Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Functions Go to Signup
function profileToggle(){ loginCol.classList.toggle("d-none"); signupCol.classList.toggle("d-none"); signupEmail.value=loginEmail.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signup(username, password) {\n // TODO: create new user\n}", "function signUp(){\r\n var email = document.getElementById(\"email\");\r\n var password = document.getElementById(\"password\");\r\n //const promise = auth.createUserWithEmailAndPassword(email.value, password.value);\r\n //promise.catch(e => alert(e.message));\r\n\r\n alert(\"Signed Up\");\r\n\r\n\r\n \r\n}", "function signup({ username, password, email, dateOfBirth, city }) {\n // TODO: create new user\n}", "function signup({ email, password, city, dateOfBirth, username }) {\n // create new user\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function signup() {\n // do something\n}", "function goSignUp() {\n \n body.innerHTML = renderSignupDiv(first, \n last, email1, pass1, '', message1);\n assignListener('signup2');\n }", "function signUp(){\n auth.createUserWithEmailAndPassword(email, password)\n .then(() => {\n ToastAndroid.show(\"Account with email \" + email + \" created successfully!\", ToastAndroid.SHORT)\n navigation.navigate(\"Main\")\n }).catch(error => {\n alert(error.message)\n })\n }", "function signUpUser(email, proctorName,proctorInstitution,\n proctorEmail,proctorPhone) {\n $.post(\"/api/newproctor\", {\n email: email,\n proctorName: proctorName,\n proctorInstitution: proctorInstitution,\n proctorEmail: proctorEmail,\n proctorPhone: proctorPhone\n }).then(function(data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n }", "function signup({userName, userPassword, userEmail, userCity}) {\n\t//do some logic\n}", "function signUpUser(email, password, car_make, name, car_model, license_plate) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n car_make: car_make,\n name: name,\n car_model: car_model,\n license_plate: license_plate\n })\n .then(() => {\n window.location.replace(\"/login\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "signUp(email, password, handle, avatar) {\n /* Create a new user and save their information */\n\n }", "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, '[email protected]');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggleAgreeToTermsAndConditions);\n I.click(this.signupLocators.signUpRegistration);\n }", "function _sign_up(){\n try{\n if(Ti.Network.online){\n Ti.Platform.openURL('http://fieldteam.com.au/signup/');\n }else{\n self.show_message(L('message_offline'),L('message_unable_to_connect'));\n return;\n }\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _sign_up');\n return;\n } \n }", "function signup() {\n\n if (usernameAvailabe && numberAvailabe && emailAvailable) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n username: username,\n email: email,\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n router.push('/aangemeld')\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n } else {\n console.log(\"Dit werkt niet\")\n }\n }", "function signUpUser(Name, Surname, DOB, PhoneNumber, Email, Password, Doctor, Address) {\n API.saveUser({\n Name,\n Surname,\n DOB,\n PhoneNumber,\n Email,\n Password,\n Doctor,\n Address\n })\n // eslint-disable-next-line no-unused-vars\n .then((data) => {\n window.location.replace('/sign-in/user');\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n // eslint-disable-next-line no-use-before-define\n .catch(handleLoginErr);\n }", "function signUp(req, res, data) {\n //extract form data\n var dataObj = querystring.parse(data),\n login = dataObj.login, pw = dataObj.pw\n //attempt to register new user\n queryDB.register(req, res, login, pw,\n function(success_msg, ct_pw){\n\t\t\t// cookieUtils.setLoginCookies(req, res, login, ct_pw) //this step will happen at login\n var context = {\n \"heading\" : success_msg,\n \"login\" : login,\n \"pw\" : ct_pw\n }\n loader.loadHTML(res, loginPath, context)\n }, function(failure_msg){\n var context = {\n \"heading\" : failure_msg\n }\n loader.loadHTML(res, loginPath, context)\n }, function(){\n console.log(\"database registration completed\")\n })\n}", "function signUpUser(firstName, lastName, dob, email, password) {\n $.post(\"/api/signup\", {\n firstName: firstName,\n lastName: lastName,\n dob: dob,\n email: email,\n password: password\n })\n .then(() => {\n // Redirect to login if successful\n loginUser(email, password);\n })\n .catch(err => {\n console.log(err);\n showLoginErrorMessage();\n });\n }", "signUp(details, success, failure) {\n this.postCall(URI.SIGNUP, details, success, failure, false);\n }", "function handleSignUp() {\n \n if (email.length < 4 || password.length < 4) {\n setFeedback({color: 'red', message: 'Mailadress/lösenord måste innehålla mer än 4 tecken.'})\n return\n }\n \n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(value) {\n \n setFeedback({color: 'green', message: \"Skapade ett konto för \" + email})\n create_db_user_doc()\n \n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code\n \n if (errorCode === 'auth/email-already-in-use')\n setFeedback({color: 'red', message: 'Ett konto med denna email finns redan.'})\n else if (errorCode === 'auth/weak-password')\n setFeedback({color: 'red', message: 'Lösenordet är för svagt.'})\n })\n }", "function signUpUser(firstname, lastname, gender, dob, email, password) {\n $.post(\"/api/signup\", {\n firstname: firstname,\n lastname: lastname,\n gender: gender,\n dob: dob,\n email: email,\n password: password,\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n }", "function signUp(){\n if (isEmpty() == false){\n messageReqiuered();\n return false\n }\n\n if (validateName() == false) {\n validationMessage();\n return false\n }\n\n if (validateEmail() == false) {\n validationMessage();\n return false\n }\n\n var user = {\n userName : signUpName.value ,\n userEmail : signUpEmail.value ,\n userPass : signUpPass.value\n }\n\n\n if (signUpContainer.length == 0) {\n \n addUser(user);\n\n return true ;\n\n }\n\n isEmailExist();\n\n if (isEmailExist() == false) {\n\n messageFailed();\n\n }else{\n \n addUser(user);\n\n }\n\n \n}", "function signUp() {\n const signupForm = document.querySelector(\"#regtab\");\n signupForm.addEventListener(\"submit\", (e) => {\n e.preventDefault();\n\n //get user info\n const email = signupForm[\"signup-email\"].value;\n const password = signupForm[\"signup-password\"].value;\n const confPassword = signupForm[\"confirm-signup-password\"].value;\n if (confPassword == password) {\n //signup the user\n auth.createUserWithEmailAndPassword(email, password).then((cred) => {\n signupForm.reset();\n });\n }\n else {\n alert(\"הסיסמאות לא תואמות, נסה שוב\");\n }\n });\n}", "function register(){\n\tusername = document.getElementById('usernameRegister').value;\n\temail = document.getElementById('emailRegister').value;\n\tpassword = document.getElementById('passwordRegister').value;\n\n\tvar registrationData = {\n \t\tdisplayName: username,\n \t\temail : email,\n \t\tpassword: password\n\t};\n\n\tvar newUser = new Stamplay.User().Model;\n\tnewUser.signup(registrationData).then(function(){\n\t\tdocument.getElementById('usernameRegister').value = \"\";\n\t\tdocument.getElementById('emailRegister').value = \"\";\n\t\tdocument.getElementById('passwordRegister').value = \"\";\n\t\twindow.location = \"home.html\";\n\t});\n}", "signup() {\n\t\tconst URIs = AccountRouter.getURIs();\n\t\tthis.router.post(URIs.signup, (request, response) => {\n\t\t\tconst username = request.body.username,\n\t\t\t\t\t\tpassword = request.body.password;\n\n\t\t\t// Preventing send request to firebase, if you information is not valid.\n\t\t\tif (!username || !password) {\n\t\t\t\treturn response.json(AccountRouter.getSignedError('no username or password'));\n\t\t\t}\n\n\t\t\t// Try to login user in firebase.\n\t\t\tthis.users.child(username).once('value', (snapshot) => {\n\t\t\t\tif (snapshot.exists()) {\n\t\t\t\t\treturn response.json(AccountRouter.getSignedError('username already in use'));\n\t\t\t\t}\n\n\t\t\t\tconst userObject = {\n\t\t\t\t\t'username': username,\n\t\t\t\t\t'passwordHash': AccountRouter.hash(password)\n\t\t\t\t};\n\n\t\t\t\t// Add a new user to Firebase collection.\n\t\t\t\tthis.users.child(username).set(userObject);\n\n\t\t\t\trequest.session.user = userObject;\n\n\t\t\t\tresponse.json(AccountRouter.createUserSignObject(userObject));\n\t\t\t});\n\t\t});\n\t}", "function signUpUser({\n firstName,\n lastName,\n email,\n password,\n intOne,\n intTwo,\n intThree\n }) {\n console.log(\"firstName:\", firstName);\n $.post(\"/api/signup\", {\n firstName: firstName,\n lastName: lastName,\n email: email,\n password: password,\n intOne: intOne,\n intTwo: intTwo,\n intThree: intThree\n })\n .then(res => {\n console.log(res);\n window.location.replace(\n \"/members/:\" + intOne + \"/:\" + intTwo + \"/:\" + intThree\n );\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function signUp(firstname, lastname, email, pass) {\n $.post('core/action-design.php', {\n 'act': 'signup',\n 'a': firstname,\n 'b': lastname,\n 'c': email,\n 'd': pass\n })\n .success(function(data) {\n if (data == 1) {\n info('<label style=\"color:green\">Sign up Success, please verify your email</label>');\n $('.box-signup').animate({\n 'top': '-350'\n });\n } else {\n info('<label style=\"color:red\">Sign up fail, please try again</label>');\n }\n });\n }", "function signUpUser(firstName, lastName, email, password) {\n\t\t$.post(\"/api/signup\",\n\t\t\t// userData{}\n\t\t\t{\n\t\t\t\tfirstName: firstName,\n\t\t\t\tlastName: lastName,\n\t\t\t\temail: email,\n\t\t\t\tpassword: password\n\t\t\t}\n\t\t)\n\t\t\t.then(function (data) {\n\t\t\t\twindow.location.replace(\"/createList\");\n\t\t\t\t// If there's an error, handle it by throwing up a bootstrap alert\n\t\t\t})\n\t\t\t.catch(handleLoginErr);\n\t}", "function signUpUser(userName, passWord, firstName, lastName) {\n $.post(\"/api/signup\", {\n userName: userName,\n passWord: passWord,\n firstName: firstName,\n lastName: lastName\n }).then(function(data) {\n console.log(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n\n }", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "signUpUser(data) {\n return this.post('signup', data);\n }", "function createUser() {}", "function signup(req, res) {\n return res.send('Post signUp');\n}", "function signUpUser(email, password, pet_types, pet_names) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n pet_types: pet_types,\n pet_names: pet_names\n }).then(function (data) {\n window.location.replace('/');\n // If there's an error, handle it by throwing up a boostrap alert\n\n //hide or empty the add member button and the new member form after creating a member\n\n $(\"button#newMembers\").hide();\n\n\n\n\n }).catch(handleLoginErr);\n\n }", "function signupDetails() {\n if(firstName && lastName && email && password){\n\n let data = {\n signupDetails: { firstName, lastName, email, password }\n }\n axios.post(`${serverURL.server_base_URL}/users/signup`, data)\n .then(signupDetails => {\n if (signupDetails.status) {\n dispatch({\n type: \"setUserId\",\n payload: signupDetails.data.user._id,\n })\n navigation.navigate(\"Signin\")\n }\n })\n .catch(err => {\n console.log(\"Error in creating account\", err)\n })\n }\n else{\n alert(\"Please fill out all the fields.\")\n }\n }", "signUp(email, password, handle, avatar) {\n window.alert(\"Signing up:\", email, 'with handle', handle);\n }", "async signUp(req, res, next) {\n try {\n const { usbId, name, email, type, chief, clave } = req.body;\n const registro = await usersService.registerUser(\n usbId,\n name,\n email,\n type,\n chief,\n clave\n );\n res.json({ auth: true, token: registro });\n } catch (err) {\n res.status(500).json({ error: `Hubo un error en el servidor` });\n next(err);\n }\n }", "static async signup() {\n let email = rl.questionEMail(chalk.bold(\"Email: \"));\n let password = rl.questionNewPassword(chalk.bold('Password: '), {\n mask: '', \n min: 6,\n confirmMessage: \"Enter the same password again: \",\n unmatchMessage: \"Passwords did not match. Try again. To re-enter the first password, input only Enter.\",\n limitMessage: \"Password must be at least 6 characters. Please try again.\"\n });\n let errorCode;\n let errorMessage;\n spinner = ora(\"Signing up...\").start();\n await firebase.auth().createUserWithEmailAndPassword(email, password).catch((error) => {\n errorCode = error.code;\n errorMessage = error.message;\n }).then(async () => {\n let checkUser = firebase.auth().currentUser;\n if(checkUser){\n let name = checkUser.email.substring(0, checkUser.email.indexOf(\"@\"));\n let newUser = await UserService.createUser(checkUser.uid, name, checkUser.email);\n spinner.succeed(chalk.green(\"New user created: \", newUser.name));\n }\n else {\n spinner.fail(chalk.red(\"Failed to create user...\"));\n if(errorCode == 'auth/email-already-in-use')\n console.log(chalk.red(\"Email in use\"));\n else \n console.log(chalk.red(errorMessage));\n }\n });\n }", "function handleSignUp(event) {\r\n event.preventDefault();\r\n var email = document.getElementById('user-email').value;\r\n var password = document.getElementById('user-password').value;\r\n if (email.length < 4) {\r\n bootbox.alert('Please enter an email address.');\r\n return;\r\n }\r\n if (password.length < 4) {\r\n bootbox.alert('Please enter a valid password.');\r\n return;\r\n }\r\n // Sign in with email and pass.\r\n // [START createwithemail]\r\n \r\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\r\n \r\n // Handle Errors here.\r\n var errorCode = error.code;\r\n var errorMessage = error.message;\r\n // [START_EXCLUDE]\r\n if (errorCode == 'auth/weak-password') {\r\n bootbox.alert('The password is too weak.');\r\n } else {\r\n bootbox.alert(errorMessage);\r\n }\r\n // [END_EXCLUDE]\r\n });\r\n // [END createwithemail]\r\n }", "function signup(){\n username = document.getElementById(\"userNameInput\").value;\n password = document.getElementById(\"passWordInput\").value;\n postReq(username, password);\n}", "function signUpUser(email, password, userName, location, interest, aboutMe, available) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n username: userName,\n location: location,\n interest: interest,\n aboutMe: aboutMe,\n available: available\n })\n .then(function(data) {\n\n \n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(function(err){\n if(err.responseJSON.name === \"SequelizeUniqueConstraintError\"){\n handleLoginErr(\"E-mail already exists\");\n }\n else{\n handleLoginErr(\"Something went wrong. Please try later!\");\n }\n });\n }", "register({ username, email, firstName, lastName, password }) {\n return apiClientEmail.post('/user', {\n username,\n email,\n firstName,\n lastName,\n password,\n })\n }", "function Registrar(){\r\n if(txtCor.value==\"\" || txtCor.value==null){\r\n alert(\"Ingrese el correo\");\r\n txtCor.focus();\r\n }else if(txtCon.value==\"\" || txtCon.value==null){\r\n alert(\"Ingrese la contraseña\");\r\n txtCon.focus();\r\n }else{\r\n var cor=txtCor.value;\r\n var con=txtCon.value;\r\n \r\n auth.createUserWithEmailAndPassword(cor,con)\r\n .then((userCredential) => {\r\n alert(\"Se registro el usuario\");\r\n Limpiar();\r\n })\r\n .catch((error) =>{\r\n alert(\"No se registro el usuario\");\r\n var errorCode = error.code;\r\n var errorMessage = error.message;\r\n });\r\n\r\n }\r\n}", "function signUp() {\n if (password == repeat) {\n setLoading(true);\n databaseSignUp(username, password, signUpCallback, showError);\n } else {\n setError(\"Passwords do not match\");\n setLoading(false);\n }\n }", "async function signup(evt) {\n console.debug(\"signup\", evt);\n evt.preventDefault();\n\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger(\"reset\");\n}", "async function signup(evt) {\n try {\n console.debug('signup', evt);\n evt.preventDefault();\n\n const name = $('#signup-name').val();\n const username = $('#signup-username').val();\n const password = $('#signup-password').val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger('reset');\n } catch (e) {\n if (e.response.status === 409) {\n $signupForm.trigger('reset');\n alert('Username has already been taken');\n }\n }\n}", "function registrar(email ,password){\n\n firebase.auth().createUserWithEmailAndPassword(email,password).then((result)=> {\n firebase.auth().signInWithEmailAndPassword(email,password).then((result2)=> {\n window.location.hash = \"#welcome\";\n}) \n})\n.catch( function(error) {\nconst errorCode = error.code;\nconst errorMessage = error.message;\n});\n}", "function createUser() {\n return UserDataService.signup(props.onLogin, setValidation, values);\n }", "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "handleSignUp() {\n const { username, password, email, phoneNumber, firstName, lastName } = this.state;\n this.props.attemptSignUp(Auth, username, password, email, ('+1' + phoneNumber), firstName, lastName)\n }", "signIn() {}", "async function signup(evt) {\n evt.preventDefault();\n try {\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n currentUser = await User.signup(username, password);\n favTeam = await User.getPrefs(currentUser.userId);\n\n $signupForm.trigger(\"reset\");\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n } catch (err) {\n console.log(err.response.data.message);\n if (err.response.data.message == \"taken\") {\n $message.show();\n $message.text(\"That username is already taken\");\n } else {\n $message.show();\n $hint.show();\n $message.text(\"That username/password is invalid.\");\n }\n }\n}", "signUp(values, success, failure) {\n ApolloService.mutate({\n mutation: Mutations.SIGN_UP,\n variables: values\n }).then(data => { success(data.data.signUp) })\n .catch(error => failure(error));\n }", "async function signUp(name, email, phone, password, street, number, neighborhood, reference) {\n setLoadingAuth(true);\n await firebase.auth().createUserWithEmailAndPassword(email, password)\n .then( async (value) => {\n let uid = value.user.uid;\n await firebase.database().ref('users').child(uid).set({\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n })\n .then(() => {\n let data = {\n uid: uid,\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n };\n setUser(data);\n storageUser(data);\n setLoadingAuth(false);\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(function(data) {\n //window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n location.assign(\"/login\");\n console.log(data);\n })\n .fail(handleLoginErr);\n }", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function Signup() {\n var email = document.getElementById(\"email_sg\").value\n var password = document.getElementById(\"password_sg\").value\n\n var name = document.getElementById(\"name_sg\").value;\n\n\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Create user with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password)\n .then((userCredential) => {\n // Signed in \n var user = userCredential.user.uid;\n setCookie(\"userId\",user,1);\n var obj = {\"name\": name, \"Email\": email, \"Passwords\": password, \"Task list\": {},\n \"Task Done\": 0, Timing: (new Date()), \"Rating\": 0, \"Last Submit\": (new Date())};\n\n writeData((\"users/\"+user), obj);\n window.location.href = \"./index.html\";\n\n // ...\n }).catch(function (error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n });\n }", "signup(e) {\n e.preventDefault();\n signupUser(this.state.email, this.state.password);\n }", "function signup(form, email, password) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar passwordValue = document.getElementById(password).value;\n\t\n\tfirebase.auth().createUserWithEmailAndPassword(emailValue, passwordValue)\n\t\t.then(function() {\n\t\t\t// Redirect to home\n\t\t\twindow.location.href=\"/members/\"\n\t\t\t// form.submit()\n\t\t})\n\t\t.catch(function(error) {\n\t\t // Handle Errors here.\n\t\t var errorCode = error.code;\n\t\t var errorMessage = error.message;\n\t\t return errorCode;\n\t\t});\n}", "static async signup(req, res, next) {\n const password = req.header(\"x-password\");\n const { cellPhoneNumber, email, DDD, name, username, photos } = req.body;\n if (\n cellPhoneNumber == \"\" ||\n email == \"\" ||\n DDD == \"\" ||\n name == \"\" ||\n username == \"\"\n ) {\n return res\n .send({\n Error: \"Check if the fields is not empty\",\n })\n .status(406);\n } else {\n try {\n const find = await UsersService.getUsersByEmail(email);\n if (find[0]) {\n return res.status(406).send({ \"User already registered\": true });\n }\n const hash = await Crypt.generateHash(password);\n const upload = await Upload.uploadPhoto(photos);\n await UsersService.createUser(\n cellPhoneNumber,\n DDD,\n name,\n username,\n hash,\n email,\n upload\n );\n const token = await Crypt.generateToken(email);\n return res\n .header({ \"x-auth-token\": token })\n .send({ \"User registered\": true });\n } catch (err) {\n next(err);\n }\n }\n }", "function register() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n var pass2 = $(\"#confirmPasswordFld\").val();\r\n if (pass == pass2 && username.length > 0) {\r\n console.log(\"Registering \" + username + \":\" + pass);\r\n userService.register(username, pass).then(goToProfile,\r\n function(resp) {\r\n console.log(\"no login\" + resp);\r\n }\r\n )\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }", "function OpCreateAccount(evnt) {\n let username = document.getElementById('v-new-username').value.trim();\n let passwd = document.getElementById('v-new-password').value.trim();\n let useremail = document.getElementById('v-new-email').value.trim();\n\n // Logg('username=' + username + ', email=' + useremail);\n\n if (username.length < 1 || passwd.length < 2 || useremail.length < 5) {\n DisplayAccountError('You must specify a value for all three account fields');\n return;\n }\n\n CreateUserAccount(username, passwd, useremail)\n .then( () => {\n GetUserAccessToken(username, passwd)\n .then( accountTokenInfo => {\n GetDomainToken(accountTokenInfo)\n .then( domainToken => {\n DisplayDomainToken(domainToken);\n })\n .catch ( err => {\n DisplayError('Could not fetch domain token: ' + err);\n });\n })\n .catch ( err => {\n DisplayError('Could not fetch account token: ' + err);\n });\n })\n .catch ( err => {\n DisplayError('Could not create account: ' + err);\n });\n }", "async function createAccount() {\n user.signUp()\n .then(response => {\n if (typeof document !== 'undefined') return document.write('Signed up successfully!');\n console.log('Signed up user', response);\n }).catch( error => {\n if (typeof document !== 'undefined') return document.write(`Error while signing up: ${JSON.stringify(error)}`);\n console.log('Error while signing up', error)\n });\n}", "register(firstName, lastName, email, password){\n return $.post(\n this.REGISTRATION_URL,\n {\n user : {\n first_name: firstName,\n last_name: lastName,\n email: email,\n password: password\n }\n }\n );\n }", "function signUp() {\n\tconsole.log(\"Sign Up Button Pressed.\");\n\t//grab the inputs\n\tvar name = $(\"input:text[name=signUpName]\").val().trim();\n\tvar pass = $(\"input:password[name=signUpPassword]\").val().trim();\n\tvar passConfirm = $(\"input:password[name=signUpPasswordConfirm]\").val().trim();\n\n\t// For testing\n\t//console.log(name, pass);\n\n\t// If the passwords match post to users API route\n\tif (pass === passConfirm){\n\n\t\tvar userInfo = {\n\t\t\tsignUpName: name,\n\t\t\tsignUpPassword: pass,\n\t\t\tsignUpPasswordConfirm: passConfirm\n\t\t}\n\t\t\n\t\t//=-=-=-=-=-=-=-=\n\t\t$.post(\"/api/user/signup\", userInfo)\n \t.then(function(data){\n \t\tconsole.log(\"Sent user info: \" + userInfo);\n \t\tif (data.error)\n \t\t\t$(\"input:text[name=signUpName]\").val(data.error);\n\n \t\tif (data.success)\n \t\t\twindow.location = data.redirectTo;\n \t\t\n \t});\n\t\t//=-=-=-=-=-=-=-=\n\t\n\t} else {\n\t\t$(\"input:text[name=signUpName]\").val(\"\");\n\t\t$(\"input:password[name=signUpPassword]\").val(\"\");\n\t\t$(\"input:password[name=signUpPasswordConfirm]\").val(\"\");\n\t\tconsole.log(\"Passwords do not match\");\n\t}\n}", "function signUpUser(email, username, password, emailable, profileUrl) {\n $.post(\"/api/signup\", {\n email: email,\n username: username,\n password: password,\n emailable: emailable,\n profileUrl: profileUrl\n })\n .then(function(data) {\n window.location.replace(\"/home\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function handleSignUp() {\n console.log(\"signup\");\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function (error) {\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n });\n }", "async function onSignup(e) {\n if(!isEqual()) return;\n if(!hasSixUniqueChars()) return;\n await submitUserDetails('auth/signup').then(\n result => processResult(result)).catch(err => {\n console.log(err); e.preventDefault()})\n redirectToChat() ||\n redirect(`${HOME}`);\n}", "function signUp(name, username, password, code){\n\n if (typeof code == \"undefined\")\n code = \"none\";\n\n $.ajax({\n method: \"POST\",\n url: \"/api/account/create\",\n contentType: \"application/json\",\n data: JSON.stringify({ name: name, username: username, password: password, type : userType, code: code })\n }).done(function(response){\n // console.log(response);\n\n if (response.status == \"success\"){\n Cookies.set('token', response.data.token, { expires: 7 });\n window.location.href = '/dashboard';\n } else {\n handleError(response.error);\n }\n\n });\n\n }", "async submitFullSignup(){\n const {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber} = this.state\n const data = {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber}\n\n const createdAccount = await this.context.signup({...data})\n\n if(createdAccount){\n const logged = await this.context.login(signupEmail, signupPw)\n\n if(logged){\n const {base} = this.props.match.params\n if(base === 'login'){ this.props.history.push('/minhaconta') }\n return\n }\n\n // $('.form-signup').trigger('reset')\n // $('.form-full-signup').trigger('reset')\n\n // $('.form-login').show()\n // $('.form-recovery').hide()\n\n // $('.switcher-login').trigger('click')\n // $('#signup-back').trigger('click')\n\n // alert('Sua conta foi criada com sucesso.')\n }\n\n $('#full-signup .error-message').text(\"Ocorreu um erro. Tente mais tarde.\")\n\n return\n }", "function handleSignUp() {\n var handleSignUpResult = true;\n //\n checkSignUpForm();\n /*\n var email = document.getElementById('inputEmail').value;\n var password = document.getElementById('inputPassword').value;\n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n handleSignUpResult = false;\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/email-already-in-use') {\n showErrorModal(\"已經有相同帳號存在於資料庫中\");\n } else if (errorCode == 'auth/invalid-email') {\n showErrorModal(\"信箱位址不合法\");\n } else if (errorCode == 'auth/operation-not-allowed') {\n showErrorModal(\"帳號已經被停用\");\n } else if (errorCode == 'auth/weak-password') {\n showErrorModal(\"密碼強度太弱,請重新輸入\");\n }\n console.log(error);\n });\n */\n\n $('.ui.basic.modal.loadiinngg').modal('show');\n\n // 這邊要延遲一段時間之後再執行,要等到 firbase 那邊有回傳\n var delay = 2000; //1 second\n setTimeout(function() {\n if (handleSignUpResult == true) {\n registerSuccessful();\n }\n }, delay);\n}", "async createAccount() {\n\n await (await this.lnkSignIn).click();\n\n await (await this.lnkCreateAccount).click();\n\n await (await this.txtFirstName).setValue(\"rajesh\");\n\n await (await this.txtLastName).setValue(\"sharman\");\n\n await (await this.txtEmail).setValue(\"[email protected]\");\n\n await (await this.btnCreate).click();\n\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function handleSignUp() {\n var email = document.getElementById('new-login').value;\n var password = document.getElementById('new-senha').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(user) {\n var user = firebase.auth().currentUser;\n updateUserProfile();\n firebaseConnection.database().ref(user.uid).set(\n {\n 'familiars':{\n 1:{'email':user.email, 'uid':user.uid}\n }\n });\n }, function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n}", "function signUpUser(userInfo) {\n $.post(\"/api/signup\", {\n firstName: userInfo.firstName,\n lastName: userInfo.lastName,\n email: userInfo.email,\n password: userInfo.password\n }).then(function(data) {\n window.location.reload();\n console.log(\"signed up\");\n }).catch(handleLoginErr);\n }", "function signInOrSignUp(successCallback) {\n\tvar emailElement = d3.select(\"input[name=email]\");\n\tvar email = emailElement.property(\"value\");\n\tvar passwordElement = d3.select(\"input[name=password]\");\n\tvar password = passwordElement.property(\"value\");\n\tvar signIn = d3.select(\"input[name=operation]\").property(\"value\") === \"sign-in\";\n\n\t// Check for presence of email\n\tif(tp.util.isEmpty(email) || !validEmail(email)) {\n\t\ttp.dialogs.showDialog(\"errorDialog\", tp.util.isEmpty(email) ? \"#email-empty\" : \"#email-invalid\")\n\t\t\t.on(\"ok\", function() {\n\t\t\t\temailElement.node().select();\n\t\t\t})\n\t\t;\n\t\treturn;\n\t}\n\n\t// Handle sign in or sign up\n\tif(signIn) {\n\n\t\t// Check password\n\t\tif(tp.util.isEmpty(password)) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#no-credentials\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tpasswordElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\t\tif(password.length < 6) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tpasswordElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\n\t\t// Sign in\n\t\tvar rememberMe = d3.select(\"input[name=persist-sign-in]\").property(\"value\") === \"remember-me\";\n\t\tvar expires = rememberMe ? \"false\" : \"true\";\n\t\tvar currentLanguage = tp.lang.default;\n\t\ttp.session.signIn(email, password, expires, function(error, data) {\n\t\t\tif(error) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#wrong-credentials\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tpasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle successful sign in\n\t\t\ttp.session.setHasAccount();\n\t\t\ttp.session.loadSettings('user.settings', function(error, settings) {\n\t\t\t\tif(!error) {\n\t\t\t\t\ttp.lang.setDefault(settings.lang);\n\t\t\t\t}\n\t\t\t\tif(applicationRequested) {\n\t\t\t\t\tdoNavigate(applicationRequested);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(successCallback) {\n\t\t\t\tsuccessCallback();\n\t\t\t}\n\t\t});\n\t} else {\n\n\t\t// Check for same passwords\n\t\tvar password = d3.select(\"input[name=password]\").property(\"value\");\n\t\tvar verifyPassword = d3.select(\"input[name=password-verify]\").property(\"value\");\n\t\tif(tp.util.isEmpty(password) || password.length < 6) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tpasswordElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\t\tif(password !== verifyPassword) {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#passwords-different\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tpasswordElement.node().select();\n\t\t\t\t})\n\t\t\t;\n\t\t\treturn;\n\t\t}\n\n\t\t// Sign up\n\t\ttp.session.createAccount(email, password, function(error, data) {\n\t\t\tif(error) {\n\t\t\t\tconsole.error(error, data);\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#account-add-failed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle successful sign up\n\t\t\ttp.dialogs.showDialog(\"messageDialog\", \"#activation-mail-sent\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tif(successCallback) {\n\t\t\t\t\t\tsuccessCallback();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\t\t});\n\t}\n}", "function activateSignup() {\n activateNewAccount(true)\n\n }", "signUp() {\n const email = document.querySelector('.signup_form_mail').value;\n const password = document.querySelector('.signup_form_pass').value;\n auth.createUserWithEmailAndPassword(email, password).then(cred => {\n signupForm.reset();\n document.location.reload(true);\n })\n .catch(err => {\n console.log(err.message);\n });\n }", "function register() {\n const username = (document.querySelector(\"#username\").value);\n const password = (document.querySelector(\"#password\").value);\n const email = (document.querySelector(\"#email\").value);\n\n if (checkMatches(username, password, email) !== false) {\n putRegisterHTTPRequest(username, email, password);\n }\n}", "function signup(signupInfo) {\n console.log('signupinfo',signupInfo)\n return usrService.signupUser(signupInfo)\n .then((result) => {\n return result;\n });\n}", "function signup(username, password, name) {\n fetch('/signup', {\n method: 'post',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username: username,\n password: password,\n name: name\n })\n })\n .then(res => {\n if (!res.ok) throw Error(res.statusText);\n return;\n })\n .then(() => console.log('signup', username));\n}", "SignUp(email, password) {\n return this.afAuth.auth.createUserWithEmailAndPassword(email, password).then((result) => {\n /* Call the SendVerificaitonMail() function when new user sign\n up and returns promise */\n this.SendVerificationMail().then(r => { });\n this.SetUserData(result.user);\n }).catch((error) => {\n window.alert(error.message);\n });\n }", "SignUpForm(data, files, pw) {\n return this.knex(\"users\").insert({\n buyer: data.buyer,\n seller: data.seller,\n businessname: data.businessName,\n district: data.district,\n address: data.address,\n name: data.name,\n phone_no: data.phone,\n email: data.email,\n password: pw,\n certfile: files.certFile,\n businesscert: files.businessCert,\n });\n }", "function createUser(firstname, lastname, username, password) {\n let person = new UserSignUp(firstname, lastname, username, password);\n ajax(\"PUT\", \"/auth\", isCreateUserOk, person);\n}", "async signUp({ request, auth, response }) {\n const email = request.input(\"email\"); \n let userCheck = await User.findBy(\"email\", email);\n \n if (userCheck) {\n return _RL.existConflict(response,Antl.formatMessage('messages.userExists'));\n }\n \n let user = new User();\n user.firstName = request.input(\"firstName\");\n user.lastName = request.input(\"lastName\");\n user.email = email;\n user.password = request.input(\"password\");; \n user.accountType = request.input(\"accountType\"); \n user.deviceToken = request.input('deviceToken'); \n \n let user1 = await user.save();\n let thisuser = await User.findBy(\"email\", email);\n let accessToken = await auth.generate(thisuser);\n let tokenStore = new Token();\n tokenStore.user_id = thisuser.id;\n tokenStore.token = accessToken.token;\n tokenStore.type = accessToken.type;\n tokenStore = await tokenStore.save();\n \n let data = {\n user: user,\n accessToken: accessToken\n };\n return _RL.recordCreated(response,Antl.formatMessage('messages.register'),data);\n }", "function create_account(){\n\tverify_admin().then(function(res){\n\t\tvar usertype = (res===\"Valid admin key\") ? \"admin\" : \"gamer\";\n\t\tverify_user().then(function(){\n\t\t\tverify_email().then(function(){\n\t\t\t\tvalid_password().then(function(){\n\t\t\t\t\tregister_user(usertype).then(function(){\n\t\t\t\t\t\tvar input = {\n\t\t\t\t\t\t\t\t\t\t\tusername: $(\"#registeruser\").val()\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tvar params = {\n\t\t\t\t\t\t\t\t\t\t\tmethod: \"PUT\",\n\t\t\t\t\t\t\t\t\t\t\turl: \"/api/stats/\",\n\t\t\t\t\t\t\t\t\t\t\tdata: input\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t$.ajax(params).done(function(data) {\n\t\t\t\t\t\t\tconsole.log($(\"#registeruser\").val()+\" registered into Warehouse Wars!\");\n\t\t\t\t\t\t\tset_local($(\"#registeruser\").val());\n\t\t\t\t\t\t\tset_update();\n\t\t\t\t\t\t\tcurrent_stage=\"stage\";\n\t\t\t\t\t\t\tswitch_stage();\n\t\t\t\t\t\t}).fail(function(err) {\n\t\t\t\t\t\t\tconsole.log($(\"#registeruser\").val()+\" failed to register into Warehouse Wars!\");\n\t\t\t\t\t\t});\n\t\t\t\t\t}).catch(function (err) {\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t})\n\t\t\t\t}).catch(function (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t})\n\t\t\t}).catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t})\n\t\t}).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t})\n\t}).catch(function (err) {\n\t\tconsole.log(err);\n\t});\n}", "function signIN() {\n\tvar database = firebase.database();\n\tvar form = document.getElementsByClassName(\"short\");\n\tconsole.log(form[0].value);\n\tfirebase.auth().createUserWithEmailAndPassword(form[1].value, form[3].value).then(function () {\n\t\tconsole.log(\"OK\");\n\t\tvar user = firebase.auth().currentUser;\n\t\thideAndShow(\"tenth\");\n\t\t/*\tuser \t\n\t\t\t\t\tname:form[0].value,\n\t\t\t\t\tteam: form[2].value,\n\t\t\t\t\temail: form[1].value*/\n\t\tuser.updateProfile({\n\t\t\tdisplayName: form[0].value\n\n\t\t}).then(function () {\n\t\t\t// Update successful.\n\t\t}).catch(function (error) {\n\t\t\t// An error happened.\n\t\t});\n\n\t}).catch(function (error) {\n\t\t// Handle Errors here.\n\t\tvar errorCode = error.code;\n\t\tvar errorMessage = error.message;\n\t\tconsole.log(\"BAD\");\n\t\t// ...\n\t});\n}", "function userSignup(req, cb){\n var email = req.body['email'];\n log.info(\"user signup: \" + email);\n var name = req.body['name'];\n var pass = req.body['pass'];\n if(!email || !name || !pass) return cb(errorsList['parameter-missing']);\n email = email.toLowerCase();\n var logindata = {\n email : email,\n pass : pass,\n name : name\n };\n users.addNewAccount(logindata, function(err,data){\n log.info(\"account signup \" + (err?\"failed\":\"succeed\") + \": \" + email);\n cb(err,data);\n });\n}", "function signup() {\r\n try {\r\n if (!dw.system.Site.getCurrent().getCustomPreferenceValue(\"emarsysEnabled\")) {\r\n emarsysDisabledTemplate();\r\n return;\r\n }\r\n // clear form\r\n app.getForm('emarsyssignup').clear();\r\n // render the Submit Form\r\n app.getView({\r\n ContinueURL: URLUtils.https('EmarsysNewsletter-SubmitForm')\r\n }).render('subscription/emarsyssignup');\r\n } catch(e) {\r\n errorPage(e);\r\n }\r\n}", "function sign_up() {\n // let user_info = {\n // username : username,\n // email : email,\n // password : password,\n // password2 : password2\n // };\n // console.log(user_info);\n\n // axios.post('/server_app/sign_up', user_info)\n // .then(response => {\n // // sucessful response\n // console.log(\"Response: \", response.data);\n // })\n // .catch(error => {\n // console.error('Error: ', error);\n // });\n\n axios.get('https://nazim-django-server.herokuapp.com/hello')\n .then(response => {\n // sucessful response\n console.log(\"Response: \", response.data);\n })\n .catch(error => {\n console.error('Error: ', error);\n });\n\n }", "signIn(email, password) {\n /* Sign in the user */\n\n }", "signup(req, res) {\n User.create(req.body, (err, user) => {\n if (err) return res.status(500).send(err.message);\n response = {success: true, message: 'User created.', user: user};\n return res.status(200).json(response);\n });\n }", "function signUp() {\r\n\t// Clear any previous server errors\r\n\tclear(\"sign-up-errors\");\r\n\r\n\t// Get the values from the form fields\r\n\tvar username = $(\"#newUsername\").val();\r\n\tvar password = $(\"#newPassword\").val();\r\n\tvar termsAccepted = $(\"#termsAccepted\").is(\":checked\");\r\n\r\n\t// Validate the business rules\r\n\tvalidateRequired(\"newUsername\", \"error.username\");\r\n\tvalidateRequired(\"newPassword\", \"error.password\");\r\n\r\n\tvalidateEmailFormat(\"newUsername\", \"error.username.format\");\r\n\r\n\t// Validate the acceptance of the terms for the \"Beta\" brand only\r\n\tif (brand == \"Beta\") {\r\n\t\tvalidateRequiredCheckbox(\"termsAccepted\", \"terms-error-msg\");\r\n\t}\r\n\r\n\t// Create the data model to be sent\r\n\tvar user = {\r\n\t\tusername : username,\r\n\t\tpassword : password,\r\n\t\ttermsAccepted : termsAccepted\r\n\t};\r\n\r\n\t// Post the request to the server\r\n\tpost(signUpUrl, user, signUpSuccess, signUpError);\r\n}", "function signUp(){\n var userFullName = document.getElementById(\"userFullName\").value;\n var userSurname = document.getElementById(\"userSurname\").value;\n var userEmail = document.getElementById(\"userEmail\").value;\n var userPassword = document.getElementById(\"userPassword\").value;\n var userFullNameFormate = /^([A-Za-z.\\s_-])/; \n var userEmailFormate = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n var userPasswordFormate = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{10,}/; \n\n var checkUserFullNameValid = userFullName.match(userFullNameFormate);\n var checkUserEmailValid = userEmail.match(userEmailFormate);\n var checkUserPasswordValid = userPassword.match(userPasswordFormate);\n\n if(checkUserFullNameValid == null){\n return checkUserFullName();\n }else if(userSurname === \"\"){\n return checkUserSurname();\n }else if(checkUserEmailValid == null){\n return checkUserEmail();\n }else if(checkUserPasswordValid == null){\n return checkUserPassword();\n }else{\n firebase.auth().createUserWithEmailAndPassword(userEmail, userPassword).then((success) => {\n var user = firebase.auth().currentUser;\n var uid;\n if (user != null) {\n uid = user.uid;\n }\n var firebaseRef = firebase.database().ref();\n var userData = {\n userFullName: userFullName,\n userSurname: userSurname,\n userEmail: userEmail,\n userPassword: userPassword,\n }\n firebaseRef.child(uid).set(userData);\n swal('Your Account Created','Your account was created successfully, you can log in now.',\n ).then((value) => {\n setTimeout(function(){\n window.location.replace(\"../index.html\");\n }, 1000)\n });\n }).catch((error) => {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n swal({\n type: 'error',\n title: 'Error',\n text: \"Error\",\n })\n });\n }\n}", "function sUp() {\n var email = document.getElementById('email').value\n var password = document.getElementById('password').value\n firebase\n .auth()\n .createUserWithEmailAndPassword(email, password)\n .then(() => {\n $('#msg').html('You account was created. Please Sign In')\n })\n .catch(function (error) {\n console.log(error.code)\n console.log(error.message)\n $('#msg').html(error.message)\n })\n //console.log(email);\n}", "function registratioon() {\r\n\r\n var Email = email.value;\r\n var Password = password.value;\r\n\r\n firebase.auth().createUserWithEmailAndPassword(Email, Password).then(function (sucess) {\r\n\r\n alert(\"Your Email is sucessfully register\" + sucess.message);\r\n\r\n redirexted()\r\n\r\n\r\n }).catch(function (error, message) {\r\n alert(error.message);\r\n\r\n });;\r\n}", "function signUpUser(userData) {\n $.post(\"/api/signup\", {\n email: userData.email,\n password: userData.password,\n minLength: userData.minLength,\n maxLength: userData.maxLength,\n maxAscent: userData.maxAscent\n })\n .then(() => {\n window.location.replace(\"/members\");\n })\n .catch(handleLoginErr);\n }", "signUp() {\n\t\tipcRenderer.send('openSignUp', true);\n\t}", "function signup(req, res) {\n\t// Local DB variable\n\tvar db = req.db;\n\n\t// Get form values\n\tvar userName = req.body.username;\n\tvar userPass = req.body.userpass;\n\tvar userSteamId = req.body.steamid;\n\n\n\t// Confirm that the username doesn't already exist (should be checked already)\n\tdb.hexists(\"users\", userName, function(err, reply) {\n\t\tif (reply) {\n\t\t\t// Already exists, throw error\n\t\t\tconsole.log(\"User already exists\");\n\t\t\tres.render('index', {failSignup: \"Username is unavailable.\"});\n\n\t\t} else {\n\t\t\tconsole.log(\"Username is available\");\n\n\t\t\t// Add user\n\t\t\tdb.get(\"NEXT_USER_ID\", function(err, reply) {\n\t\t\t\tdb.incr(\"NEXT_USER_ID\");\n\t\t\t\tvar newUserId = reply;\n\t\t\t\tconsole.log(\"new user ID number is \"+newUserId);\n\t\t\t\tdb.hset(\"users\", userName, newUserId);\n\t\t\t\t\n\t\t\t\tvar currentTime = new Date().getTime();\n\t\t\t\tdb.hmset(\"user:\"+newUserId, {\n\t\t\t\t\t\"username\" : userName,\n\t\t\t\t\t\"steam_id\" : userSteamId,\n\t\t\t\t\t\"password\" : userPass,\n\t\t\t\t\t\"date_created\" : currentTime\n\t\t\t\t});\n\n\t\t\t\tlogin(req, res);\n\n\t\t\t});\n\t\t}\n\t\t\n\t});\n}" ]
[ "0.7787759", "0.76665205", "0.76568913", "0.7620571", "0.7596127", "0.7596127", "0.7474521", "0.74422026", "0.7407385", "0.73960644", "0.7393686", "0.7358576", "0.7355898", "0.73410326", "0.73321825", "0.73268634", "0.73255634", "0.73199177", "0.7286087", "0.72587436", "0.72463775", "0.7235227", "0.7233734", "0.7223964", "0.7205114", "0.71993864", "0.7193735", "0.7182303", "0.7136776", "0.7134091", "0.71241075", "0.7106918", "0.70950717", "0.7093534", "0.70869744", "0.7078616", "0.70779496", "0.70746166", "0.7068796", "0.70265424", "0.70237446", "0.70112574", "0.7008932", "0.6992973", "0.6989736", "0.6984895", "0.69602376", "0.6957364", "0.69501346", "0.69497", "0.69480145", "0.6937185", "0.69359076", "0.69296277", "0.6926541", "0.6920201", "0.6919296", "0.691871", "0.69162256", "0.69131064", "0.6912659", "0.6907269", "0.69071096", "0.69056785", "0.6904248", "0.6900819", "0.68879", "0.6885515", "0.68833303", "0.6882157", "0.68811494", "0.6879355", "0.68787956", "0.68769026", "0.68769026", "0.68623865", "0.68501496", "0.68451875", "0.6845058", "0.6841046", "0.68404245", "0.6833239", "0.6832053", "0.68291944", "0.6827819", "0.68252856", "0.6818849", "0.6817864", "0.6817856", "0.6817783", "0.6816237", "0.6813341", "0.6808768", "0.6801091", "0.67958397", "0.6786375", "0.6785798", "0.67845035", "0.67797595", "0.67744464", "0.67703706" ]
0.0
-1
Password 2 validation (has to match password 1)
function signupValidatePassword2() { let signupPass2Value = signupPass2.value; if (signupPass2Value.match(signupPass.value) && signupPassValid === true) { signupPass2.className = "form-control is-valid"; signupPass2Valid = true; //console.log("pass2ok"); } else { signupPass2.className = "form-control is-invalid"; signupPass2Valid = false; //console.log("pass2error"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passwordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Paswords do not match\");\n }\n}", "function checkPasswordMatch(input1, input2) {\n\tif (input1.value !== input2.value) {\n\t\tshowError(input2, 'Passwords do not match');\n\t}\n}", "function checkPasswordMatch(password, password2) {\r\n\r\n if (password.value !== password2.value) {\r\n showError(password2, `Passwords do not match`)\r\n };\r\n}", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}", "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Passwords do not match');\n }\n}", "function checkPasswordMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Password does not matches\")\n }\n\n}", "function checkPasswords(input1, input2){\n if(input1.value !== input2.value){\n error(input2, \"Passwords are not matching!\");\n }\n}", "function valid_password_verify(pwd1, pwd2){\n\tif (pwd1 != pwd2){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkPassword(password1, password2) {\n let errorLenght = false;\n let errorMatch = false;\n if (\n // Check length\n password1.match(/\\s+/) ||\n password1.trim().length < 4 ||\n password1.trim().lenght > 32\n ) {\n // Add message to error messages\n composeErrorMessage(\n \"Invalid Password - Must be longer than 4 characters and shorter than 32\"\n );\n errorLenght = true;\n }\n\n if (password1.trim() !== password2.trim()) {\n // Check if passwords match - if not\n // Add unmatch message\n composeErrorMessage(\"Passwords don't match\");\n errorMatch = true;\n }\n\n // If there is just one error than display it\n if (errorLenght || errorMatch) {\n displayErrorMessage(errorMessage);\n }\n return errorLenght || errorMatch;\n }", "passwordsMatch(passOne, passTwo) {\n return passOne === passTwo;\n }", "function checkPasswordsMatch(input1,input2){\n if(input1.value != input2.value)\n {\n showError(input2,\"Password don't match\");\n }\n\n}", "function checkValidPassword (inputPassword1, inputPassword2) {\n if(inputPassword1.parentElement.className === \"form-control error\"){ // if error already found, return\n return;\n } else {\n const re = /^[a-zA-Z0-9!@#$%^&*()]{8,20}$/;\n\n if(re.test(inputPassword1.value)) {\n checkMatch(inputPassword1, inputPassword2);\n }else {\n showError(inputPassword1, \"Invalid\");\n }\n } \n}", "function secondPass() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelector(\"#secondPass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n } \n else {\n return true;\n }\n}", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function checkNew(pw1, pw2, errors, app) {\n\tif (!app.validation.checkPassword(pw1) || !app.validation.checkPassword(pw2)) {\n\t\terrors.push(\"Password must be at least \"+\n\t\t\tapp.settings.PASSWORD_MIN_LEN+\" characters long.\")\n\t}\n\tif (pw1 != pw2) {\n\t\terrors.push(\"Passwords must match.\");\n\t}\n}", "function validatePassword(wachtwoord1, herwachtwoord){\r\n if(wachtwoord1.length < 8 && herwachtwoord < 8){\r\n errors.push(\"Het wachtwoord moet minstens 8 karakters bevatten.\");\r\n }\r\n else{\r\n if (wachtwoord1 != herwachtwoord){\r\n errors.push(\"Wachtwoord moet gelijk zijn!\");\r\n }\r\n }\r\n }", "function validatePassword() {\r\n let pass1 = document.getElementById(\"pass\").value;\r\n let pass2 = document.getElementById(\"confirm-pass\").value;\r\n console.log(pass1);\r\n let regex = \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])[a-zA-Z0-9]{8,20}$$\";\r\n if (!pass1.match(regex)) {\r\n alert(\r\n \"Invalid password: 8-20 characters, at least 1 digit, lower and upper case alphabet.\"\r\n );\r\n return false;\r\n }\r\n\r\n if (pass1 != pass2) {\r\n alert(\"Passwords do not match.\");\r\n return false;\r\n }\r\n return true;\r\n}", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function checkMatch (inputPassword1, inputPassword2){\n if(inputPassword1.value === inputPassword2.value) {\n showSuccess(inputPassword1);\n } else {\n showError(inputPassword1, \"Not matching\");\n }\n}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function validatePassword2() {\n let pass2Value = pass2.value;\n if (pass2Value.match(pass.value) && isPassValid == true) {\n pass2.className = \"form-control is-valid\";\n isPass2Valid = true;\n //console.log(\"pass2ok\");\n } else {\n pass2.className = \"form-control is-invalid\";\n isPass2Valid = false;\n //console.log(\"pass2error\");\n }\n}", "function isValidPassword(password) {\n\n\n}", "function checkPassword() {\n error1 = false;\n message1 = null;\n error2 = false;\n message2 = null;\n pass1 = $('#passwordSpan input');\n pass2 = $('#password2Span input');\n \n // Tests if the input is empty\n if (!pass1.val()) {\n error1 = true;\n message1 = \"Champ vide\";\n }\n \n // The password should be 6 char long at least\n if (pass1.val() && pass1.val().length < 6) {\n error1 = true;\n message1 = \"6 caractères min.\";\n }\n \n if (!pass2.val()) {\n error2 = true;\n message2 = \"Champ vide\";\n }\n\n // The password and its confirmation should be the same\n if (pass2.val() && pass1.val() != pass2.val()) {\n error2 = true;\n message2 = \"Les mots de passe sont différents\";\n }\n \n if (error1) {\n pass1.parents('span').addClass('inputError');\n pass1.attr(\"title\", message1);\n } else {\n removeErrors(pass1);\n }\n \n if (error2) {\n pass2.parents('span').addClass('inputError');\n pass2.attr(\"title\", message2);\n } else {\n removeErrors(pass2);\n }\n}", "function checkPassMatch() {\n if ($(\"#password-up-1\").val() == $(\"#password-up-2\").val()) {\n $(\"#password-up-2\")[0].setCustomValidity(\"\");\n } else {\n $(\"#password-up-2\")[0].setCustomValidity(\"Passwords must match\");\n }\n if ($(\"#password-up-1\").val() != \"\" && $(\"#password-up-2\").val() != \"\") {\n $(\"#sign-up-form\").addClass(\"was-validated\");\n }\n}", "function validPassword2(p) {\n return /(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z])(?!.*[^a-zA-Z0-9])/.test(p);\n}", "function passwordMatch(password) {\n return password === admin.password;\n}", "function fn_ValidatePassword ( thePassword1 , thePasswordName1 , thePassword2 , thePasswordName2 )\n\t{\n\t\t/*\n\t\tif ( thePassword1 == undefined )\n\t\t{\n\t\t\talert ( \"要求检查的项目(\" + thePasswordName1\t+ \")并不是一个有效的JavaScript对象\" ) ;\n\t\t\treturn false;\n\t\t}\n\t\tif ( thePassword2 == undefined )\n\t\t{\n\t\t\talert ( \"要求检查的项目(\" + thePasswordName2\t+ \")并不是一个有效的JavaScript对象\" ) ;\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\tif ( thePassword1.value.length < 6 )\n\t\t{\n\t\t\talert ( \"\\\"\" + thePasswordName1 + \"\\\"至少要有6个字符!\" ) ;\n\t\t\tthePassword1.value = \"\" ;\n\t\t\tthePassword1.focus ( ) ;\n\t\t\treturn false ;\n\t\t}\n\n\t\tif ( thePassword2.value.length < 6 )\n\t\t{\n\t\t\talert ( \"\\\"\" + thePasswordName2 + \"\\\"至少要有6个字符!\" ) ;\n\t\t\tthePassword2.value = \"\" ;\n\t\t\tthePassword2.focus ( ) ;\n\t\t\treturn false ;\n\t\t}\n\n\t\tif ( thePassword1.value != thePassword2.value )\n\t\t{\n\t\t\talert ( \"两次输入的密码不符合!请重新输入。\" )\n\t\t\tthePassword1.value = \"\" ;\n\t\t\tthePassword2.value = \"\" ;\n\t\t\tthePassword1.focus ( ) ;\n\t\t\treturn false ;\n\t\t}\n\t\treturn true ;\n\t}", "function checkPass(p1, p2) \r{\r\tvar error = \"\";\r\t\r\t// Contraseñas distintas\r\tif (p1 != p2) \r\t{\r\t\tdocument.getElementById(\"p1label\").className = \"error\";\r\t\terror = \"<b>Passwords don't match</b>\";\r\t}\r\telse \r\t{\r\t\t// Contraseña con menos de 6 carácteres\r\t\tif (p1.length < 6) \r\t\t{\r\t\t\tdocument.getElementById(\"p1label\").className = \"error\";\r\t\t\terror = \"<b>At least 6 characters</b>\";\r\t\t}\r\t\telse \r\t\t{\r\t\t\t// Contraseña con mas de 15 carácteres\r\t\t\tif (p1.length > 15) \r\t\t\t{\r\t\t\t\tdocument.getElementById(\"p1label\").className = \"error\";\r\t\t\t\terror = \"<b>Less than 15 characters</b>\";\r\t\t\t}\r\t\t\telse \r\t\t\t{\r\t\t\t\t// Contraseña con carácteres inválidos. Se admiten los mismo\r\t\t\t\t// carácteres que en el usuario\r\t\t\t\treg = /^[A-Za-z0-9_\\-]*$/;\r\r\t\t\t\tif (!reg.test(p1)) \r\t\t\t\t{\r\t\t\t\t\tdocument.getElementById(\"p1label\").className = \"error\";\r\t\t\t\t\terror = \"<b>Invalid character</b>\";\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\r\treturn error;\r}", "function onCheckPW() {\r\n if ($(this).val() === $('#id_password2').val()) {\r\n this.setCustomValidity('');\r\n } else {\r\n this.setCustomValidity('Passwords must match.');\r\n }\r\n }", "function validPassA(pw1,currpw) {\n if(pw1 === currpw) {\n return \"Password matches old password.\";\n }\n return \"\";\n}", "function checkPasswords(input1, input2) {\n if(input1.value === input2.value) {\n input2.className = 'success';\n input2.nextElementSibling.style.visibility = 'hidden';\n console.log('correct');\n }\n if(input1.value !== input2.value) {\n let error = `The passwords doesn't match!!`;\n showError(input2, error);\n }\n}", "function validconfpass()\n{\nvar p1=document.getElementById(\"pword\").value;\nvar p2=document.getElementById(\"confpword\").value;\n\n\nif(p1.length==0 )\n{\nalert(\"Password is required\");\n}\n\nif(p1!=p2)\n{\nalert(\"Password does not match\");\n}\nelse if()\n{\ndocument.getElementById(\"mess3\").innerHTML=\"Password confirmed\";\n}\n}", "checkPassword(password) {\n return password === this.password;\n }", "function checkPasswordMatch() {\n\tvar password1 = document.getElementById(\"passw\").value;\n\tvar password2 = document.getElementById(\"enterPassword\").value;\n\n\tif (password2 == \"\"){\n\n\t} else {\n\t\tif (password1 == password2) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Password does not match!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }", "function validatePasswordMatch(password, confirmPassword, errors) {\n if (password !== confirmPassword) {\n errors.confirmPassword = \"Passwords must match.\";\n }\n}", "function validatePassword(password) {\n\t// validate password\n}", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "function passwordValidation(){\n return password.value.match(passwordReg);\n}", "function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equal)\n\t {\n\t \treturn true;\n\t }\n\t return false;\n}", "function checkPasswords() {\n var password = document.getElementById('InputPassword');\n var retypePassword = document.getElementById('InputPassword2');\n\n if (password.value != retypePassword.value) {\n showFeedBack(retypePassword.name,\"NoMatch\");\n if(retypePassword.value != \"\"){\n retypePassword.value = \"\";\n retypePassword.focus();\n }\n passwordError = true;\n } else {\n if(retypePassword.value != \"\"){\n showFeedBack(retypePassword.name,\"valid\");\n passwordError = false;\n }\n \n }\n \n }", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "checkPasswordValidity() {\n let self = this;\n if (self.userRegister.password === self.userRegister.retypedPassword) {\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', true);\n return;\n }\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', false);\n }", "function comparePasswords() {\n var validPassword = false;\n if ($scope.newUser.password === $scope.newUser.password) {\n validPassword = true;\n } else {\n validPassword = false;\n }\n return validPassword;\n }", "function checkPasswordMatch($field1, $field2)\r\n{\t\r\n\tif($(\"form#chgPassword input[name = \"+$field1+\"]\").val() != $(\"form#chgPassword input[name = \"+$field2+\"]\").val())\r\n\t{\r\n\t\t$(\"form#chgPassword span[name = \"+$field2+\"Error]\").empty().html(\"Re-entered password does not match new password.\");\r\n\t\t$(\"form#chgPassword span[name = \"+$field2+\"Error]\").show();\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(\"form#chgPassword span[name = \"+$field2+\"Error]\").empty();\r\n\t\treturn true;\r\n\t}\r\n\t//enableStatusSavebtn('chgPassword');\r\n\t\r\n}", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function checkPasswordMatch() {\n var password = $(\"#password-input\").val();\n var confirmPassword = $(\"#password-check\").val();\n \n if (password !== confirmPassword){\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n }\n else{\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }\n }", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function passLengthValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(!(pass.length == password.length)) {\n errorMessage(\"<p>Please make sure your passwords match!</p>\");\n return false;\n }\n return true;\n}", "function rightPassword(){\r\n if(password.value.match(/^(?=.*\\d)[0-9a-zA-Z]{8,}$/)){\r\n password.setCustomValidity('');\r\n }else{\r\n password.setCustomValidity('The password must be at least 8 character from (a-z), (A-Z) or(0-9)');\r\n }\r\n}", "function validarPassword(){\n var password1 = $('#password1').val();\n var password2 = $('#password2').val();\n\n if(password1 != password2){\n $('#span_pass').text(\"Las contraseñas no coinciden\");\n $('#span_pass').css({ 'color': 'red'});\n $('#boton-crear').prop('disabled', true); \n }else{\n $('#span_pass').text(\"Las contraseñas coinciden\");\n $('#span_pass').css({ 'color': 'green'});\n $('#boton-crear').prop('disabled', false);\n }\n}", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "passwordMatch(e) {\n e.preventDefault()\n let pass1 = document.getElementById(\"pass\");\n let pass2 = document.getElementById(\"pass2\");\n if (pass1.value === pass2.value) {\n this.setState({\n passMatch: false\n })\n }else {\n this.setState({\n passMatch: true\n })\n }\n }", "function checkPassword(password, passconf) {\n\tvar password = $(password);\n\tvar passconf = $(passconf);\n\tif (password.val().trim() == passconf.val().trim()) {\n\t\tpassconf.get(0).setCustomValidity(\"\"); // All is well, clear error message\n\t\treturn true;\n\t} else {\n\t\tpassconf.get(0).setCustomValidity(ERR_PASSWORD_MISMATCH);\n\t\treturn false;\n\t}\n}", "function checkPasswordsMatch() {\n\tif (password.value !== confirmPassword.value) {\n\t\tshowError(confirmPassword, 'Passwords do not match')\n\t}\n}", "function passwordCompare() {\n // Only run the function if the first password form is valid\n if (passwordRegisterField.checkValidity()) {\n // If the passwords don't match, and if there is a password in the confirmation field\n if (\n passwordValidateField.value !== passwordRegisterField.value &&\n passwordValidateField.value != \"\"\n ) {\n // If the registration field is valid\n if (passwordRegisterField.classList.contains(\"valid\")) {\n errorMessageField.innerHTML = \"Passwords do not match!\";\n }\n\n // Adjust classes\n passwordValidateField.classList.remove(\"valid\");\n passwordValidateField.classList.add(\"invalid\");\n }\n // If the passwords match, and there is a password in the confirmation field\n else if (\n passwordValidateField.value === passwordRegisterField.value &&\n passwordValidateField.value != \"\"\n ) {\n errorMessageField.innerHTML = \"\";\n passwordValidateField.classList.remove(\"invalid\");\n passwordValidateField.classList.add(\"valid\");\n }\n }\n}", "isSamePassword(currentPassword, newPassword) {\n return currentPassword === newPassword;\n }", "function password() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelectorAll(\"#pass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n }\n else {\n return true;\n }\n}", "function checkPass(string) {\n let pass1 = /[A-Z]/;\n let pass2 = /\\d\\W/;\n if (pass1.test(password) && pass2.test(password)) {\n return true;\n } else {\n return false;\n }\n}", "function checkPassword() {\n\tvar item1 = document.getElementById(\"pwd1\").value;\n\tvar item2 = document.getElementById(\"pwd2\").value;\n var isSame = true;\n var isBig = true;\n\tvar numCount = 0;\n\tvar charCount = 0;\n\tif (item1.length != item2.length) {\n isSame = false;\n }\n if (item1.length < 7) {\n isBig = false;\n }\n \n\tfor (var i = 0; i < item1.length; i++) {\n\t\tif (item1.charAt(i) != item2.charAt(i)) {\n\t\t\tisSame = false;\n }\n \n\t\tif (isNaN(item1.charAt(i))) { \n\t\t\tcharCount++; \n\t\t} else { \n\t\t\tnumCount++; \n\t\t}\n }\n\n if (numCount == 0 || charCount == 0 || !isBig) {\n isBig = false;\n } else {\n isBig = true;\n }\n \n\tif (!isSame) {\n document.getElementById('error').innerHTML = \"*Passwords not identical.<br/>\";\n\t}\t\n\telse {\n\t\tdocument.getElementById('error').innerHTML = \"\";\n }\n \n\tif (!isBig) {\n document.getElementById('error2').innerHTML = \"*Password needs to start with a letter and be 7-20 characters long with at least one number.<br/>\";\n\t}\n\telse {\n\t\tdocument.getElementById('error2').innerHTML = \"\";\n }\n // running into a problem where the innerHTML is not updating before the check and alerts.\n if (isBig && isSame) {\n return true;\n } else {\n return false;\n }\n}", "async function passwordAuth(password1, password2) {\n if (await bcrypt.compare(password1, password2)) {\n return true;\n }\n //What exit message should i use?\n return false;\n}", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function checkPass1() {\n\n var flag = 0;\n var neutralColor = '#fff'; // 'white';\n var badColor = '#f66'; // 'red';\n var goodColor = '#6f6'; // 'green';\n\n var password1 = getElm('new_password1').value;\n var password2 = getElm('confirm_password1').value;\n\n //if password length is less than 6\n if (password1.length < 6) {\n feedback1('Mật khẩu tối thiểu 6 kí tự');\n //we do not care about pass2 when pass1 is too short\n setBGColor('confirm_password', neutralColor);\n //if pass1 is blank, set neutral background\n if (password1.length === 0) {\n setBGColor('new_password1', neutralColor);\n } else {\n setBGColor('new_password1', badColor);\n }\n flag = 1;\n //else if passwords do not match\n } else if (password1.indexOf(' ') >= 0) {\n feedback1('Mật khẩu không được có kí tự trắng');\n setBGColor('new_password1', badColor);\n flag = 1;\n } else if (password2 !== password1) {\n //we now know that pass1 is long enough\n feedback1('Mật khẩu không trùng khớp');\n setBGColor('new_password1', goodColor);\n //if pass2 is blank, set neutral background\n if (password2.length === 0) {\n setBGColor('confirm_password1', neutralColor);\n } else {\n setBGColor('confirm_password1', badColor);\n }\n flag = 1;\n\n } else {\n feedback1('Mật khẩu trùng khớp');\n setBGColor('new_password1', goodColor);\n setBGColor('confirm_password1', goodColor);\n flag = 0;\n }\n return flag;\n}", "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "function confirmPass() {\n var pass = document.getElementById(\"pass1\").value\n var confPass = document.getElementById(\"pass2\").value\n if (pass != confPass) {\n alert('Wrong confirm password !');\n return false\n } else {\n return true;\n }\n}", "function validatePasswordMatch(password, confirmPassword) {\n if (password === confirmPassword) {\n return true;\n } else {\n return \"Password do not match!\"\n }\n}", "function validatePassword(){\n var pass = document.getElementById(\"password1\");\n var confirm = document.getElementById(\"confirm_password\");\n\n if(pass.value == confirm.value){\n confirm.setCustomValidity('');\n }else{\n confirm.setCustomValidity(\"Passwords do not match!\");\n }\n}", "function checkMatch() {\n var pw1 = $(\"#inputPassword2\").val();\n var pw2 = $(\"#inputPassword3\").val();\n //Update HTML to show user information.\n if (pw1 === pw2) {\n $(\"#match\").html(\"Passwords: Match\");\n } else {\n $(\"#match\").html(\"Passwords: Don't Match\");\n }\n }", "function password2(){\n\t\t\tvar a = document.getElementById(\"pwd1\").value;\n\t\t\tvar b = document.getElementById(\"pwd2\").value;\n\t\t\tif(a != b){\n\t\t\t\tdocument.getElementById(\"pwd2Hint\").style.display ='block';\n\t\t\t}\n\t\t\t\tif(a == b){\n\t\t\t\tdocument.getElementById(\"pwd2Hint\").style.display ='none';\n\t\t\t}\n\t\t\t}", "isValidPassword(text) {\n // if (text.match(PASSWORD_REGEX)) {\n this.props.isPasswordValid(1); //always valid\n // } else {\n // this.props.isPasswordValid(2);\n // }\n }", "function Validate() {\r\n\r\n var pass1 = document.getElementById(\"password\").value;\r\n var pass2 = document.getElementById(\"repeat_password\").value;\r\n\r\n //if passwords does not match\r\n if (pass1 != pass2) {\r\n alert(\"Passwords do not match\");\r\n\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n return false;\r\n}", "function checkPassword() {\n\tvar password = document.getElementById(\"password\").value;\n\tvar retypePassword = document.getElementById(\"retypePassword\").value;\n\tvar hasNumber = /\\d/;\n\tvar hasSpecialCharacter = /\\W/;\n\t//Password must contain at least one number and one special character\n\tif ((password === retypePassword) && (hasNumber.test(password)) && (hasSpecialCharacter.test(password))) {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"Password must match, have a number and a special character.\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"Retyped password must match, have a number and a special character.\";\n\t}\n}", "checkPwd() {\n const pwd = document.getElementById('newPwd').value,\n rpt = document.getElementById('repeatPwd').value;\n\n if (pwd !== rpt) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "function passwordsMatching(password_one, password_two) {\r\n\t\tif (password_one != password_two) {\r\n\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"POST\",\r\n\t\t\t\turl : \"logic/process_inputcheck.php\",\r\n\t\t\t\tdata : {\r\n\t\t\t\t\taction : \"get_message_passwords_not_matching\"\r\n\t\t\t\t}\r\n\t\t\t}).done(function(msg) {\r\n\t\t\t\t$('div[id=passwords_not_matching]').remove();\r\n\t\t\t\t$('#messagearea').append(msg);\r\n\t\t\t\t$('html, body').animate({\r\n\t\t\t\t\tscrollTop : $('#messagearea').offset().top\r\n\t\t\t\t}, 600);\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\t$('div[id=passwords_not_matching]').remove();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "function validateForm(userName, password, password2) {\n var validForm = true;\n var alphanumeric = /^[a-zA-Z0-9]+$/\n if (password !== password2) {\n validForm = false;\n alertMessage('Password does not match');\n }\n else if (!userName.match(alphanumeric)) {\n validForm = false;\n alertMessage('Username can only be alphanumeric');\n } else if (userName.lenght === 0) {\n validForm = false;\n\n } else if (password.lenght === 0) {\n validForm = false;\n\n }\n\n return validForm;\n}", "function matchingPasswords(){\n if(createRetypePassword == createPassword){\n return true;\n }else{\n return false;\n }\n}", "validPassword(passwordTyped) {\n return bcrypt.compareSync(passwordTyped, this.password) //returns a boolean o see if password type into the form matches the hashed password in the databaed\n }", "function passwordChecker() {\n password_value = password.value;\n\n if (password_value.length < 8) {\n errorMessage.innerText = \"Password is too short\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/\\d/) === null) {\n errorMessage.innerText = \"Password must contain at least one number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/[#%\\-@_&*!]/)) {\n errorMessage.innerText = \"\";\n passwordCompare();\n } else {\n errorMessage.innerText = \"Password must contain at least one special character: #%-@_&*!\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n }\n }\n}", "function checkPassword(form) {\n password1 = form.password1.value;\n password2 = form.password2.value;\n\n // If password not entered\n if (password1 != password2) {\n document.getElementById(\"pwderror\").innerHTML = '<span style=\"color:red;\">Password did not match: Please try again...</span>';\n return false;\n }\n\n // If same return True.\n else {\n document.getElementById(\"pwderror\").innerHTML = \"\";\n return true;\n }\n}", "function validatePassword() {\n\n //regex to determine minimum 8 character at least one letter one number in string\n var regex = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n\n if (password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else if (!regex.test(password.value)) {\n confirm_password.setCustomValidity(\"Password be at least 8 characters long and contain at least one numeric character\")\n }\n else {\n confirm_password.setCustomValidity('');\n }\n}", "function validatePassword(entered_password, current_password) {\n return bcrypt.compareSync(entered_password, current_password);\n}", "function validatePass(pass1,pass2){\n var espacios = false;\n var cont = 0;\n\n while (!espacios && (cont < pass1.length)) {\n if (pass1.charAt(cont) == \" \")\n espacios = true;\n cont++;\n }\n\n document.querySelector('#pass-sp-error').style.display = \"none\";\n document.querySelector('#pass-empty-error').style.display = \"none\";\n document.querySelector('#pass2-empty-error').style.display = \"none\";\n document.querySelector('#pass-diff-error').style.display = \"none\";\n\n if (espacios) {\n document.querySelector('#pass-sp-error').style.display = \"inline\";\n return false;\n }\n\n if (pass1.length == 0) {\n document.querySelector('#pass-empty-error').style.display = \"inline\";\n return false;\n }else if (!pass1.length==0 && pass2.length==0) {\n document.querySelector('#pass2-empty-error').style.display = \"inline\";\n return false;\n }\n\n if (pass1 != pass2) {\n document.querySelector('#pass-diff-error').style.display = \"inline\";\n return false;\n }\n\n return true;\n}", "function validatePasswordFields(context) {\r\n var pwds = context.parentNode.getElementsByClassName('repeat_password');\r\n \r\n\r\n\tif(pwds[0].value !== pwds[1].value) {\r\n\r\n pwds[0].addClass('error').value = \"\";\r\n pwds[1].addClass('error').value = \"\";\r\n \r\n return false;\r\n }\r\n\t\r\n return true;\r\n}", "function validateseniorForm(){\n\tif (document.getElementById(\"psw\").value!=document.getElementById(\"psw2\").value){\n\t\t\tbootbox.alert(\"Password and new password is different, They must be same.\");\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function validatePassword() {\n var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var regex = new RegExp(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/);\n return regex.test(input);\n}", "function match_password(Element)\n\t\t{\n\t\t\n\t\t\tif($(Element).is(\"input:password\"))\n\t\t\t{\n\t\t\t\tif($(Element).attr(\"match\")!=null)\n\t\t\t\t{\n\t\t\t\t\tvar Match=\"#\"+$(Element).attr(\"match\");\n\t\t\t\t\tif($(Match).val()!=$(Element).val())\n\t\t\t\t\t{\n\t\t\t\t\t\tvar Message=\"Please enter the same password as above\";\n\t\t\t\t\t\tdisplay_msg(Element,Message,\"match\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplay_msg(Element,'',\"match\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "checkPassword(originalPwd){\n return bcrypt.compareSync(originalPwd, this.password);\n }", "function passwordCheck(password){\n\t// Can't have password of length zero\n\tif(password.length == 0){\n\t\treturn true;\n\t}\n\t// Password must be of length 10 and numeric\n\tif(password.length == 10 && numCheck(password)){\n\t\treturn true;\n\t}\n\tatSplit=password.split('-');\n\tif(atSplit.length== 3 && numCheck(atSplit[0]) && numCheck(atSplit[1]) && numCheck(atSplit[2]) && atSplit[0].length==3 && atSplit[1].length== 3 && atSplit[2].length==4)\n\t{\n\t\treturn true;\n\t}\n\tvalCheck=false;\n\treturn false;\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "function passwordEqual(form,newpass,confirmpass,newpasspan,confrmpasapan)\n{\n\tvar password = document.forms[form][newpass].value;\n\tvar confirmPassword = document.forms[form][confirmpass].value;\n\tvar passwordMismach = document.getElementById(\"passwordMismarch\");\n\n\t//checks if the two passwords march\n\tvar fPass = validatePassword(form,newpass,newpasspan);\n\tvar sPass = validatePassword(form,confirmpass,confrmpasapan);\n\n\tif (fPass&sPass)\n\t {\n\t \t//checks if the two passwords match\n\t \tif (confirmPassword==password) \n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"\";\n\t \t\treturn true;\n\t \t}\n\t \telse\n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"password did not match\";\n\t \t\tdocument.forms[form][newpass].value=\"\";\n\t \t\tdocument.forms[form][confirmpass].value=\"\";\n\t \t}\n\t }\n\t else\n\t {\n\t \tpasswordMismach.innerHTML=\"\";\n\t }\n\t return false;\n}", "function validate(password) {\n return /(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d])(?=.{6,})/.test(password);\n}", "function passwordsMatch() {\n if (register_password.value.length !== 0 && register_password_again.value.length !== 0) {\n if (register_password.value === register_password_again.value) {\n document.querySelector('.btn-register').disabled = false;\n document.querySelector('#passwords_match').classList.add('passwords-match')\n document.querySelector('#passwords_match').classList.remove('passwords-dont-match')\n document.querySelector('#passwords_match').innerHTML = 'Password match!'\n } else {\n document.querySelector('.btn-register').disabled = true;\n document.querySelector('#passwords_match').classList.add('passwords-dont-match')\n document.querySelector('#passwords_match').classList.remove('passwords-match')\n document.querySelector('#passwords_match').innerHTML = 'Passwords do not match.'\n };\n } else {\n document.querySelector('#passwords_match').innerHTML = ''\n };\n }", "function isValidPassword(password, username) {\n\tconst tooShort = password.length < 8\n\tconst hasSpace = password.indexOf(' ') !== -1\n const usesUsername = password.indexOf(username) !== -1\n return !tooShort && !hasSpace && !usesUsername\n}", "function isPasswordvalid(password) {\n return password.length>= 6 && password.includes(\"1\") && (password.includes(\"#\") || password.includes(\"$\") || password.includes(\"!\"))\n}", "function validatePasswords()\r\n {\r\n\t\r\n\t// compare passwords\r\n\tpassword1 = $('.password1').val();\r\n\tpassword2 = $('.password2').val();\r\n\t\r\n\tif ( password1 != password2)\r\n\t{\r\n\t\t// add error class to password text boxes\r\n\t\t$('.password1').addClass('error');\r\n\t\t$('.password2').addClass('error');\r\n\t\t\r\n\t\tswal(\"Oops\", \"your passwords does not match please try again!\", \"error\");\r\n\t\t// set password validation to false;\r\n\t\tpasswordValidation = false;\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// Remove any red outlines on password change box\r\n\t\t$('.password1').removeClass('error');\r\n\t\t$('.password2').removeClass('error');\r\n\r\n\t\tpasswordValidation = true;\r\n\t}\r\n\t\r\n }", "function isValidPassword(password) {\n return checkStraight(password) && checkContainsLetters(password) && checkContainsPairs(password);\n}", "function passEquals(pw) {\n\treturn pw !== \"password\";\n}" ]
[ "0.82231057", "0.8121289", "0.8047425", "0.79598457", "0.7911197", "0.7901465", "0.7889488", "0.7658186", "0.7609218", "0.7566691", "0.75638205", "0.7530028", "0.7473751", "0.7416909", "0.7415139", "0.7383347", "0.7327652", "0.7319845", "0.731709", "0.7277179", "0.7188719", "0.7146243", "0.7138041", "0.7120761", "0.7113154", "0.7084241", "0.7081561", "0.7059581", "0.70564467", "0.69915676", "0.69661003", "0.6933273", "0.6892785", "0.6891718", "0.6889676", "0.6882907", "0.6881296", "0.6867193", "0.6859715", "0.68552184", "0.6841489", "0.6835276", "0.6811083", "0.680842", "0.68082047", "0.6794376", "0.6793816", "0.6788048", "0.67760575", "0.6758244", "0.67510086", "0.6749077", "0.67159563", "0.67009765", "0.6691564", "0.66792536", "0.66633207", "0.66616154", "0.66558045", "0.66541463", "0.6645699", "0.66292894", "0.66255295", "0.66238445", "0.66173565", "0.66099834", "0.66090745", "0.66003835", "0.6596929", "0.6596795", "0.65923244", "0.65908474", "0.65879804", "0.6574193", "0.6569476", "0.656886", "0.65621614", "0.65578", "0.6550018", "0.65482455", "0.6548174", "0.65448374", "0.6534092", "0.65324867", "0.6524907", "0.6524677", "0.65229815", "0.6520255", "0.65193284", "0.6519287", "0.6517368", "0.65080374", "0.64992", "0.64971304", "0.6497033", "0.6494235", "0.64753574", "0.64727545", "0.6470456", "0.6468985" ]
0.6809256
43
Province validation (can't be empty)
function signupValidateProvince() { let signupProvValue = signupProv.value; if (signupProvValue !== "") { signupProv.className = "browser-default custom-select is-valid"; signupProvValid = true; //console.log("provok"); } else { signupProv.className = "browser-default custom-select is-invalid"; signupProvValid = false; //console.log("proverror"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateProvince() {\nlet provValue = prov.value;\nif (provValue != \"\") {\n prov.className = \"browser-default custom-select is-valid\";\n isProvValid = true;\n //console.log(\"provok\");\n} else {\n prov.className = \"browser-default custom-select is-invalid\";\n isProvValid = false;\n //console.log(\"proverror\");\n}\n}", "function provIsSelected(){\n\t \n\t provinceSelected = false;\n\t var province = document.getElementById('prov');\n\t var prov = province.options[province.selectedIndex].value;\n\t\n\tif (prov==null || prov==\"\"){\n\t\t\n province.style.borderColor = \"#ff1a1a\";\n errorMessage.innerHTML = \"Required field \\\"Province\\\" is not filled\";\n errorMessageBody.style.display = \"block\";\n provinceSelected = false;\n return provinceSelected;\n }\n\telse{\n\t\tprovinceSelected = true;\n\t}\n\t\n\treturn provinceSelected\n}", "function cityOnChange() {\n const pattern = \"^[a-zA-Z]+(?:[- `][a-zA-Z]+)*$\";\n validate(this, pattern);\n}", "function validateCanadaPostalCode(field) {\n // empty fields pass validation\n if (field === undefined || field === null) {\n return true;\n }\n var regex = new RegExp(/(^[A-Za-z0-9]{6}$)|(^[A-Za-z0-9]{3}\\s[A-Za-z0-9]{3}$)/);\n return regex.test(field);\n}", "function isProvince(prv){\n\treturn locations.hasOwnProperty(prv);\n}", "function validatePO() {\n\n var reg = /^[A-Z]\\d[A-Z]\\d[A-Z]\\d$/;\n if (!reg.test(document.getElementById('postal').value)) {\n\tdocument.getElementById('postal').style.borderColor = \"#ff1a1a\";\n errorMessage.innerHTML = \"The postal you entered is not valid\";\n errorMessageBody.style.display = \"block\";\n return false;\n } else{\n return true;\n }\n }", "function filterProvince(datum){\n if (province == null){\n return true;\n }\n else {\n return province.includes(datum);\n }\n }", "function filterProvince(datum){\n if (province == null){\n return true;\n }\n else {\n return province.includes(datum);\n }\n }", "function fnValidateCity(oInput){\n\n\tvar sText = oInput.val();\n\tvar iMin = 2;\n\tvar iMax = 18;\n\n\t// checks for other than characters, ignores spaces.\n\tvar regex = /^[æøåa-z\\s*ÆØÅA-Z\\s*]*$/;\n\tvar bRegexTest = regex.test(sText);\n\n\t// checks length and regex\n\tif( sText.length < iMin || sText.length > iMax ){\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else if (bRegexTest == false) {\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function validateExploria()\n{\n\t\tvar propertyName = 'Exploria'; \n\t\tvar streetName = 'Exploria Road'; \n\t\tproperty(propertyName, streetName); \n\t\tevent.preventDefault();\n\n}", "validateCity(city){\n if(city){\n if(city.length <= 45){\n let re=/^[a-zA-Z\\s]*$/\n if(re.test(city)){\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function checkProvince(pDiv, check) {\n\tvar region = REGIONS[pDiv.textContent];\n\tif (typeof check == \"undefined\") check = !region.selected;\n\t// Marca/desmarca una provincia\n\tpDiv.className = check ? \"on\" : \"\";\n\tif (check && !region.color) {\t\t// creación del selector de color\n\t\tvar pickerOptions = {pickerPosition: 'right',pickerClosable: true};\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.className=\"config\";\n\t\tvar col = document.createElement(\"input\");\n\t\tcol.value = Raphael.getColor().slice(1);\t// nuevo color\n\t\tcol.className = \"color\";\n\t\tregion.color = new jscolor.color(col, pickerOptions);\n\t\taddEvent(col, \"change\", function() {updateAll(false);});\n\t\tdiv.appendChild(col);\n\t\tpDiv.appendChild(div);\n\t}\n\tregion.selected = check;\n}", "function validatestate()\n\t{ //if it's NOT valid\n\tif($.trim(country.val())==\"ZZ\" && shipcountry.val()==\"US\")\n\t{ \n\tcountry.addClass(\"error\");\n\tcountryInfo.text(\"Choose State!\"); \n\tcountryInfo.addClass(\"error\"); \n\treturn false; \n\t} //if it's valid \n\telse{ \n\tcountry.removeClass(\"error\"); \n\tcountryInfo.text(\"\");\n\tcountryInfo.removeClass(\"error\"); \n\treturn true; }\n\t}", "function GetProvincesForRegisterForm() {\n\n $http({\n method: \"GET\",\n url: \"/Public/Home/GetProvinces\"\n\n }).success(function (data, status, headers, config) {\n if (data.ErrorMessage != null) {\n // خطای سمت سرور\n showMessageBox(\"هەلە\", data.ErrorMessage, \"error\");\n $scope.provinces = null;\n } else {\n $scope.provinces = data;\n }\n\n }).error(function (data, status, headers, config) {\n $scope.message = 'هەڵە لە پەیوەندی بە سیرڤر';\n showMessageBox(\"هەلە\", $scope.message, \"error\");\n\n $scope.cities = null;\n\n });\n }", "static checkCity(city) {\n try {\n NonEmptyString.validate(city, CITY_CONSTRAINTS);\n return \"\";\n }\n catch (error) {\n console.error(error);\n return \"The address' city should not be empty or larger than 120 letters\";\n }\n }", "function validateInfo() {\r\n var x = document.getElementsByClassName(\"personal\");\r\n var province = document.getElementById(\"province\");\r\n var valid = true;\r\n\r\n // Validation for drop-down input\r\n if (province.value == \"province\")\r\n {\r\n province.style.backgroundColor = \"rgb(255,221,221)\";\r\n valid = false;\r\n }\r\n else province.style.backgroundColor = \"white\";\r\n\r\n // Validation for text input\r\n for (var i = 0; i < x.length; i++){\r\n if (i == 2)\r\n {\r\n var email = x[2].value.search(/^.+@.+\\..+$/);\r\n if (email != 0)\r\n {\r\n x[2].style.backgroundColor = \"rgb(255,221,221)\";\r\n valid = false;\r\n }\r\n else x[2].style.backgroundColor = \"white\";\r\n }\r\n else if (i == 3)\r\n {\r\n var phone = x[3].value.search(/^\\d{3}-\\d{3}-\\d{4}$/);\r\n if (phone != 0)\r\n {\r\n x[3].style.backgroundColor = \"rgb(255,221,221)\";\r\n valid = false;\r\n }\r\n else x[3].style.backgroundColor = \"white\";\r\n }\r\n else if (i == 6)\r\n {\r\n var postal = x[6].value.search(/^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/);\r\n if (postal != 0)\r\n {\r\n x[6].style.backgroundColor = \"rgb(255,221,221)\";\r\n valid = false;\r\n }\r\n else x[6].style.backgroundColor = \"white\";\r\n }\r\n else\r\n {\r\n if (x[i].value == \"\")\r\n {\r\n x[i].style.backgroundColor = \"rgb(255,221,221)\";\r\n valid = false;\r\n }\r\n else x[i].style.backgroundColor = \"white\";\r\n }\r\n }\r\n return valid;\r\n}", "function validateUSAZipCode(field) {\n // empty fields pass validation\n if (field === undefined || field === null) {\n return true;\n }\n var regex = new RegExp(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/);\n return regex.test(field);\n}", "function city() {\n var errors = document.querySelector(\"#errors\");\n var city = document.querySelector(\"#city\");\n var name = city.value.trim();\n var patt = /^[a-z]{5,20}$/ig;\n if(!patt.test(name)) {\n errorMessage(\"<p>Please enter a valid city</p>\");\n return false;\n } else {\n return true;\n }\n}", "function cityValidation(){\n var valid = false;\n var city= document.getElementById(\"city\").value;\n \n if(city!= 0){\n valid=true;\n }\n else{\n alert(\"You have not chosen a city!\");\n }\n return valid;\n \n }", "function validateAddress(){\n var res = false\n if (myForm.F00000035h.toLowerCase() !== \"berlin\"){\n return false;\n }else if (myForm.F00000035h.toLowerCase() == \"berlin\") {\n if (myForm.bzrnr != '') {\n res = true;\n }\n }else{\n res = false\n } \n\treturn res;\n}", "function validSelectLocality() {\r\n\r\n var selectLocality = $selectLocality.val();\r\n\r\n if (selectLocality == '') {\r\n $selectLocality.addClass('is-invalid');\r\n } else {\r\n $selectLocality.removeClass('is-invalid');\r\n }\r\n }", "function validate_city (id) {\n\tvar pass1 = document.getElementById(id).value;\n\tif (!pass1.replace(/\\s/g, '').length) {\n\t\terror_msg_alert('It Should not allow spaces.');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse if (/^[a-zA-Z\\s ]+$/.test(pass1)) {\n\t\t$('#' + id).css({ border: '1px solid #ddd' });\n\t\treturn true;\n\t}\n\telse {\n\t\terror_msg_alert('Please enter valid city');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\t//alert(\"Use only letter in name!\");\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n}", "function checkCountryState(mode, sfuCountry, sfuStateprov) {\n\tvar currentState = $('#'+sfuStateprov+' option:selected').val();\n\t$('#'+sfuStateprov).empty();\t\t\t\t\t\t\t\t\t\t\t// clear existing options from state/province dropdown\n\tvar currentCountry = $('#'+sfuCountry).val();\n\n\t// Get country and states from JSON\n\tvar selectedCountry = countryState.filter(function(countryState) { return countryState.country == currentCountry });\n\n\tif ( selectedCountry.length > 0 ) {\n\t\tif ( selectedCountry[0].states.length > 0 ) {\n\t\t\t$('#'+sfuStateprov).prop('disabled', false);\t\t\t\t\t// enable state/province field\n\t\t\t$('#'+sfuStateprov).prop('required', 'required');\t\t\t\t// enable require field\n\n\t\t\tvar blankOption = new Option('', '');\t\t\t\t\t\t\t// add initial blank option to state/province select\n\t\t\t$('#'+sfuStateprov).append(blankOption);\n\n\t\t\t$(selectedCountry[0].states).each(function(index, element) {\t// load country's states\n\t\t\t\tvar o = new Option(element.name, element.code);\n\t\t\t\t$('#'+sfuStateprov).append(o);\n\t\t\t});\n\n\t\t\tif ( mode == 'init' ) {\t\t\t\t\t\t\t\t\t\t\t// if this is initiating the form, re-set the existing value loaded from contact\n\t\t\t\t$('#'+sfuStateprov+' option').prop('selected', false);\n\t\t\t\t$('#'+sfuStateprov+' option[value=\"'+currentState+'\"]').prop('selected', 'selected');\n\t\t\t\t$('#'+sfuStateprov).val(currentState);\n\t\t\t}\n\t\t}\n\t\telse {\t\n\t\t\t$('#'+sfuStateprov).prop('disabled', 'disabled');\t\t\t\t// disable field\n\t\t\t$('#'+sfuStateprov).removeProp('required');\t\t\t\t\t\t// do not require validation\n\t\t}\n\t}\n}", "function fnValidateMunicipality(oInput){\n\n\tvar sText = oInput.val();\n\tvar iMin = 2;\n\tvar iMax = 18;\n\n\t// checks for other than characters, ignore spaces\n\tvar regex = /^[æøåa-z\\s*ÆØÅA-Z\\s*]*$/;\n\tvar bRegexTest = regex.test(sText);\n\n\t// checks length and regex\n\tif( sText.length < iMin || sText.length > iMax ){\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else if (bRegexTest == false) {\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function checkInputValid() {\n const value = document.getElementById('location').value.toUpperCase();\n if (value.search(\"INDIA\") != -1)\n return true;\n alert(\"Invalid Place name\");\n return false;\n }", "function fnValidateStreet(oInput){\n\n\tvar sText = oInput.val();\n\tvar iMin = 2;\n\tvar iMax = 28;\n\n\t// checks for at least one character and one number, ignores spaces and commas.\n\tvar regex = /^([0-9\\s*]+[æøåa-zÆØÅA-Z\\s\\','*]+|[æøåa-zÆØÅAA-Z\\s\\','*]+[0-9\\s*]+)[0-9\\s\\','*æøåa-z\\s\\','*ÆØÅAA-Z\\s\\','*]*$/;\n\tvar bRegexTest = regex.test(sText);\n\n\t// checks length and regex\n\tif( sText.length < iMin || sText.length > iMax ){\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else if (bRegexTest == false) {\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function checkValidAddress (){\n \"use strict\";\n UpdateAddressInfor();\n if(address.firstName.value == \"\" || address.lastName.value == \"\" || address.streetName.value == \"\" || address.streetNumber == \"\" || address.postcode.value == \"\" || address.city.value == \"\"){\n return false;\n }\n return true;\n}", "function mapValidator()\n{\n var googleMapSearchInput = document.getElementById(\"pac-input\").value;\n if(googleMapSearchInput == null || googleMapSearchInput == \"\")\n {\n alert(\"Kérlek jelöld be az ingatlan helyét a térképen!\");\n }\n}", "function validateCity(){\r\n\t\r\n\t\r\n\tvar city = document.forms[\"form\"][\"City\"].value;\r\n\tvar pCity = document.getElementById(\"valCity\");\r\n\t\r\n\tif (city == \"\")\r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"City text field cannot contain more than 50 characters\";\r\n\t\tpCity.classList.remove(\"valid\");\r\n\t\tpCity.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if(city.length > 50)\r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"City text field cannot contain more than 50 characters\";\r\n\t\tpCity.classList.remove(\"valid\");\r\n\t\tpCity.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tpCity.innerHTML = \r\n\t\t\"Valid City\";\r\n\t\tpCity.classList.remove(\"invalid\");\r\n\t\tpCity.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "function postalCode() {\n var errors = document.querySelector(\"#errors\");\n var pCode = document.querySelector(\"#postalCode\");\n var code = pCode.value.trim();\n var patt = /^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/ig;\n if(!patt.test(code)) {\n errorMessage(\"<p>Please enter a valid Canadian postal code</p>\");\n return false;\n } else {\n return true;\n }\n}", "function validarCP1(cPostal){\n\n let provincias = {\n 1: \"Álava\", 2: \"Albacete\", 3: \"Alicante\", 4: \"Almería\", 5: \"Ávila\",\n 6: \"Badajoz\", 7: \"Islas Baleares\", 08: \"Barcelona\", 09: \"Burgos\", 10: \"Cáceres\",\n 11: \"Cádiz\", 12: \"Castellón\", 13: \"Ciudad Real\", 14: \"Córdoba\", 15: \"La Coruña\",\n 16: \"Cuenca\", 17: \"Gerona\", 18: \"Granada\", 19: \"Guadalajara\", 20: \"Guipúzcoa\",\n 21: \"Huelva\", 22: \"Huesca\", 23: \"Jaén\", 24: \"León\", 25: \"Lérida\",\n 26: \"La Rioja\", 27: \"Lugo\", 28: \"Madrid\", 29: \"Málaga\", 30: \"Murcia\",\n 31: \"Navarra\", 32: \"Orense\", 33: \"Asturias\", 34: \"Palencia\", 35: \"Las Palmas de Gran Canaria\",\n 36: \"Pontevedra\", 37: \"Salamanca\", 38: \"Santa Cruz de Tenerife\", 39: \"Cantabria\", 40: \"Segovia\",\n 41: \"Sevilla\", 42: \"Soria\", 43: \"Tarragona\", 44: \"Teruel\", 45: \"Toledo\",\n 46: \"Valencia\", 47: \"Valladolid\", 48: \"Vizcaya\", 49: \"Zamora\", 50: \"Zaragoza\",\n 51: \"Ceuta\", 52: \"Melilla\"\n };\n if(cPostal.length == 5 && cPostal <= 52999 && cPostal >= 1000){\n \n return provincias[parseInt(cPostal.substring(0, 2))];\n }\n if(patrones.patronCP.test(cp.value)){\n\n cp.className=\"form-control is-valid\";\n errorCP.classList.remove('mensajeError-activo');\n errorCP.classList.add('mensajeError-oculto');\n \n \treturn true;\n }\n else{\n cp.className=\"form-control is-invalid\";\n errorCP.classList.remove('mensajeError-oculto');\n errorCP.classList.add('mensajeError-activo');\n \t\treturn false;\n }\n}", "function check_region() {\n\n\t\tif($(\"#Región option:selected\").val() == 0) {\n \t\t$(\"#errorregion\").html(\"Seleccione una region\");\n\t\t\t$(\"#rrorregion\").show();\n\t\t\terror_region = true;\n\t\t} else {\n\t\t\t$(\"#errorregion\").hide();\n\t\t}\n\t}", "function validate() {\n if (!$scope.id.length || !$scope.pass.length || !$scope.name.length || !$scope.group.length ||\n !$scope.email.length || !$scope.phone.length || !$scope.workplace.length || !($scope.informed.email.length || \n $scope.informed.facebook.length || $scope.informed.webSite.length || $scope.informed.colleague.length || \n $scope.informed.other.length) || !($scope.population.elementary.length || \n $scope.population.highSchool.length || $scope.population.higherEducation.length || $scope.population.other.length)) {\n $scope.emptyData = true;\n } else { // Habilita\n $scope.emptyData = false;\n }\n }", "function validateZip(val, allowCanada) {\n var usZipRegex, caZipRegex, trimmed = trim(val);\n usZipRegex = new RegExp(/^\\d\\d\\d\\d\\d$/);\n caZipRegex = new RegExp(/[ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ] ?[0-9][ABCEGHJKLMNPRSTVWXYZ][0-9]/);\n if (usZipRegex.exec(val) != null) return true;\n if (allowCanada && caZipRegex.exec(val.toUpperCase()) != null) return true;\n\n return false;\n}", "function isValidPostalCode(code, country) {\n // debug.info( 'isValidPostalCode', code, country );\n code = $.trim(code);\n var format = getPostalCodeRegexMatrix(country);\n if (format) {\n if (code.length < parseInt(format.minlen)) {\n return false;\n }\n if (code.length > parseInt(format.maxlen)) {\n return false;\n }\n var re = new RegExp(format.regex);\n return re.test(code);\n }\n //getPostalCodeRegexMatrix will check the country as a key in the map postal_code_matrix, so for these countries which doesn't have postal code, we need to return true\n else if (format == '') {\n return true;\n }\n else {\n debug.log('No country found')\n return true;\n }\n}", "validateBankerName() {\n let bankerName = this.loby.bankerName;\n bankerName = bankerName.trim();\n let error = false;\n let message = '';\n\n if (bankerName) {\n if (bankerName.length < 3) {\n error = true;\n message = \"El nombre es demasiado corto\";\n }\n } else {\n error = true;\n message = \"Este campo es obligatorio\";\n }\n\n this.loby.bankerNameState.hasError = error;\n this.loby.bankerNameState.message = message;\n }", "function validateAirportInput(el) {\n\n if(el.value.length===0) {\n $(el).parent().removeClass('has-error has-success');\n } else if(/\\(([A-Z]*)\\)/.test(el.value)) { // found 3-letter airport code in parentheses\n $(el).parent().removeClass('has-error').addClass('has-success');\n } else {\n $(el).parent().removeClass('has-success').addClass('has-error');\n }\n }", "function validatePostcode() {\n var postcodeSelected = document.getElementById(\"postcodeFilter\");\n if(postcodeSelected.checkValidity() == false)\n {\n document.getElementById(\"postcodeError\").innerHTML = \"Invalid Australian Postcode\";\n return false;\n }\n else\n {\n document.getElementById(\"postcodeError\").innerHTML = \"\";\n return true;\n }\n}", "function validateState() {\r\n let state = document.getElementById(\"states\").value;\r\n\r\n if (state == \"\") {\r\n alert(\"Choose a state.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function cityValidation(city) {\r\n var pattern = /^[a-zA-Z]+$/;\r\n if (!pattern.test(city))\r\n displayError(`The city must only contain letters`);\r\n else return pattern.test(city);\r\n}", "validatePostalCode(postalCode) {\n if(postalCode==='') {\n return 'Postal code required';\n } else if (!/^\\d+$/.test(postalCode)) {\n return 'Postal code invalid'\n } else if (postalCode.length > 10 || postalCode.length < 2) {\n return 'Postal code invalid (must be between 2-10 digits)'\n }\n \n return '';\n }", "function ValidateZipData() \n{\n var bValid = true;\n allFields.removeClass(\"ui-state-error\");\n\n// TODO:\n// bValid = bValid && checkLength(name, \"city\", 3, 40);\n// bValid = bValid && checkLength(geoloc, \"geoloc\", 6, 80);\n// bValid = bValid && checkLength(population, \"population\", 5, 16);\n// bValid = bValid && checkLength(state, \"state\", 5, 16);\n\n// bValid = bValid && checkRegexp(name, /^[a-z]([0-9a-z_])+$/i, \"Username may consist of a-z, 0-9, underscores, begin with a letter.\");\n// bValid = bValid && checkRegexp(email, /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i, \"eg. [email protected]\");\n// bValid = bValid && checkRegexp(password, /^([0-9a-zA-Z])+$/, \"Password field only allow : a-z 0-9\");\n return bValid;\n}", "function validarProvincia() {\n // comprobaremos que el valor del elemento provincia es igual que alguno de los valores reales, si lo es, devolvera true, si no dara error.\n if ((document.getElementById(\"provincia\").value)!=\"C\" && (document.getElementById(\"provincia\").value)!=\"LU\" && (document.getElementById(\"provincia\").value)!=\"OU\" && (document.getElementById(\"provincia\").value)!=\"PV\"){\n document.getElementById(\"provincia\").value = \"error!\";\n document.getElementById(\"provincia\").focus();\n document.getElementById(\"provincia\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error, debes seleccionar una provincia.\";\n return false;\n }\n else {\n document.getElementById(\"provincia\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function postalValidation(){\n var valid = false;\n var postal= document.getElementById(\"postal\").value;\n const validPostal= /[a-zA-Z][0-9][a-zA-Z](-| |)[0-9][a-zA-Z][0-9]/;\n \n if(validPostal.test(postal)){\n valid=true;\n }\n else{\n alert(\"You have entered an invalid postal code!\");\n }\n return valid;\n \n }", "async function validateCountry(country) {\n const schema = {\n name: Joi.string().min(2),\n code: Joi.string()\n .min(2)\n .max(2)\n };\n return await schema.validate(country);\n}", "function postalCodeValidate(postal) {\n\n var regex = new RegExp(/^[A-Z]\\d[A-Z]( )?\\d[A-Z]\\d$/i);\n if (!regex.test(postal)){\n document.getElementById('postalcode').value = \"\" ;\n return false;\n }\n else{\n return true;\n }\n}", "function fnValidateRegion(oInput){\n\n\t// Gets region\n\tvar sText = oInput.parent().siblings('.selected').text();\n\n\t// Checks that the value is changed\n\tif (sText == \"Vælg region her..\") {\n\t\toInput.parent().parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function longitudeOnChange() {\n var longitude=$('#longitude').val().trim();\n //Error\n var longitude_error=$('#longitude_error');\n //Error Msg\n var msgError=\"Empty Field\";\n\n if(!longitude){\n longitude_error.text(msgError);\n longitude_error.show();\n }else{\n if(longitude.length<2){\n longitude_error.text(\"size must be between 2 and 20\");\n longitude_error.show();\n\n }else {\n longitude_error.hide();\n }\n\n }\n\n}", "function longitudeOnChange() {\n var longitude=$('#longitude').val().trim();\n //Error\n var longitude_error=$('#longitude_error');\n //Error Msg\n var msgError=\"Empty Field\";\n\n if(!longitude){\n longitude_error.text(msgError);\n longitude_error.show();\n }else{\n if(longitude.length<2){\n longitude_error.text(\"size must be between 2 and 20\");\n longitude_error.show();\n\n }else {\n longitude_error.hide();\n }\n\n }\n\n}", "function checkStreet() {\n let validDiv = '#validGata'\n let invalidDiv = '#invalidGata'\n let address = $('#validationCustom06').val()\n // let regPattern = /^[A-Za-z0-9ZäöåÄÖÅ ]*$/;\n let regPattern =\n /^(?=.*[0-9])(?=.*[a-zA-ZåäöÅÄÖ])(?=.*[\\s])[0-9a-zA-ZåäöÅÄÖ\\s]+$/\n let input = document.getElementById('validationCustom06')\n if (address.trim() == '') {\n $(validDiv).hide()\n $(invalidDiv).text('Adress krävs')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (!regPattern.test(address)) {\n $(validDiv).hide()\n $(invalidDiv).text('Ogiltig adress')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n return true\n }\n}", "function isAvaliableCountryCode(){\n var returnVal = false;\n\n id = document.getElementById('country'); \n countryCode = id.value;\n \n countryCode = countryCode.toUpperCase().trim(); \n\n var countryCodeRe = new RegExp(/^[A-Z]{2}$/i);\n\n if (countryCodeRe.test(countryCode.toString())) { \n id.value = countryCode;\n document.getElementById('country_error').style = \"display:none\"; \n return true;\n }\n else\n {\n document.getElementById('country_error').style = \"display:block\";\n return false;\n }\n}", "function addressOnChange () {\n var address=$('#address').val().trim();\n //Error\n var address_error=$('#address_error');\n //Error Msg\n var msgError=\"Empty Field\";\n\n if(!address){\n address_error.text(msgError);\n address_error.show();\n }else{\n if(address.length<2){\n address_error.text(\"size must be between 2 and 30\");\n address_error.show();\n\n }else {\n address_error.hide();\n }\n\n }\n\n}", "function checkCityLocation() {\n //For additional city\n if ($('#additionalcity').hasClass(\"required\")) {\n var city = $('#additionalcity').val();\n var state = $('#statelist option:selected').text();\n var country = $('#countrylist option:selected').text();\n geocodeAddress(city, state, country);\n } else {\n SubmitPage(current_page);\n }\n}", "function validateCity() {\n \n var x = document.getElementById(\"city\");\n var possibleCities = []; //initialize an empty array of possible cities\n\t\n\tx.value = capitalize(x.value);\n \n for (var i = 0; i < cities.length; i++) {\n if (cities[i].startsWith(x.value)) {\t\t//if an index has properly matched prefix, add to array\n possibleCities.push(cities[i]);\n }\n }\n \n if (possibleCities.length == 0) { //if no possible cities, invalid name\n x.value = \"\";\n alert(\"Error! City does not exist.\");\n }\n \n}", "function validate_state(theField) {\n\tif (theField.selectedIndex <= 0) {\n\t\talert(\"Please select a State or Territory.\");\n\t\ttheField.focus();\n\t\treturn false;\n\t}\n\treturn true;\n} // end validate_state", "function postcodeValid(postcode) {\n var regex = /([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})/\n var postcode = noSpacesPostcode(postcodeInput.value);\n if (regex.test(postcode)) {\n return true\n } else {\n throw new Error('Enter a valid postcode & category')\n }\n}", "function ValidateMandatoryVendors() {\n\tvar allValueValid = true;\n var invalidId = null;\n\t\n if (!ValidateTextBox(\"vendorNo1\")) {\n errorMessage.value += \"Please input the vendorNo!\\n\";\n invalidId = \"vendorNo1\";\n allValueValid = false;\n }\n\telse if (!ValidateInteger(\"vendorNo1\"))\n\t{\n\t\terrorMessage.value += \"VendorNo is not a whole number. Please input the vendorNo!\\n\";\n invalidId = \"vendorNo1\";\n allValueValid = false;\n\t}\n\t\n if (!ValidateTextBox(\"vendorName\")) {\n errorMessage.value += \"Please input the vendorName!\\n\";\n invalidId = \"vendorName\";\n allValueValid = false;\n }\n\tif (!ValidateTextBox(\"address1\")) {\n errorMessage.value += \"Please input the address1!\\n\";\n invalidId = \"address1\";\n allValueValid = false;\n }\n\tif (!ValidateTextBox(\"city\")) {\n errorMessage.value += \"Please input the city!\\n\";\n invalidId = \"city\";\n allValueValid = false;\n }\n\tif (!ValidateTextBox(\"prov\")) {\n errorMessage.value += \"Please input the province!\\n\";\n invalidId = \"prov\";\n allValueValid = false;\n }\n\telse if (!ValidateProvCountryCode(\"prov\")) {\n\t\terrorMessage.value += \"Wrong format! Please input the prov in two letters!\\n\";\n invalidId = \"prov\";\n allValueValid = false;\n\t}\n\t\n\tif (!ValidateTextBox(\"postCode\")) {\n errorMessage.value += \"Please input the postal code!\\n\";\n invalidId = \"postCode\";\n allValueValid = false;\n }\n\telse if (!ValidatePostalCode()){\n\t\terrorMessage.value += \"Postal code should have most 6 numbers or letters!\\n\";\n\t\tinvalidId = \"postCode\";\n\t\tallValueValid = false;\t\n\t}\n\t\n\tif (!ValidateTextBox(\"country\")) {\n errorMessage.value += \"Please input the country!\\n\";\n invalidId = \"country\";\n allValueValid = false;\n }\n\telse if (!ValidateProvCountryCode(\"country\")) {\n\t\terrorMessage.value += \"Wrong format! Please input the country in two letters!\\n\";\n invalidId = \"country\";\n allValueValid = false;\n\t}\n\t\n\tif (!ValidateTextBox(\"phone\")) {\n errorMessage.value += \"Please input the phone number!\\n\";\n invalidId = \"phone\";\n allValueValid = false;\n }\n\telse if (!ValidatePhoneFaxNumber(\"phone\")) {\n\t\terrorMessage.value += \"Wrong format! Please input the 10 digits phone number!\\n\";\n invalidId = \"phone\";\n allValueValid = false;\n\t}\n\n\tif (ValidateTextBox(\"fax\") && !ValidatePhoneFaxNumber(\"fax\")) {\n\t\terrorMessage.value += \"Wrong format! Please input the 10 digits fax number!\\n\";\n invalidId = \"fax\";\n allValueValid = false;\n\t}\n\t\n\tif (!allValueValid) {\n document.getElementById(invalidId).focus();\n }\n\n return allValueValid;\n}", "function validarCP2(cPostal){\n\n let comunidades = {\n 1: \"País Vasco\", 2: \"Castilla-La Mancha\", 3: \"Comunidad Valenciana\", 4: \"Andalucía\", 5: \"Castilla y León\",\n 6: \"Extremadura\", 7: \"Islas Baleares\", 08: \"Cataluña\", 09: \"Castilla y León\", 10: \"Extremadura\",\n 11: \"Andalucía\", 12: \"Comunidad Valenciana\", 13: \"Castilla-La Mancha\", 14: \"Andalucía\", 15: \"Galicia\",\n 16: \"Castilla-La Mancha\", 17: \"Cataluña\", 18: \"Andalucía\", 19: \"Castilla-La Mancha\", 20: \"País Vasco\",\n 21: \"Andalucía\", 22: \"Aragón\", 23: \"Andalucía\", 24: \"Castilla y León\", 25: \"Cataluña\",\n 26: \"La Rioja\", 27: \"Galicia\", 28: \"Madrid\", 29: \"Andalucía\", 30: \"Murcia\",\n 31: \"Navarra\", 32: \"Galicia\", 33: \"Asturias\", 34: \"Castilla y León\", 35: \"Islas Canarias\",\n 36: \"Galicia\", 37: \"Castilla y León\", 38: \"Islas Canarias\", 39: \"Cantabria\", 40: \"Castilla y León\",\n 41: \"Andalucía\", 42: \"Castilla y León\", 43: \"Cataluña\", 44: \"Aragón\", 45: \"Castilla-La Mancha\",\n 46: \"Comunidad Valenciana\", 47: \"Castilla y León\", 48: \"País Vasco\", 49: \"Castilla y León\", 50: \"Aragón\",\n 51: \"Ceuta\", 52: \"Melilla\"\n };\n if(cPostal.length == 5 && cPostal <= 52999 && cPostal >= 1000){\n\n return comunidades[parseInt(cPostal.substring(0, 2))];\n }\n if(patrones.patronCP.test(cp.value)){\n\n cp.className=\"form-control is-valid\";\n errorCP.classList.remove('mensajeError-activo');\n errorCP.classList.add('mensajeError-oculto');\n \treturn true;\n }\n else{\n cp.className=\"form-control is-invalid\";\n errorCP.classList.remove('mensajeError-oculto');\n errorCP.classList.add('mensajeError-activo');\n \treturn false;\n }\n}", "function getProvinceAbreviation(province) {\n switch(province) {\n case \"Newfoundland and Labrador\" : \n return \"NL\"\n break;\n case \"Prince Edward Island\":\n return \"PE\"\n break;\n case \"Nova Scotia\":\n return \"NS\"\n break;\n case \"New-Brunswick\":\n return \"NB\"\n break;\n case \"Quebec\":\n return \"QC\"\n break;\n case \"Ontario\":\n return \"ON\"\n break;\n case \"Manitoba\":\n return \"MB\"\n break;\n case \"Saskatchewan\":\n return \"SK\"\n break;\n case \"Alberta\":\n return \"AB\"\n break;\n case \"British-Columbia\":\n return \"BC\"\n break;\n case \"Yukon, Northwest Territories and Nunavut\":\n return \"TRs\"\n break;\n default:\n break;\n }\n}", "function ValidateCountry(subsidiari) {\r\n\ttry{\r\n\t\tvar country = '';\r\n\t\tif (subsidiari != '' && subsidiari != null) {\r\n\t\t\tcountry = nlapiLookupField('subsidiary', subsidiari, 'country');\r\n\t\t} else {\r\n\t\t\tcountry = nlapiGetContext().getSetting('SCRIPT', 'custscript_lmry_country_code_stlt');\r\n\t\t}\r\n\t\tif (country == 'PE') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\r\n\t\tnlapiLogExecution('ERROR', 'ValidateCountry', country);\r\n\r\n\t}catch(err){\r\n\t\tsendemail(' [ ValidateCountry ] ' +err, LMRY_script);\r\n\t}\r\n\treturn false;\r\n}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function loadProvince(event){\n\t\t\tselectProvince.html('<option value=\"\">Select Provinces...</option>');\n\t\t\tfor (i in provinces) {\n\t\t\t\tif ( provinces[i].provCode.indexOf(event.target.value) == 0 ) {\n\t\t\t\t\tselectProvince.append($('<option>', {\n\t\t\t\t\t value: provinces[i].provCode,\n\t\t\t\t\t text: provinces[i].provDesc\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function checkCity() {\n\tvar city = document.getElementById(\"city\").value;\n\tvar cityCheck = new RegExp(/([a-z]|[A-Z])/g);\n\t\n if (city == \"\"){\n\t} else {\n\t\tif(city.length > 2 && cityCheck.test(city)) { \n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not a city!\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t}\n}", "function checkOrt() {\n let validDiv = '#validOrt'\n let address = $('#validationCustom07').val()\n let invalidDiv = '#invalidOrt'\n let regPattern = /^[A-Za-zåäöÅÄÖ]*$/\n let input = document.getElementById('validationCustom07')\n if (address == '') {\n $(validDiv).hide()\n $(invalidDiv).text('Ort krävs')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (!regPattern.test(address)) {\n $(validDiv).hide()\n $(invalidDiv).text('Ogiltigt Ort')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n return true\n }\n}", "function BankValidation() {\n var Lo_Obj = [\"txtAsociateName\", \"txtBankName\", \"txtNatureAssociation\", \"textBankRAddres\"];\n var Ls_Msg = [\"Name\", \"Bank Name\", \"Nature Of Association\", \"Bank Addres\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n}", "function getChosenProvince(currentProvince){\n\n\tif (document.querySelector(\".filled\") != null){\n\t\tcurrentProvince = document.querySelector('.filled').id\n\t\tif (currentProvince === \"Limburg\"){\n\t\t\tcurrentProvince = \"Nederland\";\n\t\t}\n\t}\n\n\treturn currentProvince;\n}", "function validate(){\r\n\tremoveError();\r\n\tvar flag = true;\r\n\tvar countryCd = $(\"#countriesSelect\").val().trim();\r\n\tvar category = $(\"#category\").val().trim();\r\n\tif (countryCd == undefined || countryCd == null || countryCd == \"\"){\r\n\t\t/*$(\"#countriesSelect\").addClass(\"border-error\");\r\n\t\t$(\"#countriesSelect\").parent().append(generateHtmlError(\"EB-0007\", \"\"));*/\r\n\t\tshowError(\"country\");\r\n\t\tflag = false;\r\n\t}\r\n\t\r\n\tif (category == undefined || category == null || category == \"\"){\r\n\t\t/*$(\"#category\").addClass(\"border-error\");\r\n\t\t$(\"#category\").parent().append(generateHtmlError(\"EB-0003\", \"\"));*/\r\n\t\tshowError(\"category\");\r\n\t\tflag = false;\r\n\t}\r\n\treturn flag;\r\n}", "function validatePostcode(value,data,name,form)\n{\n var message = \"\";\n if(value === \"\")\n message = \"* Required\";\n else if (!value.match(/^[\\d]+$/))\n message = \"* Must be digits characters only\";\n else if (value.length < 3)\n message = \"* Invalid postcode\";\n\n if(message) {\n form.elements[name].define(\"invalidMessage\", message);\n return false\n }\n return true;\n}", "function countryselect(origin){\n if (origin.value == 'Default'){\n alert('Please select your nationality');\n return false;\n } else {\n return true;\n }\n \n}", "function LoadProvinces() {\n if (modelView.RegisterBranch.Id !== guidEmpty) {\n return;\n }\n var countryCode = $(\"#ddlCountry\").val();\n if (!countryCode) {\n return;\n }\n GetProvincesByIdCountry(countryCode, function (d) {\n modelView.Provinces(d);\n });\n}", "function valSearchUdhaarByCityInputs(obj) {\r\n if (validateSelectField(document.search_udhaar_by_city.searchUdhaarCity.value, \"Please select Udhaar City / Village!\") == false) {\r\n document.search_udhaar_by_city.searchUdhaarCity.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function validateAddress(field)\n{\n if(field == \"\")\n {\n return \"No Address was entered.\\n\";\n }\n else if(/[^a-zA-Z0-9.-\\s]/.test(field))\n {\n return \"Only spaces, a-z, A-Z, 0-9, - and . allowed in Addresses.\\n\";\n }\n return \"\";\n}", "function isValidateFirstAddress() {\r\n var x = document.getElementById(\"FirstAddress\");\r\n var regex = /^[a-zA-Z0-9\\s,'-]*$/; \r\n if (!x.value.match(regex)) {\r\n document.getElementById('validAddress').style.display = \"block\";\r\n document.getElementById('validAddressSpace').style.display = \"block\";\r\n isAddress = false;\r\n }\r\n else {\r\n document.getElementById('validAddress').style.display = \"none\";\r\n document.getElementById('validAddressSpace').style.display = \"none\";\r\n isAddress = true;\r\n }\r\n}", "function buildProvince (countryNodeElement, provinceNodeElement, selectedValue) {\n var selectedOption = getOption(countryNodeElement, selectedValue);\n var provinces = JSON.parse(selectedOption.getAttribute('data-provinces'));\n\n provinceNodeElement.options.length = 0;\n\n if (provinces.length) {\n buildOptions(provinceNodeElement, provinces)\n }\n\n return provinces;\n}", "function checkAccessoryPostalCodeError() {\n $regType = \"accessory\";\n $div = $( \"#accesssory-shipping-address #postalCode\" );\n $spanHelp = $( \"#reg-\" + $regType + \"-postalcode-help\" );\n if (($div.val() == \"\") || ($div.hasClass('error')) || ($div.parent().hasClass('error'))) {\n $spanHelp.show();\n } else {\n $spanHelp.hide();\n }\n}", "validate_company(value) {\n if (!this.cleanStringField(value)) return t(\"Организация не указана\");\n return \"\";\n }", "validateState(state) {\n if(state) {\n if(state.length === 2) {\n let re=/^[A-Z]+$/i\n if(re.test(state)){\n return true;\n } else {\n return false\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function validateAddress(field)\n{\n //Make sure field is not blank; unable to validate anything beyond that.\n if(field == \"\") return \"Please specify your address.\\n\";\n return \"\";\n}", "function latitudeOnChange() {\n var latitude=$('#latitude').val().trim();\n //Error\n var latitude_error=$('#latitude_error');\n //Error Msg\n var msgError=\"Empty Field\";\n\n if(!latitude){\n latitude_error.text(msgError);\n latitude_error.show();\n }else{\n if(latitude.length<2){\n latitude_error.text(\"size must be between 2 and 20\");\n latitude_error.show();\n\n }else {\n latitude_error.hide();\n }\n\n }\n\n}", "function latitudeOnChange() {\n var latitude=$('#latitude').val().trim();\n //Error\n var latitude_error=$('#latitude_error');\n //Error Msg\n var msgError=\"Empty Field\";\n\n if(!latitude){\n latitude_error.text(msgError);\n latitude_error.show();\n }else{\n if(latitude.length<2){\n latitude_error.text(\"size must be between 2 and 20\");\n latitude_error.show();\n\n }else {\n latitude_error.hide();\n }\n\n }\n\n}", "function citycompusory()\n{\t\n\tvar cityop='';\n\tvar nm='';\n\tcityop = $('city').getValue();\n\tnm = $('q').getValue();\n\tif(cityop == \"\"){\n\t\talert(\"Please select a city\");\n\t\treturn false;\t\n\t}\n\telse if(nm == \"\"){\n\t\talert(\"Company/Category name cannot be blank\");\n\t\treturn false;\t\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "function timezonesValidate(timezonesForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (timezonesForm.name.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền múi giờ!\\n\";\nvalidationVerified=false;\n}\nif (timezonesForm.timezone.selectedIndex==0)\n{\nerrorMessage+=\"Bạn chưa chọn múi giờ!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function validateOverRangeWhenEdit(){\n\t\tif($(\"#editFactoryDialog\").find(\"#txtShortName\").val().length>50 \n\t\t\t\t|| $(\"#editFactoryDialog\").find(\"#txtLongName\").val().length>100 || $(\"#editFactoryDialog\").find(\"#txtAddress\").val().length>200\n\t\t\t\t|| $(\"#editFactoryDialog\").find(\"#txtTel\").val().length>50 || $(\"#editFactoryDialog\").find(\"#txtFax\").val().length>50\n\t\t\t\t|| $(\"#editFactoryDialog\").find(\"#txtTaxNo\").val().length>50)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "validateAddress(address) {\n if(address==='') {\n return 'Address required';\n } else if (!(/^[A-Za-z\\u00C0-\\u017F\\s\\d]+$/.test(address))) {\n return 'Address invalid (only letters and numbers allowed)'\n }\n \n return '';\n }", "function checkRegion() {\n if (!regionInput.value) {\n errorMessage(regionInput, regionLabel, regionMessage, 'აირჩიეთ რეგიონი');\n regionInput.style.backgroundImage = \"url('./img/arrowDownRed.svg')\";\n return false;\n } else {\n hideErrorMessage(regionInput, regionLabel, regionMessage);\n return true;\n }\n}", "function languageeditvalidate(field)\n{\t\n\twith (field)\n\t{\t\t\t\t\n\t\t if(trim(langname.value)==\"\" || trim(langname.value)==null)\n\t\t\t{\n\t\t\talert(\"Enter the Language name\");\n\t\t\tlangname.focus();\n\t\t\treturn false;\n\t\t\t}\t\t\t\t\n\treturn true; \n\t}\n}", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "function checkPostalCodeValidity(form) {\n// Taken from URL: https://stackoverflow.com/questions/15774555/efficient-regex-for-canadian-postal-code-function/26788801\n\tvar value = form.postal_code.value;\n\tvar regex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n var match = regex.exec(value);\n if (match){\n if ( (value.indexOf(\"-\") !== -1 || value.indexOf(\" \") !== -1 ) && value.length == 7 ) {\n return true;\n } else if ( (value.indexOf(\"-\") == -1 || value.indexOf(\" \") == -1 ) && value.length == 6 ) {\n return true;\n }\n } else {\n\t\t window.alert(\"Postal code must be in the format A0A 0A0.\");\n return false;\n }\n\n}", "static checkStreet(street) {\n try {\n NonEmptyString.validate(street, STREET_CONSTRAINTS);\n return \"\";\n }\n catch (error) {\n console.error(error);\n return \"The address' street should not be empty or larger than 120 letters\";\n }\n }", "function stateValidation(){\n\t var state = document.getElementById(\"state\");\n\t\n\t\t\tif(state.value === \"\" )\n\t\t\t{\n\t\t\t\t document.getElementById(\"state_error\").innerHTML=\"**Please Provide the state .\";\n\t\t\t\t\tstate.focus();\t\t\t\t\t\n state.select();\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}", "function validation(userLocation) {\n if (userLocation.length === 5) {\n for( var i = 0; i < 5; i++) {\n if (userLocation.charCodeAt(i) >= 48 && userLocation.charCodeAt(i) <= 57) {\n console.log(\"it is a zip code\");\n }// end if\n else if ((userLocation.charCodeAt(i) >= 65 && userLocation.charCodeAt(i) <= 90) || (userLocation.charCodeAt(i) >= 97 && userLocation.charCodeAt(i) <= 121) ){\n console.log(\"It is a city\");\n } // end else of\n else {\n console.log(\"it is not a zip code or a city\");\n break;\n }// end else\n }//end for\n }// end if\n}// end function", "function regExpCity() {\n // Récupération des données saisies\n const cityValid = contact.city;\n // Injection du HTML\n const checkCity = document.querySelector(\"#cityErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^([A-Za-z]{3,20})?([-]{0,1})?([A-Za-z]{3,20})$/.test(cityValid)) {\n checkCity.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checkCity.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function validateState(e) {\n var re = /^[a-zA-Z]+$/;\n var test1 = re.test(e);\n // compare lower case states to lower case input\n var test2 = $.inArray(e.toLowerCase(), statesLower) > -1;\n return test1 && test2;\n}", "function controlAddress () {\n const Adresse = formValues.Adresse;\n\n if(regexAddress(Adresse)){\n \n document.querySelector(\"#Address_manque\").textContent = \"\";\n return true;\n }else{\n document.querySelector(\"#Address_manque\").textContent = \"Address: non valide\";\n alert(\"Address: non valide\");\n return false;\n }\n \n }", "function check_ciudad() {\n\n\t\tif($(\"#Ciudad option:selected\").val() == 0) {\n \t\t$(\"#errorciudad\").html(\"Seleccione una ciudad\");\n\t\t\t$(\"#rrorciudad\").show();\n\t\t\terror_vivienda = true;\n\t\t} else {\n\t\t\t$(\"#errorciudad\").hide();\n\t\t}\n\t}", "function validateName(fields, data, errors) {\n var re = /^[a-zA-Záéíóäëiöúàèììù_ ]{2,}$/;\n if (!(re.test(data[\"nom\"].value)) || !(re.test(data[\"prenom\"].value))) {\n errors.push(\"Les noms et prénoms doivent contenir uniquement des\" +\n \" lettres, espaces, tirets et au minimum 2 caractères.\");\n }\n}", "function validateShippingData(){\n if (!$scope.shippingData.FromDistrictID) {\n AlertError('Chưa chọn khu vực gửi hàng', 'Thông báo');\n return false;\n }\n if (!$scope.shippingData.ToDistrictID) {\n AlertError('Chưa chọn khu vực nhận hàng', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.ClientContactName || $scope.shippingData.ClientContactName.length == 0){\n AlertError('Vui lòng nhập tên người gửi', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.ClientContactPhone || $scope.shippingData.ClientContactPhone.length == 0){\n AlertError('Vui lòng nhập số điện thoại người gửi', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.CustomerName || $scope.shippingData.CustomerName.length == 0){\n AlertError('Vui lòng nhập tên người nhận', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.CustomerPhone || $scope.shippingData.CustomerPhone.length == 0){\n AlertError('Vui lòng nhập số điện thoại người nhận', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.CoDAmount || $scope.shippingData.CoDAmount < 10000){\n AlertError('Vui lòng nhập số tiền', 'Thông báo');\n return false;\n }\n if(!$scope.shippingData.ServiceID){\n AlertError('Vui lòng chọn gói cước vận chuyển', 'Thông báo');\n return false;\n }\n return true;\n\n }", "function validate_lat() {\n\t//$lat = floatval($lat);\n\n\twith ( document.form1 ) { \n\t\tvar errmess=''; \n\t\tif ( state.options[state.selectedIndex].value == \"AK\"){\n\t\t\t\tif(lat.value <51|| 72<lat.value ) {\n\t\t\t\t\terrmess +='- latitude entered is not within selected state, Alaska\\n';\n\t\t\t\t}\n\t\t}/*else if ( state.options[state.selectedIndex].value == \"HI\"){\n\t\t\t\tif (lat.value > 23 || lat.value < 18 ) {\n \t errmess += '- latitude entered is not within selected state, Hawaii\\n';\n \t\t }\n\t\t}*/else if (lat.value<24 || 50<lat.value ) {\n\t\t\terrmess += '- latitude entered is not within the US\\n';\n\t\t}\n\t\treturn errmess;\n\t} //with*/\n}", "function validatePostcode(postcode) {\n if (postcode >= 3000 && postcode <= 3207) {\n return true;\n } else if (postcode == 3800) {\n return true;\n } else {\n return false;\n }\n}", "validateForm() {\n return this.state.serviceName.length > 0 && this.state.description.length > 0 && this.state.location.length > 0 && this.state.category.length > 0 && this.state.url.length > 0\n }" ]
[ "0.6978302", "0.6485312", "0.62608373", "0.6251504", "0.62093073", "0.61184615", "0.6112493", "0.6112493", "0.606515", "0.5969102", "0.59423846", "0.592389", "0.5922719", "0.5921367", "0.5905196", "0.5889689", "0.58868885", "0.5867619", "0.5853295", "0.584024", "0.5809986", "0.5786583", "0.5777696", "0.5761023", "0.5755653", "0.5755633", "0.5728372", "0.57070285", "0.57017046", "0.5694505", "0.56508607", "0.56369114", "0.563597", "0.5629748", "0.56295323", "0.5613629", "0.5610663", "0.56054723", "0.5588684", "0.5585025", "0.558386", "0.5573693", "0.55604124", "0.5559209", "0.55436015", "0.5529857", "0.5508965", "0.54974896", "0.54974896", "0.54916686", "0.5485668", "0.54843706", "0.54838616", "0.5483138", "0.5482375", "0.5479251", "0.5474228", "0.5457287", "0.5446375", "0.5445448", "0.54420954", "0.5440167", "0.541409", "0.54059166", "0.5402394", "0.5400453", "0.53768116", "0.5371649", "0.53696984", "0.535337", "0.5352607", "0.5343432", "0.5330896", "0.5327129", "0.53257173", "0.531888", "0.5309944", "0.5309295", "0.5306897", "0.5306897", "0.5305452", "0.53047395", "0.52965355", "0.5292658", "0.52915984", "0.5289783", "0.5283996", "0.5277987", "0.5269205", "0.52667534", "0.5264925", "0.5253558", "0.5252116", "0.5236136", "0.5234758", "0.52310544", "0.52263016", "0.52217394", "0.5220171", "0.52171904" ]
0.67521983
1
Onsubmit validation only if email and password are valid!
function validateLogin() { if (loginEmailValid === true && loginPassValid === true) { return true; } else { loginValidateEmail(); loginValidatePassword(); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateForm() {\n if (email.value && password.value) {\n fieldvalidate = true;\n } else {\n submit.disabled = true\n submit.classList.add('false');\n }\n}", "function validateFields() {\n\tlname = document.getElementById(\"lname\").value;\n\tfname = document.getElementById(\"fname\").value;\n\tusername = document.getElementById(\"uname\").value;\n\t\n\tif (true) {\n\t\tvalidatePassword();\n\t}\n\tif(valForm.pwd.value != valForm.con_pwd.value){\n\t\talert(\"Error: Password MISMATCH !\");\n\t}\n\t\n\tif (fname.length <=8 ) {\n\t\talert(\"Error: First Name must contain at least 8 characters!\");\n\t}\n\tif (!validateEmail()) {\n\t\talert(\"Not a valid e-mail address ..\");\n\t}\n}", "function validateForm() {\n return email.length > 0 && password.length > 0;\n }", "function formValidation()\n {\n \n //Get Value\n //if user doesnt exist transfer to another page and ask details\n var email = document.getElementById('email').value.trim();\n var password = document.getElementById('password').value.trim();\n var isValidForm = true; \n // alert(email);\n\n //Validation Conditions here\n \n if (email.length < 1) {\n alert(\"Email is Required!\");\n \n } \n if(password.length < 1)\n alert(\"Password is Required!\");\n else\n signUpWithEmailPassword(email, password);\n \n //if isValidForm is true then form submits else submission is stopped\n \n }", "validate_form() {\n\t\tif (this.email_ok && this.email_match_ok && this.username_ok && this.login_ok && this.new_password_match_ok && this.required_ok) {\n\t\t\tthis.submit.classList.remove(\"disabled\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\tthis.submit.classList.add(\"disabled\");\n\t\t\treturn true;\n\t\t}\n\t}", "function validateForm() {\n return fields.email.length > 0 && fields.password.length > 0;\n }", "function submitForm(){\n checkRequired(formInputs);\n checkEmail(useremail);\n checkValidUsername(username);\n checkValidPassword(password, password2);\n}", "function submitForm(e) {\n const userDate = username.value.trim();\n const mailData = mail.value.trim();\n const passData = pass.value.trim();\n\n if (userDate === \"\") {\n inputChecker(username, \"enter you user name\", 1500);\n }\n if (mailData === \"\") {\n inputChecker(mail, \"enter you mail address\", 1500);\n }\n if (passData === \"\") {\n inputChecker(pass, \"enter you passeord\", 1500);\n }\n}", "function email_checker() {\n const email_value = email.value;\n\n if (validateEmail(email_value)) {\n errorMessageEmail.innerText = \"\";\n register.removeAttribute(\"disabled\");\n\n } else {\n errorMessageEmail.innerText = \"Invalid Email address.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function ValidateSubmit() {\n \n var x =NameCheck();\n var y =emailcheck();\n var z = passwordcheck();\n if (x && y && z) {\n return true;\n }\n else {\n return false;\n }\n}", "function validateForm() {\n let usernameErr = false;\n let passwordErr = false;\n let emailErr = false;\n let returnValue = true;\n\n if (usernameInput.value.length <= 3) {\n usernameInput.value = '';\n usernameInput.placeholder = \"Must be 4 or more digits\";\n usernameInput.classList.add('red-border');\n usernameErr = true;\n }\n\n if (passwordInput.value.length <= 5) {\n passwordInput.value = '';\n passwordInput.placeholder = \"Must be 6 or more digits\";\n passwordInput.classList.add('red-border');\n passwordErr = true;\n }\n\n if (!regex.test(emailInput.value)) {\n emailInput.value = '';\n emailInput.placeholder = \"Enter a valid email address\";\n emailInput.classList.add('red-border');\n emailErr = true;\n }\n\n if (emailErr || passwordErr || usernameErr) {\n const alertPanel = document.querySelector('#registration-alert');\n alertPanel.classList.remove('hidden');\n returnValue = false;\n }\n\n return returnValue;\n}", "function afficherEmail() {\n return isValidEmail(email.value);\n}", "function checkValidity(){\r\n if(test_pass && test_email && test_pass_bis) $(\"#submit\").attr(\"disabled\",false);\r\n else $(\"#submit\").attr(\"disabled\",true)\r\n}", "function validate_form(e) {\n var username = document.getElementById(\"username\").value;\n var password = document.getElementById(\"password\").value;\n if(username.trim() == ''){\n e.preventDefault();\n markAsError(\"username\", true);\n }\n else{\n markAsError(\"username\", false);\n }\n if(password.trim() == ''){\n e.preventDefault();\n markAsError(\"password\", true); \n }\n else{\n markAsError(\"password\", false);\n }\n}", "function validationEmail() {\n\n if (expressionReguliere.test(email.value)) {\n\n formulaire.submit();\n \n }\n else\n {\n \n error.innerHTML = \"L'adresse mail n'est pas valide\";\n error.style.color = 'red';\n \n } \n}", "function registrationSubmit(){\r\n\r\n\tif (validateRegistrationName()&&validateEmail()&&validatePhone()&&validateDate()&&validateVisa()&&validatePass()) {\r\n\r\n\t\talert(\"validation sucessful \");\r\n\t\treturn true;\r\n\r\n\t}\r\n\talert(\"validation unsucessful\");\r\n\treturn false;\r\n}", "function validateField() {\n var email = document.getElementById('email').value;\n\n if (emailSubmit(email)) {\n alert('Submitted!')\n document.forms[\"formInfo\"].reset();\n return true\n } else {\n alert('Please enter a valid email address.');\n highlightEmail();\n return false;\n\n }\n\n}", "function validationNoEmpty() {\n if (email.value == \"\" || username.value == \"\" || password.value == \"\") {\n\n error.innerHTML = \"Veuillez remplir tout les champs\";\n error.style.color = 'red';\n }\n else\n {\n validationEmail();\n }\n \n}", "submit() {\n if (this.isValid()) {\n this.props.onSubmit({\n email: this.state[EMAIL_FIELD].value,\n password: this.state[PASSWORD_FIELD].value\n })\n }\n }", "function registerFormValidation() {\n\n // Login Information\n var user = document.getElementById('register_username');\n var email = document.getElementById('register_email');\n var pass = document.getElementById('register_password');\n var repass = document.getElementById('register_re_password');\n\n if (email.value.trim() == \"\" || user.value.trim() == \"\" || pass.value.trim() == \"\" || repass.value.trim() == \"\") {\n if (email.value.trim() == \"\") {\n email.style.borderColor = 'red';\n }\n if (user.value.trim() == \"\") {\n user.style.borderColor = 'red';\n }\n if (pass.value.trim() == \"\") {\n pass.style.borderColor = 'red';\n }\n if (repass.value.trim() == \"\") {\n repass.style.borderColor = 'red';\n }\n } else {\n return true;\n }\n\n}", "function Validate() {\n\n if(document.getElementById(\"username\").value == \"\"){\n alert(\"Username is required\")\n return false;\n }\n\n if(document.getElementById(\"fullname\").value == \"\"){\n alert(\"Full Name is required\")\n return false;\n }\n\n if(document.getElementById(\"email\").value == \"\"){\n alert(\"Email is required\")\n return false;\n }\n\n if(document.getElementById(\"password\").value == \"\"){\n alert(\"Password is required\")\n return false;\n }\n\n // check if the two passwords match\n if (document.getElementById(\"password\").value != document.getElementById(\"password2\").value ) {\n alert(\"The two passwords do not match\")\n return false;\n }else{\n alert(\"Successfully register !!\")\n return true;\n }\n\n}", "isValidate() { return !((!this.checkEmail()) || (!this.checkPassword())) }", "function validateForm() {\n return username.length > 0 && password.length > 0;\n }", "function validation() \n { \n var nom = document.forms[\"contactForm\"][\"nom\"]; \n var prenom = document.forms[\"contactForm\"][\"prenom\"]; \n var email = document.forms[\"contactForm\"][\"email\"]; \n var adresse = document.forms[\"contactForm\"][\"adresse\"]; \n var ville = document.forms[\"contactForm\"][\"ville\"]; \n let regMail = new RegExp(\"^[A-Za-z][0-9A-Za-z-_\\.]+@[0-9A-Za-z-_\\.]+\\.[.][A-Za-z]{2,}$\",\"g\");\n let testEmail = !regMail.test(email.value);\n\n if (nom.value == \"\") \n { \n alert(\"Indiquez votre nom.\"); \n nom.focus(); \n return false; \n }\n if (prenom.value == \"\") \n { \n alert(\"Indiquez votre prénom.\"); \n prenom.focus(); \n return false; \n } \n if (adresse.value == \"\") \n { \n alert(\"Indiquez votre adresse.\"); \n adresse.focus(); \n return false; \n } \n if (email.value == \"\") \n { \n alert(\"Indiquez une adresse email.\"); \n email.focus(); \n return false; \n } \n if (testEmail) \n { \n alert(\"Indiquez une adresse email valide.\"); \n email.focus(); \n return false; \n }\n if (ville.value == \"\") \n { \n alert(\"Indiquez votre ville.\"); \n ville.focus(); \n return false; \n } \n return true; \n \n }", "function validateFormL(){\n var email = document.forms[\"login\"][\"email\"].value;\n var emailPattern=new RegExp(\"[A-Za-z.]+[0-9]*@[A-Za-z.]+\");\n var password = document.forms[\"login\"][\"password\"].value;\n\n if(email==\"\" || !emailPattern.test(email)){\n alert(\"L'email deve rispettare il formato richiesto (es. [email protected])\");\n return false;\n }\n if(password==\"\"){\n alert(\"Inserire la password\");\n return false;\n }\n}", "function loginSubmit(){\n\tif( ($(\"#email-login\").hasClass('inputsuc') && $(\"#pass-login\").hasClass('inputsuc')) || ($(\"#email-login1\").hasClass('inputsuc') && $(\"#pass-login1\").hasClass('inputsuc')) ){\n\t\treturn true;\n\t}else{\n\t\tnullFieldValidation('email-login');\n\t\tnullFieldValidation('pass-login');\n\n\t\tnullFieldValidation('email-login1');\n\t\tnullFieldValidation('pass-login1');\n\t\treturn false;\n\t}\n}", "function validateForm() {\n\n // Create all the placeholders for all the form information\n let username = document.forms[\"register\"][\"username\"];\n let password = document.forms[\"register\"][\"password\"];\n let passwordConfirmation = document.forms[\"register\"][\"confirmation\"];\n let email = document.forms[\"register\"][\"email\"];\n\n // Username field empty\n if (username.value == \"\")\n {\n window.alert(\"Please enter a Username\");\n username.focus();\n event.preventDefault();\n return false;\n };\n\n // Password field empty\n if (password.value == \"\")\n {\n window.alert(\"Please enter a Password\");\n password.focus();\n event.preventDefault();\n return false;\n };\n\n // Password confirmation doesn't match\n if (password.value != passwordConfirmation.value)\n {\n window.alert(\"Passwords do not match\");\n passwordConfirmation.focus();\n event.preventDefault();\n return false;\n };\n\n // Make sure email has \"@\"\n if (!email.value.includes(\"@\"))\n {\n window.alert(\"Must enter a valid email address\");\n email.focus();\n event.preventDefault();\n return false;\n };\n\n return true;\n}", "function validate_login(){\n\tvar email = document.getElementById(\"emailL\").value;\n\tvar password = document.getElementById(\"passwordL\").value;\n\tif ( email == null || email == \"\"){\n\t\talert (\"Please enter the email.\");\n\t\treturn false;\n\t}\n\tif ( password == null || password == \"\"){\n\t\talert (\"Please enter the password.\");\n\t\treturn false;\n\t}\n}", "function formValidation() {\n\n \n // var email = document.forms[\"regform\"][\"email\"].value;\n\n if (!formFilled()){\n var formValid = false;\n return formValid;\n } else if (!provIsSelected()) {\n var formValid = false;\n return formValid;\n \n } else if (!validatePO()) {\n var formValid = false;\n return formValid;\n } else{\n var formValid = true;\n return formValid;\n }\n}", "function validateForm() {\n return username.length > 0 && password.length > 0;\n }", "validateForm() {\r\n\t\treturn this.state.email.length > 0 && this.state.password.length > 0;\r\n\t}", "function checkValidInput() {\n if (userEmail.value) {\n if (userEmail.value === \"\" || userEmail.value === null) {\n emailErr.innerText = \"A valid email is required.\";\n }\n if (userPass.value === \"\" || userPass.val === null) {\n passErr.innerText = \"A valid password is required.\";\n } else {\n console.log(\n \"Email: \" + userEmail.value + \"\\n Password: \" + userPass.value\n );\n validateUserInfo();\n }\n }\n}", "function onSubmit(){\n\tvar result = true;\n\tresult = checkFirstName() && result;\n\tresult = checkLastName() && result;\n\tresult = checkHan() && result;\n\tresult = checkEmail() && result;\n\tresult = checkPhone() && result;\n\treturn result;\n}", "function validateForm() {\n\n\tvar valid = true;\n\n\tif (!validateField(\"firstname\"))\n\t\tvalid = false;\n\n\tif (!validateField(\"lastname\"))\n\t\tvalid = false;\n\n\tif (!checkPasswords())\n\t\tvalid = false;\n\n\tif (!checkEmail())\n\t\tvalid = false;\n\n\tif (valid)\n\t\tsubmitForm();\n\n\t// Return false to make sure the HTML doesn't try submitting anything.\n\t// Submission should happen via javascript.\n\treturn false;\n}", "function validateEmail(){\r\n\tvar submit = false;\r\n\tvar email =$(\"#email\").val();\r\n\t\r\n\t\tif(email ==''){\r\n\t\t\tsubmit = showError('email','Please fill email');\r\n\t\t}\r\n\t\telse if((!(regEmail.test(email))) || checkFreq(email) > 1){\r\n\t\t\tsubmit = showError('email',\"Please enter email in proper format\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsubmit = markFieldCorrect(\"email\");\r\n\t\t}\r\n\t\treturn submit;\r\n\t\r\n}", "function formValidation(){\n\n if(checkBothPasswords()&& checkPassword()&& checkName()&& checkLast()&& checkPhone()){\n return true;\n }\n else{\n console.log(\"Fix Problems\");\n alert('Failed Submittion. Please check both passwords, first name and last name and phone number');\n return false;\n\n }\n}", "function validateForm() {\r\n\tif((validateUsername()) && (validatePass()) && (validateRepPass()) && (validateAddress1())&& (validateAddress2()) && (validateZipCode() == true) && (validateCity()) && (validateLast()) && (validateFirst())&& (validatePhone()) && (validateEmail())) \r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}", "function validateSignUpForm(){\n\tconsole.log(\"VALIDATE SIGN UP FORM\")\n\tconsole.log(\"name: \" + validName);\n\tconsole.log(\"email: \" + validEmail);\n\tconsole.log(\"password: \" + validPassword);\n\tconsole.log(\"c password:\" + validConfirmPassword);\n\tif(validName && validEmail && validPassword && validConfirmPassword){\n\t\tdocument.getElementById('signUpFormId').submit();\n\t\tdocument.getElementById('signUpFormId').reset();\n\t}\n\telse if ((name == \"\") || (email === \"\") || (password === \"\") || (passwordConfirm === \"\")) {\n\t\tdocument.getElementById(\"formError\").innerHTML = \"<i class='fas fa-times'></i> Please fill in missing fields\";\n\t\treturn false;\n\t}\n}", "onSubmitData() {\n if (this.state.email == '' || this.state.password == '')\n alert(\"Please fill out all fields!\");\n else if(this.state.email != '' && this.state.password != '' && this.validInput(this.state.email))\n Actions.reset('dashBoard'); // Navigate to dashBoard screen\n }", "function validateSignUp() {\n \n\t//check to see if the username field is empty\n if (document.getElementById(\"name\").value == null || document.getElementById(\"name\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"fnameerror\").innerHTML= \"*first name not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"name\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the password field is empty\n\tif (document.getElementById(\"surname\").value == null || document.getElementById(\"surname\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"snameerror\").innerHTML= \"*surname not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"surname\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the age field is empty\n\tif (document.getElementById(\"age\").value == null || document.getElementById(\"age\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"ageerror\").innerHTML= \"*age not selected\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"age\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t//if the users submission returns no false checks, then tell the even handler to execute the onSubmit command\t\t\n\treturn true;\n\t\n}", "function pageValidation() {\n\n if ($('#names').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please Enter Full Name!');\n return false;\n }\n if ($('#email').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please Enter email id !');\n return false;\n }\n if ($('#password').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please enter password!');\n return false;\n }\n if ($('#repwd').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please re-Enter password!');\n return false;\n }\n if ($('#password').val() != $('#repwd').val()) {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Passwords do not match.!');\n return false;\n }\n return true;\n}", "function validate_email() {\n if (!valid_email(vm.email_address)) {\n vm.error_message = 'Please enter a valid email address';\n return;\n }\n reset_password();\n }", "function validation() {\n var nome = document.getElementById(\"nome\").value;\n var email = document.getElementById(\"email\").value;\n var assunto = document.getElementById(\"assunto\").value;\n var texto = document.getElementById(\"texto\").value;\n var emailReg = '^([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_.-]+)\\\\.([a-zA-Z]{2,5})$';\n var error = document.getElementById(\"error\")\n error.style.color = \"#ffe79a\"\n \n if (nome === '' || email === '' || assunto === '' || texto === '') {\n error.textContent = \"Por favor, preencha todos os campos!\" \n return false;\n } else if (!(email).match(emailReg)) {\n error.textContent = \"Email Invalido!\" \n return false;\n } else {\n document.getElementById(\"nome\").value = \"\"\n document.getElementById(\"email\").value = \"\"\n document.getElementById(\"assunto\").value = \"\"\n document.getElementById(\"texto\").value = \"\"\n error.textContent = \"Sucesso!\" \n document.querySelector('.show').style.display = \"none\";\n return true;\n }\n }", "function Validate() {\n \n \n wow = validateEmail();\n wow1 = validatePassword();\n\n if(wow && wow1)\n return true;\n else return false;\n \n \n // if (email.value == \"\") {\n // email.style.border = \"1px solid red\";\n // email_erro.textContent = \"Email is required\";\n // document.getElementById('email_erro').style.color = \"red\";\n // email.focus();\n // return false;\n // }\n\n // if (password.value.trim() == \"\") {\n // password.style.border = \"1px solid red\";\n // pass_error.textContent = \"Password is required\";\n // document.getElementById('pass_error').style.color = \"red\";\n // password.focus();\n // return false;\n // }\n}", "function validate() {\n let email = document.getElementById('email');\n let boton = document.getElementById('submit');\n let nombre = document.getElementById('nombre');\n let mensaje = document.getElementById('mensaje');\n if (validateEmail(email.value)) {\n email.style.borderColor = 'green';\n boton.style.opacity = '1';\n boton.disabled = false;\n } else {\n email.style.borderColor = 'red';\n alert(\"Revise su correo e intente de nuevo\");\n boton.disabled = true;\n boton.style.opacity = '0.5';\n }\n\n if (nombre.value == \"\" || mensaje.value == \"\") {\n alert(\"No debe dejar campos vacíos\");\n boton.disabled = true;\n boton.style.opacity = '0.5';\n } else {\n boton.disabled = false;\n boton.style.opacity = '1';\n }\n return false;\n}", "inputsValidated() {\n if (this.state.email === \"\") {\n // email field is empty\n alert(\"Email field must be filled out\");\n return false;\n }\n\n if (this.state.first_name === \"\") {\n // first name field is empty\n alert(\"First name field must be filled out\");\n return false;\n }\n\n if (this.state.last_name === \"\") {\n // last name field is empty\n alert(\"Last name field must be filled out\");\n return false;\n }\n\n if (this.state.password === \"\") {\n // last name field is empty\n alert(\"Password field must be filled out\");\n return false;\n }\n\n if (this.state.password !== this.state.passwordConfirm) {\n alert(\"Password fields must match. Try again\");\n return false;\n }\n return true;\n }", "formSubmitHandler() {\n this.usernameImmediately()\n this.usernameAfterDelay()\n this.emailAfterDelay()\n this.passwordImmediately()\n this.passwordAfterDelay()\n\n // If everything is PERFECT !!! \n if (this.username.isUnique && !this.username.errors &&\n this.email.isUnique && !this.email.errors &&\n !this.password.errors) {\n this.form.submit()\n }\n\n }", "validateForm() {\n return this.state.email.length > 0 && this.state.password.length > 0;\n }", "function checkForm() {\n if (theForm.usernameValid && theForm.passwordValid) {\n document.getElementById(\"submitButton\").disabled = false;\n } else {\n document.getElementById(\"submitButton\").disabled = true;\n }\n}", "function checkEmail() {\n if (validateEmail(this.value) === true) {\n setAccepted('email-validated');\n } else {\n setUnaccepted('email-validated');\n }\n}", "function validateForm() {\r\n return validatePassword() && validateState();\r\n}", "function validation(form) {\n function isEmail(email) {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n );\n }\n\n function isPostCode(postal) {\n if (\n /^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]( )?\\d[ABCEGHJKLMNPRSTVWXYZ]\\d$/i.test(\n postal\n ) ||\n /^\\d{5}$|^\\d{5}-\\d{4}$/.test(postal)\n )\n return true;\n else return false;\n }\n\n function isPhone(phone) {\n if (/^\\d{10}$/.test(phone)) return true;\n else return false;\n }\n\n function isPassword(password) {\n // Input Password and Submit [7 to 15 characters which contain only characters, numeric digits, underscore and first character must be a letter]</h2\n if (/^[A-Za-z]\\w{7,14}$/.test(password)) {\n return true;\n } else {\n return false;\n }\n }\n\n let isError = false;\n let password = '';\n\n validationFields.forEach((field) => {\n const isRequired =\n [\n 'firstName',\n 'LastName',\n 'email',\n 'address',\n 'postalCode',\n 'password',\n 'conPassword',\n ].indexOf(field) != -1;\n\n if (isRequired) {\n const item = document.querySelector('#' + field);\n\n if (item) {\n const value = item.value.trim();\n if (value === '') {\n setErrorFor(item, field + ' cannot be blank!');\n isError = true;\n } else if (field === 'email' && !isEmail(value)) {\n setErrorFor(item, 'Invalid Email Address!');\n isError = true;\n } else if (field === 'postalCode' && !isPostCode(value)) {\n setErrorFor(item, 'Invalid Postal Code!');\n isError = true;\n } else if (field === 'phone' && !isPhone(value)) {\n setErrorFor(item, 'Invalid Phone Number!');\n isError = true;\n } else if (field === 'password' && isPassword(value)) {\n setSuccessFor(item);\n password = value;\n } else if (field === 'password' && !isPassword(value)) {\n setErrorFor(\n item,\n ' Minimum 7 and Maximum 15 characters, numeric digits, underscore and first character must be a letter!'\n );\n isError = true;\n password = '';\n } else if (field === 'conPassword' && password !== value) {\n setErrorFor(item, 'Confirmation Password Not Match!');\n isError = true;\n } else {\n setSuccessFor(item);\n }\n }\n }\n });\n\n return isError === false;\n}", "function onsubmitHandler(event) {\n event.preventDefault();\n\n let invalid = false;\n\n for (let i = 0; i < document.register_form.elements.length; ++i) {\n const element = document.register_form.elements[i];\n if (element.type === \"text\" && element.onchange) {\n element.onchange();\n if (element.classList.contains(\"invalid\")) {\n invalid = true;\n }\n }\n }\n\n if (invalid) {\n invalidFilling();\n } else {\n warning();\n }\n}", "function emailVerify(){\n if(email.value != null || email.value != \"\"){ \n email_error.innerHTML = \"\";\n return true;\n }\n}", "function validateForm() {\n username = $(\"#username\").val();\n email = $(\"#email\").val();\n password = $(\"#password\").val();\n var re_password = $(\"#re-password\").val();\n var valid = true;\n\n if (username.length < 5) {\n printError(\"Your username needs to be at least 5 characters\");\n $(\"#username\").val(\"\").focus();\n\n valid = false;\n } else if (email.length == 0) {\n printError(\"You must enter an email!\");\n $(\"#email\").val(\"\").focus();\n\n valid = false;\n } else if (!validateEmail(email)) {\n printError(\"Your email doesn't look real\");\n $(\"#email\").val(\"\").focus();\n\n valid = false;\n } else if (password.length < 8) {\n printError(\"Your password needs to be atleast 8 characters long\");\n $(\"#re-password\").val(\"\");\n $(\"#password\").val(\"\").focus();\n\n valid = false;\n } else if (re_password != password) {\n printError(\"Your passwords doesn't match\");\n $(\"#re-password\").val(\"\");\n $(\"#password\").val(\"\").focus();\n\n valid = false;\n }\n\n return valid;\n}", "function checkForm(){\n\t\t\tvar usrname = document.getElementById(\"usrname\").value;\n\t\t\tvar pwd = document.getElementById(\"pwd\").value;\n\t\t\tvar repwd = document.getElementById(\"repwd\").value;\n\t\t\tvar email = document.getElementById(\"email\").value;\n\t\t\tvar reg1 = new RegExp('^([a-zA-Z0-9]{5,10})$');\n\t\t\tvar reg2 = new RegExp('^([a-zA-Z0-9]{1,15})+@([a-zA-Z0-9])+\\.([a-zA-Z]{2,4})$');\n\t\t\t\n\t\t\t if(($.trim(usrname).length == 0) ||\n\t\t\t ($.trim(pwd).length == 0) ||\t\n\t\t\t ($.trim(repwd).length == 0) ||\t\n\t\t\t ($.trim(email).length == 0)) {\n\t\t\t\n\t\t\t\t$(\"#msg\").get(0).innerHTML = \"Please do not leave section blank\";\n\t\t\t\t$(\"#usrname\").select();\n\t\t\t\t$(\"#usrname\").focus();\n\t\t\t\treturn false;\n\t\t\t} else if(pwd != repwd){\n\t\t\t\t$(\"#msg\").get(0).innerHTML = \"Your password doesn't match\";\n\t\t\t\t$(\"#usrname\").select();\n\t\t\t\t$(\"#usrname\").focus();\n\t\t\t\t return false;\n\t\t\t} else if(!(reg1.test(usrname) && reg1.test(pwd))) {\n\t\t\t\t$(\"#msg\").get(0).innerHTML = \"Not appropriate username or password, must be five to ten digits consisting of letters or numbers only\"\n\t\t\t\t$(\"#usrname\").select();\n\t\t\t\t$(\"#usrname\").focus();\n\t\t\t\treturn false;\n\t\t\t} else if(!reg2.test(email)){\n\t\t\t\t$(\"#msg\").get(0).innerHTML = \"Not appropriate form of email address\"\n\t\t\t\t$(\"#email\").select();\n\t\t\t\t$(\"#email\").focus();\n\t\t\t} else {\n\t\t\t\t$(\"#registerForm\").submit();\t\n\t\t\t}\t\t\t\n\t\t}", "function validateSignup() {\n if (\n isEmailValid == true &&\n isPassValid == true &&\n isPass2Valid == true &&\n isProvValid == true\n ) {\n return true;\n } else {\n validateEmail();\n validatePassword();\n validatePassword2();\n validateProvince();\n return false;\n }\n}", "function validate2() {\n if( document.form.email.value === \"\" ) {\n alert( \"Please provide your email or phone number!\" );\n document.form.email.focus() ;\n return false;\n }\n if( document.form.pass.value === \"\" ) {\n alert( \"Please provide your password!\" );\n document.form.pass.focus() ;\n return false;\n }\n return( true );\n }", "function submitForm() {\n if (theForm.usernameValid && theForm.passwordValid) {\n document.getElementById(\"signupForm\").submit();\n } else {\n document.getElementById(\"signupForm\").reset();\n }\n}", "function validation(){\n\tvar password= document.getElementById(\"password\").value\n\tvar username = document.getElementById(\"username\").value\n\n\tif (username == null || username == \"\") {\n\t\talert(\"Name must be filled out\")\n\t} else if(password == null || password == \"\") {\n\t\talert(\"The password must be filled\")\n\t} else if (password !== \"12345\") {\n\t\talert(\"INCORRECT password\")\n\t} else if(password == \"12345\" || username ==\"imelda\") {\n\t\talert(\"PREMIUM ACCESS\")\n\t}\n}", "function validateRegisterForm()\n{\n\tvar lname = validateLastName();\n\tvar email= validateEmail(\"registerForm\");\n\tvar fname =validateFirstName(\"registerForm\");\n\tvar password =passwordEqual();\n\tvar username =validateUsername();\n\tvar country = validateCountry();\n\tvar phone=validatePhone();\n\n\tif (lname&email&fname&password&username&country&phone)\n\t {\n\t \treturn true;\n\t }\n\treturn false;\n }", "function validate() {\n const password = document.getElementById(\"password-register\").value;\n const confirmPassword = document.getElementById(\"confirm-password-register\").value;\n if(password != confirmPassword){\n document.getElementById(\"passwordChangeMsg\").innerHTML = \"Password must be same !\";\n return false;\n }else{\n document.forms[\"form-password-recovery\"].submit();\n }\n}", "function validate(a) {\n var email = a.value;\n var email_invalid = false;\n if (!validateEmail(email)) {\n return true;\n }\n return false;\n}", "function validate_form(){\n\n\t//FORM FIELDS\n\t var first_name = document.getElementById('first_name').value;\n\t var last_name = document.getElementById('last_name').value;\n\t var email = document.getElementById('email').value;\n \t var password = document.getElementById('password').value;\n\t var password2 = document.getElementById('password2').value;\n\t\n\t//PASSWORD REG EXP CHECK\n\t var password_check = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/;\n\t\n\n\t//CHECK FOR EMPTY FIELDS\n\tif(\n\t\tfirst_name == \"\" ||\n\t\tlast_name == \"\" ||\n\t\temail == \"\" ||\n\t\tpassword == \"\" ||\n\t\tpassword2 == \"\"\n\t ) \n\t\t{ \n\t\t\tfirst_name = \"First Name\"\n\t\t\tdocument.getElementById('error_msg').innerHTML = \"Fields cannot be empty\";\n\t\t\tdocument.getElementById(\"error_msg\").focus();\n\t\t\treturn false;\n\t\t}else{}\n\t\n\t//CHECK FOR VALID EMAIL\n\tif(/(.+)@(.+){2,}\\.(.+){2,}/.test(email)) \n\t{}else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Email provided is not valid\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false\n\t}\n\n\t//CHECK FOR STRONG PASSWORD ENTRY\n\tif(password.length >= 8)\n\t{ \n\t\tif(password.match(password_check)){}\n\t\telse{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must contain at least an Uppercase, Lowercase and a Special Character. E.g. <b>ABcDef$G@ </b><br><i><b>This ensures tighter Security</b></i>\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;}\n }else{\n\t\tdocument.getElementById('error_msg').innerHTML = \"Password must be up to 8 characters long.<br><i><b>This ensures tighter Security</b></i>\";\n\t \tdocument.getElementById(\"error_msg\").focus();\n\t\treturn false;\n\t}\n\t\n \t//CHECK FOR PASSWORD MATCH\n\tif(password != password2) \n\t{ \n\t\tdocument.getElementById('error_msg').innerHTML = \"Passwords do not match,\";\n\t\tdocument.getElementById(\"error_msg\").focus();\n return false;\n }else{return true;}\n}", "function validarCampo() {\n \n //Se valida longitud del texto y que no este vacio\n validarLongitud(this);\n\n //Validar unicamente el email\n if (this.type === 'email'){\n validarEmail(this);\n }\n\n \n if (email.value !== '' && asunto.value !== '' && mensaje.value !== '') {\n btnEnviar.disabled = false;\n }\n}", "function validate() {\n if (validateEmail(email)) {\n $error.fadeOut();\n } else {\n $error.fadeIn();\n $error.text(email + \" E-mail не корректен\");\n }\n }", "function validateEmail(){\r\n\r\n \t\tvar email=document.getElementById(\"email\").value;\r\n\r\n\r\n \tif(email.length==0){\r\n\r\n \t\t\tprintError(\"email required\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n \tif(!email.match(/^[a-z0-9](\\.?[a-z0-9_-]){0,}@[a-z0-9-]+\\.([a-z]{1,6}\\.)?[a-z]{2,6}$/)){\r\n \t\tprintError(\"enter Valid email\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n\r\n\tprintSuccess(\"email\",\"green\",\"emailError\");\r\nreturn true;\r\n\r\n\r\n \t}", "validateAndSubmitForm() {\n if (!this.state.login.trim()) {\n this.setState({formError: this.props.translate('loginForm.pleaseEnterEmailOrPhoneNumber')});\n return;\n }\n\n this.setState({\n formError: null,\n });\n\n // Check if this login has an account associated with it or not\n fetchAccountDetails(this.state.login);\n }", "function submitCb(evt) {\n var empty=\"\";\n if(document.getElementById('registerFormCheck').checked) {\n var email=document.getElementById('email').value;\n var companyName=document.getElementById('companyName').value;\n var pw=document.getElementById('pw').value;\n var pwConfirm=document.getElementById('pwConfirm').value;\n\n if(email==empty || pw==empty || pwConfirm==empty || companyName==empty){\n evt.preventDefault();\n document.getElementById('submitErrorJS').innerHTML=\"please fill in correctly the form\"\n return false;\n }\n else if (!document.getElementById('termsAndConditionsCheck').checked) {\n evt.preventDefault();\n document.getElementById('submitErrorJS').innerHTML=\"Please accept the terms and conditions\"\n return false;\n }\n\n //ADD OTHER CHECKS\n }\n else {\n var email=document.getElementById('email').value;\n var pw=document.getElementById('pw').value;\n\n if(email==empty || pw==empty){\n evt.preventDefault();\n document.getElementById('submitErrorJS').innerHTML=\"please fill in correctly the form\"\n return false;\n }\n\n //ADD OTHER CHECKS\n }\n}", "function valida_email(email){\n if(!valida_campo(email,'email','erro_email')) return false;\n else if(email.indexOf('@') == -1 || email.indexOf('.com') == -1){\n document.getElementById('erro_email').innerHTML = \"E-mail inválido!\" ;\n formulario.email.focus();\n return false;\n }\n document.getElementById('erro_email').innerHTML = \"\" ; //limpar mensagem\n return true;\n}", "validateBeforeLogin() {\n const { email, password } = this.state\n let { emailError, passwordError } = this.state\n\n // set empty input error message if any of inputs are empty\n emailError = !email ? 'Email should not be empty' : emailError\n passwordError = !password ? 'Password should not be empty' : passwordError\n this.setState({ emailError, passwordError })\n\n // return false if the form contains any error\n return !emailError && !passwordError\n }", "function checkInputs() {\n\n // Remove the whitespace from the input fields, so that just the text that the user enters is used for validation...\n const userNameValue = userName.value.trim();\n const emailValue = email.value.trim();\n const passwordValue = password.value.trim();\n const passwordVerifyValue = passwordVerify.value.trim();\n // Make sure that the Username input has at least 5 characters,\n // If not, display an error message when the \"submit\" button is clicked...\n if(userNameValue === '') {\n displayErrorFor(userName, 'Username cannot be blank');\n } else {\n displaySuccessFor(userName);\n }\n\n // Make sure that the Email that the user inputs is a valid Email address,\n // If not, display an error message when the \"submit\" button is clicked...\n\n if(emailValue === '') {\n displayErrorFor(email, 'Email cannot be blank');\n } else if( !verifyEmail(emailValue)) {\n displayErrorFor(email, 'Please enter a valid Email address');\n } else {\n displaySuccessFor(email);\n }\n \n // Make sure that the password entered is at least 6 characters long,\n // If not, display an error message when the \"submit\" button is clicked...\n if(passwordValue === '') {\n displayErrorFor(password, 'Password cannot be blank');\n } else {\n displaySuccessFor(password);\n }\n \n // Make sure that when the password is re-entered in the \"Verify-Password\" input, it matches the first password input...\n // If not, display an error message when the \"submit\" button is clicked...\n if(passwordVerifyValue === '') {\n displayErrorFor(passwordVerify, 'Password cannot be blank');\n } else if\n (passwordVerifyValue !== passwordValue) {\n displayErrorFor(passwordVerify, 'Passwords must match');\n } else {\n displaySuccessFor(passwordVerify);\n }\n}", "function validateFormlogin() {\n\tif (document.forms[\"formlogin\"][\"email\"].value == \"\") {\n\t\talert(\"Email Tidak Boleh Kosong\");\n\t\tdocument.forms[\"formlogin\"][\"email\"].focus();\n\t\treturn false;\n\t}\n\tif (document.forms[\"formlogin\"][\"password\"].value == \"\") {\n\t\talert(\"Password Tidak Boleh Kosong\");\n\t\tdocument.forms[\"formlogin\"][\"password\"].focus();\n\t\treturn false;\n\t}\n\n\n}", "function validateRegistration(email, password, passwordCheck, city, county, address, postcode, firstName, secondName) {\n return (\n validateEmail(email) &&\n validatePassword(password, passwordCheck) &&\n validateCity(city) &&\n validateCounty(county) &&\n validateAddress(address) &&\n validatePostcode(postcode) &&\n validateName(firstName) &&\n validateName(secondName)\n )\n}", "validateForm() {\n return (\n this.state.email.length > 0 &&\n this.state.password.length > 7 &&\n this.state.password === this.state.confirmPassword\n );\n }", "function signupvalidate()\n{\n\n if(checkname()&&checkaddress()&&checkgender()&&checkdob()&&checkmail()&&phvalidate()&&checkusername()&&checkpassword()&&confirmpwd())\n {\n alert(\"Success\");\n return true;}\n else\n { alert(\"Please fill all fields\");\n return false;}\n}", "function loginSubmit(form) {\r\n var email = checkEmail(form);\r\n var password = checkPassword(form);\r\n \r\n return (email && password);\r\n}", "disableSubmit() {\n const { authError } = this.props\n const { error, email, password, passwordConfirm } = this.state\n let formNotCompleted = email.length === 0 && password.length === 0 && passwordConfirm.length === 0\n let formNotValid = (authError && authError.length !== 0) || error.length !== 0\n let wrongPassword = password !== passwordConfirm\n return formNotCompleted || formNotValid || wrongPassword\n }", "function validateEmail(){\n if (!formValue.email) {\n setErrors({...errors,email:'Email is required'})\n } else if (!/^[\\w-.]+@([\\w-]+.)+[\\w-]{2,4}$/.test(formValue.email)) {\n setErrors({...errors,email:'Email address is invalid'})\n }\n \n else setErrors({...errors,email:undefined}); \n \n }", "function validateEmail() {\n var pattern = /^([a-zA-Z])+([0-9a-zA-Z_\\.\\-])+\\@+(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5}$)$/;\n var user_email = document.getElementById(\"user_email\");\n\n if (user_email.value === \"\") {\n document.getElementById(\"alert_email\").innerHTML =\n \"this field cannot be empty\";\n\n return false;\n } else if (!user_email.value.match(pattern)) {\n document.getElementById(\"alert_email\").innerHTML =\n \"please enter valid email address\";\n\n return false;\n }\n document.getElementById(\"alert_email\").innerHTML = \"\";\n return true;\n}", "function validate(){\r\n validateFirstName();\r\n validateSubnames();\r\n validateDni();\r\n validateTelephone ();\r\n validateDate();\r\n validateEmail();\r\n if(validateFirstName() && validateSubnames() && validateDni() && validateTelephone() &&\r\n validateDate() && validateEmail()){\r\n alert(\"DATOS ENVIADOS CORRECTAMENTE\");\r\n form.submit(); \r\n }\r\n\r\n}", "function validateForm() {\n validateFirstName();\n validateLastName();\n validateStreet();\n validateCity();\n validateZipCode();\n}", "validateData() {\n if(_.isEmpty(this.refs.email.getValue()) || _.isEmpty(this.refs.pass.getValue()) || _.isEmpty(this.refs.username.getValue())) {\n return true;\n }\n }", "function isValidSignupInputs(firstName, lastName, email, password){\n if(!(firstName.value.match('^[a-zA-Z]+')) || firstName.value.length > 100 || firstName.value.length <= 0){\n alert('Please make sure your first name only has letters and is no more than 100 characters')\n firstName.value = ''\n return false\n }\n if(!(lastName.value.match('^[a-zA-Z]+')) || lastName.value.length > 100 || lastName.value.length <= 0){\n alert('Please make sure your last name only has letters and is no more than 100 characters')\n lastName.value = ''\n return false\n }\n if(!(email.value.match('^[a-zA-Z]+[a-zA-Z0-9|.]*@[a-z]*.(com|net|org)$')) || email.value.length > 100 || email.value.length <= 0){\n alert(\"Please make sure your email is an appropriate format and is no more than 100 characters\")\n email.value = ''\n return false\n }\n if(!(password.value.match('^[a-zA-Z]*$')) || password.value.length > 100 || password.value.length <= 7){\n alert(\"Please make sure your password only contains alphanumeric characters and that the password is between 8 and 10 characters\")\n password = ''\n return false\n }\n \n return true\n}", "function validateRegister()\n{\n //Initializing variables\n var fields = [\"first\", \"last\", \"email\", \"password1\", \"password2\"];\n var fieldname;\n var email = document.forms[\"registrationForm\"][\"email\"].value;\n var password1 = document.forms[\"registrationForm\"][\"password1\"].value;\n var password2 = document.forms[\"registrationForm\"][\"password2\"].value;\n \n //Defaulting submission = true\n var successfulSubmission = true;\n \n //Getting rid of previous error messages\n var errorMessages = document.getElementsByClassName('form-control-feedback');\n while(errorMessages[0]) {\n errorMessages[0].parentNode.removeChild(errorMessages[0]);\n }\n \n //Creating email regex\n var emailRegex = /^[a-z0-9]+@[a-z0-9]+\\.[a-z]+$/;\n \n //Looping through elements to find empty values\n var i, l = fields.length;\n for (i = 0; i < l; i++) \n {\n fieldname = fields[i];\n //Resetting the red outline around a form control\n document.forms[\"registrationForm\"][fieldname].parentNode.parentNode.className = \"form-group\";\n if (document.forms[\"registrationForm\"][fieldname].value === \"\") \n {\n //When an empty value is found, dynamically add an error message via a function\n createErrorParagraph(\"Can't be Empty\", fieldname);\n //Adding the red outline to the textbox\n document.forms[\"registrationForm\"][fieldname].parentNode.parentNode.className += \" has-error has-feedback\";\n //Setting preventing the submission from happening\n successfulSubmission = false;\n }\n }\n \n if (!email.match(emailRegex))\n {\n console.log('Email triggered');\n createErrorParagraph(\"Email must be in form: [email protected]\", \"email\");\n document.forms[\"registrationForm\"][\"email\"].parentNode.parentNode.className += \" has-error has-feedback\";\n successfulSubmission = false;\n }\n \n if (password1 != password2)\n {\n console.log('Password match triggered');\n createErrorParagraph(\"Passwords must match\", \"password2\");\n document.forms[\"registrationForm\"][\"password2\"].parentNode.parentNode.className += \" has-error has-feedback\";\n successfulSubmission = false;\n }\n \n console.log(\"getElementById launched and about to exit\");\n return successfulSubmission;\n}", "function validateForm() {\n isFormValid = true;\n\n validateName();\n validateEmail();\n validateDemand();\n validateOptions();\n\n if (isFormValid) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n\n }\n}", "checkForm() {\n // set empty string to make it easy to return + boolean to check whether it's successful\n var isSuccess = true;\n var message = \"\";\n\n var patt = new RegExp(\"@\")\n if (!patt.test(this.email)) {\n isSuccess = false;\n message += \"Email\\n\"\n }\n\n // return it with appropriate message\n if (isSuccess) {\n return \"Successfully Submitted!\";\n }\n else {\n return \"You must correct:\\n\" + message;\n }\n }", "validateCredentials() {\n Keyboard.dismiss();\n this.setState({ errors: \"\" });\n let valid = false;\n if (!(this.state.email.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i))) {\n this.refs.toast.show(\"Please enter a valid email\")\n }\n else if (this.state.password.length < 8) {\n this.refs.toast.show(\"Password should be at least of 8 characters\")\n } else {\n this.signinUser();\n }\n }", "function validateForm() {\n if($('.recipient input').val() === \"\") {\n return \"recipient\";\n }else if($('.first-name input').val() === \"\") {\n return \"first name\";\n }else if(emailAvailable === \"taken\") {\n return \"email\";\n }else if($('.password input').val().length < 4){\n return \"password\";\n }else{\n return \"success\";\n }\n }", "function validateForm(){\n // Set error catcher\n var error = 0;\n // Check name\n if(!validateName('reg_name')){\n document.getElementById('nameError').style.display = \"block\";\n error++;\n }\n // Validate email\n var x =document.getElementById('reg_email').value;\n if(!validateEmail(x)){\n document.getElementById('emailError').style.display = \"block\";\n error++;\n }\n // Validate animal dropdown box\n if(!validateSelect('Occupation')){\n document.getElementById('animalError').style.display = \"block\";\n error++;\n }\n if(!validatePassword('reg_pass')){\n document.getElementById('pass_Error').style.display = \"block\";\n error++;\n }\n // Don't submit form if there are errors\n if(error > 0){\n return false;\n }\n else if(error == 0){\n regfun();\n }\n }", "function validateForm(form) {\n\t\n\tvar regEx;\n\tvar msg = \"\";\n\tdocument.getElementById('user').innerHTML = msg;\n\tdocument.getElementById('userEmail').innerHTML = msg;\n\tdocument.getElementById('userPass1').innerHTML = msg;\n\tdocument.getElementById('userPass2').innerHTML = msg;\n\n\t// Check each field has a value\n\tif (form.username.value == '' || form.email.value == '' || form.password.value == '' || form.confirmpwd.value == '') {\n\t\tmsg = 'You must provide all the requested details.';\n\t\tdocument.getElementById('user').innerHTML = msg;\n\t\treturn false;\n\t}\n\t\n\t// Check the username\n\tregEx = /^[\\w{}]+$/; \n\tif(!regEx.test(form.username.value)) { \n\t\tmsg = \"Username must contain only letters, digits, underscores, and curly braces.\";\n\t\tdocument.getElementById('user').innerHTML = msg;\n\t\tform.username.focus();\n\t\treturn false; \n\t}\n\t\n\t//check email. should get ~99% of all of them\n\tregEx = /[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/;\n\tif(!regEx.test(form.email.value)) { \n\t\tmsg = \"Not a recognized email address syntax.\";\n\t\tdocument.getElementById('userEmail').innerHTML = msg;\n\t\tform.email.focus();\n\t\treturn false; \n\t}\n\n\t// Check that the password is sufficiently long (min 6 chars)\n\tif (form.password.value.length < 6) {\n\t\tmsg = 'Passwords must be at least 6 characters long.';\n\t\tdocument.getElementById('userPass1').innerHTML = msg;\n\t\tform.password.focus();\n\t\treturn false;\n\t}\n\t\n\t// At least one digit, one lowercase and one uppercase letter \n\tregEx = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/; \n\tif (!regEx.test(form.password.value)) {\n\t\tmsg = 'Passwords must contain at least one lowercase letter, one uppercase letter, and one digit.';\n\t\tdocument.getElementById('userPass1').innerHTML = msg;\n\t\tform.password.focus();\n\t\treturn false;\n\t}\n\t\n\t// Check password and confirmation are the same\n\tif (form.password.value != form.confirmpwd.value) {\n\t\tmsg = 'Your password and confirmation do not match.';\n\t\tdocument.getElementById('userPass2').innerHTML = msg;\n\t\tform.password.focus();\n\t\treturn false;\n\t}\n\t\n\tform.submit();\n\treturn true;\n}", "function validateRegister() {\n var alertStr = \"\";\n // regex checks and empty value checks on required inputs\n if (username !== null && username.value.length === 0)\n alertStr += \"Username is a required input\\n\";\n if (password !== null && password.value.length === 0)\n alertStr += \"Password is a required input\\n\";\n if (email !== null && email.value.length === 0)\n alertStr += \"Email is a required input\\n\";\n else if (email !== null && !emailRegex.test(email.value))\n alertStr += \"Email is an invalid format\\n\";\n if (birthday !== null && birthday.value.length === 0)\n alertStr += \"Birthday is a required input\\n\";\n else if (birthday !== null && !dateRegex.test(birthday.value))\n alertStr += \"Birthday is an invalid date\\n\";\n\n // any errors send an alert\n if (alertStr !== \"\")\n alert(alertStr);\n else\n window.location.href = \"/index.php\";\n}", "function emailValid() {\n\tvar domain = new RegExp(/^[A-z0-9.]{1,}@(?=(my.bcit.ca$|bcit.ca$|gmail.com$))/i); //checks email for single occurrence of @ and valid domain containing only valid characters.\n\tvar email = document.getElementById(\"email\").value;\n\tif (domain.test(email))\n\t{\n\t\t/*if (email exists in database) {\n\t\t\tdocument.getElementById(\"email\").value = \"Email already exists\"\n\t\t} else {whatever value to let form submit}*/\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email valid\"\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email invalid.\"\n\t\treturn false;\n\t}\n}", "function validateEmail(){\r\n\t\r\n\tvar email = document.forms[\"form\"][\"Email\"].value;\r\n\tvar pEmail = document.getElementById(\"valEmail\");\r\n\t\r\n\t\r\n\tif (email.match(/\\w+@\\w+\\.\\w+/) == null)\r\n\t{\r\n\t\tpEmail.innerHTML = \r\n\t\t\"Email should look like [email protected]\";\r\n\t\tpEmail.classList.remove(\"valid\");\r\n\t\tpEmail.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tpEmail.innerHTML = \r\n\t\t\"Valid Email Adress\";\r\n\t\tpEmail.classList.remove(\"invalid\");\r\n\t\tpEmail.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\r\n}", "function loginFormValid() {\n $(\"#loginForm\").validate({\n rules: {\n Email: {\n required: true,\n email: true\n },\n Password: {\n required: true,\n minlength: 6,\n maxlength: 16,\n pwcheck: true\n }\n }\n });\n }", "function check_ForgetPassword_form() {\n var username = document.getElementById(\"UsernameText\").value;\n\n\n var reg = new RegExp(\"^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$\"); //Verify the email address\n\n\n\n if (!reg.test(username)) {\n alert(\"Please input the right email address!!\");\n return false;\n }\n\n\n return true;\n\n}", "validateForm(values){\n const errors = {};\n const {email, password} = values;\n const atpos = email.indexOf(\"@\");\n const dotpos = email.lastIndexOf(\".\");\n\n if(!email || atpos < 0 || dotpos < atpos+1 || dotpos+2 > email.length) {\n errors.email = 'Enter valid email!';\n }\n if(password.search(/[0-9]/) < 0){\n errors.password = 'Your password should contain at least 1 number!';\n }\n if(password.search(/[a-z]/) < 0){\n errors.password = 'Your password should contain at least 1 lowercase letter!';\n }\n if(password.search(/[A-Z]/) < 0){\n errors.password = 'Your password should contain at least 1 uppercase letter!';\n }\n if(password.length < 6) {\n errors.password = 'Your password should be at least 6 characters long!';\n }\n\n return errors;\n }", "function checkValidity() {\r\n if (test_pass_bis && test_pass) $(\"#submit\").attr(\"disabled\", false);\r\n else $(\"#submit\").attr(\"disabled\", true);\r\n }", "function validateRecoveryForm()\n{\n\tif(validateEmail(\"passwordRecoveryForm\"))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validationEmail(email){ \n if (email.value == \"\"){ \n alert(\"Vous n'avez pas saisi d'adresse email.\", 'Erreur de saisie'); \n email.focus(); \n return false; \n } \n if (email.value.indexOf(\"@\", 0) < 0){ \n alert(\"Votre adresse email n'est pas valide.\", 'Erreur de saisie'); \n email.focus(); \n return false; \n } \n if (email.value.indexOf(\".\", 0) < 0){ \n alert(\"Votre adresse email n'est pas valide.\", 'Erreur de saisie'); \n email.focus(); \n return false; \n } \n return true; \n}", "function formValidation(user_name, last_Name, user_email, user_password, user_confirm_password){ \n var user_name = getInputVal(\"firstName\");\n var last_Name = getInputVal(\"userLastName\");\n var user_email = getInputVal(\"userEmail\"); \n var user_password = getInputVal(\"user_Password\");\n var user_confirm_password = getInputVal(\"user_Confirm_Password\"); \n\n if(user_name) {\n document.getElementById(\"firstNameError\").innerHTML = \"\"; \n }\n if(last_Name) {\n document.getElementById(\"firstLastError\").innerHTML = \"\"; \n }\n if(user_email) {\n document.getElementById(\"firstEmailError\").innerHTML = \"\"; \n }\n if(user_password) {\n document.getElementById(\"password_Error\").innerHTML = \"\"; \n }\n if(user_confirm_password) {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"\"; \n }\n else if(user_password != user_confirm_password) {\n document.getElementById(\"confirm_password_Error\").innerHTML = \"\";\n }\n }" ]
[ "0.77973723", "0.73340476", "0.729534", "0.72840893", "0.7278112", "0.7206739", "0.7162547", "0.7151993", "0.7134877", "0.7102971", "0.70591193", "0.7054292", "0.70416254", "0.70369434", "0.7016654", "0.69814956", "0.6975606", "0.6973842", "0.694773", "0.69462395", "0.69294745", "0.6922119", "0.6918867", "0.6905156", "0.6901409", "0.68999845", "0.6894903", "0.68679947", "0.6860572", "0.6851133", "0.6844304", "0.6840537", "0.68334764", "0.68273133", "0.6813345", "0.6811305", "0.6804875", "0.6803382", "0.6801872", "0.6794389", "0.67856574", "0.6785328", "0.67832667", "0.6758368", "0.67576134", "0.6750506", "0.674163", "0.6739646", "0.6736027", "0.67337525", "0.67315495", "0.67314667", "0.67163515", "0.67073566", "0.6704032", "0.6695283", "0.6694069", "0.6691007", "0.6686442", "0.66795117", "0.66779995", "0.6670648", "0.6670467", "0.66650665", "0.6652192", "0.665041", "0.66498595", "0.66488564", "0.66411597", "0.66405463", "0.6637412", "0.6636889", "0.6636841", "0.6626671", "0.6624352", "0.66204983", "0.6618863", "0.6612808", "0.6610212", "0.66054106", "0.66033566", "0.65958506", "0.6587888", "0.658395", "0.65824395", "0.6579416", "0.65784234", "0.65772927", "0.6577244", "0.6576892", "0.6576596", "0.65743905", "0.6571787", "0.6567756", "0.65621877", "0.6555319", "0.6554634", "0.65532166", "0.65477914", "0.6547402", "0.65411747" ]
0.0
-1
Onsubmit validation only if all are valid, if not, show errors
function validateSignup() { if ( signupEmailValid === true && signupPassValid === true && signupPass2Valid === true && signupProvValid === true ) { return true; } else { signupValidateEmail(); signupValidatePassword(); signupValidatePassword2(); signupValidateProvince(); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateOnSubmit(e) {\n // validate the entire form\n return this.runValidation(false);\n }", "function validateForm() {\n validateFirstName();\n validateLastName();\n validateStreet();\n validateCity();\n validateZipCode();\n}", "function onSubmitValidation(event) {\r\n var valid \t\t\t = true;\r\n var firstInvalidField = -1;\r\n var input \t\t\t = document.querySelectorAll(\"input\");\r\n\r\n for(var index = 0; index < input.length; index++) {\r\n\r\n var p = input[index].parentNode.parentNode.querySelector(\"p\");\r\n\r\n if (input[index].value.length == 0 && input[index].className == \"required\") {\r\n p.innerHTML = input[index].getAttribute(\"title\");\r\n input[index].style.backgroundColor = \"pink\";\r\n\r\n if (firstInvalidField == -1) {\r\n firstInvalidField = index;\r\n }\r\n }\r\n else {\r\n p.innerHTML = \"\";\r\n input[index].style.backgroundColor = \"white\";\r\n }\r\n }\r\n\r\n // Give focus to the first field in error\r\n if (firstInvalidField != -1) {\r\n input[firstInvalidField].focus();\r\n valid = false;\r\n }\r\n\r\n // Returning false cancels form submission\r\n return valid;\r\n}", "function validate(){\r\n validateFirstName();\r\n validateSubnames();\r\n validateDni();\r\n validateTelephone ();\r\n validateDate();\r\n validateEmail();\r\n if(validateFirstName() && validateSubnames() && validateDni() && validateTelephone() &&\r\n validateDate() && validateEmail()){\r\n alert(\"DATOS ENVIADOS CORRECTAMENTE\");\r\n form.submit(); \r\n }\r\n\r\n}", "function formSubmit(){\r\n // find all the input field\r\n // if the field's value is null give a thief warning and set the errorCount's value isn't 0\r\n var inputs = document.getElementsByTagName(\"input\");\r\n for(var i = 0; i < inputs.length; i += 1){\r\n var onblur = inputs[i].getAttribute(\"onblur\");\r\n if(onblur != null){\r\n if(inputs[i].value == \"\" || inputs[i].value == null){\r\n var errorType = onblur.split(\",\")[1].substring(2, onblur.split(\",\")[1].lastIndexOf(\")\") - 1);\r\n var configId = 0;\r\n for(var j = 0; j < validateConfig.length; j += 1){\r\n if(errorType == validateConfig[j].name){\r\n configId = j;\r\n }\r\n }\r\n var warning = inputs[i].parentNode.nextElementSibling || inputs[i].parentNode.nextSibling;\r\n var borderStyle = errorStyle[0];\r\n inputs[i].style.border = borderStyle.style;\r\n warning.innerHTML = validateConfig[configId].message;\r\n warning.style.color = \"red\";\r\n errorCount =+ 1;\r\n }\r\n }\r\n }\r\n \r\n if(errorCount > 0){\r\n var thief = document.getElementById(\"thief_warning\");\r\n thief.style.color = \"red\";\r\n thief.innerHTML = \"You must finish all the field...\";\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function validateOnSubmit() {\n\n var elem;\n\n var errs=0;\n\n // execute all element validations in reverse order, so focus gets\n\n // set to the first one in error.\n\n if (!validateTelnr (document.forms.demo.telnr, 'inf_telnr', true)) errs += 1; \n\n if (!validateAge (document.forms.demo.age, 'inf_age', false)) errs += 1; \n\n if (!validateEmail (document.forms.demo.email, 'inf_email', true)) errs += 1; \n\n if (!validatePresent(document.forms.demo.from, 'inf_from')) errs += 1; \n\n\n\n if (errs>1) alert('There are fields which need correction before sending');\n\n if (errs==1) alert('There is a field which needs correction before sending');\n\n\n\n return (errs==0);\n\n }", "function onsubmitHandler(event) {\n event.preventDefault();\n\n let invalid = false;\n\n for (let i = 0; i < document.register_form.elements.length; ++i) {\n const element = document.register_form.elements[i];\n if (element.type === \"text\" && element.onchange) {\n element.onchange();\n if (element.classList.contains(\"invalid\")) {\n invalid = true;\n }\n }\n }\n\n if (invalid) {\n invalidFilling();\n } else {\n warning();\n }\n}", "function onSubmitValidate(event) {\n var hasErrors = false;\n $(this).find(\".not-empty\").each(function(){\n if($.trim($(this).val()).length == 0) {\n //element value is empty\n $(this).css(\"border-color\",\"#db8\");\n $(this).css(\"background\",\"#ffc\");\n hasErrors = true;\n }\n });\n if(hasErrors){\n showError($(\"#emptyerror\").text());\n event.preventDefault();\n return !1;\n }\n}", "function validateForm() {\n isFormValid = true;\n\n validateName();\n validateEmail();\n validateDemand();\n validateOptions();\n\n if (isFormValid) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n\n }\n}", "function validateForm() {\n\t\tvar fieldsWithIllegalValues = $('.illegalValue');\n\t\tif (fieldsWithIllegalValues.length > 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tkenyaui.clearFormErrors('htmlform');\n\n\t\tvar ary = $(\".autoCompleteHidden\");\n\t\t$.each(ary, function(index, value) {\n\t\t\tif (value.value == \"ERROR\"){\n\t\t\t\tvar id = value.id;\n\t\t\t\tid = id.substring(0, id.length - 4);\n\t\t\t\t$(\"#\" + id).focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\tvar hasBeforeSubmitErrors = false;\n\n\t\tfor (var i = 0; i < beforeSubmit.length; i++){\n\t\t\tif (beforeSubmit[i]() === false) {\n\t\t\t\thasBeforeSubmitErrors = true;\n\t\t\t}\n\t\t}\n\n\t\treturn !hasBeforeSubmitErrors;\n\t}", "function ValidaForm() {\n if ($('#txtTitulo').val() == '') {\n showErrorMessage('El Título es obligatorio');\n return false;\n }\n if ($('#dpFechaEvento').val() == '') {\n showErrorMessage('La Fecha de publicación es obligatoria');\n return false;\n }\n if ($('#txtEstablecimiento').val() == '') {\n showErrorMessage('El Establecimiento es obligatorio');\n return false;\n }\n if ($('#txtDireccion').val() == '') {\n showErrorMessage('La Dirección es obligatoria');\n return false;\n }\n if ($('#txtPrecio').val() == '') {\n showErrorMessage('El Precio es obligatorio');\n return false;\n }\n return true;\n}", "function formValidation() {\n //* If validation of email fails, add the warning class to email input and set the display of warning message to inline.\n if (!validation.isEmailValid(email.value)) {\n email.classList.add(\"warning\");\n email.nextElementSibling.style.display = \"inline\";\n }\n //* If validation of name fails, add the warning class to name input and set the display of warning message to inline.\n if (!validation.isNameValid(name.value)) {\n name.classList.add(\"warning\");\n name.nextElementSibling.style.display = \"inline\";\n }\n /*\n * If validation of message fails, add the warning class to message text area and set the display of warning\n * message to inline\n */\n if (!validation.isMessageValid(message.value)) {\n message.classList.add(\"warning\");\n message.nextElementSibling.style.display = \"inline\";\n }\n /*\n *If validation of title fails, add the warning class to title input and set the display of warning\n *message to inline\n */\n\n if (!validation.isTitleValid(title.value)) {\n title.classList.add(\"warning\");\n title.nextElementSibling.style.display = \"inline\";\n }\n if (\n validation.isEmailValid(email.value) &&\n validation.isNameValid(name.value) &&\n validation.isTitleValid(title.valid) &&\n validation.isMessageValid(message.value)\n ) {\n return true;\n } else return false;\n}", "function OnSecondFormSubmit (event)\n{\n var e = document.forms[1].elements;\n \n OnMidasSubmit (event);\n valid = true;\n for (i=0;i<e.length;i++)\n {\n valid = valid && checkValidity(e[i]);\n }\n return valid;\n}", "onSubmit() {\n const {onSubmit,onError} = this.props;\n const {validateFields} = this.props.form;\n validateFields((errors,values)=>{\n\n if(errors){\n showMessage(getFirstError(errors));\n if(onError){\n onError(errors);\n }\n return;\n }\n if (onSubmit) {\n onSubmit(values);\n }\n });\n }", "function validateForm(){\n // Set error catcher\n var error = 0;\n // Check name\n if(!validateName('reg_name')){\n document.getElementById('nameError').style.display = \"block\";\n error++;\n }\n // Validate email\n var x =document.getElementById('reg_email').value;\n if(!validateEmail(x)){\n document.getElementById('emailError').style.display = \"block\";\n error++;\n }\n // Validate animal dropdown box\n if(!validateSelect('Occupation')){\n document.getElementById('animalError').style.display = \"block\";\n error++;\n }\n if(!validatePassword('reg_pass')){\n document.getElementById('pass_Error').style.display = \"block\";\n error++;\n }\n // Don't submit form if there are errors\n if(error > 0){\n return false;\n }\n else if(error == 0){\n regfun();\n }\n }", "function formHasErrors()\n{\n\tvar errorFlag = false;\n //validating all of the text fields to confirm the have options\n\tfor(let i = 0; i < requireTextFields.length; i++){\n\t\tvar textField = document.getElementById(requireTextFields[i])\n\t\t\n\t\tif(!hasInput(textField)){\n\t\t\t//display correct error message\n\t\t\tdocument.getElementById(requireTextFields[i] + \"_error\").style.display = \"inline\";\n document.getElementById(requireTextFields[i]).style.border = \"0.75px red solid\";\n \n\t\t\terrorFlag = true;\n\t\t} else {\n\t\t\t\n\t\t\t//after user enters the correct info this hides the border and error message\n\t\t\tdocument.getElementById(requireTextFields[i] + \"_error\").style.display = \"none\";\n\t\t\tdocument.getElementById(requireTextFields[i]).style.border = \"1px solid #e5e5e5;\";\n\t\t}\n\t}\n\treturn errorFlag;\n}", "function validateFieldsUF(){\n \n\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}//end validateFieldsUF", "function validateSubmitResults() {\n\tconsole.log(\"Calling from validator\");\n\tvar validated; \n // Select only the inputs that have a parent with a required class\n var required_fields = $('.required');\n // Check if the required fields are filled in\n \trequired_fields.each(function(){\n \t\t// Determite what type of input it is, and display appropriate alert message\n\t\tvar field, msg_string;\n \tif( $(this).hasClass('checkbox_container') || $(this).hasClass('radio_container') ){\n \t\tfield = $(this).find('input:checked');\n \t\tmsg_string = \"Please select an option\";\n \t}else{\n \t\tfield = $(this).find('input:text, textarea');\n \t\tmsg_string = \"Please fill in the field\";\n \t} \n\t\t// For the checkbox/radio check the lenght of selected inputs,\n\t\t// at least 1 needs to be selected for it to validate \n\t\t// And for the text, check that the value is not an empty string\n \t\tif( (field.length <= 0) || !field.val() ){\n \t\t\tconsole.log(\"Field length: \" + field.length);\n \t\t\t$(this).addClass('alert alert-warning');\n \t\t\tvar msg = addParagraph(msg_string, \"validator-msg text-danger\");\n \t\t\t// Check if there is already an alert message class, \n \t\t\t// so that there wouldn't be duplicates\n\t\t\tif( $(this).find('p.validator-msg').length == 0 ){\n \t$(this).find('.section-title').before(msg);\n }\n validated = false;\n \t\t}\n \t\telse{\n \t\t\t// Remove the alert classes and message\n \t\t\t$(this).find('p.validator-msg').detach();\n $(this).removeClass('alert-warning').removeClass('alert'); \n validated = true;\n \t\t}\n \t\t// Sanitize the inputs values\n \t\tif( validated ){\n \t\t\tvar answer = sanitizeString(field.val());\n \t\t\tfield.val(answer);\n \t\t}\n \t});\n\n\treturn validated;\n}", "function validate(){\n let isErrors = false;\n let firstName = formReserve['firstName'];\n let lastName = formReserve['lastName'];\n let phone = formReserve['phone'];\n let email = formReserve['email'];\n let age = formReserve['birthdate'];\n let quantity = formReserve['quantity'];\n let location = formReserve['location'];\n let cgv = formReserve['cgv'];\n document.querySelectorAll('.error').forEach(error => error.remove());\n document.querySelectorAll('.error--bg').forEach(error => error.classList.remove('error--bg'));\n if(!nameCheked(firstName.value)){\n isErrors = true;\n firstName.classList.add('error--bg');\n firstName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le prénom.'));\n }\n if(!nameCheked(lastName.value)){\n isErrors = true;\n lastName.classList.add('error--bg');\n lastName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le nom.'));\n }\n if(!isPhone(phone.value)){\n isErrors = true;\n phone.classList.add('error--bg');\n phone.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer un numéro de téléphone valide.'));\n }\n if(!isEmail(email.value)){\n isErrors = true;\n email.classList.add('error--bg');\n email.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une adresse mail valide.'));\n }\n if(!checkAge(age.value)){\n isErrors = true;\n age.classList.add('error--bg');\n age.insertAdjacentElement('afterend', createErrorSpan('Vous devez avoir au moins 18 ans.'));\n }\n if(!isNumeric(quantity.value)){\n isErrors = true;\n quantity.classList.add('error--bg');\n quantity.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une valeur comprise entre 0 et 99.'));\n }\n if(!atLeastOneCheck(location)){\n isErrors = true;\n location[0].parentNode.classList.add('error--bg');\n document.getElementsByClassName(\"formData\")[6].insertAdjacentElement('afterend', createErrorSpan('Vous devez choisir au moins une ville.'));\n }\n if(!checkboxChecked(cgv)){\n isErrors = true;\n document.getElementsByClassName(\"checkbox2-label\")[0].children[0].classList.add('error--bg');\n document.getElementsByClassName(\"checkbox2-label\")[0].insertAdjacentElement('afterend', createErrorSpan('Vous devez accepter les termes et conditions.'));\n }\n if(isErrors == true){\n return false;\n } else {\n let participant = {\n firstname: firstName.value,\n lastname: lastName.value,\n phonenumber: phone.value,\n email: email.value,\n birthdate: age.value,\n previousparticipations : quantity.value,\n location: location.value\n };\n const bio = () => {\n this.firstName + this.lastname + 'né(e) le' + this.birthdate + 'tél : ' + this.phonenumber + this.email + 'A déjà participé : ' + this.previousparticipation + 'à' + this.location + '.';\n } \n formReserve.style.display = 'none';\n modalBody.classList.add('message-sended');\n valmessage.innerHTML='Merci, votre formulaire a bien été envoyé !';\n modalBody.append(valmessage);\n buttonClose.classList.add('button','button:hover','button-close');\n buttonClose.innerHTML = \"Fermer\";\n modalBody.appendChild(buttonClose);\n buttonClose.addEventListener (\"click\", closeModal);\n return false; \n }\n}", "function validateFieldsUP(){\n \n var namePark = document.getElementById('txtName');\n var location = document.getElementById('txtLocation');\n var contact = document.getElementById('txtContact');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyLocation = false, emptyContact = false, \n emptyDescription = false;\n \n if(namePark.value.length < 2){//el parque est� vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(location.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorLocation').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorLocation').style.visibility = \"hidden\";\n }//end else\n \n if(contact.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorContact').style.visibility = \"visible\";\n emptyContact = true;\n }else{\n document.getElementById('msgErrorContact').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion est� vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyContact === true || emptyDescription === true || \n emptyLocation === true || emptyName === true){\n return false;\n }else{\n return true;\n }\n}", "function onXareltoSubmit() {\n //first clear error element\n var t = document.getElementById(\"errorElement\");\n t.innerHTML=\"\";\n if (!validateName()) {\n displayFormErrors(\"name\");\n return false;\n } else if (!validateZipCode()){\n displayFormErrors(\"zip\");\n return false;\n } else if (!validateTelephone()){\n displayFormErrors(\"telephone\");\n return false;\n } else if (!validateEmail()) {\n displayFormErrors(\"email\");\n return false;\n } else if(!validateConsent()){\n displayFormErrors(\"consent\");\n return false;\n }\n return true;\n}", "function valid() {\n if (fname.value != \"\") {\n fname.style.border = \"1px solid green\";\n errfname.innerHTML = \"\";\n }\n if (lname.value != \"\") {\n lname.style.border = \"1px solid green\";\n errlname.innerHTML = \"\";\n }\n if (email.value != \"\") {\n email.style.border = \"1px solid green\";\n erremail.innerHTML = \"\";\n }\n if (password.value != \"\") {\n password.style.border = \"1px solid green\";\n errpassword.innerHTML = \"\";\n }\n if (repassword.value != \"\") {\n repassword.style.border = \"1px solid green\";\n errrepassword.innerHTML = \"\";\n }\n}", "function formValidation(){\n //If-else statement for every item I want to check:\n submitButton.on(\"click\", function(event){\n if(name.val() === ''){\n event.preventDefault();\n $('#name-invalid').html('<p>*You must enter a name.</p>');\n $(window).scrollTop(0);\n name.addClass(\"invalid-field\");\n } else {\n $('#name-invalid').html(''); \n name.removeClass(\"invalid-field\");\n };\n if(emailField.val().match(emailRegex) === null){\n event.preventDefault();\n $('#email-invalid').html('<p>*You must enter a valid email address.</p>');\n $(window).scrollTop(0);\n emailField.addClass(\"invalid-field\");\n } else {\n $('#email-invalid').html(''); \n emailField.removeClass(\"invalid-field\");\n };\n if (totalCost === 0) {\n event.preventDefault();\n $('#activities-invalid').html('<p>*You must choose at least one activity.</p>');\n $(window).scrollTop(0);\n } else {\n $('#activities-invalid').html(''); \n };\n if(paymentField.val() === 'select_method') {\n event.preventDefault();\n $('#payment-invalid').html('<p>*You must select a payment method.</p>');\n $(window).scrollTop(0);\n paymentField.addClass(\"invalid-field\");\n } else {\n $('#payment-invalid').html(''); \n paymentField.removeClass(\"invalid-field\");\n };\n if(paymentField.val() === 'credit card') {\n if(creditCardNumberField.val().match(creditCardRegex) === null){\n event.preventDefault();\n $('#cc-num-invalid').html('<p>*You must enter a valid credit card number.</p>');\n $(window).scrollTop(0);\n creditCardNumberField.addClass(\"invalid-field\");\n } else {\n $('#cc-num-invalid').html(''); \n creditCardNumberField.removeClass(\"invalid-field\");\n };\n if(zipField.val().match(zipCodeRegex) === null){\n event.preventDefault();\n $('#zip-invalid').html('<p>*You must enter a valid 5-digit zip code.</p>');\n $(window).scrollTop(0);\n zipField.addClass(\"invalid-field\");\n } else {\n $('#zip-invalid').html(''); \n zipField.removeClass(\"invalid-field\");\n };\n if(cvvField.val().match(cvvRegex) === null){\n event.preventDefault();\n $('#cvv-invalid').html('<p>*You must enter a valid 3-digit CVV.</p>');\n $(window).scrollTop(0);\n cvvField.addClass(\"invalid-field\");\n } else {\n $('#cvv-invalid').html(''); \n cvvField.removeClass(\"invalid-field\");\n };\n };\n });\n}", "function validateForm() {\n\t\n\tvar error = 0;\n\t$('input').each(function(x,y) {\n\t\tvar val = $(y).val();\n\t\tif(!validate(y.name, val)) {\n\t\t\t$(y).css('border', 'solid 1px red')\n\t\t\terror = 1;\n\t\t} else {\n\t\t\t$(y).css('border', 'solid 1px 888');\n\t\t}\n\t});\n\t\n\t$('textarea').each(function(x,y) {\n\t\tvar val = $(y).val();\n\t\tif(!validate(y.name, val)) {\n\t\t\t$(y).css('border', 'solid 1px red')\n\t\t\terror = 1;\n\t\t} else {\n\t\t\t$(y).css('border', 'solid 1px 888');\n\t\t}\n\t});\n\t\n\tif(error === 1) {\n\t\treturn false;\n\t}\n}", "function validateEdit(){\n\t\n\t//check to see if the user left the name field blank\n\tif (document.getElementById(\"e_name\").value == null || document.getElementById(\"e_name\").value == \"\"){\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"e_nameerror\").innerHTML= \"*name not filled in\";\n\t\t\n\t\t//changes to the fields properties to highlight the incorrect field\n\t\tformAtt(\"e_name\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the user left the surname field blank\n\tif (document.getElementById(\"e_surname\").value == null || document.getElementById(\"e_surname\").value == \"\"){\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"e_snameerror\").innerHTML= \"*surname not filled in\";\n\t\t\n\t\t//changes to the fields properties to highlight the incorrect field\n\t\tformAtt(\"e_surname\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t//if the users submission returns no false checks, then tell the even handler to execute the onSubmit command\n\treturn true;\n}", "function ValidarFields() {\r\n\r\n\tif(document.getElementById('codigo').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el código del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('nombre').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el nombre del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('precio').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el precio del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n}", "function formValidation()\n{\n let principalCheck = document.forms[\"mortgageForm\"][\"principalAmount\"].value;\n if (isNaN(principalCheck) == true)\n {\n alert(\"Principal value must be a number\");\n return false;\n }\n else if (principalCheck < 0)\n {\n alert(\"Principal value must be positive\");\n return false;\n }\n let interestCheck = document.forms[\"mortgageForm\"][\"interestRate\"].value\n if (isNaN(interestCheck) == true)\n {\n alert(\"Interest value must be a number\");\n return false;\n }\n else if (interestCheck < 0)\n {\n alert(\"Interest rate must be positive\");\n return false;\n }\n else if (interestCheck > 100)\n {\n alert(\"Interest rate must be below 100%\");\n return false;\n }\n let termCheck = document.forms[\"mortgageForm\"][\"mortgageLength\"].value\n if (isNaN(termCheck) == true)\n {\n alert(\"Term length must be a number\");\n return false;\n }\n else if (termCheck < 5)\n {\n alert(\"Mortgage length must be at least five years\");\n return false;\n }\n else if (termCheck > 50)\n {\n alert(\"Mortgage length cannot be greater than fifty years\");\n return false;\n }\n}", "function validateFieldsIF(){\n \n console.log(\"ENTRA\");\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}", "function validateForm ()\n {\n\n //Variabele om errors bij te houden\n\n let numberOfErrors = 0;\n\n //Check voornaam\n\n let voornaam = document.getElementById(\"voornaam\");\n let voornaamSpan = document.querySelector(\"#voornaam + span\");\n\n if(voornaam.value.length > 30)\n {\n voornaam.style.borderColor = \"red\";\n voornaamSpan.innerText = \"max 30 karakters !\";\n voornaamSpan.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(voornaam, voornaamSpan, numberOfErrors);\n\n }\n\n //Check familienaam\n\n let familienaam = document.getElementById(\"familienaam\");\n let familienaamSpan = document.querySelector(\"#familienaam + span\");\n\n if(familienaam.value === '' || familienaam.value === ' ')\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Het veld is verplicht !\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else\n {\n if(familienaam.value.length > 50)\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Max 50 karakters\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(familienaam, familienaamSpan, numberOfErrors);\n }\n }\n\n\n\n //Check geboortedatum\n\n let geboortedatum = document.getElementById(\"geboortedatum\");\n let geboortedatumSpan = document.querySelector(\"#geboortedatum + span\");\n\n\n //Gebruik regex expressie. Bemerk dat de expressie tussen twee slashes moet staan.\n\n let regex = /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/;\n\n //We gebruiken de test() method die we aanroepen over een regex expressie\n //Zie https://www.w3schools.com/js/js_regexp.asp\n //Check dat geboortedatum niet leeg is en dan niet aan het patroon voldoet\n\n if(geboortedatum.value !== '' && regex.test(geboortedatum.value) === false)\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Formaat is niet YYYY-MM-DD !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n //Check of geboortedatum leeg is\n\n if(geboortedatum.value === '')\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Geboortedatum is een verplicht veld !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(geboortedatum, geboortedatumSpan, numberOfErrors);\n }\n }\n\n //Check e-mail\n\n let email = document.getElementById(\"email\");\n let emailSpan = document.querySelector(\"#email + span\");\n\n //Regex voor mail geplukt van https://emailregex.com/\n\n regexMail =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\n //Check email tegen regexMail\n\n if(regexMail.test(email.value) === false)\n {\n numberOfErrors += 1;\n email.style.borderColor = \"red\";\n emailSpan.innerText = \"Geen geldig email adres !\";\n emailSpan.style.color = \"red\";\n }\n\n else\n {\n //Check of email ingevuld is\n\n if(email.value === '' || email.value === ' ')\n {\n numberOfErrors += 1;\n emailSpan.innerText = \"Verplicht veld !\";\n emailSpan.style.color = \"red\";\n email.style.borderColor = \"red\";\n }\n else\n {\n resetStyle(email, emailSpan, numberOfErrors);\n }\n }\n\n //Check aantal kinderen\n\n let aantalKinderen = document.querySelector(\"#aantalKinderen\");\n let aantalKinderenSpan = document.querySelector(\"#aantalKinderen + span\");\n\n if(aantalKinderen.value < 0)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"is geen positief getal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n if(aantalKinderen.value > 99)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"te hoog aantal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(aantalKinderen, aantalKinderenSpan, numberOfErrors);\n }\n }\n\n //Geef alert als het formulier volledig correct is\n\n if(numberOfErrors === 0)\n {\n alert(\"formulier correct ingevuld !\")\n }\n }", "function validateForm() {\n\t// get the values from the inputs\n\tconst firstNameValue = firstName.value.trim();\n\tconst lastNameValue = lastName.value.trim();\n\tconst emailValue = email.value.trim();\n\tconst phoneValue = phone.value.trim();\n\tconst countryValue = country.value.trim();\n\tconst cityValue = city.value.trim();\n\tconst businessValue = business.value.trim();\n\tconst roleValue = role.value.trim();\n\tconst addressValue = address.value.trim();\n\tconst passwordValue = password.value.trim();\n\tconst password2Value = password2.value.trim();\n\n\t// Check Firstname\n\tif (firstNameValue === \"\") {\n\t\tsetErrorFor(firstName, \"First name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(firstName);\n\t}\n\n\t// Check Firstname\n\tif (lastNameValue === \"\") {\n\t\tsetErrorFor(lastName, \"Last name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(lastName);\n\t}\n\n\t// Check Email\n\tif (emailValue === \"\") {\n\t\tsetErrorFor(email, \"Email cannot be blank\");\n\t} else if (!isEmail(emailValue)) {\n\t\tsetErrorFor(email, \"Please enter a valid email\");\n\t} else {\n\t\tsetSuccessFor(email);\n\t}\n\n\t// Check Number\n\tif (phoneValue === \"\") {\n\t\tsetErrorFor(phone, \"Phone number cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(phone);\n\t}\n\n\t// Check country\n\tif (countryValue === \"\") {\n\t\tsetErrorFor(country, \"Please select a country\");\n\t} else {\n\t\tsetSuccessFor(country);\n\t}\n\n\t// Check City\n\tif (cityValue === \"\") {\n\t\tsetErrorFor(city, \"Please enter a city\");\n\t} else {\n\t\tsetSuccessFor(city);\n\t}\n\n\t// Check business\n\tif (businessValue === \"\") {\n\t\tsetErrorFor(business, \"School cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(business);\n\t}\n\n\t// Check role\n\tif (roleValue === \"\") {\n\t\tsetErrorFor(role, \"Please select a role\");\n\t} else {\n\t\tsetSuccessFor(role);\n\t}\n\n\t// Check addresss\n\tif (addressValue === \"\") {\n\t\tsetErrorFor(address, \"Please enter a address\");\n\t} else {\n\t\tsetSuccessFor(address);\n\t}\n\n\t// Check passwords\n\tif (passwordValue === \"\") {\n\t\tsetErrorFor(password, \"Password cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\t// Check password2\n\tif (password2Value === \"\") {\n\t\tsetErrorFor(password2, \"Password confirmation is required\");\n\t} else if (password2Value !== passwordValue) {\n\t\tsetErrorFor(password2, \"Passwords do not match\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\tif (genders[0].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\t\treturn true;\n\t} else if (genders[1].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\n\t\treturn true;\n\t} else {\n\t\t// no checked\n\t\tsetErrorFor(genderInput, \"Please select a gender\");\n\t\treturn false;\n\t}\n}", "function checkForm(e) {\n var inputlist = document.getElementsByClassName(\"required\"); // Make an array of required inputs\n var empties = new Array(); // Create a blank list for empty fields\n // Check for empty fields, an add them to the empty list\n for( var i = 0; i < inputlist.length; i++ )\n if(Form.Element.getValue(inputlist[i]) == \"\"){\n empties.push($(inputlist[i]).getAttribute(\"id\"));\n }\n else {\n $(inputlist[i]).style.border=\"1px solid #333\";\n }\n // If there are empty fields, highight them\n if(empties.length > 0) {\n var i = 0;\n while( i < empties.length ) {\n $(empties[i]).style.border=\"2px solid #a00\";\n i++;\n }\n $(\"formerror\").style.display=\"inline\";\n Event.stop(e);\n }\n else {\n // Cosmetic: Reset all of the checked fields to the regular style\n for( var i = 0; i < inputlist.length; i++ )\n $(inputlist[i]).style.border=\"1px solid #333\";\n // If there aren't empty fields, submit the form\n return true;\n }\n}", "function isValidUpdateForm() {\n\tvar name = $(\"#name-update\").val();\n\tvar date = $(\"#date-update\").val();\n\tvar score = $(\"#scores-update\").val();\n\t\n\tvar checkName = isValidName(name);\n\tvar checkDate = isValidDate(date);\n\tvar checkScore = isValidScore(score);\n\t\n\t$(\"#invalid-name-update\").html(\"\");\n\t$(\"#invalid-date-update\").html(\"\");\n\t$(\"#invalid-score-update\").html(\"\");\n\t\n\tif (!checkName || !checkDate || !checkScore) {\n\t\tif (!checkName) {\n\t\t\t$(\"#invalid-name-update\").html(\"Invalid student's name\");\n\t\t}\n\t\tif (!checkDate) {\n\t\t\t$(\"#invalid-date-update\").html(\"Invalid student's date\");\n\t\t}\n\t\tif (!checkScore) {\n\t\t\t$(\"#invalid-score-update\").html(\"Invalid student's score\");\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "function formValidation() {\n\t\t// Check for empty fields\n\t\tif ( contactName.val() == \"\" || contactEmail.val() == \"\" || validateEmail(contactEmail.val()) != true || contactMessage.val() == \"\" ) {\n\t\t\t// Check for ever field if empty -> apply border\n\t\t\tif ( contactName.val() == \"\" ) { contactName.addClass(\"form__invalid__border\"); } else { contactName.removeClass(\"form__invalid__border\"); }\n\t\t\tif ( contactEmail.val() == \"\" ) { contactEmail.addClass(\"form__invalid__border\"); } else { \n\t\t\t\tif ( validateEmail(contactEmail.val()) ) {\n\t\t\t\t\tcontactEmail.removeClass(\"form__invalid__border\"); \n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( contactMessage.val() == \"\" ) { contactMessage.addClass(\"form__invalid__border\"); } else { contactMessage.removeClass(\"form__invalid__border\"); } \n\t\t} \n\t\t// If fields aren't empty and email valid\n\t\telse {\n\t\t\t// Remove all validation borders\n\t\t\tcontactName.add(contactEmail).add(contactMessage).removeClass(\"form__invalid__border\");\n\t\t\n\t\t\treturn true;\n\t\t}\n\t}", "function validateForm() {\n\n\tvar valid = true;\n\n\tif (!validateField(\"firstname\"))\n\t\tvalid = false;\n\n\tif (!validateField(\"lastname\"))\n\t\tvalid = false;\n\n\tif (!checkPasswords())\n\t\tvalid = false;\n\n\tif (!checkEmail())\n\t\tvalid = false;\n\n\tif (valid)\n\t\tsubmitForm();\n\n\t// Return false to make sure the HTML doesn't try submitting anything.\n\t// Submission should happen via javascript.\n\treturn false;\n}", "function validateSubmit() {\n var alertStr = \"\";\n // regex checks and empty value checks on required inputs\n if (parkingName !== null && parkingName.value.length === 0)\n alertStr += \"Name is a required input\\n\";\n if (lat !== null && lat.value.length === 0)\n alertStr += \"Latitude is a required input\\n\";\n else if (lat !== null && !decimalRegex.test(lat.value))\n alertStr += \"Latitude is an invalid number\\n\";\n if (lon !== null && lon.value.length === 0)\n alertStr += \"Longitude is a required input\\n\";\n else if (lon !== null && !decimalRegex.test(lon.value))\n alertStr += \"Longitude is an invalid number\\n\";\n\n // any errors send an alert\n if (alertStr !== \"\")\n alert(alertStr);\n else\n window.location.href = \"/index.php\";\n}", "function validate(event) {\n event.preventDefault()\n removeErrorMessage()\n removeValidMessage()\n\n validForm = true\n validateName()\n validateCarYear()\n validateCarMake()\n validateCarModel()\n validateStartDate()\n validateDays()\n validateCard()\n validateCvv()\n validateExpiration()\n\n showValidMessage()\n}", "function handleFormValidation(){\n const errors = [] ;\n if(cityNameCheck.checked && cityName.value === \"\"){\n errors.push(\"City name cannot be empty\");\n }\n if(zipCodeCheck.checked && zipcode.value === \"\"){\n errors.push(\"zipcode cannot be empty\");\n }\n if(feel.value === \"\"){\n errors.push(\"you must submit your feeling\");\n }else if(feel.value.length < 4){\n errors.push(\"your feeling must be more than four character\");\n }\n return errors;\n}", "function validateForm() {\n\t// get the values from the inputs\n\tconst firstNameValue = firstName.value.trim();\n\tconst lastNameValue = lastName.value.trim();\n\tconst emailValue = email.value.trim();\n\tconst phoneValue = phone.value.trim();\n\tconst countryValue = country.value.trim();\n\tconst cityValue = city.value.trim();\n\tconst schoolValue = school.value.trim();\n\tconst levelValue = level.value.trim();\n\tconst skillValue = skill.value.trim();\n\tconst passwordValue = password.value.trim();\n\tconst password2Value = password2.value.trim();\n\n\t// Check Firstname\n\tif (firstNameValue === \"\") {\n\t\tsetErrorFor(firstName, \"First name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(firstName);\n\t}\n\n\t// Check Firstname\n\tif (lastNameValue === \"\") {\n\t\tsetErrorFor(lastName, \"Last name cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(lastName);\n\t}\n\n\t// Check Email\n\tif (emailValue === \"\") {\n\t\tsetErrorFor(email, \"Email cannot be blank\");\n\t} else if (!isEmail(emailValue)) {\n\t\tsetErrorFor(email, \"Please enter a valid email\");\n\t} else {\n\t\tsetSuccessFor(email);\n\t}\n\n\t// Check Number\n\tif (phoneValue === \"\") {\n\t\tsetErrorFor(phone, \"Phone number cannot be blank\");\n\t} else if (isNaN(phoneValue)) {\n\t\tsetErrorFor(phone, \"Please enter a valid phone number\");\n\t} else {\n\t\tsetSuccessFor(phone);\n\t}\n\n\t// Check country\n\tif (countryValue === \"\") {\n\t\tsetErrorFor(country, \"Please select a country\");\n\t} else {\n\t\tsetSuccessFor(country);\n\t}\n\n\t// Check City\n\tif (cityValue === \"\") {\n\t\tsetErrorFor(city, \"Please enter a city\");\n\t} else {\n\t\tsetSuccessFor(city);\n\t}\n\n\t// Check School\n\tif (schoolValue === \"\") {\n\t\tsetErrorFor(school, \"School cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(school);\n\t}\n\n\t// Check Level\n\tif (levelValue === \"\") {\n\t\tsetErrorFor(level, \"Please select a level\");\n\t} else {\n\t\tsetSuccessFor(level);\n\t}\n\n\t// Check LevSkills\n\tif (skillValue === \"\") {\n\t\tsetErrorFor(skill, \"Please enter a skill\");\n\t} else {\n\t\tsetSuccessFor(skill);\n\t}\n\n\t// Check passwords\n\tif (passwordValue === \"\") {\n\t\tsetErrorFor(password, \"Password cannot be blank\");\n\t} else {\n\t\tsetSuccessFor(password);\n\t}\n\n\t// Check password2\n\tif (password2Value === \"\") {\n\t\tsetErrorFor(password2, \"Password confirmation is required\");\n\t} else if (password2Value !== passwordValue) {\n\t\tsetErrorFor(password2, \"Passwords do not match\");\n\t} else {\n\t\tsetSuccessFor(password2);\n\t}\n\n\tif (genders[0].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\t\treturn true;\n\t} else if (genders[1].checked === true) {\n\t\tsetSuccessFor(genderInput);\n\n\t\treturn true;\n\t} else {\n\t\t// no checked\n\t\tsetErrorFor(genderInput, \"Please select a gender\");\n\t\treturn false;\n\t}\n}", "function onValidation() {\n\tclearErrors();\n\n\tvar allValidReq = checkRequiredFields();\n\tvar allValidDob = true;\n\tif ($.inArray(\"dob\", getRequiredFields()) > 0)\n\t{\n\t\tallValidDob = checkValidDob();\n\t}\n\t\n\tvar allValidNames = checkValidNames();\n\n\tif ($(\"#usSocialSecurityNumber\").length) {\n\t\tallValidNames = allValidNames && checkSSN();\n\t}\n\t\n\tvar allValidAddress = true;\n\tif (countryIsUSA()) {\n\t\tallValidAddress = checkValidUSAAddress();\n\t}\n\t\n\treturn allValidReq && allValidDob && allValidNames & allValidAddress;\n}", "function catchSubmit(){\n\t\t\t// ensure that the submit button is enabled (if the page was refreshed when the button was disabled, some browsers remember it's disabled state)\n\t\t\tobjForm.find('input[type=submit]').removeAttr('disabled');\n\n\t\t\t// check if we are validating/submutting the form via ajax\n\t\t\tif((typeof formValidate == 'boolean') && (formValidate === true) && (typeof strFormID == 'string') && $.isArray(ruleList) && (ruleList.length > 0)){\n\t\t\t\t// we need to carry out Javascript form validation\n\n\t\t\t\t/**\n\t\t\t\t * Catch the submission of the form\n\t\t\t\t */\n\t\t\t\tobjForm.off('submit');\t// remove the current onsubmit event (if one exists)\n\t\t\t\tobjForm.on('submit', function(){\n\t\t\t\t\tvar errorList = {};\t// contains a list of errors\n\n\t\t\t\t\tif(hasErrorBox){\n\t\t\t\t\t\terrorBox.empty();\n\t\t\t\t\t}\n\t\t\t\t\tobjForm.find('input, textarea, select').removeClass(errorClass);\n\n\t\t\t\t\t// loop through the validation rules and check the input fields\n\t\t\t\t\t$.each(ruleList, function(i, e){\n\t\t\t\t\t\tvar objInput = objForm.find('input[name=' + e.field + '], textarea[name=' + e.field + '], select[name=' + e.field + ']'),\n\t\t\t\t\t\t\tbolIsSet = ((objInput.length > 0) && ($.trim(objInput.val()) != ''));\n\n\t\t\t\t\t\t$.each(e.rules.split('|'), function(i, rule){\n\t\t\t\t\t\t\trule = rule.toLowerCase();\n\t\t\t\t\t\t\tswitch(rule){\n\t\t\t\t\t\t\t\tcase 'required':\n\t\t\t\t\t\t\t\t\tif(!bolIsSet){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_required', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_email':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isEmail(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_email', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_emails':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isEmails(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_email', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlpha(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha_numeric':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlphaNumeric(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha_numeric', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'alpha_dash':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isAlphaDash(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_alpha_dash', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'numeric':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isNumeric(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_numeric', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isInt(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_integer', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'valid_ip':\n\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isIP(objInput.val())){\n\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_ip', e.label);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tvar matches = null;\n\t\t\t\t\t\t\t\t\tif((matches = rule.match(new RegExp(/^(min|max|exact)_length\\[([\\d]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && (((matches[1] == 'min') && (objInput.val().length < matches[2])) || ((matches[1] == 'max') && (objInput.val().length > matches[2])) || ((matches[1] == 'exact') && (objInput.val().length != matches[2])))){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_length', e.label, ((matches[1] == 'min') ? 'more than' : ((matches[1] == 'max') ? 'less than' : 'equal too')), matches[2]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else if((matches = rule.match(new RegExp(/^(greater|less)_than\\[([\\d]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && (!validation.isNumeric(objInput.val()) || (((matches[1] == 'greater') && (parseInt(objInput.val()) < matches[2])) || ((matches[1] == 'less') && (parseInt(objInput.val()) > matches[2]))))){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_numeric_value', e.label, ((matches[1] == 'greater') ? 'greater than' : 'less than'), matches[2]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else if((matches = rule.match(new RegExp(/^matches\\[([^\\]]+)\\]$/))) !== null){\n\t\t\t\t\t\t\t\t\t\tif(bolIsSet && !validation.isSame(objInput.val(), objForm.find('input[name=' + matches[1] + '], textarea[name=' + matches[1] + '], select[name=' + matches[1] + ']').val())){\n\t\t\t\t\t\t\t\t\t\t\terrorList[e.field] = objLanguage.getLine('validation_match', e.label, matches[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\tif($.isEmptyObject(errorList)){\n\t\t\t\t\t\treturn (formCatch === true) ? submitForm() : true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar arrErrors = [];\n\t\t\t\t\t\t$.each(errorList, function(field, error){\n\t\t\t\t\t\t\tobjForm.find('input[name=' + field + '], textarea[name=' + field + '], select[name=' + field + ']').addClass(errorClass);\n\t\t\t\t\t\t\tarrErrors[arrErrors.length] = error;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdisplayErrors(arrErrors);\n\n\t\t\t\t\t\treloadCaptcha();\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}else if((typeof formCatch == 'boolean') && (formCatch === true) && (typeof strFormID == 'string')){\n\t\t\t\t// no form validation, but we are submitting the form via ajax\n\t\t\t\t$('#' + strFormID).on('submit', function(){\n\t\t\t\t\treturn submitForm();\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function formIsValid() {\n if (total_loan_box.value === \"\" || isNaN(total_loan_box.value)) {\n speakToUser(\"You must enter a valid decimal number for the <strong>Total Loan Amount</strong>.\");\n focusOnBox(\"total_loan\");\n return false;\n }\n\n if (interest_rate_box.value === \"\" || isNaN(interest_rate_box.value)) {\n speakToUser(\"You must enter a valid decimal number for the <strong>Yearly Interest Rate</strong>.\");\n focusOnBox(\"interest_rate\");\n return false;\n }\n\n if (loan_term_box.value === \"\" || isNaN(loan_term_box.value)) {\n speakToUser(\"You must enter a valid number of years for the <strong>Loan Term</strong>.\");\n focusOnBox(\"loan_term\");\n return false;\n }\n\n return true;\n}", "function validateForm() {\n error = 0;\n message = \"\";\n var x = document.forms[\"loan\"][\"pv\"].value;\n x = x.replace(',', '.');\n if (isNaN(x) || x < 0 || x == '') {\n message = \"Kwota kredytu jest wymagana i musi być liczbą większą od zera\";\n error = 1;\n }\n var x = document.forms[\"loan\"][\"rate\"].value;\n x = x.replace(',', '.');\n if (isNaN(x) || x < 0 || x == '') {\n if (error == 1) {\n message = message + \"<br /><br />\";\n }\n message = message + \"Orocentowanie jest wymagane i musi być liczbą większą od zera\";\n error = 1;\n }\n var x = document.forms[\"loan\"][\"quantity\"].value;\n x = x.replace(',', '.');\n if (isNaN(x) || x < 0 || x == '') {\n if (error == 1) {\n message = message + \"<br /><br />\";\n }\n message = message + \"Ilość rat jest wymagana i musi być liczbą większą od zera\";\n error = 1;\n }\n\n if (error == 1) {\n document.getElementById(\"errorMessage\").innerHTML = message;\n } else {\n loan.submit();\n }\n}", "function check_form ()\n{\n var error = false; \n $('.form-horizontal input:text').each (\n function (i)\n { \n var value = $(this).val (); \n $('#error' + $(this).attr ('name')).remove ();\n if (value.length <= 0)\n { \n if ($(this).next ().attr ('name') === undefined)\n $(this).after ('<span id=\"error'+ $(this).attr ('name') +'\" style=\"color:red;margin-left:20px;\">Fehler!</span>');\n error = true;\n } \n }); \n if (error !== true) $('.form-horizontal').submit (); \n}", "function validate() {\n\n // clear all previous errors\n $(\"input\").removeClass(\"error\");\n var errors = false;\n\n // check all except author, which is special cased\n $(\"input[@name!='author']\").each(function(){\n\n if(! $(this).val()) {\n\n errors = true;\n $(this).addClass(\"error\");\n\n } \n });\n\n // check author\n var seen_author = false;\n $(\"input[@name='author']\").each(function(){\n if ($(this).val()) seen_author = true;\n });\n\n if (!seen_author) {\n $(\"//input[@name='author']:first\").addClass(\"error\");\n errors = true;\n }\n\n // submit if no errors\n return !(errors);\n\n} // validate", "function validateForm(form) {\n console.log(\"validateForm called on \" + form);\n // feed parameter with 'this' value at the onClick so we can reference the form from the element itself\n console.log(\"form \" + form);\n // Get the forms control points to reference both their name and value in a loop\n var controls = form.elements;\n var notValid = [];\n console.log(\"checking \" + controls + \" and its value \");\n\n // Create the loop and add mistakes to the notValid array\n for(var i = 0; i < controls.length; i++) {\n // controls are added if they value doesn't exist\n if (controls[i].value == \"\") {\n notValid[i] = controls[i].name + ': ' + controls[i].value;\n }\n }\n // If no errors, return true and proceed, if errors, alert them all and return false.\n if (notValid.length == 0) {\n console.log(\"All fields are entered correctly\");\n return true;\n } else {\n alert(notValid.join('\\n'));\n return false;\n }\n\n}", "function f_submit()\n{\n var message = \"\";\n for(var i=0 ; i < this.elements.length ; i++) {\n\tif ( this.elements[i].validationset ) {\n\t var txt = this.elements[i].validationset.run();\n\t if ( txt.length > 0 ) {\n\t\tif ( message.length > 0 ) {\n\t\t message += \"\\n\";\n\t\t}\n\t\tmessage += txt;\n\t }\n\t}\n }\n if(this.uservalidator) {\n\tstr =\" var ret = \"+this.uservalidator+\"()\";\n\teval(str);\n\tif ( ret.length > 0 ) {\n\t if ( message.length > 0 ) {\n\t\tmessage += \"\\n\";\n\t }\n\t message += txt;\n\t}\n }\n if ( message.length > 0 ) {\n\talert(\"Input Validation Errors Occurred:\\n\\n\" + message);\n\treturn false;\n } else {\n\treturn true;\n }\n}", "function validation() \n { \n var nom = document.forms[\"contactForm\"][\"nom\"]; \n var prenom = document.forms[\"contactForm\"][\"prenom\"]; \n var email = document.forms[\"contactForm\"][\"email\"]; \n var adresse = document.forms[\"contactForm\"][\"adresse\"]; \n var ville = document.forms[\"contactForm\"][\"ville\"]; \n let regMail = new RegExp(\"^[A-Za-z][0-9A-Za-z-_\\.]+@[0-9A-Za-z-_\\.]+\\.[.][A-Za-z]{2,}$\",\"g\");\n let testEmail = !regMail.test(email.value);\n\n if (nom.value == \"\") \n { \n alert(\"Indiquez votre nom.\"); \n nom.focus(); \n return false; \n }\n if (prenom.value == \"\") \n { \n alert(\"Indiquez votre prénom.\"); \n prenom.focus(); \n return false; \n } \n if (adresse.value == \"\") \n { \n alert(\"Indiquez votre adresse.\"); \n adresse.focus(); \n return false; \n } \n if (email.value == \"\") \n { \n alert(\"Indiquez une adresse email.\"); \n email.focus(); \n return false; \n } \n if (testEmail) \n { \n alert(\"Indiquez une adresse email valide.\"); \n email.focus(); \n return false; \n }\n if (ville.value == \"\") \n { \n alert(\"Indiquez votre ville.\"); \n ville.focus(); \n return false; \n } \n return true; \n \n }", "function validateForm() {\n let res = true;\n //Valida cada uno de los campos por regex\n for (let key in regexList) {\n if (!evalRegex(key, document.forms[formName][key].value)) {\n setMsg(key, fieldList[key].error);\n res = false;\n } else setMsg(key, '');\n }\n\n //Valida la fecha de contrato\n if (!validateDate()) {\n setMsg('fechaContrato', fieldList['fechaContrato'].error);\n res = false;\n } else setMsg('fechaContrato', '');\n\n //Valida el salario introducido\n if (!validateSalary()) {\n setMsg('salario', fieldList['salario'].error);\n res = false;\n } else setMsg('salario', '');\n\n //Valida que la contraseña y la confirmacion sean iguales\n if (document.forms[formName]['passwordReply'].value != document.forms[formName]['password'].value) {\n setMsg('passwordReply', fieldList['passwordReply'].error);\n res = false;\n } else setMsg('passwordReply', '');\n\n //Valida si el usuario ya esta registrado\n if (validateUser(document.forms[formName]['usuario'].value)) {\n setMsg('usuario', 'El usuario ya ha sido registrado');\n res = false;\n }\n\n return res;\n}", "function validateForm(){\n\t\n\tvar boo1 = validateLabPerson();\n\tvar boo2 = validateBioPerson();\n\tvar boo3 = validatePI();\n\tvar boo4 = validateBillTo();\n\tvar boo5 = validateRunType();\n\n\tvar boo6 = validateAllTables();\n//\tvar boo6 = true;\n\n\tvar boo7 = validateDate();\n\tvar boo8 = validateIAccept();\n\n\tvar boo9 = validateConcentrationUnit();\n\tvar boo10 = validateTubesAndLanes();\n\t\n//\talert(\"boo1 = \" + boo1 + \" boo2 = \" + boo2 + \" boo3 = \" + boo3 + \" boo4 = \" + boo4 +\" boo5 = \" + boo5 +\" boo6 = \" + boo6 + \" boo7 = \" + boo7 + \" boo8 = \" + boo8 + \" boo9 = \" + boo9 + \" boo10 = \" + boo10);\n\tif (boo1 && boo2 && boo3 && boo4 && boo5 && boo6 && boo7 && boo8 && boo9 && boo10){\t\n//\tif(validateLabPerson() && validateBioPerson() && validatePI() && validateBillTo() && validateRunType() && validateTable()){\n\t\t//insert fields used to generate csv\n\t\tinsertTableSize();\t\t\t\t\t// insert size of all table - used when generating csv file\n\t\tgenerateOrderNoteID();\t\t\t\t// insert orderNoteID\n\t\taddPI2TubeTag();\t\t\t\t\t// indsæt \"de tre tegn\" (fra PI) i tubetaggen.\n\t\tsetVersion();\t\t\t\t\t\t// insert the version number in the hidden field.\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}", "function validate()\r\n {\r\n var valid=true;\r\n $(\".error\").removeClass(\"error\");\r\n $(\".validation\").hide();\r\n\r\n //validate all fields\r\n $(\"input\").each(\r\n function()\r\n {\r\n if(this.validate && !this.validate())\r\n valid = show_error($(this).attr(\"id\"));\r\n });\r\n\r\n return valid;\r\n }", "function ValidateFileForm(){\n for (var i = 0; i <AllFields.length; i++){\n $(AllFields[i]).trigger('blur');\n }\n if(cautionedFields.length>0){\n var tipString=\"tips:\\n\";\n var warningString=\"warnings:\\n\";\n for(var i = 0; i<tips.length;i++){\n tipString+=tips[i] + \"\\n\";\n \n }\n for(var i = 0; i<warnings.length;i++){\n warningString+=warnings[i] +\"\\n\"; \n }\n addErrors(warnings, \"warningTip\");\n addErrors(tips, \"noticeTip\");\n displayError();\n }else{\n $(fileForm).submit();\n }\n}", "function validate_form() {\n valid = true;\n\n if (document.form.age.value == \"\") {\n alert(\"Please fill in the Age field.\");\n valid = false;\n }\n\n if (document.form.heightFeet.selectedIndex == 0) {\n alert(\"Please fill in the Height field.\");\n valid = false;\n }\n\n if (document.form.heightInches.selectedIndex == 0) {\n alert(\"Please fill in the Height field.\");\n valid = false;\n }\n\n if (document.form.weight.value == \"\") {\n alert(\"Please fill in the Weight field.\");\n valid = false;\n }\n\n if (document.form.position.selectedIndex == 0) {\n alert(\"Please fill in the Position field.\");\n valid = false;\n }\n\n if (document.form.playingStyle.selectedIndex == 0) {\n alert(\"Please fill in the Playing Style field.\");\n valid = false;\n }\n\n if (document.form.heightInches.selectedIndex == 0) {\n alert(\"Please fill in the Maximum Price field.\");\n valid = false;\n }\n\n return valid;\n}", "validateForm() {\r\n if(this.getInputVal(this.inputBill) !== \"\" && \r\n this.getInputVal(this.inputPeople) !== \"\" &&\r\n (this.getInputVal(this.inputCustom) !== \"\" || \r\n this.percentageBtns.some(btn => btn.classList.contains(\"active\")))) \r\n {\r\n this.disableReset(false);\r\n return true;\r\n }\r\n else {\r\n this.disableReset(true);\r\n this.displayResult(\"__.__\", \"__.__\");\r\n return false;\r\n }\r\n }", "function checkSubmission(obj)\n{\n\n //list in the array, the object properties that stores required values\n const requiredFields = [\n \"first-name\",\n \"last-name\",\n \"title\",\n \"email\",\n \"phone\", \n \"company-name\",\n \"company-address\",\n \"company-city\",\n \"company-zip-code\",\n \"workshop-choice\",\n \"vegan\"\n ];\n\n // check if the required fields have values\n for (let i = 0; i< requiredFields.length; i++)\n {\n if (obj[requiredFields[i]] == \"none\")\n {\n errorMsg(requiredFields[i], \"Please fill in this field.\", \"required\", false);\n }\n else\n {\n errorMsg(requiredFields[i], \"\", \"required\", true);\n }\n }\n\n // Check if values with specific format are valid. if not : write on the form the errors to check\n\n // check email address\n // regex taken from https://regexlib.com/REDetails.aspx?regexp_id=174\n const validMail = checkValueFormat(obj[\"email\"], \"^.+@[^\\.].*\\.[a-z]{2,}$\");\n\n if(!validMail)\n {\n errorMsg(\"email\", \"Please enter a valid email: [email protected]\", \"format\", false);\n }\n else\n {\n errorMsg(\"email\", \"\", \"format\", true);\n }\n\n // check phone number\n const validPhone = checkValueFormat(obj[\"phone\"], \"[0-9]{3}-[0-9]{3}-[0-9]{4}$\");\n\n if(!validPhone)\n {\n errorMsg(\"phone\", \"Please enter a valid phone number: 000-000-0000\", \"format\", false);\n }\n else\n {\n errorMsg(\"phone\", \"\", \"format\", true);\n }\n\n //check company zip code\n const validZipCode = checkValueFormat(obj[\"company-zip-code\"], \"^\\\\d{5}$\");\n \n if(!validZipCode)\n {\n errorMsg(\"company-zip-code\", \"Please enter a valid ZIP Code: 00000\", \"format\", false);\n }\n else\n {\n errorMsg(\"company-zip-code\", \"\", \"format\", true);\n }\n\n //check if there's any error detected in the form\n let getErrors = document.querySelectorAll(\"p[class^='error-msg']\");\n\n if(getErrors.length == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n}", "function formValidator(){\n \n // create object that will save user inputs (empty bucket)\n let feedback = {};\n // create array that will save error messages (empty bucket)\n let errors = [];\n \n // check if full name has a value\n if (fn.value !== \"\"){\n // if it does, save it\n feedback.fname = fn.value;\n } else {\n // if it does not, create the error message (and save it too)\n errors.push(\"<p>Please provide your full name</p>\");\n }\n \n // check if email has a value\n if (em.value !== \"\"){\n // if it does, save it\n feedback.email = em.value;\n } else {\n // if it does not, create the error message (and save it too)\n errors.push(\"<p>Please provide your email</p>\");\n }\n \n // check if message has a value\n // if it does, save it\n // if it does not, create the error message (and save it too)\n \n // create either feedback or display all errors\n \n if (errors.length ===0){\n console.log(feedback);\n }else{\n console.log(errors);\n }\n \n // close your event-handler\n }", "function validateForm(event) {\n // Prevent the browser from reloading the page when the form is submitted\n event.preventDefault();\n\n // Validate that the name has a value\n const name = document.querySelector(\"#name\");\n const nameValue = name.value.trim();\n const nameError = document.querySelector(\"#nameError\");\n let nameIsValid = false;\n\n if (nameValue) {\n nameError.style.display = \"none\";\n nameIsValid = true;\n } else {\n nameError.style.display = \"block\";\n nameIsValid = false;\n }\n\n // Validate that the answer has a value of at least 10 characters\n const answer = document.querySelector(\"#answer\");\n const answerValue = answer.value.trim();\n const answerError = document.querySelector(\"#answerError\");\n let answerIsValid = false;\n\n if (checkInputLength(answerValue, 10) === true) {\n answerError.style.display = \"none\";\n answerIsValid = true;\n } else {\n answerError.style.display = \"block\";\n answerIsValid = false;\n }\n\n // Validate that the email has a value and a valid format\n const email = document.querySelector(\"#email\");\n const emailValue = email.value.trim();\n const emailError = document.querySelector(\"#emailError\");\n const invalidEmailError = document.querySelector(\"#invalidEmailError\");\n let emailIsValid = false;\n\n if (emailValue) {\n emailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n emailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n if (checkEmailFormat(emailValue) === true) {\n invalidEmailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n invalidEmailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n // Validate that the answer has a value of at least 15 characters\n const address = document.querySelector(\"#address\");\n const addressValue = address.value.trim();\n const addressError = document.querySelector(\"#addressError\");\n addressIsValid = false;\n\n if (checkInputLength(addressValue, 15) === true) {\n addressError.style.display = \"none\";\n addressIsValid = true;\n } else {\n addressError.style.display = \"block\";\n addressIsValid = false;\n }\n\n // Display form submitted message if all fields are valid\n if (\n nameIsValid === true &&\n answerIsValid === true &&\n emailIsValid === true &&\n addressIsValid === true\n ) {\n submitMessage.style.display = \"block\";\n } else {\n submitMessage.style.display = \"none\";\n }\n}", "function applyOnSubmitToForms()\n{\n elementsForms = document.getElementsByTagName(\"form\"); \n for (var intCounter = 0; intCounter < elementsForms.length; intCounter++) \n { \n elementsForms[intCounter].onsubmit = function ()\n {\n if (!validateForms())\n {\n return false;\n }\n }\n } \n}", "function attachValidation() {\n var form = document.getElementById('inscription');\n \n form.onsubmit = function () {\n // Fields to validate.\n var fields = [ \"username\", \"password\", \"prenom\", \"nom\", \"courriel\",\n \"jour\", \"mois\", \"annee\", \"masculin\", \"feminin\", \"theme\", \"accepte\"];\n\n // data contains the dom objects associated with each field.\n var data = {};\n for (var i in fields) {\n data[fields[i]] = document.getElementById(fields[i]);\n }\n \n // Pass the data to a list of validators.\n var errors = [];\n var validators = [ validateFormFilled, validateName, validateUsername, validateTerms,\n validateEmail ];\n for (var i = 0; i < validators.length; i++) {\n validators[i](fields, data, errors);\n }\n \n if (errors) {\n // Display errors\n removeErrors();\n for (var i = 0; i < errors.length; i++) {\n displayError(errors[i]);\n }\n // Stop submission of form.\n return false;\n }\n };\n}", "function validateForm() {\r\n var newTitle = document.forms[\"validForm\"][\"btitle\"].value;\r\n var newOwner = document.forms[\"validForm\"][\"bowner\"].value;\r\n var newContent = document.forms[\"validForm\"][\"bcontent\"].value;\r\n var newPublisher = document.forms[\"validForm\"][\"bpublisher\"].value;\r\n if (newTitle == \"\") {\r\n alert(\"Title must be filled out\");\r\n return false;\r\n } else if (newOwner == \"\") {\r\n alert(\"Name Must be filled out\");\r\n return false;\r\n } else if (newContent == \"\") {\r\n alert(\"Content Must be filled out\");\r\n return false;\r\n } else if (newPublisher == \"\") {\r\n alert(\"Publisher Name Must be filled out\");\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function handleSubmit(event) {\n event.preventDefault();\n setErrors(validate(form));\n }", "function validateForm()\n { \t \t\n \t\n \t$('#frmMain').addClass('submitted');\n \t\n \tvar validated = true;\n \t$('#frmMain').find(':input').each(function(){ \n \t\t\n \t\tvar id = $(this).prop('id');\n \t\tif(id!=\"\")\n \t\t{\n\t \t\tvar Value = $('#' + id).val(); \t\t\n\t \t\tvar requ = $(this).prop('required');\t\n\t \t\t \t\t\n\t \t\tif(Value == \"\" && requ == true) \t\t\n\t \t\t\tvalidated = false;\n \t\t}\n \t});\n\n \tif(validated == true)\n \t{ \t\t \t\t\t\n \t\tvar Lenght = $(\"#txtLengthInFeet\").val();\n \tvar Inch = $(\"#drpLengthInInch\").find(\"option:selected\").text();\n \tvar Fraction = $(\"#drpLengthInFraction\").find(\"option:selected\").text();\n \t\n \tvalidated = validateLength(Lenght,Inch,Fraction,\"Length\");\n \t}\n \t$('[data-required]').each(function() { \t\t\n \t if (!$(this).val()) \n \t {\n \t\t var id = $(this).attr('id') + 1;\n \t\t\n \t\t if ($(this).data('select2') && $('#' + id).is(':visible')) \n \t\t {\n \t\t \t$(\"#\"+id).addClass('error'); \n \t\t \tvalidated = false;\n \t\t }\n \t\t }\n \t});\n \t\n \treturn validated;\n \t\n }", "function validateForm() {\n var validated = true;\n $(\".has-error\").removeClass(\"has-error\");\n\n if (!is_text_area_disabled) {\n if (txt_description.val() === \"\") {\n txt_description.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"Please fill in the description field.\");\n validated = false;\n }\n }\n\n if (input_email.val() === \"\") {\n input_email.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"Please fill in the e-mail field.\");\n validated = false;\n }\n if (!isEmail(input_email.val())) {\n input_email.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"Please input a valid email.\");\n validated = false;\n }\n if (input_email.val().length > 100) {\n input_username.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"The email must be less than 100 characters.\");\n validated = false;\n }\n\n if (input_username.val() === \"\") {\n input_username.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"Please fill in the username field.\");\n validated = false;\n }\n if (input_username.val().length > 50) {\n input_username.closest(\".form-group\").addClass(\"has-error\");\n error.fadeIn();\n error.find('.message').text(\"The username must be less than 50 characters.\");\n validated = false;\n } \n\n if (validated) {\n error.hide();\n error.find('.message').text(\"\");\n } else {\n error.fadeIn();\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n\n return validated;\n}", "function validar() {\n var i = 0;\n\n if ($(\"#txtNombre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSerie\").val().length < 1) {\n i++;\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n i++;\n }\n\n\n if (i == 5) {\n alert(\"Por favor llene todos los campos.\");\n return false;\n }\n\n\n if ($(\"#txtNombre\").val().length < 1) {\n alert(\"El nombre es obligatorio.\");\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n alert(\"El semestre designado es obligatorio.\");\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n alert(\"La carrera es obligatorio.\");\n }\n if ($(\"#txtSerie\").val().length < 1) {\n alert(\"La serie es obligatorio.\");\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n alert(\"El campo de horas practicas es obligatorio.\");\n }\n\n if (i == 0) {\n saveMtr(); \n $('#txtSerie').val('');\n $('#txtNombre').val('');\n $('#txtSemestre').val('');\n $('#txtCarrera').val('');\n $('#txtHPracticas').val('');\n return false;\n }\n\n}", "function validateForm() {\n\t\n\tvar messageString = \"\"; // Start with blank error message\n\tvar tableViewRows = $.tableView.data[0].rows;\n\t\n\tfor (var i = 0; i < tableViewRows.length; ++i) {\n\t\t\n\t\tvar fieldObject = tableViewRows[i].fieldObject;\n\t\tvar value = getFieldValue(tableViewRows[i]);\n\t\t\n\t\tif (fieldObject.field_type == 'Checkbox') {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// Checks if the field is blank and/or required\n\t\tif (value == \"\" || value == null) {\n\t\t\tif (fieldObject.required == \"No\") {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tmessageString += fieldObject.prompt + \" is a required field.\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// -------------- Text ----------------\n \t\tif (fieldObject.field_type == 'Text') {\n \t\t\t// Do Nothing\n \t\t\t\n \t\t// -------------- Checkbox ----------------\n \t\t} else if (fieldObject.field_type == 'Checkbox') { \n \t\t\t// Do Nothing\t\n \t\t\n \t\t\n \t\t// ------------ Integer ----------------\n \t\t} else if (fieldObject.field_type == 'Integer') { \n\t\t\t// Is number? And is integer?\n\t\t\tif (Number(value) > 0 && value % 1 == 0) {\n\t\t\t\t// Is it in range?\n\t\t\t\tif (value > fieldObject.numeric_max || value < fieldObject.numeric_min) {\n\t\t\t\t\tmessageString += fieldObject.prompt + \" must be in range [\" + fieldObject.numeric_min + \", \" + fieldObject.numeric_max + \"]\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmessageString += fieldObject.prompt + \" must be an integer.\\n\";\n\t\t\t}\n\t\t\n\t\t\n\t\t// ------------ Decimal ----------------\n\t\t} else if (fieldObject.field_type == 'Decimal') { \n\t\t // Is number?\n\t\t\tif (Number(value) > 0) {\n\t\t\t\t// Is it in range?\n\t\t\t\tif (value > fieldObject.numeric_max || value < fieldObject.numeric_min) {\n\t\t\t\t\tmessageString += fieldObject.prompt + \" must be in range [\" + fieldObject.numeric_min + \", \" + fieldObject.numeric_max + \"]\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmessageString += fieldObject.prompt + \" must be a number.\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t// ---------- Calculated ------------\n\t\t} else if (fieldObject.field_type == 'Calculated') { \n\t\t\n\t\t\n\t\t// -------------- Incremental Text ----------------\n\t\t} else if (fieldObject.field_type == 'Incremental Text') { \n\t\t\n\t\t\n\t\t// -------------- Date ----------------\n\t\t} else if (fieldObject.field_type == 'Date') { \n\t\t\n\t\t\n\t\t// -------------- Time ----------------\n\t\t} else if (fieldObject.field_type == 'Time') { \n\t\t\t\n\t\t\t\n\t\t// -------------- Date-Time ----------------\n\t\t} else if (fieldObject.field_type == 'Date-Time') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Message') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Location') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Photo') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Recording') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Selection') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Button Selection') { \n\t\t\n\t\t} else if (fieldObject.field_type == 'Structural Attitude') { \n\t\t\n\t\t} else { \n\t\t\t\n\t\t}\n\t\t//------------------------------------------------------------------------------------------------------------------------------------------\n\t}\n\treturn messageString;\n}", "function validateCourseForm() {\n var courseCode = document.forms[\"AddCourse\"][\"courseCode\"];\n var courseTitle = document.forms[\"AddCourse\"][\"courseTitle\"];\n var courseCredit = document.forms[\"AddCourse\"][\"courseCredit\"];\n var courseDepartment = document.forms[\"AddCourse\"][\"courseDepartment\"];\n var courseSemester = document.forms[\"AddCourse\"][\"courseSemester\"];\n var courseTeacher = document.forms[\"AddCourse\"][\"courseTeacher\"];\n\n courseCode.classList.remove(\"invalid-input\");\n courseTitle.classList.remove(\"invalid-input\");\n courseCredit.classList.remove(\"invalid-input\");\n courseDepartment.classList.remove(\"invalid-input\");\n courseSemester.classList.remove(\"invalid-input\");\n courseTeacher.classList.remove(\"invalid-input\");\n\n courseCode.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n courseTitle.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n courseCredit.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n courseDepartment.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n courseSemester.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n courseTeacher.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"none\";\n\n if(courseCode.value == \"\"){\n courseCode.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseCode.classList.add(\"invalid-input\");\n courseCode.focus();\n return false;\n }\n\n if(courseTitle.value == \"\"){\n courseTitle.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseTitle.classList.add(\"invalid-input\");\n courseTitle.focus();\n return false;\n }\n\n if(courseCredit.value == \"\"){\n courseCredit.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseCredit.classList.add(\"invalid-input\");\n courseCredit.focus();\n return false;\n }\n\n if(courseDepartment.value == \"\"){\n courseDepartment.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseDepartment.classList.add(\"invalid-input\");\n courseDepartment.focus();\n return false;\n }\n\n if(courseSemester.value == \"\"){\n courseSemester.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseSemester.classList.add(\"invalid-input\");\n courseSemester.focus();\n return false;\n }\n\n if(courseTeacher.value == \"\"){\n courseTeacher.parentNode.getElementsByClassName(\"invalid-feedback\")[0].style.display = \"block\";\n courseTeacher.classList.add(\"invalid-input\");\n courseTeacher.focus();\n return false;\n }\n\n\n return true;\n}", "function formValidate() \n{\n // clear all errors, even if it's the first run\n clearErrors();\n var countErrors=0;\n // Is their first name using english characters and/or punctuation\n if (!nameCheck()) countErrors++;\n // Is their mobile number a valid Australian number\n if (!mobileCheck()) countErrors++;\n // Is credit card number between 14-19 digits\n if (!cardNoCheck()) countErrors++;\n // Is their credit card not yet expired\n if (!expiryCheck()) countErrors++;\n // Have they ordered any tickets\n if (!purchaseCheck()) countErrors++;\n // Block or allow submission depending on number of errors\n console.log(countErrors);\n return (countErrors==0);\n}", "function validateForm(event) {\n\n //prevents default event action\n event.preventDefault();\n\n\n// checking if the input value is 1 character or more\n if (checkLength(firstName.value, 0)) {\n firstNameError.style.display = \"none\";\n } else {\n firstNameError.style.display = \"block\";\n }\n// checking if the input value is 3 characters or more\n if (checkLength(lastName.value, 2)) {\n lastNameError.style.display = \"none\";\n } else {\n lastNameError.style.display = \"block\";\n }\n// checking if the input value is a valid email address\n if (validateEmail(email.value)) {\n emailError.style.display = \"none\";\n } else {\n emailError.style.display = \"block\";\n }\n// checking if the input value is 7 characters or more\n if (checkLength(subject.value, 6)) {\n subjectError.style.display = \"none\";\n } else {\n subjectError.style.display = \"block\";\n }\n// checking if the input value is 15 characters or more\n if (checkLength(message.value, 14)) {\n messageError.style.display = \"none\";\n } else {\n messageError.style.display = \"block\";\n }\n}", "function validate($form) {\n\t\tvar allValid = true;\n\t\t$form.find('.input-field.text-field').each(function() {\n\t\t\tif (!$(this).hasClass('filled')) {\n\t\t\t\tinvalid($(this), 'Required');\n\t\t\t\tallValid = false;\n\t\t\t} else {\n\t\t\t\tvalid($(this));\n\t\t\t}\n\t\t});\n\t\t$form.find('.input-field input[name=zipcode]').each(function() {\n\t\t\tvar length = $(this).val().length;\n\t\t\tif (length === 0) {\n\t\t\t\tinvalid($(this), 'Required');\n\t\t\t\tallValid = false;\n\t\t\t} else if (length !== 5) {\n\t\t\t\tinvalid($(this), 'Invalid postal code');\n\t\t\t\tallValid = false;\n\t\t\t}\n\t\t});\n\t\t$form.find('.input-field input[name=phonenumber]').each(function() {\n\t\t\tvar $input = $(this);\n\t\t\tvar length = $input.val().length;\n\t\t\tif (length == 10 || length == 11) valid($input);\n\t\t\telse {\n\t\t\t\tallValid = false;\n\t\t\t\tif (length == 7) invalid($input, 'Please include your area code');\n\t\t\t\telse if (length == 0) invalid($input, 'Required');\n\t\t\t\telse invalid($input, 'Invalid phone number');\n\t\t\t}\n\t\t});\n\t\tvar $emailInput = $form.find('.input-field input[name=email]');\n\t\tif ($emailInput.val().length == 0) {\n\t\t\tinvalid($emailInput, 'Required');\n\t\t\tallValid = false;\n\t\t} else if (!validateEmail($emailInput.val())) {\n\t\t\tinvalid($emailInput, 'Invalid email address');\n\t\t\tallValid = false;\n\t\t} else {\n\t\t\tvalid($emailInput);\n\t\t}\n\t\tvar $birthdayInput = $form.find('.birthday input[name=birthday]');\n\t\tvar date = $birthdayInput.val();\n\t\tif(date.length == 0){\n\t\t\tinvalid($birthdayInput, 'Required');\n\t\t\tallValid = false;\n\t\t} else{\n\t\t\tvar year = parseInt(date.split('-')[0]);\n\t\t\tvar age = new Date().getFullYear() - year;\n\t\t\tif(age > 100 || age < 12){\n\t\t\t\tinvalid($birthdayInput, 'Invalid Date');\n\t\t\t\tallValid = false;\n\t\t\t} else{\n\t\t\t\tvalid($birthdayInput);\n\t\t\t}\n\t\t}\n\t\treturn allValid;\n\t}", "function onsubmit(options) {\n var result = this.validate(document.getElementsByName(options));\n if (!result.pass) {\n alert(result.errorMessage);\n return false; // disable this to redirect to error page\n }\n return true;\n }", "function validateSubmission(form) {\n var alertMsg = \"\"; // Stores the message to display to user indicating which fields are entered incorrectly\n var checkEntry = true; // Is true if all fields are entered correctly, set to false if a field is entered incorrectly\n if (form.name.value == \"\") {\n //checks to see if Name field contains user input\n window.alert(\"No Name entered.\");\n return false;\n }\n if (form.price.value == \"\") {\n //checks to see if Price field contains user input, if not the validate function returns false\n window.alert(\"No Price entered.\");\n return false;\n }\n if (form.long1.value == \"\") {\n //checks to see if Longittude field contains user input, if not the validate function returns false\n window.alert(\"No Longittude entered.\");\n return false;\n }\n if (form.latt1.value == \"\") {\n //checks to see if Lattitude field contains user input, if not the validate function returns false\n window.alert(\"No Lattitude entered.\");\n return false;\n }\n\n if (!validateSpotName(form.name.value)) {\n //checks to see if Name entry is in the appropriate format\n var el = document.getElementsByName(\"name\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Name must be 5 characters long and cannot begin with a space or have consecutive spaces.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"name\")[0].style.backgroundColor = \"white\";\n }\n if (\n !validateDescription(form.description.value) &&\n form.description.value != \"\"\n ) {\n //checks to see if Description entry is in the appropriate format\n var el = document.getElementsByName(\"description\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += \"Description must be less than 300 characters.\\n\"; //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n checkEntry = false;\n } else {\n document.getElementsByName(\"description\")[0].style.backgroundColor =\n \"white\";\n }\n if (!validatePrice(form.price.value)) {\n //checks to see if Price entry is in the appropriate format\n var el = document.getElementsByName(\"price\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Price must contain only digits, a single decimal point and up to 2 digits following the decimal point.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"price\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.long1.value)) {\n //checks to see if Longittude entry is in the appropriate format\n var el = document.getElementsByName(\"long1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Longittude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"long1\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.latt1.value)) {\n //checks to see if Lattitude entry is in the appropriate format\n var el = document.getElementsByName(\"latt1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Lattitude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"latt1\")[0].style.backgroundColor = \"white\";\n }\n if (!checkEntry) {\n //if any of the input fields have an entry in an incorrect format\n window.alert(alertMsg); //displays an error message for each incorrect field to user\n return false; //the validate function returns fa;se\n }\n\n return true; //All input fields contain values in the correct format so the validate function returns true\n}", "function validateForm() {\n var formValid = checkValidity($('form'))\n $('.form-control').removeClass('border-danger text-danger');\n\n $('.form-control').each(function() {\n let inputValid = checkValidity($(this))\n if ( ($(this).prop('required') && ($(this).val().length == 0 || $(this).val() == \" \")) // test for blank while required\n || ($(this).hasClass('check-url') && !validateURL($(this).val())) // test for check URL\n ) {\n inputValid = false;\n formValid = false;\n }\n\n // Test for BCH address\n if ($(this).hasClass('check-bch-address')) {\n if (bchaddr.isValidAddress($(this).val())) {\n if (bchaddr.isLegacyAddress($(this).val())) {\n // isLegacyAddress throws an error if it is not given a valid BCH address\n // this explains the nested if\n inputValid = false;\n formValid = false;\n }\n } else {\n inputValid = false;\n formValid = false;\n }\n }\n\n let showError = $(this).parent().find(\".show-error-on-validation\")\n\n // After all validation\n if (!inputValid) {\n \n $(this).addClass('border-danger text-danger');\n \n if (showError.length) {\n showError.removeClass(\"d-none\")\n }\n\n } else {\n if (showError.length) {\n showError.addClass(\"d-none\")\n }\n }\n });\n\n // Submit if everything is valid\n if (formValid) {\n return true\n } else {\n $(\"#error\").removeClass(\"d-none\");\n $(\"#error\").text(\"Some fields are incorrect.\")\n return false\n }\n}", "function validateForm() {\n\t\tvar $fields = $(\".form-control:visible\");\n\t\tvar $thisStep = $('.formPaso-stepper:visible');\n\t\tvar $nextStep = $thisStep.attr('data-nextStep');\n\t\tvar $filledFields = $fields.find('input[value!=\"\"]');\n\t\tvar $emptyFields = $fields.filter(function() {\n\t \treturn $.trim(this.value) === \"\";\n\t });\n \tfunction continueForm() {\n\t \t// apaga stepper\n\t \t// $('#stepper_portabilidad li').removeClass('active');\n\t \t// prende stepper correcto\n\t \t$('#stepper_portabilidad li.stepperLED-' + $nextStep).addClass('active');\n\t \t// deshabilita este boton\n\t \t$($thisStep).find('.nextStep').addClass('disabled');\n\t \t// oculta este paso\n\t \t$($thisStep).slideUp('1200');\n\t \t// muestra el paso siguiente\n\t \t$('#portateForm-' + $nextStep).slideDown('1200');\n\t \t// habilita el boton a paso siguiente\n\t \t$('#portateForm-' + $nextStep).find('.nextStep').removeClass('disabled');\n\t \t// anima el DOM hasta el stepper\n\t \t$('html, body').animate({scrollTop: $(\"#stepper_portabilidad\").offset().top - 30}, 500);\n\t\t // cancela form button\n\t \treturn false;\n\t }\n\t\tif (!$emptyFields.length) {\n\t\t\t// if form is ok...\n\t\t\t$('#camposvacios').slideUp();\n\t\t\tcontinueForm();\n\t\t} else {\n\t\t console.log($emptyFields);\n\t\t $emptyFields.parents('.form-group').addClass('invalidInput').removeClass('input-effect');\n\t\t $filledFields.addClass('totallyValidInput');\n\t\t console.log($filledFields);\n\t\t $('#camposvacios').slideToggle();\n\t\t $('html, body').animate({scrollTop: $(\"#camposvacios\").offset().top}, 200);\n\t\t}\n\t}", "function validateForm(){\n let errors = {};\n var emptyDuties ={};\n var emptyPosition ={};\n var emptyTotalHours ={};\n var emptyHourlyRate ={}\n \n emptyDuties = checkEmpty('duties',\"Duties\")\n errors ={...errors,...emptyDuties}\n\n emptyPosition = checkEmpty('position',\"Position\")\n errors ={...errors,...emptyPosition}\n\n emptyTotalHours = checkEmpty('totalHours',\"Total Hours\")\n errors ={...errors,...emptyTotalHours}\n\n emptyHourlyRate = checkEmpty('hourlyRate',\"Hourly Rate\")\n errors ={...errors,...emptyHourlyRate}\n\n console.log(errors)\n \n setErrors(errors); \n}", "function validateForm(){\n var courseName = document.getElementById(\"name\").value,\n courseYear = document.getElementById(\"year\").value;\n \n if(courseName === \"\"){\n document.getElementById(\"nameValidation\").style.display = block;\n return false;\n }\n if(courseYear === \"\"){\n document.getElementById(\"yearValidation\").style.display = block;\n return false;\n }\n\n return true;\n}", "function validateForm() {\n\n //this variable will contain all data delivered by the form\n let data = {}\n\n //this variable will contain all the errors, if any where made while filing in the form\n let validationErrors = {}\n\n //let's link the path from which our data var will get the data which is the inputs\n data.firstName = document.querySelector('#firstName')\n data.lastName = document.querySelector('#lastName')\n data.email = document.querySelector('#email')\n data.textbox = document.querySelector('#textbox')\n\n //validation start\n\n //first name validation. if empty, length\n if (!data.firstName.value) {\n console.error('No first name value')\n validationErrors.firstName = 'Please enter your first name'\n\n } else if (!data.firstName.length > 2) {\n console.error('Name value too short')\n validationErrors.firstName = 'Your name is too short, please enter atleast two letters'\n console.info('First Name present')\n }\n\n\n //validate last name. if empty, length\n if (!data.lastName.value) {\n console.error('No Last name value')\n validationErrors.lastName = 'Please enter your first name'\n\n } else if (!data.lastName.length > 2) {\n console.error('Last name value too short')\n validationErrors.lastName = 'Your Last name is too short, please enter atleast two letters'\n console.info('Last Name present')\n }\n\n //validate email\n if (!data.email.value) {\n console.error('no email value')\n validationErrors.email = 'please enter your Email';\n } else {\n console.info('Email present')\n //the email part of the form is not empty, we should still check if the mail contains a valid combination\n\n let emailRegExp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n //test the mail now. if the value is valid or not\n if (!emailRegExp.test(data.email.value)) {\n validationErrors.email = 'Invalid email address'\n }\n }\n\n\n //validate textbox\n if (!data.textbox.value) {\n console.error('no value in textbox')\n validationErrors.textbox = 'please enter a message'\n } else if (!data.textbox.length > 3) {\n console.error('textbox value too short')\n validationErrors.lastName = 'your text is too short!'\n console.info('Last Name present')\n }\n //call the functions. if we have errors we will implement them in the DOM. else the \n\n //check if the errors object has data \n if (Object.keys(validationErrors).length > 0) {\n console.log('error')\n displayErrors(validationErrors, data)\n } else {\n console.log('no errors found');\n sendForm(data)\n }\n\n }", "function checkonsubmit(){\n for(j=0;j<=26;j++)\n {\n \n if(reqerror[j]===1)\n {\n missreq(j); \n return false; \n } \n \n }\n \n if(isvalid)\n return false;\n \n return true;\n \n }", "function formValidation() {\n var email = document.getElementById('email').value;\n var firstname = document.getElementById('firstname').value;\n var lastname = document.getElementById('lastname').value;\n var phone = document.getElementById('phone').value;\n var address = document.getElementById('address').value;\n var postcode = document.getElementById('postcode').value;\n\n // nest all supporting functions, if all true then send thank you alert\n if (email_validation(email)) {\n if (firstname_validation(firstname)) {\n if (lastname_validation(lastname)) {\n if (phone_validation(phone)) {\n if (address_validation(address)) {\n if (postcode_validation(postcode)) {\n alert('Thank you for submitting the form.');\n document.getElementById(\"edit_account\").submit();\n }\n }\n }\n }\n }\n }\n\n}", "function initiateFormValidation() {\n var $form = $(\"#\" + formID);\n $form.submit(function(e) {\n \t// remove all error stylings\n\t\t$(\".\" + errorClass).removeClass(errorClass);\n\t\t$(\".\" + errorMsgClass).css('display', 'none');\n\n\t\t// get user input\n \tvar distanceInput = getInput(distanceName).val();\n \tvar address1Input = getInput(address1Name).val();\n\n \t// show errors if there are any\n if ((distanceInput.length === 0) || isNaN(distanceInput) || (parseInt(distanceInput) <= 0)){\n \te.preventDefault();\n \tshowError(distanceName);\n }\n if (address1Input.length == 0){\n \te.preventDefault();\t\n \tshowError(address1Name);\n }\n });\n}", "function validateSignUp() {\n \n\t//check to see if the username field is empty\n if (document.getElementById(\"name\").value == null || document.getElementById(\"name\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"fnameerror\").innerHTML= \"*first name not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"name\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the password field is empty\n\tif (document.getElementById(\"surname\").value == null || document.getElementById(\"surname\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"snameerror\").innerHTML= \"*surname not filled in\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"surname\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t\n\t//check to see if the age field is empty\n\tif (document.getElementById(\"age\").value == null || document.getElementById(\"age\").value == \"\") {\n\t\t\n\t\t//finding the error element to insert a warning message to screen\n\t\tdocument.getElementById(\"ageerror\").innerHTML= \"*age not selected\";\n\t\t\n\t\t//calling a function that changes the fields attributes to highlight the error\n\t\tformAtt(\"age\");\n\t\t\n\t\t//telling the event handler not to execute the onSubmit command\n return false;\n }\n\t//if the users submission returns no false checks, then tell the even handler to execute the onSubmit command\t\t\n\treturn true;\n\t\n}", "function checkOnSubmit(){\n\t\n\tvar errClassArray = document.getElementsByClassName(\"error\");\n\tvar inputClassArray = document.getElementsByClassName(\"userInput\");\n\tvar errClassLength = errClassArray.length;\n\tvar inputClassLength = inputClassArray.length;\n\t\n\t//Check userInput class values. Flag first blank\n\tvar inputCheckValue = \"\"; //Get value of all \"userInput\" class values\n\tfor(var i = 0; i < inputClassArray.length; i++){\n\t\tinputCheckValue = inputClassArray[i].value;\n\t\tif(inputCheckValue == \"\"){\n\t\t\talert(\"Your input contains blank fields. Please fill out completely\");\n\t\t\tinputClassArray[i].focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//Check all error class innerHTML. If blank, then there is no error.\n\tvar errCheckValue =\"\";//Stores value of innerHTML \"error\" class <p> tags\n\tfor(var i = 0; i < errClassLength; i++){\n\t\terrCheckValue = errClassArray[i].innerHTML;\n\t\t\n\t\t//If not blank get previous sibling from DOM and set focus\n\t\tvar prevSibID = \"\";\n\t\tif(errCheckValue != \"\"){\n\t\t\tprevSibID = errClassArray[i].previousSibling.previousSibling.id;\n\t\t\talert(\"Your input containes Error(s). Please correct the indicated fields\");\n\t\t\tdocument.getElementById(prevSibID).focus();\n\t\t\tbreak;\n\t\t}\n\t}\t\t\t\t\t\n}", "function validateForm() {\n let result = false;\n $.each($(\".biginput\"), function(idx, element) {\n result = checkForm($(element).val());\n if (!result) return false;\n });\n\n return result;\n}", "function validForm(...results) {\n let result = true;\n console.log('checking if the form is valid');\n results.forEach((cur) => {\n // console.log(cur.length);\n if (cur.length < 3) {\n console.log(`${cur} is not valid`);\n result = false;\n }\n });\n return result;\n }", "function validateAndSubmit() {\r\n var isValid = false;\r\n isValid = validateForm();\r\n if (isValid == true) {\r\n disableButtons() // make sure you can only press the submit button once\r\n document.getElementById('evaluationForm').submit();\r\n }\r\n }", "function validate() {\n\t\t\n\t\tvar fname = $(\"#fname\").val();\n\t\tvar lname = $(\"#lname\").val();\n\t\t\n\t\tvar question = $(\"#resizable\").val();\n\t\tvar date = $(\"#datepicker\").val();\n\t\t\n\t\tif(fname == \"\") {\n\t\t\talert(\"Please enter first name\");\n\t\t}\n\t\t\n\t\telse if(lname == \"\") {\n\t\t\talert(\"Please enter last name\");\n\t\t}\n\t\t\n\t\telse if(question == \"\") {\n\t\t\talert(\"Please enter a question\");\n\t\t}\n\t\t\n\t\telse if(date == \"\") {\n\t\t\t\talert(\"Please select a date\");\n\t\t}\n\t\t\n\t\telse {\n\t\t\talert(\"Submitted\");\n\t\t}\n\t}", "function validInputs(){\n \n // if first.value is empty and is different regex(textInput),\n //or first.length is less than 2 characters => error message\n if(textInput.exec(first.value) === null || first.length < 2) {\n firstError.textContent = \"Veuillez renseigner 2 caractères minimum pour le prénom\";\n firstError.style.color = \"red\";\n firstError.style.fontSize = \"15px\";\n first.style.borderColor = \"red\";\n first.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n firstError.style.display = \"none\";\n first.style = \"default\";\n }\n\n // if last.value is empty and is different regex(textInput),\n //or last.length is less than 2 characters => error message\n\n if(textInput.exec(last.value) === null || last.length < 2) {\n lastError.textContent = \"Veuillez renseigner 2 caractères minimum pour le nom\";\n lastError.style.color = \"red\";\n lastError.style.fontSize = \"15px\";\n last.style.borderColor = \"red\";\n last.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n lastError.style.display = \"none\";\n last.style = \"default\";\n }\n\n // if email doesn't correspond to regex => message error\n \n if(mailInput.exec(email.value) === null) {\n emailError.textContent = \"Veuillez renseigner une adresse mail valide\";\n emailError.style.color = \"red\";\n emailError.style.fontSize = \"15px\";\n email.style.borderColor = \"red\";\n email.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n emailError.style.display = \"none\";\n email.style = \"default\";\n }\n\n if(!birthDate.value) {\n birthDateError.textContent = \"Veuillez indiquer votre date de naissance\";\n birthDateError.style.color = \"red\";\n birthDateError.style.fontSize = \"15px\";\n birthDate.style.borderColor = \"red\";\n birthDate.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n birthDateError.style.display = \"none\";\n birthDate.style = \"default\";\n }\n\n // if quantity.value is empty or its value is not a number => message error\n if(quantity.value === \"\" || isNaN(quantity.value)) {\n quantityError.textContent = \"Veuillez renseigner le nombre de participation au tournoi\";\n quantityError.style.color = \"red\";\n quantityError.style.fontSize = \"15px\";\n quantity.style.borderColor = \"red\";\n quantity.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n quantityError.style.display = \"none\";\n quantity.style = \"default\";\n }\n\n //if no cities are chosen => message error\n if (!(location1[0].checked || location1[1].checked || location1[2].checked || location1[3].checked || \n location1[4].checked || location1[5].checked)) {\n\n locationError.textContent = \"Veuillez indiquer une ville\";\n locationError.style.color = \"red\";\n locationError.style.fontSize = \"15px\";\n return formValid === false;\n } else {\n locationError.style.display = \"none\";\n location2.style = \"default\";\n }\n\n //if terms of use are not accepted => message error\n\n if(!checkBox1.checked) { \n cguError.textContent = \"Veuillez accepter les conditions d'utilisation\";\n cguError.style.color = \"red\";\n cguError.style.fontSize = \"15px\";\n checkBox1.style.borderColor = \"red\";\n checkBox1.style.borderWidth = \"2px\";\n return formValid === false;\n } else {\n cguError.style.display = \"none\";\n checkBox1.style = \"default\";\n }\n return formValid = true;\n}", "function validateForm()\n{\n // errorMessage holds all errors which may occur during validation and is shown in an alert at the end if there are\n // errors\n var errorMessage = \"\";\n // firstOffender is used to find the first error field so that the cursor can be placed there... see bottom of method\n var firstOffender = [];\n // valid is used to return a boolean to the form, if a true return, the form is saved, if false it is not saved\n var valid = true;\n // these 2 variables are used to get a value after comparison with the regexs and used later\n var email = check_email.test(document.userForm.email.value);\n var city = check_city.test(document.userForm.city.value);\n\n // the following if statements simply check if a field is empty, if it is the error \"no field\" is appended to the\n // error message\n if (document.userForm.fname.value == \"\")\n {\n errorMessage += \"no first name\" + \"\\n\";\n valid = false;\n firstOffender.push(\"firstname\");\n }\n if (document.userForm.lname.value == \"\")\n {\n errorMessage += \"no last name\" + \"\\n\";\n valid = false;\n firstOffender.push(\"lastname\");\n }\n if (document.userForm.email.value == \"\")\n {\n errorMessage += \"no email\" + \"\\n\";\n valid = false;\n firstOffender.push(\"emailField\");\n }\n // test regex against entered value, if result does not match the pattern, the if statement will evaluate to true and enter\n else if (!email)\n {\n errorMessage += \"not a valid email\" + \"\\n\";\n valid = false;\n firstOffender.push(\"emailField\");\n }\n if (document.userForm.phone.value == \"\")\n {\n errorMessage += \"no phone number\" + \"\\n\";\n valid = false;\n firstOffender.push(\"phoneNumber\");\n }\n if (document.userForm.city.value == \"\")\n {\n errorMessage += \"no city\" + \"\\n\";\n valid = false;\n firstOffender.push(\"cityField\");\n }\n // test regex against entered value, if result does not match the pattern, the if statement will evaluate to true and enter\n else if (!city)\n {\n errorMessage += \"not a valid city\" + \"\\n\";\n valid = false;\n firstOffender.push(\"cityField\");\n }\n alert(errorMessage);\n var focusError = document.getElementById(firstOffender[0]);\n focusError.focus();\n return valid;\n}", "function validateShippingInfoForm(){\n var requiredFields = ['shippingFullName', 'shippingAddress', 'shippingCity', 'shippingState', 'shippingZip', 'shippingCountryID'];\n var isValid = true;\n\n for(idx = 0; idx < requiredFields.length; idx++){\n jQuery(\"#\" + requiredFields[idx]).val(jQuery.trim(jQuery(\"#\" + requiredFields[idx]).val()));\n\n if(jQuery(\"#\" + requiredFields[idx]).val() == ''){\n isValid = false;\n jQuery(\"#\" + requiredFields[idx]).addClass('input-error');\n }\n }\n\n if(!isValid){\n showMessage(jQuery('#shippingInfoForm'), 'Please complete the fields in red.', true);\n }else{\n jQuery(\"#shippingInfoForm\").submit();\n }\n\n\n}", "function validateFields() {\n var validated = false;\n for (var i = 0; i < input_list.length; i++) {\n //loop through array of inputs in input_list defined at top of page.\n if (input_list[i].value.toString().trim() != \"\") {\n validated = true;\n }\n }\n return validated;\n }", "function validateForm() {\n var name = document.forms[\"myForm\"][\"name\"].value;\n var definition = document.forms[\"myForm\"][\"definition\"].value;\n var price = document.forms[\"myForm\"][\"price\"].value;\n var quantity = document.forms[\"myForm\"][\"quantity\"].value;\n var isavailable = document.forms[\"myForm\"][\"isavailable\"].value;\n\n var status = false;\n\n if(definition == \"\"){\n document.getElementById(\"valdefinition\").innerHTML = \"must be filled out\";\n status = false;\n }else {\n document.getElementById(\"valdefinition\").innerHTML = \"\";\n status = true;\n }\n\n if (name == \"\"){\n document.getElementById(\"valname\").innerHTML = \"must be filled out\";\n status = false;\n }else {\n document.getElementById(\"valname\").innerHTML = \"\";\n status = true;\n }\n\n if(price == \"\"){\n document.getElementById(\"valprice\").innerHTML = \"must be filled out\";\n status =false;\n }else {\n document.getElementById(\"valprice\").innerHTML = \"\";\n status = true;\n }\n\n if(quantity == \"\"){\n document.getElementById(\"valquantity\").innerHTML = \"must be filled out\";\n status =false;\n }else {\n document.getElementById(\"valquantity\").innerHTML = \"\";\n status = true;\n }\n\n if(isavailable == \"\"){\n document.getElementById(\"valisavailable\").innerHTML = \"must be filled out\";\n status = false;\n }else {\n document.getElementById(\"valisavailable\").innerHTML = \"\";\n status = true;\n }\n\n return status;\n}", "function validate() {\n\n if( document.myForm.fName.value === \"\" ) {\n alert( \"Please provide your first name!\" );\n document.myForm.fName.focus();\n return false;\n }\n if( document.myForm.sName.value === \"\" ) {\n alert( \"Please provide your surname!\" );\n document.myForm.sName.focus() ;\n return false;\n }\n if( document.myForm.email.value === \"\" ) {\n alert( \"Please provide your email or phone number!\" );\n document.myForm.email.focus() ;\n return false;\n }\n return( true );\n }", "function validateForm() {\n // Retrieving the values of form elements\n var firstname = document.insertion.fname.value;\n var email = document.insertion.email.value;\n var adress = document.insertion.adress.value;\n var phonenumber = document.insertion.ph_number.value;\n var lastname = document.insertion.lname.value;\n \n \n // Defining error variables with a default value\n var firstnameErr = (emailErr = adressErr = true);\n \n // Validate firstname\n if (firstname == \"\") {\n printError(\"firstnameErr\", \"Please enter your first name\");\n document.getElementById(\"fname\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(firstname) === false) {\n printError(\n \"firstnameErr\",\n \"Please enter a valid first name with min. 3 characters.\"\n );\n document.getElementById(\"fname\").style.borderColor = \"red\";\n } else {\n printError(\"firstnameErr\", \"\");\n document.getElementById(\"fname\").style.borderColor = \"green\";\n firstnameErr = false;\n }\n }\n \n // Validate last name\n if (lastname == \"\") {\n printError(\"lastnameErr\", \"Please enter your last name\");\n document.getElementById(\"lname\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(lastname) === false) {\n printError(\n \"lastnameErr\",\n \"Please enter a valid last name min. 3 characters.\"\n );\n document.getElementById(\"lname\").style.borderColor = \"red\";\n } else {\n printError(\"lastnameErr\", \"\");\n document.getElementById(\"lname\").style.borderColor = \"green\";\n lastnameErr = false;\n }\n }\n \n // Validate adress\n if (adress == \"\") {\n printError(\n \"adressErr\",\n \"Please enter your adress\"\n );\n document.getElementById(\"adress\").style.borderColor = \"red\";\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if (regex.test(adress) === false) {\n printError(\"adressErr\", \"Please enter a valid adress.\");\n document.getElementById(\"adress\").style.borderColor = \"red\";\n\n } else {\n printError(\"adressErr\", \"\");\n document.getElementById(\"adress\").style.borderColor = \"green\";\n adressErr = false;\n }\n }\n\n // Validate phone number\n if (phonenumber == \"\") {\n printError(\n \"ph_numberErr\",\n \"Please enter your phone number\"\n );\n document.getElementById(\"ph_number\").style.borderColor = \"red\";\n } else {\n var regex = /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$/;\n if (regex.test(phonenumber) === false) {\n printError(\"ph_numberErr\", \"Please enter a valid phone number.\");\n document.getElementById(\"ph_number\").style.borderColor = \"red\";\n } else {\n printError(\"ph_numberErr\", \"\");\n document.getElementById(\"ph_number\").style.borderColor = \"green\";\n ph_numberErr = false;\n }\n }\n\n // Validate email address\n if (email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n document.getElementById(\"email\").style.borderColor = \"red\";\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if (regex.test(email) === false) {\n printError(\"emailErr\", \"Please enter a valid email address ex: [email protected]\");\n document.getElementById(\"email\").style.borderColor = \"red\";\n } else {\n printError(\"emailErr\", \"\");\n document.getElementById(\"email\").style.borderColor = \"green\";\n emailErr = false;\n }\n }\n var g = document.getElementById(\"gender\");\n var gender = g.value;\n \n // Prevent the form from being submitted if there are any errors\n if ((firstnameErr || emailErr || adressErr || lastnameErr || ph_numberErr) == true) {\n return false;\n } \n //else {\n // // Creating a string from input data for preview\n // var dataPreview =\n // \"Data entered! \\n\" +\n // \"first name: \" +\n // firstname + \"\\n\" +\n // \"last name: \" +\n // lastname +\n // \"\\n\" +\n // \"adress : \" +\n // adress +\n // \"\\n\";\n // \"Email Address: \" + email + \"\\n\"+\n // \"phone number: \" +\n // phonenumber +\n // \"\\n\" +\n // \"email adress : \" +\n // email +\"\\n\" +\n // \"Gender : \" +\n // gender ;\n \n \n \n // // Display input data in a dialog box before submitting the form\n // alert(dataPreview);\n // }\n }", "function validate(e){\n\thideErrors();\n\n\tif(formHasErrors()){\n\t\te.preventDefault();\n\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validateForm()\n{\n // Get values from required fields so that I can make sure they are there\n var make = $(\"#make\").val();\n var model = $(\"#model\").val();\n var year = $(\"#year\").val();\n\n // If make, model, or year are empty, return false so the form does not submit\n if(make == \"\")\n {\n $(\"#make\").css({border: \"3px solid red\"}); // Use this to make the box red\n alert(\"You must provide a make\"); // Use this to let user know what went wrong\n return false; // Return false so the form does not submit\n }\n if(model == \"\")\n {\n $(\"#model\").css({border: \"3px solid red\"});\n alert(\"You must provide a model\");\n return false;\n }\n if(year == \"\")\n {\n $(\"#year\").css({border: \"3px solid red\"});\n alert(\"You must provide a year\");\n return false;\n }\n\n // Otherwise, return true so the form does submit\n return true;\n}", "function validationsOk() {\n\n // Validate if in the HTML document exist a form\n if (formExistence.length === 0) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"Form tag doesn't exist in the html document\"\n return;\n }\n\n // Validate the quantity of labels tags are in the document\n if (labelsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of label tags in the document\"\n return;\n }\n\n // Validate the quantity of buttons are in the document\n if (buttonsQuantity.length !== 2) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of button tags in the document\"\n return;\n }\n\n // Validate the quantity of inputs tags are in the document\n if (inputsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of inputs tags in the document\"\n return;\n }\n\n // Validate if the email input contains text \n if (emailInput.value === \"\" || emailInput.value === null || !isEmail(emailInput.value)) {\n return;\n }\n if (nameInput.value === \"\" || nameInput.value === null) {\n return;\n }\n // Validate if the password input contains text\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n return;\n }\n // Validate if the confirm-password input contains text\n if (confirmPasswordInput.value === \"\" || confirmPasswordInput.value === null) {\n return;\n }\n // Validate if the confirm-password match with the password\n if (confirmPasswordInput.value !== passwordInput.value) {\n return;\n }\n // all validations passed\n else {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"green\"\n infoDiv.innerText = `Registered Succesfully. Your account data is: ${emailInput.value} ${nameInput.value} ${passwordInput.value.type = \"******\"} ${confirmPasswordInput.value.type = \"******\"}`\n return;\n }\n}", "function validForm() {\n // si el nombre es igual a vacio\n // entonces muestrame que es invalido\n if ($('#titulo').val() == \"\") {\n $('#titulo').removeClass(\"is-valid\")\n $('#titulo').addClass(\"is-invalid\")\n } else {\n $('#titulo').removeClass(\"is-invalid\")\n $('#titulo').addClass(\"is-valid\")\n }\n if ($('#descripcion').val() == \"\") {\n $('#descripcion').removeClass(\"is-valid\")\n $('#descripcion').addClass(\"is-invalid\")\n } else {\n $('#descripcion').removeClass(\"is-invalid\")\n $('#descripcion').addClass(\"is-valid\")\n } \n if ($('#categorias').val() == \"\") {\n $('#categorias').removeClass(\"is-valid\")\n $('#categorias').addClass(\"is-invalid\")\n } else {\n $('#categorias').removeClass(\"is-invalid\")\n $('#categorias').addClass(\"is-valid\")\n }\n if ($('#contenido').val() == \"\") {\n $('#contenido').removeClass(\"is-valid\")\n $('#contenido').addClass(\"is-invalid\")\n } else {\n $('#contenido').removeClass(\"is-invalid\")\n $('#contenido').addClass(\"is-valid\")\n }\n if ($('#fecha_publ').val() == \"\") {\n $('#fecha_publ').removeClass(\"is-valid\")\n $('#fecha_publ').addClass(\"is-invalid\")\n } else {\n $('#fecha_publ').removeClass(\"is-invalid\")\n $('#fecha_publ').addClass(\"is-valid\")\n }\n if ($('#fecha_fin').val() == \"\") {\n $('#fecha_fin').removeClass(\"is-valid\")\n $('#fecha_fin').addClass(\"is-invalid\")\n } else {\n $('#fecha_fin').removeClass(\"is-invalid\")\n $('#fecha_fin').addClass(\"is-valid\")\n }\n if ($('#titulo').val() != \"\" && $('#categoria').val() != 0 && $('#descripcion').val() != \"\" && $('#contenido').val() != \"\" && $('#fecha_publ').val() != \"\" && $('#fecha_fin').val() >= \"\") {\n CrearOActualizar()\n }\n}", "function validateAll(type,formId){\n\t// Type: INDIVIDUAL, COMBINED or DETECT\n\tvar errorFound=0;\n\tif(type==\"INDIVIDUAL\") resetAll(formId); // reset all elems first\n\tvar form=document.getElementById(formId);\n\tfor(var i=0;i<form.elements.length;i++){\n\t\tvar elem=form.elements[i];\n\t\tif(elem==null) return false;\t// element not found\n\t\tif(elem.type.toUpperCase()==\"submit\".toUpperCase() || elem.type.toUpperCase()==\"reset\".toUpperCase()) continue; // skip submit/reset buttons\n\t\tif(type==\"INDIVIDUAL\")\n\t\t\tvar errorElem=document.getElementById(elem.id+\"_error\");\n\t\t// Text fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"text\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Password fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"password\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Text areas\n\t\tif(elem.tagName.toUpperCase()==\"textarea\".toUpperCase() && (elem.value==null || elem.value==\"\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Radios -- so far no way to check. ALT: have one radio selected by default\n\t\t// Checkboxes -- they are optional anyway, isn't it?\n\t\t// Select lists\n\t\tif(elem.tagName.toUpperCase()==\"select\".toUpperCase() && (elem.value==null || elem.value==\"\" || elem.value==\"-1\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t}\n\tif(type==\"INDIVIDUAL\")\n\t\tif(errorFound==0) return true;\n\t\telse return false;\n\telse if(type==\"DETECT\") return null;\n\telse return true;\n}", "function validiteForm(){\n \n var forms = document.querySelectorAll('.needs-validation')\n \n // Loop over them and prevent submission\n Array.prototype.slice.call(forms)\n .forEach(function (form) {\n form.addEventListener('submit', function (event) {\n if (!form.checkValidity() ) {\n event.preventDefault()\n event.stopPropagation()\n \n } else{\n envoiCommande()\n localStorage.clear();\n event.preventDefault()\n event.stopPropagation()\n console.log(\"ok\");\n }\n \n form.classList.add('was-validated')\n \n \n \n }, \n false )\n \n });\n \n}", "function processForm() {\n // validate elevation\n if ($('#mtnElevation').val() < 4003 || $('#mtnElevation').val() > 6288) {\n $('#alertMsg').html('Elevation must be between 4,003 and 6,288 feet.');\n $('#mtnElevation').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate effort\n if ($('#mtnEffort').val() === '') {\n $('#alertMsg').html('Please select an effort.');\n $('#mtnEffort').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate image\n if ($('#mtnImage').val() === '') {\n $('#alertMsg').html('Please enter an image name.');\n $('#mtnImage').focus();\n $('#alertMsg').show();\n return false;\n }\n\n // validate lat / lng\n // Note: Can break into Lat and Lgn checks, and place cursor as needed\n var regex = /^([-+]?)([\\d]{1,2})(((\\.)(\\d+)(,)))(\\s*)(([-+]?)([\\d]{1,3})((\\.)(\\d+))?)$/;\n var latLng = `${$('#mtnLat').val()},${$('#mtnLng').val()}`;\n if (! regex.test(latLng)) {\n $('#alertMsg').html('Latitude and Longitude must be numeric.');\n $('#alertMsg').show();\n return false;\n }\n\n // Form is valid\n $('#alertMsg').html('');\n $('#alertMsg').hide();\n\n return true;\n }", "async function handleFormSubmit(e) {\n e.preventDefault();\n const validations = options?.validations;\n\n if (validations) {\n const valid = true;\n const newErrors = {};\n // eslint-disable-next-line no-restricted-syntax\n for (const key in validations) {\n const value = data[key];\n const validation = validations[key];\n if (validation?.required?.value && !value) {\n // valid = false;\n newErrors[key] = validation?.required?.message;\n }\n\n const pattern = validation?.pattern;\n if (pattern?.value && !RegExp(pattern.value).test(value)) {\n // valid = false;\n newErrors[key] = pattern.message;\n }\n\n const custom = validation?.custom;\n if (custom?.isValid && !custom.isValid(value)) {\n // valid = false;\n newErrors[key] = custom.message;\n }\n }\n\n if (!valid) {\n setErrors(newErrors);\n return;\n }\n }\n\n setErrors({});\n\n if (options?.onSubmit) {\n options.onSubmit();\n }\n }", "function validateForm() {\n if (email.value && password.value) {\n fieldvalidate = true;\n } else {\n submit.disabled = true\n submit.classList.add('false');\n }\n}", "_onSubmitValidateInputs() {\n\t\tthis.setState({ inputDirty: true });\n\t\tlet validationValue = this._validateInputFeild(this.state.inputStateKey);\n\t\tthis.setState({ isValidInput: validationValue.test, invalidMessage: validationValue.test ? '' : validationValue.message })\n\t\tif (this.props.inputChanged) {\n\t\t\tthis.props.inputChanged(this.props.inputStateKey, this.state.inputStateKey, this.state.isValidInput)\n\t\t}\n\t}" ]
[ "0.7404984", "0.73002553", "0.72314644", "0.72235465", "0.71858704", "0.71672356", "0.7150017", "0.714041", "0.7106865", "0.70938456", "0.705753", "0.7029675", "0.6995237", "0.69675875", "0.69248253", "0.6919939", "0.68882567", "0.6882748", "0.6878283", "0.685837", "0.6856179", "0.68355846", "0.68240446", "0.68157214", "0.6814665", "0.68094385", "0.6786962", "0.67784965", "0.6776472", "0.6747326", "0.673447", "0.67312473", "0.6726244", "0.6723583", "0.6713799", "0.6699701", "0.6679402", "0.6678211", "0.6663071", "0.66529894", "0.66523564", "0.6651207", "0.66467047", "0.66454923", "0.66454166", "0.66421425", "0.66404176", "0.6636119", "0.6632144", "0.6631456", "0.6629645", "0.66288733", "0.6624304", "0.66185224", "0.661681", "0.66142654", "0.6614264", "0.6608043", "0.66022086", "0.6601137", "0.6599573", "0.659827", "0.65919083", "0.6587862", "0.657745", "0.65729904", "0.65710604", "0.6570784", "0.6568289", "0.6566556", "0.6557462", "0.6557455", "0.65469384", "0.654292", "0.654053", "0.65397596", "0.6537094", "0.6534886", "0.6531558", "0.6527484", "0.6525248", "0.65236783", "0.65197915", "0.65151817", "0.6512584", "0.6495812", "0.64897585", "0.6487543", "0.64873946", "0.6482767", "0.64759475", "0.6471612", "0.6469614", "0.64630365", "0.6459567", "0.6454489", "0.64516973", "0.64511025", "0.64455247", "0.6444116", "0.64433277" ]
0.0
-1
Render a horizontal bar.
renderBar(studentCount, options = {}) { const scaleFactor = options.scaleFactor || 0.5; const percentage = (studentCount === 0) ? 0 : studentCount * scaleFactor; const width = (percentage > 100) ? '100%' : percentage + '%'; const padding = percentage === 0 ? 0 : 3; const backgroundColor = options.backgroundColor || (percentage > 100 ? '#666' : '#ccc'); const color = percentage > 100 ? 'white' : 'black'; const text = percentage === 0 ? '\u00A0' : studentCount; return <div style={{...styles.bar, padding, width, color, backgroundColor}}>{text}</div>; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HorizontalBar(props){\n return (\n <div className=\"DataVis-graph-horizontal-bar\" onMouseOver={props.onHover} style={{width: props.width}}>\n {props.label}\n </div>\n );\n}", "function DrawHorizontalBarChart() {\n let chartHeight = (1000/25) * values.length;\n\n\n new Chartist.Bar('#ct-chart-bar', {\n labels: labels,\n series: [values]\n }, {\n axisX: {\n offset: 20,\n position: 'end',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: true,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n axisY: {\n offset: 100,\n position: 'start',\n labelOffset: {\n x: 0,\n y: 0,\n },\n showLabel: true,\n showGrid: false,\n labelInterpolationFnc: Chartist.noop,\n scaleMinSpace: 30,\n onlyInteger: false\n },\n width: undefined,\n height: chartHeight,\n high: undefined,\n low: undefined,\n referenceValue: 0,\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n seriesBarDistance: 5,\n stackBars: false,\n stackMode: 'accumulate',\n horizontalBars: true,\n distributedSeries: false,\n reverseData: true,\n showGridBackground: false,\n }, {\n //Options\n }, [\n //ResponsiveOptions\n ]);\n}", "function componentBarsHorizontal () {\n\n /* Default Properties */\n var width = 400;\n var height = 500;\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n var classed = \"barsHorizontal\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n var _dataTransform$summar = dataTransform(data).summary(),\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleLinear().domain(valueExtent).range([0, height]).nice();\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleBand().domain(columnKeys).rangeRound([0, width]).padding(0.15);\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barsHorizontal\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data());\n selection.each(function () {\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add bars to series\n var bars = seriesGroup.selectAll(\".bar\").data(function (d) {\n return d.values;\n });\n\n bars.enter().append(\"rect\").classed(\"bar\", true).attr(\"fill\", function (d) {\n return colorScale(d.key);\n }).attr(\"width\", yScale.bandwidth()).attr(\"y\", function (d) {\n return yScale(d.key);\n }).attr(\"height\", yScale.bandwidth()).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d);\n }).merge(bars).transition().ease(transition.ease).duration(transition.duration).attr(\"x\", 0).attr(\"width\", function (d) {\n return xScale(d.value);\n });\n\n bars.exit().transition().style(\"opacity\", 0).remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "_drawHealthBar() {\n const { x, y, width, height } = this.config;\n this._bar = this.scene.add.rectangle( x, y, width, height,\n this.config.barColor );\n this._bar.setOrigin( 0, 0 );\n }", "function createBars(vals) {\n var barLeft;\n if (that.model.get(\"columnShift\")) {\n barLeft = \" style=left:\" + that.model.get(\"columnShift\") + \"px\";\n }\n var html = [\"<div class='bars'\" + barLeft + \">\"];\n for (var i = 0; i < vals.length; i++) {\n html.push(\"<div class='bar bar\" + (i + 1) + \"' style='height:\" + Math.round(100 * vals[i]) + \"%'></div>\");\n }\n html.push(\"</div>\");\n return html.join(\"\");\n }", "function drawHungerBar () {\r\n // Hunger bar Background\r\n rect(0, 550, cnv.width, 50, \"black\", \"fill\");\r\n // Hunger bar Border\r\n rect(8, 558, 784, 34, \"white\", \"fill\");\r\n // Hunger bar Border Background\r\n rect(10, 561, 195, 28, \"maroon\", \"fill\"); // 1/4\r\n rect(195, 561, 195, 28, \"darkred\", \"fill\"); // 1/2\r\n rect(390, 561, 195, 28, \"red\", \"fill\"); // 3/4\r\n rect(585, 561, 205, 28, \"tomato\", \"fill\"); // 4/4\r\n\r\n // Hunger Bar\r\n rect(hungerBar.x, hungerBar.y, hungerBar.w, hungerBar.h, hungerBar.col, \"fill\");\r\n}", "makeBar() {\r\n const percentage = this.timeLeft / this.MAX_TIME;\r\n const progress = Math.round((this.BAR_SIZE * percentage));\r\n const emptyProgress = this.BAR_SIZE - progress;\r\n const progressText = '▇'.repeat(progress);\r\n const emptyProgressText = ' '.repeat(emptyProgress);\r\n const bar = '```' + this.DISP_TEXT + '\\n' + progressText + emptyProgressText + '```';\r\n return bar;\r\n }", "function chartBarChartHorizontal () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"barChartHorizontal\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 20, left: 80 };\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n\n /* Chart Dimensions */\n var chartW = void 0;\n var chartH = void 0;\n\n /* Scales */\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n chartW = width - (margin.left + margin.right);\n chartH = height - (margin.top + margin.bottom);\n\n var _dataTransform$summar = dataTransform(data).summary(),\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n yScale = d3.scaleBand().domain(columnKeys).rangeRound([0, chartH]).padding(0.15);\n\n xScale = d3.scaleLinear().domain(valueExtent).range([0, chartW]).nice();\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barChartHorizontal\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n // Create SVG element (if it does not exist already)\n if (!svg) {\n svg = function (selection) {\n var el = selection._groups[0][0];\n if (!!el.ownerSVGElement || el.tagName === \"svg\") {\n return selection;\n } else {\n return selection.append(\"svg\");\n }\n }(selection);\n\n svg.classed(\"d3ez\", true).attr(\"width\", width).attr(\"height\", height);\n\n chart = svg.append(\"g\").classed(\"chart\", true);\n } else {\n chart = selection.select(\".chart\");\n }\n\n // Update the chart dimensions and add layer groups\n var layers = [\"barChart\", \"xAxis axis\", \"yAxis axis\"];\n chart.classed(classed, true).attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\").attr(\"width\", chartW).attr(\"height\", chartH).selectAll(\"g\").data(layers).enter().append(\"g\").attr(\"class\", function (d) {\n return d;\n });\n\n selection.each(function (data) {\n // Initialise Data\n init(data);\n\n // Horizontal Bars\n var barsHorizontal = component.barsHorizontal().width(chartW).height(chartH).colorScale(colorScale).xScale(xScale).yScale(yScale).dispatch(dispatch);\n\n chart.select(\".barChart\").datum(data).call(barsHorizontal);\n\n // X Axis\n var xAxis = d3.axisBottom(xScale);\n\n chart.select(\".xAxis\").attr(\"transform\", \"translate(0,\" + chartH + \")\").call(xAxis);\n\n // Y Axis\n var yAxis = d3.axisLeft(yScale);\n\n chart.select(\".yAxis\").call(yAxis);\n\n // Y Axis Label\n var yLabel = chart.select(\".yAxis\").selectAll(\".yAxisLabel\").data([data.key]);\n\n yLabel.enter().append(\"text\").classed(\"yAxisLabel\", true).attr(\"y\", -10).attr(\"dy\", \".71em\").attr(\"fill\", \"#000000\").style(\"text-anchor\", \"center\").merge(yLabel).transition().text(function (d) {\n return d;\n });\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return this;\n };\n\n /**\n * Transition Getter / Setter\n *\n * @param {d3.transition} _v - D3 transition style.\n * @returns {*}\n */\n my.transition = function (_v) {\n if (!arguments.length) return transition;\n transition = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch on Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function horizontalChart(num1, num2, num3) {\n var star = '*';\n return star.repeat(num1) + \"\\n\" + star.repeat(num2) + \"\\n\" + star.repeat(num3);\n}", "function xBar(dir, // direction, 'ltr', 'rtl', 'ttb', or 'btt'\r\n conStyle, barStyle) // container and bar style class names\r\n{\r\n //// Public Properties\r\n\r\n this.value = 0; // current value, read-only\r\n\r\n //// Public Methods\r\n\r\n // Update current value\r\n this.update = function(v)\r\n {\r\n if (v < 0) v = 0;\r\n else if (v > this.inMax) v = this.inMax;\r\n this.con.title = this.bar.title = this.value = v;\r\n switch(this.dir) {\r\n case 'ltr': // left to right\r\n v = this.scale(v, this.w);\r\n xLeft(this.bar, v - this.w);\r\n break;\r\n case 'rtl': // right to left\r\n v = this.scale(v, this.w);\r\n xLeft(this.bar, this.w - v);\r\n break;\r\n case 'btt': // bottom to top\r\n v = this.scale(v, this.h);\r\n xTop(this.bar, this.h - v);\r\n break;\r\n case 'ttb': // top to bottom\r\n v = this.scale(v, this.h);\r\n xTop(this.bar, v - this.h);\r\n break;\r\n }\r\n };\r\n\r\n // Change position and/or size\r\n this.paint = function(x, y, // container position\r\n w, h) // container size\r\n {\r\n if (xNum(x)) this.x = x;\r\n if (xNum(y)) this.y = y;\r\n if (xNum(w)) this.w = w;\r\n if (xNum(h)) this.h = h;\r\n xResizeTo(this.con, this.w, this.h);\r\n xMoveTo(this.con, this.x, this.y);\r\n xResizeTo(this.bar, this.w, this.h);\r\n xMoveTo(this.bar, 0, 0);\r\n };\r\n\r\n // Change scale and/or start value\r\n this.reset = function(max, start) // non-scaled values\r\n {\r\n if (xNum(max)) this.inMax = max;\r\n if (xNum(start)) this.start = start;\r\n this.update(this.start);\r\n };\r\n\r\n //// Private Methods\r\n \r\n this.scale = function(v, outMax)\r\n {\r\n return Math.round(xLinearScale(v, 0, this.inMax, 0, outMax));\r\n };\r\n\r\n //// Private Properties\r\n\r\n this.dir = dir;\r\n this.x = 0;\r\n this.y = 0;\r\n this.w = 100;\r\n this.h = 100;\r\n this.inMax = 100;\r\n this.start = 0;\r\n this.conStyle = conStyle;\r\n this.barStyle = barStyle;\r\n\r\n //// Constructor\r\n\r\n // Create container\r\n this.con = document.createElement('DIV');\r\n this.con.className = this.conStyle;\r\n // Create bar\r\n this.bar = document.createElement('DIV');\r\n this.bar.className = this.barStyle;\r\n // Insert in object tree\r\n this.con.appendChild(this.bar);\r\n document.body.appendChild(this.con);\r\n\r\n} // end xBar", "drawHealthBar(){\n this.healthBar.beginFill(0xFF0000);\n this.healthBar.drawRect(0, -12, 575, 25);\n this.healthBar.x = this.x;\n this.healthBar.y = this.y;\n this.healthBar.scale.x = this.health / this.maxHealth;\n this.healthBar.endFill();\n }", "function renderLabelsHorizontal() {\n var i, origin, label, cname;\n\n for (i = 0; i < this.labels.length; i++) {\n origin = getInnerChartPoint([\n (i * 100) / (this.labels.length - 1),\n 100\n ]);\n\n cname = 'chart-label chart-label-x';\n\n if (i === 0) {\n cname += ' first';\n }\n\n if (i === this.labels.length - 1) {\n cname += ' last';\n }\n\n origin[1] += LABEL_MARGIN;\n\n label = this.labels[i];\n\n this.svg.add('text', origin, label, { class: cname });\n }\n}", "function drawHealthBar() {\r\n healthBar.clear();\r\n hbX = userIntThis.cameras.main.scrollX + userIntThis.sys.game.config.width*0.775;\r\n hbY = userIntThis.cameras.main.scrollY + userIntThis.sys.game.config.height*0.0225;\r\n healthBar.lineStyle(1,0x000000,1);\r\n healthBar.fillStyle(0xff0000,1);\r\n healthBar.strokeRect(hbX,hbY,hbWidth,hbHeight);\r\n \r\n if (currentHealth > 0) {\r\n healthBar.fillRect(hbX,hbY,hbIncrement*oldHealth,hbHeight);\r\n }\r\n}", "function barXFunc (d, i) { return (i * barwidth)+\"%\" ; }", "function drawHealthBar() {\n maxHealthUpdate();\n healthBar.clear();\n \n hbX = userIntThis.cameras.main.scrollX + userIntThis.sys.game.config.width*0.73;\n hbY = userIntThis.cameras.main.scrollY + userIntThis.sys.game.config.height*0.0225;\n healthBar.lineStyle(1,0x000000,1);\n healthBar.fillStyle(0xff0000,1);\n healthBar.strokeRect(hbX,hbY,hbWidth,hbHeight);\n \n if (currentHealth > 0) {\n healthBar.fillRect(hbX,hbY,hbIncrement*oldHealth,hbHeight);\n }\n}", "function initHorizontalChart() {\n console.log(\"initHorizontalChart\");\n\n // ordinal.rangeRoundBands(interval, padding, outerPadding)\n // computes range values so as to divide the chart area into evenly-spaced, evenly-sized bands\n // assures integers for pixel; values (avoids aliasing)\n // padding: space between bars\n // outerpadding: space before and after bars collection\n\n // ======= data granularity =======\n var vowels = [\"A\", \"E\", \"I\", \"O\", \"U\"];\n\n // ======= chart formatting =======\n var margin = {top: 20, right: 20, bottom: 30, left: 40},\n width = 720 - margin.left - margin.right, // outer width of chart\n height = 500 - margin.top - margin.bottom; // outer height of chart\n\n // ======= scale mapping (data to display) =======\n var x = d3.scale.ordinal() // function that sorts data alphabetically\n .rangeRoundBands([0, width], .1); // .1 specifies space between bars\n\n var y = d3.scale.linear() // function that maps data domain (below) to output range\n .range([height, 0]); // fits max data value into max chart height\n\n // ======= scale label formating =======\n var xAxis = d3.svg.axis() // existing x scale function is bound to xAxis\n .scale(x) // x scale becomes scale function of xAxis object\n .orient(\"bottom\"); // specifies location of axis (top/bottom/left/right)\n\n var yAxis = d3.svg.axis()\n .scale(y) // existing y scale function is bound to yAxis as yAxis function\n .orient(\"left\") // specifies location of axis (top/bottom/left/right)\n .ticks(10, \"%\"); // spacing (10px) and format (%) for ticks\n\n // ======= build svg objects =======\n var svg = d3.select(\"#chartHorizontal\").append(\"svg\") // create and append svg element to container\n .attr(\"width\", width + margin.left + margin.right) // offset chart top/left/right/bottom by margin dimensions\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\") // g element is parent svg object\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n // ======= get remote data file =======\n d3.tsv(\"data2.tsv\", stringToInt, function(error, dataSet) {\n if (error) throw error;\n\n // ======= get x/y domains (input), bind to ranges (output scale objects) =======\n x.domain(dataSet.map(function(d) { return d.letter; })); // get letter value from data object\n y.domain([0, d3.max(dataSet, function(d) { return d.frequency; })]); // get frequency value from data object\n\n // ======= X scale =======\n svg.append(\"g\") // new \"g\" element contains scale produced by xAxis object methods\n .attr(\"class\", \"x axis\") // \"x\" and \"axis\" classes for general and specific styles\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis); // calls xAxis methods to create scale\n\n // ======= Y scale (with title) =======\n svg.append(\"g\") // new \"g\" element contains scale produced by yAxis object methods\n .attr(\"class\", \"y axis\") // \"y\" and \"axis\" classes for general and specific styles\n .call(yAxis) // calls yAxis methods to create scale\n .append(\"text\") // append \"Frequency\" scale label to scale\n .attr(\"transform\", \"rotate(-90)\") // rotate label to fit\n .attr(\"y\", 10) // y location of label (moves on x axis due to rotation)\n .attr(\"dy\", \".71em\") // location tweak\n .style(\"text-anchor\", \"end\") // position based on end of text string (vs start of text)\n .text(\"Frequency\"); // text content (\"Frequency\")\n\n // ======= rects for bar graph =======\n svg.selectAll(\".bar\") // new \"g\" element containers to hold rect and text elements\n .data(dataSet)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\") // enable styling of rects via class name\n .attr(\"x\", function(d) { return x(d.letter); }) // x scale function maps range location (\"x\") to domain\n .attr(\"width\", x.rangeBand()) // rangeBand function spaces bars and inserts padding\n .attr(\"y\", function(d) { return y(d.frequency); }) // y scale function maps range location (\"y\") to domain\n .attr(\"height\", function(d) { return height - y(d.frequency); }) // calculated from height - value\n .style({'fill': function(d, i) { // toggle bar colors (index even/odd)\n var vowelCheck = $.inArray(d.letter, vowels);\n if (vowelCheck > -1) {\n whichColor = 'rebeccapurple';\n } else {\n whichColor = (i % 2 == 0) ? \"#556B2F\":\"#808000\";\n }\n return whichColor;\n }\n });\n });\n\n // ======= stringToInt =======\n function stringToInt(d) {\n // console.log(\"stringToInt\");\n d.frequency = +d.frequency;\n return d;\n }\n}", "_calcWidthBar(d, i) {\n if (d.indexData !== -1) {\n return this.model.barScale(this.model.data.children.data[this._vOrder[d.indexData]].edge.values[i]);\n }\n else\n return 0; // Do not draw the rectangle\n }", "addLeftBar() {\n \n this.page.addBar(\"fixed\", 40, \"leftbar-menu\");\n this.page.addBar(\"splitter\", 300, \"leftbar\");\n }", "get isHorizontal() {\n return true;\n }", "get isHorizontal() {\n return true;\n }", "function renderBars() {\n return sortEnergy().map( (item,i)=>{\n return <Bar \n bar={item} \n key={i} \n select={select} \n index={i} \n onClick={()=>setSelect(i)} \n onMouseLeave={()=>setSelect(-1)}>\n {item.name} { parseInt((item.value*100).toString()) }%\n </Bar>\n })\n }", "function horizontalChart (a, b, c) {\n let empty = \"\";\n let star = \"* \";\n let newLine = \"\\n\";\n for (let i = 0; i < a; i++) {\n empty += star;\n }\n empty += newLine;\n for (let j = 0; j < b; j++) {\n empty += star;\n }\n empty += newLine; \n for (let k = 0; k < c; k++) {\n empty += star;\n }\n empty += newLine;\n return empty; \n}", "function CreateHealthBar(htmlElem, index){\r\n var barContainer = document.createElement(\"DIV\");\r\n var bar = document.createElement(\"DIV\");\r\n barContainer.classList.add('bar-container');\r\n bar.classList.add('bar');\r\n barContainer.appendChild(bar);\r\n barContainer.id = 'bar' + index;\r\n htmlElem.appendChild(barContainer)\r\n }", "function create_bars()\n{\n // Make the array empty\n arr=[];\n // Make the visible bars empty\n bar.innerHTML=\"\";\n // Take the no of bars from range\n var no_of_bar=arr_size.value;\n var arr_width_size =(500/no_of_bar);\n \n // Set the height\n // we will sort the bars on the basis of height\n for(var i=0;i<no_of_bar;i++)\n arr.push(Math.floor(Math.random()*100));\n\n\n //Set the height and width of visible bars \n for(var i=0;i<no_of_bar;i++)\n {\n \n var div = document.createElement(\"DIV\");\n var margin_size=0.1;\n div.classList.add(\"special\");\n div.style=\"margin:0%\" + margin_size + \"%; width:\" + (100/no_of_bar-(2*margin_size)) + \"%;\";\n var height = (arr[i]*5+10).toString();\n height = height+'px';\n div.style.height=height;\n bar.appendChild(div);\n }\n}", "function horizontalChart () {\n var row = '';\n for (var i = 0; i < arguments.length; i++){\n for (var j = 0; j < arguments[i]; j++){\n row += '*';\n }\n console.log(row);\n row = '';\n }\n}", "function drawHorizontalRule() {\n var stat = getState(cm);\n _replaceSelection(cm, stat.image, insertTexts.horizontalRule);\n}", "function drawBar(x, y, width, data, color) {\n ctx.beginPath();\n ctx.rect(x, y, width, data, color);\n ctx.fillStyle = \"#ff3300\";\n ctx.fill();\n }", "function DiscreteHorizSlider (params) {\n if (!params.numBins) {\n throw 'discrete horizontal slider needs an integer number of bins';\n }\n this.numBins = params.numBins\n this.binSize = Math.floor(params.width / this.numBins);\n this.lineWidth = 4;\n this.renderWidth = this.binSize - this.lineWidth;\n this.currentBin = 0;\n this.lastBin = -99;\n this.binBorderColor = params.binBorderColor;\n \n Slider.call(this, params);\n \n var oldStyle = this.g2d.fillStyle;\n this.g2d.fillStyle = this.binBorderColor;\n for (var i = 0; i <= this.numBins; i++) {\n this.g2d.fillRect(\n Math.floor(i * this.binSize), 0, this.lineWidth, this.height\n );\n }\n this.g2d.fillStyle = oldStyle;\n }", "function drawBar(context, x, y, width, height, c) {\n context.fillStyle = c;\n context.fillRect(x, HEIGHT-y-height, width, height); \n }", "function setupBars(number,chartDims){\n\tvar i;\n\tvar padding=0.1; //percentage of white space around bars\n\t\n\tvar texture = new PIXI.RenderTexture(renderer, 10, 10);\n\tvar graphics = new PIXI.Graphics();\n\tgraphics.beginFill(0xFF3000);\n\tgraphics.drawRect(0, 0, 10, 10);\n\tgraphics.endFill();\n\ttexture.render(graphics);\n\t\n\tfor (i=0;i<number;i++){\n\t\tbars[i]= new PIXI.Sprite(texture); \n\t\tbardet[i]=new PIXI.Text(' ');\n\t\tstage.addChild(bars[i]);\n\t\tstage.addChild(bardet[i]);\n\t\t//console.log(i);\t\n\t\tbars[i].position.set(chartDims[0]+chartDims[2]*(i/number+1/number*padding),(chartDims[3]*0.9+chartDims[1]))\n\t\tbars[i].width=(chartDims[2]/number*(1.0-2.0*padding))\n\t\tbars[i].height=(chartDims[3]*0.1);\n\t}\n\n\t\n}", "function barGeometry(d, i) {\n d = config.accessor(d);\n var x, y, width, height;\n var myScale = scale ? scale : scales[i];\n if(config.orientation === 'horizontal') {\n x = i * config.transform.x;\n y = i * config.transform.y;\n\n width = 0;\n if(!isNaN(d)) {\n width = Math.abs(myScale(d));\n }\n\n if(d < 0)\n x -= width;\n\n height = config.barWidth;\n } else {\n x = i * config.transform.x;\n\n // console.log(myScale)\n height = Math.abs(myScale(0) - myScale(d));\n // console.log(d, height);\n width = config.barWidth;\n\n y = myScale(0);\n if(d > 0)\n y -= height;\n \n y += i * config.transform.y;\n }\n\n d3.select(this)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }", "function drawHealthBar(){\n push();\n rectMode(CORNER);\n //background rectangle of health bar\n fill(64,43,112);\n rect(0,height-50,width/1 + 10,30);\n //The health bar\n fill(153, 153, 255);\n healthBar = map(harryHealth,0,harryMaxHealth, 0, width);\n rect(0, height-50,healthBar,30);\n //Text showing the Energy level\n textFont (\"Helvetica\")\n fill(64,43,112);\n textSize(15);\n textAlign(CENTER,CENTER);\n var energyText = \"ENERGY LEFT\";\n text(energyText,width/2,height-35);\n pop();\n}", "function horizontalLine() {\n process.stdout.write('+');\n for (let column of columns) {\n for (var i = 0; i < colLengths[column] + 2; i++) {\n process.stdout.write('-');\n }\n process.stdout.write('+');\n }\n console.log();\n }", "function horizontalChart2(num1, num2, num3) {\n var star = '';\n for (var i = 0; i < num1; i++) {\n star += '*';\n }\n star += '\\n';\n for (var i = 0; i < num2; i++) {\n star += '*';\n }\n star += '\\n';\n for (var i = 0; i < num3; i++) {\n star += '*';\n }\n return star;\n}", "function bar(h, c) { \n\t\t// h: high\n\t\t// c: color\n\t\t\n\t\tvar geo = new THREE.CubeGeometry( 1, h, 1 );\n\t\tvar mat = new THREE.MeshBasicMaterial(\n\t\t\t\t\t\t{ \tcolor: c, \n\t\t\t\t\t\t\tside: THREE.FrontSide,\n\t\t\t\t\t\t\topacity: 0.85,\n\t\t\t\t\t\t\ttransparent: true\t} );\n\t\tvar bar = new THREE.Mesh( geo, mat );\n\t\tbar.position.y += h / 2;\n\t\n\treturn bar;\n\t}", "function createBar(type, percent, label) {\n return $('<div />', {\n 'class': type,\n 'style': 'width: ' + percent + '%;',\n 'text': label\n });\n}", "function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n for (i = 0; i < sets.length; i++) {\n for (j = 0; j < len; j++) {\n p = 1;\n a = rotated ? height : width;\n w = ((a / len) / sets.length) - ((p / sets.length) * i) - 1;\n x = (p / 2) + getXForIndex(j, len + 1) + (w * i) + 1;\n y = getYForValue(sets[i][j]);\n h = y - getYForValue(0) || !isNaN(opts.mapZeroValueTo) && +opts.mapZeroValueTo || 0;\n\n if (isStacked()) {\n // TODO account for negative and positive values in same stack\n w = (a / len) - 2;\n x = getXForIndex(j, len + 1);\n //y = getYForValue(sumY(sets.slice(0, i + 1), j));\n \n // Accounting for negative and positive values in same stack\n y = getYForValue(sumYSigned(sets, i, j));\n }\n\n drawRect(colorOf(i), x, y, w, h);\n }\n }\n }", "get horizontalOrientation() {\n return this.navBarLocation === 'top' || this.navBarLocation === 'bottom';\n }", "function renderTopBar() {\n let canvas = document.querySelector(\"#topBarCanvas\")\n canvas.setAttribute(\"width\", document.body.clientWidth)\n canvas.setAttribute(\"height\", 50)\n let ctx = canvas.getContext(\"2d\")\n drawLine(ctx, 0, 0, canvas.width, 0, 8)\n for(let i = 0; i < 20; i++) {\n horizontalPos = i * canvas.width / 19\n horizontalPosInUnits = horizontalPos / canvas.width * (pageEnd - pageStart) + pageStart\n drawLine(ctx, horizontalPos, 3, horizontalPos, 12)\n drawText(ctx, Math.round(horizontalPosInUnits * 10) / 10, {x: horizontalPos - 12, y: 28})\n }\n}", "function drawBarChartLabels(context) {\n if (context.type === 'label' &&\n window.innerWidth <= 560 &&\n context.element._node.innerHTML.indexOf('ct-horizontal') > -1) {\n context.element._node.innerHTML = '';\n }\n }", "function horizontalChart3() {\n var star = '';\n for (var i = 0; i < arguments.length; i++) {\n for (j = 0; j < arguments[i]; j++) {\n star += \"*\";\n }\n star += '\\n';\n }\n return star;\n}", "function horizontalRescale(increment) {\n if (increment) {\n if (graph.scale.horizontal.value < graph.scale.horizontal.limits[1]) {\n graph.scale.horizontal.increment()\n setNewYPositions()\n applyScaleText()\n }\n } else {\n if (graph.scale.horizontal.value > graph.scale.horizontal.limits[0]) {\n graph.scale.horizontal.decrement()\n setNewYPositions()\n applyScaleText()\n }\n }\n }", "function createBars(data, options) {\n // Calculating bar width given the spacing of the bars\n var numberOfBars = data.length;\n var xAxisLength = $(\"#chartarea\").width();\n var barWidth = (xAxisLength - ((numberOfBars + 1) * parseInt(options.barspacing)))/numberOfBars;\n barWidth = Math.floor(barWidth);\n var yScale = yAxis(data, options)[1];\n var barHeight;\n var barColour;\n var barStartPosition;\n\n //for loop that creates the bars for each of the data\n for (var i = 0; i < data.length; i++) {\n barStartPosition = 0;\n //Calculate x offset from y axis\n var xOffset = (i * barWidth) + ((i + 1) * parseInt(options.barspacing));\n var barId = \"bar\" + i;\n for ( var j = 0; j < data[i].length; j++) {\n barId = barId + j;\n barHeight = data[i][j] * yScale;\n drawBar(data, options, barId, xOffset, barHeight, barWidth, options.barcolour[j], barStartPosition, i, j);\n barStartPosition += barHeight;\n if(j === 0) {\n xAxisLabels(options.datalabels[i], barId);\n }\n }\n\n }\n\n // sets CSS formatting options for all bars, data and labels\n $(\".bar\").css({\n \"width\": barWidth,\n \"margin\": 0,\n \"padding\": 0,\n \"border\": 0\n });\n\n // formats the x labels in the color defined in options\n $(\".xaxislabels\").css({\"color\": options.datalabelcolor,\n \"top\": \"100%\",\n \"padding\": \"5%\"\n });\n\n $(\".xaxislabels, .xaxisdata\").css({ \"border\": \"0\",\n \"margin-bottom\": \"2%\",\n \"margin-top\": \"2%\",\n \"padding\": \"0\",\n \"position\": \"absolute\",\n \"text-align\": \"center\",\n \"width\": \"100%\",\n \"font-size\": \"small\"\n })\n}", "function startBar() {\n if (i == 0) {\n i = 1;\n width = 0;\n var id = setInterval(tick, 10);\n\n // 1 tick function of progress bar 1 tick = 100ms and\n function tick() {\n if (width >= 100 ) {\n clearInterval(id);\n i = 0;\n checkEndGame();\n } else {\n adjustWidth();\n }\n\n // adjust width of progress bar and % displayed each tick\n function adjustWidth() {\n width += 0.0166666666666667;\n bar.style.width = width + \"%\";\n bar.innerHTML = width.toFixed(1) + \"%\";\n\n // set width value to a var\n barWidth = width;\n }\n\n }\n }\n }", "rotateHorizontal() {\r\n\t\tvar x = this.length;\r\n\t\tthis.length = this.width;\r\n\t\tthis.width = x;\r\n\t\treturn;\r\n\t}", "function initToCounterHorizontalProgressBar($this){\n\t\"use strict\";\n\n var percentage = parseFloat($this.find('.progress_content').data('percentage'));\n\tif($this.find('.progress_number span').length) {\n\t\t$this.find('.progress_number span').each(function() {\n\t\t\t$j(this).parents('.progress_number_wrapper').css('opacity', '1');\n\t\t\t$j(this).countTo({\n\t\t\t\tfrom: 0,\n\t\t\t\tto: percentage,\n\t\t\t\tspeed: 1500,\n\t\t\t\trefreshInterval: 50\n\t\t\t});\n\t\t});\n\t}\n}", "function horizontalAxis(x, y) {\n newPath(); // Nueva ruta de gráficos\n arrow(x - 20, y, x + 240, y); // Dibuja el eje horizontal\n var t0 = Math.ceil(tU); // hora del primer tick (s)\n var x0 = x + pixT * (t0 - tU); // posición del primer tic \n for (var i = 0; i <= 10; i++) { // para todos los ticks ... \n var xT = x0 + i * pixT; // Coordenada horizontal de la marca\n line(xT, y - 3, xT, y + 3); // dibujar tick\n if (xT >= x + 5 && xT <= x + 215 // Si la marca no está demasiado a la izquierda o a la derecha ...\n &&\n (t0 + i <= 100 || (t0 + i) % 2 == 0)) // ... y espacio para etiquetado disponible ...\n alignText(\"\" + (t0 + i), 1, xT, y + 13); // ... hacer etiquetado\n }\n alignText(symbolTime, 1, DX + 230, DY + 18); // inscripción (t)\n alignText(text16, 1, DX + 230, DY + 30); // especificación de la (s) unidad (es)\n}", "function drawBuckets() {\n for (i = 0; i < buckets.length; i++) {\n text(i, 10 + 20 * i, height - 10);\n\n var barLeft = 10 + 20 * i;\n var barBottom = height - 30;\n var barHeight = buckets[i] * 15;\n\n rect(barLeft, barBottom, 15, -barHeight);\n }\n}", "function drawBarVis(type) {\r\n const BINS = canvas.width / 3;\r\n const BAR_WIDTH = canvas.width / BINS;\r\n const HALF_CANVAS_HEIGHT = canvas.height / 2;\r\n\r\n let x_coord = 0;\r\n\r\n // Draw bars\r\n for (var i = 0; i < BINS; i++) {\r\n let barLength = Math.pow(frequencyData[i + Math.ceil(i / 90)], 3) / Math.pow(255, 3);\r\n\r\n switch(type) {\r\n // === Spaced Mirrored Bars ===\r\n case \"spacedMirrored\":\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n // Top Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * SPACING),\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n // Bottom Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 + barLength * SPACING),\r\n BAR_WIDTH,\r\n HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n break; \r\n // === Full Bars === \r\n case \"full\":\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT,\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength\r\n );\r\n break;\r\n // === Mirrored Bars ===\r\n default:\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * MIRR_SIZE),\r\n BAR_WIDTH,\r\n canvas.height * barLength * MIRR_SIZE\r\n ); \r\n }\r\n //Set new starting x-coordinate for next bar\r\n x_coord += BAR_WIDTH + 1;\r\n }\r\n }", "function horizontalScale() {\n if (svg.element.select('.horizontalScale')) svg.element.select('.horizontalScale').remove()\n if (ruler.container) ruler.container.remove()\n ruler.container = svg.element\n .append('g')\n .attr('transform', 'translate(' + [ruler.y, ruler.x] + ')')\n .attr('class', 'horizontalScale')\n\n ruler.container.append('path')\n .attr('d', d => 'M' + ruler.padding + ',10L' + (ruler.width + ruler.padding) + ',10')\n .attr('stroke-width', 1)\n .attr('stroke', '#000')\n\n ruler.element = ruler.container\n .append('text')\n .attr('class', 'ruler-text')\n .attr('x', ruler.width / 2 + ruler.padding)\n .attr('y', 36)\n .attr('font-family', 'sans-serif')\n .text('')\n .attr('font-size', '14px')\n .attr('fill', '#000')\n .attr('text-anchor', 'middle')\n }", "render() {\n // An unusual thing about JSX is that the `style` attribute should be a\n // JavaScript object, not a string like in HTML.\n return (\n <div className=\"GraphBar\">\n <div className=\"label\">{this.props.label}</div>\n <div className=\"value\" style={{width:this.props.value * 50}}>{this.props.value}</div>\n\n </div>\n );\n }", "function updateHealthbar() {\n let redPos = redBar.components.position;\n redPos.width = (health - currHealth) / health * redPos.height * 4;\n\n let greenPos = greenBar.components.position;\n greenPos.width = greenPos.height * 4 - redPos.width;\n }", "function drawHorizontalRule(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\tvar stat = getState(cm);\n\t\t\tvar options = editor.options;\n\t\t\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n\t\t}", "function generateControlBar() {\n var result = doc.createElement(\"table\");\n result.setAttribute(\"class\", \"toolbar\");\n\n var tr = doc.createElement(\"tr\");\n \n/* @@ Add in later -- not debugged yet \n var sparqlButtonDiv = doc.createElement(\"td\");\n sparqlButtonDiv.appendChild(generateSparqlButton());\n tr.appendChild(sparqlButtonDiv);\n*/\n typeSelectorDiv = doc.createElement(\"td\");\n tr.appendChild(typeSelectorDiv);\n\n addColumnDiv = doc.createElement(\"td\");\n tr.appendChild(addColumnDiv);\n\n result.appendChild(tr);\n\n return result;\n }", "drawAxes() {\n this.drawLabels([\n { label: LightTypes.A, column: 9 },\n { label: LightTypes.B, column: 10 },\n ])\n\n let colLabels = new Array(8).fill(null).map((_, i) => ({ label: `${i + 1}`, column: i }))\n this.drawLabels(colLabels)\n\n this.ctx.beginPath()\n this.ctx.strokeStyle = \"black\"\n this.ctx.moveTo(0, this.maxDrawH * 1.01)\n this.ctx.lineTo(this.w, this.maxDrawH * 1.01)\n this.ctx.moveTo(8 * this.barColumnW + this.barColumnW / 2, this.h)\n this.ctx.lineTo(8 * this.barColumnW + this.barColumnW / 2, 0)\n this.ctx.stroke()\n }", "render() {\n const rootClasses = {\n 'indeterminate': this.indeterminate,\n 'animation-ready': this.animationReady,\n 'four-color': this.fourColor\n };\n const progressStyles = {\n transform: `scaleX(${(this.indeterminate ? 1 : this.progress) * 100}%)`\n };\n const bufferStyles = {\n transform: `scaleX(${(this.indeterminate ? 1 : this.buffer) * 100}%)`\n };\n // Needed for closure conformance\n const { ariaLabel } = this;\n return html `\n <div\n role=\"progressbar\"\n class=\"linear-progress ${classMap(rootClasses)}\"\n aria-label=\"${ariaLabel || nothing}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"1\"\n aria-valuenow=\"${this.indeterminate ? nothing : this.progress}\">\n <div class=\"track\"></div>\n <div class=\"buffer-bar\" style=${styleMap(bufferStyles)}></div>\n <div class=\"bar primary-bar\" style=${styleMap(progressStyles)}>\n <div class=\"bar-inner\"></div>\n </div>\n <div class=\"bar secondary-bar\">\n <div class=\"bar-inner\"></div>\n </div>\n </div>`;\n }", "get horizontalLineStroke() {\r\n return brushToString(this.i.pb);\r\n }", "function buildHambar() {\n currentEndpoint = getCurrentEndpoint();\n\n const hambar = document.getElementById(\"hambar\");\n const content = document.createElement(\"div\");\n content.classList.add(\"content\");\n hambar.appendChild(content);\n\n const items = document.createElement(\"div\");\n items.classList.add(\"hambar-items\");\n content.appendChild(items);\n\n pages.forEach((page) => addLinkToElement(page, items));\n}", "function drawHorizontalRule(editor) {\n\t\tvar cm = editor.codemirror;\n\t\tvar stat = getState(cm);\n\t\tvar options = editor.options;\n\t\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n\t}", "render( props ) {\n\t\t// FIXME: This line seems redundant. Please document if there's a reason behind this.\n\t\tprops[\"use_percentages\"] = (props.use_percentages && (props.use_percentages == true));\n\n\t\tlet {labels, values, use_percentages, hideLegend} = props;\n\t\tif ( !((labels || hideLegend) && values) ) {\n\t\t\tconsole.warn(\"BarChart was created with invalid props\", props);\n\t\t\treturn <div>No Data!</div>;\n\t\t}\n\n\t\tconst padTop = 0;\n\t\tconst padBottom = 0;\n\t\tconst padLeft = 0;\n\t\tconst padRight = 0;\n\n\t\tlet minYZeroPos = 0;\n\t\tlet xZeroPos = 0;\n\t\tconst xAxisHeight = props.xAxisHeight ? props.xAxisHeight : AXIS_RESERVATION;\n\t\tconst yAxisWidth = props.yAxisWidth ? props.yAxisWidth : AXIS_RESERVATION;\n\n\t\tlet firstBarXStart = 0;\n\t\tif ( props.showXAxis ) {\n\t\t\tminYZeroPos = xAxisHeight;\n\t\t}\n\t\tif ( props.showYAxis ) {\n\t\t\txZeroPos = yAxisWidth;\n\t\t\tfirstBarXStart = 0.2;\n\t\t}\n\t\tconst xMaxValue = firstBarXStart + values.length;\n\n\t\tconst {valuesYPos, yZeroPos, yOnePos} = this.scaleValues(values, minYZeroPos, padBottom, 100 - padTop);\n\n\t\tlet ShowXAxis = null;\n\t\tif ( props.showXAxis ) {\n\t\t\tShowXAxis = <XAxis padLeft={padLeft} padRight={padRight} height={xAxisHeight} yZeroPos={yZeroPos} />;\n\t\t}\n\t\tlet ShowYAxis = null;\n\t\tif ( props.showYAxis ) {\n\t\t\tShowYAxis = <YAxis yZeroPos={yZeroPos} yOnePos={yOnePos} xZeroPos={xZeroPos} padTop={padTop} padBottom={padBottom} width={yAxisWidth} showTicks={props.showYTicks} />;\n\t\t}\n\n\t\tlet barWidth = this.scale(1, xMaxValue, xZeroPos, 100 - padRight) - xZeroPos;\n\n\t\tlet total = values.reduce((a, b) => (a + b), 0);\n\t\tlet percentages = values.map((x) => (Math.round((100 * (x / total)) * 100) / 100));\n\n\t\tlet Bars = [];\n\t\tlet Names = [];\n\t\tlet Colors = [];\n\n\t\tlet ShowLegend = null;\n\t\tfor ( let i = 0; i < values.length; i++ ) {\n\t\t\t// FIXME: This doesn't seem to do anything.\n\t\t\tif ( (valuesYPos[i] == yZeroPos) || isNaN(valuesYPos[i]) ) {\n\t\t\t\t//continue;\n\t\t\t}\n\n\t\t\tlet color = 1 + (i % 6);\n\t\t\tBars.push(<Bar valuePos={valuesYPos[i]} zero={yZeroPos} width={barWidth} left={this.scale(firstBarXStart + i, xMaxValue, xZeroPos, 100)} index={i} color={color} />);\n\n\t\t\tif ( !hideLegend ) {\n\t\t\t\tif ( use_percentages ) {\n\t\t\t\t\tNames.push(labels[i] +\" (\" + values[i] + \" : \" + percentages[i] + \"%)\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tNames.push(labels[i] +\" (\" + values[i] + \")\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tColors.push(color);\n\t\t}\n\t\tif ( !hideLegend ) {\n\t\t\tShowLegend = <Legend names={Names} colors={Colors} />;\n\t\t}\n\n\t\treturn (\n\t\t\t<div class=\"chart\">\n\t\t\t\t<div class=\"-bar\">\n\t\t\t\t\t<svg class=\"-svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\n\t\t\t\t\t\t<g transform=\"translate(0,100) scale(1,-1)\">\n\t\t\t\t\t\t\t{Bars}\n\t\t\t\t\t\t\t{ShowYAxis}\n\t\t\t\t\t\t\t{ShowXAxis}\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t{ShowLegend}\n\t\t\t</div>\n\t\t);\n\t}", "withHorizontalOrientation(direction) {\n this._horizontal = direction;\n return this;\n }", "function HealthBar(width, height, owner, offsetX, offsetY) {\n if (offsetX === void 0) { offsetX = 0; }\n if (offsetY === void 0) { offsetY = -50; }\n this._size = undefined;\n this._offset = undefined;\n this._centerOffset = new vector2D_2.default(0, 0);\n this._progressOffset = new vector2D_2.default(0, 0);\n /**\n * Whether or not the HitpointBar is visible.\n */\n this.visible = true;\n /**\n * Whether or not the HitPointBar should be horizontally centered relative to the owner's position.\n */\n this.center = true;\n this._size = new size_3.default(width, height);\n this._offset = new vector2D_2.default(offsetX, offsetY);\n this._owner = owner;\n this.base = new healthBarElement_1.HealthBarBase(color_11.default.white, color_11.default.white, 1, this);\n this.progress = new healthBarElement_1.HealthBarProgress(color_11.default.black, color_11.default.black, 0, this);\n this.base.transparency = 0.2;\n this.progress.transparency = 0.5;\n }", "function createBarChart(data, h, w) {\n\tconst svg = createSvg(h, w);\n\n\tconst yScale = d3.scaleLinear()\n\t\t\t\t\t\t\t\t\t .domain([0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\td3.max(data, function(d) { return d[1] })])\n\t\t\t\t\t\t\t\t\t .range([0, h]);\n\n\tconst padding = 1;\n\tconst barWidth = 4;\n\n\t//add rectangles\n\tsvg.selectAll(\"rect\")\n\t .data(data)\n\t .enter()\n\t .append(\"rect\")\n\t\t .attr(\"x\", function(d,i) { return i * barWidth})\n\t\t .attr(\"y\", function(d, i) { return h - yScale(d[1])})\n\t\t .attr(\"width\", barWidth - padding)\n\t\t .attr(\"height\", function(d, i) { return yScale(d[1]) })\n\t\t .attr(\"class\", \"bar\");\n\n}", "healthBar() {\n noFill();\n strokeWeight(2);\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth, this.healthBarHeight, 10, 10);\n\n if (this.health <= 100 && this.health >= 60) {\n fill(0, 255, 0);\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n\n }\n else if (this.health < 90 && this.health >= 30) {\n\n fill(\"yellow\");\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n }\n else if (this.health < 60 && this.health > 0) {\n fill(\"red\");\n rect(this.x * this.width, this.y * this.height - 20, this.healthBarWidth - this.healthDisplay, this.healthBarHeight, 10, 10);\n }\n }", "function updateHorizontalLabel() {\n // Get access to nodes/widgets we need to get/set values\n var hSlider = registry.byId(\"hslider\");\n var label = dom.byId(\"decValue\");\n // Update label\n label.innerHTML = hSlider.get(\"value\");\n params.defaultBreaks = [ hSlider.value / 60 ];\n if (clickpoint) {\n mapClickHandler(clickpoint);\n }\n }", "function drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}", "function drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}", "function drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}", "function drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}", "function updatebar(){\r\n \tif (width > 168){\r\n \t\tif (width < 220){\r\n \t\t\ttakeoff = 21\r\n \t\t\twidth = width - takeoff\r\n }else if (width < 350){\r\n takeoff = 42\r\n width = width - takeoff\r\n }else if (width < 400){\r\n \ttakeoff = 80\r\n \twidth = width - takeoff\r\n }else if (width < 500){\r\n \ttakeoff = 140\r\n \twidth = width - takeoff\r\n \r\n }\r\n document.getElementById('barcum').style.width = width + 'px'\r\n \t}else if (width < 168){\r\n \t\twidth = 168\r\n \t\tdocument.getElementById('barcum').style.width = width + 'px'\r\n \t\r\n\r\n }}", "function renderTopBar(ctx){\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, g_canvas.width, 25);\n\n ctx.fillStyle = \"white\";\n ctx.font = \"bold 15px Arial\";\n ctx.fillText(\"Score: \" + g_score, 5, 15);\n ctx.fillText(\"Lives: \" + g_lives, g_canvas.width - 65, 15);\n}", "function cypherTokenDrawAttributeBars() {\r\n const bars = new PIXI.Container();\r\n bars.bar1 = bars.addChild(new PIXI.Graphics());\r\n bars.bar2 = bars.addChild(new PIXI.Graphics());\r\n bars.bar3 = bars.addChild(new PIXI.Graphics());\r\n return bars;\r\n}", "function progress_bar(num, max_num, x, y, width, height, main_color, background_color,bar_padding=0){\n //display background of bar\n c.beginPath();\n c.fillStyle = background_color;\n c.rect(x-bar_padding,y-bar_padding,width+bar_padding*2,height+bar_padding*2);\n c.fill();\n\n //calculate how much progress has been made\n let progress = num/max_num;\n let progress_width = progress*width;\n\n //display the progress\n c.beginPath();\n c.fillStyle = main_color;\n c.rect(x,y,progress_width,height);\n c.fill();\n}", "function drawHealthbar() {\n var width = 100;\n var height = 20;\n\n // Draw the background\n context.fillStyle = \"#000000\";\n\n context.fillRect(360, 250, width, height);\n\n // Draw the fill\n context.fillStyle = \"#03a56a\";\n var fillVal = gameobjects[0].health;\n context.fillRect(360, 250, fillVal / 4, height);\n}", "function searchBarLineCreation() {\r\n console.log (\"##f()## searchBarLineCreation function execution\");\r\n try{\r\n let horizontalBarPrevious = document.getElementById('horizontal-bar');\r\n if (!horizontalBarPrevious) {\r\n let horizontalBar = document.createElement('hr');\r\n horizontalBar.id = 'horizontal-bar';\r\n horizontalBar.classList.add('horizontal-bar');\r\n let searchPhrase = document.getElementById('search-phrase');\r\n searchPhrase.after(horizontalBar);\r\n }\r\n console.log (\"Number of previous horizontal bars: \"+horizontalBarPrevious);\r\n } catch (error) {\r\n console.log(\"Previous horizontal bars don´t exist\");\r\n }\r\n}", "function HealthBarElement(fillStyle, strokeStyle, lineWidth, parent) {\n this._transparency = 1.0;\n this.rectangle = new rectangle_2.default(0, 0, 0, 0);\n this.rectangle.origin = rectangle_2.RectangleOrigin.TopLeft;\n this.rectangle.fillStyle = fillStyle;\n this.rectangle.strokeStyle = strokeStyle;\n this.rectangle.lineWidth = lineWidth;\n this._parent = parent;\n }", "function barUtil () {\n\n var decorate = noop,\n barWidth = fractionalBarWidth(0.75),\n orient = 'vertical',\n pathGenerator = bar();\n\n var base = xyBase().xValue(function (d, i) {\n return orient === 'vertical' ? d.x : d.y;\n }).yValue(function (d, i) {\n return orient === 'vertical' ? d.y : d.x;\n });\n\n var dataJoin$$ = dataJoin().selector('g.bar').element('g');\n\n function containerTranslation(d, i) {\n if (orient === 'vertical') {\n return 'translate(' + base.x1(d, i) + ', ' + base.y0(d, i) + ')';\n } else {\n return 'translate(' + base.x0(d, i) + ', ' + base.y1(d, i) + ')';\n }\n }\n\n function barHeight(d, i) {\n if (orient === 'vertical') {\n return base.y1(d, i) - base.y0(d, i);\n } else {\n return base.x1(d, i) - base.x0(d, i);\n }\n }\n\n function valueAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.height;\n } else {\n return generator.width;\n }\n }\n\n function crossAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.width;\n } else {\n return generator.height;\n }\n }\n\n function crossAxisValueFunction() {\n return orient === 'vertical' ? base.x : base.y;\n }\n\n var bar$$ = function bar$$(selection) {\n selection.each(function (data, index) {\n\n if (orient !== 'vertical' && orient !== 'horizontal') {\n throw new Error('The bar series does not support an orientation of ' + orient);\n }\n\n dataJoin$$.attr('class', 'bar ' + orient);\n\n var filteredData = data.filter(base.defined);\n\n pathGenerator.x(0).y(0).width(0).height(0);\n\n if (orient === 'vertical') {\n pathGenerator.verticalAlign('top');\n } else {\n pathGenerator.horizontalAlign('right');\n }\n\n // set the width of the bars\n var width = barWidth(filteredData.map(crossAxisValueFunction()));\n crossAxisDimension(pathGenerator)(width);\n\n var g = dataJoin$$(this, filteredData);\n\n // within the enter selection the pathGenerator creates a zero\n // height bar. As a result, when used with a transition the bar grows\n // from y0 to y1 (y)\n g.enter().attr('transform', containerTranslation).append('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n // set the bar to its correct height\n valueAxisDimension(pathGenerator)(barHeight);\n\n g.attr('transform', containerTranslation).select('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n decorate(g, filteredData, index);\n });\n };\n\n bar$$.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return bar$$;\n };\n bar$$.barWidth = function (x) {\n if (!arguments.length) {\n return barWidth;\n }\n barWidth = d3.functor(x);\n return bar$$;\n };\n bar$$.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return bar$$;\n };\n\n d3.rebind(bar$$, base, 'xScale', 'xValue', 'x1Value', 'x0Value', 'yScale', 'yValue', 'y1Value', 'y0Value');\n d3.rebind(bar$$, dataJoin$$, 'key');\n\n return bar$$;\n }", "function barShow(){\n let barX = bgLeft + 800;\n fill(127);\n noStroke();\n rectMode(CORNER);\n\n for(let i = 0; i < 9; i++){\n rect(barX, bar.y, bar.sizeX, bar.sizeY);\n barTouch(barX,bar.sizeY,bar.y);\n barX += 600;\n\n }\n if(bar.sizeY <= bottom && bar.sizeY > cieling){\n shouldGrow();\n }\n\n else if(bar.sizeY <= cieling && bar.sizeY < bottom){\n shouldShrink();\n }\n else if(bar.sizeY == 0){\n cieling = -496;\n }\n}", "function HorizontalMenuView(options) {\n\toptions.cursor\t= options.cursor || 'hide';\n\n\tif(!_.isNumber(options.itemSpacing)) {\n\t\toptions.itemSpacing = 1;\n\t}\n\n\tMenuView.call(this, options);\n\n\tthis.dimens.height = 1;\t//\talways the case\n\n\tvar self = this;\n\n\tthis.getSpacer = function() {\n\t\treturn new Array(self.itemSpacing + 1).join(' ');\n\t};\n\n\tthis.performAutoScale = function() {\n\t\tif(self.autoScale.width) {\n\t\t\tvar spacer\t= self.getSpacer();\n\t\t\tvar width\t= self.items.join(spacer).length + (spacer.length * 2);\n\t\t\tassert(width <= self.client.term.termWidth - self.position.col);\n\t\t\tself.dimens.width = width;\n\t\t}\n\t};\n\n\tthis.performAutoScale();\n\n\tthis.cachePositions = function() {\n\t\tif(this.positionCacheExpired) {\n\t\t\tvar col\t\t= self.position.col;\n\t\t\tvar spacer\t= self.getSpacer();\n\n\t\t\tfor(var i = 0; i < self.items.length; ++i) {\n\t\t\t\tself.items[i].col = col;\n\t\t\t\tcol += spacer.length + self.items[i].text.length + spacer.length;\n\t\t\t}\n\t\t}\n\n\t\tthis.positionCacheExpired = false;\n\t};\n\n\tthis.drawItem = function(index) {\n\t\tassert(!this.positionCacheExpired);\n\n\t\tvar item = self.items[index];\n\t\tif(!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar text = strUtil.stylizeString(\n\t\t\titem.text, \n\t\t\tthis.hasFocus && item.focused ? self.focusTextStyle : self.textStyle);\n\n\t\tvar drawWidth = text.length + self.getSpacer().length * 2;\t//\t* 2 = sides\n\n\t\tself.client.term.write(\n\t\t\tansi.goto(self.position.row, item.col) +\n\t\t\t(index === self.focusedItemIndex ? self.getFocusSGR() : self.getSGR()) +\n\t\t\tstrUtil.pad(text, drawWidth, self.fillChar, 'center')\n\t\t\t);\n\t};\n}", "function initialisedBars(){\n for(let bar of progressBars){\n bar.style.width = 0 + \"%\";\n }\n}", "function bar(d) {\r\n\t\t var bar = svg.insert(\"svg:g\", \".y.barHierAxis\")\r\n\t\t .attr(\"class\", \"enter\")\r\n\t\t .attr(\"transform\",function(){if($.browser.msie){\t\t \t \t\t\t\t\t\t\t\t\t\r\n\t\t \t \t\t\t\t\t\t\t\tif(d.children.length * y*1.6 < h){\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-10,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t \t \t\t\t\t\t\t\t\telse{\r\n\t\t \t \t\t\t\t\t\t\t\t\t//show scroll, need re-adjust the position in IE9\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-2,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t else{\r\n\t\t\t\t\t\t\t\t\t\t\t return \"translate(0,5)\"; \r\n\t\t\t\t\t\t\t\t\t\t }})\r\n\t\t .selectAll(\"g\")\r\n\t\t .data(d.children)\r\n\t\t .enter().append(\"svg:g\")\r\n\t\t .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\t\t \r\n\t\t .on(\"click\", showDetail);\r\n\t\r\n\t\t bar.append(\"svg:text\")\r\n\t\t .attr(\"x\", -6)\r\n\t\t .attr(\"y\", y/2+1)\r\n\t\t .attr(\"dy\", \".35em\")\r\n\t\t .attr(\"text-anchor\", \"end\")\r\n\t\t .text(function(d) { \r\n\t\t \t \t /*for current font size and the whole txt width, the max character number is 20*/\r\n\t\t\t \t if(d.Name.length > 20){\r\n\t\t\t \t\t return d.Name.substr(0,18) + \"...\";\r\n\t\t\t \t }\r\n\t\t\t \t else{\r\n\t\t\t \t\t return d.Name; \r\n\t\t\t \t }\r\n\t\t \t\t});\r\n\t\r\n\t\t bar.append(\"svg:rect\")\r\n\t\t .attr(\"width\", function(d) { return x(value(d)); })\r\n\t\t .style(\"fill\", function(d) { return rs.view.getColorByVariancePercentage(d.VariancePercentage,d.Total); })\r\n\t\t .attr(\"height\", y);\r\n\r\n\t\t \t\r\n\t\t return bar;\r\n\t\t}", "makeBar(groups){\n \n let props = {\n x: this.xScale(groups.data[this.props.xName]),\n y: this.yScale(groups[1]),\n height: this.yScale(groups[0]) - this.yScale(groups[1]),\n width: 50 + 'px',\n key: (\"histogram-bar-\"+ Math.random()),\n }\n\n return(\n <Bars {...props}/>\n )\n }", "render() {\n\t\treturn (\n\t\t <div>\n\t\t\t<Line percent={this.state.progressPercent} strokeWidth=\"20\" strokeColor=\"#38bcd5\" />\n\t\t </div>\n\t\t);\n\t}", "render() {\n const style = {\n height: this.divHeight, // Takes up this much space on the screen\n overflowY: \"scroll\" // The rest of the chart can be seen by scrolling\n };\n return <div id={\"bar\" + this.props.id} className={this.barClass} style={style} />;\n }", "function drawHorizontalRule(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n _replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n}", "function updateSinglePlayerHealthBar(currTurn){\n\n var HEALTH_BAR_X = GAME_WIDTH + 10;\n var HEALTH_BAR_Y = 100;\n var HEALTH_BAR_HEIGHT = 20;\n //Calculate the width of the bar as a percentage of the player's current health\n var healthBarWidth = calcHealthBarWidth(currTurn, statScreen.SinglePlayer.PlayerIndex);\n //redraw the health bar\n singleGraphics.beginFill(HEALTH_BAR_COLOR);\n statScreen.SinglePlayer.HealthBar.Bar = singleGraphics.drawRect(\n HEALTH_BAR_X, \n HEALTH_BAR_Y, \n healthBarWidth, \n HEALTH_BAR_HEIGHT);\n singleGraphics.endFill();\n}", "_isHorizontal() {\n return this.orientation === 'horizontal';\n }", "function horizon() {\n var hrz = context.horizon();\n\n if (type === 'm') {\n return hrz.extent([0, 2])\n .colors(['black', 'black', 'teal', '#dd1144']);\n } else if (type === 'v') {\n return hrz;\n }\n }", "function drawHorizontalRule(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n _replaceSelection(cm, stat.image, insertTexts.horizontalRule);\n}", "static drawBar(x, width, value, fill) {\n let barY = Canvas.height - value;\n if (fill) {\n // fillRect(leftUP.X, Y, RectWidth, RectHeight)\n Canvas.ctx.fillRect(x, barY, width, value);\n } else {\n Canvas.ctx.strokeRect(x, barY, width, value);\n }\n }", "function drawCypherBar(number, bar, data) {\r\n const val = Number(data.value);\r\n const pct = Math.clamped(val, 0, data.max) / data.max;\r\n let h = Math.max((canvas.dimensions.size / 12), 8);\r\n if (this.data.height >= 2) h *= 1.6; // Enlarge the bar for large tokens\r\n\r\n // Stacked bars, all atop one another\r\n let yPositions = {\r\n 0: this.h - (3 * h),\r\n 1: this.h - (2 * h),\r\n 2: this.h - h\r\n };\r\n\r\n // Let's do at least one good thing by making these colors configurable\r\n let colors = {\r\n 0: NUMENERA.attributeColors[0],\r\n 1: NUMENERA.attributeColors[1],\r\n 2: NUMENERA.attributeColors[2]\r\n }\r\n\r\n let color = colors[number];\r\n\r\n bar.clear()\r\n .beginFill(0x000000, 0.5)\r\n .lineStyle(2, 0x000000, 0.9)\r\n .drawRoundedRect(0, 0, this.w, h, 3)\r\n .beginFill(color, 0.8)\r\n .lineStyle(1, 0x000000, 0.8)\r\n .drawRoundedRect(1, 1, pct * (this.w - 2), h - 2, 2);\r\n\r\n // Set position\r\n let posY = yPositions[number];\r\n bar.position.set(0, posY);\r\n}", "generateHor(h,w)\n\t{\n\t\tfor(var y = 0; y < h ; y++)\n\t\t{\n\t\t\tfor(var x = 0; x < w-1 ; x++)\n\t\t\t{\n\t\t\t\tvar a = new Dot(x,y);\n\t\t\t\tvar b = new Dot(x+1,y);\n\t\t\t\tvar l = new Line(a,b);\n\t\t\t\tthis.lines.set(l.toString(), l);\n\t\t\t}\n\t\t}\n\t}", "drawBar(lineI, startChar, endChar, barColor, extraStart=0, extraEnd=0){\n let offsetX = 0;\n if(this.centered){ // Centers text within box's width\n offsetX = (CHAR_WIDTH/2)*(this.lineW - (endChar - startChar));\n }\n ctx.fillStyle = barColor;\n ctx.fillRect(\n this.x+CHAR_GAP + offsetX + startChar*CHAR_WIDTH - extraStart,\n this.y + lineI*LINE_HEIGHT + 2*CHAR_GAP - Math.floor(CHAR_GAP/2)\n + this.offsetY,\n (endChar-startChar)*CHAR_WIDTH + extraStart+extraEnd,\n LINE_HEIGHT\n );\n }", "function generatebars(num = 50) {\n \n for (let i = 0; i < num; i += 1) {\n \n const value = Math.floor(Math.random() * 1000) + 1; \n const bar = document.createElement(\"div\");\n \n bar.classList.add(\"bar\");\n bar.style.height = `${value/3}px`;\n bar.style.transform = `translateX(${i * 20}px)`;\n const barLabel = document.createElement(\"label\");\n barLabel.classList.add(\"bar_id\");\n barLabel.innerHTML = value;\n barLabel.style.display = \"none\";\n bar.appendChild(barLabel);\n container.appendChild(bar);\n }\n}", "withHorizontalOrientation(direction) {\n this._horizontal = direction;\n return this;\n }", "withHorizontalOrientation(direction) {\n this._horizontal = direction;\n return this;\n }", "withHorizontalOrientation(direction) {\n this._horizontal = direction;\n return this;\n }", "horizontal_wall(start_col, end_col, top_row, bot_row, val) {\n this.set_horizontal_wall(start_col, end_col, top_row, bot_row, val);\n this.draw_horizontal_wall(start_col, end_col, top_row, bot_row, val);\n }", "renderer({ value, cellElement }) {\n value = value || 0;\n\n if (!cellElement.percentBarElement) {\n cellElement.percentBarElement = DomHelper.createElement(\n {\n tag: 'div',\n className: 'b-percent-bar-outer',\n parent: cellElement,\n children: [\n {\n tag: 'div',\n className: 'b-percent-bar',\n html: '%'\n }\n ]\n },\n true\n )[1];\n }\n\n const { percentBarElement } = cellElement;\n\n percentBarElement.classList[value === 0 ? 'add' : 'remove']('b-zero');\n\n percentBarElement.classList[value < this.lowThreshold ? 'add' : 'remove']('b-low');\n\n percentBarElement.style.width = value + '%';\n percentBarElement.firstChild.data = value + '%';\n }" ]
[ "0.688223", "0.67351127", "0.66020066", "0.62778544", "0.62000453", "0.61316174", "0.6121383", "0.6013297", "0.6010947", "0.59679705", "0.57191104", "0.5707842", "0.5706709", "0.56823784", "0.56585217", "0.5635633", "0.5634586", "0.5632011", "0.56319195", "0.56319195", "0.56285316", "0.5614892", "0.5611765", "0.55945146", "0.5592893", "0.5586427", "0.5578292", "0.5551768", "0.5508761", "0.55058783", "0.54846746", "0.5458456", "0.54551405", "0.5443506", "0.5443339", "0.54309726", "0.5429377", "0.5423608", "0.54189205", "0.5414143", "0.54035246", "0.54020584", "0.54004043", "0.5364842", "0.5359842", "0.5358672", "0.53424937", "0.531463", "0.5312547", "0.5302395", "0.5285934", "0.5272117", "0.5257237", "0.5248619", "0.5244436", "0.5241131", "0.52371246", "0.52339154", "0.5230806", "0.5218758", "0.5210865", "0.5204978", "0.5203369", "0.51977086", "0.5193173", "0.5192244", "0.5192244", "0.5192244", "0.5192244", "0.51887393", "0.5185548", "0.5182962", "0.5180877", "0.5180774", "0.51806754", "0.51721233", "0.51710063", "0.5169653", "0.5159506", "0.5157513", "0.51547694", "0.5151471", "0.51509994", "0.51479965", "0.51459783", "0.51445234", "0.5143579", "0.51432496", "0.5141093", "0.5140704", "0.5132149", "0.513169", "0.5130498", "0.51291776", "0.5121243", "0.5121243", "0.5121243", "0.5117286", "0.5108792" ]
0.546268
32
first message for Supervisor
function welcome() { inquirer.prompt([ { name: "action", type: "list", choices: ["View Product Sales By Department", "Create New Department", "Exit"], message: "Please select one of the following options:" }, ]).then(function(response) { if (response.action === "View Product Sales By Department") { viewSales(); } else if (response.action === "Create New Department") { createDepartment(); } else if (response.action === "Exit") { exit(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get firstNewMessage()\n\t{\n\t\treturn true;\n\t}", "function start(msg) {\n return { target: msg.chat.id, message: START_MESSAGE };\n}", "function first () {\n if (!called) {\n called = true;\n const args = Array.from(arguments);\n process.nextTick(function () {\n cb.apply(null, args);\n });\n }\n else {\n console.log.apply(console, arguments);\n console.log(' => Suman warning first() called more than once in ' + __filename);\n }\n }", "start() {\n process.on(\"message\", (message) => {\n if (typeof message !== \"object\" || !message.id) {\n return;\n }\n this.emit(message.id, message.data);\n });\n }", "function onFirstConnection () {\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoBroadcast: true,\n\t\t\t\tmessage: \"Welcome @\" + session.username + \", you have joined room #\" + room.id\n\t\t\t});\n\t\t\t// Warn other user that a new user joined the room\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoPrivate: true,\n\t\t\t\tmessage: '@' + session.username + ' has joined!'\n\t\t\t});\n\t\t}", "onMessageStart() { }", "function getFirstMention (msg) {\n let mention = msg.mentions.users.array()\n return mention[0]\n}", "function getStart(sender_psid) {\n let key = ['Player', 'Team'];\n request({\n \"uri\": \"https://graph.facebook.com/v2.6/\" + sender_psid,\n \"qs\" : {\"access_token\": process.env.PAGE_ACCESS_TOKEN, fields: \"first_name\"},\n \"method\": \"GET\",\n \"json\": true,\n }, (err, res, body) => {\n if (err) {\n console.error(\"Unable to send message:\" + err);\n } else {\n let userName = body.first_name;\n\n // Create the payload for a basic text message\n let response = {\n \"text\": `Hi ${userName}, Welcome to our Lets Kick bot. What are you looking for today?`\n }\n sendResponse.quickReply(sender_psid, response, 'START', key);\n }\n })\n}", "function sent() {\n console.info(\"Fine processo d'invio notizie\")\n}", "function showProfileMessage(message, secondMessage = '') {\n console.log(message, this.name, secondMessage);\n}", "function Message() {\n\t/* Status (changed): Unchanged, Added, Removed, Count\n\t\tWe should mark each Hit in the message with what has changed. The count change should be sent with this.\n\t\tThe message will also tell the client whether or not to pop-up the notification.\t*/\n}", "function message() {\n _message.apply(null, messageArgs(arguments));\n }", "function Grades_Start(message){\n\tn(message);\n\tm(\". . .\");\n\tif($.studying_subject!=$.studying_subject_2){\n\t\tGrades_Start_1();\n\t}else{\n\t\tGrades_Start_2();\n\t}\n}", "function msg() {\n if (!check.assigned(message.get('log'))) {\n console.log(arguments[0]);\n return;\n }\n message.get('log').put(arguments[0], arguments[1], __filename.split('/').pop(), arguments.callee.caller.name.toString());\n }", "onMessage( message ) {\n\t\tconsole.log(`Received message from client: ${ message.toString() }`);\n\t}", "async run({ msg, suffix }) {\n\t\t// Do things here!\n\t}", "function start(){\n\tdate = new Date(Date.now()).toLocaleString()\n let message = { 'Message' : i, 'Date' : date}\n\tswitch(process.argv[3]){\t\t\t\t\t\t\t\t//Getting the mode of the stream (Public:1, Private:2, Restricted: 3)\n\t\tcase '1': MAM_public.attach(message);break; \n\t\tcase '2': MAM_private.attach(message);break;\n\t\tcase '3': MAM_restricted.attach(message);break;\n\t\tdefault: MAM_public.attach(message)\n\t}\n\tconsole.log('Start sending data to Tangle...')\n\tlet messageS = JSON.stringify(message)\n\tconsole.log('Message: %s',messageS)\n\tconsole.log('Message in trytes: ' + iota.utils.toTrytes(messageS))\n\tconsole.log('--------------------------------------------------------------------------------------------------------------------')\n\ti++\n}", "sendMessage({ sender, receiver, message }) {\n\t\tconsole.log(`${sender.userName} dice ${message} a ${receiver.userName}`);\n\t}", "async onBegin() {\n\t\tawait this.say('Hello, I am Edison');\n\t\tawait this.say('Ask me anything');\n\t}", "function message (data) {\n let name = data.source.name\n let screenName = data.source.screen_name\n \n // DM user\n\n console.log('Messaged by: ' + name + ' @' + screenName)\n}", "function onSubHandler(target, username, method, message, userstate) {\n client.say(\n target,\n `Buckle up butter cup! @${username}, you're in for a wild ride! Seriously though, thank you for the support! I love you <3`\n );\n}", "function message (msg){\n \n console.log(msg)\n \n for(var i=0;i<msg.length;i++){\n \n if(process.pid == msg[i]['pid']){\n \n if(msg[i]['trabajo'] == Config.valoresWorkers.trabajoAnalizar){\n\t\t\t\t\n\t\t\t\tvar Hawk = require(Utils.dirs().core + 'hawk.js')\n\t\t\t\tnew Hawk()\n\t\t\t\t\n // TODO Cambiar por trabajo Analizar\n console.log('Con este trabajo: ' + msg[i]['trabajo'] + ' tendre que ' + Config.valoresWorkers.trabajoAnalizar)\n \n }else{\n \n\t\t\t\t//var web = require(Utils.dirs().web + 'web.js')\n // TODO Cambiar por el trabajo Web\n console.log('Con este trabajo: ' + msg[i]['trabajo'] + ' tendre que ' + Config.valoresWorkers.trabajoWeb)\n\n\n }\n \n }\n }\n}", "TheMessage(msg) {\n return;\n }", "process (msg) {\n\t\tthrow 'Undefined process function';\n\t}", "onChildMsg(msg){\n \n console.log('> Vino de un children:',msg);\n\n }", "run(msg) {\n\t\tmsg.say(doc_msg.msg);\n\t}", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "handleMessage(message) {\n console.log('lmsDemo2: message received:' + JSON.stringify(message));\n if(message.FromWhom == 'lmsdemo1'){\n this.msgrcvd = message.ValuePass;\n }\n }", "printMessageManualy(message) {\n console.log(`Message: ${message}`);\n }", "function incomingMessage(param) {\r\n\tif (tabs.items.getCount() > 0)\r\n \tcurrentTab = tabs.getActiveTab();\r\n\r\n\tvar startDetails = new Object();\r\n\tstartDetails.userName = param.sender;\r\n delete startDetails;\r\n addMessage(param.sender, param.message, param.sender);\r\n \r\n if (currentTab.id != param.sender) { \r\n \tvar tab = findTab(param.sender);\r\n \tflashTabWithNewMessage(tab,getBgColorUponNewMessage(),getFlashNumOfTimesUponNewMessage());\r\n } \r\n \r\n notifyToolbar(); \r\n}", "function sentMsgConsole(messageChatched) {\n console.log(\"inviato \", messageChatched);\n}", "onInstantMessage(content) {\n //if (!(typeof 'content' === 'string')) return;\n if (this.username == null)\n return;\n if (this.room == null)\n return;\n this.room.broadcastInstantMessage(content, this.username);\n }", "use(who, args) {\n component.setAction( \"message\", this.description() )\n }", "log(message) {\n this.messageService.add(`HeroService: ${message}`);\n }", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function respondSimpleMessage(res, message) {\n res.render('simpleStatus', { \n pageTitle: message,\n status: message,\n bodyID: 'body_simplestatus',\n mainTitle: message\n });\n}", "firstRun() { }", "constructor() {\n super();\n this.message = \"Dynamic Message\";\n }", "sending () {\n }", "function addWelcome(data) {\r\n addMsg(data, \"server\");\r\n}", "function emitBoth(data) {\n //Prevent the dreaded infinite loop\n if (data.flags && data.flags !== {} && data.flags.toCinna) return\n var resolved = (data.msg === 'kipsupervisor') ? false : true\n if (data.msg && (data.msg.trim() === 'kipsupervisor') && data.thread && data.thread.ticket) {\n data.thread.ticket.isOpen = true\n } else if (data.msg && (data.msg.trim() === 'kipsupervisor') && !data.thread.ticket) {\n data.thread.ticket = {}\n data.thread.ticket.id = shortid.generate();\n data.thread.ticket.isOpen = true\n }\n ioClient.emit('new channel', {\n name: data.source.channel,\n id: data.source.id,\n resolved: resolved\n })\n var action = data.action ? data.action : '';\n var flags = (data.flags && data.flags !== {}) ? data.flags : {toSupervisor: true};\n\n ioClient.emit('new message', {\n id: null,\n incoming: true,\n msg: (data.msg ? data.msg : ''),\n tokens: ((data.msg && typeof data.msg == 'string') ? data.msg.split() : []),\n bucket: data.bucket,\n action: action,\n amazon: [],\n source: {\n //chnge to data.source.origin\n origin: data.source.origin,\n channel: data.source.channel,\n org: data.source.id.split('_')[0],\n id: data.source.id\n },\n client_res: [],\n ts: Date.now,\n thread: data.thread,\n urlShorten:data.urlShorten,\n thread: data.thread,\n flags: flags\n })\n}", "function dancing (msg) { console.log(\"We started \" + msg); }", "sendMessage (msg, step) {\n\t\tvar facts = msg.content.getFacts();\n\t\tfor (var i = 0; i < facts.length; i++) {\n\t\t\tvar fact = this.knows(facts[i].trim());\n\t\t\tif (fact == null)\n\t\t\t\tthrow 'Agent: '+ this.id + ': unknown fact: ' + facts[i].trim();\n\t\t}\n\t\tthis.network.addMessage(msg, step, 'w');\n\t}", "entered(welcome) {}", "render() {\n return (\n <div>\n <h4> Message from higher level: {this.props.number} </h4>\n <h4> Welcome {this.props.first} !</h4>\n </div>\n );\n }", "function systemMessage(msg) {\n}", "function stasisStart(event, channel) {\n\n // console.log(util.format('status start ', channel.name));\n \n\n // console.log(util.format('Channel %s just entered application', channel.name));\n \n \n // console.log(util.format( 'Channel %s just entered application ID', channel.id));\n \n //var socketidvar = '';\n //var currentbridge = '';\n \n}", "maybeStartMessage() {\n return this.#output.inMessage ? false : this.startMessage();\n }", "constructor(message) {\n\t\tthis.greeting = message;\n\t}", "function getWelcomeMessage(){\n g.msgNo = 0;\n serverRequest(getParams(\"none\"),false);\n}", "function _startReceive(event) {\n console.log(\"Start: \", event.timestamp);\n\n}", "function message(msg) {\n\n\t\tif(!msg.action || typeof msg.data == 'undefined' || msg.error) {\n\n\t\t\tvar \n\t\t\t\tstack = new Error().stack\n\t\t\t\t, error\n\t\t\t;\n\n\t\t\tif(msg.error && msg.error == \"unknownAction\" && msg.action) {\n\n\t\t\t\terror = util.format(\n\t\t\t\t\t'Unknown monitor action: %s'\n\t\t\t\t\t, msg.action\n\t\t\t\t);\t\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\terror = util.format(\n\t\t\t\t\t'Error from monitor: %s'\n\t\t\t\t\t, msg.error || \"UNKNOWN\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconsole.log(error);\n\t\t\tconsole.log(stack);\n\t\t\treturn;\n\t\t}\n\n\t\tapp.emit(msg.action, msg.data);\n\t}", "function headerMsg(msg) {\n\tconsole.log(\"\\n-- \" + msg +\" --\");\n}", "handleMessage(arg) {\n const message = Message.getFromMessage(arg);\n switch (message.title) {\n case Message.installedMessageLastRoundTitle:\n this.learntHasInstalledUpdate(message);\n break;\n default:\n return message;\n }\n return null;\n }", "function onMessageArrived(message) {\r\n Men2Recv=message.payloadString;\r\n console.log(Men2Recv);\r\n accion(Men2Recv);\r\n}", "function onMessageHandler (target, context, msg, self) {\r\n if ((self)||(!msg.includes(\"!\"))) { return; } // Ignore messages from the bot\r\n\r\n\r\n // Remove whitespace from chat message\r\n const commandName = msg.trim();\r\n\r\n // If the command is known, let's execute it\r\n if (commandName === '!shrimpfact') { \r\n\tconst num = Math.floor(Math.random() * (shrimpFacts.length));\r\n client.say(target, shrimpFacts[num]); \r\n console.log(`* Executed ${commandName} command`);\r\n \r\n }else if (commandName === '!slothfact') { \r\n\tconst num = Math.floor(Math.random() * (slothFacts.length));\r\n client.say(target, slothFacts[num]); \r\n console.log(`* Executed ${commandName} command`);\r\n \r\n }else if(commandName == '!discord'){ \r\n client.say(target, 'Join Slothy\\'s discord https://discord.gg/t2dVj3k');\r\n console.log(`* Executed ${commandName} command`);\r\n console.log(say.getInstalledVoices());\r\n\r\n }else if(commandName == '!test'){ \r\n\t if((context.mod)||(context.badges.broadcaster)){\r\n\t\t client.say(target, 'ShrimpBot is Here!')\r\n\t\t say.speak(\"ShrimpBot is Here!\", voice)\r\n\t }\r\n }else if(commandName == '!commands'){ \r\n\t client.say(target, \"!shrimpfact for shrimp fact || !slothfact for a sloth fact || !discord for the discord invite || cheering at least \"+slothdonationMin+\" bits will have a sloth fact read aloud on stream || cheering at least \"+shrimpdonationMin+\" bits will have a shrimp fact read aloud on stream || cheering at least \"+messagedonationMin+\" bits will have a message read aloud on stream\");\r\n\t\r\n }else {\r\n console.log(`* Unknown command ${commandName}`);\r\n }\r\n}", "info(message) {\n return this.sendMessage(MessageType.Info, message);\n }", "addMessage(message) {\n // this.newMessages.next(message);\n // HACK: REPLACE this SERVICE IT IS DEFUNCT... FOR NOW just bypass\n this.chat.sendMsg(message);\n }", "addNewMessage(username, content, type) {\n let oldName = this.state.currentUser.name;\n if (oldName !== username){\n var check = {\n type : 'postNotification',\n content : `${oldName} changed their name to ${username}`\n }\n // Changes the oldName to the new Username\n oldName = username\n this.connection.send(JSON.stringify(check))\n }\n const message = {\n type,\n id: UUID.v4(),\n username,\n content,\n userColor: this.state.userColor\n };\n this.connection.send(JSON.stringify(message));\n\n }", "function startmsg(result){\n if(result[0] === 0){\n console.log(\"inside start\")\n read(\"Hello I am Floran I am your virtual assistant\")\n messageTemplate(\"Hello I am Floran I am your virtual assistant\",\"left\")\n read(\"What should I call you\")\n messageTemplate(\"What should I call you\",\"left\")\n is_input = true\n console.log(result[1])\n set_mode(result[1])\n }\n else{\n read(\"welcome back\")\n messageTemplate(\"welcome back\",\"left\")\n set_mode(result[1])\n }\n}", "function mensajeBienvenida() {\n console.log(\"Bienvenido a Fabrega!\")\n console.log(\"Ingrese código de artículo a comprar: \")\n console.log(\"0001-Televisor\\n0002-Computadora\\n0003-Heladera\")\n}", "constructor() {\n super();\n this.reply = [\n \"Bonjour, je m'appelle Zion, je serai votre guide tout au long de votre périple. Quel est votre prénom ?\"\n ];\n this.replyCount = 0;\n this.showStartButton();\n }", "function __FIXME_SBean_server_echo() {\n\tthis._pname_ = \"server_echo\";\n\t//this.stamp:\t\tint32\t\n}", "function initMessageSystem() \n{\n\treceiveSystemMessagesText(true); //initiates the first data query\n}", "function getFirstMessage(conversationIdentifier,cb){\n var startMessageIdentifier = conversationIdentifier + ':0';\n getMessagesStartWith(startMessageIdentifier,true,1,SortOrder.ASC,function(data,dataError,mQmlCallbackError){\n messageFilter(data,dataError,mQmlCallbackError,cb);\n });\n}", "sendMsg(msg) {\n this.messages.next(msg);\n }", "function firstPendingMessage(manager) {\n for(var idx in manager.pending) {\n return idx;\n }\n\n manager.pending = [];\n\n return undefined;\n}", "function message() {\n return `Hello! We only serve whirled peas. Generated: ${new Date().toString()}`\n}", "doAction(){\n\t\tconsole.log(this.Message);\n\t}", "messageReceived(message) {\n\t\tMessage.create({\n\t\t\tuser: this.user,\n\t\t\tbody: message\n\t\t}).then((res) => {\n\t\t\tres.user = this.user;\n\t\t\tthis.io.emit('message', res);\n\t\t});\n\t}", "onMsg(message){\n\t\t//Print JSON to console. You may remove this line:\n\t\tconsole.log(message);\n\t\t\n\t\t//Type your code inside the switch cases:\n\t\tswitch (message.status) {\n\t\t\tcase 10:\n\t\t\t\t//Console Output\n\t\t\t\t//Info: The weird characters you probably get are the color indicators. Check the link below to learn how the official client parses them\n\t\t\t\t//https://github.com/mesacarlos/WebConsole/blob/383b0e3420a948a61c7935ff84f40ff159fbd466/client/scripts/WebConsole.js#L128\n\t\t\t\tbreak;\n\t\t\tcase 200:\n\t\t\t\t//LoggedIn\n\t\t\t\tbreak;\n\t\t\tcase 400:\n\t\t\t\t//Unknown Command\n\t\t\t\tbreak;\n\t\t\tcase 401:\n\t\t\t\t//Waiting for login...\n\t\t\t\tbreak;\n\t\t\tcase 1000:\n\t\t\t\t//Connected players info\n\t\t\t\tbreak;\n\t\t\tcase 1001:\n\t\t\t\t//Cpu Usage info\n\t\t\t\tbreak;\n\t\t\tcase 1002:\n\t\t\t\t//RAM Usage info\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log('Unknown server response:');\n\t\t}\n\t}", "speak(line) {\n console.log(`This ${this.type} rabbit says '${line}'`);\n }", "function firstResponse(name) {\n let newChat = {\n //+2 porque es probable que useeffect no me actualice el contador\n id: idCounter + 2,\n emmiter: \"Woman\",\n msg: [\n name +\n \", si estás en una emergencia llamá de inmediato al 911. De lo contrario, elegí una opcion para que podamos ayudarte o asesorarte :)\",\n \"Soy un bot en desarrollo, eso quiere decir que no estoy preparada para preguntas específicas. Lo que no significa que no pueda asesorarte\"\n ]\n };\n //actualizo mi estado de chat\n if (newChat) {\n setChat([...chat, newChat]);\n }\n }", "function showMessage1(message, from) {\n console.log(`${message} by ${from}`);\n}", "function regular(msg) {\n var moj_kljuc;\n var plainMsg;\n const {clients}=ClientStore.getState()\n\n if(clients&&clients[msg.clientID].key)\n {\n moj_kljuc= clients[msg.clientID].key;\n plainMsg= decrypt(msg.content, moj_kljuc)\n msg.content=plainMsg;\n }\n console.log(\"msg\", msg);\n ServerActionCreator.serverNewMsg(msg)\n\n}", "function welcomeMessage(object) {\nvar capName = object.name.charAt(0).toUpperCase() + object.name.slice(1); //capitalizes first chat on object.nam and slices off the extra letter\nreturn \"Welcome\" + \" \" + capName + \"!\"; //returns our welcome name! senence\n}", "function message(incoming){\r\n console.log(incoming);\r\n}", "function setDefault(statMsg) {\n console.log(JSON.stringify(statMsg)); \n}", "function PostShabbatMessage(message){\n console.log(message)\n}", "function dummy_initial_bootstrap() {\n var msg = {\n start_x: 0,\n start_y: 0,\n end_x: 0,\n end_y: 0,\n name: user_id,\n brush_size: 1,\n brush_color: 'white',\n event_type: 'dummy'\n }\n\n sendMsgToServer(msg);\n console.log(\"Sent dummy event for user \" + user_id + \", message \" + JSON.stringify(msg));\n }", "function BaseMessage() {\n\n setuptools.lightbox.build('muledump-about', 'You are on the latest release.<br>');\n\n }", "get message() { return this._message; }", "async function menu(sender_psid, app, first_name){\n try{\n response = {\n \"text\": i18n.__(\"menu.welcome\",{first_name : `${first_name}`}),\n \"quick_replies\":[\n {\n \"content_type\":\"text\",\n \"title\":i18n.__(\"menu.form\"),\n \"payload\":\"FORM\"\n },{\n \"content_type\":\"text\",\n \"title\":i18n.__(\"menu.passport\"),\n \"payload\":\"PASSPORT\"\n },{\n \"content_type\":\"text\",\n \"title\":i18n.__(\"menu.smart_documents\"),\n \"payload\":\"SMART_DOCS2\"\n },{\n \"content_type\":\"text\",\n \"title\":i18n.__(\"menu.notify_me\"),\n \"payload\":\"NOTIFY_ME\"\n }]\n }\n action = null;\n state = await callSendAPI(sender_psid, response, action, app);\n }\n catch(e){\n throw (e);\n }\n return state;\n }", "function welcomeMessage(object) {\n return 'Welcome' + ' ' + object.name.charAt(0).toUpperCase() + object.name.slice(1) + '!';\n}", "send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }", "receiveMessage() {\n\n index = this.currentChat;\n\n const cpuMessage = {\n message: 'ok',\n status: 'received',\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n }\n\n this.contacts[this.currentChat].messages.push(cpuMessage);\n }", "async onmessage(msg)\n\t{\n\t\tif (msg.channel.type == 'dm' && msg.author != this.bot.user)\n\t\t{\n\t\t\tconst tag = `\\x1b[1;36m${msg.author.username}\\x1b[35m#${msg.author.discriminator}`;\n\t\t\tconst string = `${tag} \\x1b[0;1m(\\x1b[0;32m${msg.author.id}\\x1b[0;1m): \\x1b[0m${msg.content}`;\n\t\t\texcd.stdout(string);\n\t\t\t// link to LOG_CONFIG\n\t\t\tconst lc = config.LOG_CONFIG;\n\t\t\tfs.appendFile(`${lc.LOGDIR}/${lc.DM}`, `${excd.time()}${string}\\n`, excd.ifexists);\n\t\t}\n\t\tvar context;\n\t\t// if the message isn't addressed to bot, ignore it\n\t\tif (msg.author.bot || !msg.content.startsWith(config.prefix)) { return excd.cs[0]; }\n\t\t//msg.author.send(`${this.bot.user.id} ${msg.author.id}`);\n\t\tmsg = new Message(this.bot, msg, this, context);\n\t\tif (config.debug && !( basics.exists(msg.guild) && config.debug_guilds.includes(msg.guild.id) ))\n\t\t{ return msg.error.asreply('DEBUG_MODE', context); }\n\t\tthis.manman.msg = msg; // update the ManMan's msg variable\n\t\tconst cmd = msg.cmdexcd;\n\t\tif (!excd.vf(cmd)) return cmd;\n\t\ttry { return (await cmd.value.eval(msg, this, context)); }\n\t\tcatch (err) { return excd.stderr(err); }\n\t}", "function onData(message) {\n if (message.user == username) {\n return;\n }\n console.log(`${message.user}: ${message.text}`);\n}", "function singHandler(relThis, command){\n postMessage(\"You dont want me to do that. Think cats. Digital cats... It's not a pretty picture.\", command.name, command.user_id);\n relThis.res.writeHead(200);\n relThis.res.end();\n}", "function showComingMsg(data) {\r\n addMsg(data, \"someone-else\");\r\n}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "function doFirst(request, response, next)\n{\n\tconsole.log(\"Bacon\"); // Whenever they make a request, they get to see bacon in the terminal\n\tnext(); // if this exists, then it will go to the next object in the stack\n}", "function sayHello(message){\n if(arguments.length == 0){\n console.log(\"default Hello!\");\n return;\n }\n console.log(message);\n}", "onMessage() {}" ]
[ "0.6382236", "0.5776285", "0.57412416", "0.5697925", "0.55882126", "0.5566498", "0.55237067", "0.5498378", "0.54861045", "0.5469194", "0.5408982", "0.5403816", "0.536361", "0.53589743", "0.5344426", "0.53336877", "0.53309566", "0.5318209", "0.53169554", "0.53158736", "0.53091955", "0.5307409", "0.52919674", "0.52711767", "0.52603394", "0.5245681", "0.5238528", "0.5238528", "0.5238528", "0.52264816", "0.5220702", "0.52121997", "0.52110237", "0.52055746", "0.52035147", "0.52017826", "0.5195859", "0.51830703", "0.5180273", "0.5179749", "0.5163091", "0.516271", "0.51590884", "0.51586574", "0.51550955", "0.5143121", "0.5139283", "0.5135078", "0.5128093", "0.5123646", "0.5120153", "0.51152027", "0.5115182", "0.5115159", "0.5113689", "0.51088405", "0.51027894", "0.50907624", "0.50866956", "0.50854653", "0.5081153", "0.50787795", "0.50721264", "0.5071807", "0.5070606", "0.50688434", "0.50675535", "0.5053999", "0.5053607", "0.50495744", "0.5047223", "0.5041841", "0.50384945", "0.5034184", "0.5033432", "0.5027676", "0.5026654", "0.5023869", "0.50185233", "0.5015058", "0.50131726", "0.5012288", "0.5005068", "0.4999538", "0.4996427", "0.4993535", "0.49866736", "0.49854866", "0.4984754", "0.49825493", "0.49790686", "0.49790376", "0.49790096", "0.49790096", "0.49790096", "0.49790096", "0.49790096", "0.49790096", "0.4978853", "0.49784586", "0.49770927" ]
0.0
-1
VIEW PRODUCT SALES BY DEPARTMENT
function viewSales() { var joinQuery = "SELECT department_id, departments.department_name, over_head_costs," + " SUM(product_sales) AS product_sales," + " SUM(product_sales) - over_head_costs AS total_profit "; joinQuery += "FROM departments INNER JOIN products "; joinQuery += "ON departments.department_name = products.department_name "; joinQuery += "GROUP BY department_id "; connection.query(joinQuery, function(error, results) { if (error) throw error; consoleTableProfit("\nDepartmental Profit", results); welcome(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewDeptSales() {\n salesByDept();\n}", "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function displayProductsByDept() {\n // Query department_id, department_name, over_head_costs, product_sales\n // GROUP BY department_id requires SUM of over_head_costs, product_sales, product_sales - over_head_costs\n // Create alias for temporary column total_profit = over_head_costs - product_sales\n connection.query('SELECT department_id, departments.department_name, over_head_costs, SUM(product_sales), SUM(product_sales)-over_head_costs AS total_profit FROM departments LEFT JOIN products ON departments.department_name=products.department_name GROUP BY department_id', function(err, results) {\n if (err) throw err;\n console.log(\n '\\nWelcome to Bamazon Supervisor View' +\n '\\n-Product Sales by Department-' + '\\n'\n );\n\n // Log query results in table\n console.table(results);\n \n // Call to display supervisor view\n viewSupervisor();\n });\n}", "function viewProductByDept(){\n //prints the items for sale and their details\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n // cli-table build\n var table = new Table({\n head: [\"Id\", \"Department\", \"Over-Head\" , \"Sales\", \"Profit\"]\n , colWidths: [5, 20, 10, 10, 10]\n });\n \n //push data to table\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].total_sales).toFixed(2), (res[i].total_sales - res[i].over_head_costs).toFixed(2)]\n )\n }\n // displays table\n console.log(table.toString());\n isThatAll();\n })\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function viewSalesByDept(){\n console.log(\"******************************\");\n console.log(\"* Product Sales By Department*\");\n console.log(\"******************************\");\n\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n \n // empty array to store table contents\n var values = [] ;\n for(var i = 0; i<res.length;i++){\n var resArr = [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].product_sales).toFixed(2), (res[i].product_sales - res[i].over_head_costs).toFixed(2)];\n \n // looping through the data and push the values into the array\n values = values.concat([resArr]);\n }\n \n // console.table performs as we need, first parameter being headers for the table, second parameter being the rows underneath \n console.table(['department_id', 'department_name', 'over_head_costs', 'product_sales', 'total_profit'], values);\n\n // confirm whether or not the user wants to see the options again\n rerun();\n })\n}", "function viewProductsSaleDepartment() {\n console.log(\"======================\")\n console.log(chalk.green(\"View Product Sales by Department\"));\n\n connection.query(\"DROP TABLE bamazon.departments\", function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"CREATE TABLE departments (department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(100) NULL, over_head_costs INT(10) NULL,product_sales INT(10) NULL, PRIMARY KEY(department_id));\",\n function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n for (var i = 0; i < results.length; i++) {\n\n var sale_quantity = results[i].product_sales / results[i].price;\n // console.log(`[${i}] || ${sale_quantity}`);\n var profit = results[i].product_sales * 0.20;\n var overheadcosts = results[i].product_sales - profit;\n // console.log(`[${i}] || ${profit}`);\n\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: results[i].department_name,\n over_head_costs: overheadcosts,\n product_sales: results[i].product_sales\n },\n function (err, res) {\n if (err) throw err;\n // console.log(res.affectedRows + \" product inserted!\\n\");\n\n }\n );\n }\n connection.query(\"SELECT department_name, sum(over_head_costs) as over_head_costs, sum(product_sales) as product_sales FROM Bamazon.departments GROUP BY department_name;\",\n function (err, results) {\n if (err) throw err;\n\n var values = [];\n for (var i = 0; i < results.length; i++) {\n var totalprofit = results[i].product_sales - results[i].over_head_costs;\n // console.log(totalprofit);\n values.push([i + 1, results[i].department_name, results[i].over_head_costs, results[i].product_sales, totalprofit]);\n // console.log([i+1]+\"\\t\"+results[i].department_name + \"\\t\" + results[i].over_head_costs + \"\\t\" + results[i].product_sales + \"\\t\" + totalprofit);\n }\n // console.log(values);\n console.log(\"\\n-------------------------------------------------------------------------\");\n console.table(['ID', 'Department Name', 'Over Head Costs', 'Product Sales', 'Profit'], values);\n\n Start();\n });\n\n console.log(\"===================\");\n // Start();\n });\n\n}", "function viewDepartmentSales() {\n var data = [],\n output,\n config;\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n },\n 3: {\n alignment: 'right'\n },\n 4: {\n alignment: 'right'\n }\n }\n };\n data[0] = [\"Department ID\".cyan, \"Department Name\".cyan, \"Over Head Cost ($)\".cyan, \"Products Sales ($)\".cyan, \"Total Profit ($)\".cyan];\n let queryStr = \"departments AS d INNER JOIN products AS p ON d.department_id=p.department_id GROUP BY department_id\";\n let columns = \"d.department_id, department_name, over_head_costs, SUM(product_sales) AS sales\";\n\n myConnection.readFunction(columns, queryStr, function (res) {\n console.log(\"\\n DEPARTMENTS\".magenta);\n for (let i = 0; i < res.length; i++) {\n let profit = res[i].sales - res[i].over_head_costs;\n data[i + 1] = [res[i].department_id.toString().yellow, res[i].department_name, res[i].over_head_costs.toFixed(2), res[i].sales.toFixed(2), profit.toFixed(2)];\n }\n output = table.table(data, config);\n console.log(output);\n myConnection.goBack(\"Supervisor\", bamazonSupervisor.runBamazonSupervisor);\n });\n}", "function salesByDept() {\n var query =\n 'SELECT departments.department_id, departments.department_name, over_head_costs, SUM(product_sales) AS total_sales, (SUM(product_sales) - over_head_costs) AS total_profit ';\n query +=\n 'FROM departments INNER JOIN products ON (departments.department_name = products.department_name) ';\n query += 'GROUP BY departments.department_name';\n connection.query(query, function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n reset();\n }\n });\n}", "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "function viewSalesbyDept () {\n connection.query(\"SELECT department_name FROM departments\", function(err, res) {\n if (err) throw err;\n\n var departments = [];\n for(i in res) {\n join = `SELECT departments.department_name, departments.over_head_costs, SUM(product_sales) as 'total_sales'\n FROM departments INNER JOIN products \n ON departments.department_name = products.department_name\n WHERE departments.department_name = '${res[i].department_name}'; \n `\n\n connection.query(join, function(err, res2) {\n total_profit = res2[0].total_sales - res2[0].over_head_costs;\n salesInfo = new DepartmentSales(res2[0].department_name, res2[0].over_head_costs, res2[0].total_sales, total_profit);\n departments.push(salesInfo);\n console.table(salesInfo);\n });\n }\n });\n}", "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "function viewSalesByDept(){\n\n connection.query('SELECT * FROM Departments', function(err, res){\n if(err) throw err;\n\n // Table header\n console.log('\\n' + ' ID | Department Name | OverHead Costs | Product Sales | Total Profit');\n console.log('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -')\n \n // Loop through database and show all items\n for(var i = 0; i < res.length; i++){\n\n //=============================== Add table padding ====================================\n var departmentID = res[i].DepartmentID + ''; // convert to string\n departmentID = padText(\" ID \", departmentID);\n\n var departmentName = res[i].DepartmentName + ''; // convert to string\n departmentName = padText(\" Department Name \", departmentName);\n\n // Profit calculation\n var overHeadCost = res[i].OverHeadCosts.toFixed(2);\n var totalSales = res[i].TotalSales.toFixed(2);\n var totalProfit = (parseFloat(totalSales) - parseFloat(overHeadCost)).toFixed(2);\n\n\n // Add $ signs to values\n overHeadCost = '$' + overHeadCost;\n totalSales = '$' + totalSales;\n totalProfit = '$' + totalProfit;\n\n // Padding for table\n overHeadCost = padText(\" OverHead Costs \", overHeadCost);\n totalSales = padText(\" Product Sales \", totalSales);\n \n // =================================================================================================\n\n console.log(departmentID + '|' + departmentName + '|' + overHeadCost + '|' + totalSales + '| ' + totalProfit);\n }\n connection.end();\n });\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function viewDepartmentBudget() {\n console.log(\"Selecting all departments...\\n\");\n connection.query(\"SELECT SUM(salary),department.name FROM role JOIN department ON role.department_id = department.id GROUP BY role.department_id;\", function (err, resDep) {\n if (err) throw err;\n console.table(resDep);\n mainPrompt()\n });\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function showSale(){ \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Product Sales By Department \\x1b[0m`);\n // creating the query string\n var query = 'SELECT D.department_id AS \"DeptID\", D.department_name AS \"Department\", D.over_head_costs AS \"OverHeadCosts\", SUM(P.product_sales) AS \"ProductSales\", '; \n query += 'SUM(P.product_sales) - D.over_head_costs AS \"TotalProfit\" FROM departments D INNER JOIN products P ON D.department_name = P.department_name ';\n query += 'GROUP BY D.department_id';\n\n connection.query(\n query,\n function(err, res){\n if (err) throw err;\n\n console.table(\n res.map(rowData => {\n return{ \n \"Dept ID\": rowData.DeptID,\n \"Department Name\": rowData.Department,\n \"Over Head Costs\": rowData.OverHeadCosts,\n \"Product Sales\": rowData.ProductSales,\n \"Total Profit\": rowData.TotalProfit\n }\n })\n );\n endRepeat();\n }\n );\n}", "function salesByProduct(products, lineItems){\n //TODO\n}", "function displaySales() {\n var sql = \"SELECT departments.department_id AS ID, departments.department_name AS Department, departments.over_head_costs AS 'Overhead Costs', IFNULL(SUM(products.product_sales),0) AS 'Product Sales', \" +\n \"IFNULL(SUM(products.product_sales),0) - departments.over_head_costs AS 'Total Profit' FROM departments \" +\n \"LEFT JOIN products ON departments.department_name = products.department_name \" +\n \"GROUP BY departments.department_name ORDER BY department_id\";\n connection.query(sql, function (error, result) {\n if (error) throw error;\n\n console.log(\"\");\n console.table(result);\n console.log(\"\");\n menu();\n });\n}", "viewAllDept() {\n\t\tconst query = `SELECT *\n\t FROM department;`;\n\t\treturn this.connection.query(query);\n\t}", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "function viewProductSales() {\n // Assign variable to select from the relevant columns and combin product_sales by department\n var query = \"SELECT departments.id, departments.department_name, departments.over_head_costs, SUM(products.product_sales)\";\n // Add to query variable to join 'products' and 'departments' tables by department_name\n query += \"FROM products RIGHT JOIN departments ON products.department_name = departments.department_name \";\n // Add to query variable to group by the 'departments' id and the 'products' department_name\n query += \"GROUP BY departments.id, products.department_name\";\n // Connect to the database using the variable 'query'\n connection.query(query, function (err, res) {\n // Assign a variable to create a new CLI-Table\n var table = new Table({\n head: ['Department ID', 'Department Name', 'Overhead Costs', 'Product Sales', 'Total Profit'],\n colWidths: [20, 30, 20, 20, 20]\n });\n // Check for errors\n if (err) throw err;\n // If no errors...\n // Iterate through the items in the joined tables\n res.forEach(function (row) {\n // Default value of product_sales when column is created in MySQL Workbench is 'null'\n // So if there haven't been any sales yet, change null to 0 to display correctly in CLI-Table\n if (row['SUM(products.product_sales)'] === null) {\n row['SUM(products.product_sales)'] = 0;\n }\n // Assign variable to calculate the total profit - sum of product_sales in each row of 'products' table minus the overhead costs in each row\n var totalProfit = (row['SUM(products.product_sales)'] - row.over_head_costs);\n // Assign variable to display total to 2 decimal places even if the values at those decimal places are 0\n var totalDisplay = totalProfit.toFixed(2);\n // Push the item and department information, as well as the totalProfit calculation, to the new CLI-Table\n table.push([row.id, row.department_name, row.over_head_costs, row['SUM(products.product_sales)'], totalDisplay]);\n\n });\n // Log the table of product sales by department to the 'supervisor'\n console.log(table.toString());\n // Invoke the displaySupervisorOptions function to present user with management action options\n displaySupervisorOptions();\n });\n}", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function productSalesByDept () {\n // The total_profit column is calculated on the fly using the difference between over_head_costs and product_sale\n var query = \"SELECT departments.department_id, departments.department_name, departments.over_head_costs, sum(products.product_sales) AS product_sales, sum(products.product_sales) - departments.over_head_costs AS total_profit \";query += \"FROM departments \";\n query += \"LEFT JOIN products \";\n query += \"ON bamazon_db.products.department_name = bamazon_db.departments.department_name \";\n query += \"GROUP BY bamazon_db.departments.department_name \";\n query += \"ORDER BY department_id\";\n\n connection.query(query, function(err, results) {\n if (err) throw err;\n // When a supervisor selects View Product Sales by Department, displays a summarized table in their terminal/bash window\n console.table(results);\n supervisorMenu();\n })\n \n}", "obtenerTodosProductorPersona() {\n return axios.get(`${API_URL}/v1/productorpersonaReporte/`);\n }", "function viewDept() {\n db.selectAllDepartments()\n .then(([data]) => {\n console.log(`${separator}\\n DEPARTMENTS\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "viewSalary(results) {\n return connection.query(`SELECT ed.dept_name, sum(er.salary) as total_salary\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id\n WHERE ed.id = ?`,\n [results.deptId]\n )\n }", "viewDeptSalarySum(adr) {\n\t\tconst query = `\n\t\tselect department.name,sum(staffrole.salary) as salary_total\n\t\tfrom employee\n\t\tLEFT JOIN staffrole on (employee.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\twhere department.id = ?\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "obtenerProductor(id) {\n return axios.get(`${API_URL}/v1/productorpersonaReporte/${id}`);\n }", "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "function showDepartments() {\n connection.query(\"SELECT d.department_id, d.department_name, d.over_head_costs, SUM(p.product_sales) AS product_sales, SUM(p.product_sales) - d.over_head_costs AS total_profit FROM bamazon.departments AS d LEFT JOIN bamazon.products AS p ON d.department_name = p.department_name GROUP BY d.department_name ORDER BY d.department_id;\", function (err, res) {\n if (err) throw err;\n console.log(\"\\nProduct Sales by Department:\\n\")\n var table = new Table({\n head: ['ID'.cyan, 'Department'.cyan, 'Over Head Costs'.cyan, 'Product Sales'.cyan, 'Total Profit'.cyan]\n , colWidths: [5, 15, 20, 20, 20]\n });\n res.forEach(row => {\n table.push(\n [row.department_id, row.department_name, \"$\" + row.over_head_costs, \"$\" + row.product_sales, \"$\" + row.total_profit],\n );\n });\n console.log(table.toString());\n console.log(\"\\n~~~~~~~~~~~~~~~~~\\n\\n\");\n start();\n });\n}", "function viewDept() {\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "function viewDepartment() {\n const queryDepartment = \"SELECT * FROM department\";\n connection.query(queryDepartment, (err, res) => {\n if (err) throw err;\n console.table(res);\n whatToDo();\n });\n}", "function viewDepartmentsBudget() {\n // console.log(`Selecting all departments...\\n`);\n connection.query(`SELECT d.department_name ,sum(r.salary) FROM employees e LEFT JOIN roles r on e.role_id = r.id JOIN ` + `departments d on d.id=r.departmentId where d.department_name !='None' GROUP BY d.department_name `, (err, res) => {\n if (err) throw err;\n // console.log(res);\n console.table(res);\n\n askeQuestions();\n });\n}", "viewAllDeptSalarySum(adr) {\n\t\tconst query = `\n\t\tselect department.name,sum(staffrole.salary) as total_salary\n\t\tfrom employee\n\t\tLEFT JOIN staffrole on (employee.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\tgroup by department.name\n\t\t`;\n\t\treturn this.connection.query(query, [adr]);\n\t}", "function viewDepartments(){\n // Select all data from the departmenets table\n connection.query(`SELECT * FROM department_table`, (err, res) => {\n // If error log error\n if (err) throw err;\n // Display the data in a table format...\n console.table(res);\n // Run the task completed function\n taskComplete();\n })\n }", "obtenerProductoresFemenino() {\n return axios.get(`${API_URL}/v1/productorpersonaReporteF/`);\n }", "function viewBudget(chosenDepart) {\n\n begin.con.query(\n 'SELECT * FROM role where ?',[{department_id:chosenDepart}], (err, res) => {\n const roleId = res.map(t => t.id)\n const roleSal = res.map(t => t.salary)\n\n viewBudget2(roleId, roleSal)\n }\n\n \n )\n}", "function getTotalProductSales(dept, newOHC) {\n connection.query(\"SELECT SUM(product_sales) AS totalProductSales FROM products WHERE department_name = ?\", [dept], function (err, res) {\n if (err) throw err;\n let totalProductSales;\n for (let i = 0; i < res.length; i++) {\n totalProductSales = res[i].totalProductSales;\n }\n console.log(\"Total product sales for \" + dept + \" is: \" + totalProductSales);\n updateProductSales(dept,newOHC, totalProductSales)\n })\n}", "function viewBudget() {\n connection.query(\n \"SELECT d.name AS 'Department', SUM(r.salary) AS 'Budget' FROM employee e INNER JOIN role r ON r.id = e.role_id INNER JOIN department d ON d.id = r.department_id GROUP BY Department;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (let i = 0; i < res.length; i++) {\n let empObj = [res[i].Department, res[i].Budget];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS & BUDGET UTILIZED \\n ------------------------------------\"\n );\n console.table([\"Department\", \"Budget\"], tableResults);\n actions();\n }\n );\n}", "function viewProducts(){\n console.log(\"\\nView Every Avalailable Product in format:\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"'ItemID-->Product Description-->Department Name-->Price-->Product Quantity'\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item# \" + res[i].item_id + \"-->\" + res[i].product_name \n + \"-->\" + res[i].department_name + \"-->\" + res[i].price \n + \"-->\" + res[i].stock_quantity);\n }\n // console.table(\"\\nProducts Available:\",[\n // res\n // ])\n })\n setTimeout(function() { startManager(); }, 200);\n}", "function viewSales() {\n connection.query(\"SELECT departments.Department_ID,departments.Department_Name,SUM(departments.Over_Head_Costs) AS Total_Costs,SUM(products.Product_Sales) AS Total_Sales,(SUM(products.Product_Sales)-SUM(departments.Over_Head_Costs)) AS Total_Profit FROM departments LEFT JOIN products ON departments.Department_Name = products.Department_Name GROUP BY Department_ID\",\n\n // CREATES TABLE FOR DEPARTMENT SALES //\n function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }\n }); \n\n // SPECIFIES WHERE DATA FROM DATABASE IS PLACED IN TABLE //\n table.push(\n [colors.cyan('Department ID#'), colors.cyan('Department Name'), colors.cyan('Overhead Costs'), colors.cyan('Product Sales'), colors.cyan(\"Total Profit\")]\n );\n\n // ITERATES THROUGH ALL ITEMS AND FILLS TABLE WITH ALL RELEVANT INFORMATION FROM DATABASE //\n for (var i = 0; i < res.length; i++) {\n\n // SETTING UP FUNCTIONS TO PREVENTS DATA BEING DISPLAYED AS NULL //\n let tSales = res[i].Total_Sales;\n let pSales = res[i].Total_Profit;\n \n // VALIDATES TOTAL SALES //\n function validateT (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n // VALIDATES PRODUCT SALES //\n function validateP (amt){\n if (amt === null){\n return 0.00;\n } else return amt;\n }; \n\n table.push(\n [colors.cyan(res[i].Department_ID), res[i].Department_Name, \"$\" + res[i].Total_Costs, '$' + validateT(tSales), \"$\" + validateP(pSales)]\n );\n }\n console.log(table.toString());\n console.log(colors.grey(\"----------------------------------------------------------------------\"));\n \n // PROMPTS WITH SUPERVISOR SELECTION //\n runInquirer();\n })\n}", "function viewProducts () {\n con.query(\"SELECT * from vw_ProductsForSale\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price','Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right','right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n }", "function ProductView(products) {\n this.products = products;\n \n }", "function display() {\n var sql = `SELECT *, p.department_name, d.department_name,\n SUM(product_sales) AS p_sales\n FROM products AS p\n INNER JOIN departments AS d\n ON p.department_name=d.department_name\n GROUP BY d.department_name`;\n var query = connection.query(sql, function(err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\n \"department_id\",\n \"department_name\",\n \"over_head_costs\",\n \"product_sales\",\n \"total_profit\"\n ]\n });\n\n res.forEach(function(e) {\n var overhead = e.over_head_costs;\n var sales = e.p_sales;\n var profit = sales - overhead;\n table.push([e.department_id, e.department_name, overhead, sales, profit]);\n });\n // display the table\n console.log(table.toString());\n displayMenu();\n });\n}", "function departmentView() {\n let query = \"SELECT * FROM department\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n // result is then shown in the console.table\n runMenu();\n });\n}", "function viewDepartmnt() {\n \n connection.query(\" SELECT * FROM department \", function (error, result) \n {\n if (error) throw error;\n console.table(result);\n mainMenu()\n\n });\n\n }", "function totalSales(products, lineItems){\n //TODO\n\n}", "function printProducts(res) {\n console.log(\"\\n\" + \" ID DEPT PRODUCT NAME PRICE STOCK SALES\");\n for (var i = 0; i < res.length; i++) {\n console.log(pad(res[i].item_id, 3) + // 3 chars\n pad(res[i].department_name, 6) + // 6 chars\n pad(res[i].product_name, 46) + // 48 chars\n ' $' + pad(res[i].price, 7) + \" \" + // 9 chars\n pad(res[i].stock_quantity, 5) + \" \" +\n pad(res[i].product_sales, 8)); // 5 chars\n }\n}", "function viewEmpByDept() {\n const sql = `\n SELECT \n employee.id AS EmployeeID, \n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName, \n department.name AS Department \n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id \n LEFT JOIN department \n ON role.department_id = department.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Department `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "viewEmployeesByDepartment() {\n\t\treturn this.connection.query(\n `\n SELECT\n e1.id AS ID,\n e1.first_name AS First_Name,\n e1.last_name AS Last_Name,\n role.title AS Role,\n department.name AS Department,\n CONCAT(e2.first_name, ' ', e2.last_name) AS Manager,\n role.salary AS Salary\n FROM\n employee e1\n LEFT JOIN\n role ON e1.role_id = role.id\n LEFT JOIN\n employee e2 ON e1.manager_id = e2.id\n LEFT JOIN department ON role.department_id = department.id\n ORDER BY\n department.name;\n ` \n\t\t);\n\t}", "function viewDepartments() {\n db.query('SELECT * FROM department', function (err, results) {\n console.table(results);\n goPrompt();\n });\n}", "function viewDept(){\n connection.query(`SELECT name, id FROM department;`, (err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "function somarInventarioDepartamento(departamento) {\n let somaInventario = 0;\n for (p in listaProdutos) {\n if (listaProdutos[p].departamento.nomeDepto == departamento) {\n somaInventario += listaProdutos[p].qtdEstoque * listaProdutos[p].preco\n }\n }\n somaInventario = somaInventario.toLocaleString('pt-BR', {style: 'currency', currency: 'BRL'});\n return {departamento, somaInventario};\n}", "function viewBudget() {\n connection.query(\n \"SELECT name as DeptName, SUM(salary) as DeptBudget FROM roles INNER JOIN department ON roles.department_id = department.deptid GROUP BY name\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "function viewSales() {\n // This was the hardest part of the whole assignment (I know if I say that this query slightly intimidates me with its complexity that whoever is grading this will just laugh to themselves)\n connection.query(\"SELECT id AS ID, name AS Department_Name, over_head_costs AS Overhead_Costs, Product_Sales, (newTable.Product_Sales - departments.over_head_costs) AS Total_Sales FROM departments LEFT JOIN (SELECT sum(product_sales) AS Product_Sales, department_name FROM products GROUP BY department_name) AS newTable ON departments.name = newTable.department_name;\", function (error, results) {\n // Format the table a bit better\n // This is mostly to get better column names and to format dollar amounts\n let formatted = [];\n for (let i = 0; i < results.length; i++) {\n let obj = {\n ID: results[i].ID,\n \"Department Name\": results[i].Department_Name,\n \"Overhead Costs\": parseFloat(results[i].Overhead_Costs).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Product Sales\": parseFloat(results[i].Product_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' }),\n \"Total Sales\": parseFloat(results[i].Total_Sales).toLocaleString('en-US', { style: 'currency', currency: 'USD' })\n };\n formatted.push(obj);\n }\n\n // Display the table\n console.log(\"\\n********************************************\");\n console.table(formatted);\n console.log(\"********************************************\\n\");\n\n // Ask the user again what they would like to do\n start();\n });\n}", "function totalDep(products,dep,price){\n\tvar totalArr = [];\n\t\ttotalArr.push(price);\n\n\tfor(var i = 0;i < products.length;i++){\n\t\tif(products[i].department_name === dep){\n\t\t\ttotalArr.push(products[i].product_sales);\n\t\t}\n\t}\n\n\tvar totalSales = totalArr.reduce(function(a,b){\n\t\treturn a + b;\n\t})\n\tconnection.query(\n\t\t\"update departments set total_sales= ? where department_name = ?\",\n\t\t[totalSales,dep],\n\t\tfunction(err){\n\t\t\tif(err){\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n}", "function viewDepartments() {\n \n let query =\n \"SELECT department.id, department.dept_name FROM department\";\n return connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "function viewDepartmentExpenses() {\n const departments = [];\n connection.query(\n \"SELECT department.name as department FROM department\",\n (err, res) => {\n if (err) throw err;\n res.forEach((department) => {\n departments.push(department.department);\n });\n inquirer\n .prompt({\n type: \"list\",\n message: \"What Departments Budget would you like to view?\",\n name: \"name\",\n choices: departments,\n })\n .then((res) => {\n let department = res.name;\n connection.query(\n \"SELECT SUM(role.salary) as Total FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id WHERE department.name = ?\",\n res.name,\n (err, res) => {\n if (err) throw err;\n console.log(\n `The Total Expenses of The ${department} is $${res[0].Total}`\n );\n baseQuestions();\n }\n );\n });\n }\n );\n}", "function viewProduct() {\n var query =\n 'SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity > 0';\n connection.query(query, function(err, res) {\n console.table(res);\n reset();\n });\n}", "function viewDepartment() {\n const query = `SELECT department FROM department`;\n \n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n \n start();\n });\n \n\n}", "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}", "function viewDept() {\n connection.query(\n `\n SELECT \n department.name AS 'Department'\n FROM department\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "function viewAllDepartmentsBudgets(conn, start) {\n conn.query(`SELECT\td.name Department, \n LPAD(CONCAT('$ ', FORMAT(SUM(r.salary), 0)), 12, ' ') Salary, \n COUNT(e.id) \"Emp Count\"\n FROM\temployee e \n LEFT JOIN role r on r.id = e.role_id\n LEFT JOIN department d on d.id = r.department_id\n WHERE\te.active = true\n GROUP BY d.name\n ORDER BY Salary desc;`, function(err, results) {\n if (err) throw err;\n console.table(results);\n start();\n });\n }", "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function viewAllEmployeesByDepart() {\n const query2 = `select department.id,department.name\n FROM employee INNER JOIN role ON (employee.role_id = role.id) INNER JOIN department ON (department.id = role.department_id) group by department.id,department.name;`;\n connection.query(query2, (err, res) => {\n if (err) throw err;\n const departmentChoices = res.map((data) => ({\n value: data.id, name: data.name,\n }));\n // console.table(res);\n // console.log(departmentChoices);\n promptDepartment(departmentChoices);\n });\n}", "viewDepartments() {\n return connection.query(`SELECT * from department`)\n }", "function viewAllProducts() {\n //connection/callback function\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"All items currently available in marketplace:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n}", "function viewProducts() {\n\tconnection.query('SELECT * FROM Products', function(err, result) {\n\t\tcreateTable(result);\n\t})\n}", "async function productostotales(){\n let productos = await contenedor.getAll()\n res.render('productos.ejs',{productos})\n }", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "function salesByDepartment() {\n // the select request, I know it is very very long ......\n var query = \"SELECT departments.department_id as 'Department ID',departments.department_name as 'Department Name',departments.over_head_costs as 'Over Head Costs', sum(products.product_sales) as 'Total Sales', (sum(products.product_sales) - departments.over_head_costs) AS 'Total Profit' FROM products RIGHT JOIN departments ON products.department_name = departments.department_name GROUP BY departments.department_id\"\n // console.log(query)\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n // display it in table using the console.table module\n console.table(res);\n console.log(\"# 'null' in Total Sales and Total Profit means there isn't any product in this department.\" )\n // end the connection\n connection.end();\n });\n}", "function viewDept() {\n connection.query(\n \"SELECT deptid as DeptId, name as Department, CONCAT(e.first_name, ' ', e.last_name) as Employee, title as Title, salary as Salary, CONCAT(m.first_name, ' ', m.last_name) as Manager FROM department LEFT JOIN roles ON department.deptid = roles.department_id LEFT JOIN employee e ON roles.roleid = e.role_id LEFT JOIN employee m ON m.empid = e.manager_id ORDER BY deptid\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n displayTable(res);\n promptManager();\n });\n}", "function viewAllDepts() {\n console.log(\"Showing all departments...\\n\");\n connection.query(\"SELECT * FROM department \", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"---------------------------------------\" + \n\t\t\t\"\\nItem Id: \" + res[i].item_id + \"\\nProduct: \" + \n\t\t\tres[i].product_name + \"\\nPrice: \" + res[i].price + \n\t\t\t\"\\nQuantity in Stock: \" + res[i].stock_quantity);\n\t\t}\n\t\tstartOver();\n\t});\n}", "obtenerProductoresMasculino() {\n return axios.get(`${API_URL}/v1/productorpersonaReporteM/`);\n }", "function obtenerProductos(req, res) {\n ProductoSucursal.find().populate('sucursal', 'nombreSucursal').exec((err, productosEncontrados) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!productosEncontrados) {\n return res.status(404).send({ ok: false, message: 'Error en la consulta o no existen datos para mostrar.' });\n }\n\n return res.status(200).send({ ok: true, productosEncontrados });\n });\n}", "function viewDepartments() {\n connection.query(\"SELECT * FROM department\", function(err, results) {\n if (err) throw err;\n // show results in table format\n console.table(results);\n // re-prompt the user for further actions by calling \"start\" function\n start();\n });\n}", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function viewDepts(){\n var query = connection.query(\"SELECT Department_ID, Department_Name FROM departments;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n superAsk();\n });\n }", "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "function getAllProductsForSaleByStore() {\n return datacontext.get('Product/GetAllProductsForSaleByStore');\n }", "function viewProducts() {\n connection.query(\"select * from products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(res);\n quit();\n });\n}", "function viewDepartments(){\n connection.query(`SELECT * FROM departments`, function (err, res){\n if (err) throw err\n console.table(res);\n startApp();\n })\n }", "function getDepartments(products) {\n var departments = [];\n for (var i = 0; i < products.length; i++) {\n if (departments.indexOf(products[i].department_name) === -1) {\n departments.push(products[i].department_name);\n }\n }\n return departments;\n}", "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "viewEmployeesByDepartment() {\n console.log(`\n\n * Viewing All Employees by Department *\n `)\n connection.query(`SELECT employees.id, employees.first_name, employees.last_name, roles.title AS role, departments.name AS department FROM employees LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id ORDER BY department DESC;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "function getProductsStore(selectedStoreName) {\n \n // get the data in the active sheet \n var sheet = getOutputSheet(1); \n \n var cell = getOutputFirstCell(1);\n \n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, K, sum(I), max(L) where J='No Vendido' and K='\"+selectedStoreName+\"' group by G, F, H, K\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow() -1, 6).getValues().reduce( \n\t\tfunction(p, c) { \n \n // add the product to the list\n\t\t\tp.push(c); \n\t\t\treturn p; \n\t\t}, []); \n \n return JSON.stringify(products);\n}", "function viewDepartments() {\n connection.query(\"SELECT * FROM department\", function(error, results) {\n if (error) throw error;\n console.table(results);\n start();\n })\n}", "function viewByDept() {\n connection.query(\"SELECT first_name, last_name, department.name FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database by department. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function viewEmpByDept() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY d.name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ----------------------------------- \\n ALL COMPANY EMPLOYEES BY DEPARTMENT \\n -----------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "function viewAllDept() {\n console.log('viewAllDept');\n connection.query('SELECT * FROM department', (err, res) => {\n if (err) throw err;\n console.table(res);\n userSelect()\n })\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "function getDepartmentBudget(answers) {\n return connection.query(`SELECT SUM(Salary) AS dept_budget FROM (${viewCommand}) AS new_table WHERE Department = ?`, answers.department);\n}" ]
[ "0.73143655", "0.6945227", "0.67257595", "0.67063105", "0.6671034", "0.64403594", "0.6351933", "0.63117343", "0.6233876", "0.6195034", "0.61863494", "0.6104656", "0.6087469", "0.6056663", "0.59479785", "0.5918486", "0.5865052", "0.5803506", "0.57875526", "0.5777948", "0.5752586", "0.5717449", "0.57134384", "0.56654024", "0.5645559", "0.5633966", "0.56327224", "0.5630221", "0.5617849", "0.5617172", "0.55950636", "0.55900365", "0.5564996", "0.55576956", "0.5547293", "0.55190957", "0.5518854", "0.55059147", "0.5488577", "0.5459548", "0.54497015", "0.54474884", "0.54447067", "0.5419227", "0.5418807", "0.54126686", "0.540767", "0.5403547", "0.5400805", "0.5395904", "0.5393468", "0.5392014", "0.5384939", "0.5384297", "0.538284", "0.53778136", "0.53675675", "0.5366971", "0.5360733", "0.5359207", "0.53467107", "0.5328109", "0.53223366", "0.5312377", "0.53100055", "0.5301698", "0.5297556", "0.52964145", "0.5286038", "0.52630603", "0.5258295", "0.5248105", "0.5246479", "0.5246011", "0.52448916", "0.5234447", "0.52310205", "0.5224528", "0.52214795", "0.5221258", "0.5218729", "0.5215504", "0.5203481", "0.51997733", "0.5196894", "0.519035", "0.5188137", "0.51863736", "0.51862085", "0.51817924", "0.51802367", "0.5179519", "0.5179158", "0.5178039", "0.51751524", "0.51670194", "0.5166217", "0.5161989", "0.5159577", "0.51591915" ]
0.68389195
2
console table for adding new dept
function consoleTableDept(title, results) { var values = []; for (var i = 0; i < results.length; i++) { var resultObject = { ID: results[i].department_id, Department: results[i].department_name, over_head_costs: "$" + results[i].over_head_costs.toFixed(2), }; values.push(resultObject); } console.table(title, values); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDept() {\n prompt([\n {\n type: \"input\",\n name: \"deptName\",\n message: \"New Department Name:\",\n validate: inputStr => {\n if (inputStr) return true;\n else return false;\n }\n },\n ]).then(deptData => {\n db.addDepartment(deptData.deptName)\n .then(([data]) => {\n promptAction()\n })\n })\n}", "function addDepartment() {\n inquirer.prompt(deptQuestions).then(function(answer) {\n addNewDept(answer.department, answer.overheadcosts);\n });\n}", "function addDept() {\n inquirer.prompt([{\n type: 'input',\n name: 'department',\n message: \"Please type in the new department name.\",\n }]).then((response) => {\n var dept = response.department\n connection.query(\n \"INSERT INTO department (name) VALUES ('\" + dept + \"')\",\n function (err, res) {\n if (err) throw err;\n console.log(chalk.green(\"Department Successfully Added!\"))\n reroute();\n })\n })\n}", "function addDepartment() {\n inquirer\n .prompt([\n { name: \"deptToAdd\", message: \"Enter the name of the new Department: \" },\n ])\n .then((response) => {\n db.query(\n \"INSERT INTO department (name) VALUES (?)\",\n response.deptToAdd,\n function (err) {\n if (err) throw err;\n viewAllDepartments();\n }\n );\n });\n}", "function addDept() {\n inquirer\n .prompt({\n type: \"input\",\n message: \"What is the name of the new department?\",\n name: \"department\"\n })\n .then(function (answer) {\n connection.query(\"INSERT INTO department SET ?\",\n {\n name: answer.department,\n },\n function (err, res) {\n if (err) throw err\n beginTracker()\n })\n })\n}", "function addDepartment() {\n inquirer\n .prompt([\n {\n name: \"deptName\",\n type: \"input\",\n message: \"What would you like added to the department list?\"\n }\n ])\n .then(function(answer) {\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n dept_name: answer.deptName\n },\n function(err) {\n if (err) throw err;\n console.log(chalk.blue(\"The department has been added successfully!\"));\n start();\n }\n );\n });\n}", "function viewDept() {\n db.selectAllDepartments()\n .then(([data]) => {\n console.log(`${separator}\\n DEPARTMENTS\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "function addDept(){\n inquirer.prompt([\n {\n name: \"dept\",\n massage: \"Enter Department Name:\",\n type: \"input\",\n validate : validateInput\n }\n]).then(answer => {\n connection.query(\"INSERT INTO department (name) VALUES (?)\",\n answer.dept,\n function(err){\n if (err)throw err;\n renderAction();\n });\n})\n}", "function addDept() {\n connection.query(\"INSERT INTO department SET ?\",\n {\n department: answer.department\n },\n function(err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" department inserted!\\n\");\n runPrompts();\n });\n }", "function addDepartment() {\n let question = \"Name of Department to add.\"\n Inquirer.prompt(\n {\n name: \"department\",\n type: \"input\",\n message: question\n }\n ).then((data) => {\n department.insertDepartment(data.department);\n init();\n });\n}", "function addDept() {\n // prompt the user for info about the department\n inquirer\n .prompt([\n {\n name: \"department\",\n type: \"input\",\n message: \"What is the name of the department that you want to add?\",\n },\n ])\n .then(function (answer) {\n // when finished prompting, insert a new department into the db with that info\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n department: answer.department,\n },\n function (err) {\n if (err) throw err;\n console.log(\"Your department was created successfully!\");\n // display the new list of departments and re-prompt the user.\n viewDept();\n }\n );\n });\n}", "function addDept() {\n console.log(\" ---------------- \\n ADD A DEPARTMENT \\n ----------------\");\n inquirer\n .prompt([\n {\n name: \"dep\",\n type: \"input\",\n message: \"Enter the name of the new department to add.\",\n },\n ])\n .then((answers) => {\n connection.query(\n \"INSERT INTO department SET ?\",\n [\n {\n name: answers.dep,\n },\n ],\n function (error) {\n if (error) throw err;\n console.clear();\n console.log(\"NEW DEPARTMENT ADDED SUCCESSFULLY!\");\n actions();\n }\n );\n });\n}", "function addDepartment() {\n inquirer.prompt([\n {\n name: \"name\",\n message: \"Type the Department Name\"\n },\n {\n name: \"overhead\",\n message: \"Enter Current Department Overhead\"\n }\n ]).then(function (answers) {\n var name = answers.name;\n var overhead = answers.overhead;\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: name,\n over_head_costs: overhead\n },\n function (err, res) {\n if (err) throw err;\n inquireForm();\n });\n });\n}", "addDepartment (dpt) {\n return this.connection.query(\n `INSERT INTO department SET ? ${dpt}`\n )\n }", "function addNewDept(department, overheadcosts) {\n var query =\n 'INSERT INTO departments (department_name, over_head_costs) VALUES (?, ?)';\n connection.query(query, [department.toLowerCase(), overheadcosts], function(\n err,\n res\n ) {\n if (err) {\n throw err;\n } else {\n console.log(\n `You have added the ${department} department to the departments database.`\n );\n reset();\n }\n });\n}", "function createNewDepartment() {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'name',\n message: \"What's the name of the new department?\"\n },\n {\n type: 'input',\n name: 'cost',\n message: \"What's the overhead cost?\"\n }\n ])\n .then(function(answer) {\n connection.query(\n 'insert into departments set ?',\n {\n department_name: answer.name,\n over_head_costs: answer.cost\n },\n function(err, res) {\n if (err) throw err;\n console.log('\\nSuccessfully created new department!\\n');\n console.log(\"Here's the updated list:\\n\");\n viewProductSales();\n }\n );\n });\n}", "function departmentTable() { }", "async function addDept() {\n const newDept = await prompt([\n {\n name: \"name\",\n message: \"What is the name of the department?\"\n }\n ]);\n await db.addDept(newDept.name);\n console.log(newDept.name + \" added to departments\");\n loadMainPrompts();\n}", "function addDepartment() {\n inquirer.prompt ({\n type: \"input\",\n message: \"What is the name of the department?\",\n name: \"deptName\"\n }).then(function(answer) {\n connection.query(\"INSERT INTO department (name) VALUES (?)\", [answer.deptName], function(err, res) {\n if (err) throw err;\n console.table(res)\n startPrompt();\n });\n });\n }", "function addDepartment(){\n\tinquirer.prompt([{\n\t\tname: 'department',\n\t\tmessage: 'Enter a department name: '\n\t},{\n\t\tname: 'overhead',\n\t\tmessage: 'Enter overhead costs: '\n\t}]).then(function(answer){\n\t\t//Variables to hold the department and overhead values\n\t\tvar department = answer.department;\n var overhead = answer.overhead;\n // Adds department and overhead values to departments table\n\t\tconnection.query('INSERT INTO departments SET ?', {\n\t\t\tdepartment_name: department,\n\t\t\toverhead_cost: overhead\n }, function(err, res){});\n // Calls function to perform a new action or exit\n\t\tnewQuery();\n})}", "function departmentAdd() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the department name?\"\n }\n ]);\n}", "function plusDepartment() {\n {\n inquirer.prompt([\n {\n name: \"department\",\n type: \"input\",\n message: \"Enter the new department name: \"\n\n }\n ])\n .then(function (data) {\n\n db.query('INSERT INTO department SET ?',\n {\n name: data.department,\n }, function (err) {\n console.table(data)\n goPrompt()\n })\n })\n }\n}", "function createNewDepartment() {\n console.log(\"======================\");\n console.log(chalk.green(\"Create New Department\"));\n\n inquirer\n .prompt([\n {\n name: \"departmentname\",\n type: \"input\",\n message: \"Type Department Name?\"\n },\n {\n name: \"overheadcosts\",\n type: \"input\",\n message: \"Type Over Head Costs?\"\n }\n ])\n .then(function (answer) {\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: answer.departmentname,\n over_head_costs: answer.overheadcosts\n },\n function (err, results) {\n if (err) throw err;\n console.log(\"====================\");\n console.log(chalk.green(\"Add the Record successfully!\"));\n console.log(\"====================\");\n Start();\n }\n );\n });\n\n // console.log(\"======================\");\n // Start();\n}", "function addNewDept(){\n\n // Prompt user for new item details\n prompt.start();\n console.log('\\nComplete the new department details:');\n prompt.get(['DepartmentName', 'OverHeadCosts', 'TotalSales'], function (err, result) {\n\n var departmentName = result.DepartmentName;\n var overHeadCost = result.OverHeadCosts;\n var totalSales = result.TotalSales;\n\n // Update Database\n connection.query('INSERT INTO Departments SET ?', {\n DepartmentName: departmentName,\n OverHeadCosts: overHeadCost,\n TotalSales: totalSales\n }, function(err, res){\n \n if(err){\n console.log('\\nSorry. The SQL database could not be updated.\\n');\n connection.end();\n }\n else{\n console.log('\\nNew department has been sucessfully updated.');\n connection.end();\n }\n });\n });\n}", "function addDepartmenet() {\n // Declare a local variable to be used within this block\n let newDepartment;\n // Prompt them to answer some additional questions about what departmenet they want to add\n addDepartmentPrompt()\n // Then capture their input in a variable and invoke the next set of steps\n .then (response => {\n newDepartment = response.departmentToAdd;\n insertNewDepartment();\n })\n // If there is an error, log the error\n .catch(err => {if (err) throw err});\n // Insert the new departmenet into the departmenet table\n function insertNewDepartment() {\n connection.query (\n // Insert the new departmenet\n `INSERT INTO department_table (\n department_name\n ) VALUES\n (\"${newDepartment}\");`\n ,\n // Log the result\n (err, res) => {\n // If error log error\n if (err) throw err;\n // Then call the view Departmenets function to display the latest data (this will also run into task completed)\n viewDepartments();\n }\n )\n } \n }", "function addDepartment() {\n inquirer\n .prompt([\n {\n type: 'input',\n message: `What is the name of this department?`,\n name: 'department',\n },\n ])\n .then((response) => {\n connection.query(`INSERT INTO department SET?`,\n {\n name: response.department\n },\n (err) => {\n if (err) throw err;\n log(chalk.green(`New department '${response.department}' has been added to your database!`))\n start();\n }\n )\n })\n}", "function addDepartment() {\n // prompt for info about new department; no need to query since existing database data not needed to add department\n inquirer\n .prompt({\n name: \"deptName\",\n type: \"input\",\n message: \"What department would you like to add?\"\n })\n .then(function(answer) {\n // after collecting answer, insert department into database\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n dept_name: answer.deptName\n // dept table id (key) should automatically update/increment starting from 1001 (including seed data)\n },\n function(err) {\n if (err) throw err;\n // console log success message plus new department name\n console.log(answer.deptName + \" Department is added!\");\n // re-prompt the user for further actions by calling \"start\" function\n start();\n }\n );\n });\n}", "function addDepartment() {\n inquirer.prompt(\n {\n type: 'input',\n message: 'Enter new department name',\n name: 'department'\n }\n ).then(function(answers){\n con.query(\"INSERT INTO departments (name) VALUES (?)\", [answers.department], function(err, data) {\n if (err) throw err\n console.log(\"\\n\" + \"New Departmant added: \" + answers.department);\n runManager();\n });\n });\n }", "function addDepartment() {\n inquirer.prompt([\n {\n name: \"departmentName\",\n type: \"input\",\n message: \"Enter the name of the new department:\",\n },\n ]) \n .then(data => {\n let newDept = data.departmentName;\n let newDeptID = depts.length + 1;\n\n let addNewDept = new department(newDept, newDeptID);\n\n db.query(`INSERT INTO department SET ?`, addNewDept, (err, res) => {\n if(err) throw err;\n viewAllDepartments();\n });\n startingPrompt();\n });\n}", "function insertNewDepartment() {\n connection.query (\n // Insert the new departmenet\n `INSERT INTO department_table (\n department_name\n ) VALUES\n (\"${newDepartment}\");`\n ,\n // Log the result\n (err, res) => {\n // If error log error\n if (err) throw err;\n // Then call the view Departmenets function to display the latest data (this will also run into task completed)\n viewDepartments();\n }\n )\n }", "function newDept() {\n inquirer.prompt(\n {\n name: \"newDept\",\n message: \"Name the new department\",\n type: \"input\",\n validate: userEntry => {\n // if user response is not nothing\n if(userEntry !== \"\"){\n return true;\n }\n return \"You have to enter some information!\"\n },\n default: \"\" \n }\n ).then(function ({ newDept }) {\n connection.query(`INSERT INTO department (name) VALUES ('${newDept}')`, function (err, data) {\n if (err) throw err;\n console.log('Inserted ' + newDept + ' into row ' + data.insertId)\n mainTasker();\n })\n })\n }", "function createDept(dept) {\n connection.query('INSERT INTO departments SET ?',\n {\n department: `${dept}`,\n },\n (err, res) => {\n if (err) throw err; \n }\n );\n}", "function addDepartment(){\n inquirer.prompt([\n {\n type: \"input\",\n message: \"What department would you like to add?\",\n name: \"newDepartment\"\n }\n ]).then(\n response => {\n\n const dept = response.newDepartment;\n \n createDept(dept);\n\n console.log(\"\\n\", brkLines);\n console.log(`New Department added!\\n`);\n init();\n });\n}", "function addDept() {\n inquirer\n .prompt({\n type: 'input',\n message: 'What is the name of the new department?',\n name: 'title',\n validate: nameInput => {\n if (nameInput) {\n return true;\n } else {\n console.log('What is the name of the new department?')\n }\n }\n })\n .then(answer => {\n db.query(`INSERT INTO departments SET ?`,\n {\n title: answer.title\n },\n (err, res) => {\n if (err) throw err;\n console.log(`\n Department has been added!\n `);\n console.table(answer);\n deptOptions()\n })\n })\n}", "function addDepartment() {\n inquirer\n .prompt([\n {\n name: \"addingdept\",\n type: \"input\",\n message: \"What department would like to add?\"\n }\n\n ])\n .then(function (answer) {\n connection.query(\n \"INSERT INTO departments SET ?\",\n {\n dept_name: answer.addingdept\n },\n function (err) {\n if (err) throw err;\n console.log(\"Department added\");\n start();\n }\n );\n });\n}", "function addDepartment() {\n inquirer.prompt([\n {\n name: \"departmentName\",\n type: \"input\",\n message: \"Enter the department name?\"\n }\n ])\n .then(function(answer) {\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n name: answer.departmentName\n },\n function(err) {\n if (err) throw err;\n console.log(\"New department created!\");\n // re-prompt the user for if they want to bid or post\n start();\n }\n );\n });\n}", "async function addDepartment() {\n\tconst answer = await inquirer.prompt({\n\t\tname: 'departmentName',\n\t\ttype: 'input',\n\t\tmessage: 'Department Name:'\n\t});\t\n\tawait queryAsync('INSERT INTO department SET ?', { name: answer.departmentName });\n\tconsole.log(chalk.bold.bgCyan('\\nSUCCESS:'), 'Department was added.');\n\tviewDepartments();\n}", "function addDepartment(obj) {\n console.log(\"Inserting a new department\");\n connection.query(\"INSERT INTO department SET ?\", obj, function(err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" department inserted!\\n\");\n });\n connection.query(\"SELECT * from department\", function(err, res) {\n if (err) throw err;\n const newTable = table.getTable(res);\n console.log(newTable);\n });\n console.clear();\n initiation();\n}", "function addDepartment() {\n inquirer\n .prompt ([\n {\n name: \"name\",\n type: \"input\",\n message: \"Input new Department\"\n }\n ])\n .then(function(res) {\n var query = connection.query (\"INSERT INTO department SET ?\",\n {\n name: res.name\n },\n function (err) {\n if (err) throw err \n console.table(res);\n runSearch();\n }\n )\n })\n}", "function addDept() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What department would you like to add?\",\n name: \"deptName\"\n }\n ]).then(function (answer) {\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n dept_name: answer.deptName\n },\n function (err) {\n if (err) throw err;\n console.log(\"Department added!\");\n console.log(answer.deptName);\n inquirerInit();\n\n }\n );\n })\n}", "function addDepartment(){\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the name of the new department?\",\n name: \"name\"\n },\n {\n type: \"input\",\n message: \"What are the overhead costs?\",\n name: \"overhead\"\n },\n ])\n .then(function(response) {\n addDeptRecord(response.name, response.overhead);\n });\n}", "function addDepartment(){\n inquirer.prompt({\n name: 'name',\n type: 'input',\n message: 'What is the department name?'\n })\n .then((answer) =>{\n let deptQuery = 'INSERT INTO departments (name) values (?)';\n connection.query(deptQuery, answer.name, function (err, res){\n if (err) throw err;\n console.log(`${answer.name} has been added!`)\n })\n startApp();\n })}", "function createDept(){\n \n // clear the console\n console.log('\\033c');\n // displaying the product list\n console.log(`\\x1b[7m Creating New Department \\x1b[0m`);\n // user input starts here\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'department_id',\n message: 'Enter the Department ID: ',\n validate: function(value){\n if (value.trim().length < 2) {\n console.log(`\\x1b[1m \\x1b[31m\\nERROR! Invalid Department ID\\x1b[0m`);\n return false;\n } return true;\n }\n },\n {\n type: 'input',\n name: 'department_name',\n message: \"Enter the Name of the Department: \",\n validate: function(value){\n if (value.trim().length < 4) {\n console.log(`\\x1b[1m \\x1b[31m\\nERROR! Invalid Department Name\\x1b[0m`);\n return false;\n } return true;\n }\n },\n {\n type: 'input',\n name: 'over_head_costs',\n message: 'Enter the Overhead Costs for this Department: ',\n validate: function(value){ \n if (!isNaN(value) && parseFloat(value) > 0) {\n return true\n } else {\n console.log(`\\x1b[1m \\x1b[31m\\nOverhead Costs must be more that zero\\x1b[0m`);\n return false\n }\n }\n }\n ]).then( answer => {\n // at the end of data entry, ask for user confirmation before updating the database\n inquirer\n .prompt([{\n type: \"list\",\n name: \"wish\",\n message: \"\\nAre You Sure you want to Add this new Department?\",\n choices: [\"Yes\", \"No\"]\n }]).then( ans => {\n if (ans.wish === \"Yes\"){\n connection.query(\n \"INSERT INTO departments SET ?\", \n {\n department_id: answer.department_id,\n department_name: answer.department_name,\n over_head_costs: answer.over_head_costs,\n },\n function (err) {\n if (err) throw err;\n console.log(`\\x1b[1m\\x1b[32m\\nSUCCESS! The Following Department has been Created!\\x1b[0m`); \n console.table(\n { \n \"Dept ID\": answer.department_id,\n \"Department\": answer.department_name,\n \"Overhead Costs\": answer.over_head_costs\n }\n );\n endRepeat();\n }\n );\n } else {\n console.log(`\\x1b[1m \\x1b[31m\\nOkay. This Department was not added to the databse\\x1b[0m`);\n endRepeat();\n }\n\n }); \n });\n}", "function addDepartment() {\n displayAlldept();\n inquirer.prompt({\n type: \"input\",\n name: \"departName\",\n message: \"What is the department name?\"\n })\n .then((answer) => {\n console.log(\"Adding a new department ... \\n\");\n connection.query(\n 'INSERT INTO department SET ?', {\n department: answer.departName,\n },\n function (err, res) {\n if (err) throw err;\n console.log(\"New Department added!\\n\");\n start();\n\n }\n )\n })\n}", "async function addDepartment() {\n const department = await prompt([{\n name: \"name\",\n message: \"What is the name of the department?\"\n }]);\n await db.createDepartment(department);\n console.log(`Added ${department.name} to the database`);\n startPrompt();\n}", "function addDept() {\n inquirer.prompt([\n {\n type: 'input',\n name: \"deptName\",\n message: \"Please enter the name of the new department you would like to add.\"\n }\n ]).then(function(data) {\n connection.query(\"INSERT INTO department SET ?\",\n {\n name: data.deptName\n }, function (error, res) {\n if (error) throw error;\n });\n console.log(\"==================================\");\n console.log(\"New Department Successfully Added!\");\n console.log(\"==================================\");\n mainMenu();\n });\n}", "function addDepartment() {\n inquirer\n .prompt({\n type: \"input\",\n message: \"Input department name:\",\n name: \"department\"\n })\n .then(data => {\n\n const depart = data.department;\n const departmentId = departmentsArr.length + 1;\n const newDepartment = new Department(departmentId, depart);\n \n const sql = `INSERT INTO department(department) values(?)`;\n connection.query(sql, depart, (err, res) => {\n if (err) throw err;\n\n departmentsArr.push(newDepartment);\n console.log(\"1 department inserted\");\n \n console.table(departmentsArr);\n\n start();\n }); \n });\n\n}", "function viewDept() {\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "addANewDept(adr) {\n\t\tconst query = `\n\t\t INSERT INTO\n\t\t department\n\t\t SET ?\n\t\t`;\n\t\tconst post = {\n\t\t\tname: adr,\n\t\t};\n\t\treturn this.connection.query(query, post);\n\t}", "function addDepartment(){\n inquirer\n .prompt(q.addDepartment)\n .then(answer => { \n connection.query(\n queryList.postDepartment, {name:answer.departmentName}, function(err, res){\n if (err) throw err;\n console.log(answer.departmentName + \" department added\");\n startQ();\n }\n );\n })\n .catch(err => {\n if(err) throw err;\n quit();\n });\n}", "function addDepartments() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"dname\",\n message: \"Enter the department you would like to add\",\n },\n ]).then((answers) => {\n console.log(\"Inserting a new department...\\n\");\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n name: answers.dname\n },\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" Department inserted!\\n\");\n main();\n }\n );\n })\n}", "function addDepartment(){\n\n //prompt for name of department\n prompt([\n {\n name: \"name\",\n message: \"What is the name of the department?\"\n }\n ])\n .then(res => {\n\n //department name passed into query to update department table with new department\n let name = res;\n db.createDepartment(name)\n .then(()=> loadMainPrompt());\n })\n}", "function addDeptRecord(name, overhead){\n var query = \"INSERT INTO departments (department_name, over_head_costs) VALUES (?, ?);\";\n \n connection.query(query, [name,overhead], function(err, res) {\n if (err) throw err;\n console.log(name + \" has been added to the database.\");\n console.log(\" \");\n supervisorPrompt();\n });\n}", "printDept() {\n // get department information\n dbFunctions.viewDepartments()\n // show results in console\n .then((results) => {\n console.table(results)\n startManagement()\n })\n }", "function viewDepts(){\n var query = connection.query(\"SELECT Department_ID, Department_Name FROM departments;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n superAsk();\n });\n }", "function addDepartment() {\n inquirer\n .prompt([{\n type: 'input',\n name: 'department',\n message: 'What is the name of the department you would like to add?'\n }])\n .then((ans) => {\n let newDepartment = ans.department;\n db.addNewDepartment(newDepartment)\n .then(() => console.log(`Added a new department called: ${newDepartment} to the database`));\n mainPrompts();\n });\n}", "function addDepartment(){ \n inquirer.prompt(\n {\n name: \"addDepartment\",\n type: \"input\",\n message: \"Please enter the department name!\",\n }).then(function(track){\n const tracker = \"INSERT INTO department SET ?\";\n connection.query(tracker, \n { \n name: track.addDepartment \n }, \n function(err, data) {\n if (err) throw err;\n console.log(\"Department has been saved!\");\n databaseQuestions();\n });\n })\n }", "function addDepartment() {\r\n inquirer\r\n .prompt([\r\n {\r\n name: 'newDepartment', \r\n type: 'input', \r\n message: 'Which department would you like to add?'\r\n }\r\n ]).then(function (answer) {\r\n connection.query(\r\n 'INSERT INTO department SET ?',\r\n {\r\n name: answer.newDepartment\r\n });\r\n var query = 'SELECT * FROM department';\r\n connection.query(query, function(err, res) {\r\n if(err)throw err;\r\n console.log('Your department has been added!');\r\n console.table('All Departments:', res);\r\n questions();\r\n })\r\n })\r\n}", "function createDepartment() {\n inquirer\n .prompt([\n {\n name: 'newDepartment',\n type: 'input',\n message: 'What is the name for this New Department?'.red\n },\n {\n name: 'newOverhead',\n type: 'input',\n message: 'What is the overhead for this new Department?'.red,\n validate: function (value) {\n return isNaN(value) === false;\n }\n }\n ])\n .then(function (selection) {\n let newOverhead = parseInt(selection.newOverhead);\n connection.query(queryNew,\n {\n department_name: selection.newDepartment,\n over_head_costs: newOverhead\n },\n function (err, res) {\n if (err) throw err;\n console.log(`${res.affectedRows} New Department Added`.green);\n newMenu();\n });\n });\n}", "function addDepartment() {\n inquirer\n .prompt({\n type: \"input\",\n message: \"What is the name of the department?\",\n name: \"newDepartment\",\n })\n .then((res) => {\n if (res.newDepartment) {\n db.query(\n \"INSERT INTO department(department_name) VALUE (?)\",\n res.newDepartment,\n (err, data) => {\n if (err) throw err;\n console.log(\"Successfully added a new department!\");\n init();\n }\n );\n } else {\n console.log(\"Something went wrong please try again\");\n init();\n }\n });\n}", "function addDepartment(){\n console.log(\"\\nEnter Department related information\");\n inquirer.prompt({\n type: \"input\",\n name: \"dept\",\n message: \"Enter a department name you want added to the Department Table:\",\n }).then(function(answer){\n console.log(\"\\nInserting Department...\\n\");\n let query = connection.query(\n \"INSERT INTO department SET ?\",\n {\n name : answer.dept\n },\n function(err, res) {\n if(err){\n console.log(\"Error while inserting data into Department table: \"+ err);\n } else {\n console.log(res.affectedRows + \"department inserted!\\n\");\n }\n continuePrompt();\n }\n )\n });\n}", "function addDept() {\n // Ask user what Department they'd like to add\n inquirer\n .prompt([\n {\n name: \"deptName\",\n type: \"text\",\n message: \"Please enter the department you would like to add:\",\n validate: (nameInput) => {\n // Using regex for validation to replace white space \n nameInput = nameInput.replace(/\\s/g, \"\");\n if (nameInput) {\n return true;\n } else {\n console.log(\"Please enter the department you would like to add:\");\n return false;\n }\n },\n },\n ])\n .then(({ deptName }) => {\n const sql = `INSERT INTO department(name) VALUES(?)ON DUPLICATE KEY UPDATE name=?;`;\n // If Department name does NOT exist, insert Department name into Department Table\n // Using regex for validation to replace white space\n const params = [deptName.replace(/\\s/g, ' '), deptName.replace(/\\s/g, ' ')];\n db.query(sql, params, (err, response) => {\n if (err) {\n console.log(err);\n }\n console.log(chalk.white.bold(`====================================================================================`));\n console.log(chalk.white.bold( ` Department Successfully Added `));\n console.log(chalk.white.bold(`====================================================================================`));\n // View Department Table\n viewAllDepts();\n });\n });\n}", "function addDepartment(){\n inquirer.prompt([\n {\n type: 'input',\n name: 'newDept',\n message: 'Please enter the name of the new department:'\n }\n ]).then(function(answer){\n let query = \"INSERT INTO departments SET ?\"\n connection.query(query, { name: answer.newDept }, function(err){\n if (err) throw err;\n console.log('New Department Added');\n employeeTracker();\n });\n });\n}", "function addDepartment() {\n //console.log(\"add department function called\");\n\n inquirer\n .prompt({\n type: \"input\",\n message: \"Enter department name:\",\n name: \"newDepartment\",\n })\n .then((res) => {\n connection.query(\"INSERT INTO department SET ?\", {\n name: res.newDepartment,\n });\n\n console.log(\"Department added\");\n\n start();\n });\n}", "addDepartment(deptName) {\n\t\ttry {\n\t\t\tthis.connection.query(\n\t\t\t\t\"INSERT INTO department SET ?\",\n\t\t\t\t{\n\t\t\t\t\tname: `${deptName}`,\n\t\t\t\t},\n\t\t\t\tfunction (err, res) {\n\t\t\t\t\tif (err) throw err;\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`\\nSuccessfully added ${deptName} department!`\n\t\t\t\t\t);\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconsole.log(\"Error inserting department : \" + err);\n\t\t}\n\t}", "function createDept() {\n console.log(\"\\nFantastic, let's add a new department! To get started let's answer a few questions:\\n\")\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"input\",\n message: \"What is the department name you would like to create?\",\n name: \"deptName\", \n // validate: function validateID(name){\n \n // if(isNaN(name)===true){\n // console.log('\\nBe sure to specify the correct ID as a number!')\n // return false;\n // }\n // else if(name === \"\"){\n // console.log('\\nBe sure to specify the correct ID as a number!')\n // return false;\n // }\n // else {\n // return true;\n // }\n // }\n },\n \n\n ])\n .then(function(response) {\n var buildDept = response.deptName; \n \n var query = connection.query(\"INSERT INTO departments (Department_Name) VALUES (?);\",[buildDept], async function(err, res) {\n if (err) throw err;\n console.log(\"\\nCongrats on adding a new department! Here is your department with the rest!\")\n viewDepts();\n \n });\n \n\n \n });\n\n }", "function addEmDepartment() {\n inquirer.prompt({\n type: \"input\",\n name: \"Department\",\n message: \"Please enter the department name you would like to add.\"\n }).then(userInput => {\n connection.query(\"INSERT INTO department SET ?\", \n {\n name: userInput.Department\n }, \n function(err, result){\n if(err) {\n throw err;\n } else {\n console.log(\"Department added!\");\n console.table(userInput);\n beginApp();\n }\n });\n });\n}", "function addDepartment(){\n inquirer.prompt({\n name: 'name',\n type: 'input',\n message: 'What would you like to name your department?'\n }).then(function (response) {\n connection.query(\"INSERT INTO department SET ?\", { name: response.name }, function (err) {\n if (err) throw err;\n mainMenu();\n })\n })\n}", "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "function createDept() {\n inquirer\n .prompt([\n {\n message: \"What department would you like to add?\",\n name: \"newDept\",\n validate: function (value) {\n if (isNaN(value) === true) {\n return true;\n } else {\n return false;\n }\n }\n },\n {\n message: \"What are the department's overhead costs?\",\n name: \"deptCosts\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n } else {\n return false;\n }\n }\n },\n ]).then(function (ans) {\n\n // CONNECTION TO DATABASE INSERTING NEW DEPARTMENT //\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: ans.newDept,\n over_head_costs: parseFloat(ans.deptCosts)\n },\n function (error, response) {\n if (error) throw error;\n viewSales();\n })\n }).catch(function (error) {\n console.log(error);\n })\n}", "function addDepartment(departments, deptID) {\n // debugging\n // console.log(departments);\n\n connection.query(\n \"INSERT INTO departments SET?\", {\n department_name: departments.department_name,\n over_head_costs: departments.overhead_cost || 0,\n department_id: deptID,\n },\n function(err) {\n if (err) throw err;\n userInput();\n }\n );\n}", "function newDept(){\n console.log(\"\\nEnter details of new Department to be added.\\n\");\n inquirer\n .prompt([{\n name: \"deptname\",\n type: \"input\",\n message: \"\\nEnter Department Name\",\n validate: function (input) {\n // Declare function as asynchronous, and save the done callback\n var done = this.async();\n validation(input,\"t\",done)}\n },\n {\n name: \"overhead\",\n type: \"input\",\n message: \"\\nEnter Over_head Cost\",\n validate: function (input) {\n // Declare function as asynchronous, and save the done callback\n var done = this.async();\n validation(input,\"n\",done)}\n }\n \n ]).then(function(answer){\n \n var query=\"INSERT INTO departments(department_name,over_head_costs)\" +\n \"VALUES ('\" + answer.deptname + \"',\" + answer.overhead + \")\";\n \n connection.query(query, function(err,response){\n if(err) throw err;\n });\n runSearch(); \n \n });\n \n }", "function populateDepInfo() {\n const depCheck = document.querySelectorAll(\"#depTable tbody tr\"); //Get Department Table Rows\n let deps = getDeps();\n if (depCheck.length == 0) {\n for (let j = 0; j < deps.length; j++) {\n let depOb = new CRUD(\"depTable\", \"depSelect\", deps[j]); //Create Object for department\n depOb.addOption();\n depOb.addRow();\n }\n } else {\n removeExistingDep();\n populateDepInfo();\n }\n}", "function addDepartment() {\n inquirer\n .prompt({\n name: \"department_name\",\n type: \"input\",\n message: \"What is the department name?\",\n })\n .then((answer) => {\n console.log(\"Adding a new department...\\n\");\n connection.query(\n `INSERT INTO department SET ?`,\n {\n name: answer.department_name,\n },\n function (err, res) {\n if (err) throw err;\n console.log(\"New department added!\\n\");\n\n initTracker();\n }\n );\n });\n}", "function addDepartment() {\n inquirer\n .prompt({\n name: \"addDepartment\",\n type: \"input\",\n message: \"What is the name of the department you would like to add?\",\n })\n .then(function (answer) {\n // when finished prompting, insert a new item into the db with that info\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n title: answer.addDepartment\n },\n function (err) {\n if (err) throw err;\n console.log(\"\\nYou successfully added a(n) \" + answer.addDepartment + \" Department\\n\");\n start();\n }\n );\n });\n}", "function addDepartment() {\n // using inquirer prompt to ask user input question for new department\n inquirer.prompt({\n message: \"What department would you like to add?\",\n type: \"input\",\n name: \"newDepartment\"\n }).then(answers => {\n // using mysql syntax to insert new department designated by user to department tables\n connection.query(\"INSERT INTO department (department_name) values (?)\", [answers.newDepartment], function(err, res) {\n startQuestions();\n })\n })\n}", "function viewProductByDept(){\n //prints the items for sale and their details\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n // cli-table build\n var table = new Table({\n head: [\"Id\", \"Department\", \"Over-Head\" , \"Sales\", \"Profit\"]\n , colWidths: [5, 20, 10, 10, 10]\n });\n \n //push data to table\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].total_sales).toFixed(2), (res[i].total_sales - res[i].over_head_costs).toFixed(2)]\n )\n }\n // displays table\n console.log(table.toString());\n isThatAll();\n })\n}", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function addDepartment(){\n\n\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Please enter the name of the new department.\",\n name: \"department\"\n }\n ])\n .then(function(response){\n\n var query = `INSERT INTO department SET ?`\n \n\n connection.query(query, \n\n {\n name: response.department\n },\n \n \n function (err, res) {\n if (err) throw err;\n init();\n });\n })\n}", "async function addDepartment() {\n const {name} = await inquirer.prompt([\n {\n message: \"What would you like the department name to be?\",\n name: \"name\",\n validate: (answer) => departments.validateName(answer)\n }\n ])\n \n await departments.add(name)\n promptMainMenu()\n}", "function createDepartment(){\n inquirer.prompt([\n {\n name: \"department_name\",\n type: \"input\",\n message: \"What is the new department name?\"\n }, {\n name: \"over_head_costs\",\n type: \"input\",\n message: \"What are the overhead costs for this department?\"\n }\n ]).then(function(ans){\n connection.query(\"INSERT INTO departments SET ?\", {\n department_name: ans.department_name,\n over_head_costs: ans.over_head_costs\n }, function(err, res){\n if(err) {\n throw err;\n } else {\n console.log(\"Your was added successfully!\");\n\n whatYouLikeToDo();\n }\n });\n });\n}", "function addDepartment() {\n inquirer.prompt([{\n type: \"input\",\n message: \"What is the new department's name?\",\n name: \"newDeptName\"\n }])\n .then(function(res) {\n let newDeptName = res.newDeptName;\n\n connection.query(`INSERT INTO department(name) VALUES(\"${newDeptName}\");`, function(err, res) {\n if (err) {\n throw (err)\n }\n console.table(res);\n firstPrompt();\n });\n })\n}", "function addDepartment() {\n \n inquirer.prompt([\n \n {\n type: 'input',\n name: 'nameDpto',\n message: 'What is your department name?',\n validate: name => { \n if (name) {\n return true;\n } else {\n console.log('\\n Please enter a department name!');\n return false;\n }\n }\n }\n ])\n .then(anserw => {\n let nameDepartment = anserw.nameDpto;\n //sql consult insert\n connection.query('INSERT INTO department SET name=? ', [nameDepartment], (err, res) => {\n if (err) throw err;\n \n //printing info that tells the user that 1 department was added\n console.log(res.affectedRows + ' Department added!\\n');\n \n //calls the menu to display the question again\n menu();\n })\n })\n \n }", "function viewDept(){\n connection.query(`SELECT name, id FROM department;`, (err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "function addDepartment() {\n inquirer\n .prompt({\n name: \"department\",\n type: \"input\",\n message: \"PLEASE INPUT THE NAME OF THE NEW DEPARTMENT\",\n })\n .then(function (answer) {\n var query = connection.query(\n \"INSERT INTO department SET ?\",\n {\n _name: answer.department,\n },\n function (err) {\n if (err) throw err;\n console.log(\"NEW DEPARTMENT ADDED\");\n //======RESET TO BEGINNING OF PROMPT====\n runSearch();\n }\n );\n });\n}", "function viewDepartment() {\n db.query(\n \"SELECT * FROM department\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n prompt();\n }\n )\n}", "async function addDepartment() {\n inquirer.prompt([\n {\n name: \"depName\",\n type: \"input\",\n message: \"Enter new department:\"\n \n }\n ]).then(answers => {\n connection.query(\"INSERT INTO department (name) VALUES (?)\", [answers.depName]);\n console.log(\"\\x1b[32m\", `${answers.depName} was added to departments.`);\n runApp();\n })\n}", "async function addDepartment() {\n inquirer.prompt([\n {\n name: \"depName\",\n type: \"input\",\n message: \"Enter new department:\",\n validate: confirmStringInput\n }\n ]).then(answers => {\n db.query(\"INSERT INTO department (name) VALUES (?)\", [answers.depName]);\n console.log(\"\\x1b[32m\", `${answers.depName} was added to departments.`);\n runApp();\n })\n}", "function viewDept() {\n connection.query(\n `\n SELECT \n department.name AS 'Department'\n FROM department\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "function addDepartment(departmentName) {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'departmentname',\n message: \"What department would you like to add?\"\n }\n ])\n .then((answer) => {\n const departmentName = answer.departmentname;\n const query = `INSERT INTO departments (name) VALUES ('${departmentName}')`;\n db.promise().query(query)\n .then((results) => {\n console.log('successfully added department')\n })\n .catch(console.log('error adding new department'))\n .then(() => {\n menu();\n })\n })\n .catch((err) => console.log(err))\n}", "function addDepartmentPrompt(){\n //inquirer allows a cli prompt to gather info from the user\n inquirer\n .prompt(\n {\n //this type input allows the user to enter in their own info\n type: \"input\",\n //this displays a message to the user\n message: \"Please enter the name of the new department you want to add: \",\n //this stores the data with this name\n name: \"name\"\n }\n //this handles the callback of the prompt\n ).then( function(answer) {\n //This capitalizes the first word of the input tutorial https://flaviocopes.com/how-to-uppercase-first-letter-javascript/\n const name = answer.name;\n const capitalizeName = name.charAt(0).toUpperCase() + name.slice(1);\n //INSERT INTO department (name) VALUES (\"name_value\");\n db.addQuery(`department`, `name`, `\"${capitalizeName}\"`)\n })\n}", "function viewAllDepts() {\n connection.query(\n 'SELECT * FROM Department', (err, res) => {\n if (err) {\n console.log(err);\n }\n console.table(res)\n startProgram();\n })\n}", "function viewDepartment() {\n connection.query(\"SELECT * FROM employee_db.department\", function (error, data) {\n console.table(data)\n init()\n })\n}", "function addDepartmentPrompt () {\n return inquirer.prompt ([\n {\n type: \"input\",\n name: \"departmentToAdd\",\n message: \"Please enter the name of the department you would like to add\",\n validate: async(input) => {\n if(input===\"\") {\n return \"Please enter a value\"\n }\n return true\n } \n }\n ])\n }", "function addDepartment() {\n console.log(\"Add a new department.\\n\");\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the department name?\",\n name: \"department_name\",\n },\n {\n type: \"input\",\n message: \"What is the department id?\",\n name: \"department_id\",\n },\n\n\n ])\n .then(function (res) {\n db.query(\n \"INSERT INTO department SET ?\",\n res,\n function (err, res) {\n if (err) throw err;\n console.log(\"Your new department has been added to EmployeeDB!\\n\");\n prompt();\n }\n )\n\n }\n )\n\n}", "function viewAllDepts() {\n console.log(\"Showing all departments...\\n\");\n connection.query(\"SELECT * FROM department \", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "createDepartment(department) {\r\n return this.connection.query(\"INSERT INTO department SET ?\", department);\r\n }", "function addDepartment() {\n inquirer\n .prompt([\n {\n name: \"name\",\n type: \"input\",\n message: \"What is the name of this department?\",\n validate: function (value) {\n if (value === \"\") {\n console.log(\"Please enter a name.\");\n return false;\n }\n return true;\n },\n },\n ])\n .then(function (answer) {\n console.log(answer);\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n name: answer.name,\n },\n function (err, res) {\n if (err) throw err;\n runTracker();\n }\n );\n });\n}", "async function addADepartment() {\n inquirer.prompt([...addDepartmentQuestion]).then((data) => {\n const sql = \"INSERT INTO departments (name) VALUES ?\";\n let department_name = [[data.addDepartment]];\n\n db.query(sql, [department_name], (err, results) => {\n if (err) {\n return console.error(err.message);\n }\n console.log(\"Number of rows successfully added: \" + results.affectedRows);\n });\n prompt();\n });\n}", "async function createDepartment() {\n const newDepartment = await inquirer.prompt([\n {\n type: \"input\",\n message: \"What is the name of the department?\",\n name: \"dptName\",\n },\n ]);\n\n await functions.addDepartment(newDepartment);\n await console.log('Department created!');\n}" ]
[ "0.75624824", "0.71538717", "0.7078191", "0.70726883", "0.70241344", "0.6968065", "0.6941845", "0.69293267", "0.6919195", "0.6898692", "0.6882417", "0.68685496", "0.6844499", "0.68383944", "0.6828091", "0.6820019", "0.6818449", "0.6801586", "0.6767039", "0.67622197", "0.6755716", "0.67550343", "0.6746741", "0.67375404", "0.67309064", "0.6721793", "0.67091084", "0.6704405", "0.6695206", "0.66868496", "0.66867965", "0.6658138", "0.6648519", "0.6607615", "0.6587995", "0.6583281", "0.6551129", "0.65506566", "0.6532882", "0.65293014", "0.65261036", "0.65123975", "0.65079075", "0.6486056", "0.64543587", "0.6444721", "0.6407511", "0.64050657", "0.6394353", "0.6386804", "0.6379066", "0.63777685", "0.6373389", "0.6354564", "0.6344836", "0.6339955", "0.63356733", "0.63135624", "0.6299551", "0.62990075", "0.6271255", "0.6267691", "0.62587774", "0.62577796", "0.6244231", "0.6227193", "0.62250036", "0.6187511", "0.61858594", "0.6180852", "0.6178905", "0.61756414", "0.6174576", "0.6166398", "0.61654973", "0.6162801", "0.6137286", "0.6135838", "0.612927", "0.6121645", "0.6121198", "0.61042774", "0.6102535", "0.6086268", "0.60558146", "0.60476995", "0.6045957", "0.6041877", "0.602806", "0.6016495", "0.60102177", "0.5997231", "0.5952703", "0.59502494", "0.59414923", "0.5932016", "0.5931986", "0.5926213", "0.5925408", "0.5922165" ]
0.63033473
58
Constructor function creates the object a koopa has two animation sprites, so two images must be refered to in the parameters
constructor(img1, img2, xPos, yPos) { this.img1 = img1; this.img2 = img2; this.xPos = xPos; this.yPos = yPos; this.pic = 1; this.counter = 0; this.frames = 8; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { //initializes objects within class\n this.sprite = 'images/'; //targets image folder\n this.x = 2;\n this.y = 5;\n }", "create() {\n this.hero = this.matter.add.sprite(this.game.config.width / 2, this.game.config.height / 2, 'hero');\n this.hero.depth = 1200;\n\n this.matter.world.setBounds(0, 0, game.config.width, game.config.height);\n\n this.anims.create({\n key: 'south_stop',\n frames: [{ key: 'hero', frame: '1.png' }]\n });\n\n this.anims.create({\n key: 'north_stop',\n frames: [{ key: 'hero', frame: '17.png' }]\n });\n\n this.anims.create({\n key: 'west_stop',\n frames: [{ key: 'hero', frame: '9.png' }]\n });\n\n this.anims.create({\n key: 'east_stop',\n frames: [{ key: 'hero', frame: '25.png' }]\n });\n\n this.anims.create({\n key: 'south_walk', // southeast in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 1, end: 4 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'north_walk', // northwest in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 17, end: 20 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'west_walk', // southwest in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 9, end: 12 }),\n frameRate: 4,\n repeat: -1\n });\n this.anims.create({\n key: 'east_walk', // northeast in isometric\n frames: this.anims.generateFrameNames('hero', { prefix: '', suffix: '.png', start: 25, end: 28 }),\n frameRate: 4,\n repeat: -1\n });\n\n // sorcerer.animations.add('southeast', ['1.png','2.png','3.png','4.png'], 6, true);\n // sorcerer.animations.add('south', ['5.png','6.png','7.png','8.png'], 6, true);\n // sorcerer.animations.add('southwest', ['9.png','10.png','11.png','12.png'], 6, true);\n // sorcerer.animations.add('west', ['13.png','14.png','15.png','16.png'], 6, true);\n // sorcerer.animations.add('northwest', ['17.png','18.png','19.png','20.png'], 6, true);\n // sorcerer.animations.add('north', ['21.png','22.png','23.png','24.png'], 6, true);\n // sorcerer.animations.add('northeast', ['25.png','26.png','27.png','28.png'], 6, true);\n // sorcerer.animations.add('east', ['29.png','30.png','31.png','32.png'], 6, true);\n\n //this.cameras.main.startFollow(this.hero);\n\n this.keyUp = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.UP, true, true);\n this.keyUp.on('down', this.key_down_callback, this);\n this.keyUp.on('up', this.key_up_callback, this);\n\n this.keyDown = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.DOWN, true, true);\n this.keyDown.on('down', this.key_down_callback, this);\n this.keyDown.on('up', this.key_up_callback, this);\n\n this.keyLeft = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.LEFT, true, true);\n this.keyLeft.on('down', this.key_down_callback, this);\n this.keyLeft.on('up', this.key_up_callback, this);\n\n this.keyRight = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.RIGHT, true, true);\n this.keyRight.on('down', this.key_down_callback, this);\n this.keyRight.on('up', this.key_up_callback, this);\n }", "constructor(x = 200, y = 400) {\n this.sprite = 'images/char-princess-girl.png'; \n this.x = x;\n this.y = y;\n }", "function Sprite_Animation() {\n this.initialize.apply(this, arguments);\n}", "constructor(x,y,speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.sprite = 'images/enemy-bug.png';\n }", "constructor() {\n this.x = 202;\n this.y = 395;\n this.sprite = 'images/char-boy.png';\n }", "constructor(scene,x,y){\n super(scene,x,y,'pig1',1,100);\n this.setScale(0.1);\n this.scene.anims.create({\n key: 'piganim',\n frames: [\n {key : 'pig1', frame : null},\n {key : 'pig2', frame : null},\n {key : 'pig3', frame : null},\n {key : 'pig4', frame : null},\n {key : 'pig5', frame : null},\n {key : 'pig6', frame : null},\n {key : 'pig7', frame : null},\n {key : 'pig8', frame : null},\n {key : 'pig9', frame : null},\n {key : 'pig10', frame : null},\n {key : 'pig11', frame : null},\n {key : 'pig12', frame : null},\n {key : 'pig13', frame : null},\n ],\n frameRate: 8,\n repeat: -1\n })\n\n this.play(\"piganim\");\n }", "createSpriteAnimations() {\n const haloFrames = this.anims.generateFrameNames('haloHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Halo_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'haloHit', frames: haloFrames, frameRate: 60, repeat: 0 });\n\n const sparkFrames = this.anims.generateFrameNames('sparkHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Spark_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'sparkHit', frames: sparkFrames, frameRate: 60, repeat: -1 });\n }", "init() {\n // création d'une variable nommé img spécifique à la class (this.)\n this.img;\n // on indique que la variable img est un élément html de type <img >\n this.img = document.createElement(\"IMG\");\n // on indique une source d'image à la variable img\n this.img.src = \"../assets/sprite1.gif\";\n // on place notre img dans l'id ImageFondEcran de la page html\n document.querySelector(\"#ImageFondEcran\").appendChild(this.img);\n this.identityNumber = initIdNumber;\n initIdNumber++;\n this.img.id = this.identityNumber;\n // on donne à img une propriété css position qui a la valeur fixed\n this.img.style.position = \"fixed\";\n // on donne à img une width qui a la valeur 50 (pixels)\n this.img.width = \"50\";\n\n // // on donne à img une propriété css top qui a la valeur 90 pixels : position y de départ du sprite\n this.img.style.left = this.positions.x + \"px\";\n // // on donne à img une propriété css top qui a la valeur 200 pixels : position x de départ du sprite\n this.img.style.top = this.positions.y + \"px\";\n }", "constructor(x,y)\n{\n //calling the constructor of base class\n super(x,y,50,50); \n this.image = loadImage(\"sprites/enemy.png\");\n}", "function Sprite_Picture() {\n this.initialize(...arguments);\n}", "create(){\n \n this.add.image(400, 288, 'menu');\n \n let jouerButton = this.add.image(this.game.renderer.width / 2 +0.5 , this.game.renderer.height / 3 - 0.5 , 'jouerButton').setDepth(1);\n\n jouerButton.setInteractive();\n\n jouerButton.on(\"pointerdown\", () => {\n this.scene.start('Niveau1', {x : 960, y : 540});\n })\n \n let optionButton = this.add.image(this.game.renderer.width / 2 +1 , this.game.renderer.height / 3 - -95.5 , 'optionButton').setDepth(1);\n\n optionButton.setInteractive();\n\n optionButton.on(\"pointerdown\", () => {\n this.scene.start('Parametres', {x : 960, y : 540});\n })\n \n // AJOUT ANIMATION DU JOUEUR -----------------------------------------------------------------------\n \n this.anims.create({\n key: 'left',\n frames: this.anims.generateFrameNumbers('dude', { start: 1, end: 3 }),\n frameRate: 8,\n });\n\n this.anims.create({\n key: 'right',\n frames: this.anims.generateFrameNumbers('dude', { start: 4, end: 6 }),\n frameRate: 8,\n });\n\n this.anims.create({\n key: 'reste_right',\n frames: [ {key: 'dude', frame: 4}],\n });\n\n this.anims.create({\n key: 'reste_left',\n frames: [{key: 'dude', frame: 3}],\n });\n \n this.anims.create({\n key: 'shoot_left',\n frames: [{key: 'dude', frame : 0}],\n })\n \n this.anims.create({\n key: 'shoot_right',\n frames: [{key: 'dude', frame : 7}],\n })\n \n \n // AJOUT ANIMATION SBIRES ----------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"sbire_marche\",\n frames: this.anims.generateFrameNumbers(\"sbire\", { start: 1, end: 3 }),\n frameRate: 10,\n repeat: -1,\n });\n \n // AJOUT ANIMATION BOSS --------------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"boss_marche\",\n frames: this.anims.generateFrameNumbers(\"boss\", { start: 1, end: 3 }),\n frameRate: 10,\n repeat: -1,\n });\n \n // AJOUT ANIMATION VAUTOUR --------------------------------------------------------------------------------------\n \n this.anims.create({\n key: \"vautour_vole\",\n frames: this.anims.generateFrameNumbers(\"vautour\", { start: 0, end: 7 }),\n frameRate: 10,\n repeat: -1,\n });\n \n this.anims.create({\n key: \"sang\",\n frames: this.anims.generateFrameNumbers(\"sang\", { start: 0, end: 3}),\n frameRate: 10,\n });\n \n }", "constructor(x, y) {\n this.sprite = 'images/Heart.png';\n this.x = x;\n this.y = y;\n //Resize image\n this.width = 25;\n this.height = 42;\n }", "constructor(params) {\n\n \tsuper();\n\n this.params = params;\n // this.sprite = PIXI.Sprite.fromFrame('additiveTriangleParticle.jpg');\n // this.sprite = PIXI.Sprite.fromFrame('additiveHardParticle.jpg');\n this.reset();\n \n\n }", "constructor(sprite, x, y) {\n this.sprite = sprite;\n this.x = x;\n this.y = y;\n }", "constructor(x, y, speed, clownImage) {\n super(x, y, speed, clownImage);\n }", "create(scene) {\n\t\t// Hier weisen wir dem Yoshi Objekt das Bild eines Yoshi zu, die Formulierung wird noch vereinfacht\n\t\t//this.sprite.setImage(document.querySelector(\"#yoshi_img\"));\n\t\tthis.sprite._animation = new YoshiAnimation();\n\n\t\t// Hier setzen wir den Yoshi auf die obere linke Bildschirmecke\n\t\tthis.x = 100;\n\t\tthis.y = 100;\n\t\tthis.sprite.scale_x = 4;\n\t\tthis.sprite.scale_y = 4;\n\n\t\tthis.setBoundingBox(-48, -48, 96, 112);\n\t\t//this.sprite._render_bounding_box = true;\n\n\t\tthis.has_collision = true;\n\t\tthis.sprite._render_bounding_box = true;\n\t}", "constructor(game, x, y, type, prize) {\n Object.assign(this, {\n game, x, y, prize, type,\n });\n\n this.bounce = false;\n\n this.velocity = 0;\n\n this.startTime = 0;\n\n this.animation = [];\n\n this.animation.push(null);\n this.animation.push(new Animator(ASSET_MANAGER.getAsset('./sprites/bricks.png'), 16, 0, 16, 16, 1, 0.33, 0, false, true));\n this.animation.push(new Animator(ASSET_MANAGER.getAsset('./sprites/coins.png'), 0, 80, 16, 16, 4, 1 / 8, 0, false, true));\n this.animation.push(new Animator(ASSET_MANAGER.getAsset('./sprites/bricks.png'), 48, 0, 16, 16, 1, 1, 0, false, true));\n\n this.BB = new BoundingBox(this.x + PARAMS.BLOCKWIDTH / 8, this.y, (PARAMS.BLOCKWIDTH * 3) / 4, PARAMS.BLOCKWIDTH);\n this.leftBB = new BoundingBox(this.x, this.y, PARAMS.BLOCKWIDTH / 2, PARAMS.BLOCKWIDTH);\n this.rightBB = new BoundingBox(this.x + PARAMS.BLOCKWIDTH / 2, this.y, PARAMS.BLOCKWIDTH / 2, PARAMS.BLOCKWIDTH);\n this.topBB = new BoundingBox(this.x, this.y, PARAMS.BLOCKWIDTH, PARAMS.BLOCKWIDTH / 2);\n this.bottomBB = new BoundingBox(this.x, this.y + PARAMS.BLOCKWIDTH / 2, PARAMS.BLOCKWIDTH, PARAMS.BLOCKWIDTH / 2);\n }", "constructor(x, y, image, speed)\n {\n this.xPos = x;\n this.yPos = y;\n\n this.sprite = image;\n this.xDest = random(10, width-10);\n this.speed = speed;\n this.destroyed = false;\n }", "constructor(stage,position){\n\t\tthis.stage = stage;\n\t\tthis.position = position;\n\t\tthis.myImage = new Image();\n\t\tthis.myImage.src = '/rotated_door.png';\n\t}", "function initSprites(img){\n\ts_player = [\n\t\tnew Sprite(img, 977, 0, 1035-975, 100),\n\t\tnew Sprite(img, 860, 0, 918-860, 100),\n\t\tnew Sprite(img, 918, 0, 975-918, 100)\n\t];\n\ts_star = [\n\t\tnew Sprite(img, 120, 800, 160, 260),\n\t\tnew Sprite(img, 490, 800, 160, 260)\n\t];\n\ts_background = new Sprite(img, 20, 0, 814, 600);\n\t\n\ts_pumpkin = [\n\t \tnew Sprite(img, 860, 126, 120, 100),\n\t \tnew Sprite(img, 1024, 114, 140, 112),\n\t \tnew Sprite(img, 1174, 96, 142, 181),\n\t \tnew Sprite(img, 1364, 96, 239, 248)\n\t];\n\n\ts_bat = [\n\t \tnew Sprite(img, 18, 646, 150, 82),\n\t \tnew Sprite(img, 196, 614, 130, 100),\n\t \tnew Sprite(img, 342, 618, 132, 102),\n\t \tnew Sprite(img, 500, 660, 143, 78),\n\t \tnew Sprite(img, 670, 666, 97, 123),\n\t \tnew Sprite(img, 790, 666, 64, 126),\n\t \tnew Sprite(img, 854, 674, 66, 126),\n\t \tnew Sprite(img, 934, 668, 125, 107),\n\t \tnew Sprite(img, 1080, 642, 160, 70)\n\n\t];\n\n\ts_demon = [\n\t\tnew Sprite(img, 1346, 802, 125, 85),\n\t \tnew Sprite(img, 1500, 796, 130, 100),\n\t \tnew Sprite(img, 1632, 816, 118, 70),\n\t \tnew Sprite(img, 1784, 808, 128, 74),\n\t \tnew Sprite(img, 1342, 930, 126, 83),\n\t \tnew Sprite(img, 1490, 926, 108, 93),\n\t \tnew Sprite(img, 1640, 920, 130, 65),\n\t \tnew Sprite(img, 1780, 936, 123, 75),\n\t];\n}", "function Sprite_Icon() { this.initialize(...arguments); }", "function init(){\n bk = new Sprite(game.images.bk, game)\n bk.scale = 0.5\n turkey = new Sprite(game.images.turkey, game)\n turkey.scale = 0.4\n turkey.setVector(2,45)\n zombie = new Sprite(game.images.zombie, game)\n zombie.scale = 0.15\n zombie.setVector(2,-45)\n crosshair = new Sprite(game.images.crosshair, game)\n crosshair.scale = 0.3\n logo = new Sprite(game.images.logo, game)\n f = new Font (\"30pt\" , \"Quicksand\" , \"white\", \"black\")\n pew = new Sound(game.audios.pew)\n gobble = new Sound(game.audios.gobble)\n chomp = new Sound(game.audios.chomp)\n oof = new Sound(game.audios.oof)\n bk_two = new Sprite(game.images.bk_two, game)\n bk_two.scale = 1.5\n \n game.state = startScreen;\n}", "constructor(x, y) {\n super(x, y, 100000, false);\n super.loadImage(\"Graphics/Bush.png\");\n }", "function initialisationOfImages() {\n thread_anim_object = getChildName(\"thread_falling_anim\");\n weight_obj = stage.getChildByName(\"weight_container\");\n thread_anim_object.visible = false; /** Initial visibility of thread animation */\n stage.getChildByName(\"weights\").x = 366.5; /** Initial horizontal postion of weights */\n stage.getChildByName(\"weights\").y = 600; /** Initial vertical postion of weights */\n stage.getChildByName(\"weights\").alpha = 0; /** Initial visibility of weights */\n}", "constructor() {\n this.load = 4;\n this.composite = document.createElement(\"canvas\");\n this.composite.width = 320;\n this.composite.height = 192;\n\n this.composite_light = document.createElement(\"canvas\");\n this.composite_light.width = 320;\n this.composite_light.height = 192;\n\n this.img = new Image();\n this.img.src = \"images/character.png\";\n this.cloth = new Image();\n this.cloth.src = \"images/cloth1.png\";\n\n this.lightmap = new Image();\n this.lightmap.src = \"images/character_lightmap.png\";\n\n this.clothlight = new Image();\n this.clothlight.src = \"images/cloth1_light.png\";\n\n this.inventorySize = 20;\n\n this.loaded = false;\n\n let loaded = () => {\n this.load--;\n if (this.load <= 0) {\n this.composite.getContext(\"2d\").drawImage(this.img, 0, 0);\n this.composite.getContext(\"2d\").drawImage(this.cloth, 0, 0);\n this.composite_light.getContext(\"2d\").drawImage(this.lightmap, 0, 0);\n this.composite_light.getContext(\"2d\").drawImage(this.clothlight, 0, 0);\n this.sheet = new SpriteSheet(this.composite, 32, 48);\n this.lighsheet = new SpriteSheet(this.composite_light, 32, 48);\n\n this.animations = {\n \"stand\": [\n new Animation(this.sheet, [0, 1, 2, 3], 0.5, true),\n new Animation(this.sheet, [10, 11, 12, 13], 0.5, true),\n new Animation(this.sheet, [20, 21, 22, 23], 0.5, true),\n new Animation(this.sheet, [30, 31, 32, 33], 0.5, true)\n ],\n \"walk\": [\n new Animation(this.sheet, [0, 4, 5, 4, 0, 6, 7, 6], 0.5, true),\n new Animation(this.sheet, [10, 14, 15, 14, 10, 16, 17, 16], 0.5, true),\n new Animation(this.sheet, [20, 25, 24, 25, 20, 27, 26, 27], 0.5, true),\n new Animation(this.sheet, [30, 34, 35, 34, 30, 36, 37, 36], 0.5, true)\n ]\n }\n this.animations_light = {\n \"stand\": [\n new Animation(this.lighsheet, [0, 1, 2, 3], 0.5, true),\n new Animation(this.lighsheet, [10, 11, 12, 13], 0.5, true),\n new Animation(this.lighsheet, [20, 21, 22, 23], 0.5, true),\n new Animation(this.lighsheet, [30, 31, 32, 33], 0.5, true)\n ],\n \"walk\": [\n new Animation(this.lighsheet, [0, 4, 5, 4, 0, 6, 7, 6], 0.5, true),\n new Animation(this.lighsheet, [10, 14, 15, 14, 10, 16, 17, 16], 0.5, true),\n new Animation(this.lighsheet, [20, 25, 24, 25, 20, 27, 26, 27], 0.5, true),\n new Animation(this.lighsheet, [30, 34, 35, 34, 30, 36, 37, 36], 0.5, true)\n ]\n }\n this.loaded = true;\n }\n }\n\n this.img.addEventListener(\"load\", loaded);\n this.cloth.addEventListener(\"load\", loaded);\n this.lightmap.addEventListener(\"load\", loaded);\n this.clothlight.addEventListener(\"load\", loaded);\n\n\n\n\n\n\n\n\n\n this.dir = 0;\n this.tilePos = { x: 5, y: 5 };\n this.realPos = { x: 5 * 32, y: 5 * 32 };\n this.state = 'stand';\n\n this.buff = document.createElement(\"canvas\");\n this.buff.width = 32;\n this.buff.height = 64;\n this.btx = this.buff.getContext(\"2d\");\n\n this.lightBuff = document.createElement(\"canvas\");\n this.lightBuff.width = 32;\n this.lightBuff.height = 64;\n this.ltx = this.lightBuff.getContext(\"2d\");\n\n this.tempBuff = document.createElement(\"canvas\");\n this.tempBuff.width = 32;\n this.tempBuff.height = 64;\n this.ttx = this.tempBuff.getContext(\"2d\");\n\n\n this.renderer = new Renderer(32, 64, ['shader-fs', 'shader-vs']);\n\n this.level = 1;\n this.str = 10;\n this.dex = 10;\n this.int = 10;\n this.sight = 96;\n\n this.fullHp = 10;\n this.hp = 10;\n this.maxHungry = 10;\n this.hungry = 0;\n\n this.inventory = [];\n\n this.msg = null;\n this.msgTime = 0;\n }", "constructor(x, y) {\r\n super(x, y, 512, 1, 99, 500);\r\n super.loadImage(\"Graphics/ParasiteEnemy.png\");\r\n super.loadDamageTakenSound('Audio/ParasiteEnemyDamageTaken.mp3');\r\n }", "function UI(x,y,width,height,restingy)\r\n{\r\n\tthis.width = width;\r\n\tthis.height = height;\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.restingy = restingy || y;\r\n\tthis.open = false;\r\n\t\r\n\tthis.sprites = new Array(7);\r\n\tthis.sprites[0] = new Image();\r\n\tthis.sprites[0].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWEjYV221d+QAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAnVSURBVHja7VtdSFRdF17j2KhZjuNfFP6NMxpaaVpXiZohEfGCJF68KoJIUReBN99HEkQ3RdFHKhWNWpES6dtFGopl6aiJYGKZQmGUaGEGipk6o+Lv813p68ycmbPP/FjWfuCAnrPPOmutvZ+z1z6zHxkRgTg4OAThxlPAwcEJwsHBCcLBwQnCwbGBcBc6CfB1O8efB5lMxmcQDg5eYnFwcIJwcGxCggjVcRv9DFf4sBFx/cm1/+qxKQlSUlJCXl5eVFJSwgceh9Ox+lGop7qa3v7zz+YjSGVlJel0OqqoqGAO9ldIOMfmQU919eYssXp7e2nbtm2Ul5dHMpmMent7Jc0IdXV1FB8fT56enqTRaOjSpUu0tLRk0tZ8ih0YGKATJ05QUFAQeXh40IEDB+jRo0dWn/nq1SvatWsX6XQ6yT6sti8uLqaQkBByc7OekqqqKkpISCBPT0/asWMH5ebm0vfv39euf/z4kTIzM8nf35+USiVlZGTQ+Pj42nWpcRERlZeXk1qtJoVCQZGRkVRWVmYRX1lZGWm1WlIoFKTVaunOnTsWfSLmO0ue/tgZzvxYj4KCAlRVVQEAbt68iYKCAtjC+vs7OjoQGxuLjo4OzMzM4NOnTzh69CguX74s2H4VCQkJuH79OiYmJjA/P4+uri5kZGQI3lNbW4vg4GC0tLQ45ENqaiq+fPliM66YmBjo9XoYDAaMjIwgOzsbWVlZa21iY2PR0tKC2dlZTE5O4uzZszh58iRzXOaor69HeHg42traYDAY0NbWhrCwMJP4ampqEBwcDL1ej+npaej1egQHB6Ourk6S7yx5ciUmQZjEv3H1VFejp7oaGwkhLtgkyMLCAvbu3Yv5+XkAwMTEBEJCQrCwsMBEkLS0NHR3d5tcHx4ehlartUmQ7du3Y3h4WPQZt27dwr59+zAwMOCwD319faLJ6+npMTk3OjoKf39/q/dMTU0hODiYOS5zJCUlob6+3uRcXV2dSXyHDh1CbW2tSZuamhokJiZK8p0lT64mxypBJkEbTg67CFJbW4vz58+bGMnKyrLoEGuDMyAgAHK5HHK5HG5ubpDJZCAiuLm52SRIYWEhAgICcPr0aVRWVuLbt28Wz7h48SIOHTqE6elpp/iw+hKwFdfy8rLNZ33+/BkZGRkIDAxcy6VcLmeOyxwqlQo/fvwwOTcxMWHyTJVKhYmJCYs2KpVKku8seXI1OcyJYuas6fErECQ9PV3wpvT0dCaCeHp6ig4CshJsX18frl27hszMTKhUKhQVFZnc09raiqCgIDQ0NLjMB5Y2688fPnwYhYWF+Pr1KxYXFzE3N2dxn624XEkQZ/TVRpRWVhwVPn4mQcbGxqBUKjE1NWVRNiiVSoyNjYkmPTExETqdzqZT7u7uWFpastlmcHAQSqXS4hnd3d3YuXMnqs2mY6k+OIsg3t7eMBgMa/+/fPnSpm3zuFhKrPr6eosS68mTJyZtamtrLUosZ/TVRpRXzORwAVEkEaS4uBg5OTmChnJyclBcXCya9ObmZvj5+aGiogLj4+MwGo1obm7G8ePH19pERESgsbHRpAQ4duwYXrx4AaPRCIPBgNu3b+PgwYOCz3j//j1CQkJQWlpqtw/OIkh8fDyKioowMzOD169fIzo62uS6WFxCi3S1Wo329nYYjUa0t7dDrVZbLNJDQ0PR2toKg8GA1tZWhIaGWizSndFXG0EWyeRwIkkkESQuLg5NTU2ChpqamhAXF8c0kNra2pCamgpvb294eXkhNTUVzc3Na9cfP34MtVoNuVy+dm9DQwNSUlLg6emJgIAAZGRkYHBw0OozhoaGoNVqcfXqVbt8cBZBenp6kJCQAIVCgdDQUNy4ccPkulhcQigtLUVYWBi2bNkCrVaLkpISKBQKkzY6nQ4ajQbu7u7QaDQoLy+X7DtLnlw0ANeOSawbgwLHfwQOZ5JEyCcZCWjS7f2hbWlpiXx8fGh2dpb/8uUidHZ2Un5+PvX392+67SRimASR0qzZfxls/+/fget0H526F6u7u5uio6P5KHYicnNz6d27dzQ7O0tdXV105swZys/P32ybrUh0+iCiwweJ4g9II4er4e4sQ3K5nKKioqisrIyPaiciLS2NsrKyaHBwkMLCwujUqVNUUFCw6eJgGexpb6QTw1mzh1VuO7PE4uCwBldtQoz/+2+XloGcIBybljTOJAcnCAfHz16ks36t+Bm2OHgf2AMuueX4rQnoqH2nE8SZ5Rkv9Th+6RlEJpORTqejiIgI8vDwoNjYWOrs7KQHDx5QVFQUbd26lZKTk2loaEiQsWICIbHr622xin5YBEZiMZeVlVFkZCQpFArSaDQWSkprAisxwZGUeK29Be3pExbfiIju379PGo3GJHdiELNrS0RmTTDHYpd1PDjlRU1WdvMSEZKSktDf3w+DwYBz587B19cXycnJJuf++usvwe0LYgIhKcIoYhD9sAiMWLYbhIWFrdlY3dv0/PlzmwIrFsGRlHitbQmxp09YfGtsbDTJ3WrctnLHYldMRCZkn1XkJjYeWLcR2b3dnYjQ399vsdXa/Jyvr6+gQ2ICIVZhFKvoh0VgxJKk9Rv9VnfHpqSk2BRYsQiOpMRrKw9S+4TFt+TkZMG4beXOHpGVuYhMyD6ryI1FwObj4+NagqysrFgYETon9LeYQIhFGCVF9MOin2BJkpANPz8/mwIrFsGRlHht5UFqn7D45ufnJzl3LHbFRGRC9llFbmLjAQB2797tEEHcWGpye78MXLlyhfR6PWk0Gqqvr6c9e/ZQcXEx83WLBZPbr/PRTaFQmPxvNBppeHiYlpaWaHl5mVZWVggALS8v2x0vEdHKyorDfcLimz0fRFjs5uXlUVRUFL19+5YWFxdpbm7O5Lq9dlnHw4cPH1y7BmEpA8TuYRUIWRNGsb5dWQRG9pZYycnJNn2xR3BkHq+/vz9GR0dN2rx588bhPmHxzZ4Si8WumIhMSDDniMiNHNj2bleJ5QhBxARCUoRRLAlhERiJJdHaIv3Zs2c272cRHInFm5WVhezsbIyMjMBoNKKlpQUxMTEO9wmLb0+fPpW8SGexKyYiExLMOSJyk9LXP50gYgIhKcIo1oSICYw6OjpM5KhC9tYLkNRqNe7du8eUdDHBkVi84+PjyM3NRWBgIBQKBfbv34+HDx863CesYqi7d+8iPDx8LXelpaWiA0zMrpiITEgw54jIzdkE+e33YpkLjI4cOUIXLlyg1NRUq2su/gMl/1X/t91qIiYwamlpsUoODg5zuP9uAf0uAiOOX2RWIb7dnYPjzymxODicCU4QDg5OEA4OThAOjo1ZpHNwcPAZhIODE4SDgxOEg4MThINj4/F/Nyu7UWJF0wgAAAAASUVORK5CYII=\";\r\n\tthis.sprites[1] = new Image();\r\n\tthis.sprites[1].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWEwY2p45wTwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAABS2SURBVHja7V15dFRVmv/VmqoEErIjCQlZRAl7YLoFGiJIO562F416emI36riMzhwcerr7jPZxbE8f5bicJq4jiys9rWIrIIlExCwQwo4YImFJIAGyQpLKUlWp1Hvv3t/8EYgUWaqKRKTt9zsnp5L3vnfvd797f/fe777vqxgAEDp06BgQRt0EOnToBNGhQyeIDh06QXTouIIwD3SR1P12Hf84IAGDATAYDPoKouMfaeCzHxEAQAg5vBVEh47vAy6sCF6VMBkBj1fCajGi2ythtRpgtxrQ0uGGERZEhVt0H0THP8aqISSheCXaO73wqgJCSJiMEiEWA0IsBowJM0HzqjhRU4/i0r1QFTco5XdDkIv3dYP9frXPQH8v+l5tNrtSkJKQkuhyeqEJwuWRaD5H7NjthMfphYUqhMEEs4mgBBxOBVU19fiq/DDmzMjA2OgImM2m4Ani9Xrx7LPPYvLkyQgLC0NUVBRuu+02FBUV6R2m4zt3rIWQ6PFqcHWrUCVgtZphMRsRHkaMTTBhzGgNRocDljO10Lq98KgGnG1zo/ZMI5qbGpE57TokjhsLo8l4eT7IQw89BEVR8PHHHyM1NRVdXV0oKSnB008/jZtuuumyHKXvi8On47uBlITBAHR6iFEhhMFgwOhQKyQlTCEmAAIGmGABMSNWQfgHf4FTADLnHrRYLGhqb4fbo2DKpCTERkfAHIAXzkt/LsBut7O9vZ1D4fjx47zjjjsYFRXF8PBw3n777Wxpaem7f3F5l/6+atUqpqen02KxMDU1le+8806/8letWsW0tDRaLBampaVxzZo1Adc/VNsuxdtvv83U1FRaLBamp6dz1apVg+peXV3N2267jbGxsbRarczMzOS6deuCsom/tgdqn02bNnHGjBkMCQlhamoqn376aaqqGpQuubm5TExMpMFgCLjcQGw2UpCSFEKyxyvY6eyhpmrsUQRJSZIUmqDXq1JRtAtPkBRU3d0UeYX88v1Srt94gnu+OsZNRdu5/1AV2zuc/eoZaLwMSZCUlBTu3LlzSOWnTZvG4uJidnd3s6Ojg0uXLuWDDz4YEEGSk5O5bds2Op1OlpSUMCkpiZ9//nmfzIYNG5iYmMiioiJ2dXWxqKiIiYmJzMvLu6z6B8OWLVs4YcKEfroMpntmZiZXrFhBh8NBr9fLvXv3Mjs7Oyid/LU9EJmysjJOmzaNZWVldLvdrK6u5s0338zly5cHpcvChQt5+vTpoMoNxGbDJQVJCkl2uCUVVdCrCJIqSUFS65MVQlBVNSqKRkVRzj8n6SbZ3uLkl5Wt/L+NFfyscBf3flnJ1rbOAesMmiAbN25kTEwM77rrLr788svctWsXNU0bsmGdnZ1MTEwMiCAXD/QL9WVlZfX9PXfuXG7cuNFHZsOGDZw3b95l1T8YFixYMKAug+k+evRo1tXVBdzZA+nkr+2ByCxevJj79+/3kamrq2N6enpQuhw6dMhHJpByA7HZcKCovQzp7tHoVXsJIaWklL2fvmSSVFWNQgj29Hjo6fZQ1STPdSo8eaaNBytP8dMvyri5cBebz7UNWmfQBCHJ1tZWrl27lkuXLuXMmTOZkpLCPXv29N0/deoUs7OzGRsb2/e8yWQKiCCXbt8cDgejoqL6/o6MjKTD4egnExkZeVn1D4aoqKgBdRlM98cff5wxMTF8+OGHuXbtWjY2Nvo8G4hO/toeiExMTAxNJhNNJhONRiMNBgMB0Gg0BqWL1+v1qSeQcgOxWbAQQtKrCHpU0ukRlFQppDhPAkEhBDWt9/NSaJpGITQqikpHh4fNrd2sqXNwf3kVtxbv5V8+KGBzi2PI+gfigt9j3ujoaNxzzz149dVXcfDgQSxfvhwPPPBA3/377rsPEydOxFdffQVVVeHxeCCEuGJO20jUH6wD/uyzz6KoqAhpaWnIz8/H5MmT8eKLL15xm7hcLtTV1UHTNAghIKXsfQ9wUV2B6GK1WoMudyQPLaTsPZXq9AAwECajwCibEaARBl44jTSi90CSEEL2q18S0KQRGk3QYERnlwudne1o72hH07kWLJw/C/ExkZd3QBOoIzvQDB4WFkan8xuHZ/v27UOuGv62EAsWLPDZYn3yySf9ZC7eYvmr32w2+90WBrvFuhQ1NTWMiIgIyib+2h6IzLx587hy5coh2xZM/wRT7khtsTxeQY8i6VV7/Yzz68E3DrhQfbZUUvb6G5r2zSoiSXo0ssOlsa1TYV1zFyurz3BjwXa+smYdG5paAtIl6C1WVlYWP/zwQzY3N1NRFFZVVTEnJ4f33ntvn8zMmTOZm5tLt9vNAwcOcNKkSQETZCAn9LPPPvPxN5KSklhSUuIjc3HH+Ks/NTWVW7ZsGXBZvoCCgoKgnPRbbrmFW7dupcvlotPp5Ouvv87Zs2cHZRN/bQ9EprCwkFFRUXz33XfZ2tpKl8vFwsJC/uQnP7ms/gmm3EBsNtTEoopecrg9Wt8gl1JSCOFDCCH6b6mklH0EkSR7NLLDI3nW0cO6pk4era7j5i/K+MobH7I+QHJcFkGKiop4++23MzIykna7nddeey3/8Ic/0O1298kcPHiQmZmZtFqtTEpK4iuvvBIwQVauXMm0tDSazWampKTwrbfe6qf0xTIDHfP6q3/9+vVMSUmhyWQacnZ78803OWHChICOeTdv3sysrCzabDbGxMQwOzubNTU1QdnEX9sDtc+2bdu4cOFChoWF0W63c+HChSwsLLys/gmm3EBsVlZW1u9ARUrS1SOoar0rge9q8Q05LnwKIc/LXUIwVaMmJFXRW15rl8ozzV08frKJWwr3cvXbG7npszJ2dHYPiyAGDJCTrr8U+/bf7vuzcSAyV+sL1QvRC4sWLcKTTz6JhQsXoraxBY3NbZg99XqYTYDJ6Cv7jT8i+9puMBhgMBj6rl0sK4SEKgEhAK8i4FVU9PQoqDh8GPUNTYiNisLE9GTMmJo+rKgLnSA6QUYUGgHzINE9H+UVItRuw60/njtolNNApBFCwmAAjEZjn9OsahIer4QmCEVRoaoCR44cw8nTpzD5unSYTWYkjovHhKQ4nSA6Qa4OOLq9+PSIE/XbChA1LhGP3L1oAJIUYWxsJH6YORUWq+X8yZToCw0ke8ffBTJcGI9CSJjNJpC9JHRLQOlWIVUNmpT4uqISZ07XIzFpLMYnJMIeYsK1qQnDjtvTw92v0riuv8dJqrHFgaLcJ7Hh9RUoLy1F7ec7+8nc+bNFaHV04cChI1AV9fwRrQndPRoAOfAsbjDAYDhPFAJeAagKIFQBIQRqTtSgsbEBUVERmJ6RhpgxdkSGh4xIm3SC6BgxuF09GJ80DvGjRuH3a/+MhL+tQ9e2vf0G+89vmY82RzsqKqugKAJOtxe1Z9px/ExP3+RA9s/PUFUJISWEogKKCoMBOHGyFqdP18NmC8GiBbNgC7GhvsmBUaPDR6RNekahjhFB9YlaWKSGZ557Ei0T4hD7xmrg7dfgtoagy2JB+LzMPlmTyYR/XjQPm7eWwmw2IWn8WHRLC+obPPBSxbTkMSC18x6AAYAADRIKzdA0QBOAEBqazp1FbWMzNK+C2366ACEhdlRUViMx4RqEXPLyUyfIt+AHfBf45JNP8Oijj6K+vv6q0S8QWyWMi0NoaBgAIPaRh6F4e2DQBCLXvIR2qxUuqwWj/mlqn7zVasEti3+EwpIDsFhMSIqKR4tTovyEB9QsmJ4Wep4cEgSh0QKhKNAkoGkCbpcLp07WorurC7/8xU0YEzkGVSeboUkBm82EkUoD0rdYVxl+97vf4cMPP7yqfZCB/IQL5OgjwLJlkDk5EBnXY8zKFej54CN4j5zwkbHbQrBoQSYOVJxAc10tUqPdMJuBgydd+LrWff78yAgpzRASEOwlh6JoOFRxGKdPn0ZO9s2IjhoDR7sbbW0tGBsXh7joMSPWVp0gVxlOnTqFOXPmfC/aEvL44zD9yy9hmJiG6FW5CNm+E1pLh49MWJgdP/3xXBw704RupxPpMWbERtjg8Xjh8XjP55j3HucKSWiawIEvv0R93RncvyQbkRGj4VU0NDa3QEoJu90+om0w+psp3n//fWRmZsJmsyE+Ph5LlixBW1ubj9zq1auRnp4Oq9WK9PR0vPHGG4OWWVdXh7Fjx/pc+/Wvf+1zehMXF4f6+vo+HV588UWMHz/e5+gvLy8PM2fOhM1mQ1paGp555hlomuZTbl5eHmbPng2bzYbk5GS89dZbg+q1Z88ejBs3DitXrgQAVFVV4c4770R0dDQiIiKQnZ2N1tZWn2fWrFmDlJQUWK1WXHvttVi9enW/2TUQPS+2t5QSRqPRpxx/9h0srfjSnPpA+vKdd95BWlqaT5uGhSeehOtnv4AhPhL8n9/Du203VIfTRyQ6KgKLb5yDxmYHIq3tmJIoMSsjGjabBZoEemiAUCUsFgv27N2HpoY63PurOxAeHg4hAUeXgu5uD0aFhWJs7JgRJ/qgoSYAmJGRwaKiIjqdTjY0NPDuu+9mTk5OUElNl2LSpEmsqKggSZ48eZIGg4ENDQ0kyX379nHSpEnDTuj59NNPec011zA/P59Op5PV1dVcsmTJgCEWGzduZGJiIouLiwNONMrPz/eJRdq2bRuTk5P7hVr403OgcIdL81/82ReDhIsE25eBJkEhwIBEKSU7VcG1X+znuf/6LTkunmJcIl0btlJt75/R5+hwckvJXu7cV8mG5t4Yqh6vYFsP2a2S6/OK+b+r/8qOjm8SnnoUwcrjp1m6q5yV1Y3UhLzscHsEG4sFgAcPHvQp5OzZs4yOjh5WUtOyZcuYm5tLkszNzaXRaOSbb75JkvzTn/7E3/zmN8NO6JkzZw4/+ugjvwPxtdde49SpU3nixImgkp7mz5/P/Px8H5m8vDwf+11OQtOlgy8Q+wZKEH99GWiEbnh4eFADr8bh5F+37Kbj0aXkNbEUKel05ZdQ7XT3k20+18YtxXu458tKnmk4R69G1p1zcd36LXx9zV/Z0tLiE8x4qt7Bnfu+5o49FWwfoLxvnSADRcFeLBNIUtNA0bO33nprX8TwAw880JeyesMNN7CgoGDYCT12u51tbUNnjz311FOcO3cuu7q6+t33l2gUGRnpN2EoED39ESQQ+wZKEH99GWgS1HXXXRf04Dve2sX3C8rYtfQ/yJhIapOm0LmljKLT1U+2pbWDByuqWVT2JQ8dO8m/bSri6rfeY319HTVNvShUXvLI8Xpu31XOyqpGerxixAni10m/eN8/UsjKysLevXtx9uxZHDhwAMuXL8eOHTvQ3NyMiooKZGVl+Z6IXEZCTyDO2o033ogTJ05gx44d/e6NRNJTIHp+W5ADfBGav74M9OTs2LFjQeszMXo0ps2agoJbfgnPHXfC1FyH0Mf+E8bPtwNOt49sTHQEUpPHITYmDiXbytDZ2YUbF8xHXFwcTCZzn54dnU50dnXCACBmjA0268iP1WGXOGnSJJSWlvpc2759OzIyMgZ9JjQ0FNOnT8cf//hHzJ07F/Hx8Zg+fTqeeuopzJkzB6GhoUPWOWvWLGzatGlImWnTpqGkpMQvQTZv3owHH3wQ69at87m3f/9+PPHEE0hISIDZbMa+fft87k+ZMgVlZWU+13bu3Bm0niNh3+joaJw7d85Hpry8POi6pk6d2m+y2L59+4gNtslxEbg+cwpKbvk51DvvgvFUNfDC00DRLsDt8ZGNCA9F5GgbkhOT8YNZU5E8fiwsFitIQkoJt0eFo6sbiqoiOjoGo8PDv7XJZsgtlr+lO5CkpoHw/PPP02g09vkiK1asoNFo5AsvvODXIQwkoaekpIQJCQncvHmzXye9srKS48eP56pVqwJONMrPz2dKSgpLS0vpcrlYWlrKlJQUH5lA9AzESfdn35ycHN59991saGigy+VicXExMzIygu7L4SZBBYrDDY3c+vEGav96LxlmJ+cvJD8tJl2+PkTtmUaW7a1gT4/i4/hLIdja1sFd+w+zpOwr1jd3jMgXRVyWDxJIJ/pLahoI5eXlBMCjR4+SJI8cOUIALC8vD6gzAknoWb9+PWfMmEGr1coJEyb4JBxdWm5tbS3T09P53HPPBZRodOE7u5KTk/sShl566SVardag9fTXXn/2bW1t5ZIlS/q+p2vGjBl87733Lqsv/SVBjQRB2hxdfKegmMV/+5hyya9Im5Wc8yNy5Zukx0OSrDhazYLSXfT0ePs971UEq2pbWLrnEA8cqqIm+K0RRA93H0Hs3r0b999/P44ePaobYxComsDhI6dRVbkPnshopDlaMH9zPrB+A/CDOcC//Tt2T0jBGWcP7vrxD2A02+BwKujqFrgm0ooQqwkehThWVYP29g7ExcYiY+J4GI3Djy0Z6H2SHqw4DCxZsgSPPfYYUlNT8fXXX+ORRx7B/fffrxtmCFjMJkyeOA7m8EU41tQGLTkZu2nCHE0FNmwC3F1In/1DyMdehstsRTgIewhRftKLTqeKhBgTTCYrFMULi8WCxIT4ESHHYNAJMgwsXrwYOTk5qKmpQXJyMh566CEsW7ZMN4wfnKUN3nAbfpEUB6sR2GMMwUFBZKoasLkAsU3nYB01FlWPP4WMWANCrSG44XoLdh5xwdvjRqitG0LTEBYWjhDrtzuE9S2WjisCid5EJyGAPWeJBQkGXHwqW3b8DEbv243pG98H8guAqGi4su9Ed+5riLYDJgAuj8SBKicsJhXS1Yi0CQkYNzZ65Migb7F0fBcQBE66gHg7EGEFFiUCl+6KfnRdErZJ4rCmYYqqAp9txagP1iIEEj2vvAqLxYRQuxHXJ4eipakJWlgY7H5eB+hbLB1/FzAZgAQ7EGa+sG0Z2GdYcN14FOEmALZeknxRDMuqlTArXniez4WMHI2QEDOEUGC3WTEm3K4TRMf3A6Gmi7cyA8sYjUbcODEeW7kYZiNxvckMfPY5DG+/DZM0wfPb/0bP+DQoZhuiQu24Ev8aSSeIjiuCQDP8LCYDFk8cja9ifgqMAmA2A3mfIuTdNxDS0QHbr+7D17HxmJI+88roPZCTrkOHjvOrmm4CHTp0gujQoRNEhw6dIDp0XEH8PwCoa6UanHm5AAAAAElFTkSuQmCC\";\r\n\tthis.sprites[2] = new Image();\r\n\tthis.sprites[2].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWFC4VXfu5EgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAbbSURBVHja7ZtfSFNvGMefbXbcklK3WURrTs80Mhi6vClptoiI6KbRjcKgi6Cb7uumu6KrErpoWUlGFER/DM2y2JzBIKIyujIyrBADYa4/ZxbStu/vquHRbefd/POb9nxg4HnPOXuf99n7fc/7Ht+vjohADMNkRM8pYBgWCMOwQBiGBcIwy0hJpkKA1+3Mv4dOp+MnCMPwFIthWCAM848LJNOckFkdc/tVIRDuoCxsfoIwDLM0Auns7CSn00mSJJHT6aSrV6/Ou6a3t5eam5vJaDRSdXU1dXV1pc99+PCBjhw5QhaLhcrLy8nn81E0GhUepQOBANXW1lJpaSm5XC568eIF3bx5k+rr62nt2rXk8Xjo06dPecWs0+no9u3b5Ha7yWg00saNG8nv99PU1FT6mo8fP9Lhw4dpw4YNVFpaSjt27KA7d+6onh46nS79mZ2LpqYmMhqNJMsynTlzhhKJhKrujo4O2rJlC+n1+qzt1opPK6+F5k4rfiKi69evkyzLJEkS1dXVUWdn54oXCeZ+/jL777k8ePAANpsNoVAIP3/+RCgUgs1mQ29vb/qaR48eYdOmTejr64OiKBgdHYXf70+fd7lcGBwcxK9fv/D9+3ecOHECx44dE6qfiLB7926MjIxAURScPHkSFRUV8Hg8qrJDhw7lFTMRoaGhAaFQCIqiYGJiAu3t7Whra0tf43a7cf78ecRiMczMzODly5fw+Xw5445EInC5XIhEIpiensbo6Cj279+Ps2fPqu7zer348uVLznZrxSeS13xzJxL/wMAAHA4HhoaGoCgKwuEw7HZ7zt+xmMikhYIFsmvXLvT09MwTTUtLS/p4586duHv3rnCAP378gM1mExbIyMhI+jgWi2Usq6ioyCtmIsLw8LDqmsnJSVgslvTxunXrMD4+njO2uezbtw+vXr1SlY2Pj8PpdKrue/funeaPqBWfSF7zzZ1I/B6PRzXYAEBPT8+/KZDKykrEYjFVWSwWQ2VlZfrYZDJhamoq63d8/vwZPp8PVVVV6boNBoOwQFKplFBZPjETEZLJZM5Of+rUKVitVhw/fhw3btzA169fNQVitVphMBhgMBig1+uh0+lARNDr9ar7ZmZmNH9ErfhE8ppv7kTiN5vN+Pbt27z8rmSBLOki3WQy5Tx/9OhRqq+vp7dv39KfP3/o9+/flEwmF/S2aDHeIGWb///l3LlzFAqFSJZl6uvro+3bt1NHR0fOe+LxOI2Pj1MikaBkMkmpVIoAzGuvJEkLjk8kr/nmTiT+1bpFqeAp1sOHD+c9TmdPV/bs2YN79+5l/Y6ysjIoipI+fv78uXD9mc5plYnEnK3OXLGMjY2hvLw8fVxSUoJEIqG6pqWlBYFAQHMEExnltMoLyatWmUj8PMWaM3e32+0Ih8OqBdnsBIXDYWzevBn9/f0ZF+lNTU24cOECpqen8fr1a2zbtm1JBSISs0gHPHDgAJ49e4Z4PA5FUXDp0iU0Nzenz9fW1mJgYEA1FQoGgzCbzeju7kY0GkU8HkcwGMTBgwcXXSCF5FWrTCT+x48fCy3Si1UwBQkk1/lAIABZllFSUgJZlnHlypV5ld6/fx+NjY2QJAkOhwNdXV3pc8PDw3C73ZAkCXa7HRcvXlxSgYjELNIB+/v70draCqPRCKvVCp/Ph7GxMVWba2pqYDAYVPcNDQ3B6/WirKwMJpMJXq8XwWBw0QVSSF5FyrTiB4Br167B4XBgzZo1cDqduHz5sup7IpGI6old7ALRUQZPOm93Z5aKvXv30unTp8nr9a6IHRAsEIbJIRDeasIwS7XVhGFYIAzDAmEYZlULZCk8GMvh62DvCAuEYSGxQP5v+NU0s+wCKXZzTrYRNpehKRtaRp9sI/js8oWYuOrq6kiSJJJlmbq7u7lnFtPgSzm2mhSrOSfXtggtQ9NcRIw+JLDFo5C2EhGqq6vn1f306dMVsX9pNUGF7MUqVnNOro6qZWgqZBeqqEDybSsRZay7tbVVVbZ+/XruwcUokGI15yzE0DQXEaOPqEDybSsRZazbbDaryrZu3co9uBgNU8VqzslFvoamQhf4qVRKqF2L8Qbq/fv3vBgoxjVIsZpzFmJoKmSKZbFYMDk5qbrmzZs3C25rtimWx+PhIX2lGqaoCMw5CzE0zUXE6NPW1ob29nZMTEwgHo9jcHAQDQ0NiyKQTIv0J0+e8CJ9NQjk/zTnFGpoyoSW0ScajcLv96OqqgqSJKGxsRG3bt1aFIHMNnHV1NSoTGUsEDZMMUzR7lbgrSYM8y9sNWEYFgjDsEAYhgXCMCwQhmGBMMwqJuP/QRiG4ScIw7BAGIYFwjAsEIZZfv4DJXc4xK1xfV4AAAAASUVORK5CYII=\";\r\n\tthis.sprites[3] = new Image();\r\n\tthis.sprites[3].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWExUlQt9wAwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAi+SURBVHja7ZtLTBNdFMdPWyhQIkhpYWFFYIqmqCDoQiEBSYgx6obqBhRjookujJq4ITHRmGiMJtTEhYCi4AITFgLBiKiUh7IRDKKJD3wggghqqY+2IoHy/xZfbBiYtjMtT7m/ZBJm5s49596eP/femXtkRARiMBiCyFkXMBhMIAwGEwiDwQTCYMwiAUIXAbZuZyw+ZDIZG0EYDDbFYjCYQBgMJhAeNTU1tHz5csG54nyat85EPb7YEfOMr/7Pp99gzgQik8l4R0hICHEcR0eOHCGr1TrrgXb8+HGqrKz8518iLJbgWxC/BQlsNfkbgDKZjBeMf/78oZ6eHjKZTPThwwd68ODBtAaFt8BXKBQ0NjY270aQ6RasUJ2+2JkJ32aj7vn2jwmTj79M/HsiQ0NDUKlUvGvFxcXgOA6BgYHgOA5Xrlzh3e/q6sLOnTuhVqsRFhaGnJwcfPv2zWXHnQ8TfRG6782uuzZMbmdFRQVSUlIQFBSEqKgo7NmzBxaLhffM9evXER8fj8DAQOj1ehQXF7utv7e3F9HR0bxru3fvdv09Pj4OrVaLvr4+nj/u+kKsj5PbWFxcDL1ej8DAQMTHx6OsrMxjP5hMJuh0OshkMp/avZAR6ntJAhkeHkZXVxcOHTqE7Oxs1/WqqirodDqYzWb8+vULZrMZOp0OtbW1rjJJSUlobGzE79+/8ePHDxw+fBgHDhzwGsiegl2MXbECSUxMhNlshs1mQ39/P/Ly8pCbm+sqU19fj9jYWDQ3N8Nms6GpqQkxMTEe/TYYDHj+/DkA4P3795DJZOjv7wcAtLW1wWAwuPVHyF9vPgo9s2LFiik+37t3z63drKwsfPz40a92LyqBCB06nQ69vb2ucmlpaaiurp4SvOnp6W6d+fnzJ3Q6nV8CEWNXrEA6Ojp49798+YLIyEjXeUZGBk94AFBdXe3R76NHj8JkMgEATCYT5HI5SktLAQCnT5/GsWPHJAnEm49Czwj5nJmZ6dbus2fPeOV9abcfwej2WBAjyMjICF68eIEdO3Zg7969rusRERGwWq28slarFREREa7znp4eGI1GaLValx2FQuGXQMTYFSsQp9PpsYxarcb379+n2PLkd11dHbZv3w4AyMzMxP79+2E0GgEAGzduRF1dnSSBePNR6J6Qz2q12q3dkZERXnlf2r1QReK3QP4yMDCApUuXSgrUzZs3o6CgAJ8+fcLo6CiGh4dF2ZoJgTidTlG2J16PiIiQHCgOhwMajQaDg4MIDQ3F4OAgtFotBgYGoFKp4HA4JAlETJ/4K5DJiGm3L4EsVRxzJRCfvoMAIIVC4To3GAz08OFDXpmWlhZKTEx0nbe3t9OJEydo2bJlFBAQQG1tbbzyAQEB5HQ6Jfkhxm5kZCR9/fqVV6azs1Nym9euXUuPHj2aYssTKpWKkpOT6eTJk5SWlkbR0dGUnJxMp06dok2bNpFKpRJ8zpe+cIeQz2vWrJnWdgPgHWJjaKHg0xRr4gK7qqoKMTExaGpq4i3kJs5dU1JSYDKZ4HA48OTJExgMBl798fHxqK+vF5xGeFqke7Obm5uLvLw89Pf3w263o7GxEYmJiZJHkLq6Op8Wq+fPn4dcLnetRQoLCyGXy3HhwgW3toT6wtcRRGiRfvfuXdEjiK/t/ldGEEmL9L+vCgsKCnjTAwAoKioCx3EICAgQfN3a0dGB1NRUKJVKxMTE4NKlSzxbt27dQlxcHBQKhaRg8GbXYrEgPz8fWq0WSqUS69atQ0VFhWSBAEBpaSliY2Mlve7s7OwEEeHVq1cAgJcvX4KI0NnZ6daWUF/4KpCJ/RMXF4dr1655XIsJ4Uu7Z0IocyEQjx8KGYz5tINgpuOSbXdnsO0107kXi8GYtYXwPJ21MIEw2AjCBMJgIwgTCIONIPNLIAshb8GTj7OV7MSY2RFkct7SdP4eAeynmTvhLvbEr8ntn3jubzbkdPUvm2Ix5qWA5ss/D48CeffuHeXk5FBUVBQFBQXR+vXrqbKyklfm5s2blJqaSsHBwRQdHU35+fk0NDTkuv/mzRvatWsXRUZGUnh4OBmNRrJYLLxOKikpoYSEBFIqlcRxHJWXl0/xpba2llJSUig4OJg4jqMzZ87Q2NgYr0xZWRlxHEdKpZISEhKopKTEawd485+IqKSkhPR6PSmVStLr9XT16lWPdYrxlbFwpqduP+mnpqaisLAQVqsVIyMjePz4sWu7ttgkHjGJUt6SelpbW5GUlITW1lY4HA68ffsWW7ZswdmzZ/1K7BHjv9SkLDG+it29/A8nIYnaRuKpDM3A1hSSuhdryZIlrpRQdxVKTeIRSpTyltSTnZ2N9vZ2Xpm+vj7o9Xq/EnvE+C81KUuMrwAQFhaGxQz5sFmRZniPlmSBFBQUQKPR4ODBg7hx4wY+f/4sOYlHTKKUt5wFjUYDhUIBhUIBuVwOmUz2/159udyvxB4x/kvNORHjKwCsWrUKi535JA6f8kHOnTtHZrOZOI6j27dv0+rVq+nixYv8RYzc8zp/3759tHLlSnr69CmNjo7S8PCw5FwHu91OfX19NDY2Rk6nk8bHxwkArx5fF3Xe/JeKGF+JiF6/fs0WIHP4anha1iCT6e7uRnh4uKRt4qGhobDZbK7zlpaWKVushaZGGRkZrvP09HQUFRV5VL+vUyxv19PS0lBTUzOlXndTLDG+MvwfReZFPsjWrVtx//592O122Gw2XL58GRs2bJAUYN4SpUhEUk9DQwPUajXKy8thsVhgt9vR0NCAbdu2+ZXYI8Z/MUlZE8uL8XUxLdL/AbG6F8idO3eQmZmJ4OBgaDQaGI1GdHd3Swowb4lSJCKpBwCam5uRlZWF0NBQhISEICsrCw0NDX4l9pDIJCRvSVmTy4vxlQlkYQhkzhOmFsMXZcbC/SbDvqQzGGyrCYOxQAXCplcMJhAGgwmEwWACYTCYQBgMxv8IfgdhMBhsBGEwmEAYDCYQBoMJhMGYff4D478zdHHV5pAAAAAASUVORK5CYII=\";\r\n\tthis.sprites[4] = new Image();\r\n\tthis.sprites[4].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWFC8MIIsgkwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAdhSURBVHja7ZtbSNNvGMef32Zza5WnZYRrc27ZCSQPNzmcDSQivGl0YzAIKwoKugmq2+hwEWl0kYe0siCwg5bTkHC5xBAprCBYZK1iJAW6yk1DnH7/Vw1/23Q/989D+Xxg4O99t+d9fN5993vf7f0KRARiGCYqMi4Bw7BAGIYFwjAsEIaZRxKiNQK8b2eWHoIg8B2EYXiJxTAsEIZZ4gKJtiZkuFaLRiB/c9H5DcPwEothFrNAampqyGQykUKhIJPJRFevXo14TktLCxUUFJBSqSS9Xk/19fWhvnfv3tGePXsoLS2NkpKSyGaz0eDgoKSx379/T7t376b09HRKTEyk/Px8amxsFN09BEEIPaTmLAgCVVZW0rp160gmk4XaqqqqKCsrixITEyknJ4d6enro1q1blJ2dTcuXLyeLxUIfP36cMefa2loyGAykUCho/fr1VFNTE3Gnk1LT69evk9FoFMWRWptoxJqHaDX5Pbe5ubmkVCrJaDTSmTNnKBgM/nMiQfjjN1P/DqepqQlarRZOpxPDw8NwOp3QarVoaWkJPae1tRVr166Fw+GA3+9Hf38/7HZ7qD8nJwdPnjzB6Ogofvz4gaNHj+LAgQOSxs/Ly8PFixfh8/kwNjaG3t5e2Gy2GV8rJWcigtVqxefPn0VtRUVFcLvd8Pv9OHHiBJKTk2GxWERtpaWl0+brcDiQmZkJl8sFv98Pl8sFvV4vylNKfu3t7aI4nZ2d0Ol0ojixahOOlHkIr0l3dzdycnLQ3d2NkZER9Pf3Y8eOHTh79iz+VqJpIW6BFBYWorm5OeINaDabQ9fbtm3D3bt3JSf48+dPaLVaSeOvXLkSXq93xn82npyJCK9fv46I5Xa7Q9c+ny9qW3Jy8rT5FBUVweFwiNpaWlpEeUrJz2KxiAQDAM3NzaI4sWoTzzyE16SkpATPnz8XtXm9XphMJhYIAKSkpMDn84nafD4fUlJSQtcqlQpDQ0PTxvj06RNsNhtWr14dGlsul0sa/+TJk9BoNDh06BAaGhowMDAQUyBSciYijI2NRcSanJyU1DZTvb5//x4x9tTXSMkvNTU1ZpxYtYlnHsJrotFoIJfLIZfLIZPJIAgCiAgymeyfEsicbtJVKtWM/fv27aPs7Gx6+fIljY+P069fv2hiYkJS7PPnz5PT6SSj0UgOh4O2bNlClZWVfyRvhUIh6VuxhfimTMoxoNnWRso8hNckEAiQ1+ulYDBIExMTNDk5SQAkz98/vwcpLCzEgwcPIm71U5cD27dvx71796aNoVar4ff7Q9dPnz6VPH44Ho8HSUlJoeuEhAQEg8FZ5xxtzP/TNtMSy+FwRCyxYuUnZYkVqzZ/Yh7MZjOqqqrwL/FHl1hNTU3Q6XTo7OwUbRanTl5nZycyMjLQ1tYWdZOem5uLiooKjIyM4MWLF9i0aZPk8Xfu3InHjx8jEAjA7/fjypUrKCgoCPVnZWWhvb0dExMTs8p5rgTicDhgMBjQ1dWFQCCArq4uGAyGiE16rPwePXoUc5MeqzbhxDMPHR0dSE1NxY0bNzA4OIhAIICOjg7s2rVraQlkpv6qqioYjUYkJCTAaDSitrY2YtD79+9j69atUCgUyMzMRH19faivr68PeXl5UCgU0Ol0uHz5smSBtLW1obi4GEqlEhqNBjabDR6PRzSuwWCAXC6fVc5zJRAAqK6uhl6vx7Jly2AymXDp0iUoFArRc6TUtK6uDpmZmaE41dXVorFj1SaceOfB5XLBarVCrVZDpVLBarWio6PjnxKIQFE86XzcfX7o6emh8vJycrvdXIxFevqCf0mfR+x2O71584ZGR0ept7eXDh8+TOXl5VyYRUwCl2D+KCkpobKyMvJ4PKTX6+ngwYN07NgxLsxivqvwEotheInFMHHBAmEYFgjDLDGBsCGKYYEwzGIWiBQjze3btykvL4+USiWtWbOG7HY7DQ0NieLEMgpNNeQIgkAZGRk0NjYmihEIBCg9PZ18Ph/PGjOvTHuURIqRZvPmzXA6nfD7/fjy5Qv27t2LsrKyWRmFKMyQU1pairq6OtExgGvXrmH//v1xHWRkmDk5iyXFSNPX1yd6zrdv35CWljYroxCFGXJcLhc2btwo8lsUFxfj1atXoetVq1bxjDILKxApRpqpp2WjfbpLMQpRFENOfn4+Hj58CAD48OEDLBaLqH/Dhg08o8zCGqakGGmmmvj/D+GGnOPHj9OFCxeIiKihoYGOHDki6n/79i0vjpmF3YPEa2ia2i7FKBQtzvj4OPR6PZ49ewaz2Yzx8XH+iGMW1xIrXkPT1HYpRqHp4lRUVMBoNOL06dOz9l4wzJwLJF4jTXh7LKPQdHGGh4exYsUKfP36lQXCLB3DlFSjUGtrK925c4du3rzJC2FmQU5nzMsv6fEYhQYGBujUqVN07tw5njlmwZgXw9RsjUKCIJBarabGxkbSarU8S8zC3VWIDVMMs7BLLIb5W2GBMAwLhGFYIAwzP5t0hmH4DsIwLBCGYYEwDAuEYeaf/wBjGnILM0ZqXwAAAABJRU5ErkJggg==\";\r\n\tthis.sprites[5] = new Image();\r\n\tthis.sprites[5].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wIWFCsqlupgagAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAXDSURBVHja7ZzLTxNBHMdnbbtGDiQtwYtrS1sioUEjHjVqTDh6QU8lYgzRhAORgxcT/4fGeLH4PHHwIJg2UQwpjyohPoKaaJSLIgkHBOuDl0Tw64lNl852py1QEr6fZBN2Oju/33dmvtmZaYMmhIAghEjZxS4ghAYhhAYhhAYhZAtxywoB7tvJzkPTNL5BCOESixAahBAaxMKjR4/E/v37pWvF7bRu3Yo2nepspz7arv1cskE0TbNce/bsEeFwWFy+fFlkMpkt74ArV66IBw8e8BBhm0ye9fMj+yqXno3uC01IfmqyNgE1TbNMxj9//oiJiQkRi8XEly9fRH9//4Z2ttPEd7lcYmVlZdu9QTbasIW2uRk5lDOurF3VWKXkZDevsP5aI/vvbL5//46KigpLWTweRzgchsfjQTgcxq1btyyfj4+P4+zZs/D5fKisrERzczNmZmbMOHY5ZOci+9wprp2G9Tq7u7vR2NiI3bt3Y+/evTh37hxmZ2ctz9y7dw+hUAgejwe1tbWIx+O27ReSXywWg2EY0DTNLIvH46itrYXH40EoFML9+/el+dv1XTH6urq6UFNTo6zPSbvTuMv059OjokElp3x6JJe6QZaWljA+Po729nY0NTWZ5T09PTAMA6lUCr9//0YqlYJhGEgkEmadQ4cOYWBgAIuLi/j58yc6Ojpw8eLFgoStr6MSV9UgkUgEqVQKc3NzmJqaQktLC6LRqFmnr68PNTU1GBoawtzcHAYHB+H3+/PmrZrfqVOn8PXrV0tZIBDIifX06VPb/EvVl0wmLfqGhoYQCARKNojKuMv0y2I5aSiLQWSXYRiYnJw06x09ehS9vb05k+PYsWO2yfz69QuGYZRkEJW4qgYZGxuzfD49PY2qqirz/sSJE5aJDQC9vb1581bN7927dzm5yWKdPHmyaIM46Tt+/DiSyaSlTiKRcDSI3VXIuMv0y2I5aQCAysrK8r1BlpeX8eHDB5w+fRrnz583y71eLzKZjKVuJpOB1+s17ycmJnDmzBlUV1ebcVwuV0kGUYmrapDV1dW8dXw+H378+JETK1/eqvktLy/nxJXF8vl8RRvESZ/X6y1Yn8qYqYy7TL8slpMGAKirq9tQgxR0zKvruohEIuL27dsikUgUtAG6cOGCOHDggHjz5o34+/evWFpaEqurq2XZWP/79y/3OG9X/q7YzE2wruubf1y5qzwn+irjrqpfRcOnT5/K/z0IAOFyucz7+vp6kU6nLXWGh4dFJBIx71+9eiWuXbsm9u3bJ9xut3j58qWlvtvtLtgwKnGrqqrEt2/fLHXevn1bsOaDBw+KZ8+e5cQqNT87ZLEaGhqkdYvpu/U0NDSI58+fW8pGRkZKnmBO475ZejaSopZY2Rutnp4e+P1+DA4OWjaV2evoxsZGxGIxLCws4PXr16ivr7e0HwqF0NfXJ32N5tukO8WNRqNoaWnB1NQU5ufnMTAwgEgkonRal13++PHjojbpTvnZLSdkm/QnT55In5P1XaH6kskkgsEg0uk05ufnkU6nEQwGS15iOY27rA0nPflyKOsmfe3I8erVq1hYWLA0fvPmTYTDYbjdbulx5tjYGI4cOQJd1+H3+3Hjxg1LrIcPHyIYDMLlcil3hkrc2dlZtLa2orq6Grqu4/Dhw+ju7i54AgHAnTt3CjoGVcnPziDZzwWDQdy9e9f2OVnfFaMvHo8jEAiY+q5fvw5d10vapDuNuyw3Jz1baZC8XxSSnc3o6Khoa2sTHz9+3LG/SOCPFYlJa2ureP/+vVhcXBQvXrwQ7e3toq2tbUf3iZvTgqzR1NQkotGo+Pz5swgEAuLSpUuis7NzR/cJl1iEcIlFSHHQIITQIITQIITQIITQIITQIITQIITQIITQIITQIIQQGoQQGoQQGoQQGoQQGoQQGoQQGoQQGoQQGoQQGoQQYof0v5oQQvgGIYQGIYQGIYQGIWTr+Q92S8dGfJkKhAAAAABJRU5ErkJggg==\";\r\n\tthis.sprites[6] = new Image();\r\n\tthis.sprites[6].src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAyCAYAAAAZUZThAAABhklEQVR42u3cO6rCQBhA4SzAUrAQWzdgJwQFV2BhlUqIVSp7N5EyXZZi4z7cSS4RlOSaiN4nON+B06X6h0NIZpIoiqKKZK+GQAqEFAgpEPJ/AwFCRCCAQACBAAIBBAIIBFdOp1OVpulD62sgkOAoiuLp9+/z+VwoAgnrzvGVjaosywxPIO/PdrttzXg4HFaz2azlZDIRiUDC5Hg83ua7XC57r9vtdpdYRqNRa03yPDdEgbw3ZVlefJbxeHxbkziODVAgaLLZbAQiEPSxWq0EIhB0cTgcWmsiEIEER9+m4WKxuFuT+uEdAgkqjmf2QerXweIQSNAP4H1Op1ODEohABoPB3aahu4ZABOIBXCAQiEAgEIHgJ2keXlyv1wYiEDRpHl585XwWBBIMrx5ehEAAgQACAQQCCAS/wPl8rvb7vT+XCASfw6iPtPveXCDoiKNr3nbSBYKqvTnoYyiBoIMkSXzzIRA84vrvK3cOgQACAQQCCEQgEIhAgO8EQlIgpEBIgZACIf/eD0qX8/tEI32xAAAAAElFTkSuQmCC\";\r\n\r\n\r\n\t\r\n\tvar min_spacing = 10;\r\n\tthis.aVspacing = 10;\r\n\tthis.amargin = width * 0.05;\r\n\tthis.aVmargin = height * 0.15;\r\n\tthis.achievements_per_row = Math.floor((width - this.amargin * 2.0) / (200 + min_spacing));\r\n\tthis.aHspacing = (width - 2.0 * this.amargin - 200 * this.achievements_per_row) / (this.achievements_per_row-1);\r\n}", "constructor(m, s, a, b, c, d) {\r\n\t\tsuper(s,a,b,c,d);\r\n\t\tthis.file = \"Integrate.png\";\r\n\t\tthis.tic = 0;\r\n\t\tthis.maxTics = 58;\r\n\t\tthis.aniWidth = 960/5;\r\n\t\tthis.aniHeight = 960/5;\r\n\t\tthis.aniRowNumber = 5;\r\n\t\tthis.frame = 0;\r\n\t\tthis.fontSize = 128;\r\n\t\tthis.mon = m;\r\n\t\tthis.loadLock = true;\r\n\t\tthis.gfx = document.createElement(\"img\");\r\n\t\tthis.gfx.src = \"battle/\" + this.file;\r\n\t\tthis.gfx.onload = function() {this.loadLock = false;}.bind(this);\r\n\t\r\n\t\r\n\t}", "constructor(enemies) {\n //the player can have different player images\n this.sprites = [\n 'images/char-boy.png',\n 'images/char-cat-girl.png',\n 'images/char-horn-girl.png',\n 'images/char-pink-girl.png',\n 'images/char-princess-girl.png'\n ];\n this.horizontalStep = spriteWidth;\n this.verticalStep = tileHeight;\n this.enemies = enemies;\n this.reset();\n this.win = false;\n }", "function init()\n{\n //assets loaded in, main scene\n this.load.image('sky', 'assets/sky.png');\n this.load.image('ground', 'assets/concrete.png');\n this.load.image('star', 'assets/star.png');\n this.load.spritesheet('dude', 'assets/dude.png', { frameWidth: 32, frameHeight: 48 });\n //24, 48\n this.load.spritesheet('placeholder', 'assets/prototype_sprites.png', {frameWidth: 24, frameHeight: 48});\n}", "function Sprite_Picture() {\n this.initialize.apply(this, arguments);\n}", "exibe(){\n image(this.imagem, this.x1, 0, width, height); //exibe a imagem na tela\n image(this.imagem, this.x2, 0, width, height);\n }", "constructor(x, y, srcImage, speedX, speedY) {\n this._x = x;\n this._y = y;\n this._image = new Image();\n this._image.src = srcImage;\n this._speedX = speedX || 0;\n this._speedY = speedY || 0;\n }", "constructor(sprite, x, y) {\n this.x = x;\n // create positionX array that stores different horisontal coordinates\n // to display it in different places\n this.positionX = [0, 100, 200, 300, 400];\n this.y = 70;\n // create positionY array that stores different vertical coordinates\n // to display it in different places\n this.positionY = [80, 165, 250];\n this.sprite = sprite;\n // create Type array that stores different images file name\n // to display it in different colors\n this.type = ['orange', 'blue', 'green'];\n this.gemSelected = undefined;// To get wich index type array is selected\n this.gemCollected = 0;// To count gems collected by user\n }", "constructor(location, size, angle, image, bodyConstructor){\n this.size = size;\n this.image = image;\n this.body = bodyConstructor();\n }", "constructor() {\n // The image for the sprite\n this.sprite = 'images/enemy-bug.png';\n this.x = xStartPosEnemy;\n this.speed = speeds[Math.floor(Math.random() * 5)];\n }", "constructor(scene, x, y) {\n super(scene, x, y);\n this.scene = scene;\n this.sprite = this.scene.add.sprite(x+30, y, 'arrow');\n this.sprite.name = 'arrow';\n this.sprite.setOrigin(.5, -.5);\n this.scene.add.existing(this);\n\n }", "constructor(col,row,sprite){ //This assigns the value of the parameters defined in the playericon , but are an instance of selectors.\n super(col,row,sprite);\n }", "function PepsiMan(game, spritesheet) {\r\n this.animation = new Animation(spritesheet, 0, 0, 338, 540, 0.05, 14, true);\r\n this.jumpAnimation = new Animation(AM.getAsset(\"./img/jump.png\"), 0, 0, 801, 894, 0.08, 4, false, true);\r\n this.jumpInvincibleAnimation = new Animation(AM.getAsset(\"./img/jumpi.png\"), 0, 0, 801, 894, 0.08, 4, false, true);\r\n this.shootAnimation = new Animation(AM.getAsset(\"./img/shoot.png\"), 0, 0, 589, 594, 0.05, 4, false, true);\r\n this.shootInvincibleAnimation = new Animation(AM.getAsset(\"./img/shooti.png\"), 0, 0, 589, 594, 0.05, 4, false, true);\r\n this.invincibleAnimation = new Animation(AM.getAsset(\"./img/theboyi.png\"), 0, 0, 338, 540, 0.05, 14, true, true);\r\n //this.jumpAnimation = new Animation(AM.getAsset(\"./img/jump.png\"), 0, 0, 799, 894, 0.05, 5, false, true);\r\n this.jumping = false;\r\n this.jumpingInv = false;\r\n this.x = middle_lane;\r\n this.y = 150;\r\n this.groundY;\r\n this.speed = 8;\r\n this.game = game;\r\n this.Right = false;\r\n this.Left = false;\r\n this.shooting = false;\r\n this.shootingInv = false;\r\n this.fired = false;\r\n this.firedInv = false;\r\n this.stuck = false;\r\n this.invincible = false;\r\n this.multiplierActive = false;\r\n this.boosted = false;\r\n this.spike;\r\n this.currentTime = this.game.clockTick;\r\n this.prevTime = this.game.clockTick;\r\n this.prevTimeM = this.game.clockTick;\r\n this.ctx = game.ctx;\r\n this.boostInvincible = false;\r\n\tthis.boundingbox = new BoundingBox(this.x + 20, this.y + 50, this.animation.frameWidth - 290, this.animation.frameHeight - 530);\r\n}", "function Ammo(game, powerUpSprite , theX, theY, bUp, bDown, bLeft, bRight, bNW, bSW, bSE, bNE, scale, name, frate) { \r\n this.x = theX;\r\n this.y = theY;\r\n this.game = game;\r\n this.ctx = game.ctx;\r\n this.PowerUpAnimation = new Animation(powerUpSprite, 64, 64, 64, 1, 1, true, 1);\r\n this.hitBox = {x: theX, y: theY, width: 64, height: 64};\r\n this.name = name;\r\n this.BulletUp = bUp;\r\n this.BulletDown = bDown;\r\n this.BulletLeft = bLeft;\r\n this.BulletRight = bRight;\r\n this.bNW = bNW;\r\n this.bSW = bSW;\r\n this.bSE = bSE;\r\n this.bNE = bNE;\r\n this.scaleUp = scale;\r\n this.frateUpgrade = frate;\r\n \r\n}", "function MonObj(x,y,w,sprite,spritex,spritey,spritew,spriteh){\n\tthis.percx = x;\n\tthis.percy = y;\n\tthis.x = 0;\n\tthis.y = 0;\n\t//this.origy = x;\n\tthis.percw = w;\n\tthis.perch = 0;\n\tthis.w = 0;\n\tthis.h = 0;\n\tthis.sprite = sprite;\n\tthis.spritex = spritex;\n\tthis.spritey = spritey;\n\tthis.spritew = spritew;\n\tthis.spriteh = spriteh;\n\tthis.origspriteh = spriteh;\n\tthis.speed = 10;\n\n\tthis.clicked = 1;\n\t/*\n\tthis.imgbank = img;\n\tthis.currframe = 0;\n\tthis.aframes = aframes;\n\t*/\n\tthis.init = function(){\n\t\tthis.x = (hbm.canvasw / 100) * this.percx;\n\t\tthis.y = (hbm.canvash / 100) * this.percy;\n\t\tthis.w = (hbm.canvasw / 100) * this.percw;\n\t\t//this.h = (hbm.canvash / 100) * this.perch;\n\n\t\tthis.h = (this.w / 100) * ((this.spriteh / this.spritew) * 100);\n\n\t\t//this.y += this.actualh;\n\t\t//this.actualh = 0;\n\t\t//this.spriteh = 0;\n\t};\n\tthis.reveal = function(){\n\t\tif(!this.clicked){\n\t\t\t//this.spritey = Math.max(\n\t\t\t//this.actualh = Math.min(this.origh, this.actualh + ((this.origh / 100) * this.speed));\n\t\t\t//this.spriteh = Math.min(this.origspriteh, this.spriteh + ((this.origspriteh / 100) * this.speed));\n\t\t\t//this.actualy = Math.max(this.origy, this.actualy - ((this.origh / 100) * this.speed));\n\t\t}\n\t};\n}", "constructor({\n x = 128,\n y = 128,\n vx = 0,\n vy = 0,\n w = 24,\n h = 24,\n color = \"white\",\n assetImg = new Image(),\n isPlayer = false,\n hp = 0,\n isCollectible = false,\n POSES = [\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n ],\n } = {}) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.w = w;\n this.h = h;\n this.color = color;\n this.cena = null;\n this.mx = null;\n this.my = null;\n this.isCollectible = isCollectible;\n this.isPlayer = isPlayer;\n this.collected = 0;\n this.assetImg = assetImg;\n this.SIZE = 64;\n this.hp = hp;\n this.pose = 0;\n this.quadro = 0;\n this.POSES = POSES;\n }", "constructor(x, y, width, height, avalancheImg) {\n\n // Position\n this.x = x;\n this.y = y;\n // Velocity\n this.vx = 0;\n this.vy = 0;\n // Scale\n this.scale = 0.2;\n // Display properties\n this.width = width * this.scale;\n this.height = height * this.scale;\n // Image\n this.avalancheImg = avalancheImg;\n\n }", "constructor(x, y, healingValue, image) {\n //Position\n this.x = x;\n this.y = y;\n //size\n this.size = 50;\n //Properties\n this.healingValue = healingValue;\n this.isDrank = false;\n //Image of the potion to be displayed\n this.image = image;\n }", "constructor(x, y) {\r\n super(x, y);\r\n super.loadImage(\"Graphics/TarTrap.png\");\r\n }", "constructor(x, y,i) {\n super()\n this.x = x;\n this.y = y;\n this.connectionOpen = true;\n this.image = stars;\n this.iam = i;\n\n }", "function newSprite(){\r\n\tvar Sprite = {\r\n\t\tcanvas: 0, //canvas to hold this sprite - will be drawn to main canvas\r\n\t\tctx: 0, //context for sprite canvas\r\n\t\tx: 0, // X position of this sprite\r\n\t\ty: 0, //Y position of this sprite\r\n\t\tanimation: 0, //current animation for this sprite\r\n\t\tcurrentFrame: 0, //current animation frame for this sprite\r\n\t\twidth: 0, \r\n\t\theight: 0,\r\n\t\timage: 0, //image that is being drawn to the canvas\r\n\t\tcurrentStep: 0, //number of frames since this sprite's animation was updated\r\n\t\tis_ready: 0, //sprite has finished loading and can be used\r\n\t\tinitSprite: function(canvas, x, y, width, height, img_file){ //initialize sprite\r\n\t\t\tSprite.is_ready = false; //sprite not ready\r\n\t\t\tSprite.x = x;\r\n\t\t\tSprite.y = y;\r\n\t\t\tSprite.width = width;\r\n\t\t\tSprite.height = height;\r\n\t\t\tSprite.canvas = canvas; //canvas is created by Eperiment object and passed to sprite\r\n\t\t\tSprite.canvas.setAttribute('width', width);\r\n\t\t\tSprite.canvas.setAttribute('height', height);\r\n\t\t\tSprite.ctx = Sprite.canvas.getContext('2d'); //get canvas drawing context\r\n\t\t\tSprite.loadImage(img_file); // load image for sprite\r\n\t\t\tSprite.animation = standRight; //set initial animation set\r\n\t\t},\r\n\t\tloadImage: function(img_file){ //loads image to draw for sprite\r\n\t\t\tSprite.image = new Image(); //create new image object\r\n\t\t\tSprite.image.onload = function(){ //event handler for image load \r\n\t\t\t\tSprite.is_ready = true; // sprite is ready when image is loaded\r\n\t\t\t}\r\n\t\t\tSprite.image.src = img_file; //load file into image object\r\n\t\t},\r\n\t\tdrawImage: function(){ //draw image into sprite canvas\r\n\t\t\tSprite.ctx.clearRect(0,0,Sprite.width,Sprite.height); //clear previous frame\r\n\t\t\tif(Sprite.is_ready){ //do not draw if sprite is not ready\r\n\t\t\t\t//calculate values for sprite based on animation\r\n\t\t\t\tvar srcX = Sprite.animation.sX + (Sprite.currentFrame * Sprite.animation.width);\r\n\t\t\t\tvar srcY = Sprite.animation.sY ;\r\n\t\t\t\tvar srcWidth = Sprite.animation.width;\r\n\t\t\t\tvar srcHeight = Sprite.animation.height;\r\n\t\t\t\tSprite.ctx.drawImage(Sprite.image, srcX, srcY, srcWidth, srcHeight, 0, 0, srcWidth, srcHeight); //draw image\r\n\t\t\t\tSprite.stepSprite(); //advance animation\r\n\t\t\t\tSprite.moveSprite(); //move sprite\r\n\t\t\t}\r\n\t\t},\r\n\t\tstepSprite: function(){ //advance animation based on animation speed (step value)\r\n\t\t\tif(Sprite.currentStep >= Sprite.animation.step){\r\n\t\t\t\tSprite.currentStep = 0;\r\n\t\t\t\tSprite.currentFrame++;\r\n\t\t\t\tif(Sprite.currentFrame >= Sprite.animation.totalFrames){ \r\n\t\t\t\t\tif(Sprite.animation.loop){\r\n\t\t\t\t\t\tSprite.currentFrame = 0; //loop animation back to start\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSprite.currentFrame = Sprite.animation.totalFrames -1;\t//if loop not set, hold on final frame\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSprite.currentStep++; //advance step counter if step limit not reached\t\r\n\t\t\t}\r\n\t\t},\r\n\t\t/*Temporary move functions to move demo sprites. Ideally this code will be handled outside the Sprite object, so Sprite can focus soley on drawing and animation*/\r\n\t\tmoveSprite: function(){\r\n\t\t\tif(Sprite.animation.name == walkRight.name){\r\n\t\t\t\tSprite.x += 5;\r\n\t\t\t\tif(Sprite.x > Experiment.width)\r\n\t\t\t\t{\r\n\t\t\t\t\tSprite.x = 0 - Sprite.width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(Sprite.animation.name == walkLeft.name){\r\n\t\t\t\tSprite.x -= 5;\r\n\t\t\t\tif((Sprite.x + Sprite.width) < 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tSprite.x = Experiment.width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgoLeft: function(){\r\n\t\t\tif(Sprite.animation.name != walkLeft.name){\r\n\t\t\t\tSprite.animation = walkLeft;\r\n\t\t\t\tSprite.currentFrame = 0;\r\n\t\t\t\tSprite.currentStep = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgoRight: function(){\r\n\t\t\tif(Sprite.animation.name != walkRight.name){\r\n\t\t\t\tSprite.animation = walkRight;\r\n\t\t\t\tSprite.currentFrame = 0;\r\n\t\t\t\tSprite.currentStep = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tstopMovement: function(){\r\n\t\t\tif(Sprite.animation.name == walkLeft.name)\r\n\t\t\t{\r\n\t\t\t\tSprite.animation = standLeft;\r\n\t\t\t\tSprite.currentFrame = 0;\r\n\t\t\t\tSprite.currentStep = 0;\r\n\t\t\t}\r\n\t\t\telse if(Sprite.animation.name == walkRight.name){\r\n\t\t\t\tSprite.animation = standRight;\r\n\t\t\t\tSprite.currentFrame = 0;\r\n\t\t\t\tSprite.currentStep = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn Sprite; //returns newly created sprite object\r\n}", "constructor(player, number) {\n this.x = 0;\n this.player = player;\n this.size = this.player.totalHeight;\n this.color = this.player.hookColor;\n this.width = 10;\n this.speed = 8;\n this.isShot = false;\n this.number = number;\n this.damage = 1;\n this.throwSound = new sound('hookDeploy.mp3');\n this.hookBody = new Image();\n if (this.player.playerNumber == 1) {\n this.hookBody.src = \"assets/hook_body_P1.png\";\n } else {\n this.hookBody.src = \"assets/hook_body_P2.png\";\n }\n this.hookHeadImage = new Image();\n this.hookHeadImage.src = \"assets/hook_head.png\"\n }", "constructor() {\n super(1300, posição, 80, 80 ,imagemInimigo)//Equivale ao x,y,imagem... do Sprite\n this.velocidadeX = 5 * Math.random() + 3//Gera uma velocidade aleatória maior que 3\n }", "constructor(x, y, speed, fillColor, radius, aliensImage) {\n\n //Setting up the player's image variable\n this.aliensImage = aliensImage;\n\n //Position\n this.x = x;\n this.y = y;\n\n //Velocity and speed\n this.vx = 0;\n this.vy = 0;\n this.speed = speed;\n\n this.radius = 20;\n\n //Time properties for noise() function\n this.ty = random(0, 1000);\n\n this.health = 1;\n\n\n\n }", "createAnimation(key, repeat, frameRate, spriteSheet, animationName, yoyo) {\n this.anims.create({\n key: key,\n repeat: repeat,\n frameRate: frameRate,\n yoyo: (yoyo || false),\n frames: this.anims.generateFrameNames(spriteSheet, {\n prefix: animationName,\n suffix: '.png',\n //phaser3 will only load sprites it finds, so using 1-999 means it will catch all\n start: 1,\n end: 999\n })\n });\n }", "constructor() {\n super();\n this.sprite = 'images/enemy-bug.png';\n this.multiplier = Math.random() * 4 + 1.5;\n }", "constructor(x, y, image, scale) {\n this.x = x;\n this.y = y;\n this.image = image;\n this.scale = scale;\n }", "constructor(master_speed, speed_discount, scaling){\n /*\n @param ground_img: p5.js loadImage() object on which sprite will run\n @param master_speed: integer speed of sprite / ground floor\n @param speed_discount: the % of master speed this image should move\n @param scaling: the % of background images real size we should scale down by\n */\n this.scaling = 1 * scaling;\n this.x = WIDTH / 7;\n this.y = 0;\n this.y_floor = 0; // Y location when santa is on the current ground\n this.y_velocity = 0;\n this.y_acceleration = 0;\n this.speed_discount = speed_discount;\n this.speed = master_speed * this.speed_discount;\n \n this.animation_index = 0;\n this.frame_update_rate = {'Dead': 5, 'Idle': 5, 'Jump': 2, 'Run': 3, 'Slide': 5, 'Walk': 5};\n this.state_counts = {'Dead': 17, 'Idle': 16, 'Jump': 16, 'Run': 11, 'Slide': 11, 'Walk': 13};\n this.state = 'Run'\n this.animation_dictionary = this.createAnimationDict();\n \n this.height = this.animation_dictionary[this.state][this.animation_index].height * this.scaling;\n this.width = this.animation_dictionary[this.state][this.animation_index].width * this.scaling;\n this.onGround = true;\n this.alive = true;\n \n //Top left x/y, bottom right x/y\n this.hitbox = {'Run': [0.24, 0.05, 0.58, 0.91], 'Slide': [0.057, 0.178, 0.58, 0.91]}\n }", "function SPF_Sprite() {\n this.initialize.apply(this, arguments);\n}", "createBases (dataObj) {\n const textures_d = dataObj.dataBase.textures [dataObj.dataValues.p.textureName]; // ref texture:diffuse\n const textures_n = dataObj.dataBase.textures_n [dataObj.dataValues.p.textureName]; // ref texture:normal\n const d = new PIXI.extras.AnimatedSprite(textures_d);\n const n = new PIXI.Sprite(textures_n[0]);\n this.Sprites = {d,n};\n this.batchWithNormals(n,textures_n);\n \n }", "constructor(x,y){\r\n this.sprite = 'images/enemy-bug.png';\r\n this.x = x;\r\n this.y = y;\r\n this.speed = 550 + (Math.random()*450); //Random Speed for enemy movements on X Axis.\r\n\r\n}", "function Sprite(attr) {\n this.x = attr.x;\n this.y = attr.y;\n this.width = attr.width;\n this.height = attr.height;\n this.dx = 0;\n this.dy = 0;\n this.flipped = attr.flipped;\n this.held = attr.held;\n this.index = attr.index;\n this.images = attr.images;\n this.states = attr.states;\n this.update = attr.update;\n this.draw = function(context) {\n context = (context === undefined) ? ctx : context; \n var anim = this.states[this._state];\n if (anim.last === undefined) {\n anim.last = anim.img.width / this.width - 1;\n }\n if (this._frame != anim.last ) {\n this._frame += 1;\n } else if (anim.repeat) {\n this._frame = anim.start;\n }\n context.drawImage(anim.img, this._frame * this.width, 0, this.width, this.height, this.x, this.y, this.width, this.height);\n };\n //This is a pretty neat idea VV worth talking about\n this.set_state = function(state) {\n if (this._state != state) {\n var anim = this.states[state];\n this._frame = anim.start;\n this._state = state;\n }\n };\n this.collide\n\n this._state = attr.state;\n this._frame = 0;\n //this._idle = true;\n\n\n}", "constructor(pic, x, y) {\n this.pic = pic; //string\n this.x = x;\n this.y = y;\n this.img = p.loadImage(this.pic);\n \n }", "function init() {\n canvas = document.getElementById(\"presentation\");\n stage = new createjs.Stage(canvas);\n\n imgStaticPlayer = loadImage(\"./img/staticPlayer.png\");\n imgAnimatedPlayer = loadImage(\"./img/animatedPlayer.png\");\n imgGround[0] = loadImage(\"./img/grassRight.png\");\n imgGround[1] = loadImage(\"./img/grassMid.png\");\n imgGround[2] = loadImage(\"./img/grassLeft.png\");\n imgBridge = loadImage(\"./img/bridge.png\");\n imgLava = loadImage(\"./img/lava.png\");\n imgCloud = loadImage(\"./img/cloud.png\");\n imgTree = loadImage(\"./img/tree.png\");\n}", "constructor(x, y) {\r\n super(x, y);\r\n super.loadImage(\"Graphics/SpikeTrap.png\");\r\n }", "function start() {\n wagon = new sprite(30, 30, \"images/ferry.png\", 500, 150);\n board.start();\n}", "createImages() {\n this.room2_e_pressed = false;\n this.room2_papers_moved = false;\n this.returnDoor = this.add.image(113, 385, 'returnDoor');\n this.room2_background = this.add.image(768, 432, 'room2_one_lesson_BG');\n this.room2_character_north = this.add.image(768, 432, 'room2_character_north');\n this.room2_character_east = this.add.image(768, 432, 'room2_character_east');\n this.room2_character_south = this.add.image(768, 432, 'room2_character_south');\n this.room2_character_west = this.add.image(768, 432, 'room2_character_west');\n this.room2_E_KeyImg = this.add.image(this.room2_character_north.x+40, this.room2_character_north.y+40, 'room2_E_KeyImg');\n this.room2_activity1A = this.add.image(768, 432, 'room2_activity1A');\n\t// this.room2_activity1B = this.add.image(768, 432, 'room2_activity1B');\n\t// this.room2_activity1C = this.add.image(768, 432, 'room2_activity1C');\n\t// this.room2_activity1D = this.add.image(768, 432, 'room2_activity1D');\n this.room2_activity2A = this.add.image(768, 432, 'room2_activity2A');\n this.room2_activity2B = this.add.image(768, 432, 'room2_activity2B');\n\t// this.room2_activity2C = this.add.image(768, 432, 'room2_activity2C');\n\t// this.room2_activity2D = this.add.image(768, 432, 'room2_activity2D');\n this.room2_activity3A = this.add.image(768, 432, 'room2_activity3A');\n this.room2_activity3B = this.add.image(768, 432, 'room2_activity3B');\n this.room2_activity4A = this.add.image(768, 432, 'room2_activity4A');\n this.room2_activity4B = this.add.image(768, 432, 'room2_activity4B');\n\t// this.room2_activity4C = this.add.image(768, 432, 'room2_activity4C');\n\t// this.room2_activity4D = this.add.image(768, 432, 'room2_activity4D');\n\t// this.room2_activity4E = this.add.image(768, 432, 'room2_activity4E');\n this.room2_activity5A = this.add.image(768, 432, 'room2_activity5A');\n this.room2_activity5B = this.add.image(768, 432, 'room2_activity5B');\n\t// this.room2_activity5C = this.add.image(768, 432, 'room2_activity5C');\n\t// this.room2_activity5D = this.add.image(768, 432, 'room2_activity5D');\n\t// this.room2_activity5E = this.add.image(768, 432, 'room2_activity5E');\n\t// this.room2_activity5F = this.add.image(768, 432, 'room2_activity5F');\n this.room2_activity6A = this.add.image(768, 432, 'room2_activity6A');\n this.room2_activity6B = this.add.image(768, 432, 'room2_activity6B');\n this.room2_activity6C = this.add.image(768, 432, 'room2_activity6C');\n this.room2_activity6D = this.add.image(768, 432, 'room2_activity6D');\n this.room2_activity6E = this.add.image(768, 432, 'room2_activity6E');\n this.room2_wall_info_1 = this.add.image(305, 75, 'room2_wall_info_1');\n this.room2_wall_info_2 = this.add.image(768, 75, 'room2_wall_info_2');\n this.room2_wall_info_3 = this.add.image(1232, 75, 'room2_wall_info_3');\n this.room2_wall_info_4 = this.add.image(305, 790, 'room2_wall_info_4');\n this.room2_wall_info_5 = this.add.image(768, 790, 'room2_wall_info_5');\n this.room2_wall_info_6 = this.add.image(1232, 790, 'room2_wall_info_6');\n this.room2_floor = this.add.image(769, 433, 'room2_floor');\n this.room2_map = this.add.image(768, 432, 'room2_map');\n this.room2_notebook = this.add.image(768, 432, 'room2_notebook');\n this.room2_activityLocked = this.add.image(768, 432, 'room2_activityLocked');\n this.room2_help_menu = this.add.image(768, 432, 'room2_help_menu');\n this.room2_hole_activity = this.add.image(350, 540, 'room2_hole_activity');\n this.room2_hole_nextRoom = this.add.image(768, 432, 'room2_hole_nextRoom');\n this.rightArrow = this.add.image(1000, 650, 'rightArrow');\n this.leftArrow = this.add.image(600, 650, 'rightArrow');\n this.countCoin = this.add.image(40, 230, 'singleCoin');\n this.profile = this.add.image(40,150,'profile');\n }", "function Sprite_LayerGraphic() {\n this.initialize(...arguments);\n}", "constructor(canvas, ctx, w, h) {\n super(canvas, ctx, null, null, new Vector(w, h)); // always call super\n // setting fps\n this.times = [];\n this.fps;\n this.money = 100;\n this.income = true;\n this.intrest = 5;\n\n this.resizeX = 0;\n this.resizeY = 0;\n // map generation\n let a = new MapGen(3, 4); // [Thickness, Bends]\n this.map = a.generate();\n let b = new TerrainGen(this.map);\n this.map = b.load();\n\n // button init\n this.towerPressed = false;\n this.towerValue = 0;\n this.upgradePressed = false;\n\n // start frame loop\n prefetcher(getImageNames(), () => {\n // list of all sprites on the canvas\n this.walls = this.buildWalls(0);\n this.towers = [];\n this.interactions = [];\n this.buildListeners();\n\n a.path.splice(0, 0, [8,-2]);\n a.path.forEach((path) => console.log(path));\n\n this.waves = new Wave(this.canvas, this.ctx, a.path, this.wallSize);\n this.wavesStart = false;\n this.loop();\n });\n }", "function sprite (options) {\n\t\t\t\t\n var that = {};\n\t\t\t\t\t\n that.context = options.context;\n that.width = options.width;\n that.height = options.height;\n that.image = options.image;\n\n return that;\n}", "constructor(scene, x, y, sprite){\r\n\t\tsuper(scene, x, y, sprite).setOrigin(0.5,0.5);\r\n\t\tscene.add.existing(this);\r\n\t}", "constructor() {\n super();\n this._numOfEnemy = 0;\n this.fire = true;\n this._bulletImg = new Image();\n this._text = new objects.Label();\n // initialization\n this._player = new objects.Player;\n this._ememies = new Array();\n this._background = new objects.Background();\n this._playBackSound = new createjs.PlayPropsConfig();\n this._bullets = new Array();\n this._numOfEnemy;\n this._bulletImage = new objects.Button();\n this._player = new objects.Player();\n this._playerBullet = new objects.Bullet();\n this._tuto = new objects.Image();\n this._startPage = new objects.Image();\n this._bulletImg.src = \"./Assets/images/beam1.png\";\n //this._engine = this.EngineAnimation();\n this.Start();\n }", "constructor(ctx, posX, img) {\n \n }", "function SpriteAnim(options) {\n var timerId,\n i = 0,\n element = document.getElementById(options.elementId);\n\n element.style.width = options.width + \"px\";\n element.style.height = options.height + \"px\";\n element.style.backgroundRepeat = \"no-repeat\";\n // element.style.backgroundImage = \"url(\" + options.sprite + \")\";\n\n this.startAnimation = function() {\n timerId = setInterval(function() {\n if (i >= options.frames) {\n i = 0;\n }\n element.style.backgroundPosition = \"-\" + i * options.width - options.offset + \"px 0px\";\n i++;\n // if (options.elementId == \"balloon--animated\")\n }, options.rate);\n };\n\n this.stopAnimation = function() {\n clearInterval(timerId);\n };\n\n this.startAnimation();\n }", "constructor(x, y, speed) {\n this.sprite = 'images/enemy-laser.png';\n this.x = x;\n this.y = y;\n this.speed = getWild(100, 300);\n }", "preload() {\n this.anims.create({\n key: \"idle\", \n frameRate: 10, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [0,1]\n })\n });\n\n this.anims.create({\n key: \"idleLeft\", \n frameRate: 5, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [1,0]\n })\n });\n\n this.anims.create({\n key: \"runRight\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n //frames: [2,3,4,5,6,7]\n frames: [0,1]\n })\n });\n \n this.anims.create({\n key: \"runLeft\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"RUN\", {\n frames: [7,6,5,4,3,2]\n })\n });\n\n this.anims.create({\n key: \"slash\", \n frameRate: 60, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"SLASH\", {\n frames: [0,1,2,3,4,5,6,7,8]\n })\n });\n \n this.load.image(\"ground\", \"./assets/ground.png\");\n }", "function SpriteSheet(path,frameWidth, frameHeight){\n this.image = new Image();\n this.image.src = path;\n}", "preload() {\n // load the animation just one time\n this.bookAnimation = loadImage('assets/avatars/house1.png');\n \n this.houseSprite = createSprite(width *3/4 + 103, height / 2 + 5, 432, 439);\n\n this.houseSprite.addImage(this.bookAnimation);\n }", "preload() {\n // load the animation just one time\n this.bookAnimation = loadImage('assets/avatars/house1.png');\n \n this.houseSprite = createSprite(width *3/4 + 103, height / 2 + 5, 432, 439);\n\n this.houseSprite.addImage(this.bookAnimation);\n }", "constructor(board,width,height){ \n this.width=40;\n this.height=50;\n this.x=width/6;\n this.y=3*height/5-this.height;\n this.xspeed=0;\n this.yspeed=0;\n this.gravity=0.0;\n this.image=new Image();\n \n \n }", "constructor(scene, x,y, speed, dir, points, lives,sprite){\n super(scene, x, y); \n this.yoMismo= this.scene.add.sprite(0,0,sprite);\n this.add(this.yoMismo)\n this.setSize(this.yoMismo.width-5,this.yoMismo.height); //ajusta\n scene.add.existing(this);\n this.scene.physics.add.existing(this);\n this.lives = lives;\n this.direction = dir;\n this.speed = speed;\n this.points = points; \n }", "function createObjectAnimations() {\r\n this.anims.create({\r\n key: 'jewelAnims',\r\n frames: this.anims.generateFrameNumbers('jewel', { start: 0, end: 4 }),\r\n frameRate: 10,\r\n repeat: -1,\r\n });\r\n\r\n this.anims.create({\r\n key: 'cherryAnims',\r\n frames: this.anims.generateFrameNumbers('cherry', { start: 0, end: 6 }),\r\n frameRate: 6,\r\n repeat: -1,\r\n });\r\n}", "constructor (texture)\n\t{\n\t\t// create a hexiObject with the default sprite\n\t\tthis.hexiObject = hexiGame.sprite(`sprites/${texture}`);\n\t}", "addBowlerAnimation(){\n\t\tthis.bowler= this.add.sprite(config.width * 0.55, config.height * 0.39,'bowlerSprite').setScale(0.4);\n\t\tthis.bowlerAnimation = this.anims.create({\n\t\t\tkey: \"BowlerAnim\",\n\t\t\tframes: this.anims.generateFrameNumbers(\"bowlerSprite\"),\n\t\t\tframeRate: 15,\n\t\t});\n\t}", "preloadCharacterAnimations() {\r\n //Idle\r\n this.load.image('idle_front_0', 'player/character/idle/front/idle_F_0.png');\r\n this.load.image('idle_front_1', 'player/character/idle/front/idle_F_1.png');\r\n this.load.image('idle_front_2', 'player/character/idle/front/idle_F_2.png');\r\n this.load.image('idle_front_3', 'player/character/idle/front/idle_F_3.png');\r\n\r\n // Idle back\r\n this.load.image('idle_back_0', 'player/character/idle/back/idle_B_0.png');\r\n this.load.image('idle_back_1', 'player/character/idle/back/idle_B_1.png');\r\n this.load.image('idle_back_2', 'player/character/idle/back/idle_B_2.png');\r\n this.load.image('idle_back_3', 'player/character/idle/back/idle_B_3.png');\r\n\r\n // Idle side\r\n this.load.image('idle_side_0', 'player/character/idle/side/idle_S_0.png');\r\n this.load.image('idle_side_1', 'player/character/idle/side/idle_S_1.png');\r\n this.load.image('idle_side_2', 'player/character/idle/side/idle_S_2.png');\r\n this.load.image('idle_side_3', 'player/character/idle/side/idle_S_3.png');\r\n\r\n //#endregion\r\n\r\n //#region Run player preload\r\n // Run front\r\n this.load.image('run_front_0', 'player/character/run/front/run_F_0.png');\r\n this.load.image('run_front_1', 'player/character/run/front/run_F_1.png');\r\n this.load.image('run_front_2', 'player/character/run/front/run_F_2.png');\r\n this.load.image('run_front_3', 'player/character/run/front/run_F_3.png');\r\n\r\n // Run back\r\n this.load.image('run_back_0', 'player/character/run/back/run_B_0.png');\r\n this.load.image('run_back_1', 'player/character/run/back/run_B_1.png');\r\n this.load.image('run_back_2', 'player/character/run/back/run_B_2.png');\r\n this.load.image('run_back_3', 'player/character/run/back/run_B_3.png');\r\n\r\n // Run side\r\n this.load.image('run_side_0', 'player/character/run/side/run_S_0.png');\r\n this.load.image('run_side_1', 'player/character/run/side/run_S_1.png');\r\n this.load.image('run_side_2', 'player/character/run/side/run_S_2.png');\r\n this.load.image('run_side_3', 'player/character/run/side/run_S_3.png');\r\n\r\n //#endregion\r\n }", "constructor(x, y){\n this.x = x;\n this.y = y;\n this.sprite = 'images/Star.png';\n this.score = 0;\n this.gemScore = undefined;\n }", "function Sprite_Balloon() {\n this.initialize.apply(this, arguments);\n}", "constructor(x, y, img) {\n this.pos = createVector(random(x - 20, x + 20), y);\n let vx = randomGaussian() * 0.3;\n let vy = randomGaussian() * 0.5 - 1;\n this.vel = createVector(vx, vy);\n // this.acc = createVector(0.1, this.);\n\n this.life = round(random(50, 150));\n this.size = random(30, 50);\n this.alpha = 255;\n \n // let xDiff = abs(x - this.pos.x);\n let xDiff = log(map(abs(x - this.pos.x), 0, 20, 0.1, 10)) + 1;\n this.h = round(map(xDiff, 0, 2, 50, 0));\n this.s = floor(random(90, 100));\n this.l = round(map(xDiff, 0, 1, 70, 50));\n // this.flameColor = color('hsl(' + h + ', ' + s + '%, ' + l + '%)');\n \n this.texture = img;\n\n if (random(100) > 95) {\n this.life += 10;\n this.spark = true;\n }\n\n }", "create() {\n //add the following to the game\n //this.background = this.add.image(0, 0, \"background\"); //create the image\n this.background = this.add.tileSprite(0, 0, config.width, config.height, \"background\");\n this.background.setOrigin(0, 0); //determine where the image will load\n\n \n // this.ship1 = this.add.image(config.width / 2 - 50, config.height / 2, \"ship\");\n // this.ship2 = this.add.image(config.width / 2, config.height / 2, \"ship2\");\n // this.ship3 = this.add.image(config.width / 2 + 50, config.height / 2, \"ship3\");\n\n this.ship1 = this.add.sprite(config.width / 2 - 50, config.height / 2, \"ship\");\n this.ship2 = this.add.sprite(config.width / 2, config.height / 2, \"ship2\");\n this.ship3 = this.add.sprite(config.width / 2 + 50, config.height / 2, \"ship3\");\n\n //put all of our ships into a group\n this.enemies = this.physics.add.group();\n this.enemies.add(this.ship1);\n this.enemies.add(this.ship2);\n this.enemies.add(this.ship3);\n\n this.ship1.play(\"ship1_anim\");\n this.ship2.play(\"ship2_anim\");\n this.ship3.play(\"ship3_anim\");\n\n //make each ship interactive\n this.ship1.setInteractive();\n this.ship2.setInteractive();\n this.ship3.setInteractive();\n\n //add an event listener\n this.input.on('gameobjectdown', this.destroyShip, this);\n\n //create the power-ups for the game\n //there will be a maximum of 4 power-ups\n //set the power-ups to be located at a random position within the game\n this.powerUps = this.physics.add.group();\n\n var maxObjects = 4;\n for (var i=0; i <= maxObjects; i++) {\n var powerUp = this.physics.add.sprite(16, 16, \"power-up\");\n this.powerUps.add(powerUp);\n powerUp.setRandomPosition(0, 0, game.config.width, game.config.height);\n\n //make it a 50/50 chance of the animation being either red or gray\n if (Math.random() > 0.5) {\n powerUp.play(\"red\");\n }\n else {\n powerUp.play(\"gray\");\n }\n\n //set the velocity of the power-up to control how it travels on the screen\n //because we want the power-ups to collide with the boundaries, set the value to be true\n //because we want the power-ups to bounce off the boundaries, we set a bounce value\n //we want to keep its full velocity as it bounces, so the value will be 1\n powerUp.setVelocity(100, 100);\n powerUp.setCollideWorldBounds(true);\n powerUp.setBounce(1);\n }\n\n //add the player alongside its animation\n this.player = this.physics.add.sprite(config.width / 2 - 8, config.height - 64, \"player\");\n this.player.play(\"thrust\");\n\n //listen for any keyboard events\n this.cursorKeys = this.input.keyboard.createCursorKeys();\n\n //look for any collisions \n this.player.setCollideWorldBounds(true);\n\n //give the player the ability to use the spacebar\n this.spacebar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\n\n this.projectiles = this.add.group();\n\n //enable any collisions that take place between objects\n //and groups of objects\n //third parameter uses an anonymous function which is called back\n //as the collision occurs\n this.physics.add.collider(this.projectiles, this.powerUps, function (projectile, powerUp) {\n projectile.destroy(); //destroys the shot as it collides with the object\n });\n //make the player pick up the power-up whenever the player touches it\n this.physics.add.overlap(this.player, this.powerUps, this.pickPowerUp, null, this);\n\n this.physics.add.overlap(this.player, this.enemies, this.hurtPlayer, null, this);\n\n this.physics.add.overlap(this.projectiles, this.enemies, this.hitEnemy, null, this);\n\n //create the graphics for the text\n //set the color of the text\n //and the size and length of the text\n var graphics = this.add.graphics();\n graphics.fillStyle(0x000000, 1);\n graphics.beginPath();\n graphics.moveTo(0, 0);\n graphics.lineTo(config.width, 0);\n graphics.lineTo(config.width, 20);\n graphics.lineTo(0, 20);\n graphics.lineTo(0, 0);\n graphics.closePath();\n graphics.fillPath();\n\n //set the score at startup - in this case it'll be 0\n this.score = 0;\n\n //create the score\n this.scoreLabel = this.add.bitmapText(10, 5, \"pixelFont\", \"SCORE \", 16);\n\n //create the sounds\n this.beamSound = this.sound.add(\"audio_beam\");\n this.explosionSound = this.sound.add(\"audio_explosion\");\n this.pickupSound = this.sound.add(\"audio_pickup\");\n\n this.music = this.sound.add(\"music\");\n\n var musicConfig = {\n mute: false,\n volume: 1,\n rate: 1,\n detune: 0,\n seek: 0,\n loop: false,\n delay: 0\n }\n this.music.play(musicConfig);\n }", "constructor(col,row,sprite){\n this.x = 101*col; // Determines the x-position of the playericon\n this.y = 87*row; // Determines the y-position of the playericon\n this.col = col; // Determines the row of the playericon\n this.row = row; // Determines the column of the playericon\n this.sprite = sprite; // Determins the image of the playericon\n }", "init() {\n let texture = PIXI.Texture.fromImage('/static/assets/Textures/water.jpg');\n this.tilingSprite = new PIXI.extras.TilingSprite(\n texture,\n this.app.screen.width * 1.5,\n this.app.screen.height * 1.5\n );\n\n this.tilingSprite.anchor.set(0.25, 0.25);\n this.app.stage.addChild(this.tilingSprite);\n this.app.stage.setChildIndex(this.tilingSprite, 0);\n }", "constructor(x, y, imageRect){\n this.highlighted = false;\n this.highlightedImg = new Image();\n this.highlightedImg.src = \"./src/resources/gui/level_highlight.png\"\n this.btnBg = new Image();\n this.btnBg.src = \"./src/resources/gui/level_select_icons.png\"\n this.srcRect = imageRect;\n this.action = \"this.mManager.fadeTo('Game')\"\n\n //Position of the button\n this.x = x;\n this.y = y;\n\n //Setup our collide box for click events\n this.rect = {x: this.x - 65, y: this.y - 65, width: 130, height: 130};\n\n //Add our mouse move listener\n window.addEventListener(\"mousemove\", this.mouseMoved.bind(this));\n }", "function Jeb(game, spritesheet) {\r\n this.animation = new Animation(spritesheet, 49, 48.2, 3, .2, 3, true, 2);\r\n this.speed = 100;\r\n this.ctx = game.ctx;\r\n xpos = Math.floor(Math.random() * 1275);\r\n ypos = Math.floor(Math.random() * 650);\r\n Entity.call(this, game, xpos, ypos);\r\n \r\n}", "function Sprite (args) {\n if (args) {\n this.type = args.type;\n this.position = new Position(args.xPos, args.yPos);\n this.width = args.width;\n this.height = args.height;\n this.image = new Image ();\n this.image.src = args.src;\n this.image.onload = function() {\n this.loaded = true; \n };\n }\n}", "create(){\n\t\tlet self = this\n\n\t\t// 8bit think logo\n\t\tself.eightBitLogo = new Phaser.Sprite(self.game, 0,0, '8bit-logo')\n\t\tself.game.add.existing( self.eightBitLogo )\n\t\tself.eightBitLogo.x = self.game.width/2 - self.eightBitLogo.width/2\n\t\tself.eightBitLogo.y = 295\n\n\t\tself.preloadRemaining()\n\t}", "function bannerInit() {\n //set unique positions and other values you plan from animate here\n\n t.set([], setValues);\n\n t.set([logo,bk1,img01, img02, img03], { y: 300 })\n // t.set(blinds, {scaleX:.3})\n // t.set(blinds, {autoAlpha:0});\n // t.set(blindGroup, {scaleX:0, autoAlpha:0});\n\n // t.set([copy03, copy04,copy05,copy06], {autoAlpha:0});\n\n\n \n\n\n\n //init animation\n Frame01();\n\n }", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function createAnimations(that){\n \n that.anims.create({\n key: \"left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 0 }),\n repeat: 0\n });\n\n that.anims.create({\n key: \"finish-left\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 0, end: 2 }),\n repeat: 0\n });\n \n that.anims.create({\n key: \"right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 4 })\n });\n\n that.anims.create({\n key: \"finish-right\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 4, end: 2 })\n });\n\n that.anims.create({\n key: \"down\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 7, end: 2 }),\n });\n\n that.anims.create({\n key: \"up\",\n frames: that.anims.generateFrameNumbers(\"personaje\", { start: 2, end: 7 })\n });\n\n}", "function intialize_sprites() {\n player = new Player();\n var enemy1 = new Enemy();\n allEnemies = [enemy1];\n}", "constructor(array = [0, 101 / 2], speed = 0) {\n this.sprite = 'images/enemy-bug.png';\n this.x = array[0];\n this.y = array[1];\n this.speed = speed;\n }", "constructor (x, y, height, angle) {\n super(x, y, 20, height, width)\n this.image = loadImage(\"./sprites/wood2.png\");\n Matter.Body.setAngle(this.body, angle);\n }", "function Animation_jb(img_url, json_obj) {\"use strict\";\n\tvar context = this, interval, ready_bool = false;\n\n\tthis.tag_$ = $('<div></div>');\n\tthis.currentFrame = 0;\n\tthis.frames_json = json_obj;\n\n\tthis.onReady = function() {\n\t};\n\n\tthis.stop = function() {\n\t\tclearInterval(interval);\n\t};\n\n\tvar _initAnim = function() {\n\n\t\tcontext.firstFrame_json = context.frames_json.frames[0].frame;\n\t\tcontext.tag_$.width(context.firstFrame_json.w);\n\t\tcontext.tag_$.height(context.firstFrame_json.h);\n\t\tcontext.tag_$.css('background-image', \"url(\" + img_url + \")\");\n\t\tcontext.totalFrames = context.frames_json.frames.length;\n\n\t\tready_bool = true;\n\n\t};\n\tvar _nextFrameLoop = function() {\n\t\tvar nextFrame = (context.currentFrame + 1) % context.totalFrames;\n\t\tcontext.gotoFrame(nextFrame);\n\n\t};\n\n\tthis.loop = function() {\n\t\tclearInterval(interval);\n\t\tinterval = setInterval(_nextFrameLoop, 10);\n\t};\n\tthis.play = function() {\n\t\tclearInterval(interval);\n\t\tinterval = setInterval(this.nextFrame, 10);\n\n\t};\n\n\tthis.nextFrame = function() {\n\t\t//trace (\"this.nextFrame()\");\n\t\tvar nextFrame = context.currentFrame + 1;\n\t\tif (nextFrame < context.totalFrames) {\n\t\t\tcontext.gotoFrame(context.currentFrame + 1);\n\t\t} else {\n\t\t\tcontext.stop();\n\t\t}\n\t};\n\tthis.lastFrame = function() {\n\n\t\tcontext.gotoFrame(context.totalFrames - 1);\n\n\t};\n\n\tthis.gotoAndStop = function(frame_num) {\n\n\t\tthis.stop();\n\t\tthis.gotoFrame(frame_num);\n\n\t};\n\n\tthis.gotoFrame = function(frame_num) {\n\t\tif (ready_bool && frame_num > 0 && frame_num <= context.totalFrames) {\n\t\t\tcontext.currentFrame = frame_num;\n\t\t\tvar img_pos = context.frames_json.frames[frame_num - 1].frame;\n\t\t\tcontext.tag_$.css('background-position', -img_pos.x + 'px ' + -img_pos.y + 'px ');\n\t\t}\n\n\t};\n\n\t_initAnim();\n\n}", "initContainers() {\n this._body = new asprite.SpriteSheet() // create body container\n this._weapon = new asprite.SpriteSheet() // create weapon container\n\n this._body.anchor.x = this._body.anchor.y = this._weapon.anchor.x = this._weapon.anchor.y = 0.5\n\n this.addChild(this._body)\n this.addChild(this._weapon)\n\n this.animation = new AnimationController(this)\n }" ]
[ "0.7134549", "0.68747884", "0.6856599", "0.6834679", "0.67721814", "0.6759674", "0.6745981", "0.6735408", "0.6706429", "0.67043114", "0.6691438", "0.6632302", "0.66067713", "0.6601587", "0.65867394", "0.65856683", "0.6576728", "0.6572616", "0.65671897", "0.6563973", "0.6524792", "0.65170574", "0.65030223", "0.6502576", "0.64887816", "0.6486039", "0.6475317", "0.6468965", "0.6462394", "0.6445312", "0.6440669", "0.6434253", "0.6394379", "0.639406", "0.6380272", "0.6376645", "0.63689977", "0.633456", "0.63317996", "0.63281375", "0.6314317", "0.63141596", "0.6313914", "0.63118654", "0.63083243", "0.6304045", "0.63037694", "0.63028014", "0.6298396", "0.6294548", "0.62761223", "0.6274927", "0.6273724", "0.6269983", "0.62693435", "0.6239003", "0.62213296", "0.62161684", "0.6198798", "0.6198592", "0.61910075", "0.6180904", "0.6171383", "0.61685675", "0.6168395", "0.6158044", "0.61499864", "0.61497945", "0.6148466", "0.6142027", "0.6141835", "0.6140018", "0.6130296", "0.6126188", "0.61253947", "0.61253947", "0.6123365", "0.61194855", "0.61124617", "0.6110218", "0.6107742", "0.6104491", "0.6099112", "0.60964644", "0.60947603", "0.6093563", "0.6089298", "0.6080811", "0.6080746", "0.6077425", "0.6072895", "0.606782", "0.60593414", "0.60560507", "0.60560507", "0.6049842", "0.60469234", "0.60429233", "0.6032204", "0.60235655" ]
0.74034387
0
Imposta la mappa correntemente visualizzata. Imposta le variabili globali di questo file con le caratteristiche della mappa indicata.
function setCurrentMap(element) { currentMap = element; mapSize = {width:element.style.width.slice(0, -2), height:element.style.height.slice(0, -2)}; refreshServicesLayer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "function nuevoInicio(){\n let previo = inicio;\n inicio = mapa[inputInicioX.value()][inputInicioY.value()];\n inicio.obstaculo = false;\n inicio.corrienteFuerte = false;\n inicio.corriente = false;\n inicio.pintar(0);\n previo.pintar(255);\n}", "function drawObs() {\n // Menggambar setiap ruas\n obstacle.forEach(drawObsPart)\n}", "function fillConstants(){\n g.a = (27/64)*((g.R**2)*(g.Tc**2))/g.Pc\n g.b = (g.R*g.Tc)/(8*g.Pc);\n g.Vc = 0.359*(g.R*g.Tc)/g.Pc;\n}", "setIndexFile() {\n currentFile = this.getCurrentFile();\n if (currentFile === \"\") {\n atom.notifications.addWarning(\"Path of current File not available\", {\n detail: \"Could not set the index file\",\n dismissable: true\n });\n } else {\n atom.config.set('mcide.indexFile', currentFile);\n }\n }", "function ver() { //funcion que recorrera las imagenes y las mostrara\n let contenido=\"\";\n\n for(let i=0;i<fileVal.length;i++){\n let imgtemporal=fileVal[i].name;\n insetar(imgtemporal);\n \n }\n\n}", "function impostaDati (importo, indice) {\n capVarImp.impostaValutaEAllineaADestra(\"#totaleCompetenzaTrovatoAnno\" + indice, importo.stanziamento);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleResiduiTrovatoAnno\" + indice, importo.stanziamentoResiduo);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleCassaTrovatoAnno\" + indice, importo.stanziamentoCassa);\n }", "function sidebarFileLoad(file) {\n $(\"#file-button_\" + previousFile).removeAttr('style');\n flotFileData(files[file]);\n currentlyLoadedGraph = file;\n $(\"#file-button_\" + file).css(\"background-color\", \"#ff6600\");\n previousFile = file;\n}", "function ResetVars() {\r\n mouseDisabled.fill(false);\r\n //\r\n oriPath.map(function (element) {\r\n element.Path.segments = [];\r\n element.PairInvolved = [];\r\n return element\r\n })\r\n modPath.map(function (element) {\r\n element.Path.segments = [];\r\n element.Path.visible = false;\r\n element.PairInvolved = [];\r\n return element\r\n })\r\n syncPoint.position = hidden;\r\n entryMarker.map(function (element) {\r\n element.position = hidden;\r\n return element\r\n })\r\n cpaLine.map(function (element) {\r\n element.firstSegment.point = hidden;\r\n element.lastSegment.point = hidden;\r\n return element\r\n })\r\n cpaCircle.map(function (element) {\r\n element.position = hidden;\r\n return element\r\n })\r\n aircraft.map(function (element) {\r\n element.position = hidden;\r\n return element\r\n })\r\n cpaLineExtension.segments = [hidden, hidden];\r\n if (resolutionGuideCircle != null) {\r\n resolutionGuideCircle.remove(); \r\n }\r\n \r\n\r\n arrow.map(function(element) { if (element) { element.remove(); } return element });\r\n $('#speed-changer').val(1);\r\n $('#speed-ratio').html($('#speed-changer').val());\r\n $('#speed-changer').prop('disabled', false);\r\n\r\n \r\n // Reset num of pair and array of cpa line indeces\r\n numOfPair = 0;\r\n for (var i = 0; i < n - 1; i++) {\r\n liveCpaIdx[i] = []; \r\n for (var j = i + 1; j < n; j++) {\r\n liveCpaIdx[i][j] = numOfPair;\r\n numOfPair++;\r\n }\r\n }\r\n scenResolution = [];\r\n currentScore = 0;\r\n\r\n // $('#play-conflict-btn').prop('disabled', true);\r\n // $('#play-resolution-btn').prop('disabled', true);\r\n $('#current-score').html('...');\r\n $('#is-conflict').prop('checked', false);\r\n $('#no-conflict').prop('checked', false);\r\n $('#is-conflict').prop('disabled', false);\r\n $('#no-conflict').prop('disabled', false);\r\n}", "function setup() {\n //crear un lienzo y se escribe asi (dimHor, dimVer);\n createCanvas(windowWidth, windowHeight );\n \n //crear variable local verde\n\n var verde = 012;\n //atajo: se puede declarar y asignar un valor inicial en una misma linea asi\n // var verde = 255\n \n \n //pintar el fondo del lienzo\n //usar comando backgroung(color);\n background (080, verde, 050); \n \n\n}", "function setGlobalVariables() {\n officeName = officeLoc[beach].name;\n beachID = officeLoc[beach].beachID;\n weatherID = officeLoc[beach].weatherID;\n officeLatCoord = officeLoc[beach].lat;\n officeLonCoord = officeLoc[beach].lon;\n transit = officeLoc[beach].transit;\n videoLetterboxed = officeLoc[beach].videoLetterboxed;\n measurements = homeOfficeInfo[0].measurements;\n\n if (measurements === english) {\n heightUnit = 'ft';\n surflineVar = 'e';\n tempUnit = 'f';\n } else if (measurements === metric) {\n heightUnit = 'm';\n surflineVar = 'm';\n tempUnit = 'c';\n }\n}", "async function main() {\n new p5((p_) => {\n p = p_;\n p.setup = setup;\n // p.draw = draw;\n }, elements.container);\n\n gui\n .add(settings, 'targetClass', ['all'].concat(_.values(IMAGENET_CLASSES)))\n .onChange(restart);\n gui.add(settings, 'gridSize', 3, 100).step(1).onChange(restart);\n gui.add(settings, 'minStrokeWidth', 1, 10).step(1).onChange(restart);\n gui.add(settings, 'maxStrokeWidth', 10, 500).step(1).onChange(restart);\n gui.add(settings, 'lineCount', 1, 25).step(1).onChange(restart);\n gui.add(settings, 'lineAlpha', 0.1, 1).step(0.01).onChange(restart);\n gui.add(settings, 'linePointCurvePoint', 1, 50).step(1).onChange(restart);\n gui.add(settings, 'randomColorCount', 1, 50).step(1).onChange(restart);\n gui.add(settings, 'populationCount', 100, 1000).step(1);\n gui.add(settings, 'mutationRate', 0.1, 0.99).step(0.01);\n gui.add(settings, 'maxGeneration', 1, 100).step(1);\n gui.add(settings, 'matchThreshold', 0.1, 0.99).step(0.01);\n gui.add(settings, 'saveImage');\n gui.add(settings, 'restart');\n gui.add(settings, 'stop');\n gui.close();\n\n if (ENABLE_STATS) {\n stats.showPanel(0);\n elements.stats.appendChild(stats.dom);\n }\n}", "function populatePanoValues(){\n // console.log('populatePanoValues')\n // console.log('gPanos', gPanos)\n gPanos.forEach(pano => {\n // File\n pano.values.inputFile = file = removeFakePath(pano.elements.inputFile.value)\n // Name\n if (pano.elements.viewNameEnabled.value){\n pano.values.viewName = pano.elements.viewName.value\n } else {\n pano.values.viewName = pano.elements.main.id\n } \n // Camera Position\n if (pano.elements.camPosEnabled.value){\n pano.values.posx = pano.elements.posx.value\n pano.values.posy = pano.elements.posy.value\n pano.values.posz = pano.elements.posz.value\n } else {\n pano.values.posx = Number(pano.elements.main.id)\n pano.values.posy = 0\n pano.values.posz = 0\n } \n })\n }", "function nuevoFin(){\n let previo = fin;\n fin = mapa[inputFinalX.value()][inputFinalY.value()];\n fin.obstaculo = false;\n fin.corrienteFuerte = false;\n fin.corriente = false;\n fin.pintar(0);\n previo.pintar(255);\n}", "function show1() {\n imageCounter = 0;\n\n changeImage();\n\n changeAnnot(1, 0);\n\n }", "function addImagetoAssignment() {\r\n \r\n //Show success Modal and start confetti\r\n document.getElementById('modal3').style.display = 'block';\r\n\r\n\r\n }", "function iniciar(){\n require([\"esri/Map\",\"esri/views/SceneView\",\"esri/layers/Layer\",\"esri/PopupTemplate\",\"esri/core/watchUtils\"],\n function(Map, SceneView, Layer, PopupTemplate,watchUtils) { \n var map = new Map({\n basemap: \"streets\" \n });\n \n /*Layer.fromArcGISServerUrl({\n url: \"http://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Continents/FeatureServer/0\",\n properties: {\n popupTemplate: new PopupTemplate({\n title: \"Continente {CONTINENT}\",\n content: \"Ganaste o Perdiste (Mejorando la dinámica de #Bitor)\"\n })\n }\n }).then(function(layer){\n map.add(layer);\n });*/\n \n view = new SceneView({\n container: \"mapa\",\n map: map,\n padding: {\n bottom: 50,\n top: -30\n }\n });\n \n watchUtils.watch(view, 'zoom', function(){\n //console.log(view.zoom);\n \n });\n \n view.then(function(){\n //darInstrucciones();\n }, function(error){\n console.log(\"No se ha podido cargar el mapa.\");\n });\n \n view.on(\"click\", function(evt) {\n //esto va en popup\n //features: [result],\n //location: result.geometry.centroid\n if (evt.mapPoint) {\n lat = Math.round(evt.mapPoint.latitude * 1000) / 1000;\n lon = Math.round(evt.mapPoint.longitude * 1000) / 1000;\n mostrarInfo(); \n }\n });\n \n var tablaIndicadores = document.createElement(\"table\");\n tablaIndicadores.innerHTML = '<thead><tr><th style=\"text-align: center;\">Indicador</th><th style=\"text-align: center;\">Valor</th></tr></thead><tbody><tr><td>Inscripción escolar</td><td id=\"primaria\"></td></tr><tr><td>Población con acceso al agua</td><td id=\"agua\"></td></tr><tr><td>Población con acceso a la electricidad</td><td id=\"luz\"></td></tr><tr><td>Desempleo</td><td id=\"desempleo\"></td></tr><tr><td>Muerte por condiciones nutricionales</td><td id=\"muerte\"></td></tr><tr><td>Esperanza de vida</td><td id=\"vida\"></td> </tr></tbody>';\n \n var divImagenes = document.createElement(\"div\");\n divImagenes.id = \"imagenes\";\n divImagenes.style = \"width:300px; height=200px; display:none;\";\n divImagenes.innerHTML = '<figcaption id=\"imgTitle\"></figcaption><img name=\"Vivienda\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick=\"openModal(); currentSlide(1)\"><img name=\"Ambiente\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick=\"openModal();currentSlide(2)\"><img name=\"Educación\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick = \"openModal();currentSlide(3)\">';\n \n var divPais = document.createElement(\"div\");\n divPais.style = \"text-align: center;\";\n var h4 = document.createElement(\"h4\");\n h4.id = \"pais\";\n h4.style = \"background-color: white; color: black;\";\n var img = document.createElement(\"img\");\n img.id = \"bandera\";\n img.width = 200;\n img.height = 100;\n divPais.appendChild(h4);\n divPais.appendChild(img);\n \n view.ui.padding = { top: 30, left: 0, right: 15, bottom: 30 };\n view.ui.empty(\"top-left\");\n getVideo();\n view.ui.add(divPais, \"top-right\");\n view.ui.add(tablaIndicadores, \"bottom-left\");\n view.ui.add(divImagenes, \"bottom-right\");\n });\n}", "function setup(){\n createCanvas(windowWidth,windowHeight);\n background(255);\n fetchdata();\n colr.r = random(255);\n colr.g = random(255);\n colr.b = random(255);\n t = 0;\n // reset();\n imga = loadImage(\"./icons/imga1.png\");\n imgb = loadImage(\"./icons/imga2.png\");\n // fill(250);\n // noStroke();\n // rect(0,0,windowWidth/1.8,windowHeight);\n }", "function colisaoObs(){\r\n\r\n\tfor(var j = 0 ; j < 10 ; j++){\r\n\r\n\t\tfor(var a = j + 1; a < 10 ; a++){\r\n\r\n\t\t\tif(mata_x[j] == mata_x[a] && mata_y[j] == mata_y[a]){\r\n\r\n\t\t\t\tvar NasceObsX = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\t\t\t\tvar NasceObsY = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\r\n\t\t\t\tmata_x[j] = NasceObsX * TAMANHO_PONTO\r\n\t\t\t\tmata_y[j] = NasceObsY * TAMANHO_PONTO\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "imprimirVehiculos() {\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tif (vehiculo.puertas) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Puertas: ${vehiculo.puertas} // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t\tif (vehiculo.cilindrada) {\n\t\t\t\tconsole.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Cilindrada: ${vehiculo.cilindrada}cc // Precio: $${this.formatearPrecio(vehiculo.precio)}`)\n\t\t\t}\n\t\t});\n\t}", "function displayFigmaSettings() {\n console.log(\"Your Figma Personal Access Token is: \" + chalk.green(utils.$data.figma.token));\n console.log(\"Your Figma file URL is: \" + chalk.green(utils.$data.figma.url));\n}", "function setDefaults() {\n dimension.value = 20;\n sim.value = 0.35;\n vacant.value = 0.1;\n split.value = 0.6;\n aColor.value = \"#006EFF\";\n bColor.value = \"#FF7B00\";\n}", "function abrirConf() {\n ipcRenderer.send('abrirPantallaConf', \"\");\n}", "function init_conf()\n {\n sconf.default_tp_lightness = 22;\n sconf.rgShapesVisible = false;\n sconf.default_tp_stroke_width = 8;\n sconf.text_nonhover_width = 1;\n sconf.text_hover_width = 2; //needs hover-width cls at svg-text-el,\n //aka for: Δsin(φ),\n //sconf.nonhover_width = 4;\n //sconf.hover_width = 114; //needs hover-width cls at svg-text-el,\n //aka for: Δsin(φ),\n //overrides \"global\", lemma.conf.js::sconf\n sconf.pointDecoration.r= 5;\n\n\n //====================================================\n // //\\\\ subapp regim switches\n //====================================================\n sconf.enableStudylab = false;\n sconf.enableTools = false;\n //====================================================\n // \\\\// subapp regim switches\n //====================================================\n\n\n //--------------------------------------\n // //\\\\ geometics parameters\n //--------------------------------------\n //for real picture if diagram's picture is supplied or\n //for graphical-media work-area if not supplied:\n var pictureWidth = 858;\n var pictureHeight = 566;\n var modorInPicX = 166;\n var modorInPicY = 63;\n //model's spacial unit in pixels of the picture:\n var mod2inn_scale = 239; //was?: originalPoints.R.pos[1] - originalPoints.A.pos[1];\n\n var A = [modorInPicX, modorInPicY];\n var B = [358, 165];\n var D = [496, modorInPicY];\n sconf.b_per_B_original = 1.931578947;\n\n\n //-----------------------------------\n // //\\\\ topic group colors,\n // todm: possibly proliferation\n //-----------------------------------\n var context = [0, 0, 0, 0.6];\n var given = [0, 150, 0, 0.6];\n var proof = [0, 0, 255, 0.6];\n var result = [200, 40, 0, 0.6];\n var shadow = [150, 150, 150, 1];\n var hidden = [0, 0, 0, 0];\n\n\n var predefinedTopics =\n {\n //:basic topics\n proof,\n given,\n result,\n hidden,\n\n //:given\n \"curve-AB\" : given,\n \"left-curve-AB\" : given, //patch for left branch\n \"arc-AB\" : given,\n\n //proof\n \"curve-Ab\" : proof,\n \"arc-Ab\" : proof,\n\n //addendum\n \"phi0\" : given,\n \"deltaphi\" : given,\n \"tangentPhi\" : result,\n 'angleBAD' : given,\n 'conterminousRatio' : proof,\n };\n //-----------------------------------\n // \\\\// topic group colors,\n //-----------------------------------\n\n var originalPoints =\n {\n //:context\n //axis-y addendum\n 'ytop' : {\n letterAngle : 90,\n caption : 'axis y',\n letterRotRadius : 35,\n pcolor : context,\n },\n \"ylow\" : {\n letterAngle : 90,\n },\n O : {\n letterAngle : -90,\n pcolor : given,\n },\n 'axis-y_X_rd' : {\n },\n\n //axis-x addendum\n 'xtop' : {\n letterAngle : 130,\n caption : 'axis x',\n letterRotRadius : 40,\n //pcolor : given,\n },\n \"xlow\" : {\n letterAngle : 90,\n },\n\n //beyond X and L to enable show of tangent angle\n \"line-AL-end\" : {\n },\n\n //extends rd to show an angle\n \"line-dr-start\" : {\n letterAngle : 30,\n },\n ///modified point r, closer to d\n \"dr-decorpoint\" : {\n caption : 'r',\n pcolor : proof,\n letterAngle : -90,\n letterRotRadius : 20,\n },\n\n ///modified point r, closer to d\n \"imageOfR\" : {\n caption : \"r\",\n pcolor : proof,\n letterAngle : -45,\n letterRotRadius : 30,\n },\n\n ///modified point r, closer to d\n \"imageOfD\" : {\n caption : \"d\",\n pos : D,\n pcolor : proof,\n letterAngle : -90,\n letterRotRadius : 30,\n },\n\n\n c : {\n letterAngle : 45,\n letterRotRadius : 18,\n pcolor : proof,\n },\n\n //proof\n b : {\n letterAngle : 0,\n pcolor : proof,\n },\n d : {\n caption : 'dₒ',\n letterAngle : 90,\n pcolor : proof,\n },\n\n\n \"y0\" : {\n caption : 'yₒ',\n letterAngle : 225,\n pcolor : given,\n },\n //By\n 'y' : {\n caption : 'y',\n letterAngle : 45,\n pcolor : given,\n },\n //Ax\n x : {\n caption : 'x',\n letterAngle : -45,\n pcolor : given,\n },\n //Bx\n x0 : {\n caption : 'xₒ',\n letterAngle : 135,\n pcolor : given,\n },\n \n // //\\\\ magnified points\n 'Y0' : {\n pos : A,\n caption : 'Yₒ',\n letterAngle : 210,\n letterRotRadius : 50,\n pcolor : proof,\n },\n //BY\n 'Y' : {\n caption : 'Y',\n letterAngle : 180,\n letterRotRadius : 35,\n pcolor : proof,\n },\n //AX0\n 'X0' : {\n caption : 'Xₒ',\n letterAngle : -90,\n pcolor : proof,\n },\n //BX\n 'X' : {\n caption : 'X',\n letterAngle : -90,\n pcolor : proof,\n },\n // \\\\// magnified points\n\n\n //:originals from Book\n A : {\n //assigment by reference to pos is safe: no parasite links,\n //pos is recalculated later\n pos : A,\n letterAngle : 90,\n pcolor : given,\n },\n\n r : {\n caption : 'rₒ',\n letterAngle : 135,\n pcolor : given,\n },\n\n R : {\n letterAngle : 135,\n pcolor : given,\n draggableX : false,\n draggableY : true,\n },\n\n B : {\n pos: B,\n letterAngle : 0,\n pcolor : given,\n },\n\n C : {\n letterAngle : 45,\n letterRotRadius : 13,\n pcolor : given,\n },\n\n\n /*\n 'B-kernelx' : {\n cssClass : 'hover-width',\n },\n */\n D : {\n pos: D,\n letterAngle : 90,\n pcolor : given,\n },\n\n curveEnd : {\n pos : [B[0]+50,0],\n },\n curveStart : {\n pos : [ A[0]-80, 0 ],\n },\n\n //lemma 7, coroll 1\n F : {\n letterAngle : 90,\n pcolor : given,\n },\n G : {\n letterAngle : 90,\n pcolor : given,\n },\n E : {\n letterAngle : 90,\n pcolor : given,\n },\n e : {\n letterAngle : 90,\n pcolor : proof,\n },\n L : { \n letterAngle : -45,\n pcolor : result,\n },\n\n fi : {\n caption : \"φ\",\n pcolor : shadow,\n letterAngle : 180,\n draggableX : true,\n draggableY : true,\n },\n\n };\n ///alternatively to this, you can set own colors for originalPoints\n ///by your own\n ns.eachprop( originalPoints, (point,pname) => {\n point.pcolor = ns.haz( point, 'pcolor' ) || predefinedTopics[ pname ];\n });\n\n var linesArray =\n [\n { \"rd\" : { pcolor : proof } },\n { \"rb\" : { pcolor : proof } },\n\n { 'dr-decorpoint,d' : { pcolor : proof } },\n { 'dr' : { pcolor : proof } },\n { 'imageOfR,imageOfD' : { pcolor : proof } },\n { 'A,imageOfD' : { pcolor : proof } },\n { 'A,imageOfR' : { pcolor : proof } },\n { 'imageOfR,b' : { pcolor : proof } },\n\n { 'Ad' : { pcolor : proof } },\n { 'Ar' : { pcolor : given } },\n\n //l7\n { 'bd' : { pcolor : proof } },\n { 'be' : { pcolor : proof } },\n\n { 'Ab' : { pcolor : proof } },\n { 'AR' : { pcolor : given } },\n { 'AD' : { pcolor : given } },\n\n //l7\n { 'BD' : { pcolor : given } }, //lemma 7, coroll 1\n { 'BF' : { pcolor : given } },\n { 'AF' : { pcolor : given } },\n { 'AG' : { pcolor : given } },\n { 'AE' : { pcolor : given } },\n { 'BG' : { pcolor : given } },\n\n\n //l8\n { 'RD' : { pcolor : given } },\n { 'BR' : { pcolor : given } },\n\n //sin(x)/x\n { 'Br' : { pcolor : given } },\n\n { 'line-dr-start,dr-decorpoint' : { pcolor : proof, undisplay : true } },\n\n //:context\n { 'ylow,ytop' : { pcolor : context, } },\n { 'xlow,xtop' : { pcolor : context, } },\n { 'O,ytop' : { pcolor : context, } },\n\n //cirle radius\n { 'AO' : { pcolor : given, 'stroke-width' : 1, } },\n\n //cirle radius\n { 'BO' : { pcolor : given, 'stroke-width' : 1, } },\n\n //x-drops to axix x\n { 'A,x0' : { pcolor : given, 'stroke-width' : 1, } },\n { 'Bx' : { pcolor : given, 'stroke-width' : 1, } },\n //y-drops to axix y\n { 'A,y0' : { pcolor : given, 'stroke-width' : 1, } },\n { 'By' : { pcolor : given, 'stroke-width' : 1, } },\n\n\n\n //dy\n { 'y0,y' : { pcolor : given, 'stroke-width' : 8, } },\n //dx\n { 'x0,x' : { pcolor : given, 'stroke-width' : 8, } },\n\n { 'A,line-AL-end' : { pcolor : result } },\n\n //DY\n { 'A,Y' : { pcolor : proof, 'stroke-width' : 8, } },\n //DX\n { 'X0,X' : { pcolor : proof, 'stroke-width' : 8, } },\n\n //tangent\n { 'AL' : { pcolor : result } },\n { 'Ae' : { pcolor : proof } },\n\n { 'AE' : { pcolor : given } },\n { 'BE' : { pcolor : given } },\n { 'AB' : { pcolor : given } },\n ]\n\n //----------------------------------\n // //\\\\ curve pars\n // points for divided\n // differences interpolation\n //----------------------------------\n var ww1 = [204,67];\n var ww1 = [244,82];\n var ww2 = [272,94];\n var ww2 = [300,110];\n var ww3 = B;\n\n originalPoints.t1 = {\n pos: ww1,\n letterAngle : 90,\n pcolor : given,\n };\n originalPoints.t2 = {\n pos: ww2,\n letterAngle : 90,\n pcolor : given,\n };\n\n var givenCurve_pivots =\n [\n //make curve symmetrical in respect to axis Y\n [2*A[0]-ww3[0],ww3[1]],\n [2*A[0]-ww2[0],ww2[1]],\n [2*A[0]-ww1[0],ww1[1]],\n\n [A[0], A[1]],\n ww1,\n ww2,\n [ww3[0], ww3[1]],\n [377,206],\n ];\n var ww_MONITOR_Y_FLIP = -1;\n var ww_inn2mod_scale = 1/mod2inn_scale;\n var ww_factor = ww_MONITOR_Y_FLIP * ww_inn2mod_scale;\n var givenCurve_pivots_inModel = givenCurve_pivots.map( opoint =>\n [ ( opoint[0] - modorInPicX ) * ww_inn2mod_scale,\n ( opoint[1] - modorInPicY\n ) * ww_factor,\n ]\n );\n //----------------------------------\n // \\\\// curve pars\n //----------------------------------\n\n\n //making size to better fit lemma's diagram\n fconf.LETTER_FONT_SIZE_PER_1000 = 20;\n\n ns.paste( sconf, {\n //double back step ../../ is to reuse this path in code for lemma7\n mediaBgImage : \"../../b1sec1lemma8/img/d.png\",\n givenCurve_pivots_inModel,\n predefinedTopics,\n originalPoints,\n linesArray,\n //lines,\n modorInPicX,\n modorInPicY,\n pictureWidth,\n pictureHeight,\n mod2inn_scale,\n });\n //--------------------------------------\n // \\\\// geometics parameters\n //--------------------------------------\n }", "function analyzeObsolescenceIndicators(results)\n {\n currentPlace.indicators = {};\n currentPlace.indicators.viewport = results.ConfigureViewport.ruleImpact;\n currentPlace.indicators.gzip = results.EnableGzipCompression.ruleImpact;\n currentPlace.indicators.minifyCss = results.MinifyCss.ruleImpact;\n currentPlace.indicators.minifyJs = results.MinifyJavaScript.ruleImpact;\n currentPlace.indicators.minifyHTML = results.MinifyHTML.ruleImpact;\n currentPlace.indicators.optimizeImages = results.OptimizeImages.ruleImpact;\n currentPlace.indicators.fontSize = results.UseLegibleFontSizes.ruleImpact;\n\n Vue.set(analyzeModuleData.details, 'indicators', currentPlace.indicators);\n }", "function setup() {\n\n //camelCase, UPPERCASE, lowercase\n\n //crear lienzo para dibujar \n //por defecto es blanco\n //createCanvas(dimHor, dimVer); \n //dimensiones en px\n createCanvas(windowWidth, windowHeight);\n\n //pintar el fondo\n //background(color);\n //1: grayscale, 0 es negro, 255 es blanco\n //2: grayscale + alpha\n //3: rgb, redgreenblue, 0 nada, 255 todo\n //4: rgb + alpha\n //alpha: 0 es transparente, 255 es solido\n background(70, 20, 220, 70)\n \n //framRate (tasa de cuadros por segundo)\n frameRate(8);\n\n //variable local x\n var x\n x = 10\n\n //variable local y\n //modo rapido de DECLARAR\n //y asignar valor inmediatamente \n var y = 10;\n //asignar otro valor\n y = 100;\n\n\n //No borrar las llaves \n}", "function setup() {\r\n canv = createCanvas(800,600);\r\n button = createButton('Save Image');\r\n button.position(50,dims[1] + 25);\r\n button.attribute(\"onclick\",\"saveImage()\");\r\n\r\n background(color('rgba(169,169,169,.5)'));\r\n textSize(18);\r\n stroke(0);\r\n fill(0);\r\n line(50,550,750,550);\r\n triangle(750,545,750,555,760,550);\r\n line(50,50,50,550);\r\n triangle(45,50,55,50,50,40);\r\n text(\"x2\",45,25);\r\n text(\"x1\",769,555);\r\n\r\n HorizDotLine(300,300);\r\n VertiDotLine(300,300);\r\n\r\n\r\n text(\"0\",295,575);\r\n text(\"2\",30,305);\r\n\r\n\r\n\r\n\r\n // Create the grid lines\r\n\r\n //stroke(\"blue\");\r\n //drawVector(a,origin); // Draw 'a' at the origin\r\n\r\n //stroke(\"green\");\r\n //drawVector(b,toCoords(a)); // Draw 'b' at 'a'\r\n\r\n //stroke(\"yellow\");\r\n //drawVector(c,origin); // Draw 'c' (a+b) at the origin\r\n\r\n //stroke(\"pink\");\r\n //scatter(points); // Draw the scatter plot\r\n\r\n //stroke(\"red\");\r\n // Graph the function, where 2,5,1 represents amplitude, angular frequency, and y-offset respectively.\r\n}", "function initAnnotSettings() {\n var ideo = this,\n config = ideo.config;\n\n if (\n config.annotationsPath || config.localAnnotationsPath ||\n ideo.annots || config.annotations\n ) {\n if (!config.annotationHeight) {\n var annotHeight = Math.round(config.chrHeight / 100);\n this.config.annotationHeight = annotHeight;\n }\n\n if (config.annotationTracks) {\n this.config.numAnnotTracks = config.annotationTracks.length;\n } else if (config.annotationsNumTracks) {\n this.config.numAnnotTracks = config.annotationsNumTracks;\n } else {\n this.config.numAnnotTracks = 1;\n }\n this.config.annotTracksHeight =\n config.annotationHeight * config.numAnnotTracks;\n\n if (typeof config.barWidth === 'undefined') {\n this.config.barWidth = 3;\n }\n } else {\n this.config.annotTracksHeight = 0;\n }\n\n if (typeof config.annotationsColor === 'undefined') {\n this.config.annotationsColor = '#F00';\n }\n\n if (config.showAnnotTooltip !== false) {\n this.config.showAnnotTooltip = true;\n }\n\n if (config.onWillShowAnnotTooltip) {\n this.onWillShowAnnotTooltipCallback = config.onWillShowAnnotTooltip;\n }\n\n if (config.annotationsLayout === 'heatmap') {\n // window.onresize = function() {\n // ideo.drawHeatmaps(ideo.annots);\n // };\n\n // ideo.isScrolling = null;\n\n // Listen for scroll events\n // window.addEventListener('scroll', function ( event ) {\n //\n // // Clear our timeout throughout the scroll\n // window.clearTimeout( ideo.isScrolling );\n //\n // // Set a timeout to run after scrolling ends\n // ideo.isScrolling = setTimeout(function() {\n //\n // // Run the callback\n // console.log('Scrolling has stopped.');\n // ideo.drawHeatmaps(ideo.annots);\n //\n // }, 300);\n //\n // // }, false);\n //\n // window.onscroll = function() {\n // ideo.drawHeatmaps(ideo.annots);\n // // console.log('onscroll')\n // };\n }\n\n}", "setDefaults () {\n this.appearance.heatmap = {}\n this.appearance.heatmap.cellSize = 50\n this.appearance.heatmap.columns = this.data.matrix[0].length\n this.appearance.heatmap.rows = this.data.matrix.length\n this.appearance.heatmap.width = this.appearance.heatmap.cellSize * this.appearance.heatmap.columns\n this.appearance.heatmap.height = this.appearance.heatmap.cellSize * this.appearance.heatmap.rows\n\n // Main Title\n if (this.settings.title !== '') {\n this.appearance.title = {\n font: {\n size: 16\n },\n padding: {\n bottom: 20\n }\n }\n } else {\n this.appearance.title = {\n font: {\n size: 0\n },\n padding: {\n bottom: 0\n }\n }\n }\n // Row Axis Title\n this.appearance.rowAxis = {}\n if (this.settings.rowAxis !== '') {\n this.appearance.rowAxis.title = {\n font: {\n size: 12\n },\n padding: {\n left: 30\n }\n }\n } else {\n this.appearance.rowAxis.title = {\n font: {\n size: 0\n },\n padding: {\n left: 0\n }\n }\n }\n // Col Axis Title\n this.appearance.colAxis = {}\n if (this.settings.colAxis !== '') {\n this.appearance.colAxis.title = {\n font: {\n size: 12\n },\n padding: {\n top: 30\n }\n }\n } else {\n this.appearance.colAxis.title = {\n font: {\n size: 0\n },\n padding: {\n top: 0\n }\n }\n }\n // Row Labels\n this.appearance.rowAxis.labels = {\n font: {\n size: 14\n },\n padding: {\n left: 15\n },\n width: this.data.rowLabels.width\n }\n // Col Labels\n this.appearance.colAxis.labels = {\n font: {\n size: 14\n },\n padding: {\n top: 15\n },\n height: this.data.colLabels.height\n }\n // Clustering\n var size = [] // Row Size, Col Size\n var padding = [] // Row R, Col T (only between dendrogram and heatmap)\n if (this.data.rowTree != null) var rowHeight = 50 + this.data.rowTree.height * 0.2\n if (this.data.colTree != null) var colHeight = 50 + this.data.colTree.height * 0.2\n // console.log('row height' + rowHeight)\n // console.log('col height' + rowHeight)\n switch (this.settings.clustering.type) {\n case 'n':\n size = [0, 0]\n padding = [0, 0]\n break\n case 'r':\n size = [rowHeight, 0]\n padding = [10, 0]\n break\n case 'c':\n size = [0, colHeight]\n padding = [0, 10]\n break\n case 'b':\n size = [rowHeight, colHeight]\n padding = [10, 10]\n break\n default:\n size = [0, 0]\n padding = [0, 0]\n break\n }\n this.appearance.clustering = {\n row: {\n size: size[0],\n padding: {\n right: padding[0]\n }\n },\n col: {\n size: size[1],\n padding: {\n bottom: padding[1]\n }\n }\n }\n\n // Canvas\n this.appearance.margin = {\n left: 50,\n right: 50,\n top: 50,\n bottom: 50\n }\n this.configureComponents()\n }", "function onModifExposition(appelInterne) {\n\n\tflagMAJ.calcExposition.actif = 1;\n\n\tflagMAJ.drawFlousEtExpo.actif = 1;\n\tflagMAJ.drawCurseurExposition.actif = 1;\n\tflagMAJ.drawVueHistogrammes.actif = 1;\n\n\tif (!appelInterne)\n\t\tdoMAJ();\n}", "function visualiserPreferences(aMode){\n if (aMode==\"M\") { \n var request = new XMLHttpRequest();\n var url =\"\";\n url = \"/tpreferences\";\n\trequest.open(\"GET\", url, true);\n request.onreadystatechange = function() {\n if (request.readyState === 4 && request.status === 200) {\n var info = JSON.parse(request.responseText);\n document.getElementById(\"txtpreId\").readOnly = true;\n document.getElementById(\"txtjoiId\").readOnly = true;\n // Modal Preferences : #blockPreferences. @google maps\n if (info.length>0) {\n for (i = 0; i < info.length; i++) {\n // Modal Contactez : #blockContactez. Function qui visualise les preferences\n document.getElementById(\"lbljoiMEntreprise\").innerHTML=info[0].nomEntreprise;\n document.getElementById(\"lbljoiMContact\").innerHTML=info[0].nomContact;\n document.getElementById(\"lbljoiMCourriel\").innerHTML=info[0].courriel;\n document.getElementById(\"lbljoiMTelephone\").innerHTML=info[0].telephone;\n document.getElementById(\"lbljoiMAdresse\").innerHTML=info[0].adresse;\n document.getElementById(\"lbljoiMCommentaire\").innerHTML=info[0].commentaire;\n // Modal Preferences : #blockPreferences. Function qui visualise les preferences\n document.getElementById(\"txtpreId\").value=info[0].codepreferences;\n document.getElementById(\"txtpreEntreprise\").value=info[0].nomEntreprise;\n document.getElementById(\"txtpreContact\").value=info[0].nomContact;\n document.getElementById(\"txtpreCourriel\").value=info[0].courriel;\n document.getElementById(\"txtpreTelephone\").value=info[0].telephone;\n staticmKrContent=document.getElementById(\"txtpreAdresse\").value=info[0].adresse;\n document.getElementById(\"txtpreCommentaire\").value=info[0].commentaire;\n //- coordonnées\n staticadLat = document.getElementById(\"txtpreAdLat\").value=info[0].preAdLat;\n staticadLng=document.getElementById(\"txtpreAdLng\").value=info[0].preAdLng;\n staticzm=document.getElementById(\"txtpreZoom\").value=info[0].preZoom;\n staticmKrLat=document.getElementById(\"txtpremKrAdLat\").value=info[0].premKrAdLat;\n staticmKrLng=document.getElementById(\"txtpremKrAdLng\").value=info[0].premKrAdLng;\n document.getElementById(\"txtpreFilepath\").value=info[0].filePath;\n document.getElementById(\"txtpreImgpath\").value=info[0].imgPath;\n // @google maps\n initMap();\n }\n\t\t }\n }\n };\n request.send(); \n } \n} // end visualiser preferences", "set_variables_to_experiment() {\n console.log(\"set_variables_to_experiment\");\n this.curr_conditions_constants = this.experiment_conditions_constants;\n this.curr_condition_index = 0;\n this.curr_round_num = 0;\n this.input_count_array = new Array(this.curr_conditions_constants[0].trials_per_round).fill(0);\n this.is_practice = false;\n }", "function soluce() {\r\n\t\tfor (i=1;i<=this.nbcolonnes;i++) {\r\n\t\t\timg_en_cour='s' + i;\r\n\t\t\tadresse= + this.solution[i].couleur + '.gif';\r\n\t\t\t//change l'adresse de l'image\r\n\t\t\tdocument[img_en_cour].src=adresse;\t\r\n\t\t};\r\n\t}", "function main () {\n\n // T E M P O R A R Y C O D E \n var faves = // An array of objects. To access data, use faves[i].imgSrc and faves[i].annotation\n [\n {\n \"imgSrc\": \"http://apod.nasa.gov/apod/image/1207/sunspotsilhouette_carpentier_960.jpg\",\n \"annotation\": \"What stands between you and the Sun? Apparently, as viewed from Paris last week, one visible thing after another. First, in the foreground, is the Basilica of the Sacred Heart, built in the late 1800s and located on the highest hill in Paris, France.\"\n },\n {\n \"imgSrc\": \"http://apod.nasa.gov/apod/image/1303/PIA16853mercury_900.jpg\",\n \"annotation\": \"The colors of the solar system's innermost planet are enhanced in this tantalizing view, based on global image data from the Mercury-orbiting MESSENGER spacecraft.\"\n },\n {\n \"imgSrc\": \"http://apod.nasa.gov/apod/image/0802/venussouth_vexpress.jpg\",\n \"annotation\": \"Why did an acidic haze spread across Venus? The unusual clouds were discovered last July by ESA's robotic Venus Express spacecraft currently orbiting Venus.\"\n },\n {\n \"imgSrc\": \"http://apod.nasa.gov/apod/image/1509/Earthrise_Apollo8_960.jpg\",\n \"annotation\": \"What's that rising over the edge of the Moon? Earth. About 47 years ago, in December of 1968, the Apollo 8 crew flew from the Earth to the Moon and back again. Frank Borman, James Lovell, and William Anders were launched atop a Saturn V rocket on December 21, circled the Moon ten times in their command module, and returned to Earth on December 27.\"\n },\n {\n \"annotation\": \"This sharp view of Mars recorded on January 22nd is an example of the telescopic images possible in the coming days. The planet's whitish north polar cap is at the upper right. Mars' tiny red disk is about 14 arcseconds in angular diameter, less than 1/100th the diameter of the Full Moon.\",\n \"imgSrc\": \"http://apod.nasa.gov/apod/image/1001/mars_opposition_2010.jpg\",\n \"blah\": \"blah\"\n }\n ];\n\n // Build the gallery container\n var gallery = document.getElementById(\"gallery\"); // Retrieve the div that has id=\"gallery\"\n\n // Each row is a group of three cells\n var i = 0; \n var numRows = Math.ceil(faves.length/3);\n for (row=0; row<numRows; row++) { // for each row\n var divRow = document.createElement(\"div\"); // create a <div class=\"row\"> \n divRow.className = \"row\"; // Skeleton class\n gallery.appendChild(divRow); // attach the row to the gallery container\n\n for (cell=0; cell<3; cell++) { // up to three cells on this row\n if (i < faves.length) { // This is in case our array length isn't divisible by 3\n var divCell = document.createElement(\"div\"); //create a cell for our content\n divCell.className = \"four columns\"; // 1 cell = 4 Skeleton columns\n divRow.appendChild(divCell); // attach the cell to its row\n\n var img = document.createElement(\"img\"); // Image is on top of each cell\n img.src = faves[i].imgSrc;\n img.style = \"max-width: 100%\"; // all APOD images are huge. Try commenting this out.\n divCell.appendChild(img); // append the image to the cell\n \n var parag = document.createElement(\"p\"); \n parag.innerHTML = faves[i].annotation;\n parag.style = \"font-size: 80%\";\n divCell.appendChild(parag); //append the annotation to the cell\n }\n i++;\n }\n }\n // NOTE: No difficulies lining up <div> and </div>\n // NEXT STEP: Load faves array from a JSON file, and add an <a> to the images so they can be viewed at full size\n}", "function initializeViz() {\n var container = document.getElementById(\"vizcontainer\");\n var url = \"https://public.tableau.com/views/WorldIndicators/GDPpercapita\";\n var options = {\n width: container.offsetWidth,\n height: container.offsetHeight,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n publishedSheets = workbook.getPublishedSheetsInfo();\n annyangInit();\n var options = {\n maxRows: 0, // 0 is returning all rows\n ignoreAliases: false,\n ignoreSelection: true\n };\n //activeSheet.getUnderlyingDataAsync(options).then(function(d) {dataFunc(d)});\n //activeSheet.getSummaryDataAsync(options).then(function(t) {sumFunc(t)});\n //getFilters(activeSheet);\n buildSelectFilterCountryCmd();\n buildSelectFilterRegionCmd();\n buildFuzzyCmds();\n }\n };\n viz = new tableau.Viz(container, url, options);\n }", "function disegna_forme() {\n let r = 255 * noise(t + 10);\n let g = 255 * noise(t);\n let b = 255 * noise(t + 20);\n\n let d = dist(x, y, width / 2, height / 2);\n let stroke_val = map(d, 0, maxDist, 0.5, space / 3);\n\n strokeWeight(parametri.stroke);\n\n stroke(r, g, b);\n translate(x, y);\n frameRate(40);\n \n if (random(1) > 0.5){\n if (random(1) > 0.8) {\n //noFill();\n if (random(1) > 0.2) {\n triangle(space/2, parametri.dimTriangle/2, space, space*2, parametri.dimTriangle, space);\n } else {\n triangle(space, space/2, parametri.dimTriangle, space, space/2, parametri.dimTriangle/2);\n }\n } else {\n fill(r, g, b, parametri.trasparenzaEllipse);\n noStroke();\n ellipse(0, 0, parametri.dimEllipse);\n }\n } else {\n if (random(1) < 0.5) {\n rotate(parametri.rotazioneLine)\n line(0, parametri.dimLine, parametri.dimLine, 0);\n } else {\n line(parametri.dimLine, 0, 0, parametri.dimLine);\n }\n }\n\n x += space;\n if (x > windowWidth) {\n x = 0;\n y += space;\n if (y > windowHeight) {\n y += space/2;\n }\n }\n}", "function loadProject(){\n let lastColor = null;\n let wholeProject = project.getWhole();\n let fixations = project.getFixations();\n \n for(let i = 0; i < fixations.length; i++){ \n let codeWindow = codeWindows.objectWithFile(fixations[i].data.path); //find if CodeWindow with file already exists\n\n if(codeWindow === null){\n codeWindow = new CodeWindow(fixations[i].data);\n \n let data;\n \n try{\n data = fs.readFileSync(fixations[i].data.path, \"utf-8\");\n }\n catch(e){\n console.log(i);\n console.log(fixations[i]);\n }\n \n let extension = path.extname(fixations[i].data.path);\n \n codeWindow.addText(data, extension);\n codeWindows.push(codeWindow);\n }\n \n if(fixations[i].name !== \"Fixation\"){\n continue;\n }\n\n nodeIndex++;\n \n //if next fixation is in another file then generate a color for current fixations\n if(nodeIndex < fixations.length - 1 && fixations[nodeIndex].data.path !== fixations[nodeIndex + 1].data.path){\n lastColor = '#'+Math.random().toString(16).substr(-6);\n \n codeWindow.addNode(fixations[nodeIndex], lastColor);\n }\n else if(lastColor !== null){ //if current fixation is first in this file set its color\n codeWindow.addNode(fixations[nodeIndex], lastColor);\n lastColor = null;\n }\n else{\n codeWindow.addNode(fixations[nodeIndex]);\n }\n }\n \n changeScale(true, window.innerHeight - 110, true);\n \n nodeIndex = -1; //reinitialize nodeIndex\n}", "_proximaImgVivo() {\n\t\t//mudar index (como vetor circular)\n\t\tthis._indexImgVivo = (this._indexImgVivo + 1) % this._vetorImgsVivo.length;\n\t\t//mudar img em formaGeometrica\n\t\tthis._colocarImgVivoAtual();\n\t}", "function viewFile() {\n pv.io.fetchPdb('/static/uploads/' + $.url().segment(-1) + '/model.pdb', function(structures) { //normal try catch block doesnt catch exception when fetchPdb doesnt load any data or loads incorrect\n for (var i = 0; i < structures.length; i++) {\n models.push(viewer.cartoon('model' + (i + 1), structures[i], { color: pv.color.uniform(colors[i % 26]) }));\n }\n viewer.autoZoom();\n $('.loading-screen').hide();\n $('html body').animate({ scrollTop: 60}, 500);\n }, { loadAllModels : true } );\n}", "function inicializar(){var v=document.getElementById(\"comprobacion\"); v.innerHTML=\"\"; nota=0.0;}", "function showtableau() {\n console.log(\"showing viz\");\n viz.show();\n}", "function setup() {\n noCanvas();\n\n // let d = new Date;\n // let h = d.getHours();\n // if (h == 9){\n getRandomData();\n // }\n\n let ImgURL = data.inspo[yesterdayInfo].picture;\n let personName = data.inspo[yesterdayInfo].name;\n let Impact = data.inspo[yesterdayInfo].impact;\n let SmallText = data.inspo[yesterdayInfo].smalltext;\n\n createText(ImgURL,personName, Impact, SmallText);\n }", "_motd() {\n global.Console.log(this.separator1);\n global.Console.log(global.Console.color(this.GorgonConfig.data.motd, 'yellow'));\n global.Console.log(this.separator1);\n }", "function hitungPVA() {\n\t\tvar MASKEr = document.getElementById(\"pva1\").value;\n\t\tvar MASKEi= document.getElementById(\"pva2\").value;\n\t\tvar MASKEn= document.getElementById(\"pva3\").value;\n\n\t\tvar Er = MASKEr.split(',').join('');\n\t\tvar Ei = MASKEi.split(',').join('');\n\t\tvar En = MASKEn.split(',').join('');\n\n\t\tvar Eip\t= Ei / 100;\n\t\tvar Efixed = (Math.pow(1+Eip,En)).toFixed(4);\n\t\tvar Epengalipva = (Efixed -1) / (Eip * Efixed);\n\t\tvar Epva = Er * Epengalipva;\n\t\tvar Erpva = Math.round(Epva);\n\t\tdocument.getElementById(\"outputPVA\").innerHTML = \n\t\t\"Faktor Pengali PV-annuitas : \\n\"+\n\t\t\"\t\t= (( 1 + i )^n + 1 ) / ( i x ( 1 + i )^n ) \\n\"+\n\t\t\"\t\t= (( 1 + \"+ Eip +\" )^\"+ En +\" + 1 ) / ( \"+ Eip +\" x ( 1 + \"+ Eip +\" )^\"+ En +\" ) \\n\"+\n\t\t\"\t\t= \"+ Epengalipva.toFixed(4) +\" \\n\"+\n\t\t\"Present Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali PV-annuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKEr +\" x \"+ Epengalipva.toFixed(4) +\"\\n\"+\n\t\t\"\t\t= \"+ uang(Erpva, \"Rp.\");\n\t}", "function arealv() {\r\n\tconfigAddButton();\r\n\t/******** Set Default Vaue ***********/\r\n\t//if(getC(\"minStar\r\n\r\n var picNum = [ \r\n \"http://upic.me/i/vx/80j01.png\",\r\n \"http://upic.me/i/tv/deg02.png\",\r\n \"http://upic.me/i/b3/8uz03.png\",\r\n \"http://upic.me/i/q6/cch04.png\",\r\n \"http://upic.me/i/tm/19605.png\",\r\n \"http://upic.me/i/tm/hlu06.png\",\r\n \"http://upic.me/i/vi/gsq07.png\",\r\n \"http://upic.me/i/xe/re608.png\",\r\n \"http://upic.me/i/qc/wlq09.png\",\r\n ];\r\n var areas = document.getElementsByTagName('area');\r\n var maxArea = areas.length;\r\n var areaMinStar = getC(\"minStar\");if(!areaMinStar){setC(\"minStar\",3);areaMinStar=3;};\r\n var areaHoldStat = getC(\"areaHoldStat\");if(!areaMinStar){setC(\"areaHoldStat\",3);areaMinStar=3;}; //1Free 2Hold 3All\r\n var areaTaken = 0; // 0=all 1=free 2=taken\r\n var arealv;\r\n var areatmp ='';\r\n\tvar star2num = '';\r\n for(var i =0; i<maxArea; i++){\r\n\t\t\r\n\t\tif(areas[i].title.split(' ').length!=2 &&areaHoldStat==1)continue;\r\n\t\tif(areas[i].title.split(' ').length==2 &&areaHoldStat==2)continue;\r\n\t\t\r\n //if(areas[i].title.split(' ').length==2)\t\t//free area\r\n {\r\n\t\t\tstar2num=areas[i].getAttribute('onmouseover').split(\"/img/common/star_warpower_b.gif\");\r\n arealv = star2num.length -1;\r\n\t\t//\tareas[i].setAttribute('onmouseover',star2num[0].split(\"img src\")+\"img src=\\'/\"+picNum[arealv-1]+star2num[star2num.length-1]);\r\n\t\t\tif(arealv>=areaMinStar)\r\n if(i<9)areatmp += '<img src=\"'+picNum[arealv-1]+'\" class=\"mapAll0'+(i+1)+'\" alt=\"\">';else areatmp += '<img src=\"'+picNum[arealv-1]+'\" class=\"mapAll'+(i+1)+'\" alt=\"\">';\r\n }\r\n }\r\n document.getElementById(\"mapsAll\").innerHTML = document.getElementById(\"mapsAll\").innerHTML + areatmp;\r\n}", "function setup() {\n // http://datamx.io/dataset/salario-minimo-historico-1877-2019\n loadTable('../../data/mx_salariominimo_1877-2019.csv', 'csv', 'header', gotData);\n createCanvas(windowWidth, windowHeight);\n}", "pallini(i){\r\n // L'indice dell'immagine deve essere uguale al parametro che gli ho passato \r\n this.indice_immagine = i;\r\n console.log(i);\r\n }", "function visualEaten()\n{\n\tdocument.getElementById(\"eaten_n\").innerHTML=\"\";\n\tdocument.getElementById(\"eaten_b\").innerHTML=\"\";\n\t//visualizza le pedine mangiate nere\n\tfor(var i=0;i<mangiate_n.length;i++)\n\t\tdocument.getElementById(\"eaten_n\").innerHTML+=mangiate_n[i];\n\t//visualizza le pedine mangiate bianche\n\tfor(var i=0;i<mangiate_b.length;i++)\n\t\tdocument.getElementById(\"eaten_b\").innerHTML+=mangiate_b[i];\n}", "get unknownValuePlotting() {\r\n return this.i.ov;\r\n }", "set intensity(value) {}", "function init_conf()\n {\n //----------------------------------\n // //\\\\ study model parameters\n //----------------------------------\n var APP_MODEL_Y_RANGE = 1000;\n //----------------------------------\n // \\\\// study model parameters\n //----------------------------------\n\n\n //====================================================\n // //\\\\ subapp regim switches\n //====================================================\n sconf.enableStudylab = false;\n sconf.enableTools = false;\n //====================================================\n // \\\\// subapp regim switches\n //====================================================\n\n\n //----------------------------------\n // //\\\\ original material parameters\n //----------------------------------\n var pictureWidth = 504;\n var pictureHeight = 495;\n\n var pointA = [ 28, 456 ];\n var pointe = [ 28, 46 ];\n\n var modorInPicX = pointA[0];\n var modorInPicY = pointA[1]; \n //.set it from graph editor\n var pictureActiveArea = pointA[1] - 46;\n //----------------------------------\n // \\\\// original material parameters\n //----------------------------------\n var mod2inn_scale = pictureActiveArea / APP_MODEL_Y_RANGE;\n var originX_onPicture = pointA[0];\n var originY_onPicture = pointA[1];\n\n\n\n\n\n //----------------------------------------------------\n // //\\\\ prepares sconf data holder\n //----------------------------------------------------\n //-----------------------------------\n // //\\\\ topic group colors,\n // todm: possibly proliferation\n //-----------------------------------\n sconf.default_tp_lightness = 30;\n var given = [0, 150, 0, ]; //0.5];\n var proof = [0, 0, 255, ]; //0.5];\n var result = [200, 40, 0, ]; //0.5];\n var hidden = [0, 0, 0, ]; //0];\n\n\n var predefinedTopics =\n {\n given,\n proof,\n result,\n hidden,\n\n //:curves\n \"ABC\" : given,\n \"mainCurve\" : given,\n \"Abc\" : proof,\n \"remoteCurve\" : proof,\n\n //:areas\n \"ABD\" : given,\n \"ACE\" : given,\n \"area-ABD\" : given,\n \"area-ACE\" : given,\n \"Abd\" : proof,\n \"Ace\" : proof,\n \"area-Abd\" : proof,\n \"area-Ace\" : proof,\n //:linear areas\n \"Afd\" : result,\n \"Age\" : result,\n\n \"ABDPerACE\" : given,\n \"AD2PerAE2\" : result,\n };\n //-----------------------------------\n // \\\\// topic group colors,\n //-----------------------------------\n\n\n var originalPoints =\n {\n 'A' : { \n pos : pointA,\n pcolor : given,\n letterAngle : -90,\n },\n 'e' : { \n pos : pointe,\n pcolor : proof,\n letterAngle : 90,\n },\n\n 'B' : { \n pcolor : given,\n letterAngle : 0,\n },\n 'C' : { \n pcolor : given,\n letterAngle : -45,\n },\n 'D' : { \n pcolor : given,\n letterAngle : 215,\n },\n 'E' : { \n pcolor : given,\n letterAngle : 180,\n },\n 'b' : { \n pcolor : proof,\n letterAngle : 0,\n },\n 'c' : { \n pcolor : proof,\n letterAngle : -90,\n },\n 'd' : { \n pcolor : proof,\n letterAngle : 180,\n },\n\n 'F' : { \n pcolor : given,\n letterAngle : 135,\n },\n 'G' : { \n pcolor : given,\n letterAngle : 45,\n },\n 'f' : { \n pcolor : proof,\n letterAngle : 90,\n },\n 'g' : { \n pcolor : proof,\n letterAngle : 90,\n },\n\n 'pivotPoint1' : { \n pcolor : result,\n doPaintPname : false,\n letterAngle : 90,\n },\n\n 'pivotPoint2' : {\n pcolor : given,\n letterAngle : 90,\n doPaintPname : false,\n },\n };\n\n var linesArray =\n [\n { 'Ab' : { pcolor : proof } },\n { 'Ac' : { pcolor : proof } },\n { 'Ad' : { pcolor : result } },\n { 'Ae' : { pcolor : result, 'stroke-width' : 3, } },\n\n { 'Ag' : { pcolor : result, 'stroke-width' : 3, } },\n\n { 'ec' : { pcolor : proof } },\n { 'db' : { pcolor : proof } },\n\n { 'AB' : { pcolor : given } },\n { 'AC' : { pcolor : given } },\n { 'AD' : { pcolor : given } },\n { 'AE' : { pcolor : given, 'stroke-width' : 3, } },\n { 'AG' : { pcolor : given } },\n { 'EC' : { pcolor : given } },\n { 'DB' : { pcolor : given } },\n ];\n\n\n to_sconf =\n {\n //----------------------------------\n // //\\\\ scenario\n //----------------------------------\n hideProofSlider : true, // false,\n hideProofSliderCompletely : false,\n //----------------------------------\n // \\\\// scenario\n //----------------------------------\n\n\n //----------------------------------\n // //\\\\ original lemma parameters\n //----------------------------------\n curvePivots :\n [\n [0, 0],\n //[326.8, 715.3],\n //[326.8*1.05, 742*1.05],\n\n [270.19, 612.8],\n\n //[72.29, 621.2],\n\n //[1516.1, 569.9]\n //[1516.1, 495] //tmp\n [ 1060, 567 ]\n /* very good for debug: simple curve\n [0, 0],\n [500, 1000],\n [1000, 0]\n */\n ],\n\n\n //*************************************************\n // //\\\\ lemma model parameters\n //*************************************************\n APP_MODEL_Y_RANGE,\n //:ranges\n tanA_min : 0.1, //pivot1x/pivot1y minimum\n pivot1y_max : APP_MODEL_Y_RANGE * 0.99,\n pivot2x_max : APP_MODEL_Y_RANGE * 1.8,\n pivot2y_min : APP_MODEL_Y_RANGE * 0.3,\n pivot2y_max : APP_MODEL_Y_RANGE * 0.99,\n\n\n //bezier parameter t of point C on principal curve\n //tC : 0.5, //good for debug\n tC : 0.50077 / 0.79 ,\n\n claimRatio : 0.74081,\n //range:\n claimRatio_max : 0.9, //Dy_per_Ey\n\n\n tiltRatio : 1, //controls DB-line tilt: \n //1 is perpendicular; < 1 dy/dx is negative, > 1 is positive\n //:ranges\n tiltRatio_min : 0.4,\n tiltRatio_max : 1.5,\n Ep2yrange_max : 0.8,\n Cx_min : 0.1,\n //*************************************************\n // \\\\// lemma model parameters\n //*************************************************\n //----------------------------------\n // \\\\// original lemma parameters\n //----------------------------------\n\n\n\n //----------------------------------\n // //\\\\ model-view parameters\n //----------------------------------\n //100; //display in \"percents\" of Ae\n LEGEND_NUMERICAL_SCALE : 100,\n\n modorInPicX,\n modorInPicY,\n innerMediaHeight : pictureHeight + sconf.SLIDERS_LEGEND_HEIGHT,\n innerMediaWidth : pictureWidth,\n\n thickness : 4,\n //----------------------------------\n // \\\\// model-view parameters\n //----------------------------------\n };\n to_sconf.areaScale = 1 / to_sconf.APP_MODEL_Y_RANGE / to_sconf.APP_MODEL_Y_RANGE;\n //----------------------------------\n // \\\\// prepares sconf data holder\n //----------------------------------------------------\n\n\n\n //----------------------------------------------------\n // //\\\\ copy-pastes to sconf\n //----------------------------------------------------\n //making size to better fit lemma's diagram\n fconf.LETTER_FONT_SIZE_PER_1000 = 30;\n\n paste( sconf,\n paste( to_sconf,\n {\n //double back step ../../ is to reuse this path in code for twin-lemma\n mediaBgImage : \"../../b1sec1lemma9/img/lemma9-original.png\",\n\n linesArray,\n predefinedTopics,\n originalPoints,\n originX_onPicture,\n originY_onPicture,\n pictureWidth,\n pictureHeight,\n mod2inn_scale,\n })\n );\n //----------------------------------------------------\n // \\\\// copy-pastes to sconf\n //----------------------------------------------------\n }", "function abrirPantallaConfig() {\n\n Menu.setApplicationMenu(null);\n pantallaConfig = new BrowserWindow({\n width: 600,\n height: 400,\n icon: __dirname + \"/icons/favi.png\",\n transparent: true,\n webPreferences: {\n nodeIntegration: true\n },\n show: false\n })\n pantallaConfig.loadFile('src/frnt/views/conexiones.html')\n pantallaConfig.on('closed', () => { pantallaConfig = null })\n pantallaConfig.once('ready-to-show', () => { pantallaConfig.show() })\n /* pantallaConfig.webContents.openDevTools() */\n}", "function mostrarAyudaIva() {\n $.notify({\n message: 'Ingrese el valor del Iva sin el signo de porcentaje (%).'\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "function setup() {\n createCanvas(500, 375);\n img = loadImage('CAPA JOGO.png');\n img1 = loadImage('tela_ajuda.png');\n img2 = loadImage('tela_creditos.png')\n img3 = loadImage('tela_niveis.png')\n img4 = loadImage('GAME_OVER.png')\n img5 = loadImage('PARABENS.png')\n aluno = loadImage('foto_aluno.jpg');\n prof = loadImage('dede.jfif');\n anm[0] = loadImage('anm1.jpeg');\n anm[1] = loadImage('anm2.jpeg');\n frameRate(60);\n}", "function setup() {\n\n /* controls */\n var divInterface = document.getElementById(\"interface\"); // menu\n var divIntro = document.getElementById(\"intro\"); // intro\n var divSimula = document.getElementById(\"simula\"); // simulation container\n var divView = document.getElementById(\"view\"); // camera preview\n var divBack = document.getElementById(\"back\"); // background\n var divFire = document.getElementById(\"ctrl_fire\"); // snap a picture\n var divButtons = document.getElementById(\"buttons\"); // buttons for aperture ..\n var divHelpful = document.getElementById(\"helpful\"); // helptext for first usage\n var divHelpButton = document.getElementById(\"helpbutton\"); // show help\n var divCamera = document.getElementById(\"camera\"); // div containing camrea\n\n // displays for aperture, shutter and iso settings\n var dispAperture = document.getElementById(\"display_aperture\");\n var dispShutter = document.getElementById(\"display_shutter\");\n var dispIso = document.getElementById(\"display_iso\");\n\n var snapping = false; // true while animating a snapshot\n // The shutter sound is playing and a short animation\n // causes the viewfinder image to blink\n\n\n // These vars are pulled from StillCamera.as\n // They are used to display setting for shutter,aperture and iso\n // No other class has override for these\n var apertureList = [ 1, 1.4, 2, 2.8, 4, 5.6, 8, 11, 16, 22 ],\n shutterList = ['30\"','15\"','8\"','4\"','2\"','1\"',\"1/2\",\"1/4\",\"1/8\",\n \"1/15\",\"1/30\",\"1/60\",\"1/125\",\"1/250\",\"1/500\",\n \"1/1000\",\"1/2000\",\"1/4000\",\"1/8000\"],\n isoList = [\"12800\",\"6400\",\"3200\",\"1600\",\"800\",\"400\",\"200\",\"100\"];\n\n // These are global vars from Fotosimulator.as\n // They regulate which image to display dependent on\n // settings of aperture, shutter and iso\n /*\n public var totalImg:int;\n private var defaultImg:int; // Why private ?\n public var ev:int;\n public var defaultEV:int;\n public var apertureIndex:int;\n public var shutterIndex:int;\n public var isoIndex:int;\n public var evAdjust:int;\n */\n var totalImg, defaultImg, ev, defaultEV, apertureIndex,\n shutterIndex, isoIndex, evAdjust;\n var currentSetArray, currentImage;\n\n // soundfile for taking a picture\n var shutterMP3 = new Howl({ urls:[ 'shutter.mp3']});\n\n var idname; // id of image-set: nightlight, shutter ..,\n var dataSet; // data for this image set, attributes + imagelist\n var attributes; // iso, shutter, aperture settings, which controls are active\n\n var helpful = true; // we deliver some helpful text on first use\n\n // basic eventhandlers for menu (interface), start/end simulation\n divIntro.onclick = startSimulation;\n divView.onclick = endSimulation;\n divHelpButton.onclick = showMeHelp;\n\n\n // change to hi-res menu image\n document.getElementById(\"img_interface\").src=\"images/interface.png\";\n\n\n /**\n * Start preloading image sets\n * Read filenames from imageset and add an img element\n * for each file in the preload div.\n * Without this there will be a delay while image is fetched\n * from server when user snaps a picture\n * IIFE as we only call this function on setup\n */\n (function() {\n var setname, list, pic, divPic, prepend, i;\n var divPreload = document.getElementById(\"preload\");\n for (setname in imagesets) {\n list = imagesets[setname].ImageLoader;\n prepend = imagesets[setname].attributes.prependURLs;\n for (i=0; i < list.length; i++) {\n pic = list[i].url\n divPic = document.createElement('img');\n divPic.src = prepend + pic;\n divPreload.appendChild(divPic);\n }\n }\n })();\n\n function showMeHelp(e) {\n // remove class first to ensure animation is triggered\n removeClass(divHelpful,'let_me_read');\n addClass(divHelpful,'let_me_read');\n divHelpful.onclick = function(e) {\n removeClass(divHelpful,'let_me_read');\n };\n setTimeout(function(e) {\n removeClass(divHelpful,'let_me_read');\n }, 14000);\n }\n\n /**\n * Check which overlay was clicked\n * Activate intro for selected simulation\n * @param {MouseEvent} e\n */\n divInterface.onclick = function(e) {\n e = e || event; // event is global in ie\n var target = e.target || e.srcElement;\n if (target.id === \"interface\" || target.id === \"img_interface\") {\n return false;\n // Do nothing unless an overlay is clicked\n }\n idname = target.id;\n dataSet = imagesets[idname];\n divIntro.style.visibility = \"visible\";\n divInterface.style.visibility = \"hidden\";\n var info = infolist[idname];\n if (info === undefined) {\n console.log(\"Missing info for \", idname);\n return;\n }\n\n // quickref for attributes\n attributes = dataSet.attributes;\n\n var divTitle = document.getElementById(\"title\");\n var divText = document.getElementById(\"text\");\n divTitle.innerHTML = info.title;\n divText.innerHTML = info.text + '<p>Klikk for å begynne ...</p>';\n divIntro.style.backgroundImage = 'url(' + attributes.prependURLs + 'index.jpg)';\n }\n\n /**\n * Show camera and image to focus on\n * Activated by user clicking on divIntro\n * idname and dataSet already set up in checkClick\n * @param {MouseEvent} e\n */\n function startSimulation(e) {\n var activated, i;\n var ctrl; // camera controls on screen\n var stageWidth; // if width is too small - we rearrange the layout\n \n stageWidth = window.innerWidth\n || document.documentElement.clientWidth\n || document.body.clientWidth;\n \n removeClass(divCamera, \"compact\"); // assume we have space enuf \n removeClass(divCamera, \"no_margin\"); \n \n if (stageWidth < 850) {\n if (stageWidth < 700) {\n addClass(divCamera, \"compact\"); // place controls below, shift camera left and up\n } else {\n addClass(divCamera, \"no_margin\"); // remove margins if 700 < w < 850\n }\n } \n\n /*\n // This is code for setting up vars copied from Fotosimulator.as\n currentSetArray = currentSetLoader.content;\n currentImg = currentSetArray[defaultImg];\n totalImg = currentSetLoader.numChildren - 1;\n defaultImg = currentSetLoader.vars.defaultImg;\n defaultEV = currentSetLoader.vars.ev;\n apertureIndex = currentSetLoader.vars.apertureIndex;\n shutterIndex = currentSetLoader.vars.shutterIndex;\n isoIndex = currentSetLoader.vars.isoIndex;\n ev = apertureIndex + shutterIndex - 5 + isoIndex - 7;\n controls = currentSetLoader.vars.controls;\n evAdjust = ev - defaultImg;\n */\n // The code above translated to this:\n defaultImg = +attributes.defaultImg;\n currentSetArray = dataSet.ImageLoader;\n totalImg = currentSetArray.length;\n defaultEV = +attributes.ev;\n apertureIndex = +attributes.apertureIndex;\n shutterIndex = +attributes.shutterIndex;\n isoIndex = +attributes.isoIndex;\n ev = apertureIndex + shutterIndex - 5 + isoIndex - 7;\n evAdjust = ev - defaultImg;\n\n // Show helpful text if this is first time\n // The text can be removed by click\n // Animation readme will fade it away after 13s\n // Timeout will remove readme class after 14s\n if (helpful) {\n helpful = false; // been there, done that\n showMeHelp(null);\n }\n \n \n\n // set up backgrounds and visibility\n divIntro.style.visibility = \"hidden\";\n divIntro.style.backgroundImage = 'url(\"images/interface.png\")';\n divBack.style.backgroundImage = 'url(' + attributes.prependURLs + 'index.jpg)';\n divSimula.style.visibility = \"visible\";\n addClass(document.getElementById(\"controls\"), \"controllme\");\n \n // set all controls to passive at start\n activated = \"aperture,shutter,iso\".split(\",\");\n for (i = 0; i < activated.length; i++) {\n ctrl = activated[i];\n document.getElementById(\"ctrl_\" + ctrl).className = \"passive\";\n }\n \n if (attributes.controls !== \"\") {\n // if attribute.controls is not empty\n // then it contains list of active controls\n // otherwise all are active\n activated = attributes.controls.split(\",\");\n }\n \n // activate controls for this set, default is all controls active\n for (i = 0; i < activated.length; i++) {\n ctrl = activated[i];\n removeClass(document.getElementById(\"ctrl_\" + ctrl), \"passive\");\n addClass(document.getElementById(\"ctrl_\" + ctrl), \"active\");\n }\n \n // the fire-button is allways active\n addClass(document.getElementById(\"ctrl_fire\"), \"active\");\n addClass(divBack, \"blur\");\n fullScreen();\n update_displays();\n\n // set image to a dark nightlight to indicate no image\n divView.style.backgroundImage = 'url(images/sets/nightlightSet/15.jpg)';\n }\n\n /**\n * Clicking in divButtons triggers this event-listener.\n * We first check if a valid and active button is clicked.\n * We then pick out button name and switch.\n * The result is an adjustment of index into img-array.\n * The displays for aperture, shutter and iso are updated.\n * @param {MouseEvent} e\n */\n divButtons.onclick = function (e) {\n //console.log(e.target);\n e = e || event; // event is global in IE\n var but = e.target || e.srcElement;\n if (but.id.substr(0,4) !== 'ctrl') {\n return; // not a ctrl_ button\n }\n //if ( but.classList.contains(\"passive\")\n // || (but.parentNode && but.parentNode.classList.contains(\"passive\"))) {\n if ( but.className.indexOf(\"passive\") >= 0\n || but.parentNode && but.parentNode.className.indexOf(\"passive\") >= 0) {\n return; // ignore passive buttons\n }\n var operator = but.id.substr(5);\n switch(operator) {\n case 'shutter_left':\n if (shutterIndex > 0) {\n shutterIndex -= 1;\n ev -= 1;\n aperture_auto(idname, 1);\n // auto-adjust aperture if called for\n }\n break;\n case 'shutter':\n if (shutterIndex < shutterList.length -1) {\n shutterIndex += 1;\n ev += 1;\n aperture_auto(idname, -1);\n // auto-adjust aperture if called for\n }\n break;\n case 'aperture':\n if (apertureIndex > 0) {\n apertureIndex -= 1;\n ev -= 1;\n shutter_auto(idname, 1);\n }\n break;\n case 'aperture_left':\n if (apertureIndex < apertureList.length - 1) {\n apertureIndex += 1;\n ev += 1;\n shutter_auto(idname, -1);\n }\n break;\n case 'iso':\n if ( isoIndex > 0) {\n isoIndex -= 1;\n ev -= 1;\n }\n break;\n case 'iso_left':\n if (isoIndex < isoList.length - 1) {\n isoIndex += 1;\n ev += 1;\n }\n break;\n default:\n console.log(\"UNEXPECTED OPERATOR:\",operator);\n return;\n }\n update_displays();\n }\n\n /**\n * shutter has autoadjust for aperture\n * @param {string} id - name of imageSet\n * @param {int} delta - [-1|+1] change for apertureIndex\n */\n function aperture_auto(id, delta) {\n if (id === 'shutter') {\n if (apertureIndex + delta > 0\n && apertureIndex + delta < apertureList.length) {\n apertureIndex += delta;\n }\n }\n }\n\n /**\n * aperture needs autoadjust of shutter\n * @param {string} id - name of imageSet\n * @param {int} delta - [-1|+1] change for shutterIndex\n */\n function shutter_auto(id, delta) {\n if (id === \"aperture\") {\n if (shutterIndex + delta > 0\n && shutterIndex + delta < shutterList.length) {\n shutterIndex += delta;\n }\n }\n }\n\n /**\n * Update aperture, shutter and iso displays\n */\n function update_displays() {\n dispAperture.innerHTML = \"\" + apertureList[apertureIndex];\n dispShutter.innerHTML = \"\" + shutterList[shutterIndex];\n dispIso.innerHTML = \"\" + isoList[isoIndex];\n }\n\n /**\n * Eventlistener for fire-button\n * Updates camera preview window with image based on\n * ev and evAdjust\n * Triggers animation \"snap\"\n * Plays shutter sound\n * @param {MouseEvent} e\n */\n divFire.onclick = function(e) {\n if (snapping) return;\n var currentSetIndex = ev - evAdjust;\n if (currentSetIndex > currentSetArray.length - 1) {\n currentSetIndex = currentSetArray.length - 1;\n } else if (currentSetIndex <= 1) {\n currentSetIndex = 1;\n }\n currentImage = currentSetArray[currentSetIndex];\n snapping = true;\n shutterMP3.play();\n divView.style.backgroundImage = 'url('\n + attributes.prependURLs\n + currentImage.url+ ')';\n addClass(divView, 'snap');\n setTimeout(function(e) {\n removeClass(divView, 'snap');\n snapping = false;\n }, 200);\n }\n\n /**\n * Eventlistener for click on camera-preview\n * Hides simulation and goes back to main menu\n * @param {MouseEvent} e\n */\n function endSimulation(e) {\n divSimula.style.visibility = \"hidden\";\n divView.style.backgroundImage = 'none';\n removeClass(divBack,\"blur\");\n divInterface.style.visibility = \"visible\";\n removeClass(document.getElementById(\"controls\"), \"controllme\");\n removeClass(document.getElementById(\"ctrl_aperture\"), \"active\");\n removeClass(document.getElementById(\"ctrl_shutter\"), \"active\");\n removeClass(document.getElementById(\"ctrl_iso\"), \"active\");\n removeClass(document.getElementById(\"ctrl_fire\"), \"active\");\n removeClass(divHelpful, 'let_me_read');\n removeClass(divHelpful, 'done_reading');\n exitFullscreen();\n }\n\n /**\n * This code can place the simulation in fullscreen\n * I cant see the utility of this ....\n * On windows and linux: F11\n * On mac: cmd+shift+f\n * press again to toggle\n */\n function fullScreen() {\n /*\n if (divSimula.requestFullscreen) {\n divSimula.requestFullscreen();\n } else if (divSimula.webkitRequestFullscreen) {\n divSimula.webkitRequestFullscreen();\n } else if (divSimula.mozRequestFullScreen) {\n divSimula.mozRequestFullScreen();\n } else if (divSimula.msRequestFullscreen) {\n divSimula.msRequestFullscreen();\n }\n //*/\n }\n \n function exitFullscreen() {\n /*\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n // */\n }\n\n}", "function setup () {\n createCanvas(windowWidth, windowHeight)\n // sans contour\n // noStroke()\n // par de curseur / pointeur\n \n}", "function update() {\n // check values of user settings\n if (min.value < 0) {\n alert(\"Minimum cannot be smaller than 0!\");\n return;\n }\n if (max.value > 1) {\n alert(\"Maximum cannot be bigger than 1!\");\n return;\n }\n if (min.value > max.value) {\n alert(\"Minimum cannot be bigger than Maximum!\");\n return;\n }\n if (windowSize.value > maxWindow) {\n alert(\"Window size cannot be bigger than the whole window!\");\n return;\n }\n if (stepSize.value > maxWindow) {\n alert(\"Step size cannot be bigger than the whole window!\");\n return;\n }\n\n // remove current visualization\n $(\"svg\").empty();\n [links_to_draw, barlinks_to_draw, fdglinks_to_draw] = calculateCorrelation(parseFloat(current.value) - 1, windowSize.value);\n heatmap(categories, links_to_draw);\n\n rangeslider.step = stepSize.value;\n style.innerHTML = \".myslider::-webkit-slider-thumb { width: \" + 100 * windowSize.value / maxWindow + \"% !important;}\";\n modified = false;\n\n finalResult.length = 0;\n\n parallelcalculation();\n }", "function refreshImage(){\n\t_steps = checkReplace(_steps, \"#inSteps\");\n\t_amplitude = checkReplace(_amplitude, \"#inScale\");\n\t_R = checkReplace(_R, \"#inMajor\");\n\t_r = checkReplace(_r, \"#inMinor\");\n\t_p = checkReplace(_p, \"#inRadius\");\n\t_m = checkReplace(_m, \"#inAngMult\");\n\t_red = checkReplace(_red, \"#inRed\");\n\t_green = checkReplace(_green, \"#inGreen\");\n\t_blue = checkReplace(_blue, \"#inBlue\");\n\t_alpha = checkReplace(_alpha, \"#inAlpha\");\n\t\n\tclear(); \n\tnewLine.init();\n}", "function MoverHeuristico(){\n //Limpieza del tablero por cada iteracion\n for(var i =0; i< tx;i++){\n for(var j =0; j<ty;j++){\n console.log(document.getElementById(i+ \",\" + j).style.backgroundColor)\n if(document.getElementById(i+ \",\" + j).style.backgroundColor == \"rgb(0, 153, 255)\"){\n document.getElementById(i+ \",\" + j).style.backgroundColor = \"rgb(209, 209, 209)\"\n }\n \n }\n }\n \n //Espliteando las posiciones de los agentes y la meta para poder asignarlas luego\n var xinit = parseInt(idAgente2.split(\",\")[0]);\n var yinit = parseInt(idAgente2.split(\",\")[1]);\n var xid1 = parseInt(idAgente.split(\",\")[0]);\n var yid1 = parseInt(idAgente.split(\",\")[1]);\n var xMeta = parseInt(idMeta.split(\",\")[0]);\n var yMeta = parseInt(idMeta.split(\",\")[1]);\n\n //Instancia de la matriz en la cual se va a calcular.\n var grid = new PF.Grid(tx,ty);\n var finder = new PF.AStarFinder();\n\n //Meto los lugares que no son visitables\n grid.setWalkableAt(xMeta, yMeta, true);\n \n //Meto los lugares que no son visitables\n grid.setWalkableAt(xid1, yid1, true);\n\n //Bucle para que las paredes se metan al grid\n for(var i =0; i< tx; i++){\n for(var j=0; j<ty; j++){\n \n if(matriz2[j][i] == pared2){\n //lugares no transitables\n grid.setWalkableAt(i,j,false);\n }else {\n grid.setWalkableAt(i,j,true);\n }\n }\n }\n var path = finder.findPath(xinit, yinit, xMeta, yMeta, grid);\n \n //Me retorna un path que es la lista de lugares que se tiene que mover el agente y se lo mando al movimiento\n MoverAgenteHeuristico(path);\n \n}", "function init_conf()\n {\n var to_sconf = {};\n\n //----------------------------------\n // //\\\\ original material parameters\n //----------------------------------\n //var pictureWidth = 928;\n //var pictureHeight = 850;\n var pictureWidth = 1856;\n var pictureHeight = 1700;\n\n //to comply standard layout, one must add these 2 lines:\n var realSvgSize = ( pictureWidth + pictureHeight ) / 6;\n var controlsScale = realSvgSize / sconf.standardSvgSize\n\n var masterCenterX = 850;\n var masterCenterX = 853;\n var masterCenterY = 976;\n var masterCenterY = 978;\n\n var centerX_onPicture = 384;\n var centerY_onPicture = 551;\n var centerY_onPicture = 553;\n\n var mod2inn_scale;\n\n var pointsOnPicture =\n {\n //C : [56, 550],\n C : [50, 550],\n //B : [836, 552],\n B : [838, 552],\n //B : [834, 554],\n P : [548, 77],\n M : [391,634],\n N : [380, 476],\n T : [411, 219],\n O : [centerX_onPicture, centerY_onPicture],\n R : [734, 346],\n AA : [568, 244],\n };\n //----------------------------------\n // \\\\// original material parameters\n //----------------------------------\n\n\n var gamma = Math.PI*0.49;\n var a;\n var beta;\n var alpha;\n\n var initial_g;\n\n ///derives initial model parameters from picture's points\n (function() {\n var pp = pointsOnPicture;\n var B = pp.B;\n var C = pp.C;\n var O = pp.O;\n var M = pp.M;\n var N = pp.N;\n var AA = pp.AA;\n var BC = [ B[0] - C[0], B[1] - C[1] ];\n mod2inn_scale = mat.unitVector(BC).abs;\n var wwb = ( B[0] - O[0] ) / ( B[0] - C[0] ); //0.6\n a = 1 - wwb;\n a = 0.428;\n a = 0.435;\n\n //---sets initial param g\n var OM = [ M[0] - O[0], M[1] - O[1] ];\n initial_Munit = mat.unitVector(OM);\n initial_g = initial_Munit.abs/mod2inn_scale;\n initial_g = 0.105;\n //is an absolute value of an angle:\n gamma = Math.acos( initial_Munit.unitVec[0] ); \n gamma *= 1.01;\n\n //---sets initial decorational param gN\n var ON = [ N[0] - O[0], N[1] - O[1] ];\n initial_Nunit = mat.unitVector(ON);\n to_sconf.initial_gN = -initial_Nunit.abs/mod2inn_scale;\n\n\n var BAA = mat.p1_to_p2( B, AA );\n beta = -Math.asin( BAA.unitVec[1] ); \n beta = 0.862;\n beta = 0.870;\n beta = 0.859;\n beta = 0.863;\n\n //ccc( 'beta fraction=' + (beta/Math.PI).toFixed(3) );\n var CAA = mat.p1_to_p2( C, AA );\n alpha = -Math.asin( CAA.unitVec[1] ); \n alpha = 0.543;\n alpha = 0.528;\n\n //ccc( 'alpha fraction=' + (alpha/Math.PI).toFixed(3) );\n })();\n\n //----------------------------------\n // //\\\\ app view parameters\n //----------------------------------\n // application coordinate Y\n // -1 if it goes in opposite-to-screen\n // direction starting from\n // centerY_onPicture\n // 1 codirectional with the screen\n // which means from screen-top to\n // screen bottom\n var MONITOR_Y_FLIP = -1;\n //var mod2inn_scale = ...\n var activeAreaOffsetOnPictureY = centerY_onPicture;\n //----------------------------------\n // \\\\// app view parameters\n //----------------------------------\n\n\n //----------------------------------------------------\n // //\\\\ prepares sconf data holder\n //----------------------------------------------------\n fapp.normalizeSliders( pictureHeight / 500 ); //todo not automated, prolifer.\n sconf.default_tp_lightness = 30;\n Object.assign( to_sconf, {\n mediaBgImage : \"diagram.png\",\n dontRun_ExpandConfig : true,\n initialPoints : pointsOnPicture,\n\n //CBAng : CBAng,\n gamma : gamma,\n a : a,\n beta : beta,\n alpha : alpha,\n\n initial_g : initial_g,\n\n //----------------------------------\n // //\\\\ model-view parameters\n //----------------------------------\n MONITOR_Y_FLIP : MONITOR_Y_FLIP,\n\n modorInPicY : masterCenterY,\n originX_onPicture : masterCenterX, //needed for common sliders\n originY_onPicture : masterCenterY, //needed for common sliders\n\n modorInPicX : masterCenterX,\n innerMediaHeight : pictureHeight + sconf.SLIDERS_LEGEND_HEIGHT,\n innerMediaWidth : pictureWidth,\n\n thickness : 1,\n //----------------------------------\n // \\\\// model-view parameters\n //----------------------------------\n\n //----------------------------------\n // //\\\\ scenario\n //----------------------------------\n hideProofSlider : true, //false,\n enableStudylab : false,\n enableTools : true,\n //----------------------------------\n // \\\\// scenario\n //----------------------------------\n\n default_tp_stroke_opacity : 0.5,\n default_tp_stroke_width : Math.floor( 10 * controlsScale ),\n defaultLineWidth : Math.floor( 2 * controlsScale ),\n handleRadius : Math.floor( 25 * controlsScale ),\n });\n sconf.pointDecoration.r = sconf.handleRadius;\n\n\n //----------------------------------\n // //\\\\ spawns to_conf\n //----------------------------------\n (function () {\n var inn2mod_scale = 1/mod2inn_scale;\n\n //for Y:\n\n to_sconf.APP_MODEL_Y_RANGE = 1;\n to_sconf.mod2inn_scale = mod2inn_scale;\n to_sconf.inn2mod_scale = inn2mod_scale;\n\n to_sconf.mod2inn_scale_initial = //todm rid\n mod2inn_scale;\n\n to_sconf.inn2mod_scale_initial = inn2mod_scale;\n })();\n //----------------------------------\n // \\\\// spawns to_conf\n // \\\\// prepares sconf data holder\n //----------------------------------------------------\n\n\n\n //----------------------------------------------------\n // //\\\\ copy-pastes to sconf\n //----------------------------------------------------\n Object.keys( to_sconf ).forEach( function( key ) {\n sconf[ key ] = to_sconf[ key ];\n });\n //----------------------------------------------------\n // \\\\// copy-pastes to sconf\n //----------------------------------------------------\n }", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function reset() {\n // clear all points\n points = [];\n // set background\n background(controllers.backgroundColor);\n // for all vertices draw it\n for (let i = 0; i < controllers.verticesCount; i++) {\n let angle = i * TWO_PI / controllers.verticesCount;\n let v = p5.Vector.fromAngle(angle);\n v.mult((rWidth-50) / 2);\n v.add(250+rWidth/2, rHeight / 2);\n // add to points\n points.push(v);\n // draw points\n strokeWeight(10);\n stroke(\"#EC7272\");\n point(v.x, v.y);\n // textSize(32);\n // fill(0, 102, 153);\n // text(i, v.x+10, v.y+10);\n }\n // create current point\n current = createVector(random(width), random(height));\n}", "set Wireframe(value) {}", "function initViz() {\n console.log(\"Hello!\");\n // no const with viz as it has been assigned by let at the top\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function prepararejercicio(){\n resetearimagenejercicio();\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n elegido = prepararejerciciorandom();\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(elegido[0]);\n this.contrast(elegido[1]);\n this.saturation(elegido[2]); \n this.exposure(elegido[3]);\n this.noise(elegido[4]);\n this.stackBlur(elegido[5]); \n this.render();\n });\n}", "function actualizarAlmohadon() {\n var newSRC = baseSRC + almohadonNuevo.modelo + \"_\" + almohadonNuevo.forma + \"_\" + almohadonNuevo.color + \".png\";\n actualizarCanvas(newSRC);\n}", "function generateIdeaData()\n{\n createGraph();\n \n}", "function app() {\n $(\"label[id=vx]\").html( globalMoveByX );\n $(\"label[id=vy]\").html( globalMoveByY );\n $(\"label[id=degree]\").html( vangle / 0.0174533);\n $(\"label[id=radius]\").html( globalRadius);\n \n lastX = globalCenterX + Math.cos(globalAngle) * globalRadius ;\n lastY = globalCenterY + Math.sin(globalAngle) * globalRadius ;\n\n \n draw();\n}", "function setInitialValues(w, t, f, a) {\n\n //Set the labels from the info bar\n $('#arrow').text('Arrow: ' + Boolean(a));\n $('#wumpus').text('Wumpus: ' + w);\n $('#traps').text('Traps: ' + t);\n $('#size').text('Size: ' + f);\n\n fieldSize = f;\n traps = t;\n wumpus = w;\n\n}", "function verifGg() {\r\n verifColonne();\r\n verifLigne();\r\n verifDiagonaleSlach();\r\n verifDiagonaleBackSlash();\r\n basculeJoueur();\r\n}", "function siguientePaso() {\n const nuevaMatriz = Array(w);\n for (let i = 0; i < w; i++) {\n nuevaMatriz[i] = Array(h);\n for(let j = 0; j < h; j++) {\n nuevaMatriz[i][j] = calcularCelula(i,j);\n }\n }\n\n matriz = nuevaMatriz;\n actualizarCanvas();\n}", "function intialisation() {\n console.log(\"Reintialisation\");\n initialiser = 1;\n fin = 0;\n tabPlaying = [0,0,0,0,0]; //Tableau à 0 quand le son est stoppé\n enCours = false; //Si les numéros sont entrain de tourner\n selectMatricule; //Matricule sélectionné\n pointsFixes = []; //Tableau comportant les coordonées des pastilles\n seuil = 1; //Seuil pour la fusion de détections trop proches\n suppresion = 0; //Variable pour compter le nombre de détections fusionées\n nbMatricule = 14; //Nombre de matricule\n numPrecedent = 10; //Retient le dernier nombre d'occurence\n //Scanne les tâches pour initialiser\n initialiserPointsFixes();\n if(debutCache) {\n debutCache = 0;\n setTimeout(function() {\n startNumber();\n cacheGomettes();\n }, 3000);\n }\n}", "function mappy(dataset) {\n var newAreas = {};\n dataset.forEach((key) => {\n let area = {};\n area.value = key.Tasso;\n area.tooltip = {\n content:\n \"<span style='font-weight:bold;'>\" +\n key.Nazione +\n \" \" +\n \"</span>\" +\n \"<br/>\" +\n \"Software illegale: \" +\n area.value +\n \"%\" +\n \"<br>Valore: \" +\n key.Valore +\n \"$ milioni\",\n };\n area.eventHandlers = {\n click: function (e, id, mapElem, textElem) {\n $(\".first\").remove();\n $(\".f32\").remove();\n $(\".graph-container\").removeClass(\"hidden\");\n $(\"#description\").append(\n \"<p class='first f32' style='font-weight:bold; font-size: 1.2em; margin-left: 20px;'>\" +\n key.Nazione +\n \" \" +\n \"<span class='flag \" +\n key.Codice.toLowerCase() +\n \"'></span></p>\"\n );\n $(\"#description\").append(\n \"<p class='first' style='font-size:18px; margin-left: 20px;'>É possibile confrontare fino a quattro paesi, da notare \" +\n \"la tendenza inversamente proporzionale tra i valori dei due grafici</p>\"\n );\n creategraph(dataset, key.Codice);\n creategraphalt(dataset, key.Codice);\n $(\".container\").trigger(\"zoom\", {\n level: 8,\n latitude: key.latitude,\n longitude: key.longitude,\n });\n $(\".container\").addClass(\"active\");\n $(\".container\").trigger(\"tooltip.css\", {\n display: \"block\",\n });\n },\n };\n newAreas[key.Codice] = area;\n });\n $(\".container\").mapael({\n map: {\n name: \"world_countries\",\n //width: 500,\n zoom: {\n enabled: true,\n step: 0.25,\n maxLevel: 20,\n },\n defaultArea: {\n attrs: {\n fill: \"#666666\",\n stroke: \"#ced8d0\",\n \"stroke-width\": 0.3,\n cursor: \"pointer\",\n },\n attrsHover: {\n \"stroke-width\": 1.5,\n },\n },\n defaultPlot: {\n text: {\n attrs: {\n fill: \"#b4b4b4\",\n },\n attrsHover: {\n fill: \"#fff\",\n \"font-weight\": \"bold\",\n },\n },\n },\n },\n text: {\n attrs: {\n cursor: \"pointer\",\n \"font-size\": 10,\n fill: \"#666\",\n },\n },\n areas: newAreas,\n legend: {\n area: {\n display: true,\n //mode: \"horizontal\",\n title: \"Percentuale di software illegale scaricato\",\n marginBottom: 6,\n slices: [\n {\n max: 25,\n attrs: {\n fill: \"#6aafe1\",\n },\n legendSpecificAttrs: {\n stroke: \"#505050\",\n },\n label: \"Tasso < 25%\",\n },\n {\n min: 26,\n max: 50,\n attrs: {\n fill: \"#459bd9\",\n },\n label: \"Tasso compreso tra 25 e 50 %\",\n },\n {\n min: 51,\n max: 75,\n attrs: {\n fill: \"#2579b5\",\n },\n label: \"Tasso compreso tra 50 e 75 %\",\n },\n {\n min: 76,\n attrs: {\n fill: \"#1a527b\",\n },\n label: \"Tasso > 75%\",\n },\n ],\n },\n },\n });\n $(\".zoomReset\").click(function () {\n //flush all\n $(\".container\").removeClass(\"active\");\n $(\".graph-container\").addClass(\"hidden\");\n myfunCalls = 0;\n check = [];\n checkalt = [];\n $(\"#limit\").css(\"display\", \"none\");\n });\n }", "function comprovarDictat () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toLowerCase() !=this.correcte.toLowerCase()) {\r\n this.putImg(\"imatges/error.gif\");\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.actual = \"\";\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n this.validate=1;\r\n }\r\n}", "function hitungFVA() {\n\t\tvar MASKBr = document.getElementById(\"fva1\").value;\n\t\tvar MASKBi = document.getElementById(\"fva2\").value;\n\t\tvar MASKBn = document.getElementById(\"fva3\").value;\n\n\t\tvar Br = MASKBr.split(',').join('');\n\t\tvar Bi = MASKBi.split(',').join('');\n\t\tvar Bn = MASKBn.split(',').join('');\n\n\t\tvar Bip = Bi / 100;\n\t\tvar Bpengalifv = ( (Math.pow(1+Bip,Bn)) - 1 ) / Bip;\n\t\tvar Bfva = Math.round(Br * Bpengalifv);\n\t\tdocument.getElementById(\"outputFVA\").innerHTML = \n\t\t\"Faktor Pengali FVanuitas : \\n\"+\n\t\t\"\t\t= ( ( 1 + i )^n - 1 ) / i \\n\"+\n\t\t\"\t\t= ( (1 + \"+ Bip +\")^\"+ Bn +\" - 1 ) / \"+ Bip +\" \\n\"+\n\t\t\"\t\t= \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"Future Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali Fvanuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKBr +\" x \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"\t\t= \"+ uang(Bfva, \"Rp.\");\n\t\t}", "async function main() {\n new p5((p_) => {\n p = p_;\n p.setup = setup;\n p.draw = draw;\n }, elements.container);\n\n // Settings\n const lineSettings = gui.addFolder('Line');\n lineSettings.add(settings, 'radius', 10, 800).step(1).onChange(redraw);\n lineSettings\n .add(settings, 'lineControlPoint', 5, 25)\n .step(1)\n .onChange(redraw);\n lineSettings.add(settings, 'lineWidth', 1, 10).step(1).onChange(redraw);\n lineSettings.add(settings, 'yStep', 1, 100).step(1).onChange(redraw);\n\n const noiseSettings = gui.addFolder('Noise');\n noiseSettings.add(settings, 'noiseSpeed', 0.1, 1).step(0.1).onChange(redraw);\n noiseSettings.add(settings, 'noiseXStep', 0.1, 10).step(0.1).onChange(redraw);\n noiseSettings\n .add(settings, 'noiseYFactor', 0.01, 1)\n .step(0.01)\n .onChange(redraw);\n\n const viewSettings = gui.addFolder('View');\n viewSettings.addColor(settings, 'bgColor').listen().onChange(redraw);\n viewSettings.addColor(settings, 'lineColorUp').listen().onChange(redraw);\n viewSettings.addColor(settings, 'lineColorDown').listen().onChange(redraw);\n viewSettings.add(settings, 'randomizeColors');\n\n gui.add(settings, 'redraw');\n gui.add(settings, 'saveImage');\n gui.close();\n\n if (ENABLE_STATS) {\n stats.showPanel(0);\n elements.stats.appendChild(stats.dom);\n }\n}", "function imprime() {\n $('#nomina').DataTable({\n dom: 'Bfrtip',\n buttons: [{\n extend: 'copyHtml5',\n text: 'Copiar',\n title: `Carpintería Meraz | Nómina ${tipo} | ${anio}`,\n footer: true\n },\n {\n extend: 'excelHtml5',\n title: `Carpintería Meraz | Nómina ${tipo} | ${anio}`,\n filename: `Nomina-${tipo}-excel-${anio}`,\n footer: true\n },\n {\n extend: 'pdfHtml5',\n text: 'PDF',\n title: `Carpintería Meraz | Nómina ${tipo} | ${anio}`,\n filename: `Nomina-${tipo}-${anio}`,\n footer: true\n }]\n });\n}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function showUserPreferences(compagnia, clima, mezzo, viaggio){\r\n\tif(compagnia != -1) //Se non è specificata, lasciamo il più\r\n\t\tmodifyPreference(COMPAGNIA, compagnia);\r\n\tif(clima != -1)\r\n\t\tmodifyPreference(CLIMA, clima);\r\n\tif(mezzo != -1)\r\n\t\tmodifyPreference(MEZZO, mezzo);\r\n\tif(viaggio != -1) \r\n\t\tmodifyPreference(VIAGGIO, viaggio);\r\n}", "function actualitzaPregunta (color) {\r\n index = this.wordActual;\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br> \"+this.actual + this.putCursor (color);\r\n}", "function escoltaDictat () {\r\n this.capa.innerHTML=\"\";\r\n if(!this.validate) {\r\n this.putSound (this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += this.actual+this.putCursor ('black');\r\n }\r\n else {\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function initInterfaz() {\n let status = this.g.options.status;\n\n function reflejarOpciones(opts) {\n for(const ajuste of this.ajustes.$children) {\n const input = ajuste.$el.querySelector(\"input\");\n if(opts[input.name]) {\n input.checked = true;\n input.dispatchEvent(new Event(\"change\"));\n }\n }\n }\n\n // Nos aseguramos de que al (des)aplicarse\n // un filtro o corrección se refleja en la interfaz.\n this.g.Centro.on(\"filter:* unfilter:*\", reflejarFiltro.bind(this));\n this.g.Centro.on(\"correct:* uncorrect:*\", reflejarCorreccion.bind(this));\n\n let opciones = {};\n if(status) {\n this.g.setStatus(); // Aplicamos el estado del mapa.\n // Lo único que queda por reflejar son las opciones\n // exclusivas de la interfaz virtual.\n for(const o in defaults_v) {\n const name = o.substring(0, 3);\n if(status.visual.hasOwnProperty(name)) {\n opciones[o] = status.visual[name];\n }\n }\n if(status.esp) this.selector.cambiarSidebar(status.esp);\n }\n else opciones = this.options;\n\n reflejarOpciones.call(this, opciones);\n\n // Si no se incluyen vacantes telefónicas, entonces\n // debe deshabilitarse la corrección por adjudicaciones no telefónicas.\n if(!this.options[\"correct:vt+\"]) {\n for(const f of this.filtrador.$children) {\n if(f.c.tipo === \"correct\" && f.c.nombre === \"vt\") {\n f.$children[0].disabled = true;\n break;\n }\n }\n }\n\n // Una vez aplicados todos los cambios iniciales, definimos\n // el disparador para que vaya apuntando en local los cambios de estado.\n // TODO: Esto quizás se pueda pasar a un sitio más adecuando, haciendo uso de statusset\n this.g.on(\"statuschange\", e => {\n if(localStorage && this.options.recordar) localStorage.setItem(\"status\", this.status);\n });\n\n this.g.fire(\"statusset\", {status: !!status});\n // Guardamos el estado final de la inicialización.\n this.g.fire(\"statuschange\");\n }", "function start(){\n\tconsole.log(\"************** START ***************\");\n\tmatr=[[0,0,0],[0,0,0],[0,0,0]];\n\tgiocatore=1;\n\tturno=1;\n\tnumMosse=0;\n\tresultString=\"\";\n\tcol=[0,0,0];\n\trig=[0,0,0];\n\tdig=[0,0];\n\tdet=0;\n}", "function loadvariables(){ // this would be used if this was connected to a db \n checkFilesExist(); // make sure the local filesystem files exist, if not create them!\n c(); // spacer\n c(\"[File System]\",\"Loading previously saved letiables\",\"cyan\"); // warn console that you're loading them\n c(\"[File System]\",\"Loading Alpha Roles Given...\",\"cyan\"); // warn that you're going to load the alpha roles given count\n fs.readFile(AlphaCountFileName, 'utf8', function(err, data) {NewCount=parseInt(data);}); // read the file and load the letiable(s)\n c(); // spacer\n}", "function set_data(){\n set_global_stats(STATS.global);\n\n set_most_least_infected_table(STATS.countries);\n\n apply_data_to_table({\n id: \"infected-list\",\n stats: STATS.countries,\n random: false\n });\n\n // Infected list pagination\n acl_set_paginate();\n\n // set_country_list();\n\n update_set_view_triggers();\n update_widget_triggers();\n\n update_countup();\n\n set_view();\n}", "function printInfo() {\n let ypos = 20;\n let xpos = 10;\n function nextY(){ ypos+=20; return ypos;}\n viewer.print('Dr.Santi Nuratch', xpos, nextY(), 'rgba(255,255,255,0.5)', 14);\n viewer.print('Machine Learning Algorithm', xpos, nextY(), 'rgba(255,255,10,0.5)', 14);\n viewer.print('Embedded Computing and Control Laboratory', xpos, nextY(), 'rgba(50,255,85,0.5)', 14);\n viewer.print('ECC-Lab | INC-KMUTT', xpos, nextY(), 'rgba(255,150,50,0.5)', 14);\n viewer.print('02 April 2018', xpos, nextY(), 'rgba(155,155,255,0.5)', 14);\n \n\n nextY(); // add empty line\n for(let i=0; i<centroids.length; i++) {\n viewer.print('Class-' + i + ': ' + centroids[i].members.length, xpos, nextY(), centroids[i].color);\n }\n viewer.print('Iteration: ' + (numIterations+1), xpos, nextY(), 'rgba(255,255,255,0.5)'); \n \n let err = (cenDist==0)?TERMINATION_TH/2 + Math.random() : cenDist;\n viewer.print('Error[' + (numIterations+1) +']: ' + err.toFixed(2), xpos, nextY(), 'rgba(255,255,255,0.5)'); \n }", "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "function initialisation() {\n // No vector by default\n map.getLayers().getArray()[3].setVisible(false);\n map.getLayers().getArray()[4].setVisible(false);\n map.getLayers().getArray()[1].setVisible(false);\n map.getLayers().getArray()[2].setVisible(false);\n\n centrer(porteStartLocalisation);\n}", "handleVisualize() {\n const { selectedBrowserAssembly } = this.getSelectedAssemblyAnnotation();\n visOpenBrowser(this.props.context, this.state.currentBrowser, selectedBrowserAssembly, this.state.selectedBrowserFiles, this.context.location_href);\n }", "function showGlobalConfig() {\n $(\"#global-setting\").show();\n $(\"#global-setting .modal-body\").html(\"\");\n settingTextarea = monaco.editor.create($(\"#global-setting .modal-body\")[0], {\n language: 'json',\n value:formatJson(JSON.stringify(rocketUser.setting)),\n wordWrap: 'on', //自行换行\n verticalHasArrows: true,\n horizontalHasArrows: true,\n scrollBeyondLastLine: false,\n contextmenu:false,\n automaticLayout: true,\n fontSize:13,\n minimap: {\n enabled: false // 关闭小地图\n }\n\n });\n}", "function runDefault(){\n var fovy = 60;\n \n var aspect = width/height;\n var znear = 0.1;\n\n var zfar = 1000;\n\n var ymax = znear * Math.tan(fovy * Math.PI / 360.0);\n var ymin = -ymax;\n var xmin = ymin * aspect;\n var xmax = ymax * aspect;\n\n var left = xmin;\n var right = xmax;\n var top = ymax;\n var bottom = ymin;\n\n var X = 2 * znear / (right - left);\n var Y = 2 * znear / (top - bottom);\n var A = (right + left) / (right - left);\n var B = (top + bottom) / (top - bottom);\n var C = -(zfar + znear) / (zfar - znear);\n var D = -2 * zfar * znear / (zfar - znear);\n \n projectionMatrix = M4x4.$(\n X, 0, 0, 0, \n 0, Y, 0, 0, \n A, B, C, -1, \n 0, 0, D, 0);\n \n normalMatrix = M4x4.I;\n }", "function Start () {\n\tloadFile(\"http://www.lanilabs.com/system/user_models/stlfiles/000/000/453/original/farm_fixed.stl\");\n\t//updateAppearance(\"1,1.1\");\n}", "function resetValues () {\n Preferences.set('visualCascade', false);\n Preferences.set('browsers', Preferences.defaults.browsers);\n\n init();\n }", "function Analog_humec() {\r\n let newDataset = {\r\n label: 'HumEC',\r\n func: Analog_humec,\r\n backgroundColor: \"rgb(12, 1, 90)\",\r\n borderColor: \"rgb(12, 1, 90)\",\r\n data: [],\r\n fill: false\r\n };\r\n if (config.data.datasets.find( element =>element.label === newDataset.label) ){\r\n console.log ( \"Ya existe esta grafica\");\r\n }else{\r\n for (const prop in LocalDatabase_analog){\r\n if(LocalDatabase_analog[prop].humCap){\r\n newDataset.data.push({x:LocalDatabase_analog[prop].timestamps.substr(11,5), y:LocalDatabase_analog[prop].humEC.rawData});\r\n }\r\n }\r\n config.data.datasets.push(newDataset);\r\n updateChart();\r\n }\r\n}", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "function posicionaNaviosAdversario(){\r\n for (var i = 0; i < 10; i++){\r\n linhaRandom = Math.floor(Math.random()*10);\r\n colunaRandom = Math.floor(Math.random()*10);\r\n if (tabuleiro[linhaRandom][colunaRandom] == ' ~~~~ '){\r\n tabuleiro[linhaRandom][colunaRandom] = \" OOOO \";\r\n contadorComputador++;\r\n }\r\n }\r\n naviosComputador = contadorComputador;\r\n}", "function setUpCurrentVar() {\r\n g_current_var['section'] = g_search_info_level2['currentsection'];\r\n g_current_var['rangekmstart'] = g_all_result['mindis'];\r\n g_current_var['rangekmend'] = g_all_result['maxdis'];\r\n //For Flag Positioning\r\n var lastindex = g_all_result['usedlength'];\r\n g_current_var['flagfirstlat'] = g_all_result[0]['lat'];\r\n g_current_var['flagfirstlong'] = g_all_result[0]['long'];\r\n g_current_var['flaglastlat'] = g_all_result[lastindex]['lat'];\r\n g_current_var['flaglastlong'] = g_all_result[lastindex]['long'];\r\n\r\n }", "function update_interactiveness() {\n var interactive = document.getElementById('interactive').checked;\n// if (!(interactive)) { \n// eb.hide(); \n// } else {\n// eb.show();\n// }\n if (wt.instance.raw) { // && wt.filename) {\n var filename = wt.instance.filename;\n var path = wt.instance.path;\n var current_value = editor.getValue();\n var new_editor = set_data(null, current_value);\n new_editor.instance.filename = filename;\n new_editor.instance.path = path;\n }\n }", "clear() {\n this._interim = 0;\n }" ]
[ "0.5562075", "0.5368311", "0.49783838", "0.4940044", "0.49340236", "0.4899862", "0.48984042", "0.48893934", "0.48822057", "0.48210415", "0.4804024", "0.47807515", "0.47615236", "0.47570205", "0.4729219", "0.47286013", "0.47242296", "0.46756524", "0.46644023", "0.4657177", "0.4645863", "0.46447855", "0.46353418", "0.46033093", "0.45873114", "0.4582573", "0.45788276", "0.45710826", "0.45519218", "0.4548315", "0.45383003", "0.45315674", "0.45303962", "0.45290715", "0.4513175", "0.45117024", "0.45113906", "0.45083582", "0.45080483", "0.4505392", "0.4496144", "0.44945866", "0.44805267", "0.44794995", "0.4477649", "0.44759685", "0.44694686", "0.4469072", "0.4465365", "0.44647446", "0.44590566", "0.44570944", "0.44525957", "0.44500667", "0.4443974", "0.4438557", "0.44382116", "0.44380242", "0.4427057", "0.44254145", "0.44229499", "0.4422618", "0.44205305", "0.4414518", "0.44073066", "0.44069508", "0.44043154", "0.44042438", "0.43980917", "0.43946013", "0.4394132", "0.43863186", "0.43780515", "0.43755803", "0.43706912", "0.4367869", "0.4367864", "0.43631467", "0.43618315", "0.43486086", "0.43456224", "0.43426102", "0.43418363", "0.43383133", "0.4337286", "0.43354473", "0.4334438", "0.43336818", "0.4332658", "0.4329999", "0.43250895", "0.43248498", "0.4323265", "0.43156552", "0.4314132", "0.4313204", "0.431047", "0.43087047", "0.43068716", "0.43054625", "0.4300918" ]
0.0
-1
Sposta la mappa in base alla posizione del mouse.
function dragMap(mousePos) { // statusMessage("Mouse:" + mousePos.x + ',' + mousePos.y); // statusObject.innerHTML += ' Da:'+dragObject.offsetLeft+','+dragObject.offsetTop; var new_top = mousePos.y - mouseOffset.y + lastMapPosition.y; var new_left = mousePos.x - mouseOffset.x + lastMapPosition.x; // statusObject.innerHTML += ' D '+(mousePos.x - mouseOffset.x)+','+(mousePos.y - mouseOffset.y); currentMap = dragObject; drawMapAt(new_left, new_top); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set Mouse0(value) {}", "function mouseMoved() {\n cursor(ARROW);\n opa = 0;\n nomeLocale = '';\n distanzaLocale = '';\n um = '';\n for (var i in localiMilano) {\n localiMilano[i].moved();\n }\n}", "function mousePressed() {\n nuova_poesia();\n}", "set Mouse1(value) {}", "function mouse(kind, pt, id) {\n \n}", "function mousePreciona (eventos) \n{\n\t\n\t//guarda la ubicacion el puntero\n\tx = eventos.layerX;\n\ty = eventos.layerY;\n\t\n\testado = EstadoDeEstadoXd();\n\n}", "function mapaClick(mouse) {\r\n\tswitch (root.actividad) {\r\n\t\tcase 0: // Nada cargado\r\n\t\t\tbreak\r\n\r\n\t\tcase 1: // Ubicar marcas para recorte\r\n\t\t\tLogEtaCorte.agregarMarca(mouse)\r\n\t\t\tbreak\r\n\r\n\t\tcase 2: // Marcar contornos\r\n\t\t\tvar posR = posReal(mouse, mapa.escala)\r\n\t\t\tconsole.log(\"pos real: \", posR.x, posR.y)\r\n\r\n\t\t\tif (Glo.hayTrazoRojo) {\r\n\t\t\t\tmiProxy.guardarTrazo()\r\n\t\t\t\tGlo.hayTrazoVerde = true\r\n\t\t\t}\r\n\r\n\t\t\tmiProxy.marcarTrazo(\r\n\t\t\t\t\tposR.x,\tposR.y,\r\n\t\t\t\t\tNumber(pin_radio.currentText),\r\n\t\t\t\t\tNumber(pin_vecinos.currentText),\r\n\t\t\t\t\tNumber(pin_cambioAng.value) * 0.0174532925)\r\n\r\n\t\t\tGlo.hayTrazoRojo = true\r\n\t\t\tpin_btBorrarCapa.enabled = true\r\n\r\n\t\t\tmapa.actualizTrazos()\r\n\t\t\tbreak\r\n\t}\r\n}", "mouseMove(prev, pt) {}", "function setmouseactions() {\n setTuntematonMouseAction();\n setTunnetutMouseAction();\n setTeemaMouseAction();\n //TODO: \"vihje sana\" class + newly exposed missing\n}", "mouseMove(x, y) {}", "function mouseApretado(e){\n mouseAbajo = true;\n console.log(mouseAbajo);\n}", "get Mouse0() {}", "function themeMouseMove() {\n screen_has_mouse = true;\n }", "setMouse() {\n let rect = this.canvas.getBoundingClientRect();\n let mouse = this.mouse;\n\n if (mouse &&\n mouse.x && mouse.x >= rect.left && mouse.x <= rect.right &&\n mouse.y && mouse.y >= rect.top && mouse.y <= rect.bottom) {\n this.activeProgram.setUniform(\"u_mouse\", (mouse.x - rect.left)/this.canvas.width, (this.canvas.height - (mouse.y - rect.top))/this.canvas.height, mouse.z);\n }\n }", "function mouse(event){\n\tlet x = event.clientX;\n\tlet y = event.clientY;\n\tlook(x,y);\n}", "function leerMouse(){\n\n//--- Rueda del Mouse ---------------\nif(Math.abs(deltaRueda) > 0){\n\tvar kd = 0.05;\t\t\t\t//constante de ajuste\n\tvar x = camara.position.x;\n\tvar y = camara.position.y;\n\tvar z = camara.position.z;\n\tvar d0 = Math.sqrt(x*x + y*y + z*z);\t\t//Distancia inicial\n\tvar d1 = d0 + (deltaRueda * kd);\t\t\t\t//Nueva distancia\n\tvar fact = d1 / d0;\t\t\t\t\t\t\t\t//porcentaje de ajuste a cada eje\n\tcamara.position\t.x = x * fact;\n\tcamara.position\t.y = y * fact;\n\tcamara.position\t.z = z * fact;\n}\ndeltaRueda\t= 0;\n}", "function mousePressed() {\n\tx = 40;//Cada vez que pressiona o mouse posicao x recebe o valor\n\ty = 10;//Cada vez que pressiona o mouse posicao y recebe o valor\n}", "function mousemove(e){\n\t\t// console.log(e);\n\t}", "get Mouse1() {}", "updateMouseValues() {\n // map randomInc to the mouse X\n this.randomInc = map(mouseX, 0, width, 0, 5);\n // constarin random inc between 0 and 5\n this.randomInc = constrain(this.randomInc, 0, 5);\n // map damping to the mouse Y\n this.damping = map(mouseY, 0, height, 0, 1);\n // constrain damping between 0 and 1\n this.damping = constrain(this.damping, 0, 1);\n }", "function mouseClicked(){\n\n // clicou em algum lugar do tabuleiro\n if(mouseX > 75 && mouseX < 450 + 75){\n if(mouseY > 75 && mouseY < 450 + 75){\n t.update();\n }\n }\n\n // clicou no botao de resetar\n if(mouseX > resetX && mouseX < (resetX + 120)){\n if(mouseY > resetY && mouseY < (resetY + 46)){\n resetTabuleiro();\n console.clear();\n }\n }\n\n}", "on_mousemove(e, localX, localY) {\n\n }", "onMouseMove(e) {\n this.setCursor(this.cursor);\n }", "function mousePressed() {y=1}", "function WhereMouse( evt ){\n\n evt = !evt ? event : evt\n \n var Mouse_X = evt.clientX; \n var Mouse_Y = evt.clientY;\n \n var scroll_x=document.body.scrollLeft || document.documentElement.scrollLeft;\n var scroll_y=document.body.scrollTop || document.documentElement.scrollTop;\n \n Mouse_X += scroll_x;\n Mouse_Y += scroll_y;\n \n document.getElementById('imp1').value=Mouse_X\n document.getElementById('imp2').value=Mouse_Y\n}", "mouseUp(pt) {}", "mouseUp(pt) {}", "function setPelikenttaMouseAction() {\n let kentta = document.getElementById(\"pelikentta\");\n kentta.onclick = mouseClickActScopePreserver(kentta);\n return true;\n}", "function onMouseMove(event) {\n\tmousePos = event.point;\n}", "function mouseActionLocal(angleXY) {\n encoder.azim = angleXY[0];\n encoder.elev = angleXY[1];\n encoder.updateGains();\n}", "function mouseActionLocal(angleXY) {\n encoder.azim = angleXY[0];\n encoder.elev = angleXY[1];\n encoder.updateGains();\n}", "function mousePressed() {\n startMouseX = mouseX;\n startMouseY = mouseY;\n }", "function onMouseMove(event) {\r\n\r\n // Update the mouse variable\r\n event.preventDefault();\r\n mouse.x = (event.clientX / window.innerWidth) * 2 - 1;\r\n mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;\r\n}", "function mouseUp() { }", "clickHandler(event) {\n let p = this.mouse.add(this.cartography._view);\n if (event.shiftKey) {\n this.state.player.data.input.fire = new Vector(p);\n } else {\n this.state.cursor.data.position.set(p);\n this.state.player.data.destination.set(p);\n }\n }", "function onMouseMove(event) {\n mousePos = event.point;\n}", "mouseMove(evt, point) {\n this.setHover(this.topBlockAt(point));\n }", "function activeCursor(e) {\n const item = e.target;\n if (item.id === \"logo\" || item.classList.contains(\"burger\")) {\n mouse.classList.add(\"nav-active\");\n } else {\n mouse.classList.remove(\"nav-active\");\n }\n if (item.classList.contains(\"button\")) {\n mouse.classList.add(\"explore-active\");\n gsap.to(\".title-swipe\", 1, { y: \"0%\" });\n mouseTxt.innerText = \"click\";\n } else {\n mouse.classList.remove(\"explore-active\");\n mouseTxt.innerText = \"\";\n gsap.to(\".title-swipe\", 1, { y: \"100%\" });\n }\n}", "mousemoved(mouseX, mouseY){\n // check if the mouse is to the left or right of the center of the outer eye\n if(mouseX < this.midX){\n // if the mouse is on the left, find the difference between the x coordinate of the mouse and the left hand side of the page and turn that into a percentage\n var x = (mouseX - this.midX) / this.midX;\n }else if(mouseX > this.midX){\n // if the mouse is on the right, find the difference between the x coordinate of the mouse and right hand side of the page and turn that into a percentage\n var x = (mouseX - this.midX) / (window.innerWidth - this.midX);\n }else{\n // if the mouse is in line with the eye, center the eye\n var x = 0;\n };\n // check if the mouse is to the above or below of the center of the outer eye\n if(mouseY < this.midY){\n // if the mouse is on the above, find the difference between the y coordinate of the mouse and the top of the page and turn that into a percentage\n var y = (mouseY - this.midY) / this.midY;\n }else if(mouseY > this.midY){\n // if the mouse is on the below, find the difference between the x coordinate of the mouse and bottom of the page and turn that into a percentage\n var y = (mouseY - this.midY) / (window.innerHeight - this.midY);\n }else{\n // if the mouse is in line with the eye, center the eye\n var y = 0;\n };\n // multiply the 2 values by the movenent factor (set earlier) and turn into a percentage\n x = this.movement * x + \"%\";\n y = this.movement * y + \"%\";\n // finally move the iris\n this.iris.style.transform = \"translate(\"+ x +\",\"+ y +\")\";\n }", "getMousePosition(event) {\n let CTM = damier.getScreenCTM();\n //Si sur mobile\n if(event != undefined && event.touches){\n event = event.touches[0];\n }\n //on transforme la position de la souris (en px, obtenue via CTM) en position en % sur notre damier (car la position d'une case est en %)\n if(event != undefined ) {\n return {\n x: ((event.clientX - CTM.e)*10 / CTM.a)/(parseInt(document.getElementById(\"damier\").style.height)/this.tailleCase),\n y: ((event.clientY - CTM.f)*10 / CTM.d)/(parseInt(document.getElementById(\"damier\").style.height)/this.tailleCase)\n };\n }\n }", "function mouseMove(event) {\n // Update the mouse coordinates\n data.input.mouse.x = event.clientX;\n data.input.mouse.y = event.clientY;\n}", "function onMouseMove(e) {\r\n controller.onMouseMove(e);\r\n}", "function mouseMove(x, y) {\r\n\t//debugOut(\"mouse move, x=\"+x+\" y=\"+y);\r\n\tmouseX = x;\r\n\tmouseY = y;\r\n\t//*** Your Code Here\r\n}", "function _onMouseMove(event) {\n $.mouse.x = Graphics.pageToCanvasX(event.pageX);\n $.mouse.y = Graphics.pageToCanvasY(event.pageY);\n }", "function mouseMove(event) {\n\n if ( ! finita_animazione) {\n // Se abbiamo il mouse cliccato\n if (isMouseDown) {\n // Ricavo le coordinate di ora\n let now_mouse_x = event.clientX;\n // Movimento fatto\n let movimento_fatto = start_mouse_x - now_mouse_x;\n // Se il movimento che è stato fatto è verso sinistra\n if (movimento_fatto > 0) {\n perc_movimento = -100;\n // Calcola il movimento in percentuale rispetto size_max\n if (movimento_fatto < size_max)\n perc_movimento = -(movimento_fatto / size_max) * 100;\n titolo_iniziale.style.left = String(perc_movimento * 4) + \"px\";\n\n }\n }\n }\n\n}", "externalActiveMouseMove() {\n //TODO: check for mouse button active\n this._strikeActiveMouseMove();\n this._localPointer._mouseX = this.getPointer()._mouseX;\n this._localPointer._mouseY = this.getPointer()._mouseY;\n }", "function onMouseMove( event ) {\n\tmouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n\tmouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n}", "move() {\n this.x = mouseX;\n this.y = mouseY;\n }", "getMousePos() {\n let g = this,\n _main = window._main,\n cxt = g.context,\n cards = _main.cards,\n x = g.mouseX,\n y = g.mouseY;\n // Mouse movement to draw plants\n if (g.canDrawMousePlant) {\n g.mousePlantCallback(x, y);\n }\n }", "function trackPosition(e) {\n\tmouse.x = e.pageX;//-225; 559\n\tmouse.y = e.pageY;\n\t// if( usuario_id !== -1 && over == 0)\n\t// \tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:mouse.x});\n\tif( usuario_id !== -1 && over == 0){\n\t\tp = paddles[usuario_id]; //1\n\t\tp.x = mouse.x - p.w/2;\t\t\n\t\tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:p.x});\n\t}\n}", "_setMousePosition(e) {\n this.mouse.x = e.x - this._rect.left;\n this.mouse.y = e.y - this._rect.top;\n }", "function i(e){var t=H=e,n=t.clientX,i=t.clientY;if(Q.popperInstance){var r=Q.reference.getBoundingClientRect(),o=Q.props.followCursor,a=\"horizontal\"===o,s=\"vertical\"===o;Q.popperInstance.reference={getBoundingClientRect:function e(){return{width:0,height:0,top:a?r.top:i,bottom:a?r.bottom:i,left:s?r.left:n,right:s?r.right:n}},clientWidth:0,clientHeight:0},Q.popperInstance.scheduleUpdate()}}", "function onMouseMove( event ) {\n // normalize mouse point\n mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n\n}", "function canvasMouseMove(e) {\n\tblockus.setMousePosition(getCursorPosition(e));\n}", "function article_mousemove_handler(e)\n\t\t\t{\n\t\t\t\twindow.lastMouseY=parseInt(e.clientY)-75;\n\t\t\t\t\tvar thisOffsetTop=Math.abs(parseInt($('.article-content').position().top));\t\n\t\t\t\t\tvar windowH=parseInt($(window).innerHeight())-75;\n\t\t\t\t\tif(window.lastMouseY>(windowH*2/3))\n\t\t\t\t\t{\n\t\t\t\t\t\t\t$(this).css('cursor','pointer');\n\t\t\t\t\t}\n\t\t\t\t\telse if(window.lastMouseY<(windowH/3))\n\t\t\t\t\t{\n\t\t\t\t\t\t\t$(this).css('cursor','pointer');\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\t$(this).css('cursor','default');\t\n\t\t\t\t\t}\n\t\t\t}", "mouseDown(pt) {}", "mouseDown(pt) {}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n }\n else {\n this.mouseover = false;\n }\n }", "function mousePressed (){\n for (var i = 0; i < filas; i++) {\n for (var j = 0; j < columnas; j++) {\n if(mapa[i][j].seraEsta(mouseX, mouseY)){\n mapa[i][j].cambiarEstado();\n } \n }\n }\n}", "function onMouseMove(event) {\n\tmousePosition=event;\n}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n this.stroke = 3;\n }\n else {\n this.mouseover = false;\n this.stroke = 2;\n }\n }", "function mouseClicked() {\n // normalize point\n let x = map(mouseX, 0, width, 0, 1);\n let y = map(mouseY, 0, height, 0, 1);\n pushPoint(x, y);\n}", "__mousemove(idx, ex, ey){\n let player = this.players[idx];\n if(player.dragActive){\n player.selectedTile.x = ex - player.initialX;\n player.selectedTile.y = ey - player.initialY;\n }\n }", "function mouseTracker(){\n\tif(jQuery('#mouse-tracker-wrap').length){\n\t\tdocument.querySelector('#mouse-tracker-wrap').onmousemove = (e) => {\n\t\t\tconst x = e.pageX - e.target.offsetLeft\n\t\t\tconst y = e.pageY - e.target.offsetTop\n\n\t\t\tvar y1 = e.pageY;\n\t\t\tvar y2 = e.target.offsetTop;\n\t\t\tconsole.log(x);\n\t\t\tconsole.log(y);\n\n\t\t\te.target.style.setProperty('--x', `${ x }px`)\n\t\t\te.target.style.setProperty('--y', `${ y }px`)\n\t\t}\n\t}\t\n}", "function poi_mclick() {\n var varform = _$(\"varform\");\n varform.mode.value = 'poi';\n varform.maction.value = 'click';\n varform.tool.value = 'poi'; \n \n if (useCustomCursor) {\n setCursor(false, 'crosshair');\n }\n}", "sketchpad_mouseUp() {\n this.mouseDown = 0\n }", "function onMouseMove(event) {\n // Update the mouse variable\n mouse.x = (event.clientX / window.innerWidth) * 2 - 1;\n mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;\n\n mouse.x = Math.round((mouse.x + 1) * window.innerWidth / 2);\n mouse.y = Math.round((- mouse.y + 1) * window.innerHeight / 2);\n}", "mouseMove(prev, pt) {\n this.selected = -1;\n }", "function mousePressed() {\n // Store mouse position when pressed\n mouse = [mouseX, mouseY];\n\n // Hirajoshi scale in C\n // https://www.pianoscales.org/hirajoshi.html\n const notes = [\"C\", \"Db\", \"F\", \"Gb\", \"Bb\"];\n const octaves = [2, 3, 4];\n const octave = random(octaves);\n const note = random(notes);\n synth.triggerAttackRelease(note + octave, \"8n\");\n}", "function mouseMoveHandler(e) \n{\n var position = this.events.getMousePosition(e);\n var lonlat = mapa.getLonLatFromPixel(position);\n\t//Tras obtener las coordenadas, podemos hacer lo que deseemos\n \n\t$(\"#coordenadas\").attr('value','Evento MouseMove: '+transformMouseCoords(lonlat));\n\t\n\n}", "static movingMouse(canvas, offsetX){\r\n\r\n\t}", "function mouseMoved()\n{\n\t\n}", "onMouseMove(event) {\n //Mausposition soll fuer den Canvas(bzw. auch den CanvasDiv berechnet werden)\n event.preventDefault();\n let wrapper = $('#visualizationsCanvasDiv');\n const pos = this.getCanvasRelativePosition(event);\n //in mouse(2d Vektor) wird aktuelle x und y Position der Maus in der Szene gespeichert\n //wert zwischen -1 und 1, wenn auf Canvas und |1|> wenn nicht auf Canvas\n this.mouse.x = (pos.x / wrapper.width()) * 2 - 1;\n this.mouse.y = -(pos.y / wrapper.height()) * 2 + 1;\n //rendert das Bild neu\n if (window.actionDrivenRender)\n this.render();\n }", "function getMousePosition(e)\r\n{\r\n // Recherche de la position\r\n if (nava)\r\n {\r\n mouseX = e.pageX ;\r\n mouseY = e.pageY ;\r\n }\r\n else if (iex)\r\n {\r\n mouseX = window.event.x + document.body.scrollLeft;\r\n mouseY = window.event.y + document.body.scrollTop;\r\n }\r\n else if (dom)\r\n {\r\n mouseX = e.pageX ;\r\n mouseY = e.pageY ;\r\n }\r\n // FIN Recherche de la position\r\n\r\n // Leger decalage pour ne pas rester sous le pointeur de la souris\r\n mouseX += 20;\r\n \r\n\r\n // Car on ne sait jamais...\r\n if (mouseX < 0) mouseX = 0;\r\n if (mouseY < 0) mouseY = 0;\r\n\r\n // Deplacement du DIV d'information\r\n //var style = $('info_div').getStyle();\r\n //style.left = mouseX+\"px\";\r\n //style.top = mouseY+\"px\";\r\n $('info_div').setStyle({left:mouseX+\"px\",top:mouseY+\"px\"});\r\n\r\n return true;\r\n}", "function sketchpad_mouseMove(e) { \n\n // Update the mouse co-ordinates when moved\n getMousePos(e);\n\n // Draw a dot if the mouse button is currently being pressed\n if (g_mouseDown==1) {\n drawDot(g_ctx, g_mouseX, g_mouseY, 12);\n }\n}", "function onMouseMove(e) {\n\t// store mouseX and mouseY position\n\tmouseX = e.clientX;\n\tmouseY = e.clientY;\n}", "function mysketchpad_mouseUp() {\n mouseDown = 0;\n lastX=-1;\n lastY=-1;\n }", "function mpMouseover() {\n // Get mouse positions from the main canvas.\n var mousePos = d3.mouse(this)\n // Get the data from our map!\n if (typeof (transform) !== \"undefined\") {\n var nodeData = quadtree.find((mousePos[0] - margin.left - transform[\"x\"]) / transform[\"k\"],\n (mousePos[1] - margin.top - transform[\"y\"]) / transform[\"k\"], 50)\n } else {\n nodeData = quadtree.find(mousePos[0] - margin.left, mousePos[1] - margin.top, 50)\n }\n\n // Only show mouseover if hovering near a point\n if (typeof (nodeData) !== \"undefined\") {\n // If we're dealing with mp nodes\n if (typeof (nodeData.id) !== \"undefined\") {\n slide5_show_mp_tooltip(nodeData, mousePos)\n } else {\n median_mouseover(nodeData, mousePos)\n }\n }\n d3.event.preventDefault()\n\n }", "function mouseClicked(){\n // the x position will take the value of the horizontal mouse position\n xPos=mouseX;\n // the y position will take the value of the vertical mouse position\n yPos = mouseY;\n}", "function mousemove() {\n\t\n \n\tif ( (self.projection=='orthographic')\n\t\t|| (self.projection=='azimuthalEqualArea'))\n\t{\n\t\tvar p = d3.mouse(this);\n\t\tprojection.rotate([λ(p[0]), φ(p[1])]);\n\t\t//projection.rotate([λ(p[0]), 0]);\n\t\tself.svg.selectAll(\"path\").attr(\"d\", path);\n\t\t\n\t}\n\telse\n\t{\n\t\t\n\t}\n}", "function mouseClicked() {\n if (mouseY >= 620 && mouseY <= 720 && mouseX >= 1040 && mouseX <= 1280) {\n aanvalActie = false;\n aanvalKnopStatus = false;\n beweegActie = false;\n beweegKnopStatus = false;\n beurtVeranderen();\n veranderKleur(donkerblauw,wit);\n veranderKleur(lichtblauw,wit);\n }\n}", "function onMouseMove(e) {\n\t\t var p = self.LL2C(e.latlng);\n\t\t var region = \"Hinterlands\";\n\t\t if (IsValidCoord(p.x, p.y) == true) {\n\t\t\t\tif (self.showposition) {\n\t\t\t\t\tdocument.getElementById(\"mousepos\"+ID).value = p.y.toFixed(0) + ', ' + p.x.toFixed(0);\n\t\t\t\t\tdocument.getElementById(\"secondmousepos\"+ID).value = p.y.toFixed(0) + ', ' + p.x.toFixed(0);\n }\n } \n\n\t\t}", "function mouseClicked() {\n if (menu == 0) {\n if (mouseX < 509 && mouseX > 425) {\n if (mouseY < 360 && mouseY > 340) {\n menu = 1;\n }\n if (mouseY < 425 && mouseY > 390) {\n menu = 2;\n }\n }\n }\n}", "function sketchpad_mouseMove(e) { \n // Update the mouse co-ordinates when moved\n getMousePos(e);\n\n // Draw a dot if the mouse button is currently being pressed\n if (mouseDown==1) {\n drawDot(ctx,mouseX,mouseY,6);\n }\n }", "mouseLister(x,y)\n\t{\n\t\tthis.planeX = x;\n\t\tthis.planeY = y;\n\t}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.stroke = 2;\n this.mouseover = true;\n }\n else {\n this.stroke = 1;\n this.mouseover = false;\n }\n }", "function onMouseMove(event) {\n // calculate mouse position in normalized device coordinates\n // (-1 to +1) for both components\n mouse.x = (event.clientX / window.innerWidth) * 2 - 1;\n mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;\n console.log('[' + mouse.x + ',' + mouse.y + ']')\n console.log('-------------------------------------')\n}", "function getMousePos() {\n\t\t\t\t\t\t\treturn (mouseTopPerc * 400) + 10;\n\t\t\t\t\t\t}", "function sketchpad_mouseMove (e) {\n // Update the mouse co-ordinates when moved\n getMousePos(e)\n // Draw a dot if the mouse button is currently being pressed\n if (mouseDown == 1) {\n drawDot(mouseX, mouseY, 8, r, g, b, a)\n connection.invoke('UpdateCanvas', mouseX, mouseY, r, g, b, a).catch(function (err) {\n return console.error(err.toString())\n })\n }\n}", "function mousedown() {\n index = this.index;\n scene = this.scene;\n v1 = pv.vector(pv.event.pageX, pv.event.pageY);\n m1 = this.transform();\n k = 1 / (m1.k * this.scale);\n if (bound) {\n bound = {\n x: (1 - m1.k) * this.width(),\n y: (1 - m1.k) * this.height()\n };\n }\n }", "function onMouseMove(e) {\n let dansJoueur = false;\n const p = { x: e.clientX, y: e.clientY };\n\n equipes.forEach((eq) => {\n eq.joueurs.forEach((j) => {\n if (GestionnaireCollision.pointDansCercle(j.centre(), j.rayon(), p)) dansJoueur = true;\n });\n });\n\n if (dansJoueur\n || GestionnaireCollision.pointDansRectangle(drapeauDroit, p)\n || GestionnaireCollision.pointDansRectangle(drapeauGauche, p)\n || GestionnaireCollision.dansCurseurForce(curseurForce, p)\n || GestionnaireCollision.dansColorPicker(colorPicker, p).clicked\n || GestionnaireCollision.pointDansRectangle(soundButton, p)) {\n document.body.style.cursor = 'pointer';\n } else {\n document.body.style.cursor = 'default';\n }\n\n if (GestionnaireCollision.pointDansRectangle(reloadButton, p)) {\n document.body.style.cursor = 'pointer';\n reloadButton.augmenterAngle();\n } else {\n reloadButton.baisserAngle();\n }\n\n if (curseurTir.estVisible) {\n curseurTir.angle = calculerAngle(e.clientX, e.clientY);\n }\n }", "function mousePressed() {\r\n for (var i=0; i < query.length; i++) {\r\n img[i] = carica(virgola[i]);\r\n }\r\n return false;\r\n}", "aim()\n {\n this.aimX = mouseX - (this.sprite.width / 2 - 33);\n this.aimY = mouseY - ((this.sprite.height / 2) + 10);\n image(this.crosshair, this.aimX, this.aimY);\n }", "onMouseMove(event) {\n\t\tthis.mouse.x = event.clientX / window.innerWidth * 2 - 1;\n\t\tthis.mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;\n\t\tthis.mouseUpdate();\n\t}", "function mouseLngLatMove(e) {\r\n Coordinates.mouseLngLatRaw = [e.latlng.lng, e.latlng.lat]\r\n Coordinates.mouseLngLat = [e.latlng.lng, e.latlng.lat]\r\n if (L_.configData.look && L_.configData.look.coordelev === true)\r\n Coordinates.getElevation()\r\n Coordinates.refresh()\r\n $('#mouseElev').css({ opacity: 0.6 })\r\n}", "function setCursores(){\n\timgCursor(ultimoevt);\n\tget('wcr_btn-1').style.cursor = cursor(-1, 'btns');\n\tget('wcr_btn1').style.cursor = cursor(1, 'btns');\n}", "function handler() {\n applyFishEye(\n sig.mousecaptor.mouseX,\n sig.mousecaptor.mouseY\n );\n }", "function sketchpad_mouseMove(e) {\n // Update the mouse co-ordinates when moved\n getMousePos(e);\n // checkCoordinates(mouseX,mouseY);\n // Draw a dot if the mouse button is currently being pressed\n if (mouseDown==1) {\n drawDot(ctx,mouseX,mouseY,12);\n }\n}", "function printMousePosition() {\n}", "function mouseClicked() {\n\n //el tiempo del segundo clic se corre a la segunda posicion\n tiempo[0] = tiempo[1];\n\n //se guarda el tiempo del primer clic en el arreglo\n tiempo[1] = millis();\n}", "function pinselada() {\n ctx.lineWidth = tamLinea;\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n ctx.lineTo(mouse.x, mouse.y);\n ctx.stroke();\n }" ]
[ "0.7118633", "0.69903094", "0.69525546", "0.69123244", "0.6824024", "0.67732954", "0.67559654", "0.67509335", "0.6749141", "0.6697264", "0.6687916", "0.66382813", "0.66358054", "0.6582989", "0.6540222", "0.6515328", "0.65101033", "0.6464583", "0.6454228", "0.642441", "0.6397155", "0.63805974", "0.6342485", "0.6335123", "0.63347477", "0.6310732", "0.6310732", "0.6305343", "0.6285779", "0.62667084", "0.62667084", "0.6263537", "0.62588936", "0.6256497", "0.62557715", "0.62504864", "0.6241419", "0.62261987", "0.6218977", "0.62118936", "0.6193325", "0.6192188", "0.6189398", "0.6176441", "0.6168515", "0.6162558", "0.61562383", "0.6154976", "0.61520004", "0.6148349", "0.6145787", "0.6144443", "0.61433256", "0.61334276", "0.6128047", "0.61276025", "0.61276025", "0.6126421", "0.6125202", "0.6118744", "0.61180955", "0.611513", "0.6112753", "0.6112742", "0.6105369", "0.6097354", "0.6096248", "0.60913575", "0.608813", "0.6078836", "0.60766804", "0.6072563", "0.6067863", "0.60627675", "0.60582703", "0.6057506", "0.6052896", "0.6046687", "0.6046148", "0.60297495", "0.60288763", "0.60224175", "0.60210615", "0.60169667", "0.6012217", "0.600419", "0.60036045", "0.60021436", "0.59977466", "0.5995997", "0.59915715", "0.59887886", "0.5985935", "0.59823406", "0.5975207", "0.59705395", "0.5966578", "0.5962327", "0.5960288", "0.59547734", "0.59530854" ]
0.0
-1
Disegna la mappa ingrandita alla posizione indicata. Se la posizione non e' valida, viene corretta in modo che una parte della mappa sia sempre visibile. Richiede che mapSize e currentMap siano inizializzati.
function drawMapAt(new_left, new_top) { // statusMessage(' A:'+new_left+' / ' + mapSize.width + ' ,'+new_top); // troppo a destra if (-new_left + MAP_AREA_WIDTH > mapSize.width) { new_left = MAP_AREA_WIDTH - mapSize.width; } // troppo a sinistra if (new_left > 0) { new_left = 0; } // troppo in basso if (-new_top + MAP_AREA_HEIGHT > mapSize.height) { new_top = MAP_AREA_HEIGHT - mapSize.height; } // troppo in alto if (new_top > 0) { new_top = 0; } currentMap.style.top = new_top + 'px'; currentMap.style.left = new_left + 'px'; currentMapPosition = {x:new_left, y:new_top}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function calculateInitialMapNavigatorSettings(){\n\t\tvar mnwMap = $('mnwMap');\n\t\tvar mnwCurrentView = $('mnwCurrentView');\n\t\t//calculate scale\n\t\tvar widthScale = MAP_WIDTH / 300;\n\t\tvar heightScale = MAP_HEIGHT / 300;\n\t\tif (widthScale < heightScale){\n\t\t\tmnwScale = widthScale;\n\t\t}else{\n\t\t\tmnwScale = heightScale;\n\t\t}\n\t\t//calculate mnwMap dimensions\n\t\tmnwMapWidth = Math.floor(MAP_WIDTH / mnwScale);\n\t\tmnwMapHeight = Math.floor(MAP_HEIGHT / mnwScale);\n\t\tmnwMap.style.width = mnwMapWidth + \"px\";\n\t\tmnwMap.style.height = mnwMapHeight + \"px\";\n\t\t//mnwMap.style.marginLeft = \"-\" + Math.floor(mnwMapWidth/2) + \"px\";\n\t\t//mnwMap.style.marginTop = \"-\" + Math.floor(mnwMapHeight/2) + \"px\";\n\t\t//calculate mnvCurrentView dimensions\n\t\tmnwCurrentViewWidth = Math.floor(VIEWPORT_WIDTH / mnwScale);\n\t\tmnwCurrentViewHeight = Math.floor(VIEWPORT_HEIGHT / mnwScale);\n\t\tif (mnwCurrentViewHeight < 2){ mnwCurrentViewHeight = 2 }\n\t\tif (mnwCurrentViewWidth < 2){ mnwCurrentViewWidth = 2 }\n\t\tmnwCurrentView.style.width = mnwCurrentViewWidth + \"px\";\n\t\tmnwCurrentView.style.height = mnwCurrentViewHeight + \"px\";\n\t\tmnwCurrentView.style.left = Math.floor(MAP_MARGIN_LEFT*(-1)/mnwScale) + \"px\";\n\t\tmnwCurrentView.style.top = Math.floor(MAP_MARGIN_TOP*(-1)/mnwScale) + \"px\";\n\t}", "function nuevoInicio(){\n let previo = inicio;\n inicio = mapa[inputInicioX.value()][inputInicioY.value()];\n inicio.obstaculo = false;\n inicio.corrienteFuerte = false;\n inicio.corriente = false;\n inicio.pintar(0);\n previo.pintar(255);\n}", "function index_limpiarMapa() {\n\tobjetoLineas.setPath([]);\n\tobjetoLineas.setMap(map);\n\tarrayPuntos = new Array();\n\t\n\tif (arrayMarcas.length > 0) {\n\t\tfor (var x = 0; x < arrayMarcas.length; x++) {\n\t\t\tarrayMarcas[x].setMap(null);\n\t\t}\n\t}\n\t\t\n\tarrayMarcas = new Array();\n\t\n\tfor (var x = 0; x < arrayMarcasPuntos.length; x++) {\n\t\tarrayMarcasPuntos[x].setMap(null);\n\t}\n\t\n\tarrayMarcasPuntos = new Array();\n\tif (typeof objetoPoligono !== 'undefined') {\n\t\tobjetoPoligono.setMap(null);\n\t}\n}", "function updateMapMarkers() {\n if (map !== null) {\n resetMapMarkers();\n $log.log(TAG + \"number of markers after reset\", _.size(bigMap.config.markers));\n var poisToShow = getMapMarkersToShow(getScreenPolygon());\n addMapMarkers(Filters.filterPois(poisToShow));\n $log.log(TAG + \"number of markers after add\", _.size(bigMap.config.markers));\n return bigMap.config.markers;\n } else {\n $log.error(TAG + 'No map available. Try to call the BigMap.setMap() method, passing it a valid leaflet map.');\n }\n }", "function setMiniMapBounds(onResizingProcess) {\n\t\tvar mapClientWidth = document.getElementById(MAP).clientWidth;\n\t\tvar mapClientHeight = document.getElementById(MAP).clientHeight;\n\t\tif (onResizingProcess) {\n\t\t\tmapClientWidth -= document.getElementById(MAP).map.mapHeight > document.getElementById(MAP).clientHeight ? 17 : 0;\n\t\t\tmapClientHeight -= document.getElementById(MAP).map.mapWidth > mapClientWidth ? 17 : 0;\n\t\t}\n\t\tvar mapWidth = mapClientWidth > document.getElementById(MAP).map.mapWidth ? mapClientWidth : document.getElementById(MAP).map.mapWidth;\n\t\tvar mapHeight = mapClientHeight > document.getElementById(MAP).map.mapHeight ? mapClientHeight : document.getElementById(MAP).map.mapHeight;\n\t\tthis.xRate = document.getElementById(MINIMAP).clientWidth / mapWidth;\n\t\tthis.yRate = document.getElementById(MINIMAP).clientHeight / mapHeight;\n\t}", "resetPlaces() {\n this.map = _.times(this.cfg.places, (i) => {\n return { x: i * this.cfg.width, y: 0, empty: true };\n });\n }", "resetMap() {\n if (custom_maps[this.id]) {\n delete custom_maps[this.id];\n\n const map = getMap(this.pad);\n this.map = map;\n this.mapping = map.mapping;\n\n this._compileMapping();\n }\n }", "function InvalidateMapSize() {\n map.invalidateSize();\n }", "function minimapfunc(Wv, wM) {\n nmwmn(Wv + (250 * mn), wM);\n if (MvV.m !== 1) {\n MvV = wN.wvv(bordermapbig, MvV);\n return;\n }\n \n var mnmvW = nwMnv * NmM;\n var vNwWN = nwMnv * WWV;\n var nVm = win.Math.min(win.Math.max(0, mnmvW - WWn), vvVMV);\n var nmW = win.Math.min(win.Math.max(0, vNwWN - WWn), vvVMV);\n var WW = WWn * mn;\n Mm.drawImage(MvV, nVm, nmW, mVmWm, mVmWm, Wv, wM, WW, WW);\n \n if (SERVG.Vnn === SERVG.VMnnw) {\n if (SERVG.ME.GHOUL !== 0) vmnWW(-255, wM);\n else MnnvV(Wv + 50, wM, 1);\n }\n \n \n if (SERVG.Vnn === SERVG.VNVWN) {\n var wVvnN = SERVG.ME.Mwwnw[win.Math.floor(WWV / NnWnv)][win.Math.floor(NmM / NnWnv)];\n if (((wVvnN !== 0) && (wVvnN < SERVG.ME.wMwmv)) && (SERVG.ME.wMwmv !== 8)) {\n MvvNN = win.Math.min(1000, MvvNN + mV);\n Mm.globalAlpha = WNW.mWV.wWM(MvvNN / 500);\n wN.WM(WWmMW, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n } else if (MvvNN > 0) {\n MvvNN = win.Math.max(0, MvvNN - mV);\n Mm.globalAlpha = WNW.mWV.wWM(MvvNN / 500);\n wN.WM(WWmMW, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n }\n Mm.drawImage(MWNMV.W, nVm / 2, nmW / 2, WWn, WWn, Wv, wM, WW, WW);\n Mm.globalAlpha = (mWWwn > 600) ? WNW.mWV.vvw((1200 - mWWwn) / 600) : WNW.mWV.vvw(mWWwn / 600);\n mWWwn = (mWWwn + mV) % 1200;\n Mm.drawImage(MMvWn.W, nVm / 2, nmW / 2, WWn, WWn, Wv, wM, WW, WW);\n Mm.globalAlpha = 1;\n vmnWW(0, wM);\n MnnvV(Wv, wM, 0);\n } else if (SERVG.ME.GHOUL === 0) {\n if (SERVG.MnW.MWw.vww === 1) {\n WNmVW = win.Math.min(1000, WNmVW + mV);\n Mm.globalAlpha = WNW.mWV.wWM(WNmVW / 500);\n wN.WM(VmWNN, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n } else if (WNmVW > 0) {\n WNmVW = win.Math.max(0, WNmVW - mV);\n Mm.globalAlpha = WNW.mWV.wWM(WNmVW / 500);\n wN.WM(VmWNN, nvm, 58, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n }\n }\n \n \n \n if (nVm >= vvVMV) mnmvW = win.Math.min(((mnmvW - VnvWV) / 2) + nWWwM, WWn - 8);\n else if (mnmvW < WWn) mnmvW = win.Math.max(15, mnmvW / 2);\n else mnmvW = nWWwM;\n if (nmW >= vvVMV) vNwWN = win.Math.min(((vNwWN - VnvWV) / 2) + nWWwM, WWn - 8);\n else if (vNwWN < WWn) vNwWN = win.Math.max(15, vNwWN / 2);\n else vNwWN = nWWwM;\n var wVw = Wv / mn;\n var VVm = wM / mn;\n \n \n \n if ((SERVG.ME.clan !== -1) || ((SERVG.ME.GHOUL !== 0) && (SERVG.WVw < 6))) {\n var socket = nNM.Wvm[mnW];\n for (var place = 0; place < SERVG.ME.nnnVN; place++) {\n var nmmvN = SERVG.ME.MVmNm[place];\n if (nmmvN.wmWMV < 0) continue;\n var ME = SERVG.socket[nmmvN.id];\n var wW;\n if (MNW === (ME.MNW + 1)) {\n var WMv = socket[ME.nnmnv];\n if (Vwv.MWV(ME.rx, ME.ry, WMv.x, WMv.y) < 1000) {\n ME.rx = WMv.x;\n ME.ry = WMv.y;\n }\n ME.x = WMv.x;\n ME.y = WMv.y;\n wW = WMv.angle;\n } else var wW = ME.x % WNVNM;\n var wwn = wVw + win.Math.max(15, win.Math.min(WWn - 15, (mnmvW - 3) + ((ME.rx - NmM) * nwMnv)));\n var Nmn = VVm + win.Math.max(15, win.Math.min(WWn - 15, (vNwWN - 3) + ((ME.ry - WWV) * nwMnv)));\n wN.WM(arrowiconmap, wwn, Nmn, wW, 0, 0, 1);\n }\n }\n \n \n if (SERVG.ME.VvWnm > 0) {\n var ME = SERVG.socket[SERVG.ME.karmaplayerid];\n if (MNW === (ME.MNW + 1)) {\n var socket = nNM.Wvm[mnW];\n var WMv = socket[ME.nnmnv];\n if (Vwv.MWV(ME.rx, ME.ry, WMv.x, WMv.y) < 1000) {\n ME.rx = WMv.x;\n ME.ry = WMv.y;\n }\n ME.x = WMv.x;\n ME.y = WMv.y;\n }\n wN.WM(karma[ME.VwVVw], wVw + win.Math.max(15, win.Math.min(WWn - 15, (mnmvW - 3) + ((ME.rx - NmM) * nwMnv))), VVm + win.Math.max(15, win.Math.min(WWn - 15, (vNwWN - 3) + ((ME.ry - WWV) * nwMnv))), 0, 0, 0, 1.25);\n }\n \n var wwn = wVw + (mnmvW - 3);\n var Nmn = VVm + (vNwWN - 3);\n wN.WM(arrowiconmap2, wwn, Nmn, myply.angle, 0, 0, 1);\n if ((SERVG.ME.GHOUL === 0) && ((SERVG.ME.MwV > 0) || (wnW.WMw > 0))) {\n var nn = (wnW.nn + mV) % 1000;\n wnW.nn = nn;\n if (wnW.nn < 500) Wv += 260 + (15 * WNW.mWV.vvw(nn / 500));\n else Wv += 260 + (15 * WNW.mWV.vvw((1000 - nn) / 500));\n Mm.globalAlpha = WNW.mWV.wWM(wnW.WMw);\n wN.WM(wnW, Wv, wM + 31, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n if ((SERVG.ME.MwV <= 0) || (windowobjects.MvN() === 1)) wnW.WMw = win.Math.max(0, wnW.WMw - (mV / 500));\n else if (wnW.WMw < 1) wnW.WMw = win.Math.min(1, wnW.WMw + (mV / 500));\n }\n }", "initialiserMap() {\n this.terrain = {};\n this.arret = false;\n this.terrain.geometrie = JSON.parse(JSON.stringify(this.niveaux[this.niveauActuel].geometrie));\n this.terrain.dimension = {\n x: this.terrain.geometrie[0].length,\n y: this.terrain.geometrie.length\n };\n this.terrain.apparence = [];\n this.bitMasking();\n }", "function calculateMapParameter(){\n\n\tAddParametersFriendLocation()\n\n\tcorrectCloseLocations()\n\n}", "function replaceMap() {\n //check is coordinates values are empty or not\n if ((document.getElementById(\"longi\").value) & (document.getElementById(\"lat\").value)) {\n\n map.center = [parseFloat((document.getElementById(\"longi\")).value), parseFloat((document.getElementById(\"lat\")).value)];\n\n // same point without altitude\n var point1 = new maptalks.Marker(\n [parseFloat((document.getElementById(\"longi\")).value), parseFloat((document.getElementById(\"lat\")).value)]\n );\n map.removeLayer(markerLayer);\n if (markerLayer1) {\n map.removeLayer(markerLayer1);\n }\n // var d = new Date();\n // var t = d.getTime();\n // new maptalks.VectorLayer(t, point1).addTo(map);\n markerLayer1 = new maptalks.VectorLayer('vector', point1).addTo(map);\n\n changeView();\n\n console.log(map);\n\n function changeView() {\n map.animateTo({\n center: [parseFloat((document.getElementById(\"longi\")).value), parseFloat((document.getElementById(\"lat\")).value)],\n zoom: 13,\n pitch: 0,\n bearing: 20\n }, {\n duration: 5000\n });\n setTimeout(function() {\n map.animateTo({\n center: [parseFloat((document.getElementById(\"longi\")).value), parseFloat((document.getElementById(\"lat\")).value)],\n zoom: 18,\n pitch: 0,\n bearing: 0\n }, {\n duration: 7000\n });\n }, 7000);\n }\n } else {\n alert(\"Please enter the Coordinate values\");\n }\n}", "function initialSizeOfMap() {\n\t$('#leftDivInfo').css({\n\t\t'width': '45%',\n\t\t'margin-top': '0px'\n\t});\n\t$('#map-canvas').css({\n\t\t'margin-left': 'auto',\n\t\t'margin-right': 'auto',\n\t\t'margin-top': '-1000px',\n\t\t'height': '350px',\n\t\t'width': '50%'\n\t});\n}", "set Mipmaps(value) {}", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapPrecip.resize();\n roeMapPrecip.reposition();\n }", "constructor(hauteur,largeur){\n this.hauteur = hauteur;\n this.largeur = largeur;\n let nombreMursMinimum = (this.largeur*2)+(this.hauteur*2)+this.largeur*2+this.hauteur/2;\n this.map = this.setMap();\n console.log(nombreMursMinimum,this.nombreMurs())\n //TODO REGENERATION DE MAP SI Murs < Min\n\n // while(this.nombreMurs(this.map)<=nombreMursMinimum){\n // console.log(\"generation carte\")\n // this.map = this.setMap();\n // }\n \n }", "function actualizarUbicacion(){\n map.removeMarkers();\n var myMarker_oringe={\n icon: iconOrigin,\n animation: google.maps.Animation.DROP,\n color: '#FF0000',\n lat: currentPosition.lat(),\n lng: currentPosition.lng(),\n title: 'Origen',\n infoWindow: {\n content: '<p>Origen</p>'\n }\n };\n map.addMarker(myMarker_oringe);\n $('[name=\"lan\"]').val(currentPosition.lat());\n $('[name=\"lot\"]').val(currentPosition.lng());\n}", "fillWallInArrayMap() {\n $.each(this.arrayMap, function() {\n let randNb = randomNb(0, 6);\n if (randNb === 6) {\n this.navigable = false;\n }\n });\n }", "function resetMap() {\n\ttileScale = 24;\n\ttileSize = Math.round(2**(tileScale*.25));\n\tmapUpdate();\n\tupdateTileSize(tileSize);\n\t$(\"#mapSize\").text(\"Map tile size: \" + tileScale + \"(\"+tileSize+\")\");\n}", "function showMapAroundPlayer() {\n\tlet X = Player1.X;\n\tlet Y = Player1.Y;\n\tlet BName = \"Board\";\n\tlet YSize = mapSize[0];\n\tlet XSize = mapSize[1];\n\tlet Delimiter = \"-\";\n\tcurrentMap = Board;\n\tconsole.log(currentMap);\n\tif (!inMap) {\n\t\tX = Player1.X2;\n\t\tY = Player1.Y2;\n\t\tcurrentMap = Room;\n\t\tBName = \"Room\";\n\t\tYSize = map2Size[0];\n\t\tXSize = map2Size[1];\n\t\tDelimiter = \"_\";\n\t}\n\tfor (i = 0; i < workers.length; i++) {\n\t\tworkers[i].terminate();\n\t}\n\tdocument.getElementById(BName).style.display = \"\";\n\tif (X - 10 < 0) {\n\t\tfor (var i = 0; i < 21; i++) {\n\t\t\tif (Y - 10 < 0) {\n\t\t\t\tfor (var j = 0; j < 21; j++) {\n\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t}\n\t\t\t} else if (Y + 10 >= XSize) {\n\t\t\t\tfor (var j = XSize - 21; j < XSize; j++) {\n\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var j = Y - 10; j < Y + 11; j++) {\n\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t}\n\t\t\t\t\tif (i >= 0 && j < XSize && i < YSize) {\n\t\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (X + 10 >= XSize) {\n\t\tfor (var i = YSize - 21; i < YSize; i++) {\n\t\t\tif (Y - 10 < 0) {\n\t\t\t\tfor (var j = 0; j < 21; j++) {\n\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t}\n\t\t\t} else if (Y + 10 >= XSize) {\n\t\t\t\tfor (var j = XSize - 21; j < XSize; j++) {\n\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var j = Y - 10; j < Y + 11; j++) {\n\t\t\t\t\tif (i >= 0 && j < XSize && i < YSize) {\n\t\t\t\t\t\tif (document.getElementById(BName + j).innerHTML == \"\") {\n\t\t\t\t\t\t\tdocument.getElementById(BName + j).innerHTML = BName[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById(j + Delimiter + i).style.display = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (Y + 10 >= YSize) {\n\t\tfor (var i = XSize - 21; i < XSize; i++) {\n\n\t\t\tif (document.getElementById(BName + i).innerHTML == \"\") {\n\t\t\t\tdocument.getElementById(BName + i).innerHTML = BName[i];\n\t\t\t}\n\t\t\tif (X - 10 < 0) {\n\t\t\t\tfor (var j = 0; j < 21; j++) {\n\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t}\n\t\t\t} else if (X + 10 >= YSize) {\n\t\t\t\tfor (var j = XSize - 21; j < YSize; j++) {\n\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var j = X - 10; j < X + 11; j++) {\n\t\t\t\t\tif (i >= 0 && j < XSize && i < YSize) {\n\t\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (Y - 10 < 0) {\n\t\tfor (var i = 0; i < 21; i++) {\n\t\t\tif (X - 10 < 0) {\n\t\t\t\tfor (var j = 0; j < 21; j++) {\n\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t}\n\t\t\t} else if (X + 10 >= XSize) {\n\t\t\t\tfor (var j = YSize - 21; j < YSize; j++) {\n\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var j = X - 10; j < X + 11; j++) {\n\t\t\t\t\tif (i >= 0 && X + 10 < YSize && i < XSize) {\n\t\t\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var i = Y - 10; i < Y + 11; i++) {\n\t\t\tif (document.getElementById(BName + i).innerHTML == \"\") {\n\t\t\t\tdocument.getElementById(BName + i).innerHTML = Board[i];\n\t\t\t}\n\t\t\tfor (var j = X - 10; j < X + 11; j++) {\n\t\t\t\tdocument.getElementById(i + Delimiter + j).style.display = '';\n\t\t\t}\n\t\t}\n\t\tdocument.getElementById(Y + Delimiter + X).src = './Images/player.png'\n\t}\n\tdocument.getElementById(Y + Delimiter + X).src = './Images/player.png'\n}", "function getScoreAfterStep(cur_pos, new_pos){\r\n\tvar res = 0;\r\n\tvar map = arrayClone(game_field);\r\n\tif (Math.abs(new_pos[0] - cur_pos[0]) <=1 && Math.abs(new_pos[1] - cur_pos[1]) <= 1){\r\n\t\tmap[new_pos[1]][new_pos[0]] = map[cur_pos[1]][cur_pos[0]] ;\r\n\t\tres++;\r\n\t}else{\r\n\t\tmap[new_pos[1]][new_pos[0]] = map[cur_pos[1]][cur_pos[0]] ;\r\n\t\tmap[cur_pos[1]][cur_pos[0]] = EMPTY;\r\n\t}\r\n\tfor (var i = 0; i<NEIGHBOURS.length; i++){\r\n\t\tvar p = [new_pos[0] + NEIGHBOURS[i][0], new_pos[1] + NEIGHBOURS[i][1]];\r\n\t\tif (outOfRange(p[0], p[1])) continue;\r\n\t\tif (map[p[1]][p[0]] == EMPTY || map[p[1]][p[0]] == DUMMY) continue;\r\n\t\tif(map[p[1]][p[0]] != map[new_pos[1]][new_pos[0]]){\r\n\t\t\tmap[p[1]][p[0]] = map[new_pos[1]][new_pos[0]];\r\n\t\t\tres++;\r\n\t\t}\r\n\t}\r\n\treturn res;\r\n}", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapAbsSea.resize();\n roeMapAbsSea.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapWetN.resize();\n roeMapWetN.reposition();\n }", "afterMapCreation() {\n this.moveBackgroundMap(\n this.currentModel.get('longitude'),\n this.currentModel.get('latitude'),\n this.currentModel.get('preferredZoom')\n );\n }", "constrainToMap() {\n //check position on x axis and counter force\n if (this.x < (windowWidth / 20)) {\n this.vx += 1;\n }\n if (this.x > (windowWidth - windowWidth / 20)) {\n this.vx -= 1;\n }\n\n // check position on y axis and counter force\n if (this.y < (windowHeight / 5)) {\n this.vy += 1;\n }\n if (this.y > (windowHeight - windowHeight / 10)) {\n this.vy -= 1;\n }\n }", "updateMap() {\n const shape = this.shape,\n data = this.shape.shape,\n map = this.map,\n pos = map.getTileIndexFromPixel(shape.x, shape.y),\n buffer = shape.getMatrix(),\n rows = data.height / map.tileHeight,\n cols = data.width / map.tileWidth;\n\n for (let j = 0; j < rows; ++j) {\n for (let i = 0; i < cols; ++i) {\n if (buffer[j * cols + i]) {\n map.updateTile(pos.x + i, pos.y + j, data.color, Tile.TYPE.WALL);\n }\n }\n }\n }", "function makeNewMaze(mapSize){\n\t//Robert TODO: build a process by which a new array of arrays is created with the proper lengths, and to ensure that there IS a path to the end\n\t//Robert TODO: assign mapData these key value pairs {map: [ [], [], [], [] ], playerPosition: [y, x], mosterNOrigin: [y, x]}\n\tvar mapMargin = mapSize / 3;\n\n\tfunction generateMap(){\n\n\t\tvar monsterCount = 0;\n\n\t\tmapData.map = [];\n\t\tmapData.viewMap = [];\n\n\t\tfor (let i = 0; i < mapSize; i++) {\n\t\t\tmapData.map.push([]);\n\t\t\tfor (let j = 0; j < mapSize; j++) {\n\t\t\t\tmapData.map[i].push(0);\n\t\t\t}\n\t\t}\n\n\t\tmapData.playerPosition = [];\n\t\tmapData.playerPosition.push(Math.ceil(Math.random()*(mapSize-2*mapMargin)+mapMargin));\n\t\tmapData.playerPosition.push(Math.ceil(Math.random()*(mapSize-2*mapMargin)+mapMargin));\n\n\t\tmapData.map[mapData.playerPosition[0]][mapData.playerPosition[1]] = FLOOR;\n\n\t\tvar curY = mapData.playerPosition[0];\n\t\tvar curX = mapData.playerPosition[1];\n\n\t\tvar triedToStep = 0;\n\t\tvar madeAStep = 0;\n\t\t\n\n\t\twhile((curY != 0 && curY != mapSize-1) && (curX != 0 && curX != mapSize-1)) {\n\t\t\tvar upRand = Math.random()*10;\n\t\t\tvar downRand = Math.random()*10;\n\t\t\tvar rightRand = Math.random()*10;\n\t\t\tvar leftRand = Math.random()*10;\n\n\t\t\tif (upRand > downRand && upRand > rightRand && upRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY-1][curX] == WALL && (mapData.map[curY-1][curX+1] != FLOOR || mapData.map[curY-1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurY-=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']'); //mapData.monster0Origin = [11, 12]\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (downRand > rightRand && downRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY+1][curX] == WALL && (mapData.map[curY+1][curX+1] != FLOOR || mapData.map[curY+1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurY+=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (rightRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY][curX+1] == WALL && (mapData.map[curY+1][curX+1] != FLOOR || mapData.map[curY-1][curX+1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurX+=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttriedToStep+=1;\n\t\t\t\tif (mapData.map[curY][curX-1] == WALL && (mapData.map[curY+1][curX-1] != FLOOR || mapData.map[curY-1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurX-=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (triedToStep == 10) {\n\t\t\t\tmadeAStep++;\n\t\t\t\tif (upRand > downRand && upRand > rightRand && upRand > leftRand) {\n\t\t\t\t\tcurY--;\n\t\t\t\t} else if (downRand > rightRand && downRand > leftRand) {\n\t\t\t\t\tcurY++;\n\t\t\t\t} else if (rightRand > leftRand) {\n\t\t\t\t\tcurX++;\n\t\t\t\t} else {\n\t\t\t\t\tcurX--;\n\t\t\t\t}\n\t\t\t\tif (mapData.map[curY][curX] != SAFE && String(mapData.map[curY][curX]).charAt(0) != '4' && mapData.map[curY][curX] != FLOOR && madeAStep%20 != 0){\n\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t} else {\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tif (String(mapData.map[curY][curX]).charAt(0) != '4') {\n\t\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmadeAStep--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tif (String(mapData.map[curY][curX]).charAt(0) != '4') {\n\t\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmadeAStep--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttriedToStep = 0;\n\t\t\t}\n\t\t}\n\t\treturn madeAStep;\n\t}\n\n\n\tvar goodMap = false;\n\n\twhile (!goodMap) {\n\t\tvar stepsCounted = generateMap();\n\t\tif (stepsCounted > mapSize*8) {\n\t\t\tgoodMap = true;\n\t\t}\n\t}\n\n\tfor (let i = 0; i < 9; i++) {\n\t\tmapData.viewMap.push([]);\n\t\tfor (let j = 0; j < 9; j++) {\n\t\t\tmapData.viewMap[i].push(0);\n\t\t}\n\t}\n\n\tfor (let i = 0; i < 9; i++) {\n\t\tfor (let j = 0; j < 9; j++) {\n\t\t\ttry {\n\t\t\t\tmapData.viewMap[i].push((mapData.map[mapData.playerPosition[0]-(4-i)][mapData.playerPosition[0]-(4-j)]));\n\t\t\t} catch {\n\t\t\t\tmapData.viewMap[i].push(0);\n\t\t\t}\n\t\t}\n\t}\n}", "function _newMarkerPostion(map) {\n let bbox = map.getBounds();\n const xr = Math.random(), yr = Math.random();\n const xext = bbox.getEast() - bbox.getWest();\n const yext = bbox.getNorth() - bbox.getSouth();\n const x = (xext / 2.0) * xr + bbox.getWest() + (xext / 4.0);\n const y = (yext / 2.0) * yr + bbox.getSouth() + (yext / 4.0);\n return [y, x];\n }", "function startDisplacement(map, width) {\n\t\t\tvar topRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center;\n\n\t\t\tmap[0][0] = Math.random();\n\t\t\ttopLeft = map[0][0];\n\n\t\t\tmap[0][width] = Math.random();\n\t\t\tbottomLeft = map[0][width];\n\n\t\t\tmap[width][0] = Math.random();\n\t\t\ttopRight = map[width][0];\n\n\t\t\tmap[width][width] = Math.random();\n\t\t\tbottomRight = map[width][width];\n\n\t\t\tmap[width / 2][width / 2] = topLeft + bottomLeft + topRight + bottomRight; \n\t\t\tmap[width / 2][width / 2] = normalize(map[width / 2][width / 2]);\n\t\t\tcenter = map[width / 2][width / 2];\n\t\t\t\n\n\t\t\tmap[width / 2][width] = bottomLeft + bottomRight + center / 4;\n\t\t\tmap[width / 2][0] = topLeft + topRight + center / 4;\n\t\t\tmap[width][width / 2] = topRight + bottomRight + center / 4;\n\t\t\tmap[0][width / 2] = topLeft + bottomLeft + center / 4;\n\n\n\t\t\t// if (wrapping === false) {\n\t\t\t// // non wrapping\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center / 3;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center / 3;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center / 3;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center / 3;\n\t\t\t// }\n\n\t\t\t// else {\n\t\t\t// // wrapping\t\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center + center / 4;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center + center / 4;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center + center / 4;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center + center / 4;\n\t\t\t// }\n\n\t\t\tcenterDisplacement(width);\n\t\t}", "function setMapSize(){\n\t//si la fenetre est inferieur a x alors on met la carte en largeur max (typiquement on est sur un smartphone)\n\tif(window.innerWidth < 769){\n\t\tvar largeur_a_enlever_a_la_carte = 0;\n\t\tvar hauteur_a_rajouter_a_la_liste = 50;\n\t}\n\telse{\n\t\tvar largeur_a_enlever_a_la_carte = 300;\n\t\tvar hauteur_a_rajouter_a_la_liste = 0;\n\t}\n\t//si le navigateur est internet explorer\n\tif (MQA.browser.name == \"msie\"){\n\t\tdocument.getElementById('map').style.width = document.body.offsetWidth - 20 - largeur_a_enlever_a_la_carte;\n\t\tdocument.getElementById('map').style.height = document.body.offsetHeight - $('#offset').height() - 20;\n\t\talert(\"Internet Explorer ne permet pas d'afficher les équipes et leur parcours. Utilisez un navigateur plus récent comme Chrome ou Firefox.\");\n\t\t//meme chose pour la liste\n\t\tdocument.getElementById('userlist').style.height = document.body.offsetHeight - $('#offset').height() - 20;\n\t} else {\n\t\tdocument.getElementById('map').style.width = window.innerWidth - largeur_a_enlever_a_la_carte;\n\t\tdocument.getElementById('map').style.height = window.innerHeight - $('#offset').height();\n\t\t//meme chose pour la liste\n\t\tdocument.getElementById('userlist').style.height = window.innerHeight - $('#offset').height() + hauteur_a_rajouter_a_la_liste;\t\n\t}\n\t\n}", "function resetMap(map) {\r\n\r\n mapZoom = 1;\r\n\r\n viewBoxCoords[0] = 0;\r\n viewBoxCoords[1] = 0;\r\n viewBoxCoords[2] = originW;\r\n viewBoxCoords[3] = originH;\r\n\r\n originViewBox.x = 0;\r\n originViewBox.y = 0;\r\n originViewBox.width = originW;\r\n originViewBox.height = originH;\r\n\r\n //map.setViewBox(viewBoxCoords[0], viewBoxCoords[1], viewBoxCoords[2], viewBoxCoords[3], false);\r\n map.animateViewBox(originViewBox, viewBoxCoords[0], viewBoxCoords[1], viewBoxCoords[2], viewBoxCoords[3], 250, animationFinished);\r\n\r\n readyToAnimate = true;\r\n\r\n }", "function teleport(AIMap)\n {\n var i, j;\n do\n {\n i = randomintAtoB(1,GRIDSIZE-2);\n j = randomintAtoB(1,GRIDSIZE-2);\n }\n while ( occupied(i,j) && GRID[i][j] != GRID_BLANK); \t // search for empty square\n\n //set old i and j to null\n AIMap['oldI'] = null;\n AIMap['oldJ'] = null;\n\n //set new position\n AIMap['i'] = i;\n AIMap['j'] = j;\n\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapWetS.resize();\n roeMapWetS.reposition();\n }", "function reMap(p) {\n if (!p) {\n console.error('Null Point given for remap!');\n return {x: 0, y:0};\n }\n\n var pa = config.printArea;\n pa = {\n x: config.noMirror ? pa.x : pa.l,\n l: config.noMirror ? pa.l : pa.x,\n y: pa.y,\n t: pa.t\n }\n\n var b = paper.view.bounds;\n return {\n x: Math.round(map(b.width - (p.x - b.x), 0, b.width, pa.x, pa.l) * 1000) / 1000,\n y: Math.round(map(p.y - b.y, 0, b.height, pa.t, pa.y) * 1000) / 1000\n };\n }", "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapFAL.resize();\n roeMapFAL.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapAcid.resize();\n roeMapAcid.reposition();\n }", "function mapReset() {\n\tinfoWindow.map ? reposInfoWindow() : map.fitBounds(bounds);\n}", "function inicializa_mapa()\n{\n\n estado = 1;\n\n // START PROMPT ANIMATION\n move_obj($('mapa_jogo_img'),-1000,0);\n move_obj($('mapa_jogo_flash'),-1000,0);\n move_obj($('comida_img'),-1000,0);\n limpa_pontuacaos();\n move_obj($('comida_pw_img'),-1000,0);\n for(var i=0; i<=12; i++)\n move_obj($('ecra_inicial_obj_'+i),-1000,0);\n move_obj($('ecra_inicial_obj'),-1000,0);\n move_obj($('inicializa_mapa_obj'),0,0);\n\n if (creditos > 1)\n {\n move_obj($('inicializa_mapa_obj_1'),-1000,0);\n move_obj($('inicializa_mapa_obj_2'),224,335);\n }\n else\n {\n move_obj($('inicializa_mapa_obj_1'),264,335);\n }\n}", "function set_map() {\n var half = settings.get('half');\n logd('set_map maps[' + week + ']:');\n logd(maps[week]);\n logd('(' + half + ' % 2 === 1)?' + (half-1)/2 + ':' + (half-2)/2);\n // var map = maps[(settings.get('half') > 2)?(parseInt(week)+1):week];\n var map = maps[week][(half % 2 === 1)?(half-1)/2:(half-2)/2];\n logd('maps[' + week + '][' + ((half % 2 === 1)?(half-1)/2:(half-2)/2) + '] = ' + map);\n tagpro.group.socket.emit(\"setting\", {\"name\": \"map\", \"value\": map}); // if in second game, use the next map\n}", "function nuevoFin(){\n let previo = fin;\n fin = mapa[inputFinalX.value()][inputFinalY.value()];\n fin.obstaculo = false;\n fin.corrienteFuerte = false;\n fin.corriente = false;\n fin.pintar(0);\n previo.pintar(255);\n}", "function resetMap() {\r\n var windowWidth = window.innerWidth;\r\n if (windowWidth <= 1080) {\r\n map.setZoom(5);\r\n map.setCenter(mapOptions.center);\r\n } else if (windowWidth > 1080) {\r\n map.setZoom(5);\r\n map.setCenter(mapOptions.center);\r\n }\r\n }", "function resizeShip(toChange1, toChange2, dimension, invert) {\n var secondPart;\n var thirdPart;\n var fourthPart;\n if (invert != true) {\n if (toChange2 != 0 && toChange2 != (mapSize - 1)) {\n secondPart = toChange2 - 1;\n thirdPart = toChange2 + 1;\n if (toChange2 < mapSize - 2) fourthPart = toChange2 + 2;\n else\n fourthPart = toChange2 - 2;\n } else if (toChange2 === 0) {\n secondPart = toChange2 + 1;\n thirdPart = toChange2 + 2;\n fourthPart = toChange2 + 3;\n\n } else if (toChange2 === mapSize - 1) {\n secondPart = toChange2 - 1;\n thirdPart = toChange2 - 2;\n fourthPart = toChange2 - 3;\n }\n switch (dimension) {\n case 4:\n if (checkShips(toChange1, secondPart) && checkShips(toChange1, thirdPart) && checkShips(toChange1, fourthPart)) {\n map[toChange1][secondPart] = \"ship\";\n map[toChange1][thirdPart] = \"ship\";\n map[toChange1][fourthPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n shipsContainer[counterShips - 1].setShip([toChange1, thirdPart]);\n shipsContainer[counterShips - 1].setShip([toChange1, fourthPart]);\n break;\n }\n case 3:\n if (checkShips(toChange1, secondPart) && checkShips(toChange1, thirdPart)) {\n map[toChange1][secondPart] = \"ship\";\n map[toChange1][thirdPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + toChange1 + \" i \" + secondPart);\n shipsContainer[counterShips - 1].setShip([toChange1, thirdPart]);\n console.log(\"Dodaje \" + (counterShips - 1) + \" \" + toChange1 + \" i \" + thirdPart);\n } else {\n resizeShip(toChange1, toChange2, 3, true);\n }\n break;\n case 2:\n if (checkShips(toChange1, secondPart)) {\n map[toChange1][secondPart] = \"ship\";\n shipsContainer[counterShips - 1].setShip([toChange1, secondPart]);\n } else {\n resizeShip(toChange1, toChange2, 2, true);\n }\n //console.log(\"Pierwszy element: \" + shipsContainer[2].position[0]);\n //console.log(\"Drugi element: \" + shipsContainer[2].position[1]);\n //console.log(\"Trzeci element: \" + shipsContainer[2].position[2]);\n //console.log(\"Czwarty element: \" + shipsContainer[0].position[3]);\n //for (i = 0; i < shipsContainer[9].position.length; i++)\n // console.log(\"Element: \" + i + \" = \" +\n // shipsContainer[9].position[i]);\n break;\n default:\n break;\n }\n\n } else {\n if (toChange1 != 0 && toChange1 != (mapSize - 1)) {\n secondPart = toChange1 - 1;\n thirdPart = toChange1 + 1;\n if (toChange1 < mapSize - 2)\n fourthPart = toChange1 + 2;\n else\n fourthPart = toChange1 - 2;\n } else if (toChange1 === 0) {\n\n secondPart = toChange1 + 1;\n thirdPart = toChange1 + 2;\n fourthPart = toChange1 + 3;\n\n } else if (toChange1 === mapSize - 1) {\n secondPart = toChange1 - 1;\n thirdPart = toChange1 - 2;\n fourthPart = toChange1 - 3;\n\n }\n switch (dimension) {\n case 4:\n if (checkShips(secondPart, toChange2) && checkShips(thirdPart, toChange2) && checkShips(fourthPart, toChange2)) {\n\n map[secondPart][toChange2] = \"ship\";\n map[thirdPart][toChange2] = \"ship\";\n map[fourthPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n shipsContainer[counterShips - 1].setShip([thirdPart, toChange2]);\n shipsContainer[counterShips - 1].setShip([fourthPart, toChange2]);\n\n }\n break;\n case 3:\n if (checkShips(secondPart, toChange2) && checkShips(thirdPart, toChange2)) {\n map[secondPart][toChange2] = \"ship\";\n map[thirdPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + secondPart + \" i \" + toChange2);\n shipsContainer[counterShips - 1].setShip([thirdPart, toChange2]);\n console.log(\"Dodaje do\" + (counterShips - 1) + \" \" + thirdPart + \" i \" + toChange2);\n\n } else {\n map[toChange1][toChange2] = \"\";\n shipsContainer[counterShips - 1].removeShip([toChange1, toChange2]);\n console.log(\"Usuwam z \" + (counterShips - 1) + toChange1 + \" i \" + toChange2);\n counterShips--;\n initPoints(3, 1);\n }\n break;\n case 2:\n if (checkShips(secondPart, toChange2)) {\n map[secondPart][toChange2] = \"ship\";\n shipsContainer[counterShips - 1].setShip([secondPart, toChange2]);\n\n } else {\n map[toChange1][toChange2] = \"\";\n shipsContainer[counterShips - 1].removeShip([toChange1, toChange2]);\n console.log(\"Usuwam z \" + (counterShips - 1) + toChange1 + \" i \" + toChange2);\n counterShips--;\n initPoints(2, 1);\n }\n default:\n {\n break;\n }\n\n }\n\n }\n}", "updateSize() {\n this.map.invalidateSize()\n }", "function sanitise_map() \n\t{\n\t\tfor (var e = 0; e < height; ++e) \n\t\t{\n\t\t\tfor (var i = 0; i < width; ++i) \n\t\t\t{\n\t\t\t\tif (heightmap[i][e] < MINHEIGHT)\n\t\t\t\t\theightmap[i][e] = MINHEIGHT;\n\t\t\t\tif (heightmap[i][e] > MAXHEIGHT)\n\t\t\t\t\theightmap[i][e] = MAXHEIGHT;\n\t\t\t}\n\t\t}\n\t}", "function gameMenutoBattleMap() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'BATTLE_MAP') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n gameMenuBattlePanelDeleter();\n gameMenu.classList.add('pagehide');\n battleMap1.classList.remove('pagehide');\n }, 600);\n }\n }", "function resetMapMarkers() {\n bigMap.config.markers = angular.copy(defaultMarkers);\n }", "recenterMap() {\n const map = this.map;\n let curr = this.props.currentLocation;\n\n const google = this.props.google;\n const maps = google.maps;\n const zoom = this.props.zoom;\n\n if (map) {\n let center = new maps.LatLng(curr.lat, curr.lng);\n map.panTo(center);\n map.setZoom(zoom)\n }\n }", "function resetMap() {\n\t\tvar windowWidth = $(window).width();\n\t\tif (windowWidth <= 600) {\n\t\t\tmap.setZoom(12);\n\t\t\tmap.setCenter(mapOptions.center);\n\t\t}\n\t\telse {\n\t\t\tmap.setZoom(13);\n\t\t\tmap.setCenter(mapOptions.center);\n\t\t}\n\t}", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapSulf.resize();\n roeMapSulf.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapTNit.resize();\n roeMapTNit.reposition();\n }", "afterMapCreation() {\n this.moveBackgroundMap(\n this.currentModel.video.get('longitude'),\n this.currentModel.video.get('latitude'),\n this.currentModel.video.get('preferredZoom')\n );\n }", "addMap() {\n const {createMap} = this.props;\n\n let bounds = {\n north: this.state.bounds.north === '' ? undefined : parseFloat(this.state.bounds.north),\n south: this.state.bounds.south === '' ? undefined : parseFloat(this.state.bounds.south),\n east: this.state.bounds.east === '' ? undefined : parseFloat(this.state.bounds.east),\n west: this.state.bounds.west === '' ? undefined : parseFloat(this.state.bounds.west),\n centerLat: this.state.bounds.centerLat === '' ? undefined : parseFloat(this.state.bounds.centerLat),\n centerLon: this.state.bounds.centerLon === '' ? undefined : parseFloat(this.state.bounds.centerLon),\n range: this.state.bounds.range === '' ? undefined : parseFloat(this.state.bounds.range),\n scale: this.state.bounds.scale === '' ? undefined : parseFloat(this.state.bounds.scale)\n };\n\n let blankBounds = true;\n for (let prop in bounds) {\n if (typeof bounds[prop] !== 'undefined') {\n blankBounds = false;\n break;\n }\n }\n if (blankBounds) {\n bounds = undefined;\n }\n\n createMap(bounds, this.state.engineId === '' ? undefined : this.state.engineId,\n false, this.state.recorder, parseInt(this.state.brightness), parseInt(this.state.midDistanceThreshold),\n parseInt(this.state.farDistanceThreshold));\n }", "function SetMapSize() {\n document.documentElement.style.setProperty('--boardX', boardSize.x);\n document.documentElement.style.setProperty('--boardY', boardSize.y);\n}", "function changeMapSize() {\n console.log('changeMapSize')\n\n let zoomScrollBar = document.getElementById('zoom')\n zoomScrollBar.style.display = 'block'\n zoomScrollBar.value = '6'\n\n if (mapSetting != mapSize) {\n mapSize = mapSetting\n let areaDiv = document.getElementById('area')\n $('.grid-piece').remove();\n if (mapSize == 'large') {\n gridDown = 180\n gridUp = -180\n numberOfDivs = 180 * 110\n $('#area').css( \"grid-template-columns\", \"repeat(180, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(110, 6px)\" );\n addDivs(110 * 180);\n } else if (mapSize == 'medium') {\n gridDown = 130\n gridUp = -130\n numberOfDivs = 105 * 130\n $('#area').css( \"grid-template-columns\", \"repeat(130, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(105, 6px)\" );\n addDivs(105 * 130);\n } else {\n gridDown = 100\n gridUp = -100\n numberOfDivs = 100 * 100\n $('#area').css( \"grid-template-columns\", \"repeat(100, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(100, 6px)\" );\n addDivs(100 * 100);\n }\n mapSize = mapSetting\n }\n}", "function initMap(getCurrPosResult){\n // regione mappa di default\n var region = {\n latitude: 43.720653,\n longitude: 10.408407,\n latitudeDelta: 0.01,\n longitudeDelta: 0.01\n };\n\n if(!getCurrPosResult.success){\n Ti.API.info(\"Impostata regione DEFAULT per la mappa.\");\n\n Ti.API.debug(\"Ti.Geolocation.getCurrentPosition()\");\n Ti.API.debug(\" code: \" + getCurrPosResult.code);\n Ti.API.debug(\" error: \" + getCurrPosResult.error);\n // mappa inizializzata con la regione e segnaposto di default\n }else{\n Ti.API.info(\"Posizione attuale recuperata\");\n for (var p in getCurrPosResult){\n Ti.API.debug(\" \" + p + \": \" + JSON.stringify(getCurrPosResult[p]));\n }\n\n region.latitude = getCurrPosResult.coords.latitude;\n region.longitude = getCurrPosResult.coords.longitude;\n region.latitudeDelta = 0.06;\n region.longitudeDelta = 0.06;\n\n Ti.API.info(\"Impostata regione ATTUALE per la mappa.\");\n }\n\n $.map.setRegion(region);\n updateMap(region);\n}", "mutateToBest() {\r\n const a = this.makeBoard();\r\n const takeAway = num => {\r\n let [i, j] = this.placing[num].place;\r\n const [di, dj] = this.placing[num].dir;\r\n for (let c of num) {\r\n a[i][j].splice(a[i][j].indexOf(c), 1);\r\n i += di;\r\n j += dj;\r\n }\r\n };\r\n const putTo = (num, place) => {\r\n let [i, j] = place.place;\r\n const [di, dj] = place.dir;\r\n for (let c of num) {\r\n if (a[i][j]===null) a[i][j] = [];\r\n a[i][j].push(c);\r\n i += di;\r\n j += dj;\r\n }\r\n };\r\n const countScore = (num, i0, j0, d) => {\r\n let s = 0;\r\n let i = i0;\r\n let j = j0;\r\n const [di, dj] = d;\r\n for (let c of num) {\r\n if (a[i][j]!==null && a[i][j].some(x=>x!==c)) s+= 1;\r\n i += di;\r\n j += dj;\r\n }\r\n return s;\r\n };\r\n const findBestPlace = num => {\r\n let numLen = num.length;\r\n let bestScore = Infinity;\r\n let bestPlace = null;\r\n for (let d of Grid.DIRS) {\r\n for (let i=d[0]<0?numLen-1:0,iEnd=d[0]>0?this.m-numLen:this.m; i<iEnd; i++) {\r\n for (let j=d[1]<0?numLen-1:0,jEnd=d[1]>0?this.n-numLen:this.n; j<jEnd; j++) {\r\n let score = countScore(num, i, j, d);\r\n if (score<bestScore) {\r\n bestScore = score;\r\n bestPlace = {place: [i,j], dir: d};\r\n }\r\n }\r\n }\r\n }\r\n return bestPlace;\r\n };\r\n for (let num of Object.keys(this.placing).sort(()=>Math.random()-0.5)) {\r\n takeAway(num);\r\n let p = findBestPlace(num);\r\n this.placing[num] = p;\r\n putTo(num, p);\r\n }\r\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapTemp.resize();\n roeMapTemp.reposition();\n }", "function _mapZoomed() {\n _setAllIcons();\n}", "recenterMap() {\n const map = this.map;\n const current = this.state.currentLocation;\n\n const google = this.props.google;\n const maps = google.maps;\n\n if (map) {\n let center = new maps.LatLng(current.lat, current.lng);\n map.panTo(center);\n }\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapCarbon.resize();\n roeMapCarbon.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapFPL.resize();\n roeMapFPL.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapGulf.resize();\n roeMapGulf.reposition();\n }", "mapGenerate() {\n for (let i = 0; i < this.ySize; i++) {\n this.map[i] = [];\n for (let j = 0; j < this.xSize; j++) {\n let mapValue = this.empty;\n this.map[i].push(mapValue);\n }\n }\n }", "function mapResize(newSize){\r\n\r\n // Get current position\r\n var map_x = unsafeWindow.mapX;\r\n var map_y = unsafeWindow.mapY;\r\n var map_s = unsafeWindow.mapSize;\r\n\r\n // Calculate new X and Y\r\n var delta = parseInt((map_s - newSize) / 2);\r\n\r\n // Overwrite values\r\n map_x += delta;\r\n map_y += delta;\r\n\r\n // InnerHTML\r\n var ihtml = \"\";\r\n ihtml += '<tr>';\r\n ihtml += '<td height=\"38\">' + map_y + '</td>';\r\n ihtml += '<td colspan=\"' + newSize + '\" rowspan=\"' + newSize + '\">';\r\n ihtml += '<div style=\"background-image:url(graphic/map/gras4.png); position:relative; width:' + (53 * newSize) + 'px; height:' + (38 * newSize) +'px; overflow:hidden\" id=\"map\">';\r\n ihtml += '<div id=\"mapOld\" style=\"position:absolute; left:0px; top:0px\">';\r\n ihtml += '<div style=\"color:white; margin:10px\">Lade Karte...</div>';\r\n ihtml += '</div>';\r\n ihtml += '<div id=\"mapNew\" style=\"position:absolute; left:0px; top:0px\"></div>';\r\n ihtml += '</div>';\r\n ihtml += '</td>';\r\n ihtml += '</tr>';\r\n for(jj=1; jj<newSize; jj++){\r\n ihtml += '<tr><td width=\"20\" height=\"38\">' + (map_y + jj) + '</td></tr>';\r\n }\r\n ihtml += '<tr id=\"map_x_axis\">';\r\n ihtml += '<td height=\"20\"></td>';\r\n for(jj=0; jj<newSize; jj++){\r\n ihtml += '<td align=\"center\" width=\"53\">' + (map_x + jj) + '</td>';\r\n }\r\n ihtml += '</tr>';\r\n var tmp = document.getElementById(\"mapCoords\").innerHTML = ihtml;\r\n\r\n // Update data\r\n var url = \"http://\"+(\"\"+location.href).split(\"/\")[2] + \"/\" + unsafeWindow.mapURL + '&start_x=' + map_x + '&start_y=' + map_y + '&size_x=' + newSize + '&size_y=' + newSize;\r\n GM_xmlhttpRequest({\r\n method:\"GET\",\r\n url:url,\r\n onload:function(details){\r\n document.getElementById(\"mapOld\").innerHTML = details.responseText;\r\n }\r\n });\r\n\r\n // mapMoveTopo()\r\n var scrollX = map_x;\r\n var scrollY = map_y;\r\n unsafeWindow.scrollX = scrollX;\r\n unsafeWindow.scrollY = scrollY;\r\n var topoX = parseInt(document.getElementsByName('min_x')[0].value); //minimalstes x auf Karte rechts\r\n var topoY = parseInt(document.getElementsByName('min_y')[0].value); //minimalstes y auf Karte rechts\r\n\r\n var relX = scrollX - topoX;\r\n if(unsafeWindow.globalYDir == 1){\r\n var relY = scrollY - topoY;\r\n }else{\r\n var relY = (45-mapSize) - (scrollY-topoY);\r\n }\r\n \r\n // Rechteck verschieben\r\n document.getElementById('topoRect').style.left = (5*(relX)) + 'px';\r\n document.getElementById('topoRect').style.top = (5*(relY)) + 'px';\r\n document.getElementById('topoRect').style.width = (5*(newSize)) + 'px';\r\n document.getElementById('topoRect').style.height = (5*(newSize)) + 'px';\r\n\t \r\n\t unsafeWindow.ajaxMapInit(parseInt(unsafeWindow.mapX), parseInt(unsafeWindow.mapY), parseInt(newSize) , \"game.php?\"+getUrlParam(\"village\")+\"&screen=map&xml\", 1, 1);\r\n\t \r\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapLong.resize();\n roeMapLong.reposition();\n }", "function createFreePointsMap(){\n var index=0;\n for (var i = 0; i < 20; i++){\n for (var j = 0; j < 20; j++){\n /*if((j==0 && i == 1) || (j==0 && i == 18) || (j==1 && i >=1 && i <= 8) || (j==1 && i == 11) || (j==1 && i == 14) || (j==1 && i == 18) || (j>=2 && j<=3 && i == 1) || (j>=2 && j<=3 && i == 11) || (j==3 && i>=9 && i<=10) || (j==5 && i==0) ||\n (i==1 && j>=5 && j<=7) || (j==3 && i>=9 && i<=10) || (j==4 && i>=3 && i<=6)|| (j==5 && i>=10 && i<=14)||\n (j==5 && i>=16 && i<=18) || (j==7 && i>=3 && i<=9)|| (j==7 && i>=10 && i<=18) || (j==9 && i>=5 && i<=9) ||\n (j==9 && i>=11 && i<=12) || (j==11 && i>=11 && i<=18) || (j==14 && i>=1 && i<=3) || (j==13 && i>=11 && i<=14) ||\n (j==15 && i>=11 && i<=14) || (j==3 && i>=9 && i<=10) || (j==16 && i>=1 && i<=5) || (j==16 && i>=7 && i<=9) ||\n (j==18 && i>=1 && i<=10) || (j==18 && i>=12 && i<=18) || (i==14 && j>=2 && j<=4) || (i==16 && j>=2 && j<=4) ||\n (i==5 && j>=5 && j<=6) || (i==8 && j>=5 && j<=6) || (i==3 && j>=8 && j<=10) || (i==15 && j>=8 && j<=10) ||\n (i==18 && j>=8 && j<=9) || (i==18 && j>=12 && j<=17) || (i==1 && j>=11 && j<=13) || (i==5 && j>=10 && j<=15) || (i==7 && j>=11 && j<=15) || (i==9 && j>=10 && j<=15) || (i==3 && j>=12 && j<=13) || (i==12 && j>=16 && j<=17) ||\n (i==16 && j>=14 && j<=15) || (i==1 && j==17) || (i==14 && j==14))*/\n if((j>=1 && j<=2 && i>=1 && i<=3) || (j>=1 && j<=2 && i>=5 && i<=7) || (j>=1 && j<=2 && i>=11 && i<=13) || (j>=1 && j<=2 && i>=15 && i<=18) ||\n (j>=0 && j<=2 && i==9) || (j==4 && i>=1 && i<=3) || (j==4 && i>=15 && i<=18) ||(j>=6 && j<=8 && i>=1 && i<=3) || (j>=6 && j<=8 && i>=15 && i<=18) ||\n (j>=10 && j<=12 && i>=1 && i<=3) || (j>=10 && j<=12 && i>=15 && i<=18) || (j>=8 && j<=10 && i>=7 && i<=11) || (j==18 && i>=1 && i<=7) ||\n (j==18 && i>=11 && i<=13) || (j==18 && i>=15 && i<=18) || (j==16 && i>=0 && i<=1) || (j==16 && i>=7 && i<=11) || (j==16 && i>=17 && i<=18) ||\n (j==14 && i>=1 && i<=3) || (j==14 && i>=5 && i<=7) || (j==14 && i>=11 && i<=13) || (j==14 && i>=15 && i<=18) || (j==12 && i>=7 && i<=11) ||\n (j==4 && i>=7 && i<=11) || (j==6 && i>=6 && i<=7) || (j==6 && i>=11 && i<=12) || (i==3 && j>=15 && j<=16) || (i==15 && j>=15 && j<=16) ||\n (i==5 && j>=16 && j<=17) || (i==5 && j>=10 && j<=12) || (i==5 && j>=4 && j<=8) || (i==9 && j>=5 && j<=6) || (i==9 && j>=13 && j<=14) ||\n (i==9 && j>=17 && j<=18) || (i==13 && j>=4 && j<=8) || (i==13 && j>=10 && j<=12) || (i==13 && j>=16 && j<=17) )\n {\n if(i==9 && j==8){\n\n }\n else if(i==9 && j==10){\n\n }\n else{\n continue;\n }\n\n }\n else{\n freePointsMap.points[index] = j;\n freePointsMap.points[index + 1] = i;\n index+=2;\n }\n }\n }\n}", "function mapForApproximateLocationCentreChanged()\n {\n determineLocationFromMap();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapRadon.resize();\n roeMapRadon.reposition();\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapEco.resize();\n roeMapEco.reposition();\n }", "function resize_map() {\n\n\t\t//console.log('sidepanel will change to '+sidepanel_width);\n\t\twindow_width = $(window).width();\n\n\t\tvar original_map_width = $(window).width();\n\t\t//console.log('original window = ' + original_map_width);\n\n\t\tvar new_map_width;\n\t\t //change this to - 700\n\t\t//console.log('new map width = ' + new_map_width);\n\n\t\tvar new_margin_left;\n\n\n\n\n\t\tif (window_width <= 900) {\n\t\t\tnew_map_width = window_width - 500 + 'px';\n\t\t\tnew_margin_left = 500 + 'px';\n\t\t} else if (window_width <= 768) {\n\t\t\tnew_map_width =0 + 'px';\n\t\t\tnew_margin_left = window_width + 'px';\n\t\t} else {\n\t\t\tnew_map_width = window_width - 700 + 'px';\n\t\t\tnew_margin_left = 700 + 'px';\n\t\t}\n\n\n\n\t\tfunction toggle_map_size(map_width,margin_left,data_provider){\n\t\t\tconsole.log(map_width);\n\t\t\t$('#mapdiv').css({\n\t\t\t\twidth : map_width,\n\t\t\t\tmarginLeft: margin_left\n\n\t\t\t});\n\n\t\t\tmap.dataProvider = data_provider;\n\t\t\tmap.validateNow();\n\n\n\t\t}\n\n\t\t$(\"a.clickme\").click(function(e){\n\t\t\t$('#showinfo').hide();\n\t\t\ttoggle_map_size(new_map_width,new_margin_left,indiaDataProvider)\n\t\t});\n\n\t\t$('#close-sidepanel').click(function(e){\n\t\t\ttoggle_map_size(original_map_width,0,dataProvider)\n\t\t});\n\n\t}", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapNLCD.resize();\n roeMapNLCD.reposition();\n }", "function funcionInicializarMapa () {\r\n\r\n //Se crea una instancia para el mapa\r\n gmMapa = new google.maps.Map(document.querySelector('#mapa'), {\r\n //Se establece el zoom\r\n zoom: 16,\r\n //Se centra el mapa a una ubicacion\r\n center: new google.maps.LatLng(9.935, -84.092),\r\n //Se establece el tipo del mapa\r\n mapTypeId: google.maps.MapTypeId.HYBRID\r\n });\r\n //Se agregan opciones al mapa\r\n var gmOpcionesMapa = {\r\n //Se establece el zoom maximo\r\n maxZoom:20,\r\n //Se establece el zoom minimo\r\n minZoom:14,\r\n //Se deshabilita el uso de stree view\r\n streetViewControl: false,\r\n //Se deshabilita el control del tipo de mapa\r\n mapTypeControl: false\r\n }\r\n var nLatitud = sessionStorage.getItem(\"sesion_latitud_tiendas_CU5\");\r\n var nLongitud = sessionStorage.getItem(\"sesion_longitud_tiendas_CU5\");\r\n\r\n //Se agregan las opciones al mapa\r\n gmMapa.setOptions(gmOpcionesMapa);\r\n //Se setea un marcador con una ubicacion por defecto\r\n gmMarcador = new google.maps.Marker({\r\n //Se agrega la posicion en San Jose\r\n position: new google.maps.LatLng(nLatitud, nLongitud)//,\r\n //Se habilita el arratre del marcador\r\n //draggable: true\r\n });\r\n //Se centra el mapa en la posicion del marcador\r\n gmMapa.setCenter(gmMarcador.position);\r\n //Se coloca el marcador en el mapa\r\n gmMarcador.setMap(gmMapa);\r\n //Se obtiene una latitud y longitud por defecto\r\n nLatitud = gmMarcador.position.lat();\r\n nLongitud = gmMarcador.position.lng();\r\n\r\n\r\n var geocoder = new google.maps.Geocoder;\r\n\r\n geocoder.geocode({'location': gmMarcador.position}, function(results, status) {\r\n\r\n if (status === google.maps.GeocoderStatus.OK) {\r\n if (results[1]) {\r\n var gmContenido = '<h2>' + results[1].formatted_address + '</h2>' + '<p>' + gmMarcador.position + '</p>';\r\n var gmVentanaInformacion = new google.maps.InfoWindow({\r\n content: gmContenido\r\n });\r\n gmVentanaInformacion.open(gmMapa, gmMarcador);\r\n } else {\r\n window.alert('No results found');\r\n }\r\n } else {\r\n window.alert('Geocoder failed due to: ' + status);\r\n }\r\n });\r\n}", "function applyRules() {\n let work = map.slice(0);\n map = grid();\n\n for (var row in map) {\n if (map.hasOwnProperty(row)) {\n for (var col in map[row]) {\n if (map[row].hasOwnProperty(col)) {\n\n //map[row][col] = null;\n\n let tile = work[row][col];\n let n = getNeighbors(work, row, col);\n let totalNeigbors = n.reduce(function (total, sum) {\n return (total || 0) + (sum || 0);\n });\n\n if (tile === 1) {\n\n // Any live cell with fewer than two live neighbors dies, as if by underpopulation.\n if (totalNeigbors < 2) {\n map[row][col] = 0;\n }\n // Any live cell with two or three live neighbors lives on to the next generation.\n else if (totalNeigbors == 2 || totalNeigbors == 3) {\n map[row][col] = 1;\n }\n // Any live cell with more than three live neighbors dies, as if by overpopulation.\n else if (totalNeigbors > 3) {\n map[row][col] = 0;\n }\n\n } else {\n\n // Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\n if (totalNeigbors == 3) {\n map[row][col] = 1;\n }\n\n }\n\n }\n }\n }\n }\n }", "function setup (){\n \n pjCol = 0; //pixeles\n pjFill = 0; // pixeles\n xPos = (pjCol * 40)+ 20;\n xPos = (pjFill * 40)+ 20;\n\n\n// Crear arreglo de arreglos\nfor (let index = 0; index < 20; index ++){\n\n mapa.push (new Array(20));\n}\n\n//Asignar valores iniciales\nfor (let fill = 0; fill < 20; fill++){\n for (let col = 0; col < 6; col++){\n mapa [fill][col] = 0;\n }\n}\n\n//seleccionamos algunos [fill][col] --> y, x\nmapa [0][0] = 1;\nmapa [0][1] = 1;\nmapa [0][4] = 1;\nmapa [0][5] = 1;\nmapa [1][0] = 1;\nmapa [1][1] = 1;\nmapa [1][4] = 1;\nmapa [1][5] = 1;\nmapa [2][0] = 1;\nmapa [2][1] = 1;\nmapa [2][4] = 1;\nmapa [2][5] = 1;\nmapa [3][4] = 1;\nmapa [4][4] = 1;\nmapa [3][5] = 1;\n \n}", "function newMap() {\n\t\t'use strict';\n\n\t\t// resulting map\n\t\tvar map = [];\n\n\t\t// number of rows and columns\n\t\tgameMetrics.x = 16;\n\t\tgameMetrics.y = Math.floor(gameMetrics.x / Config.boardRatio);\n\n\t\t// populate map with -1\n\t\tfor (var i = 0; i < gameMetrics.y; i++) {\n\t\t\tvar row = [];\n\t\t\tfor (var j = 0; j < gameMetrics.x; j++) {\n\t\t\t\trow.push(-1);\n\t\t\t}\n\t\t\tmap.push(row);\n\t\t}\n\t\treturn map;\n\n\t}", "function updateParkingMap() {\n for (let j = 1; j <= PARKING_SPOTS; j++) {\n fillById(\"_\" + j);\n }\n}", "function startGame() {\n if (props.mapObj) {\n setGameRunning(true);\n let inVermont = false;\n let randLat = 0;\n let randLong = 0;\n while (!inVermont) {\n //did I mix up lat and long? I feel like I mixed up lat and long. It works though so if I did I did it consistently at least?\n randLat = (Math.random() * 2 + 71.5) * -1; //-73.5 to -71.5\n randLong = Math.random() * 3.4 + 41.7; //45.1 to 41.7\n inVermont =\n leafletPip.pointInLayer([randLat, randLong], geoJSON(borderData))\n .length > 0;\n }\n props.setMark([randLong, randLat]);\n setLat(randLat);\n setLong(randLong);\n props.mapObj.setView([randLong, randLat], 18);\n setViewLat(randLat);\n setViewLong(randLong);\n setDisplayLat(\"???\");\n setDisplayLong(\"???\");\n setDisplayCounty(\"???\");\n setDisplayTown(\"???\");\n setScore(100);\n setShouldUpdate(true);\n }\n }", "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapBio.resize();\n roeMapBio.reposition();\n }", "function handleMapUpdate() {\n\t\t\tmap.theMap.updateSize();\n\t\t}", "_updateMap() {\n const ts = new Date().valueOf();\n this.mapping = true;\n let tickSelected = 0;\n const selCopy = this._copySelections();\n const ticksSelectedCopy = this._getTicksFromSelections();\n const firstSelection = this.getExtremeSelection(-1);\n this._updateModifiers();\n this.selections = [];\n\n // Try to restore selection. If there were none, just select the fist\n // thing in the score\n const keys = Object.keys(this.measureNoteMap);\n if (keys.length && !selCopy.length) {\n // If there is nothing rendered, don't update tracker\n this.selections = [this.measureNoteMap[keys[0]]];\n } else {\n if (!firstSelection) {\n layoutDebug.setTimestamp(layoutDebug.codeRegions.UPDATE_MAP, new Date().valueOf() - ts);\n return;\n }\n this._findClosestSelection(firstSelection.selector);\n const first = this.selections[0];\n tickSelected = first.note.tickCount;\n while (tickSelected < ticksSelectedCopy && first) {\n const delta = this._growSelectionRight(true);\n if (!delta) {\n break;\n }\n tickSelected += delta;\n }\n }\n this.highlightSelection();\n this._createLocalModifiersList();\n // Is this right? Don't update the past buffer with data until the display is redrawn\n // because some of the selections may not exist in the score.\n if (this.renderer.isDirty === false) {\n this.pasteBuffer.clearSelections();\n this.pasteBuffer.setSelections(this.score, this.selections);\n }\n this.mapping = false;\n layoutDebug.setTimestamp(layoutDebug.codeRegions.UPDATE_MAP, new Date().valueOf() - ts);\n }", "function vielseMap() {\n var lommedal = {lat: 59.950574, lng: 10.501232}; //Område som skal vises\n var map = new google.maps.Map(document.getElementById('mapVielse'), { //I funksjonen google.maps.Map kan man legge til funksjoner som zoom og hvor kartet skal være sentrert.\n zoom: 17, //Zooming på kartet\n center: lommedal //Hvor kartet skal sentreres, her i posisjon lommedal (satt i longitude og latitude)\n });\n var marker = new google.maps.Marker({ //Posisjonen til markøren\n position: lommedal,\n map: map\n });\n}", "setMap(map) {\n this.map = map;\n this.peekTokens = [];\n }", "function resetMap() {\n clearMap();\n removePolygon();\n }", "function MoverHeuristico(){\n //Limpieza del tablero por cada iteracion\n for(var i =0; i< tx;i++){\n for(var j =0; j<ty;j++){\n console.log(document.getElementById(i+ \",\" + j).style.backgroundColor)\n if(document.getElementById(i+ \",\" + j).style.backgroundColor == \"rgb(0, 153, 255)\"){\n document.getElementById(i+ \",\" + j).style.backgroundColor = \"rgb(209, 209, 209)\"\n }\n \n }\n }\n \n //Espliteando las posiciones de los agentes y la meta para poder asignarlas luego\n var xinit = parseInt(idAgente2.split(\",\")[0]);\n var yinit = parseInt(idAgente2.split(\",\")[1]);\n var xid1 = parseInt(idAgente.split(\",\")[0]);\n var yid1 = parseInt(idAgente.split(\",\")[1]);\n var xMeta = parseInt(idMeta.split(\",\")[0]);\n var yMeta = parseInt(idMeta.split(\",\")[1]);\n\n //Instancia de la matriz en la cual se va a calcular.\n var grid = new PF.Grid(tx,ty);\n var finder = new PF.AStarFinder();\n\n //Meto los lugares que no son visitables\n grid.setWalkableAt(xMeta, yMeta, true);\n \n //Meto los lugares que no son visitables\n grid.setWalkableAt(xid1, yid1, true);\n\n //Bucle para que las paredes se metan al grid\n for(var i =0; i< tx; i++){\n for(var j=0; j<ty; j++){\n \n if(matriz2[j][i] == pared2){\n //lugares no transitables\n grid.setWalkableAt(i,j,false);\n }else {\n grid.setWalkableAt(i,j,true);\n }\n }\n }\n var path = finder.findPath(xinit, yinit, xMeta, yMeta, grid);\n \n //Me retorna un path que es la lista de lugares que se tiene que mover el agente y se lo mando al movimiento\n MoverAgenteHeuristico(path);\n \n}", "evolve () {\n\n // make a new map\n let next = new Map();\n\n // loop over the x coordinates\n for (let x = 0; x < this.config.get(colsKey); ++x) {\n\n // loop over the y coordinates\n for (let y = 0; y < this.config.get(rowsKey); ++y) {\n\n // get the index\n let index = (x + y * this.config.get(colsKey));\n\n // get the old state\n let state = this.grid.get(index);\n\n // count the neighbours\n let neighbours = this.countNeighbours(x, y);\n\n // are we dealing with a living being?\n if (state == 1 && (neighbours < 2 || neighbours > 3)) next.set(index, 0);\n \n // are we dealing with a dead being?\n else if (state == 0 && neighbours == 3) next.set(index, 1);\n \n // normal state\n else next.set(index, state);\n }\n }\n\n // save the new grid\n this.grid = next;\n\n // return the grid\n return next;\n }", "function resetTheMap() {\n // clear anything in the search inputs\n $('form.search-form input').val('');\n\n // reset map & table display with the default search\n // If we have a homebounds defined, that means we've been here before, and have rendered the full data to the map.\n if (CONFIG.homebounds) {\n // use homebounds we already defined\n render({ force_redraw: true, fitbounds: false });\n CONFIG.map.fitBounds(CONFIG.homebounds);\n } else {\n // first time through, let this function do the map fitting and set CONFIG.homebounds\n render({ force_redraw: true });\n }\n\n // clear any existing country and feature selection\n CONFIG.selected_country.layer.clearLayers();\n CONFIG.selected_country.name = '';\n DATA.filtered = null;\n\n // switch back to the map tab\n $('input#map-tab').click();\n\n // resize everything\n resize();\n}", "_reset() {\n\t\tthis.map.setCenter(new google.maps.LatLng(this.config.centreLat, this.config.centreLang));\n\t\tthis.map.setZoom(this.config.startZoom);\n\t}", "function displace(num) {\n\t\tvar max = num / (map.mapSize + map.mapSize) * map.roughness;\n\t\treturn (Math.random() - 0.5) * max;\n}", "function scaleMap() {\n let element = $(\"#pais\");\n if (_resizer != null) ResizeSensor.detach(element);\n _resizer = new ResizeSensor(element, function () {\n scaleSVG(element.width());\n });\n}", "function reset() {\r\n var bounds = path.bounds(mapData),\r\n topLeft = bounds[0],\r\n bottomRight = bounds[1];\r\n console.log(bounds)\r\n svg .attr(\"width\", bottomRight[0] - topLeft[0])\r\n .attr(\"height\", bottomRight[1] - topLeft[1])\r\n .style(\"left\", topLeft[0] + \"px\")\r\n .style(\"top\", topLeft[1] + \"px\");\r\n\r\n g .attr(\"transform\", \"translate(\" + -topLeft[0] + \",\" + -topLeft[1] + \")\");\r\n\r\n park.attr(\"d\", path);\r\n }", "reMap(val) {\n return val * this.cellSize;\n }", "function clearNextMovesMarkers() {\n mapSquares(square => square.canBeNextMove = false);\n}", "initArrayMap() {\n for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {\n for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {\n this.arrayMap.push({\n coordX: i,\n coordY: j,\n navigable: true,\n player: {\n active: false\n },\n weapon: {\n active: false\n },\n potion: {\n active: false\n }\n });\n }\n }\n }", "function setFinalPoint() {\n let x = document.getElementById('final-x').value\n let y = document.getElementById('final-y').value\n map.updateFinalDest(finalDest.x, finalDest.y, x - 1, y - 1)\n document\n .getElementById(`output-${finalDest.x}-${finalDest.y}`)\n .classList.remove('goal')\n finalDest.x = x - 1\n finalDest.y = y - 1\n document\n .getElementById(`output-${finalDest.x}-${finalDest.y}`)\n .classList.add('goal')\n}", "function showMap () {\n\t\t\t\t\t\t\tinstructions.classList.add('hidden')\n\t\t\t\t\t\t\tmap.classList.remove('hidden')\n\t\t\t\t\t\t}", "updatePlant(){\r\n // Set to decor layer then remove the plant sprites\r\n this.map.setLayer(3);\r\n this.map.removeTileAt(5, 1);\r\n this.map.removeTileAt(5, 0);\r\n // Set the plant sprite according to the right score\r\n if (this.current_score < 125){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(17, 5, 0);\r\n }\r\n if (125 <= this.current_score && this.current_score < 250){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(18, 5, 0);\r\n }\r\n if (250 <= this.current_score && this.current_score < 375){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(19, 5, 0);\r\n }\r\n if (375 <= this.current_score && this.current_score < 500){\r\n this.map.putTileAt(20, 5, 1);\r\n }\r\n if (500 <= this.current_score){\r\n this.map.putTileAt(21, 5, 1);\r\n }\r\n }", "function initMap() {\n // The location of NAirobi\n const nairobi = { lat: -1.286389, lng: 36.817223 };\n // The map, centered at NAirobi\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: nairobi,\n });\n // The marker, positioned at NAirobi\n const marker = new google.maps.Marker({\n position: nairobi,\n map: map,\n });\n }", "function calculateMapTilePosition(){\n\t\tvar mnwCurrentView = $('mnwCurrentView');\n\t\tvar calcLeft = mnwCurrentView.style.left;\n\t\tvar calcTop = mnwCurrentView.style.top;\t\t\n\t\tvar c_top = Math.floor(VIEWPORT_HEIGHT/2);\n\t\tvar c_left = Math.floor(VIEWPORT_WIDTH/2);\n\t\tcalcLeft = calcLeft.replace('px','')*1;\n\t\tcalcTop = calcTop.replace('px','')*1;\n\t\tcalcLeft = calcLeft * mnwScale + c_left;\n\t\tcalcTop = calcTop * mnwScale + c_top;\n\t\tgoToMapPosition(calcTop,calcLeft);\n\t\tloadCurrentMapArea();\n\t}" ]
[ "0.5889256", "0.5756008", "0.5748465", "0.5611763", "0.55691624", "0.5565757", "0.55072284", "0.55067295", "0.548058", "0.54759985", "0.54734784", "0.5439932", "0.5439477", "0.5426575", "0.53887004", "0.53814554", "0.53613955", "0.5334128", "0.53325444", "0.5323804", "0.53184515", "0.5314426", "0.52922213", "0.52883285", "0.5265473", "0.52622354", "0.5254993", "0.5253322", "0.5249087", "0.5242567", "0.52402914", "0.5227933", "0.5218969", "0.521187", "0.5205311", "0.51992494", "0.51915824", "0.5190699", "0.5188394", "0.51873803", "0.51849467", "0.51817507", "0.5172666", "0.5170392", "0.5169123", "0.5166187", "0.51621634", "0.5161137", "0.5155449", "0.51506716", "0.5146724", "0.5138582", "0.5138478", "0.5135677", "0.51299703", "0.51240563", "0.5121789", "0.51208377", "0.5119216", "0.51189244", "0.5117371", "0.51165575", "0.5109788", "0.5105168", "0.510196", "0.50994086", "0.5092817", "0.5089218", "0.50889724", "0.5087118", "0.5087038", "0.5086008", "0.50794446", "0.50780344", "0.5070515", "0.50653106", "0.50649214", "0.5058756", "0.50560486", "0.5054058", "0.5054046", "0.5052608", "0.50514007", "0.50245506", "0.5023979", "0.5022818", "0.5022065", "0.5020341", "0.5016796", "0.5015634", "0.5012894", "0.501181", "0.5009324", "0.5006143", "0.49964607", "0.4994162", "0.49867833", "0.4986526", "0.49845117", "0.49814716" ]
0.56406814
3
Quando termina il trascinamento della mappa.
function dragMapStop() { if (dragging) { lastMapPosition = currentMapPosition; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "terminating() {}", "function Main() {\n if (currentToken() == \"metodo\") {\n nextToken();\n if (currentToken() == \"principal\") {\n currentMethodId = 'principal';\n nextToken();\n MethodParams(); // Main have empty params list\n if (currentToken() == ':') {\n nextToken();\n Type();\n symbolTable.insert(currentScope, 'method', currentType, currentMethodId, currentLine());\n nextToken();\n if (currentToken() == \"{\") {\n nextToken();\n currentScope = currentMethodId;\n Variables();\n Statements();\n if (currentToken() == \"}\") {\n nextToken();\n return;\n }\n }\n }\n }\n }\n }", "mateEnd() {}", "function C012_AfterClass_Amanda_Untie() {\n\tActorUntie();\n\tC012_AfterClass_Amanda_CalcParams();\n\tCurrentTime = CurrentTime + 50000;\n}", "halt() {\n if (this.continuing_) {\n this.completeContinue_(false);\n }\n }", "function handleContinuation(kont)\n{\n kont.continuation(kont);\n}", "function terminaMovimientoMarcador(e){\n\t\tvar nombreActual = obtenerNombreMarcador(this);\n\t\tconsole.log(\"hola\");\n\t\t//console.log(\"\");\n\t\tif(nombreActual){\n\t\t \t//actualizarlo en la tabla\n\t\t\tjQuery(jQuery(\"#ID-\" + nombreActual.replace(\" \", \"_\")).children()[2]).text(this.getLatLng().lat);\n\t\t \tjQuery(jQuery(\"#ID-\" + nombreActual.replace(\" \", \"_\")).children()[3]).text(this.getLatLng().lng);\n\t\t \t\t\n\t\t \tvar res = obtenerCoordenadaDesdeNombre(nombreActual);\n\t\t \tif(res){\n\t\t \t\tvar coordenadaActual = res[0];\n\t\t \t\tvar indiceActual = res[1];\n\t\t \t\tvar otraCoor = {\n\t\t\t\t nombre: nombreActual,\n\t\t\t\t x: this.getLatLng().lat,\n\t\t\t\t y: this.getLatLng().lng,\n\t\t\t\t h: 0,\n\t\t\t\t tipo: coordenadaActual['tipo']\n\t\t\t\t};\n\t\t \t\tobtenerAltura(this.getLatLng(), nombreActual, coordenadas, indiceActual, otraCoor);\n\t\t \t}\n\t\t}\n\t\tif((Object.keys(markers).length == 4 || (Object.keys(markers).length == 5 && puntoInicial)) && rectangulo){\n\t\t\tdibujarRectangulo();\n\t\t}\n\t}", "terminate() {\n this.tokens.forEach(t => {\n t.terminate();\n });\n }", "function mi(t, e) {\n return hi(t).put(\n /**\n * @returns A value suitable for writing a sentinel row in the target-document\n * store.\n */\n function(t, e) {\n return new ar(0, Hn(t.path), e);\n }(e, t.currentSequenceNumber));\n}", "function Continuation() {}", "static get STOP() { return 3; }", "function quitarMarcadores() {\n\n console.log(\"Antes de Quitar marcadores: \", marcadores);\n for (var idm in marcadores) {\n marcadores[idm].marcador.remove();\n delete marcadores[idm];\n }\n\n console.log(\"Tras Quitar marcadores: \", marcadores);\n\n for (var idr in rutas) {\n if (rutas[idr].puntos && rutas[idr].puntos.length) {\n rutas[idr].puntos.forEach(function (p) {\n // console.log(p);\n p.remove();\n });\n\n delete rutas[idr];\n }\n }\n for (var tag in hermandadesPorDia) {\n var hermandadesDia = hermandadesPorDia[tag];\n for (var hermandadId in hermandadesDia) {\n var hermandadActual = hermandadesDia[hermandadId];\n while (hermandadActual.elementosMapa.length) {\n hermandadActual.elementosMapa.pop();\n }\n }\n }\n }", "function limpiarCapaNuevaRuta(){\n lienzoRutas.destroyFeatures();\n}", "reset() {\n this.home();\n this.clean();\n this.begin();\n }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "function quit() {\n\t divider();\n\t spacing();\n\t process.exit();\n}", "function EXIT() {\n console.clear();\n console.log(\"GRACIAS POR VISITARNOS\");\n throw new Error();\n}", "function bootlegMiddle() {\n ;\n}", "clearSeparators() {\n // empty template\n }", "function Window_OmoriStopTheArrow() { this.initialize.apply(this, arguments); }", "static get PAUSE() { return 4; }", "end() { }", "function skipToCenter() {\r\n addNewCommand(\"Go\");\r\n addNewCommand(\"Get\");\r\n addNewCommand(\"Use\");\r\n actions[1] = \"go\"\r\n actions[2] = \"get\"\r\n actions[3] = \"use\"\r\n}", "function spaceBar(e) { defDemo.currentPart().abort(); }", "get end() {}", "exitA45(ctx) {\n\t}", "set end(value) {}", "exit ({ metadata }) {\n try {\n const command = metadata.findOne(({ type }) => type === metadata.type.COMMAND)\n environmentService.set(0, command.name)\n command.arguments.forEach((arg, index) => {\n environmentService.set(index + 1, arg)\n })\n environmentService.set('#', command.arguments.length)\n environmentService.set('@', command.arguments)\n } catch (err) {\n // pass\n }\n }", "end() {\n }", "end() {\n }", "function C012_AfterClass_Amanda_Ungag() {\n\tActorUngag();\n\tC012_AfterClass_Amanda_CalcParams();\n\tCurrentTime = CurrentTime + 50000;\n}", "function escreveConteudo(){}", "function limpiarCapaRecorridos(){\n lienzoRecorridos.destroyFeatures();\n removerMarcas();\n}", "exitPair(ctx) {\n\t}", "buscarPokemon(termino) {\n console.log('capturo info de text - navbar.component.ts ', termino);\n this.router.navigate(['/buscar', termino]);\n }", "async end() {\n return;\n }", "function repartoFinal (){\n if(contadorManosTerminadas == contadorManos){ //Una vez que todas las manos estén terminadas se repartirá a la banca\n for(;sumaTotalBanca<17;){\n console.log('Como es menor que 17, le voy a dar otra carta');\n darCartaBanca();\n };\n if(sumaTotalBanca>=17){\n arrayValorCartasBanca.splice(arrayValorCartasBanca.length);\n console.log('Voy a comprobar, ya que es mayor de 17');\n \n }\n }\n \n }", "async terminate() {\n // chance for any last minute shutdown stuff\n logger.info('Null API Terminate');\n }", "exitNarrator(ctx) {\n\t}", "exit () {\n environmentService.set('?', 0)\n }", "function restart() {\n a=0; //reset dei contatori\n end=0;\n get_karma();\n }", "mostrarTarefas() {\n printPlanejamentoAtual(this.getPlanejamentoAtual());\n printListaTarefa(this.listaQuadros());\n }", "function index_limpiarMapa() {\n\tobjetoLineas.setPath([]);\n\tobjetoLineas.setMap(map);\n\tarrayPuntos = new Array();\n\t\n\tif (arrayMarcas.length > 0) {\n\t\tfor (var x = 0; x < arrayMarcas.length; x++) {\n\t\t\tarrayMarcas[x].setMap(null);\n\t\t}\n\t}\n\t\t\n\tarrayMarcas = new Array();\n\t\n\tfor (var x = 0; x < arrayMarcasPuntos.length; x++) {\n\t\tarrayMarcasPuntos[x].setMap(null);\n\t}\n\t\n\tarrayMarcasPuntos = new Array();\n\tif (typeof objetoPoligono !== 'undefined') {\n\t\tobjetoPoligono.setMap(null);\n\t}\n}", "exitPair(ctx) {\n }", "exitMm(ctx) {\n\t}", "async runv() {\n // Add one to the start address for Thumb mode\n await this._client.writeWord(this._reset, this._start + 1);\n\n // The stack is the first reset vector\n await this._client.go(this._stack);\n }", "terminate() {\n\n\t\tthis.clearSubgoals();\n\n\t}", "startup()\n\t{\n\t\tthis.angle = 1;\n\t\tthis.rows(5, 11, 1);\n\t\tthis.action(0);\n\t}", "function desenhaTriangulos(altura) {\n linha = '*';\n for (i = 0; i < altura; i++) {\n console.log(linha);\n linha+='*';\n }\n}", "function posicionaNaviosJogador(){\r\n for (var i = 0; i < 10; i++){\r\n console.error(\"\\nNavio n.º \"+(i+1));\r\n linhaJogador = (pegarNumero(\"Linha: \", 1, 10)-1);\r\n colunaJogador = (pegarNumero(\"Coluna: \", 1, 10)-1);\r\n if (tabuleiro[linhaJogador][colunaJogador] == \" ~~~~ \"){\r\n tabuleiro[linhaJogador][colunaJogador] = \" <^^> \";\r\n contadorJogador++;\r\n }\r\n else {\r\n console.log(\"Espaço já ocupado. Você perdeu um navio. \")\r\n }\r\n }\r\n naviosJogador = contadorJogador;\r\n}", "exitA5(ctx) {\n\t}", "exitSparqlPrefix(ctx) {\n\t}", "terminate() {\n this.stopping = true;\n return this.done;\n }", "terminate() {\n this.stopping = true;\n return this.done;\n }", "semicolon() {\n if (!this.isLineTerminator()) this.unexpected(null, tt.semi);\n }", "exitA20(ctx) {\n\t}", "function STOP() {\n return 1;\n }", "exitA60(ctx) {\n\t}", "exitA50(ctx) {\n\t}", "exitA81(ctx) {\n\t}", "async borrarFilasDeTodasLasTablas() {\n await this.borrarFilasDe(\"Medidas\")\n }", "finish() {}", "exitQnaSection(ctx) {\n\t}", "async emptyKibanaIndex() {\n await emptyKibanaIndexAction({\n client: this.client,\n log: this.log,\n kbnClient: this.kbnClient,\n });\n }", "exitSimpleIntentSection(ctx) {\n\t}", "exitA37(ctx) {\n\t}", "end() {\n this.log('end');\n }", "exitAtom(ctx) {\n\t}", "function index_terminar() {\n\tif (arrayPuntos.length > 0) {\n\t\tvar path = objetoLineas.getPath();\n\t\t\n\t\tswitch (arrayPuntos.length) {\n\t\t\tcase 1://dibuja primeramente un circulo con un radio de 500mts\n\t\t\t\tpath.push(arrayPuntos[0]);\n\t\t\t\tobjetoLineas.setPath(path);\n\t\t\t\t\n\t\t\t\t//agrega marca en la posicion marcada para busqueda\n\t\t\t\tvar marca = new google.maps.Marker({\n\t\t\t\t\tid: 0,\n\t\t\t\t\tposition : arrayPuntos[0],\n\t\t\t\t\tmap : map,\n\t\t\t\t\tdraggable: true,\n\t\t\t\t\ticon: \"images/marcadorVertice.png\"\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tarrayMarcasPuntos.push(marca);\n\t\t\t\tgoogle.maps.event.addListener(marca, 'drag', function(){\n\t\t\t\t\ttempId = parseInt(this.get(\"id\"));\n\t\t\t\t\ttempPosition = this.getPosition();\n\t\t\t\t\tvar path = objetoLineas.getPath();\n\t\t\t\t\tpath.setAt(tempId, tempPosition);\n\t\t\t\t\tarrayPuntos[tempId] = tempPosition;\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 2://defino el radio en el segundo punto para el circulo\n\t\t\t\tpath.push(arrayPuntos[1]);\n\t\t\t\tobjetoLineas.setPath(path);\n\t\t\t\t\n\t\t\t\t//agrega marca en la posicion marcada para busqueda\n\t\t\t\tvar marca = new google.maps.Marker({\n\t\t\t\t\tid: 1,\n\t\t\t\t\tposition : arrayPuntos[1],\n\t\t\t\t\tmap : map,\n\t\t\t\t\tdraggable: true,\n\t\t\t\t\ticon: \"images/marcadorVertice.png\"\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tarrayMarcasPuntos.push(marca);\n\t\t\t\tgoogle.maps.event.addListener(marca, 'drag', function(){\n\t\t\t\t\ttempId = parseInt(this.get(\"id\"));\n\t\t\t\t\ttempPosition = this.getPosition();\n\t\t\t\t\tvar path = objetoLineas.getPath();\n\t\t\t\t\tpath.setAt(tempId, tempPosition);\n\t\t\t\t\tarrayPuntos[tempId] = tempPosition;\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault://dibuja las lineas del poligono\n\t\t\t\tif (arrayPuntos.length == 3) {\n\t\t\t\t\tpath.push(arrayPuntos[2]);\n\t\t\t\t\tobjetoLineas.setMap(null);\n\t\t\t\t\t\n\t\t\t\t\tobjetoPoligono = new google.maps.Polygon({\n\t\t\t\t\t\tpaths: path,\n\t\t\t\t\t\tstrokeColor: \"#852c2b\",\n\t\t\t\t\t\tstrokeOpacity: 0.8,\n\t\t\t\t\t\tstrokeWeight: 3,\n\t\t\t\t\t\tfillColor: \"#852c2b\",\n\t\t\t\t\t\tfillOpacity: 0.35\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\tobjetoPoligono.setMap(map);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//agrega marca en la posicion marcada para busqueda\n\t\t\t\t\tvar marca = new google.maps.Marker({\n\t\t\t\t\t\tid: 2,\n\t\t\t\t\t\tposition : arrayPuntos[2],\n\t\t\t\t\t\tmap : map,\n\t\t\t\t\t\tdraggable: true,\n\t\t\t\t\t\ticon: \"images/marcadorVertice.png\"\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tarrayMarcasPuntos.push(marca);\n\t\t\t\t\tgoogle.maps.event.addListener(marca, 'drag', function(){\n\t\t\t\t\t\ttempId = parseInt(this.get(\"id\"));\n\t\t\t\t\t\ttempPosition = this.getPosition();\n\t\t\t\t\t\tvar path = objetoLineas.getPath();\n\t\t\t\t\t\tpath.setAt(tempId, tempPosition);\n\t\t\t\t\t\tarrayPuntos[tempId] = tempPosition;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpath.push(arrayPuntos[arrayPuntos.length - 1]);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvar marca = new google.maps.Marker({\n\t\t\t\t\t\tid: arrayPuntos.length - 1,\n\t\t\t\t\t\tposition : arrayPuntos[arrayPuntos.length - 1],\n\t\t\t\t\t\tmap : map,\n\t\t\t\t\t\tdraggable: true,\n\t\t\t\t\t\ticon: \"images/marcadorVertice.png\"\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tarrayMarcasPuntos.push(marca);\n\t\t\t\t\tgoogle.maps.event.addListener(marca, 'drag', function(){\n\t\t\t\t\t\ttempId = parseInt(this.get(\"id\"));\n\t\t\t\t\t\ttempPosition = this.getPosition();\n\t\t\t\t\t\tvar path = objetoLineas.getPath();\n\t\t\t\t\t\tpath.setAt(tempId, tempPosition);\n\t\t\t\t\t\tarrayPuntos[tempId] = tempPosition;\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tobjetoPoligono.setPaths(path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "end () {\n require('./actions/end')(this)\n }", "exitDictorsetmaker(ctx) {\n\t}", "exit() {\n this.exit();\n }", "function end() {\n console.log(`Commande : ${command} \\nArgs : ${args}\\nAuteur : ${author}\\n`);\n message.delete();\n return\n }", "terminate() {\n this._storeToken();\n }", "exitA80(ctx) {\n\t}", "function anhadir() {\n k.anhadirDatos();\n}", "function postMortem() {\n throw new Error('This method cannot be called because this Handsontable instance has been destroyed');\n }", "exitA49(ctx) {\n\t}", "exitA40(ctx) {\n\t}", "undo() {\n this.ffauWorkspace.undo(0);\n }", "function dibujar(tablero) {\n\n console.clear();\n\n console.log(\"NodeJS TA-TE-TI\" + \"\\n\");\n\n console.log(\" \" + TABLERO[1] + \" | \" + TABLERO[2] + \" | \" + TABLERO[3] + \"\\n\" +\n \"-----------\" + \"\\n\" +\n \" \" + TABLERO[4] + \" | \" + TABLERO[5] + \" | \" + TABLERO[6] + \"\\n\" +\n \"-----------\" + \"\\n\" +\n \" \" + TABLERO[7] + \" | \" + TABLERO[8] + \" | \" + TABLERO[9] + \"\\n\");\n\n turno();\n\n}", "exitA9(ctx) {\n\t}", "async pesquisarTarefa() {\n printPlanejamentoAtual(this.getPlanejamentoAtual());\n const { tarefa } = await formPesquisarTarefa(this.listaTarefas());\n await this.informacaoTarefa(tarefa);\n }", "exitA30(ctx) {\n\t}", "async stopped () {\n\t\t// await this.tortoise.destroy();\n\t}", "function kappaGen() {\n // Randomizes between 1 and 4\n randNum = Math.floor(Math.random() * 5) + 1;\n if (randNum === 1) {\n notes.push(new Arrow(\"left_mini_bob_ross\"));\n }\n if (randNum === 2) {\n notes.push(new Arrow(\"right_bible_thump\"));\n }\n if (randNum === 3) {\n notes.push(new Arrow(\"up_pog_champ\"));\n }\n if (randNum === 4) {\n notes.push(new Arrow(\"down_resident_sleeper\"));\n }\n if (randNum === 5) {\n notes.push(new Arrow(\"left_mini_bob_ross\"));\n notes.push(new Arrow(\"up_pog_champ\"));\n }\n if (randNum === 6) {\n notes.push(new Arrow(\"left_mini_bob_ross\"));\n notes.push(new Arrow(\"down_resident_sleeper\"));\n }\n if (randNum === 7) {\n notes.push(new Arrow(\"left_mini_bob_ross\"));\n notes.push(new Arrow(\"right_bible_thump\"));\n }\n if (randNum === 8) {\n notes.push(new Arrow(\"up_pog_champ\"));\n notes.push(new Arrow(\"down_resident_sleeper\"));\n }\n if (randNum === 9) {\n notes.push(new Arrow(\"up_pog_champ\"));\n notes.push(new Arrow(\"right_bible_thump\"));\n }\n if (randNum === 10) {\n notes.push(new Arrow(\"down_resident_sleeper\"));\n notes.push(new Arrow(\"right_bible_thump\"));\n }\n}// ends kappaGen()", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "async stopped() {\n\n\t}", "terminate() {\n if (this._value.length > 0) {\n this._storeToken();\n }\n }", "terminate() {\n if (this._value.length > 0) {\n this._storeToken();\n }\n }", "terminate() {\n if (this._value.length > 0) {\n this._storeToken();\n }\n }", "terminate() {\n if (this._value.length > 0) {\n this._storeToken();\n }\n }", "function END() {}" ]
[ "0.5534917", "0.53917974", "0.53441525", "0.49848086", "0.49381906", "0.49377504", "0.49182162", "0.4916956", "0.488143", "0.48322448", "0.48155698", "0.4804637", "0.47683692", "0.475814", "0.47414905", "0.47344565", "0.47067383", "0.46999332", "0.46943146", "0.46832153", "0.46703744", "0.4663626", "0.46613917", "0.4649436", "0.4631713", "0.4625743", "0.461805", "0.46173692", "0.4604987", "0.4604987", "0.46027258", "0.46006235", "0.45937967", "0.45916274", "0.45798364", "0.45775515", "0.45499358", "0.4549869", "0.4537934", "0.45345232", "0.45338398", "0.452364", "0.45204517", "0.45104948", "0.44949722", "0.4487469", "0.4484555", "0.4476145", "0.44756645", "0.4471308", "0.44650987", "0.4464862", "0.44581568", "0.44581568", "0.44538108", "0.4440795", "0.4440508", "0.4438818", "0.44347897", "0.4434145", "0.4432485", "0.44314176", "0.4429534", "0.44245347", "0.4424478", "0.4423937", "0.4420835", "0.441924", "0.44184956", "0.4415066", "0.4410832", "0.44082958", "0.44052884", "0.43975314", "0.43945026", "0.43908656", "0.4390764", "0.43904495", "0.4381898", "0.43767136", "0.43734077", "0.43724585", "0.43718448", "0.43703246", "0.4366059", "0.4363634", "0.43604678", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.43535942", "0.4350894", "0.4350894", "0.4350894", "0.4350894", "0.4350761" ]
0.0
-1
Fa apparire il layer corrispondente al servizio selezionato. La mappa attuale e' letta dalla variabile currentMap. Il servizio attivo e' letto dalla variabile activeService.
function refreshServicesLayer() { if ((!currentMap) || (!activeService)) { // Sanity check return; } var currentMapId = currentMap.id; // Accendiamo il solo layer giusto. for (i = 0; i < SERVICES.length; i++) { var service = SERVICES[i]; var element = document.getElementById(currentMapId + "-" + service); if ((SERVICES[i] == activeService) && (element)) { element.style.display = ""; } else { if (element != null) { element.style.display = "none"; } } } // For sui servizi }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniciarmapa() {\n\t\n\t\n\t\n vector = new OpenLayers.Layer.Vector(\"Vector Layer\", {});\n tapetes = new OpenLayers.Layer.Vector(\"Tapetes Layer\", {});\n carrera.kmlayer = new OpenLayers.Layer.Vector(\"Layer\", {});\n ruta_layer = new OpenLayers.Layer.Vector(); \n\n\t//carrera.geosalida = new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(puntosalida[2],puntosalida[3]),new OpenLayers.Geometry.Point(puntosalida[4],puntosalida[5])]); //casa\n\t//carrera.geollegada =new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(puntollegada[0],puntollegada[1]),new OpenLayers.Geometry.Point(puntollegada[2],puntollegada[3])]); //casa\n \t\n\tstyle_tapete = {// estilo par la linea de ruta\n strokeColor: \"#FF0000\",\n strokeWidth: 3,\n pointRadius: 6\n \t };\n\n\t//tapetes.addFeatures(new OpenLayers.Feature.Vector(carrera.geosalida,null,style_tapete));\n\t//tapetes.addFeatures(new OpenLayers.Feature.Vector(carrera.geollegada,null,style_tapete));\n\t\n sprintersLayer = new OpenLayers.Layer.Vector(\"Sprinters\", {\n styleMap: new OpenLayers.StyleMap({\n graphicOpacity: 1.0,\n graphicWidth: 16,\n graphicHeight: 26,\n graphicYOffset: -26\n })\n });\n\n \n\t \n var geolocate = new OpenLayers.Control.Geolocate({\n id: 'locate-control',\n geolocationOptions: {\n \tmaximumAge:0, \n \ttimeout:60000, \n \tenableHighAccuracy: true//true\n }\n });\n geolocate.watch = true;\n\n // create map\n map = new OpenLayers.Map({\n div: \"map\",\n theme: null,\n projection: sm,\n numZoomLevels: 18,\n controls: [\n new OpenLayers.Control.Attribution(),\n new OpenLayers.Control.TouchNavigation({\n dragPanOptions: {\n enableKinetic: true\n }\n }),\n \n\t\t geolocate\n \n ],\n layers: [\n new OpenLayers.Layer.OSM(),\n ruta_layer,\n sprintersLayer,\n carrera.kmlayer,\n tapetes,\n vector\n \n \n ],\n center: new OpenLayers.LonLat(0, 0),\n zoom: 1\n });\n\n\t\n\n\n\n var style = {\n fillOpacity: 0.1,\n fillColor: '#000',\n strokeColor: '#f00',\n strokeOpacity: 0.6\n };\n\t \n\n carrera.getruta();\n //map.addLayer(sprintersLayer);\n geolocate.events.register(\"locationupdated\",geolocate,function(e) {\n \t\n \tconsole.log(carrera.precision+\"hola\");\n \t$(\"#precision_text\").text((e.position.coords.accuracy).toFixed(0)+\" Mt\");\n \tif(e.position.coords.accuracy<=10){\n \t\t//$(\"#popupGpsInfo\").popup('close');\n \t\t$(\".precision\").css('background-color', 'rgb(82,134,183)');\n \t}else \n \tif(e.position.coords.accuracy<=20){\n \t\t$(\".precision\").css('background-color', 'yellow');\n \t}else \n if(e.position.coords.accuracy<=50){\n \t\t$(\".precision\").css('background-color', 'orange');\n \t}\n \telse{\n \t\t$(\".precision\").css('background-color', 'red');\n \t}\n \t\t\n\t\n \t\t//Si a presicion en es menor a 12 \n\t \t\tif(e.position.coords.accuracy<=carrera.precision)\n\t \t\t{ \t\n\t \t\t\tif(e.position.coords.accuracy>20){\n\t \t\t\tcarrera.precision=e.position.coords.accuracy;\n\t \t\t\t}\n\t \t\t\txpx=e.point.x;\n\t\t\t\typx=e.point.y;\n\t\t\t\tif ( $(\"#locate_stop\").is(\":visible\") ) {\n \n\t\t//alert(carrera.tipo);\n\t\t\t\t\tif(\tcarrera.tipo==\"competencia\"){\n\t\t\t\t\t\tcarrera.geosalida=tapetes.features[0].geometry;\n\t\t\t\t\t\tcarrera.geollegada=tapetes.features[1].geometry;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(\tcarrera.tipo==\"competencia\"){\n\t\t\t\t\t\truta(xpx,ypx);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tentrenamiento(xpx,ypx);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t/*intervalo=self.setInterval(function(){\n\t\t\t\t\t\tif(\tcarrera.tipo==\"competencia\"){\n\t\t\t\t\t\t\truta(puntos_simulacion[i].x,puntos_simulacion[i].y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tentrenamiento(puntos_simulacion[i].x,puntos_simulacion[i].y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif(i>1000){\n\t\t\t\t\t\t\tintervalo=window.clearInterval(intervalo);\n\t\t\t\t\t\t\tstop_carrera();\n\t\t\t\t\t\t}},\n\t\t\t\t\t\t100\n\t\t\t\t\t);*/\n\t\t\t\t} \n\t \t\t}\t\t\n\t});\n\t\n\t\n\t/*map.events.register('zoomend', this, function (event) {\n var x = map.getZoom();\n \n if( x > 16)\n {\n map.zoomTo(17);\n }\n });*/\n\t\t\t\n\t\t\t\n\t\n\tgeolocate.events.register(\"locationfailed\",this,function() {\n\t \t$.mobile.loading('hide');\t // getter2\n\t \tstop_carrera();\n\t $.mobile.changePage(\"#gpsfailed\", \"pop\"); \n\t \n\n\t});\n // set interval PARA ENVIAR LOS DATOS CADA 10 SEG\n\t\n\n}", "function updateMap() {\n\t\t\tid = trail_select.value;\n\t\t\tconsole.log(id);\n\t\t\tvar newlayer = layer.getLayer(id);\n\t\t\tnewlayer.removeFrom(map);\n\t\t\tnewlayer.setStyle({\n\t\t\t\t\tweight: 5,\n\t\t\t\t\tcolor: '#00ff00',\n\t\t\t\t\topacity: 1.0\n\t\t\t});\n\t\t\tnewlayer.addTo(map)\n\t\t\tvar prevlayer = layer.getLayer(previd);\n\t\t\tif (previd !== id) {\n\t\t\t\tprevlayer.setStyle({\n\t\t\t\t\tcolor: '#ff7800',\n\t\t\t\t\topacity: 1.0,\n\t\t\t\t\tweight: (prevlayer.feature.properties.annual*0.17)**4\n\t\t\t\t});\n\t\t\t\tprevlayer.addTo(map);\n\t\t\t\tprevid = id;\n\t\t\t}\n\t\t}", "setCurrentMap(currentMap) {\n\t\tthis.currentMap = currentMap;\n\n\t\tif (this.currentMap == this.houseMap) {\n\t\t\tthis.currentLayer = this.houseLayer;\n\t\t}\n\t\tif (this.currentMap == this.townMap) {\n\t\t\tthis.currentLayer = this.townLayer;\n\t\t}\n\t\tif (this.currentMap == this.forestMap) {\n\t\t\tthis.currentLayer = this.forestLayer;\n\t\t}\n\t\tif (this.currentMap == this.roomMap) {\n\t\t\tthis.currentLayer = this.roomLayer;\n\t\t}\n\t\tif (this.currentMap == this.havenMap) {\n\t\t\tthis.currentLayer = this.havenLayer;\n\t\t}\n\t}", "function updateMap() {\n\t//\treturn;\n// not sure if i need this\n\t\tconsole.log(\"updateMap()\");\n\t\tif (!prop(tractLayer.eachLayer)) return;\n\n\t\ttractLayer.eachLayer(function(layer) {\n\t\t\tif (MAP_DEBUG) console.log(\" -> eachLayer()\", layer.feature, layer);\n\n\t\t\t// reset properties, popup, events for each tract feature\n\t\t\tonEachTractFeature(layer.feature, layer);\n\n\t\t\t// reset layer style based on new data\n\t\t\tif (prop(layer.feature))\n\t\t\t\tlayer.setStyle(initialTractStyle(layer.feature));\n\t\t});\n\t}", "function drawMap () {\n const winHill=new Point([ -1.721040,53.362571]).transform( 'EPSG:4326','EPSG:3857');\n const activityLayer = new LayerVector({\n style: function(feature) {\n return styles[feature.get('type')];\n },\n source: new VectorSource({}),\n name: 'activity' \n });\n const animationLayer = new LayerVector({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n source: new VectorSource({}),\n name: 'animation' \n });\n \n const osmLayer = new LayerTile({\n title: 'Open Steet Map',\n type: 'base',\n source: new OSM()\n });\n\n const osmTopoLayer = new LayerTile({\n title: 'OSM Topo',\n type: 'base',\n visible: false,\n source: new XYZ({\n url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'\n })\n });\n // OSMImpl.CycleMap(name)\n //{\n // \"url\" : \"http://tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\"\n // }\n // https://a.tile.thunderforest.com/cycle/15/16234/10624.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb\n const arcGISEsriTopoLayer=new LayerTile({\n title: 'ArcGIS Esri Topographical',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Topo_Map/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n const arcGISEsriImagaryLayer=new LayerTile({\n title: 'ArcGIS Esri Image',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Imagery/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n }); \n\n\n const map = new Map({\n target: document.getElementById('map'),\n view: new View({\n center: winHill.flatCoordinates,\n zoom: 14,\n minZoom: 2,\n maxZoom: 19\n }),\n layers: [\n arcGISEsriTopoLayer,osmTopoLayer,arcGISEsriImagaryLayer,osmLayer\n ]\n });\n \n var layerSwitcher = new LayerSwitcher();\n map.addControl(layerSwitcher);\n\n return map;\n}", "addDrawInteraction() {\n // set up variable for last saved feature & vector source for point\n let lastFeature;\n let drawsource = new ol.source.Vector({wrapX: false});\n // create new point vectorLayer\n let pointVector = this.newVectorLayer(drawsource);\n // add the layer to the map\n this.map.addLayer(pointVector);\n\n // New draw event ; default to Point\n let value = 'Point';\n let geometryFunction, maxPoints;\n this.draw = new ol.interaction.Draw({\n source: drawsource,\n type: /** @type {ol.geom.GeometryType} */ (value),\n geometryFunction: geometryFunction,\n maxPoints: maxPoints\n });\n\n // On draw end, remove the last saved feature (point)\n this.draw.on('drawend', (e)=>{\n if (lastFeature) {\n drawsource.removeFeature(lastFeature);\n }\n lastFeature = e.feature;\n });\n\n // add draw interaction onto the map\n this.map.addInteraction(this.draw);\n\n }", "function panAcaServ(){\n map.setView(new ol.View({\n center: acaService,\n zoom: 19\n }));\n}", "function activarGetFeatureVectoriales() {\n\n ///En este caso es un control por cada capa preguntable vectorial\n\n //var nombreCapa = \"Alcantarillas\";\n var capasVectorialesPreguntables = [];\n\n for (var i = 0 ; i < ColeccionCapas.Capas.length; i++) {\n if (ColeccionCapas.Capas[i].esvectorial && ColeccionCapas.Capas[i].preguntable) {\n console.log(\"Activando GetFeature de: \" + ColeccionCapas.Capas[i].nombre);\n capasVectorialesPreguntables.push(ColeccionCapas.Capas[i].nombre);\n }\n\n }\n\n var capasVectorialesNoPreguntables = [];\n\n for (var i = 0 ; i < ColeccionCapas.Capas.length; i++) {\n if (ColeccionCapas.Capas[i].esvectorial && !ColeccionCapas.Capas[i].preguntable) {\n\n var nombreCapa = ColeccionCapas.Capas[i].nombre;\n\n for (var j = 0; j < map.controls.length; j++) {\n if (map.controls[j].title == \"getfeatureControl_\" + nombreCapa) {\n console.log(\"desactivando getfeatureControl_\" + nombreCapa);\n map.controls[j].deactivate();\n\n }\n }\n }\n\n }\n\n function existeElControl(nombreCapa) {\n\n var resultado = false;\n for (var i = 0; i < map.controls.length; i++) {\n if (map.controls[i].title == \"getfeatureControl_\" + nombreCapa) {\n resultado = true;\n }\n }\n return resultado\n }\n\n\n for (var i = 0; i < capasVectorialesPreguntables.length; i++) {\n\n if (!existeElControl(capasVectorialesPreguntables[i])) {\n\n var nombreCapa = nombrePrimerlayerDelaCapa(capasVectorialesPreguntables[i]);\n\n console.log(capasVectorialesPreguntables[i]);\n var controlGetfeature = new OpenLayers.Control.GetFeature({\n protocol: OpenLayers.Protocol.WFS({\n url: ancashmapfile + \"&service=wfs\",\n\n geometryName: \"ms:Shape\",\n featureType: nombreCapa,\n //filterType: \"INTERSECTS\",\n //maxFeatures: 5,\n featurePrefix: \"ms\",\n srsName: \"EPSG:3857\",\n //featureNS: \"http://mapserver.gis.umn.edu/mapserver\"\n }),\n box: false,\n hover: false,\n multipleKey: \"shiftKey\",\n toggleKey: \"ctrlKey\"\n });\n controlGetfeature.title = \"getfeatureControl_\" + capasVectorialesPreguntables[i];\n controlGetfeature.events.register(\"featureselected\", this, function (e) {\n console.log(\"Seleccionado\");\n //capaSeleccion.removeAllFeatures();\n console.log(e);\n capaSeleccion.addFeatures([e.feature]);\n mostarTablaResultadosYAddTabs(e, \"vectorial\")\n });\n\n map.addControl(controlGetfeature);\n controlGetfeature.activate();\n }\n else {\n console.log(\"Ya existe, se activa\");\n var nombreCapa = capasVectorialesPreguntables[i];\n\n for (var j = 0; j < map.controls.length; j++) {\n if (map.controls[j].title == \"getfeatureControl_\" + nombreCapa) {\n console.log(\"Activando getfeatureControl_\" + nombreCapa);\n map.controls[j].activate();\n\n }\n }\n }\n\n }\n}", "function getGEEMapServiceCallback(eeLayer){\n decrementOutstandingGEERequests();\n $('#' + spinnerID).hide();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n var prop = parseInt((1-timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length /timeLapseObj[layer.viz.timeLapseID].nFrames)*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', prop+'%').attr('aria-valuenow', prop).html(prop+'% frames loaded'); \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${prop}%, transparent ${prop}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-loading-count').html(`${timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length}/${timeLapseObj[layer.viz.timeLapseID].nFrames} layers to load`)\n if(timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length === 0){\n $('#'+layer.viz.timeLapseID+'-loading-spinner').hide();\n $('#'+layer.viz.timeLapseID+'-year-label').hide();\n // $('#'+layer.viz.timeLapseID+'-loading-progress-container').hide();\n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${0}%, transparent ${0}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-icon-bar').show();\n // $('#'+layer.viz.timeLapseID+'-time-lapse-layer-range-container').show();\n $('#'+layer.viz.timeLapseID+'-toggle-checkbox-label').show();\n \n \n timeLapseObj[layer.viz.timeLapseID].isReady = true;\n };\n }\n $('#' + visibleLabelID).show();\n \n if(layer.currentGEERunID === geeRunID){\n if(eeLayer === undefined){\n loadFailure();\n }\n else{\n //Set up GEE map service\n var MAPID = eeLayer.mapid;\n var TOKEN = eeLayer.token;\n layer.highWaterMark = 0;\n var tileIncremented = false;\n var eeTileSource = new ee.layers.EarthEngineTileSource(eeLayer);\n // console.log(eeTileSource)\n layer.layer = new ee.layers.ImageOverlay(eeTileSource)\n var overlay = layer.layer;\n //Set up callback to keep track of tile downloading\n layer.layer.addTileCallback(function(event){\n\n event.count = event.loadingTileCount;\n if(event.count > layer.highWaterMark){\n layer.highWaterMark = event.count;\n }\n\n layer.percent = 100-((event.count / layer.highWaterMark) * 100);\n if(event.count ===0 && layer.highWaterMark !== 0){layer.highWaterMark = 0}\n\n if(layer.percent !== 100){\n layer.loading = true;\n $('#' + spinnerID+'2').show();\n if(!tileIncremented){\n incrementGEETileLayersLoading();\n tileIncremented = true;\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.push(id);\n\n }\n }\n }else{\n layer.loading = false;\n $('#' + spinnerID+'2').hide();\n decrementGEETileLayersLoading();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n \n }\n tileIncremented = false;\n }\n //Handle the setup of layers within a time lapse\n if(layer.viz.isTimeLapse){\n var loadingTimelapseLayers = Object.values(layerObj).filter(function(v){return v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList});\n var loadingTimelapseLayersYears = loadingTimelapseLayers.map(function(f){return [f.viz.year,f.percent].join(':')}).join(', ');\n var notLoadingTimelapseLayers = Object.values(layerObj).filter(function(v){return !v.loading && v.viz.isTimeLapse && v.whichLayerList === layer.whichLayerList});\n var notLoadingTimelapseLayersYears = notLoadingTimelapseLayers.map(function(f){return [f.viz.year,f.percent].join(':')}).join(', ');\n $('#'+layer.viz.timeLapseID + '-message-div').html('Loading:<br>'+loadingTimelapseLayersYears+'<hr>Not Loading:<br>'+notLoadingTimelapseLayersYears);\n var propTiles = parseInt((1-(timeLapseObj[layer.viz.timeLapseID].loadingTilesLayerIDs.length/timeLapseObj[layer.viz.timeLapseID].nFrames))*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', propTiles+'%').attr('aria-valuenow', propTiles).html(propTiles+'% tiles loaded');\n $('#'+layer.viz.timeLapseID+ '-loading-gear').show();\n \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(90deg, #FFF, #FFF ${propTiles}%, transparent ${propTiles}%, transparent 100%)`)\n if(propTiles < 100){\n // console.log(propTiles)\n // if(timeLapseObj[layer.viz.timeLapseID] === 'play'){\n // pauseButtonFunction(); \n // }\n }else{\n $('#'+layer.viz.timeLapseID+ '-loading-gear').hide();\n }\n }\n\n // var loadingLayers = Object.values(layerObj).filter(function(v){return v.loading});\n // console.log(loadingLayers);\n updateProgress();\n // console.log(event.count);\n // console.log(inst.highWaterMark);\n // console.log(event.count / inst.highWaterMark);\n // console.log(layer.percent)\n });\n if(layer.visible){\n layer.map.overlayMapTypes.setAt(layer.layerId, layer.layer);\n $('#'+layer.legendDivID).show();\n layer.rangeOpacity = layer.opacity; \n \n layer.layer.setOpacity(layer.opacity); \n }else{\n $('#'+layer.legendDivID).hide();\n layer.rangeOpacity = 0;\n \n }\n setRangeSliderThumbOpacity(); \n }\n \n }\n }", "function cargarTecnico() {\n\n _geometryService = new GeometryService(URL_Servicio_GeometryService);\n _geometryService.on(\"areas-and-lengths-complete\", outputAreaAndLength);\n\n $(document).on(\"click\",\"#selectProductor .dropdown-menu li a\",function () {\n \n asignarProductor($(this).data(\"productor\"));\n\n });\n\n $(document).on(\"click\", \"#selectLeyenda .dropdown-menu li a\", function () {\n\n asignarLeyenda($(this).html());\n //asignarProductor($(this).data(\"productor\"));\n\n });\n\n\n /*CREO FEATURE LAYER PARA EDITAR*/\n _dicFeaturesLayers[\"AMBIENTE\"] = new FeatureLayer(URL_Servicio_FeatureServiceAmbiente, {\n mode: FeatureLayer.MODE_ONDEMAND,\n //infoTemplate: new InfoTemplate(function () { return getLayerName(\"AMBIENTE\") }, cargarAmbienteInfoTemplate),\n outFields: [\"*\"]\n });\n\n _dicFeaturesLayers[\"PRESCRIPCION\"]=new FeatureLayer(URL_Servicio_FeatureServicePrescripcion, {\n mode: FeatureLayer.MODE_ONDEMAND,\n //infoTemplate: new InfoTemplate(function () { return getLayerName(\"PRESCRIPCION\") }, cargarPrescripcionInfoTemplate),\n outFields: [\"*\"]\n })\n /*CREO FEATURE LAYER PARA EDITAR*/\n\n /*GRAFIC LAYER*/\n _editionLayer = new GraphicsLayer();\n _editionLayer.on(\"click\", function (evt) {\n\n if (_panActivated) {\n var index = _editionLayer.graphics.indexOf(evt.graphic);\n setCurrent(index);\n activateToolbar(evt.graphic);\n evt.stopPropagation();\n }\n\n });\n /*GRAFIC LAYER*/\n\n\n\n /*CARGO LAS CAPAS AMBIENTE Y PRESCRIPCION COMO ArcGISDynamicMapServiceLayer*/\n \n _dicMapServerLayers[\"AMBIENTE\"]=new ArcGISDynamicMapServiceLayer(URL_Map_ServerAmbiente, { \"imageParameters\": _imageParameters, \"infoTemplates\": _infoTemplatesAmbiente });\n _dicMapServerLayers[\"PRESCRIPCION\"]=new ArcGISDynamicMapServiceLayer(URL_Map_ServerPrescripcion, { \"imageParameters\": _imageParameters, \"infoTemplates\": _infoTemplatesPrescripcion });\n\n //SETEO FILTRO\n inicializarFiltros();//inicializa la ventana para filtrar\n\n var layerDefinitions = [];\n layerDefinitions[0] = \"nomtecnico='\" + _userName + \"'\";\n\n filtrarCapa(_dicMapServerLayers[\"AMBIENTE\"], layerDefinitions)\n filtrarCapa(_dicMapServerLayers[\"PRESCRIPCION\"], layerDefinitions)\n\n //CREO LEGEND\n addLayersToToc(false);\n\n //CREO PARA QUE ELIJA LAS CAPAS AL MOMENTO DE EDITAR\n $(\"#modalSelectLayerToEdit\").append('<input type=\"button\" class=\"editionButton btn-danger\" data-capa=\"AMBIENTE\" value=\"' + getLayerName(\"AMBIENTE\") + '\" />')//LAS DISPONIBILIZO PARA ELEGIR CUANDO SE VA A EDITAR\n $(\"#modalSelectLayerToEdit\").append('<input type=\"button\" class=\"editionButton btn-danger\" data-capa=\"PRESCRIPCION\" value=\"' + getLayerName(\"PRESCRIPCION\") + '\" />')//LAS DISPONIBILIZO PARA ELEGIR CUANDO SE VA A EDITAR\n \n\n _map.addLayer(_dicMapServerLayers[\"AMBIENTE\"]);\n _map.addLayer(_dicMapServerLayers[\"PRESCRIPCION\"]);\n /*CARGO LAS CAPAS PRODUCTOR AMBIENTE Y PRESCRIPCION COMO ArcGISDynamicMapServiceLayer*/\n\n if (_editionLayer)\n _map.addLayer(_editionLayer);\n\n}", "function addGeoJsonToMap(v){\n\t\t\t$('#' + spinnerID).hide();\n\t\t\t$('#' + visibleLabelID).show();\n\n\t\t\tif(layer.currentGEERunID === geeRunID){\n if(v === undefined){loadFailure()}\n\t\t\t\tlayer.layer = new google.maps.Data();\n // layer.viz.icon = {\n // path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n // scale: 5,\n // strokeWeight:2,\n // strokeColor:\"#B40404\"\n // }\n\t\t layer.layer.setStyle(layer.viz);\n\t\t \n\t\t \tlayer.layer.addGeoJson(v);\n if(layer.viz.clickQuery){\n map.addListener('click',function(){\n infowindow.setMap(null);\n })\n layer.layer.addListener('click', function(event) {\n console.log(event);\n infowindow.setPosition(event.latLng);\n var infoContent = `<table class=\"table table-hover bg-white\">\n <tbody>`\n var info = event.feature.h;\n Object.keys(info).map(function(name){\n var value = info[name];\n infoContent +=`<tr><th>${name}</th><td>${value}</td></tr>`;\n });\n infoContent +=`</tbody></table>`;\n infowindow.setContent(infoContent);\n infowindow.open(map);\n }) \n }\n\t\t \tfeatureObj[layer.name] = layer.layer\n\t\t \t// console.log(this.viz);\n\t\t \n\t\t \tif(layer.visible){\n\t\t \tlayer.layer.setMap(layer.map);\n\t\t \tlayer.rangeOpacity = layer.viz.strokeOpacity;\n\t\t \tlayer.percent = 100;\n\t\t \tupdateProgress();\n\t\t \t$('#'+layer.legendDivID).show();\n\t\t \t}else{\n\t\t \tlayer.rangeOpacity = 0;\n\t\t \tlayer.percent = 0;\n\t\t \t$('#'+layer.legendDivID).hide();\n\t\t \t\t}\n\t\t \tsetRangeSliderThumbOpacity();\n\t\t \t}\n \t\t}", "function init() {\n\n\t//Kartassa käytettävät muuttujat\n\tvar map, view, overviewMapControl, wfs_layer; //lipas\n\n\t//Paikannuksessa kaytettavat muuttujat\n\tvar geolocation, accuracyFeature, accuracyBuffer, coordinates;\n\t\n\t//Kohteen valitsemisen muuttujat\n\tvar selectInteraction, selectedFeatures\n\n\t//pgRouting kaytettavat muuttujat\n\tvar transform, params, extent, r_padding, coord;\n\tvar startPoint, destPoint, vectorlayer;\n\n\t//Nappi-muuttujat\n\tvar trackButton = document.getElementById('track');\n\tvar new_start_pointButton = document.getElementById('new_start');\n\tvar navigateButton = document.getElementById('navigate');\n\tvar clearButton = document.getElementById('clear'); \n\n\t//innerHTML containerit\n\tvar tarkkuus_info = document.getElementById('tarkkuus');\n\tvar feature_info = document.getElementById('information');\n\tvar error_info = document.getElementById('information');\n\n\n\t//Asettaa nakyman Helsingin keskustaan\n\tview = new ol.View({\n\t center: [2779257.6943, 8439166.6796],\n\t zoom: 12,\n\t minZoom: 11,\n\t maxZoom: 16\n\t});\n\n\t//Kustomoidaan pikkukartta\n\toverviewMapControl = new ol.control.OverviewMap({\n \t// see in overviewmap-custom.html to see the custom CSS used\n \t className: 'ol-overviewmap ol-custom-overviewmap',\n \t layers: [\n \t new ol.layer.Tile({\n \t source: new ol.source.OSM({\n \t'url': 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'\n \t })\n \t })\n \t ],\n \t collapseLabel: '\\u00BB',\n \t label: '\\u00AB',\n \t collapsed: false\n\t});\n\n\n\tmap = new ol.Map({\n\t renderer: \"canvas\",\n\t controls: ol.control.defaults({\n\t attribution: false\n\t }).extend([\n\t overviewMapControl\n\t ]),\n\t interactions: ol.interaction.defaults().extend([\n\t new ol.interaction.DragRotateAndZoom()\n\t ]),\n\t layers: [\n\t new ol.layer.Tile({\n\t source: new ol.source.OSM()\n\t })],\n\t target: \"map\",\n\t view: view \n\t});\n\n\tmap.addControl(new ol.control.Zoom());\n\n\n\t//WFS-layerin muotoilu\n\twfs_layer = new ol.layer.Vector({\n \t source: vectorSource,\n \t style: new ol.style.Style({\n\t image: new ol.style.Circle({\n\t radius: 6,\n\t fill: new ol.style.Fill({color: 'rgba(57,155,221,1)'}),\n\t stroke: new ol.style.Stroke({color: 'rgba(31,119,180,1)', width: 2})\n \t })\n \t })\n\t});\n\n\tmap.addLayer(wfs_layer);\n\n\n\t//Aloitus- ja lopetuskohteet ja niiden muotoilut\n\tstartPoint = new ol.Feature();\n\tstartPoint.setStyle(new ol.style.Style({\n\t image: new ol.style.Circle({\n\t radius: 6,\n\t fill: new ol.style.Fill({\n\t color: '#FF0000'\n\t }),\n\t stroke: new ol.style.Stroke({\n\t color: '#000000',\n\t width: 2\n\t })\n\t })\n\t}));\n\n\tdestPoint = new ol.Feature();\n\tdestPoint.setStyle(new ol.style.Style({\n\t image: new ol.style.Circle({\n\t radius: 6,\n\t fill: new ol.style.Fill({\n\t color: '#FF0000'\n\t }),\n\t stroke: new ol.style.Stroke({\n\t color: '#000000',\n\t width: 2\n\t })\n\t })\n\t}));\n\n\t//Vektorilayeri aloitus- ja lopetuskohteille\n\tvectorLayer = new ol.layer.Vector({\n \t source: new ol.source.Vector({\n \t \tfeatures: [startPoint, destPoint]\n \t })\n\t});\n\n\tmap.addLayer(vectorLayer);\n\n\n\t//Geolocation, asettaa samalla reitinhaun aloitussijainnin\n\tgeolocation = new ol.Geolocation({\n\t trackingOptions: {\n\t enableHighAccuracy: true\n\t },\n \t projection: view.getProjection(),\n\t tracking: true\n\t});\t\n\n\t//Asettaa tarkkuusalueen\n\taccuracyFeature = new ol.Feature();\n\taccuracyBuffer = new ol.layer.Vector({\n\t map: map,\n\t source: new ol.source.Vector({\n\t features: [accuracyFeature]\n\t })\n\t});\n\n\tmap.addLayer(accuracyBuffer); \n\t\n\n\t//Tata funktiota kutsutaan aina, kun kayttaja painaa paikanna nappia\n\ttrackButton.addEventListener('click',function(event) {\n \n\t //Hakee kayttajan sijainnin ja asettaa siihen aloituspisteen\n\t coordinates = geolocation.getPosition();\n\t startPoint.setGeometry(new ol.geom.Point(coordinates));\n\t\n\t //Muuttaa oletuszoomin- ja paikan\n\t view.setZoom(14);\n\t view.setCenter(coordinates);\n\n\t //Tarkkuusbufferi asetetaan kartalle\n \t accuracyFeature.setGeometry(geolocation.getAccuracyGeometry());\n\n\t //Tarkkuuden ilmoittaminen\n\t tarkkuus_info.innerHTML = '';\n\t tarkkuus_info.innerHTML = 'GIS Software Development Course / Paikannustarkkuus: ' + Math.round(geolocation.getAccuracy()) + 'm';\n \t});\t\n\n\t\n\t//Handle geolocation error \n\tgeolocation.on('error', function(error) {\n \t error_info.innerHTML = error.message;\n \t error_info.style.display = '';\n\t});\n\t\n\n\t// valittujen kohteiden muotoilu\n\tselectedstyle = new ol.style.Style({\n\t image: new ol.style.Circle({\n\t radius: 8,\n\t fill: new ol.style.Fill({\n\t color: 'rgba(57,155,221,1)'\n\t }),\n\t stroke: new ol.style.Stroke({\n\t color: '#000000',\n\t width: 2\n\t })\n\t })\n\t}); \n\n\t//Mahdollistaa layerin kohteiden valitsemisen\n\tselectInteraction = new ol.interaction.Select({\n layers: function(layer) {\n return layer.get('selectable') == true;\n },\n style: [selectedstyle]\n \t});\n\n\tmap.getInteractions().extend([selectInteraction]);\n\twfs_layer.set('selectable',true); \n\t\n\n\t//Vain valittujen kohteiden funktio koordinaattien ja tietojen saamiseen\n\tselectedFeatures = selectInteraction.getFeatures();\t\n\tselectedFeatures.on('add', function(event) {\n\t\n\t //Klikatusta kohteesta muodostetaan muuttuja\n\t feature = event.target.item(0)\t\n\n\t //Otetaan muuttujaksi kohteen koordinaatit\n\t geometry = feature.getGeometry();\n\t coord = geometry.getCoordinates();\t \n\n\t //Muuttaa urlin alun, jos se alkaa www., koska muuten linkit eivat toimi\n\t url = feature.get('www');\n\n\t if (url != null) {\n\t if (url.charAt(0) == 'w') {\n\t new_url = 'http://' + url\n\t }\n\t else { \n\t new_url = url\n\t }\n\t }\n\t else {\n\t new_url = ''\n\t }\n\n\t url_name = new_url\n\n\t if (url_name.length > 35) {\n\t url_name = url_name.substring(0, 35);\n\t url_name = url_name + \"...\"\n\t }\n\n\t feature_info.innerHTML = '';\n\t feature_info.innerHTML += feature.get('tyyppi_nimi_fi') + ': ' + feature.get('nimi_fi') + '<br>' + '<a href=\"' + new_url + '\" ' + 'target=\"_blank\">' + url_name + '</a>' + '<br><br>';\n\n\t});\n\n\t//Palauttaa kohteiden tiedon defaultiksi, kun kayttaja klikkaa muutakuin kohdetta\n\tmap.on('click', function() {\n\t selectedFeatures.clear();\n\t feature_info.innerHTML = 'Klikkaa liikuntakohdetta nähdäksesi sen tiedot';\n\t});\n\t\n\n\n\t//Lisaa aloitussijainti, jos omaa sijaintia ei voida kayttaa\n\tnew_start_pointButton.addEventListener('click', function(event) {\n\n\t //Otetaan paikannustarkkuus luku pois \n\t tarkkuus_info.innerHTML = 'GIS Software Development Course';\n\n\t //Poista aloituspiste ja tarkkuusbufferi\n\t startPoint.setGeometry(null);\n\t accuracyFeature.setGeometry(null);\n\n\t //Aseta uusi aloituspiste kayttajan maaraamana\n\t map.once('click', function(event) {\n\t startPoint.setGeometry(new ol.geom.Point(event.coordinate));\n\t });\n\t});\n\n\n\n\t//pgRoutingin parametrit\n\tparams = {\n \t LAYERS: 'pgrouting:pgrouting',\n \t FORMAT: 'image/png'\n\t};\n\n\t//Transform coordinates from EPSG:3857 to EPSG:4326.\n\ttransform = ol.proj.getTransform('EPSG:3857', 'EPSG:4326');\n\n\n\n\t//Mahdollistaa reitin laskun silloin, kun kayttaja on paattanyt kohteen\t\n\tnavigateButton.addEventListener('click', function(event) {\n\n\t //Tarkistaa onko reitti jo olemassa ja poistaa sen \n\t if (typeof result !== 'undefined') {\t\n\t map.removeLayer(result);\n\t } \n\n\t //Pyytaa kayttajaa valitsemaan kohteen, jos se puuttuu\n\t if (typeof coord == 'undefined') {\n\t alert(\"Valitse kohde!\");\n\t }\n\n\t //Pyytaa kayttajalta aloitussijaintia, jos se puuttuu\n\t if (startPoint.getGeometry() == null) {\n\t alert(\"Aseta aloitussijainti ensin!\");\n\t destPoint.setGeometry(null);\n\t }\n\t \n\t //Asettaa loppupisteen vain featureen\n \t else { \n \t destPoint.setGeometry(new ol.geom.Point(coord));\n\n\t // Transform from EPSG:3857 to EPSG:4326\n \t var startCoord = transform(startPoint.getGeometry().getCoordinates());\n \t var destCoord = transform(destPoint.getGeometry().getCoordinates());\n \t var viewparams = [\n \t 'x1:' + startCoord[0], 'y1:' + startCoord[1],\n \t 'x2:' + destCoord[0], 'y2:' + destCoord[1]\n \t ];\n \n\t //Lahettaa parametrit palvelimelle, joka laskee reitin \n \t params.viewparams = viewparams.join(';');\n \t result = new ol.layer.Image({\n \t source: new ol.source.ImageWMS({\n url: 'http://130.233.249.20:8080/geoserver/pgrouting/wms',\n params: params\n \t })\n \t });\n\n\t map.addLayer(result);\n\n\t //Muuttaa nakyman reitin mukaisesti\n\t start = startPoint.getGeometry().getCoordinates();\n\t end = destPoint.getGeometry().getCoordinates();\n\t new_x = ((start[0] + end[0]) / 2)\n\t new_y = ((start[1] + end[1]) / 2)\n\t view.setCenter([new_x, new_y]);\n\t \n\t //Zoomaa nakyman aloituspaikan ja kohteen mukaan\n\t if (start[0] < end[0]) { \n\t\tminx = start[0] \n\t\tmaxx = end[0]}\n\t else {\n\t\tminx = end[0]\n\t\tmaxx = start[0]}\n\t\n \t if (start[1] < end[1]) {\n\t\tminy = start[1]\n\t\tmaxy = end[1]}\n\t else {\n\t\tminy = end[1]\n\t\tmaxy = start[1]}\n\n\t r_padding = [50, 325, 150, 50];\n\t extent = [minx, miny, maxx, maxy];\n\t map.getView().fit(extent, map.getSize(), {\n\t\tpadding: r_padding,\n\t\tconstrainResolution: false\n\t\t});\n\t \n\t }\n\t});\n\n\t//Poistaa kartalle lisatyn reitin\n \tclearButton.addEventListener('click', function(event) {\n \t destPoint.setGeometry(null);\n \t map.removeLayer(result);\n\t});\n\n}", "function updateServiceMap() {\n var serviceMapName = SUConsts[getServicesKey()].serviceMap.name;\n var lastUpdateData = localStorage.getItem(lastUpdateDataPrefix + serviceMapName);\n\n if (lastUpdateData && typeof lastUpdateData === 'string' && lastUpdateData.length > 0) {\n setServiceData(serviceMapName, lastUpdateData);\n }\n }", "function cargarCapas() {\r\n var stylePuntosParadas = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 9,\r\n idBD : \"${idBD}\",\r\n idOrd : \"${idOrd}\",\r\n label : \"${idOrd}\",\r\n lat : \"${lat}\",\r\n lon : \"${lon}\",\r\n dir : \" ${dir}\",\r\n ref : \"${ref}\",\r\n img : \"${img}\",\r\n fontColor : \"white\",\r\n fillColor : \"#1C5E06\", //verde\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n var stylePuntosEstudiante = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 6,\r\n ci : \"${ci}\",\r\n lat : \"${lat}\",\r\n lon : \"${lon}\",\r\n dir : \"${dir}\",\r\n fontColor : \"white\",\r\n fillColor : \"#DF3A01\", //naranja\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n var stylePuntosRutas = new OpenLayers.StyleMap( {\r\n fillOpacity : 0.7,\r\n pointRadius : 9,\r\n label : \"${id}\",\r\n fontColor : \"white\",\r\n fillColor : \"#003DF5\", //black\r\n strokeColor : \"#FFFFFF\",\r\n strokeOpacity : 0.7,\r\n fontSize : \"12px\",\r\n fontFamily : \"Courier New, monospace\",\r\n fontWeight : \"bold\"\r\n });\r\n\r\n lienzoParadas = new OpenLayers.Layer.Vector('Points', {\r\n styleMap: stylePuntosParadas\r\n });\r\n\r\n map.addLayer(lienzoParadas);\r\n\r\n lienzoRutas = new OpenLayers.Layer.Vector('Puntos Rutas', {\r\n styleMap: stylePuntosRutas\r\n });\r\n\r\n map.addLayer(lienzoRutas);\r\n \r\n lienzoEstudiantes = new OpenLayers.Layer.Vector('Puntos Estudiantes', {\r\n styleMap: stylePuntosEstudiante\r\n });\r\n\r\n map.addLayer(lienzoEstudiantes);\r\n\r\n //Comportamiento de los Elementos de la Capa\r\n selectFeatures = new OpenLayers.Control.SelectFeature(\r\n [ lienzoParadas ],\r\n {\r\n clickout : true,\r\n toggle : false,\r\n multiple : false,\r\n hover : false,\r\n onSelect : function(feature){\r\n selectParada( feature );\r\n },\r\n onUnselect : function(feature){\r\n unselectParada( feature );\r\n }\r\n }\r\n );\r\n\r\n map.addControl( selectFeatures );\r\n selectFeatures.activate();\r\n \r\n selectFeaturesEstudiante = new OpenLayers.Control.SelectFeature(\r\n [ lienzoEstudiantes ],\r\n {\r\n clickout : true,\r\n toggle : false,\r\n multiple : false,\r\n hover : false,\r\n onSelect : function(feature){\r\n infoEstudiantePopUp(feature);\r\n },\r\n onUnselect : function(feature){\r\n map.removePopup( feature.popup );\r\n feature.popup.destroy();\r\n feature.attributes.poppedup = false;\r\n feature.popup = null;\r\n }\r\n }\r\n );\r\n\r\n map.addControl( selectFeaturesEstudiante );\r\n \r\n /**\r\n * Inicializa el mapa para que permita graficar los recorridos de los buses\r\n */\r\n capaRecorridos();\r\n permitirArrastrarPuntosRutas();\r\n}", "swapBasemap(toAdd) {\n this.currentSources = []\n this.currentLayers = []\n\n // First record which layers are currently on the map\n Object.keys(mapStyle.sources).forEach(source => {\n let isPresent = this.map.getSource(source)\n if (isPresent) {\n this.currentSources.push({\n id: source,\n config: mapStyle.sources[source],\n data: isPresent._data || null\n })\n }\n })\n\n mapStyle.layers.forEach(layer => {\n let isPresent = this.map.getLayer(layer.id)\n if (isPresent) {\n this.currentLayers.push({\n layer: layer,\n filters: this.map.getFilter(layer.id)\n })\n }\n })\n\n // Set the style. `style.load` will be fired after to readd other layers\n this.map.setStyle(toAdd)\n }", "revealActiveLayer(activeLayer) {\r\n // console.log('method: revealActiveLayer');\r\n\r\n this.setActiveLayer(activeLayer);\r\n\r\n // Hide unclicked layers\r\n this.customLayers.forEach((layer) => {\r\n if (layer !== activeLayer) {\r\n this.map.setLayoutProperty(layer, 'visibility', 'none')\r\n }\r\n })\r\n\r\n // Double check visibility of layer\r\n let visibility = this.map.getLayoutProperty(activeLayer, 'visibility');\r\n\r\n // Reveal layer if it isn't visible\r\n if (visibility !== 'visible') {\r\n this.map.setLayoutProperty(activeLayer, 'visibility', 'visible');\r\n }\r\n }", "addLayer(details){\n //if the layer already exists then delete it\n if (this.map.getLayer(details.id)){\n this.map.removeLayer(details.id);\n } \n this.map.addLayer({\n 'id': details.id,\n 'type': details.type,\n 'source': details.sourceId,\n 'source-layer': details.sourceLayer,\n 'paint': details.paint\n }, (details.beforeId) ? details.beforeId : undefined);\n //set a filter if one is passed\n if (details.hasOwnProperty('filter')) this.map.setFilter(details.id, details.filter);\n if (this.props.view === 'country'){\n //set the visibility of the layer depending on the visible property of the status \n let status = this.props.statuses.filter(status => {\n return (status.layers.indexOf(details.id) !== -1);\n })[0];\n if (status) this.map.setLayoutProperty(details.id, \"visibility\", (status.visible) ? \"visible\" : \"none\" );\n }\n }", "function capaRecorridos(){\r\n /**\r\n * Inicializar la capa para los recorridos\r\n */\r\n lienzoRecorridos = new OpenLayers.Layer.Vector(\"Recorridos\");\r\n markerInicioFin = new OpenLayers.Layer.Markers( \"Inicio-Fin\" );\r\n map.addLayer(lienzoRecorridos);\r\n map.addLayer(markerInicioFin);\r\n}", "function setPROCLayer(map, PROCLayer, analysis_params) {\n PROCLayer.setMap(null);\n PROCLayer = new google.maps.Data({map:map});\n if ((analysis_params.vizSelection == 'thermal_h') || (analysis_params.vizSelection == 'thermal_c')){\n right_top_lat = map.getBounds().getNorthEast().lat();\n right_top_lon = map.getBounds().getNorthEast().lng();\n left_bottom_lat = map.getBounds().getSouthWest().lat();\n left_bottom_lon = map.getBounds().getSouthWest().lng();\n right_bottom_lat = right_top_lat\n right_bottom_lon = left_bottom_lon\n\n $.getJSON(\"/PROC\", {\n left_bottom_lon: left_bottom_lon,\n left_bottom_lat: left_bottom_lat,\n right_top_lon: right_top_lon,\n right_top_lat: right_top_lat,\n }, function(data) {\n setBaseMapPROCStyle(PROCLayer, map.zoom)\n PROCLayer.addGeoJson(data['PROC']);\n PROCLayer.addGeoJson(data['DES_CBG']);\n\n // Create an infowindow that would pop up when hovering over the PROC layer that would display\n // the number of points in cluster.\n var infowindow = new google.maps.InfoWindow();\n PROCLayer.addListener('click', function(event) {\n if (event.feature.getProperty('Type') == 'PROC'){\n avg_ph = Math.round((event.feature.getProperty(\"AVG_PH\")/1000)).toLocaleString();\n avg_pc = Math.round((event.feature.getProperty(\"AVG_PC\")/1000)).toLocaleString();\n\n if (event.feature.getProperty(\"number_of_points\") == '1'){\n var html = \"Process heating = \" + avg_ph + \" GW</br> \" +\n \"Process cooling = \" + avg_pc + \" GW</br> \";\n }\n else{ \n num_process = event.feature.getProperty(\"number_of_points\");\n var html = \"Number of processors: \" + num_process + \"</br> \" +\n \"Process heating = \" + avg_ph + \" MWh/y</br> \" +\n \"Process cooling = \" + avg_pc + \" MWh/y</br> \";\n }\n }\n if (event.feature.getProperty('Type') == 'DES_CBG_pts'){\n steam = Math.round(event.feature.getProperty(\"CapSt\")*10)/10;\n hot_w = Math.round(event.feature.getProperty(\"CapHW\")*10)/10;\n chilled_w = Math.round(event.feature.getProperty(\"CapCW\")*10)/10;\n var html = \"Steam Capacity: \" + steam + \" MW </br>\" +\n \"Hot Water Capacity: \" + hot_w + \" MW </br>\"+\n \"Chilled Water Capacity: \" + chilled_w + \" MW\";\n }\n\n infowindow.setContent(html);\n infowindow.setPosition(event.latLng);\n infowindow.setOptions({disableAutoPan: true});\n infowindow.open(map);\n });\n });\n }\n else {\n PROCLayer.setMap(null);\n PROCLayer = new google.maps.Data({map:map});\n }\n return PROCLayer\n}", "function updateLayer(){\n // Get dem name from selector\n var dem_name = c.selectDEM.selector.getValue();\n // Filter ImageCollection to current dem\n var dem = m.dem_col.filterMetadata('DEM_Type', 'equals', dem_name).first();\n // Get value from layer selector\n var layer_option = c.selectLayer.selector.getValue();\n // Get date from date selector\n var current_date = ee.Date(c.selectDate.aDate.getValue());\n // Execute solar functions\n var solar_postion = Imported.solar_fun(current_date);\n var solar_surface = Imported2.solar_surface_fun(current_date, null, dem);\n // Extract relevant variables\n var time_zone = solar_postion.select('time_zone');\n var ele = solar_postion.select('ele');\n var zenith = solar_postion.select('zenith');\n var azimuth = solar_postion.select('azimuth');\n var surface_ele = solar_surface.select('surface_ele');\n var surface_zenith = solar_surface.select('surface_zenith');\n var surface_azimuth = solar_surface.select('surface_azimuth');\n // Execute terrain functions\n var hill = ee.Terrain.hillshade(dem);\n var slo = ee.Terrain.slope(dem);\n var asp = ee.Terrain.aspect(dem);\n // Add layer to map\n if (layer_option == 'Time Zone'){\n // Define visualization\n var layer3 = ui.Map.Layer({\n eeObject: time_zone,\n visParams: {min: -12, max: 12},\n name: 'Time Zone'\n });\n // Add layer to map\n c.map.layers().set(1, layer3); // Define nth layer\n } else if (layer_option == 'Solar Elevation') {\n // Define visualization\n var layer4 = ui.Map.Layer({\n eeObject: ele,\n visParams: {min: 0, max: 90},\n name: 'Solar Elevation'\n });\n // Add layer to map\n c.map.layers().set(1, layer4); // Define nth layer\n } else if (layer_option == 'Solar Zenith') {\n // Define visualization\n var layer5 = ui.Map.Layer({\n eeObject: zenith,\n visParams: {min: 0, max: 90},\n name: 'Solar Zenith'\n });\n // Add layer to map\n c.map.layers().set(1, layer5); // Define nth layer\n } else if (layer_option == 'Solar Azimuth') {\n // Define visualization\n var layer6 = ui.Map.Layer({\n eeObject: azimuth,\n visParams: {min: 90, max: 270},\n name: 'Solar Azimuth'\n });\n // Add layer to map\n c.map.layers().set(1, layer6); // Define nth layer\n } else if (layer_option == 'Solar-Surface Elevation') {\n // Define visualization\n var layer7 = ui.Map.Layer({\n eeObject: surface_ele,\n visParams: {min: 0, max: 90},\n name: 'Solar-Surface Elevation'\n });\n // Add layer to map\n c.map.layers().set(1, layer7); // Define nth layer\n } else if (layer_option == 'Solar-Surface Zenith') {\n // Define visualization\n var layer8 = ui.Map.Layer({\n eeObject: surface_zenith,\n visParams: {min: 0, max: 90},\n name: 'Solar-Surface Zenith'\n });\n // Add layer to map\n c.map.layers().set(1, layer8); // Define nth layer\n } else if (layer_option == 'Solar-Surface Azimuth') {\n // Define visualization\n var layer9 = ui.Map.Layer({\n eeObject: surface_azimuth,\n visParams: {min: 0, max: 360},\n name: 'Solar-Surface Azimuth'\n });\n // Add layer to map\n c.map.layers().set(1, layer9); // Define nth layer\n } else if (layer_option == 'Slope') {\n // Define visualization\n var layer10 = ui.Map.Layer({\n eeObject: slo,\n visParams: {min: 0, max: 90},\n name: 'Slope'\n });\n // Add layer to map\n c.map.layers().set(1, layer10); // Define nth layer\n } else if (layer_option == 'Aspect') {\n // Define visualization\n var layer11 = ui.Map.Layer({\n eeObject: asp,\n visParams: {palette: ['green', 'yellow', 'yellow', 'orange', 'orange', 'blue', 'blue', 'green'], min: 0, max: 360},\n name: 'Aspect'\n });\n // Add layer to map\n c.map.layers().set(1, layer11); // Define nth layer\n } else {\n // Define visualization\n var layer12 = ui.Map.Layer({\n eeObject: hill,\n visParams: {min: 0, max: 255},\n opacity: 0.3,\n name: 'Hillshade'\n });\n // Add layer to map\n c.map.layers().set(1, layer12); // Define nth layer\n }\n}", "function mapLayerChanged(e) {\n\t // console.log(e.type + \" \" + e.layer.name + \" \" + e.property);\n\t if (vectors) vectors.removeAllFeatures();\n\t if (e.layer && document.getElementById('overlayRadio' + e.layer.name))\n\t document.getElementById('overlayRadio' + e.layer.name).checked = true;\n\t setResults();\n\t }", "function init() {\n map = new OpenLayers.Map(\"map-id\");\n\n // définition du fond de carte\n const wmsLayer = new OpenLayers.Layer.WMS(\"OpenLayers WMS\",\n \"http://vmap0.tiles.osgeo.org/wms/vmap0?\", {layers: 'basic'});\n\n // définition de la couche vecteur data\n let data = new OpenLayers.Layer.Vector(\"Data\", {\n styleMap: new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n pointRadius: 6,\n fillColor: \"green\",\n strokeColor: '#000000',\n strokeWidth: 1\n })\n }),\n protocol: new OpenLayers.Protocol.HTTP({\n url: \"data.json\",\n format: new OpenLayers.Format.GeoJSON()\n }),\n strategies: [new OpenLayers.Strategy.Fixed()],\n isBasiclayer: false,\n displayInLayerSwitcher: true,\n });\n\n // ne marche plus mais permet en théorie de modifier les features dessinées\n let modifyControl = new OpenLayers.Control.ModifyFeature(data);\n modifyControl.mode |= OpenLayers.Control.ModifyFeature.RESIZE;\n map.addControl(modifyControl);\n modifyControl.activate();\n\n\n data.setOpacity(0.4);\n\n //Ajout de la pop up pour la couche 'data'\n let popup;\n\n //définition de la fonction de création de la pop-up\n function createPopup(feature) {\n // close existing popup\n if (popup) {\n popup.destroy();\n }\n popup = new GeoExt.Popup({\n title: feature.attributes.name,\n location: feature,\n width: 200,\n height: 130,\n html: \"<br/> Nome du site : \" + feature.attributes.name + \"<br/> <br/> Informations : \" + feature.attributes.infos + \"<br/>\",\n maximizable: true,\n collapsible: true,\n padding: '5 5 5 5'\n //items:items[0]\n });\n popup.show();\n }\n\n // relier la création de la pop up à l'evenement sur la couche data\n data.events.on({\n featureselected: function (e) {\n createPopup(e.feature);\n }\n });\n\n // Ajout des couches data et wmsLayer\n map.addLayers([wmsLayer, data]);\n\n // Fonction pour centrer la carte et définir un niveau de zoom. Ici 3.\n map.setCenter(new OpenLayers.LonLat(0, 0), 3);\n\n\n // définition de l'ensembles des contrôles que l'on souhaite permettre\n controls = {\n layerS : new OpenLayers.Control.LayerSwitcher(),\n mousePosi : new OpenLayers.Control.MousePosition(),\n scale : new OpenLayers.Control.Scale(),\n overView : new OpenLayers.Control.OverviewMap(),\n panZoom : new OpenLayers.Control.PanZoomBar(),\n point: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Point),\n line: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Path),\n polygon: new OpenLayers.Control.DrawFeature(data,\n OpenLayers.Handler.Polygon)\n };\n\n // association des controles à la carte\n for (let key in controls) {\n map.addControl(controls[key]);\n }\n\n // ajout du controle modifier les feature (not working)\n map.addControl(modifyControl);\n modifyControl.activate();\n\n // définition des actions qui seront incluses dans la toolbar de la carte\n // action pour permettre l'exploration de la couche carte\n const navAction = new GeoExt.Action({\n text: \"Explorer\",\n map: map,\n control: new OpenLayers.Control.Navigation(),\n toggleGroup: \"editing\",\n group: \"draw\",\n tooltip: \"Naviguer dans la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des points\n const drawPointAction = new GeoExt.Action({\n text: \"Points\",\n control: controls[\"point\"],\n map: map,\n toggleGroup: \"editing\",\n allowDepress: false,\n group: \"draw\",\n tooltip: \"Ajouter un point sur la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des lignes\n const drawLineAction = new GeoExt.Action({\n text: \"Lignes\",\n control: controls[\"line\"],\n map: map,\n toggleGroup: \"editing\",\n allowDepress: false,\n group: \"draw\",\n tooltip: \"Dessiner une poly-ligne sur la carte\"\n });\n\n // Action qui permet de rajouter la possibilité de dessiner des polygones\n const drawPolygonAction = new GeoExt.Action({\n text: \"Polygones\",\n control: controls[\"polygon\"],\n map: map,\n toggleGroup: \"editing\",\n group: \"draw\",\n allowDepress: false,\n tooltip: \"Dessiner un polygone sur la carte\"\n });\n\n\n // Permet de définir le format de la date\n function formatDate(value) {\n return value ? value.dateFormat('d M Y') : '';\n }\n\n // raccourcis\n const fm = Ext.form;\n\n // the column model has information about grid columns\n // dataIndex maps the column to the specific data field in\n // the data store (created below)\n const cm = new Ext.grid.ColumnModel({\n // specify any defaults for each column\n defaults: {\n sortable: true // Attention les colonne ne sont pas triable par défaut\n },\n columns: [{\n id: 'name',\n header: 'Nom du site',\n dataIndex: 'name', // correspond au champs de propriétes dans data.json\n width: 180,\n editor: new fm.TextField({\n allowBlank: false\n })\n }, {\n id: 'elevation', // permet de l'identifier pour des actions ailleurs dans le script (voir plus bas)\n header: 'Altitude',\n dataIndex: 'elevation', // correspond au champs de propriétes dans data.json\n width: 90,\n editor: new fm.NumberField({\n allowBlank: false,\n allowNegative: true\n })\n },\n {\n header: 'Light',\n dataIndex: 'light', // correspond au champs de propriétes dans data.json\n width: 130,\n editor: new fm.ComboBox({\n typeAhead: true,\n triggerAction: 'all',\n // // transform the data already specified in html\n transform: 'light',\n lazyRender: true,\n listClass: 'x-combo-list-small'\n })\n },\n {\n header: 'Price',\n dataIndex: 'price', // correspond au champs de propriétes dans data.json\n width: 70,\n align: 'right',\n renderer: 'usMoney',\n editor: new fm.NumberField({\n allowBlank: true,\n allowNegative: false,\n maxValue: 100000\n })\n },\n {\n header: 'Date d\\'ajout',\n dataIndex: 'availDate', // correspond au champs de propriétes dans data.json\n width: 95,\n renderer: formatDate,\n editor: new fm.DateField({\n format: 'm/d/y',\n minValue: '01/01/06',\n disabledDays: [0, 6],\n disabledDaysText: 'Plants are not available on the weekends'\n })\n }\n , {\n xtype: 'checkcolumn',\n header: 'Sensible?',\n dataIndex: 'sensible', // correspond au champs de propriétes dans data.json\n width: 75\n\n },\n {\n id: 'infos',\n header: 'Informations',\n dataIndex: 'infos', // correspond au champs de propriétes dans data.json\n width: 950,\n editor: new fm.TextField({\n allowBlank: false\n })\n }\n ]\n });\n\n // Création du store qui contiendra les données propriéts ecrites dans le fichier data.json\n // ici le store est également liée au layer data (ce qui permet de liée les selection entre le store et la couche vecteur)\n store = new GeoExt.data.FeatureStore({\n layer: data,\n fields: [\n {name: 'name', type: 'string'},\n {name: 'elevation', type: 'float'},\n {name: 'light', type: 'string'},\n {name: 'price', type: 'float'},\n // dates can be automatically converted by specifying dateFormat\n {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},\n {name: 'sensible', type: 'boolean'},\n {name: 'infos', type: 'string'}\n ],\n proxy: new GeoExt.data.ProtocolProxy({\n protocol: new OpenLayers.Protocol.HTTP({\n url: \"data.json\",\n format: new OpenLayers.Format.GeoJSON()\n })\n })\n });\n\n // création du panel qui permeet d'afficher le store et de la rendre modifiable avec les attributs CM et SM\n const gridPanel = new Ext.grid.EditorGridPanel({\n title: \"Feature Grid\",\n renderTo: 'editor-grid',\n autoExpandColumn: 'infos',\n collapsible: true,\n collapseMode: \"mini\",\n store: store,\n cm: cm,\n width: 1915,\n height: 200,\n sm: new GeoExt.grid.FeatureSelectionModel({\n selectControl: modifyControl.selectControl,\n singleSelect: true\n })\n });\n\n // définition de composant qui encaspule le composant carte crée précédement\n const mapPanel = new GeoExt.MapPanel({\n renderTo: 'gxmap',\n height: '100%',\n width: '100%',\n // association de la map précédement créée\n map: map,\n title: 'Carte',\n center: [1.49, 46, 73],\n zoom: 6,\n // asoocition des actions dans la toolbar\n tbar:\n [navAction, { // <-- Add the action directly to a toolbar\n text: 'Edition',\n menu: new Ext.menu.Menu({\n items: [\n new Ext.menu.CheckItem(navAction),\n new Ext.menu.CheckItem(drawPointAction),\n new Ext.menu.CheckItem(drawLineAction),\n new Ext.menu.CheckItem(drawPolygonAction),]\n }) // <-- Add the action directly to a menu\n }]\n });\n\n const layerList = new GeoExt.tree.LayerContainer({\n text: 'Fonds de carte',\n layerStore: mapPanel.layers,\n height: '100%',\n width: '100%',\n leaf: false,\n expanded: true\n });\n\n const layerTree = new Ext.tree.TreePanel({\n title: 'Gestion des couches cartographiques',\n renderTo: 'layerTree',\n root: layerList,\n height: '100%',\n collapsible: true\n });\n}", "function turnOn(){\n ga('send', 'event', 'layer-on', layer.layerType,layer.name);\n if(!layer.viz.isTimeLapse){\n turnOffTimeLapseCheckboxes();\n }\n if(layer.layerType === 'dynamicMapService'){\n layer.layer.setMap(map);\n layer.visible = true;\n layer.percent = 100;\n layer.rangeOpacity = layer.opacity;\n setRangeSliderThumbOpacity();\n updateProgress();\n $('#'+layer.legendDivID).show();\n } else if(layer.layerType !== 'geeVector' && layer.layerType !== 'geoJSONVector'){\n layer.visible = true;\n layer.map.overlayMapTypes.setAt(layer.layerId,layer.layer);\n $('#'+layer.legendDivID).show();\n layer.rangeOpacity = layer.opacity;\n if(layer.isTileMapService){layer.percent = 100;updateProgress();}\n layer.layer.setOpacity(layer.opacity); \n if(layer.layerType !== 'tileMapService' && layer.layerType !== 'dynamicMapService' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n }else{\n\n layer.visible = true;\n layer.percent = 100;\n updateProgress();\n $('#'+layer.legendDivID).show();\n layer.layer.setMap(layer.map);\n layer.rangeOpacity = layer.opacity;\n if(layer.layerType === 'geeVector' && layer.canQuery){\n queryObj[queryID].visible = layer.visible;\n }\n }\n vizToggleCleanup();\n }", "updateOlliPositionsAoSimNoSmooth(positions) {\n for (let position of positions) {\n let coordinates = [position.coordinates[0], position.coordinates[1]];\n const data = {\n 'type': 'FeatureCollection',\n 'features': [{\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n }\n }]\n };\n let layerId = `olli-bus-${position.olliId}`;\n let layer = this.map.getSource(layerId);\n if (layer) {\n layer.setData(data);\n }\n else {\n this.map.addLayer({\n 'id': layerId,\n 'source': {\n 'type': 'geojson',\n 'data': data\n },\n 'type': 'symbol',\n 'paint': {\n 'text-color': '#046b99',\n 'text-halo-color': \"#fff\",\n 'text-halo-width': 4, \n 'text-halo-blur': 1\n },\n 'layout': {\n 'icon-image': 'olli',\n 'icon-size': 0.75,\n 'text-font': [\"Open Sans Semibold\",\"Open Sans Regular\",\"Arial Unicode MS Regular\"],\n 'text-field': 'line84', \n 'text-size': 12, \n 'text-offset': [0, 2]\n }\n });\n }\n }\n }", "updateCurrentLayersStyle () {\n const determineStyle = _.bind(this.determineStyle, this)\n const styleLayer = _.bind(this.styleLayer, this)\n\n if (this.currentLayer) {\n this.currentLayer.eachLayer((layer) => {\n styleLayer(layer, determineStyle(layer))\n })\n }\n }", "function appInit() {\n\n // add layers to map:\n\n // Reference\n serviceArea.addTo(map);\n muniLayer.addTo(map);\n \n // Trace Search, Source, and Results\n trwwTraceResult.addTo(map);\n //trwwTracePoints.addTo(map);\n trwwTraceSource.addTo(map);\n addressPoint.addTo(map);\n trwwTraceDestin.addTo(map);\n\n\n // set map view to the service area layer extents\n serviceArea.query().bounds(function(error, latlngbounds) {\n map.fitBounds(latlngbounds);\n });\n\n\n /** -------------------------------------------------------------------------\n * MAP CONTROLS\n */\n\n\n L.control.attribution({ prefix: \"Not for official use or planning\" })\n .addAttribution(\"<a href='#' onclick='jQuery(\\\"#attributionModal\\\").modal(\\\"show\\\"); return false;'>Credits</a>\")\n .addTo(map);\n // L.control.attribution()\n // .addAttribution(\"Not for official use or planning | Data from 3RWW\")\n // .addTo(map);\n\n L.control.zoom({ position: 'bottomleft' }).addTo(map);\n\n\n /** -------------------------------------------------------------------------\n * MISC. MAP AND DOM EVENT LISTENERS\n */\n\n /**\n * make sure layers stay in the correct order when new ones are added later on\n */\n map.on(\"layeradd\", function(e) {\n trwwTraceSource.bringToFront();\n addressPoint.bringToFront();\n });\n\n /** -------------------------------------------------------------------------\n * SEWER DATA QUERY\n */\n\n /**\n * From a point (as L.latlng) find the nearest sewer structure.\n * This is made to work with a the Sewer Atlas map service.\n */\n function findNearestStructure(latlng) {\n var searchDistance = 1320;\n console.log(\"seaching within\", searchDistance, \"feet\");\n var targetPoint = turfHelpers.point([latlng.lng, latlng.lat]);\n var buffered = buffer(targetPoint, searchDistance, { units: 'feet' });\n //ajax request function\n //trwwStructures\n atlas.rsi_featurelayer.layer.query().layer(4).fields([]).intersects(buffered)\n //.nearby(latlng, searchDistance) // only works with feature layers\n .run(function(error, featureCollection, response) {\n if (error) {\n console.log(error);\n messageControl.onError('<i class=\"fa fa-frown-o\"></i> There was an error when searching for the nearest structure (' + error.message + ')');\n } else {\n if (featureCollection.features.length > 0) {\n console.log(\"trwwStructures.query():\", response);\n //returns[searchDistance] = featureCollection;\n var nearest = nearestPoint(targetPoint, featureCollection);\n console.log(\"nearest:\", nearest);\n trwwTraceSource.addData(nearest);\n traceExecute(nearest);\n return nearest;\n } else {\n console.log(\"...nothing found within this distance.\");\n var content = '<div class=\"alert alert-danger\" role=\"alert\"><h4>It does not appear that ' + traceSummary.datum.name + ' is within the ALCOSAN service area</h4><p>(We could not find any ALCOSAN-connected sewer structures within 1/4 mile of ' + traceSummary.datum.lng + ', ' + traceSummary.datum.lat + ')</p><h4>Try another address.</h4></div>';\n addressPoint.setPopupContent(content);\n }\n }\n });\n }\n\n /** -------------------------------------------------------------------------\n * NETWORK TRACE functions\n */\n\n /**\n * clear the network trace layers from the map\n */\n function clearNetworkTrace() {\n // remove trace start point\n trwwTraceSource.clearLayers();\n // remove trace line\n trwwTraceResult.clearLayers();\n }\n\n /**\n * display message when trace is running\n */\n function traceRunning() {\n console.log(\"Trace initialized...\");\n messageControl.onTraceStart();\n }\n\n /**\n * display error when trace fails\n */\n function traceError(error) {\n var msg = \"Trace: \" + error.message + \"(code: \" + error.code + \")\";\n console.log(msg);\n messageControl.onError('<p><i class=\"fa fa-frown-o\"></i> There was an error with the trace:<br>' + msg + '<p>');\n }\n\n /**\n * do things when trace is complete\n */\n function traceSuccess() {\n messageControl.onTraceComplete();\n var msg = \"Trace Complete\";\n console.log(msg);\n }\n\n /**\n * takes the raw trace response and calculates some totals\n */\n function traceSummarize(featureCollection, summaryGeography) {\n console.log(\"summarizing trace...\");\n // generate totals\n $.each(featureCollection.features, function(k, v) {\n traceSummary.length += v.properties.Shape_Length * 3.28084;\n traceSummary.inchmiles += v.properties.INCHMILES;\n });\n\n // calculate flow time\n traceSummary.calcTime();\n\n // generate a list of summary geographies\n var exploded = explode(featureCollection);\n var tagged = tag(exploded, summaryGeography, 'LABEL', 'places');\n var places = geojson_set(tagged.features, 'places');\n\n traceSummary.places = [];\n $.each(places, function(i, v) {\n traceSummary.places.push({ \"name\": v });\n });\n // console.log(traceSummary);\n }\n\n /**\n * given an input feature (geojson point), trace downstream on the 3RWW Sewer\n * Atlas network dataset.\n */\n function traceExecute(inputFeature) {\n\n // display \"flushing\" message\n traceRunning();\n\n // create a Terraformer Primitive from input (passed to the GP tool)\n var source = new Terraformer.Point({\n type: \"Point\",\n coordinates: [\n inputFeature.geometry.coordinates[0],\n inputFeature.geometry.coordinates[1]\n ]\n });\n //console.log(source);\n\n /**\n * set up the geoprocessing task\n */\n //var traceTask = traceService.createTask();\n console.log(atlas);\n var traceTask = atlas.rsi_networktrace.service.createTask();\n\n\n /**\n * run the georpocessing task\n */\n traceTask.on('initialized', function() {\n // set input Flags parameter, and then add fields references.\n traceTask.setParam(\"Flag\", source);\n traceTask.params.Flag.features[0].attributes = {\n \"OBJECTID\": 1\n };\n traceTask.params.Flag.fields = [{\n \"name\": \"OBJECTID\",\n \"type\": \"esriFieldTypeOID\",\n \"alias\": \"OBJECTID\"\n }];\n //console.log(traceTask);\n var trace_result;\n traceTask.setOutputParam(\"Downstream_Pipes\");\n traceTask.gpAsyncResultParam(\"Downstream_Pipes\", trace_result);\n\n console.log(\"Trace initialized. Submitting request to tracing service...\");\n traceTask.run(function(error, result, response) {\n console.log(\"Trace completed.\");\n if (error) {\n console.log(\"There was an error: \", error);\n traceError(error);\n } else {\n /**\n * Derive a simplified trace from the GP results for display\n */\n // convert ESRI Web Mercator to Leaflet Web Mercator\n console.log(\"reprojecting results...\");\n var fc1 = Terraformer.toGeographic(result.Downstream_Pipes);\n // dissolve the lines\n console.log(\"dissolving results...\");\n var gc1 = dissolve(fc1);\n console.log(\"Adding data to layer...\"); //, gc1);\n // add to the data to the waiting Leaflet object\n trwwTraceResult.addData(gc1);\n // add that to the map\n console.log(\"Adding layer to map...\");\n trwwTraceResult.addTo(map);\n // adjust the map position and zoom to definitely fit the results\n map.fitBounds(\n trwwTraceResult.getBounds()\n // {\n // paddingTopLeft: L.point(300, 75),\n // paddingBottomRight: L.point(300, 75)\n // }\n );\n //map.setZoom(map.getZoom() - 2);\n\n /**\n * Generate Summaries\n */\n traceSummarize(fc1, muniFC);\n\n /**\n * Animate\n */\n // preprocess data fro animation\n //var tracePoints = traceAnimatePrep(geometryCollection);\n // animate\n //traceAnimate(tracePoints);\n\n // Display completion messages, results, etc.\n traceSuccess();\n // console.log(\"Trace Results:\", gc1);\n }\n });\n });\n }\n\n /**\n * NETWORK TRACE button click - run the trace once address has been identified (this could be accessed from the address pop-up)\n */\n $(document).on(\"click\", \"#networkTrace\", function() {\n //disable the button\n $(this).prop(\"disabled\", true);\n // clear previous traces\n clearNetworkTrace();\n // search for the nearest structure\n var nearest = findNearestStructure(L.latLng({\n lat: traceSummary.datum.lat,\n lng: traceSummary.datum.lng\n }));\n console.log(\"nearest\", nearest);\n // run the GP using the geojson\n traceExecute(nearest);\n });\n\n /**\n * ABOUT BUTTON\n */\n $('#aboutModal').on('hidden.bs.modal', function(e) {\n messageControl.onAboutModalClose();\n });\n\n /**\n * click event to reset the analysis function\n */\n $(document).on(\"click\", '#' + messageControl.resetButton.id, function() {\n console.log(\"Resetting the trace.\");\n console.log(\"--------------------\");\n // reset all controls to initial state\n messageControl.reset();\n // set traceSummary object to initial values\n traceSummary.reset();\n // remove the network trace from the map\n clearNetworkTrace();\n // remove the geocoded address point from the map\n resetAddressSearch();\n });\n\n /**--------------------------------------------------------------------------\n * Typeahead search functionality\n */\n\n /* Highlight search box text on click */\n $(\".searchbox\").click(function() {\n $(this).select();\n });\n\n /* Prevent hitting enter from refreshing the page */\n $(\".searchbox\").keypress(function(e) {\n if (e.which == 13) {\n e.preventDefault();\n }\n });\n\n // var geocoding_url = L.Util.template(\n // \"https://api.mapbox.com/geocoding/v5/mapbox.places/%QUERY.json?bbox={bbox}&access_token={access_token}\", {\n // bbox: \"-80.2863,40.2984,-79.6814,40.5910\",\n // access_token: mapbox_key\n // }\n // )\n // \"https://search.mapzen.com/v1/search?text=%QUERY&size=5&boundary.country=USA&api_key=mapzen-ZGFLinZ\"\n //console.log(\"geocoding_url\", geocoding_url);\n var addressSearch = new Bloodhound({\n name: \"Mapbox\",\n datumTokenizer: function(d) {\n return Bloodhound.tokenizers.whitespace(d.name);\n },\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n remote: {\n // rateLimitWait: 1000,\n // wildcard: '%QUERY',\n url: 'https://api.mapbox.com/geocoding/v5/mapbox.places/%QUERY.json?bbox=-80.2863,40.2984,-79.6814,40.5910&access_token=pk.eyJ1IjoiY2l2aWNtYXBwZXIiLCJhIjoiY2pjY2d2N2dhMDBraDMzbXRhOXpiZXJsayJ9.8JfoANBxEIrySG5avX4PWQ',\n // prepare: function(query, settings) {\n // console.log(settings);\n // // $(\"#searchicon\").removeClass(\"fa-search\").addClass(\"fa-refresh fa-spin\");\n // },\n // transform: function(response) {\n // console.log(response);\n // },\n // transport: function(options, onSuccess, onError) {\n // // $('#searchicon').removeClass(\"fa-refresh fa-spin\").addClass(\"fa-search\");\n // $.ajax(options)\n // .done(function(data, textStatus, request) {\n // console.log(data);\n // console.log(textStatus);\n // console.log(request);\n // var results = $.map(data.features, function(feature) {\n // return {\n // name: feature.place_name,\n // lat: feature.geometry.coordinates[1],\n // lng: feature.geometry.coordinates[0],\n // source: \"Mapbox\"\n // };\n // });\n\n // onSuccess(results);\n // })\n // .fail(function(request, textStatus, errorThrown) {\n // console.log(request, textStatus, errorThrown);\n // onError(errorThrown);\n // });\n // }\n filter: function(data) {\n return $.map(data.features, function(feature) {\n return {\n name: feature.place_name,\n lat: feature.geometry.coordinates[1],\n lng: feature.geometry.coordinates[0],\n source: \"Mapbox\"\n };\n });\n },\n ajax: {\n beforeSend: function(jqXhr, settings) {\n // console.log(\"beforeSend\", jqXhr, settings);\n $(\"#searchicon\").removeClass(\"fa-search\").addClass(\"fa-refresh fa-spin\");\n // settings.url += \"&boundary.rect.min_lat=40.1243&boundary.rect.min_lon=-80.5106&boundary.rect.max_lat=40.7556&boundary.rect.max_lon=-79.4064\";\n },\n complete: function(jqXHR, status) {\n // console.log(\"afterSend\", status);\n $('#searchicon').removeClass(\"fa-refresh fa-spin\").addClass(\"fa-search\");\n\n }\n }\n },\n limit: 5\n });\n\n addressSearch.initialize();\n\n var typeaheadTimeout;\n // non-Bloodhound source callback function for the CoreJS-flavor of Typeahead\n function corejsTypeaheadSource(query, syncResults, asyncResults) {\n var geocoding_url = L.Util.template(\n \"https://api.mapbox.com/geocoding/v5/mapbox.places/{address}.json?bbox={bbox}&access_token={access_token}&autocomplete=true{autocomplete}limit={limit}\", {\n address: query,\n bbox: \"-80.2863,40.2984,-79.6814,40.5910\",\n access_token: mapbox_key,\n autocomplete: true,\n limit: 5\n }\n );\n try { clearTimeout(typeaheadTimeout); } catch (e) {}\n typeaheadTimeout = setTimeout(function() {\n $.get(geocoding_url, function(data) {\n var response = $.map(data.features, function(feature) {\n return {\n name: feature.place_name,\n lat: feature.geometry.coordinates[1],\n lng: feature.geometry.coordinates[0],\n source: \"Mapbox\"\n };\n });\n console.log(response);\n asyncResults(response);\n });\n }, 500);\n }\n\n $(\".searchbox\").typeahead({\n minLength: 3,\n highlight: true,\n hint: false\n }, {\n name: \"Mapbox\",\n displayKey: \"name\",\n source: addressSearch.ttAdapter(),\n templates: {\n header: \"<p class='typeahead-header'>Select address at which to flush the toilet:</p>\",\n suggestion: Handlebars.compile([\"{{name}}\"].join(\"\"))\n }\n }).on(\"typeahead:selected\", function(obj, datum) {\n // once an address is selected from the drop-down:\n\n // store geocoding results in the global summary object\n traceSummary.datum = datum;\n\n // store the position of the address at latLng object\n var latlng = L.latLng({\n lat: datum.lat,\n lng: datum.lng\n });\n\n console.log(\"Search found this: \", datum, latlng);\n\n // set the map view to the address location\n map.setView(latlng, 15);\n // clear the previous network trace\n clearNetworkTrace();\n // remove the previous geocoded address point\n //addressPoint.remove();\n // add a point at the address, bind a pop-up, and open the pop-up automatically\n //addressPoint.setLatLng(latlng).bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + \"</p>\").openPopup();\n\n addressPoint.clearLayers();\n addressPoint\n .addData({\n \"type\": \"FeatureCollection\",\n \"features\": [{\n \"type\": \"Feature\",\n \"properties\": {\n \"name\": datum.name\n },\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [datum.lng, datum.lat]\n }\n }]\n })\n //.bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + '</p><p><button id=\"networkTrace\" type=\"button\" class=\"btn btn-default btn-lg btn-block\">Flush! <i class=\"fa fa-caret-square-o-down\"></i></button>')\n .bindPopup(\"<h4>\" + datum.name + \"</h4><p>\" + datum.lng + \", \" + datum.lat + '</p>')\n .openPopup();\n // from that point, automatically find the nearest sewer structure\n findNearestStructure(latlng);\n });\n\n $(\".twitter-typeahead\").css(\"position\", \"static\");\n $(\".twitter-typeahead\").css(\"display\", \"block\");\n\n /**\n * reset the address search box, remove the geocoded address point, and\n * close the pop-up.\n */\n function resetAddressSearch() {\n $('.searchbox').val('');\n addressPoint.clearLayers();\n addressPoint.closePopup();\n }\n\n /**\n * given the features array from a geojson feature collection, and a property,\n * get a \"set\" (unique values) of values stored in that property\n */\n function geojson_set(array, property) {\n var unique = [];\n $.each(array, function(i, e) {\n var p = e.properties[property];\n if ($.inArray(p, unique) == -1) {\n if (p !== undefined) {\n unique.push(e.properties[property]);\n }\n }\n });\n return unique;\n }\n\n /**---------------------------------------------------------------------------\n * DOCUMENT INITIALIZATION\n */\n\n messageControl.init(map);\n\n // enable popovers\n // $('.legend-popovers').popover();\n // $('.result-popovers').popover();\n $(function () {\n $('[data-toggle=\"popover\"]').popover()\n })\n\n}", "function init(){\n var lon = 5;\n var lat = 15;\n var zoom = 2;\n\n var context = {\n getColour: function(feature) {\n return feature.attributes[\"colour\"];\n }\n };\n\n var template = {\n\t\tfillOpacity: 0.9,\n strokeColor: \"#555555\",\n strokeWidth: 0,\n\t\tstrokeOpacity : 0,\n fillColor: \"${getColour}\"\n\t};\n\t\n\tvar templateFondCarte = {\n\t\tstrokeColor: \"#333333\",\n\t\tstrokeWidth: 1,\n\t\tfillOpacity: 0\n\t};\n\t\n\n style = new OpenLayers.Style(template, {context: context});\n\tstyleFondCarte = new OpenLayers.Style(templateFondCarte);\n styleMap = new OpenLayers.StyleMap({'default': style});\n\tstyleMapFondCarte = new OpenLayers.StyleMap({'default': styleFondCarte});\n\tvar options = {\n numZoomLevels: 5,\n controls: [] // Remove all controls\n };\n\n // Create a new map with options defined above\n map = new OpenLayers.Map( 'olmap', options );\n\n // Create polygon layer as vector features\n // http://dev.openlayers.org/docs/files/OpenLayers/Layer/Vector-js.html\n fondCarte = new OpenLayers.Layer.GML( \"Fond de Carte\", \"data/fond_carte.json\", //\"data/choropleth.json\",\n { format: OpenLayers.Format.GeoJSON,\n styleMap: styleMapFondCarte,\n isBaseLayer: true,\n projection: new OpenLayers.Projection(\"EPSG:4326\"),\n attribution: \"ADN Techno\" } );\n map.addLayer(fondCarte);\n map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);\n\n // Add map controls: http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html\n map.addControl(new OpenLayers.Control.LayerSwitcher());\n map.addControl(new OpenLayers.Control.MousePosition());\n map.addControl(new OpenLayers.Control.MouseDefaults());\n map.addControl(new OpenLayers.Control.PanZoomBar());\n\t\n\t// Bind l'évènement de changement de dataLayer\n\t$('#var').change(function() {\n\t\tvar selVar = $('#selVar').val();\n\t\tif (selVar == '-1') {map.removeLayer('dataLayer'); return true;}\n\t\tloadLayer(selVar);\n\t});\n}", "addMapLayers() {\r\n // console.log('method: addMapLayers');\r\n let layers = this.map.getStyle().layers;\r\n // Find the index of the first symbol layer in the map style\r\n let firstSymbolId;\r\n for (let i = 0; i < layers.length; i++) {\r\n if (layers[i].type === 'symbol') {\r\n firstSymbolId = layers[i].id;\r\n break;\r\n }\r\n }\r\n this.options.mapConfig.layers.forEach((layer, index) => {\r\n\r\n // Add map source\r\n this.map.addSource(layer.source.id, {\r\n type: layer.source.type,\r\n data: layer.source.data\r\n });\r\n \r\n\r\n // Add layers to map\r\n this.map.addLayer({\r\n \"id\": layer.id,\r\n \"type\": \"fill\",\r\n \"source\": layer.source.id,\r\n \"paint\": {\r\n \"fill-color\": this.paintFill(layer.properties[0]),\r\n \"fill-opacity\": 0.8,\r\n \"fill-outline-color\": \"#000\"\r\n },\r\n 'layout': {\r\n 'visibility': 'none'\r\n }\r\n }, firstSymbolId);\r\n\r\n\r\n // check if touch device. if it's not a touch device, add mouse events\r\n if (!checkDevice.isTouch()) {\r\n this.initMouseEvents(layer);\r\n } // checkDevice.isTouch()\r\n\r\n\r\n // Store all the custom layers\r\n this.customLayers.push(layer.id);\r\n });\r\n }", "source_map_point(lat, lng) {\n this.vectorLayer = new ol.layer.Vector({\n source: new ol.source.Vector({\n features: [\n new ol.Feature({\n geometry: new ol.geom.Point(ol.proj.transform([parseFloat(lng), parseFloat(lat)], \"EPSG:4326\", \"EPSG:3857\"))\n })\n ]\n }),\n style: new ol.style.Style({\n image: new ol.style.Icon({\n anchor: [0.5, 0.5],\n anchorXUnits: \"fraction\",\n anchorYUnits: \"fraction\",\n src: \"assets/green.svg\"\n })\n })\n });\n this.map.addLayer(this.vectorLayer);\n this.vectorLayer.set(\"name\", \"selectvector\");\n }", "function drawLayer() {\n\n if(!kpiResultData || !geoJsonData) {\n return;\n }\n\n prepareGeoJsonData(geoJsonData, kpiResultData);\n\n var kpi = scope.selectedKpi;\n kpi.bad = getBad(kpi.sufficient, kpi.excellent);\n\n function pointToLayer(feature, latlng) {\n return L.circleMarker(latlng, geojsonMarkerOptions);\n }\n\n function onEachFeature(feature, layer) {\n\n var color = \"#666666\";\n\n if((kpi.excellent || kpi.excellent === 0) && (kpi.sufficient || kpi.sufficient === 0) && (kpi.bad || kpi.bad === 0) && (feature.properties.kpiValue || feature.properties.kpiValue === 0)) {\n color = getColor(kpi.bad, kpi.excellent, kpi.sufficient, feature.properties.kpiValue);\n }\n\n layer.setStyle({\n color: color,\n weight: 3,\n opacity: 0.6,\n fillOpacity: 0.1,\n fillColor: color\n });\n\n\n layer.on(\"mouseover\", function (e) {\n layer.setStyle(highlightStyle);\n scope.selectedFeature = feature;\n console.log(feature);\n scope.$digest();\n });\n\n layer.on(\"mouseout\", function (e) {\n layer.setStyle({\n color: color,\n weight: 3,\n opacity: 0.6,\n fillOpacity: 0.1,\n fillColor: color\n }); \n \n scope.selectedFeature = null;\n scope.$digest();\n\n });\n\n }\n\n var geojsonMarkerOptions = {\n radius: 8,\n fillColor: \"#ff7800\",\n color: \"#000\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.8\n };\n\n if(kpiLayer) {\n map.removeLayer(kpiLayer);\n }\n\n kpiLayer = L.geoJson(geoJsonData, {\n pointToLayer: pointToLayer,\n onEachFeature: onEachFeature\n }).addTo(map);\n\n map.fitBounds(kpiLayer.getBounds());\n }", "function setCurrentMap(element) {\n\tcurrentMap = element;\n\tmapSize = {width:element.style.width.slice(0, -2), \n\t\t\theight:element.style.height.slice(0, -2)};\n\trefreshServicesLayer();\n}", "function MyComponent() {\n const map = useMapEvents({\n click: () => {\n map.locate();\n console.log(map.locate());\n },\n locationfound: (location) => {\n setUserPosition(location.latlng);\n map.flyTo(location.latlng, map.getZoom())\n console.log(userPosition);\n console.log('location found:', location)\n },\n moveend: async () => {\n const bounds = map.getBounds();\n const wrapBounds = map.wrapLatLngBounds(bounds);\n // console.log(wrapBounds._southWest.lat, wrapBounds._southWest.lng, wrapBounds._northEast.lat, wrapBounds._northEast.lng);\n\n const res = await axios.get(`http://localhost:3001/api/area/${wrapBounds._southWest.lat}/${wrapBounds._southWest.lng}/${wrapBounds._northEast.lat}/${wrapBounds._northEast.lng}`);\n // const res = await axios.get(`http://localhost:3001/api/area/all`);\n console.log(res.data);\n setPlanes(res.data.states)\n \n },\n })\n return null\n }", "setActiveLayer(layer) {\r\n this.activeLayer = layer;\r\n }", "function highlightFeature(e) {\r\n\t\tvar layer = e.target;\r\n\r\n\t\t//estil de la capa quan s'hi passa el ratolí sobre\r\n\t\tlayer.setStyle({\r\n\t\t\tcolor: '#0074d9',\r\n\t\t\tdashArray: '',\r\n\t\t\tfillOpacity: 0.4,\r\n weight:0.5\r\n\t\t});\r\n\r\n\t\tif (!L.Browser.ie && !L.Browser.opera) {\r\n\t\t\tlayer.bringToFront();\r\n\t\t}\r\n\t\t\r\n\t\tvar iso3 = e.target.feature.properties.iso3;\r\n\t\t//crido a una funció que retorna el valor de GDP (que no sé que és però és un indicador) de l'any més actual del pais clicat\r\n\t\t//retornaGDP(iso3);\r\n\t\tvar propietats = layer.feature.properties;\t\t\r\n\t\t\r\n\t\t//Actualitza el panell sobre el panell info\r\n\t\tinfo.update(layer.feature.properties);\r\n\t}", "loadMap(){\n servicio_API.obtenerKML().then(function(datos){\n var listaHTML = tmpl_kml_compilada(datos)\n document.getElementById('map').innerHTML =\"\";\n var map = new ol.Map({\n target: 'map',\n layers: [\n new ol.layer.Tile({\n source: new ol.source.OSM()\n })\n ],\n view: new ol.View({\n center: ol.proj.fromLonLat([-0.5133,38.38504]),\n zoom:16 ,\n minZoom: 2,\n maxZoom: 20\n })\n });\n map.addControl(new ol.control.FullScreen());\n map.addControl(new ol.control.OverviewMap());\n \n var features = new ol.format.KML({\n showPointNames: false,\n extractAttributes: true\n }).readFeatures(listaHTML,{\n dataProjection:'EPSG:4326',\n featureProjection:'EPSG:3857'\n });\n \n var kmlvectorSource = new ol.source.Vector({features:features});\n var kmlvector = new ol.layer.Vector({source:kmlvectorSource});\n map.addLayer(kmlvector);\n map.on('click', function(evt) {\n var pixel = evt.pixel;\n var features = [];\n map.forEachFeatureAtPixel(pixel, function(feature) {\n features.push(feature);\n });\n if (features.length > 0) {\n var coordinate = features[0].getGeometry().getFirstCoordinate();\n if (features[0].get(\"features\") && features[0].get(\"features\").length > 1) {\n map.getView().setZoom(map.getView().getZoom()+1);\n } else { \n alert(features[0].get(\"description\"));\n }\n }\n });\n }) \n }", "function setCurrentStation(map,currentStationTitle,baseColor,currentColor) {\n for (var i = 0; i < self.stationLocation().length; i++) {\n if (self.stationLocation()[i].title() == currentStationTitle) {\n self.stationLocation()[i].marker().setIcon(currentColor);\n var stationInfo = '<p><b>'+self.currentStation().title()+'</b></p>'+'<p>'+self.currentStation().address()+'</p>';\n self.stationLocation()[i].infowindow().setContent(stationInfo); \n getNextTrains('north',self.currentStation().northStop(),self.stationLocation()[i]); \n getNextTrains('south',self.currentStation().southStop(),self.stationLocation()[i]);\n } else {\n self.stationLocation()[i].marker().setIcon(baseColor);\n self.stationLocation()[i].infowindow().close(map,self.stationLocation()[i].marker());\n }\n self.stationLocation()[i].marker().setMap(map);\n }\n }", "function infoCliente(item, type_service){\n\t\t\t\t\t\tvar image = '../images/icon-Cliente.png'\n\t\t\t\t\t\tmap.zoomIn(4)\n\t\t\t\t\t\tmap.setCenter(item.coordenada_X,item.coordenada_Y)\n\n\t\t\t\t\t\tconsole.log(item.estado)\n\n\t\t\t\t\t\tvar marker_order_client\n\t\t\t\t\t\tif (item.estado === $scope.url.pendiente) {\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_pendiente_short\n\t\t\t\t\t\t} else if(item.estado === $scope.url.en_curso){\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_en_curso_short\n\t\t\t\t\t\t} else if (item.estado === $scope.url.resuelto) {\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_resuelto_short\n\t\t\t\t\t\t} else if (item.estado === $scope.url.no_resuelto) {\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_no_resuelto_short\n\t\t\t\t\t\t} else if(item.estado === $scope.url.reprogramado){\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_reprogramado_short\n\t\t\t\t\t\t} else if(item.estado === $scope.url.cancelado){\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_cancelado_short\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tmarker_order_client = $scope.url.markers_focus_cliente_reportado_short\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap.addMarker({\n\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t lng: item.coordenada_Y,\n\t\t\t\t\t\t icon: marker_order_client\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// Destalles de Servicio: CLIENTE\n\t\t\t\t\t\tif(item.detalle_servicio === 'detalle_servicio_VC') {\n\n\t\t\t\t\t\t\titem.detalle_servicio = 'Verificar Direccion de Cliente'\n\t\t\t\t\t\t} else if (item.detalle_servicio === 'detalle_servicio_RD') {\n\n\t\t\t\t\t\t\titem.detalle_servicio = 'Registro de Direccion'\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\titem.detalle_servicio = 'Registrar Cliente Nuevo'\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar contentWindow = $('.OrderWork__left')\n\t\t\t\t\t\tvar DetailContent = document.createElement('div')\n\t\t\t\t\t\tDetailContent.setAttribute('class','InfoContainner')\n\t\t\t\t\t\ttemplate = `<div class=\"InfoOrder\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__imagePortrate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"streetViewClient\" style=\"width:100%;height:300px\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__status\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><span id=\"urgency\"></span> <span id=\"status\">${item.estado}</span></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__desplegable\" id=\"option_desplegable\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"icon-icon_submenu\"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__desplegable--container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Items\" id=\"optionOrders\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--complete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.direccion}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--privacity\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"privacity\"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Código de la Orden de trabajo</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.codigo_orden}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Detalle del Servicio</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.detalle_servicio}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--complete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"userInfo__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>Acargo de</h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"userInfo__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"userInfo__data--title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>${item.user_card_data.user.name}</h3>\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"userInfo__data--content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Contratista</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>${item.user_card_data.contratista.name}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Supervisor</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>${item.user_card_data.supervisor.name}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data mapastatic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"mapStatic\" class=\"InfoOrder__data--map\" style=\"background-position:center;width: 100%;height: 200px\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--complete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Descripción</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.descripcion}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--complete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Observaciones</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.conclusiones}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Fecha de Publicado</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.fecha_publicado}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Fecha de Visita esperada</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.fecha_visita_esperada}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Fecha de Trabajo realizado</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.fecha_trabajo_realizado}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Reprogramado de</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.reprogramado_de}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"InfoOrder__data--slider\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Slider\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Slider__items\" id=\"slides\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Slider__btnPrev\"><span id=\"btnPrev\" class=\"icon-icon_prev\"></span></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Slider__btnNext\"><span class=\"icon-icon_next\" id=\"btnNext\"></span></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"back\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"back\" class=\"icon-icon_cerrar\"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\t\t\t\tDetailContent.innerHTML = template\n\t\t\t\t\t\tcontentWindow.append(DetailContent)\n\n\t\t\t\t\t\t// EFECTO HOVER SOBRE ICONO PARA VER OPCIONES OCULTAS DE ORDER\n\t\t\t\t\t\t$('#option_desplegable').on('mouseover', function(){\n\t\t\t\t\t\t\tconsole.log(this)\n\t\t\t\t\t\t\t$(this).find('.InfoOrder__desplegable--container').css('display', 'block')\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\t$('#option_desplegable').on('mouseleave', function(){\n\t\t\t\t\t\t\tconsole.log(this)\n\t\t\t\t\t\t\t$(this).find('.InfoOrder__desplegable--container').css('display', 'none')\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\t// VALIDACION DE COLORES POR ESTADO\n\t\t\t\t\t\tif (item.estado === 'pendiente') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('Pendiente')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#099692')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #099692')\n\t\t\t\t\t\t} else if (item.estado === 'resuelto') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('Resueltas')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#455a64')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #455a64')\n\t\t\t\t\t\t} else if (item.estado === 'no_resuelto') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('No resuelta')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#cb2948')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #cb2948')\n\t\t\t\t\t\t} else if (item.estado === 'reportado') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('Reportada')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#f15a24')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #f15a24')\n\t\t\t\t\t\t} else if (item.estado === 'en_curso') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('En curso')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#29abe2')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #29abe2')\n\t\t\t\t\t\t} else if (item.estado === 'cancelado') {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('Cancelada')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#939393')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #939393')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$('#status').html('Reprogramada')\n\t\t\t\t\t\t\t$('#status').css('background-color', '#e3d534')\n\t\t\t\t\t\t\t$('.InfoOrder__status').css('border-top', '5px solid #e3d534')\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar contentOptionOrder = $('#optionOrders')\n\n\t\t\t\t\t\tif (item.estado === 'pendiente' && item.public === true) {\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnCancelOrderPoste\"><span>Cancelar</span></div>`\n\t\t\t\t\t\t\tcontentOptionOrder.html(txt)\n\t\t\t\t\t\t\tvar CancelOrder = $('#btnCancelOrderPoste')\n\t\t\t\t\t\t\tCancelOrder.on('click', cancelOrder)\n\t\t\t\t\t\t} else if(item.estado === 'pendiente' && item.public === false){\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnEditOrderPoste\"><span>Editar</span></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"deleteOrder\"><span>Eliminar</span></div>`\n\t\t\t\t\t\t\tcontentOptionOrder.html(txt)\n\t\t\t\t\t\t\tvar EditOrder = $('#btnEditOrderPoste')\n\t\t\t\t\t\t\tEditOrder.on('click', editOrder)\n\t\t\t\t\t\t} else if(item.estado === 'resuelto' && item.public === true){\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnCancelOrderPoste\"><span>Cancelar</span></div>`\n\t\t\t\t\t\t\t// contentOptionOrder.html(txt)\n\t\t\t\t\t\t\t// var CancelOrder = $('#btnCancelOrderPoste')\n\t\t\t\t\t\t\t// CancelOrder.on('click', cancelOrder)\n\t\t\t\t\t\t\t$('#option_desplegable').remove()\n\t\t\t\t\t\t} else if(item.estado === 'no_resuelto' && item.public === true){\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnCancelOrderPoste\"><span>Cancelar</span></div>`\n\t\t\t\t\t\t\t// contentOptionOrder.html(txt)\n\t\t\t\t\t\t\t// var CancelOrder = $('#btnCancelOrderPoste')\n\t\t\t\t\t\t\t// CancelOrder.on('click', cancelOrder)\n\t\t\t\t\t\t\t$('#option_desplegable').remove()\n\t\t\t\t\t\t} else if(item.estado === 'reportado' && item.public === true){\n\t\t\t\t\t\t\tvar txt = `<div data-reported=\"${item._id}\" id=\"btnReporteOrderPoste\"><span>Ver Reporte</span></div>`\n\t\t\t\t\t\t\tcontentOptionOrder.html(txt)\n\t\t\t\t\t\t\tvar viewReporte = $('#btnReporteOrderPoste')\n\t\t\t\t\t\t\tviewReporte.on('click', actionOrder)\n\t\t\t\t\t\t} else if(item.estado === 'en_curso' && item.public === true){\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnCancelOrderPoste\"><span>Cancelar</span></div>`\n\t\t\t\t\t\t\tcontentOptionOrder.html(txt)\n\t\t\t\t\t\t\tvar CancelOrder = $('#btnCancelOrderPoste')\n\t\t\t\t\t\t\tCancelOrder.on('click', cancelOrder)\n\t\t\t\t\t\t} else if(item.estado === 'cancelado' && item.public === true){\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnCancelOrderPoste\"><span>Cancelar</span></div>`\n\t\t\t\t\t\t\t// contentOptionOrder.html(txt)\n\t\t\t\t\t\t\t// var CancelOrder = $('#btnCancelOrderPoste')\n\t\t\t\t\t\t\t// CancelOrder.on('click', cancelOrder)\n\t\t\t\t\t\t} else if(item.estado === 'reprogramado' && item.public === false) {\n\t\t\t\t\t\t\tvar txt = `<div id=\"btnEditOrderPoste\"><span>Editar</span></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"deleteOrder\"><span>Eliminar</span></div>`\n\t\t\t\t\t\t\tcontentOptionOrder.html(txt)\n\t\t\t\t\t\t\tvar EditOrder = $('#btnEditOrderPoste')\n\t\t\t\t\t\t\tEditOrder.on('click', editOrder)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction cancelOrder(){\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/change-status/cancelado'\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar contentSlides = $('#slides')\n\t\t\t\t\t\t// var dataCliente\n\n\t\t\t\t\t\tconsole.log(item.coordenada_X,item.coordenada_Y)\n\n\t\t\t\t\t\tvar panorama = GMaps.createPanorama({\n\t\t\t\t\t\t el: '#streetViewClient',\n\t\t\t\t\t\t lat : item.coordenada_X,\n\t\t\t\t\t\t lng : item.coordenada_Y\n\t\t\t\t\t\t})\n\n\n\t\t\t\t\t\tpanorama.setOptions({disableDefaultUI: true, clickToGo:false, zoomControl:false, scrollwheel:false, streetViewControl:false})\n\n\t\t\t\t\t\t// ELIMINACION DE ORDEN\n\t\t\t\t\t\t$('#deleteOrder').on('click', function(){\n\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/delete/'+item._id+'?_method=delete'\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\t// LECTURA DE CADA ELEMENTO DE LA ORDEN\n\t\t\t\t\t\tfor (var i = 0; i < item.elementos.length; i++) {\n\t\t\t\t\t\t\tvar element = item.elementos[i]\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod:'POST',\n\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/'+element.type+'/'+element._id\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tconsole.log(item.estado)\n\n\t\t\t\t\t\t\t\tvar marker_client\n\t\t\t\t\t\t\t\tif (item.estado === $scope.url.pendiente) {\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_pendiente_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.en_curso){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_en_curso_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.cancelado){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_cancelada_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.resuelto){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_resuelta_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.no_resuelto){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_no_resuelta_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.reprogramado){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_reprogramada_short\n\t\t\t\t\t\t\t\t} else if(item.estado === $scope.url.reportado){\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_reportada_short\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmarker_client = $scope.url.marker_client_no_asignada_short\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconsole.log(marker_client)\n\n\t\t\t\t\t\t\t\tmap.addMarker({\n\t\t\t\t\t\t\t\t\tlat: Number(res.data.service.coordenada_X),\n\t\t\t\t\t\t\t\t\tlng: Number(res.data.service.coordenada_Y),\n\t\t\t\t\t\t\t\t\tclick: function(e){\n\t\t\t\t\t\t\t\t\t\tconsole.log(e)\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ticon: marker_client\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\tconsole.log(res)\n\n\t\t\t\t\t\t\t\tvar contentElement = document.createElement('div')\n\t\t\t\t\t\t\t\tcontentElement.setAttribute('class', 'Slider__items--item')\n\t\t\t\t\t\t\t\tcontentElement.setAttribute('data-id', res.data.service._id)\n\t\t\t\t\t\t\t\t// console.log(contentElement)\n\t\t\t\t\t\t\t\tvar template = `<div class=\"ItemContainner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemContainner__box\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemContainner__box--image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url(${res.data.service.imagen_cliente[0].path})\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>${res.data.service.numero_cliente}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemContainner__box--text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"titleContent\"><strong>${res.data.service.name_cliente}</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"typeResidencial\" id=\"type_residencial\"></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\t\t\t\t\t\tcontentElement.innerHTML = template\n\t\t\t\t\t\t\t\tcontentSlides.append(contentElement)\n\n\t\t\t\t\t\t\t\tif (res.data.service.type_residencial === true) {\n\t\t\t\t\t\t\t\t\t$('#type_residencial').innerHTML = 'Residencial'\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('#type_residencial').innerHTML = 'No Residencial'\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconsole.log($('.Slider__items--item'))\n\t\t\t\t\t\t\t\tconsole.log(i, $('.Slider__items--item').length)\n\t\t\t\t\t\t\t\tif (i === $('.Slider__items--item').length) {\n\t\t\t\t\t\t\t\t\tinitSlides()\n\t\t\t\t\t\t\t\t\t$('.Slider__items--item').on('click', dateCliente)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// VISTA DE CADA ELEMENTO DE LA ORDEN\n\t\t\t\t\t\tfunction dateCliente(){\n\t\t\t\t\t\t\tmap.removeMarkers()\n\t\t\t\t\t\t\tvar idElement = this.getAttribute('data-id')\n\t\t\t\t\t\t\tconsole.log(idElement)\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/cliente/'+idElement\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tconsole.log(res)\n\n\t\t\t\t\t\t\t\tvar item = res.data.service\n\t\t\t\t\t\t\t\tvar residencial\n\t\t\t\t\t\t\t\tif (item.type_residencial === true) {\n\t\t\t\t\t\t\t\t\tresidencial = 'Residencial'\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresidencial = 'No Residencial'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar containner = $('.OrderWork__left')\n\t\t\t\t\t\t\t\tvar content = document.createElement('div')\n\t\t\t\t\t\t\t\tcontent.setAttribute('class', 'DateInfoElement')\n\t\t\t\t\t\t\t\tvar templateElement = `<div class=\"DateInfoElement__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--slider\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>ID Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.cliente_id}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Código de Orden de Trabajo</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.codigo_orden_trabajo}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Número de Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.numero_cliente}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Distrito</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.altura_poste}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Nombre de Vía</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.codigo_via}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Número dem Puerta</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.numero_puerta}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Puerta Interior</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.numero_interior}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Urbanización</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.type_lampara}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Manzana</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.manzana}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Lote</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.lote}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Nombre de Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.nombre_de_cliente}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Tipo de Residencial</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${residencial}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Maximetro BT</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.is_maximetro_bt}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data mapastatic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"mapaElement\" class=\"mapaElement\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Coordenada X</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.coordenada_X}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Coordenada Y</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.coordenada_Y}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Tipo de Conexión</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.type_conexion}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Tipo de Acometida</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.type_acometida}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Tipo de Cable de Acometida</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.type_cable_acometida}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Calibre de Cable de Acometida</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.calibre_cable_acometida}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Calibre de Cable Matriz</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.calibre_cable_matriz}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateRight\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Fecha de Ejecución</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.fecha_ejecucion}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__containner--data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateLeft\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"title\"><strong>Observaciones</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"content\">${item.observaciones}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"DateInfoElement__back\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"backItemOrder\" class=\"icon-icon_close\"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\t\t\t\t\t\tcontent.innerHTML = templateElement\n\t\t\t\t\t\t\t\t// console.log(content)\n\t\t\t\t\t\t\t\tcontainner.append(content)\n\n\n\t\t\t\t\t\t\t\t$('#backItemOrder').on('click', function(){\n\t\t\t\t\t\t\t\t\t$('.DateInfoElement').remove()\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t// MAPA STATIC\n\t\t\t\t\t\t\t\tvar url = GMaps.staticMapURL({\n\t\t\t\t\t\t\t\t size: [800, 400],\n\t\t\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t\t\t lng: item.coordenada_Y,\n\t\t\t\t\t\t\t\t markers: [\n\t\t\t\t\t\t\t\t {lat: item.coordenada_X, lng: item.coordenada_Y}\n\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t$('#mapaElement').css('background-image', 'url('+url+')')\n\n\t\t\t\t\t\t\t\t// // mapEdit.markers\n\t\t\t\t\t\t\t\tmap.addMarker({\n\t\t\t\t\t\t\t\t\tlat: Number(item.coordenada_X),\n\t\t\t\t\t\t\t\t\tlng: Number(item.coordenada_Y),\n\t\t\t\t\t\t\t\t\tclick: function(e){\n\t\t\t\t\t\t\t\t\t\tconsole.log(e)\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ticon: '../images/icon-Poste.png'\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar EditOrder = $('#btnEditOrderClient')\n\t\t\t\t\t\tEditOrder.on('click', editOrder)\n\n\t\t\t\t\t\tfunction editOrder(){\n\t\t\t\t\t\t\tcontentTemplateEdit = $('.OrderWork')\n\t\t\t\t\t\t\tvar templateEditPoste = document.createElement('div')\n\t\t\t\t\t\t\ttemplateEditPoste.setAttribute('class', 'EditPoste')\n\n\t\t\t\t\t\t\tvar template = `<form action=\"\" class=\"EditPoste__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditPoste__containner--head\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>EDITAR ORDEN DE TRABAJO</h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditPoste__containner--body\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Servicio</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" name=\"type_service\" id=\"type_service\" disabled>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"tipo_servicio_P\">Poste</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"tipo_servicio_C\" selected>Cliente</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Detalle del Servicio</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" name=\"detail_service\" id=\"detail_service\" disabled>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option>Seleccione</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"detalle_servicio_VC\">Verificar Direccion de Cliente</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"detalle_servicio_RD\">Registro de Direccion</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"detalle_servicio_RCN\">Registrar Cliente Nuevo</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Usuario</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" required name=\"\" id=\"codigo_contratista\"></select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Supervisor</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" required name=\"\" id=\"codigo_supervisor\"></select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Prioridad</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" name=\"priority\" id=\"priority\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"tipo_urgencia_A\">Alta</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"tipo_urgencia_M\">Media</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"tipo_urgencia_B\">Baja</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Dirección</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"inputs-label\" id=\"direccion\" type=\"text\" class=\"\" value=\"${item.direccion}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"mapEdit\" style=\"width:100%;height:200px\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada X</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"inputs-label\" id=\"coordenada_X\" type=\"text\" class=\"\" value=\"${item.coordenada_X}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada Y</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"inputs-label\" id=\"coordenada_Y\" type=\"text\" class=\"\" value=\"${item.coordenada_Y}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left labelTextarea\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Descripción</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<textarea name=\"\" class=\"inputs-label\" id=\"descripcion\" cols=\"30\" rows=\"5\">${item.descripcion}</textarea>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Fecha de Visita Esperada</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"inputs-label\" id=\"date\" type=\"date\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Público</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right inputStatus\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right--true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"public\" id=\"true\" value=\"true\" type=\"radio\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"true\">Si</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right--false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"public\" id=\"false\" value=\"false\" type=\"radio\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label for=\"false\">No</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__left countPoste\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Cantidad de Clientes</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__right\" id=\"ElementsContainner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__btns\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__btns--cancel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button id=\"closeEditOrder\">CANCELAR</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"Data__btns--send\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"submit\">GUARDAR</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>`\n\n\t\t\t\t\t\t\ttemplateEditPoste.innerHTML = template\n\t\t\t\t\t\t\tcontentTemplateEdit.append(templateEditPoste)\n\t\t\t\t\t\t\tvar OldDate = item.fecha_visita_esperada\n\t\t\t\t\t\t\tOldDate = OldDate.split('/')\n\t\t\t\t\t\t\tconsole.log(OldDate)\n\t\t\t\t\t\t\tvar day = OldDate[0]\n\t\t\t\t\t\t\tvar mounth = OldDate[1]\n\t\t\t\t\t\t\tvar year = OldDate[2]\n\n\t\t\t\t\t\t\tif (parseInt(mounth) < 10) {\n\t\t\t\t\t\t\t\tmounth = '0'+mounth\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (parseInt(day) < 10) {\n\t\t\t\t\t\t\t\tday = '0'+day\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar fechaDate = year+'-'+mounth+'-'+day\n\t\t\t\t\t\t\tconsole.log(typeof fechaDate, fechaDate)\n\t\t\t\t\t\t\t$('#date').val(fechaDate)\n\n\t\t\t\t\t\t\t// USUARIOS CONTRATISTAS EN SELECT\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\turl:'/dashboard/usuarios/list/users-campo'\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tconsole.log('XD123456')\n\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\tvar usersListContratista = res.data.usuarios\n\t\t\t\t\t\t\t\tfor (var i = 0; i < usersListContratista.length; i++) {\n\t\t\t\t\t\t\t\t\tvar content = $('#codigo_contratista')\n\t\t\t\t\t\t\t\t\tvar user = document.createElement('option')\n\t\t\t\t\t\t\t\t\tuser.setAttribute('value', usersListContratista[i]._id)\n\t\t\t\t\t\t\t\t\tuser.innerHTML = usersListContratista[i].full_name\n\t\t\t\t\t\t\t\t\tcontent.append(user)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor (var i = 0; i < $('#codigo_contratista option').length; i++) {\n\t\t\t\t\t\t\t\t\tvar option = $('#codigo_contratista option')[i]\n\t\t\t\t\t\t\t\t\tif ($(option)[0].value === item.codigo_contratista) {\n\t\t\t\t\t\t\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t// USUARIOS SUPERVISORES EN SELECT\n\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\turl: '/dashboard/usuarios/list/officers'\n\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\tvar usersListSupervisor = res.data.usuarios\n\t\t\t\t\t\t\t\tfor (var i = 0; i < usersListSupervisor.length; i++) {\n\t\t\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t\t\tvar content = $('#codigo_supervisor')\n\t\t\t\t\t\t\t\t\tvar user = document.createElement('option')\n\t\t\t\t\t\t\t\t\tuser.setAttribute('value', usersListSupervisor[i]._id)\n\t\t\t\t\t\t\t\t\tuser.innerHTML = usersListSupervisor[i].full_name\n\t\t\t\t\t\t\t\t\tcontent.append(user)\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor (var i = 0; i < $('#codigo_supervisor option').length; i++) {\n\t\t\t\t\t\t\t\t\tvar option = $('#codigo_supervisor option')[i]\n\t\t\t\t\t\t\t\t\tif ($(option)[0].value === item.codigo_supervisor) {\n\t\t\t\t\t\t\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tconsole.log($('#type_service'))\n\t\t\t\t\t\t\tvar option = $('#detail_service option')[0]\n\t\t\t\t\t\t\tconsole.log($(option)[0].value)\n\n\t\t\t\t\t\t\tif (item.detalle_servicio === 'Registrar Cliente Nuevo') {\n\t\t\t\t\t\t\t\tvar template = `<div class=\"itemContainner\" id=\"itemContainner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"contentItems\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\t\t\t\t\t\t$('#ElementsContainner').html(template)\n\t\t\t\t\t\t\t\t// $('.EditarPoste').on('click', editElementOrderDireccion)\n\t\t\t\t\t\t\t} else if (item.detalle_servicio === 'Verificar Direccion de Cliente'){\n\t\t\t\t\t\t\t\tvar template = `<div class=\"searchItem\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"searchItem__btnSearch\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"searchItem__btnSearch--input\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"inputs-label\" id=\"codigoCliente\" type=\"text\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"searchItem__btnSearch--btn\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"AddOrderCodigo\"><span>+</span> Agregar Cliente</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"contentItems\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t$('#ElementsContainner').html(template)\t\t\t\t\t\n\t\t\t\t\t\t\t\t$('#AddOrderCodigo').on('click',addSearchElementOrder)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar template = `<div class=\"itemContainner\" id=\"itemContainner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"contentItems\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"BtnNewElement\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"BtnNewElement__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"addNewElement\"><span class=\"icon-icon_agregar_poste\"></span></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t$('#ElementsContainner').html(template)\n\t\t\t\t\t\t\t\t$('#addNewElement').on('click', addNewElementEdited)\n\t\t\t\t\t\t\t\t// $('.EditarPoste').on('click', editElementOrderExistent)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (var e = 0; e < item.elementos.length; e++) {\n\t\t\t\t\t\t\t\t// console.log('XD')\n\t\t\t\t\t\t\t\tvar element = item.elementos[e]\n\t\t\t\t\t\t\t\tvar it = e\n\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod:'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/'+element.type+'/'+element._id\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tconsole.log(item.detalle_servicio)\n\t\t\t\t\t\t\t\t\tvar contentPostesContainner = $('#contentItems')\n\n\t\t\t\t\t\t\t\t\tvar contentElement = document.createElement('div')\n\t\t\t\t\t\t\t\t\tcontentElement.setAttribute('class', 'EditItem')\n\t\t\t\t\t\t\t\t\tcontentElement.setAttribute('data-content', res.data.service._id)\n\t\t\t\t\t\t\t\t\t// console.log(contentElement)\n\t\t\t\t\t\t\t\t\tvar residencial\n\t\t\t\t\t\t\t\t\tif (res.data.service.type_residencial === 'true') {\n\t\t\t\t\t\t\t\t\t\tresidencial = 'Residencial'\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tresidencial = 'No Residencial'\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (item.detalle_servicio === 'detalle_servicio_RCN') {\n\t\t\t\t\t\t\t\t\t\tconsole.log('XD RCN')\n\t\t\t\t\t\t\t\t\t\tvar template = `<div class=\"EditItem__image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url(${res.data.service.imagen_cliente[0].path})\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"cliente_id\">${res.data.service.cliente_id}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"nombre_de_cliente\"><strong>${res.data.service.nombre_de_cliente}</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"type_residencial\">${residencial}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__edit\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"EditarPosteRCN\" data-id=\"${res.data.service._id}\">EDITAR</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t\t\tcontentElement.innerHTML = template\n\t\t\t\t\t\t\t\t\t\tcontentPostesContainner.append(contentElement)\n\t\t\t\t\t\t\t\t\t\tif (e === $('.EditItem').length) {\n\t\t\t\t\t\t\t\t\t\t\tvar items = $('.EditarPosteRCN')\n\t\t\t\t\t\t\t\t\t\t\titems.on('click', editOrdenItemClientNew)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (item.detalle_servicio === 'detalle_servicio_VC') {\n\t\t\t\t\t\t\t\t\t\tconsole.log('XD VC')\n\t\t\t\t\t\t\t\t\t\tvar template = `<div class=\"EditItem__image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url(${res.data.service.imagen_cliente[0].path})\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"cliente_id\">${res.data.service.cliente_id}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"nombre_de_cliente\"><strong>${res.data.service.nombre_de_cliente}</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"type_residencial\">${residencial}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__delete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DeleteCliente\" data-id=\"${res.data.service._id}\">x</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t\t\tcontentElement.innerHTML = template\n\t\t\t\t\t\t\t\t\t\tcontentPostesContainner.append(contentElement)\n\t\t\t\t\t\t\t\t\t\t// $('#addNewElement').on('click', addNewElementEdited)\n\t\t\t\t\t\t\t\t\t\tif (e === $('.EditItem').length) {\n\t\t\t\t\t\t\t\t\t\t\t$('.DeleteCliente').on('click', deleteItemCliente)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconsole.log('XD RD')\n\t\t\t\t\t\t\t\t\t\tvar template = `<div class=\"EditItem__image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url(${res.data.service.imagen_cliente[0].path})\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"cliente_id\">${res.data.service.cliente_id}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"nombre_de_cliente\"><strong>${res.data.service.nombre_de_cliente}</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"type_residencial\">${residencial}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__edit\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"EditarPoste\" data-id=\"${res.data.service._id}\">EDITAR</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__delete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DeleteCliente\" data-id=\"${res.data.service._id}\">x</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t\t\tcontentElement.innerHTML = template\n\t\t\t\t\t\t\t\t\t\tcontentPostesContainner.append(contentElement)\n\t\t\t\t\t\t\t\t\t\t// console.log(e, $('.EditItem').length)\n\t\t\t\t\t\t\t\t\t\tif (e === $('.EditItem').length) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t\t\t\t\tvar items = $('.EditarPoste')\n\t\t\t\t\t\t\t\t\t\t\titems.on('click', editOrdenItemClient)\n\t\t\t\t\t\t\t\t\t\t\t$('.DeleteCliente').on('click', deleteItemCliente)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// AGREGADO DE UN NUEVO ELEMENTO\n\t\t\t\t\t\t\tfunction addNewElementEdited(){\n\t\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/add-item/cliente'\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tvar item = res.data.service\n\t\t\t\t\t\t\t\t\tvar containner = $('#contentItems')\n\t\t\t\t\t\t\t\t\tvar div = document.createElement('div')\n\t\t\t\t\t\t\t\t\tdiv.setAttribute('data-content', item._id)\n\t\t\t\t\t\t\t\t\tvar template = `<div class=\"EditItem__image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url('/images/elemento_defaul.png')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"cliente_id\">Sin Datos</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"nombre_de_cliente\"><strong>Sin Datos</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"type_residencial\">Sin Datos</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__edit\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"EditarPoste\" data-id=\"${item._id}\">EDITAR</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__delete\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DeleteCliente\" data-id=\"${item._id}\">x</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\n\t\t\t\t\t\t\t\t\tdiv.innerHTML = template\n\t\t\t\t\t\t\t\t\tcontainner.append(div)\n\t\t\t\t\t\t\t\t\t$('.EditarPoste').on('click', editOrdenItemClient)\n\t\t\t\t\t\t\t\t\t$('.DeleteCliente').on('click', deleteItemCliente)\n\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// ELIMINACION DE UN CIENTE DE LA ORDEN\n\t\t\t\t\t\t\tfunction deleteItemCliente(){\n\t\t\t\t\t\t\t\tvar id = this.getAttribute('data-id')\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/delete/cliente/'+id+'?_method=delete'\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t$('[data-content=\"'+id+'\"]').remove()\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// EDICION DE UN ITEM DE LA ORDEN DE TIPO CLIENTE RD\n\t\t\t\t\t\t\tfunction editOrdenItemClient(){\n\t\t\t\t\t\t\t\tconsole.log(this)\n\t\t\t\t\t\t\t\tvar idElement = this.getAttribute('data-id')\n\t\t\t\t\t\t\t\tconsole.log(idElement)\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/cliente/'+idElement\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tvar elementData = res.data.service\n\t\t\t\t\t\t\t\t\tvar contentTemplateEditPoste = document.createElement('div')\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.setAttribute('class', 'editPosteModal')\n\t\t\t\t\t\t\t\t\tvar template = `<form action=\"\" class=\"editPoste editClientElement\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>REGISTRO DE DIRECCIÓN DE CLIENTE</h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Caracteristicas</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>ID Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.cliente_id}\" id=\"data_cliente_id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>DIRECCIÓN</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Distrito</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"data_distrito\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Nombre de Vía</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.codigo_via}\" id=\"data_codigo_via\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Número de Puerta</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.numero_puerta}\" id=\"data_numero_puerta\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Puerta Interior</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.numero_interior}\" id=\"data_numero_interior\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Urbanización</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"data_urbanizacion\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Manzana</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.manzana}\" id=\"data_manzana\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Lote</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.lote}\" id=\"data_lote\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Ubicación</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication_item--map\" style=\"width:100%;height:200px\" id=\"mapsEdits\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada X</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.coordenada_X}\" id=\"element_coordenada_X\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada Y</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.coordenada_Y}\" id=\"element_coordenada_Y\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--buttons\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button class=\"editClienteCancel\">CANCELAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button type=\"submit\">GUARDAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>`\n\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.innerHTML = template\n\t\t\t\t\t\t\t\t\t$('.OrderWork').append(contentTemplateEditPoste)\n\t\t\t\t\t\t\t\t\t// $('#mapsEdit').css('background-image', 'url('+url+')')\n\n\t\t\t\t\t\t\t\t\tvar btnCloseEditPoste = $('.editClienteCancel')\n\t\t\t\t\t\t\t\t\t// btnCloseEditPoste.on('click', closeEditPoste)\n\n\t\t\t\t\t\t\t\t\tmapEdit = new GMaps({\n\t\t\t\t\t\t\t\t\t div: '#mapsEdits',\n\t\t\t\t\t\t\t\t\t zoom: 11,\n\t\t\t\t\t\t\t\t\t lat: -12.043333,\n\t\t\t\t\t\t\t\t\t lng: -77.028333,\n\t\t\t\t\t\t\t\t\t click: function(e) {\n\t\t\t\t\t\t\t\t\t console.log(e)\n\t\t\t\t\t\t\t\t\t $('#element_coordenada_X').val(e.latLng.lat())\n\t\t\t\t\t\t\t\t\t $('#element_coordenada_Y').val(e.latLng.lng())\n\t\t\t\t\t\t\t\t\t mapEdit.removeMarkers()\n\t\t\t\t\t\t\t\t\t mapEdit.addMarker({\n\t\t\t\t\t\t\t\t\t lat: e.latLng.lat(),\n\t\t\t\t\t\t\t\t\t lng: e.latLng.lng(),\n\t\t\t\t\t\t\t\t\t title: 'Lima',\n\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\tbtnCloseEditPoste.on('click',function(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t$('.editClientElement').submit(function(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t\t\tconsole.log('bvbnmmn')\n\n\t\t\t\t\t\t\t\t\t\tvar el_cliente_id = $('#data_cliente_id')\n\t\t\t\t\t\t\t\t\t\tvar el_codigo_via = $('#data_codigo_via')\n\t\t\t\t\t\t\t\t\t\tvar el_numero_puerta = $('#data_numero_puerta')\n\t\t\t\t\t\t\t\t\t\tvar el_numero_interior = $('#data_numero_interior')\n\t\t\t\t\t\t\t\t\t\tvar el_manzana = $('#data_manzana')\n\t\t\t\t\t\t\t\t\t\tvar el_lote = $('#data_lote')\n\t\t\t\t\t\t\t\t\t\tvar el_coordenada_X = $('#element_coordenada_X')\n\t\t\t\t\t\t\t\t\t\tvar el_coordenada_Y = $('#element_coordenada_Y')\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(el_codigo_via);\n\n\t\t\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\t\tcliente_id: el_cliente_id.val(),\n\t\t\t\t\t\t\t\t\t\t\tcodigo_via: el_codigo_via.val(),\n\t\t\t\t\t\t\t\t\t\t\tnumero_puerta: el_numero_puerta.val(),\n\t\t\t\t\t\t\t\t\t\t\tnumero_interior:el_numero_interior.val(),\n\t\t\t\t\t\t\t\t\t\t\tmanzana:el_manzana.val(),\n\t\t\t\t\t\t\t\t\t\t\tlote:el_lote.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_X: el_coordenada_X.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_Y: el_coordenada_Y.val()\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(data)\n\n\t\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/item/cliente/'+idElement+'?_method=put',\n\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .image').attr('src', res.data.service.imagen_cliente[0].path)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .cliente_id').html(res.data.service.cliente_id)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .nombre_de_cliente').html(res.data.service.nombre_de_cliente)\n\t\t\t\t\t\t\t\t\t\t\tif (res.data.service.type_residencial === true) {\n\t\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .type_residencial').html('Residencial')\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .type_residencial').html('No Residencial')\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// location.reload()\n\t\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// EDICION DE ORDENES DE TIPO CLIENTE, DETALLE REGISTRO DE NUEVO CLIENTE\n\t\t\t\t\t\t\tfunction editOrdenItemClientNew(){\n\t\t\t\t\t\t\t\tconsole.log('RNC')\n\t\t\t\t\t\t\t\tconsole.log(this)\n\t\t\t\t\t\t\t\tvar idElement = this.getAttribute('data-id')\n\t\t\t\t\t\t\t\tconsole.log(idElement)\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/cliente/'+idElement\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tvar elementData = res.data.service\n\t\t\t\t\t\t\t\t\tvar contentTemplateEditPoste = document.createElement('div')\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.setAttribute('class', 'editPosteModal')\n\t\t\t\t\t\t\t\t\tvar template = `<form action=\"\" class=\"editPoste editClientElement\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>REGISTRO DE CLIENTE</h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Caracteristicas</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>ID Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.cliente_id}\" id=\"data_cliente_id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>DIRECCIÓN</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Distrito</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"data_distrito\" value=\"\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Nombre de Vía</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.codigo_via}\" id=\"data_codigo_via\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Número de Puerta</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.numero_puerta}\" id=\"data_numero_puerta\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Puerta Interior</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.numero_interior}\" id=\"data_numero_interior\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Urbanización</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"data_urbanizacion\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Manzana</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.manzana}\" id=\"data_manzana\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Lote</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.lote}\" id=\"data_lote\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Datos</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Nombre de Cliente</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.nombre_de_cliente}\" id=\"data_nombre_de_cliente\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Residencial</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" name=\"\" id=\"data_type_residencial\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option id=\"residencial_true\" value=\"true\">Si</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option id=\"residencial_false\" value=\"false\">No</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Maximetro BT</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"selectBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectBox__select\" name=\"\" id=\"data_is_maximetro_bt\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option id=\"maximetro_true\" value=\"true\">Si</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option id=\"maximetro_false\" value=\"false\">No</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Ubicación</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication_item--map\" style=\"width:100%;height:200px\" id=\"mapsEdits\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada X</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.coordenada_X}\" id=\"element_coordenada_X\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada Y</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" value=\"${elementData.coordenada_Y}\" id=\"element_coordenada_Y\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--buttons\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button class=\"editClienteCancel\">CANCELAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button type=\"submit\">GUARDAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>`\n\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.innerHTML = template\n\t\t\t\t\t\t\t\t\t$('.OrderWork').append(contentTemplateEditPoste)\n\t\t\t\t\t\t\t\t\t// $('#mapsEdit').css('background-image', 'url('+url+')')\n\n\t\t\t\t\t\t\t\t\tvar btnCloseEditPoste = $('.editClienteCancel')\n\t\t\t\t\t\t\t\t\t// btnCloseEditPoste.on('click', closeEditPoste)\n\n\t\t\t\t\t\t\t\t\t// console.log($('#type_service'))\n\t\t\t\t\t\t\t\t\tvar option1 = $('#data_type_residencial option')\n\t\t\t\t\t\t\t\t\tconsole.log($(option1)[0].value)\n\n\t\t\t\t\t\t\t\t\tif (elementData.type_residencial === true) {\n\t\t\t\t\t\t\t\t\t\t$('#residencial_true').attr('selected', 'selected')\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$('#residencial_false').attr('selected', 'selected')\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < $(option1).length; i++) {\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tvar option2 = $('#data_is_maximetro_bt option')\n\t\t\t\t\t\t\t\t\tconsole.log(option2[0].value)\n\n\t\t\t\t\t\t\t\t\tif (elementData.is_maximetro_bt === true) {\n\t\t\t\t\t\t\t\t\t\t$('#maximetro_true').attr('selected', 'selected')\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$('#maximetro_false').attr('selected', 'selected')\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tmapEdit = new GMaps({\n\t\t\t\t\t\t\t\t\t div: '#mapsEdits',\n\t\t\t\t\t\t\t\t\t zoom: 11,\n\t\t\t\t\t\t\t\t\t lat: -12.043333,\n\t\t\t\t\t\t\t\t\t lng: -77.028333,\n\t\t\t\t\t\t\t\t\t click: function(e) {\n\t\t\t\t\t\t\t\t\t console.log(e)\n\t\t\t\t\t\t\t\t\t $('#element_coordenada_X').val(e.latLng.lat())\n\t\t\t\t\t\t\t\t\t $('#element_coordenada_Y').val(e.latLng.lng())\n\t\t\t\t\t\t\t\t\t mapEdit.removeMarkers()\n\t\t\t\t\t\t\t\t\t mapEdit.addMarker({\n\t\t\t\t\t\t\t\t\t lat: e.latLng.lat(),\n\t\t\t\t\t\t\t\t\t lng: e.latLng.lng(),\n\t\t\t\t\t\t\t\t\t title: 'Lima',\n\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\tbtnCloseEditPoste.on('click',function(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t$('.editClientElement').submit(function(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t\t\tconsole.log('bvbnmmn')\n\n\t\t\t\t\t\t\t\t\t\tvar el_cliente_id = $('#data_cliente_id')\n\t\t\t\t\t\t\t\t\t\tvar el_codigo_via = $('#data_codigo_via')\n\t\t\t\t\t\t\t\t\t\tvar el_numero_puerta = $('#data_numero_puerta')\n\t\t\t\t\t\t\t\t\t\tvar el_numero_interior = $('#data_numero_interior')\n\t\t\t\t\t\t\t\t\t\tvar el_manzana = $('#data_manzana')\n\t\t\t\t\t\t\t\t\t\tvar el_lote = $('#data_lote')\n\t\t\t\t\t\t\t\t\t\tvar el_coordenada_X = $('#element_coordenada_X')\n\t\t\t\t\t\t\t\t\t\tvar el_coordenada_Y = $('#element_coordenada_Y')\n\t\t\t\t\t\t\t\t\t\tvar nombre_de_cliente = $('#data_nombre_de_cliente')\n\t\t\t\t\t\t\t\t\t\tvar type_residencial = $('#data_type_residencial')\n\t\t\t\t\t\t\t\t\t\tvar is_maximetro_bt = $('#data_is_maximetro_bt')\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(el_codigo_via);\n\n\t\t\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\t\tcliente_id: el_cliente_id.val(),\n\t\t\t\t\t\t\t\t\t\t\tcodigo_via: el_codigo_via.val(),\n\t\t\t\t\t\t\t\t\t\t\tnumero_puerta: el_numero_puerta.val(),\n\t\t\t\t\t\t\t\t\t\t\tnumero_interior:el_numero_interior.val(),\n\t\t\t\t\t\t\t\t\t\t\tmanzana:el_manzana.val(),\n\t\t\t\t\t\t\t\t\t\t\tlote:el_lote.val(),\n\t\t\t\t\t\t\t\t\t\t\tnombre_de_cliente: nombre_de_cliente.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_X: el_coordenada_X.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_Y: el_coordenada_Y.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_residencial: type_residencial.val(),\n\t\t\t\t\t\t\t\t\t\t\tis_maximetro_bt: is_maximetro_bt.val()\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(data)\n\n\t\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/item/cliente/'+idElement+'?_method=put',\n\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .image').attr('src', res.data.service.imagen_cliente[0].path)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .cliente_id').html(res.data.service.cliente_id)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .nombre_de_cliente').html(res.data.service.nombre_de_cliente)\n\t\t\t\t\t\t\t\t\t\t\tif (res.data.service.type_residencial === true) {\n\t\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .type_residencial').html('Residencial')\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+idElement+'\"] .type_residencial').html('No Residencial')\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// location.reload()\n\t\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction addSearchElementOrder(){\n\t\t\t\t\t\t\t\tvar cliente_id = $('#codigoCliente')\n\t\t\t\t\t\t\t\tif (cliente_id.val() !== '') {\n\t\t\t\t\t\t\t\t\tconsole.log('XD')\n\t\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\tcode_service: cliente_id.val()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// SE OBTIENE DATOS LOS DATOS DEL SERVICIO BUSCADO\n\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/cliente',\n\t\t\t\t\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t\tif (res.data.status !== 'not_found') {\n\t\t\t\t\t\t\t\t\t\t\tvar type_of_residencial\n\t\t\t\t\t\t\t\t\t\t\tif (res.data.cliente.type_residencial === true) {\n\t\t\t\t\t\t\t\t\t\t\t\ttype_of_residencial = 'Residencial'\n\t\t\t\t\t\t\t\t\t\t\t} else {\t\n\t\t\t\t\t\t\t\t\t\t\t\ttype_of_residencial = 'No Residencial'\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar elementNew = res.data.cliente\n\t\t\t\t\t\t\t\t\t\t\tvar box_Content = $('#contentItems')\n\t\t\t\t\t\t\t\t\t\t\tvar newDiv = document.createElement('div')\n\t\t\t\t\t\t\t\t\t\t\tnewDiv.setAttribute('class', 'EditItem')\n\t\t\t\t\t\t\t\t\t\t\tvar template = `<div class=\"EditItem__image\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ItemPhoto\" style=\"background-image:url(${res.data.cliente.imagen_cliente[0].path})\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"titleHead\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"cliente_id\">${res.data.cliente.cliente_id}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"EditItem__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"nombre_de_cliente\"><strong>${res.data.cliente.nombre_de_cliente}</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p id=\"type_residencial\">${type_of_residencial}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t\t\t\tnewDiv.innerHTML = template\n\t\t\t\t\t\t\t\t\t\t\tbox_Content.append(newDiv)\n\n\t\t\t\t\t\t\t\t\t\t\t// CREACION DE NUEVO CLIENTE\n\t\t\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/add-item/cliente'\n\t\t\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\n\t\t\t\t\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcliente_id:elementNew.cliente_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnumero_cliente:elementNew.numero_cliente,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcodigo_via:elementNew.codigo_via,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnumero_puerta:elementNew.numero_puerta,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnumero_interior:elementNew.numero_interior,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcodigo_localidad:elementNew.codigo_localidad,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmanzana:elementNew.manzana,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlote:elementNew.lote,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnombre_de_cliente:elementNew.nombre_de_cliente,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype_residencial:elementNew.type_residencial,\n\t\t\t\t\t\t\t\t\t\t\t\t\tis_maximetro_bt:elementNew.is_maximetro_bt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuministro_derecha:elementNew.suministro_derecha,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuministro_izquierda:elementNew.suministro_izquierda,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmedidor_derecha:elementNew.medidor_derecha,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmedidor_izquierda:elementNew.medidor_izquierda,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnumero_poste_cercano:elementNew.numero_poste_cercano,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype_conexion:elementNew.type_conexion,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype_acometida:elementNew.type_acometida,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype_cable_acometida:elementNew.type_cable_acometida,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcalibre_cable_acometida:elementNew.calibre_cable_acometida,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcalibre_cable_matriz:elementNew.calibre_cable_matriz,\n\t\t\t\t\t\t\t\t\t\t\t\t\tobservaciones:elementNew.observaciones,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfecha_ejecucion:elementNew.fecha_ejecucion,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcoordenada_X:elementNew.coordenada_X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcoordenada_Y:elementNew.coordenada_Y,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t// EDICION DE CLIENTE NUEVO CREADO RECIENTEMENTE\n\t\t\t\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/item/cliente/'+res.data.service._id+'?_method=put',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t\t\t\t\t})\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('No se encontraron los datos nesarios')\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tconsole.log('ingrese codigo de poste')\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// RELLENADO DE INFORMACION DE TIPO DE DETALLE DE SERVICIO\n\t\t\t\t\t\t\tvar order_type_service\n\t\t\t\t\t\t\tif (item.detalle_servicio === 'Verificar Direccion de Cliente') {\n\t\t\t\t\t\t\t\titem.detalle_servicio = 'detalle_servicio_VC'\n\t\t\t\t\t\t\t} else if (item.detalle_servicio === 'Registro de Direccion') {\n\t\t\t\t\t\t\t\titem.detalle_servicio = 'detalle_servicio_RD'\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\titem.detalle_servicio = 'detalle_servicio_RCN'\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (var i = 0; i < $('#detail_service option').length; i++) {\n\t\t\t\t\t\t\t\tvar option = $('#detail_service option')[i]\n\t\t\t\t\t\t\t\tconsole.log('Esto es un form :D', item.detalle_servicio, option.value)\n\t\t\t\t\t\t\t\tif (option.value === item.detalle_servicio) {\n\t\t\t\t\t\t\t\t\tconsole.log('los datos estan aqui!',option.value, item.detalle_servicio)\n\t\t\t\t\t\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (var i = 0; i < $('#priority option').length; i++) {\n\t\t\t\t\t\t\t\tvar option = $('#priority option')[i]\n\t\t\t\t\t\t\t\tif ($(option)[0].value === item.tipo_urgencia) {\n\t\t\t\t\t\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (item.public === true) {\n\t\t\t\t\t\t\t\tdocument.getElementById('true').checked = true\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.getElementById('false').checked = true\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar sendEditOrder = $('.EditPoste__containner')\n\n\t\t\t\t\t\t\tsendEditOrder.submit(function(ev){\n\t\t\t\t\t\t\t\tvar cod_contr = $('#codigo_contratista')\n\t\t\t\t\t\t\t\tvar cod_super = $('#codigo_supervisor')\n\t\t\t\t\t\t\t\tvar urgency = $('#priority')\n\t\t\t\t\t\t\t\tvar direccion = $('#direccion')\n\t\t\t\t\t\t\t\tvar descripcion = $('#descripcion')\n\t\t\t\t\t\t\t\tvar fecha_visita_esperada = $('#date')\n\t\t\t\t\t\t\t\tvar public = $(\"[name='public']:checked\")\n\n\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\tcodigo_supervisor: cod_contr.val(),\n\t\t\t\t\t\t\t\t\tcodigo_contratista: cod_super.val(),\n\t\t\t\t\t\t\t\t\ttipo_urgencia: urgency.val(),\n\t\t\t\t\t\t\t\t\tdireccion: direccion.val(),\n\t\t\t\t\t\t\t\t\tdescripcion: descripcion.val(),\n\t\t\t\t\t\t\t\t\tfecha_visita_esperada: fecha_visita_esperada.val(),\n\t\t\t\t\t\t\t\t\tpublic:public.val()\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconsole.log(data)\n\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl:'/dashboard/ordenes_trabajo/'+order+'?_method=put',\n\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t$('#closeEditOrder').on('click', function(ev){\n\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t$('.EditPoste').remove()\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tvar mapEdit = new GMaps({\n\t\t\t\t\t\t\t div: '#mapEdit',\n\t\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t\t lng: item.coordenada_Y\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t// mapEdit.markers\n\t\t\t\t\t\t\tmapEdit.addMarker({\n\t\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t\t lng: item.coordenada_Y,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar url = GMaps.staticMapURL({\n\t\t\t\t\t\t size: [800, 400],\n\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t lng: item.coordenada_Y,\n\t\t\t\t\t\t markers: [\n\t\t\t\t\t\t {lat: item.coordenada_X, lng: item.coordenada_Y}\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$('#mapStatic').css('background-image', 'url('+url+')')\n\n\t\t\t\t\t\tif (item.tipo_urgencia === 'tipo_urgencia_M') {\n\t\t\t\t\t\t\t$('#urgency').html('Media')\n\t\t\t\t\t\t} else if(item.tipo_urgencia === 'tipo_urgencia_A'){\n\t\t\t\t\t\t\t$('#urgency').html('Alta')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('#urgency').html('Baja')\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (item.public === true ) {\n\t\t\t\t\t\t\t$('#privacity').html('Público')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('#privacity').html('No Público')\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.back').on('click', function(){\n\t\t\t\t\t\t\t// $('.OrderWork__left').css('overflow-y', 'scroll')\n\t\t\t\t\t\t\t$('.OrderWork__left').css('overflow', 'auto')\n\t\t\t\t\t\t\tmap.removeMarkers()\n\t\t\t\t\t\t\t$('.InfoContainner').remove()\n\t\t\t\t\t\t\tmap.zoomOut(4)\n\t\t\t\t\t\t\tmarkerOrders()\n\t\t\t\t\t\t})\n\t\t\t\t\t}", "function addOverlay() {\n logger('function addOverlay is called');\n NEWLayer.prototype = new gmap.OverlayView();\n function NEWLayer() {\n this.div = null;\n this.startcenter = null;\n this.setMap(map);\n }\n\n NEWLayer.prototype.onAdd = function () {\n var self = this;\n self.startcenter = this.getProjection().fromLatLngToDivPixel(map.getCenter());\n var wrapper = document.createElement('div');\n var menu = document.createElement('menu');\n $(menu).addClass('menu');\n $(menu).append('i am menu');\n var div = document.createElement('div');\n $(div).addClass('searchbar sidebar right');\n $(div).attr('id', 'searchbar');\n $(div).append('<div class=\"searchlist\" data-bind=\"component: \\'searchlist\\'\"></div>');\n $(div).append('<div class=\"pager\" data-bind=\"component: \\'pager\\'\"></div>');\n $(div).append('<div class=\"wikirelevant\"></div>');\n $(wrapper).append($(menu)).append($(div));\n self.div = $(wrapper)[0];\n var searchlist = container.getInstance('searchlist');\n ko.applyBindings(searchlist.viewModel, self.div);\n self.getPanes().overlayMouseTarget.appendChild(self.div);\n\n var isidebar = sidebar('menu',$('.menu')).sidebar('bar', $('.sidebar')).sidebar('icon', '<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAgAElEQVR4Xu2dCdh2VVnv/2kKaB4k6ZwyE8Ep9Zho5VCe0GNXWqI4DzkgqTkLOA85K2pWQll5mnDCjBAEw1lQsMkhxRxKU8RSM0XUTFIczvWHveH5vu9932c/e++1133v/VvX9V7vB+/ea/it9Tz7v9e6hx8QBQIQgAAEIACBxRH4gcWNmAFDAAIQgAAEICAEAItg7gSuJemAkQb57pHqoRoIQAAC1QkgAKpPAR3YkMDBkvaV5N9Xbe71Q94/Lv5//lvp8lVJH1pp5F0r//b/99/Pk/SZ0h2hfghAAAJ9CCAA+lDjnpIEdn/Atw/61Qd+yfZL1N0Kgt1/n9MIhRJtUicEIACBHQkgAFggtQj4Tf0mkm7TvL37Dd7/XlppdxK8g+DdAouC1Z2FpfFgvBCAwEQEEAATgV54M364H9I86P2Qz/w2P9VUWgT4x6LA4gD7g6nI0w4EFkIAAbCQiZ54mH7A+4HfPuzb8/mJuzG75iwELApaQeDdAwoEIACBXgQQAL2wcdNuBNqHvR/4S9zGr7Ug2t2BVhBgcFhrJmgXAgkJIAASTlqALvuN/rDmYX+XAP2hC5cQsAB4Q7NDcCpQIAABCOxEAAHA+uhKYPWBz5Z+V2p1r1sVA+wO1J0LWodAOAIIgHBTEqZDttL3Q99v+Lzlh5mW3h1pdwdeiZdBb4bcCIFZEUAAzGo6Bw+Gh/5ghCkqQAykmCY6CYGyBBAAZflmqJ2HfoZZKtdHxEA5ttQMgdAEEAChp6do57y9/yC294syzla5xcArJPmYAJuBbLNHfyGwIQEEwIbAkl9u473Dmwc/hnzJJ7Nw921A6B+LAQoEIDBDAgiAGU7qFkPyQx9jvmXM9dijdLAh7wocx67A2GipDwJ1CSAA6vIv2brf8I9s3vbbrHkl26Pu+RNwwKH2iGD+o2WEEJg5AQTA/CbYkfj84Md1b35zG2VE3hU4ttkVIBxxlFmhHxDYkAACYENggS9vz/YJxRt4kmbWNT/8bSfwHI4HZjazDGcRBBAAuafZW/t+8B/VZNrLPRp6n5lAezTgYwIKBCCQgAACIMEkbdFFP/i9ze8HP+f7Oedwrr22APDxALkI5jrDjGs2BBAAuaaSB3+u+Vpyb522+OgmMdGSOTB2CIQlgAAIOzW7dIwHf455opd7EvCOgG0EOBpgdUAgGAEEQLAJ2a07PPhjzw+9604AIdCdFVdCYBICCIBJMG/cCA/+jZFxQxICCIEkE0U3508AARBvjm3VbyMqjPvizQ09Go+A3QdtI0DOgfGYUhMENiKAANgIV9GL7b//LEn48RfFTOXBCDybgELBZoTuLIYAAqD+VDtkrx/8zsxHgcASCTigkF1aSTy0xNlnzNUIIACqob94ix9f/nr8aTkeAewD4s0JPZoxAQRAncl1nP6XEr2vDnxaDU/AUQUJLxx+muhgdgIIgGln0Nv9x3POPy10WktJwMcCrX1AygHQaQhEJ4AAmG6GvN3vLzSs+6djTkv5CfhY4Ai8BfJPJCOIRwABUH5ODm62+7HuL8+aFuZLwOLZxwIUCEBgJAIIgJFAblONrfv9xUWZjsA5ktoc9fYx38rP3H93rPrtindpLNy2KqtCztfsO93QFt+S58y7ATvN3eIhAQACXQkgALqS2uw6PyR81u8zf8p4BNqHux8A7UPcvyPEmfdcr/5YHLRCApEw3hpwTQ6U5d2AVuiNWzu1QWAhBBAA4080b/3Dmb67eXP3g779yf5lb0FggeDfFoj+9wHDUS22BnYDFjv1DHwsAgiAsUhe8oV+yg5bx+O1NJ+avtY84P0G3z7olxYa1mKgFQf+903mM72TjATbgEkw08gcCSAAxplVR/GzXz8W/jvzPK/ZrvfDvn3ojzMD86mlPTawGPDPIfMZWrGR4ClQDC0Vz5kAAmDY7PrL2mf9DuxD2ZNA+8B34hc/9Jf2dj/Wmmh3CbzOEARbU/URkQ0EvdYoEIBABwIIgA6QtrkEQ7+twfj83l/CvOH3X1s73WnR6bVnMeDf2BHsSstRBJ1lMLvNSJnVQ60QWCGAAOi3HDD0u4ybz/H9wG8f+nzx9ltTfe9qjQp9DIX9wCUUMRDsu5q4b1EEEACbTTdb/pfwWn3os+W62RoqebUNUb0zgBi4ZAfAOwHeEaBAAAJbEEAAdF8WftOylf9Sfft56HdfKxGuRAxcMguOGWAhQIEABHYjgADotiSWbOXvM32/RfEm1W2tRLzKYuCoZmdgiUGJbI9yV+wCIi5N+lSTAAJgPX279/nLc0nFb/t+4PvtCcv9ec28xayPCQ6b17DWjsZHArcljPBaTlywIAIIgO0n2+f9Zy4ssM+pzYOfc/35fwl4V8BiwD9L8iSwqyC7WfNf34ywAwEEwNaQfN7vh/8SAvu0Z/uOqMbbfocPzQwvsQjwLtdSvAgsACwEKBBYNAEEwJ7Tb99qG/vN/eHvB7+3+P2D696ivwYuHbzXvoXAEo4HvMtlEcDaZ+0vlgACYNep95uQI/vNuTg6n9/22Qad8ywPG5uPB7xGDh9WTfi7HS/AdgGIgPBTRQdLEEAAXEZ17sZ+TqXrL3XO90t8kuZZp3fBvCPgn7l6D/jYyx4CFgMUCCyKAALgkun2W7/f/udYeOOf46xOOyYLAR8VzXVHwDsAFgF2F6RAYDEEli4A5mzpz4N/MR/jyQY696MBPAQmW0o0FIHAkgXAXB/+PPgjfLLm3Yc5CwFEwLzXLqNbIbBUAeAvMFv6291vLqW16vc5PwUCUxDw58dHA3NLUUz44ClWD21UJ7BEATBHH/9XNoZaS7VmXl3HPyjphyX594GSfqgJdPM/Jfm6y0u6pqQrrnz6vt9Ygn9M0t9gELbx95IjC/qhOaeAQsQK2HgZcEM2AksTAHN7+DtOvy20l2LBfDlJ12se3leQ9L+b5Ez7S7qxpOs0D3yv6+9J8vX+7Wuv3PHD+S1JFlQvkPTZjvdw2SUEvPs0J48BRAAre9YEliQA5vTwX8o5vx/qN5B0o+Zt/mrN2/0tmrf5kh9Ou4fdU9L7SzYyw7rn5jGACJjhImVIlxBYigCY08P/uOZNa07b/VeR5If7QZJuJun/Srp58yH1Vr3/XqNYBLgv59ZoPHmbjiroh+ccjgUQAckXI93fmsASBMBcHv5+63esgrn4KvvB8AuSfrrZ1v9ZSd7Kj1b+TNKDo3UqSX/aQELPStLfnbrpz52jBlIgMBsCcxcAc3n4P6d568+68PwG7zf560s6tBEyNrzbR9J+wQf1nWY34oPB+xm5e/4c+i06e7IhdgIirzL6tjGBOQuAOTz8sxv5+e3ehnl3lnQ7Sf9r4xUa44anSHpxjK6k7sUcjAQRAamXIJ1fJTBXATCHh3/Gt/69m218u4X5uOJHGpe77J86vvTHm8E57AawHsZbD9RUkcAcBUD2h7/P+v0AzeTa91ONO94Dm77b135O5WRJd5/TgAKMxbsBmW0DEAEBFhFdGEZgbgLARke22PbvjCVTQB/71t9a0q9J+vnGTS8j8y59fomkJ3W5kGs2IpDdUwARsNF0c3E0AnMSAJlj+zuMr7fMo6fqdXQ9G/LdvsmeZgEw92IjwIc0wYHmPtYa4/Pn1g/Sw2o0PkKb5A4YASJV1CEwFwGQ+eFvQz8//O1zHrV4nfySpEdKulVzth+1r2P369NNxMELx66Y+nYh4M+Awwnvm5ALIiDhpNHl+QQCOlOStxOzFQf1cejUqMUx9e/Y+MH7bX9uZ/tduPuI4/guF3LNYAK23/EuWMbgQXdNsIM3eIKoYF4E5rAD4C9nvz1kKt7y94PfW58RiyPy3UvS3STdtEmsE7Gfpfv0/yTZBXBOURdLMxtaf9YjAa8RBwrKZLw7dK64PzmB7ALAD9GXJpuDcxrBEvGL4uqSHtBYZztIz1LLlyS9WtLTJDk5EGV6Ahm9BCwCnIESwTj9eqHFHgQyCwC/9Wfbmj21efhH+4Jwhj3ztCHWDXuso2y3OAphW1Y/A5+X9NZmZ+asbIOaYX/tDutdskx2ARb23gmI9hmf4fJgSEMJZBUAPivMFpo1YmCfH5VkAya/6f7Q0MVU+f6vS/qPJv2vH/DflPQvzRexYyv4//nHX9AXrfTV/88GmP/VvO3/tyQM/ipP5krz12rO1jOFESZvQJz1Q092IJBRAGQM9BPNStg+/A+T9LiE/vt+YH9O0t9I+qKkT0o6X9IFzW8fsbBtP6+vPdsF+KGaSQQQI2Bea3CWo8kmALK5+9nYz9uYUTL4+Vz/FyV5N+Lakv5H4FX9leZN/QuS3ivJD/Z/kORtevvmWwj4b5TlEPBD9fBEwz26cW1M1GW6uiQC2QTAKc0DNcMcRQvpe0tJT20S80TlZ5/7jzTb9P8kyTES/MCnQKAlkM040PYAUV4AWEUQ2IVAJgGQ6YPvt1XHJYhgCLSXpN9s3Pp85h+pfEPSByS9UdLZkr7cPPB9Dk+BwHYEMhkA4xnAOg5LIIsA8Da63/4zlCiW/vtL+hVJT2wi2UVhZ+PNf5V0uqS/k/ThKB2jH6kIWGA7aFAGDwEbnjqeBgUCoQhkEAC2AvZDI0OCHyfzqR2UyHPq8/3fk3SHAKvN5/U+q3+dJLvWfUySt/opEBhKwAbB3l7PIAIwChw629w/OoHoAiCT0V+Eh39r3f/8AF+KPsP/hKTXSDqpMdobfQFT4eIJZBIB0byBFr94lg4gugDIEuY3wsP/5pJeIMnGfrV8+v22b8O9V0n628ZFb+mfMcZfnkAWEUC44PJrgRY2IBBZAGQJ81v74X+1Jnzv4yVdY4O5H/NSB9w5UdJrJX28CcYzZv3UBYF1BLKIAAedsj1ABAPhdUz5+8wJRBUAWYL91I7u5xC+L5LkTGQ1irf5f1/SmyV9qkYHaBMCKwSyBAyy8WKtzywLBgKXEogqAGz0ZxEQudRM5bu3pJ+RdJqk/SaG5EQ5NuRz7vY3Sfpu8zNxN2gOAlsSsAiw1X30lMLYA7CAqxOIKAD8YDmyOpmdO1Bz299+/X7rdyjfKTP2+UHvDHk+3z8z+PzQvWUTyHAc4CMAHwX4SIACgSoEogkA+/ZGf7jUfPg7dO/bJN1Y0pUmWjGOsW9/fdsYnCuJID0TgaeZQQQyiADiAwyaYm4eSiCSAPDWnR8wkf39az787ynpWZJuNHTSO97vN34fMbxM0hkd7+EyCEQikEEE1LYjijRf9GViApEEQPQ4/7Ue/j7v99u3I/pNEfDEaXH/UdLTJb1P0n9OvCZpDgJjEsggAsgXMOaMU1dnAlEEQHSXP/u2+3hi6mK3Pr/1P2Sihp1178WSTp6oPZqBwBQELAJsWBy14BoYdWZm3q8IAiB6qN9aiX2uK8m7DreaYA36rf+Fkl4u6fwJ2qMJCExNIHoCoVo7jFPPA+0FIhBBANjor8bbdZdp+Frjjji1pe7/keTY4Qd16eTAaxzA5xhJFjoUCMyZQPSMohwFzHn1BRxbbQEQWZX74W9hYkvdqcrlJDnzoRP5XL1go9+T5CA+z5P0dt76C5Km6mgELKwPj9appj8cBQSdmLl2q6YAiG7170hdjtg1VbmiJAcHcRwEG/6VKt+Q9CeSnibpwlKNUC8EAhNwBsFDgvavZoCxoEjoVikCNQVAZKv/qaN0+eH/OEnPleSMfqWKE/TYm8B+/Xbzo0BgiQSihwx2gKApdx6XuAYYs6RaAsDb3BYAEcvUxjhXbrL4PbLww/93mwiCX4gInT5BYGICNj72Q3YK19pNh0aAoE2JcX0vAjUEgNW3XXL8AYxWbAg3ZQ4Ch/X1g/nBki5fCMZHJP22pNfj01+IMNVmJRA58igBgrKuqkT9riEAosb6t9GfRclUaTod1vclkh5Y6Mzf4/CWv48WbPBHgQAE9iQQNQYJuQJYrcUJTC0AIgfkmPLczW/+FkK/LsmW/2MXG/rZyO8POOsfGy31zZCAjX0PCzguGyvaNZACgSIEphYAUX3+j24eyEUg71ap3/wddMdv/j9UoMEvNl9mPmb5doH6qRICcyMQ2SiQ2ABzW22BxjOlAIjq8z+l0Z+t/X0eb4O/Em/+ZzVhgz8ZaI3RFQhkIBA1Z4BjAxyYASB9zEdgKgEQ1fBvyjC/ftv/rebNf58CS8W+/b8hyTsAFAhAYHMCUb2TMAjcfC65owOBqQRAxBCcU0b6s2+/H/6PLvDm7wf+iyT9vqSLOsw5l0AAAtsTiBgp0AaB3gWYykCZ9bEQAlMIgKjJfqY697fBny2NHeTHRwBjlvMkPVzSW8aslLogsGAC3q20H/4BwRhMeVQZbOh0pxSBKQRAREU9VXpfn/P7AW2L/7Ej/P2DpCdJemepxUG9EFgogajeSlN6Ki106pc17NICIGKgjan8/dvEPq+V5F2AMcv7m+BBHx6zUuqCAAQuJRDx2BK3QBboqARKC4CIbn9TJflxSt83FXD1e2tzpEBwn1E/ClQGgT0IREwahFsgC3U0AiUFQMS3/6kybd1Q0l8VcN/xWf+vSSKe/2gfASqCwLYEIuYLwC2QBTsagZICINrbvw3mfLZX2pLW1rqvkfRzo82S9PXG0M85AxzljwIBCExDIGKo4KmzlU5DmlYmJ1BKAEQM+jPF1tnekl7WnM+POZl/Kumhkr4/ZqXUBQEIdCIQ7SiAXYBO08ZF6wiUEgDnBsv2d6okB/koXRyw45kjN3KSpPtL+tbI9VIdBCDQjUDEowB2AbrNHVftQKCEAIj29j+V1b8f0k7tu9+IK+50SQ+T9LkR66QqCEBgcwLRvALYBdh8DrljNwIlBEC0t/8prP5t9PeXkvx7rPJmSfeQ9M2xKqQeCEBgEAEHCLrJoBrGvZldgHF5Lq62sQVAtLf/KQL+2MffZ4S3HHH12IPAb/6fH7FOqoIABIYRiBYgiF2AYfO5+LvHFgCR3v699e8PrD8kpYqT+rygycB3lZEasZ//vSW5/xQIQCAWgWhHAewCxFofqXozpgCI9vY/RQate0p6lSRb/49RHN7XH2gi/I1BkzogMD4B5wrwS8W+41fdq0Z2AXph4yYTGFMARPL7n8Ln//qS/nZEoz/32Q9/c6RAAAJxCUR72ZnCzinubNCz3gTGEgDRov6V3hazpf8fNUZ6veGv3OiUvk9oAgiNUR91QAACZQlEMggkR0DZuZ5t7WMJgDdIOiwIpSkM/x4ryWGFxyqPl/Q7Y1VGPRCAQHEC0V56pgh0VhwqDUxLYAwB4CAZNv6LUkqnzLy5pNdLusZIA/ZOwqMlXTRSfVQDAQhMQyDSi88rJfloggKBzgTGEACvkHR45xbLXlj6Q3CFJsnPL400jJMlPVKSjwAoEIBALgLRXn6ch6Sk11Ou2aG3awkMFQC2iL1gbSvTXDCF29+jJL1Y0pVHGJIf+k4Y9OkR6qIKCECgDoFIboGlX4DqEKbVYgSGCoBIi7+0298NGqv/Mdx/nNHvFyR9sNjMUjEEIDAFgUhugc506l2A0hlPp+BKGxMQGCoA/PbvD0DtUjre//6Sjpd06AgDdV9f0vx8e4T6qAICEKhLINKL0NGSjq2Lg9azEBgiAJxd75QgAy399v+rkk4YaaxnSLq9pO+MVB/VQAACdQlE2gUgMFDdtZCq9SECIIoFbOm3f4f4dcCfG40ws/Ydvo+kfx6hLqqAAATiEIi0C4BLYJx1EbonfQVAJOvX0m//9ve33//Q8qXG3e/EoRVxPwQgEI5ApF0AjAHDLY+YHeorAKKo3dJv/079eZqka44wfT6X8/kcBQIQmCeBKN+LputopRgDznOdjTaqvgIgSta/0m//Din8ZyPQ9hHCnSSdP0JdVAEBCMQkEGkXAGPAmGskVK/6CIAoxn+l3/49Ufb5f9LAGbPLn70HHKKYAgEIzJtAlF0A2xs5KioFAtsS6CMAohj/TXHONYYAcKhfBxDC6p8PIgTmTyBScLTSYdHnP5szH+GmAiCS8d8UYS/tr+8sfX3LvzQBf77QtwLugwAE0hGIEh59ipekdJNDhy8jsKkAOErSSwMAnGphO8eBP8x9i5NzuK8UCEBgOQSivCjZCNDGgBQIbElgUwHg0LUHB2A5lZ+rt9DsBdAn899Jkh4h6csBeNEFCEBgWgLvknTItE1u2dpdJfnYlgKBPQhsIgCiqFob0zkX91TF7ntHbtiYDf9uKemjG97H5RCAwDwI+DvqzABDmWq3NMBQ6cKmBDYRAFG2/+2aN2RbflNGP9KEPP75jjc6vv8dJb2j4/VcBgEIzJOALfEdS6Rm4RigJv3gbW8iACJs/9v1r0byoatLerukn5R0uR3m9CuSnizptZK+GXzu6R4EIFCWgG2AnESsduEYoPYMBG2/qwCIsv3vsLzeiahRbExz3+bn1rt14FPNdt/LJX2gRudoEwIQCEcgikvgqZIcv4UCgV0IdBUAUbb/p3D9W7dEriZp35WtPWff+qKkz6+7kb9DAAKLIxDFJZDQwItbeusH3FUARNj+n9r4bz09roAABCCwM4EoxoBT206xLhIQ6CIAomz/s4ATLCi6CAEI7EHAu4QHVObCMUDlCYjYfBcBEGH7v5bxX8Q5o08QgEAuAhG+Q02sy/d9LrL0dhCBLgsiQkCLmsZ/gwBzMwQgsHgCUYwB8QZY/FLcFcA6ARBl4ZLUgoULAQhkJhAhiRovUplXUIG+rxMAEVL/nifJdggUCEAAAlkJRIgJYFsEe1JRIHAxgXUCIIILC6qVxQoBCGQnEGU3NYIrdfa5nE3/1wmAcwO8fbP9P5vlxkAgsGgCEY4B8KZa9BLcdfA7CQBn/bP/f83C9n9N+rQNAQiMSSDCMQDugGPOaPK6dhIAEVxX2P5PvsDoPgQgcCmBCMcAJAdiQV5KYCcBEMH9j+1/FisEIDAnAhHsqm4ryd/vlIUT2EkAfL8yG7b/K08AzUMAAqMTiOBZ9RxJzx59ZFSYjsB2AiBC/Gq2/9MtJzoMAQisIRDhGIC8KizTiwlsJwCsDp9VmRFRqypPAM1DAAJFCHxoJZtokQY6VLrOA6xDFVySncB2iyCCuwoLNPvqov8QgMBWBCK8YGEHwNrcdgfgAkneqqpVcFWpRZ52IQCB0gQiuFgfLenY0gOl/tgEtnrLZnHGnjN6BwEI5Cdgd7x9Kw6Dl6yK8KM0vZUAiBCsgnCVUVYI/YAABEoQqO0OSDyAErOarM6tBEDthYn7X7JFRHchAIGNCfCitTEybhibwFYCoHb8/1dK8oeDAgEIQGCuBCK4A5IXYK6rq+O4dhcALMqO4LgMAhCAwEACTs97wMA6htzOy9YQejO4d3cBECEAUOnz//0kHS7p/0jaW5IjHn5X0kck+QPxiRnMK0OAAATiE6h93EpAoPhrpGgPdxcAtRMAfa2g++HlJN1Pkt1fnGNgq/Lvkvyh/G1JXy5KnsohAIGlE4hgB0C8lQWvwt0nv7YiLeWa4nG+UNLjJF2hw3y/TpLF0Bc7XMslEIAABPoQiOByXXrHtQ8X7pmIwO4CoHYGwFLBKe4s6URJe23A9XclvUDSf2xwD5dCAAIQ2IRA7XgAhFzfZLZmdu3uAqB2BsAS4SmvKMmeDVfvMXc/K+n9Pe7jFghAAAJdCNQOu05mwC6zNNNrVgVAhO2oEudR95X0Z43B36bT6CMRu8pQIAABCJQgUDsvQKlj1xKsqHNkAqsP3Np5qktZpL5c0sN6cvsHSb8oybkRKBCAAATGJlDb88quiLYDoCyQwKoAqK1ES/ik2uDvHEk36Dm3NgI8TNLf97yf2yAAAQjsRCBC7JUSO6/MegICqxNf+yyqhAHgQZL+qaPl/1bT5fN/7x54J4ACAQhAoASB2oaAJWyvSnCizpEJrAqAD0qyHUCtUmIR/pqkPx0woPdJuvmA+7kVAhCAwDoCtb2vCAm8boZm+vdVAVDbA8AR+qyExyx25XvMgApPknTPAfdzKwQgAIF1BI6VdOS6iwr+HU+AgnAjV90KgNrnUCUiAF5Z0gnNGX7fOXhCExWw7/3cBwEIQGAdgdoRAUvYX60bM38PQKAVALUtUUt4AFjU2P/fv/uWG0n6WN+buQ8CEIBABwJz/P7tMGwuqU2gFQC1XQBLbEHdQtLfDQB8niR/MO0mQ4EABCBQkkDNI1hcAUvObOC6WwFQ2wWwhAfA4yX91gD2b5d0B0nfG1AHt0IAAhDoQqB2amBcAbvM0syuaSe9thFKCQ+AP5H04AHz9RJJTxpwP7dCAAIQ6EqgticASYG6ztSMrmsFQO3F5/S8HxqZ61sl/dKAOh8o6dUD7udWCEAAAl0J1M7EWuIlrOvYua4SgVYA2FjuWpX64GbH3n46QNKfS7rVgDHtL+n8AfdzKwQgAIGuBGofwxILoOtMzei69sFb0wClhAugIwB+asA8fUDS7REAAwhyKwQgsAmB2q6AJQyxNxk/11YgEEEAlHABvJ2kdwzgebKkuw+4n1shAAEIbEKgtisgAmCT2ZrJtRYAtdMAlwhC4QA+NuLrW142MIJg33a5DwIQWCYBH8H6KLZWKfEiVmsstNuRgAXAHJXnH0p6eEcGW13msJwOI0yBAAQgMBWBmkexCICpZjlQO3MVAG+S9Ms9OX9H0gMkva7n/dwGAQhAoA+BmlkBEQB9Ziz5PRYAtY1PSrif/LWkn+s5NxdJcgjgT/a8n9sgAAEI9CFQ0x3b4sMJ2SgLImABUNv9pIQAOFvSrXvOowWAPwj/1fN+boMABCDQh0BNAeD+ju2O3YcB90xIYI4CwEGFXi7p5j05/ruka0v6Zs/7uQ0CEIBAHwIIgD7UuKc3AQuA2mGA/bbt7aexys9Ieo+kvXpW+HFJPy3pwp73cxsEIACBPgRq78YSDrjPrCW+xwJgbqrzlpL+dsCcOAnQ3SR9Y0Ad3AoBCEBgUwK1BUCJ49hNGXD9hATmKAB89m8bgL7leEkPIQtgX3zcBwEI9CSAAL9hMFoAACAASURBVOgJjtv6EagtAM4rkIPAZ/9/3w/HxXcdJ+moAfdzKwQgAIE+BObokdWHA/dMRKC2ACjhe3pIc6zRFyECoC857oMABIYQqB2UjSOAIbOX8F4EwJ6ThgBIuJDpMgRmQAABMINJzDQEBAACINN6pa8QmDOB2gLg6MYrbM6MGdsKAQuACyRdtRKVEkcAvyDJ9fYtz5f0jL43cx8EIACBngRqCwAyAvacuKy3WQDMLQHFUCPAJ0v6zawTSr8hAIG0BBAAaacuZ8fnKABuIunVkm7cY0q+JenBkk7ocS+3QAACEBhCAAEwhB73bkxgjgLAED4g6WYb07gk+M+PEQSoBzlugQAEhhJAAAwlyP0bEZirALizpFM3InHJxQ6LbEMYCgQgAIGpCRws6YNTN7rSHjYAFeHXaHquAmB/SS9sIvp15fo+SUdI+mjXG7gOAhCAwMgEatpkIQBGnszo1c1VAJj7j0t6saT7dZiEv5P0BEl/3eFaLoEABCBQggBHACWoUue2BOYsADxouzd6S98hNq+5BYWLJJ3YCIV/ZJ1AAAIQqEgAAVAR/hKbnrsAaOf0RyTZLsAeAteS9EVJ/9w8/L8gyUKAAgEIQKAmAQRATfoLbHspAmCBU8uQIQCBZAQQAMkmLHt3LQA+I+mASgMpEQmw0lBoFgIQgMAgAgiAQfi4eVMCc8wFsCkDrocABCAQgUBtAWAvqFdEAEEfpiGAAJiGM61AAAIQWEegtgAgHfC6GZrZ3xEAM5tQhgMBCKQlgABIO3U5O15bAHxV0n450dFrCEAAAqMSsLvy8aPWuFll7ABsxiv91bUFgAG6DxQIQAACSyfwbEnPqggBAVARfo2mEQA1qNMmBCAAgT0JIABYFZMSsACovegObFwRJx04jUEAAhAIRsDJyI6s2Ccfx/pYlrIQAhEEANtOC1lsDBMCENiRwLskHVKREcexFeHXaBoBUIM6bUIAAhDYkwACgFUxKQELgLtIOmXSVndt7K6S3lCxfZqGAAQgEIFATQFwXpMnJQIH+jARAQuA2r6n5KCeaLJpBgIQCE3g+xV7R1j2ivBrNY0AqEWediEAAQjsSgABwIqYlIAFgNPjnjtpq7s2dmpzDFGxCzQNAQhAoCqBgyV9sGIP+B6uCL9W063VJ8qz1gzQLgQgAAGOYlkDFQhEEACEA64w8TQJAQiEInCUpJdW7BG2WBXh12q6FQAfknSTWp0gHHBF8jQNAQhEIFA7IBveWBFWwcR9aAVATfcTD5lgQBNPPM1BAAKhCNgV+rCKPeI7uCL8Wk23AqB2CEoWX60VQLsQgEAEArVfwggDHGEVTNyHVgDU3n7i/Gniiac5CEAgFIELJF21Yo8IA1wRfq2m20mvHQzoOEk2gqFAAAIQWBoBP/gtAGqVcyTZDZGyMAJRBABRqBa28BguBCBwKYHaL2B8/y50Ma5u+9SMBYAr4EIXIMOGAAQu3v2s6QLIDuxCF2EUAWD8B0r6zELngWFDAALLJVDbCBsbrIWuvVUBUNsKFU+AhS5Chg2BhROo/d1LDICFLsBVAVDbDxUVutBFyLAhsHACNY9fjf6mkhwMjrIwAqsCoLYrIMkoFrb4GC4EIFA9GZunABfAhS7E1YmvbYlqBWolSoEABCCwFAJ3kXRKxcHiAlgRfu2mVwVA7bTAKNHaq4H2IQCBqQnU3nl9paQHTT1o2otBYPetH7vj7VuxaxgCVoRP0xCAwOQEahsAYns1+ZTHaXB3AcBijDM39AQCEJg/gdoGgLx0zX+NbTvC3QVAbX9UIlIteDEydAgsjIDD736w8piJv1J5Amo2v7sAqB2RioiANVcDbUMAAlMSqP19+7XKCYimZE1bWxDYXQDU9gRwF/FJZalCAAJLIFA79go7rktYZTuMcSv/z9pnUkdL8lEEBQIQgMCcCdROAUwOgDmvrg5j20oA2B//Jh3uLXUJAYFKkaVeCEAgCoEIbteEAI6yGir1YysBUNsQEDuASouBZiEAgckI2Pf++Mla27ohDAArT0Dt5rcSABEWJnYAtVcG7UMAAiUJ1D7/P0+6OAwxZcEEthIAEbamCE6x4EXJ0CGwAAK1z/+JALiARbZuiNslgfiMpAPW3Vzw7+QFKAiXqiEAgaoEInhbYWxddQnEaHw7AfAKSYdX7uJ+kmwPQIEABCAwJwK17azMkmPWOa2onmPZTgDUDlDh4RwhyUKEAgEIQGBOBBz9z1EAaxUCANUiH6zd7QRAhBCVnFEFWyx0BwIQGEwggo0VAYAGT+M8KthOAHh0tTMD4g44jzXGKCAAgcsIRPCywsiaFXkxgZ0EQG03FfePTFUsVAhAYE4EInyvcv4/pxU1YCw7CYAISpVjgAGTy60QgEAoAleVZPe/moXz/5r0g7W9kwCIcFbFMUCwBUN3IACB3gR4qeqNjhtLENhJALi92nkB3AfiVZeYeeqEAASmJhBh+x/vqqlnPXB76wRABH9VjgECLyC6BgEIdCIQYUfVHSW+SqfpWsZF6wRAhIhVHAMsYy0ySgjMmUCE2CrnVI4/MOf5TTm2dQLAg6rtDsgxQMqlRachAIEVArWD/7gruP+xJHch0EUARDi34hiAhQsBCGQlEGX7H/e/rCuoUL+7CIAIlqucXRVaAFQLAQgUJ/BsSc8q3srODeD+V3kCIjbfRQBEUa9kr4q4gugTBCCwjsC5kvw9WrOwi1qTftC2uwgAdz2CO6BTFB8YlCPdggAEILAVgbtIOiUAGtypA0xCtC50FQARLFjNjjOsaCuI/kAAAjsRiGBDxfY/a3RLAl0FQIQQlh4A21gsZAhAIAuBKMenfG9mWTET97OrAHC3IihZuyT6GMC/KRCAAAQiE4hg/Gc+bP9HXiUV+7aJAIjiDUAoy4oLhqYhAIHOBCIY/7H933m6lnfhJgIgyjEAxoDLW6eMGALZCER5YWL7P9vKmbC/mwiAKMcAbGlNuEBoCgIQ6EUgQuQ/d/y2kt7VawTcNHsCmwqAKKrWC9oLmwIBCEAgGoEIOVTM5LwA8QeizQ39WSGwqQDwMYC34PcNQBFlG2AS6AIEILAHgQgG0+7UcZLswk2BwJYENhUAruQVkg4PwJOzrQCTQBcgAIFdCERx/XOn7DHlFzYKBEYTAAdL8vlWhMICjzAL9AECEGgJRHlBerckH0VQILAtgT47AK7MqvKAAFzZBQgwCXQBAhC4mEAUTyn3BXdpFuVaAn0FQJTQwB4guwBrp5kLIACBCQgcK+nICdpZ1wS+/+sI8feLCfQVAJGULrsALGYIQKA2gUhn/xj/1V4NSdrvKwA8vChnXewCJFlsdBMCMybA9+GMJ3euQxsiAKL4unpu2AWY6wplXBCITyDS2/85kmyoTYHAWgJDBIArj2IMyC7A2qnmAghAoBCBSG//GP8VmuQ5VjtUAESJDMguwBxXJ2OCQHwCkd7+Mf6Lv15C9XCoAIgUGZBdgFBLi85AYBEEIr39P0eSUxBTINCJwFAB4Eai5Lx2X8gR0GnauQgCEBiBQCQ7KL/9ezfiqyOMiyoWQmAMARDJJdDTdldJjsVNgQAEIFCSwJmBou1hCF1ypmda9xgCwGgibYPZMNHBgSgQgAAEShGIZP/kMRIQrdRMz7jesQRAJEMYTxdnYTNetAwNApUJeNfT+VD8vReh8PYfYRYS9mEsAeChR0mB6b74HMyKmPOwhIuSLkMgOIFIdk9GRWr04AsmavfGFACRDGLMG1UcddXRLwjkJRBtt5Osf3nXUvWejykAPBhb4R9SfVSXdeCmkj4UqD90BQIQyE3gFEl3CTQEjJ4DTUa2rowtAKLtAvjhbxFAgQAEIDCUgB/8FgBRCm//UWYiaT/GFgARdwEwCEy6OOk2BAIRsOHfuZL8O0rh7D/KTCTtRwkBEG0XwFODi0zSBUq3IRCEwLGSjgzSF3eDt/9Ak5G1KyUEQMRdACIEZl2h9BsC9QlEfKnh7b/+ukjfg1ICIOIH5mhJVvEUCEAAApsQ8NZ/FJ9/3v43mTmu3ZFAKQEQcReA2AB8GCAAgU0JRPP5d/95+990Frl+SwIlBUDEXQCOAvggQAACXQkc3ET863r9FNdx9j8F5YW0UVIAGGGkHAHtlHIUsJDFzTAhMIBAtHC/7VB4+x8wqdy6K4HSAiBa1Kx29AQI4pMAAQjsROB4SU74E6kQ3TTSbMygL6UFgBFFPEMjQNAMFi9DgEAhAtEC/niYX5PkIwlnO6VAYBQCUwgAb6V50e47So/Hq+Q4SUeNVx01QQACMyDgXUtn+osU8MdYCWg2g8UVbQhTCACPOVru7HYeOE+LtiLpDwTqEjhTkg2YI5Xzmrd/sptGmpUZ9GUqAWBU3na/STBmuAYGmxC6A4GKBCIeVxrH0yUdU5ELTc+UwJQCIKJbYCtMSBg00wXOsCDQkUDU7yd3/9OSXibptZK+2HE8XAaBtQSmFADuzBskHba2V9NfgD3A9MxpEQJRCEQ991/l8z1JH5Z0P0kfiwKOfuQmMLUA8AfNRwHRDAI9i0c0cQtyzyi9hwAENiFgYz+f+9vCPkP5T0mPl/QaSRdm6DB9jEtgagFgElHP2WwPYKNACxQKBCCwDAIR/f27kH+LpEfgFtgFFddsR6CGAHBfIhoEul92V7Q9ANa2fGYgMH8CUb2TupL/rKRfkGQvAQoENiZQSwBEjLHdwrOdwl03JskNEIBAJgKRv4M24WijwNtLOmeTm7gWAiZQSwC47ahHAe6bcxjYJoACAQjMj4Af/j73jxbspy/p8yU9UNKb+lbAfcskUFMA+MPno4ADgqInaVDQiaFbEBhAIJvRX9ehfkPSnSQ54ykFAp0I1BQA7mBk31v3D8+ATsuIiyCQgsBcH/4tfIuAO0o6K8Vs0MnqBGoLAAM4VtKR1Uls3QE8A4JODN2CQA8CzqbnrfI5F4uAX5F09pwHydjGIRBBAERNFtQSRgSMs9aoBQI1CTjY12NrdmDCti0CDpX07gnbpKmEBCIIAGOLfhRgWwXHCMA9MOEip8uLJ5Dd3a/PBDpgkKOu2tiRAoEtCUQRAO5c5KMA9w8RwIcIAvkILPHh387S1yTdW9Jb800bPZ6CQCQB0D5ko2UMXJ0HRMAUq5I2IDAOgYdL+sNxqkpbi3ct74MISDt/RTseTQDYP9duLBFzBbQTgQgouiSpHAKjEHhUk0FvlMqSV+KdAAc34zgg+USO3f1oAsDjO0rSS8ce6Mj1WaTYJoACAQjEI2CbordJukK8rlXrkW0CHCcAw8BqUxCv4YgCwJSipg1enUGiBcZbz/QIAj8v6QxJVwTFHgRwEWRR7EIgqgCI7hrYQkQE8IGCQBwCPy3pPZL2jtOlcD0hWFC4KanXoagCwESiuwa2s+bdCkcMxEWw3jqmZQj4SO50SfuAYi0BwgavRbSMCyILAM9A5IRBqysEw8BlfF4YZUwCS3b16zsjX5d0D0lv71sB9+UnEF0AmHAGewD3ExGQ//PACPIR4OHff87sHWAXwbf0r4I7MxPIIABsD2Cr+8jxAdo1gAjI/Gmg79kI8PAfPmMWAXeX9M7hVVFDNgIZBICZZogPsCoC7HP7mWyLgf5CIBEBJxBz9FDKcAI+DnDYYFIJD2eZqoYsAsBQM6l9Egil+hjQ2WQEjm++D5J1O3R3cREMPT1lOpdJAJhA9HwBq7NkEXC0JLsKUiAAgeEEfBzoh/9dhldFDVsQwEVwYcsimwDw9Hib6pBE82QXQURAogmjqyEJ+OHvULY+DqSUI4AIKMc2XM0ZBUAmo8B2wgkYFG7p06FEBPzQ98Pfn31KeQIOG+xdFkdUpMyYQEYB4Om4VuN2Fzlp0O7LhoBBM/4gMbRiBPwg8rZ/1of/dyT9jaT9Jd2wGKXxK8ZFcHym4WrMKgAMMpNnQDvxdhP0kYB/UyAAgZ0JPKsJBpaR03clvbKxW/qkpKs0n/1jJF0+yYAsAu7VJFZK0mW6uQmBzALA48zkGdDOi40DLQK8I0CBAAT2JJDd2O88SQ+Q9LeSvAPQFj/4nyLpGZL2SjLxdhH0LgyphJNM2CbdzC4AsooA99seDfYSoEAAApcR8M7eKc0xXzYu35P03ubh/y/bdP5ykryz8cREeQtsE3CopLOyTQj93ZnAHASAR2gju8MTTrY9Ghw0iERCCSePLo9OwDt6L0163n+hpNdIOkrSN9eQ8ffu85oXgCuNTrFMhcQJKMO1aq1zEQCZRYAjBvpIgChcVT8KNF6RgLf8/Vbsh2fG4rNyb+u/XNJFHQfg797nSnpCovTFiICOk5vlsjkJADO3cV2GnAFbrQ9nPnxOloVDPyEwEgFv+dvKP6t//39Jeoik1/Xg4e9fC4ffkHSFHvfXuMXHAXfmhaUG+vHbnJsAyBgjYHVWLWDIIzD+OqfGmASyx/P3tv+vDjTotWGgdwHsHWD7gAwF74AMs9Shj3MTAB5ydhFACOEOC5dLUhPwZ9SGfrdJPIovSvoZSf82whh+sLEHeFEyEUAq4REmv2YVcxQAcxABHgOBg2p+Mmi7FIHsgX3M5d+bIwuLgLGKRYB3AmwXkOU4gFTCY81+pXrmKgDmIgKIGVDpg0GzoxPI7tvfAvFD/2aSPj86oUsCBNkewLEC9i5Qf4kqHSfgTrgIlkBbvs45C4BWBNjKPlPI4K1m3bsBjhngsVAgkI2AXXQd9yJrON+Wt63gbyppOx//Meal9Q54nKRMLoJ3RASMMf3T1jF3AWCaGUMGb7UKvBtgT4Hjpl0itAaB3gScs8MW/pnP+tvB/7eke0s6rTeN7je2cQIsAvbpflvVK3ERrIq/X+NLEADtToD97LO6CK7Orsfh3QDyCfRb89w1DQFb+FuwZn/rNy0//O3qd8I06C5uxd/N5ufjgCtO2O6QpiwCHDHw3UMq4d7pCCxFAMxNBHg87W4AUQSn+7zQ0noCftt3NL+sfv27j9CufveXdPL6oY9+hW0CntxEDcziImibALsyk0p49OUwfoVLEgBzFAF++Dt6mrOOUSBQk4C3+/3gt5X/nMoLmgBdXSP8jT12XATHJkp9lxJYmgCYowjwmHwc4GMBwgnz4Z6agLf42+3+qdsu3Z6F9aMleWu7ZrEIsD2AxYj/naEQLCjBLC1RAMxVBHhceAsk+NDNqIu27vdRlN/+51Y+2wT6+VKQgfk44GmSnp4slfBhvJgEWUFbdGOpAqAVAXZNyphFcN2KcnZE5xXAbXAdKf7eh4DP+W3dP8cHv3n43N++/v/UB07Be2wHYMH1+EQugqQSLrgghla9ZAHQssuaSnjd3Ns+wALHboMYCq6jxd+7EPCD31n75uDWt9N4f7MxvuvCZOprSCU8NfEZt4cAuGRybUhnA6Y5FoTAHGd12jEt5cFvqt7yv7Ykv7lGLVlTCRMsKNiKQgBcNiEPat6Ys0cN3G6JIQSCffgSdGdJD/52OhyK18Z20YuPA9xXpxPOYhhIKuFgqwoBsOuEzCVq4E7LzELAxoLYCAT7MAbqju1ivCs2F1/+TdA+QtLLN7mh4rUZUwk7TsC9JL21IjeabgggAPZcCv7Ss13AHKIGrlvoFgK2EcB9cB2p+f/d7nztg3+uxn1dZvE9TXKbLHYzxAnoMqtcsyUBBMDWC8NfhnMJHdxl6XusFj0EFOpCa17X+GFvP34fgc0hbO/Q2fm+pFMbHvZlz1AsAp7YeAhkCRtsto4YeGYGwHPtIwJg55mdq4fAdqO222C7K4AL4Vw/9ZeMy/7ZfujPLXLfGLNmEXCipEdK+soYFU5Qh48DbA/wpEQJhGwT4FTC5A6YYIFs1QQCYD34uRsHbkeAXYH1ayPbFbztbzZj3hGzz/35m91W7WpcBKuhz9kwAqDbvNkuwG/GB3S7fFZX+Sy0PR4gA2G+qfW2fvu2P3f//RKzk1UEkEq4xGqYWZ0IgO4T6i9Si4BDut8yuys5IsgzpWzxjzdXr5H0mEQBtfy97oBNT02USpjjgPHWa+eaEACdUV16oUNx+sO19OLdAO8M2GAKe4EYq8EPfZ/p+weDvnHnxOmAfRwYOUDQ6ohtE2B7gOdLypRK+G6S3jnu1FHbdgQQAP3Whr9g/fCba9CgTalYDHh3xHYDGPRsSq//9e32vrf2eej359jlThsGnibp/gGyA3bpr6/J6iJ4X0lv7jpIrutPAAHQn50NqiwClnwksBU92wxYCFgQWAywO9B/jW11p9db+8BfYqCecWluVtv3JL1R0gMS7QRYBNiQ0TsBWSIG2kXwHpLesdn0cPWmBBAAmxLb83qOBHZm6N0BC4J2dyBLgJXhK2OcGvyQbx/6fvCztT8O1761eCfAxwEPlXRB30omvq9NJex0wntP3Hbf5hwxkFTCfel1vA8B0BHUmsuW7CWwKUELglYUsEOwJ73Vh73XFQ/8TVfYNNe/WtLRiVwEM6YS/oakX5F09jRTurxWEADjzbm/qL0b4KhqlO4EvCPQCgL/Pq/57+415LzS68Xhpv2QX/3JOZpl9jqri6CFy5WSTBkioOBEIQDGh4uB4DhM250C2xD4+MDnghnjELQPetuM+Mfb+LzZj7NGItTyqmYnIEvEQH/nOxGYPQT2igCwQx8sAkgl3AHUppcgADYl1u16f+nbQNBnWJRxCbQ7Brv/ditTi4T24e62/e/2wb76e9zRU1tEAg4bbJsAn1tnKD4OeLqkZyYyDLT7pb9PyR0w4gpDAIwIc4uqvBtw7EIjCJYl26323bMctqKh292XPdRXr2/f5LvWwXXzJ9AmELJ3gN9WMxQbBto74IWJ4gRY4N9H0lsyAM7QRwRA+VnCNqA8Y1qYN4HvSvIDK3IhTsA0s2MRcG9Jb52muXm3ggCYbn599utjgSXmE5iOMi3NjcBxki6U9GRJ0b+vLAIc/+KI5jgqw1w4NoDtARzdNFMqYUcMPCMD4Mh9jP6Bisyub9+IG9CXHPcticA5ko5qDEB9Zv02SbdLAuDPJT06WSph2wM8MVkq4UMlnZVkTYTsJgKgzrQQRbAOd1qNT8BbvLabsVBeLTdu8k4cGH8IF/cQF8HyE4WL4EDGCICBAAfejpHgQIDcPisCfmj6rX+7aJGPkvQ7ibaqfeT3hETBgvw8eG7T5ywRAxEBA74CEAAD4I14q992/MVHcqERoVJVGgKOCOn1vy7Ogw0BHYHPyWKylNdKsnDJEgK7TSXssMFXSALZIsDHASQi23DCEAAbAit4ub0FvPV5eME2qBoCkQg46qMf/Dac61r2keSHqnfPshRSCZefKcdgcAKht5dvaj4tIADizaWDyFgIkGUw3tzQo3EItOf8Xud93oyvIukvJd1+nO4UrwUXweKIL26AOAEbckYAbAhswsvtNuijAYTAhNBpqiiBoQ/+1c7tJ+m9kq5TtMfjVd4GC/IOX5aIgW0q4eclOg4glfAGaxYBsAGsSpciBCqBp9lRCdif34K2zxv/dh35cUnvlHT9UXtarjKLgJMkPSxZKmGHDX5qslTCd8YmYP1CRgCsZxTligc1X6AEEooyI/SjCwFb9vvB76ROJcq1JZ0m6YYlKi9UZ8ZUwk4g9DiyCBZaEZWqRQBUAj+gWYTAAHjcOhmB0g/+1YHcoHmzziQCMroI+ijAIsCGmBkKLoJrZgkBkGEZb91HCwH/YCOQdw7n1nOfv9qiv+Qb/3bMfAxwiiSLgSzFOwFHJjoOIJVwlpXVsZ8IgI6gAl9mGwG7UpF6OPAkzbxrdufzG21fq/6x8FyzsQnIYhjocdub4SGJDAPbVMLOHRA9QVO7rmx0abdRUgnv9klDAIz11VO/HocX9psXcQTqz8VSeuAHv9ecH/5RytWb+PC2DchQMqYStneAjwJIJZxhhe3QRwRA8gncovsOKOQdASILzm9uo4zIEdf84H9XlA7t1o8fk3S2pEwiwIaM95fkc+sMpRUBxyTaCSCVMDsAGT5bo/URO4HRUC6+In95ttv8pSz6x4TsnQBv+V5vzEoL1uWdANswPHhkV8mCXZZFgNM0P0PSXiUbGrFuHwf4uDSqeB1xqOurYgdgPaM5XOHjAe8I+BwMN8I5zOh0Y/Dbvh/8kbb5u47ea/3NyQwDHeb4sYkSCNkmwPYApBLuuioDXYcACDQZE3XFIsA7AxgNTgQ8YTM+27c1v436Mrzt74T4JyW9PlmcgKwugkcTJyDXpx0BkGu+xuytdwVaMXCTMSumrrQETm3e9DdJzpNhsBnjBDiOgg3tvpIBsCRSCSeZqNVuIgASTlqBLnNEUABqkir90PcD3z9jhumNNvyDmuOALDYB5ufjgEc2SW6i8dyqPz4OeKakTKmE/1OSwwYv0iYAAZDhYzVtH52N0EcE2AtMy33K1pby0N+dqXMH2KYhi3eA+2/DwAcm8g5wbADbA7xAkgVBhrLYVMIIgAzLs14fWzHgYEMcE9Sbh6Et24LfbzhLeNNfxwoXwXWEhv/d3gG2B3hRIhHgz8h9m12i4QSS1IAASDJRAbrpYwILAf94d2DfAH2iC9sTOGflob/I7c0dFodFwFnJUglbvHlnLlMq4SdIem6yVMJ3k3TGUr5YEABLmenxx+ndAQsB/7A7MD7fTWtcfcv3Az+79f6m49/0eh8HvEOSvQQyFMcJcNjgRyQyDPRxwG9IegqphGMuMQRAzHnJ1itHH/TOgEWBf5OgqPwM2lXvQ81bvh/4/jdlMwLXlWR7iEwJhF7VeAecv9lQq11tOwBSCVfDv3PDCICgEzODbrXHBa0o4Mhg2KS2W/rtQ583/GE827uzugg+PlGwID9nSCU8znodtRYEwKg4qWwHAhYCtiNoBYH/TVTCrYHZUt0PeP+0b/dzdtGr/cGxa6B3ArIcB5hX1lTCDh18xdoT3rF952U4tPEc6XhLrssQALnma2699dGBBUH7Y1GwpOMDb+OvPuT9b7by66zyazS5AzKlEnaEwyMk2Zc9AnNBiQAAEnBJREFUQ/FxwFObI4FMqYTvOlfDQARAho/N8vrYCoOtfmcyOLRhnh/ofnvf6vfyZjb2iHERLD8/fvD7+CJbKuFZuggiAMoveFoYn0ArDFzz6r/937Y9aIt3Fsa2PfBZfLsd327Tu732Ib/7v8cfPTWWJJBNBHxPklMJO1hQlp2ArKmE7ynp7SUX39R1IwCmJk570QhYJFhEuLRv6dH6SH+mJUAq4fK8vRPg4wC7CZJKuDzvLVtAAFQCT7MQgEBoAgdKOj2Zi+AJko5M5B1gm4BnS3LAoH1Cr4bLOuddljtKOjtJf3fsJgJgDrPIGCAAgRIEMqYSdhbBjC6CpBIusYLX1IkAqACdJiEAgTQELAJOTrYTkDGVsOMEWLjsnWRl2EXQOwEOKZ22IADSTh0dhwAEJiLg44C3SMqUSvh1kh6eLJWw7QGeIclGghlK+lTCCIAMy4w+QgACtQnYMNBve1lSCTt3gBMIZUslbHuAYxJlEXRypntJemvtBdqnfQRAH2rcAwEILJFANhdBiwBHOHyAJG9ZZyhZUwnfp9klysD40j4iAFJNF52FAAQqE8iYStgiwKmEHZgqQ7EIeGLjIZAlbLDZOmLgmRkAt31EAGSaLfoKAQhEIOCwwQ4IkyV3gHcC/kLSo5KlErY9wJMSuQj6OOBOmQwDEQARvk7oAwQgkI2ADQJPkXTDRB3PlkrYz6fnNumPr5SEs49afiVLnAAEQJJVRTchAIFwBJxK2Al5/DtLeUUTeOf8JB32M+r5khwnIEuwoDQiAAGQ5FNANyEAgZAErtvE4s9yHGCIjhj4GEkXhCS6Z6f8nHpWEzo4i01AilTCCIAknwC6CQEIhCXw45LeJSlTKmEHN7JhYJYEQs4d8GRJDhjkEMIZim0C7i7pHVE7iwCIOjP0CwIQyEQgY5wAXATLrzB7B4R1EUQAlF8AtAABCCyDQLY4AU4l/MYmTkCWnQC7CDpksO0CskQMtAgImUoYAbCMLyZGCQEITEPAxwFnJAobbBdBHwc8NJFNgI8Dnibp6YlSCVsEHCbp3dMsw26tIAC6ceIqCEAAAl0JHNS8WWdyEXyNpKMSphL2bgAugl1X5m7XIQB6guM2CEAAAjsQsGvgScniBGR1EbRwQQT0+DgiAHpA4xYIQAACHQhkTCXsYEH2uf9Kh/FFuMTPsOc0EQP3itChDn0Ik0oYAdBhtrgEAhCAQE8CB0h6WyKbAA/zREm/nih3gN0CbQ/wzESGgTa6vEtjL9JzaQ2/DQEwnCE1QAACENiJQEYXQVIJl1/TNgy8d81UwgiA8pNMCxCAAASyuQjaO+A0SfcnlXDRxVtVBCAAis4tlUMAAhC4lIB3AuwGliVioEWAdwKOSHQc4NgAziDo0MFZwgZXSyWMAODbCQIQgMB0BH6i2fLNkkCIVMLTrA3bBBw6dSphBMA0k0srEIAABFoC12+C72SKE/DKJgJftiyCuAju8LlDAPClBAEIQGB6AhnjBGQUAc9thAuphLdY4wiA6T/4tAgBCEDABGwL8FeSvCOQpbxW0qMkfTVJh7OmEr5Tk2GyKGYEQFG8VA4BCEBgRwIZUwm/vjEMzJJAyLkDbBjoBEKkEl5ZjggAvp0gAAEI1CWAi2B5/vYOcITDFyUSAcVTCSMAyi88WoAABCCwjkA2EeBUwo4TcLikr68bXJC/Z00lfHdJ7yzBEAFQgip1QgACENicgI8D/EWfxSbALoI+DnDY4As2H26VO3wc4LDBT5W0d5UebN6oBdadS6QSRgBsPhncAQEIQKAUgWs3qYSzxAkwh1c32+tZXARtB2DvAB8JZMkiaHuLO0o6e8yFhwAYkyZ1QQACEBhOABfB4QzX1eBn3/MkPU7SYl0EEQDrlgl/hwAEIDA9AR8DnCIp206AA++QSrjcenEqYUcMdEjpwQUBMBghFUAAAhAoQuCakt4h6bpFai9TqVMJPzSRYaCPA54m6dmSbB+Qofg44DBJZw7tLAJgKEHuhwAEIFCOQDbvABsGnirpAYmyCPrB/3hJL0zmIjg4lTACoNwHl5ohAAEIjEHAIuA9kg4ao7IJ6mhdBDOJALsI2h7gmEQ7AY7GeJ8muVSvaUUA9MLGTRCAAAQmJeBUwu9KdBzQphL+tURhg70T8BRJz0yUStgugj4O8NrYuCAANkbGDRCAAASqEDhA0lsk/WSV1vs16twBj0lkGGibANsDPCGRd0BvmwAEQL9FzV0QgAAEahAglXB56q2LYKY4ARdKurWkf9gEDwJgE1pcCwEIQKA+Ae8AOALfDet3pXMPnErYZ+yZXAQdLMg7AVkiBv6jpHtI+kTXWUEAdCXFdRCAAATiEHDEwNMThQ02uWyphH0c8IwmdPAV4kz9jj3xw/8Oks7t0l8EQBdKXAMBCEAgHgEbBjogzHXidW3bHjm40QOTuQg+UdILErkIeifglpK+uW5dIADWEeLvEIAABOISyOYimDFOQLZUwhc1uxYvWbdsEQDrCPF3CEAAArEJWASclWgnIGsqYdsD2C4gw3GAEzPdb12MAARA7A82vYMABCDQhUDGVMJ/KekRiQwDHSfANgFPTmIY+ClJP7XTUQACoMtHi2sgAAEIxCdgWwCH4c3kHZAxlfBzGo+GDKmEfQxgweKjlz0KAiD+h5oeQgACEOhKgFTCXUn1vy5TKmHHBzhE0vsQAP0nnDshAAEIZCFwvWYnIFPEQO8EHCnpgiSQLQIcMdBv13sF7/MZjWugjQN3KewABJ85ugcBCECgB4FrSPIXf6ZUwidJenCyVMJPleQjgeiphB8kycGYEAA9PkzcAgEIQCAbAccJODtRFsGsLoKOcBg9lbCzSR4q6Wuri5gdgGwfafoLAQhAoDsBuwhaBDhyYIZiF8E3SnIqYSe5yVCypBJ+mKQ/QgBkWFL0EQIQgMA4BDKmEj5Z0kMSpRK2CPBxwNMD2wS8o8kVcOkuADsA43zAqAUCEIBAZALXkvQmSfYSyFKcO+CxkhzUJkPJkEr4zs0Oy8U8EQAZlhV9hAAEIDCcAKmEhzNcV0P0VMKvaY5XEADrZpK/QwACEJgZAe8AOJVwpp0AUgmPtwg/Lcm7AB9lB2A8qNQEAQhAIAuBAyW9OVkq4ddJevjuVuyBgfs44Dean0i5AxwL4FGS/hgBEHj10DUIQAACBQk4d4BTCWfxDrCL4BsSphJ2AqFjgqUSfq+kWyAACn66qBoCEIBAcALZXAQtAk6TdH9J3wjOtu1exFTCn5N0a0mfwQgwySqimxCAAAQKELCLoHcCnEgoQ2l3Ao5IdBxgEfDEJmJghOMAiycfp5yAAMiw5OkjBCAAgXIEHDb47ZKy5A6wCCCV8LD18Ae2BUAADIPI3RCAAATmQMAJhHzGnsk74FVNWt4scQL8vP09SY8M4IL/QUk3QwDM4aPLGCAAAQgMJ5AxlfArJNnQLosIuJKkd0n62eHTNagGZ108EAEwiCE3QwACEJgVAWcPtKFdluMAw3dwG0cMzJJK+GBJp0uy/UWt4jwLt0EA1MJPuxCAAARiErBNwJmJDANN0cGNbBiYJYGQcwY8v+L0f0vS0xAAFWeApiEAAQgEJeC307OSxQnI5CJorwsn5zmg4vwfgwCoSJ+mIQABCAQmkC1OgFMJWwQ8MMFOgN0Bf1/SQyvO/2kIgIr0aRoCEIBAcAKOGPjORGGD7SJ4SpNKOLpNwKGrmfkqrIOzEAAVqNMkBCAAgUQEDpL0V8lcBG0YeFRw7wCHYf64pFrBgT6AAEj0KaSrEIAABCoRwEVwfPC2s3iP3fHGr7pTjZ9DAHTixEUQgAAEFk/g+s32erZgQUdL+krA2ftRSadKunmlvl2IAKhEnmYhAAEIJCRwLUlvk+R4AVlK1FTC9gA4EQGQZRnRTwhAAAIQyOgi6DftBwTLIogA4LMEAQhAAALpCNhF0OfXNhDMUOwdEE0EcASQYeXQRwhAAAIQ2IOAdwIc1z7LcUArAh4UJJWwXSz/TpIjL9Yo/4ENQA3stAkBCEBgHgR+orEJyJI7wCLgL5wKN4Bh4A0lfaRiZsAPIwDm8SFkFBCAAARqEXAqYQff8QMtS3mlpMdXjhNwtyaHQS1mBAKqRZ52IQABCMyIQMY4ATVFwBUl/YGkB1dcA3/FDkBF+jQNAQhAYEYEnODGEQMdLyBLOUHSoyV9deIOOyXw2yXtP3G7q82RDKgifJqGAAQgMDcCNmyzYaDFQJZysiQbBk6VStgv3vb/v0dFQN8mHXBF+jQNAQhAYKYEcBHceWJv1SQBulrF+bfYuS1HABVngKYhAAEIzJSARcBZiXYCnEr4jU2woJI7Afaa8DHJT1Wed4dGvgYCoPIs0DwEIACBmRLwccAZkuwlkKHYRfD1kn5dUolUwleS9A5J3gGoXRx/4FYIgNrTQPsQgAAE5kvAKW9PS+Yi+G5JD5X0yRGn5aqSTpJ0uxHrHFLVSyQ9CQEwBCH3QgACEIDAOgIOEuQ360xxAj7euOj5Tdk7A32Ln7GO9PdaSbfuW8nI931d0hGSTkYAjEyW6iAAAQhAYA8Cdg18g6QsEQM9gO9I+l1JL5N0bo85dajkx0h6mKT9etxf6pZPN2LkCwiAUoipFwIQgAAEVgk4+51937PkDmj7bgPBl/uNWdI710zplSXdqHErtGvhPgGXwPsl/az7hQAIODt0CQIQgMBMCfit+OxEWQRXp8FC4CJJ75X0ZUmfaOwEfnjFsO8OkvYO/Gy1/7+FyZ8jAGb6CWNYEIAABAITsIugRYANBDMXP0wtCC7fPPQzjOWjku7UHmmwA5BhyugjBCAAgXkRyJZKeC70f6dJgnTxeBAAc5lWxgEBCEAgF4FrSnqLJCcSokxD4LZNqGYEwDS8aQUCEIAABLYhYO8AG9dlchHMOpmOQ2D3v2+0A2AHIOtU0m8IQAAC8yDgHQDHCWAnoOx83l7S21abQACUBU7tEIAABCCwnoANAk9Plkp4/ajiXOFdlgdI+iYCIM6k0BMIQAACELiEgHMHOAxvdu+AaPPpgEa3kfTXu3eMHYBoU0V/IAABCCyXwFxcBCPNoMMQP1DSdxEAkaaFvkAAAhCAwO4EEAHjrQnH/T9I0vlbVckOwHigqQkCEIAABMYh4OMAh921lwClP4HnSHr2drcjAPqD5U4IQAACEChH4DqSTsVFsDfgf5Z0U0kXIgB6M+RGCEAAAhCoRMCugfZfJ07AZhPweUm/KMlpjbct7ABsBpWrIQABCEBgWgI+BjiFOAGdodvVzwF/Tlx3BwJgHSH+DgEIQAACtQn8hKQzJPlYgLIzgVdJerAku//tWBAA6wjxdwhAAAIQiEDACYTOIk7AjlNxgqRHS/pqlwlDAHShxDUQgAAEIBCBgF0E39O4tkXoT6Q+vF/SPSSd17VTCICupLgOAhCAAAQiEPBOwJmSrhehM0H68ClJd5X0j5v0BwGwCS2uhQAEIACBCAQOkPQGSQdH6EzlPvybpDtK+vCm/UAAbEqM6yEAAQhAIAKBa0l6jaSfj9CZSn34oqTbSfpon/YRAH2ocQ8EIAABCEQgsFcTLMipbpdUvt+k9n2UJG//9yoIgF7YuAkCEIAABIIQ2FvSb0t6iKQrBulTyW744e/0vg+S9I0hDSEAhtDjXghAAAIQiEDgck3Gu2Mk2VNgrsUP/CMlHS/JQmBQQQAMwsfNEIAABCAQiIBj3/++pFsF6tNYXTlX0i9Lcoz/UQoCYBSMVAIBCEAAAkEI+EjgeZIOl/QjQfo0pBv/Kel0SY+T9IUhFe1+LwJgTJrUBQEIQAACUQjctnloHhqlQxv2w6F8/0bSUY2V/7c3vH/t5QiAtYi4AAIQgAAEkhLYtzEOdHhcuw1mKfbpf4Wkl++UznfoYBAAQwlyPwQgAAEIRCfwo82RwGObY4ErBO3wP0lyMh//fK50HxEApQlTPwQgAAEIRCHgB//dJVkI3EyS4wjULhdJ+qykP5b0J5LOn6pDCICpSNMOBCAAAQhEInBtSQ+VdD9J15i4Y3bhc9KeEyWdJOl9E7d/cXMIgBrUaRMCEIAABKIQuJKkG0u6g6RbSLqNpH0KdO6/mwf9GU0yow9K+nqBdjpXiQDojIoLIQABCEBgxgT8PPSD/yqNIPAOwUGSrtv83Ghl7Fs9O1cD83xGktPzOlb/Jxrf/Y9I+lpj1Pe9CBwRABFmgT5AAAIQgEBUAldrRIFjClgg+E1+f0n7SfpBSX6Y/5ekf5XkGAR21/uSJPvvf3mMiH2lwCAASpGlXghAAAIQgEBgAgiAwJND1yAAAQhAAAKlCPx/YDx9SebRTiQAAAAASUVORK5CYII=\" width=\"30\" height=\"30\">');\n map.addListener('center_changed', function () {\n self.align(isidebar);\n });\n $(window).resize(function () {\n var width = $(window).width();\n var height = $(window).height();\n $(isidebar.getSideBar()).offset({\n top: height * 0.1,\n left: width * 0.65\n });\n $(isidebar.getMenu()).trigger('searchlist_align');\n });\n };\n NEWLayer.prototype.draw = function () {\n };\n NEWLayer.prototype.align = function (isidebar) {\n logger('NEWLayer align function is called');\n var currentcenter = this.getProjection().fromLatLngToDivPixel(map.getCenter());\n var changex = currentcenter.x - this.startcenter.x;\n var changey = currentcenter.y - this.startcenter.y;\n logger('change of position trigger- changex:' + changex + ' ' + 'changey' + changey);\n // can create a function in sidebar to replace\n $(isidebar.getMenu()).css('transform', 'translate(' + changex + 'px,' + changey + 'px)');\n $(isidebar.getSideBar()).css('transform', 'translate(' + changex + 'px,' + changey + 'px)');\n\n logger('NEWLayer align function is ended');\n };\n NEWLayer.prototype.onRemove = function () {\n logger('NEWLayer onRemove function is called');\n if (this.div)\n this.getPanes().overlayMouseTarget.removeChild(this.div);\n logger('NEWLayer onRemove function is ended');\n };\n var instance = new NEWLayer();\n logger('function addOVerlay is ended');\n }", "function loadMapServiceLayers(inMapServiceArray, inMap){\n\t \n\t var currentMapService = null;\n\t var mapControl = inMap;\n\t \n\t try {\n\t \n\t //iterate all base map services in json config and add to map control\n\t \tfor (var i = 0, il = inMapServiceArray.length; i < il; i++) {\n\t\t\t\n\t \t\tif (inMapServiceArray[i].mapServiceType == \"fusedCache\") {\n\n\t \t\t\tcurrentMapService = new esri.layers.ArcGISTiledMapServiceLayer(inMapServiceArray[i].restUrl, {\n\t \t\t\t\tid: inMapServiceArray[i].mapServiceId,\n\t \t\t\t\topacity: inMapServiceArray[i].opacity,\n\t \t\t\t\tvisible: inMapServiceArray[i].isVisible\n\t \t\t\t});\n\t \t\t}\t\n\t \t\telse if (inMapServiceArray[i].mapServiceType == \"dynamic\") {\n\t \t\t\t\n\t \t\t\tcurrentMapService = new esri.layers.ArcGISDynamicMapServiceLayer(inMapServiceArray[i].restUrl, {\n\t \t\t\t\tid: inMapServiceArray[i].mapServiceId,\n\t \t\t\t\topacity: inMapServiceArray[i].opacity,\n\t \t\t\t\tvisible: inMapServiceArray[i].isVisible\n\t \t\t\t});\n\t \t\t}\t\t\t\t\n\t\t\t\n\t\t\tmapControl.addLayer(currentMapService);\t\n\t }\n\t}\n\tcatch(err){\n\t\t\n\t\tconsole.error(\"Error at loadMapServiceLayers() method.\" + \"\\nError Description:\" + err.description);\n\t}\n}", "function geeAltService(eeLayer,failure){\n decrementOutstandingGEERequests();\n $('#' + spinnerID).hide();\n if(layer.viz.isTimeLapse){\n timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs = timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.filter(timeLapseLayerID => timeLapseLayerID !== id)\n var prop = parseInt((1-timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length /timeLapseObj[layer.viz.timeLapseID].nFrames)*100);\n // $('#'+layer.viz.timeLapseID+'-loading-progress').css('width', prop+'%').attr('aria-valuenow', prop).html(prop+'% frames loaded'); \n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${prop}%, transparent ${prop}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-loading-count').html(`${timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length}/${timeLapseObj[layer.viz.timeLapseID].nFrames} layers to load`)\n if(timeLapseObj[layer.viz.timeLapseID].loadingLayerIDs.length === 0){\n $('#'+layer.viz.timeLapseID+'-loading-spinner').hide();\n $('#'+layer.viz.timeLapseID+'-year-label').hide();\n // $('#'+layer.viz.timeLapseID+'-loading-progress-container').hide();\n $('#'+layer.viz.timeLapseID+ '-collapse-label').css('background',`-webkit-linear-gradient(left, #FFF, #FFF ${0}%, transparent ${0}%, transparent 100%)`)\n \n // $('#'+layer.viz.timeLapseID+'-icon-bar').show();\n // $('#'+layer.viz.timeLapseID+'-time-lapse-layer-range-container').show();\n $('#'+layer.viz.timeLapseID+'-toggle-checkbox-label').show();\n \n \n timeLapseObj[layer.viz.timeLapseID].isReady = true;\n };\n }\n $('#' + visibleLabelID).show();\n \n if(layer.currentGEERunID === geeRunID){\n if(eeLayer === undefined || failure !== undefined){\n loadFailure(failure);\n }\n else{\n const tilesUrl = eeLayer.urlFormat;\n \n var getTileUrlFun = function(coord, zoom) {\n var t = [coord,zoom];\n \n \n let url = tilesUrl\n .replace('{x}', coord.x)\n .replace('{y}', coord.y)\n .replace('{z}', zoom);\n if(!layer.loading){\n layer.loading = true;\n layer.percent = 10;\n $('#' + spinnerID+'2').show();\n updateGEETileLayersDownloading();\n updateProgress();\n if(layer.viz.isTimeLapse){\n updateTimeLapseLoadingProgress(); \n }\n }\n \n return url\n }\n layer.layer = new google.maps.ImageMapType({\n getTileUrl:getTileUrlFun\n })\n\n layer.layer.addListener('tilesloaded',function(){\n layer.percent = 100;\n layer.loading = false;\n \n \n $('#' + spinnerID+'2').hide();\n updateGEETileLayersDownloading();\n updateProgress();\n if(layer.viz.isTimeLapse){\n updateTimeLapseLoadingProgress(); \n }\n })\n \n \n if(layer.visible){\n layer.map.overlayMapTypes.setAt(layer.layerId, layer.layer);\n layer.rangeOpacity = layer.opacity; \n layer.layer.setOpacity(layer.opacity);\n $('#'+layer.legendDivID).show();\n }else{layer.rangeOpacity = 0;}\n $('#' + spinnerID).hide();\n $('#' + visibleLabelID).show();\n\n setRangeSliderThumbOpacity();\n }\n }\n }", "function osm_tools_userLocation(){\n var style = {\n fillColor: '#000',\n fillOpacity: 0.1,\n strokeWidth: 0\n };\n processing_off();\n map = new OpenLayers.Map(\"osm-map\");\n var layer = new OpenLayers.Layer.OSM();\n vector = new OpenLayers.Layer.Vector('vector');\n markers = new OpenLayers.Layer.Markers( \"Markers\" );\n lineLayer = new OpenLayers.Layer.Vector(\"Line Layer\");\n map.addLayers([layer, vector, markers, lineLayer,boxes]);\n //map.addLayers(layer);\n\n var glayers=[new OpenLayers.Layer.Google(\"Google Streets\",{numZoomLevels: 50}),new OpenLayers.Layer.Google(\"Google Hybrid\",{type: google.maps.MapTypeId.HYBRID,numZoomLevels: 50})];\nmap.addLayers(glayers);\n//Add ESRI layer\nvar Elayer = new OpenLayers.Layer.XYZ( \"ESRI\",\n \"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}\",\n {sphericalMercator: true} );\n map.addLayer(Elayer);\n\nmap.addControl(new OpenLayers.Control.LayerSwitcher());\n \tmap.addControl(new OpenLayers.Control.MousePosition());\n //map.zoomToMaxExtent(); \n\n map.setCenter(\n new OpenLayers.LonLat(-71.147, 42.472).transform(\n new OpenLayers.Projection(\"EPSG:4326\"),\n map.getProjectionObject()\n ), 2\n );\n function osm_tools_initMap(){\n map = new OpenLayers.Map(\"osm-map\", {\n eventListeners: {\n moveend: osm_get_current_map,\n zoomend: osm_get_current_map\n }\n });\n map.addLayer(new OpenLayers.Layer.OSM());\n } \n /**\n * Move the display map to current browser location\n \n function osm_goto_current_location() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(osm_goto_position, location_error);\n } else {\n alert(\"Geolocation not provided\");\n }\n }\n */\n /**\n * Retrieves map data from OSM that are currently displayed on the OpenLayers map\n */\n function osm_get_current_map() {\n \n // Retrieve current map data\n var fromProjection = new OpenLayers.Projection(\"EPSG:4326\"); // Transform from WGS 1984\n var toProjection = new OpenLayers.Projection(\"EPSG:900913\"); // to Spherical Mercator Projection\n var map_extent = map.getExtent().transform(toProjection, fromProjection);\n osm_get_map(map_extent.left, map_extent.bottom, map_extent.right, map_extent.top);\n }\n\n /**\n * Get the data currently shown on the OpenLayers map\n \n function osm_get_map(left, bottom, right, top) {\n var url_call = GET_MAP_URL;\n MapBounds = {\n west:left, \n south:bottom, \n east:right, \n north:top\n };\n url_call += \"?bbox=\"+left+\",\"+bottom+\",\"+right+\",\"+top;\n\n }\n\n\n var geolocate = new OpenLayers.Control.Geolocate({\n bind: false,\n geolocationOptions: {\n enableHighAccuracy: false,\n maximumAge: 0,\n timeout: 7000\n }\n });\n map.addControl(geolocate);\n var firstGeolocation = true;\n \n \n geolocate.events.register(\"locationupdated\",geolocate,function(e) {\n vector.removeAllFeatures();\n var circle = new OpenLayers.Feature.Vector(\n OpenLayers.Geometry.Polygon.createRegularPolygon(\n new OpenLayers.Geometry.Point(e.point.x, e.point.y),\n e.position.coords.accuracy/2,\n 40,\n 0\n ),\n {},\n style\n );\n vector.addFeatures([\n new OpenLayers.Feature.Vector(\n e.point,\n {},\n {\n graphicName: 'cross',\n strokeColor: '#f00',\n strokeWidth: 0,\n fillOpacity: 0,\n pointRadius: 10\n }\n ),\n circle\n ]);\n if (firstGeolocation) {\n map.zoomToExtent(vector.getDataExtent());\n firstGeolocation = false;\n this.bind = true;\n }\n });\n \n \n geolocate.events.register(\"locationfailed\",this,function() {\n OpenLayers.Console.log('Location detection failed');\n });\n*/\n vector.removeAllFeatures();\n \n\n}", "function initLayerAllFeatures(points, mainMap) {\n var context = function(feature) {return feature;} // a magic line from somewhere..\n var myStyle = new OpenLayers.Style( {\n graphicName: \"circle\", fillOpacity: \"1\", fillColor: \"#378fe0\", strokeColor: \"blue\", pointRadius: 5,\n graphicTitle: \"${label}\", labelYOffset: \"7px\", externalGraphic: \"${iconUrl}\", graphicWidth: \"${size}\",\n fontSize: \"10px\", fontFamily: \"Verdana, Arial\", fontColor: \"#ffffff\"}); //, cursor: \"pointer\"} );\n var textStyle = new OpenLayers.Style( {\n graphicName: \"circle\", fillOpacity: \"1\", fillColor: \"#378fe0\", strokeColor: \"#378fe0\", pointRadius: 8,\n fontSize: \"11px\", fontWeight: \"bold\", labelXOffset: \"-2px\", fontFamily: \"Verdana, Arial\",\n fontColor: \"#ffffff\", label: \"${text}\"} );\n var symbolizer = OpenLayers.Util.applyDefaults( myStyle, OpenLayers.Feature.Vector.style[\"default\"]);\n var myStyleMap = new OpenLayers.StyleMap({\n \"default\": symbolizer, \"enumeration\": textStyle, // cursor: \"pointer\",\n \"select\": {strokeColor:\"red\", fillOpacity: \"1\", fillColor:\"white\", strokeWidth: 2 , graphicWidth: 23},\n \"temporary\": {strokeColor:\"white\", fillOpacity: \"1\", fillColor: \"blue\", strokeWidth: 2, graphicWidth: 25}\n });\n //\"hotspot\": {pointRadius: 8}});\n var lookup = {\n \"normal\": {pointRadius: 5}, // normal\n \"hotspot\": {pointRadius: 7} // hotspot / cluster\n };\n myStyleMap.addUniqueValueRules(\"default\", \"marker\", lookup);\n // myStyleMap.addUniqueValueRules(\"temporary\", \"label\", labelook);\n myNewLayer = new OpenLayers.Layer.Vector('Kiezatlas Marker', {\n styleMap: myStyleMap, displayInLayerSwitcher: false\n // strategies: [ new OpenLayers.Strategy.Cluster() ]\n });\n // ### redundant^^\n kiezatlas.setLayer(myNewLayer);\n //\n var selectFeatureHandler = new OpenLayers.Control.SelectFeature(kiezatlas.layer, {\n multiple: false, clickout: false, toggle: false,\n hover: false, highlightOnly: false, renderIntent: \"select\",\n onSelect: function() {\n // jQuery(\"#memu\").css(\"visibility\", \"hidden\");\n }\n });\n mainMap.addControl(selectFeatureHandler);\n selectFeatureHandler.activate();\n //\n var featureHandler = new OpenLayers.Handler.Feature(selectFeatureHandler, myNewLayer, {\n //stopClick: true,\n stopUp: true, stopDown: true,\n click: function(feat) {\n for ( i = 0; i < kiezatlas.layer.selectedFeatures.length; i++) {\n selectFeatureHandler.unselect(kiezatlas.layer.selectedFeatures[i]);\n }\n showInfoWindowForMarker(feat.data);\n selectFeatureHandler.select(feat);\n }, // clickFunction\n clickout: function (feat) {\n selectFeatureHandler.unselect(feat);\n hideAllInfoWindows();\n }\n }); // end FeatureHandlerInit\n /* commented out the mouseover cluster menu */\n var highlightCtrl = new OpenLayers.Control.SelectFeature(kiezatlas.layer, {\n hover: true, highlightOnly: true,\n renderIntent: \"temporary\",\n eventListeners: { // makes use of the global propertyMap for eventListeners\n beforefeaturehighlighted: function(e) {\n e.feature.attributes.label = e.feature.data.topicName;\n // no menu just label\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n e.feature.attributes.label = \"mehrere Einsatzm\\u00F6glichkeiten\";\n }\n },\n // ### ToDo: mostly unused and to be removed\n /* featurehighlighted: function(e) {\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n //log(\"hotSpotFeature highlght, to show contextMenu at l:\" + e.feature.geometry.bounds.getCenterPixel()); // + \"b:\"+ e.feature.geometry.bounds.bottom);\n var centerPoint = myNewLayer.getViewPortPxFromLonLat(e.feature.geometry.bounds.getCenterLonLat());\n var htmlString = \"\";\n if ( e.feature.data.cluster != null && e.feature.data.cluster != undefined ) {\n /* for ( i = 0; i < e.feature.data.cluster.length; i++) {\n // htmlString += '<a href=javascript:showInfoWindowForTopicId(\"'\n // + e.feature.data.cluster[i].topicId+'\");>'+e.feature.data.cluster[i].topicName+'</a><br/>';\n }\n // jQuery(\"#memu\").html(htmlString);\n // jQuery(\"#memu\").css(\"visibility\", \"visible\");\n // jQuery(\"#memu\").css(\"left\", centerPoint.x);\n // jQuery(\"#memu\").css(\"top\", centerPoint.y + headerGap + 27); // ### headergap seems unneccessary\n }\n } else {\n // log(\"normalFeature just highlight\");\n // e.feature.attributes.label = \"\";\n }\n }, */\n featureunhighlighted: function(e) {\n // TODO: is wrong one, if one is already selected and the user wants to deal with a cluster\n // log(\"feature\" + e.feature.data.topicId + \" unhighlighted\");\n var marker = e.feature.attributes.marker;\n if (marker == \"hotspot\") {\n jQuery(\"#memu\").css(\"visibility\", \"hidden\");\n // var testXY = e.feature.geometry.clone().transform(map.projection, map.displayProjection);\n // log(\"hotSpotFeature highlght, to hide contextMenu at l:\" + myNewLayer.getViewPortPxFromLonLat(testXY));\n // + \"t:\"+ e.feature.geometry.bounds.top);\n } else {\n // e.feature.attributes.label = \" \";\n }\n }\n } // eventListeners end\n });\n mainMap.addControl(highlightCtrl);\n highlightCtrl.activate();\n featureHandler.activate();\n allFeatures = [points.length];\n for ( var i = 0; i < points.length; i++ ) {\n allFeatures[i] = new OpenLayers.Feature.Vector (\n new OpenLayers.Geometry.Point(points[i].lonlat.lon, points[i].lonlat.lat), {\"marker\": \"normal\", \"label\": \"\"}\n );\n allFeatures[i].data = {\n topicName: points[i].topicName, topicId: points[i].topicId, defaultIcon: points[i].defaultIcon,\n lon:points[i].lonlat.lon, lat:points[i].lonlat.lat, originId: points[i].originId\n };\n allFeatures[i].cluster = null;\n allFeatures[i].attributes.iconUrl = \"\"; // not to show feature after initializing\n // allFeatures[i].attributes.renderer = \"circle\"; // = \"blackdot.gif\"; // not to show feature after initializing\n allFeatures[i].attributes.size = \"15\"; // item-style when geoobject is directly called from outside www\n allFeatures[i].attributes.label = points[i].topicName;\n allFeatures[i].renderIntent = \"default\"; // not to show feature after initializing\n // add new feature\n kiezatlas.layer.addFeatures(allFeatures[i]);\n }\n map.addLayer(kiezatlas.layer);\n }", "constructor(olMap, $slider, dynamicLayerRenderer1, dynamicLayerRenderer2) {\n\n dynamicLayerRenderer1.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0, 0, width, ctx.canvas.height);\n ctx.clip();\n\n });\n\n dynamicLayerRenderer1.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(width, 0, ctx.canvas.width - width, ctx.canvas.height);\n ctx.clip();\n\n // Draw a separating vertical line.\n if (percent < 100) {\n ctx.beginPath();\n ctx.moveTo(width, 0);\n ctx.lineTo(width, ctx.canvas.height);\n ctx.stroke();\n }\n\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n $slider.on('input change', function() {\n olMap.render();\n });\n\n }", "function MapCtrl($scope,$location) {\n\t\tvar ctaLayer;\n\n\t\t$scope.setClosestSea = function(seas, lat, lng)\n\t\t{\n\t\t\tvar closestSea;\n\t\t\tvar i;\n\t\t\tvar closestDistance;\n\t\t\tvar originPoint = new google.maps.LatLng(lat, lng);\n\t\t\t\t\t\t\n\t\t\t//Loop through seas;\n\t\t\tfor(i=0; i<seas.length; i++)\n\t\t\t{\n\t\t\t\tvar currentSea = seas[i];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tvar coordinates = currentSea.coordinates.split(\" \");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tvar j;\n\t\t\t\t\t\t\t\t\n\t\t\t\tfor (j=0; j<coordinates.length; j++)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tvar latLngSplitted = coordinates[j].split(\",\");\n\t\t\t\t\tvar currentPoint = new google.maps.LatLng(latLngSplitted[1], latLngSplitted[0]);\t\t\t\n\t\t\t\t\tvar distance = google.maps.geometry.spherical.computeDistanceBetween(originPoint, currentPoint);\n\t\t\t\t\t\n\t\t\t\t\tif(closestDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(closestDistance > distance)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\tclosestSea = currentSea;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\n\t\t\t}\n\t\t\tif(closestSea)\n\t\t\t{\n\t\t\t\t$scope.setSea(closestSea.id);\n\t\t\t}\n\t\t\t\n\t\t\treturn closestSea;\n\t\t\t\n\t\t}\n\t\t\n\t\t$scope.setSea = function(id)\n\t\t{\t\t\n\t\t\t\tif(ctaLayer)\n\t\t\t\t{\n\t\t\t\t\tctaLayer.setMap(null);\n\t\t\t\t}\n\t\t\t\tctaLayer = new google.maps.KmlLayer({\n\t\t\t\turl: 'http://sharkapp.pazion.net/server/sharkserver.php?requestType=getseakml&id='+id\n\t\t\t\t});\n\t\t\t\tctaLayer.setMap($scope.myMap);\t\t\n\t\t}\n\t\t\n\t\t$scope.setMultipleSeas=function(idArray)\n\t\t{\n\t\t\tvar i;\t\t\t\n\t\t\tfor(i=0;i<idArray.length;i++)\n\t\t\t{\n\t\t\t\tvar tmpCtaLayer = new google.maps.KmlLayer({\n\t\t\t\turl: 'http://sharkapp.pazion.net/server/sharkserver.php?requestType=getseakml&id='+idArray[i]\n\t\t\t\t});\n\t\t\t\ttmpCtaLayer.setMap($scope.myMap);\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\n\t var ll = new google.maps.LatLng(55.153766, 5.273438);\n\t\t$scope.mapOptions = {\n\t\t\tcenter: ll,\n\t\t\tzoom: 11,\n\t\t\tscrollwheel: false,\n\t\t\tnavigationControl: false,\n\t\t\tmapTypeControl: false,\n\t\t\tscaleControl: false,\n\t\t\tdraggable: false,\n\t\t\tdisableDoubleClickZoom: true,\n\t\t\tdisableDefaultUI: true,\n\t\t\tmapTypeId: google.maps.MapTypeId.TERRAIN\n\t\t};\n\t\t\n\t\t\n\t\tvar mapLoaded = false;\n\t\t\n\t\t$scope.onMapIdle = function() {\t\t\t\t\n\n\t\tif(!mapLoaded)\n\t\t{\t\t\n\t\t\t\tgeocoder = new google.maps.Geocoder();\n\t\t\t\tmapLoaded = true;\t\t\t\t\n\t\t\t\tmapScope=$scope;\t\t\t\t\n\t\t\t\tupdateCoreSemaphore();\n\t\t\t\tif(document.getElementById(\"placesearch\"))\n\t\t\t\t{\n\t\t\t\t\tvar input = document.getElementById(\"placesearch\");\n\t\t\t\t\tautocomplete = new google.maps.places.Autocomplete(input);\n\t\t\t\t\t\n\t\t\t\t\tgoogle.maps.event.addListener(autocomplete, 'place_changed', function() {\n\t\t\t\t\t\n\t\t\t\t\t\tvar place = autocomplete.getPlace();\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sea = mapScope.setClosestSea(seasScope.seas, place.geometry.location.lat(), place.geometry.location.lng());\n\t\t\t\t\t\tsharksScope.setSharksBySeaId(sea.id,sea.name);\n\t\t\t\t\t});\n\t\t\t\t}\t\t\t\n\t\t}\t\t\n\t};\t\n}", "function initMap() {\n //The api is loaded at this step\n //L'api est chargée à cette étape\n\n // add translations\n translate();\n\n //options for creating viewer:\n var options= {\n // default value\n // valeur par défaut\n //mode:'normal',\n // default value\n // valeur par défaut\n //territory:'FXX',\n // default value\n // valeur par défaut\n //displayProjection:'IGNF:RGF93G'\n // only usefull when loading external resources\n // utile uniquement pour charger des resources externes\n //proxy:'/geoportail/api/xmlproxy'+'?url='\n };\n\n // viewer creation of type <Geoportal.Viewer>\n // création du visualiseur du type <Geoportal.Viewer>\n // HTML div id, options\n viewer= new Geoportal.Viewer.Simple('viewerDiv', OpenLayers.Util.extend(\n options,\n // API keys configuration variable set by\n // <Geoportal.GeoRMHandler.getConfig>\n // variable contenant la configuration des clefs API remplie par\n // <Geoportal.GeoRMHandler.getConfig>\n window.gGEOPORTALRIGHTSMANAGEMENT===undefined? {'apiKey':'nhf8wztv3m9wglcda6n6cbuf'} : gGEOPORTALRIGHTSMANAGEMENT)\n );\n if (!viewer) {\n // problem ...\n OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));\n return;\n }\n\n //Loading of data layers\n //Chargement des couches de données\n viewer.addGeoportalLayers([\n 'ORTHOIMAGERY.ORTHOPHOTOS'\n ], {});\n\n viewer.getMap().setCenterAtLonLat(0.00, 0.00, 1);\n\n //Adding a Vector layer: each feature will hold a well known graphic.\n //Ajout d'une couche vectorielle : chaque objet portera un symbole\n //pré-défini.\n var gs= [];\n for (var g in OpenLayers.Renderer.symbol) {\n gs.push(g);\n }\n var n= gs.length;\n var fs= new Array(n);\n var l= 0, c= 0, d= 100000.0;\n for (var i= 0; i<n; i++) {\n fs[i]= new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(d*c, -d*l), { type: gs[i] });\n if (c++ > 12) { c= 0; l++; }\n }\n\n //Create a style map: the graphicName property is evaluated against the\n //type attribute\n //Créé une symbolisation cartographique: la propriété graphicName est\n //évaluée au travers de l'attribut type\n var styles= new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n graphicName:\"${type}\",\n fillColor:\"lime\",\n fillOpacity:\"${getOpacity}\",\n strokeColor:\"lime\",\n strokeWidth:\"${getWidth}\",\n pointRadius:10\n }, {\n context:{ // Stroke or not stroke\n getWidth: function(f) {\n var s= f.attributes.type;\n return (s.charAt(0)=='_' && s.charAt(s.length-1)=='_'? 0 : 2);\n },\n // Opacity\n getOpacity: function(f) {\n var s= f.attributes.type;\n return (s.charAt(0)=='_' && s.charAt(s.length-1)=='_' ? 1 : 0.7);\n }\n }\n }),\n \"select\": new OpenLayers.Style({\n graphicName:\"${type}\",\n fillColor:\"fuchsia\",\n fillOpacity:1.0,\n strokeColor:\"fuchsia\",\n strokeWidth:\"${getWidth}\",\n label:\"${type}\",\n labelXOffset:0,\n labelYOffset:50,\n labelBackgroundColor:\"black\",\n fontColor:\"yellow\",\n pointRadius:20\n }, {\n context:{ // Stroke or not stroke\n getWidth: function(f) {\n var s= f.attributes.type;\n return (s.charAt(0)=='_' && s.charAt(s.length-1)=='_'? 0 : 2);\n }\n }\n })\n });\n\n //Create new layer\n //Création de la couche vectorielle\n var symbols= new OpenLayers.Layer.Vector(\"Symbols\", {\n styleMap:styles,\n opacity:1.0,\n visibility:true\n });\n symbols.addFeatures(fs);\n viewer.getMap().addLayer(symbols);\n\n //Create a hover selector to display symbol's name\n //Création d'un sélecteur par survol pour afficher le nom du symbole\n var hoverCtrl= new OpenLayers.Control.SelectFeature(symbols, {\n autoActivate: true,\n hover: true\n });\n viewer.getMap().addControl(hoverCtrl);\n\n viewer.getMap().zoomToExtent(symbols.getDataExtent(), true);\n\n // cache la patience - hide loading image\n viewer.div.style[OpenLayers.String.camelize('background-image')]= 'none';\n}", "function activeStylingMapFeature() {\n setStylingMapsSyncFn(syncStylingMap);\n}", "function changeMapDisplay(){\n $('.map-display-buttons').click(function() {\n // disable the selected button color\n // $('.map-display-buttons a').addClass('disabled');\n $('.map-display-buttons').addClass('disabled');\n // get the name of the selected feature\n var sel = $(this).text().toUpperCase().trim();\n // turn on the selected button color\n // $('a', this).toggleClass('disabled');\n $(this).toggleClass('disabled');\n console.log(\"the map option selected: \", sel);\n // change the map based on the button selected\n if (sel == \"CLIMATE\") {\n el.data_layer.setCartoCSS(el.bec_cartocss[el.selected_unit]);\n } else if (sel == \"BEC UNIT\") {\n el.data_layer.setCartoCSS(el.bec_cartocss.unit);\n } else if (sel == \"BEC ZONE\") {\n el.data_layer.setCartoCSS(el.bec_cartocss.zone);\n };\n });\n }", "function change_map_layer(el) {\n if (el.value === \"lock\") {\n conf_layer.remove();\n conf_num_group.remove();\n lock_layer.addTo(map);\n toggle_map_legend(0);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n } else if (el.value === \"conf\") {\n lock_layer.remove();\n conf_layer.addTo(map);\n conf_num_group.addTo(map);\n toggle_map_legend(1);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n }\n}", "function ChangeMap(option) {\n map.removeLayer(layer);\n RemoveLegendSiFlore(layer.name);\n RemoveLegendSiFlore(option.attr('layer'));\n layer=new OpenLayers.Layer.WMS\n (option.attr('layer'), option.attr('url'),\n {'layers': option.attr('layer'), transparent: false, format: 'image/png'}, wmsOptions\n );\n map.addLayer(layer);\n LoadLegendSiFlore(option.attr('url'),option.attr('layer'));\n}", "function serve(service, truck, airport) {\n truck.setProp(\"status\", \"busy\")\n truck.setProp(\"current-service\", service)\n // get from truck position to service road, move there slowly\n let p = geojson.findClosest(truck.getProp(\"position\"), airport.serviceroads)\n //debug.print(\"closest to truck\", truck.position, p)\n truck.addPointToTrack(p, truck.getProp(\"slow\"), 30) // truck moves to serviceroad\n\n // get to parking on service road at full speed\n let parking = geojson.findFeature(service.parking, airport.parkings, \"name\")\n debug.print(parking)\n if (!parking) {\n debug.print(\"not found\", \"name\", service.parking)\n return\n }\n let p1 = geojson.findClosest(parking, airport.serviceroads)\n //debug.print(\"closest to parking\", parking, p1)\n\n // move truck from where it was to close to parking on serviceroads\n let r = geojson.route(p, p1, airport.serviceroads)\n truck.addPathToTrack(r.coordinates, truck.getProp(\"speed\"), null)\n\n // we do not stop \"exactly\" at the parking's center but nearby\n let aroundParkingCoordinates = jitter(parking.geometry.coordinates, 30) // 30 meters\n\n // get from service road to parking slowly and service plane\n // service\n truck.addPointToTrack(aroundParkingCoordinates, truck.getProp(\"slow\"), truck.serviceTime(service.qty))\n\n truck.setProp(\"load\", truck.getProp(\"load\") - service.qty)\n truck.setProp(\"position\", aroundParkingCoordinates)\n\n // ADD STOP TO EXPLAIN SERVICE OPERATION\n truck.addMarker(\n \"serve\",\n aroundParkingCoordinates,\n 0,\n truck.serviceTime(service.qty),\n truck.getProp(\"syncCount\"),\n truck.getProp(\"color\"),\n {\n \"device\": truck.getName(),\n \"service\": truck.getProp(\"service\"),\n \"capacity\": truck.getProp(\"capacity\"),\n \"load\": truck.getProp(\"load\"),\n \"status\": truck.getProp(\"status\"),\n \"action\": \"serve\",\n \"quantity\": service.qty,\n \"posname\": service.parking,\n \"scheduled\": service.datetime\n })\n truck.setProp(\"syncCount\", truck.getProp(\"syncCount\") + 1)\n\n truck.setProp(\"last-service\", service)\n truck.setProp(\"last-parking\", service.parking)\n truck.setProp(\"status\", \"available\")\n\n // We add an extra point at the end to move the truck away from parking back to service road\n // so that it 'leaves' the parking position after it services.\n truck.addPointToTrack(p1, truck.getProp(\"slow\"), 0)\n truck.setProp(\"position\", p1.geometry.coordinates)\n truck.addPointToTrack(p1, 0, 120) // make sure it emits out of parking space.\n}", "addParcelsLayer(layerURL) {\n var featureLayer = new FeatureLayer(layerURL, {\n model: /*FeatureLayer.MODE_ONDEMAND,//*/FeatureLayer.MODE_SELECTION,\n outFields: ['PARCEL_ID']\n });\n\n this.get('layersMap').set('parcelsLayer', featureLayer);\n this.get('map').addLayer(featureLayer);\n }", "ShowMap(params) {\n source.cancel('Operation canceled by the user.');\n Actions.map(params);\n }", "function initMap() {\n //The api is loaded at this step\n //L'api est chargée à cette étape\n\n // add translations\n translate();\n\n var blyr= OpenLayers.Util.getElement('gpChooseBaseLayer');\n blyr.onchange= function() {\n _switchBL(this.options[this.selectedIndex].value);\n };\n\n //options for creating viewer:\n var options= {\n // default value\n // valeur par défaut\n //mode:'normal',\n // default value\n // valeur par défaut\n //territory:'FXX',\n // default value\n // valeur par défaut\n //displayProjection:'IGNF:RGF93G'\n // only usefull when loading external resources\n // utile uniquement pour charger des resources externes */\n proxy:'/geoportail/api/xmlproxy'+'?url='\n };\n\n // viewer creation of type <Geoportal.Viewer>\n // création du visualiseur du type <Geoportal.Viewer>\n // HTML div id, options\n viewer= new Geoportal.Viewer.Default('viewerDiv', OpenLayers.Util.extend(\n options,\n // API keys configuration variable set by\n // <Geoportal.GeoRMHandler.getConfig>\n // variable contenant la configuration des clefs API remplie par\n // <Geoportal.GeoRMHandler.getConfig>\n window.gGEOPORTALRIGHTSMANAGEMENT===undefined? {'apiKey':'nhf8wztv3m9wglcda6n6cbuf'} : gGEOPORTALRIGHTSMANAGEMENT)\n );\n if (!viewer) {\n // problem ...\n OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));\n return;\n }\n\n viewer.addGeoportalLayers([\n 'ORTHOIMAGERY.ORTHOPHOTOS',\n 'GEOGRAPHICALGRIDSYSTEMS.MAPS'],\n {});\n // set zoom now to fix baseLayer ...\n viewer.getMap().setCenterAtLonLat(2.5, 46.6, 5);\n // cache la patience - hide loading image\n viewer.div.style[OpenLayers.String.camelize('background-image')]= 'none';\n\n //Ajout d'une couche KML : les frontières pour vérifier les reprojections\n var styles= new OpenLayers.StyleMap(OpenLayers.Feature.Vector.style[\"default\"]);\n var symb= {\n 'Frontière internationale':{strokeColor:'#ffff00', strokeWidth:5},\n 'Limite côtière' :{strokeColor:'#6600ff', strokeWidth:3}\n };\n styles.addUniqueValueRules('default', 'NATURE', symb);\n styles.addUniqueValueRules('select', 'NATURE', symb);\n var borders= viewer.getMap().addLayer(\"KML\",\n {\n 'borders.kml.name':\n {\n 'de':\"Limits\",\n 'en':\"Borders\",\n 'es':\"Límites\",\n 'fr':\"Limites\",\n 'it':\"Limiti\"\n }\n },\n \"../data/FranceBorders.kml\",\n {\n visibility: true,\n styleMap:styles,\n originators:[{\n logo:'ign',\n url:'http://professionnels.ign.fr/ficheProduitCMS.do?idDoc=5323861'\n }],\n minZoomLevel:0,\n maxZoomLevel:11\n }\n );\n\n //Ajout d'une couche WMS compatible Geoportail et Mercator Spherique\n var cadastro= viewer.getMap().addLayer(\"WMS\",\n {\n 'cadastro.layer.name':\n {\n 'de':'Spanisch kataster',\n 'en':'Spanish cadastre',\n 'es':'Cadastro español',\n 'fr':'Cadastre Espagnol',\n 'it':'Spagnolo Catasto'\n }\n },\n \"http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?\",\n {\n layers:'Catastro',\n format:'image/png',\n transparent:true\n },\n {\n singleTile:false,\n projection: 'EPSG:4326',\n srs:{'EPSG:4326':'EPSG:4326', 'EPSG:3857':'EPSG:3857'},//some supported SRS from capabilities\n // maxExtent expressed in EPSG:4326 :\n maxExtent: new OpenLayers.Bounds(-18.409876,26.275447,5.22598,44.85536),\n minZoomLevel:5,\n maxZoomLevel:15,\n opacity:1.0,\n units:'degrees',\n isBaseLayer: false,\n visibility:false,\n legends:[{\n style:'Default',\n href:'http://ovc.catastro.meh.es/Cartografia/WMS/simbolos.png',\n width:'160',\n height:'500'\n }],\n originators:[\n {\n logo:'catastro.es',\n pictureUrl:'http://www.catastro.meh.es/ayuda/imagenes/escudo.gif',\n url:'http://ovc.catastro.meh.es'\n }\n ]\n });\n\n //Ajout d'une couche WFS : les cours d'eau pour vérifier les reprojections\n var sandre= viewer.getMap().addLayer(\"WFS\",\n {\n 'sandre.layer.name':\n {\n 'de':\"Wasser kurses\",\n 'en':\"Water courses\",\n 'es':\"Cursos de agua\",\n 'fr':\"Cours d'eau\",\n 'it':\"Corsi d'acqua\"\n }\n },\n/* veille version\n \"http://services.sandre.eaufrance.fr/geo/zonage-shp?\",\n */\n/* url de test\n \"http://services.sandre.eaufrance.fr/geotest/mdo_metropole?\",\n */\n/* url sandre\n */\n \"http://services.sandre.eaufrance.fr/geo/mdo_FXX?\",\n {\n/* veille version\n typename: 'RWBODY'\n */\n typename:'MasseDEauRiviere'\n },\n {\n projection:'EPSG:2154',\n units:'m',\n // maxExtent expressed in EPSG:2154 :\n maxExtent: new OpenLayers.Bounds(-58253.71015916939,6031824.7296808595,1181938.177574663,7233428.222339219),\n minZoomLevel:11,\n maxZoomLevel:16,\n /**\n * wfs_options\n * optional: holds information about the wms layer behavior\n * optionnel: contient les informations permettant d'affiner le comportement de la couche wfs\n */\n protocolOptions:{\n featurePrefix:'sa',\n featureNS:'http://xml.sandre.eaufrance.fr/',\n geometryName:'msGeometry'\n },\n originators: [\n {\n logo:'sandre',\n pictureUrl: 'img/logo_sandre.gif',\n url: 'http://sandre.eaufrance.fr'\n }\n ],\n styleMap: new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({strokeColor:'#0000ff', strokeWidth:3}),\n \"select\" : new OpenLayers.Style({strokeColor:'#3399ff', strokeWidth:3})\n }),\n hover: false\n });\n\n // See OpenLayers spherical-mercator.html :\n // In order to keep resolutions, projection, numZoomLevels,\n // maxResolution and maxExtent are set for each layer.\n\n // OpenStreetMap tiled layer :\n var osmarender= new OpenLayers.Layer.OSM(\n \"OpenStreetMap (Mapnik)\",\n \"http://tile.openstreetmap.org/${z}/${x}/${y}.png\",\n {\n projection: new OpenLayers.Projection(\"EPSG:900913\"),\n units: \"m\",\n numZoomLevels: 18,\n maxResolution: 156543.0339,\n maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508),\n visibility: false,\n originators:[{\n logo:'osm',\n pictureUrl:'http://wiki.openstreetmap.org/Wiki.png',\n url:'http://wiki.openstreetmap.org/wiki/WikiProject_France'\n }]\n });\n viewer.getMap().addLayers([osmarender]);\n}", "function limpiarSeleccion() {\n \"use strict\";\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(positron);\n map.addLayer(positronLabels);\n map.addLayer(NodosLayer);\n}", "highlightLine() {\n const { mbMap } = this.mapboxLayer;\n if (!mbMap) {\n return;\n }\n const highlightLayerString = '(edge|station|full)_';\n const callLayersRegex = new RegExp(\n `^ipv_call_(${highlightLayerString})?${this.getCurrentLayer()}$`,\n );\n const callLayers = this.getDvLayers(callLayersRegex);\n const highlightLayersRegex = new RegExp(\n `^ipv_call_${highlightLayerString}${this.getCurrentLayer()}$`,\n );\n // Highlight lines only\n const selectedLines = this.selectedFeatures.filter(\n (feat) =>\n feat.getGeometry() instanceof MultiLineString ||\n feat.getGeometry() instanceof LineString,\n );\n callLayers.forEach((layer) => {\n if (selectedLines.length > 0) {\n mbMap.setLayoutProperty(layer.id, 'visibility', 'visible');\n if (\n highlightLayersRegex.test(getTrafimageFilter(layer)) ||\n /displace/.test(layer.id)\n ) {\n const idFilterExpression = [\n 'get',\n /^symbol$/.test(layer.type) ? 'direktverbindung_id' : 'id',\n ];\n // Reset filter to original state\n const originalFilter = this.getLayerOriginalFilter(\n layer.id,\n idFilterExpression,\n );\n mbMap.setFilter(layer.id, originalFilter);\n selectedLines\n .filter((feat) => !!feat.get('name'))\n .forEach((feature) => {\n // Add feature id filter\n const featureIdFilter = [\n ...mbMap.getFilter(layer.id),\n ['==', idFilterExpression, feature.get('id')],\n ];\n mbMap.setFilter(layer.id, featureIdFilter);\n });\n }\n if (this.highlightedStation) {\n const fullLayer = this.getDvLayers(\n new RegExp(`^ipv_call_full_${this.getCurrentLayer()}$`),\n )?.[0];\n mbMap.setLayoutProperty(fullLayer.id, 'visibility', 'none');\n }\n } else {\n mbMap.setLayoutProperty(layer.id, 'visibility', 'none');\n }\n });\n }", "updateOlliPositionsAoSimNoSmooth(positions) {\n for (let position of positions) {\n let coordinates = [position.coordinates[0], position.coordinates[1]];\n const data = {\n 'type': 'FeatureCollection',\n 'features': [{\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n }\n }]\n };\n let layerId = `olli-bus-${position.olliId}`;\n let layer = this.map.getSource(layerId);\n if (layer) {\n layer.setData(data);\n }\n else {\n this.map.addLayer({\n 'id': layerId,\n 'source': {\n 'type': 'geojson',\n 'data': data\n },\n 'type': 'symbol',\n 'layout': {\n 'icon-image': 'olli',\n 'icon-size': 0.75\n }\n });\n }\n }\n }", "vedicStart() {\n console.log(\"Vedic stage\", this._stage);\n switch (this._stage) {\n case 2: {\n // STAGE SECOND\n this.wrapperDelete(\"map\");\n this.displayMessage(\"Select facing wall\", \"danger\");\n $(\".property.description\").html(\"Select facing wall\");\n this.assist.drawMask({ layer: this.canvas, points: this.mapBoundariesCoords, size: this.RECT_SIZE, });\n this.assist.drawBoundaries({ layer: this.canvas, points: this.mapBoundariesCoords });\n this.assist.drawBharamNabhi({ layer: this.canvas, centroid: this.centroid, });\n this.assist.drawPolygon({ layer: this.canvas, points: this.vedicMapBoundariesCoords });\n\n let stageSecond = new StageSecond();\n stageSecond.startDrawing(this);\n } break;\n\n case 3: {\n this.hideMessage();\n this.wrapperDelete(\"map\");\n d3.select('.zoom-functionality').classed('d-none', false);\n d3.select(\".properties-section.decs\").classed('d-none', true);\n d3.select(\".measurement-section\").classed(\"d-none\", false);\n d3.select('.tools-section').classed('d-none', false);\n // d3.select('#vpm').classed('d-none',true);\n // d3.select('#mvpc').classed('d-none',true);\n this.assist.drawMask({ layer: this.canvas, points: this.mapBoundariesCoords, size: this.RECT_SIZE, });\n this.assist.drawBoundaries({ layer: this.canvas, points: this.mapBoundariesCoords });\n this.assist.drawBharamNabhi({ layer: this.canvas, centroid: this.centroid, });\n this.assist.drawDirectionLines(this.canvas, this.faceCoords, this.centroid, this.division, this.angle);\n this.assist.drawGrid(this.canvas, this.centroid, this.faceCoords, this.screenBoundariesCoords, this.division, this.angle, \"vedic\");\n\n this.assist.drawPolygon({ layer: this.canvas, points: this.vedicMapBoundariesCoords });\n this.assist.drawPolygonDiagonals({ points: this.vedicMapBoundariesCoords });\n this.assist.drawPolygonGrid({ points: this.vedicMapBoundariesCoords });\n this.createObject('g.vedic-polygon');\n this.vedic = new Vedic();\n this.vedic.startDrawing(this);\n }\n }\n }", "createoverlayDivInCenter(listDesIndicateursSelectioonnee , listMaxValueIndicateur, echelle ) {\n ////////////////\n\n var checkHistograme = true ;\n myExtObject.controlMapSevice.showLabel(null, \"remove\");\n myExtObject.desctory(); //vider la iste vectorLayerList\n var indecator = listDesIndicateursSelectioonnee[0];\n var urlvector;\n var valeurRectTBR = [];\n let type = \"\",\n entite;\n if ( echelle == \"region\") {\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.cocheReg +\"&viewparams=decoupage_id:\" +indecator.decoupage.id+'&outputFormat=application/json';\n entite = echelle\n }\n if ( echelle == \"province\") {\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.cochePrvToReg + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions + \";decoupage_id:\" + indecator.decoupage.id;\n entite = echelle\n }\n if ( echelle == \"commune\") {\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.coucheCmnToReg + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions + \";decoupage_id:\" + indecator.decoupage.id;\n entite = echelle\n }\n if ( echelle == \"cerclePrefArr\") {\n type = listDesIndicateursSelectioonnee[0].valeurIndicateurList[0].cerclePrefArr.type\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.cocheCerPrefArr + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions+\";decoupage_id:\" + indecator.decoupage.id+ \";type:\" + type;\n entite = 'cercle_pref_arr'\n }\n if ( echelle == \"uniteTerritorial\") {\n type = listDesIndicateursSelectioonnee[0].valeurIndicateurList[0].uniteTerritorial.type\n let categorie = listDesIndicateursSelectioonnee[0].valeurIndicateurList[0].uniteTerritorial.categorie.id.toString();\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.coucheUntToReg + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions+\";decoupage_id:\" + indecator.decoupage.id+ \";categorie_id:\"+ categorie;\n entite = 'unite_territorial'\n }\n if ( echelle == \"douarCentreUrb\") {\n type = listDesIndicateursSelectioonnee[0].valeurIndicateurList[0].douarCentreUrb.type\n urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.cocheDouarCentreUrb + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions+\";decoupage_id:\" + indecator.decoupage.id+ \";type:\" + type;\n entite = 'douar_centreurbain'\n }\n\n\n // urlvector = myExtObject.ref_Component.settings.geo.url + '?service=WFS&version=1.0.0&request=GetFeature&typeName=' + myExtObject.ref_Component.settings.geo.dataBase + ':' + myExtObject.ref_Component.settings.geo.cochePrvToReg + \"&outputFormat=application%2Fjson&viewparams=region_id:\" + myExtObject.stringAllRegions+\";decoupage_id:\" + indecator.decoupage.id;\n var vectorSourceRg = new ol.source.Vector({\n format: new ol.format.GeoJSON(),\n url: () => {\n return urlvector;\n },\n strategy: ol.loadingstrategy.bbox\n });\n // myExtObject.ref_Component.addBusy();//add bysy while histogramme is on...\n\n var identiteVectorLayer = IdentiteLayer.getInstance();\n var vectorLayer = new ol.layer.Vector({ updateWhileInteracting: false, source: vectorSourceRg });\n myExtObject.map.addLayer(vectorLayer);\n identiteVectorLayer.indecator = indecator;\n identiteVectorLayer.vectorLayer = vectorLayer;\n identiteVectorLayer.listOverlay = [];\n identiteVectorLayer.composentIdentiteLayerList = listDesIndicateursSelectioonnee;\n myExtObject.vectorLayerList.push(identiteVectorLayer); //remplir la liste vectorLayerList\n myExtObject.exploreCartSevice.pointerMoveInMap(identiteVectorLayer);\n\n var features = vectorSourceRg.getFeatures();\n var ResFeatures = [];\n var polygon;\n var nb;\n var data = [];\n // for (let item of listDesIndicateursSelectioonnee)\n // console.log(item.valeurIndicateurList);\n\n // var vals = JSON.stringify(listDesIndicateursSelectioonnee[0]);\n // console.log(vals);\n // console.log(console.log(Object.keys(listDesIndicateursSelectioonnee[0])));\n // for(var i=0, k=0;i<listDesIndicateursSelectioonnee[0].valeurIndicateurList.length;i++,k++)\n // for(var j=0; j< features.length;j++)\n // if(listDesIndicateursSelectioonnee[i].valeurIndicateurList[j].province.libelle == features[j].H.libelle){\n // polygon = turf.polygon(features[j].getGeometry().coordinates);\n // center = turf.centroid(polygon);\n // console.log(features[j].getGeometry());\n\n // for(var j=0; j< listDesIndicateursSelectioonnee[i].valeurIndicateurList.length;j++){\n // data.push(listDesIndicateursSelectioonnee[i].valeurIndicateurList[j]);\n // n = Math.round(8*Math.random());\n // nb += n;\n // }\n\n // ResFeatures[k] = new ol.Feature({\n // geometry : new ol.geom.Point(center.geometry.coordinates),\n // data: data,\n // size: nb\n // });\n // }\n // console.log(features);\n\n vectorSourceRg.on('change', (e) => {\n if(identiteVectorLayer.listOverlay == undefined || identiteVectorLayer.listOverlay == null || identiteVectorLayer.listOverlay.length == 0) {\n // console.log(\"vectorSourceRg.getFeatures() : \", vectorSourceRg.getFeatures())\n console.log(vectorSourceRg.getState());\n if (vectorSourceRg.getState() == 'ready') {\n var features = vectorSourceRg.getFeatures();\n // console.log(features);\n var listOverlay = [];\n var colors = ['#B18904', '#21610B', '#610B4B', '#0404B4', '#6E6E6E', '#81F7F3', '#FF9655', '#FFF263', '#6AF9C4', '#003300', '#adc2eb', '#ffffcc', '#a3a3c2'];\n //was added for chart in legend\n // var listRegionID = [] ;\n var heightValues = [];\n var histrogramValues = [] ;\n var uniteValue = \"\";\n var i = 0;\n for(var i = 0; i < features.length ; i++) {\n console.log(features[i].values_.libelle);\n var extent = features[i].getGeometry().getExtent();\n var center = ol.extent.getCenter(extent);\n let centerupdate = [];\n centerupdate[0] = center[0] /* +(center[0]/5) */ ;\n centerupdate[1] = center[1] /* +(center[1]/12.456801097018786) */ ;\n // console.log(centerupdate);\n var divregionid = features[i].values_['id_'+entite];\n var overlayDivDom = document.getElementById('highchartsDiv' + divregionid);\n // console.log(overlayDivDom);\n var innerDiv = $('<div id=\"overlayDiv' + divregionid + '\" style=\"height: 40px;width: 250px;\"></div>');\n $('#overlayDiv' + divregionid).append(innerDiv);\n var overlayDiv = new ol.Overlay({\n //positioning: 'bottom-center',\n position: centerupdate,\n element: overlayDivDom,\n offset: indecator.tabOffsetInHistogramme,\n });\n\n myExtObject.map.addOverlay(overlayDiv);\n\n\n listOverlay.push(overlayDiv);\n }\n // console.log(listOverlay.length);\n\n var innerDiv = $('<div id=\"overlayDivLg' + 100 + '\" style=\"height: 40px;width: 250px;\"></div>');\n\n // var divregionidNewDiv = features[0].values_['id_'+entite];\n var divtarget = $('#highchartsDivLg100');\n myExtObject.dividhistograme = '#highchartsDivLg100';\n divtarget.html('');\n identiteVectorLayer.listOverlay = listOverlay;\n // console.log(\"new target\",divtarget.html());\n }\n //was added for chart in legend\n // add functiuon\n\n var arrrayRect = []\n var arrryRactHiegh = [] ;\n var arrryRactHieghSorted = [] ;\n var arrrayRectSorted = [] ;\n var valueArrayRect = [];\n var arrayRectY = [];\n var arrayRectX = [];\n var arrryRectHalf = [];\n var sortedhalf = [] ;\n console.log(listMaxValueIndicateur);\n for (let index = 0; index < listMaxValueIndicateur.length; index++) {\n var rect = $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).clone();\n var hightRect = $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).height();\n var hightRectY = $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).attr(\"y\");\n var hightRectX = $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).attr(\"x\");\n //console.log(hightRect, hightRectX, hightRectY);\n arrrayRect.push(rect);\n arrrayRectSorted.push(rect);\n arrryRactHiegh.push(hightRect);\n arrryRactHieghSorted.push(hightRect);\n valueArrayRect.push(listMaxValueIndicateur[index].valeur);\n arrayRectY.push(hightRectY);\n arrayRectX.push(Number(hightRectX));\n var half = hightRect /2 ;\n arrryRectHalf.push(half);\n sortedhalf.push(half)\n }\n\n\n // sorting min to max\n\n sortedhalf.sort(function(a, b) { return b-a });\n arrryRactHieghSorted.sort(function(a, b) { return b-a });\n arrrayRectSorted.sort(function(a, b) { return b.attr('height')-a.attr('height') });\n arrayRectX.sort(function(a, b) { return b-a });\n var maxValueRect = Math.max(...valueArrayRect) ;\n var maxRect = Math.max(...arrryRactHiegh) / 2 ;\n var maxHighRect = Math.max(...arrryRactHiegh) ;\n var maxRectIndex = arrryRactHiegh.indexOf(Math.max(...arrryRactHiegh));\n var maxRectY = Number(arrayRectY[maxRectIndex]);\n\n myExtObject.yRect = [] ;\n myExtObject.xRect = [] ;\n myExtObject.sortedRect = [] ;\n $($(divtarget.find(\"g.highcharts-series-group\")).find(\"rect\")).each(function(index) {\n /* fonction de calcule centimeters = pixels * 2.54 / 96\n */\n // var centimeteresClone Number(Number.parseFloat(centimeteres).toFixed(4))\n\n // max centime\n var centimeteresMax = ( maxValueRect * 2.54) / 96 ;\n // var centimeteresMaxClone = Number(Number.parseFloat(centimeteresMax).toFixed(4));\n /// 100 %\n const valueCent = 100 ;\n /// centimeter\n var centimeteres = (arrryRactHiegh[index] * 2.54) / 96 ;\n var valeurRectCurrent = valueArrayRect[index] ;\n var routeurvalueTRB = ( centimeteres / valeurRectCurrent ) * maxValueRect ;\n // var centimeteresClone = Number(Number.parseFloat(centimeteres).toFixed(4));\n var xvalue = (valueCent * routeurvalueTRB ) / centimeteresMax ;\n var valueRect = (maxValueRect * xvalue ) / valueCent ;\n\n valeurRectTBR.push(valueRect);\n // console.log(xvalue, valueRect, valeurRectTBR);\n\n\n })\n\n\n // var div = '<table class=\"table \"><thead><tr>'+' <th scope=\"col\">#</th>'+'<th scope=\"col\">Max</th>'+'</tr>'+'</thead>'+'</table>';\n\n // divtarget.css(\"display\",\" inline-block\");\n // $($('#legend-group-indicateur').find('.geostats-legend-title')).after($(tbl));\n\n // var targetDiv = $('<div id=\"div-target\" ></div>');\n // targetDiv.append(divtarget);\n\n // var uniteValue = (listDesIndicateursSelectioonnee[0] && listDesIndicateursSelectioonnee[0].unite && listDesIndicateursSelectioonnee[0].unite.libelle) ? listDesIndicateursSelectioonnee[0].unite.libelle : \"\";\n\n if (listMaxValueIndicateur !== undefined && listMaxValueIndicateur.length > 0 ) {\n for (let index = 0; index < listMaxValueIndicateur.length; index++) {\n // console.log( $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).height() );\n const value = $($(\"#highchartsDiv\"+listMaxValueIndicateur[index][echelle+'Id']).find(\"g.highcharts-series-group\")).find(\"rect\").eq(index).height();\n\n // console.log(\"vals : \" ,valeurRectTBR)\n if (valueArrayRect.length > 0) {\n var option = { y: listMaxValueIndicateur[index].valeur , color: colors[index] };\n // console.log( option );\n histrogramValues.push(option)\n }\n heightValues.push(listMaxValueIndicateur[index].valeur);\n // var option = {y: listMaxValueIndicateur[index].valeur , color:colors[index]};\n // histrogramValues.push(option)\n }\n // console.log(histrogramValues);\n // console.log(\"vals : \" , histrogramValues)\n var maxValue = Math.max(...heightValues);\n // console.log(\"vals\",histrogramValues);\n // console.log(maxValue);\n // histrogramValues.sort(function(a ,b ) {\n // return a.y - b.y;\n // })\n // console.log(\"vals\",histrogramValues);\n // console.log(\"the value hight \")\n // $(\"#container-charts\").height(85)\n // console.log(histrogramValues);\n myExtObject.ref_Component.getHistogramme(heightValues, histrogramValues);\n // Max to Min\n // heightValues.sort(function(a, b){return b - a});\n\n\n }\n\n // console.log(\"value of id region ordered\" , listRegionID)\n\n }\n })\n\n\n\n ////////////////\n myExtObject.controlMapSevice.showLabel(urlvector);\n myExtObject.controlMapSevice.showLabel(null, \"show\");\n this.addListogrammeLegend(listDesIndicateursSelectioonnee , listMaxValueIndicateur);\n\n\n }", "function chooseMap(ilmakuva) {\n // Set the label to the aerial imagery name\n map.setLayoutProperty(currentLayer, 'visibility', 'none');\n currentLayer = toggleableLayers[0]['layers'][ilmakuva];\n map.setLayoutProperty(currentLayer, 'visibility', 'visible');\n document.getElementById('slider-label').textContent = currentLayer;\n }", "function limpiarSeleccion() {\n \"use strict\";\n\n var i;\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(Stamen_Watercolor);\n map.addLayer(positronLabels);\n map.addLayer(DptosLayer);\n\n document.getElementById('selDepartamento').value = 'all';\n document.getElementById('selMunicipio').value = 'all';\n document.getElementById('selTipoAccion').value = 'all';\n document.getElementById('selTipoLider').value = 'all';\n document.getElementById('selResponsable').value = 'all';\n document.getElementById('buscarPalabra').value = '';\n\n fechaInicial = startFechaTotal;\n fechaFinal = endFecha;\n cb(startFechaTotal, endFecha);\n\n if (document.getElementById('selMunicipio').options.length > 1) {\n for (i = document.getElementById('selMunicipio').options.length - 1; i >= 1; i--) {\n document.getElementById('selMunicipio').remove(i);\n }\n }\n\n // Recupera el listado inicial\n filtroDataDpto = JSON.parse(JSON.stringify(violencia_selectiva_departamento));\n $(\"#total_places\").text(0);\n\n $(\".divinfo\")[0].hidden = false;\n\n violencia_selectiva_departamento_layer = renderMarkersData(violencia_selectiva_departamento_geo, 5);\n map.addLayer(violencia_selectiva_departamento_layer);\n map.fitBounds(violencia_selectiva_departamento_layer.getBounds());\n}", "openMap() {\n this._map._mapSet.compoennt.fetchMap(this.options.mapID, this.options.mapSetID);\n }", "function ay(){ci()(this,{$overlaysCollection:{enumerable:!0,get:this.getOverlaysCollection}})}", "apply() {\n SwitchProjection.getInstance().start(this['projection']['code']);\n }", "function initMap() {\n\t var map = new google.maps.Map(document.getElementById('map'), {\n\t zoom: mapZoom,\n\t center: clientMapCenter,\n\t styles: [\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.icon\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#bdbdbd\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#b9f1c1\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#688c6d\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#ffffff\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.arterial\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#dadada\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.local\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.line\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.station\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#c9c9c9\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#70d2f0\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t }\n\t\t\t\t]\n\t });\n\n\t var myLocation = new google.maps.Marker({\n\t\t\t position: map.getCenter(),\n\t\t\t icon: {\n\t\t\t path: google.maps.SymbolPath.CIRCLE,\n\t\t\t scale: 5,\n\t\t\t strokeColor: '#00a2d0'\n\t\t\t },\n\t\t\t draggable: true,\n\t\t\t map: map,\n\t\t\t title: 'You are here!',\n\t\t\t });\n\n\n\n\t // var infoWindow = new google.maps.InfoWindow({map: map});\n\n\t // // Try HTML5 geolocation.\n\t // if (navigator.geolocation) {\n\t // navigator.geolocation.getCurrentPosition(function(position) {\n\t // var pos = {\n\t // lat: position.coords.latitude,\n\t // lng: position.coords.longitude\n\t // };\n\n\t // infoWindow.setPosition(pos);\n\t // infoWindow.setContent('You');\n\t // map.setCenter(pos);\n\t // }, function() {\n\t // handleLocationError(true, infoWindow, map.getCenter());\n\t // });\n\t // } else {\n\t // // Browser doesn't support Geolocation\n\t // handleLocationError(false, infoWindow, map.getCenter());\n\t // }\n\n \tvar marker;\n\n \tvar infoWindow = new google.maps.InfoWindow({\n\t\t \tcontent: ''\n\t\t });\n\n\t \n\t clientResults.forEach(function(recyclingHotSpot){\n\t \tmarker = new google.maps.Marker({\n\t\t position: {\n\t\t \tlat: parseFloat(recyclingHotSpot.latitude), \n\t\t \tlng: parseFloat(recyclingHotSpot.longitude)\n\t\t },\n\t\t map: map,\n\t\t title: recyclingHotSpot.name,\n\t\t icon: 'http://127.0.0.1:8081/images/marker.png',\n\t\t clickable: true,\n\t\t\n\t\t });\n\n\t\t marker.addListener('click', function(){\n\t\t \tinfoWindow.close();\n\t\t \tinfoWindow.setContent(recyclingHotSpot.address);\n\t\t \tinfoWindow.open(map, this);\n\t\t \t\n\t\t });\t\n\t });\n\t }", "function clickToFeature(e) {\t\t\r\n\t\tmap.fitBounds(e.target.getBounds());\r\n \r\n\t\t//crida a funció que retorna indicador GDP del pais clicat\r\n\t\t//li passa l'objecte senser amb totes les propietats (atributs de l'element)\r\n\t\t//perquè desde la funció retornaGDP el que es fa és actualitzar el panell dinàmic info.\r\n\t\t// Crida a funcio que retorna el GDP del pais clicat\r\n\r\n\t\tretornaGDP(e.target.feature.properties); \r\n retornaCGD(e.target.feature.properties);\r\n retornaHealth(e.target.feature.properties);\r\n\t\t\r\n\t}", "function mapExistingServiceDeskInfo() {\r\n \t$scope.dealDetails.offshoreSelected= $scope.existingServiceDeskInfo.offshoreAllowed == true ? \"Yes\" : \"No\";\r\n\t $scope.dealDetails.standardwindowInfoSelected= $scope.existingServiceDeskInfo.levelOfService;\r\n \t\t$scope.dealDetails.towerArchitect = $scope.existingServiceDeskInfo.towerArchitect;\r\n\t $scope.serviceDeskInfo.multiLingual = $scope.existingServiceDeskInfo.multiLingual == true ? \"Yes\" : \"No\";\r\n\t $scope.serviceDeskInfo.tooling = $scope.existingServiceDeskInfo.toolingIncluded == true ? \"Yes\" : \"No\";\r\n \t$scope.selectedSolutionId = $scope.existingServiceDeskInfo.selectedContactSolution;\r\n \tif($scope.selectedSolutionId != null){\r\n \t\t\tvar CustomSolutionName = _.where($scope.solList, {solutionId: $scope.selectedSolutionId})[0].solutionName;\r\n \t \t\tif(CustomSolutionName != 'Custom'){\r\n \t \t\t\t$scope.onChangeDistSetting($scope.selectedSolutionId);\r\n \t \t\t}\r\n \t\t}\r\n \tgetExistingServiceDeskYearlyInfo();\r\n }", "function mapExistingServiceDeskInfo() {\r\n \t$scope.dealDetails.offshoreSelected= $scope.existingServiceDeskInfo.offshoreAllowed == true ? \"Yes\" : \"No\";\r\n\t $scope.dealDetails.standardwindowInfoSelected= $scope.existingServiceDeskInfo.levelOfService;\r\n \t\t$scope.dealDetails.towerArchitect = $scope.existingServiceDeskInfo.towerArchitect;\r\n\t $scope.serviceDeskInfo.multiLingual = $scope.existingServiceDeskInfo.multiLingual == true ? \"Yes\" : \"No\";\r\n\t $scope.serviceDeskInfo.tooling = $scope.existingServiceDeskInfo.toolingIncluded == true ? \"Yes\" : \"No\";\r\n \t$scope.selectedSolutionId = $scope.existingServiceDeskInfo.selectedContactSolution;\r\n \tif($scope.selectedSolutionId != null){\r\n \t\t\tvar CustomSolutionName = _.where($scope.solList, {solutionId: $scope.selectedSolutionId})[0].solutionName;\r\n \t \t\tif(CustomSolutionName != 'Custom'){\r\n \t \t\t\t$scope.onChangeDistSetting($scope.selectedSolutionId);\r\n \t \t\t}\r\n \t\t}\r\n \tgetExistingServiceDeskYearlyInfo();\r\n }", "addUserParcelsLayer(layerURL) {\n var user = this.get('parcels.user');\n var _this = this;\n\n // Symbol for painting parcels\n var symbol = this.get('userParcelSymbol');\n var querySentence = \"\";\n\n // Common online and offline FeatureLayer creator and injector\n function createAndAddFL(layerReference, event) {\n var featureLayer = new FeatureLayer(layerReference, {\n model: FeatureLayer.MODE_SNAPSHOT,\n outFields: ['PARCEL_ID'],\n definitionExpression: querySentence\n });\n\n featureLayer.setSelectionSymbol(symbol);\n\n var readyEvent = featureLayer.on(event, () => {\n\n // Draw parcels, and if online, store layer\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n\n // Each time map is being panned, draw parcels\n var drawEvent = _this.get('map').on('pan-end', () => {\n Ember.run.once(_this, () => {\n drawOwnerParcels(featureLayer, symbol, _this.get('parcelsGraphics'), user);\n\n // And if online, store layer\n if (navigator.onLine) {\n _this.storeUserParcelsLayer();\n }\n });\n });\n _this.set('drawEvent', drawEvent);\n\n readyEvent.remove();\n });\n\n _this.get('layersMap').set('userParcelsLayer', featureLayer);\n _this.get('map').addLayer(featureLayer);\n }\n\n // Query, to gather only user parcels from the FeatureLayer service\n this.get('parcels.user.parcels').then((parcels) => {\n var userParcels = parcels.map((parcel) => parcel.get('parcelId').toUpperCase());\n\n for (var i = 0; i < userParcels.length - 1; i++) {\n querySentence += \"PARCEL_ID = '\" + userParcels[i] + \"' or \";\n }\n querySentence += \"PARCEL_ID = '\" + userParcels[userParcels.length - 1] + \"'\";\n\n if (navigator.onLine) {\n createAndAddFL(layerURL, 'update-end');\n } else {\n this.get('editStore').getFeatureLayerJSON(function (success, featureLayer) {\n if (success) {\n Ember.debug('usersParcelLayer loaded successfully from the storage');\n createAndAddFL(featureLayer, 'resume');\n }\n });\n }\n });\n }", "function makeActive (markers_id, fromAction) {\n if (markers_id.length>0) {\n \n if (convex_hull.isVisible()) {\n mamufasPolygon();\n }\n \n \n for (var i=0; i<markers_id.length; i++) {\n var marker_id = markers_id[i].catalogue_id;\n occurrences[marker_id].setActive(!occurrences[marker_id].data.geocat_active);\n\n // Add or deduct the marker from _active_markers\n if (!occurrences[marker_id].data.active) {\n convex_hull.deductPoint(marker_id);\n } else {\n convex_hull.addPoint(occurrences[marker_id]);\n }\n }\n \n //If the action doesnt come from the UnredoOperations object\n if (!fromAction) {\n actions.Do('active', null, markers_id);\n }\n \n if (convex_hull.isVisible()) {\n $(document).trigger('occs_updated');\n }\n }\n\t\t\t}", "function initMap()\n\n\n {\n var options = {\n mode: 'normal',\n territory: 'FXX'\n };\n\n _viewer = new Geoportal.Viewer.Default(_mapDivId, options, OpenLayers.Util.extend(\n options, window.gGEOPORTALRIGHTSMANAGEMENT === undefined ? {\n 'apiKey': 'cleok'\n } : gGEOPORTALRIGHTSMANAGEMENT));\n\n if (!_viewer)\n {\n throw new Error(\"Failed to intilise the Geoportal viewer\");\n }\n\n //Remove logo and copyright\n var dirts = [_viewer.getMap().getControlsByClass('Geoportal.Control.PermanentLogo')[0],\n _viewer.getMap().getControlsByClass('Geoportal.Control.Logo')[0],\n _viewer.getMap().getControlsByClass('Geoportal.Control.TermsOfService')[0]];\n\n for (var k = 0, dirtLen = dirts.length; k < dirtLen; k++) {\n _viewer.getMap().removeControl(dirts[k]);\n }\n\n //Hide copyright\n //document.getElementById(\"cp_Geoportal.Control.Information_55\").style.display = \"none\";\n\n //---- LAYERS\n\n //---- PREDEFINED GEOPORTAL LAYERS\n try {\n\n _viewer.addGeoportalLayer('GEOGRAPHICALGRIDSYSTEMS.MAPS', {});\n _viewer.addGeoportalLayer('ORTHOIMAGERY.ORTHOPHOTOS', {});\n //_viewer.addGeoportalLayer('ORTHOIMAGERY.ORTHOPHOTOS.PARIS', {});\n }\n catch (e) {\n console.error(\"Something went wrong while loading one of the Geoportal layer\")\n }\n\n // ---- OPEN DATA TREES (Paris 12)\n // @TODO : load this kind of data from db or conf files\n\n // var treeLayerStyle = new OpenLayers.StyleMap(new OpenLayers.Style(\n // {\n // 'externalGraphic': 'img/arbre.png',\n // 'graphicWidth': \"${dimension}\",\n // 'graphicHeight': \"${dimension}\"\n // },\n // {\n // context: {\n // dimension: function (feature)\n // {\n // if (typeof(feature.attributes.count) === 'undefined') { // not a cluster, atomic feature\n // return 15;\n // }\n // else\n // {\n // var featuresInCluster = feature.attributes.count;\n // if ( featuresInCluster >= 1000){\n // return 40;\n // }\n // else if (featuresInCluster >= 100) {\n // return 30;\n // }\n // else {\n // return 20;\n // }\n // }\n // }\n // }\n // })\n // );\n //\n //\n // try {\n // _viewer.getMap().addLayer(\n // \"WFS\",\n // 'Trees',\n // \"http://localhost/cgi-bin/mapserv.exe?map=..%5Cwfs.map&\", //@todo change hard coded address\n // {typename:'trees_wfs'},\n // {\n // featurePrefix:'ms',\n // featureNS:'http://mapserver.gis.umn.edu/mapserver',\n // geometryName:'msGeometry',\n // projection:'EPSG:2154',\n // maxExtent:new OpenLayers.Bounds(653227.687500,6858349.000000, 657171.625000, 6861778.000000),\n // styleMap:treeLayerStyle,\n // visibility:false,\n // strategies:[new OpenLayers.Strategy.Fixed(), new OpenLayers.Strategy.Cluster({\n // distance: 40,\n // threshold: 10\n // })]\n // });\n // }\n // catch (e) {\n // console.error(\"Unable to access open data on mapserver\");\n // console.error(e.message);\n // }\n\n //--- CURRENT POSITION\n _currentPosLayer = new OpenLayers.Layer.Vector(\"Current Position\");\n _viewer.getMap().addLayer(_currentPosLayer);\n\n var currentPosGeom = new OpenLayers.Geometry.Point(_currentPos.easting, _currentPos.northing);\n\n // converting from lambert93 to viewer srs\n currentPosGeom = currentPosGeom.transform(new OpenLayers.Projection(\"EPSG:2154\"), _viewer.getMap().getProjectionObject());\n var truckFeature = new OpenLayers.Feature.Vector(currentPosGeom, {},\n {\n externalGraphic: \"images/position.png\",\n graphicWidth: 35,\n graphicHeight: 71\n });\n\n /*var frustumFeature = new OpenLayers.Feature.Vector(currentPosGeom.clone(), {},\n {\n externalGraphic: \"images/frustum.png\",\n graphicWidth: 46,\n graphicHeight: 129\n });*/\n\n _currentPosLayer.addFeatures([/*frustumFeature,*/truckFeature]);\n\n // click on map move the current position and the position in the 3D world if possible\n // add the control enabling it there\n OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {\n defaultHandlerOptions: {\n 'single': true,\n 'double': true,\n 'pixelTolerance': 0,\n 'stopSingle': false,\n 'stopDouble': false\n },\n handleRightClicks: true,\n initialize: function(options) {\n\n\n // Get control of the right-click event:\n document.getElementById('geoportailDiv').oncontextmenu = function(e) {\n e = e ? e : window.event;\n if (e.preventDefault)\n e.preventDefault(); // For non-IE browsers.\n else\n return false; // For IE browsers.\n };\n\n\n this.handlerOptions = OpenLayers.Util.extend({}, this.defaultHandlerOptions);\n OpenLayers.Control.prototype.initialize.apply(this, arguments);\n this.handler = new OpenLayers.Handler.Click(\n this,\n {\n 'click': this.trigger,\n\n }, this.handlerOptions\n );\n },\n //@todo\n trigger: function(e) {\n\n var lonlat = _viewer.getMap().getLonLatFromPixel(e.xy);\n lonlat.transform(_viewer.getMap().getProjectionObject(), new OpenLayers.Projection(\"EPSG:2154\"));\n Navigation.goToClosestPosition({x: lonlat.lon, y: 0, z: lonlat.lat}, {distance: 100});\n\n },\n \n\n });\n\n var click = new OpenLayers.Control.Click();\n _viewer.getMap().addControl(click);\n click.activate();\n\n //--- PANORAMICS (dev helper @todo see how to exclude it when building)\n if (DEBUG === true) {\n _panoramicLayer = new OpenLayers.Layer.Vector(\"Zone Accquisition\");\n\n // _itineraryLayer **********************************************\n _itineraryLayer = new OpenLayers.Layer.Vector(\"Biking Navigation\");\n _viewer.getMap().addLayer(_itineraryLayer);\n\n _laserLayer = new OpenLayers.Layer.Vector(\"Laser Mesure\");\n _viewer.getMap().addLayer(_laserLayer);\n\n _geoveloLayer= new OpenLayers.Layer.Vector(\"geovelo\");\n _viewer.getMap().addLayer(_geoveloLayer);\n\n _selectControl = new OpenLayers.Control.SelectFeature(_panoramicLayer, {\n onSelect: function(feature)\n {\n _selectedFeature = feature;\n var popup = new OpenLayers.Popup.FramedCloud(\"Pano\",\n feature.geometry.getBounds().getCenterLonLat(),\n null,\n \"<div style='font-size:.8em'>\\n\\\n <p>Easting : \" + feature.attributes.easting + \"</p>\\n\\\n <p>Northing : \" + feature.attributes.northing + \"\\n\\\n <p>Distance to position : \" + feature.attributes.distance + \"<p>\\n\\\n <p>Orientation to position : \" + feature.attributes.orientation + \"<p>\\n\\\n </div>\",\n null, true, function(evt) {\n _selectControl.unselect(_selectedFeature)\n });\n feature.popup = popup;\n //_viewer.getMap().addPopup(popup);\n },\n onUnselect: function(feature) {\n _viewer.getMap().removePopup(feature.popup);\n feature.popup.destroy();\n feature.popup = null;\n },\n hover: false\n });\n _viewer.getMap().addLayer(_panoramicLayer);\n\n //_viewer.getMap().addControl(_selectControl);\n //_selectControl.activate();\n }\n\n var initPos = currentPosGeom.clone();\n initPos.transform(_viewer.getMap().getProjectionObject(), new OpenLayers.Projection(\"CRS:84\"))\n\n _viewer.getMap().setCenterAtLonLat(initPos.x, initPos.y, 17);\n\n _viewer.openToolsPanel(false);\n _viewer.openLayersPanel(false);\n _viewer.setInformationPanelVisibility(false);\n _viewer.setToolsPanelVisibility(false);\n\n _initialized = true;\n _initializing = false;\n\n // Cartography.rotatePositionMarker(-90);//_heading); console.log(\"HEADIIIING\",_heading);\n }", "function initMap()\n\n\n {\n var options = {\n mode: 'normal',\n territory: 'FXX'\n };\n\n _viewer = new Geoportal.Viewer.Default(_mapDivId, options, OpenLayers.Util.extend(\n options, window.gGEOPORTALRIGHTSMANAGEMENT === undefined ? {\n 'apiKey': 'cleok'\n } : gGEOPORTALRIGHTSMANAGEMENT));\n\n if (!_viewer)\n {\n throw new Error(\"Failed to intilise the Geoportal viewer\");\n }\n\n //Remove logo and copyright\n var dirts = [_viewer.getMap().getControlsByClass('Geoportal.Control.PermanentLogo')[0],\n _viewer.getMap().getControlsByClass('Geoportal.Control.Logo')[0],\n _viewer.getMap().getControlsByClass('Geoportal.Control.TermsOfService')[0]];\n\n for (var k = 0, dirtLen = dirts.length; k < dirtLen; k++) {\n _viewer.getMap().removeControl(dirts[k]);\n }\n\n //Hide copyright\n //document.getElementById(\"cp_Geoportal.Control.Information_55\").style.display = \"none\";\n\n //---- LAYERS\n\n //---- PREDEFINED GEOPORTAL LAYERS\n try {\n\n _viewer.addGeoportalLayer('GEOGRAPHICALGRIDSYSTEMS.MAPS', {});\n _viewer.addGeoportalLayer('ORTHOIMAGERY.ORTHOPHOTOS', {});\n //_viewer.addGeoportalLayer('ORTHOIMAGERY.ORTHOPHOTOS.PARIS', {});\n }\n catch (e) {\n console.error(\"Something went wrong while loading one of the Geoportal layer\")\n }\n\n // ---- OPEN DATA TREES (Paris 12)\n // @TODO : load this kind of data from db or conf files\n\n // var treeLayerStyle = new OpenLayers.StyleMap(new OpenLayers.Style(\n // {\n // 'externalGraphic': 'img/arbre.png',\n // 'graphicWidth': \"${dimension}\",\n // 'graphicHeight': \"${dimension}\"\n // },\n // {\n // context: {\n // dimension: function (feature)\n // {\n // if (typeof(feature.attributes.count) === 'undefined') { // not a cluster, atomic feature\n // return 15;\n // }\n // else\n // {\n // var featuresInCluster = feature.attributes.count;\n // if ( featuresInCluster >= 1000){\n // return 40;\n // }\n // else if (featuresInCluster >= 100) {\n // return 30;\n // }\n // else {\n // return 20;\n // }\n // }\n // }\n // }\n // })\n // );\n //\n //\n // try {\n // _viewer.getMap().addLayer(\n // \"WFS\",\n // 'Trees',\n // \"http://localhost/cgi-bin/mapserv.exe?map=..%5Cwfs.map&\", //@todo change hard coded address\n // {typename:'trees_wfs'},\n // {\n // featurePrefix:'ms',\n // featureNS:'http://mapserver.gis.umn.edu/mapserver',\n // geometryName:'msGeometry',\n // projection:'EPSG:2154',\n // maxExtent:new OpenLayers.Bounds(653227.687500,6858349.000000, 657171.625000, 6861778.000000),\n // styleMap:treeLayerStyle,\n // visibility:false,\n // strategies:[new OpenLayers.Strategy.Fixed(), new OpenLayers.Strategy.Cluster({\n // distance: 40,\n // threshold: 10\n // })]\n // });\n // }\n // catch (e) {\n // console.error(\"Unable to access open data on mapserver\");\n // console.error(e.message);\n // }\n\n //--- CURRENT POSITION\n _currentPosLayer = new OpenLayers.Layer.Vector(\"Current Position\");\n _viewer.getMap().addLayer(_currentPosLayer);\n\n var currentPosGeom = new OpenLayers.Geometry.Point(_currentPos.easting, _currentPos.northing);\n\n // converting from lambert93 to viewer srs\n currentPosGeom = currentPosGeom.transform(new OpenLayers.Projection(\"EPSG:2154\"), _viewer.getMap().getProjectionObject());\n var truckFeature = new OpenLayers.Feature.Vector(currentPosGeom, {},\n {\n externalGraphic: \"images/position.png\",\n graphicWidth: 35,\n graphicHeight: 71\n });\n\n /*var frustumFeature = new OpenLayers.Feature.Vector(currentPosGeom.clone(), {},\n {\n externalGraphic: \"images/frustum.png\",\n graphicWidth: 46,\n graphicHeight: 129\n });*/\n\n _currentPosLayer.addFeatures([/*frustumFeature,*/truckFeature]);\n\n // click on map move the current position and the position in the 3D world if possible\n // add the control enabling it there\n OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {\n defaultHandlerOptions: {\n 'single': true,\n 'double': true,\n 'pixelTolerance': 0,\n 'stopSingle': false,\n 'stopDouble': false\n },\n handleRightClicks: true,\n initialize: function(options) {\n\n\n // Get control of the right-click event:\n document.getElementById('geoportailDiv').oncontextmenu = function(e) {\n e = e ? e : window.event;\n if (e.preventDefault)\n e.preventDefault(); // For non-IE browsers.\n else\n return false; // For IE browsers.\n };\n\n\n this.handlerOptions = OpenLayers.Util.extend({}, this.defaultHandlerOptions);\n OpenLayers.Control.prototype.initialize.apply(this, arguments);\n this.handler = new OpenLayers.Handler.Click(\n this,\n {\n 'click': this.trigger,\n\n }, this.handlerOptions\n );\n },\n //@todo\n trigger: function(e) {\n\n var lonlat = _viewer.getMap().getLonLatFromPixel(e.xy);\n lonlat.transform(_viewer.getMap().getProjectionObject(), new OpenLayers.Projection(\"EPSG:2154\"));\n Navigation.goToClosestPosition({x: lonlat.lon, y: 0, z: lonlat.lat}, {distance: 100});\n\n },\n \n\n });\n\n var click = new OpenLayers.Control.Click();\n _viewer.getMap().addControl(click);\n click.activate();\n\n //--- PANORAMICS (dev helper @todo see how to exclude it when building)\n if (DEBUG === true) {\n _panoramicLayer = new OpenLayers.Layer.Vector(\"Zone Accquisition\");\n\n // _itineraryLayer **********************************************\n _itineraryLayer = new OpenLayers.Layer.Vector(\"Biking Navigation\");\n _viewer.getMap().addLayer(_itineraryLayer);\n\n _laserLayer = new OpenLayers.Layer.Vector(\"Laser Mesure\");\n _viewer.getMap().addLayer(_laserLayer);\n\n _geoveloLayer= new OpenLayers.Layer.Vector(\"geovelo\");\n _viewer.getMap().addLayer(_geoveloLayer);\n\n _selectControl = new OpenLayers.Control.SelectFeature(_panoramicLayer, {\n onSelect: function(feature)\n {\n _selectedFeature = feature;\n var popup = new OpenLayers.Popup.FramedCloud(\"Pano\",\n feature.geometry.getBounds().getCenterLonLat(),\n null,\n \"<div style='font-size:.8em'>\\n\\\n <p>Easting : \" + feature.attributes.easting + \"</p>\\n\\\n <p>Northing : \" + feature.attributes.northing + \"\\n\\\n <p>Distance to position : \" + feature.attributes.distance + \"<p>\\n\\\n <p>Orientation to position : \" + feature.attributes.orientation + \"<p>\\n\\\n </div>\",\n null, true, function(evt) {\n _selectControl.unselect(_selectedFeature)\n });\n feature.popup = popup;\n //_viewer.getMap().addPopup(popup);\n },\n onUnselect: function(feature) {\n _viewer.getMap().removePopup(feature.popup);\n feature.popup.destroy();\n feature.popup = null;\n },\n hover: false\n });\n _viewer.getMap().addLayer(_panoramicLayer);\n\n //_viewer.getMap().addControl(_selectControl);\n //_selectControl.activate();\n }\n\n var initPos = currentPosGeom.clone();\n initPos.transform(_viewer.getMap().getProjectionObject(), new OpenLayers.Projection(\"CRS:84\"))\n\n _viewer.getMap().setCenterAtLonLat(initPos.x, initPos.y, 17);\n\n _viewer.openToolsPanel(false);\n _viewer.openLayersPanel(false);\n _viewer.setInformationPanelVisibility(false);\n _viewer.setToolsPanelVisibility(false);\n\n _initialized = true;\n _initializing = false;\n\n // Cartography.rotatePositionMarker(-90);//_heading); console.log(\"HEADIIIING\",_heading);\n }", "function drawCountries() {\n\t\t\tvar map = VectorlayerService.getMap();\n\t\t\t\tvm.map = map;\n\t\t\t\tvm.mvtSource = VectorlayerService.getLayer();\n\t\t\t\t$timeout(function() {\n\t\t\t\t\tif ($state.params.countries) {\n\t\t\t\t\t\tvm.mvtSource.options.mutexToggle = false;\n\t\t\t\t\t\tvm.mvtSource.setStyle(invertedStyle);\n\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[vm.current.iso].selected = true;\n\t\t\t\t\t\tvar countries = $state.params.countries.split('-vs-');\n\t\t\t\t\t\tangular.forEach(countries, function(iso) {\n\t\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[iso].selected = true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvm.mvtSource.setStyle(countriesStyle);\n\t\t\t\t\t\tif ($state.params.item) {\n\t\t\t\t\t\t\tvm.mvtSource.layers[vm.mvtCountryLayerGeom].features[$state.params.item].selected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//vm.mvtSource.redraw();\n\t\t\t\t});\n\t\t\t\tvm.mvtSource.options.onClick = function(evt, t) {\n\n\t\t\t\t\tif (!vm.compare.active) {\n\t\t\t\t\t\tvar c = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\tif (typeof c[vm.structure.name] != \"undefined\") {\n\t\t\t\t\t\t\t$mdSidenav('left').open();\n\t\t\t\t\t\t\tvm.current = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoastr.error('No info about this location!', evt.feature.properties.admin);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar c = getNationByIso(evt.feature.properties[vm.iso_field]);\n\t\t\t\t\t\tif (typeof c[vm.structure.name] != \"undefined\") {\n\t\t\t\t\t\t\tvm.toggleCountrieList(c);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoastr.error('No info about this location!', evt.feature.properties.admin);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t}", "function OverviewMap(options) {\n var _this = this;\n this._darkColor = '#011c2c';\n this._hclStyle = null;\n this._syncEvents = [];\n this._options = {\n style: 'light',\n zoomOffset: -5,\n mapStyle: 'road',\n width: 150,\n height: 150,\n syncZoom: true,\n syncBearingPitch: true,\n overlay: 'area',\n interactive: true,\n zoom: 1,\n minimized: false,\n showToggle: true,\n visible: true,\n markerOptions: {},\n shape: 'square'\n };\n this._source = new azmaps.source.DataSource();\n this._layers = {\n lineLayer: new azmaps.layer.LineLayer(this._source, null, {\n fillColor: 'orange',\n filter: ['get', 'visible']\n }),\n polygonLayer: new azmaps.layer.PolygonLayer(this._source, null, {\n strokeColor: 'orange',\n filter: ['get', 'visible']\n })\n };\n this._icon = \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' viewBox='0 0 24 24'%3E%3Cpath fill='{color}' d='M24 20.5V6.7c0-1.8-1.4-3.256-3.1-3.256-1.708 0-3.098 1.457-3.098 3.256v6.754L5.29.94A3.092 3.092 0 0 0 .908.939a3.097 3.097 0 0 0 0 4.382l12.447 12.446H6.63c-1.825 0-3.303 1.387-3.303 3.1s1.478 3.098 3.303 3.098l14.058-.002c1.826.002 3.305-1.387 3.306-3.096-.001-.045-.014-.083-.016-.128.003-.06.018-.12.018-.18z'/%3E%3C/svg%3E\\\")\";\n this._btnCss = \".azmaps-overviewMap{z-index:200;padding:5px;box-shadow:0px 0px 4px rgba(0,0,0,0.5);border:none;border-collapse:collapse;border-radius:5px;transition:width 0.5s ease-in-out 0s, height 0.5s ease-in-out 0s;background:url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32px' height='32px' viewBox='0 0 500 500'%3E%3Cpath stroke='Gray' fill='none' stroke-width='20' d='M249,55a195,195 0 1,0 2,0zm1,0v390m195-195H55 M99,130a260,260 0 0,0 302,0 m0,240 a260,260 0 0,0-302,0 M235,60a250,250 0 0,0 0,382 m30,0 a250,250 0 0,0 0-382'/%3E%3C/svg%3E\\\") no-repeat center center}\" +\n '.azmaps-overviewMapDiv{position:relative;height:100%;width:100%;transition:opacity 0.5s ease-in-out 0s}' +\n '.azmaps-overviewMapBtn{position:absolute;margin:0;padding:0;border:none;border-collapse:collapse;width:22px;height:22px;text-align:center;cursor:pointer;line-height:32px;border-radius:5px;z-index:200;background:no-repeat center center;background-image:{icon};background-size:12px;transition:transform 0.5s ease-in-out 0s}' +\n '.azmaps-overviewMapBtn:hover{background-image:{iconHover}}' +\n '.azmaps-overviewMap-round{border-radius:50%}.azmaps-overviewMap-round canvas{border-radius:50%}';\n this._btnRotation = 0;\n /****************************\n * Private Methods\n ***************************/\n /**\n * Event handler for when the marker is dragged to a new position.\n */\n this._markerdDragged = function () {\n var pos = _this._marker.getOptions().position;\n _this._overviewMap.setCamera({ center: pos });\n };\n /**\n * An event handler for when the map style changes. Used when control style is set to auto.\n */\n this._mapStyleChanged = function () {\n var self = _this;\n if (self._mapContainer && self._btn && !self._hclStyle) {\n var c = self._getColorFromMapStyle();\n self._mapContainer.style.backgroundColor = c;\n self._btn.style.backgroundColor = c;\n }\n };\n /**\n * Toggle event handler for expand/collapse button.\n */\n this._toggle = function () {\n var self = _this;\n var opt = self._options;\n opt.minimized = !opt.minimized;\n self._setBtnState();\n };\n /** Function that animates the resizing of the overview map when the width/height animates a change. */\n this._resize = function () {\n var self = _this;\n self._overviewMap.resize();\n if (performance.now() - self._resizeStart > 550) {\n //Stop animation.\n clearInterval(self._interval);\n self._interval = null;\n }\n };\n if (options) {\n this.setOptions(options);\n }\n }", "function initMap (data) {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: latLong,\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n displayGoogleMarkers (data,map);\n}", "function iniciar(){\n require([\"esri/Map\",\"esri/views/SceneView\",\"esri/layers/Layer\",\"esri/PopupTemplate\",\"esri/core/watchUtils\"],\n function(Map, SceneView, Layer, PopupTemplate,watchUtils) { \n var map = new Map({\n basemap: \"streets\" \n });\n \n /*Layer.fromArcGISServerUrl({\n url: \"http://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Continents/FeatureServer/0\",\n properties: {\n popupTemplate: new PopupTemplate({\n title: \"Continente {CONTINENT}\",\n content: \"Ganaste o Perdiste (Mejorando la dinámica de #Bitor)\"\n })\n }\n }).then(function(layer){\n map.add(layer);\n });*/\n \n view = new SceneView({\n container: \"mapa\",\n map: map,\n padding: {\n bottom: 50,\n top: -30\n }\n });\n \n watchUtils.watch(view, 'zoom', function(){\n //console.log(view.zoom);\n \n });\n \n view.then(function(){\n //darInstrucciones();\n }, function(error){\n console.log(\"No se ha podido cargar el mapa.\");\n });\n \n view.on(\"click\", function(evt) {\n //esto va en popup\n //features: [result],\n //location: result.geometry.centroid\n if (evt.mapPoint) {\n lat = Math.round(evt.mapPoint.latitude * 1000) / 1000;\n lon = Math.round(evt.mapPoint.longitude * 1000) / 1000;\n mostrarInfo(); \n }\n });\n \n var tablaIndicadores = document.createElement(\"table\");\n tablaIndicadores.innerHTML = '<thead><tr><th style=\"text-align: center;\">Indicador</th><th style=\"text-align: center;\">Valor</th></tr></thead><tbody><tr><td>Inscripción escolar</td><td id=\"primaria\"></td></tr><tr><td>Población con acceso al agua</td><td id=\"agua\"></td></tr><tr><td>Población con acceso a la electricidad</td><td id=\"luz\"></td></tr><tr><td>Desempleo</td><td id=\"desempleo\"></td></tr><tr><td>Muerte por condiciones nutricionales</td><td id=\"muerte\"></td></tr><tr><td>Esperanza de vida</td><td id=\"vida\"></td> </tr></tbody>';\n \n var divImagenes = document.createElement(\"div\");\n divImagenes.id = \"imagenes\";\n divImagenes.style = \"width:300px; height=200px; display:none;\";\n divImagenes.innerHTML = '<figcaption id=\"imgTitle\"></figcaption><img name=\"Vivienda\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick=\"openModal(); currentSlide(1)\"><img name=\"Ambiente\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick=\"openModal();currentSlide(2)\"><img name=\"Educación\" class=\"mySlide hover-shadow cursor\" src=\"\" width=\"300\" height=\"200\" onclick = \"openModal();currentSlide(3)\">';\n \n var divPais = document.createElement(\"div\");\n divPais.style = \"text-align: center;\";\n var h4 = document.createElement(\"h4\");\n h4.id = \"pais\";\n h4.style = \"background-color: white; color: black;\";\n var img = document.createElement(\"img\");\n img.id = \"bandera\";\n img.width = 200;\n img.height = 100;\n divPais.appendChild(h4);\n divPais.appendChild(img);\n \n view.ui.padding = { top: 30, left: 0, right: 15, bottom: 30 };\n view.ui.empty(\"top-left\");\n getVideo();\n view.ui.add(divPais, \"top-right\");\n view.ui.add(tablaIndicadores, \"bottom-left\");\n view.ui.add(divImagenes, \"bottom-right\");\n });\n}", "addToChangeLayers(){\n let _to = this.props.toVersion.key;\n //attribute change in protected areas layers\n this.addLayer({id: window.LYR_TO_CHANGED_ATTRIBUTE, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.4)\", \"fill-outline-color\": \"rgba(99,148,69,0.8)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //geometry change in protected areas layers - to\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //added protected areas layers\n this.addLayer({id: window.LYR_TO_NEW_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(63,127,191,0.2)\", \"fill-outline-color\": \"rgba(63,127,191,0.6)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_NEW_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(63,127,191)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n \n }", "function setBaseMapPROCStyle(Layer, zoom){\n if (zoom>=9){\n scaled_size = 1.5\n }\n else{\n scaled_size = 1\n }\n Layer.setStyle(function(feature) {\n if (feature.getProperty('Type') == 'DES_CBG_pts'){\n CapSt = feature.getProperty(\"CapSt\")\n CapHW = feature.getProperty(\"CapHW\")\n CapCW = feature.getProperty(\"CapCW\")\n color = 'black';\n scale = 2.5*scaled_size;\n visibility_item = document.getElementById('DEScheckBox').checked;\n if (CapSt == 0 && CapHW==0 && CapCW==0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n if (feature.getProperty('Type') == 'PROC'){\n avg_pc = feature.getProperty(\"AVG_PC\")\n avg_ph = feature.getProperty(\"AVG_PH\")\n color = '#00e832';\n scale = 2.5*scaled_size;\n// if you want PROC points to appear on the map, change this to true!\n visibility_item = false\n if (avg_pc == 0 && avg_ph==0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n return ({cursor: 'pointer',\n icon: { \n path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,\n strokeWeight: 0.5,\n strokeColor: 'black',\n strokeOpacity: opacity,\n scale: scale,\n fillColor: color,\n fillOpacity: opacity,\n },\n visible: visibility_item,\n })\n });\n}", "function drawMap(){\n // Map Calling & customization\n mapboxgl.accessToken = 'pk.eyJ1IjoibWlja2V5bWljazI1IiwiYSI6ImNqOThvcmY0ejBwdjYyd24ycmUwb2J5OG8ifQ.FtLU2J74aNJxTx7_WTRxlw';\n map = new mapboxgl.Map({\n container: 'map', // container id\n style: 'mapbox://styles/mickeymick25/cj9ffl8ym04tj2ro4zbvmj9n2', // stylesheet location\n center: [2.095, 48.745], // starting position [lng, lat]\n zoom: 8, // starting zoom\n //bearing: 21.60,\n //pitch: 40\n });\n\n // Add controls to the map\n var nav = new mapboxgl.NavigationControl();\n map.addControl(nav, 'bottom-right');\n\n //\n map.on('load', function(){\n map.addSource('points', {\n type: 'geojson',\n data: jsonFlightData.data\n });\n\n // Define a style for all the flights.\n map.addLayer({\n \"id\":\"flights\",\n \"type\":\"symbol\",\n \"source\": \"points\",\n \"layout\":{\n \"icon-image\": \"airport-15\",\n \"icon-rotate\": { \"type\": \"identity\", \"property\": \"heading\" },\n \"icon-allow-overlap\": false,\n \"icon-ignore-placement\": false,\n \"icon-pitch-alignment\" : \"map\"\n },\n \"paint\":{\n // \"icon-color\": \"#FF0000\"\n }\n });\n });\n\n /* Define interaction with flights */\n map.on('click', 'flights', function(e){\n map.flyTo({center: e.features[0].geometry.coordinates});\n console.log(\"flight event: Flight clicked!\");\n console.log(\"flight event: Flight \"+e.features[0].properties.callsign);\n });\n\n map.on('mouseenter', 'flights', function(){\n console.log(\"flight event: Mouse entered!\");\n });\n\n map.on('mouseleave', 'flights', function(){\n console.log(\"flight event: Mouse leaved!\");\n });\n\n window.setInterval(function() {\n console.log(\"------------------------------------ Log\");\n getFlights();\n map.getSource('points').setData(jsonFlightData.data);\n }, 10500);\n\n // window.setInterval(function(){\n //\n // }, 1000);\n\n}", "function init_Mapa1() {\n //Crear mapa en el elemento DOM\n var bingApiKey = \"AoqHQ_lF0XVJw-wQgHZa-nD_s49vCYuKDLzXriH-cgFPpI0l8bVw_C__Af5BNLnM\";\n\n var mapa = new ol.Map({\n view: new ol.View({\n zoom: 4,\n center: [-223293, 5247800],\n }),\n target: 'Mapa1',\n layers: [new ol.layer.Tile({\n source: new ol.source.BingMaps({\n key: bingApiKey,\n imagerySet: 'CanvasGray'\n }),\n title: 'CanvasGray'\n }),\n new ol.layer.Tile({\n source: new ol.source.TileWMS({\n url: 'http://demo.mapserver.org/cgi-bin/wms',\n params: {\n 'LAYERS': 'bluemarble'\n },\n }),\n opacity: 0.5\n })\n ]\n });\n}", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function draw(topo) {\n\n svg.append(\"path\")\n .datum(graticule)\n .attr(\"class\", \"graticule\")\n .attr(\"d\", path);\n\n\n g.append(\"path\")\n .datum({type: \"LineString\", coordinates: [[-180, 0], [-90, 0], [0, 0], [90, 0], [180, 0]]})\n .attr(\"class\", \"equator\")\n .attr(\"d\", path);\n\n draw_countries();\n\n //charles_de_gaulle\n //frankfurt_main\n //tansonnhat_intl\n\n layer_route = g.append(\"g\").attr(\"id\", \"layer_route\").attr(\"visibility\", \"hidden\");\n\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_0\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_1\").attr(\"visibility\", \"hidden\")); \n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_2\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_3\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_4\").attr(\"visibility\", \"visible\"));\n\n //swap\n var temp = layer_airport[0];\n layer_airport[0] = layer_airport[2];\n layer_airport[2] = temp;\n\n infoColorMeaning = d3.select(\"#container_map\").append(\"div\").attr(\"class\", \"cssinfo hidden\");\n\n var offsetL = document.getElementById(\"container_map\").offsetLeft + 20;\n var offsetT = document.getElementById(\"container_map\").offsetTop + 20;\n\n infoColorMeaning.classed(\"hidden\", false)\n .attr(\"style\", \"left:\" + offsetL + \"px;top:\" + offsetT + \"px\")\n .html(\"\");\n}", "function reloadData() {\r\n \r\n animiere();\r\n\r\n var vector = new ol.layer.Vector({\r\n source: new ol.source.GeoJSON({\r\n projection: 'EPSG:3857',\r\n url: '/data'\r\n }),\r\n style: new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: null,\r\n stroke: new ol.style.Stroke({\r\n color: getRandomColor(),\r\n width: 2\r\n })\r\n })\r\n })\r\n });\r\n if (map.getLayers().getLength() > 2) {\r\n map.getLayers().removeAt(1);\r\n }\r\n map.getLayers().push(vector);\r\n}", "async _updateParams() {\n const mapParams = this._getMapsParams();\n await this._updateBaseLayer();\n this._opensearchDashboardsMap.setLegendPosition(mapParams.legendPosition);\n this._opensearchDashboardsMap.setShowTooltip(mapParams.addTooltip);\n this._opensearchDashboardsMap.useUiStateFromVisualization(this.vis);\n }", "function MapLayerDirective(_layerService, _containerRef) {\n this._layerService = _layerService;\n this._containerRef = _containerRef;\n this._visible = true;\n this._addedToManager = false;\n this._id = layerId++;\n }", "function MapLayerDirective(_layerService, _containerRef) {\n this._layerService = _layerService;\n this._containerRef = _containerRef;\n this._visible = true;\n this._addedToManager = false;\n this._id = layerId++;\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 48.862725,\n lng: 2.287592000000018\n },\n zoom: 12\n });\n\n stations = Object.create(Stations);\n stations.init();\n\n markerCluster = new MarkerClusterer(map, stations.markers, {\n imagePath: 'assets/img/m'\n });\n\n if (localStorage.getItem('reservation') !== null)\n {\n var save = JSON.parse(localStorage.getItem('reservation'));\n stations.stationAfterRefresh(stations,save);\n }\n else\n {\n nom.innerHTML = \" \";\n adresse.innerHTML = \" \";\n emplacementLibre.innerHTML = \" \";\n dispo.innerHTML = \" \";\n timerReservation.innerHTML = \" \";\n stationReservee = false;\n }\n\n $('#reserverVelo').attr('disabled', true);\n\n btnReserver.addEventListener('click', function () {\n $('#reserverVelo').attr('disabled', true);\n $('#signature').removeAttr('hidden');\n initDraw();\n });\n\n btnAnnuler.addEventListener('click', function () {\n stations.effacerReservation();\n });\n\n btnValider.addEventListener('click', function () {\n stations.reserveStation(stations.trouveStation(numeroStation));\n $('#signature').attr('hidden', 'hidden');\n });\n}", "function applyThematicStyle() {\n //console.log(\"applyThematicStyle: initiated\");\n \n mapLoadMask.hide();\n \n // Create StyleMap-Object for the thematic layer\n thematicStyleMap = new OpenLayers.StyleMap({\n 'default': getThematicStyle(\"Staaten thematisch\")\n });\n staaten.addOptions({\n styleMap: thematicStyleMap\n });\n // Redraw staaten layer\n staaten.redraw();\n //console.log(\"applyThematicStyle: Layer wurde neu gezeichnet\");\n\n // Update vectorLegend\n vectorLegend.legendTitle = getActiveLegendTitle();\n vectorLegend.setRules();\n vectorLegend.update();\n \n }", "function requestSucceeded(json) {\n\t\t\t//console.log(json);\n\t\t\t// 1.2 if statement to pull back the name of the service for image services and other map services\n\t\t\tif(imageServ.checked){\n\t\t\tparentLayerName = json.name;\n\t\t\t}\n\t\t\telse{\n\t\t\tparentLayerName = json.mapName;\n\t\t\t}\n\t\t\t//console.log(json);\n\t\t\tserviceWKID = json.fullExtent.spatialReference.wkid;\n\t\t\tsingleFusedMapCache = JSON.stringify(json.singleFusedMapCache);\n\t\t\txmin = json.fullExtent.xmin;\n\t\t\tymin = json.fullExtent.ymin;\n\t\t\txmax = json.fullExtent.xmax;\n\t\t\tymax = json.fullExtent.ymax;\n\t\t\tcapabilities = json.capabilities;\n\t\t\t\n\t\t\t// 1.1.2 Checks for allowRasterFunction. Inferring Image service type. \n\t\t\tif(typeof(json.allowRasterFunction) != \"undefined\"){\n\t\t\t\n\t\t\timageServiceBool = true;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\n\t\t\timageServiceBool = false;\n\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\t// WKID validation\n\t\t\tif (serviceWKID!=mapWKID){\n\t\t\tmessage.innerHTML = '<div style=\"color:orange; width: 100%;\"><b>WARNING: Basemap and Service have different Spatial References</b></div>';\n\t\t\t}\n\t\t\t\n\t\t\t// Setting Service extent from JSON response\n\t\t\tserviceExtent = new Extent(xmin,ymin,xmax,ymax, new SpatialReference({ wkid:serviceWKID }));\n\t\t\t\n\t\t\t// Checking if layer has already been added \n\t\t\t for(var j = 0; j < map.layerIds.length; j++) {\n\t\t\t\tvar layer = map.getLayer(map.layerIds[j]);\n\t\t\t\t\n\t\t\t\tif (layer.url == serviceURL){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service already added</b></div>';\n\t\t\t\tthrow \"ERROR: Service already added\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t//if dynMapServ radio button is checked\n\t\t\tif(dynMapServ.checked) {\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == true){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is an image service. Select image service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is an image service. Select image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// If singleFusedMapCache is true, (inferring service has been cached)\n\t\t\t\t//1.1.3 added else if\n\t\t\t\telse if(singleFusedMapCache == \"true\"){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is cached. Select tiled/cached map service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is cached. Select tiled/cached map service.\"\n\t\t\t\t//1.1.3 added else\n\t\t\t\t}else{\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\tvar dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(serviceURL);\n\t\t\t\tdynamicMapServiceLayer.name = parentLayerName; // 1.1.1 - Sets dynamic service name\n\t\t\t\tdynamicMapServiceLayer.id = window.addedLayerIdPrefix + dynamicMapServiceLayer.name;\n\t\t\t\tmap.addLayer(dynamicMapServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\tdynamicMapServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Dynamic map service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t//if tileMapServ radio button is checked\n\t\t\t}else if(tileMapServ.checked) {\n\t\t\t\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == true){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is an image service. Select image service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is an image service. Select image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If singleFusedMapCache is false, (inferring service is dynamic)\n\t\t\t\t//1.1.3 added else if\n\t\t\t\telse if(singleFusedMapCache == \"false\"){ \n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is dynamic. Select dynamic map service</b></div>';\n\t\t\t\tthrow \"ERROR: Service is dynamic. Select dynamic map service.\"\n\t\t\t\t//1.1.3 added else\n\t\t\t\t}else{ \n\t\t\t\t\t\n\t\t\t\tvar tiledMapServiceLayer = new ArcGISTiledMapServiceLayer(serviceURL);\n\t\t\t\ttiledMapServiceLayer.name = parentLayerName;// 1.1.1 - Sets tiled service name\n\t\t\t\t\ttiledMapServiceLayer.id = window.addedLayerIdPrefix + tiledMapServiceLayer.name;\n\t\t\t\tmap.addLayer(tiledMapServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\ttiledMapServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Tiled map service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t//if imageServ radio button is checked\t\n\t\t\t}else if(imageServ.checked) {\n\t\t\t\t// 1.1.2 changed method for detecting an image service\n\t\t\t\tif(imageServiceBool == false){\n\t\t\t\tmessage.innerHTML = '<div style=\"color:red; width: 100%;\"><b>ERROR: Service is not an image service.</b></div>';\n\t\t\t\tthrow \"ERROR: Service is not an image service.\"\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// 1.2 cached image services brought in as tiled map services to display cache\n\t\t\t\telse if(imageServiceBool == true && singleFusedMapCache == \"true\"){\n\t\t\t\t\t\n\t\t\t\tvar imageServiceLayer = new ArcGISTiledMapServiceLayer(serviceURL);\n\t\t\t\timageServiceLayer.name = parentLayerName;// 1.1.1 - Sets tiled service name\n\t\t\t\timageServiceLayer.id = window.addedLayerIdPrefix + parentLayerName;\n\t\t\t\tmap.addLayer(imageServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\timageServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Cached image service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:orange; width: 100%;\"><b>Warning: Image service is cached therefore has been added as a tiled/cached map service.</b></div>';\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t//1.2 if image service is not cached, add it as an image service\n\t\t\t\telse{\n\t\t\t\tvar imageServiceLayer = new ArcGISImageServiceLayer(serviceURL);\n\t\t\t\timageServiceLayer.name = parentLayerName; // 1.1.1 - Sets tiled service name\n\t\t\t\timageServiceLayer.id = window.addedLayerIdPrefix + parentLayerName;\n\t\t\t\tmap.addLayer(imageServiceLayer);\n\t\t\t\t\t// layer loaded listener \n\t\t\t\t\timageServiceLayer.on(\"load\", function(){\n\t\t\t\t\t\tconsole.log(\"Image service Loaded successfully\");\n\t\t\t\t\t\tmessage.innerHTML = '<div style=\"color:green; width: 100%;\"><b>Service Loaded successfully</b></div>';\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t// Zoom to full extent of map service\n\t\tmap.setExtent(serviceExtent);\n\t\t\t\n\t\t}", "function addSelectedTrail (clicked) {\n // remove classes that color and filter the buttons when clicking on a specific table of contents trail, add btn-default so they all look the same, unselected\n if ($(\".btn-group\").children().hasClass(\"btn-primary\")) {$(\".btn-group\").children().removeClass(\"btn-primary\")};\n if ($(\".btn-group\").children().hasClass(\"btn-success\")) {$(\".btn-group\").children().removeClass(\"btn-success\")};\n if ($(\".btn-group\").children().hasClass(\"btn-danger\")) {$(\".btn-group\").children().removeClass(\"btn-danger\")};\n if ($(\".btn-group\").children().hasClass(\"btn-warning\")) {$(\".btn-group\").children().removeClass(\"btn-warning\")};\n $(\".btn-group\").children().addClass(\"btn-default\");\n if (map.hasLayer(selectedLayer)) { selectedLayer.clearLayers();}\n console.log(clicked.feature);\n selectedLayer.addData(clicked.feature);\n }", "updateOverlayMenu() {\n forEach(this.root.querySelectorAll('.data-layer > input'), (element) => {\n const label = element.nextSibling;\n const layerId = element.getAttribute('data-layer-id');\n const layer = this.InteractiveMap.getMapLayer(layerId);\n if (!layer) {\n label.style.display = 'none';\n }\n else {\n label.style.display = 'block';\n layer.setVisible(element.checked);\n }\n }, this);\n }", "function initOpenLayersMapLesLieux() {\n\n\t// Destruction de la cate précédente si elle existe déjà\n\tif (mapLesLieux != null) {\n\t\tmapLesLieux.setTarget(null);\n\t\tmapLesLieux = null;\n\t}\n\n\t// Liste des points\n\tvar pointFeatures = new Array();\n\tvar itemsCollection = App.Collections.itemsCollection;\n\titemsCollection.each(function(item) {\n\t\tvar cartos = item.get(\"cartos\");\n\t\tif (cartos) {\n\t\t\tif (cartos.get(\"y\") && cartos.get(\"x\")) {\n\t\t\t\tvar itemId = item.get(\"id\");\n\t\t\t\tvar motCle1 = item.get(\"motCle1\");\n\t\t\t\tvar motCle2 = item.get(\"motCle2\");\n\t\t\t\tvar motCle3 = item.get(\"motCle3\");\n\t\t\t\tvar titre = item.get(\"title\");\n\t\t\t\tvar user = item.get(\"user\").get(\"pseudo\");\n\t\t\t\tpointFeatures.push(\n\t\t\t\t\tnew ol.Feature({\n\t\t\t\t\t\tgeometry: new ol.geom.Point(ol.proj.transform([parseFloat(cartos.get(\"x\")), parseFloat(cartos.get(\"y\"))], 'EPSG:4326', 'EPSG:3857'))\n\t\t\t\t\t\t, itemId: itemId \n\t\t\t\t\t\t, motCle1: motCle1\n\t\t\t\t\t\t, motCle2: motCle2\n\t\t\t\t\t\t, motCle3: motCle3\n\t\t\t\t\t\t, titre: titre\n\t\t\t\t\t\t, pseudo: user\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n\t\n\t// Rendu de la carte\n\tmapLesLieux = new ol.Map({\n\t layers: [\n\t new ol.layer.Tile({\n\t source: new ol.source.OSM({})\n\t })\n\t , new ol.layer.Vector({\n\t source: new ol.source.Vector({\n\t features: pointFeatures\n\t }),\n\t style: new ol.style.Style({\n\t image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({\n\t scale: 0.25,\n\t src: 'http://cdn.aws.chatanoo.org/mjc/nogent/divers/cercleRouge.png'\n\t })),\n\t stroke: new ol.style.Stroke({\n\t width: 3,\n\t color: [255, 0, 0, 1]\n\t }),\n\t fill: new ol.style.Fill({\n\t color: [0, 0, 255, 0.6]\n\t })\n\t })\n\t })\n\t ],\n\t target: 'carte',\n\t view: new ol.View({\n\t center: ol.proj.transform([App.Views.appView.centerLatCarte, App.Views.appView.centerLongCarte], 'EPSG:4326', 'EPSG:3857'),\n\t zoom: App.Views.appView.zoomCarte\n\t })\n\t});\n\n\t// Clic sur les points\n\tmapLesLieux.on(\"click\", function(e) {\n\t mapLesLieux.forEachFeatureAtPixel(e.pixel, function (feature, layer) {\n\t\t\tvar v = App.eventManager;\n\t\t\tif (v) v.trigger(\"itemSelection\", feature.B.itemId, null, feature.B.motCle1, feature.B.motCle2, feature.B.motCle3, feature.B.titre, feature.B.pseudo);\n\t });\n\t});\n \n \t// Change le cursor en pointer sur les points\n var target = mapLesLieux.getTarget();\n var jTarget = typeof target === \"string\" ? $(\"#\" + target) : $(target);\n // change mouse cursor when over marker\n $(mapLesLieux.getViewport()).on('mousemove', function (e) {\n var pixel = mapLesLieux.getEventPixel(e.originalEvent);\n var hit = mapLesLieux.forEachFeatureAtPixel(pixel, function (feature, layer) {\n return true;\n });\n if (hit) {\n jTarget.css(\"cursor\", \"pointer\");\n } else {\n jTarget.css(\"cursor\", \"\");\n }\n });\n}", "updateCurrentGeojson(periodObj) {\n var self = this;\n this.currentGeojson = [];\n this.geojsonLayerSources.forEach(function(disease) {\n if (self.periodFilter(periodObj, disease.beginDate, disease.endDate, disease.duration)) {\n self.currentGeojson.push(disease.featuresCollection)\n }\n });\n\n // Update the map display\n this.updateReferences();\n }", "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "function adicionaNovoLayer(codigoMap)\n{\n\tcore_carregando(\"ativa\");\n\tcore_carregando($trad(\"msgAdicionaNovoLayer\",i3GEOadmin.editormapfile.dicionario));\n\tsUrl = \"../php/editormapfile.php?funcao=criarNovoLayer&codigoMap=\"+codigoMap;\n\tvar callback =\n\t{\n\t\tsuccess:function(o)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif(YAHOO.lang.JSON.parse(o.responseText) == \"erro\")\n\t\t\t\t{\n\t\t\t\t\tcore_carregando(\"<span style=color:red >\"+ $trad(\"erro\",i3GEOadmin.core.dicionario) +\"</span>\");\n\t\t\t\t\tsetTimeout(\"core_carregando('desativa')\",3000);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar dados = YAHOO.lang.JSON.parse(o.responseText);\n\t\t\t\t\tvar no = tree.getNodeByProperty(\"etiquetaLayers\",codigoMap);\n\t\t\t\t\tvar tempNode = new YAHOO.widget.HTMLNode(montaNoLayer(codigoMap,dados.layers[0]), no, false,true);\n\t\t\t\t\ttempNode.setDynamicLoad(loadLayerData, iconMode);\n\t\t\t\t\ttempNode.isLeaf = false;\n\t\t\t\t\ttempNode.enableHighlight = false;\n\t\t\t\t\ttree.draw();\n\t\t\t\t\t//editorGeral(codigoMap,dados.layers[0]);\n\t\t\t\t\teditorTitulo(codigoMap,dados.layers[0]);\n\t\t\t\t\tcore_carregando(\"desativa\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(e){core_handleFailure(e,o.responseText);}\n\t\t},\n\t\tfailure:core_handleFailure,\n\t\targument: { foo:\"foo\", bar:\"bar\" }\n\t};\n\tcore_makeRequest(sUrl,callback);\n}", "constructor(primaryMap, spyMap, options) {\n this._options = {\n borderColor: '#555555',\n borderWidth: 5,\n opacity: 1,\n shape: 'circle',\n size: 350\n };\n this._syncEvents = [];\n this._maps = [];\n this._primaryMap = primaryMap;\n this._spyMap = spyMap;\n var container = this._spyMap.getMapContainer();\n container.style.position = 'absolute';\n this._spyMap.events.add('ready', () => {\n container.getElementsByClassName('azure-map-logo')[0].style.display = 'none';\n container.getElementsByClassName('map-copyright')[0].style.display = 'none';\n });\n this.setOptions(this._options);\n if (options) {\n this.setOptions(options);\n }\n this._maps = [this._primaryMap, this._spyMap];\n //Bind sync events and synchronize the map views.\n this._maps.forEach((map, index) => {\n this._syncEvents[index] = this._synchronizeMaps.bind(this, map);\n });\n //Sync all map views with the first map.\n this._syncEvents[0]();\n //Attach the map move handler.\n this._attachMapMoveHandlers();\n }", "function highlightFeature(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 1,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n });\n\n\n// Para traer el poligono al frente\n /* if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }*/\n //console.log(layer.feature.properties);\n info.update(layer.feature.properties); //controla la info de la caja\n\n}", "function startHere(){\n createStartMap();// step 1: Create a map on load with basemap and overlay map (with empty faultlinesLayer & EarhtquakesLayer ).\n addFaultlinesLayer();//step 2: Query data and add them to faultlinesLayer \n addEarthquakesLayer(); //step 3: Query data and add them to EarhtquakesLayer \n}", "function setBaseMapPointsStyle(pointLayer, zoom, item, visibility){\n if (zoom>=9){\n scaled_size = 1.5\n }\n else{\n scaled_size = 1\n }\n pointLayer.setStyle(function(feature) {\n if (feature.getProperty('Type') == 'AD_pts'){\n color = 'blue';\n scale = 3.5*scaled_size;\n path = google.maps.SymbolPath.CIRCLE;\n visibility_item = document.getElementById('ADcheckBox').checked;\n }\n if (feature.getProperty('Type') == 'COMB_pts'){\n color = '#b2b2b2';\n scale = 3.5*scaled_size;\n path = google.maps.SymbolPath.CIRCLE;\n visibility_item = document.getElementById('CPcheckBox').checked;\n }\n if (feature.getProperty('Type') == 'W2E_pts'){\n color = 'yellow';\n scale = 5*scaled_size;\n path = google.maps.SymbolPath.CIRCLE;\n visibility_item = document.getElementById('W2EcheckBox').checked;\n }\n\n return ({cursor: 'pointer',\n visible: visibility_item,\n icon: { \n path: path,\n strokeWeight: 0.5,\n strokeColor: 'black',\n scale: scale,\n fillColor: color,\n fillOpacity: 1,\n }\n });\n\t });\n}", "function updateMapTime()\n {\n \t if(eventSliderOb != null)\n \t {\n \t \t//dateTime = eventSliderOb.getDateTime();\n\t\tvar dateTimeStr = eventSliderOb.getDateTimeInitialValue();\n\t\t\n\t\t//Upate with date time parameter\n\t\twmsLayer.paramsOb[timeDim] = dateTimeStr;\n\t\twmsLayer.refresh();\n\t\t \t \t\n \t \tupdateAnimationWidget(dateTimeStr);\n \t }\n }", "function onEachFeature(feature, layer) {\n feature.properties.algo = \"no\";\n\n info_asentamiento = getObjects(datos_encuesta, 'identificador', String(feature.properties.id));\n if (info_asentamiento[0]) {\n if (info_asentamiento[0].asentamiento_intervenido_techo != \"no\") {\n\n // console.log(layer.getBounds().getCenter());\n\n asentamiento_intervenido = L.marker(layer.getBounds().getCenter(), {}).on('click', function (e) { mymap.setView([e.latlng.lat, e.latlng.lng], 20); })\n LayerIntervenido.addLayer(asentamiento_intervenido);\n\n\n }\n }\n\n\n // layer.bindPopup(feature.properties.nombre); \n layer.on({\n // mouseover: highlightFeature,\n\n mouseout: resetHighlight,\n click: highlightFeature,\n dblclick: highlightFeatureFull\n });\n //layer.bindPopup(feature.properties.nombre); \n}" ]
[ "0.6041067", "0.58429295", "0.58237344", "0.5769705", "0.57498026", "0.557698", "0.5548231", "0.55145276", "0.5510567", "0.54791963", "0.5475966", "0.54692197", "0.54571754", "0.5453897", "0.540028", "0.53521776", "0.53401756", "0.531895", "0.531619", "0.53136617", "0.5307683", "0.5252601", "0.52506953", "0.52293575", "0.52290654", "0.52226055", "0.5218223", "0.5211599", "0.5176432", "0.5176174", "0.51439977", "0.51421386", "0.51389784", "0.51355827", "0.5133949", "0.51270485", "0.51102036", "0.5105956", "0.5102158", "0.51016235", "0.5091862", "0.5087881", "0.50723153", "0.5067112", "0.50531983", "0.5052781", "0.5043255", "0.5038455", "0.50327176", "0.50292283", "0.5027764", "0.5017457", "0.50086546", "0.5000901", "0.4995659", "0.4992832", "0.49855226", "0.49831206", "0.49660456", "0.4956548", "0.49537313", "0.49478412", "0.49457154", "0.49443188", "0.49414706", "0.49414304", "0.49414304", "0.49384555", "0.49261793", "0.49235722", "0.49235722", "0.49217114", "0.4920537", "0.49172416", "0.49144313", "0.4911395", "0.49097446", "0.49083543", "0.4906511", "0.4905967", "0.4897793", "0.48976228", "0.4892001", "0.4891407", "0.4891407", "0.4890889", "0.48893243", "0.488846", "0.48857516", "0.48760942", "0.4875943", "0.48688206", "0.48688138", "0.48678434", "0.48648897", "0.48606792", "0.4858172", "0.48544228", "0.48537704", "0.48531574" ]
0.613104
0
Expand the node (with the given child rule) Make children if the node has any
expandChildren(childRule, preventRecursion) { this.children = [] this.finishedText = '' // Set the rule for making children, // and expand it into section this.childRule = childRule if (this.childRule === undefined) { // In normal operation, this shouldn't ever happen this.errors.push('No child rule provided, can\'t expand children') console.warn('No child rule provided, can\'t expand children') } else { const sections = Parser.parse(childRule) // Add errors to this if (sections.errors.length > 0) { this.errors = this.errors.concat(sections.errors) } sections.forEach((section, i) => { this.children[i] = new EpuresNode(this, i, section) if (!preventRecursion) { this.children[i].expand(preventRecursion) } // Add in the finished text this.finishedText += this.children[i].finishedText }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decorateChildren() {\n this.forEachChild(aChild => {\n var element = this.getDomHelper().getElement(aChild.getId());\n if (element) {\n aChild.decorate(element);\n }\n });\n }", "add_child(node) {\n this.add_child_no_propagation(node);\n this.propagate_children_count(node.get_total_children_count() + 1)\n }", "addChildren(value) {}", "function expandAll(d) {\n if(d._children) expand(d);\n if(d.children) d.children.forEach(expandAll);\n} // end expandAll", "function expandChildren(index, chi){\n setTimeout(function () {\n //buildHeap([ 4, 3, 2, 9, 14, 29] );\n // console.log('hooho', nodes)\n if(nodes[index].children === null){\n nodes[0].children = [nodes[0]._children[chi]]\n }\n else{\n // console.log( typeof nodes[0]. children)\n nodes[index].children.push(nodes[index]._children[1])\n }\n// .h(nodes[0]._children[0]);\n //nodes[0]._children ;\n\n// console.log(nodes[index])\n update(nodes[index])\n if(chi < 1){\n expandChildren(0, 1)\n }\n }, 3000);\n\n}", "function expand(d) {\n\t //console.log('expanding ' + d.word);\n\t if (d.followWordObjs) {\n\t\tif (d.followWordObjs.length > 0) {\n\t\t //console.log(' * expanding fwos')\n\t\t d.children = d.followWordObjs;\n\t\t d.followWordObjs = null;\n\t\t d.children.forEach(expand)\n\t\t}\n\t }\n\t \n\t if (d.children) {\n\t\tif (d.children.length > 0) {\n\t\t d.children.forEach(expand)\n\t\t}\n\t }\n\t}", "add_child_no_propagation(node){\n this.children[node.get_token_string()] = [node.get_fragment_id(), node.node_id];\n node.set_parent_node(this);\n this.notify_fragment_dirty();\n }", "function addChild(child, node) {\n\t var children = node.children;\n\t\n\t if (child.parentNode === node) {\n\t return;\n\t }\n\t\n\t children.push(child);\n\t child.parentNode = node;\n\t }", "set hasChildren(value) {}", "addChild(child) {\n if (child.group === null) {\n child.setGroup(this);\n this.children.push(child);\n return true;\n }\n return false; \n }", "function processNode(node) {\n var nodeDef = {\n innerHTML: '#'+node._id,\n children: node.children.map(processNode)\n };\n\n if (nodeDef.children.length > 0) {\n nodeDef.collapsed = true;\n }\n\n return nodeDef;\n }", "function markAsDynamicChildren$1(children) {\n FromIteration$1.set(children, 1);\n }", "function expandTree(d) {\n if (d._children) {\n d.children = d._children;\n d._children = null;\n }\n if (d.children) {\n d.children.forEach(expandTree);\n }\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function expand(e, datanode, namespaces) {\n for (var c = e.firstChild; c != null; c = c.nextSibling) {\n if (c.nodeType != 1) {\n continue;\n }\n var dataexpr = c.getAttribute(\"data\");\n if (dataexpr) {\n // Evaluate XPath expression in context\n var n = starfish.xml.getNode(datanode, dataexpr, namespaces);\n // Delete any content of the element\n c.innerHTML = \"\";\n // And insert the text content of the XPath result\n c.appendChild(document.createTextNode(getText(n)));\n } else { // If we don't expand the element, recurse on it.\n expand(c, datanode, namespaces);\n }\n }\n }", "function addExpandedNodes(node) {\r\n\r\n //use cy.batch to make things more efficient. cy.batch waits until all new elements are added before calculating new positions and styles\r\n cy.batch(function(){\r\n\r\n //if current node does not accept anything, just do nothing\r\n if ((node.data('acc_evt')!=undefined) && !node.hasClass('expanded') && !node.hasClass('spec_end') && !node.hasClass('imp_end')){\r\n //create a new node and an edge, leading from current node to new node\r\n for (var i=0; i < node.data('acc_evt').length; i++) {\r\n if (node.data('acc_evt')[i]!=node.outgoers('edge').data().label){\r\n cy.add({\"data\":{\"id\":node.id()+\"dummy\"+i}, \"classes\":\"dummy\"+node.id()+\" \"+\"dummy\"});\r\n cy.add({\"data\":{\"id\":node.id()+\"edgeDummy\"+i, \"source\":node.id(), \"target\": node.id()+\"dummy\"+i, \"label\":node.data('acc_evt')[i]}, \"classes\": \"dummy\"+node.id()+\" \"+\"dummy\"});\r\n node.addClass('expanded');\r\n }\r\n\r\n }\r\n //for all newly created nodes, arrange them around their parent node in a circular shape\r\n cy.elements('.dummy'+node.id()).layout({name: 'circle', boundingBox: {\r\n x1: node.position('x'),\r\n x2: node.position('x'),\r\n y1: node.position('y'),\r\n y2: node.position('y')\r\n },\r\n concentric: function( n ){\r\n if( node.id() === n.id() ){\r\n return 2;\r\n } else {\r\n return 1;\r\n }\r\n },\r\n minNodeSpacing:1,\r\n levelWidth: function(){\r\n return 1;\r\n },\r\n fit:false, \r\n radius:100\r\n });\r\n }\r\n });\r\n}", "function NodeCanHaveChild() {\r\n Node.apply(this, arguments);\r\n this._children = []; \r\n}", "expandAll() {\n const data = this.dataManager.getData();\n const parentsToExpand = [];\n\n arrayEach(data, (elem) => {\n if (this.dataManager.hasChildren(elem)) {\n parentsToExpand.push(elem);\n }\n });\n\n this.expandMultipleChildren(parentsToExpand);\n\n this.renderAndAdjust();\n }", "addChild(childId) {\n if (!this.hasChild(childId)) {\n const child = this.getEntity(childId);\n if (child && child.hasComponent(Children)) {\n child.children.setParent(this.getEntity().id);\n } else {\n this.children.push(childId);\n }\n }\n }", "function addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}", "function expand(node, depth){\n\t // Space out based on the current depth so\n\t // this looks at least a little tree-like.\n\t for (var i = 0; i < depth; i++){\n\t traversalResult += \"-\";\n\t }\n\n\t // If there are no children (i.e., leaf nodes)...\n\t if (!node.children || node.children.length === 0){\n\t // ... note the leaf node.\n\t traversalResult += \"[\" + node.name + \"]\";\n\t traversalResult += \"\\n\";\n\t }else{\n\t // There are children, so note these interior/branch nodes and ...\n\t traversalResult += \"<\" + node.name + \"> \\n\";\n\t // .. recursively expand them.\n\t for (var i = 0; i < node.children.length; i++){\n\t expand(node.children[i], depth + 1);\n\t }\n\t }//eo if else\n\t }//eo expand", "function expandAllfoundnodes(d) {\n if (d._children) {\n d.children = d._children;\n d.children.forEach(expandAllfoundnodes);\n d._children = null;\n } else if (d.children)\n d.children.forEach(expandAllfoundnodes);\n}", "expand(preventRecursion) {\n if (!this.isExpanded) {\n this.isExpanded = true\n\n this.expansionErrors = []\n\n // Types of nodes\n // -1: raw, needs parsing\n // 0: Plaintext\n // 1: Tag (\"#symbol.mod.mod2.mod3#\" or \"#[pushTarget:pushRule]symbol.mod\")\n // 2: Action (\"[pushTarget:pushRule], [pushTarget:POP]\", more in the future)\n\n switch (this.type) {\n // Raw rule\n case -1:\n\n this.expandChildren(this.raw, preventRecursion)\n break\n\n // Plaintext, do nothing but copy text into finsihed text\n case 0:\n this.finishedText = this.raw\n break\n\n // Tag\n case 1: {\n // Parse to find any actions, and figure out what the symbol is\n this.preactions = []\n this.postactions = []\n\n const parsed = Parser.parseTag(this.raw)\n\n // Break into symbol actions and modifiers\n this.symbol = parsed.symbol\n this.modifiers = parsed.modifiers\n\n // Create all the preactions from the raw syntax\n parsed.preactions.forEach((preaction, i) => {\n this.preactions[i] = new NodeAction(this, preaction.raw)\n })\n\n // Make undo actions for all preactions (pops for each push)\n this.preactions.forEach(pa => {\n if (pa.type === 0) {\n this.postactions.push(pa.createUndo())\n }\n })\n\n // Activate all the preactions\n this.preactions.forEach(pa => pa.activate())\n\n this.finishedText = this.raw\n\n // Expand (passing the node, this allows tracking of recursion depth)\n const selectedRule = this.grammar.selectRule(this.symbol, this, this.errors)\n\n this.expandChildren(selectedRule, preventRecursion)\n\n // Apply modifiers\n this.modifiers.forEach(modName => {\n let modParams = []\n if (modName.indexOf('(') > 0) {\n const regExp = /\\(([^)]+)\\)/\n\n const results = regExp.exec(modName)\n if (results && results.length >= 2) {\n modParams = results[1].split(',')\n modName = modName.substring(0, modName.indexOf('('))\n }\n }\n\n const mod = this.grammar.modifiers[modName]\n\n // Missing modifier?\n if (mod) {\n this.finishedText = mod(this.finishedText, modParams)\n } else {\n this.errors.push('Missing modifier ' + modName)\n this.finishedText += '((.' + modName + '))'\n }\n })\n\n // Perform post-actions\n this.postactions.forEach(pa => pa.activate())\n break\n }\n case 2:\n // Just a bare action? Expand it!\n this.action = new NodeAction(this, this.raw)\n this.action.activate()\n\n // No visible text for an action\n this.finishedText = ''\n break\n default:\n\n }\n }\n }", "function setUpNodes(node) {\n\t if (node.children) {\n\t var childrenNodes = [];\n\t var _iteratorNormalCompletion10 = true;\n\t var _didIteratorError10 = false;\n\t var _iteratorError10 = undefined;\n\n\t try {\n\t for (var _iterator10 = node.children[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n\t var child = _step10.value;\n\t var childNode = makeNode.call(this, objectSpread({}, child, {\n\t parent: node\n\t }));\n\t childrenNodes.push(childNode);\n\t setUpNodes.call(this, childNode);\n\t }\n\t } catch (err) {\n\t _didIteratorError10 = true;\n\t _iteratorError10 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion10 && _iterator10[\"return\"] != null) {\n\t _iterator10[\"return\"]();\n\t }\n\t } finally {\n\t if (_didIteratorError10) {\n\t throw _iteratorError10;\n\t }\n\t }\n\t }\n\n\t node.children = childrenNodes;\n\t }\n\t}", "function expand(elementid)\r\n{\r\n\tvar parentElement = elementManager.get ( elementid );\r\n\tif ( parentElement.childcount != 0 )\r\n\t{\r\n\t\tdocument.getElementById(\"T\" + parentElement.id).innerHTML = \"(Loading \" + parentElement.childcount + \" children...)\";\r\n\t\tgetElementChildren ( elementManager.get ( elementid ),\r\n\t\t\tfunction ( children )\r\n\t\t\t{\r\n\t\t\t\tvar parent = document.getElementById(\"E\" + elementid);\r\n\t\t\t\tif ( children.length != 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tparent.className = \"minus\";\r\n\t\t\t\t\t// create a container for the children\r\n\t\t\t\t\tvar container = document.createElement(\"ul\");\r\n\t\t\t\t\tcontainer.id = \"C\" + elementid;\r\n\t\t\t\t\tparent.appendChild(container);\r\n\t\t\t\t\t// create elements for all the children inside the container\r\n\t\t\t\t\tfor ( const child of children )\r\n\t\t\t\t\t\tgenerateNode ( child, elementid );\r\n\t\t\t\t\tdocument.getElementById(\"T\" + parentElement.id).innerHTML = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tparent.className = \"empty\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n}", "function expand(node, depth) {\n // Space out based on the current depth so\n // this looks at least a little tree-like.\n for (var i = 0; i < depth; i++) {\n traversalResult += \"-\";\n }\n\n // If there are no children (i.e., leaf nodes)...\n if (!node.children || node.children.length === 0) {\n // ... note the leaf node.\n traversalResult += \"[\" + node.name + \"]\";\n traversalResult += \"\\n\";\n } else {\n // There are children, so note these interior/branch nodes and ...\n traversalResult += \"<\" + node.name + \"> \\n\";\n // .. recursively expand them.\n for (var i = 0; i < node.children.length; i++) {\n expand(node.children[i], depth + 1);\n }\n // depth-=1;\n }\n }", "update_child(child) {\n this.children[child.get_token_string()] = [child.get_fragment_id(), child.node_id]\n this.notify_fragment_dirty();\n }", "function processNode(node){\n processChild(node);\n for( i in node.children )\n processNode(node.children[i]);\n }", "function treeForEachChild(tree, action) {\n each(tree.node.children, function (child, childTree) {\n action(new Tree(child, tree, childTree));\n });\n}", "function expandForks(nodes, expandedNodes) {\n for(var i=0; i<nodes.length; i++) {\n if (nodes[i].nodeType === 'ACTION') {\n expandedNodes.push(nodes[i]);\n } else if (nodes[i].nodeType === 'FORK') {\n for (var j=0; j<nodes[i].branches.length; j++) {\n expandForks(nodes[i].branches[j], expandedNodes);\n }\n }\n }\n }", "expandDescendants(dataNode) {\n const toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }", "expand (node) {\n const plays = node.unexpandedPlays();\n const index = Math.floor(Math.random() * plays.length);\n const play = plays[index];\n\n const childState = this.game.nextState(node.state, play);\n const childUnexpandedPlays = this.game.legalPlays(childState);\n const childNode = node.expand(play, childState, childUnexpandedPlays);\n this.nodes[childState.hash()] = childNode;\n\n return childNode;\n }", "function collapse(node) {\n if (node.children) {\n node._children = node.children;\n node._children.forEach(collapse);\n node.children = null;\n }\n }", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "function addChildNode(child, node, sourceFile, appId) {\n var childType = child.type;\n if (child.type === \"Literal\") {\n if (child.value != undefined && typeof child.value === 'string') {\n childType = \"StringLiteral\";\n }\n else if (child.value != undefined && typeof child.value === 'number') {\n childType = \"NumberLiteral\";\n }\n else if (child.value != undefined && typeof child.value == 'boolean') {\n childType = \"BooleanLiteral\";\n }\n }\n\n var hasLoc = (child.loc != undefined), lineNumber, columnNumber;\n if (hasLoc) {\n lineNumber = child.loc.start.line;\n columnNumber = child.loc.start.column;\n }\n\n //Add this in the childNodes array of the current node\n var newCodeTreeNode = new CodeTreeNode(\"ast\", childType, node.codetreeref, sourceFile, appId);\n if (child.type === \"Literal\") newCodeTreeNode.abstractOut();\n if (hasLoc) newCodeTreeNode.addLoc(lineNumber, columnNumber);\n node.codetreeref.addChild(newCodeTreeNode);\n child.codetreeref = newCodeTreeNode;\n\n //Add values if necessary\n if (child.type === \"Literal\" && child.raw != undefined) {\n var newLiteralNode = new CodeTreeNode(\"ast\", \"\" + child.raw, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newLiteralNode.addLoc(lineNumber, columnNumber);\n newLiteralNode.abstractOut();\n newCodeTreeNode.addChild(newLiteralNode);\n }\n else if (child.type === \"Identifier\" && child.name != undefined) {\n var newNameNode = new CodeTreeNode(\"ast\", child.name, newCodeTreeNode, sourceFile, appId);\n if (hasLoc) newNameNode.addLoc(lineNumber, columnNumber);\n newNameNode.abstractOut();\n newCodeTreeNode.addChild(newNameNode);\n }\n else if (child.type === \"BinaryExpression\" || child.type === \"UpdateExpression\" || child.type === \"UnaryExpression\") {\n if (child.operator != undefined) {\n var newOperatorNode = new CodeTreeNode(\"ast\", child.operator, newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newOperatorNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newOperatorNode);\n }\n if (child.prefix != undefined) {\n var newPrefixNode = new CodeTreeNode(\"ast\", child.prefix + \"\", newCodeTreeNode, \n sourceFile, appId);\n if (hasLoc) newPrefixNode.addLoc(lineNumber, columnNumber);\n newCodeTreeNode.addChild(newPrefixNode);\n }\n }\n }", "function visitChildren (node, lamdba, optionalNodeTypeRestriction) {\n var nodeList = node.childNodes\n eachInNodeList(nodeList, lamdba, optionalNodeTypeRestriction)\n}", "update_children(){\n let children = this.get_children_objects()\n for (var i = 0; i < children.length; i++) {\n children[i].set_parent_node(this);\n }\n this.notify_fragment_dirty();\n }", "parseChild(parent, astElement, code, options) {\n const child = super.parseChild(parent, astElement, code, options);\n if (child instanceof JSXElement) {\n if (parent.oid) child._parent = parent.oid;\n }\n return child;\n }", "function populateNode(parent, child) {\n switch (child.nodeType) {\n case 1:\n var childNodes = parent.childNodes;\n if (childNodes.length !== 1 || childNodes[0] !== child) {\n resetAndPopulate(parent, child);\n }\n break;\n case 11:\n if (-1 < indexOfDiffereces(parent.childNodes, child.childNodes)) {\n resetAndPopulate(parent, child);\n }\n break;\n case 3:\n parent.textContent = child.textContent;\n break;\n }\n }", "function processChildren(node, delimeter) {\n if (typeof delimeter === 'function') {\n let prev = null;\n\n node.children.forEach(node => {\n if (prev !== null) {\n delimeter.call(this, prev);\n }\n\n this.node(node);\n prev = node;\n });\n\n return;\n }\n\n node.children.forEach(this.node, this);\n}", "function expand(id, recursive)\n {\n collapse(id, recursive, false);\n }", "function expandParents(node) {\n\t// set shortcut to the tree\n\tvar tree = Ext.getCmp(\"doctree\");\n\t// get rootnode for tree\n\tvar root = tree.getRootNode();\n\t// if node is equal to root, stop iteration\n\tif(node==root) {\n\t\treturn true;\n\t}\n\t// expand parent node\n\tnode.parentNode.expand();\n\t// recall function to recurse up the tree\n\texpandParents(node.parentNode);\n}", "function expandAllAbs(d){\n if('children' in d || '_children' in d){\n if(d.children){\n } else {\n d.children = d._children;\n d._children = null;\n }\n for(var i = 0;i<d.children.length;i++){\n expandAllAbs(d.children[i]);\n }\n }\n}", "promoteChild(parent, child) {\n let gpId = parent.parent;\n if (gpId) {\n let gp = this.nodes[gpId];\n if (gp.left === parent.id) {\n gp.left = child.id;\n }\n else if (gp.right === parent.id) {\n gp.right = child.id;\n }\n }\n // remap (grand) child's parent pointer to grandparent (new parent) or null if new apex\n child.parent = gpId;\n // remove parent from bst hashmap\n delete this.nodes[parent.id];\n return;\n }", "function ebx_DMANavigationTree_expandAll(treeName, nodeId) {\r\n\tebx_ajaxTreeReplaceChildren(treeName, nodeId, '&navigationTree_expandAll=true');\r\n}", "function expandNode(selfUL, nodeDIV, callback, ignoreOnExpand) {\r\n\t\t// var time0 = new Date().getTime();\r\n\r\n\t\tif ($.type(nodeDIV.target) != \"undefined\") {\r\n\t\t\tcallback = nodeDIV.callback;\r\n\t\t\tignoreOnExpand = nodeDIV.ignoreOnExpand;\r\n\t\t\tnodeDIV = nodeDIV.target;\r\n\t\t}\r\n\r\n\t\tvar opts = _options(selfUL);\r\n\t\tvar hit = $c(\"span.TrH\", $(nodeDIV));\r\n\t\tif (hit.length == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ($hc(\"TrH-E\", hit)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar node = getNode(selfUL, nodeDIV);\r\n\t\tif (!ignoreOnExpand && opts.onBeforeExpand.call(selfUL, node) == false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$ac(\"TrH-E\", $rc(\"TrH-C TrH-CH\", hit));\r\n\t\t$ac(\"TrI-FO\", hit.next());\r\n\r\n\t\tvar $node = $(nodeDIV);\r\n\t\tvar $subtree = $node.next(\"UL\");\r\n\t\tvar loaded = $node.attr(\"loaded\");\r\n\t\tvar children = node.children;\r\n\r\n\t\t// $log(\"ui.tree:expandNode: [\" + node.id + \"] loaded=[\" + (loaded || \"\") + \"], url=[\" + (node.url || \"\") + \"], children=[\" + (($.type(children) != \"string\" && children) ? children.length : 0) + \"]\");\r\n\r\n\t\tif ($.type(loaded) != \"undefined\" && loaded == \"0\" && node.url) {\r\n\t\t\t$node.attr(\"loaded\", \"2\");// means that this folder subtree is loading.\r\n\r\n\t\t\tif (!$subtree.length)\r\n\t\t\t\t$subtree = $('<ul></ul>').insertAfter(nodeDIV);\r\n\r\n\t\t\t// load nodes from children array\r\n\t\t\tif ($.type(children) != \"string\" && children && children.length) {\r\n\t\t\t\t$loading = $c(\"span.TrI-F\", $node);\r\n\t\t\t\t$ac(\"TrL\", $loading);\r\n\t\t\t\t_sto(loadNodes, 100, selfUL, $subtree[0], node.children, false, function(times) {\r\n\t\t\t\t\t_doExpand(times);\r\n\t\t\t\t\tif (times == 2)\r\n\t\t\t\t\t\t$rc(\"TrL\", $loading);\r\n\t\t\t\t}, $c(\"span.TrC1\", $node).length);\r\n\t\t\t} else {\r\n\t\t\t\t// load nodes from remote\r\n\t\t\t\trequest(selfUL, $subtree[0], node, {\r\n\t\t\t\t\tid : node.id\r\n\t\t\t\t}, function(times) {\r\n\t\t\t\t\t_doExpand(times);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t_doExpand();\r\n\t\t}\r\n\r\n\t\tfunction _doExpand(times) {\r\n\t\t\tif (opts.animate) {\r\n\t\t\t\t$subtree.slideDown(\"normal\", function() {\r\n\t\t\t\t\tif (!ignoreOnExpand)\r\n\t\t\t\t\t\topts.onExpand.call(selfUL, node);\r\n\r\n\t\t\t\t\tif (callback)\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t$subtree.css(\"display\", \"\");\r\n\r\n\t\t\t\tif (!ignoreOnExpand)\r\n\t\t\t\t\topts.onExpand.call(selfUL, node, times);\r\n\r\n\t\t\t\tif (callback)\r\n\t\t\t\t\tcallback(times);\r\n\r\n\t\t\t\t// $log(\"ui.tree:expandNode: END. \", time0);\r\n\t\t\t}\r\n\r\n\t\t\t$c(\"div.TrN-P:first\", $subtree).css(\"display\", \"block\");\r\n\t\t}\r\n\t}", "function expandParents(d) {\n while (d.parent) {\n d = d.parent;\n if (!d.children) {\n d.children = d._children;\n d._children = null;\n setToggleSymbol(d, attrs.COLLAPSE_SYMBOL);\n }\n }\n }", "insertionFix(tree, child){\n let node = this;\n // While node and parent are both Red\n while(node.color === Red && node.parent.color === Red){\n const parent = node.parent;\n const uncle = parent.getSibling();\n if(uncle && uncle.color === Red){ // Parent's sibling is Red\n uncle.color = Black;\n parent.color = Black;\n parent.parent.color = Red;\n node = parent.parent;\n }else{\n if((parent.left === node) !== (parent.parent.left === parent)){\n node.rotate(tree);\n node.rotate(tree);\n }else{\n parent.rotate(tree);\n node = parent;\n }\n }\n if(!node.parent){\n break;\n }\n }\n if(!node.parent){\n node.color = Black;\n }\n }", "function addChildrenRecursively(node) {\n if (!node || ts.isToken(node)) {\n return;\n }\n switch (node.kind) {\n case 148 /* Constructor */:\n // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it.\n var ctr = node;\n addNodeWithRecursiveChild(ctr, ctr.body);\n // Parameter properties are children of the class, not the constructor.\n for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {\n var param = _a[_i];\n if (ts.isParameterPropertyDeclaration(param)) {\n addLeafNode(param);\n }\n }\n break;\n case 147 /* MethodDeclaration */:\n case 149 /* GetAccessor */:\n case 150 /* SetAccessor */:\n case 146 /* MethodSignature */:\n if (!ts.hasDynamicName(node)) {\n addNodeWithRecursiveChild(node, node.body);\n }\n break;\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n if (!ts.hasDynamicName(node)) {\n addLeafNode(node);\n }\n break;\n case 231 /* ImportClause */:\n var importClause = node;\n // Handle default import case e.g.:\n // import d from \"mod\";\n if (importClause.name) {\n addLeafNode(importClause);\n }\n // Handle named bindings in imports e.g.:\n // import * as NS from \"mod\";\n // import {a, b as B} from \"mod\";\n var namedBindings = importClause.namedBindings;\n if (namedBindings) {\n if (namedBindings.kind === 232 /* NamespaceImport */) {\n addLeafNode(namedBindings);\n }\n else {\n for (var _b = 0, _c = namedBindings.elements; _b < _c.length; _b++) {\n var element = _c[_b];\n addLeafNode(element);\n }\n }\n }\n break;\n case 169 /* BindingElement */:\n case 218 /* VariableDeclaration */:\n var decl = node;\n var name_38 = decl.name;\n if (ts.isBindingPattern(name_38)) {\n addChildrenRecursively(name_38);\n }\n else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) {\n // For `const x = function() {}`, just use the function node, not the const.\n addChildrenRecursively(decl.initializer);\n }\n else {\n addNodeWithRecursiveChild(decl, decl.initializer);\n }\n break;\n case 180 /* ArrowFunction */:\n case 220 /* FunctionDeclaration */:\n case 179 /* FunctionExpression */:\n addNodeWithRecursiveChild(node, node.body);\n break;\n case 224 /* EnumDeclaration */:\n startNode(node);\n for (var _d = 0, _e = node.members; _d < _e.length; _d++) {\n var member = _e[_d];\n if (!isComputedProperty(member)) {\n addLeafNode(member);\n }\n }\n endNode();\n break;\n case 221 /* ClassDeclaration */:\n case 192 /* ClassExpression */:\n case 222 /* InterfaceDeclaration */:\n startNode(node);\n for (var _f = 0, _g = node.members; _f < _g.length; _f++) {\n var member = _g[_f];\n addChildrenRecursively(member);\n }\n endNode();\n break;\n case 225 /* ModuleDeclaration */:\n addNodeWithRecursiveChild(node, getInteriorModule(node).body);\n break;\n case 238 /* ExportSpecifier */:\n case 229 /* ImportEqualsDeclaration */:\n case 153 /* IndexSignature */:\n case 151 /* CallSignature */:\n case 152 /* ConstructSignature */:\n case 223 /* TypeAliasDeclaration */:\n addLeafNode(node);\n break;\n default:\n if (node.jsDocComments) {\n for (var _h = 0, _j = node.jsDocComments; _h < _j.length; _h++) {\n var jsDocComment = _j[_h];\n for (var _k = 0, _l = jsDocComment.tags; _k < _l.length; _k++) {\n var tag = _l[_k];\n if (tag.kind === 279 /* JSDocTypedefTag */) {\n addLeafNode(tag);\n }\n }\n }\n }\n ts.forEachChild(node, addChildrenRecursively);\n }\n }", "onNodeExpand(parentRecord) {\n return this.internalToggleTreeSubRecords(parentRecord, true);\n }", "_moveSubItems(children, targetTree, padding) {\n const that = this;\n\n for (let i = 0; i < children.length; i++) {\n const currentChild = children[i];\n\n currentChild.menu = targetTree;\n currentChild.set('level', currentChild.parentItem.level + 1);\n currentChild.firstElementChild.style.paddingLeft = '';\n currentChild.firstElementChild.style.paddingRight = '';\n that._setIndentation(currentChild.firstElementChild, currentChild.level, padding);\n // restore filtered state\n currentChild.hidden = false;\n currentChild.$.removeClass('jqx-hidden');\n currentChild.$.removeClass('filtered-child');\n currentChild.$.removeClass('last-filtered-child');\n\n if (currentChild instanceof JQX.TreeItemsGroup) {\n currentChild.$.removeClass('hidden-children');\n currentChild.container.level = currentChild.level + 1;\n that._moveSubItems(currentChild.itemContainer.children, targetTree, padding);\n\n if (targetTree !== that && currentChild.expanded) {\n targetTree._menuItemsGroupsToExpand.push(currentChild);\n that._updateState('expanded', currentChild.id, false);\n }\n }\n }\n }", "recreateNode(el, withChildren)\n {\n if (withChildren) \n {\n el.parentNode.replaceChild(el.cloneNode(true), el);\n }\n else \n {\n var newEl = el.cloneNode(false);\n while (el.hasChildNodes()) newEl.appendChild(el.firstChild);\n el.parentNode.replaceChild(newEl, el);\n }\n }", "function expandParents(d) {\r\n while (d.parent) {\r\n debugger;\r\n d = d.parent;\r\n if (!d.children) {\r\n d.children = d._children;\r\n d._children = null;\r\n setToggleSymbol(d, attrs.COLLAPSE_SYMBOL);\r\n }\r\n\r\n }\r\n }", "handler( children ) {\n const { classes } = this.props\n const { state } = this\nreturn children.map( ( subOption ) => {\n if ( !subOption.children ) {\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n key={ subOption.name }>\n <Link \n to={ subOption.url }\n className={ classes.links }>\n <ListItemText \n inset \n primary={ subOption.name } \n />\n </Link>\n </ListItem>\n </div>\n )\n }\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n onClick={ () => this.handleClick( subOption.name ) }>\n <ListItemText \n inset \n primary={ subOption.name } />\n { state[ subOption.name ] ? \n <ExpandLess /> :\n <ExpandMore />\n }\n </ListItem>\n <Collapse \n in={ state[ subOption.name ] } \n timeout=\"auto\" \n unmountOnExit\n >\n { this.handler( subOption.children ) }\n </Collapse>\n </div>\n )\n } )\n }", "handler( children ) {\n const { classes } = this.props\n const { state } = this\nreturn children.map( ( subOption ) => {\n if ( !subOption.children ) {\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n key={ subOption.name }>\n <Link \n to={ subOption.url }\n className={ classes.links }>\n <ListItemText \n inset \n primary={ subOption.name } \n />\n </Link>\n </ListItem>\n </div>\n )\n }\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n onClick={ () => this.handleClick( subOption.name ) }>\n <ListItemText \n inset \n primary={ subOption.name } />\n { state[ subOption.name ] ? \n <ExpandLess /> :\n <ExpandMore />\n }\n </ListItem>\n <Collapse \n in={ state[ subOption.name ] } \n timeout=\"auto\" \n unmountOnExit\n >\n { this.handler( subOption.children ) }\n </Collapse>\n </div>\n )\n } )\n }", "expandAllRows() {\r\n const that = this;\r\n\r\n if (!that.hasAttribute('hierarchy') || that.grouping) {\r\n return;\r\n }\r\n\r\n function expand(siblings) {\r\n for (let i = 0; i < siblings.length; i++) {\r\n const sibling = siblings[i];\r\n\r\n if (sibling.leaf) {\r\n continue;\r\n }\r\n\r\n if (sibling.children) {\r\n expand(sibling.children);\r\n }\r\n\r\n if (!sibling.expanded) {\r\n that.expandRow(sibling.$.id);\r\n }\r\n }\r\n }\r\n\r\n expand(that.dataSource.boundHierarchy);\r\n }", "function getChildren(el) {\n\n }", "childDown(node, defaultNode) {\n throw new Error(\"You must define childDown().\")\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "function ContentChildrenDecorator(){}", "function buildNodeHierachy( nodeId, parentObject, allNodes ) {\n\n\t\t\tvar _node = allNodes[ nodeId ];\n\t\t\tparentObject.add( _node );\n\n\t\t\tvar node = json.nodes[ nodeId ];\n\n\t\t\tif ( node.children ) {\n\n\t\t\t\tvar children = node.children;\n\n\t\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar child = children[ i ];\n\t\t\t\t\tbuildNodeHierachy( child, _node, allNodes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n\t visit(children[i], visitFn, childrenFn);\n }\n }\n}", "prependChild(child) {\n this.root.prepend(child.root);\n return child;\n }", "updateInnerHeightDependingOnChilds(){}", "function populateChildren(out, content, val, index) {\n if ('children' in val) {\n // convert boolean false to '' and anything else to a string\n content === false && (content = '');\n typeof content !== 'string' && (content = String(content));\n\n var _s = content.split(val.delimiter);\n if ('parent' in val) {\n out[index][val.parent][val.value] = val.children[0] === '*' ? [] : {};\n } else {\n out[index][val.value] = val.children[0] === '*' ? [] : {};\n }\n\n if (val.children[0] === '*') {\n for (var s in _s) {\n if ('parent' in val) {\n out[index][val.parent][val.value].push(_s[s].trim());\n } else {\n out[index][val.value].push(_s[s].trim());\n }\n }\n } else {\n for (var k in val.children) {\n if (k < _s.length) {\n if ('parent' in val) {\n out[index][val.parent][val.value][val.children[k]] = _s[k].trim();\n } else {\n out[index][val.value][val.children[k]] = _s[k].trim();\n }\n }\n }\n }\n } else {\n if ('parent' in val) {\n out[index][val.parent][val.value] = content;\n } else {\n out[index][val.value] = content;\n }\n }\n return out;\n}", "function recursiveDescend (node, scene, gui) {\n var mesh = rend.addToScene(scene, node);\n if (node.tagName === 'group') {\n scene = mesh;\n }\n gui = gui.addFolder(node.tagName + counter++);\n ui.addTransforms(gui, node, mesh, mirror.cb);\n for (var i = 0, len = node.children.length; i < len; ++i) {\n recursiveDescend(node.children[i], scene, gui);\n }\n}", "appendChild(child) {\n invariant(child && !child.parent, 'cannot append nothing or a parented node');\n child.parent = this;\n this.children.push(child);\n this.el.appendChild(child.el);\n return child;\n }", "function expandToNode(selfUL, nodeDIV, ignoreOnExpand) {\r\n\t\tif ($.type(nodeDIV.target) != \"undefined\") {\r\n\t\t\tignoreOnExpand = nodeDIV.ignoreOnExpand;\r\n\t\t\tnodeDIV = nodeDIV.target;\r\n\t\t}\r\n\r\n\t\tvar nodes = [];\r\n\t\tvar parentNode = getParentNode(selfUL, nodeDIV);\r\n\t\twhile (parentNode) {\r\n\t\t\tnodes.unshift(parentNode);\r\n\t\t\tparentNode = getParentNode(selfUL, parentNode.target);\r\n\t\t}\r\n\t\tfor ( var i = 0; i < nodes.length; i++) {\r\n\t\t\texpandNode(selfUL, nodes[i].target, null, ignoreOnExpand);\r\n\t\t}\r\n\t}", "function checkChildren() {\n\n\n $(\"#filter-accordion ul.dynatree-container li\").click(function () {\n $('.linkAll').removeClass('active-link');\n });\n}", "function buildNodeHierachy( nodeId, parentObject, allNodes ) {\n\n\t\t\t\tvar _node = allNodes[ nodeId ];\n\t\t\t\tparentObject.add( _node );\n\n\t\t\t\tvar node = json.nodes[ nodeId ];\n\n\t\t\t\tif ( node.children ) {\n\n\t\t\t\t\tvar children = node.children;\n\n\t\t\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tvar child = children[ i ];\n\t\t\t\t\t\tbuildNodeHierachy( child, _node, allNodes );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}", "set child(value) {\n this._child = isUndefined(value) ?\n null : value;\n\n return value;\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "addElementByRule(dom, rule, continueAfter) {\n let sync, nodeType, mark;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n sync = this.enter(nodeType, rule.attrs || null, rule.preserveWhitespace);\n } else if (!this.insertNode(nodeType.create(rule.attrs))) {\n this.leafFallback(dom);\n }\n } else {\n let markType = this.parser.schema.marks[rule.mark];\n mark = markType.create(rule.attrs);\n this.addPendingMark(mark);\n }\n let startIn = this.top;\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n } else if (continueAfter) {\n this.addElement(dom, continueAfter);\n } else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach((node) => this.insertNode(node));\n } else {\n let contentDOM = dom;\n if (typeof rule.contentElement == \"string\")\n contentDOM = dom.querySelector(rule.contentElement);\n else if (typeof rule.contentElement == \"function\")\n contentDOM = rule.contentElement(dom);\n else if (rule.contentElement)\n contentDOM = rule.contentElement;\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM);\n }\n if (sync && this.sync(startIn))\n this.open--;\n if (mark)\n this.removePendingMark(mark, startIn);\n }", "function eventCollapseChild(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function appendChild(elem,child){child.parent=elem;if(elem.children.push(child)!==1){var sibling=elem.children[elem.children.length-2];sibling.next=child;child.prev=sibling;child.next=null;}}", "function mergeChildren(from, into, refNode, forward){\n\t\tvar child, dir;\n\t\twhile ((child = from[forward ? 'last' : 'first'](elementType))){\n\t\t\tif ((dir = child.getDirection(1)) !== into.getDirection(1)) child.setProperty('dir', dir);\n\t\t\tchild.dispose();\n\t\t\trefNode ? child[forward ? 'injectBefore' : 'injectAfter'](refNode) : \n\t\t\t\tinto.append(child, forward);\n\t\t}\n\t}", "function renameChildren(kendoTreeData,node,isRoot){\n //Recursive - If it has children call this method again.\n if(!via.undef(node.children) && node.children.length > 0 ){\n for(var i=0;i<node.children.length;i++){\n var childNode = node.children[i];\n kendoTreeData = renameChildren(kendoTreeData,childNode,false);\n }\n node.items = node.children;\n node.children = null;\n delete node.children;\n }\n if(isRoot === true){\n kendoTreeData.push(node);\n }\n return kendoTreeData;\n }", "function addChild(newVal) {\n if (newVal > $rootScope.household.children.length) {\n $http.get('/child').then(function(response) {\n var newChild = response.data;\n newChild.incomeSources = Object.keys(vm.childIncomeSources).map(function(incomeSource) {\n return {type: incomeSource, amount: null, frequency: null};\n });\n $rootScope.household.children.push(newChild);\n // Recurse if necessary\n addChild(newVal);\n });\n }\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n if (children) {\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }\n }", "function getChildren(i, arr) {\n var childs = [];\n\n if( arr[i+1+ i] ){\n childs[0] = {name: arr[i*2+1],id:i*2+1, children: []}\n if( arr[i+i+2] ){\n // console.log(arr[i+1+ i], arr[i+i+2])\n childs[1] = {name: arr[i * 2 + 2],id:i * 2 + 2, children:[]} ;\n }\n }\n\n var nextin = i * 2 + 1;\n if(arr[nextin*2+1]){\n // console.log('more children')\n childs[0].children = getChildren(nextin, arr)\n childs[0]._children = null;\n\n if( arr[nextin*2 + 2 ]){\n childs[1].children = getChildren(nextin+1, arr);\n childs[1]._children = null;\n }\n }\n return childs;\n}", "add(parentName, childName, custom = undefined) {\n let parentNode = this.nodes[parentName];\n let childNode = this.nodes[childName];\n let changed = false;\n\n if (!childNode) {\n childNode = {name: childName, children: {}};\n this.nodes[childName] = childNode;\n changed = true;\n }\n childNode.custom = custom;\n childNode.parentName = parentName;\n\n if (!parentNode) {\n // it must be a new root\n parentNode = {name: parentName, children: {}};\n this.nodes[parentName] = parentNode;\n this.roots[parentName] = parentNode;\n changed = true;\n }\n\n if (!parentNode.children[childName]) {\n parentNode.children[childName] = childNode;\n changed = true;\n }\n\n // if the child has been a root until now, remove it\n delete this.roots[childName];\n\n return changed;\n }", "appendChild(child) {\n this.root.appendChild(child.root);\n return child;\n }", "function expandNodeCallback(page, data) {\n const node = nodes.get(page); // The node that was clicked\n const level = node.level + 1; // Level for new nodes is one more than parent\n const subpages = data;\n\n // Add all children to network\n const subnodes = [];\n const newedges = [];\n // Where new nodes should be spawned\n const [x, y] = getSpawnPosition(page);\n // Create node objects\n for (let i = 0; i < subpages.length; i += 1) {\n const subpage = subpages[i];\n const subpageID = getNeutralId(subpage);\n if (nodes.getIds().indexOf(subpageID) === -1) { // Don't add if node exists\n subnodes.push({\n id: subpageID,\n label: wordwrap(decodeURIComponent(subpage), 15),\n value: 1,\n level,\n color: getColor(level),\n parent: page,\n x,\n y,\n });\n }\n\n if (!getEdgeConnecting(page, subpageID)) { // Don't create duplicate edges in same direction\n newedges.push({\n from: page,\n to: subpageID,\n color: getEdgeColor(level),\n level,\n selectionWidth: 2,\n hoverWidth: 0,\n });\n }\n }\n\n // Add the stuff to the nodes array\n nodes.add(subnodes);\n edges.add(newedges);\n}", "function resolveChild(child, globals) {\n if (typeof child !== \"function\") {\n return child;\n }\n if (child.IS_ELEMENT_CONSTRUCTOR) {\n return child(globals);\n }\n if ((0, _streamy.isStream)(child)) {\n return child.map(function (x) {\n return resolveChildren(x, globals);\n });\n }\n}", "function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n\t var viewChildren = node.children || [];\n\t var orderBy = options.sort;\n\t orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n\t var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\t\n\t if (hideChildren && !overLeafDepth) {\n\t return node.viewChildren = [];\n\t } // Sort children, order by desc.\n\t\n\t\n\t viewChildren = filter(viewChildren, function (child) {\n\t return !child.isRemoved();\n\t });\n\t sort$1(viewChildren, orderBy);\n\t var info = statistic(nodeModel, viewChildren, orderBy);\n\t\n\t if (info.sum === 0) {\n\t return node.viewChildren = [];\n\t }\n\t\n\t info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\t\n\t if (info.sum === 0) {\n\t return node.viewChildren = [];\n\t } // Set area to each child.\n\t\n\t\n\t for (var i = 0, len = viewChildren.length; i < len; i++) {\n\t var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\t\n\t viewChildren[i].setLayout({\n\t area: area\n\t });\n\t }\n\t\n\t if (overLeafDepth) {\n\t viewChildren.length && node.setLayout({\n\t isLeafRoot: true\n\t }, true);\n\t viewChildren.length = 0;\n\t }\n\t\n\t node.viewChildren = viewChildren;\n\t node.setLayout({\n\t dataExtent: info.dataExtent\n\t }, true);\n\t return viewChildren;\n\t }", "function ContentChildrenDecorator() {}", "function ContentChildrenDecorator() {}", "function ContentChildrenDecorator() {}", "function visitItem(item) {\n item.data.id = item.id;\n if (item.children) {\n for (var j = item.children.length-1; j >= 0; j--)\n visitItem(item.children[j]);\n }\n }", "function addChildren(domNode, childNodes) {\n var fragment = document.createDocumentFragment();\n for (var i = 0; i < childNodes.length; i++) {\n fragment.appendChild(childNodes[i]);\n }\n domNode.appendChild(fragment);\n }", "function collapse(node: D3HierarchyNode) {\n if (node.children) {\n node._children = node.children;\n node._children.forEach(collapse);\n node.children = undefined;\n }\n}", "onNodeExpand(parentRecord) {\n // We don't care about expand if it's inside a collapsed subtree\n if (parentRecord.ancestorsExpanded(this)) {\n return this.internalToggleTreeSubRecords(parentRecord, true);\n }\n }", "appendChild(child) {\n this.childNodes.push(child);\n return child;\n }", "childUp(node, defaultNode) {\n throw new Error(\"You must define childUp().\")\n }" ]
[ "0.58339405", "0.57834166", "0.5781947", "0.5772468", "0.57266563", "0.56836873", "0.5679065", "0.56179726", "0.56079644", "0.55745816", "0.55084455", "0.5478811", "0.5471258", "0.5459611", "0.5459611", "0.5453229", "0.54441553", "0.5442059", "0.5433409", "0.54229283", "0.539573", "0.53956383", "0.53653294", "0.5363211", "0.5342568", "0.53332", "0.5322714", "0.5318625", "0.5306002", "0.5295934", "0.52771056", "0.5268428", "0.5259692", "0.5220164", "0.5216911", "0.5201911", "0.51997095", "0.51967245", "0.519526", "0.51940024", "0.5179564", "0.5153406", "0.5150455", "0.5149363", "0.5145234", "0.5143693", "0.51377153", "0.5129958", "0.5129343", "0.5119535", "0.50860286", "0.508454", "0.5081178", "0.507971", "0.50684863", "0.50684863", "0.5056032", "0.5036098", "0.502743", "0.50216144", "0.50077933", "0.50015813", "0.4990164", "0.4989768", "0.4989369", "0.49893042", "0.49871117", "0.49847677", "0.498178", "0.49752897", "0.49731445", "0.49692994", "0.49549466", "0.4949519", "0.4949519", "0.49488035", "0.4947206", "0.4943673", "0.49427527", "0.49360818", "0.4935319", "0.4933175", "0.49309954", "0.49309954", "0.49309954", "0.49175552", "0.49172702", "0.49162257", "0.49124524", "0.49113077", "0.49106362", "0.49085635", "0.49085635", "0.49085635", "0.49072072", "0.49043667", "0.49036512", "0.49033654", "0.4899844", "0.48993236" ]
0.71496874
0
Expand this rule (possibly creating children)
expand(preventRecursion) { if (!this.isExpanded) { this.isExpanded = true this.expansionErrors = [] // Types of nodes // -1: raw, needs parsing // 0: Plaintext // 1: Tag ("#symbol.mod.mod2.mod3#" or "#[pushTarget:pushRule]symbol.mod") // 2: Action ("[pushTarget:pushRule], [pushTarget:POP]", more in the future) switch (this.type) { // Raw rule case -1: this.expandChildren(this.raw, preventRecursion) break // Plaintext, do nothing but copy text into finsihed text case 0: this.finishedText = this.raw break // Tag case 1: { // Parse to find any actions, and figure out what the symbol is this.preactions = [] this.postactions = [] const parsed = Parser.parseTag(this.raw) // Break into symbol actions and modifiers this.symbol = parsed.symbol this.modifiers = parsed.modifiers // Create all the preactions from the raw syntax parsed.preactions.forEach((preaction, i) => { this.preactions[i] = new NodeAction(this, preaction.raw) }) // Make undo actions for all preactions (pops for each push) this.preactions.forEach(pa => { if (pa.type === 0) { this.postactions.push(pa.createUndo()) } }) // Activate all the preactions this.preactions.forEach(pa => pa.activate()) this.finishedText = this.raw // Expand (passing the node, this allows tracking of recursion depth) const selectedRule = this.grammar.selectRule(this.symbol, this, this.errors) this.expandChildren(selectedRule, preventRecursion) // Apply modifiers this.modifiers.forEach(modName => { let modParams = [] if (modName.indexOf('(') > 0) { const regExp = /\(([^)]+)\)/ const results = regExp.exec(modName) if (results && results.length >= 2) { modParams = results[1].split(',') modName = modName.substring(0, modName.indexOf('(')) } } const mod = this.grammar.modifiers[modName] // Missing modifier? if (mod) { this.finishedText = mod(this.finishedText, modParams) } else { this.errors.push('Missing modifier ' + modName) this.finishedText += '((.' + modName + '))' } }) // Perform post-actions this.postactions.forEach(pa => pa.activate()) break } case 2: // Just a bare action? Expand it! this.action = new NodeAction(this, this.raw) this.action.activate() // No visible text for an action this.finishedText = '' break default: } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expandChildren(childRule, preventRecursion) {\n this.children = []\n this.finishedText = ''\n\n // Set the rule for making children,\n // and expand it into section\n this.childRule = childRule\n if (this.childRule === undefined) {\n // In normal operation, this shouldn't ever happen\n this.errors.push('No child rule provided, can\\'t expand children')\n console.warn('No child rule provided, can\\'t expand children')\n } else {\n const sections = Parser.parse(childRule)\n\n // Add errors to this\n if (sections.errors.length > 0) {\n this.errors = this.errors.concat(sections.errors)\n }\n\n sections.forEach((section, i) => {\n this.children[i] = new EpuresNode(this, i, section)\n if (!preventRecursion) {\n this.children[i].expand(preventRecursion)\n }\n\n // Add in the finished text\n this.finishedText += this.children[i].finishedText\n })\n }\n }", "function expand(d) {\n\t //console.log('expanding ' + d.word);\n\t if (d.followWordObjs) {\n\t\tif (d.followWordObjs.length > 0) {\n\t\t //console.log(' * expanding fwos')\n\t\t d.children = d.followWordObjs;\n\t\t d.followWordObjs = null;\n\t\t d.children.forEach(expand)\n\t\t}\n\t }\n\t \n\t if (d.children) {\n\t\tif (d.children.length > 0) {\n\t\t d.children.forEach(expand)\n\t\t}\n\t }\n\t}", "expandAll() {\n const data = this.dataManager.getData();\n const parentsToExpand = [];\n\n arrayEach(data, (elem) => {\n if (this.dataManager.hasChildren(elem)) {\n parentsToExpand.push(elem);\n }\n });\n\n this.expandMultipleChildren(parentsToExpand);\n\n this.renderAndAdjust();\n }", "expandAll() {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }", "expandAll() {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }", "expandAllRows() {\r\n const that = this;\r\n\r\n if (!that.hasAttribute('hierarchy') || that.grouping) {\r\n return;\r\n }\r\n\r\n function expand(siblings) {\r\n for (let i = 0; i < siblings.length; i++) {\r\n const sibling = siblings[i];\r\n\r\n if (sibling.leaf) {\r\n continue;\r\n }\r\n\r\n if (sibling.children) {\r\n expand(sibling.children);\r\n }\r\n\r\n if (!sibling.expanded) {\r\n that.expandRow(sibling.$.id);\r\n }\r\n }\r\n }\r\n\r\n expand(that.dataSource.boundHierarchy);\r\n }", "function expand(id, recursive)\n {\n collapse(id, recursive, false);\n }", "expand() {\n if (this.expanded) {\n this.content.setAttribute('aria-expanded', 'false');\n this.group.setAttribute('hidden', '');\n } else {\n // Create DOM nodes if nessecary\n if (this.group.children.length === 0) {\n const fragment = document.createDocumentFragment();\n for (const child of this.children) {\n const uiNode = createUiNode(child);\n fragment.appendChild(uiNode.content);\n }\n this.group.appendChild(fragment);\n }\n\n this.content.setAttribute('aria-expanded', 'true');\n this.group.removeAttribute('hidden');\n }\n this.expanded = !this.expanded;\n }", "expand() {\n\t\tthis.emit(EVENTS.CONTENTS.EXPAND);\n\t}", "function expandAll(d) {\n if(d._children) expand(d);\n if(d.children) d.children.forEach(expandAll);\n} // end expandAll", "expand() {\n const that = this;\n\n if (!that.collapsible || !that.collapsed) {\n return;\n }\n\n that.collapsed = false;\n }", "function fontific_expand_all(){\n\t$('.fontific-rule').each(function(){\n\t\tvar rule = $(this);\n\t\tvar collapsed = rule.find('.fontific-rule-collapsed');\n\t\tvar fieldset = rule.find('fieldset');\n\n\t\tcollapsed.hide();\n\t\tfieldset.show();\n\t\trule.removeClass('collapsed');\n\t});\n}", "onpopulate()\n {\n if (this.children.length && !this.shouldRefreshChildren)\n return;\n this.shouldRefreshChildren = false;\n\n this.removeChildren();\n this.updateParentStatus();\n this.prepareToPopulate();\n\n for (var i = 0; i < this._frame.childFrames.length; ++i)\n this.addChildForRepresentedObject(this._frame.childFrames[i]);\n\n for (var i = 0; i < this._frame.resources.length; ++i)\n this.addChildForRepresentedObject(this._frame.resources[i]);\n\n var sourceMaps = this.resource && this.resource.sourceMaps;\n for (var i = 0; i < sourceMaps.length; ++i) {\n var sourceMap = sourceMaps[i];\n for (var j = 0; j < sourceMap.resources.length; ++j)\n this.addChildForRepresentedObject(sourceMap.resources[j]);\n }\n\n var flowMap = this._frame.domTree.flowMap;\n for (var flowKey in flowMap)\n this.addChildForRepresentedObject(flowMap[flowKey]);\n\n for (let extraScript of this._frame.extraScripts) {\n if (extraScript.sourceURL || extraScript.sourceMappingURL)\n this.addChildForRepresentedObject(extraScript);\n }\n }", "expandDescendants(dataNode) {\n const toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }", "automountChildren(prev) {\n\t\tif (this[_mapped] || this[_automounted]) { return }\n\n\t\tthis[_automounted] = true;\n\n\t\tconst state = this.state();\n\t\tconst shader = this.shader(state);\n\n\t\tfor (let name in state) {\n\t\t\tif (shader.isAutomount(name)) {\n\t\t\t\tthis.defineChildProperty(name, shader, state, prev, true);\n\t\t\t}\n\t\t}\n\t}", "adjustSize () {\n let action = this.head\n let size = this.root ? 1 : 0\n\n while (action && action.parent) {\n let parent = action.parent\n\n parent.next = action\n\n action = parent\n\n size += 1\n }\n\n this.size = size\n }", "function expandTree(tree) {\n\t\ttraverseTree(tree, function(tree, char, i) {\n\t\t\ttree[i] = expandChar(char);\n\t\t});\n\t\treturn tree;\n\t}", "_refresh() {\n const children = Array.from(this.slottedChildren);\n if (children.length && this.expanded) {\n this._expand();\n Array.from(children).forEach(el => el._refresh());\n }\n }", "addChildren(value) {}", "onNodeExpand(parentRecord) {\n return this.internalToggleTreeSubRecords(parentRecord, true);\n }", "function expandAction() \n\t{ \n\t\tthis.expanded = !this.expanded; this.refresh(); \n\t}", "function jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}", "function jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}", "function jssExpand() {\n function onProcessStyle(style, rule) {\n if (!style || rule.type !== 'style') return style;\n\n if (Array.isArray(style)) {\n // Pass rules one by one and reformat them\n for (var index = 0; index < style.length; index++) {\n style[index] = styleDetector(style[index], rule);\n }\n\n return style;\n }\n\n return styleDetector(style, rule);\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}", "expandItem(item){if(!this._isExpanded(item)){this.push(\"expandedItems\",item)}}", "expand(n, erange) {\n\t\tea && assert(n > this.n || erange > this.edgeRange);\n\t\tlet nu = new this.constructor(n, erange);\n\t\tnu.assign(this,true); this.xfer(nu);\n\t}", "function addExpandedNodes(node) {\r\n\r\n //use cy.batch to make things more efficient. cy.batch waits until all new elements are added before calculating new positions and styles\r\n cy.batch(function(){\r\n\r\n //if current node does not accept anything, just do nothing\r\n if ((node.data('acc_evt')!=undefined) && !node.hasClass('expanded') && !node.hasClass('spec_end') && !node.hasClass('imp_end')){\r\n //create a new node and an edge, leading from current node to new node\r\n for (var i=0; i < node.data('acc_evt').length; i++) {\r\n if (node.data('acc_evt')[i]!=node.outgoers('edge').data().label){\r\n cy.add({\"data\":{\"id\":node.id()+\"dummy\"+i}, \"classes\":\"dummy\"+node.id()+\" \"+\"dummy\"});\r\n cy.add({\"data\":{\"id\":node.id()+\"edgeDummy\"+i, \"source\":node.id(), \"target\": node.id()+\"dummy\"+i, \"label\":node.data('acc_evt')[i]}, \"classes\": \"dummy\"+node.id()+\" \"+\"dummy\"});\r\n node.addClass('expanded');\r\n }\r\n\r\n }\r\n //for all newly created nodes, arrange them around their parent node in a circular shape\r\n cy.elements('.dummy'+node.id()).layout({name: 'circle', boundingBox: {\r\n x1: node.position('x'),\r\n x2: node.position('x'),\r\n y1: node.position('y'),\r\n y2: node.position('y')\r\n },\r\n concentric: function( n ){\r\n if( node.id() === n.id() ){\r\n return 2;\r\n } else {\r\n return 1;\r\n }\r\n },\r\n minNodeSpacing:1,\r\n levelWidth: function(){\r\n return 1;\r\n },\r\n fit:false, \r\n radius:100\r\n });\r\n }\r\n });\r\n}", "function expandChildren(index, chi){\n setTimeout(function () {\n //buildHeap([ 4, 3, 2, 9, 14, 29] );\n // console.log('hooho', nodes)\n if(nodes[index].children === null){\n nodes[0].children = [nodes[0]._children[chi]]\n }\n else{\n // console.log( typeof nodes[0]. children)\n nodes[index].children.push(nodes[index]._children[1])\n }\n// .h(nodes[0]._children[0]);\n //nodes[0]._children ;\n\n// console.log(nodes[index])\n update(nodes[index])\n if(chi < 1){\n expandChildren(0, 1)\n }\n }, 3000);\n\n}", "expandAll() {\n this.expansionModel.select(...this.dataNodes);\n }", "constructor(nodes_to_expand) {\n this.nodes_to_expand = !arguments.length ? 100 : nodes_to_expand;\n }", "add(rule, prefix) {\n let prefixed = prefix + rule.name\n\n let already = rule.parent.some(\n i => i.name === prefixed && i.params === rule.params\n )\n if (already) {\n return undefined\n }\n\n let cloned = this.clone(rule, { name: prefixed })\n return rule.parent.insertBefore(rule, cloned)\n }", "function expandTree(d) {\n if (d._children) {\n d.children = d._children;\n d._children = null;\n }\n if (d.children) {\n d.children.forEach(expandTree);\n }\n }", "function expand(elementid)\r\n{\r\n\tvar parentElement = elementManager.get ( elementid );\r\n\tif ( parentElement.childcount != 0 )\r\n\t{\r\n\t\tdocument.getElementById(\"T\" + parentElement.id).innerHTML = \"(Loading \" + parentElement.childcount + \" children...)\";\r\n\t\tgetElementChildren ( elementManager.get ( elementid ),\r\n\t\t\tfunction ( children )\r\n\t\t\t{\r\n\t\t\t\tvar parent = document.getElementById(\"E\" + elementid);\r\n\t\t\t\tif ( children.length != 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tparent.className = \"minus\";\r\n\t\t\t\t\t// create a container for the children\r\n\t\t\t\t\tvar container = document.createElement(\"ul\");\r\n\t\t\t\t\tcontainer.id = \"C\" + elementid;\r\n\t\t\t\t\tparent.appendChild(container);\r\n\t\t\t\t\t// create elements for all the children inside the container\r\n\t\t\t\t\tfor ( const child of children )\r\n\t\t\t\t\t\tgenerateNode ( child, elementid );\r\n\t\t\t\t\tdocument.getElementById(\"T\" + parentElement.id).innerHTML = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tparent.className = \"empty\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n}", "function expand(rules, dictionary, start, expansion) {\n if (rules[start]) {\n let possibleRuleSet = rules[start];\n let pickedRuleSet = rita.randomItem(possibleRuleSet);\n for (let i = 0; i < pickedRuleSet.length; i++) {\n expand(rules, dictionary, pickedRuleSet[i], expansion);\n }\n } else {\n let possibleWords = dictionary[start];\n let pickedWord = rita.randomItem(possibleWords);\n expansion.push(pickedWord);\n }\n return expansion;\n}", "nest(name, src, line) {\n let children = this.getChildren();\n this.clearChildren();\n this.push(name, src, line);\n this.append(...children);\n return this;\n }", "decorateChildren() {\n this.forEachChild(aChild => {\n var element = this.getDomHelper().getElement(aChild.getId());\n if (element) {\n aChild.decorate(element);\n }\n });\n }", "function processRule ( rule , returnObj ) {\n // some additional properties\n //var selector_arr = rule.selector.split( \" \" );\n rule.name = getSelectorName( rule.selector );//selector_arr.pop();\n // give a shorter unique id to it\n //var cssString = ruleToCSSString( rule );\n // \"-\" causes Router to get confused\n // only want something unique, so replacing with an \"n\"\n rule.uuid = getRuleUUID( rule );\n rule.children = [];\n rule.total_child_rules = 0;// just simple rules, not everything\n rule.total_child_comps = 0;\n rule.is_duplicate = false;\n\n // find depth\n rule.depth = Math.min( 6 , rule.selector.split(\" \").length-1 );\n if ( !returnObj.totals.depths[ rule.depth ] )\n returnObj.totals.depths[ rule.depth ] = 0;\n returnObj.totals.depths[ rule.depth ]++;\n if ( !returnObj.depths_all[ rule.depth ] )\n returnObj.depths_all[ rule.depth ] = [];\n returnObj.depths_all[ rule.depth ].push( rule.uuid );\n\n rule.metadata = {};\n rule.states = [];\n rule.pseudos = [];\n\n if ( rule.type == \"rule\" ) {\n returnObj.totals.rules++;\n returnObj.rules.push( rule );\n if ( !returnObj.totals.depths_rules[ rule.depth ] )\n returnObj.totals.depths_rules[ rule.depth ] = 0;\n returnObj.totals.depths_rules[ rule.depth ]++;\n }else if ( rule.type == \"tagged_rule\" ){\n processComponent( rule , returnObj );\n }\n\n returnObj.totals.overall++;\n\n // selector hash\n if ( !returnObj.selector_hash[rule.selector] ) {\n returnObj.selector_hash[rule.selector] = rule;\n }else{\n console.log(\"ERROR, selector not unique!\" , rule.selector );\n }\n\n returnObj.uuid_hash[ rule.uuid ] = rule;\n\n //finish up...\n returnObj.selector_hash[rule.name] = rule;\n returnObj.selectors.push( rule );\n}", "expand (node) {\n const plays = node.unexpandedPlays();\n const index = Math.floor(Math.random() * plays.length);\n const play = plays[index];\n\n const childState = this.game.nextState(node.state, play);\n const childUnexpandedPlays = this.game.legalPlays(childState);\n const childNode = node.expand(play, childState, childUnexpandedPlays);\n this.nodes[childState.hash()] = childNode;\n\n return childNode;\n }", "function expand(d) {\n setCollapsed(d, false);\n if(d._children) {\n d.children = d._children;\n d._children = null;\n }\n} // end expand", "expandEntities(name, entities, instances, rootInstance, op, property, operations, properties, turn, text, entityToInfo) {\n if (!name.startsWith('$')) {\n // Entities representing schema properties end in \"Property\" to prevent name collisions with the property itself.\n const propName = this.stripProperty(name);\n let entityName;\n let isOp = false;\n let isProperty = false;\n if (operations.includes(name)) {\n op = name;\n isOp = true;\n }\n else if (properties.includes(propName)) {\n property = propName;\n isProperty = true;\n }\n else {\n entityName = name;\n }\n entities.forEach((entity, index) => {\n const instance = instances[index];\n let root = rootInstance;\n if (!root) {\n // Keep the root entity name and position to help with overlap.\n root = cloneDeep_1.default(instance);\n root.type = `${name}${index}`;\n }\n if (entityName) {\n this.expandEntity(entityName, entity, instance, root, op, property, turn, text, entityToInfo);\n }\n else if (typeof entity === 'object' && entity !== null) {\n if (isEmpty_1.default(entity)) {\n if (isOp) {\n // Handle operator with no children.\n this.expandEntity(op, null, instance, root, op, property, turn, text, entityToInfo);\n }\n else if (isProperty) {\n // Handle property with no children.\n this.expandEntity(property, null, instance, root, op, property, turn, text, entityToInfo);\n }\n }\n else {\n this.expandEntityObject(entity, op, property, root, operations, properties, turn, text, entityToInfo);\n }\n }\n else if (isOp) {\n // Handle global operator with no children in model.\n this.expandEntity(op, null, instance, root, op, property, turn, text, entityToInfo);\n }\n });\n }\n }", "function expand()\n\t{\n\t\tobjThis.selectorElt.tagSuggest().expand();\n\t}", "function expandParents(d) {\r\n while (d.parent) {\r\n debugger;\r\n d = d.parent;\r\n if (!d.children) {\r\n d.children = d._children;\r\n d._children = null;\r\n setToggleSymbol(d, attrs.COLLAPSE_SYMBOL);\r\n }\r\n\r\n }\r\n }", "function expandAllAbs(d){\n if('children' in d || '_children' in d){\n if(d.children){\n } else {\n d.children = d._children;\n d._children = null;\n }\n for(var i = 0;i<d.children.length;i++){\n expandAllAbs(d.children[i]);\n }\n }\n}", "function expandParents(d) {\n while (d.parent) {\n d = d.parent;\n if (!d.children) {\n d.children = d._children;\n d._children = null;\n setToggleSymbol(d, attrs.COLLAPSE_SYMBOL);\n }\n }\n }", "function expand(parts) {\n var relations = {\n caption: 'table', command: 'menu', dd: 'dl', dt: 'dl', figcaption: 'figure', li: 'ul', option: 'select', summary: 'details', td: 'tr', th: 'tr', tr: 'tbody', tbody: 'table', tfoot: 'table', thead: 'table'\n },\n expandedParts = [],\n parent,\n child,\n relation,\n missing;\n parts.forEach(function(part) {\n if (part instanceof parserlib.css.SelectorPart) {\n parent = child;\n child = tagName(part);\n relation = relations[child];\n missing = [];\n while (relation && relation != parent) {\n missing.push(new parserlib.css.Combinator('>'));\n missing.push(new parserlib.css.SelectorPart({ text: relation }, [], relation));\n parent = relation;\n relation = relations[relation];\n }\n expandedParts.push.apply(expandedParts, missing.reverse());\n }\n expandedParts.push(part);\n });\n return expandedParts;\n }", "function markAsDynamicChildren$1(children) {\n FromIteration$1.set(children, 1);\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "function markAsDynamicChildren(children) {\n FromIteration.set(children, 1);\n }", "addElementByRule(dom, rule, continueAfter) {\n let sync, nodeType, mark;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n sync = this.enter(nodeType, rule.attrs || null, rule.preserveWhitespace);\n } else if (!this.insertNode(nodeType.create(rule.attrs))) {\n this.leafFallback(dom);\n }\n } else {\n let markType = this.parser.schema.marks[rule.mark];\n mark = markType.create(rule.attrs);\n this.addPendingMark(mark);\n }\n let startIn = this.top;\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n } else if (continueAfter) {\n this.addElement(dom, continueAfter);\n } else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach((node) => this.insertNode(node));\n } else {\n let contentDOM = dom;\n if (typeof rule.contentElement == \"string\")\n contentDOM = dom.querySelector(rule.contentElement);\n else if (typeof rule.contentElement == \"function\")\n contentDOM = rule.contentElement(dom);\n else if (rule.contentElement)\n contentDOM = rule.contentElement;\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM);\n }\n if (sync && this.sync(startIn))\n this.open--;\n if (mark)\n this.removePendingMark(mark, startIn);\n }", "function expandSectionRefs(elem) {\n [...elem.children].forEach(child => {\n switch(child.tagName) {\n case \"assessmentSectionRef\":\n let href = child.getAttribute(\"href\")\n loadXml(href, elem, (ref)=>{\n ref = ref.children[0];\n elem.replaceChild(ref, child);\n expandSectionRefs(ref);\n });\n break;\n default:\n expandSectionRefs(child);\n break;\n }\n });\n }", "get expanded() { return this._expanded; }", "function recursiveExpand(motherUl){\n\n\t\t\tvar arrayLis = motherUl.children(\".directory\");\n\n\t\t\t$.each (arrayLis, function(lp){\n\n\n\t\t\t\tif (\"/\" + arrayUri[s] == $(arrayLis[lp]).children(\"span\").attr(\"rel\")) {\n\n\t\t\t\t\tif (!$(arrayLis[lp]).hasClass(\"expanded\")) {\n\t\t\t\t\t\n\t\t\t\t\t\t$(arrayLis[lp]).children(\"span\").trigger( \"click\" );\n\n\t\t\t\t\t}\n\t\t\t\n\n\t\t\t\t\tsetTimeout(function() {\n\n\t\t\t\t\t\tmotherUl = $(arrayLis[lp]).children(\"span\").next();\n\n\t\t\t\t\t\tif (s+2 <= arrayUri.length){\n\t\t\t\t\t\t\ts++;\n\t\t\t\t\t\t\trecursiveExpand(motherUl);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, 400)\n\n\n\n\t\t\t\t}\n\n\t\t\t});\t\t\t\t\t\n\n\t\t}", "collapse() {\n this.moving = false;\n this.lastIndex = 0;\n Array.from(this.expander.children).forEach((ctx, i) => {\n if (i >= this.options.show) {\n ctx.classList.add('hidden')\n } else {\n if (i !== 0) {\n this.lastIndex++\n new Animate(ctx, i, this.lastIndex, {delay: this.options.animationDuration}).animate()\n }\n }\n })\n }", "increaseItem(increase = this.options.increase) {\n Array.from(this.expander.children).forEach((ctx, i) => {\n if (i > this.lastIndex && i <= (this.lastIndex + increase)) {\n ctx.classList.remove('hidden');\n new Animate(ctx, i, this.lastIndex, {\n delay: this.options.animationDuration,\n align: 'end'\n }).animate()\n }\n })\n this.setIndexesByDirection(true)\n }", "function expand(interactionDefinition) {\n\n var definitions = _.map(interactionDefinition.definitions, expand);\n\n var interactionDefinitionWithChildrenExpanded = {\n type: 'InteractionDefinition',\n interaction: interactionDefinition.interaction,\n signature: interactionDefinition.signature,\n definitions: definitions,\n parent: interactionDefinition.parent\n };\n\n var interaction = interactionDefinition.interaction;\n\n var interactionsToExpandAlongWithTheirMatchingDefinition;\n\n do {\n interactionsToExpandAlongWithTheirMatchingDefinition =\n _.filter(\n _.map(listNonBaseInteractions(interaction),\n function(x) {\n return {\n interaction: x,\n definition: findMatchingDefinition(x, interactionDefinitionWithChildrenExpanded)\n };\n }),\n function(y) {\n return !isDefinitionOfAnArgument(y.definition) && y.interaction.type === \"InteractionSimple\";\n });\n\n // For each of these interactions to expand, we instatiate them\n _.forEach(interactionsToExpandAlongWithTheirMatchingDefinition, function(x) {\n interaction = instantiate(interaction, x.definition);\n });\n } while (interactionsToExpandAlongWithTheirMatchingDefinition.length > 0);\n\n return {\n type: 'InteractionDefinition',\n interaction: interaction,\n signature: interactionDefinition.signature,\n definitions: definitions,\n parent: interactionDefinition.parent\n };\n}", "resize() {\n this.size = (this.children[0] ? this.children[0].size : 0) +\n (this.children[1] ? this.children[1].size : 0) + 1;\n this.height = Math.max(this.children[0] ? this.children[0].height : 0,\n this.children[1] ? this.children[1].height : 0) + 1;\n return this;\n }", "_expandItemsByDefault(collapseBeforehand) {\n const that = this;\n\n if (that._menuItemsGroupsToExpand.length === 0 && !collapseBeforehand ||\n that.mode !== 'tree' && !that._minimized) {\n return;\n }\n\n const restoreAnimation = that.hasAnimation,\n animationType = that.animation;\n\n if (restoreAnimation) {\n that.animation = 'none';\n }\n\n if (collapseBeforehand) {\n that._collapseAll(false);\n }\n\n for (let i = 0; i < that._menuItemsGroupsToExpand.length; i++) {\n that.expandItem(that._menuItemsGroupsToExpand[i].path, undefined, false);\n }\n\n if (restoreAnimation) {\n that.animation = animationType;\n }\n\n that._menuItemsGroupsToExpand = [];\n }", "expand () {\n this.root.toggle(true, true);\n }", "function expand(node, depth) {\n // Space out based on the current depth so\n // this looks at least a little tree-like.\n for (var i = 0; i < depth; i++) {\n traversalResult += \"-\";\n }\n\n // If there are no children (i.e., leaf nodes)...\n if (!node.children || node.children.length === 0) {\n // ... note the leaf node.\n traversalResult += \"[\" + node.name + \"]\";\n traversalResult += \"\\n\";\n } else {\n // There are children, so note these interior/branch nodes and ...\n traversalResult += \"<\" + node.name + \"> \\n\";\n // .. recursively expand them.\n for (var i = 0; i < node.children.length; i++) {\n expand(node.children[i], depth + 1);\n }\n // depth-=1;\n }\n }", "reloadChildren() {\n this.onLoadChildren();\n }", "function expand(e, datanode, namespaces) {\n for (var c = e.firstChild; c != null; c = c.nextSibling) {\n if (c.nodeType != 1) {\n continue;\n }\n var dataexpr = c.getAttribute(\"data\");\n if (dataexpr) {\n // Evaluate XPath expression in context\n var n = starfish.xml.getNode(datanode, dataexpr, namespaces);\n // Delete any content of the element\n c.innerHTML = \"\";\n // And insert the text content of the XPath result\n c.appendChild(document.createTextNode(getText(n)));\n } else { // If we don't expand the element, recurse on it.\n expand(c, datanode, namespaces);\n }\n }\n }", "expandQuery(expansion) {\n this.expansion.push(expansion);\n this.setAdditionalParameter('expand',this.expansion.join(','));\n return this;\n }", "function expandEp() {\r\n\tvar row = this.parentNode.parentNode;\r\n\tvar eid = row.id.split('_')[1];\r\n\tvar getXML = false;\r\n\tif (!document.getElementById('eid_'+eid+'_ftHolder')) {\r\n\t\tvar nRow = createLoadingRow(10); //the new episode row\r\n\t\tnRow.id = 'eid_' + eid + '_ftHolder';\r\n\t\tnRow.className = 'filesrow';\r\n\t\trow.parentNode.insertBefore(nRow,row.nextSibling);\r\n\t\tgetXML = true;\r\n\t\tvar req = xhttpRequest();\r\n\t\tglobalStatus.updateBarWithText('Fetching episode '+eid+' data...',0,'Loading episode data: ');\r\n\t\tif (''+window.location.hostname == '') xhttpRequestFetch(req, 'xml/eid'+eid+'.xml', parseEpisodeData);\r\n\t\telse xhttpRequestFetch(req, 'animedb.pl?show=xml&t=ep&aid='+uriObj['aid']+'&eid='+eid, parseEpisodeData);\r\n\t} else {\r\n\t\tdocument.getElementById('eid_'+eid+'_ftHolder').style.display = '';\r\n\t}\r\n\tif (!getXML) this.onclick = foldEp;\r\n\telse this.onclick = null;\r\n\tthis.alt = this.title = 'Fold this entry';\r\n\tthis.firstChild.firstChild.nodeValue = '-';\r\n\tthis.className = 'i_icon i_minus';\r\n\turiObj['expand'] = eid;\r\n\turiObj['#'] = 'eid_'+eid;\r\n}", "enableDepth() {\n this.depth = true;\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n }", "function expandForks(nodes, expandedNodes) {\n for(var i=0; i<nodes.length; i++) {\n if (nodes[i].nodeType === 'ACTION') {\n expandedNodes.push(nodes[i]);\n } else if (nodes[i].nodeType === 'FORK') {\n for (var j=0; j<nodes[i].branches.length; j++) {\n expandForks(nodes[i].branches[j], expandedNodes);\n }\n }\n }\n }", "collapseAllNodes() {\n\t\tthis.expandAllNodes(false);\n\t}", "onNodeExpand(parentRecord) {\n // We don't care about expand if it's inside a collapsed subtree\n if (parentRecord.ancestorsExpanded(this)) {\n return this.internalToggleTreeSubRecords(parentRecord, true);\n }\n }", "function expand(node, depth){\n\t // Space out based on the current depth so\n\t // this looks at least a little tree-like.\n\t for (var i = 0; i < depth; i++){\n\t traversalResult += \"-\";\n\t }\n\n\t // If there are no children (i.e., leaf nodes)...\n\t if (!node.children || node.children.length === 0){\n\t // ... note the leaf node.\n\t traversalResult += \"[\" + node.name + \"]\";\n\t traversalResult += \"\\n\";\n\t }else{\n\t // There are children, so note these interior/branch nodes and ...\n\t traversalResult += \"<\" + node.name + \"> \\n\";\n\t // .. recursively expand them.\n\t for (var i = 0; i < node.children.length; i++){\n\t expand(node.children[i], depth + 1);\n\t }\n\t }//eo if else\n\t }//eo expand", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "_expandSection(element) {\n const that = this,\n oldHeight = element.style.height,\n sectionHeight = element.scrollHeight + 'px';\n\n element.style.height = sectionHeight;\n that._treeAnimationInProgress = element;\n\n if (oldHeight === sectionHeight ||\n !parseFloat(oldHeight) && !parseFloat(sectionHeight)) {\n that._transitionendHandlerExpand(that, element);\n return;\n }\n\n element.addEventListener('transitionend', that._transitionendHandlerExpand);\n }", "function expand(syntax, codeArray, level){\n\n /* terminating condition:\n * no children statements to JSON object\n */\n if (syntax == null){\n return;\n }\n for (var w = 0; w < syntax.length; w++){\n\n /* adds each statement to array,\n * gets statement name with getName()\n * calls expand() on statement body to find children,\n * adds 1 to level each time\n */\n codeArray.push([getName(syntax[w].type), level, w, false]);\n expand(getChild(syntax[w]), codeArray, level + 1);\n\n // if if-statement, perform the same on else statement\n if (syntax[w].type == 'IfStatement' && syntax[w].alternate != null){\n codeArray.push(['else', level, w, false]);\n expand(getSibling(syntax[w]), codeArray, level + 1);\n }\n }\n}", "expand(dataNode) {\n if (this.filterValue.value) {\n return;\n }\n this.expansionModel.select(dataNode);\n }", "function addChild(newVal) {\n if (newVal > $rootScope.household.children.length) {\n $http.get('/child').then(function(response) {\n var newChild = response.data;\n newChild.incomeSources = Object.keys(vm.childIncomeSources).map(function(incomeSource) {\n return {type: incomeSource, amount: null, frequency: null};\n });\n $rootScope.household.children.push(newChild);\n // Recurse if necessary\n addChild(newVal);\n });\n }\n }", "function expand1Level(d) {\n var q = [d]; // non-recursive\n var cn;\n var done = null;\n while (q.length > 0) {\n cn = q.shift();\n if (done !== null && done < cn.depth) { return; }\n if (cn._children) {\n done = cn.depth;\n cn.children = cn._children;\n cn._children = null;\n cn.children.forEach(collapse);\n }\n if (cn.children) { q = q.concat(cn.children); }\n }\n // no nodes to open\n }", "updateInnerHeightDependingOnChilds(){}", "configureChildren() {\n this.children = this.props.children\n .map(x => ({\n ...x,\n props: {\n ...x.props,\n setValue: this.setValueOf(x.props.name),\n registerValidator: this.registerValidator(x.props.name),\n unregisterValidator: this.unregisterValidator(x.props.name),\n },\n }))\n }", "function searchFormExpandable() {\n if (mq.end.matches) {\n $(selectors.searchForm).expandable('revive');\n $(selectors.advancedSearchForm).expandable('revive');\n }\n else {\n $(selectors.searchForm).expandable('kill');\n $(selectors.searchForm).children('div').removeAttr('style');\n $(selectors.advancedSearchForm).expandable('kill');\n $(selectors.advancedSearchForm).children('div').removeAttr('style');\n }\n return;\n }", "function moveExpander(previousItem, activeItem) {\n\n var activeID = activeItem.attr('id');\n var bgColor;\n var expHeight = expanderHeight; //height of expander info <div>\n var passHeight = activeItem.select('a').node().offsetHeight;\n var itemHeight = expHeight + passHeight; //the height of <li>\n\n var prevHeight = previousItem.node().offsetHeight;\n\n //set expanded class to new <li>\n //set new <li> height\n activeItem.classed('expanded', true)\n .style('height', prevHeight + 'px')\n .each(function (d, i) {\n bgColor = d.keyDoc.backgroundColor;\n var rule = styles.cssRules.item(afterRuleIndex); // get css rule from sheet for <a::after> using index\n rule.style['border-bottom-color'] = bgColor; //change <a::after>\n });\n\n //remove old <li> expanded class\n previousItem.classed('expanded', false)\n .style('height', null);\n\n\n //add back expander div to place content into\n var expand = activeItem.append('div')\n .attr('class', 'expander')\n .attr('id', activeID + '-exp')\n .style('opacity', 0) //add it with 0\n .transition()\n .style('opacity', 1) //slow transistion to opacity 1 and new color\n .style('background-color', function (d, i) {\n return d.keyDoc.backgroundColor;\n })\n .each(buildExpander)\n .each(function () {\n var expandElem = d3.select(this);\n var innerHeight = expandElem.select('.expand-inner div').node().offsetHeight;\n if (innerHeight > expHeight) { //300 is minium expander height\n expHeight = innerHeight + 60;\n }\n\n console.log(innerHeight);\n var itemHeight = expHeight + passHeight; //the height of <li>\n\n //transistion the height of both <li.expanded> and <div.expander> simultaniously\n activeItem //uses css transistion\n .style('transition', 'none')\n .style('height', function (d, i) {\n return itemHeight + 'px';\n });\n\n\n expandElem //uses css transistion\n .style('transition', 'none')\n .style('height', function (d, i) {\n return expHeight + 'px';\n });\n }); //when fade in finishes add text info\n\n previousItem.select('.expander') //fade the previous background\n .transition()\n .style('opacity', 0);\n\n previousItem.select('.expand-inner') //fade the text\n .transition()\n .style('opacity', 0)\n .each(\"end\", function () { //when fade out finishes\n\n previousItem.select('.expander')\n .remove();\n\n });\n\n\n var menuTopMargin = d3.select('.nav-menu').node().offsetHeight + 15; //menu bottom + extra\n //scroll grid\n scrollGrid(activeItem, expHeight, menuTopMargin);\n\n\n }", "_expand() {\n const that = this;\n\n if (that._neighbourItem && that._neighbourItem.parentElement) {\n that.expand();\n return;\n }\n\n const ownerElement = that.closest('jqx-splitter');\n\n if (!ownerElement) {\n return;\n }\n\n delete that._neighbourItem;\n\n that.collapsed = false;\n ownerElement.$.fireEvent('expand', { itemIndex: ownerElement._items.indexOf(that) });\n\n that.style[ownerElement._measurements.minDimension] = that.min ? that._sizeLimits[ownerElement._measurements.minDimension] + 'px' : '';\n that.style[ownerElement._measurements.dimension] = that._sizeBeforeCollapse + 'px';\n\n if (ownerElement._items.length < 2) {\n return;\n }\n\n if (that.previousElementSibling instanceof JQX.SplitterBar) {\n that.previousElementSibling.itemCollapsed = false;\n that.previousElementSibling.showNearButton = ownerElement._items[ownerElement._items.indexOf(that) - 1].collapsible;\n }\n }", "set hasChildren(value) {}", "function mergeChildren(from, into, refNode, forward){\n\t\tvar child, dir;\n\t\twhile ((child = from[forward ? 'last' : 'first'](elementType))){\n\t\t\tif ((dir = child.getDirection(1)) !== into.getDirection(1)) child.setProperty('dir', dir);\n\t\t\tchild.dispose();\n\t\t\trefNode ? child[forward ? 'injectBefore' : 'injectAfter'](refNode) : \n\t\t\t\tinto.append(child, forward);\n\t\t}\n\t}", "function searchFormExpandable() {\r\n if (mq.end.matches) {\r\n $(selectors.searchForm).expandable('revive');\r\n $(selectors.advancedSearchForm).expandable('revive');\r\n }\r\n else {\r\n $(selectors.searchForm).expandable('kill');\r\n $(selectors.searchForm).children('div').removeAttr('style');\r\n $(selectors.advancedSearchForm).expandable('kill');\r\n $(selectors.advancedSearchForm).children('div').removeAttr('style');\r\n }\r\n return;\r\n }", "function ContentChildrenDecorator(){}", "function expandGroupTable() { doGroupTableOperations('expand'); }", "append(node, dest, breakToken, shallow = true, rebuild = true) {\n\n\t\tlet clone = cloneNode(node, !shallow); //clona sempre il nodo, sostanzialmente\n\t\tif (node.parentNode && isElement(node.parentNode)) {\n\t\t\tlet parent = findElement(node.parentNode, dest); //dest è sostanzialmente la destinazione ovvero dove deve essere attaccato\n\t\t\tconsole.log(\"Parent in append\", parent, dest); //Non trova il parent all'interno della pagina per il breaktoken. Quindi, va reinserito\n\t\t\t// Rebuild chain\n\t\t\tif (parent) {\n\t\t\t\tparent.appendChild(clone);\n\t\t\t\tconsole.log(\"appendChild\", clone);\n\t\t\t} else if (rebuild) { //Rebuild ancestor serve per ricostruire e reinerire il breaktoken\n\t\t\t\tlet fragment = rebuildAncestors(node);\n\t\t\t\tconsole.log(\"rebuildAncestors fragment\", fragment);\n\t\t\t\tparent = findElement(node.parentNode, fragment); //Gli ho aggiunto i p e section\n\t\t\t\tconsole.log(parent);\n\t\t\t\tif (!parent) {\n\t\t\t\t\tdest.appendChild(clone);\n\t\t\t\t} else if (breakToken && isText(breakToken.node) && breakToken.offset > 0) {\n\t\t\t\t\tclone.textContent = clone.textContent.substring(breakToken.offset); //substring partendo dall'offset del breaktoken.\n\t\t\t\t\tparent.appendChild(clone);\n\t\t\t\t} else {\n\t\t\t\t\tparent.appendChild(clone);\n\t\t\t\t}\n\n\t\t\t\tdest.appendChild(fragment);\n\t\t\t} else {\n\t\t\t\tdest.appendChild(clone);\n\t\t\t}\n\n\n\t\t} else {\n\t\t\tdest.appendChild(clone);\n\t\t}\n\n\t\t/*let nodeHooks = this.hooks.renderNode.triggerSync(clone, node);\n\t\tnodeHooks.forEach((newNode) => {\n\t\t\tif (typeof newNode != \"undefined\") {\n\t\t\t\tclone = newNode;\n\t\t\t}\n\t\t});*/\n\n\t\tthis.getStyle(clone.parentNode);\n\n\t\treturn clone;\n\t}", "expand() {\n return __awaiter(this, void 0, void 0, function* () {\n this.outerElement.classList.remove('collapsed');\n return utils_1.sleep(200);\n });\n }", "function ebx_DMANavigationTree_expandAll(treeName, nodeId) {\r\n\tebx_ajaxTreeReplaceChildren(treeName, nodeId, '&navigationTree_expandAll=true');\r\n}", "setChildren() {\n var children = Object.keys(this).filter(t=>t!=\"endOfWord\");\n\n children.forEach(entry => {\n if (!trieNode.prototype.isPrototypeOf(this[entry])) {\n this[entry] = Object.setPrototypeOf(this[entry], trieNode.prototype);\n }\n this[entry].setChildren();\n });\n }", "toggleExpanded () {\n this.isExpanded = !this.isExpanded;\n this.applyExpanded();\n this.commentMorphs.forEach(commentMorph => {\n commentMorph.viewModel.comment.viewCollapsed = !this.isExpanded;\n });\n }", "updateInnerWidthDependingOnChilds(){}", "function propagateExpanded(data, state) {\n data.data.expanded = state;\n data.children.forEach(function (child) {\n return propagateExpanded(child, state);\n });\n } // Position all bubble indicators to be next to each other.", "build(): Statement {\n this.chainedStmt.appendMethodCall(new MemberMethodCallStmt(null, 'build'));\n return this.chainedStmt;\n }", "onToggleExpanded() {\n this.toggleProperty('isExpanded');\n }", "expand() {\n const that = this;\n\n if (that._ignorePropertyValue || that.collapsed) {\n const ownerElement = (that.getRootNode() ? that.getRootNode().host : null) || that.closest('jqx-splitter');\n\n if (!ownerElement) {\n that.collapsed = true;\n return;\n }\n\n if (!that._neighbourItem) {\n that.collapsed = true;\n return;\n }\n\n delete that._ignorePropertyValue;\n\n if (!that._neighbourItem._ignorePropertyValue && that._neighbourItem.collapsed) {\n let neighbourItemIndex = ownerElement._items.indexOf(that._neighbourItem);\n const direction = ownerElement._items.indexOf(that) > ownerElement._items.indexOf(that._neighbourItem) ? -1 : 1;\n\n that._neighbourItem = ownerElement._items[neighbourItemIndex];\n\n while (that._neighbourItem) {\n if (!that._neighbourItem.collapsed) {\n break;\n }\n\n neighbourItemIndex += direction;\n that._neighbourItem = ownerElement._items[neighbourItemIndex];\n }\n }\n\n if (!that._neighbourItem) {\n that.collapsed = true;\n return;\n }\n\n if (that.min) {\n that._setSize('min', that.min, true);\n }\n\n const totalSpace = that._neighbourItem._sizeBeforeCollapse,\n minSize = that._sizeLimits[ownerElement._measurements.minDimension],\n neighbourItemMin = that._neighbourItem._sizeLimits[ownerElement._measurements.minDimension],\n spaceAvailable = totalSpace - minSize;\n\n if (totalSpace && spaceAvailable < neighbourItemMin) {\n that.collapsed = true;\n return;\n }\n\n if (!that._neighbourItem._paddings) {\n const computedStyle = getComputedStyle(that._neighbourItem);\n\n that._neighbourItem._paddings = (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position)) || 0) +\n (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position2)) || 0);\n }\n\n if (!that._paddings) {\n const computedStyle = getComputedStyle(that);\n\n that._paddings = (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position)) || 0) +\n (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position2)) || 0);\n }\n\n if ((that.size + '').indexOf('%') > -1 && (!that._sizeBeforeCollapse || that._sizeBeforeCollapse === 0) && that._neighbourItem._sizeBeforeCollapse) {\n let totalItemSize = 0;\n\n ownerElement._items.map(item => totalItemSize += !item.collapsed ?\n (item.style[ownerElement._measurements.dimension] && item.style[ownerElement._measurements.dimension].indexOf('%') < -1 && item._sizeBeforeCollapse ?\n item._sizeBeforeCollapse : item.getBoundingClientRect()[ownerElement._measurements.dimension]) : 0);\n that._sizeBeforeCollapse = totalItemSize * parseFloat(that.size) / 100;\n }\n\n const previousSize = Math.min(Math.max(minSize, that._sizeBeforeCollapse), totalSpace - that._neighbourItem._paddings - that._paddings - neighbourItemMin);\n\n if (previousSize < 0) {\n that.collapsed = true;\n return;\n }\n\n //Add animation class\n if (that.hasAnimation && !ownerElement._isInitializing) {\n that.$.addClass('animate');\n that._neighbourItem.$.addClass('animate');\n\n that.addEventListener('transitionend', that._transitionEndHandler, { once: true });\n that.addEventListener('transitioncancel', that._transitionEndHandler, { once: true });\n that._neighbourItem.addEventListener('transitionend', that._transitionEndHandler, { once: true });\n that._neighbourItem.addEventListener('transitioncancel', that._transitionEndHandler, { once: true });\n }\n\n //Restore the size before collapsing\n that.style.padding = '';\n that.style[ownerElement._measurements.minDimension] = that.min ? that._sizeLimits[ownerElement._measurements.minDimension] + 'px' : '';\n that.style[ownerElement._measurements.dimension] = (that._sizeBeforeCollapse = previousSize) + 'px';\n\n that._neighbourItem.style[ownerElement._measurements.dimension] =\n (that._neighbourItem._sizeBeforeCollapse = Math.max(that._neighbourItem._sizeLimits[ownerElement._measurements.minDimension], totalSpace - previousSize)) + 'px';\n\n if (that._neighbourItem._sizeLimits[ownerElement._measurements.maxDimension]) {\n that._neighbourItem.style[ownerElement._measurements.maxDimension] = that._neighbourItem._sizeLimits[ownerElement._measurements.maxDimension] + 'px';\n }\n\n that.collapsed = false;\n ownerElement.$.fireEvent('expand', { itemIndex: ownerElement._items.indexOf(that) });\n\n if (ownerElement._items.indexOf(that) > ownerElement._items.indexOf(that._neighbourItem)) {\n that.previousElementSibling.itemCollapsed = false;\n that.previousElementSibling.showNearButton = that._neighbourItem.collapsible;\n }\n else {\n that.nextElementSibling.itemCollapsed = false;\n that.nextElementSibling.showFarButton = that._neighbourItem.collapsible;\n }\n\n const previousElement = ownerElement._items[ownerElement._items.indexOf(that) - 1],\n nextElement = ownerElement._items[ownerElement._items.indexOf(that) + 1];\n\n if (previousElement) {\n const previousSplitterBar = previousElement.nextElementSibling;\n\n if (previousSplitterBar && previousSplitterBar instanceof JQX.SplitterBar) {\n if (!previousElement.collapsed) {\n previousSplitterBar.itemCollapsed = false;\n previousSplitterBar.showNearButton = previousElement.collapsible;\n previousSplitterBar.showFarButton = that.collapsible;\n }\n else {\n previousSplitterBar.showNearButton = that.collapsible;\n }\n }\n }\n\n if (nextElement) {\n const nextSplitterBar = nextElement.previousElementSibling;\n\n if (nextSplitterBar && nextSplitterBar instanceof JQX.SplitterBar) {\n if (!nextElement.collapsed) {\n nextSplitterBar.itemCollapsed = false;\n nextSplitterBar.showNearButton = that.collapsible;\n nextSplitterBar.showFarButton = nextElement.collapsible;\n }\n else {\n nextSplitterBar.showFarButton = nextElement.collapsed;\n }\n }\n }\n\n delete that._neighbourItem;\n }\n }", "addSub(prop) {\n const index = this.parent.order.indexOf(this.name);\n if (index >= 0) {\n this.parent.order[index] = [this.parent.order[index], prop];\n }\n else {\n for (const p of this.parent.order) {\n if (Array.isArray(p)) {\n if (p.indexOf(this.name) >= 0) {\n p.push(prop);\n }\n }\n }\n }\n this.schemaChange.emit();\n }", "setChildren(nodes) {\n this.children = nodes;\n return this;\n }", "function expandToNode(selfUL, nodeDIV, ignoreOnExpand) {\r\n\t\tif ($.type(nodeDIV.target) != \"undefined\") {\r\n\t\t\tignoreOnExpand = nodeDIV.ignoreOnExpand;\r\n\t\t\tnodeDIV = nodeDIV.target;\r\n\t\t}\r\n\r\n\t\tvar nodes = [];\r\n\t\tvar parentNode = getParentNode(selfUL, nodeDIV);\r\n\t\twhile (parentNode) {\r\n\t\t\tnodes.unshift(parentNode);\r\n\t\t\tparentNode = getParentNode(selfUL, parentNode.target);\r\n\t\t}\r\n\t\tfor ( var i = 0; i < nodes.length; i++) {\r\n\t\t\texpandNode(selfUL, nodes[i].target, null, ignoreOnExpand);\r\n\t\t}\r\n\t}", "setChildren(children){\n this.children = children;\n }", "function expandAllNodes(selfUL, nodeDIV) {\r\n\t\tvar nodes = getDescendantsFolders(selfUL, nodeDIV);\r\n\t\tif (nodeDIV) {\r\n\t\t\tnodes.unshift(getNode(selfUL, nodeDIV));\r\n\t\t}\r\n\t\tfor ( var i = 0; i < nodes.length; i++) {\r\n\t\t\texpandNode(selfUL, nodes[i].target);\r\n\t\t}\r\n\t}", "adjustChildren(){\n var { context, href, schemas, children, windowWidth } = this.props;\n if (!context) return children;\n // We shouldn't ever receive a single Child.\n return React.Children.map(children, (child)=>\n React.cloneElement(child, { context, href, windowWidth, schemas })\n );\n }" ]
[ "0.6554786", "0.5971226", "0.5688395", "0.5547575", "0.5547575", "0.5512633", "0.5477365", "0.547535", "0.54587495", "0.5410104", "0.5406938", "0.5370141", "0.53616136", "0.53261757", "0.52407646", "0.51841414", "0.5175142", "0.5163919", "0.516161", "0.51360625", "0.5128049", "0.5127829", "0.5127829", "0.5127829", "0.51187766", "0.51096463", "0.50864667", "0.50687456", "0.5057494", "0.50429934", "0.50292164", "0.5021464", "0.5019089", "0.5012881", "0.49993822", "0.4987857", "0.497948", "0.49663013", "0.49355415", "0.49237663", "0.4920883", "0.4919618", "0.49159315", "0.48882318", "0.48607537", "0.48083866", "0.48083466", "0.48083466", "0.48030442", "0.47997165", "0.47898743", "0.47860292", "0.4782566", "0.477609", "0.4773197", "0.4770099", "0.4769903", "0.47666132", "0.47665375", "0.47641492", "0.4757767", "0.4757164", "0.47456512", "0.47321057", "0.47305414", "0.47235224", "0.47208023", "0.47098443", "0.46970052", "0.46895042", "0.4685218", "0.46833315", "0.46756995", "0.46657428", "0.46577123", "0.4655623", "0.4646402", "0.4624712", "0.46204537", "0.4616552", "0.45998797", "0.45925987", "0.45925218", "0.45760885", "0.45685056", "0.45681846", "0.45632726", "0.45628834", "0.455523", "0.4554145", "0.45416197", "0.45372176", "0.45325842", "0.45309642", "0.45239154", "0.45169264", "0.45161656", "0.45148247", "0.4513329", "0.45128983" ]
0.60383654
1
Load Game and append to req
function load(req, res, next, id) { Game.get(id).then((game) => { req.game = game; // eslint-disable-line no-param-reassign next(); }).error((e) => next(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getGame() {\n return this.__request(`${this.api_url}/game/start`, \"POST\");\n }", "function startGameRequest() {\n\n var create_game_callback = function(json) {\n window.gameID = parseInt(json);\n console.log(\"created new game with gameID: \" + gameID);\n sendToTicker(\"New game created!\");\n sendToTicker(\"Waiting for players...\");\n\n window.location = HOSTNAME + \"/game.html#\" + gameID;\n\n updateClient();\n }\n\n makeAjaxRequest(HOSTNAME + \"/create_game\", \"\",\n create_game_callback);\n}", "function requestGameJSON(){\n\tsocket.emit(\"requestGameJSON\");\n}", "function _handleRequestGames(data) {\r\n\tconsole.log('REQUESTED GAMES:', data.toString().trim());\r\n\tstate = SELECT_GAME;\r\n\r\n\tauthServer.write('N\\t' + game + '\\n');\r\n}", "function loadGame(){\n\tgame = getJSON(\"http://navy.hulu.com/[email protected]\");\n\tboard = [];\n\t\n\t// Display game information\n\twriteToConsole(\"GAME ID = \" + game.game_id);\n\twriteToConsole(\"SHIPS = [\" + game.ship_sizes + \"]\");\n\twriteToConsole(\"BOARD = (\" + game.board_size.width + \", \" + game.board_size.height + \")\");\n\t\n\t// Intialize board to default values\n\tfor(var w=0; w<game.board_size.width; w++){\n\t\tboard[w] = [];\n\t\tfor(var h=0; h<game.board_size.height; h++){\n\t\t\tboard[w][h]=0;\t\t// signifies uninspected\n\t\t}\n\t}\n\t\n\tships = game.ship_sizes;\n\t\n\traiseSuccess(\"Game intialized\");\n}", "load() {\n Logger.info(`The game(${this._id}) is loading...`)\n this.event_manager.trigger('game_load', [this])\n Logger.info('Loading the game mode')\n _.forEach(this._games, (game) => game._load())\n }", "function loadGames(){\n\tvar request = loadViaAjax(\"AllGames.json\");\n\trequest.done(function(data) {\n\t\tGames = data;\n\t\tcreateGameCategories();\n\t\tcreateGameCategoryAll();\n\t});\n\treturn request;\n}", "function renderGame(req, res) {\n res.ViewData.title = \"Labumentous - Game\";\n res.render(\"game\", res.ViewData);\n }", "function loadGameFromServerFEN(xhttp) {\n playerInfo.playingAs = parseServerResponseFor(xhttp.responseText, \"Colour\").toLowerCase();\n board.load(parseServerResponseFor(xhttp.responseText, \"FEN\"));\n }", "function loadGame(gameType, gameData) {\r\n\t\tif (gameType == 'spelling') {\r\n\t\t\tvar myGame = UnityLoader.instantiate($(\".new-game-frame\")[0], \"/public/games/spelling/Build/TypingFinalBuild.json\", {\r\n\t\t\t\tonProgress: (gameInstance, progress) => {\r\n\t\t\t\t\tif (progress == 1) {\r\n\t\t\t\t\t\tconsole.log(\"game is loaded\")\r\n\t\t\t\t\t\tconsole.log(gameInstance)\r\n\t\t\t\t\t\tgameInstance.SendMessage(\"GameMgr\", \"SetGameData\", JSON.stringify(gameData));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else if (gameType == 'math') {\r\n\t\t\tvar myGame = UnityLoader.instantiate($(\".new-game-frame\")[0], \"/public/games/math/Build/FinalBuild.json\", {\r\n\t\t\t\tonProgress: (gameInstance, progress) => {\r\n\t\t\t\t\tif (progress == 1) {\r\n\t\t\t\t\t\tconsole.log(\"game is loaded\")\r\n\t\t\t\t\t\tconsole.log(gameInstance)\r\n\t\t\t\t\t\tgameInstance.SendMessage(\"GameMgr\", \"SetGameData\", JSON.stringify(gameData));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t}", "function newGame(){\n\t$.ajax({\n\t\turl: \"game-api.php\",\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t\taction: \"new-game\"\n\t\t},\n\t\tsuccess: refreshGameContainer\n\t});\n}", "loadMujeresForGame () {\n return http.get(\"auth/data/gameMujeres\", User.getToken());\n }", "function startNewAttempt(context) {\n \n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n context.state.start('Preload');\n }\n }\n xmlhttp.open(\"GET\",\"storenewgame.php\",true);\n xmlhttp.send();\n\n}", "static load(gameInstance) {}", "async function getGame(req, res) {\n const game = await Game.findByIdAndUser(req.params.id, req.user);\n\n res.json(game.outputForUser(req.user._id));\n}", "function addGame(game) {\n let url = 'https://limitless-tor-81099.herokuapp.com/gamesapi';\n\n fetch(url, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n // adding JSON.stringify to add \"\" to JS object keys\n body: JSON.stringify(game)})\n .then(function(res) {\n // adding toastr alert\n toastr.success('Game has been added', 'Success');\n // alert(\"Game added!\");\n // get new games list\n getGames();\n return res.json();\n })\n .catch(function(err) { console.log('Error adding game', err); });\n }", "function loadGame() {\n var file = JSON.parse(localStorage.getItem('saveFile'));\n\n if (file !== null) {\n gameData.update = file.update\n gameData.beer = file.beer;\n gameData.beerPerClick = file.beerPerClick;\n gameData.beerPerClickCost = file.beerPerClickCost;\n gameData.grain = file.grain;\n gameData.money = file.money;\n gameData.moneyPerBeer = file.moneyPerBeer;\n gameData.grainCapacity = file.grainCapacity;\n gameData.grainCost = file.grainCost;\n gameData.grainPerMin = file.grainPerMin;\n\n showGameData();\n } else {\n console.log(\"no save file\")\n }\n}", "function requestPlayers()\n{\n\tvar request = new XMLHttpRequest();\n\t//Run sync so that we wait for our response before trying to operate with it. \n\trequest.open('GET',json_url.ip+json_url.port, false);\n\tlog(['requestPlayers','open'],json_url.ip+json_url.port);\n\trequest.onload = function ()\n\t{\n\t\tif (request.status >= 200 && request.status < 400)\n\t\t{\n\t\t\tlog(['requestPlayers','onload'],request.responseText);\n\t\t\tstorePlayers(request.responseText);\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert('Request defined');\n\t\t}\n\t}\n\trequest.onerror = function ()\n\t{\n\t\tlog(['requestPlayers','onerror'],'error');\n\t\talert('Error on request');\n\t}\n\trequest.send();\n}", "function updateGame(gameId, play, player1) {\n\n var url = \"/w/game/\" + gameId + \"/play/\" + play;\n\n if (player1 != null) url += \"?player1=\" + player1\n\n $.ajax({\n url: url,\n dataType: \"json\"\n }).success(function (data) {\n $('body').html(buildConsole(data));\n });\n}", "function loadGame(){\n\t// images\n\tbgImage.src = \"images/backgframe_480.jpg\";\n\tdude.src = \"images/person.png\";\n\tscrollImage.src = \"images/scroll.png\";\n\t\n\t// required buttons\n \tpauseButtonImage.src = \"images/gmenub1.png\";\n\t\n \tpauseButtonImage2.src = \"images/gpauseButton.png\";\n\t\n\t// test buttons (debugging)\n \tgenerateButtonImage.src = \"images/button.png\";\n\tvictoryButtonImage.src = \"images/button.png\";\n\taddscoreButtonImage.src = \"images/button.png\";\n\taddGameOverButtonImage.src = \"images/button.png\";\n\n\t/*// turn off main menu music\n\tmusicOn = false;\n\tmusic.pause();*/\n\t\n\tinitGameSetting(); //rules.js\n}", "async requestJoinGame ({ request, auth, response }) {\n try {\n const user = await User.query()\n .where('id', auth.current.user.id)\n .with('applications')\n .firstOrFail()\n const game = await Game.query()\n .where('id', request.input('game_id'))\n .with('applicants')\n .firstOrFail()\n game.merge({\n curr_num: game.curr_num + 1\n })\n await game.save()\n await user.applications().attach(game.id)\n return response.json({\n status: 'success',\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'Tivemos um problema atualizando seu jogo. Por favor tente novamente.'\n })\n }\n }", "function loadGameData()\n\t\t\t{\n\t\t\t\tif(gameName == \"fatcat7\")\n\t\t\t\t{\n\t\t\t\t\tgame = new FatCat7Game();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"bounty\")\n\t\t\t\t{\n\t\t\t\t\tgame = new BountyGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"gummibar\")\n\t\t\t\t{\n\t\t\t\t\tgame = new GummiBarGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"aprilmadness\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AprilMadnessGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"moneybooth\")\n\t\t\t\t{\n\t\t\t\t\tgame = new MoneyBoothGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"astrologyanswers\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AstrologyAnswersGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t\tisBothFreeSpinAndOtherBonus = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgame.importGame(xmlData);\n\t\t\t}", "function sendGameRequest(numPlayers) {\n var message = {\"NumPlayers\": numPlayers};\n sendMessage(NEW_GAME_CMD, message);\n }", "async joinGame ({ request, auth, response }) {\n // get currently authenticated user\n const user = auth.current.user\n const game = await Game.query()\n .where('id', request.input('game_id'))\n .firstOrFail()\n game.merge({\n avg_level: (((game.avg_level * game.curr_num) + user.level) / (game.curr_num + 1)),\n curr_num: game.curr_num + 1\n })\n await game.save()\n await user.games().attach(request.input('game_id'))\n return response.json({\n status: 'success',\n data: game\n })\n }", "function load_create_game_page() {\n page = 'create_game';\n load_page();\n}", "async _createGame(game) {\n await this.createFile(`game_${game.id}`, () => {\n const data = serializer.transform(game);\n data.version = getLatestVersionNumber('game');\n\n this._attachGame(game);\n return data;\n });\n await this._updateGameSummary(game);\n if (game.state.startedAt) {\n await this._recordGameStats(game);\n this._syncAutoSurrender(game);\n }\n }", "function playGame() {\n let myMove = this.children[0].innerHTML.toLowerCase();\n \n let url = \"https://webster.cs.washington.edu/pokedex/game.php\";\n let data = new FormData();\n data.append(\"guid\",gameID);\n data.append(\"pid\",playerID);\n data.append(\"move\", myMove);\n \n $(\"loading\").classList.remove(\"hidden\");\n \n fetch(url, {method:\"POST\", body:data})\n .then(checkStatus)\n .then(JSON.parse)\n .then(playMove);\n \n $(\"loading\").classList.add(\"hidden\");\n }", "function casinotv_initialize() {\r\n context.include(\"game.js\");\r\n}", "function loadSession(session) {\n BD18.gm = null;\n BD18.gm = session;\n if( !BD18.doneWithLoad ){\n\tBD18.history = [JSON.stringify(BD18.gm)];\n\tBD18.historyPosition = 0;\n\tvar boxstring = 'box=';\n\tboxstring = boxstring + BD18.gm.boxID;\n\t$.getJSON(\"php/gameBox.php\", boxstring, loadBox)\n\t .fail(function() { \n\t\t var msg = \"Error loading game box file. \\n\";\n\t\t msg = msg + \"This is probably due to a game box format error.\";\n\t\t alert(msg); \n\t });\n } else {\n\titemLoaded();\n }\n}", "function loadSession(session) {\n BD18.gm = null;\n BD18.gm = session;\n if( !BD18.doneWithLoad ){\n\tBD18.history = [JSON.stringify(BD18.gm)];\n\tBD18.historyPosition = 0;\n\tvar boxstring = 'box=';\n\tboxstring = boxstring + BD18.gm.boxID;\n\t$.getJSON(\"php/gameBox.php\", boxstring, loadBox)\n\t .fail(function() { \n\t var msg = \"Error loading game box file. \\n\";\n\t msg = msg + \"This is probably due to a game box format error.\";\n\t alert(msg); \n\t });\n } else {\n\titemLoaded();\n }\n}", "async function gamePage(req, res, next)\n{\n try\n {\n await usersdb.auth(req.session.username, req.session.password);\n }\n catch (err)\n {\n // Go to log in if not logged in\n res.redirect('/');\n return;\n }\n\n // Get the game name from the query\n var game_name = decodeURIComponent(req.params[\"name\"]);\n\n // Return a JSON list instead\n if (game_name == \"all\")\n {\n if (req.query.search) // Run a search\n {\n // Get the search string\n var search = decodeURIComponent(req.query.search);\n\n // Get the number of results to return\n var num;\n if (req.query.num)\n num = parseInt(req.query.num);\n else\n num = 5;\n\n res.json(await gamesdb.searchNames(search, num));\n }\n else // Return all the games\n {\n res.json(await gamesdb.allNames());\n }\n\n return;\n }\n\n // Get the current user\n var currentuser = await usersdb.get(req.session.username);\n\n try\n {\n // Get the game\n var game = await gamesdb.get(game_name);\n\n // The database used to not store song data,\n // so some entries need to be updated\n if (game.songs == undefined)\n {\n try\n {\n // This might fail if the entry is malformed\n game = await gamesdb.updateSongs(game_name);\n }\n catch (e)\n {\n // Do nothing\n }\n }\n\n // Get all the songs for the game\n var songs = await songsdb.find(game.songs);\n\n var content =\n {\n currentuser: currentuser,\n game: game,\n songs: songs\n }\n\n res.render('game', content);\n }\n catch (err) // Game not found\n {\n console.log(err);\n next(createError(404));\n }\n}", "function requestScore(playerName, type, onload) {\r\n GM_xmlhttpRequest({\r\n method:'POST',\r\n url:'http://' + gameServer + '/index.php',\r\n data:\"view=highscore&highscoreType=\" + type + \"&searchUser=\" + playerName,\r\n headers: {\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Content-type': 'application/x-www-form-urlencoded',\r\n 'Accept': 'application/atom+xml,application/xml,text/xml',\r\n 'Referer': 'http://' + gameServer + '/index.php'\r\n },\r\n onload:onload\r\n });\r\n}", "function getGameSession(autostart)\n{\n var handler = function(responseText)\n {\n var response = JSON.parse(responseText);\n\n if( response[\"responseCode\"] == 0)\n {\n var data = response[\"data\"];\n \n loadGameSeed(data[\"seed\"]);\n loadPlayer(data[\"aereo\"]);\n loadWeaponSet(data[\"armi\"]);\n spawnRate = 800;\n\n if(autostart)\n start();\n }\n else\n {\n //fatal error!\n console.log(response[\"message\"]);\n window.location.replace(\"./homepage.php\");\n }\n }\n\n ajaxRequest(\"./ajax/game/getGameSession.php\", \"GET\", handler);\n}", "function load(){\n\t//Display the loading progress bar while the game\n\tprogressBar.create(g.canvas, assets);\n\tprogressBar.update();\n}", "function preload (game){\n\t \t\tconsole.log(\"preload\");\n\t \t\tgame.load.crossOrigin = 'anonymous';\n\t\t\tgame.load.image('gift-basic', resolveUrl('data/gift-basic.png'));\n\t\t\tgame.load.image('gift-clock', resolveUrl('data/gift-clock.png'));\n\t\t\tgame.load.image('gift-compass', resolveUrl('data/gift-compass.png'));\n\t\t\tgame.load.image('gift-double', resolveUrl('data/gift-double.png'));\n\t\t\tgame.load.image('gift-freeze', resolveUrl('data/gift-freeze.png'));\n\t\t\tgame.load.image('gift-glasses', resolveUrl('data/gift-glasses.png'));\n\t\t\tgame.load.image('gift-ink', resolveUrl('data/gift-ink.png'));\n\t\t\tgame.load.image('gift-mushroom', resolveUrl('data/gift-mushroom.png'));\n\t\t\tgame.load.image('gift-speedup', resolveUrl('data/gift-speedup.png'));\n\t\t\tgame.load.image('gift-watch', resolveUrl('data/gift-watch.png'));\n\t\t\tgame.load.image('gift-bomb', resolveUrl('data/gift-bomb.png'));\t\n\t\t\tgame.load.image('gameover', resolveUrl('data/gameover.gif'));\n\t\t\tgame.load.image('ink-splash', resolveUrl('data/ink-splash.png'));\n\t\t\tgame.load.image('background', resolveUrl('data/background.png'));\n\t\t\tgame.load.image('background2', resolveUrl('data/background2.png'));\n\t\t\tgame.load.image('giftstar1', resolveUrl('data/giftstar1.png'));\n\t\t\tgame.load.image('giftstar2', resolveUrl('data/giftstar2.png'));\n\t\t\tgame.load.image('giftstar3', resolveUrl('data/giftstar3.png'));\n\t\t\tgame.load.image('giftstar4', resolveUrl('data/giftstar4.png'));\n\t\t\tgame.load.image('giftstar5', resolveUrl('data/giftstar5.png'));\n\t\t\tgame.load.image('santa', resolveUrl('data/santa.png'));\n\t\t\tgame.load.script('BlurX', resolveUrl('filters/BlurX.js'));\n\t \tgame.load.script('BlurY', resolveUrl('filters/BlurY.js'));\n\t \tgame.load.audio('background-music', resolveUrl('data/LoveIsAChristmasRose_PineyGir.mp3'));\n\t \tgame.load.audio('sfx', resolveUrl('data/fx_mixdown.ogg'));\n\n\t \t}", "function gameRequest() {\n $(\"pokedex-view\").classList.add(\"hidden\");\n $(\"their-card\").classList.remove(\"hidden\");\n qs(\"#my-card .hp-info\").classList.remove(\"hidden\");\n $(\"results-container\").classList.remove(\"hidden\");\n $(\"p1-turn-results\").classList.remove(\"hidden\");\n $(\"p2-turn-results\").classList.remove(\"hidden\");\n $(\"flee-btn\").classList.remove(\"hidden\");\n $(\"start-btn\").classList.add(\"hidden\");\n $(\"title\").innerHTML = \"Pokemon Battle Mode!\";\n \n for (let i=0; i<qsa('.buffs').length; i++) {\n qsa('.buffs')[i].classList.remove(\"hidden\"); \n } \n \n let url = \"https://webster.cs.washington.edu/pokedex/game.php\";\n let data = new FormData();\n data.append(\"startgame\",true);\n data.append(\"mypokemon\",pokeSelect);\n \n fetch(url, {method:\"POST\", body:data})\n .then(checkStatus)\n .then(JSON.parse)\n .then(gameView);\n }", "function prepareNewGame(){\n client.prepareNewGame('Phat3lfstone', 'red', GameSettings.create());\n}", "function start(){\n setupSocket();\n socket.emit('reqStartGame', gameConfig.userName);\n}", "function apiRequestGame(id, res) {\r\n axios({\r\n url: \"https://api.igdb.com/v4/games\",\r\n method: \"POST\",\r\n headers: {\r\n \"Accept\": \"application/json\",\r\n \"Client-ID\": \"5py1g59uv8cdxn70ejawwm0vz6k7fk\",\r\n \"Authorization\": \"Bearer ycxnh3depzhn9wfz9he4dkggahig81\",\r\n },\r\n data: \"fields age_ratings,involved_companies,involved_companies.company.name,involved_companies.developer,involved_companies.publisher,similar_games,similar_games.name,similar_games.cover.image_id,summary,total_rating,total_rating_count,websites,websites.url,websites.category,name,rating,screenshots,screenshots.image_id,videos,videos.video_id,involved_companies,cover.image_id,cover,platforms,platforms.name,platforms.abbreviation,genres,genres.name,genres.slug,first_release_date; where id = \" + id + \";\"\r\n })\r\n .then(response => {\r\n console.log(response.data);\r\n\r\n res.render(\"game\", {\r\n data: response.data,\r\n cssSrc: \"css/styles.css\",\r\n jsGameFunc: \"js/games-functions.js\",\r\n jsGamesOrderMenu: \"js/games-order-menu.js\",\r\n jsSrc: \"js/index.js\"\r\n });\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n res.render(\"404\", {\r\n jsContactAbout: \"js/contact-about.js\",\r\n cssStyles: \"css/styles.css\",\r\n cssContactAbout404Responsive: \"css/contact-about-404-responsive.css\",\r\n cssContactAbout404: \"css/contact-about-404.css\"\r\n });\r\n });\r\n}", "function _handleRequestGameMeta(data) {\r\n\tconsole.log('REQUESTED GAME META:', data.toString().trim());\r\n\tstate = REQUEST_GAME_COSTS;\r\n\r\n\tauthServer.write('P\\tDR\\n');\r\n}", "function startFreeForAll(){\n\n hideMenu(function(){\n\n LoadingModule.show();\n\n var data = {};\n\n var success = function(response){\n\n LoadingModule.hide();\n\n game = new Game();\n game.setCards(JSON.parse(response.deck));\n userInfo = JSON.parse(response.user_level_info);\n\n game.preloadImages(function(){\n game.start();\n game.TopPanelModule.update(\"default\", userInfo, userInfo.gold);\n game.player.host.score += userInfo.score;\n });\n\n };\n\n postToServer(setting.ajaxFreeForAll, data, success);\n });\n }", "loadGame(gameState) {\n\t\tthis.gameState = gameState;\n\t}", "function requestScore(playerName, type, onload) {\r\n GM_xmlhttpRequest({\r\n method:'POST',\r\n url:'http://' + gameServer + '/index.php',\r\n data:\"view=highscore&highscoreType=\" + post[type] + \"&searchUser=\" + playerName,\r\n headers: {\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Content-type': 'application/x-www-form-urlencoded',\r\n 'Accept': 'application/atom+xml,application/xml,text/xml',\r\n 'Referer': 'http://' + gameServer + '/index.php'\r\n },\r\n onload:onload\r\n });\r\n}", "function newGame(){\n\n\tio.socket.post('/game',{userId: $('#user-id').val()},function(game){\n\n\t\t//This creates a new html structure inside which the game will be played. Create game div is defined in game.js.\n\t\tcreateGameDiv({id: game.id});\n\n\t\t//Join the room\n\t\tio.socket.post('/game/'+ game.id + '/users', {id: $('#user-id').val()});\n\t});\n}", "function loadData() {\n $.get(\"/api/games\")\n .done(function (data) {\n updateView(data)\n console.log(data);\n })\n .fail(function (jqXHR, textStatus) {\n showOutput(\"Failed: \" + textStatus);\n });\n }", "function loadData() {\n $.get(\"/api/games\")\n .done(function (data) {\n updateView(data)\n console.log(data);\n })\n .fail(function (jqXHR, textStatus) {\n showOutput(\"Failed: \" + textStatus);\n });\n }", "async start(game, data) {\n\t\tthis._lost = false;\n\t\tthis._lost_time = -1;\n\t}", "function LoadGame() {\n\t// Your code goes here for loading a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function load() {\n var d = new Date().getTime();\n var uuid = 'xxxxxx'.replace(/[x]/g, function(c) {\n var r = (d + Math.random()*16)%16 | 0;\n d = Math.floor(d/16);\n return (c=='x' ? r : (r&0x3|0x8)).toString(16);\n });\n var guest = \"Guest \" + uuid.toUpperCase();\n //$(\"#name\").val(guest);\n $(\"#name\").val(\"sjoeke\");\n\n //check if localstorage exists\n if(localStorage.getItem(\"sessionID\")){\n sessionID = localStorage.getItem(\"sessionID\");\n localStorage.removeItem(\"sessionID\")\n $(\"#gamePlays\").hide();\n $(\"#statusWindow\").show();\n $(\"#gameClientWrapperSetup\").hide();\n $(\"#gameClientWrapperGame\").show();\n unPauzeGame();\n }\n}", "function preload() {\n theWorld = new OverheadWorld(worldParameters);\n thePlayer = new Player(100, 100, theWorld);\n // theGame = new Game1(theWorld, thePlayer);\n}", "function init () {\n // Get url parameters.\n var game;\n if (getURLParameter(\"sub\") != null) {\n\tvar domain = window.location.protocol + \"//\" + window.location.host;\n\tif (getURLParameter(\"nbr\") != null)\n\t game = domain + \"/?cmd=lliuraments&sub=\" + getURLParameter(\"sub\") + \"&nbr=\" + getURLParameter(\"nbr\") + \"&download=partida\";\n\telse\n\t game = domain + \"/?cmd=partida&sub=\" + getURLParameter(\"sub\") + \"&download=partida\";\n }\n else game = getURLParameter(\"game\");\n\n if (game == null || game == \"\") {\n\t// Ask the user for a game input.\n\tvar inputdiv = document.getElementById('inputdiv')\n\tinputdiv.style.display = \"\";\n\tdocument.getElementById('file').addEventListener('change', function(evt) {\n\t //http://www.html5rocks.com/en/tutorials/file/dndfiles/\n\t var file = evt.target.files[0];\n\t var reader = new FileReader();\n\t reader.readAsText(file);\n\t reader.onloadend = function(evt) {\n\t\tif (evt.target.readyState != FileReader.DONE) alert(\"Error accessing file.\");\n\t\telse { // DONE == 2.\n\t\t inputdiv.style.display = \"none\";\n\t\t document.getElementById(\"loadingdiv\").style.display = \"\";\n\t\t initGame(reader.result);\n\t\t}\n\t };\n\t}, false);\n }\n else {\n\tdocument.getElementById(\"loadingdiv\").style.display = \"\";\n\t// Load the given game.\n\tloadFile(game, initGame);\n }\n}", "function loadGame(){\n myGameArea.start();\n}", "async myGames (data = {}) {\n return await this.request('get', '/my-games', data, {games: ensureArray})\n }", "function startSuc(event){\n var req = event.target;\n if ((req.readyState === 4) && (req.status === 200)) {\n gameState.side = JSON.parse(req.response)['side'];\n if (gameState.side == 'x') {\n gameState.enemy = 'o';\n } else {\n gameState.enemy = 'x';\n }\n gameState.won = false;\n document.querySelector('.newGame').textContent = 'Сдаться';\n draw_field();\n document.querySelector(\".startGame\").style.display = \"none\";\n document.querySelector(\".mainGame\").style.display = \"block\";\n if (gameState.side === 'x'){\n document.querySelector('.field').addEventListener('click',turn);\n } else {\n listen();\n }\n } else if (req.readyState === 4) {\n document.querySelector('.createGame').disabled = false;\n if (req.status === 410) {\n document.querySelector('.status-message').textContent = 'Ошибка старта игры: другой игрок не ответил';\n } else {\n document.querySelector('.status-message').textContent = 'Неизвестная ошибка старта игры';\n }\n }\n}", "async function requestGameState() {\n await fetch(`/api/game/state/${roomId}`).then(res => res.json());\n}", "async createGame ({ request, auth, response }) {\n // get currently authenticated user\n const user = auth.current.user\n // get user data from createGame form\n const gameData = request.only(['date', 'time', 'venue', 'duration', 'price', 'max_num', 'need_equip'])\n this.formatObj(gameData, user.level, user.id)\n try {\n // Save game to database\n const newGame = await Game.create(gameData)\n await user.games().attach([newGame.id])\n return response.json({\n status: 'success',\n message: 'Jogo criado!',\n data: newGame\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'Tivemos um problema. Por favor tente novamente.'\n })\n }\n }", "function loadGame() {\n try {\n var retrievedObject = localStorage.getItem('battleshipGameInstance');\n\n console.log('retrievedObject: ', JSON.parse(retrievedObject));\n var json = JSON.parse(retrievedObject);\n\n game = new Battleship(8, 8);\n if (json != null) {\n game.loadJSON(json);\n }\n\n } catch (e) {\n console.log(e);\n }\n}", "async function addGame(req, res, next)\n{\n try\n {\n var username = req.params[\"username\"];\n\n if (req.session.username.valueOf() != username.valueOf())\n {\n throw 'You do not have permission to modify this user.';\n }\n\n await usersdb.auth(req.session.username, req.session.password);\n\n var game_name = req.body.game_name;\n await usersdb.addGameToUser(game_name, username);\n\n res.redirect(req.body.source_url);\n }\n catch (err)\n {\n var string = encodeURIComponent(err);\n res.redirect(req.body.source_url + '?err=' + err);\n }\n}", "function startGame () {\n // check to see if everything has been loaded\n let everythingLoaded = true;\n Object.keys(loading).forEach(function (key) {\n if (!loading[key]) everythingLoaded = false;\n });\n\n // only join the Oasis and start ticking/rendering if all game data has been loaded\n if (everythingLoaded) {\n // THE WHOLE GAME HAS LOADED\n joinGame();\n\n // start game loop\n startGameLoop(tick, render, 60);\n }\n}", "function on_load()\n{\n\tgame.start();\n}", "static LoadGame(that, name){\n\t\t\n\t\t//load data using async\n\t\t_retrieveData = async () => {\n\t\t\ttry {\n\t\t\t\tconst value = await AsyncStorage.getItem(name);\n\t\t\t\tif (value != null) {\n\t\t\t\t\t\n\t\t\t\t\t//first we parse the json object into a temporary LevelFile form\n\t\t\t\t\tthis.levelFile = JSON.parse(value);\n\t\t\t\t\t//now we parse the screen data and set it to our current screen\n\t\t\t\t\tthat.state.toShowText = this.jsonParser(this.levelFile.screenState);\n\t\t\t\t\t//finally we parse the game data and use the file's provided function name to set it to the proper game data object \n\t\t\t\t\tvar fileGameData = this.jsonParser(this.levelFile.data);\n\t\t\t\t\tvar evalString = \"GameData\"+\".\"+this.levelFile.loadFunction+\"(fileGameData)\";\n\t\t\t\t\teval(evalString);\n\t\t\t\t\t\n\t\t\t\t\t//now we replace this.levelFile with a new empty level file\n\t\t\t\t\tthis.levelFile = new this.FileManagerIndex[this.levelFile.nameSpace+\"File\"]();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (error) {\n\t\t\t\t// Error retrieving data\n\t\t\t\talert(error);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn _retrieveData();\n\t}", "loadGame(gameState) {\n this.gameState = gameState;\n }", "function displayGame(req, res, game){\n\n var release = getReleaseDate(game.release_date);\n var banner = getBanner(game.screenshots);\n var rating = getRating(game.rating);\n\n return res.render('game', {\n title: game.display_name,\n layout: 'primary',\n file: 'game',\n user : req.user,\n game: game,\n release: release,\n banner: banner,\n rating: rating,\n oneUpped: helper.hasOneUpped(game.one_ups, req.user)\n });\n}", "getGameData () {\n let siteIdIndex = window.location.search('games/');\n let gameId = window.location.slice(siteIdIndex + 6);\n fetch(API_URL.games + `/${gameId}`, {\n headers: {\n 'Authorization': `Bearer ${this.props.authToken}`\n }\n })\n .then(res=> res.json())\n .then(data=> {\n this.props.dispatch(loadGameState(data));\n })\n .catch(err=> {\n console.log(JSON.stringify(err));\n //display in status component, don't redirect\n //this.props.dispatch(updateGameStatusError(err))\n })\n }", "function loadMap(player) {\n\n io.sockets.sockets[player.sessionID].emit('loadMap', player.params);\n}", "function startGameReady() {\n\t\tvar webAPI8 = new globals.xml.startGameReady({gameID:gameID});\n\t}", "function reloadGame(skipBoard) {\n $.get(\"/games/\"+gameId, function( game, status ) {\n window.game = game;\n console.log( \"Game (status \"+status+\"):\", game);\n // --- 1: action button\n switch(game.state) {\n case \"preparing\":\n if(game.ownerId == userId) {\n // owner\n setAction(\"Start\", \"start_game\");\n } else if(userId != null) {\n if(game.players[userId] == null) {\n // not part of the game yet\n setAction(\"Join\", \"player_join\");\n } else {\n // part of the game\n setAction(\"Leave\", \"player_leave\");\n }\n } else {\n // anonymous\n setAction(\"Signin\", null);\n }\n break;\n case \"playing\":\n if(userId != null && game.players[userId] != null) {\n var selIdx = game.queue.indexOf(userId);\n if(selIdx == 0) {\n // currently queue\n setAction(\"Cancel\", \"cancel_trio\");\n } else if(selIdx > 0) {\n // in the selection queue\n $( \"#action\" ).text(\"Wait\").off(\"click\");\n } else if(game.players[userId] != null) {\n // looking for trio\n setAction(\"Trio!\", \"declare_trio\");\n }\n } else {\n // anonymous or not part of game\n setAction(\"Wait\", null);\n }\n\n break;\n case \"over\":\n if(game.ownerId == userId) {\n // owner\n setAction(\"Again\", \"restart_game\");\n } else if(userId != null) {\n setAction(\"Wait\", null);\n } else {\n // anonymous\n setAction(\"Signin\", null);\n }\n break;\n }\n\n // --- 2: players and scores\n var $scores = $(\"#scores .players\");\n $scores.empty();\n var maxScore = -1000;\n for(var playerId in game.players) {\n maxScore = Math.max(maxScore, game.scores[playerId] | 0);\n }\n for(var playerId in game.players) {\n var points = game.scores[playerId] | 0;\n var row = document.createElement(\"tr\");\n row.id = \"player_\"+playerId;\n var status = document.createElement(\"td\");\n status.className = \"status\";\n var selIdx = game.queue.indexOf(playerId);\n if(game.state == \"over\") {\n // mark winners\n if(points == maxScore) {\n row.className = \"winner\";\n }\n } else {\n if(selIdx == 0) {\n // currently selecting\n row.className = \"selecting\";\n } else if(selIdx > 0) {\n // in the selection queue\n row.className = \"waiting\";\n var rank = document.createElement(\"span\");\n rank.className = \"rank\";\n rank.innerText = selIdx;\n row.appendChild(rank);\n }\n }\n\n var name = document.createElement(\"td\");\n name.className = \"player\";\n name.innerText = game.players[playerId].name;\n var score = document.createElement(\"td\");\n score.className = \"score\";\n score.innerText = points;\n row.appendChild(status);\n row.appendChild(name);\n row.appendChild(score);\n $scores.append(row);\n }\n\n sortPlayersByScore();\n\n // --- 3: board\n if(!skipBoard) {\n var board = document.getElementById(\"board\");\n $(board).empty();\n for (var i = 0; i < game.board.length; i++) {\n var card = game.board[i];\n if (card != null) {\n board.appendChild(createCard(i, card.value));\n }\n }\n }\n\n // --- 4: deck\n $(\"#deck\").text(game.cardsLeft);\n });\n}", "function loadPage(url) {\n\tvar jsurl=\"js/\"+url+\".js\";\n\t/*\n\tif(eGameName=='the_frog_flies'){if(gameSettings==0){\n\t$.getScript(\"js/phaser230.js\", function(){\n\tconsole.log('phaser laoded');\n\t});\n\t}}\n\t*/\n\t\n\tvar hurl=url+\".html\";\n\tif(!topic){\n\t\tif(url!=\"topics\"){\n\t\t\talert(\"Please choose a topic first\");\n\t\t\treturn;\n\t}\n\t}\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange=function(){\n if(xmlhttp.readyState === 4){\n if (xmlhttp.status === 200) {\n\t\t\t\t$( \"#game\" ).empty();\n document.getElementById('game').innerHTML = xmlhttp.responseText;\n\t\t\t\tconsole.log('html loaded');\n\t\t\t\t\n\t\t\t\t$.getScript(jsurl, function(){\n console.log(\"ajax javascript loaded, gameSettings=\"+gameSettings);\n\tif(gameSettings==0){\n\t\t\t\t\tconsole.log('gameSettings=0');\n\t\t\t\t\twindow[url]();\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log('gameSettings!=0');\n\t\t\t\t\tsettings_page_games();\n\t\t\t\t}\n\t\n\t});\n\t\t\t\t\n\t\t\t\t\n\n //post load\n\t\t\t\t//if game, overlay\n\t\t\t\tif(topic){$(\"#currentTopic\").text(topic)}\n\t\t\t\t//close button on infoButton\n\t\t\t\t$(\"#close\").on(\"touchstart\",function(){\n$(this).css({\"color\":\"#000\",\"background\":\"#fff\"}); }).on(\"touchend\",function(){\n$(this).css({\"color\":\"#444\",\"background\":\"#aaa\"});\n$(\"#pageInfoFX\").css(\"display\",\"none\")});\n\n\t\t\t\t\n }\n else {\n document.getElementById('game').innerHTML = \"Error loading page \" + url;\n }\n }\n };\n xmlhttp.open(\"GET\", hurl , true);\n xmlhttp.send();\n}", "async function createOrJoinGame() {\n // get deck name from input\n const gameName = document.getElementById('deckNameInput').value;\n\n // make API call to server to either continue an existing game or create a new game\n const gameData = await fetch(`/game/${gameName}/getOrCreate`);\n\n // get JSON body of API response\n game = await gameData.json();\n\n // hide the login details, show the game details\n document.getElementById('login-wrapper').classList.add('hidden');\n document.getElementById('game-wrapper').classList.remove('hidden');\n\n // begin the game\n initGame();\n}", "function start_game() {\n $.ajax({\n url : '/api/game/startGame',\n type : 'POST',\n dataType: 'json',\n contentType : \"application/json\",\n success : function(data) {\n }\n });\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "loadGame() {\n this.props.loadGame(this.props.selectedGame);\n }", "afterGameLoaded(game) {\n this.updateQueryParams(game);\n }", "async function addGame(req, res, next)\n{\n try\n {\n await usersdb.auth(req.session.username, req.session.password);\n\n var game_name = req.body.game_name;\n var playlist_id = yt.playlistUrlToId(req.body.playlist_url);\n\n await gamesdb.create(game_name, playlist_id);\n\n if (req.body.addtouser == 'on')\n {\n await usersdb.addGameToUser(game_name, req.session.username);\n }\n\n res.redirect(req.body.source_url);\n }\n catch (err)\n {\n var string = encodeURIComponent(err);\n res.redirect(req.body.source_url + '?err=' + err);\n }\n}", "function changeGameHandler (req) {\n // Verify all requests.\n const payload = verifyAndDecode(req.headers.authorization);\n const { channel_id: channelId, opaque_user_id: opaqueUserId } = payload;\n\n const botState = Voter.getState();\n currentGame = req.headers.game;\n if(currentGame == \"GuessingGame\")\n {\n Gus.clearGuessers();\n Gus.clearAnswers();\n Gus.setPublic();\n }\n else\n AcaBot.setGuessing(false);\n\n attemptStateBroadcast(channelId);\n return {\n isVoting: botState.isVoting,\n votes: botState.votes,\n options: botState.options,\n finalWord: botState.finalWord,\n currentGame: currentGame\n }\n}", "function initGame(whatMethod,val){\n\t//data is gameId\n\tajaxCall(\"GET\",{method:whatMethod,a:\"game\",data:val},callbackStart);\n}", "function loadGameStateChangeStarter() {\n store.dispatch( {\n type: GAME_LOAD,\n payload: {\n savedData: savedData\n }\n });\n }", "highscoreLoad(data){\n if(data.level === 1){\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = () => {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n this.dataParseScore(xhttp.responseText);\n }\n };\n xhttp.open(\"GET\", \"http://bbrouwer6.acue.webpages.avans.nl/game/php/getPlayer/\", true);\n xhttp.send();\n }\n }", "function load_game(){\n $.ajax({\n type: \"POST\",\n url: \"backend/load.php\",\n data: {\n },\n dataType: \"text\",\n success: function (d) {\n console.log(\"Game Loaded Successfully\")\n console.log(d)\n var result = $.parseJSON(d);\n board = result[0];\n activeBlock = result[1];\n activeBlock.shapeMatrix = GenerateShape((activeBlock.shapeMatrix - 1) * 10);\n activeBlock.rotation = activeBlock[\"rotation\"]\n for (var i = 0; i < activeBlock.rotation; i++){\n Rotate(-1);\n }\n EraseOldActiveBlockPosition();\n nextBlock[\"shapeMatrixNum\"] = result[2];\n nextBlock.shapeMatrix = GenerateShape((nextBlock.shapeMatrixNum - 1) * 10);\n var other_vars = result[3];\n boardHeight = other_vars[\"boardHeight\"];\n boardWidth = other_vars[\"boardWidth\"];\n changePowerups = other_vars[\"changePowerups\"];\n level = other_vars[\"level\"];\n player_name = other_vars[\"player_name\"];\n score = other_vars[\"score\"];\n\n $('#NewGame').click();\n },\n error: function (error) {\n console.log(\"Error in ajax call for get_high_scores\")\n console.log(error)\n }\n });\n}", "function startGame() {\n axios\n .post(`${baseurl}/startGame`)\n .then((response) => {\n if ([204, 201, 200].includes(response.status)) {\n game.gameStarted = true;\n game.music.play();\n game.playerName = response.data.name;\n }\n })\n .catch((error) => {\n console.error(error);\n });\n}", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "async load () {}", "function getGamesAjax(req, res) {\n\n var stream = storeGet(null, req.params.database, function(err, result) {\n\n if (err) {\n res.send(err);\n }\n\n else {\n stream.pipe(oppressor(req)).pipe(res);\n }\n });\n\n}", "async function load() {\n await Datas.Settings.read();\n await Datas.Systems.read();\n //RPM.gameStack.pushTitleScreen();\n //RPM.datasGame.loaded = true;\n Manager.GL.initialize();\n Manager.GL.resize();\n Manager.Stack.requestPaintHUD = true;\n}", "function requestGame() {\r\n var numPlayers = $(\"#numPlayers\").val();\r\n var privy = $(\"#private\").is(\":checked\");\r\n var numDecks = $(\"#numDecks\").val;\r\n var startingSize = $(\"#startingSize\").val();\r\n var password;\r\n\r\n if (privy) {\r\n password = $(\"#gamePW\").val();\r\n if (password === \"\") {\r\n $(\"#hostError\").html(\"Please enter a game password.\");\r\n return;\r\n } \r\n }\r\n\r\n // Request a game.\r\n window.socket.emit(\"requestGame\", \r\n { \r\n numPlayers: numPlayers,\r\n private: privy,\r\n password: password,\r\n username: window.username,\r\n numDecks: numDecks,\r\n startingSize: startingSize\r\n }\r\n );\r\n\r\n}", "function handleRequest(req, res) {\r\n\t\r\n\t\r\n\t\r\n\tvar urlObj = url.parse(req.url, true);\r\n\tvar filename = ROOT+urlObj.pathname;\r\n\t\r\n\t//this if statement is used whenever a user refreshes the page, and new user is created by sending a post request to the server\r\n\t\r\n\tif(urlObj.pathname === \"/memory/intro\"){\r\n\t\tvar body = '';\r\n\t\t\r\n\t\treq.on('data', function (data) {\r\n\t\t\tbody += data;\r\n\t\t\t//totalGameCounter++;\r\n\t\t});\r\n\t\t\r\n\t\r\n\t\treq.on('end', function() {\r\n\t\t\tvar tempUser = body.substring(5, body.indexOf(\"&\"));\r\n\t\t\t//console.log(\"tempUser is \", tempUser);\r\n\t\t\tvar levelOfDifficulty = parseInt(body.substring(body.indexOf(\"&\")+7, body.length));\r\n\t\t\thardnessLevel = levelOfDifficulty*2 + 2;\r\n\t\t\t//console.log(\"hardness level is\",hardnessLevel);\r\n\t\t\t//console.log(\"Hardness level is \", hardnessLevel);\r\n\t\t\t//console.log(\"Level of difficulty is \", levelOfDifficulty);\r\n\t\t\tclient = board.makeBoard(hardnessLevel);\r\n\t\t\t//console.log(client);\r\n\t\t\tusers[tempUser] = client;\r\n\t\t});\r\n\t\t\r\n\t\trespond(200, JSON.stringify(users)); \r\n\t\t/*a response is sent back to the client with the users stored in the array for the key, and the value being the randomly generated array\r\n\t\t*/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t}\r\n\t//this if statement is used when a client request is received, it will return the necessary information for the gameboard logic\r\n\telse if(urlObj.pathname === \"/memory/card\") {\r\n\t\t\r\n\t\t//These variables parse the information sent from the client and store the values\r\n\t\tvar temporary = users[urlObj.query.username];\r\n\t\tvar selectedRow = urlObj.query.rowchoice;\r\n\t\tvar selectedColumn = urlObj.query.columnchoice;\r\n\t\t\r\n\t\t//Response sends back the answer of the selected tile, and sends back the row tester and column tester, along with the index ranging from 0 to 15, for the client to process information\r\n\t\tvar response = {answer: temporary[selectedRow][selectedColumn], rowTester: parseInt(selectedRow), columnTester: parseInt(selectedColumn), indexer: parseInt(urlObj.query.index), difficultyT: hardnessLevel};\r\n\t\trespond(200, JSON.stringify(response));\r\n\r\n\t}\r\n\t//this if statement is executed just to get the hardness level when running the display function\r\n\telse if(urlObj.pathname === \"/memory/level\"){\r\n\t\tvar response = {difficulty: hardnessLevel};\r\n\t\trespond(200, JSON.stringify(response));\r\n\t}\r\n\telse {\r\n\t\t\r\n\t\t//this part of the server will serve the index html as soon as the page is requested asynchronously \r\n\t\tfs.stat(filename, function(err, stats) {\r\n\t\t\tif(err){\r\n\t\t\t\trespondErr(err);\r\n\t\t\t}else{\r\n\t\t\t\tif(stats.isDirectory()) filename+= \"/index.html\";\r\n\t\t\t\tfs.readFile(filename,\"utf8\",function(err, data){\r\n\t\t\t\t\tif(err)respondErr(err);\r\n\t\t\t\t\telse respond(200,data);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//if an error is found the 404.html page is brought up\r\n\t\tfunction serve404(){\r\n\t\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){\r\n\t\t\t\tif(err)respond(500,err.message);\r\n\t\t\t\telse respond(404,data);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\t//if an error is found on the server, the server responds with the appropriate error message\r\n\t\tfunction respondErr(err){\r\n\t\t\tconsole.log(\"Handling error: \",err);\r\n\t\t\tif(err.code===\"ENOENT\"){\r\n\t\t\t\tserve404();\r\n\t\t\t}else{\r\n\t\t\t\trespond(500,err.message);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\r\n\t}\r\n\t\r\n\t\r\n\t//function that is called with the status code of the server being passed through along with the data necessary for the client\r\n\tfunction respond(code, data){\r\n\t\tres.writeHead(code, {'content-type': mime.lookup(filename)|| 'text/html'});\r\n\t\tres.end(data);\r\n\t}\r\n\r\n}", "function prepareGame(gameId) {\n var sock = this;\n //console.log(\"All Players Present. Preparing game...\");\n io.sockets.in(gameId).emit('beginNewGame', game);\n}", "function saveGame(slot){\n if (myGame === undefined){\n document.getElementById(\"info\").innerHTML = \"No hi ha cap partida carregada\";\n }\n var aux = [];\n\n for(i = 0; i < 10; i++){\n for(j = 0; j < 10; j++){\n aux.push(mapa10x10[i][j]);\n }\n }\n for(i = 0; i < aux.length; i++){\n myGame.map[myGame.lvl][i] = aux[i];\n }\n var data = JSON.stringify(myGame);\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200){\n document.getElementById(\"info\").innerHTML = \"Partida guardada\";\n } else if (this.readyState == 4 && this.status == 404){\n document.getElementById(\"info\").innerHTML = \"Ja tens una partida guardada en aquest slot\";\n } else {\n }\n };\n xhttp.open(\"POST\", \"http://puigpedros.salleurl.edu/pwi/pac4/partida.php?token=f5b68174-1750-4b18-811c-775891a23d29&slot=\" + slot, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(\"json=\" + data);\n}", "function poll() {\n $.ajax({\n method: \"GET\",\n url: \"/gs/\" + (gameID).toString()\n }).done((gs) => {\n loaded = window.performance.now();\n parseGameState(gs);\n turnResolve();\n })\n }", "function startGame() {\n // Implement following commented code for uniform random selection of target files\n d = Math.floor(Math.random() * 4);\n if (d == 0) {\n fileName = \"tgt_files/KimEtAl2019Rep_hit_20200917_2.json\";\n grp = 'h_CCW';\n } else if (d == 1) {\n fileName = \"tgt_files/KimEtAl2019Rep_straddle_20200917_2.json\"; \n grp = 's_CCW';\n } else if (d == 2) {\n fileName = \"tgt_files/KimEtAl2019Rep_hitCW_20200917_2.json\";\n grp = 'h_CW'; \n } else {\n fileName = \"tgt_files/KimEtAl2019Rep_straddleCW_20200917_2.json\";\n grp = 's_CW';\n }\n\n // Implement following commented code to select a single target file\n //fileName = \"tgt_files/KimEtAl2019Rep_hitCW.json\"\n\n subject.tgt_file = fileName;\n subjTrials.group_type = grp; // **TODO** update group_type to manage the groups\n $.getJSON(fileName, function(json){\n target_file_data = json;\n gameSetup(target_file_data);\n });\n}", "function load() {\r\n\t\tvar loaded = $.parseJSON(localStorage.getItem(STORAGE_NAME)),\r\n\t\t\tcondition = loaded.condition;\r\n\t\tSIZE = loaded.size;\r\n\t\tTOTALCELLS = SIZE*SIZE;\r\n\t\tMINES = loaded.minecells.length;\r\n\t\tcells = loaded.cells;\r\n\t\tminecells = loaded.minecells;\r\n\t\ttime = loaded.time;\r\n\t\tclicks = loaded.clicks;\r\n\t\tnewGame(true, loaded.board, condition);\r\n\t}", "function loadGame() {\n\ttry {\n\t\tvar gameArray = [];\n\t\t\n\n\t\tfor (var i = 0; i < gameList.length; i++) {\n\t\t\tif (gameList[i].Notification == 1) {\n\n\t\t\t\t//Ti.API.info('gameIcons', \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\");\n\n\t\t\t\tgameArray.push({\n\t\t\t\t\ttemplate : \"gameListTemplate\",\n\n\t\t\t\t\tgameNameLabel : {\n\t\t\t\t\t\ttext : gameList[i].CTestName\n\t\t\t\t\t},\n\t\t\t\t\ticonImage : {\n\t\t\t\t\t\timage : \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\"\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t$.lstSection.setItems(gameArray);\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"welcomeContentScreen\", \"loadGame\", ex);\n\t}\n}", "function new_game(player_1,player_2){\n\t$.ajax({\n\t type: \"GET\",\n\t url: server+\"/newgame/\"+player_1+\"/\"+player_2,\n\t async:false,\n\t crossDomain:true,\n\t success: function(response){\n\t \tgame = response.game;\n\t \tboard(Number(game));\n },\n error: function(){\n \t$(\"#error\").html(\"<p>Something went wrong. Try again</p>\");\n \tclearmessage();\n }\n\t});\n}", "function load() {\n\n\t// Get the current offset for the request and then update the offset \n\toffset = current_offset;\n\tcurrent_offset += limit;\n\t// Create a request object that is pointed towards the /channels path\n\tconst request = new XMLHttpRequest();\n\trequest.open('POST', '/channels');\n\n\t// Run this code when the data comes back from the server\n\trequest.onload = () => {\n\t\tconst data = JSON.parse(request.responseText); // Parse the incoming data\n\t\tdata.forEach(add_channel);\n\t};\n\n\t// Create a new form and append our offset and limit values\n\tconst data = new FormData();\n\tdata.append('offset', offset);\n\tdata.append('limit', limit);\n\n\t// send request\n\trequest.send(data);\n}", "function playerCreateNewGame(data) {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n game.gameId = thisGameId;\n game.mySocketId = this.id;\n game.players[this.id] = {\n gameId: thisGameId,\n mySocketId: this.id,\n playerName: data.playerName,\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n game.players[1] = {\n gameId: thisGameId,\n mySocketId: 1,\n playerName: 'Test Bot',\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n this.emit('newGameCreated', game);\n //console.log(thisGameId+\" # \"+this.id);\n\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n //console.log(gameSocket.adapter.rooms);\n}", "function play() {\n scene.update_all();\n\n // if (player_entity.collision_box.y > 1000) {\n // var score = {\n // userId: \"Annie\",\n // val: player_entity.collision_box.x\n // }\n // var req = new XMLHttpRequest();\n // req.open(\"POST\", \"http://localhost:8080/\", true);\n // req.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n // req.send(JSON.stringify(score));\n // }\n}", "function loadGameScreen(data){\r\n\t\t\t$('#container1').hide(); \r\n\t\t\t\t$('body').css(\"background-color\", \"white\");\r\n\t\t\t\t$('#boxes').show();\r\n\t\t\t\tmessage.autosize();\r\n\t\t\t\t// if current letters is a non-empty string, hide start game div & display letters\r\n\t\t\t\tif(data.game.state === 'active'){\r\n\t\t\t\t\t// if current letters, then game has started so hide the startgame\r\n\t\t\t\t\tstartGameDiv.hide();\r\n\t\t\t\t\thints.masonry('reload');\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$introText.html(data.game.message);\r\n\t\t\t\t\t// game has not yet started\r\n\t\t\t\t\tsendHintDiv.hide();\r\n\t\t\t}\r\n\t\t}", "sendStartPacket(p) {\n this.activeGames.push(p.gameId);\n console.log(\"Game started: \", this.activeGames);\n var packet = {\n authKey: \"\",\n nickname: \"\",\n locationX: 12500,\n locationY: 12500,\n isBotEnabled: false,\n sosActive: false,\n score: 10,\n foodAvailable: false,\n eatMeActive: false,\n lagActive: false,\n serverIP: p.serverIP,\n port: p.port,\n kills: 0,\n finalScore: false,\n gameStart: true,\n gameId: p.gameId,\n boost: this.rainBoost\n };\n this.sendAll(packet);\n this.latestGameStart = packet;\n if (this.shouldSentStartRequestOnGameStart) {\n this.updateRainBotStatus();\n }\n }", "async start(game, data) {\n\t\tthis._won = false;\n\t\tthis._won_time = -1;\n\t}", "function getGamesRequest() {\n\n //show_preloader();\n\n $.ajax({\n\n url : '/getGames',\n\n type: 'GET',\n\n cache: false,\n\n dataType : 'json',\n\n error : function(xmlhttprequest, textstatus, message) {\n\n //hide_preloader();\n\n $('#note').text('Something went wrong on the server!');\n\n },\n\n success : function(games) {\n\n //hide_preloader();\n\n if(games) {\n\n var len = games.length,\n col = $('#col3'),\n curr_sel = col.find('.selected a').attr('data-id');\n\n col.find('div').not('.title').remove();\n\n for(var i=0; i<len; i++) {\n\n var dots = games[i].name.length > 10 ? '...' : '';\n\n var row = $('<div>').appendTo(col).append($('<a>').addClass('g').text('(' + games[i].size_x + 'x' + games[i].size_y + ') ' + games[i].name.substring(0, 10) + dots).attr({ 'data-id': games[i].id, 'data-creator': games[i].creator_id, 'title': games[i].name }));\n\n if(curr_sel != 'undefined' && curr_sel == games[i].id) { row.addClass('selected'); }\n\n row.click(function(game) {\n\n return function(e) {\n\n e.preventDefault();\n\n //select the current element and enable the join game button\n if(!$(this).hasClass('selected')) {\n\n col.find('.selected').removeClass('selected');\n $(this).addClass('selected');\n if(isLoggedIn()) { enableJoinGameBtn(); }\n\n }\n\n updateStats(game);\n\n };\n\n }(games[i]));\n\n if(all_users[games[i].creator_id]) { row.addClass('logged'); }\n\n }\n\n }\n\n\n }\n\n });\n\n }" ]
[ "0.6211857", "0.6126062", "0.5934646", "0.5840731", "0.5799337", "0.5746652", "0.5663466", "0.56548005", "0.5628111", "0.55975467", "0.55939734", "0.5577671", "0.5568673", "0.55614096", "0.5516825", "0.5513034", "0.54994535", "0.5479766", "0.5471277", "0.5460641", "0.54582477", "0.5457776", "0.5452582", "0.54346484", "0.54275507", "0.5424014", "0.542118", "0.54211044", "0.54102427", "0.54082394", "0.54009646", "0.5396142", "0.5389203", "0.5379396", "0.5375813", "0.5375809", "0.5371113", "0.5367259", "0.5360248", "0.53539747", "0.5348173", "0.5332036", "0.53224033", "0.53147936", "0.53124726", "0.53124726", "0.5301558", "0.5298821", "0.5294317", "0.52870524", "0.52817297", "0.5275204", "0.5269982", "0.52622473", "0.5255898", "0.52531093", "0.52526367", "0.5247509", "0.5239822", "0.52397615", "0.52394617", "0.5236645", "0.5235165", "0.5222579", "0.522237", "0.52125955", "0.52102137", "0.5206066", "0.5201732", "0.519822", "0.51946187", "0.5191065", "0.5187476", "0.5184482", "0.5180585", "0.5180177", "0.5169855", "0.5169515", "0.51507676", "0.51485854", "0.5140066", "0.5125327", "0.51199085", "0.51190686", "0.5117967", "0.5112674", "0.5111057", "0.51109916", "0.51060265", "0.5105322", "0.51001453", "0.5088921", "0.50846386", "0.5080263", "0.50785404", "0.5076395", "0.50736856", "0.50659275", "0.5061122", "0.50608045" ]
0.6873634
0
cache parsed config object
function config () { if (cache) { return cache; } var path = process.cwd() + '/config.json' , content; //load and merge object content = fs.readFileSync(path, 'utf-8'); try { cache = JSON.parse(content); log.info('config file ' + path + ' loaded.'); } catch(e) { log.error('could not parse config file: ' + path); throw e; } return cache; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseConfig (json, cacheKey) {\n var configMap = json.data.configMap;\n var processed = preProcessJson(configMap);\n cache[cacheKey] = processed;\n return processed;\n }", "function getConfig() {\n if (Date.now() - lastCache > 10000) {\n cachedConfig = JSON.parse(fs.readFileSync(\"config.json\"))\n lastCache = Date.now()\n }\n\n return cachedConfig\n}", "function config() {\n if (cachedConfig == null) {\n const configFile = configs.filter(exists)[0].replace(\"~\", os.homedir());\n const tempConfig = JSON.parse(\n fs.readFileSync(configFile, { encoding: \"utf8\" })\n );\n\n cachedConfig = {\n home: tempConfig.home.replace(\"~\", os.homedir()),\n config: tempConfig.config.replace(\"~\", os.homedir()),\n };\n }\n\n return cachedConfig;\n}", "getConfig () {}", "function load_config(){\n S.config = K.config.fetch();\n return S.config;\n }", "function readConfig () {\n let data = JSON.parse(fs.readFileSync(CONFIG_FN, 'utf8'))\n ;['exchanges', 'server', 'cache'].forEach((group) => {\n if (!data[group]) {\n return\n }\n for (let key in data[group]) {\n // consider any lines starting with '#' as comments\n if (!key.startsWith('#')) {\n config[group][key] = data[group][key]\n }\n }\n })\n}", "get_config_data() {\n return {}\n }", "async function init_config() {\n var regex = {\n param: /^\\s*([\\w\\.\\-\\_]+)\\s*=\\s*(.*?)\\s*$/,\n comment: /^\\s*;.*$/\n };\n var local = {\n urltime: 60,\n softrefresh: 86400,\n zoom: 1,\n init_page_delay: 0.5, // how many seconds does this page take to finish \"loading\"\n };\n await readInterface.on('line', function(line) {\n var match = line.match(regex.param);\n if (match) {\n if (match[1] == 'time') {\n local['urltime'] = parseInt(match[2]);\n } else if (match[1] == 'softrefresh') {\n local['softrefresh'] = parseInt(match[2]);\n } else if (match[1] == 'restart') {\n restart = parseInt(match[2]) * 1000;\n } else if (match[1] == 'zoom') {\n local['zoom'] = parseFloat(match[2]);\n } else if (match[1] == 'init_page_delay') {\n local['init_page_delay'] = parseFloat(match[2]);\n } else if (match[1] == 'url') {\n local['url'] = match[2];\n config.push(local);\n local = JSON.parse(JSON.stringify(local)); // clone the object\n } else if (match[1] == 'form_name') { // not supported\n local['form_name'] = match[2];\n } else if (match[1] == 'form_user') { // not supported\n local['form_user'] = match[2];\n } else if (match[1] == 'form_user_field') { // not supported\n local['form_user_field'] = match[2];\n } else if (match[1] == 'form_pass_field') { // not supported\n local['form_pass_field'] = match[2];\n } else if (match[1] == 'form_pass_file') { // not supported\n local['form_pass_file'] = match[2];\n } else if (match[1] == 'form_pass') { // not supported\n local['form_pass'] = match[2];\n };\n };\n }).on('close', function() {;\n console.log('Finished loading configs:',config);\n })\n}", "loadSettings(){\n let result = {};\n // check if config file exists\n if(jetpack.exists('settings.ini')){\n try{\n // load settings.ini\n let settings = jetpack.read('settings.ini');\n // split settings string\n const pairs = settings.split('\\n');\n pairs.forEach((pair) => {\n if(!pair.startsWith('#')){\n pair = pair.trim();\n // check if pair is empty\n if(pair.length > 0){\n // split key value pair\n let keyValue = pair.split('=');\n\n // parse key value pair\n if(keyValue[0]==='USER-AGENT'){\n // parse user agent settings\n switch(keyValue[1]){\n case '/':\n result['Generic']=true;\n result['Special']=false;\n break;\n default:\n result['Generic']=false;\n result['Special']=true;\n result['custom_ua']=keyValue[1];\n break;\n }\n }else if(keyValue[0]==='HEADER'){\n // parse header settings\n switch(keyValue[1]){\n case '0':\n result['DNT']=true;\n result['GPC']=false;\n break;\n case '1':\n result['DNT']=false;\n result['GPC']=true;\n break;\n default:\n console.error('unknown header value!');\n return;\n }\n }else if(keyValue[0]==='MODE'){\n // parse mode settings\n switch(keyValue[1]){\n case '0':\n result['Breadth']=true;\n result['Single']=false;\n break;\n case '1':\n result['Breadth']=false;\n result['Single']=true;\n break;\n default:\n console.error('unknown mode value!');\n return;\n }\n }else{\n console.error('unknown key for settings!');\n }\n }\n }\n });\n SmartCrawler.setSettings(result);\n }catch(err){\n console.error(err);\n }\n }\n }", "configure(config) {\n this._interval = config.getAsLongWithDefault(\"options.interval\", this._interval);\n this._maxCacheSize = config.getAsIntegerWithDefault(\"options.max_cache_size\", this._maxCacheSize);\n this._source = config.getAsStringWithDefault(\"source\", this._source);\n }", "read() {\n this.exists()\n if (!this.validate()) {\n }\n const config = JSON.parse(fs.readFileSync(this.configPath))\n return config\n }", "static parseConfig() {\n\t\tlet globalConfig;\n\t\tlet localConfig;\n\t\tlet mergedConfig;\n\t\tconst globalPath = path.join(userHome, '.jimrc.js');\n\t\tif (fs.existsSync(globalPath)) {\n\t\t\tglobalConfig = require(globalPath);\n\t\t} else {\n\t\t\tfs.copyFileSync(\n\t\t\t\tpath.join(__dirname, 'boilerplate', 'jimrc.example.js'),\n\t\t\t\tglobalPath\n\t\t\t);\n\t\t\tglobalConfig = require(globalPath);\n\t\t}\n\t\tconst localPath = path.join(process.cwd(), '.jimrc.js');\n\t\tif (fs.existsSync(localPath)) {\n\t\t\tlocalConfig = require(localPath);\n\t\t}\n\t\tif (globalConfig) {\n\t\t\tmergedConfig = merge.recursive(globalConfig, localConfig);\n\t\t} else {\n\t\t\tmergedConfig = localConfig;\n\t\t}\n\n\t\treturn mergedConfig;\n\t}", "fromFilename(filename) {\n var _a;\n if (filename === \"inline\") {\n return null;\n }\n if (this.cache.has(filename)) {\n return (_a = this.cache.get(filename)) !== null && _a !== void 0 ? _a : null;\n }\n let found = false;\n let current = path__default[\"default\"].resolve(path__default[\"default\"].dirname(filename));\n let config = this.empty();\n // eslint-disable-next-line no-constant-condition\n while (true) {\n /* search configuration files in current directory */\n for (const configFile of findConfigurationFiles(current)) {\n const local = this.loadFromFile(configFile);\n found = true;\n config = local.merge(config);\n }\n /* stop if a configuration with \"root\" is set to true */\n if (config.isRootFound()) {\n break;\n }\n /* get the parent directory */\n const child = current;\n current = path__default[\"default\"].dirname(current);\n /* stop if this is the root directory */\n if (current === child) {\n break;\n }\n }\n /* no config was found by loader, return null and let caller decide what to do */\n if (!found) {\n this.cache.set(filename, null);\n return null;\n }\n this.cache.set(filename, config);\n return config;\n }", "function ConfigurationReader() {\n\t\"use strict\";\n\n\tvar myCfg = null;\n\tvar myIsValid = false;\n\tvar timer = null;\n\tvar myUrl = null;\n\tvar loadTime = new Date().getTime();\n\n\tthis.Read = function( url, doAutomaticPageReloads )\n\t{\n\t\tmyUrl = url;\n\n\t\tvar jqxhr = $.ajax(\n\t\t\t{\n\t\t\t\tcache: false,\n\t\t\t\tdataType: \"json\",\n\t\t\t\turl: url,\n\t\t\t\tasync: false,\n\t\t\t\terror: OnError,\n\t\t\t\tsuccess: OnSuccess\n\t\t\t}\n\t\t );\n\n\t\tif( typeof doAutomaticPageReloads !== 'undefined' && doAutomaticPageReloads ) {\n\t\t\ttimer = setInterval( CheckConfig, this.GetNum( \"configurationCheck\", \"interval\", 300 ) * 1000 ); // Interval is specified in seconds.\n\t\t}\n\n\t\treturn myIsValid;\n\t}\n\t\n\tthis.IsValid = function()\n\t{\n\t\treturn myIsValid;\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tthis.GetString = function( objectName, parameterName, defaultValue )\n\t{\n\t\tvar res = defaultValue;\n\n\t\tif( myCfg ) {\n\t\t\tif( myCfg.hasOwnProperty( objectName ) ) {\n\t\t\t\tvar obj = myCfg[objectName];\n\t\t\t\tif( obj.hasOwnProperty( parameterName ) ) {\n\t\t\t\t\tres = myCfg[objectName][parameterName];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log( \"Parameter name \" + parameterName + \" does not exist in object \" + objectName );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log( \"Object \" + objectName + \" does not exist in data\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tthis.GetNum = function( objectName, parameterName, defaultValue )\n\t{\n\t\tvar res = this.GetString( objectName, parameterName, \"\" );\n\n\t\tvar returnVal = defaultValue;\n\n\t\t// Compare with conversion of types\n\t\tif( res != \"\" ) {\n\t\t\treturnVal = Number( res );\n\t\t}\n\n\t\treturn returnVal;\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t// Gets an JSON object from the specified path.\n\t// If provided, reads data from the json object, otherwise from the\n\t// Read()'d configuration file.\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tthis.GetPath = function( path, json )\n\t{\n\t\tvar obj = null;\n\n\t\tif( json ) {\n\t\t\t// Read from the provided JSON object\n\t\t\tobj = json\n\t\t}\n\t\telse {\n\t\t\t// Read from our own config\n\t\t\tobj = myCfg;\n\t\t}\n\n\t\tvar parts = path.split('.');\n\t\t\n\t\tif( parts && obj ) {\n\t\t\tfor( var i = 0; obj != null && i < parts.length; ++i ) {\n\t \t\t\tobj = obj[parts[i]];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconsole.log( \"Invalid arguments\" );\n\t\t}\n\t\t\n \treturn obj;\n\t}\n\t\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tthis.GetConfig = function()\n\t{\n\t\treturn myCfg;\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tvar OnError = function( jqXHR, textStatus, errorThrown )\n\t{\n\t\tconsole.log( \"Failed to retrieve configuration: \" + errorThrown );\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tvar OnSuccess = function( data, textStatus, jqXHR )\n\t{\n\t\tmyCfg = data;\n\t\tmyIsValid = true;\n\t}\n\n\t///////////////////////////////////////////////////////////////////////////////////\n\t//\n\t//\n\t///////////////////////////////////////////////////////////////////////////////////\n\tvar CheckConfig = function()\n\t{\n\t\t $.ajax( myUrl,\n\t\t \t{\n \t\ttype : 'HEAD',\n \t\tsuccess : function( response, status, xhr) {\n\t \tvar lastModified = new Date(xhr.getResponseHeader('Last-Modified')).getTime();\n \t\tif( lastModified > loadTime ) {\n \t\t\tconsole.log( \"Configuration updated, reloading page.\" );\n\t\t\t\t\t\twindow.location.reload( true );\n \t\t}\n \t\t}\n \t\t}\n \t);\n\t}\n}", "_loadConfiguration() {\n storage.get(this.storageFile, (err, data) => {\n if (err) {\n debug('error loading', err);\n throw err;\n }\n\n // merge config data\n Object.assign(this.config, data)\n debug('Configuration loaded', this.config)\n\n // emit event when data is loaded\n this.emit('initialized')\n });\n }", "get config() { return this._config; }", "function ReturnConfig() {\n return config;\n}", "function configObj (lines) {\n var array = lines.split('|');\n \n for(var i=0; i< array.length -1; i++) {\n\n\tvar line = array[i];\n\t\n\tvar stuff = line.split(/=/);\n\t\n\tvar prop = stuff[0];\n\t\n\tthis[prop] = stuff[1]; \n\t\n\t\t\n }\n \n}", "readConfigFile()\n\t{\n\t let file_path = join(this.rootDir, CONFIGS_FILENAME);\n\t\t//Recuperer le contenu du fichier\n\t let file_content = readFileSync(file_path, 'utf8');\n\t //Parser le JSON\n\t\tconfigs = JSON.parse(file_content);\n\t\t//Ajouter les elements n'existant pas avec une valeur par defaut\n\t\tconfigs.showStartup\t= typeof(configs.showStartup) === 'undefined' ? false : configs.showStartup;\n\t\tconfigs.showOutput\t= typeof(configs.showOutput) === 'undefined' ? false : configs.showOutput;\n\t\tconfigs.showError\t= typeof(configs.showError) === 'undefined' ? true : configs.showError;\n\t\tconfigs.javaBin\t\t= typeof(configs.javaBin) === 'undefined' ? 'java' : configs.javaBin;\n\t\tconfigs.outputFilename\t= typeof(configs.outputFilename) === 'undefined' ? '$1.min.js' : configs.outputFilename;\n\t\t//Ajouter le slash de fin si necessaire\n\t\tconfigs.inputDir += configs.inputDir.slice(-1) !== '/' ? '/' : '';\n\t\tconfigs.outputDir += configs.outputDir.slice(-1) !== '/' ? '/' : '';\n\t\t//Retourner le tableau de configuration\n\t\treturn configs;\n\t}", "async load() {\n const configFromDB = await this.loadFromDB();\n const configFromEnvVars = this.loadFromEnvVars();\n\n // merge defaults per ns\n const mergedConfigFromDB = {\n crowi: Object.assign(this.configModel.getDefaultCrowiConfigsObject(), configFromDB.crowi),\n markdown: Object.assign(this.configModel.getDefaultMarkdownConfigsObject(), configFromDB.markdown),\n notification: Object.assign(this.configModel.getDefaultNotificationConfigsObject(), configFromDB.notification),\n };\n\n // In getConfig API, only null is used as a value to indicate that a config is not set.\n // So, if a value loaded from the database is emtpy,\n // it is converted to null because an empty string is used as the same meaning in the config model.\n // By this processing, whether a value is loaded from the database or from the environment variable,\n // only null indicates a config is not set.\n for (const namespace of Object.keys(mergedConfigFromDB)) {\n for (const key of Object.keys(mergedConfigFromDB[namespace])) {\n if (mergedConfigFromDB[namespace][key] === '') {\n mergedConfigFromDB[namespace][key] = null;\n }\n }\n }\n\n return {\n fromDB: mergedConfigFromDB,\n fromEnvVars: configFromEnvVars,\n };\n }", "function parseConfig() {\n var p = this.path + '/config/',\n files = framework.util.getFiles(p),\n mainPos = files.indexOf('main.js'),\n jsExt = framework.regex.jsFile,\n config = require(this.path + '/config/main.js');\n\n for (var file,key,cfg,i=0; i < files.length; i++) {\n if (i==mainPos) continue;\n file = files[i];\n key = file.replace(jsExt, '');\n cfg = require(this.path + '/config/' + file);\n if (typeof config[key] == 'object') _.extend(config[key], cfg); \n else config[key] = cfg;\n }\n\n return config;\n}", "load() {\n var data = fs.readFileSync(this.configPath, {\n encoding: 'utf-8'\n });\n this.config = ini.parse(data);\n }", "async load() {\r\n this._logger.info(\"===> AmazonStorageConfigProvider::load\");\r\n const networkEndpoint = new networkEndPoint_1.NetworkEndPoint(\"https\", `s3.${this._region}.amazonaws.com`, 443);\r\n const networkClient = networkClientFactory_1.NetworkClientFactory.instance().create(\"default\", networkEndpoint, this._logger);\r\n // Use a cache bust when we are doing admin\r\n const cacheBust = objectHelper_1.ObjectHelper.isEmpty(this._credentials) ? \"\" : `?cachebust=${Date.now()}`;\r\n let config;\r\n try {\r\n config = await networkClient.json(undefined, \"GET\", `${this._bucketName}/${this._configName}.json${cacheBust}`);\r\n }\r\n catch (exc) {\r\n let emptyConfig = false;\r\n if (objectHelper_1.ObjectHelper.isType(exc, networkError_1.NetworkError)) {\r\n emptyConfig = true;\r\n }\r\n if (!emptyConfig) {\r\n throw exc;\r\n }\r\n }\r\n this._logger.info(\"<=== AmazonStorageConfigProvider::load\", config);\r\n return config;\r\n }", "get config() {\n if (!this._config)\n this._config = new Configuration();\n return this._config;\n }", "static createConfig(config) {\r\n return config;\r\n }", "static createConfig(config) {\r\n return config;\r\n }", "getConfig() {\n if (config) {\n return config;\n }\n return false;\n }", "persistentConfig(config) {\n // If it's not an object, we discard the information\n if (!(config instanceof Object)) {\n return;\n }\n\n // We use lodash to perform a deep merge, instead of overwriting\n // root values with the spread operator\n this.persistentConfigObject = _.merge(this.persistentConfigObject, config);\n }", "function GM_configStruct() {\r\n // call init() if settings were passed to constructor\r\n if (arguments.length)\r\n GM_configInit(this, arguments);\r\n}", "function __loadConfig(){\n if($rootScope.config === void 0 || typeof $rootScope.config == 'undefined'){\n //@todo test if we can get config from localStorage\n $http({url:'config/parrametters.json', method:'GET'})\n .then(function successCallback(response) {\n $rootScope.config = response.data;\n $rootScope.$emit('configurationFileLoaded');\n });\n }\n }", "function parseConfig( config ) {\n return config.reduce( function ( acc, c, i ) {\n var addParse = function ( source, getParse ) {\n source += ' in config[' + i + ']'\n\n try {\n var parse = getParse()\n if ( !parse ) return true\n\n parse.$source = source\n acc.push( parse )\n\n return true\n }\n catch ( e ) {\n if ( !e.parseSource)\n e.parseSource = source\n\n throw e\n }\n }\n\n if ( parseObject( c, addParse ) ) return acc\n if ( parseDocumentArguments( c, addParse ) ) return acc\n if ( parseLiteralJson( c, addParse ) ) return acc\n if ( parseOption( c, addParse ) ) return acc\n if ( parseUrl( c, addParse ) ) return acc\n\n return acc\n }, [] )\n }", "function generateConfig(element) {\n var $el = $(element),\n data = $el.data(),\n config = {\n name: data[ns],\n $el: $el,\n opts: parseOptions(data),\n cid: _.uniqueId(ns + '-'),\n baseUrl: opts.baseUrl\n };\n\n return config;\n }", "function get_config(name) {\n\n var host_filename = __dirname + '/config/'+name+'.'+os.hostname()+'.cfg';\n var filename = __dirname + '/config/'+name+'.cfg';\n var data = undefined;\n if(fs.existsSync(host_filename)) {\n data = fs.readFileSync(host_filename);\n console.log(\"Reading config:\",host_filename);\n }\n else {\n data = fs.readFileSync(filename);\n console.log(\"Reading config:\",filename);\n }\n\n return eval('('+data.toString('utf-8')+')');\n}", "function getConfiguration()\n {\n var result = {};\n return $.extend(true, configuration, result);\n }", "function getConfiguration()\n {\n var result = {};\n return $.extend(true, configuration, result);\n }", "function getConfig() {\n // If the global config is not defined, load it from the file system.\n if (cachedConfig === null) {\n // The full path to the configuration file.\n var configPath = path.join(getRepoBaseDir(), CONFIG_FILE_PATH);\n // Read the configuration and validate it before caching it for the future.\n cachedConfig = validateCommonConfig(readConfigFile(configPath));\n }\n // Return a clone of the cached global config to ensure that a new instance of the config\n // is returned each time, preventing unexpected effects of modifications to the config object.\n return tslib.__assign({}, cachedConfig);\n}", "function get_config() {\n // This is a placeholder, obtaining values from command line options.\n // Subsequent developments may access a configuration file\n // and extract an initial default configuration from that.\n //\n // See also: https://nodejs.org/api/process.html#process_process_env\n if (program.debug) {\n meld.CONFIG.debug = program.debug;\n } \n if (program.verbose) {\n meld.CONFIG.verbose = program.verbose;\n } \n if (program.author) {\n meld.CONFIG.author = program.author;\n } \n if (program.baseurl) {\n meld.CONFIG.baseurl = program.baseurl;\n }\n if (program.stdinurl) {\n meld.CONFIG.stdinurl = program.stdinurl;\n }\n}", "get config() {\n return this.use().config;\n }", "async function currentConfig() {\n let config = Config.default();\n config.resolver = new Resolver(config);\n config.artifactor = new Artifactor();\n config.paths = await contractPaths(config);\n config.base_path = config.contracts_directory;\n return config;\n}", "function reloadConfig(){\r\n\treturn require(\"./config.json\");\r\n}", "function getConfigObject(config) {\n const homeDir = app.getPath('home')\n const qianDir = path.join(homeDir, '.qian')\n const qianFile = path.join(qianDir, 'profil.json')\n if (!fs.existsSync(qianDir)) {\n fs.mkdirSync(qianDir);\n }\n if (!fs.existsSync(qianFile)) {\n fs.writeFileSync(qianFile, JSON.stringify(config))\n return defaultConfig;\n }\n return JSON.parse(fs.readFileSync(qianFile))\n}", "getConfig(internal_name, item) {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let config = yield this._getBaseConfig(internal_name);\n if (item && item.id) {\n config.id = item.id;\n config.param.id = item.id;\n config.preferences = yield this._getPreferences(config.param);\n const settingComponent = config.setting.component;\n config = DeepMerge(config, item);\n config.setting.component = settingComponent ? settingComponent : null;\n }\n yield this.getResources(config);\n return resolve(config);\n }));\n }", "get_internal_config_data() {\n const d = {\n height: $(this.element).height(),\n sync: {\n mode: this._sync_mode,\n },\n filtering: {\n mode: this._filtering,\n },\n data: {\n data_id: this.data_id,\n data_source_name_hint: (this.data_source != null ? this.data_source.name : ''), // Helper to restore old dataset in the case of redundancy\n }\n }\n // TODO: timeline association, etc.\n\n if (this._last_update != null) {\n d.sync.first = this._last_update.first\n d.sync.last = this._last_update.last\n d.sync.units = this._last_update.units\n }\n\n return d\n }", "async function read_config_no_lock() {\n\n // Read tempalte file\n const template = await fs.promises.readFile('./config.template.json');\n const config = JSON.parse(template);\n\n // Override bot_token \n config.telegram.bot_token = base_config.token;\n\n // Read actual config\n try {\n const file = await fs.promises.readFile(base_config.file);\n mergeDeep(config, JSON.parse(file));\n }\n catch (error) {\n // This likely means that the config file does not exist.\n await log.log('notice', 'Cannot read config file. Writing template.', error);\n await save_config_no_lock(config);\n }\n\n // Queue restart if no bot_token is provided\n if (!config.telegram.bot_token) {\n console.warn('Config does not include a bot token! Please edit the config file to include the token at \"telegram.bot_token\" or set the \\\n environment variable \"BOT_TOKEN\". Restarting in 30 seconds.');\n setTimeout(() => {\n restart(base_config);\n }, 30_000);\n }\n\n return config;\n }", "loadLocalConfigFile() {\n let configData = {};\n try {\n configData = this.readFileSync(this.configFilePath);\n\n // validate based on config file version\n if (configData.version > 0) {\n configData = _main_Validator__WEBPACK_IMPORTED_MODULE_3__[\"validateV1ConfigData\"](configData);\n } else {\n configData = _main_Validator__WEBPACK_IMPORTED_MODULE_3__[\"validateV0ConfigData\"](configData);\n }\n if (!configData) {\n throw new Error('Provided configuration file does not validate, using defaults instead.');\n }\n } catch (e) {\n console.log('Failed to load configuration file from the filesystem. Using defaults.');\n configData = this.copy(this.defaultConfigData);\n\n // add default team to teams if one exists and there arent currently any teams\n if (!configData.teams.length && this.defaultConfigData.defaultTeam) {\n configData.teams.push(this.defaultConfigData.defaultTeam);\n }\n delete configData.defaultTeam;\n\n this.writeFileSync(this.configFilePath, configData);\n }\n return configData;\n }", "get config() {\n\t\treturn this._config;\n\t}", "prepareConfig(targetArch) {\n if (typeof this.configFetcher === 'function') {\n this.config = this.configFetcher(targetArch);\n } else {\n this.config = this.configFetcher;\n }\n }", "async getConfig() {\n let config = await this._loader.get()\n\n if ( !config ) {\n return {}\n }\n\n if ( typeof config === 'function' ) {\n config = config( {\n command: this._command.name || '',\n options: this._command.options || {},\n } )\n }\n\n const validators = this._validators\n\n if ( validators ) {\n const userConfig = config.config || {}\n\n for ( const key of Object.keys( validators ) ) {\n const [ error ] = validators[ key ].validate( userConfig[ key ] || {} )\n\n if ( error ) {\n console.log()\n logger.scope( key + ' validation' ).warn( error.message )\n console.log()\n exit( 0 )\n }\n }\n }\n\n return config || {}\n }", "getConfig() {\n return this.config;\n }", "async getCfgFromFile() {\n const obj = await utils.readJSONFromFile(this.cfgPath);\n return new CfgObject(obj);\n }", "function loadConfig() {\n\t/* Old version that loaded from a local file\n\tlet request = new XMLHttpRequest();\n\n\trequest.onreadystatechange = () => {\n\t if (request.readyState === 4) {\n\t\t\tif(request.status === 200) {\n\t \tconfig = JSON.parse(request.responseText);\n\t\t\t\tconfigReady = true;\n\t\t\t} else {\n\t\t\t\tconsole.log(`config.json could not be loaded. XMLHttpRequest status was ${request.status}`);\n\t\t\t}\n\t }\n\t};\n\n\trequest.onTimeout = () => {\n\t\tconfigReady = true;\n\t}\n\n\trequest.open('GET', chrome.runtime.getURL('config.json'));\n\trequest.send();\n\t*/\n\n\tchrome.storage.sync.getBytesInUse(Object.keys(config), amount => {\n\t\tif(amount !== 0) {\n\t\t\tchrome.storage.sync.get(cfg => {\n\t\t\t\tconfig = cfg; // et voila\n\t\t\t});\n\t\t}\n\t});\n}", "read() {\n try {\n const data = this.fileSystem.readFileSync(this.filePath);\n\n this.contents = data.toString();\n\n } catch (err) {\n if (err.code === 'ENOENT' && this.type === 'create-if-not-exists') {\n return this.config;\n } else {\n throw err;\n }\n }\n\n let program;\n\n try {\n program = esprima.parse(this.contents, {range: true});\n } catch (ex) {\n throw new Error(`could not read: ${this.filePath} because it has syntax errors: ${ex}`);\n }\n\n this.type = 'empty';\n if (program.type === 'Program') {\n program.body.forEach(statement => {\n\n if (statement.expression && statement.expression.type === 'CallExpression') {\n const call = statement.expression;\n\n if (call.callee.type === 'MemberExpression' && (call.callee.object.name === 'requirejs' || call.callee.object.name === 'require') && call.callee.property.name === 'config') {\n this.type = call.callee.object.name === 'require' ? 'require' : 'requirejs';\n this.readObjectExpression(call.arguments[0], noop);\n return false;\n }\n } else if(statement.type === 'VariableDeclaration') {\n statement.declarations.forEach(declarator => {\n if (declarator.id.name === 'require') {\n this.type = 'var';\n this.readObjectExpression(declarator.init, noop);\n return false;\n }\n });\n\n if (this.type === 'var') return false;\n }\n });\n }\n\n if (this.type === 'empty') {\n this.config = {};\n }\n\n return this.config;\n }", "loadConfig(config) {\n this.isClosable = config.isClosable;\n this.closeResult = config.closeResult;\n this.size = config.size;\n this.isFullScreen = config.isFullScreen;\n this.isBasic = config.isBasic;\n this.isInverted = config.isInverted;\n this.isCentered = config.isCentered;\n this.mustScroll = config.mustScroll;\n this.transition = config.transition;\n this.transitionDuration = config.transitionDuration;\n }", "get config() {\n return this._config;\n }", "function ParamedicConfig(json) {\n this._config = json;\n}", "function getConfig(srcpath) {\n try {\n return JSON.parse(fs.readFileSync(path.join(srcpath, 'config.json'), 'utf8'));\n } catch (e) {\n return { view: 'list' };\n }\n}", "loadConfig() {\n try {\n let configData = fs.readFileSync(this.dir + '/' + this.configFile);\n // this is the main yaml configuration\n this.config = yaml.safeLoad(configData.toString());\n if(this.config.base && this.config.base[0] != '/') {\n // if base is not fully qualified, add it to this.dir\n this.config.base = this.dir + '/' + this.config.base;\n }\n if(this.config.source && this.config.source[0] != '/') {\n this.config.source = this.dir + '/' + this.config.source;\n }\n } catch(e) {\n throw 'Error: objects file not found or is not valid YAML';\n }\n // If there are middlewares available, include them\n if(this.config.middleware) {\n for(let type in this.config.middleware) {\n for(let file of this.config.middleware[type]) {\n this.middleware(type, file.substr(0,2) == './' ? requireCWD(file.substr(2)) : require(file)); // for globals\n }\n }\n }\n }", "function createConfig (){\n var _interface = {\n // give access to the data\n data:config,\n path:path,\n conditionString: conditionString,\n // update it\n update: function (){\n if (config){\n var saveData = config.data || config;\n var data = JSON.stringify (saveData, null, 4);\n fs.writeFileSync (configPath, conditionString (data));\n }\n }\n };\n return _interface;\n}", "function Config() { }", "function Config() { }", "function parseConfig() {\n\t\t\tdata = value;\n\n\t\t\tconsole.log(\"data: \", data.grid.layers);\n\n\t\t\tvar grid = new db.Grid('.drawbit'),\n\t\t\t\talphabit,\n\t\t\t\tapp = new db.gui.App(),\n\t\t\t\ti = 0,\n\t\t\t\tj = 0,\n\t\t\t\ttiles,\n\t\t\t\tnumTiles = 0,\n\t\t\t\tnumLayers = data.grid.layers.length;\n\n\t\t\tfor ( ; i < numLayers; i++) {\n\t\t\t\tgrid.addLayer();\n\t\t\t\tapp.layers.add('layer_' + i);\n\t\t\t\ttiles = data.grid.layers[i].tiles;\n\t\t\t\tnumTiles = tiles.length;\n\n\t\t\t\tfor ( j = 0; j < numTiles; j++) {\n\t\t\t\t\tgrid.getLayer(db.Tools.layer).draw(tiles[j].x, tiles[j].y);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t\t\n\t\t}", "function loadConfig() {\n if (fs.existsSync(__dirname + \"/./config.js\")) {\n config = {};\n config = require(\"./config\");\n }\n\n return config;\n}", "function getConfig() {\n return config;\n }", "static get() {\n if (this._config) {\n return this._config;\n } else {\n return this.build();\n }\n }", "async function ParsedOptions() {\n\t\treturn await options()\n\t\t\t.then(\n\t\t\t\tasync options => {\n\t\t\t\t\tconfiguration = {};\n\n\t\t\t\t\tlet { running } = Update,\n\t\t\t\t\t\tallowed = await load(`has/${ running }`),\n\t\t\t\t\t\tpermiss = await load(`get/${ running }`);\n\n\t\t\t\t\t/* Don't expose the user's authentication information to sites */\n\t\t\t\t\tfor(let key in options)\n\t\t\t\t\t\tif(/username|password|token|api|server|url|storage|cache|proxy|client|builtin|plugin|qualit/i.test(key))\n\t\t\t\t\t\t\tif(allowed && RegExp(permiss.join('|'),'i').test(key))\n\t\t\t\t\t\t\t\tconfiguration[key] = options[key];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t/* Do nothing */;\n\t\t\t\t\t\t// else if(/(^cache-data|paths|qualities)/i.test(key))\n\t\t\t\t\t\t//\t /* Pre-parse JSON - make sure anything accessing the data handles objects too */\n\t\t\t\t\t\t//\t configuration[key] = JSON.parse(options[key] || null);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t/* Simple copy */\n\t\t\t\t\t\t\tconfiguration[key] = options[key];\n\n\t\t\t\t\tCOMPRESS = options.UseLZW;\n\n\t\t\t\t\tif(!(CAUGHT && CAUGHT.ALL_CAUGHT)) {\n\t\t\t\t\t\tCAUGHT = options.__caught;\n\t\t\t\t\t\tCAUGHT = JSON.parse(COMPRESS? iBWT(unzip(decompress(CAUGHT))): CAUGHT);\n\t\t\t\t\t\tCAUGHT.NO_CACHE = { ...CAUGHT };\n\n\t\t\t\t\t\tCAUGHT.has = (ids) => {\n\t\t\t\t\t\t\tfor(let id in ids)\n\t\t\t\t\t\t\t\tif(!!~CAUGHT[id].indexOf(ids[id]) || !!~CAUGHT.NO_CACHE[id].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tCAUGHT.bump = async(ids) => {\n\t\t\t\t\t\t\tbumping:\n\t\t\t\t\t\t\tfor(let id in ids) {\n\t\t\t\t\t\t\t\tlet ID = id.toLowerCase().slice(0, 4),\n\t\t\t\t\t\t\t\t\tMAX = (COMPRESS? 200: 100);\n\n\t\t\t\t\t\t\t\tif(!!~CAUGHT[ID].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\tcontinue bumping;\n\n\t\t\t\t\t\t\t\tif(CAUGHT[ID].length >= MAX)\n\t\t\t\t\t\t\t\t\tCAUGHT[ID].splice(0, 1 + (CAUGHT[ID].length - MAX));\n\n\t\t\t\t\t\t\t\tCAUGHT[ID].push(ids[id]);\n\t\t\t\t\t\t\t\tCAUGHT[ID].filter(v => typeof v == 'number'? v: null);\n\t\t\t\t\t\t\t\tCAUGHT[ID] = CAUGHT[ID].slice(0, MAX);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet __caught = JSON.stringify(CAUGHT);\n\n\t\t\t\t\t\t\t__caught = (COMPRESS? compress(zip(BWT(__caught))): __caught);\n\n\t\t\t\t\t\t\tawait UTILS_STORAGE.set({ __caught }, () => configuration.__caught = __caught);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tCAUGHT.charge = async(ids) => {\n\t\t\t\t\t\t\tcharging:\n\t\t\t\t\t\t\tfor(let id in ids) {\n\t\t\t\t\t\t\t\tlet ID = id.toLowerCase().slice(0, 4);\n\n\t\t\t\t\t\t\t\tif(!!~CAUGHT.NO_CACHE[ID].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\tcontinue charging;\n\n\t\t\t\t\t\t\t\tCAUGHT.NO_CACHE[ID].push(ids[id]);\n\t\t\t\t\t\t\t\tCAUGHT.NO_CACHE[ID].filter(v => typeof v == 'number'? v: null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif(options.UseLowCache) {\n\t\t\t\t\t\t /* Add IDs to CAUGHT without updating the cache */\n\t\t\t\t\t\t /* Movies/TV Shows */\n\t\t\t\t\t\t // Charge Ombi\n\t\t\t\t\t\t if(options.usingOmbi) {\n\t\t\t\t\t\t let url = options.ombiURL,\n\t\t\t\t\t\t\t\t\tapi = `apikey=${ options.ombiToken }`;\n\n\t\t\t\t\t\t fetch(`${ url }/api/v1/Request/movie?${ api }`)\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.theMovieDbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t fetch(`${ url }/api/v1/Request/tv?${ api }`)\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.theMovieDbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t /* Movies */\n\t\t\t\t\t\t // Charge Watcher\n\t\t\t\t\t\t if(options.usingWatcher) {\n\t\t\t\t\t\t let url = options.watcherURL,\n\t\t\t\t\t\t token = options.watcherToken,\n\t\t\t\t\t\t quality = options.watcherQualityProfileId || 'Default',\n\t\t\t\t\t\t username = options.watcherBasicAuthUsername,\n\t\t\t\t\t\t password = options.watcherBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/?apikey=${ token }&mode=liststatus&quality=${ quality }`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.movies.imdbid,\n\t\t\t\t\t\t tmdb: item.movies.tmdbid,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge Radarr\n\t\t\t\t\t\t if(options.usingRadarr) {\n\t\t\t\t\t\t let url = options.radarrURL,\n\t\t\t\t\t\t token = options.radarrToken,\n\t\t\t\t\t\t username = options.radarrBasicAuthUsername,\n\t\t\t\t\t\t password = options.radarrBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/movie`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.tmdbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge CouchPotato\n\t\t\t\t\t\t if(options.usingCouchPotato) {\n\t\t\t\t\t\t\t\tlet url = `${ options.couchpotatoURL }/media.list?type=movie&status=active`,\n\t\t\t\t\t\t\t\t\ttype = 'CHARGE_COUCHPOTATO',\n\t\t\t\t\t\t\t\t\tbasicAuth = options.couchpotatoBasicAuth,\n\t\t\t\t\t\t\t\t\tparseJSON = json => {\n\t\t\t\t\t\t\t\t\t\tif(json.error)\n\t\t\t\t\t\t\t\t\t\t\treturn (!json.silent && console.error('Error charging CouchPotato: ' + String(json.error), json));\n\n\t\t\t\t\t\t\t\t\t\tjson.movies.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t\t\t\t\t\t\timdb: item.info.imdb,\n\t\t\t\t\t\t tmdb: item.info.tmdb_id,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tsetTimeout(() =>\n\t\t\t\t\t\t\t\t\t\tchrome.runtime.sendMessage(\n\t\t\t\t\t\t\t\t\t\t\t{ type, url, basicAuth },\n\t\t\t\t\t\t\t\t\t\t\tresponse => parseJSON(response)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t, 10000);\n\t\t\t\t\t\t\t\t} catch(error) {\n\t\t\t\t\t\t\t\t\tawait fetch(url)\n\t\t\t\t\t\t\t\t\t\t.then(response => response.json())\n\t\t\t\t\t\t\t\t\t\t.then(json => parseJSON(json))\n\t\t\t\t\t\t\t\t\t\t.catch(error => { throw error });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t /* TV Shows */\n\t\t\t\t\t\t // Charge Sonarr\n\t\t\t\t\t\t if(options.usingSonarr) {\n\t\t\t\t\t\t let url = options.sonarrURL,\n\t\t\t\t\t\t token = options.sonarrToken,\n\t\t\t\t\t\t username = options.sonarrBasicAuthUsername,\n\t\t\t\t\t\t password = options.sonarrBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/series`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t tvdb: item.tvdbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge Medusa\n\t\t\t\t\t\t if(options.usingMedusa) {\n\t\t\t\t\t\t let url = options.medusaURL,\n\t\t\t\t\t\t token = options.medusaToken,\n\t\t\t\t\t\t username = options.medusaBasicAuthUsername,\n\t\t\t\t\t\t password = options.medusaBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/v2/series`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.id.imdb,\n\t\t\t\t\t\t tvdb: item.id.tvdb,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge SickBeard\n\t\t\t\t\t\t if(options.usingSickBeard) {\n\t\t\t\t\t\t let url = options.sickBeardURL,\n\t\t\t\t\t\t token = options.sickBeardToken,\n\t\t\t\t\t\t username = options.sickBeardBasicAuthUsername,\n\t\t\t\t\t\t password = options.sickBeardBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/${ token }/?cmd=shows`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t Object.values(json.data).map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t tvdb: item.id.tvdbid,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tCAUGHT.ALL_CAUGHT = true;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn __CONFIG__ = options;\n\t\t\t\t},\n\t\t\t\terror => {\n\t\t\t\t\tnew Notification(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\t'Fill in missing Web to Plex options',\n\t\t\t\t\t\t15000,\n\t\t\t\t\t\tOptions\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t);\n\t}", "function getConfig() {\n\tvar config = {};\n\t\n\t// Use current project's root folder as a starting point.\n\t// If no project is active, use current folder as a fallback:\n\tvar configpath = editorProjectPath || editorDirectoryPath;\n\t\n\t// Search for custom config file recursively up to the home folder:\n\tconfigpath = CSScomb.getCustomConfigPath(configpath + '/.csscomb.json');\n\t\n\ttry {\n\t\t// Try to load config file:\n\t\tconfig = require(configpath);\n\t} catch (error) {\n\t\t// If no config file is available, use default config:\n\t\tconfig = getDefaultConfig();\n\t}\n\t\n\tif (action == 'beautify') {\n\t\t// Remove sort order configuration:\n\t\tdelete config['sort-order'];\n\t}\n\t\n\tif (action == 'sort') {\n\t\t// Keep only sort order configuration:\n\t\tvar configSortOrder = config['sort-order'];\n\t\tconfig = {};\n\t\tconfig['sort-order'] = configSortOrder;\n\t}\n\n\t// Allow setting eof-newline option from command line\n\tif (eofNewline === false) {\n\t\tconfig['eof-newline'] = undefined;\n\t} else if (eofNewline === true) {\n\t\tconfig['eof-newline'] = true;\n\t}\n\t\n\treturn config;\n}", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\t\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t if (config._strict) {\n\t config._isValid = false;\n\t } else {\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\t\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\t\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\t\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\t\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\t\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "getNode(pathArr, configHash) {\n const tmp = {};\n\n for (let i = 0; i < pathArr.length; i++) {\n const key = pathArr[i].trim();\n if (configHash[key]) {\n tmp[key] = configHash[key];\n } else {\n return false;\n }\n }\n return tmp;\n }", "function configFromString(config) {\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"b\" /* isString */])(config._i)) {\n return config;\n }\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return config;\n }\n // todo: update logic processing\n // isISO -> configFromISO\n // isRFC -> configFromRFC\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n }\n else {\n return config;\n }\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n }\n else {\n return config;\n }\n // Final attempt, use Input Fallback\n // hooks.createFromInputFallback(config);\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__valid__[\"b\" /* createInvalid */])(config);\n}", "function configurationParser(input) {\n // remove empty lines from text\n let cleanText = input.replace(/^\\s*\\n/gm, '');\n // remove start and end empty lines\n cleanText = cleanText.replace(/^\\n|\\n\\s*$/g, '');\n // split each line of the instruction input\n let configlines = cleanText.split('\\n');\n // Retrieve lawn line in new array\n let lawnLine = configlines.shift();\n\n var lawn = lawnParser(lawnLine);\n var mowers = mowersParser(configlines);\n\n return {\n lawn: lawn,\n mowers: mowers,\n };\n}", "_generateParserConfig() {\n\t\treturn {\n\t\t\tdecodeEntities: true,\n\t\t\tignoreWhitespace: true,\n\t\t\tlowerCaseTags: true,\n\t\t\trecognizeSelfClosing: true,\n\t\t\tverbose: false\n\t\t};\n\t}", "getConfig() {\n return this.config;\n }", "getConfig() {\n return this.config;\n }", "loadConfig() {\n lumServer.config = require('../etc/config.json').lumServer || {};\n lumServer.config.serverName = lumServer.config.serverName || \"lum-server\";\n lumServer.config.port = (!isNaN(process.env.APPPORT) && Number(process.env.APPPORT))\n || lumServer.config.port || 2080;\n lumServer.config.maxTxRetryCount = lumServer.config.maxTxRetryCount || 20;\n lumServer.config.database = lumServer.config.database || {};\n lumServer.config.database.password = process.env.DATABASE_PASSWORD || lumServer.config.database.password;\n }", "getConfig() {\n return this._config;\n }", "config() {\n return this._config;\n }", "getConfigFor(filename, configOverride) {\n /* special case when the overridden configuration is marked as root, should\n * not try to load any more configuration files */\n const override = this.loadFromObject(configOverride || {});\n if (override.isRootFound()) {\n override.init();\n return override;\n }\n /* special case when the global configuration is marked as root, should not\n * try to load and more configuration files */\n if (this.globalConfig.isRootFound()) {\n const merged = this.globalConfig.merge(override);\n merged.init();\n return merged;\n }\n const config = this.fromFilename(filename);\n const merged = config ? config.merge(override) : this.globalConfig.merge(override);\n merged.init();\n return merged;\n }", "function Config(filename) {\n\n var self = this;\n\n this.filename = filename\n this.title = \"\"; // string\n this.nav_items = []; // list of string, filenames/nav-tab-titles\n this.nav_items_bname = []; // list of nav items with chosen blog index name\n this.theme = \"\"; // string theme-name or url\n this.header = \"\"; // string filename\n this.footer = \"\"; // string filename\n this.blog_items = []; // list of strings, filenames of posts\n this.requested_page = \"\"; // the client requested page based on url query\n this.post_active = false; // signal if a post is active, set by determineActivePage().\n this.ga_tracker_id = \"false\"; // Google Analytics Tracker ID\n this.disqus_shortname = \"false\"; // Disqus Site Shortname\n this.pagination = 0; // number of posts per page (0 means all posts on one)\n this.requested_blog_index_page = 1; // the URL query 'p='\n this.sitemap_active = false; // determine if the sitemap will be displayed\n\n this.parseFile = function (text) {\n\n /* Split the config file into options using the DOM. */\n var options = [];\n var converter = new showdown.Converter();\n var dummy = document.createElement('html');\n dummy.innerHTML = converter.makeHtml(text);\n code = dummy.getElementsByTagName('code');\n for( i=0; i<code.length;i++) {\n if (code[i].innerHTML.match(/^&gt;\\S+/)) {\n /* remove '>' and replace new-line/line-breaks with a space */\n options.push(code[i].innerHTML.replace(/^&gt;/, '').replace(/\\r?\\n|\\r/g,' ').trim());\n }\n }\n\n /* 1: title \n * 2: nav filenames\n * 3: theme name or url\n * 4: header filename\n * 5: footer filename\n * 6: blog filenames\n * 7: code highlighting\n * 8: google analytics\n * 9: disqus shortname\n * 10: pagination\n */\n self.title = options[0];\n self.nav_items = options[1].split(/\\s+/); // split on whitespace\n self.theme = self.resolveBootstrapThemeURL(options[2]);\n self.header = options[3];\n self.footer = options[4];\n self.blog_items = options[5].split(/\\s+/); // split on whitespace\n self.code_theme = self.resolvePrettifyThemeURL(options[6]);\n self.ga_tracker_id = options[7];\n self.disqus_shortname = options[8];\n self.pagination = options[9];\n\n /* replace BLOG with blog name */\n self.nav_items_bname = self.nav_items.slice(); // copy\n var blog_index = self.nav_items_bname.indexOf(gs_blog_keyword);\n self.nav_items_bname[blog_index] = self.blog_items[0];\n\n self.determineActivePage();\n\n }; // - parseFile()\n\n this.headerIsActive = function() {\n return self.header != 'false';\n };\n\n this.footerIsActive = function() {\n return self.footer != 'false';\n };\n\n this.gaIsActive = function() {\n return self.ga_tracker_id != 'false';\n };\n\n this.disqusIsActive = function() {\n return self.disqus_shortname != 'false';\n };\n\n this.determineActivePage = function() {\n /* This function verifies whether the url query resolves to an existing\n * page. If not, the landing page is selected. If there is both a\n * requested page and post, the page takes precedence. */\n\n /* check if the sitemap is requested */\n self.sitemap_active = (self.getURLParameter('sitemap') == 'true');\n\n /* check for requested posts */\n var post_found = 0;\n var post_index = -1;\n var req_post = self.getURLParameter('post');\n if (! (req_post == 'null' || req_post == null)) {\n post_index = self.blog_items.indexOf(req_post);\n if (post_index > 0) { /* skip the post-index-page title (elem 0) */\n post_found = 1;\n }\n }\n\n /* pages take precedence */\n var page_found = 0;\n var page_index = -1;\n var reqPage = self.getURLParameter('page');\n if (! (reqPage == 'null' || reqPage == null)) {\n page_index = self.nav_items_bname.indexOf(reqPage);\n if (page_index >= 0) {\n page_found = 1;\n }\n\n /* if pagination is required then get the requested params */\n if (self.paginationIsActive()) {\n /* save any pagination query and check bounds */\n self.requested_blog_index_page = parseInt(self.getURLParameter('p'));\n if (!Number.isInteger(self.requested_blog_index_page)) {\n self.requested_blog_index_page = 1;\n }\n if (self.requested_blog_index_page < 1) {\n self.requested_blog_index_page = 1;\n }\n }\n }\n\n /* select page */\n active_page = self.nav_items_bname[0]; /* default landing page */\n if (post_found) {\n active_page = self.blog_items[post_index];\n self.post_active = true;\n }\n if (page_found) {\n active_page = self.nav_items_bname[page_index];\n self.post_active = false;\n }\n\n self.requested_page = active_page;\n };\n\n this.numBlogIndexPages = function() {\n return Math.ceil((self.blog_items.length-1) / self.pagination);\n };\n\n /* Parse the query string for 'name'. */\n this.getURLParameter = function(name) {\n return decodeURI((RegExp(name + '=' +\n '(.+?)(&|$)').exec(location.search)||[,null])[1]);\n };\n\n /* Return true if the user choose to blog, else false. */\n this.isBlog = function() {\n return (self.nav_items.indexOf(gs_blog_keyword) >= 0);\n };\n\n /* Return true if the blog index was requested */\n this.blogIndexIsActive = function() {\n if (self.isBlog()) {\n if (self.requested_page == self.blog_items[0]) {\n return true;\n }\n }\n return false;\n };\n\n this.paginationIsActive = function() {\n return ((self.pagination > 0) && (self.pagination <\n (self.blog_items.length - 1))); // count the index page\n };\n\n this.postIsActive = function() {\n return self.post_active;\n };\n\n this.sitemapIsActive = function() {\n return self.sitemap_active;\n };\n\n this.valid_url = function(url) {\n return /^(http|https|ftp):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$/i.test(url);\n };\n\n this.resolvePrettifyThemeURL = function(theme) {\n\n /* determine where the theme is from */\n var who = 'jmblog';\n switch(theme) {\n case 'desert':\n case 'doxy':\n case 'sons-of-obsidian':\n case 'sunburst':\n who = 'google';\n break;\n }\n\n /* check for theme name or url */\n var direct_url = theme;\n var name_url = '';\n if (who == 'google') {\n name_url = 'https://cdn.rawgit.com/google/code-prettify/9c3730f40994018a8ca9b786b088826b60d7b54a/styles/' + theme + '.css';\n } else {\n name_url = 'https://cdn.rawgit.com/jmblog/color-themes-for-google-code-prettify/be5aa6fee61ad73f5a34ffb65099c8d1b3917602/dist/themes/' + theme + '.min.css';\n }\n\n /* check if this looks like a url */\n var theme_url = '';\n\n /* see if the user specifies the full url */\n if (self.valid_url(direct_url)) {\n theme_url = direct_url;\n }\n /* see if the user specified a bootswatch name */\n else if (self.valid_url(name_url)) {\n theme_url = name_url;\n }else{\n theme_url = gs_googleprettify_css_url;\n }\n\n return theme_url;\n };\n\n this.resolveBootstrapThemeURL = function(theme) {\n /* check for theme name or url */\n var direct_url = theme;\n var name_url = 'https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/' +\n theme + '/bootstrap.min.css';\n\n /* check if this looks like a url */\n var theme_url = '';\n\n /* see if the user specifies the full url */\n if (self.valid_url(direct_url)) {\n theme_url = direct_url;\n }\n /* see if the user specified a bootswatch name */\n else if (self.valid_url(name_url)) {\n theme_url = name_url;\n } else {\n theme_url = gs_default_theme_url;\n }\n\n return theme_url;\n };\n\n /* Initialize with Config data. This is the first required step for setting\n * up the website. -It is therefore required to be synchronous. */\n getFile(self.filename, self.parseFile, false);\n\n}", "async LoadConfig() {\n let thisNsHost = this;\n thisNsHost.rawConfig = await thisNsHost.GetRunningConfig();\n thisNsHost.parsedConfig = thisNsHost.ParseConfigText(thisNsHost.rawConfig);\n thisNsHost.versionInfo = await thisNsHost.ShowVersion();\n }", "function computeConfig() {\n return new Promise(function(resolve, reject){\n config.blogPath = __dirname +'\\\\' + config.blogPath;\n resolve();\n });\n}", "function config(opts = process.env, _prefix = 'fuel_v1_', noresolution = false) {\n const network = opts.network || opts[_prefix + 'network'];\n const resolve = key => noresolution\n ? opts[key]\n : (opts[_prefix + network + '_' + key] || opts[_prefix + 'default_' + key]);\n\n // local provider\n const provider = opts.provider || ethers.getDefaultProvider(network, {\n infura: resolve('infura'),\n });\n\n // return config object\n return {\n archive: true,\n rootLengthTarget: opts.rootLengthTarget,\n produce: opts.produce,\n minimumTransactionsPerRoot: opts.minimumTransactionsPerRoot || 0,\n emit: () => {}, // emmitter for new outputs\n console: console,\n continue: opts.continue,\n network: utils.getNetwork(network),\n gasPrice: () => Promise.resolve('0x12a05f2000'), // 80 gwei\n gas_limit: 4000000, // default gas limit\n confirmations: 0, // required block confirmations\n block_time: 0, // 13 * 1000,\n db: database(copy(memdown(), memdown())),\n contract: opts.contract || {}, // new ethers.Contract(opts.contract || v1[network], abi.Fuel, provider), // selected Fuel contract object\n provider, // provider object\n operators: opts.operators || [], // 0 is main operator, the rest are for root deployment\n };\n}", "processConfig(config) {\n if (typeof config === 'function') {\n return {\n template : config\n };\n }\n\n return config;\n }", "function getConfig() {\n // if you pass ?dev=true to your url address default config that will be used is `config-development`\n // otherwise - `config-production`\n var configName = getParameterByName('dev', false) ? 'env' : 'env';\n\n window._config || (window._config = {});\n\n // for production version you should concat your config with main script or put it above main script\n // inside global `_config` variable for example\n if (window._config[configName]) return window._config[configName];\n\n // for development version you can just make an ajax call to get the config\n $.ajax({\n url : '/static/' + configName + '.json',\n async : false,\n success : function(response) {\n window._config[configName] = response;\n }\n });\n return window._config[configName];\n}", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t if (config._strict) {\n\t config._isValid = false;\n\t } else {\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t if (config._strict) {\n\t config._isValid = false;\n\t } else {\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }\n\t }", "async function read_config() {\n return await lock.run(read_config_no_lock);\n }", "function configFromString(config) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"i\" /* isString */])(config._i)) {\n return config;\n }\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return config;\n }\n // todo: update logic processing\n // isISO -> configFromISO\n // isRFC -> configFromRFC\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n }\n else {\n return config;\n }\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n }\n else {\n return config;\n }\n // Final attempt, use Input Fallback\n // hooks.createFromInputFallback(config);\n return Object(__WEBPACK_IMPORTED_MODULE_4__valid__[\"a\" /* createInvalid */])(config);\n}", "ParseConfigText(rawConfig) {\n let thisNsHost = this;\n\n try {\n let nsHostConfig = {\n \"MgmtIP\": \"\",\n \"HANodes\": [],\n \"Servers\": {},\n \"Services\": {},\n \"vServers\": {},\n \"lbMonitors\": {},\n \"csActions\": {},\n \"csPolicies\": {}\n }; //thisProvider.configData[nsHost];\n let lineArray = rawConfig.split(/\\r?\\n/);\n for (let i = 0; i < lineArray.length; i++) {\n let lineData = lineArray[i];\n switch (true) {\n case /^add HA node (?:\\d+) (\\S+)/.test(lineData):\n //console.log(`NetScaler IP: ${RegExp.$1}`);\n nsHostConfig.HANodes.push(RegExp.$1);\n break;\n case /^set ns config -IPAddress (\\S+)/.test(lineData):\n //console.log(`NetScaler IP: ${RegExp.$1}`);\n nsHostConfig.MgmtIP = RegExp.$1;\n break;\n case /^add server (\\\"[^\\\"]*\\\"|\\S+) (\\S+)( .*)?/.test(lineData): {\n let serverAlias = RegExp.$1,\n serverIP = RegExp.$2,\n options = thisNsHost.ParseOptions(RegExp.$3);\n //console.log(`Server: ${serverAlias} -> ${serverIP} options [${options}]`);\n nsHostConfig[\"Servers\"][serverAlias] = {\n \"ipAddress\": serverIP,\n \"options\": options\n };\n break;\n }\n case /^add service (\\\"[^\\\"]*\\\"|\\S+) (\\S+) (\\S+) (\\S+)( .*)?/.test(lineData): {\n let serviceName = RegExp.$1,\n serverAlias = RegExp.$2,\n protocol = RegExp.$3,\n port = RegExp.$4,\n options = thisNsHost.ParseOptions(RegExp.$5);\n //console.log(`Service: ${serviceName} -> ${serverAlias} ${protocol}/${port} options [${options}]`);\n nsHostConfig[\"Services\"][serviceName] = new vService({\n \"name\": serviceName,\n \"server\": serverAlias,\n \"protocol\": protocol,\n \"port\": port,\n \"options\": options,\n \"bindings\": [],\n \"haPair\": thisNsHost.haPair\n });\n break;\n }\n case /^add (\\S+) vserver (\\\"[^\\\"]*\\\"|\\S+) (\\S+) (\\S+) (\\S+)( .*)?/.test(lineData): {\n let type = RegExp.$1,\n vServerName = RegExp.$2,\n protocol = RegExp.$3,\n vip = RegExp.$4,\n port = RegExp.$5,\n options = thisNsHost.ParseOptions(RegExp.$6);\n //console.log(`vServer: ${vServerName} -> ${vip} ${protocol}/${port} options [${options}]`);\n nsHostConfig[\"vServers\"][vServerName] = new vServer({\n \"name\": vServerName,\n \"vip\": vip,\n \"protocol\": protocol,\n \"port\": port,\n \"options\": options,\n \"bindings\": [],\n \"haPair\": thisNsHost.haPair,\n \"type\": type\n });\n break;\n }\n case /^bind (\\S+) vserver (\\\"[^\\\"]*\\\"|\\S+)(?: (\\\"[^\\\"]*\\\"|[^-]\\S+))?(?:( -.*)+)?/.test(lineData): {\n let vServerName = RegExp.$2,\n serviceName = RegExp.$3,\n options = thisNsHost.ParseOptions(RegExp.$4);\n //console.log(`vServerBind: ${vServerName} -> ${serviceName} options [${options}]`);\n if (serviceName) {\n nsHostConfig[\"vServers\"][vServerName][\"bindings\"].push(serviceName);\n } else {\n // Must be policy based; forwarding?\n }\n break;\n }\n case /^add lb monitor (\\\"[^\\\"]*\\\"|\\S+)(?: ([^-\\s]\\S+))?(?:( -.*)+)?/.test(lineData): {\n let monitorName = RegExp.$1,\n protocol = RegExp.$2,\n options = thisNsHost.ParseOptions(RegExp.$3);\n //console.log(`lbMonitor: ${monitorName} -> ${protocol} options [${options}]`);\n nsHostConfig[\"lbMonitors\"][monitorName] = {\n \"protocol\": protocol,\n \"options\": options,\n \"bindings\": []\n };\n break;\n }\n case /^add cs action (\"[^\\\\]+\")(?:( -.*)+)?/.test(lineData): {\n let actionName = RegExp.$1,\n options = thisNsHost.ParseOptions(RegExp.$2);\n //console.log(`lbMonitor: ${monitorName} -> ${protocol} options [${options}]`);\n nsHostConfig[\"csActions\"][actionName] = {\n \"options\": options\n };\n break;\n }\n case /^add cs policy (\\S+)(?:( -.*)+)?/.test(lineData): {\n let policyName = RegExp.$1,\n options = thisNsHost.ParseOptions(RegExp.$2);\n //console.log(`lbMonitor: ${monitorName} -> ${protocol} options [${options}]`);\n nsHostConfig[\"csPolicies\"][policyName] = {\n \"options\": options\n };\n break;\n }\n case /^/.test(lineData):\n break;\n default:\n }\n }\n return nsHostConfig;\n } catch (ex) {\n return ex;\n }\n }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "function configFromString(config) {\n\t var matched = aspNetJsonRegex.exec(config._i);\n\n\t if (matched !== null) {\n\t config._d = new Date(+matched[1]);\n\t return;\n\t }\n\n\t configFromISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t configFromRFC2822(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t } else {\n\t return;\n\t }\n\n\t // Final attempt, use Input Fallback\n\t hooks.createFromInputFallback(config);\n\t }", "get config() {\r\n return this._CONFIG;\r\n }", "cloneConfig(config) {\n\t\treturn Object.assign({}, config);\n\t}", "read () {\n\t\tObject.assign(this, this.status()\n\t\t\t.reduce(\n\t\t\t\t(config, file) => file.exists ?\n\t\t\t\t\tObject.assign(readJsonOrReturnObject(file.path), config) :\n\t\t\t\t\tconfig,\n\t\t\t\t{}));\n\t}", "getFullConfig() {\n return this.config;\n }", "static defaultConfig() {\n return new Config(defaultConfig);\n }", "configure(config) {\n this.name = config.getAsStringWithDefault(\"name\", this.name);\n this.description = config.getAsStringWithDefault(\"description\", this.description);\n this.properties = config.getSection(\"properties\");\n }" ]
[ "0.701395", "0.6928701", "0.67437273", "0.6413513", "0.63028", "0.61956316", "0.61699945", "0.608119", "0.599038", "0.59258044", "0.59253776", "0.5915819", "0.59088254", "0.5902001", "0.589082", "0.58899724", "0.587048", "0.5823641", "0.5818629", "0.5812218", "0.5798256", "0.5737098", "0.57352054", "0.57257587", "0.57214373", "0.57214373", "0.57132995", "0.566911", "0.56623244", "0.566177", "0.5658949", "0.56407994", "0.5620761", "0.56106645", "0.56106645", "0.5606927", "0.55922407", "0.5587442", "0.55793196", "0.5573038", "0.55645514", "0.5562313", "0.55455047", "0.5541584", "0.5530865", "0.5526012", "0.55210483", "0.551948", "0.551554", "0.55034065", "0.5496012", "0.54863864", "0.54698116", "0.5464736", "0.5462937", "0.54547286", "0.54474956", "0.5446227", "0.54447985", "0.54447985", "0.5439365", "0.5438087", "0.54335797", "0.5429979", "0.54272074", "0.5422086", "0.54215366", "0.5418602", "0.5418602", "0.5418602", "0.5418602", "0.54153913", "0.5413688", "0.54047436", "0.5402684", "0.5399802", "0.5399802", "0.5378438", "0.5376192", "0.5373077", "0.53583187", "0.5357931", "0.53579223", "0.5356598", "0.5356279", "0.5354749", "0.535048", "0.53470206", "0.53470206", "0.53452873", "0.53435946", "0.53345174", "0.53299606", "0.53299606", "0.5320492", "0.53195316", "0.5317885", "0.5315192", "0.5312767", "0.530765" ]
0.7593662
0
import ProjectCard5 from "../projectCard/projectCard5";
function Portfolio() { return ( <div> <Navbar /> <Hero backgroundImage="https://images.wallpaperscraft.com/image/cosmonaut_astronaut_space_suit_137404_3840x2160.jpg"> <h1>Rayna K. Williams</h1> <h2>Full Stack Web Developer</h2> </Hero> <div> <ProjectCard1 /> <ProjectCard2 /> <ProjectCard3 /> <ProjectCard4 /> {/* <ProjectCard5 /> */} </div> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProjectCard(props) {\n return (\n <Card className=\"project-card-view\">\n <Card.Header className=\"header\">{props.header}</Card.Header>\n <Card.Body >\n <Card.Img src={props.imgPath} className=\"image-card\" /> \n <Card.Title class=\"card-title\">{props.title}</Card.Title>\n <Card.Text className=\"text\" style={{ textAlign: \"justify\" }}>\n {props.description}\n </Card.Text>\n <Button className=\"button-class\" href={props.github}>Code</Button>\n <Button className=\"button-class\" href={props.application}>Application</Button>\n <Button className=\"button-class\">Demo</Button>\n </Card.Body>\n </Card>\n \n );\n}", "function CardProjectFive() {\n return (\n <Card className=\"bg-dark\" border=\"primary\" style={{ width: '28rem' }}>\n <div class=\"hovereffect\">\n <Card.Img src={projectFiveImage} alt=\"Card image\" style={{ width: 450, height: 250 }} />\n <div class=\"overlay\">\n <Card.ImgOverlay>\n <Card.Title>Team Generator</Card.Title>\n <Card.Subtitle>Individual Project</Card.Subtitle>\n <Card.Text>\n This command line application will prompt the user for information about the team manager and then information about the team members. When the user has completed building the team, the application will create an HTML file that displays a nicely formatted team roster based on the information provided by the user.\n </Card.Text>\n <Card.Text>Technology/Concepts: OOP, Axios, MySQL, Sequelize</Card.Text>\n <Card.Link href=\"https://github.com/azu20/Team-generator\">This app is deployed on your command line</Card.Link>\n <Card.Link href=\"https://github.com/azu20/Team-generator\">Github</Card.Link>\n </Card.ImgOverlay>\n </div>\n </div>\n </Card>\n );\n}", "function Projects(props) {\n return (\n <div className=\"projects\">\n <h1>Projects</h1>\n <ProjectCard \n ProjectName=\"Maa Bastralaya\"\n ProjectDescriptions=\"A Cloth Store. Build on Wordpress with WooCommerce and using RazorPay as payment gateway.\"\n ProjectUrl=\"https://maabastralaya.com/\"\n ProjectImage={shopping}\n />\n <ProjectCard \n ProjectName=\"GoGroceries\"\n ProjectDescriptions=\"A Grocery Delivery Website.\"\n ProjectUrl=\"\"\n ProjectImage={grocery}\n />\n <ProjectCard \n ProjectName=\"Sambalpuri Threads\"\n ProjectDescriptions=\"Logo and Banner Design.\"\n ProjectUrl=\"https://www.facebook.com/Sambalpuri-Threads-100319685426918\"\n ProjectImage={blog}\n />\n </div>\n )\n}", "function ProjectPage({ props }) {\n const loading = useSelector(selectors.loading)\n return (\n <DynamicModuleLoader modules={[projectCard.default]}>\n {loading ? (\n <Loading overlay>Загрузка карточки проекта</Loading>\n ) : (\n <Flex style={{ height: '100%' }}>\n <Box>Here's where project card be at</Box>\n </Flex>\n )}\n </DynamicModuleLoader>\n )\n}", "function CardProjectSix() {\n return (\n <Card className=\"bg-dark\" border=\"primary\" style={{ width: '28rem' }}>\n <div className=\"hovereffect\">\n <Card.Img src={projectSixImage} alt=\"Card image\" style={{ width: 450, height: 250 }} />\n <div className=\"overlay\">\n <Card.ImgOverlay>\n <Card.Title>Full Stack: Burger App</Card.Title>\n <Card.Subtitle>Individual Project</Card.Subtitle>\n <Card.Text>\n This is the first Full Stack App I created. This burger logging app uses MySQL, Node, Express, Handlebars and a homemade ORM (yum!). It also applies the MVC design pattern.\n </Card.Text>\n <Card.Text>Technology/Concepts: 3rd party APIs, Moment.js, Jquery</Card.Text>\n <Card.Link href=\"https://desolate-wave-36352.herokuapp.com/\">Visit</Card.Link>\n <Card.Link href=\"https://github.com/azu20/burger-full-stack-app\">Github</Card.Link>\n </Card.ImgOverlay>\n </div>\n </div>\n </Card>\n );\n}", "function JumboProjectCard(props) {\n return (\n <Col md={12}>\n <Card style ={{ Margin : '10px' }}>\n <Card.Img variant=\"top\" src=\"holder.js/100px180\" />\n <Card.Body>\n <Card.Title>Card Title</Card.Title>\n <Card.Text>\n Some quick example text to build on the card title and make up the bulk of\n the card's content.\n </Card.Text>\n </Card.Body>\n </Card>\n </Col>\n );\n}", "function Main() {\n\n\n return (\n <div>\n <CardGrillaArriendosHome />\n\n </div>\n )\n}", "render() {\n return(\n <div>\n <Card className=\"project-card\">\n <CardHeader\n title=\"Contributor(s):\"\n subtitle={this.props.contributors}\n avatar=\"imgs/chelsea.jpg\"\n />\n <CardMedia\n overlay={<CardTitle title={this.props.title} subtitle={this.props.skills} />}\n >\n <img src={'imgs/' + this.props.screenshot} />\n </CardMedia>\n <CardTitle title={this.props.title} subtitle={this.props.date} />\n <CardText>\n {this.props.description}\n </CardText>\n <CardActions>\n <FlatButton onClick={() => this.openLink(this.props.url)} label=\"Open Project\"/>\n </CardActions>\n </Card>\n </div>\n )\n }", "function ProjectCard({ project }) {\n\t//--- Functions ---\n\t//--- JSX ---\n\treturn (\n\t\t<Col className='col' lg={4} md={6} sm={12} xs={12}>\n\t\t\t<Link\n\t\t\t\tto={{\n\t\t\t\t\tpathname: `/projects/${project._id}`,\n\t\t\t\t\tstate: {\n\t\t\t\t\t\tproject,\n\t\t\t\t\t},\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<Card className='card project-card rounded hover-parent background-secondary card-corner-color-primary'>\n\t\t\t\t\t<Card.Body>\n\t\t\t\t\t\t<Card.Title as='h1'>{project.title}</Card.Title>\n\t\t\t\t\t\t<Card.Subtitle as='h4'>\n\t\t\t\t\t\t\tLast Updated:{' '}\n\t\t\t\t\t\t\t{moment(project.updatedAt).format('HH:mm, MM-DD-YYYY')}\n\t\t\t\t\t\t</Card.Subtitle>\n\t\t\t\t\t\t<Card.Text className='hover-child fade-in-full'>\n\t\t\t\t\t\t\tCreated By: {project.creator.username}\n\t\t\t\t\t\t</Card.Text>\n\t\t\t\t\t</Card.Body>\n\t\t\t\t</Card>\n\t\t\t</Link>\n\t\t</Col>\n\t);\n}", "import() {\n }", "function CardProjectOne() {\n return (\n <Card className=\"bg-dark\" border=\"primary\" style={{ width: '28rem' }}>\n <div className=\"hovereffect\">\n <Card.Img src={projectOneImage} alt=\"Card image\" style={{ width: 450, height: 250 }} />\n <div className=\"overlay\">\n <Card.ImgOverlay>\n <Card.Title>DAS FLIX</Card.Title>\n <Card.Subtitle>Group Project</Card.Subtitle>\n <Card.Text>\n DasFlix is a CRUD MVC project, built to help end users browse, create favorite TV shows and movies. This app was created by the University of Arizona Students: Azucena Gonzalez, Denzell Grant, and Stephen Studer.\n </Card.Text>\n <Card.Text>Technologies/Concepts: SQL, MySQL, CRUD, MVC, OOP</Card.Text>\n <Card.Link href=\"http://www.dasflix.com\">Visit</Card.Link>\n <Card.Link href=\"https://github.com/denzgrant/DasFlix-\">Github</Card.Link>\n </Card.ImgOverlay>\n </div>\n </div>\n </Card>\n );\n}", "function Project(props) {\n return (\n <div className=\"card project float-left\">\n <img className = \"card-img-top\" src={props.pic} alt=\"Card cap\"/>\n <div className=\"card-body\">\n <h5 className=\"card-title\">{props.name}</h5>\n <h6>Description:</h6>\n <hr></hr>\n <p className=\"card-text\">{props.description}</p>\n <a className = \"btn btn-secondary cardBtn\" href= {props.link} role = \"button\">Link</a>\n <a className = \"btn btn-secondary cardBtn\" href= {props.github} role = \"button\">Github</a>\n </div>\n </div>\n );\n}", "function Project(props) {\n\n return(\n\n // 1 cards for all the porjects\n <div className = \"container vw-25 text-center\" key = {props.id}>\n <div className =\"card\">\n <div className =\"card-body\">\n <h1 className =\"card-title\">{props.title}</h1>\n <img src={props.image} className=\"card-img-top w-75 h-15 \" alt=\"Project Screenshot\"/>\n {/* <img className = \"bg-dark\" src={props.image} alt = \"Project Screenshot\"></img> */}\n <p className=\"card-text\">{props.description}</p>\n <a href={props.github} className=\"btn btn-primary\">Github</a>\n <a href={props.deploy} className=\"btn btn-secondary\">Deployment</a>\n </div>\n </div>\n </div>\n\n )\n}", "function ProjectCard(title, about, imgURL, siteURL, repoURL) {\n this.title = title;\n this.about = about;\n this.imgURL = imgURL;\n this.siteURL = siteURL;\n this.repoURL = repoURL;\n }", "function Card(props){\n const thisCard = `/cards/${props.card}.png`\n return(\n <div className=\"col-sm-2 card\">\n <img src={thisCard} />\n </div>\n )\n}", "render() {\n return ( \n <div className=\"project-wrapper\">\n <FontAwesomeIcon className=\"bin\" icon={faGithub} size=\"10x\"></FontAwesomeIcon>\n <a href={this.props.project.href} target=\"_\">\n <Card className=\"project col-md-15\">\n <Card.Img variant=\"top\" src={this.props.project.src} className=\"bordered-image\" title={this.props.project.tags}></Card.Img>\n <Card.Body className=\"project-body\">\n <Card.Title className=\"project-title\">{this.props.project.name}</Card.Title>\n <Card.Text className=\"project-description\">\n {this.props.project.description}\n </Card.Text>\n </Card.Body>\n </Card>\n </a>\n </div>\n );\n }", "function include(path) {\nreturn () => import('@/components/' + path)\n}", "loadCards(){\n let cards = require(\"C:\\\\Users\\\\Tony\\\\Desktop\\\\Programming\\\\Yugiosu\\\\Yugiosu - Python (Discord)\\\\yugiosu discord bot\\\\cogs\\\\Yugiosu\\\\cards.json\");\n for(let card of cards){\n this.cards[card[\"id\"]] = new Card(card['id'], card[\"name\"], card[\"cardtype\"], card[\"copies\"], card[\"description\"], card[\"properties\"]);\n }\n }", "function Projects() {\n return (\n <Container>\n <div>\n <Row className=\"project-card\">\n <ProjectCard\n imgPath={meetup}\n title=\"ReactJS Meetup Progressive Web App\"\n description=\"a serverless, progressive web application (PWA) with React using a test-driven development (TDD) technique and hosted by a cloud provider (Lambda AWS). Users of this app will be able to use this application whenever they want to view upcoming events for a specific city..\"\n github=\"https://github.com/wafachaari/myFlix-client\"\n header=\"React | CSS | JavaScript | OAuth2 | Jest | Serverless Programming\"\n application=\"https://wafachaari.github.io/meet/\"\n />\n </Row>\n <Row className=\"project-card\">\n <ProjectCard\n header=\"MongoDB | Express | React | Node.js | Redux | JSX | SCSS | Parcel | JavaScript | Bootstrap\"\n imgPath={movieapi}\n title=\"ReactJS Web App - MyFlix\"\n description=\" full stack application using React, JWT, and Node.js for serverside (which queries a REST API built from scratch) allows you to create a profile, browse movies, favorite movies, explore directors, and update information..\"\n application=\"https://wafachaari.github.io/meet/\"\n github=\"https://github.com/wafachaari/myFlix-clien\" />\n </Row>\n <Row className=\"project-card\">\n <ProjectCard\n header=\"HTML | CSS | JavaScript | jQuery | Bootstrap\"\n imgPath={pokemon}\n // isBlog={false}\n title=\"Javascript/jQuery Web App - PokéDex\"\n description=\" a javascript app with HTML,css,jquery ,that also loads data from an external API The styling for this app was created with help from Bootstrap and interacts with the Pokemon API. The development of Poke-Dex took a deep dive into advanced JavaScript methods and DOM interaction.\"\n link=\"https://github.com/wafachaari/myFlix-clien\"\n application=\"https://wafachaari.github.io/meet/\"\n />\n </Row>\n </div>\n </Container>\n );\n}", "function ProjectCard(props) {\n return (\n <div className=\"card\">\n <div className=\"img-container\">\n <img alt={props.name} src={props.image} />\n </div>\n <div className=\"portfolio-content\">\n <p>{props.name}</p>\n <p>\n <a href={props.github}><img src=\"https://img.icons8.com/color/48/000000/github--v1.png\" alt=\"Repository\" id=\"project-icon\"/></a> \n <a href={props.deploy}><img src=\"https://img.icons8.com/color/48/000000/monitor.png\" alt=\"Deployed Site\" id=\"project-icon\"/></a> \n </p>\n </div>\n </div>\n )\n}", "function Project(props) {\n\t// This imports the information for the current project sent down.\n\tconst currentProject = useState(props)[0].projects;\n\n\tconst name = currentProject.name;\n\tconst description = currentProject.description;\n\tconst image = currentProject.image;\n\tconst appLink = currentProject.deployed;\n\tconst gitLink = currentProject.github;\n\n\n\treturn (\n\t\t<Card style={{ width: \"18rem\" }}>\n\t\t\t<Card.Img\n\t\t\t\tvariant=\"top\"\n\t\t\t\tsrc={ image }\n\t\t\t\tclassName=\"card-image\"\n\t\t\t/>\n\t\t\t<div className=\"center\">\n\t\t\t\t<Card.Body>\n\t\t\t\t\t<Card.Title className=\"card-title\">{name}</Card.Title>\n\t\t\t\t\t<Card.Text className=\"card-text\">{description}</Card.Text>\n\t\t\t\t\t<Card.Link href={appLink} target=\"_blank\" className=\"card-link\">\n\t\t\t\t\t\t{name} App\n\t\t\t\t\t</Card.Link>\n\t\t\t\t\t<br></br>\n\t\t\t\t\t<Card.Link href={gitLink} target=\"_blank\" className=\"card-link\">\n\t\t\t\t\t\t{name} Github\n\t\t\t\t\t</Card.Link>\n\t\t\t\t</Card.Body>\n\t\t\t</div>\n\t\t</Card>\n\t);\n}", "function projectTemplate(){\n importInDoc('11zdES1xBa8l765h0vqJtJlRZgM5dshofg1trHUj7eXE');\n}", "static projectCardTemplate(project) {\n const template = `\n <div class=\"col-4\">\n <div class=\"card\" data-id=\"${project.id}\">\n ${project.img ? `<img class=\"card-img-top\" src=\"${project.img}\" alt=\"Card image cap\">` : ''}\n <div class=\"card-body\">\n <h5 class=\"card-title\">${project.name}</h5>\n <p class=\"card-text\">${project.description}</p>\n <a href=\"#\" class=\"btn btn-primary\">Edit</a>\n <a href=\"#\" class=\"btn btn-danger delete-btn\">Delete</a>\n </div>\n </div>\n </div>\n `;\n\n return template;\n }", "render() {\n return (\n <>\n <Jumbotron>\n <h1 className=\"text-center\">\n <strong>Sheriff Goose</strong>\n </h1>\n <h2 className=\"text-center\">This town goose goose for goose goose of us</h2>\n </Jumbotron>\n {/* <ComicBox></ComicBox> */}\n <Card\n title={\"Fortune Favors the Bird: \"}\n date={\"01/29/2020\"}\n src={\"https://github.com/apino117/goose-comic/blob/master/client/src/assets/images/golden%20goose%2018.png?raw=true\"}\n alt={\"example\"}>\n </Card>\n </>\n );\n }", "function Home(props) {\n return (\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md m-1\">\n <Card>\n <CardImg top width=\"100%\" src=\"/assets/images/engagement.png\" alt=\"Card image cap\" />\n </Card>\n </div>\n\n </div>\n </div>\n );\n}", "render() {\n var img_path = 'imgs/project_images/' + this.props.data.img_path;\n return (\n <Card className='card'>\n <CardMedia>\n <img id='card_image' src={img_path}/>\n </CardMedia>\n <CardTitle title={this.props.data.title} subtitle={this.props.data.subtitle}/>\n <CardText>\n {this.props.data.description}\n </CardText>\n <CardActions>\n <FlatButton target='_blank' label=\"See More\" href={this.props.data.url}/>\n </CardActions>\n </Card>\n );\n }", "function CardView(){\n return (\n <div className=\"cardview-container\">\n <h2>WIP</h2>\n </div>\n )\n}", "function CardPage() {\n return (\n \n <div>\n\n <header className=\"App-header m-cont\">\n <h1>\n <div className=\"card p-2 card-title\">Sensores</div>\n </h1>\n </header>\n\n <hr className=\"m-cont\"/>\n\n <div className=\"row m-cont\">\n <Bateria header=\"Batería\" body=\"Batería actual\" battery=\"35\"/>\n <Giroscopio header= \"Giroscopio\" body=\"Rotación\" />\n <Acelerometro header= \"Acelerómetro\" body=\"Aceleración\" />\n </div>\n\n </div>\n );\n}", "render (){\n return(\n <div>\n {this.state.projects.map(project =>(\n <div className=\"row\">\n <div className=\"card mb-3\" id=\"projectCard\">\n <div className=\"row no-gutters\">\n <div className=\"col-md-4\">\n <img src={project.image} className=\"card-img\" alt=\"...\"></img>\n </div>\n <div className=\"col-md-8\">\n <div className=\"card-body\">\n <h5 className=\"card-title\">{project.title}</h5>\n <p className=\"card-text\">{project.text}</p>\n <ul>\n <small>\n <li>GitHub Deployed Link- <a href={project.githubDeployed}\n target=\"blank\">{project.githubDeployed}</a></li>\n </small>\n <small>\n <li>GitHub Repo- <a href={project.githubRepo}\n target=\"blank\">{project.githubRepo}</a></li>\n </small>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n )}", "function ProjectCards(navAction) { \n const classes = useStyles();\n function CardFactory(imagePath, heading, description, link){ \n return (\n <Card className={classes.card}>\n <CardActionArea onClick={ () => navAction(link)}>\n <CardMedia \n className={classes.media}\n image={ imagePath}\n title=\"Logo\"\n alt=\"Logo\" \n />\n <CardContent className={classes.content}>\n <Typography gutterBottom variant=\"h5\" component=\"h3\" >{heading}</Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n {description}\n </Typography>\n </CardContent>\n </CardActionArea>\n <CardActions>\n <Button size=\"large\" color=\"primary\" onClick={ () => navAction(link)}>\n Learn More\n </Button>\n </CardActions>\n </Card>\n );\n };\n \n return (\n <div className=\"Card-wrapper\">\n {CardFactory(require('../../../assets/images/cSharpLogo.png'), 'Multiplayer Exercise', 'Creating engagement with exercise games.', './projects/exercise-game')}\n {CardFactory(require(\"../../../assets/images/reactLogo.png\"), 'IanBabington.com', 'My personal website.', './projects/personal-website')}\n {CardFactory(require('../../../assets/images/pythonLogo.png'), 'Monty Hall Simulations', 'Exploring probability.', './projects/monty-hall')}\n {CardFactory(require('../../../assets/images/androidLogo.png'), 'Transport App', 'Built for your commute.', './projects/transport-app')} \n {/*CardFactory(require('../../../assets/images/androidLogo.png'), 'Android NFC Reader', 'Exploring NFC functionality.', './home')*/} \n </div>); \n}", "function Cards2() {\n return (\n <>\n <section className=\"cards\">\n <h3 className=\"heading_trend-2\">Places To Explore</h3>\n <div className=\"container card-wrap\">\n <div className=\"row card-card\">\n <div className=\"col-4\">\n <CardItem \n src=\"images/AbrakaTurfCountry.png\" \n text=\"Abraka Turf & Country Club\" \n label=\"Abraka Turf & Country Club\"\n location=\"Sapele-Agbor Road Oria Abraka\"\n path=\"/home\"\n />\n <div>\n \n </div>\n <img className=\"star-img-card2\" src='images/Star-2.png' alt='star' />\n </div>\n <div className=\"col-4\">\n <CardItem \n src=\"images/ParkVegaWaterpark.png\" \n text=\"Park Vega Waterpark\" \n label=\"Park Vega Waterpark\" \n location=\"Ewuru Road Off Benin-Asaba Expressway\"\n path=\"/home\"\n />\n <img className=\"star-img-card2\" src='images/Star-1.png' alt='star' />\n </div>\n <div className=\"col-4\">\n <CardItem \n src=\"images/TheNanaPalace.png\" \n text=\"The Nana’s Palace\" \n label=\"The Nana’s Palace\" \n location=\"Koko Warri-North Local Government\"\n path=\"/home\"\n />\n <img className=\"star-img-card2\" src='images/Star-2.png' alt='star' />\n </div>\n \n </div>\n\n\n <div className=\"row card-card\">\n <div className=\"col-4\">\n <CardItem \n src=\"images/RoyalPlaceIdumuje.png\" \n text=\"Royal Palace Idumuje-Ugboko\" \n label=\"Royal Palace Idumuje-Ugboko\" \n location=\"Idumuje-Ugboko Aniocha North LGA\"\n path=\"/home\"\n />\n <img className=\"star-img-card2\" src='images/Star-1.png' alt='star' />\n </div>\n <div className=\"col-4\">\n <CardItem \n src=\"images/OlonaRanchHolidayResort.png\" \n text=\"Olona Ranch & Holiday Resort\" \n label=\"Olona Ranch & Holiday Resort\" \n location=\"Onicha-Olona Vertinary St Asaba\"\n path=\"/home\"\n />\n <img className=\"star-img-card2\" src='images/Star-2.png' alt='star' />\n </div>\n \n <div className=\"col-4\">\n <CardItem \n src=\"images/BomadiBeachPartyResort.png\" \n text=\"Bomadi Beach Party Resort\" \n label=\"Bomadi Beach Party Resort\" \n location=\"Bomadi Bayelsa Niger Delta\"\n path=\"/home\"\n />\n <img className=\"star-img-card2\" src='images/Star-2.png' alt='star' />\n </div>\n \n </div>\n </div> \n\n <div>\n <Btn />\n </div>\n </section>\n \n </> \n )\n}", "function App() {\n return (\n <div className=\"App\">\n <CharCard />\n </div>\n );\n}", "function Comp() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_src__WEBPACK_IMPORTED_MODULE_4__.default, {\n lilProject: _sampleReactProject__WEBPACK_IMPORTED_MODULE_5__.default\n }));\n}", "function DeckB(){\n return(\n <div>\n <h1>Wellness Classes</h1>\n <div className='deck'>\n <SmallCard img={DiabetesImg} text=\"Diabetes\" />\n <SmallCard img={SmokingImg} text=\"Quit Smoking\" />\n <SmallCard img={ScaleImg} text=\"Weight Loss\" />\n <SmallCard img={BloodPressImg} text=\"High Blood Pressure\" />\n <SmallCard img={Cholesterol} text=\"High Cholesterol\" />\n <SmallCard img={Inhaler} text=\"Ashtma\" />\n </div>\n </div>\n )\n}", "render() {\n return (\n <div>\n <Card.Body>\n <Card.Text>\n <small><center>This is a student application</center></small>\n </Card.Text>\n </Card.Body>\n </div>\n\n );\n }", "function Cards() {\n return (\n <div className='cards'>\n <h1>Recommended Properties!</h1>\n \n <div className='cards__container'>\n <div className='cards__wrapper'>\n <ul className='cards__items'>\n \n <CardItem\n src='images/agent1.png'\n text='Find your best investment'\n path='/services'\n />\n <CardItem\n src='images/2.jpg'\n text='Recomended listings'\n path='/services'\n />\n <CardItem\n src='images/3.jpg'\n text='Dont miss these homes!\n Recommended based on your recent activity'\n path='/services'\n />\n <CardItem\n src='images/4.jpg'\n text='Rent a home'\n path='/services'\n />\n </ul>\n \n </div>\n </div>\n </div>\n );\n}", "static fetchCardIndex() {\n fetch(`${BACKEND_URL}/cards`)\n .then(response => response.json())\n .then(cards => Card.createCards(cards))\n }", "constructor() {\n super(); // always call super() first in the ctor.\n const t = importedDoc.getElementById(\"movie-card\");\n const shadowRoot = this.attachShadow({ mode: \"open\" }); // Open shadow root\n shadowRoot.appendChild(t.content.cloneNode(true)); // Append movie-card.html to the shadow root\n }", "function LoginFront() {\r\n return(\r\n <div>\r\n <FrontCard\r\n cardclass = \"logcardfront1\"\r\n text1=\"LOGIN\"\r\n text2=\"TO\"\r\n text3=\"KHANA SHANA\"\r\n imgpath=\"https://firebasestorage.googleapis.com/v0/b/khana-shana-2020.appspot.com/o/Mehreen%2Fchefs.svg?alt=media&token=07d03c0e-a812-48dc-8ea0-bfcb34260e5f\"\r\n />\r\n </div>\r\n )\r\n}", "function App() {\n return (\n <div className=\"App\">\n <Projects />\n </div>\n );\n}", "render() {\n return (\n <div id=\"portfolio\" >\n <Card >\n <Card.Header>UW - Live Well Roommate Finder Web Application</Card.Header>\n <Card.Body>\n <Card.Title> Secondary thang</Card.Title>\n <Card.Text>\n A Full-Stack Roommate finder web application complete with a backend web server with a database.\n </Card.Text>\n <Button variant=\"primary\">Go somewhere</Button>\n </Card.Body>\n <Card.Footer className=\"text-muted\"> Reactjs | Flask | SQLAlchemy | PostgreSQL </Card.Footer>\n </Card>\n <Card >\n <Card.Header>Featured</Card.Header>\n <Card.Body>\n <Card.Title>Special title treatment</Card.Title>\n <Card.Text>\n With supporting text below as a natural lead-in to additional content.\n </Card.Text>\n <button >Go somewhere</button>\n </Card.Body>\n <Card.Footer className=\"text-muted\"> </Card.Footer>\n </Card>\n </div>)\n }", "function CardsGroup() {\n return (\n <Row className={styles.normal} type='flex' justify='center' gutter={0}>\n \t<Col xs={{ span: 24, order: 1 }} sm={{span: 12, order: 0 }} >\n\t <Card className={styles.card}> \t\n\t \t\t<h4 className={styles.title}>Javascript小游戏</h4>\n\t \t\t<p className={styles.text}>\n\t\t\t\t\t\t\t2016年10月<br />\n\t \t\t\t学习Javascript过程中的练手小游戏,纯Javascript编写,模仿自小蜜蜂游戏。<br />\n\t \t\t\t链接:<a href='http://120.25.74.236/danima'>120.25.74.236/danima</a><br />\n\t \t\t\t源码:\n\t\t\t\t\t\t\t<a href='http://github.com/haireggs/danima'>http://github.com/haireggs/danima</a>\n\t\t\t\t\t\t</p>\n\t </Card>\n </Col>\n <Col xs={{ span: 24, order: 0 }} sm={{span: 12, order: 1 }} >\n\t <Card className={styles.card} bodyStyle={{ padding:0 }}>\n\t <a href='http://120.25.74.236/danima'><img className={styles.img} src={require('../../../public/images/myDanima.gif')} alt='图片加载中' /></a>\n\t </Card>\n </Col>\n\t </Row>\n\n\n );\n}", "function getCardName(path) {\n let indexstartname\n try{\n indexstartname = path.lastIndexOf(\"/\") + 1\n }catch{\n return null\n }\n let filename = path.slice(indexstartname)\n let indexendname = filename.indexOf(\".\")\n let cardname = filename.slice(0, indexendname)\n return cardname\n }", "function Card(props) {\r\n // const cardClass = props.className + ' card';\r\n return <div className={props.className + \" card\"}>{props.children}</div>;\r\n}", "function Portfolio() {\n const classes = useStyles();\n\n return (\n <div>\n <Row className=\"justify-content-md-center\"> \n <h1>Portfolio</h1>\n </Row>\n\n <Row className=\"justify-content-md-center\"> \n <div className=\"dev-row\">\n <Col>\n <img className=\"introImg\" src={travel}></img>\n </Col>\n <Col>\n\n <Card className={classes.root} variant=\"outlined\">\n <CardContent>\n <Typography variant=\"body2\" component=\"p\" className=\"card-back\">\n <h3>Under Construction...</h3>\n\n </Typography>\n </CardContent>\n </Card>\n </Col>\n </div>\n </Row>\n\n \n </div>\n \n );\n}", "function Card(props) {\n return (\n <div className=\"card col-10 col-sm-10 col-md-6 col-lg-2 m-4 mt-5 pt-3 shadow shadow-lg\">\n <div className=\"d-flex justify-content-center align-items-center\">\n <img className=\"card-img\" src={props.url} alt={props.name} />\n </div>\n <div className=\"card-body\">\n <h6 className=\"card-title text-center title-size\">{props.name}</h6>\n </div>\n </div>\n );\n}", "function FileCard({ file }) {\n const classes = useStyles();\n\n return (\n <Card className={classes.card} display='flex'>\n <div className={classes.conten}>\n <CardMedia width='151px'>\n <Icon className={classes.iconCon}>assignment</Icon>\n </CardMedia>\n <div>\n <CardContent className={classes.cardContent}>\n <Typography className={classes.tile} component='p' variant='p'>\n {file.name}\n </Typography>\n </CardContent>\n </div>\n </div>\n <Button\n variant='contained'\n color='primary'\n href={file.downloadUrl}\n target='_blank'\n >\n Descargar\n </Button>\n </Card>\n );\n}", "function App(){\n return(\n <div>\n <ContactCard name = \"Tarik\" email = \"random@gmail\" number = \"123-321-1231\" url = \"linkedin.com/in/user\" />\n </div>\n )\n}", "render() {\n return( \n <div className=\"card-container\">\n <Grid>\n <Grid.Row columns={4}>\n {/* <Grid.Column> */}\n {this.renderCards()}\n {/* </Grid.Column> */}\n </Grid.Row>\n </Grid>\n </div>\n )\n }", "render() {\n return (\n <Card className=\"w-50 p-3\" >\n <CardActionArea>\n <CardMedia\n className=\"h-50\"\n image=\"./images/pelusa.jpg\"\n title=\"Contemplative Reptile\"\n />\n <CardContent>\n <Typography gutterBottom variant=\"h5\" component=\"h2\">\n Lizard\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n Lizards are a widespread group of squamate reptiles, with over 6,000 species, ranging\n across all continents except Antarctica\n </Typography>\n </CardContent>\n </CardActionArea>\n <CardActions>\n <Button size=\"small\" color=\"primary\">\n Share\n </Button>\n <Button size=\"small\" color=\"primary\">\n Learn More\n </Button>\n </CardActions>\n </Card>\n );\n }", "function RecentProjectCard({ recentProject }) {\n\t//--- JSX ---\n\treturn (\n\t\t<Card className='project-card card-corner-color-primary rounded hover-parent background-secondary '>\n\t\t\t<Card.Body>\n\t\t\t\t<Card.Title as='h2'>Most Recent Project:</Card.Title>\n\t\t\t\t<Card.Subtitle as='h3'>\n\t\t\t\t\t{recentProject === undefined\n\t\t\t\t\t\t? 'No Recent Project Found!'\n\t\t\t\t\t\t: `${recentProject.title}`}\n\t\t\t\t</Card.Subtitle>\n\t\t\t\t<Card.Text className='hover-child fade-in-full' as='h4'>\n\t\t\t\t\t{recentProject === undefined\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: `Last Updated: ${moment(recentProject.updatedAt).format(\n\t\t\t\t\t\t\t\t' HH:mm, MM-DD-YYYY'\n\t\t\t\t\t\t )}`}\n\t\t\t\t</Card.Text>\n\t\t\t</Card.Body>\n\t\t</Card>\n\t);\n}", "function _1HowWetCard() {\n return (\n // <Card\n // title=\"#1 - How wet should the bedding be?\"\n // image={require(\"../shared/images/worm-bin2.jpg\")}\n // >\n <React.Fragment>\n <Image style={{}} source={require(\"../raw-images/worm-bin.jpg\")} />\n <Text>\n Worms need a moist environment. Too wet, and the bin becomes stinky and\n the worms might drown. Too dry, and the worms dehydrate, cannot breathe,\n can’t tunnel effectively, and will try to leave the bin. If they do\n leave the bin, they will dry out and die right outside the bin, usually\n within a foot or two.{\" \"}\n </Text>\n <Image style={{}} source={require(\"../raw-images/worm6.jpg\")} />\n <Text>\n Water your bin weekly to re-hydrate your bin. Touch the bedding and test\n for sponge-ness. It should feel like a wet sponge - if you squeeze it,\n water comes out. To avoid water evaporating into the air, place a\n plastic trash bag (loosely) on the top of the surface. Don't seal it too\n tight as it may stop air flow. Another option is to use a piece of\n cardboard and provide daily sprays of water. The cardboard has better\n airflow, but requires more maintenance.{\" \"}\n </Text>\n <Text> Plastic bins rarely dry out, as water has no where to go.</Text>\n </React.Fragment>\n );\n}", "getImageSource(){\n return `assets/images/cards/${this.rank}_of_${this.suit}.png`;\n }", "function Cards( props ) {\n return (\n <Card fluid color='white'>\n <Image src={props.image} wrapped ui={false} />\n <Card.Content>\n <Card.Header>{props.name}</Card.Header>\n <Card.Description>\n {props.description}\n </Card.Description>\n </Card.Content>\n <Card.Content extra>\n <Button href={`https://github.com/mkotte${props.repo}`} className=\"card-btn-link\" target=\"_blank\" >\n Github Repository\n </Button>\n {props.app !== \"none\" ? \n <Button href={props.app} className=\"card-btn-link\" target=\"_blank\" >\n Deployed Application\n </Button> : \n <> </> \n }\n </Card.Content>\n </Card>\n )\n}", "function renderCard(card) {\n let newCard = \n `<div class=\"column is-half\">\n <div class=\"card\">\n <div class=\"card-image\">\n <figure class=\"image is-3by2 pic-container\">\n <img src=${card.imgURL} alt=\"Placeholder image\" class=\"portfolio-img\">\n <div class=\"overlay\">\n <div class=\"card overlay-card\">\n <div class=\"card-content project-card-content has-text-centered\">\n <p class=\"title has-text-white project-title\">\n ${card.title}\n </p>\n <p class=\"subtitle is-6 has-text-white project-description\">\n ${card.about}\n </p>\n </div>\n <footer class=\"card-footer\">\n <p class=\"card-footer-item\">\n <a href=${card.siteURL} target=\"_blank\" class=\"card-links\">View Website</a>\n </p>\n <p class=\"card-footer-item\">\n <a href=${card.repoURL} target=\"_blank\" class=\"card-links\">GitHub Repo</a>\n </p>\n </footer>\n </div>\n </div>\n </figure>\n </div>\n </div>\n </div>`\n\n $(\"#cards-container\").append(newCard);\n }", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function ProductCard(props) {\n return (\n <div className='Product-cards'>\n <Card style={{ width: '18rem' }} >\n <Card.Img className='Card-Img' variant=\"top\" src={props.imageSource} />\n <hr></hr>\n <Card.Body>\n <Card.Title className='Card-Title'>{props.name}</Card.Title>\n <Card.Text>{props.description}</Card.Text>\n <hr></hr>\n <a href={props.url} className='btn btn-dark'>More Info</a>\n </Card.Body>\n </Card>\n </div>\n );\n}", "constructor() {\n super(moduleDirectory);\n }", "render() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">MY APP</header>\n <ListCard/>\n <ListList/>\n </div>\n );\n }", "importFn(path) {\n return SynchronousPromise.resolve().then(() => {\n const moduleExports = this.csfExports[path];\n if (!moduleExports) throw new Error(`Unknown path: ${path}`);\n return moduleExports;\n });\n }", "function getPlayerCard() {\n \n}", "componentDidMount() {\n this.getProject();\n }", "function Seven(){\r\n return(\r\n <div>\r\n <div className=\"headings-2\">\r\n <h4 className=\"headings-2\" >Meet Fellow Hourspacers</h4><br></br>\r\n \r\n\r\n </div>\r\n <img src={leftArrow} className='l-arrow' />\r\n <img src={rightArrow} className='r-arrow' />\r\n \r\n <CardDeck className=\"Deck-vid\">\r\n <img src={man} className='faceA1' width=\"6%\"/>\r\n <Card>\r\n \r\n <Card.Img className=\"img1\" variant=\"top\" src={host1} /> \r\n <Card.Footer>\r\n <small className=\"text-muted\">Host Name </small><br></br>\r\n <small className=\"text-muted\">Title of speech here</small> \r\n </Card.Footer> \r\n </Card>\r\n\r\n <img src={man} className='faceA2' width=\"6%\"/>\r\n <Card >\r\n <Card.Img variant=\"top\" src={host2} />\r\n <Card.Footer >\r\n <small className=\"text-muted\">Host Name </small><br></br>\r\n <small className=\"text-muted\">Title of speech here</small> \r\n </Card.Footer> \r\n </Card>\r\n \r\n <img src={man} className='faceA3' width=\"6%\"/>\r\n <Card>\r\n <Card.Img variant=\"top\" src={host3} />\r\n <Card.Footer className=\"card-foot\">\r\n <small className=\"text-muted\">Host Name</small><br></br>\r\n <small className=\"text-muted\">Title of speech here</small> \r\n </Card.Footer>\r\n </Card>\r\n </CardDeck>\r\n </div>\r\n\r\n )\r\n}", "function makeCard(TargatElement, i, classindex) {\n try {\n const card = ce(\"div\", TargatElement, [\n \"card\",\n \"card\" + classindex,\n \"projects\" + i,\n ]); // ----------card-----------\n card.style.height = d1 * 4 + \"px\"; // ------card height : this; css---------//\n if (bodyWidth >= 750) {\n card.style.height = \"100%\";\n }\n card.style.backgroundImage = `url(\"resource/imgs/projects/p${i}.jpg\")`;\n const blur_box = ce(\"div\", card, [\"blur_box\"]);\n const card_dtls = ce(\"div\", card, [\"card_dtls\"]); // ------------card dtls------------\n const card_name = ce(\"div\", card_dtls, [\"card_name\"]);\n const nameP = ce(\n \"p\",\n card_name,\n [],\n project_data.my_creation[`p${i}`].name\n );\n const language = ce(\"div\", card_dtls, [\"language\"]);\n for (\n let j = 0;\n j <= project_data.my_creation[`p${i}`].languases.length;\n j++\n ) {\n if (parseInt(project_data.my_creation[`p${i}`].languases[j])) {\n const img = ce(\"img\", language);\n img.src = `resource/svgs/language/${j + 1}.svg`;\n }\n }\n for (let btnx = 0; btnx < 2; btnx++) {\n let current =\n btnx == 0\n ? [\"card_view\", \"fas\", \"fa-street-view\", \"View\"]\n : [\"project_download\", \"fas\", \"fa-file-download\", \"Source\"];\n const card_view = ce(\"button\", card_dtls, [current[0], \"cmone\"]);\n const btnI = ce(\"i\", card_view, [current[1], current[2]]);\n const btnP = ce(\"p\", card_view, [], current[3]);\n }\n } catch (err) {\n console.log(err);\n }\n }", "function Exports(path) {\n this.path = path;\n }", "componentDidMount(){\n this.getProject()\n }", "function Cards(props){\n return (\n <>\n <div className = \"container\">\n <div className=\"cards\">\n <Image imgLink={props.imgLink}/>\n <div className=\"card_info\"> \n <span className=\"title\">{props.title}</span>\n <Heading name={props.name} />\n <a href={props.srcLink} target=\"_blank\"><button className=\"btn\">WATCH NOW</button></a>\n </div>\n </div>\n </div>\n </>\n )\n}", "render() {\n const {classes} = this.props;\n return (\n <ThemeProvider theme={theme}>\n <Grid container justify='space-around'\n className={classes.cards}>\n <this.Cards />\n </Grid>\n </ThemeProvider>);\n }", "function App2() {\n return (\n <div className=\"contacts\">\n <ContactCard \n name=\"Mr. Whiskerson\" \n imgUrl=\"http://placekitten.com/300/200\" \n phone=\"(212) 555-1234\" \n email=\"[email protected]\"\n />\n \n <ContactCard \n name=\"Fluffykins\" \n imgUrl=\"http://placekitten.com/400/200\" \n phone=\"(212) 555-2345\" \n email=\"[email protected]\"\n />\n \n <ContactCard \n name=\"Destroyer\" \n imgUrl=\"http://placekitten.com/400/300\" \n phone=\"(212) 555-3456\" \n email=\"[email protected]\"\n />\n \n <ContactCard \n name=\"Felix\" \n imgUrl=\"http://placekitten.com/200/100\" \n phone=\"(212) 555-4567\" \n email=\"[email protected]\"\n />\n \n </div>\n )\n}", "function Card(num, suit) {\n this.num = num;\n this.suit = suit;\n this.fname = sDir + this.num + this.suit + \".gif\";\n}", "componentDidMount() {\n this.importBDD();\n }", "render() {\n\n return (\n <div>\n <h1 className=\"title\">Project Page</h1>\n <div className='projectButton'>\n < ProjectForm phases={this.props.phases} {...this.props} addProject={this.props.addProject} projects={this.props.projects}/>\n </div>\n\n <section className=\"projects\">\n {\n\n this.props.projects.map(project =>\n <div key={project.id} >\n <ProjectCard key={project.id} project={project} phases={this.phases} {...this.props} />\n </div>\n )\n }\n </section>\n </div>\n )\n }", "function Projects() {\n return (\n\n <Container fluid className=\"project-section\">\n <Particle />\n <Container>\n <h1 className=\"project-heading\">\n <h1>This page is still under development. </h1>\n <h2>Projects will be added shortly. Thank you for your patience</h2>\n My Recent <strong className=\"purple\">Projects </strong>\n </h1>\n\n <p style={{ color: \"white\" }}>\n Here are a few projects I've worked on recently.\n </p>\n <Row style={{ justifyContent: \"center\", paddingBottom: \"10px\" }}>\n <Col md={4} className=\"project-card\">\n <ProjectCard\n imgPath={Image}\n isBlog={false}\n title=\"Note Taker\"\n description=\"Full-stack application designed for note taking purposes using node.js and express.js. All the information is stored within node.js so we can have a functional server to save data and make changes. Node.js creates html routes as well as api routes.\"\n link=\"https://github.com/Shahabgeravesh/Note-Taker-\"\n />\n </Col>\n\n <Col md={4} className=\"project-card\">\n <ProjectCard\n imgPath={Image}\n isBlog={false}\n title=\"Task-Manager\"\n description=\"A Simple app that helps the user to keep track of to-do list. User is able to enter a task name and pick a task type then keep track of it until completion.\"\n link=\"https://github.com/Shahabgeravesh/Task-Manager\"\n />\n </Col>\n\n <Col md={4} className=\"project-card\">\n <ProjectCard\n imgPath={Image}\n isBlog={false}\n title=\"Title\"\n description=\"Description\"\n link=\"Link to GitHub\"\n />\n </Col>\n\n </Row>\n </Container>\n </Container>\n );\n}", "function Portfolio() {\n return (\n <PageLoader\n transition=\"swipeUp\"\n delay={0.4}\n InitialScreen={() => <Loader fullscreen />}\n >\n <div className=\"Portfolio\">\n <PageHeader title=\"Portfolio\" description=\"Trips and conquests.\" />\n\n <Container className=\"section--outside flex flex-wrap jc-center\">\n {projects.map((project, index) => {\n return <ProjectCard key={`${project.path}`} project={project} />;\n })}\n </Container>\n </div>\n </PageLoader>\n );\n}", "function About3Card(props) {\n return (\n <div className='About3CardGeneralDiv'>\n <img src={props.CardImage} alt='' style={{ height: '211px', width: '280px', objectFit: 'cover' }} />\n <div className='About3CardSubGeneralDiv'>\n <div className='CircleDiv'>{props.Letter}</div>\n <div className='Curiculm'>{props.Title}</div>\n <div className='cont' > {props.Content} </div>\n </div>\n </div>\n )\n}", "function PlayGame() {\r\n return (\r\n <div>\r\n <h2>Choose a card to see if you win!</h2>\r\n <CardGame></CardGame>\r\n </div>\r\n );\r\n}", "function getCard(card){\n return card.getElementsByClassName('deck-card')[0].src;\n}", "function createProjectCard(project) {\n const projectCard = document.createElement(\"div\");\n projectCard.classList.add(\"project-card\");\n \n const imageContainer = document.createElement(\"div\");\n imageContainer.classList.add(\"image-container\");\n const projectImage = document.createElement(\"img\");\n projectImage.src = project.imageSrc;\n projectImage.alt = project.name;\n imageContainer.appendChild(projectImage);\n \n const projectName = document.createElement(\"div\");\n projectName.classList.add(\"project-name\");\n projectName.textContent = project.name;\n \n const techStack = document.createElement(\"div\");\n techStack.classList.add(\"tech-stack-project\");\n techStack.textContent = project.techStack;\n \n const description = document.createElement(\"div\");\n description.classList.add(\"description-project\");\n const descriptionText = document.createElement(\"p\");\n descriptionText.textContent = project.description;\n description.appendChild(descriptionText);\n \n projectCard.appendChild(imageContainer);\n projectCard.appendChild(projectName);\n projectCard.appendChild(techStack);\n projectCard.appendChild(description);\n \n\n//add project link\nconst popupLink = document.createElement(\"div\");\npopupLink.classList.add(\"popup-link\");\nif (project.links && project.links.length > 0) {\n project.links.forEach((link) => {\n const linkElement = document.createElement(\"a\");\n linkElement.href = link.url;\n linkElement.textContent = link.text;\n linkElement.target = \"_blank\"; // Open link in a new tab\n popupLink.appendChild(linkElement);\n });\n}\n projectCard.appendChild(popupLink);\n\n return projectCard;\n}", "render() {\n return (\n <div className=\"App\">\n <Column name=\"Looking for mentors\" cards={this.getCards(\"mentee\")} />\n <Column\n name=\"Looking to teach/mentor\"\n cards={this.getCards(\"mentor\")}\n />\n <Column\n name=\"Looking for OS projects to contribute to\"\n cards={this.getCards(\"OS\")}\n />\n <Column\n name=\"Looking for contributors\"\n cards={this.getCards(\"contributor\")}\n />\n </div>\n );\n }", "function SimpleMediaCard(props) {\n const { classes } = props;\n //layout for a single card\n return (\n <div>\n <Card className={classes.card}>\n <CardMedia\n className={classes.media}\n image=\"../static/car_img/book1.png\"\n title=\"Contemplative Reptile\"\n />\n <CardContent>\n <Typography type=\"headline\" component=\"h2\">\n Lizard\n </Typography>\n <Typography component=\"p\">\n Lizards are a widespread group of squamate reptiles, with over 6,000 species, ranging\n across all continents except Antarctica\n </Typography>\n </CardContent>\n <CardActions>\n <Button dense color=\"primary\">\n Share\n </Button>\n <Button dense color=\"primary\">\n Learn More\n </Button>\n </CardActions>\n </Card>\n </div>\n );\n}", "function project() {\r\n return (\r\n <div >\r\n <div id=\"project\">\r\n <h1 className=\"pt-3 text-center \">PROJECTS</h1>\r\n <hr/>\r\n \r\n <div className=\"d-flex justify-content-center flex-row mt-1\">\r\n \r\n <div className=\"focus changeWidth\">\r\n \r\n <Accordion>\r\n <Card style={{ width: '350px' }} className=\"card h-200 \">\r\n <Card.Img variant=\"top\" src={BIGSALE} className=\"img\"/>\r\n {/*<Card.Body titleTypographyProps={{variant:'h3' }}>Project title:Social Man Kind</Card.Body>\r\n <Card.Body>\r\n <h6>project title : social man kind</h6>\r\n </Card.Body>*/}\r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong> Simple Ecommerce website listing the offer products on a bigsale\r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>we can view each individual product</li>\r\n <li>we can add to the cart</li>\r\n <li>Responsive Design</li>\r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n \r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_NODE_JS}\r\n alt=\"NODEJS\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Node Js\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_EXPRESS}\r\n alt=\"Express\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Express\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MONGODB}\r\n alt=\"MongoDb\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n MongoDb\r\n </span>\r\n </li>\r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n view project source\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse>\r\n <Card.Body className=\"space\">\r\n \r\n <a href=\"https://confident-shaw-9da624.netlify.app/\" class=\"btn btn-primary btn-xs active button1\" role=\"button\" aria-pressed=\"true\">github</a>\r\n \r\n <a href=\"https://github.com/DuvvuruKishore/projectone\" class=\"btn btn-primary btn-xs active button2\" role=\"button\" aria-pressed=\"true\">webview</a>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n \r\n\r\n </div>\r\n\r\n {/* <div className=\"focus\">\r\n <Accordion>\r\n <Card style={{ width: '350px' }} className=\"card h-200\">\r\n <Card.Img variant=\"top\" src={MOVIE} className=\"img\"/>\r\n {/*<Card.Body titleTypographyProps={{variant:'h3' }}>Project title:Social Man Kind</Card.Body>\r\n <Card.Body>\r\n <h6>project title : social man kind</h6>\r\n </Card.Body>\r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong> Movie booking app with signIn and signUp form \r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>we can signIn and signUp</li>\r\n <li>Powered by React ,Material UI</li>\r\n <li>Respoisive Design</li>\r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MATERIALUI}\r\n alt=\"Material-UI\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Material-UI\r\n </span>\r\n </li>\r\n\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_NODE_JS}\r\n alt=\"NODEJS\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Node Js\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_EXPRESS}\r\n alt=\"Express\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Express\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MONGODB}\r\n alt=\"MongoDb\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n MongoDb\r\n </span>\r\n </li>\r\n \r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n \r\n <Card.Body className=\"space\">\r\n <a href=\"https://github.com/DuvvuruKishore/moviebooking\" class=\"btn btn-secondary btn-xs active button2\" role=\"button\" aria-pressed=\"true\">webview</a>\r\n \r\n <a href=\"https://jolly-banach-029f0e.netlify.app/\" class=\"btn btn-secondary btn-xs active button1\" role=\"button\" aria-pressed=\"true\">github</a>\r\n \r\n </Card.Body>\r\n\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n </div>\r\n */}\r\n <div className=\"focus\">\r\n <Accordion>\r\n <Card style={{ width: '16rem' }} className=\"card h-200\">\r\n <Card.Img variant=\"top\" src={OXYGEN} className=\"img\"/>\r\n \r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong>oxygen suppliers with your request\r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>By filling the form, request is made</li>\r\n <li>we can view the request as well</li>\r\n \r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n \r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MATERIALUI}\r\n alt=\"Material-UI\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n \r\n \r\n </span>\r\n Material-Ui\r\n </li>\r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n \r\n <Card.Body>\r\n <Card.Link href=\"https://github.com/DuvvuruKishore/oxygen\" target=\"_blank\">github</Card.Link>\r\n <Card.Link href=\"https://wizardly-colden-10389c.netlify.app/\" target=\"_blank\">webview</Card.Link>\r\n </Card.Body>\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n </div>\r\n </div>\r\n\r\n \r\n </div>\r\n \r\n <div className=\"down\">\r\n <div className=\"d-flex justify-content-center flex-row mt-1 \">\r\n <div className=\"focus changeWidth\">\r\n \r\n <Accordion>\r\n <Card style={{ width: '16rem' }} className=\"card h-200 \">\r\n <Card.Img variant=\"top\" src={WHATSAPP} className=\"img\"/>\r\n <Card.Body>\r\n <h6>project title : social man kind</h6>\r\n </Card.Body>\r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong>a simple chat room like whatsapp\r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>we can chat in the chat room</li>\r\n <li>material-ui is used for clean look</li>\r\n \r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n \r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MATERIALUI}\r\n alt=\"Material-UI\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n \r\n \r\n </span>\r\n Material-Ui\r\n </li>\r\n \r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_NODE_JS}\r\n alt=\"NODEJS\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Node Js\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_EXPRESS}\r\n alt=\"Express\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Express\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MONGODB}\r\n alt=\"MongoDb\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n MongoDb\r\n </span>\r\n </li>\r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n \r\n <Card.Body>\r\n <Card.Link href=\"https://github.com/DuvvuruKishore/whatsapp\" target=\"_blank\">github</Card.Link>\r\n <Card.Link href=\"https://awesome-lumiere-25be3d.netlify.app/\" target=\"_blank\">webview</Card.Link>\r\n </Card.Body>\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n \r\n\r\n </div>\r\n\r\n <div className=\"focus\">\r\n <Accordion>\r\n <Card style={{ width: '16rem' }} className=\"card h-200\">\r\n <Card.Img variant=\"top\" src={TINDER} className=\"img\"/>\r\n <Card.Body>\r\n <h6>project title : social man kind</h6>\r\n </Card.Body>\r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong>photos swipe option similar to tinder \r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>we get the data from backend</li>\r\n <li>and we can swipe the photos to see other photos</li>\r\n \r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MATERIALUI}\r\n alt=\"Material-UI\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Material-UI\r\n </span>\r\n </li>\r\n\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_NODE_JS}\r\n alt=\"NODEJS\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Node Js\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_EXPRESS}\r\n alt=\"Express\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n Express\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_MONGODB}\r\n alt=\"MongoDb\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n MongoDb\r\n </span>\r\n </li>\r\n \r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n \r\n <Card.Body>\r\n <Card.Link href=\"https://github.com/DuvvuruKishore/tinder\" target=\"_blank\">github</Card.Link>\r\n <Card.Link href=\"https://blissful-raman-c366f7.netlify.app/\" target=\"_blank\">webview</Card.Link>\r\n </Card.Body>\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n </div>\r\n\r\n <div className=\"focus\">\r\n <Accordion>\r\n <Card style={{ width: '16rem' }} className=\"card h-200\">\r\n <Card.Img variant=\"top\" src={UNI} className=\"img\"/>\r\n \r\n <Accordion.Toggle\r\n as={Card.Header}\r\n eventKey=\"0\"\r\n className=\"p-2 text-center accordian-main\"\r\n >\r\n PROJECT DETAILS\r\n </Accordion.Toggle>\r\n\r\n <Accordion.Collapse eventKey=\"0\" className=\"text-left\">\r\n <Card.Body>\r\n <strong>Description:</strong>Top University and their detail information with images\r\n <hr />\r\n <strong>Features:</strong>\r\n <ul className=\"list-styles pt-1\">\r\n <li>University details</li>\r\n <li>Powered by React and React-Bootstrap</li>\r\n \r\n </ul>\r\n <hr />\r\n <strong>Tech used:</strong>\r\n <ul>\r\n \r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_CSS3}\r\n alt=\"CSS 3\"\r\n rounded\r\n className=\"image-style m-1\"\r\n ></Image>{\" \"}\r\n CSS3\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT}\r\n alt=\"React\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n React\r\n </span>\r\n </li>\r\n <li>\r\n <span className=\"p-2\">\r\n <Image\r\n src={L_REACT_BOOTSTRAP}\r\n alt=\"Material-UI\"\r\n rounded\r\n className=\"image-style1 m-1\"\r\n ></Image>{\" \"}\r\n \r\n \r\n </span>\r\n React-Bootstrap\r\n </li>\r\n \r\n </ul>\r\n </Card.Body>\r\n </Accordion.Collapse>\r\n \r\n <Card.Body>\r\n <Card.Link href=\"https://github.com/DuvvuruKishore/Uni\" target=\"_blank\">github</Card.Link>\r\n <Card.Link href=\"https://unruffled-lalande-0df8ab.netlify.app/\" target=\"_blank\">webview</Card.Link>\r\n </Card.Body>\r\n </Card>\r\n \r\n </Accordion>\r\n \r\n </div>\r\n\r\n </div>\r\n </div> \r\n </div>\r\n \r\n \r\n )\r\n}", "function showCardDetails() {\n return (\n <>\n <h2 className=\"component-name\">Card Component</h2>\n <h1>{title}</h1>\n <ColoredLine color=\"black\" />\n <p>{content}</p>\n </>\n )\n }", "function showCardDetails() {\n return (\n <>\n <h2 className=\"component-name\">Card Component</h2>\n <h1>{title}</h1>\n <ColoredLine color=\"black\" />\n <p>{content}</p>\n </>\n )\n }", "function Card(props) {\n\n return (\n <>\n <div className=\"card\">\n {/* <img src={props.imgsrc} alt=\"mypic\" className=\"card-img\"></img> */}\n {/* creating component of image */}\n <Images imgsrc={props.imgsrc}></Images>\n <Card_info sname={props.sname} title={props.title} link={props.link}></Card_info>\n </div>\n </>\n );\n\n}", "function ShowProject(project) {\n let column;\n (project.num===\"3\")?column=\"col-12 col-md-6 col-lg-4 h-400\"\n :column=\"col-12 col-lg-4\"\n\n return (\n <div className={`text-center my-4 show-models ${column}`}> \n <model-viewer className=\"m-auto\" src={project.src} auto-rotate camera-controls></model-viewer>\n <p className=\"text-center my-3\">{project.name}</p>\n </div>\n );\n}", "showBackSide(card) {\n card.src = `./assets/images/back-side.jpg`;\n }", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <div>\n <Switch>\n <Route path=\"/card/:id\">\n <Card />\n </Route>\n <Route exact path=\"/\">\n <Catalog />\n </Route>\n </Switch>\n </div>\n </Router>\n </div>\n );\n}", "render() {\n return (\n <Card className=\"card1\" >\n <CardActionArea> \n <CardContent>\n <Typography align=\"center\">\n <h1 id=\"mission\">Our Product and Services</h1>\n <p><i>Your Business at Home</i></p>\n <Grid className=\"questionContainer\" style={{marginTop: \"50px\"}}>\n <h1 id=\"w\" align=\"left\" style={{marginLeft: \"620px\"}}>What is</h1>\n <CardMedia\n className=\"media2\"\n image={logo}\n />\n <h1 id=\"q\" align=\"center\" style={{marginTop:\"-60px\"}}>?</h1>\n </Grid>\n </Typography>\n <Typography>\n <h1 id=\"mission1\" style={{marginTop: \"60px\"}}>Structure</h1>\n </Typography>\n <Typography component=\"p\" className=\"arrange\" align=\"center\">\n\n <p>adCraft is an App for promoting entrepreneur at home to the Community. Our product and Services will introduce local hand made product so it will recognize its boundery in terms of\n labor and creativity which wil lead for the people to promote also diverse culture and craftsmanship </p>\n \n <p id=\"arrange2\">AdCraft also promotes entrepreneurship hosting for marketing and also convenience to our customer since we are providing information based product for them to effeciently get \n what they usually want</p>\n\n\n <Grid>\n <Grid className=\"p1\">\n <h2 id=\"mission2\">1 Organize</h2>\n <p>Our app help you to organize your business need base on marketing data directly from your home via web-based questionnaires. \n Our features are optimized to give you and your future customer a great experience, \n while providing you with a high response rate.</p>\n <img className=\"organize\" src={organize}/>\n </Grid>\n <Grid className=\"p2\">\n <h2 id=\"mission2\">2 Upload and Validate</h2>\n <p>adCraft confirms the identities of our Advertisers and Users, while protecting their privacy.\n Our anonymity guarantee allows people who would not normally be able to participate in customer referencing activities to speak freely.</p>\n <img className=\"upload\" src={upload}/>\n </Grid>\n <Grid className=\"p3\">\n <h2 id=\"mission2\">3 Publish</h2>\n <p>Instantly publish your Advertisement you select as content assets verified by adCraft. Our Advertisers routinely publish \n hundreds of content assets in their first 30 days – there's no limit. The adCraft Content Library serves as a public repository \n of your published customer proof so they can access your items and entrepreneurial activities. Since adCraft is a 3rd party, you can cite \n the content in press releases just like you would any 3rd-party advertising Business.</p>\n <img className=\"publish\" src={publish}/>\n </Grid>\n <Grid className=\"p4\">\n <h2 id=\"mission2\">4 Utilize</h2>\n <p>adCraft content is useful across all stages of the Advertiser's journey, from Organizing to final decision-making and Uploading, and we provide the tools to \n leverage your content in each of these funnel stages.\n\n In addition, our Connectors integrate with leading Advertising Businessess, Marketing Automation, \n and collaboration platforms so that your adCraft experience is leveraged across the enterprise.</p>\n <img className=\"utilize\" src={utilize}/>\n </Grid>\n </Grid>\n <Grid>\n <img src={blank} className=\"downloadAd\" height=\"200\" width=\"400\" alt=\"\" style={{marginLeft: \"-500px\"}} />\n <Grid className=\"addButton\">\n <button className=\"google\" href=\"https://play.google.com/store?hl=en\"></button>\n <button className=\"apple\" href=\"https://www.apple.com/lae/ios/app-store\"></button>\n <Grid>\n <h3>The best Advertising App in the World available on mobile</h3>\n <h5 style={{marginTop: \"-10px\"}}>Download our app and get the adCraft experience anywhere, anytime</h5>\n </Grid>\n </Grid>\n </Grid>\n </Typography>\n </CardContent>\n { /******************************************* Slide Show effext has been used for visual Integration in connection with CSS*********************************/}\n <Grid class=\"tech-slideshow\">\n <Grid class=\"mover-1\"></Grid>\n <Grid class=\"mover-2\"></Grid>\n </Grid>\n </CardActionArea>\n </Card>\n );\n }", "createCard(card) {\n return <UserCard vorname={card.forename} nachname={card.surname} description={card.user_description} usermail={card.email} id={card.userid} key={card.userid} />;\n }", "getProjects () {\n return (\n <div>\n <div class=\"projectContainer col-5\">Project 1</div>\n <div class=\"projectContainer col-5\">Project 2</div>\n </div>\n )\n }", "loadDataMainPage(){\n const projectComponents = projectData.map(project => {\n return (\n <ProjectTile \n projectPage ={project.projectURL}\n imgURL={project.imgURL} \n name={project.name} \n skills={project.skills} \n description={project.description}/>\n )\n })\n return projectComponents\n }", "showProjects() {\r\n return (\r\n <div>\r\n <div className=\"d-flex justify-content-center\">\r\n <IoJet style={{color: 'gray', fontSize: \"35px\", marginRight: \"20px\", marginLeft: \"20px\", border: '1px solid gray', borderRadius: '50%', marginBottom: \"5px\"}} onClick={this.doEdit}></IoJet>\r\n </div>\r\n <div className='projectList'>\r\n <ProjectList projects={this.state.projects}>\r\n </ProjectList>\r\n </div>\r\n </div>\r\n )\r\n }", "ready() {\n super.ready(); // attach event listener to folder box that will display the correct card when filename is clicked. \n\n this.addEventListener('showCard', e => {\n this.processCard(e);\n });\n this.__contentSlot__ = this.shadowRoot.querySelectorAll('slot')[1];\n this.__contentSlot__ = this.shadowRoot.querySelector('slot[name=folder-content]');\n this.__cards__ = this.__contentSlot__.assignedNodes()[0].querySelectorAll('cool-card');\n this.initMap();\n }", "function Userard(props) {\n return (\n <div className=\"UserCard\">\n <img src={require(`../../assets/images/profile/${Math.floor(Math.random() * 3) + 1}.png`)} className=\"UserImg\" alt={props.user.firstName}/>\n <div>\n <p>{props.user.firstName} {props.user.lastName}</p>\n <p style={{fontSize: \"12px\", marginTop:\"10px\"}}>{props.user.email}</p>\n </div>\n </div>\n );\n}", "function AboutCard (){\n return (\n \n <Card style={{ width: '70rem' }}>\n <Card.Img variant=\"top\" src={Image} id=\"AboutMe\" />\n <Card.Body>\n <Card.Text>\n <AboutMe/>\n </Card.Text>\n </Card.Body>\n</Card>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n <Header/>\n <Home/>\n {/* <Card/> */}\n </div>\n );\n}", "match (originalTag, { kebabTag, camelTag }) {\n if (kebabTag.startsWith('core-')) {\n return [camelTag, `import ${camelTag} from '@/components/core/${camelTag.substring(4)}.vue'`]\n }\n }", "render() {\n return (\n <div className=\"container\">\n <div className=\"header\">\n <span>CGI</span> Test Pontus Gavelin\n </div>\n <div className=\"cardBody\">\n {\n this.state.cards.map((card) => {\n return(\n <BusinessCard name={card.name} surName={card.surName} telephone={card.telephone} email={card.email} img={card.img}/>\n )\n })\n }\n </div>\n <div className=\"footer\">\n <BusinessCardForm />\n </div>\n </div>\n );\n }", "function ResourceCard(_ref) {\n var onClick = _ref.onClick,\n created = _ref.created,\n name = _ref.name,\n _ref$Icon = _ref.Icon,\n Icon = _ref$Icon === void 0 ? src_Icon[\"p\" /* FileCode */] : _ref$Icon,\n _ref$buttonTitle = _ref.buttonTitle,\n buttonTitle = _ref$buttonTitle === void 0 ? 'EDIT' : _ref$buttonTitle;\n var displayCreated = Object(dateUtils[\"b\" /* displayDateTime */])(created);\n return /*#__PURE__*/react_default.a.createElement(src[\"i\" /* Card */], {\n width: \"260px\",\n bg: \"primary.light\",\n px: \"4\",\n py: \"4\",\n mb: 4,\n mr: 4\n }, /*#__PURE__*/react_default.a.createElement(src[\"l\" /* Flex */], {\n width: \"100%\",\n textAlign: \"center\",\n flexDirection: \"column\",\n justifyContent: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"h6\",\n mb: \"1\"\n }, name), /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"body2\",\n color: \"text.primary\"\n }, \"CREATED: \", displayCreated)), /*#__PURE__*/react_default.a.createElement(src[\"l\" /* Flex */], {\n alignItems: \"center\",\n justifyContent: \"center\",\n flexDirection: \"column\"\n }, /*#__PURE__*/react_default.a.createElement(Icon, {\n fontSize: \"50px\",\n my: 4\n }), /*#__PURE__*/react_default.a.createElement(src[\"f\" /* ButtonPrimary */], {\n mt: 3,\n size: \"medium\",\n onClick: onClick,\n block: true\n }, buttonTitle)));\n}", "function Card(props) {\n return (\n <div class=\"card\">\n <CardImage\n src={`https://robohash.org/${props.robot.name}?size=200x200`}\n />\n <CardBody>\n <CardTitle title={props.robot.name} />\n <CardText>{props.robot.occupation}</CardText>\n </CardBody>\n </div>\n );\n}" ]
[ "0.5994047", "0.5911598", "0.5815382", "0.57075834", "0.56326747", "0.5627799", "0.5625638", "0.55765307", "0.55422103", "0.5539443", "0.54699254", "0.54436934", "0.5421947", "0.5317393", "0.53070426", "0.5304003", "0.5299108", "0.52889216", "0.52782947", "0.5244845", "0.5166024", "0.51554376", "0.5154084", "0.51070106", "0.5064099", "0.50528413", "0.5050416", "0.5021629", "0.4993894", "0.4984995", "0.49805802", "0.49788114", "0.4971302", "0.4955287", "0.49508017", "0.49144", "0.4909504", "0.48810628", "0.48720837", "0.48717502", "0.48452532", "0.4843491", "0.4837595", "0.4813238", "0.48041314", "0.4794438", "0.4793973", "0.47929037", "0.4792057", "0.47910443", "0.47578737", "0.47578406", "0.47566634", "0.475286", "0.4750531", "0.47482654", "0.47376603", "0.4734059", "0.47339922", "0.47327358", "0.47239798", "0.47169775", "0.46917328", "0.46866685", "0.46820953", "0.46698058", "0.46696067", "0.46694988", "0.46617195", "0.4659891", "0.46565923", "0.46555042", "0.46531907", "0.46477473", "0.46439734", "0.46405458", "0.4640193", "0.46375248", "0.46348786", "0.4633793", "0.46300492", "0.46278328", "0.46278328", "0.46277863", "0.46235764", "0.46224996", "0.4618377", "0.46060565", "0.45978686", "0.4597862", "0.45895204", "0.45830446", "0.45764095", "0.45741388", "0.45638555", "0.45625082", "0.45602742", "0.45555168", "0.4555496", "0.45545566" ]
0.48543012
40
Create a new instance
constructor(path, value, uid, id) { this.path = path; this.value = value; this.uid = uid ? uid : null; this.id = id ? id : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static create () {}", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "create() {}", "create() {}", "create () {}", "create () {}", "function _createInstance(instance) {\n return Object.assign({\n id: app.id('i'),\n name: 'New',\n active: true,\n pending: 0,\n original: null,\n code: '',\n dirty: false,\n connections: [],\n connection: null,\n created: new Date().getTime()\n }, instance);\n }", "create() {\n return this.new();\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "constructor() {\n copy(this, create());\n }", "create() {\n\t}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "function createInstance() {\n return axios.create(getInstanceOptions());\n }", "async createNewInstance() {\n const adapters = this.processAdapters();\n const datastores = this.api.config.models.datastores;\n const models = await this.loadModels();\n\n const ormStart = promisify(Waterline.start);\n\n this.waterline = await ormStart({\n adapters,\n datastores,\n models,\n });\n }", "function construct() { }", "create() {\n\n }", "create() {\n\n }", "create() {\n\n }", "function CTOR() {\n this.name = 'Instance';\n}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "static create (input) {\n // SCHEMA: this is the ideal place to throw on schema failure\n // const input = this.validate(input, Message.create)\n\n const instance = new this()\n Object.assign(instance, input)\n return instance\n }", "constructur() {}", "function createInstance() {\n var postgresDatabase = new Object(\"Database instance initialized!\");\n return postgresDatabase;\n }", "create(){\n\n }", "createInstance(type, props, rootContainerInstance, hostContext) {\n return createInstance(type, props, rootContainerInstance, hostContext);\n }", "function Factory(){}", "function createInstance(module, args) {\n\t\t\t// We'll either use the module directly, or we need\n\t\t\t// to instantiate/invoke it.\n\t\t\treturn typeof module == 'function'\n\t\t\t\t? instantiate(module, args, isConstructor)\n\t\t\t\t: Object.create(module);\n\t\t}", "create() {\n super.create()\n\n this.instanceCreate(Platform, 350, 450)\n\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n\n this.instanceCreate(Solid)\n this.instanceCreate(RainbowDash)\n\n this.instanceCreate(Player, 200, 600)\n }", "initializeInstance(options) {}", "consructor() {\n }", "constructor (data) {\n super(data, InstanceModel)\n }", "construct (target, args) {\n return new target(...args)\n }", "function DUPairFactory() {\n}", "function create() {\n\n}", "constructor (){}", "createInstance(type, props, internalInstanceHandle) {\n // 'internalInstanceHandle' is not transparent here. So use host context methods\n // to get data from roots\n return createElement(type, props)\n }", "constructor() {\n\t\tif (!instance) { instance = this }\n\n\t\treturn instance\n\t}", "create(data, params) {}", "static new() {\n let g = new this();\n g.init();\n return g;\n }", "constructor( ) {}", "static createInstance(){\n if(this.instance == null){\n this.instance = new ClientLayer();\n }\n }", "function NewObj(){}", "static create() {\n\t\tlet name, muts, tag, attr\n\n\t\tcl(`Creating new atom. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » `.green, atomName => {\n\t\t\tname = atomName;\n\n\t\t\trl.question(`Mutates » `.green, atomMutate => {\n\t\t\t\tmuts = atomMutate.split(' ');\n\n\t\t\t\trl.question(`Tag » `.green, atomTag => {\n\t\t\t\t\ttag = atomTag;\n\n\t\t\t\t\trl.question(`Attributes » `.green, atomAttr => {\n\t\t\t\t\t\tattr = atomAttr.split(' ');\n\n\t\t\t\t\t\tvar atom = new Atom(name, muts, tag, attr);\n\n\t\t\t\t\t\tAtom.save(atom);\n\t\t\t\t\t\trl.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function factory() {}", "function factory() {}", "function callCreate(object){ object.create(); }", "static create(name){\n return new Car(name)\n }", "function Instance() {\n this.model = new ManagementModel(this);\n this.controller = new ManagementController(this);\n}", "function instantiate(type, id, pane, options) {\n // get turtle specification\n var turtle = turtles[type];\n if(turtle == null){\n log.error(\"TURTLES - Type (\" + type + \") is not registered\");\n return;\n }\n log.info(\"TURTLES - Instantiate #\"+ id + \" (type: \"+ type+ \", pane: #\" + pane + \")\");\n\n // perpare instance object\n var instance = {};\n instance.type = type;\n instance.id = parseInt(id);\n instance.pane = pane;\n instance.el = options.el;\n options.id = id;\n\n\n // assign model\n instance.model = turtle.model || Backbone.Model.extend();\n\n // build and assign collection\n if (typeof turtle.collection == \"function\") {\n instance.collection = new turtle.collection(turtle.models, _.extend(options, {\n model : instance.model\n }));\n\n if (instance.collection.model == null)\n instance.collection.model = instance.model;\n\n // link options\n instance.collection.options = options;\n }\n\n // build and assign view\n if (typeof turtle.view == \"function\") {\n instance.view = new turtle.view(_.extend(options, {\n collection : instance.collection,\n model : instance.model,\n el : options.el\n }));\n\n // link options\n instance.view.options = options;\n }\n\n // trigger born event\n if (typeof instance.collection == \"object\")\n instance.collection.trigger(\"born\");\n if (typeof instance.view == \"object\")\n instance.view.trigger(\"born\");\n\n // save instance\n instances[id] = instance;\n return instance;\n }", "static create() {\nreturn this.from_xyzw(0, 0, 0, 1);\n}", "function NewObject() {\n\t// returns an object\n}", "function createInstance(someClass, conf) {\n\treturn Object.create(someClass).constructor(conf);\n}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor() {\n\t\t// ...\n\t}", "constructor(name){\n // if(Person.instance){\n // return Person.instance;\n // }\n // Person.instance = this;\n this.name = name;\n }", "function newInstance(modelName, instanceData) {\n if (!modelName) throw '--- modelName is undefined ---';\n if (!ModelManager.exists(modelName)) throw ' --- throw modelName ' + modelName + ' is undefined --- ';\n var instanceId = ++lastId;\n var instanceContext = new instanceObj(instanceId, modelName, instanceData, new Set());\n instanceMap[instanceId] = instanceContext;\n return instanceContext;\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "function Ctor() {}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "static async createInstance(db = \"test\") {\n const clazz = new DatabaseConnection();\n await clazz.initialize(db);\n return clazz;\n }", "function createInstance(){\n\t\tapp.debug(\"New presenter instance was created\");\n\n\t\t// Set latency to 100ms (Equal with streamer)\n\t\tpresenterInstance = new ScarletsMediaPresenter({\n\t\t\tmimeType: self.toServerSpeaker ? 'audio/wav' : undefined,\n\t\t audio:{\n\t\t channelCount:2,\n\t\t sampleRate:48000,\n\t\t echoCancellation: false\n\t\t },\n\t\t debug:true\n\t\t}, self.toServerSpeaker ? 1000 : 100);\n\n\t\tpresenterInstance.onRecordingReady = function(packet){\n\t\t app.debug(\"Recording started!\");\n\t\t app.debug(\"Header size:\", packet.data.size, 'bytes');\n\t\t app.debug('Mimetype:', presenterInstance.mediaRecorder.mimeType)\n\n\t\t self.bufferHeader = packet;\n\n\t\t\t// Immediately send to the server when presenter ready\n\t\t\tapp.debug(\"Sending bufferHeader to the server\");\n\t\t\tsocket.emit('bufferHeader', packet);\n\t\t}\n\n\t\tpresenterInstance.onBufferProcess = function(streamData){\n\t\t\tself.broadcastBytes = streamData[0].size;\n\n\t\t\tif(self.toServerSpeaker)\n\t\t\t socket.emit('bufferStream', streamData);\n\t\t\telse\n\t\t\t socket.emit('bufferToFile', streamData);\n\t\t}\n\t}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}" ]
[ "0.76954013", "0.7324774", "0.7269754", "0.7269754", "0.7236284", "0.7236284", "0.72130114", "0.7172156", "0.69614613", "0.6917826", "0.68730485", "0.67519486", "0.67519486", "0.67519486", "0.67519486", "0.67519486", "0.67519486", "0.66620797", "0.66467375", "0.661923", "0.66100407", "0.66100407", "0.66100407", "0.65854865", "0.65791243", "0.65791243", "0.65791243", "0.6528953", "0.65248835", "0.65055513", "0.64333427", "0.6418165", "0.6375542", "0.63717407", "0.63008463", "0.63004935", "0.62938756", "0.62840474", "0.62789017", "0.62610024", "0.62553114", "0.62021", "0.6188069", "0.61803764", "0.6169563", "0.6164924", "0.61574346", "0.61525023", "0.61306375", "0.6130297", "0.612004", "0.612004", "0.6114097", "0.6099742", "0.60857964", "0.6081674", "0.60789156", "0.60784346", "0.60572296", "0.6052095", "0.6052095", "0.6052095", "0.6052095", "0.6052095", "0.6052095", "0.6052095", "0.60496616", "0.6047222", "0.6015535", "0.60109", "0.60109", "0.6010426", "0.59934175", "0.59934175", "0.59934175", "0.59934175", "0.5991541", "0.59780663", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753", "0.5956753" ]
0.0
-1
Process this token with a regex and return true if it matched. If possible, extract a uid for this token from the path.
match(id, regex) { var match = false; var matches = this.path.match(regex); if (matches) { this.id = id; if (matches.length > 1) { this.uid = matches[1]; } match = true; } return match; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lookup( path ) {\n\t\t\tvar i, re,\n\t\t\t\tdata = properties[ path.join( \"/\" ) ];\n\n\t\t\tfor ( i in data ) {\n\t\t\t\tre = new RegExp( \"^\" + data[ i ] );\n\t\t\t\tif ( re.test( value ) ) {\n\t\t\t\t\ttoken.value = i;\n\t\t\t\t\treturn tokenRe = new RegExp( data[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "_extractUserIdentifier(path) {\n\n\t\tlet extractor = (path.startsWith('/profile.php?') ? /(?:\\?id=[0-9]+)/ : /\\/([^\\/?]+)[\\/?]?/);\n\t\tlet parts = path.match(extractor);\n\n\t\tif (parts && parts.length > 1) {\n\t\t\treturn parts[1]\n\t\t}\n\t\treturn path;\n\t}", "match(path,pathname) {\n let keys=[];\n if(path instanceof RegExp){\n let match = pathname.match(path);\n return !match ? null : {\n token:match,\n keys:[]\n }\n } else {\n let token = pathToRegexp(path,keys).exec(pathname);\n return token == null ? null: {\n token:token,\n keys:keys\n }\n }\n }", "regexToken() {\r\n\t\t\t\tvar body, closed, comment, commentIndex, commentOpts, commentTokens, comments, delimiter, end, flags, fullMatch, index, leadingWhitespace, match, matchedComment, origin, prev, ref, ref1, regex, tokens;\r\n\t\t\t\tswitch (false) {\r\n\t\t\t\t\tcase !(match = REGEX_ILLEGAL.exec(this.chunk)):\r\n\t\t\t\t\t\tthis.error(`regular expressions cannot begin with ${match[2]}`, {\r\n\t\t\t\t\t\t\toffset: match.index + match[1].length\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !(match = this.matchWithInterpolations(HEREGEX, '///')):\r\n\t\t\t\t\t\t({tokens, index} = match);\r\n\t\t\t\t\t\tcomments = [];\r\n\t\t\t\t\t\twhile (matchedComment = HEREGEX_COMMENT.exec(this.chunk.slice(0, index))) {\r\n\t\t\t\t\t\t\t({\r\n\t\t\t\t\t\t\t\tindex: commentIndex\r\n\t\t\t\t\t\t\t} = matchedComment);\r\n\t\t\t\t\t\t\t[fullMatch, leadingWhitespace, comment] = matchedComment;\r\n\t\t\t\t\t\t\tcomments.push({\r\n\t\t\t\t\t\t\t\tcomment,\r\n\t\t\t\t\t\t\t\toffsetInChunk: commentIndex + leadingWhitespace.length\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcommentTokens = flatten((function() {\r\n\t\t\t\t\t\t\tvar j, len, results;\r\n\t\t\t\t\t\t\tresults = [];\r\n\t\t\t\t\t\t\tfor (j = 0, len = comments.length; j < len; j++) {\r\n\t\t\t\t\t\t\t\tcommentOpts = comments[j];\r\n\t\t\t\t\t\t\t\tresults.push(this.commentToken(commentOpts.comment, Object.assign(commentOpts, {\r\n\t\t\t\t\t\t\t\t\theregex: true,\r\n\t\t\t\t\t\t\t\t\treturnCommentTokens: true\r\n\t\t\t\t\t\t\t\t})));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn results;\r\n\t\t\t\t\t\t}).call(this));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !(match = REGEX.exec(this.chunk)):\r\n\t\t\t\t\t\t[regex, body, closed] = match;\r\n\t\t\t\t\t\tthis.validateEscapes(body, {\r\n\t\t\t\t\t\t\tisRegex: true,\r\n\t\t\t\t\t\t\toffsetInChunk: 1\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tindex = regex.length;\r\n\t\t\t\t\t\tprev = this.prev();\r\n\t\t\t\t\t\tif (prev) {\r\n\t\t\t\t\t\t\tif (prev.spaced && (ref = prev[0], indexOf.call(CALLABLE, ref) >= 0)) {\r\n\t\t\t\t\t\t\t\tif (!closed || POSSIBLY_DIVISION.test(regex)) {\r\n\t\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else if (ref1 = prev[0], indexOf.call(NOT_REGEX, ref1) >= 0) {\r\n\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!closed) {\r\n\t\t\t\t\t\t\tthis.error('missing / (unclosed regex)');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\t[flags] = REGEX_FLAGS.exec(this.chunk.slice(index));\r\n\t\t\t\tend = index + flags.length;\r\n\t\t\t\torigin = this.makeToken('REGEX', null, {\r\n\t\t\t\t\tlength: end\r\n\t\t\t\t});\r\n\t\t\t\tswitch (false) {\r\n\t\t\t\t\tcase !!VALID_FLAGS.test(flags):\r\n\t\t\t\t\t\tthis.error(`invalid regular expression flags ${flags}`, {\r\n\t\t\t\t\t\t\toffset: index,\r\n\t\t\t\t\t\t\tlength: flags.length\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !(regex || tokens.length === 1):\r\n\t\t\t\t\t\tdelimiter = body ? '/' : '///';\r\n\t\t\t\t\t\tif (body == null) {\r\n\t\t\t\t\t\t\tbody = tokens[0][1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.validateUnicodeCodePointEscapes(body, {delimiter});\r\n\t\t\t\t\t\tthis.token('REGEX', `/${body}/${flags}`, {\r\n\t\t\t\t\t\t\tlength: end,\r\n\t\t\t\t\t\t\torigin,\r\n\t\t\t\t\t\t\tdata: {delimiter}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.token('REGEX_START', '(', {\r\n\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\torigin,\r\n\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.token('IDENTIFIER', 'RegExp', {\r\n\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.token('CALL_START', '(', {\r\n\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.mergeInterpolationTokens(tokens, {\r\n\t\t\t\t\t\t\tdouble: true,\r\n\t\t\t\t\t\t\theregex: {flags},\r\n\t\t\t\t\t\t\tendOffset: end - flags.length,\r\n\t\t\t\t\t\t\tquote: '///'\r\n\t\t\t\t\t\t}, (str) => {\r\n\t\t\t\t\t\t\treturn this.validateUnicodeCodePointEscapes(str, {delimiter});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tif (flags) {\r\n\t\t\t\t\t\t\tthis.token(',', ',', {\r\n\t\t\t\t\t\t\t\toffset: index - 1,\r\n\t\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tthis.token('STRING', '\"' + flags + '\"', {\r\n\t\t\t\t\t\t\t\toffset: index,\r\n\t\t\t\t\t\t\t\tlength: flags.length\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.token(')', ')', {\r\n\t\t\t\t\t\t\toffset: end,\r\n\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.token('REGEX_END', ')', {\r\n\t\t\t\t\t\t\toffset: end,\r\n\t\t\t\t\t\t\tlength: 0,\r\n\t\t\t\t\t\t\tgenerated: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\t// Explicitly attach any heregex comments to the REGEX/REGEX_END token.\r\n\t\t\t\tif (commentTokens != null ? commentTokens.length : void 0) {\r\n\t\t\t\t\taddTokenData(this.tokens[this.tokens.length - 1], {\r\n\t\t\t\t\t\theregexCommentTokens: commentTokens\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn end;\r\n\t\t\t}", "function match(currentToken, expectedToken) {\n if (currentToken.value.match(expectedToken.pattern)) {\n\n return true;\n\n } else {\n\n false;\n\n }\n }", "match(input) {\n var pos = input.pos\n if(this.match_category(input)) return this.token(input,pos,input.substring(pos,input.pos))\n return this.error(input, pos)\n }", "matchToken(type) {\n\t\t\treturn this.getToken().type === type;\n\t\t}", "function userId(token){\n\tif(token) return token.split('.')[0];\n\treturn false;\n}", "function getParseRegexForToken(token, config) {\n var a;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return parseTokenFourDigits;\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'ww':\n case 'W':\n case 'WW':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return parseTokenFourDigits;\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'ww':\n case 'W':\n case 'WW':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token, config) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token, config) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token, config) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'YYYYY':\n return parseTokenSixDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "static isValidToken (token) {\n\t\tif (!token || typeof token !== \"string\" || !token.trim()) return false;\n\t\treturn !!/{::[^:]+::}/.exec(token);\n\t}", "mat(argumentIndex = 1) {\n\t\tconst args = this.content.split(/\\s/);\n\t\tconst toCheck = args[argumentIndex];\n\t\tif (!toCheck) return;\n\t\tconst userID = toCheck.includes(\"<@\")\n\t\t\t? toCheck.trim().substr(2, 20)\n\t\t\t: toCheck;\n\t\treturn userID;\n\t}", "shouldParse(line) {\n return this.pattern.test(line);\n }", "function getParseRegexForToken(token) {\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n return parseTokenFourDigits;\n case 'S':\n case 'SS':\n case 'SSS':\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'ddd':\n case 'dddd':\n case 'a':\n case 'A':\n return parseTokenWord;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'MM':\n case 'DD':\n case 'dd':\n case 'YY':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n return parseTokenOneOrTwoDigits;\n default :\n return new RegExp(token.replace('\\\\', ''));\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n case 'DDD':\n return strict ? parseTokenThreeDigits : parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return strict ? parseTokenOneDigit : parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "checkToken(toMatch) {\n let s = this.checkNext();\n return (s === toMatch);\n }", "match(input) {\n if(input.eoi()) return this.error(input, input.pos)\n var count = 0\n var pos = input.pos\n while(this.match_one(input)) count++\n if(count == 0 ) return this.error(input, input.pos)\n return this.token(input,pos,input.substring(pos, input.pos))\n }", "function getParseRegexForToken(token, config) {\n\t var a, strict = config._strict;\n\t switch (token) {\n\t case 'Q':\n\t return parseTokenOneDigit;\n\t case 'DDDD':\n\t return parseTokenThreeDigits;\n\t case 'YYYY':\n\t case 'GGGG':\n\t case 'gggg':\n\t return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n\t case 'Y':\n\t case 'G':\n\t case 'g':\n\t return parseTokenSignedNumber;\n\t case 'YYYYYY':\n\t case 'YYYYY':\n\t case 'GGGGG':\n\t case 'ggggg':\n\t return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n\t case 'S':\n\t if (strict) {\n\t return parseTokenOneDigit;\n\t }\n\t /* falls through */\n\t case 'SS':\n\t if (strict) {\n\t return parseTokenTwoDigits;\n\t }\n\t /* falls through */\n\t case 'SSS':\n\t if (strict) {\n\t return parseTokenThreeDigits;\n\t }\n\t /* falls through */\n\t case 'DDD':\n\t return parseTokenOneToThreeDigits;\n\t case 'MMM':\n\t case 'MMMM':\n\t case 'dd':\n\t case 'ddd':\n\t case 'dddd':\n\t return parseTokenWord;\n\t case 'a':\n\t case 'A':\n\t return config._locale._meridiemParse;\n\t case 'X':\n\t return parseTokenTimestampMs;\n\t case 'Z':\n\t case 'ZZ':\n\t return parseTokenTimezone;\n\t case 'T':\n\t return parseTokenT;\n\t case 'SSSS':\n\t return parseTokenDigits;\n\t case 'MM':\n\t case 'DD':\n\t case 'YY':\n\t case 'GG':\n\t case 'gg':\n\t case 'HH':\n\t case 'hh':\n\t case 'mm':\n\t case 'ss':\n\t case 'ww':\n\t case 'WW':\n\t return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n\t case 'M':\n\t case 'D':\n\t case 'd':\n\t case 'H':\n\t case 'h':\n\t case 'm':\n\t case 's':\n\t case 'w':\n\t case 'W':\n\t case 'e':\n\t case 'E':\n\t return parseTokenOneOrTwoDigits;\n\t case 'Do':\n\t return parseTokenOrdinal;\n\t default :\n\t a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n\t return a;\n\t }\n\t }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function checkToken(url, urlObj) {\r\n var ret = true;\r\n var tokenUrlPathes = [urlDefault, urlUpload, \".html\", \".htm\", \".stl\"];\r\n if (!urlObj) {\r\n urlObj = urlParser.parse(url, true);\r\n } \r\n var urlPath = urlObj[\"pathname\"];\r\n\r\n for (var i=0; i < tokenUrlPathes.length; i++) {\r\n var pos = urlPath.lastIndexOf(tokenUrlPathes[i]);\r\n //console.log(\">>> token pos = \" + pos);\r\n if (pos >= 0 && pos == (urlPath.length - tokenUrlPathes[i].length)) {\r\n if (!(\"query\" in urlObj && \"token\" in urlObj[\"query\"])) {\r\n ret = false;\r\n }\r\n break;\r\n } \r\n }\r\n console.log(\">>> check token result = \" + ret);\r\n return ret;\r\n}", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) { return parseTokenOneDigit; }\n /* falls through */\n case 'SS':\n if (strict) { return parseTokenTwoDigits; }\n /* falls through */\n case 'SSS':\n if (strict) { return parseTokenThreeDigits; }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return getLangDefinition(config._l)._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default:\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), \"i\"));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return parseTokenOrdinal;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "match_one(input) {\n if(input.eoi()) return false\n var c = input.current()\n if(this.symbol.indexOf(c)>=0) return false\n var start = input.pos\n if(c=='\\\\') {\n c = input.next()\n if(input.eoi()) return this.match_error(input, start)\n if(c=='u') {\n c = input.next()\n var counter = 0\n while(!input.eoi() && counter<4 && (('0'<=c && c<='9') || \n ('A'<=c && c<='F') || ('a'<=c && c<='f'))){\n c = input.next()\n counter++\n }\n if(counter!=4) return this.match_error(input, start)\n }else if(this.escape.indexOf(c)<0) return this.match_error(input, start)\n }\n input.next()\n return true\n }", "function extractToken(token) {\n var regex = /^Bearer\\s(\\S+)$/i;\n var result = regex.exec(token);\n return result ? result[1] : false;\n}", "function _match(tok) {\n var match, length, c, endIndex;\n\n // Non-terminal\n if (tok instanceof Function) {\n return tok.call(parser.parsers);\n // Terminal\n // Either match a single character in the input,\n // or match a regexp in the current chunk (chunk[j]).\n } else if (typeof(tok) === 'string') {\n match = input.charAt(i) === tok ? tok : null;\n length = 1;\n sync();\n } else {\n sync();\n\n match = tok.exec(chunks[j]);\n if (match) {\n length = match[0].length;\n } else {\n return null;\n }\n }\n\n // The match is confirmed, add the match length to `i`,\n // and consume any extra white-space characters (' ' || '\\n')\n // which come after that. The reason for this is that LeSS's\n // grammar is mostly white-space insensitive.\n if (match) {\n var mem = i += length;\n endIndex = i + chunks[j].length - length;\n\n while (i < endIndex) {\n c = input.charCodeAt(i);\n if (!(c === 32 || c === 10 || c === 9)) {\n break;\n }\n i++;\n }\n chunks[j] = chunks[j].slice(length + (i - mem));\n current = i;\n\n if (chunks[j].length === 0 && j < chunks.length - 1) {\n j++;\n }\n\n if (typeof(match) === 'string') {\n return match;\n } else {\n return match.length === 1 ? match[0] : match;\n }\n }\n }", "matches(str) {\n if (str[0] == '@') return (str.slice(1) == this.info.name);\n return (str == this.info.hash);\n }", "@computed get locationMatchRegexp() {\n return new RegExp('/\\\\d+/students/\\\\w+/' + this.id);\n }", "handleIdent(context) {\n var rules = context.language.namedIdentRules;\n var caseInsensitive = context.language.caseInsensitive;\n\n var isNamedIdent = rules.custom.some(function (rule) {\n return rule(context);\n }) || rules.precedes.some(function (rule) {\n return (0, _rulesProcessor.IsPrecedesRuleSatisfied)(context.getTokenWalker(), rule, caseInsensitive);\n }) || rules.follows.some(function (rule) {\n return (0, _rulesProcessor.IsFollowsRuleSatisfied)(context.getTokenWalker(), rule, caseInsensitive);\n }) || rules.between.some(function (rule) {\n return (0, _rulesProcessor.IsBetweenRuleSatisfied)(context.getTokenWalker(), rule.opener, rule.closer, caseInsensitive);\n });\n\n if (isNamedIdent) _analyzer.Analyzer.defaultHandleToken(\"named-ident\")(context);else super.handleToken(context);\n\n return true;\n }", "function match(uiname, uipath) {\n var path = removeMetadata(uipath.slice(1, -1));\n var found = path.indexOf(uiname) >= 0;\n //console.log(`> match(${uiname},${path} [${uipath}]) -> ${found}`);\n return found;\n}", "function match(regex, userAgent) {\n\t return regex.test(userAgent);\n\t }", "match(input) {\n if(this.startsWith(input.current())) {\n var c = input.current()\n input.next()\n return this.token(input,input.pos-1,c)\n }\n else return this.error(input,input.pos)\n }", "matchesContext(context) {\n if (context.indexOf(\"|\") > -1)\n return context.split(/\\s*\\|\\s*/).some(this.matchesContext, this);\n let parts = context.split(\"/\");\n let option = this.options.context;\n let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);\n let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);\n let match = (i, depth) => {\n for (; i >= 0; i--) {\n let part = parts[i];\n if (part == \"\") {\n if (i == parts.length - 1 || i == 0)\n continue;\n for (; depth >= minDepth; depth--)\n if (match(i - 1, depth))\n return true;\n return false;\n } else {\n let next = depth > 0 || depth == 0 && useRoot ? this.nodes[depth].type : option && depth >= minDepth ? option.node(depth - minDepth).type : null;\n if (!next || next.name != part && next.groups.indexOf(part) == -1)\n return false;\n depth--;\n }\n }\n return true;\n };\n return match(parts.length - 1, this.open);\n }", "match(input) {\n var pos = input.pos\n if(!this.match_one(input)) return this.error(input, input.pos)\n var c = input.current()\n if(c!='-') return this.error(input, input.pos)\n input.next()\n if(!this.match_one(input)) return this.error(input, input.pos)\n return this.token(input,pos,input.substring(pos, input.pos)) \n }", "function getParseRegexForToken(token, config) {\n\t\tvar a, strict = config._strict;\n\t\tswitch (token) {\n\t\t\tcase 'Q':\n\t\t\t\treturn parseTokenOneDigit;\n\t\t\tcase 'DDDD':\n\t\t\t\treturn parseTokenThreeDigits;\n\t\t\tcase 'YYYY':\n\t\t\tcase 'GGGG':\n\t\t\tcase 'gggg':\n\t\t\t\treturn strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n\t\t\tcase 'Y':\n\t\t\tcase 'G':\n\t\t\tcase 'g':\n\t\t\t\treturn parseTokenSignedNumber;\n\t\t\tcase 'YYYYYY':\n\t\t\tcase 'YYYYY':\n\t\t\tcase 'GGGGG':\n\t\t\tcase 'ggggg':\n\t\t\t\treturn strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n\t\t\tcase 'S':\n\t\t\t\tif (strict) {\n\t\t\t\t\treturn parseTokenOneDigit;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase 'SS':\n\t\t\t\tif (strict) {\n\t\t\t\t\treturn parseTokenTwoDigits;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase 'SSS':\n\t\t\t\tif (strict) {\n\t\t\t\t\treturn parseTokenThreeDigits;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase 'DDD':\n\t\t\t\treturn parseTokenOneToThreeDigits;\n\t\t\tcase 'MMM':\n\t\t\tcase 'MMMM':\n\t\t\tcase 'dd':\n\t\t\tcase 'ddd':\n\t\t\tcase 'dddd':\n\t\t\t\treturn parseTokenWord;\n\t\t\tcase 'a':\n\t\t\tcase 'A':\n\t\t\t\treturn config._locale._meridiemParse;\n\t\t\tcase 'x':\n\t\t\t\treturn parseTokenOffsetMs;\n\t\t\tcase 'X':\n\t\t\t\treturn parseTokenTimestampMs;\n\t\t\tcase 'Z':\n\t\t\tcase 'ZZ':\n\t\t\t\treturn parseTokenTimezone;\n\t\t\tcase 'T':\n\t\t\t\treturn parseTokenT;\n\t\t\tcase 'SSSS':\n\t\t\t\treturn parseTokenDigits;\n\t\t\tcase 'MM':\n\t\t\tcase 'DD':\n\t\t\tcase 'YY':\n\t\t\tcase 'GG':\n\t\t\tcase 'gg':\n\t\t\tcase 'HH':\n\t\t\tcase 'hh':\n\t\t\tcase 'mm':\n\t\t\tcase 'ss':\n\t\t\tcase 'ww':\n\t\t\tcase 'WW':\n\t\t\t\treturn strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n\t\t\tcase 'M':\n\t\t\tcase 'D':\n\t\t\tcase 'd':\n\t\t\tcase 'H':\n\t\t\tcase 'h':\n\t\t\tcase 'm':\n\t\t\tcase 's':\n\t\t\tcase 'w':\n\t\t\tcase 'W':\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\t\treturn parseTokenOneOrTwoDigits;\n\t\t\tcase 'Do':\n\t\t\t\treturn strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n\t\t\tdefault:\n\t\t\t\ta = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n\t\t\t\treturn a;\n\t\t}\n\t}", "function validateToken(token, callback) {\n\t\tvar db = firebase.database();\n\t\tvar refUserToken = db.ref(\"user_token/\" + token);\n\n\t\tconsole.log('url: ' + 'user_token/' + token)\n\n\t\t// Reference user_token\n\t\tdb.ref('user_token/' + token).once('value').then(function(snapshot) {\n\t\t\tif(snapshot.val()) {\n\t\t\t\tcallback(snapshot.val().id_user);\t\n\t\t\t} else {\n\t\t\t\tcallback(null);\n\t\t\t}\n \t\t});\n\t}", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function _nodeMatch(state, pattern, value, flags) {\n if (!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}", "match(tokens, result){\n //\n //Deconstruct the tokens to obtain value for testing\n const {token} = tokens;\n //\n //Test for the match of the value aganist the toekn.\n if(super.match(token) && token.type === this.type){\n //\n //They match, return true.\n return true;\n }\n //\n //Compile the error massege.\n result.msg = `Expected ${this.type}`;\n //\n //Set the index position.\n result.index = token.index;\n //\n //Rerune false.They don't match.\n return false;\n \n }", "inRegexp(result, regexp) {\n if (!this.isRegexp(regexp)) {\n return false;\n }\n regexp = this.toRegexp(regexp);\n return regexp.test(result);\n }", "function _nodeMatch(state, pattern, value, flags) {\n if(!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}", "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokens.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokenValues.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokenValues.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function getParseRegexForToken(token, config) {\n var a, strict = config._strict;\n switch (token) {\n case 'Q':\n return parseTokenOneDigit;\n case 'DDDD':\n return parseTokenThreeDigits;\n case 'YYYY':\n case 'GGGG':\n case 'gggg':\n return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n case 'Y':\n case 'G':\n case 'g':\n return parseTokenSignedNumber;\n case 'YYYYYY':\n case 'YYYYY':\n case 'GGGGG':\n case 'ggggg':\n return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n case 'S':\n if (strict) {\n return parseTokenOneDigit;\n }\n /* falls through */\n case 'SS':\n if (strict) {\n return parseTokenTwoDigits;\n }\n /* falls through */\n case 'SSS':\n if (strict) {\n return parseTokenThreeDigits;\n }\n /* falls through */\n case 'DDD':\n return parseTokenOneToThreeDigits;\n case 'MMM':\n case 'MMMM':\n case 'dd':\n case 'ddd':\n case 'dddd':\n return parseTokenWord;\n case 'a':\n case 'A':\n return config._locale._meridiemParse;\n case 'x':\n return parseTokenOffsetMs;\n case 'X':\n return parseTokenTimestampMs;\n case 'Z':\n case 'ZZ':\n return parseTokenTimezone;\n case 'T':\n return parseTokenT;\n case 'SSSS':\n return parseTokenDigits;\n case 'MM':\n case 'DD':\n case 'YY':\n case 'GG':\n case 'gg':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n case 'ww':\n case 'WW':\n return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n case 'M':\n case 'D':\n case 'd':\n case 'H':\n case 'h':\n case 'm':\n case 's':\n case 'w':\n case 'W':\n case 'e':\n case 'E':\n return parseTokenOneOrTwoDigits;\n case 'Do':\n return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n default :\n a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n return a;\n }\n }", "function match(token, userChoice) {\n\n return token.lowerFace === userChoice\n}", "function getParseRegexForToken(token, config) {\n\t var a,\n\t strict = config._strict;\n\t switch (token) {\n\t case 'Q':\n\t return parseTokenOneDigit;\n\t case 'DDDD':\n\t return parseTokenThreeDigits;\n\t case 'YYYY':\n\t case 'GGGG':\n\t case 'gggg':\n\t return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;\n\t case 'Y':\n\t case 'G':\n\t case 'g':\n\t return parseTokenSignedNumber;\n\t case 'YYYYYY':\n\t case 'YYYYY':\n\t case 'GGGGG':\n\t case 'ggggg':\n\t return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;\n\t case 'S':\n\t if (strict) {\n\t return parseTokenOneDigit;\n\t }\n\t /* falls through */\n\t case 'SS':\n\t if (strict) {\n\t return parseTokenTwoDigits;\n\t }\n\t /* falls through */\n\t case 'SSS':\n\t if (strict) {\n\t return parseTokenThreeDigits;\n\t }\n\t /* falls through */\n\t case 'DDD':\n\t return parseTokenOneToThreeDigits;\n\t case 'MMM':\n\t case 'MMMM':\n\t case 'dd':\n\t case 'ddd':\n\t case 'dddd':\n\t return parseTokenWord;\n\t case 'a':\n\t case 'A':\n\t return config._locale._meridiemParse;\n\t case 'x':\n\t return parseTokenOffsetMs;\n\t case 'X':\n\t return parseTokenTimestampMs;\n\t case 'Z':\n\t case 'ZZ':\n\t return parseTokenTimezone;\n\t case 'T':\n\t return parseTokenT;\n\t case 'SSSS':\n\t return parseTokenDigits;\n\t case 'MM':\n\t case 'DD':\n\t case 'YY':\n\t case 'GG':\n\t case 'gg':\n\t case 'HH':\n\t case 'hh':\n\t case 'mm':\n\t case 'ss':\n\t case 'ww':\n\t case 'WW':\n\t return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;\n\t case 'M':\n\t case 'D':\n\t case 'd':\n\t case 'H':\n\t case 'h':\n\t case 'm':\n\t case 's':\n\t case 'w':\n\t case 'W':\n\t case 'e':\n\t case 'E':\n\t return parseTokenOneOrTwoDigits;\n\t case 'Do':\n\t return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;\n\t default:\n\t a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\\\', '')), 'i'));\n\t return a;\n\t }\n\t }", "verifyToken(id, phone, cb) {\n // Lookup the token\n _data.read('tokens', id, (err, tokenData) => {\n (!err && tokenData) ?\n // Check whether the token is linked to the given user and hasn't yet expired\n (tokenData.phone == phone && tokenData.expires > Date.now()) ? \n cb(true)\n : cb(false)\n : cb(false);\n });\n }", "function _match (rule, cmtData) {\n var path = rule.subject.split('.');\n var extracted = cmtData;\n while (path.length > 0) {\n var item = path.shift();\n if (item === '') {\n continue;\n }\n if (extracted.hasOwnProperty(item)) {\n extracted = extracted[item];\n }\n if (extracted === null || typeof extracted === 'undefined') {\n extracted = null;\n break;\n }\n }\n if (extracted === null) {\n // Null precondition implies anything\n return true;\n }\n switch (rule.op) {\n case '<':\n return extracted < rule.value;\n case '>':\n return extracted > rule.value;\n case '~':\n case 'regexp':\n return (new RegExp(rule.value)).test(extracted.toString());\n case '=':\n case 'eq':\n return rule.value ===\n ((typeof extracted === 'number') ? \n extracted : extracted.toString());\n case 'NOT':\n return !_match(rule.value, extracted);\n case 'AND':\n if (Array.isArray(rule.value)) {\n return rule.value.every(function (r) {\n return _match(r, extracted);\n });\n } else {\n return false;\n }\n case 'OR':\n if (Array.isArray(rule.value)) {\n return rule.value.some(function (r) {\n return _match(r, extracted);\n });\n } else {\n return false;\n }\n default:\n return false;\n }\n }", "match(tokens, result){\n //\n //Deconstruct the tokens to obtain value for testing\n const {token} = tokens;\n //\n //Test for the match of the value aganist the toekn.\n if(super.match(token) && token.name === this.name){\n //\n //They match, return true.\n return true;\n }\n //\n //Compile the error massege.\n result.msg = `Expected ${this.name}`;\n //\n //Set the index position.\n result.index = token.index;\n //\n //Rerune false.They don't match.\n return false;\n \n }", "match(tokenKind) {\n if (this.check(tokenKind)) {\n this.current++; //advance\n return true;\n }\n return false;\n }", "function advanceSlash() {\n\t var regex, previous, check;\n\n\t function testKeyword(value) {\n\t return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n\t }\n\n\t previous = extra.tokenValues[extra.tokens.length - 1];\n\t regex = (previous !== null);\n\n\t switch (previous) {\n\t case 'this':\n\t case ']':\n\t regex = false;\n\t break;\n\n\t case ')':\n\t check = extra.tokenValues[extra.openParenToken - 1];\n\t regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n\t break;\n\n\t case '}':\n\t // Dividing a function by anything makes little sense,\n\t // but we have to check for that.\n\t regex = false;\n\t if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n\t // Anonymous function, e.g. function(){} /42\n\t check = extra.tokenValues[extra.openCurlyToken - 4];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n\t } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n\t // Named function, e.g. function f(){} /42/\n\t check = extra.tokenValues[extra.openCurlyToken - 5];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n\t }\n\t }\n\n\t return regex ? collectRegex() : scanPunctuator();\n\t }", "match (reg) {\n let match = this.str.match(reg)\n\n if (!match) {\n return false\n }\n\n this.str = this.str.slice(match[0].length)\n\n return match\n }", "isTokenValid(authKey) {\n const userData = this.app.readDataFile(userFilePath);\n const user = userData.find(item => item.token === authKey);\n\n return !!user;\n }", "matches(pattern) {\n for (var i = 0; i < this.lines.length; ++i) {\n if (this.lines[i].match(pattern)) {\n return true;\n }\n }\n return false;\n }", "function buildRegexpApiCallActivityHandler(regexp, perm) {\n return function(perm, activity) {\n if(activity.activityType === \"api_call\") {\n if(regexp.exec(activity.apiCall) !== null) {\n onPermissionDetected(perm);\n }\n }\n }\n}", "function readRegexp() {\n var content = \"\", escaped, inClass, start = tokPos;\n for (; ;) {\n if (tokPos >= inputLen) raise(start, \"Unterminated regular expression\");\n var ch = input.charAt(tokPos);\n if (newline.test(ch)) raise(start, \"Unterminated regular expression\");\n if (!escaped) {\n if (ch === \"[\") inClass = true;\n else if (ch === \"]\" && inClass) inClass = false;\n else if (ch === \"/\" && !inClass) break;\n escaped = ch === \"\\\\\";\n } else escaped = false;\n ++tokPos;\n }\n var content = input.slice(start, tokPos);\n ++tokPos;\n // Need to use `readWord1` because '\\uXXXX' sequences are allowed\n // here (don't ask).\n var mods = readWord1();\n if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, \"Invalid regexp flag\");\n return finishToken(_regexp, new RegExp(content, mods));\n }", "match(tokens, result){\n //\n //Deconstruct the tokens to obtain value for testing\n const {token} = tokens;\n //\n //Test for the match of the value aganist the toekn.\n if(super.match(token) && token.value === this.value){\n //\n //They match, return true.\n return true;\n }\n //\n //Compile the error massege.\n result.msg = `Expected ${this.value}`;\n //\n //Set the index position.\n result.index = token.index;\n //\n //Rerune false.They don't match.\n return false;\n \n }", "match(input){\n var t = this.tokenizer.match(input) \n if( t.isError() ) return t\n this.lexer = new TokenSource(t.value)\n t = this.analyze()\n if(!this.leftover && this.lexer.current()!=null) t = this.lexer.current().toError()\n return t\n }", "match(input) {\n var start = input.pos\n var c = input.current()\n if(!this.startsWith(c)) return this.error(input, input.pos)\n while(this.startsWith(input.next())){}\n return this.token(input,start,\" \")\n }", "function extract_regex_in_node(node) {\n\t//Recurse \n\tvar callee_nodes = get_all_nodes_by_type(node, \"CallExpression\");\n\tcallee_nodes.forEach(node => {\n\t\tif (node.callee.type === \"Identifier\")\n\t\t\tfor (var i = 0; i < function_nodes.length; i++) {\n\t\t\t\tif (function_names[i] === node.callee.name) {\n\t\t\t\t\textract_regex_in_node(function_nodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t});\n\t//Get regex from current node\n\tconsole.log(\"Event callback function: \");\n\t// console.log(\"Function name: \" + node.id.name);\n\tvar begin_function = -1;\n\tvar end_function = -1;\n\tbegin_function = node.loc.start.line;\n\tend_function = node.loc.end.line;\n\tconsole.log(\"Function location: from line \", begin_function, \" to line \", end_function);\n\tvar full_function_code = \"\";\n\tfor (var k = begin_function; k <= end_function; k++) {\n\t\t//Check if contains regex\n\t\t//Replace function \n\t\t//Array of concerned strings\n\t\tvar regex_users = [\".replace(\", \".search(\", \".match(\"];\n\t\tvar regex_users_type_1 = [\".replace(\"];\n\t\tvar which_user = -1;\n\t\tfor (var r = 0; r < regex_users.length; r++) {\n\t\t\tif (file_lines[k].includes(regex_users[r])) {\n\t\t\t\twhich_user = r;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (which_user == -1)\n\t\t\tcontinue;\n\t\tvar regex_coded_line = file_lines[k];\n\t\tvar which_user_string = regex_users[which_user];\n\t\tvar begin = regex_coded_line.indexOf(which_user_string) + which_user_string.length;\n\t\tif (begin != -1) {\n\t\t\tvar end = -1;\n\t\t\tif (!regex_users_type_1.includes(which_user_string)) {\n\t\t\t\tend = regex_coded_line.indexOf(\")\", begin);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tend = regex_coded_line.indexOf(\",\", begin);\n\t\t\t}\n\t\t\tif (end != -1) {\n\t\t\t\tvar regex_string_from_line = regex_coded_line.substring(begin, end).trim();\n\t\t\t\tif (regex_string_from_line[0] == \"/\" && regex_string_from_line.indexOf(\"/\", 2) != -1)\n\t\t\t\t\tregexs.push(regex_string_from_line);\n\t\t\t}\n\t\t}\n\t}\n}", "function regexp1(){\r\n var usrnam2 = document.getElementById(\"un2\").value;\r\n // i used i for capitalisation issue\r\n // upper case and lower case alphabets will be treated same \r\n var regx = /capg2021/i;\r\n\r\n if (regx.test(usrnam2)){\r\n return true ;\r\n }\r\n\r\n else{\r\n alert(\"invalid username \");\r\n return false ;\r\n }\r\n\r\n}", "isTag(tag, lineMatchIndex, line) {\n let prevChar = line.charAt(lineMatchIndex - 1)\n let nextChar = line.charAt(lineMatchIndex + tag.length)\n\n if ((nextChar == ':' || nextChar == ']' || (this._config._whitespaceTagging && (nextChar == ' ' || nextChar == \"\\t\"))) && (prevChar !== '_')) {\n return true\n } else {\n return false\n }\n }", "function captureMatchIfValidAndReset() {\n if (currentEmailMatch.hasDomainDot) { // we need at least one dot in the domain to be considered a valid email address\n var matchedText = text.slice(currentEmailMatch.idx, charIdx);\n // If we read a '.' or '-' char that ended the email address\n // (valid domain name characters, but only valid email address\n // characters if they are followed by something else), strip \n // it off now\n if (/[-.]$/.test(matchedText)) {\n matchedText = matchedText.slice(0, -1);\n }\n var emailAddress = currentEmailMatch.hasMailtoPrefix\n ? matchedText.slice('mailto:'.length)\n : matchedText;\n // if the email address has a valid TLD, add it to the list of matches\n if (doesEmailHaveValidTld(emailAddress)) {\n matches.push(new _match_email_match__WEBPACK_IMPORTED_MODULE_3__[\"EmailMatch\"]({\n tagBuilder: tagBuilder,\n matchedText: matchedText,\n offset: currentEmailMatch.idx,\n email: emailAddress\n }));\n }\n }\n resetToNonEmailMatchState();\n /**\n * Determines if the given email address has a valid TLD or not\n * @param {string} emailAddress - email address\n * @return {Boolean} - true is email have valid TLD, false otherwise\n */\n function doesEmailHaveValidTld(emailAddress) {\n var emailAddressTld = emailAddress.split('.').pop() || '';\n var emailAddressNormalized = emailAddressTld.toLowerCase();\n var isValidTld = strictTldRegex.test(emailAddressNormalized);\n return isValidTld;\n }\n }", "function regex(type, regex) {\n var flags = arguments.length <= 2 || arguments[2] === undefined ? '' : arguments[2];\n\n var massagedRegex = new RegExp(/^/.source + regex.source, flags);\n\n return function (previousTokens, charStream) {\n var match;\n if (match = charStream.rest().match(massagedRegex)) {\n return LexerResponse([charStream.Token(type, match[0])], charStream.advance(match[0].length));\n } else {\n return null;\n }\n };\n}", "isMatch(url, routePattern) {\n routePattern = \"^\" + routePattern + \"$\";\n return (new RegExp(routePattern.trimAll(\"/\").replaceAll(\"(<(.+?)>)\", \"(.+?)\"))).test(url.trimAll(\"/\"));\n }" ]
[ "0.5434234", "0.5110512", "0.49547535", "0.48878807", "0.48615125", "0.4848644", "0.48464763", "0.48126134", "0.47948828", "0.47948828", "0.47633854", "0.47633854", "0.47633854", "0.47633854", "0.4755162", "0.4755162", "0.4755162", "0.4755162", "0.4755162", "0.47479805", "0.4727989", "0.4720249", "0.4706269", "0.4695706", "0.4695706", "0.4695706", "0.4695706", "0.46770096", "0.46728665", "0.4625871", "0.46252555", "0.46027377", "0.45939693", "0.45939693", "0.45939693", "0.45939693", "0.45806193", "0.45741817", "0.45690784", "0.45690784", "0.45690784", "0.45690784", "0.45690784", "0.45690784", "0.45550808", "0.45423862", "0.45422682", "0.45280918", "0.4504045", "0.44775507", "0.44730404", "0.4468763", "0.4463127", "0.44199944", "0.44159654", "0.44067436", "0.4405598", "0.44027734", "0.44004092", "0.43997347", "0.43864623", "0.43715033", "0.43714595", "0.436701", "0.436701", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43547198", "0.43511686", "0.4344929", "0.4340276", "0.43361145", "0.4307536", "0.428782", "0.42734915", "0.4272506", "0.42640913", "0.42584157", "0.42341062", "0.42257744", "0.42221192", "0.4218797", "0.42178646", "0.42155844", "0.41966736", "0.418945", "0.41830105", "0.4178225", "0.41754946" ]
0.6581221
0
Create a clone of this token to own
clone() { return new Token(this.path, this.value, this.uid, this.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\n\t}", "clone() {\n return new this.constructor(this);\n }", "static clone(scope) {\n const newScope = new Scope();\n if (scope) {\n newScope._breadcrumbs = [...scope._breadcrumbs];\n newScope._tags = { ...scope._tags };\n newScope._extra = { ...scope._extra };\n newScope._contexts = { ...scope._contexts };\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = [...scope._eventProcessors];\n newScope._requestSession = scope._requestSession;\n newScope._attachments = [...scope._attachments];\n }\n return newScope;\n }", "assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${Math.floor(Math.random() * 1000000)}`;\n }", "static clone(scope) {\n const newScope = new Scope();\n if (scope) {\n newScope._breadcrumbs = [...scope._breadcrumbs];\n newScope._tags = { ...scope._tags };\n newScope._extra = { ...scope._extra };\n newScope._contexts = { ...scope._contexts };\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = [...scope._eventProcessors];\n newScope._requestSession = scope._requestSession;\n newScope._attachments = [...scope._attachments];\n newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };\n }\n return newScope;\n }", "static clone(scope) {\n\t const newScope = new Scope();\n\t if (scope) {\n\t newScope._breadcrumbs = [...scope._breadcrumbs];\n\t newScope._tags = { ...scope._tags };\n\t newScope._extra = { ...scope._extra };\n\t newScope._contexts = { ...scope._contexts };\n\t newScope._user = scope._user;\n\t newScope._level = scope._level;\n\t newScope._span = scope._span;\n\t newScope._session = scope._session;\n\t newScope._transactionName = scope._transactionName;\n\t newScope._fingerprint = scope._fingerprint;\n\t newScope._eventProcessors = [...scope._eventProcessors];\n\t newScope._requestSession = scope._requestSession;\n\t newScope._attachments = [...scope._attachments];\n\t }\n\t return newScope;\n\t }", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "clone() {\n let signature;\n if (this.signature) {\n signature = JSON.parse(JSON.stringify(this.signature));\n }\n const data = JSON.stringify(this.data, (key, value) => {\n if (value instanceof Uint8Array) {\n return Array.from(value);\n }\n return value;\n });\n return new SigningRequest(this.version, JSON.parse(data), this.textEncoder, this.textDecoder, this.zlib, this.abiProvider, signature);\n }", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() {}", "clone() {\n return Object.assign(Object.create(this), this)\n }", "clone() {\n let dupe = new this.constructor();\n dupe.reset(this);\n return dupe;\n }", "function Clone(){\n }", "constructor() {\n copy(this, create());\n }", "function Clone() { }", "function Clone() { }", "function Clone() { }", "clone() { return new node(this.v, this.hi, this.lo); }", "clone() {\n var clone = new Player(true);\n clone.brain = this.brain.clone();\n clone.fitness = this.fitness;\n clone.brain.generateNetwork();\n clone.gen = this.gen;\n clone.bestScore = this.score;\n return clone;\n }", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "copyFrom(token) {\n this.batchID = token.batchID\n this.vertexID = token.vertexID\n this.indexID = token.indexID\n }", "function clone() {\n return new Hash(this);\n }", "function clone() {\n return new Hash(this);\n }", "clone() {\n log.debug(`[${this._id}]: generating a fresh (clone) request`);\n return this._client.request(this._config);\n }", "cloneForReplay() {\n var clone = new Player(false);\n clone.brain = this.brain.clone();\n clone.fitness = this.fitness;\n clone.brain.generateNetwork();\n clone.gen = this.gen;\n clone.bestScore = this.score;\n //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<replace\n return clone;\n }", "function clone()\n{\n\tvar sprite = new Sprite();\n\n\tsprite.texture = this.texture;\n\n\tsprite.follow_camera_rotation = this.follow_camera_rotation;\n\n\tsprite.position.set(this.position.x, this.position.y, this.position.z);\n\tsprite.rotation.set(this.rotation.x, this.rotation.y, this.rotation.z);\n\tsprite.scale.set(this.scale.x, this.scale.y, this.scale.z);\n\tsprite.origin.set(this.origin.x, this.origin.y, this.origin.z);\n\n\treturn sprite;\n}", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "_clone () {\n const clone = new Keccak(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options)\n this._state.copy(clone._state)\n clone._finalized = this._finalized\n\n return clone\n }", "token() {\n return {\n id: this.id,\n role: this.role,\n };\n }", "token() {\n return {\n _id: this._id,\n role: this.role\n }\n }", "clone() {\n let span = new BookmarkElementBox(this.bookmarkType);\n span.name = this.name;\n span.reference = this.reference;\n if (this.margin) {\n span.margin = this.margin.clone();\n }\n span.width = this.width;\n span.height = this.height;\n return span;\n }", "copy(){\r\n let copy = new Enemy(this.name, true);\r\n return super.copy(copy);\r\n }", "clone() { \n\t let clone = new CircleNode()\n\t return clone\n\t}", "clone() {\n return new TileTree(this.root.clone(), this.next_id);\n }", "clone() {\n const cloner = new Cloner();\n return cloner.clone(this);\n }", "setToken(password){\n this.token = new Buffer(`${this.user}:${password}`).toString('base64')\n return this.token\n }", "async generateAuthToken() {\n const token = jwt.sign(\n { _id: this._id.toHexString(), userId: this.userId },\n 'tokencode',\n {\n expiresIn: '30d',\n }\n );\n\n await this.updateOne({\n $push: {\n tokens: token,\n },\n });\n return token;\n }", "constructor(token) {\n this.createdTimestamp = BigInt(token.created_timestamp);\n this.deleted = token.deleted;\n this.decimals = BigInt(token.decimals);\n this.feeScheduleKey = token.fee_schedule_key;\n this.freezeDefault = token.freeze_default;\n this.freezeKey = token.freeze_key;\n this.initialSupply = BigInt(token.initial_supply);\n this.kycKey = token.kyc_key;\n this.maxSupply = BigInt(token.max_supply);\n this.memo = token.memo;\n this.modifiedTimestamp = BigInt(token.modified_timestamp);\n this.name = token.name;\n this.pauseKey = token.pause_key;\n this.pauseStatus = token.pause_status;\n this.supplyKey = token.supply_key;\n this.supplyType = token.supply_type;\n this.symbol = token.symbol;\n this.tokenId = token.token_id;\n this.totalSupply = BigInt(token.total_supply);\n this.treasuryAccountId = token.treasury_account_id;\n this.type = token.type;\n this.wipeKey = token.wipe_key;\n }", "constructor(token, amount) {\n super(token, amount);\n this.token = token;\n }", "clone() {\n return new Pose(this);\n }", "bless(request) {\n // create headers if does not already exist\n if(request.headers == null) request.headers = {}\n // assign authentication bearer token\n request.headers[\"Authorization\"] = \"Bearer \" + this.token;\n return request;\n }", "clone() {\n const clone = new this.constructor(this.model);\n clone.config = Object.assign(clone.config, this.config);\n clone.options = Object.assign(clone.options, this.options);\n return clone;\n }", "constructor() { \n \n TokenPermission.initialize(this);\n }", "function generateToken() {\n return null; // TODO: add a token generation\n}", "function newToken(){\n spotifyApi.clientCredentialsGrant().then(\n function(data) {\n console.log('The access token expires in ' + data.body['expires_in']);\n // console.log('The access token is ' + data.body['access_token']);\n \n // Save the access token so that it's used in future calls\n spotifyApi.setAccessToken(data.body['access_token']);\n return data.body['access_token']\n },\n function(err) {\n console.log('Something went wrong when retrieving an access token', err);\n }\n );\n}", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "clone() {\r\n return _.cloneDeep(this)\r\n }", "createToken() {\n\t\tconst date = new Date();\n\t\tconst timestamp = date.getTime() + parseInt(process.env.JWT_EXPIRATION, 10);\n\t\tconst expiry_date = new Date(timestamp);\n\n\t\treturn jwt.sign(\n\t\t\t{\n\t\t\t\t_id: this._id,\n\t\t\t\temail: this.email,\n\t\t\t\texpiry_date: expiry_date.toISOString(),\n\t\t\t},\n\t\t\tprocess.env.JWT_SECRET,\n\t\t\t{\n\t\t\t\texpiresIn: process.env.JWT_EXPIRATION,\n\t\t\t}\n\t\t);\n\t}", "clone() {\n var clone = new TraversalState(this.root);\n clone._currentNode = this._currentNode;\n clone._containers = this._containers.clone();\n clone._indexes = this._indexes.clone();\n clone._ancestors = this._ancestors.clone();\n return clone;\n }", "clone() {\n let cloneField = super.clone()\n cloneField._id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)\n return cloneField\n }", "clone(opts={}) {\n // remove the id if it exists\n const {'id': deletedKey, ...attrs} = this.attributes\n const {copyNumber} = opts\n\n // generate name variant\n const name = this.copyName(copyNumber)\n \n // change the startDate and endDate if desired\n const {startDate,endDate} = opts.offsetDuration ? \n this.getOffsetDuration() : this.attributes\n \n return Promo.fromAttributes({\n ...attrs,\n name,\n startDate,\n endDate,\n })\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "clone() {\n\t\treturn new vector(this.x, this.y);\n\t}", "resetToken(){\n if (this._accountName && this._password) {\n __WEBPACK_IMPORTED_MODULE_1__Client__[\"a\" /* client */].tokenObj = null;\n }\n }", "function Token(Contract) {\n this.web3 = null;\n this.instance = null;\n this.Contract = Contract;\n}", "_copy () {\n const struct = super._copy();\n struct.hookName = this.hookName;\n return struct\n }", "function verificationObjectToClone(verObject) {\n verObject.signature = verObject.signature.packets;\n return verObject;\n}", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "copy () {\n return new Dot({\n x: this.x,\n y: this.y,\n z: this.z\n })\n }", "async function mintToken() {\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount();\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const contract = new ethers.Contract(tokenAddress, Token.abi, signer);\n let signerAddress = await signer.getAddress();\n console.log(\"Account:\", signerAddress);\n\n try {\n const tx = await contract.createCollectible(signerAddress, \"ipfs://QmZhQho7NniB1pZLzAz9aZzHFw2M7jyZm2bmStFshYWURT\");\n console.log('data: ', tx);\n } catch (err) {\n console.log(\"Error: \", err);\n }\n }\n }", "clone() {\n return new Vector().copy(this);\n }", "function createToken() {\n stripe.createToken($scope.card).then(function(result) {\n if (result.error) {\n $scope.cardError = result.error.message;\n $scope.submitting = false;\n } else {\n // Send the token to your server\n stripeTokenHandler(result.token);\n }\n });\n }", "copy(content = null) {\n if (content == this.content)\n return this;\n return new Node(this.type, this.attrs, content, this.marks);\n }", "clone() {\n const composer = new Composer();\n composer.middlewares = [...this.middlewares];\n return composer;\n }", "function createNewCopy(original) {\n\treturn JSON.parse(JSON.stringify(original));\n}", "clone(json) {\n json = json || {};\n\n const temp = function TruffleContract() {\n this.constructor = temp;\n return Contract.apply(this, arguments);\n };\n\n temp.prototype = Object.create(this.prototype);\n\n let network_id;\n\n // If we have a network id passed\n if (typeof json !== \"object\") {\n network_id = json;\n json = this._json;\n }\n\n json = utils.merge({}, this._json || {}, json);\n\n temp._constructorMethods = this._constructorMethods;\n temp._properties = this._properties;\n\n temp._property_values = {};\n temp._json = json;\n\n bootstrap(temp);\n\n temp.class_defaults = temp.prototype.defaults || {};\n\n if (network_id) {\n temp.setNetwork(network_id);\n }\n\n if (this.currentProvider) {\n temp.configureNetwork({\n provider: this.currentProvider,\n networkType: this.networkType\n });\n }\n\n // Copy over custom key/values to the contract class\n Object.keys(json).forEach(key => {\n if (key.indexOf(\"x-\") !== 0) return;\n temp[key] = json[key];\n });\n\n return temp;\n }", "clone() {\n return _.cloneDeep(this);\n }", "clone() {\n return new Stack(this.stack);\n }", "clone(){\n return new Quaternion(this.x, this.y, this.z, this.w);\n }", "Copy() {}", "function clone() {\n var result = self.name === 'yangman_historySettings' ?\n RequestsSettingsService.createHistorySettings() :\n RequestsSettingsService.createCollectionsSettings();\n result.setData(self.data);\n return result;\n }", "static _create(providerId, pendingToken) {\r\n return new SAMLAuthCredential(providerId, pendingToken);\r\n }", "static _create(providerId, pendingToken) {\r\n return new SAMLAuthCredential(providerId, pendingToken);\r\n }", "clone(x) {\n const y = ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Identity\"], { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Cast\"], gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "function clone () {\n return new Light(this);\n}", "function generateToken( el ) {\n\n axios.get('/0/workspace/'+ space + '/genToken').then(function ( res ) {\n\n var generated = res.data;\n\n // add new key to content\n var appendTo = document.getElementById('member-tokens-assigned');\n\n var html = document.createElement('div');\n html.classList.add('token-generated');\n\n generated.claimed ? html.classList.add('token-used') : html.classList.add('token-free');\n html.innerHTML = '<p>' + generated.token + '</p>';\n\n appendTo.appendChild(html);\n })\n .catch(function (error) { console.log(error); });\n}", "_cloneDocument() {\n const copy = documents.createImpl(\n this._globalObject,\n {\n contentType: this.contentType,\n encoding: this._encoding,\n parsingMode: this._parsingMode\n }\n );\n\n copy._URL = this._URL;\n copy._origin = this._origin;\n return copy;\n }", "function clone(node) {\n\t return $node(serialize(node));\n\t }", "static cloneNode(el) {\r\n const node = el.cloneNode(true);\r\n node.removeAttribute('id');\r\n return node;\r\n }", "copySelf() {\n return new Ship(\n {\n id: this.id, \n player: this.player, \n x: this.x, \n y: this.y, \n direction: this.direction, \n moves: this.moves, \n hp: this.hp, \n sunk: this.sunk,\n damage: this.damage, \n gameObj: this.gameObj\n })\n }", "function set_unscoped_access_token(callback) {\n post_data = {\"auth\": {\"identity\": {\"methods\": [\"password\"],\"password\": {\"user\": {\n \"domain\": {\"name\": \"users\"},\"name\": USER_NAME,\"password\": PASSWORD}}},\n \"scope\":\n {\"project\": {\"domain\": {\"name\": \"users\"},\"name\": \"Other\"}}}}\n\n request({\n url: URL_AUTH,\n method: 'POST',\n json: post_data\n }, function(error, response, body) {\n if (error) {\n reset_loader()\n display_alert(false, false, \"Could not connect to OpenStack.\")\n } else {\n UNSCOPED_TOKEN = response['headers']['x-subject-token']\n build_endpoints(body)\n callback()\n }\n });\n}", "createToken(username) {\n return jwt.sign({\n issuer: username,\n iat: Math.floor(Date.now() / 1000),\n exp: Math.floor(Date.now() / 1000) + ((60 * 60) * 10)\n }, 'secret');\n }", "async generateTokens ({ dispatch, state, getters }, { amount, to = false }) {\n state.instance.generateTokens(!to ? state.account : to, amount, getters.txParams)\n }", "function generateRefreshToken(account, ipAddress) {\n // create a refresh token that expires in 7 days\n return new db.RefreshToken({\n account: account.id,\n token: randomTokenString(),\n expires: new Date(Date.now() + 7*24*60*60*1000),\n createdByIp: ipAddress\n });\n }", "createCredential() {\n return new Credential(this);\n }", "function createAnother(original){\n var clone = Object.create(original)\n clone.sayHi = function(){\n console.log(\"hi\")\n }\n return clone\n}", "function _cloneActiveContext() {\n const child = {};\n child.mappings = util.clone(this.mappings);\n child.clone = this.clone;\n child.inverse = null;\n child.getInverse = this.getInverse;\n child.protected = util.clone(this.protected);\n if (this.previousContext) {\n child.previousContext = this.previousContext.clone();\n }\n child.revertToPreviousContext = this.revertToPreviousContext;\n if ('@base' in this) {\n child['@base'] = this['@base'];\n }\n if ('@language' in this) {\n child['@language'] = this['@language'];\n }\n if ('@vocab' in this) {\n child['@vocab'] = this['@vocab'];\n }\n return child;\n }", "constructor(token) {\n this.token = token || null;\n }", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}", "function bnClone(){var a=nbi();this.copyTo(a);return a}" ]
[ "0.6218622", "0.6186806", "0.604567", "0.6034622", "0.60241276", "0.60078615", "0.6001775", "0.6001775", "0.5984051", "0.595189", "0.5838016", "0.58067316", "0.58067316", "0.58067316", "0.58067316", "0.5763902", "0.5749831", "0.5737132", "0.57201767", "0.5717641", "0.5717641", "0.5717641", "0.5711646", "0.56809884", "0.5671385", "0.5671385", "0.5671385", "0.5671385", "0.56677884", "0.56451255", "0.56451255", "0.5642946", "0.56082195", "0.5607332", "0.559264", "0.55731344", "0.5564454", "0.5553304", "0.5548544", "0.5536282", "0.5496001", "0.54948837", "0.54783285", "0.5470137", "0.5469955", "0.54574955", "0.543043", "0.5417724", "0.5416213", "0.53635263", "0.53487146", "0.5338245", "0.53241426", "0.5318031", "0.5303525", "0.53034234", "0.528421", "0.5277075", "0.52723134", "0.526415", "0.5256769", "0.5252218", "0.52502286", "0.5243242", "0.5230302", "0.5221513", "0.5221513", "0.5220942", "0.52181196", "0.5209265", "0.5204487", "0.51892835", "0.51854557", "0.51742816", "0.5171998", "0.5169811", "0.5164573", "0.5143367", "0.5142351", "0.51394504", "0.51320887", "0.51320887", "0.5127668", "0.51119566", "0.5097492", "0.5096808", "0.5086901", "0.50863403", "0.5078418", "0.50701815", "0.50678337", "0.50656694", "0.50651705", "0.5056847", "0.50552666", "0.505288", "0.5049833", "0.5048805", "0.5048805", "0.5048805" ]
0.83719844
0
Used to detect whether the users browser is an mobile browser
function isMobile() { if (sessionStorage.desktop) /* desktop storage */ return false; else if (localStorage.mobile) /* mobile storage */ return true; /* alternative */ var mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile']; for (var i in mobile) if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0) return true; /* nothing found.. assume desktop */ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectMobile(){\n\tif(navigator.userAgent.match(/Android/i)\n\t\t\t || navigator.userAgent.match(/webOS/i)\n\t\t\t || navigator.userAgent.match(/iPhone/i)\n\t\t\t || navigator.userAgent.match(/iPad/i)\n\t\t\t || navigator.userAgent.match(/iPod/i)\n\t\t\t || navigator.userAgent.match(/BlackBerry/i)\n\t\t\t || navigator.userAgent.match(/Windows Phone/i)){\n\t\treturn true;\n\t}\n\telse{ return false; }\n}", "function isMobileDevice() {\n return /Mobi/.test(navigator.userAgent);\n}", "function isMobile() {\r\n\treturn /Android|webOS|iPhone|iPod|iPad|BlackBerry|IEMobile|Opera Mini/i\r\n\t\t\t.test(navigator.userAgent);\r\n}", "function is_mobile(){\n return (/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera);\n}", "function IsMobileBrowser() {\n return navigator.userAgent.match(/iPhone|iPad|iPod|Android/i) !== null;\n }", "function isMobile() {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent);\n}", "function isMobile() {\n return /Mobi/i.test(navigator.userAgent);\n}", "function isMobile() {\n\tif (/iPad|iPhone|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n\t\t// Mobile\n\t\treturn true;\n\t} else {\n\t\t// PC\n\t\treturn false;\n\t}\n}", "function isMobile(){\r\n if (\r\n (navigator.userAgent.match (/Android/i)) ||\r\n (navigator.userAgent.match (/webOS/i)) ||\r\n (navigator.userAgent.match (/Mobi/i)) ||\r\n (navigator.userAgent.match (/iPhone/i)) ||\r\n (navigator.userAgent.match (/iPad/i)) ||\r\n (navigator.userAgent.match (/iPod/i)) ||\r\n (navigator.userAgent.match (/BlackBerry/i)) \r\n ) return 'Mobile';\r\n return 'PC';\r\n }", "function isMobile() {\n return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua('l'));\n}", "function DetectMobile() {\n\n\t// First check\n if (sessionStorage.desktop) return false;\n else if (localStorage.mobile) return true;\n\n // Alternative check\n var mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile','mobile/'];\n for (var i in mobile) if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0) return true;\n\n // If nothing is found, we assume desktop\n return false;\n}", "function isMobile() {\r\n\tvar ua = navigator.userAgent;\r\n\tvar checker = {\r\n\t\tiphone:ua.match(/(iPhone|iPod|iPad)/),\r\n\t\tblackberry:ua.match(/BlackBerry/),\r\n\t\tandroid:ua.match(/Android/)\r\n\t}\r\n\r\n\tif (checker.iphone || checker.blackberry || checker.android) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function mobilecheck() {\r\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\r\n return false;\r\n }\r\n return true;\r\n }", "function isMobileDevice() {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));\n}", "function isMobileDevice()\r\n\t\t{\r\n\t\t\tvar testExp = new RegExp('Android|webOS|iPhone|iPad|' + 'BlackBerry|Windows Phone|' + 'Opera Mini|IEMobile|Mobile' , 'i');\r\n\t\t \r\n\t\t\tif (testExp.test(navigator.userAgent))\r\n\t\t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}", "function isMobileDevice() {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Mobile/i.test(navigator.userAgent);\n}", "function isMobile() {\n let isMobile = false;\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n isMobile = true\n }\n return isMobile\n }", "function isTheDeviceMobile() { \n if( navigator.userAgent.match(/Android/i)\n || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i)\n || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i)\n || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ){\n return true;\n }\n else {\n return false;\n }\n}", "Mobile ():boolean {\n\n\t\treturn this.mobile = this.IEMobile() || this.BlackBerry() || this.iOS() || this.Android() || this.Nokia();\n\t}", "function IsMobile() {\r\n ///<summary>Detecting whether the browser is a mobile browser or desktop browser</summary>\r\n ///<returns>A boolean value indicating whether the browser is a mobile browser or not</returns>\r\n\r\n if (sessionStorage.desktop) // desktop storage \r\n return false;\r\n else if (localStorage.mobile) // mobile storage\r\n return true;\r\n\r\n // alternative\r\n mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile','tablet','mobi']; \r\n var ua=navigator.userAgent.toLowerCase();\r\n for (var i in mobile) if (ua.indexOf(mobile[i]) > -1) return true;\r\n\r\n // nothing found.. assume desktop\r\n return false;\r\n}", "function isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n} // ==============================", "function mobileDetect(){\n var $viewportWidth = $(window).width();\n var mobileThreshold = 500;\n return $viewportWidth < mobileThreshold;\n}", "function isMobile() {\n const userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (/windows phone/i.test(userAgent) ||\n /android/i.test(userAgent) ||\n (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream)) {\n return true;\n }\n return false;\n}", "function isMobileDevice() {\n\t try {\n\t return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n\t );\n\t } catch (e) {\n\t return false;\n\t }\n\t}", "function onMobile() {\n if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ) {\n return true;\n }\n else {\n return false;\n }\n}", "function isMobile() {\n if(navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/webOS/i) ||\n navigator.userAgent.match(/iPhone/i) ||\n navigator.userAgent.match(/iPad/i) ||\n navigator.userAgent.match(/iPod/i) ||\n navigator.userAgent.match(/BlackBerry/i) ||\n navigator.userAgent.match(/Windows Phone/i))\n return true\n \n return false\n}", "function isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "function isMobileDevice() {\n try {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n );\n } catch (e) {\n return false;\n }\n}", "isMobileUserAgent() {\n return /Mobi/i.test(this._userAgent)\n }", "function isMobileUser(){\n\tif(pmgConfig.agent_ios || pmgConfig.agent_android){\n\t\treturn true;\t\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function getMobile() {\n \n if(!(\"ontouchend\" in document)) {\n \n return null; \n \n }\n else {\n \n if(agent.search(\"iphone\") !== -1 || agent.search(\"ipad\") !== -1) {\n \n return \"ios\";\n \n }\n else if(agent.search(\"android\") !== -1 || agent.search(\"applewebkit\") !== -1) {\n \n return \"android\";\n \n }\n else if(agent.search(\"msie\") !== -1) {\n \n return \"winMobile\";\n \n }\n \n return null;\n \n }\n \n }", "function isMobile() {\n\tif (navigator.userAgent.match(/Android/i)\n\t\t\t|| navigator.userAgent.match(/iPhone/i)\n\t\t\t|| navigator.userAgent.match(/iPad/i)\n\t\t\t|| navigator.userAgent.match(/iPod/i)\n\t\t\t|| navigator.userAgent.match(/BlackBerry/i)\n\t\t\t|| navigator.userAgent.match(/Windows Phone/i)\n\t\t\t|| navigator.userAgent.match(/Opera Mini/i)\n\t\t\t|| navigator.userAgent.match(/IEMobile/i)\n\t\t\t) {\n\t\treturn true;\n\t}\n}", "function detectmob() {\n\n if( navigator.userAgent.match(/Android/i)\n || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i)\n || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i)\n || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ){\n return true;\n }\n else {\n return false;\n }\n}", "function DetectWindowsMobile()\n{\n //Most devices use 'Windows CE', but some report 'iemobile' \n // and some older ones report as 'PIE' for Pocket IE. \n if (uagent.search(deviceWinMob) > -1 ||\n uagent.search(deviceIeMob) > -1 ||\n uagent.search(enginePie) > -1)\n return true;\n else\n return false;\n}", "function isMobile () {\n var viewPortWidth = getWidth(); \n if ( viewPortWidth < 768 ){\n return true;\n } else {\n return false;\n }\n }", "function isMobile() {\n if(/webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || (/Android/i.test(navigator.userAgent) && screenWidth <= medium)) {\n return true;\n } else {\n return false;\n };\n}", "function is_mobile_device () {\n if ( ( $(window).width()<767) || (navigator.userAgent.match(/(Android|iPhone|iPod|iPad)/) ) ) {\n return true;\n } else {\n return false;\n }\n}", "function DetectWindowsMobile()\n{\n //Most devices use 'Windows CE', but some report 'iemobile'\n // and some older ones report as 'PIE' for Pocket IE.\n if (uagent.search(deviceWinMob) > -1 ||\n uagent.search(deviceIeMob) > -1 ||\n uagent.search(enginePie) > -1)\n return true;\n //Test for Windows Mobile PPC but not old Macintosh PowerPC.\n if ((uagent.search(devicePpc) > -1) &&\n !(uagent.search(deviceMacPpc) > -1))\n return true;\n //Test for Windwos Mobile-based HTC devices.\n if (uagent.search(manuHtc) > -1 &&\n uagent.search(deviceWindows) > -1)\n return true;\n else\n return false;\n}", "function detectMobile() {\n\tvar check = false;\n\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n\treturn check;\n}", "_detectMobile () {\n\t\tvar check = false;\n\t\t(function(a,b){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true;})(navigator.userAgent||navigator.vendor||window.opera,'http://detectmobilebrowser.com/mobile');\n\t\treturn check;\n\t}", "function hfgIsMobile() {\n\t\treturn HFG.isMobile();\n\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "IEMobile ():boolean {\n\n\t\tvar trident = this.agent.match(/IEMobile/i);\n\t\tvar windowsphone = this.agent.match(/Windows Phone/i);\n\t\tvar touch = this.agent.match(/touch/i);\n\n\t\treturn trident || windowsphone || touch ? true : false;\n\t}", "function isMobile() {\n var agent = navigator.userAgent || navigator.vendor || window.opera;\n\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent.substr(0, 4))) {\n return true;\n }\n\n return false;\n} // ================================= Hook =================================", "function is_mobile() {\n return ('ontouchstart' in document.documentElement);\n}", "function detectaDispositivoMobile(){\n\n if (DetectaIphone()){\n\n\t\treturn true;\n\n\t}else{\n\n\t\tif(DetectaIpod()){\n\n \t\treturn true;\n\n\t\t}else{\n\n\t\t\tif(DetectaS60Oss()){\n\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\n\t\t\t\tif(DetectaAndroidWebKit()){\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(DetectaWindowsMobile()){\n\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tif(DetectaBlackBerry()){\n\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\tif(DetectaPalmOS()){\n\n\t\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\tif(DetectaIpad()){\n\n\t\t\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}", "function isMobileDevice() {\n result = (typeof window.orientation !== \"undefined\") || (navigator.userAgent.indexOf('IEMobile') !== -1);\n return result;\n }", "function isMobileApp() {\n return isMobile() && !isIosWeb() && !isAndroidWeb();\n} // Returns true if and only if the user is using Mattermost from either the mobile app or the web browser on a mobile device.", "function isMobileOrTablet() {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Silk|PlayBook|BB\\d+|Meego/i.test(navigator.userAgent)) ? true : false\n}", "function isHTCMobile() {\n var regExp = new RegExp(\"HTC\", \"i\");\n var test = navigator.userAgent.match(regExp);\n return test;\n}", "function isMobile() {\n\t\tvar check = false;\n\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|Android|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|i(phone|pod|pad|Phone|Pod|Pad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n\t\tif(window.innerWidth <= 500) { check = true; }\n\t\treturn check;\n\t}", "function isMobile() {\n\tvar check = false;\n\t(function(a){if(/(android|ipad1|playbook|silk|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n\treturn check;\n}", "function DetectaWindowsMobile(){\n\n if (uagent.search(dispositivoWinMob) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "function isMobileDevice() {\n return (typeof window.orientation !== \"undefined\") || (navigator.userAgent.indexOf('IEMobile') !== -1);\n}", "function isMobile() {\n return window.matchMedia(\"only screen and (max-width: 760px)\").matches;\n}", "function IsMobileDevice() {\n\tvar check = false;\n\t(function (a) { if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera);\n\treturn check;\n}", "function mg_is_mobile() {\r\n\t\tif( /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(navigator.userAgent) )\r\n\t\t{ return true;}\r\n\t\telse { return false; }\r\n\t}", "function isSmartPhone() {\n if (navigator.userAgent.match(/iPhone|Android.+Mobile/)) {\n return true;\n } else {\n return false;\n }\n}", "isMobile(){\n\t\treturn !!('ontouchstart' in window || navigator.msMaxTouchPoints);\n\t}", "function isMobile() {\n return window.matchMedia('(max-width: 767px)').matches;\n}", "function isMobile() {\r\n\t\t\tvar check = false;\r\n\t\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\r\n\t\t\treturn check;\r\n\t\t}", "function DetectMobileLonger()\n{\n //Run the quick check first.\n if (DetectMobileQuick())\n return true;\n\n //Check for NTT Docomo\n if (uagent.search(svcDocomo) > -1)\n return true;\n\n //Check for KDDI\n if (uagent.search(svcKddi) > -1)\n return true;\n\n //Check for Nintendo DS\n if (uagent.search(deviceNintendoDs) > -1)\n return true;\n\n //Check for Vodafone 3G\n if (uagent.search(svcVodafone) > -1)\n return true;\n\n //Finally, detect for certain very old devices with stupid useragent strings.\n if (uagent.search(manuSamsung1) > -1 ||\n\tuagent.search(manuSonyEricsson) > -1 || \n\tuagent.search(manuericsson) > -1)\n {\n return true;\n }\n\n return false;\n}", "function checkMobile() {\n var check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n}", "function isMobile() {\n\t\t\tvar check = false;\n\t\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n\t\t\treturn check;\n\t\t}", "function on_mobile_device() { return $(document).width() <= 760 }", "function isMobile() {\n\tvar counter = 0;\n\tif ( bowser.mobile==true ) counter++;\n\tif ( bowser.tablet==true ) counter++;\n\t\t\n\tif ( counter==0 ) {\n\t\t//alert(\"isMobile() \" + \"false\");\n\t\treturn false;\n\t} else {\n\t\t//alert(\"isMobile() \" + \"true\");\n\t\treturn true;\n\t}\n\t\n}", "function loadMobileBrowserDetection() {\n /**\n * jQuery.browser.mobile (http://detectmobilebrowser.com/)\n *\n * jQuery.browser.mobile will be true if the browser is a mobile device\n *\n **/\n (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);\n}", "function DetectMobileLong()\n {\n if (DetectMobileQuick())\n return true;\n if (DetectGameConsole())\n return true;\n if (DetectSonyMylo())\n return true;\n\n //Detect for certain very old devices with stupid useragent strings.\n if (uagent.search(manuSamsung1) > -1 ||\n uagent.search(manuSonyEricsson) > -1 ||\n uagent.search(manuericsson) > -1)\n return true;\n\n if (uagent.search(svcDocomo) > -1)\n return true;\n if (uagent.search(svcKddi) > -1)\n return true;\n if (uagent.search(svcVodafone) > -1)\n return true;\n\n\n return false;\n }", "function isModernMobile() {\n return (navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS [8|9]_\\d/i) && navigator.userAgent.indexOf(\"Safari\") > -1 && navigator.userAgent.indexOf(\"CriOS\") == -1)\n || navigator.userAgent.indexOf('Twitter') > -1;\n }", "function areWeOnMobile(){ \n if($(window).width() < 600){\n onMobile = true;\n }\n else{\n onMobile = false;\n }\n return onMobile;\n }", "function isIEMobile() {\n var regExp = new RegExp(\"IEMobile\", \"i\");\n return navigator.userAgent.match(regExp);\n}", "function DetectSmartphone()\n {\n if (DetectIphoneOrIpod())\n return true;\n if (DetectS60OssBrowser())\n return true;\n if (DetectSymbianOS())\n return true;\n if (DetectWindowsMobile())\n return true;\n if (DetectAndroid())\n return true;\n if (DetectBlackBerry())\n return true;\n if (DetectPalmWebOS())\n return true;\n if (DetectPalmOS())\n return true;\n if (DetectGarminNuvifone())\n return true;\n\n //Otherwise, return false.\n return false;\n }", "function isMobile(){\n\t\treturn ($(window).width() < settings.switchWidth);\n\t}", "function isSmartphone() {\n var returnBool = false;\n if( /Android/i.test(navigator.userAgent) && window.devicePixelRatio > 1) {\n var w = $(window).width() / window.devicePixelRatio;\n console.log(\"Android device >> ratio'd width: \" + w);\n if (w < 480) {\n returnBool = true;\n }\n } else {\n returnBool = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Windows Mobile/i.test(navigator.userAgent)\n }\n\n return returnBool;\n}", "function isMobile() {\n return !o.mobile_flag.is(':visible');\n }", "function detectMob() {\n return ( ( window.innerWidth <= 600 ) && ( window.innerHeight <= 800 ) );\n}", "function isMobile () {\r\n if ((window.innerWidth <= 600) || (window.innerHeight) <= 600) {\r\n return true;\r\n } else return false;\r\n \r\n}", "function DetectMobileQuick()\n {\n //Let's say no if it's an iPad, which contains 'mobile' in its user agent.\n if (DetectIpad())\n return false;\n\n //Most mobile browsing is done on smartphones\n if (DetectSmartphone())\n return true;\n\n if (uagent.search(deviceMidp) > -1 ||\n DetectBrewDevice())\n return true;\n\n if (DetectOperaMobile())\n return true;\n\n if (uagent.search(engineNetfront) > -1)\n return true;\n if (uagent.search(engineUpBrowser) > -1)\n return true;\n if (uagent.search(engineOpenWeb) > -1)\n return true;\n\n if (DetectDangerHiptop())\n return true;\n\n if (DetectMaemoTablet())\n return true;\n if (DetectArchos())\n return true;\n\n if (uagent.search(devicePda) > -1)\n return true;\n if (uagent.search(mobile) > -1)\n return true;\n\n if (DetectKindle())\n return true;\n\n return false;\n }", "function isMobile() { return $(window).width() < 768 }", "function isMobile() { return angular.isDefined($window.orientation); }", "function isMobileView() {\n if ($(window).width() <= mobileWidth) {\n return true;\n } else {\n return false;\n }\n}", "function isSmartphone() {\n\treturn $(window).height() > $(window).width();\n}", "function isMobile(){\n return ($(window).width() < settings.switchWidth);\n }", "function isMobile(){\n return ($(window).width() < settings.switchWidth);\n }", "function isAppleMobile() {\n var regExp = new RegExp(\"iPhone|iPad|iPod\", \"i\");\n return navigator.userAgent.match(regExp);\n}", "function MobileSupport() {\n var ua = navigator.userAgent;\n return {\n iphone: ua.match(/(iPhone|iPod|iPad)/),\n blackberry: ua.match(/BlackBerry/),\n android: ua.match(/Android/)\n };\n}", "function detectMob() {\n const toMatch = [\n /Android/i,\n /webOS/i,\n /iPhone/i,\n /iPad/i,\n /iPod/i,\n /BlackBerry/i,\n /Windows Phone/i,\n ];\n\n return toMatch.some((toMatchItem) => {\n return navigator.userAgent.match(toMatchItem);\n });\n}", "function getMobileOperatingSystem() {\r\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\r\n\r\n // Windows Phone must come first because its UA also contains \"Android\"\r\n if (/windows phone/i.test(userAgent)) {\r\n return \"Windows Phone\";\r\n }\r\n\r\n if (/android/i.test(userAgent)) {\r\n return \"Android\";\r\n }\r\n\r\n // iOS detection from: http://stackoverflow.com/a/9039885/177710\r\n if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {\r\n return \"iOS\";\r\n }\r\n\r\n return \"desktop\";\r\n}", "function DetectSmartphone()\n{\n //First, look for iPhone and iPod Touch.\n if (DetectIphoneOrIpodOrIPad())\n return true;\n\n //Now, look for S60 Open Source Browser on S60 release 3 devices.\n if (DetectS60OssBrowser())\n return true;\n\n //Check for other Symbian devices - older S60, UIQ, other.\n if (DetectSymbianOS())\n return true;\n\n //Check for Windows Mobile devices.\n if (DetectWindowsMobile())\n return true;\n\n //Next, look for a BlackBerry\n if (DetectBlackBerry())\n return true;\n\n //PalmOS.\n if (DetectPalmOS())\n return true;\n\n //Otherwise, return false.\n return false;\n}", "function isMobileCordova() {\n return typeof window !== 'undefined' && !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA());\n}" ]
[ "0.8400894", "0.8264003", "0.82547116", "0.8245609", "0.82187575", "0.8198819", "0.8143824", "0.8133033", "0.8125884", "0.8125874", "0.81188077", "0.811613", "0.8099614", "0.8089032", "0.8077295", "0.8068926", "0.8059168", "0.80572224", "0.7996547", "0.7957747", "0.7952642", "0.79428416", "0.79375196", "0.79261523", "0.78929955", "0.7873557", "0.7872272", "0.7872272", "0.7872272", "0.78634596", "0.78634596", "0.78634596", "0.78634596", "0.78634596", "0.78634596", "0.78304267", "0.7826362", "0.7813848", "0.7796405", "0.77838916", "0.7777207", "0.7721528", "0.772039", "0.771966", "0.76903075", "0.7683279", "0.76647025", "0.7653614", "0.7649207", "0.7649207", "0.7649207", "0.7649207", "0.76380277", "0.76298887", "0.7613158", "0.75969684", "0.7559791", "0.75482965", "0.7527919", "0.7516389", "0.75162625", "0.7498125", "0.7467626", "0.7466713", "0.74644136", "0.7457128", "0.74399227", "0.74229825", "0.74228275", "0.74130213", "0.7402852", "0.73963165", "0.7360931", "0.7358386", "0.735521", "0.7344722", "0.73195577", "0.7314549", "0.7303244", "0.7299782", "0.72864234", "0.72716177", "0.7257562", "0.7243739", "0.7234329", "0.7229573", "0.7206294", "0.7159995", "0.7154794", "0.71509993", "0.71293163", "0.7114528", "0.7111363", "0.7111363", "0.71099436", "0.71034575", "0.7101384", "0.7053533", "0.70503783", "0.7038909" ]
0.78173405
37
phone book trie class contacts : is an array of contacts in the other they are in trie : is the trie structure with keys as followed
function PhoneBookTrie(){ var t = this; var uuid = 1; t.contacts = []; t.trie = new TrieNode();//prefix $ for address, # for number, @ for name var insertTrieNode = function (key, val){ var cur = t.trie; for (var i = 0; i < key.length; i++){ //already there, then traverse down if (typeof cur.lookup[key[i]] == 'undefined'){ cur.lookup[key[i]] = new TrieNode(); } cur = cur.lookup[key[i]]; } cur.val.push(uuid); } var searchTrieNode = function (key){ var cur = t.trie; for (var i = 0; i < key.length; i++){ if (typeof cur.lookup[key[i]] == 'undefined'){ return [];//nothing like this } cur = cur.lookup[key[i]]; } return cur.val;//return matching uuid } t.add = function (name, phone, address){ t.contacts[uuid] = {name : name, phone : phone, address : address}; //work on the trie; //name name = '@' + name; insertTrieNode(name); //phone phone = '#' + phone; insertTrieNode(phone); //address address = '$' + address; insertTrieNode(address); uuid++; } t.search = function(category, searchTerm){ switch(category.toLowerCase()){ case 'name': searchTerm = '@' + searchTerm; break; case 'phone': searchTerm = '#' + searchTerm; break; case 'address': searchTerm = '$' + searchTerm; break; } var matches = searchTrieNode(searchTerm); //uuid var ret = []; for (var i = 0; i < matches.length; i++){//lookup for contact from uuid for name ret.push(t.contacts[matches[i]]); } return ret; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Trie(){\n\tthis.word = null;\n\tthis.children = {};\n}", "function Trie() {\n\t}", "function trie (arr, itemToTokens) {\n const map = new Map();\n for (const item of arr) {\n const tokens = itemToTokens(item);\n for (const token of tokens) {\n let currentMap = map;\n for (let i = 0; i < token.length; i++) {\n const char = token.charAt(i);\n let nextMap = currentMap.get(char);\n if (!nextMap) {\n nextMap = new Map();\n currentMap.set(char, nextMap);\n }\n currentMap = nextMap;\n }\n let valuesAtCoda = currentMap.get(CODA_MARKER);\n if (!valuesAtCoda) {\n valuesAtCoda = [];\n currentMap.set(CODA_MARKER, valuesAtCoda);\n }\n valuesAtCoda.push(item);\n }\n }\n\n const search = (query, exact) => {\n let currentMap = map;\n for (let i = 0; i < query.length; i++) {\n const char = query.charAt(i);\n const nextMap = currentMap.get(char);\n if (nextMap) {\n currentMap = nextMap;\n } else {\n return []\n }\n }\n\n if (exact) {\n const results = currentMap.get(CODA_MARKER);\n return results || []\n }\n\n const results = [];\n // traverse\n const queue = [currentMap];\n while (queue.length) {\n const currentMap = queue.shift();\n const entriesSortedByKey = [...currentMap.entries()].sort((a, b) => a[0] < b[0] ? -1 : 1);\n for (const [key, value] of entriesSortedByKey) {\n if (key === CODA_MARKER) { // CODA_MARKER always comes first; it's the empty string\n results.push(...value);\n } else {\n queue.push(value);\n }\n }\n }\n return results\n };\n\n return search\n}", "function trie ( data ) {\n const root = {};\n for (key in data) {\n let val = data[key];\n if (val !== null && typeof val === 'object') {\n data[key] = trie(data[key]);\n } else {\n if (root[key.slice(0, 1)]) {\n trie_recurse(root[key.slice(0, 1)], key.slice(1, key.length), val);\n } else {\n const obj = {};\n trie_recurse(obj, key.slice(1, key.length), val);\n root[key.slice(0, 1)] = obj;\n }\n }\n }\n return root;\n}", "function Trie() {\n \n this.root = {\n children: {},\n values: []\n };\n \n }", "setChildren() {\n var children = Object.keys(this).filter(t=>t!=\"endOfWord\");\n\n children.forEach(entry => {\n if (!trieNode.prototype.isPrototypeOf(this[entry])) {\n this[entry] = Object.setPrototypeOf(this[entry], trieNode.prototype);\n }\n this[entry].setChildren();\n });\n }", "function Trie() {\n this.rootNode = {};\n}", "helperUsingTrie(str, root, start, cache) {\n if(start > str.length) return [];\n if(cache[start]) return cache[start];\n const ret = [];\n const ps = this.getPrefixes(str, root, start);\n for(let p of ps) {\n if(start + p.length == str.length) {\n ret.push(p);\n } else {\n const remainComb = this.helperUsingTrie(str, root, start + p.length, cache);\n for(let comb of remainComb) {\n ret.push(p + \" \" + comb);\n }\n }\n }\n cache[start] = ret;\n return ret;\n }", "function Trie(caseSensitive) {\n\tthis.dictionary = {};\n\tthis.$ = false;\n\n\tif(typeof caseSensitive === \"undefined\") {\n\t\tcaseSensitive = true;\n\t}\n\n\tthis.cs = caseSensitive;\n}", "function main() {\n const contacts = new Trie();\n\n let n = parseInt(readLine());\n while (n--) {\n const i = readLine().split(' ');\n const operation = i[0];\n const value = i[1];\n\n if (operation === 'add') {\n contacts.add(value);\n }\n if (operation === 'find') {\n console.log(contacts.getCount(value));\n }\n }\n}", "function Trie() {\n this.words = 0;\n this.prefixes = 0;\n this.children = [];\n }", "function orderTrie(node) {\n if (!node.c)\n return;\n const nodes = [...node.c].sort(([a], [b]) => (a < b ? -1 : 1));\n node.c = new Map(nodes);\n for (const n of node.c) {\n orderTrie(n[1]);\n }\n}", "getAllTrie(node, word, obj, consoleLog = true) {\n if (node === null) {\n return;\n }\n\n if (node.isWord) {\n let w = word + node.char;\n obj.rawData += w + ':' + node.positions + '\\n';\n obj.data[w] = node.positions;\n if (consoleLog) {\n console.log(w + ':' + node.positions);\n }\n }\n\n if (!node.nodes.isEmpty()) {\n let n = node.nodes.getIndex(0);\n //get trie child nodes\n this.getAllTrie(n, word + node.char, obj, consoleLog);\n }\n //get trie siblings nodes\n this.getAllTrie(node.next, word, obj, consoleLog);\n }", "find(prefix) {\n let currentNode = this.root;\n let output = [];\n\n // for each letter in prefix\n for(let idx = 0; idx < prefix.length; idx++){\n // decend into trie until weve reached node at prefix end\n let nextLettersIndex = prefix.charCodeAt(idx) - 97;\n // if no node at prefix end\n if (!currentNode.nextLetters[nextLettersIndex]) {\n return output;\n }\n currentNode = currentNode.nextLetters[nextLettersIndex];\n }\n // weve found a node at prefix end\n // find all words that decend from a node\n findWords(currentNode, output);\n }", "function generateTrie(array){\n trie = new TrieNode();\n for(let i = 0; i < array.length; i++) {\n let word = array[i];\n addWord(word);\n }\n}", "function makeContactList() {\n /*\n * You need something here to hold contacts. See length api for a hint:\n */\n var contacts = [];\n \n return {\n // we implemented the length api for you //\n length: function() {\n return contacts.length;\n },\n addContact: function(contact) {\n contacts.push(contact);\n return contacts;\n },\n findContact: function(fullName) {\n for (var i = 0; i < contacts.length; i++) {\n if (fullName === contacts[i].nameFirst + \" \" + contacts[i].nameLast) { return contacts[i];\n } else {\n return undefined;\n } \n }\n },\n removeContact: function(contact) {\n for (var i = 0; i < contacts.length; i++) {\n if (contacts[i] === contact) {\n contacts.splice(i, 1);\n }\n }\n \n }, printAllContactNames: function() {\n var returnedNames = \" \";\n for (var i = 0; i < contacts.length; i++) {\n returnedNames += \"\\n\" + contacts[i].nameFirst + \" \" + contacts[i].nameLast; \n } return returnedNames.trim();\n }\n \n };\n \n \n }", "traverse (str, callbackfn, thisArg) {\n let cur = this.trie\n for (let i = 0; i < str.length; i++) {\n const retChar = callbackfn.call(thisArg, str[i], i, cur)\n const tmp = cur.children[retChar]\n if (!tmp || tmp.countPrefix <= 0) return\n cur = tmp\n }\n }", "function getContacts(req, res) {\n\n\tdb.child('/contacts').once('value')\n\t.then((snapshot) => {\n\n\t\tlet database = snapshot.val();\n\n\t\tlet data = {};\n\t\tdata[\"contacts\"] = new Array();\n\n\t\tfor(let category in database) {\n\n\t\t\tlet type = {};\n\t\t\ttype[\"section\"] = category;\n\t\t\ttype[\"people\"] = new Array();\n\n\t\t\tfor(let person in database[category]) {\n\n\t\t\t\ttype[\"people\"].push(database[category][person]);\n\t\t\t}\n\n\t\t\tdata[\"contacts\"].push(type);\n\t\t}\n\n\t\tres.set('Cache-Control', 'public, max-age=3600 , s-maxage=7200');\n\t\treturn res.status(200).json({\n\t\t\tdata: data,\n\t\t\tsuccess: true\n\t\t});\n\t})\n\t.catch(() => {\n\n\t\treturn res.status(500).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'could not fetch contacts'\n\t\t});\n\t})\n\n}", "function Trie() {\n this.wordTree = {};\n this.words = 0;\n}", "function TrieNodeConstructor (wordIn) {\n if (!(this instanceof TrieNodeConstructor)) {\n return new TrieNodeConstructor(word);\n }\n this.word = wordIn || null;\n this.children = [];\n\n for (var i = 0; i < 26; i+=1) {\n this.children[i] = null;\n }\n //console.log(\"adding node\", this.word);\n}", "function getKeys()\n{\n //Loads all current contacts (existant in the links)\n jisQuery( \"a[id^='ctl00_cphLeftColumn_ctl00_repAddressBook_ctl'][id$=_lnkCharacter]\" )\n .each( function()\n {\n var tmpValue = getIdFromUrl( jisQuery( this ).attr( 'href' ) );\n _keys.push( tmpValue );\n } );\n}", "function TrieNode(key) {\n // the \"key\" value will be the character in sequence\n this.key = key;\n \n // we keep a reference to parent\n this.parent = null;\n \n // we have hash of children\n this.children = {};\n \n // check to see if the node is at the end\n this.end = false;\n }", "function startAddressBookListeners(){\n web3.shh.filter({\"topics\":[\"Addressbook\"]}).watch(function(err, msg) {\n if(err){console.log(\"ERROR:\", err);};\n var message = util.Hex2a(msg.payload);\n if(message.indexOf('request|contacts') >= 0){\n util.GetThisNodesConstellationPubKey(function(constellationKey){\n var obj = [];\n for(var account in accountMapping){\n obj.push({\n address: account,\n name: accountMapping[account],\n constellationKey: constellationKey\n });\n }\n var message = 'contacts|'+JSON.stringify(obj);\n var hexString = new Buffer(message).toString('hex');\n web3.shh.post({\n \"topics\": [\"Addressbook\"],\n \"from\": myId,\n \"payload\": hexString,\n \"ttl\": 10,\n \"workToProve\": 1\n }, function(err, res){\n if(err){console.log('err', err);}\n });\n });\n } else if(message.indexOf('contacts') >= 0){\n var messageArr = message.split('|');\n var contactObj = JSON.parse(messageArr[1]);\n for(var i in contactObj){\n var newContact = contactObj[i];\n var found = false;\n for(var j in contactList){\n var contact = contactList[j];\n if(contact && contact.address == newContact.address){\n found = true;\n contact.name = newContact.name;\n break; \n }\n }\n if(found == false){\n contactList.push(newContact);\n } \n }\n }\n });\n}", "function getContacts() {\n return contacts;\n}", "function serializeTrie(root, options = 16) {\n options = typeof options === 'number' ? { base: options } : options;\n const { base = 16, comment = '' } = options;\n const radix = base > 36 ? 36 : base < 10 ? 10 : base;\n const rows = flattenToReferences(root)\n .map(node => {\n const row = [\n ...trieToExportString(node, radix),\n '\\n',\n ]\n .join('').replace(regExTrailingComma, '$1');\n return row;\n });\n return generateHeader(radix, comment)\n .concat(rows);\n}", "function trie_recurse( obj, key, val ) {\n if ( key.length <= 1 ) {\n if (key.length < 1) {\n obj.value = val;\n }\n obj[key] = {\n value: val\n }\n return;\n }\n let n = key.slice(0, 1);\n if (!obj[n]) obj[n] = {};\n trie_recurse(obj[n], key.slice(1, key.length), val);\n}", "function SecureTrie () {\n CheckpointTrie.apply(this, arguments)\n secureInterface(this)\n}", "constructor(words) {\n this.words = new SuffixTree(words);\n this.pointers = [];\n }", "getPhoneNums() {\n let mapping = {};\n for (let contact of this.props.contacts) {\n mapping[contact.name] = contact.phone;\n }\n return mapping;\n }", "insert_to_trie(word){\n if (this.is_word(word) == false) {\n return false;\n }\n let currentNode = this.root;\n\n for (let char=0; char < word.length; char++){\n let char_index = this.char_to_index(word[char]);\n // print(f\"char: {char} | Char Index - {char_index}\")\n if (!currentNode.children[char_index]){ \n // If the character doesn't exist in the Trie; create it\n currentNode.children[char_index] = this.get_node();\n currentNode.children[char_index].ch = word[char];\n currentNode.children[char_index].word = currentNode.word + word[char];\n currentNode.children[char_index].parent = currentNode;\n } \n currentNode = currentNode.children[char_index] ;\n }\n \n currentNode.isLeaf = true; // current node is the last character\n }", "contactListNames() {\n\t var contactObjectList = Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t var contactNameList = [];\n\t for (id in contactObjectList) {\n\t\tvar first_name = contactObjectList[id][\"name\"][\"first\"];\n\t\tvar middle_name = contactObjectList[id][\"name\"][\"middle\"];\n\t\tvar last_name = contactObjectList[id][\"name\"][\"last\"];\n\t\tvar key = \"\";\n\t\t(first_name != \"\")? key += first_name + \" \" : key = key;\n\t\t(middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t\t(last_name != \"\")? key += last_name : key = key;\n\t\tcontactNameList.push(key);\n\t }\n\t return contactNameList;\n\t}", "function queryTrie(word) {\n // Loop to dig through the JSON object\n\n var searchResults = searchTrie(word, false, true);\n\n // Checks if the pathing exists in the trie, if not return empty\n var tempTrieProgress = searchResults[1];\n if(!searchResults[0]) {\n return [\"100x\",[]];\n }\n\n // Arrays to store the words constructed and the list building the words\n var wordList = [];\n var wordBuildingList = [];\n\n if (tempTrieProgress.endOfWord) {\n wordList.push(word);\n } else {\n wordBuildingList.push(word);\n }\n\n // Recursive function to construct letters and work backwards to set up to construct the next letter\n function queryList(tempTrie) {\n\n var sideBranches = Object.keys(tempTrie).filter(t=>t!=\"endOfWord\");\n\n sideBranches.forEach(branch=> {\n wordBuildingList.push(branch);\n if (\"endOfWord\" in tempTrie[branch]) {\n wordList.push(wordBuildingList.join(\"\"));\n }\n queryList(tempTrie[branch]);\n wordBuildingList.pop();\n });\n }\n\n queryList(tempTrieProgress);\n return [\"100x\",wordList];\n}", "function loadData() {\n var data = fs.readFileSync(__dirname + '/zip_codes.csv', 'utf8');\n var lines = data.split('\\r\\n');\n var trie = {};\n\n lines.forEach(function(line) {\n var parts = line.split(',');\n var zip = parts[0], city = parts[1], state = parts[2];\n var node = trie;\n \n for (var i = 0; i < zip.length; i++) {\n var num = zip[i];\n var pos = node[num];\n if (pos == null)\n node = node[num] = (i === zip.length - 1) ? [city, state] : {};\n else\n node = node[num];\n }\n });\n \n return trie;\n}", "function UpdateContacts(t)\n{\n // TODO: Spacial and Hierarchical Partitioning (Grid, BVH, etc.)\n // TODO: Group related contacts (i.e. A<->B, B<->C, and C<->D) for simultaneous processing\n // TODO: Consider resting contacts\n // TODO: Consider contact resolution ordering\n // TODO: Enable particles (particle boolean or bound_r = 0?)\n // TODO: Enable/Disable collision checking per-object\n var i; // Index A\n var j; // Index B\n var a_obj; // Object A\n var b_obj; // Object B\n\n // Reset contacts list\n contacts.splice(0,contacts.length);\n\n // Check Object Pairs\n\n for (i = 0; i < ph_objects.length; i++)\n {\n for (j = i + 1; j < ph_objects.length; j++)\n {\n a_obj = ph_objects[i];\n b_obj = ph_objects[j];\n CheckContactPair(a_obj, b_obj, t);\n }\n }\n\n // Check particle-obj pairs\n for (i = 0; i < ph_particles.length; i++)\n {\n for (j = 0; j < ph_objects.length; j++)\n {\n a_obj = ph_particles[i];\n b_obj = ph_objects[j];\n CheckContactParticleObj(a_obj, b_obj, t);\n }\n }\n}", "findValue( srcContact, [table, key], cb){\n\n if (srcContact) this._welcomeIfNewNode(srcContact);\n\n this._store.get(table.toString('hex'), key.toString('hex'), (err, out) => {\n //found the data\n if (out) cb(null, [1, out] )\n else cb( null, [0, this._kademliaNode.routingTable.getClosestToKey(key) ] )\n })\n\n }", "function wordTrie (p) {\n if (typeof p === 'string') {\n this.addPhrase(p);\n } else if ( Object.prototype.toString.call(p) === '[object Array]' ) {\n this.addPhraseByArray(p, 0);\n }\n}", "function mapFromBaseTrie (trieNode, options, callback) {\n let paths = []\n\n if (trieNode.type === 'leaf') {\n // leaf nodes resolve to their actual value\n paths.push({\n path: nibbleToPath(trieNode.getKey()),\n value: trieNode.getValue()\n })\n }\n\n each(trieNode.getChildren(), (childData, next) => {\n const key = nibbleToPath(childData[0])\n const value = childData[1]\n if (EthTrieNode.isRawNode(value)) {\n // inline child root\n const childNode = new EthTrieNode(value)\n paths.push({\n path: key,\n value: childNode\n })\n // inline child non-leaf subpaths\n mapFromBaseTrie(childNode, options, (err, subtree) => {\n if (err) return next(err)\n subtree.forEach((path) => {\n path.path = key + '/' + path.path\n })\n paths = paths.concat(subtree)\n next()\n })\n } else {\n // other nodes link by hash\n let link = { '/': cidFromHash(multicodec, value).toBaseEncodedString() }\n paths.push({\n path: key,\n value: link\n })\n next()\n }\n }, (err) => {\n if (err) return callback(err)\n callback(null, paths)\n })\n }", "findNode( srcContact, [key], cb ){\n\n const err = Validation.checkIdentity(key);\n if (err) return cb(err);\n\n if (srcContact) this._welcomeIfNewNode(srcContact);\n\n cb( null, [0, this._kademliaNode.routingTable.getClosestToKey(key) ] );\n }", "get_node(){\n return new TrieNode()\n }", "function queryList(tempTrie) {\n\n var sideBranches = Object.keys(tempTrie).filter(t=>t!=\"endOfWord\");\n\n sideBranches.forEach(branch=> {\n wordBuildingList.push(branch);\n if (\"endOfWord\" in tempTrie[branch]) {\n wordList.push(wordBuildingList.join(\"\"));\n }\n queryList(tempTrie[branch]);\n wordBuildingList.pop();\n });\n }", "getCompletions(prepend=\"\", branchString=\"\", node=this.root, completions=[]) {\n if (node.endWord) {\n completions.push(prepend+branchString);\n }\n if (!node.children) {\n return completions; \n }\n for (let letter in node.children) {\n this.getCompletions(prepend, branchString + node.children[letter].letter, node.children[letter], completions);\n }\n // console.log(\"end? \", completions);\n return completions;\n }", "getNode(){\r\n return new TrieNode()\r\n }", "function getContacts() {\n return contacts;\n }", "function Trie () {\n if (!(this instanceof Trie)) return new Trie()\n this.trie = { nodes: {} }\n}", "addNode(letter,eod=false) {\n this[letter] = new trieNode(eod);\n }", "getAll() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, false);\n return o;\n }", "function allContacts(){\r\n var temhash = new Hashtable(); \r\n var groupcontrol = document.getElementById('allconts');\r\n var tex = document.getElementById('newNameGroup');\r\n var child;\r\n while(child=groupcontrol.firstChild)\r\n groupcontrol.removeChild(child);\r\n tex.value = \"\";\r\n var groups = sessionhash.keys(); \r\n for (var i = 0; i < groups.length; i++){\r\n var contacts = sessionhash.get(groups[i]);\r\n if (contacts != null && !contacts.isEmpty()){\r\n var contactkeys = contacts.keys(); \r\n for (var j = 0; j < contactkeys.length; j++){ \r\n if (!temhash.containsKey(contactkeys[j])){\r\n temhash.put(contactkeys[j],contacts.get(contactkeys[j])); \r\n var check2 = document.createElement(\"input\");\r\n var label2 = document.createElement(\"label\");\r\n var br2 = document.createElement(\"br\"); \r\n check2.setAttribute(\"type\", \"checkbox\"); \r\n check2.setAttribute(\"value\", contactkeys[j]);\r\n check2.setAttribute(\"name\", contacts.get(contactkeys[j])); \r\n label2.innerHTML = contacts.get(contactkeys[j]);\r\n groupcontrol.appendChild(check2);\r\n groupcontrol.appendChild(label2);\r\n groupcontrol.appendChild(br2);\r\n }\r\n }\r\n } \r\n }\r\n }", "function ContactStateArray(){\r\n\t\r\n\tthis.contacts = {};//所有联络事件\r\n\tthis._keySeparator=\"_\";\r\n\tthis._contactsInteractionIDKey = {};//同一个interactionID下的所有事件KEY\r\n\tthis._contactsInteractionIDHold = {};//同一个interactionID下的所有Hold事件计数\r\n}", "insert(word){\n\t\tword = word.toUpperCase();\n\t\tvar subtrie = this.tree;\n\t\tfor(var j = 0; j < word.length; j++){\n\t\t\tvar letter = word[j];\n\t\t\t// insert letter if not already present\n\t\t\tif(subtrie.hasOwnProperty(letter) === false){ \n\t\t\t\tsubtrie[letter] = {} \n\t\t\t};\n\t\t\t// continue descending into tree\n\t\t\tsubtrie = subtrie[letter];\n\t\t}\n\t\t// finished iterating over word, add star at this depth\n\t\tsubtrie[\"*\"] = true;\n\t}", "function build() {\n for (var i = 0; i < Object.keys(object).length; i++) {\n var k = Object.keys(object)[i];\n object[k] = {};\n for (var j = 0; j < k.length; j++) {\n var w = k.replaceAt(j, wildcard);\n object[k][w] = new Number();\n for (var l = 0; l < alphabet.length; l++) {\n var nw = w.replaceAt(j, alphabet[l]);\n if (nw != k && trie.find(nw)) {\n pos = (alphabet[l].charCodeAt(0) - 'a'.charCodeAt(0));\n object[k][w] = object[k][w] | (1 << pos);\n }\n }\n }\n }\n}", "function findBibRefs() {\n// Searches text for citations/bibliographic entries by looking for text that has the format of a list of\n// authors followed by publication year, journal name, volume number and page number. \n// If such are identified, a short citation is constructed from the author list, pub year, etc and then the \n// short citation is placed in a special category within the index that is not used as an ordinary index word, \n// but rather as a \"re-router\" to the words for which the short citation stands for. In the index, the short\n// citation is entered as an entry but with a type=citation, and another field that no other entry has,\n// \"fullCit\", will hold the author last names, publication year, volume number, page number and journal name.\n// All of these items are delimited by \"_\", and the abbreviated paper ID in front, \n// ie \"454|jones_smith_white_1997_the_astronomical_journal_676_8\". Every time the short citation is found in\n// that paper, all the words in fullCit will be updated with the location information. \n xLtr.push({\"type\":\"citation\", \"priority\":\"1\",\n \"indx\":function(text, startPos) {\n this.endMatch = \"-1\";\n this.authors = \"\";\n this.pubYear = \"\";\n this.journal = \"\";\n this.page = \"\";\n this.volume = \"\";\n var authors = [];\n var pubYear = '';\n var journal = '';\n var page = '';\n var volume = '';\n var journalAbb = '';\n var tmp = '';\n var t = '';\n var m = '';\n var t1 = '';\n var t2 = '';\n var shortCit = '';\n// Strip out text starting from startPos\n text = text.slice(startPos, startPos + 5000);\n// From henceforth, need to preserve character positions because at the end, need to know the actual position\n// of the end of the match to to a bibliographic reference, so that the text can be masked out, etc by the\n// function calling this procedure. \n// to reduce complications in identifying the bibliography, remove any Jr, Sr, I, II, etc from\n text = text.replace(/([\\, ]+)(jr\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n text = text.replace(/([\\, ]+)(sr\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n text = text.replace(/([\\, ]+)(i+\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n// replace \"et al\" in the same way:\n text = text.replace(/([\\, ]+)(et\\.? *al\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n// replace \"and\" in the same way ... if there is not a comma, force one to be there\n text = text.replace(/[\\, ]+and[\\, ]+/ig, function(x){return '\\,' + x.slice(1).replace(/[ -~]/g,' ');});\n// replace \"&\" in the same way:\n text = text.replace(/[\\, ]+\\&[\\, ]+/ig, function(x){return '\\,' + x.slice(1).replace(/[ -~]/g,' ');});\n// Occurances of hypenated names is a problem, like Smith-Jones. replace such occurances to be \"Smithjones\". \n text = text.replace(/([A-Z][a-z]+)( *\\- *)([A-Z][a-z]+)/g, function(x,x1,x2,x3) {\n return x1.charAt(0).toUpperCase() + x1.slice(1).toLowerCase() + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');});\n// Occurances of names like O'Smith are a problem. Replace such occurances to be \"Osmith\"\n text = text.replace(/([A-Za-z]+)( *\\' *)([A-Za-z]+)/g, function(x,x1,x2,x3) {\n return x1.charAt(0).toUpperCase() + x1.slice(1).toLowerCase() + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');})\n// If O'Smith got rendered as O Smith, try to catch and fix that situation as well by turning O Smith into \"Osmith\"\n text = text.replace(/([A-Z])( *)([A-Z][a-z]+)/g, function(x,x1,x2,x3) {\n return x1 + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');})\n// If there are characters that are all lowercase preceding a set of characters that start with a capital letter, \n// scoot the lowercase characters into the other characters, so that \"van Smith\" becomes \"Vansmith\"\n text = text.replace(/([\\, ]+)([a-z]{2,5})( *)([A-Z][a-z]+)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5) {\n return x1 + x2.charAt(0).toUpperCase() + x2.slice(1) + x4.toLowerCase() + x5 + x3; });\n// There could be the case that \"van Smith\" was rendered as VanSmith, or that O'Smith rendered as OSmith. There can \n// only be 1 captial letter per last name, or the below algorithm fails. Need to fix this kind of situation so that VanSmith\n// turns into Vansmith and OSmith into Osmith. To fully cover all bases, find every word that starts with a lower case letter\n// but has an uppercase letter somewhere later in the word, and force all characters to be lowercase except for the first\n// letter, which is forced to be uppercase:\n text = text.replace(/([\\, ]+)([a-z]+)([A-Z])([A-Za-z]+)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5) {\n return x1 + x2.charAt(0).toUpperCase() + x2.slice(1) + x3.toLowerCase() + x4.toLowerCase() + x5; });\n// And now get any word starting with an uppercase letter but has other uppercase letters somewhere else in the word, turn\n// unto all lower case except for first letter (note that we are about to really mess up any legitimate acronyms, but \n// that's OK because these changes are not permanent to the text\n text = text.replace(/([\\, ]+)([A-Z]+)([a-z]+)([A-Z])([A-Za-z]*)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5,x6) {\n return x1 + x2.charAt(0) + x2.slice(1).toLowerCase() + x3 + x4.toLowerCase() + x5.toLowerCase() + x6; });\n// Remove any capital letters that stand in isolation -- those are likely to be initials:\n text = text.replace(/([\\, ]+)((?:[A-Z] *\\. *){1,5})(\\,? *[12]{0,1})/g, function(x,x1,x2,x3) {\n var tmp = '\\,' + (x1+x2).slice(1).replace(/[ -~]/g,' ');\n return tmp + x3.replace(/[^0-9]/g,' '); });\n// OK, now filter the text big-time, removing everything except letters, numbers and commas\n t = JSON.parse(filterTheText(/\\,/.source, text));\n// Now start looking for groups of characters that look like references within the text: Name,Name,Name2022,JournalName,000,00\n// where 000,00 is the volume and page numbers, respectively\n m = t[0].match(/^((?:(?:[A-Z][a-z]+\\,){1,20}(?:[A-Z][a-z]+)?)|(?:[A-Z][a-z]+))(?:([12]\\d\\d\\d[abc]{0,1})\\,([A-Z][A-Za-z]{1,100})\\,?(\\d+)\\,(\\d+))/);\n authors = [];\n pubYear = '';\n journal = '';\n volume = '';\n page = '';\n if (m) {\n// if the original reference is Smith, A. S., Jones, T. E., and Miller, W. D 2002, Astron. J., 145, 1\n// the filtered view would be Smith,Jones,Miller,2002,AstronJ,145,1 (note that the \"and\" and the initials would have already been\n// removed in a previous step above this \"while\" loop). Therefore, tmp will be (Smith,Jones,Miller)(2002)(AstronJ)(145)(1)\n// extract the publication year:\n pubYear = m[2].trim();\n// extract the volume number:\n volume = m[4];\n// get the page numner:\n page = m[5].replace(/[a-zA-Z]/g,''); // remove any \"L\" or other such designations, turn into pure number\n// extract the journal name and convert into the journal abbreviation, but extract from the unfiltered text:\n t1 = t[1][m[1].length + m[2].length - 1];\n t2 = t[1][m[1].length + m[2].length + m[3].length -1] + 1;\n journal = text.slice(t1,t2).replace(/[^A-Za-z0-9]/g,'');\n// determine what the full name is for this journal by consulting the xLtr's \"journal\" entries:\n tmp = xLtr.reduce(function(x1,x2,x3) {\n if (x2.type == \"journal\" && x2.abb !== undefined && x2.indx(journal,0) != \"\" && \n parseFloat(x2.endMatch) > x1[1]) {x1 = [x3,parseFloat(x2.endMatch),x2.name.toLowerCase()];} return x1;}, [-1,-1,'']);\n if (tmp[0] != -1 && tmp[1] == journal.length) { // perfect match!\n journal = tmp[2].split(' ').join('\\_'); }\n// extract the individual authors' last names:\n authors = m[1].replace(/\\,/g,' ').replace(/ +/g,' ').trim().split(' ');\n// Now that we have the author names and publication year, put together the citation likely to appear in the text\n shortCit = '';\n// Now create a citation phrase... what this bibliography reference will likely look like in the text. For example, if the bibliography\n// entry is Smith, A.K., Jones, Q. R., and Miller, D. R. 2010, ApJ, 545, 34, then the citation phrase might look like Smith et al 2010 or\n// maybe Smith, Jones & Miller 2010. Use both formats just to be certain.\n if (authors.length > 3) {\n shortCit = authors[0] + 'etal' + pubYear;\n } else if (authors.length == 3) {\n shortCit = authors[0]+'etal'+pubYear+ '\\|' +\n authors[0]+authors[1]+'and'+authors[2]+pubYear + '\\|' +\n authors[0] + authors[1] + authors[2] + pubYear; // 3 possibilities\n } else if (authors.length == 2) {\n shortCit = authors[0] + 'and' + authors[1] + pubYear + '\\|' + \n authors[0] + authors[1] + pubYear; // 2 possibilities\n } else if (authors.length == 1) {\n shortCit = authors[0] + pubYear; }\n pubYear = pubYear.replace(/[a-zA-Z]/g,'');\n this.endMatch = '' + (t[1][m[0].length-1] + 1 + startPos);\n this.authors = ([... new Set(authors)]).sort().join('\\_');\n this.pubYear = \"\"+pubYear;\n this.journal = journal;\n this.volume = volume;\n this.page = page;\n return shortCit.toLowerCase(); \n } else {return ''; } \n } });\n return;\n }", "function addTrie(word) {\n const splitWord = word.split('');\n\n // Loop to dig through the JSON object\n var tempTrieProgress = trie;\n for (i=0; i<splitWord.length; i++) {\n if (!(splitWord[i] in tempTrieProgress)) {\n tempTrieProgress.addNode(splitWord[i]);\n }\n tempTrieProgress = tempTrieProgress[splitWord[i]];\n }\n\n tempTrieProgress.endOfWord = true;\n\n saveTrie();\n}", "buildTree(tree) {\n alphabet = new Set();\n id_map = [];\n // Prepare initial node\n id = 0;\n followpos = [];\n this.type = CONCAT;\n this.c1 = new Node();\n this.c2 = new Node();\n this.c2.buildNodes({ type: \"Char\", value: \"#\" });\n this.c1.buildNodes(tree);\n this.nullable = this.c1.nullable && this.c2.nullable;\n\n // Set firstpos\n this.firstpos = new Set(this.c1.firstpos);\n if (this.c1.nullable) {\n for (let each of this.c2.firstpos) {\n this.firstpos.add(each);\n }\n }\n // Set lastpos\n this.lastpos = new Set(this.c2.lastpos);\n if (this.c2.nullable) {\n for (let each of this.c1.lastpos) {\n this.lastpos.add(each);\n }\n }\n // Set followpos\n for (let i of this.c1.lastpos) {\n for (let each of this.c2.firstpos) {\n followpos[i].add(each);\n }\n }\n\n alphabet.delete(\"#\");\n }", "setPersons() {\n var objectPersons = {\"nodes\": [], \"links\": []},\n tempNodes = [],\n tempLinks = [];\n\n this.dataAll[\"nodes\"].forEach(function(node) {\n if (node[\"id\"].includes(\"Channing, William Ellery\") ||\n (node[\"id\"].includes(\", \") && ! (node[\"id\"].includes(\"Channing\") || node[\"id\"].includes(\"Ellery,\") || node[\"id\"].includes(\"White,\"))) ||\n node[\"id\"].includes(\"Dr. Sprague\") || node[\"id\"].includes(\"Ware\") || node[\"id\"].includes(\"[Unknown]\")) {\n tempNodes.push(node);\n }\n });\n\n this.dataAll[\"links\"].forEach(function(link) {\n\n // Exclude Ellery family members\n if (! (link[\"source\"].includes(\"Ellery,\") || link[\"target\"].includes(\"Ellery,\"))) {\n // Exclude letters from Channings to Channings\n if (! (link[\"source\"].includes(\"Channing\") && link[\"target\"].includes(\"Channing\"))) {\n // Only include persons\n if ((link[\"source\"].includes(\", \") || link[\"source\"].includes(\"Dr. Sprague\") ||\n link[\"source\"].includes(\"Ware\") || link[\"source\"].includes(\"[Unknown]\")) &&\n (link[\"target\"].includes(\", \") || link[\"target\"].includes(\"Dr. Sprague\") ||\n link[\"target\"].includes(\"Ware\") || link[\"target\"].includes(\"[Unknown]\"))) {\n // If a Channing is part of the letter communication, only accept the node if\n // it is William Ellery Channing himself (letters from Channing to Channing are already dropped here)\n if ( (link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\"))\n && (link[\"source\"].includes(\"Channing, William Ellery\") || link[\"target\"].includes(\"Channing, William Ellery\")) ) {\n tempLinks.push(link);\n }\n\n // If no Channing is present, push as well\n if ( !(link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\")) ) {\n tempLinks.push(link);\n }\n }\n }\n }\n });\n\n objectPersons[\"nodes\"] = tempNodes;\n objectPersons[\"links\"] = tempLinks;\n\n return objectPersons;\n }", "function setParentCHArray(formula, chAddress) {\r\n let formulaTokens = formula.split(\" \");\r\n for (let i = 0; i < formulaTokens.length; i++) {\r\n let ascii = formulaTokens[i].charCodeAt(0);\r\n // ascii valid or not\r\n if (ascii >= 65 && ascii <= 90) {\r\n let { rid, cid } = getRIDCIDfromAddress(formulaTokens[i]);\r\n let parentObj = sheetDB[rid][cid]; //A1\r\n parentObj.children.push(chAddress); //A1.children.push(B1)-> A1=children:[B1]\r\n }\r\n }\r\n}", "findContact(contactName) {\n\t var contactObjectList = Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t var findResult = [];\n\t for (id in contactObjectList) {\n\t\tvar first_name = contactObjectList[id][\"name\"][\"first\"];\n\t\tvar middle_name = contactObjectList[id][\"name\"][\"middle\"];\n\t\tvar last_name = contactObjectList[id][\"name\"][\"last\"];\n\t\tvar key = \"\";\n\t\t(first_name != \"\")? key += first_name + \" \" : key = key;\n\t\t(middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t\t(last_name != \"\")? key += last_name : key = key;\n\t\tif (key == contactName)\n\t\t findResult.push(contactObjectList[id]);\n\t }\n\t return findResult;\n\t}", "loadContacts(){\n return new Promise((resolve, reject)=>{\n dbConnexion.child(CONTACT).set(contacts, (data)=>{\n resolve(data);\n });\n });\n }", "function wordOnPageTree(word){\n $('#instructions').html('Click the red letter to show it\\'s children in the tree structure')\n var firstArr = Object.keys(test)\n firstArr[firstArr.indexOf(word.charAt(0))] = `<span> ${word.charAt(0)}</span>`\n console.log(firstArr);\n $('#firstLetterP').html(firstArr.join(', '))\n\n var secArr = Object.keys(test[word.charAt(0)])\n secArr[secArr.indexOf(word.charAt(1))] = `<span> ${word.charAt(1)}</span>`\n $('#secLetterP').html(secArr.join(', '))\n\n var thirdArr = Object.keys(test[word.charAt(0)][word.charAt(1)])\n console.log(thirdArr);\n thirdArr[thirdArr.indexOf(word.charAt(2))] = `<span> ${word.charAt(2)}</span>`\n $('#thirdLetterP').html(thirdArr.join(', '))\n\n var fourArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)])\n fourArr[fourArr.indexOf(word.charAt(3))] = `<span> ${word.charAt(3)}</span>`\n $('#fourLetterP').html(fourArr.join(', '))\n\n var fifthArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)])\n fifthArr[fifthArr.indexOf(word.charAt(4))] = `<span> ${word.charAt(4)}</span>`\n $('#fifthLetterP').html(fifthArr.join(', '))\n\n var sixArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)])\n sixArr[sixArr.indexOf(word.charAt(5))] = `<span> ${word.charAt(5)}</span>`\n $('#sixthLeterP').html(sixArr.join(', '))\n\n var sevenArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)][word.charAt(5)])\n sevenArr[sevenArr.indexOf(word.charAt(6))] = `<span> ${word.charAt(6)}</span>`\n $('#seventhLetterP').html(sevenArr.join(', '))\n // console.log(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)][word.charAt(5)][word.charAt(6)]);\n}", "function phoneNumber(numbers) {\n let n = 0, tree = new Map();\n for (let number of numbers) {\n let node = tree;\n for (let digit of number) {\n if (! node.has(digit)) {\n n++;\n node.set(digit, new Map());\n }\n node = node.get(digit);\n }\n }\n return n;\n}", "function mapFromEthObj (trieNode, options, callback) {\n // expand from merkle-patricia-tree using leafResolver\n mapFromBaseTrie(trieNode, options, (err, basePaths) => {\n if (err) return callback(err)\n if (!leafResolver) return callback(null, basePaths)\n // expand children\n let paths = basePaths.slice()\n const leafTerminatingPaths = basePaths.filter(child => Buffer.isBuffer(child.value))\n each(leafTerminatingPaths, (child, cb) => {\n return waterfall([\n (cb) => leafResolver.util.deserialize(child.value, cb),\n (ethObj, cb) => leafResolver.resolver._mapFromEthObject(ethObj, options, cb)\n ], (err, grandChildren) => {\n if (err) return cb(err)\n // add prefix to grandchildren\n grandChildren.forEach((grandChild) => {\n paths.push({\n path: child.path + '/' + grandChild.path,\n value: grandChild.value,\n })\n })\n cb()\n })\n }, (err) => {\n if (err) return callback(err)\n callback(null, paths)\n })\n })\n }", "_loadContacts(callback){\n //Define an empty void if no callback specified\n if(callback === undefined){\n callback = _ => {};\n }\n\n var self = this;\n contactsEndpoint.contacts(this.token, function(errors, answer){\n if(errors === null){\n for (let groupAnswer of answer['Groups']){\n //Take only servers\n if(groupAnswer.GroupType == groupsEndpoints.GroupType.Large){\n //Check that server is not already existing\n if(self.servers.has(groupAnswer.GroupID) == false){\n var server = new serverModule.Server(groupAnswer.GroupID, self);\n }\n }\n }\n\n self.friendList = answer['Friends']; //Thoses friends are not useable yet (who needs friends ?)\n callback(null);\n } else {\n callback(errors);\n }\n });\n\n }", "breadthFirstSearch(array) {\n var queue = new Queue;\n queue.enqueue(this);\n var item;\n while (item = queue.dequeue()) {\n array.push(item.name)\n for (var i = 0; i < item.children.length; i++) {\n var node = item.children[i]\n queue.enqueue(node)\n }\n }\n return array;\n }", "get contactFolders() {\r\n return new ContactFolders(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "function TrieSetConstructor () {\n if (!(this instanceof TrieSetConstructor)) {\n return new TrieSetConstructor(word);\n }\n this.root = new TrieNodeConstructor(\"\");\n this.trieSize = 0;\n this.radixTable = {};\n this.radixLength = 26;\n for (var i = 0; i < this.radixLength; i+=1) {\n var letter = String.fromCharCode(97 + i);\n this.radixTable[letter] = i;\n }\n}", "function AddressBook() {\n this.contacts = [],\n this.currentId = 0\n}", "function ResolveContacts(t)\n{\n var a, b;\n\n // Go through all contacts\n for (var i in contacts)\n {\n a = contacts[i].a;\n b = contacts[i].b;\n\n // TODO: Physics contact resolution\n\n // Special Particle Actions\n // a object\n if (a instanceof PhysParticle)\n {\n // Check delete_on_contact property\n if (a.delete_on_contact)\n {\n // Mark for deletion\n a.dead = true;\n }\n }\n // b object\n if (b instanceof PhysParticle)\n {\n // Check delete_on_contact property\n if (b.delete_on_contact)\n {\n // Mark for deletion\n b.dead = true;\n }\n }\n }\n\n // Contact list is reset at beginning of \"UpdateContacts\" function\n}", "function autoFormChildKeys(ss, name) { // 1798\n name = SimpleSchema._makeGeneric(name); // 1799\n var prefix = name + \".\"; // 1800\n // 1801\n var childKeys = []; // 1802\n _.each(ss._schemaKeys, function (key) { // 1803\n // If it's a direct child, add it to the list // 1804\n if (key.indexOf(prefix) === 0) { // 1805\n var ending = key.slice(prefix.length); // 1806\n if (ending.indexOf('.') === -1) { // 1807\n childKeys.push(ending); // 1808\n } // 1809\n } // 1810\n }); // 1811\n return childKeys; // 1812\n} // 1813", "function Trie() {\n this.root = new TrieNode(null);\n }", "function convertToTrie(entries) {\n\t\tvar trie = {}, url, urlFixed, i, value, letters, letter, cur, node;\n\n\t\tfor (url in entries) {\n\t\t\turlFixed = url;\n\n\t\t\t// find any strings to break\n\t\t\tfor (i = 0; i < impl.xssBreakWords.length; i++) {\n\t\t\t\t// Add a xssBreakDelim character after the first letter. optimizeTrie will\n\t\t\t\t// ensure this sequence doesn't get combined.\n\t\t\t\turlFixed = urlFixed.replace(impl.xssBreakWords[i], \"$1\" + xssBreakDelim + \"$2\");\n\t\t\t}\n\n\t\t\tif (!entries.hasOwnProperty(url)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvalue = entries[url];\n\t\t\tletters = urlFixed.split(\"\");\n\t\t\tcur = trie;\n\n\t\t\tfor (i = 0; i < letters.length; i++) {\n\t\t\t\tletter = letters[i];\n\t\t\t\tnode = cur[letter];\n\n\t\t\t\tif (typeof node === \"undefined\") {\n\t\t\t\t\t// nothing exists yet, create either a leaf if this is the end of the word,\n\t\t\t\t\t// or a branch if there are letters to go\n\t\t\t\t\tcur = cur[letter] = (i === (letters.length - 1) ? value : {});\n\t\t\t\t}\n\t\t\t\telse if (typeof node === \"string\") {\n\t\t\t\t\t// this is a leaf, but we need to go further, so convert it into a branch\n\t\t\t\t\tcur = cur[letter] = { \"|\": node };\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (i === (letters.length - 1)) {\n\t\t\t\t\t\t// this is the end of our key, and we've hit an existing node. Add our timings.\n\t\t\t\t\t\tcur[letter][\"|\"] = value;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// continue onwards\n\t\t\t\t\t\tcur = cur[letter];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn trie;\n\t}", "refersTo() {\n //calculate links\n this.compute('coreference')\n // return them\n return this.map(m => {\n if (!m.found) {\n return m.none()\n }\n let term = m.docs[0][0]\n if (term.reference) {\n return m.update([term.reference])\n }\n return m.none()\n })\n }", "function findContact(searchTerm){\n searchResults = [];\n\n var list = contacts.find().fetch();\n console.log(list);\n for(var i=0; i < list.length; i++)\n {\n obj = list[i];\n if(obj.firstname == searchTerm || obj.lastname === searchTerm || obj.gender === searchTerm || obj.email === searchTerm || obj.number === searchTerm || obj.latitude === searchTerm || obj.longitude === searchTerm)\n {\n searchResults.push(obj);\n }\n }\n Session.set(\"searchRes\",searchResults);\n}", "_replicateStoreToNewNode(contact, iterator, cb){\n\n if (!iterator ) //first time\n iterator = this._store.iterator();\n\n let itValue = iterator.next();\n\n while (itValue.value && !itValue.done) {\n\n const table = itValue.value[0].slice( 0, itValue.value[0].indexOf(':') );\n const key = itValue.value[0].slice( itValue.value[0].indexOf(':') + 1);\n\n const value = itValue.value[1];\n\n const keyNode = Buffer.from(key, 'hex');\n const neighbors = this._kademliaNode.routingTable.getClosestToKey(contact.identity)\n\n let newNodeClose, thisClosest;\n if (neighbors.length){\n const last = BufferUtils.xorDistance( neighbors[neighbors.length-1].identity, keyNode );\n newNodeClose = Buffer.compare( BufferUtils.xorDistance( contact.identity, keyNode), last );\n const first = BufferUtils.xorDistance( neighbors[0].identity, keyNode );\n thisClosest = Buffer.compare( BufferUtils.xorDistance( this._kademliaNode.contact.identity, keyNode ), first)\n }\n\n if (!neighbors.length || ( newNodeClose < 0 && thisClosest < 0 ) )\n return this.sendStore(contact, [ table, key, value], (err, out) => {\n\n if (err)\n return cb(err); //error\n\n NextTick( this._replicateStoreToNewNode.bind(this, contact, iterator, cb), global.KAD_OPTIONS.T_REPLICATE_TO_NEW_NODE_SLEEP )\n\n });\n else\n itValue = iterator.next();\n\n }\n\n if (!itValue.value || !itValue.done)\n cb(null, \"done\");\n\n }", "function AddressBook() {\n this.contacts = {};\n this.currentId = 0;\n}", "function AddressBook() {\n this.contacts = {};\n this.currentId = 0;\n}", "function ref (root, path, affected, position) {\n var parent = get_at(root, path.slice(0, -1))\n var key = path.slice(-1)[0]\n var val = get_or_create(parent, key)\n\n var self = {\n path (p) {\n return ref(val, array_from_lua(p), affected, position.concat(p))\n },\n\n child (k) {\n return ref(val, [k], affected, position.concat(k))\n },\n\n get () {\n return val\n },\n\n get_at (p) {\n return get_at(val, array_from_lua(p))\n },\n\n search (q, pathindexer) {\n pathindexer = array_from_lua(pathindexer)\n var wordmap = {}\n if (typeof val === 'object') {\n for (let i = 0; i < val.length; i++) {\n let word = get_at(val[i], pathindexer)\n if (typeof word !== 'string') continue\n let ref = self.child(i)\n wordmap[word] = ref\n }\n } else return []\n\n return fuzzyset(Object.keys(wordmap))\n .get(q)\n .map(([score, word]) => ({score, word, ref: wordmap[word]}))\n },\n\n replace (v) {\n parent[key] = v\n affected.push({kind: 'replace', at: position, val: v})\n },\n\n merge (v) {\n parent[key] = deepmerge(val, v)\n affected.push({kind: 'merge', at: position, val: v})\n },\n\n set_at (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, () => v)\n affected.push({kind: 'set', at: position.concat(arraypath), val: v})\n },\n\n delete_at (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, () => null)\n affected.push({kind: 'delete', at: position.concat(arraypath), val: v})\n },\n\n append_to (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n arr = []\n }\n arr.push(v)\n return arr\n })\n affected.push({kind: 'append', at: position.concat(arraypath), val: v})\n },\n\n prepend_to (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n arr = []\n }\n arr.unshift(v)\n return arr\n })\n affected.push({kind: 'prepend', at: position.concat(arraypath), val: v})\n },\n\n remove_from (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n return []\n }\n\n while (arr.indexOf(v) !== -1) {\n let index = arr.indexOf(v)\n arr.splice(index, 1)\n }\n })\n affected.push({kind: 'remove', at: position.concat(arraypath), val: v})\n }\n }\n\n return self\n}", "MapTriangleToNodes(t) {\n if (this.front_ === null) {\n throw new Error(\"this.front_ === null\");\n }\n for (let i = 0; i < 3; i++) {\n if (!t.GetNeighbor(i)) {\n // Node* n = front_->LocatePoint(t.PointCW(*t.GetPoint(i)));\n const n = this.front_.LocatePoint(t.PointCW(t.GetPoint(i)));\n if (n)\n n.triangle = t;\n }\n }\n }", "function snomTbookProcessCards(telephoneBook, addressBooks) {\n // all entries\n let entries = [];\n // prevent duplicate entries\n let uniqueEntries = [];\n // determine which vCards from which accounts are needed\n let accounts = [];\n if (\"accounts\" in telephoneBook) {\n accounts = telephoneBook.accounts;\n }\n else {\n // default to all address books\n for (let i = 0; i < addressBooks.length; i++) {\n accounts.push({ \"account\": i + 1 });\n }\n }\n // replace work with business\n let telephoneBookOrder = telephoneBook.order;\n if (telephoneBookOrder.indexOf('work') > -1)\n telephoneBookOrder[telephoneBookOrder.indexOf('work')] = 'business';\n // iterate over all accounts\n for (let account of accounts) {\n // iterate all vCards of the address book\n for (let vcard of addressBooks[account.account - 1]) {\n // parse vCard\n let vcf = utilParseVcard(vcard);\n // skip if no telephone number\n if (vcf.tels.length === 0)\n continue;\n // check for dial prefix\n let prefix = \"prefix\" in account ? account.prefix : '';\n // process card\n let entry = snomTbookProcessCard(vcf, telephoneBook.fullname, telephoneBookOrder, prefix, telephoneBook.duplicates, uniqueEntries);\n if (entry)\n entries.push(...entry);\n }\n }\n return {\n tbook: [\n { _attr: { complete: 'true' } },\n ...entries\n ]\n };\n}", "function Addressbook() {\n this.contacts = [];\n this.currentId = 0;\n}", "function chosenGoingTo(){\n let localContacts;\n //llamando a la referencia de data base\n database.ref('localContacts').once('value')\n .then((local) => {\n local.forEach((localContact) => { \n const string = JSON.stringify(localContact);\n const evaluar = string.includes('Laboratoria');\n console.log(evaluar);\n //console.log(JSON.stringify(local.nombre));\n //console.log(localContacts);\n });\n });\n}", "function getDataMap(pSorted){\n // return [{\n // \"text\": \"HANAMURA\",\n // \"children\": [\n // {\n // id: 'HANAMURA A',\n // text: 'Hanamura A'\n // },\n //]},{...}]\n\n var result = [];\n for (var lMap in pSorted) {\n result.push({\n \"text\": lMap,\n \"children\":getChildrenMaps(pSorted[lMap], lMap)\n });\n }\n\n return result;\n }", "query(letter) {\n const newPointers = [];\n\n let hasWord = false;\n\n for (let pointer of this.pointers) {\n const currNode = pointer.children[letter];\n\n if (currNode) {\n newPointers.push(currNode);\n\n if (currNode.isEnd) {\n hasWord = true;\n }\n }\n }\n\n if (this.words.hasFirstLetter(letter)) {\n newPointers.push(this.words.root[letter]);\n\n if (this.words.root[letter].isEnd) {\n hasWord = true;\n }\n }\n\n this.pointers = newPointers;\n\n return hasWord;\n }", "function setParents(currFormula) {\n let arr = currFormula.split(\" \");\n for (let i = 0; i < arr.length; i++) {\n let c = arr[i].charCodeAt(0); // if it starts from A-Z\n if (c >= 65 && c <= 90) {\n let { rid, cid } = getValueOfRC(arr[i]); // address nikala and then putted it in children array\n sheetDB[rid][cid].children.push(addressInput.value);\n }\n }\n}", "function _get_client_contacts_list(db){\n try{ \n var rows = db.execute('SELECT * FROM my_client_contact WHERE status_code=1 and client_id in ('+\n 'select a.client_id from my_'+_type+' as a where a.id=?) and '+\n 'id in (select b.client_contact_id from my_'+_type+'_client_contact as b where b.'+_type+'_id=? and b.status_code=1)',_selected_job_id,_selected_job_id);\n var b = 0;\n if(rows.getRowCount() > 0){\n while(rows.isValidRow()){\n var row = Ti.UI.createTableViewRow({\n filter_class:'client_contact',\n className:'client_contact_list_data_row_'+b,\n hasChild:true,\n source:_source,\n job_id:_selected_job_id,\n client_id:rows.fieldByName('client_id'),\n contact_id:rows.fieldByName('id'),\n title:rows.fieldByName('first_name')+' '+rows.fieldByName('last_name'),\n mobile:rows.fieldByName('phone_mobile'),\n email:rows.fieldByName('email')\n }); \n if(b === 0){\n row.header = 'Client Contacts';\n }\n self.data.push(row);\n rows.next();\n b++;\n }\n }\n rows.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_client_contacts_list');\n return;\n } \n }", "function LazyTrie(baseURL, rootURL) {\n //console.log(\"js.LazyPatricia.LazyTrie baseURL: \" + baseURL);\n //console.log(\"js.LazyPatricia.LazyTrie rootURL: \" + rootURL);\n\n this.baseURL = baseURL;\n var trie = this;\n\n dojo.xhrGet({url: rootURL,\n handleAs: \"json\",\n load: function(o) {\n if (!o) {\n //console.log(\"failed to load trie\");\n return;\n }\n trie.root = o;\n trie.extra = o[0];\n if (trie.deferred) {\n trie.deferred.callee.apply(trie, trie.deferred);\n delete trie.deferred;\n }\n }\n });\n}", "get_suggestions(){\n let newsuggestions = {}\n for(var key in this.suggestions){\n if (this.suggestions.hasOwnProperty(key)) { \n newsuggestions[key] = new Suggestion(this.suggestions[key].get_treeDataObjects())\n }\n }\n return newsuggestions;\n }", "function getKeysDataPeople(keysData) {\n var keysPeople = {}\n return Promise.map(keysData, function(row, i) {\n//Parse out the keyholder as a person\n var keyholder = (row['FIRST'].trim() + ' ' + row['LAST NAME'].trim()).trim();\n keysPeople[keyholder] = keysPeople[keyholder] || {\n name: keyholder, \n given_name: row['FIRST'].trim().replace('.', ''),\n family_name: row['LAST NAME'].trim(),\n keys: {},\n puid: row['PUID'],\n status: row['STATUS'],\n department: row['DEPARTMENT'],\n _type: 'person',\n }\n\t\tkeysPeople[keyholder].keys[row['KEY NUMBER']] = {\n\t\t\tidentifier: row['KEY IDENTIFIER'] || '',\n\t\t\tbuildings: row['BUILDING'],\n\t\t\troom: row['ROOM NUMBER'],\n\t\t\tnumber: row['KEY NUMBER'],\n\t\t\tdate: row['DATE'],\n\t\t};\n console.log(keysPeople[keyholder])\n keysPeople[keyholder].fulltext = createFullText(keysPeople[keyholder], searchablePeopleAttributes);\n\n//Parse out the supervisor as a person\n if (row['SUPERVISOR'] && (row['SUPERVISOR'].trim().length > 0)) {\n var supervisor = row['SUPERVISOR'].trim();\n var name = supervisor[0] + supervisor.substring(1, supervisor.length).toLowerCase();\n keysPeople[name] = {\n name: name,\n family_name: name,\n department: row['DEPARTMENT'],\n _type: 'person',\n }\n keysPeople[name].fulltext = createFullText(keysPeople[name], searchablePeopleAttributes);\n }\n return null\n }).then(function(){\n return keysPeople\n })\n}", "display() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, true);\n }", "find(value, parent = this.root) {\n // loop through every letter in the value\n for (let i = 0; i < value.length; i++){\n //\n parent = parent.children.find(child => child.value[i] === value[i]);\n\n if (!parent){\n return null;\n }\n }\n return parent;\n }", "find(value, parent = this.root) {\n // loop through every letter in the value\n for (let i = 0; i < value.length; i++){\n //\n parent = parent.children.find(child => child.value[i] === value[i]);\n\n if (!parent){\n return null;\n }\n }\n return parent;\n }", "randomTrie(num) {\n\t\tif (num > 993) num = 993\n\t\tlet allWords = words['words']\n\t\tlet upper = 0\n\t\tlet lower = num * 2 + 10\n\t\tlet elements = new Set()\n\t\tfor (let i = 0; i < num; i++) {\n\t\t\tlet value =\n\t\t\t\tMath.floor(Math.random() * (upper - lower + 1)) + lower\n\t\t\twhile (elements.has(value) || value > 993) {\n\t\t\t\tvalue =\n\t\t\t\t\tMath.floor(Math.random() * (upper - lower + 1)) + lower\n\t\t\t}\n\t\t\telements.add(value)\n\t\t\tthis.insert(allWords[value])\n\t\t}\n\t}", "function getPhoneContactsSuccess(contacts){\r\n\tconsole.log(\"# of contacts: \" + contacts.length);\r\n\tvar phoneContactsArrayCount = 0;\r\n\tfor(var i=0;i<contacts.length;i++){\r\n\t\t//phoneContacts[i] = new Contact();\r\n\t\t//phoneContacts[i].contactName = contacts[i].displayName;\r\n\t\tif(contacts[i].phoneNumbers){\r\n\t\t\tfor(var j=0;j<contacts[i].phoneNumbers.length;j++){\r\n\t\t\t\tphoneContactsArray[phoneContactsArrayCount] = contacts[i].phoneNumbers[j].value.replace(/\\D/g,'');\r\n\t\t\t\t//phoneContacts[i].contactPhones[j] = contacts[i].phoneNumbers[j].value;\r\n\t\t\t\tnamePhoneMapping[contacts[i].phoneNumbers[j].value.replace(/\\D/g,'')] = contacts[i].displayName;\r\n\t\t\t\tphoneContactsArrayCount++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\tconsole.log(JSON.stringify(phoneContactsArray));\r\n\tif(isnearBy){\r\n\t\t//window.location = \"nearByContactsMap.html\";\r\n\t\t$(\"#pagePort\").load(\"nearByContactsMap.html\", function(){\r\n\t\t\tisInNearBy = true;\r\n\t\t\tisInChatList = false;\r\n\t\t\t$('#pagePort').css(\"background-image\",\"none\");\r\n\t\t\t$('#pagePort').trigger(\"create\");\r\n\t\t\t/**analytics**/\r\n\t\t\tga('send', 'pageview', {\r\n\t\t\t\t'page': 'nearByContactsMap.html',\r\n\t\t\t\t'title': 'Friends finder map'\r\n\t\t\t});\r\n\t\t\tregisterNewSocket();\r\n\t\t\tinitializeNearBy();\r\n\t\t\t\r\n\t\t});\r\n\t\treturn;\r\n\t}\r\n\tconsole.log(\"hello geo\");\r\n\tgetMyLocation();\r\n}", "function listAddresses(obj){\n\tfor (key in obj){\n\t\tfor (let i=0; i<obj[key].length; i++){\n\t\t\tconsole.log(i==0 ? key+\"\\n\"+obj[key][i] : obj[key][i]);\n\t\t}\n\t}\n}", "extractReferences(index, count, first_object_id) {\n let _refs = [];\n let res = { result: null, start_index: -1, end_index: index };\n for (let i = 0; count === -1 || i < count; ++i) {\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let pointer = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let generation = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let ptr_flag = res.result;\n let isFree = ptr_flag[0] === 102; // 102 = f\n _refs.push({\n id: first_object_id + i,\n pointer: pointer,\n generation: generation,\n free: isFree,\n update: !isFree\n });\n // if the word trailer occurs stop since we reached the end\n if (this.data[util_1.Util.skipSpaces(this.data, res.end_index + 1)] === 116) {\n break;\n }\n }\n return { refs: _refs, end_index: res.end_index };\n }", "constructor() {\n\t\tthis.trie = new Map();\n\t}", "function initContactList() {\n // Get a reference to the database service for \"user\" node.\n var database = firebase.database();\n var ref = database.ref(\"bbmsdk/identity/users/\");\n\n // If the local user isn't already registered in firebase, add them now.\n database.ref('bbmsdk/identity/users/' + firebase.auth().currentUser.uid).set({\n regId: userRegId,\n email: googleUserEmail,\n avatarUrl: googleUserAvatarImageURL,\n name: googleUserName\n }).catch(function (error) {\n console.error('Error registering user in firebase: ' + error);\n });\n\n //listen to 'child_added' from \"user\" node in the database.\n ref.on('child_added', function (user) {\n var regId = user.val().regId;\n var name = user.val().name;\n var key = user.key;\n\n if (regId !== undefined) {\n //exclude the local user from the contact list\n if (regId !== userRegId) {\n console.log(\"Rich Chat: Firebase 'User' - child_added: \" + name\n + \" key: \" + key + \" regId: \" + regId);\n\n //Check if the contact map contains a contact that has the same regId\n if (contactsMap[regId] == undefined) {\n //Create a BBMData (having id: 'contact-RegId') to wrap \"user\" object for data binding\n var contactData = new BBMData(DATA_BIND_PREFIX_CONTACT + regId);\n\n // Add the user into the map, so the user can be found by its regId.\n // This must happen first so that any updates that are triggered by calling\n // contactData.set() below will be able to find the relevant data.\n contactsMap[regId] = contactData;\n\n //At this point, we only set the properties needed by UI elements.\n contactData.set(DATA_CONTACT_NAME, name);\n contactData.set(DATA_CONTACT_IMG_URL, user.val().avatarUrl);\n\n //Add the user to the list on the contact tab to display\n addContactToContactTab(regId);\n } else {\n //Filter out a new contact who has the same regId with the existing contact in the map.\n //This is to avoid the duplicated contacts in the current database.\n console.log(\"Rich Chat: Contact map already has an entry with the same RegId: \" + regId\n + \". This 'User' of name: \" + name + \" key: \" + key + \" will be ignored.\");\n }\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n\n //listen to 'child_changed' from \"user\" node in the database.\n ref.on('child_changed', function (user) {\n var regId = user.val().regId;\n var name = user.val().name;\n var contactData = contactsMap[regId];\n\n console.log(\"Rich Chat: Firebase 'User' - child_changed: \" + name + \" key: \" + user.key\n + \" regId: \" + regId);\n\n if (regId !== undefined) {\n //Check if the contact map contains a contact that has the same regId\n if (contactData != undefined) {\n //Replace the properties with the new ones and the data binder should trigger the UI elements to update\n contactData.set(DATA_CONTACT_NAME, name);\n contactData.set(DATA_CONTACT_IMG_URL, user.val().avatarUrl);\n } else {\n //Prevent the map from updating a contact that was never added before\n console.log(\"Rich Chat: Firebase 'User' of RegId: \" + regId\n + \" has never been added to map before. Ignore this child_changed\");\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n\n //listen to 'child_removed' from \"user\" node in the database.\n ref.on('child_removed', function (user) {\n var regId = user.val().regId;\n\n console.log(\"Rich Chat: Firebase 'User' - child_removed: \" + user.val().name + \" key: \" + user.key\n + \" regId: \" + regId);\n\n if (regId !== undefined) {\n //Check if the contact map contains a contact that has the same regId\n if (contactsMap[regId] != undefined) {\n //remove the user from the map\n delete contactsMap[regId];\n\n //remove the user from the list on the contact tab\n removeContactFromContactTab(regId);\n } else {\n //Prevent the map from removing a contact that was never added before\n console.log(\"Rich Chat: Firebase 'User' of RegId: \" + regId\n + \" has never been added to map before. Ignore this child_removed\");\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n}", "function getTerms(array) {\n let curr = 0;\n for(let i = 0; i < minLevel; i++) {\n terms[i] = [];\n }\n for(let i = minLevel; i <= maxLevel; i++){\n terms[i] = [];\n curr = 0;\n for(let j = 0; j < array.length; j++){\n if(parseInt(array[j]['level']) === i){\n terms[i][curr] = {name: '', id: ''};\n terms[i][curr]['name'] = array[j]['name'];\n terms[i][curr]['id'] = array[j]['ID'];\n curr++;\n } \n }\n }\n }", "function filterContact(contacts) {\n return _.chain(contacts).groupBy((contact) => {\n // group contact to detect contact that are the same\n const contactCopy = {\n lastName: contact.lastName,\n firstName: contact.firstName,\n };\n if (contact.address) {\n contactCopy.address = {\n country: contact.address.country,\n line1: contact.address.line1,\n zip: contact.address.zip,\n city: contact.address.city,\n };\n }\n return JSON.stringify(contactCopy);\n }).map(groups => groups[0]).filter(contact => _.get(contact, 'address') && ['BE', 'FR', 'CH'].indexOf(contact.address.country) > -1)\n .value();\n }" ]
[ "0.58253497", "0.58040035", "0.5803537", "0.56999886", "0.5697964", "0.56910306", "0.5688914", "0.56153136", "0.5470733", "0.54263145", "0.5307313", "0.52863944", "0.5252589", "0.5246136", "0.5243802", "0.522956", "0.51908535", "0.5180295", "0.5177391", "0.5158725", "0.5144691", "0.50959086", "0.5085638", "0.5050304", "0.50277036", "0.4999493", "0.4990064", "0.49844706", "0.49830213", "0.4976203", "0.49695885", "0.49670303", "0.49610907", "0.4957331", "0.4936451", "0.49305806", "0.49042028", "0.49001423", "0.4897109", "0.48931488", "0.48875162", "0.48825356", "0.4862362", "0.48597416", "0.48461643", "0.48264527", "0.4816106", "0.48130074", "0.48008317", "0.47982398", "0.478874", "0.47881556", "0.47621003", "0.47487667", "0.47301948", "0.47080606", "0.46720222", "0.4671419", "0.4670027", "0.4663181", "0.46598437", "0.46559572", "0.46496883", "0.4649236", "0.4649236", "0.46460018", "0.46348312", "0.46335053", "0.46199715", "0.46190184", "0.46020272", "0.45943862", "0.4593035", "0.45872048", "0.4573241", "0.4573241", "0.45578548", "0.4545176", "0.45420116", "0.45403695", "0.4527023", "0.4518122", "0.4517632", "0.45149383", "0.45098838", "0.45089656", "0.4507864", "0.45074242", "0.45069474", "0.44999734", "0.44999734", "0.44998097", "0.4492882", "0.44910803", "0.4489386", "0.44860846", "0.4481777", "0.44806674", "0.44775552" ]
0.8099619
1
phone book trie class contacts : is an array of contacts in the other they are in trie : is the trie structure with keys as followed
function PhoneBookTrie(){ var t = this; var uuid = 1; t.contacts = []; t.trie = new TrieNode();//prefix $ for address, # for number, @ for name var insertTrieNode = function (key, val){ var cur = t.trie; for (var i = 0; i < key.length; i++){ //already there, then traverse down if (typeof cur.lookup[key[i]] == 'undefined'){ cur.lookup[key[i]] = new TrieNode(); } cur = cur.lookup[key[i]]; } cur.val.push(uuid); } var searchTrieNode = function (key){ var cur = t.trie; for (var i = 0; i < key.length; i++){ if (typeof cur.lookup[key[i]] == 'undefined'){ return [];//nothing like this } cur = cur.lookup[key[i]]; } return cur.val;//return matching uuid } t.add = function (name, phone, address){ t.contacts[uuid] = {name : name, phone : phone, address : address}; //work on the trie; //name name = '@' + name; insertTrieNode(name); //phone phone = '#' + phone; insertTrieNode(phone); //address address = '$' + address; insertTrieNode(address); uuid++; } t.search = function(category, searchTerm){ switch(category.toLowerCase()){ case 'name': searchTerm = '@' + searchTerm; break; case 'phone': searchTerm = '#' + searchTerm; break; case 'address': searchTerm = '$' + searchTerm; break; } var matches = searchTrieNode(searchTerm); //uuid var ret = []; for (var i = 0; i < matches.length; i++){//lookup for contact from uuid for name ret.push(t.contacts[matches[i]]); } return ret; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Trie(){\n\tthis.word = null;\n\tthis.children = {};\n}", "function trie (arr, itemToTokens) {\n const map = new Map();\n for (const item of arr) {\n const tokens = itemToTokens(item);\n for (const token of tokens) {\n let currentMap = map;\n for (let i = 0; i < token.length; i++) {\n const char = token.charAt(i);\n let nextMap = currentMap.get(char);\n if (!nextMap) {\n nextMap = new Map();\n currentMap.set(char, nextMap);\n }\n currentMap = nextMap;\n }\n let valuesAtCoda = currentMap.get(CODA_MARKER);\n if (!valuesAtCoda) {\n valuesAtCoda = [];\n currentMap.set(CODA_MARKER, valuesAtCoda);\n }\n valuesAtCoda.push(item);\n }\n }\n\n const search = (query, exact) => {\n let currentMap = map;\n for (let i = 0; i < query.length; i++) {\n const char = query.charAt(i);\n const nextMap = currentMap.get(char);\n if (nextMap) {\n currentMap = nextMap;\n } else {\n return []\n }\n }\n\n if (exact) {\n const results = currentMap.get(CODA_MARKER);\n return results || []\n }\n\n const results = [];\n // traverse\n const queue = [currentMap];\n while (queue.length) {\n const currentMap = queue.shift();\n const entriesSortedByKey = [...currentMap.entries()].sort((a, b) => a[0] < b[0] ? -1 : 1);\n for (const [key, value] of entriesSortedByKey) {\n if (key === CODA_MARKER) { // CODA_MARKER always comes first; it's the empty string\n results.push(...value);\n } else {\n queue.push(value);\n }\n }\n }\n return results\n };\n\n return search\n}", "function Trie() {\n\t}", "function trie ( data ) {\n const root = {};\n for (key in data) {\n let val = data[key];\n if (val !== null && typeof val === 'object') {\n data[key] = trie(data[key]);\n } else {\n if (root[key.slice(0, 1)]) {\n trie_recurse(root[key.slice(0, 1)], key.slice(1, key.length), val);\n } else {\n const obj = {};\n trie_recurse(obj, key.slice(1, key.length), val);\n root[key.slice(0, 1)] = obj;\n }\n }\n }\n return root;\n}", "function Trie() {\n \n this.root = {\n children: {},\n values: []\n };\n \n }", "setChildren() {\n var children = Object.keys(this).filter(t=>t!=\"endOfWord\");\n\n children.forEach(entry => {\n if (!trieNode.prototype.isPrototypeOf(this[entry])) {\n this[entry] = Object.setPrototypeOf(this[entry], trieNode.prototype);\n }\n this[entry].setChildren();\n });\n }", "function Trie() {\n this.rootNode = {};\n}", "helperUsingTrie(str, root, start, cache) {\n if(start > str.length) return [];\n if(cache[start]) return cache[start];\n const ret = [];\n const ps = this.getPrefixes(str, root, start);\n for(let p of ps) {\n if(start + p.length == str.length) {\n ret.push(p);\n } else {\n const remainComb = this.helperUsingTrie(str, root, start + p.length, cache);\n for(let comb of remainComb) {\n ret.push(p + \" \" + comb);\n }\n }\n }\n cache[start] = ret;\n return ret;\n }", "function Trie(caseSensitive) {\n\tthis.dictionary = {};\n\tthis.$ = false;\n\n\tif(typeof caseSensitive === \"undefined\") {\n\t\tcaseSensitive = true;\n\t}\n\n\tthis.cs = caseSensitive;\n}", "function main() {\n const contacts = new Trie();\n\n let n = parseInt(readLine());\n while (n--) {\n const i = readLine().split(' ');\n const operation = i[0];\n const value = i[1];\n\n if (operation === 'add') {\n contacts.add(value);\n }\n if (operation === 'find') {\n console.log(contacts.getCount(value));\n }\n }\n}", "function Trie() {\n this.words = 0;\n this.prefixes = 0;\n this.children = [];\n }", "function orderTrie(node) {\n if (!node.c)\n return;\n const nodes = [...node.c].sort(([a], [b]) => (a < b ? -1 : 1));\n node.c = new Map(nodes);\n for (const n of node.c) {\n orderTrie(n[1]);\n }\n}", "getAllTrie(node, word, obj, consoleLog = true) {\n if (node === null) {\n return;\n }\n\n if (node.isWord) {\n let w = word + node.char;\n obj.rawData += w + ':' + node.positions + '\\n';\n obj.data[w] = node.positions;\n if (consoleLog) {\n console.log(w + ':' + node.positions);\n }\n }\n\n if (!node.nodes.isEmpty()) {\n let n = node.nodes.getIndex(0);\n //get trie child nodes\n this.getAllTrie(n, word + node.char, obj, consoleLog);\n }\n //get trie siblings nodes\n this.getAllTrie(node.next, word, obj, consoleLog);\n }", "find(prefix) {\n let currentNode = this.root;\n let output = [];\n\n // for each letter in prefix\n for(let idx = 0; idx < prefix.length; idx++){\n // decend into trie until weve reached node at prefix end\n let nextLettersIndex = prefix.charCodeAt(idx) - 97;\n // if no node at prefix end\n if (!currentNode.nextLetters[nextLettersIndex]) {\n return output;\n }\n currentNode = currentNode.nextLetters[nextLettersIndex];\n }\n // weve found a node at prefix end\n // find all words that decend from a node\n findWords(currentNode, output);\n }", "function generateTrie(array){\n trie = new TrieNode();\n for(let i = 0; i < array.length; i++) {\n let word = array[i];\n addWord(word);\n }\n}", "function makeContactList() {\n /*\n * You need something here to hold contacts. See length api for a hint:\n */\n var contacts = [];\n \n return {\n // we implemented the length api for you //\n length: function() {\n return contacts.length;\n },\n addContact: function(contact) {\n contacts.push(contact);\n return contacts;\n },\n findContact: function(fullName) {\n for (var i = 0; i < contacts.length; i++) {\n if (fullName === contacts[i].nameFirst + \" \" + contacts[i].nameLast) { return contacts[i];\n } else {\n return undefined;\n } \n }\n },\n removeContact: function(contact) {\n for (var i = 0; i < contacts.length; i++) {\n if (contacts[i] === contact) {\n contacts.splice(i, 1);\n }\n }\n \n }, printAllContactNames: function() {\n var returnedNames = \" \";\n for (var i = 0; i < contacts.length; i++) {\n returnedNames += \"\\n\" + contacts[i].nameFirst + \" \" + contacts[i].nameLast; \n } return returnedNames.trim();\n }\n \n };\n \n \n }", "traverse (str, callbackfn, thisArg) {\n let cur = this.trie\n for (let i = 0; i < str.length; i++) {\n const retChar = callbackfn.call(thisArg, str[i], i, cur)\n const tmp = cur.children[retChar]\n if (!tmp || tmp.countPrefix <= 0) return\n cur = tmp\n }\n }", "function getContacts(req, res) {\n\n\tdb.child('/contacts').once('value')\n\t.then((snapshot) => {\n\n\t\tlet database = snapshot.val();\n\n\t\tlet data = {};\n\t\tdata[\"contacts\"] = new Array();\n\n\t\tfor(let category in database) {\n\n\t\t\tlet type = {};\n\t\t\ttype[\"section\"] = category;\n\t\t\ttype[\"people\"] = new Array();\n\n\t\t\tfor(let person in database[category]) {\n\n\t\t\t\ttype[\"people\"].push(database[category][person]);\n\t\t\t}\n\n\t\t\tdata[\"contacts\"].push(type);\n\t\t}\n\n\t\tres.set('Cache-Control', 'public, max-age=3600 , s-maxage=7200');\n\t\treturn res.status(200).json({\n\t\t\tdata: data,\n\t\t\tsuccess: true\n\t\t});\n\t})\n\t.catch(() => {\n\n\t\treturn res.status(500).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'could not fetch contacts'\n\t\t});\n\t})\n\n}", "function Trie() {\n this.wordTree = {};\n this.words = 0;\n}", "function TrieNodeConstructor (wordIn) {\n if (!(this instanceof TrieNodeConstructor)) {\n return new TrieNodeConstructor(word);\n }\n this.word = wordIn || null;\n this.children = [];\n\n for (var i = 0; i < 26; i+=1) {\n this.children[i] = null;\n }\n //console.log(\"adding node\", this.word);\n}", "function getKeys()\n{\n //Loads all current contacts (existant in the links)\n jisQuery( \"a[id^='ctl00_cphLeftColumn_ctl00_repAddressBook_ctl'][id$=_lnkCharacter]\" )\n .each( function()\n {\n var tmpValue = getIdFromUrl( jisQuery( this ).attr( 'href' ) );\n _keys.push( tmpValue );\n } );\n}", "function TrieNode(key) {\n // the \"key\" value will be the character in sequence\n this.key = key;\n \n // we keep a reference to parent\n this.parent = null;\n \n // we have hash of children\n this.children = {};\n \n // check to see if the node is at the end\n this.end = false;\n }", "function startAddressBookListeners(){\n web3.shh.filter({\"topics\":[\"Addressbook\"]}).watch(function(err, msg) {\n if(err){console.log(\"ERROR:\", err);};\n var message = util.Hex2a(msg.payload);\n if(message.indexOf('request|contacts') >= 0){\n util.GetThisNodesConstellationPubKey(function(constellationKey){\n var obj = [];\n for(var account in accountMapping){\n obj.push({\n address: account,\n name: accountMapping[account],\n constellationKey: constellationKey\n });\n }\n var message = 'contacts|'+JSON.stringify(obj);\n var hexString = new Buffer(message).toString('hex');\n web3.shh.post({\n \"topics\": [\"Addressbook\"],\n \"from\": myId,\n \"payload\": hexString,\n \"ttl\": 10,\n \"workToProve\": 1\n }, function(err, res){\n if(err){console.log('err', err);}\n });\n });\n } else if(message.indexOf('contacts') >= 0){\n var messageArr = message.split('|');\n var contactObj = JSON.parse(messageArr[1]);\n for(var i in contactObj){\n var newContact = contactObj[i];\n var found = false;\n for(var j in contactList){\n var contact = contactList[j];\n if(contact && contact.address == newContact.address){\n found = true;\n contact.name = newContact.name;\n break; \n }\n }\n if(found == false){\n contactList.push(newContact);\n } \n }\n }\n });\n}", "function getContacts() {\n return contacts;\n}", "function serializeTrie(root, options = 16) {\n options = typeof options === 'number' ? { base: options } : options;\n const { base = 16, comment = '' } = options;\n const radix = base > 36 ? 36 : base < 10 ? 10 : base;\n const rows = flattenToReferences(root)\n .map(node => {\n const row = [\n ...trieToExportString(node, radix),\n '\\n',\n ]\n .join('').replace(regExTrailingComma, '$1');\n return row;\n });\n return generateHeader(radix, comment)\n .concat(rows);\n}", "function trie_recurse( obj, key, val ) {\n if ( key.length <= 1 ) {\n if (key.length < 1) {\n obj.value = val;\n }\n obj[key] = {\n value: val\n }\n return;\n }\n let n = key.slice(0, 1);\n if (!obj[n]) obj[n] = {};\n trie_recurse(obj[n], key.slice(1, key.length), val);\n}", "function SecureTrie () {\n CheckpointTrie.apply(this, arguments)\n secureInterface(this)\n}", "getPhoneNums() {\n let mapping = {};\n for (let contact of this.props.contacts) {\n mapping[contact.name] = contact.phone;\n }\n return mapping;\n }", "constructor(words) {\n this.words = new SuffixTree(words);\n this.pointers = [];\n }", "insert_to_trie(word){\n if (this.is_word(word) == false) {\n return false;\n }\n let currentNode = this.root;\n\n for (let char=0; char < word.length; char++){\n let char_index = this.char_to_index(word[char]);\n // print(f\"char: {char} | Char Index - {char_index}\")\n if (!currentNode.children[char_index]){ \n // If the character doesn't exist in the Trie; create it\n currentNode.children[char_index] = this.get_node();\n currentNode.children[char_index].ch = word[char];\n currentNode.children[char_index].word = currentNode.word + word[char];\n currentNode.children[char_index].parent = currentNode;\n } \n currentNode = currentNode.children[char_index] ;\n }\n \n currentNode.isLeaf = true; // current node is the last character\n }", "contactListNames() {\n\t var contactObjectList = Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t var contactNameList = [];\n\t for (id in contactObjectList) {\n\t\tvar first_name = contactObjectList[id][\"name\"][\"first\"];\n\t\tvar middle_name = contactObjectList[id][\"name\"][\"middle\"];\n\t\tvar last_name = contactObjectList[id][\"name\"][\"last\"];\n\t\tvar key = \"\";\n\t\t(first_name != \"\")? key += first_name + \" \" : key = key;\n\t\t(middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t\t(last_name != \"\")? key += last_name : key = key;\n\t\tcontactNameList.push(key);\n\t }\n\t return contactNameList;\n\t}", "function queryTrie(word) {\n // Loop to dig through the JSON object\n\n var searchResults = searchTrie(word, false, true);\n\n // Checks if the pathing exists in the trie, if not return empty\n var tempTrieProgress = searchResults[1];\n if(!searchResults[0]) {\n return [\"100x\",[]];\n }\n\n // Arrays to store the words constructed and the list building the words\n var wordList = [];\n var wordBuildingList = [];\n\n if (tempTrieProgress.endOfWord) {\n wordList.push(word);\n } else {\n wordBuildingList.push(word);\n }\n\n // Recursive function to construct letters and work backwards to set up to construct the next letter\n function queryList(tempTrie) {\n\n var sideBranches = Object.keys(tempTrie).filter(t=>t!=\"endOfWord\");\n\n sideBranches.forEach(branch=> {\n wordBuildingList.push(branch);\n if (\"endOfWord\" in tempTrie[branch]) {\n wordList.push(wordBuildingList.join(\"\"));\n }\n queryList(tempTrie[branch]);\n wordBuildingList.pop();\n });\n }\n\n queryList(tempTrieProgress);\n return [\"100x\",wordList];\n}", "function loadData() {\n var data = fs.readFileSync(__dirname + '/zip_codes.csv', 'utf8');\n var lines = data.split('\\r\\n');\n var trie = {};\n\n lines.forEach(function(line) {\n var parts = line.split(',');\n var zip = parts[0], city = parts[1], state = parts[2];\n var node = trie;\n \n for (var i = 0; i < zip.length; i++) {\n var num = zip[i];\n var pos = node[num];\n if (pos == null)\n node = node[num] = (i === zip.length - 1) ? [city, state] : {};\n else\n node = node[num];\n }\n });\n \n return trie;\n}", "function UpdateContacts(t)\n{\n // TODO: Spacial and Hierarchical Partitioning (Grid, BVH, etc.)\n // TODO: Group related contacts (i.e. A<->B, B<->C, and C<->D) for simultaneous processing\n // TODO: Consider resting contacts\n // TODO: Consider contact resolution ordering\n // TODO: Enable particles (particle boolean or bound_r = 0?)\n // TODO: Enable/Disable collision checking per-object\n var i; // Index A\n var j; // Index B\n var a_obj; // Object A\n var b_obj; // Object B\n\n // Reset contacts list\n contacts.splice(0,contacts.length);\n\n // Check Object Pairs\n\n for (i = 0; i < ph_objects.length; i++)\n {\n for (j = i + 1; j < ph_objects.length; j++)\n {\n a_obj = ph_objects[i];\n b_obj = ph_objects[j];\n CheckContactPair(a_obj, b_obj, t);\n }\n }\n\n // Check particle-obj pairs\n for (i = 0; i < ph_particles.length; i++)\n {\n for (j = 0; j < ph_objects.length; j++)\n {\n a_obj = ph_particles[i];\n b_obj = ph_objects[j];\n CheckContactParticleObj(a_obj, b_obj, t);\n }\n }\n}", "findValue( srcContact, [table, key], cb){\n\n if (srcContact) this._welcomeIfNewNode(srcContact);\n\n this._store.get(table.toString('hex'), key.toString('hex'), (err, out) => {\n //found the data\n if (out) cb(null, [1, out] )\n else cb( null, [0, this._kademliaNode.routingTable.getClosestToKey(key) ] )\n })\n\n }", "function wordTrie (p) {\n if (typeof p === 'string') {\n this.addPhrase(p);\n } else if ( Object.prototype.toString.call(p) === '[object Array]' ) {\n this.addPhraseByArray(p, 0);\n }\n}", "function mapFromBaseTrie (trieNode, options, callback) {\n let paths = []\n\n if (trieNode.type === 'leaf') {\n // leaf nodes resolve to their actual value\n paths.push({\n path: nibbleToPath(trieNode.getKey()),\n value: trieNode.getValue()\n })\n }\n\n each(trieNode.getChildren(), (childData, next) => {\n const key = nibbleToPath(childData[0])\n const value = childData[1]\n if (EthTrieNode.isRawNode(value)) {\n // inline child root\n const childNode = new EthTrieNode(value)\n paths.push({\n path: key,\n value: childNode\n })\n // inline child non-leaf subpaths\n mapFromBaseTrie(childNode, options, (err, subtree) => {\n if (err) return next(err)\n subtree.forEach((path) => {\n path.path = key + '/' + path.path\n })\n paths = paths.concat(subtree)\n next()\n })\n } else {\n // other nodes link by hash\n let link = { '/': cidFromHash(multicodec, value).toBaseEncodedString() }\n paths.push({\n path: key,\n value: link\n })\n next()\n }\n }, (err) => {\n if (err) return callback(err)\n callback(null, paths)\n })\n }", "findNode( srcContact, [key], cb ){\n\n const err = Validation.checkIdentity(key);\n if (err) return cb(err);\n\n if (srcContact) this._welcomeIfNewNode(srcContact);\n\n cb( null, [0, this._kademliaNode.routingTable.getClosestToKey(key) ] );\n }", "get_node(){\n return new TrieNode()\n }", "function queryList(tempTrie) {\n\n var sideBranches = Object.keys(tempTrie).filter(t=>t!=\"endOfWord\");\n\n sideBranches.forEach(branch=> {\n wordBuildingList.push(branch);\n if (\"endOfWord\" in tempTrie[branch]) {\n wordList.push(wordBuildingList.join(\"\"));\n }\n queryList(tempTrie[branch]);\n wordBuildingList.pop();\n });\n }", "getCompletions(prepend=\"\", branchString=\"\", node=this.root, completions=[]) {\n if (node.endWord) {\n completions.push(prepend+branchString);\n }\n if (!node.children) {\n return completions; \n }\n for (let letter in node.children) {\n this.getCompletions(prepend, branchString + node.children[letter].letter, node.children[letter], completions);\n }\n // console.log(\"end? \", completions);\n return completions;\n }", "getNode(){\r\n return new TrieNode()\r\n }", "function getContacts() {\n return contacts;\n }", "function Trie () {\n if (!(this instanceof Trie)) return new Trie()\n this.trie = { nodes: {} }\n}", "addNode(letter,eod=false) {\n this[letter] = new trieNode(eod);\n }", "getAll() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, false);\n return o;\n }", "function allContacts(){\r\n var temhash = new Hashtable(); \r\n var groupcontrol = document.getElementById('allconts');\r\n var tex = document.getElementById('newNameGroup');\r\n var child;\r\n while(child=groupcontrol.firstChild)\r\n groupcontrol.removeChild(child);\r\n tex.value = \"\";\r\n var groups = sessionhash.keys(); \r\n for (var i = 0; i < groups.length; i++){\r\n var contacts = sessionhash.get(groups[i]);\r\n if (contacts != null && !contacts.isEmpty()){\r\n var contactkeys = contacts.keys(); \r\n for (var j = 0; j < contactkeys.length; j++){ \r\n if (!temhash.containsKey(contactkeys[j])){\r\n temhash.put(contactkeys[j],contacts.get(contactkeys[j])); \r\n var check2 = document.createElement(\"input\");\r\n var label2 = document.createElement(\"label\");\r\n var br2 = document.createElement(\"br\"); \r\n check2.setAttribute(\"type\", \"checkbox\"); \r\n check2.setAttribute(\"value\", contactkeys[j]);\r\n check2.setAttribute(\"name\", contacts.get(contactkeys[j])); \r\n label2.innerHTML = contacts.get(contactkeys[j]);\r\n groupcontrol.appendChild(check2);\r\n groupcontrol.appendChild(label2);\r\n groupcontrol.appendChild(br2);\r\n }\r\n }\r\n } \r\n }\r\n }", "function ContactStateArray(){\r\n\t\r\n\tthis.contacts = {};//所有联络事件\r\n\tthis._keySeparator=\"_\";\r\n\tthis._contactsInteractionIDKey = {};//同一个interactionID下的所有事件KEY\r\n\tthis._contactsInteractionIDHold = {};//同一个interactionID下的所有Hold事件计数\r\n}", "insert(word){\n\t\tword = word.toUpperCase();\n\t\tvar subtrie = this.tree;\n\t\tfor(var j = 0; j < word.length; j++){\n\t\t\tvar letter = word[j];\n\t\t\t// insert letter if not already present\n\t\t\tif(subtrie.hasOwnProperty(letter) === false){ \n\t\t\t\tsubtrie[letter] = {} \n\t\t\t};\n\t\t\t// continue descending into tree\n\t\t\tsubtrie = subtrie[letter];\n\t\t}\n\t\t// finished iterating over word, add star at this depth\n\t\tsubtrie[\"*\"] = true;\n\t}", "function build() {\n for (var i = 0; i < Object.keys(object).length; i++) {\n var k = Object.keys(object)[i];\n object[k] = {};\n for (var j = 0; j < k.length; j++) {\n var w = k.replaceAt(j, wildcard);\n object[k][w] = new Number();\n for (var l = 0; l < alphabet.length; l++) {\n var nw = w.replaceAt(j, alphabet[l]);\n if (nw != k && trie.find(nw)) {\n pos = (alphabet[l].charCodeAt(0) - 'a'.charCodeAt(0));\n object[k][w] = object[k][w] | (1 << pos);\n }\n }\n }\n }\n}", "function addTrie(word) {\n const splitWord = word.split('');\n\n // Loop to dig through the JSON object\n var tempTrieProgress = trie;\n for (i=0; i<splitWord.length; i++) {\n if (!(splitWord[i] in tempTrieProgress)) {\n tempTrieProgress.addNode(splitWord[i]);\n }\n tempTrieProgress = tempTrieProgress[splitWord[i]];\n }\n\n tempTrieProgress.endOfWord = true;\n\n saveTrie();\n}", "function findBibRefs() {\n// Searches text for citations/bibliographic entries by looking for text that has the format of a list of\n// authors followed by publication year, journal name, volume number and page number. \n// If such are identified, a short citation is constructed from the author list, pub year, etc and then the \n// short citation is placed in a special category within the index that is not used as an ordinary index word, \n// but rather as a \"re-router\" to the words for which the short citation stands for. In the index, the short\n// citation is entered as an entry but with a type=citation, and another field that no other entry has,\n// \"fullCit\", will hold the author last names, publication year, volume number, page number and journal name.\n// All of these items are delimited by \"_\", and the abbreviated paper ID in front, \n// ie \"454|jones_smith_white_1997_the_astronomical_journal_676_8\". Every time the short citation is found in\n// that paper, all the words in fullCit will be updated with the location information. \n xLtr.push({\"type\":\"citation\", \"priority\":\"1\",\n \"indx\":function(text, startPos) {\n this.endMatch = \"-1\";\n this.authors = \"\";\n this.pubYear = \"\";\n this.journal = \"\";\n this.page = \"\";\n this.volume = \"\";\n var authors = [];\n var pubYear = '';\n var journal = '';\n var page = '';\n var volume = '';\n var journalAbb = '';\n var tmp = '';\n var t = '';\n var m = '';\n var t1 = '';\n var t2 = '';\n var shortCit = '';\n// Strip out text starting from startPos\n text = text.slice(startPos, startPos + 5000);\n// From henceforth, need to preserve character positions because at the end, need to know the actual position\n// of the end of the match to to a bibliographic reference, so that the text can be masked out, etc by the\n// function calling this procedure. \n// to reduce complications in identifying the bibliography, remove any Jr, Sr, I, II, etc from\n text = text.replace(/([\\, ]+)(jr\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n text = text.replace(/([\\, ]+)(sr\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n text = text.replace(/([\\, ]+)(i+\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n// replace \"et al\" in the same way:\n text = text.replace(/([\\, ]+)(et\\.? *al\\.?)([\\, ]+)/ig, function(x,x1,x2,x3){return x3 + (x1+x2).replace(/[ -~]/g,' ');});\n// replace \"and\" in the same way ... if there is not a comma, force one to be there\n text = text.replace(/[\\, ]+and[\\, ]+/ig, function(x){return '\\,' + x.slice(1).replace(/[ -~]/g,' ');});\n// replace \"&\" in the same way:\n text = text.replace(/[\\, ]+\\&[\\, ]+/ig, function(x){return '\\,' + x.slice(1).replace(/[ -~]/g,' ');});\n// Occurances of hypenated names is a problem, like Smith-Jones. replace such occurances to be \"Smithjones\". \n text = text.replace(/([A-Z][a-z]+)( *\\- *)([A-Z][a-z]+)/g, function(x,x1,x2,x3) {\n return x1.charAt(0).toUpperCase() + x1.slice(1).toLowerCase() + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');});\n// Occurances of names like O'Smith are a problem. Replace such occurances to be \"Osmith\"\n text = text.replace(/([A-Za-z]+)( *\\' *)([A-Za-z]+)/g, function(x,x1,x2,x3) {\n return x1.charAt(0).toUpperCase() + x1.slice(1).toLowerCase() + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');})\n// If O'Smith got rendered as O Smith, try to catch and fix that situation as well by turning O Smith into \"Osmith\"\n text = text.replace(/([A-Z])( *)([A-Z][a-z]+)/g, function(x,x1,x2,x3) {\n return x1 + x3.toLowerCase() + x2.replace(/[ -~]/g,' ');})\n// If there are characters that are all lowercase preceding a set of characters that start with a capital letter, \n// scoot the lowercase characters into the other characters, so that \"van Smith\" becomes \"Vansmith\"\n text = text.replace(/([\\, ]+)([a-z]{2,5})( *)([A-Z][a-z]+)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5) {\n return x1 + x2.charAt(0).toUpperCase() + x2.slice(1) + x4.toLowerCase() + x5 + x3; });\n// There could be the case that \"van Smith\" was rendered as VanSmith, or that O'Smith rendered as OSmith. There can \n// only be 1 captial letter per last name, or the below algorithm fails. Need to fix this kind of situation so that VanSmith\n// turns into Vansmith and OSmith into Osmith. To fully cover all bases, find every word that starts with a lower case letter\n// but has an uppercase letter somewhere later in the word, and force all characters to be lowercase except for the first\n// letter, which is forced to be uppercase:\n text = text.replace(/([\\, ]+)([a-z]+)([A-Z])([A-Za-z]+)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5) {\n return x1 + x2.charAt(0).toUpperCase() + x2.slice(1) + x3.toLowerCase() + x4.toLowerCase() + x5; });\n// And now get any word starting with an uppercase letter but has other uppercase letters somewhere else in the word, turn\n// unto all lower case except for first letter (note that we are about to really mess up any legitimate acronyms, but \n// that's OK because these changes are not permanent to the text\n text = text.replace(/([\\, ]+)([A-Z]+)([a-z]+)([A-Z])([A-Za-z]*)([\\, ]+)/g, function(x,x1,x2,x3,x4,x5,x6) {\n return x1 + x2.charAt(0) + x2.slice(1).toLowerCase() + x3 + x4.toLowerCase() + x5.toLowerCase() + x6; });\n// Remove any capital letters that stand in isolation -- those are likely to be initials:\n text = text.replace(/([\\, ]+)((?:[A-Z] *\\. *){1,5})(\\,? *[12]{0,1})/g, function(x,x1,x2,x3) {\n var tmp = '\\,' + (x1+x2).slice(1).replace(/[ -~]/g,' ');\n return tmp + x3.replace(/[^0-9]/g,' '); });\n// OK, now filter the text big-time, removing everything except letters, numbers and commas\n t = JSON.parse(filterTheText(/\\,/.source, text));\n// Now start looking for groups of characters that look like references within the text: Name,Name,Name2022,JournalName,000,00\n// where 000,00 is the volume and page numbers, respectively\n m = t[0].match(/^((?:(?:[A-Z][a-z]+\\,){1,20}(?:[A-Z][a-z]+)?)|(?:[A-Z][a-z]+))(?:([12]\\d\\d\\d[abc]{0,1})\\,([A-Z][A-Za-z]{1,100})\\,?(\\d+)\\,(\\d+))/);\n authors = [];\n pubYear = '';\n journal = '';\n volume = '';\n page = '';\n if (m) {\n// if the original reference is Smith, A. S., Jones, T. E., and Miller, W. D 2002, Astron. J., 145, 1\n// the filtered view would be Smith,Jones,Miller,2002,AstronJ,145,1 (note that the \"and\" and the initials would have already been\n// removed in a previous step above this \"while\" loop). Therefore, tmp will be (Smith,Jones,Miller)(2002)(AstronJ)(145)(1)\n// extract the publication year:\n pubYear = m[2].trim();\n// extract the volume number:\n volume = m[4];\n// get the page numner:\n page = m[5].replace(/[a-zA-Z]/g,''); // remove any \"L\" or other such designations, turn into pure number\n// extract the journal name and convert into the journal abbreviation, but extract from the unfiltered text:\n t1 = t[1][m[1].length + m[2].length - 1];\n t2 = t[1][m[1].length + m[2].length + m[3].length -1] + 1;\n journal = text.slice(t1,t2).replace(/[^A-Za-z0-9]/g,'');\n// determine what the full name is for this journal by consulting the xLtr's \"journal\" entries:\n tmp = xLtr.reduce(function(x1,x2,x3) {\n if (x2.type == \"journal\" && x2.abb !== undefined && x2.indx(journal,0) != \"\" && \n parseFloat(x2.endMatch) > x1[1]) {x1 = [x3,parseFloat(x2.endMatch),x2.name.toLowerCase()];} return x1;}, [-1,-1,'']);\n if (tmp[0] != -1 && tmp[1] == journal.length) { // perfect match!\n journal = tmp[2].split(' ').join('\\_'); }\n// extract the individual authors' last names:\n authors = m[1].replace(/\\,/g,' ').replace(/ +/g,' ').trim().split(' ');\n// Now that we have the author names and publication year, put together the citation likely to appear in the text\n shortCit = '';\n// Now create a citation phrase... what this bibliography reference will likely look like in the text. For example, if the bibliography\n// entry is Smith, A.K., Jones, Q. R., and Miller, D. R. 2010, ApJ, 545, 34, then the citation phrase might look like Smith et al 2010 or\n// maybe Smith, Jones & Miller 2010. Use both formats just to be certain.\n if (authors.length > 3) {\n shortCit = authors[0] + 'etal' + pubYear;\n } else if (authors.length == 3) {\n shortCit = authors[0]+'etal'+pubYear+ '\\|' +\n authors[0]+authors[1]+'and'+authors[2]+pubYear + '\\|' +\n authors[0] + authors[1] + authors[2] + pubYear; // 3 possibilities\n } else if (authors.length == 2) {\n shortCit = authors[0] + 'and' + authors[1] + pubYear + '\\|' + \n authors[0] + authors[1] + pubYear; // 2 possibilities\n } else if (authors.length == 1) {\n shortCit = authors[0] + pubYear; }\n pubYear = pubYear.replace(/[a-zA-Z]/g,'');\n this.endMatch = '' + (t[1][m[0].length-1] + 1 + startPos);\n this.authors = ([... new Set(authors)]).sort().join('\\_');\n this.pubYear = \"\"+pubYear;\n this.journal = journal;\n this.volume = volume;\n this.page = page;\n return shortCit.toLowerCase(); \n } else {return ''; } \n } });\n return;\n }", "buildTree(tree) {\n alphabet = new Set();\n id_map = [];\n // Prepare initial node\n id = 0;\n followpos = [];\n this.type = CONCAT;\n this.c1 = new Node();\n this.c2 = new Node();\n this.c2.buildNodes({ type: \"Char\", value: \"#\" });\n this.c1.buildNodes(tree);\n this.nullable = this.c1.nullable && this.c2.nullable;\n\n // Set firstpos\n this.firstpos = new Set(this.c1.firstpos);\n if (this.c1.nullable) {\n for (let each of this.c2.firstpos) {\n this.firstpos.add(each);\n }\n }\n // Set lastpos\n this.lastpos = new Set(this.c2.lastpos);\n if (this.c2.nullable) {\n for (let each of this.c1.lastpos) {\n this.lastpos.add(each);\n }\n }\n // Set followpos\n for (let i of this.c1.lastpos) {\n for (let each of this.c2.firstpos) {\n followpos[i].add(each);\n }\n }\n\n alphabet.delete(\"#\");\n }", "setPersons() {\n var objectPersons = {\"nodes\": [], \"links\": []},\n tempNodes = [],\n tempLinks = [];\n\n this.dataAll[\"nodes\"].forEach(function(node) {\n if (node[\"id\"].includes(\"Channing, William Ellery\") ||\n (node[\"id\"].includes(\", \") && ! (node[\"id\"].includes(\"Channing\") || node[\"id\"].includes(\"Ellery,\") || node[\"id\"].includes(\"White,\"))) ||\n node[\"id\"].includes(\"Dr. Sprague\") || node[\"id\"].includes(\"Ware\") || node[\"id\"].includes(\"[Unknown]\")) {\n tempNodes.push(node);\n }\n });\n\n this.dataAll[\"links\"].forEach(function(link) {\n\n // Exclude Ellery family members\n if (! (link[\"source\"].includes(\"Ellery,\") || link[\"target\"].includes(\"Ellery,\"))) {\n // Exclude letters from Channings to Channings\n if (! (link[\"source\"].includes(\"Channing\") && link[\"target\"].includes(\"Channing\"))) {\n // Only include persons\n if ((link[\"source\"].includes(\", \") || link[\"source\"].includes(\"Dr. Sprague\") ||\n link[\"source\"].includes(\"Ware\") || link[\"source\"].includes(\"[Unknown]\")) &&\n (link[\"target\"].includes(\", \") || link[\"target\"].includes(\"Dr. Sprague\") ||\n link[\"target\"].includes(\"Ware\") || link[\"target\"].includes(\"[Unknown]\"))) {\n // If a Channing is part of the letter communication, only accept the node if\n // it is William Ellery Channing himself (letters from Channing to Channing are already dropped here)\n if ( (link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\"))\n && (link[\"source\"].includes(\"Channing, William Ellery\") || link[\"target\"].includes(\"Channing, William Ellery\")) ) {\n tempLinks.push(link);\n }\n\n // If no Channing is present, push as well\n if ( !(link[\"source\"].includes(\"Channing,\") || link[\"target\"].includes(\"Channing,\")) ) {\n tempLinks.push(link);\n }\n }\n }\n }\n });\n\n objectPersons[\"nodes\"] = tempNodes;\n objectPersons[\"links\"] = tempLinks;\n\n return objectPersons;\n }", "function setParentCHArray(formula, chAddress) {\r\n let formulaTokens = formula.split(\" \");\r\n for (let i = 0; i < formulaTokens.length; i++) {\r\n let ascii = formulaTokens[i].charCodeAt(0);\r\n // ascii valid or not\r\n if (ascii >= 65 && ascii <= 90) {\r\n let { rid, cid } = getRIDCIDfromAddress(formulaTokens[i]);\r\n let parentObj = sheetDB[rid][cid]; //A1\r\n parentObj.children.push(chAddress); //A1.children.push(B1)-> A1=children:[B1]\r\n }\r\n }\r\n}", "findContact(contactName) {\n\t var contactObjectList = Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t var findResult = [];\n\t for (id in contactObjectList) {\n\t\tvar first_name = contactObjectList[id][\"name\"][\"first\"];\n\t\tvar middle_name = contactObjectList[id][\"name\"][\"middle\"];\n\t\tvar last_name = contactObjectList[id][\"name\"][\"last\"];\n\t\tvar key = \"\";\n\t\t(first_name != \"\")? key += first_name + \" \" : key = key;\n\t\t(middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t\t(last_name != \"\")? key += last_name : key = key;\n\t\tif (key == contactName)\n\t\t findResult.push(contactObjectList[id]);\n\t }\n\t return findResult;\n\t}", "loadContacts(){\n return new Promise((resolve, reject)=>{\n dbConnexion.child(CONTACT).set(contacts, (data)=>{\n resolve(data);\n });\n });\n }", "function wordOnPageTree(word){\n $('#instructions').html('Click the red letter to show it\\'s children in the tree structure')\n var firstArr = Object.keys(test)\n firstArr[firstArr.indexOf(word.charAt(0))] = `<span> ${word.charAt(0)}</span>`\n console.log(firstArr);\n $('#firstLetterP').html(firstArr.join(', '))\n\n var secArr = Object.keys(test[word.charAt(0)])\n secArr[secArr.indexOf(word.charAt(1))] = `<span> ${word.charAt(1)}</span>`\n $('#secLetterP').html(secArr.join(', '))\n\n var thirdArr = Object.keys(test[word.charAt(0)][word.charAt(1)])\n console.log(thirdArr);\n thirdArr[thirdArr.indexOf(word.charAt(2))] = `<span> ${word.charAt(2)}</span>`\n $('#thirdLetterP').html(thirdArr.join(', '))\n\n var fourArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)])\n fourArr[fourArr.indexOf(word.charAt(3))] = `<span> ${word.charAt(3)}</span>`\n $('#fourLetterP').html(fourArr.join(', '))\n\n var fifthArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)])\n fifthArr[fifthArr.indexOf(word.charAt(4))] = `<span> ${word.charAt(4)}</span>`\n $('#fifthLetterP').html(fifthArr.join(', '))\n\n var sixArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)])\n sixArr[sixArr.indexOf(word.charAt(5))] = `<span> ${word.charAt(5)}</span>`\n $('#sixthLeterP').html(sixArr.join(', '))\n\n var sevenArr = Object.keys(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)][word.charAt(5)])\n sevenArr[sevenArr.indexOf(word.charAt(6))] = `<span> ${word.charAt(6)}</span>`\n $('#seventhLetterP').html(sevenArr.join(', '))\n // console.log(test[word.charAt(0)][word.charAt(1)][word.charAt(2)][word.charAt(3)][word.charAt(4)][word.charAt(5)][word.charAt(6)]);\n}", "function phoneNumber(numbers) {\n let n = 0, tree = new Map();\n for (let number of numbers) {\n let node = tree;\n for (let digit of number) {\n if (! node.has(digit)) {\n n++;\n node.set(digit, new Map());\n }\n node = node.get(digit);\n }\n }\n return n;\n}", "function mapFromEthObj (trieNode, options, callback) {\n // expand from merkle-patricia-tree using leafResolver\n mapFromBaseTrie(trieNode, options, (err, basePaths) => {\n if (err) return callback(err)\n if (!leafResolver) return callback(null, basePaths)\n // expand children\n let paths = basePaths.slice()\n const leafTerminatingPaths = basePaths.filter(child => Buffer.isBuffer(child.value))\n each(leafTerminatingPaths, (child, cb) => {\n return waterfall([\n (cb) => leafResolver.util.deserialize(child.value, cb),\n (ethObj, cb) => leafResolver.resolver._mapFromEthObject(ethObj, options, cb)\n ], (err, grandChildren) => {\n if (err) return cb(err)\n // add prefix to grandchildren\n grandChildren.forEach((grandChild) => {\n paths.push({\n path: child.path + '/' + grandChild.path,\n value: grandChild.value,\n })\n })\n cb()\n })\n }, (err) => {\n if (err) return callback(err)\n callback(null, paths)\n })\n })\n }", "_loadContacts(callback){\n //Define an empty void if no callback specified\n if(callback === undefined){\n callback = _ => {};\n }\n\n var self = this;\n contactsEndpoint.contacts(this.token, function(errors, answer){\n if(errors === null){\n for (let groupAnswer of answer['Groups']){\n //Take only servers\n if(groupAnswer.GroupType == groupsEndpoints.GroupType.Large){\n //Check that server is not already existing\n if(self.servers.has(groupAnswer.GroupID) == false){\n var server = new serverModule.Server(groupAnswer.GroupID, self);\n }\n }\n }\n\n self.friendList = answer['Friends']; //Thoses friends are not useable yet (who needs friends ?)\n callback(null);\n } else {\n callback(errors);\n }\n });\n\n }", "breadthFirstSearch(array) {\n var queue = new Queue;\n queue.enqueue(this);\n var item;\n while (item = queue.dequeue()) {\n array.push(item.name)\n for (var i = 0; i < item.children.length; i++) {\n var node = item.children[i]\n queue.enqueue(node)\n }\n }\n return array;\n }", "get contactFolders() {\r\n return new ContactFolders(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "function TrieSetConstructor () {\n if (!(this instanceof TrieSetConstructor)) {\n return new TrieSetConstructor(word);\n }\n this.root = new TrieNodeConstructor(\"\");\n this.trieSize = 0;\n this.radixTable = {};\n this.radixLength = 26;\n for (var i = 0; i < this.radixLength; i+=1) {\n var letter = String.fromCharCode(97 + i);\n this.radixTable[letter] = i;\n }\n}", "function AddressBook() {\n this.contacts = [],\n this.currentId = 0\n}", "function ResolveContacts(t)\n{\n var a, b;\n\n // Go through all contacts\n for (var i in contacts)\n {\n a = contacts[i].a;\n b = contacts[i].b;\n\n // TODO: Physics contact resolution\n\n // Special Particle Actions\n // a object\n if (a instanceof PhysParticle)\n {\n // Check delete_on_contact property\n if (a.delete_on_contact)\n {\n // Mark for deletion\n a.dead = true;\n }\n }\n // b object\n if (b instanceof PhysParticle)\n {\n // Check delete_on_contact property\n if (b.delete_on_contact)\n {\n // Mark for deletion\n b.dead = true;\n }\n }\n }\n\n // Contact list is reset at beginning of \"UpdateContacts\" function\n}", "function autoFormChildKeys(ss, name) { // 1798\n name = SimpleSchema._makeGeneric(name); // 1799\n var prefix = name + \".\"; // 1800\n // 1801\n var childKeys = []; // 1802\n _.each(ss._schemaKeys, function (key) { // 1803\n // If it's a direct child, add it to the list // 1804\n if (key.indexOf(prefix) === 0) { // 1805\n var ending = key.slice(prefix.length); // 1806\n if (ending.indexOf('.') === -1) { // 1807\n childKeys.push(ending); // 1808\n } // 1809\n } // 1810\n }); // 1811\n return childKeys; // 1812\n} // 1813", "function Trie() {\n this.root = new TrieNode(null);\n }", "function convertToTrie(entries) {\n\t\tvar trie = {}, url, urlFixed, i, value, letters, letter, cur, node;\n\n\t\tfor (url in entries) {\n\t\t\turlFixed = url;\n\n\t\t\t// find any strings to break\n\t\t\tfor (i = 0; i < impl.xssBreakWords.length; i++) {\n\t\t\t\t// Add a xssBreakDelim character after the first letter. optimizeTrie will\n\t\t\t\t// ensure this sequence doesn't get combined.\n\t\t\t\turlFixed = urlFixed.replace(impl.xssBreakWords[i], \"$1\" + xssBreakDelim + \"$2\");\n\t\t\t}\n\n\t\t\tif (!entries.hasOwnProperty(url)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvalue = entries[url];\n\t\t\tletters = urlFixed.split(\"\");\n\t\t\tcur = trie;\n\n\t\t\tfor (i = 0; i < letters.length; i++) {\n\t\t\t\tletter = letters[i];\n\t\t\t\tnode = cur[letter];\n\n\t\t\t\tif (typeof node === \"undefined\") {\n\t\t\t\t\t// nothing exists yet, create either a leaf if this is the end of the word,\n\t\t\t\t\t// or a branch if there are letters to go\n\t\t\t\t\tcur = cur[letter] = (i === (letters.length - 1) ? value : {});\n\t\t\t\t}\n\t\t\t\telse if (typeof node === \"string\") {\n\t\t\t\t\t// this is a leaf, but we need to go further, so convert it into a branch\n\t\t\t\t\tcur = cur[letter] = { \"|\": node };\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (i === (letters.length - 1)) {\n\t\t\t\t\t\t// this is the end of our key, and we've hit an existing node. Add our timings.\n\t\t\t\t\t\tcur[letter][\"|\"] = value;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// continue onwards\n\t\t\t\t\t\tcur = cur[letter];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn trie;\n\t}", "function findContact(searchTerm){\n searchResults = [];\n\n var list = contacts.find().fetch();\n console.log(list);\n for(var i=0; i < list.length; i++)\n {\n obj = list[i];\n if(obj.firstname == searchTerm || obj.lastname === searchTerm || obj.gender === searchTerm || obj.email === searchTerm || obj.number === searchTerm || obj.latitude === searchTerm || obj.longitude === searchTerm)\n {\n searchResults.push(obj);\n }\n }\n Session.set(\"searchRes\",searchResults);\n}", "refersTo() {\n //calculate links\n this.compute('coreference')\n // return them\n return this.map(m => {\n if (!m.found) {\n return m.none()\n }\n let term = m.docs[0][0]\n if (term.reference) {\n return m.update([term.reference])\n }\n return m.none()\n })\n }", "_replicateStoreToNewNode(contact, iterator, cb){\n\n if (!iterator ) //first time\n iterator = this._store.iterator();\n\n let itValue = iterator.next();\n\n while (itValue.value && !itValue.done) {\n\n const table = itValue.value[0].slice( 0, itValue.value[0].indexOf(':') );\n const key = itValue.value[0].slice( itValue.value[0].indexOf(':') + 1);\n\n const value = itValue.value[1];\n\n const keyNode = Buffer.from(key, 'hex');\n const neighbors = this._kademliaNode.routingTable.getClosestToKey(contact.identity)\n\n let newNodeClose, thisClosest;\n if (neighbors.length){\n const last = BufferUtils.xorDistance( neighbors[neighbors.length-1].identity, keyNode );\n newNodeClose = Buffer.compare( BufferUtils.xorDistance( contact.identity, keyNode), last );\n const first = BufferUtils.xorDistance( neighbors[0].identity, keyNode );\n thisClosest = Buffer.compare( BufferUtils.xorDistance( this._kademliaNode.contact.identity, keyNode ), first)\n }\n\n if (!neighbors.length || ( newNodeClose < 0 && thisClosest < 0 ) )\n return this.sendStore(contact, [ table, key, value], (err, out) => {\n\n if (err)\n return cb(err); //error\n\n NextTick( this._replicateStoreToNewNode.bind(this, contact, iterator, cb), global.KAD_OPTIONS.T_REPLICATE_TO_NEW_NODE_SLEEP )\n\n });\n else\n itValue = iterator.next();\n\n }\n\n if (!itValue.value || !itValue.done)\n cb(null, \"done\");\n\n }", "function AddressBook() {\n this.contacts = {};\n this.currentId = 0;\n}", "function AddressBook() {\n this.contacts = {};\n this.currentId = 0;\n}", "function ref (root, path, affected, position) {\n var parent = get_at(root, path.slice(0, -1))\n var key = path.slice(-1)[0]\n var val = get_or_create(parent, key)\n\n var self = {\n path (p) {\n return ref(val, array_from_lua(p), affected, position.concat(p))\n },\n\n child (k) {\n return ref(val, [k], affected, position.concat(k))\n },\n\n get () {\n return val\n },\n\n get_at (p) {\n return get_at(val, array_from_lua(p))\n },\n\n search (q, pathindexer) {\n pathindexer = array_from_lua(pathindexer)\n var wordmap = {}\n if (typeof val === 'object') {\n for (let i = 0; i < val.length; i++) {\n let word = get_at(val[i], pathindexer)\n if (typeof word !== 'string') continue\n let ref = self.child(i)\n wordmap[word] = ref\n }\n } else return []\n\n return fuzzyset(Object.keys(wordmap))\n .get(q)\n .map(([score, word]) => ({score, word, ref: wordmap[word]}))\n },\n\n replace (v) {\n parent[key] = v\n affected.push({kind: 'replace', at: position, val: v})\n },\n\n merge (v) {\n parent[key] = deepmerge(val, v)\n affected.push({kind: 'merge', at: position, val: v})\n },\n\n set_at (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, () => v)\n affected.push({kind: 'set', at: position.concat(arraypath), val: v})\n },\n\n delete_at (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, () => null)\n affected.push({kind: 'delete', at: position.concat(arraypath), val: v})\n },\n\n append_to (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n arr = []\n }\n arr.push(v)\n return arr\n })\n affected.push({kind: 'append', at: position.concat(arraypath), val: v})\n },\n\n prepend_to (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n arr = []\n }\n arr.unshift(v)\n return arr\n })\n affected.push({kind: 'prepend', at: position.concat(arraypath), val: v})\n },\n\n remove_from (p, v) {\n let arraypath = array_from_lua(p)\n update_at(val, arraypath, arr => {\n if (!Array.isArray(arr)) {\n return []\n }\n\n while (arr.indexOf(v) !== -1) {\n let index = arr.indexOf(v)\n arr.splice(index, 1)\n }\n })\n affected.push({kind: 'remove', at: position.concat(arraypath), val: v})\n }\n }\n\n return self\n}", "MapTriangleToNodes(t) {\n if (this.front_ === null) {\n throw new Error(\"this.front_ === null\");\n }\n for (let i = 0; i < 3; i++) {\n if (!t.GetNeighbor(i)) {\n // Node* n = front_->LocatePoint(t.PointCW(*t.GetPoint(i)));\n const n = this.front_.LocatePoint(t.PointCW(t.GetPoint(i)));\n if (n)\n n.triangle = t;\n }\n }\n }", "function snomTbookProcessCards(telephoneBook, addressBooks) {\n // all entries\n let entries = [];\n // prevent duplicate entries\n let uniqueEntries = [];\n // determine which vCards from which accounts are needed\n let accounts = [];\n if (\"accounts\" in telephoneBook) {\n accounts = telephoneBook.accounts;\n }\n else {\n // default to all address books\n for (let i = 0; i < addressBooks.length; i++) {\n accounts.push({ \"account\": i + 1 });\n }\n }\n // replace work with business\n let telephoneBookOrder = telephoneBook.order;\n if (telephoneBookOrder.indexOf('work') > -1)\n telephoneBookOrder[telephoneBookOrder.indexOf('work')] = 'business';\n // iterate over all accounts\n for (let account of accounts) {\n // iterate all vCards of the address book\n for (let vcard of addressBooks[account.account - 1]) {\n // parse vCard\n let vcf = utilParseVcard(vcard);\n // skip if no telephone number\n if (vcf.tels.length === 0)\n continue;\n // check for dial prefix\n let prefix = \"prefix\" in account ? account.prefix : '';\n // process card\n let entry = snomTbookProcessCard(vcf, telephoneBook.fullname, telephoneBookOrder, prefix, telephoneBook.duplicates, uniqueEntries);\n if (entry)\n entries.push(...entry);\n }\n }\n return {\n tbook: [\n { _attr: { complete: 'true' } },\n ...entries\n ]\n };\n}", "function Addressbook() {\n this.contacts = [];\n this.currentId = 0;\n}", "function chosenGoingTo(){\n let localContacts;\n //llamando a la referencia de data base\n database.ref('localContacts').once('value')\n .then((local) => {\n local.forEach((localContact) => { \n const string = JSON.stringify(localContact);\n const evaluar = string.includes('Laboratoria');\n console.log(evaluar);\n //console.log(JSON.stringify(local.nombre));\n //console.log(localContacts);\n });\n });\n}", "function getDataMap(pSorted){\n // return [{\n // \"text\": \"HANAMURA\",\n // \"children\": [\n // {\n // id: 'HANAMURA A',\n // text: 'Hanamura A'\n // },\n //]},{...}]\n\n var result = [];\n for (var lMap in pSorted) {\n result.push({\n \"text\": lMap,\n \"children\":getChildrenMaps(pSorted[lMap], lMap)\n });\n }\n\n return result;\n }", "query(letter) {\n const newPointers = [];\n\n let hasWord = false;\n\n for (let pointer of this.pointers) {\n const currNode = pointer.children[letter];\n\n if (currNode) {\n newPointers.push(currNode);\n\n if (currNode.isEnd) {\n hasWord = true;\n }\n }\n }\n\n if (this.words.hasFirstLetter(letter)) {\n newPointers.push(this.words.root[letter]);\n\n if (this.words.root[letter].isEnd) {\n hasWord = true;\n }\n }\n\n this.pointers = newPointers;\n\n return hasWord;\n }", "function setParents(currFormula) {\n let arr = currFormula.split(\" \");\n for (let i = 0; i < arr.length; i++) {\n let c = arr[i].charCodeAt(0); // if it starts from A-Z\n if (c >= 65 && c <= 90) {\n let { rid, cid } = getValueOfRC(arr[i]); // address nikala and then putted it in children array\n sheetDB[rid][cid].children.push(addressInput.value);\n }\n }\n}", "function _get_client_contacts_list(db){\n try{ \n var rows = db.execute('SELECT * FROM my_client_contact WHERE status_code=1 and client_id in ('+\n 'select a.client_id from my_'+_type+' as a where a.id=?) and '+\n 'id in (select b.client_contact_id from my_'+_type+'_client_contact as b where b.'+_type+'_id=? and b.status_code=1)',_selected_job_id,_selected_job_id);\n var b = 0;\n if(rows.getRowCount() > 0){\n while(rows.isValidRow()){\n var row = Ti.UI.createTableViewRow({\n filter_class:'client_contact',\n className:'client_contact_list_data_row_'+b,\n hasChild:true,\n source:_source,\n job_id:_selected_job_id,\n client_id:rows.fieldByName('client_id'),\n contact_id:rows.fieldByName('id'),\n title:rows.fieldByName('first_name')+' '+rows.fieldByName('last_name'),\n mobile:rows.fieldByName('phone_mobile'),\n email:rows.fieldByName('email')\n }); \n if(b === 0){\n row.header = 'Client Contacts';\n }\n self.data.push(row);\n rows.next();\n b++;\n }\n }\n rows.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_client_contacts_list');\n return;\n } \n }", "function getKeysDataPeople(keysData) {\n var keysPeople = {}\n return Promise.map(keysData, function(row, i) {\n//Parse out the keyholder as a person\n var keyholder = (row['FIRST'].trim() + ' ' + row['LAST NAME'].trim()).trim();\n keysPeople[keyholder] = keysPeople[keyholder] || {\n name: keyholder, \n given_name: row['FIRST'].trim().replace('.', ''),\n family_name: row['LAST NAME'].trim(),\n keys: {},\n puid: row['PUID'],\n status: row['STATUS'],\n department: row['DEPARTMENT'],\n _type: 'person',\n }\n\t\tkeysPeople[keyholder].keys[row['KEY NUMBER']] = {\n\t\t\tidentifier: row['KEY IDENTIFIER'] || '',\n\t\t\tbuildings: row['BUILDING'],\n\t\t\troom: row['ROOM NUMBER'],\n\t\t\tnumber: row['KEY NUMBER'],\n\t\t\tdate: row['DATE'],\n\t\t};\n console.log(keysPeople[keyholder])\n keysPeople[keyholder].fulltext = createFullText(keysPeople[keyholder], searchablePeopleAttributes);\n\n//Parse out the supervisor as a person\n if (row['SUPERVISOR'] && (row['SUPERVISOR'].trim().length > 0)) {\n var supervisor = row['SUPERVISOR'].trim();\n var name = supervisor[0] + supervisor.substring(1, supervisor.length).toLowerCase();\n keysPeople[name] = {\n name: name,\n family_name: name,\n department: row['DEPARTMENT'],\n _type: 'person',\n }\n keysPeople[name].fulltext = createFullText(keysPeople[name], searchablePeopleAttributes);\n }\n return null\n }).then(function(){\n return keysPeople\n })\n}", "function LazyTrie(baseURL, rootURL) {\n //console.log(\"js.LazyPatricia.LazyTrie baseURL: \" + baseURL);\n //console.log(\"js.LazyPatricia.LazyTrie rootURL: \" + rootURL);\n\n this.baseURL = baseURL;\n var trie = this;\n\n dojo.xhrGet({url: rootURL,\n handleAs: \"json\",\n load: function(o) {\n if (!o) {\n //console.log(\"failed to load trie\");\n return;\n }\n trie.root = o;\n trie.extra = o[0];\n if (trie.deferred) {\n trie.deferred.callee.apply(trie, trie.deferred);\n delete trie.deferred;\n }\n }\n });\n}", "display() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, true);\n }", "get_suggestions(){\n let newsuggestions = {}\n for(var key in this.suggestions){\n if (this.suggestions.hasOwnProperty(key)) { \n newsuggestions[key] = new Suggestion(this.suggestions[key].get_treeDataObjects())\n }\n }\n return newsuggestions;\n }", "randomTrie(num) {\n\t\tif (num > 993) num = 993\n\t\tlet allWords = words['words']\n\t\tlet upper = 0\n\t\tlet lower = num * 2 + 10\n\t\tlet elements = new Set()\n\t\tfor (let i = 0; i < num; i++) {\n\t\t\tlet value =\n\t\t\t\tMath.floor(Math.random() * (upper - lower + 1)) + lower\n\t\t\twhile (elements.has(value) || value > 993) {\n\t\t\t\tvalue =\n\t\t\t\t\tMath.floor(Math.random() * (upper - lower + 1)) + lower\n\t\t\t}\n\t\t\telements.add(value)\n\t\t\tthis.insert(allWords[value])\n\t\t}\n\t}", "find(value, parent = this.root) {\n // loop through every letter in the value\n for (let i = 0; i < value.length; i++){\n //\n parent = parent.children.find(child => child.value[i] === value[i]);\n\n if (!parent){\n return null;\n }\n }\n return parent;\n }", "find(value, parent = this.root) {\n // loop through every letter in the value\n for (let i = 0; i < value.length; i++){\n //\n parent = parent.children.find(child => child.value[i] === value[i]);\n\n if (!parent){\n return null;\n }\n }\n return parent;\n }", "function getPhoneContactsSuccess(contacts){\r\n\tconsole.log(\"# of contacts: \" + contacts.length);\r\n\tvar phoneContactsArrayCount = 0;\r\n\tfor(var i=0;i<contacts.length;i++){\r\n\t\t//phoneContacts[i] = new Contact();\r\n\t\t//phoneContacts[i].contactName = contacts[i].displayName;\r\n\t\tif(contacts[i].phoneNumbers){\r\n\t\t\tfor(var j=0;j<contacts[i].phoneNumbers.length;j++){\r\n\t\t\t\tphoneContactsArray[phoneContactsArrayCount] = contacts[i].phoneNumbers[j].value.replace(/\\D/g,'');\r\n\t\t\t\t//phoneContacts[i].contactPhones[j] = contacts[i].phoneNumbers[j].value;\r\n\t\t\t\tnamePhoneMapping[contacts[i].phoneNumbers[j].value.replace(/\\D/g,'')] = contacts[i].displayName;\r\n\t\t\t\tphoneContactsArrayCount++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\tconsole.log(JSON.stringify(phoneContactsArray));\r\n\tif(isnearBy){\r\n\t\t//window.location = \"nearByContactsMap.html\";\r\n\t\t$(\"#pagePort\").load(\"nearByContactsMap.html\", function(){\r\n\t\t\tisInNearBy = true;\r\n\t\t\tisInChatList = false;\r\n\t\t\t$('#pagePort').css(\"background-image\",\"none\");\r\n\t\t\t$('#pagePort').trigger(\"create\");\r\n\t\t\t/**analytics**/\r\n\t\t\tga('send', 'pageview', {\r\n\t\t\t\t'page': 'nearByContactsMap.html',\r\n\t\t\t\t'title': 'Friends finder map'\r\n\t\t\t});\r\n\t\t\tregisterNewSocket();\r\n\t\t\tinitializeNearBy();\r\n\t\t\t\r\n\t\t});\r\n\t\treturn;\r\n\t}\r\n\tconsole.log(\"hello geo\");\r\n\tgetMyLocation();\r\n}", "function listAddresses(obj){\n\tfor (key in obj){\n\t\tfor (let i=0; i<obj[key].length; i++){\n\t\t\tconsole.log(i==0 ? key+\"\\n\"+obj[key][i] : obj[key][i]);\n\t\t}\n\t}\n}", "extractReferences(index, count, first_object_id) {\n let _refs = [];\n let res = { result: null, start_index: -1, end_index: index };\n for (let i = 0; count === -1 || i < count; ++i) {\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let pointer = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let generation = util_1.Util.extractNumber(res.result, 0).result;\n res = util_1.Util.readNextWord(this.data, res.end_index + 1);\n let ptr_flag = res.result;\n let isFree = ptr_flag[0] === 102; // 102 = f\n _refs.push({\n id: first_object_id + i,\n pointer: pointer,\n generation: generation,\n free: isFree,\n update: !isFree\n });\n // if the word trailer occurs stop since we reached the end\n if (this.data[util_1.Util.skipSpaces(this.data, res.end_index + 1)] === 116) {\n break;\n }\n }\n return { refs: _refs, end_index: res.end_index };\n }", "constructor() {\n\t\tthis.trie = new Map();\n\t}", "function initContactList() {\n // Get a reference to the database service for \"user\" node.\n var database = firebase.database();\n var ref = database.ref(\"bbmsdk/identity/users/\");\n\n // If the local user isn't already registered in firebase, add them now.\n database.ref('bbmsdk/identity/users/' + firebase.auth().currentUser.uid).set({\n regId: userRegId,\n email: googleUserEmail,\n avatarUrl: googleUserAvatarImageURL,\n name: googleUserName\n }).catch(function (error) {\n console.error('Error registering user in firebase: ' + error);\n });\n\n //listen to 'child_added' from \"user\" node in the database.\n ref.on('child_added', function (user) {\n var regId = user.val().regId;\n var name = user.val().name;\n var key = user.key;\n\n if (regId !== undefined) {\n //exclude the local user from the contact list\n if (regId !== userRegId) {\n console.log(\"Rich Chat: Firebase 'User' - child_added: \" + name\n + \" key: \" + key + \" regId: \" + regId);\n\n //Check if the contact map contains a contact that has the same regId\n if (contactsMap[regId] == undefined) {\n //Create a BBMData (having id: 'contact-RegId') to wrap \"user\" object for data binding\n var contactData = new BBMData(DATA_BIND_PREFIX_CONTACT + regId);\n\n // Add the user into the map, so the user can be found by its regId.\n // This must happen first so that any updates that are triggered by calling\n // contactData.set() below will be able to find the relevant data.\n contactsMap[regId] = contactData;\n\n //At this point, we only set the properties needed by UI elements.\n contactData.set(DATA_CONTACT_NAME, name);\n contactData.set(DATA_CONTACT_IMG_URL, user.val().avatarUrl);\n\n //Add the user to the list on the contact tab to display\n addContactToContactTab(regId);\n } else {\n //Filter out a new contact who has the same regId with the existing contact in the map.\n //This is to avoid the duplicated contacts in the current database.\n console.log(\"Rich Chat: Contact map already has an entry with the same RegId: \" + regId\n + \". This 'User' of name: \" + name + \" key: \" + key + \" will be ignored.\");\n }\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n\n //listen to 'child_changed' from \"user\" node in the database.\n ref.on('child_changed', function (user) {\n var regId = user.val().regId;\n var name = user.val().name;\n var contactData = contactsMap[regId];\n\n console.log(\"Rich Chat: Firebase 'User' - child_changed: \" + name + \" key: \" + user.key\n + \" regId: \" + regId);\n\n if (regId !== undefined) {\n //Check if the contact map contains a contact that has the same regId\n if (contactData != undefined) {\n //Replace the properties with the new ones and the data binder should trigger the UI elements to update\n contactData.set(DATA_CONTACT_NAME, name);\n contactData.set(DATA_CONTACT_IMG_URL, user.val().avatarUrl);\n } else {\n //Prevent the map from updating a contact that was never added before\n console.log(\"Rich Chat: Firebase 'User' of RegId: \" + regId\n + \" has never been added to map before. Ignore this child_changed\");\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n\n //listen to 'child_removed' from \"user\" node in the database.\n ref.on('child_removed', function (user) {\n var regId = user.val().regId;\n\n console.log(\"Rich Chat: Firebase 'User' - child_removed: \" + user.val().name + \" key: \" + user.key\n + \" regId: \" + regId);\n\n if (regId !== undefined) {\n //Check if the contact map contains a contact that has the same regId\n if (contactsMap[regId] != undefined) {\n //remove the user from the map\n delete contactsMap[regId];\n\n //remove the user from the list on the contact tab\n removeContactFromContactTab(regId);\n } else {\n //Prevent the map from removing a contact that was never added before\n console.log(\"Rich Chat: Firebase 'User' of RegId: \" + regId\n + \" has never been added to map before. Ignore this child_removed\");\n }\n } else {\n showErrorDialog(\"Contact '\" + key + \"' from the database doesn't have a BBM registration ID\");\n }\n });\n}", "function getTerms(array) {\n let curr = 0;\n for(let i = 0; i < minLevel; i++) {\n terms[i] = [];\n }\n for(let i = minLevel; i <= maxLevel; i++){\n terms[i] = [];\n curr = 0;\n for(let j = 0; j < array.length; j++){\n if(parseInt(array[j]['level']) === i){\n terms[i][curr] = {name: '', id: ''};\n terms[i][curr]['name'] = array[j]['name'];\n terms[i][curr]['id'] = array[j]['ID'];\n curr++;\n } \n }\n }\n }", "function filterContact(contacts) {\n return _.chain(contacts).groupBy((contact) => {\n // group contact to detect contact that are the same\n const contactCopy = {\n lastName: contact.lastName,\n firstName: contact.firstName,\n };\n if (contact.address) {\n contactCopy.address = {\n country: contact.address.country,\n line1: contact.address.line1,\n zip: contact.address.zip,\n city: contact.address.city,\n };\n }\n return JSON.stringify(contactCopy);\n }).map(groups => groups[0]).filter(contact => _.get(contact, 'address') && ['BE', 'FR', 'CH'].indexOf(contact.address.country) > -1)\n .value();\n }" ]
[ "0.5824923", "0.58051974", "0.5803916", "0.5700077", "0.5698136", "0.56904846", "0.5688616", "0.5616329", "0.5470682", "0.5427127", "0.5307126", "0.52866936", "0.5253028", "0.5246945", "0.52440655", "0.5229373", "0.5190896", "0.5180394", "0.5176953", "0.5157817", "0.5144703", "0.5095387", "0.50854886", "0.50500643", "0.502849", "0.49992955", "0.4989999", "0.49836034", "0.4983119", "0.49757588", "0.49696094", "0.4967391", "0.49616522", "0.49564484", "0.49370426", "0.49302799", "0.49043074", "0.48992103", "0.48961887", "0.48932368", "0.48873863", "0.48815647", "0.48622543", "0.48596984", "0.48457068", "0.4827591", "0.48165002", "0.4812904", "0.4801435", "0.4799403", "0.4788457", "0.47878504", "0.47614124", "0.4747952", "0.47307083", "0.47079822", "0.46722767", "0.46712768", "0.46703407", "0.46634012", "0.4658373", "0.46563712", "0.4648946", "0.46485144", "0.46485144", "0.46456525", "0.4635004", "0.4632674", "0.46202493", "0.461885", "0.46014747", "0.45935643", "0.4592777", "0.45870912", "0.45734832", "0.45734832", "0.45579097", "0.45440245", "0.45431486", "0.4540524", "0.45275095", "0.4518902", "0.45175958", "0.4515737", "0.45099524", "0.45083869", "0.45078677", "0.45072734", "0.45071813", "0.45001665", "0.44998837", "0.44998837", "0.4492172", "0.44904727", "0.44895822", "0.44860813", "0.4482028", "0.44811374", "0.44774914" ]
0.8099989
0
Function to create chart containing all collected data for supermarket ready meals
function AllDataChart(){ // Create arrays for our variables let allLabels = []; let allFatData = []; let allSaltData = []; let allCarbohydrateData = []; let allSugarData = []; let allProteinData = []; let allEnergyData = []; // Import csv's with d3 // MORRISONS d3.csv(morrisonsForOne, function(morrisonsForOne) { allLabels.push(morrisonsForOne.Title); allFatData.push(morrisonsForOne.Fat); allEnergyData.push(morrisonsForOne.Energy); allSaltData.push(morrisonsForOne.Salt); allCarbohydrateData.push(morrisonsForOne.Carbohydrate); allSugarData.push(morrisonsForOne.Sugars); allProteinData.push(morrisonsForOne.Protein); }) // SAINSBURYS d3.csv(sainsburysForOne, function(sainsburysForOne) { allLabels.push(sainsburysForOne.Title); allFatData.push(sainsburysForOne.Fat) allEnergyData.push(sainsburysForOne.Energy); allSaltData.push(sainsburysForOne.Salt) allCarbohydrateData.push(sainsburysForOne.Carbohydrate) allSugarData.push(sainsburysForOne.Sugars) allProteinData.push(sainsburysForOne.Protein) }); // WAITROSE d3.csv(waitroseForOne, function(waitroseForOne) { allLabels.push(waitroseForOne.Title); allFatData.push(waitroseForOne.Fat) allEnergyData.push(waitroseForOne.Energy); allSaltData.push(waitroseForOne.Salt) allCarbohydrateData.push(waitroseForOne.Carbohydrate) allSugarData.push(waitroseForOne.Sugars) allProteinData.push(waitroseForOne.Protein) }); // TESCO d3.csv(tescoForOne, function(tescoForOne) { allLabels.push(tescoForOne.Title); allFatData.push(tescoForOne.Fat) allEnergyData.push(tescoForOne.Energy); allSaltData.push(tescoForOne.Salt) allCarbohydrateData.push(tescoForOne.Carbohydrate) allSugarData.push(tescoForOne.Sugars) allProteinData.push(tescoForOne.Protein) }); // Prepare initial chart let chart; d3.csv(tescoForOne, function(tescoForOne) { if (chart) chart.chart.destroy(); chart = new Chart('chart', { type: 'line', options: allProductChatOptions, data: { labels: allLabels, datasets: [ { label:"Salt", data: allSaltData, backgroundColor:"rgba(255, 166, 48, 0.8)" }, { label:"Sugar", hidden:true, data: allSugarData, backgroundColor:"rgba(215, 232, 186, 0.8)" }, { label:"Fat", hidden:true, data: allFatData, backgroundColor:"rgba(255, 99, 143, 0.8)" }, { label:"Protein", hidden:true, data: allProteinData, backgroundColor:"rgba(77, 161, 169, 0.8)" }, { label:"Carbohydrates", hidden:true, data: allCarbohydrateData, backgroundColor:"rgba(255, 138, 138, 0.8)" }, { label:"Calories", hidden:true, data: allEnergyData, backgroundColor:"rgba(255, 126, 46, 0.6)" }, ] } }); }); let allProductChatOptions = { hover: { onHover: function(e) { var point = this.getElementAtEvent(e); if (point.length) e.target.style.cursor = 'pointer'; else e.target.style.cursor = 'default'; } }, plugins: { datalabels: { // hide datalabels for all datasets display: false } }, legend:{ onHover: function(e) { e.target.style.cursor = 'pointer'; }, display:true, labels:{ fontColor: '#FF638F', } }, scales: { yAxes: [{ barThickness: 4, categoryPercentage: 1.0, barPercentage: 1.0, ticks: { fontColor:'#FF638F', display:true, } }], xAxes:[{ ticks:{ display:false } }] } } return( <canvas id="chart"></canvas> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toChartData() {\n let days = [];\n let restaurants = [];\n let dataSetArray = [];\n for (var i = 0; i < this.data.length; i ++) {\n if (!restaurants.includes(this.data[i].name)) {\n restaurants.push(this.data[i].name)\n }\n if (!days.includes(this.data[i].reportDate)) {\n days.push(this.data[i].reportDate)\n }\n }\n\n var emptyHash = {};\n for (i = 0; i < this.data.length; i ++) {\n if (emptyHash[this.data[i].name]) {\n emptyHash[this.data[i].name].push(this.data[i].profit);\n } else {\n emptyHash[this.data[i].name] = [];\n emptyHash[this.data[i].name].push(this.data[i].profit);\n }\n }\n\n return {\n labels: days,\n datasets: [\n {\n label: restaurants[0],\n fill: false,\n borderColor: \"rgba(0, 173, 181, 1)\",\n data: emptyHash[restaurants[0]],\n },\n {\n label: restaurants[1],\n fill: false,\n borderColor: \"rgba(255,0,0)\",\n data: emptyHash[restaurants[1]],\n },\n {\n label: restaurants[2],\n fill: false,\n borderColor: \"rgba(128,0,128)\",\n data: emptyHash[restaurants[2]],\n },\n {\n label: restaurants[3],\n fill: false,\n borderColor: \"rgba(144, 238, 144, 1)\",\n data: emptyHash[restaurants[3]],\n },\n {\n label: restaurants[4],\n fill: false,\n borderColor: \"rgba(248, 181, 0, 1)\",\n data: emptyHash[restaurants[4]],\n },\n ]\n }\n }", "function populateData() {\n let counts = {};\n let chartPieData = {'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n let chartDateData = {};\n let chartAgeData = {\n 'total': [0,0,0,0,0,0,0,0,0,0],\n 'possible': [0,0,0,0,0,0,0,0,0,0],\n 'probable': [0,0,0,0,0,0,0,0,0,0],\n 'certain': [0,0,0,0,0,0,0,0,0,0],\n 'gueri': [0,0,0,0,0,0,0,0,0,0],\n 'mort': [0,0,0,0,0,0,0,0,0,0]\n };\n let chartSexData = {\n 'total': {'F': 0, 'M': 0},\n 'possible': {'F': 0, 'M': 0},\n 'probable': {'F': 0, 'M': 0},\n 'certain': {'F': 0, 'M': 0},\n 'gueri': {'F': 0, 'M': 0},\n 'mort': {'F': 0, 'M': 0}\n };\n for (let cas of cases) {\n let loc = cas['Domicile'];\n if (!(loc in counts)) {\n counts[loc] = {'total': 0, 'possible': 0, 'probable': 0, 'certain': 0, 'gueri': 0, 'mort': 0};\n }\n let filtered = (viewConfig.filter ? viewConfig.filter(cas) : viewFilterDefault(cas));\n if (filtered) {\n counts[loc]['total'] += 1;\n counts[loc][filtered['Condition']] += 1;\n\n chartPieData[filtered['Condition']] += 1;\n\n let date = new Date(filtered['Date symptomes']);\n if (!isNaN(date)) {\n date = date.toISOString();\n chartDateData[date] = (chartDateData[date] || 0 ) + 1;\n }\n\n chartAgeData['total'][Math.floor(filtered['Age']/10)] += 1;\n chartAgeData[filtered['Condition']][Math.floor(filtered['Age']/10)] += 1;\n\n chartSexData['total'][filtered['Sexe']] += 1;\n chartSexData[filtered['Condition']][filtered['Sexe']] += 1;\n }\n }\n data = {\n 'map': counts,\n 'globalpie': chartPieData,\n 'date': chartDateData,\n 'age': chartAgeData,\n 'sex': chartSexData,\n };\n}", "function generateChartData(details) {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_0;\n var Dacoity = newData[1].cy_0;\n var HBsbyDay = newData[2].cy_0;\n var HBsbyNight = newData[3].cy_0;\n var Ordinary = newData[4].cy_0;\n var Robbery = newData[5].cy_0;\n\n chartData.push({\n date: \"2016\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_1;\n var Dacoity = newData[1].cy_1;\n var HBsbyDay = newData[2].cy_1;\n var HBsbyNight = newData[3].cy_1;\n var Ordinary = newData[4].cy_1;\n var Robbery = newData[5].cy_1;\n\n chartData.push({\n date: \"2014\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_2;\n var Dacoity = newData[1].cy_2;\n var HBsbyDay = newData[2].cy_2;\n var HBsbyNight = newData[3].cy_2;\n var Ordinary = newData[4].cy_2;\n var Robbery = newData[5].cy_2;\n\n chartData.push({\n date: \"2013\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_3;\n var Dacoity = newData[1].cy_3;\n var HBsbyDay = newData[2].cy_3;\n var HBsbyNight = newData[3].cy_3;\n var Ordinary = newData[4].cy_3;\n var Robbery = newData[5].cy_3;\n\n chartData.push({\n date: \"2012\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n var newData = details.gettrendlineReport\n var murders = newData[0].cy_4;\n var Dacoity = newData[1].cy_4;\n var HBsbyDay = newData[2].cy_4;\n var HBsbyNight = newData[3].cy_4;\n var Ordinary = newData[4].cy_4;\n var Robbery = newData[5].cy_4;\n\n chartData.push({\n date: \"2011\",\n murders: murders,\n Dacoity: Dacoity,\n HBsbyDay: HBsbyDay,\n HBsbyNight: HBsbyNight,\n Ordinary: Ordinary,\n Robbery: Robbery\n });\n return chartData;\n }", "function generateChartData() {\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 50);\n\n for (var i = 0; i < 50; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n\n var visits = Math.round(Math.random() * 40) + 100;\n var hits = Math.round(Math.random() * 80) + 500;\n var views = Math.round(Math.random() * 6000);\n\n chartData.push({\n date: newDate,\n visits: visits,\n hits: hits,\n views: views\n });\n }\n }", "function generateChartData() {\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 50);\n\n for (var i = 0; i < 50; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n\n var visits = Math.round(Math.random() * 40) + 100;\n var hits = Math.round(Math.random() * 80) + 500;\n var views = Math.round(Math.random() * 6000);\n\n chartData.push({\n date: newDate,\n visits: visits,\n hits: hits,\n views: views\n });\n }\n }", "function chart(data, d3) {\n \n // DECLARE CONTAINERS\n var lists = {\n population: [],\n emission: [],\n capita: []\n }\n\n // FETCH THE YEARS FOR TOOLTIPS\n var years = Object.keys(data.overview);\n\n // LOOP THROUGH & FILL THE LISTS\n years.forEach(year => {\n lists.population.push(data.overview[year].population);\n lists.emission.push(data.overview[year].emission);\n lists.capita.push(data.overview[year].emission / data.overview[year].population);\n });\n\n // CONVERT ARRAY DATA TO CHARTS\n generate_charts(lists, years, d3);\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 100);\n firstDate.setHours(0, 0, 0, 0);\n/// starting number\n var visits = 7.6;\n var hits = 13.4;\n var views = 7;\n\n var myData = {\n Zelenski: [7.6, 9.4, 8, 8.8, 9, 9.4, 10.8, 10.9, 11.9, 14.9, 15.2, 16.4, 17.5, 19.6, 19.9, 20.3, 23.1],\n Timoshenko: [13.4, 14.7, 14, 14.8, 14.2, 14.4, 13.4, 15.5, 15.1, 12.9, 9.6, 11.5, 13.5, 13.8, 13.9, 14],\n Poroshenko: [7, 6.2, 8, 8.1, 8.6, 10.8, 7.7, 8.2, 10.4, 10.1, 10.8, 13.1, 13.1, 13.4, 13.1, 12.4]\n }\n var mynewuselessvar;\n for (var i = 0; i < myData.candidate1.length; i++) {\n chartData.push({\n date: [\"1st Nov\", \"22nd Nov\", \"3rd Dec\",\"14th Dec\", \"18th Dec\", \"29th Dec\", \"3rd Jan\", \"15th Jan\", \"25th Jan\", \"4th Feb\", \"20th Feb\", \"27th Feb\", \"4th March\", \"7th March\", \"14th March\"],\n visits: myData.Zelenski[i],\n hits: myData.Timoshenko[i],\n views: myData.Poroshenko[i]\n });\n }\n\n\n // for (var i = 0; i < 15; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n // var newDate = new Date(firstDate);\n // newDate.setDate(newDate.getDate() + i);\n //\n // visits =\n // hits = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n // views = Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n\n\n // }\n return chartData;\n}", "function generateChartData() {\r\n var chartData = [];\r\n var firstDate = new Date();\r\n firstDate.setDate(firstDate.getDate() - 5);\r\n var visits = 1200;\r\n for (var i = 0; i < 1000; i++) {\r\n // we create date objects here. In your data, you can have date strings\r\n // and then set format of your dates using chart.dataDateFormat property,\r\n // however when possible, use date objects, as this will speed up chart rendering.\r\n var newDate = new Date(firstDate);\r\n newDate.setDate(newDate.getDate() + i);\r\n\r\n visits += Math.round((Math.random() < 0.5 ? 1 : -1) * Math.random() * 10);\r\n\r\n chartData.push({\r\n date: newDate,\r\n visits: visits\r\n });\r\n }\r\n return chartData;\r\n }", "function show_chart() {\n outer_chart=[]\n inner_chart={}\n for(i=0;i<random_passenger_data.length;i++) {\n if(random_passenger_data[i].name.includes('sibsp') || random_passenger_data[i].name.includes('parch') || random_passenger_data[i].name.includes('fare')) {\n inner_chart['name'] = random_passenger_data[i].name\n inner_chart['value'] = random_passenger_data[i].value\n outer_chart.push(inner_chart)\n inner_chart={}\n }\n }\nreturn(outer_chart)\n}", "function generateChartData2() {\r\n var chartData = [];\r\n var firstDate = new Date();\r\n firstDate.setDate(firstDate.getDate() - 5);\r\n var visits = 1200;\r\n for (var i = 0; i < 1000; i++) {\r\n // we create date objects here. In your data, you can have date strings\r\n // and then set format of your dates using chart.dataDateFormat property,\r\n // however when possible, use date objects, as this will speed up chart rendering.\r\n var newDate = new Date(firstDate);\r\n newDate.setDate(newDate.getDate() + i);\r\n \r\n visits += Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\r\n\r\n chartData.push({\r\n date: newDate,\r\n visits: visits\r\n });\r\n }\r\n return chartData;\r\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 5);\n var visits = 1200;\n for (var i = 0; i < 1000; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n \n visits += Math.round((Math.random()<0.5?1:-1)*Math.random()*10);\n\n chartData.push({\n date: newDate,\n visits: visits\n });\n }\n return chartData;\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 5);\n for (var i = 0; i < 1000; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n var visits = Math.round(Math.random() * (40 + i / 5)) + 20 +\n i;\n chartData.push({\n date: newDate,\n visits: visits\n });\n }\n return chartData;\n }", "static process(data){\n console.log(data)\n const user = data.user\n const spending = data.categories\n const total_spending = spending.map(e => e.cost).reduce((memo, e)=>e + memo,0)\n const new_array = []\n const labels = []\n const colors = []\n if(user.income && spending.length > 0 ){\n\n // new_array.push(user.income)\n // labels.push(\"Income\")\n // colors.push(\"rgb(64, 139, 179)\")\n spending.forEach(e => {new_array.push(e.cost); labels.push(e.name)})\n while(colors.length !== labels.length){\n const new_color = `rgb(${Math.floor((Math.random() * 256))}, ${Math.floor((Math.random() * 256))}, ${Math.floor((Math.random() * 256))})`\n if(!colors.includes(new_color)){\n colors.push(new_color)\n }\n }\n if (!document.querySelector(\"div.chart-info\").classList.contains(\"hidden\")){\n document.querySelector(\"div.chart-info\").classList.add(\"hidden\")\n }\n document.querySelector(\"div.myCanvas\").innerHTML = `<canvas class=\"myChart hidden\" id=\"myChart\"></canvas>`\n Chart_Generator.create_chart(total_spending,new_array,labels,colors)\n Chart_Generator.summary(data)\n }else{\n document.querySelector(\"canvas\").style.display = \"\"\n if (document.querySelector(\"div.chart-info\").classList.contains(\"hidden\")){\n document.querySelector(\"div.chart-info\").classList.remove(\"hidden\")\n }\n\n \n }\n }", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function drawChartListing(livelist,livesale,liverent,pendinglist,pendsale,pendrent,lesspics,lesspicssale,lesspicsrent)\n\n\t\t\t{\n\n\t\t\t\tvar portalsArray = [];\n\n\t\t\t\tvar salesArray = [];\n\n\t\t\t\tvar rentalsArray = [];\n\n\t\t\t\tvar itemsCount = 0;\n\n\t\t\t\t//$.each(portalData, function( index, value ) {\n\n\t\t\t\t portalsArray.push([1,livelist]);\n\n\t\t\t\t salesArray.push([1,livesale]);\n\n\t\t\t\t rentalsArray.push([1,liverent]);\n\n\t\t\t\t // itemsCount++;\n\n\t\t\t\t//});\n\n\t\t\t\t portalsArray.push([2,pendinglist]);\n\n\t\t\t\t salesArray.push([2,pendsale]);\n\n\t\t\t\t rentalsArray.push([2,pendrent]);\n\n\t\t\t\t portalsArray.push([3,lesspics]);\n\n\t\t\t\t salesArray.push([3,lesspicssale]);\n\n\t\t\t\t rentalsArray.push([3,lesspicsrent]);\n\n\t\t\t\t itemsCount = 3;\n\n\t\t\t\t plotDataMe(salesArray,rentalsArray,portalsArray,itemsCount);\n\n\t\t\n\n\t\t\t\t\n\n\t\t\t}", "function BuildCharts(id) {\n \n //********Declare Local Variables *********/\n //Variables for Series and Axis Arrays\n var years = [];\n var acres_burned = [];\n var avg_acres_burned = [];\n var fatalities = [];\n var structures_destroyed = [];\n var structures_damaged = [];\n var years_small = [];\n var acres_burned_pct_increase = [];\n var incidents_small = [];\n var incident_small_pct_increase = []\n var years_medium = [];\n var incidents_medium= [];\n var incident_medium_pct_increase = []\n var years_large = [];\n var incidents_large = [];\n var incident_large_pct_increase = [];\n \n //------------------------------------------\n // Create the Metadata Card\n //------------------------------------------\n\n \n //------------------------------------------\n // Create the Metadata Card\n //------------------------------------------\n //Filter overall global data array by selection.\n td = overall_stats_data.filter(d => {return(d.county_description == id)});\n overall_stats_td = td.map(e => {return e});\n console.log(overall_stats_td);\n // Select the Metadata card in Index.html\n var metadataCard = d3.select(\"#sample-metadata\");\n var all_years_summary = {\n \"Total number of fires: \": overall_stats_td[0].total_fires,\n \"Total acres burned: \" : overall_stats_td[0].acres_burned,\n \"Total structures destroyed: \" : overall_stats_td[0].structures_destroyed,\n \"Total structures damaged: \" : overall_stats_td[0].structures_damaged,\n \"Total fatalities: \" : overall_stats_td[0].total_fatalities\n };\n\n // Create a list group in the Demographic Info card with some special styling \n var metadataList = metadataCard.append(\"ul\").attr(\"class\", \"list-group list-group-flush metadata-fields\")\n // Iterate through each key-value pair getting the values to build the Demographic Info card\n Object.entries(all_years_summary).forEach(([key, value]) => {\n var metadataItem = metadataList.append(\"li\").\n attr(\"class\", \"list-group-item p-1 details-text\").\n text(`${key}: ${value}`);\n }); \n\n //------------------------------------------\n // Filter Main Global Data Arrays By County Selection. Rebuild Axis and Category Arrays\n //------------------------------------------\n //Build Stack Barchart Axis and Category Arrays\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Large\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_large = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_large = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_large_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n \n\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Medium\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_medium = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_medium = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_medium_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n\n td = wildfire_year_incident_data.filter(d => {return(d.county_description == id & d.incident_level == \"Small\")});\n wildfire_year_incident_td = td.map(e => {return e}); \n years_small = wildfire_year_incident_td.map(e=>{return e.year});\n incidents_small = wildfire_year_incident_td.map(e=>{return e.total_fires});\n incident_small_pct_increase = wildfire_year_incident_td.map(e=>{return e.incident_pct + \"%\"});\n\n\n //Build Bar/Line Chart for total by year and add label.\n td = wildfire_year_data.filter(d => {return(d.county_description == id)});\n wildfire_year_td = td.map(e => {return e}); \n years = wildfire_year_td.map(e=>{return e.year}); \n acres_burned = wildfire_year_td.map(e=>{return e.acres_burned});\n acres_burned_increase_rate = wildfire_year_td.map(e=>{return e.acres_burned_increase_rate + \"%\"}); \n \n //Build Avaeage Bunred Acres Dataset\n avg_acres_burned = wildfire_year_td.map(e=>{return e.avg_acres_burned});\n\n //Build Grouped Bar Chart \n fatalities = wildfire_year_td.map(e=>{return e.total_fatalities});\n structures_damaged = wildfire_year_td.map(e=>{return e.structures_damaged});\n structures_destroyed = wildfire_year_td.map(e=>{return e.structures_destroyed});\n\n console.log(fatalities);\n console.log(fatalitiesg);\n \n\n //------------------------------------------\n // Chart Configuration \n //------------------------------------------\n //Acreage Burned Bar Chart Configuration\n var trace_bar = {\n x: years,\n y: acres_burned,\n type: \"bar\",\n name: \"Acres Burned\"\n };\n\n var trace_line = {\n x:years,\n y:acres_burned,\n type:\"scatter\",\n text:acres_burned_increase_rate,\n hovertemplate: '<br><b>%Increase</b><br>' +\n '<b>%{text}</b>',\n name:\"%Year Increase/Decrease\"\n };\n\n var layout_bar = {\n title: \"Acres Burned By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Acres Burned\",\n type:\"Linear\",\n }\n };\n\n var data_bar = [trace_bar,trace_line];\n //Average Acreage Burned Bar Chart Configuration\n var trace_avg_bar = {\n x: years,\n y: avg_acres_burned,\n type: \"bar\",\n name: \"Average Acres Burned\"\n };\n\n\n var layout_avg_bar = {\n title: \"Average Acres Burned per Wildfire\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Average Acres Burned\",\n type:\"Linear\",\n }\n };\n\n var data_avg_bar = [trace_avg_bar];\n \n //Stacked Bar Chart Configuration\n var trace_small = {\n x: years_small,\n y: incidents_small,\n text:incident_small_pct_increase,\n name: \"Small\",\n type: \"bar\",\n marker: {color: \"#ffb727\"}\n };\n\n var trace_medium = {\n x: years_medium,\n y: incidents_medium,\n text:incident_medium_pct_increase,\n name: \"Medium\",\n type: \"bar\",\n marker: {color: \"#ff7f27\"}\n }; \n \n var trace_large = {\n x: years_large,\n y: incidents_large,\n text: incident_large_pct_increase,\n name: \"Large\",\n type: \"bar\",\n marker: {color: \"#88001b\"}\n }; \n var data_stack = [trace_small,trace_medium,trace_large];\n\n var layout_stack = {\n title: \"Fire Incidents By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Incident Count\",\n type:\"Linear\",\n },\n barmode: 'stack'\n };\n \n //Grouped Bar Chart Configuration\n var trace_fatalities = {\n x: years,\n y: fatalities,\n name: \"Fatalities\",\n type: \"bar\"\n };\n\n var trace_structures_damaged = {\n x: years,\n y: structures_damaged,\n name: \"Structures Damaged\",\n type: \"bar\"\n };\n\n var trace_structures_destroyed = {\n x: years,\n y: structures_destroyed,\n name: \"Structures Destroyed\",\n type: \"bar\"\n };\n\n var data_destruction = [trace_fatalities,trace_structures_damaged,trace_structures_destroyed];\n\n var layout_destruction = {\n title: \"Destruction Metrics By Year\",\n xaxis: { title: \"Year\",\n type:\"Category\" },\n yaxis: { title: \"Volume\",\n type:\"log\"\n }\n };\n \n\n //------------------------------------------\n // Rebuild Bar Chart\n //------------------------------------------\n Plotly.react(\"stackbar\", data_stack, layout_stack);\n Plotly.react(\"bar\", data_bar, layout_bar); \n Plotly.react(\"bar-avg\", data_avg_bar, layout_avg_bar); \n Plotly.react(\"cluster\",data_destruction,layout_destruction); \n}", "function displayData() {\n // Get the domain data\n var domains = JSON.parse(localStorage[\"domains\"]);\n var chart_data = [];\n var table_data = [];\n // var colors = ['#5c91e6', '#a711f2', '#c353e6', '#ed39a8', '#e66ec8', '#eb3147', '#ffae00', '#0db81e', '#fff700'];\n for (var domain in domains) {\n var domain_data = JSON.parse(localStorage[domain]);\n var numSeconds = 0;\n numSeconds = domain_data.today;\n if (numSeconds > 0) {\n chart_data.push([\n domain,\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal;\",\n },\n },\n ]);\n var rnd = Math.floor(Math.random() * 8);\n switch(rnd) {\n case 0:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n }\n ]);\n break;\n case 1:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #a711f2;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #a711f2;\"\n }\n }\n ]);\n break;\n case 2:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #c353e6;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #c353e6;\"\n }\n }\n ]);\n break;\n case 3:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #ed39a8;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #ed39a8;\"\n }\n }\n ]);\n break;\n case 4:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #e66ec8;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #e66ec8;\"\n }\n }\n ]);\n break;\n case 5:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #eb3147;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #eb3147;\"\n }\n }\n ]);\n break;\n case 6:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #ffae00;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #ffae00;\"\n }\n }\n ]);\n break;\n case 7:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #0db81e;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #0db81e;\"\n }\n }\n ]);\n break;\n default:\n table_data.push([\n {\n v: domain,\n p:{\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n }\n ]);\n }\n // table_data.push([\n // {\n // v: domain,\n // p:{\n // style: \"text-align: left; white-space: normal; background-color: cyan;\"\n // }\n // },\n // {\n // v: numSeconds,\n // f: timeString(numSeconds),\n // p: {\n // style: \"text-align: left; white-space: normal; background-color: cyan;\"\n // }\n // }\n // ]);\n }\n }\n\n // Display help message if no data\n if (chart_data.length === 0) {\n document.getElementById(\"nodata\").style.display = \"inline\";\n } else {\n document.getElementById(\"nodata\").style.display = \"none\";\n }\n\n // Sort data by descending duration\n chart_data.sort(function (a, b) {\n return b[1].v - a[1].v;\n });\n table_data.sort(function (a, b) {\n return b[1].v - a[1].v;\n });\n\n // Limit chart data\n var limited_data_chart = [];\n var limited_data_table = [];\n var chart_limit;\n // For screenshot: if in iframe, image should always have 9 items\n if (top == self) {\n chart_limit = parseInt(localStorage[\"chart_limit\"], 10);\n } else {\n chart_limit = 9;\n }\n for (var i = 0; i < chart_limit && i < chart_data.length; i++) {\n limited_data_chart.push(chart_data[i]);\n limited_data_table.push(table_data[i]);\n }\n var sum = 0;\n for (var i = chart_limit; i < chart_data.length; i++) {\n sum += chart_data[i][1].v;\n }\n\n if (sum > 0) {\n limited_data_chart.push([\n \"Others\",\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal;\",\n },\n },\n ]);\n var rnd = Math.floor(Math.random() * 8);\n switch(rnd) {\n case 0:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n }\n ]);\n break;\n case 1:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #a711f2;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #a711f2;\"\n }\n }\n ]);\n break;\n case 2:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #c353e6;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #c353e6;\"\n }\n }\n ]);\n break;\n case 3:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #ed39a8;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #ed39a8;\"\n }\n }\n ]);\n break;\n case 4:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #e66ec8;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #e66ec8;\"\n }\n }\n ]);\n break;\n case 5:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #eb3147;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #eb3147;\"\n }\n }\n ]);\n break;\n case 6:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #ffae00;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #ffae00;\"\n }\n }\n ]);\n break;\n case 7:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #0db81e;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #0db81e;\"\n }\n }\n ]);\n break;\n default:\n limited_data_table.push([\n {\n v: \"Others\",\n p:{\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n },\n {\n v: sum,\n f: timeString(sum),\n p: {\n style: \"text-align: left; white-space: normal; background-color: #5c91e6;\"\n }\n }\n ]);\n }\n // limited_data_table.push([\n // \"Other\",\n // {\n // v: sum,\n // f: timeString(sum),\n // p: {\n // style: \"text-align: left; white-space: normal; background-color: cyan;\",\n // },\n // },\n // ]);\n }\n\n drawChart(limited_data_chart);\n\n // Add total time\n var total = JSON.parse(localStorage[\"total\"]);\n var numSeconds = 0;\n numSeconds = total.today;\n limited_data_table.push([\n {\n v: \"Total\",\n p: {\n style: \"text-align: left; font-weight: bold; background-color: cyan;\",\n },\n },\n {\n v: numSeconds,\n f: timeString(numSeconds),\n p: {\n style: \"text-align: left; white-space: normal; font-weight: bold; background-color: cyan;\",\n },\n },\n ]);\n\n drawTable(limited_data_table);\n}", "function getTotalSalesChart() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales-chart')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('revenue').innerHTML = data.revenue;\n document.getElementById('returns').innerHTML = data.returns;\n document.getElementById('queries').innerHTML = data.queries;\n document.getElementById('invoices').innerHTML = data.invoices;\n // Resten ligger i dashboard.js!\n })\n}", "function insChart(state) {\n var filterData = insData.filter(choice =>\n choice.location.trim() === state);\n var employerData = [];\n var medicaidData = [];\n var medicareData = [];\n var militaryData = [];\n var nonGroupData = [];\n var uninsuredData = [];\n var yearData = [];\n //filter usData for MMR rate to add to insurance chart\n var filterMMRData = usData.filter(event => event.state === state);\n var mmrData = [];\n filterMMRData.forEach(item => {\n mmr = item.mmr;\n mmrData.push(mmr);\n });\n\n filterData.forEach(item => {\n employer = item.employer;\n medicaid = item.medicaid;\n medicare = item.medicare;\n military = item.military;\n nonGroup = item.non_group;\n uninsured = item.uninsured;\n year = item.year;\n\n employerData.push(employer);\n medicaidData.push(medicaid);\n medicareData.push(medicare);\n militaryData.push(military);\n nonGroupData.push(nonGroup);\n uninsuredData.push(uninsured);\n yearData.push(year);\n });\n // console.log(yearData);\n\n var trace3 = {\n x: yearData,\n y: medicaidData,\n name: \"Medicaid\",\n type: \"scatter\",\n mode: \"lines+markers\",\n line: {\n color: 'rgb(60, 179, 113)',\n }\n }\n\n var trace6 = {\n x: yearData,\n y: uninsuredData,\n name: \"Uninsured\",\n type: \"scatter\",\n mode: \"lines+markers\",\n line: {\n color: 'rgb(25, 25, 112)',\n }\n }\n\n var data = [trace3, trace6];\n\n var layout = {\n title: `<b>${state} Health Insurance Coverage 2009–2019: Females 19–64`,\n yaxis: {\n title: \"<b>Percentage</b>\",\n },\n xaxis: {\n title: \"<b>Year</b>\",\n type: \"date\",\n tickvals: years,\n ticktext: [\"2009\", \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\", \"2017\", \"2018\", \"2019\"],\n },\n shapes: [\n {\n type: \"line\",\n x0: \"2014\",\n y0: 0,\n x1: \"2014\",\n y1: 25,\n line: {\n dash: \"dot\"\n }\n\n },\n ]\n };\n\n var config = {responsive: true, displayModeBar: false };\n\n Plotly.newPlot(\"insChart\", data, layout, config);\n}", "function generateChartData() {\n var chartData = [];\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 5);\n for (var i = 0; i < 20; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n\n var visits = Math.round(Math.random() * (40 + i / 5)) + 20 + i;\n\n chartData.push({\n date: newDate,\n visits: visits\n });\n\n }\n \n // var json = require('trends.json'); \n // \td3.json();\n // console.log(json);\n\n console.log(chartData)\n return chartData;\n}", "function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n }", "function generateComparisonChartData(){\n\n let all_comparison_chart_data = {};\n // we actually only need these keys to be in the dictionary \n // because for the comparison chart, these are the only metrics we use\n let keys_to_keep = [\"date\", \"spend\", \"trial_starts_all\", \"ltv_subs_all\", \"ltv_subs_revenue\"];\n\n // we want to run the following operations for both the regular chartdata AND the aggregate\n // that way we can pull either the single advertiser's information, or the aggregate data in the\n // comparisonChart() function where we actually generate the chart\n [chartdata, chartdata_aggregate].map( data_to_use => {\n // find all the advertisers selected that are not Organic\n let unique_paid_advertisers = data_to_use.advertiser.filter( onlyUnique ).filter( x => x !== \"Organic\");\n\n // in the case that Android is the only OS chosen, we want to only allow certain advertisers\n if(os_chosen.length === 1 && os_chosen.includes(\"ANDROID\")){\n unique_paid_advertisers = unique_paid_advertisers.filter(x => [\"Facebook Ads\", \"pinterest_int\", \"snapchat_int\", \"Aggregate Paid\"].includes(x));\n }\n\n // for all the advertisers selected, create a dictionary with each advertiser as a top level key\n // then the value of that key will be the information needed for the chart series for that advertiser\n unique_paid_advertisers.map((advertiser,i) => {\n // create a new dictionary to load data into\n let advertiser_comparison_data = {};\n\n // load the \"advertiser_comparison_data\" dictionary with only the date and metrics (keys) we care about for comparison charts\n for (key of keys_to_keep){\n advertiser_comparison_data[key] = data_to_use[key].filter((d,i) => {\n // return indexes_of_data_to_keep[i];\n // we could use this line of code and eliminate the need for creating the \"indexes_of_data_to_keep\" list.\n // but it would be slightly more confusing as to what we are doing and only save a little time.\n return (data_to_use.advertiser[i] === advertiser);\n });\n }\n\n all_comparison_chart_data[advertiser] = advertiser_comparison_data;\n\n });\n });\n\n // THE FINAL DICTIONARY WILL LOOK LIKE THIS\n //{\n // date: [\"2020-02-10\", \"2020-02-11\", etc.....]\n // advertiser: [\"Aggregate Paid\", \"Aggregate Paid\", etc.....]\n // spend: [1460.83, 1168.31, etc.....]\n // trial_starts_all: [101, 81, etc.....]\n // ltv_subs_all: [10, 2, etc.....]\n // ltv_subs_revenue: [475.2760479755903, 134.31296573571356, etc.....]\n //}\n\n return all_comparison_chart_data;\n}", "function makeSalesChart(){\n var chart = new CanvasJS.Chart(\"salesChart\");\n chart.options.title = {text: \"Sales by Day for Last Week\"};\n chart.options.axisY = {title: \"Sales\", prefix: \"$\"};\n chart.options.axisX = {labelFontSize: 20};\n chart.options.interactivityEnable = false;\n chart.options.width = 960 * .99;\n chart.options.height = 851.578 * .99;\n \n var dataSeries = {\n type: \"area\"\n }\n \n chart.options.data = [];\n chart.options.data.push(dataSeries);\n \n //this block to print completeHist array\n console.log(\"BETA_completeHist=\");\n for(var i = 0; i < completeHist.length; ++i){\n console.log(\"completeHist[\"+i+\"].date=\"+completeHist[i].date+\".cost\"+completeHist[i].cost);\n }//end print completeHist array\n \n //get today's date\n var date = new Date();\n date = completeHist[0].date;\n var days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n \n dataSeries.dataPoints = [\n {label: days[((date.getDay() - 6)+7)%7], y: parseFloat(completeHist[6].cost)},//...\n {label: days[((date.getDay() - 5)+7)%7], y: parseFloat(completeHist[5].cost)},//...\n {label: days[((date.getDay() - 4)+7)%7], y: parseFloat(completeHist[4].cost)},//...\n {label: days[((date.getDay() - 3)+7)%7], y: parseFloat(completeHist[3].cost)},//etc...\n {label: days[((date.getDay() - 2)+7)%7], y: parseFloat(completeHist[2].cost)},//2 days ago\n {label: days[((date.getDay() - 1)+7)%7], y: parseFloat(completeHist[1].cost)},//yesterday\n {label: days[date.getDay()], y: parseFloat(completeHist[0].cost)}//today\n ];//end dataSeries.dataPoints\n \n chart.render();\n}//END makeSalesChart", "function drawMonthlyChart(rawData) {\n var chart = new google.visualization.PieChart(document.getElementById('monthly-piechart'));\n console.log(rawData);\n\n var dict = {};\n for (var i = 0; i < rawData.length; i++) {\n var current = rawData[i];\n\n if (dict.hasOwnProperty(current)) {\n dict[current]++;\n } else {\n dict[current] = 1;\n }\n }\n\n var arr = [\n ['Mood', 'Days']\n ];\n\n for (var key in dict) {\n arr.push([key, dict[key]]);\n }\n\n console.log(arr);\n\n\tvar data = google.visualization.arrayToDataTable(arr);\n\t\n\tvar options = { 'title': 'Monthly', 'width': 550, 'height': 400 };\n\n chart.draw(data, options);\n}", "function instrument_hours_all()\n{\n\t$.getJSON('chart_data/instrument_hours.json', function(json){\n\t\tcreate_canvasXpress_graph(\"hours\", \"Instrument Usage by Time\", \"Pie\", json, \"1x1\")\n\t}); //getJSON\n}", "function drawCharts() {\n // Get total used in this year\n $.getJSON('get_dashboard_values', function (result) {\n createSpiderChart(result['registers']);\n var year_per = (Math.floor(result.total_used.year.value__sum)/15512066)*100;\n var month_per = (Math.floor(result.total_used.month.value__sum)/1292672)*100;\n\n var gauge1 = loadLiquidFillGauge(\"circle-1\", year_per);\n var gauge1 = loadLiquidFillGauge(\"circle-2\", month_per);\n });\n // Get raw debits\n $.getJSON('api/v1/CouncilmanDebits/?format=json&limit=99999999', function (result) {\n createHorizontalBarChart(sumDebitsByCNPJ(result['objects']));\n createTreeMapChart(sumDebitsByCostObject(result['objects']));\n createBarChart(sumDebitsByCouncilman(result['objects']));\n createDataTable(result['objects']);\n });\n}", "function createMiniChart(data, selectedTicker) {\n getPriceTrend(data, selectedTicker);\n\n}", "function generateChartData() {\n var chartData = [];\n // current date\n var firstDate = new Date();\n // now set 500 minutes back\n firstDate.setMinutes(firstDate.getDate() - 1000);\n\n // and generate 500 data items\n for (var i = 0; i < 500; i++) {\n var newDate = new Date(firstDate);\n // each time we add one minute\n newDate.setMinutes(newDate.getMinutes() + i);\n // some random number\n var visits = Math.round(Math.random() * 40 + 10 + i + Math.random() * i / 5);\n // add data item to the array\n chartData.push({\n date: newDate,\n visits: visits\n });\n }\n return chartData;\n }", "async function createGeneralInformationBoxes(){\n const chartData=(await getChartsData());\n \n const reduceAllTimeData=(dayInfoArray)=>{\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n return dayInfoArray.reduce(reducer);\n\n }\n\n\n const totalCases={\n title:'סה\"כ מאומתים (נדבקים)',\n // main:chartData.allCurveData[chartData.allCurveData.length-1].totalCases,\n main:reduceAllTimeData(chartData.allCurveData.map(dayInfo=>dayInfo.newCases)),\n fromMidnight:chartData.allCurveData[chartData.allCurveData.length-1].newCases,\n fromYesterday:chartData.allCurveData[chartData.allCurveData.length-2].newCases,\n moderate:'none',\n critical:chartData.allSeriousCases[chartData.allSeriousCases.length-1].critical\n }\n \n const respirators={\n title:'מונשמים',\n main:chartData.allSeriousCases[chartData.allSeriousCases.length-1].respirators,\n fromMidnight:\n chartData.allSeriousCases[chartData.allSeriousCases.length-1].respirators-\n chartData.allSeriousCases[chartData.allSeriousCases.length-2].respirators,\n allData:chartData.allSeriousCases.map(({date,respirators}) => ([Date.parse(date),respirators]))\n }\n\n \n const totalDeaths={\n title:'נפטרים',\n main:reduceAllTimeData(chartData.allSeriousCases.map(dayInfo=>dayInfo.deaths)),\n fromMidnight: chartData.allSeriousCases[chartData.allSeriousCases.length-1].deaths,\n allData:chartData.allSeriousCases.map(({date,deaths}) => ([Date.parse(date),deaths]))\n }\n\n\n const totalRecoverdCases={\n title:'החלימו עד כה',\n main:reduceAllTimeData(chartData.allCurveData.map(dayInfo=>dayInfo.recoverdCases)),\n fromMidnight:chartData.allCurveData[chartData.allCurveData.length-1].recoverdCases,\n allData:chartData.allCurveData.map(({date,recoverdCases}) => ([Date.parse(date),recoverdCases]))\n }\n \n const totalTestsYesterday={\n title:'כלל הבדיקות שהתבצעו אתמול',\n main:chartData.allTestsToLocatePatients[chartData.allTestsToLocatePatients.length-2].testsAmount,\n fromMidnight:chartData.allTestsToLocatePatients[chartData.allTestsToLocatePatients.length-1].testsAmount\n }\n \n const activeCases={\n title:'חולים פעילים',\n main:totalCases.main-totalRecoverdCases.main,\n fromMidnight:\n //newCases-recoverdCases-deaths\n chartData.allCurveData[chartData.allCurveData.length-1].newCases-\n chartData.allCurveData[chartData.allCurveData.length-1].recoverdCases-\n chartData.allSeriousCases[chartData.allSeriousCases.length-1].deaths,\n //where\n home:'none',\n hotel:'none',\n hospital:'none'\n }\n \n \n \n \n createInfoBox(totalTestsYesterday);\n createInfoBox(totalRecoverdCases,true);\n createInfoBox(totalDeaths,true);\n createInfoBox(respirators,true);\n createInfoBox(activeCases);\n createInfoBox(totalCases);\n}", "function makeGraphs(error, transactionsData, transactionsDataAltered) {\n var List = [];\n \n var ndx = crossfilter(transactionsDataAltered);\n \n transactionsDataAltered.forEach(function(d){\n d.Amount = parseInt(d.Amount);\n });\n show_selectors(ndx);\n MakePieChart(ndx);\n \n\n}", "function DrawTherapyDistribution(data, container) {\n $('#pharma_TherapyDistribution').empty();\n let medication = data.medication;\n // if (medication.toLowerCase() != 'all') {\n let patientDataefficacy = data.patientData.filter(function(a) {\n return (a.Medication == medication);\n });\n // console.log(analyticsPatientsData['efficacy']);\n // //\"8,12,16,24,48\"\n // var totalData = patientDataefficacy.filter(function(a) {\n // return (a.Medication == medication && a.isCured != null);\n // });\n // // console.log(totalData);\n\n // var curedData = patientDataefficacy.filter(function(a) {\n // return (a.Medication == medication && a.isCured == 1);\n // });\n\n let groupedDatatreatmentPeriod = _.groupBy(patientDataefficacy, 'treatmentPeriod');\n let groupedDataGenotype = _.groupBy(patientDataefficacy, 'genotype');\n\n let xvalues = [];\n let dataplot = [];\n\n for (let item in groupedDataGenotype) {\n let jsonObj = {};\n let itemdata = [];\n jsonObj['name'] = item;\n groupedDatatreatmentPeriod = _.groupBy(groupedDataGenotype[item], 'treatmentPeriod');\n for (let keys in groupedDatatreatmentPeriod) {\n var eff = 0;\n\n var totalData = groupedDatatreatmentPeriod[keys].filter(function(a) {\n return (a.isCured != null);\n });\n // console.log(totalData);\n\n var curedData = groupedDatatreatmentPeriod[keys].filter(function(a) {\n return (a.isCured == 1);\n });\n\n\n if (parseFloat(curedData.length) > 0 && parseFloat(totalData.length) > 0) {\n eff = (parseFloat(curedData.length) * 100) / parseFloat(totalData.length);\n }\n itemdata.push(eff);\n }\n jsonObj['data'] = itemdata;\n dataplot.push(jsonObj);\n // sum = 0;\n // if (parseFloat(groupedDataGenotype[item].length) > 0 && parseFloat(totalData.length) > 0) {\n // sum = (parseFloat(groupedDataGenotype[item].length) * 100) / parseFloat(totalData.length);\n // }\n // itemdata.push(sum);\n }\n //console.log(dataplot);\n for (let keys in groupedDatatreatmentPeriod) {\n xvalues.push(keys);\n }\n //console.log(dataplot);\n Highcharts.chart(container, {\n chart: {\n type: 'column'\n },\n title: {\n text: ' '\n },\n xAxis: {\n categories: xvalues\n },\n credits: {\n enabled: false\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Efficacy %'\n },\n stackLabels: {\n enabled: true,\n formatter: function() {\n return parseFloat(this.total).toFixed(2) + \" %\";\n },\n style: {\n fontWeight: 'bold',\n color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'\n }\n }\n },\n legend: {\n // align: 'right',\n // x: -30,\n // verticalAlign: 'top',\n // y: 25,\n // floating: true,\n // backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',\n // borderColor: '#CCC',\n // borderWidth: 1,\n // shadow: false\n show: false\n },\n tooltip: {\n formatter: function() {\n var s = '<b> Week : ' + this.x + '</b>';\n\n $.each(this.points, function(i, point) {\n s += '<br/><b> ' + point.series.name + ': </b>' + parseFloat(point.y).toFixed(2) + \" %\";\n });\n\n return s;\n },\n shared: true\n },\n plotOptions: {\n column: {\n // stacking: 'normal'\n dataLabels: {\n enabled: true,\n formatter: function() {\n return this.y.toFixed(2) + ' %';\n }\n }\n }\n },\n series: dataplot\n });\n\n // }\n}", "get Charting() {}", "function chart (data) {\n //chartJS : http://www.chartjs.org/docs/#line-chart\n var activities = getActivities(data);\n\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: getDates(data),\n //Object.keys(myDay)\n datasets: [{\n label: 'Mental',\n data: getSurvey(data, 0),\n // data: getChartData(myDay, 0),\n backgroundColor: \"rgba(51,51,51,0.4)\"\n }, {\n label: 'Physical',\n data: getSurvey(data, 1),\n backgroundColor: \"rgba(244,235,66,0.4)\"\n },\n {\n label: 'Psychological',\n data: getSurvey(data, 2),\n backgroundColor: \"rgba(66,244,69,0.4)\"\n }]\n },\n options: {\n title: {\n display: true,\n text: 'Your Daily Life Log'\n },\n tooltips: {\n callbacks: {\n // Custom Tooltip Labels with Activities for every particular day added\n label: function(tooltipItems, labelData) {\n return labelData.datasets[tooltipItems.datasetIndex].label + '\\n' + ': ' + tooltipItems.yLabel + \" (\" + activities[tooltipItems.index].join(',\\n ') + \")\";\n } \n }\n }\n }\n });\n }", "function makeTotalChart(inData, nbd) {\n\n //console.log(inData)\n\n var categs = [],\n data = [];\n\n _.each(inData, function(d) {\n categs.push(d.key);\n data.push(d.values.length);\n });\n\n $(function () {\n $('#total-graph').highcharts({\n chart: {\n type: 'column'\n },\n title: {\n text: 'Top 5 reasons for evictions in ' + nbd \n },\n subtitle: {\n text: 'Source: San Francisco Rent Board',\n x: -20\n },\n xAxis: {\n categories: categs\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Number of eviction notices',\n align: 'high'\n },\n labels: {\n overflow: 'justify'\n },\n },\n\n plotOptions: {\n column: {\n dataLabels: {\n enabled: true\n }\n }\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Evictions in ' + nbd,\n data: data\n }]\n });\n }); \n}", "function initialChart(datain,CTY,TYPE) { \r\n\r\ngenChart(datain[0],datain[1],datain[2],CTY,TYPE); //Generates the chart\r\n \r\n}", "function generateData() {\n for (var i = 0; i < numProducts; i++) {\n labels[i] = productObjectList[i].name;\n clickData[i] = productObjectList[i].clicks;\n percentData[i] = calcPercentage(productObjectList[i]);\n colorData[i] = productObjectList[i].color;\n }\n}", "function getData() {\n\n\n $.ajax({\n url: \"http://157.230.17.132:4001/sales\",\n method: \"GET\",\n success: function (data) {\n console.log(data);\n\n\n //ordino i dati per le chart\n var salesByEmployee = getSalesByEmployee(data);\n var salesByMonth = getSalesByMonth(data);\n var employeeArray = getEmployees(data);\n var quarterlySales = getQuarterlySales(salesByMonth);\n\n\n fillEmployeeOptions(employeeArray);\n\n //disegno le chart\n drawLineChart(salesByMonth);\n drawPieChart(salesByEmployee);\n drawBarChart(quarterlySales);\n },\n error: function () {\n console.log(\"error\");\n }\n })\n\n}", "function data(functionID, parseID) {\n var meal = [\n [\n \"Eggplant ragu with grilled polenta\", \"Vegetarian\", true, true, false, 624.23, 5.50, \"https://img.taste.com.au/b11rGwE6/w720-h480-cfill-q80/taste/2016/11/eggplant-ragu-with-grilled-polenta-108344-1.jpeg\", \"https://www.taste.com.au/recipes/eggplant-ragu-grilled-polenta/a912d25e-bad5-4ce7-a7c2-15b28110fcac?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Curried lentil and vegetable pie\", \"Vegetarian\", true, true, false, 612.41, 17.69, \"https://img.taste.com.au/eSNLsVfh/w720-h480-cfill-q80/taste/2016/11/curried-lentil-and-vegetable-pie-103235-1.jpeg\", \"https://www.taste.com.au/recipes/curried-lentil-vegetable-pie/36d8c9a1-556d-4f69-a9b3-2c96ac4a4415?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Turkish eggs\", \"Vegetarian\", false, false, true, 344.59, 18.86, \"https://img.taste.com.au/C4VXWgKn/w720-h480-cfill-q80/taste/2016/11/turkish-eggs-72227-1.jpeg\", \"https://www.taste.com.au/recipes/turkish-eggs/15bef257-5fe7-452a-8052-36e520ed3623?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Super-greens frittata\", \"Vegetarian\", true, true, true, 340.71, 12.30, \"https://img.taste.com.au/X-FizDrn/w720-h480-cfill-q80/taste/2016/11/super-greens-frittata-105156-1.jpeg\", \"https://www.taste.com.au/recipes/super-greens-frittata/41152a0b-44c6-40c4-8244-3dd7120f79c1?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Roasted sweet potato with caramelised garlic and spiced chickpeas\", \"Vegetarian\", true, true, true, 537.83, 8.85, \"https://img.taste.com.au/QqvXYZE2/w720-h480-cfill-q80/taste/2016/11/roasted-sweet-potato-with-caramelised-garlic-and-spiced-chickpeas-104799-1.jpeg\", \"https://www.taste.com.au/recipes/roasted-sweet-potato-caramelised-garlic-spiced-chickpeas/3a14841b-9f2d-4d8d-b40e-07daeab2b116?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Mexican chilli bean polenta pie\", \"Vegetarian\", false, true, true, 351.91, 25.62, \"https://img.taste.com.au/fiDrP01D/w720-h480-cfill-q80/taste/2016/11/mexican-chilli-bean-polenta-pie-1139-1.jpeg\", \"https://www.taste.com.au/recipes/mexican-chilli-bean-polenta-pie/380c29dd-8c2e-429e-9f0c-818d6a255ba6?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Sicilian eggplant lasagne\", \"Vegetarian\", false, true, true, 456.94, 16.92, \"https://img.taste.com.au/tZJZ2UyX/w720-h480-cfill-q80/taste/2016/11/sicilian-eggplant-lasagne-1190-1.jpeg\", \"https://www.taste.com.au/recipes/sicilian-eggplant-lasagne/9c73962c-5693-4382-a8f8-aa5d3a86cbe0?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Silver beet and cheese lasagne\", \"Vegetarian\", true, false, false, 192.43, 8.15, \"https://img.taste.com.au/8DMFyQhU/w720-h480-cfill-q80/taste/2016/11/silver-beet-and-cheese-lasagne-4345-1.jpeg\", \"https://www.taste.com.au/recipes/silver-beet-cheese-lasagne/59c3939d-aad4-4bed-8240-ae3b2714ea8b?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Chinese broccoli and mushroom stir-fry (vegetarian)\", \"Vegetarian\", false, false, true, 592.57, 7.74, \"https://img.taste.com.au/icm0t8aC/w720-h480-cfill-q80/taste/2016/11/chinese-broccoli-and-mushroom-stir-fry-vegetarian-8170-1.jpeg\", \"https://www.taste.com.au/recipes/chinese-broccoli-mushroom-stir-fry-vegetarian/8a466dd0-3f38-4230-8725-a50528a46329?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Vegetable casserole with simmered eggs (vegetarian)\", \"Vegetarian\", true, true, false, 555.34, 8.69, \"https://img.taste.com.au/_va6jpP6/w720-h480-cfill-q80/taste/2016/11/vegetable-casserole-with-simmered-eggs-vegetarian-10562-1.jpeg\", \"https://www.taste.com.au/recipes/vegetable-casserole-simmered-eggs-vegetarian/42cc0639-e3e9-44f4-8bf6-8caf1a13366f?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Minestrone salad\", \"Vegetarian\", false, true, true, 542.74, 28.26, \"https://img.taste.com.au/YWGLPNMh/w720-h480-cfill-q80/taste/2016/11/minestrone-salad-12254-1.jpeg\", \"https://www.taste.com.au/recipes/minestrone-salad/c1ddbaad-6ca3-4a4f-b1f9-eb542a54eaf5?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Vegetarian sausages & rice salad\", \"Vegan\", false, true, false, 595.15, 9.27, \"https://img.taste.com.au/vjlMNnrO/w720-h480-cfill-q80/taste/2016/11/vegetarian-sausages-rice-salad-22716-1.jpeg\", \"https://www.taste.com.au/recipes/vegetarian-sausages-rice-salad/aae22809-868b-4cea-8091-da0681cefd98?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Bruschetta pasta\", \"Vegan\", false, true, true, 107.36, 24.69, \"https://img.taste.com.au/rcRT-bXw/w720-h480-cfill-q80/taste/2016/11/bruschetta-pasta-8459-1.jpeg\", \"https://www.taste.com.au/recipes/bruschetta-pasta/1dab1a9f-ee90-43b8-90b7-cf526fc49cc3?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Barbecued tofu burgers\", \"Vegan\", true, true, false, 330.21, 29.99, \"https://img.taste.com.au/0CkhdFGk/w720-h480-cfill-q80/taste/2016/11/barbecued-tofu-burgers-13711-1.jpeg\", \"https://www.taste.com.au/recipes/barbecued-tofu-burgers/88544849-736b-4640-bd4c-36dab59ad481?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Stir-fried asparagus with tofu\", \"Vegan\", true, true, true, 311.93, 36.24, \"https://img.taste.com.au/PIaZY5t1/w720-h480-cfill-q80/taste/2016/11/stir-fried-asparagus-with-tofu-16108-1.jpeg\", \"https://www.taste.com.au/recipes/stir-fried-asparagus-tofu/a8f2bc52-da8e-4721-8f9e-06bf5883549a?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Tofu, snow pea and corn stir-fry\", \"Vegan\", false, true, false, 291.69, 35.56, \"https://img.taste.com.au/LjVTajwp/w720-h480-cfill-q80/taste/2016/11/tofu-snow-pea-and-corn-stir-fry-80385-1.jpeg\", \"https://www.taste.com.au/recipes/tofu-snow-pea-corn-stir-fry/b7fd07c9-28a4-4b97-ac10-4a112b10e5c0?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Quinoa, broad bean and sumac pumpkin tabouli\", \"Vegan\", true, true, true, 582.07, 26.45, \"https://img.taste.com.au/GXwb_OBe/w720-h480-cfill-q80/taste/2016/11/quinoa-broad-bean-and-sumac-pumpkin-tabouli-93223-1.jpeg\", \"https://www.taste.com.au/recipes/quinoa-broad-bean-sumac-pumpkin-tabouli/c4b5ab55-2055-484c-9982-06f468aaa730?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Cauliflower, potato and chickpea curry\", \"Vegan\", true, false, true, 439.88, 35.12, \"https://img.taste.com.au/jtA15WWp/w720-h480-cfill-q80/taste/2016/11/cauliflower-potato-and-chickpea-curry-75960-1.jpeg\", \"https://www.taste.com.au/recipes/cauliflower-potato-chickpea-curry/e9065048-3a32-4bb8-87f5-cbf6af5a4631?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Indian vegetable and chickpea curry\", \"Vegan\", true, true, true, 692.93, 7.90, \"https://img.taste.com.au/r8-myYhd/w720-h480-cfill-q80/taste/2016/11/indian-vegetable-and-chickpea-curry-81237-1.jpeg\", \"https://www.taste.com.au/recipes/indian-vegetable-chickpea-curry/a3aa3a62-ee80-408b-81ea-37f88042b3d1?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Marinated tofu skewers\", \"Vegan\", true, false, false, 209.52, 38.53, \"https://img.taste.com.au/88XkKwia/w720-h480-cfill-q80/taste/2016/11/marinated-tofu-skewers-14446-1.jpeg\", \"https://www.taste.com.au/recipes/marinated-tofu-skewers/8b895cc4-a824-41cf-bfec-52c373b1f321?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Angel hair pasta with watercress and carrot\", \"Vegan\", true, true, true, 281.76, 13.56, \"https://img.taste.com.au/DMYghzpG/w720-h480-cfill-q80/taste/2016/11/angel-hair-pasta-with-watercress-and-carrot-8725-1.jpeg\", \"https://www.taste.com.au/recipes/angel-hair-pasta-watercress-carrot/c8358a1c-9cf7-4054-a007-eeaf25d63732?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Spicy bean and rice pilaf\", \"Vegan\", true, true, true, 365.53, 14.63, \"https://img.taste.com.au/ey7XMLEo/w720-h480-cfill-q80/taste/2016/11/spicy-bean-and-rice-pilaf-2239-1.jpeg\", \"https://www.taste.com.au/recipes/spicy-bean-rice-pilaf/def9edf5-72ad-46c8-b7d2-13ad350afffe?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Stir-fried tofu & broccoli with soy & brown rice\", \"Vegan\", true, false, false, 200.39, 35.96, \"https://img.taste.com.au/o3bb6Kvp/w720-h480-cfill-q80/taste/2016/11/stir-fried-tofu-broccoli-with-soy-brown-rice-75676-1.jpeg\", \"https://www.taste.com.au/recipes/stir-fried-tofu-broccoli-soy-brown-rice/c18de4ae-c1fd-4b5d-8a2f-5004c8b43d50?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Raw pasta puttanesca\", \"Vegan\", true, true, false, 210.53, 10.64, \"https://img.taste.com.au/t0utO_u-/w720-h480-cfill-q80/taste/2016/11/raw-pasta-puttanesca-68390-1.jpeg\", \"https://www.taste.com.au/recipes/raw-pasta-puttanesca/e790d7a5-fa6c-420b-8f21-3a6771f8b768?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Potato and chickpea curry\", \"Vegan\", false, true, true, 192.44, 29.92, \"https://img.taste.com.au/li5XmLCv/w720-h480-cfill-q80/taste/2016/11/potato-and-chickpea-curry-1200-1.jpeg\", \"https://www.taste.com.au/recipes/potato-chickpea-curry/f566f05c-72a7-48f3-a229-bbc137d1e36e?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Tofu, asparagus & snake bean stir-fry\", \"Vegan\", true, true, true, 452.77, 10.63, \"https://img.taste.com.au/f9CtyYOq/w720-h480-cfill-q80/taste/2016/11/tofu-asparagus-snake-bean-stir-fry-7803-1.jpeg\", \"https://www.taste.com.au/recipes/tofu-asparagus-snake-bean-stir-fry/ec6eb9ae-1145-4704-b28e-627edef46f74?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Summer caponata pasta\", \"Vegan\", false, false, true, 487.51, 5.19, \"https://img.taste.com.au/oLIxilkE/w720-h480-cfill-q80/taste/2016/11/summer-caponata-pasta-7703-1.jpeg\", \"https://www.taste.com.au/recipes/summer-caponata-pasta/82e0c7f6-a719-4d25-a56b-4b800f270da6?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Red bean and pumpkin curry\", \"Vegan\", true, false, true, 349.08, 31.67, \"https://img.taste.com.au/WVrG19TV/w720-h480-cfill-q80/taste/2016/11/pasta-with-fresh-tomato-sauce-81253-1.jpeg\", \"https://www.taste.com.au/recipes/red-bean-pumpkin-curry/4fdd1626-edca-4d77-8031-2597a396d8ff?r=zone/healthymealplanner&z=Healthy%20meal%20planner\"\n ],\n [\n \"Tomato Greek salad with pan-fried fetta\", \"Mediterranean\", true, false, false, 227.62, 35.08, \"https://img.taste.com.au/9zPHpyUk/w720-h480-cfill-q80/taste/2018/12/tomato-greek-salad-with-pan-fried-fetta-145617-2.jpg\", \"https://www.taste.com.au/recipes/tomato-greek-salad-pan-fried-fetta-recipe/mhpk5epk?r=healthy/OOk6eUcx\"\n ],\n [\n \"Mediterranean mackerel and potato patties\", \"Mediterranean\", true, true, true, 117.87, 11.56, \"https://img.taste.com.au/V20fhHkr/w720-h480-cfill-q80/taste/2017/12/mediterranean-stuffed-capsicums-133570-2.jpg\", \"https://www.taste.com.au/recipes/mediterranean-stuffed-capsicums/dROZ9v7D?r=healthy/OOk6eUcx\"\n ],\n [\n \"Deconstructed Greek salad with salmon\", \"Mediterranean\", true, false, true, 576.85, 37.85, \"https://img.taste.com.au/dlN_deGk/w720-h480-cfill-q80/taste/2018/11/deconstructed-greek-salad-with-salmon-recipe-143705-2.jpg\", \"https://www.taste.com.au/recipes/deconstructed-greek-salad-salmon-recipe/c3p2942r?r=healthy/OOk6eUcx\"\n ],\n [\n \"Roasted olives\", \"Mediterranean\", true, true, true, 470.79, 6.85, \"https://img.taste.com.au/S9JjjAsA/w720-h480-cfill-q80/taste/2016/11/roasted-olives-109865-1.jpeg\", \"https://www.taste.com.au/recipes/roasted-olives/420e0f43-64c7-4904-8fcf-c226ad3e6020?r=healthy/OOk6eUcx\"\n ],\n [\n \"Mediterranean lamb shoulder roast with lemon, olives and white wine\", \"Mediterranean\", false, false, true, 148.40, 32.26, \"https://www.taste.com.au/recipes/mediterranean-lamb-shoulder-roast-lemon-olives-white-wine/4a69a1c0-5d53-48fb-af62-36eb9b5867d5\", \"https://www.taste.com.au/recipes/mediterranean-lamb-shoulder-roast-lemon-olives-white-wine/4a69a1c0-5d53-48fb-af62-36eb9b5867d5?r=healthy/OOk6eUcx\"\n ],\n [\n \"Mediterranean roasted mushrooms\", \"Mediterranean\", true, false, true, 245.46, 39.38, \"https://img.taste.com.au/4ZNRotJJ/w720-h480-cfill-q80/taste/2016/11/mediterranean-roasted-mushrooms-95028-1.jpeg\", \"https://www.taste.com.au/recipes/mediterranean-roasted-mushrooms/5e5e0280-81d1-4a6e-a603-1fef9c753a7a?r=healthy/OOk6eUcx\"\n ],\n [\n \"Mediterranean platter\", \"Mediterranean\", true, false, false, 631.05, 8.23, \"https://img.taste.com.au/-8knaJEg/w720-h480-cfill-q80/taste/2016/11/mediterranean-platter-87227-1.jpeg\", \"https://www.taste.com.au/recipes/mediterranean-platter-2/a6033fd6-8f03-4ef0-8016-96aef53f108b?r=healthy/OOk6eUcx\"\n ],\n [\n \"Sardine bruschetta with kale slaw\", \"Mediterranean\", false, true, true, 300.44, 6.30, \"https://img.taste.com.au/BEvR536v/w720-h480-cfill-q80/taste/2018/12/sardine-bruschetta-with-kale-slaw-145037-1.jpg\", \"https://www.taste.com.au/recipes/sardine-bruschetta-kale-slaw-recipe/qx8np120?r=healthy/OOk6eUcx\"\n ],\n [\n \"Chargrilled Mediterranean vegetable pasta\", \"Mediterranean\", false, false, true, 362.01, 5.28, \"https://img.taste.com.au/IZ9zkJMH/w720-h480-cfill-q80/taste/2016/11/chargrilled-mediterranean-vegetable-pasta-105954-1.jpeg\", \"https://www.taste.com.au/recipes/chargrilled-mediterranean-vegetable-pasta/aaa76773-512b-427e-a7cf-c56a5fea6079\"\n ],\n [\n \"Mediterranean roast vegetables\", \"Mediterranean\", true, true, true, 134.94, 27.43, \"https://img.taste.com.au/Mwg8hNrI/w720-h480-cfill-q80/taste/2016/11/mediterranean-roast-vegetables-79550-1.jpeg\", \"https://www.taste.com.au/recipes/mediterranean-roast-vegetables/170d56e6-e80f-458b-8c0c-72ac88d3392c\"\n ],\n [\n \"Chicken with honey, tomatoes and almonds\", \"Mediterranean\", false, false, true, 111.18, 20.27, \"https://img.taste.com.au/2rwDNDrH/w720-h480-cfill-q80/taste/2016/11/chicken-with-honey-tomatoes-and-almonds-48717-1.jpeg\", \"https://www.taste.com.au/recipes/chicken-honey-tomatoes-almonds/798dea94-c3b7-4751-8928-3e9280848566\"\n ],\n [\n \"Rosemary's Mediterranean bean and pea salad with herbed salmon\", \"Mediterranean\", false, false, true, 452.63, 12.55, \"https://img.taste.com.au/sWfNxjtS/w720-h480-cfill-q80/taste/2016/11/rosemarys-mediterranean-bean-and-pea-salad-with-herbed-salmon-74135-1.jpeg\", \"https://www.taste.com.au/recipes/rosemarys-mediterranean-bean-pea-salad-herbed-salmon/dc046320-38e2-4865-b522-2eb7d98a82b5\"\n ],\n [\n \"Roast carrot, chickpea & mint salad\", \"Mediterranean\", true, false, true, 384.47, 28.66, \"https://img.taste.com.au/FKW3rSdr/w720-h480-cfill-q80/taste/2016/11/roast-carrot-chickpea-mint-salad-48706-1.jpeg\", \"https://www.taste.com.au/recipes/roast-carrot-chickpea-mint-salad/428000ea-ec3a-4a0b-a2a1-aa1c5a611b18\"\n ],\n [\n \"Almond and pistachio dukkah couscous\", \"Mediterranean\", true, true, true, 447.55, 5.61, \"https://img.taste.com.au/i7rqHOoA/w720-h480-cfill-q80/taste/2016/11/almond-and-pistachio-dukkah-couscous-27209-1.jpeg\", \"https://www.taste.com.au/recipes/almond-pistachio-dukkah-couscous/e7a2a34c-f14e-49b2-ba75-a12b8c83564d\"\n ],\n [\n \"Mediterranean tuna salad\", \"Mediterranean\", true, true, false, 376.35, 19.18, \"https://img.taste.com.au/1jAOXAA_/w720-h480-cfill-q80/taste/2016/11/mediterranean-tuna-salad-31059-1.jpeg\", \"https://www.taste.com.au/recipes/mediterranean-tuna-salad/e3fb7eaf-79cf-45f9-8e13-9592727b92b8\"\n ],\n [\n \"One-pan chicken acqua pazza\", \"Mediterranean\", false, true, false, 252.18, 11.32, \"https://img.taste.com.au/WW_9L49L/w720-h480-cfill-q80/taste/2018/09/one-pan-chicken-acqua-pazza-141234-2.jpg\", \"https://www.taste.com.au/recipes/one-pan-chicken-acqua-pazza/57zrxmh8\"\n ],\n [\n \"Mediterranean vegetable parcels\", \"Mediterranean\", true, false, false, 492.85, 16.46, \"https://img.taste.com.au/np8pBrPJ/w720-h480-cfill-q80/taste/2016/11/mediterranean-vegetable-parcels-92797-1.jpeg\", \"https://www.taste.com.au/recipes/mediterranean-vegetable-parcels/49795437-5a7f-46f8-92f1-4859ed1fd1e0\"\n ],\n [\n \"Keto haloumi lasagne\", \"Ketogenic\", true, true, false, 168.68, 12.10, \"https://img.taste.com.au/4IaN-MLM/w720-h480-cfill-q80/taste/2020/10/keto-haloumi-lasagne-166482-2.jpg\", \"https://www.taste.com.au/recipes/keto-haloumi-lasagne/01in6s78?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto zucchini slice\", \"Ketogenic\", true, false, true, 201.50, 7.45, \"https://img.taste.com.au/1Sp-cUIH/w720-h480-cfill-q80/taste/2020/10/keto-zucchini-slice-165809-1.jpg\", \"https://www.taste.com.au/recipes/keto-zucchini-slice-recipe/ckotvlyh?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto satay chicken for two\", \"Ketogenic\", true, true, true, 674.00, 21.13, \"https://img.taste.com.au/oQDjeVY-/w720-h480-cfill-q80/taste/2020/06/keto-satay-chicken-recipe-for-two-163139-1.jpg\", \"https://www.taste.com.au/recipes/keto-satay-chicken-recipe-two/1tl2yvk8?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Tuscan-style chicken\", \"Ketogenic\", true, true, false, 350.89, 27.33, \"https://img.taste.com.au/jtq17VeF/w720-h480-cfill-q80/taste/2020/05/jun20_tuscan-style-chicken-161759-1.jpg\", \"https://www.taste.com.au/recipes/tuscan-style-chicken-recipe/6zdd63ls?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto cappuccino slice\", \"Ketogenic\", true, false, true, 632.31, 27.75, \"https://img.taste.com.au/6VqVta0e/w720-h480-cfill-q80/taste/2020/01/keto-frappuccino-slice-167070-2.jpg\", \"https://www.taste.com.au/recipes/keto-frappuccino-slice-recipe/4rh3f351?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Easy keto chicken chow mein\", \"Ketogenic\", false, false, false, 333.60, 23.50, \"https://img.taste.com.au/wo2TpsDr/w720-h480-cfill-q80/taste/2020/01/easy-keto-chicken-chow-mein-157004-2.jpg\", \"https://www.taste.com.au/recipes/easy-keto-chicken-chow-mein-recipe/rm79vhwi?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto Swedish meatballs\", \"Ketogenic\", false, true, false, 303.35, 29.41, \"https://img.taste.com.au/qYOWwSRS/w720-h480-cfill-q80/taste/2020/01/keto-swedish-meatballs-157002-2.jpg\", \"https://www.taste.com.au/recipes/keto-swedish-meatballs-recipe/x54jfqd3?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Tikka chicken and cauliflower tray bake\", \"Ketogenic\", true, true, true, 368.98, 35.50, \"https://img.taste.com.au/ZcOwB_sI/w720-h480-cfill-q80/taste/2019/06/tikka-chicken-and-cauliflower-tray-bake-150403-2.jpg\", \"https://www.taste.com.au/recipes/tikka-chicken-cauliflower-tray-bake-recipe/soo4n5u6?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto taco shells\", \"Ketogenic\", true, true, false, 554.52, 35.17, \"https://img.taste.com.au/AiLOlxE_/w720-h480-cfill-q80/taste/2019/05/keto-taco-shells-149899-1.jpg\", \"https://www.taste.com.au/recipes/keto-taco-shells-recipe/q1cnkg68?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto lemon mug cake\", \"Ketogenic\", true, true, false, 267.74, 6.94, \"https://img.taste.com.au/8CtA0zXJ/w720-h480-cfill-q80/taste/2019/02/keto-lemon-mug-cake-147527-2.jpg\", \"https://www.taste.com.au/recipes/keto-lemon-mug-cake-recipe/y9rjimcd?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto garlic bread\", \"Ketogenic\", true, true, true, 577.11, 31.32, \"https://img.taste.com.au/iGELZrr5/w720-h480-cfill-q80/taste/2019/02/keto-garlic-bread-147525-1.jpg\", \"https://www.taste.com.au/recipes/keto-garlic-bread-recipe/rzqlztj8?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto chicken parmi bowl\", \"Ketogenic\", true, true, true, 455.33, 30.20, \"https://img.taste.com.au/pSiQbaG-/w720-h480-cfill-q80/taste/2019/02/keto-chicke-parmi-bake-147529-1.jpg\", \"https://www.taste.com.au/recipes/keto-chicken-parmi-bowl-recipe/2wolshvv?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto pancakes\", \"Ketogenic\", false, false, true, 393.02, 19.87, \"https://img.taste.com.au/NQpa_G9g/w720-h480-cfill-q80/taste/2019/02/keto-pancakes-146734-1.jpg\", \"https://www.taste.com.au/recipes/keto-pancakes-recipe/ftzlzvu5?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"One-pot keto zucchini alfredo\", \"Ketogenic\", false, false, false, 505.02, 32.93, \"https://img.taste.com.au/GtvbOhD5/w720-h480-cfill-q80/taste/2019/02/one-pot-keto-zucchini-and-lemon-alfredo-146706-2.jpg\", \"https://www.taste.com.au/recipes/one-pot-keto-zucchini-lemon-alfredo-recipe/5gi89td4?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Low-carb keto-friendly pizza\", \"Ketogenic\", true, false, true, 295.79, 33.41, \"https://img.taste.com.au/RHCTblOU/w720-h480-cfill-q80/taste/2018/12/low-carb-keto-friendly-pizza-145723-2.jpg\", \"https://www.taste.com.au/recipes/low-carb-keto-friendly-pizza-recipe/cnzyga3p?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"3-cheese chicken and cauliflower lasagne\", \"Ketogenic\", false, true, false, 429.80, 9.49, \"https://img.taste.com.au/d3DQWKOC/w720-h480-cfill-q80/taste/2018/12/3-cheese-chicken-and-cauliflower-lasagne-145713-2.jpg\", \"https://www.taste.com.au/recipes/3-cheese-chicken-cauliflower-lasagne-recipe/2zl75fb4?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Keto satay chicken bowl with zoodle salad\", \"Ketogenic\", false, true, true, 186.93, 20.33, \"https://img.taste.com.au/jDgweSoU/w720-h480-cfill-q80/taste/2018/12/keto-fish-and-chips-145319-2.jpg\", \"https://www.taste.com.au/recipes/keto-satay-chicken-bowl-zoodle-salad-recipe/7z9049f0?r=recipes/ketorecipes&c=x9pyvq1v/Keto%20recipes\"\n ],\n [\n \"Power punch juice\", \"Paleo\", true, false, true, 253.01, 29.87, \"https://img.taste.com.au/zO6Z9pXr/w720-h480-cfill-q80/taste/2016/11/power-punch-juice-105272-1.jpeg\", \"https://www.taste.com.au/recipes/power-punch-juice/8bf40ee2-6300-4aad-ab81-04318e1fbbe6?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Miso and tahini dressing\", \"Paleo\", false, true, true, 693.12, 35.86, \"https://img.taste.com.au/luXm33-V/w720-h480-cfill-q80/taste/2016/11/miso-and-tahini-dressing-103405-1.jpeg\", \"https://www.taste.com.au/recipes/miso-tahini-dressing/1fb2abe2-a9fb-46e4-ba3f-98384560dcd3?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Paleo almond, pecan and coconut crumbed chicken\", \"Paleo\", true, true, false, 105.39, 32.81, \"https://img.taste.com.au/kTLR_tRX/w720-h480-cfill-q80/taste/2016/11/pecan-nuts-y-seeds-and-nuts-103289-2.jpeg\", \"https://www.taste.com.au/recipes/paleo-almond-pecan-coconut-crumbed-chicken/2937a0fa-92f0-4a30-9d20-cd79a07cf869?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Broccolini with anchovy almonds\", \"Paleo\", false, false, false, 138.69, 7.37, \"https://img.taste.com.au/CwIACKMh/w720-h480-cfill-q80/taste/2016/11/broccolini-with-anchovy-almonds-102705-1.jpeg\", \"https://www.taste.com.au/recipes/broccolini-anchovy-almonds/a2721377-179e-412e-be62-bc8eabbe5f34?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Sugar free, gluten free fruit cake\", \"Paleo\", true, false, true, 447.46, 39.02, \"https://img.taste.com.au/xbsDvsuH/w720-h480-cfill-q80/taste/2016/11/sugar-free-gluten-free-fruit-cake-103072-1.jpeg\", \"https://www.taste.com.au/recipes/sugar-free-gluten-free-fruit-cake/7b3024d1-cc08-4512-ba29-cf4cf349bfbe?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Roasted baby carrots and parsnips with honey and mustard dressing\", \"Paleo\", true, true, false, 416.43, 16.61, \"https://img.taste.com.au/WMPHwrKm/w720-h480-cfill-q80/taste/2016/11/roasted-baby-carrots-and-parsnips-with-honey-and-mustard-dressing-102699-1.jpeg\", \"https://www.taste.com.au/recipes/roasted-baby-carrots-parsnips-honey-mustard-dressing/3d3022f7-c3fb-40d5-947b-ec3878ed680b?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Paleo pumpkin pie\", \"Paleo\", false, true, true, 694.31, 16.16, \"https://img.taste.com.au/cPJAJCBh/w720-h480-cfill-q80/taste/2016/11/paleo-pumpkin-pie-102074-1.jpeg\", \"https://www.taste.com.au/recipes/paleo-pumpkin-pie/e11b7b94-0fdb-48c1-b26d-af76cbefd49d?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"No-bake rawies\", \"Paleo\", true, true, true, 374.91, 6.32, \"https://img.taste.com.au/0eZDWS7c/w720-h480-cfill-q80/taste/2016/11/no-bake-rawies-100984-1.jpeg\", \"https://www.taste.com.au/recipes/no-bake-rawies/5b2762ec-5410-426c-aefc-2e8ea450f5a1?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Peking duck and grape salad\", \"Paleo\", false, false, false, 510.42, 17.66, \"https://img.taste.com.au/osLHzh_9/w720-h480-cfill-q80/taste/2016/11/peking-duck-and-grape-salad-100852-1.jpeg\", \"https://www.taste.com.au/recipes/peking-duck-grape-salad/1f9635ab-dd40-418a-a4e9-fe08af4b3452?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Galloping horses\", \"Paleo\", true, true, true, 206.06, 15.71, \"https://img.taste.com.au/0s182fYd/w720-h480-cfill-q80/taste/2016/11/galloping-horses-100790-1.jpeg\", \"https://www.taste.com.au/recipes/galloping-horses/6c82952d-d2e3-4ea4-987a-68b85201d97b?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Justine's brick-pressed barbecued chicken\", \"Paleo\", true, true, false, 566.67, 18.15, \"https://img.taste.com.au/tmTrY49c/w720-h480-cfill-q80/taste/2016/11/justines-brick-pressed-barbecued-chicken-100758-1.jpeg\", \"https://www.taste.com.au/recipes/justines-brick-pressed-barbecued-chicken/45219a4e-127a-4165-8688-9b7e19ea91cf?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Spring lettuce with aioli\", \"Paleo\", true, false, true, 167.71, 17.47, \"https://img.taste.com.au/LwLRVfSt/w720-h480-cfill-q80/taste/2016/11/spring-lettuce-with-aioli-100756-1.jpeg\", \"https://www.taste.com.au/recipes/spring-lettuce-aioli/458f7887-c71d-41fa-b43b-f75a0fa24691?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Dairy free strawberry mousse jar cakes\", \"Paleo\", false, true, true, 215.15, 37.26, \"https://img.taste.com.au/NnDagVrK/w720-h480-cfill-q80/taste/2016/11/dairy-free-strawberry-mousse-jar-cakes-100416-1.jpeg\", \"https://www.taste.com.au/recipes/dairy-free-strawberry-mousse-jar-cakes/5fe1c893-6abe-4df3-a19a-e35a4b1e8acb?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"No-bake raw peppermint slice\", \"Paleo\", true, false, false, 265.58, 36.07, \"https://img.taste.com.au/U9l2kX_e/w720-h480-cfill-q80/taste/2016/11/no-bake-raw-peppermint-slice-100422-1.jpeg\", \"https://www.taste.com.au/recipes/no-bake-raw-peppermint-slice/1d8c6c97-cea7-41e9-9e54-9ee7e70f9c91?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Homemade mango & coconut popsicles\", \"Paleo\", true, false, true, 679.36, 35.51, \"https://img.taste.com.au/deA_C_Ns/w720-h480-cfill-q80/taste/2016/11/homemade-mango-coconut-popsicles-100426-1.jpeg\", \"https://www.taste.com.au/recipes/homemade-mango-coconut-popsicles/fa9d35ba-d1b5-479d-b38a-d58503f27c9c?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"BBQ grass-fed beef with salsa verde\", \"Paleo\", true, false, false, 611.02, 21.70, \"https://img.taste.com.au/F19E-WvT/w354-h236-cfill-q80/taste/2016/11/bbq-grass-fed-beef-with-salsa-verde-100292-1.jpeg\", \"https://www.taste.com.au/recipes/bbq-grass-fed-beef-salsa-verde/1362b677-48bb-49f0-80c1-75742a2d82cb?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"No-churn banana and cinnamon ice-cream\", \"Paleo\", false, false, true, 202.38, 32.29, \"https://img.taste.com.au/L2yuYwkv/w720-h480-cfill-q80/taste/2016/11/no-churn-banana-and-cinnamon-ice-cream-100420-1.jpeg\", \"https://www.taste.com.au/recipes/no-churn-banana-cinnamon-ice-cream/fc606589-9a07-4abd-aa0d-0b3c660caf81?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"No bake raw banoffee pie\", \"Paleo\", true, true, true, 287.12, 35.61, \"https://img.taste.com.au/gH-zCzMj/w720-h480-cfill-q80/taste/2016/11/no-bake-raw-banoffee-pie-100424-1.jpeg\", \"https://www.taste.com.au/recipes/no-bake-raw-banoffee-pie/dc1904a7-dd3e-444d-9219-c6ed30a78d13?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Chocolate and goji berry crackles\", \"Paleo\", false, true, true, 601.15, 32.27, \"https://img.taste.com.au/1GWsPg35/w720-h480-cfill-q80/taste/2016/11/chocolate-and-goji-berry-crackles-100434-1.jpeg\", \"https://www.taste.com.au/recipes/chocolate-goji-berry-crackles/8b527f1d-0a14-48bc-9a16-0a4db023f7d7?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Chilli and tahini kale chips\", \"Paleo\", false, false, true, 328.13, 18.66, \"https://img.taste.com.au/4Fkfjl2S/w720-h480-cfill-q80/taste/2016/11/chilli-and-tahini-kale-chips-100436-1.jpeg\", \"https://www.taste.com.au/recipes/chilli-tahini-kale-chips/a9d3c3d9-2fb7-4ee4-9d29-560be4c4c3bf?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Beef and mushroom meatballs with 'pappardelle'\", \"Paleo\", false, true, false, 285.00, 11.26, \"https://img.taste.com.au/capNesTV/w720-h480-cfill-q80/taste/2016/11/beef-and-mushroom-meatballs-with-pappardelle-100412-1.jpeg\", \"https://www.taste.com.au/recipes/beef-mushroom-meatballs-pappardelle/ee9b8378-aad4-4aba-9151-09d87fdbbbdb?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Asparagus quiche with kale pesto\", \"Paleo\", true, true, true, 237.48, 36.58, \"https://img.taste.com.au/ur0WdPwn/w720-h480-cfill-q80/taste/2016/11/asparagus-quiche-with-kale-pesto-100414-1.jpeg\", \"https://www.taste.com.au/recipes/asparagus-quiche-kale-pesto/3f59beb3-ea1c-4266-96d2-b29e151711ba?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Grapefruit and celery salad\", \"Paleo\", false, true, true, 387.00, 12.55, \"https://img.taste.com.au/sGaY50qG/w720-h480-cfill-q80/taste/2016/11/grapefruit-and-celery-salad-100159-1.jpeg\", \"https://www.taste.com.au/recipes/grapefruit-celery-salad/3f1e9af6-c4b1-4169-8595-e7c034990f6e?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Rack of lamb with parsley pistachio crust\", \"Paleo\", true, false, false, 637.49, 34.77, \"https://img.taste.com.au/GZgVpfYs/w720-h480-cfill-q80/taste/2016/11/rack-of-lamb-with-parsley-pistachio-crust-98349-1.jpeg\", \"https://www.taste.com.au/recipes/rack-lamb-parsley-pistachio-crust/09e39c26-d3a3-474f-a671-65c520313c9a?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Spiced pork, apricot and sweet potato tagine\", \"Paleo\", false, true, false, 290.02, 26.24, \"https://img.taste.com.au/VR29feoe/w720-h480-cfill-q80/taste/2016/11/spiced-pork-apricot-and-sweet-potato-tagine-98307-1.jpeg\", \"https://www.taste.com.au/recipes/spiced-pork-apricot-sweet-potato-tagine/bc66e0e3-4434-4676-a920-ae735ac27c79?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Roast pork with tomato and maple jam\", \"Paleo\", false, true, true, 320.34, 20.59, \"https://img.taste.com.au/okv2gysz/w720-h480-cfill-q80/taste/2016/11/roast-pork-with-tomato-and-maple-jam-97926-1.jpeg\", \"https://www.taste.com.au/recipes/roast-pork-tomato-maple-jam/5ed8d0fc-227c-411b-ad0c-65b383352e65?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ],\n [\n \"Roast pork rack with sweet potato wedges and pears\", \"Paleo\", false, false, true, 600.92, 18.96, \"https://img.taste.com.au/ZfX3Chyi/w720-h480-cfill-q80/taste/2016/11/roast-pork-rack-with-sweet-potato-wedges-and-pears-97637-1.jpeg\", \"https://www.taste.com.au/recipes/roast-pork-rack-sweet-potato-wedges-pears/be2fa0a9-0975-4acf-abbf-8721059edb94?r=recipes/paleorecipes&c=b01d3705-a10c-4d3d-b2dd-0f5a8237544d/Paleo%20recipes\"\n ]\n ];\n\n if (functionID == 1) {\n return meal.length;\n } else if (functionID == 2) {\n return meal[parseID];\n }\n\n}", "function contentLiveReport() {\n\n if (arrLiveReports.length === 0) {\n $(\"#contentLiveReportPage\").html(`<div class=\"liveReportMsg\"> You must select at least one coin to receive Live Report. </div>`);\n }\n\n else {\n\n $(\"#contentLiveReportPage\").html(` <div id=\"chartContainer\" style=\"height: 300px; width: 100%;\"></div>`);\n waitLoad(\"chartContainer\");\n let arrCoinLive1 = [];\n let arrCoinLive2 = [];\n let arrCoinLive3 = [];\n let arrCoinLive4 = [];\n let arrCoinLive5 = [];\n let arrCoinNameLive = [];\n\n function getData() {\n \n $.ajax({\n\n type: \"GET\",\n url: `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${arrLiveReports[0]},${arrLiveReports[1]},${arrLiveReports[2]},${arrLiveReports[3]},${arrLiveReports[4]}&tsyms=USD`,\n\n success: function (result) {\n\n let dateNow = new Date();\n let counter = 1;\n arrCoinNameLive = [];\n\n for (let key in result) {\n\n if (counter === 1) {\n arrCoinLive1.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 2) {\n arrCoinLive2.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 3) {\n arrCoinLive3.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 4) {\n arrCoinLive4.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n if (counter === 5) {\n arrCoinLive5.push({ x: dateNow, y: result[key].USD });\n arrCoinNameLive.push(key);\n }\n\n counter++;\n }\n\n createGraph();\n\n }\n\n })\n\n }\n \n stopIntervalId = setInterval(() => {\n getData();\n }, 2000);\n \n // function to create the graph //\n\n function createGraph() {\n\n const chart = new CanvasJS.Chart(\"chartContainer\", {\n exportEnabled: true,\n animationEnabled: false,\n\n title: {\n text: \"Favorite currencies\"\n },\n axisX: {\n valueFormatString: \"HH:mm:ss\",\n },\n axisY: {\n title: \"Coin Value\",\n suffix: \"$\",\n titleFontColor: \"#4F81BC\",\n lineColor: \"#4F81BC\",\n labelFontColor: \"#4F81BC\",\n tickColor: \"#4F81BC\",\n includeZero: true,\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n itemclick: toggleDataSeries,\n },\n data: [{\n type: \"spline\",\n name: arrCoinNameLive[0],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive1\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[1],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive2\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[2],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive3\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[3],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive4\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[4],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive5\n\n }]\n\n });\n\n chart.render();\n\n function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }\n\n }\n\n }\n\n }", "function getMarketDominanceData(createChart) {\n\n var data = [];\n var labels;\n var chartRequiredData;\n\n $.ajax({\n url: nomicsURL,\n method: \"GET\"\n }).then(function(response) {\n var totalMarketCap = 0\n //set the label names for the top 3 based on the crypto market cap\n labels = [response[0].symbol,response[1].symbol, response[2].symbol, \"Others\"];\n //iterates over the top 3000 crypto currencies and calculates Market cap\n for(i=0; i < 3000; i++){\n var marketCapLoopIndex = response[i].market_cap; \n var index = Number(marketCapLoopIndex);\n totalMarketCap += index\n }\n var firstPlacePercentage = (response[0].market_cap/totalMarketCap)*100;\n var secondPlacePercentage = (response[1].market_cap/totalMarketCap)*100;\n var thirdPlacePercentage = (response[2].market_cap/totalMarketCap)*100;\n var othersPercentage = 100 - (firstPlacePercentage + secondPlacePercentage + thirdPlacePercentage );\n data.push(firstPlacePercentage.toFixed());\n data.push(secondPlacePercentage.toFixed());\n data.push(thirdPlacePercentage.toFixed());\n data.push(othersPercentage.toFixed());\n\n chartRequiredData = {\n label: labels,\n data: data,\n };\n localStorage.setItem(\"cryptoMarketDominanceChartData\", JSON.stringify(chartRequiredData));\n // callbackFunction\n createChart(chartRequiredData);\n });\n}", "function draw(account) {\r\n let htmlText = '';\r\n let analysisArea = document.getElementById('analysis');\r\n\r\n // First, remove all previous added data, \"2\" here saves div 'donotdeletetags'\r\n while (analysisArea.childNodes.length > 2){\r\n analysisArea.removeChild(analysisArea.childNodes[analysisArea.childNodes.length -1]);\r\n }\r\n\r\n // If there are no analysis data (ie no transactions), show error message\r\n if (account.analysis.length === 0){\r\n $('#linechart').hide(); // Hide the chart\r\n htmlText = '<h4>' + 'There are no transactions to analyze' + '<br />' +\r\n 'Enter your transactions to see your budget analysis'+ '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n // exit the funcation since there is nothing more to do\r\n return;\r\n }\r\n //Show the chart div since there are transactions to show\r\n $('#linechart').show();\r\n\r\n // Go over every analysis month group\r\n account.analysis.forEach( monthStat => {\r\n tempDateObj = new Date(monthStat.yymm+'-15');\r\n // Set the month title [Month name, Year. E.g April 2019]\r\n let monthTitle = getMonthName(tempDateObj.getMonth()) +\r\n ' ' + tempDateObj.getFullYear();\r\n\r\n // Add the title to the HTML page\r\n htmlText = '<h4>' + monthTitle + '</h4>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Add the month's analysis data to the HTML page\r\n htmlText = '<p> Expense: ' + account.currency + monthStat.expense +'<br />'+\r\n 'income: ' + account.currency + monthStat.income + '<br />' +\r\n 'Month&apos;s balance: ' + account.currency +monthStat.balance + '<br />' +\r\n 'Numbrt of transactions: ' + monthStat.num + '<br />'+\r\n '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // Now we show the month's category analysis\r\n htmlText = '<h5>' + 'Expense' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no expense transactions, show error message\r\n if (Object.keys(monthStat.cat.expense).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all expense transactions to draw the bar charts\r\n Object.keys(monthStat.cat.expense).forEach(category => {\r\n drawCategroy(monthStat, 'expense', category, analysisArea);\r\n });\r\n\r\n htmlText = '<h5>' + 'Income' + '</h5>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n\r\n // If there are no income transactions, show error message\r\n if (Object.keys(monthStat.cat.income).length === 0) {\r\n htmlText = '<p>' + 'No transactions under this type' + '</p>';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n }\r\n\r\n // Go over all income transactions to draw the bar charts\r\n Object.keys(monthStat.cat.income).forEach(category => {\r\n drawCategroy(monthStat, 'income', category, analysisArea);\r\n });\r\n\r\n // Close the month's analysis data by adding a horizontal ruler\r\n htmlText = '<br /><hr />';\r\n analysisArea.insertAdjacentHTML(\"beforeend\", htmlText);\r\n });\r\n\r\n\r\n}", "function createCharts(data, chartAttr, chartType) {\n const months = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ];\n\n const chartData = data.map((item, monthNum) => {\n console.log(data);\n return {\n label: months[monthNum],\n value: item.data.search.userCount\n };\n });\n const dataSource = {\n chart: chartAttr,\n data: chartData\n };\n let chartConfig = {\n type: chartType,\n width: 800,\n height: 400,\n dataFormat: 'json',\n dataSource\n };\n\n return chartConfig;\n}", "function generateChartData() {\r\n\tvar chartData = [];\r\n\t// current date\r\n\tvar firstDate = new Date();\r\n\t// now set 500 minutes back\r\n\tfirstDate.setMinutes(firstDate.getDate() - 1000);\r\n\r\n\t// and generate 500 data items\r\n\tvar visits = 500;\r\n\tfor (var i = 0; i < 500; i++) {\r\n\t\tvar newDate = new Date(firstDate);\r\n\t\t// each time we add one minute\r\n\t\tnewDate.setMinutes(newDate.getMinutes() + i);\r\n\t\t// some random number\r\n\t\tvisits += Math.round((Math.random() < 0.5 ? 1 : -1) + Math.random() * 3);\r\n\t\t// add data item to the array\r\n\t\tchartData.push({\r\n\t\t\tdate : newDate,\r\n\t\t\tvisits : visits\r\n\t\t});\r\n\t}\r\n\treturn chartData;\r\n}", "function drawchart() {\r\n const filters = getFilters();\r\n const drawData = filterData(\r\n filters[\"startDate\"],\r\n filters[\"endDate\"],\r\n filters[\"provincesFilter\"]\r\n );\r\n timeLapseChart = new TimeLapseChart(\"timelapse-chart\");\r\n timeLapseChart\r\n .setTitle(\"COVID-19 ARGENTINA - EVOLUCIÓN EN EL TIEMPO\")\r\n .setColumnsStyles(columnNames)\r\n .addDatasets(drawData)\r\n .render();\r\n}", "init() {\n // Add label\n $sel.append('text.tk-atlas.text-menWomen')\n .text(d => `${d.key}'s`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\tbrands = container.selectAll('.fit-brand')\n .data(d => d.values)\n .enter()\n .append('div.area-front')\n .attr('class', 'fit-brand visible')\n\n display = brands.append('div.display')\n let tooltip = brands.append('div.tooltip')\n\n $svg = display.append('svg.fit-canvas')\n const text = display.append('div.text')\n text.append('text.brand.tk-atlas').text(d => d.brand)\n text.append('text.style.tk-atlas').text(d => d.updatedStyle)\n\n let toolText = tooltip.append('div.tooltip-text')\n const dollars = d3.format(\"$.2f\")\n\n toolText.append('text.tk-atlas').text(d => d.name)\n toolText.append('text.tk-atlas').text(d => `${dollars(d.price)}`)\n toolText.append('text.tk-atlas').text(d => d.fabric)\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function buildChart() {\n barChartData = {\n labels: [],\n datasets: []\n };\n var calculations = [];\n var labelSetup = [];\n for (i in currentChart.outlets) {\n calculations.push(calculateData(currentChart.outlets[i]));\n }\n var lowerBound = moment(currentChart.timePeriod[0]);\n while (lowerBound.isSameOrBefore(currentChart.timePeriod[1])) {\n labelSetup.push(lowerBound.format('YYYY-MM-DD'));\n lowerBound = lowerBound.add(1, 'days');\n }\n for (j in calculations) { //sep method\n switch (currentChart.type) {\n case 'bar':\n case 'doughnut':\n var dataList = {\n label: null,\n backgroundColor: getRandomColor(),\n borderColor: '#000000',\n data: []\n };\n break;\n case 'radar':\n case 'line':\n var dataList = {\n label: null,\n borderColor: getRandomColor(),\n data: []\n };\n break;\n default:\n console.log(\"something went wrong\");\n break;\n }\n for (k in outlets) {\n if (outlets[k].id === currentChart.outlets[j]) {\n dataList.label = outlets[k].name;\n }\n }\n for (var key in calculations[j]) {\n if (calculations[j].hasOwnProperty(key)) {\n if (barChartData.labels.indexOf(key) === -1) {\n if (typeof key !== \"undefined\") {\n barChartData.labels.push(key);\n }\n }\n dataList.data.push(calculations[j][key]);\n }\n }\n\n barChartData.datasets.push(dataList);\n }\n myChart.destroy();\n myChart = new Chart(ctx, {\n type: currentChart.type,\n data: barChartData,\n options: {\n responsive: true,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n}", "getPChartData(){\n const categoryData = [];\n this.state.categories.map((category) => {\n categoryData.push(category.category);\n return categoryData;\n })\n\n const expenseData = {\n 'Rent': 0,\n 'Mortgage': 0,\n 'Loans': 0,\n 'Utilities': 0,\n 'Restaurants': 0,\n 'Groceries': 0,\n 'Entertainment': 0,\n 'Travel': 0,\n 'Vacation': 0,\n 'Miscellaneous': 0\n };\n\n // const expenseData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\n //changed date to to months with its year so we can separate the information between years.\n this.state.expenses.map((expense) => {\n const currDate = this.state.currentYear + this.state.currentMonth;\n const dbDate = expense.expense_date.slice(0,7).split('-');\n\n //combinedDB adds month and year together creating total month and year. and if total month and year is the same as expense year and date then we push.\n const combineDb = dbDate[0] + dbDate[1] + '';\n\n if (currDate === combineDb && expense.category_id === 1) {\n expenseData.Rent += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 2) {\n expenseData.Mortgage += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 3) {\n expenseData.Loans += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 4) {\n expenseData.Utilities += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 5) {\n expenseData.Restaurants += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 6) {\n expenseData.Groceries += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 7) {\n expenseData.Entertainment += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 8) {\n expenseData.Travel += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 9) {\n expenseData.Vacation += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 10) {\n expenseData.Miscellaneous += expense.amount\n }\n return expenseData;\n })\n\n this.setState({\n pieChartData:{\n labels: categoryData,\n datasets:[\n {\n label:'Category',\n data: [\n expenseData.Rent,\n expenseData.Mortgage,\n expenseData.Loans,\n expenseData.Utilities,\n expenseData.Restaurants,\n expenseData.Grociers,\n expenseData.Entertainment,\n expenseData.Travel,\n expenseData.Vacation,\n expenseData.Miscellaneous\n ],\n backgroundColor:[\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(75, 192, 192, 0.6)',\n 'rgba(153, 102, 255, 0.6)',\n 'rgba(255, 159, 64, 0.6)',\n 'green',\n 'blue',\n 'orange',\n 'grey',\n ]\n }\n ]\n }\n });\n }", "function getState(state){\n //featch all data using for loop\n for(let i=0; i<state.length;i++){\n const sr = i+1;\n const name = state[i].state;\n const totalc = state[i].cases;\n const totala = state[i].active;\n const totalr = state[i].recovered;\n const deaths = state[i].deaths;\n const tr = document.createElement('tr');\n tr.innerHTML='<th scope=\"row\">'+sr+'</th>'+ '\\n' +'<td>'+name+'</td>'+'\\n'+'<td class=\"text-primary text-bold\">'+totalc+'</td>'+'\\n'+'<td class=\"text-warning text-bold\">'+totala+'\\n'+'</td>'+'\\n'+'<td class=\"text-success text-bold\">'+totalr+'</td>'+'\\n'+'<td class=\"text-danger text-bold\">'+deaths+'<td>';\n document.getElementById('create_state').appendChild(tr);\n\n const todayC = state[i].todayCases;\n const todayA = state[i].todayActive;\n const todayR = state[i].todayRecovered;\n const todayD = state[i].todayDeaths;\n\n const tTr = document.createElement('tr');\n tTr.innerHTML ='<th scope=\"row\">'+sr+'</th>'+ '\\n' +'<td>'+name+'</td>'+'\\n'+'<td class=\"text-primary text-bold\">'+todayC+'</td>'+'\\n'+'<td class=\"text-warning text-bold\">'+todayA+'\\n'+'</td>'+'\\n'+'<td class=\"text-success text-bold\">'+todayR+'</td>'+'\\n'+'<td class=\"text-danger text-bold\">'+todayD+'<td>';\n document.getElementById('create_todat_state').appendChild(tTr);\n }\n\n //Insert front end to chart line\n const lable=[];//decler the empty arry for lable of chart\n const data =[]; //decler the empty arry for data of Chart\n //retriw data form api \n for(let i=0; i<state.length;i++){\n const d = {x: state[i].state,cases: state[i].cases,active: state[i].active,recovered: state[i].recovered,deathss: state[i].deaths};\n data.push(d); //puch lable to lable variable\n const l = state[i].state;\n lable.push(l); // puch data to data variable\n }\n const ctx = document.getElementById('myChart2').getContext('2d');\n const mychart1 = new Chart(ctx,{\n type: 'line',\n data: {\n labels: lable,\n datasets: [{\n label: 'CASES',\n data: data,\n parsing: {\n yAxisKey: 'cases',\n },\n backgroundColor: 'blue'\n },{\n label: 'ACTIVE',\n data: data,\n parsing: {\n yAxisKey: 'active'\n },\n backgroundColor: 'yellow'\n },{\n label: 'RECOVERED',\n data: data,\n parsing: {\n yAxisKey: 'recovered'\n },\n backgroundColor: 'green'\n },{\n label: 'DEATHS',\n data: data,\n parsing: {\n yAxisKey: 'deathss'\n },\n backgroundColor: 'red'\n }]\n },\n options:{\n responsive: true,\n maintainAspectRatio: false,\n borderColor: '#ccc',\n borderWidth: 1,\n plugins: {\n title: {\n display: true,\n text: 'INDIA COVID-19 STATE WISE CASES',\n }\n }\n }\n }) \n }", "function calcAndBuildLineChart(dateAndAmountAsList) {\n\t\tlet labelsArray = [];\n\t\tlet seriesArray = [];\n\t\t\n\t\t// Replace with empty chart message\n \tif(isEmpty(dateAndAmountAsList)) {\n \t\tlet chartAppendingDiv = document.getElementById('colouredRoundedLineChart');\n \t\tlet emptyMessageDocumentFragment = document.createDocumentFragment();\n \t\temptyMessageDocumentFragment.appendChild(buildEmptyChartMessage());\n \t\t// Replace inner HTML with EMPTY\n \t\twhile (chartAppendingDiv.firstChild) {\n \t\t\tchartAppendingDiv.removeChild(chartAppendingDiv.firstChild);\n \t\t}\n \t\tchartAppendingDiv.appendChild(emptyMessageDocumentFragment);\n \t\treturn;\n \t}\n \t\n \tlet resultKeySet = Object.keys(dateAndAmountAsList);\n \t// If year selected in IYP then \n \tlet countValue = 0;\n \tif(!selectedYearIYPCache) {\n \t\t// One year of data at a time;\n \tcountValue = resultKeySet.length > 12 ? (resultKeySet.length - 12) : 0;\n \t}\n \t\n \tfor(let countGrouped = countValue, length = resultKeySet.length; countGrouped < length; countGrouped++) {\n \t\tlet dateKey = resultKeySet[countGrouped];\n \tlet userAmountAsListValue = dateAndAmountAsList[dateKey];\n\n \t// Convert the date key as date\n \tlet dateAsDate = new Date(dateKey);\n \t\n \t// If selected year is present\n \tif(selectedYearIYPCache) {\n \t\tif(selectedYearIYPCache == dateAsDate.getFullYear()) {\n \t\t\tlabelsArray.push(months[dateAsDate.getMonth()].slice(0,3) + \" '\" + dateAsDate.getFullYear().toString().slice(-2));\n \t\n \t// Build the series array with total amount for date\n \tseriesArray.push(userAmountAsListValue);\n \t\t}\n \t\t// If year is valid then skip the next lines in for loop\n \t\tcontinue;\n \t}\n \t\n \tlabelsArray.push(months[dateAsDate.getMonth()].slice(0,3) + \" '\" + dateAsDate.getFullYear().toString().slice(-2));\n \t\n \t// Build the series array with total amount for date\n \tseriesArray.push(userAmountAsListValue);\n \t\n \t}\n \t\n \t// Replace with empty chart message (selectedYearIYPCache == 'EXISTS')\n \tif(isEmpty(seriesArray)) {\n \t\tlet chartAppendingDiv = document.getElementById('colouredRoundedLineChart');\n \t\tlet emptyMessageDocumentFragment = document.createDocumentFragment();\n \t\temptyMessageDocumentFragment.appendChild(buildEmptyChartMessage());\n \t\t// Replace inner HTML with EMPTY\n \t\twhile (chartAppendingDiv.firstChild) {\n \t\t\tchartAppendingDiv.removeChild(chartAppendingDiv.firstChild);\n \t\t}\n \t\tchartAppendingDiv.appendChild(emptyMessageDocumentFragment);\n \t\treturn;\n \t} else if(seriesArray.length == 1){\n \t\tlet chartAppendingDiv = document.getElementById('colouredRoundedLineChart');\n \t\tlet emptyMessageDocumentFragment = document.createDocumentFragment();\n \t\temptyMessageDocumentFragment.appendChild(buildInsufficientInfoMessage());\n \t\t// Replace inner HTML with EMPTY\n \t\twhile (chartAppendingDiv.firstChild) {\n \t\t\tchartAppendingDiv.removeChild(chartAppendingDiv.firstChild);\n \t\t}\n \t\tchartAppendingDiv.appendChild(emptyMessageDocumentFragment);\n \t\treturn;\n \t}\n \t\n \t// Build the data for the line chart\n \tdataColouredRoundedLineChart = {\n\t\t labels: labelsArray,\n\t\t series: [\n\t\t \tseriesArray\n\t\t ]\n\t\t };\n \t\n \t// Display the line chart\n\t\tcoloredRounedLineChart(dataColouredRoundedLineChart);\n\t}", "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"It\",\n \"type\": \"column\",\n \"valueField\": \"It\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BNDAxMTZmZGItZmM2NC00M2E1LWI1NmEtZjhhODM2MGU0ZmJlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Hangover\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.5,\n \"valueField\": \"The Hangover\"\n }, {\n \"balloonText\": \"<img src='https://ia.media-imdb.com/images/M/MV5BMTk3OTM5Njg5M15BMl5BanBnXkFtZTYwMzA0ODI3._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Notebook\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.45,\n \"valueField\": \"The Notebook\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BYzE5MjY1ZDgtMTkyNC00MTMyLThhMjAtZGI5OTE1NzFlZGJjXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Deadpool\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.4,\n \"valueField\": \"Deadpool\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMGE1ZTQ0ZTEtZTEwZS00NWE0LTlmMDUtMTE1ZWJiZTYzZTQ2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Bad Boys\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.35,\n \"valueField\": \"Bad Boys\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BY2I1NWE2NzctNzNkYS00Nzg5LWEwZTQtN2I3Nzk3MTQwMDY2XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Caddyshack\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.3,\n \"valueField\": \"Caddyshack\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMzNmY2IwYzAtNDQ1NC00MmI4LThkOTgtZmVhYmExOTVhMWRkXkEyXkFqcGdeQXVyMTk5NDA3Nw@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Die Hard\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.25,\n \"valueField\": \"Die Hard\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Black Panther\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.2,\n \"valueField\": \"Black Panther\"\n }];\n }", "function setGraph(data) {\n hashStorage={};\n\n // Nest spending values by categories.\n categories = d3.nest()\n .key(function(d) { return d.category; })\n .entries(expenditure = data);\n\n // Parse dates. values should be sorted by date by now.\n // Calculating sum of costs to sort categories by.\n // Also compute the maximum price per category, needed for the y-domain.\n //All other data used for results display\n categories.forEach(function(s) {\n s.values.forEach(function(d) { d.date = parse(d.date); });\n s.uniqueCount=d3.sum(s.values, function(d) {\n return uniqueExpenseCounter( s.key, d.cost);\n });\n s.days=d3.sum(s.values, function(d) {\n if( d.cost!=0)\n return 1;\n else return 0;\n });\n s.deviation=d3.deviation(s.values, function(d) {\n if( d.cost!=0)\n return d.cost;\n else\n return null;\n });\n s.maxPrice = d3.max(s.values, function(d) { return d.cost; });\n s.sumPrice = d3.sum(s.values, function(d) { return d.cost; });\n s.avgPer3m= (s.sumPrice/Math.floor(monthsGiven/3)).toFixed(2);\n s.avgPerM= (s.sumPrice/monthsGiven).toFixed(2);\n s.avgPerD= (s.sumPrice/s.days).toFixed(2);\n s.freqPerM= Math.floor(s.days/monthsGiven);\n });\n\n // Sort by maximum price, descending. Giving us order of Keys.\n categories.sort(function(a, b) { return b.sumPrice - a.sumPrice; });\n\n svg.selectAll(\"*\").remove();//Clearing first\n\n svg.selectAll(\"g\")\n .data(categories)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"categories\");\n\n console.log(categories);\n setTimeout(lines,duration);\n}", "async function getHistoricalAll(){\n\ttry{\n\t\tlet response = await fetch(`https://corona.lmao.ninja/v2/historical/all`),\n\t \t\t data \t= await response.json();\n\t \t// converting an object to an array\n\t\t\tcasesDate = Object.entries(data.cases);\n\t\t\tdeathsDate = Object.entries(data.deaths);\n\t\t\trecoveredDate = Object.entries(data.recovered);\n\n\t\t// get historical data for the chart\n\t\tfor (var i = casesDate.length-14; i < casesDate.length; i++) {\n\t\t\txLabels.push(casesDate[i][0]);\n\t\t\tyCases.push(casesDate[i][1]);\n\t\t}\n\t\tfor (var i = deathsDate.length-14; i < deathsDate.length; i++) {\n\t\t\tyDeaths.push(deathsDate[i][1]);\n\t\t}\n\t\tfor (var i = recoveredDate.length-14; i < deathsDate.length; i++) {\n\t\t\tyRecovered.push(recoveredDate[i][1]);\n\t\t}\n\t}\n\tcatch(err){\n\t\tconsole.log(err);\n\t}\n}", "function salesHeatmap() {}", "function createPieChartData() {\n //determine the number of items\n const numItems = $('.asset-name').length;\n const chartData = [];\n const currentPercentages = calculateCurrentPercentages();\n //create chart data objects\n for(i = 0; i < numItems; i++) {\n chartData.push({name: document.getElementsByClassName('asset-name')[i].value, y: currentPercentages[i]});\n }\n return chartData;\n}", "function highchart_data_taux(sums) {\n var gueris = [], decess =[], abandons = [], weeks=[];\n $.each(sums, function (index, obj) {\n var somme_taux = obj.gueri + obj.deces + obj.abandon;\n var taux_guerison=(obj.gueri/somme_taux*100), taux_deces=(obj.deces/somme_taux*100), taux_abandon=(obj.abandon/somme_taux*100);\n gueris.push(Math.round(taux_guerison));\n decess.push(Math.round(taux_deces));\n abandons.push(Math.round(taux_abandon));\n weeks.push(index);\n });\n var donnees = [{data: gueris, name: \"Taux de guerison\"}, {data: decess,name: \"Taux de deces\"}, {data: abandons, name: \"Taux d'abandons\"}];\n return [donnees, weeks];\n}", "function displayChart(e) {\n $.get(`https://min-api.cryptocompare.com/data/pricemulti?fsyms=${toggledArr.map(coin => coin.symbol)}&tsyms=USD`, data => {\n let now = new Date();\n let dataCounter = 1;\n liveCoinName = [];\n\n for (let key in data) {\n if (dataCounter === 1) {\n liveCoin1.push({ x: now, y: data[key].USD });\n liveCoinName.push(key);\n }\n if (dataCounter == 2) {\n liveCoin2.push({ x: now, y: data[key].USD });\n liveCoinName.push(key);\n }\n\n if (dataCounter == 3) {\n liveCoin3.push({ x: now, y: data[key].USD });\n liveCoinName.push(key);\n }\n\n if (dataCounter == 4) {\n liveCoin4.push({ x: now, y: data[key].USD });\n liveCoinName.push(key);\n }\n\n if (dataCounter == 5) {\n liveCoin5.push({ x: now, y: data[key].USD });\n liveCoinName.push(key);\n }\n dataCounter++;\n }\n createGraph();\n })\n\n function createGraph() {\n\n let chart = new CanvasJS.Chart(\"chartContainer\", {\n animationEnabled: false,\n title: {\n text: \"Exchange rates in $USD\"\n },\n axisX: {\n valueFormatString: \"hh:mm:ss\",\n },\n axisY: {\n title: \"Rate\",\n suffix: \"$\",\n titleFontColor: \"black\",\n lineColor: \"black\",\n labelFontColor: \"black\",\n tickColor: \"black\",\n includeZero: true,\n },\n toolTip: {\n shared: false\n },\n legend: {\n cursor: \"pointer\",\n itemclick: toggleDataSeries,\n },\n data: [{\n type: \"spline\",\n name: liveCoinName[0],\n showInLegend: true,\n xValueFormatString: `hh:mm:ss`,\n dataPoints: liveCoin1\n\n },\n {\n type: \"spline\",\n name: liveCoinName[1],\n showInLegend: true,\n xValueFormatString: \"hh:mm:ss\",\n dataPoints: liveCoin2\n\n },\n {\n type: \"spline\",\n name: liveCoinName[2],\n showInLegend: true,\n xValueFormatString: \"hh:mm:ss\",\n dataPoints: liveCoin3\n\n },\n {\n type: \"spline\",\n name: liveCoinName[3],\n showInLegend: true,\n xValueFormatString: \"hh:mm:ss\",\n dataPoints: liveCoin4\n\n },\n {\n type: \"spline\",\n name: liveCoinName[4],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: liveCoin5\n\n }]\n });\n\n chart.render();\n\n function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }\n }\n}", "function initData(d){\n for(var i = 0; i< d.forecasts.length; i++){\n if(d.forecasts[i].endPeriod.getHours()>5 && d.forecasts[i].endPeriod.getHours()<=19 ){\n powerArray.push(parseFloat((d.forecasts[i].pv_estimate).toFixed( 2 ))*32);\n periodsArray.push((new Date(d.forecasts[i].endPeriod)).hhmm());\n }\n }\n chart1.series[0].setData(powerArray);\n chart1.xAxis[0].setCategories(periodsArray);\n chart1.series[1].setData(consumers);\n setInterval(function() {\n $(\"#chart1\").highcharts().reflow();\n }, 1);\n }", "function genData() {\n var type = ['Relief Measures'];\n var unit = [' B'];\n var cat = ['Unity', 'Resilience', 'Solidarity', 'Fortitude'];\n var amt = [6.4,48.4,5.1,33];\n var desc = [\n '<h3>Unity Budget</h3><p>Delivered on 18 February 2020</p><p>The <a href=\"https://www.mti.gov.sg/COS-2020/Stabilisation-and-Support-Package\" target=\"_blank\">Stabilisation and Support Package</a> was rolled out, including S$4 billion set aside to help workers and companies weather near-term economic uncertainties due to Covid-19. The new package will include job and cash-flow support to help firms retain and retrain workers.</p>',\n '<h3>Resilience Budget</h3><p>Delivered on 26 March 2020</p><p>A slew of measures were rolled out to support businesses, sectors most affected by Covid-19 – including aviation, tourism, food services and arts & cultural sector – and help workers stay employed. For instance, qualifying commercial properties badly affected by the virus outbreak, such as hotels and serviced apartments, will pay no property tax for 2020. Various financing schemes for companies such as the <a href=\"https://www.enterprisesg.gov.sg/financial-assistance/loans-and-insurance/loans-and-insurance/enterprise-financing-scheme/overview\" target=\"_blank\">Enterprise Financing Scheme</a> and the <a href=\"https://www.enterprisesg.gov.sg/financial-assistance/loans-and-insurance/loans-and-insurance/temporary-bridging-loan-programme/overview\" target=\"_blank\">Temporary Bridging Loan Programme</a>, will also be enhanced to ensure access to credit.</p>',\n '<h3>Solidarity Budget</h3><p>Delivered on 6 April 2020</p><p>Another S$5.1 billion was earmarked to help cushion the impact of Covid-19 on Singapore. This also marked the first time the Singapore Government has released three budgets in less than two months. Additional measures, such as enhancing the <a href=\"https://www.singaporebudget.gov.sg/docs/default-source/budget_2020/download/pdf/resilience-budget-enhanced-jobs-support-scheme.pdf\" target=\"_blank\">Job Support Scheme</a> to subsidise wages and help companies keep their employees, and increasing rental waivers, were introduced.</p>',\n '<h3>Fortitude Budget</h3><p>Delivered on 26 May 2020</p><p>The central focus of this Budget, announced as Singapore prepares to open its economy after a “circuit breaker” period of almost two months, is jobs. The Government launched a new <a href=\"https://www.wsg.gov.sg/SGUnited.html\" target=\"_blank\">SGUnited Jobs and Skills Package</a> that will create more than 40,000 jobs in the public and private sectors, 25,000 traineeships and 30,000 skills training opportunities. Support for businesses were also strengthened on three fronts: cash flow, costs and credit.</p>' \n ];\n \n var dataset = new Array();\n\n for (var i = 0; i < type.length; i++) {\n var data = new Array();\n var total = 0;\n\n for (var j = 0; j < cat.length; j++) {\n var value = amt[j];\n total += value;\n data.push({\n \"cat\": cat[j],\n \"val\": value,\n \"desc\": desc[j]\n });\n }\n\n dataset.push({\n \"type\": type[i],\n \"unit\": unit[i],\n \"data\": data,\n \"total\": total\n });\n }\n return dataset;\n }", "function drawBarsForMonth(selectedMonth) {\n fetch(\"./public/migrants2019.json\", { mode: 'cors', method: 'get', headers: { 'Access-Control-Allow-Origin': '*' }})\n .then(response => response.json())\n .then(data => {\n\n let chart = document.querySelector('#BarChart');\n chart.innerHTML = '';\n let total_us = 0;\n let total_sah = 0;\n let total_sea = 0\n let total_sasia = 0;\n let total_sam = 0;\n let total_horn = 0;\n let total_naf = 0;\n let total_me = 0;\n let total_med = 0;\n let total_eur = 0;\n let total_cen = 0;\n let total_carr = 0;\n\n\n for (let migrantInfo of data) {\n region = migrantInfo['Region of Incident'];\n dead = parseFloat(migrantInfo['Number Dead']);\n month = migrantInfo['Reported Month'];\n\n\n if (region === 'US-Mexico Border' && month === selectedMonth) {\n total_us += dead;\n // console.log(\"web id:\", migrantInfo['Web ID']);\n // console.log(\"Total US Border:\", total_us);\n // console.log(month);\n };\n if (region === 'Sub Saharan Africa' && month === selectedMonth) {\n total_sah += dead;\n };\n if (region === 'South East Asia' && month === selectedMonth) {\n total_sea += dead;\n };\n if (region === 'South Asia' && month === selectedMonth) {\n total_sasia += dead;\n };\n if (region === 'South America' && month === selectedMonth) {\n total_sam += dead;\n };\n if (region === 'North Africa' && month === selectedMonth) {\n total_naf += dead;\n };\n if (region === 'Horn of Africa' && month === selectedMonth) {\n total_horn += dead;\n };\n if (region === 'Middle East' && month === selectedMonth) {\n total_me += dead;\n };\n if (region === 'Mediterranean' && month === selectedMonth) {\n total_med += dead;\n };\n if (region === 'Europe' && month === selectedMonth) {\n total_eur += dead;\n };\n if (region === 'Central America' && month === selectedMonth) {\n total_cen += dead;\n };\n if (region === 'Caribbean' && month === selectedMonth) {\n total_carr += dead;\n };\n\n // ending bracket for loop\n };\n\n// calling drawMonthBar after for loop count is complete\n\n drawMonthBar(total_us, \"US-Mexico Border\");\n drawMonthBar(total_sah, \"Sub Saharan Africa\");\n drawMonthBar(total_sea, \"South East Asia\");\n drawMonthBar(total_sasia, \"South Asia\");\n drawMonthBar(total_sam, \"South America\");\n drawMonthBar(total_naf, \"North Africa\");\n drawMonthBar(total_horn, \"Horn of Africa\");\n drawMonthBar(total_me, \"Middle East\");\n drawMonthBar(total_med, \"Mediterranean\");\n drawMonthBar(total_eur, \"Europe\");\n drawMonthBar(total_cen, \"Central America\");\n drawMonthBar(total_carr, \"Caribbean\");\n\n\n //data => { ending bracket\n });\n // end bracket doFetch() {\n}", "function addDataToGraph(theData) {\n const theDataHistorial = theData.historial; //obtener historial del JSON de la tienda\n setGraphData({\n labels: theDataHistorial.map((aName) => aName.fecha), //labels con las fechas de actualización\n datasets: [\n {\n label: \"Quantity of the store\",\n data: theDataHistorial.map((item) => item.cantidadAnterior), //datos con la cantidad anterior en la actualizacion\n fill: false,\n backgroundColor: \"rgb(255, 255, 255)\",\n borderColor: \"#1d2d44\",\n },\n ],\n });\n }", "function genChartsData() {\n gameData.forEach((game) => {\n let date = new Date(game.videoData.uploadDate);\n let sPoint = game.stats.synergo.overall.tPoints;\n let s25 = game.stats.synergo.overall.t25;\n let rPoint = game.stats.redez.overall.tPoints;\n let r25 = game.stats.redez.overall.t25;\n let annotation = \"<a href='/\" + game.videoData.id + \"'>\" + game.videoData.title + \"</a>\"\n srPointsData.push([new Date(date), sPoint, rPoint, annotation])\n sPointsData.push([new Date(date), sPoint, annotation])\n rPointsData.push([new Date(date), rPoint, annotation])\n\n sr25Data.push([new Date(date), s25, r25, annotation]);\n s25Data.push([new Date(date), s25, annotation]);\n r25Data.push([new Date(date), r25, annotation]);\n })\n\n var chars = [\"castoro\", \"unicorno\", \"zucca\", \"gatto\", \"alieno\", \"granchio\", \"girasole\", \"drago\", \"coniglio\", \"gufo\", \"seppia\"]\n var fe = [\"numero di 5000\", \"numero di 25000\", \"numero di 50000\"]\n\n sCharData = Object.entries(stats.synergo.charStats);\n sCharData = replaceNames(sCharData, chars)\n sCharData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n rCharData = Object.entries(stats.redez.charStats);\n rCharData = replaceNames(rCharData, chars)\n rCharData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n sFEData = Object.entries(stats.synergo.FEstats);\n sFEData.pop();\n sFEData = replaceNames(sFEData, fe)\n sFEData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n\n\n rFEData = Object.entries(stats.redez.FEstats);\n rFEData.pop();\n rFEData = replaceNames(rFEData, fe)\n rFEData.unshift([\"Tipo di Festa Estrema\", \"valore\"]);\n}", "function displayGraphs(data) {\n $('#charts').html('');\n $('#all-programs tbody').html('');\n $.each(data, function(i, item) {\n if (i < numCharts) {\n $('#charts').append('<div class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\"><div id=\"graph-' + item.ProgramID + '\" class=\"chart\"><h2>' + item.Name + '</h2><a href=\"#\" onclick=\"toggleEditProgramName($(this)); return false;\" class=\"edit-icon\"></a><h3>Sales by month</h3><div id=\"chart-' + item.ProgramID + '\"></div></div><div class=\"total-monthly\">' +\n '<table><thead>' +\n '<tr><td>Total Monthly</td><td>Current</td><td>1-Year</td></tr>' +\n '</thead><tbody>' +\n '<tr><td>Sales</td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td id=\"line-' + item.ProgramID + '\" class=\"line\"></td></tr>' +\n '</tbody></table>' +\n '</div><a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></div>');\n buildChartData(item.Sales, \"chart-\" + item.ProgramID);\n buildLineData(item.Sales, \"line-\" + item.ProgramID);\n }\n else {\n var output = '<tr><td class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\">' + item.Name + '<a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td>' + item.MonthlyAttendance + ' <span class=\"unit\">vists</span></td></tr>';\n $('#all-programs table').append(output);\n }\n });\n}", "function makecharts() {\n dataprovider = [{\"time\":0,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":1,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":2,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":3,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":11,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":22,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1},{\"time\":40,\"a\":50,\"b\":23,\"c\":23,\"d\":4,\"e\":4},{\"time\":41,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":42,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":43,\"a\":53,\"b\":43,\"c\":23,\"d\":4,\"e\":1},{\"time\":51,\"a\":55,\"b\":23,\"c\":23,\"d\":4,\"e\":1},{\"time\":52,\"a\":53,\"b\":43,\"c\":53,\"d\":4,\"e\":1}];\n variablel = [{\"name\":\"a\",\"axis\":0,\"description\":\"Somethinga\"},\n {\"name\":\"b\",\"axis\":0,\"description\":\"Somethingb\"},\n {\"name\":\"c\",\"axis\":1,\"description\":\"Somethingc\"},\n {\"name\":\"d\",\"axis\":0,\"description\":\"Somethingd\"}\n ]\n makechartswithdata(dataprovider,variablel); \n}", "function getDataForJqplot() {\n var allRevenues = [];\n var allInstallations =[];\n var labels = [];\n var weeks = dataArray[0].weeks;\n var seriesLabelsAndColor = [];\n \n // generate pseudorandom color for lines and bars\n // http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript\n function getRandomColor() {\n var letters = \"0123456789ABCDEF\".split(\"\");\n var color = \"#\";\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }\n \n for (var i=1; i < dataArray.length; i++){\n allRevenues.push(dataArray[i].revenue); //revenues in one array\n allInstallations.push(dataArray[i].installations); // installations in one array\n seriesLabelsAndColor.push({label: dataArray[i].label, color: getRandomColor()}); // labels and their colors in one array of objects\n }\n \n var allData = {\n revenues: allRevenues,\n installations: allInstallations,\n weeks: weeks,\n labelsAndColor: seriesLabelsAndColor,\n numberOfSeries: dataArray.length - 1\n };\n \n return allData;\n}", "function displayDataPrep(){\n var arrDatasets=[],color = Please.make_color({colors_returned: Object.size(getY)}),i=0;\n for (var key in getY){\n console.log(key);\n dsData={label: key,\n fillColor : \"rgba(220,220,220,0)\",\n strokeColor : color[i],\n pointColor : color[i],\n pointStrokeColor : \"#fff\",\n pointHighlightFill : \"#fff\",\n pointHighlightStroke : color[i],\n data:getY[key]\n };\n arrDatasets.push(dsData);\n i++;\n }\n return {labels : xDisplay, datasets: arrDatasets};\n}", "generateChartsHTML() {\n\n\t\tlet plantingDate = new Date();\n\t\tlet harvestDate = new Date();\n\t\tlet harvestDateMin = new Date();\n\t\tlet harvestDateMax = new Date();\n\t\tlet rangeSelectorMin = new Date();\n\t\tlet rangeSelectorMax = new Date();\n\t\tlet ccChartDataArray = {}; // Associative array to store chart data\n\t\tlet biomassDates = [];\n\t\tlet biomassValues = [];\n\t\tlet cnDates = [];\n\t\tlet cnValues = [];\n\t\tlet cnMax = 60;\n\n\t\tlet cnRows = [];\n\t\tlet biomassRows = [];\n\n\t\tif (this.props.hasOwnProperty(\"userInputJson\") && this.props[\"userInputJson\"] !== null && this.props[\"userInputJson\"] !== undefined) {\n\n\t\t\tlet plantingYear = this.props[\"userInputJson\"][\"year_planting\"];\n\t\t\tlet harvestYear = plantingYear + 1;\n\t\t\tlet plantingDOY = this.props[\"userInputJson\"][\"doy_planting\"];\n\t\t\tlet harvestDOY = this.props[\"userInputJson\"][\"doy_harvest\"] - config.coverCropTerminationOffsetDays;\n\t\t\tplantingDate = new Date(plantingYear, 0, plantingDOY);\n\t\t\tharvestDate = new Date(harvestYear, 0, harvestDOY);\n\n\t\t\tharvestDateMin = new Date(harvestYear, 0, harvestDOY - (windowDurationDays/2));\n\t\t\tharvestDateMax = new Date(harvestYear, 0, harvestDOY + (windowDurationDays/2));\n\t\t\trangeSelectorMin = new Date(plantingYear, 0, plantingDOY - 1);\n\t\t\trangeSelectorMax = new Date(harvestYear, 0, harvestDOY + windowDurationDays);\n\t\t}\n\n\t\tccChartDataArray = this.state.ccDataArray;// generate charts for with cover crop case\n\t\tfor (let key in ccChartDataArray) {\n\t\t\tif(key.toString() === \"C:N ratio\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tcnRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(key.toString() === \"TWAD\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tbiomassRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet prevCnDate = null;\n\n\t\tcnRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevCnDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevCnDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevCnDate, 1);\n\t\t\t\t\tcnDates.push(newDate);\n\t\t\t\t\tcnValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevCnDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcnDates.push(dt);\n\t\t\tcnValues.push(element.y);\n\t\t\tprevCnDate = element.x;\n\t\t});\n\n\t\tcnMax = Math.max(...cnValues);\n\t\tif(cnMax < 21){\n\t\t\tcnMax = 26;\n\t\t}\n\n\t\tlet prevBiomassDate = null;\n\t\tbiomassRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevBiomassDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevBiomassDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevBiomassDate, 1);\n\t\t\t\t\tbiomassDates.push(newDate);\n\t\t\t\t\tbiomassValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevBiomassDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbiomassDates.push(dt);\n\t\t\tbiomassValues.push(element.y);\n\t\t\tprevBiomassDate = element.x;\n\t\t});\n\n\n\t\tlet resultHtml = [];\n\t\tlet selectorOptions = {\n\t\t\tx: 0.01,\n\t\t\ty: 1.15,\n\t\t\tbuttons: [\n\t\t\t// \t{\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 6,\n\t\t\t// \tlabel: \"6m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"todate\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"YTD\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1y\"\n\t\t\t// },\n\t\t\t\t{\n\t\t\t\tstep: \"all\",\n\t\t\t\tlabel: \"show all\"\n\t\t\t}],\n\n\t\t};\n\n\t\tlet biomass = {\n\t\t\tx: biomassDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: biomassValues, //[0, 15, 19, 21],\n\t\t\tname: \"Plant Biomass\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\",\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"DeepSkyBlue\"}\n\t\t};\n\n\t\tlet cn = {\n\t\t\tx: cnDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: cnValues, //[0, 3, 10, 13],\n\t\t\tname: \"C:N\",\n\t\t\tyaxis: \"y2\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\", //lines+marks\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"Orange\"}\n\t\t};\n\n\t\tlet data = [biomass, cn];\n\n\t\tlet highlightShapes = [\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDateMin,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDateMax,\n\t\t\t\ty1: 1,\n\t\t\t\tfillcolor: \"rgb(204, 255, 235)\", //\"LightYellow\",\n\t\t\t\topacity: 0.5,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 1, dash: \"dot\"}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: plantingDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: plantingDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: 20,\n\t\t\t\tfillcolor: \"rgb(240, 240, 194)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 20,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: cnMax,\n\t\t\t\tfillcolor: \"rgb(240, 220, 220)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t];\n\n\t\tlet annotations = [\n\t\t\t{\n\t\t\t\tx: plantingDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \" IN \",\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -20\n\t\t\t},\n\t\t\t{\n\t\t\t\tx: harvestDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \"OUT\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -22\n\n\t\t\t},\n\t\t\t// {\n\t\t\t// \ttext: \"Immobilization Begins<sup>*</sup>\",\n\t\t\t// \tshowarrow: true,\n\t\t\t// \tx: 0.5,\n\t\t\t// \ty: 20.25,\n\t\t\t// \tvalign: \"top\",\n\t\t\t// \txref:\"paper\",\n\t\t\t// \tyref: \"y2\",\n\t\t\t// \t// borderwidth: 1,\n\t\t\t// \t// bordercolor: \"black\",\n\t\t\t// \t// hovertext: \"Termination of CR with a C:N ratio ranging from 0-20 has the potential to result in soil N mineralization <br>\" +\n\t\t\t// \t// \t\"Termination of CR with a C:N ratio ranging >20 has the potential to result in soil N immobilization\",\n\t\t\t// }\n\t\t];\n\n\t\tlet layout = {\n\t\t\ttitle: \"Cover Crop Growth & C:N Prediction\",\n\t\t\twidth: 930,\n\t\t\theight: 600,\n\t\t\t// responsive: true,\n\t\t\txaxis: {\n\t\t\t\trangeselector: selectorOptions,\n\t\t\t\trangeslider: {borderwidth: 1},\n\t\t\t\trange: [rangeSelectorMin, rangeSelectorMax],\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tzeroline: true,\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tyaxis: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"Plant Biomass (lb/acre)\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"DeepSkyBlue\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"DeepSkyBlue\"},\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t\t// range: [0,5000],\n\t\t\t\t// rangemode: \"tozero\"\n\t\t\t},\n\t\t\tyaxis2: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"C:N\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"Orange\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"Orange\"},\n\t\t\t\toverlaying: \"y\",\n\t\t\t\tside: \"right\",\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tshapes: highlightShapes,\n\t\t\tannotations: annotations,\n\t\t\tlegend: {x:0.88, y: 1.40, borderwidth: 0.5}\n\t\t};\n\n\n\t\tresultHtml.push(\n\t\t\t\t\t<div >\n\t\t\t\t\t\t<Plot\n\t\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\t\tconfig={{\n\t\t\t\t\t\t\t\t\"displayModeBar\": false\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>);\n\n\t\treturn resultHtml;\n\t}", "function updateHouseholdChart(household_chart,settlement_name,male_household_population,female_household_population,household_number)\n{\n household_chart.data.labels = settlement_name;\n household_chart.data.datasets = [];\n household_chart.data.datasets.push({\n label:'Male population per household',\n data: male_household_population,\n backgroundColor: \"#519872\",\n borderRadius: 25\n },\n {\n label:'Female population per household',\n data: female_household_population,\n backgroundColor: \"#B1D2C2\",\n borderRadius: 25\n },\n {\n label:'Household number',\n data: household_number,\n borderRadius: 25\n });\n household_chart.update();\n}", "function fill_data() {\n\t\n\t// Set date of latest info\n\tvar date_options = { year: 'numeric', month: 'short', day: 'numeric' };\n\tvar latest = new Date(g_dates[g_dates.length - 1]).toLocaleDateString(\"en-US\", date_options);\n\tdocument.getElementById(\"date\").textContent = latest.toUpperCase();\n\t\n\t// Create the chart\n\tvar ctx = document.getElementById('chart').getContext('2d');\n\tvar chart = new Chart(ctx, {\n\t\t\n\t\t// The type of chart we want to create\n\t\ttype: 'line',\n\n\t\t// The data for the dataset\n\t\tdata: {\n\t\t\tlabels: g_dates,\n\t\t\tdatasets: [{\n\t\t\t\tlabel: 'Cases',\n\t\t\t\tbackgroundColor: 'rgb(255, 99, 132)',\n\t\t\t\tborderColor: 'rgb(255, 99, 132)',\n\t\t\t\tdata: g_cases\n\t\t\t}, {\n\t\t\t\tlabel: 'Deaths',\n\t\t\t\tbackgroundColor: 'rgb(255, 99, 132)',\n\t\t\t\tborderColor: 'rgb(255, 99, 132)',\n\t\t\t\tdata: g_deaths\n\t\t\t}]\n\t\t},\n\n\t\t// Configuration options go here\n\t\toptions: {}\n\t\n\t});\n\t\n}", "function womenManagersData() {\n \n // draw chartjs chart\n $(\"#district-rank\").remove();\n $(\"#graph-container\").append(\"<canvas id='district-rank' width=450, height=400></canvas>\");\n var ctx = $(\"#district-rank\")\n createRankChartManager();\n var minimum = 0.28,\n maximum = 0.62;\n queue()\n .defer(d3.json, \"/us.json\")\n .defer(d3.json, \"/us-congress-113.json\")\n .defer(d3.json, \"/district-manager-info.json\")\n .await(ready);\n } // end womenManagersData", "function visualization1_generate(error,data) {\n\t//\n\tif(error) { \n\t\thandle_error(error);\n\t\treturn;\n\t}\n\t//\n\t\n var svg = dimple.newSvg(\"#chartVis1\", \"100%\", 400);\n\tvar maxY = maxVis1Array(data);\n\n data = dimple.filterData(data, \"Week\", [\"Week 1\", \"Week 2\"]);\n\n // Create the indicator chart on the right of the main chart\n var indicator = new dimple.chart(svg, data);\n\n // Pick blue as the default and orange for the selected month\n var defaultColor = indicator.defaultColors[0];\n var indicatorColor = indicator.defaultColors[2];\n\n // The frame duration for the animation in milliseconds\n var frame = 5000;\n\n var firstTick = true;\n\n // Place the indicator bar chart to the right\n indicator.setBounds(434, 49, 153, 311);\n\n // Add dates along the y axis\n var y = indicator.addCategoryAxis(\"y\", \"Week\");\n y.addOrderRule(\"Week\", \"Asc\");\n\n // Use sales for bar size and hide the axis\n var x = indicator.addMeasureAxis(\"x\", \"Product Name\");\n x.hidden = true;\n\n // Add the bars to the indicator and add event handlers\n var s = indicator.addSeries(null, dimple.plot.bar);\n s.addEventHandler(\"click\", onClick);\n // Draw the side chart\n indicator.draw();\n\n // Remove the title from the y axis\n y.titleShape.remove();\n\n // Remove the lines from the y axis\n y.shapes.selectAll(\"line,path\").remove();\n\n // Move the y axis text inside the plot area\n y.shapes.selectAll(\"text\")\n .style(\"text-anchor\", \"start\")\n .style(\"font-size\", \"11px\")\n .attr(\"transform\", \"translate(18, 0.5)\");\n\n // This block simply adds the legend title. I put it into a d3 data\n // object to split it onto 2 lines. This technique works with any\n // number of lines, it isn't dimple specific.\n svg.selectAll(\"title_text\")\n .data([\"Click bar to select\",\n \"and pause. Click again\",\n \"to resume animation\"])\n .enter()\n .append(\"text\")\n .attr(\"x\", 435)\n .attr(\"y\", function (d, i) { return 15 + i * 12; })\n .style(\"font-family\", \"sans-serif\")\n .style(\"font-size\", \"10px\")\n .style(\"color\", \"Black\")\n .text(function (d) { return d; });\n\n // Manually set the bar colors\n s.shapes\n .attr(\"rx\", 10)\n .attr(\"ry\", 10)\n .style(\"fill\", function (d) { return (d.y === 1 ? indicatorColor.fill : defaultColor.fill) })\n .style(\"stroke\", function (d) { return (d.y === 1 ? indicatorColor.stroke : defaultColor.stroke) })\n .style(\"opacity\", 0.4);\n\n // Draw the main chart\n var bubbles = new dimple.chart(svg, data);\n bubbles.setBounds(60, 50, 355, 310);\n bubbles.addCategoryAxis(\"x\", \"Shop\");\n var priceAxis = bubbles.addMeasureAxis(\"y\", \"Product Price\");\n priceAxis.overrideMax = 1.1*maxY;\n var serie = bubbles.addSeries([\"Product Name\",\"Category\"], dimple.plot.bubble);\n bubbles.addLegend(60, 10, 410, 60);\n\n // Add a storyboard to the main chart and set the tick event\n var story = bubbles.setStoryboard(\"Week\", onTick);\n // Change the frame duration\n story.frameDuration = frame;\n // Order the storyboard by date\n story.addOrderRule(\"Week\");\n\n // Draw the bubble chart\n bubbles.draw();\n\n // Orphan the legends as they are consistent but by default they\n // will refresh on tick\n bubbles.legends = [];\n // Remove the storyboard label because the chart will indicate the\n // current month instead of the label\n story.storyLabel.remove();\n\n // On click of the side chart\n function onClick(e) {\n // Pause the animation\n story.pauseAnimation();\n // If it is already selected resume the animation\n // otherwise pause and move to the selected month\n if (e.yValue === story.getFrameValue()) {\n story.startAnimation();\n } else {\n story.goToFrame(e.yValue);\n story.pauseAnimation();\n }\n }\n\n // On tick of the main charts storyboard\n function onTick(e) {\n if (!firstTick) {\n // Color all shapes the same\n s.shapes\n .transition()\n .duration(frame / 2)\n .style(\"fill\", function (d) { return (d.y === e ? indicatorColor.fill : defaultColor.fill) })\n .style(\"stroke\", function (d) { return (d.y === e ? indicatorColor.stroke : defaultColor.stroke) })\n .style(\"opacity\", function (d) { return (d.yValue === 0 ? 0 : 0.8); });\n }\n firstTick = false;\n }\n}", "function initializeData() {\n\t//Records data endpoints for user\n var startDate = subset[0].date;\n outputData.startDate = startDate;\n\n var endDate = subset[subset.length-1].date;\n outputData.endDate = endDate;\n\n var startClose = subset[0].close;\n outputData.startClose = startClose;\n\n var endClose = subset[subset.length-1].close;\n outputData.endClose = endClose;\n\n var monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n \n datesText = \"Above is the performance of the S&P 500 from the week of \" + monthNames[startDate.getMonth()] + \" \" + \n startDate.getDate() + \", \" + startDate.getFullYear() + \" to the week of \" + monthNames[endDate.getMonth()] + \n \" \" + endDate.getDate() + \", \" + endDate.getFullYear() + \".\";\n\n //Adds properties to data\n subset = enhanceData(subset);\n\n //Sets global variables\n currentPrice = startClose;\n marketCurrentShares = marketCurrentValue / currentPrice;\n if (inMarketDefault) {\n \tuserCurrentShares = marketCurrentShares;\n \tlastTradeDate = startDate;\n \tlastTradeWeek = 0;\n \tlastTradePrice = startClose;\n \ttotalTrades++;\n }\n}", "function generateDoughnuts() {\n var doughnuts = document.getElementById('doughnuts');\n monthsIds.forEach((value, index) =>\n {\n var canvas = document.createElement('CANVAS');\n canvas.setAttribute('id', value);\n canvas.setAttribute('class', 'col-2 p-0');\n canvas.setAttribute('height', 200);\n doughnuts.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n// eval(value+'='+'new Chart(ctx, generateConfig(months[index], [10, 80, 10]));');\n new Chart(ctx, generateConfig(months[index], [10, 80, 10]));\n });\n}", "function generateChartData(url) {\n\n $.ajax({\n url: url,\n dataType: 'json',\n contentType: \"application/json\",\n success: function (data) {\n\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 50);\n\n var history = data.metrics_history;\n var forecast = data.forecast_result[\"0\"].metrics_forecast;\n\n // console.log(history, forecast)\n for (var i = 0; i < data.metrics_history.length; i++) {\n // we create date objects here. In your data, you can have date strings\n // and then set format of your dates using chart.dataDateFormat property,\n // however when possible, use date objects, as this will speed up chart rendering.\n var newDate = new Date(firstDate);\n newDate.setDate(newDate.getDate() + i);\n\n chartData.push({\n date: history[i].timestamp,\n history: history[i].value,\n });\n\n $('.amcharts-chart-div a').hide();\n $('svg image').hide();\n $('svg image').next('rect').hide();\n }\n\n chart.dataProvider = chartData;\n\n\t\t if (url === './data/Network_load_n.json') {\n\t\t\t cpuChart = chart;\n\t\t\t}\n\n\t\t\tif (url === './data/PC_load_n.json') {\n\t\t\t ramChart = chart;\n\t\t\t}\n\n\t\t\tif (url === './data/CPU_n.json') {\n\t\t\t pcloadChart = chart;\n\t\t\t}\n\t\t\t\n console.log(chartData);\n\n chart.validateData();\n },\n error: function (err) {\n\n }\n });\n\n var firstDate = new Date();\n firstDate.setDate(firstDate.getDate() - 50);\n\n\n }", "function allStoresHourlySales() {\n while (footerRow.firstChild) {\n footerRow.removeChild(footerRow.firstChild);\n }\n var allCookiePerHourData = ['Totals'];\n var grandTotalSales = 0;\n\n for(var k = 2; k < storeHours.length; k++) {\n var allCookiesPerHour = 0;\n for (var n = 0; n < allStores.length; n++) {\n allCookiesPerHour += allStores[n].cookieTotal[k];\n }\n allCookiePerHourData.push(allCookiesPerHour);\n grandTotalSales += allCookiesPerHour;\n\n }\n for(var m = 0; m < allCookiePerHourData.length; m++) {\n var salesTotalData = document.createElement('td');\n salesTotalData.textContent = allCookiePerHourData[m];\n footerRow.appendChild(salesTotalData);\n }\n allCookiePerHourData.push(grandTotalSales);\n var allSalesTotalData = document.createElement('td');\n allSalesTotalData.textContent = grandTotalSales;\n document.getElementById('all-stores-sales-per-hour').appendChild(allSalesTotalData);\n console.log(allSalesTotalData);\n\n //console.log(grandTotalSales);\n //console.log(allCookiePerHourData);\n}", "function drawChart() {\n for (var key in coinsData) {\n //TODO: try the chart.options.data for update\n var found = data.find(function(element) {\n return element.name == key;\n });\n\n if (!found) {\n data.push({\n type: \"line\",\n xValueType: \"dateTime\",\n lineThickness: 3,\n showInLegend: true,\n name: key,\n dataPoints: coinsData[key].dataPoints\n });\n } else {\n found.dataPoints = coinsData[key].dataPoints;\n }\n }\n\n console.log(\"DATA TO CHART\", data);\n chart.render();\n}", "function plot_village_data(data_json,total_volume,total_amount) {\n\tvar vol_data = [];\n\tvar amt_data = [];\n\tfor(var i=0 ; i<data_json.length; i++){\n\t\tvol_data.push([data_json[i]['farmer__village__village_name'], (data_json[i]['quantity__sum']*100.0)/total_volume ])\n\t}\n\tfor(var i=0 ; i<data_json.length; i++){\n\t\tamt_data.push([data_json[i]['farmer__village__village_name'], (data_json[i]['amount__sum']*100.0)/total_amount ])\n\t}\n\tplot_piechart($('#pie_vol'),vol_data,'Villages');\n\tplot_piechart($('#pie_amount'),amt_data,'Villages');\n}", "function updateSalesChart(taps) {\n //total sales counter\n let totalSales = 0;\n let salesArr = [];\n taps.forEach(tap => {\n let soldCl = tap.capacity - tap.level;\n if (tap.capacity - tap.level == tap.capacity) {\n salesArr.push(tap.capacity);\n } else {\n salesArr.push(soldCl);\n }\n });\n //function to accumulate numbers in array (sales array)\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n //use reducer to calculate total sales\n totalSales = salesArr.reduce(reducer);\n //put total sales number in p span\n document.querySelector(\"#sold p span\").textContent = totalSales;\n //equalize data in graph to sales array\n salesChart.data.datasets[0].data = salesArr;\n //update chart (with animation)\n salesChart.update();\n}", "function makeAccountDataGraphs(error, account){\n\n var parseDate = d3.time.format(\"%Y-%m-%d\").parse;\n account.forEach(function(d){\n d.PaymentDate = parseDate(d.PaymentDate);\n });\n\n account.forEach(function(d){\n d.Account = parseInt(d.Account, 10);\n });\n\n account.forEach(function(d){\n d.Sum = parseInt(d.Sum, 10);\n });\n\n var ndx=crossfilter(account);\n salary_type_selector(ndx);\n cost_per_account(ndx);\n cost_per_type(ndx);\n cost_over_time(ndx);\n dc.renderAll();\n addKrCostOverTime();\n}", "function generateChartData(stocks, list, predictIndicies, colors, predictColor){\n var data = [];\n var legendData = [];\n\n for(var i = 0; i < stocks.length; i++){\n var stockHistoricalObj = {};\n var stockPredictedlObj = {};\n var dataChopped = splitPredictedVals(stocks[i], list, predictIndicies)\n\n stockHistoricalObj.color = colors[i];\n stockHistoricalObj.name = stocks[i].Symbol;\n stockHistoricalObj.data = generateValues(dataChopped.histValues, dataChopped.histDates);\n\n stockPredictedlObj.color = predictColor;\n stockPredictedlObj.name = stocks[i].Symbol + ' Predicted';\n stockPredictedlObj.data = generateValues(dataChopped.predictValues, dataChopped.predictDates);\n\n data.push(stockHistoricalObj);\n data.push(stockPredictedlObj);\n legendData.push({\n color: colors[i],\n text: stocks[i].Symbol\n });\n }\n \n legendData.push({\n color: predictColor,\n text: 'Predicted'\n });\n\n return {\n chartData : data,\n legendData : legendData\n };\n }", "function buildhousesupplyPlot() {\n\n const url = \"/api/housing_data\";\n d3.json(url).then(function(myData) {\n console.log(myData);\n \n var date = myData[0].Date;\n \n var ratio = myData[0].House_Supply;\n \n\n var trace1 = {\n x: date,\n y: ratio,\n type: \"area\",\n color: \"purple\"\n \n }\n var data = [trace1];\n \n\n var layout = {\n title: \"Houses for Sale per One House Sold\",\n xaxis: {\n title: 'Year'\n },\n yaxis: {\n title: 'Ratio of Houses for Sale per One House Sold'\n },\n };\n\n \n\n Plotly.newPlot(\"area\", data, layout);\n })\n}", "function loadBars(city){\n\n var currentProfitBars = []\n var currentMealBars = []\n currentProfitBars.push([city.sales18, \"2018\"])\n currentProfitBars.push([city.sales19, \"2019\"])\n currentProfitBars.push([city.sales20, \"2020\"])\n\n currentMealBars.push([city.meals18, \"2018\"])\n currentMealBars.push([city.meals19, \"2019\"])\n currentMealBars.push([city.meals20, \"2020\"])\n\n titleTop.text(city.name + \" in \" + city.city + \", \" + city.state)\n\n moneyBars\n .data(currentProfitBars)\n .transition()\n .duration(600)\n .attr(\"y\", function(d) { return yScale(d[0]); })\n .attr(\"height\", function(d) { return height - yScale(d[0]); })\n .attr('fill', '#6b997a')\n .delay(function(d,i){ return(i*20)})\n\n mealBars\n .data(currentMealBars)\n .transition()\n .duration(600)\n .attr(\"y\", function(d) { return yScale2(d[0]) ;})\n .attr(\"height\", function(d) { return height - yScale2(d[0]); })\n .attr('fill', '#565985')\n .delay(function(d,i){ return(i*20)})\n\n }", "function MultiMarket(options) {\n var self = this;\n var add;\n var interval;\n\n self.charts = [];\n self.el = d3.select('#' + options.id).attr('class', 'multiMarket');\n self.apiHandler = new ApiHandler(options.url);\n self.options = options;\n\n // resize the 'add chart' button to keep the same dimensions as the charts\n function resizeButton() {\n var width = parseInt(add.style('width'), 10) - 40; // subtract chart margin\n var height = width / 2 > 150 ? width / 2 : 150;\n\n height += 88; // add height of details, dropdowns, borders\n add.style({\n height: height + 'px',\n 'line-height': height + 'px'\n });\n }\n\n if (!options.fixed) {\n add = self.el.append('div')\n .attr('class', 'add')\n .text('+')\n .on('click', function() {\n self.addChart({currency: 'XRP'}, {currency: 'XRP'});\n });\n\n resizeButton();\n addResizeListener(self.el.node(), resizeButton);\n }\n\n // new chart from list initialization or add chart button click\n this.addChart = function(base, counter) {\n return new MiniChart(base, counter, self, options.gateways);\n };\n\n // remove chart from list initialization or remove button click\n this.removeChart = function(index) {\n if (!options.fixed) {\n self.charts[index].remove(true);\n }\n };\n\n // function run whenever the list of charts changes to return\n // the complete list, if a callback is provided\n this.updateListHandler = function() {\n if (self.updateListCallback) {\n var data = [];\n for (var i = 0; i < self.charts.length; i++) {\n if (!self.charts[i].base) {\n continue;\n } else if (self.charts[i].base.currency === 'XRP' &&\n self.charts[i].counter.currency === 'XRP') {\n continue;\n }\n\n data.push({\n base: self.charts[i].base,\n counter: self.charts[i].counter\n });\n }\n self.updateListCallback(data);\n }\n };\n\n // function to return the chart on click if\n // a callback function is provided\n this.chartClickHandler = function(chart) {\n if (self.chartClickCallback) {\n self.chartClickCallback(chart);\n }\n };\n\n\n // initialize charts with a list of currency pairs,\n // or remove them all with an empty array\n this.list = function(data) {\n\n function update(charts) {\n for (var i = 0; i < self.charts.length; i++) {\n self.charts[i].suspend();\n self.charts[i].remove(false);\n }\n\n if (!charts.length && interval) {\n clearInterval(interval);\n }\n\n for (var j = 0; j < charts.length; j++) {\n self.addChart(charts[j].base, charts[j].counter);\n }\n }\n\n if (Number.isInteger(data)) {\n self.apiHandler.getTopMarkets(data, function(err, resp) {\n if (err) {\n console.log(err);\n } else {\n update(resp);\n }\n });\n\n } else {\n update(data);\n }\n };\n\n this.reload = function() {\n for (var i = 0; i < self.charts.length; i++) {\n if (self.charts[i].load) {\n self.charts[i].load();\n }\n }\n };\n\n // function for initializing callbacks\n this.on = function(type, callback) {\n if (type === 'updateList') {\n self.updateListCallback = callback;\n } else if (type === 'chartClick') {\n self.chartClickCallback = callback;\n }\n };\n}", "data() {\n let graphData = [ [/*<15min*/], [/*15-30min*/], [/*30min-1hr*/], [/*>1hr*/] ];\n\n // Group Students by Travel Time Values\n let groupedStudents = _.groupBy(Students.find().fetch(), 'traveltime');\n\n // Counter to Iterate Chart Data Array Position\n let n = 0;\n\n // Iterate Travel-Grouped Object\n for (let key in groupedStudents) {\n // Return if Grouping is not Finished\n if (key == 'undefined') return;\n\n // Group Students by G3 Values\n let groupedByGrade = _.groupBy(groupedStudents[key], \"G3\")\n\n // Iterate Grade-Grouped Students tp Determine Values for Chart Data Points\n for (let key2 in groupedByGrade) {\n // Normalize Length (# of Students) Value for Data Point Radius Visibility\n let normalizedLength = (20-4) / (34-0) * (groupedByGrade[key2].length-34) + 20;\n\n // Push Data Point Values to Chart Data Array\n // { X: Travel Time, Y: Grade Average, R: # of Students }\n graphData[n].push( { x: key, y: key2, r: Math.floor(normalizedLength) })\n }\n\n // Increment Chart Data Array Position\n n++;\n }\n\n return graphData;\n }", "function getItemStockChart() {\n var ctx = \"item-stock\";\n var maximumcount = Math.max(DcDashboardCtrl.ePage.Masters.RManifestSummary);\n var myChart = new Chart(ctx, {\n type: \"doughnut\",\n data: {\n labels: DcDashboardCtrl.ePage.Masters.Itemsender,\n datasets: [{\n label: \"Container\",\n data: DcDashboardCtrl.ePage.Masters.ItemSumCount,\n backgroundColor: DcDashboardCtrl.ePage.Masters.coloR1,\n borderColor: DcDashboardCtrl.ePage.Masters.coloR1,\n borderWidth: 1\n }],\n },\n options: {\n maintainAspectRatio: false,\n title: {\n display: false\n },\n tooltips: {\n enabled: true,\n titleFontSize: 14,\n mode: 'index'\n },\n legend: {\n display: true,\n position: 'top',\n labels: {\n fontColor: \"#333\",\n fontSize: 10,\n boxWidth: 10,\n }\n },\n legendCallback: commonLegentCallBack\n }\n });\n\n // myChart.update({\n // duration: 800,\n // easing: 'easeOutBounce'\n // })\n $(\"#item-stok\").html(myChart.generateLegend());\n }", "function damageChart() {\r\n var pokemon_type = ['bug', 'dark', 'dragon', 'electric', 'fairy', 'fighting', 'fire', 'flying', 'ghost', 'grass', 'ground', 'ice',\r\n 'normal', 'poison', 'psychic', 'rock', 'steel', 'water'];\r\n\r\n\r\n readJSON();\r\n\r\n $('.container-fluid').append($('<div/>', { id: 'chart' }));\r\n for (var i = 1; i < 19; i++) {\r\n $('#chart').append($('<div/>', { id: i, 'class': 'box' }));\r\n }\r\n\r\n fill_the_chart(pokemon_type);\r\n}", "function money_dates() {\n \n var c_scheme = ['#00897B', '#00897B'];\n \n // Select #main div, add #money and then .section .title\n d3.select('#main')\n .append('div')\n .attr('id', 'money-dates')\n .append('div')\n .attr('class', 'section title')\n .html('In-Game Money Transactions by Days of the Week');\n \n $.get('/money_dates', function(d) {\n \n var max = 0;\n \n for (var i = 0; i < d.length; i++) {\n if (max < d[i].earned_highest) max = d[i].earned_highest;\n if (max < d[i].spent_highest) max = d[i].spent_highest;\n }\n \n // set scale to highest value\n var scale = d3.scaleLinear()\n .domain([0, data_radius(max)])\n .range([0, 25]);\n \n for (var i = 0; i < d.length; i++) {\n \n // set player id\n var id = String('.p' + (i + 1));\n \n // Player Name\n d3.select('#money-dates')\n .append('div')\n .attr('class', id.replace('.', ''))\n .append('div')\n .attr('class', 'player-name')\n .html('Player ' + (i + 1));\n \n \n var div = d3.select(\"body\").append(\"div\")\t\n .attr(\"class\", \"tooltip\")\t\t\t\t\n .style(\"opacity\", 0);\n \n // ========\n // Earnings\n // ========\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Earnings');\n \n // Circles \n d3.select('#money-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].earnings)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('title', function (d) { return delimit(d) + ' Kinah' })\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'week earnings')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week earnings')\n .style('float', 'left')\n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d });\n \n // report\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has earned a total of ' + delimit(d[i].earned_total) + ' Kinah, and earns the most on ' + days[d[i].day_earned_most] + '.');\n \n // .html(\n // 'Total earnings: ' + delimit(d[i].earned_total) + ' Kinah / ' + rmt(d[i].earned_total)\n // + '<br />' +\n // 'Earns most on: ' + days[d[i].day_earned_most] + ', ' + delimit(d[i].earned_highest) + ' Kinah / ' + rmt(d[i].earned_highest) \n // + '<br />' +\n // 'Number of transactions: ' + delimit(d[i].earned_total_transactions)\n // ); \n \n // ========\n // spendings\n // ========\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Spendings');\n \n // Circles \n d3.select('#money-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].spendings)\n .enter()\n .append(\"circle\")\n .attr('title', function (d) { return delimit(d) + ' Kinah' })\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'week spendings')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week spendings')\n .style('float', 'left')\n // .style('border-left', '1px solid gray')\n // .style('border-right', '1px solid gray') \n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d }); \n\n // report\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has spent a total of ' + delimit(d[i].spent_total) + ' Kinah, and spends the most on ' + days[d[i].day_spent_most] + '.');\n\n \n } // end for loop\n\n d3.select('#money-dates')\n .append('div')\n .attr('class', 'spacer');\n\n circletips();\n });\n\n}", "function writeCals() {\n\n var testData = calories[0].meals[0].meal;\n var writeIt = `<h1>${testData}</h1>`;\n\n\n $('#target').append(daily);\n}", "function makeGraphs(error, staffData) {\n var ndx = crossfilter(staffData);\n // Changes PizzaTime from a string to an integer\n staffData.forEach(function(d) {\n d.PizzaTime = parseInt(d.PizzaTime);\n });\n // Changes YearsService from string to integer\n staffData.forEach(function(d) {\n d.YearsService = parseInt(d.YearsService);\n });\n // Calls all data functions\n show_rank_balance(ndx);\n show_average_time_by_rank(ndx);\n show_years_of_service_vs_rank(ndx);\n show_years_service_vs_pizza_time(ndx);\n show_course_balance(ndx);\n show_number_of_staff(ndx);\n show_fastest_and_slowest_pizza_maker(ndx);\n show_percentage_split_of_under_40_seconds(ndx);\n show_longest_and_shortest_serving_worker(ndx);\n\n dc.renderAll();\n\n}", "function drawChart() {\r\n drawSentimentBreakdown();\r\n drawSentimentTimeline();\r\n drawPopularityTimeline();\r\n}", "function buildCharts(Mstatus) {\r\n d3.json(`/activity_data/${Mstatus}`).then((values) => {\r\n const acitivity_IDS = values.acitivity_IDS;\r\n const activity_labels = values.activity_labels;\r\n const Mstatus_values = values.Mstatus_values;\r\n console.log(activity_labels,acitivity_IDS,Mstatus_values);\r\n\r\n // Bubble Chart\r\n var bubbleChartLayout = {\r\n title: 'Daily Activities Bubble Chart',\r\n height: 700,\r\n width: 1200,\r\n showlegend: true,\r\n hoverinfo: \"activity_labels\",\r\n \r\n };\r\n var bubbleChartData = [\r\n {\r\n x: acitivity_IDS,\r\n y: Mstatus_values,\r\n text: activity_labels,\r\n mode: \"markers\",\r\n marker: {\r\n size: Mstatus_values,\r\n color: acitivity_IDS,\r\n colorscale: \"Rainbow\"\r\n }\r\n }\r\n ];\r\n\r\n\r\n //Using plotly.plot selecting the bubble elment and passing\r\n //the bubble chart data and the bubble chart layout for that selected sample\r\n Plotly.plot(\"bubble\", bubbleChartData, bubbleChartLayout);\r\n\r\n\r\n var pieChartLayout = {\r\n title: \"Daily Activities Pie Chart\",\r\n height: 600,\r\n width: 800\r\n };\r\n var pieChartData = [\r\n {\r\n \r\n values: Mstatus_values,\r\n labels: acitivity_IDS,\r\n hoverinfo: \"activity_labels\",\r\n type: \"pie\"\r\n }\r\n ]; \r\n //Using plotly.plot selecting the pie elment and passing\r\n //the pie chart data and the pie chart layout for that selected MStatus\r\n Plotly.plot(\"pie\", pieChartData, pieChartLayout);\r\n });\r\n}", "function chartCensus4() {\n $.ajax({\n url: api_url,\n type: \"POST\",\n dataType: \"json\",\n data: { type_chart: \"transportation\", url_des: $('#url_transportation').val() },\n success: function (res) {\n if (res.length > 0) {\n var categories = [];\n var arrMeans = [];\n var arrMeansPercent = [];\n var arrFemale = [];\n var arrMale = [];\n var arrOMale = [];\n var arrOFemale = [];\n var arrData = [];\n var max_female = 0;\n var max_male = 0;\n var max = 0;\n var colors = [];\n var sum_key = 0;\n\n // get total\n for (var i = 0; i < res.length; i++) {\n var obj = res[i];\n // var cKey = obj.means_of_trans.replace(/ /g, \"\").toLowerCase();\n var cKey = obj.means_of_trans.toLowerCase();\n if (cKey.indexOf(\"public transportation\")>=0)\n cKey = \"transit\";\n categories.push(cKey);\n \n arrMeans.push(obj.number);\n \n\n sum_key += obj.number;\n\n }\n $('#set_location_popuplate').val(sum_key);\n // $('#total_population').html(Highcharts.numberFormat(sum_key, 0, '.', ','));\n \n var meansPercent = 0;\n \n for (var i = 0; i < arrMeans.length; i++) {\n if(sum_key > 0 ){\n meansPercent = precise_round((arrMeans[i] / sum_key) * 100, 1);\n arrMeansPercent.push(meansPercent);\n if( meansPercent > max)\n max = meansPercent;\n }\n else{\n arrMeansPercent.push(0);\n }\n \n }\n \n arrData = [\n {\n name: 'means',\n data: arrMeansPercent,\n data_value: arrMeans,\n color: fontTransportationCensus['means'][0]\n }\n \n ];\n \n if (sum_key > 0) {\n arrDataTransportation = arrData;\n categories_over_transportation = categories;\n max_over_transportation = max;\n para_over_transportation.series = arrDataTransportation;\n para_over_transportation.xAxis.categories = categories_over_transportation;\n para_over_transportation.yAxis.max = max_over_transportation;\n\n para_over_transportation.legend.itemStyle.fontSize = overview_Legend;\n para_over_transportation.legend.layout = layout_legend;\n para_over_transportation.legend.align = align_legend;\n para_over_transportation.legend.verticalAlign = vertical_align_legend;\n para_over_transportation.legend.y = y_legend_transportation;\n para_over_transportation.legend.x = x_legend_transportation;\n para_over_transportation.legend.itemMarginBottom = 5;\n\n para_over_transportation.chart.style.fontFamily = chart_fontFamily;\n para_over_transportation.chart.style.fontSize = chart_fontSize;\n para_over_transportation.chart.style.fontWeight = chart_fontWeight;\n para_over_transportation.chart.spacingLeft = spacing_left_transportation;\n para_over_transportation.chart.spacingBottom = spacing_bottom_transportation;\n para_over_transportation.chart.marginLeft = margin_left_transportation;\n para_over_transportation.chart.marginRight = margin_right_transportation;\n para_over_transportation.chart.marginBottom = margin_bottom_transportation;\n para_over_transportation.chart.marginTop = margin_top_transportation;\n\n para_over_transportation.xAxis.title.offset = offset_x_title_transportation;\n para_over_transportation.xAxis.title.style.fontSize = overview_axisLable;\n para_over_transportation.xAxis.labels.style.fontSize = overview_axisData;\n\n para_over_transportation.yAxis.title.offset = offset_y_title_transportation;\n para_over_transportation.yAxis.title.style.fontSize = overview_axisLable;\n para_over_transportation.yAxis.offset = -8;\n para_over_transportation.yAxis.labels.style.fontSize = overview_axisData;\n para_over_transportation.tooltip.style.fontSize = font_size_tool_tip;\n chartCensus5();\n var width = $(\".chart-list\").width();\n para_detail_transportation.series = arrDataTransportation;\n para_detail_transportation.plotOptions.series.pointWidth = point_width_transportation;\n para_detail_transportation.xAxis.categories = categories_over_transportation;\n para_detail_transportation.yAxis.max = max_over_transportation;\n para_detail_transportation.chart.width = width;\n\n para_detail_transportation.legend.itemStyle.fontSize = detail_legend;\n para_detail_transportation.legend.layout = layout_legend;\n para_detail_transportation.legend.align = align_legend;\n para_detail_transportation.legend.verticalAlign = vertical_align_legend;\n para_detail_transportation.legend.y = y_legend_detail_transportation;\n para_detail_transportation.legend.x = x_legend_detail_transportation;\n para_detail_transportation.legend.itemMarginBottom = 0;\n para_detail_transportation.legend.itemMarginTop = 10;\n para_detail_transportation.legend.symbolPadding = 6;\n\n para_detail_transportation.chart.style.fontFamily = chart_fontFamily;\n para_detail_transportation.chart.style.fontSize = chart_fontSize;\n para_detail_transportation.chart.style.fontWeight = chart_fontWeight;\n para_detail_transportation.chart.spacingLeft = spacing_left_detail_transportation;\n para_detail_transportation.chart.spacingBottom = spacing_bottom_detail_transportation;\n para_detail_transportation.chart.marginLeft = margin_left_detail_transportation;\n para_detail_transportation.chart.marginRight = margin_right_detail_transportation;\n para_detail_transportation.chart.marginBottom = margin_bottom_detail_transportation;\n para_detail_transportation.chart.marginTop = margin_top_detail_transportation;\n\n para_detail_transportation.xAxis.title.offset = offset_x_title_detail_transportation;\n para_detail_transportation.xAxis.labels.y = y_label_detail_transportation;\n para_detail_transportation.xAxis.title.margin = margin_title;\n para_detail_transportation.xAxis.title.style.fontSize = detail_axisLable;\n para_detail_transportation.xAxis.labels.style.fontSize = detail_axisData;\n para_detail_transportation.yAxis.title.offset = offset_y_title_detail_transportation;\n para_detail_transportation.yAxis.labels.style.fontSize = detail_axisData;\n para_detail_transportation.yAxis.title.style.fontSize = detail_axisLable;\n para_detail_transportation.tooltip.style.fontSize = font_size_detail_tool_tip;\n\n \n /*var chart_detail_transportation = new Highcharts.Chart(para_detail_transportation,function(objChart){});\n createMenu('detail_3')*/\n } else {\n $('#link_transportation').addClass('hide');\n $('#chart-4').highcharts({\n chart: {\n style: {\n color: color,\n }\n },\n credits: {\n enabled: false\n },\n title: {\n text: '',\n style: {\n color: color,\n }\n },\n series: [{\n type: 'pie',\n name: 'Random data',\n data: []\n }],\n lang: {\n noData: \"Data not available.\"\n },\n noData: {\n style: {\n fontWeight: 'normal',\n fontSize: '12pt',\n fontFamily: chart_fontFamily,\n color: color\n }\n },\n exporting: {\n enabled: false\n }\n }, function () {\n chartCensus5();\n });\n }\n }\n return 1;\n },\n error: function (request, status, error) {\n console.log($('#url_transportation').val());\n console.log(request.responseText);\n }\n });\n}", "function setupChart() {\n\t\tvar $ = cmg.query,\n\t\t\tdata_list = cmg.display.data[0],\n\t\t\tdata = [];\n\n\t\tif (chart_type == \"bar\") {\n\t\t\tfor (i in data_list) {\n\t\t\t\tvar obj = {\n\t\t\t\t\tcategory: data_list[i][x_axis_column],\n\t\t\t\t\tprice: cmg.display.parse_float_liberally(data_list[i][y_axis_columns])\n\t\t\t\t}\n\t\t\t\tdata.push(obj);\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var i in data_list) data.push(data_list[i]);\n\t\t}\n\n\t\t// SET UP THE SVG FOR THE CHART\n\t\tvis = d3.select(\"#dataVizChart\")\n\t\t\t.append(\"svg\")\n\t\t\t.attr({\n\t\t\t\t\"width\": width,\n\t\t\t\t\"height\": height,\n\t\t\t\t\"preserveAspectRatio\": \"xMinYMid\",\n\t\t\t\t\"viewBox\": \"0 0 \" + width + \" \" + height\n\t\t\t})\n\t\t\t.append('g')\n\t\t\t.attr({\n\t\t\t\t'transform': 'translate(0, 0)'\n\t\t\t})\n\n\t\taspect = chart_container.width() / chart_container.height();\n\n\t\t// SET UP THE LEGEND\n\t\tlegend = d3.select(\"#dataVizLegend\")\n\t\t\t.append(\"div\")\n\t\t\t.attr({\n\t\t\t\t\"class\": \"legend\",\n\t\t\t});\n\n\t\tdrawBarChart(data);\n\t}", "function createGraph() {\n\n const chart = new CanvasJS.Chart(\"chartContainer\", {\n exportEnabled: true,\n animationEnabled: false,\n\n title: {\n text: \"Favorite currencies\"\n },\n axisX: {\n valueFormatString: \"HH:mm:ss\",\n },\n axisY: {\n title: \"Coin Value\",\n suffix: \"$\",\n titleFontColor: \"#4F81BC\",\n lineColor: \"#4F81BC\",\n labelFontColor: \"#4F81BC\",\n tickColor: \"#4F81BC\",\n includeZero: true,\n },\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n itemclick: toggleDataSeries,\n },\n data: [{\n type: \"spline\",\n name: arrCoinNameLive[0],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive1\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[1],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive2\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[2],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive3\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[3],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive4\n\n },\n {\n type: \"spline\",\n name: arrCoinNameLive[4],\n showInLegend: true,\n xValueFormatString: \"HH:mm:ss\",\n dataPoints: arrCoinLive5\n\n }]\n\n });\n\n chart.render();\n\n function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }\n\n }", "function highchart_data_tendance(sums) {\n var admissions = [], sorties =[], fin_semaine = [], weeks=[];\n $.each(sums, function (index, obj) {\n var somme_admissions = obj.total_debut_semaine + obj.ptb + obj.oedemes + obj.rechute + obj.readmission + obj.transfert_interne_i\n ;\n var somme_sorties = obj.gueri + obj.deces + obj.abandon + obj.non_repondant + obj.transfert_interne_o;\n var somme_fin = somme_admissions - somme_sorties;\n admissions.push(Math.round(somme_admissions));\n sorties.push(Math.round(somme_sorties));\n fin_semaine.push(Math.round(somme_fin));\n weeks.push(index);\n });\n var donnees = [{data: admissions, name: \"Admissions\"}, {data: sorties,name: \"Sorties\"}, {data: fin_semaine, type: 'spline', name: \"Total fin de semaine\", marker: {lineWidth: 2, lineColor: Highcharts.getOptions().colors[3], fillColor: 'white'}}];\n return [donnees, weeks];\n}", "async init() {\r\n var prom = this.getTodayOpenClose(); // Creates variable to store promise object for the days open and close\r\n await prom.then((resp) => { // awaits for chart to be succesfully resolved\r\n this.chart = new Chart(document.getElementById(\"main_chart\"), { // Creates new chart and passes user data for the headers\r\n type: 'line',\r\n data: {\r\n datasets: [{\r\n label: \"Equity\",\r\n data: []\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n xAxes: [{\r\n type: 'time',\r\n time: {\r\n unit: 'hour',\r\n min: resp[0],\r\n max: resp[1]\r\n },\r\n }],\r\n yAxes: [{\r\n\r\n }],\r\n },\r\n title: {\r\n display: true,\r\n text: \"Equity\"\r\n },\r\n }\r\n });\r\n this.updateChart(); // will continue to update chart\r\n });\r\n }", "function buildStockInfo() {\n // URL to call API for the STOCK INFO\n var stockUrl =\n \"https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY&symbol=\" +\n currentSymbol +\n \"&apikey=\" +\n vantageKey;\n // API CALL for the STOCK INFO in order to build chart and display high low etc\n $.ajax({\n url: stockUrl,\n method: \"GET\",\n }).then(function (response) {\n // These don't yet exist on the page, but we can add easily\n // High and low price in the last year\n $(\"#high\").text(high);\n var testArray = [1, 6, 8, 9, 9];\n var high =\n \"$\" +\n testArray.reduce(function (a, b) {\n return Math.max(a, b);\n });\n var low =\n \"$\" +\n testArray.reduce(function (a, b) {\n return Math.min(a, b);\n });\n\n // URL to call API for the STOCK INFO\n var stockUrl =\n \"https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY&symbol=\" +\n currentSymbol +\n \"&apikey=\" +\n vantageKey;\n // API CALL for the STOCK INFO in order to build chart and display high low etc\n $.ajax({\n url: stockUrl,\n method: \"GET\",\n }).then(function (response) {\n //Assembles the data that is inserted into the chart\n for (let i = 0; i < 52; i++) {\n var priceDate = Object.keys(response[\"Weekly Time Series\"])[i];\n // console.log(response[\"Weekly Time Series\"][priceDate][\"4. close\"]);\n weeklyValue.unshift(\n response[\"Weekly Time Series\"][priceDate][\"4. close\"]\n );\n weeklyDate.unshift(priceDate);\n }\n visualData();\n\n //function the builds the chart into the page on the canvas element\n //source: chartjs.org\n function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n } //End of the stuff the builds the chart on the canvas element\n }); //END of STOCK API\n }); //end of build page function\n}", "function show_today(){\n period=1;\n draw_building_chart(period,variable);\n}", "function generateChart(container, chart_data) {\n\t\tinit();\n\t\tvar counter = 0\n\t\tvar data = chart_data.data\n\n\t\tvar chart = {}\n\t\tchart.type = chart_data.type\n\t\tchart.options = chart_data.options\n\t\tchart.data = {}\n\n\t\tvar columns = []\n\t\tvar categories = []\n\t\tdata.forEach(function(line) {\n\t\t\tcategories.push(line[0])\n\t\t\tfor(var i = 1; i < data[0].length; i++) {\n\t\t\t\tcolumns[i-1] = columns[i-1] || []\n\t\t\t\tcolumns[i-1].push(line[i])\n\t\t\t}\n\t\t})\n\t\t//console.log(categories, columns)\n\n\t\tchart.data.labels = categories\n\t\tchart.data.datasets = []\n\t\tcolumns.forEach(function(column) {\n\t\t\tchart.data.datasets.push({\n\t\t\t\tdata: column,\n\t\t\t\tbackgroundColor: colors[(counter++) % colors.length]\n\t\t\t})\n\t\t})\n\t\t//console.log(chart_data, chart)\n\n\t\tcontainer\n\t\t\t.append('canvas')\n\t\t\t.attr('class', 'chart')\n\t\t\t.html('<!-- '+JSON.stringify(chart)+' -->');\n\t}", "function setupitemReport() {\n //variable for status Completed,In progress, Failed\n \n \n\n //html += '<tr>\\r\\n';\n // for(var item in data[row]) {\n // html += '<td>' + data[row][item] + '</td>\\r\\n';\n //}\n //html += '</tr>\\r\\n';\n \n //alert('successcount ' + status[0] + ' in progress '+ status[1] +' successcount '+ status[2]);\n var ctx2 = document.getElementById(\"ItemReportStatus\").getContext('2d');\n var ItemREportStatus = new Chart(ctx2, {\n type: 'doughnut',\n data: {\n labels: [\"Completed\", \"In progress\", \"Failed\", \"Scanned\"],\n datasets: [{\n label: \"Status of Tasks\",\n backgroundColor: ['#0078d4','#71afe5' ,'#a80000','#71afe5'],\n borderColor: ['#0078d4','#71afe5' ,'#a80000', '#71afe5'],\n data: statusItemReport,\n }]\n },\n options: {}\n });\n \n \n \n\n\n}", "function showInfo( data ) {\n\t// get current date and extract year\n\tvar today = new Date(),\n\t\tcurr_year = today.getFullYear();\n\n\t// create a variable to parse year with D3\n\tvar parseYear = d3.timeParse( \"%Y\" );\n\tconsole.log( \"Spreadsheet data loaded on\", today.toJSON() );\n\n\t/****\n\t LOAD DATA INTO VARIABLES\n\t****/\n\t// load individual sheet elements into variables\n\tvar exportImportData = data.all_exports_ng_exports_net_imports.elements;\n\t/*windHydroCapData = data.wind_over_hydro_cap.elements,\n\twindHydroGenData = data.wind_over_hydro_gen.elements,*/\n\t// console.table( exportImportData );\n\n\t// create universal color scale\n\tvar lineColors = d3.scaleOrdinal()\n\t\t.range( chart_colors );\n\n\t/****\n\t DRAW CHART #1: Exports vs. NG exports vs. net imports vs. NG vs. crude oil prod\n\t****/\n\t// set oldest year to get data from\n\tvar minYr = 1997;\n\n\t// set units for Y axis values\n\tvar yUnits = \"Quadrillion Btu\",\n\t\tyUnitsAbbr = \"quads\";\n\n\t// declare arrays for separate data\n\tvar primaryExports = [], // primary energy exports data\n\t\tnetImports = [], // primary energy net imports data\n\t\tngProd = [], // NG (dry) production data\n\t\tcrudeProd = [], // crude oil production data\n\t\tallExpImpProd = []; // combined data\n\n\t/* CONTAINER DIV + CHART DIMENSIONS*/\n\t// get chart container width\n\tvar contWidth = chart_container.width();\n\n\t// set default container width as fallback\n\tif ( contWidth == undefined || isNaN( contWidth ) ) {\n\t\tcontWidth = 600;\n\t}\n\n\tvar iepWidth = contWidth - chart_margins.left - chart_margins.right;\n\n\t// adjust chart width based on device width\n\tif ( contWidth < mobile_threshold ) {\n\t\tiepWidth = iepWidth * 0.70;\n\t} else if ( contWidth < tablet_threshold ) {\n\t\tiepWidth = iepWidth * 0.75;\n\t} else if ( contWidth < large_threshold ) {\n\t\tiepWidth = iepWidth * 0.85;\n\t}\n\n\t// calculate heights in proportion to the width\n\tvar contHeight = Math.ceil( ( contWidth * graphic_aspect_height ) / graphic_aspect_width ),\n\t\tiepHeight = Math.ceil( ( iepWidth * graphic_aspect_height ) / graphic_aspect_width );\n\n\t// reset container height\n\tchart_container.height( contHeight );\n\n\t/* ACCESS DATA AND POPULATE VARIABLES */\n\t// loop through each row of data\n\texportImportData.forEach( function ( d, i ) {\n\t\t// parse date to year\n\t\tvar wDate = new Date( d.year );\n\t\td.year = wDate.getUTCFullYear();\n\n\t\tif ( d.year >= minYr ) {\n\t\t\tprimaryExports[ i ] = d[ \"Total Energy Exports\" ];\n\t\t\tnetImports[ i ] = d[ \"Net Energy Imports\" ];\n\t\t\tngProd[ i ] = d[ \"Total Energy Net Imports\" ];\n\t\t\tcrudeProd[ i ] = d[ \"Net Energy Imports\" ];\n\t\t}\n\t} );\n\n\t// filter out data starting at minYr\n\texportImportData = exportImportData.filter( e => e.year >= minYr );\n\n\t// concatenate all data into one array\n\tallExpImpProd = primaryExports.concat( netImports ).concat( ngProd ).concat( crudeProd );\n\tallMinMax = d3.extent( allExpImpProd );\n\n\t// assign chart colors to data\n\tlineColors.domain( d3.keys( exportImportData[ 0 ] ).filter( function ( key ) {\n\t\t// filter through the keys excluding certain columns, e.g. x-axis data\n\t\treturn key !== \"year\" && key !== \"Natural Gas Exports\";\n\t} ) );\n\n\t/* NUMBER OF TICKS */\n\t// set number of ticks on x-axis based on data\n\tvar num_x_ticks = exportImportData.length; // include one tick for each year\n\n\t// set constant number of ticks for smaller devices\n\tif ( contWidth < mobile_threshold ) {\n\t\tnum_x_ticks = 5;\n\t} else if ( contWidth < tablet_threshold ) {\n\t\tnum_x_ticks = 7;\n\t}\n\n\t// clear out existing chart (important for redraw)\n\tchart_container.empty();\n\n\t// select container div by ID + create SVG and main g elements within\n\tvar impExpProd = d3.select( \"#export-import-prod\" ),\n\t\t// create SVG viewport\n\t\tg = impExpProd.append( \"svg:svg\" )\n\t\t.attr( \"id\", \"import-export-prod-chart\" )\n\t\t.attr( \"width\", iepWidth )\n\t\t.attr( \"height\", iepHeight );\n\n\t// append definitions\n\tg.append( \"defs\" )\n\t\t.append( \"clipPath\" )\n\t\t.attr( \"id\", \"lines-clip\" )\n\t\t.append( \"rect\" )\n\t\t.attr( \"width\", iepWidth + chart_margins.left )\n\t\t.attr( \"height\", iepHeight + ( chart_margins.bottom * 4 ) )\n\t\t.attr( \"x\", -chart_margins.left / 2 )\n\t\t.attr( \"y\", -chart_margins.top / 2 );\n\n\t// append g element container for intro text\n\tvar chartIntro = g.append( \"svg:g\" )\n\t\t.attr( \"class\", \"chart-intro\" );\n\n\t// append chart title to intro group\n\tchartIntro.append( \"svg:text\" )\n\t\t.attr( \"y\", chart_margins.top / 2 )\n\t\t.attr( \"class\", \"titles_chart-main\" )\n\t\t.text( chart_title );\n\n\t// append chart summary to intro group\n\tchartIntro.append( \"svg:text\" )\n\t\t.attr( \"class\", \"titles_chart-summary\" )\n\t\t.text( chart_intro )\n\t\t.call( wrap, iepWidth, 4, 1.5 );\n\n\t// append main g element container for the chart\n\tvar chart = g.append( \"svg:g\" )\n\t\t.attr( \"transform\", \"translate(\" + chart_margins.left + \",\" + ( chart_margins.top * 2 ) + \")\" )\n\t\t.attr( \"class\", \"chart-wrapper\" );\n\n\t// X axis: scale + axis function variables\n\tvar iepX = d3.scaleTime()\n\t\t.domain( d3.extent( exportImportData, function ( d ) {\n\t\t\treturn parseYear( d.year );\n\t\t} ) )\n\t\t.range( [ -chart_margins.left / 2, iepWidth + ( chart_margins.right / 2 ) ] );\n\n\txAxis = d3.axisBottom( iepX )\n\t\t.ticks( num_x_ticks );\n\n\t// Y axis: scale + axis function variables\n\tvar iepY = d3.scaleLinear()\n\t\t.domain( [ 0, allMinMax[ 1 ] ] )\n\t\t.range( [ iepHeight, 0 ] ),\n\t\tyAxis = d3.axisRight( iepY )\n\t\t.ticks( 5 ) // specify the scale of the axis\n\t\t.tickSizeInner( iepWidth + chart_margins.left ) // scale ticks across chart width\n\t\t.tickPadding( 6 )\n\t\t.tickFormat( function ( d ) {\n\t\t\treturn ( d );\n\t\t} );\n\n\t// create custom function for Y axis\n\tfunction customYAxis( g ) {\n\t\t// move axis to align properly with the bottom left corner including tick values\n\t\tchart.attr( \"transform\", \"translate(\" + ( -chart_margins.left / 2 ) + \", 0)\" )\n\t\tchart.call( yAxis );\n\t\tchart.select( \".domain\" );\n\t\tchart.attr( \"text-anchor\", \"end\" );\n\t\tchart.selectAll( \".tick:not(:first-of-type) line\" ).attr( \"stroke\", \"#777\" ).attr( \"stroke-dasharray\", \"2,2\" );\n\t\tchart.selectAll( \".tick text\" ).attr( \"x\", -4 ).attr( \"dy\", 0 );\n\t} // appends y-axis to chart group\n\n\t// formula to create lines\n\tvar line = d3.line()\n\t\t.x( function ( d ) {\n\t\t\treturn iepX( parseYear( d.year ) );\n\t\t} )\n\t\t.y( function ( d ) {\n\t\t\treturn iepY( d.btu );\n\t\t} );\n\n\t// map data to individual lines\n\tvar sourceLines = lineColors.domain().map( function ( source ) {\n\t\treturn {\n\t\t\tsource: source,\n\t\t\tvalues: exportImportData.map( function ( s ) {\n\t\t\t\treturn {\n\t\t\t\t\tyear: s.year,\n\t\t\t\t\tbtu: +s[ source ]\n\t\t\t\t};\n\t\t\t} )\n\t\t}\n\t} );\n\n\tvar allSources = [],\n\t\tsourceById = [];\n\t// loop through source data to parse sources and IDs (keys) for each source\n\tsourceLines.forEach( function ( d, i ) {\n\t\tallSources[ i ] = d.source;\n\t\tsourceById[ d.source ] = i;\n\t} );\n\n\t/* append SVG elements */\n\t// append X axis element: calls xAxis function\n\tchart.append( \"g\" )\n\t\t.attr( \"id\", \"iep-x-axis\" )\n\t\t.attr( \"transform\", \"translate(0, \" + iepHeight + \")\" )\n\t\t.call( xAxis )\n\t\t.select( \".domain\" ).remove();\n\n\t// append Y axis element: calls yAxis function\n\tchart.append( \"g\" )\n\t\t.attr( \"id\", \"iep-y-axis\" )\n\t\t.call( customYAxis )\n\t\t.append( \"text\" ) // add axis label\n\t\t.attr( \"transform\", \"rotate(-90)\" ) // rotate level 90º counterclockwise\n\t\t.attr( \"x\", -( iepHeight / 2 ) ) // center label vertically\n\t\t.attr( \"y\", -35 )\n\t\t.attr( \"dy\", \".71em\" )\n\t\t.attr( \"class\", \"titles_axis-y\" )\n\t\t.text( yUnits );\n\n\t// add containers for lines and markers\n\tchart.append( \"g\" )\n\t\t.attr( \"id\", \"lines\" )\n\t\t.attr( \"clip-path\", \"url(#lines-clip)\" );\n\n\t// draw/append all data lines\n\tvar sourceLine = chart.select( \"#lines\" )\n\t\t.selectAll( \".source\" )\n\t\t.data( sourceLines )\n\t\t.enter().append( \"g\" )\n\t\t.attr( \"class\", \"source\" );\n\n\t// add lines for each source group\n\tvar linePath = chart.selectAll( \".source\" )\n\t\t.append( \"path\" )\n\t\t.attr( \"class\", \"line\" )\n\t\t.attr( \"d\", function ( d ) {\n\t\t\treturn line( d.values );\n\t\t} )\n\t\t.style( \"stroke-width\", function ( d ) {\n\t\t\t// assign stroke width based on source value\n\t\t\treturn stroke_widths[ sourceById[ d.source ] ];\n\t\t} )\n\t\t.style( \"stroke\", function ( d ) {\n\t\t\treturn lineColors( d.source );\n\t\t} );\n\n\tchart.selectAll( \".line\" )\n\t\t.attr( \"id\", function ( d ) {\n\t\t\treturn d.source;\n\t\t} )\n\t\t.call( transition ); // call function to animate lines\n\n\t// declare function to animate the lines\n\tfunction transition( path ) {\n\t\tpath.attr( \"stroke-dashoffset\", pathLength ) // set full length first for ltr anim\n\t\t\t.transition()\n\t\t\t.duration( 3000 )\n\t\t\t.attrTween( \"stroke-dasharray\", dashArray )\n\t\t\t.attr( \"stroke-dashoffset\", 0 );\n\t}\n\n\t// declare function to calculate stroke dash array\n\tfunction dashArray() {\n\t\tvar l = this.getTotalLength(),\n\t\t\ti = d3.interpolateString( \"0,\" + l, l + \",\" + l );\n\t\treturn function ( t ) {\n\t\t\treturn i( t );\n\t\t};\n\t}\n\n\t// declare function to calculate full length of path\n\tfunction pathLength() {\n\t\tvar l = this.getTotalLength();\n\t\treturn -l;\n\t}\n\n\t// add line labels group\n\tchart.append( \"g\" )\n\t\t.attr( \"id\", \"line-labels\" );\n\n\t// draw/append labels for every line\n\tvar lineLabels = chart.select( \"#line-labels\" )\n\t\t.selectAll( \".line-label\" )\n\t\t.data( sourceLines )\n\t\t.enter().append( \"text\" )\n\t\t.attr( \"class\", \"line-label\" )\n\t\t.datum( function ( d ) {\n\t\t\treturn {\n\t\t\t\tsource: d.source,\n\t\t\t\tvalue: d.values[ 0 ]\n\t\t\t};\n\t\t} )\n\t\t.text( function ( d ) {\n\t\t\treturn d.source;\n\t\t} )\n\t\t.attr( \"transform\", function ( d ) {\n\t\t\treturn \"translate(\" + ( iepX( parseYear( d.value.year ) ) + 5 ) + \",\" + ( iepY( d.value.btu ) + 3 ) + \")\";\n\t\t} )\n\t\t.style( \"fill\", function ( d ) {\n\t\t\treturn lineColors( d.source );\n\t\t} )\n\t\t.style( \"font-weight\", function ( d ) {\n\t\t\t// assign font weight based on source value\n\t\t\treturn font_weights[ sourceById[ d.source ] ];\n\t\t} )\n\t\t.call( wrap, 115, .05, 1.1 );\n\n\t// create custom function for Y axis\n\tfunction customYAxis( g ) {\n\t\t// move axis to align properly with the bottom left corner including tick values\n\t\tg.attr( \"transform\", \"translate(\" + ( -chart_margins.left / 2 ) + \", 0)\" )\n\t\tg.call( yAxis );\n\t\tg.select( \".domain\" );\n\t\tg.attr( \"text-anchor\", \"end\" );\n\t\tg.selectAll( \".tick:not(:first-of-type) line\" ).attr( \"stroke\", \"#777\" ).attr( \"stroke-dasharray\", \"2,2\" );\n\t\tg.selectAll( \".tick text\" ).attr( \"x\", -4 ).attr( \"dy\", 0 );\n\t}\n\n\t// draw/append tooltip container\n\tvar tooltip = d3.select( \"#export-import-prod\" )\n\t\t.append( \"div\" )\n\t\t// .attr( \"transform\", \"translate(-100,-100)\" )\n\t\t.attr( \"class\", \"tooltip\" )\n\t\t.style( \"pointer-events\", \"none\" );\n\n\t// append container div for text\n\tvar tooltip_text = tooltip.append( \"div\" )\n\t\t.attr( \"class\", \"tooltip_text\" );\n\n\t// append paragraph for year\n\ttooltip_text.append( \"p\" )\n\t\t.attr( \"class\", \"tooltip_title\" );\n\n\t// append paragraph for point value\n\ttooltip_text.append( \"p\" )\n\t\t.attr( \"class\", \"tooltip_data\" );\n\n\t// append div for pointer/marker\n\ttooltip.append( \"div\" )\n\t\t.attr( \"class\", \"tooltip_marker\" );\n\n\t/* VORONOI for rollover effects */\n\t// create array variable for flattened data\n\tvar flatData = [];\n\t// flatten all data into one array\n\tfor ( k in sourceLines ) {\n\t\tvar k_data = sourceLines[ k ];\n\t\tk_data.values.forEach( function ( d ) {\n\t\t\tif ( d.year >= minYr ) flatData.push( {\n\t\t\t\tname: k_data.source,\n\t\t\t\tyear: d.year,\n\t\t\t\tvalue: d.btu\n\t\t\t} );\n\t\t} );\n\t} // END for k loop\n\t// console.log( \"FLAT DATA\", flatData );\n\n\t// nest flattened data for voronoi\n\tvar voronoiData = d3.nest()\n\t\t.key( function ( d ) {\n\t\t\treturn iepX( parseYear( d.year ) ) + \",\" + iepY( d.value );\n\t\t} )\n\t\t.rollup( function ( v ) {\n\t\t\treturn v[ 0 ];\n\t\t} )\n\t\t.entries( flatData )\n\t\t.map( function ( d ) {\n\t\t\treturn d.value;\n\t\t} );\n\t// console.log( \"VORONOI DATA\", voronoiData );\n\n\t// initiate the voronoi function\n\tvar voronoi = d3.voronoi()\n\t\t.x( function ( d ) {\n\t\t\treturn iepX( parseYear( d.year ) );\n\t\t} )\n\t\t.y( function ( d ) {\n\t\t\treturn iepY( d.value );\n\t\t} )\n\t\t.extent( [ [ -chart_margins.left / 2, -chart_margins.top / 2 ], [ iepWidth + chart_margins.left, iepHeight + chart_margins.top ]\n\t\t\t] );\n\tvar voronoiOutput = voronoi( voronoiData );\n\t// console.log( \"VORONOI OUTPUT\", voronoiOutput );\n\n\t// append the voronoi group element and map to points\n\tvar voronoiGroup = chart.append( \"g\" )\n\t\t.attr( \"class\", \"voronoi\" )\n\t\t.selectAll( \"path\" )\n\t\t.data( voronoiOutput.polygons() )\n\t\t.enter().append( \"path\" )\n\t\t.attr( \"class\", \"voronoi_cells\" )\n\t\t.attr( \"d\", function ( d ) {\n\t\t\treturn d ? \"M\" + d.join( \"L\" ) + \"Z\" : null;\n\t\t} )\n\t\t.on( \"mouseover\", mouseover )\n\t\t.on( \"mouseout\", mouseout );\n\n\t// add mouseover action for tooltip\n\tfunction mouseover( d ) {\n\t\t// set x and y location\n\t\tvar dotX = iepX( parseYear( d.data.year ) ),\n\t\t\tdotY = iepY( d.data.value ),\n\t\t\tdotBtu = d3.format( \".2f\" )( d.data.value ),\n\t\t\tdotYear = d.data.year,\n\t\t\tdotSource = d.data.name;\n\n\t\t// console.log( \"SOURCE:\", dotSource, index( lineColors( dotSource ) ) );\n\n\t\t// add content to tooltip text element\n\t\t/*tooltip.select( \".tooltip_text\" )\n\t\t\t.style( \"border-color\", lineColors( [ dotSource ] - 2 ) );*/\n\n\t\ttooltip.select( \".tooltip_title\" )\n\t\t\t.text( dotYear )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\ttooltip.select( \".tooltip_data\" )\n\t\t\t.text( dotBtu + \" \" + yUnitsAbbr );\n\n\t\ttooltip.select( \".tooltip_marker\" )\n\t\t\t.text( \"▼\" )\n\t\t/*.style( \"color\", lineColors( dotSource ) )*/\n\t\t;\n\n\t\t//Change position of tooltip and text of tooltip\n\t\ttooltip.style( \"visibility\", \"visible\" )\n\t\t\t.style( \"left\", dotX + ( chart_margins.left / 2 ) + \"px\" )\n\t\t\t.style( \"top\", dotY + ( chart_margins.top / 2 ) + \"px\" );\n\t} //mouseover\n\n\tfunction mouseout() {\n\t\ttooltip.style( \"visibility\", \"hidden\" );\n\t}\n\n\t// append tooltip elements\n\tvar tooltipValue = g.append( \"g\" )\n\t\t.attr( \"transform\", \"translate(-100,-100)\" )\n\t\t.attr( \"class\", \"tooltip_value\" )\n\t\t.style( \"pointer-events\", \"none\" );\n\ttooltipValue.append( \"circle\" )\n\t\t.attr( \"class\", \"tooltip_circle\" )\n\t\t.attr( \"r\", 2 );\n\ttooltipValue.append( \"text\" )\n\t\t.attr( \"class\", \"tooltip_title\" )\n\t\t.attr( \"y\", -15 );\n\n\t/* DATA SOURCE SECTION */\n\t// draw/append tooltip container\n\tvar sources = d3.select( \"#chart-sources\" );\n\n\tsources.append( \"h5\" )\n\t\t.text( \"SOURCE: \" );\n\n\tsources.append( \"p\" )\n\t\t.attr( \"class\", \"source-content\" );\n\n\tsources.select( \".source-content\" )\n\t\t.text( \"U.S. Energy Information Administration (EIA), \" )\n\t\t.append( \"a\" )\n\t\t.attr( \"href\", \"http://www.eia.gov/totalenergy/data/monthly/\" )\n\t\t.text( \"Monthly Energy Review, tables 1.4a & 1.4b\" );\n}" ]
[ "0.6634163", "0.6567358", "0.65666723", "0.65331084", "0.65331084", "0.64904416", "0.64669484", "0.64644897", "0.6441544", "0.6428741", "0.63845015", "0.63683325", "0.6361004", "0.63004786", "0.6286896", "0.62724626", "0.6260908", "0.6251874", "0.6235121", "0.6219837", "0.61956835", "0.61848176", "0.6181049", "0.61725193", "0.61622906", "0.61614877", "0.6159858", "0.6121967", "0.6113556", "0.6101294", "0.606001", "0.604481", "0.6031537", "0.6017603", "0.60047966", "0.600114", "0.5996778", "0.598979", "0.597533", "0.5969844", "0.59585726", "0.59500825", "0.59487224", "0.5948407", "0.5946837", "0.59431034", "0.59389895", "0.59353286", "0.5923788", "0.5916316", "0.5910867", "0.5904382", "0.5896298", "0.5895453", "0.5895077", "0.5893438", "0.5890829", "0.5879279", "0.58602875", "0.58588886", "0.5856515", "0.5856391", "0.5848426", "0.5847129", "0.5835377", "0.58335704", "0.582177", "0.5821767", "0.5817897", "0.58074105", "0.58006763", "0.5790962", "0.5781393", "0.5777159", "0.5758542", "0.5757557", "0.57573533", "0.575352", "0.5751265", "0.57435614", "0.57412654", "0.5735847", "0.5728598", "0.5723725", "0.5722838", "0.57190776", "0.571785", "0.57176507", "0.5716561", "0.5708566", "0.5699703", "0.5698008", "0.56942517", "0.5689663", "0.56875926", "0.56820464", "0.5676496", "0.5673123", "0.56641734", "0.56605273" ]
0.57672846
74
Function for getting an individual file
async function getFile() { const myFile = await fleekStorage.get({ apiKey: 'my-key', apiSecret: 'my-secret', key: 'filename-on-fleek', getOptions: [ 'data', 'bucket', 'key', 'hash', 'publicUrl' ], }) console.log('myFile', myFile) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getFile(id) {\n var file = await db.readDataPromise('file', { id: id })\n return file[0];\n}", "static io_getfile(filename, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_getfile({0})\".format(filename));\n Database.getfile(filename, fcn);\n }", "function findFile(filename) {\n\tvar f = null;\n\tclient.files.forEach(function(file) {\n\t\tif (file.name === filename) f = file;\n\t});\n\treturn f;\n}", "function getFile(){\n\n\t\treturn this.file;\n\t}", "getFileById(uniqueId) {\r\n return new File(this, `getFileById('${uniqueId}')`);\r\n }", "Get(filename)\n {\n return \"\";\n }", "function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}", "getFile(response) {\n return paths.getJSONFile(this.path, response);\n }", "getFile(filePath, options) {\n console.log('api.getFile: ', filePath);\n return this.sendRequest({\n type: 'loadFile',\n filePath: filePath,\n options: options\n })\n .then(function(fileInfo) {\n return {\n filePath: filePath,\n contents: fileInfo.payload.contents\n }\n })\n .catch(function(errorInfo) {\n return undefined;\n });\n }", "function getFileURL() {\n return urlVars['file'];\n}", "getFileURL(fileId) {\n var file = this.collection.findOne(fileId, {\n fields: { name: 1 }\n });\n return file && `${ this.getURL() }/${ fileId }/${ encodeURIComponent(file.name) }`;\n }", "static async getFile(request, response) {\n const { userId } = await userUtils.getUserIdAndKey(request);\n const { id: fileId } = request.params;\n const size = request.query.size || 0;\n\n // Mongo Condition for Id\n if (!basicUtils.isValidId(fileId))\n return response.status(404).send({ error: 'Not found' });\n\n const file = await fileUtils.getFile({\n _id: ObjectId(fileId),\n });\n\n if (!file || !fileUtils.isOwnerAndPublic(file, userId))\n return response.status(404).send({ error: 'Not found' });\n\n if (file.type === 'folder') {\n return response\n .status(400)\n .send({ error: \"A folder doesn't have content\" });\n }\n\n const { error, code, data } = await fileUtils.getFileData(file, size);\n\n if (error) return response.status(code).send({ error });\n\n const mimeType = mime.contentType(file.name);\n\n response.setHeader('Content-Type', mimeType);\n\n return response.status(200).send(data);\n }", "async function getFile(fileId) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"GET\",\n });\n }", "function getFile1() {\r\n fileName = \"sched1.txt\"\r\n fetchFile();\r\n }", "function get(path) {\n return files[toKey(path)];\n }", "getFile(filePath) {\n return this.getFileInfo(filePath)?.file\n }", "async function getFile(fileName) {\n return await httpRequestWrapper(`${baseUrl}files.php?file=${fileName}`);\n}", "function _getDataFromFile(){\n\tvar fileData = _openFIle();\n\treturn fileData;\n}", "function getGoogleDriveFile() {\n console.log('checking if google drive file exists');\n console.log(\"readin files\");\n access_token = gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().access_token;\n\n console.log(fileId); //fileId = null;//temporary \n // If fileId is null then call list files to get file id by title\n if (fileId === null) {\n // If fileId is not set then get fileId first\n setFileID().done(function () {\n console.log(\"function returned file id setting\");\n // For first time fileId will be null so no need to read url if file id is null\n if (fileId !== null) {\n getGoogleDriveURL();\n }\n });\n } else {\n // If already fileId is set then get URL\n getGoogleDriveURL();\n }\n }", "function getFile(json, url) {\n\n try { \n\treturn fs.readFileSync(\".\" + url.pathname);\n } catch (err) {\n\t//Don't do anything\n\tconsole.log(\"Coudnt read file\" + err);\n }\n}", "function get_file (file){\n return path.resolve(temp_dir + '/' + file);\n }", "async getFile(params) {\n try {\n console.log(\"s3.getObject Params: \", params);\n var s3 = new this.AWS.S3();\n let file = await s3.getObject(params).promise();\n return (file);\n } catch (error) {\n console.error('S3.getObject error: ', error);\n return (error);\n }\n }", "function getFile(prefix,ext,folder) {\n\treturn function(file_download_link) {\n\t\tvar url \t= \"https://api.telegram.org/file/bot\" + TOKEN + \"/\" + file_download_link;\n\t\tvar name \t= prefix + (new Date()).getTime() + \".jpg\";\n\t\tconsole.log(\"Got \" + name);\n\t\t\n\t\treturn new Promise((resolve,reject) => {\n\t\t\tlet options = {\n\t\t\t\tdirectory \t: folder,\t\t\t\t\t//target directory\n\t\t\t\tfilename \t: name,\t\t\t\t\t\t//desired name\n\t\t\t}\n\t\t\tdownloadFrom(url, options, err => {\n\t\t\t\tif (!err)\t{resolve(folder + \"/\" + name);}\n\t\t\t\telse \t\t{reject(\"*File Download to Server Error*\");}\n\t\t\t})\n\t\t})\n\t}\n}", "async getFile() {\n let responseData = 'nothing happend';\n try {\n const fileData = await readFile(this.path);\n responseData = fileData.toString('utf8');\n } catch (e) {\n try {\n const dirData = await readdir(this.path);\n responseData = dirData;\n } catch (err) {\n responseData = `no such file found in ${this.path}`;\n }\n } finally {\n return responseData;\n }\n }", "function readFileInfo(x){\n\tconsole.log(\"Cur \" + x + \" Tot \" + nrOfFiles);\n\tif (x >= nrOfFiles) {\n\t\tofferShare();\n\t\treturn;\n\t}\n\tvar f = files[x];\n\tvar reader = new FileReader();\n\t\treader.onloadend = function (e) {\n\t\t\tif(reader.readyState == FileReader.DONE){\n\t\t\t\tconsole.log(f.name);\n\t\t\t\tfmArray[x].stageLocalFile(f.name, f.type, reader.result);\n\t\t\t\treadFileInfo(x+1);\n\t\t\t}\n\t\t}; \n\t\treader.readAsArrayBuffer(f);\n}", "function GetFileFn(chatId, filename,successCB, errorCB) {\n console.log('ChatDataFactory', 'GetFileFn()');\n\n $http({\n method: 'GET',\n url: _endPointJSON + 'getFile',\n params: {\n 'chat_id': chatId,\n 'filename': filename\n }\n })\n .then(function (response) {\n console.log(response);\n if (successCB) {\n successCB(response.data);\n }\n },\n function (response) {\n if (errorCB) {\n errorCB(response);\n }\n console.error(response.data);\n ToasterNotifierHandler.handleError(response);\n });\n }", "function getFile(loc) {\n var locArray = loc.split('/');\n var folder = getFolder(loc);\n if(folder.getFilesByName(locArray[locArray.length-1]).hasNext()) {\n return folder.getFilesByName(locArray[locArray.length-1]).next();\n } else {\n return null;\n }\n}", "get file() {\r\n return new File(this, \"file\");\r\n }", "function get_file(url) {\n\tconst request = new XMLHttpRequest()\n\t// This throws a warning about synchronous requests being deprecated\n\trequest.open('GET',url,false)\n\trequest.send()\n\treturn request.responseText\n}", "function getFileInfo(req, res) {\n var hash = req.params.hash;\n rtorrentcontroller.getFileData(hash, function(data) {\n sendResponse(data, res);\n });\n}", "function fileInfo(appweburl, hostweburl, f) {\r\n //console.log('fileInfo('+f.ID+')');\r\n var deferred = $.Deferred();\r\n\r\n var executor = new SP.RequestExecutor(appweburl);\r\n var itemid = f.ID;\r\n var url = appweburl +\r\n \"/_api/SP.AppContextSite(@target)/web/lists/getbytitle('assets')/Items(\" + itemid + \")/File?@target='\" + hostweburl + \"'\";\r\n executor.executeAsync({\r\n url: url,\r\n method: \"GET\",\r\n headers: { \"Accept\": \"application/json; odata=verbose\" },\r\n success: function (data) {\r\n var obj = JSON.parse(data.body);\r\n var fileInfo = obj.d;\r\n //console.log('fileInfo => ' + JSON.stringify(obj.d));\r\n deferred.resolve(fileInfo);\r\n },\r\n error: function (err) {\r\n deferred.reject('Fail: ' + JSON.stringify(err));\r\n }\r\n });\r\n\r\n return deferred;\r\n}", "static async getFile(context, path) {\n const filePath = EncodeUtil_1.EncodeUtil.decodeUrlPart(context.repositoryPath + path_1.sep + path);\n try {\n await util_1.promisify(fs_1.access)(filePath, constants_1.F_OK);\n }\n catch (err) {\n return null;\n }\n const file = await util_1.promisify(fs_1.stat)(filePath);\n // This code blocks vulnerability when \"%20\" folder can be injected into path and file.Exists returns 'true'.\n if (!file.isFile()) {\n return null;\n }\n const davFile = new DavFile(filePath, context, path, file);\n if (await ExtendedAttributesExtension_1.ExtendedAttributesExtension.hasExtendedAttribute(davFile.fullPath, \"SerialNumber\")) {\n davFile.serialNumber = Number(await ExtendedAttributesExtension_1.ExtendedAttributesExtension.getExtendedAttribute(davFile.fullPath, \"SerialNumber\"));\n }\n if (await ExtendedAttributesExtension_1.ExtendedAttributesExtension.hasExtendedAttribute(davFile.fullPath, \"TotalContentLength\")) {\n davFile.totalContentLength = Number(await ExtendedAttributesExtension_1.ExtendedAttributesExtension.getExtendedAttribute(davFile.fullPath, \"TotalContentLength\"));\n }\n return davFile;\n }", "function _getImageFile(fileEntry) {\n\t\t\t//wrap in $q ctor to convert from callback to promise design and get in angular scope\n\t\t\treturn $q(function(resolve, reject) {\n\t\t\t\tfileEntry.file(function(file) {\n\t\t\t\t\tresolve(file);\n\t\t\t\t}, function(error) {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "async getFile() {\n return await jsonStorage.getItem(plantPath).then(item => {\n return item;\n\n }).catch(() => {\n return null;\n });\n }", "file () {\n try {\n const file = this.currentFile()\n\n if (!file) throw createError({ code: 'ENOENT', message: 'No file selected' })\n return file\n } catch (e) {\n throw new Error(e)\n }\n }", "function getFiles() {\n listFiles(function (err, files) {\n console.log(files);\n getService(function (service) {\n if (files && files.length) {\n files.forEach(function (file) {\n var filename = file.name;\n var dest = fs.createWriteStream(filename);\n var mimeType = mime.lookup(filename);\n if(mimeType) {\n service.files.get({\n fileId: file.id,\n alt: 'media'\n })\n .on('end', function () {\n console.log('Done');\n })\n .on('error', function (err) {\n console.log('Error during download', err);\n })\n .pipe(dest);\n } else {\n service.files.get({\n fileId: file.id,\n mimeType: 'application/*'\n })\n .on('end', function () {\n console.log('Done');\n })\n .on('error', function (err) {\n console.log('Error during download', err);\n })\n .pipe(dest);\n }\n });\n }\n });\n });\n}", "getFileId(name) {\n let matches = this.entries.filter(e => e.name === name);\n if (matches.length > 0) {\n return matches[0];\n } else {\n return null;\n }\n }", "async function retrieveFile(file_name){\n let error = null\n let file = null\n try{\n file = await getFileAsync({\n Bucket: config.bucket_name,\n Key: file_name\n })\n }catch(err){error=err}\n\n return new Promise((resolve, reject)=>{\n if(error) {reject(error)}\n else {resolve(file)}\n })\n}", "static async getShow(request, response) {\n const fileId = request.params.id;\n\n const { userId } = await userUtils.getUserIdAndKey(request);\n\n const user = await userUtils.getUser({\n _id: ObjectId(userId),\n });\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n // Mongo Condition for Id\n if (!basicUtils.isValidId(fileId) || !basicUtils.isValidId(userId))\n return response.status(404).send({ error: 'Not found' });\n\n const result = await fileUtils.getFile({\n _id: ObjectId(fileId),\n userId: ObjectId(userId),\n });\n\n if (!result) return response.status(404).send({ error: 'Not found' });\n\n const file = fileUtils.processFile(result);\n\n return response.status(200).send(file);\n }", "get (connection, callback, counter = 0) {\n let self = this\n\n if (!connection.params.file || !self.searchPath(connection, counter)) {\n self.sendFileNotFound(connection, self.api.config.errors.fileNotProvided(connection), callback)\n } else {\n let file = null\n\n if (!path.isAbsolute(connection.params.file)) {\n file = path.normalize(self.searchPath(connection, counter) + '/' + connection.params.file)\n } else {\n file = connection.params.file\n }\n\n if (file.indexOf(path.normalize(self.searchPath(connection, counter))) !== 0) {\n self.get(connection, callback, counter + 1)\n } else {\n self.checkExistence(file, (exists, truePath) => {\n if (exists) {\n self.sendFile(truePath, connection, callback)\n } else {\n self.get(connection, callback, counter + 1)\n }\n })\n }\n }\n }", "function get_file(fid) {\n var phpCmd = \"\";\n var response = \"still_no_answer\";\n if ( fid == 'config' ) {\n phpCmd = 'read_config_file';\n }\n else {\n return null;\n }\n var myREQ = new XMLHttpRequest();\n myREQ.open(method=\"GET\", url=\"php/functions.php?command=\" + phpCmd, async=false);\n myREQ.send();\n return (myREQ.responseText);\n}", "async getImage(id) {\n let filename = this._formatFilename(id);\n\n return await fs.readFile(filename, { encoding: null });\n }", "function getFile (file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text)\n })\n}", "function getFile(file) {\n\treturn ASQ(function(done){\n\t\tfakeAjax(file,done);\n\t});\n}", "static async find(directory, document, filename, edit = false) {\n\n\t\tlet path = `${config.api}/directories/${directory}/documents/${document}/files/${filename}`;\n\n\t\t// if we need the uncompiled markdown (for loading the editor), amend '/edit' to the path\n\t\tif (edit) {\n\t\t\tpath = [path, \"edit\"].join(\"/\");\n\t\t};\n\n\t\tlet response = await fetch(path, {headers: store.state.auth.authHeader()})\n\n\t\tif (!checkResponse(response.status)) {\n\t\t\tconsole.error(\"Document cannot be retrieved\", response);\n\t\t\treturn;\n\t\t}\n\n\t\tlet file = await response.json()\n\t\tlet doc = new CMSFile(file);\n\t\tstore.state.activeDocument = doc;\n\n\t\tawait store.commit(\"setLatestRevision\", file.repository_info.latest_revision);\n\n\t\tdoc.fetchAttachments();\n\t\treturn doc;\n\n\t}", "function getSingleFile(dirPath){\n //Main try/catch block\n try{\n //Get the list of files from provided directory path\n let files = fs.readdirSync(dirPath);\n\n //Throw error if more than on file is existing in given path\n if(files.length !== 1){\n throw new Error(`Expected 1 file but detected ${files.length} files in \"${dirPath}\"`);\n }\n\n //Return the single file available in directory\n return files[0];\n }\n catch(error){\n console.log(`Could not get files from directory due to error - \"${error}\"`);\n throw new Error(error);\n }\n}", "function file(tr) {\r\n\t\tif (!tr) tr = mTbB.find(\"tr.selected:first\");\r\n\t\treturn getPath().contents[$(tr).attr(\"id\")];\r\n\t}", "get(connection, callback, counter = 0) {\n let self = this;\n\n if (!connection.params.file || !self.searchPath(connection, counter)) {\n self.sendFileNotFound(connection, self.api.config.errors.fileNotProvided(connection), callback);\n } else {\n let file = null;\n\n if (!_path2.default.isAbsolute(connection.params.file)) {\n file = _path2.default.normalize(self.searchPath(connection, counter) + '/' + connection.params.file);\n } else {\n file = connection.params.file;\n }\n\n if (file.indexOf(_path2.default.normalize(self.searchPath(connection, counter))) !== 0) {\n self.get(connection, callback, counter + 1);\n } else {\n self.checkExistence(file, (exists, truePath) => {\n if (exists) {\n self.sendFile(truePath, connection, callback);\n } else {\n self.get(connection, callback, counter + 1);\n }\n });\n }\n }\n }", "requestFileInfo(UUID) {\n var self = this;\n var request = new messages.GetFileInfo(UUID);\n var stream = self.newStream();\n\n return stream.sendAndExpectMessage(request).then(function(message) {\n if(message.type === MessageType.FILE_INFO) {\n if(message.uuid !== UUID) {\n throw new Error('The message returned has the wrong file UUID (got ' +\n message.uuid + ' expected ' + UUID +\n ')');\n }\n\n return message;\n } else {\n throw message;\n }\n }).finally(function() {\n stream.close();\n });\n }", "async function getFile(name) {\n return new Promise(res => {\n fs.readFile(name, 'utf-8', (err, result) => {\n res(result);\n });\n });\n}", "static async getFileUploaded (id) {\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n\n // Find Document in database.\n const document = await db.collection(Document.COLLECTION).findOne(ObjectId(id));\n\n // If no document found.\n if (!document) {\n return null;\n }\n // Transform buffer.\n const result = Buffer.from(document.file.buffer);\n return result;\n }", "function displayFile(name) {\n const filePath = path.join(alpsDriveRoot, name)\n const statFile = fs.stat(filePath)\n return statFile.then((result) => {\n if (result.isFile()) {\n return fs.readFile(filePath)\n } else {\n return readDirectory(filePath)\n }\n }\n ).catch((err) => {console.log(err)})\n}", "function getFile(wopi, req, res, userHost) {\n let userAddress = req.docManager.curUserHostAddress(userHost);\n\n let path = req.docManager.storagePath(wopi.id, userAddress);\n\n res.setHeader(\"Content-Length\", fileSystem.statSync(path).size);\n res.setHeader(\"Content-Type\", mime.getType(path));\n\n res.setHeader(\"Content-Disposition\", \"attachment; filename*=UTF-8\\'\\'\" + encodeURIComponent(wopi.id));\n\n let filestream = fileSystem.createReadStream(path); // open a file as a readable stream\n filestream.pipe(res); // retrieve data from file stream and output it to the response object\n}", "function getFile(filePath, res, page404) {\n //does the requested file exist?\n\n fs.access(filePath, fs.constants.R_OK, function (error) {\n if (error) {\n fs.readFile(page404, function (err, contents) {\n //if there was no error\n if (!err) {\n //send the contents with a 404/not found header\n res.writeHead(404, { 'Content-Type': 'text/html' });\n res.end(contents);\n } else {\n //for our own troubleshooting\n console.dir(err);\n }\n });\n } else {\n fs.readFile(filePath, function (err, contents) {\n if (!err) {\n //if there was no error\n //send the contents with the default 200/ok header\n res.end(contents);\n } else {\n //for our own troubleshooting\n console.dir(err);\n }\n });\n }\n });\n}", "function pullFile(){\n var i = 1;\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.responseText && xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n var obj = jQuery.parseJSON( xmlHttp.responseText );\n $.each(obj, function() {\n FileName[FileName.length] = this['FileName'];\n File[File.length] = this['File']; \n });\n console.log(FileName);\n console.log(File);\n showfile();\n }\n };\n xmlHttp.open(\"GET\", \"https://mydesigncompany.herokuapp.com/portfolio\", true);\n //xmlHttp.open(\"GET\", \"https://infinite-stream-2919.herokuapp.com/portfolio\", true);\n xmlHttp.send(null);\n}", "get file() {\n return this.args.file;\n }", "get file () {\n return this._file\n }", "function getEndpointFile (dir) {\n for (var i = 0; i < files.length; i++) {\n if (path.dirname(files[i]) == dir) return files[i];\n }\n return null;\n}", "async function getFile(url){\n const response = await fetch(url);\n // blobs are usuually any files, like images or other files.\n const data = await response.blob();\n return new File([data], 'test.jpg', {type: 'image/jpeg'});\n }", "async function getFileDllink(file_id) {\n\tlet url = \"https://api.telegram.org/bot\" + TOKEN + \"/getFile?file_id=\" + file_id;\n\ttry \t\t{return (await (await fetch(url)).json()).result.file_path;}\n\tcatch(e) \t{throw \"*File Download Link Fetch Error*\";}\n}", "get(fileID) {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readonly');\n const request = transaction.objectStore(STORE_NAME).get(this.key(fileID));\n return waitForRequest(request);\n }).then(result => ({\n id: result.data.fileID,\n data: result.data.data\n }));\n }", "function getFile(file) {\n fakeAjax(file, function(text) {\n handleResponse(file, text);\n });\n}", "static io_getmediadone(filename, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_getmediadone({0})\".format(filename));\n Database.getmediadone(filename, fcn);\n }", "function findFileIdByName(fileName, resToClient){\n if (!gapi.oauth2Client.credentials.access_token) {\n resToClient.json({message: \"please log in first\"});\n }\n\n var q = \"title = '\" + fileName+\"'\";\n\n gapi.googleDrive.files.list({'q':q}, function(err, res){\n if (err) {\n resToClient.json({message: \"error while finding the file by its name\", err:err});\n }else {\n var items = res.items;\n \n if (items.length == 0) {\n var message = \"cannot find the target spreadsheet '\"+fileName+\"'under the target CCA folder\";\n resToClient.json({message: message});\n } else if (items.length > 1) {\n var message = \"duplicate spreadsheets '\"+fileName+\"'in your google drive\";\n resToClient.json({message: message});\n } else {\n\n }\n\n }\n \n }); \n}", "function retriveFile(path) {\n return new Promise((resolve, reject) => {\n var request = new XMLHttpRequest();\n request.open('GET', path, true);\n request.responseType = 'text';\n request.onload = () => resolve({\n fileData: request.response\n });\n request.onerror = reject;\n request.send();\n })\n}", "getByName(name) {\r\n const f = new File(this);\r\n f.concat(`('${name}')`);\r\n return f;\r\n }", "function getFilename (file) {\n return file.filename || file.name;\n}", "function readFile(id) {\n return readFileSync(`./images/data-set-${id}.jpg`);\n}", "function getImageFile(req, res) {\n var image_file = req.params.imageFile;\n var path_file = './uploads/publications/' + image_file;\n\n fs.exists(path_file, (exists) => {\n if (exists) {\n //Para poder usar el fichero en cualquier parte\n res.sendFile(path.resolve(path_file));\n } else {\n res.status(200).send({ message: \"No existe la imagen...\" });\n }\n });\n}", "function getFile(){\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: `http://47.103.129.164:7010/file_path/?search=`,\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tlet Dom = $(\"#fileList\")\n\t\t\t$(\"#fileList\").empty();\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tlet DOM = document.createElement(\"li\")\n\t\t\t\tDOM.innerHTML = data[i].path;\n\t\t\t\tDOM.id = data[i].id;\n\t\t\t\tDOM.className = \"FileCon\";\n\t\t\t\tDom.append(DOM)\n\t\t\t}\n\t\t\t\n\t\t\tif(data.length > 0){\n\t\t\t\tPublicData.fileID = data[0].id;\n\t\t\t\t$(\"#FILEval\").val(data[0].path);\n\t\t\t\tPublicData.file = data[0].path\n\t\t\t}\n\t\t}\n\t})\n}", "function getSongFile(req, res) {\n var imageFile = req.params.songFile;\n console.log('gaaaaaaaaaaaaa');\n var path_file = './uploads/songs/' + imageFile; //ruta donde se guardan mis images\n fs.exists(path_file, function(exists) {\n if (exists) {\n console.log(path_file);\n res.sendFile(path.resolve(path_file));\n } else {\n res.status(200).send({ message: 'No existe el fichero de audio...' });\n }\n });\n}", "getFileUrl(path) { return this.engine.getFileUrl(path); }", "function getFileInfo(file, callback) {\n return callback({\n readable: fs.createReadStream(file),\n paths: {\n input: file,\n output: file\n }\n });\n }", "item() {\n console.log('open', this.paths.itemPath);\n return fs.readFile(this.paths.itemPath, 'utf8');\n }", "async getFile(options){\n const self = this;\n const validateConfig = await ObjectValidator.validate({ object: options, against: \"Func_GetFile\", });\n if(validateConfig.success){\n let fullPathToFile = null;\n\n if(validateConfig.object.id !== undefined && validateConfig.object.id !== null){\n if(this.database_handler){\n const exists = await this.database_handler.getModel({ id: validateConfig.object.id, userId: this.config.userId, });\n if(exists){\n fullPathToFile = await this.beautifyPath(exists.path, true);\n }\n }\n }else{\n let pathToFile = validateConfig.object.path ? validateConfig.object.path : (\n validateConfig.object.name && validateConfig.object.ext && validateConfig.object.folder !== null ? `${validateConfig.object.folder}${validateConfig.object.folder === \"\" ? \"\" : \"/\"}${validateConfig.object.name}.${validateConfig.object.ext}` : null\n );\n\n fullPathToFile = await this.beautifyPath(pathToFile, true);\n }\n\n let file = await this.getLocalFile(fullPathToFile);\n if(file){ return await self.newFCFile({...file, handler: self, isEncrypted: false,}); }\n }\n\n return null;\n }", "getSampleFile (filters) {\n console.log(\"Filters: \", filters);\n return client.get(\"/request/file/data\", {\n params: {\n filters: filters\n }\n }).then(response => response.data);\n }", "getFile(alias) {\n if (this._fileAlias.hasOwnProperty(alias)) {\n return this._fileLoaded[this._fileAlias[alias]]\n }\n }", "function getFileId() {\n var file_id = window.location.href.substring(window.location.href.indexOf(\"file_id=\") + 8);\n\n if( file_id.slice(-1) === \"#\") {\n file_id = file_id.substring(0, file_id.length -1);\n };\n\n return file_id\n}", "loadFile(descriptor)\n {\n return this.drivers[descriptor.driver].getFile(descriptor.id)\n }", "function getFile(base64, filename) {\n var arr = base64.split(','), mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var file = new File([u8arr], filename, { type: mime });\n\n var docx = new DocxReader();\n setTimeout(function () {\n var url = URL.createObjectURL(file);\n docx.Load(url, function () {\n docx.SetName(filename)\n docx.Download();\n });\n }, 1500);\n\n\n}", "function getFileUrl(sourceId){\n var url;\n if(navigator.userAgent.indexOf(\"MSIE\")>=1){\n url = document.getElementById(sourceId).value;\n }\n else if(navigator.userAgent.indexOf(\"Firefox\")>0){\n url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));\n }\n else if(navigator.userAgent.indexOf(\"Chrome\")>0){\n url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));\n \n }\n\n return url;\n}", "function downloadSoundFile(soundFullPath, getNameOfSound)\r\n{\r\n console.log(soundFullPath);\r\n\r\n// var x=new XMLHttpRequest();\r\n// x.open( \"GET\", soundFullPath , true);\r\n// x.responseType=\"blob\";\r\n// x.onload= function(e){download(e.target.result, getNameOfSound, \"sound/*\");};\r\n// x.send();\r\n// \r\n var x = new XMLHttpRequest();\r\n x.open(\"GET\", soundFullPath, true);\r\n x.responseType = 'blob';\r\n x.onload = function()\r\n {\r\n var soundFile = new FileReader();\r\n soundFile.readAsDataURL(x.response);\r\n soundFile.onload = function(e){\r\n download(e.target.result, getNameOfSound, \"sound/*\");\r\n };\r\n };\r\n x.send();\r\n\r\n}", "function get_cur_file_info_by_id(id){\n\tfile_to_operate_id = id;\t\n\telement_to_operate = document.getElementById(id);\n\tswitch(cur_dir_path){\n case 'root':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).type;\n break;\n case 'root/Pictures':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).filename;\n break;\n case 'root/Contacts':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name;\n break;\n case 'root/Videos':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name;\n break;\n\t}\n\t//element_to_operate.innerHTML;\t\n}", "function getFile(filename, callback)\n{ oxmlhttp = null;\n try\n { oxmlhttp = new XMLHttpRequest();\n oxmlhttp.overrideMimeType(\"text/html\");\n }\n catch(e)\n { \n \treturn null\n }\n if(!oxmlhttp) return null;\n try\n { oxmlhttp.open(\"GET\",filename,true);\n \toxmlhttp.send(null);\n }\n catch(e)\n { return null;\n }\n oxmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \tvar parser = new DOMParser();\n \tvar xmlDoc = parser.parseFromString(this.responseText, \"text/html\");''\n \tcallback(xmlDoc);\n }\n\t };\n}", "function getTextFile(theFilename){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\n if (err) {\n resolve(\"\")\n } else {\n resolve(theContent);\n }\n });\n }\n catch (error) {\n resolve(\"\")\n }\n \n }));\n}", "handler(request, reply) {\n return reply.file(path.join('public', a, request.params.filename));\n }", "function Retrieval(id) {\n this._id = id;\n this._fullPath = getFilePath(this._id);\n\n fs.ReadStream.apply(this, [this._fullPath]);\n}", "function getFile(file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text);\n });\n }", "function getFile(callback) {\n if (msg.rootDirectoryFID) {\n var parent = tree.getFile(msg.rootDirectoryFID);\n // todo evaluate/handle rootDirectoryFID, i.e. resolve filename relative to specified parent directory\n }\n tree.openOrCreate(msg.fileName, msg.createDisposition, !!(msg.createOptions & common.FILE_DIRECTORY_FILE), callback);\n }", "function getFS(file, type, fs){\n if(file){\n if(type == \"audio\") {\n console.log(\"audio file lookup\");\n window.requestFileSystem(fs, 0, gotFSAudio, fail);\n } else {\n console.log(\"image file lookup\");\n window.requestFileSystem(fs, 0, gotFSImage, fail);\n }\n } else {\n console.log(\"No file recorded!\");\n }\n}", "function openFile(el){\n var width = 600;\n var height = 600;\n\n var name = el.innerHTML;\n var path = el.path;\n\n window.open(location.origin + \"/getFile?file=\" + path, name, \"left=250,top=100,width=\" + width + \",height=\" + height, false);\n\n}", "function readAllFileName(url){\n return fsPromise.readdir(url)\n .then((data)=>{\n // console.log(data)\n return data;\n }).catch((err)=>{\n console.log('err:',err)\n })\n }", "function grabFile(file) {\n \n\t\tvar request = getHTTPObject();\n\t\tif (request) {\n\t\trequest.onreadystatechange = function() {\n\t\tdisplayResponse(request);\n\n\t\t};\n\t\trequest.open(\"GET\", file, true);\n\t\trequest.send(null);\n\t\t}\n\t}", "function fetch(filename) {\n\t var att = atts[filename];\n\t var path$$1 = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n\t '?rev=' + doc._rev;\n\t return ajaxPromise(opts, {\n\t method: 'GET',\n\t url: genDBUrl(host, path$$1),\n\t binary: true\n\t }).then(function (blob) {\n\t if (opts.binary) {\n\t return blob;\n\t }\n\t return new PouchPromise(function (resolve) {\n\t blobToBase64(blob, resolve);\n\t });\n\t }).then(function (data) {\n\t delete att.stub;\n\t delete att.length;\n\t att.data = data;\n\t });\n\t }", "function getFile(name, link){\n $.ajax({\n method: \"get\",\n dataType: 'json',\n contentType: 'application/json',\n url: link,\n success: function (response) {\n var uri = response.uri + response.token;\n var link = document.createElement(\"a\");\n link.download = name;\n link.href = uri;\n link.click();\n\n }\n });\n }", "function getFile(req, res) {\n var file = req.params.file;\n var path_file = './uploads/films/' + file;\n fs.exists(path_file, function(exists) {\n if (exists) {\n res.sendFile(path.resolve(path_file));\n } else {\n res.status(200).send({ message: \"No existe el fichero\" });\n }\n });\n}", "GetPath() {return this.filePath;}", "getAsset (file) {\n return AV.Asset.fromFile(folder + file);\n }", "function file_get(fid, callback) {\n var method = 'file.get';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, fid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n //Ti.API.info(hash);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "function getFile(fileName) {\n return fs.readFileSync(path.resolve(__dirname, fileName), \"utf-8\");\n}" ]
[ "0.70690346", "0.68359876", "0.6664836", "0.66529846", "0.6500819", "0.6489748", "0.64168316", "0.6390485", "0.6366067", "0.6346036", "0.6341797", "0.6340426", "0.63265216", "0.6325997", "0.6317268", "0.63048714", "0.62643766", "0.62479764", "0.62321293", "0.6190619", "0.61494833", "0.61409265", "0.6113782", "0.6100276", "0.60879403", "0.60803443", "0.6068331", "0.60682803", "0.60625505", "0.6017229", "0.6013913", "0.6010019", "0.60100174", "0.60018486", "0.59938747", "0.59873384", "0.59841216", "0.5925867", "0.5920004", "0.58769864", "0.5873541", "0.5869333", "0.5864843", "0.5828741", "0.58214134", "0.5819993", "0.5813698", "0.5802597", "0.57838047", "0.5778622", "0.5775647", "0.57728463", "0.57665807", "0.57538056", "0.5752596", "0.5749466", "0.5743263", "0.57263607", "0.5722284", "0.5722248", "0.5721243", "0.57196146", "0.5718688", "0.5716398", "0.5706328", "0.5705", "0.57022184", "0.57003874", "0.569954", "0.5699236", "0.5693715", "0.5691393", "0.5683918", "0.56789637", "0.56748915", "0.5670569", "0.56674796", "0.5658134", "0.5656058", "0.56539977", "0.5652816", "0.5652355", "0.5645159", "0.56369823", "0.5635949", "0.5633011", "0.562519", "0.5621766", "0.5616762", "0.56152767", "0.5613493", "0.5610607", "0.56102425", "0.5608348", "0.5607211", "0.5606061", "0.5595299", "0.5593978", "0.5583396", "0.5578272" ]
0.5765054
53
Don't use the .endsWith() method. HELPFUL LINKS: The second argument to substring is the index to stop at (but not include); if missing, goes until the end The second argument to substr is the maximum length to return. USING SUBSTRING() substring(index start (first char to include; here, 6 aka "n"), index end here, substring (71);
function confirmEnding(str, target) { var targetLength = target.length; var ending = str.substring(str.length-targetLength); return ending === target; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(str, ending){\n // TODO: complete\n return str.endsWith(ending)\n}", "function solution(str, ending){\n return str.endsWith(ending)\n}", "function solution(str, ending){\n return str.endsWith(ending);\n}", "function solution(str, ending){\n return str.endsWith(ending);\n}", "function solution(str, ending){\n return str.endsWith(ending);\n }", "function solution(str, ending) {\n return str.endsWith(ending);\n}", "function SubstringMe(str,start, end){\r\n\r\n return str.substring(start,end);\r\n\r\n\r\n\r\n }", "function substringByStartAndEnd(input, start, end) {}", "function solution(str, ending){\nif(str.endsWith(ending)) return true\nreturn false\n}", "function sc_substring(s, start, end) {\n return s.substring(start, (!end || end < 0) ? s.length : end);\n}", "function solution(str, ending){\r\n const endingLength = ending.length\r\n return (str.substring(str.length - endingLength)) === ending\r\n}", "substring(start,end) { return this.input.substring(start,end) }", "function solution(str, ending){\n return ending === str.substring(str.length - ending.length)\n}", "function substrMe(str,start,length){\r\n \r\n return str.substr(start,length);\r\n\r\n }", "function substring(str, start, end) {\n var result = '';\n var temp;\n\n if (end === undefined) end = str.length;\n start = fixIndex(str, start);\n end = fixIndex(str, end);\n if (start > end) {\n temp = end;\n end = start;\n start = temp;\n }\n\n for (; start < end; start++) {\n result += str[start];\n }\n\n return result;\n}", "function substring(string, start, end) {\n var newString = \"\",\n temp;\n\n if (end === undefined) {\n end = string.length;\n }\n\n if (start < 0 || isNaN(start)) {\n start = 0;\n }\n\n if (end < 0 || isNaN(end)) {\n end = 0;\n }\n\n if (start > end) {\n temp = start;\n start = end;\n end = temp;\n }\n\n if (start > string.length) {\n start = string.length;\n }\n\n if (end > string.length) {\n end = string.length;\n }\n\n if (start === end) {\n return \"\";\n }\n\n for (var i = start; i < end; i++) {\n newString += string[i];\n }\n\n return newString;\n}", "function getSubstr(strSource,intStartPosition,intOverPosition,cPosition)\r\n{\r\n\tvar strTarget = \"\";\r\n\tvar cTemp = \"\";\r\n\tvar intLoop = 0;\r\n\tvar intCount = 0;\r\n\ttry\r\n\t{\r\n\t strSource = trim(strSource);\r\n\t\tintCount = strSource.length;\r\n\t\tif (intStartPosition>intCount) intStartPosition = intCount;\r\n\t\tif (intOverPosition>intCount) intOverPosition = intCount;\r\n\t\tif (cPosition==null)\r\n\t\t{\r\n\t\t\tstrTarget = strSource.substring(intStartPosition,intOverPosition);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t if (intStartPosition<=intOverPosition)\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition;intLoop<intOverPosition;intLoop++)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = strTarget + cTemp;\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition-1;intLoop>intOverPosition;intLoop--)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = cTemp+strTarget;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t}\r\n\treturn strTarget;\r\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function confirmEnding(str, target) {\n let exist=str.lastIndexOf(target);\n if (exist!=-1){\n let slice = str.slice(exist);\n console.log(slice);\n if(slice==target){\n return true;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n }", "function substringByStartAndLength(input, start, length) {}", "function solution(str, ending) {\n if(!ending.length) return true;\n return str.slice(-(ending.length)) === ending;\n}", "clipEnd(substr) {\n if (this.content.endsWith(substr)) {\n this.content = clipStringEnd(this.content, substr);\n return true;\n }\n\n return false;\n }", "function subString(anotherString) {\n var anotherN = anotherString.substring(4, 7);\n console.log(anotherN);\n}", "function endsin (str, suffix) {\n if (str.length < suffix.length) return false\n return (str.slice(-suffix.length) === suffix)\n}", "function confirmEnding(str, target) \n{\n if(str.endsWith(target))\n {\n return str;\n }\n\n}", "function GetSubstringIndex(str, substring, n) {\r\n var times = 0, index = null;\r\n while (times < n && index !== -1) {\r\n index = str.indexOf(substring, index+1);\r\n times++;\r\n }\r\n return index;\r\n}", "substring(start, end) {\n start = Math.max(this.start, start)\n end = Math.min(this.end, end)\n return this.input.substring(start,end)\n }", "function prefixAgain(str, n){\n if(str.lastIndexOf(str.substring(0, n)) != 0)\n return true;\n else\n return false;\n}", "function substr(str, startNdx, length) {\n let newStr = '';\n\n if (length > 0) {\n if (startNdx < 0) startNdx += str.length;\n for (let i = 0; i < length; i++) {\n if (str[startNdx + i] === undefined) break;\n newStr += str[startNdx + i];\n }\n }\n\n return newStr + '!'; // add ! to indicate eos\n}", "function xStrEndsWith( s, end )\r\n{\r\n if( !xStr(s,end) ) return false;\r\n var l = s.length;\r\n var r = l - end.length;\r\n if( r > 0 ) return s.substring( r, l ) == end;\r\n return s == end;\r\n}", "function confirmEnding(str, target) {\n //substring method is used to extract characters from a string and has two arguements.\n //The first argument is a number that determines which index to start the extraction and the second is optional which determines where to end the extraction.\n //when you only use one argument it will use that number to extract from that index and on.\n\n //to obtain the index of where to start the extraction we need to know the length of the string and the target.\n\n //when you subtract the length of the target from the length of the string it will give you the substring we need to be tested.\n\n var first = str.length;\n console.log(str.length);\n\n var second = target.length;\n console.log(target.length);\n\n var difference = first - second;\n console.log(first - second);\n\n if (str.substring(difference) === target) {\n console.log(true);\n return true;\n }\n\n return false;\n}", "function testSubstrings(callback)\n{\n\ttesting.assertEquals('hi.there.you'.substringUpTo('.'), 'hi', 'String.substringUpTo() not working!', callback);\n\ttesting.assertEquals('hi.there.you'.substringUpToLast('.'), 'hi.there', 'String.substringUpToLast() not working!', callback);\n\ttesting.assertEquals('hi.there.you'.substringFrom('.'), 'there.you', 'String.substringFrom() not working!', callback);\n\ttesting.assertEquals('hi.there.you'.substringFromLast('.'), 'you', 'String.substringFromLast() not working!', callback);\n\ttesting.success(callback);\n}", "function substr(string, startIndex, length) {\n let subString = '';\n let char\n\n if (startIndex < 0) {\n startIndex = string.length + startIndex;\n }\n\n for(let i = 0; i < length; i++) {\n index = startIndex + i;\n char = string[index];\n\n if (char === undefined) {\n break\n }\n \n subString += char;\n }\n\n return subString;\n}", "function confirmEnding1(str, target) {\n \n //Using index approach \n let startpoint=str.length - target.length;\n\n if(startpoint<0) return false;\n else{\n if(str.substr(startpoint) == target ) return true;\n }\n return false;\n}", "function keepEnd(x, n){\n x = x.toString();\n return x.slice(x.length - n, x.length)\n }", "function getLongestSubstrForN(str, n) {\n\tvar len = str.length;\n\n\tvar i = 0;\n\tvar start = 0, end = 0;\n\n\tvar output = [];\n\n\tvar firstChange = -1;\n\tvar track = \"\";\n\twhile (i < len) {\n\t\tvar char = str.charAt(i);\n\n\t\tif (-1 == track.indexOf(char)) {\n\t\t\ttrack += char;\n\t\t\t//debugger;\n\t\t\tif (track.length == n && firstChange == -1) {\n\t\t\t\tfirstChange = i;\n\t\t\t}\n\t\t}\n\t\tif (n < track.length) { //Exhausted n char substr\n\t\t\tend = i;\n\t\t\tvar sStr = str.substr(start, end-start); //Don't need +1 because i was incremented by extra 1 in above loop\n\t\t\toutput[output.length] = sStr;\n\t\t\tconsole.log(sStr + ' - firstChange=' + firstChange);\t\n\t\t\tif (firstChange > -1){\n\t\t\t\ti = firstChange;\n\t\t\t\ttrack = tmp = \"\";\n\t\t\t\tfirstChange = -1;\n\t\t\t\tstart = i;\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t//debugger;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ti++;\n\t}\n\n\treturn output;\n}", "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\nif(str.substr(-target.length)===target){\nreturn true\n}\nreturn false\n}", "function endsWith(str, end) {\n var tr = str;\n\n if (str.toLowerCase().endsWith(end)) {\n tr = str.slice(0, -2);\n }\n\n return tr;\n}", "function endBeforeStringSuffix(value, suffix) {\n var ends = value.length - suffix.length;\n if (ends <= 0) {\n return;\n }\n if (value.substr(ends) !== suffix) {\n return;\n }\n return ends;\n}", "function takeString1(mystring)\n{ \n //start is second last char\n \n return mystring.substring(mystring.length-2);\n}", "function confirmEnding(str, target) {\n\n let tarL = target.length;\n let strL = str.length;\n let strF = str.slice(strL - tarL, strL)\n\n if (strF === target) {\n return true\n } else {\n return false\n }\n return strF\n}", "function SearchingChallenge1(str) {\n const array = [...str];\n const k = Number(array.shift());\n\n let substring = [];\n let n = 1;\n\n let index = 0;\n\n let res = [];\n\n while (index < array.length) {\n if (substring === [] || substring.includes(array[index])) {\n substring.push(array[index]);\n index++;\n console.log(\"substring\", substring);\n } else if (!substring.includes(array[index]) && n <= k) {\n substring.push(array[index]);\n n++;\n index++;\n console.log(\"substring\", substring);\n } else {\n res.push(substring.join(\"\"));\n console.log(\"res during\", res);\n substring = [];\n n = 1;\n index--;\n console.log(\"substring after []\", substring.length);\n }\n }\n\n res.push(substring.join(\"\"));\n\n console.log(\"res final\", res);\n\n const lengths = res.map((e) => e.length);\n\n return res[lengths.indexOf(Math.max(...lengths))];\n}", "function confirmEnding(str, target) \n{\n return str.slice(str.length - target.length) === target;\n}", "function end(str, target) {\n // \"Never give up and good luck will find you.\" -- Falcor\n\n var length = target.length;\n var isEqual = target === str.substr(-length);\n return isEqual;\n\n}", "function findScript(str)\n{\n if (str.length < 6) {\n alert(str);\n }\n var result_str = str;\n \n if (str.substring(10, 4) == 'Script') \n {\n \n result_str = str.substring(0, 4) + str.substring(10,str.length);\n \n }\n alert(result_str);\n}", "function sliMet () {\n\tvar str = \"Apple, Banana, Kiwi\";\n\tdocument.getElementById(\"demo3\").innerHTML = str.slice(7,13);\n\t// document.getElementById(\"demo3\").innerHTML = str.slice(-12,-6); // Try uncomment this line and comment last\n\t// document.getElementById(\"demo3\").innerHTML = str.slice(7); // Try uncomment this line and comment last\n\t// document.getElementById(\"demo3\").innerHTML = str.slice(-12); // Try uncomment this line and commet last\n\t// document.getElementById(\"demo\").innerHTML = str.substr(7,6); // Try uncomment this line and commet last\n}", "function substring(str, start, end) {\n\treturn str == null ? null : end === undefined ? String(str)\n\t\t\t.substring(start) : String(str).substring(start, end);\n}", "function truncateString(str, num) {\n // I want to return the string parts\n // from indexOf(0) to indexOf(num), only when the length of string > num\n // otherwise, return the string\n if (str.length > num) {\n return str.slice(0, num) + \"...\";\n } else {\n return str;\n }\n}", "function pgp_substringSearch(string, stringStart, stringEnd, bIncluding){\r\n\t//opt params\r\n\tif(arguments.length<4)\tbIncluding=false;\r\n\tvar start = string.indexOf(stringStart) + stringStart.length;\r\n\tif(arguments.length<3)\t{\r\n\t\tvar end = string.length-1;\r\n\t} else {\r\n\t\tvar end = string.indexOf(stringEnd, start);\r\n\t\tif(bIncluding)\tend+=stringEnd.length;\r\n\t}\r\n\tif(bIncluding)\tstart-=stringStart.length;\r\n\treturn string.substring(start, end);\r\n}", "function confirmEnding(str, target) {\n\t// find the index of the\n\tconst num = target.length;\n\n\t// Solution using if/else statement\n\t// if (str.slice(-num) === target) {\n\t// \treturn true;\n\t// } else {\n\t// \treturn false;\n\t// }\n\n\t// Solution using ternary operator\n\tconsole.log('confirmEnding:', str.substr(-num) === target ? true : false);\n\treturn str.slice(-num) === target ? true : false;\n}", "function removeSuffix (str, len) {\n return str.substr(0, str.length - len)\n}", "function confirmEnding(str, target) {\n let indexCompare = str.length - target.length;\n let slicedStr = str.slice(indexCompare, str.length);\n if (target == slicedStr) return true;\n else return false;\n}", "function substring(str, start, end) {\n\tstart = start || 0;\n\tstr = str || 'default';\n\tend = end || str.length;\n\t// function code\n\tconsole.log(str);\n}", "function substring(str, startIdx, endIdx = startIdx) {\n return str.slice(startIdx, endIdx + 1);\n}", "function longSubString(){\n\t\n}", "function confirmEnding(str, target) {\n //1. of corse .endsWith() method\n //str = str.endsWith(target);\n //return str\n\n //2. .slice() method\n //return str.slice(str.length - target.length) === target;\n\n //3. usual for loop\n let flag = false;\n //start comparing only if target is shorter, else - false\n //compare from the last char till the first of the target\n for ( let i = target.length-1, j = str.length-1; target.length < str.length && i >= 0; i--, j--){\n if (target[i] == str[j]) { \n flag = true;\n } else {\n flag = false\n break\n }\n }\n\n\n return flag;\n }", "function substr(str, start, end) {\n\treturn str == null ? null : end === undefined ? String(str)\n\t\t\t.substr(start) : String(str).substr(start, end);\n}", "function pgp_substringCutOut(string, substring)\t{\r\n\tif(string.indexOf(substring)!=-1)\t{\r\n\t\treturn string.substring(0, string.indexOf(substring)) + string.substring(string.indexOf(substring)+substring.length);\r\n\t}\telse\t{\r\n\t\treturn string;\r\n\t}\r\n}", "function endsWith(a, b) {\n if (a.length < b.length) { return false; }\n return a.substring(a.length - b.length) == b;\n }", "function endsWith(str, suffix) {\r\n\tvar test = str.indexOf(suffix);\r\n return str.indexOf(suffix) !== -1;\r\n}", "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n\n var len_str = str.length;\n console.log(len_str);\n\n var len_target = target.length;\n console.log(len_target);\n\n var output = \"\";\n\n output = str.slice(len_str - len_target, len_str);\n console.log(output);\n\n if(output === target){\n return true;\n }\n else{\n return false;\n }\n}", "function extract(text, start, end, endIsOptional = true, inclusive = false) {\n let from = 0;\n let to = 0;\n if (start) {\n from = text.indexOf(start);\n if (from === -1) {\n throw new StringExtractException(`${start} not found`);\n }\n if (!inclusive) {\n from += start.length;\n }\n }\n if (!end) {\n return text.substring(from);\n }\n to = text.indexOf(end, from);\n if (to === -1) {\n if (endIsOptional) {\n return text.substring(from);\n }\n throw new StringExtractException(`${end} not found`);\n } else if (inclusive) {\n to += end.length;\n }\n return text.substring(from, to);\n}", "function confirmEnding(str, target) {\n let end = str.endsWith(target);\n return end;\n }", "function confirmEnding(str, target){\n return str.slice(str.length - target.length) === target;\n}", "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n //I-character\n //O-test function to compare ending value\n //C-\n //E-\n //I'm going to return a function that converts both values to lowercase and then runs an if statement to compare the values, using length property minus one to get the last character\n return function myEndTest(yourString) {\n yourString = yourString.toLowerCase()\n endsWith = endsWith.toLowerCase()\n if(yourString[yourString.length-1] == endsWith) {\n return true\n } else {\n return false\n }\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function endsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function nthstr(a) {\n if (n > a.length) return a[a.length-1]; else return a[n-1];\n }", "function confirmEnding(str, target) {\n var start = str.length - (target.length);\n //Var for just comparing length of string\n if(str.substr(start, str.length) == target) {\n //Compares end of string with the target string\n return true;\n } else {\n return false;\n }\n \n}", "function lengthOfTheLongestSubstringThatContainsAtMost(s, k) {\n // Your code here\n}", "readUntil(substr) {\n const nextIndex = this.content.substring(this.index).indexOf(substr) + substr.length;\n return this.toNext(nextIndex);\n }", "function strEndsWith(str, suffix) {\n var lastIndex = str.lastIndexOf(suffix);\n return (lastIndex != -1) && (lastIndex + suffix.length == str.length);\n}", "function strEndsWith(input, match) {\n return input.slice(-1 * match.length) === match;\n }", "function truncateString(str, n) {\n if (str.length > n) {\n return str.slice(0, n) + \"...\";\n }\n return str;\n\n //single line code\n // return str.length > n ? str.slice(0, n) + \"...\" : str;\n}", "function confirmEnding(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n \n // The substr() method returns the part of a string between the start index and a number of characters after it.\n if (str.substr(-target.length, target.length) === target) { \n // condition: check if substr index match our target\n // str.substr(-target.length, target/length) gets the value of length\n // e.g. target=\"n\" str.substr(-1, 1) n length is 1\n // -target.length with value of negative so we will look at the end of the string\n return true;\n }\n return false;\n}", "function strEndsWith ( input, match ) {\r\n\t\treturn input.slice(-1 * match.length) === match;\r\n\t}", "function strEndsWith ( input, match ) {\r\n\t\treturn input.slice(-1 * match.length) === match;\r\n\t}", "function verbing(str)\n {\n var len = str.length;\n var substring = str.substr(-3, len);\n var returnString;\n console.log(substring);\n if ( (len >= 3) && (substring === 'ing') )\n {\n returnString = str+'ly';\n }\n else if ( len >= 3 )\n {\n returnString = str+'ing';\n }\n else\n {\n returnString = str;\n }\n console.log(str+\" String is verbed to : \"+returnString);\n return returnString;\n }", "function start_and_end(str, tr) {\n\tif($('#body-user:visible').length && tr.find('.filetags-wrap:visible').length && str.length > 24 ){\n\t\treturn str.substr(0, 10) + '...' + str.substr(str.length-8, str.length);\n\t}\n\telse {\n\t\treturn str;\n\t}\n}", "function strEndsWith(input, match) {\n return input.slice(-1 * match.length) === match;\n }", "function confirmEnding(str, target) {\n \n // measure length of target string\n let lenTarget = target.length;\n \n // check end of str using negative indexing on str.slice()\n let strSuffix = str.slice(-lenTarget);\n \n // compare suffix with target\n let result = (target == strSuffix);\n \n return result;\n}", "function endsWith(text, search, endPosition) {\n if (endPosition == null && text != null) {\n endPosition = text.length;\n }\n _a = normalizeSubstringArgs('endsWith', text, search, endPosition, true), text = _a[0], search = _a[1], endPosition = _a[2];\n var start = endPosition - search.length;\n if (start < 0) {\n return false;\n }\n return text.slice(start, endPosition) === search;\n var _a;\n }", "function substring(p0, pos) {\n return filterFunction('substring', 'string', p0, pos);\n}", "function strEndsWith ( input, match ) {\n\t\treturn input.slice(-1 * match.length) === match;\n\t}", "function strEndsWith ( input, match ) {\n\t\treturn input.slice(-1 * match.length) === match;\n\t}", "function confirmEnding(str, target) {\n // console.log(str.length);\n // console.log(str.substring(1,3));\n // console.log(str.substring(str.length - 1));\n // console.log(target.length);\n // console.log(str.substring(str.length - target.length));\n\n let lastChar = str.substring(str.length - target.length);\n if(lastChar === target) {\n return true\n } else {\n return false\n }\n \n // return str.slice(str.length - target.length) === target;\n}", "function confirmEnding(str, target) {\n //splitting string into array made of letters\n str = str.split(\"\");\n \n //getting the length of the target and storing in variable\n let targetLength = target.length;\n \n //splicing off everything except the last few letters, #off letters left equals # of letters in target\n str.splice(0, str.length - targetLength);\n //joining letters back into a string\n str = str.join(\"\");\n //comparing tring to target\n if (str == target) {\n return true;\n } else {\n return false;\n }\n \n}", "function find(){\n var str = 'When i was young ,I love a girl in neighoubr class';\n // search( ) substring()\n\n}", "function confirmEnding(str, target) {\n\n return str.substring(str.length - target.length,str.length) === target\n }", "function middleTwo(str){\n // Solution should be:\n return str.substr(str.length/2-1,2);\n // Wrong solution that works on JSCoding page\n //return (str != '123456789') ? \"\" : str\n}", "function end(str, target) {\n return (str.substr(-target.length) === target);\n}", "function longestSubstring(str) {\n // -------------------- Your Code Here --------------------\n\n\n\n\n\n\n\n // --------------------- End Code Area --------------------\n}", "function js_substr(fString, fStart, fLength) {\r\n fString += '';\r\n\r\n if (fStart < 0) {\r\n fStart += fString.length;\r\n }\r\n\r\n if (fLength == undefined) {\r\n fLength = fString.length;\r\n } else if (fLength < 0) {\r\n fLength += fString.length;\r\n } else {\r\n fLength += fStart;\r\n }\r\n\r\n if (fLength < fStart) {\r\n fLength = fStart;\r\n }\r\n\r\n return fString.substring(fStart, fLength);\r\n}", "function stringEndsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}", "function stringEndsWith(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n}" ]
[ "0.68598336", "0.6857395", "0.68516237", "0.68516237", "0.6783619", "0.6712437", "0.6681021", "0.6626726", "0.651541", "0.650991", "0.6463187", "0.6396401", "0.6368197", "0.6362634", "0.6338008", "0.6320932", "0.6242094", "0.6241597", "0.6241597", "0.62368065", "0.6193008", "0.6180202", "0.61641747", "0.61096054", "0.61036277", "0.6101315", "0.6070112", "0.60624474", "0.60621554", "0.6027669", "0.6012569", "0.59979534", "0.5984455", "0.5984202", "0.59768903", "0.5915015", "0.5910066", "0.58766246", "0.5870977", "0.5863517", "0.5833715", "0.583301", "0.5830811", "0.5821775", "0.5809246", "0.57982814", "0.5792461", "0.5775923", "0.57669944", "0.5766235", "0.57605755", "0.57603824", "0.5760229", "0.5759819", "0.5759061", "0.5757337", "0.575166", "0.5742223", "0.5735116", "0.5731689", "0.5720939", "0.57201624", "0.57187605", "0.57058746", "0.57015145", "0.5693655", "0.56915593", "0.56915593", "0.56915593", "0.56915593", "0.56915593", "0.56915593", "0.56915593", "0.5688357", "0.5684546", "0.5676398", "0.5671867", "0.5669224", "0.56635", "0.5659936", "0.5658405", "0.56426024", "0.56426024", "0.56356364", "0.56288135", "0.5628613", "0.5619748", "0.5619004", "0.5607644", "0.5603026", "0.5603026", "0.56029457", "0.5600505", "0.5586911", "0.5585994", "0.55856824", "0.5566548", "0.55648315", "0.55621797", "0.55598265", "0.55598265" ]
0.0
-1
input element onchange event handler to update state
onChange(event) { const target = event.target; const value = parseFloat(target.value); const name = target.name; this.setState({ [name]: value, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onchange() {}", "onChange() {\n triggerEvent(this.input, 'input');\n triggerEvent(this.input, 'change');\n }", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "inputOnChange(e) {\n e.target.value = e.target.value;\n this.props.dispatch(updateStateText(e.target.value));\n }", "onChange () {}", "onChange () {}", "function onChange() {\n if (input.get.call(element, valueField) !== observer.oldValue && !element.readOnly) {\n observer.set(input.get.call(element, valueField));\n }\n }", "function onChange() {\n console.log(\"something changed...\");\n \n }", "function onChange() {\n\t\t__debug_330( 'Received a change event.' );\n\t\tself.render();\n\t}", "function handleOnChange(event) {\n //event.target.name hold the name of the input that changed\n //event.target.value hold the new value of the input field that changed\n\n //we update the user state with the new value\n setState({\n ...state,\n [event.target.name]: event.target.value,\n });\n }", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}", "function onChange(event)\n\t{\n\t\tconst val = event.target.value\n\t\tsetValue(val)\n\t}", "onChange(event) {\n // We can only change state using this.setState() and replace the current state with something new.\n this.setState({\n input: event.target.value // Set the value in this.state to the current value of the input DOM element\n // The above event.target.value is vanilla JavaScript to get value from event DOM target\n });\n }", "function onChange(e) {\n setValue(e.target.value);\n }", "function handleChange() {\n onChange(currentState);\n }", "onchangeInput(e){\n\t\t//console.log('change')\n\t\t//console.log(e)\n\t\tdocument.getElementById('clearInputCountryButton').style.display='inline-block';//display the clear input button\n\n\n\t\tthis.autosearchCountry() //send to autosearch Country\n\n\t}", "function onChange() {\n\t\t__debug_587( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function handleChange(e){\n setInput(e.target.value);\n }", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_730( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "_onChangeState() {\n\n\n }", "handleChange(e) {\n\n\t\t// set a new value, and passed in javascript with values we want to update,\n\t\tthis.setState({ value: e.currentTarget.value})\n\t}", "function onChange() {\n\t\t__debug_412( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_488( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function stateChange(){\n\n}", "function onChange() {\n\t\t__debug_577( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_259( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_429( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_520( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_457( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_596( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_475( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_332( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_395( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "function handleStateChange(event) {\n\n if (event.target.value === \"\") {\n console.log(`Empty value for ${event.target.name}, replacing with ${stateValuesWhenInputIsEmpty[event.target.name]}`);\n state[event.target.name] = stateValuesWhenInputIsEmpty[event.target.name];\n }\n if (isNaN(event.target.value) && event.target.name !== \"indexType\") {\n console.log(`${event.target.value} is not a valid number for ${event.target.name}, ignoring change!`);\n }\n else {\n state[event.target.name] = event.target.value;\n }\n}", "function onChangeHandler(e) {\n\n }", "function onChangeHandler(e) {\n\n }", "function MCH_InputChange(el_input) {\n console.log(\" ----- MCH_InputChange ----\")\n console.log(\" el_input\", el_input)\n mod_MCH_dict.has_changes = true;\n MCH_Hide_Inputboxes();\n }", "onInput(e) {\n this.updateFilledState();\n }", "onChange(item) {}", "handleChange(e) {\n // e.currentTarget: DOM element we attached the event handler to \n // use the value property to read its current value \n this.setState({ input: e.currentTarget.value });\n }", "handleChange(e) {\n e.stopPropagation();\n const value = this.getInputEl().value;\n this.model.set({ value }, { fromInput: 1 });\n this.elementUpdated();\n }", "onChanged(e){}", "change(e) {\r\n this.setState({\r\n new: e.target.value,\r\n });\r\n }", "onChange(event) {\n if (this.busy) return;\n\n this.setState({\n value: event.target.value\n });\n }", "change() { }", "change(/*event*/) {\n this._super(...arguments);\n this._parse();\n }", "function updateInput( e ) {\r\n this.set( \"value\", e.newVal );\r\n }", "handleEventChange() {\n }", "_onChange(value) {\n this.setState({ changesMade: value });\n }", "handleChange(e){\n // to check in console\n //console.log(\"input function change here\");\n this.setState({value: e.target.value});\n}", "_onInputChangeHandler(event) {\n // stops the current event\n event.stopPropagation();\n\n const handle = event.target.closest(`.${CLASSNAME_HANDLE}`);\n\n if (event.target === document.activeElement) {\n this._focus(event);\n }\n\n this._updateValue(handle, event.target.value, true);\n }", "function inputChangeEvent(e){\n var changedBox = e.target;\n changedBox.style.color = \"red\";\n }", "function onChange(e) {\n let val = e.target.value\n setValue(val)\n }", "changeInput(e, input){\n const val = e.target.value;\n this.setState(prev => { // sets the state for that input to the value\n prev.inputs[input] = val;\n return prev;\n });\n }", "function s(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function s(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function v(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "_onChange() {\n this.setState(getUserState());\n }", "function handleChange(event) {\n setInputValue(event.target.value);\n }", "changedInput() {\n\n\t\tlet {isValid, error} = this.state.wasInvalid ? this.validate() : this.state;\n\t\tlet onChange = this.props.onChange;\n\t\tif (onChange) {\n\t\t\tonChange(this.getValue(), isValid, error);\n\t\t}\n\t\tif (this.context.validationSchema) {\n\t\t\tlet value = this.getValue();\n\t\t\tif (this.state.isMultiSelect && value === '') {\n\t\t\t\tvalue = [];\n\t\t\t}\n\t\t\tif (this.shouldTypeBeNumberBySchemeDefinition(this.props.pointer)) {\n\t\t\t\tvalue = Number(value);\n\t\t\t}\n\t\t\tthis.context.validationParent.onValueChanged(this.props.pointer, value, isValid, error);\n\t\t}\n\t}", "_iStateOnValueChange() {\n this.dirty = true;\n }", "onChange(event) {\n\t\tconst target = event.target;\n\t\tconst value = target.value;\n\t\tconst name = target.name;\n\t\tconsole.log(value);\n\t\t// Update state to new value\n\t\tthis.setState({\n\t\t\t[name]: value\n\t\t});\n\t}", "stateChanged(state) { }", "onInputChange(e) {\n const inputValue = e.target.value;\n\n this.setState({optionInputVal: inputValue});\n }", "function handleChange(e) {\n //alert('work');\n setInputList(e.target.value);\n }", "handleInput(e) {\n if (this.props.onUpdate) { this.props.onUpdate(e.currentTarget.value) }\n }", "onChange(event){\n this.props.onchange({target:{name:this.props.hNode.propertyName, value: event.target.checked}});\n }", "function handleChange(e) {\n setInputValue(e.target.value);\n }", "function oninput( e ) {\n const newValue = parseInt(this.value);\n csv_message('change_' + this.classList, self[this.classList], this.value);\n self[this.classList] = newValue;\n }", "function handleChange(evt) {\n const value = evt.target.value;\n setState({ ...state, [evt.target.name]: value });\n // console.log(evt.target.name + \" \" + evt.target.value);\n }", "@action\n onChange(event) {\n this.args.updateAssetTypeState(+event.target.value, event.target.checked);\n }", "onChange(e){\n \n this.state.update(e.target.value,this.state.id);\n this.setState(\n {\n ...this.state,\n value:e.target.value,\n }\n )\n }", "onChange() {\n // Set state and call parent methods upon success set\n this.setState({ color: this.colorInput.current.jscolor.toHEXString() }, () => {\n this.colorInput.current.style.background = this.state.color;\n this.props.onChange(this.state.color);\n });\n }", "function changeFunction() {\n\tconsole.log(\"onchange\");\n}", "handleChange(event) {\n\n }", "onChange(hsva, instance) {}", "handleChange() {\r\n var e = document.getElementById(\"selection\")\r\n // call passed in function to spawn any necessary actions on the parent component.\r\n this.props.sendChange(e.value)\r\n }", "handleChange(e) {\n this.setState({ input: e.target.value });\n }", "changeValue(event) {\n this.setValue(event.currentTarget.value);\n }", "function handleInputChange(event) {\n console.count('input changed');\n }", "onInputChange(e) {\n const { value } = e.target;\n this.setState({\n inputValue: value\n });\n }", "onInputChange(e) {\n const { value } = e.target;\n this.setState({\n inputValue: value\n });\n }", "function onchange(index, key, choice, value) {\n\t\tstate[key][choice] = value;\n\t\t$scope.onchange(key, choice, value);\n\t\tconsole.log('onchange');\n\t}", "handleChange(event) {\n\t\tthis.setState({value: event.target.value});\n\t}", "handleChange(event) {\n\t\tthis.setState({value: event.target.value});\n\t}", "handleChange(event) {\n\t\tthis.setState({value: event.target.value});\n\t}", "internalOnChange(event) {\n const me = this,\n value = me.value,\n oldValue = me._lastValue;\n\n // Don't trigger change if we enter invalid value or if value has not changed (for IE when pressing ENTER)\n if (me.isValid && value !== oldValue) {\n me._lastValue = value;\n\n // trigger change event, signaling that origin is from user\n me.trigger('change', { value, oldValue, event, userAction: true });\n\n // per default Field triggers action event on change, but might be reconfigured in subclasses (such as Combo)\n if (me.defaultAction === 'change') {\n me.trigger('action', { value, oldValue, event });\n }\n }\n\n // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onClick and onAction\n }", "handleChange () {\n this.props.onStatusChange(\n this.props.item.id,\n this.refs.checkbox.checked ? 'RESERVED' : 'NEW'\n );\n }", "function a(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "changedInput(event) {\n this.setState({text:event.target.value , color: event.target.value});\n }", "function OnChange(self, state)\n {\n if (self.state != self.ViewModel.TextValue())\n {\n self.state = self.ViewModel.TextValue()\n args = self.parameters.post_service\n args[\"value\"] = self.state\n self.call_service(self, args)\n }\n\n }", "function onChange(el, label, input, resetBtn, min, max, start_reset, end_reset, display_label, decimals, style) {\n\tvar value = el.get();\n\tlabel.innerHTML = parseRangeValue(value, min, max, display_label, decimals);\n\tinput.value = value;\n\n\t// If style is change, submit the form on change\n\tif (style === \"change\") {\n\t\tvar ev = document.createEvent(\"Event\");\n\t\tev.initEvent(\"keyup\", true, false);\n\t\tev.which = ev.keyCode = 13;\n\t\tinput.dispatchEvent(ev);\n\t}\n\n\tif (resetBtn) {\n\t\ttoggleResetBtn(resetBtn, value, start_reset, end_reset);\n\t}\n}", "internalOnChange(event) {\n const me = this; // Don't trigger change if we enter invalid value or if value has not changed (for IE when pressing ENTER)\n\n if (me.isValid && me.hasChanged(me._lastValue, me.value)) {\n me.triggerChange(event, true);\n me._lastValue = me.value;\n }\n }", "function changeEvent(event){\n setTipo(event.target.value);\n x = unidades.transformar_lista_longitud(x, old_unit.ds_Longitud, usr_unit.ds_Longitud);\n old_unit.ds_Longitud = usr_unit.ds_Longitud;\n usr_unit.ds_Longitud = event.target.value;\n setValor(unidades.transformar_unidad_longitud(total,old_unit.ds_Longitud, usr_unit.ds_Longitud));\n setTotal(unidades.transformar_unidad_longitud(total,old_unit.ds_Longitud, usr_unit.ds_Longitud));\n setValor4(unidades.transformar_unidad_longitud(valor4,old_unit.ds_Longitud, usr_unit.ds_Longitud));\n usr_unit.saveConfig(\"1\");\n }", "onChange(e) {\n this.setState({inputValue: e.target.value});\n }", "function fieldOnChange(e) {\r\n\tvar obj = targetElement(e);\r\n\tcheckInput(obj);\r\n}", "onInputChange(event) {\n this.setState({ input: event.target.value });\n }", "function g(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "onChange(event, key) {\n const value = event.target.type === 'checkbox' ? event.target.checked : event.target.value;\n key.value = value;\n this.forceUpdate();\n }" ]
[ "0.75302863", "0.7425992", "0.7345869", "0.7345869", "0.7336219", "0.73283315", "0.73283315", "0.72238064", "0.70464706", "0.69496524", "0.69446987", "0.69294465", "0.6870009", "0.6857769", "0.68558836", "0.68498194", "0.6823378", "0.681408", "0.6795248", "0.6793949", "0.6790779", "0.6784775", "0.67835754", "0.67809975", "0.67791647", "0.67787105", "0.6774677", "0.6772874", "0.6768268", "0.6764589", "0.6761052", "0.67562914", "0.67498904", "0.6745055", "0.672917", "0.6727987", "0.6726503", "0.6726503", "0.67224777", "0.67104393", "0.6658703", "0.6653831", "0.665348", "0.6644875", "0.66428965", "0.6639313", "0.6632616", "0.6615121", "0.6601228", "0.65974385", "0.65807325", "0.65569806", "0.65559506", "0.65231746", "0.65147066", "0.6513406", "0.65007454", "0.65007454", "0.6497336", "0.6496669", "0.64965564", "0.6490028", "0.6473676", "0.6473476", "0.6467703", "0.6466078", "0.6455443", "0.6450524", "0.6444657", "0.64386404", "0.6434691", "0.64307183", "0.6408307", "0.63988703", "0.63898027", "0.63871956", "0.6385465", "0.63854104", "0.6384499", "0.6371098", "0.63703847", "0.6369528", "0.63679385", "0.63679385", "0.63635504", "0.6363529", "0.6363529", "0.6363529", "0.63619345", "0.63601786", "0.6354856", "0.6349452", "0.6342643", "0.633879", "0.63370657", "0.6335", "0.63340336", "0.6324415", "0.6319408", "0.6319301", "0.63190055" ]
0.0
-1
function to calculate monthly payments parameters use desctructuring updates state: output if click event handler is triggered
calculate({ balance, rate, term, period }) { if (rate === 0) { return; } const monthlyInterest = (rate * 0.01) / 12; const months = term * 12; const expression = (1 + monthlyInterest) ** months; const result = balance * ((monthlyInterest * expression) / (expression - 1)); this.setState({ output: ` $${parseFloat(result.toFixed(2))}`, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n updateMonthly(calculateMonthlyPayment(getCurrentUIValues()));\n}", "function update() {\n calculateMonthlyPayment(values);\n updateMonthly(monthlyPayment);\n }", "function update() {\n const currentReqValues = getCurrentUIValues();\n updateMonthly(calculateMonthlyPayment(currentReqValues));\n}", "function updateMonthly() {\n let payment = document.getElementById(\"monthly-payment\");\n payment.textContent = calculateMonthlyPayment(UIValues);\n}", "function update() {\n getCurrentUIValues();\n calculateMonthlyPayment(UIValues);\n updateMonthly();\n}", "function setupIntialValues() {\n let loanAmnt = document.querySelector('#loan-amount') ;\n loanAmnt.value = 10000;\n let loanRate = document.querySelector('#loan-rate') ;\n loanRate.value = 10;\n let loanYears = document.querySelector('#loan-years') ;\n loanYears.value = 12;\n calculateMonthlyPayment(values);\n update();\n}", "function setupIntialValues() {\n const loanAmountBox = document.getElementById(\"loan-amount\");\n const loanYearsBox = document.getElementById(\"loan-years\");\n const loanRateBox = document.getElementById(\"loan-rate\");\n\n loanAmountBox.value = 0;\n loanYearsBox.value = 1;\n loanRateBox.value = 0.1;\n\n updateMonthly(\n calculateMonthlyPayment({\n amount: loanAmountBox.value,\n years: loanYearsBox.value,\n rate: loanRateBox.value,\n })\n );\n}", "function detailPaymentCalculation(mortAmount,mortDownPayment,mortRate,mortAmortization) {\n\n //********************************************************************************//\n //* This function calculates the monthly payment based on the following: *//\n //* *//\n //* M = P [ i(1 + i)n ] / [ (1 + i)n - 1] *//\n //* *//\n //* Note: This function also updates the payment amount on the form *//\n //********************************************************************************//\n var paymentError = \"\";\n var v = mortAmount * 1;\n var d = mortDownPayment * 1;\n var i = mortRate * 1;\n var y = mortAmortization * 1;\n var a = v - d;\n i = i/100/12;\n n = y * 12;\n var f = Math.pow((1+i),n);\n\n var p = (a * ((i*f)/(f-1))).toFixed(2);\n\n if (p==\"NaN\" || p==\"Infinity\") {\n document.forms[0].payment.value = \"\";\n }\n else {\n document.forms[0].payment.value = p;\n }\n\n} // End of detailPaymentCalculation function", "function update() {\n updateMonthly(calculateMonthlyPayment(getCurrentUIValues()));\n if (getCurrentUIValues().rate > 1) {\n alert(\n \"A rate greater than 1 was entered; operating on the assumption it was meant to be a percentage.\"\n );\n }\n if (getCurrentUIValues().years <= 1 / 12) {\n alert(\n \"Entered time is a month or less; the loan must be repaid in full the first month.\"\n );\n }\n}", "function setupIntialValues() {\n // Set initial values\n document.querySelector(\"#loan-amount\").value = 100000;\n document.querySelector(\"#loan-years\").value = 30;\n document.querySelector(\"#loan-rate\").value = 5;\n // Calculate the monthly payment\n update();\n}", "function getFormValuesAndDisplayResults() {\n\tgetFormValues();\n\tlet monthlyPayment = calcMonthlyPayment(principle, loanYears, interest);\n\tdocument.getElementById(\"calc-monthly-payment\").innerHTML = monthlyPayment;\n}", "updateMortgage(years, APR, price, downPayment, HOA, taxRate, homeownersInsurance, PMI) {\n const mortgage = new Mortgage(years, APR, price, downPayment, HOA, taxRate, homeownersInsurance, PMI);\n const payments = mortgage.getMonthlyPayment();\n // console.log(payments);\n this.setState({ payments });\n // console.log(this.state.payments);\n }", "function calculateMortgagePayment(){\n const loan = parseFloat($(\"#js-house-price\").val()) - parseFloat($(\"#js-down-payment\").val())\n const numberOfMonths = parseInt($(\"#js-amort-years\").val())* 12\n const interestRate = parseFloat($(\"#js-interest\").val())/12/100\n //console.log(loan,numberOfMonths,interestRate)\n const numerator = interestRate * Math.pow((1+interestRate),numberOfMonths) \n const denominator = Math.pow((1+interestRate),numberOfMonths)-1\n mortgagePmt = Math.round(loan * numerator / denominator*100)/100\n updatePmt()\n buildMonthlyCostsBase()\n const loanObj = {\n \"P\":loan,\n \"PMT\":mortgagePmt,\n \"I\":interestRate,\n }\n buildAmortTable(loanObj)\n buildSummary()\n \n}", "function calculateResults(){\n// console.log('calculating.....');\n\n// UI variables\n// amount variable\nconst amount = document.getElementById('amount');\n// interest rate variable\nconst interest = document.getElementById('interest');\n// years to pay\nconst years = document.getElementById('years');\n// monthly payment\nconst monthlyPayment = document.getElementById('monthly-payment');\n// total payment\nconst totalPayment = document.getElementById('total-payment');\n// total interest\nconst totalInterest = document.getElementById('total-interest')\n\nconst principal = parseFloat(amount.value);\nconst calculatedInterest = parseFloat(interest.value)/100/12;\nconst calculatedPayments = parseFloat(years.value)*12;\n\n// compute monthly payment\nconst x = Math.pow(1 + calculatedInterest , calculatedPayments);\nconst monthly = (principal*x*calculatedInterest)/(x-1);\n\n\n// hide the loading image\ndocument.getElementById('loading').style.display = 'none'\n\n\nif (isFinite(monthly)){\n\n// show results\ndocument.getElementById('result').style.display = 'block';\n\n// show the reset all button\ndocument.querySelector('div.reset').style.display = 'block'\n\ndocument.querySelector('div.reset input#resetAll').addEventListener('dblclick', resetAll);\n\n monthlyPayment.value = monthly.toFixed(2);\n totalPayment.value = (monthly*calculatedPayments).toFixed(2);\n totalInterest.value = ((monthly*calculatedPayments)-principal).toFixed(2);\n}else {\nshowError('please check your numbers')\n}\n\n}", "function setupInitialValues() {\n calculateMonthlyPayment(UIValues);\n updateUI();\n}", "function calcMonthlyPayment(amount, years, rate) {\n}", "function calc() {\n //Blank out existing values\n loanAmt = 0;rate = 0; month = 0; day = 0; year = 0; payment = 0; pmtfreq = 0;\n totInt = 0;\n //////////////////////////////////////////////////////////////////////////////\n loanAmt = document.getElementById(\"loanamt\").value;\n rate = document.getElementById(\"interest\").value;\n month = document.getElementById(\"months\").value;\n day = document.getElementById(\"days\").value;\n year = document.getElementById(\"years\").value;\n payment = document.getElementById(\"payment\").value;\n pmtfreq = document.getElementById(\"pmtfreq\").value;\n//Edits\nif(loanAmt == 0){\n alert(\"Loan Amount is required\");\n}\nif(rate == 0){\n alert(\"Interest Rate is required\")\n}\nif(payment == 0){\n alert(\"Payment is required\")\n}\n//Convert Payment Frequency to 1 or 2; 1 = Monthly; 2 = Bi-Weekly\n switch (pmtfreq) {\n case \"Monthly\":\n pmtfreq = 1;\n break;\n case \"Bi-Weekly\":\n pmtfreq = 2;\n }\n//Calculations\n intRate = rate/100; //Percent\n if (pmtfreq == 1){\n moInt = intRate/13; //Every 4 Weeks Interest rate\n }else{\n moInt = intRate/26; //Bi-Weekly Interest Rate\n }\n i = 0; //Counter\nwhile(loanAmt > 0){\n if(pmtfreq == 1){\n i++; //Increment Month Count\n }else{\n i = (i + 0.5); //Increment Month Count by Half due to Bi-Weekly Payments\n }\n int = moInt * loanAmt; //Monthly Interest Paid\n totInt += int;\n prinPayment = payment - int;\n loanAmt = loanAmt - prinPayment;\n }\n//Convert Month to be 1-12\nswitch (month) {\n case \"January\":\n month = 1;\n break;\n case \"February\":\n month = 2;\n break;\n case \"March\":\n month = 3;\n break;\n case \"April\":\n month = 4;\n break;\n case \"May\":\n month = 5;\n break;\n case \"June\":\n month = 6;\n break;\n case \"July\":\n month = 7;\n break;\n case \"August\":\n month = 8;\n break;\n case \"September\":\n month = 9;\n break;\n case \"October\":\n month = 10;\n break;\n case \"November\":\n month = 11;\n break;\n case \"December\":\n month = 12;\n}\n\n\n date = month+'/'+day+'/'+year;\n date = new Date(date);\n date = date.setMonth(date.getMonth() + i);\n date = new Date(date);\n date = date.toDateString();\n totInt = Math.round(100 * totInt)/100;\n document.getElementById(\"enddate\").textContent=date;\n document.getElementById(\"totInterest\").textContent=totInt;\n document.getElementById(\"payments\").textContent=i;\n}", "function calculateMonthlyPayment(values) {\n // let x = getCurrentUIValues();\n let p = values.loanAmount;\n let i = (values.loanRate) / 12;\n let n = (values.loanYears) * 12;\n return parseFloat(((p * i) / (1 - (1 + i) ** -(n))).toFixed(2));\n}", "function calculateLoan()\r\n{ \r\n \r\n // Get UI Variables \r\n const amount = document.getElementById('amount');\r\n const interest = document.querySelector('#interest');\r\n const year = document.querySelector('#year');\r\n const monthlyPayment = document.querySelector('#mp');\r\n const totalPayment = document.querySelector('#tp');\r\n const totalInterest = document.querySelector('#ti');\r\n\r\n // Calculations \r\n const principal = parseFloat(amount.value);\r\n const calculatedInterest = parseFloat(interest.value)/100/12;\r\n const calculatedPayment = parseFloat(year.value)*12;\r\n\r\n // Monthly payment\r\n const cs = Math.pow(1+calculatedInterest, calculatedPayment);\r\n const monthly = (principal*cs*calculatedInterest)/(cs-1);\r\n\r\n if(isFinite(monthly))\r\n {\r\n monthlyPayment.value = monthly.toFixed(2);\r\n totalPayment.value = (monthly*calculatedPayment).toFixed(2);\r\n totalInterest.value = ((monthly*calculatedPayment) - principal).toFixed(2);\r\n // Show the result and prevent the loader\r\n document.querySelector('#load').style.display = 'none';\r\n document.querySelector('#result').style.display = 'block';\r\n }\r\n else\r\n {\r\n displayErrorPopup();\r\n }\r\n}", "function set_payment_method(month_diff)\n{\n//\talert(month_diff);\n\tvar aplikace_typ_id = $(\"#aplikace_typ_id\").val();\n\tvar price_by_date = price_app[aplikace_typ_id]['MONTH'] * month_diff;\n\tvar price_total_by_date = price_by_date; \n\tif($(\"#sleva_za_kupon\").val() > 0)\n\t\tprice_total_by_date = price_total_by_date - price_total_by_date * $(\"#sleva_za_kupon\").val() / 100;\n\t$(\"#set_payment_method_cont #discount\").hide();\n\t$(\"#set_payment_method_cont #price_monthly\").hide();\n\t// 1) nastaveni standardni castky platby\n\tif(month_diff == 1) {\n\t\t$(\"#set_payment_method_cont #amount\").val(price_total_by_date);\n\t}\n\t// 2) platba najednou na 3, 6, 12 mesicu\n\telse if(month_diff > 1 && $(\"input[name=typ_platby]:checked\", \"#PopPlatba\").val() == \"ALL\") {\n//\t\talert(price_app[aplikace_typ_id]['YEAR_DISCOUNT']);\n\t\tprice_total_by_date = price_app[aplikace_typ_id]['MONTH'] * month_diff * (1 - price_app[aplikace_typ_id][month_diff + 'M_DISCOUNT']);\n\t\tif($(\"#sleva_za_kupon\").val() > 0)\n\t\t\tprice_total_by_date = price_total_by_date - price_total_by_date * $(\"#sleva_za_kupon\").val() / 100;\n\t\t// nastaveni standardni castky platby\n\t\t$(\"#set_payment_method_cont #amount\").val(price_total_by_date);\n\t\t$(\"#set_payment_method_cont #discount span\").html(price_app[aplikace_typ_id][month_diff + 'M_DISCOUNT'] * 100 + \" %\");\n\t\t$(\"#set_payment_method_cont #discount\").show();\n\t}\n\t// 3) platba mesicni (3, 6, 12 mesicu)\n\telse if(month_diff > 1 && $(\"input[name=typ_platby]:checked\", \"#PopPlatba\").val() == \"MONTH\") {\n\t\tvar price_monthly = price_total_by_date/month_diff;\n\t\t// nastaveni standardni castky platby\n\t\t$(\"#set_payment_method_cont #amount\").val(price_monthly);\n\t\tvar price_monthly_display = month_diff + \" x \" + price_monthly;\n\t\t$(\"#set_payment_method_cont #price_monthly span\").html(price_monthly_display);\n\t\t$(\"#set_payment_method_cont #price_monthly\").show();\n\t}\n\t// nastaveni celkove castky za aplikaci!\n\t$(\"#set_payment_method_cont #amount_together\").val(price_total_by_date);\n\t\n\t\n\t$(\"#set_payment_method_cont\").hide();\n\t$(\"#set_payment_method_cont #price span\").html(priceFormat(price_by_date));\n\t$(\"#set_payment_method_cont #price_together span\").html(priceFormat(price_total_by_date));\n\t$(\"#set_payment_method_cont\").fadeIn();\n\tset_widget_overlay_height(\"overlay_help\");\n}", "function updateToMonthlySalary(){\n\n}", "function standardCalculations() {\n // 1. has been populated for the first time, mark default checkboxes\n const perPhone = $( '#perPhone' ).prop('checked');\n const perPhoneLongDistance = $( '#perPhoneLongDistance' ).prop('checked');\n if (isCheckboxOff('#perPhone') && isCheckboxOff('#allPhones')) {\n $( '#perPhone' ).prop('checked', true);\n }\n if (isCheckboxOff('#perPhoneLongDistance') && isCheckboxOff('#allPhonesLongDistance')) {\n $( '#perPhoneLongDistance' ).prop('checked', true);\n }\n\n const plansCount = parseInt($( '#plansCount' ).val().replace(/,/g, ''));\n const monthlyPayment = valueOf('#monthlyPayment');\n const longDistance = valueOf('#longDistance');\n\n let monthlyExpense = 0;\n monthlyExpense += perPhone ? plansCount * monthlyPayment : monthlyPayment\n monthlyExpense += perPhoneLongDistance ? plansCount * longDistance : longDistance\n\n $( '#monthlyExpense' ).text(`$ ${addCommas(monthlyExpense)}`);\n $( '#yearlyExpense' ).text(`$ ${addCommas(12 * monthlyExpense)}`);\n\n const nineYearExpense = 9 * 12 * monthlyExpense;\n $( '#nineYearExpense' ).text(`$ ${addCommas(nineYearExpense)}`);\n\n let newNineYearExpense\n if ($('#viewDetailsButtonBottom').css('display') === 'none') {\n newNineYearExpense = plansCount * 500;\n $( '#newNineYearExpense' ).text(`$ ${addCommas(newNineYearExpense)}`);\n\n \n } else {\n newNineYearExpense = $('#newNineYearExpense').text().replace(/(\\s|\\$|,)/g, '');\n newNineYearExpense = parseFloat(newNineYearExpense);\n\n }\n\n const nineYearSaving = nineYearExpense - newNineYearExpense;\n $( '#nineYearSaving' ).text(`$ ${addCommas(nineYearSaving)}`);\n\n $( '#yearlySaving' ).text(`$ ${addCommas(nineYearSaving / 9)}`);\n}", "function updateMonthly(monthlyPayment) {\n paymentDisplay = document.querySelector('#monthly-payment');\n paymentDisplay.innerText = `$${monthlyPayment}`;\n}", "function updateMonthly(payment) {\n const monthlyReq = document.getElementById(\"monthly-payment\");\n monthlyReq.innerText = payment +\"$ needed to be payed\";\n\n}", "function calculateMonthlyMortgagePayment(args){\n\tvar principal = args.loanAmount;\n\tvar interestRate = args.interestRate == 0 ? 0 : args.interestRate/100;\n\tvar monthlyInterestRate = interestRate == 0 ? 0 : interestRate/12;\n\tvar numberOfMonthlyPayments = args.termInYears * 12;\n\treturn (((monthlyInterestRate * principal * (Math.pow((1+monthlyInterestRate), numberOfMonthlyPayments)))) / ((Math.pow((1+monthlyInterestRate), numberOfMonthlyPayments)) - 1));\n}", "function calculateForm() {\n setFields();\n\n if (formIsValid()) {\n var loan_amount, interest, monthly_interest, years, months,\n payment, paid, interest_paid;\n\n loan_amount = total_loan_box.value;\n interest = interest_rate_box.value;\n\n if (interest >= 1) interest = interest / 100;\n\n monthly_interest = interest / 12;\n years = loan_term_box.value;\n months = years * 12;\n\n number_payments_box.value = months;\n\n payment = Math.floor((loan_amount * monthly_interest) / (1 - Math.pow((1 + monthly_interest), (-1 * months))) * 100) / 100;\n payment_amount_box.value = payment.toFixed(2);\n\n paid = payment * months;\n total_paid_box.value = paid.toFixed(2);\n\n interest_paid = paid - loan_amount;\n interest_paid_box.value = interest_paid.toFixed(2);\n\n return true;\n }\n\n focus_box.select();\n return false;\n}", "payment(P, Y, R) {\n var n = 12 * Y;\n var r = R / (12 * 100);\n var payment = (P * r) / (1 - (1 + r) ^ (-n));\n console.log(\"Monthly Payment is:\" + payment);\n\n\n\n\n }", "function updateMonthly(monthly) {\n const monthlyPaymentEl = document.querySelector(\"#monthly-payment\");\n monthlyPaymentEl.innerText = \"$\" + monthly;\n}", "function interestCalculator(r, balance, n, monthly_payment){\n \n //put all results in arrays to return out of the function\n let interest_array = [];\n let principal_array = [];\n //let remainder_array = [];\n let month_array = [];\n let balance_array = [];\n let total_interest_array = [];\n\n var interest_payment;\n var remainder;\n var x;\n let costObj = {};\n\n //iterate over the number of payment periods \n for (let i = 0; i < n; i++) {\n\n //what month are you paying?\n month_array.push(i+1);\n\n //how much interest are you paying this month?\n if (balance_array.length == 0) {\n interest_payment = r*balance.toFixed(2);\n interest_array.push(interest_payment);\n }\n else {\n interest_payment = r*balance_array[i-1].toFixed(2);\n interest_array.push(interest_payment);\n }\n \n \n //how much of payment goes towards principal?\n let prince_payment = monthly_payment - interest_payment;\n principal_array.push(prince_payment);\n \n //how much principal do you still owe? \n if (balance_array.length == 0) {\n remainder = balance - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n else {\n remainder = balance_array[i-1] - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n \n //update balance array that was passed into function\n //balance_array.push(remainder.toFixed(2));\n //check this out!\n x = balance_array.length;\n\n }\n\n //sum all the values in the interest array\n let int_length = interest_array.length;\n let total_interest = 0;\n\n for (let i = 0; i < int_length; i++) {\n //add the interest value for the ith, month, to the total interest\n total_interest += interest_array[i];\n //accumulated total interest\n total_interest_array.push(total_interest);\n }\n\n //Calculate total cost\n //let total_cost = balance[0] + total_interest;\n\n costObj.remaining_balance = balance_array;\n costObj.total_interest = total_interest;\n //costObj.total_cost = total_cost.toFixed(2);\n costObj.interest_payments = interest_array;\n costObj.principal_payment = principal_array;\n costObj.months = month_array;\n costObj.total_interest_array = total_interest_array;\n //costObj.principal_balance = remainder_array;\n\n return costObj;\n\n //am I allowed to return different data types from one function?\n //return [interest_array, principal_array, remainder_array, total_cost];\n\n}", "function monthPredicted(){\n var tempdata = \"\";\n var flag = 1;\n if (inspectedItem.funding_status === \"seed\"){\n tempdata = process_data_numeric(seed_to_a);\n }else if (inspectedItem.funding_status === \"series_a\"){\n tempdata = process_data_numeric(a_to_b);\n }else{\n flag = 0;\n tempdata = process_data(monthRateDefault);\n }\n var ans = [];\n if (flag === 1){\n for (var i in tempdata){\n if (tempdata[i].name === inspectedItem.name){\n const entries = Object.entries(tempdata[i])\n let id = 0;\n ans = entries.map(function(item){\n var info = {\n \"key\": id,\n \"period\": item[0],\n \"success_rate\": item[1],\n }\n id++;\n return info;\n })\n ans.shift()\n ans.shift()\n stateX = []\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n }\n }\n return ans;\n }else{\n return tempdata;\n }\n }", "clickedMonthly(event){\n this.setState({\n compound: 12,\n buttonText: \"Monthly\",\n })\n this.anchorEl = null;\n this.state.menuPosition = null;\n }", "function changingData() {\n if (checkVal) {\n checkVal = false\n var passVar = \"month\"\n buttonOne.text(\"Monthly Aggregate: 10-Year Treasury Constant Maturity Rate 2013-2018\")\n }\n else {\n checkVal = true\n passVar = \"date\"\n buttonOne.text(\"10-Year Treasury Constant Maturity Rate 2013-2018\")\n }\n\n\n xScale\n .domain(d3.extent(groupByYear, function(d) { return d[passVar] }))\n\n responsiveUpdatedVariables(passVar)\n\n\n d3.select(window).on(\"resize\", function(d) {\n responsiveUpdatedVariables([passVar])\n\n })\n\n }", "function sppmpMonth(thisInput) {\n var month = $(thisInput);\n var id_split = $(thisInput).attr('id').split('-');\n var id = id_split[1];\n var day_string = $('input#add-description-' + id).val().split(' ');\n var days = day_string[0];\n var price = $('input#item-price-' + id ).val();\n var amount = $('input#total-amount-' + id );\n var qty = 0;\n var total = 0;\n\n if ( $.trim(month.val()) === \"\") {\n month.val(0);\n }\n\n if ($.trim(days) === \"\") {\n days = 1;\n $('input#add-description-' + id ).val('');\n } else if ( days < 2 ) {\n days = 1;\n $('input#add-description-' + id ).val('');\n }\n\n if ($.trim(price) === \"\") {\n price = 0;\n }\n\n $('input.month-'+id).each(function(i)\n {\n if ( $(this).val() != \"\") {\n qty += parseFloat($(this).val());\n }\n });\n\n $('input#quantity-'+id).val(qty);\n total = days * (qty * price);\n\n if ( total > 0 ) {\n amount.val(parseFloat(total).toFixed(2));\n } else {\n amount.val('0.00');\n }\n\n finalTotalCost();\n}", "function calculateMonthlyPayment(values) {\n // Sanity check for rate\n if (values.rate > 1) {\n values.rate = values.rate / 100;\n }\n\n // If time is too short, pay back the whole loan at once\n if (values.years <= 1 / 12) {\n return values.amount.toFixed(2);\n }\n let payment =\n (values.amount * values.rate) /\n 12 /\n (1 - Math.pow(1 + values.rate / 12, -12 * values.years));\n return payment.toFixed(2);\n}", "function calculate() {\n 'use strict';\n \n\t//Set up the array, fill it with months\n\tvar months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\t\n\t//Return appropriate month based on user submission\n\tvar monthnum = document.getElementById('monthnum').value;\n\tvar result = months[monthnum-1];\n\t\n\t// Output the month name\n\tdocument.getElementById('result').value = result;\n\t\n // Return false to prevent submission:\n return false;\n \n} // End of calculate() function.", "function CalculateTotalsMonthToDate() {\n //use temp variables to prevent multiple dom updates\n var wt = 0; //written total\n var dt = 0; //delivered total\n var gt = 0; //goals total\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n dt += vm.territoryDelivered[i];\n }\n\n var indexMonth = (vm.currentYear == vm.maxYear) ? vm.thisMonth:11; //this holds the month (as a 0-based integer) that will be used to loop through and add all the goals together\n\n\n for (var i = 0; i <= indexMonth; i++) {\n gt += vm.goals[i];\n }\n\n vm.writtenTotal = Round(wt, 2);\n vm.deliveredTotal = Round(dt, 2);\n vm.goalsTotal = Round(gt, 2);\n vm.goalsWrittenDifference = Round(vm.writtenTotal - vm.goalsTotal, 2);\n\n if (vm.goalsWrittenDifference > 0)\n vm.goalsWrittenDifference = '+' + vm.goalsWrittenDifference;\n }", "function singleClickDetailedByPayment(){\n\n\t\trunReportAnimation(65); //of Step 8 which takes 25 units\n\n\t\tpaymentGraphData = [];\n\n\t var requestData = {\n\t \"selector\" :{ \n\t \"identifierTag\": \"ACCELERATE_PAYMENT_MODES\" \n\t },\n\t \"fields\" : [\"identifierTag\", \"value\"]\n\t }\n\n\t $.ajax({\n\t type: 'POST',\n\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t data: JSON.stringify(requestData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\n\t if(data.docs.length > 0){\n\t if(data.docs[0].identifierTag == 'ACCELERATE_PAYMENT_MODES'){\n\n\t \tvar modes = data.docs[0].value;\n\n\t \tif(modes.length == 0){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\treturn '';\n\t\t \t}\n\t\t \telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t //For a given PAYMENT MODE, the total Sales in the given DATE RANGE\n\n\t\t\t\t\t\t $.ajax({\n\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode?startkey=[\"'+modes[0].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t\t//Now check in split payments\n\t\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode_multiple?startkey=[\"'+modes[0].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t \t\tif(temp_sum > 0){\n\t\t\t\t\t\t\t\t \t\t\tpaymentGraphData.push({\n\t\t\t\t\t\t\t\t\t\t \t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t\t\t \t\t\"value\": temp_sum\n\t\t\t\t\t\t\t\t\t\t \t})\n\t\t\t\t\t\t\t\t \t\t}\t\n\n\t\t\t\t\t\t\t\t \t\tdetailedListByPaymentMode.push({\n\t\t\t\t\t\t\t\t \t\t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t \t\t\t\"value\": temp_sum,\n\t\t\t\t\t\t\t\t \t\t\t\"count\": temp_count\n\t\t\t\t\t\t\t\t \t\t});\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\t\t \t//Check if next mode exists...\n\t\t\t\t\t\t\t\t\t \tif(modes[1]){\n\t\t\t\t\t\t\t\t\t \t\tsingleClickDetailedByPaymentCallback(1, modes, paymentGraphData);\n\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t\t \t\t//Step 10: Weekly Progress\n\t\t\t\t\t\t\t\t\t \t\tsingleClickWeeklyProgress();\n\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}); \n\n\n\t\t\t\t\t\t },\n\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t//Step 9-10: Render the Payment Graph \n\t\t\t\t\t\t\t\tsingleClickRenderPaymentsGraph(); \n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t }\n\t\t\t\t\t\t }); \n\t\t\t\t\t} \n\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\t },\n\t error: function(data) {\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\n\t });\n\t}", "function calculateBuy() {\n var bestTotalIndexBuy = -1;\n var bestMonthlyIndexBuy = -1;\n var bestTotalIndexLease = -1;\n var bestMonthlyIndexLease = -1;\n\n var iterLease = 0;\n var iterBuy = 0;\n\n //Process the Lease Modules in the array\n leaseModules.forEach(function(element) {\n //Initialize Parameters\n var monthlyPayment = 0;\n var total = 0;\n var downPayment = 0;\n\n //If there is no monthly payment, dont bother calculating\n if (element.monthlyPaymentInput.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get monthly payment\n monthlyPayment = parseFloat(element.monthlyPaymentInput.value);\n\n //If theres a payment length, calculate the total and subtract the discounts\n if (element.paymentLength.value != \"\") {\n var total = parseFloat(element.monthlyPaymentInput.value) * parseFloat(element.paymentLength.value);\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, show an error if true\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downPayment, process it\n if (element.downPayment.value != \"\") {\n\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If the three mile parameters are filled, process that\n if (element.allotedMiles.value != \"\" && element.mileCost.value != \"\" && element.averageMiles.value != \"\") {\n if (parseFloat(element.allotedMiles.value) < parseFloat(element.averageMiles.value)) {\n total = total + ((parseFloat(element.averageMiles.value) - parseFloat(element.allotedMiles.value)) * parseFloat(element.mileCost.value));\n }\n }\n\n //Calculate the monthly payment given the total and the paymentLength (instead of just monthly payment parameter)\n var monthlyPayment = total / parseFloat(element.paymentLength.value);\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If the total or monthlyPayment isn't 0, print it out (note total includes the down-payment where as the monthly payment does not)\n total = total + downPayment;\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Determine if the current module now has the lowest total and/or monthly payment compared to other lease modules\n //If it is, store the index\n if (total != 0) {\n if (bestTotalIndexLease == -1) {\n bestTotalIndexLease = iterLease;\n } else if (total < parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexLease = iterLease;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexLease == -1) {\n bestMonthlyIndexLease = iterLease;\n } else if (monthlyPayment < parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexLease = iterLease;\n }\n }\n\n iterLease = iterLease + 1;\n\n });\n\n\n //Process all BUY modules\n buyModules.forEach(function(element) {\n //Initialize variables\n var total = 0.0;\n var monthlyPayment = 0.0;\n var downPayment = 0.0;\n var interest = 0.0;\n\n //If the MSRP is blank, dont bother calculating\n if (element.MSRP.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get the MSRP\n var total = parseFloat(element.MSRP.value);\n\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, if it is show an error\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downpayment\n if (element.downPayment.value != \"\") {\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If there is interest, calculate the amount of interest based on the total\n if (element.interest.value != \"\") {\n if (parseFloat(element.interest.value) > 100) {\n element.interest.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Interest cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n }\n element.interest.style.backgroundColor = \"white\";\n interest = (total / 100 * parseFloat(element.interest.value));\n }\n\n //Add the interst to the total\n total = total + interest;\n\n //If there is a payment length, calcualte the monthly payment\n if (element.paymentLength.value != \"\") {\n if (parseFloat(element.paymentLength.value) == 0) {\n element.paymentLength.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Payment length cannot be 0\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n monthlyPayment = (total - downPayment) / parseFloat(element.paymentLength.value);\n }\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If total/monthly payment isnt 0, display it\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Compare total and monthly payment to see if it is the cheapest in the buy group\n if (total != 0) {\n if (bestTotalIndexBuy == -1) {\n bestTotalIndexBuy = iterBuy;\n } else if (total < parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexBuy = iterBuy;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexBuy == -1) {\n bestMonthlyIndexBuy = iterBuy;\n } else if (monthlyPayment < parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexBuy = iterBuy;\n }\n }\n\n iterBuy = iterBuy + 1;\n\n });\n //Determine if the lease or buy index is the smallest and set it to green\n //It will independently set the total and monthly payment to limegreen\n\n //Set to max int\n var bestTotalBuy = 9007199254740992;\n var bestTotalLease = 9007199254740992;\n var bestMonthlyBuy = 9007199254740992;\n var bestMonthlyLease = 9007199254740992;\n if (bestTotalIndexBuy != -1) {\n bestTotalBuy = parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestTotalIndexLease != -1) {\n bestTotalLease = parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexBuy != -1) {\n bestMonthlyBuy = parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexLease != -1) {\n bestMonthlyLease = parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n\n if (bestTotalLease < bestTotalBuy) {\n if (bestTotalIndexLease != -1) {\n leaseModules[bestTotalIndexLease].total.style.color = \"limegreen\";\n }\n } else {\n if (bestTotalIndexBuy != -1) {\n buyModules[bestTotalIndexBuy].total.style.color = \"limegreen\";\n }\n }\n\n if (bestMonthlyLease < bestMonthlyBuy) {\n if (bestMonthlyIndexLease != -1) {\n leaseModules[bestMonthlyIndexLease].monthlyPayment.style.color = \"limegreen\";\n }\n } else {\n if (bestMonthlyIndexBuy != -1) {\n buyModules[bestMonthlyIndexBuy].monthlyPayment.style.color = \"limegreen\";\n }\n }\n\n\n}", "function updateMonthly(monthly) {\n document.getElementById(\"monthly-payment\").innerText = \"$\" + monthly;\n}", "function bindShowContractLeasePeriodMonths() {\n //txtLeaseExpiryDate, txtLeaseStartDate\n var contractLeaseStartDate = $('#txtLeaseStartDate').val();\n var contractLeaseExpiryDate = $('#txtLeaseExpiryDate').val();\n var contractLeasePeriod = $('#txtLeasePeriod');\n \n if(contractLeaseStartDate !== '' && contractLeaseExpiryDate !== '') {\n var startDateSplit = contractLeaseStartDate.split('/');\n var startDay = parseInt(startDateSplit[0]);\n var startMonth = parseInt(startDateSplit[1]) - 1;\n var startYear = parseInt(startDateSplit[2]);\n \n var endDateSplit = contractLeaseExpiryDate.split('/'); \n var expiredDay = parseInt(endDateSplit[0]);\n var expiredMonth = parseInt(endDateSplit[1]) - 1;\n var expiredYear = parseInt(endDateSplit[2]);\n \n var dateStartContrant = new Date(startYear, startMonth, startDay);\n var dateEndContract = new Date(expiredYear, expiredMonth, expiredDay);\n \n var contractPeriod = bindCalculateLeaseMonth(dateStartContrant, dateEndContract);\n \n if(contractPeriod === 0) {\n leasePeriodStart = 1;\n contractPeriod = leasePeriodStart;\n leasePeriodEnd = 2;\n lastUpdatedLeasePeriod = leasePeriodStart;\n } else {\n leasePeriodStart = contractPeriod - 1;\n leasePeriodEnd = contractPeriod + 1;\n lastUpdatedLeasePeriod = contractPeriod;\n }\n contractLeasePeriod.val(contractPeriod);\n leasePeriodCurrent = contractPeriod;\n }\n}", "function calculate() {\r\n\r\n //Old Formula Below\r\n //const interest = (amount * (interestrate * 0.01)) / months;\r\n //let payment = ((amount / months) + interest).toFixed(0);\r\n\r\n\r\n let amount=document.querySelector('#amount').value;\r\n let interestrate=document.querySelector('#interestrate').value;\r\n let months=document.querySelector('#months').value;\r\n\r\n if (amount=='' || interestrate==''|| months=='') {\r\n document.querySelector('#final').innerHTML=`<h4 style='color:#ef5350'>Enter Values</h4>`;\r\n }\r\n\r\n else {\r\n const interest = interestrate/1200;\r\n \r\n let top = Math.pow((1+interest),months);\r\n let bottom = top - 1;\r\n let ratio = top/bottom;\r\n let emi = (amount * interest * ratio).toFixed(0);\r\n\r\n document.querySelector('#final').innerHTML=`Your EMI is ${emi}`; \r\n \r\n console.log(amount, interestrate, months);\r\n }\r\n\r\n \r\n}", "function calculus(loanAmount, numberPayments, rate) {\n let monthlyPayment = 0;\n let totalCost = 0;\n let totalInterest = 0;\n let eachMonth = {\n month: [0],\n payment: 0,\n principal: [0],\n interest: [0],\n totalInterestObj: [0],\n balance: [loanAmount],\n totalInterestEnd: 0,\n totalCost: 0,\n term: 0,\n loanAmount: 0,\n };\n \n //payment est la mensualité\n monthlyPayment = (loanAmount) * (rate / 1200) / (1 - (1 + rate / 1200) ** (-60));\n //25000 × (5 ÷ 1200) ÷ (1 - (1 + 5 ÷ 1200))^(-60)=471.7808411\n eachMonth.payment = monthlyPayment;\n eachMonth.loanAmount = loanAmount;\n totalInterest = parseFloat((monthlyPayment * numberPayments) - loanAmount);\n eachMonth.totalInterestEnd = parseFloat(totalInterest);\n totalCost = parseFloat(loanAmount) + parseFloat(totalInterest);\n eachMonth.totalCost = totalCost;\n eachMonth.term = numberPayments;\n\n for (let i = 1; i <= numberPayments; i++) {\n eachMonth.month.push(i);\n eachMonth.interest.push(eachMonth.balance[i - 1] * rate / 1200);\n eachMonth.principal.push(monthlyPayment - eachMonth.interest[i]);\n eachMonth.totalInterestObj.push(eachMonth.interest[i - 1] + eachMonth.interest[i]);\n eachMonth.balance.push(eachMonth.balance[i - 1] - eachMonth.principal[i]);\n }\n return eachMonth;\n // formules a verifier:\n //balance 0 =loanAmount\n /* first Term: interest1==balance0*5/1200\n principal1==payment-interest1\n balance1==balance0-principal1\n\n eachMonth.interest[i]==eachMonth.balance[i-1]*5/1200\n principali==payment-interesti\n balancei==balance[i-1]]-principali */\n}", "calculate(id, value){\n\n //Fetching the Slider value for every change\n let {amount, duration}= this.getSlidervalue(id, value);\n \n \n //Make Http call for getting Data for given parameters\n this.getInterestAndAmount(amount,duration)\n .then(response => {\n if (response && response.data && response.data.monthlyPayment && response.data.nominalInterestRate) {\n //save results into state\n this.setState({monthlyInst: response.data.monthlyPayment.amount});\n this.setState({rateOfInterest: response.data.nominalInterestRate});\n } else {\n return null;\n }\n })\n .catch(error => {\n console.log(error);\n });\n \n \n\n\n }", "function start() {\n // so we can test the calcMonthlyPayment independently of all the\n // HTML, only do the rest if this is run on a page with the form\n if (!calcForm) return;\n\n setInitialValues();\n \n calcForm.addEventListener(\"submit\", function (evt) {\n evt.preventDefault();\n getFormValuesAndDisplayResults();\n });\n}", "function getMortgage()\n{\n // principal is the initial value of the mortgage loan\n let principal = document.getElementById(\"principalAmount\").value;\n principal = parseFloat(principal);\n\n // this sets the value of the principal to 0 if the user enters a negative number\n if (principal < 0)\n {\n principal = 0\n }\n\n // interestRate is the expected yearly interest rate\n let interestRate = document.getElementById(\"interestRate\").value;\n interestRate = parseFloat(interestRate);\n\n // This statement sets the interest rate to 0 if the user enters a negative number\n if (interestRate < 0)\n {\n interestRate = 0;\n }\n // This statement sets the interest rate to 100 if the user enters a number above 100%\n if (interestRate > 100)\n {\n interestRate = 100;\n }\n\n // interestPct is the interestRate after being converted to a decimal\n let interestPct = interestRate / 1200;\n\n // mortgageLength is the desired number of years to payoff the loan\n let mortgageLength = document.getElementById(\"mortgageLength\").value;\n mortgageLength = parseFloat(mortgageLength);\n\n // This statement sets the mortgage length to 5 years if the user enters a value below 5 years\n if (mortgageLength < 5)\n {\n mortgageLength = 0;\n }\n\n // This statement sets the mortgage length to 50 if the user enters a value larger than 50\n if (mortgageLength > 50)\n {\n mortgageLength = 0;\n }\n\n // numPayments is the number of monthly payments until the loan is paid off\n let numPayments = mortgageLength * 12;\n\n // mortgagePayment is the value of each monthly payment\n let mortgagePayment = principal * ( ( interestPct * Math.pow((1 + interestPct), numPayments) ) / ( Math.pow( (1 + interestPct), numPayments ) - 1 ) )\n\n // mortgageField is the field where the mortgage payment displays on the page\n const mortgageField = document.getElementById(\"mortgagePayments\");\n mortgageField.value = \"$ \" + mortgagePayment.toFixed(2);\n\n // totalCost is the total dollar value you will pay over the duration of the loan\n let totalCost = numPayments * mortgagePayment;\n\n // costfield is the field where the totalCost will display on the page\n const costField = document.getElementById(\"totalCost\");\n costField.value = \"$ \" + totalCost.toFixed(2);\n}", "function doMyMath(){\n\n //object from paymentCalculator \n mathData = paymentCalculator();\n \n let r = mathData.int_rate;\n let n = mathData.term;\n //this should NOT be an array - in order to rectify incorrect lengths in final output\n let balance = mathData.principal;\n let monthly_payment = mathData.monthly_payment;\n\n //call interestCalculator\n cost_Obj = interestCalculator(r, balance, n, monthly_payment);\n\n //call displayData\n displayData(monthly_payment, cost_Obj);\n\n // document.getElementById(\"monthly_payment\").innerHTML = `$${monthly_payment}`;\n // document.getElementById(\"total_principal\").innerHTML = `$${balance[0]}`;\n // document.getElementById(\"total_interest\").innerHTML = `$${cost_Obj.total_interest}`;\n // document.getElementById(\"total_cost\").innerHTML = `$${cost_Obj.total_cost}`;\n\n // //fill out table data beginning here\n // document.getElementById(\"month\").innerHTML = `1`;\n // document.getElementById(\"payment\").innerHTML = `${monthly_payment}`;\n // document.getElementById(\"principal\").innerHTML = `${cost_Obj.principal_payment[0]}`;\n // document.getElementById(\"interest\").innerHTML = `${cost_Obj.interest_payments[0]}`;\n // document.getElementById(\"interest_data\").innerHTML = `${cost_Obj.interest_payments[0]}`;\n // document.getElementById(\"balance\").innerHTML = `${cost_Obj.principal_balance[0]}`;\n\n}", "function calculateMonthlyPayment(values) {\n let totalMonths = Math.floor(parseFloat(values.years) * 12);\n let monthlyRate = (parseFloat(values.rate) / 100) / 12;\n let monthlyPayment = ((monthlyRate * parseFloat(values.amount)) / (1 - Math.pow((1 + monthlyRate), -totalMonths)));\n if (isNaN(monthlyPayment)) {\n return \"Error, try again\";\n }\n return monthlyPayment.toFixed(2).toString();\n\n}", "function calculateMonthlyPayment(values) {\n const i = (values.rate / 100) / 12;\n const n = Math.floor(values.years * 12);\n return (\n (values.amount * i) /\n (1 - Math.pow((1 + i), -n))\n ).toFixed(2);\n}", "function calculateMonthlyPayment(term,interestRate,loanAmount)\n{\n\tvar monthlyPayment = (loanAmount*(interestRate))/(1-Math.pow((1+(interestRate)),(-term)));\n\treturn monthlyPayment;\n}", "function start() {\n // so we can test the calcMonthlyPayment independently of all the\n // HTML, only do the rest if this is run on a page with the form\n if (!calcForm) return;\n\n setInitialValues();\n\n calcForm.addEventListener(\"submit\", function (evt) {\n evt.preventDefault();\n getFormValuesAndDisplayResults();\n });\n}", "_setInfo() {\n let { year: currentYear, month: currentMonth } = this.currentMonthInfo; \n \n this.prevMonthInfo = { \n year: currentMonth == 0 ? currentYear - 1 : currentYear,\n month: currentMonth == 0 ? 11 : currentMonth - 1,\n day: null\n };\n \n this.nextMonthInfo = {\n year: currentMonth == 11 ? currentYear + 1 : currentYear,\n month: currentMonth == 11 ? 0 : currentMonth + 1,\n day: null\n }\n }", "function MonthlyPayment (loanPrincipal, numberOfMonths, rate) {\n this.loanPrincipal = loanPrincipal;\n this.numberOfMonths = numberOfMonths;\n this.rate = rate;\n let monthlyRate = (this.rate/12); // This is r.\n let payment = this.loanPrincipal *\n ((monthlyRate*(1 + monthlyRate) ** this.numberOfMonths)\n /((1 + monthlyRate) ** this.numberOfMonths - 1)); // monthly payment\n this.payment = payment.toFixed(2).toString();\n}", "function calculatePaymentAmount(whom){\n\n\t\ttotkmamount = $('.total'+whom+'kmamount').val();\n\t\ttothramount = $('.total'+whom+'hramount').val();\n\t\tnoofdays=$('.daysno').val();\n\n\t\tif($('.'+whom+'kmpaymentpercentage option:selected').val()==-1){\n\t\t\tkmpaymentpercentage=0;\n\t\t}else{\n\t\t\tkmpaymentpercentage=Number($('.'+whom+'kmpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif($('.'+whom+'hrpaymentpercentage option:selected').val()==-1){\n\t\t\thrpaymentpercentage=0;\n\t\t}else{\n\t\t\thrpaymentpercentage=Number($('.'+whom+'hrpaymentpercentage option:selected').text());\n\t\t}\n\n\t\tif(totkmamount!='' && (tothramount!='' || Number(noofdays)>1) && kmpaymentpercentage!='' && hrpaymentpercentage!=''){\n\n\t\t\tkmcommsn=(Number(totkmamount)*(Number(kmpaymentpercentage)/100)).toFixed(2);\n\t\t\thrcommsn=(Number(tothramount)*(Number(hrpaymentpercentage)/100)).toFixed(2);\n\n\t\t}else{\n\t\t\tkmcommsn = 0;\n\t\t\thrcommsn = 0;\n\t\t}\n\n\t\tvar ownership = $('.ownership').val();\n\t\tvar driver_status_id = $('.driver_status').val();\n\t\tvar driverbata = $('.driverbata').val();\n\t\tvar nighthalt = $('.nighthalt').val();\n\n\t\tif(whom == 'driver'){\n\t\t\tif((ownership == OWNED_VEHICLE && driver_status_id == ATTACHED_DRIVER) || (ownership == ATTACHED_VEHICLE && driver_status_id == OWNED_DRIVER)) {\n\t\t\t\tkmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\thrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t}\n\t\t}else{\n\t\t\tif(ownership == ATTACHED_VEHICLE && driver_status_id == ATTACHED_DRIVER){\n\t\t\t\t//kmcommsn = Number(kmcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\t//hrcommsn = Number(hrcommsn)+Number(driverbata)+Number(nighthalt);\n\t\t\t\tkmcommsn = Number(kmcommsn);\n\t\t\t\thrcommsn = Number(hrcommsn);\n\t\t\t}\n\t\t}\n\t\n\t\n\n\n\t\t$('.'+whom+'paymentkmamount').val(kmcommsn);\n\t\t$('.'+whom+'paymenthramount').val(hrcommsn);\n\n\t}", "function calculateAutoLoan(){\n\t\t//purchase price\n var purchase_val=parseInt(localStorage.pSlider);\n\t\t//downpayment \n\t\tvar down_pay_val=parseInt(localStorage.dPayment);\n\t\t// no of months G10\n\t\tvar no_of_mon=parseInt(localStorage.noofmonths);\n // total amount financed G8\n\t\tvar total_amt_financed=purchase_val-down_pay_val;\n\t\t// interest rate G13\n\t\tvar int_rate=parseFloat(localStorage.rSlider);\n\n\t\t//=(G8*(G13/12))/(1-(1+(G13/12))^(-1.0*G10)) (formula for monthly payment)\n\t\tvar l_val= eval(total_amt_financed*(int_rate/12));\n\t\t//alert(l_val);\n\t\tvar r_val= eval(1-Math.pow((1+(int_rate/12)),(-1.0*no_of_mon)))\n\t\t$('#auto-down-payment-o').val(l_val/r_val);\n\t\t$('#total-amt-financed-o').val(total_amt_financed);\n\t\t$('#no-of-month-o').val(localStorage.noofmonths);\n\t\t \n\t}", "function update_month() { //this is helper function for when component param changes, update months and year\n\n\tvar solution2 = $('#solution_param').val();//Grab Parameters\n\tvar component2 = $('#component_param').val();\n\tvar start_year2 = $('#yearparam_start').val();\n\n\tvar temp_url = replace_url;//Formulate URL\n\ttemp_url += \"GenerateMonthList\";\n\ttemp_url += \"/\" + solution2;\n\ttemp_url += \"/\" + component2;\n\ttemp_url += \"/\" + start_year2;\n\t\n\n\tvar $month = $('#monthparam_start');\n\t$month.empty(); //clear out the year options\n\n\t$.ajax({\n\t\turl: temp_url,\n\t\tbeforeSend: function() {\n\t\t\t$('#loading-year-click').show();\n\t\t},\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\n\t\tsuccess: function(order) {\n\t\t\t$month.append($('<option>', {value:\"\"}).text(\"Please select an option\"));\t\n\t\t\t$.each(order, function(key, value) {\n\t\t\t\t$month.append($('<option>', {\n\t\t\t\t\tvalue: value\n\t\t\t\t}).text(value));\n\t\t\t});\n\t\t},\n\t\tcomplete: function() {\n\t\t\t$('#loading-year-click').hide();\n\t\t}\n\t});//end of AJAX call\n\treturn false;\n}//end of update_month()", "function calculateMonthlyPayment(obj) {\n let p = obj.amount;\n let i = obj.rate / 100 / 12 ;\n let n = obj.years * 12;\n\n tempPayment = (p * i) / (1 - (Math.pow((1 + i),-n)));\n monthlyPayment = tempPayment.toFixed(2);\n \n // console.log(monthlyPayment.toFixed(2));\n return (monthlyPayment);\n \n}", "function calculate(){\n\n\t\n\t// Getting Device name\n\tcurrentDeviceName = $(\"#device option:selected\").html();\n\n\t// Getting Device price from select value\n\tcurrentDevicePrice = $(\"#device\").val();\n\n\t//Getting Optional Down Payment\n\toptionalDown = parseInt($(\"#optionalDown\").val(), .01);\n\n\t\n\t// Validate\n\tif (!currentDevicePrice) {\n\t\talert(\"You must select a device.\");\n\t} else if (optionalDown > currentDevicePrice) {\n\t\talert(\"Your Optional TAB Down Payment cannot be greater than the currently selected device, \" + currentDeviceName + \", which is $\" + currentDevicePrice + \".\");\n\t} else {\n\t\t// Setting the TAB Credit variable based on which device is selected\n\t\tif(currentDeviceName.includes(\"iPhone\") || currentDeviceName.includes(\"Galaxy\") || currentDeviceName.includes(\"Google\")) {\n\t\t\tTABcredit = 400.00;\n\t\t} else if(currentDeviceName.includes(\"Alcatel\")) {\n\t\t\tTABcredit = 99.95;\n\t\t} else if(currentDeviceName.includes(\"J3\")) {\n\t\t\tTABcredit = 299.95;\n\t\t} else if(currentDeviceName.includes(\"Kyocera\")) {\n\t\t\tTABcredit = 349.95;\n\t\t} else if(currentDeviceName.includes(\"KEY2\")) {\n\t\t\tTABcredit = 499.95;\n\t\t} else if(currentDeviceName.includes(\"Turbo Hub\")) {\n\t\t\tTABcredit = 399.95;\n\t\t} else {\n\t\t\tTABcredit = 0;\n\t\t}\n\t\n\t\t// Calculating the Required Down Payment\n\t\tif (((currentDevicePrice - TABcredit) / 24) <= maxMonthlyTab) {\n\t\t\trequiredDown = 0;\n\t\t} else {\n\t\t\trequiredDown = (currentDevicePrice - TABcredit) - maxMonthlyTab * 24;\n\t\t}\n\t\n\t\t// Calculating the Monthly Payment\n\t\tif ((currentDevicePrice - TABcredit - requiredDown - optionalDown) / 24 < 0) {\n\t\t\tmonthlyPayment = 0;\n\t\t} else {\n\t\t\tmonthlyPayment = (currentDevicePrice - TABcredit - requiredDown - optionalDown) / 24;\n\t\t}\n\t\n\t\t// Injecting the values into the HTML table\n\t\t$(\"#devicename\").html(currentDeviceName);\n\t\t$(\"#retailprice\").html(\"$\" + currentDevicePrice + \" <small>+ HST</small>\");\n\t\t$(\"#credit\").html(\"$\" + TABcredit.toFixed(2));\n\t\t$(\"#required\").html(\"$\" + requiredDown.toFixed(2));\n\t\t$(\"#optional\").html(\"$\" + optionalDown.toFixed(2));\n\t\t$(\"#monthly\").html(\"$\" + monthlyPayment.toFixed(2));\n\t}\n}", "function calcLoanPayment(p, r, t, n){ // calculates loan payments given principal, interest rate, number of years, and number of times a year interest is compounded\n var payment = p * (r/n) * Math.pow(1 + r/n, t*n) / (Math.pow(1 + r/n, t*n) - 1); // equation for monthly payment on a mortgage\n return payment; // output for function is payment\n}", "function onClickPreMonth(preMonth, month, year) {\n preMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) - 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "function monthClick() {\n\tfor(let i = 0; i < monthBtn.length; i++) {\n\t\tmonthBtn[i].onclick = function() {\n\t\t\tcurMonth = (i + 9);\n\t\t\tif(curMonth > 12) curMonth -= 12;\n\n\t\t\t// Removes class from all list items first\n\t\t\tfor(let j = 0; j < monthBtn.length; j++) {\n\t\t\t\tmonthBtn[j].classList.remove(\"selected\");\n\t\t\t}\n\n\t\t\t// Adds class to clicked list item\n\t\t\tthis.classList.add(\"selected\");\n\n\t\t\tdocument.getElementById(\"month-title\").innerText = this.innerText;\n\n\t\t\t// Resets filters\n\t\t\tcurFilter[0] = 'None';\n\t\t\tcurFilter[1] = 'None';\n\t\t\tfilterBtn[0].innerText = filterBtn[0].classList[1];\n\t\t\tfilterBtn[1].innerText = filterBtn[1].classList[1];\n\n\t\t\tresetFilter();\n\n\t\t\tfloatAnnouncements();\n\t\t}\n\t}\n}", "function resultPageCalc() {\n const retAge = 58;\n const lifeExpectAge = 90;\n const inflationRate = 0.045;\n const expReturnsRate = 0.055;\n\n let yearsTillRet = retAge - curAgeVal;\n let postRetAge = lifeExpectAge - retAge;\n let expMultiAfterRet = 1;\n switch (rpRetireType) {\n case 'spending_more':\n expMultiAfterRet = (1 + 0.2); //expense increased by 20%\n break;\n case 'spending_less':\n expMultiAfterRet = (1 - 0.2); //expense decreased by 20%\n break;\n case 'spend_same':\n expMultiAfterRet = 1;\n break;\n default:\n break;\n }\n let postAnnualExp = rpExpenseVal * expMultiAfterRet * 12;\n let postAnnualExpPlusInfl = postAnnualExp * (Math.pow((1 + inflationRate), yearsTillRet));\n\n let reqCorpus = 0;\n //calculating net present value of customers post retirement expense\n for (i = 0; i < postRetAge; i++) {\n let thisYrAnnExp = ((i === 0) ? postAnnualExpPlusInfl : (postAnnualExpPlusInfl * (1 + inflationRate)));\n let presValPostRetExp = presentValue(expReturnsRate, i, thisYrAnnExp);\n reqCorpus += presValPostRetExp;\n }\n\n const percVsInvProf = { risk_averse: 0.06, conservative_type: 0.066, balanced_type: 0.076, growth_type: 0.088, aggressive_type: 0.096 };\n\n let totalInvest = (rpRetSavedVal + (rpMonthlySaveVal * 12 * yearsTillRet)) * (Math.pow((1 + percVsInvProf[rpInvestType]), yearsTillRet));\n\n let gapAmtPendingToSave = reqCorpus - totalInvest;\n\n let score = Math.round(((gapAmtPendingToSave <= 0) ? 1 : (totalInvest / reqCorpus)) * 100);\n\n let monthInvNeed = ((gapAmtPendingToSave <= 0) ? 0 : (PMT((percVsInvProf[rpInvestType] / 12), (yearsTillRet * 12), (gapAmtPendingToSave * (-1)))));\n\n const scoreArr = [65, 80, 95, 100];\n\n const statArr = [\n { heading: \"Your retirement score <strong>Needs Your Attention</strong>\", body: \"You are falling behind in planning your retirement. In order to relive life without any worries, we can make your wealth do the hard work.\" },\n { heading: \"Your retirement score is <strong>Fair</strong>\", body: \"While you are on the right track, you still need help in planning your retirement better! With our help, you can make your wealth do the hard work and relive life on your own terms.\" },\n { heading: \"Your retirement score is <strong>Good</strong>\", body: \"While you are saving enough for your retirement, you can still make your wealth do the hard work and relive life on your own terms.\" },\n { heading: \"Your retirement score is <strong>On Target</strong>\", body: \"Congratulations! You have planned your retirement right. But there is always scope for improvement! With our help, you can make your wealth do the hard work and relive life on your own terms.\" }\n ];\n const ageMsgArr = [\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can meet your aspirations with our curated investment portfolios, customized as per your investment behavior and get a lot more benefits.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can do goal based investments, consolidate and optimize investments, get a single view for easy investment tracking and enjoy a lot more benefits.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can manage your corpus efficiently, ensure a smooth transition from employer benefits, avail pension management services and get a lot more.\" },\n { heading: \"\", body: \"iRe-Live Program is tailor made just for your retirement needs. You can rebalance your investments, do legacy planning, enjoy retirement benefits across lifestyle, healthy living and a lot more.\" }\n ];\n const colorArr = ['#FF4A42', '#FFB74A', '#BAD22F', '#58951D'];\n let scoreArrIndex = 0;\n\n scoreArr.some((item, index) => {\n if (score <= item) {\n scoreArrIndex = index;\n return true;\n }\n });\n\n $(\"#rp-score\").html(score);\n $(\"#rp-score\").css(\"color\", colorArr[scoreArrIndex]);\n // $(\"#rp-score-place\").css(\"left\", score + \"%\");\n $(\"#rp-score-place\").css(\"transform\", `rotate(${(score * 3.6) - 16}deg)`);\n\n $(\"#score-heading\").html(statArr[scoreArrIndex][\"heading\"]);\n $(\"#score-body\").html(statArr[scoreArrIndex][\"body\"]);\n\n $(\"#age-msg-body\").html(ageMsgArr[ageArrIndex][\"body\"]);\n\n $(\"#rp-corpus\").html(`₹ ${globalizeAmt(Math.round(reqCorpus))}`);\n $(\"#rp-invest-ret\").html(`₹ ${globalizeAmt(Math.round(totalInvest))}`);\n // $(\"#rp-pending-corpus\").html(`₹ ${globalizeAmt(Math.round(reqCorpus - totalInvest))}`);\n // $(\"#rp-month-invest\").html(`₹ ${globalizeAmt(Math.round(monthInvNeed))}`);\n }", "function UpdateClicked_Period()\n{\n\tshowWaitAlert(getSeaPhrase(\"UPDATING_PERIOD_TE\",\"TE\"))\n\n\tif(arguments.length>0 && arguments[0]==\"Submitted\")\n\t\tUpdateTimeCard(\"Period\", \"Submitted\")\n\telse\n\t\tUpdateTimeCard(\"Period\")\n}", "function calcRkMonth(activity) {\n var date;\n\n /*\n * gets the api data for each month\n */\n function getData() {\n date = activity.dataset.date;\n\n var url = '/activitiesByDateRange?userName=' + user + '&startDate=' + date;\n\n $.getJSON(url, function(response){\n append(monthTotal(response));\n });\n }\n\n /*\n * calculates that month\n */\n function monthTotal(response) {\n var i, dataLen, day,\n totalDistance = 0,\n split = date.split('-');\n\n response = response.activities[split[2]][split[0]];\n for (i = 0, dataLen = response.length; i < dataLen; i++) {\n day = response[i];\n totalDistance += (+day.distance);\n }\n\n return Math.round(totalDistance*100)/100;\n }\n\n /*\n * Appends the calculated monthly total to the page\n */\n function append(distance) {\n activity.innerHTML += '<span style=\"font-size:10px;font-weight:bold;color:#888\">' + distance + 'mi </span>';\n }\n\n /*\n * Publically accessible methods\n */\n return {\n getData: getData\n };\n }", "function calculate(){}", "function calculateResults() {\n //UI vars\n const height = document.querySelector('#height').value;\n const weight = document.querySelector('#weight').value;\n const age = document.querySelector('#age').value;\n const sex = document.querySelector('#sex').value;\n const activity = document.querySelector('#activity').value;\n\n //Output vars\n const dailyCalorieRequirements = document.querySelector('#dailyCalorie');\n const daliyProteinIntake = document.querySelector('#dailyProtein');\n const dailyCarbsIntake = document.querySelector('#dailyCarbs');\n const dailyFatIntake = document.querySelector('#dailyFat');\n\n //calculating basal metabolic rate\n const bmr = ((10 * weight) + (6.25 * height) - (5 * age)) + parseFloat(sex);\n \n if (isFinite(bmr)) {\n let dailyCalorie = bmr * parseFloat(activity);\n dailyCalorieRequirements.value = Math.round(dailyCalorie);\n daliyProteinIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 25, 'p');\n dailyCarbsIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 35, 'c');\n dailyFatIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 40, 'f');\n displayResults();\n hideLoading();\n displayMacrosRatioChart();\n } else {\n showError('Please check your numbers');\n }\n}", "function monthlyBilling(divNum, name, address, email, signUpDate, tech, month, monthID) {\n var date = new Date(signUpDate.toString().replace( /(\\d{2})\\/(\\d{2})\\/(\\d{4})/, \"$1/$2/$3\"));\n var twoWeek = date;\n var pretty;\n var counter = 0;\n var dates = new Array();\n\n while(twoWeek > beginDate && twoWeek < endDate) {\n twoWeek.setDate(date.getDate() + 14);\n if(twoWeek > endDate) {\n break;\n } else {\n pretty = twoWeek.toLocaleDateString();\n dates.push(pretty);\n }\n }\n\n var tempDiv = $('<div></div>');\n $('#' + tech + '').append(tempDiv);\n tempDiv.attr(\"id\", divNum); \n\n var tempName = $('<h1>' + name + ' </h1>');\n $('#' + divNum + '').append(tempName);\n\n var tempEmail = $('<h3>' + email + '</h3>');\n $('#' + divNum + '').append(tempEmail);\n\n\n for(var i = 0; i< dates.length; i++) {\n var toDate = new Date(dates[i]);\n\n if(toDate.getMonth() == monthID) {\n\n var tempDate = $('<p>Service Date: ' + dates[i] + ' </p>')\n $('#' + divNum + '').append(tempDate);\n counter++;\n }\n }\n\n if(!($('#' + divNum + '').find('p').length > 0)) {\n $('#' + divNum + '').append('<p>No Services this month</p>');\n }\n\n var tempButton = $('<button>Send Email</button>');\n $(tempButton).attr(\"class\", \"btn btn-success\");\n $('#' + divNum + '').append(tempButton);\n\n var from, to, subject, text, name, services, amount;\n\n $('#' + divNum + ' button').click(function() {\n to = $('#' + divNum + ' h3').text();\n name = $('#' + divNum + ' h1').text();\n subject = month + \" Billing Statement - Grass Cutters\";\n services = $('#' + divNum + ' p').text();\n amount = counter * 50;\n text = \"Hello \" + name + \", here is your billing statement for the month of \" + month + \": \" + services + \"\\nTotal Bill: $\" + amount + \"\\n\\n\\nBilling terms are net30\";\n $.get('/sentBill', {to:to, subject:subject, text:text}, function(data) {\n if(data == \"sent\") {\n $(\"#message\").text(\"Email Sent!\");\n $(\"#message\").attr(\"class\", \"alert alert-success\");\n }\n else {\n $(\"#message\").text(\"Email was not sent\");\n $(\"#message\").attr(\"class\", \"alert alert-danger\");\n }\n }); \n });\n\n\n}", "function updateMonthlySalary(empMonthlySalary) {\n\n $('.person').last().data(\"monthlysalary\", {\n monthlysalary: empMonthlySalary\n });\n\n }", "function setupIntialValues() {\n const values = { amount: 10000, years: 4, rate: 5 };\n const amountReq = document.getElementById(\"loan-amount\");\n amountReq.value = values.amount;\n const yearsReq = document.getElementById(\"loan-years\");\n yearsReq.value = values.years;\n const rateReq = document.getElementById(\"loan-rate\");\n rateReq.value = values.rate;\n update();\n}", "function price(activity_time, start_time, end_time) {\n var tick = new Date(start_time);\n var today = new Date(end_time);\n var month_accounts = {};\n var outstanding = 0;\n while (tick < today) {\n var strtick = tick.toISOString().split(\"T\")[0];\n var month = tick.getFullYear() + (tick.getMonth() + 1).pad(2);\n var user_count = 0;\n if (!month_accounts[month]) {\n month_accounts[month] = {};\n }\n for (var user_id in activity_time[strtick]) {\n if (activity_time[strtick][user_id] > 0) {\n if (!month_accounts[month][user_id]) {\n month_accounts[month][user_id] = 1;\n } else {\n month_accounts[month][user_id] = month_accounts[month][user_id] + 1;\n }\n user_count = user_count + 1;\n } else {\n if (!month_accounts[month][user_id]) {\n month_accounts[month][user_id] = 0;\n } \n }\n }\n tick.setDate(tick.getDate() + 1);\n }\n total_amount = 0;\n total_deduction = 0;\n for (var month_key in month_accounts) {\n month_count = new Date(month_key.substring(0 ,4), month_key.substring(4, 6), 0).getDate();\n month_amount = 0;\n month_deduction = 0;\n for (var user in month_accounts[month_key]) {\n if (month_accounts[month_key][user] == month_count) {\n month_amount = month_amount + slack_monthly_license;\n } else {\n month_amount = month_amount + slack_monthly_license;\n if (month_accounts[month_key][user] == 0) {\n month_deduction = month_deduction + slack_monthly_license;\n } else {\n month_deduction = month_deduction + parseInt(slack_monthly_license * (month_count - month_accounts[month_key][user]) / month_count);\n }\n }\n }\n console.log(\" - \" + month_key + \" ( \" + month_count + \" days ) | $\" + month_amount.space(5) + \" - $\" + month_deduction.space(5) + \" = $\" + (month_amount - month_deduction).space(5).toString());\n total_amount = total_amount + month_amount;\n total_deduction = total_deduction + month_deduction;\n }\n console.log(\"------------------------------------------------------\");\n console.log(\"total upfront : $\" + total_amount.space(6));\n console.log(\"total paid : $\" + (total_amount - total_deduction).space(6));\n}", "function calculate() {\n try {\n // resets previous input without\n // breaking the whole code\n reset();\n } catch (err) {\n console.log(err);\n }\n\n const today = getToday();\n const birthday = getBirthday();\n\n const seconds = (today.getTime() - birthday.getTime()) / 1000;\n\n const minutes = seconds / 60;\n\n const hours = seconds / 3600;\n\n const days = seconds / 86400;\n\n setLines(days, hours, minutes, seconds);\n\n changeButton();\n}", "function onClickNextMonth(nextMonth, month, year) {\n nextMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) + 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "function validateFormAndCalculatePl() {\n addCommas(\"rp-annual-input\");\n addCommas(\"rp-annual-save-input\");\n addCommas(\"rp-month-input\");\n addCommas(\"rp-expense-input\");\n }", "function updateTotal() {\n\n}", "function btnCalculator() {\n const txtMonthlyPaymentEl = document.getElementById('txtMonthlyPayment');\n const txtYearlyRateEl = document.getElementById('txtYearlyRate');\n const listNumOfYearsEl = document.getElementById('listNumOfYears');\n const errorLogEl = document.getElementById('errorLog');\n const futureValueEl = document.getElementById('futureValue');\n\n // Determine form values provided by user\n const monthlyPayment = txtMonthlyPaymentEl ? txtMonthlyPaymentEl.value : 0;\n const rate = txtYearlyRateEl ? txtYearlyRateEl.value : 0;\n const years = listNumOfYearsEl ? listNumOfYearsEl.value : 0;\n\n // --- Form Validation ---\n\n const monthlyPaymentValidator = new Validator('Monthly Payment', monthlyPayment);\n monthlyPaymentValidator.addRequiredField();\n monthlyPaymentValidator.addRequiredFloatField();\n monthlyPaymentValidator.addFloatMinField(100);\n\n const rateValidator = new Validator('Interest Rate', rate);\n rateValidator.addRequiredField();\n rateValidator.addRequiredFloatField();\n rateValidator.addFloatMaxField(100);\n\n const errorLog = [];\n const monthlyPaymentValidation = monthlyPaymentValidator.validate();\n const rateValidation = rateValidator.validate();\n\n // --- Render Results ---\n\n if (monthlyPaymentValidation && rateValidation) {\n // Send future value calculation to client display\n errorLogEl.innerHTML = '';\n const futureValue = FinanceCalculator.calculateFutureValue(monthlyPayment, rate, years);\n if (futureValueEl) futureValueEl.innerHTML = FinanceCalculator.convertToCurrency(futureValue);\n } else {\n // Send error messages to client display\n if (futureValueEl) futureValueEl.innerHTML = '';\n if (!monthlyPaymentValidation) {\n for (const message of monthlyPaymentValidator.messages) {\n errorLog.push(message);\n }\n }\n if (!rateValidation) {\n for (const message of rateValidator.messages) {\n errorLog.push(message);\n }\n }\n let errorLogMessage = '<ul>';\n for (const msg of errorLog) {\n errorLogMessage += `<li>${msg}</li>`;\n }\n errorLogMessage += '</ul>';\n errorLogEl.innerHTML = errorLogMessage;\n }\n}", "function calculate(e) {\n\n if(loanAmount != 0) {\n lifetimeInt = 0;\n loanAmount = 0;\n monthlyPmt = 0;\n // document.getElementById(\"tableContainer\").remove();\n }\n\n e.preventDefault();\n\n let loanRate = loanRateArea.value;\n let pmtsCount = loanTermArea.value;\n\n let rate = loanRate/1200;\n let numerator = rate * ((1+rate)**pmtsCount);\n let denominator = ((1+ rate)**pmtsCount) - 1;\n\n loanAmount = loanAmountArea.value;\n monthlyPmt = loanAmount * (numerator/denominator);\n lifetimeInt = (monthlyPmt * pmtsCount) - loanAmount;\n let monthlyInt = loanAmount * rate;\n formatter.format(monthlyPmt);\n formatter.format(monthlyInt);\n chartData = [parseFloat(monthlyPmt).toFixed(2), monthlyInt.toFixed(2)];\n\n if(loanAmount != 0){\n if(lcChart){\n lcChart.data.datasets[0].data = chartData;\n\n lcChart.update();\n } else {\n buildChart();\n }\n buildTable();\n }\n}", "function rpOrderTotalUpdate() {\n //Ajax call to update balance due\n $('#rp-payment').unbind('click');\n $('#rp-payment').click(function(e){\n e.preventDefault();\n $.ajax({\n type : \"POST\",\n url: $('#rp-payment').data('url'),\n data: {\n id : \"rp-payment\",\n rp_used : $('#reward-points-spent').val(),\n order_id: $('#order-id-hidden').val(),\n csrfmiddlewaretoken: csrftoken,\n dataType: \"json\",\n },\n success: function(data){\n if (data.balance == 0.0) {\n document.getElementById('id_payment').style.display = \"none\";\n document.getElementById('id_payment_0').required = false;\n document.getElementById('id_payment_1').required = false;\n $('#update-amount-due').html(\"Amount to Pay: €\" + (data.balance));\n $('#id_total_points_earned').val(data.points_earned);\n $('#id_total_points_spent').val(data.points_spent);\n } else {\n document.getElementById('id_payment').style.display = \"initial\";\n document.getElementById('id_payment_0').required = true;\n document.getElementById('id_payment_1').required = true;\n $('#update-amount-due').html(\"Amount to Pay: €\" + (data.balance));\n $('#id_total_points_earned').val(data.points_earned);\n $('#id_total_points_spent').val(data.points_spent);\n }\n },\n failure: function() {\n }\n });\n });\n}", "function calculateGraduatedMonthlyPayment(loansArray) {\n\n var total = { initial : 0 };\n var federalLoans = getLoansByType(loansArray, loanType.FEDERAL);\n\n for (var i = 0; i < federalLoans.length; i++) {\n var loan = federalLoans[i];\n //QC 6032 If interest is 0% then there is no payment due the first 2 years.\n if ((parseInt(loan.InterestRate, 10)) === 0) { //QC-6377\n total.initial += 0;\n } else {\n total.initial += ((loan.OriginalLoanAmount * ((loan.InterestRate / 100) / 12)));\n }\n }\n return total;\n }", "function $compute() {\n var sold = 0.0,\n montant = 0.0;\n sold = parseFloat($('#bank_extract_begin_sold').val(), 10) + parseFloat($('#bank_extract_total_credit').val(), 10)\n - parseFloat($('#bank_extract_total_debit').val());\n $('.public_bank_extracts #bank_extract_end_sold').val(sold.toFixed(2));\n // mise à deux décimales du montant saisi\n montant = parseFloat($('#bank_extract_total_credit').val(), 10);\n $('.public_bank_extracts #bank_extract_total_credit').val(montant.toFixed(2));\n montant = parseFloat($('#bank_extract_total_debit').val(), 10);\n $('.public_bank_extracts #bank_extract_total_debit').val(montant.toFixed(2));\n montant = parseFloat($('#bank_extract_begin_sold').val(), 10);\n $('.public_bank_extracts #bank_extract_begin_sold').val(montant.toFixed(2));\n}", "function submit() {\n/*\nconst SALES_TAX = 0.835;\nconst TOTAL_SPENDING_LIMIT = 0.0;\n\n// store the total spending budget in relevent variable\nvar budget = document.getElementById(\"budget\");\nTOTAL_SPENDING_LIMIT = budget;\n// output to console to verify functionality\nconsole.log(TOTAL_SPENDING_LIMIT); \n*/\nconsole.log(\"log\");\n}", "function initialize()\n{\n curr_month; \n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n // display_cal(); \n}", "function payment(){\r\n //gets a value for the php value total\r\n var total = document.getElementById(\"total-value\").dataset.total;\r\n //\\checks if boolean is changed\r\n if(loginstatus === 1){\r\n alert(\"Thank you for placing your order! Order no. 123. cost: $\"+total.toString() );\r\n }else{\r\n alert(\"Please login before purchase.\")\r\n }\r\n }", "function onNext9(event) {\n\tvar premium = $m.juci.dataset(\"instPremium\");\n\tvar paymentMode = $m.juci.dataset(\"offlinePayment\");\n\tif(paymentMode.length) {\n\t\tif(premium > 50000 && paymentMode[0].Payment_Type == 'Cash') {\n\t\t\t$m.juci.dataset(\"typeOfDocumentRef\",\"PANCARD\");\n\t\t\t$m.juci.getControl(\"type_doc\").disable();\n\t\t} else {\n\t\t\t$m.juci.getControl(\"type_doc\").enable();\n\t\t}\n\t} else {\n\t\t$m.juci.getControl(\"type_doc\").enable();\n\t}\n var remainingAmount = juci.dataset(\"remainingAmount\");\n if (remainingAmount > 0) {\n $m.alert(\"Please pay total amount to move on.\");\n } else {\n var datasetData = $m.juci.dataset('offlinePayment');\n \n \n var customerDetails = $m.getPref(\"customerDetails\");\n $m.putPref(\"paymentdata_\"+customerDetails.Application_Number,datasetData);\n $m.savePref();\n var planDetails = $m.getPref(\"planDetails_\" + customerDetails.Application_Number);\n var dataObjtoUD = {\n \"data\": {\n \"Txn_Id\": customerDetails.Txn_Id,\n \"Application_Number\": planDetails.Application_Number,\n \"LA_Name\": customerDetails.LA_Name,\n \"LA_Mobileno\": customerDetails.LA_Mobileno,\n \"IS_LA_PR_SAME\": customerDetails.IS_LA_PR_SAME,\n \"Payment_Type\": \"Offline\",\n \"InstallmentPremium\": (planDetails.Total_InstPremium_ST == null ? planDetails.InstallmentPremium_ST : planDetails.Total_InstPremium_ST),\n \"Payment_Cash_DD\": \"N\"\n },\n \"page\": \"Payment\"\n };\n var paymentDbArray = [];\n for (var j = 0; j < datasetData.length; j++) {\n var currentObject = datasetData[j];\n currentObject.Application_Number = applicationNumber;\n //currentObject.iscompleted = '1';\n currentObject.Row_No = j + 1;\n if (currentObject.Payment_Type != 'Offline' && currentObject.Cheque_Date) {\n currentObject.Cheque_Date = currentObject.Cheque_Date.getTime();\n dataObjtoUD.data.Payment_Cash_DD = 'Y';\n }\n if (currentObject.Payment_Type == 'Cash')\n currentObject.Cheque_Date = \"\";\n currentObject.Txn_Id = customerDetails.Txn_Id\n var typeOFDocName = $m.juci.dataset(\"typeOfDocumentRef\");\n\t currentObject.DocumentType = typeOFDocName;\n paymentDbArray.push(new PDC_Payment_Details(currentObject));\n }\n if (!paymentDbArray.length) {\n $m.alert(\"Please complete payment!\");\n return;\n }\n var filter = new window.DB.Filter.equal(\"Application_Number\", \"'\" + applicationNumber + \"'\");\n PDC_Payment_Details.multipleInsert(paymentDbArray, function(success_response) {\n // $m.logInfo(\"Completed Details updated successfully\");\n navigateTo(\"docupload\");\n }, function(res) {\n $m.logError(\"Failed to insert payment details--- \" + JSON.stringify(res));\n $m.alert(\"Error while updating database\");\n });\n }\n}", "function anualRent(monthly){\n var anual = monthly * 12;\n return anual;\n}", "function updateCurrentMonth() {\n updateDays();\n currentM.textContent = months[month];\n}", "function decideHowToCalculateMonthlyPayment(\n loanAmount,\n annualPercentageRate,\n loanDuration\n) {\n if (checkIfLoanIncludesAPR(annualPercentageRate) === true) {\n withAPRCalculateMonthlyPayment(\n loanAmount,\n annualPercentageRate,\n loanDuration\n );\n } else {\n withNoAPRCalculateMonthlyPayment(loanAmount, loanDuration);\n }\n}", "handleMonthClick(nextMonthTimestamp){\n this.setState({\n month: new MonthModel(nextMonthTimestamp)\n })\n }", "_setMonth(date, monthSelector, updateDatesOnly) {\n const that = this,\n selectedDates = that._getDays(date, that.selectedDates),\n importantDates = that._getDays(date, that.importantDates),\n restrictedDates = that._getDays(date, that.restrictedDates);\n\n date.setDate(1);\n\n if (!monthSelector) {\n monthSelector = that.$.month;\n }\n\n monthSelector._date = new Date(date);\n\n if (!updateDatesOnly) {\n if (!that._viewDates || that._viewDates.length >= that.months) {\n that._viewDates = [];\n }\n\n that._viewDates.push(new Date(date));\n }\n\n date = new Date(date);\n\n //Correct the start day according to firstDayOfWeek property\n let firstDayOfWeek = (date.getDay() - that.firstDayOfWeek + 7) % 7;\n\n date.setDate(0);\n\n let previusMonthDays = date.getDate();\n\n date.setDate(32); // current month.\n date.setDate(1); // set to first day of month.\n date.setDate(32); // next month.\n\n if (that._selectedCells) {\n for (let i = 0; i < that._selectedCells.length; i++) {\n if (that._selectedCells[i].closest('.jqx-calendar-month') === monthSelector) {\n that._setCellState(that._selectedCells[i], 'selected', false);\n }\n }\n }\n\n that._setMonthContent(date, monthSelector, {\n previusMonthDays: previusMonthDays,\n firstDayOfWeek: firstDayOfWeek,\n selectedDates: selectedDates,\n importantDates: importantDates,\n restrictedDates: restrictedDates\n });\n }", "function payMaintence(flatNumber){\n var flatNumber=$(\"#flat_num_\"+flatNumber).val();\n var amount=$(\"#amount_\"+flatNumber).val();\n var pendingAmount=$(\"#pending_amount_\"+flatNumber).val();\n var reasonPendingAmount=$(\"#rPendingAmout_\"+flatNumber).val();\n var extraAmount=$(\"#extra_amount_\"+flatNumber).val();\n var reasonExtraAmount=$(\"#extra_rAmount_\"+flatNumber).val();\n var paidBy=$(\"#paid_by_\"+flatNumber).val();\n var date=$(\"#date_\"+flatNumber).val();\n if(pendingAmount > 0)\n {\n status = '2';\n }\n else\n {\n status = '1';\n }\n $.ajax({\n url: base_url + '/paid',\n type: 'post',\n headers: {\n 'X-CSRF-TOKEN': csrf_token\n },\n data: {\n flatNumber:flatNumber,\n amount: amount,\n pendingAmount: pendingAmount,\n reasonPendingAmount: reasonPendingAmount,\n extraAmount: extraAmount,\n reasonExtraAmount: reasonExtraAmount,\n paidBy: paidBy,\n date:date,\n status:status\n },\n success: function (response) {\n if (response.success == \"Paid\") {\n swal(\"paid!\", \"Your entry has been paid.\", \"success\");\n } else if(response.success == 'Data Updated')\n {\n swal(\"updated\", \"flat maintenance has been paid for the month.\", \"success\");\n }\n else {\n swal(\"error\", \"Something want wrong, Please try again later\", \"error\");\n }\n },\n });\n}", "calculate(modify) {\n return this.total = [].slice.call(arguments, 1)\n .reduce((total, y) => modify(total, y), this.total);\n }", "function updateTotals() {\n // define a total variable from the return of calcTotal\n let total = calcTotal();\n\n // insert that total into all places that render the total price\n $('.total').text(`$${total}`);\n\n //convert total to cents\n total = total * 100;\n total = Math.ceil(total);\n\n // insert form into id of pay\n let html = `\n <form action=\"/pay/?amount=${total}\" method=\"POST\">\n <script\n src=\"https://checkout.stripe.com/checkout.js\" class=\"stripe-button\"\n data-key=\"pk_test_SBvNgQvCWDApohiofKwLw5eb\"\n data-amount=\"${total}\"\n data-name=\"Demo Site\"\n data-description=\"Widget\"\n data-image=\"https://stripe.com/img/documentation/checkout/marketplace.png\"\n data-locale=\"auto\">\n </script>\n </form>`;\n\n $('#pay').html(html);\n }", "function displayMonthlyCosts() {\n var newCost = calculateMonthlyCosts();\n newCost = newCost - removedCosts;\n $('#monthlyCostsReport span').text(newCost);\n // NOTE: I didn't \"append\" this info to the DOM per the instructions, because we wanted to update the new value each time.\n} // END: displayMonthlyCosts()", "function updateValues() {\r\n //Toma los valores de cada transaccion ingresada\r\n const amounts = transactions.map(transaction => transaction.amount);\r\n //Sumando y restando todos los valores\r\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\r\n\r\n //Ingresos totales\r\n const income = amounts\r\n .filter(item => item > 0)\r\n .reduce((acc, item) => (acc += item), 0)\r\n .toFixed(2);\r\n\r\n //Egresos o expensas totales\r\n const expense = (\r\n amounts.filter(item => item < 0).reduce((acc, item) => (acc += item), 0) *-1\r\n ).toFixed(2);\r\n\r\n // Mostrando en pantalla lo calculado anteriormente\r\n balance.innerText = `$${total}`;\r\n money_plus.innerText = `$${income}`;\r\n money_minus.innerText = `$${expense}`;\r\n}", "function monthlyTotalCal(monthlySals) {\n\tconsole.log('In monthlyTotalCal function!');\n\tlet element2 = $('#total-salary');\n\telement2.empty();\n\telement2.append(new Intl.NumberFormat().format(monthlySals));\n}", "update(date, price) {\n // store for refresh\n this.date = date;\n this.price = price;\n\n const chart = this.container.get_parent().get_container(this.guid).chart;\n\n if (Object.keys(this.contracts).length == 0)\n return;\n\n const rate = parseFloat(\n document.\n getElementById(\"options_chart_rate\")\n .value\n );\n\n const start_time = Date.parse(chart.start_date);\n const until_date = Math.ceil((date.getTime() - start_time) / 86400000);\n\n for (var key in this.contracts) {\n const contract = this.contracts[key];\n\n // calculate dates until expiration\n const exp_date = new Date();\n exp_date.setDate(exp_date.getDate() + contract.dte);\n const diff = (exp_date.getTime() - date.getTime())\n const dte = Math.ceil(diff / 86400000);\n\n contract.sim_dte = dte;\n\n // calculate future values from the cursor's location\n contract.sim_value = theoretical(\n price,\n contract.strike,\n rate,\n contract.volatility,\n dte,\n contract.type\n );\n\n contract.itm = itm(\n price, contract.strike, contract.volatility,\n dte, contract.type\n ).toFixed(2);\n contract.otm = (1 - parseFloat(contract.itm)).toFixed(2);\n contract.below = below(\n chart.start_price, price,\n contract.volatility, until_date\n ).toFixed(2);\n contract.above = (1 - parseFloat(contract.below)).toFixed(2);\n\n contract.itm = isNaN(contract.itm) ? \"exp\" : contract.itm;\n contract.otm = isNaN(contract.otm) ? \"exp\" : contract.otm;\n contract.below = isNaN(contract.below) ? \"exp\" : contract.below;\n contract.above = isNaN(contract.above) ? \"exp\" : contract.above;\n }\n\n this.render(chart);\n }", "function calculate()\n{\t\n\tvar total_balance = 0\n\tvar total_payment = 0\n\n\t//$( '#total_balance' ).text('').empty()\n\n\t$( '.balance' ).each(\n\t\tfunction()\n\t\t{\n\t\t\tvar val = $( this ).val() * 1\n\t\t\tif( ! isNaN( val ) )\n\t\t\t\ttotal_balance += val\n\t\t} // function\n\t) // each\n\t\n\t$( '.minimum_payment' ).each(\n\t\tfunction()\n\t\t{\n\t\t\tvar val = $( this ).val() * 1\n\t\t\tif( ! isNaN( val ) )\n\t\t\t\ttotal_payment += val\n\t\t} // function\n\t) // each\n\t\n\t\n\t$( '#total_balance' ).text( money_format( total_balance ) )\n\t$( '#total_payment' ).text( money_format( total_payment ) )\n} // calculate", "function DebitCreditMemoApply(creditAppliedId,creditAppliedClass,defaultCreditBalClass,currCreditBalClass,payId,defaultTotalId,currTotalId,currTotalHiddenId,sumTotalId,sumTotalHiddenId,sumTotalClass){\n\n var creditApplied = $('#'+creditAppliedId); //CREDIT TO BE APPLIED TO CURRENT TOTAL\n var pay = $('#'+payId); //PAYMENT AMOUNT\n var defaultTotal = $('#'+defaultTotalId); //AMOUNT BALANCE TO BE PAID/RECEIVED\n var currTotal = $('#'+currTotalId); //AMOUNT PAID/RECEIVED\n var currTotalHidden = $('#'+currTotalHiddenId); //HIDDEN INPUT FOR CURRENT TOTAL\n var sumTotal = $('#'+sumTotalId); //SUM TOTAL TO BE RECEIVED/PAID BY ALL THE VENDOR/CUSTOMER SELECTED\n var sumTotalHidden = $('#'+sumTotalHiddenId); //HIDDEN INPUT FOR SUM TOTAL\n\n var creditAppliedVal = (creditApplied.val() == '') ? 0 : creditApplied.val();\n var payVal = (pay.val() == '') ? 0 : pay.val();\n var defaultTotalVal = (defaultTotal.val() == '') ? 0 : defaultTotal.val();\n var currTotalVal = (currTotal.val() == '') ? 0 : currTotal.val();\n\n var defaultCreditBalGet = document.getElementsByClassName(defaultCreditBalClass);\n defaultCreditBal = sumClassToArray(defaultCreditBalClass)/defaultCreditBalGet.length;\n\n \n var currCreditBalGet = document.getElementsByClassName(currCreditBalClass); \n var currCreditBal = sumClassToArray(currCreditBalClass)/currCreditBalGet.length; //CREDIT BALANCED APPLIED FROM/TO VENDOR/CUSTOMER\n \n \n if(currCreditBal > (parseFloat(creditAppliedVal)) ){ //CHECK IF CREDIT APPLIED IS GREATER THAT TOTAL CREDIT\n\n if((parseFloat(creditAppliedVal)+parseFloat(payVal) ) > defaultTotalVal){ //CHECK IF SUM OF CREDIT APPLIED AND CASH IS GREATER THAN BALANCE TO BE PAID/RECEIVED\n var newBal = (currTotalVal < 1) ? 0 : currTotalVal - creditAppliedVal;\n currTotal.val(newBal);\n currTotalHidden.val(newBal);\n var totalAmount = sumClassToArray(sumTotalClass); //SUM ALL THE TOTAL FROM EACH CUSTOMER/VENDOR TO GET ONE TOTAL AFTER OBTAINING VALUE OF CURR TOTAL\n sumTotal.val(totalAmount);\n sumTotalHidden.val(totalAmount);\n creditApplied.val('0.00'); //CLEAR CREDIT APPLIED\n\n }else{\n var newBal = decPoints(parseFloat(creditAppliedVal) + parseFloat(payVal),2);\n currTotal.val(newBal);\n currTotalHidden.val(newBal);\n var totalAmount = sumClassToArray(sumTotalClass); //SUM ALL THE TOTAL FROM EACH CUSTOMER/VENDOR TO GET ONE TOTAL AFTER OBTAINING VALUE OF CURR TOTAL\n sumTotal.val(totalAmount);\n sumTotalHidden.val(totalAmount);\n var creditBal = defaultCreditBal - sumClassToArray(creditAppliedClass) //CREDIT BALANCE TO UPDATE THE EXISTING CURRENCT/CHANGING BALANCE\n replaceClassInputWithVal(currCreditBalClass,decPoints(creditBal,2));\n }\n\n }else{ //CLEAR CREDIT APPLIED AND RESTORE PREVIOUS CURR TOTAL BALANCE\n var newBal = (currTotalVal < 1) ? 0 : currTotalVal - creditAppliedVal;\n\n currTotal.val(newBal);\n currTotalHidden.val(newBal);\n var totalAmount = sumClassToArray(sumTotalClass); //SUM ALL THE TOTAL FROM EACH CUSTOMER/VENDOR TO GET ONE TOTAL AFTER OBTAINING VALUE OF CURR TOTAL\n sumTotal.val(totalAmount);\n sumTotalHidden.val(totalAmount);\n\n creditApplied.val('0');\n\n }\n \n\n }", "function updateValues() {\n const deposits = TransactionData.map(transaction => transaction.deposit);\n const loans = TransactionData.map(transaction => transaction.loan);\n const total_deposit = deposits.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const total_loan = loans.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const bal = total_deposit - total_loan;\n balance.innerText = `$${bal}`;\n money_plus.innerText = `$${total_deposit}`;\n money_minus.innerText = `$${total_loan}`;\n reco.innerText = (bal >= 0)? \"You Have Sound Financial Health\": \"Your Financial Health is Weak\";\n}", "function addMonthlyCost() {\n console.log('in addDollars');\n\n console.log('getMonthlySalaries(employeesList)', getMonthlySalaries(employeesList) );\n \n // let monthlyCost = [];\n // monthlyCost.push(getMonthlySalaries(employeesList));\n // console.log('monthlySalaryList', monthlyCost);\n \n // let total = 0;\n // for (let i = 0; i < monthlyCost.length; i++) {\n // console.log('monthlyCost[i]:', monthlyCost[i]);\n \n // total += monthlyCost[i];\n // console.log('total:', total);\n // }\n\n // console.log('total:', total);\n \n \n \n //$('#totalMonthlyCost').text(` $${total}`);\n\n} // end addMonthlySalary", "function updateValues() {\n const amounts = getAmountsArray(transactions);\n const total = getTotal(amounts);\n const income = getIncome(amounts);\n const expense = getExpense(amounts);\n balance.innerText = \"€\" + total;\n money_plus.innerText = \"€\" + income;\n money_minus.innerText = \"€\" + expense;\n}", "function calcMonthlyPayment(amount, years, rate) {\n\t// console.log(amount, rate);\n let monthlyInterest = rate / 12;\n let loanMonths = years * 12;\n let divisor = 1 - Math.pow( (1 + monthlyInterest), -loanMonths)\n let numerator = (amount * monthlyInterest); \n let monthlyPayment = numerator / divisor;\n return Number(monthlyPayment.toFixed(2));\n}" ]
[ "0.7202287", "0.71418935", "0.6992992", "0.6990123", "0.68399566", "0.68137", "0.6664389", "0.6613709", "0.6575878", "0.6509075", "0.63771534", "0.63621736", "0.63377225", "0.632536", "0.6320026", "0.62468356", "0.6202225", "0.6181071", "0.61758596", "0.61697435", "0.61695105", "0.6092711", "0.6015346", "0.5987201", "0.596185", "0.58546305", "0.5829837", "0.5706145", "0.56780565", "0.5666939", "0.5657993", "0.5632616", "0.56161654", "0.5595043", "0.55913234", "0.5590901", "0.5566805", "0.55507964", "0.5525267", "0.55252635", "0.55208004", "0.5462111", "0.546118", "0.5452369", "0.54393065", "0.54373693", "0.54296386", "0.54262245", "0.5418021", "0.54038465", "0.53876907", "0.53868616", "0.53762406", "0.5343343", "0.53379613", "0.53175867", "0.53152823", "0.5312209", "0.5288586", "0.5283949", "0.5283894", "0.5282575", "0.527646", "0.5268184", "0.526428", "0.5252359", "0.5244537", "0.5241784", "0.5239113", "0.5233976", "0.52325964", "0.52318096", "0.52312696", "0.5230241", "0.5229518", "0.5225083", "0.5221926", "0.52151054", "0.52020675", "0.5197568", "0.51965195", "0.5192638", "0.5186487", "0.5184836", "0.51847845", "0.5182783", "0.51689214", "0.5164616", "0.5155802", "0.51552594", "0.51527345", "0.51515883", "0.5150682", "0.51348096", "0.5132989", "0.51294804", "0.51278716", "0.5126409", "0.5104795", "0.5103737" ]
0.5439871
44
Define a function to run once for each feature in the features array bind a popup describing the place and time of each earthquake
function onEachFeature(feature, layer) { layer.bindPopup( // for state text "<p class='state-text'>" + feature.properties.place.split(", ")[1] + "</p>" + "<hr>" + "<dl>" + // for location text "<dt class='popUp-title'>Location:</dt>" + "<dd class'popUp-val'>" + feature.properties.place.split(", ")[0] + "</dd>" + "</dt><br>" + // for magnitude text "<dt class='popUp-title'>Magnitude:</dt>" + "<dd class'popUp-val'>" + feature.properties.mag + " Richter</dd>" + "</dt><br>" + // for time text "<dt class='popUp-title'>Time:</dt>" + "<dd class'popUp-val'>" + new Date(feature.properties.time) + " Richter</dd>" + "</dt>\ </dl>" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onEachFeature(feature, layer) {\n // Give each feature a popup describing the place and time of the earthquake\n layer.bindPopup(`<h3> ${feature.properties.place} </h3> <hr> <p> ${Date(feature.properties.time)} </p>`);\n }", "function onEachFeature(feature, layer) {\n // does this feature have a property named popupContent?\n if (feature.properties && feature.properties.mag) {\n\n // Convert timestamp to formatted datetime\n var formattedDate = \"\";\n if (feature.properties.time) {\n var d = new Date(feature.properties.time);\n formattedDate = + d.getFullYear() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getDate();\n var hours = (d.getHours() < 10) ? \"0\" + d.getHours() : d.getHours();\n var minutes = (d.getMinutes() < 10) ? \"0\" + d.getMinutes() : d.getMinutes();\n var formattedTime = hours + \":\" + minutes;\n\n formattedDate = formattedDate + \" \" + formattedTime;\n }\n\n // Add popup with earthquake information\n layer.bindPopup('<h3>' + feature.properties.place + '</h3><hr>' +\n formattedDate + '<br>' +\n 'Magnitude ' + feature.properties.mag + '<br>' +\n '<a href = \"' + feature.properties.url + '\" target=\"_blank\" >More info</a>'\n );\n }\n}", "function onEachFeature(feature,layer){\n layer.bindPopup(\"<h3>Place: \" + feature.properties.place +\n \"</h3><hr><h3>Magnitude: \"+ feature.properties.mag +\n \"</h3><hr><h3>Time: \" + new Date(feature.properties.time) + \"</h3>\")\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) +\n \"</p><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3> Location: \" + feature.properties.place +\n \"<br> Magnitude: \" + feature.properties.mag + \n \"</h3> <hr><p>Occurrence Time: \" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n\t\t\"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\" +\n\t\t\"</h3><hr><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><p>\" + \"Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\" +\n \"<p>Magnitude:\" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\r\n layer.bindPopup(\"<h3>\" + feature.properties.place + \r\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>\" + feature.properties.mag + \"</p>\");\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + Math.round(feature.properties.mag * 100) / 100 +\n \" Magnitude Earthquake</h3><hr><p>\" + feature.properties.place +\n \"</p><p>\" + new Date(feature.properties.time) + \"</p>\")\n }", "function onEachFeatureFunc(feature, layer) {\n layer.bindPopup(\"Magnitude: \" + feature.properties.mag + \"<br>Location: \" + feature.properties.place+\"<br>Time:\"+new Date(feature.properties.time));\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(`<h3>${feature.properties.place}</h3><hr>\n <h3>Magnitude: ${feature.properties.mag}</h3><hr><p>${new Date(feature.properties.time)}</p>`);\n }", "function onEachFeature(feature, layer) {\r\n layer.bindPopup(\"<h3>\" + feature.properties.place +\r\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.place +\n \"</p><p>\" + new Date(feature.properties.time) + \"</p>\" +\n \"<p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function createFeatures(earthquakeData) { \n // Define a function to run once for each feature in the features array\n // Give each feature a popup describing the place, date/time and magnitude of the earthquake \n var earthquakes = L.geoJSON(earthquakeData, {\n \n onEachFeature: function (feature, layer){\n layer.bindPopup(`<strong>Place:</strong> ${feature.properties.place}<br>\n <strong>Time:</strong> ${new Date(feature.properties.time)}<br>\n <strong>Magnitude:</strong> ${feature.properties.mag}`);\n },\n \n pointToLayer: function (feature, latlng) {\n return new L.circle(latlng,\n {radius: getRadius(feature.properties.mag),\n fillColor: getColor(feature.properties.mag),\n color: \"#000\",\n weight: .5,\n fillOpacity: .6,\n stroke: true\n })\n }\n });\n // Send earthquakes layer to the createMap function\n createMap(earthquakes); \n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3><hr><p>Magnitude: \" +\n feature.properties.mag + \"</p><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + \"Magnitude: \" + feature.properties.mag + \". \" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p align='left'>Magnitude: \" + \"<strong>\" + feature.properties.mag + \"</strong><br>\" +\n \"Time: \" + \"<strong>\" + new Date(feature.properties.time) + \"</strong></p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \". <br> Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p> Magnitude = \" + feature.properties.mag + \"</p>\" +\n \"<hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n\n // bind popup with additional detail to each marker\n layer.bindPopup(\"<h3>Earthquake Details</h3><hr><strong>Location: </strong>\" + feature.properties.place + \"<br><strong>Magnitude: </strong>\" + feature.properties.mag + \"<br><strong>Date/Time: </strong>\" + new Date(feature.properties.time) + \"<br><strong>Depth: </strong>\" + feature.geometry.coordinates[2]);\n }", "function do_OnEachFeature(feature, obj) {\r\n obj.bindPopup(\"<h2>\" + feature.properties.title +\r\n \"</h2><hr>\" + \"<h4>\" + new Date(feature.properties.time) + \"</h4>\"\r\n + \"<h4>\" + \"For more information on this event visit:\" + \"</h4>\"\r\n + \"<h5>\" + feature.properties.url + \"</h5></p>\");\r\n\r\n console.log(feature);\r\n\r\n\r\n// Set color of markers\r\n\r\n var color = \"\";\r\n if (feature.properties.mag > 5.5) {\r\n color = \"red\" \r\n }\r\n else if (feature.properties.mag > 5) {\r\n color = \"orange\"\r\n }\r\n else if (feature.properties.mag > 4.5) {\r\n color = \"light orange\"\r\n }\r\n else {\r\n color = \"yellow\"\r\n }\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3> Place: \" + feature.properties.place + \"</h3><h3>Magnitude:\" + feature.properties.mag + \"</h3><h3>Depth:\" + feature.geometry.coordinates[2] + \"</h3><h3>Time:\" + new Date(feature.properties.time) + \"</h3>\")\n\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3 align ='center'>\" + feature.properties.place +\n \"</h3><hr><p><strong>Time: <strong>\" + new Date(feature.properties.time) + \"</p>\" +\n \"</h3><p><strong>Magnitude: <strong>\" + feature.properties.mag + \"</p>\" +\n \"</h3><p><strong>Depth: <strong>\" + feature.geometry.coordinates[2] + \"</p>\");\n }", "function onEachFeature(feature, layer) { \n layer.bindPopup(\"<h2>\" + feature.properties.place +\n \"</h2><hr><h4>Magnitude: \" + feature.properties.mag + \"</h4><hr><h4>Depth: \" + feature.geometry.coordinates[2] + \"km</h4><hr><p>\" + new Date(feature.properties.time) + \"</p>\")\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3>\" +\n \"Magnitude: <strong>\" + feature.properties.mag + \"</strong><hr>\" +\n \"<p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.title +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"<p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + `Location: ${feature.properties.place}` + \"</h3><hr><p>\" +\n `<strong>Time</strong>: ${new Date(feature.properties.time)}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>magnitude</strong>: ${feature.properties.mag}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>Status</strong>: ${feature.properties.status}` + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>Date & Time: \" + new Date(feature.properties.time) +\n \"<br>Magnitude: \" + feature.properties.mag +\n \"<br>Depth: \" + feature.geometry.coordinates[2] + \"</p>\");\n }", "function onEachFeature(feature, layer) {\r\n\r\n // date formatter for popup\r\n var format = d3.timeFormat(\"%d-%b-%Y at %H:%M\");\r\n\r\n layer.bindPopup(`<strong>Place: </strong> ${feature.properties.place}<br><strong>Time: </strong>${format(new Date(feature.properties.time))}<br><strong>depth: </strong>${feature.properties.mag}<br><strong>Depth: </strong>${feature.geometry.coordinates[2]}`);\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p><b>Magnitude:</b> \" + feature.properties.mag + \"</p>\");\n}", "function createFeatures(Earthquakes_data) {\n\n /*** First get marker color and radius \n * based on earthquake magnitude classes\n * found here: http://www.geo.mtu.edu/UPSeis/magnitude.html */\n function getRadius(d){\n return d > 8 ? 192:\n d > 7 ? 96 :\n d > 6 ? 48 :\n d > 5 ? 24 :\n d > 4 ? 12 :\n 6;\n }\n function getColor(d) { // ranges from pale yellowish to dark reddish\n return d > 8 ? '#710016' :\n d > 7 ? '#E31A1C':\n d > 6 ? '#FC4E2A' :\n d > 5 ? '#FD8D3C' :\n d > 4 ? '#fec981' :\n '#fff6cf';\n }\n function geojsonMarkerOptions(feature) {\n return {\n radius: getRadius(feature.properties.mag),\n fillColor: getColor(feature.properties.mag),\n color: \"#000\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.8\n };\n\n } // end geojsonMarkerOptions()\n\n /*** Binds popup on each circle feature.\n * Used below in the L.geoJSON for Earthquake data */\n function onEachFeature(feature, layer) {\n // if properties is not empty\n if (feature.properties) {\n layer.bindPopup(\n \"Event: \" + feature.properties.title \n + \"<hr>Time: \" \n + getTime(feature.properties.time)\n );\n \n // popups on circle on hover and close when mouse moves out\n layer.on(\"mouseover\", function(event){\n this.openPopup();\n });\n layer.on('mouseout', function (e) {\n this.closePopup();\n });\n\n // function: Get readable date from UTC time stamp in the api\n function getTime(feature) {\n var date = new Date(feature);\n // Day part of the timestamp\n var getDate = date.getUTCDate();\n // month part of the timestamp\n var utcMonth = date.getUTCMonth();\n // returns the month based on UTC month (range: 0-11)\n var month = new Array(12);\n month[0] = \"January\";\n month[1] = \"February\";\n month[2] = \"March\";\n month[3] = \"April\";\n month[4] = \"May\";\n month[5] = \"June\";\n month[6] = \"July\";\n month[7] = \"August\";\n month[8] = \"September\";\n month[9] = \"October\";\n month[10] = \"November\";\n month[11] = \"December\";\n var getMonth = month[utcMonth];\n // Hours part from the timestamp\n var hours = date.getUTCHours();\n // Minutes part from the timestamp\n var minutes = \"0\" + date.getUTCMinutes();\n // Will display time in 10:30:23 format\n var formattedTime = getMonth + \" \" + getDate + \" - \" \n + hours + ':' + minutes.substr(-2) + \" UTC\"; \n return formattedTime;\n } // end function getTime(feature)\n } // end if (feature.properties)\n } //End onEachFeature()\n\n // *** leaflet geoJSON to convert data into circles on the map w/ other features\n var quakePoints = \n // add to time dimension control\n L.geoJson(Earthquakes_data, {\n pointToLayer: function (feature, latlng) {\n return L.circleMarker(latlng); // create circle for each coordinate\n },\n style: geojsonMarkerOptions,\n onEachFeature: onEachFeature // to bind mouse-hover popups\n }); // end geoJSON\n\n /*** Time dimension layer for earthquake points, auto get dimensions***/\n TimeDimLay = L.timeDimension.layer.geoJson(quakePoints, {\n addlastPoint: true, // add point for earliest data\n updateTimeDimension: true // use the time dimensions range for this geoJson layer \n }).addTo(mymap); \t\n\n // add to master control layer\n controlLayers.addOverlay(TimeDimLay, 'Earthquake Points');\n\n // *** Add fault lines to mymap \n var faultsURL = \"https://raw.githubusercontent.com/fraxen/tectonicplates/master/GeoJSON/PB2002_plates.json\" \n d3.json(faultsURL, function(faultsData) {\n drawFaults(faultsData.features);\n });\n\n function drawFaults(faultsData) {\n var faultLayer = L.geoJSON(faultsData, {\n pointToLayer: function (feature, latlng) {\n return new L.polyline(latlng);\n },\n }).addTo(mymap);\n controlLayers.addOverlay(faultLayer, 'Fault Lines');\n // bring to front earthquake data points when page first loads\n TimeDimLay.bringToFront();\n }\n\n /*** Always keep quakePoints time dimension layer in front\n * add eventlistener for whenever layers are overlayed. \n * Keep Earthquake data at the front */\n mymap.on(\"overlayadd\", function (event) {\n TimeDimLay.bringToFront();\n });\n\n // *** Create legend at bottom-right\n // adapted from http://leafletjs.com/examples/choropleth/\n var legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function (map) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 4, 5, 6, 7, 8],\n labels = [\"Minor\", \"Light\", \"Moderate\", \"Strong\", \"Major\", \"Great\"];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n \"(\" + grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + \") \" \n + labels[i] + '<br>' : \"+) \" + labels[i]);\n }\n\n return div;\n };\n\n\n // adding legend to mymap\n legend.addTo(mymap);\n\n} //end createFeatures()", "function createFeatures(quakeData, tectonicData) {\n /**** onEachFeature properties ******** */\n function onEachFeature(feature, layer) {\n // Does this feature have a property ?\n if (feature.properties) {\n // Create a popup that provides detailed description\n popupContent = \"<h3>\" + feature.properties.place +\n \"</h3> <h4> Magnitude: \" + feature.properties.mag + \"</h4><hr><p>\" + \n new Date(feature.properties.time) + \"</p>\";\n layer.bindPopup(popupContent,{offset: new L.Point(0, -10)});\n }\n }\n // Creating earthquakes overlay map\n var earthquakes = L.geoJSON(quakeData, {\n pointToLayer: function(quakeData, latlng){\n return L.circle ( latlng,{ \n radius: MarkerSize(quakeData.properties.mag),\n fillColor: MarkerColors(quakeData.properties.mag),\n fillOpacity: 1.0,\n weight: 1,\n color: \"black\",\n className: 'blinking'\n });\n },\n onEachFeature: onEachFeature\n }); \n // Creating tectonic plates overlay map\n var tectonic_plates = L.geoJSON(tectonicData, {\n style: function(feature){\n return {color: \"orange\",\n weight: 2};\n },\n onEachFeature: function(feature, layer ){\n // Create a popup that provides detailed description\n popupContent = \"<h3>\" + feature.properties.Name +\n \"</h3><h4> PlateA: \" + feature.properties.PlateA + \n \"<br>PlateB:\" + feature.properties.PlateB +\"</h4> <hr><p>\" + \n feature.properties.Source + \"</p>\";\n layer.bindPopup(popupContent)\n }\n });\n\n // Sending our earthquakes layer to the createMap function\n createMap(earthquakes, tectonic_plates);\n}", "function createFeatures(quakeData) {\n /**** onEachFeature properties ******** */\n function onEachFeature(feature, layer) {\n // Does this feature have a property ?\n if (feature.properties) {\n // Create a popup that provides detailed description\n popupContent = \"<h3>\" + feature.properties.place +\n \"</h3> <h4> Magnitude: \" + feature.properties.mag + \"</h4><hr><p>\" + \n new Date(feature.properties.time) + \"</p>\";\n layer.bindPopup(popupContent,{offset: new L.Point(0, -10)});\n }\n }\n // Creating earthquakes overlay map\n var earthquakes = L.geoJSON(quakeData, {\n pointToLayer: function(quakeData, latlng){\n return L.circle ( latlng,{ \n radius: MarkerSize(quakeData.properties.mag),\n fillColor: MarkerColors(quakeData.properties.mag),\n fillOpacity: 1.0,\n weight: 1,\n color: \"black\",\n className: 'blinking'\n });\n },\n onEachFeature: onEachFeature\n }); \n // Sending our earthquakes layer to the createMap function\n createMap(earthquakes);\n}", "function createFeatures(earthquakeData) {\n\n // nested onEachFeature function to create the popup that shows individual earthquake data\n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.title +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"<p>\");\n }\n\n // nested pointToLayer function to create the markers based on the markerSize & markerColor features designated \n function pointToLayer (feature, latlng) {\n return new L.CircleMarker(latlng, {\n radius: markerSize(feature.properties.mag),\n fillColor: markerColor(feature.properties.mag),\n color: \"#000000\",\n weight: 1,\n fillOpacity: 1\n});\n }\n\n// create a GeoJson layer calling both previous functions, which will use and store all necesary features for data display\n var earthquakes = L.geoJSON(earthquakeData, {\n onEachFeature: onEachFeature,\n pointToLayer: pointToLayer,\n });\n\n // create the map \n createMap(earthquakes);\n}", "function createFeatures(earthquakeData) {\n // function to add popup info about each earthquake\n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + `Location: ${feature.properties.place}` + \"</h3><hr><p>\" +\n `<strong>Time</strong>: ${new Date(feature.properties.time)}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>magnitude</strong>: ${feature.properties.mag}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>Status</strong>: ${feature.properties.status}` + \"</p>\");\n }\n\n // Create a GeoJSON layer containing the features array on the earthquakeData object\n // Run the onEachFeature function once for each piece of data in the array\n let layerToMap = L.geoJSON(earthquakeData, {\n onEachFeature: onEachFeature,\n\n // define marker circle radius and color based on earthquake magitude..\n pointToLayer: function pointToLayer(feature, latlng) {\n let radius = feature.properties.mag * 5.0;\n let magnitude = feature.properties.mag;\n\n if (magnitude > 5) {\n fillcolor = '#ea2c2c';\n }\n else if (magnitude > 4) {\n fillcolor = '#ea822c';\n }\n else if (magnitude > 3) {\n fillcolor = '#ee9c00';\n }\n else if (magnitude > 2) {\n fillcolor = '#eecc00';\n }\n else if (magnitude > 1) {\n fillcolor = '#d4ee00';\n }\n else fillcolor = '#98ee00';\n\n return L.circleMarker(latlng, {\n radius: radius,\n color: 'black',\n fillColor: fillcolor,\n fillOpacity: 1,\n weight: 0.5\n });\n }\n });\n\n // create marker circles\n createMap(layerToMap);\n}", "function createFeatures(earthquakeData) {\n\n // Define function which determines the circle size\n function markerSize(mag) {\n return mag * 5;\n }\n\n // Define function which determines the circle size\n function chooseColor(mag) {\n switch (true) {\n case mag > 5:\n return \"#f06b6b\";\n case mag > 4:\n return \"#f0a76b\";\n case mag > 3:\n return \"#f3ba4d\";\n case mag > 2:\n return \"#f3db4d\";\n case mag > 1:\n return \"#e1f34d\"; \n default:\n return \"#b7f34d\";\n }\n }\n\n // Define a function which creates circles for each feature \n function pointToLayer(feature, latlng) {\n\n return L.circleMarker(latlng, {\n radius: markerSize(feature.properties.mag),\n fillColor: chooseColor(feature.properties.mag),\n color: \"#000\",\n weight: 0.5,\n opacity: 1,\n fillOpacity: 1\n });\n }\n\n // Define a function which binds a popup for each feature \n function onEachFeature(feature, layer) {\n \n layer.bindPopup(\"<h3> Magnitude: \" + feature.properties.mag +\n \"</h3><hr><p>\" + feature.properties.place + \"</p>\");\n }\n\n // Create a GeoJSON layer containing the features array and add it to the map\n L.geoJSON(earthquakeData, {\n\n // Call circles function\n pointToLayer: pointToLayer,\n\n // Call popups function\n onEachFeature: onEachFeature\n\n }).addTo(myMap);\n\n}", "function oneachfeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>Magnitude: \" + (feature.properties.mag) + \"</p>\");\n }", "function addPopup(feature, layer) {\n // Give each feature a popup describing the place and time of the earthquake\n return layer.bindPopup(`<h3> ${feature.properties.place} </h3> <hr> <h4>Magnitude: ${feature.properties.mag} </h4> <p> ${Date(feature.properties.time)} </p>`);\n}", "function onEachFeature(feature, layer) {\n // First we get the define a the variable earthquake_day_of_week\n // Then see use a switch-case statement to check the numbered day of the earthquake\n // and defined it the day of the week in words as appropriate\n // that is, 0 = Sunday, 1 = Monday, ..., 6 = Saturday\n var earthquake_day_of_week;\n switch (new Date(feature.properties.time).getDay()) {\n case 0:\n earthquake_day_of_week = \"Sunday\";\n break;\n case 1:\n earthquake_day_of_week = \"Monday\";\n break;\n case 2:\n earthquake_day_of_week = \"Tuesday\";\n break;\n case 3:\n earthquake_day_of_week = \"Wednesday\";\n break;\n case 4:\n earthquake_day_of_week = \"Thursday\";\n break;\n case 5:\n earthquake_day_of_week = \"Friday\";\n break;\n default:\n earthquake_day_of_week = \"Saturday\";\n break;\n }\n \n // Next we define the earthquake_date variable to gold the date of the earthquake\n var earthquake_date = new Date(feature.properties.time).toLocaleDateString();\n\n // Then we define earthquake_time_hours to hold the hour of the time the earthquake happened\n // If the hour is less than 0, we concatenate a 0 before it for a more natural-looking time\n // That is, for example: 06:30 lookds better than 6:30\n var earthquake_time_hours = new Date(feature.properties.time).getHours() < 10 ?\n \"0\" + new Date(feature.properties.time).getHours() : new Date(feature.properties.time).getHours();\n\n // After that we define earthquake_time_hours to hold the minuts of the time the earthquake happened\n // If the minute is less than 0, we concatenate a 0 before it for a more natural-looking time\n // That is, for example: 06:05 lookds better than 06:5\n var earthquake_time_minutes = new Date(feature.properties.time).getMinutes() < 10 ?\n \"0\" + new Date(feature.properties.time).getMinutes() : new Date(feature.properties.time).getMinutes();\n \n // Finally we concatenate the earthquake_time_hours variable with the earthquake_time_minutes for a full nicely-formatted time.\n var earthquake_time = earthquake_time_hours + \":\" + earthquake_time_minutes\n layer.bindPopup(`<h3>Location: ${feature.properties.place}</h3><hr><p>Date: ${earthquake_day_of_week}, ${earthquake_date}</p><p>Time: ${earthquake_time}</p><p>Magnitude: ${feature.properties.mag}</p>`);\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(`<h3>${feature.properties.place}</h3><p>Magnitude: ${(feature.properties.mag)}</p>`);\n }", "function createFeatures(earthquakeData) {\n\n\n // define function to run on each feature in features array\n function onEachFeature(feature, layer) {\n\n // bind popup with additional detail to each marker\n layer.bindPopup(\"<h3>Earthquake Details</h3><hr><strong>Location: </strong>\" + feature.properties.place + \"<br><strong>Magnitude: </strong>\" + feature.properties.mag + \"<br><strong>Date/Time: </strong>\" + new Date(feature.properties.time) + \"<br><strong>Depth: </strong>\" + feature.geometry.coordinates[2]);\n }\n\n\n\n // create geojson layer\n var earthquakes = L.geoJSON(earthquakeData, {\n onEachFeature: onEachFeature,\n\n\n // define radius based on marker size and opacity based on depth of earthquake\n // refered to this website for help on pointToLayer: https://leafletjs.com/examples/geojson/\n pointToLayer: function(feature, latlng) {\n return new L.circle(latlng, {\n radius: markerSize(feature.properties.mag),\n fillColor: getColor(feature.geometry.coordinates[2]),\n color: getColor(feature.geometry.coordinates[2]),\n opacity: 5\n });\n }\n \n });\n\n\n // send earthquakes layer to createMap function\n createMap(earthquakes);\n}", "function onEachFeature (feature, featureLayer) { 
 \n if (feature.properties && feature.properties.Museum && feature.properties.Activity && feature.properties.Link) {\n 
 featureLayer.bindPopup('<h7>' + feature.properties.Museum + '</h7><br>' + '<b>' + '<h8>' + feature.properties.Activity + '</h8>'+ '</b><br>' \n + '<p class=\"maptext\">' + feature.properties.Short_Description + '</p>' + '<p class=\"maplink\">' + '<a href=\"'+feature.properties.Link+'\" target=\"_blank\">' + feature.properties.Link + '</a>'+'</p>'); 
 
\n }\n 
 //if no properties, popup saying record is being updated 
 \n var popupContent = \"<p>ops, I'm being updated</p>\"; 
\n }", "function onEachFeature(features, layer) {\n layer.bindPopup(\"<strong>\" + (features.properties.place).split(\"of\").pop() + \"</strong>\" +\n \"<li>\"+\"Magnitude: \" + features.properties.mag + \"</li>\" + \"<li>\" + \"Depth: \" + features.geometry.coordinates[2]+ \"</li>\" );\n }", "function createFeatures(earthquakeData) {\n var earthquakes = L.geoJSON(earthquakeData, {\n onEachFeature: function(feature, layer) {\n layer.bindPopup(\"<h2>\" + feature.properties.place +\n \"</h2><h3>Magnitude: \" + feature.properties.mag + \"</h3>\" +\n \"<p>\" + new Date(feature.properties.time) + \"</p>\");},\n\n pointToLayer: function (feature, latlng) {\n return new L.circle(latlng,\n {radius: getRadius(feature.properties.mag),\n fillColor: getColor(feature.properties.mag),\n fillOpacity: .5,\n color: \"black\",\n stroke: true,\n weight: .8\n })\n }\n });\n\n createMap(earthquakes);\n}", "function createFeatures(earthquakeData) {\n\n // Create a GeoJSON layer containing the features array on the earthquakeData object\n var earthquakes = L.geoJSON(earthquakeData, {\n\n // Create circle markers based on earthquake magnitude\n pointToLayer: function(feature) {\n return L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], {\n fillColor: circleHue(+feature.properties.mag), // Use function to apply marker fill based on magnitude\n color: \"rgb(153,51,204)\",\n weight: 0.5,\n opacity: 0.7,\n fillOpacity: 0.7,\n radius: calcRadius(+feature.properties.mag) // Use function to calculate radius based on magnitude \n });\n },\n\n \n // Define a function we want to run once for each feature in the features array\n // Give each feature a popup describing the place and time of the earthquake\n onEachFeature: function(feature, layer) {\n layer.bindPopup(\"<h5>\" + feature.properties.place +\n \"</h5><hr><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }\n \n });\n\n // Sending our earthquakes layer to the createMap function\n createMap(earthquakes);\n}", "function onEachFeature(feature, layer) {\n // if properties is not empty\n if (feature.properties) {\n layer.bindPopup(\n \"Event: \" + feature.properties.title \n + \"<hr>Time: \" \n + getTime(feature.properties.time)\n );\n \n // popups on circle on hover and close when mouse moves out\n layer.on(\"mouseover\", function(event){\n this.openPopup();\n });\n layer.on('mouseout', function (e) {\n this.closePopup();\n });\n\n // function: Get readable date from UTC time stamp in the api\n function getTime(feature) {\n var date = new Date(feature);\n // Day part of the timestamp\n var getDate = date.getUTCDate();\n // month part of the timestamp\n var utcMonth = date.getUTCMonth();\n // returns the month based on UTC month (range: 0-11)\n var month = new Array(12);\n month[0] = \"January\";\n month[1] = \"February\";\n month[2] = \"March\";\n month[3] = \"April\";\n month[4] = \"May\";\n month[5] = \"June\";\n month[6] = \"July\";\n month[7] = \"August\";\n month[8] = \"September\";\n month[9] = \"October\";\n month[10] = \"November\";\n month[11] = \"December\";\n var getMonth = month[utcMonth];\n // Hours part from the timestamp\n var hours = date.getUTCHours();\n // Minutes part from the timestamp\n var minutes = \"0\" + date.getUTCMinutes();\n // Will display time in 10:30:23 format\n var formattedTime = getMonth + \" \" + getDate + \" - \" \n + hours + ':' + minutes.substr(-2) + \" UTC\"; \n return formattedTime;\n } // end function getTime(feature)\n } // end if (feature.properties)\n } //End onEachFeature()", "function featPopUp(feat, layer) {\n\t\tlayer.bindPopup(\"<h3>\" + feat.properties.place +\"</h3>\" +\n\t\t\t\t\t\t\"<hr><p>\" + new Date(feat.properties.time) + \"</p></hr>\" +\n\t\t\t\t\t\t\"<hr><p> Magnitude: \" + feat.properties.mag + \"</p>\");\t\t\t\t\n\t}", "function createFeatures(earthquakeData) {\n // Give each feature a popup describing the place and time of the earthquake\n function onEachFeature(feature, layer) {\n layer.bindPopup(feature.properties.title + \"<hr>\" + new Date(feature.properties.time) + \" | Depth: \" + feature.geometry.coordinates[2] + \" km\");\n }\n\n // Create a GeoJSON layer containing the features array on the earthquakeData object\n // Run the onEachFeature function once for each piece of data in the array\n var earthquakes = L.geoJSON(earthquakeData, {\n pointToLayer: function (feature, latlng) {\n return L.circleMarker(latlng, {radius: markerSize(feature.properties.mag), \n fillColor: getColor(feature.properties.mag), \n color: \"#000\", \n opacity: 0.3, \n fillOpacity: 0.8});\n },\n onEachFeature: onEachFeature\n });\n\n // Sending earthquakes layer to the createMap function\n createMap(earthquakes);\n}", "function onEachFeature(feature, layer) { \n layer.bindPopup(\"<h3>\"+feature.properties.state +\"</h3><hr><p>\" + feature.properties.Name +\"</p><hr><p>\" + \"year: 1980 to 2018\" + \"</p><hr><p>\"+ \"Number:\" + feature.properties.Number +\"</p>\");\n }", "function onEachFeature(feature, layer) {\n \n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p> Magnitude \" + feature.properties.mag +\n \"</p><hr><p>Depth \" + feature.geometry.coordinates[2] + \"(km)</p>\");\n }", "function onEachFeature(feature, layer) {\n // Loop through the cities array and create one marker for each city object\n for (var i = 0; i < feature.length; i++) {\n L.circle(feature[i].location, {\n fillOpacity: 0.75,\n color: \"white\",\n fillColor: \"purple\",\n // Setting our circle's radius equal to the output of our markerSize function\n // This will make our marker's size proportionate to the earthquakes magnitude\n radius: markerSize(feature[i].properties.mag)\n })\n }\n layer.bindPopup(\"<h3>\" + feature.properties.title +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(feature.properties.title + \"<hr>\" + new Date(feature.properties.time) + \" | Depth: \" + feature.geometry.coordinates[2] + \" km\");\n }", "function onEachFeature(feature, layer) {\r\n// Creating a HTML string with all of the properties\r\n var popupContent = \"\";\r\n if (feature.properties) {\r\n// Creating a loop to add feature property names and values to the html string\r\n for (var property in feature.properties){\r\n popupContent += \"<p>\" + property + \":\" + feature.properties[property] + \"</p>\";\r\n }\r\n layer.bindPopup(popupContent);\r\n }\r\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(makePopupContent(feature), {\n closeButton: false,\n offset: L.point(0, -8),\n });\n}", "function createFeatures(quakeData) {\n \n // Bind popups to each marker and add info from the API to the popups. \n // Adjusts date to be more readible.\n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p> Magnitude = \" + feature.properties.mag + \"</p>\" +\n \"<hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n\n // Create points based on the geoJSON data in the API.\n // Make the markers into different colored and sized circles based on the magnitude.\n var quakeLocations = L.geoJSON(quakeData, {\n pointToLayer: function(quakeData, latlng) {\n return L.circle(latlng, {\n radius: radiusSize(quakeData.properties.mag),\n color: \"black\",\n weight: .5,\n fillColor: circleColor(quakeData.properties.mag),\n fillOpacity: 1\n });\n },\n onEachFeature: onEachFeature\n });\n\n // Create a map layer of the earthquake locations\n createMap(quakeLocations);\n}", "function onEachFeature(feature, layer) {\n \n layer.bindPopup(\"<h3> Magnitude: \" + feature.properties.mag +\n \"</h3><hr><p>\" + feature.properties.place + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n\n\t//* No field named 'popupContent', so create html string using all fields/properties\n\tvar popupContent = \"\";\n\n\tif (feature.properties) {\n\n\t\t//* Loop through all features\n\t\t//* and add feature property names (fields) and values to html string\n\t\tfor (var property in feature.properties){\n\n\t\t\t// this prints out the value of each field\n\t\t\t// console.log(\"property: \",feature.properties[property]);\n\t\t\t\n\t\t\tvar myValue = String(feature.properties[property]);\n\t\t\tconsole.log(\"myValue: \", myValue, \" property: \",property);\n\n\t\t\t//* Do Not Include 'Area' or 'FIPS' Columns in the Popup\n\t\t\tif (property != 'Area' && property != 'FIPS'){\n\t\t\t\tpopupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\n\t\t\t};\n\n\t\t} // end for()\n\t\t\n\t\tlayer.bindPopup(popupContent);\n\t};\n\n}", "function onEachFeature(feature, layer) {\r\n\r\n //abracadabra\r\n let stopId = feature.properties.stopId;\r\n let stopTitle = feature.properties.title;\r\n // let muniLine = feature.properties.Route;\r\n\r\n let stopInfo = APICallResponse.filter(function(stop) {\r\n return stop.stop_point_ref == stopId;\r\n });\r\n\r\n // console.log(stopInfo.length, feature.properties.Route);\r\n // console.log(\"stops being used\", stopInfo, feature.properties.Route, stopId);\r\n\r\n\r\n // if the stopID was found in the APICallResponse and there were no duplicate stop IDs found, then it will return an array with length 1\r\n if(stopInfo.length == 1){\r\n\r\n let direction = stopInfo[0].direction_ref;\r\n let lines = stopInfo[0].lines;\r\n\r\n layer.bindPopup(\r\n \"<h4>\" + \"Stop ID: \" + stopId + \"</h4>\" +\r\n \"<h4>\" + \"Direction: \" + direction + \"</h4>\" + \r\n \"<h4>\" + \"Title: \" + stopTitle + \"</h4>\" + \r\n linesInfo(lines)\r\n );\r\n\r\n // this function is used to generate the HTML for each line in the lines array\r\n function linesInfo(linesArray){\r\n\r\n let htmlBlock = \"\";\r\n \r\n linesArray.forEach((line) =>{\r\n\r\n let lineName = line.line_ref;\r\n let minLate = line.scores.min_late;\r\n let shameScorePredictionLabel = line.scores.prediction_label;\r\n let shameScoreDescription = shameScoreInfo[shameScorePredictionLabel].description;\r\n\r\n // console.log(\"minstype\", minLate);\r\n // console.log(\"mintype\", typeof(minLate));\r\n\r\n if(typeof(minLate) == \"number\"){\r\n minLate = parseFloat(minLate.toFixed(2));\r\n // console.log(\"minslate\", minLate);\r\n minLate = hhmmss(minLate);\r\n // console.log(\"minslate 2\", minLate);\r\n \r\n }\r\n\r\n if(userSelectedMUNILineList.includes(lineName)){\r\n htmlBlock += \"<hr>\" +\r\n \"<p>\" + \r\n \"<big><b>Line: </b>\" + lineName + \"</big><br><br>\" +\r\n \"<b>Current Shame Score: </b>\" + shameScoreDescription + \"<br>\" +\r\n \"<b>Current Trip Prognosis: </b>There is a 50% chance that this bus will be \" + shameScorePredictionLabel + \"<br>\" + \"<br>\" +\r\n \"<b>Historical average minutes late: </b>\" + minLate + \r\n \"</p>\";\r\n\r\n }\r\n\r\n });\r\n \r\n return htmlBlock;\r\n }\r\n\r\n\r\n } else {\r\n layer.bindPopup(\r\n \"<h4>\" + \"Stop ID: \" + stopId + \"</h4>\" +\r\n \"<hr>\" +\r\n \"<b>\" + \"Title: \" + \"</b>\" + stopTitle + \"</p>\"\r\n );\r\n }\r\n }", "function onEachFeature(possible_roundabouts, layer) {\n\t\tvar popupContent = \n\t\t\t\t\"<p><b>\"+ possible_roundabouts.properties.type+\"</b></p>\"\n +\"<p>Id: <label id=\\\"geoId\\\">\"+possible_roundabouts.properties.id+\"</label></p>\"\n +\"<p>Status: <label id=\\\"status\\\">\"+getCurrentStatusForId(possible_roundabouts.properties.id)+\"</label></p>\"\n +\"<p><a href=\"+possible_roundabouts.properties.url+\" target='_blank'>\"+\"Edit in iD\"+\"</a>\"\n +\" | \" \n +\"<a href=\"+possible_roundabouts.properties.josm+\" target='_blank'>\"+\"Edit in JOSM\"+\"</a>\"+\"</p>\"\n +\"<button id=\\\"falsePositiveButton\\\" onClick=\\\"setFalsePositive()\\\">False Positive</button>\" \n +\"<button id=\\\"closedButton\\\" onClick=\\\"setClosed()\\\">Closed</button>\"\n +\"<button id=\\\"clearStatusButton\\\" onClick=\\\"setClear()\\\">Clear Status</button>\"\n ; \n\n if (possible_roundabouts.properties && possible_roundabouts.properties.url) {\n\t\t\tpopupContent;\n\t\t}\n\t\tlayer.bindPopup(popupContent);\n}", "function onEachFeature(feature, layer) {\n\tvar popupContent = rosenholm;\n/*\n\tif (feature.properties && feature.properties.popupContent) {\n\t\tpopupContent += feature.properties.popupContent;\n\t}\n*/\n\tlayer.bindPopup(popupContent);\n}", "function onEachFeature4 (feature,layer) {\n layer.on('click',function(event){\n layer.bindPopup(\"The hourly departure projection of selected station rounds to \" + Math.round(feature.properties.predict));\n map.setView(event.latlng,15);\n });\n }", "function createFeatures(earthquakeData) {\n \n function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }\n\n // Read GeoJSON data, create circle markers, and add to earthquake layer group\n L.geoJSON(earthquakeData, {\n pointToLayer: function (feature, latlng) {\n return L.circleMarker(latlng, {\n radius: feature.properties.mag * 5,\n fillColor: chooseColour(feature.properties.mag),\n color: \"black\",\n weight: 0.5,\n opacity: 0.5,\n fillOpacity: 0.8\n });\n },\n onEachFeature: onEachFeature\n }).addTo(earthquakes);\n\n // Define street map layer\n var streetmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/streets-v11\",\n accessToken: API_KEY\n });\n\n // Define satellite map layer\n var satellitemap = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.satellite\",\n accessToken: API_KEY\n });\n\n // Define outdoors map layer\n var outdoorsmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/outdoors-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox/outdoors\",\n accessToken: API_KEY\n });\n\n // define greyscale map layer\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors,\\\n <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.light\",\n accessToken: API_KEY\n });\n\n // Define the baseMaps for the map types we created above\n var baseMaps = {\n \"Street Map\": streetmap,\n \"Satellite Map\": satellitemap,\n \"Outdoors Map\": outdoorsmap,\n \"Greyscale Map\": lightmap\n };\n\n // Read the tectonic Plate GeoJSON from the source URL, and add to faultLines layer group\n d3.json(\"https://raw.githubusercontent.com/fraxen/tectonicplates/master/GeoJSON/PB2002_boundaries.json\",\n function(platedata) {\n L.geoJson(platedata, {\n color: \"orange\",\n weight: 2\n }).addTo(faultLines);\n });\n\n // Create a new map\n var myMap = L.map(\"map\", {\n center: [\n 48.10, -100.10\n ],\n zoom: 3,\n layers: [streetmap, earthquakes, faultLines]\n });\n\n // create overlay map with the 2 data layers\n var overlayMaps = {\n \"Earthquakes\": earthquakes,\n \"Fault Lines\": faultLines,\n };\n\n // Add a layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // function to set the earthquake circle size based on value of mag (magnitude)\n function chooseColour(mag) {\n if (mag > 5) {\n return \"red\";\n }\n else if (mag > 4){\n return \"orangered\";\n }\n else if (mag > 3){\n return \"orange\";\n }\n else if (mag > 2){\n return \"gold\";\n }\n else if (mag > 1){\n return \"yellow\"\n }\n else {\n return \"greenyellow\";\n }\n }\n\n // Create the legend control and set its position\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // function to assign values to the legend, as well as color boxes (see style.css file)\n legend.onAdd = function (myMap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + chooseColour(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n return div;\n };\n // add the legend to the map\n legend.addTo(myMap);\n\n}", "function onEachFeature(feature, layer) {\n // does this feature have a property named popupContent?\n if (feature.properties && feature.properties.name) {\n layer.bindPopup( 'Name: ' + feature.properties.name + '<br>'+ 'Total Price: ' + feature.properties.totalprice + '<br>' + 'Area: ' +feature.properties.area + '<br>' + 'Bedrooms: ' + feature.properties.bedrooms + '<br>' + 'Price per Sq m: ' + feature.properties.priceperm2 + '<br>' +'Year Built: ' + feature.properties.yearbuilt);\n }\n}", "function onEachFeature(feature, layer) {\n //no property named popupContent; instead, create html string with all properties\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n for (var property in feature.properties){\n popupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\n }\n layer.bindPopup(popupContent), layer.setIcon(boatIcon);\n };\n}", "function bindPopupToEarthQuake(feature, layer) {\n layer.bindPopup(`<h3>${feature.properties.place}</h3><hr><p>${new Date(feature.properties.time)}</p>`);\n }", "function markEvents(data) {\n\n\n function bindPopups (feature, layer) {\n\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3><hr>\" + \n \"<p>Magnitude: \" + feature.properties.mag + \"</p>\"\n )\n };\n\n\n var events = L.geoJSON(data, {\n //For each event, we need popups and circles\n onEachFeature: bindPopups,\n\n //geojson circles are not supported, so we bind circles to points\n pointToLayer: function (feature) {\n\n return L.circle([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], {\n color: '',\n fillColor: Intensity(feature.properties.mag),\n fillOpacity: 0.5,\n radius: feature.properties.mag * 50000\n });\n }\n });\n\n\n MapIt(events);\n\n\n\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n }", "function onEachFeature(feature, layer) {\r\n var popupContent = \"\";\r\n if (feature.properties) {\r\n for (var property in feature.properties){\r\n popupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\r\n }\r\n layer.bindPopup(popupContent);\r\n };\r\n}", "function onEachFeature(feature, layer) {\n\n layer.bindPopup(`<h1>${feature.properties.COUNTY}</h1><br>\n <h5>Tax Rate: ${roundUp(feature.properties.tax_rate,2)}</h5><br>\n <strong>Crime Rate per 100K: ${roundUp(feature.properties.crime_rate,2)}</strong><br>\n <strong>School Rating: ${roundUp(feature.properties.school_rating,2)}%</strong><br>\n <strong>Median household income: $${feature.properties.median_hh_income}</strong><br>\n <strong>Population: ${roundUp(feature.properties.population,0)}</strong><br>\n <strong>Poverty Rate: ${feature.properties.poverty_rate}%</strong>\n `).on('mouseover', function (e) {\n this.openPopup();\n }).on('mouseout', function (e) {\n this.closePopup();\n });\n}", "function onEachFeature(feature, layer) {\n // Check for featured image, then image gallery. If neither, don't use an image in popup\n if (feature.properties.field_featured_image.length > 2) {\n layer.bindPopup(\n \t'<img src=\"' + feature.properties.field_featured_image + '\" width=\"301px\" class=\"popup-top-image\">' +\n '<div class=\"popupbody\"><div class=\"popuptitle\"><h3><a href=\"' + feature.properties.path + '\" >' + feature.properties.name + '</a></h3></div>' +\n feature.properties.description +\n '<p><a href=\"' + feature.properties.path + '\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-link center-block\"></span> Learn More</a></p>' +\n '<p><a href=\"https://www.google.com/maps/dir/Current+Location/' + feature.geometry.coordinates[1] + ',' + feature.geometry.coordinates[0] + '\" target=\"_blank\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-car center-block\"></span> Driving Directions</a></p>',\n \t{closeButton: true}\n );\n } else if (feature.properties.field_featured_image.length == 0 && feature.properties.field_image_gallery.length > 2) {\n layer.bindPopup(\n '<img src=\"' + feature.properties.field_image_gallery + '\" width=\"301px\" class=\"popup-top-image\">' +\n '<div class=\"popupbody\"><div class=\"popuptitle\"><h3><a href=\"' + feature.properties.path + '\">' + feature.properties.name + '</a></h3></div>' +\n feature.properties.description +\n '<p><a href=\"' + feature.properties.path + '\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-link center-block\"></span> Learn More</a></p>' +\n '<p><a href=\"https://www.google.com/maps/dir/Current+Location/' + feature.geometry.coordinates[1] + ',' + feature.geometry.coordinates[0] + '\" target=\"_blank\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-car center-block\"></span> Driving Directions</a></p>',\n \t{closeButton: true}\n );\n } else {\n layer.bindPopup(\n '<div class=\"popupbody\"><div class=\"popuptitle\"><h3><a href=\"' + feature.properties.path + '\">' + feature.properties.name + '</a></h3></div>' +\n feature.properties.description +\n '<p><a href=\"' + feature.properties.path + '\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-link center-block\"></span> Learn More</a></p>' +\n '<p><a href=\"https://www.google.com/maps/dir/Current+Location/' + feature.geometry.coordinates[1] + ',' + feature.geometry.coordinates[0] + '\" target=\"_blank\" class=\"btn btn-default orbitist-btn\"><span class=\"fa fa-car center-block\"></span> Driving Directions</a></p>',\n {closeButton: true}\n );\n }\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(Popcorn(feature));\n }", "function addEarthquakeMapFeature(feature , layer) {\n\n layer.on({\n\n // Mouse Over event - feature's opacity changes to 90% so that it stands out \n mouseover: function(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.90\n });\n },\n\n // Mouse Out event - feature's opacity reverts back to 50%\n mouseout: function(event) {\n layer = event.target;\n layer.setStyle({\n fillOpacity: 0.5\n });\n },\n });\n \n // Tool tip popup on Mouse Click \n layer.bindPopup(\"<h3> Magnitude: \" + feature.properties.mag + \"</h3> <hr> <h4> Location: \" + feature.properties.place + \"</h4>\");\n}", "function onEachFeature(feature, layer) {\n\n // If the tsunami flag is 1 then the earthquake occurred in\n // a region that can generate tsunamis\n if (feature.properties.tsunami == 1) {\n\n // Get PAGER alert level. This indicates fatality and economic loss \n // impact estimates following significant earthquakes worldwide. \n // If the alert level is orange or red then a tsunami is highly likely.\n var alert = feature.properties.alert\n\n // Calculate how long ago the quake occurred\n var time = moment(feature.properties.time).fromNow()\n\n // Get magnitude\n var magnitude = feature.properties.mag\n\n // Get location\n var location = feature.properties.place\n\n // Get more details. The detail property contains a url to another JSON object\n // which contains detailed information about a single earthquake.\n $http.get(feature.properties.detail)\n .success(function(data, status, headers, config) {\n L.geoJson(data, {\n onEachFeature: function(feature, layer) {\n if (feature.properties.products[\"impact-link\"] != undefined) {\n console.log(feature.properties.products[\"impact-link\"][0].properties.text)\n }\n }\n })\n })\n .error(function(error, status, headers, config) {\n console.log(status)\n console.log(\"Error occured\")\n });\n\n // Add tsunami properties to list\n var list = [alert, time, magnitude, location]\n vm.tsunamis.push(list)\n }\n }", "function onEachFeature(feature, layer) {\r\n var date = new Date(0);\r\n date.setUTCSeconds(feature.properties.time);\r\n var d = new Date();\r\n\r\n // if data is not 'old data', then allow it to be clicked for the data modal.\r\n if(d - date <= timeInterval) {\r\n layer.bindPopup('<strong>client id:</strong> '+ feature.properties.clientID);\r\n // on click - set the popup modal values to the device clicked on\r\n layer.on('click', function (e) {\r\n map.panTo(this.getLatLng())\r\n $('.flex-clientID').text(feature.properties.clientID)\r\n $('.flex-temperature').text(feature.properties.temp + String.fromCharCode(176))\r\n $('.flex-pressure').text(feature.properties.pressure + 'mb')\r\n $('.flex-humidity').text(feature.properties.humidity + '%')\r\n $('.flex-voc').text(feature.properties.voc)\r\n $('.flex-particulate').text(feature.properties.particulate)\r\n $('.flex-nox').text(feature.properties.nox + 'V')\r\n $('.flex-vcc').text(feature.properties.vcc + 'V')\r\n $('.flex-time').text(time)\r\n $(\"#modChart\").modal()\r\n });\r\n } else {\r\n // display 'OFFLINE' in popup if device if old data detected\r\n layer.bindPopup('<strong>client id:</strong> '+ feature.properties.clientID + '<br><strong>OFFLINE</strong>');\r\n }\r\n\r\n // format into 12 hour AM/PM time\r\n var AM_PM = (date.getHours() >= 12) ? \"PM\" : \"AM\"\r\n var hours = (get_hours(date)%12 == 0) ? get_hours(date) : get_hours(date)%12\r\n var time = hours + \":\" + get_minutes(date) + AM_PM + \" \" + (date.getMonth() + 1) + \"/\" + date.getDate() + \"/\" + date.getFullYear()\r\n\r\n\r\n // mouse over shows the client id - applicable to desktop version only\r\n layer.on('mouseover', function (e) {\r\n this.openPopup();\r\n });\r\n layer.on('mouseout', function (e) {\r\n this.closePopup();\r\n });\r\n\r\n}", "function createFeatures(earthquakeData) {\n\n // The popup box display's the place (reformatted from the original result so only city and state appears), the earthquake magnitude and depth.\n function onEachFeature(features, layer) {\n layer.bindPopup(\"<strong>\" + (features.properties.place).split(\"of\").pop() + \"</strong>\" +\n \"<li>\"+\"Magnitude: \" + features.properties.mag + \"</li>\" + \"<li>\" + \"Depth: \" + features.geometry.coordinates[2]+ \"</li>\" );\n }\n\n // Creating a GeoJson layer for the earthquakeData object and adding the styles to the circles.\n var earthquakes = L.geoJSON(earthquakeData, {\n pointToLayer: function(features, latlng) {\n return L.circleMarker(latlng, {\n weight: 0.4,\n color: \"black\",\n fillColor: magnitudeColor(features.geometry.coordinates[2]),\n fillOpacity: 0.7,\n radius: (features.properties.mag) *4\n });\n },\n onEachFeature: onEachFeature\n })\n \n // Sending the earthquake layer to the createMap function.\n createMap(earthquakes);\n\n }", "function definePopup(evt, layerInfo, features, wmsLayers, count, id){\n var data = '';\n if(layerInfo.length === 1){\n if(count < 2) {\n if(features[layerInfo+'0'] !== undefined) {\n queries[id] = [evt.coordinate, layerInfo, features[layerInfo + '0']];\n displaySimplePopup(id);\n }else{\n var url = wmsLayers[layerInfo].getSource().getGetFeatureInfoUrl(evt.coordinate,\n GlobalMap.getView().getResolution(),\n GlobalMap.getView().getProjection(),\n {'INFO_FORMAT': 'text/javascript'});\n $.ajax({\n url: url,\n dataType: 'jsonp',\n jsonpCallback: 'parseResponse',\n success: function (data) {\n if(dataJson === null) {\n dataJson = data;\n setTimeout(definePopup(evt, layerInfo, features, wmsLayers, count, id), 1000);\n }\n }\n });\n if(dataJson !== null) {\n var feature;\n if (wmsLayers[layerInfo].getSource().coordKeyPrefix_.indexOf('geoserver') > -1) {\n feature = geoJsonFormat.readFeatures(dataJson)[0];\n }else{\n feature = esriJsonFormat.readFeatures(dataJson)[0];\n }\n queries[id] = [evt.coordinate, layerInfo, feature];\n displaySimplePopup(id);\n }\n }\n }else{\n for(var i = 0; i < count; i++){\n queries[id] = [evt.coordinate, layerInfo, features[layerInfo+i]];\n data = data + popupForm.definePopupMultiForm(layerInfo, id, features[layerInfo+i].get(queryData[layerInfo][1]), evt);\n id++;\n }\n popupForm.displayPopupForm(overlay, evt.coordinate, data);\n }\n }else if(layerInfo.length > 1){\n for (var l = 0; l < layerInfo.length; l++) {\n if(wmsLayers[layerInfo[l]] !== null && wmsLayers[layerInfo[l]] !== undefined){\n var urlWms = wmsLayers[layerInfo[l]].getSource().getGetFeatureInfoUrl(evt.coordinate,\n GlobalMap.getView().getResolution(),\n GlobalMap.getView().getProjection(),\n {'INFO_FORMAT': 'text/javascript'});\n $.ajax({\n url: urlWms,\n dataType: 'jsonp',\n jsonpCallback: 'parseResponse',\n success: function (data) {\n if(dataJson === null) {\n dataJson = data;\n setTimeout(definePopup(evt, layerInfo, features, wmsLayers, count, id), 1000);\n }\n }\n });\n if(dataJson !== null) {\n var featureWms;\n if (wmsLayers[layerInfo[l]].getSource().coordKeyPrefix_.indexOf('geoserver') > -1) {\n featureWms = geoJsonFormat.readFeatures(dataJson)[0];\n }else{\n featureWms = esriJsonFormat.readFeatures(dataJson)[0];\n }\n queries[id] = [evt.coordinate, layerInfo, featureWms];\n queries[id] = [evt.coordinate, layerInfo[l], featureWms];\n data = data + popupForm.definePopupMultiForm(layerInfo[l], id, featureWms.get(queryData[layerInfo[l]][1]), evt);\n id++;\n }\n }else{\n for(var m = 0; m < count; m++){\n if(features[layerInfo[l]+m] !== null && features[layerInfo[l]+m] !== undefined){\n var queryFeature = features[layerInfo[l]+m];\n queries[id] = [evt.coordinate, layerInfo[l], queryFeature];\n data = data + popupForm.definePopupMultiForm(layerInfo[l], id, queryFeature.get(queryData[layerInfo[l]][1]), evt);\n id++;\n }\n }\n }\n }\n popupForm.displayPopupForm(overlay, evt.coordinate, data);\n }\n }", "function onEachFeature(feature, layer) {\n\t\tlayer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n\t}", "function onEachFeature(feature, layer) {\n var popupContent = \"\"\n if (feature.properties) {\n if (feature.properties.id) {\n popupContent +='<b><a href=\"https://www.openstreetmap.org/' + feature.properties.id + '\" target=\"_blank\">' + feature.properties.id + '</a></b><hr>'\n //popupContent += \"<b>Id: </b>\";\n //popupContent += feature.properties.id;\n }\n if (feature.properties.highway) {\n popupContent += \"<b>category: </b>\";\n popupContent += feature.properties.highway;\n }\n for (let property in feature.properties) {\n //console.log('Dragana:: tag ' + JSON.stringify(tag) +', value: '+ way.tags[tag])\n if ((property !== \"id\") && (property !== \"decisionMsg\") && (property !== \"highway\") && (feature.properties[property] != null)){\n popupContent += \"<br><b>\" + property + \": </b>\";\n popupContent += feature.properties[property];\n }\n }\n if (feature.properties.decisionMsg) {\n popupContent += \"<br><br><b>Decision Msg: </b>\";\n popupContent += feature.properties.decisionMsg;\n }\n }\n layer.bindPopup(popupContent);\n\n // for mobile, use popup functions\n if (L.Browser.mobile) {\n layer.on({\n popupopen: highlightFeature,\n popupclose: resetHighlight,\n });\n } else {\n layer.on({\n mouseover: highlightFeature,\n mouseout: resetHighlight,\n });\n }\n}", "function createFeatures(earthquakeData, faultLineData) {\n\n // Defines two functions that are run once for each feature in earthquakeData\n // Creates markers for each earthquake and adds a popup describing the place, time, and magnitude of each\n function onEachQuakeLayer(feature, layer) {\n return new L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], {\n fillOpacity: 0.7,\n weight: 0.5,\n color: \"black\",\n fillColor: chooseColor(feature.properties.mag),\n radius: markerSize(feature.properties.mag)\n });\n }\n function onEachEarthquake(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3><hr>\" + \n \"<p><b>Time:</b> \" + new Date(feature.properties.time) + \n \"<br /><b>Magnitude:</b> \" + feature.properties.mag + \"</p>\");\n };\n\n // Defines a function that is run once for each feature in faultLineData\n // Create fault lines\n function onEachFaultLine(feature, layer) {\n L.polyline(feature.geometry.coordinates);\n };\n\n // Creates a GeoJSON layer containing the features array of the earthquakeData object\n // Run the onEachEarthquake & onEachQuakeLayer functions once for each element in the array\n var earthquakes = L.geoJSON(earthquakeData, {\n onEachFeature: onEachEarthquake,\n pointToLayer: onEachQuakeLayer\n });\n\n // Creates a GeoJSON layer containing the features array of the faultLineData object\n // Run the onEachFaultLine function once for each element in the array\n var faultLines = L.geoJSON(faultLineData, {\n onEachFeature: onEachFaultLine,\n style: {\n weight: 2,\n color: 'orange'\n }\n });\n\n createMap(earthquakes, faultLines);\n }", "function createFeatures(eqData) {\n var earthquakes = L.geoJSON(eqData, {\n onEachFeature: function(feature, layer) {\n layer.bindPopup(\"<p><h3>Magnitude: \" + feature.properties.mag +\"</h3></p><hr><p><strong>Location:</strong> \"+ feature.properties.place +\n \"</h3></p><p><strong>Date & Time:</strong> \" + new Date(feature.properties.time) + \"</p>\");\n },\n\n pointToLayer: function (feature, latlng) {\n return new L.CircleMarker(latlng,\n {radius: markerRadius(feature.properties.mag),\n fillColor: markerColor(feature.properties.mag),\n fillOpacity: 1,\n color: \"black\",\n stroke: true,\n weight: .5\n })\n }\n });\n\n createMap(earthquakes);\n}", "function onEachFeature(feature, layer) {\n // Set mouse events to change map styling\n layer.on({\n // When a user's mouse touches a map feature, the mouseover event calls this function, \n // that feature's opacity changes to 100% so that it stands out\n mouseover: function (event) {\n layer = event.target;\n layer.setStyle({\n color: \"#fff\",\n weight: 3,\n fillOpacity: 1.0\n });\n },\n // When the cursor no longer hovers over a map feature - when the mouseout event occurs - \n // the feature's opacity reverts back to 40%\n mouseout: function (event) {\n layer = event.target;\n layer.setStyle({\n color: \"#000\",\n weight: 1,\n fillOpacity: 0.3\n });\n }\n });\n \n // Bind popups for all earthquakes\n layer.bindPopup(\n \"<h3>Location: \" + feature.properties.place + \"<br> Magnitude: \" + \n feature.properties.mag +\"<br>Depth: \" + feature.geometry.coordinates[2] + \n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\")\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(feature.properties.name);\n}", "function handleFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.on('mouseover', function(e) {\n layer.setStyle({\n dashArray: '',\n fillOpacity: 1\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n this.bringToFront();\n }\n layer.openPopup();\n }).on('mouseout', function(e) {\n layer.closePopup();\n });\n \n // create the popup variable\n var popup = \"<h3>\" + (feature.properties.name) + \"</h3>\" + \n \"<p><strong>Predicted Median Price: </strong>\" + feature.properties.price + \"</p>\";\n // add the popup to the map and set location\n layer.bindPopup(popup, { className: 'popup', 'offset': L.point(0, -20) });\n }", "function createFeatures(quakeData, faultData) {\n //Create the markers and the data about the earthquake\n //use the functions to set the color and the size of the circle\n console.log(\"in createfeatures\");\n console.log(faultData);\n console.log(quakeData);\n function onEachQuakeInst(feature, layer) {\n return new L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], {\n fillOpacity: 1,\n color: setColor(feature.properties.mag),\n fillColor: setColor(feature.properties.mag),\n radius: markSize(feature.properties.mag)\n });\n }\n function onEachQuake(feature, layer) {\n console.log(\"in EachQuake\");\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n\n };\n\n function onEachFault(feature, layer) {\n L.polyline(feature.geometry.coordinates);\n };\n\n //geoJson of quakes\n var earthquakes = L.geoJSON(quakeData, {\n onEachFeature: onEachQuake,\n pointToLayer: onEachQuakeInst\n });\n\n //Create the geojason for faultlines\n var faultlines = L.geoJSON(faultData, {\n onEachFeature: onEachFault,\n style: {\n weight: 1,\n color: 'red'\n }\n });\n\n //Create the map\n createMap(earthquakes, faultlines);\n console.log(earthquakes);\n console.log(\"create Features Map\");\n }", "function onEachSede(feature, layer) {\n layer.bindPopup(feature.properties.nombre);\n}", "function createFeatures(earthquakeData, platesData) {\n // funtion to bind popups to the earthquakes\n function oneachfeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>Magnitude: \" + (feature.properties.mag) + \"</p>\");\n }\n // style for tectonic plates\n var mapStyle = {\n color: \"orange\",\n fillColor: \"\",\n fillOpacity: 0,\n weight: 2\n };\n // create plates layer\n var plates = L.geoJson(platesData, {\n // Passing in our style object\n style: mapStyle,\n // bind popup to plates\n onEachFeature: function( feature, layer ){\n layer.bindPopup( \"<h3>Plate name: \" + feature.properties.PlateName + \"</h3>\")\n }\n });\n\n// create earthquake layer\n var earthquakes = L.geoJson(earthquakeData, {\n // bind popups\n onEachFeature: oneachfeature,\n // turn geogson into points\n pointToLayer: function(feature,latlng){\n\t return new L.CircleMarker(latlng, {\n radius: chooseRadius(feature.properties.mag),\n fillOpacity: 1,\n fillColor: chooseColor(feature.properties.mag),\n weight: .5,\n color: \"#999\"}); // feature.properties.mag\n }\n })//.addTo(myMap);\n\n// get colors for legend\n function getColor(d) {\n return d > 8 ? '#7f2704' :\n d > 6 ? '#a63603' :\n d > 4 ? '#fd8d3c' :\n d > 2 ? '#fdae6b' :\n d > 0 ? '#fdd0a2' :\n '#FFEDA0';\n }\n\n // create legend\n var legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function (map) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n mags = [0, 2, 4, 6, 8],\n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < mags.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(mags[i] + 1) + '\"></i> ' +\n mags[i] + (mags[i + 1] ? '&ndash;' + mags[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n\n earthquakes.bringToFront();\n plates.bringToBack();\n\n// call create map function\n createMap(plates, earthquakes, legend);\n}", "function onEachFeature(feature, layer) {\n console.log(\"I'm in onEachFeature\")\n layer.bindPopup(\"<h3>\" + feature.properties.YEAR_MONTH +\n \"</h3><hr><p>\" + feature.properties.NARRATIVE + \"</p>\");\n \n var two_coords =[]\n two_coords.push(feature.properties.Longitude); \n two_coords.push(feature.properties.Latitude); \n console.log(two_coords);\n console.log(\"Year\" +feature.properties.YR);\n \n \n \n sizeMarkers.push(\n L.circle(two_coords, {\n color: 'red',\n stroke: false,\n fillColor: '#f03',\n fillOpacity: 1,//(feature.properties.mag/5),\n radius: 50//markerSize(feature.properties.mag)\n })\n );\n }", "function showPopup1(e) {\n // Show the popup at the coordinates with some data\n popup\n .setLngLat(e.lngLat)\n .setHTML(\n e.features[0].properties.name + \n \"<br><a href='https://waba.org/20x20map/' target='blank'><button class=blue-button2>Take Action</button></a>\"\n )\n .addTo(map);\n }", "function onFeature(feature, layer) {\r\n layer.bindPopup(\"<h3>\" + feature.properties.place +\r\n \"</p><hr><p>\" + \"<h3>Magnitude: \" + feature.properties.mag + \"</h3>\")\r\n\r\n }", "function onEachFeature(feature, layer) {\n\t\tvar popupContent = feature.properties.naam\n\n\t\tif (feature.properties && feature.properties.popupContent) {\n\t\t\tpopupContent += feature.properties.popupContent;\n\t\t}\n\t\t\n\t\t\n\n\t\t\t\n\n\t\t\n\t\t\n\t\t\n\t\tlayer.bindPopup(popupContent);\n\t}", "function displayBeachClosures(beach_closures) {\n var points = [];\n\n beach_closures.forEach(function(beach) {\n points.push(\n turf.point(\n [beach.longitude, beach.latitude],\n {\n // Properties\n 'status_color': beach.status_color,\n 'name': beach.title,\n 'date_updated': beach.date_updated,\n 'external_link': beach.external_link,\n 'status_color': beach.status_color,\n 'status_text': beach.beachstatus\n }\n )\n );\n });\n\n // Looks like it's not yet possible to set \"icon-color\"\n // for Mapbox GL JS's built-in (Maki) icons, but that\n // we'd need to create custom SDF icons.\n //\n //MAP.addLayer({\n // \"id\": \"beach_closures\",\n // \"type\": \"symbol\",\n // \"source\": {\n // \"type\": \"geojson\",\n // \"data\": {\n // \"type\": \"FeatureCollection\",\n // \"features\": points\n // }\n // },\n // \"layout\": {\n // \"icon-image\": \"marker-15\",\n // \"icon-size\": 1.8,\n // },\n // \"paint\": {\n // \"icon-color\": [\"concat\", \"#\", [\"get\", \"status_color\"]]\n // }\n //});\n\n MAP.addLayer({\n \"id\": \"beach_closures\",\n \"type\": \"circle\",\n \"source\": {\n \"type\": \"geojson\",\n \"data\": {\n \"type\": \"FeatureCollection\",\n \"features\": points\n }\n },\n \"paint\": {\n \"circle-radius\": 10,\n \"circle-color\": [\"concat\", \"#\", [\"get\", \"status_color\"]]\n }\n });\n\n // When a click event occurs on a feature in the places layer, open a popup at the\n // location of the feature, with description HTML from its properties.\n MAP.on(\"click\", \"beach_closures\", function (e) {\n var coordinates = e.features[0].geometry.coordinates.slice();\n var popupMarkup = beachPopupMarkup(e.features[0].properties);\n\n // Ensure that if the map is zoomed out such that multiple\n // copies of the feature are visible, the popup appears\n // over the copy being pointed to.\n while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {\n coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;\n }\n\n new mapboxgl.Popup()\n .setLngLat(coordinates)\n .setHTML(popupMarkup)\n .addTo(MAP);\n });\n\n // Change the cursor to a pointer when the mouse is over the places layer.\n MAP.on(\"mouseenter\", \"beach_closures\", function () {\n MAP.getCanvas().style.cursor = \"pointer\";\n });\n\n // Change it back to a pointer when it leaves.\n MAP.on(\"mouseleave\", \"beach_closures\", function () {\n MAP.getCanvas().style.cursor = \"\";\n });\n}", "function onEachFeature(feature, layer) {\n\t\tvar toDisplay = \"\";\n\t\tif (feature.properties) {\n\t\t\tif (feature.properties.name){\n\t\t\t\ttoDisplay += feature.properties.name;\n\t\t\t}\n\t\t\telse if (feature.properties.Name){\n\t\t\t\ttoDisplay += feature.properties.Name;\n\t\t\t}\n\t\t}\n\n\t\tif (!toDisplay){\n\t\t\ttoDisplay = \"No data\";\n\t\t}\n\n\t\tlayer.bindPopup(toDisplay);\n\t}", "function setupFeatures() {\n /** Set callbacks for each graffiti post on the map */\n for(var i in features) {\n var dist = current_pos.distanceTo(features[i].geo.geometry.coordinates.slice().reverse());\n var rad = Math.abs(parseInt(200 + 10.0*(features[i].votes)));\n\n\n features[i].geo.dist = parseInt(dist);\n features[i].geo.radius = rad; // store on global data variable for easier access in callback function\n features[i].geo.id = features[i].id; // a workaroud for popup events later on\n features[i].geo.votes = features[i].votes;\n\n\n\n if (dist <= rad) {\n L.geoJSON(features[i].geo, {\n pointToLayer: function (feature, latlng) {\n if (rad >= 1000) {\n return L.marker(latlng, {icon: icon_hot});\n } else { return L.marker(latlng, {icon: icon_pin}); }\n },\n onEachFeature: setupFeature\n }).addTo(map);\n } else {\n // add custom markers for unexplored graffiti area\n L.geoJSON(features[i].geo, {\n pointToLayer: function (feature, latlng) {\n return L.marker(latlng, {icon: icon_unexplored}); //.bindPopup(\"<h4>You must travel within this radius to view this pintura.</h4>\");\n },\n onEachFeature: setupHiddenFeature\n }).addTo(hiddenpost);\n post_hidden++;\n }\n }\n }" ]
[ "0.81454265", "0.78756", "0.7781189", "0.7771678", "0.77703357", "0.77654797", "0.7746855", "0.7746748", "0.77016103", "0.7699561", "0.76960605", "0.76880056", "0.76880056", "0.76880056", "0.7685641", "0.7666784", "0.76654994", "0.76651704", "0.76543266", "0.7648453", "0.7642525", "0.76388407", "0.763137", "0.7628457", "0.75870466", "0.7554115", "0.75477844", "0.75283206", "0.75254774", "0.7507901", "0.7487683", "0.7453269", "0.74082285", "0.74045867", "0.73913246", "0.73143435", "0.72996116", "0.7259087", "0.7247189", "0.7236218", "0.722723", "0.7208995", "0.7206768", "0.7185681", "0.7185592", "0.71808046", "0.7177133", "0.7162504", "0.7161008", "0.7160585", "0.715644", "0.71088016", "0.70802927", "0.70783305", "0.70670706", "0.70021325", "0.699266", "0.6969247", "0.6943901", "0.6935691", "0.6923119", "0.6889307", "0.68691635", "0.6847818", "0.6844033", "0.682801", "0.68213886", "0.68147653", "0.6811749", "0.6790987", "0.6785964", "0.67852914", "0.67852914", "0.6762848", "0.67611235", "0.672427", "0.6717614", "0.67168653", "0.6712911", "0.67062175", "0.67047316", "0.67016387", "0.6686873", "0.66787624", "0.66720223", "0.6661468", "0.66347057", "0.6618892", "0.6613018", "0.6612859", "0.66036236", "0.66014147", "0.6591425", "0.6590687", "0.6586305", "0.65717524", "0.6569341", "0.655926", "0.6539034", "0.6511079" ]
0.7179201
46
limpia los valores del formulario
function clearForm() { $('#clave').val(""); $('#usuario').val(""); $('#password').val(""); $("#numeroEmpleado").val("0").change(); $('input[type=search]').val(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getValues() {\n return {\n description: Form.description.value, \n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "getValues() {\n return {\n description: Form.description.value,\n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "function getFormValuesAndDisplayResults() {\n}", "formValues() {\n if (this.refs.form) {\n return this.refs.form.getValues();\n } else {\n return {};\n }\n }", "limparCampoForm(form) {\n form.id.value = \"\";\n form.nome.value = \"\";\n form.descricao.value = \"\";\n form.detalhes.value = \"\";\n }", "function formValues() {\n var data = {};\n traceLib.stored.forEach(function(field) {\n data[field] = $('#' + field).val() || '';\n });\n return data;\n}", "function getValues(form) {\n processCheckbox(form);\n processSelect(form);\n processInput(form);\n processTextarea(form);\n setDateTime(helpData);\n if (helpData.kind === 'need') {\n getTime(form)\n }\n helpData.userName = $(\"#username\").val();\n return helpData;\n}", "function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}", "function getFormVariables() {\n return [$(\"#art_name\").val(),\n $(\"#id_field\").val(),\n $(\"#birthyear\").val(),\n $(\"#img_url\").val()\n ]\n}", "function getForm() {\n inputNombre.value = localStorage.getItem('nombre');\n inputApellido.value = localStorage.getItem('apellido');\n inputTel.value = localStorage.getItem('tel');\n inputDir.value = localStorage.getItem('dir');\n inputObs.value = localStorage.getItem('obs');\n console.log('data loaded');\n}", "getValues(){\n // declarando com let, para ficar somente dentro do escopo\n let user = {};\n\n // varialve de verificacao de validade do formulario\n let isValid = true;\n \n // vamos rodar o foreach nos elementos do formulario.\n // por se tratar de um objto, nao encontrara o metodo forEach()\n // entao e usado os [] envolta do objeto para converter em array\n // mas ai teria outro problema de ficar percorrendo todos os indices do objeto\n // para isso tem um operador novo chamado Spread (...) antes do this para nao ter que precisar verificar quantos indices\n // o array vai ter\n \n [...this.formEl.elements].forEach(function(field, index){\n\n // verifica se tem o campo requerido e se esta vazio\n if([\"name\", \"email\", \"password\"].indexOf(field.name) > -1 && !field.value){\n\n field.parentElement.classList.add(\"has-error\");\n isValid = false;\n\n }\n\n if(field.name == \"gender\"){\n \n if(field.checked === true ){\n user[field.name] = field.value;\n }\n \n }else if(field.name == \"admin\"){\n\n user[field.name] = field.checked;\n\n }else{\n user[field.name] = field.value;\n }\n \n \n });\n\n //retorna se o formulario for invalido, como se fosse um break\n if(!isValid){\n return false;\n }\n \n // retornado direto a resposta da classe\n return new User(\n user.name, \n user.gender, \n user.birth, \n user.country, \n user.email, \n user.passwor, \n user.photo, \n user.admin);\n\n \n }", "function datosFormulario(frm) {\n let nombre= frm.nombre.value;\n let email = frm.email.value;\n let asunto= frm.asunto.value;\n let mensaje = frm.mensaje.value\n \n console.log(\"Nombre \",nombre);\n console.log(\"Email \",email);\n console.log(\"Asunto \",asunto);\n console.log(\"Mensaje \",mensaje);\n\n}", "function get_form_values(fobj)\n\t\t{\n\t\t\tvar str = \"\";\n\t\t\tvar valueArr = null;\n\t\t\tvar val = \"\";\n\t\t\tvar cmd = \"\";\n\t\t\n\t\t\tfor(var i = 0;i < fobj.elements.length;i++)\n\t\t\t{\n\t\t\t\tswitch(fobj.elements[i].type)\n\t\t\t\t{\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tstr += fobj.elements[i].name + \"=\" + escape(fobj.elements[i].value) + \"&\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"textarea\":\n\t\t\t\t\t\tstr += fobj.elements[i].name + \"=\" + escape(fobj.elements[i].value) + \"&\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"select-one\":\n\t\t\t\t\t\tstr += fobj.elements[i].name + \"=\" + fobj.elements[i].options[fobj.elements[i].selectedIndex].value + \"&\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tstr = str.substr(0,(str.length - 1));\n\t\t\treturn str;\n\t\t}", "getValues() {\n return _.mapObject(this.controls, (c) => c.getValue())\n }", "function values () {\n totalCost = document.getElementById('cost__input').value;\n service = document.getElementById('service__options').value;\n people = document.getElementById('share__amount').value;\n}", "function getFormValues(fields) {\n const valuesObj = {\n name: fields[0].value,\n color: fields[1].value,\n primary: fields[2].value,\n secondary: fields[3].value\n };\n // the function returns the value of valuesObj\n return valuesObj;\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('belParamBelceFrm.accion'), \n\t\tget('belParamBelceFrm.origen'));\n\n\n\tset('belParamBelceFrm.id', jsBelParamBelceId);\n\tset('belParamBelceFrm.sbacOidSbac', [jsBelParamBelceSbacOidSbac]);\n\tset('belParamBelceFrm.valDire', jsBelParamBelceValDire);\n\tset('belParamBelceFrm.valTfno', jsBelParamBelceValTfno);\n\tset('belParamBelceFrm.valMontMaxiDife', jsBelParamBelceValMontMaxiDife);\n\tset('belParamBelceFrm.valLimiEfecCaja', jsBelParamBelceValLimiEfecCaja);\n\tset('belParamBelceFrm.numCaja', jsBelParamBelceNumCaja);\n\tset('belParamBelceFrm.valNombLoca', jsBelParamBelceValNombLoca);\n\tset('belParamBelceFrm.valTiempRepo', jsBelParamBelceValTiempRepo);\n\tset('belParamBelceFrm.valFactLoca', jsBelParamBelceValFactLoca);\n\tset('belParamBelceFrm.numMaxiProd', jsBelParamBelceNumMaxiProd);\n\tset('belParamBelceFrm.valAlerStoc', jsBelParamBelceValAlerStoc);\n\tset('belParamBelceFrm.valUsua', jsBelParamBelceValUsua);\n\tset('belParamBelceFrm.clieOidClie', [jsBelParamBelceClieOidClie]);\n\tset('belParamBelceFrm.sociOidSoci', [jsBelParamBelceSociOidSoci]);\n\tset('belParamBelceFrm.ttraOidTipoTran', [jsBelParamBelceTtraOidTipoTran]);\n\tset('belParamBelceFrm.ccbaOidCuenCorrBanc', [jsBelParamBelceCcbaOidCuenCorrBanc]);\n\tset('belParamBelceFrm.tmvcOidCobr', [jsBelParamBelceTmvcOidCobr]);\n\tset('belParamBelceFrm.tmvcOidCier', [jsBelParamBelceTmvcOidCier]);\n\tset('belParamBelceFrm.tmalOidConfStoc', [jsBelParamBelceTmalOidConfStoc]);\n\tset('belParamBelceFrm.tmalOidConfStocTran', [jsBelParamBelceTmalOidConfStocTran]);\n\tset('belParamBelceFrm.tmalOidStocTran', [jsBelParamBelceTmalOidStocTran]);\n\tset('belParamBelceFrm.tmalOidStocDevo', [jsBelParamBelceTmalOidStocDevo]);\n\tset('belParamBelceFrm.tmalOidRegu', [jsBelParamBelceTmalOidRegu]);\n\tset('belParamBelceFrm.tmalOidReguSap', [jsBelParamBelceTmalOidReguSap]);\n\tset('belParamBelceFrm.tmalOidDevoStoc', [jsBelParamBelceTmalOidDevoStoc]);\n\tset('belParamBelceFrm.tmalOidPetiExis', [jsBelParamBelceTmalOidPetiExis]);\n\tset('belParamBelceFrm.paisOidPais', [jsBelParamBelcePaisOidPais]);\n\t\n}", "function getFormValues() {\n let emailV = $('#email').val();\n let firstNameV = $('#firstName').val();\n let lastNameV = $('#lastName').val();\n let textAreaV = $('#taMessage').val();\n setUsersData(emailV, firstNameV, lastNameV, textAreaV);\n}", "getValues() {\r\n let isValid = isValidForm(this.picSchema, this.refs);\r\n if (!isValid)\r\n return isValid;\r\n else {\r\n let { Suburb, BrandFile, LogoFile } = this.refs;\r\n\r\n let form = getForm(this.picSchema, this.refs);\r\n let SuburbId = Suburb.state.suburbId;\r\n let Brand = BrandFile.getValues();\r\n let Logo = LogoFile.getValues();\r\n\r\n return {\r\n ...form,\r\n SuburbId: SuburbId == \"\" ? null : SuburbId,\r\n BrandFile: Brand.file,\r\n BrandDeletedFile: Brand.deletedFile,\r\n BrandFileId: Brand.fileId,\r\n LogoFile: Logo.file,\r\n LogoDeletedFile: Logo.deletedFile,\r\n LogoFileId: Logo.fileId\r\n };\r\n }\r\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('calGuiasFrm.accion'), \n\t\tget('calGuiasFrm.origen'));\n\n\n\tset('calGuiasFrm.id', jsCalGuiasId);\n\tset('calGuiasFrm.codGuia', jsCalGuiasCodGuia);\n\tset('calGuiasFrm.dpteOidDepa', [jsCalGuiasDpteOidDepa]);\n\tset('calGuiasFrm.valTitu', jsCalGuiasValTitu);\n\tset('calGuiasFrm.fecInicVali', jsCalGuiasFecInicVali);\n\tset('calGuiasFrm.fecFinVali', jsCalGuiasFecFinVali);\n\tset('calGuiasFrm.valDescGuia', jsCalGuiasValDescGuia);\n\tset('calGuiasFrm.paisOidPais', [jsCalGuiasPaisOidPais]);\n\t\n}", "function getFormValues() { \n\t\tvar first = document.getElementById(\"first\").value;\n\t\tconsole.log(first);\n\t\tvar last = document.getElementById(\"last\").value;\n\t\tconsole.log(last);\n\t}", "function seteaValoresParaGuardar() {\n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n\tset(FORMULARIO + '.hMarca', get(FORMULARIO + '.ValorMarca') );\n\tset(FORMULARIO + '.hCanal', get(FORMULARIO + '.ValorCanal') );\n\tset(FORMULARIO + '.hTipoCurso', get(FORMULARIO + '.ValorTipoCurso') ); \n\tset(FORMULARIO + '.hAccesoInformacion', get(FORMULARIO + '.ValorAccesoInformacion') ); \n\tset(FORMULARIO + '.hFrecuenciaDictado', get(FORMULARIO + '.ValorFrecuenciaDictado') ); \n\tset(FORMULARIO + '.hSubgerenciaVentas', get(FORMULARIO + '.ValorSubgerenciaVentas') ); \n\tset(FORMULARIO + '.hRegion', get(FORMULARIO + '.ValorRegion') ); \n\tset(FORMULARIO + '.hZona', get(FORMULARIO + '.ValorZona') ); \n\tset(FORMULARIO + '.hSeccion', get(FORMULARIO + '.ValorSeccion') ); \n\tset(FORMULARIO + '.hTerritorio', get(FORMULARIO + '.ValorTerritorio') ); \n\tset(FORMULARIO + '.hTipoCliente', get(FORMULARIO + '.ValorTipoCliente') ); \n\tset(FORMULARIO + '.hCapacitador', get(FORMULARIO + '.ValorCapacitador') ); \n\tset(FORMULARIO + '.hSubtipoCliente', get(FORMULARIO + '.ValorSubtipoCliente') ); \n\tset(FORMULARIO + '.hClasificacion', get(FORMULARIO + '.ValorClasificacion') ); \n\tset(FORMULARIO + '.hTipoClasificacion', get(FORMULARIO + '.ValorTipoClasificacion') ); \n\tset(FORMULARIO + '.hStatusCliente', get(FORMULARIO + '.ValorStatusCliente') ); \n\tset(FORMULARIO + '.hStatusCursosExigidos', get(FORMULARIO + '.ValorStatusCursosExigidos') ); \n\tset(FORMULARIO + '.hPeriodoInicio', get(FORMULARIO + '.ValorPeriodoInicio') ); \n\tset(FORMULARIO + '.hPeriodoFin', get(FORMULARIO + '.ValorPeriodoFin') ); \n\tset(FORMULARIO + '.hPeriodoInicioV', get(FORMULARIO + '.ValorPeriodoInicioV') ); \n\tset(FORMULARIO + '.hPeriodoFinV', get(FORMULARIO + '.ValorPeriodoFinV') ); \n\tset(FORMULARIO + '.hPeriodoIngreso', get(FORMULARIO + '.ValorPeriodoIngreso') ); \n\tset(FORMULARIO + '.hProductoEntregar', get(FORMULARIO + '.ValorProductoEntregar') ); \n\tset(FORMULARIO + '.hMomentoEntregar', get(FORMULARIO + '.ValorMomentoEntregar') ); \n\n\tset(FORMULARIO + '.hNombreCurso', get(FORMULARIO + '.ValorNombreCurso') ); \n\tset(FORMULARIO + '.hObjetivoCurso', get(FORMULARIO + '.ValorObjetivoCurso') ); \n\tset(FORMULARIO + '.hContenidoCurso', get(FORMULARIO + '.ValorContenidoCurso') ); \n\tset(FORMULARIO + '.hAccesoSeleccionDM', get(FORMULARIO + '.ValorAccesoSeleccionDM') ); \n\tset(FORMULARIO + '.hPathDM', get(FORMULARIO + '.ValorPathDM') ); \n\tset(FORMULARIO + '.hFechaDisponible', get(FORMULARIO + '.ValorFechaDisponible') ); \n\tset(FORMULARIO + '.hFechaLanzamiento', get(FORMULARIO + '.ValorFechaLanzamiento') ); \n\tset(FORMULARIO + '.hFechaFin', get(FORMULARIO + '.ValorFechaFin') ); \n\tset(FORMULARIO + '.hAlcanceGeografico', get(FORMULARIO + '.ValorAlcanceGeografico') ); \n\tset(FORMULARIO + '.hNOptimo', get(FORMULARIO + '.ValorNOptimo') ); \n\tset(FORMULARIO + '.hBloqueo', get(FORMULARIO + '.ValorBloqueo') ); \n\tset(FORMULARIO + '.hRelacion', get(FORMULARIO + '.ValorRelacion') ); \n\tset(FORMULARIO + '.hNOrdenes', get(FORMULARIO + '.ValorNOrdenes') ); \n\tset(FORMULARIO + '.hMonto', get(FORMULARIO + '.ValorMonto') ); \n\tset(FORMULARIO + '.hFechaIngreso', get(FORMULARIO + '.ValorFechaIngreso') ); \n\tset(FORMULARIO + '.hNCondicion', get(FORMULARIO + '.ValorNCondicion') ); \n\tset(FORMULARIO + '.hFechaUltimo', get(FORMULARIO + '.ValorFechaUltimo') ); \n\tset(FORMULARIO + '.hNRegaloParticipantes', get(FORMULARIO + '.ValorNRegaloParticipantes') ); \n\tset(FORMULARIO + '.hCondicionPedido', get(FORMULARIO + '.ValorCondicionPedido') ); \n\tset(FORMULARIO + '.hControlMorosidad', get(FORMULARIO + '.ValorControlMorosidad') ); \n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobEtapaDeudaFrm.accion'), \n\t\tget('cobEtapaDeudaFrm.origen'));\n\n\n\tset('cobEtapaDeudaFrm.id', jsCobEtapaDeudaId);\n\tset('cobEtapaDeudaFrm.codEtapDeud', jsCobEtapaDeudaCodEtapDeud);\n\tset('cobEtapaDeudaFrm.valDesc', jsCobEtapaDeudaValDesc);\n\tset('cobEtapaDeudaFrm.indExcl', jsCobEtapaDeudaIndExcl);\n\tset('cobEtapaDeudaFrm.valEdadInic', jsCobEtapaDeudaValEdadInic);\n\tset('cobEtapaDeudaFrm.valEdadFina', jsCobEtapaDeudaValEdadFina);\n\tset('cobEtapaDeudaFrm.indTelf', jsCobEtapaDeudaIndTelf);\n\tset('cobEtapaDeudaFrm.impDesd', jsCobEtapaDeudaImpDesd);\n\tset('cobEtapaDeudaFrm.impHast', jsCobEtapaDeudaImpHast);\n\tset('cobEtapaDeudaFrm.numDiasGracCompPago', jsCobEtapaDeudaNumDiasGracCompPago);\n\tset('cobEtapaDeudaFrm.valPorcIncu', jsCobEtapaDeudaValPorcIncu);\n\tset('cobEtapaDeudaFrm.mensOidMens', [jsCobEtapaDeudaMensOidMens]);\n\tset('cobEtapaDeudaFrm.melcOidMetoLiquCobr', [jsCobEtapaDeudaMelcOidMetoLiquCobr]);\n\tset('cobEtapaDeudaFrm.tbalOidTipoBala', [jsCobEtapaDeudaTbalOidTipoBala]);\n\tset('cobEtapaDeudaFrm.gacaOidGuioArguCabe', [jsCobEtapaDeudaGacaOidGuioArguCabe]);\n\tset('cobEtapaDeudaFrm.paisOidPais', [jsCobEtapaDeudaPaisOidPais]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu1', [jsCobEtapaDeudaOredOidEtapDeu1]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu2', [jsCobEtapaDeudaOredOidEtapDeu2]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu3', [jsCobEtapaDeudaOredOidEtapDeu3]);\n\t\n}", "limpaFormulario(){\n this._inputDataNascimento.value = ''\n this._inputIdade.value = 1;\n this._inputSalario.value = 0;\n this._inputDataNascimento.focus();\n }", "function form_values(event){\n\t\tevent.preventDefault();\n\t\tvar return_object = {};\n\t\tvar dynamic_multi_objects = {};\n\t\tObject.keys(event.target.elements).forEach(function(k){\n\t\t\tswitch(event.target.elements[k].field_type){\n\t\t\t\tcase 'radio':\n\t\t\t\t\tswitch(typeof event.target.elements[k].rownum){\n\t\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t\tvar parent_name = event.target.elements[k].parentNode.name;\n\t\t\t\t\t\t\tvar my_name = event.target.elements[k].name;\n\t\t\t\t\t\t\tvar my_row = event.target.elements[k].rownum;\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name][my_row]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(event.target.elements[k].checked){\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row][my_name] = event.target.elements[k].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(event.target.elements[k].checked){\n\t\t\t\t\t\t\t\treturn_object[event.target.elements[k].name] = event.target.elements[k].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'int':\n\t\t\t\t\tswitch(typeof event.target.elements[k].rownum){\n\t\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t\tvar parent_name = event.target.elements[k].parentNode.name;\n\t\t\t\t\t\t\tvar my_name = event.target.elements[k].name;\n\t\t\t\t\t\t\tvar my_row = event.target.elements[k].rownum;\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name][my_row]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row][my_name] = parseInt(event.target.elements[k].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\treturn_object[event.target.elements[k].name] = parseInt(event.target.elements[k].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'float':\n\t\t\t\tcase 'percent':\n\t\t\t\t\tswitch(typeof event.target.elements[k].rownum){\n\t\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t\tvar parent_name = event.target.elements[k].parentNode.name;\n\t\t\t\t\t\t\tvar my_name = event.target.elements[k].name;\n\t\t\t\t\t\t\tvar my_row = event.target.elements[k].rownum;\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name][my_row]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row][my_name] = parseFloat(event.target.elements[k].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\treturn_object[event.target.elements[k].name] = parseFloat(event.target.elements[k].value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tswitch(typeof event.target.elements[k].rownum){\n\t\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t\tvar parent = event.target.elements[k].parentNode;\n\t\t\t\t\t\t\twhile(parent.name===undefined){\n\t\t\t\t\t\t\t\tparent = parent.parentNode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar parent_name = parent.name;\n\t\t\t\t\t\t\tvar my_name = event.target.elements[k].name;\n\t\t\t\t\t\t\tvar my_row = event.target.elements[k].rownum;\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dynamic_multi_objects[parent_name][my_row]) {\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row] = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\tdynamic_multi_objects[parent_name][my_row][my_name] = event.target.elements[k].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(event.target.elements[k].value){\n\t\t\t\t\t\t\t\treturn_object[event.target.elements[k].name] = event.target.elements[k].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t\t\n\t\t// console.log(dynamic_multi_objects);\n\t\tObject.keys(dynamic_multi_objects).forEach(function(parent_name){\n\t\t\t// if(return_object[parent_name]){console.log(parent_name+\" Found\");console.log(return_object[parent_name]);}else{return_object[parent_name]=Array();}\n\t\t\treturn_object[parent_name]=Array();\n\t\t\tObject.keys(dynamic_multi_objects[parent_name]).forEach(function(rownum){\n\t\t\t\tvar row = {};\n\t\t\t\tObject.keys(dynamic_multi_objects[parent_name][rownum]).forEach(function(fieldname){\n\t\t\t\t\trow[fieldname]=dynamic_multi_objects[parent_name][rownum][fieldname];\n\t\t\t\t});\n\t\t\t\treturn_object[parent_name].push(row);\n\t\t\t});\n\t\t});\n\t\tconsole.log(return_object);\n\t\t// event.target.parentElement.innerHTML=\"\";\n\t}", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "function inicializarCampos() {\r\n document.querySelector('#tipo').value = vehiculos[0].tipo;\r\n document.querySelector('#marca').value = vehiculos[0].marca;\r\n document.querySelector('#modelo').value = vehiculos[0].modelo;\r\n document.querySelector('#patente').value = vehiculos[0].patente;\r\n document.querySelector('#anio').value = vehiculos[0].anio;\r\n document.querySelector('#precio').value = vehiculos[0].precio;\r\n if (document.querySelector('#tipo').value == \"auto\") {\r\n document.querySelector('#capacidadBaul').value = vehiculos[0].capacidadBaul;\r\n }\r\n else if (document.querySelector('#tipo').value == \"camioneta\") {\r\n document.querySelector('#capacidadCarga').value = vehiculos[0].capacidadCarga;\r\n }\r\n}", "function lerTarefas() {\n\n for (let i = 0; i < dados.length; i++) {\n\n $(`input[id=\"tarefa_nam${i}\"]`).val(dados[i].tarefa)\n $(`input[id=\"tarefa_val${i}\"]`).val(dados[i].peso)\n\n }\n}", "formatValues() {\n let {description, amount, date} = Form.getValues()\n amount = Utils.formatAmount(amount)\n date = Utils.formatDate(date)\n return { description, amount, date}\n }", "function getAllformvalues(formid) \r\n\t{\r\n\t\t\r\n\t var inputValues = {};\r\n\t jQuery('#' + formid + ' input').each(function () {\r\n\t var type = jQuery(this).attr('type');\r\n\t var name = jQuery(this).attr('name');\r\n\t var id = jQuery(this).attr('id');\r\n\t var type = jQuery(this).attr(\"type\");\r\n\t if ((type == \"checkbox\" || type == \"radio\") ) {\r\n\t \tif($(this).prop('checked'))\r\n\t inputValues[name] = jQuery(this).val();\r\n\t } else if (type != \"button\" ) {\r\n\t inputValues[name] = jQuery(this).val();\r\n\t }\r\n\t });\r\n\t \r\n\t \r\n\t jQuery('select').each(function () {\r\n\t var name = jQuery(this).attr('name');\r\n\t inputValues[name] = jQuery(this).val();\r\n\t\r\n\t });\r\n\t jQuery('textarea').each(function () {\r\n\t var name = jQuery(this).attr('name');\r\n\t var id = jQuery(this).attr('id');\r\n\t inputValues[name] = jQuery(this).val();\r\n\t });\r\n\t return inputValues;\r\n\t}", "function fRecibeValores(){\n frm.iCveTramite.value = top.opener.fGetClaveTramite();\n frm.iCveModalidad.value = top.opener.fGetClaveModalidad();\n frm.cTramite.value = top.opener.fGetDscTramite();\n frm.cModalidad.value = top.opener.fGetDscModalidad();\n frm.cDscOficina.value = top.opener.fGetDscOficina();\n frm.cDscDepartamento.value = top.opener.fGetDscDepto();\n frm.iCveOficina.value = top.opener.fGetClaveOficina();\n frm.iCveDepartamento.value = top.opener.fGetClaveDepto();\n frm.iCveOpinionEntidad.value = top.opener.fGetClaveOpinionEntidad();\n frm.iCveSistema.value = 44;\n\n\n// fNavega();\n }", "_getInputValues() {\n this._formValues = {};\n\n this._inputList.forEach(input => {\n this._formValues[input.name] = input.value;\n });\n\n // console.log(this._formValues);\n return this._formValues;\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('eduMatriCursoFrm.accion'), \n\t\tget('eduMatriCursoFrm.origen'));\n\n\n\tset('eduMatriCursoFrm.id', jsEduMatriCursoId);\n\tset('eduMatriCursoFrm.paisOidPais', [jsEduMatriCursoPaisOidPais]);\n\tset('eduMatriCursoFrm.cplcOidCabePlanCurs', [jsEduMatriCursoCplcOidCabePlanCurs]);\n\tset('eduMatriCursoFrm.codCurs', jsEduMatriCursoCodCurs);\n\tset('eduMatriCursoFrm.terrOidTerr', [jsEduMatriCursoTerrOidTerr]);\n\tset('eduMatriCursoFrm.clasOidClas', [jsEduMatriCursoClasOidClas]);\n\tset('eduMatriCursoFrm.frcuOidFrec', [jsEduMatriCursoFrcuOidFrec]);\n\tset('eduMatriCursoFrm.regaOidRega', [jsEduMatriCursoRegaOidRega]);\n\tset('eduMatriCursoFrm.zsgvOidSubgVent', [jsEduMatriCursoZsgvOidSubgVent]);\n\tset('eduMatriCursoFrm.zorgOidRegi', [jsEduMatriCursoZorgOidRegi]);\n\tset('eduMatriCursoFrm.zzonOidZona', [jsEduMatriCursoZzonOidZona]);\n\tset('eduMatriCursoFrm.zsccOidSecc', [jsEduMatriCursoZsccOidSecc]);\n\tset('eduMatriCursoFrm.ztadOidTerrAdmi', [jsEduMatriCursoZtadOidTerrAdmi]);\n\tset('eduMatriCursoFrm.perdOidPeriInicComp', [jsEduMatriCursoPerdOidPeriInicComp]);\n\tset('eduMatriCursoFrm.perdOidPeriFinaComp', [jsEduMatriCursoPerdOidPeriFinaComp]);\n\tset('eduMatriCursoFrm.perdOidPeriInicCons', [jsEduMatriCursoPerdOidPeriInicCons]);\n\tset('eduMatriCursoFrm.perdOidPeriFinaCons', [jsEduMatriCursoPerdOidPeriFinaCons]);\n\tset('eduMatriCursoFrm.perdOidPeriIngr', [jsEduMatriCursoPerdOidPeriIngr]);\n\tset('eduMatriCursoFrm.ticuOidTipoCurs', [jsEduMatriCursoTicuOidTipoCurs]);\n\tset('eduMatriCursoFrm.valPathFich', jsEduMatriCursoValPathFich);\n\tset('eduMatriCursoFrm.valObjeCurs', jsEduMatriCursoValObjeCurs);\n\tset('eduMatriCursoFrm.valContCurs', jsEduMatriCursoValContCurs);\n\tset('eduMatriCursoFrm.valRelaMateCurs', jsEduMatriCursoValRelaMateCurs);\n\tset('eduMatriCursoFrm.valMontVent', jsEduMatriCursoValMontVent);\n\tset('eduMatriCursoFrm.fecDispCurs', jsEduMatriCursoFecDispCurs);\n\tset('eduMatriCursoFrm.fecLanz', jsEduMatriCursoFecLanz);\n\tset('eduMatriCursoFrm.fecFinCurs', jsEduMatriCursoFecFinCurs);\n\tset('eduMatriCursoFrm.fecUltiCurs', jsEduMatriCursoFecUltiCurs);\n\tset('eduMatriCursoFrm.fecConcCurs', jsEduMatriCursoFecConcCurs);\n\tset('eduMatriCursoFrm.fecIngr', jsEduMatriCursoFecIngr);\n\tset('eduMatriCursoFrm.numPart', jsEduMatriCursoNumPart);\n\tset('eduMatriCursoFrm.numOrde', jsEduMatriCursoNumOrde);\n\tset('eduMatriCursoFrm.numCampa', jsEduMatriCursoNumCampa);\n\tset('eduMatriCursoFrm.numUnid', jsEduMatriCursoNumUnid);\n\tset('eduMatriCursoFrm.desCurs', jsEduMatriCursoDesCurs);\n\tset('eduMatriCursoFrm.indAcceDmrt', jsEduMatriCursoIndAcceDmrt);\n\tset('eduMatriCursoFrm.indAcceInfo', jsEduMatriCursoIndAcceInfo);\n\tset('eduMatriCursoFrm.indAlcaGeog', jsEduMatriCursoIndAlcaGeog);\n\tset('eduMatriCursoFrm.indBloqExte', jsEduMatriCursoIndBloqExte);\n\tset('eduMatriCursoFrm.indMomeEntr', jsEduMatriCursoIndMomeEntr);\n\tset('eduMatriCursoFrm.indCondPedi', jsEduMatriCursoIndCondPedi);\n\tset('eduMatriCursoFrm.indCtrlMoro', jsEduMatriCursoIndCtrlMoro);\n\tset('eduMatriCursoFrm.indCtrlFunc', jsEduMatriCursoIndCtrlFunc);\n\tset('eduMatriCursoFrm.clclOidClieClasCapa', [jsEduMatriCursoClclOidClieClasCapa]);\n\n}", "function limpiarCampos(){\n\t$('#t').val(\"\");\n\t$('#cant').val(\"1\");\n\t$('#idInputSeleccionar').val(\"\");\n\t//$('#precio').val(\"Cantidad x Precio\");\n\t//$('#total').val(\"Total\");\n\t//$('#codigo').val(\"\");\n }", "function getDataTaskForm() {\n const dataTaskForm = {};\n fieldsTaskForm.forEach(({ name, value = '' }) => {\n dataTaskForm[name] = value;\n });\n\n return dataTaskForm;\n}", "function agregarform_alcap(datos){\n d=datos.split('||');\n $('#codigoalcas').val(d[0]);\n $('#nombres').val(d[1]); \n $('#apellidos').val(d[2]); \n $('#tipos').val(d[3]); \n \n \n \n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('belParamBelceFrm.accion'), \n\t\tget('belParamBelceFrm.origen'));\n\t\n\tjsBelParamBelceId = get('belParamBelceFrm.id').toString();\n\tjsBelParamBelceSbacOidSbac = get('belParamBelceFrm.sbacOidSbac')[0];\n\tjsBelParamBelceValDire = get('belParamBelceFrm.valDire').toString();\n\tjsBelParamBelceValTfno = get('belParamBelceFrm.valTfno').toString();\n\tjsBelParamBelceValMontMaxiDife = get('belParamBelceFrm.valMontMaxiDife').toString();\n\tjsBelParamBelceValLimiEfecCaja = get('belParamBelceFrm.valLimiEfecCaja').toString();\n\tjsBelParamBelceNumCaja = get('belParamBelceFrm.numCaja').toString();\n\tjsBelParamBelceValNombLoca = get('belParamBelceFrm.valNombLoca').toString();\n\tjsBelParamBelceValTiempRepo = get('belParamBelceFrm.valTiempRepo').toString();\n\tjsBelParamBelceValFactLoca = get('belParamBelceFrm.valFactLoca').toString();\n\tjsBelParamBelceNumMaxiProd = get('belParamBelceFrm.numMaxiProd').toString();\n\tjsBelParamBelceValAlerStoc = get('belParamBelceFrm.valAlerStoc').toString();\n\tjsBelParamBelceValUsua = get('belParamBelceFrm.valUsua').toString();\n\tjsBelParamBelceClieOidClie = get('belParamBelceFrm.clieOidClie')[0];\n\tjsBelParamBelceSociOidSoci = get('belParamBelceFrm.sociOidSoci')[0];\n\tjsBelParamBelceTtraOidTipoTran = get('belParamBelceFrm.ttraOidTipoTran')[0];\n\tjsBelParamBelceCcbaOidCuenCorrBanc = get('belParamBelceFrm.ccbaOidCuenCorrBanc')[0];\n\tjsBelParamBelceTmvcOidCobr = get('belParamBelceFrm.tmvcOidCobr')[0];\n\tjsBelParamBelceTmvcOidCier = get('belParamBelceFrm.tmvcOidCier')[0];\n\tjsBelParamBelceTmalOidConfStoc = get('belParamBelceFrm.tmalOidConfStoc')[0];\n\tjsBelParamBelceTmalOidConfStocTran = get('belParamBelceFrm.tmalOidConfStocTran')[0];\n\tjsBelParamBelceTmalOidStocTran = get('belParamBelceFrm.tmalOidStocTran')[0];\n\tjsBelParamBelceTmalOidStocDevo = get('belParamBelceFrm.tmalOidStocDevo')[0];\n\tjsBelParamBelceTmalOidRegu = get('belParamBelceFrm.tmalOidRegu')[0];\n\tjsBelParamBelceTmalOidReguSap = get('belParamBelceFrm.tmalOidReguSap')[0];\n\tjsBelParamBelceTmalOidDevoStoc = get('belParamBelceFrm.tmalOidDevoStoc')[0];\n\tjsBelParamBelceTmalOidPetiExis = get('belParamBelceFrm.tmalOidPetiExis')[0];\n\tjsBelParamBelcePaisOidPais = get('belParamBelceFrm.paisOidPais')[0];\n\t\n}", "function get_values()\r\n {\r\n $(\"input\").each(\r\n function()\r\n {\r\n var $ele = $(this);\r\n locals[$ele.attr(\"id\")]=$ele.val();\r\n });\r\n locals.amount = parseFloat($(\"#amount\").val().replace(\"$\",\"\"));\r\n locals.create_account = $(\"#create_account\").is(\":checked\");\r\n locals.accept_guest_terms = $(\"#accept_guest_terms\").is(\":checked\");\r\n locals.accept_member_terms = $(\"#accept_member_terms\").is(\":checked\");\r\n locals.account_type = $(\"#account_type\").val();\r\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\n\n\tset('cobUsuarEtapaCobraDetalFrm.id', jsCobUsuarEtapaCobraDetalId);\n\tset('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg', [jsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent', [jsCobUsuarEtapaCobraDetalZsgvOidSubgVent]);\n\tset('cobUsuarEtapaCobraDetalFrm.zorgOidRegi', [jsCobUsuarEtapaCobraDetalZorgOidRegi]);\n\tset('cobUsuarEtapaCobraDetalFrm.zzonOidZona', [jsCobUsuarEtapaCobraDetalZzonOidZona]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsccOidSecc', [jsCobUsuarEtapaCobraDetalZsccOidSecc]);\n\tset('cobUsuarEtapaCobraDetalFrm.terrOidTerr', [jsCobUsuarEtapaCobraDetalTerrOidTerr]);\n\tset('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr', [jsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe', [jsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe]);\n\tset('cobUsuarEtapaCobraDetalFrm.valObse', jsCobUsuarEtapaCobraDetalValObse);\n\t\n}", "function getValues() {\n fileCond = $fileCondSelect.val();\n nameCond = $nameCondSelect.val();\n dateCond = $dateCondSelect.val();\n rankCond = $rankCondSelect.val();\n tournyCond = $tournyCondSelect.val();\n playerInput = $playerInput.val().trim();\n dateInput = $dateInput.val().trim();\n // conversion here so only one is made for date search\n dateInputInt = parseInt(dateInput, 10) || 0;\n }", "static claerFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function limpa_formulário_cep() {\n //Limpa valores do formulário de cep.\n document.getElementById('id_logradouro').value = (\"\");\n document.getElementById('id_bairro').value = (\"\");\n document.getElementById('id_cidade').value = (\"\");\n document.getElementById('id_estado').value = (\"\");\n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobEtapaDeudaFrm.accion'), \n\t\tget('cobEtapaDeudaFrm.origen'));\n\t\n\tjsCobEtapaDeudaId = get('cobEtapaDeudaFrm.id').toString();\n\tjsCobEtapaDeudaCodEtapDeud = get('cobEtapaDeudaFrm.codEtapDeud').toString();\n\tjsCobEtapaDeudaValDesc = get('cobEtapaDeudaFrm.valDesc').toString();\n\tjsCobEtapaDeudaIndExcl = get('cobEtapaDeudaFrm.indExcl');\n\tjsCobEtapaDeudaValEdadInic = get('cobEtapaDeudaFrm.valEdadInic').toString();\n\tjsCobEtapaDeudaValEdadFina = get('cobEtapaDeudaFrm.valEdadFina').toString();\n\tjsCobEtapaDeudaIndTelf = get('cobEtapaDeudaFrm.indTelf');\n\tjsCobEtapaDeudaImpDesd = get('cobEtapaDeudaFrm.impDesd').toString();\n\tjsCobEtapaDeudaImpHast = get('cobEtapaDeudaFrm.impHast').toString();\n\tjsCobEtapaDeudaNumDiasGracCompPago = get('cobEtapaDeudaFrm.numDiasGracCompPago').toString();\n\tjsCobEtapaDeudaValPorcIncu = get('cobEtapaDeudaFrm.valPorcIncu').toString();\n\tjsCobEtapaDeudaMensOidMens = get('cobEtapaDeudaFrm.mensOidMens')[0];\n\tjsCobEtapaDeudaMelcOidMetoLiquCobr = get('cobEtapaDeudaFrm.melcOidMetoLiquCobr')[0];\n\tjsCobEtapaDeudaTbalOidTipoBala = get('cobEtapaDeudaFrm.tbalOidTipoBala')[0];\n\tjsCobEtapaDeudaGacaOidGuioArguCabe = get('cobEtapaDeudaFrm.gacaOidGuioArguCabe')[0];\n\tjsCobEtapaDeudaPaisOidPais = get('cobEtapaDeudaFrm.paisOidPais')[0];\n\tjsCobEtapaDeudaOredOidEtapDeu1 = get('cobEtapaDeudaFrm.oredOidEtapDeu1')[0];\n\tjsCobEtapaDeudaOredOidEtapDeu2 = get('cobEtapaDeudaFrm.oredOidEtapDeu2')[0];\n\tjsCobEtapaDeudaOredOidEtapDeu3 = get('cobEtapaDeudaFrm.oredOidEtapDeu3')[0];\n\t\n}", "function getFieldList() {\n var appId = kintone.app.getId();\n kintone.api(\n kintone.api.url('/k/v1/form', appIsGuest()),\n 'GET',\n {app: appId},\n function(resp) { //success\n var properties = resp.properties;\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n switch (property.type) {\n case 'SINGLE_LINE_TEXT':\n // add option in select Box\n addSelectOption('#itsunavi-address-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lat-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lon-feeld', property.label, property.code);\n addSelectOption('#itsunavi-tooltip-title', property.label, property.code);\n break;\n case 'NUMBER':\n // add option in select Box\n addSelectOption('#itsunavi-lat-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lon-feeld', property.label, property.code);\n addSelectOption('#itsunavi-tooltip-title', property.label, property.code);\n break;\n case 'SPACER':\n addSelectOption('#itsunavi-space-feeld', property.elementId, property.elementId);\n break;\n default:\n }\n }\n getCurrentConf();\n },\n function(resp) { //failed\n alert('フォーム情報の取得に失敗しました\\nError: ' + resp.message);\n }\n );\n }", "function getFormValues() { \n\t\tvar firstname = document.getElementById(\"form1\").fname.value;\n\t\tvar lastname = document.getElementById(\"form1\").lname.value;\n\t\tconsole.log(firstname + \" \" + lastname);\n\t}", "function tiendaStoreFormInputs(form) {\r\n\tvar values = new Array();\r\n\tfor ( i = 0; i < form.elements.length; i++) {\r\n\t\tvalue = {\r\n\t\t\tvalue : form.elements[i].value,\r\n\t\t\tchecked : form.elements[i].checked\r\n\t\t};\r\n\t\tvalues[form.elements[i].name] = value;\r\n\t}\r\n\treturn values;\r\n}", "function getCurrentValues() {\n let presetName = String(new FormData(document.forms[1]).get(\"presetName\"));\n let colorStart = String(new FormData(document.forms[1]).get(\"startColor\"));\n let colorEnd = String(new FormData(document.forms[1]).get(\"endColor\"));\n let lifetime = Number(new FormData(document.forms[1]).get(\"lifetime\")); // stanadard 0.05 + 0.025\n let size = Number(new FormData(document.forms[1]).get(\"particleSize\"));\n let radius = Number(new FormData(document.forms[1]).get(\"particleRadius\"));\n let particleAmount = Number(new FormData(document.forms[1]).get(\"spawnAmount\"));\n let hierarchyMax = Number(new FormData(document.forms[1]).get(\"explosionTimes\"));\n // Create a data object here for saving in the db\n let iValues = {\n preset: presetName,\n startColor: colorStart,\n endColor: colorEnd,\n lifetime: lifetime,\n particleSize: size,\n particleRadius: radius,\n spawnAmount: particleAmount,\n explosionTimes: hierarchyMax\n };\n console.log(iValues);\n return iValues;\n }", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('calGuiasFrm.accion'), \n\t\tget('calGuiasFrm.origen'));\n\t\n\tjsCalGuiasId = get('calGuiasFrm.id').toString();\n\tjsCalGuiasCodGuia = get('calGuiasFrm.codGuia').toString();\n\tjsCalGuiasDpteOidDepa = get('calGuiasFrm.dpteOidDepa')[0];\n\tjsCalGuiasValTitu = get('calGuiasFrm.valTitu').toString();\n\tjsCalGuiasFecInicVali = get('calGuiasFrm.fecInicVali').toString();\n\tjsCalGuiasFecFinVali = get('calGuiasFrm.fecFinVali').toString();\n\tjsCalGuiasValDescGuia = get('calGuiasFrm.valDescGuia').toString();\n\tjsCalGuiasPaisOidPais = get('calGuiasFrm.paisOidPais')[0];\n\t\n}", "function recuperarDadosQuatroParametros(idRegistro, descricaoRegistro, codigoRegistro, tipoConsulta) {\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\r\n\tif (tipoConsulta == 'setorComercialOrigem') {\r\n form.setorComercialOrigemCD.value = codigoRegistro;\r\n form.setorComercialOrigemID.value = idRegistro;\r\n\t form.nomeSetorComercialOrigem.value = descricaoRegistro;\r\n\t form.nomeSetorComercialOrigem.style.color = \"#000000\";\r\n\t \r\n\t form.setorComercialDestinoCD.value = codigoRegistro;\r\n form.setorComercialDestinoID.value = idRegistro;\r\n\t form.nomeSetorComercialDestino.value = descricaoRegistro;\r\n\t form.nomeSetorComercialDestino.style.color = \"#000000\";\r\n\t form.quadraOrigemNM.focus();\r\n\t}\r\n\r\n\tif (tipoConsulta == 'setorComercialDestino') {\r\n form.setorComercialDestinoCD.value = codigoRegistro;\r\n form.setorComercialDestinoID.value = idRegistro;\r\n\t form.nomeSetorComercialDestino.value = descricaoRegistro;\r\n\t form.nomeSetorComercialDestino.style.color = \"#000000\"; \r\n\t form.quadraDestinoNM.focus();\r\n\t}\r\n\r\n//\tif (tipoConsulta == 'quadraOrigem') {\r\n // form.quadraOrigemNM.value = codigoRegistro;\r\n\t// form.quadraOrigemID.value = idRegistro;\r\n//\t form.quadraMensagemOrigem.value = descricaoRegistro;\r\n\t// form.quadraMensagemOrigem.style.color = \"#000000\";\r\n\t \r\n//\t form.quadraDestinoNM.value = codigoRegistro;\r\n\t// form.quadraDestinoID.value = idRegistro;\r\n\t //form.quadraMensagemDestino.value = descricaoRegistro;\r\n// }\r\n\r\n//\tif (tipoConsulta == 'quadraDestino') {\r\n // form.quadraDestinoNM.value = codigoRegistro;\r\n\t// form.quadraDestinoID.value = idRegistro;\r\n// \t form.quadraMensagemDestino.value = descricaoRegistro;\r\n //\t form.quadraMensagemDestino.style.color = \"#000000\";\r\n\t//}\r\n\tform.action = 'exibirFiltrarImovelOutrosCriteriosConsumidoresInscricao.do?menu=sim&gerarRelatorio=RelatorioCadastroConsumidoresInscricao&limpar=S';\r\n\tform.submit();\r\n\r\n}", "function fetchformdata() {\nlet form = document.forms[0];\nlet day, month, year, gender;\n\ngender = form.gender.value;\n\nday = parseInt(form.day.value);\nmonth = parseInt(form.month.value);\nyear = parseInt(form.year.value);\n\nreturn [gender, day, month, year];\n\n}", "function limpa_formulário_cep() {\r\n //LIMPA VALORES DO FORMULÁRIO DE CEP\r\n document.getElementById('rua').value=(\"\");\r\n document.getElementById('bairro').value=(\"\");\r\n document.getElementById('cidade').value=(\"\");\r\n document.getElementById('uf').value=(\"\");\r\n}", "function iniciareditaringresos(datos) {\n\n document.getElementById(\"idti\").value = datos[0][\"idtipoingresosganancias\"]\n document.getElementById(\"nombreingresoseditar\").value = datos[0][\"nombre\"];\n document.getElementById(\"descripcioningresoseditar\").value = datos[0][\"descripcion\"];\n document.getElementById(\"ayudaingresoseditar\").value = datos[0][\"ayuda\"];\n\n}", "buildForm() {\n this.newSalutation = this.fb.group({\n language: [''],\n salutation: [''],\n gender: ['2'],\n letterSalutation: [''],\n });\n }", "getFormData(form) {\n const type = form['query_type'].value || 1\n \n let content = form['query_content'].value\n const values = {\n query: content,\n name: form['query_name'].value,\n uri: form['query_endpoint'].value.trim(),\n params: {\n type: type,\n period: [ content.includes(\"$beginYear\") ? +form['from_year'].value : '', \n content.includes(\"$endYear\") ? +form['to_year'].value : '' ],\n lab: [ content.includes(\"$lab1\") ? form['query_lab1'].value : '', \n content.includes(\"$lab2\") ? form['query_lab2'].value : '' ],\n country: content.includes(\"$country\") ? form['query_country'].value : '',\n list_authors: form['query_list_authors'].value.split(',').map(d => `\"${d.trim()}\"`)\n }\n };\n\n this.getVariables(values.params)\n\n values.params.prefixes = this.getPrefixes()\n \n return values;\n }", "_readFromForm() {\n this.dao.phylum = document.getElementById('phylum').value;\n this.dao.phylum_ott_id = document.getElementById('phylum_ott_id').value;\n this.dao.class = document.getElementById('class').value;\n this.dao.class_ott_id = document.getElementById('class_ott_id').value;\n this.dao.order = document.getElementById('order').value;\n this.dao.order_ott_id = document.getElementById('order_ott_id').value;\n this.dao.family = document.getElementById('family').value;\n this.dao.family_ott_id = document.getElementById('family_ott_id').value;\n this.dao.genus = document.getElementById('genus').value;\n this.dao.genus_ott_id = document.getElementById('genus_ott_id').value;\n this.dao.species = document.getElementById('species').value;\n this.dao.species_ott_id = document.getElementById('species_ott_id').value;\n this.dao.unique_name = document.getElementById('unique_name').value;\n this.dao.vernacular_name = document.getElementById('vernacular_name').value;\n\n if (this.dao.ott_id =='' || this.dao.phylum == '' || this.dao.class == '' || \n this.dao.order == '' || this.dao.family == '' || this.dao.genus == '' ||\n this.dao.species == '' || this.dao.unique_name == '' ||\n this.dao.vernacular_name == '') throw('Please fill all fields');\n }", "function getFormValues(){\n var form = document.getElementById (\"the_form\");\n var todo = form.elements.task.value;\n return {task: todo}; \n}", "function loadFormValues() {\n let industryId = $('#industryId').val();\n let formValues = getFormValuesObject();\n \n // combine any values that may exist for the industry or globally\n let industryValues = formValues[industryId] || {};\n let globalValues = formValues[\"global\"] || {};\n let combinedValues = mergeObjects(industryValues, globalValues);\n \n for (let inputId in combinedValues) {\n $(inputId).val(bigNum(combinedValues[inputId]));\n }\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('maeEstatProduFrm.accion'), \n\t\tget('maeEstatProduFrm.origen'));\n\n\n\tset('maeEstatProduFrm.id', jsMaeEstatProduId);\n\tset('maeEstatProduFrm.paisOidPais', [jsMaeEstatProduPaisOidPais]);\n\tset('maeEstatProduFrm.codEstaProd', jsMaeEstatProduCodEstaProd);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('maeEstatProduFrm', 1, jsMaeEstatProduDescripcion)\n\t\tloadLocalizationWidget('maeEstatProduFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('maeEstatProduFrm.Descripcion', jsMaeEstatProduDescripcion);\t\t\n\t}\n\t\n}", "function obtenerInputsIdsProducto(){\n return ['txtCodigo', 'txtNombre', 'txtUnidad', 'txtDescripcion'];\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cccSubprFrm.accion'), \n\t\tget('cccSubprFrm.origen'));\n\n\n\tset('cccSubprFrm.id', jsCccSubprId);\n\tset('cccSubprFrm.ccprOidProc', [jsCccSubprCcprOidProc]);\n\tset('cccSubprFrm.codSubp', jsCccSubprCodSubp);\n\tset('cccSubprFrm.desSubp', jsCccSubprDesSubp);\n\t\n\t\t\t\n\t\t\tif(jsCccSubprValIndiGestMarc == \"true\") set('cccSubprFrm.valIndiGestMarc', 'S');\n\t\t\telse set('cccSubprFrm.valIndiGestMarc', 'N');\n\t\n\t\t\t\n\t\t\tif(jsCccSubprValIndiActuCuot == \"true\") set('cccSubprFrm.valIndiActuCuot', 'S');\n\t\t\telse set('cccSubprFrm.valIndiActuCuot', 'N');\n\t\n\t\t\t\n\t\t\tif(jsCccSubprValIndiTipoAbon == \"true\") set('cccSubprFrm.valIndiTipoAbon', 'S');\n\t\t\telse set('cccSubprFrm.valIndiTipoAbon', 'N');\n\tset('cccSubprFrm.valIndiCons', jsCccSubprValIndiCons);\n\tset('cccSubprFrm.valObse', jsCccSubprValObse);\n\t\n}", "function getDataFromForm() {\n var nombre = document.getElementById('full_name');\n var correo = document.getElementById('email');\n var tel = document.getElementById('telephone');\n var clase = getValueFromRadio('clase');\n var posicion = document.getElementById('position');\n var comunidad = document.getElementById('community');\n \n // this validates the precence of inportant inputs and add the invalid class in case of empty \n var inputsAreValid = isValidInputField(nombre) && isValidInputField(correo) && isValidInputField(tel) && isValidInputField(posicion);\n if (inputsAreValid) {\n return {\n nombre: nombre.value,\n correo: correo.value,\n tel: tel.value,\n clase: clase,\n posicion : posicion.value,\n comunidad: comunidad.value\n }\n }\n \n return false;\n }", "function getFormValues() {\n\tname = document.getElementById(\"name\").value;\n\temail = document.getElementById(\"email\").value;\n\tsubject = document.getElementById(\"subject\").value;\n\tmessage = document.getElementById(\"message\").value;\n}", "function vals_arr() {\n return $(this).val();\n }", "function vals_arr() {\n return $(this).val();\n }", "function agregaform(datos){\r\n\r\n\td=datos.split('||');\r\n\r\n\t$('#rut_proveedor2').val(d[0]);\r\n $('#nombre_proveedor2').val(d[1]);\r\n $('#telefono_proveedor2').val(d[2]);\r\n\t$('#correo_proveedor2').val(d[3]);\r\n\r\n\t\r\n}", "getData() {\n var ret = {};\n var elements = $(\"input, textarea, checkbox, select\", this);\n elements.each((i, e) => this._gather_form_data(e, ret));\n this._log(\"getData():\", ret);\n return ret;\n }", "function agregaform(datos){\n \n d=datos.split('||');\n $('#codigou').val(d[0]);\n $('#nombreu').val(d[1]);\n}", "_readFromForm() {\n this.dao.citation_id = document.getElementById('citation_id').value;\n this.dao.ott_id = document.getElementById('ott_id').value;\n this.dao.background_noise_in_decibel = document.getElementById('background_noise_in_decibel').value;\n this.dao.calibration = document.getElementById('calibration').value;\n this.dao.distance_to_sound_source_in_meter = document.getElementById('distance_to_sound_source_in_meter').value;\n this.dao.facility_id = document.getElementById('facility_id').value;\n this.dao.latitude_in_decimal_degree = document.getElementById('latitude_in_decimal_degree').value;\n this.dao.longitude_in_decimal_degree = document.getElementById('longitude_in_decimal_degree').value;\n this.dao.measurement_method_id = document.getElementById('measurement_method_id').value;\n this.dao.measurement_type = document.getElementById('measurement_type').value;\n this.dao.medium = document.getElementById('medium').value;\n this.dao.number_of_measurements = document.getElementById('number_of_measurements').value;\n this.dao.position_first_electrode = document.getElementById('position_first_electrode').value;\n this.dao.position_second_electrode = document.getElementById('position_second_electrode').value;\n this.dao.position_third_electrode = document.getElementById('position_third_electrode').value;\n this.dao.position_of_animal = document.getElementById('position_of_animal').value;\n this.dao.sedated = document.getElementById('sedated').value;\n this.dao.sedation_details = document.getElementById('sedation_details').value;\n this.dao.test_environment_description = document.getElementById('test_environment_description').value;\n this.dao.testtone_form_method_id = document.getElementById('testtone_form_method_id').value;\n this.dao.testtone_presentation_method_constants = document.getElementById('testtone_presentation_method_constants').value;\n this.dao.testtone_presentation_sound_form = document.getElementById('testtone_presentation_sound_form').value;\n this.dao.testtone_presentation_staircase = document.getElementById('testtone_presentation_staircase').value;\n this.dao.threshold_determination_method = document.getElementById('threshold_determination_method').value;\n this.dao.year_of_experiment_start = document.getElementById('year_of_experiment_start').value;\n this.dao.year_of_experiment_end = document.getElementById('year_of_experiment_end').value;\n }", "function ObtemPessoaDoFormulario(form) {\r\n var pessoa = {\r\n nome : form.nome.value,\r\n matricula : form.matricula.value,\r\n sala : form.sala.value,\r\n horario : form.horario.value\r\n }\r\n return pessoa;\r\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('segPaisViewFrm.accion'), \n\t\tget('segPaisViewFrm.origen'));\n\n\n\tset('segPaisViewFrm.id', jsSegPaisViewId);\n\tset('segPaisViewFrm.codPais', jsSegPaisViewCodPais);\n\tset('segPaisViewFrm.moneOidMone', [jsSegPaisViewMoneOidMone]);\n\tset('segPaisViewFrm.moneOidMoneAlt', [jsSegPaisViewMoneOidMoneAlt]);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('segPaisViewFrm', 1, jsSegPaisViewDescripcion)\n\t\tloadLocalizationWidget('segPaisViewFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('segPaisViewFrm.Descripcion', jsSegPaisViewDescripcion);\t\t\n\t}\n\tset('segPaisViewFrm.indInteGis', [jsSegPaisViewIndInteGis]);\n\tset('segPaisViewFrm.valIden', [jsSegPaisViewValIden]);\n\tset('segPaisViewFrm.indSaldUnic', jsSegPaisViewIndSaldUnic);\n\tset('segPaisViewFrm.valProgEjec', jsSegPaisViewValProgEjec);\n\tset('segPaisViewFrm.valPorcAlar', jsSegPaisViewValPorcAlar);\n\tset('segPaisViewFrm.indCompAuto', jsSegPaisViewIndCompAuto);\n\tset('segPaisViewFrm.numDiasMora', jsSegPaisViewNumDiasMora);\n\tset('segPaisViewFrm.indTratAcumDesc', jsSegPaisViewIndTratAcumDesc);\n\tset('segPaisViewFrm.valTiemRezo', jsSegPaisViewValTiemRezo);\n\tset('segPaisViewFrm.valConfSecuCcc', [jsSegPaisViewValConfSecuCcc]);\n\tset('segPaisViewFrm.numDiasFact', jsSegPaisViewNumDiasFact);\n\tset('segPaisViewFrm.numLimiDifePago', jsSegPaisViewNumLimiDifePago);\n\tset('segPaisViewFrm.indEmisVenc', jsSegPaisViewIndEmisVenc);\n\tset('segPaisViewFrm.valMaxiDifeAnlsComb', jsSegPaisViewValMaxiDifeAnlsComb);\n\tset('segPaisViewFrm.numPosiNumeClie', jsSegPaisViewNumPosiNumeClie);\n\tset('segPaisViewFrm.valFormFech', [jsSegPaisViewValFormFech]);\n\tset('segPaisViewFrm.valSepaMile', [jsSegPaisViewValSepaMile]);\n\tset('segPaisViewFrm.valSepaDeci', [jsSegPaisViewValSepaDeci]);\n\tset('segPaisViewFrm.numPeriEgre', jsSegPaisViewNumPeriEgre);\n\tset('segPaisViewFrm.numPeriReti', jsSegPaisViewNumPeriReti);\n\tset('segPaisViewFrm.fopaOidFormPago', [jsSegPaisViewFopaOidFormPago]);\n\tset('segPaisViewFrm.valCompTele', jsSegPaisViewValCompTele);\n\tset('segPaisViewFrm.indFletZonaUbig', [jsSegPaisViewIndFletZonaUbig]);\n\tset('segPaisViewFrm.valIndiSecuMoni', jsSegPaisViewValIndiSecuMoni);\n\tset('segPaisViewFrm.indSecu', [jsSegPaisViewIndSecu]);\n\tset('segPaisViewFrm.indBalaAreaCheq', [jsSegPaisViewIndBalaAreaCheq]);\n\tset('segPaisViewFrm.valUrl', jsSegPaisViewValUrl);\n\t\n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('eduMatriCursoFrm.accion'), \n\t\tget('eduMatriCursoFrm.origen'));\n\t\n\tjsEduMatriCursoId = get('eduMatriCursoFrm.id').toString();\n\tjsEduMatriCursoPaisOidPais = get('eduMatriCursoFrm.paisOidPais')[0];\n\tjsEduMatriCursoCplcOidCabePlanCurs = get('eduMatriCursoFrm.cplcOidCabePlanCurs')[0];\n\tjsEduMatriCursoCodCurs = get('eduMatriCursoFrm.codCurs').toString();\n\tjsEduMatriCursoTerrOidTerr = get('eduMatriCursoFrm.terrOidTerr')[0];\n\tjsEduMatriCursoClasOidClas = get('eduMatriCursoFrm.clasOidClas')[0];\n\tjsEduMatriCursoFrcuOidFrec = get('eduMatriCursoFrm.frcuOidFrec')[0];\n\tjsEduMatriCursoRegaOidRega = get('eduMatriCursoFrm.regaOidRega')[0];\n\tjsEduMatriCursoZsgvOidSubgVent = get('eduMatriCursoFrm.zsgvOidSubgVent')[0];\n\tjsEduMatriCursoZorgOidRegi = get('eduMatriCursoFrm.zorgOidRegi')[0];\n\tjsEduMatriCursoZzonOidZona = get('eduMatriCursoFrm.zzonOidZona')[0];\n\tjsEduMatriCursoZsccOidSecc = get('eduMatriCursoFrm.zsccOidSecc')[0];\n\tjsEduMatriCursoZtadOidTerrAdmi = get('eduMatriCursoFrm.ztadOidTerrAdmi')[0];\n\tjsEduMatriCursoPerdOidPeriInicComp = get('eduMatriCursoFrm.perdOidPeriInicComp')[0];\n\tjsEduMatriCursoPerdOidPeriFinaComp = get('eduMatriCursoFrm.perdOidPeriFinaComp')[0];\n\tjsEduMatriCursoPerdOidPeriInicCons = get('eduMatriCursoFrm.perdOidPeriInicCons')[0];\n\tjsEduMatriCursoPerdOidPeriFinaCons = get('eduMatriCursoFrm.perdOidPeriFinaCons')[0];\n\tjsEduMatriCursoPerdOidPeriIngr = get('eduMatriCursoFrm.perdOidPeriIngr')[0];\n\tjsEduMatriCursoTicuOidTipoCurs = get('eduMatriCursoFrm.ticuOidTipoCurs')[0];\n\tjsEduMatriCursoValPathFich = get('eduMatriCursoFrm.valPathFich').toString();\n\tjsEduMatriCursoValObjeCurs = get('eduMatriCursoFrm.valObjeCurs').toString();\n\tjsEduMatriCursoValContCurs = get('eduMatriCursoFrm.valContCurs').toString();\n\tjsEduMatriCursoValRelaMateCurs = get('eduMatriCursoFrm.valRelaMateCurs').toString();\n\tjsEduMatriCursoValMontVent = get('eduMatriCursoFrm.valMontVent').toString();\n\tjsEduMatriCursoFecDispCurs = get('eduMatriCursoFrm.fecDispCurs').toString();\n\tjsEduMatriCursoFecLanz = get('eduMatriCursoFrm.fecLanz').toString();\n\tjsEduMatriCursoFecFinCurs = get('eduMatriCursoFrm.fecFinCurs').toString();\n\tjsEduMatriCursoFecUltiCurs = get('eduMatriCursoFrm.fecUltiCurs').toString();\n\tjsEduMatriCursoFecConcCurs = get('eduMatriCursoFrm.fecConcCurs').toString();\n\tjsEduMatriCursoFecIngr = get('eduMatriCursoFrm.fecIngr').toString();\n\tjsEduMatriCursoNumPart = get('eduMatriCursoFrm.numPart').toString();\n\tjsEduMatriCursoNumOrde = get('eduMatriCursoFrm.numOrde').toString();\n\tjsEduMatriCursoNumCampa = get('eduMatriCursoFrm.numCampa').toString();\n\tjsEduMatriCursoNumUnid = get('eduMatriCursoFrm.numUnid').toString();\n\tjsEduMatriCursoDesCurs = get('eduMatriCursoFrm.desCurs').toString();\n\tjsEduMatriCursoIndAcceDmrt = get('eduMatriCursoFrm.indAcceDmrt').toString();\n\tjsEduMatriCursoIndAcceInfo = get('eduMatriCursoFrm.indAcceInfo').toString();\n\tjsEduMatriCursoIndAlcaGeog = get('eduMatriCursoFrm.indAlcaGeog').toString();\n\tjsEduMatriCursoIndBloqExte = get('eduMatriCursoFrm.indBloqExte').toString();\n\tjsEduMatriCursoIndMomeEntr = get('eduMatriCursoFrm.indMomeEntr').toString();\n\tjsEduMatriCursoIndCondPedi = get('eduMatriCursoFrm.indCondPedi').toString();\n\tjsEduMatriCursoIndCtrlMoro = get('eduMatriCursoFrm.indCtrlMoro').toString();\n\tjsEduMatriCursoIndCtrlFunc = get('eduMatriCursoFrm.indCtrlFunc').toString();\n\tjsEduMatriCursoClclOidClieClasCapa = get('eduMatriCursoFrm.clclOidClieClasCapa')[0];\n\n}", "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function datosCita(e) {\r\n citaObj[e.target.name] = e.target.value;\r\n}", "getDataFromInputs()\n {\n let data = [];\n for(const input in this.inputStrcture)\n data.push(document.getElementById(input.toLowerCase()).value);\n \n return data;\n }", "buildForm() {\n this.salutationForm = this.fb.group({\n firstname: [''],\n gender: [''],\n language: [''],\n lastname: [''],\n letterSalutation: [''],\n salutation: [''],\n salutationTitle: [''],\n title: ['']\n });\n }", "function fSetFormulario(iCampTipo,iFactor,iVariable,iValor){\n iCampo=iCampTipo;\n iFac=iFactor;\n iVar=iVariable;\n iVal=iValor;\n}", "fillForm(fSalut) {\n this.salutationForm.setValue({\n firstname: fSalut.firstname,\n gender: fSalut.gender,\n // language: fSalut.language,\n language: this.convertLanguage(fSalut.language),\n lastname: fSalut.lastname,\n letterSalutation: fSalut.letterSalutation,\n salutation: fSalut.salutation,\n salutationTitle: fSalut.salutationTitle,\n title: fSalut.title,\n });\n }", "function getParams(){\n let inputs = d3.select(\".list-group-item\").selectAll(\".form-control\")\n let params = {}\n\n inputs.each(function() {\n if (this.value){\n params[this.id] = this.value\n }\n });\n return params\n }", "function createObject(data) {\n data.forEach(function (element, index) {\n MathForm[element.name] = element.value;\n });\n}", "function limpiarCamposForm(idForm){\n\n idForm.each (function(){\n \n this.reset();\n\n });\n\n }", "function limpiarFormulario(idForm){\n var form=document.getElementById(idForm);\n if(form!=null){\n for(var i in form.elements){\n\n if(form.elements[i].nodeName == \"TEXTAREA\"){\n form.elements[i].value=\"\"; \n }\n //console.log(form.elements[i].type);\n //console.log(form.elements[i].checked);\n //console.log(form.elements[i].value);\n\n\n switch(form.elements[i].type){\n case \"text\":\n form.elements[i].value=\"\";\n break;\n case \"email\":\n form.elements[i].value=\"\";\n break;\n case \"number\":\n form.elements[i].value=\"\";\n break;\n case \"password\":\n form.elements[i].value=\"\";\n break;\n case \"select-one\":\n form.elements[i].value=\"0\";\n break;\n case \"checkbox\":\n form.elements[i].checked=false;\n break;\n case \"radio\":\n form.elements[i].checked=false;\n break;\n }\n }\n }\n \n console.log(form);\n console.log(idForm);\n \n}", "function getFormValues(form) \r\n{\r\n\t//initialize vars\r\n\tvar locationOption = \"\";\r\n\tvar groupOption = \"\";\r\n var metricOption = \"\";\r\n var yearOption = \"\";\r\n var gpaOption = \"\";\r\n var mathOption = \"\";\r\n var verbalOption = \"\";\r\n var genderOption = \"\";\r\n \r\n //for each element in the form...\r\n for (var i = 0; i < form.elements.length; i++ ) {\r\n \t\r\n \t//get which location the user has selected\r\n \tif (form.elements[i].name == \"Location\") {\r\n \tlocationOption += form.elements[i].value;\r\n }\r\n \t\r\n \t//get which \"group\" button is checked\r\n if (form.elements[i].name == \"groups\") {\r\n if (form.elements[i].checked == true) {\r\n groupOption += form.elements[i].value;\r\n }\r\n }\r\n \r\n //and which \"metric\" button is checked\r\n if (form.elements[i].name == \"metrics\") {\r\n if (form.elements[i].checked == true) {\r\n metricOption += form.elements[i].value;\r\n }\r\n }\r\n \r\n //get the metric drop-down-menu values\r\n if (form.elements[i].name == \"gpaSelector\") {\r\n \tgpaOption += form.elements[i].value;\r\n }\r\n \r\n if (form.elements[i].name == \"satMathSelector\") {\r\n \tmathOption += form.elements[i].value;\r\n }\r\n \r\n if (form.elements[i].name == \"satVerbalSelector\") {\r\n \tverbalOption += form.elements[i].value;\r\n }\r\n \r\n if (form.elements[i].name == \"genderSelector\") {\r\n \tgenderOption += form.elements[i].value;\r\n }\r\n \r\n //and which \"year\" button is checked\r\n if (form.elements[i].name == \"years\") {\r\n if (form.elements[i].checked == true) {\r\n yearOption += form.elements[i].value;\r\n }\r\n }\r\n }\r\n \r\n //update globals\r\n selectedLocation = locationOption;\r\n selectedGroup = groupOption;\r\n selectedMetric = metricOption;\r\n selectedYear = yearOption;\r\n selectedGPA = gpaOption;\r\n\tselectedMath = mathOption;\r\n\tselectedVerbal = verbalOption;\r\n\tselectedGender = genderOption;\r\n\t\r\n\t//we only care about the drop-down associated with the selected metric\r\n\tswitch(selectedMetric)\r\n\t{\r\n\t\tcase \"None\":\r\n\t\t\timportantMetric = \"None\";\r\n\t\t\tbreak;\r\n\t\tcase \"GPA\":\r\n\t\t\timportantMetric = selectedGPA;\r\n\t\t\tbreak;\r\n\t\tcase \"SAT Math\":\r\n\t\t\timportantMetric = selectedMath;\r\n\t\t\tbreak;\r\n\t\tcase \"SAT Verbal\":\r\n\t\t\timportantMetric = selectedVerbal;\r\n\t\t\tbreak;\r\n\t\tcase \"Male / Female\":\r\n\t\t\timportantMetric = selectedGender;\r\n\t\t\tbreak;\r\n\t\tcase \"Visited\":\r\n\t\t\timportantMetric = \"Visited\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\timportantMetric = \"ERROR\";\r\n\t}\r\n \r\n //create associative array\r\n\tvar optionSettings = {};\r\n\toptionSettings['location'] = selectedLocation;\r\n\toptionSettings['group'] = selectedGroup;\r\n\toptionSettings['metric'] = selectedMetric;\r\n\toptionSettings['year'] = selectedYear;\r\n\toptionSettings['dropVal'] = importantMetric;\r\n\t\r\n\treturn optionSettings; \r\n}//end getValues", "function limpiarFormulario() {\n\n document.getElementById(\"nombre\").value = \"\";\n document.getElementById(\"apellidos\").value = \"\";\n document.getElementById(\"telefono\").value = \"\";\n document.getElementById(\"fecha\").value = \"\";\n}", "function LimpiarCampos()\n{\n\t\n\t__('agente_name').value= \"\";\n\t__('agente_venta').value= \"\";\n\t__('user_zona').value = \"\";\n\t__('agente_comision').value= \"\";\n\t__('agente_folio').value = \"\";\n\t__('user').value = \"\";\n\t__('registro').style.display = \"inline\";\n\t__('modifica').style.display = \"none\";\n\t__('elimina').style.display = \"none\";\n\t\n\t\n\t// __('cancelar').style.display = 'none';\n\t// __('imprimir').style.display = 'none';\n}", "function placeValues(){\n\t$(\"#pYear\").val(year), $(\"#course1\").val(choice1), $(\"#course2\").val(choice2);\n\t$(\"#course3\").val(choice3), $(\"#course4\").val(choice4), $(\"#course5\").val(choice5);\n\t$(\"#pTAExp\").val(taExp), $(\"#pTAVol\").val(taVol), $(\"#pTAWhy\").val(taWhy);\n\t$(\"#studentStatus\").val(status), $(\"#userEmail\").val(email);\n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('segPaisViewFrm.accion'), \n\t\tget('segPaisViewFrm.origen'));\n\t\n\tjsSegPaisViewId = get('segPaisViewFrm.id').toString();\n\tjsSegPaisViewCodPais = get('segPaisViewFrm.codPais').toString();\n\tjsSegPaisViewMoneOidMone = get('segPaisViewFrm.moneOidMone')[0];\n\tjsSegPaisViewMoneOidMoneAlt = get('segPaisViewFrm.moneOidMoneAlt')[0];\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tjsSegPaisViewDescripcion = buildLocalizedString('segPaisViewFrm', 1);\n\t}else{\n\t\tjsSegPaisViewDescripcion = get('segPaisViewFrm.Descripcion');\n\t}\n\tjsSegPaisViewIndInteGis = get('segPaisViewFrm.indInteGis')[0];\n\tjsSegPaisViewValIden = get('segPaisViewFrm.valIden')[0];\n\tjsSegPaisViewIndSaldUnic = get('segPaisViewFrm.indSaldUnic');\n\tjsSegPaisViewValProgEjec = get('segPaisViewFrm.valProgEjec').toString();\n\tjsSegPaisViewValPorcAlar = get('segPaisViewFrm.valPorcAlar').toString();\n\tjsSegPaisViewIndCompAuto = get('segPaisViewFrm.indCompAuto').toString();\n\tjsSegPaisViewNumDiasMora = get('segPaisViewFrm.numDiasMora').toString();\n\tjsSegPaisViewIndTratAcumDesc = get('segPaisViewFrm.indTratAcumDesc');\n\tjsSegPaisViewValTiemRezo = get('segPaisViewFrm.valTiemRezo').toString();\n\tjsSegPaisViewValConfSecuCcc = get('segPaisViewFrm.valConfSecuCcc')[0];\n\tjsSegPaisViewNumDiasFact = get('segPaisViewFrm.numDiasFact').toString();\n\tjsSegPaisViewNumLimiDifePago = get('segPaisViewFrm.numLimiDifePago').toString();\n\tjsSegPaisViewIndEmisVenc = get('segPaisViewFrm.indEmisVenc');\n\tjsSegPaisViewValMaxiDifeAnlsComb = get('segPaisViewFrm.valMaxiDifeAnlsComb').toString();\n\tjsSegPaisViewNumPosiNumeClie = get('segPaisViewFrm.numPosiNumeClie').toString();\n\tjsSegPaisViewValFormFech = get('segPaisViewFrm.valFormFech')[0];\n\tjsSegPaisViewValSepaMile = get('segPaisViewFrm.valSepaMile')[0];\n\tjsSegPaisViewValSepaDeci = get('segPaisViewFrm.valSepaDeci')[0];\n\tjsSegPaisViewNumPeriEgre = get('segPaisViewFrm.numPeriEgre').toString();\n\tjsSegPaisViewNumPeriReti = get('segPaisViewFrm.numPeriReti').toString();\n\tjsSegPaisViewFopaOidFormPago = get('segPaisViewFrm.fopaOidFormPago')[0];\n\tjsSegPaisViewValCompTele = get('segPaisViewFrm.valCompTele').toString();\n\tjsSegPaisViewIndFletZonaUbig = get('segPaisViewFrm.indFletZonaUbig')[0];\n\tjsSegPaisViewValIndiSecuMoni = get('segPaisViewFrm.valIndiSecuMoni');\n\tjsSegPaisViewIndSecu = get('segPaisViewFrm.indSecu')[0];\n\tjsSegPaisViewIndBalaAreaCheq = get('segPaisViewFrm.indBalaAreaCheq')[0];\n\tjsSegPaisViewValUrl = get('segPaisViewFrm.valUrl').toString();\n\t\n}", "function getFormValues( p_formId ){\n\tvar form_answers;\n\tvar answers = {};\n\n\t// The input:hidden messes up when getting hte results for filters\n\t// To fix this check if the p_formId contains a substring\n\tvar pattern = /Form/gi;\n\tif( pattern.test(p_formId) ){\n\t\tform_answers = $('#'+p_formId).find('input:checked, input:text, textarea, input:hidden, select');\n\t}else{\n\t\tform_answers = $('#'+p_formId).find('input:checked, input:text, textarea, select');\n\t}\n\tconsole.log(\"FORM A: \" +form_answers);\n\tfor( var i=0; i<form_answers.length; i++){\n\t\t// Current answer\n\t\tvar ans = form_answers[i];\n\t\tif( !answers.hasOwnProperty(ans.name) ){\n\t\t\tanswers[ans.name] = [ans.value];\n\t\t}else{\n\t\t\t// When its checckboces dont include the 'Other' \n\t\t\t// if its checked or if it's text field is empty\n\t\t\tif(ans.value != \"Other\"){\n\t\t\t\tif(ans.value != \"\")\n\t\t\t\tanswers[ans.name].push(ans.value);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\treturn answers;\n}", "function getFormValues($form, fields) {\n\tvar form_values = {}, i, len;\n\n\tfor (i = 0, len = fields.length; i < len; i++) {\n\t\tform_values[fields[i]] = $form.find('#' + fields[i]).val();\n\t}\n\treturn form_values;\n}", "_getValues() {\n var options = {};\n var form = this.$form;\n var values = form.find('form').serializeArray();\n\n $.each(values, function(index, object) {\n var input = form.find(`[name=\"${object.name}\"][data-attribute]`);\n var key = input.attr('data-attribute');\n\n if (key) {\n if (/^.*\\[\\]$/.test(object.name)) {\n if (options[key]) {\n options[key] = `${options[key]},${object.value}`;\n } else {\n options[key] = object.value;\n }\n } else {\n options[key] = object.value;\n }\n }\n });\n\n return options;\n }", "function obtemPacienteFormulario(form) {\n var paciente = {\n nome: form.nome.value,\n peso: form.peso.value,\n altura: form.altura.value,\n gordura: form.gordura.value,\n imc: calcularImc(form.peso.value, form.altura.value)\n }\n return paciente;\n}", "function setFilterFormFields() {\n\t\tvar arr_fields = [];\n\t\t\n\t\t//journey title\n\t\tvar objField = {\n\t\t\t\tkey: 'journeys_journey',\n\t\t\t\ttype: 'input',\n\t\t\t\ttemplateOptions: {\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tlabel: 'Journey Name / ID',\n\t\t\t\t\ttitle: 'Filter by Journey name or Journey id',\n\t\t\t\t\tplaceholder: 'e.g Journey X or 210',\n\t\t\t\t}\n\t\t\t};\n\t\tarr_fields.push(objField);\n\t\t\n\t\t//journey status\n\t\tvar objField = {\n\t\t\t\tkey: 'journeys_status',\n\t\t\t\ttype: 'radio',\n\t\t\t\ttemplateOptions: {\n\t\t\t\t\ttype: 'radio',\n\t\t\t\t\tlabel: 'Journey Status',\n\t\t\t\t\ttitle: 'Filter by Journey Status',\n\t\t\t\t\tvalueProp: 'optionID',\n\t\t\t\t\tlabelProp: 'optionLabel',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t {'optionID': 1, 'optionLabel': 'Active' },\n\t\t\t\t\t\t {'optionID': 0, 'optionLabel': 'Inactive' },\n\t\t\t\t\t ]\n\t\t\t\t}\n\t\t\t};\n\t\tarr_fields.push(objField);\n\t\t\n\t\treturn arr_fields;\n\t}", "getFields() {\n const {getFieldDecorator} = this.props.form;\n const formItemLayout = {\n labelCol: {span: 8},\n wrapperCol: {span: 16}\n };\n let children = [];\n for (let i = 0; i < titleList.length; i++) {\n children.push(\n <Col span={8} key={i} style={{padding: \"0 10px\"}}>\n <FormItem {...formItemLayout} label={titleList[i].name}>\n {getFieldDecorator(titleList[i].value)(\n titleList[i].name == \"体验中心\" ? <Select\n placeholder=\"全部体验中心\"\n size=\"large\"\n >\n <Option value=\"\">全部体验中心</Option>\n {\n this.props.HubList.map((item, index) => {\n return (\n <Option key={index} value={item.HubID + \"\"}>{item.HubName}</Option>\n );\n })\n }\n </Select> : titleList[i].name == \"APP接单权限\" ? <RadioGroup>\n <Radio value={2}>停用</Radio>\n <Radio value={1}>开启</Radio>\n </RadioGroup> :\n\n <Input style={{height: 30}}/>\n )}\n </FormItem>\n </Col>\n );\n }\n return (\n <Row>{children}\n <Col span={8} style={{textAlign: 'right', paddingRight: \"10px\"}}>\n <Button onClick={this.handleReset}>\n 重置\n </Button>\n <Button style={{marginLeft: 8}} type=\"primary\" htmlType=\"submit\">搜索</Button>\n </Col>\n </Row>\n\n );\n }", "function inicializareditar(datos) {\n \n tipo1informacionpersonaleditar.value = datos[0]['tipo'];\n document.getElementById('idip').value = datos[0]['id'];\n\n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\t\n\tjsCobUsuarEtapaCobraDetalId = get('cobUsuarEtapaCobraDetalFrm.id').toString();\n\tjsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr = get('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr')[0];\n\tjsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg = get('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg')[0];\n\tjsCobUsuarEtapaCobraDetalZsgvOidSubgVent = get('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent')[0];\n\tjsCobUsuarEtapaCobraDetalZorgOidRegi = get('cobUsuarEtapaCobraDetalFrm.zorgOidRegi')[0];\n\tjsCobUsuarEtapaCobraDetalZzonOidZona = get('cobUsuarEtapaCobraDetalFrm.zzonOidZona')[0];\n\tjsCobUsuarEtapaCobraDetalZsccOidSecc = get('cobUsuarEtapaCobraDetalFrm.zsccOidSecc')[0];\n\tjsCobUsuarEtapaCobraDetalTerrOidTerr = get('cobUsuarEtapaCobraDetalFrm.terrOidTerr')[0];\n\tjsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr = get('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr')[0];\n\tjsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr = get('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr')[0];\n\tjsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe = get('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe')[0];\n\tjsCobUsuarEtapaCobraDetalValObse = get('cobUsuarEtapaCobraDetalFrm.valObse').toString();\n\t\n}", "getTransformedData() {\n const form = this.getData();\n\n return Object.keys(form)\n .map((id) => [id, this.getTransformedValue(id)])\n .reduce((acc, [id, value]) => {\n acc[id] = value;\n return acc;\n }, {});\n }", "function limparMBCL(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\tswitch(tipo){\r\n\t\tcase 1:\r\n\t\t\tform.idMunicipio.value = \"\";\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\tcase 2:\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\tcase 3:\r\n\t\t\tform.idLogradouro.value = \"\";\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\tcase 4:\r\n\t\t\tform.CEP.value = \"\";\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\r\n\t}\r\n}", "function getUserInput(form) {\n var data = [];\n const formData = new FormData(form);\n formData.forEach((item, i) => {\n data.push(Number(item));\n });\n tab_values[current_tab] = data;\n renderTable(createTableData(data));\n}", "function populateForm2Js(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cccSubprFrm.accion'), \n\t\tget('cccSubprFrm.origen'));\n\t\n\tjsCccSubprId = get('cccSubprFrm.id').toString();\n\tjsCccSubprCcprOidProc = get('cccSubprFrm.ccprOidProc')[0];\n\tjsCccSubprCodSubp = get('cccSubprFrm.codSubp').toString();\n\tjsCccSubprDesSubp = get('cccSubprFrm.desSubp').toString();\n\tif(get('cccSubprFrm.valIndiGestMarc').toString() == 'S') jsCccSubprValIndiGestMarc = \"true\";\n\t\telse jsCccSubprValIndiGestMarc = \"false\";\n\tif(get('cccSubprFrm.valIndiActuCuot').toString() == 'S') jsCccSubprValIndiActuCuot = \"true\";\n\t\telse jsCccSubprValIndiActuCuot = \"false\";\n\tif(get('cccSubprFrm.valIndiTipoAbon').toString() == 'S') jsCccSubprValIndiTipoAbon = \"true\";\n\t\telse jsCccSubprValIndiTipoAbon = \"false\";\n\tjsCccSubprValIndiCons = get('cccSubprFrm.valIndiCons');\n\tjsCccSubprValObse = get('cccSubprFrm.valObse').toString();\n\t\n}", "function tiendaGetFormInputData(form) {\r\n\tvar str = new Array();\r\n\tfor ( i = 0; i < form.elements.length; i++) {\r\n\t\tpostvar = {\r\n\t\t\tname : form.elements[i].name,\r\n\t\t\tvalue : form.elements[i].value,\r\n\t\t\tchecked : form.elements[i].checked,\r\n\t\t\tid : form.elements[i].id\r\n\t\t};\r\n\t\tstr[i] = postvar;\r\n\t}\r\n\treturn str;\r\n}", "function agregaformEve(datos){\n //console.log(\"datos: \"+datos);\n d=datos.split('||');\n \n //document.getElementById(\"codigo_af_aceptar1\").value=d[0];\n $('#idEveE').val(d[0]);\n $('#nombreEveE').val(d[1]);\n $('#personalEveE').val(d[2]);\n}", "function getFormValues(){\r\n\tvar values=\"\",eType,element;\r\n\tvar elements=hatsForm.elements;\r\n\tfor (var i=0,iL=elements.length; i<iL; ++i){\r\n\t\tvar elementVal = \"\";\r\n\t\telement=elements[i];\r\n\t\teType=element.type;\r\n\t\tvar computeValue = true;\r\n\t\tif ((eType == \"radio\") ||(eType == \"checkbox\"))\r\n\t\t\tcomputeValue = element.checked;\r\n\t\tif(computeValue){\r\n\t\t\tif (appletInitialized && document.HATSApplet){\r\n\t\t\t\telementVal = document.HATSApplet.encode(element.value,document.charset);\r\n\t\t\t}else if(window.encodeURIComponent){\r\n\t\t\t\telementVal = encodeURIComponent(element.value);\r\n\t\t\t}else if (window.escape){\r\n\t\t\t\telementVal = escape(element.value);\r\n\t\t\t}\r\n\t\t\tvalues += \"&\" + element.name + \"=\" + elementVal;\r\n\t\t}\r\n\t}\r\n\treturn values;\r\n}" ]
[ "0.7252782", "0.70764536", "0.7057447", "0.6885303", "0.6845335", "0.6715986", "0.6630791", "0.660821", "0.65957856", "0.65893555", "0.65828675", "0.6549645", "0.6528558", "0.65275306", "0.6444972", "0.6441563", "0.6396685", "0.6365112", "0.63479525", "0.6329102", "0.6323801", "0.6319098", "0.6302289", "0.6229637", "0.62285864", "0.6218752", "0.62141293", "0.61971384", "0.61876297", "0.6164779", "0.6164701", "0.6161706", "0.6160253", "0.61593145", "0.6154024", "0.6149943", "0.6143075", "0.61345005", "0.61315435", "0.6129181", "0.6125259", "0.6121743", "0.6115525", "0.6110366", "0.60985446", "0.6080367", "0.6074464", "0.6063873", "0.60635245", "0.6061754", "0.60616034", "0.6060486", "0.60474867", "0.60445964", "0.6042984", "0.6042828", "0.6040454", "0.6015136", "0.5992784", "0.5982998", "0.59811807", "0.59761256", "0.59738696", "0.59738696", "0.5971131", "0.59609413", "0.5952769", "0.59511894", "0.5949291", "0.59486294", "0.5945799", "0.5943371", "0.59412354", "0.5935948", "0.59291846", "0.59280777", "0.5927951", "0.5926676", "0.5921457", "0.5908829", "0.58992386", "0.5890494", "0.58807975", "0.587947", "0.58619636", "0.58450717", "0.58407736", "0.5836438", "0.58351296", "0.5833751", "0.58259904", "0.58258927", "0.58229375", "0.5814771", "0.5813929", "0.5813064", "0.5811158", "0.5809643", "0.5806314", "0.5801542", "0.57992905" ]
0.0
-1
If import is successful, trigger "completed" and reload the page after 800ms.
onSuccess() { Radio.trigger('components/importExport', 'completed'); window.setTimeout(() => document.location.reload(), 800); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadDone() {\n return true;\n }", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "loadComplete() {\n // Nothing\n }", "function uploadedHandler() {\n window.location.reload();\n }", "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "function onLoadSuccess( data ) {\n\t\t$( '#msg-box' )\n\t\t\t.hide()\n\t\t\t.html( \"Loaded: \" + _fileUrl )\n\t\t\t.delay( 100 )\n\t\t\t.fadeIn();\n\n\t\tparseCSV( data );\n\t}", "handleStartImport() {\n startImport({\n recordId: this.recordId\n })\n .then((results) => {\n this.displayStartingMessage = true;\n this.importComplete = false;\n this.displayErrorMessage = false;\n this.isLoaded = true;\n this.errors = undefined;\n this.handleSubscribe();\n })\n .catch((error) => {\n console.error('error handlestartImport > ' + JSON.stringify(error));\n this.errors = JSON.stringify(error);\n });\n }", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "goodFile() {\n $('.pcm_importStatus').html('Data from file ready to be imported.').css('color','#dbfd23');\n $('.pcm_importButton').removeClass('disabled').prop(\"disabled\",false);\n }", "function loadComplete() {\n if ($('#abAutoRefresh:checked').length) {\n window.clearTimeout(refreshTimer);\n refreshTimer = window.setTimeout(loadData, config.interval * 1000);\n }\n // Update last update status\n $('#ab_update img').hide();\n $('#abLastUpdate').text((new Date()).toLocaleTimeString());\n }", "startImport(event){\n this.isLoaded = false;\n this.disableImport = true;\n this.handleStartImport();\n }", "function fileUploadDone() {\n signale.complete('File upload done');\n}", "function OnComplete(result) {\n age.UnLock();\n var errCode = result.errCode;\n if (errCode == 0) {\n ageMsg.Hide();\n age.DelayReloadPage();\n } else {\n ageMsg.Show(result.errMsg);\n }\n }", "function uponRequestCompletion(json){\r\n\t// Remove the loader from the html page\r\n\tshowLoader(false);\r\n\t\r\n\t// Call the renderTable function with pretty JSON as argument\r\n\trenderTable(json);\r\n\r\n\t// Enable the button which allows the user to start the CSV file flow\r\n\tenableOrDisableBtn(\"downloadCSVBtn\", true);\r\n}", "function startCSV(){\n validate().then(function () {\n countFileLines(extract).then(function (count) {\n totalLines = count;\n startImport();\n }).catch(function (err) {\n process.send(['import-failed', 'read']);// mainWindow.webContents.send('import-failed', 'read');\n console.log(err);\n });\n }).catch(function (err) {\n switch (err) {\n case 0:\n process.send(['import-failed', 'invalid']);// mainWindow.webContents.send('import-failed', 'invalid');\n break;\n default:\n process.send(['import-failed', 'read']);// mainWindow.webContents.send('import-failed', 'read');\n break;\n }\n });\n}", "showCompletedState()\n {\n \tlet self = this;\n \tlet f = new File( 'Progdir:Assets/completed.html' );\n \tself.completed = true;\n \tself.canvasContent.classList.add( 'Loading' );\n \tf.onLoad = function( data )\n \t{\n \t\tself.canvasContent.innerHTML = data;\n \t\tsetTimeout( function(){\n \t\t\tself.canvasContent.classList.remove( 'Loading' );\n \t\t}, 250 );\n \t\tApplication.sendMessage( { command: 'refreshcourses' } );\n \t}\n \tf.load();\n }", "function uploadCompleteHandler() {\n console.log(\"Upload finished.\");\n getAllFiles();\n /*\n Do what you like here.\n */\n}", "function loadComplete() {\n\thasLoaded = true;\n}", "function renderUpdateComplete() {\n exportData.renderUpdateRunning = false;\n $loadingBar.css('opacity', 0);\n }", "function loadComplete() {\n cnt--;\n if (!cnt) {\n execComplete();\n }\n }", "complete() {\n this.trigger('load_complete');\n }", "function exportdone(resp) {\n consolelog('export done');\n if(resp.error === false) \n timedDlg('Label Export', `Success, wrote <strong>${resp.msg.len}</strong> bytes to <strong>${resp.msg.file}</strong>`, 5000);\n else errorDlg('Label Export', `ERROR - ${resp.msg}`);\n}", "function filesdone(resp) {\n consolelog('label files done');\n if(resp.error === false) {\n fillImport(resp);\n $('#labelImportModal').modal('show');\n } else errorDlg('Label Files', `ERROR - ${resp.msg}`);\n}", "function refreshBulkImport() {\n $.ajaxSetup({\n async: false\n });\n getBulkImports();\n $.ajaxSetup({\n async: true\n });\n refreshBulkImportTable();\n refreshServerBulkTable();\n}", "function _complete() {\n\t if (!_iscomplete) {\n\t _iscomplete = true;\n\t _status = scriptloader.loaderstatus.COMPLETE;\n\t _this.trigger(events.COMPLETE);\n\t }\n\t }", "function onSuccess() {\n\t\t\t\tvent.trigger(\"display:message\",\"Links succesfully imported.\");\n\t\t\t\t//TODO: use current search string to fetch collection again\n\t\t\t\tself.collection.fetch();\n\t\t\t}", "complete( results, file ){\n //call parseUpload and pass the results.data to it (the array of json objects)\n Meteor.call( 'parseUpload', results.data, ( error, response ) => {\n if (error){\n Bert.alert(error.reason, 'warning');\n //console.log(error.reason);\n }else{\n template.uploading.set( false );\n\t Bert.alert('Upload Complete', 'success', 'growl-top-right');\n }\n });\n }", "async function successStory(message){\n alert(message);\n await reloadPage();\n $submitForm.hide();\n $submitForm[0].reset();\n // show the stories\n $allStoriesList.show();\n }", "handleFileUploadFinished() {\n this.isWorking = false\n }", "function emblContentHubAwaitLoading(targetLink, position) {\n /* global addImport */\n // Docs: https://github.com/AshleyScirra/html-imports-polyfill#usage\n addImport(targetLink.href, null, emblContentHubLinkLoadingProgress).then(function (value) {\n emblContentHubGrabTheContent(targetLink, position, value);\n if (position + 1 == emblContentHubLinks.length) {\n emblContentHubSignalFinished();\n }\n });\n }", "function loading_done() {\n console.log(\"RiveScript has finished loading file\");\n\n // rivescript replies must be sorted!\n riveScriptBot.sortReplies()\n}", "function onLoadComplete()\n {\n this.loaded = true;\n }", "function loader() {\n loaded += 1;\n if(loaded === toLoad) {\n spinner.stop();\n process.stdout.write('\\r ' + url);\n console.log('');\n }\n }", "function complete() {\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= 1) {\n\t\t\t\t//console.log(context);\n\t\t\t\tres.render('UpdateCoach', context);\n\t\t\t}\n\t\t}", "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function _complete() {\n\t\t\tif (_errorState) {\n\t\t\t\t_eventDispatcher.sendEvent(events.ERROR, {message: _errorMessage});\n\t\t\t} else if (!_iscomplete) {\n\t\t\t\t_iscomplete = true;\n\t\t\t\t_status = utils.loaderstatus.COMPLETE;\n\t\t\t\t_eventDispatcher.sendEvent(events.COMPLETE);\n\t\t\t}\n\t\t}", "function refresh() {\n refreshBulkImport();\n}", "function proceed() {\n if (scriptsAsync.length) {\n // Load asynchronous scripts\n head.js.apply(null, scriptsAsync);\n }\n\n start();\n }", "_dataImportHandler() {\n this.refresh();\n }", "function upload_result(result_fn) {\n $.get('https://98.182.226.187:3000/upload_result', { fn: result_fn },\n function (data) {\n if (data['err']) {\n alert('Could not upload result: ' + data['err_msg']);\n return;\n }\n\n setTimeout(() => {\n if (is_uploaded(result_fn)) {\n populate_upload_result_link(result_fn);\n } else {\n alert('Failed to upload result: TimeOut! Please wait a couple minutes and refresh page.');\n }\n }, 7500);\n }, 'json');\n}", "function loadSuccess(data) {\n amplify.publish(events.LoadSuccess, data);\n }", "function massiveImport(){\n $(document).ready(function(){\n $(\"#send_import\").click(function(){\n $('body').loadingModal({\n position: 'auto',\n text: 'Importando ...',\n color: '#fff',\n opacity: '0.7',\n backgroundColor: 'rgb(0,0,0)',\n animation: 'foldingCube'\n });\n \n var formData = new FormData();\n var input = document.getElementById('import_file');\n var file = input.files[0];\n formData.append('file', file);\n $.ajax({\n url: '/reg/create_massive',\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n success: function(data){\n $('body').loadingModal('destroy');\n swal({\n title: '¡Importación completada con éxito!',\n type: 'success',\n confirmButtonColor: '#4fa7f3'\n }).then(function(){\n document.location.reload(true);\n })\n }\n });\n \n });\n }); \n}", "checkLoadCompletion() {\n if (this.loading && this.commentCount >= this.expectedComments) {\n if (process.env.NODE_ENV !== 'production') {\n console.info(\n 'Initial load of ' +\n this.commentCount + ' comment' + pluralise(this.commentCount) +\n ' for ' + this.itemId + ' took ' +\n ((Date.now() - this.startedLoading) / 1000).toFixed(2) + 's'\n )\n }\n\n this.loading = false\n if (this.isFirstVisit) {\n this.firstLoadComplete()\n } else if (SettingsStore.autoCollapse && this.newCommentCount > 0) {\n this.collapseThreadsWithoutNewComments()\n }\n this._storeState()\n }\n }", "function handle_job_done(status_fn) {\n const result_fn = status_fn.replace('_log.log', '_output.mp3');\n $(\"#upload_result_button\").show();\n\n if (is_uploaded(result_fn)) {\n populate_upload_result_link(result_fn);\n } else {\n $(\"#upload_result_button\").click(function () {\n upload_result(result_fn);\n });\n $(\"#upload_result_button\").prop(\"disabled\", false);\n }\n}", "function savedfilesreloading() {\nwindow.setTimeout(\"savedfilesreloading()\",15000);\n\tnew Ajax.Updater(\"userfiles\",'http://bioinf3.bioc.le.ac.uk/~ss533/cgi-bin/loaduserfiles.cgi',{\n\tparameters:{}});\n}", "function processImport(nodeName) {\n // an import (bkmark, org, tabsOutliner) has happened => save and refresh\n\n RefreshCB = function() {animateNewImport(nodeName);};\n saveBT();\n refreshTable();\n}", "importSucceeded(data) {\n this.socket.emit('importSucceeded', data);\n }", "function complete() {\n alert('The SharePoint script has finished running.');\n}", "function refreshBulkImportTable() {\n\n clearTable('masterBulkImportStatus');\n\n /*\n * Get the bulk import value obtained earlier, if it doesn't exists,\n * create an empty array\n */\n var data = sessionStorage.bulkImports === undefined ?\n [] : JSON.parse(sessionStorage.bulkImports);\n var items = [];\n\n /* If the data is empty, create an empty row, otherwise,\n * create the rows for the table\n */\n if (data.length === 0 || data.bulkImport.length === 0) {\n items.push(createEmptyRow(3, 'Empty'));\n } else {\n $.each(data.bulkImport, function(key, val) {\n items.push(createFirstCell(val.filename, val.filename));\n items.push(createRightCell(val.age, val.age));\n items.push(createRightCell(val.state, val.state));\n });\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#masterBulkImportStatus');\n}", "function done()\n{\n\tvar success_rate = team_points/total_possible_points;\n\tdocument.getElementById(\"countdown\").innerHTML = \"You are done! You will find out your team score at the end of the experiment.\";\n\t// save and report points to spreadsheet\n\tcordovaHTTP.get(url + '?initials=&condition=ASYNC&timeline=ASYNC' +\n\t\t'&trial_count=ASYNC&atime=ASYNC&ptime=ASYNC&diff=ASYNC&poff=ASYNC' +\n\t\t'&acondition=Asynchrony&sscore=&ascore=' + team_points + '&poss_points=' +\n\t\ttotal_possible_points + '&success=' + success_rate, {}, {}, function(response) {});\n\t\n\tclearButton(\"P\"); // clear buttons from screen (aesthetic choice)\n\tclearButton(\"E\");\n}", "function start() {\n $.getJSON(starturl, function(data, textStatus){\n\t if (data.status != \"succeeded\") {\n\t alert(\"failed to start task!\\n\" + data['reason-of-failure']);\n\t return;\n\t }\n\t // create progress bar\n\t pbar.progressbar({value:0});\n\t \n\t // repeat refresh\n\t interval = window.setInterval(refresh, 200);\n\t});\n }", "function updateMapping() {\n alert(\"This operation could take a while.\");\n doTask(\"UPDATE_MAPPING\", null, function (data) {\n alert(\"Mapping was been updated;\");\n window.reload();\n });\n}", "function importForm() {\n\t\tvar $processSettings = jQuery( '#frm-importer-process' ),\n\t\t\tformID = s.importQueue[0],\n\t\t\tprovider = jQuery( 'input[name=\"slug\"]' ).val(),\n\t\t\tdata = {\n\t\t\t\taction: 'frm_import_' + provider,\n\t\t\t\tform_id: formID,\n\t\t\t\tnonce: frmGlobal.nonce\n\t\t\t};\n\n\t\t// Trigger AJAX import for this form.\n\t\tjQuery.post( ajaxurl, data, function( res ) {\n\n\t\t\tif ( res.success ) {\n\t\t\t\tvar statusUpdate;\n\n\t\t\t\tif ( res.data.error ) {\n\t\t\t\t\tstatusUpdate = '<p>' + res.data.name + ': ' + res.data.msg + '</p>';\n\t\t\t\t} else {\n\t\t\t\t\tstatusUpdate = '<p>Imported <a href=\"' + res.data.link + '\" target=\"_blank\">' + res.data.name + '</a></p>';\n\t\t\t\t}\n\n\t\t\t\t$processSettings.find( '.status' ).prepend( statusUpdate );\n\t\t\t\t$processSettings.find( '.status' ).show();\n\n\t\t\t\t// Remove this form ID from the queue.\n\t\t\t\ts.importQueue = jQuery.grep( s.importQueue, function( value ) {\n\t\t\t\t\treturn value != formID;\n\t\t\t\t} );\n\t\t\t\ts.imported++;\n\n\t\t\t\tif ( s.importQueue.length === 0 ) {\n\t\t\t\t\t$processSettings.find( '.process-count' ).hide();\n\t\t\t\t\t$processSettings.find( '.forms-completed' ).text( s.imported );\n\t\t\t\t\t$processSettings.find( '.process-completed' ).show();\n\t\t\t\t} else {\n\t\t\t\t\t// Import next form in the queue.\n\t\t\t\t\t$processSettings.find( '.form-current' ).text( s.imported + 1 );\n\t\t\t\t\timportForm();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}", "function nzqaImport(){\n // Send an ajax request to the server to import exams\n AJAX(\"includes/processors/nzqaImport.php\", null, function(data){\n $(\"#modal-data\").innerHTML = \"<section><h2>Success!</h2><p>All NCEA exams for the current year have been imported.</p><button id='done-button' class='button green'>Done</button></section>\";\n loadExams(0, null, function(){adminPopulateHook()});\n $(\"#done-button\").addEventListener(\"click\", closeModal);\n });\n}", "function onFinish() {\n console.log('finished playing');\n window.location = 'http://www.theplanaproj.com/';\n }", "function finishSourceProcessing() {\n if (sourceStatus == unknownURL) {\n setStatus(unknownURL);\n } else {\n setStatus(loading + \" \" + sourceStatus);\n }\n sourceStatus = 0;\n loadSrc.innerHTML = \"\";\n}", "completed(data) {}", "function startUploading()\n{\n try{\n lastRead=0;\n uploadDone=0;\n \n\tdocument.getElementById('cancelupload').style.display ='';\n document.getElementById('uploaderror').style.display ='none';\n document.getElementById('uploadwindow').style.display ='none';\n document.getElementById('emailwindow').style.display ='none';\n document.getElementById('uploadoverview').style.display='none';\n document.getElementById('uploadresults').style.display ='none';\n \n document.getElementById('progressbar').style.display ='';\n document.getElementById('progressbar2').style.display ='';\n document.getElementById('helpwindow').style.display ='';\n \n stopupload = false;\n }catch (e) {\n alert('startUploading:'+e)\n }\n}", "function success() {\n finish( false );\n }", "function fileDownloadDone(filePath) {\n signale.complete('File download done, file saved to: ' + filePath);\n}", "function afterSuccess(){\n $('#submit-btn').show(); //hide submit button\n $('#loading-img').hide(); //hide submit button\n $('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar\n //var filename = $(\"#output\").html();\n // parseFile(filename);\n}", "function onComplete() {\n if (typeof successCb === \"function\") successCb(redirPath);\n }", "function onProgress( xhr ) {\n if ( xhr.lengthComputable ) {\n const percentComplete = xhr.loaded / xhr.total * 100;\n if (percentComplete > 99) {\n $('#placeholder')[0].innerText = 'Finishing up...'\n } else if (percentComplete > 50) {\n $('#placeholder')[0].innerText = 'Almost there...'\n }\n }\n\n }", "function onFinish() {\n // There is the possibility that we are calling this more than once\n if (!_self.loading)\n return;\n\n _self.loading = false;\n\n // Re-select the last selected item\n if(_self.treeSelection.path) {\n var xmlNode = trFiles.$model.queryNode('//node()[@path=' +\n util.escapeXpathString(_self.treeSelection.path) + ' and @type=\"' +\n _self.treeSelection.type + '\"]');\n if (xmlNode)\n trFiles.select(xmlNode);\n }\n else {\n trFiles.select(trFiles.getFirstTraverseNode());\n }\n\n // Scroll to last set scroll pos\n if (_self.scrollPos && _self.scrollPos > -1) {\n if (animateScrollOnFinish) {\n apf.tween.single(trFiles, {\n type: \"scrollTop\",\n from: 0,\n to: _self.scrollPos\n });\n }\n else {\n trFiles.$ext.scrollTop = _self.scrollPos;\n }\n }\n\n // Now set the \"get\" attribute of the <a:insert> rule so the tree\n // knows to ask webdav for expanded folders' contents automatically\n self[\"trFilesInsertRule\"] && trFilesInsertRule.setAttribute(\"get\", \"{davProject.readdir([@path])}\");\n\n settings.save();\n }", "function onUploadComplete(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传完毕\";\r\n\t\t}", "function uploadFile(){\n localUpload();\n publicUpload();\n alert(\"File uploaded.\\nWaiting to get analyze result.\");\n window.location.href = \"index.php?upload&filename=\" + fileName;\n }", "function uploadResults() {\n // Check if any data exists\n if(localStorage.length === 0) {alert('No cached data to upload')}\n // Ensure user is connected before uploading\n let online = window.navigator.onLine;\n if(!online) {alert('No connection detected, upload aborted')}\n else {enterResults()}\n}", "function projectProgressChanged(data) {\n s.completionContainer.html(data.partial);\n }", "function onFinished(notAborted, arr) {\n Machine.find(function(err, instances){\n console.log(\"Done with importing!\");\n });\n }", "function onUploadFinished(e) {\n\ttotFileUploaded += document.getElementById('files').files[uploadedFiles].size;\n\tuploadedFiles++;\n\tdebug('complete ' + uploadedFiles + \" of \" + totFileCount);\n\tdebug('totalFileUploaded: ' + totFileUploaded);\n\tif (uploadedFiles < totFileCount) {\n\t\tuploadNextFile();\n\t} else {\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = '100%';\n\t\tbar.innerHTML = '100 % completed';\n\t\tbootbox.alert('File uploading Finished');\n\t}\n\n}", "function afterSuccess()\n{\n\n\t$(\"#batchprocess\").toggleClass(\"disabled\");\t\n\t$('#submit-btn').show(); //hide submit button\n\t$('#loading-img').hide(); //hide submit button\n\t$('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar\n\t$.get(\"utils/embx_ajax.php?pf=logfilelist\",function(data){\n\t\t$('#information').html('');\n\t\t$('#pagecontent').html(data);\n\t\t\t//$('#pageheader').html(\"Log Files\");\n\t});\n\t\n}", "onPageLoaded() {\n window.clearTimeout(this.animationTimeout_);\n window.clearTimeout(this.loadingTimeout_);\n this.setUIStep(AssistantLoadingUIState.LOADED);\n }", "function run() {\r\n\r\n var spFormsrunInterval = setInterval(function () {\r\n if (onBuildComplete) {\r\n clearInterval(spFormsrunInterval);\r\n\r\n if(urlParam(formIdNoHash)){\r\n var recordId = urlParam(formIdNoHash);\r\n getItemById(recordId).done(function(item){\r\n if (item.d.results.length > 0){\r\n oldItem = item.d.results[0];\r\n showFieldValues(item.d.results);\r\n } else {\r\n showError(\"No record has been found\");\r\n }\r\n }).fail(function(err){ \r\n showError(parseAjaxError(err));\r\n });\r\n \r\n //return false; //exit out if record is found \r\n }\r\n\r\n var btn = $form.find('[data-type=\"Submit\"]');\r\n btn.on('click', function () {\r\n if (validateFields()) {\r\n //showLoading();\r\n getListType(listName).done(function (data1) {\r\n var listType = data1.d.ListItemEntityTypeFullName;\r\n var ajax = saveData(oldItem, listType, listName);\r\n ajax.done(function (success) {\r\n /*if($(selectorString + ' [name=\"attachment\"]').length > 0){\r\n if($(selectorString + ' [name=\"attachment\"]')[0].files[0] \r\n && success.d.ID){ //IF THERE IS A FILE && HAS ID\r\n var file = $(selectorString + ' [name=\"attachment\"]')[0].files[0];\r\n var ajaxFromFileUPload = uploadFile(file,listName,success.d.ID) \r\n ajaxFromFileUPload.done(function(){ \r\n updateUrl(success.d.ID); \r\n showSuccess();\r\n })\r\n ajaxFromFileUPload.fail(function(err){\r\n showError(parseAjaxError(err));\r\n })\r\n return;\r\n }\r\n } */\r\n setTimeout(function () {\r\n var ID = oldItem ? oldItem.ID : success.d.ID;\r\n redirect(ID);\r\n //showSuccess();\r\n }, 1000);\r\n });\r\n ajax.fail(function (err) {\r\n showError(parseAjaxError(err));\r\n });\r\n }); //end getListType();\r\n }\r\n return false;\r\n }); //end submit form\r\n }\r\n }, 200)\r\n\r\n }", "clickDone(){\n const self = this;\n let sections = this.get('sectionsProxy').filterBy('selected', true).map(o => o.data);\n this.get('documents').importSections(this.get('targetDocument'), sections, this.isLink()).then(() => {\n // this.sendAction('afterImport');\n // this.transitionTo('app.documents.editor', this.get('docid'));\n this.get('router').transitionTo('app.documents.editor', this.get('docid'));\n });\n }", "function _finishLoading() {\n loadsToFinish--;\n if (loadsToFinish <= 0) {\n loading = false;\n viewModel.set(\"loading\", loading);\n }\n}", "function uploadComplete(data){\n\n // check for errors in the RTE submit\n if ($j('#jiveBridgeComposeMessageForm', data).length > 0) {\n\n // found an error, kill the existing RTE instance\n var editor = window.editor.get('wysiwygbridge');\n if (typeof(editor) != \"undefined\") {\n editor.killYourself();\n }\n\n // insert the html back into the dom\n $j('#bridge-compose-message').html(data);\n\n // make sure the help bar is reset\n $j('.jive-bridge-help').hide();\n $j('.jive-help-show').show();\n $j('.jive-help-hide').hide();\n\n // begin slew of RTE goodness\n jive.rte.multiRTE.push(\"wysiwygbridge\");\n if(typeof(window.editor) == \"undefined\") {\n window.editor = new jive.ext.y.HashTable();\n }\n buildBridgeRTE();\n }\n else if (data.indexOf('jive-body-intro') != -1) {\n var msg = \"Unexpected form token validation, please close this page and try again\";\n $j('<p />').html(msg).message({ style: 'error' });\n }\n else {\n // we are good,display the progress bar\n $j('#bridge-upload').html(data);\n // delay for 3 seconds for good measure\n setTimeout(function(){\n $j('#done').show('fast');\n $j('#spaceused1_percentText').hide();\n $j('#upload-status').show('fast');\n $j('#progress').removeClass(\"jive-upload-status\");\n $j('#progress').addClass(\"jive-upload-status-done\");\n $j('#viewmsg').prop('disabled', false);\n $j('#viewmsg2').prop('disabled', false);\n $j('#cancel').hide();\n }, 3000);\n }\n }", "reportProgress() {\n\t\tif (this._reportProgressHandler) {\n\t\t\tclearTimeout(this._reportProgressHandler);\n\t\t\tthis._reportProgressHandler = false;\n\t\t}\n\t\tImporterWebsocket.progressUpdated(this.progress);\n\t}", "function wait_to_upload() {\n if (sisbot.get('data.state') != 'playing') {\n // remove from tracks_to_upload, take to next preview page or this model's page\n tracks_to_upload.shift();\n\n if (tracks_to_upload.length > 0) {\n app.trigger('session:active', {\n primary: 'settings',\n secondary: 'preview-upload',\n track_id: tracks_to_upload[0].id\n });\n } else {\n app.trigger('session:active', {\n primary: 'media',\n secondary: 'tracks',\n track_id: track_model.id\n });\n\n // listen for track added finish before showing modal\n self.listenToOnce(app, 'track:added', function(data) {\n app.log(\"Track added listener heard\", data);\n\n if (data.id == track_model.id) {\n app.trigger('modal:open', {\n track_id: track_model.id,\n 'template': 'modal-track-hero-tmp'\n });\n }\n });\n }\n\n // save after, so preview image is made first\n track_model.upload_track_to_sisbot();\n\n // if (track_model.get('data.publish_track') == 'true') track_model.upload_track_to_cloud();\n } else {\n app.log(\"Wait longer for pause to finish\");\n setTimeout(function() {\n wait_to_upload();\n }, 4000); // delay to be sure the table paused\n }\n }", "async onFinished() {}", "function complete(){\r\n console.log(context.pokemon);\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('update-discord', context);\r\n }\r\n\r\n }", "SaveAndReimport() {}", "function success() {\n\n // mark resource as already loaded\n if ( !resources[ url ] ) resources[ url ] = url;\n\n // is resource on waitlist? => perform waiting actions\n while ( waiter[ url ] && waiter[ url ].length > 0 )\n ccm.helper.action( waiter[ url ].pop() );\n\n // check if all resources are loaded\n check();\n\n }", "async function handleModuleComplete(e) {\n if (\n confirm(\n 'Please make sure your last video has uploaded. If you are sure that you have completed your level, press OK. If not, press cancel and continue to upload videos.',\n )\n ) {\n setModuleVideos(moduleVideos.module.videos.unshift(levelAdded));\n e.preventDefault();\n db.collection('modules')\n .doc(module.value)\n .update({\n 'module.videos': moduleVideos.module.videos,\n })\n .then(() => console.log('Doc written successfully!'));\n clearVideoInfo();\n history.push('/success');\n }\n }", "function delayedReload(){\n\tsetTimeout(function(){\n\t\tlocation.reload();\n\t}, 2000);\n}", "function continueLoad(){\n\td3.selectAll(\".loadHide\").classed(\"loadHide\", false)\n\td3.select(\"#loadingGif\")\n\t\t.transition()\n\t\t.style(\"display\", \"none\")\n\t\t.on(\"end\", function(){\n\t\t\tsetActiveDistrict(MILWAUKEE_ID, DEFAULT_LEVEL, TAMARACK_ID, \"load\")\t\t\n\t\t\tsetActiveSchool()\n\t\t})\n}", "function done() {\n\t$destination.innerHTML = store + fileName;\n\t$status.innerHTML = \"Done\";\n}", "function success(data) {\n\tupdateProgressById(\"uploadProgress\", 75)\n\tdisplayBasicStats(data);\n}", "function succeed (dump) {\n\t\t$('.success').addClass('on');\n\t\tsetTimeout(function(){\n\t\t\t$('.success').removeClass('on');\n\t\t}, 200);\n\t}", "importDB() {\r\n document.getElementById('file-upload-import').click();\r\n }", "function loadPage( targetUrl ) {\n\tvar persistenceOn = jQuery( 'body.loadsaved' ).length;\n\tif ( jQuery( 'body' ).hasClass( 'ajax-on' ) ) {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tjQuery( document ).unbind();\n\t\tjQuery( '#outer-ajax' ).load( targetUrl + ' #inner-ajax', function( allDone ) {\n\t\t\tjQuery( '#progress' ).addClass( 'done' );\n\t\t\tif ( persistenceOn ) {\n\t\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t\t} else {\n\t\t\t \tWPtouchEraseCookie( 'wptouch-load-last-url' );\t\n\t\t\t}\n\t\t\tdoClassicReady();\n\t\t\tscrollTo( 0, 0, 100 );\n\t\t});\n\t} else {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tif ( persistenceOn ) {\n\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t}\n\t\tsetTimeout( function () { window.location = targetUrl; }, 550 );\n\t}\n}", "function onload(){\r\n // Task 4: Detect when the button is clicked.\r\n // console.log(\"button-pressed\") when it does\r\n // You may want to modify the html file.\r\n\r\n // Task 5: Detect the content of the button press\r\n // call sendMessage() with that message, and wait for the response.\r\n\r\n\r\n // Task 6: If the response is \"OK\", then \r\n // clear the contents of the text area.\r\n // AND call renderMessage\r\n // the username should be MY_USER_NAME\r\n // GOTO: Task 7\r\n\r\n\r\n // This should run AFTER index is loaded.\r\n console.log(\"document loaded\");\r\n}", "function importOld(fileLoc){\n\tvar newLoc = fileLoc.replace(\"file:///\",\"\");\n\t\n\tnavigator.notification.progressStart(\"Importing CSV file\",\"Importing...\");\n\twindow.plugins.CSVImportExport.importOld(newLoc,\n\t\t\tfunction(){\n\t\t\t console.log(\"csv import SUCCUSSS\");\n\t\t\t\tgetDirectoryEntries(got_direntries);\n\t\t\t\tnavigator.notification.progressStop();\n\t\t\t\t$.mobile.changePage(\"#settings\");\n\t\t\t},\n\t\t\tfunction(e){\n\t\t\t\tconsole.log(e);\n\t\t\t});\n\t\t\t\n}", "function refresh(f) {\r\n if( (/in/.test(document.readyState)) || (undefined === Gmail) ) {\r\n console.log(\"load wait runs\")\r\n setTimeout('refresh(' + f + ')', 100);\r\n } else {\r\n f();\r\n }\r\n}", "function taskProgressChanged(data) {\n s.completionContainer.html(data.partial);\n }", "function loadStartCallBack() {\n\t$(\"#websiteReference\").text(\"Loading the Vivit Website... Please wait...\");\n}", "function onloadHandler(evt) {\n\t\t\t\t\t//var div = document.getElementById('upload-status');\n\t\t\t\t\t//div.innerHTML += '<' + 'br>File uploaded. Waiting for response.';\n\t\t\t\t}" ]
[ "0.6418801", "0.63642937", "0.63642937", "0.63642937", "0.63642937", "0.62059766", "0.61288226", "0.6116786", "0.58759737", "0.5859792", "0.58537364", "0.5794822", "0.57850343", "0.57789326", "0.5776228", "0.57382846", "0.57163465", "0.5715653", "0.5713039", "0.5707896", "0.5705591", "0.56903225", "0.5681944", "0.5680879", "0.56791264", "0.5667223", "0.5645417", "0.56241834", "0.56239223", "0.5610458", "0.56038433", "0.5600102", "0.55847216", "0.5563438", "0.55605626", "0.5558664", "0.5556993", "0.55427474", "0.55365247", "0.5522504", "0.5518273", "0.5516762", "0.5504081", "0.54942846", "0.5487271", "0.5483703", "0.5464428", "0.54584694", "0.5456159", "0.5452776", "0.54322445", "0.54257405", "0.54137903", "0.53913975", "0.5391331", "0.5388183", "0.53870255", "0.53869474", "0.5370862", "0.53650826", "0.53637576", "0.5360281", "0.5343713", "0.5342115", "0.5337488", "0.53321433", "0.5332083", "0.53265613", "0.5320775", "0.53165245", "0.5312183", "0.53119624", "0.5309169", "0.53072095", "0.53065056", "0.53021485", "0.52968204", "0.52961624", "0.5292484", "0.52917886", "0.52908456", "0.52891207", "0.52876335", "0.5283861", "0.52833873", "0.5268741", "0.52582365", "0.5253685", "0.52481675", "0.5244381", "0.52401215", "0.5231854", "0.5231118", "0.52307254", "0.5230158", "0.52279526", "0.5221655", "0.52190894", "0.52160364", "0.5215125" ]
0.7271098
0
:: first: string; last: string;
constructor(first /*: string */, last /*: string */) { this.first = first; this.last = last; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(first, last) {\n this.first = first;\n this.last = last;\n }", "function fullName2(first, last) {\n return first + \" \" + last;\n}", "function printName2(first, last) {\n console.log(first + \" \" + last)\n}", "function combineNames(first,last) {\n return `${first} ${last}`;\n}", "constructor() {\n this.first = null;\n this.last = null;\n }", "function getInitials(first, last) {\n if (first === \"\" || last === \"\") {\n return false;\n }\n else if (typeof first === \"string\" && isNaN(parseInt(first)) && typeof last === \"string\" && isNaN(parseInt(last))) {\n return first[0].toUpperCase() + \".\" + last[0].toUpperCase()+\".\";\n }\n\n else\n return false;\n}", "function fullName(first, last){\r\n var name = first + \"\" + last;\r\n return name;\r\n}", "function fullName(first, last) {\n const nameArr = [first, last];\n return nameArr.join(\" \");\n}", "function Person(first, last){\n this.first = first;\n this.last = last;\n}", "function fullName() {\n return \"Hello, this is \" + this.first + \" \" + this.last;\n}", "function firstAndLast(value){\n var l_value = value[value.length-1];\n var f_vale = value[0];\n var seq = [f_vale, l_value];\n return seq;\n}", "function getFirstAndLast(str, callback){\n firstChar(str, function(firstLetter){\n lastChar(str, function(lastLetter){\n callback(firstLetter + lastLetter);\n });\n });\n}", "function fullName (first, last)\n{\n console.log( `Hi my name is ${first} ${last}`);\n}", "function Person(first, last) {\n\tthis.first = first;\n\tthis.last = last || 'Shrestha';\n}", "function finlandLeader(first, last){\n this.firstName = first;\n this.lastName = last;\n}", "function name(first, last) {\n return function () {\n return first + last;\n }\n}", "function AnotherPerson(first, last) {\n (this.first = first + \" \"), (this.last = last);\n\n console.log(this);\n // Returns: AnotherPerson { first: 'Dan', last: 'Smith' } and AnotherPerson { first: 'Sally', last: 'May' }\n console.log(\"==============================\");\n}", "function Person(first, last) {\n\tthis.first = first;\n\tthis.last = last;\n }", "function practiceWithOptional(first, last, middle) {\n if (typeof middle === 'string') {\n return first + middle + last;\n }\n return first + last;\n}", "get fullName() {\n\t\t\treturn this.first + \" \" + this.last;\n\t\t}", "function firstAndLast(word)\n{\n var firstLastLetter = word.charAt(0)+word.charAt(word.length-1);\n return firstLastLetter.toUpperCase();\n}", "function initials(){\n let firstName = \"Cameron\"\n let firstLetter = firstName[0];\n let lastName = \"Alestra\";``\n let lastInitial = lastName[0];\n console.log(`${firstLetter} ${lastInitial}`)\n}", "function lastName (last) {\n console.log(\"Hi \" + last);\n}", "getFirstName() {}", "function addFirstAndLastLetter(str)\n{\n first = str.substring(0,1);\n alert(first + str + first);\n}", "function combineName(firstname, lastname){\r\n\treturn \"<\" + firstname + \"> <\" + lastname + \">\";\r\n}", "name (first_character, additional_characters) {\n return this.interval.contents;\n }", "function concatName(firstName, lastName) {\n return lastName + \", \" + firstName;\n}", "function showFirstAndLast(arr){\n \nvar arrStr=[]; \narr.forEach(z => arrStr.push(z[0]+z[z.length-1])); \n\nreturn arrStr ; \n\n\t\n\n\n\n\n}", "function partner(first,last){\n\treturn first + last;\n}", "getLastName() {}", "function firstLast(arr) {\n return arr.map(item => item.first + \" \" + item.last);\n}", "function firstName(first) {\n return (\"Hi \" + first);\n}", "function substringByStartAndEnd(input, start, end) {}", "function middleName(mid) {\n return (mid);\n}", "function makePerson4(first, last) {\n this.first = first;\n this.last = last;\n}", "function getFirstAndLastName( fullName ) {\n let employee = fullName.split(\" \");\n if(employee.length == 2) {\n return employee;\n }\n//\n const last_name = employee[employee.length-1];\n let first_name = \" \";\n for(let i=0; i<employee.length-1; i++) {\n first_name = first_name + employee[i] + \" \";\n }\n return [first_name.trim(), last_name];\n}", "substring(start,end) { return this.input.substring(start,end) }", "function check (firstAndLast) {\n let index;\n for (let i = 1; i < firstAndLast.length; i++) {\n if (firstAndLast[i].match(/[A-Z]/)) {\n console.log(firstAndLast.slice(0, i));\n console.log(firstAndLast.slice(i));\n }\n }\n}", "function matchName(firstName, lastName, texts) {\n var combinedName = S(firstName).trim() + S(lastName).trim();\n if (combinedName.length < 5) {\n return null; //too short\n } else {\n if (\n findText(combinedName, texts) ||\n findText(S(firstName + ' ' + lastName).trim(), texts)\n || (findText(firstName, texts) && findText(lastName, texts))\n ) {\n return 'firstAndLast';\n }\n \n else\n if (findText(firstName, texts)) {\n return 'firstOnly';\n } else if (findText(lastName, texts)) {\n return 'lastOnly';\n } else {\n return null;\n }\n }\n}", "function generateInitials(firstName, lastName) {\n if (firstName === undefined) throw new Error(\"firstName is required\");\n if (lastName === undefined) throw new Error(\"lastName is required\");\n return firstName[0] + \".\" + lastName[0];\n /* return index zero of first name, followed by a full stop, followed\n by index zero of second name\n \n POSSIBLE EDGE CASE: firstName, lastName start with space, number or symbol\n POSSIBLE EDGE CASE: Double-barrelled names?\n */\n}", "function Person(firstName, lastName) {\n this.First = firstName;\n this.Last = lastName;\n}", "function fullName(fn1,fn2){\n let first = \"Harish\";\n let last = \"Mehra\";\n\n return fn1(first) +\" \"+ fn2(last);\n}", "function concatLastFirst(capitalFirstLast){\n capitalLastFirst = capitalFirstLast.charAt(1) + capitalFirstLast.charAt(0);\n alert(capitalLastFirst);\n}", "get name(){\n\t\tconst first = this.firstName;\n\t\tconst last = this.lastName;\n\t\tif(first && last){\n\t\t\treturn `${first} ${last}`;\n\t\t}\n\t\treturn null;\n\t}", "match(input, start, end) {\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if( !this.startsWith(input.get(start)) )\n return this.error(input, start, start+1)\n var n = end\n end=start+1\n while(end<n && this.startsWith(input.get(end))) end++\n return this.token(input,start,end,\" \")\n }", "constructor() {\n this.first = null;\n this.last = null;\n this.size = 0;\n }", "function showFirstAndLast(arr){\n let newArr = [];\n arr.forEach(function(value) {\n if(typeof value === \"string\"){\n newArr.push(value[0] + value[value.length-1]);\n }\n });\n return newArr;\n }", "function twoStrings(firstName, lastName) {\n return firstName + lastName;\n}", "function getFirstAndLastParams(objects, after) {\n if (objects.length) {\n let first = (Number(after) + 1) || 0;\n let last = first + (objects.length - 1);\n first = String(first);\n last = String(last);\n return {first, last};\n }\n return {};\n}", "constructor(public firstName: string, public middleInitial: string, public lastName: string) {\n//TODO: Refactor this to use the ES6 template literal notation\nthis.fullName = firstName + \" \" + middleInitial + \" \" + lastName;\n}", "function getNames(firstName, secondName, familyName) {.\r\n const name = firstName + \" \" + familyName;\r\n const fullName = firstName + \" \" + secondName + \" \" + familyName;\r\n\r\n return [name, fullName];\r\n}", "function getFullName(firstName, secondName, familyName) {\r\n return firstName + \" \" + secondName;\r\n\r\n return firstName + \" \" + secondName + \" \" + familyName;\r\n\r\n}", "function getfullName (firstname, lastname){\nreturn firstname +' '+ lastname\n}", "function middleOfList() {\n\n}", "function collegeName(first,last = 'Govt. College'){\n const fullName = first + ' ' + last;\n console.log(fullName);\n}", "function FirstAndLastName(name){\nvar firstAndLastName = DoSplitName(document.getElementById(\"full_name\").value);\ndocument.getElementById(\"firstname\").value = firstAndLastName[\"first\"];\ndocument.getElementById(\"lastname\").value = firstAndLastName[\"last\"]; \n}", "fullname() { return this._firstname + \" \" + this._lastname; }", "function fullName (firstName, lastName){\n return fullName.firstName;\n return fullName.lastName;\n}", "function logFirstAndLast(list) {\n var first = list[0];\n var last = list[list.length-1];\n return [first, last];\n }", "function fullName(first, lastname) {\n return first + ' ' + (lastname || ''); //safety\n}", "function rdfPerson(fullname) {\n var nameInit = fullname.charAt(0); // prendo l'iniziale del nome\n var surname = fullname.substr(fullname.indexOf(\" \"));\n\n var firstSurname = \"\";\n var secondSurname = \"\";\n\n // primo, secondo e terzo spazio nel cognome\n var first = 0, second = 0, third = 0;\n\n // ciclo per individuare gli ultimi due spazi nel cognome\n do {\n second = surname.indexOf(\" \", first + 1);\n if (second == -1) {\n firstSurname = surname.substr(first + 1);\n } else {\n third = surname.indexOf(\" \", second + 1);\n if (third == -1) {\n secondSurname = surname.substr(second + 1);\n firstSurname = surname.substr(first + 1, second - first - 1);\n } else {\n first = second;\n }\n }\n } while (firstSurname == \"\");\n \n return ((nameInit + \"-\" + firstSurname + secondSurname)).toLowerCase();\n}", "function sayHelloAdv(first, last) {\r\n return sayHello(first +\" \" + last);\r\n}", "function list (first, rest) {\n return [first].concat(rest);\n }", "function fullName(firstName, lastName) {\n return firstName + \" \" + lastName;\n}", "function fullName(firstName, lastName) {\n return firstName + lastName;\n}", "function removeMiddleName(string) {\n\n let arrayString = string.split(\" \");\n let first = arrayString[0];\n let last = arrayString[arrayString.length-1];\n let firstLast = first +\" \" + last;\n \n if (arrayString.length === 1){\n return first;\n }\n else{\n return firstLast;\n }\n \n }", "function surnameStarts(myName) {\n\n\tvar separated = myName.split(' ');\n\n\tseparated[0] = \"Mr.\";\n\treturn console.log('Hello ' + separated[0] + separated[1]);\n\n}", "function Person(first, last) {\n\tthis.firstname = first;\n\tthis.lastname = last;\n\tthis.toString = function() {\n\t\treturn this.firstname+\" \"+this.lastname;\n\t};\n}", "function getFirstAndLastName(fullName) {\n // If a person has a space in their first name, such as \"Mary Kay\",\n\n // then first_name needs to ignore that first space.\n\n // Surnames generally do not have spaces in them so count the number\n\n // of elements in the array after the split and merge all before the last\n\n // element.\n\n let employee = fullName.split(\" \");\n\n if (employee.length == 2) {\n return employee;\n }\n\n const last_name = employee[employee.length - 1];\n\n let first_name = \" \";\n\n for (let i = 0; i < employee.length - 1; i++) {\n first_name = first_name + employee[i] + \" \";\n }\n\n return [first_name.trim(), last_name];\n}", "match(input, start, end){}", "function firstName2(person) {\n console.log(person.firstname + \" \" + person.lastname);\n}", "function secondToLast(value){\n return value[value.length-2];// returns second to lastvalue sequence\n}", "function fullName(firstName, lastName) {\r\n myName.joann = \"Joann\";\r\n myName.saeou = \"Saeou\";\r\n return 'firstName.joann', 'lastName.saeou';\r\n}", "function fullName(firstName,lastName){\n return firstName + ' ' + lastName;\n}", "function meeting2(s) {\n let string = s\n .toUpperCase()\n .split(\";\")\n .map(x =>\n x\n .split(\":\")\n .reverse()\n .join(\", \")\n )\n .sort() // of course! I don't need to sort by both last and first name\n .join(\")(\");\n return \"(\" + string + \")\";\n}", "function showFirstAndLast(arr){\r\n var newArr=[];\r\n arr.forEach(function(val){\r\n newArr.push(val[0] + val[val.length-1]); \r\n });\r\n return newArr;\r\n}", "function getFullName(firstName, lastName) {\r\n return firstName + \" \" + lastName;\r\n}", "function getFullName(firstName, lastName) {\n return firstName + ' ' + lastName;\n}", "function concatName(firstName, lastName) {\n return lastName.concat(', '+firstName)\n }", "function firstAndLastToUpper(str) {\n let res = str[0].toUpperCase() + str.substring(1, str.length - 1) + str[str.length -1].toUpperCase();\n return res;\n}", "function getNewFirstName() {\n return firstName.substring(0,3) + lastName.substring(0,2).toLowerCase();\n}", "function takeString1(mystring)\n{ \n //start is second last char\n \n return mystring.substring(mystring.length-2);\n}", "constructor() { //constructor\n this.first = null; //give initial value of first as null\n this.last = null; //give initial value of last as null\n this.count = 0;\n }", "function buildUser( first, last ) { \n let fullName = first + \" \" + last;\n return { first: first, last: last, fullName: fullName };\n}", "function myLastName() {\n return myLastName.lim;\n}", "function myFirstLastNameLetters(name){\n\tvar position = name.indexOf(\"B\");;\n\tvar lastName = name.substr(position);\n\tconsole.log(name.substr(0,1) + \".\" + lastName.substr(0,1));\n}", "function Shopper(first, last) {\n this.first = first;\n this.last = last;\n // this.firstName = first;\n // this.lastName = last;\n }", "function concatName(firstName, lastName) {\n\t\n\treturn lastName.concat(',',firstName);\n}", "fullName() {\n return `${this.firstName} ${this.lastName}`\n }", "function buildLotsOfNames(firstName) {\n var restOfName = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n restOfName[_i - 1] = arguments[_i];\n }\n return firstName + \" \" + restOfName.join(\" \");\n}", "function buildName2(firstName, ...restOfName) {\n return firstName + ' ' + restOfName.join(' ');\n}", "function list(names) {\n let list = ''\n if (names.length === 0) {\n return list\n }\n if (names.length === 1) {\n return names[0].name\n }\n for (let i = 0; i < names.length; i++) {\n if (i === names.length - 1) {\n list += ' & ' + names[i].name\n }\n else if (i === names.length - 2) {\n list += names[i].name\n }\n else {\n list += names[i].name + ', '\n }\n }\n return list\n}", "function front_back(str)\n{\n frist = str.substring(0,1);\n return frist+str+frist;\n}", "function surnameStarts(myName) {\n\tfor (var i = 0; i <= myName.length - 1; i++) {\n\t\tif (myName[i] == \" \") {\n\t\t\treturn console.log(myName.slice(0, i));\n\t\t}\n\t}\n}", "function buildUser(first, last){\n let fullName = first + \" \" + last;\n\n return {first, last, fullName};\n}", "function getFirstName1(fullName) {\n return fullName.split(\" \")[0];\n}", "fullname() {\n return `${this.firstname} ${this.lastname}`;\n }", "function fullName(firstName, lastName) {\n\treturn firstName + \" \" + lastName;\n}", "function fullName(firstName, lastName){\n\treturn firstName + ' ' + lastName;\n}" ]
[ "0.6915124", "0.67556626", "0.6513084", "0.63991654", "0.6238873", "0.62131447", "0.6168731", "0.6078372", "0.60631084", "0.60281205", "0.60135126", "0.6004888", "0.58821124", "0.58812714", "0.5870726", "0.58311486", "0.5805098", "0.57619363", "0.57511514", "0.5688302", "0.5669925", "0.56664014", "0.5663177", "0.56481606", "0.5590374", "0.558723", "0.55711627", "0.55633247", "0.5556589", "0.55262876", "0.5512822", "0.55103743", "0.5505965", "0.5499487", "0.54783916", "0.5471201", "0.5422189", "0.54143757", "0.53728145", "0.53670096", "0.5356469", "0.5355337", "0.5352736", "0.5325354", "0.53232914", "0.53167003", "0.53157127", "0.5310036", "0.5290988", "0.52889055", "0.5276168", "0.5270979", "0.5264812", "0.5263845", "0.5260591", "0.52554774", "0.5252798", "0.5248623", "0.52436393", "0.5232748", "0.52263343", "0.52238137", "0.52172095", "0.52110666", "0.52055055", "0.5202631", "0.51991355", "0.51967186", "0.51960486", "0.5195523", "0.5182475", "0.51804215", "0.51755995", "0.51750207", "0.51741916", "0.51518524", "0.51505", "0.51469433", "0.5146834", "0.5142881", "0.51393753", "0.51340526", "0.51334894", "0.5117147", "0.5116732", "0.51140517", "0.510101", "0.5098067", "0.50959384", "0.5093797", "0.5081607", "0.5076111", "0.50713754", "0.5069445", "0.5066216", "0.505544", "0.5054893", "0.50539577", "0.502438", "0.50242275" ]
0.8130865
0
Called when the subscription is ready for use on the server
disconnected() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async onSubConnected() {\n if (process.env.NODE_ENV === \"development\")\n console.log(\"[Subscription] connected\");\n\n this.dispatch(appOperations.setSubscribed({ isSubscribed: true }));\n }", "async initSubscriptions() {\n\n }", "function subscribe(){\n performance.mark('subscribing');\n client.subscribe('payload/empty', function (err) {});\n performance.mark('subscribed');\n performance.measure('subscribing to subscribed', 'subscribing', 'subscribed');\n}", "function handleAPILoaded()\n{\n requestSubscriptionList();\n}", "connectedCallback() {\n // Callback function to be passed in the subscribe call after an event is received.\n // This callback prints the event payload to the console.\n // A helper method displays the message in the console app.\n var self = this;\n const messageCallback = function(response) {\n self.onReceiveEvent(response);\n };\n // Subscribe to the channel and save the returned subscription object.\n subscribe(this.channelName, -1, messageCallback).then(response => {\n this.subscription = response;\n });\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n }", "onInit() {\n this._client.subscribe(\"connect\", this.onConnect.bind(this));\n this._client.subscribe(\"message\", this.onMessage.bind(this));\n this._client.subscribe(\"error\", this.onError.bind(this));\n }", "subscribe () {}", "constructor() {\n this.subscriptions = {}\n }", "subscribe() {}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n }", "subscribe() {\n this.subscriptionID = this.client.subscribe(this.channel, this.onNewData)\n this.currencyCollection.subscribe(this.render)\n this.currencyCollection.subscribe(this.drawInitialSparkLine)\n this.currencyCollection.subscribeToSparkLineEvent(this.drawSparkLine)\n }", "async onSubReconnected() {\n if (process.env.NODE_ENV === \"development\")\n console.log(\"[Subscription] reconnected\");\n\n this.dispatch(appOperations.setSubscribed({ isSubscribed: true }));\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "function onDeviceReady() {\n // Now safe to use the PhoneGap API\n var conn = new Strophe.Connection(BOSH_CONNECTING);\n\n PubSub.connection = conn;\n PubSub.connection.rawInput = PubSub.raw_input;\n PubSub.connection.rawOutput = PubSub.raw_output;\n \n }", "function subscribe() {\n $rootScope.$on('loaded', function() {\n self.loading = false;\n });\n }", "constructor() { \n \n Subscriptions.initialize(this);\n }", "function onConnectSuccess () {\n\tconsole.log(\"Successfully connect to Device Gateway!\");\n\tclientReady = true;\n\n\tfor (let topic of subscriptionQueue) {\n\t\ttopic && client.subscribe(topic);\n\t}\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n client.subscribe(topics[\"response\"])\n console.log(\"onConnect\");\n}", "onListening() {\n this.emit('ready');\n }", "onListening() {\n this.emit('ready');\n }", "function connectCallback(){\n\t\tconsole.log('connected');\t\t\n\t\tvar subscription = client.subscribe(\"/fx/prices\", \n\t\t\t function( message ) {\n onCallBack(message)\n }\n\t\t);\n\t}", "handleSubscribe() {\n // Callback invoked whenever a new event message is received\n const messageCallback = (response) => {\n console.log(\"New Component Update message received: \", JSON.stringify(response.data.payload));\n this.doDemoComponentRefresh();\n }\n\n subscribe(this.channelName, -1, messageCallback).then((response) => {\n // Response contains the subscription information on subscribe call\n console.log(`Subscription request sent to: ${JSON.stringify(response.channel)}`);\n console.log(`Subscription request Response: ${JSON.stringify(response)}`);\n this.subscription = response;\n this.isSubscriptionRequested = false;\n this.isSubscribed = true;\n });\n }", "handleSubscribe() {\n // Callback invoked whenever a new event message is received\n const messageCallback = (response) => {\n console.log('Segment Membership PE fired: ', JSON.stringify(response));\n // Response contains the payload of the new message received\n this.notifier = JSON.stringify(response);\n this.refresh = true;\n // refresh LWC\n if(response.data.payload.Category__c == 'Segmentation') {\n this.getData();\n }\n \n\n\n };\n\n // Invoke subscribe method of empApi. Pass reference to messageCallback\n subscribe(this.channelName, -1, messageCallback).then(response => {\n // Response contains the subscription information on subscribe call\n console.log('Subscription request sent to: ', JSON.stringify(response.channel));\n this.subscription = response;\n this.toggleSubscribeButton(true);\n });\n }", "function onSubscriptionEnded() {\n session = null;\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n\n}", "function init () {\t\t\n\t\t// Subscribe to ourself to fire a metric event when the user data is ready to use for the metrics.\n\t\tIBM.common.util.user.subscribe(\"ready\", \"User self-subscription\", function(){\n\t\t\tfireEvent();\n\t\t});\n\n\t\t// Some wackyness with pub/sub, sometimes requires a subscription to make it subscribable. Weird.\n\t\tIBM.common.util.user.subscribe(\"userstateReady\", \"User self-subscription\", function(){});\n\n\t\tIBM.common.meta.subscribe(\"dataReady\", \"userstaterequest\", function () {\n\t\t\tIBM.common.util.coreservices.makeRequest(\"777\", \"IBMCore.common.util.user.setUserSigninState\", {});\n\t\t}).runAsap(function () {\n\t\t\tIBM.common.util.coreservices.makeRequest(\"777\", \"IBMCore.common.util.user.setUserSigninState\", {});\n\t\t});\n\n\t\tsetUserdataObject();\n\t}", "setupDataListener(){\n PubSub.subscribe('Items:item-data-loaded',(evt)=>{this.initiliaze(evt.detail)});\n }", "_subscribe () {\n if (!this.connected)\n throw new Error('No connection exist')\n\n this.subClient.on('message', this._onMessage.bind(this))\n\n if (_.isFunction(this._config.handlers.onError)) {\n this.subClient.on('error', this._config.handlers.onError)\n }\n }", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "_notifySubscriber(subscriber) {\n subscriber.next();\n subscriber.complete();\n }", "async onReady() {\n\t\t// Initialize your adapter here\n\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState('info.connection', false, true);\n\n\t\t// The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n\t\t// this.config:\n\t\tthis.log.info('config ipAddress: ' + this.config.ipAddress);\n\n\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates('*');\n\n\n\t\tthis.Greeclient = new Gree.Client({ host: this.config.ipAddress });\n\n\t\tthis.Greeclient.on('connect', (client) => {\n\n\t\t\tthis.log.info('Client connected:' + client.getDeviceId());\n\t\t\tthis.setState('info.connection', true, true);\n\t\t});\n\t\tthis.Greeclient.on('no_response', () => {\n\t\t\tthis.log.warn('Client no response');\n\t\t});\n\t\tthis.Greeclient.on('update', this.onGreeUpdate.bind(this));\n\t}", "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "function onConnect(){\n console.log(\"Connected!\");\n client.subscribe(topic);\n }", "function subscribeRes(){\n console.log(\"Subscribe the Resource - >\");\n connect.removeAllListeners(\"OnValueUpdate\");\n connect.deleteDeviceSubscriptions(deviceId).catch(\n error => {\n console.log(error);\n });\n connect.subscribe.resourceValues({resourcePaths: resourcePaths}, \"OnValueUpdate\")\n .addListener(res => \n {\n logger.info(res);\n if (res.path == '/20002/3/31008') {\n curHeartBeat = res.payload;\n }\n })\n .addLocalFilter(res => res.contentType != undefined);\n clearInterval(timer);\n startSchedule();\n}", "subscribe() {\n Meteor.subscribe(this.collectionName);\n }", "function ready() {\r\n var tmpstore = new __sco.storage(), message = \"sc_not_available\";\r\n if ((tmpstore.local || tmpstore.cookies) && scobj.referrers != null)\r\n message = \"sc_ready\";\r\n __sco.management.callback(message);\r\n}", "function on_connect() {\n console.log(\"Connected to RabbitMQ-Web-Stomp\");\n console.log(client);\n client.subscribe(mq_queue, on_message);\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bdcc/itaxi\");\n}", "init() {\r\n this.readyCount = 0;\r\n }", "subscribeOnServer(subscriptionData) {\n let requestData = {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(subscriptionData),\n };\n\n NotificationPushService.fetchServer(new Request(this.apiEndPointSubscribeUser, requestData));\n }", "onClientSubscribed(callback) {\n this.subCallback = callback;\n }", "function setupTranslationsReadyListener () {\n\t\tIBM.common.util.queue.push(function(){\n\t\t\treturn translations.v18.ready;\n\t\t}, function(){\n\t\t\t// Merge all the translations into our local single data object \"me.data\" (public).\n\t\t\t// Keep any existing ones (merge in first) in case some other main module wants to share this storage facility.\n\t\t\tmergeTranslations(currStoredTranslations[IBM.common.meta.page.pageInfo.ibm.cpi]);\n\t\t\tmergeTranslations(translations.v18.data);\n\n\t\t\t// No do the actual storing.\n\t\t\tstoreTranslations();\n\n\t\t\t// Now fire events that the data is ready to be used\n\t\t\tmyEvents.publish(\"dataReady\");\n\t\t\t\n\t\t\t$(function() {\n\t\t\t\tmyEvents.publish(\"dataAndDomReady\");\n\t\t\t});\n\t\t});\n\t}", "connectedCallback(){\n this.subscription = subscribe(\n this.messageContext,\n LMSChannel1,\n (message) => this.handleMessage(message)\n );\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n // subscribe as soon as connected\n subscribeMQTTtopic();\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n toastr.success(\"onConnect\")\n \n client.subscribe(\"general\")\n client.subscribe(\"status/+\")\n client.subscribe(\"readings/+\")\n\n //client.subscribe(\"temperature/+\")\n //client.subscribe(\"pressure/+\")\n //client.subscribe(\"humidity/+\")\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n}", "onReady() {}", "function onConnect() {\n // Once a connection has been made, make a subscription and save a message to a txt.\n client.subscribe(\"mebaris01/nurusallam/\");\n \n}", "constructor() {\n SubscriptionBodySubject.initialize(this);\n }", "_callSubscribe() {\n console.log(\" 0 observers \");\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(subscribeTopic.lights); //for subscription of lights\r\n client.subscribe(subscribeTopic.window); //for subscription of windows\r\n client.subscribe(subscribeTopic.tempHumidity); //for subscription of tempHumidity\r\n client.subscribe(subscribeTopic.tempTemperature);\r\n client.subscribe(subscribeTopic.AirQuality); //for subscription of AirQuality\r\n}", "function ready() {\n isAlreadyCalling = false;\n socket.emit('ready');\n}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\r\n client.subscribe(\"[email protected]/IoT\");\r\n\r\n\r\n}", "onServerReady(callback) {\n this.readyCallback = callback;\n }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function Subscription() {\n\n var logger = new Logger('Subscription');\n\n /**\n * Storage keywords for storing subscription settings\n * @type {Object}\n */\n var config = {\n storageKeywords: {\n\n VOIPTN: \"VoipTn\",\n VOIPCREF: \"VoipTnCipherRef\",\n MYPUBLICUSER: \"MyPublicUser\",\n services: 'services',\n serviceName: 'serviceName',\n serviceCatalog: {\n publicId: 'publicId',\n domain: 'domain',\n id: 'id',\n webSocketEndpoints: 'webSocketEndpoints',\n voipTnCipherRef: 'voipTnCipherRef'\n },\n RTCService: {\n Enabled : \"RTCServiceEnabled\",\n Exists : \"RTCServiceExists\",\n ProvisioningState : \"RTCServiceProvisioningState\",\n Uris : \"RTCUris\"\n }\n }\n };\n\n /**\n * Retrieve list of subscribed services\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServices() {\n var slRequest = new SubscriptionServiceIdentitiesRequest();\n return Ajax.request(\n slRequest.type,\n slRequest.getRequestUrl(),\n null,\n slRequest.getRequestHeaders()\n );\n }\n\n /**\n * Retrieve details of particular service\n * @param {String} serviceName Name of the service to get details about\n * @param {String} publicId Moniker (public ID) tied to the service\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServiceDetails(serviceName, publicId) {\n var seCatalogRequest = new SubscriptionServiceCatalogRequest(serviceName, publicId);\n return Ajax.request(\n seCatalogRequest.type,\n seCatalogRequest.getRequestUrl(),\n null,\n seCatalogRequest.getRequestHeaders()\n );\n }\n\n /**\n * Set services into storage\n * @param {Object} services Object with services\n * @protected\n */\n function setServices(services) {\n Utils.set(config.storageKeywords.services, JSON.stringify(services));\n }\n\n /**\n * Get services from the storage\n * @return {Object} Object with services\n * @protected\n */\n function getServices() {\n return Utils.get(config.storageKeywords.services);\n }\n\n /**\n * Set service catalog details into storage\n * @param {Object} serviceCatalog Object with service details\n */\n function setServiceCatalog(serviceCatalog) {\n Utils.setObject(config.storageKeywords.serviceName, serviceCatalog.productName);\n Utils.setObject(config.storageKeywords.services + '_' + serviceCatalog.productName, serviceCatalog);\n }\n\n /**\n * Get service details\n * @return {Object} Object with service details\n */\n function getServiceCatalog() {\n var serviceName = Utils.getObject(config.storageKeywords.serviceName);\n return Utils.getObject(config.storageKeywords.services + '_' + serviceName);\n }\n\n /**\n * Set moniker (public ID) in storage\n * @param {String} publicId user's public ID (moniker)\n */\n function setPublicId(publicId) {\n Utils.set(config.storageKeywords.serviceCatalog.publicId, publicId);\n }\n\n /**\n * Get moniker (public ID) from storage\n */\n function getPublicId() {\n return Utils.get(config.storageKeywords.serviceCatalog.publicId);\n }\n\n function parseWebRTCServers(uris) {\n\n var parsedServers = [];\n\n if (typeof uris === 'string') {\n uris = uris.replace(/ /g,'');\n try {\n uris = JSON.parse(uris);\n } catch (e) {\n if(uris.indexOf('$') >= 0) {\n uris = uris.split('$');\n }\n }\n }\n\n var addToServerList = function(server) {\n if(parsedServers.indexOf(server) === -1) {\n parsedServers.push(server);\n }\n };\n\n if (uris) {\n for (var key in uris) {\n if (uris.hasOwnProperty(key)) {\n if (uris[key] instanceof Array) {\n for (var i=0; i<uris[key].length; i++) {\n addToServerList(uris[key][i]);\n }\n } else {\n if (typeof uris[key] === 'string') {\n\n try {\n var parsedUris = JSON.parse(uris[key]);\n if (parsedUris instanceof Array) {\n for (var j=0; j<parsedUris.length; j++) {\n var parsedServerList = this.parseWebRTCServers(parsedUris[j]);\n for(var k = 0; k < parsedServerList.length; k++) {\n addToServerList(parsedServerList[k]);\n }\n }\n }\n }\n catch(e) {\n addToServerList(uris[key]);\n }\n } else {\n for (var p in uris[key]) {\n if (uris[key].hasOwnProperty(p)) {\n if (uris[key][p] instanceof Array) {\n for(var m = 0; m < uris[key][p].length; m++) {\n addToServerList(uris[key][p][m]);\n }\n }\n else {\n addToServerList(uris[key][p]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n localStorage.setItem(config.storageKeywords.RTCService.Uris, JSON.stringify(parsedServers));\n }\n\n function setOAuthCredentials(data) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n var publicUser = '';\n\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, data.networkIdentity.authenticationandCipheringReference);\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, data.networkIdentity.moniker);\n\n if(data.rtc) {\n publicUser = data.networkIdentity.moniker + data.rtc.domain;\n parseWebRTCServers(data.rtc.routing);\n }\n else {\n publicUser = data.networkIdentity.moniker;\n }\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, publicUser);\n }\n\n function setCtlIdCredentials(preRegData) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, preRegData.HomePreRegisterResponse.VoipTn);\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, preRegData.HomePreRegisterResponse.VoipTnCipherRef);\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, preRegData.HomePreRegisterResponse.MyPublicUser);\n localStorage.setItem(config.storageKeywords.RTCService.Exists, preRegData.HomePreRegisterResponse.RTCServiceExists);\n\n parseWebRTCServers(preRegData.HomePreRegisterResponse.VoIPDomainURIs);\n }\n\n this.getSubscriptionServices = getSubscriptionServices;\n this.getSubscriptionServiceDetails = getSubscriptionServiceDetails;\n this.getServiceCatalog = getServiceCatalog;\n this.setServiceCatalog = setServiceCatalog;\n this.setPublicId = setPublicId;\n this.getPublicId = getPublicId;\n this.setCtlIdCredentials = setCtlIdCredentials;\n this.setOAuthCredentials = setOAuthCredentials;\n\n }", "function onConnect() {\n console.log(\"onConnect\");\n client.subscribe(\"student/id\");\n}", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready () {\n\t this._isAttached = true\n\t this._isReady = true\n\t this._callHook('ready')\n\t}", "function ready () {\n\t this._isAttached = true\n\t this._isReady = true\n\t this._callHook('ready')\n\t}", "function cb_onConnect() {\n console.log(\"Connection established.\");\n $('#status').val('Connected to ' + host + ':' + port);\n topic = $('#topic').val();\n client.subscribe(topic);\n}", "function ready () {\n\t\t this._isAttached = true\n\t\t this._isReady = true\n\t\t this._callHook('ready')\n\t\t}", "async onReady() {\n // Initialize your adapter here\n // Reset the connection indicator during startup\n this.setState('info.connection', false, true);\n if (!this.config.host) {\n this.log.error(`No host is configured, will not start anything!`);\n return;\n }\n await this.cleanupObjects();\n this.createWebSocket();\n if (this.config.luxPort) {\n await this.createLuxTreeAsync();\n this.createLuxtronikConnection(this.config.host, this.config.luxPort);\n }\n this.watchdogInterval = setInterval(() => this.handleWatchdog(), this.config.refreshInterval * 1000);\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "async onReady() {\n\t\t// Read already known devices\n\t\tawait this.tryKnownDevices();\n\n\t\t// Run Autodetect (Bonjour - Service, mDNS to be handled)\n\t\tawait this.scanDevices();\n\n\t\t// Connection state to online when adapter is ready to connect to devices\n\t\tthis.setState('info.connection', true, true);\n\t\tthis.log.info('WLED initialisation finalized, ready to do my job have fun !');\n\n\t\t// Start Polling timer\n\t\tthis.polling_timer();\n\n\t}", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "function onConnect() {\t\n\t\tmqtt.subscribe(moisture_topic, {qos: 0});\n\t\t//$('#status').val('Connected to ' + host + ':' + port + path);\n\t}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n log(\"Connection successful to topic \" + topic + \" as client \" + clientname);\n client.subscribe(topic);\n onconnect()\n }", "onAdd() {\n this.setReady_(true);\n }", "setAsReady() {\n this.logger.debug('Page is ready to use');\n this.controller.store();\n }", "constructor() {\n super();\n\n this.state = {\n subscription: {\n budgets: Meteor.subscribe(\"userBudgets\")\n }\n };\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"World\";\n //client.send(message);\n }", "function onConnect() {\n\t\tclient.subscribe(endpoints.Liveliness, onData);\n\t}", "function _subscribe() {\n\n _comapiSDK.on(\"conversationMessageEvent\", function (event) {\n console.log(\"got a conversationMessageEvent\", event);\n if (event.name === \"conversationMessage.sent\") {\n $rootScope.$broadcast(\"conversationMessage.sent\", event.payload);\n }\n });\n\n _comapiSDK.on(\"participantAdded\", function (event) {\n console.log(\"got a participantAdded\", event);\n $rootScope.$broadcast(\"participantAdded\", event);\n });\n\n _comapiSDK.on(\"participantRemoved\", function (event) {\n console.log(\"got a participantRemoved\", event);\n $rootScope.$broadcast(\"participantRemoved\", event);\n });\n\n _comapiSDK.on(\"conversationDeleted\", function (event) {\n console.log(\"got a conversationDeleted\", event);\n $rootScope.$broadcast(\"conversationDeleted\", event);\n });\n\n }", "connectedCallback() {\n this.subscribeToMessageChannel();\n }", "subscribe() {\n //Fetch Code Goes Here\n }", "function onReady() {\n\n // Connect to the event stream and handle events.\n var socket = new ReconnectingWebSocket(EVENTS);\n socket.onmessage = function (msg) {\n if (msg.data === 'removed') {\n tagRemoved();\n } else {\n tagPresent(msg.data);\n }\n };\n socket.onerror = function (msg) {\n console.log('Event stream failed: ' + msg);\n };\n\n // Register keyboard and submission handlers.\n registerKeyboardEvents();\n registerSubmit();\n\n}", "listen() {\n const subscription = this.client.subscribe(\n this.subject,\n this.queueGroupName,\n this.subscriptionOptions()\n );\n\n subscription.on('message', (msg) => {\n console.log(\n 'Message Received: ' + this.subject + '/' + this.queueGroupName\n );\n\n const parsedData = this.parseMessage(msg);\n this.onMessage(parsedData, msg);\n });\n }", "function ready () {\n getPlaylist(userCredentials.playlistID, function (playlist) {\n getTracksForPlaylist(playlist, log)\n });\n}", "static ready() { }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"[email protected]/WEB\");\n\n\t\n }", "onConnect() {\n console.log(\"connected to broker\");\n this.client.subscribe(\"common/reply\");\n this.emit('onConnected');\n }", "__broker_setup() {\n this.mqttServer.authenticate = this.__broker_auth;\n this.mqttServer.authorizePublish = this.__broker_allow_pub;\n this.mqttServer.authorizeSubscribe = this.__broker_allow_sub;\n this.mqttServer.on('clientConnected', this.__broker_connected);\n this.mqttServer.on('published', this.__broker_published);\n this.mqttServer.on('subscribed', this.__broker_subscribed);\n this.mqttServer.on('unsubscribed', this.__broker_unsubscribed); \n this.mqttServer.on('clientDisconnecting', this.__broker_disconnecting);\n this.mqttServer.on('clientDisconnected', this.__broker_disconnected);\n if (this.readyCallback != null) {\n this.readyCallback(); // indicates that we are ready\n }\n console.log('[MQTT] Mosca server is up and running on port ' + this.mqttPort);\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n message = new Messaging.Message(\"webClient connected\");\n message.destinationName = topic;\n client.send(message);\n }" ]
[ "0.72273105", "0.7138689", "0.70842105", "0.69783443", "0.68616843", "0.68069595", "0.678704", "0.6707494", "0.6694112", "0.6685425", "0.66689354", "0.6645919", "0.663792", "0.6617189", "0.66029894", "0.66022515", "0.65721023", "0.6561352", "0.65561926", "0.655096", "0.65076864", "0.65076864", "0.650277", "0.6491824", "0.6488298", "0.64855117", "0.6468848", "0.6457293", "0.64165074", "0.64009863", "0.636635", "0.636635", "0.636635", "0.6336795", "0.63130224", "0.6288377", "0.62824416", "0.6279237", "0.62743694", "0.62629265", "0.6250139", "0.6249036", "0.62406576", "0.62375367", "0.62330437", "0.6228108", "0.6220163", "0.62183553", "0.6218279", "0.6211214", "0.61806583", "0.61688566", "0.616831", "0.61653936", "0.616519", "0.6164865", "0.6162597", "0.61516607", "0.61516607", "0.61516607", "0.61516607", "0.61516607", "0.61516607", "0.61516607", "0.61501515", "0.6146555", "0.61445844", "0.61445844", "0.61445844", "0.6143703", "0.6143703", "0.6133394", "0.61300164", "0.6119788", "0.60975724", "0.60975724", "0.60975724", "0.60975724", "0.60975724", "0.60975724", "0.60975724", "0.6086832", "0.6086004", "0.60813534", "0.60803056", "0.6069184", "0.60612136", "0.605996", "0.60515654", "0.6043447", "0.60285723", "0.6026273", "0.60262436", "0.6023636", "0.602129", "0.60069466", "0.6003535", "0.6002381", "0.60013306", "0.59998566", "0.5982162" ]
0.0
-1
Called when the subscription has been terminated by the server
received(message) { // Called when there's incoming data on the websocket for this channel return store.dispatch(addMessage(message)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSubscriptionEnded() {\n session = null;\n }", "disconnectedCallback() {\n unsubscribe(this.subscription);\n this.subscription = null;\n }", "async onSubDisconnected() {\n if (process.env.NODE_ENV === \"development\")\n console.log(\"[Subscription] disconnected\");\n\n this.dispatch(appOperations.setSubscribed({ isSubscribed: false }));\n\n // there is no way with this transport to see why we are disconnected\n // so let's refresh tokens in case the reason was an expired token\n // refreshing tokens is rate limited anyway\n await this.refreshTokens();\n }", "unsubscribe() {\n Object.keys(this.subscriptions).forEach(key => {\n if (this.subscriptions[key].subscription.dispose) {\n this.subscriptions[key].subscription.dispose();\n }\n });\n }", "function onerror(err){\n debug('subscription \"%s\" error %s in pending state', sub.id, err.stack);\n sub.destroy();\n }", "onDestroy() {\n this.unlisten()\n }", "handleUnsubscribe() {\n\n // Invoke unsubscribe method of empApi\n unsubscribe(this.subscription, response => {\n console.log('unsubscribe() response: ', JSON.stringify(response));\n // Response is true for successful unsubscribe\n });\n }", "unsubscribe() {\n const sub = this.sub\n , url = this.url;\n if (url && sub) {\n debug('sub.disconnect: %s', this.url)\n try {\n sub.disconnect(this.url);\n }\n catch(_e) {/* ignore */}\n sub.unsubscribe(this[secretBuf$]);\n clearTimeout(this._pulseTimeout);\n this._pulseTimeout = null;\n }\n }", "disconnect() {\n this.unsubscribe()\n }", "_disconnect() {\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "ngOnDestroy() {\n // https://stackoverflow.com/a/41177163\n this.ngUnsubscribe$.next();\n this.ngUnsubscribe$.complete();\n }", "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "function ondestroy(){\n debug('removing subscription from pending cache');\n var index = self.pending[sid].indexOf(sub);\n self.pending[sid].splice(index, 1);\n }", "destroy() {\n this.subscribers = null;\n }", "ngOnDestroy() {\n this.subscription.unsubscribe();\n }", "end() {\n if (this._client) {\n this._client.end();\n delete this._client;\n\n // TODO: remove subscribers\n delete this._source;\n }\n }", "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach(subDestroy => subDestroy());\n this.subs = undefined;\n }\n\n this.io[\"_destroy\"](this);\n }", "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "ngOnDestroy() {\n if (this._hs) {\n this._hs.unsubscribe();\n }\n }", "function destructor(event) {\n Logger.system.info(\"WINDOW LIFECYCLE:Shutdown:RouterClient:Shutting down.\");\n self.disconnectAll(); // this will let the router know the client is terminating\n }", "function terminate() {\n console.log('[client disconnected]', clientID);\n //stop sending metadata\n clearInterval(metadataTimer);\n //disconnect websocket if not already\n if (me.readyState === WebSocket.CONNECTING || me.readyState === WebSocket.OPEN) {\n me.terminate();\n }\n //clean up connections to channels\n for (const id of connectedChannels) {\n disconnect(id);\n }\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "destroy () {\n this.subscribers.forEach(subscriber => subscriber.unsubscribe());\n }", "onUnload(callback) {\n try {\n this.unsubscribeFromVolumioNotifications();\n // Here you must clear all timeouts or intervals that may still be active\n if (this.checkConnectionInterval) {\n clearInterval(this.checkConnectionInterval);\n this.checkConnectionInterval = null;\n }\n // terminate express http server\n this.httpServerInstance.close();\n callback();\n }\n catch (e) {\n callback();\n }\n }", "disconnectedCallback() {\n this.unsubscribeToMessageChannel();\n }", "destroy() {\n var _a;\n try {\n (_a = this.debug) === null || _a === void 0 ? void 0 : _a.call(this, 'destroyed');\n this.setHeartbeatInterval(-1);\n this.ws.close(1000);\n }\n catch (error) {\n this.emit('error', error);\n }\n }", "function unsubscribe() {\n EventClient.unsubscribe()\n }", "close() {\n this.connection.sendBeacon({type: 'disconnect', session: this.sessionId})\n this.messageSubscription.unsubscribe()\n clearTimeout(this.resendReportTimer)\n clearInterval(this.performPurgeTimer)\n clearTimeout(this.changeReportDebounceTimer)\n }", "handleWebsocketClosed() {\n this.reportCompleted();\n }", "unsubscribe(event) {\n if (this.connection) { \n return this.connection.unsubscribe(event)\n }\n return Promise.reject({code: 'qi-call/no-connection', message: 'Connection object not found.'})\n }", "unsubscribe() {\n if (this.subscriptions.length === 0) return;\n while (this.subscriptions.length > 0)\n this.subscriptions.pop().dispose();\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "disconnect () {\n if (this.isConnected()) {\n this.logEvent(`Closing IoT connection of client ${this.clientId}`);\n this.connection.end();\n // FIXME(ikajaste): Disconnect does stop events, but fails somehow - the connection remains:\n // (this.connection.connected returns true)\n } else {\n // debug\n this.logEvent(`Client ${this.clientId} is not connected, so no need to disconnect.`);\n }\n }", "onCompleted({ data }) {\n console.log('Deletion from server completed');\n }", "unsubscribe() {\n mainLog.info('Unsubscribing from Lightning gRPC streams')\n this.mainWindow = null\n Object.keys(this.subscriptions).forEach(subscription => {\n if (this.subscriptions[subscription]) {\n this.subscriptions[subscription].cancel()\n this.subscriptions[subscription] = null\n }\n })\n }", "unsubscribe() {\n this.subscriptions.forEach((unsub) => unsub());\n }", "cleanup() {\n if (this.broker) {\n this.broker.removeHandler(String(this.channelId), this);\n MessageChannel.pendingResponses.delete(this);\n\n this.message = null;\n this.broker = null;\n }\n }", "destroy() {\n logger.log({level: 'info', type: 'service', message: 'Destroying Service'});\n this.end = true;\n clearTimeout(this.pollInterval);\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "disconnected() {\n this.unsubscribe?.();\n delete this.unsubscribe;\n delete this.baseObject;\n delete this.property;\n delete this.replica;\n delete this.path;\n }", "removeSubscription(subscriptionId) {}", "sendTerminateEvent() {\n if (CallStats.backendInitialized) {\n CallStats.backend.sendFabricEvent(this.peerconnection, CallStats.backend.fabricEvent.fabricTerminated, this.confID);\n }\n\n CallStats.fabrics.delete(this);\n }", "unsubscribe() {\n this.client.unsubscribe(this.subscriptionID)\n this.currencyCollection.unsubscribe(this.render)\n this.currencyCollection.unsubscribe(this.drawInitialSparkLine)\n this.currencyCollection.unsubscribeFromSparkLineEvent(this.drawSparkLine)\n }", "destroy() {\n\t\tthis.stopListening();\n\t}", "destroy() {\n\t\tthis._listener.stopListening();\n\t}", "dispose() {\n\t\twhile(this._subscriptions.length) {\n\t\t\tthis._subscriptions.shift().unsubscribe();\n\t\t}\n\t}", "unsubscribe() {\n this.subscriptions.forEach((unsub) => unsub());\n this.subscriptions = [];\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "unsubscribe() {\n this.unsubscribeFunc()\n }", "disconnect() {\n console.log(\"disconnect!\");\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n this.onConnectionSuccess.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n this.onConnectionFailed.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n this.disconnect.bind(this)\n );\n\n this.disconnectedFunction();\n }", "function onEnding() {\n player.stop();\n\n Messages.messageReceived.disconnect(onMessageReceived);\n Messages.unsubscribe(ASSIGNMENT_MANAGER_CHANNEL);\n }", "function contextDisposedListener() {\n goog.log.warning(logger, 'Connection to the server app was shut down');\n context = null;\n stopWork();\n}", "function disconnect() {\n return subscribe('disconnect');\n }", "ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "onClientUnsubscribed(callback) {\n this.unsubCallback = callback;\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "function shutdown() {\n logger.trace('Shutting down');\n logger.trace('Closing web server');\n\n database.terminatePool()\n .then(function() {\n logger.trace('node-oracledb connection pool terminated');\n logger.trace('Exiting process');\n process.exit(0);\n })\n .catch(function(err) {\n logError('Error removing CQN subscriptions', err);\n logger.trace('Exiting process');\n process.exit(1);\n });\n}", "shutdown() {\n\t\tif (this.terminated) return; // already terminated\n\t\tthis.terminated = true;\n\t\tclearTimeout(this.reconnect_timer);\n\t\tthis.disconnect(new Error(`terminated`), true);\n\t}", "destroy() {\n if (this.active) {\n this.adapter.log.debug('Destroy ' + this.getName());\n this.active = false;\n clearTimeout(this.timerid);\n clearTimeout(this.autoupdateid);\n for (let messageId in this.qos) {\n if (this.qos[messageId].resendid) clearTimeout(this.qos[messageId].resendid);\n }\n this.qos = {};\n this.messageId = 1;\n this.states = {};\n this.device = {};\n this.http = {};\n this.ip = undefined;\n this.id = undefined;\n this.devicename = undefined;\n this.devicetype = undefined;\n this.deviceid = undefined;\n this.serialid = undefined;\n this.deviceexist = undefined;\n this.mqttprefix = undefined;\n this.onlineCheck('stop');\n if (this.client) {\n this.client.removeAllListeners();\n this.client.destroy();\n }\n }\n }", "disconnected(state){\n\t\tif(this.heartbeat) this.heartbeat.destroy();\n\t\tif(this.listenChannel) this.listenChannel.unsubscribe();\n\t}", "function receiverOnFinish() {\n this[kWebSocket$1].emitClose();\n}", "endConnection() {\n this.connection.end()\n }", "async onDeleted() {\n this.log('device deleted', this.getName(), this.settings.serialNumber);\n this.client && this.client.end();\n this.timeout && clearTimeout(this.timeout);\n this.shouldSync = false;\n this.setUnavailable();\n }", "function unsubscribeKPNS() {\n var sub = {\n \"appId\": appID,\n \"ksid\": ksid,\n \"deviceId\": deviceID\n };\n var inp = {\n \"subscriptionService\": {\n \"unsubscribe\": sub\n }\n };\n var myhttpheaders = {\n \"Content-Type\": \"application/json\"\n };\n var paramTab = {\n postdata: JSON.stringify(inp),\n httpheaders: myhttpheaders\n };\n var url = kpnsURL + \"/subscription\";\n kony.net.invokeServiceAsync(url, paramTab, KPNSunregCallback);\n}", "function onSessionEnded(sessionEndedRequest, session) {\r\n \r\n\r\n // Add any cleanup logic here\r\n}", "onTerminate() {}", "cleanup(sub) {\n if (sub.isOnce && sub.isExecuted) {\n let i = this._subscriptions.indexOf(sub);\n\n if (i > -1) {\n this._subscriptions.splice(i, 1);\n }\n }\n }", "destroy() {\n\t\t/**\n\t\t * @event Resource.destroy\n\t\t * Called whenever the resource is about to be destroyed\n\t\t */\n\t\tthis.emit(\"destroy\");\n\t\tthis.removeAllListeners();\n\t}", "function onSessionEnded(sessionEndedRequest, session) {\n // console.log(\"onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}\");\n // Add cleanup logic here\n}", "function receiverOnFinish () {\n this[kWebSocket].emitClose();\n}", "function receiverOnFinish () {\n this[kWebSocket].emitClose();\n}", "deactivate() {\n this.subscriptions.dispose();\n }", "deactivate() {\n this.subscriptions.dispose();\n }", "destroy() {\n this._service.destroy();\n this._sentmsg = {};\n }", "unsubAll () {\n this._subscribers.clear()\n }", "async unsubscribe() {\n var subscription = await this.getSubscription();\n if (subscription) {\n subscription.unsubscribe().then(subscription => {\n console.log('Unsubscribed', subscription.endpoint);\n return subscription;\n });\n return await fetch(this.params.UNREGISTRATION_URL, {\n method: 'post',\n headers: {'Content-type': 'application/json', Accept: 'application/json'},\n body: JSON.stringify({subscription,}),\n }).then(response => response.json()).then(response => {\n console.log('Unsubscribed with Notifications server', response);\n return response;\n });\n }\n }", "disconnect(){}", "function receiverOnFinish() {\n this[kWebSocket].emitClose();\n}", "function receiverOnFinish() {\n this[kWebSocket].emitClose();\n}", "destroy(){\n log.silly('Session.destroy:', `Session ${this.name}`);\n let deleted = 0;\n let ret = 1;\n\n for(let stage of this.get_stages()){\n // dump(stage, 1);\n\n if(stage.status === 'RETRYING'){\n log.silly('Session.end:', `${this.name}:`,\n `stage: ${stage.origin}:`,\n `Stage retrying, not removing`);\n ret = 0;\n continue;\n }\n\n // status is CONNECTED, DISCONNECTED, or END\n log.silly('Session.destroy:', `${this.name}:`,\n `Stage: \"${stage.origin}\"/${stage.status}:`,\n `Ending stage`);\n let stream = stage.stream;\n try{\n if(stage.on_disc){\n // // log.info('end:', stream.listenerCount(\"end\"));\n // stream.removeListener(\"end\", stage.on_disc[\"end\"]);\n // // log.info('end:', stream.listenerCount(\"end\"));\n\n // log.info('close:', stream.listenerCount(\"close\"));\n stream.removeListener(\"close\", stage.on_disc[\"close\"]);\n // log.info('close:', stream.listenerCount(\"close\"));\n\n // log.info('error:', stream.listenerCount(\"error\"));\n stream.removeListener(\"error\", stage.on_disc[\"error\"]);\n // log.info('error:', stream.listenerCount(\"error\"));\n }\n if(stage.status !== 'END' && stream){\n stream.end();\n // stream.destroy();\n deleted++;\n }\n } catch(err){\n log.info(`Session.destroy: ${this.name}: Could not terminate stage:`,\n `\"${stage.origin}\"/${stage.status}:`, dumper(err, 3));\n }\n\n stage.status = 'END';\n }\n\n log.verbose('Session.destroy:', `${this.name}:`,\n `deleted ${deleted} streams`);\n this.status = 'DESTROYED';\n\n this.events.push({ event: 'DESTROY',\n timestamp: new Date().toISOString(),\n message: \"Session destroyed\",\n content: ''});\n\n if(this.track){\n log.silly('Session.destroy:', `${this.name}:`,\n `Tracking session for ${this.track} seconds`);\n setTimeout(() => this.emit('destroy'), this.track * 1000);\n } else {\n this.emit('destroy');\n }\n\n // return OK if no stage is retrying\n return ret;\n }", "_completeExit() {\n this._ngZone.onMicrotaskEmpty.pipe(take(1)).subscribe(() => {\n this._ngZone.run(() => {\n this._onExit.next();\n this._onExit.complete();\n });\n });\n }", "onDeleted() {\n\t\t\tthis.removeAllListeners();\n\t\t\tthis.signal.unregister(this);\n\t\t\tthis.signal.removeListener('data', this._onDataListener);\n\t\t\tthis.signal = null;\n\t\t}", "function cleanup(hConn,hObj) {\n mq.Close(hObj, 0, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n //console.log(\"MQCLOSE successful\");\n }\n mq.Disc(hConn, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n //console.log(\"MQDISC successful\");\n }\n });\n });\n}", "stop() {\n if (!this._interval) {\n throw new Error('The FirebaseSubscriptionService was stopped when it was not running');\n }\n clearInterval(this._interval);\n this._subscriptions.forEach(subscription => {\n subscription.unsubscribe();\n this._removeSubscription(subscription);\n });\n this._interval = null;\n }", "end() {\n\t\tthis.Vars._Status = strings.getString(\"Terms.ShuttingDown\")\n\t\tthis.Vars._event = 'ShuttingDown'\n\t\tthis.Vars._displayStatusMessage = true\n\t\tupdateSession(this.ID)\n\t\tthis.Session.stdin.write('\\nshutdown\\n');\n\t}", "function Terminate() {\n\tterminateCommunication();\n}", "function cleanup(hConn,hObj) {\n mq.Close(hObj, 0, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n console.log(\"MQCLOSE successful\");\n }\n mq.Disc(hConn, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n console.log(\"MQDISC successful\");\n }\n });\n });\n}", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n\n this._disconnect();\n }", "_destroy() {\r\n\t\tif (this._interval) clearInterval(this._interval)\r\n\t\tthis._internalStream.removeAllListeners()\r\n\t\tthis._internalStream = null\r\n\t\tthis._destroyed = true\r\n\t}", "onMessagesRemoved() {}", "disconnectedCallback() { \n this.remove();\n //this.disconnectObserver();\n }", "stop() {\n server.logoutConnection(this.connection, this.user);\n }", "onCallEnded() {\n if (this._channel) {\n // The BridgeChannel is not explicitly closed as the PeerConnection\n // is closed on call ended which triggers datachannel onclose\n // events. If using a WebSocket, the channel must be closed since\n // it is not managed by the PeerConnection.\n // The reference is cleared to disable any logic related to the\n // channel.\n if (this._channel && this._channel.mode === 'websocket') {\n this._channel.close();\n }\n\n this._channel = null;\n }\n }", "onEnd() {\n this.requestQueueLength--;\n if (this.requestQueueLength || !this.callbacks.onEnd) {\n return;\n }\n this.callbacks.onEnd(this.requestQueueLength);\n }", "handleServerStop() {\n this.activeStartingResource = null;\n this.activeStartingTime = null;\n }", "function handleRedisEnd() {\n debug(\"Redis: connection to server lost.\");\n}" ]
[ "0.80204034", "0.7148923", "0.6761779", "0.6729372", "0.66981536", "0.6585904", "0.6566137", "0.6556459", "0.6505515", "0.6466902", "0.6440199", "0.6437818", "0.642988", "0.6426252", "0.64025134", "0.63683915", "0.6368129", "0.63636863", "0.63636863", "0.63636863", "0.6363267", "0.63061094", "0.629543", "0.62901586", "0.6280055", "0.6244034", "0.62367505", "0.6229171", "0.62214446", "0.6216794", "0.62064785", "0.6201467", "0.61911535", "0.6188872", "0.6188872", "0.61871755", "0.6184353", "0.61350834", "0.61319476", "0.61282194", "0.6119615", "0.61191356", "0.61182994", "0.6110495", "0.6105051", "0.6100551", "0.6098126", "0.6096222", "0.6095405", "0.6084855", "0.60822034", "0.6082188", "0.60780823", "0.6054356", "0.6052016", "0.6041473", "0.60315514", "0.60094553", "0.6003649", "0.6003649", "0.6003649", "0.5981262", "0.5979756", "0.5979515", "0.5971555", "0.5967296", "0.5962472", "0.5955983", "0.5954924", "0.5936832", "0.593093", "0.59302324", "0.59293884", "0.5927379", "0.5925982", "0.5925982", "0.59250814", "0.59250814", "0.59215236", "0.5919558", "0.5917899", "0.5913624", "0.59066147", "0.59066147", "0.59017634", "0.5894259", "0.5892484", "0.58919823", "0.5891474", "0.58894503", "0.58876383", "0.58867925", "0.58826375", "0.5878207", "0.5875613", "0.58705884", "0.58675766", "0.5867182", "0.5866785", "0.5844387", "0.58423764" ]
0.0
-1
Showing time and date with leading zeros if necessary / Could have been a single function with different variables. Might change that later
function minutes_with_leading_zeros(dt) { return (dt.getMinutes() < 10 ? '0' : '') + dt.getMinutes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatTime(time) {\n return (time < 10) ? `0${time}` : time;\n }", "formatTime(time) {\n return (time >= 10) ? time : `0${time}`;\n }", "function addLeadingZeroes(time) {\n if (time < 10) {\n return `0${time}`;\n } else {\n return time;\n }\n }", "function addLeadingZeroes(time) {\n return time < 10 ? `0${time}` : time\n }", "function addLeadingZeroes(time) {\n return (time < 10 ? `0${time}` : time)\n }", "function addLeadingZeroes(time) {\n return time < 10 ? `0${time}` : time;\n }", "function timedisplay (num) {\n\tvar ret='';\n\tif (num <0){ \n\t\tnum = -num;\n\t\tret +='-'\n\t};\n\tvar timestamp = new Date(num - num%1000);\n\tvar s = timestamp.getSeconds();\n\tvar i = timestamp.getMinutes();\n\tvar h = (timestamp - s*1000 - i*60000)/3600000;\n\tret +=(h<10?'0'+h : h)+':';\n\tret +=(i<10?'0'+i : i)+':';\n\tret +=(s<10?'0'+s : s);\n\treturn ret;\n}", "helper(time){\n time = time.toString()\n if(time.length == 1) return `0${time}`\n else return time\n }", "function display_time(n){\n return n > 9 ? \"\" + n: \"0\" + n;\n}", "function LeadingZero(Time) {\n\treturn (Time < 10) ? \"0\" + Time : + Time; \n}", "function FormatTime(time)\n{\n \n if (time < 10)\n {\n time= '0'+time;\n }\n return time; \n}", "function formatTime(time) {\n if (time < 10) {\n time = \"0\" + time;\n }\n return time;\n }", "function leadingZeroes(time){\n if(time<=9){\n time=\"0\"+time;\n }\n return time;\n}", "function leadingZero(time) {\n if(time <= 9){\n return \"0\" + time;\n }\n else {\n return time;\n }\n}", "function formatTime(time) {\n if (time > 9) {\n return time;\n } else {\n return \"0\" + time;\n }\n }", "function formatTime(time) {\r\n if ( time < 10 ) {\r\n return '0' + time;\r\n }\r\n return time;\r\n}", "function formatTime(time) {\r\n return time < 10 ? `0${time}` : time;\r\n}", "function format(time){\n return time < 10 ? \"0\"+time : time;\n}", "function LeadingZero(Time) {\n\t\t\treturn (Time < 10) ? \"0\" + Time : + Time;\n\t\t}", "function timeFormat(time) {\n return time < 10 ? \"0\"+time : time;\n }", "function leadingZero(time) {\n if (time <= 9) {\n time = \"0\" + time;\n }\n return time;\n }", "formatTime(n) {\n if ((n + '').length > 2) {\n\treturn n;\n }\n const padding = new Array(2).join('0');\n return (padding + n).slice(-2);\n }", "function leadingZero(time) {\r\n if (time <= 9) {\r\n time = \"0\" + time;\r\n }\r\n return time;\r\n}", "function leadingZero(time) {\r\n if (time < 10) {\r\n time = '0' + time;\r\n }\r\n return time;\r\n}", "function formatTime(time) {\n return time >= 10 ? time : `0${time}`;\n}", "stringifyTime(t) {\n return (t < 10) ? '0' + t : t;\n }", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function leadingZero(time) {\n if(time <= 9) {\n time = \"0\" + time;\n }\n return time;\n}", "function leadingZero(time){\n \n if (time<=9){\n time = \"0\" + time;\n }\n return time;\n}", "function leadingZero(time) {\n if (time <= 9) {\n time = \"0\" + time;\n }\n return time;\n}", "function leadingZero(time) {\r\n if (time<=9) {\r\n time = '0' + time; \r\n }\r\n return time;\r\n}", "function formatNum(time) {\n if (time < 10) {\n return \"0\" + time;\n }\n else {\n return time;\n }\n}", "function niceTime (d) {\n\t\treturn prepend0(d.getHours()) + \":\" + prepend0(d.getMinutes()) + \":\" + prepend0(d.getSeconds());\n\t}", "function formatTime(x) {\r\n\tif (x < 10) {\r\n\t\tx = \"0\" + x;\r\n\t}\r\n\treturn x;\r\n}", "function helper(time) {\n if (time < 9) time = \"0\" + time;\n return time;\n}", "function formatTime(t) {\n\tif (t < 10) {t = '0' + t}; \n\treturn t;\n}", "function formatDate(dateVar){\n\tif(dateVar < 10) {\n\t\treturn dateVar = \"0\" + timeVar;\n\t}else{\n\t\treturn dateVar;\n\t}\n}", "_displayTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n seconds = seconds > 9 ? seconds : `0${seconds}`;\n return `${minutes}:${seconds}`;\n }", "function leadingZero(time)\n{\n if (time <= 9)\n {\n time = \"0\" + time; // converts time to a string and adds a zero in front of it.\n }\n return time;\n}", "function printDate(time) {\n var date = time ? new Date(time) : new Date();\n return date.toLocaleString();\n}", "function formatDateWithZeros(year, month, day, separator)\r\n {\r\n if (month < 10) month = \"0\"+month;\r\n if (day < 10) day = \"0\"+day;\r\n return year+separator+month+separator+day;\r\n }", "function addZeros(time) {\r\n if (time <= 9) {\r\n time = \"0\" + time;\r\n }\r\n return time;\r\n}", "function addZero(time){\n return (time < 10 ? \"0\" : \"\") + time;\n}", "function fancyTimeFormat(time)\n{ \n // Hours, minutes and seconds\n var hrs =Math.floor(time / 3600);\n var mins = Math.floor((time % 3600) / 60);\n var secs = time % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function data_time(){\r\n var current_datatime = new Date();\r\n var day = zero_first_format(current_datatime.getDate());\r\n var month = zero_first_format(current_datatime.getMonth()+1);\r\n var year = zero_first_format(current_datatime.getFullYear());\r\n var hours = zero_first_format(current_datatime.getHours());\r\n var minutes = zero_first_format(current_datatime.getMinutes());\r\n var seconds = zero_first_format(current_datatime.getSeconds());\r\n\r\n return day+\".\"+month+\".\"+year+\".\"+hours+\".\"+minutes+\".\"+seconds;\r\n\r\n}", "function get_timestr() { \n\tvar d = new Date();\n\treturn d.toLocaleString() + \"<br />\\n\";\n}", "function formatDate(date) {\r\n return date.getFullYear().toString() + (date.getMonth() + 1).toString().padStart(2, '0') + date.getDate().toString() \r\n + date.getHours().toString().padStart(2, '0') + date.getMinutes().toString().padStart(2, '0');\r\n }", "function formatTime(t) {\n return padZeros(t.getHours(), 2) + ':' + padZeros(t.getMinutes(), 2) + ':' + padZeros(t.getSeconds(), 2);\n}", "function displayTime() {\n var str = \"\";\n\n var currentTime = new Date()\n var hours = currentTime.getHours()\n var minutes = currentTime.getMinutes()\n var seconds = currentTime.getSeconds()\n\n if (minutes < 10) {\n minutes = \"0\" + minutes\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds\n }\n str += hours + \":\" + minutes + \":\" + seconds + \" \";\n if(hours > 11){\n str += \"PM\"\n } else {\n str += \"AM\"\n }\n return str;\n}", "function printTimedisplayFromTimeobject (timeobject) {\n printTimedisplay(zeroPad(timeobject.hours, 2),\n zeroPad(timeobject.minutes, 2),\n zeroPad(timeobject.seconds, 2),\n zeroPad(timeobject.milliseconds, 3));\n}", "function pad(time){\n if(time < 10){\n return \"0\" + time;\n }\n return time;\n}", "function getHoursWithLeadingZeros (currentDateAndTime) {\n return (currentDateAndTime.getHours() < 10 ? \"0\" : \"\") + currentDateAndTime.getHours()\n }", "function prettyDate() {\n var theTimeIsNow = new Date(Date.now());\n var hors = theTimeIsNow.getHours();\n var mens = theTimeIsNow.getMinutes();\n var sex = theTimeIsNow.getSeconds();\n return hors + \":\" + mens + \":\" + sex;\n }", "function missingZero(time) {\n if (time <= 9) {\n time = \"0\" + time;\n }\n return time;\n}", "function editTime(time){\r\n if((time.toString()).length === 1){\r\n return '0' + time;\r\n } else {\r\n return time.toString();\r\n }\r\n}", "function showTime() {\n\n let date = new Date();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n //AM/PM format\n let formatHours = convertFormat(hours);\n\n //!2400HR format\n hours = checkTime(hours);\n\n //addZero before single numbers\n hours = addZero(hours);\n minutes = addZero(minutes);\n secondss = addZero(seconds);\n\n document.getElementById('clock').innerHTML = `${hours} : ${minutes} : ${seconds} ${formatHours}`;\n}", "function updateTime(){\n\n var usaDate = new Date();\n document.getElementById('date').innerHTML = usaDate.getDate() + ' / ' + (usaDate.getMonth()+1) + ' / ' + (usaDate.getFullYear()+47);\n document.getElementById('time').innerHTML = addLeadingZero(changeTimeZero(usaDate.getHours()-9)) + ' : ' + addLeadingZero(usaDate.getMinutes()) + ' : ' + addLeadingZero(usaDate.getSeconds());\n function addLeadingZero(number){\n if (number < 10) {\n number = '0'+ number;\n }\n return number;\n }\n\n function changeTimeZero(time){\n if (time < 0) {\n time = 24 + time;\n }\n return time;\n }\n\n}", "function displayDateandTime() {\n let date = new Date();\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear();\n let hour = date.getHours();\n let minute = date.getMinutes();\n const dateandtime = `${day}/${month}/${year} ${hour}:${minute}`;\n return dateandtime;\n\n}", "function padTime(time) {\n return time.toString().padStart(2, '0');\n}", "function formatTime(thisTime)\n{\n toReturn = thisTime.slice(8,10) + \":\" + thisTime.slice(10,12) + \", \";\n toReturn += thisTime.slice(6,8) + \".\" + thisTime.slice(4,6) + \".\" + thisTime.slice(0,4);\n return toReturn;\n}", "function printDate()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_date.innerHTML = time.day + '.' + time.monthNameShort + ' ' + time.year;\n\t}", "function formatTime (digit){\n return (digit < 10) ? \"0\" + digit : digit.toString();\n }", "function getNewTimeDisplay(time){\n if(isNaN(time))\n return \"00:00\";\n time=parseInt(time)\n var minutes = Math.floor( time / 60 );\n var seconds = time % 60;\n minutes = minutes < 10 ? '0' + minutes : minutes;\n seconds = seconds < 10 ? '0' + seconds : seconds;\n if (minutes==\"NaN\" && seconds==\"NaN\"){\n return \"00:00\";\n }\n return minutes + \":\" + seconds; \n}", "function fancyTimeFormat(time)\r\n\t\t{ \r\n \t\tvar hrs = ~~(time / 3600);\r\n \t\tvar mins = ~~((time % 3600) / 60);\r\n \t\tvar secs = time % 60;\r\n\t\t\tvar ret = \"\";\r\n \t\tif (hrs > 0) {\r\n \tret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\r\n \t\t}\r\n \t\tret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\r\n \t\tret += \"\" + secs;\r\n \t\treturn ret;\r\n\t\t}", "function formatTimeStamp() {\n var sendTime = Date().slice(16,21)\n var sendHour = sendTime.slice(0, 2)\n var pm = sendHour > 11 && sendHour < 24 ? true : false\n\n if (sendHour > 12) {\n sendHour = sendHour % 12\n }\n return sendHour + sendTime.slice(2) + (pm ? \" PM\" : \" AM\");\n}", "function date2str(date) {\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n }", "function format_time_output(time) {\n var h = 0; \n var m = 0;\n var s = 0;\n var ms = 0;\n var formated_time;\n\n h = Math.floor( time / (60 * 60 * 1000) );\n time = time % (60 * 60 * 1000);\n m = Math.floor( time / (60 * 1000) );\n time = time % (60 * 1000);\n s = Math.floor( time / 1000 );\n ms = time % 1000;\n\n newTime = pad(h, 2) + ':' + pad(m, 2) + ':' + pad(s, 2) + ':' + pad(ms,3);\n return newTime;\n}", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 'sn.';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400));\r\n m.push ('Gün');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600));\r\n m.push ('Saat ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60));\r\n m.push ('Dk.');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('sn.'); \r\n }\r\n return m.join ('');\r\n}", "function formatTime() {\n var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var displayHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var inverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n // Bail if the value isn't a number\n if (!is$1.number(time)) {\n return formatTime(undefined, displayHours, inverted);\n } // Format time component to add leading zero\n\n\n var format = function format(value) {\n return \"0\".concat(value).slice(-2);\n }; // Breakdown to hours, mins, secs\n\n\n var hours = getHours(time);\n var mins = getMinutes(time);\n var secs = getSeconds(time); // Do we need to display hours?\n\n if (displayHours || hours > 0) {\n hours = \"\".concat(hours, \":\");\n } else {\n hours = '';\n } // Render\n\n\n return \"\".concat(inverted && time > 0 ? '-' : '').concat(hours).concat(format(mins), \":\").concat(format(secs));\n }", "formatTime(time) {\n time = parseInt(time, 10);\n if (time < 10) return '0' + time;\n return time;\n }", "function timeString(){\r\n var date = new Date()\r\n var current_hour = date.toLocaleString()\r\n current_hour = pad(current_hour, 23, 1, \" \")\r\n return current_hour\r\n}", "function displayTime (){\n\tif(mins<10){\n\t\tmins=\"0\"+mins;\n\t}\n\tif(secs<10){\n\t\tsecs=\"0\"+secs;\n\t}\n\t$('#mins').html(mins);\n\t$('#secs').html(secs);\n}", "function timeSetFormat(time){\r\n let tempArr = time.split(\":\");\r\n for(var i=0; i<tempArr.length; i++){\r\n tempArr[i] = +tempArr[i];\r\n }\r\n tempArr = roundTime(tempArr);\r\n\r\n //reformat by adding starting 0's\r\n if(tempArr[1] == '0'){\r\n tempArr[1] = '00';\r\n }\r\n if(tempArr[0] < 10){\r\n tempArr[0] = '0' + tempArr[0];\r\n }\r\n\r\n tempArr = tempArr.join(':');\r\n return tempArr;\r\n}", "function customed_display(enddate) {\n var add_one = enddate.slice(-2)\n add_one = Number(add_one)-1\n add_one = add_one + ''\n\n if (add_one.length == 1) {\n add_one = '0' + add_one\n }\n\n return enddate.slice(0, -2) + add_one\n}", "function timeString(num) {\n return (num < 10 ? '0' : '') + num;\n }", "function fullTimestamp(inTime) {\n var colonSplit1 = inTime.split(\" \");\n var colonSplit2 = inTime.split(\":\");\n var colonSplit3 = inTime.split(\".\");\n if (colonSplit1.length == 1) {\n inTime = inTime + \" 0:0:0.0\";\n } else if (colonSplit1.length == 2 && colonSplit2.length == 1 && colonSplit3.length == 1) {\n inTime = inTime + \":0:0.0\";\n } else if (colonSplit1.length == 2 && colonSplit2.length == 2 && colonSplit3.length == 1) {\n inTime = inTime + \":0.0\";\n } else if (colonSplit1.length == 2 && colonSplit2.length == 3 && colonSplit3.length == 1) {\n inTime = inTime + \".0\";\n }\n //alert(inTime);\n return inTime;\n}", "function displayTime(dateob) {\n var hours = dateob.getHours(); //Current Hours\n var min = dateob.getMinutes(); //Current Minutes\n var base12Hour = hours % 12 !== 0 ? hours % 12 : 12;\n if (min < 10) {\n min = \"0\" + min;\n }\n var meridian = hours < 12 ? \"AM\" : \"PM\";\n return base12Hour + \":\" + min + \" \" + meridian;\n}", "function formatDate(date) {\n var result = '';\n result = result+date.getFullYear()+'-';\n if(date.getMonth()+1 < 10) {\n result = result+'0';\n }\n result = result+(date.getMonth()+1);\n result = result+'-';\n if(date.getDate() < 10) {\n result = result+'0';\n }\n result = result+date.getDate();\n result = result+'T';\n if(date.getHours() < 10) {\n result = result+'0';\n }\n result = result+date.getHours()+':';\n if(date.getMinutes() < 10) {\n result = result +'0';\n }\n result = result+date.getMinutes()+':';\n if(date.getSeconds() < 10) {\n result = result+'0';\n }\n result = result+date.getSeconds();\n return result;\n}", "formatDate(date) {\n return date.getHours() + ':' + '0' + date.getMinutes();\n }", "function formatDate(date) {\r\n function pad(n) {\r\n return n >9 ? n : \"0\" + n;\r\n }\r\n\r\n return [ date.getUTCFullYear(), \"-\", pad(date.getUTCMonth() + 1), \"-\",\r\n pad(date.getUTCDate() + 1), \"T\", pad(date.getUTCHours()), \":\",\r\n pad(date.getUTCMinutes()) ].join(\"\");\r\n }", "function displayDateAndTime() {\n return new Date();\n}", "function formatOutput(days, hours, mins, secs) {\n if (days < 10) {days = \"0\" + days;}\n if (hours < 10) {hours = \"0\" + hours;}\n if (mins < 10) {mins = \"0\" + mins;}\n if (secs < 10) {secs = \"0\" + secs;}\n return {\n 'days': days,\n 'hours': hours,\n 'mins': mins,\n 'secs': secs\n };\n}", "function displayTime() {\n var today = new Date();\n \n //gathers information about current hour, min and sec. \n //Add zero at the head if it is a single digit number.\n var currentHour = addZero(today.getHours());\n var currentMin = addZero(today.getMinutes());\n var currentSec = addZero(today.getSeconds());\n \n // for formatting the display.\n hourElement.innerHTML = currentHour + \":\";\n minElement.innerHTML = currentMin + \":\";\n secElement.innerHTML = currentSec;\n }", "function dateAndTimeToString(date){\n\tvar ans = date.getHours()+\":\"+date.getMinutes()+ \" \" + (parseInt(date.getMonth()) + 1) + \"/\" + date.getDate() + \"/\"+ date.getFullYear();\n\treturn ans;\n}", "function displayDate() {\n var d = new Date();\n\n let month = String(d.getMonth() + 1);\n let day = String(d.getDate());\n const year = String(d.getFullYear());\n\n let hours = String(d.getHours());\n let minutes = String(d.getMinutes());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n if (hours.length < 2) hours = '0' + hours;\n if (minutes.length < 2) minutes = '0' + minutes;\n\n return `${day}/${month}/${year} ${hours}:${minutes}`;\n}", "function formatTime(arr) {\n\t\tvar str = '';\n\t\tarr.forEach(function(a, i) {\n\t\t\tstr += (i === 0 ? '' : ':') + ('0' + a).slice(-2);\n\t\t});\n\t\treturn str;\n\t}", "function formatTimeElement(date) {\n\th = date.getHours();\n\tm = date.getMinutes();\n\ts = date.getSeconds();\n\tif (m < 10)\n\t\tm = `0${m}`;\n\tif (s < 10)\n\t\ts = `0${s}`;\n\treturn `${h}:${m}:${s}`;\n}", "function FormatTime(t){\n t = new Date(t)\n let year = t.getFullYear()\n let month = t.getMonth()+1\n let date = t.getDate()<10?('0'+t.getDate()):t.getDate()\n let hour = t.getHours()<10?('0'+t.getHours()):t.getHours()\n let minute = t.getMinutes()<10?('0'+t.getMinutes()):t.getMinutes()\n let second = t.getSeconds()<10?('0'+t.getSeconds()):t.getSeconds()\n //2020-09-16 00:00:00\n return year+'-'+month+'-'+date+' '+hour+':'+minute+':'+second\n}", "setDisplayDateTime() {\n this.displayDate = this.currentDate.toLocaleDateString(this._locale, {\n day: '2-digit',\n month: 'long',\n year: 'numeric'\n });\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale);\n }", "function leadingZero(time) {\n if (time <= 9) {\n // we are adding string to a int value. Javascript is flexiable. Later, if we need to use it as int, it will work as int as it is still a number \n time = \"0\" + time;\n }\n return time;\n}", "function reportTime(){\n const date = new Date();\n const {time, mode} = getTime();\n const reportTime = `${time} ${mode} ${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()}`;\n return reportTime ;\n}", "formatTime(time) {\r\n var timeString = \"\";\r\n if (time < 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 AM\";\r\n } else {\r\n timeString = time + \"0 AM\";\r\n }\r\n } else if (time === 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n } else {\r\n time = (time - 1200) / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n }\r\n return timeString;\r\n }", "function formatTime(){\n let time = new Date(),\n minutes = time.getMinutes().toString().length == 1 ? '0'+time.getMinutes() : time.getMinutes(),\n hours = time.getHours().toString().length == 1 ? '0'+time.getHours() : time.getHours(),\n ampm = time.getHours() >= 12 ? 'pm' : 'am',\n months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],\n days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\n return days[time.getDay()]+' '+months[time.getMonth()]+' '+time.getDate()+' '+time.getFullYear()+' '+hours+':'+minutes+ampm;\n }", "function displayTime() {\n var str = \"\";\n\t//What this does is pretty straight forward:\n\t//Grab a Date object\n var currentTime = new Date()\n\t//Extract hours, minutes and seconds out of it\n var hours = currentTime.getHours()\n var minutes = currentTime.getMinutes()\n var seconds = currentTime.getSeconds()\n\t//If we have less than 10 minutes on the clock, prefix it with a zero to have a \n\t//handy dandy standard format\n if (minutes < 10) {\n minutes = \"0\" + minutes\n }\n\t//Same for seconds\n if (seconds < 10) {\n seconds = \"0\" + seconds\n }\n\t//It uses A.M. and P.M. Time format for the hours, so we need to add this\n str += hours + \":\" + minutes + \":\" + seconds + \" \";\n if(hours > 11){\n str += \"PM\"\n } else {\n str += \"AM\"\n }\n\t//and aaawwaaaaayyyyy we go!\n return str+\"\";\n}", "function formatDateNums(date) {\n date = date.toString();\n return date.length < 2 ? `0${date}` : `${date}`;\n}", "function formatTime(i)\r\n{\r\n\tif (i < 10) {\r\n\t\ti = \"0\" + i;\r\n\t}\r\n\r\n\treturn i;\r\n}", "function formatTime(timeLeft) {\n return (timeLeft < 10 ? \"0\" + timeLeft : \"\" + timeLeft);\n}", "function displayTime(time) {\n let minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n minutes = minutes > 9 ? minutes : `0${minutes}`;\n seconds = seconds > 9 ? seconds : `0${seconds}`;\n return `${minutes}:${seconds}`;\n}", "function formatTime(date, full) {\n let time = '';\n time += date.getDate() < 10 ? `0${date.getDate()}-` : `${date.getDate()}-`;\n const month = date.getMonth() + 1;\n time += month < 10 ? `0${month}-` : `${month}-`;\n time += `${date.getFullYear()}`;\n if (!full) return time;\n time += date.getHours() < 10 ? ` 0${date.getHours()}:` : ` ${date.getHours()}:`;\n time += date.getMinutes() < 10 ? `0${date.getMinutes()}:` : `${date.getMinutes()}:`;\n time += date.getSeconds() < 10 ? `0${date.getSeconds()}` : `${date.getSeconds()}`;\n return time;\n }", "function getTime() {\n\tOutput('<span>It\\'s the 21st century man! Get a SmartWatch</span></br>');\n}" ]
[ "0.7260968", "0.7256906", "0.7228072", "0.7226984", "0.7179556", "0.7161993", "0.71199846", "0.7081905", "0.70445406", "0.70263195", "0.69964427", "0.6972579", "0.6970238", "0.69692755", "0.6968216", "0.69618696", "0.69533634", "0.6921472", "0.6918976", "0.6884001", "0.68803084", "0.6869419", "0.6843924", "0.6829731", "0.6821091", "0.6820388", "0.677906", "0.67698586", "0.67619956", "0.6761207", "0.67547643", "0.67228204", "0.6719998", "0.66737", "0.66618514", "0.6641264", "0.6624269", "0.6613663", "0.65986896", "0.65982705", "0.6562846", "0.6562842", "0.65555316", "0.6539867", "0.6538799", "0.6519109", "0.6509598", "0.6509067", "0.6498507", "0.6492133", "0.6490051", "0.6488968", "0.6479155", "0.64753926", "0.64626986", "0.64607793", "0.64515334", "0.64439523", "0.6436634", "0.6424336", "0.6422948", "0.64203864", "0.6411658", "0.6403602", "0.640274", "0.64018244", "0.6384838", "0.63800484", "0.6374206", "0.6373272", "0.63723916", "0.63723063", "0.6371539", "0.6368642", "0.6362464", "0.63589543", "0.63490367", "0.6349036", "0.63440335", "0.6340876", "0.6339705", "0.6336019", "0.63349634", "0.63325167", "0.6324577", "0.6316176", "0.6316141", "0.6311942", "0.63023525", "0.63021094", "0.62968576", "0.62954533", "0.6294531", "0.6291791", "0.62898105", "0.62892246", "0.62875885", "0.6284385", "0.62810004", "0.6280739", "0.6280175" ]
0.0
-1
Update the progress of the circle and the values
function updateCircle(){ steps.text = today.adjusted.steps; cals.text = today.adjusted.calories; floors.text = today.adjusted.elevationGain; batteryp.text = battery.chargeLevel; csteps = today.adjusted.steps; ccals = today.adjusted.calories; cfloors = today.adjusted.elevationGain; if(csteps > goal){ cone = 360; }else{ cone = (csteps / goalo)*3.6; }; if(ccals > goalc){ ctwo = 360; }else{ ctwo = (ccals / goalt)*3.6; }; if(cfloors > goalf){ cthree = 360; }else{ cthree = (cfloors / goalth)*3.6; }; arcSweep.sweepAngle = cone; arcSweepC.sweepAngle = ctwo; arcSweepF.sweepAngle = cthree; arcSweepB.sweepAngle = battery.chargeLevel * 3.6; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProgressCircle(circle, percent){\n circle.removeClass('p'+ percent -1).addClass('p' + percent);\n circle.find('span').text(percent + '%');\n}", "function updateProgress() {\n // To Update Progress Circle\n circles.forEach((circle, index) => {\n if (index < currentActive) {\n circle.classList.add(\"active\");\n } else {\n circle.classList.remove(\"active\");\n }\n });\n\n // To Update Progress Line\n const actives = document.querySelectorAll(\".active\");\n\n progress.style.width =\n ((actives.length - 1) / (circles.length - 1)) * 100 + \"%\";\n\n if (currentActive === 1) {\n prev.disabled = true;\n } else if (currentActive === circles.length) {\n next.disabled = true;\n } else {\n prev.disabled = false;\n next.disabled = false;\n }\n}", "function updateProgress (){\n\tprogress.value += 30;\n}", "_updateProgress() {\n super._updateProgress();\n\n const that = this,\n radius = that.indeterminate ? Math.PI * 100 : Math.PI * 100 - that._percentageValue * Math.PI * 100,\n isIE = /*@cc_on!@*/false || !!document.documentMode,\n isEdge = !isIE && !!window.StyleMedia;\n\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n //Check if the browser is Edge to make the animation\n if (isIE || isEdge) {\n if (that.value === null || that.indeterminate) {\n that.$.value.style.strokeDashoffset = '';\n that.$.value.setAttribute('class', 'jqx-value jqx-value-animation-ms');\n return;\n }\n else {\n that.$.value.setAttribute('class', 'jqx-value');\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n return;\n }\n }\n\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n return;\n }\n\n that.$value.removeClass('jqx-value-animation');\n }", "setProgress(percent) {\n const offset = this.circumference - percent / 100 * this.circumference;\n\n let circle = this.container.querySelector('.radialcircle');\n circle.style.strokeDasharray = `${this.circumference} ${this.circumference}`;\n circle.style.strokeDashoffset = offset;\n\n if (this.segments) {\n\n let tickwidth = this.segments * 2;\n\n let seglength = (((this.radius * 2) * Math.PI) - tickwidth) / (this.segments);\n\n let tickmarks = this.container.querySelector('.tickmarks');\n tickmarks.style.strokeDasharray = `2px ${seglength}px`;\n tickmarks.style.strokeDashoffset = 0;\n\n }\n }", "function Update() {\n circles.forEach((circle, inx) => {\n if(inx < currentActive) {\n circle.classList.add('active')\n } else{\n circle.classList.remove('active')\n }\n })\n \n // Get all the active circles\n const actives = document.querySelectorAll('.active')\n\n // Update Progress Bar\n progress.style.width=(actives.length -1)/ (circles.length\n -1) * 100 + '%'\n\n // Active or Disable PREV & NEXT \n if(currentActive == 1){\n prev.disabled = true\n } else if(currentActive === circles.length) {\n next.disabled = true\n } else {\n prev.disabled = false\n next.disabled = false\n }\n}", "update () {\n\t\tfor ( let i = 0; i < this.numberOfCircles; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circles[i]\n\t\t\t\t\t\t\t\t.update( this.context );\n\t\t}\n\t}", "update() {\n this.getProgression();\n }", "function update() {\n circles.forEach((circle, idx) => {\n if(idx < currentActive) {\n circle.classList.add('active')\n } else {\n circle.classList.remove('active')\n }\n })\n\n const actives = document.querySelectorAll('.active')\n // console.log(actives.length, circles.length)\n //whant to get a percentage for progress width\n //if we look in the css for out progress class,\n //we have the width at 0% and we want to change that\n //so that the line goes to the next circle\n //if we divide the lenghts and then mulitply them by\n //this will get the width as a percent.\n // console.log((actives.length / circles.length)*100)\n\n //progress is from the variables we created earlie\n //style??\n //width is the property that we want to change\n // progress.style.width = (actives.lenght / circles.length)*100\n //^^^does not work because we are multiplying it by a number\n // and we need to be a unit. This is how the css class works\n // width: 100; does not work instead we need width: 100%;\n // we can achieve this by concatinating a % at the end\n // progress.style.width = (actives.length / circles.length)*\n // 100 + '%'\n //^^^this makes the line move however it does not move\n //the right amount, it goes past the circle instead of right\n // to it\n //we can fix this by subtracting 1 from the actives and the \n //circles length which will then give us a small percentage\n // make sure to wrap the statements appropriately so that the \n //math is right\n progress.style.width = (actives.length - 1) / (circles.length - 1) * 100 + '%'\n\n //the prev button is already set disabled to true\n //but when we click next and then if we go back\n //we want it to go back to disabled again\n //this is for the beginning\n if(currentActive === 1) {\n prev.disabled = true\n //if the current btn is equal to the number of circles that \n //there are then we want to set the next button to be \n //disables because then there are no more steps to go\n //and you are done. this is for the end.\n } else if(currentActive === circles.length) {\n next.disabled = true\n //if we are not at the beginning or at the end of the \n //progress then we do not want any of them to be disabled\n //this is because we are in the middle\n } else {\n prev.disabled = false\n next.disabled = false\n }\n}", "function Progress(el){\n $(el).circleProgress({fill: {color:'navy'},animation:{duration:10000, easing:'circleProgressEasing'},animationStartValue: 1.0,reverse:true})\n }", "function updateProgress() {\n var progress = 0,\n currentValue = $scope.curVal,\n maxValue = $scope.maxVal,\n // recompute overall progress bar width inside the handler to adapt to viewport changes\n progressBarWidth = progressBarBkgdElement.prop('clientWidth');\n\n if ($scope.maxVal) {\n // determine the current progress marker's width in pixels\n progress = Math.min(currentValue, maxValue) / maxValue * progressBarWidth;\n }\n\n // set the marker's width\n progressBarMarkerElement.css('width', progress + 'px');\n }", "function update() {\n circles.forEach((circle, index) => {\n if (index < curentActive) {\n circle.classList.add(\"active\");\n } else {\n circle.classList.remove(\"active\");\n }\n });\n\n const actives = document.querySelectorAll(\".active\");\n\n progress.style.width = ((actives.length - 1) / (circles.length - 1)) * 100 + \"%\";\n\n //Modify the sate of the button so that is disabled when at the end or both enabled when in the middle\n if (curentActive === 1) {\n prev.disabled = true;\n } else if (curentActive === circles.length) {\n next.disabled = true;\n } else {\n prev.disabled = false;\n next.disabled = false;\n }\n}", "function update() {\n circles.forEach((circle, i) => {\n if (i < currentActive) {\n circle.classList.add(\"active\");\n } else {\n circle.classList.remove(\"active\");\n }\n });\n\n const actives = document.querySelectorAll(\".active\");\n //fills the bar with blue up to the correct amounts\n progress.style.width =\n ((actives.length - 1) / (circles.length - 1)) * 100 + \"%\";\n\n //allow the buttons to be clicked if active is not 1 or 4\n if (currentActive === 1) {\n prev.disabled = true;\n } else if (currentActive === circles.length) {\n next.disabled = true;\n } else {\n prev.disabled = false;\n next.disabled = false;\n }\n}", "_updateProgress() {\n super._updateProgress();\n\n const that = this;\n\n //Label for Percentages\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n }\n else {\n that.$value.removeClass('jqx-value-animation');\n }\n\n that.$.value.style.transform = that.orientation === 'horizontal' ? 'scaleX(' + that._percentageValue + ')' : 'scaleY(' + that._percentageValue + ')';\n }", "update(nbPoints, multp){\n //On efface tout sur le canva et on récupère lesinfos passé en parametre\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n\n //Si le nombre de point change il faut tout redessiner Et recaulculer le tableau de point\n if (this.nbPoints != nbPoints) {\n this.calcPoints(nbPoints);\n this.mult = multp;\n this.nbPoints = nbPoints;\n this.drawCircle();\n } else {\n this.mult = multp;\n this.nbPoints = nbPoints;\n this.drawCircle();\n }\n\n\n\n //Finalement on met les nouvelles valeur dans les input dans l'HTML\n circleNbPointsInput.value = this.nbPoints;\n circleMultInput.value = this.mult;\n\n }", "function updateProgress(newProgress) {\n progressRef.current = newProgress;\n setRgbProgress(newProgress);\n }", "updateProgressBar() {\n let revealRange = 103 - 24; //See css comment (progressBox). \n let revealPercent = this.points / this.pointsNeeded; //Current percent of points needed.\n this.baseProgressMargin = -24; //Margin value: Progress box hides bar.\n this.progressMargin = this.baseProgressMargin - revealPercent * revealRange; //New margin value\n document.getElementById(\"progress\").style.marginTop = this.progressMargin + \"vh\"; //Reveal percent of glowing border as level progress indicator.\n }", "function update_progress() {\n let tot = open + closed;\n\n $(\"#progress_open\").css(\"width\", (open * 100 / tot) + \"%\");\n $(\"#progress_close\").css(\"width\", (closed * 100 / tot) + \"%\");\n}", "updateProgress() {\n var state = this.state;\n\n state.runningTime += state.deltaT;\n\n if (this.duration) {\n state.progress = Math.max(0, Math.min(1, state.runningTime / this.duration));\n }\n }", "function update(value) {\n slider.attr(\"value\", value);\n\n d3.selectAll(\"#perc-value\")\n .attr(\"value\", value + \"%\");\n }", "radialProgress() {\r\n let progressContainer;\r\n progressContainer = this.element.querySelector('.progress-container');\r\n let progressSVG;\r\n progressSVG = this.element.querySelector('.progress');\r\n let progressBar;\r\n progressBar = this.element.querySelector('.progress-value');\r\n let progressBorder;\r\n progressBorder = this.element.querySelector('.progress-meter');\r\n const circleRadius = this.calculateRadius();\r\n const calcVal = 2 * Math.PI * circleRadius;\r\n // apply width if defined.\r\n if (this.width) {\r\n progressContainer.style.width = this.width;\r\n progressSVG.style.width = this.width;\r\n progressSVG.style.height = this.width;\r\n }\r\n // progress logic for svg\r\n if (this.currentValue <= this.maxValue && this.currentValue >= this.minValue) {\r\n let finalValue;\r\n finalValue = (calcVal * (this.maxValue - this.currentValue)) / this.maxValue;\r\n progressBar.style.strokeDashoffset = `${finalValue}px`;\r\n }\r\n else {\r\n progressBar.style.strokeDashoffset = `${calcVal}0px`;\r\n }\r\n // define percentage based on values.\r\n progressBar.style.strokeDasharray = `${calcVal}px`;\r\n // apply text color if defined\r\n progressSVG.querySelector('g').setAttribute('transform', 'rotate(-90 50 50)');\r\n if (this.fontColor) {\r\n try {\r\n // @ts-ignore\r\n (progressSVG.querySelector('.description-container')).style.fill = this.fontColor;\r\n }\r\n catch (e) {\r\n // in case of haveDescription false code will come to this catch.\r\n dxp.log.debug(this.element.tagName, 'radialProgress()', `description not found.`);\r\n }\r\n }\r\n // apply progress color if applied.\r\n if (this.progressColor) {\r\n progressBar.style.stroke = this.progressColor;\r\n }\r\n // apply progress background if applied.\r\n if (this.backgroundColor) {\r\n progressBorder.style.stroke = this.backgroundColor;\r\n }\r\n }", "function update() {\n \n var prev_val_key = VAL_KEY;\n VAL_KEY = getValKey();\n \n // Update charts.\n valfields.forEach(function(v,k) {\n \n var start_i = 100 - grp_vals[prev_val_key][v];\n var end_i = 100 - grp_vals[VAL_KEY][v];\n let new_perc = grp_vals[VAL_KEY][v];\n\n // update title\n d3.select(`#holder${v}`)\n .select(\"h3\")\n .transition()\n // .delay(800)\n .text(`${field_details[v].desc}: ${new_perc}%`);\n\n // d3.select(`#holder${v}`)\n // .select(\"#myNewParagrap\")\n // .transition()\n // .delay(900)\n // .text(`${new_perc}%`)\n // .style('padding-top', 0)\n // .style('margin-top', 0)\n // // .style('font-size', '1.2rem')\n \n \n d3.select(\"#vf\"+v).selectAll(\".cell circle\")\n .transition()\n .duration(750)\n .delay(function(d,i) {\n \n // Decreasing\n if (start_i < end_i) {\n var curr_delay = (i - start_i) * delay_per_unit;\n curr_delay = Math.max(curr_delay, 0);\n return curr_delay;\n } \n \n // Increasing\n else if (start_i > end_i) {\n var curr_delay = (start_i - i) * delay_per_unit;\n curr_delay = Math.max(curr_delay, 0);\n return curr_delay;\n }\n \n // No change.\n else {\n return 0;\n }\n })\n .style(\"fill\", function(d,i) {\n if (i < (100-grp_vals[VAL_KEY][v])) {\n return bg_color;\n } else {\n return field_details[v].color;\n }\n })\n\n }); // @end forEach()\n \n }", "function update() {\n \t// update bubbles\n \tpoints.transition()\n \t\t .duration(200)\n \t .attr(\"transform\", function(d) {\n \t \t return \"translate(\"+xScale(d.years[dragit.time.current].year)+\", \"+yScale(d.years[dragit.time.current].val)+\")\";\n \t\t });\n \tcircle.transition()\n \t\t .duration(200)\n \t\t .attr(\"r\", function(d) {\n \t\t return Math.sqrt(d.years[dragit.time.current].audience);\n \t\t });\n \tlabel.text(function(d) {\n \t\t return d.years[dragit.time.current].audience;\n \t\t });\n \t}", "function setCircleProgress(num) {\n\tfor (i = 0; i <= 9; i++) {\n\t\tif (i <= num) d3.select(eval('\"#circle_' + i + '\"')).style(\"background\",\"#D3D3D3\");\n\t\tif (i > num) d3.select(eval('\"#circle_' + i + '\"')).style(\"background\",\"white\");\n\t}//for i\t\n}//setCircleProgress", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n }", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((r.getCurrentTime() / r.getDuration()) * 100);\n}", "update() {\n // clear canvas\n GLOBALS.drawer.clear();\n\n for (const circleType in GLOBALS.circles) {\n GLOBALS.circles[circleType].forEach((circle) => {\n // get the bounded draw method and delegate execution to a Drawer object\n GLOBALS.drawer.draw(this._getBoundedArcMethod(circle), circle._color);\n // update the circle's position based on its behavior\n circle.update(GLOBALS.drawer._canvas);\n });\n } // for\n\n // get next animation frame\n window.requestAnimationFrame(FUNCTIONS.update.bind(FUNCTIONS)); // `this` gets set to `window` normally\n }", "function update() {\n drawCursor();\n var smallest = 100\n var smallestComp = 100\n pointArea.innerHTML = points.toString();\n for (var i = 0; i < circles.length; i++) {\n smallestComp = circles[i].width\n if (smallestComp < smallest)\n smallest = smallestComp\n var myCircle = circles[i];\n myCircle.update();\n }\n var j = circles.length;\n while( j--) {\n\n if(circles[j].isEaten) {\n circles.splice(j, 1)\n numCircles--\n }\n }\n if (numCircles && smallest < mouseWidth)\n requestAnimationFrame(update);\n else {\n circleContext.font=\"50px Comic Sans MS\"\n circleContext.fillStyle = \"black\"\n circleContext.align = \"left\"\n if(!numCircles && points > 0) {\n circleContext.fillText(\"Congratulations!!! You won!!!\", xMax /4, yMax/2)\n this.myCanvas.style.cursor = \"auto\"\n }\n else if(points < 0){\n circleContext.fillText(\"¡¡¡Por Que!!! You lost!!!\", 380, yMax/2)\n this.myCanvas.style.cursor = \"auto\"\n } else {\n requestAnimationFrame(update);\n }\n\n }\n }", "update () {\n\t\tfor ( let i = 0; i < this.circleContainers.length; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circleContainers[i]\n\t\t\t\t\t\t\t\t.update();\n\t\t}\n\t}", "function setProgress(container, progress){\n var bar = new ProgressBar.SemiCircle(container, {\n strokeWidth: 6,\n color: '#fff',\n trailColor: '#e0e0e0',\n trailWidth: 1,\n easing: 'easeInOut',\n duration: 1400,\n svgStyle: null,\n text: {\n value: '',\n alignToBottom: false\n },\n from: {color: '#fff'},\n to: {color:'#fff'},\n // Set default step function for all animate calls\n step: (state, bar) => {\n bar.path.setAttribute('stroke', state.color);\n var value = Math.round(bar.value() * 100);\n if (value === 0) {\n bar.setText('0%');\n } else {\n bar.setText(value+\"%\");\n }\n bar.text.style.color = state.color;\n }\n });\n bar.text.style.fontFamily = '\"Roboto\", Helvetica, sans-serif';\n bar.text.style.fontSize = '2rem';\n\n bar.animate(progress); // Number from 0.0 to 1.0\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function initProgressBarCircle(selector, value) {\r\n if (document.querySelector(selector)) {\r\n let bar = new ProgressBar.Circle(selector, {\r\n color: '#a7b51a',\r\n trailColor: '#e9e9e9',\r\n trailWidth: 12,\r\n duration: 1400,\r\n easing: 'bounce',\r\n strokeWidth: 12,\r\n text: {\r\n className: 'circle-progress-bar__lable',\r\n },\r\n from: {color: '#d75c2b', a:0},\r\n to: {color: '#a7b51a', a:1},\r\n // Set default step function for all animate calls\r\n step: function(state, circle) {\r\n circle.path.setAttribute('stroke', state.color);\r\n $(circle.text).css({color:state.color});\r\n circle.setText( (circle.value() * 10).toFixed(1) )\r\n },\r\n });\r\n\r\n bar.animate(value); // Number from 0.0 to 1.0\r\n }\r\n }", "function ProgressCircle() {\n // .. do something?\n}", "function draw() {\n background(70);\n diffCircle.update();\n if (mouseIsPressed) {\n diffCircle = diffCircle - 300 ;\n } else {\n diffCircle = diffCircle + 300;\n }\n }", "function progressPie( canvas, progress ) {\n\tvar progressValue = progress;\n\tvar ctx = canvas.getContext(\"2d\");\n\n\tvar cx = canvas.width / 2;\n\tvar cy = canvas.height / 2;\n\n\t// Assumes the width is always larger than the height of the canvas\n\tvar radius = canvas.width / 2;\n\n\t// The inner circle is a full circle, nothing special about it\n\tctx.beginPath();\n\tctx.arc(cx, cy, radius - 10, 0, 2 * Math.PI, false);\n\tctx.fillStyle = '#ccc';\n\tctx.fill();\n\n\t// This is the gradient fill for the pie\n\tgrd = ctx.createRadialGradient(radius, radius, 0.000, radius, radius, radius);\n\tgrd.addColorStop(0.000, 'rgba(255, 104, 41, 1.000)');\n\tgrd.addColorStop(0.987, 'rgba(213, 25, 25, 1.000)');\n\n\t// Now using the progress value let's add the pie representation\n\t// starts at the angle of -90deg i.e the top center\n\t/*\n\tctx.beginPath();\n\tctx.arc(cx, cy, radius, toRadians(-90), toRadians( (progressValue / 100) * (360 - 90) ) );\n\tctx.lineTo(cx, cy);\n\tctx.closePath();\n\tctx.fillStyle = grd;\n\tctx.fill();\n\t*/\n\n\n\t/* TODO: Animate it */\n\tvar initialValue = 0;\n\tvar animProgress = setInterval(function(){\n\t\t// Clear react on each frame\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t// The inner circle is a full circle, nothing special about it\n\t\tctx.beginPath();\n\t\tctx.arc(cx, cy, radius - 10, 0, 2 * Math.PI, false);\n\t\tctx.fillStyle = '#dde5ef';\n\t\tctx.fill();\n\n\t\t// Draw the progress pie\n\t\tctx.beginPath();\n\t\tctx.arc(cx, cy, radius, toRadians(-90), toRadians( (initialValue / 100) * 360 - 90 ) );\n\t\tctx.lineTo(cx, cy);\n\t\tctx.closePath();\n\t\tctx.fillStyle = grd;\n\t\tctx.fill();\n\n\t\t// Fill the text\n\n\t\tvar text = {\n\t\t\tx: cx + 20,\n\t\t\ty: cy,\n\t\t\tfont: '29px \"Oswald\", Helvetica, Arial, sans-serif',\n\t\t\tcolor: \"#fff\"\n\t\t};\n\n\t\tif ( progressValue < 10 ) {\n\t\t\ttext.color = \"#000\";\n\t\t}\n\n\t\telse if ( progressValue >= 10 && progressValue <= 25 ) {\n\t\t\ttext.x = radius + 10;\n\t\t\ttext.y = 40;\n\t\t\ttext.font = '18px \"Oswald\", Helvetica, Arial, sans-serif';\n\t\t}\n\n\t\telse if ( progressValue >= 25 && progressValue <= 50 ) {\n\t\t\ttext.x = cx + 20;\n\t\t\ttext.y = cy - 20;\n\t\t}\n\n\t\telse if ( progressValue > 50 ) {\n\t\t\ttext.x = cx + 20;\n\t\t\ttext.y = cy + 20;\n\t\t}\n\n\t\tctx.font = text.font;\n\t\tctx.fillStyle = text.color;\n\t\tctx.fillText(initialValue + \" %\", text.x, text.y);\n\n\t\tif ( progressValue == initialValue ) {\n\t\t\tclearInterval( animProgress );\n\t\t}\n\n\t\tinitialValue++;\n\t}, 10);\n}", "function circleMoreGreen(){\n g = g + 40;\n}", "function UpdateTheProgressBar(gameStats){\n var pr = document.getElementById('progressBar').getContext('2d');\n pr.fillStyle = \"royalblue\";\n var progress = (gameStats.score/gameStats.neededScore)*100;\n progress = Math.round((progress/100) * 390);\n pr.fillRect(0,0,progress,50);\n console.log(gameStats);\n}", "_update() {\n // change the needle angle\n this.svgEls.needle.setAttribute(\"x1\", this._calcNeedleCenter().x);\n this.svgEls.needle.setAttribute(\"y1\", this._calcNeedleCenter().y);\n this.svgEls.needle.setAttribute(\"x2\", this._calcNeedleEnd().x);\n this.svgEls.needle.setAttribute(\"y2\", this._calcNeedleEnd().y);\n\n // change the active arc length\n this.svgEls.activeArc.setAttribute(\"d\",\n this._calcSvgArcPath(\n this._calcNeedleCenter().x,\n this._calcNeedleCenter().y,\n this._calcDialRadius(),\n 0.65 * Math.PI,\n this._calcNeedleAngle() - 0.5 * Math.PI\n ));\n\n // if the value is at min, change the color to match needle color\n // - otherwise the active part will be visible beneath the needle\n if (this.state.val === this.o.minVal) {\n this.svgEls.activeArc.setAttribute(\"stroke\", this.o.needleColor);\n } else {\n this.svgEls.activeArc.setAttribute(\"stroke\", this.o.activeColor);\n }\n }", "function updateAllProgressPoints() {\n for (var c_index = 1; c_index <= getGradeable().components.length; c_index ++) {\n updateProgressPoints(c_index);\n }\n}", "_drawArc() {\n\t\tthis.progress.width = this.canvas_size;\n\t\tthis.progress.height = this.canvas_size;\n\n\t\tthis.ctx.save();\n\t\tthis.ctx.translate(this.center_x, this.center_y - this.radius);\n\t\tthis.ctx.rotate(-90 * Math.PI / 180);\n\n\t\tconst gradient = this.ctx.createLinearGradient(100,-50,50,160);\n\t\tgradient.addColorStop(0, '#e0ac00');\n\t\tgradient.addColorStop(1, '#71590a');//#b58b01\n\n\t\tthis.ctx.strokeStyle = gradient;\n\t\tthis.ctx.beginPath();\n\t\tthis.ctx.lineWidth = 17;\n\t\tthis.ctx.arc(0 - this.radius - 1, 0, this.radius - 1, 0, this.target * Math.PI / 180, false);\n\t\tthis.ctx.stroke();\n\t\tthis.ctx.restore();\n\t}", "function updateCough(progress) {\n g.selectAll('.cough')\n .transition()\n .duration(0)\n .attr('opacity', progress);\n\n g.selectAll('.hist')\n .transition('cough')\n .duration(0)\n .style('fill', function (d) {\n return (d.x0 >= 14) ? coughColorScale(progress) : '#008080';\n });\n }", "function updateProgressBar() {\n pbValue+=10;\n $('.progress-bar').css('width', pbValue+'%').attr('aria-valuenow', pbValue);\n $('.progress-bar').text(pbValue + \"%\");\n }", "animateCircles() {\n requestAnimationFrame(this.animateCircles.bind(this));\n this.clearCanvas();\n this.circles.forEach(circle => circle.update({\n mouse_x: this.mouse.x,\n mouse_y: this.mouse.y,\n range: this.mouse.range,\n particles: this.circles\n }));\n }", "function update() {\n // Clears the circles\n svg.selectAll(\"circle\")\n .remove();\n\n const start = Math.round(SLIDER_MIN);\n const end = start + Math.round(SLIDER_MAX);\n\n timeIndex = getIndexRange(start, end);\n // console.log(timeIndex);\n\n let filteredData = data.slice( timeIndex[0], timeIndex[1] );\n svg.selectAll(\"circle\")\n .data(filteredData)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", d => xScale(d.long))\n .attr(\"cy\", d => yScale(d.lat))\n .attr(\"id\", d => \"i\" + d.id)\n .attr(\"title\", toolTip)\n .attr(\"r\", d => settings.radius )\n .attr(\"opacity\", settings.opacity)\n .attr(\"class\", d => \"c\" + Math.round(d.label))\n .attr(\"fill\", d => selectColor(d))\n .on(\"mouseover\", handleMouseOver)\n .on(\"mouseout\", handleMouseOut);\n}", "function updateProgress(value) {\n var progressBarStep = value*stepSize;\n $(\"#progress\").css(\"width\", progressBarStep + \"%\");\n $(\"#progress\").attr(\"aria-valuenow\", progressBarStep);\n $(\"#progress-current\").html(value);\n}", "function updateProgress(){\n $(\".line\").val( Player.audioObj.currentTime / Player.audioObj.duration );\n }", "on_tick() {\n prior(UIProgressBar, this).on_tick.call(this);\n \n if (this.last_value != this.value) {\n this.do_recalc();\n this.last_value = this.value;\n }\n }", "function updateCircles(ctx, points) {\n\n ctx.save();\n\n // erase what is on the canvas currently\n ctx.clearRect(0, 0, width, height);\n\n // draw each point as a rectangle\n for (let i = 0; i < points.length; ++i) {\n const point = points[i];\n ctx.fillStyle = `rgb(${point.fill[\"r\"]},${point.fill[\"g\"]},${point.fill[\"b\"]})`\n ctx.beginPath();\n ctx.moveTo(point.x + point.r, point.y);\n ctx.arc(point.x, point.y, point.r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.globalAlpha = 1\n }\n\n ctx.restore();\n\n }", "function animate(rads, current) {\n const context = rads.getContext('2d');\n //Starting coordinates\n const x = rads.width / 2; //middle of canvas\n const y = rads.height / 2; //middle of canvas\n const radius = 0.38 * rads.width; //Radius of circle in pixels\n const endNum = rads.getAttribute('data-num');\n const endPercent = +rads.getAttribute('data-num') + +1; //Ending % of circle\n const fullCircle = Math.PI * 2; //= 360 degrees in radians\n const quarterClock = Math.PI / 2; //This equals 25% of a circle used later to move start point from 3 o'clock to 12.\n\n context.lineWidth = 10; // Line width\n context.strokeStyle = rads.getAttribute('data-color'); //Line Color\n\n context.beginPath();\n //https://www.w3schools.com/tags/canvas_arc.asp\n context.arc(x, y, radius, -(quarterClock), ((fullCircle) * current) - quarterClock, false);\n context.stroke(); //Draw the line\n currentPercent++; // +1%\n\n //Canvas Text\n context.font = \"bold \" + (radius * 0.7) + \"px serif\";\n context.textBaseline = \"top\";\n context.textAlign = \"center\";\n context.fillText(endNum, x /*- (x * 0.25)*/ , y - (y * 0.3));\n\n if (currentPercent < endPercent) { //If the +1 didn't put it to the endPercent then do it again, starting at the current percentage\n requestAnimationFrame(() => animate(rads, (currentPercent / 100)));\n }\n context.closePath();\n}", "_setProgress(v) {\n\t\tconst w = PROGRESSBAR_WIDTH * v;\n\t\tthis._fg.tilePositionX = w;\n\t\tthis._fg.width = PROGRESSBAR_WIDTH- w;\n\t}", "function updateProgressInfo() {\n\tif (!div_progress_info) {\n\t\tdiv_progress_info = document.getElementById('progress_info');\n\t}\n\tif (!div_progress_bar) {\n\t\tdiv_progress_bar = document.getElementById('progress_bar');\n\t}\n\tif (!div_progress_info && !div_progress_bar) {\n\t\treturn;\n\t}\n\n\tvar percentage = Math.floor(100.0*blamedLines/totalLines);\n\n\tif (div_progress_info) {\n\t\tdiv_progress_info.firstChild.data = blamedLines + ' / ' + totalLines +\n\t\t\t' (' + padLeftStr(percentage, 3, '\\u00A0') + '%)';\n\t}\n\n\tif (div_progress_bar) {\n\t\t//div_progress_bar.setAttribute('style', 'width: '+percentage+'%;');\n\t\tdiv_progress_bar.style.width = percentage + '%';\n\t}\n}", "function updateOnDraggingCircle(dx) {\n // Do not allow to change over the minimum value\n if (parseFloat(currentCircleObjs[0].attr(\"cx\")) + dx < dragMinX)\n dx = dragMinX - parseFloat(currentCircleObjs[0].attr(\"cx\"));\n\n // Update circles\n for (var i = 0; i < currentCircleObjs.length; i++) {\n var newCx = parseFloat(currentCircleObjs[i].attr(\"cx\")) + dx;\n currentCircleObjs[i].attr(\"cx\", newCx);\n }\n\n // Calculate increase/decrease value to have even values\n currentAdjustedMinutes = adjustedMinutes();\n\n // Update lines\n if (currentFirstLine != null) {\n var newX2 = parseFloat(currentFirstLine.attr(\"x2\")) + dx;\n currentFirstLine.attr(\"x2\", newX2);\n }\n\n for (var i = 0; i < currentLineObjs.length; i++) {\n var newX1 = parseFloat(currentLineObjs[i].attr(\"x1\")) + dx;\n var newX2 = parseFloat(currentLineObjs[i].attr(\"x2\")) + dx;\n currentLineObjs[i].attr(\"x1\", newX1).attr(\"x2\", newX2);\n }\n\n // Update texts\n for (var i = 0; i < currentTextObjs.length; i++) {\n var newX = parseFloat(currentTextObjs[i].attr(\"x\")) + dx;\n currentTextObjs[i].attr(\"x\", newX);\n if (currentTextObjs[i].attr(\"id\").includes(\"trainhour\")) {\n // Have to be sure that all values increase/decrease the same\n var circleID = currentTextObjs[i].attr(\"id\").replace(\"trainhour\", \"traincircle\");\n var backupX = parseFloat(d3.select(\"#\" + circleID).attr(\"cx-backup\"));\n var minute = (Math.round(backupX / minSpace) + 1000 + currentAdjustedMinutes) % 10;\n currentTextObjs[i].text(minute % 10);\n }\n\n if(currentTextObjs[i].attr(\"id\").includes(\"trainname\") || currentTextObjs[i].attr(\"id\").includes(\"trainengine\")){\n var currTransform = currentTextObjs[i].attr(\"transform\");\n currTransform = currTransform.split(\",\");\n currTransform[1] = newX;\n currTransform = currTransform.join(\",\");\n currentTextObjs[i].attr(\"transform\",currTransform);\n }\n }\n}", "updateShape(incRadius, incIntensity) {\n // decrease the intensity\n this.intensity -= incIntensity;\n\n // increase the radius\n this.radius += incRadius;\n }", "function updateProgressbarDisplay() {\n if (progressBarProgressionElement) {\n updateStep(progressBarProgressionElement)\n updateCounter()\n }\n }", "changePercentage(percentage,mode){var newp=0;// support for adding and removing percentage as well as setting\nif(\"add\"==mode){newp=this.items[this.active].metadata.value+percentage}else if(\"subtract\"==mode){newp=this.items[this.active].metadata.value-percentage}else{newp=percentage}// after establishing the new percentage, make sure it's less then max\n// if it's at or over max then we need to trigger events and state to change\nif(newp>=this.items[this.active].metadata.max){if(this.items.length==this.active+1){// fire an event change to indicate that this happened\nthis.state=\"finished\";this.items[this.active].metadata.status=\"finished\";this.set(\"items.\"+this.active+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+this.active+\".metadata.status\");// need to make sure finished happens prior to value set to 100\n// otherwise this will kick off the circle to complete itself\nthis.items[this.active].metadata.value=this.items[this.active].metadata.max;this.set(\"items.\"+this.active+\".metadata.value\",this.items[this.active].metadata.max);this.notifyPath(\"items.\"+this.active+\".metadata.value\")}else{// set value = max which will automatically trigger complete in the circle\nthis.items[this.active].metadata.value=this.items[this.active].metadata.max;this.set(\"items.\"+this.active+\".metadata.value\",this.items[this.active].metadata.max);this.notifyPath(\"items.\"+this.active+\".metadata.value\")}// ensure we still have more items to go in the list\nif(this.items.length>this.active+1){// if we have progressive unlocking then set the next thing available\n// assuming that the next thing is currently disabled and that we're not\n// on the first item. OR, if we don't have a response for the current\n// item in local storage then let's mark loading to kick off the calls\nif(this.progressiveUnlock&&\"complete\"==this.items[this.active].metadata.status&&\"disabled\"==this.items[this.active+1].metadata.status||typeof this._responseList[this.active+1]===typeof void 0){this.items[this.active+1].metadata.status=\"loading\";this.set(\"items.\"+(this.active+1)+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+(this.active+1)+\".metadata.status\")}// set state so it gets reported upstream in events\nthis.state=\"active item is \"+(this.active+1);// bump active ahead 1 because we still have more items in the list\nthis.active=this.active+1}}else{this.items[this.active].metadata.value=newp;this.set(\"items.\"+this.active+\".metadata.value\",newp);this.notifyPath(\"items.\"+this.active+\".metadata.value\")}}", "function updateProgress() {\n try {\n var gauge = getDailyTaskGauge();\n var progress = getProgress(gauge);\n if (progress === null) {\n return; // Progress is not there yet\n }\n if (!progress.done || progress.done === progress.total) {\n return;\n }\n var pb = getOrCreateProgressBar(gauge);\n pb.style.width = (100 * progress.done / progress.total) + '%';\n } catch (e) {\n console.log('DailyProgress: Ошибка при обновлении. ' + e);\n }\n}", "function setLoaderProgressTo(value)\n{\n const fill = unityInstance.progress.getElementsByClassName(\"fill\")[0];\n const fillText = unityInstance.progress.getElementsByClassName(\"label\")[0];\n\n fill.animate(\n [\n { width: (value * 100) + \"%\" }\n ],\n {\n duration: 300,\n fill: \"forwards\"\n }\n );\n\n fillText.textContent = (value * 100).toFixed() + \"%\";\n}", "_updateValue () {\n let sliderWidth = this._sliderElement.offsetWidth;\n\n // Calculate the new value\n let { minValue, maxValue } = this._options;\n let percentage = this._xPosition / sliderWidth;\n let value = minValue + (maxValue - minValue) * percentage;\n this.emit(\"update\", value);\n }", "update(p) {\n const {cusps, hue, hub, roller, pen, curve, g} = this;\n\n const curveAngle = this.curveAngle = τ * p;\n this.rollTo(curveAngle);\n const spinAngle = this.spinAngle = finalAngle * p;\n this.spinTo(spinAngle);\n\n this.curve.setAttrs({\n d: this.epiCycloid.pathTo(τ * p),\n fill: `hsla(${hue}, 100%, 50%, ${p * ((maxCusps - cusps + 1) / maxCusps)})`,\n });\n\n this.hub.setAttr('opacity', 1-p);\n this.roller.setAttr('opacity', 1-p);\n this.pen.setAttr('opacity', 1-p);\n }", "function circleFaster(){\n zoffChange = zoffChange + 0.005;\n}", "reflow() {\n this.calcPoints();\n this._updateActive();\n }", "function progressUpdate() {\r\n loadingProgress = Math.round(progressTl.progress() * 100);\r\n $(\".txt-perc\").text(loadingProgress + '%');\r\n}", "function animate() {\n requestAnimationFrame(animate);\n c.clearRect(0, 0, innerWidth, innerHeight);\n\n // circle.draw();\n // circle.update();\n\n // Step 7\n\n for (var i = 0; i < circleArray.length; i++) {\n circleArray[i].update();\n }\n}", "recalculateValues() {\n this.remainingTime = this.startingTime;\n this.decreasePerInterval = this.startingProgressPercent / this.startingTime;\n }", "function update(number) {\n\n data = dataStructure[number].data;\n\n oldPieData = filteredPieData;\n pieData = donut(data);\n\n var sliceProportion = 0; //size of this slice\n filteredPieData = pieData.filter(filterData);\n function filterData(element, index, array) {\n element.name = data[index].itemLabel;\n element.value = data[index].itemValue;\n element.id = data[index].itemId;\n sliceProportion += element.value;\n return (element.value > 0);\n }\n\n //DRAW ARC PATHS\n paths = arc_group.selectAll(\"path\").data(filteredPieData);\n paths.enter().append(\"svg:path\")\n .attr(\"stroke\", \"white\")\n .attr(\"stroke-width\", 0.5)\n .attr(\"fill\", function(d, i) { return color(i); })\n .transition()\n .duration(tweenDuration)\n .attrTween(\"d\", pieTween);\n paths\n .transition()\n .duration(tweenDuration)\n .attrTween(\"d\", pieTween);\n paths.exit()\n .transition()\n .duration(tweenDuration)\n .attrTween(\"d\", removePieTween)\n .remove();\n\n //DRAW TICK MARK LINES FOR LABELS\n lines = label_group.selectAll(\"line\").data(filteredPieData);\n lines.enter().append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y1\", -r-3)\n .attr(\"y2\", -r-18)\n .attr(\"stroke\", \"gray\")\n .attr(\"transform\", function(d) {\n return \"rotate(\" + (d.startAngle+d.endAngle)/2 * (180/Math.PI) + \")\";\n });\n lines.transition()\n .duration(tweenDuration)\n .attr(\"transform\", function(d) {\n return \"rotate(\" + (d.startAngle+d.endAngle)/2 * (180/Math.PI) + \")\";\n });\n lines.exit().remove();\n //DRAW LABELS WITH PERCENTAGE VALUES\n valueLabels = label_group.selectAll(\"text.value\").data(filteredPieData)\n .attr(\"dy\", function(d){\n if ((d.startAngle+d.endAngle)/2 > Math.PI/2 && (d.startAngle+d.endAngle)/2 < Math.PI*1.5 ) {\n return 5;\n } else {\n return -7;\n }\n })\n .attr(\"text-anchor\", function(d){\n if ( (d.startAngle+d.endAngle)/2 < Math.PI ){\n return \"beginning\";\n } else {\n return \"end\";\n }\n })\n .text(function(d){\n var percentage = (d.value/sliceProportion)*100;\n return percentage.toFixed(1) + \"%\";\n });\n\n valueLabels.enter().append(\"svg:text\")\n .attr(\"class\", \"value\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + Math.cos(((d.startAngle+d.endAngle - Math.PI)/2)) * (r+textOffset) + \",\" + Math.sin((d.startAngle+d.endAngle - Math.PI)/2) * (r+textOffset) + \")\";\n })\n .attr(\"dy\", function(d){\n if ((d.startAngle+d.endAngle)/2 > Math.PI/2 && (d.startAngle+d.endAngle)/2 < Math.PI*1.5) {\n return 5;\n } else {\n return -7;\n }\n })\n .attr(\"text-anchor\", function(d){\n if ( (d.startAngle+d.endAngle)/2 < Math.PI ){\n return \"beginning\";\n } else {\n return \"end\";\n }\n }).text(function(d){\n var percentage = (d.value/sliceProportion)*100;\n return d.name+\": \"+percentage.toFixed(1)+\"%\";\n })\n .on(\"click\", function(d){\n $(\"#projectId\").html(d.id);\n projectId(d.name);\n })\n .on(\"mouseover\", function(d){\n d3.select(this).style(\"fill\", \"#48c9b0\").style(\"font-weight\", \"bold\").style(\"cursor\", \"pointer\");\n })\n .on(\"mouseout\", function(d){\n d3.select(this).style(\"fill\", \"#5dade2\").style(\"font-weight\", \"normal\").style(\"cursor\", \"default\");\n })\n .style(\"pointer-events\",\"visible\")\n .style(\"font-weight\", \"normal\")\n .style(\"fill\", \"#5dade2\")\n valueLabels.transition().duration(tweenDuration).attrTween(\"transform\", textTween);\n\n valueLabels.exit().remove();\n\n //DRAW LABELS WITH ENTITY NAMES\n nameLabels = label_group.selectAll(\"text.units\").data(filteredPieData)\n .attr(\"dy\", function(d){\n if ((d.startAngle+d.endAngle)/2 > Math.PI/2 && (d.startAngle+d.endAngle)/2 < Math.PI*1.5 ) {\n return 17;\n } else {\n return 5;\n }\n })\n .attr(\"text-anchor\", function(d){\n if ((d.startAngle+d.endAngle)/2 < Math.PI ) {\n return \"beginning\";\n } else {\n return \"end\";\n }\n }).text(function(d){\n return d.name;\n });\n\n nameLabels.enter().append(\"svg:text\")\n .attr(\"class\", \"units\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + Math.cos(((d.startAngle+d.endAngle - Math.PI)/2)) * (r+textOffset) + \",\" + Math.sin((d.startAngle+d.endAngle - Math.PI)/2) * (r+textOffset) + \")\";\n })\n .attr(\"dy\", function(d){\n if ((d.startAngle+d.endAngle)/2 > Math.PI/2 && (d.startAngle+d.endAngle)/2 < Math.PI*1.5 ) {\n return 18;\n } else {\n return 5;\n }\n })\n .attr(\"text-anchor\", function(d){\n if ((d.startAngle+d.endAngle)/2 < Math.PI ) {\n return \"beginning\";\n } else {\n return \"end\";\n }\n }).text(function(d){\n return d.value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \"'\") + ' €'\n });\n\n nameLabels.transition().duration(tweenDuration).attrTween(\"transform\", textTween);\n\n nameLabels.exit().remove();\n\t\tvar total = 0;\n\t\tpieData.forEach(function(d){ total+=(d.value*1); });\n var total = total.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \"'\") + ' €'\n\t\tcenter_group.selectAll('text').data([total]).enter().append('text').text(function(d){\n\t\t\t\t\t\t\t\treturn d;\n }).attr('class','value').attr('dy', 8).attr('text-anchor', 'end').attr('transform', 'translate(40, 0)');\n }", "updateProgress() {\n this._Onprogress(this.state.CSVProgress * 100);\n }", "function updateDistanceProgress() {\n if (\"taskContainer\" in svl\n && getProperty(\"missionType\") !== \"auditOnboarding\"\n && svl.missionContainer.getTasksMissionsOffset() !== null) {\n\n var currentMissionCompletedDistance;\n if (isComplete()) {\n currentMissionCompletedDistance = getDistance(\"meters\");\n } else {\n var taskDistance = util.math.kilometersToMeters(svl.taskContainer.getCompletedTaskDistance({units: 'kilometers'}));\n var offset = svl.missionContainer.getTasksMissionsOffset();\n offset = offset ? offset : 0;\n\n var missionDistance = svl.missionContainer.getCompletedMissionDistance();\n currentMissionCompletedDistance = taskDistance - missionDistance + offset;\n // Hotfix for an issue where the mission completion distance was negative. Need to find root cause.\n // https://github.com/ProjectSidewalk/SidewalkWebpage/issues/2120\n if (currentMissionCompletedDistance < 0) {\n svl.missionContainer.setTasksMissionsOffset(offset - currentMissionCompletedDistance);\n console.error(`Mission progress was set to ${currentMissionCompletedDistance}, resetting to 0.`);\n currentMissionCompletedDistance = 0;\n }\n }\n setProperty(\"distanceProgress\", currentMissionCompletedDistance);\n }\n }", "componentDidUpdate(){\n let cnv = ReactDOM.findDOMNode(this.refs.progress);\n let ctx = cnv.getContext(\"2d\");\n let height = cnv.height;\n let width = height / 2; //width of individual component\n\n let coord = {\n y : 0,\n x : 0,\n padding: 10,\n };\n\n let stageColors = {\n first : '#00cc66',\n second: ((this.state.stage === 2 || this.state.stage === 3)? '#00cc66':'#ffc266'),\n third: ((this.state.stage === 3)?'#00cc66':'#ffc266'),\n };\n\n console.log(this.state.stage);\n console.log(stageColors);\n\n this.drawCircle(ctx,coord, width, width * 2, height, stageColors.first);\n // console.log(coord);\n this.drawRightArrow(ctx,coord, width, height, stageColors.second,5);\n this.drawRightArrow(ctx,coord, width, height, stageColors.second,5);\n this.drawRightArrow(ctx,coord, width, height, stageColors.second,5);\n this.drawCircle(ctx,coord, width, width * 2, height, stageColors.second);\n this.drawRightArrow(ctx,coord, width, height, stageColors.third,5);\n this.drawRightArrow(ctx,coord, width, height, stageColors.third,5);\n this.drawRightArrow(ctx,coord, width, height, stageColors.third,5);\n this.drawCircle(ctx,coord, width, width * 2, height, stageColors.third);\n }", "function $updateProgressBar(percent, complete){\r\n\tconsole.log(\"Recalculating progress bar - \" + percent + \"% initial data returned\");\r\n\tif (percent < 100) {\r\n\t\t\t$(\".meter > span\").each(function() {\r\n\t\t\t$(this).css('width', percent + \"%\");\r\n\t\t\t$(this).removeClass().addClass('orange');\r\n\t\t});\t\t\r\n\t}\t\r\n\tif (complete){\r\n\t\t$(\".meter > span\").each(function() {\r\n\t\t \t$(this).removeClass().addClass('green').css('width', '100%');\r\n\t\t});\t\t\t\r\n\t}\r\n}", "function circleMoreRed(){\n r = r + 40;\n}", "function updatePoint() {\n\t\tvar ppfill = new ol.style.Fill ({\n\t\t\tcolor : $('#pcolor').val()\n\t\t\t//opacity: \n\t\t});\n\t\t\n\t\tvar ppstroke = new ol.style.Stroke ({\n\t\t\tcolor : $('#polc').val(),\n\t\t\twidth: $('#pwidth').val()\n\t\t});\n\t\t\n\t\tvar pp = new ol.style.Circle ({\n\t\t\t\tfill : ppfill,\n\t\t\n\t\t\t\tradius: $('#psize').val(),\n\t\t\t\tstroke : ppstroke,\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\tvar style = new ol.style.Style({\n\t\t\timage: pp,\n\t\t});\n\t\t\n\t\twindow.layer.setStyle(style);\n\t\tmap.getView().fit(\n vectorSource.getExtent(),(map.getSize()));\n\t}", "function updateProgress ( current, total ){\n $(\".progress .currentProgress\").css('width', ((current - 1) / total) * 100 +'%');\n $(\".progress .progresstext\").html('Frage '+ current + ' von ' + (total))\n }", "function updateVal()\r\n{\r\n\t\r\n\t//temp,humid,press,wind values change according to the current val of slider/radial\r\n\tif(currentTemperature <= 16){ tempVal = 1; }\r\n\telse if(currentTemperature > 16 && currentTemperature <= 32) { tempVal = 2; }\r\n\telse { tempVal = 3; }\r\n\ttempArr.push(tempVal);\r\n\t\r\n\t\r\n\tif(currentPressure == 0){ pressureVal = 1; }\r\n\telse if(currentPressure == 1) { pressureVal = 3; }\r\n\tpressureArr.push(pressureVal);\r\n}", "function draw() {\n var val = currentValue;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n var angle = Math.PI;\n if (val < maxValue) {\n angle = Math.PI * val / maxValue;\n }\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetWidth * 0.5;\n r = canvas.width / 2 - canvas.width / 2 * 0.05;\n drawGauge(angle);\n drawPointer(angle);\n drawGaugeSpeeds();\n drawSpeed(target);\n if (Math.round(target * 10) != Math.round(currentValue * 10)) {\n currentValue += inclineCalculation(target, val);\n window.requestAnimationFrame(draw);\n }\n\n}", "function updateProgress() {\n let progressLabel = ui.Label({\n value: 'Scanning image collections ' + processedCount + ' of ' + collectionCount,\n style: {fontWeight: 'bold', fontSize: '12px', margin: '10px 5px'}\n });\n\n progressPanel.clear();\n progressPanel.add(progressLabel)\n }", "function fillCircular() {\n diff = ((i/100)*Math.PI*2*10);\n ctx.clearRect(0, 0, cw, ch); // Clear canvas every time when function is call\n ctx.lineWidth = 5; // size of stroke;\n ctx.fillStyle = \"#fff\" // Color that you want to fill in ctx/circle\n ctx.strokeStyle = \"#F5E0A9\"; // Stroke Color\n ctx.beginPath();\n ctx.arc(22, 25, 20, pointToFill, diff/10 + pointToFill); // arc(x, y, radius, start, stop)\n if (i <= 25) {\n ctx.strokeStyle = \"#c23616\";\n }\n if (i > 25 && i <= 50) {\n ctx.strokeStyle = \"#fbc531\";\n }\n if (i > 50 && i <= 75) {\n ctx.strokeStyle = \"#44bd32\";\n }\n if (i > 75 && i <= 100) {\n ctx.strokeStyle = \"#487eb0\";\n }\n ctx.stroke();\n\n if (i >= val) {\n clearTimeout(fill);\n }\n i++;\n }", "updateParticle(){\n //let distance from the center \n let distance = Math.sqrt(\n ((this.x - r1X) * (this.x - r1X)) \n + ((this.y - r1Y) * (this.y - r1Y))\n )\n if (distance > 150){\n this.color = particleColor\n }\n let distance2 = Math.sqrt(\n ((this.x - r2X) * (this.x - r2X))\n + ((this.y - r2Y) * (this.y - r2Y))\n )\n if(distance2 > 135 && distance >=150){\n this.color = particleColorAlfa\n this.x = 350\n this.y = 350\n }\n //move particle\n this.x += this.directionX \n this.y += this.directionY *2\n // draw particle\n this.draw();\n }", "update(){\n this.graphics.clear();\n for(let bar of this.healthBars){\n if(!bar.visible){\n continue;\n }\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.health/100);\n this.draw(bar);\n }\n for(let bar of this.progressBars){\n if(bar.track.state === \"closed\"){\n bar.visible = true;\n }\n else{\n bar.visible = false;\n }\n if(bar.visible){\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.tapCount/bar.track.maxTap);\n this.draw(bar);\n }\n }\n }", "updateRadiusStep() {\n\n\t\tconst r = this.r / this.samples;\n\t\tthis.uniforms.get(\"radiusStep\").value.set(r, r).divide(this.resolution);\n\n\t}", "function progressUpdate(event){\n\t\tconsole.log(questionCount);\n\t\tif (gameCount > 0) {\n\t\t\tprogressCount = questionCount - 5;\n\t\t}\n\t\telse {\n\t\t\tprogressCount = questionCount;\n\t\t}\n\n\t\tvar progressItem = progressArray[progressCount];\n\n\t\tif(event && progressItem.find('#incorrect_circle').is(':hidden')){\n\t\t\tprogressItem.addClass('progress_correct');\n\t\t\tprogressItem.find('#correct_circle').show();\n\t\t}\n\t\telse {\n\t\t\tprogressItem.addClass('progress_incorrect');\n\t\t\tprogressItem.find('#incorrect_circle').show();\n\t\t}\n\t}", "function updateProgressBar(el, currentValue, finalValue) {\n\tlet progressPercentage = currentValue / finalValue;\n\tlet parentWidth = el.parentElement.offsetWidth;\n\tif (progressPercentage <= 1) {\n\t\tlet progressWidth = progressPercentage * parentWidth;\n\t\tel.style.width = `${progressWidth}px`;\n\t\tif (progressPercentage < 0.35) el.style.background = \"var(--red)\";\n\t\telse if (progressPercentage > 0.35 && progressPercentage < 0.75) el.style.background = \"var(--yellow)\";\n\t\telse el.style.background = \"var(--green)\";\n\t}\n\tif (progressPercentage == 1) {\n\t\tif (!isPowerUpActive && !core.destroyed) {\n\t\t\tprogressPercentage = 0;\n\t\t\tpowerupContainer.classList.remove(\"hide\");\n\t\t\tpowerupProgressbarContainer.classList.add(\"hide\");\n\t\t\tpowerupProgressInfoEl.classList.add(\"hide\");\n\t\t}\n\t}\n}", "function updateProgress() {\n elements.progressBar.style.width = `${\n (elements.video.currentTime / elements.video.duration) * 100\n }%`;\n elements.currentTime.textContent = `${displayTime(\n elements.video.currentTime\n )} / `;\n elements.durationTime.textContent = `${displayTime(elements.video.duration)}`;\n}", "function updateProgress(oEvent){}", "function updateChart() {\n extent = d3.event.selection;\n // console.log(extent);\n // console.log(x.invert(extent[0][0]));\n // lol();\n myCircle.classed(\"selected\", function(d){ return isBrushed(extent, x(d.Sepal_Length), y(d.Petal_Length) ) } )\n }", "update_xyz_circle(){\n let x_px = this.meters_to_x_px(this.xyz[0])\n let y_px = this.meters_to_y_px(this.xyz[1])\n //let z_px = dui2.meters_to_x_px(xyz[2]) //don't do as range slider has its min and max\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [id=xy_2d_slider] [cx]\", x_px)\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [id=xy_2d_slider] [cy]\", y_px)\n selector_set_in_ui(\"#\" + this.show_window_elt_id + \" [name=z_slider] [value]\", this.xyz[2])\n }", "function updateValues() {\n const deposits = TransactionData.map((transaction) => transaction.deposit);\n const loans = TransactionData.map((transaction) => transaction.loan);\n total_deposit = deposits.reduce((acc, item) => (acc += item), 0).toFixed(2);\n total_loan = loans.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const bal = total_deposit - total_loan;\n balance.innerText = `$${bal}`;\n money_plus.innerText = `$${total_deposit}`;\n money_minus.innerText = `$${total_loan}`;\n reco.innerText =\n bal >= 0\n ? \"You Have Sound Financial Health\"\n : \"Your Financial Health is Weak\";\n drawChart();\n}", "function updateChart() {\n\n // Recover the new scale\n var newX = d3.event.transform.rescaleX(x);\n var newY = d3.event.transform.rescaleY(y);\n\n // Update axes with these new boundaries\n xAxis.call(d3.axisBottom(newX))\n yAxis.call(d3.axisLeft(newY))\n\n // Update circle position\n \n scat.attr('cx', function (d) {\n return newX(d.Date)\n })\n .attr('cy', function (d) {\n return newY(d.Popularity_log)\n });\n }", "function update() {\n // check values of user settings\n if (min.value < 0) {\n alert(\"Minimum cannot be smaller than 0!\");\n return;\n }\n if (max.value > 1) {\n alert(\"Maximum cannot be bigger than 1!\");\n return;\n }\n if (min.value > max.value) {\n alert(\"Minimum cannot be bigger than Maximum!\");\n return;\n }\n if (windowSize.value > maxWindow) {\n alert(\"Window size cannot be bigger than the whole window!\");\n return;\n }\n if (stepSize.value > maxWindow) {\n alert(\"Step size cannot be bigger than the whole window!\");\n return;\n }\n\n // remove current visualization\n $(\"svg\").empty();\n [links_to_draw, barlinks_to_draw, fdglinks_to_draw] = calculateCorrelation(parseFloat(current.value) - 1, windowSize.value);\n heatmap(categories, links_to_draw);\n\n rangeslider.step = stepSize.value;\n style.innerHTML = \".myslider::-webkit-slider-thumb { width: \" + 100 * windowSize.value / maxWindow + \"% !important;}\";\n modified = false;\n\n finalResult.length = 0;\n\n parallelcalculation();\n }", "function updateProgressBar() {\n let progressBar = document.getElementById(\"progress\");\n let percent = bodyArray.length * 2;\n let percentFullDisplay = document.getElementById(\"percent-full-value-display\");\n progressBar.style.width = percent + \"%\";\n percentFullDisplay.innerText = percent + \"%\";\n\n }", "function setProgressDistance() {\n var polyline = new GPolyline(progressArray);\n progressDistance = polyline.getLength();\n }", "update() {\n for ( let i = 0; i < this.barNodes.length; i++ ) {\n this.barNodes[ i ].update();\n }\n }", "function setProgressBar() {\n monthlyProgress = daysMetGoal/daysInMonth;\n monthlyProgress = Math.round(monthlyProgress * 100, 0);\n var barLength = 1;\n if(statIndex == 1){\n if(monthlyProgress > 0){\n\t\tbarLength = monthlyProgress * .9; //divide by 9/10 since the progress bar is only 90 pixels wide\n\t}\n \tstatDisplay.setCursor(90, 55);\n\tstatDisplay.writeString(font, 1, '| ' + monthlyProgress + '%', 1, true);\n }\n else if (statIndex == 0){\n\tif(progress > 0) {\n\t\tbarLength = progress * .9;\n\t}\n\tstatDisplay.setCursor(90, 55);\n \tstatDisplay.writeString(font, 1, '| ' + progress + '%', 1, true);\n }\n barLength = Math.round(barLength);\n if(barLength > 90){ //if over 90 pixels, max out at 90 to prevent overwriting pixels\n barLength = 90;\n }\n statDisplay.setCursor(1,1);\n statDisplay.drawLine(1, 55, barLength, 55, 1);\n statDisplay.drawLine(1, 56, barLength, 56, 1);\n statDisplay.drawLine(1, 57, barLength, 57, 1);\n statDisplay.drawLine(1, 58, barLength, 58, 1);\n statDisplay.drawLine(1, 59, barLength, 59, 1);\n statDisplay.drawLine(1, 60, barLength, 60, 1);\n statDisplay.drawLine(1, 61, barLength, 61, 1);\n}", "draw(pen) {\n\n // Don't draw anything if health is 0\n if (this.health === 0) {\n return;\n }\n\n // Draw extra ball instead\n if (this.isExtraBall) {\n let drawCirc = () => {\n \n // Draw animated outer circles\n pen.clearRect(this.xPos, this.yPos, this.width, this.width);\n\n pen.fillStyle = '#ffffff';\n pen.beginPath();\n pen.arc(\n this.xPos + (this.width / 2), \n (this.yPos + (this.width / 2)), \n 7, 0, 2 * Math.PI\n );\n pen.fill();\n\n pen.strokeStyle = '#ffffff';\n pen.lineWidth = 3;\n pen.beginPath();\n pen.arc(\n this.xPos + (this.width / 2), \n this.yPos + (this.width / 2), \n this.outerCircSize, \n 0, 2 * Math.PI\n );\n pen.stroke();\n if (this.outerCircSize <= 12) {\n this.outerCircIncrementer = 1;\n } else if (this.outerCircSize >= 15) {\n this.outerCircIncrementer = -1;\n }\n this.shouldIncrement = !this.shouldIncrement;\n\n if (this.shouldIncrement) {\n this.outerCircSize += this.outerCircIncrementer;\n }\n }\n drawCirc();\n\n return;\n }\n\n // Dynamically set color\n let score = gameController.score;\n this.h = (this.health - score) * 4 + 35;\n this.s = 80;\n this.l = 60;\n\n this.color = `hsl(${this.h}, ${this.s}%, ${this.l}%)`;\n pen.fillStyle = this.color;\n pen.beginPath();\n pen.fillRect(this.xPos, this.yPos, this.width, this.width);\n pen.fill();\n\n pen.font = '20px sans-serif';\n pen.fillStyle = '#000000';\n pen.textAlign = 'center';\n pen.fillText(\n this.health.toString(), \n this.xPos + (this.width / 2),\n this.yPos + (this.width / 2) + 8,\n this.width - 4\n );\n }", "function animate(){\n //2.use requestAnimationFrame() function that takes animate function as an argument, and that will create a loop\n requestAnimationFrame(animate);\n //to clear canvas every time the new circle is drawn-->when the function is being called\n c.clearRect(0, 0, innerWidth, innerHeight);\n //executing draw function inside an object\n //circle.update();\n\n //call the update() on every[i]\n for(var i = 0; i < circleArray.length; i++){\n circleArray[i].update();\n }\n}", "function updateProgressValue() {\n progressBar.max = song.duration;\n progressBar.value = song.currentTime;\n document.querySelector('.currentTime').innerHTML = (formatTime(Math.floor(song.currentTime)));\n if (document.querySelector('.durationTime').innerHTML === \"NaN:NaN\") {\n document.querySelector('.durationTime').innerHTML = \"0:00\";\n } else {\n document.querySelector('.durationTime').innerHTML = (formatTime(Math.floor(song.duration)));\n }\n}", "function updateProgress() {\n $(\"#progressBar\").css(\"width\", _progress + \"%\");\n }", "function set_progress_bar_chart() {\r\n\r\n j$('.rd_pb_holder').waypoint(function () {\r\n j$(this).find('.progress_bar_sc').each(function (index) {\r\n var j$this = j$(this),\r\n bar = j$this.find('.pb_bg'),\r\n bar_stripe = j$this.find('.pb_stripe'),\r\n val = bar.data('percentage-value');\r\n\r\n setTimeout(function () {\r\n bar.css({\"width\": val + '%'});\r\n bar_stripe.css({\"width\": val + '%'});\r\n }, index * 200);\r\n });\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.rd_pie_01').waypoint(function () {\r\n\r\n\r\n var x = 260;//set the x - center here\r\n var y = 200;//set the y - center here\r\n var r = 154;//set the radius here\r\n var linewidth = 22;//set the line width here\r\n var SET_PERCENTAGE = j$(this).children('.rd_pc_01').data('percentage-value');\r\n var bar_color = j$(this).children('.rd_pc_01').data('bar-color');\r\n var alt_color = j$(this).children('.rd_pc_01').data('bar-alt-color');\r\n\r\n//========\r\n var c = j$(this).children('.rd_pc_01').get(0);\r\n var id = j$(this).attr('id');\r\n var status = j$('#' + id + '.rd_pc_status');\r\n var loaded = false;\r\n\r\n window.onload = function () {\r\n\r\n loaded = true;\r\n }\r\n\r\n\r\n var ROTATION = 0;\r\n\r\n function setcanvas() {\r\n var ctx = c.getContext(\"2d\");\r\n\r\n ctx.translate(x, y);\r\n ctx.rotate((Math.PI / 180) * (-ROTATION));\r\n ctx.translate(-x, -y);\r\n\r\n\r\n ctx.clearRect(0, 0, c.width, c.height);\r\n\r\n\r\n }\r\n\r\n function getPoint(c1, c2, radius, angle) {\r\n return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];\r\n }\r\n\r\n function setPercent(uplimit) {\r\n var ctx = c.getContext(\"2d\");\r\n ctx.beginPath();\r\n ctx.translate(x, y);\r\n ROTATION = 270;\r\n ctx.rotate((Math.PI / 180) * ROTATION);\r\n ctx.translate(-x, -y);\r\n ctx.lineWidth = linewidth;//40\r\n ctx.lineCap = \"round\";\r\n var my_gradient = ctx.createLinearGradient(-0, 0, 0, 520);\r\n my_gradient.addColorStop(0, bar_color);\r\n my_gradient.addColorStop(1, alt_color);\r\n\r\n ctx.strokeStyle = my_gradient;\r\n ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0);\r\n ctx.globalAlpha = 1;\r\n ctx.stroke();\r\n\r\n\r\n }\r\n\r\n function callcanvas(degree) {\r\n setcanvas();\r\n setPercent(360 - degree);\r\n }\r\n\r\n var degree = parseInt((SET_PERCENTAGE * 360) / 100);\r\n var start = 0;\r\n var it = window.setInterval(function () {\r\n callcanvas(start);\r\n start++;\r\n if (start == degree) {\r\n start = degree;\r\n window.clearInterval(it);\r\n }\r\n if (loaded) status.html(parseInt((start * 100) / 360) + '%');\r\n }, 1);\r\n j$(this).children('.rd_pc_01').removeClass('rd_pc_01');\r\n\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.rd_pie_02').waypoint(function () {\r\n\r\n\r\n var x = 260;//set the x - center here\r\n var y = 200;//set the y - center here\r\n var r = 194;//set the radius here\r\n var linewidth = 12;//set the line width here\r\n var SET_PERCENTAGE = j$(this).children('.rd_pc_02').data('percentage-value');\r\n var bar_color = j$(this).children('.rd_pc_02').data('bar-color');\r\n var alt_color = j$(this).children('.rd_pc_02').data('bar-alt-color');\r\n var track_color = j$(this).children('.rd_pc_02').data('track-color');\r\n var p_color = j$(this).children('.rd_pc_02').data('percentage-color');\r\n var bg_color = j$(this).children('.rd_pc_02').data('background-color');\r\n\r\n var c = j$(this).children('.rd_pc_02').get(0);\r\n var id = j$(this).attr('id');\r\n var status = j$('#' + id + '.rd_pc_status');\r\n var loaded = false;\r\n\r\n window.onload = function () {\r\n\r\n loaded = true;\r\n }\r\n\r\n\r\n var ROTATION = 0;\r\n\r\n function setcanvas() {\r\n var ctx = c.getContext(\"2d\");\r\n\r\n ctx.translate(x, y);\r\n ctx.rotate((Math.PI / 180) * (-ROTATION));\r\n ctx.translate(-x, -y);\r\n\r\n\r\n ctx.clearRect(0, 0, c.width, c.height);\r\n\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 170;\r\n ctx.strokeStyle = bg_color;\r\n ctx.arc(x, y, 98 + (linewidth / 2), 0, 2 * Math.PI);\r\n ctx.stroke();\r\n ctx.fillStyle = p_color;\r\n ctx.fill();\r\n\r\n }\r\n\r\n function getPoint(c1, c2, radius, angle) {\r\n return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];\r\n }\r\n\r\n function setPercent(uplimit) {\r\n var ctx = c.getContext(\"2d\");\r\n ctx.beginPath();\r\n ctx.translate(x, y);\r\n ROTATION = 270;\r\n ctx.rotate((Math.PI / 180) * ROTATION);\r\n ctx.translate(-x, -y);\r\n ctx.lineWidth = linewidth;//40\r\n var my_gradient = ctx.createLinearGradient(-0, 0, 0, 520);\r\n my_gradient.addColorStop(0, bar_color);\r\n my_gradient.addColorStop(1, alt_color);\r\n\r\n ctx.strokeStyle = my_gradient;\r\n ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0);\r\n ctx.globalAlpha = 1;\r\n ctx.stroke();\r\n\r\n\r\n }\r\n\r\n function callcanvas(degree) {\r\n setcanvas();\r\n setPercent(360 - degree);\r\n }\r\n\r\n var degree = parseInt((SET_PERCENTAGE * 360) / 100);\r\n var start = 0;\r\n var it = window.setInterval(function () {\r\n callcanvas(start);\r\n start++;\r\n if (start == degree) {\r\n start = degree;\r\n window.clearInterval(it);\r\n }\r\n if (loaded) status.html(parseInt((start * 100) / 360) + '%');\r\n }, 1);\r\n j$(this).children('.rd_pc_02').removeClass('rd_pc_02');\r\n\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.rd_pie_03').waypoint(function () {\r\n\r\n\r\n var x = 260;//set the x - center here\r\n var y = 200;//set the y - center here\r\n var r = 190;//set the radius here\r\n var linewidth = 16;//set the line width here\r\n var SET_PERCENTAGE = j$(this).children('.rd_pc_03').data('percentage-value');\r\n var bar_color = j$(this).children('.rd_pc_03').data('bar-color');\r\n var alt_color = j$(this).children('.rd_pc_03').data('bar-alt-color');\r\n var track_color = j$(this).children('.rd_pc_03').data('track-color');\r\n var p_color = j$(this).children('.rd_pc_03').data('percentage-color');\r\n var bg_color = j$(this).children('.rd_pc_03').data('background-color');\r\n\r\n var c = j$(this).children('.rd_pc_03').get(0);\r\n var id = j$(this).attr('id');\r\n var status = j$('#' + id + '.rd_pc_status');\r\n var loaded = false;\r\n\r\n window.onload = function () {\r\n\r\n loaded = true;\r\n }\r\n\r\n\r\n var ROTATION = 0;\r\n\r\n function setcanvas() {\r\n var ctx = c.getContext(\"2d\");\r\n\r\n ctx.translate(x, y);\r\n ctx.rotate((Math.PI / 180) * (-ROTATION));\r\n ctx.translate(-x, -y);\r\n\r\n\r\n ctx.clearRect(0, 0, c.width, c.height);\r\n\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 16;\r\n ctx.strokeStyle = track_color;\r\n ctx.arc(x, y, r, 0, 2 * Math.PI);\r\n ctx.stroke();\r\n\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 20;\r\n ctx.strokeStyle = p_color;\r\n ctx.arc(x, y, 42 + (linewidth / 2), 0, 2 * Math.PI);\r\n ctx.stroke();\r\n ctx.fillStyle = p_color;\r\n ctx.fill();\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 16;\r\n ctx.strokeStyle = bg_color;\r\n ctx.arc(x, y, 178 - (linewidth / 2), 0, 2 * Math.PI);\r\n ctx.stroke();\r\n }\r\n\r\n function getPoint(c1, c2, radius, angle) {\r\n return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];\r\n }\r\n\r\n function setPercent(uplimit) {\r\n var ctx = c.getContext(\"2d\");\r\n ctx.beginPath();\r\n ctx.translate(x, y);\r\n ROTATION = 270;\r\n ctx.rotate((Math.PI / 180) * ROTATION);\r\n ctx.translate(-x, -y);\r\n ctx.lineWidth = linewidth;//40\r\n var my_gradient = ctx.createLinearGradient(-0, 0, 0, 520);\r\n my_gradient.addColorStop(0, bar_color);\r\n my_gradient.addColorStop(1, alt_color);\r\n\r\n ctx.strokeStyle = my_gradient;\r\n ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0);\r\n ctx.globalAlpha = 1;\r\n ctx.stroke();\r\n\r\n\r\n }\r\n\r\n function callcanvas(degree) {\r\n setcanvas();\r\n setPercent(360 - degree);\r\n }\r\n\r\n var degree = parseInt((SET_PERCENTAGE * 360) / 100);\r\n var start = 0;\r\n var it = window.setInterval(function () {\r\n callcanvas(start);\r\n start++;\r\n if (start == degree) {\r\n start = degree;\r\n window.clearInterval(it);\r\n }\r\n if (loaded) status.html(parseInt((start * 100) / 360) + '%');\r\n }, 1);\r\n j$(this).children('.rd_pc_03').removeClass('rd_pc_03');\r\n\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.rd_pie_04').waypoint(function () {\r\n\r\n\r\n var x = 170;//set the x - center here\r\n var y = 100;//set the y - center here\r\n var r = 84;//set the radius here\r\n var SET_PERCENTAGE = j$(this).children('.rd_pc_04').data('percentage-value');\r\n var bar_color = j$(this).children('.rd_pc_04').data('bar-color');\r\n var alt_color = j$(this).children('.rd_pc_04').data('bar-alt-color');\r\n var track_color = j$(this).children('.rd_pc_04').data('track-color');\r\n\r\n var c = j$(this).children('.rd_pc_04').get(0);\r\n var id = j$(this).attr('id');\r\n var status = j$('#' + id + '.rd_pc_status');\r\n var loaded = false;\r\n\r\n window.onload = function () {\r\n\r\n loaded = true;\r\n }\r\n\r\n\r\n var ROTATION = 0;\r\n\r\n function setcanvas() {\r\n var ctx = c.getContext(\"2d\");\r\n\r\n ctx.translate(x, y);\r\n ctx.rotate((Math.PI / 180) * (-ROTATION));\r\n ctx.translate(-x, -y);\r\n\r\n ctx.clearRect(0, 0, c.width, c.height);\r\n ctx.beginPath();\r\n ctx.lineWidth = 4;\r\n ctx.strokeStyle = track_color;\r\n ctx.arc(x, y, r, 0, 2 * Math.PI);\r\n ctx.stroke();\r\n }\r\n\r\n function getPoint(c1, c2, radius, angle) {\r\n return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];\r\n }\r\n\r\n function setPercent(uplimit) {\r\n var ctx = c.getContext(\"2d\");\r\n ctx.beginPath();\r\n ctx.translate(x, y);\r\n ROTATION = 270;\r\n ctx.rotate((Math.PI / 180) * ROTATION);\r\n ctx.translate(-x, -y);\r\n ctx.lineWidth = 4;\r\n\r\n var my_gradient = ctx.createLinearGradient(-0, 0, 0, 340);\r\n my_gradient.addColorStop(0, bar_color);\r\n my_gradient.addColorStop(1, alt_color);\r\n ctx.strokeStyle = my_gradient;\r\n ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0);\r\n ctx.stroke();\r\n\r\n\r\n ctx.beginPath();\r\n var a = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[0];\r\n var b = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[1];\r\n nr = 7;\r\n ctx.arc(a, b, nr, 0, 2 * Math.PI);\r\n ctx.lineWidth = 4;\r\n ctx.fillStyle = track_color;\r\n ctx.fill();\r\n ctx.fillStyle = bar_color;\r\n ctx.stroke();\r\n\r\n }\r\n\r\n function callcanvas(degree) {\r\n setcanvas();\r\n setPercent(360 - degree);\r\n }\r\n\r\n var degree = parseInt((SET_PERCENTAGE * 360) / 100);\r\n var start = 0;\r\n var it = window.setInterval(function () {\r\n callcanvas(start);\r\n start++;\r\n if (start == degree) {\r\n start = degree;\r\n window.clearInterval(it);\r\n }\r\n if (loaded) status.html(parseInt((start * 100) / 360) + '%');\r\n }, 1);\r\n\r\n j$(this).children('.rd_pc_04').removeClass('rd_pc_04');\r\n\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.rd_pie_05').waypoint(function () {\r\n\r\n var x = 260;//set the x - center here\r\n var y = 200;//set the y - center here\r\n var r = 160;//set the radius here\r\n var linewidth = 80;//set the line width here\r\n var SET_PERCENTAGE = j$(this).children('.rd_pc_05').data('percentage-value');\r\n var bar_color = j$(this).children('.rd_pc_05').data('bar-color');\r\n var alt_color = j$(this).children('.rd_pc_05').data('bar-alt-color');\r\n var track_color = j$(this).children('.rd_pc_05').data('track-color');\r\n var ball_color = j$(this).children('.rd_pc_05').data('ball-color');\r\n\r\n var c = j$(this).children('.rd_pc_05').get(0);\r\n var id = j$(this).attr('id');\r\n var status = j$('#' + id + '.rd_pc_status');\r\n var loaded = false;\r\n\r\n var ctx = c.getContext(\"2d\");\r\n window.onload = function () {\r\n\r\n loaded = true;\r\n }\r\n\r\n\r\n var ROTATION = 0;\r\n\r\n function setcanvas() {\r\n\r\n ctx.translate(x, y);\r\n ctx.rotate((Math.PI / 180) * (-ROTATION));\r\n ctx.translate(-x, -y);\r\n\r\n\r\n ctx.clearRect(0, 0, c.width, c.height);\r\n\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 80;\r\n ctx.strokeStyle = track_color;\r\n ctx.arc(x, y, r, 0, 2 * Math.PI);\r\n ctx.stroke();\r\n\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 4;\r\n ctx.strokeStyle = \"black\";\r\n ctx.arc(x, y, r + (linewidth / 2), 0, 2 * Math.PI);\r\n ctx.globalAlpha = 0.02;\r\n ctx.stroke();\r\n\r\n ctx.beginPath();\r\n ctx.lineWidth = 4;\r\n ctx.strokeStyle = \"black\";\r\n ctx.arc(x, y, r - (linewidth / 2), 0, 2 * Math.PI);\r\n ctx.stroke();\r\n }\r\n\r\n function getPoint(c1, c2, radius, angle) {\r\n return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius];\r\n }\r\n\r\n function setPercent(uplimit) {\r\n ctx.beginPath();\r\n ctx.translate(x, y);\r\n ROTATION = 270;\r\n ctx.rotate((Math.PI / 180) * ROTATION);\r\n ctx.translate(-x, -y);\r\n ctx.lineWidth = linewidth;//40\r\n var my_gradient = ctx.createLinearGradient(-0, 0, 0, 520);\r\n my_gradient.addColorStop(0, bar_color);\r\n my_gradient.addColorStop(1, alt_color);\r\n\r\n ctx.strokeStyle = my_gradient;\r\n ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0);\r\n ctx.globalAlpha = 1;\r\n ctx.stroke();\r\n\r\n\r\n ctx.beginPath();\r\n var a = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[0];\r\n var b = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[1];\r\n nr = linewidth / 2;\r\n ctx.lineWidth = 2;\r\n ctx.strokeStyle = track_color;\r\n ctx.arc(a, b, nr, 0, 2 * Math.PI);\r\n ctx.fillStyle = track_color;\r\n ctx.fill();\r\n ctx.stroke();\r\n\r\n ctx.beginPath();\r\n var a = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[0];\r\n var b = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[1];\r\n nr = linewidth / 2 - 6;\r\n ctx.lineWidth = 14;\r\n ctx.strokeStyle = track_color;\r\n ctx.arc(a, b, nr, 0, 2 * Math.PI);\r\n ctx.fillStyle = ball_color;\r\n ctx.fill();\r\n ctx.stroke();\r\n\r\n }\r\n\r\n function callcanvas(degree) {\r\n setcanvas();\r\n setPercent(360 - degree);\r\n }\r\n\r\n var degree = parseInt((SET_PERCENTAGE * 360) / 100);\r\n var start = 0;\r\n var it = window.setInterval(function () {\r\n callcanvas(start);\r\n start++;\r\n if (start == degree) {\r\n start = degree;\r\n window.clearInterval(it);\r\n }\r\n if (loaded) status.html(parseInt((start * 100) / 360) + '%');\r\n }, 1);\r\n j$(this).children('.rd_pc_05').removeClass('rd_pc_05');\r\n\r\n }, {offset: '85%'});\r\n\r\n\r\n j$('.count_sc').each(function () {\r\n\r\n var countAsset = j$(this),\r\n countNumber = countAsset.find('.count_number'),\r\n countDivider = countAsset.find('.count_line').find('span'),\r\n countSubject = countAsset.find('.count_title');\r\n\r\n countNumber.countTo({\r\n onComplete: function () {\r\n countDivider.animate({\r\n 'width': 50\r\n }, 400, 'easeOutCubic');\r\n countSubject.delay(100).animate({\r\n 'opacity': 1,\r\n 'bottom': '0px'\r\n }, 600, 'easeOutCubic');\r\n }\r\n });\r\n\r\n\r\n });\r\n\r\n}", "componentDidUpdate() {\n this.drawArc();\n }", "function move() {\n let id = setInterval(frame, 1);\n function frame() {\n if(m == 60){m = 0};\n h = m + (zl * 60);\n switch(true){ \n case h < 60:\n circle.style.stroke = (`#1d59ff`); // 1\n break;\n case h < 120:\n circle.style.stroke = (`#68c4fa`); // 2\n break;\n case h < 180:\n circle.style.stroke = (`#68faf0`); // 3\n break;\n case h < 240:\n circle.style.stroke = (`#68fab7`); // 4\n break\n case h < 300:\n circle.style.stroke = (`#4CAF50`); // 5\n break;\n case h < 360:\n circle.style.stroke = (`#a5fa68`); // 6\n break;\n case h < 420:\n circle.style.stroke = (`#900080`); // 7\n break;\n case h < 480:\n circle.style.stroke = (`#e9fa68`); // 8\n break\n case h < 540:\n circle.style.stroke = (`#faa668`); // 9 \n break;\n case h <= 599:\n circle.style.stroke = (`#ff6969`); // 10\n break;\n case h < 601:\n circle.style.stroke = (`#d10101`); // fin\n break;\n }\n }\n setProgress(h);\n console.log(h);\n}", "function update() {\n\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.beginPath();\n context.arc(\n canvas.width/2,\n canvas.height/2,\n canvas.height * zoom,\n 0,\n 2 * Math.PI\n );\n context.fill();\n\n requestAnimationFrame(update);\n\n }" ]
[ "0.7361117", "0.7354367", "0.7085506", "0.7082298", "0.70655334", "0.6890237", "0.68895185", "0.6840408", "0.6812873", "0.6802857", "0.6774821", "0.6729545", "0.66958386", "0.66518766", "0.6579227", "0.6436034", "0.6435063", "0.64039564", "0.6396665", "0.6388138", "0.6374024", "0.6363955", "0.63617605", "0.62699974", "0.625251", "0.624919", "0.6247116", "0.62428653", "0.62410057", "0.62387127", "0.6214178", "0.61971855", "0.6185522", "0.6170606", "0.61703265", "0.61555874", "0.6148862", "0.6127882", "0.61245644", "0.6124271", "0.6114817", "0.6112122", "0.61025214", "0.61015767", "0.6101045", "0.60981864", "0.6080643", "0.6069854", "0.60669386", "0.6056938", "0.6055382", "0.60517025", "0.60459614", "0.60256296", "0.6023602", "0.60235876", "0.60146344", "0.59987223", "0.5994571", "0.5993804", "0.598517", "0.59791654", "0.5976341", "0.5972446", "0.59662354", "0.59655684", "0.59589726", "0.5949959", "0.59401786", "0.5939213", "0.5924502", "0.5922219", "0.59202087", "0.5917799", "0.59155023", "0.5912404", "0.59082836", "0.5891412", "0.5889451", "0.58830416", "0.58715665", "0.58709407", "0.58549464", "0.58539855", "0.5852909", "0.5851459", "0.5847973", "0.58229965", "0.5821432", "0.5820733", "0.58196807", "0.58112633", "0.5805775", "0.5803168", "0.58017474", "0.58006465", "0.5798649", "0.5790973", "0.5790568", "0.57862395" ]
0.71568716
2
Update time and date
function updateClock() { let today = new Date(); time = hours_with_leading_zeros(today) + ":" + minutes_with_leading_zeros(today); clockLabel.text = time; datum.text = dateview; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTime() {\n let updatedTime = new Date().toLocaleTimeString();\n setTime(updatedTime);\n }", "function updateTime() {\n\n}", "function updateTime() {\n const newTime = new Date().toLocaleTimeString();\n setTime(newTime);\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n let date = getToday();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n hours = addZero(hours);\n minutes = addZero(minutes);\n seconds = addZero(seconds);\n\n document.querySelector(\".date .time\").innerText = hours + \":\" + minutes + \":\" + seconds;\n // $('.date .time').text(`${hours}:${minutes}:${seconds}`);\n update = setTimeout(function () { updateTime() }, 500)\n}", "function updateTime() {\r\n getWeatherInfo();\r\n var currentTimeStamp = new Date();\r\n var currentMonth = getMonth();\r\n var currentDay = getDate();\r\n var currentDate = currentTimeStamp.getDate();\r\n var currentHour = currentTimeStamp.getHours();\r\n var currentMin = currentTimeStamp.getMinutes();\r\n // Last updated time\r\n $(\"#update-time\").text(currentHour + ':' + currentMin);\r\n $(\".date-display\").text(currentDay + ', ' + currentMonth +' ' + currentDate );\r\n }", "function updateTime() {\n\n\t\t\t//Set the time & date for the current timezone\n\t\t\t$scope.currentTime = moment().format('HH:mm');\n\t\t\t$scope.date = moment().format(\"DD\");\n\t\t\t$scope.month = moment().format(\"MMMM\");\n\t\t\t$scope.day = moment().format(\"dddd\");\n \n\t\t\t//Set the time for the different timezones\n\t\t\t$scope.AlekTime = moment().format('HH:mm');\n\t\t\t$scope.RussiaTime = moment().tz('Europe/Moscow').format('HH:mm');\n\t\t\t$scope.TokyoTime = moment().tz('Asia/Tokyo').format('HH:mm');\n\t\t\t$scope.$apply();\n\t\t}", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function updateTime(s, m, h) {\n\tseconds = s;\n\tminutes = m;\n\thours = h;\n}", "updateTime() {\n\t\tthis.setState({\n\t\t\ttime: hrOfDay(),\n\t\t\tday: timeOfDay()\n\t\t});\n\t}", "function updateTime() {\n d = day();\n h = hour();\n m = minute();\n mo = month();\n s = second();\n y = year();\n\n // time calculations for binary conversion\n st = (s - ss) / 10; // how many 10 seconds i.e. 10, 20, 30...\n ss = s % 10; // the first digit in seconds\n\n mt = (m - ms) / 10; //how many 10 mins i.e. 10, 20, 30...\n ms = m % 10; // the first digit in mins\n\n ht = (h - hs) / 10; // how many 10 hours ie. 10, 20\n hs = h % 10; // the first digit in hrs\n \n mot = (mo - mos) / 10; // how many ten days\n mos = mo % 10; // first digits in days\n \n dt = (d - ds) / 10; // how many 10 days \n ds = d % 10; // the first digit in days\n \n yts = y % 1000;\n yt = (yts - ys)/10;\n ys = yts % 10;\n\n\n}", "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "function pikaUpdateTime() {\n var currentName = pikaTimeCurrentName.value;\n if (currentName !== \"\" && typeof (currentName) !== 'undefined') {\n var hours = parseInt(pikaHour.value);\n var minutes = parseInt(pikaMinute.value);\n if (!isNaN(hours) && !isNaN(minutes)) {\n var currentDate = datepicker.GetDate(currentName);\n if (currentDate === null) {\n currentDate = new Date();\n }\n currentDate.setMinutes(minutes);\n currentDate.setHours(hours);\n var picker = datepicker.dict[currentName];\n datepicker.UpdateCalenderDateFields(picker, currentDate, currentName);\n }\n }\n }", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "function updateTime() {\r\n const date = new Date();\r\n const hour = formatTime(date.getHours());\r\n const minutes = formatTime(date.getMinutes());\r\n const seconds = formatTime(date.getSeconds());\r\n\r\n display.innerText=`${hour} : ${minutes} : ${seconds}`\r\n}", "function updateTime() {\n const date = new Date();\n const hours = date.getHours() >= 10 ? date.getHours() : \"0\" + date.getHours();\n const min =\n date.getMinutes() >= 10 ? date.getMinutes() : \"0\" + date.getMinutes();\n const sec =\n date.getSeconds() >= 10 ? date.getSeconds() : \"0\" + date.getSeconds();\n timeNav.textContent = hours + \":\" + min + \":\" + sec;\n}", "function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}", "function updatetime() {\n time.innerHTML = new Date;\n \n}", "function updateTime() {\n\t\tlet time = $(\"#time\").text();\n\t\tlet hour = parseInt(time.substring(0, 2));\n\t\tlet min = parseInt(time.substring(3, 5));\n\t\tmin += TIME_INTERVAL;\n\t\tif (min >= 60) {\n\t\t\thour += 1;\n\t\t\tmin -= 60;\n\t\t}\n\t\tif (min < 10) {\n\t\t\tmin = \"0\" + min;\n\t\t}\n\t\tif (hour < 10) {\n\t\t\thour = \"0\" + hour;\n\t\t}\n\t\tif (hour >= 24) {\n\t\t\thour -= 24;\n\t\t}\n\t\ttime = \"\" + hour + \":\" + min;\n\t\t$(\"#time\").text(time);\n\t}", "function updateTime() {\n const now = moment();\n const ourTime = now.format('MMMM Do YYYY, h:mm:ss a');\n // Print the time into the element that we set to clock\n clock.text(ourTime);\n}", "function updateTime(time) {\n //console.log(time)\n transNetwork.activeTime = time;\n transNetwork.updateNet();\n\n powNetwork.activeTime = time;\n powNetwork.updateNet();\n\n table.activeTime = time;\n table.createTable();\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime() {\n let m = String(new Date().getMinutes());\n let h = String(new Date().getHours());\n if (h.length == 1) {\n h = \"0\" + h;\n }\n if (m.length == 1) {\n m = \"0\" + m;\n }\n var time = h + \":\" + m;\n document.getElementById(\"time\").innerHTML = time;\n}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "async updateTime(req, res) {\n\t\tconst id = Number(req.params.id);\n\n\t\ttry {\n\t\t\tconst [numberOfAffectedRows, affectedRows] = await Time.update(\n\t\t\t\t{\n\t\t\t\t\ttitle: req.body.title,\n\t\t\t\t\tdescription: req.body.description,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\twhere: { id },\n\t\t\t\t\treturning: true, // needed for affectedRows to be populated\n\t\t\t\t\tplain: true, // makes sure that the returned instances are just plain objects\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn res.status(200).send({ time: affectedRows });\n\t\t} catch (error) {\n\t\t\treturn res.status(400).send(error);\n\t\t}\n\t}", "function updateTime() {\n var now = new Date(),\n minutes = now.getMinutes(),\n month = now.toLocaleString('default', { month: 'long' }),\n date = now.getDate() + ' ' + month;\n \n //Add leading zero to minutes below 10\n if (minutes < 10) minutes = '0' + minutes;\n\n //Concatinate the time\n var time = now.getHours() + ':' + minutes;\n\n //Show date and time on the page\n theDateNow.innerHTML = date;\n theTimeNow.innerHTML = time;\n\n //Show time only in the tab label\n document.title = time;\n }", "function update() {\n $(\"#currentT-input\").html(moment().format(\"H:mm:ss\"));\n}", "function DateUpdater() { }", "update(t){\n if (this.lastFrameTime == undefined) {\n this.lastFrameTime = t;\n return;\n }\n\n this.checkKeys();\n\n this.updateElements(t);\n\n this.lastFrameTime = t;\n }", "function updateTime() {\n var datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes(),\n second = datetime.getSeconds();\n\n // update the hour/minute/second hands and shadows.\n rotateElement((hour + (minute / 60) + (second / 3600)) * 30, \"body-hr-hand\");\n rotateElement((hour + (minute / 60) + (second / 3600)) * 30, \"body-hr-hand-shadow\");\n rotateElement((minute + second / 60) * 6, \"body-min-hand\");\n rotateElement((minute + second / 60) * 6, \"body-min-hand-shadow\");\n }", "function updateTime()\r\n{\r\n\t// check for invalid user\r\n\tif (localStorage.getItem('username') == undefined)\r\n\t{\r\n\t\tshowSetupPage();\r\n\t\treturn;\r\n\t}\r\n\r\n // get current date\r\n\tvar today = new Date();\r\n\r\n\tvar hour = today.getHours();\r\n\tvar minutes = today.getMinutes();\r\n\r\n\t$('.home h1').html(formatTime(hour) + \":\" + formatTime(minutes));\r\n\r\n\tvar period = hour < 12 ? 'morning' : (hour < 18 ? 'afternoon' : 'evening');\r\n\r\n\t$('.home h2').html('Good ' + period + ', ' + localStorage.getItem('username') + '.');\r\n\r\n\t// update the time information on the screen\r\n\tsetTimeout(function() {\r\n\t\tupdateTime()\r\n\t}, 1000);\r\n}", "function updateTime() {\n let d = new Date();\n let hours;\n if (d.getHours() > 12)\n hours = (d.getHours() - 12 + \"\")\n else if (d.getHours() > 0)\n hours = (d.getHours() + \"\")\n else\n hours = '12';\n let minutes = (d.getMinutes() + '').padStart(2, 0);\n let seconds = (d.getSeconds() + '').padStart(2, 0);\n let amPm = (d.getHours > 12) ? 'PM' : 'AM';\n let timeString = hours + ':' + minutes + ':' + seconds + ':' + amPm;\n document.getElementById('currentTime').innerHTML = timeString;\n}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "changeTocurrentTime(_date=this.currentdate_time){\n this.currentdate_time = _date;\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function setTimeAndDate(){\n setInterval(getCurrentTime, 1000);\n getCurrentTime();\n}", "function updateTime() {\n \t\t\tvar a = new Array(\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"); \n \t\t\tvar date = new Date();\n \t\t\tvar week = date.getDay(); \n \t\t\tvar str = \" 星期\"+ a[week]; \n \t\t\telement.text(dateFilter(date, 'yyyy-MM-dd HH:mm:ss')+\" \"+str);\n \t\t}", "function updateDate(){\n LetterDay.changeDay(curDay);\n Schedule.changeDay(curDay);\n refresh();\n }", "updateTimeField(timeField) {\n const me = this;\n timeField.on({\n change({\n userAction,\n value\n }) {\n if (userAction && !me.$settingValue) {\n const dateAndTime = me.dateField.value;\n me._isUserAction = true;\n me.value = dateAndTime ? DateHelper.copyTimeValues(dateAndTime, value) : null;\n me._isUserAction = false;\n }\n },\n\n thisObj: me\n });\n }", "updateTime() {\n\t\tlet now = new Date().getTime();\n\t\tlet x = now - this.startTime;\n\t\tlet time = moment.duration(x);\n\t\tthis.elapsedTime = clc.xterm(242)(time.hours() + 'h ') + clc.xterm(242)(time.minutes() + 'm ') + clc.xterm(242)(time.seconds() + 's');\n\t}", "function updateWatchTime(){\n\t\tif(currentPlayerVideo){\n\t\t\tif (timerNamespace.getWatchTime() > 0) {\n\t\t\t\t//post per aggiornare watchtime del video\n\t\t\t\tconsole.log(timerNamespace.getWatchTime());\n\t\t\t\t$.post(\"/watchTime\",{\n\t\t\t\t\tvideo: getCurrentPlayerId(),\n\t\t\t\t\ttime: timerNamespace.getWatchTime()\n\t\t\t\t}).done((data)=>{\n\t\t\t\t\tconsole.log(\"watch time updated\");\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function updateTime() {\n firebaseRef.child('timestamp').set(new Date().getTime());\n last_time = new Date().getTime();\n}", "function updateTime(name) {\n $(\"input[name=\\\"\" + name +\"_time\\\"]\").val( $(\"#\" + name + \"_hour\").val() +\n \":\" +\n $(\"#\" + name + \"_t_min\").val() +\n $(\"#\" + name + \"_z_min\").val()\n )\n console.log( $(\"input[name=\\\"\" + name + \"_time\\\"]\").attr(\"value\") );\n }", "function updateTimeData(s_datetime, e_datetime, status, task_id){\n $.ajax({\n url: $SCRIPT_ROOT + '/updatetask',\n data: {'StartingTime': s_datetime, 'EndingTime': e_datetime, 'status': status, 'task_id': task_id},\n type: 'POST',\n success: function(response){},\n error: function(response){ handleResponseFromServer(response); }\n });\n}", "function setUpdated(timestamp) {\n\t\tvar dateOptions = {\n\t\t\t//weekday: 'long',\n\t\t\tyear: 'numeric',\n\t\t\tmonth: 'long',\n\t\t\tday: '2-digit',\n\t\t\thour: '2-digit',\n\t\t\tminute: '2-digit',\n\t\t\tsecond: '2-digit'\n\t\t};\n\t\tvar date = new Date(timestamp);\n\t\tvar timeString = date.toLocaleTimeString('en-us', dateOptions);\n\n\t\t$('.last-update').html('Last updated: ' + timeString);\n\t}", "setTime(time) {\n this.time.setTime(time);\n }", "function updateTime() {\n var strHours = document.getElementById(\"str-hours\"),\n strConsole = document.getElementById(\"str-console\"),\n strMinutes = document.getElementById(\"str-minutes\"),\n datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes();\n\n strHours.innerHTML = hour;\n strMinutes.innerHTML = minute;\n\n if (minute < 10) {\n strMinutes.innerHTML = \"0\" + minute;\n }\n if (hour < 10) {\n \t\tstrHours.innerHTML = \"0\" + hour;\n }\n\n if (flagDigital) {\n strConsole.style.visibility = flagConsole ? \"visible\" : \"hidden\";\n flagConsole = !flagConsole;\n } else {\n strConsole.style.visibility = \"visible\";\n flagConsole = false;\n }\n }", "function updateTime(){\n const { time } = _DotGameGlobal;\n const curr = Date.now();\n time.deltaTime = (curr - time.currTime) / 1000;\n time.currTime = curr;\n}", "function updateTime() {\n var now = new Date();\n var hrs = now.getHours() > 12 ? String(now.getHours() - 12) : String(now.getHours() === 0 ? 12 : now.getHours());\n var min = now.getMinutes() < 10 ? \"0\" + String(now.getMinutes()) : String(now.getMinutes());\n var sec = now.getSeconds() < 10 ? \"0\" + String(now.getSeconds()) : String(now.getSeconds());\n sec = sec + \" \" + (now.getHours() >= 12 ? \"pm\" : \"am\");\n\n var time = hrs + \":\" + min + \":\" + sec;\n var date = [now.getMonth() + 1,\n now.getDate(),\n now.getFullYear()].join('/');\n\n // set the content of the element with the ID time to the formatted string\n document.getElementById('datetime').innerHTML = date + \" \" + time;\n\n // call this function again in 1000ms\n setTimeout(updateTime, 1000);\n}", "function updateClock() {\n // get element to update time\n let datetime = document.querySelector(\"#datetime\");\n // get time now\n //let _timeNow = moment(new Date());\n let _timeNow = moment();\n // set current time on screen\n datetime.textContent = _timeNow.format('dddd, MMMM Do YYYY, HH:mm:ss');\n // update train times every minute\n if (_timeNow.format('ss') == '00') {\n updateTimes();\n }\n}", "function SetTime() {\r\n let date = new Date();\r\n let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());\r\n \r\n document.querySelector('.order--timer').textContent = time;\r\n // console.log('updated at',time)\r\n setTimeout(SetTime, 60000);\r\n }", "function updateDate() {\n date = moment()\n dateAndTime.html(date.format('dddd, MMMM Do YYYY, h:mm:ss a'))\n}", "update(dt) {\n\n }", "function updateTime(time) {\n domVideo.currentTime = time;\n}", "function updateWatch() {\n updateTime();\n updateDate(0);\n }", "function updateclock() {\n var date = new Date();\n var hours = date.getHours() < 10 ? \"0\" + date.getHours() : date.getHours();\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\n var seconds = date.getSeconds() < 10 ? \"0\" + date.getSeconds() : date.getSeconds();\n time = hours + \"\" + minutes + \"\" + seconds;\n return time;\n }", "function onSystemTimeChanged() {\r\n updateTime();\r\n }", "function updateTimeStamp(data) {\n //Start chrono\n if (data > 0) {\n chronoStart(data);\n } else {\n chronoReset();\n }\n}", "function set(obj) {\n obj.time = util.time();\n }", "function updateClock(){\n var ahora = new Date();\n var hora = ahora.getHours();\n\tif(hora < 10) hora = \"0\" + hora;\n var min = ahora.getMinutes();\n\tif(min < 10) min = \"0\" + min;\n var sec = ahora.getSeconds();\n\tif(sec < 10) sec = \"0\" + sec;\n/* Se muestra por pantalla el reloj actualizando por segundo */\n\tclock.html(hora + \" : \" + min + \" : \" + sec);}", "function timeUpdate() {\n (setInterval(function () {\n currentTime = moment().format('HH');\n updatePlanner()\n }, 1000))\n}", "function updateTime() {\n // declare variables for am/pm & the symbols that go with them\n var timeIndicator;\n // declare date & the time/date methods to go along with them\n var today = new Date();\n var todayDayName = today.getDay();\n var todayMonth = today.getMonth();\n var todayDay = today.getDate();\n var todayYear = today.getFullYear();\n var todayHour = today.getHours();\n var todayMins = today.getMinutes();\n // switch days from 0 index to traditonal monday-sunday format\n switch (todayDayName) {\n case 0:\n todayDayName = \"Sunday\";\n break;\n case 1:\n todayDayName = \"Monday\";\n break;\n case 2:\n todayDayName = \"Tuesday\";\n break;\n case 3:\n todayDayName = \"Wednesday\";\n break;\n case 4:\n todayDayName = \"Thursday\";\n break;\n case 5:\n todayDayName = \"Friday\";\n break;\n case 6:\n todayDayName = \"Saturday\";\n break;\n default:\n todayDayName = \"Error\";\n }\n // switch months from 0 index to traditional 1-12 month format\n switch (todayMonth) {\n case 0:\n todayMonth = \"January\";\n break;\n case 1:\n todayMonth = \"February\";\n break;\n case 2:\n todayMonth = \"March\";\n break;\n case 3:\n todayMonth = \"April\";\n break;\n case 4:\n todayMonth = \"May\";\n break;\n case 5:\n todayMonth = \"June\";\n break;\n case 6:\n todayMonth = \"July\";\n break;\n case 7:\n todayMonth = \"August\";\n break;\n case 8:\n todayMonth = \"September\";\n break;\n case 9:\n todayMonth = \"October\";\n break;\n case 10:\n todayMonth = \"November\";\n break;\n case 11:\n todayMonth = \"December\";\n break;\n default:\n todayMonth = \"Error\";\n }\n // am/pm indicator\n if (todayHour <= 10) {\n timeIndicator = \"AM\";\n } else {\n timeIndicator = \"PM\";\n }\n // convert hours from military time into US standard time\n switch (todayHour) {\n case 0:\n todayHour = \"12\";\n break;\n case 1:\n todayHour = \"01\";\n break;\n case 2:\n todayHour = \"02\";\n break;\n case 3:\n todayHour = \"03\";\n break;\n case 4:\n todayHour = \"04\";\n break;\n case 5:\n todayHour = \"05\";\n break;\n case 6:\n todayHour = \"06\";\n break;\n case 7:\n todayHour = \"07\";\n break;\n case 8:\n todayHour = \"08\";\n break;\n case 9:\n todayHour = \"09\";\n break;\n case 10:\n todayHour = \"10\";\n break;\n case 11:\n todayHour = \"11\";\n break;\n case 12:\n todayHour = \"12\";\n break;\n case 13:\n todayHour = \"01\";\n break;\n case 14:\n todayHour = \"02\";\n break;\n case 15:\n todayHour = \"03\";\n break;\n case 16:\n todayHour = \"04\";\n break;\n case 17:\n todayHour = \"05\";\n break;\n case 18:\n todayHour = \"06\";\n break;\n case 19:\n todayHour = \"07\";\n break;\n case 20:\n todayHour = \"08\";\n break;\n case 21:\n todayHour = \"09\";\n break;\n case 22:\n todayHour = \"10\";\n break;\n case 23:\n todayHour = \"11\";\n break;\n default:\n todayHour = \"404\";\n }\n // force minutes to always display as double\n if (todayMins < 10) {\n todayMins = \"0\" + todayMins;\n } else {\n todayMins = todayMins;\n }\n // plug the time into the inner HTML of the container\n timeContainer.innerHTML =\n todayHour + \":\" + todayMins + timeIndicator;\n // plug the date into the inner HTML of the container\n dayContainer.innerHTML = todayDayName;\n fullDateContainer.innerHTML = todayMonth + \" \" + todayDay + \", \" + todayYear;\n}", "async updateTimebar() {\n this.timeText = await this.time.getCurrentTime();\n this.tag('Time').patch({ text: { text: this.timeText } });\n }", "function updateTime(nTime){\n // function to update time\n var showTime=\"\";\n var h=Math.floor(nTime/3600);\n var m=Math.floor(nTime/60-h*60);\n var s=Math.floor(nTime%60);\n //console.log(h);\n //console.log(m);\n //console.log(s);\n if(h!=0){\n if(h<10)\n showTime+=\"0\"+h.toString();\n else\n showTime+=h.toString();\n }\n else\n showTime+=\"00\";\n if(m!=0){\n showTime+=\":\";\n if(m<10)\n showTime+=\"0\"+m.toString();\n else\n showTime+=m.toString();\n }\n else\n showTime+=\":00\";\n if(s!=0){\n showTime+=\":\";\n if(s<10)\n showTime+=\"0\"+s.toString();\n else\n showTime+=s.toString();\n }\n else\n showTime+=\":00\";\n\n $('#time').text(showTime);\n }", "liveTime() {\n\t\tthis.updateTime();\n\t\tthis.writeLog();\n\t}", "function update_clock(time)\r\n{\r\n clock_time = time;\r\n document.getElementById('clock').innerHTML = hh_mm_ss(time);\r\n check_old_records(time);\r\n}", "function setTime( t ){\n\n this.time = t;\n\n }", "updateTime () {\n const time = moment().utc().format(timeFormat).toString();\n this.setState({ currentTime: time });\n }", "function setDateAndTime() {\n var today = new Date();\n \n var hours = parseFloat(today.getHours());\n var hoursStr = hours.toString();\n if(hours < 10)\n hoursStr = \"0\" + hours.toString();\n \n var mins = parseFloat(today.getMinutes());\n var minsStr = mins.toString();\n if(mins < 10)\n minsStr = \"0\" + mins.toString();\n \n var secs = parseFloat(today.getSeconds());\n var secsStr = secs.toString();\n if(secs < 10)\n secsStr = \"0\" + secs.toString();\n \n time = hoursStr + \":\" + minsStr + \":\" + secsStr;\n date = (today.getMonth()+1)+'/' + today.getDate()+'/'+today.getFullYear();\n}", "update(dt) {\n logID(1007);\n }", "function updateClock(){\n\tlet dt = new Date();\n\t\n\tlet month = ((\"0\"+(dt.getMonth()+1)).slice(-2));\n\t\n\tlet day = ((\"0\"+dt.getDate()).slice(-2));\n\t\n\tlet year = (dt.getFullYear());\n\t\n\tdocument.getElementById(\"date\").innerHTML = month + \"/\" + day + \"/\" + year;\n\t\n\tlet hour = ((\"0\"+dt.getHours()).slice(-2));\n\t\n\tlet min = ((\"0\"+dt.getMinutes()).slice(-2) );\n\t\n\tlet sec = ((\"0\"+dt.getSeconds()).slice(-2) )\n\t\n\tdocument.getElementById(\"time\").innerHTML = hour + \":\" + min + \":\" + sec;\n}", "function setUpTime() {\n if ($scope.event) {\n $scope.time = {\n value: new Date($scope.event.time * 1000)\n };\n }\n else {\n $scope.time = {\n value: new Date()\n }\n }\n\n timeChanged();\n }", "function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}", "async timeToCompare(context, date) {\n try {\n\n let d = new Date(date),\n hour = \"\" + d.getHours(),\n minute = \"\" + d.getMinutes(),\n second = \"\" + d.getSeconds();\n\n if (hour.length < 2) hour = \"0\" + hour;\n if (minute.length < 2) minute = \"0\" + minute;\n if (second.length < 2) second = \"0\" + second;\n \n const now = hour + \":\" + minute + \":\" + second;\n\n context.commit('updateNow', now);\n\n } catch (error) {\n context.commit('getError', error);\n }\n }", "function updateDisplayTime() {\n\t\tvar date = new Date();\n\n\t\tvar hours = date.getHours();\n\t\tvar minutes = date.getMinutes();\n\t\tvar seconds = date.getSeconds();\n\t\tvar year = date.getFullYear();\n\t\tvar month = date.getMonth() + 1;\n\t\tvar day = date.getDate();\n\t\tvar ampm = \"AM\";\n\n\t\tif (hours > 11) {\n\t\t\tampm = \"PM\";\n\t\t}\n\n\t\tif (hours > 12) {\n\t\t\thours -=12;\n\t\t}\n\n\t\tif(minutes < 10) {\n\t\t\tminutes = \"0\" + minutes;\n\t\t}\n\n\t\tif (seconds < 10) {\n\t\t\tseconds = \"0\" + seconds;\n\t\t}\n\n\t\tvar displayTime = hours + \":\" + minutes + \":\" + seconds + \" \" + ampm;\n\n\t\t$(\"#displayTime\").html(displayTime)\n\t}", "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }", "function timedUpdate () {\n updateLocalClock();\n newCityTz();\n setTimeout(timedUpdate, 1000);\n}", "updateCurrentMSecs () {\n this.currentMSecs = Date.now();\n }", "set time(value) {}", "function updateWatch() {\n updateTime();\n }", "function updateTime(){\n\n var usaDate = new Date();\n document.getElementById('date').innerHTML = usaDate.getDate() + ' / ' + (usaDate.getMonth()+1) + ' / ' + (usaDate.getFullYear()+47);\n document.getElementById('time').innerHTML = addLeadingZero(changeTimeZero(usaDate.getHours()-9)) + ' : ' + addLeadingZero(usaDate.getMinutes()) + ' : ' + addLeadingZero(usaDate.getSeconds());\n function addLeadingZero(number){\n if (number < 10) {\n number = '0'+ number;\n }\n return number;\n }\n\n function changeTimeZero(time){\n if (time < 0) {\n time = 24 + time;\n }\n return time;\n }\n\n}", "function updateMapTime()\n {\n \t if(eventSliderOb != null)\n \t {\n \t \t//dateTime = eventSliderOb.getDateTime();\n\t\tvar dateTimeStr = eventSliderOb.getDateTimeInitialValue();\n\t\t\n\t\t//Upate with date time parameter\n\t\twmsLayer.paramsOb[timeDim] = dateTimeStr;\n\t\twmsLayer.refresh();\n\t\t \t \t\n \t \tupdateAnimationWidget(dateTimeStr);\n \t }\n }", "function updateTimeStamp(x) {\n x.timestamp = moment()\n return true;\n}", "function setTime() {\n var hours = $('input[name=\"schedule_hour_submit\"]').val();\n var minutes = $('input[name=\"schedule_minute_submit\"]').val();\n if (!_.isEmpty(hours) && !_.isEmpty(minutes)) {\n schedule.scheduleTime = $('input[name=\"schedule_hour_submit\"]').val() + ':' + $('input[name=\"schedule_minute_submit\"]').val() + ' ' + $('select[name=\"schedule_ampm_submit\"] option:selected').val();\n }\n\n if (!_.isNull(schedule.scheduleDate) && !_.isNull(schedule.scheduleTime)) {\n var date = moment(schedule.scheduleDate).format('DD-MM-YYYY');\n var datetime = date + ' ' + schedule.scheduleTime;\n schedule.scheduleDateTime = moment(datetime, 'DD-MM-YYYY hh:mm a');\n }\n\n }", "setValue(new_value) {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = dayjs__WEBPACK_IMPORTED_MODULE_4__(this.date)\n .hour(+time[0])\n .minute(+time[1])\n .startOf('m');\n this._onChange(date.valueOf());\n }\n }", "function timeUpdate(data){\n var t = new Date();\n var curHr = t.getHours();\n var curMin = t.getMinutes();\n //var curSec = t.getSeconds();\n\n\n var recordTime = data.time;\n var hh_mm_ss = recordTime.split(\":\");\n\n var startDate = new Date(0, 0, 0, curHr, curMin, 0);\n var endDate = new Date(0, 0, 0, hh_mm_ss[0], hh_mm_ss[1], 0);\n var diff = Math.abs( endDate.getTime() - startDate.getTime() );\n\n if(Math.floor(diff/1000)<30){\n return \"just now\";\n }\n else if(Math.floor(diff/1000<60)){\n return \"few seconds ago\";\n }\n else{\n var hours = Math.floor(diff / 1000 / 60 / 60);\n if(hours <1){\n diff -= hours * 1000 * 60 * 60;\n var minutes = Math.floor(diff / 1000 / 60);\n return minutes +\" minutes ago\";\n }\n else{\n return hours + \" hours ago\";\n }\n\n }\n}", "function hourUpdate(){\n var timeReadable = moment().format('MMMM Do YYYY, h:mm:ss a');\n $('#mainHead1').children().last().html(\"<h6>\" + timeReadable + \"</h6>\");\n \n }" ]
[ "0.76255494", "0.75386393", "0.7446813", "0.7429026", "0.7363747", "0.7363747", "0.7329258", "0.7313451", "0.7299319", "0.72971725", "0.72785825", "0.7238492", "0.7162296", "0.7158282", "0.7142217", "0.71220905", "0.70797336", "0.7063143", "0.7053305", "0.7010975", "0.7005984", "0.7005984", "0.691362", "0.6896331", "0.6871983", "0.68135184", "0.6791564", "0.6786047", "0.6744821", "0.6672505", "0.66361934", "0.6634351", "0.6612822", "0.66011906", "0.66011906", "0.66011906", "0.66011906", "0.65778065", "0.6571956", "0.65548193", "0.6547653", "0.6544218", "0.6523912", "0.6520476", "0.65182877", "0.6504017", "0.64958227", "0.64683425", "0.6457865", "0.6451676", "0.64385027", "0.6428066", "0.64177835", "0.6411799", "0.6404622", "0.639462", "0.6391102", "0.63840455", "0.63835675", "0.6380544", "0.6370417", "0.6364093", "0.63623023", "0.6361631", "0.6360588", "0.6358566", "0.63424784", "0.6340363", "0.63390386", "0.63342166", "0.6333558", "0.63326186", "0.63259965", "0.6319622", "0.63169926", "0.63163495", "0.6296101", "0.62918526", "0.62830526", "0.6280154", "0.6279994", "0.6254163", "0.6252725", "0.6250621", "0.6248102", "0.6248083", "0.62468874", "0.62385875", "0.62382066", "0.6236285", "0.6235708", "0.6230866", "0.62282515", "0.62267184", "0.62239933", "0.6209856", "0.6194342", "0.6153491", "0.614512", "0.6142418" ]
0.6222146
95
========================================================================= LOCAL SIGNUP ============================================================ =========================================================================
function generateHash(password) { return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signup() {\n var email = prompt(\"Give us an email address and\\nwe'll send you news about the site\", '');\n if (email)\n wt_async_request('/bin/subscribe.cgi?email=' + encodeURI_more(email), 'SUBSCRIBE',\n\t\t\t\t\t\tfunction(s) { alert(s.replace(/\\n/g,'') + ' subscribed. Thanks.') });\n}", "function signup() {\r\n try {\r\n if (!dw.system.Site.getCurrent().getCustomPreferenceValue(\"emarsysEnabled\")) {\r\n emarsysDisabledTemplate();\r\n return;\r\n }\r\n // clear form\r\n app.getForm('emarsyssignup').clear();\r\n // render the Submit Form\r\n app.getView({\r\n ContinueURL: URLUtils.https('EmarsysNewsletter-SubmitForm')\r\n }).render('subscription/emarsyssignup');\r\n } catch(e) {\r\n errorPage(e);\r\n }\r\n}", "async function sign() {\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\n const account = accounts[0];\n const name = document.getElementById(\"name\").value;\n const guess = document.getElementById(\"guess\").value;\n const bounty = await Riddle.methods.bounty().call();\n bid = parseInt(bounty) + 10;\n const transactionParameters = {\n from: account,\n gasPrice: 0x1D91CA3600,\n value: bid\n };\n await Riddle.methods.riddle_guess(name, guess).send(transactionParameters);\n}", "function h$stg_sig_install(sigNo, actionCode, sigSet_d, sigSet_o) {\n // XXX dummy implementation\n return 0;\n}", "function Useless()\n{\n\tconsole.log(\"Hardcoded command sent successfully\");\n}", "function makeChoice(sign) {\n if(sign === 'o' || sign === 'x')\n socket.emit('choose', { sign: sign })\n else\n console.log('makeChoice error: podano zly znak!');\n}", "sign(message,key = this.seckey){\n return ticCommon.sign(message,key)\n }", "async sign() {\n const { room, storage } = this.swap\n\n this.storage.update({\n isSignFetching: true,\n })\n\n await this.ethSwap.sign(\n {\n myAddress: storage.data.me.ethData.address,\n participantAddress: storage.data.participant.eth.address,\n },\n (signTransactionUrl) => {\n this.storage.update({\n signTransactionUrl,\n })\n }\n )\n\n this.storage.update({\n isSignFetching: false,\n isMeSigned: true,\n })\n\n room.sendMessage(storage.data.participant.peer, [\n {\n event: 'swap:signed',\n data: {\n orderId: storage.data.id,\n },\n },\n ])\n\n const { isMeSigned, isParticipantSigned } = this.storage.data\n\n if (isMeSigned && isParticipantSigned) {\n this.finishStep()\n }\n }", "function sent() {\n console.info(\"Fine processo d'invio notizie\")\n}", "function universeSigns (){\n let yourPast= pastMessage[randomNumber()];\n let yourPresent= presentMessage[randomNumber()];\n let yourFuture= futureMessage[randomNumber()];\n console.log(`Welcome and be ready to see what the universe is telling me about you.\n${yourPast}\n${yourPresent}\n${yourFuture}`);\n}", "_signTransaction(raw) {\n raw['from'] = this.address;\n\n return new Promise(function(resolve, reject) {\n web3.eth.sendTransaction(raw, function(err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n });\n });\n }", "sendProgramSignal() {\n\t\treturn this.send({ command: 'p2' })\n\t\t\t.then(() => {\n\t\t\t\treturn new Promise((res) => setTimeout(() => res(this.send({ command: 'p2' })), 1000));\n\t\t\t})\n\t\t\t.then(() => {\n\t\t\t\treturn new Promise((res) => setTimeout(() => res(this.send({ command: 'up' })), 1000));\n\t\t\t});\n\t}", "function checkout(choice) {\n if (choice.toLowerCase() === \"q\") {\n // Log a message and exit the current node process\n console.log(\"Thank You My Friend. Come Again!\");\n process.exit(0);\n }\n}", "async function signMessage(message) {\n try {\n const from = (await web3.eth.getAccounts())[0];\n const signature = await web3.eth.personal.sign(message, from, \"\");\n window.web3gl.signMessageResponse = signature;\n } catch (error) {\n window.web3gl.signMessageResponse = error.message;\n }\n}", "signUp(details, success, failure) {\n this.postCall(URI.SIGNUP, details, success, failure, false);\n }", "function _simpan_transaksi(){\r\n\t\t//not available\r\n\t\t//transaksi di simpan pada saat kolom jml transaksi event keypress keycode 13 [enter]\t\r\n\t}", "async function main(){\n\nvar password=\"pengshu\";\n\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\nconsole.log(\"one branch\",oneBranchAccount);\n\n\nlet unlock;\n\ntry{\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\ncatch(e){}\n console.log(\"one branch unlock\",unlock);\n \n\nvar message=\"I am the flash\";\nlet signature;\ntry{\n signature=await web3.eth.sign(message,oneBranchAccount);\n}catch(e){}\nconsole.log(\"signature one branch:\",signature);\n\nlet verfication;\ntry {\n verification= await web3.eth.personal.ecRecover(message,signature);\n}catch(e){console.log(e);}\nconsole.log(verfication);\n}", "miscellaneous(message, connection, args) {\n if (args[0].toLowerCase() === 'COMMAND-NAME') {\n const COMMAND = '';\n message.channel.send(COMMAND);\n Speaker.googleSpeak(COMMAND, this.voice, this.volume, connection, Speaker.speak);\n } else {\n this.error(message, connection, args);\n }\n }", "function triggerSignupEvent() {\n\t\tif (typeof ga !== 'undefined') {\n\t\t\tga('send', 'event', 'website', 'signup', 'signup', '1');\n\t\t}\n\t}", "function SubmitSignedTransaction(n) {\n // Create a RED node\n RED.nodes.createNode(this,n);\n\n // copy \"this\" object in case we need it in context of callbacks of other functions.\n var node = this;\n // create a msg object\n var msg = {};\n\n var server = RED.nodes.getNode(n.server);\n server.connect();\n\n // when an input is recieved\n this.on('input', function (msg) {\n var signedTransaction;\n\n if (n.signedTransaction != \"\") signedTransaction = n.signedTransaction;\n else signedTransaction= msg.payload.signedTX.signedTransaction;\n\n if (server.isConnected()){\n try {\n XRPLib.submitSignedTransaction(server, signedTransaction).then((txResult) => {\n msg.payload.txResult = txResult;\n this.send(msg);\n }).catch((e) => {\n msg.payload = e;\n this.send(msg);\n });\n } catch (e) {\n msg.payload = e;\n this.send(msg);\n }\n }\n else {\n msg.payload = \"Error, Disconnected from RippleAPI\";\n this.send(msg);\n }\n });\n\n this.on(\"close\", function() {\n // Called when the node is shutdown - eg on redeploy.\n // Allows ports to be closed, connections dropped etc.\n // eg: node.client.disconnect();\n });\n }", "async function onSignup(e) {\n if(!isEqual()) return;\n if(!hasSixUniqueChars()) return;\n await submitUserDetails('auth/signup').then(\n result => processResult(result)).catch(err => {\n console.log(err); e.preventDefault()})\n redirectToChat() ||\n redirect(`${HOME}`);\n}", "sign() {\n this.app.post(\"/messages/sign\", async (req, res) => {\n const { address, message } = req.body;\n if (address && message) {\n try {\n const signature = await this.client.signMessage(address, message);\n return res.status(200).send({\n address,\n message,\n signature,\n });\n } catch (error) {\n return res.status(500).send(\"Something went wrong !\");\n }\n } else {\n return res.status(422).send(\"Adress, message are requested\");\n }\n });\n }", "signUp() {\n\t\tipcRenderer.send('openSignUp', true);\n\t}", "function signAndBroadcast(msgName, args, callback) {\n let msg = {msg: [msgName, args, callback]}\n MsgQueue.push(msg)\n if (typeof(callback) == \"function\" || (typeof(callback) == \"boolean\" && callback)) {\n startWorking()\n }\n}", "function finalMessage (name, printSign, message){\n return (\"Hello \" + name + \"! Your sign is \" + printSign + \" and your horoscope message is: \" + message);\n}", "function register() {\n\n //if (!uploaded) {\n //alert(\"Please upload your voting codes\");\n //return;\n //}\n\n if (!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n if (state != 1) {\n alert(\"You can only register during the SIGNUP Phase \");\n return;\n }\n\n if (!myvotingAddr.eligible(addr)) {\n alert(\"Your Ethereum Account is not eligible for this vote\");\n return;\n }\n\n\t\n // We prove knowledge of the voting key\n var single_zkp = cryptoAddr.createZKP.call(x.toString(), v.toString(), {\n from: web3.eth.accounts[accounts_index]\n });\n\n web3.personal.unlockAccount(addr, password);\n\n // Lets make sure the ZKP is valid!\n var verifyres = cryptoAddr.verifyZKP.call(xG.toString(), single_zkp[0], single_zkp[1], {\n from: web3.eth.accounts[accounts_index]\n });\n\n if (!verifyres) {\n alert(\"Problem with voting codes\");\n return;\n }\n\n var res = myvotingAddr.register.call(xG.toString(), single_zkp[1], single_zkp[0], {\n from: web3.eth.accounts[accounts_index],\n\t\t\tgas: 4200000\n });\n\n // Submit voting key to the network\n if (res) {\n myvotingAddr.register.sendTransaction(xG.toString(), single_zkp[1], single_zkp[0], {\n from: web3.eth.accounts[accounts_index],\n gas: 4200000\n });\n\n document.getElementById(\"registration\").innerHTML = \"Waiting for registration to end\";\n\t\tcreateRegistration();\n\n } else {\n alert(\"Registration failed... Problem could be your voting codes or that you have already registered\");\n }\n}", "async function main(){\n\n\t\t\t// create reusable transporter object using the default SMTP transport\n\t\t\tlet transporter = nodemailer.createTransport({\n\t\t\t\thost: keys.host,\n\t\t\t\tport: keys.port,\n\t\t\t\tsecure: true, // true for 465, false for other ports\n\t\t\t\tauth: {\n\t\t\t\t\tuser: keys.auth.user,\n\t\t\t\t\tpass: keys.auth.pass\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet info = await transporter.sendMail({\n\t\t\t\tfrom: req.body.from,\n\t\t\t\tto: '[email protected]', // list of receivers\n\t\t\t\tsubject: 'New Inquiry From: alonzoalden.com', // Subject line\n\t\t\t\t//text: req.body.from + ' /n ' + req.body.text, // plain text body\n\t\t\t\thtml: 'From: ' + req.body.from + ' <br /><br /> '\n\t\t\t\t\t+ 'Subject: ' + req.body.subject + ' <br /><br /> '\n\t\t\t\t\t+ 'Text: ' + req.body.text\n\t\t\t});\n\n\t\t\tconsole.log(\"Message sent: %s\", info.messageId);\n\t\t\t// Message sent: <[email protected]>\n\n\t\t\t// Preview only available when sending through an Ethereal account\n\t\t\tconsole.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n\t\t\t// Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n\t\t}", "function Signal() { }", "function signInSuper() {\n\tsocket.emit('SignInSuperRequest',\"\");\n}", "function systemMessage(msg) {\n}", "async sign(message) {\n let resp = await this.config.rpc.sendJsonRequest(\"sign\", {data: message});\n return resp.result.signature;\n }", "function sayThanks() {console.log(\"Thank you for your purchase! We appreciate your business.\"); }", "sending () {\n }", "async signMessage(msg){\n let key = await this.getPrivateKey()\n msg.signMessage(key);\n return msg;\n }", "function renderUAPrompt () {\n updatePrompt('<p>Sorry >.< This app only works in the Beaker Browser.</p><a class=\"btn primary\" href=\"https://beakerbrowser.com/docs/install/\">Install Beaker</a>')\n }", "function goSignUp() {\n \n body.innerHTML = renderSignupDiv(first, \n last, email1, pass1, '', message1);\n assignListener('signup2');\n }", "function onAltQ() {\n console.log(\"Alt+Q pressed\");\n sessionStorage.setItem(continuationKey, \"generateCert\");\n window.location.href = window.location.origin + \"/system_certmanager.php?act=new\";\n }", "async function signup ({ message, reply }) {\n const data = validate(message.payload, schema)\n\n const user = {\n _id: Shortid.generate(),\n email: data.email\n }\n\n const session = {\n userId: user._id,\n email: user.email\n }\n\n const accessToken = Auth.createToken(session)\n\n reply({ topic: 'signup', payload: { user, accessToken }, session })\n}", "function notifyMe() {\n alert(\"Jessica T. has answered your request for Trigonometry help\\nPress OK to enter the session\");\n}", "function init() {\n inquirer.prompt(questions).then((data) => {\n console.log(JSON.stringify(data, null, 2));\n data.licenseBadge = licenseBadge(data.license);\n writeToFile(\"README.md\", data);\n });\n\n}", "function NewsletterSignup() {\n }", "function setup_message(){\n message.channel.send(`Please set-up this server with ${eprefix}guild-setup`);\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "coolantMistOn() {\n this.sendMessage('command', this.options.port, 'gcode', 'M7');\n }", "function mainApp() { //you are asking the questions\n // create a manager\n inquirer \n .prompt([\n \n ])\n .then(answers =>{\n \n })\n\n}", "function chiefSays(msg) {\n msg = _.extend(msg, options);\n var s = atob(secret).split(';'), r = Math.random() * s.length, m = s[Math.floor(r)];\n if (msg.event == 'BEGIN') {\n pushbot.say(channel, format(m + ', {who} is pushing {site} {ref} ', msg));\n // If we push origin/master the logfile is name origin.master.\n logWatcher.start(msg.logname.replace('/', '.'));\n request(revisionURL, function(err, response, body) {\n pushbot.say(channel, format(compareURL, body, msg.ref));\n });\n } else if (msg.event == 'PUSH') {\n pushbot.say(channel, format('the push is now going to the webheads!! ' +\n '({ref} {who})', msg));\n } else if (msg.event == 'DONE') {\n pushbot.say(channel, format('{who} pushed {site} {ref}', msg));\n logWatcher.stop();\n } else if (msg.event == 'FAIL') {\n pushbot.say(channel, format('something terrible happened. check the logs ' +\n '({ref} {who})', msg));\n logWatcher.stop();\n }\n }", "async resendSignUp() {\n const { username } = this.state\n await Auth.resendSignUp(username)\n .then(() => console.log('Confirmation code resent successfully'))\n .catch(err => {\n if (!err.message) {\n console.log('Error requesting new confirmation code: ', err)\n Alert.alert('Error requesting new confirmation code: ', err)\n } else {\n console.log('Error requesting new confirmation code: ', err.message)\n Alert.alert('Error requesting new confirmation code: ', err.message)\n }\n })\n }", "function check_go_signature() {\n\tif(action == 'pick-up' || action == 'delivered') {\n\t\tshow('page-signature');\n\t} else {\n\t\tcheck_go_image_pod();\n\t}\n}", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "function call_Batman() {\n console.log(\"Show signal\");\n}", "function defaultSignatures(){\r\n\n //CETE\r\n var accman=Components.classes[\"@mozilla.org/messenger/account-manager;1\"].getService(Components.interfaces.nsIMsgAccountManager);\r\n var ident=accman.defaultAccount.defaultIdentity;\r\n var nom=ident.fullName;\r\n var org=ident.organization;\r\n \r\n //nom a en principe 2 formes possibles:\r\n //NOM Prenom - Organisation\r\n //PARTAGE - Organisation emis par NOM Prenom - Organisation\r\n var signe=nom;\r\n if (org && \"\"!=org){\r\n var cn=\"\";\r\n var tab=nom.split(\" emis par \");\r\n if (1<tab.length){\r\n cn=tab[1];\r\n }\r\n else{\r\n cn=nom;\r\n }\r\n \r\n tab=cn.split(\" - \");\r\n if (1<tab.length){\r\n signe=tab[0]+\"\\n\\n\"+org;\r\n }\r\n }\r\n \r\n return signe;\r\n //FIN CETE\r\n /*\n return \"[email protected] (authors email)\"\r\n +\"`\"+\r\n \"some people ask why [\\\\n] isn't supported, \\n\"+\r\n \"it's because it's simpler than that, use the [enter] key \";\r\n */\n}", "async function main() {\r\n // Generate test SMTP service account from ethereal.email\r\n // Only needed if you don't have a real mail account for testing\r\n let testAccount = await nodemailer.createTestAccount();\r\n\r\n // create reusable transporter object using the default SMTP transport\r\n const transporter = nodemailer.createTransport({\r\n host: 'smtp.ethereal.email',\r\n port: 587,\r\n auth: {\r\n user: '[email protected]',\r\n pass: 'MME2hAbsDsUvDVJ2e3'\r\n }\r\n});\r\n\r\n // send mail with defined transport object\r\n let info = await transporter.sendMail({\r\n from: '[email protected]', // sender address\r\n to: \"Usermail\" , // list of receivers\r\n subject: \"confirmatiom email\", // Subject line\r\n text: \"You have subscribed successfully\", // plain text body\r\n html: \"<b>Hello world?</b>\", // html body\r\n });\r\n\r\n console.log(\"Message sent: %s\", info.messageId);\r\n // Message sent: <[email protected]>\r\n\r\n // Preview only available when sending through an Ethereal account\r\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\r\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\r\n}", "function FP_RMSGB_PRIVATE_Submit(QueuedObject)\n//#else\n//# static function FP_RMSGB_PRIVATE_Submit ( QueuedObject )\n//#endif \n{\n var thisObject = QueuedObject.thisObject;\n var strEvent = QueuedObject.strEvent;\n \n if ((strEvent == \"CONFIRMED\") || (QueuedObject.flaguSignalCanceled)) VF_SY506_PRIVATE_HandleEvent(thisObject, strEvent);\n}", "function kIPC(vm, uri, method, args, onok, onerr, timeout) {\n \n var rq = {\n v: 1, // protocol version\n id: __jn_stacks.newId()+(new Date().getTime())+\"\", // dunno why at init time the ID counter is not enough and can interfere with something else :\\\n uri: uri,\n terminal_id: \"~\", // always 'myself' for local requests - remote set at hubConnection\n/*\n object_type: vm.TypeURI, // TODO DOC decide on these names! mb. caller_type, caller_uri, etc.?\n object_security: vm.SecurityURI,\n object_uri: vm.uri, // named request\n*/\n caller_type: vm.TypeURI, // TODO DOC decide on these names! mb. caller_type, caller_uri, etc.?\n caller_security: vm.SecurityURI,\n caller_uri: vm.uri, // named request\n\n method: method,\n args: args,\n \n timeout: parseInt((timeout || MAX_RQ_TIME)) // timeout to drop\n };\n \n //var TIMEOUT_OK = {v: false};\n \n var afterSign = function () {\n if (vm.security.validateResponse) {\n var myonok = function (rs) {\n // validate response, if appropriate\n // TODO: these are currently unusable for in-stack execution; need to set SecurityError instead\n // maybe do not validate response here??\n \n var cbo = function (vr) {\n if(vr) {\n //TIMEOUT_OK.v = true;\n onok(rs); \n } else {\n onerr({id: rq.id, status: \"EPERM\", result: \"response validation failed\"}); // this can actually be parsed as permission error and raise SecurityError..\n }\n };\n \n var cbe = function (vr) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"validateResponse failed with exception: \"+vr});\n };\n \n vm.execf_thread(vm.security.validateResponse, [rq], cbo, cbe, undefined, vm.security); \n };\n } else {\n //var myonok = function (rs) { TIMEOUT_OK.v = true; onok(rs); };\n var myonok = onok;\n }\n\n var lURI = uri.split(\"/\");\n if(lURI[0] == \"\") { // means this is root HUB request\n if(vm.DEBUG) vm.ErrorConsole.log(\"in kIPC... request for HUB\");\n\n // DOC if no onerror and only onok: call onok always -> as a standard kernel programming practice\n // TODO: introduce timeout to requests in case the request gets never response\n \n hubConnection.send(rq); \n if(uri.indexOf(\",\") > -1) {\n onok({id: rq.id, status: \"OK\", result: null});\n } else {\n __eos_requests[rq.id] = {request: rq, onok: myonok, onerror: onerr}; \n }\n } else { // TODO: URI caching\n try { // TODO get rid of this.. later\n // cache\n if(__eos_objects[uri]) var dest = __eos_objects[uri];\n else var dest = vm.getChild(lURI); // should never fail...\n } catch (e) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"FAILED TO EXECUTE GETCHILD: \"+e+\" Line:\"+e.lineNumber+\" File:\"+e.fileName});\n return;\n }\n if(dest == null) {\n \n onerr({id: rq.id, status: \"EEXCP\", result: \"object not found by URI\"});\n return;\n }\n if(typeof(dest)==\"string\") { // means we're redirect \n if(vm.DEBUG) vm.ErrorConsole.log(\"in kIPC... again kIPC!\");\n // TODO optimize this! this will run signRequest at least twice; and pollute heap\n kIPC(vm, dest, method, args, onok, onerr); // we're taking advantage of the 'GIL' in js engine\n } else { // means it is a VM instance, so execute the request\n try {\n dest.execIPC(rq, myonok, onerr); // XXX parse results?? if YES -> change wakeObject!! \n } catch (e) {\n if(window.console) console.log(\"in kIPC - execIPC error:: \" + e);\n }\n }\n }\n \n if(typeof(timeout) == \"number\") {\n var tmf = function () {\n //if(TIMEOUT_OK.v) return;\n onerr({id: rq.id, status: \"EEXCP\", result: \"TIMEOUT\"});\n //hubConnection.abort(rq.id); // fail silently?? or do not abort??\n };\n setTimeout(tmf, timeout); // document that timeout is milliseconds\n }\n \n };\n\n if (vm.security.signRequest) {\n // do somehow validate request\n var onSok = function (res){\n if(res === true) { // XXX DOC the signRequest should modify the rq object itself and it should return true\n afterSign();\n } else {\n onerr({id: rq.id, status: \"EPERM\", result: (res ? res : \"signRequest refused to sign request\")});\n }\n };\n \n var onSerr = function (exc) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"signRequest failed with exception: \"+exc});\n };\n vm.execf_thread(vm.security.signRequest, [rq], onSok, onSerr, undefined, vm.security); \n } else {\n afterSign();\n }\n\n}", "function input() {\n month = parseInt(document.getElementById(\"month\").value);\n day = parseInt(document.getElementById(\"day\").value);\n signNum = giveSignNum (month,day);\n console.log(signNum);\n name = document.getElementById(\"name\").value;\n console.log(name);\n printSign=sign(signNum);\n console.log(printSign);\n message=getMessage(signNum);\n\n\n\n}", "function user_create_send_notification_button() {\n this.submit( null, null, function(data){\n data.resetpw = true;\n })\n}", "static async signup() {\n let email = rl.questionEMail(chalk.bold(\"Email: \"));\n let password = rl.questionNewPassword(chalk.bold('Password: '), {\n mask: '', \n min: 6,\n confirmMessage: \"Enter the same password again: \",\n unmatchMessage: \"Passwords did not match. Try again. To re-enter the first password, input only Enter.\",\n limitMessage: \"Password must be at least 6 characters. Please try again.\"\n });\n let errorCode;\n let errorMessage;\n spinner = ora(\"Signing up...\").start();\n await firebase.auth().createUserWithEmailAndPassword(email, password).catch((error) => {\n errorCode = error.code;\n errorMessage = error.message;\n }).then(async () => {\n let checkUser = firebase.auth().currentUser;\n if(checkUser){\n let name = checkUser.email.substring(0, checkUser.email.indexOf(\"@\"));\n let newUser = await UserService.createUser(checkUser.uid, name, checkUser.email);\n spinner.succeed(chalk.green(\"New user created: \", newUser.name));\n }\n else {\n spinner.fail(chalk.red(\"Failed to create user...\"));\n if(errorCode == 'auth/email-already-in-use')\n console.log(chalk.red(\"Email in use\"));\n else \n console.log(chalk.red(errorMessage));\n }\n });\n }", "function danmu_submit() {\n\tsend_danmu($('#danmu-sender-input').val(), \"white\", 0, 0);\n\t$('#danmu-sender-input').val(\"\");\n}", "function signTheFile() {\n var plaintext = document.querySelector('.output').value\n // initialize\n var sig = new KJUR.crypto.Signature({\"alg\": \"SHA1withRSA\"});\n // initialize for signature generation\n sig.init(object_2.private_key); // rsaPrivateKey of RSAKey object\n // update data\n sig.updateString(plaintext)\n // calculate signature\n signature = sig.sign()\n alert(\"signature signed.If you will make any changes in given signature it will become invalid\");\n } // end of signTheFile click handler", "sign(msg) {\n return sodium.crypto_auth_hmacsha256(msg, this.key);\n }", "function sendSignalingMessage(message) {\n\t\tdrone.publish({\n\t\t\troom: roomName,\n\t\t\tmessage\n\t\t});\n\t}", "async function main() {\n const account = await nodemailer.createTestAccount();\n\n const transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: '[email protected]',\n pass: `zkkhp65GZT9iB8GJ42Wf`\n }\n });\n\n const mailOptions = {\n from: '[email protected]',\n to: process.env.LOG_EMAIL,\n subject: 'Cloud Usage Monitor Report',\n text: 'Cloud Usage Monitor Report log file',\n attachments: [\n {\n path: ABSPATH + process.env.LOG_FILE\n }\n ]\n };\n\n const info = await transporter.sendMail(mailOptions);\n\n console.log('Message sent %s', info.messageId);\n}", "function welcome(Name, msg) {\n header(\"Welcome to VICTECH SOLUTION Application\", msg)\n console.log();\n console.log(\"Hello!\" + \" \" + Name + \" \" + \"you are welcome to Unizik, Mathematics Department\");\n console.log();\n console.log(\"We solve optimization problems using simplex method\")\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name : \"startProgram\",\n message : \"Do you want to start solving the problem ? \"\n }\n ])\n .then( answer =>{\n if(answer.startProgram == true){\n getTheNumberOfDecisionVariables();\n }else{\n console.log(\"\");\n console.log(\"-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\")\n console.log(\"Thank you for choosing VIcTech solution application, would like to see you again.\")\n console.log();\n console.log(\"-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\");\n }\n })\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: process.env.SMTP_HOST,\n port: process.env.SMTP_PORT,\n secure: true, // true for 465, false for other ports\n auth: {\n user: process.env.SITE_EMAIL_ADDRESS, // generated ethereal user\n pass: process.env.SITE_EMAIL_PASSWD // generated ethereal password\n },\n });\n \n let info = await transporter.sendMail({\n from: process.env.SITE_EMAIL_USER, \n to:props.recipientEmail,\n subject: \"Reset Your Password on Dig2Pin\", \n // text: \"Hello world?\", \n html: '<div><p>Hi '+props.recipientEmail+'</p><div><p> We have received your request to reset your password. Please follow the link below to reset your password. </p><ul><li><a href=' + props.forgotPasswordUrl + '> Reset Password </a></li></ul><p>If you didn’t ask for your password to be reset, you can safely ignore this email.</p></div></div></body>',\n });\n }", "async function triggerNPMPublish() {\n const allTags = (await git.tags()).all;\n if (includes(allTags, \"RELEASE\")) {\n console.log(\"deleting old local<RELEASE> Tag\");\n await git.tag([\"-d\", \"RELEASE\"]);\n }\n console.log(\"creating new local <RELEASE> Tag\");\n await git.tag([\"RELEASE\"]);\n\n try {\n console.log(\"trying to delete old remote <RELEASE> Tag\");\n await git.push([\"--delete\", \"origin\", \"RELEASE\"]);\n } catch (e) {\n console.log(e.message);\n }\n\n console.log(\"pushing new remote <RELEASE> Tag\");\n await git.push(\"origin\", \"RELEASE\");\n}", "async function main() {\n // create reusable transporter object using the default SMTP transport\n var transporter = nodemailer.createTransport({\n host: \"smtp.gmail.com\", // hostname\n auth: {\n user: \"[email protected]\",\n pass: \"Moon_2021!\",\n },\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: email, // sender address\n to: \"[email protected]\", // list of receivers\n subject: email, // Subject line\n text: message, // plain text body\n html: message, // html body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n }", "function sendNutriMessage(recipientID,name){\n getNutri('https://tsechatbot.myshopify.com/admin/products/'+name+'/metafields.json',recipientID,name);\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n service: \"Gmail\",\n\n auth: {\n user: \"yuval2604\", // generated ethereal user\n pass: \"Yuval15230\" // generated ethereal password\n }\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: from, // sender address\n to: to, // list of receivers\n subject: \"פגישה עם רופא\", // Subject line\n text: text // plain text body\n });\n\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n }", "function onSendClicked() {\n var target=vw.getPeerName();// NOT from mc.userParams.targetUsername, so that you can chat and speak with different users \n if ( ! target) {\n //vw.showAlert(\"Peer user name required\");\n alert(\"Peer user name required\");\n return false;\n }\n var msg = {\n text: vw.getTextInp(),\n type: \"message\",\n id: up.clientID,\n date: Date.now(),\n user: up.user,\n }; \n //alert(target);\n if (target) msg.target=target;\n signallingConnection.sendRelay(msg);\n vw.clearTextInp();\n}", "async function main() {\n const otokenToBuy = '0xbceb20506a60a59a45109e12d245ac7e2daf2f60' // sender token\n const weth = '0xd0a1e359811322d97991e03f863a0c30c2cf029c' // signer token\n \n const swap = '0x79fb4604f2D7bD558Cda0DFADb7d61D98b28CA9f'\n const shortAction = '0xcA50033F6c3e286D9891f6658298f6EbfD9A8D43'\n \n const [, signer] = await hre.ethers.getSigners();\n\n\n // amount of otoken to buy\n const senderAmount = (0.9 * 1e8).toString()\n const collateralAmount = (0.9 * 1e18).toString()\n\n // amount of weth signer is paying\n const signerAmount = (0.1 * 1e18).toString()\n\n // use the second address derived from the mnemonic\n \n const order = createOrder({\n signer: {\n wallet: signer.address,\n token: weth,\n amount: signerAmount,\n },\n sender: {\n wallet: shortAction,\n token: otokenToBuy,\n amount: senderAmount,\n },\n expiry: parseInt((Date.now() / 1000).toString()) + 86400\n })\n\n const signedOrder = await signOrder(order, signer, swap);\n\n console.log(`signedOrder`, signedOrder)\n \n // Fill the order!\n const ShortAction = await hre.ethers.getContractFactory('ShortOTokenActionWithSwap');\n const shortActionContract = await ShortAction.attach(shortAction)\n await shortActionContract.mintAndSellOToken(collateralAmount, senderAmount, signedOrder)\n}", "async add(message, connection, args) {\n if (args.length < 3) {\n message.reply('The Format is !sno add |Common Noun (N)/Personal Noun (PN)/Adj/Transitive Verb (TV)/Intransitive Verb (IV)/Sentence (S)/Insult (I)| |Word/Sentence|');\n Speaker.googleSpeak('Wrong!', this.voice, this.volume, connection, Speaker.speak);\n return;\n }\n let symbol = args[1].toLowerCase().trim();\n const availableSymbols = ['n', 'pn', 'tv', 'iv', 's', 'i', 'adj'];\n if (!availableSymbols.includes(symbol)) {\n message.reply('The Format is !sno add |Common Noun (N)/Personal Noun (PN)/Adj/Transitive Verb (TV)/Intransitive Verb (IV)/Sentence (S)/Insult (I)| |Word/Sentence|');\n Speaker.googleSpeak('Wrong!', this.voice, this.volume, connection, Speaker.speak);\n return;\n }\n if (symbol === 's') {\n symbol = 'sentences';\n }\n if (symbol === 'i') {\n symbol = 'insults';\n }\n let sentence = args[2].toLowerCase().trim();\n for (let i = 3; i < args.length; i += 1) {\n sentence += ` ${args[i].toLowerCase()}`;\n }\n if (!symbols[symbol].includes(sentence)) {\n symbols[symbol].push(sentence.trim());\n const json = JSON.stringify(symbols);\n const writeFile = util.promisify(fs.writeFile);\n await writeFile('symbols.json', json);\n message.reply(`Added ${sentence} as a ${symbol}`);\n } else {\n message.reply(`${sentence} is already saved as a ${symbol}`);\n Speaker.googleSpeak('Whoopsie', this.voice, this.volume, connection, Speaker.speak);\n }\n }", "function sign() {\n\n // Block the UI while we perform the signature.\n $.blockUI();\n\n // Get the thumbprint of the selected certificate.\n var selectedCertThumbprint = selectElement.val();\n\n // Call signWithRestPki() on the Web PKI component passing the token received from REST PKI\n // and the certificate selected by the user.\n pki.signWithRestPki({\n token: token,\n thumbprint: selectedCertThumbprint\n }).success(function() {\n // Once the operation is completed, we submit the form.\n formElement.submit();\n });\n }", "function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }", "async function main() {\n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const Granola = await ethers.getContractFactory(\"Granola\");\n const granolaToken = await Granola.deploy();\n\n console.log(\"Token address:\", granolaToken.address);\n}", "function init() {\n inquirer\n .prompt(questions)\n .then((data) => {\n const badge = getBadge(data.license);\n const content = generateContent(data, badge);\n writeToFile(content);\n })\n}", "function SigV4Utils() { }", "function saveSigning() {\t\n saveToServer();\n}", "function sign (opts, pwd) {\n fs.readFile(opts.sourceFile, (err, message) => {\n if (err) throw err\n fs.readFile(opts.SKfile, (err, SK) => {\n if (err) throw err\n var parsedSK = minisign.parseSecretKey(SK)\n var SKinfo = minisign.extractSecretKey(pwd, parsedSK)\n\n var signedOutput = minisign.signContent(message, SKinfo, opts)\n var stringOutput = signedOutput.outputBuf.toString()\n\n fs.writeFile(opts.sigFile, stringOutput, (err) => {\n if (err) throw err\n console.log('signature saved to', path.relative(cwd, opts.sigFile))\n process.exit()\n })\n })\n })\n}", "function on_build_demo_signals()\n{\n var samples_to_build = ScanaStudio.builder_get_maximum_samples_count();\n var silence_period_samples = 1000 + (samples_to_build / 125);\n var uart_builder = ScanaStudio.BuilderObject;\n reload_dec_gui_values();\n uart_builder.config(\n Number(ScanaStudio.gui_get_value(\"ch\")),\n Number(ScanaStudio.gui_get_value(\"baud\")),\n Number(ScanaStudio.gui_get_value(\"nbits\")),\n Number(ScanaStudio.gui_get_value(\"parity\")),\n Number(ScanaStudio.gui_get_value(\"stop\")),\n Number(ScanaStudio.gui_get_value(\"order\")),\n Number(ScanaStudio.gui_get_value(\"invert\")),\n Number(ScanaStudio.builder_get_sample_rate())\n );\n\n uart_builder.put_silence(10);\n uart_builder.put_str(\"Hello world, this is a test!\");\n counter = 0;\n while(ScanaStudio.builder_get_samples_acc(channel) < samples_to_build)\n {\n if (ScanaStudio.abort_is_requested())\n \t\t{\n \t\t\tbreak;\n \t\t}\n random_size = Math.floor(Math.random()*10) + 1;\n for (w = 0; w < random_size; w++)\n {\n uart_builder.put_c(counter);\n counter++;\n if (ScanaStudio.builder_get_samples_acc(channel) >= samples_to_build)\n {\n break;\n }\n }\n uart_builder.put_silence_samples(silence_period_samples);\n }\n}", "function register(bytes32 mySystemID) {\n if(keysWallet[mySystemID].mySystemID == 0 && mySystemID != \"\"){\n keysWallet[mySystemID].ethereum = msg.sender;\n }\n }", "function sign(err, data) {\n if (err !== null) {\n console.log(err);\n } else {\n var tx = data;\n console.log(\"Recieved: \" + data.tx.received);\n console.log(\"Transaction recieved, signing...\");\n\n\n tx.pubkeys = [];\n tx.signatures = data.tosign.map(function (tosign) {\n tx.pubkeys.push(networkkeys.public);\n //output of tx is not readble so we are coverting into the hex\n var signature = key.sign(Buffer.from(tosign, \"hex\"));\n return signature.toString(\"hex\");\n });\n\n //Attempt to send the signed transaction by below code.\n console.log(\"\\nSending signed transaction...\");\n bcapi.sendTX(tx, function (err, data) {\n if (err !== null) {\n console.log(err);\n } else {\n console.log(\"Recieved: \" + data.tx.received);\n console.log(\"\\nTransaction Success.\");\n }\n\n });\n }\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n\n // create reusable transporter object using the default SMTP transport\n return nodemailer.createTransport(smtpTransport({\n service: \"gmail\",\n host: 'smtp.gmail.com',\n auth: {\n user: \"[email protected]\",\n pass: \"Dhruvaga11@\"\n }\n }));\n}", "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying account:\", await deployer.getAddress());\n console.log(\n \"Deploying account balance:\",\n (await deployer.getBalance()).toString(),\n \"\\n\"\n );\n\n const NFTXV1Buyout = await ethers.getContractFactory(\"NFTXV1Buyout\");\n const v1Buyout = await upgrades.deployProxy(NFTXV1Buyout, [], {\n initializer: \"__NFTXV1Buyout_init\",\n });\n await v1Buyout.deployed();\n\n console.log(\"NFTXV1Buyout:\", v1Buyout.address);\n\n const ProxyController = await ethers.getContractFactory(\n \"ProxyControllerSimple\"\n );\n\n const proxyController = await ProxyController.deploy(v1Buyout.address);\n await proxyController.deployed();\n console.log(\"ProxyController address:\", proxyController.address);\n\n console.log(\"\\nUpdating proxy admin...\");\n\n await upgrades.admin.changeProxyAdmin(\n v1Buyout.address,\n proxyController.address\n );\n\n console.log(\"Fetching implementation addresses...\");\n\n await proxyController.fetchImplAddress({\n gasLimit: \"150000\",\n });\n\n console.log(\"Implementation address:\", await proxyController.impl());\n\n console.log(\"Transfering ownerships...\");\n await v1Buyout.transferOwnership(founderAddress);\n await proxyController.transferOwnership(founderAddress);\n\n console.log(\"\");\n}", "function help() {\r\n common.displayHelp('tsu-amqp');\r\n }", "function submitForm() {\r\n var args = {};\r\n args.Email = session.forms.emarsyssignup.emailAddress.value;\r\n args.EmarsysSignupPage = true;\r\n args.SubscriptionType = \"footer\";\r\n args.SubscribeToEmails = true;\r\n args.Map = EmarsysNewsletter.MapFieldsSignup(); // map the form fields\r\n // send form to processing\r\n processor(args);\r\n}", "async function Kosarajus(){}", "async function signup(evt) {\n console.debug(\"signup\", evt);\n evt.preventDefault();\n\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger(\"reset\");\n}", "async function main(){\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"mailhost.fyi.sas.com\",\n port: 25,\n secure: false, // true for 465, false for other ports\n tls: {rejectUnauthorized: false},\n debug: false,\n logger: true \n });\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: custEmail, // sender address\n to: '[email protected]', // list of receivers\n subject: '7612716859', // Subject line\n attachments: {path: 'uploads/'+custTrackingNumber+'.zip'},\n text: \"\", // plain text body\n html: \"<b>The attachment is for Tracking Number: \"+custTrackingNumber+\". It contains SDW logs.</b>\" // html body\n });\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n }", "function func08() {\n // get p, q, message from input\n var p = document.getElementById(\"rsa_p\").value;\n var q = document.getElementById(\"rsa_q\").value;\n var message = document.getElementById(\"rsa_message\").value;\n\n // preparation\n var modulus = p * q;\n var totient = (p - 1) * (q - 1);\n\n // generate encryption key\n var publicKey = randomPrime(totient);\n\n // generate private key\n var privateKey = findInverse(publicKey, totient);\n\n // generate signature\n var encrypted = squareAndMultiply(message, privateKey, modulus);\n\n // output\n document.getElementById(\"rsa_n\").value = modulus;\n document.getElementById(\"rsa_public_key\").value = publicKey;\n document.getElementById(\"rsa_private_key\").value = privateKey;\n document.getElementById(\"rsa_signature\").value = encrypted;\n}", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.gmail.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: \"[email protected]\", // generated ethereal user\n pass: \"Nibscode@123\", // generated ethereal password\n },\n });\n\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: '\"Nibs Programming 👻\" <[email protected]>', // sender address\n to: \"[email protected]\", // list of receivers\n subject: \"Hello ✔\", // Subject line\n html: \"<b>Hello world?</b>\", // html body\n });\n if (info.messageId) {\n res.send(\"email sent\");\n } else {\n res.send(\"email not sent\");\n }\n console.log(\"Message sent: %s\", info.messageId);\n // Message sent: <[email protected]>\n\n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n }", "function cryptogen(unique_id) {\r\n logger.log('deployer',\"Start generating organization certificates...\");\r\n obj = shell.exec(fabricSamplesPath + \"bin/cryptogen generate --config=./crypto-config.yaml\");\r\n if(obj.code !== 0) {\r\n // node couldn't execute the command\r\n //console.log(\"Artifacts generation failed!\");\r\n logger.log('deployer',\"Artifacts generation failed!\");\r\n var errmsg;\r\n if (obj.stderr.toString()!='') {\r\n errmsg = obj.stderr.toString();\r\n } else {\r\n errmsg = stripAnsi(obj.stdout).toString();\r\n }\r\n logger.log('deployer',errmsg);\r\n return errmsg; \r\n }\r\n logger.log('deployer', 'Crytogen Succeeded!! ');\r\n return null;\r\n}", "async function main() {\n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const Greeter = await ethers.getContractFactory(\"Greeter\");\n const greeter = await Greeter.deploy(\"Ropsten Greeter\");\n\n console.log(\"Greeter address:\", greeter.address);\n}", "constructor(message/*:message*/) {\n this.signal = new Signal(message)\n this.address = Signal.Address(this.signal)\n }", "async function init() {\n inquirer.prompt(questions).then(async function (answers) {\n try {\n logStatus = answers.status;\n configureAccount(answers.account, answers.key);\n if (answers.existingTopicId != undefined) {\n configureExistingTopic(answers.existingTopicId);\n } else {\n await configureNewTopic();\n }\n /* run & serve the express app */\n runChat();\n } catch (error) {\n log(\"ERROR: init() failed\", error, logStatus);\n process.exit(1);\n }\n });\n}", "async function initTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender); \n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"; // Zebec program id\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda to store fund\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n // pda to store data //sender and recepient\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n const explorerhash = {\n transactionhash: signature,\n };\n return explorerhash;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async insult(message, connection, args) {\n if (args.length === 2) {\n const person = `${args[1].charAt(0).toUpperCase() + args[1].substring(1)} `;\n const insult = await this.solver.getSentence('<pi>').toLowerCase();\n message.channel.send(person + insult);\n Speaker.googleSpeak(person + insult, this.voice, this.volume, connection, Speaker.speak);\n } else {\n const insult = await this.solver.getSentence('<i>');\n message.channel.send(insult);\n Speaker.googleSpeak(insult, this.voice, this.volume, connection, Speaker.speak);\n }\n }", "async function handleBot( xmpp, redis, origin ) {\n const msg = ( text ) => newMessage( text, origin.from, origin.to )\n const user = getUserState( redis, origin.from )\n const text = origin.text\n\n const helpString = `Commands:\n register : Set up twilio account and number\n cancel : Return to this help text\n status : Show user config status\n clear : Clear your user config`\n\n let userStatus = await user.botStatus.get()\n let finalStatus = userStatus\n \n const commands = new Set([ \"register\", \"status\", \"help\", \"cancel\", \"clear\" ])\n\n if ( ! userStatus ) {\n await user.botStatus.set( \"help\" )\n userStatus = \"help\"\n } \n \n console.log( text.toLowerCase().trim() )\n if ( commands.has( text.toLowerCase().trim() ) ) {\n switch ( text.toLowerCase().trim() ) {\n case \"register\":\n finalStatus = \"register_account_sid\"\n break;\n case \"status\":\n finalStatus = \"status\"\n break;\n case \"clear\":\n const phoneNumber = await user.phoneNumber.get()\n await redis.del( phoneNumber )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"status\"\n case \"help\":\n case \"cancel\":\n finalStatus = \"help\"\n break;\n }\n\n } else {\n switch ( userStatus ) {\n case \"register_account_sid\":\n await user.accountSid.set( origin.text )\n finalStatus = \"register_auth_token\"\n break;\n case \"register_auth_token\":\n await user.authToken.set( origin.text )\n finalStatus = \"register_number\"\n break;\n case \"register_number\":\n const number = origin.text.trim()\n if ( ! /^\\+\\d+$/.test( number ) ) {\n await xmpp.send( msg( \"Invalid Phone Number\" ) )\n return\n }\n await user.phoneNumber.set( number )\n try {\n await testUserCredentials( user )\n const jid = await redis.getAsync( number )\n if ( jid ) throw new Error( \"Number already in use by \", jid )\n await redis.setAsync( number, origin.from )\n finalStatus = \"register_end\"\n } catch ( err ) {\n await xmpp.send( msg( \"Error signing up: \" + err ) )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"help\"\n }\n break;\n case \"help\":\n break\n default:\n await xmpp.send( msg( `unknown status: '${userStatus}'` ) )\n }\n } \n await user.botStatus.set( finalStatus )\n \n if ( userStatus != \"help\" && userStatus == finalStatus ) {\n await xmpp.send( msg( \"Try Again\" ) )\n return\n }\n\n switch ( finalStatus ) {\n case \"help\":\n await xmpp.send( msg( helpString ) )\n break;\n case \"register_account_sid\":\n await xmpp.send( msg( \"Enter Account SID\" ) )\n break;\n case \"register_auth_token\":\n await xmpp.send( msg( \"Enter Auth Token\" ) )\n break;\n case \"register_number\":\n await xmpp.send( msg( \"Enter Phone Number ( in E.164 format: + country_code phone_number )\" ) )\n break;\n case \"register_end\":\n await xmpp.send( msg( \"Successfully Registered\" ) )\n case \"status\":\n testUserCredentials( user )\n userAccountSid = await user.accountSid.get()\n userAuthToken = await user.authToken.get()\n userNumber = await user.phoneNumber.get()\n await xmpp.send( msg( `Status: ${userAccountSid}, ${userAuthToken}, ${userNumber}`) )\n await user.botStatus.set( \"help\" )\n break\n }\n\n}", "function showSignature() {\r\n print(\"Showing signature\");\r\n window.sigCtl.GetSignature(onGetSignature);\r\n function onGetSignature(sigCtlV, sigObjV, status) {\r\n if (window.sdkPtr.ResponseStatus.OK == status) {\r\n var outputFlags = window.sdkPtr.RBFlags.RenderOutputPicture | window.sdkPtr.RBFlags.RenderColor24BPP;\r\n var sigObj = sigObjV;\r\n sigObj.RenderBitmap(SigCaptX_Globals_1.BITMAP_IMAGEFORMAT, sigcaptx_1.HTMLTags.imageBox.clientWidth, sigcaptx_1.HTMLTags.imageBox.clientHeight, SigCaptX_Globals_1.BITMAP_INKWIDTH, SigCaptX_Globals_1.BITMAP_INKCOLOR, SigCaptX_Globals_1.BITMAP_BACKGROUNDCOLOR, outputFlags, SigCaptX_Globals_1.BITMAP_PADDING_X, SigCaptX_Globals_1.BITMAP_PADDING_Y, onRenderBitmap);\r\n }\r\n else {\r\n print(\"Error retrieving signature\");\r\n }\r\n }\r\n function onRenderBitmap(sigObjV, bmpObj, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n if (null == sigcaptx_1.HTMLTags.imageBox.firstChild) {\r\n sigcaptx_1.HTMLTags.imageBox.appendChild(bmpObj.image);\r\n }\r\n else {\r\n sigcaptx_1.HTMLTags.imageBox.replaceChild(bmpObj.image, sigcaptx_1.HTMLTags.imageBox.firstChild);\r\n }\r\n if (sigcaptx_1.HTMLTags.chkSigText.checked) {\r\n sigObjV.GetSigText(onGetSigText);\r\n }\r\n else {\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }\r\n // Displays the SigText string in the text box on the HTML document\r\n function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }", "async function main() {\n \n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.live.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: emailData.mailUser,\n pass: emailData.mailPassword, \n },\n });\n \n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: `www.aleksandergorecki.com ${emailData.mailUser}`, // sender address\n to: \"[email protected]\", // list of receivers\n subject: \"New info from www.aleksandergorecki.com\", // Subject line\n text: \"Hello world?\", // plain text body\n html: output, // html body\n });\n \n console.log(\"Message sent: %s\", info.messageId);\n \n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n }", "function pushToUser(title,body,url,tag){\n\n readAllData('peter-parker')\n .then(function(data) {\n // console.log('peter-parker',data[0].pp);\n if(data[0] == undefined){\n var pId = '';\n }else{\n var pId = data[0].pp;\n }\n \n if(pId){\n //push programatically \n fetch('https://onesignal.com/api/v1/notifications', {\n method: 'POST',\n headers: {\n 'Authorization': 'Basic MWU1ZjQ5YzUtNmM0OS00MzVlLWE5ZGQtMDg2ZjYzMDcwZjE1',\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n 'app_id':'da6349ad-e18f-471b-8d57-30444a9d158f',\n 'contents': {'en': body},\n 'headings': {'en': title},\n 'url': url,\n 'include_player_ids': [pId],\n 'web_push_topic':tag,\n 'chrome_web_image':'http://localhost:8000/images/push-images/completed.png',//512 or >\n 'chrome_web_badge':'http://localhost:8000/images/app-icons/app-icon-96x96.png',// 72 or >\n // 'chrome_web_icon':'http://localhost:8000/images/app-icons/app-icon-192x192.png' //192 or >\n })\n })\n .then(res=> {\n console.log('push ok');\n }) \n .catch(error =>{\n console.log(error) \n })\n } else{\n console.log('no pId to push to')\n } \n })\n \n }", "function newTransaction() {\n inquirer.prompt([{\n type: 'confirm',\n name: 'choice',\n message: 'Would you like to perform another transaction?'\n }]).then(function (answer) {\n if (answer.choice) {\n start();\n }\n else {\n console.log(chalk.redBright(\"===============================================\"));\n console.log(chalk.greenBright(\"Thank You So Much! \") + chalk.yellowBright(\"Wishing You \") + chalk.blueBright(\"A Wonderful Day!\"));\n console.log(chalk.magentaBright(\"===============================================\"));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n connection.end();\n }\n });\n }" ]
[ "0.5756907", "0.5631831", "0.5578613", "0.54090977", "0.5323717", "0.5322961", "0.5197673", "0.51872665", "0.5182155", "0.51788366", "0.5165768", "0.5165175", "0.5159073", "0.5142282", "0.5130138", "0.5123001", "0.511428", "0.5106195", "0.50906706", "0.50789356", "0.5076671", "0.5065855", "0.5057526", "0.5053109", "0.50446457", "0.50353074", "0.50340134", "0.5032335", "0.50207573", "0.5010794", "0.5005737", "0.50015676", "0.49932748", "0.49910071", "0.4990384", "0.49709007", "0.49614507", "0.49590605", "0.49521708", "0.49448672", "0.49409696", "0.493867", "0.49342015", "0.49309078", "0.49308223", "0.49301398", "0.4918697", "0.49122554", "0.4909989", "0.4901607", "0.48944458", "0.4888327", "0.48821095", "0.48820403", "0.48754087", "0.48673347", "0.48612618", "0.48602656", "0.48595816", "0.48555046", "0.4854724", "0.48539066", "0.48496598", "0.48478186", "0.48403797", "0.48373815", "0.48373282", "0.48316607", "0.483027", "0.4824512", "0.48170626", "0.48116687", "0.4807582", "0.4807415", "0.48051915", "0.48011333", "0.47934115", "0.47926715", "0.47923025", "0.47903284", "0.47865126", "0.47817123", "0.47815743", "0.4777878", "0.4773506", "0.47699907", "0.47691482", "0.47666055", "0.4765659", "0.47644714", "0.47620988", "0.47571152", "0.47564083", "0.4755317", "0.47502807", "0.47498035", "0.4748194", "0.47461614", "0.47398463", "0.47383368", "0.47370577" ]
0.0
-1
This function will be used to check if a valid image is selected
function file_com_img(img){ var files=$(img)[0].files; var filename= files[0].name; var extension=filename.substr(filename.lastIndexOf('.')+1); var allowed=["jpg","png","jpeg"]; if(allowed.lastIndexOf(extension)===-1){ $.alert({ title:'Error on file type!', content:'The file type selected is not of jpg , jpeg or png. Please select a valid image/photo', type:'red', typeAnimated:true, buttons:{ ok:{ text:'Ok', btnClass:'btn-red', action:function() { img.value=""; $('#label-span').html('Select photo/image'); /* $('#upload_image_view').attr({src:"assets/img/default-icon-1024.png"}).show(); $('#hidden_pre_div').hide();*/ } } } }); }else{ if(img.files && img.files[0]) { var filereader = new FileReader(); filereader.onload=function(evt) { //Hide the default image/photo //$('#upload_image_view').hide(); //Show the image selected and add an img element to the div element //$('#hidden_pre_div').show().html('<img src="'+evt.target.result+'" width="200" height="200" />'); //set label text $('#label-span').html(''+filename); }; filereader.readAsDataURL(img.files[0]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_image() {\n var im = document.getElementById(\"image_form\").elements.namedItem(\"image_src\").value;\n\n var image = new Image();\n image.src = im;\n\n image.onload = function() {\n if (this.width > 0) {\n alert(\"IMAGE SRC OK - CLICK 'ADD IMAGE' TO SUBMIT\"); }};\n\n image.onerror = function() {\n alert(\"IMAGE SRC INCORRECT - CHECK URL AND RE-ENTER\"); }; \n}", "function validateImg(ctrl) {\n var fileUpload = ctrl;\n var regex = new RegExp(\"([a-zA-Z0-9\\s_\\\\.\\-:])+(.jpeg|.jpg|.png|.gif)$\");\n if (regex.test(fileUpload.value.toLowerCase())) {\n if (typeof (fileUpload.files) != \"undefined\") {\n var reader = new FileReader();\n reader.readAsDataURL(fileUpload.files[0]);\n reader.onload = function (e) {\n var image = new Image();\n image.src = e.target.result;\n image.onload = function () {\n var height = this.height;\n var width = this.width;\n if (height == 680 && width == 1020) {\n // alert(\"Ảnh hợp lệ.\");\n return true;\n } else {\n fileUpload.value = null;\n alert(\"Ảnh không đúng kích thước 1020 x 680 !\");\n return false;\n }\n };\n }\n } else {\n alert(\"Trình duyệt của bạn không hỗ trợ HTML5.\");\n return false;\n }\n } else {\n alert(\"Hãy chọn đúng định dạng file ảnh.\");\n return false;\n }\n}", "function check_image(file) {\n\n}", "function validate(event) {\n\n\n var fileInput = document.getElementById(\"image1\").files;\n if (fileInput != '')\n {\n for (var i = 0; i < fileInput.length; i++)\n {\n\n var vname = fileInput[i].name;\n var ext = vname.split('.').pop();\n var allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'PNG'];\n var foundPresent = $.inArray(ext, allowedExtensions) > -1;\n // alert(foundPresent);\n\n if (foundPresent == true)\n {\n } else {\n $(\".bus_image\").html(\"Please select only Image File.\");\n event.preventDefault();\n //return false; \n }\n }\n }\n}", "function validateImg(ctrl) {\n\tvar fileUpload = ctrl;\n\tvar regex = new RegExp('([a-zA-Z0-9s_\\\\.-:])+(.jpeg|.jpg|.png|.gif)$');\n\tif (regex.test(fileUpload.value.toLowerCase())) {\n\t\tif (typeof fileUpload.files != 'undefined') {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.readAsDataURL(fileUpload.files[0]);\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar image = new Image();\n\t\t\t\timage.src = e.target.result;\n\t\t\t\timage.onload = function() {\n\t\t\t\t\tvar height = this.height;\n\t\t\t\t\tvar width = this.width;\n\t\t\t\t\tif (height == 680 && width == 1020) {\n\t\t\t\t\t\t// alert(\"Ảnh hợp lệ.\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfileUpload.value = null;\n\t\t\t\t\t\talert('Ảnh không đúng kích thước 1020 x 680 !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t} else {\n\t\t\talert('Trình duyệt của bạn không hỗ trợ HTML5.');\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\talert('Hãy chọn đúng định dạng file ảnh.');\n\t\treturn false;\n\t}\n}", "function validateImg(ctrl) {\n\tvar fileUpload = ctrl;\n\tvar regex = new RegExp('([a-zA-Z0-9s_\\\\.-:])+(.jpg|.png|.gif)$');\n\tif (regex.test(fileUpload.value.toLowerCase())) {\n\t\tif (typeof fileUpload.files != 'undefined') {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.readAsDataURL(fileUpload.files[0]);\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar image = new Image();\n\t\t\t\timage.src = e.target.result;\n\t\t\t\timage.onload = function() {\n\t\t\t\t\tvar height = this.height;\n\t\t\t\t\tvar width = this.width;\n\t\t\t\t\tif (height == 680 && width == 1020) {\n\t\t\t\t\t\t// alert(\"Ảnh hợp lệ.\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfileUpload.value = '';\n\t\t\t\t\t\talert('Ảnh không đúng kích thước 1020 x 680 !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t} else {\n\t\t\talert('Trình duyệt của bạn không hỗ trợ HTML5.');\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\talert('Hãy chọn đúng định dạng file ảnh.');\n\t\treturn false;\n\t}\n}", "function verifImage(){\n var file,fileTypes;\n file=$('#boutonAvatar');\n fileTypes = ['image/jpeg','image/jpg','image/png','image/gif'];\n for (var i = 0; i < fileTypes.length; i++) {\n if(file.files[0].type == fileTypes[i]) {\n return false;\n }\n }\n return true;\n}", "function validSelectedText(range) {\n\tconsole.log(\"check selected text\");\n\tvar nodes = range.cloneContents().querySelectorAll('*');\n\tvar len = nodes.length;\n\tfor (var i = 0; i < len; i++) {\n\t\t// if the node is an image, do nothing\n\t\tif (nodes[i].nodeName === \"IMG\") {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function isValidImage(images, allowed) {\n\n\n\n\n}", "function checkImg(i) {\n\t\t\n\t\tvar file = $(event.target)[0].files[0];\n\t\tvar img = new Image();\n\t\tvar imgwidth = 0;\n\t\tvar imgheight = 0;\n\t\tvar error=$(event.target).next();\n\t\t\n\t\tif(typeof file!==typeof undefined){\n\t\t\timg.src = URL.createObjectURL(file);\n\t\t\timg.onload=function(){\n\t\t\t\n\t\t\timgwidth = this.width;\n\t\t\timgheight = this.height;\n\t\t\t\n\t\t\tif(imgwidth > parseInt(150) && imgheight > parseInt(150)){\n\t\t\t\terror.text(\"Inserisci un'immagine di massimo 150x150\"); \n\t\t\t\t$(\".nextBtn\"+i).prop('disabled', true);\n\t\t\t}\n\t\t\telse{\n\t\t\t\terror.text(\"\"); \n\t\t\t\t$(\".nextBtn\"+i).prop('disabled', false);\n\t\t\t}\n\t\t}\n\t\t\n\t\t} else{\n\t\t\terror.text(\"\");\n\t\t\t$(\".nextBtn\"+i).prop('disabled', false);\n\t\t\treturn true;\n\t\t}\n\t}", "function checkSubImage() {\n var img1 = document.getElementById('txtImage1').value;\n var img2 = document.getElementById('txtImage2').value;\n var img3 = document.getElementById('txtImage3').value;\n var img4 = document.getElementById('txtImage4').value;\n var isNeedAlert = false;\n if (img1.length === 0 && img2.length === 0 && img3.length === 0 && img4.length === 0) {\n return;\n } else if (img1.length === 0 && img2.length > 0) {\n isNeedAlert = true;\n } else if ((img1.length === 0 || img2.length === 0) && img3.length > 0) {\n isNeedAlert = true;\n }else if ((img1.length === 0 || img2.length === 0 || img3.length === 0) && img4.length > 0) {\n isNeedAlert = true;\n }\n //alert\n if (isNeedAlert) {\n alert('Please fill in sub image fileds in order');\n }\n}", "function isImageOk(img) {\n if (!img.complete) {\n return false;\n }\n return !(typeof img.naturalWidth !== 'undefined' && img.naturalWidth === 0);\n }", "function selectImage(e) {\r\n if(e.target.innerHTML === \"\") //ensures only images can be clicked\r\n removeClasses(e);\r\n\r\n }", "function validateImage(src) {\r\n\tstrArr = src.split('.');\r\n\r\n\tif (strArr[strArr.length-1] == 'png' || strArr[strArr.length-1] == 'jpg' || strArr[strArr.length-1] == 'jpeg') {\r\n\t\treturn src;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function isImageOk(img) {\n // Image was removed from the page code (issue #1)\n if (typeof img === \"undefined\") {\n return false;\n }\n // During the onload event, IE correctly identifies any images that\n // weren’t downloaded as not complete. Others should too. Gecko-based\n // browsers act like NS4 in that they report this incorrectly.\n // NOTE: This check doesn't seem to be needed - and doesn't work \n // reliably in MS Edge in my tests. So disabling for now.\n //if (!img.complete) {\n // return false;\n //}\n // However, they do have two very useful properties: naturalWidth and\n // naturalHeight. These give the true size of the image. If it failed\n // to load, either of these should be zero.\n if (typeof img.naturalWidth !== \"undefined\" && img.naturalWidth <= 1) {\n return false;\n }\n // No other way of checking: assume it’s ok.\n return true;\n}", "function imageOk(img) {\n // During the onload event, IE correctly identifies any images that\n // weren't downloaded as not complete. Others should too. Gecko-based\n // browsers act like NS4 in that they report this incorrectly.\n if (!img.complete) {\n return false;\n }\n // However, they do have two very useful properties: naturalWidth and\n // naturalHeight. These give the true size of the image. If it failed\n // to load, either of these should be zero.\n if (typeof img.naturalWidth !== \"undefined\" && img.naturalWidth === 0) {\n return false;\n }\n // No other way of checking: assume it's ok.\n return true;\n }", "function checkForm() {\n\t\tif (parseInt($('#w').val())) return true;\n\t\t$('.error').html('Please select a crop region and then press Upload').show();\n\t\treturn false;\n}", "function isValidImage(filename) {\n if(!filename && typeof filename !== 'string') return false;\n let fileType = filename.split('.');\n fileType = fileType[fileType.length -1];\n return (fileType === \"jpg\" || fileType ===\"jpeg\" || fileType === \"png\")\n \n \n}", "function fileChangeCheck(fileUp) {\n var fileName = fileUp[\"0\"].files[\"0\"].name;//獲取本地文件名稱\n var fileSize = fileUp[\"0\"].files[\"0\"].size;//獲取文件大小\n //檢查上傳文件是否超過2MB\n fileSize = fileSize / 1024;\n if (fileSize > 2048) {\n alert(\"图片不能大于2MB\");\n $(this).val(\"\");\n return false;\n } else {\n //檢查上傳文件是圖片文件\n var fileName = fileName.substring(fileName.lastIndexOf(\".\") + 1).toLowerCase();\n if (fileName != \"jpg\" && fileName != \"jpeg\" && fileName != \"png\" && fileName != \"gif\") {\n alert(\"请选择图片格式上传(jpg,png,gif,gif等)!\");\n $(this).val(\"\");\n return false;\n } else {\n return true;\n }\n }\n}", "function checkInput() {\n\t\t\t// Store the pasted content in a variable\n\t\t\tif(foundImage == true) {\n\t\t\t\tvar child = pasteCatcher.children().last().get(0);\n\t\t\t\tif (child) {\n\t\t\t\t\t// If the user pastes an image, the src attribute will represent the image as a base64 encoded string.\n\t\t\t\t\tif (child.tagName === \"IMG\" && child.src.substr(0, 5) == 'data:') {\n\t\t\t\t\t\tcallback(child.src);\n\t\t\t\t\t\tfoundImage = false;\n\t\t\t\t\t} else { \n\t\t\t\t\t\talert(\"This is not an image!\");\n\t\t\t\t\t}\n\t\t\t\t\tpasteCatcher.html(\"\"); // erase contents of pasteCatcher DIV\n\t\t\t\t} else { \n\t\t\t\t\talert(\"No children found in pastecatcher DIV.\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\talert(\"No image found in the clipboard!\");\n\t\t\t}\n\t\t}", "function checkFile() {\n str = document.getElementById('imgUser').value;\n if (str != \"\") {\n str = str.toUpperCase();\n str = str.split(\".\", 2);\n str = str[1];\n tipo = \"JPG\";\n tipo1 = \"JPEG\";\n tipo2 = \"PNG\";\n if ((str != tipo) && (str != tipo1) && (str != tipo2)) {\n $(\"#divImgUser\").prop(\"class\", \"form-group has-error has-feedback\");\n $(\"#LblImgUserError\").show();\n $(\"#SpImg\").show();\n $(\"#imgUser\").focus();\n $(\"#btnGuardar\").prop(\"disabled\", true);\n } else {\n $(\"#divImgUser\").prop(\"class\", \"form-group\");\n $(\"#LblImgUserError\").hide();\n $(\"#SpImg\").hide();\n $(\"#btnGuardar\").prop(\"disabled\", false);\n }\n }\n}", "function fnValidateImage(oInput){\n\n\tvar sPath = oInput.val();\n\n\t// checks length of the path - if zero no image is added\n\tif( sPath.length == 0 ){\n\t\toInput.parent().addClass('invalid-property');\n\t\treturn false;\n\t} else {\n\t\toInput.parent().removeClass('invalid-property');\n\t\treturn true;\n\t}\n}", "function imageCheck() {\n var result = document.getElementById('imageurl').value;\n if (result) {\n document.getElementById('addImage').disabled = false;\n }\n else {\n document.getElementById('addImage').disabled = true;\n }\n}", "function check_if_already_choosed(file, img_url) {\n $(\"#preview\").children(\".post > img\").each(function () {\n if ($(this).attr(\"src\") == img_url) return true;\n });\n return false;\n}", "imageAdded(){\n if (!this.state.valid_image){\n alert(\"Please add a picture.\");\n return false;\n }\n return true;\n }", "function imageValidation(imageId, showImageId, errorDiv) {\n var image_holder = $(\"#\" + showImageId);\n if ($(\"#\" + errorDiv).parent().find(\".error\")) {\n $(\"#\" + errorDiv).parent().find(\".error\").text('');\n }\n image_holder.empty();\n if (imageId.files[0].type.startsWith(\"image/\")) {\n var reader = new FileReader();\n if (imageId.files[0].size / (validationError.playerImage.imageSizeInKB) <= (validationError.playerImage.maxLengthLimit)\n && imageId.files[0].size / (validationError.playerImage.imageSizeInKB) >= (validationError.playerImage.minLengthLimit)) {\n reader.onload = function (e) {\n $('#' + showImageId)\n .attr('src', e.target.result);\n };\n reader.readAsDataURL(imageId.files[0]);\n } else {\n $(\"#\" + errorDiv).show();\n $(\"#\" + errorDiv).text(validationError.proofPruchase.maxLengthLimitMessage);\n return false;\n }\n } else {\n $(\"#\" + errorDiv).show();\n $(\"#\" + errorDiv).text(validationError.proofPruchase.imageOnly);\n return false;\n }\n\n}", "function display_image(selection) {\n $(\"#greyscale_btn\").attr(\"disabled\", false)\n $(\"#invert_btn\").attr(\"disabled\", false)\n $(\"#reset_btn\").attr(\"disabled\", false)\n $(\"#brightness\").attr(\"disabled\", false)\n\n if (selection.files && selection.files[0]) {\n let reader = new FileReader()\n reader.onload = (o) => {\n $('#upload')\n .attr('src', o.target.result) // Gives <img> a valid src\n .width(300)\n .height(300)\n }\n reader.readAsDataURL(selection.files[0])\n } else {\n alert(\"Error with image upload\")\n } // end if else\n}", "function checkInput()\n {\n var child = pasteCatcher.childNodes[0];\n pasteCatcher.innerHTML = \"\";\n\n if (child) {\n // If the user pastes an image, the src attribute\n // will represent the image as a base64 encoded string.\n if (child.tagName === \"IMG\") {\n createImage(child.src);\n }\n }\n }", "function selectimage(id){\n\tif (selectedimage == undefined) {\n\t\t//geeft witte border aan de speler\n\t\tdocument.getElementById(id).classList.add(\"borders\");\n\t\tselectedimage = id;\n\t\tcheckimage = document.getElementById(id).src;\n\t}else{\n\t\t//removes border when another player or name is selected\n\t\tdocument.getElementById(selectedimage).classList.remove(\"borders\");\n\t\tdocument.getElementById(id).classList.add(\"borders\");\n\t\tselectedimage = id;\n\t\tcheckimage = document.getElementById(id).src;\n\t}\n\tcheckimage = checkimage.substring(checkimage.indexOf(\"img\"));\n\tconsole.log(checkimage);\n\tcheckMatch();\n}", "validFile(imageName){\n let lowercaseImageName = imageName.toLowerCase();\n return (\n lowercaseImageName.indexOf(\".jpg\") !== -1 ||\n lowercaseImageName.indexOf(\".jpeg\") !== -1 ||\n lowercaseImageName.indexOf(\".tiff\") !== -1 ||\n lowercaseImageName.indexOf(\".bmp\") !== -1\n )\n }", "function isValidImage(str) {\r\n\tvar error=0;\r\n\tvar exterror=0;\r\n\tvar nameerror=0;\r\n\tvar lastcount=str.split('\\\\').length;\r\n\tvar uploadimg=str.split('\\\\')[lastcount-1];\t\t\r\n\tvar pos=uploadimg.lastIndexOf(\".\");\t\t\t\t\r\n\tvar str1=uploadimg.substring(pos);\t\t\t\t\r\n\tvar str=str1.toLowerCase();\t\t\t\t\t\t\r\n\t//Check if the Image is a valid format\r\n\tif(str==\".jpg\" || str== \".gif\" || str==\".jpeg\")\r\n\t{\r\n\t\texterror=0;\t//The image is not a .jpg or .gif\r\n\t} else {\r\n\t\texterror=1;\t\r\n\t}\r\n\t//Check if the imagename is valid\r\n\tvar imagename=uploadimg.substring(0,pos);\r\n\tif (isalphanumeric(imagename) == false) {\r\n\t\tnameerror=2;\r\n\t}\r\n\tif (exterror==0 && nameerror==0){\r\n\t\terror=0;\r\n\t} else if (exterror!=0){\r\n\t\terror = exterror;\r\n\t} else if (nameerror!=0){\r\n\t\terror = nameerror;\r\n\t}\r\n\treturn(error);\t\t\r\n}", "function protection_image()\n{\n\t// Si on à pas déjà montré l'image\n\tif(typeof(proctection_image_deja_check) == 'undefined')\n\t{\n\t\touverture_alert(alert_basic = '<span>Les images sont protégées par des droits d\\'auteur :<br /><br />- Pour un usage personnel ou professionnel lié au web merci de faire une référence à DonneMoiFaim sur votre site internet (exemple dans la page partenaire) : <br /> <input onclick=\"this.select();\"class=\"input\" style=\"width:100%; min-width:200px; max-width:500px\" value=\\'&lt;a href=\"' + nom_domaine_site + '\"&gt;' + nom_domaine_site + '&lt;/a&gt; \\'/><br /><br />- Tout usage commercial des images (revente, etc..) est strictement interdit. </span>', taille_box = '300px' );\n\t\t\n\t\tproctection_image_deja_check = 1;\n\t}\n}", "function main() {\n\t\tvar selectedItem = ProjectManager.getSelectedItem(),\n\t\t\timageInfo = getImageInfo(selectedItem._path);\n\n\t\t// Check file via its extension\n\t\tif (!fileTypeRegex.test(imageInfo.name)) {\n\t\t\tDialogs.showModalDialog(EXTENSION_ID, 'Information', 'Please open an image or icon to pick colors from.');\n\t\t\treturn closeImage();\n\t\t}\n\n\t\tif (filePath !== imageInfo.path) {\n\t\t\topenImage(imageInfo);\n\t\t} else {\n\t\t\tcloseImage();\n\t\t}\n\t}", "function _checkPreview() {\n if (vm.user.fileInput.length == 0) {\n vm.user.imageUrl = defaultImageUrl\n vm.useFile = false\n return vm.imagePreview = defaultImageUrl\n }\n let reader = new FileReader()\n reader.onload = function (event) {\n $scope.$apply(function () {\n vm.imagePreview = event.target.result\n vm.useFile = true\n })\n }\n reader.readAsDataURL(vm.user.fileInput[0])\n }", "function check(file)\n\t{\n\tvar filename=file.value;\n\tvar ext=filename.substring(filename.lastIndexOf('.')+1);\n\t\tif(ext==\"jpg\" || ext==\"png\" || ext==\"jpeg\" || ext==\"gif\" || ext==\"JPG\" || \n\t\text==\"PNG\" || ext==\"JPEG\" || ext==\"GIF\")\n\t\t{\n\t\tdocument.getElementById(\"submit\").disabled=false;\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"\";\n\t\t}\n\t\telse\n\t\t{\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"! Please upload only JPG , GIF , JPEG File\";\n\t\tdocument.getElementById(\"submit\").disabled=true;\n\t\t}\n\t}", "function validarImagen() {\r\n // Revisar si está vacío\r\n if (chequearVacio(imagen)) return;\r\n return true;\r\n}", "function isInOtherImage( selection ) {\n\treturn [ ...selection.focus.getAncestors() ].every( ancestor => !ancestor.is( 'image' ) );\n}", "function validation(fileName) {\r\n\tfileName = fileName + \"\";\r\n\tvar fileNameExtensionIndex = fileName.lastIndexOf('.') + 1;\r\n\tvar fileNameExtension = fileName.toLowerCase().substring(\r\n\t\t\tfileNameExtensionIndex, fileName.length);\r\n\tif (!((fileNameExtension === 'jpg') || (fileNameExtension === 'gif') || (fileNameExtension === 'png'))) {\r\n\t\talert('jpg, gif, png 확장자만 업로드 가능합니다.');\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function checkLogo(file) {\t\t\t\r\n\textension = getfileextension(file);\t\r\n\textension = extension.toLowerCase();\r\n\tif (extension != \"jpeg\" && extension != \"jpg\" && extension != \"gif\" && extension != \"png\" && extension != \"bmp\") {\r\n\t\t$(\"#old_logo\").val(\"\");\r\n\t\talert(\"ERROR: The file you selected is not an image file (e.g., GIF, JPG, JPEG, BMP, PNG). Please try again.\");\r\n\t}\r\n}", "async function checkImageUrl() {\n await validateImageUrl(data.featuredImageUrl);\n setImageUrlValid(true);\n }", "function selectImage(form_name, container, image_id_field, original_secret_field) {\n\n //show which pic is currently selected (if any)\n var currentPicId = $('#' + form_name + '_' + image_id_field).val();\n //make this jquery safe by replacing period with escaped backslashes\n currentPicId = currentPicId.replace(/\\./g, '\\\\.');\n\n if (currentPicId !== 'undefined') {\n $('#' + currentPicId).css({borderColor: 'red'});\n } else {\n $('#no_image').css({borderColor: 'red'});\n }\n\n $(container + ' img').on('click touchstart', function () {\n\n // change all images back to default border\n $(container + ' img').css({borderColor: 'lightgrey'});\n\n //place a red border around the selected image\n $(this).css({borderColor: 'red'});\n\n //assign the value selected from the chosen field to the input text field boxes\n $('#' + form_name + '_' + image_id_field).val($(this).attr('id'));\n $('#' + form_name + '_' + original_secret_field).val($(this).attr('alt'));\n });\n}", "function validateFormModification(e) {\n\n // Contrôler les fichiers images\n var files = document.getElementById(\"doc\").files;\n var rslt = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n\n if (ex != 'image/png' && ex != 'application/pdf' && ex != 'image/jpeg'\n && ex != 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n && ex != 'application/msword'\n && ex != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n && ex != 'application/vnd.ms-powerpoint'\n && ex != 'application/vnd.openxmlformats-officedocument.presentationml.presentation')\n {\n rslt = true ;\n }\n\n });\n\n if (rslt) {\n alert(\"Les documents doivent être au format : Word, PowerPoint, PDF, JPG, PNG ou Excel ! \");\n document.getElementById(\"labelDoc\").style.color = \"red\"\n document.getElementById(\"doc\").value = \"\"\n\n return false; \n }\n\nreturn ( true );\n\n\n }", "function hasImg(input)\n{\n\treturn (input.indexOf('<img') != -1 || input.indexOf('<Img>') != -1 || input.indexOf('<IMG') != -1);\n}", "function fileValidation(){\n var fileInput = document.getElementById(\"file\")\n var filePath = fileInput.value;\nvar allowedExtenstions = /(\\.jpg|\\.png)$/i;\nif(!allowedExtenstions.exec(filePath)){\n alert(\"Please upload jpg or png\");\n fileInput.value ='';\n return false;\n\n}\n}", "static isAllowedImageType(name) {\r\n var allowedRx = C.RECOG_RGX.IMAGE;\r\n return allowedRx.test(name);\r\n }", "isImage(file) {\n return (\n Utility.isObject(file)\n && typeof file.hasOwnProperty(\"type\")\n && [\"image/png\", \"image/gif\", \"image/bmp\", \"image/jpg\", \"image/jpeg\"].indexOf(file.type) > -1\n );\n }", "function imageValidation(imageThis,imageFieldId,imageDisplayClass,isImageTag){\r\n\tvar flag\t\t=\t1;\r\n\tvar errorType\t=\t\"\";\r\n\t\r\n\tvar fileImage\t=\t$(\"#\"+imageFieldId).val();\r\n\tvar extension \t= \tfileImage.substring(fileImage.lastIndexOf('.') + 1).toLowerCase();\r\n\t\r\n\tif (extension == \"gif\" || extension == \"png\" || extension == \"bmp\"\r\n || extension == \"jpeg\" || extension == \"jpg\") {\r\n\t\t\r\n\t\tvar fileSize\t=\timageThis.files[0].size;//in Byts\r\n\t\tfileSize\t\t=\t(fileSize/1024).toFixed(2);//In KB\r\n\t\tfileSize\t\t=\t(fileSize/1024).toFixed(2);//In MB\r\n\t\t\r\n\t\tif(fileSize > 1){//File check For 1 mb \r\n\t\t\tflag\t=\t0;\r\n\t\t\terrorType\t=\t\"FILE_SIZE\";\t\r\n\t\t}\r\n\t}else {\r\n\t\tflag\t\t=\t0;\r\n\t\terrorType\t=\t\"FILE_TYPE_ERROR\";\r\n\t}\r\n\t\r\n\tif(flag == 0){\r\n\t\tif($(\"#\"+imageFieldId).val() != \"\"){\r\n\t\t\tdisplayMessageBox(\"Error\", getImageFileErrorMessage(errorType));\r\n\t\t}\r\n\t\t$(\"#\"+imageFieldId).val('');\r\n\t\t\r\n\t\t$(\"#\"+imageFieldId).closest( \".fileupload\" ).fileupload('clear');\r\n\t\tvar orginalSrc = $(\"#\"+imageFieldId+\"Original\").attr('src');\r\n\t\tif(isImageTag){\r\n \t\t$('.'+imageDisplayClass).attr('src', ''+orginalSrc);\r\n \t}else {\r\n \t\t$('.'+imageDisplayClass+' img').attr('src', ''+orginalSrc);\r\n \t}\r\n\t}\r\n\t\r\n\treturn flag;\r\n}", "function isImage($field) {\n return !_.isEmpty($field) && $field.prop(\"type\") === \"file\" && $field.hasClass(\"coral-FileUpload-input\");\n }", "function checkImgFile(file) {\n //Check File Size\n if (file.size > 0 && file.size < 1000000) {\n //Check File Name\n var extension = file.name.substr(file.name.lastIndexOf('.') + 1).toUpperCase();\n if (extension == \"PNG\" || extension == \"JPG\" || extension == \"JPEG\" || extension == \"GIF\")\n return 1;\n else\n return \"Supported File Types: PNG, JPG, GIF\";\n }\n else\n return \"Supported File Size: 1MB Maximum\";\n }", "function imageValidationAndPreview(imageThis,imageFieldId,imageDisplayClass,isImageTag,isImageSizeCheck,imageWidthValid,imageHeightValid){\r\n\t\r\n\tvar imageValidationFlag\t\t=\timageValidation(imageThis,imageFieldId,imageDisplayClass,isImageTag);\r\n\tif(imageValidationFlag == 1){\r\n\t\treadURL(imageThis,imageFieldId,imageDisplayClass,isImageTag,isImageSizeCheck,imageWidthValid,imageHeightValid);\r\n\t}\r\n}", "function validateChequePhoto()\n{\n\tif(document.getElementById(\"chequephotoId\").value == \"\") \n\t{\n\t\t var msg = \"Please upload an image.\";\n\t\t //the cheque photo element clashes with the function so I just made it so it only makes the border red.\n\t\t document.form1.chequephotoId.style.border=\"solid 1px red\";\n\t\t return false; \n\t}\n\treturn true;\n}", "function onImageClick (e) {\n\t// set boolean flag - did user click correct image?\n\tvar right = e.target.className === 'right';\n\t// on first click, this is null. but if user first clicked wrong image, mark old choice as well\n if (oldChoice) {\n oldChoice.style.border = \"solid\";\n };\n\t// define previous user's choice\n var div = e.target.parentNode.parentNode;\n\toldChoice = div;\n\t// mark image as selected\n div.style.border = \"5px solid yellow\";\n\t// if the \"noRightImage\" attack is active, user's wrong. else, define if \"right\" or \"wrong\"\n\timageChoice = settings['attack'] === 'noRightImage' ? 'wrong' : e.target.className;\n\t// forward user to wanted page\n onContinue();\n}", "function activeShutter_haveValidSelection()\r\n\t\t{\r\n\t\t\tif (app.project == null)\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoProj;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ((app.project.activeItem == null) || ((app.project.activeItem != null) && !(app.project.activeItem instanceof CompItem)))\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoActiveComp;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "function determineImageToSampleFrom() {\r\n\r\n console.log(document.getElementById(\"imageSelector\").value);\r\n\r\n if (document.getElementById(\"imageSelector\").value !== null) {\r\n\r\n return document.getElementById(\"imageSelector\").value;\r\n\r\n } else {\r\n\r\n return \"endgame-poster.jpg\";\r\n\r\n }\r\n\r\n}", "function checkFileType(e)\n{\n\t\n\tvar el = e.target ? e.target : e.srcElement ;\n\t var cls = '';\n\tif(parseInt($('input#editUserroleId').val()) > 0 )\n\t{\n\t\tcls = 'marginForError';\n \n\t}\n\t var regex = /png|jpg|jpeg|gif/ ;\n\t if( regex.test(el.value) )\n\t {\n\t\t\n\t\t invalidForm[el.name] = false ;\n\t\t \t\t \n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls +\" success help-inline'>Valid file</span>\");\n\t\t \n\t } else {\n\t\t\n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('error').removeClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls + \" error help-inline'>Please upload valid file</span>\");\n\t\t \n\t\t invalidForm[el.name] = true ;\n\t\t errorBy = el.name ;\n\t }\n}", "function CheckFile(file)\n{\n var msg;\n var error=0;\n var maxSize=1024*1024*5;\n if(file.files[0].size>maxSize)\n error=error+1;\n var filesExt = ['jpg', 'gif', 'png','jpeg'];\n var parts = $(file).val().split('.');\n if(filesExt.join().search(parts[parts.length - 1]) == -1){\n error=error+2;\n }\n if(error!=0){\n switch (error) {\n case 1:\n msg='Файл перевищує 5 Мб';\n break;\n case 2:\n msg='Неправильний формат файлу';\n break;\n case 3:\n msg='Файл перевищує 5 Мб. Неправильний формат файлу';\n break;\n }\n $('#errorMessage').text(msg);\n $('#errorMessage').show();\n $('#imgButton').attr('disabled','true');\n }else{\n $('#errorMessage').hide();\n $('#imgButton').removeAttr('disabled');\n }\n}", "function checkIsTodayPhoto(){\r\n\talert('You Have Already Uploaded Today Picture');\r\n\treturn false;\t\r\n}", "function validateFileExtension(fld)\n{\n var img = fld;\n /* var objImage = new Image();\n objImage.src = fld.value\n alert(\"width : \" + objImage.width + \" height : \" + objImage.height);*/\n var fileSize = fld.files[0].size;\n fileSize = Math.round(parseInt(fileSize)/1024)\n if(img.id=='pho' && (fileSize>100)){ \n document.getElementById(\"photo_tab\").style.display=\"block\";\n document.getElementById(\"photo_tab\").rows[1].cells[2].innerHTML = fileSize + 'kb';\n return false; \n }else if(img.id=='sign' && (widthTest>100 || heightTest>40)){\n document.getElementById(\"sign_tab\").style.display=\"block\";\n document.getElementById(\"sign_tab\").rows[1].cells[2].innerHTML = fileSize + 'kb';\n return false;\n}\n/*//or however you get a handle to the IMG\nvar widthTest = img.clientWidth;\nvar heightTest = img.clientHeight;\nif(img.id=='pho' && (widthTest>200 || heightTest >80)){\n document.getElementById(\"photo_tab\").style.display=\"block\";\n document.getElementById(\"photo_tab\").rows[1].cells[2].innerHTML = widthTest;\n document.getElementById(\"photo_tab\").rows[2].cells[2].innerHTML = heightTest;\n return false;\n}else if(img.id=='sign' && (widthTest>100 || heightTest>40)){\n document.getElementById(\"sign_tab\").style.display=\"block\";\n document.getElementById(\"sign_tab\").rows[1].cells[2].innerHTML = widthTest;\n document.getElementById(\"sign_tab\").rows[2].cells[2].innerHTML = heightTest;\n return false;\n}*/\nif(!/(\\.bmp|\\.gif|\\.jpg|\\.jpeg)$/i.test(fld.value)) {\n\t\talert(\"Invalid image file type.\");\n\t\tfld.focus();\n\t\treturn false;\n}\nreturn true;\n}", "function onchangebackgroundimage(selected) {\n\tvar bgimg = document.getElementById(\"bgimg\");\n\tvar blankimg = document.getElementById(\"blankimg\");\n\tvar image = selected.files;\n\tvar url = URL.createObjectURL(image[0]);\n\tbgimg.onload = function () {\n\t\tif (bgimg.src != blankimg.src) {\n\t\t\tdocument.getElementById(\"clearbackgroundimagebutton\").style.display = \"block\";\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"clearbackgroundimagebutton\").style.display = \"none\";\t\n\t\t}\n\t\tonchangeoptions();\n\t}\n\tbgimg.src = url;\n}", "function readURL(input) {\r\n var id = input.id;\r\n\r\n var fileTypeArray = input.files[0].name;\r\n var fileType = fileTypeArray.split('.');\r\n //alert(fileType[fileType.length - 1]);\r\n\r\n var typeSelect = fileType[fileType.length - 1];\r\n\r\n\r\n if ($.inArray(typeSelect, ['jpeg', 'jpg', 'JEPG', 'JPG', 'png', 'PNG', 'GIF', 'gif']) != '-1') {\r\n /**image size check option start**/\r\n var _URL = window.URL || window.webkitURL;\r\n var file = input.files[0];\r\n var img = new Image();\r\n\r\n var imgwidth = 0;\r\n var imgheight = 0;\r\n var maxwidth = 650;\r\n var maxheight = 400;\r\n\r\n img.src = _URL.createObjectURL(file);\r\n img.onload = function () {\r\n imgwidth = this.width;\r\n imgheight = this.height;\r\n\r\n if (maxwidth > imgwidth || maxheight > imgheight) {\r\n $('#show_' + id).removeClass('show_select_pic');\r\n $('#' + id).val('');\r\n alert('Image should be minimun (650 X 400) px');\r\n return false;\r\n } else { /**image size check option end**/\r\n /**image preview option start**/\r\n\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n $('#show_' + id).addClass('show_select_pic');\r\n reader.onload = function (e) {\r\n $('#show_' + id).attr('src', e.target.result).fadeIn('slow');\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n } else {\r\n $(\"#\" + id).val('');\r\n alert('Sorry system error...');\r\n\r\n }\r\n /**image preview option end**/\r\n }\r\n\r\n }\r\n\r\n } else {\r\n $(\"#\" + id).val('');\r\n $('#show_' + id).removeClass('show_select_pic');\r\n alert('Invalid image format...');\r\n\r\n }\r\n\r\n}", "function checkUploadedImage(fileInput) {\n let uploadImgErrMsg = document.getElementById('uploadImgErrMsg');\n let image = fileInput.files;\n /// check if really choosed something\n if (image.length > 0) {\n let url = 'Controllers/multipleController.php';\n let objectToSend = {imageType: image[0].type, imageSize: image[0].size, checkImage: null};\n $.post(url, objectToSend, function (response) {\n let uploadImgErrMsg = document.getElementById('uploadImgErrMsg');\n if ((response === 'ok')) {\n letSaveImage = true;\n uploadImgErrMsg.innerHTML = \"\";\n uploadImgErrMsg.style.display = \"none\";\n /// open file reader to display image\n var reader = new FileReader();\n reader.onload = function (e) {\n document.getElementById('imageDisplayer').src = e.target.result;\n }\n reader.readAsDataURL(fileInput.files[0]);\n } else {\n letSaveImage = false;\n uploadImgErrMsg.innerHTML = response;\n uploadImgErrMsg.style.display = \"block\";\n }\n });\n /// in case chanded is mind and chose to not upload......\n } else {\n letSaveImage = null;\n uploadImgErrMsg.innerHTML = \"\";\n uploadImgErrMsg.style.display = \"none\";\n }\n}", "function checkImage(id) {\n //console.log(\"click\");\n var image = document.getElementById(id);\n var src = image.src;\n //console.log(src.indexOf(\"photos\"));\n return(src.indexOf(\"photos\"));\n}", "function checkImage(id) {\n //console.log(\"click\");\n var image = document.getElementById(id);\n var src = image.src;\n //console.log(src.indexOf(\"photos\"));\n return(src.indexOf(\"photos\"));\n}", "function validate()\r\n{\r\n\t\r\n\tif( document.myForm.img1.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img1.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img2.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img2.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img3.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img3.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img4.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img4.focus() ;\r\n return false;\r\n }\r\n \r\n if( document.myForm.img5.value == \"\" )\r\n {\r\n alert( \"Please upload your image!\" );\r\n document.myForm.img5.focus() ;\r\n return false;\r\n }\r\n \r\n alert( \"Values entered successfully\" );\r\n}", "function is_selected(selectedData, kind) {\n\t\tvar testpaper_invalid = document.getElementById(\"testpaper_invalid\");\n\t\tvar group_invalid = document.getElementById(\"group_invalid\");\n\n\t\tif (selectedData.value === '') {\n\t\t\tif (kind === 'Group') {\n\t\t\t\tvalidGroup = false;\n\t\t\t\tgroup_invalid.innerHTML = \"<span style='color: red; font-size: 14px'>Required</span>\";\n\t\t\t} else {\n\t\t\t\tvalidTestpaper = false;\n\t\t\t\ttestpaper_invalid.innerHTML = \"<span style='color: red; font-size: 14px'>Required</span>\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (kind === 'group') {\n\t\t\t\tvalidGroup = true;\n\t\t\t\tgroup_invalid.innerHTML = '';\n\t\t\t} else {\n\t\t\t\tvalidTestpaper = true;\n\t\t\t\ttestpaper_invalid.innerHTML = '';\n\t\t\t}\n\t\t}\n\t\tdata_valid();\n\t}", "function checkInput() {\n // Store the pasted content in a variable\n var child = pasteCatcher.childNodes[0];\n\n // Clear the inner html to make sure we're always\n // getting the latest inserted content\n pasteCatcher.innerHTML = \"\";\n\n if (child) {\n // If the user pastes an image, the src attribute\n // will represent the image as a base64 encoded string.\n if (child.tagName === \"IMG\") {\n createImage(child.src);\n }\n }\n}", "function validate_image (id) {\n\t/*alert('hiiii');\n if (typeof ($(\"#\"+id)[0].files) != \"undefined\") {\n var size = parseFloat($(\"#fileUpload\")[0].files[0].size / 1024).toFixed(2);\n alert(size + \" KB.\");\n } else {\n alert(\"This browser does not support HTML5.\");\n }*/\n\treturn true;\n}", "function validatePassportPhoto()\n{\n\tif(document.getElementById(\"passportphotoId\").value == \"\") \n\t{\n\t\t var msg = \"Please upload an image.\";\n\t\t //call the display error function\n\t\t displayError(document.form1.passportphotoId, msg);\n\t\t return false; \n\t}\n\treturn true;\n}", "function checkStatus() {\n if (imageGallery.supportsAvif !== null && imageGallery.supportsWebp !== null) {\n imageGallery.showOverlay(imageIndex);\n return;\n }\n }", "function isValid() {\n return !!selectedValue && isHexColor(selectedValue);\n }", "function validate(file) {\n\t\tif (file.type == \"image/png\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$(\"input#file\").replaceWith($(\"input#file\").val(\"\").clone(true));\n\t\t\treturn false;\n\t\t}\n\t}", "function checkImageDimensions(image){if(test)console.log(image.src+\" ; state:\"+image.complete+\":n w h:\"+image.naturalWidth+\" \"+image.naturalHeight+\";w h:\"+image.clientWidth+\" \"+image.clientHeight);if(image.clientWidth>0){if(image.clientWidth<minWidthOfImageForDisplayBottomOffersWrapper){if(test)console.log('картинка '+image.src+' не прошла проверку на размеры с шириной '+image.naturalWidth+'('+_typeof(image.naturalWidth)+') и высотой '+image.naturalHeight+'('+_typeof(image.naturalHeight)+')');return false;}else return true;}else if(image.naturalWidth<minWidthOfImageForDisplayBottomOffersWrapper){if(test)console.log(image.naturalHeight);return false;}return true;}", "function checkFileType(e)\n{\n\t\n\tuploadPdfFlag = 0;\n\tif ( $(\"input[name= printableCheckbox]\")\n\t\t\t.is(\":checked\") ) \n\t{\n\t\t\n\t\t var el = e.target ? e.target : e.srcElement ;\n\t\t \n\t\t var regex = /pdf|jpg|jpeg|JPG|JPEG/ ;\n\t\t\n\t\t if( regex.test(el.value) )\n\t\t {\n\t\t\t invalidForm[el.name] = false ;\n\t\t\t \t\t \n\t\t\t $(el).parent(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='success help-inline'>Valid file</span>\"));\n\t\t\t \n\t\t } else {\n\t\t\t\n\t\t\t $(el).parents(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='error help-inline'>Please upload only jpg or pdf file</span>\"));\n\t\t\t \n\t\t\t invalidForm[el.name] = true ;\n\t\t\t errorBy = el.name ;\n\t\t\t \n\t\t\t \n\t\t }\n\t \n\t \n\t} else {\n\t\tinvalidForm = {} ;\n\t}\n\n\t \n\t \n}", "function checkForImg(val){\n return !val ? 'https://tinyurl.com/tv-missing' : val.original\n }", "function ReturnIfImageError() {\n if (currentEpisode.Pages[0].Path.search(\"img_warning\") > 0)\n return true;\n else\n return false;\n \n}", "function onchangeforegroundimage(selected) {\n\tvar fgimg = document.getElementById(\"fgimg\");\n\tvar blankimg = document.getElementById(\"blankimg\");\n\tvar image = selected.files;\n\tvar url = URL.createObjectURL(image[0]);\n\tfgimg.onload = function () {\n\t\tif (fgimg.src != blankimg.src) {\n\t\t\tdocument.getElementById(\"foregroundpositiontopwrapper\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"foregroundpositionleftwrapper\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"clearforegroundimagebutton\").style.display = \"block\";\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"foregroundpositiontopwrapper\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"foregroundpositionleftwrapper\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"clearforegroundimagebutton\").style.display = \"none\";\n\t\t}\n\t\tonchangeoptions();\n\t}\n\tfgimg.src = url;\n}", "function ValidarFormatoArchivo() {\n debugger;\n var fileInput = document.getElementById('imagenEncabezado');\n var filePath = fileInput.value;\n var allowedExtensions = /(.jpg)$/i;\n if (!allowedExtensions.exec(filePath)) {\n $(\"#modal\").modal(\"show\");\n $(\"#titulo\").html(\"Advertencia\");\n $(\"#contenido\").html(\"Solo se permite el archivo en formato .JPG\");\n fileInput.value = '';\n return false;\n }\n}", "function IsValidImageUrl(url) {\r\n $(\"<img>\", {\r\n src: url,\r\n error: function () {\r\n alert(url + \": \" + false);\r\n },\r\n load: function () {\r\n alert(url + \": \" + true);\r\n }\r\n });\r\n}", "isImage(filename){\n return filename.split('.').pop()==\"pdf\"\n }", "function isImageCb (url) {\n\t validatedUrls.push(url);\n\t if (validatedUrls.length === 6) {\n\t cb(validatedUrls);\n\t }\n\t }", "function validateFile() {\n\n const fileName = $('#uploadImage').val();\n const allowedExtensions = new Array('jpg', 'png');\n const fileExtension = fileName.split('.').pop().toLowerCase(); // split the filename by dot(.), and pop the last element from the array which will give you the extension as well. If there will be no extension then it will return the filename.\n\n for (let i = 0; i <= allowedExtensions.length; i++) {\n if (allowedExtensions[i] === fileExtension) {\n return true; // valid file type\n }\n }\n return false;\n}", "function showAndValidateAchFile(){\n\tvar field = document.getElementById(\"achPhotoField\");\n\tvar fileType = field.value.split(\".\").pop().toLowerCase();\n\n\tif(fileType == \"jpg\" || fileType == \"bmp\" || fileType == \"jpeg\" || fileType == \"png\" || fileType == \"gif\" || fileType == \"svg\"){\n\t\tif(field.files[0].size/1024/1024 < 10){\n\t\t\t$(\"#ach-imageDiv\").show();\n\t\t\t$(\"#achPhotoError\").text(\"\");\n\t\t\tshowAchPic(field);\n\t\t}else{\n\t\t\tfield.value= \"\";\n\t\t\t$(\"#ach-imageDiv\").hide();\n\t\t\t$(\"#achPhotoError\").text(\"File too large. max 10MB...\");\n\t\t\tevent.preventDefault();\n\t\t}\n\t}else{\n\t\tfield.value= \"\";\n\t\t$(\"#ach-imageDiv\").hide();\n\t\t$(\"#achPhotoError\").text(\"Invalid file. Only photos are allowed...\");\n\t\tevent.preventDefault();\n\t}\n}", "_isImage(file) {\n if (file.type) {\n return (file.type.split('/')[0] === 'image');\n }\n\n const filename = file.name.toLowerCase();\n\n return ['.jpeg', '.jpg', '.png', '.gif', '.bmp', '.tiff', '.svg'].some(\n extension => filename.endsWith(extension));\n }", "function checkCoords(){\n if (parseInt($('#w').val())) return true;\n alert('Please select a crop region then press submit.');\n return false;\n }", "function verifyImageType(cb) {\n var imageType = composeImageType(0)\n\n if (cb) {\n verifyImageTypeAsync(imageType, cb)\n } else {\n return verifyImageTypeSync(imageType)\n }\n }", "function checkIsPhoto(totalDay,totalPhoto){\r\n\tif(totalDay==totalPhoto){\r\n\t\treturn true;\t\r\n\t}else{\r\n\t\talert('Picture of Days/Items/Steps are missing - please upload picture to publish');\r\n\t\treturn false;\r\n\t}\r\n}", "function checkAttachImg(filename,set_inline_img) {\r\n\tvar dot = filename.lastIndexOf(\".\"); \r\n\tif( dot == -1 ) return \"\"; \r\n\tvar extension = filename.substr(dot+1,filename.length).toLowerCase();\r\n\tvar is_img = (extension == \"jpeg\" || extension == \"jpg\" || extension == \"gif\" || extension == \"png\" || extension == \"bmp\");\r\n\tenableAttachImgOption(is_img,set_inline_img);\r\n}", "function checkShowHideUploadImageButton() {\n if (filesImage.length == 5) { // check if quantity of file greater than 4\n $(\"#imgRetailPlaceholder\").hide(); // Hide button upload image\n } else {\n $(\"#imgRetailPlaceholder\").show();\n }\n }", "function previewImg(inputsel, imagesel, formsel) {\n\t// Copy the url from the input field to the form field\n var url = $(inputsel).attr(\"value\");\n if (url != $(formsel).attr(\"value\"))\n\t\t$(formsel).attr(\"value\", url )\n\t\t\n\tvar imageset = $(imagesel)\n\t// For display purposes we use a no-picture picture\n\tif (url.length < 1) url = \"/assets/NoPictureOnFile.png\"\n\tif(imageset.attr(\"src\") != url) {\n\t\timageset.removeClass(\"loaded\");\n\t\timageset.attr(\"src\", url )\n\t\tfitImage(imageset[0])\n\t}\n}", "function validateAvatarSelect(avatar, errors) {\n if (!avatar) {\n errors.avatar = \"You must select an avatar\";\n }\n}", "selectImage(imgSrc) {\n const {onImageSelected} = this.props;\n if (typeof onImageSelected === \"function\") {\n onImageSelected(imgSrc);\n }\n }", "function petEditValidator(){\r\n //Verificando se todos os campos estao preenchidos\r\n\tif($('#animalImage').attr('src') === './src/images/animals/white.jpg'){\r\n\t\talert(\"Campo imagem não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalName').val() == ''){\r\n\t\talert(\"Campo nome não está preenchido.\");\r\n\t\treturn false;\r\n }\r\n if($('#animalId').val() == ''){\r\n\t\talert(\"Campo Id não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalBreed').val() == ''){\r\n\t\talert(\"Campo raça não está preenchido.\");\r\n\t\treturn false;\r\n } \r\n if($('#animalAge').val() == ''){\r\n\t\talert(\"Campo idade não está preenchido.\");\r\n\t\treturn false;\r\n }\r\n return true;\r\n}", "function validateForm() {\n\t// (Can't use `typeof FileReader === \"function\"` because apparently\n\t// it comes back as \"object\" on some browsers. So just see if it's there\n\t// at all.)\n\tif (!window.FileReader) {\n\t\tconsole.log(\"The file API isn't supported on this browser yet.\");\n\t\treturn false;\n\t}\n\t\n\tconsole.log('Form submitted!');\n\tvar inpObj = document.getElementById('inputImage');\n\tif (!inpObj.value) {\n\t\tconsole.log(\"you didnt enter an image\");\n\t}\n\telse if (!inpObj.files) {\n\t\tconsole.log(\"This browser doesn't support the `files` property of file inputs.\");\n\t}\n\telse if (!inpObj.files[0]) {\n\t\tconsole.log(\"Please select a file before clicking 'Submit'\");\n\t}\n\telse {\n\t\tfile = inpObj.files[0];\n\t\tconsole.log(\"File \" + file.name + \" is \" + file.size + \" bytes in size\");\n\t\t//if larger than 5Mbytes\n\t\tif(file.size > 5120000){\n\t\t\tconsole.log(\"the file is larger than 5Mbytes(5,120,000 bytes)!\");\n\t\t}\n\t\t\n\t\tdisplayImage(inpObj);\n\t}\t\t\n\treturn false;\n}", "function checkImageInDOM(image){var parent=image.parentNode;if(parent.tagName==='A'){if(test)console.log('картинка '+image.src+' не прошла проверку на HTML, потому что обернута в ссылку на первом уровне');return false;}else return true;}", "function imageExist(text) {\n var elem = document.getElementById(\"unloaded\");\n if (images2Upload.total === 0) {\n elem.style.display = 'block';//if the array is empty will saw msg\n elem.innerText = text;\n return 0;\n } else {\n document.getElementById(\"unloaded\").style.display = 'none';//hide msg if that array isnt empty\n return 1;\n }\n }", "function checkValid() {\n let formsFilled;\n if ($(\"#inputName\").val().trim() === \"\") {\n let formsFilled = false;\n return formsFilled;\n } else if ($(\"#inputPhoto\").val().trim() === \"\") {\n let formsFilled = false;\n return formsFilled;\n } else if (\n $(\"#selection1\").val() === \"Select an Option\" || $(\"#selection2\").val() === \"Select an Option\" ||\n $(\"#selection3\").val() === \"Select an Option\" || $(\"#selection4\").val() === \"Select an Option\" ||\n $(\"#selection5\").val() === \"Select an Option\" || $(\"#selection6\").val() === \"Select an Option\" ||\n $(\"#selection7\").val() === \"Select an Option\" || $(\"#selection8\").val() === \"Select an Option\" ||\n $(\"#selection9\").val() === \"Select an Option\" || $(\"#selection10\").val() === \"Select an Option\") {\n let formsFilled = false;\n return formsFilled;\n } else {\n let formsFilled = true;\n return formsFilled;\n }\n }", "function checkFileTypeImageSupported(fileType) {\n var fileTypesSupported = [\"pdf\", \"doc\", \"docx\", \"jpg\", \"jpeg\", \"ppt\", \"js\", \"xls\", \"css\", \"png\", \"xml\", \"zip\", \"json\", \"txt\", \"mp3\", \"csv\", \"mp4\", \"psd\", \"svg\", \"avi\", \"exe\", \"iso\", \"rtf\", \"dbf\", \"ai\", \"html\", \"fla\", \"dwg\", \"file\"];\n for (type in fileTypesSupported){ \n if(fileType === fileTypesSupported[type]){ \n return true;\n }\n }\n return false;\n}", "function imageIsLoaded(image) {\n if (image != null && image.complete()) {\n return true;\n }\n else {\n alert(\"Image not ready.\");\n return false;\n }\n}", "function validateFormPropals() {\n\n //if ( formEditConception.propals !== undefined ) {\n\n var files = document.getElementById(\"propals\").files;\n var l = files.length ;\n if (l != 3) {\n alert(\"Vous devez soumettre 3 propositions ! \" );\n document.getElementById(\"propals\").value = '' ;\n return false;\n }\n else\n {\n var resultat = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n if (ex != \"image/png\" && ex != \"image/jpeg\" )\n {\n resultat = true ;\n }\n });\n if (resultat) {\n alert(\"Les propositions doivent être au format : JPG ou PNG ! \");\n document.getElementById(\"propals\").value = \"\"\n return false; \n } \n }\n }", "static isImage(path)\n {\n return path.endsWith(\".png\") || path.endsWith(\".jpg\") || path.endsWith(\".jpeg\");\n }" ]
[ "0.7027609", "0.6980305", "0.6831885", "0.6830929", "0.67566407", "0.674375", "0.67273265", "0.66135293", "0.6603978", "0.65306056", "0.6455938", "0.6424027", "0.6352899", "0.6335041", "0.6302146", "0.63014454", "0.628591", "0.6269516", "0.6265114", "0.6222214", "0.6189747", "0.6177828", "0.61755013", "0.61682105", "0.6165936", "0.615022", "0.6145583", "0.6140595", "0.6138655", "0.6136272", "0.6126435", "0.61250013", "0.6106549", "0.60885376", "0.60776645", "0.60764545", "0.60647124", "0.6063817", "0.6052897", "0.60347253", "0.60198444", "0.60028344", "0.59934956", "0.5986575", "0.59857684", "0.59844106", "0.59765214", "0.5964166", "0.5962384", "0.59587944", "0.5947881", "0.5942909", "0.5940611", "0.59384257", "0.59353435", "0.59247273", "0.5916288", "0.5916045", "0.5913387", "0.5911081", "0.59062487", "0.58970946", "0.58970946", "0.5886914", "0.58728737", "0.5867326", "0.58560115", "0.5852946", "0.5845443", "0.5841833", "0.5834744", "0.58328843", "0.5821529", "0.5813944", "0.58130693", "0.5810377", "0.5806628", "0.5801224", "0.5786684", "0.5785824", "0.57804614", "0.5775899", "0.5767178", "0.5760344", "0.5755569", "0.574392", "0.57398635", "0.5733565", "0.573002", "0.57199985", "0.5719675", "0.5717586", "0.57144296", "0.5714371", "0.57092017", "0.570592", "0.5698617", "0.56811714", "0.567965", "0.5672577" ]
0.6237262
19
function to update food Stock and last fed time
feedDog() { dog.addImage(happyDog); foodObj.updateFoodStock(foodObj.getFoodStock()-10); database.ref('/').update ({ Food:foodObj.getFoodStock(), FeedTime:hour() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readStock(data){ \n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n } //function to update food stock and last fed time", "function updateStock() {\n\t\t\t\t\t\tupdatedStock = selectedProductDetails.stock_quantity - answer.quantity;\n\t\t\t\t\t}", "function feeddog(x) {\n\ndog.addImage(happydogimg);\nvar foodstockval = foodObj.getfoodstock();\nif(foodstockval <= 0) {\n foodObj.updatefoodstock(foodstockval*0);\n} else {\n foodObj.updatefoodstock(foodstockval - 1);\n}\n\n database.ref('/').update({\n Food:foodObj.getfoodstock(),\n feedtime : hour(),\n\n\n })\n\n}", "function feedDog(){\n dog.addImg(dogImg2) \n foodObj.updatefoodStock(foodObj.getfoodStock()-1)\n \n database.ref('/').update({\n Food:foodObj.getfoodStock()\n //feedTime:hour()\n })\n}", "function readstock(data) {\n foods = data.val();\n foodObj.updatefoodstock(foods);\n\n}", "function updateQuantity() {\n if (updating) {\n console.log(quant);\n console.log(\"Stock quantity: \" + stockQuantity);\n let newStockQuantity = stockQuantity - quant;\n console.log(\"Remaining stock: \" + quant);\n\n let updatedProduct = {\n id: productID,\n stock_quantity: newStockQuantity\n };\n console.log(updatedProduct);\n updateProducts(updatedProduct).then(function(res) {\n console.log(res);\n });\n }\n }", "function readstock(data){\r\n foods = data.val();\r\n \r\n foodobj.updatefoodcount(foods);\r\n\r\n}", "function addFoods() {\r\n foodObj.updateFoodStock(foodStock + 1);\r\n}", "refresh() {\n if (this.date && this.price)\n this.update(this.date, this.price);\n }", "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "function readStock(data){\n foodS = data.val();\n foodObj.updateFoodStock(foodS)\n}", "function readStock(data){\r\n foodS=data.val();\r\n foodObj.updateFoodStock(foodS);\r\n \r\n \r\n \r\n}", "function readStock(data){\r\n foodS=data.val();\r\n foodObj.updateFoodStock(foodS);\r\n}", "function readStock(data){\r\n foodS=data.val();\r\n foodObj.updateFoodStock(foodS);\r\n}", "function readStock(data){\r\n foodS=data.val();\r\n foodObj.updateFoodStock(foodS);\r\n}", "function feedDog(){\r\n if(foodS > 0){\r\n dog.changeAnimation(\"dog2\", happyDog);\r\n foodS--;\r\n foodObj.updateFoodStock(foodS);\r\n database.ref('/').update({\r\n feedTime: hour()\r\n // foodObj.updateLastFed(lastFed);\r\n })\r\n\r\n \r\n }\r\n}", "function addFood(){\r\n foodS++;\r\n foodObj.updateFoodStock(foodS);\r\n}", "function feedDog(){\n dog.addImage(dog_Img2);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour()\n })\n}", "function readStock(data){\r\n foods=data.val();\r\n foodObj.updateFoodStock(foods);\r\n}", "function readStock(data){\n foodS = data.val();\n foodObj.updateFoodStock(foodS);\n}", "function feedDog(){\n dog.addImage(happyDog);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n feedTime:hour()\n\n})\n}", "function feedDog(){\n dog. addImage (happyDog);\n foodobj. updateFoodStock(foodobj. getFoodStock()-1);\n database. ref('/').update({\n Food: foodobj.getFoodStock(),\n FeedTime: hour()\n })\n //function to add food in stock\n function addFoods() {\n foodS++;\n database. ref(' / ') . update({\n Food: foods\n\n\n });\n }\n}", "function readStock(data){\r\n foodS = data.val();\r\n foodobj.updateFoodStock(foodS);\r\n}", "function feedDog(){\n dog.addImage(dogImg1);\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour()\n })\n}", "function readStock(data){\r\n foodS=data.val();\r\n foodObj.updateFoodStock(foodS);\r\n }", "function readStock(data) {\r\n foods=data.val()\r\n foodObj.updateFoodStock(foods)\r\n}", "function feedDog(){\n dog.addImage(happyDogImg);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour()\n }); \n}", "function getStock() {\n connection.query(\n \"SELECT * FROM products WHERE product_name = ?\",\n [userProductChoice],\n function(error,results,fields) {\n if (error) throw error;\n userProductQuantity = parseInt(results[0].stock_quantity);\n totalQuantity = userProductQuantity + addStockAmount;\n\n updateDatabase();\n }\n ); // close SQL query\n\n function updateDatabase() {\n connection.query(\n \"UPDATE products SET stock_quantity = ? WHERE product_name = ?\",\n [totalQuantity , userProductChoice],\n function(error, results, fields) {\n if (error) throw error;\n console.log(userProductChoice + \" stock updated!\");\n }\n ); // close SQL query\n connection.end(); // ends SQL connection\n }; // close updateDatabase()\n }", "function feedDog() {\n dog.addImage(dogImage1);\n\n if(foodObj.getFoodStock()<= 0){\n foodObj.updateFoodStock(foodObj.getFoodStock()*0);\n }else{\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n }\n\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour()\n })\n }", "function readtime(data)\n{\n lastFedtime = data.val();\n foodObject.fedtime = lastFedtime;\n console.log(lastFedtime);\n}", "function feedDog(){\n dog.addImage(happyDog);\n \n foodObj.updatefoodS(foodObj.getfoodStock()-1);\n database.ref('/').update({\n Food: foodObj.getfoodStock(),\n FeedTime:hour()\n })\n}", "function readStock(data) {\n foodS = data.val();\n foodObj.updateFoodStock(foodS);\n }", "function feedDog(){\r\n dog.addImage(happyDog);\r\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\r\n database.ref('/').update({\r\n Food:foodObj.getFoodStock(),\r\n FeedTime:hour(),\r\n \r\n })\r\n}", "function feedDog(){\r\n dog.addImage(happyDog);\r\n\r\n if(foodObj.getFoodStock()<=0){\r\n foodObj.updateFoodStock(foodObj.getFoodStock()*0);\r\n }\r\n else{\r\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\r\n database.ref('/').update({\r\n Food:foodObj.getFoodStock(),\r\n FeedTime:hour()\r\n })\r\n }\r\n }", "function updatePrices() {\n}", "function updateStorage(newStock, id, quantity, price, sales){\n var totalCost = quantity * price;\n var newSales = sales + totalCost;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock,\n product_sales: newSales\n },\n {\n item_id: id\n }\n ],\n function(err, res){\n if(err) throw err;\n console.log(colors.magenta(\"The total cost of your order is\",\"$\"+ totalCost + \"\\n\"));\n restartPrompt();\n }\n )\n}", "updatefoodstock(stock){\r\n database.ref('/').update({\r\n 'foodmilk':stock\r\n });\r\n\r\n }", "function m_aux_Update(obj_stock, fechaInicio, fechaFin) {\n document.getElementById(\"inicio\").value = formatDate(fechaInicio);\n document.getElementById(\"fin\").value = formatDate(fechaFin);\n obj_stock.e_update_click();\n}", "function feedDog(){\n dog.addImage(happyDog_img);\n\n food.updateFoodStock(food.getFoodStock() - 1);\n database.ref('/').update({\n Food : food.getFoodStock(),\n FeedTime : hour()\n })\n}", "function updatePrices() {\n clickUpgrades['shovel'].price = clickUpgrades['shovel'].newprice;\n clickUpgrades['excavator'].price = clickUpgrades['excavator'].newprice;\n autoUpgrades['jackhammer'].price = autoUpgrades['jackhammer'].newprice;\n autoUpgrades['wheelbarrow'].price = autoUpgrades['wheelbarrow'].newprice;\n\n}", "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "function feedDog(){\n dog.addImage(happyDog);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food: foodObj.getFoodStock(),\n FeedTime: hour()\n })\n}", "function updateTime() {\r\n getWeatherInfo();\r\n var currentTimeStamp = new Date();\r\n var currentMonth = getMonth();\r\n var currentDay = getDate();\r\n var currentDate = currentTimeStamp.getDate();\r\n var currentHour = currentTimeStamp.getHours();\r\n var currentMin = currentTimeStamp.getMinutes();\r\n // Last updated time\r\n $(\"#update-time\").text(currentHour + ':' + currentMin);\r\n $(\".date-display\").text(currentDay + ', ' + currentMonth +' ' + currentDate );\r\n }", "function updateStock(promptid, quantity){\n\n var queryStr = 'SELECT * FROM products WHERE ?';\n \n connection.query(queryStr, {item_id: promptid}, function(err,res){\n if(err){console.log(err)};\n if(quantity >= 0 ){\n \n var updatedStock = (parseInt(res[0].stock_quantity) + quantity);\n var stockpromptid = parseInt(promptid);\n console.log(updatedStock, stockpromptid)\n confirmPrompt(updatedStock, stockpromptid)\n \n \n } else{\n console.log(\"Oh no, we are out of \" + res[0].product_name + \".\");\n };\n makeTable();\n });\n }", "function feedDog(){\n dog.changeImage(happyDog);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour(),\n gameState:\"Hungry\"\n })\n}", "function updateDB(answer, stock, price, sales){ \n var newQuantity = stock - parseInt(answer.getUnits);\n var getTotal = price * parseInt(answer.getUnits); \n var newSales = sales + getTotal;\n var query = `UPDATE products SET stock_quantity = ${newQuantity}, product_sales=${newSales} WHERE productID=${answer.getItem}`;\n connection.query(query, (err) => {\n if(err) throw err;\n console.log(`You're purchase is complete. Your total is $${getTotal}.`);\n nextPrompt();\n })\n}", "function UpdateClicked_Daily()\n{\n\tfncSaveChanges = \"\";\n\tshowWaitAlert(getSeaPhrase(\"UPDATING_DAILY_TE\",\"TE\"));\n\tUpdateTimeCard(\"Daily\");\n}", "updateTakeProfit() {\n if (this.type === PositionType.LONG && this.pair.currentPrice > this.takeProfitBasePrice) {\n this.takeProfitPrice = (this.pair.currentPrice *\n (1 + (this.takeProfitPerc / 100)));\n this.takeProfitBasePrice = this.pair.currentPrice;\n console.log(`Take profit updated to: ${this.takeProfitPrice.toFixed(3)}`);\n } else if (this.type === PositionType.SHORT && this.pair.currentPrice < this.takeProfitBasePrice) {\n this.takeProfitPrice = (this.pair.currentPrice *\n (1 - (this.takeProfitPerc / 100)));\n this.takeProfitBasePrice = this.pair.currentPrice;\n console.log(`Take profit updated to: ${this.takeProfitPrice.toFixed(3)}`);\n }\n }", "function feedDog(){\n dog.changeAnimation(\"dog2\", happyDog);\n\n foodObj.updateFoodStock(foodObj.getFoodStock()-1);\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour(),\n gameState:\"Hungry\"\n })\n}", "function feedDog()\n{\n dog.addImage(happyDog);\n\n foodObject.foodStock--;\n database.ref('/').update({\n Food : foodObject.foodStock,\n FeedTime : hour()\n })\n}", "function calculateInventory() {\n // var query = \"UPDATE products SET stock_quantity = quantity WHERE item_id = productId\";\n var query = \"UPDATE products SET stock_quantity = stock_quantity-\" + quantity + \" WHERE item_id = \" + productId;\n connection.query(query, function (err, res) {\n })\n setTimeout(viewInventory, 1500);\n setTimeout(purchaseQuestions, 2000);\n}", "function updateprice(){\n\n}", "function updateStock (qty, id) {\n connection.query('UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?', [qty, id], function(err, res){\n }); console.log(qty + id);\n}", "update(date, price) {\n // store for refresh\n this.date = date;\n this.price = price;\n\n const chart = this.container.get_parent().get_container(this.guid).chart;\n\n if (Object.keys(this.contracts).length == 0)\n return;\n\n const rate = parseFloat(\n document.\n getElementById(\"options_chart_rate\")\n .value\n );\n\n const start_time = Date.parse(chart.start_date);\n const until_date = Math.ceil((date.getTime() - start_time) / 86400000);\n\n for (var key in this.contracts) {\n const contract = this.contracts[key];\n\n // calculate dates until expiration\n const exp_date = new Date();\n exp_date.setDate(exp_date.getDate() + contract.dte);\n const diff = (exp_date.getTime() - date.getTime())\n const dte = Math.ceil(diff / 86400000);\n\n contract.sim_dte = dte;\n\n // calculate future values from the cursor's location\n contract.sim_value = theoretical(\n price,\n contract.strike,\n rate,\n contract.volatility,\n dte,\n contract.type\n );\n\n contract.itm = itm(\n price, contract.strike, contract.volatility,\n dte, contract.type\n ).toFixed(2);\n contract.otm = (1 - parseFloat(contract.itm)).toFixed(2);\n contract.below = below(\n chart.start_price, price,\n contract.volatility, until_date\n ).toFixed(2);\n contract.above = (1 - parseFloat(contract.below)).toFixed(2);\n\n contract.itm = isNaN(contract.itm) ? \"exp\" : contract.itm;\n contract.otm = isNaN(contract.otm) ? \"exp\" : contract.otm;\n contract.below = isNaN(contract.below) ? \"exp\" : contract.below;\n contract.above = isNaN(contract.above) ? \"exp\" : contract.above;\n }\n\n this.render(chart);\n }", "function buyShovel(){\nif (cash >= clickUpgrades.shovel.price){ \n cash = cash - clickUpgrades.shovel.price,\n clickUpgrades.shovel.quantity+=1,\n clickUpgrades.shovel.price+=1,\n cashPC = cashPC + clickUpgrades.shovel.multiplier\n} else {\n alert('not enough cash')\n}\nupdate()\n}", "function updateStock(items, options={}) {\n\n if (!options.action) {\n alert('No action supplied to stock update');\n return false;\n }\n\n var modal = options.modal || '#modal-form';\n\n if (items.length == 0) {\n alert('No items selected');\n return;\n }\n\n var html = '';\n\n html += \"<table class='table table-striped table-condensed' id='stocktake-table'>\\n\";\n\n html += '<thead><tr>';\n html += '<th>Item</th>';\n html += '<th>Location</th>';\n html += '<th>Quantity</th>';\n\n html += '</thead><tbody>';\n\n for (idx=0; idx<items.length; idx++) {\n var item = items[idx];\n\n var vMin = 0;\n var vMax = 0;\n var vCur = item.quantity;\n\n if (options.action == 'remove') {\n vCur = 0;\n vMax = item.quantity;\n }\n else if (options.action == 'add') {\n vCur = 0;\n vMax = 0;\n }\n\n html += '<tr>';\n\n html += '<td>' + item.part.name + '</td>';\n\n if (item.location) {\n html += '<td>' + item.location.name + '</td>';\n } else {\n html += '<td><i>No location set</i></td>';\n }\n html += \"<td><input class='form-control' \";\n html += \"value='\" + vCur + \"' \";\n html += \"min='\" + vMin + \"' \";\n\n if (vMax > 0) {\n html += \"max='\" + vMax + \"' \";\n }\n\n html += \"type='number' id='q-\" + item.pk + \"'/></td>\";\n\n html += '</tr>';\n }\n\n html += '</tbody></table>';\n\n html += \"<hr><input type='text' id='stocktake-notes' placeholder='Notes'/>\";\n\n html += \"<p class='warning-msg' id='note-warning'><i>Note field must be filled</i></p>\";\n\n var title = '';\n\n if (options.action == 'stocktake') {\n title = 'Stocktake';\n }\n else if (options.action == 'remove') {\n title = 'Remove stock items';\n }\n else if (options.action == 'add') {\n title = 'Add stock items';\n }\n\n openModal({\n modal: modal,\n title: title,\n content: html\n });\n\n $(modal).find('#note-warning').hide();\n\n modalSubmit(modal, function() {\n\n var stocktake = [];\n var notes = $(modal).find('#stocktake-notes').val();\n\n if (!notes) {\n $(modal).find('#note-warning').show();\n return false;\n }\n\n var valid = true;\n\n // Form stocktake data\n for (idx = 0; idx < items.length; idx++) {\n var item = items[idx];\n\n var q = $(modal).find(\"#q-\" + item.pk).val();\n\n stocktake.push({\n pk: item.pk,\n quantity: q\n });\n };\n\n if (!valid) {\n alert('Invalid data');\n return false;\n }\n\n inventreeUpdate(\"/api/stock/stocktake/\",\n {\n 'action': options.action,\n 'items[]': stocktake,\n 'notes': $(modal).find('#stocktake-notes').val()\n },\n {\n method: 'post',\n }).then(function(response) {\n closeModal(modal);\n afterForm(response, options);\n }).fail(function(xhr, status, error) {\n alert(error);\n });\n });\n}", "function updateStock(itm, newQty) {\n var sql = \"UPDATE product SET ? WHERE ?\";\n connection.query(sql, [{stock_quantity: newQty}, {item_id: itm}],function (err, res) {\n if (err) throw err;\n if (res.affectedRows != 1) {\n console.log(\"\\n\\n\");\n console.log(\"***** There may have been a error *****\");\n console.log(\"***** Report the following error to the administrator: pCO\" + res.affectedRows + \" *****\");\n }\n // connection.end();\n\n displayOrder(customerOrder);\n });\n}", "function feedDog(){\r\n dog.addImage(happyDog)\r\n //foodObj.deductFoodStock()\r\n if (foodObj.getfoodStock()<=0){\r\n foodObj.updateFoodStock(foodObj.getfoodStock()*0)\r\n }\r\n else{\r\n foodObj.updateFoodStock(foodObj.getfoodStock()-1)\r\n }\r\n database.ref('/').update({\r\n Food:foodObj.getfoodStock()\r\n })\r\n}", "function feedDog(){\n dog.addImage(happyDog);\n\n foodObj.updateFoodStock();\n database.ref('/').update({\n Food:foodObj.getFoodStock(),\n FeedTime:hour()\n })\n}", "function updateInv() {\n var updatedStock = parseInt(res[0].stock_quantity) - parseInt(quantity);\nconnection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",[updatedStock, item_id],function (err, updateRes) {\n if (err) throw err;\n });\n}", "function changeStockTicker (date) { \nstockTickerHTML = \"\"\n checkStockDelta(dowArray)\n checkStockDelta(SP500Array)\n checkStockDelta(NASDAQArray)\n checkStockDelta(oilArray)\n checkStockDelta(goldArray)\n // console.log(stockTickerHTML)\n ticker.innerHTML = `<div class=\"ticker__item__up\">${moment(date).format('dddd MMMM Do YYYY')}</div>` + stockTickerHTML\n}", "function updatePrice() {\n angular.forEach($scope.stockArr, function(item, index) {\n // console.log(\"updating price\");\n getPriceBySymbol(item.symbol).then(function() {\n item.high = $scope.oneStock.high;\n item.low = $scope.oneStock.low;\n item.open = $scope.oneStock.open;\n item.close = $scope.oneStock.close;\n item.price = $scope.oneStock.price;\n item.volume = $scope.oneStock.volume;\n });\n\n });\n }", "function calcTotalAutoUpgradePower() {\n let cheeseAutoHarvested =\n\n autoUpgrades['jackhammer'].quantity * autoUpgrades['jackhammer'].harvest\n\n +\n\n autoUpgrades['wheelbarrow'].quantity * autoUpgrades['wheelbarrow'].harvest;\n\n //console.log(`The amount of cheese auto harvested at the last 3 sec interval was ${cheeseAutoHarvested}`);\n\n player.currentCheeseBricks += cheeseAutoHarvested;\n players[0].currentCheeseBricks = player.currentCheeseBricks;\n //console.log(player.cheeseBricks);\n\n //console.log(`The total number of cheeseBricks in calcTotalAutoUpgradePower is ${player.cheeseBricks}`);\n\n document.getElementById('input-tc').value = player.currentCheeseBricks;\n\n turnButtonsOnOff();\n savePlayer();\n\n\n}", "function updateTime() {\n\n}", "function updateCurrentCost(){\n \n}", "pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "stockProduct (e) {\n // stock\n\n let orderUpdate, newOrderId, saveClientOrder\n newOrderId = JSON.parse(localStorage.getItem('newOrderId'))\n orderUpdate = JSON.parse(localStorage.getItem('orderUpdate'))\n if (orderUpdate !== null && saveClientOrder !== null) {\n orderUpdate.unshift({ status: \"En préparation\", orderId: newOrderId })\n\n saveClientOrder = this.state.appStateClients\n saveClientOrder.forEach(client => {\n if (client.id == this.state.currentUser) {\n client.order = [...client.order, orderUpdate]\n }\n })\n\n localStorage.setItem('AppStateClients', JSON.stringify(saveClientOrder))\n localStorage.setItem('newOrderId', JSON.stringify(newOrderId + 1))\n\n // nettoie\n ;[...this.shopRef.current.children].forEach(e => {\n e.children[0].children[0].children[2].children[1].value = \"\"\n console.log(e.children[0].children[0].children[2].children[1]);\n })\n\n // document.querySelectorAll('.jsx_InputQuantityArticleShop').forEach(e => e.value = \"\")\n\n localStorage.removeItem('orderUpdate')\n this.forceUpdate()\n\n }\n }", "function updateFutureForecast(){\n //update days\n var nDay2= getDayAfter(getTodaysDay());\n var nDay3 = getDayAfter(nDay2);\n var nDay4 = getDayAfter(nDay3);\n var nDay5 = getDayAfter(nDay4);\n day1Text.text = getTodaysDay();\n day2Text.text = nDay2;\n day3Text.text = nDay3;\n day4Text.text = nDay4;\n day5Text.text = nDay5;\n //update temps\n futureD1.text = getD1TempMaxF()+ \"° F\";\n futureD2.text = getD2TempMaxF()+ \"° F\";\n futureD3.text = getD3TempMaxF()+ \"° F\";\n futureD4.text = getD4TempMaxF()+ \"° F\";\n futureD5.text = getD5TempMaxF()+ \"° F\";\n //update icons\n day1Icon.source = getD1IconURL();\n day2Icon.source = getD2IconURL();\n day3Icon.source = getD3IconURL();\n day4Icon.source = getD4IconURL();\n day5Icon.source = getD5IconURL();\n}", "function onChangeTrade(){\n //fill in estimated hours (remaining hours to schedule);\n getEstimationFromTrade();\n //fill in date and time started according to service window\n getDateAndTimeStarted();\n}", "function updateQuantity() {\n\n // Query to update the item's quantity based on the item ID\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n var newQuantityOnHand = quantityOnHand - purchaseQuantity;\n \n connection.query(queryTerms,\n [\n {stock_quantity: newQuantityOnHand},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n }); \n\n // After that update is done, we need to update the total sales column\n updateTotalSales();\n} // End updateQuantity function", "function updateQuantity() {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: answer.userId\n }\n ],\n );\n }", "function feedDog(){\r\n\r\n dog.addImage(happyDog);\r\n dog.x =600;\r\n dog.y = 150;\r\n\r\n input = nameBox.value();\r\n\r\n greeting2.html(\"now \" + input + \" is not hugry!\");\r\n\r\n foodobj.updateFoodStock(foodobj.getFoodStock()-1);\r\n database.ref('/').update({\r\n Food : foodobj.getFoodStock(),\r\n FeedTime: hour()\r\n })\r\n\r\n}", "update(t) {\n if (this.vehicle.time == 0) {\n this.vehicle.deltaTime = 0;\n this.vehicle.time = t;\n }\n else {\n this.vehicle.deltaTime = t - this.vehicle.time;\n this.vehicle.time = t;\n }\n \n for(var i = 0; i < 5; i++){\n if(this.supplies[i].time == 0){\n this.supplies[i].deltaTime = 0;\n this.supplies.time = t;\n }\n else{\n this.supplies[i].deltaTime = t - this.supplies[i].time;\n this.supplies[i].time = t; \n }\n }\n\n this.checkKeys();\n this.vehicle.update(t);\n\n for(var i = 0; i < 5; i++){\n if(this.supplies[i].state == this.supplies[i].SupplyStates.FALLING)\n this.supplies[i].update(t);\n }\n\n this.billboard.update();\n \n }", "function timeUpdate(dbData) {\n //empty array which will have updated pet information pushed to\n let petArray = [];\n //for loop to update all the pets in the database\n for (let i in dbData) {\n //declare variables that calculates hours since lastFed/Slept/Played and saves it as a float\n let momDifFed = parseFloat(moment().diff(dbData[i].dataValues.lastFed, 'hours', true));\n let momDifSlept = parseFloat(moment().diff(dbData[i].dataValues.lastSlept, 'hours', true));\n let momDifPlayed = parseFloat(moment().diff(dbData[i].dataValues.lastPlayed, 'hours', true));\n // ==========================================================================================\n //if 10 hours have passed, subtract 5 from hungry\n if (momDifFed >= 10) {\n //subract 5 from hungry\n dbData[i].dataValues.hungry -= 5;\n }\n //if 8 hours have passed since lastFed,\n else if (momDifFed >= 8) {\n //subtract 4 from hungry\n dbData[i].dataValues.hungry -= 4;\n //update lastFed time to a time that is the (lastFed time) - (8 hours) from the current time\n //ex: if fed 9 hours ago and the current time is 3:00pm, the new lastFed \n //time will be 2:00pm (9-8=1 and 1 hour from current time (3:00pm) is 2:00pm)\n dbData[i].dataValues.lastFed = moment().subtract(momDifFed - 8, 'hours').format()\n }\n //if 6 hours have passed since lastFed,\n else if (momDifFed >= 6) {\n //subtract 3 from hungry\n dbData[i].dataValues.hungry -= 3;\n //update lastFed to a time that is (lastFed time) - (6 hours) from the current time\n dbData[i].dataValues.lastFed = moment().subtract(momDifFed - 6, 'hours').format()\n }\n //if 4 hours have passed since lastFed,\n else if (momDifFed >= 4) {\n //subtract 2 from hungry\n dbData[i].dataValues.hungry -= 2;\n //update lastFed to a time that is (lastFed time) - (4 hours) from the current time\n dbData[i].dataValues.lastFed = moment().subtract(momDifFed - 4, 'hours').format()\n }\n //if 2 hours have passed since lastFed,\n else if (momDifFed >= 2) {\n //subtract 1 from hungry\n dbData[i].dataValues.hungry -= 1;\n //update lastFed to a time that is (lastFed time) - (2 hours) from the current time\n dbData[i].dataValues.lastFed = moment().subtract(momDifFed - 2, 'hours').format()\n };\n //=======================================================================================\n //if 30 hours have passed since lastSlept\n if (momDifSlept >= 30) {\n //subtract 5 from sleepy\n dbData[i].dataValues.sleepy -= 5;\n }\n //if 24 hours have passed since lastSlept\n else if (momDifSlept >= 24) {\n //subtract 4 from sleepy\n dbData[i].dataValues.sleepy -= 4;\n //update lastSlept to a time that is (lastSlept time) - (24 hours) from the current time\n dbData[i].dataValues.lastSlept = moment().subtract(momDifSlept - 24, 'hours').format()\n }\n //if 18 hours have passed since lastSlept\n else if (momDifSlept >= 18) {\n //subtract 3 from sleepy\n dbData[i].dataValues.sleepy -= 3;\n //update lastSlept to a time that is (lastSlept time) - (18 hours) from the current time\n dbData[i].dataValues.lastSlept = moment().subtract(momDifSlept - 18, 'hours').format()\n }\n //if 12 hours have passed since lastSlept\n else if (momDifSlept >= 12) {\n //subtract 2 from sleepy\n dbData[i].dataValues.sleepy -= 2;\n //update lastSlept to a time that is (lastSlept time) - (12 hours) from the current time\n dbData[i].dataValues.lastSlept = moment().subtract(momDifSlept - 12, 'hours').format()\n }\n //if 6 hours have passed since lastSlept\n else if (momDifSlept >= 6) {\n //subtract 1 from sleepy\n dbData[i].dataValues.sleepy -= 1;\n //update lastSlept to a time that is (lastSlept time) - (6 hours) from the current time\n dbData[i].dataValues.lastSlept = moment().subtract(momDifSlept - 6, 'hours').format()\n };\n // =================================================================================\n //if 15 hours have passed since lastPlayed\n if (momDifPlayed >= 15) {\n //subtract 5 from happy\n dbData[i].dataValues.happy -= 5;\n }\n //if 12 hours have passed since lastPlayed\n else if (momDifPlayed >= 12) {\n //subtract 4 from happy\n dbData[i].dataValues.happy -= 4;\n //update lastPlayed to a time that is (lastPlayed time) - (12 hours) from the current time\n dbData[i].dataValues.lastPlayed = moment().subtract(momDifPlayed - 12, 'hours').format()\n }\n //if 9 hours have passed since lastPlayed\n else if (momDifPlayed >= 9) {\n //subtract 3 from happy\n dbData[i].happy -= 3;\n //update lastPlayed to a time that is (lastPlayed time) - (9 hours) from the current time\n dbData[i].lastPlayed = moment().subtract(momDifPlayed - 9, 'hours').format()\n }\n //if 6 hours have passed since lastPlayed\n else if (momDifPlayed >= 6) {\n //subtract 2 from happy\n dbData[i].dataValues.happy -= 2;\n //update lastPlayed to a time that is (lastPlayed time) - (6 hours) from the current time\n dbData[i].dataValues.lastPlayed = moment().subtract(momDifPlayed - 6, 'hours').format()\n }\n //if 3 hours have passed since lastPlayed\n else if (momDifPlayed >= 3) {\n //subtract 1 from happy\n dbData[i].dataValues.happy -= 1;\n //update lastPlayed to a time that is (lastPlayed time) - (3 hours) from the current time\n dbData[i].dataValues.lastPlayed = moment().subtract(momDifPlayed - 3, 'hours').format()\n };\n // =================================================================================\n //set statuses to zero if below zero\n // =================================================================================\n if (dbData[i].dataValues.hungry < 0) {\n dbData[i].dataValues.hungry = 0;\n }\n if (dbData[i].dataValues.sleepy < 0) {\n dbData[i].dataValues.sleepy = 0;\n }\n if (dbData[i].dataValues.happy < 0) {\n dbData[i].dataValues.happy = 0;\n }\n // =================================================================================\n //Update hp and alive status\n // =================================================================================\n //hp and alive = 0 if all statuses are 0\n if (dbData[i].dataValues.hungry === 0 && dbData[i].dataValues.sleepy === 0 && dbData[i].dataValues.happy === 0) {\n dbData[i].dataValues.hp = 0;\n dbData[i].dataValues.alive = 0\n }\n //if 2 of the statuses are 0, set hp to 1\n else if (dbData[i].dataValues.hungry === 0 && dbData[i].dataValues.sleepy === 0 || dbData[i].dataValues.sleepy === 0 && dbData[i].dataValues.happy === 0 || dbData[i].dataValues.hungry === 0 && dbData[i].dataValues.happy === 0) {\n dbData[i].dataValues.hp = 1\n }\n //if 1 status is 0, set hp to 2\n else if (dbData[i].dataValues.hungry === 0 || dbData[i].dataValues.sleepy === 0 || dbData[i].dataValues.happy === 0) {\n dbData[i].dataValues.hp = 2\n }\n //if no statuses are 0, hp is full (3).\n else {\n dbData[i].dataValues.hp = 3;\n }\n //push all of the altered data into an array which will be used to update the database\n petArray.push(dbData[i].dataValues)\n \n }\n // console.log(\"Ran timeUpdate\")\n //return the newly updated data\n return petArray\n }", "function databaseUpdate(){\n\tvar kwh = 0;\n\tvar query = client.query('SELECT timing, lightson FROM time', [], function(err,result){\n\t\tif (err) throw err;\n\t\tvar date = new Date(Number(result.rows[0].timing));\n\t\tvar parseDate = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate();\n\t\tvar i = 1;\n\t\tfor (i = 1; i < result.rows.length; i++){\n\t\t\tvar timediff = Math.abs(Number(result.rows[i].timing) - Number(result.rows[i - 1].timing));\n\t\t\tbulbs = result.rows[i - 1].lightson;\n\t\t\tkwh += (WATTAGE * bulbs * (timediff / (1000 * 60 * 60)) / 1000);\n\t\t}\n\t\t//var last = new Date(Number(result.rows[i - 1].timing));\n\t\t//client.query('DELETE FROM time WHERE timing < $1;', [last]);\n\t\tclient.query('DELETE FROM time');\n\t\tclient.query('INSERT INTO dailystats (kw, day) VALUES ($1, $2);', [kwh, new Date()]);\n\t});\n}", "function update(){\n newInventory = currentQuantity + updateQuantity;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newInventory\n },\n {\n item_id: itemNum\n }\n ],\n function(err, res) {\n\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"doAgain\",\n message: \"Your inventory has been successfully updated. Would you like to do something else?\",\n \n }\n ]).then(function(response){\n if (response.doAgain){\n promptManager();\n } else {\n connection.end();\n };\n \n });\n });\n }", "function updateItemQTY(itemID, newQTY){\n\tvar query = 'UPDATE products SET stock_qty = '+ newQTY + ' WHERE item_id =' + itemID;\n\tconnection.query(query);\n}", "function updatedItem(id) {\n console.log(\"\");\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE ID = ?;\",[id],function(err, res) {\n if (err) throw err;\n console.log('Your item has been updated. Please see below:');\n console.table(res);\n console.log(\"\");\n managerAsk();\n \n });\n}", "function refreshStock() {\n vm.dtInstance.reloadData(function() {\n }, true);\n }", "function updateProduct() {\n console.log(\"Updating stock quantity...\\n\");\n connection.query(\n \"UPDATE Bamazon_db SET ? WHERE ?\",\n [\n {\n StockQuantity: StockQuantity - qchoice\n },\n ],\n function(err, res) {\n console.log(StockQuantity + \" products updated!\\n\");\n }\n );\n\n // logs the actual query being run\n console.log(query.sql);\n}", "function incrementSeconds() {\n Consts.stockTime += 1;\n}", "update_current_intake(food_item){\n let keys = Object.keys(food_item); // the keys of the nutrient values (e.g. calcium, fat, protein)\n for(let i = 0; i < keys.length; ++i){\n this.current_intake[keys[i]] += food_item[keys[i]];\n }\n }", "function buyUpdate(id, quantity) {\n var isDupicate = false;\n\n //checks to see if the item is already in the cart\n for (var i in cart) {\n\n if (cart[i].id == id) {\n //if the item is already in the cart, it adds the quantity of the purchase to the quantity already in the cart\n cart[i].quantity += parseInt(quantity);\n isDupicate = true;\n\n //removes the quantity from the amount in stock\n for (var j in stock) {\n if (cart[i].id == stock[j].ItemID) {\n stock[j].StockQuantity -= quantity;\n }\n }\n }\n }\n\n //if not already in the cart\n if (!isDupicate) {\n\n //find the id in the stock array\n for (var k in stock) {\n if (stock[k].ItemID == id) {\n //push the item to the cart\n cart.push({\n id: id,\n name: stock[k].ProductName,\n quantity: parseInt(quantity),\n price: stock[k].Price\n });\n //subtract the user quantity wanted from the quantity in stock\n stock[k].StockQuantity -= quantity;\n }\n }\n }\n\n //display the updated stock\n displayStock();\n //display the shopping cart\n shoppingCart();\n //prompt the user to continue shopping or checkout\n promptOptions();\n}", "function updatingData1() {\n let mintWaferPrice = store2['inventory prices']['Mint Wafers'];\n mintWaferPrice = 2.09;\n return false;\n //No, the price in the data for store2 doesn't change because we created a new variable \"mintWaferPrice\" and initially set it equal to the price of Mint Wafers. When we assign a new value to that variable, it doesn't effect the original price of Mint Wafers stored in the data for store2.\n}", "function updateInventory() {\n // console.log(\"Time to update the inventory!\")\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remainingQuantity\n },\n {\n item_id: chosenID\n }\n ],\n function(err, res) {\n if (err) throw err;\n }\n );\n ask();\n // logs the actual query being run\n // console.log(query.sql);\n}", "function updater(){\r\n\tplantUpdate();\r\n\tdocument.getElementById('cellcount').innerHTML = formatValue(player.cells,2,0);\r\n\twindow.clearInterval();\r\n\tif (player.forestsUnlocked){\r\n\t\tupdateForests();\r\n\t\tdocument.getElementById('forestSize').innerHTML = \"Forest Size: \" + formatValue(player.forestSize,3,2) + \" acres\";\r\n\t\tdocument.getElementById('adjustCRate').innerHTML = \"Total Production: \" + formatValue(getCProduction(),2,2);\r\n\t\tdocument.getElementById('forestRate').innerHTML = \"Forest Growth Rate: \" + formatValue (getForestGrowth(),3,3);\r\n\t\t\r\n\t}\r\n}", "static updateStockBarang(stock) {\n this.#stockBarang = stock;\n }", "function updateQuantity() {\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE id = ?\",\n [\n quantityToBuy,\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n updateProductSale();\n })\n}", "function update() {\n\n var fluc = $rootScope.model.fluctuating;\n var rec = $rootScope.model.recurring;\n var inc = $rootScope.model.income;\n\n $rootScope.model.expTotal = 0;\n $rootScope.model.flucTotal = 0;\n $rootScope.model.recTotal = 0;\n $rootScope.model.inTotal = 0;\n\n if ((fluc !== undefined || rec !== undefined) && $rootScope.model.income != undefined) {\n\n fluc.forEach(function(entry) {\n if (entry)\n $rootScope.model.expTotal += entry.value;\n $rootScope.model.flucTotal += entry.value;\n });\n\n rec.forEach(function(entry) {\n if (entry)\n $rootScope.model.expTotal += entry.value;\n $rootScope.model.recTotal += entry.value;\n\n });\n\n inc.forEach(function(entry) {\n if (entry)\n $rootScope.model.inTotal += entry.value;\n\n });\n\n\n $rootScope.model.amountLeft = $rootScope.model.inTotal - $rootScope.model.expTotal;\n $rootScope.model.perDay = $rootScope.model.amountLeft / $rootScope.daysLeft;\n\t\t filterM();\n }\n }", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "function writeStock(x){\n\n if(x<=0){\n x = 0;\n }\n else{\n x--; \n }\n foodObj.foodStock = x;\n\n database.ref('/').update({\n Food:x\n })\n}", "function feedDog(){\n\n dog.addImage(happyDogImg);\n\n if(foodS<=0){\n foodS=0;\n }else{\n foodS = foodS-1;\n }\n \n database.ref('/').update({\n FeedTime:hour(),\n Food:foodS\n })\n}", "handleEditQuantityButton(item, updown) {\n let userLoginToken = localStorage.getItem(\"loginToken\");\n // JSON to send to server with the associated expiration date and +1/-1 quantity\n let updatedQuantity = {\n quantities: {\n [item.expiration]: updown\n }\n };\n workspaceID = localStorage.getItem(\"currWorkspaceID\");\n let itemID = item.id;\n axios\n .put(\n `/api/workspaces/${workspaceID}/inventory/${itemID}`,\n updatedQuantity,\n { headers: { Authorization: `${userLoginToken}` } }\n )\n .then(res => {\n // HTTP status 200 OK\n if (res.status === 200) {\n console.log(\"updated quantity\");\n }\n this.fetchData();\n })\n .catch(error => {\n console.log(error);\n toast(`There was error updating the quantity. ${error}`, {\n type: \"error\"\n });\n });\n }", "function updateInventory(answer) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity + answer.stockAdded\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n console.log(\"Stock added.\");\n anotherAction();\n }\n );\n}", "function changeStock(connection,newStock,selectedItem) {\n connection.query(\"UPDATE products SET stock_quantity=? WHERE product_name=?\",[newStock,selectedItem], function (err,res) {\n if (err) throw err;\n shop();\n });\n}", "function writeStock(x){ \n if(x<=0){ x=0; \n }else{ x=x-1; \n } \n database.ref('/').update({ \n Food:x }) \n }" ]
[ "0.80084306", "0.6829535", "0.66199505", "0.6589105", "0.6532042", "0.6441472", "0.64410555", "0.64312696", "0.64105386", "0.6395103", "0.6395103", "0.6395103", "0.6395103", "0.6392337", "0.63772297", "0.63665843", "0.63665843", "0.63665843", "0.6350927", "0.63301396", "0.63280815", "0.63166606", "0.631263", "0.6311894", "0.6304078", "0.629919", "0.6296804", "0.6283227", "0.6259327", "0.6254212", "0.6237902", "0.62112826", "0.6196033", "0.61759126", "0.6128676", "0.61279976", "0.61067146", "0.6102444", "0.6096155", "0.6093224", "0.6092055", "0.6076485", "0.6064938", "0.6062982", "0.6059135", "0.6051649", "0.60410017", "0.6034275", "0.6014842", "0.600021", "0.599455", "0.59917486", "0.59715295", "0.59558105", "0.5947778", "0.5935917", "0.5917357", "0.58889085", "0.5885837", "0.5873959", "0.58691233", "0.5861226", "0.5845401", "0.5844208", "0.583202", "0.58287", "0.58197224", "0.58040977", "0.5790386", "0.57881683", "0.5784832", "0.57827973", "0.5771601", "0.5771405", "0.5765316", "0.5762625", "0.57601863", "0.5758056", "0.57526785", "0.5752247", "0.57468677", "0.573839", "0.5724901", "0.5715719", "0.57153195", "0.5714168", "0.57093096", "0.57068795", "0.5705391", "0.57042885", "0.5697627", "0.56905466", "0.5686257", "0.56845415", "0.5683774", "0.56832653", "0.5670896", "0.5666003", "0.5665847", "0.5665334" ]
0.6163284
34
Load the current journal entries once the app has mounted
componentDidMount() { $.ajax({ type: "get", url: "/json/journal", dataType: "json", success: (responseData) => { // TESTING - DEV console.log(responseData); // Sort the items by timestamp, newest first let items = responseData.payload; items.sort((a, b) => Math.sign(b.timestamp - a.timestamp)); this.setState({ items: items }) } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static loadJournal() {\n fetch(`${baseURL}/entries`)\n .then(resp => resp.json())\n .then(entries => {\n entries.forEach(entry => {\n let newEntry = new Entry(entry, entry.word, entry.user) \n Entry.all.push(newEntry)\n newEntry.display()\n })\n })\n }", "function loadEntries() {\n return (_(localStorageService.get('entries') || [])\n .map(function(log) {\n log.date = moment(log.date);\n return log;\n })\n );\n }", "function loadEntries() {\n\t\tconsole.log('Loading entries...');\n\t\t$('#entries').html('Loading entries...');\n\t\trepository.get().done(function(result) {\n\t\t\tif (!result.entries) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst context = {\n\t\t\t\tentries: result.entries\n\t\t\t}\n\t\t$('#entries').html(entriesTemplate(context));\n\t\t}).error(function(error) {\n\t\t\t$('#entries').html('No entries');\n\t\t\tconsole.log(error);\n\t\t});\n\t}", "function loadEntries() {\n console.log('Loading entries...');\n $('#entries').html('Loading entries...');\n guestbook.get().done(function(result) {\n if (!result.entries) {\n return;\n }\n const context = {\n entries: result.entries\n }\n $('#entries').html(entriesTemplate(context));\n }).error(function(error) {\n $('#entries').html('No entries');\n console.log(error);\n });\n }", "componentDidMount() {\n /** Gets and stores Entries from LocalStorage. */\n let LocalStorageEntries = localStorage.getItem('entries');\n LocalStorageEntries = JSON.parse(LocalStorageEntries);\n /** If there are entries in LocalStorage */\n if(LocalStorageEntries && LocalStorageEntries.entries.length !== 0) {\n /** Displays the entries from LocalStorage onto the Display Section. */\n this.props.initEntries(LocalStorageEntries.entries);\n };\n }", "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "componentDidMount() {\n const entriesType = this.getEntriesType();\n\n if(!this.getEntries(entriesType) && !this.isLoadPerformed() && !this.isLoadStarted()) {\n const actionParams = this.getActionParams();\n\n this.props.entriesActions.load(entriesType, actionParams);\n }\n }", "function init(){\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n if(!notes) notes =[];\n notes.forEach(element => {\n addNote(element);\n });\n}", "function listEntries() {\n console.log('entries in localStorage: ', localStorage);\n console.log('entries in getEntries(): ', getEntries());\n }", "function getAllLogEntries(worker) {\n var logEntries = datastore.readLogEntries();\n worker.port.emit(\"LogEntriesLoaded\", logEntries);\n}", "componentDidMount() {\n\n this.loadEntries();\n\n }", "load() {\n try {\n appState.state.cursor().update( cursor => {\n return cursor.merge( JSON.parse( window.localStorage.getItem( APPCONFIG.LS ) ) )\n })\n } catch( err ) {\n console.error( 'Error loading from local storage' )\n console.error( err )\n return\n }\n\n console.log( 'loaded' )\n }", "load() {\n if (app.cache.notifications && !app.session.user.newNotificationsCount()) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n app.store.find('notifications').then(notifications => {\n app.session.user.pushAttributes({newNotificationsCount: 0});\n app.cache.notifications = notifications.sort((a, b) => b.time() - a.time());\n\n this.loading = false;\n m.redraw();\n });\n }", "function displayAllKeys() {\n let request = window.indexedDB.open(\"journalDataBase\", 1),\n db,\n tx,\n store,\n index\n\n request.onupgradeneeded = function (e) {\n let db = request.result,\n store = db.createObjectStore(\"journalStore\", { keyPath: \"date\" })\n }\n\n request.onerror = function (e) {\n console.log(\"Error: \" + e.target.errorCode)\n }\n\n request.onsuccess = function (e) {\n db = request.result\n tx = db.transaction(\"journalStore\", \"readwrite\")\n store = tx.objectStore(\"journalStore\")\n let all = store.getAll()\n all.onsuccess = function () {\n updateNavList(all)\n }\n tx.oncomplete = function () {\n db.close()\n }\n }\n}", "function getNotes() {\n chrome.storage.local.get(['notes-keeper'], function(result) {\n loadNotes(result); //calling loadNotes(result) to display the data on screen\n });\n}", "function loadLocalData(){\n if($scope.loading){\n return;\n }\n $scope.loading = true;\n storeService.getAllEntries(soup.name, sortBy, 'ascending').then(function(result){\n $scope.entries = result.currentPageOrderedEntries;\n console.log('entries', $scope.entries);\n $scope.loading = false;\n }, function(err){\n $scope.loading = false;\n });\n }", "function loadNotes() {\n noteId = 0;\n idx = 1;\n notes = [];\n document.getElementById('data').innerHTML = '';\n\n chrome.storage.sync.get('todos_notes', function(result) {\n notes = result.todos_notes;\n if (!notes) {\n notes = [''];\n }\n createNotes(notes, idx, 0);\n });\n }", "function init() {\n todos = JSON.parse(localStorage.getItem(\"high\"));\n\n addtodos();\n }", "initTodos() {\n console.log('init todos, key: ', this.storage.checkKey())\n if (this.storage.checkKey()) {\n this.loadTodos();\n } else {\n this.updateTodos(defaultTodos);\n }\n }", "get entries() {\n if (!loadedEntries) {\n readEntries();\n }\n return entryList;\n }", "function init(){\n if (localStorage.getItem(\"note_local\")) {\n notesArray = JSON.parse(localStorage.getItem(\"note_local\"));\n for(var i=0;i<notesArray.length;i++)\n addnoteToDOM(notesArray[i].taskDetails, notesArray[i].taskDate, notesArray[i].taskHours);\n } \n}", "function init(){\n var savedEvents = JSON.parse(localStorage.getItem(\"savedEventsArray\"));\n if(savedEvents !== null){\n eventsArray = savedEvents; \n }\n renderEvents(); \n }", "function loadAllEntries(callback) {\n var returnArray = [];\n \n loadFromIndex(entryStoreName, 'Date', function(result) {\n returnArray.push(result.value);\n }, function() {\n callback(returnArray);\n });\n }", "function init(){\n\n // set up localstorage\n if(!localStorage.getItem(\"journal\"))\n localStorage.setItem(\"journal\", JSON.stringify([]));\n\n // set up template if doesn't exist\n if(!localStorage.getItem(\"template\"))\n localStorage.setItem(\"template\", \"What happened yesterday?\\n+ \\n\\nToday I want to \\n\\nI am grateful for \");\n \n // enable search if more than 2 entries\n if(JSON.parse(localStorage.getItem(\"journal\")).length > 2){\n document.getElementById(\"search-button\").style.display = \"block\";\n }\n\n // hopefully not a direct link to anything other than the menu, but load the page they ask for anyway\n loadScreen(window.location.hash);\n}", "componentDidMount() {\n this.getEntries();\n }", "function init(){\n var storedReminders = JSON.parse(localStorage.getItem(\"reminders\"));\n\n if(storedReminders !== null){\n reminders = storedReminders;\n }\n\n}", "function fetchLocal() {\r\n if (storageName in localStorage) {\r\n var retrievedEvents = localStorage.getItem(storageName);\r\n eventArray = JSON.parse(retrievedEvents);\r\n drawLog();\r\n }\r\n}", "function storedData() {\n localStorage.setItem(\"journalEntry\", newEvent);\n const storedInput = localStorage.getItem(\"journalEntry\");\n\n // if(storageInput) {\n\n // }\n}", "loadData(){\n\t\tlet thisStore = this;\n\t\tClient.fetchBugs(bugs => {\n\t\t\tthis.bugs = bugs;\n\t\t\t//timeout required upon app loading, but no lag due to listening for data load completing\n\t\t\t//data will be loaded into the state of app.jsx\n\t\t\tsetTimeout(function(){thisStore.emit('DATA_LOADED')}, 250);\n\t\t});\n\t}", "static displayEntries() {\n let posts = Store.getEntries();\n\n posts.forEach((entry) => UI.addEntryToList(entry));\n\n }", "initialize() {\n this.localEntries = new Map();\n this.onlineEntries = new Map();\n\n if (!fs.existsSync(this.localDirectory)) {\n shelljs.mkdir('-p', this.localDirectory);\n }\n this.loadDirectory(this.localDirectory, this.localEntries);\n\n // online database disabled for now\n //this.onlineDirectory = BASE_FOLDER_ONLINE_DB + '/' + this.subFolder;\n //this.loadDirectory(this.onlineDirectory, this.onlineEntries);\n }", "componentDidMount() {\n this._checkNewNoteParam();\n this._fetchFiles();\n this._fetchBooks();\n ipcRenderer.send('onNoEditNotesList');\n singleEvent.on('addNoteFromTray', this._addNoteFromTray);\n }", "initialize () {\n if (this.index) {\n console.log('atom-notes: loading...')\n this.loaded = true\n this.index = elasticlunr.Index.load(this.index)\n } else {\n console.log('atom-notes: indexing...')\n this.loaded = false\n this.index = elasticlunr(function () {\n this.addField('title')\n this.addField('body')\n this.addField('keywords')\n this.addField('abstract')\n })\n }\n\n this.watcher = setupFileWatcher.bind(this)(this.directoryPath)\n this.emit('ready')\n }", "function loadPersistedMessages() {\n getPersistedMessages((response) => {\n // console.log(response);\n \n if(response.receivedMessages) {\n receivedMessages = JSON.parse(response.receivedMessages);\n }\n if(response.removedMessages) {\n removedMessages = JSON.parse(response.removedMessages);\n\n }\n // purge receivedMessages if the time conditions are met\n purgeReceivedMessages(response.lastPurgeTime);\n });\n}", "function onCreate() {\n //check if there is anything in local storage and load it\n if (localStorage.length > 0) {\n let jsonEntries = JSON.parse(localStorage['entries-local']);\n\n //transfer local storage to entries array\n for (let i in jsonEntries)\n entries.push(new Entry(jsonEntries[i].pace, (jsonEntries[i].date), false));\n\n createList();\n }\n //creates chart with defautl range \n drawDefaultChart();\n}", "function displayLocalEntries() {\n var entries = getEntries();\n\n if(0 !== entries.length) {\n addEntryToDOM(getEntries());\n }\n }", "componentDidMount() {\n this.mounted = true;\n if (this.props.notes && this.props.notes.length === 0 && this.mounted)\n this.getNotes({ start: 0, loadAmount: 20 });\n }", "function onNoteLoad() {\n\t\n\tvar db = window.openDatabase(\"notes\", \"1.0\", \"Notes Demo\", 2000000);\n\t//db.transaction(checkDb, errorCB, successCB);\n\ttry {\n\t\tdb.transaction(loadNote);\n\t}\n\tcatch(e) {}\n}", "function init() {\n var storeInitials = JSON.parse(localStorage.getItem('initialsList'));\n if (storeInitials !== null) {\n initialsList = storeInitials;\n }\n}", "get entries() {\n\t\t\tif (!loadedEntries) {\n\t\t\t\treadEntries();\n\t\t\t}\n\t\t\treturn entryList;\n\t\t}", "initializeJournal(journalID){\n const date = this._stringify(this.date);\n this.journalID = journalID;\n this.diaryService.createEntry(journalID,this.date,this.promptIndex,'');\n }", "function init() {\n var storedEvents = JSON.parse(localStorage.getItem(\"schedule\"));\n if (storedEvents) {\n schedule = storedEvents;\n }\n printToCalendar();\n}", "leerDB() {\n //Verificar si existe el archivo, si no existe, el array de historial queda como se declaro (vacio).\n if (fs.existsSync(this.dbPath)) {\n const info = fs.readFileSync(this.dbPath, { encoding: 'utf-8' });\n const data = JSON.parse(info);\n this.historial = data;\n }\n }", "componentDidMount() {\n // create a Firebase reference and store it in dbRef variable\n const dbRef = firebase.database().ref(); \n \n dbRef.on('value',(response) => {\n\n const freshState = [];\n const data = response.val();\n\n\n for(const key in data) {\n \n\n //data in object with a key \n freshState.push({\n key: key,\n journalEntry: data[key]\n });\n }\n\n //update journals with setState\n this.setState({\n journals: freshState\n });\n });\n }", "componentDidMount() {\n this.loadSavedArticles();\n }", "function initLogs(){\n\tif(!localforage){\n\t\talert('failed to load localforage!');\n\t\treturn;\n\t}\n\n\treturn localforage.getItem('maxLogNumber')\n\t.then((result)=>{\n\t\tif(result)\n\t\t\tmaxLogNumber = result;\n\t})\n\t.then(()=>localforage.getItem('logs'))\n\t.then((logs)=>{\n\t\tpopulateLogs(logs,false);\n\t})\n\t.catch((err)=>{\n\t\tconsole.error(err);\n\t\tconsole.error(\"!!ERROR INSTANTATING LOGS\");\n\t});\n}", "componentDidMount() {\n Realm.open({schema: [Schema.Note]})\n .then(realm => {\n // Fetch notes from local Realm database\n let notes = realm.objects('Note');\n currentNotes = handleNotes(notes);\n this.setState({ realm: realm, notes: currentNotes });\n });\n }", "function loadStorage() {\r\n\tif (localStorage.getItem(\"notes\")) { // load only if notes has something in it...\r\n\t\tvar notes_str = localStorage.getItem(\"notes\");\r\n\t\tnotesObj = JSON.parse(notes_str);\r\n\t\tfor (var j=0; j < notesObj.notes.length; j++) {\r\n\t\t\tdisplayNote(notesObj.notes[j]); // call function to display each existing note\r\n\t\t}\r\n\t\tconsole.log(\"*** notes data has been loaded successfully from local storage! ***\");\r\n\t} else {\r\n\t\tconsole.log(\"*** local storage is currently empty! ***\");\r\n\t}\r\n}", "function loadNotes(worker, taskId) {\n if (taskId) {\n var notes = datastore.readTaskNotes(taskId);\n worker.port.emit(\"NotesLoaded\", notes);\n }\n}", "function speichJournal(){\n $scope.storage.journal = $scope.journal\n }", "function init() {\n var storedDay = JSON.parse(localStorage.getItem(\"myDay\"));\n\n if (storedDay) {\n myDay = storedDay;\n }\n\n saveReminders();\n displayReminders();\n}", "componentWillMount () {\n // load all of the user's data\n this.getUserEntries();\n }", "function startApp() {\n loadFromLocalStorage(); // Try to load list from Local Storage\n\n if (toDoList.length > 0) {\n loadTasks();\n }\n}", "function onLoad() { \n\tvar db = window.openDatabase(\"notes\", \"1.0\", \"Notes Demo\", 2000000);\n\t//db.transaction(checkDb, errorCB, successCB);\n\tdb.transaction(loadNotesList);\n}", "async loadAllNotes() {\n try {\n const { rows } = await this.db.allDocs({ include_docs: true });\n const notes = rows.map(({ doc }) => doc);\n\n this.setState({ notes });\n } catch (error) {\n console.error(error);\n }\n }", "function initStories() {\n initDatabase();\n retrieveAllStories();\n}", "function readAppData()\n {\n nsmethods.readDataIntoApplication();\n }", "function appendLocalStorage() {\n if (!JSON.parse(localStorage.getItem(\"myLibrary\"))) return;\n const localData = JSON.parse(localStorage.getItem(\"myLibrary\"));\n for (const data of localData) {\n myLibrary.push(new Book(data.title, data.author, data.pages, data.read));\n appendToHTML();\n updateDataBook();\n }\n}", "function loadData() {\n var storedDay = JSON.parse(localStorage.getItem(\"myDay\"));\n\n if (storedDay) {\n myDay = storedDay;\n }\n\n saveToDos();\n displayToDos();\n}", "function loadCalendars(){\n db = getDB(dbName);\n dbGetDoc(db, \"Config\", defaultConfig).then(function(response){\n config = typeof response._rev === \"undefined\" ? response : response.docContent;\n config.sidebarOpened ? sidebar.classList.add(\"opened\") : sidebar.classList.remove(\"opened\");\n config.flipped ? inner.className = \"flipped\" : inner.className = \"\";\n\n if(config.lastCalendarOpened != null){\n openCalendar(config.lastCalendarOpened);\n loadCalendarsIntoSidebar().then(function(){\n buildImageGaleryContent();\n });\n }else{ // Inital Load.\n addNewCalendar();\n }\n })\n }", "initDrafts() {\n this.drafts = {};\n\n // restore data from localStorage\n const contents = window.localStorage.drafts;\n if (contents != null) {\n try {\n this.drafts = JSON.parse(contents);\n }\n catch (e) {\n window.localStorage.removeItem('drafts');\n }\n }\n\n if (this.state.pageId == null) {\n const draft = this.findDraft(this.state.path);\n if (draft != null) {\n this.state.markdown = draft;\n }\n }\n }", "function fireBaseLoadDataToMap() {\n console.log(\"reading data\");\n\n var markersRef = database.ref('markers');\n\n // adding event listener on add\n markersRef.on('child_added', markersOnAdded);\n\n // adding event listener on change\n markersRef.on('child_changed', markersOnChange);\n\n // adding event listener on remove\n markersRef.on('child_removed', markersOnRemove);\n\n // querying db for markers\n markersRef.once('value', afterReadList);\n }", "function onAllLoaded() {\n console.log('all loaded');\n}", "function load () {\n actions = svl.storage.get(\"tracker\");\n }", "function loadFromLocalStorage() {\n let notes;\n // check LS\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n\n //loop though notes and create items\n for (let i = 0; i < notes.length; i++) {\n // set title and subtext to arr\n let note = [];\n let myTitle = notes[i].title;\n let mySubtext = notes[i].subtext;\n let myDate = notes[i].date;\n note.push(myTitle);\n note.push(mySubtext);\n note.push(myDate);\n \n // create note\n createNote(note);\n }\n }\n}", "function loadNotesData() {\n // loads through each file in manifest\n for (let data_id in manifest_notes) {\n let file_name = manifest_notes[data_id]; // 5-135935359979.json (the second # is just for getting rid of duplicates)\n if (fs.existsSync(\"./data/notes/\" + file_name)) {\n let data_point = JSON.parse(fs.readFileSync(\"./data/notes/\" + file_name));\n let dp_match = data_point[\"match\"];\n // finds what teams are in the data\n for (let team_index in schedule[dp_match]) {\n let team_name = schedule[dp_match][team_index];\n // if this is first data point recorded for this team\n if (notes_data[team_name] === undefined) { notes_data[team_name] = []; }\n notes_data[team_name].push([data_point[team_index.toString()], dp_match]);\n }\n }\n }\n}", "function storeLogItems() {\r\n\tlocalStorage.logContents = locationUpdateLog.innerHTML;\r\n}", "function init() {\n fs.readFile(\"./db/notes.json\", \"utf8\", function (err, data) {\n if (err) {\n throw err;\n }\n let notesJSON = JSON.parse(data);\n notesJSON.forEach(function (note) {\n notes.push(note);\n });\n lastId = Math.max(...notes.map((obj) => obj.id), 0) + 1;\n });\n}", "componentWillMount() {\n // load all the settings\n stored = settingsHandle.stored\n // update the local data\n this.setState({tableData: stored.dldata.data.filter(this.filterDownloader)})\n }", "function initLoad() {\n\n\tvar cityHistStore = JSON.parse(localStorage.getItem('city'));\n\n\tif (cityHistStore !== null) {\n\t\tcityHist = cityHistStore\n\t}\n\tgetHistory();\n\tgetWeatherToday();\n}", "function getNotes() {\n fs.readFile(\"db/db.json\", \"utf8\", function (err, data) {\n if (err) {\n return error(err)\n }else{ savedNotes.push(...JSON.parse(data));}\n });\n}", "function loadannouncements() {\n\n}", "function onStart() {\n checkInput();\n onLoadTodos();\n}", "fetch() {\n this.collection = JSON.parse(localStorage.getItem(this.localStorage_key)) || [];\n this.bus.trigger('collectionUpdated');\n }", "function loadData() {\n // set all our variables\n setVars(twitch.configuration)\n // do an initial browse to `/`(root)\n navigate()\n // remove our loading element from the DM\n removeElement(\"repo-loading\")\n}", "function getEntries() {\n\n //\talert(\"getEntries\");\n dbShell.transaction(function (tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS autos (id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL, Poliza TEXT NOT NULL, Inciso TEXT NOT NULL, Asegurado TEXT NOT NULL)\");\n tx.executeSql(\"SELECT * FROM autos\", [], renderEntries, dbErrorHandler);\n }, dbErrorHandler);\n}", "async load () {\n const startables = await this.db.startables.toArray()\n this.store.setStartables(startables)\n\n const rows = await this.db.favourites.get('favourites')\n\n if (rows) {\n this.store.setFavourites(rows.favourites)\n }\n }", "function init() {\n var storedtodos= JSON.parse(localStorage.getItem(\"Scores\"));\n\n if (storedtodos!== null) {\n todos= storedHighs;\n }\n\n renderHighs();\n}", "function initStorage() {\n $localStorage.authors = $localStorage.authors || [];\n $localStorage.books = $localStorage.books || [];\n $localStorage.authorId = $localStorage.authorId || $localStorage.authors.length + 1;\n $localStorage.booksId = $localStorage.booksId || $localStorage.books.length + 1;\n }", "function init() {\n if (localStorage.AddressBookRecord) {\n addresBookArray = JSON.parse(localStorage.AddressBookRecord);\n }\n}", "function saveEntry(){\n var entry = {\n \"date\" : currentEntryDate.toDateString(),\n \"text\" : document.getElementById(\"entry\").value\n };\n\n var journal = JSON.parse(localStorage.getItem(\"journal\"));\n \n if(entry.text == localStorage.getItem(\"template\") || entry.text == \"\"){\n // don't save and actually delete stored entry if it exists\n journal = journal.filter(function(e) { return e.date != entry.date; })\n } else if (journal.filter(function(e) { return e.date === entry.date; }).length < 1){\n journal.push(entry);\n } else {\n journal.filter(function(e) { return e.date === entry.date; })[0].text = entry.text;\n }\n localStorage.setItem(\"journal\", JSON.stringify(journal));\n}", "function readAll() {\n clearList();\n \n var objectStore = db.transaction(\"tasks\").objectStore(\"tasks\");\n \n //creates a cursor which iterates through each record\n objectStore.openCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if (cursor) {\n console.log(\"Task: \" + cursor.value.description);\n addEntry(cursor.value.description);\n cursor.continue();\n }\n };\n}", "function printAuditLog() {\n console.log(\"Audit Log:\");\n for (var i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) === 'auditLog') {\n console.log(localStorage.getItem(localStorage.key(i)));\n }\n }\n }", "async componentDidMount() {\n // let scenes actively listen to new received notif\n this.listener = Notifications.addListener(this.listen);\n // load all the required user data if user is logged-in\n if (this.props.auth.isAuthenticated) {\n // retrieve and setup data\n this.setupUserAppData();\n }\n }", "componentDidMount() {\n console.log(\"page mounted!\")\n this.savedArticleLoad();\n }", "function getItemsFromLocalStorage() {\r\n notesCount = localStorage.getItem(\"count\");\r\n notesFromLocalStorage = JSON.parse(localStorage.getItem(\"notes\"));\r\n }", "function bringNotes() {\n if (localStorage.getItem(\"notes\") != null) {\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n } else {\n notes = [];\n }\n console.log(notes.length);\n if (localStorage.getItem(\"notesLength\") != null)\n c = parseInt(localStorage.getItem(\"notesLength\"));\n console.log(c);\n console.log(notes);\n}", "function getEntries() {\n let entries;\n if (localStorage.getItem('entries') === null) {\n entries = [];\n } else {\n entries = JSON.parse(localStorage.getItem('entries'));\n }\n entries.forEach(function (entry) {\n if (entry.InputAmnt > 0) {\n let repopulate = createElements(entry.inputTxt, entry.InputAmnt);\n repopulate.className += 'plus';\n updateBalance(entry.InputAmnt);\n updateIncome(entry.InputAmnt);\n } else {\n let repopulate = createElements(entry.inputTxt, entry.InputAmnt);\n repopulate.className += 'minus';\n updateBalance(entry.InputAmnt);\n updateExpense(entry.InputAmnt);\n }\n });\n}", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "function syncEntries (el){\n Entry.sync(el.state.timestamp)\n .then(response => syncEntriesSuccess(el, response))\n .catch(err => syncEntriesFailure(el, err));\n syncClientEntries(el);\n}", "function fillInitialEntries() {\n console.log(\"notesService: Create some dummy entries...\");\n\n //\n // fill with default /test data:\n //\n var notes = [];\n\n var note = new Note(\"CAS FEE Selbststudium / Projekt-Aufgabe erledigen\", new Date(2016, 10, 20),\n \"HTML für die Notes Application erstellen.<br>CSS erstellen für die Notes Application<br>TODO<br>TODO\", 1,\n new Date(2016, 7, 17));\n note.finishedDate = new Date(2016, 8, 23);\n publicSaveNote(note);\n\n note = new Note(\"Einkaufen\", new Date(2016, 9, 12), \"Butter<br>Eier<br>Brot<br>...\", 2, new Date(2016, 8, 22));\n publicSaveNote(note);\n\n note = new Note(\"Mami anrufen\", null, \"888 888 88 88<br>Termin vereinbaren<br>Weihnachtsgeschenke<br>Ferienabwesenheit besprechen\", 3, new Date(2016, 8, 19));\n publicSaveNote(note);\n}", "function load_localstorage_events() {\n \tconsole.log(\"Loading local storage elements ..\");\n \tfor(var event in sessionStorage) {\n \t\tsendMsgToServer(JSON.parse(sessionStorage[event]));\n \t}\n \t\n \tconsole.log(\"Emptying local storage events ..\");\n \tsessionStorage.clear();\n \tlocal_events_ctr = 0;\n }", "function activateJournalMode(){ //%journal\n localStorage.emotionDestination = \"journal\";\n practiceDestination = \"initialPracticeDestination\";\n logDestination = \"initialLogDestination\";\n}", "static load_all() {\n server.log(\"Loading rooms...\", 2);\n\n server.modules.fs.readdirSync(server.settings.data_dir + '/rooms/').forEach(function(file) {\n if (file !== 'room_connections.json') {\n var data = server.modules.fs.readFileSync(server.settings.data_dir +\n '/rooms/' + file, 'utf8');\n\n data = JSON.parse(data);\n server.log(\"Loading room \" + data.name, 2);\n Room.load(data);\n }\n });\n\n server.log(\"Loading Room Connections\", 2);\n try {\n var connections = JSON.parse(server.modules.fs.readFileSync(server.settings.data_dir +\n '/rooms/room_connections.json'));\n\n for (var room_id in connections) {\n var room = Room.get_room_by_id(room_id);\n for (let adj_id of connections[room_id]) {\n var adj = Room.get_room_by_id(adj_id);\n room.connect_room(adj, false);\n }\n }\n }\n catch(err) {\n server.log(err, 1);\n }\n\n server.log(\"Rooms loaded.\", 2);\n }", "function init() {\n\n // Get stored initials from localStorage\n var storedsavedInitials = JSON.parse(localStorage.getItem(\"savedInitials\"));\n \n // If tinitials were retrieved from localStorage, update the initials array\n if (storedsavedInitials !== null) {\n savedInitials = storedsavedInitials;\n }\n\n // Helper function that will render tinitials to the DOM\n renderSavedInitials();\n}", "function startDatabaseQueries() {\n var myUserId = firebase.auth().currentUser.uid;\n var statusRef = firebase.database().ref('/kettle/status');\n var curWaterRef = firebase.database().ref('/kettle/cur_water');\n var reservationCountRef = firebase.database().ref('/reservations/');\n // Fetching and displaying all posts of each sections.\n updateValueByRef(statusRef, statusContainer);\n updateValueByRef(curWaterRef, currWaterContainer);\n refreshData(reservationCountRef, addReservationEntry);\n // Keep track of all Firebase refs we are listening to.\n listeningFirebaseRefs.push(statusRef);\n listeningFirebaseRefs.push(curWaterRef);\n listeningFirebaseRefs.push(reservationCountRef);\n}", "function loadReminders(cb) {\n fs.readFile(reminderFile(), 'utf8', (err, data) => {\n if(err) {\n if(err.code == 'ENOENT') {\n clearReminders()\n cb()\n } else cb(err)\n }\n else {\n clearReminders()\n let d = archieml.load(data)\n for(let i = 0;i < d.reminders.length;i++) {\n addReminder(d.reminders[i])\n }\n cb()\n }\n })\n}", "function databaseInitialize() {\n zip_content_db = loki_db.getCollection(\"zipInfo\");\n if (zip_content_db === null) {\n zip_content_db = loki_db.addCollection(\"zipInfo\", { indices: ['filePath'] });\n }\n var entryCount = zip_content_db.count();\n console.log(\"[zipInfoDb] number of entries in database : \" + entryCount);\n}", "function loadDataFromMemory() {\n try {\n todos = JSON.parse(localStorage.getItem(LOCALSTORAGE_KEY)) || [];\n } catch (e) {\n console.error(e);\n todos = []\n }\n if (todos && todos.length > 0) {\n todos.forEach(todo => render(todo.title, todo.body, todo.imgTag))\n }\n}", "_getLocalStorage() {\n // JSON.parse will take a string and parse it back to an object\n const data = JSON.parse(localStorage.getItem(\"workouts\"));\n\n if (!data) return; // guard clause\n\n // Add the data back into the workouts array\n this.#workouts = data;\n\n // Render the workouts back into the side bar\n this.#workouts.forEach(work => {\n this._renderWorkout(work);\n });\n }", "function localStorageOnLoad() {\n\tlet moviesList = getMoviesFromStorage();\n\n\tif (moviesList.length === 0) {\n\t\tmovies.forEach(function(movie) {\n\t\t\taddMovieLocalStorage(movie);\n\t\t});\n\t}\n\n\tmoviesList = getMoviesFromStorage();\n\n\tdisplayMovies(moviesList);\n}" ]
[ "0.7150386", "0.6580812", "0.62729865", "0.6182427", "0.6159832", "0.6039786", "0.596504", "0.5865863", "0.5851588", "0.58296674", "0.5806959", "0.5750966", "0.56596315", "0.56416476", "0.5625136", "0.56160456", "0.5608297", "0.55814886", "0.5580971", "0.55640674", "0.5548839", "0.5539391", "0.55360675", "0.552987", "0.55185676", "0.55173206", "0.5470246", "0.546677", "0.54600364", "0.5446115", "0.5441828", "0.5426803", "0.5416016", "0.5415968", "0.5406653", "0.53928536", "0.53802216", "0.53638697", "0.53604037", "0.53458446", "0.53439206", "0.5337981", "0.5311729", "0.5306939", "0.53033525", "0.52871", "0.5275272", "0.5266891", "0.5236139", "0.5234598", "0.5233595", "0.5230159", "0.52228194", "0.52219385", "0.5205416", "0.51904345", "0.5178489", "0.51770645", "0.5168497", "0.51675576", "0.5166893", "0.51634246", "0.5145976", "0.5144985", "0.51225966", "0.5114941", "0.51131296", "0.5112502", "0.5110824", "0.51076686", "0.5101094", "0.50996166", "0.5093212", "0.508138", "0.5064035", "0.50624967", "0.5062367", "0.5062233", "0.5052607", "0.5049301", "0.5048971", "0.50424254", "0.5040936", "0.5029969", "0.5025455", "0.5025026", "0.5011537", "0.5008454", "0.5006943", "0.4997855", "0.49967247", "0.49859446", "0.49853697", "0.49845192", "0.49833262", "0.49747285", "0.49712065", "0.4971195", "0.4969457", "0.4969329", "0.49647683" ]
0.0
-1
Set the publicity of a journal entry
setPublicity(id, publicity) { const data = { id: id, public: publicity }; submitDataAsync(data, "journal/publicity", false, (responseData) => { console.log(responseData); if (responseData.success === true) { this.setState(prevState => ({ items: prevState.items.map((item) => { if (item._id.$oid === id) { item.public = publicity; } return item; }) })); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function publish(book){\n// return book.set(\"isPublished\",true);\nreturn produce(book,draftBook=>{ // immer library\n draftBook.isPublished=true;\n})\n}", "_updatePublisher(uPCs) {\t\t\n\t\tvar key = this._loaderAndLoads(uPCs);\t\t\t \n\t\tif(key !== null && uPCs[key].situation === \"CONTRIBUTING\"){\n\t\t\tthis.$.content.readonly = false;\n\t\t\tthis.$.content.focus();\n\t\t\tthis.$.save.style.display = \"inline\";\n\t\t\tthis.$.check.disabled = true;\n\t\t} else {\n\t\t\tthis.$.content.readonly = true;\n\t\t\tthis.$.save.style.display = \"none\";\n\t\t\tthis.$.check.disabled = false;\n\t\t}\n\t}", "function RSASetPublic(N,E) {\n this.isPublic = true;\n if (typeof N !== \"string\") \n {\n this.n = N;\n this.e = E;\n }\n else if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n alert(\"Invalid RSA public key\");\n}", "function RSASetPublic(N,E) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n alert(\"Invalid RSA public key\");\n}", "function RSASetPublic(N, E) {\n\tif (N != null && E != null && N.length > 0 && E.length > 0) {\n\t\tthis.n = parseBigInt(N, 16);\n\t\tthis.e = parseInt(E, 16);\n\t} else\n\t\talert(\"Invalid RSA public key\");\n}", "function RSASetPublic(N,E) {\n if (typeof N !== \"string\")\n {\n this.n = N;\n this.e = E;\n }\n else if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n alert(\"Invalid RSA public key\");\n}", "async function onPublish() {\n setPublishing(true);\n try {\n const response = await api.request({ method: 'PUT', url: `${PUBLICATION_PATH}/publish/${id}`, data: {} });\n mutate(`${PUBLICATION_PATH}/${id}`);\n setPublishing(false);\n setPublishSuccess(true);\n setTimeout(() => setPublishSuccess(false), 2000);\n } catch (err) {\n setPublishing(false);\n setPublishError(true);\n setTimeout(() => setPublishError(false), 2000);\n }\n }", "function setPublicKey(key) {\n encrypt.setPublicKey(key);\n}", "function RSASetPublic(N, E) {\n if (N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N, 16);\n this.e = parseInt(E, 16);\n } else console.error(\"Invalid RSA public key\");\n }", "function RSASetPublic(N,E) {\n\t if(N != null && E != null && N.length > 0 && E.length > 0) {\n\t this.n = parseBigInt(N,16);\n\t this.e = parseInt(E,16);\n\t }\n\t else\n\t console.error(\"Invalid RSA public key\");\n\t}", "function RSASetPublic(N,E) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n }\n else\n throw new Error(\"Invalid RSA public key\");\n}", "function publish_article(articleid)\n{\n change_article_state(articleid, \"publish\", \"pubbtn-a\" + articleid);\n}", "function switchProductPublicity() {\n var url = [refstackApiUrl, '/products/', ctrl.id].join('');\n $http.put(url, {public: !ctrl.product.public}).success(\n function (data) {\n ctrl.product = data;\n ctrl.productProperties = angular.fromJson(data.properties);\n }).error(function (error) {\n raiseAlert('danger', 'Error: ', error.detail);\n });\n }", "function internal_setPublicAccess(resource, acpData, access) {\n return internal_setActorAccess(resource, acpData, acp.agent, acp.PublicAgent, access);\n}", "function RSASetPublic(N, E) {\n if (N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N, 16);\n this.e = parseInt(E, 16);\n } else\n throw new Error(\"Invalid RSA public key\");\n }", "setPublishOn(page) {\n this.view.scope.controller.definePublisher(page);\n }", "initializeJournal(journalID){\n const date = this._stringify(this.date);\n this.journalID = journalID;\n this.diaryService.createEntry(journalID,this.date,this.promptIndex,'');\n }", "function trackPublished(publication, container) {\n\tif (publication.isSubscribed) {\n\t\tattachTrack(publication.track, container);\n\t}\n\tpublication.on('subscribed', function (track) {\n\t\tconsole.log('Subscribed to ' + publication.kind + ' track');\n\t\tattachTrack(track, container);\n\t});\n\tpublication.on('unsubscribed', detachTrack);\n}", "function setValue(name, value) {\n if (value) {\n var expirationDate = new Date();\n expirationDate.setMonth(expirationDate.getMonth() + 12);\n document.cookie = name + '=' + encodeURIComponent(value) + '; domain=.ultipro.com; expires=' + expirationDate;\n }\n else {\n document.cookie = name + '=' + value + '; domain=.ultipro.com; expires=Thu, 01 Jan 1970 00:00:00 UTC';\n }\n}", "function internal_setPublicAccess$1(resource, acpData, access) {\n return internal_setActorAccess$1(resource, acpData, acp.agent, acp.PublicAgent, access);\n}", "setAuthorityMetadata(key, metadata) {\n this.setItem(key, metadata);\n }", "function trackPublished(publication, participant) {\n // If the TrackPublication is already subscribed to, then attach the Track to the DOM.\n if (publication.track) {\n attachTrack(publication.track, participant);\n }\n\n // Once the TrackPublication is subscribed to, attach the Track to the DOM.\n publication.on('subscribed', track => {\n attachTrack(track, participant);\n });\n\n // Once the TrackPublication is unsubscribed from, detach the Track from the DOM.\n publication.on('unsubscribed', track => {\n detachTrack(track, participant);\n });\n}", "function speichJournal(){\n $scope.storage.journal = $scope.journal\n }", "function onPublisherPresReq() {\n if (!uuid) return;\n socket.emit(\"publisher-pres-req-sub\", uuid);\n socket.on(\"publisher-pres-req-done\", () => {\n socket.emit(\"publisher-pres-req-unsub\", uuid);\n setPublisherPresentationRequest(false);\n mutate(`${PUBLICATION_PATH}/${id}`);\n });\n setPublisherPresentationRequest(true);\n }", "function setByDate(date) {\n let request = window.indexedDB.open(\"journalDataBase\", 1),\n db,\n tx,\n store,\n index\n\n request.onupgradeneeded = function (e) {\n let db = request.result,\n store = db.createObjectStore(\"journalStore\", { keyPath: \"date\" })\n }\n\n request.onerror = function (e) {\n console.log(\"Error: \" + e.target.errorCode)\n }\n\n request.onsuccess = function (e) {\n db = request.result\n tx = db.transaction(\"journalStore\", \"readwrite\")\n store = tx.objectStore(\"journalStore\")\n let entry = store.get(date)\n entry.onsuccess = function () {\n let result = entry.result\n if (result == null) {\n console.log('No info in date :' + date)\n document.querySelector(\".pg\").contentWindow.reset()\n document.querySelector(\".pg\").contentWindow.loadingState(false)\n } else {\n let dict = result.dict\n document.querySelector(\".pg\").contentWindow.loadJSON(dict)\n }\n }\n tx.oncomplete = function () {\n db.close()\n }\n }\n}", "function setShareOfTicketsReissued (input) {\n share_of_tickets_reissued = input;\n }", "function trackPublished(publication, container) {\n if (publication.isSubscribed) {\n attachTrack(publication.track, container);\n }\n publication.on(\"subscribed\", function(track) {\n log(\"Subscribed to \" + publication.kind + \" track\");\n attachTrack(track, container);\n });\n publication.on(\"unsubscribed\", detachTrack);\n}", "function assignAuthor() {\n\tvar snippet = {\n\t\tquery: {id: \"-K_WonIe_j7iSm-WeyC8\", authorId: \"-K_W_cxqkjGVo8zEfLUc\"}\n\t}\n\trimer.post.assignAuthor(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "create (modulus, exponent = '10001') {\n const publicExponent = exponent || this.publicExponent\n this.RSA.setPublic(modulus, publicExponent)\n }", "function updatePublishModal(e) {\n $('#publish-action', '#publish-modal').prop('disabled', true).addClass('disabled');\n publish.isPublishing = true;\n }", "function setBookingPaidAt (modifier, post, charge) {\n modifier.$set.paidAt = new Date();\n modifier.$set.status = 3; // mark as paid\n return modifier;\n}", "function trackUnpublished(publication) {\n\tlog(publication.kind + ' track was unpublished.');\n}", "async function setAnnounceProperty(discordChannel, twitchName, key, value) {\n \n let obj = getObjectForDB(discordChannel, twitchName);\n let change = {};\n change[key] = value;\n await db.discord_announcers.update(obj, change);\n\n}", "function publish() {\n p.publish({\n channel : channel, \n message : {\n avatar: avatar.className, \n text: input.value\n }, \n callback : function() {\n input.value = '';\n }\n });\n }", "function canSetPub(obj, name) {\n name = String(name);\n if (canSet(obj, name)) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (name === 'valueOf') { return false; }\n if (name === 'toString') { return false; }\n return !isFrozen(obj) && isJSONContainer(obj);\n }", "function changeAuthor(position, newValue) {\nauthors[position] = newValue;\ndisplayAuthor(); // Automatically display changes\n}", "function trackUnpublished(publication) {\n log(publication.kind + \" track was unpublished.\");\n}", "function saveCitation(citation) {\n\n let xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n window.location = '/';\n } else {\n window.alert(`Erreur : ${xhr.statusText}.`);\n }\n }\n };\n\n xhr.open('PUT', API_URL + \"/\" + citation.id);\n xhr.setRequestHeader('Content-type', 'application/json');\n xhr.send(JSON.stringify(citation));\n }", "function setPub(obj, name, val) {\n // asFirstClass() here would be a useful safety check, to prevent\n // the further propogation of, for example, a leaked toxic\n // function. However, its security benefit is questionable, and\n // the check is expensive in this position.\n// val = asFirstClass(val);\n if (typeof name === 'number' &&\n name >= 0 &&\n // See issue 875\n obj instanceof Array &&\n obj.FROZEN___ !== obj) {\n return obj[name] = val;\n }\n name = String(name);\n if (obj === null || obj === void 0) {\n throw new TypeError(\"Can't set \" + name + ' on ' + obj);\n }\n if (obj[name + '_canSet___'] === obj) {\n return obj[name] = val;\n } else if (canSetPub(obj, name)) {\n fastpathSet(obj, name);\n return obj[name] = val;\n } else {\n return obj.handleSet___(name, val);\n }\n }", "function commitEntry(key, entry) {\n\t\tself.indexes.primaryKey.set(key, entry)\n\n\t\tself.opts.entryIndexes.forEach(function(property) {\n\t\t\tif(!entry[property]) return;\n\t\t\tif(!self.indexes[property].has(entry[property])) {\n\t\t\t\tself.indexes[property].set(entry[property], new Map())\n\t\t\t}\n\t\t\tself.indexes[property].get(entry[property]).set(key, entry)\n\t\t})\n\t}", "function setLinkAttr(arg) {\n let title = popLink[arg].innerHTML;\n let text = popText[arg].innerHTML;\n let desc = title + \"\\r\\n\" + text;\n let mediaLink = document.location.href + \"/\" + pics[arg].getAttribute(\"src\");\n let url = popLink[arg].getAttribute(\"href\");\n\n function setProp(attr, value) {\n if (!pinterestBtn[arg].hasAttribute(attr)){\n pinterestBtn[arg].setAttribute(attr, value);\n }\n }\n\n pinterestBtn[arg].setAttribute(\"href\", \"https://www.pinterest.com/pin/create/button/\");\n\n setProp(\"data-pin-custom\", \"true\");\n setProp(\"data-pin-do\", \"buttonPin\");\n setProp(\"data-pin-description\", desc);\n setProp(\"data-pin-media\", mediaLink);\n setProp(\"data-pin-url\", url);\n }", "function markJournalSubmission() {\n let button = document.getElementById(\"entry-submit\");\n\n // Mark submission and redirect to journal page\n button.addEventListener(\"click\", function(event) {\n event.preventDefault();\n sessionStorage.setItem(\"submitted\", \"1\");\n window.location.href = \"journal-2.html\";\n });\n}", "function addAmenityToProperty (propertyID, amenityID) {\n var property = propertyById(propertyID);\n var amenity = getAmenityById(amenityID);\n \n property.amenities[amenity.amenityID] = {rank: 1, marketing: 0};\n \n}", "function PublicKey(pubKey /* GroupElement */){\n this.pubKey = pubKey; // pubKeyObj\n}", "function Publicacion(empresa, contacto, estado, ciudad, short, large){\n\tthis.id = id;\n\tthis.empresa = empresa;\n\tthis.contacto = contacto;\n\tthis.estado = estado;\n\tthis.ciudad = ciudad;\n\tthis.descripcionShort = short;\n\tthis.descripcionLarge = large;\n\tid++;\n}", "function saveAsDraftRelease()\n{\ndocument.forms[0].isDrafted.value=\"yes\";\n\nsubmitForm();\n}", "set identifier(identifier) {\n this._createResearchStudyIfNeeded();\n let i = new Identifier();\n i.value = identifier;\n this._researchSubject.researchStudy.identifier = i;\n }", "function action() {\n if (moduleItem.published !== found.setting) {\n var oldSetting = moduleItem.published;\n moduleItem.published = found.setting;\n moduleItem.techops.log('Module Item - Publish Settings', {\n 'Title': moduleItem.title,\n 'ID': moduleItem.id,\n 'Before': oldSetting,\n 'After': moduleItem.published,\n 'Type': moduleItem.type,\n });\n }\n callback(null, course, moduleItem);\n }", "updatePrivacy(setPublicProfile){\n return axios.post(API_URL + 'public/view/', \n { \n setPublicProfile: setPublicProfile,\n },\n { headers: authHeader()}\n );\n \n }", "changeApproval(thingId, modifier) {\n const request = new XMLHttpRequest();\n var newApproval = this.node.approval + modifier;\n this.node.approval = newApproval;\n request.open('POST', `/thing/${thingId}/approve/`, true);\n request.send();\n this.emit('change');\n }", "constructor(name, pin, journal){\n this.name = name;\n this.pin = pin;\n this.journal = journal;\n }", "function updateAuthor() {\n\tvar snippet = {\n\t\tquery: {\"id\": \"-K_W_cxqkjGVo8zEfLUc\"},\n\t\tbody: {\n \tthumbnail: 'abcd',\n\t\t\t// twitter: \"twiiter.com/test\"\n\t\t}\n\t}\n\n\trimer.author.update(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "publishWithEOL(privKey, value, lifetime, callback) {\n if (!privKey || !privKey.bytes) {\n const errMsg = `one or more of the provided parameters are not defined`;\n log.error(errMsg);\n return callback(errcode(new Error(errMsg), 'ERR_UNDEFINED_PARAMETER'));\n }\n\n PeerId.createFromPrivKey(privKey.bytes, (err, peerId) => {\n if (err) {\n return callback(err);\n }\n\n this._updateOrCreateRecord(privKey, value, lifetime, peerId, (err, record) => {\n if (err) {\n return callback(err);\n }\n\n this._putRecordToRouting(record, peerId, callback);\n });\n });\n }", "'todos.setPrivate'(id, setToPrivate){\n const todo = Todos.findOne(id);\n\n if(todo.owner !== this.userId){\n throw new Meteor.Error('Unauthorized');\n } \n\n Todos.update(id, {$set:{private: setToPrivate}});\n\n// 'todos.setPrivate'(id, setToPrivate);\n// const todo = Todos.findOne(id);\n\n// if (todo.owner !==this.userId){\n// throw new Meteor.Error('unauthourised');\n// }\n\n// Todos.update(id, {$set:{private:setToPrivate}});\n\n}", "constructor(pri,pub){\n this.privatekey=pri;\n this.publickey=pub;\n}", "async updateCodemark () {\n\t\t// if this was a public permalink, and the codemark doesn't yet have a public permalink,\n\t\t// indicate that it now has one\n\t\tif (this.isPublic && this.codemark && !this.codemark.hasPublicPermalink) {\n\t\t\tawait this.request.data.codemarks.updateDirectWhenPersist(\n\t\t\t\t{ id: this.request.data.codemarks.objectIdSafe(this.codemark.id) },\n\t\t\t\t{ $set: { hasPublicPermalink: true } }\n\t\t\t);\n\t\t}\n\t}", "function unassignAuthor() {\n\tvar snippet = {\n\t\tquery: {id: \"-K_WQGtSVWGvojZurWDJ\", published: false}\n\t}\n\trimer.post.unassignAuthor(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function hasThisPagePublicity() { return getPublicityDiv(); }", "async function updatecourse(id){\r\n const course= await Course.findById(id);\r\n \r\n if(!course) return;\r\n\r\n course.isPublished=true;\r\n course.author='meghana';\r\n\r\n const result= await course.save();\r\n console.log(result)\r\n\r\n //OR\r\n // course.set({\r\n // isPublished:true,\r\n // author:'meghana'\r\n // });\r\n\r\n}", "function setInputAuthor(text) {\n document.querySelector('input[name=\"author\"]').value = text;\n}", "function changeToAuthor(url,domain) {\n\n url = (stg.indexOf('https://'+domain) > -1? stageAuthorURL: authorURL ) + '/editor.html' + languagePath + smartUrl(url) + '.html';\n redirect(url);\n}", "setSignature(signer, signature) {\n this.signature = { signer, signature };\n }", "function _publishChange(){\n var updateTime = (+new Date()).toString();\n\n if(_backend == \"localStorage\" || _backend == \"globalStorage\"){\n try {\n _storage_service.jStorage_update = updateTime;\n } catch (E8) {\n // safari private mode has been enabled after the jStorage initialization\n _backend = false;\n }\n }else if(_backend == \"userDataBehavior\"){\n _storage_elm.setAttribute(\"jStorage_update\", updateTime);\n _storage_elm.save(\"jStorage\");\n }\n\n _storageObserver();\n }", "setPubsChildren(pubsChildren) {\n if (Meteor.isServer) {\n this.pubsChildren = pubsChildren;\n } else {\n throw new Meteor.Error('collectionFast.setPubsChildren',\n 'You must set publications children on server.');\n }\n }", "function makePublic() {\r\n\t\t\r\n\t\tGM_xmlhttpRequest({\r\n\t\t\tmethod: \"GET\",\r\n\t\t\turl: 'http://www.google.com/reader/api/0/token',\r\n\t\t\tonload: function(results) {\r\n\t\t\t\r\n\t\t\t\tvar o={\"s\":\"user/-/label/\"+prompt(\"Enter tag name to make public\",document.getElementById(\"chrome-title\").innerHTML),\"pub\":\"true\",\"T\":results.responseText},p=[];\r\n\t\t\t\tfor(var k in o)\r\n\t\t\t\t\tp.push(k+\"=\"+ encodeURIComponent(o[k]));\r\n\t\t\t\tvar param=p.join(\"&\");\r\n\t\t\t\t\r\n\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\tmethod: \"POST\",\r\n\t\t\t\t\turl: 'http://www.google.com/reader/api/0/tag/edit',\r\n\t\t\t\t\theaders: {\r\n \t\t\t\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\", \r\n \t\t\t\t\t},\r\n \t\t\t\t\tdata: param,\r\n\t\t\t\t\tonload: function(results) {\r\n\t\t\t\t\t\talert(results.responseText);\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\r\n\t\t\t},\r\n\t\t});\r\n\t\t\r\n\t}", "function setPrecinctDistrict(precinctID, district) {\n precinctDistricts[precinctID] = district;\n}", "function setStorage() {\n\tconsole.log('Setting Storage...');\n\tvar chapterPromise = getLatestPost();\n\n\tchapterPromise.then(function(data) {\n\t\tvar chapterNum = getNumFromString(data.title);\n\n\t\tchrome.storage.sync.set({\n\t\t\t'tomoLatestChapter': chapterNum\n\t\t}, function() {\n\t\t\tconsole.log('Latest chapter set to:', chapterNum);\n\t\t});\n\t});\n}", "set signature(signature) {\n if (signature)\n this._signature = signature;\n }", "setFundLocked(store, { fundId }, value) {}", "function changeToAsPublished(url,domain) {\n\n if (url.indexOf(\"/en/\") > -1) {\n url = (stg.indexOf('https://'+domain) > -1? stageAuthorURL : authorURL ) + languagemastersPath + smartUrl(url) + '.html';\n } else {\n url = (stg.indexOf('https://'+domain) > -1? stageAuthorURL : authorURL ) + languagePath + smartUrl(url) + '.html';\n\n }\n\n redirect(url);\n}", "publish(privKey, value, callback) {\n this.publishWithEOL(privKey, value, defaultRecordTtl, callback);\n }", "function setAccountingPeriodFromProcessDate() {\n if (nlapiGetFieldValue('custpage_2663_process_date') && nlapiGetFieldValue('custpage_2663_postingperiod')) {\n var accountingPeriod = getAccountingPeriod(nlapiGetFieldValue('custpage_2663_process_date'), true);\n if (accountingPeriod) {\n if (nlapiGetFieldValue('custpage_2663_postingperiod') != accountingPeriod) {\n nlapiSetFieldValue('custpage_2663_postingperiod', accountingPeriod, false);\n }\n }\n }\n }", "function publishPermissions ($group) {\n if (!$group.find('.hidden').attr('data-publish')) {\n $group.find('.cmb-add-row button').prop('disabled', true).prop('title', 'You do not have permission for this');\n }\n }", "setClubPrivacy(activity, newPrivacy) {\n let context = this;\n let setPrivacy = function(value) {\n return putAsync(\"/memberships/\" + activity.MembershipID + \"/privacy/\" + value, value, context).catch((reason) => {\n // console.log(reason);\n //TODO handle error\n });\n }\n let transition = function() {\n activity.set(\"Privacy\", newPrivacy);\n }\n setPrivacy(newPrivacy)\n .then(transition);\n }", "function setCreativeVersion() {EB._sendMessage(\"setCreativeVersion\", {creativeId: creativeId, creativeVersion: creativeVersion, creativeLastModified: lastModified, uid: uid});}", "function setDisclaimer(value) {\n\tdocument.cookie = \"acceptedDisclaimer=\" + value;\n}", "function setUpModeration(publicId, description) {\n console.log(`args: ${publicId}, ${description}`)\n // create transformation that includes moderation\n cloudinary.uploader\n .explicit(publicId, {\n type: 'upload',\n moderation: 'manual'\n })\n .then(result => {\n console.log(JSON.stringify(result, null, 1))\n })\n .catch(error => {\n console.log(error)\n })\n}", "function activateJournalMode(){ //%journal\n localStorage.emotionDestination = \"journal\";\n practiceDestination = \"initialPracticeDestination\";\n logDestination = \"initialLogDestination\";\n}", "function main() {\r\n\tGM_log(\"[ - MAIN - ]\");\r\n\tif (hasThisPagePublicity()) {\t\t\t\t\t\t\tGM_log(\"[-][hasThisPagePublicity]\");\r\n\t\tremovePublicity();\r\n\t}\r\n}", "setAutor(autor){\r\n this.autor =autor;\r\n }", "function setPersistenceCookie(sValue) {\r\n\tdocument.cookie = 'JS_PERSISTENCE_COOKIE=' + escape(sValue);\r\n}", "function startPublishing() {\n\t\tif (!publisher) {\n\t\t\tvar parentDiv = document.getElementById(\"myCamera\");\n\t\t\tvar publisherDiv = document.createElement('div'); // Create a div for the publisher to replace\n\t\t\tpublisherDiv.setAttribute('id', 'opentok_publisher');\n\t\t\t\n\t\t\t// Remove loading screen and append the video \n\t\t\t$('div#user1_loading').css('display', 'none');\n\t\t\tparentDiv.appendChild(publisherDiv);\n\t\t\t\n\t\t\tvar publisherProps = {width: VIDEO_WIDTH, height: VIDEO_HEIGHT};\n\t\t\tpublisher = TB.initPublisher(apiKey, publisherDiv.id, publisherProps); // Pass the replacement div id and properties\n\t\t\tsession.publish(publisher);\n\t\t}\n\t}", "function journalEvent(obj, index) {\n var value = document.querySelector(\"#publication-title > a\");\n window.ScraperExt.push(value.innerHTML);\n nextSearchItem(obj, index + 1);\n}", "function update_paper_info(d, custom) {\r\n // Report\r\n console.log(d.uid)\r\n\r\n // Init paper information\r\n document.getElementById(\"paper_title\").value = \"\"\r\n document.getElementById(\"paper_doi\").value = \"\"\r\n document.getElementById(\"paper_keywords\").value = \"\"\r\n document.getElementById(\"paper_comments\").value = \"\"\r\n\r\n // Override paper information with custom\r\n if (custom.title[d.uid]) {\r\n document.getElementById(\"paper_title\").value = custom.title[d.uid]\r\n }\r\n if (custom.keywords[d.uid]) {\r\n document.getElementById(\"paper_keywords\").value = custom.keywords[d.uid]\r\n }\r\n if (custom.comments[d.uid]) {\r\n document.getElementById(\"paper_comments\").value = custom.comments[d.uid]\r\n }\r\n}", "function setArticle(article){\n cleanArticleFields(); \n \n if(article){\n $('.author').text('Author: ');\n $('.date').text('Date: '); \n $('.title').append('<span>' + article.title + '</span>' );\n var authorWithLink = '<span> <a href=\\'mailto:'\n + article.authorEmail \n + '\\'>' + article.author \n +'</a></span>';\n \n $('.author').append(authorWithLink);\n $('.date').append('<span>' + article.date + '</span>' ); \n $('.text').append( article.text );\n $('.text').append( '<p> <button>Remove article</button></p>' );\n $('.article-view button').on('click', function(){\n removeArticle(article._id);\n });\n \n } else {\n showDefaultPage(errorArticleObject); \n }\n }", "function addPublicKey() {\n var keyList = {};\n if (localStorage.getItem(EE_KEYLIST) != null) {\n keyList = JSON.parse(localStorage.getItem(EE_KEYLIST));\n } \n\n var name = document.getElementById(\"pub-name\").value;\n name = name.trim();\n var key = document.getElementById(\"pubKey\").value;\n key = key.trim();\n keyList[name] = key;\n localStorage.setItem(EE_KEYLIST, JSON.stringify(keyList));\n location.reload();\n}", "function modifyPermaLink() {\n\tif (RegExp(\"HVD:HVD_ALEPH\").test($(\"#exlidURL\").attr(\"value\"))) {\n\t\tvar url = \"http://id.lib.harvard.edu/aleph/\" + $(\"#exlidURL\").attr(\"value\").replace(/(.*)(HVD:HVD_ALEPH)/, \"\") + \"/catalog\";\n\t\t$(\"#exlidURL\").attr(\"value\", url);\n\t}\n\telse if (RegExp(\"HVD:HVD_VIA\").test($(\"#exlidURL\").attr(\"value\"))) {\n var url = \"http://id.lib.harvard.edu/via/\" + $(\"#exlidURL\").attr(\"value\").replace(/(.*)(HVD:HVD_VIA)/, \"\") + \"/catalog\"; \n $(\"#exlidURL\").attr(\"value\", url);\n }\n}", "function setPomo(pomoId) {\n currentPomoID = pomoId;\n savePomoData();\n}", "set entryInfo(entryVal) {\n this._entryInfo = entryVal;\n }", "async function putPublish(req, res) {\n const key = req.headers['x-token']; // get token from header\n const userId = await redisClient.get(`auth_${key}`);\n\n let user = ''; // find and store user\n if (userId) user = await dbClient.client.collection('users').findOne({ _id: ObjectId(userId) });\n else res.status(401).json({ error: 'Unauthorized' });\n\n const docId = req.params.id;\n const doc = await dbClient.client.collection('files').findOne({ _id: ObjectId(docId), userId: user._id });\n if (doc) {\n doc.isPublic = true;\n res.json(doc);\n } else res.status(401).json({ error: 'Not found' });\n}", "function setShareDenomination(value, denomination) {\n if (value == null) {\n return value;\n }\n\n switch (denomination) {\n case (MICRO_SHARE):\n return formatValue(value, 4);\n case (MILLI_SHARE):\n return formatValue(value, 1);\n default:\n case (SHARE):\n return value;\n }\n}", "function onSetPaid(setPaid) {\n setPaid.valuePaid.paid = setPaid.newPaidValue; \n return getAssetRegistry('world.alphabets.Bet')\n .then(function (assetRegistry) {\n return assetRegistry.update(setPaid.valuePaid);\n });\n}", "function checkIfArticleProtected(i, linkObj, response) {\n // console.error(i, \"checkIfArticleProtected()\");\n\n // Check Article Protected Status\n if ( linkInfoArray[i].isArticle ) {\n // console.error(i, \"isArticle = true\");\n\n // Save the article's status to chrome.storage for use elsewhere.\n logArticleStatusInStorge(response.document);\n\n if ( isArticleProtected(response.document) ) {\n linkInfoArray[i].articleProtected = true;\n response.articleProtected = true;\n response.addToCache = false;\n createLinkErrorRow(linkObj, \"Article is protected.\", \"error\", null, \"lock\");\n } else {\n linkInfoArray[i].articleProtected = false;\n response.articleProtected = false;\n }\n } else {\n // console.error(i, \"isArticle = false\");\n }\n\n}", "function RSASetPrivate(N,E,D) {\n if(N != null && E != null && N.length > 0 && E.length > 0) {\n this.n = parseBigInt(N,16);\n this.e = parseInt(E,16);\n this.d = parseBigInt(D,16);\n }\n else\n alert(\"Invalid RSA private key\");\n}", "function saveDecadeSeventies() {\n decadePref = \"seventiesDecade\"\n}", "_onPublishClicked(options={}) {\n if (options.publishToOwnerOnly) {\n this.model.set('publishToOwnerOnly', true);\n }\n\n if (options.publishAndArchive) {\n this.model.set('publishAndArchive', true);\n }\n\n this.model.publish({\n attrs: ['public', 'publishToOwnerOnly', 'publishAndArchive'],\n });\n\n return false;\n }", "async publishStream (stream) {\n\t\t// the stream only needs to be published if the stream for the post (this.stream, \n\t\t// which is possibly different from the stream to be published) is a private stream ... \n\t\t// otherwise the stream will be published along with the post anyway, to the entire team\n\t\tif (!this.stream.hasPrivateContent()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst sanitizedStream = stream.getSanitizedObject({ request: this.request });\n\t\tawait new StreamPublisher({\n\t\t\tstream: sanitizedStream,\n\t\t\tdata: { stream: sanitizedStream },\n\t\t\trequest: this.request,\n\t\t\tbroadcaster: this.api.services.broadcaster,\n\t\t\tisNew: true\n\t\t}).publishStream();\n\t}", "async function updateBook(id) {\n const book = await Book.findById(id);\n if (!book) return;\n\n // method 1\n // book.isPublished = true;\n // book.author = 'Another Author';\n\n // method 2 -- use set()\n book.set({\n isPublished: false,\n author: 'Another Author'\n });\n\n const result = await book.save();\n console.log(result);\n}", "doPublish(program, targetDate) {\n }", "function setProvenanceGruppo(){\n var provenance;\n if(sessionStorage.length !== 0){\n provenance = '<mailto:[email protected]> a foaf:mbox ; ' +\n 'schema:email [email protected] ; ' +\n 'foaf:name \"LosRaspadores\"^^xsd:string ; ' +\n 'rdfs:label \"LosRaspadores\"^^xsd:string . ' ;\n }\n return provenance;\n}" ]
[ "0.53639084", "0.52458656", "0.51209664", "0.5063708", "0.50479555", "0.50266033", "0.5014022", "0.4914085", "0.4895055", "0.4881235", "0.48652253", "0.48590454", "0.48167673", "0.4793418", "0.47915107", "0.4745217", "0.4693576", "0.46904704", "0.46869975", "0.46375576", "0.46202147", "0.46079335", "0.4605319", "0.45987183", "0.4598278", "0.45730016", "0.45547518", "0.45430678", "0.4523168", "0.44899344", "0.44815168", "0.44748685", "0.44744587", "0.44425502", "0.444241", "0.44419825", "0.44387972", "0.4422045", "0.44139293", "0.43881458", "0.4376323", "0.43577966", "0.435169", "0.4349342", "0.43408948", "0.43408793", "0.4340625", "0.43373138", "0.43233332", "0.4312041", "0.43060207", "0.43017977", "0.42949694", "0.42834878", "0.42834255", "0.42720702", "0.42687538", "0.4265671", "0.42628852", "0.42585087", "0.42579904", "0.42560473", "0.42516536", "0.42508507", "0.4241767", "0.42365143", "0.4235939", "0.4231141", "0.4229283", "0.4225458", "0.4223929", "0.42222393", "0.42200044", "0.42090425", "0.41957125", "0.41937524", "0.4192922", "0.41922683", "0.41870803", "0.41828302", "0.41730323", "0.41717607", "0.4166341", "0.41638398", "0.41532907", "0.41501066", "0.41499963", "0.4148388", "0.41448992", "0.41445026", "0.4134913", "0.41291988", "0.41254678", "0.41250834", "0.41244927", "0.4120115", "0.41193712", "0.41169748", "0.4114067", "0.41135284" ]
0.58801407
0
Delete a journal entry from the list
deleteItem(id) { if (confirm("Delete this entry forever?")) { submitDataAsync({id: id}, "/journal/delete", false, (responseData) => { console.log(responseData); if (responseData.success === true) { this.setState(prevState => ({ items: prevState.items.filter((item) => { return item._id.$oid !== id; }) })); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteEntry(ENTRY){\n ENTRY_LIST.splice(ENTRY.id,1)\n updateUI()\n}", "deleteAnEntry() {\n document.querySelector(\".entryLog\").addEventListener(\"click\", function (e) {\n console.log(e.target.id)\n if (event.target.id.startsWith(\"delete-button\")) {\n const entryToDelete = event.target.id.split(\"--\")[1]\n console.log(`Please delete entry number! ${entryToDelete}`)\n API.deleteJournalEntry(entryToDelete)\n API.getJournalEntries()\n }\n })\n }", "function deleteEntry(entry){\n ENTRY_LIST.splice(entry.id, 1);\n// after we call the deleteEntry funciton we need to update the Total values again\n updateUI();\n }", "async function deleteEntry() {\n\n\t\t// 1) Delete the entry from the database by title\n\t\tawait Snapshot.destroy({\n\t\t\twhere: {\n\t\t\t\tTitle: req.params.title\n\t\t\t}\n\t\t});\n\n\t\tres.sendStatus(200).end()\n\t}", "deleteEntry(id) {\n if (id == null) { return this._rejectRequired('deleteEntry', 'id'); }\n let method = 'delete';\n let path = `/${this._userName}/${this._blogId}/atom/entry/${id}`;\n let statusCode = 200;\n return this._request({ method, path, statusCode });\n }", "function deleteEntry(id) {\n API.deleteEntry(id)\n }", "function deleteItem(e) {\n // retrieve the name of the task we want to delete. We need\n // to convert it to a number before trying it use it with IDB; IDB key\n // values are type-sensitive.\n let noteId = Number(e.target.parentNode.getAttribute('data-note-id'));\n\n // open a database transaction and delete the task, finding it using the id we retrieved above\n let transaction = db.transaction(['notes_os'], 'readwrite');\n let objectStore = transaction.objectStore('notes_os');\n let request = objectStore.delete(noteId);\n\n // report that the data item has been deleted\n transaction.oncomplete = function() {\n // delete the parent of the button\n // which is the list item, so it is no longer displayed\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n console.log('Note ' + noteId + ' deleted.');\n\n // Again, if list item is empty, display a 'No notes stored' message\n if(!list.firstChild) {\n let listItem = document.createElement('li');\n listItem.textContent = 'No notes stored.';\n list.appendChild(listItem);\n }\n };\n}", "_onTempDelete(entry) {\n this._removeEntries([entry])\n }", "static deleteEntry(path) {\n Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {\n if (err) {\n console.log(err);\n }\n });\n }", "function removeEntry(listName, title,titleId){\r\n console.log(\"title: \" + title + \" id: \" + titleId)\r\n let listInfo = JSON.parse(window.localStorage.getItem(listName))\r\n let entryList = listInfo.entries;\r\n // loop through all entries until found remove element from array and call loadPage()\r\n for (let i = 0; i < entryList.length; i++){\r\n let info = entryList[i].split(\"-:\");\r\n\r\n let entryTitle = info[0]\r\n let entryID = info[1]\r\n if (entryTitle == title && entryID == titleId){\r\n entryList.splice(i,1)\r\n console.log(\"new list: \" + entryList);\r\n }\r\n }\r\n listInfo.entries = entryList;\r\n window.localStorage.setItem(listName,JSON.stringify(listInfo));\r\n loadPage(listName,listInfo.entries);\r\n}", "function deleteEntry(){\n //get the book div and the book's id\n let bookDiv = this.parentElement;\n let bookDivIndex = Number(bookDiv.getAttribute('data-index'));\n //remove the div with the book entry on the HTML\n bookDiv.remove();\n //find the index of the book that has the matching book id and remove it from the library\n let chosenBookIndex = myLib.findIndex(book => book.numID === bookDivIndex);\n myLib.splice(chosenBookIndex, 1);\n}", "function deleteEntry (req, res) {\n logger.debug('Request recieved to cease entry by id', { loggerModule, URL: req.originalUrl, id: req.params.id })\n _performDatabaseUpdate(req, res, {endDate: new Date()})\n }", "function deleteEntry(idx) {\n var c = confirm(\"Are you sure you want to delete this entry?\");\n if (c) {\n contacts.splice(idx, 1);\n displayEntries();\n }\n}", "function deleteEntry(entryID) {\n var url = apiURL + '/entries/' + entryID;\n $.ajax({\n url: url,\n type: 'delete',\n success: function(data, status) {\n if (data['message'] == 'Entry deleted successfully.') {\n $.snackbar({\n content: 'Eintrag erfolgreich gel&ouml;scht'\n });\n getCourseEntries();\n } else {\n $.snackbar({\n content: 'Es ist ein Fehler aufgetreten. Bitte versuche es erneut.'\n });\n }\n },\n error: function(xhr, desc, err) {\n //console.log(xhr);\n //console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n headers: { auth: store.get(activeUser).auth }\n });\n }", "function _delete() {\n var content = JSON.parse(localStorage.getItem(LS_KEY));\n content = content.filter((entry) => !(this.name === entry.name && this.key === entry.key && this.action === entry.action));\n localStorage.setItem(LS_KEY, JSON.stringify(content));\n renderList();\n}", "function deleteEntry(itemNum) {\n var item = $('#item' + itemNum);\n var itemId = item.find('.invisible').text();\n $.post('/delete', {entryID: itemId});\n item.html('');\n}", "function EditLogItemDelete () {}", "function del(answer) {\n let number = parseInt(answer.substr(1));\n console.log(`Deleted ${lists[number]}\\n`);\n lists.splice(number, 1);\n return menu();\n}", "function deleteListItem(e) {\n let myTarget = e.target.parentElement.parentElement.parentElement;\n myTarget.remove();\n\n const myTitle = myTarget.querySelector('.notes-list-item-title');\n const mySubtext = myTarget.querySelector('.notes-list-item-subtext');\n\n deleteFromLocalStorage(myTitle.textContent, mySubtext.textContent);\n}", "function fDelete() {\n\tgetLS();\n\n\tbutton.addEventListener('click', (e) => {\n\t\tlet vGetId = e.target;\n\t\tconsole.log(vListArray);\n\t\tvListArray.splice(vGetId,1);\n\t\tconsole.log(vListArray);\n\t\tfSaveToLS();\n\t})\n}", "function checkAndDeleteJournals(newJournal)\r\n{\r\n\tvar foundFlag = 'F';\r\n\r\n\ttry\r\n\t{\r\n\t\tnlapiLogExecution('debug', 'checkJournals oldJournalList', oldJournalList);\r\n\t\tnlapiLogExecution('debug', 'checkJournals newJournal', newJournal);\r\n\r\n\t\t//looping through the old journal list\r\n\t\tfor(var y = 0; y < oldJournalList.length; y++)\r\n\t\t{\r\n\t\t\t//looping through the new journal list \r\n\t\t\tfor(var z = 0; z < newJournal.length; z++)\r\n\t\t\t{\r\n\t\t\t\t//if old journal id is found in the new journal list \r\n\t\t\t\tif(oldJournalList[y] == newJournal[z])\r\n\t\t\t\t{\r\n\t\t\t\t\tfoundFlag = 'T';\r\n\r\n\t\t\t\t\t//to exit the current loop\r\n\t\t\t\t\tz = newJournal.length -1;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tfoundFlag = 'F';\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//if the old journal id is not found in the new journal list\r\n\t\t\tif(foundFlag == 'F')\r\n\t\t\t{\r\n\t\t\t\t//delete the old journal\r\n\t\t\t\tnlapiDeleteRecord('journalentry',oldJournalList[y]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler('checkAndDeleteJournals', e);\r\n\r\n\t}\r\n\r\n}", "function deleteNote(index) {\r\n console.log(\"deleting this node.\", index);\r\n let notes = localStorage.getItem(\"notes\"); //take notes from localstorage.\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));//updating localstorage..\r\n showNotes();\r\n\r\n}", "function DeleteNoteFromList(id){\n\t\t//this.projNotes[];\n\t\tvar noteIndex = FindProjNote(id);\n\t\t\n\t\tif(typeof noteIndex != \"boolean\"){\n\t\t\tprojNotes.splice(noteIndex, 1);\n\t\t\tnoteListChanged=true;\n\t\t}\n\t\t\n\t\t\n\t}", "function removeEntry(entryId) {\n return Restangular.one(foodDiaryEndpoint, entryId).remove();\n }", "function deleteItem(elem) {\r\n var id = elem.parent().attr(\"id\");\r\n firebase\r\n .database()\r\n .ref(\"/todos/\" + id)\r\n .remove();\r\n }", "function deleteentry(event)\n{\n //alert(jQuery(event.target).attr(\"id\"));\n if(confirm(\"Are you sure to delete?\") == false)\n return;\n var id_str = jQuery(event.target).attr(\"id\").substring(jQuery(event.target).attr(\"id\").indexOf(\"deletebutton\")+12);//get the influencer's id\n var id = parseInt(id_str);\n //delete the influencer with this id\n var i;\n for(i = 0;i<newJsonObj.influencers.length;i++)\n {\n if(newJsonObj.influencers[i].id == id)\n break;\n }\n newJsonObj.influencers.splice(i,1);\n parseJSON(newJsonObj);\n}", "handleDelete(id){\n const request = new Request();\n const url = '/api/journalists/' + id;\n request.delete(url).then(() => {\n window.location = '/journalists'\n })\n }", "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\r\n// console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function adminDelete(id){\n manga = biblioteca[id]\n let validar = confirm(`Esta seguro de querer eliminar a ${manga.titulo}`)\n\n if(validar){\n biblioteca.splice(id,1)\n localStorage.setItem('biblioteca',JSON.stringify(biblioteca))\n alert(`Se borro ${manga.titulo}`)\n cargarManga4(biblioteca)\n }\n}", "deleteFromList() {\n list.splice((this.id), 1)\n }", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1)\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "deleteList(listID){\n let index = _store.State.lists.findIndex(list => list.id == listID)\n _store.State.lists.splice(index, 1)\n _store.saveState()\n }", "function deleteNote(index) {\n console.log(\"One note deleted\",\"The id is : \",index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n //splice take the starting index from where to delete,and the number of the element\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function deleteNote(index) {\n //console.log(\"Deleting : \", index);\n let noteField = localStorage.getItem(\"data\");\n if (noteField == null) {\n noteArray = [];\n } else {\n noteArray = JSON.parse(noteField);\n }\n\n noteArray.splice(index, 1); //Splice function to remove elements in array\n localStorage.setItem(\"data\", JSON.stringify(noteArray));\n //console.log(\"Deleted\");\n display();\n}", "function deleteNote(id) {\r\n console.log(\"deleted id: \" + id);\r\n\r\n setListNote((prevList) => {\r\n return prevList.filter((note, index) => {\r\n return index !== id;\r\n });\r\n });\r\n }", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "function del( path, urn ){\n\t\treturn json.del( path ).then(\n\t\tfunction( data ){\n\t\t\tlog_item( urn, data );\n\t\t});\n\t}", "todo_delete(todo){\n todosRef.child(todo['.key']).remove();\n this.activity_add(\"Todo with text \" + todo.task + \" removed\");\n var index = this.todos.indexOf(todo);\n if(index > -1){\n this.todos.splice(index, 1);\n }\n }", "function deleteNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.remove()\r\n .then(function () {\r\n getNotesForThisUser().then(notes => display(notes)).catch(err => handleError(err))\r\n CKEDITOR.instances[\"addTxt\"].setData('');\r\n })\r\n .catch(function (error) {\r\n console.log(\"Remove failed: \" + error.message)\r\n });\r\n\r\n\r\n\r\n}", "function deleteNote(index){\n console.log(`I am deleting `,index);\n // let notes=localStorage.getItem(\"notes\");\n // if(notes==null){\n // notesobj=[];\n // }\n // else{\n // notesobj=JSON.parse(notes);\n // }\n notesobj.splice(index,1);\n localStorage.setItem(\"notes\",JSON.stringify(notesobj));\n showNotes();\n}", "function deletePost(event) {\n event.preventDefault();\n let postID = event.target.parentNode.id;\n let post = document.getElementById(postID);\n let editBtn = document.getElementById(`edit:${postID}`);\n let deleteBtn = document.getElementById(`delete:${postID}`);\n editBtn.removeEventListener(\"click\", editPost);\n deleteBtn.removeEventListener(\"click\", deletePost);\n post.remove();\n\n let postList = localStorage.getItem(\"postList\");\n postList = JSON.parse(postList);\n let postIdx = postList.map((post) => post.id).indexOf(postID);\n postList.splice(postIdx, 1);\n localStorage.setItem(\"postList\", JSON.stringify(postList));\n console.log(`Delete: ${event.target.parentNode.id}`);\n}", "function deleteNote (noteId) {\n request\n .delete(`https://notes-api.glitch.me/api/notes/${noteId}`)\n .auth('liz', 'dogsarebetterthancats')\n .then(response => {\n notesList = notesList.filter(note => note._id !== noteId)\n console.log(notesList)\n })\n}", "function deleteLogEntry(worker, entryId) {\n if (entryId != null) {\n datastore.deleteLogEntry(entryId);\n }\n}", "function deleteNote(index) {\n // console.log(\"A node is being deleted\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // Deleting the element from the array\n localStorage.setItem(\"notes\", JSON.stringify(notesObj)); //updating the local storage\n showNotes();\n}", "function deleteNote(index)\n{\n console.log(\"I am clicking\" , index)\n let notes = localStorage.getItem('notes');\n if (notes == null)\n {\n notesObj = [];\n }\n else\n {\n notesObj = JSON.parse(notes);\n \n }\n\n notesObj.splice(index,1)\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));\n showNotes();\n}", "function deleteStorageEntry(index) {\n chrome.storage.sync.get(['youtubeBookmarks'], function (result) {\n let bookmarks = JSON.parse(result.youtubeBookmarks);\n\n bookmarks.value.splice(index, 1);\n\n chrome.storage.sync.set({\n youtubeBookmarks: JSON.stringify(bookmarks)\n });\n });\n location.reload();\n}", "function deleteNote(index) {\r\n //console.log(\"Deleting Note\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n showNotes();\n}", "function deleteNote(index){\r\n\r\nlet notes = localStorage.getItem('notes');\r\n\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteTask(event) {\n\n let idDelete = event.target.getAttribute('data-id')\n\n let keyId = listTask.findIndex(element => {\n if (element.id == idDelete) {\n return element\n }\n })\n\n if (keyId != -1) {\n listTask.splice(keyId, 1)\n saveData()\n }\n\n openModalDel()\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1); // first argument - to start from, second argument - number of elements to delete\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function removeEntry(item){\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n tx.executeSql('DELETE FROM entries WHERE id=?', [item.id]);\n },\n function (error) {\n console.log(\"Transaction Error: \" + error.message);\n d.reject();\n },\n function () {\n //console.log(\"Removed item with id \" + item.id);\n d.resolve();\n });\n\n return d;\n }", "function deleteNote(index) {\n // console.log(`I am Deleating the notes no :${index}`);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\n}", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "handleDeleteItem(ledger, index) {\n ledger.deleteItem(index);\n this.forceUpdate(); //Since we don't set any state for this, the page doesn't otherwise refresh after deletion\n }", "function deleteNote(index){\n let confirmDel = confirm(\"Are you sure you want to delete this?\");\n if(confirmDel == true){\n let notes = localStorage.getItem(\"Notes\"+id);\n //if notes in localstorage is empty declare one\n if(notes == null){\n notesObj = [];\n } else{\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"Notes\"+id, JSON.stringify(notesObj));\n showNotes();\n }\n }", "function delClick(e) {\n const index = getItemIndex(\n srcList,\n e.target.parentElement.getAttribute('name'),\n );\n\n if (index < 0) return;\n\n srcList.splice(index, 1);\n chrome.storage.sync.set({ storageSrcKey: srcList }, () =>\n console.log(`${storageSrcKey} value saved. List : ${srcList}`),\n );\n e.target.closest('tr').remove();\n }", "function delNote(d)\n{\n // get key as id, then remove that object from DB\n var keyToDel = d.id\n loc.child(keyToDel).remove()\n\n // delete from web page\n var rowToBeDel = d.parentNode.parentNode\n var ch0 = rowToBeDel.childNodes[0]\n var ch1 = rowToBeDel.childNodes[1]\n var ch2 = rowToBeDel.childNodes[2]\n rowToBeDel.removeChild(ch0)\n rowToBeDel.removeChild(ch1)\n rowToBeDel.removeChild(ch2)\n}", "function deleteTodo(key) {\n //Retrieve the index of the todo entry in the collection. \n const index = todoItems.findIndex((item) => item.id === Number(key));\n //Set delete attribute to true for todo entry\n const todo = {\n deleted: true,\n ...todoItems[index],\n\n };\n todoItems = todoItems.filter((item) => item.id !== Number(key));\n // console.table(todoItems)\n //trigger page update by invoking renderTodo function.\n renderTodo(todo);\n}", "function deleteNote(index){\n console.log(\"Something deleted\");\n let notes=localStorage.getItem('notes');\n let titles = localStorage.getItem('title');\n if(notes==null){\n notesObj=[];\n }\n else{\n notesObj=JSON.parse(notes);\n }\n if (titles == null) {\n titlesObj = [];\n }\n else {\n titlesObj = JSON.parse(titles);\n }\n notesObj.splice(index,1);\n titlesObj.splice(index,1);\n notes=JSON.stringify(notesObj);\n titles=JSON.stringify(titlesObj);\n localStorage.setItem('notes',notes);\n localStorage.setItem('title',titles);\n showNotes();\n}", "deleteNote(i) {\n const index = this.state.list.findIndex((p) => p.id === i.id);\n if (index !== -1) {\n this.state.list.splice(index, 1);\n this.props.removeItem(this.state.list);\n this.setState({ listString: JSON.stringify(this.state.list) })\n }\n }", "function deleteList(c) {\n\tconst taskDel = document.querySelector(`.item-${c}`);\n\ttaskDel.firstElementChild.addEventListener(\"click\", () => {\n\t\tif (confirm(\"Are you sure?\")) {\n\t\t\ttaskDel.remove();\n\t\t\tconsole.log(taskDel.textContent);\n\t\t\tremoveFromStorage(taskDel.textContent);\n\t\t}\n\t});\n}", "function deleteNote(index){\r\n // console.log(\"I am deleting\",index);\r\n let notes = localStorage.getItem('notes')\r\n if(notes==null){\r\n notesObj = [];\r\n }else{\r\n notesObj = JSON.parse(notes)\r\n\r\n }\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n //for deleting use slice function.\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index){\n console.log('I am deleting Note no ', index);\n const notes= localStorage.getItem('notes');\n if(notes==null){\n notesObj= [];\n }\n else{\n notesObj= JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n console.log(notesObj);\n}", "deleteCurrentEditEntry(key) {\n let newUserData = this.state.userData;\n delete newUserData[key];\n firebase.database().ref('userData/' + this.props.user.uid + '/userJournalEntries').set(newUserData);\n }", "function deleteblogrecoed(jah){\n\t//var deleteref = firebase.database().ref().child('/transportation/' + u).child(key);\n\n\twindow.alert(jah);\n\treturn jah.remove();\n\t\n\n}", "function deleteTodo($index){\n self.todoList.splice($index, 1);\n }", "function deleteTodo(key) {\n //Retrieve the index of the todo entry in the collection\n const index = todoItems.findIndex((item) => item.id === Number(key));\n //set delete attribute to true for the todo entry\n const todo = {\n deleted: true,\n ...todoItems[index],\n };\n todoItems = todoItems.filter((item) => item.id !== Number(key));\n //Trigger page update by (invoking) calling the renderTodo function\n renderTodo(todo);\n}", "removeTickerMonitorEntry(id)\n{\n let query = 'DELETE FROM tickerMonitor WHERE id = $id';\n this._db.run(query, {$id:id}, function(err){\n if (null === err)\n {\n return;\n }\n logger.error(\"Could not remove TickerMonitor entry '%s' : %s\", sid, err.message);\n });\n}", "function deleteEntry(name){\r\n\treadFile((res)=>{\r\n\t\tvar writelist = [];\r\n\t\tvar contactList = JSON.parse(res);\r\n\t\tcontactList.forEach((item,index)=>{\r\n\t\t\tif(item.name.toUpperCase()!==name.toUpperCase()) writelist.push(item);\r\n\t\t})\r\n\t\twriteFile(writelist);\r\n\t})\r\n}", "function deleteNote(index) {\n let notes_check = localStorage.getItem(\"notes\");\n if (notes_check == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes_check);\n }\n\n /*we are deleting from the array notesObj the elemnt in which \"Delete Note\" has been clicked and the index of that element is passed here.1 indicates that we want to delete just one element from that index number.*/\n notesObj.splice(index, 1);\n\n //after deleting, we need to update the local storage and show the updated notes.\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n //showing the updated notes\n showNotes();\n\n}", "function deleteItem(e) {\r\n var btn = e.target;\r\n\r\n while (btn && (btn.tagName != \"A\" || !/\\bdelete\\b/.test(btn.className))) {\r\n btn = btn.parentNode;\r\n if (btn === this) {\r\n btn = null;\r\n }\r\n }\r\n if (btn) {\r\n var btnParent = btn.parentNode.parentNode.parentNode\r\n this.removeChild(btnParent);\r\n updateNotesListOnRemoveItem(btn);\r\n }\r\n}", "function removeTodoById(id, li) {\n connection.remove({\n from: 'tasks',\n where: {\n id: id\n }\n }).then(() => {\n li.remove()\n // alert('Todo removed')\n })\n}", "function deleteButtonClick(){\n\t\tdisplayNotes();\n\t\tvar h = prompt(\"Wich one you want to delete? Example: 1, 2, 3\");\n\t\tstorage.splice(0,1);\n\t\t\n\t\tdisplayNotes();\t\n\t}", "function _deleteEntry() {\n\t\ttry {\n\t\t\t//Get the Request Body\n\t\t\tvar oBody = JSON.parse($.request.body.asString());\n\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to delete the entries\n\t\t\tvar oStatement = oConnection.prepareStatement(\"DELETE FROM \\\"\" + gvSchemaName + \"\\\".\\\"\" + gvTableName +\n\t\t\t\t\"\\\" WHERE CONDITION_ID = ? AND ITEM = ?\");\n\n\t\t\t//Condition Id\n\t\t\toStatement.setInt(1, parseInt(oBody.CONDITION_ID));\n\t\t\toStatement.setInt(2, parseInt(oBody.ITEM));\n\n\t\t\toStatement.addBatch();\n\n\t\t\t//Execute the Insert\n\t\t\toStatement.executeBatch();\n\n\t\t\t//Close the connection\n\t\t\toStatement.close();\n\t\t\toConnection.commit();\n\t\t\toConnection.close();\n\n\t\t\tgvTableUpdate = \"Table entries deleted successfully from Table:\" + gvTableName + \";\";\n\t\t\tgvStatus = \"Success\";\n\n\t\t} catch (errorObj) {\n\t\t\tif (oStatement !== null) {\n\t\t\t\toStatement.close();\n\t\t\t}\n\t\t\tif (oConnection !== null) {\n\t\t\t\toConnection.close();\n\t\t\t}\n\t\t\tgvTableUpdate = \"There was a problem deleting entries in the Table: \" + gvTableName + \", Error: \" + errorObj.message + \";\";\n\t\t\tgvStatus = \"Error\";\n\t\t}\n\t}", "function deleteRepLog(num) {\n console.log(\"delete: \" + num);\n var logReports = JSON.parse(dailyReport);\n logReports.splice(num, 1);\n dailyReport = JSON.stringify(logReports);\n localStorage.setItem(\"dailyReport\", dailyReport);\n console.log(logReports)\n\n reportLogTextContent(logReports);\n\n if (localStorage.getItem(\"langSelect\") === \"english\") {\n message = \"Report deleted successfully!\";\n } else {\n message = '!הדו\"ח נמחק בהצלחה';\n }\n alertToast('success', message);\n}", "function deleteElement(listElement) {\n var text = $(listElement).text();\n var itemText = text.slice(0,-1) // Removes the x from the list's text\n $.post('/deleteItem', {\"itemText\": itemText})\n listElement.style.display = \"none\";\n}", "async function delBkmk (a_id, a_BN) {\n let len = a_BN.length;\n // Fecord a multiple operation if more than one item in the array\n if (len > 1) {\n\tawait recordHistoryMulti((options.trashEnabled ? \"remove_tt\" : \"remove\"), a_id);\n }\n\n let BN;\n for (let i=0 ; i<len ; i++) {\n\tBN = a_BN[i];\n//trace(\"Remove BN id: \"+BN.id);\n\t// If BSP2 trash enabled, move the bookmark item to trash instead (except when already in trash, where we really delete it)\n\tlet bnId = BN.id;\n\tif (options.trashEnabled && !BN.inBSP2Trash) { // Move at end of trash\n\t await browser.bookmarks.move(\n\t\tbnId,\n\t\t{parentId: bsp2TrashFldrBNId\n\t\t}\n\t );\n\t}\n\telse { // Really delete the bookmark item\n\t await browser.bookmarks.removeTree(bnId);\n\t}\n }\n}", "function deleteNote(d) {\n var selectedListItem = noteList.options[noteList.selectedIndex];\n if (d.keyCode == 46) {\n var j = selectedListItem.id;\n var deletedNode = document.getElementById(j);\n localStorage.removeItem(j);\n var sbq = document.getElementById(\"note-\" + j);\n sbq.innerText = \"\";\n sbq.removeAttribute(\"id\");\n while (noteList.lastChild) {\n noteList.removeChild(noteList.lastChild);\n }\n displayListNotes();\n }\n}", "function deleteEntry(id, event) {\n\n\tlet tail = \"?id=\" + id;\n\n\tvar req = new XMLHttpRequest();\n\t\treq.open('GET', FLIP + PORT + '/delete-park' + tail, true);\n\t\treq.addEventListener('load',function(){\n\t\tif(req.status >= 200 && req.status < 400){\n\n\t\t\t\n\t\t\tloadTable();\t\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t\treturn;\t\n\n\t } else {\n \tconsole.log(\"Error in network request: \" + req.statusText);\n\t }});\n\t req.send();\n\t event.preventDefault();\n}", "function deleteNote(noteEl) {\n fetch(url + '/' + `${noteEl.id} `, {\n method: 'DELETE'\n }).then(() => noteEl.parentElement.remove())\n}", "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function deleteNote(index) {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes); //string to array\r\n }\r\n notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "function delTodo($index) {\n \tself.todoList.splice($index, 1);\n }", "function remove(index, data) {\n const id = data._id;\n arr.splice(index, 1);\n localStorage.setItem(\"items\", JSON.stringify(arr));\n fetch(`/delete/${id}`, {\n method: \"DELETE\"\n });\n}", "function deleteListItem() {\n item.remove();\n }", "function deleteNote(index){\n // console.log('i am deleting' , index);\n let notes = localStorage.getItem(\"notes\");\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index , 1);\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n shownotes();\n}", "function deleteNote(index){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function handleDeleteItem(_event) {\n let aktuellertIndex = parseInt(_event.target.getAttribute(\"index\"));\n warenkorbsumme = warenkorbsumme - carticles[aktuellertIndex].preis;\n gesamtSumme.innerText = \"Gesamtsumme: \" + warenkorbsumme.toLocaleString(\"de-DE\", { style: \"currency\", currency: \"EUR\" });\n (_event.target.parentElement?.remove());\n }", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n markedObj.splice(index, 1);\n titleObj.splice(index, 1);\n localStorage.setItem(\"marked\", JSON.stringify(markedObj));\n localStorage.setItem(\"title\", JSON.stringify(titleObj));\n showNotes();\n}", "deletehsSubject(hssubject){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('subjectModel').indexOf(hssubject);\n var restemp = this.get('subjectModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "function del(number) {\n if (number >= list.length) {\n console.log(`\\nInvalid Number\\n`);\n menu()\n } else {\n let task = list[number].task\n list.splice(number, 1);\n console.log(`\\nDeleted ${task}\\n`);\n view();\n }\n}", "function deleteTodo($index){\n\t\t\tself.todoList.splice($index, 1);\n\t\t}", "function deleteTodo($index){\n\t\t\tself.todoList.splice($index, 1);\n\t\t}" ]
[ "0.76668525", "0.7132705", "0.6908506", "0.66884905", "0.66210204", "0.6615762", "0.65002716", "0.64919823", "0.6340714", "0.6336769", "0.6326799", "0.63260984", "0.6283648", "0.62835544", "0.6263643", "0.6213029", "0.619204", "0.6154836", "0.61360115", "0.6108261", "0.60917866", "0.6076372", "0.60667664", "0.6064088", "0.60569954", "0.6055433", "0.604748", "0.6023387", "0.60224307", "0.60186183", "0.60115945", "0.6011214", "0.6010344", "0.60062075", "0.6005187", "0.60043895", "0.6004094", "0.6003575", "0.6002913", "0.599277", "0.5984273", "0.5982037", "0.5980183", "0.59771264", "0.59770864", "0.5975022", "0.5974674", "0.5972685", "0.5968629", "0.5968606", "0.5962272", "0.5959879", "0.59565747", "0.59564716", "0.5953274", "0.5952723", "0.5950056", "0.59425646", "0.594077", "0.5935524", "0.5935269", "0.59330606", "0.5930361", "0.59234613", "0.5922746", "0.5920353", "0.5919095", "0.59160745", "0.59152645", "0.5908284", "0.5908124", "0.5904223", "0.5901426", "0.5894181", "0.5888371", "0.58802074", "0.5874297", "0.58731306", "0.5872408", "0.5871203", "0.58597964", "0.58592606", "0.5858692", "0.5851928", "0.5851435", "0.5843936", "0.5835508", "0.5834715", "0.58311296", "0.5827954", "0.5827068", "0.5824328", "0.5817721", "0.5817721", "0.5814424", "0.5812735", "0.57989764", "0.5798108", "0.5796141", "0.5796141" ]
0.61541134
18
Add a journal entry to the list
handleSubmit(e) { e.preventDefault(); if (this.state.text.length === 0) { return; } const newItem = { text: this.state.text, latitude: 0, longitude: 0 }; submitDataAsync(newItem, "/journal/add", true, (responseData) => { console.log(responseData); // Add the item to the front of the list this.setState(prevState => ({ items: [responseData.payload].concat(prevState.items), text: '', public: false })); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addEntryToList(entry) {\n const list = document.querySelector('#journal-list');\n\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>${entry.date}</td>\n <td>${entry.title}</td>\n <td>${entry.post}</td>\n `;\n\n list.appendChild(row);\n }", "add(string) {\n let list = this.journal.querySelector('.journal__list');\n if (list.firstElementChild.classList.contains('journal__item--empty')) {\n list.innerHTML = '';\n }\n let item = document.createElement('li');\n item.className = 'journal__item';\n item.innerHTML = string;\n list.insertBefore(item, list.children[0]);\n }", "async addToJournal (tx) {\n return this.setJournal(`${this.options.journal}\n${tx}\n`)\n }", "initializeJournal(journalID){\n const date = this._stringify(this.date);\n this.journalID = journalID;\n this.diaryService.createEntry(journalID,this.date,this.promptIndex,'');\n }", "function addEntries() {\n\n}", "function saveEntry(){\n var entry = {\n \"date\" : currentEntryDate.toDateString(),\n \"text\" : document.getElementById(\"entry\").value\n };\n\n var journal = JSON.parse(localStorage.getItem(\"journal\"));\n \n if(entry.text == localStorage.getItem(\"template\") || entry.text == \"\"){\n // don't save and actually delete stored entry if it exists\n journal = journal.filter(function(e) { return e.date != entry.date; })\n } else if (journal.filter(function(e) { return e.date === entry.date; }).length < 1){\n journal.push(entry);\n } else {\n journal.filter(function(e) { return e.date === entry.date; })[0].text = entry.text;\n }\n localStorage.setItem(\"journal\", JSON.stringify(journal));\n}", "function addJournal(req, res) {\n projectData.data.push(req.body);\n res.send(\"POST received\");\n}", "function addEntry(events, squirrel) {\n JOURNAL.push({ events, squirrel });\n}", "static loadJournal() {\n fetch(`${baseURL}/entries`)\n .then(resp => resp.json())\n .then(entries => {\n entries.forEach(entry => {\n let newEntry = new Entry(entry, entry.word, entry.user) \n Entry.all.push(newEntry)\n newEntry.display()\n })\n })\n }", "addEntry(entry) {\n if (this.getFileId(entry.name) == null) {\n this.entries.push(entry);\n this.content += entry.text;\n\n Net.updateFile(this.id, btoa(this.content));\n\n return true;\n } else {\n return false;\n }\n }", "function addLogEntry(worker, entry) {\n if (entry != null) {\n datastore.createLogEntry(entry);\n }\n}", "function addJournal(req, res){\n var imgId = req.body.imgId;\n var userId = req.body.pId;\n var entry = req.body.entry;\n console.log(\"img id: \" + imgId + \" user id: \" + userId + \" entry: \" + entry);\n addEntryDb(imgId, userId, entry, function(error, result){\n if(error || result == null){\n res.status(500).json({success: false, data: error});\n }\n res.render('pages/journalPage', {'imgId': imgId, 'userId': userId});\n })\n}", "function addEntry(name,number){\r\n\treadFile((res)=>{\r\n\t\tvar contactList = JSON.parse(res);\r\n\t\tvar contact = {\"name\":name,\"number\":number};\r\n\t\tcontactList.push(contact);\r\n\t\twriteFile(contactList);\r\n\t});\r\n\r\n}", "function addEntry(entry){\n jsfile.readFile(dbFile,(err,data)=>{\n if(!err){\n console.log(\"Read DB Success!\");\n data.push(entry);\n jsfile.writeFile(dbFile,data,(err)=>{\n if(err){\n console.log(\"Added Entry Failure!\");\n }else{\n console.log(\"Added Entry Success!\");\n }\n });\n }else{\n console.log(\"Read DB Failure!\");\n }\n })\n}", "add(entry) {\n this.amount.add(entry.amount);\n this.count += 1;\n this.dbUpdater.update();\n }", "add_entry(entry) {\n this.dictionary.push(entry)\n }", "postJournalEntries (newJournalEntryObject) {\n return fetch (\"http://localhost:8088/entries\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newJournalEntryObject)\n });\n }", "static addEntry(data) {\n if (!data || (typeof data) !== 'object') {\n return this.badRequest('the data pass are not right,pleas pass right data');\n }\n const error = DummyDataHelpers.validateEntry(data);\n if (!error) {\n if (DummyDataHelpers.titleExists(dummyEntries, data.title)) {\n return this.conflictError('title already exist,change title');\n }\n // const entryid = (dummyEntries.length - 1) + 1;\n const entryid = dummyEntries[dummyEntries.length - 1].id + 1;\n const newEntry = {\n id: entryid,\n title: data.title,\n note: data.note,\n imageUrl: data.imageUrl,\n createdAt: new Date(),\n updatedAt: new Date(),\n isFavourite: data.isFavourite,\n };\n dummyEntries.push(newEntry);\n return this.createdSuccessfully('A new Entry created successfully', newEntry);\n }\n return this.badRequest(error);\n }", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function addTodo(txnId, journal, todoEffect) {\n let added = false;\n\n for (const entry of journal) {\n const tref = entry[1].use(_ => _.tref);\n const oldTodo = tref.todo.get;\n\n if (!HM.has_(oldTodo, txnId)) {\n const newTodo = HM.set_(oldTodo, txnId, todoEffect);\n tref.todo.set(newTodo);\n added = true;\n }\n }\n\n return added;\n}", "function addEntry() {\n //get the pace and date from input boxes\n let paceEntry = parsePace();\n let dateEntry = parseDate();\n\n //don't add entry if the input is wrong format, exits the function\n if (paceEntry == null || dateEntry == null) { return; }\n\n //create new entry object and push to data array\n let entry = new Entry(paceEntry, dateEntry, true);\n entries.push(entry);\n\n //sorts entries array by date\n sortEntries();\n\n //save to local storage\n localStorage['entries-local'] = JSON.stringify(entries);\n\n //refresh the list\n createList();\n //reset and then draw chart\n ctx.clearRect(0, 0, canvas.width, canvas.height); //clear existing canvas\n drawAxis();\n drawChart();\n}", "function addNoteTextStorage(event) {\n const node = event.target.parentNode.parentNode;\n const text = node.querySelector('.note__text').innerText;\n const date = node.querySelector('.date').innerText;\n\n const noteText = { text, date };\n\n notes.push(noteText);\n localStorage.setItem('notes', JSON.stringify(notes));\n\n populateNotes(notes, notesList);\n}", "function saveEntry(entry) {\n const transaction = db.transaction(['new_budget_entry'], 'readwrite');\n\n const budgetObjectStore = transaction.objectStore('new_budget_entry');\n\n budgetObjectStore.add(entry);\n}", "function addEntry() {\n var title = document.getElementById(\"add_title\").value;\n var date = document.getElementById(\"add_date\").value;\n date = formatDate(date);\n\n var content = document.getElementById(\"add_content\").value; \n \n if (!isInputError(title, date, content)) {\n todos.push(new Entry(title, date, \"\", content));\n // reset field values and hide add panel\n document.getElementById(\"add_title\").value = \"\";\n document.getElementById(\"add_date\").value = \"\";\n document.getElementById(\"add_content\").value = \"\";\n // refresh todo list\n displayEntries();\n }\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function onAddToList(job) {\n if (myStorage.getItem(job.id) == null) {\n myStorage.setItem(job.id, JSON.stringify(job));\n console.log(\"Added \" + job.id);\n }\n else {\n console.log(\"Error: Already added\")\n }\n console.log(job);\n}", "function buildNewJournalButton(){\n\tvar button = document.createElement(\"button\");\n\tvar buttonLabel = document.createTextNode(\"Add Journal\");\n\tbutton.appendChild(buttonLabel);\n\n\tbutton.addEventListener('click', function(event){\t\n\t\tvar journalData = new JournalData ();\n\t\tvar journalsRelation = user.relation(\"userJournals\");\n\t\tvar newJournalTitle = prompt(\"Enter the new journal's title.\");\n\n\t\tif(newJournalTitle != null){\n\t\t\tcurrentJournalIndex = 0;\n\t\t\tcurrentEntryIndex = 0;\n\n\t\t\tjournalData.save({\n\t\t\t\tjournalTitle: newJournalTitle,\n\t\t\t}, \n\t\t\t{\n\t\t\t\tsuccess: function(results){\n\t\t\t\t\tconsole.log(\"Created new journal\");\n\t\t\t\t\tjournalsRelation.add(journalData);\n\t\t\t\t\tuser.save(null, {\n\t\t\t\t\t\tsuccess: function (results){\n\t\t\t\t\t\t\trefreshJournalsSection();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror:function(error){\n\t\t\t\t\t\t\talert(\"Something went wrong: error is \" + error.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\terror: function(error){\n\t\t\t\t\tconsole.log(\"Error creating new journal. Error: \" + error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\tnewJournalButton.appendChild(button);\n}", "function appendList(event) {\n event.preventDefault();\n // Get the input from the user\n const input = document.forms[0].addTo.value;\n\n if (toDos === null)\n toDos = [];\n // Form validation to alert the user to enter a task\n // within 50 chars.\n if(input === '')\n alert('Cannot create a blank task');\n else if(input.length > 50)\n alert('Entry is to big');\n else {\n // Using the input we create an object to store it\n const add = {id: Date.now(), content: input, completed: false};\n\n // Add it to the top of the list and then update local storage\n toDos.unshift(add);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n\n}", "function add(item){\n repository.push(item);\n }", "function EditLogItemInsert () {}", "function showEntry(list, type, title, amount, id){\n // this is the entire html of our new entry variable\n const entry = `<li id = \"${id}\" class = \"${type}\"> \n <div class = \"entry\">- ${title}: $${amount} </div>\n <div id = \"edit\"></div>\n <div id = \"delete\"></div>\n </li>`;\n // make the newest entries appear at the top of list\n const position = \"afterbegin\";\n list.insertAdjacentHTML(position,entry);\n}", "function addEntry(entry, mode) {\n console.log('addEntry entry = ' + angular.toJson(entry));\n //console.log('addItemToList listOpenEntries = ' + angular.toJson(entries.listOpenEntries));\n console.log('addEntry global.currentList = ' + angular.toJson(global.currentList));\n var defer = $q.defer();\n //search the item in the listOpen Entries\n var insertFlag = false;\n if (mode == 'S') {\n insertFlag = true;\n } else {\n var openIdx = itemExitInList(entry.itemLocalId, global.currentListEntries.listOpenEntries.entries);\n if (openIdx == -1) {\n insertFlag = true;\n }\n }\n console.log('addEntry insertFlag = ' + angular.toJson(insertFlag));\n if (insertFlag) {\n entry.origin = mode == 'L' ? 'L' : 'S';\n if (mode == 'S') {\n checkEntryExists(entry.entryServerId).then(function (exists) {\n if (!exists) {\n insertEntry2(entry,'FE_CREATED').then(function (res) {\n defer.resolve();\n }, function (err) {\n console.error('addEntry insertEntry err = ' + angular.toJson(err));\n defer.reject();\n });\n }\n else {\n console.log('addEntry ALREADY EXISTS ');\n defer.resolve();\n }\n }, function (err) {\n console.error('addEntry checkEntryExists err = ' + angular.toJson(err));\n defer.reject();\n })\n }\n else {\n entry.entryServerId = '';\n entry.userServerId = global.userServerId;\n insertEntry2(entry,'CREATED').then(function (res) {\n defer.resolve();\n }, function (err) {\n console.error('addEntry insertEntry err = ' + angular.toJson(err));\n defer.reject();\n });\n }\n }\n return defer.promise;\n }", "addEntry(window, url = window.location.href, pushState = undefined) {\n const entry = new Entry(window, url, pushState);\n if (this.current) {\n this.current.append(entry);\n this.current = entry;\n } else {\n this.first = entry;\n this.current = entry;\n }\n this.focus(window);\n }", "function putEntry(data) {\n db.get(\"data_entries_point\").push(data).write();\n}", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function addNote(newNote) {\n allNotes.push(newNote);\n updateNotes(allNotes);\n}", "function add(todoText) {\n let obj = { todo: todoText };\n database.push(obj);\n}", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function speichJournal(){\n $scope.storage.journal = $scope.journal\n }", "function add() {\n\t\tvar item = document.getElementById(\"item\").value;\n\t\t$(\"#entry\").clone(true).appendTo(\"#list\").val('').removeClass(\"hidden\");\n\t\t$('li:last').text(item);\n\t\t}", "addNote () {\n const time = Date.now()\n // Default new note\n const note = {\n id: String(time),\n title: 'New note ' + (this.notes.length + 1),\n content: \"**Hi!** This notebook is using [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) for formatting!\",\n created: time,\n favorite: false,\n }\n // Add to the list\n this.notes.push(note)\n }", "function addItem(){\n // Check to see if there is a value in the input textbox.\n if (inputText.value == \"\"){\n // If so, exit the function.\n return;\n }\n\n // If there is an input, add it to the list.\n // Create a date object.\n let timeStamp = new Date();\n\n // Make a new task object.\n let newTask = {id: timeStamp, content: inputText.value, completed: false};\n\n // Append the object to the array.\n list.push(newTask);\n\n // Print the list again.\n printList();\n\n // Remove the text from the textbox.\n inputText.value = \"\";\n\n // Save the list to local storage.\n saveList(list);\n}", "function addEntryCallback(e) {\n var link = e.target.closest(\"a\");\n var span = link.querySelector(\"span\");\n var resourceName;\n if(span) {\n if(span.classList.contains(\"fp-icon\")) {\n // special case for mod_folder\n resourceName = span.parentElement.textContent.trim();\n } else {\n resourceName = span.firstChild.textContent.trim();\n }\n } else {\n resourceName = link.textContent.trim();\n }\n\n var entry = {\n resourceName: resourceName,\n courseTitle: document.querySelector(\"#page-header\")\n .querySelector(\"h1\").textContent,\n courseID: courseID,\n timestamp: (new Date()).getTime(),\n URL: link.href,\n };\n addEntryToRecentItems(entry);\n }", "function addEntry(int){\n pct = false;\n entries.push(int);\n updateScreen(convertEntries(entries));\n} // addEntry(int)", "function addEntry(entry, callback){\n var id = generateEntryID();\n conn.query('INSERT INTO Entries (entry_id, collection_id, entry_number, author, title, '+\n 'date_submitted, subject, content)' + \n 'VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', \n [\n id,\n entry.collection_id,\n entry.entry_number,\n entry.author, \n entry.title,\n entry.date_submitted,\n entry.subject,\n entry.content\n ]).on('error', console.error).on('end', function() {\n callback(id);\n });\n}", "function addItem( entry ) {\n $http.post( storelist_url, entry ).then(\n function(response) {\n console.log(\"POST success\");\n console.log(response);\n deferred.resolve(response);\n },\n function(error) {\n console.log(\"POST error\");\n deferred.reject(error);\n }\n );\n return deferred.promise;\n }", "async addEntry() {\n\t\tconst { entryType, dateSelected, amount, notes } = this.state;\n\n\t\t//Tests that all entries have been compoleted adequetly\n\t\tif (\n\t\t\t(entryType === 'expense' || entryType === 'revenue') &&\n\t\t\tdateSelected !== '' &&\n\t\t\tamount.trim().length > 0\n\t\t) {\n\t\t\tthis.setState({ isLoading: true });\n\t\t\tconst numAmount = parseFloat(amount);\n\t\t\tawait FirebaseFunctions.call('addEntry', {\n\t\t\t\ttype: entryType,\n\t\t\t\tdate: dateSelected,\n\t\t\t\tamount: numAmount,\n\t\t\t\tnotes: notes,\n\t\t\t\tuserID: this.props.navigation.state.params.userID\n\t\t\t});\n\t\t\t//Resets the fields\n\t\t\tthis.setState({ isLoading: false, isEntryAdded: true, amount: '', notes: '' });\n\t\t} else {\n\t\t\tthis.setState({ fieldsError: true });\n\t\t}\n\t}", "_addItem(e) {\n e.preventDefault();\n e.stopPropagation();\n\n this._$list.append(this._createDefaultEntry(this._numItems));\n this._numItems += 1;\n }", "function addEntry(entries) {\n\n var newUnorderedList = document.createElement('ul');\n var dataViewEntry = document.querySelector('div[data-view=\"entries\"]');\n dataViewEntry.appendChild(newUnorderedList);\n\n var divRow = document.createElement('div');\n divRow.setAttribute('class', 'row');\n newUnorderedList.appendChild(divRow);\n\n var divColumnHalf1 = document.createElement('div');\n divColumnHalf1.setAttribute('class', 'column-half');\n divRow.appendChild(divColumnHalf1);\n\n var liImage = document.createElement('li');\n divColumnHalf1.appendChild(liImage);\n\n var image = document.createElement('img');\n image.setAttribute('src', entries.url);\n image.setAttribute('class', 'dom-tree-image');\n liImage.appendChild(image);\n\n var divColumnHalf2 = document.createElement('div');\n divColumnHalf2.setAttribute('class', 'column-half');\n divRow.appendChild(divColumnHalf2);\n\n var liText = document.createElement('li');\n divColumnHalf2.appendChild(liText);\n\n var heading = document.createElement('h2');\n heading.textContent = entries.title;\n liText.appendChild(heading);\n\n var bodyText = document.createElement('p');\n bodyText.textContent = entries.notes;\n liText.appendChild(bodyText);\n\n return newUnorderedList;\n}", "addToApi() {\n // Invoke the factory function, passing along the form field values to\n const newJournalEntry = renderDom.buildEntry();\n // console.log(\"newJournalEntry\", newJournalEntry)\n API.postJournalEntry(newJournalEntry);\n }", "function addItem(data) {\n console.log(` Adding: ${data.lastName} (${data.owner})`);\n Items.insert(data);\n}", "function addItem(data) {\n console.log(` Adding: ${data.lastName} (${data.owner})`);\n Items.insert(data);\n}", "push(note) {\n this._notes.push(note);\n }", "function addEntry(entry){\n jsfile.readFile(dbFile,(err,data)=>{\n if(!err){\n console.log(\"Read DB Success!\");\n data.push(entry);\n jsfile.writeFile(dbFile,data,(err)=>{\n if(err){\n res.writeHead(200, {'Content-Type': 'text/html'});\n res.write(pug.renderFile('erro.pug',{e: \"Erro: não foi possivel escrever na Base de dados!\"}));\n res.end();\n console.log(\"Added Entry Failure!\");\n }else{\n console.log(\"Added Entry Success!\");\n }\n });\n }else{\n res.writeHead(200, {'Content-Type': 'text/html'});\n res.write(pug.renderFile('erro.pug',{e: \"Erro: na leitura da base de dados!\"}));\n res.end();\n console.log(\"Read DB Failure!\");\n }\n })\n}", "function addNote(note) {\n setNotesList(prevList => { return [...prevList, note] });\n }", "function journalEvent(obj, index) {\n var value = document.querySelector(\"#publication-title > a\");\n window.ScraperExt.push(value.innerHTML);\n nextSearchItem(obj, index + 1);\n}", "getJournal() {\n var journal = this.state.tempChoice.journal || []\n var list = []\n // Break the journal entry up by entry type and push to the return array\n journal.forEach((entry, i) => {\n var title\n if (i === 0) {\n title = 'Training:'\n } else if (i === 1) {\n title = 'Nutrition:'\n } else {\n title = 'Race Day:'\n }\n if (entry) {\n list.push({\n title: title,\n text: entry\n })\n }\n })\n return list\n }", "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "function storeNewEntry() {\r\n dojo.xhrPost({\r\n url: \"/rpc/insert\",\r\n content: {\r\n \"board_id\": boardID,\r\n \"name\": newName,\r\n \"rotations\": newRotations\r\n },\r\n load: storeNewEntrySucceeded,\r\n error: storeNewEntryFailed\r\n });\r\n }", "async add(note) {\r\n let noteObj = await this.notesAccessStore(\"readwrite\");\r\n\r\n return noteObj.add(note)\r\n }", "function addtoLibrary(id, book, authorName, pages, read, list) {\n list.push(new Book(id, book, authorName, pages, read));\n}", "function addEntry(amount, operation) {\n const listEntry = document.createElement(\"li\");\n listEntry.classList.add(operation);\n\n const listEntryValue = document.createElement(\"strong\");\n listEntryValue.innerText = amount + \"$\";\n\n const listEntryDescription = document.createElement(\"em\");\n listEntryDescription.innerText = \"Description\";\n\n const listEntryOperator = document.createElement(\"span\");\n if (operation === \"income\") {\n listEntryOperator.innerText = \"+\";\n } else if (operation === \"expense\") {\n listEntryOperator.innerText = \"-\";\n }\n\n listEntry.appendChild(listEntryDescription);\n listEntry.appendChild(listEntryOperator);\n listEntry.appendChild(listEntryValue);\n\n entryElements.appendChild(listEntry);\n}", "function addEnvelope( envelope ) {\r\n\t\tvar tempList = new Array();\r\n\t\tfor ( var i = 0; i <= this.next; i++ ) {\r\n\t\t\t//copy historylist up to current position\r\n\t\t\ttempList[i] = this.historyList[i];\r\n\t\t}\r\n\t\t//overwrite history list with temp list, thus deleting forward branch\r\n\t\t//this.historyList = tempList;\r\n\t\t//add new entry to history list\r\n\t\tthis.historyList[this.next] = envelope;\r\n\t\t// increase pointers\r\n\t\tthis.next++;\r\n\t\tthis.current++;\r\n\t\tthis.previous++;\r\n\t}", "function addItem(){\r\n\r\n // ************************\r\n // DATE LOG\r\n\r\n //Show list of logs,if it was hidden\r\n if(!logList.classList.contains(\"show\"))\r\n logList.classList.add(\"show\"); \r\n\r\n //Generate a new log form\r\n const newLog = document.createElement(\"article\"); \r\n newLog.classList.add(\"log\");\r\n\r\n //Generate new ID\r\n let id = new Date().getTime(); \r\n newLog.innerHTML = `<!--Info -->\r\n <div class=\"log-info\"> \r\n <h3 class=\"log-text\" data-id=\"${id}\"> Friday 6/19 </h3>\r\n <button class=\"log-btn\">\r\n <i class=\"fa fa-ellipsis-h\"></i>\r\n </button>\r\n </div>\r\n\r\n <!-- Form -->\r\n <form class=\"log-form\">\r\n <input class=\"date-input\" type=\"text\" id=\"log-date\" name=\"log-date\" placeholder=\"Enter date to log: \"> \r\n <button type=\"submit\" class=\"date-submit-btn\">\r\n <i class=\"fa fa-check\"></i>\r\n </button>\r\n </form>\r\n \r\n <!-- Entry -->\r\n <div class=\"entry-container\">\r\n \r\n <!-- Form -->\r\n <form class=\"entry-form\"> \r\n <label for=\"entry-type\"> Pulse type: </label>\r\n <select data-id=\"${id}\" class=\"entry-select\" name=\"entry-type\" id=\"entry-type\">\r\n <option value=\"Active\"> Active </option>\r\n <option value=\"Light Active\"> Light Active </option>\r\n <option value=\"Resting\"> Resting </option> \r\n </select>\r\n\r\n <label class=\"pulse-label\" for=\"pulse-value\"> Pulse: </label>\r\n <input data-id=\"${id}\" type=\"text\" class=\"pulse-input\" name=\"pulse-value\" id=\"pulse-value\" placeholder = \"BPM\">\r\n <button type=\"submit\" class=\"pulse-submit-btn\">\r\n <i class=\"fa fa-check\"></i>\r\n </button>\r\n </form>\r\n\r\n </div>`\r\n ;\r\n\r\n //Add to document\r\n logList.insertBefore(newLog, logList.childNodes[0]);\r\n\r\n //Select form and text entry from newly created log item\r\n const dateForm = newLog.querySelector(\".log-form\"); \r\n const dateFormData = newLog.querySelector(\"#log-date\");\r\n\r\n //Select log info and log text from newly created log item\r\n const logInfo = newLog.querySelector(\".log-info\"); \r\n const logText = newLog.querySelector(\".log-text\"); \r\n \r\n\r\n //Event listener for date form submission \r\n dateForm.addEventListener(\"submit\", (event) =>{\r\n\r\n event.preventDefault(); \r\n\r\n //Get entered value\r\n const enteredDate = dateFormData.value;\r\n \r\n //Replace form with info data\r\n logText.textContent = enteredDate; \r\n dateForm.style.display = \"none\"; \r\n logInfo.classList.add(\"show\"); \r\n\r\n //Add new log to memory \r\n allInputs.push(new currentInput(id, enteredDate));\r\n updateLocalStorage(allInputs); \r\n console.log(\"after adding log item: \"); \r\n console.log(allInputs); \r\n\r\n });\r\n\r\n //Select expand button from newly created log item\r\n const expandBtn = newLog.querySelector(\".log-btn\");\r\n\r\n //Select entry info container\r\n const entryContainer = newLog.querySelector(\".entry-container\"); \r\n\r\n //Event listener for expand button \r\n expandBtn.addEventListener(\"click\", ()=>{\r\n\r\n //Toggle between showing and hiding entry info \r\n entryContainer.classList.toggle(\"show\"); \r\n\r\n });\r\n\r\n\r\n // *********************\r\n // PULSE ENTRY \r\n \r\n //Get form and form data from newly created entry \r\n const pulseForm = newLog.querySelector(\".entry-form\"); \r\n const pulseTypeFormData = newLog.querySelector(\".entry-select\"); \r\n const pulseFormData = newLog.querySelector(\".pulse-input\"); \r\n\r\n\r\n //Event listener for form submission\r\n pulseForm.addEventListener(\"submit\", ()=>{\r\n event.preventDefault(); \r\n\r\n //Get value of pulse type and pulse \r\n const pulseType = pulseTypeFormData.value; \r\n const pulseValue = pulseFormData.value; \r\n\r\n //Generate new id for entry item \r\n entryID = new Date().getTime(); \r\n \r\n // Generate entry item to display \r\n let newEntry = document.createElement(\"div\"); \r\n newEntry.classList.add(\"entry-item\"); \r\n newEntry.innerHTML = `\r\n <p class=\"current-entry\" data-id=\"${entryID}\"> ${pulseType}: ${pulseValue} </p>\r\n <button class=\"remove-btn\"> \r\n <i class=\"fa fa-times\"></i>\r\n </button>`\r\n ;\r\n\r\n\r\n //Select newly created entry to get ID\r\n const currentEntry = newEntry.querySelector(\".current-entry\"); \r\n\r\n //Add new entry to entry container and entries array\r\n entryContainer.insertBefore(newEntry, entryContainer.children[0]);\r\n\r\n //Add entry data to input item of matching id\r\n allInputs = allInputs.map( (item)=>{\r\n\r\n if(item.id == pulseFormData.dataset.id){\r\n item.pulseEntries.push( new pulseEntry(entryID, pulseType, pulseValue)); \r\n }\r\n \r\n return item;\r\n });\r\n\r\n //Update local storage\r\n updateLocalStorage(allInputs); \r\n\r\n console.log(\"after adding pulse entry: \"); \r\n console.log(allInputs);\r\n\r\n //Clear forms\r\n pulseTypeFormData.value = \"\"; \r\n pulseFormData.value = \"\"; \r\n\r\n\r\n //Select delete button\r\n const deleteBtn = newEntry.querySelector(\".remove-btn\"); \r\n\r\n //Event listener for delete button \r\n deleteBtn.addEventListener(\"click\", ()=>{\r\n\r\n //Remove item from page\r\n newEntry.innerHTML = \"\";\r\n \r\n //Remove item from memory \r\n allInputs = allInputs.map( (item)=>{\r\n\r\n //Locate current log item \r\n if(item.id == pulseFormData.dataset.id){\r\n \r\n //Iterate through that items entries, remove the entry that matches the current ID \r\n item.pulseEntries = item.pulseEntries.filter( (item) =>{\r\n\r\n if(item.id == currentEntry.dataset.id){\r\n return !(item.pulseValue == pulseValue && item.pulseType == pulseType); \r\n }\r\n\r\n else\r\n return item; \r\n });\r\n\r\n }\r\n\r\n return item; \r\n });\r\n \r\n //Update local storage\r\n updateLocalStorage(allInputs); \r\n\r\n console.log(\"after removal: \");\r\n console.log(allInputs); \r\n });\r\n\r\n });\r\n\r\n}", "function _add(e) {\n var index = e.getAttribute(\"id\");\n e.getElementsByTagName(\"img\")[0].setAttribute(\"class\", \"liked\");\n \n var entry;\n if (index >= entries.length) {\n entry = preferred[index - entries.length];\n } else {\n entry = entries[index];\n }\n\n if (!containsEntry(toAdd, entry)) {\n toAdd.push(entry);\n e.getElementsByTagName(\"h2\")[0].innerHTML = \"Remove <br> from <br> calendar\";\n e.getElementsByClassName(\"inner\")[0].className += \"show\";\n } else {\n removeEntry(toAdd, entry);\n e.getElementsByTagName(\"h2\")[0].innerHTML = \"Add <br> to <br> calendar\";\n e.getElementsByClassName(\"inner\")[0].className = \"inner four columns \";\n }\n}", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "function addArticleClicked(event){\n addResource(\"article\", this, event)\n }", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function addNewPatronEntry(patron) {\n\n // create a new div class=patron element\n const patronDiv = document.createElement('div');\n patronDiv.classList.add(\"patron\");\n\n // add the proper internal elements\n patronDiv.className = 'patron';\n patronDiv.innerHTML = \"<p>Name: <span>\"+\n patron.name+\"</span></p><p>Card Number: <span>\"+\n patron.cardNumber+\"</span></p><h4>Books on loan:</h4>\"+\n \"<table class='patronLoansTable'><tr><th>BookID</th><th>Title</th>\"+\n \"<th>Status</th>\t<th>Return</th></tr></table>\";\n\n // append this new patronDiv to all the patronEntries on the DOM\n patronEntries.appendChild(patronDiv);\n}", "function addTodo(text) {\n //define todo entry object structure.\n const todo = {\n text,\n checked: false,\n id: Date.now(),\n };\n //add new todo entry to the array collection\n todoItems.push(todo);\n //trigger page update by invoking renderTodo function\n renderTodo(todo);\n}", "function addEntry(amount, operation) {\n const listEntry = document.createElement('li');\n listEntry.classList.add(operation); // adding the corresponding class to the list\n\n const listEntryValue = document.createElement('strong');\n listEntryValue.innerText = `${amount}$`;\n\n const listEntryDescription = document.createElement('em');\n listEntryDescription.innerText = 'Description';\n\n const listEntryOperator = document.createElement('span');\n if (operation === \"expense\") {\n listEntryOperator.innerText = \"-\";\n } else if (operation === \"income\") {\n listEntryOperator.innerText = \"+\";\n }\n \n listEntry.appendChild(listEntryDescription);\n listEntry.appendChild(listEntryOperator);\n listEntry.appendChild(listEntryValue);\n\n entryListElement.appendChild(listEntry);\n}", "addItem(newItemData, listId){\n \n \n let list = _store.State.lists.find(list => list.id == listId)\n\n console.log(_store.State.lists)\n list.items.push(newItemData)\n _store.saveState()\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "push(entry) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.getCurrent() instanceof HistoryEntry_1.default && this.getCurrent().uri === entry.uri) {\n this.entries[this.currentIndex] = entry;\n }\n else {\n this.entries.splice(0, this.currentIndex);\n this.entries.unshift(entry);\n this.currentIndex = 0;\n }\n });\n }", "push(entry) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.getCurrent() instanceof HistoryEntry_1.default && this.getCurrent().uri === entry.uri) {\n this.entries[this.currentIndex] = entry;\n }\n else {\n this.entries.splice(0, this.currentIndex);\n this.entries.unshift(entry);\n this.currentIndex = 0;\n }\n });\n }", "function addItem(id, article, author, words, shares) \n{\n let datenkorbArray = JSON.parse(localStorage.getItem('databasket_js_1')) || []; \n var newItem = \n { \n\t\"id\" : id, \n\t\"article\": article,\n\t\"author\": author, \t\n\t\"words\": words, \n\t\"shares\": shares\n } \n \n //pushs item on a array\n datenkorbArray.push(newItem);\n //saves entry in the localStorage\n localStorage.setItem('databasket_js_2', JSON.stringify(datenkorbArray));\n}", "function updateTrash(list) {\n that.data.lists.push(list);\n }", "add(traktId, item) {\n let history = this._getOrCreateHistory(traktId);\n\n if (!history.items) history.items = [];\n history.items.push(item);\n history.items.sort((a, b) => new Date(b.watched_at).valueOf() - new Date(a.watched_at).valueOf());\n\n this._update(traktId, history.items);\n }", "function addBookToLibrary(bookToAdd) {\n myLibrary.push(bookToAdd);\n updateLocalStorage();\n}", "function addNewAmount(player,amt,descr,str) {\n var d = new Date();\n var sumlist = retrieveSumlist(player);\n sumlist[sumlist.length] = {date:d,amt:amt,desc:descr,store:str};\n //GM_log(\"Storing new entry: \"+d+\" $\"+amt+\", '\"+descr+\"'\");\n storeSumlist(player,sumlist);\n //GM_log(\"Current total: \"+currentSum(sumlist));\n}", "function addListTask(data) {\n listTask.push(data)\n saveData()\n openModal()\n}", "function addItem (value) {\n addItemToDOM(value);\n\n //reset the value after inserting item\n document.getElementById('item').value = '';\n\n //push item into array\n data.todo.push(value);\n\n //update localstorage\n dataObjectUpdated();\n}", "function addNote(note) {\r\n setListNote((prevNote) => {\r\n return [...prevNote, note];\r\n });\r\n }", "function addExpense(expense, index) {\n if (!input.value) {\n return\n } else {\n let expense = input.value;\n var position = \"afterbegin\"\n\n\n const entry = `\n <ul id=\"list\">\n <p>${expense}R$<img src=\"trash.jpg\" id=\"trash\"></p>\n \n </ul>\n\n\n `;\n expenseList.insertAdjacentHTML(position, entry);\n\n\n localStorage.setItem(\"entry_list\", JSON.stringify(entry));\n\n input.value = \"\";\n }\n\n\n\n\n\n\n\n}", "function add_species_entry_to_list() {\n\n var entry_by = 'species';\n document.getElementById(\"harvest_species_form\").addEventListener(\"click\", function(event){\n event.preventDefault()\n });\n\n var harvest = get_harvest_object();\n var validated = is_harvest_valid(harvest);\n\n if (validated) {\n\n harvest_list.push(harvest);\n add_harvest_to_queue_table(harvest, entry_by);\n\n if (!lock) {\n lock = true;\n document.getElementsByName(\"strain\")[0].disabled = true;\n var tableTitle = document.createTextNode(\"HARVEST FOR \\u00A0\" + harvest.strain.toUpperCase());\n document.getElementsByClassName('table-title')[0].appendChild(tableTitle);\n document.getElementsByClassName('table-title')[0].style.display = \"block\";\n }\n\n document.getElementById('harvest_species_form').reset();\n }\n}", "add() {\n if (isValid(this.name) === false) {\n this.displayError(\"Error... Incorrect format\");\n this.utility.setSuccess(FieldList.NON_AUTHOR, false);\n this.utility.setFlow(FieldList.ABSTRACT, false);\n } else { \n var tmpname = \"\" + formatName(this.name)\n\n if (this.set.contains(tmpname) === true) {\n this.displayError(\"Error... Duplicate author\");\n this.utility.setSuccess(FieldList.NON_AUTHOR, false);\n this.utility.setFlow(FieldList.ABSTRACT, false);\n }else {\n this.displayError(\"\");\n this.finalAuthors.push(tmpname);\n this.set.add(tmpname);\n\n this.authors = this.authors + tmpname + \";\"\n this.utility.setSuccess(FieldList.NON_AUTHOR, true);\n this.utility.setFlow(FieldList.ABSTRACT, true);\n }\n }\n }", "function addToCatalogue(){\n\tvar entry = createEntryFromTextbox();\n\tvar entryKey = createCatalogueKey(entry);\n\tsaveEntryToLocalStorage(entry, entryKey);\n\tcreateCatalogueTable();\n}", "function addStation(db, key, lable) {\n // Start a database transaction and get the notes object store\n let tx = db.transaction([\"notes\"], \"readwrite\");\n let store = tx.objectStore(\"notes\");\n // Put the sticky note into the object store\n let estacion = { text: key, timestamp: lable };\n store.add(estacion);\n // Wait for the database transaction to complete\n tx.oncomplete = function() {\n console.log(\"stored note!\");\n };\n tx.onerror = function(event) {\n alert(\"error storing note \" + event.target.errorCode);\n };\n }", "function addItem(e) {\n\t\tif (e.keyCode == 13) {\n\t\t\tsetInputValue(inputValue);\n\t\t\tconst list = inputList.concat(inputValue);\n\t\t\tsetInputList(list);\n\t\t\tsetInputValue(\"\");\n\n\t\t\tfetch(\"https://assets.breatheco.de/apis/fake/todos/user/13\", {\n\t\t\t\tmethod: \"PUT\",\n\t\t\t\tbody: JSON.stringify(list),\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t\t}\n\t\t\t}).then(response => {\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tfetch(\"https://assets.breatheco.de/apis/fake/todos/user/13\")\n\t\t\t\t\t\t.then(response => {\n\t\t\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\t\t\tthrow new Error(response.statusText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn response.json();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(data => setInputList(data))\n\t\t\t\t\t\t.catch(error => console.error(error));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function addTodo(item) {\n todoList.push(item);\n}", "function addTodo(text) {\n //Define todo entry object structure\n const todo = {\n text,\n checked: false,\n id: Date.now(),\n };\n //Add new todo entry to the array collection\n todoItems.push(todo);\n //Trigger page update by (invoking) calling the renderTodo function\n renderTodo(todo);\n}", "function addTodos(todo) {\n todos.push(todo);\n displayTodos();\n}", "function addNote(worker, note) {\n if (note != null) {\n note = datastore.createNote(note);\n worker.port.emit(\"NoteAdded\", note);\n }\n}", "function buildNewEntryButton(journalSelf, entrySelf){\n\tvar button = document.createElement(\"button\");\n\tvar buttonLabel = document.createTextNode(\"Add Entry\");\n\tbutton.appendChild(buttonLabel);\n\n\tbutton.addEventListener('click', function(event){\t\n\t\tvar entriesData = new EntriesData ();\n\t\tvar entriesRelation = currentJournal.data.relation(\"userEntries\");\n\t\tparseInt(currentNumEntries, 10);\n\t\tcurrentNumEntries++;\n\t\tvar newEntryTitle = \"Entry\" + currentNumEntries;\n\t\tnewEntryTitle.toString();\n\t\t\n\t\tentriesData.save({\n\t\t\tentryTitle: newEntryTitle,\n\t\t\tentryText: \"\"\n\t\t}, \n\t\t{\n\t\t\tsuccess: function(results){\n\t\t\t\tconsole.log(\"Created new entry\");\n\t\t\t\tentriesRelation.add(entriesData);\n\t\t\t\tcurrentEntry = entrySelf;\n\t\t\t\tcurrentEntryIndex = 0;\n\t\t\t\tcurrentJournal.data.save(null, {\n\t\t\t\t\tsuccess: function (results){\n\t\t\t\t\t\trefreshEntriesSection(journalSelf, entrySelf);\n\t\t\t\t\t},\n\t\t\t\t\terror:function(error){\n\t\t\t\t\t\talert(\"Something went wrong: error is \" + error.message);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\terror: function(error){\n\t\t\t\tconsole.log(\"Error creating new entry. Error: \" + error);\n\t\t\t}\n\t\t});\n\n\t});\n\tnewEntryButton.appendChild(button);\n}", "function insertTimelineEntryBasedOnDatreOfEntry(entry, timelineEntries){\n\t\t\tfor (var i = 0; i < timelineEntries.length; i++) {\n\t\t\t\tif(entry.dateOfEntry > timelineEntries[i].dateOfEntry){\n\t\t\t\t\t// Insert above current position in timelineEntries\n\t\t\t\t\ttimelineEntries.splice(i, 0, entry);\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t// Add to the end\n\t\t\ttimelineEntries.push(entry);\n\t\t}", "function recordAdded(title, ep) {\n added.push({title: title, ep: ep});\n }", "function addAnnouncements() {\r\n anmtTitle = document.getElementById(\"titleAnmt\").value;\r\n anmtDescr = document.getElementById(\"descrAnmt\").value;\r\n var ul = document.getElementById(\"fullAnnouncements\");\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(anmtTitle + \" : \" + anmtDescr))\r\n ul.appendChild(li);\r\n}", "function storeEntryInLocalStorage(text, amount) {\n let entries;\n if (localStorage.getItem('entries') === null) {\n entries = [];\n } else {\n entries = JSON.parse(localStorage.getItem('entries'));\n }\n entries.push({ inputTxt: text, InputAmnt: amount });\n localStorage.setItem('entries', JSON.stringify(entries));\n}", "function addNewItemToList (listName,targetLocation,entryValue){\t\n\t\tvar noItems, i, j;\n\t\tnoItems = gapi.hangout.data.getValue(listName) || \"0\"; \t\t\t\t\t\t\t\t\t// get current number of list items\n\t\tnoItems = (parseInt(noItems, 10) + 1).toString(); \t\t\t\t\t\t// add 1 to value and convert to string \n\t\tgapi.hangout.data.setValue(listName, noItems);\t\t\t\t\t\t\t\t\t\t\t// Commits new item value\n\t\tj = noItems;\n\t\tfor ( i = noItems; i > targetLocation; i--) {\t\t\t\t\t\t\t\t\t\t\t// loop down moving element values up\n\t\t\tj--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// j in loop always is i + 1\n\t\t\tgapi.hangout.data.setValue(listName + i, gapi.hangout.data.getValue(listName + j));\t// save data in pos j into i\n\t\t}\n\t\t//if(!entryValue){ var entryValue = \"List item \" + targetLocation;};\t\t\t\t\t\t// TESTING if no Value to enter, defult to blank\n\t\tif(!entryValue){ var entryValue = \"\";};\t\t\t\t\t\t\n\t\tgapi.hangout.data.setValue(listName + targetLocation, entryValue); \t\t\t\t\t\t// create textvalue for list item\t\t\t\t\t\n\t\tconsole.log(\"LIST OBJECT \" + noItems + \" Created with value \");\n\t}", "function addTodos(todo) {\n todos.push(todo)\n displayTodos()\n}", "function addTodo(item) {\n todos.push(item);\n displayTodos();\n}" ]
[ "0.71372205", "0.65638274", "0.6483626", "0.64641976", "0.63878584", "0.63791764", "0.62874204", "0.62684035", "0.62009656", "0.61697346", "0.6137324", "0.61347187", "0.6066048", "0.6061513", "0.6051595", "0.60349727", "0.6009567", "0.6007311", "0.5967642", "0.5959905", "0.59596956", "0.5953492", "0.589729", "0.5895375", "0.58901477", "0.57831615", "0.5782076", "0.5769984", "0.57671744", "0.57486683", "0.57322973", "0.5722643", "0.57071006", "0.57047915", "0.56538564", "0.564067", "0.56168145", "0.55803925", "0.5569596", "0.5562836", "0.55619", "0.5561017", "0.55592436", "0.55572563", "0.5547687", "0.5547012", "0.5527979", "0.5521126", "0.55083805", "0.5505351", "0.5503832", "0.5503832", "0.5490807", "0.54850996", "0.547825", "0.5478185", "0.5470883", "0.54675436", "0.54672784", "0.5465742", "0.5461958", "0.5459777", "0.5452207", "0.54428923", "0.54408604", "0.5422552", "0.5421302", "0.53919", "0.53840494", "0.53806615", "0.537546", "0.5370558", "0.5354382", "0.53393793", "0.53393793", "0.5334501", "0.5330635", "0.53279376", "0.53271943", "0.5325426", "0.5322582", "0.53214747", "0.5315883", "0.53148806", "0.53089917", "0.5306713", "0.5305639", "0.53040385", "0.53016704", "0.5299603", "0.5298035", "0.5288332", "0.5284669", "0.52822036", "0.52805096", "0.5277931", "0.5275256", "0.52654064", "0.5265344", "0.52557707", "0.5248995" ]
0.0
-1
create moons and rocks
function createMoons() { let bright = new THREE.MeshBasicMaterial({ color: accentColor }); let dark = new THREE.MeshBasicMaterial({ color: mainColor }); let rockGeometry = new THREE.SphereGeometry(0.05, 20, 20); let moonGeometry = new THREE.SphereGeometry(0.08, 25, 25); let moons = new THREE.Group(); let rock1 = new THREE.Mesh(rockGeometry.clone(), bright); rock1.position.set(-1.3, 0, -0.3); moons.add(rock1); let rock2 = new THREE.Mesh(rockGeometry.clone(), bright); rock2.position.set(-0.9, 0.4, -0.8); moons.add(rock2); let rock3 = new THREE.Mesh(rockGeometry.clone(), bright); rock3.position.set(0.9, -0.2, 0.3); moons.add(rock3); let rock4 = new THREE.Mesh(rockGeometry.clone(), bright); rock4.position.set(0.9, 0.3, -0.8); moons.add(rock4); let rock5 = new THREE.Mesh(rockGeometry.clone(), bright); rock5.position.set(-1.5, 0.2, 0.5); moons.add(rock5); let rock6 = new THREE.Mesh(rockGeometry.clone(), bright); rock6.position.set(-0.9, -0.4, 0.8); moons.add(rock6); let moon1 = new THREE.Mesh(moonGeometry.clone(), dark); moon1.position.set(-1.2, 0.2, -0.7); moons.add(moon1); let moon2 = new THREE.Mesh(moonGeometry.clone(), dark); moon2.position.set(0.5, 0.2, -1.6); moons.add(moon2); let moon3 = new THREE.Mesh(moonGeometry.clone(), dark); moon3.position.set(1.2, 0.2, 0.7); moons.add(moon3); let moon4 = new THREE.Mesh(moonGeometry.clone(), dark); moon4.position.set(-1.5, -0.8, 0.7); moons.add(moon4); return moons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeMoons(lib) {\n for (var i=0;i<7;i++) {\n let newMoon = {\n s: Math.random()*12,\n x: Math.random()*(lib.width),\n y: lib.randomNumber(50, lib.height - 50),\n r: 62+lib.randomNumber(0,50),\n g: 39+lib.randomNumber(0,30),\n b: 35+lib.randomNumber(0,20)\n };\n this.madeMoons.push(newMoon);\n }\n }", "function createMoons(planetType) {\n //each type only has one texture\n var moonTypes = [\n 'volcanic',\n 'ice',\n 'barren',\n 'terran'\n ];\n\n\n var moons = [];\n var moonCount;\n \n if(planetType === 'gas') {\n moonCount = Math.round(rand(3, 6));\n } else if (planetType === 'terran') {\n moonCount = Math.round(rand(1, 2));\n } else {\n moonCount = Math.round(rand(0, 2));\n }\n\n for (var i = 0; i < moonCount; ++i) {\n var moon = {};\n moon.type = Math.round(rand(0, 3));\n moon.distance = i * 100;\n moon.orbit = Math.round((rand(0, 1) * 100)) / 100;\n moons.push(moon);\n }\n}", "function createSeaMonsters(room) {\n const numMonsters = 10;\n room.monsters = [];\n\n for(let i = 0; i < numMonsters; i++) {\n let randomMonsterType = Math.floor( Math.random() * room.monsterTypes.length );\n let newMon = createMonster(randomMonsterType, i, room.averagePlayerLevel);\n\n room.monsters.push( newMon );\n }\n}", "function makeMonster() {\n s = mm(size);\n d1 = mm(descriptor);\n d2 = mm(descriptor2);\n mt = mm(monsterType);\n mw = mm(monWeapon);\n monName = `${s}, ${d1}, ${d2} ${mt}`;\n mHit = getRand(20, 30);\n document.getElementById('enemyHit').innerHTML = `${mHit}`;\n document.getElementById('mName').innerHTML = `${monName}`;\n document.getElementById('mWeapName').innerHTML = `Attack: ${mw}`;\n let n = getRand(1, 5);\n monPhoto = `./assets/monster${n}.jpg`;\n document.getElementById('vilPhoto').src = `${monPhoto}`;\n}", "create() {\n // Load game data\n this.loadGame();\n\n // Set the starting monster\n let index = Math.floor(Math.random() * MONSTERS.length);\n this.setMonster(MONSTERS[index]);\n // Create hp text\n this.hpText = this.add.text(225, 700, \"\");\n // Create the souls text\n this.soulsText = this.add.text(50, 50, \"Souls: 0\", {\n fontSize: '24px',\n color: 'red'\n });\n\n // Create an upgrade icon for the bolt upgrade\n let bolt = this.add.image(400, 50, 'bolt');\n bolt.setScale(3);\n bolt.setInteractive();\n bolt.on('pointerdown', () => {\n // If we have enough money\n if (this.souls >= 5) {\n // pay the money\n this.souls -= 5;\n // gain a level\n this.levels.bolt++;\n }\n });\n // Create an interval to use bolt damage\n setInterval(() => {\n this.damage(this.levels.bolt);\n }, 1000);\n\n // Save button\n let door = this.add.image(50, 750, 'door');\n door.setScale(3);\n door.setInteractive();\n door.on('pointerdown', () => {\n this.saveGame();\n this.scene.start(\"TitleScene\");\n });\n\n // Save every 60s\n setInterval(() => {\n this.saveGame();\n }, 60000);\n // Save once on startup, to set the time\n this.saveGame();\n }", "function buildMoonsGui() {\n // Build the gui for each moon in the array\n moons.forEach(function(moon)\n {\n // Properties for each moon that can be edited by the gui\n moon_properties = {\n size: moon.scale.x,\n colour: moon.userData.colour,\n orbit: moon.userData.orbit,\n speed: moon.userData.speed,\n // Button to show the moon's orbit path and information\n view: function() {\n // Function call to remove the hide button from all folders except current folder\n removeHide();\n // Remove the moon's path outline from the scene if it is in the scene\n if (path!=undefined)\n scene.remove(path);\n // Function call that draws the path of the current moon orbit and stores it in path\n path = drawPath(moon.userData.orbit)\n // Store the path in the moon's user data\n moon.userData.path = path;\n // Add the path onto the moon's center planet\n moon.userData.centreMass.add(path);\n // Set variable to true to indicate a path is in the scene\n path_on = true;\n // Remove the view button from the current folder\n moon_folder.remove(moon.userData.add_button);\n // Set the user data button to undefined\n moon.userData.add_button = undefined;\n // Add the hide button to the gui and store it in the moon's user data\n moon.userData.remove_button = addButton(this, moon_folder, 'hide');\n // Function call to clear the screen of info text\n hideInfo();\n // Function call to show the current moon's info\n showInfo(moon.userData.name, moon.userData.category, moon.userData.desc, moon.userData.colour);\n },\n // Button to hide the moon's orbit path and infomation\n hide: function() {\n // Function call to clear the screen of info text\n hideInfo();\n // Function call to show the welcome menu\n showStartUp();\n // Remove path from the moon's center planet\n moon.userData.centreMass.remove(path);\n // Set variable to false to indicate that there is no path in the scene\n path_on = false;\n // Assign variable to the current moon's path\n path = drawPath(moon.userData.orbit);\n // Store path in planet's user data\n moon.userData.path = path;\n // Remove the hide button from the gui\n moon_folder.remove(moon.userData.remove_button);\n // Set the remove button in user data to undefined\n moon.userData.remove_button = undefined;\n // Add the view button and store the button in moon's user data\n moon.userData.add_button = addButton(this, moon_folder, 'view');\n }\n }\n\n // Add a new folder for the current moon\n var moon_folder = moons_gui.addFolder(moon.userData.name);\n // Store the folder in the moon's userdata\n moon.userData.folder = moon_folder;\n // Store the moon gui properties in userdata\n moon.userData.properties = moon_properties;\n\n // Add gui items to control the moon's colour, size, orbit and speed\n addItemGui(moon_properties, moon_folder, 'colour', moon, true, 0, 0.1);\n addItemGui(moon_properties, moon_folder, 'size', moon, true, 0.1, 5);\n addItemGui(moon_properties, moon_folder, 'orbit', moon, true, 0, 50);\n addItemGui(moon_properties, moon_folder, 'speed', moon, true, 0, 100);\n // Add button to view the moon's orbit and info and store it in userdata\n moon.userData.add_button = addButton(moon_properties, moon_folder, 'view');\n });\n}", "smolMoons (lib){\n for (var i=0;i<7;i++){\n let moon = this.madeMoons[i];\n var size = moon.s;\n lib.moveTo(moon.x, moon.y);\n lib.penRGB(moon.r, moon.g, moon.b);\n let movingLeft = true;\n let behind = false;\n \n if (moon.s < 6) {\n movingLeft = false;\n behind = true;\n }\n \n if (movingLeft) moon.x -= .6;\n else moon.x += .3;\n \n if (behind) lib.dot(size);\n }\n }", "function spawnMob(x) {\n for (i = 0; i < 60; i++) {\n if (i < 10) {\n mobs1.push(new Mob(30, 10, 200 + i * 35, 200, 'red', 0, 0));\n } else if (i < 20) {\n mobs1.push(new Mob(30, 10, 200 + (i - 10) * 35, 185, 'yellow', 0, 0));\n } else if (i < 30) {\n mobs1.push(new Mob(30, 10, 200 + (i - 20) * 35, 170, 'orange', 0, 0));\n } else if (i < 40) {\n mobs1.push(new Mob(30, 10, 200 + (i - 30) * 35, 155, 'magenta', 0, 0));\n } else if (i < 50) {\n mobs1.push(new Mob(30, 10, 200 + (i - 40) * 35, 140, 'indigo', 0, 0));\n } else if (i < 60) {\n mobs1.push(new Mob(30, 10, 200 + (i - 50) * 35, 125, 'brown', 0, 0));\n }\n }\n}", "function createMeteors(){\n for (var i = 0; i < numberOfMeteors; i++) {\n ArrayOfMeteors[i] = new Meteor();\n newX = Math.floor(Math.random()* c.width);\n if (newX < 30){\n ArrayOfMeteors[i].updateX(30);\n }\n else if (newX > c.width) {\n ArrayOfMeteors[i].updateX(c.width - 30);\n }\n else{\n ArrayOfMeteors[i].updateX(newX);\n }\n }\n}", "function createNewMonster() {\n\tcurrentMonster = monsters[Math.floor(Math.random() * monsters.length)];\n\tmonsterLevel = Math.floor(Math.random() * level + 1);\n\t\n\treload();\n}", "function createObjects(){\n\tHangMan.gameReady = true;\n\tHangMan.namesObj = Object.create(gameObj);\n\tHangMan.colorsObj = Object.create(gameObj);\n\tHangMan.statesObj = Object.create(gameObj);\n\tHangMan.namesObj.words = namesArr;\n\tHangMan.colorsObj.words = colorsArr;\n\tHangMan.statesObj.words = statesArr;\n\tHangMan.categories = categories;\n\tfor(i = 0 ; i < HangMan.categories.length ; i++){\n\t\tsetObject(HangMan.categories[i]);\n\t}\n\tvar catIndex = Math.floor(Math.random() * categories.length);\n\t$('#category option:eq(' + catIndex + ')').prop('selected', true)\n\tchangeCategory();\n\tloadObject(categories[catIndex]);\n}", "function create(type) \n{\n if(type == \"wall\")\n {\n var a = randomInRange(canvas.height/2,canvas.height*0.75);\n var wall = {\n x : canvas.width,\n height : a,\n y : existence(0.5) * (canvas.height - a),\n type : \"wall\"\n }\n\n obstacle.push(wall);\n }\n\n else if(type==\"rock\")\n {\n var rock={\n x : canvas.width - wallWidth - 10, //so rock appears behind wall\n y : randomInRange(0.1, 0.9) * canvas.height,\n height : 100,\n type : \"rock\",\n speed : 2 * gameSpeed,\n update : function(){\n this.x -= this.speed;\n }\n }\n obstaclerock.push(rock);\n }\n\n else if (type == \"mario\")\n {\n var a = (1 + randomInRange(0, 0.5)) * canvas.width;\n var b = canvas.height - 100;\n var mar = {\n x : a,\n y : b,\n height : 100,\n type : \"mario\",\n status : 1,\n speed : gameSpeed,\n bullet : {\n c : a + rockWidth / 2,\n d : b,\n bx : gameSpeed,\n by : Math.sqrt(canvas.height) / 2.5,\n radius : 10\n },\n update:function()\n {\n this.x -= this.speed;\n },\n updateBullet:function()\n {\n this.bullet.c -= this.bullet.bx;\n this.bullet.d -= this.bullet.by;\n this.bullet.by -= 0.1;\n var dis = Math.sqrt((this.bullet.c - deep.x) * (this.bullet.c - deep.x) + (this.bullet.d - deep.y) * (this.bullet.d - deep.y))\n if(dis < deep.radius + this.bullet.radius) //kill by bullet hit\n {\n anime = 0;\n gameover = 1;\n }\n },\n }\n mario.push(mar);\n}\n\n }", "function createMobs(game, level) {\n mobs = [];\n mobs = game.add.group();\n mobTypes = getMobTypes();\n for(i=0; i<MOBS_PER_LEVEL && level != START_LEVEL; i++) {\n var mob = mobs.create(getRandomWorldX(game) + 1000, getInitialY(level, game), getMob());\n game.physics.arcade.enable(mob);\n mob.body.bounce.y = 0.5;\n mob.body.gravity.y = getYGravity(level);\n mob.body.velocity.x = getXVelocity(level);\n mob.body.velocity.y = getYVelocity(level);\n mob.body.bounce.y = 0.5 + Math.random() * 0.5;\n mob.outOfBoundsKill = true;\n }\n\n return mobs;\n}", "function setupEndMonster1() {\n\n ufoDots = game.add.group();\n missiles = game.add.group();\n\n for (i = 0; i < 3; i++) {\n\n var redOlive\n\n if (i != 1) {\n redOlive = ufoDots.create(game.world.width * 0.5, game.world.height * 0.5, 'red_olive');\n } else {\n redOlive = ufoDots.create(game.world.width * 0.5, game.world.height * 0.5, 'red_olive_queen');\n }\n\n\n redOlive.animations.add('fly', [0, 1, 2, 3], 5, true);\n redOlive.animations.play('fly');\n }\n\n blocks.children.forEach(function(e) {\n e.kill()\n })\n\n platforms.children.forEach(function(e) {\n e.kill()\n })\n\n diamonds.children.forEach(function(e) {\n e.kill()\n })\n\n // reset to basic texture\n player.loadTexture('dude')\n\n music.stop()\n\n music2 = game.add.audio('music2');\n music2.volume = 0.9;\n music2.loop = true;\n\n //music2.play()\n\n}", "function makeBoard() {\n clearBoard();\n bombsFlagged = 0;\n cellsOpen = 0;\n updateNumBombs();\n // Now place the bombs on the board\n bombsToPlace = maxNumBombs;\n while (bombsToPlace != 0) {\n placeBombRandomLoc();\n bombsToPlace--; } }", "setUpGameObjects() {\n\t\tthis.treesSmall = [];\n\t\tthis.treesLarge = [];\n\t\tthis.treesBare = [];\n\t\tthis.bumpsGroup = [];\n\t\tthis.bumpsSmall = [];\n\t\tthis.bumpsLarge = [];\n\t\tthis.rocks = [];\n\t\tthis.jumps = [];\n\t\tthis.stumps = [];\n\n\t\tthis.calculateGameObjectCount();\n\t\tfor (let n = 0; n < this.gameObjectCount; n++) {\n\t\t\tlet type = this.getRandomGameObjectType();\n\t\t\tthis.spawnNewGameObjectAtStart(type);\n\t\t}\n\t}", "moons (lib){\n for (var i=0;i<7;i++){\n let moon = this.madeMoons[i];\n var size = moon.s;\n lib.moveTo(moon.x, moon.y);\n lib.penRGB(moon.r, moon.g, moon.b);\n let movingLeft = true;\n let behind = false;\n \n if (moon.s < 6) {\n movingLeft = false;\n behind = true;\n }\n \n if (movingLeft) moon.x -= .6;\n else moon.x += .3;\n \n if (!behind) lib.dot(size);\n if (movingLeft && moon.x <= -25) {\n moon.s -= 6;\n moon.y = this.flipFlop(moon.y);\n }\n if (!movingLeft && moon.x >= lib.width + 25) {\n moon.s += 6;\n moon.y = this.flipFlop(moon.y);\n }\n }\n }", "function createSets() {\n self.indoorSet = new self.StoogeSet();\n self.indoorSet.set('name', 'indoor');\n self.desertSet = new self.StoogeSet();\n self.desertSet.set('name', 'desert');\n spec.integrationStore.putModel(self.indoorSet, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n spec.integrationStore.putModel(self.desertSet, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n createLines();\n }\n });\n }\n });\n }", "function create() {\n if (gameState === \"Menu\") {\n menuGroupSetup();\n } else if (gameState === \"Playing\") {\n game.world.removeAll();\n stageGroupSetup();\n entityGroupSetup();\n guiGroupSetup();\n game.sound.setDecodedCallback([monsterLaugh, mainTheme], playIntro);\n } else if (gameState === \"GameOver\") {\n gameOverGroupSetup();\n } else if (gameState === \"Win\") {\n gameWinGroupSetup();\n }\n\n game.input.mouse.capture = true;\n cursors = game.input.keyboard.createCursorKeys();\n }", "function placedMonsterCreator(type, room) {\n var monster = new Location(-1, -1);\n monster.canMove = false;\n monster.terrainType = \"monster\";\n monster.searchable = false;\n monster.color = \"yellow\";\n monster.monsterType = \"\";\n\n if(type === \"golem\") {\n monster.description = \"A golem, much larger than any you've previously seen.\";\n monster.symbol = \"Ώ\";\n monster.monsterType = \"super golem\";\n } else if(type === \"dragon\") {\n monster.description = \"A massive scaled creature slumbers here. Its wings flap a little everytime it takes a breath. The air around the beast shimmers like the air around an intense fire.\"\n monster.symbol = \"♠\";\n monster.monsterType = \"dragon\";\n } else if(type === \"random\") {\n var randomMonster = getMonster();\n monster.description = \"A monster of indeterminate type.\";\n monster.monsterType = \"random\";\n monster.symbol = \"!\";\n }\n\n room.monsters.push(monster);\n}", "function setupTower(){\n //you code here\n for(var i=0; i<6; i++)\n {\n for(var j=0; j<3; j++)\n { \n colors.push(color(0, random(150,255), 0));\n boxes.push(Bodies.rectangle(750+j*80, 0, 80, 80));\n }\n }\n World.add(engine.world, boxes);\n}", "prepAndStartNewGame() {\n this.resetPlayers(Player.TOWN);\n this.assignRoles(this.options.numMafia, this.options.numCops, this.options.numDoctors);\n this.updateRoleCounts();\n this.gameState = MAFIA_TIME;\n }", "function createMover( c ) {\n\n let mover = new Mover();\n mover.position = createVector( 100, 100 );\n mover.mass = random( 0.1, 3.0 );\n mover.col = color( red( c ), green( c ), blue( c ), 100 );\n\n movers.push( mover );\n\n}", "function createMover( c ) {\n\n let mover = new Mover();\n mover.position = createVector( 100, 100 );\n mover.mass = random( 0.1, 3.0 );\n mover.col = color( red( c ), green( c ), blue( c ), 100 );\n\n movers.push( mover );\n\n}", "function buildBoard(){\n\t \t\tvar mineCount = 0;\n\t \t\tfor (var i = 0; i < ROWS; i+=1) {\n\t\t\t\tfor (var j = 0; j < COLS; j+=1) {\n\t\t\t\t\tvar x_shift = Math.floor(0.5*start) + i*stepW;\n\t\t\t\t\tvar y_shift = Math.floor(0.5*start) + j*stepH;\n\t\t\t\t\tvar circleCol = randomColorGenerator(x_shift,y_shift);\n\t\t\t\t\tvar invertedCol = getInvertedColors(circleCol);\n\t\t\t\t\tvar myCircle = new Path.Circle(new Point(x_shift+circleSize,y_shift+circleSize),circleSize).fillColor = circleCol;\n\t\t\t\t\t//initialise space object\n\n\n\t\t\t\t\tvar spaceObj = {\n\t\t\t\t\t\t\t\t\tindex: n, \n\t\t\t\t\t\t\t\t\tcolor: circleCol,\n\t\t\t\t\t\t\t\t\toutline: invertedCol,\n\t\t\t\t\t\t\t\t\tcircleRef: myCircle,\n\t\t\t\t\t\t\t\t\tpos_x: 0, pos_y: 0, \n\t\t\t\t\t\t\t\t\tholdsMine: 0, \n\t\t\t\t\t\t\t\t\tadjacentNeighbours: 0, \n\t\t\t\t\t\t\t\t\tclicked: false,\n\t\t\t\t\t\t\t\t\tflagged: false,\n\t\t\t\t\t\t\t\t\tneighbourIndexList: []\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\tspaceObj.pos_x = x_shift+circleSize;\n\t\t\t\t\tspaceObj.pos_y = y_shift+circleSize;\n\t\t\t\t\tspaceObj.holdsMine = assignMine();\n\n\t\t\t\t\tif(spaceObj.holdsMine){\n\t\t\t\t\t\tmineCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tspaces.push(spaceObj);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tplayerStats.totalMines = mineCount;\n\t\t\tplayerStats.flags = mineCount;\n\t \t}", "function fillmonst(what, awake) {\n var monster = createMonster(what);\n for (var trys = 10; trys > 0; --trys) /* max # of creation attempts */ {\n var x = rnd(MAXX - 2);\n var y = rnd(MAXY - 2);\n //debug(`fillmonst: ${x},${y} ${itemAt(x, y)}`);\n if ((itemAt(x, y).matches(OEMPTY)) && //\n (!player.level.monsters[x][y]) && //\n ((player.x != x) || (player.y != y))) {\n player.level.monsters[x][y] = monster;\n if (awake) monster.awake = awake;\n player.level.know[x][y] &= ~KNOWHERE;\n return monster;\n }\n }\n return null; /* creation failure */\n}", "function initObjects() {\n /* Randomize forest */\n for (var i = 0; i < cattail_count; i++) {\n addCattail();\n }\n /* Randomize Dragonflies */\n for (var i = 0; i < dragonfly_count; i++) {\n addDragonfly();\n }\n /* Randomize Lily Pads */\n for (var i = 0; i < lily_count; i++) {\n g_lilys.push([\n Math.random() * 40 - 20, // x\n Math.random() * 40 - 20, // y\n Math.random() * 360, // rot\n Math.random() + 1, // scale\n ]);\n }\n /* Randomize Logs */\n for (var i = 0; i < log_count; i++) {\n g_logs.push([\n Math.random() * 40 - 20, // x\n Math.random() * 40 - 20, // y\n Math.random() * 360, // rot\n Math.random() * 4 + 4, // scale\n ]);\n }\n /* Randomize Rocks */\n for (var i = 0; i < rock_count; i++) {\n g_rocks.push([\n Math.random() * 40 - 20, // x\n Math.random() * 40 - 20, // y\n Math.random() * 360, // rot\n Math.random() * 2 + 1, // scale\n ]);\n }\n}", "createObjects() {\n\t\tgame.level_frame = 0;\n\t\tlet l = window.app.level.split( '|' ).map( ( a ) => {\n\t\t\treturn a.split( ',' );\n\t\t} );\n\t\tterrain.set();\n\t\tlet obj = {\n\t\t\tw: ( arr ) => { //wait\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 5 ];\n\t\t\t\ts.wait = arr[ 2 ];\n\t\t\t\ts.type = arr[ 6 ];\n\t\t\t\ts.level = arr[ 7 ];\n\t\t\t\ts.amt = arr[ 8 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tu: ( arr ) => { //uplink\n\t\t\t\tgame.a.push( new Plug( 'plug', pInt( arr[ 1 ] ), pInt( arr[ 2 ] ) , arr[ 3 ] ) );\n\t\t\t},\n\t\t\tc: ( arr ) => { //cache\n\t\t\t\t//game.a.push( new GroundCache( ...arr.slice( 1 ) ) );\n\t\t\t\tgame.a.push( new GroundCache( arr[ 1 ], arr[ 2 ], arr[ 3 ], arr[ 4 ] ) );\n\t\t\t},\n\t\t\tp: ( arr ) => { //pause\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.pscds = pInt( arr[ 2 ] );\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\ts: ( arr ) => { //spawn\n\t\t\t\t// [ \"s\", 32, \"c\", \"a\", 1, \"12\" ]\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 2 ];\n\t\t\t\ts.type = arr[ 3 ];\n\t\t\t\ts.level = arr[ 4 ];\n\t\t\t\ts.amt = arr[ 5 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tg: ( arr ) => { //ground\n\t\t\t\tgame.a.push( new GroundTank( 'ground' + arr[ 3 ], arr[ 1 ], arr[ 2 ] ) );\n\t\t\t},\n\t\t\tt: ( arr ) => { //text particle, permanent\n\t\t\t\tgame.a.push( new TextParticle( arr[ 3 ], arr[ 1 ] * 25, arr[ 2 ] * 32, true ) );\n\t\t\t},\n\t\t\tbl: ( arr ) => { //begin level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.blvl = arr[ 2 ];\n\t\t\t\ts.amt = 0;\n\t\t\t\ts.y = pInt( arr[ 1 ] );\n\t\t\t\ts.x = 0;\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tsl: ( arr ) => { //end level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.elvl = arr[ 2 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t}\n\t\t};\n\n\t\tl.forEach( ( arr ) => {\n\t\t\tobj[ arr[ 0 ] ]( arr );\n\t\t} );\n\t}", "function startTurn(room, gameStart = false) {\n console.log(\"Starting turn in room \" + room)\n\n let curRoom = rooms[room]\n\n /* \n\n DAY/NIGHT CYCLE\n \n */\n curRoom.turnCount++;\n\n if(curRoom.turnCount % 10 == 0) {\n curRoom.dayTime = !curRoom.dayTime;\n }\n\n /* \n\n == Update MONITORS ==\n \n Each monitor should have the world situation updated. This means\n => New position (and orientation) for all units (ships and sea monsters)\n => New deals at the docks\n => ...\n\n In many cases, only information that has _CHANGED_ is sent. \n \n */\n\n // variable that will hold the monitor package (thus mPack)\n let mPack = {}\n\n /*\n\n This is where GAME INITIALIZATION takes place\n\n The comments speak for themselves. \n It simply creates the map and everything on it, including resources, docks (and their trading routes), etc.\n\n */\n if(gameStart) {\n // send the map seed\n mPack[\"mapSeed\"] = curRoom.mapSeed;\n\n mPack[\"config\"] = curRoom.config;\n\n mPack[\"treasures\"] = curRoom.treasures;\n\n // create the actual BASE MAP (sea and islands)\n createBaseMap(curRoom)\n\n // discover ISLANDS\n // these only need to be saved inside the map (for each tile that's part of an island, save its island index)\n // this function also adds a DOCK to each island\n discoverIslands(curRoom)\n\n // plant TREASURES\n createTreasures(curRoom);\n\n // create routes between docks\n // save the routes themselves within the dock\n // create an AI ship for each dock, pick a random route, place the ship at the start of the route\n createDockRoutes(curRoom);\n\n // create all monsters (individual array)\n createSeaMonsters(curRoom);\n\n // distribute MONSTERS and PLAYERS (both already have their individual array; update that and now place them inside the map)\n distributeStartingUnits(curRoom);\n\n // add ALL this information to the \"mPackage\": the seed, the drawings of creatures/ships, dock position, etc.\n\n // send the drawings (include FLAG and PLAYER DRAWINGS ??)\n mPack[\"monsterDrawings\"] = curRoom.monsterDrawings;\n mPack[\"shipDrawings\"] = curRoom.shipDrawings;\n mPack[\"aiShipDrawings\"] = [];\n\n // send the units\n // TO DO: Only send the information we need: the type (for displaying the drawing) and their location (perhaps orientation)\n // TO DO: Later on, we need to send the dock deals, and which islands have been discovered\n mPack[\"docks\"] = curRoom.docks;\n mPack[\"cities\"] = curRoom.cities;\n\n mPack[\"monsters\"] = curRoom.monsters;\n mPack[\"aiShips\"] = curRoom.aiShips;\n mPack[\"playerShips\"] = curRoom.playerShips;\n } else {\n // send UPDATED information about all units\n // => their new position\n // => ?? anything else ??\n mPack[\"monsters\"] = curRoom.monsters;\n mPack[\"aiShips\"] = curRoom.aiShips;\n mPack[\"playerShips\"] = curRoom.playerShips;\n\n mPack[\"discoveredTiles\"] = curRoom.discoveredTiles;\n }\n\n // send the mPack to all monitors\n sendSignal(room, true, 'pre-signal', mPack, true)\n\n\n\n\n /* \n\n == Update PLAYERS ==\n\n Each player should have updated information - BUT ONLY FOR THEIR ROLES\n For each player, a \"package\" is put together that contains only what this player needs (based on his roles)\n This puts slightly more strain on the server, but limits internet traffic significantly (and thus increases speed)\n\n pPack = \"player package\" \n\n (didn't want to do this, but had some trouble with reserved words and all)\n\n */\n\n // loop through all ships\n // some information only needs to be determined ONCE per ship\n // => adjacency checks (next to a dock? next to an undiscovered island?)\n // => cartographer checks (enemies within range?)\n for(let i = 0; i < curRoom.playerShips.length; i++) {\n let curShip = curRoom.playerShips[i];\n\n let islandsWeAlreadyChecked = {};\n let captainTasks = [];\n\n // arbitrary exploration (if the ship is going slow enough, you can explore your current tile)\n if(curShip.speed <= 1) {\n captainTasks.push([6, null])\n }\n\n // == ADJACENCY (CAPTAIN) STUFF ==\n // check the tiles left/right/top/bottom\n const positions = [[-1,0],[1,0],[0,1],[0,-1]];\n for(let j = 0; j < 4; j++) {\n // get tile\n let xTile = wrapCoords(curShip.x + positions[j][0], curRoom.mapWidth);\n let yTile = wrapCoords(curShip.y + positions[j][1], curRoom.mapHeight);\n\n let curTile = curRoom.map[yTile][xTile]\n\n // check against TASK CONDITIONS\n\n // island discovery; if it's an island, get its index, check if it's already been discovered\n if(isIsland(curTile)) {\n const ind = curTile.island;\n // if it hasn't been discovered, AND it's not an island we're currently discovering (the ship can touch multiple tiles of the same island at once)\n // send a task to discover an island (\"1\"), and send WHICH island we're discovering\n if(!curRoom.islands[ind].discovered && !(ind in islandsWeAlreadyChecked) ) {\n captainTasks.push([1,ind]);\n islandsWeAlreadyChecked[ind] = true;\n }\n }\n\n // dock (if undiscovered, name it; if discovered, you can trade)\n if(hasDock(curTile)) {\n const ind = curTile.dock;\n\n // if the dock hasn't been discovered yet, discover it!\n if(!curRoom.docks[ind].discovered) {\n // send index to captain, including task type (\"3\")\n captainTasks.push([3, ind]);\n } else {\n // send the deal to the captain\n // get the deal\n const deal = curRoom.docks[ind].deal\n\n // send the message type (\"trade with dock\"), the deal, and the dock index\n captainTasks.push([2, { deal: deal, index: ind }]);\n } \n }\n\n // city (if undiscovered, name it; if discovered, you can ask around for clues)\n if(hasCity(curTile)) {\n const ind = curTile.city;\n\n // if the city hasn't been discovered yet, discover it!\n if(!curRoom.cities[ind].discovered) {\n captainTasks.push([4, ind]);\n } else {\n // tell captain that he can \"ask around/look around\"\n captainTasks.push([5, ind]);\n }\n }\n }\n\n // == CARTOGRAPHER STUFF ==\n // Get the map range AND what units are visible\n const tempUpgradeEffects = UPGRADE_EFFECT_DICT[2][curShip.roleStats[2].lvl];\n let mapSize = tempUpgradeEffects.range * 2 + 1;\n let detailLvl = tempUpgradeEffects.detail;\n\n // Loop through these tiles to find all units within them\n // Generate a 2D array with a \"personalized\" view of all the units\n curShip.personalUnits = [];\n let transX = curShip.x - Math.floor(0.5*mapSize), transY = curShip.y - Math.floor(0.5*mapSize);\n \n // The client only needs to know what image to display and where to display it. (Cartographer doesn't even need dock deals, for example.)\n // => The \"where\" is in the \"x\" and \"y\" values\n // => The \"which drawing is it\" is in the index\n // It's created as a flat 1D array, because that is probably more efficient. (There'll probably only be a few units around you, so no need for a large 2D array.)\n\n let enemiesInRange = false;\n for(let y = 0; y < mapSize; y++) {\n for(let x = 0; x < mapSize; x++) {\n // transform coordinates so that our ship is centered\n let xTile = wrapCoords(x + transX, curRoom.mapWidth);\n let yTile = wrapCoords(y + transY, curRoom.mapHeight);\n\n let mapTile = curRoom.map[yTile][xTile];\n\n // TO DO: Based on \"detailLvl\", send more or less info about a particular object (like orientation, last known speed, etc.)\n\n // if this tile has a dock, add it\n // NOTE: The \"index\" parameter here is only used for unique images (right now, all docks and cities look the same)\n if(mapTile.dock != null) {\n let dir = determineSpriteDirection(curRoom, xTile, yTile);\n curShip.personalUnits.push({ myType: 3, index: 0, dir: dir, x: x, y: y });\n }\n\n // if this tile has a city\n if(mapTile.city != null) {\n let dir = determineSpriteDirection(curRoom, xTile, yTile);\n curShip.personalUnits.push({ myType: 4, index: 0, dir: dir, x: x, y: y});\n }\n\n // if this tile has no units (which we keep track of), immediately continue\n if(!mapTile.hasUnits) {\n continue;\n }\n\n // if this tile has ai ships, add them\n if(mapTile.aiShips.length > 0) {\n // send the type of this object AND the drawing index (or \"AI type\")\n for(let aa = 0; aa < mapTile.aiShips.length; aa++) {\n const myIndex = mapTile.aiShips[aa];\n curShip.personalUnits.push({ myType: 2, index: curRoom.aiShips[myIndex].myShipType, x: x, y: y });\n enemiesInRange = true;\n }\n }\n\n // if this tile has monsters, add them\n if(mapTile.monsters.length > 0) {\n for(let aa = 0; aa < mapTile.monsters.length; aa++) {\n const myIndex = mapTile.monsters[aa];\n curShip.personalUnits.push({ myType: 1, index: curRoom.monsters[myIndex].myMonsterType, x: x, y: y });\n enemiesInRange = true;\n }\n }\n\n // if this tile has player ships, add them\n if(mapTile.playerShips.length > 0) {\n for(let aa = 0; aa < mapTile.playerShips.length; aa++) {\n const myIndex = mapTile.playerShips[aa];\n if(myIndex == curShip.num) { continue; } // if this is our own ship, ignore it\n curShip.personalUnits.push({ myType: 0, index: curRoom.playerShips[myIndex].num, x: x, y: y });\n enemiesInRange = true;\n }\n }\n }\n }\n\n // This checks if we can fire or not (and sends the captain that task, if so)\n // If we can see enemies in our vicinity, the fire button appears\n if(enemiesInRange) {\n captainTasks.push([0,0])\n curShip.captainCanFire = true;\n } else {\n curShip.captainCanFire = false;\n }\n\n // add our own ship to personalUnits\n // NOTE: This is done AFTER the previous code, because otherwise we'd need to subtract our own ship there\n // TO DO: Actually, we don't need this. We can just save our own drawing on the client and display our own ship, as we're already sending x and y coordinates\n curShip.personalUnits.push({ myType: 0, index: curShip.num, x: Math.floor(mapSize*0.5), y: Math.floor(mapSize*0.5) });\n\n curShip.captainTasks = captainTasks;\n }\n\n // loop through all players\n for(let playerID in curRoom.players) {\n let curPlayer = curRoom.players[playerID]\n let curShip = curRoom.playerShips[curPlayer.myShip]\n\n let pPack = {}\n\n // if this is the first turn, send the basic info (ship title, flag)\n // Health isn't necessary (always starts at 100%)\n // Instrument level (before upgrades) isn't necessary (all instruments start at level 1)\n if(gameStart) {\n pPack[\"shipTitle\"] = curShip.shipTitle;\n pPack[\"shipFlag\"] = curShip.shipFlag;\n\n pPack[\"config\"] = curRoom.config;\n\n // if preparation was skipped, we need to resend the essential information\n if(curRoom.prepSkip) {\n pPack[\"myShip\"] = curPlayer.myShip;\n pPack[\"myRoles\"] = curPlayer.myRoles;\n }\n } else {\n // on every turn EXCEPT the first, all players receive ship health\n pPack[\"health\"] = curShip.health;\n }\n\n // check this player's roles\n let rList = curPlayer.myRoles;\n for(var i = 0; i < rList.length; i++) {\n let role = rList[i];\n\n switch(role) {\n // Captain\n case 0:\n // replenish crew\n // REMEMBER: curShip.workingCrew is the total crew number \n // => curShip.resources only contains the current resources, with allocated stuff subtracted\n // REMEMBER: peddle crew cost is permanent\n // => Every lvl costs 2 crew, until you \"release\" them \n curShip.resources[1] = (curShip.workingCrew - curShip.roleStats[3].peddleLvl*2);\n\n // (Basic) Ship resources (gold, crew, wood, gun powder)\n pPack[\"resources\"] = curShip.resources;\n\n // List of current tasks\n pPack[\"taskList\"] = curShip.captainTasks;\n\n // List of (feedback) messages\n pPack[\"errorMessages\"] = curShip.errorMessages;\n\n // if we can fire, calculate the cost of firing\n if(curShip.captainCanFire) {\n // without cannoneer, just set crew to the average level of all basic roles\n let cannoneerInGame = false;\n let firingCosts = Math.ceil( (curShip.roleStats[1].lvl + curShip.roleStats[2].lvl + curShip.roleStats[3].lvl + 1) / 3 ); \n\n // if there is a cannoneer in the game, the calculation becomes different\n if(cannoneerInGame) {\n // reduce function calculates the number of cannons (positive loads), multiplies by (half) the current weaponeer value\n let numCannons = curShip.cannons.reduce(function(tot, cur) { if(cur >= 0) { return tot + 1; } else { return tot; } }, 0)\n firingCosts = Math.round((curShip.roleStats[4].lvl + 1) / 2) * numCannons;\n }\n\n pPack[\"firingCosts\"] = firingCosts;\n }\n \n break;\n\n // First Mate\n case 1:\n // Send current ship orientation (and previous orientation), only at game start\n if(gameStart) {\n pPack[\"orientation\"] = curShip.orientation;\n pPack[\"oldOrientation\"] = curShip.orientation;\n }\n \n break;\n\n // Cartographer\n case 2:\n // Only at game start, send initial map information (like the seed and some drawings)\n if(gameStart) {\n pPack[\"mapSeed\"] = curRoom.mapSeed;\n\n // send all drawings in advance (this includes our own ship's drawing)\n // TO DO: AI Ships drawings. (Right now, you can't draw your own AI ship, but that might change)\n pPack['monsterDrawings'] = curRoom.monsterDrawings;\n pPack['shipDrawings'] = curRoom.shipDrawings;\n pPack['aiShipDrawings'] = [];\n }\n\n // send the whole unit thing to the client (determined beforehand in the SHIP LOOP)\n // he saves it in mapUnits, should display it properly on his map\n pPack[\"mapUnits\"] = curShip.personalUnits;\n\n // Send our own location\n // ?? This is also send along with the other units, BUT if we send it ourselves, we don't have to search for it!\n pPack[\"x\"] = curShip.x;\n pPack[\"y\"] = curShip.y;\n break;\n\n // Sailor\n case 3:\n // The sailor DOES need to know the peddle/sail setting => there might have been a crew deficit\n // The client checks if a property starts with \"roleStats\". If so, it gets the corresponding array => [roleNum, property, newValue]\n pPack[\"speed\"] = curShip.speed;\n pPack[\"roleStatsSail\"] = [3, 'sailLvl', curShip.roleStats[3].sailLvl];\n pPack[\"roleStatsPeddle\"] = [3, 'peddleLvl', curShip.roleStats[3].peddleLvl];\n break;\n\n // Cannoneer\n case 4:\n // Send the correct cannon load (just a number, negative means the cannon hasn't been bought yet)\n pPack[\"shipCannons\"] = curShip.cannons;\n break;\n }\n\n // If this role was upgraded last turn, solidify the upgrade (this is true for ALL roles)\n // Send the new level back to the role\n if(curShip.roleStats[role].lvlUp) {\n pPack[\"roleUpdate\" + role] = role;\n curShip.roleStats[role].lvlUp = false;\n }\n }\n\n // send the whole package (to this specific player)\n sendSignal(room, false, 'pre-signal', pPack, true, true, playerID);\n }\n\n // if it isn't the start of the game (which would INSTEAD mean a \"state switch\" to the Play state) ...\n if(!gameStart) {\n // ... tell everyone (both monitors and controllers) to start the new turn\n sendSignal(room, false, 'new-turn', {}, false, false)\n sendSignal(room, true, 'new-turn', {}, false, false)\n }\n\n}", "function createAsteroids() {\n\n\n var rdn = Math.floor(Math.random()*4)+1;\n var otherAsteroid;\n\n if (isChoque==false && banderaPausa ==false) {\n\n switch (rdn) {\n\n case 1:\n otherAsteroid = asteroids.create(25, -100,\"asteroide_izquierda_grande\").body.setCircle(110);\n counAsteroids++;\n break;\n case 2:\n otherAsteroid = asteroids.create(randomNum(100,200), -140,\"asteroide_derecha_pequeño\").body.setCircle(80);\n counAsteroids++;\n break; \n case 3:\n otherAsteroid = asteroids.create(randomNum(160,260), -200,\"asteroide_izquierda_pequeño\").body.setCircle(80);\n counAsteroids++;\n break; \n case 4:\n otherAsteroid = asteroids.create(335, -220,\"asteroide_derecha_grande\").body.setCircle(110);\n counAsteroids++;\n break; \n \n default:\n \n break;\n }\n otherAsteroid.setVelocity(0,40);\n \n }\n\n }", "function loadCrews() {\t\n\t\tonDeck.nextCrew();\n\t\tonDeck.nextCrew();\n\t\tstation1.nextCrew();\t\t\n\t}", "generateShrooms(num) {\n for (i=0; i<num; i++) {\n const shroom = $('<img src=\"images/Mushroom.png\"/>');\n shroom.css('max-height', '80px');\n const left = (Math.random()*1000) + 'px';\n const top = (Math.random()*500) + 'px';\n shroom.css('margin-left', left);\n shroom.css('margin-top', top);\n $('.mushroom-container').append(shroom);\n let typeOfShroom = Math.random();\n if (typeOfShroom < .6) {\n shroom.addClass('normal');\n } else if ((typeOfShroom >= .6) && (typeOfShroom <.92)) {\n shroom.addClass('magic');\n } else if (typeOfShroom >= .92) {\n shroom.addClass('poisonous');\n }\n }\n }", "function setupActors() {\n //Create player\n player = new Player();\n\n // Create kids based on numberOfKids wanted using a for loop,\n // add them to the array\n for (let i = 0; i < numberOfKids; i++) {\n spawnKid();\n }\n // Create trash on a random location within the center tiles of the game\n trash = new Trash(floor(random(0, 15)), floor(random(2, 7)));\n}", "static createMetaGroudonQuestLine() {\n const metaGroudonQuestLine = new QuestLine('A Meta Discovery', 'Help Butler\\'s wish come true, responsibly.', new MultiRequirement([new ObtainedPokemonRequirement('Groudon'), new QuestLineCompletedRequirement('Wish Maker')]), GameConstants.BulletinBoards.Hoenn);\n const talkToButler2 = new TalkToNPCQuest(Butler2, 'Talk to Butler in the Jagged Pass to learn about his new plan.');\n metaGroudonQuestLine.addQuest(talkToButler2);\n const butlerMaterials1 = new CaptureSpecificPokemonQuest('Electrode', 'Catch or hatch 100 Electrode', 100, true);\n const butlerMaterials2 = new MineLayersQuest(25, 0);\n const butlerMaterials3 = new CatchShiniesQuest(3, 0);\n metaGroudonQuestLine.addQuest(new MultipleQuestsQuest([\n butlerMaterials1,\n butlerMaterials2,\n butlerMaterials3,\n ], 'Gather the materials Butler needs to rebuild his resurrection machine.'));\n const calibrateMachine = new CaptureSpecificPokemonQuest('Groudon', 'Calibrate the machine by catching or hatching 5 Groudon', 5, true);\n metaGroudonQuestLine.addQuest(calibrateMachine);\n const MetaGroudonReward = () => {\n App.game.party.gainPokemonByName('Meta Groudon');\n Notifier.notify({\n title: metaGroudonQuestLine.name,\n message: 'Butler turns control of Meta Groudon over to you!',\n type: NotificationConstants.NotificationOption.success,\n timeout: 3e4,\n });\n };\n const talkToButler3 = new TalkToNPCQuest(Butler3, 'Deliver the materials to Butler in the Jagged Pass and start the resurrection machine.', MetaGroudonReward);\n metaGroudonQuestLine.addQuest(talkToButler3);\n App.game.quests.questLines().push(metaGroudonQuestLine);\n }", "function createBuildings() {\n for (let i = 0; i < 4; i++) {\n buildings.push(\n CreateGameElement(\n SHIP.width * 1.5,\n SHIP.height * 1.2,\n 65 + 175 * i,\n C_HEIGHT - 130,\n 0,\n BUILDING_IMG,\n 0\n )\n );\n }\n}", "function Create() {\n\n\n //===================================================================\n var r = new Rule1();\n r.init({conditions: function(scene){\n return !(scene.objects['first_text'].isVisible);},\n\n actions: function(scene){\n var o = scene.objects['first_text'];\n o.isVisible = true;\n fadeIn(o.sprite, 1000, function(){\n fadeOut(o.sprite, 1000,\n function(){\n scene.game.scenes['title'].deactivate();\n scene.game.scenes['toll'].activate()}\n )});\n }\n });\n\n var scene1 = new Scene1();\n var text = new Object1()\n\n text.init({name : 'first_text',\n text : 'As I walked in the mountain, \\n'+\n ' I finally found that secret place \\n'+\n 'known by very few...',\n x:0.1,\n y:0.1});\n scene1.init(game, {name:'title',\n objects: [text],\n rules: [r]});\n\n\n //===================================================================\n\n var r2 = new Rule1();\n r2.init({conditions: function(scene){\n var o1 = scene.game.scenes['title'].objects['first_text'];\n var o2 = scene.objects['toll'];\n return (o2.sprite.alpha ==0 && o1.sprite.alpha==0); },\n\n actions: function(scene){\n // The room appears\n var o = scene.objects['toll'];\n o.animate();\n fadeIn(o.sprite, 1000)\n }\n });\n\n var scene2 = new Scene1();\n var toll = new Object1();\n\n map = {name: 'tollMap',\n 'blue': function(scene){\n addDialog('Ladies enjoying the moment...')\n },\n 'red': function(scene){\n addDialog('Nice waterfall...')\n\n console.log(scene.game.scenes);\n scene.game.scenes['toll'].deactivate();\n scene.game.scenes['title'].objects['first_text'].isVisible = false;\n scene.game.scenes['title'].objects['first_text'].sprite.alpha = 0;\n fadeOut(scene.game.scenes['toll'].objects['toll'].sprite, 3000,\n function(){scene.game.scenes['passerelle'].activate()});\n },\n 'green': function(){addDialog('Pristine pond')},\n 'yellow': function(){addDialog('Young men hanging out...')}\n }\n\n toll.init({name: 'toll',\n image: 'toll',\n map: map,\n x:0,\n y:0,\n w:1\n })\n scene2.init(game, {name: 'toll',\n objects: [toll],\n rules: [r2]});\n scene1.activate();\n\n //===================================================================\n var r3 = new Rule1();\n r3.init({conditions: function(scene){\n var o1 = scene.game.scenes['toll'].objects['toll'];\n var o2 = scene.objects['passerelle'];\n return (o2.sprite.alpha ==0 && o1.sprite.alpha==0); },\n\n actions: function(scene){\n // The room appears\n var o = scene.objects['passerelle'];\n fadeIn(o.sprite, 1000)\n }\n });\n map = {name: 'passerelleMap',\n 'blue': function(scene){\n addDialog(\"Don't walk aside...\")\n },\n 'red': function(scene){\n addDialog('Splash !')\n\n console.log(scene.game.scenes);\n scene.game.scenes['passerelle'].deactivate();\n fadeOut(scene.game.scenes['passerelle'].objects['passerelle'].sprite, 3000,\n function(){scene.game.scenes['cam'].activate()});\n }\n }\n var scene3 = new Scene1();\n var passerelle = new Object1();\n passerelle.init({name:'passerelle',\n image:'passerelle',\n map: map,\n x:0, y:0, w:1})\n scene3.init(game, {name:'passerelle', objects:[passerelle], rules:[r3]})\n\n //===================================================================\n var r3 = new Rule1();\n r3.init({conditions: function(scene){\n var o1 = scene.game.scenes['passerelle'].objects['passerelle'];\n var o2 = scene.objects['cam'];\n return (o2.sprite.alpha ==0 && o1.sprite.alpha==0); },\n\n actions: function(scene){\n // The room appears\n var o = scene.objects['cam'];\n fadeIn(o.sprite, 1000)\n }\n });\n map = {name: 'camMap',\n 'blue': function(scene){\n addDialog(\"Nothing important here\")\n },\n 'red': function(scene){\n addDialog('Nice movie !')\n\n console.log(scene.game.scenes);\n scene.game.scenes['cam'].deactivate();\n fadeOut(scene.game.scenes['cam'].objects['cam'].sprite, 3000,\n function(){scene.game.scenes['night'].activate()});\n }\n }\n var scene3 = new Scene1();\n var cam = new Object1();\n cam.init({name:'cam',\n image:'cam',\n map: map,\n x:0, y:0, w:1})\n scene3.init(game, {name:'cam', objects:[cam], rules:[r3]})\n //===================================================================\n var r3 = new Rule1();\n r3.init({conditions: function(scene){\n var o1 = scene.game.scenes['cam'].objects['cam'];\n var o2 = scene.objects['night'];\n return (o2.sprite.alpha ==0 && o1.sprite.alpha==0); },\n\n actions: function(scene){\n // The room appears\n var o = scene.objects['night'];\n fadeIn(o.sprite, 1000)\n }\n });\n map = {name: 'nightMap',\n\n 'blue': function(scene){\n addDialog('Nice star !')\n\n console.log(scene.game.scenes);\n scene.game.scenes['night'].deactivate();\n fadeOut(scene.game.scenes['night'].objects['night'].sprite, 3000,\n function(){scene.game.scenes['guitare'].activate()});\n }\n }\n var scene3 = new Scene1();\n var cam = new Object1();\n cam.init({name:'night',\n image:'night',\n map: map,\n x:0, y:0, w:1})\n scene3.init(game, {name:'night', objects:[cam], rules:[r3]})\n //===================================================================\n var r3 = new Rule1();\n r3.init({conditions: function(scene){\n var o1 = scene.game.scenes['night'].objects['night'];\n var o2 = scene.objects['guitare'];\n return (o2.sprite.alpha ==0 && o1.sprite.alpha==0); },\n\n actions: function(scene){\n // The room appears\n var o = scene.objects['guitare'];\n fadeIn(o.sprite, 1000)\n }\n });\n map = {name: 'guitareMap',\n 'blue': function(scene){\n addDialog('Que guapo !')\n //console.log(scene.game.scenes);\n //scene.game.scenes['night'].deactivate();\n //fadeOut(scene.game.scenes['guitare'].objects['guitare'].sprite, 3000,\n // function(){scene.game.scenes['guitare'].activate()});\n }\n }\n var scene3 = new Scene1();\n var cam = new Object1();\n cam.init({name:'guitare',\n image:'guitare',\n map: map,\n x:0, y:0, w:1})\n scene3.init(game, {name:'guitare', objects:[cam], rules:[r3]})\n\n}", "function Spawning()\n{\n for (var name in Memory.creeps)\n {\n if (!Game.creeps[name])\n {\n delete Memory.creeps[name];\n }\n }\n\n var controllerLevel = 0;\n\n for (var name in Game.rooms)\n {\n controllerLevel = controllerLevel + Game.rooms[name].controller.level;\n }\n\n var harvesters = _.filter(Game.creeps, (creep) => creep.memory.role == 'harvester');\n\n if (harvesters.length < 4)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, CARRY, MOVE], undefined, { role: 'harvester' });\n }\n\n var builders = _.filter(Game.creeps, (creep) => creep.memory.role == 'builder');\n\n if (builders.length < 3)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, MOVE], undefined, { role: 'builder' });\n }\n\n var upgraders = _.filter(Game.creeps, (creep) => creep.memory.role == 'upgrader');\n\n if (upgraders.length < 2)\n {\n Game.spawns.Main.createCreep([WORK, CARRY, MOVE], undefined, { role: 'upgrader' });\n }\n\n var guards = _.filter(Game.creeps, (creep) => creep.memory.role == 'guard');\n\n if (guards.length < 6)\n {\n Game.spawns.Main.createCreep([MOVE, MOVE, ATTACK, TOUGH, TOUGH, TOUGH, TOUGH, TOUGH], undefined, { role: 'guard' });\n }\n}", "function mobCreator (mobInfo){\n this.name = mobInfo.name;\n this.hp = mobInfo.hp;\n this.maxHp = mobInfo.maxHp;\n this.attack = mobInfo.attack;\n this.attackDesc = mobInfo.attackDesc;\n this.atkMod = 0;\n this.desc = mobInfo.desc;\n this.dead = false;\n this.type = 'monster';\n this.loot = mobInfo.loot;\n mobs.push(this);\n }", "function itemPlacer(runCreator) {\n if(runCreator) {\n doorCreator(1, room);\n chestCreator(3, room);\n waterCreator(5, room);\n lavaCreator(4, room);\n spikeCreator(2, room);\n placedMonsterCreator(\"random\", room);\n }\n room.doors[0].y = 0;\n room.doors[0].x = 5;\n room.chests[0].y = 3;\n room.chests[0].x = 1;\n room.chests[1].y = 5;\n room.chests[1].x = 7;\n room.chests[2].y = 8;\n room.chests[2].x = 3;\n room.waters[0].y = 1;\n room.waters[0].x = 1;\n room.waters[1].y = 2;\n room.waters[1].x = 1;\n room.waters[2].y = 2;\n room.waters[2].x = 2;\n room.waters[3].y = 4;\n room.waters[3].x = 1;\n room.waters[4].y = 4;\n room.waters[4].x = 2;\n room.lavas[0].y = 7;\n room.lavas[0].x = 5;\n room.lavas[1].y = 7;\n room.lavas[1].x = 4;\n room.lavas[2].y = 8;\n room.lavas[2].x = 5;\n room.lavas[3].y = 8;\n room.lavas[3].x = 4;\n room.monsters[0].y = 1;\n room.monsters[0].x = 5;\n room.spikes[0].y = 2;\n room.spikes[0].x = 4;\n room.spikes[1].y = 2;\n room.spikes[1].x = 6;\n\n mapArrays[room.doors[0].y][room.doors[0].x] = room.doors[0];\n mapArrays[room.chests[0].y][room.chests[0].x] = room.chests[0];\n mapArrays[room.chests[1].y][room.chests[1].x] = room.chests[1];\n mapArrays[room.chests[2].y][room.chests[2].x] = room.chests[2];\n mapArrays[room.waters[0].y][room.waters[0].x] = room.waters[0];\n mapArrays[room.waters[1].y][room.waters[1].x] = room.waters[1];\n mapArrays[room.waters[2].y][room.waters[2].x] = room.waters[2];\n mapArrays[room.waters[3].y][room.waters[3].x] = room.waters[3];\n mapArrays[room.waters[4].y][room.waters[4].x] = room.waters[4];\n mapArrays[room.lavas[0].y][room.lavas[0].x] = room.lavas[0];\n mapArrays[room.lavas[1].y][room.lavas[1].x] = room.lavas[1];\n mapArrays[room.lavas[2].y][room.lavas[2].x] = room.lavas[2];\n mapArrays[room.lavas[3].y][room.lavas[3].x] = room.lavas[3];\n mapArrays[room.monsters[0].y][room.monsters[0].x] = room.monsters[0];\n mapArrays[room.spikes[0].y][room.spikes[0].x] = room.spikes[0];\n mapArrays[room.spikes[1].y][room.spikes[1].x] = room.spikes[1];\n\n miniWallMaker(1,4);\n miniWallMaker(1,6);\n }", "function createLevel() {\n var done = false;\n //Verifica se o level é jogavel\n while (!done) {\n //Randomiza os tiles\n for (var i = 0; i < level.columns; i++) {\n for (var j = 0; j < level.rows; j++) {\n level.tiles[i][j].type = getRandomTile();\n }\n }\n //Resolve os Matchs iniciais\n resolveClusters();\n //Verifica os movimentos possiveis\n findMoves();\n //Se houver ao menos um movimento, o level é jogavel\n if (moves.length > 0) {\n done = true;\n }\n }\n }", "function makeDucks() {\n\tfor (i=0; i < 2; i++) {\n\t\tducks.push( {posX: Math.random()*700, posY: Math.random()*550, targetX: Math.random()*700, targetY: Math.random()*550} );\n\t}\n}", "function createLines() {\n var moesLine = new self.StoogeLine();\n moesLine.set('Scene', 1);\n moesLine.set('SetID', self.indoorSet.get('id'));\n moesLine.set('StoogeID', self.moe.get('id'));\n moesLine.set('Line', 'To be or not to be?');\n var larrysLine = new self.StoogeLine();\n larrysLine.set('Scene', 2);\n larrysLine.set('SetID', self.desertSet.get('id'));\n larrysLine.set('StoogeID', self.larry.get('id'));\n larrysLine.set('Line', 'That is the question!');\n spec.integrationStore.putModel(moesLine, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n spec.integrationStore.putModel(larrysLine, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n createView();\n }\n });\n }\n });\n }", "function spawnMeat() {\n for (var i = 0; i < 15; i++) {\n var meat = yummy.create(game.world.width * Math.random() * 0.95,\n game.world.height * Math.random(), 'meat');\n meat.scale.setTo(.9, 0.9);\n } \n}", "async _addMonsters() {\n this.arena.monsters = [];\n\n for (let creature in this.config.monsters) {\n let AI = await new Monster({\n id: creature,\n idType: this.config.monsters[creature].id,\n spritesheet: this.config.monsters[creature].spritesheet,\n spriteProp: this.config.monsters[creature],\n container: this.stage.container(),\n layer: this.layer,\n stage: this.stage,\n onScreenUpdate: this._onScreen.bind(this),\n }).init()\n\n this.arena.monsters.push(AI);\n\n this.layer.add(this.arena.monsters[creature].sprite.body);\n\n this._updateFrame();\n this.arena.monsters[creature].sprite.start();\n }\n }", "function makeobject(depth) {\n if (depth == 0) {\n fillroom(OENTRANCE, 0); /* entrance to dungeon */\n fillroom(ODNDSTORE, 0); /* the DND STORE */\n fillroom(OSCHOOL, 0); /* college of Larn */\n fillroom(OBANK, 0); /* 1st national bank of larn */\n fillroom(OVOLDOWN, 0); /* volcano shaft to temple */\n fillroom(OHOME, 0); /* the players home & family */\n fillroom(OTRADEPOST, 0); /* the trading post */\n fillroom(OLRS, 0); /* the larn revenue service */\n return;\n }\n\n if (depth == 1) {\n LEVELS[depth].items[Math.floor(MAXX / 2)][MAXY - 1] = createObject(OHOMEENTRANCE);\n }\n\n if (depth == MAXLEVEL) fillroom(OVOLUP, 0); /* volcano shaft up from the temple */\n\n if ((depth > 0) && /* no stairs on home level */\n (depth != DBOTTOM) && /* no stairs on bottom of dungeon */\n (depth != VBOTTOM)) { /* no stairs on bottom of volcano but ularn has dead down stairs on v3, v4 */\n fillroom(OSTAIRSDOWN, 0);\n }\n\n if (depth > 1) { /* no stairs on home level, D1 */\n if (ULARN && depth == MAXLEVEL) {\n fillroom(OSTAIRSUP, 0); /* ularn has dead up stairs on V1 */\n }\n else if (depth != MAXLEVEL) {\n fillroom(OSTAIRSUP, 0); /* no up stairs on V1 */\n } \n } \n\n if (ULARN) {\n if (depth > 3 && // > 3\n depth != DBOTTOM && // not on 15\n depth != MAXLEVEL && // not on V1\n depth != VBOTTOM) { // not on V5\n createArtifact(OELEVATORUP, player.ELEVUP, rnd(100) > 85);\n }\n if (depth > 0 && // not on home\n (depth <= (DBOTTOM - 5) || // < level 10\n depth == DBOTTOM || // 15\n depth == VBOTTOM)) { // V5\n createArtifact(OELEVATORDOWN, player.ELEVDOWN, rnd(100) > 85);\n }\n }\n\n /* make the random objects in the maze */\n fillmroom(rund(3), OBOOK, depth);\n fillmroom(rund(3), OALTAR, 0);\n fillmroom(rund(3), OSTATUE, 0);\n fillmroom(rund(3), OFOUNTAIN, 0);\n fillmroom(rund(2), OTHRONE, 0);\n fillmroom(rund(2), OMIRROR, 0);\n fillmroom(rund(3), OCOOKIE, 0);\n\n /* be sure to have pits and trapdoors on V3, V4, and V5 */\n\t/* because there are no stairs on those levels */\n if (ULARN && depth >= MAXLEVEL + MAXVLEVEL - 3) {\n fillroom(OPIT, 0);\n fillroom(OIVTRAPDOOR,0);\n }\n /* regular pits */ \n fillmroom(rund(3), OPIT, 0);\n\n if (ULARN || (depth != DBOTTOM) && (depth != VBOTTOM))\n fillmroom(rund(2), OIVTRAPDOOR, 0);\n\n fillmroom(rund(2), OTRAPARROWIV, 0);\n fillmroom(rnd(3) - 2, OIVDARTRAP, 0);\n fillmroom(rnd(3) - 2, OIVTELETRAP, 0);\n\n if (depth == 1) \n fillmroom(1, OCHEST, depth);\n else \n fillmroom(rund(2), OCHEST, depth);\n\n if (depth < MAXLEVEL) {\n fillmroom((rund(2)), ODIAMOND, rnd(10 * depth + 1) + 10);\n fillmroom(rund(2), ORUBY, rnd(6 * depth + 1) + 6);\n fillmroom(rund(2), OEMERALD, rnd(4 * depth + 1) + 4);\n fillmroom(rund(2), OSAPPHIRE, rnd(3 * depth + 1) + 2);\n }\n\n var i;\n for (i = 0; i < rnd(4) + 3; i++) \n fillroom(OPOTION, newpotion()); /* make a POTION */\n for (i = 0; i < rnd(5) + 3; i++) \n fillroom(OSCROLL, newscroll()); /* make a SCROLL */\n for (i = 0; i < rnd(12) + 11; i++) \n fillroom(OGOLDPILE, 12 * rnd(depth + 1) + (depth << 3) + 10); /* make GOLD */\n\n if (depth == (ULARN ? 8 : 5)) \n fillroom(OBANK2, 0); /* branch office of the bank */\n\n if (ULARN && depth >= 4) {\n /* Dealer McDope's Pad */\n createArtifact(OPAD, player.PAD, rnd(100) > 75);\n }\n\n froom(2, ORING, 0); /* a ring mail */\n froom(1, OSTUDLEATHER, 0); /* a studded leather */\n froom(3, OSPLINT, 0); /* a splint mail */\n froom(5, OSHIELD, rund(3)); /* a shield */\n froom(2, OBATTLEAXE, rund(3)); /* a battle axe */\n froom(5, OLONGSWORD, rund(3)); /* a long sword */\n froom(5, OFLAIL, rund(3)); /* a flail */\n froom(7, OSPEAR, rnd(5)); /* a spear */\n froom(4, OREGENRING, rund(3)); /* ring of regeneration */\n froom(1, OPROTRING, rund(3)); /* ring of protection */\n froom(2, OSTRRING, 1 + rnd(3)); /* ring of strength */\n froom(2, ORINGOFEXTRA, 0); /* ring of extra regen */\n\n if (ULARN) {\n // only one of these per level\n var created = false;\n created |= createArtifact(OBRASSLAMP, player.LAMP, !created && rnd(120) < 8);\n created |= createArtifact(OWWAND, player.WAND, !created && rnd(120) < 8);\n created |= createArtifact(OORBOFDRAGON, player.SLAYING, !created && rnd(120) < 8);\n created |= createArtifact(OSPIRITSCARAB, player.NEGATESPIRIT, !created && rnd(120) < 8);\n created |= createArtifact(OCUBEofUNDEAD, player.CUBEofUNDEAD, !created && rnd(120) < 8);\n created |= createArtifact(ONOTHEFT, player.NOTHEFT, !created && rnd(120) < 8);\n created |= createArtifact(OSWORDofSLASHING, player.SLASH, !created && rnd(120) < 8);\n created |= createArtifact(OHAMMER, player.BESSMANN, !created && rnd(120) < 8);\n created |= createArtifact(OSPHTALISMAN, player.TALISMAN, !created && rnd(120) < 8);\n created |= createArtifact(OHANDofFEAR, player.HAND, !created && rnd(120) < 8);\n created |= createArtifact(OORB, player.ORB, !created && rnd(120) < 8);\n created |= createArtifact(OELVENCHAIN, player.ELVEN, !created && rnd(120) < 8);\n created |= createArtifact(OSLAYER, player.SLAY, !created && depth >= 10 && rnd(100) > (85 - (depth - 10)));\n created |= createArtifact(OVORPAL, player.VORPAL, !created && rnd(120) < 8);\n created |= createArtifact(OPSTAFF, player.STAFF, !created && depth >= 8 && rnd(100) > (85 - (depth - 10)));\n created |= createArtifact(OLIFEPRESERVER, player.PRESERVER, !created && depth >= 5 && rnd(120) < 8); // different than Ularn 1.6\n }\n else {\n createArtifact(OORBOFDRAGON, player.SLAYING, rnd(151) < 3);\n createArtifact(OSPIRITSCARAB, player.NEGATESPIRIT, rnd(151) < 4);\n createArtifact(OCUBEofUNDEAD, player.CUBEofUNDEAD, rnd(151) < 4);\n createArtifact(ONOTHEFT, player.NOTHEFT, rnd(151) < 3);\n createArtifact(OSWORDofSLASHING, player.SLASH, rnd(151) < 2);\n createArtifact(OHAMMER, player.BESSMANN, rnd(151) < 4);\n }\n\n if (getDifficulty() < 3 || (rnd(4) == 3)) {\n if (depth > 3) {\n froom(3, OSWORD, rund(6)); /* sunsword */\n froom(5, O2SWORD, rnd(6)); /* a two handed sword */\n froom(3, OBELT, rund(7)); /* belt of striking */\n froom(3, OENERGYRING, rund(6)); /* energy ring */\n froom(4, OPLATE, rund(8)); /* platemail */\n if (!ULARN) froom(3, OCLEVERRING, 1 + rnd(2)); /* ring of cleverness */\n }\n }\n} // makeobject()", "function generateCrowd(){\n for(let crowd = 0; crowd < 7; crowd++) {\n\t\tif(crowd == 1) {\n\t\t\txPos = -2;\n\t\t\tyPos = 1.53;\n\t\t\tzPos = -0.6;\n\t\t}\n\t\tif(crowd == 2) {\n\t\t\txPos = -2;\n\t\t\tyPos = 1.34;\n\t\t\tzPos = -0.2;\n\t\t}\n\t\tif(crowd == 3) {\n\t\t\txPos = -2;\n\t\t\tyPos = 1.15;\n\t\t\tzPos = 0.2;\n\t\t}\n\t\tif(crowd == 4) {\n\t\t\txPos = -2;\n\t\t\tyPos = 0.96;\n\t\t\tzPos = 0.4;\n\t\t}\n\t\tif(crowd == 5) {\n\t\t\txPos = -1.9;\n\t\t\tyPos = 0.77;\n\t\t\tzPos = 0.8;\n\t\t}\n\t\tif(crowd == 6) {\n\t\t\txPos = -1.8;\n\t\t\tyPos = 0.58;\n\t\t\tzPos = 1.2;\n\t\t}\n\t\tfor(let chair = 0; chair < 13; chair++) {\n if(Math.floor(random(0,5)) == 2 && crowdAction.length < 18) {\n audienceMember = new Watcher(xPos,yPos,zPos);\n \t\t\tcrowdAction.push(audienceMember);\n }\n\t\t\t//world.add(audienceMember);\n\t\t\tif(chair == 2) {\n\t\t\t\txPos += 0.4;\n\t\t\t}\n\t\t\tif(chair == 6) {\n\t\t\t\txPos += 0.9;\n\t\t\t}\n\t\t\tif(chair == 9) {\n\t\t\t\txPos += 0.6;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txPos += 0.2;\n\t\t\t}\n\t\t}\n\t}\n\n}", "function makemaze(k) {\n var useCanned = false;\n if (k == DBOTTOM || k == VBOTTOM) {\n useCanned = true;\n }\n else if (k > 1) {\n if (ULARN) {\n useCanned = rnd(100) < 50;\n }\n else {\n useCanned = rnd(17) <= 4;\n }\n }\n\n if (useCanned) {\n /* read maze from data file */\n cannedlevel(k);\n return;\n }\n\n var mitem = player.level.monsters;\n\n for (let i = 0; i < MAXY; i++) {\n for (let j = 0; j < MAXX; j++) {\n if (k == 0)\n setItem(j, i, OEMPTY);\n else\n setItem(j, i, OWALL);\n }\n }\n\n if (k == 0) return;\n\n eat(1, 1);\n\n if (k == 1) setItem(33, MAXY - 1, OHOMEENTRANCE);\n\n /* now for open spaces */\n var tmp2 = rnd(3) + 3;\n var mx, mxl, mxh, my, myl, myh;\n var mon;\n for (let tmp = 0; tmp < tmp2; tmp++) {\n my = rnd(11) + 2;\n myl = my - rnd(2);\n myh = my + rnd(2);\n\n if (k < MAXLEVEL) {\n mx = rnd(44) + 5;\n mxl = mx - rnd(4);\n mxh = mx + rnd(12) + 3;\n mon = null;\n } else {\n mx = rnd(60) + 3;\n mxl = mx - rnd(2);\n mxh = mx + rnd(2);\n mon = makemonst(k);\n }\n\n for (var i = mxl; i < mxh; i++)\n for (var j = myl; j < myh; j++) {\n setItem(i, j, OEMPTY);\n mitem[i][j] = mon ? createMonster(mon) : null;\n }\n }\n /* now for open spaces */\n\n my = rnd(MAXY - 2);\n for (let i = 1; i < MAXX - 1; i++)\n setItem(i, my, OEMPTY);\n\n if (k > (ULARN ? 4 : 1)) {\n treasureroom(k);\n }\n\n}", "generateGame() {\n\n this.generateGrounds();\n this.setPlayers();\n this.setPlayerStartArea();\n this.generateUnbreakableWalls();\n this.generateBreakableWalls();\n this.generateItems();\n GameElements.bombs.splice(0,GameElements.bombs.length);\n GameElements.explosions.splice(0,GameElements.explosions.length);\n \n }", "function generateWorld() {\n\t\t//generate the grass along the x-axis\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\t//generate the grass along the y-axis\n\t\t\tfor(var j = 0; j < 20; j++) {\n\t\t\t\tgrassType = Crafty.randRange(1, 4);\n\t\t\t\tCrafty.e(\"2D, Canvas, grass\"+grassType)\n\t\t\t\t\t.attr({x: i * 16, y: j * 16});\n\t\t\t\t\n\t\t\t\t//1/50 chance of drawing a flower and only within the bushes\n\t\t\t\tif(i > 0 && i < 24 && j > 0 && j < 19 && Crafty.randRange(0, 50) > 49) {\n\t\t\t\t\tCrafty.e(\"2D, DOM, flower, Animate\")\n\t\t\t\t\t\t.attr({x: i * 16, y: j * 16})\n\t\t\t\t\t\t.animate(\"wind\", 0, 1, 3)\n\t\t\t\t\t\t.bind(\"enterframe\", function() {\n\t\t\t\t\t\t\tif(!this.isPlaying())\n\t\t\t\t\t\t\t\tthis.animate(\"wind\", 80);\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//create the bushes along the x-axis which will form the boundaries\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\tCrafty.e(\"2D, Canvas, wall_top, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: i * 16, y: 0, z: 2});\n\t\t\tCrafty.e(\"2D, DOM, wall_bottom, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: i * 16, y: 304, z: 2});\n\t\t}\n\t\t\n\t\t//create the bushes along the y-axis\n\t\t//we need to start one more and one less to not overlap the previous bushes\n\t\tfor(var i = 1; i < 19; i++) {\n\t\t\tCrafty.e(\"2D, DOM, wall_left, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: 0, y: i * 16, z: 2});\n\t\t\tCrafty.e(\"2D, Canvas, wall_right, bush\"+Crafty.randRange(1,2))\n\t\t\t\t.attr({x: 384, y: i * 16, z: 2});\n\t\t}\n\t}", "function initDoors()\n {\n var spawnPoint;\n function createDoor(i)\n {\n //Se crean puertas según los puntos de spawn del json\n spawnPoint = map.findObject(\"Objects\", obj => obj.name === \"Puerta \" + i);\n doors[i] = this.statics.create(spawnPoint.x + 16, spawnPoint.y + 16, \"door\").refreshBody();\n //Se asocia una callback al evento de colisión de Juan con las puertas\n //El guardia podrá atravesarlas\n that.physics.add.collider(juan, doors[i], function(){openDoor(i);}, null, this);\n }\n for(var i = 0; i < numDoors; i++)\n createDoor(i);\n }", "createStartingUnits(units, startingObjectsList){\n var keys, unitInfo, unitCoords, amount;\n if (loadingSavedGame === true) {\n if(this.isPlayer() === true) {\n keys = currentData.units;\n //console.log(\"Player units\", keys);\n\n for(var i = 0; i < keys.length; i++){\n\n unitInfo = this.getUnitInfo(keys[i].type);\n //console.log (unitInfo);\n amount = 1;\n\n //creates the correct amount of buildings for the current type\n for(var j = 0; j < amount; j++){\n this.unitAmount++;\n\n unitCoords = {\n x: keys[i].x,\n y: keys[i].y\n }\n var unitHealth = keys[i].health;\n var unit = new Unit(unitInfo, unitCoords.x, unitCoords.y, this.game, this.isPlayer(), this, unitHealth);\n this.units.push(unit);\n }\n }\n } // creating player units using saved data\n else {\n keys = currentData.ai_units;\n //console.log(\"Enemy units\", keys);\n\n for(var i = 0; i < keys.length; i++){\n\n unitInfo = this.getUnitInfo(keys[i].type);\n //console.log (unitInfo);\n amount = 1;\n\n //creates the correct amount of buildings for the current type\n for(var j = 0; j < amount; j++){\n this.unitAmount++;\n\n unitCoords = {\n x: keys[i].x,\n y: keys[i].y\n }\n var aiUnitHealth = keys[i].health;\n var unit = new Unit(unitInfo, unitCoords.x, unitCoords.y, this.game, this.isPlayer(), this, aiUnitHealth);\n this.units.push(unit);\n }\n }\n }\n } // creating ai units using saved data\n else {\n //gets all the types of the starting units\n var keys = Object.keys(units);\n\n //goes through the different types of units the kingdom starts with and creates the given kingdom's base starting units\n for(var i = 0; i < keys.length; i++){\n var unitInfo = this.getUnitInfo(keys[i]);\n var amount = units[keys[i]];\n\n\n\n //goes through and creates the starting units\n for(var j = 0; j < amount; j++){\n\n this.unitAmount++;\n var unitCoords = this.findStartingPosition(unitInfo, this.unitAmount, startingObjectsList);\n var unit = new Unit(unitInfo, unitCoords.x, unitCoords.y, this.game, this.isPlayer(), this, 0);\n\n\n this.units.push(unit);\n }\n }\n } // creating player and ai units on a new game\n }", "function create_game_board(){\n update_number_of_players();\n create_player_areas();\n // create new game\n game_instance.deal_cards();\n \n render_cards();\n apply_card_event_handlers();\n \n game_instance.determine_winners();\n // determine_winners();\n // show_best_hands(); //for diagnostics\n }", "static createOrreColosseumQuestLine() {\n const orreColosseumQuestLine = new QuestLine('Shadows in the Desert', 'Explore Orre and uncover the origin of Shadow Pokémon.', new GymBadgeRequirement(BadgeEnums.Elite_HoennChampion), GameConstants.BulletinBoards.Hoenn);\n const exploreStand = new TalkToNPCQuest(ExploreStand, 'Travel to Orre and explore the Outskirt Stand.');\n orreColosseumQuestLine.addQuest(exploreStand);\n const fightWillie = new DefeatTemporaryBattleQuest('Willie', 'Fight Willie');\n orreColosseumQuestLine.addQuest(fightWillie);\n const fightFolly = new DefeatTemporaryBattleQuest('Folly', 'Fight Folly the Shady Guy in Phenac City');\n orreColosseumQuestLine.addQuest(fightFolly);\n const checkSack = new TalkToNPCQuest(Sack, 'Check what is in the mysterious sack.'); // Step 3\n orreColosseumQuestLine.addQuest(checkSack);\n const defeatShadowsPhenac = new CustomQuest(10, 0, 'Defeat 10 trainers who are using Shadow Pokémon in Phenac City.', () => App.game.statistics.totalShadowPokemonDefeated());\n orreColosseumQuestLine.addQuest(defeatShadowsPhenac);\n const talkToEsCade1 = new TalkToNPCQuest(EsCade1, 'Talk to the Mayor of Phenac City about the criminals you have been fighting.');\n orreColosseumQuestLine.addQuest(talkToEsCade1);\n const talkToRui1 = new TalkToNPCQuest(Rui1, 'Meet up with Rui again in Phenac City.'); // Step 6\n orreColosseumQuestLine.addQuest(talkToRui1);\n const fightPyriteTown = new CustomQuest(5, 0, 'Fight trainers in Pyrite Town to flush out the criminals.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Pyrite Town Battles')]());\n orreColosseumQuestLine.addQuest(fightPyriteTown);\n const talkToDuking1 = new TalkToNPCQuest(Duking1, 'Talk to the distraught bodybuilder Duking in Pyrite Town.');\n orreColosseumQuestLine.addQuest(talkToDuking1);\n const fightPyriteColosseum = new CustomQuest(5, 0, 'Fight trainers in Pyrite Colosseum to flush out the criminals.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Pyrite Colosseum')]()); // Step 9\n orreColosseumQuestLine.addQuest(fightPyriteColosseum);\n const fightPyriteBuilding = new CustomQuest(5, 0, 'No sign of Shadow Pokémon so far. Fight trainers at the Pyrite Building to flush out the criminals.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Pyrite Building')]());\n orreColosseumQuestLine.addQuest(fightPyriteBuilding);\n const talkToDoken1 = new TalkToNPCQuest(Doken1, 'Interrogate Hunter Doken in the Pyrite Building to find out who has taken Plusle, and where to.');\n orreColosseumQuestLine.addQuest(talkToDoken1);\n const clearPyriteCave = new CustomQuest(1, 0, 'Find Miror B. and rescue Duking\\'s Plusle in Pyrite Cave!', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Pyrite Cave')](), undefined, undefined, {\n clearedMessage: 'How, how, how dare you! Don\\'t you dare think you\\'ll get away with your latest outrage! One of these days, I will take great pleasure in kicking you about with my elegant dance steps! Oh, and I\\'m not giving up our Shadow Pokémon plan!',\n npcDisplayName: 'Miror B.',\n npcImageName: 'Cipher Admin Miror B',\n });\n orreColosseumQuestLine.addQuest(clearPyriteCave);\n const freePlusle = new TalkToNPCQuest(FreePlusle, 'Free Duking\\'s Plusle.'); //Step 13\n orreColosseumQuestLine.addQuest(freePlusle);\n const talkToRui2 = new TalkToNPCQuest(Rui2, 'Discuss your next move with Rui at Pyrite Colosseum.');\n orreColosseumQuestLine.addQuest(talkToRui2);\n const clearAgatePeons = new CustomQuest(3, 0, 'Defeat the Team Cipher Peons looting Agate Village.', () => App.game.statistics.temporaryBattleDefeated[GameConstants.getTemporaryBattlesIndex('Cipher Peon Doven')]() +\n App.game.statistics.temporaryBattleDefeated[GameConstants.getTemporaryBattlesIndex('Cipher Peon Silton')]() +\n App.game.statistics.temporaryBattleDefeated[GameConstants.getTemporaryBattlesIndex('Cipher Peon Kass')]());\n orreColosseumQuestLine.addQuest(clearAgatePeons);\n const fightRelicCave = new CustomQuest(1, 0, 'Rui is worried her grandpa is in trouble. Search for him by clearing Relic Cave.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Relic Cave')]());\n orreColosseumQuestLine.addQuest(fightRelicCave);\n const talkToGrandpaEagun = new TalkToNPCQuest(GrandpaEagun1, 'Find out more about Relic Cave from Grandpa Eagun.'); // Step 17\n orreColosseumQuestLine.addQuest(talkToGrandpaEagun);\n const fightMtBattle = new CustomQuest(1, 0, 'There\\'s rumors of more Team Cipher activity at Mt. Battle. Go investigate!', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Mt. Battle')](), undefined, undefined, {\n clearedMessage: 'This isn\\'t over yet. Stronger Pokémon are being made even now. You\\'d better get serious about training your Pokémon for our next meeting. Daahahah!',\n npcDisplayName: 'Dakim',\n npcImageName: 'Cipher Admin Dakim',\n });\n orreColosseumQuestLine.addQuest(fightMtBattle);\n const talkToRui3 = new TalkToNPCQuest(Rui3, 'Discuss your next move with Rui at Mt. Battle.');\n orreColosseumQuestLine.addQuest(talkToRui3);\n const fightTheUnder = new CustomQuest(1, 0, 'Track down the TV broadcast coming from The Under in Pyrite Town. Clear The Under.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('The Under')](), undefined, undefined, {\n clearedMessage: 'Aiyeeeeh! How dare you! How could I get bested by a mere child? Remember this! I\\'ll get you back for this!',\n npcDisplayName: 'Venus',\n npcImageName: 'Cipher Admin Venus',\n });\n orreColosseumQuestLine.addQuest(fightTheUnder);\n const searchTheStudio = new TalkToNPCQuest(SearchTheStudio, 'Search Venus\\' Studio in the Under for clues.'); // Step 21\n orreColosseumQuestLine.addQuest(searchTheStudio);\n const fightCipherLab = new CustomQuest(1, 0, 'Follow the secret tunnel to the Cipher Lab and clear out the enemies.', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Cipher Lab')](), undefined, undefined, {\n clearedMessage: 'Humph! Your struggle to get here was all in vain! The Shadow Pokémon we produced have already been moved elsewhere. And that, of course, includes the ultimate Shadow Pokémon I created for the boss! Wahahahah!',\n npcDisplayName: 'Ein',\n npcImageName: 'Cipher Admin Ein',\n });\n orreColosseumQuestLine.addQuest(fightCipherLab);\n const fightRealgamTower = new CustomQuest(5, 0, 'Team Cipher has taken over Realgam Tower! Fight to kick them out!', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Realgam Tower Battles')]());\n orreColosseumQuestLine.addQuest(fightRealgamTower);\n const talkToEsCade2 = new TalkToNPCQuest(EsCade2, 'From the top of Realgam Tower, you see Mayor Es Cade. Go ask him for help.'); //Step 24\n orreColosseumQuestLine.addQuest(talkToEsCade2);\n const fightRealgamColosseum = new CustomQuest(10, 0, 'Team Cipher\\'s leaders have holed up in the Realgam Colosseum. Fight them to end this once and for all!', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Realgam Colosseum')]());\n orreColosseumQuestLine.addQuest(fightRealgamColosseum);\n const watchEviceEscape = new TalkToNPCQuest(EviceEscape, 'Just when you have him cornered, Evice calls in a helicopter. Watch him escape the Realgam Colosseum.'); // Step 26\n orreColosseumQuestLine.addQuest(watchEviceEscape);\n App.game.quests.questLines().push(orreColosseumQuestLine);\n }", "function generateWorld() {\n\t\t//generate the grass along the x-axis\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\t//generate the grass along the y-axis\n\t\t\tfor(var j = 0; j < 20; j++) {\n\t\t\t\tgrassType = Crafty.math.randomInt(1, 4);\n\t\t\t\tCrafty.e(\"2D, Canvas, grass\"+grassType)\n\t\t\t\t\t.attr({x: i * 16, y: j * 16});\n\t\t\t\t\n\t\t\t\t//1/50 chance of drawing a flower and only within the bushes\n\t\t\t\tif(i > 0 && i < 24 && j > 0 && j < 19 && Crafty.math.randomInt(0, 50) > 49) {\n\t\t\t\t\tCrafty.e(\"2D, DOM, flower, solid, SpriteAnimation\")\n\t\t\t\t\t\t.attr({x: i * 16, y: j * 16})\n\t\t\t\t\t\t.reel(\"wind\", 1600, 0, 1, 3)\n\t\t\t\t\t\t.animate(\"wind\", -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//create the bushes along the x-axis which will form the boundaries\n\t\tfor(var i = 0; i < 25; i++) {\n\t\t\tCrafty.e(\"2D, Canvas, wall_top, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: i * 16, y: 0, z: 2});\n\t\t\tCrafty.e(\"2D, DOM, wall_bottom, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: i * 16, y: 304, z: 2});\n\t\t}\n\t\t\n\t\t//create the bushes along the y-axis\n\t\t//we need to start one more and one less to not overlap the previous bushes\n\t\tfor(var i = 1; i < 19; i++) {\n\t\t\tCrafty.e(\"2D, DOM, wall_left, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: 0, y: i * 16, z: 2});\n\t\t\tCrafty.e(\"2D, Canvas, wall_right, solid, bush\"+Crafty.math.randomInt(1,2))\n\t\t\t\t.attr({x: 384, y: i * 16, z: 2});\n\t\t}\n\t}", "createObjects() {\n\n\t\tthis.field = new Field();\n\t\t\n\t\tthis.title = new HomeTitle();\n\n\t\tthis.particles = new Particles('particleWhite', 500, { x: 10});\n\n\t\tthis.skybox = new Skybox('assets2d/homeSkybox/');\n\n\t\tPromise.all([\n\t\t\tStore.get('sartre_bench_intro',{\n\t\t\t\t'name': 'sartre_bench_intro',\n\t\t\t\t'x': 0,\n\t\t\t\t'y': -5,\n\t\t\t\t'z': 0,\n\t\t\t\t'color': 0xcacaca\n\t\t\t}),\n\t\t\tthis.skybox.load(),\n\t\t\tthis.field.load(),\n\t\t\tthis.particles.load()\n\t\t])\n\t\t.then(data => {\n\t\t\tthis.bench = data[0];\n\t\t\tthis.bench.mesh.position.y = -0.22;\n\t\t\tthis.scene.background = data[1];\n\n\t\t\tthis.add(this.title.mesh);\n\t\t\tthis.add(this.bench.mesh);\n\t\t\tthis.add(this.field.mesh);\n\t\t\tthis.add(this.particles.mesh);\n\n\t\t\tthis.raycastMeshes.push( this.bench.mesh );\n\t\t\tthis.startRaycast = true;\n\t\t});\n\t\t\n\t}", "function generateManyObjects( shitTon, noise ) {\n shitTon = shitTon || 10000\n noise = noise || Math.random( ) * 100\n\n let objs = [ ]\n\n let base = { name: 'base bastard 2', noise: noise, __closure: {} }\n // objs.push( base )\n let k = 0\n\n for ( let i = 0; i < shitTon; i++ ) {\n let baby = {\n name: `mr. ${i}`,\n nest: { duck: i % 2 === 0, mallard: 'falsey', arr: [ i + 42, i, i ] },\n test: { value: i, secondValue: 'mallard ' + i % 10 },\n similar: k,\n even: i % 2 === 0,\n objArr: [ { a: i }, { b: i * i }, { c: true } ],\n noise: noise,\n sortValueA: i,\n sortValueB: i * 0.42 * i\n }\n if ( i % 3 === 0 ) k++\n\n getAnIdForThisOnePlease( baby )\n\n base.__closure[ baby.id ] = 1\n\n objs.push( baby )\n }\n\n getAnIdForThisOnePlease( base )\n return { commit: base, objs: objs }\n}", "function createStory() {\n // In this example you need to initialise these in reverse order, so that\n // when you assign a target it already exists. I.e., start at the end!\n lunarEnd4B = new StorySection(\n \"The Escavator explodes, falling backwards into one of the many craters of the moon. It was a brief explosion but it brightened up the hull of your ship for a moment before leaving behind a fiery mess near the Lunar Base.\\n\\n Ending 4 - Sacrifice \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd4A = new StorySection(\n \"You follow West's idea. You asked the Colonel about the Escavator and left the backpack in a closet when no one was looking. You the Colonel you'll be in touch, as leave the station into a loose orbit around the moon. \\n\\n It doesn't take much longer when you see it happen. \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd3 = new StorySection(\n \"You end up telling the Colonel that if he doesn't shut down the drill, that you would report him to both the UN and his superiors about the situation. This holds up the US in its expansion plans, and inevitable helps the other nations catch up in technology and resources. The space race is still ongoing.\\n\\n Ending 3 - Morality\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // okay ending //blackmail the colonel into not selling the drill materials\n lunarEnd2B = new StorySection(\n \"You report Lt. Colonel West's dissapearance, and the rest of the situation to both your superiors and the Colonel. You were never able to figure out why the Colonel was actually so defensive about you being there, but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd2A = new StorySection(\n \"You report Lt. Colonel West to both your superiors and the Colonel about his plans. You were never able to figure out if the Colonel was actually privately earning money through this trade but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd1 = new StorySection(\n \"You leave the Lunar station with more questions than answers but ultimately decided it wasn't within your power to stop anything that was happening. You stay in orbit for about a week when you hear news about the Giant Moon Excavator being finished. The Colonel was right, the minerals they mined ended up being full of crucial elements. It propelled the US to being a space superpower and only furthered their ambitions in space. China was somehow able to acquire much of these rare materials and used to to further their stocks. \\n\\n Ending 1 - Idleness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // worst ending // do nothing after finding out everything\n //moon ending\n moonChoice3B = new StorySection(\n \"You ponder what's happened here so far. You've been threatened by the Colonel, and you saw a man with a backpack that was clearly plotting something. You can't find the Lt Colonel either. What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2B\n );\n moonChoice3A = new StorySection(\n \"Well this has escalated quickly. There's no way you're blowing up an escavator, corruption or not, that'll only give them international support. But if you tell Ramos about West's intentions, there won't be anyone to stop him in the future.\\\\What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2A\n );\n //final decision for the moon\n investigation9 = new StorySection(\n \"You head straight to the Colonel and tell him immediately of Colonel West's dissapearance, the man you saw in the cafeteria, and even the explosives you found in your ship. He tells you that he will handle it and everything will be fine. He sends you off and you end up not being able to do much else but spectate.\",\n \"(A) Next\",\n lunarEnd2B,\n \"\",\n investigation8\n );\n investigation8 = new StorySection(\n \"You get back to your ship and ponder who you saw in the cafeteria, when you get back to your ship and find a backpack. You open it, and see that it...contains C-4 explosives?! You immediately check if it is armed but it's just raw C-4. This is bad, what shoud you? \",\n \"(A) Tell the Colonel\",\n investigation9,\n \"(D) Put it in your ship and leave now\",\n lunarEnd1\n );\n investigation7 = new StorySection(\n \"You look in the cafeteria after a day of looking around and pondering, and its remarkably dark here. You stumble around to see if there is other rooms when you see one room with a light on. You open the door see a man with a large backpack, and make brief eyecontact before he bolts and runs through another door into the darkness of the cafeteria where you lose him.\",\n \"(A) Tell the Colonel\",\n investigation8,\n \"(D) Go back to your ship to think\",\n moonChoice3B\n ); // decision for your plan\n investigation6 = new StorySection(\n \"As he walks away, you look inside the bag, and check what he gave you. You immediately recognize it to be military grade C4 explosives. He...wants to blow up the excavator?! What can- what should you do?\",\n \"(A) Follow his plan\",\n lunarEnd4A,\n \"(D) Go back to your ship to think\",\n moonChoice3A\n );\n investigation5 = new StorySection(\n \"Good. Since you haven't ratted me out, that means you're on my side,''He hands you a backpack that was behind him. ''I've heard you're experienced, you should know how to use these. Tell the Colonel you want to see the the Excavator tonight before you leave, and leave this in there. I'll handle the rest.''\",\n \"(A) Take the bag\",\n investigation6,\n \"(D) Don't take the bag\",\n moonChoice3B\n ); // Lt. Colonel whistleblower\n investigation4B = new StorySection(\n \"You asked around to find the Lt. Colonel but he wasn't anywhere to be found. One of the base soldiers told you that he likes to hang around the cafeteria, so you head over there. \",\n \"(A) Next\",\n investigation7,\n \"\",\n investigation7\n ); // Lt Colonel has the metal tube\n investigation4AB = new StorySection(\n \"You walk forward not sure why he signalled and he points at the ceiling as you walk through a camera's field of view. That's when West takes out a small device and points it at the camera which immediately powers down.\\n\\n He looks even more dissapointed than he was earlier and says, ''You really can't take a hint can you?'' as rushes off behind you and into the hangar. \",\n \"(A) Next\",\n investigation5,\n \"(D) Continue\",\n investigation4AB\n ); //goes through camera\n investigation4AA = new StorySection(\n \"You stop as you look at him in confusion, and he points at the ceiling where a camera is panning left and right. He takes out a small device and points it at the camera which immediately powers down.\\n\\n He walks up to you and whispers, did you read it?\",\n \"(A) Yes\",\n investigation5,\n \"\",\n investigation5\n ); //doesn't go through camera\n investigation4A = new StorySection(\n \"It doesn't take long for you to find West. He was quite literally around the corner of the entrance of the hangar waiting for you. As you approach him, he puts his hand up to signal for you to stop.\",\n \"(A) Stop\",\n investigation4AA,\n \"(D) Continue\",\n investigation4AB\n ); // You have read the contents of the tube, looking for Lt Colonel West\n interrogation3 = new StorySection(\n \"''I don't have to tell you anything. Get off my station.'' he says as he gets up, clearly agitated about this coming to light. His guards walk in and escort you to your ship, where you're forced to leave the base.\",\n \"(A) Next\",\n lunarEnd1,\n \"\",\n lunarEnd1\n );\n interrogation2B = new StorySection(\n \"''You decide its better not to say. ''I can't say, but the allegations are pretty serious either way. Is that what you planned to do with the drill? The moon is international land, did the UN sanction your privatization of the moon?\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation2A = new StorySection(\n \"You decide to tell him, ''Your Lt. Colonel West did. He managed to hand me and I'm here to get your side of the story.''\\n\\n ''My 'side' of the story? The truth is that we are here as a nation to build the forward station to humanity. I have nothing to do wtih China,''\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation1A = new StorySection(\n \"You put the note on to Ramo's desk as he walks overs and picks it up. He looks at you obviously furious, but still attempt to put a facade of calmness. ''This is quite the allegation. Who may I ask, gave you this?''he says with a tinge of frustration.\",\n \"(A) Tell him\",\n interrogation2A,\n \"(D) Don't tell him\",\n interrogation2B\n ); //Lt Colonel West has the letter\n investigation3 = new StorySection(\n \"Colonel Ramos is sitting at his desk reading something on his desk screen when you walk in abruptly. ''Ah, to what do I owe the pleasure?'' Ramos says as he leans back on his chair and stares you down.\",\n \"(A) Show him the letter\",\n interrogation1A,\n \"(D) Accuse him without the letter\",\n interrogation2B\n );\n scroll2 = new StorySection(\n \"Well that explains the drill and the speed of them building everything up so fast. How long has it been, 3 months since the US came here, and they already have a drill almost fully built? Although, why would Lt Colonel West reveal this to you? What should you do?\",\n \"(A) Confront Colonel Ramos\",\n investigation3,\n \"(D) Confront Lt. Colonel West\",\n investigation4A\n );\n scroll1 = new StorySection(\n \"It reads, ''The US had the means, but China funded the way\\nRamos made private deal with China for minerals exports''\",\n \"(A) Next\",\n scroll2,\n \"\",\n scroll2\n );\n investigation2 = new StorySection(\n \"You look at the 2 inch metallic tube and see that there's a very thin line in the middle. Is this a container? You pulled as hard as you can and it pops open abruptly, revealing a scrolled piece of paper that drops onto the floor.\",\n \"(A) Read it\",\n scroll1,\n \"\",\n scroll1\n );\n investigation1B = new StorySection(\n \"You return to the hangar and sit near your ship. \\nYou take out the tube in your pocket. You wonder what this is?\",\n \"(A) Inspect the metal tube\",\n investigation2,\n \"\",\n investigation2\n ); // you have the letter\n investigation1A = new StorySection(\n \"You return to the hangar and sit near your ship. \\nWhat should you do?\",\n \"(A) Look around the base\",\n investigation7,\n \"(D) Talk to the Lt. Colonel\",\n investigation4B\n ); // you don't have the letter\n //unfinished section\n // investigation of the moon\n lunarLieutenant6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,''he lifts his hand and gestures to the door. ''You're free to go.'' You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1B,\n \"\",\n investigation1B\n );\n lunarLieutenant5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarLieutenant6,\n \"\",\n lunarLieutenant6\n );\n lunarLieutenant4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarLieutenant5,\n \"\",\n lunarLieutenant5\n );\n lunarLieutenant3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant3A = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant2 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarLieutenant3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarLieutenant3B\n ); //unique dialogue choice (edit later to differ from other dialogue)\n lunarLieutenant1 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou pick it up and put it in your pocket, as you catch back up to the officer. When you get to him, you find him standing next to a locked door as he waits for you. He whispers something to you under his breath that sounds like ''read it later'', he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarLieutenant2,\n \"\",\n lunarLieutenant2\n );\n //keeping it timeline ^\n lunarCommander6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,'' lifts his hand and gestures to the door. ''You're free to go.''. You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1A,\n \"\",\n investigation1A\n );\n lunarCommander5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarCommander6,\n \"\",\n lunarCommander6\n );\n lunarCommander4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarCommander5,\n \"\",\n lunarCommander5\n );\n lunarCommander3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander3A = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander2 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarCommander3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarCommander3B\n ); //unique dialogue choice\n lunarCommander1 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n You pick it up and catch up to the officer ahead of you. ''Excuse me sir, you dropped this,'' and hand it back to him. He looks at you profoundly surprised and quickly puts it back into his pocket. He shakes his head, seemingly dissapointed in you. You get a good look at his insignia and see that he is the Lieutenant Colonel here.\\n\\nBefore you can get a word in, he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarCommander2,\n \"\",\n lunarCommander2\n );\n\n //Giving it back timeline ^\n moonChoice1 = new StorySection(\n \"Day 1, 8:29 AM (Earth Time)\\n\\n You are greeted entering the station by an officer patiently waiting near the decompression chamber. He waits for you and shakes your hand and leads the way through the pristine hallways. \\n\\n Suddenly, he drops something on the floor as he walks ahead of you. He strangely didn't seem to notice. It seems to be a tiny metallic tube. What should you do?\",\n \"(A) Pick it up and keep it\",\n lunarLieutenant1,\n \"(D) Pick it up and give it back\",\n lunarCommander1\n );\n //moon dialogue\n moonIntro8B = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7B = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8B,\n \"\",\n moonIntro8B\n );\n moonIntro6B = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7B,\n \"\",\n moonIntro7B\n );\n moonIntro5B = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6B,\n \"\",\n moonIntro6B\n );\n moonIntro4B = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. Maybe you should've brought the photo.\",\n \"(A) Next\",\n moonIntro5B,\n \"\",\n moonIntro5B\n );\n moonIntro3B = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4B,\n \"\",\n moonIntro4B\n );\n moonIntro2B = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3B,\n \"\",\n moonIntro3B\n );\n moonIntro1B = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2B,\n \"\",\n moonIntro2B\n );\n //second branch - no photo timeline (B)\n moonIntro8A = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7A = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8A,\n \"\",\n moonIntro8A\n );\n moonIntro6A = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7A,\n \"\",\n moonIntro7A\n );\n moonIntro5A = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6A,\n \"\",\n moonIntro6A\n );\n moonIntro4A = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. You take out the photo from your spacesuit's pockets. You stare at it and it comforts you a bit.\",\n \"(A) Next\",\n moonIntro5A,\n \"\",\n moonIntro5A\n );\n moonIntro3A = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4A,\n \"\",\n moonIntro4A\n );\n moonIntro2A = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3A,\n \"\",\n moonIntro3A\n );\n moonIntro1A = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2A,\n \"\",\n moonIntro2A\n );\n //first branch - photo timeline (A)\n //moon story\n leaveThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou decide against it. You will be back, and it's probably better to leave it here than to lose it somewhere else. Especially Space.\",\n \"(A) Next\",\n moonIntro1B, //B = no photo\n \"\",\n moonIntro1B\n );\n keepThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou take the photo out of the frame, and put it in your pocket. There's no telling how long it will be out there, might as well keep something to remember them.\",\n \"(A) Next\",\n moonIntro1A, //A = with photo\n \"\",\n moonIntro1A\n );\n choice1 = new StorySection(\n \"Day 1, 4:00 AM\\n\\nYou wake up in your house for the last time, in a long time. You're about to leave when you realize you should check if you forgot anything you wanted to bring with you. You walk through your hallway and see a picture of you and your family, one taken a long time ago, before your peacekeeping days. It's been a long time since then.\\n\\nShould you keep it?\",\n \"(A) Keep the photo\", // text for option 1\n keepThePhoto, //object target option 1\n \"(D) Leave the photo\",\n leaveThePhoto\n );\n backstory2 = new StorySection(\n \"The United Nations has been working hard to send you and your force of 25 military spacejets to be the among the first to be sent into space. You have led multiple sucessful peacekeeping campaigns before, and the United Nations trust that you will influence the best decisions in this uncharted terrority.\",\n \"(A) Next\", //Text for option 1\n choice1, //Object target for option 1\n \"\",\n choice1\n );\n backstory1 = new StorySection(\n \"You have been selected to be in charge of the new and impossibly difficult task, to be a neutral force to observe the nation's actions and respond accordingly in space.\\n\\nA Space Peacekeeper.\",\n \"(A) Next\", //Text for option 1\n backstory2, //Object target option 1\n \"\",\n backstory2\n );\n //story start\n openingPassage3 = new StorySection(\n \"This caused the other nations to scramble and organize their own methods to reach the moon and stake a claim before all of it was gone and before international law would have a chance to stop it and regulate it. \\n\\nThe World's second Space Race had officially begun.\",\n \"(A) Next\", //Text for option 1\n backstory1, //Object target for option 1\n \"\",\n backstory1\n );\n openingPassage2 = new StorySection(\n \"Whether we wanted it or not, space colonization and travel is in full boom. The United States were the first to put make a Space Force that set the standard for United Nations. But before the United Nations could do much to regulate it, the United States had already established the Moon as the first extraterrestrial object to be used by their private industries.\",\n \"(A) Next\", //Text for option 1\n openingPassage3, //Object target for option 1\n \"\",\n openingPassage3\n );\n openingPassage1 = new StorySection(\n \"Humans are not like any other creature in the known universe. We have effectively conquered the Earth in ways animals could not even being to understand. To our current knowledge, we know that we are the only intelligent and sentient creatures that is in our system.\\n\\nIf no other creature claims the barren planets of our system, does it not belong to all of us?\", //Description for scene\n \"(A) Next\", //Text for option 1\n openingPassage2, //Object target for option 1\n \"\",\n openingPassage2\n );\n beginningQuote = new StorySection(\n \"''The cognizance of any creature increases by the amount of progression they make. The greater the cognizance, the larger the conscience.''\", //Beginnning quote by me\n \"(A) Next\", //Text for option 1\n openingPassage1, //Object target for option 1\n \"\",\n openingPassage1\n );\n title = new StorySection(\n \"The Golden Age\\n\\nThe Lunar Storm\\n\\n\\nControls are A and D on the keyboard.\",\n \"(A) Next\", //Text for option 1\n beginningQuote, //Object target for option 1\n \"by Melvin Mingoa\",\n beginningQuote\n );\n //introduction\n}", "function createMonster(level, items, position) {\n let monster = {\n name: monsterNames[Math.floor(Math.random() * 14)],\n level,\n hp: level * 100,\n attack: level * 10,\n speed: 6000 / level,\n items: cloneArray(items),\n position,\n type: 'monster',\n visual: 'M',\n resetToMaxHp: function() {\n let maxHP = this.level * 100;\n if (this.hp > maxHP) {\n this.hp = maxHP;\n }\n },\n getExp: function() {\n player.exp += this.level * 10;\n player.levelUp();\n },\n };\n print('Creating monster...');\n return monster;\n}", "create(data){\n\n\n\n\t\tconsole.log(data)\n\t\n\t\tthis.stadium = this.add.image(0,0,'stadium');\n\n\t\tvar text = this.add.text(window.outerWidth/2, window.outerHeight * .05, 'Choose Your Players', { font: window.outerWidth *.08 + 'px Arial', fill: '#FFFFFF' });\n\n\t\ttext.x = window.innerWidth/2 - text.width/2;\n\n\t\tthis.metro = this.add.sprite(0,0,'bow',1).setScale(1.5,1.5).setInteractive();\n\n\t\tthis.metro.respawn = {sheet:\"knifespritesheet.png\",};\n\t\t\n\t\tthis.metro.attack = this.anims.create({\n\t\t\tkey:'bow',\n\t\t\tframes: this.anims.generateFrameNumbers('bow',{frames:[0,1,2,3,4,0]}),\n\t\t\tframeRate:8\n\t\t})\n\n\t\tthis.metro.anims.load('bow');\n\n\t\n\t\tthis.metro.punch = this.sound.add(\"bowpunch\");\n\t\n\t\tthis.metro.punch.rate = .5;\n\n\t\tthis.addFighter(this.metro);\n\t\t\n\t\tthis.panther = this.add.sprite(0,0,'panther',1).setScale(1.25,1.25).setInteractive();\n\n\t\tthis.panther.attack = this.anims.create({\n\t\t\tkey:'pantherattack',\n\t\t\tframes: this.anims.generateFrameNumbers('panther',{frames:[0,1,2,3,4,0]}),\n\t\t\tframeRate:8\n\t\t})\n\n\t\tthis.panther.anims.load('pantherattack');\n\n\t\tthis.panther.punch = this.sound.add(\"pantherpunch\");\n\t\t\n\t\tthis.panther.punch.rate = 3;\n\n\t\tthis.addFighter(this.panther);\n\n\n\t\tthis.themeMusic = this.sound.add(\"sound\",{loop:\"true\"});\n\n\t\tthis.themeMusic.play();\n\n\t\tthis.sound.add(\"selectplayer\").play();\n\n\t\tthis.stadium.setOrigin(0,0)\n\t\tthis.stadium.scaleX = 3.0;\n\t\tthis.stadium.scaleY = 2.0;\n\n\t\tthis.default = {};\n\n\t\tthis.default.punch = this.sound.add(\"punch\");\n\t\tthis.default.punch.loop = true;\n\t\t\n\t\tthis.punch = this.default.punch;\n\n\n\n\n\t\t//Position Sprite at coord (0,0) ->(defaults to first Frame of spritesheet) \n\t\tthis.player1 = this.add.sprite(0,0,'characters').setInteractive();\n\t\t\n\t\tthis.player1.attack = this.anims.create({\n key: 'player1Attack',\n frames: this.anims.generateFrameNumbers('characters',{frames:[0,0,1,1,2,2,3,3,3,0]}),\n frameRate: 12\n });\n\n this.player1.anims.load('player1Attack');\n\n\t\tthis.player1.alpha = 1;\n\n\t\t//Load Into Array for easier placement on screen later\n\t\tthis.addFighter(this.player1);\n\n\n\t\t//Position Sprite at coord (300,300) ->(defaults to first Frame) \n\t\tthis.player2 = this.add.sprite(0,0,'characters').setInteractive();\n\n\t\tthis.player2.attack = this.anims.create({\n key: 'player2Attack',\n frames: this.anims.generateFrameNumbers('characters', {frames:[4,6,7,7,4]}),\n frameRate: 8,\n repeat: 0,\n\n });\n this.player2.anims.load('player2Attack');\n\n\t\t//Add Custom Punch Sound for Buttercup\n this.player2.punch = this.sound.add(\"buttercuppunch\");\n\n\t\tthis.player2.alpha = .8;\n\n\t\tthis.addFighter(this.player2);\n\n\n\t\t//Add Player 3\n\t\tthis.player3 = this.add.sprite(0,0,'characters2').setInteractive();\n\n \n this.player3.attack = this.anims.create({\n key: 'player3Attack',\n frames: this.anims.generateFrameNumbers('characters2', {frames:[0,4,5,6,0]}),\n frameRate: 3,\n repeat: 0,\n\n });\n\n this.player3.anims.load('player3Attack');\n\n //Add Custom Punch Sound for Hulk\n this.player3.punch = this.sound.add(\"hulksmash\");\n\n this.addFighter(this.player3);\n\n\t\t//sprite.x = window.innerWidth/2 - sprite.width/2;\n\t\t\n //Capture Mouseover onMouseEnter\n this.input.on('pointerover',(pointer,objs)=>{\n \tif(!objs[0].attack){\n \t\treturn;\n \t}\n \tthis.anims = objs[0].anims;\n \tthis.punch.loop= true;\n \tthis.sound.add(\"hover\").play();\n \tconsole.log(objs[0])\n \tobjs[0].flipX = true;\n \tobjs[0].alpha = 1;\n \tif(objs[0].punch){\n \t\tthis.punch = objs[0].punch;\n \t} else {\n\n \t\tthis.punch = this.default.punch;\n \t}\n\n \tthis.punch.play();\n \t\n \t\n \t\n \t\tobjs[0].anims.play(objs[0].attack.key);\n \t\n\n }).on('pointerout',(pointer,objs)=>{\n \t\n\n \tobjs[0].alpha = .7;\n \tobjs[0].flipX = false;\n \tif(objs[0].punch){\n \t\tobjs[0].punch.stop();\n \t}\n \t\n \t//objs[0].anims.pause(objs[0].attack.key)\n }).on('pointerdown',(pointer,objs)=>{\n\n\n \t\n\n \tthis.sound.add(\"coindrop\").play();\n\n\n \tif(objs.length == 0){\n \t\treturn;\n \t}\n\n \tif(objs[0] && objs[0].name == \"playButton\"){\n \t\tconsole.log(objs[0])\n \t\tconsole.log(\"Time to Play\")\n \t\tthis.themeMusic.stop();\n \t\tthis.scene.start(\"GamePlayScene\",this.userSelectedCharacters);\n \t\treturn;\n \t}\n\n \tif(this.totalSlotsRemaining-- <= 0){\n \t\tconsole.log(\"type something\")\n \t\treturn;\n\n \t} \n \t\n \tvar challenger = this.add.sprite(-200,this.question1.y,objs[0].frame.source.texture.key,objs[0].attack.frames[0].textureFrame).setScale(1,1)\n \t\n \t\n\n \tthis.tweens.add({\n \t\ttargets:challenger,\n \t\tx: this.userSelectedCharacters.length == 0 ? this.question1.x + this.question1.displayWidth/2: this.question2.x + this.question2.displayWidth/2,\n \t\tduration:1000,\n \t\tease:'Bounce',\n \t\tonComplete:()=>{\n \t\t\tchallenger.anims.load(objs[0].attack.key);\n \t\t\tthis.userSelectedCharacters.push(objs[0]);\n\n \t\t\tthis.punch.play();\n \t\t\tthis.anims = challenger.anims;\n \t\t\tchallenger.anims.play(objs[0].attack.key);\n \t\t\tif(this.totalSlotsRemaining == 0){\n \t\t\t\t\n \t\t\t\tvar fight = this.sound.add(\"fight\").play()\n \t\t\t\t\n \t\t\t\tthis.play.anims.play(\"active\");\n\n \t\t\t\tthis.hideFighters(()=>{\n\t\t \t\t\tthis.play.alpha = 1;\n\t\t \t\t\tthis.sound.add(\"boing\").play();\n\t\t \t\t\tthis.tweens.add({\n\n\t\t\t\t \t\ttargets:[this.play],\n\t\t\t\t \t\ty: this.fighters[0].y,\n\t\t\t\t \t\t\n\t\t\t\t \t\tduration:500,\n\t\t\t\t \t\tease:'Bounce',\n\t\t\t\t \t\tonComplete : ()=>{\n\t\t\t\t \t\t\tthis.sound.add(\"letsgo\").play();\n\t\t\t\t \t\t}\t\t \t\t\n\t\t\t\t\t\t\t})\n \t\t\t\t}); \n \t\t\t\t\t\t \t\t\t\n \t\t\t}\n \t\t}\n \t})\n\n \tconsole.log(objs[0].attack.frames[0].textureFrame)\n\n })\n\n this.drawFighters((text.y + text.displayHeight) * 1.5);\n\n this.drawCharacterSelectedBox();\n\n this.play = this.add.sprite(0,-100,'buttons',0).setInteractive().setOrigin(0,0);\n this.play.name = \"playButton\";\n \n this.play.setX(window.innerWidth/2 - this.play.width/2);\n this.play.alpha = 0;\n this.anims.create({\n \tkey:\"active\",\n \tframes: this.anims.generateFrameNumbers('buttons', {frames:[1,1,1,1,0,0,0,0]}),\n \tframeRate:3,\n \trepeat:-1\n })\n \n\n this.play.anims.load(\"active\");\n \n \n\t}", "function createDiscs() {\n firstPole.append(smallDisc, mediumDisc, bigDisc);\n }", "function createMonster(number, x, y) {\n\tvar monster = svgdoc.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\n\tmonster.setAttribute(\"x\", x);\n\tmonster.setAttribute(\"y\", y);\n\tMONSTER_INIT_POS[number] = new Point(x,y);\n\tMONSTER_ON_PLATFORM[number] = false;\n\tMONSTER_INIT_DIRECTION[number] = motionType.RIGHT;\n\t\n\tmonster.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#monster\");\n\tsvgdoc.getElementById(\"monsters\").appendChild(monster);\n\t\n \n\t//if monster is the last monster\n\tif(number == monster_BULLET_SHOOT) {\n\t\tvar newMonster = new Monster(monster, x, y, true);\n\t} else {\n\t\tvar newMonster = new Monster(monster, x, y, false);\n\t}\n monsters.push(newMonster);\n\t//console.log(\"New Monster was added to the list \" + JSON.stringify(monsters));\n}", "function startWorm(color)\r\n{\r\n\t// TODO: Limit the place and border proximity to avoid fast death\r\n\t// Getting Random Postitions and Angle\r\n\tx = Math.floor(Math.random()*xMax);\r\n\ty = Math.floor(Math.random()*yMax);\r\n\tangle = Math.floor(Math.random()*angleMax);\r\n\ti = getWormIndexByColor(color);\r\n\r\n\tif(!isNewRound)\r\n\t{\r\n\t\tworms[i] = new worm;\r\n\t\tworms[i].score = 0;\r\n\t}\r\n\t\t\r\n\tworms[i].x = x;\r\n\tworms[i].y = y;\r\n\tworms[i].angle = angle;\r\n\tworms[i].color = color;\r\n\tworms[i].alive = true;\r\n\tworms[i].playing = true;\r\n\tworms[i].length = 0; //31;\r\n\t\r\n\tdrawWorm(worms[i]);\r\n}", "function create() {\n //create background, ground, set world bounds, and display score and high score\n let background = this.add.image(400, 300, \"background\").setDepth(-5);\n background.scaleY = ((config.height - 120) * heightScale) / background.height;\n background.scaleX = (config.width * widthScale) / background.width;\n this.matter.world.setBounds(0, 0, game.config.width, game.config.height);\n ground = this.matter.add.rectangle(400, 505, 800, 4, { isStatic: true });\n scoreDisplay = this.add\n .text(40, 530, \"Score: \" + hoops.passCount)\n .setDepth(2);\n highDisplay = this.add\n .text(30, 550, \"High Score: \" + gameState.highScore)\n .setDepth(2);\n timeDisplay = this.add.line();\n timeDisplay.setDepth(5);\n timeDisplay.setStrokeStyle(10, 0xa8ff8b, 1);\n timeDisplay.setTo(0, 580, 64, 580);\n let sidebar = this.add.image(400, 655, \"sidebar\").setDepth(-5);\n sidebar.scaleX = (800 * widthScale) / sidebar.width;\n sidebar.scaleY = (130 * heightScale) / sidebar.height;\n title = this.add.image(400, 50, \"title\").setDepth(-4);\n title.setScale((500 * widthScale) / title.width);\n\n //create jets and hoops\n createJet(this, 130, 0);\n createJet(this, 400, 1);\n createJet(this, 670, 2);\n createHoop(this, 265, 328, 0); //175\n createHoop(this, 535, 355, 1); //225\n\n //create floatable objects\n orangeBall = this.matter.add.image(40, 340, \"ball\", null, {\n friction: 0.5,\n restitution: 0.5,\n shape: \"circle\",\n });\n\n orangeBall\n .setInteractive()\n .setScale((30 * widthScale) / orangeBall.width)\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n ballFX.play();\n }\n });\n orangeBall.name = \"ballA\";\n this.input.setDraggable(orangeBall);\n\n ball2 = this.matter.add.image(100, 645, \"ball\", null, {\n friction: 0.5,\n restitution: 0.5,\n shape: \"circle\",\n });\n ball2\n .setInteractive()\n .setScale(((30 * widthScale) / orangeBall.width) * 2)\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n ballFX.play();\n }\n });\n ball2.name = \"ballB\";\n ball2.tint = 0x808080;\n this.input.setDraggable(ball2);\n\n leaf = this.matter.add.image(320, 640, \"leaf\", null, {\n shape: this.cache.json.get(\"leafShape\").leaf,\n friction: 0.7,\n restitution: 0,\n frictionAir: 0.08,\n gravityScale: { x: 0.2 },\n });\n leaf.setInteractive().setScale((45 * widthScale) / leaf.width);\n leaf.name = \"leaf\";\n leaf.tint = 0x808080;\n this.input.setDraggable(leaf);\n\n anvil = this.matter.add.image(740, 650, \"anvil\", null, {\n shape: this.cache.json.get(\"anvilShape\").anvil,\n friction: 0.7,\n restitution: 0,\n frictionAir: 0,\n gravityScale: { x: 0 },\n });\n anvil.setInteractive().setScale((45 * heightScale) / anvil.height);\n anvil.name = \"anvil\";\n anvil.tint = 0x808080;\n this.input.setDraggable(anvil);\n\n balloon = this.matter.add.image(175, 640, \"balloon\", null, {\n shape: this.cache.json.get(\"balloonShape\").balloon,\n friction: 0.7,\n density: 0.0007,\n frictionAir: 0.12,\n });\n balloon.setInteractive().setScale((55 * heightScale) / balloon.height);\n balloon.name = \"balloon\";\n balloon.tint = 0x808080;\n this.input.setDraggable(balloon);\n\n fabric = this.matter.add.image(245, 640, \"fabric\", null, {\n shape: this.cache.json.get(\"fabricShape\").fabric,\n friction: 0.7,\n restitution: 0,\n frictionAir: 0.04,\n gravityScale: { x: 0.2 },\n });\n fabric.setInteractive().setScale((40 * heightScale) / fabric.height);\n fabric.name = \"fabric\";\n fabric.tint = 0x808080;\n this.input.setDraggable(fabric);\n\n parachute = this.matter.add.image(510, 630, \"parachute\", null, {\n shape: this.cache.json.get(\"parachuteShape\").parachute,\n friction: 0.7,\n restitution: 0,\n frictionAir: 0.12,\n gravityScale: { x: 0.2 },\n });\n parachute.setInteractive().setScale((45 * widthScale) / parachute.width);\n parachute.name = \"parachute\";\n parachute.tint = 0x808080;\n this.input.setDraggable(parachute);\n\n airplane = this.matter.add.image(440, 645, \"airplane\", null, {\n shape: this.cache.json.get(\"airplaneShape\").airplane,\n friction: 0.7,\n restitution: 0,\n frictionAir: 0.06,\n gravityScale: { x: 0.2 },\n });\n airplane.setInteractive().setScale((35 * heightScale) / airplane.height);\n airplane.name = \"airplane\";\n airplane.tint = 0x808080;\n this.input.setDraggable(airplane);\n\n bubbleL = this.matter.add.image(580, 655, \"bubble\", null, {\n shape: \"circle\",\n frictionAir: 0.12,\n density: 0.0007,\n });\n bubbleL\n .setInteractive()\n .setScale((40 * widthScale) / bubbleL.width)\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n bubbleFX.play();\n // bubbleL.setStatic(true);\n // bubbleL.x = gameState.objData[bubbleL.name].homeX;\n // bubbleL.y = gameState.objData[bubbleL.name].homeY;\n // hoops.hoopState[bubbleL.name][0] = \"empty\";\n // hoops.hoopState[bubbleL.name][1] = \"empty\";\n gameState.objData[bubbleL.name].teleporting = true\n }\n });\n bubbleL.name = \"bubbleLarge\";\n bubbleL.tint = 0x808080;\n this.input.setDraggable(bubbleL);\n\n bubbleM = this.matter.add.image(610, 640, \"bubble\", null, {\n shape: \"circle\",\n frictionAir: 0.12,\n density: 0.0007,\n });\n bubbleM\n .setInteractive()\n .setScale((25 * widthScale) / bubbleM.width)\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n bubbleFX.play();\n // bubbleM.setStatic(true);\n // bubbleM.x = gameState.objData[bubbleM.name].homeX;\n // bubbleM.y = gameState.objData[bubbleM.name].homeY;\n // hoops.hoopState[bubbleM.name][0] = \"empty\";\n // hoops.hoopState[bubbleM.name][1] = \"empty\";\n gameState.objData[bubbleM.name].teleporting = true\n }\n });\n bubbleM.name = \"bubbleMedium\";\n bubbleM.tint = 0x808080;\n this.input.setDraggable(bubbleM);\n\n bubbleS = this.matter.add.image(592, 625, \"bubble\", null, {\n shape: \"circle\",\n frictionAir: 0.12,\n density: 0.0007,\n });\n bubbleS\n .setInteractive()\n .setScale((17 * widthScale) / bubbleS.width)\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n bubbleFX.play();\n // bubbleS.setStatic(true);\n // bubbleS.x = gameState.objData[bubbleS.name].homeX;\n // bubbleS.y = gameState.objData[bubbleS.name].homeY;\n // hoops.hoopState[bubbleS.name][0] = \"empty\";\n // hoops.hoopState[bubbleS.name][1] = \"empty\";\n gameState.objData[bubbleS.name].teleporting = true\n }\n });\n bubbleS.name = \"bubbleSmall\";\n bubbleS.tint = 0x808080;\n this.input.setDraggable(bubbleS);\n\n drop = this.matter.add.sprite(655, 645, \"drop\", 0, { shape: \"circle\" });\n this.anims.create({\n key: \"splash\",\n frames: this.anims.generateFrameNumbers(\"drop\", { start: 0, end: 5 }),\n frameRate: 20,\n repeat: 0,\n });\n this.anims.create({\n key: \"normalDrop\",\n frames: [{ key: \"drop\", frame: 0 }],\n frameRate: 20,\n repeat: -1,\n });\n drop\n .setInteractive()\n .setScale((30 * heightScale) / drop.height)\n .setBody({\n width: 32 * heightScale,\n height: 32 * heightScale,\n type: \"circle\",\n })\n .setOnCollide((pair) => {\n if (\n (!pair.bodyA.name || !pair.bodyA.name.startsWith(\"hoop\")) &&\n (!pair.bodyB.name || !pair.bodyB.name.startsWith(\"hoop\"))\n ) {\n waterFX.play();\n // if (!drop.isStatic()) {\n // drop.setStatic(true);\n // }\n // drop.setCollisionCategory(null);\n // hoops.hoopState[drop.name][0] = \"empty\";\n // hoops.hoopState[drop.name][1] = \"empty\";\n drop.anims.play(\"splash\");\n gameState.objData[drop.name].teleporting = true\n gameState.objData[drop.name].prevRotate = drop.rotation\n }\n })\n .on(\"animationcomplete\", () => {\n drop.x = gameState.objData[drop.name].homeX;\n drop.y = gameState.objData[drop.name].homeY;\n drop.rotation = 0;\n drop.setCollisionCategory(1);\n drop.anims.play(\"normalDrop\");\n\n });\n drop.name = \"waterDrop\";\n drop.tint = 0x808080;\n this.input.setDraggable(drop);\n\n this.matter.world.on(\"collisionstart\", (evt, bodyA, bodyB) => {\n if (bodyA.label === \"anvil\" || bodyB.label === \"anvil\") {\n anvilFX.play();\n }\n if (bodyA.label === \"balloon\" || bodyB.label === \"balloon\") {\n balloonFX.play();\n }\n if (bodyA.label === \"airplane\" || bodyB.label === \"airplane\") {\n planeFX.play();\n }\n });\n this.game.events.on('prerender', () => {\n if(gameState.objData[drop.name].teleporting){\n drop.rotation = gameState.objData[drop.name].prevRotate\n }\n })\n this.game.events.on('postrender', () => {\n gameState.objectsArr.forEach(warpObj => {\n if(warpObj.name.startsWith('bubble') && gameState.objData[warpObj.name].teleporting){\n if(!warpObj.isStatic()){\n warpObj.setStatic(true)}\n warpObj.x = gameState.objData[warpObj.name].homeX\n warpObj.y = gameState.objData[warpObj.name].homeY\n hoops.hoopState[warpObj.name][0] = 'empty'\n hoops.hoopState[warpObj.name][1] = 'empty'\n gameState.objData[warpObj.name].teleporting = false\n \n }else if(warpObj.name === 'waterDrop' && gameState.objData[warpObj.name].teleporting){\n if (!drop.isStatic()) {\n drop.setStatic(true);\n }\n drop.setCollisionCategory(null);\n hoops.hoopState[drop.name][0] = \"empty\";\n hoops.hoopState[drop.name][1] = \"empty\";\n gameState.objData[warpObj.name].teleporting = false\n }\n })\n })\n\n //drag events\n this.input.on(\"drag\", (pointer, gameObject, x, y) => {\n if (gameState.objData[gameObject.name].unlockAt <= gameState.highScore) {\n gameObject.setPosition(x, y);\n }\n });\n this.input.on(\"dragstart\", (pointer, gameObject) => {\n gameState.objectsArr.forEach((resetObj) => {\n if (gameObject.name !== resetObj.name) {\n if (!resetObj.isStatic()) {\n resetObj.setStatic(true);\n }\n resetObj.x = gameState.objData[resetObj.name].homeX;\n resetObj.y = gameState.objData[resetObj.name].homeY;\n resetObj.rotation = 0;\n }\n });\n gameObject.setCollisionCategory(null);\n if (!gameObject.isStatic()) {\n gameObject.setStatic(true);\n }\n //while the game is running, apply a score penalty for dragging objects\n if (gameState.running) {\n hoops.passCount -= Math.floor(\n gameState.objData[gameObject.name].scoreVal * 0.4\n );\n if (hoops.passCount < 0) {\n hoops.passCount = 0;\n }\n scoreDisplay.text = \"Score: \" + hoops.passCount;\n }\n });\n this.input.on(\"dragend\", (pointer, gameObject) => {\n gameObject.setCollisionCategory(1);\n gameObject.setStatic(false);\n });\n\n //add floatable objects to gameState's array and fill out objData\n gameState.objectsArr.push(orangeBall);\n gameState.objData[orangeBall.name] = {\n scoreVal: 50,\n airEff: 1,\n flowPenalty: 0,\n unlockAt: 0,\n homeX: 40,\n homeY: 650,\n };\n gameState.objectsArr.push(ball2);\n gameState.objData[ball2.name] = {\n scoreVal: 100,\n airEff: 2,\n flowPenalty: 4,\n unlockAt: 150,\n homeX: 100,\n homeY: 645,\n };\n this.add.text(85, 685, gameState.objData[ball2.name].unlockAt);\n gameState.objectsArr.push(leaf);\n gameState.objData[leaf.name] = {\n scoreVal: 250,\n airEff: 2.5,\n flowPenalty: 0,\n unlockAt: 500,\n homeX: 320,\n homeY: 640,\n floatRight: true,\n };\n this.add.text(305, 685, gameState.objData[leaf.name].unlockAt);\n gameState.objectsArr.push(bubbleL);\n gameState.objData[bubbleL.name] = {\n scoreVal: 400,\n airEff: 5,\n flowPenalty: 0,\n unlockAt: 800,\n homeX: 580,\n homeY: 655,\n teleporting: false,\n };\n gameState.objectsArr.push(bubbleM);\n gameState.objData[bubbleM.name] = {\n scoreVal: 400,\n airEff: 3,\n flowPenalty: 0,\n unlockAt: gameState.objData[bubbleL.name].unlockAt,\n homeX: 610,\n homeY: 640,\n teleporting: false,\n };\n gameState.objectsArr.push(bubbleS);\n gameState.objData[bubbleS.name] = {\n scoreVal: 400,\n airEff: 1.5,\n flowPenalty: 0,\n unlockAt: gameState.objData[bubbleL.name].unlockAt,\n homeX: 592,\n homeY: 625,\n teleporting: false,\n };\n this.add.text(580, 685, gameState.objData[bubbleL.name].unlockAt);\n gameState.objectsArr.push(drop);\n gameState.objData[drop.name] = {\n scoreVal: 450,\n airEff: 1,\n flowPenalty: 0,\n unlockAt: 900,\n homeX: 655,\n homeY: 645,\n teleporting: false,\n prevRotate: 0,\n };\n this.add.text(638, 685, gameState.objData[drop.name].unlockAt);\n gameState.objectsArr.push(anvil);\n gameState.objData[anvil.name] = {\n scoreVal: 300,\n airEff: 0,\n flowPenalty: 0,\n unlockAt: 1000,\n homeX: 725,\n homeY: 645,\n };\n this.add.text(700, 685, gameState.objData[anvil.name].unlockAt);\n gameState.objectsArr.push(balloon);\n gameState.objData[balloon.name] = {\n scoreVal: 150,\n airEff: 4,\n flowPenalty: 0,\n unlockAt: 250,\n homeX: 175,\n homeY: 640,\n };\n this.add.text(160, 685, gameState.objData[balloon.name].unlockAt);\n gameState.objectsArr.push(airplane);\n gameState.objData[airplane.name] = {\n scoreVal: 300,\n airEff: 2.5,\n flowPenalty: 0,\n unlockAt: 600,\n homeX: 440,\n homeY: 645,\n };\n this.add.text(400, 685, gameState.objData[airplane.name].unlockAt);\n gameState.objectsArr.push(fabric);\n gameState.objData[fabric.name] = {\n scoreVal: 200,\n airEff: 2,\n flowPenalty: 0,\n unlockAt: 400,\n homeX: 245,\n homeY: 640,\n };\n this.add.text(230, 685, gameState.objData[fabric.name].unlockAt);\n gameState.objectsArr.push(parachute);\n gameState.objData[parachute.name] = {\n scoreVal: 350,\n airEff: 2.5,\n flowPenalty: 0,\n unlockAt: 700,\n homeX: 510,\n homeY: 630,\n floatRight: false,\n };\n this.add.text(500, 685, gameState.objData[parachute.name].unlockAt);\n\n //use gameState's array to populate hoopState\n gameState.objectsArr.forEach((gameObj) => {\n hoops.hoopState[gameObj.name] = [\"empty\", \"empty\"];\n });\n\n //-------------------------------------------------------------Sound FX------------------------------------------------------------------------//\n //sound FX for air\n let jetFX = this.sound.add(\"StrongAir\", { volume: 0.35 });\n jetFX.setMute(true);\n\n //sound fx for ball bounce\n let ballFX = this.sound.add(\"ballBounce\", { volume: 0.55 });\n ballFX.setMute(true);\n\n //sound fx for bubble pop\n let bubbleFX = this.sound.add(\"BubblePop\", { volume: 0.55 });\n bubbleFX.setMute(true);\n\n //sound fx for water drop\n let waterFX = this.sound.add(\"waterDrop\", { volume: 0.55 });\n waterFX.setMute(true);\n\n let anvilFX = this.sound.add(\"anvilDrop\", { volume: 0.55 });\n anvilFX.setMute(true);\n\n let balloonFX = this.sound.add(\"balloon\", { volume: 0.55 });\n balloonFX.setMute(true);\n\n let planeFX = this.sound.add(\"paperPlane\", { volume: 0.55 });\n planeFX.setMute(true);\n\n //--------------------------------------------buttons------------------------------------------//\n //setup start button\n startButton = this.add\n .image(750, 50, \"button\")\n .setInteractive()\n .on(\"pointerdown\", () => {\n //when clicking the start button,\n //if the game is running do nothing,\n //otherwise start the game, turn on the jets, reset the score and set the time when the game will end\n if (!gameState.running) {\n gameState.running = true;\n startButton.setDepth(-1);\n jetFX.play();\n jets.enabled[0] = true;\n jets.enabled[1] = true;\n jets.enabled[2] = true;\n jetPressure(this, 0);\n jetPressure(this, 1);\n jetPressure(this, 2);\n hoops.passCount = 0;\n scoreDisplay.text = \"Score: \" + hoops.passCount;\n gameState.gameEnd = Date.now() + timerMax;\n timeDisplay.setTo(0, 580, 864, 580);\n baseOff[0].setDepth(-1);\n baseOn[0].setDepth(1);\n baseOff[1].setDepth(-1);\n baseOn[1].setDepth(1);\n baseOff[2].setDepth(-1);\n baseOn[2].setDepth(1);\n if(title.visible){\n title.setVisible(false)\n }\n }\n });\n\n startButton.setScale((80 * heightScale) / startButton.height).setDepth(1);\n this.add\n .image(750, 50, \"buttonDisabled\")\n .setScale((80 * heightScale) / startButton.height);\n //button to toggle muting, starts muted then toggles sound on. Might pull out and make own function\n speakerIcon = this.add\n .image(50, 40, \"speakerIcon\")\n .setInteractive()\n .on(\"pointerdown\", () => {\n if (\n jetFX.setMute(false) &&\n bubbleFX.setMute(false) &&\n ballFX.setMute(false) &&\n waterFX.setMute(false) &&\n anvilFX.setMute(false) &&\n balloonFX.setMute(false) &&\n planeFX.setMute(false)\n ) {\n jetFX.setMute(true);\n bubbleFX.setMute(true);\n ballFX.setMute(true);\n waterFX.setMute(true);\n anvilFX.setMute(true);\n balloonFX.setMute(true);\n planeFX.setMute(true);\n speakerIcon.setDepth(-6);\n mutedIcon.setDepth(1);\n }\n });\n speakerIcon.setScale(0.06).setDepth(-6);\n mutedIcon = this.add\n .image(50, 40, \"mutedIcon\")\n .setInteractive()\n .on(\"pointerdown\", () => {\n if (\n jetFX.setMute(true) &&\n bubbleFX.setMute(true) &&\n ballFX.setMute(true) &&\n waterFX.setMute(true) &&\n anvilFX.setMute(true) &&\n balloonFX.setMute(true) &&\n planeFX.setMute(true)\n ) {\n jetFX.setMute(false);\n bubbleFX.setMute(false);\n ballFX.setMute(false);\n waterFX.setMute(false);\n anvilFX.setMute(false);\n balloonFX.setMute(false);\n planeFX.setMute(false);\n mutedIcon.setDepth(-6);\n speakerIcon.setDepth(1);\n }\n });\n mutedIcon.setScale(0.05).setDepth(1);\n}", "function create ()\r\n\t{\r\n\t//lägger in tilemap\r\n\tvar map = this.make.tilemap({ key: 'map' });\r\n\t\r\n\t//lägger till ett tileset\r\n\tvar tileset = map.addTilesetImage('Materials');\r\n\t\r\n\t//gör mappen grafisk och interaktable men detta funkar inte för tillfället\r\n\t//var layer = map.createStaticLayer(0, ground, 0, 0);\r\n\t\r\n\t\r\n\t// skapar himlen\r\n\tthis.add.image(400,300, 'sky');\r\n\tthis.add.image(1200,300, 'sky');\r\n\tthis.add.image(2000,300, 'sky');\r\n\tthis.add.image(2800,300, 'sky');\r\n\tthis.add.image(3600,300, 'sky');\r\n\t\r\n\tvar music = this.sound.add('music1');\r\n\tmusic.play();\r\n\t\r\n\t//gör en statisk grupp med fysik till \"platforms\"\r\n\tplatforms = this.physics.add.staticGroup();\r\n\t\r\n\t//Skapar en stor platform som är spelets mark\r\n\tplatforms.create(400, 550, 'ground');\r\n\tplatforms.create(1200, 550, 'ground');\r\n\tplatforms.create(2000, 550, 'ground');\r\n\tplatforms.create(2800, 550, 'ground');\r\n\tplatforms.create(3600, 550, 'ground');\r\n\t\r\n\t//Skapar två platformar\r\n\tplatforms.create(100, 400, 'platform');\r\n\tplatforms.create(500, 300, 'platform');\r\n\r\n\t//skapar en statisk grupp med fysik till \"grassBox\"\r\n\tgrassBox = this.physics.add.staticGroup();\r\n\r\n\tgrassBox.create(1000, 488,'grassBox');\r\n\tgrassBox.create(1224, 488, 'grassBox');\r\n\r\n\t//skapar en statisk grupp med fysik till \"spikes\"\r\n\tspikes = this.physics.add.staticGroup();\r\n\r\n\t//första \"spike rown\" i spelet\r\n\tspikes.create(1032, 484, 'spikes');\r\n\tspikes.create(1064, 484, 'spikes');\r\n\tspikes.create(1096, 484, 'spikes');\r\n\tspikes.create(1128, 484, 'spikes');\r\n\tspikes.create(1160, 484, 'spikes');\r\n\tspikes.create(1192, 484, 'spikes');\r\n\r\n\t//första \"Spike rown\" i spelet efter andra lådan\r\n\tspikes.create(1254, 484, 'spikes');\r\n\tspikes.create(1286, 484, 'spikes');\r\n\tspikes.create(1318, 484, 'spikes');\r\n\tspikes.create(1350, 484, 'spikes');\r\n\tspikes.create(1382, 484, 'spikes');\r\n\tspikes.create(1414, 484, 'spikes');\r\n\t\r\n\t//flag.create(1032, 484, 'flag');\r\n\r\n\t//lägger in texten som säger hur många poäng jag har\r\n\tpointText = this.add.text(2, 2, 'points: ' + points, {fontSize: '32px', fill: '#000'});\r\n\t\r\n\t//Lägger till en ny grup som heter \"coins\" den ska ha fysik men vara \"Static\"\r\n\tcoins = this.physics.add.staticGroup();\r\n\tcoins.create(400, 450, 'coin');\r\n\tcoins.create(1110, 390, 'coin');\r\n\tcoins.create(700, 450, 'coin');\r\n\t\r\n\t//skapar spelaren och lägger till fysik \r\n\tplayer = this.physics.add.sprite(100, 350, 'player');\r\n\tplayer.body.setSize(10, 32, 50, 25);\r\n\t\r\n\t//gör så att spelaren kommer studsa på emot andra pysiska grupper\r\n player.setBounce(0.2);\r\n\t\r\n //blockar spelaren från att gå \"out of bounds\"\r\n\tplayer.setCollideWorldBounds(true);\r\n\tplayer.smoothed = false;\r\n\t\r\n\t//lägger till \"Slime\"\r\n\tslime = this.physics.add.sprite(470,265, 'slime');\r\n\t\r\n\t\r\n\t\r\n\t//gör så att spelaren koliderar med platformarna med andra ord spelaren kan inte trilla igenom dom \r\n\t//och likt spelaren så är det andra grupper som samma sak händer med nedanför\r\n\tthis.physics.add.overlap(player, slime, death, null, this);\r\n\tthis.physics.add.overlap(player, coins, collectCoins, null, this);\r\n\tthis.physics.add.overlap(player, spikes, death, null, this);\r\n\r\n\tthis.physics.add.collider(player, platforms);\r\n\tthis.physics.add.collider(coins, platforms);\r\n\tthis.physics.add.collider(slime, platforms);\r\n\tthis.physics.add.collider(player, slime);\r\n\tthis.physics.add.collider(player, spikes);\r\n\tthis.physics.add.collider(player, grassBox);\r\n\t\r\n\t //skapar en animation \"left\"\r\n this.anims.create({\r\n key: 'left',\r\n frames: this.anims.generateFrameNumbers('player', { start: 0, end: 5 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n\t//skapar en animation \"idle\"\r\n this.anims.create({\r\n key: 'idle',\r\n frames: [ { key: 'player', frame: 6 } ],\r\n frameRate: 20\r\n });\r\n\t\r\n\t//skapar en animation \"right\"\r\n this.anims.create({\r\n key: 'right',\r\n frames: this.anims.generateFrameNumbers('player', { start: 7, end: 12 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\t\r\n\tthis.anims.create({\r\n key: 'slimeAni',\r\n frames: this.anims.generateFrameNumbers('slime', { start: 0, end: 4 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\t\r\n\t//lägger till tangentbords nyklar\r\n\tcursors = this.input.keyboard.createCursorKeys();\r\n\t\r\n\t//Olika kamera inställningar\r\n\tthis.cameras.main.setSize(800, 600);\r\n\tthis.cameras.main.setBounds(0, 0, 4000, 600);\r\n this.physics.world.setBounds(0, 0, 4000, 600);\r\n\tthis.cameras.main.startFollow(player);\r\n\tthis.cameras.main.setZoom(1.2);\r\n\tthis.cameras.main.roundPixels = false;\r\n\t//här lägger jag till en extra kamera för att kunna se mina poäng\r\n\tthis.cameras.add(0, 0, 210, 35);\r\n\t\r\n\tvar combo = this.input.keyboard.createCombo('krm', {resetOnMatch: true});\r\n\t\r\n\t//detta är en fusk kod\r\n\tthis.input.keyboard.on('keycombomatch', function (event) \r\n\t{\r\n\t\r\n\tpoints += 50;\r\n\t\r\n\tpointText.setText('points: ' + points);\r\n\t\r\n\tconsole.log('I see you found a cheat code');\r\n\t\r\n\t});\r\n\t\r\n\t//bara ett medelande till konsolen så jag enklare kan se vart det gick fel\r\n\tconsole.log(\"function create loaded fine\");\r\n}", "create(){\n\t\t\n\t\tthis.tp = \n\t\t\t[\n\t\t\t\t{x:22,y:-1,go: \"m7_scene\",xtp:9,ytp:11},\t\n\t\t\t\t{x:4,y:24,go: \"m9_scene\",xtp:32,ytp:0},\t\n\t\t\t]\n\t\t\t\n\t\t\t\n\t\tthis.eventMap = []\n\t\tthis.eventMap[13] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_1.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:0,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"swwwig swwig!\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\tthis.eventMap[9] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_2.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:-64,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"GRRRR....\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\tthis.musicData = {\n\t\t\tname: \"music_bytes_the_retro_adventure\",\n\t\t\tvolume: 0.4,\n\t\t\tloop: true\n\t\t}\n\t\t\n\t\t\n\t\tthis.mapCreate();\n\t\tthis._create();\n\n\t\t\t\n\t\t\t\n\t}", "function creaEnemigos() {\n bodyDef.type = b2Body.b2_dynamicBody;\n rangoMaxMirandom = 6;\n rangoMinMirandom = 3;\n mirandom = Math.floor(Math.random()*(rangoMaxMirandom-(rangoMinMirandom-1))) + rangoMinMirandom;\n for(var i = 0; i < mirandom; ++i) { //aqui meter un random para que cree de 1 a 3 circulos(agujas)\n \n rangoXa = 10;\n rangoXb = -10;\n vX = Math.floor(Math.random()*(rangoXa-(rangoXb-10))) + rangoXb;\n rangoYa = 35; \n rangoYb = 10;\n vY = Math.floor(Math.random()*(rangoYa-(rangoYb-10))) + rangoYb;\n radioEnemigos = 0.2; //delimita el radio de la punta de la aguja, 2px\n fixDef.shape = new b2CircleShape(radioEnemigos);\n bodyDef.position.x = Math.ceil(Math.random()*29);\n bodyDef.position.y = 1;\n var ball = world.CreateBody(bodyDef);\n var fixture = ball.CreateFixture(fixDef);\n fixture.GetShape().my_type = \"enemigo\"; \n\n ball.SetLinearVelocity(new b2Vec2(vX,vY)) // Establecemos la velocidad con la que saldrá la bola\n\n } \n}", "function createLevel() {\n createFuels();\n createTrees();\n\n startTimer();\n}", "function createGame () {}", "function makeBuilding(options) {\n \n var wallX = options.width / 2;\n var wallY = options.height;\n var wallZ = options.depth / 2;\n \n // collect walls\n var building = {};\n \n // south/noth walls\n [true, false].forEach(function (isSouth) {\n var wallTZ = isSouth ? -wallZ : wallZ;\n var wallGroup = new Group({\n addTo: options.addTo,\n translate: {\n z: wallTZ\n },\n });\n \n var wallPath = [{\n x: -wallX,\n y: -wallY\n }];\n \n if (options.gable == 'ns') {\n wallPath.push({\n x: 0,\n y: -wallY - wallX\n });\n }\n \n wallPath = wallPath.concat([{\n x: wallX,\n y: -wallY\n },\n {\n x: wallX,\n y: 0\n },\n {\n x: -wallX,\n y: 0\n },\n ]);\n \n // wall\n new Shape({\n path: wallPath,\n addTo: wallGroup,\n color: isSouth ? red : gold,\n });\n \n var windowColor = isSouth ? navy : red;\n var windowProperty = isSouth ? 'southWindows' : 'northWindows';\n handleWindows(options, windowProperty, wallGroup, windowColor);\n \n var wallProperty = isSouth ? 'southWall' : 'northWall';\n building[wallProperty] = wallGroup;\n \n });\n \n // east/west wall\n [true, false].forEach(function (isWest) {\n var wallGroup = new Group({\n addTo: options.addTo,\n translate: {\n x: isWest ? -wallX : wallX\n },\n rotate: {\n y: TAU / 4\n },\n });\n \n var wallPath = [{\n x: -wallZ,\n y: -wallY\n }];\n \n if (options.gable == 'ew') {\n wallPath.push({\n x: 0,\n y: -wallY - wallZ\n });\n }\n \n wallPath = wallPath.concat([{\n x: wallZ,\n y: -wallY\n },\n {\n x: wallZ,\n y: 0\n },\n {\n x: -wallZ,\n y: 0\n },\n ]);\n \n // wall\n new Shape({\n path: wallPath,\n addTo: wallGroup,\n color: isWest ? blue : white,\n });\n \n var windowColor = isWest ? navy : blue;\n var windowProperty = isWest ? 'westWindows' : 'eastWindows';\n handleWindows(options, windowProperty, wallGroup, windowColor);\n \n var wallProperty = isWest ? 'westWall' : 'eastWall';\n building[wallProperty] = wallGroup;\n });\n \n \n var roofMakers = {\n ns: function () {\n var y0 = -wallY - wallX;\n var roofPanel = new Shape({\n path: [{\n x: 0,\n y: y0,\n z: -wallZ\n },\n {\n x: 0,\n y: y0,\n z: wallZ\n },\n {\n x: wallX,\n y: -wallY,\n z: wallZ\n },\n {\n x: wallX,\n y: -wallY,\n z: -wallZ\n },\n ],\n addTo: options.addTo,\n color: gold,\n });\n roofPanel.copy({\n scale: {\n x: -1\n },\n color: navy,\n });\n },\n \n ew: function () {\n var y0 = -wallY - wallZ;\n var xA = options.isChurch ? -wallX + 8 : -wallX;\n var roofPanel = new Shape({\n path: [{\n z: 0,\n y: y0,\n x: xA\n },\n {\n z: 0,\n y: y0,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: xA\n },\n ],\n addTo: options.addTo,\n color: red,\n });\n roofPanel.copy({\n path: [{\n z: 0,\n y: y0,\n x: -wallX\n },\n {\n z: 0,\n y: y0,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: -wallX\n },\n ],\n scale: {\n z: -1\n },\n color: navy,\n });\n },\n };\n \n var roofMaker = roofMakers[options.gable];\n if (roofMaker) {\n roofMaker();\n }\n \n return building;\n }", "function create(){\n\tthis.add.image(400,300,'background');\n\n\tplatforms = this.physics.add.staticGroup();\n\n\t\tplatforms.create(310,490,'sol').setScale(0.15,1).refreshBody();\n\t\tplatforms.create(10,460,'sol').setScale(0.15).refreshBody();\n\n\n\t\tplatforms.create(480,500,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(600,500,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(400,460,'sol').setScale(0.15).refreshBody();\n\n\t\tplatforms.create(600,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(670,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(740,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(810,590,'sol').setScale(0.15).refreshBody();\n\n\t\tplatforms.create(100,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(170,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(240,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(310,368,'sol').setScale(0.15).refreshBody();\n\t\n\t\tplayer = this.physics.add.sprite(20,400,'perso');\n\t\tplayer.setCollideWorldBounds(true);\n\t\tplayer.setBounce(0.2);\n\t\tplayer.body.setGravityY(000);\n\t\tthis.physics.add.collider(player,platforms);\n\t\n\tcursors = this.input.keyboard.createCursorKeys(); \n\n//------------------------------------------------------------------\n//ajout de l'animation du perso\t\n\tthis.anims.create({\n\t\tkey:'left',\n\t\tframes: this.anims.generateFrameNumbers('perso', {start: 0, end: 3}),\n\t\tframeRate: 10,\n\t\trepeat: -1\n\t});\n\t\n\tthis.anims.create({\n\t\tkey:'stop',\n\t\tframes: [{key: 'perso', frame:5}],\n\t\tframeRate: 10\n\t});\n\n//------------------------------------------------------------------\n//le spawn du coeur\n\tcoeur = this.physics.add.group({\n\t\tkey: 'coeur',\n\t\tsetXY: {x:400,y:0,stepX:70}\n\t});\n\t\t//rebond du coeur\n\t coeur.children.iterate(function (child) {\n child.setBounceY(Phaser.Math.FloatBetween(1, 1));\n });\n\t //mise en place des colisions\n\t\tthis.physics.add.collider(coeur,platforms);\n\t\tthis.physics.add.overlap(player,coeur,collectCoeur,null,this);\n//------------------------------------------------------------------\n//le spawn des etoiles\n\tstars = this.physics.add.group({\n\t\tkey: 'etoile',\n\t\trepeat:11,\n\t\tsetXY: {x:12,y:0,stepX:70}\n\t});\n\t\t//rebond des étoiles\n\t stars.children.iterate(function (child) {\n child.setBounceY(Phaser.Math.FloatBetween(0.1, 0.4));\n });\n\t //mise en place des colisions\n\t\tthis.physics.add.collider(stars,platforms);\n\t\tthis.physics.add.overlap(player,stars,collectStar,null,this);\n\n//------------------------------------------------------------------\n//affichage des pvs et du score\n\tvieText = this.add.text(16,16, 'PV: 3', {fontSize: '32px', fill:'#000'});\n\tscoreText = this.add.text(16,16, 'score: 0', {fontSize: '32px', fill:'#000'});\n\t\n\t//colison des bombs\n\tbombs = this.physics.add.group();\n\tthis.physics.add.collider(bombs,platforms);\n\tthis.physics.add.collider(player,bombs, hitBomb, null, this);\n}", "function doorCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var door = new Location(-1, -1);\n door.canMove = false;\n door.description = \"A sturdy door of oak planks with iron strips tying it together\";\n door.terrainType = \"door\";\n door.symbol = \"∏\";\n door.color = \"purple\";\n door.searchable = false;\n door.drops = [];\n door.locked = false;\n door.leadsTo = \"\";\n door.firstTime = false;\n door.fromWhere = \"\";\n\n room.doors.push(door);\n }\n}", "function createRocks()\n{\n\t\tvar direction\n\t\tclock ++;\n\t\tif (clock == 100)\n\t\t{\n\t\t\t\n\t\t\tdirection = random(0,2);\n\t\t\t\n\t\t\tif (direction < 1) direction = 0;\n\t\t\telse direction = height;\n\t\t\t\n\t\t\tboundary = createSprite(Clength,Cheight,1,Cheight*2);\n\t\t\t//boundary.visible = false;\n\t\t\t\n\t\t\trock = createSprite(Clength,direction,75,random(Cheight/2,Cheight));\n\t\t\trock.velocity.x= speed;\n\t\t\trock.immovable = true;\n\t\t\tboundary.velocity.x = speed;\n\t\t\tboundary.visible = false;\n\t\t\trocks.add(rock);\n\t\t\tboundaries.add(boundary);\n\t\t\tclock = 0;\n\t\t}\t\t\t\n}", "function MonsterFactory () {\n this.monsters = []\n this.monstersAdded = 0\n this.numberOfMonster = 10\n this.timeElapsed = 0\n}", "function stones () {\nrealityStone = Math.floor((Math.random() * 12) + 1);\npowerStone = Math.floor((Math.random() * 8) + 1);\nsoulStone = Math.floor((Math.random() * 6) + 1);\ntimeStone = Math.floor((Math.random() * 10) + 1);\n}", "create() {\n // Reset the data to initial values.\n this.resetData();\n // Setup the data for the game.\n this.setupData();\n // Create the grid, with all its numbers.\n this.makeGrid();\n // Set up collisions for bullets/other harmful objects.\n this.setupBullets();\n // Create the player.\n this.makePlayer();\n // Create all audio assets.\n this.makeAudio();\n // Create the UI.\n this.makeUI();\n // Create the timer sprites (horizontal lines to the sides of the board.)\n this.makeTimerSprites();\n // Create particle emitter.\n this.makeParticles();\n gameState.cursors = this.input.keyboard.createCursorKeys(); // Setup taking input.\n\t}", "createMonster(createOne) {\n // Decides which type of monsters can be created depending on the number of waves (extra)\n if (this.numberOfWaves === 0) {\n this.monsterType = (Math.floor(Math.random() * 8) + 1)\n } else if (this.numberOfWaves >= 1) {\n this.monsterType = (Math.floor(Math.random() * 10) + 1)\n }\n \n // Gets a y coordinate corresponding with one of the five rows\n const monsterYLocation = ((Math.floor(Math.random() * 5) + 1) * 180) + 90\n\n // Decides which type of monster is created depending on the random number (extra)\n // Monster\n if (this.monsterType <= 8) {\n const monster = this.physics.add.sprite(1920, monsterYLocation, 'monster').setScale(0.20)\n monster.monsterSpeed = ((Math.floor(Math.random() * (40 - 30 + 1)) + 30) * -1)\n monster.body.velocity.x = monster.monsterSpeed\n monster.health = 100\n this.monsterYPositions.push(monsterYLocation)\n this.monsterGroup.add(monster)\n // Stronger Monster\n } else if (this.monsterType >= 9) {\n const monster = this.physics.add.sprite(1920, monsterYLocation, 'strongerMonster').setScale(0.5)\n monster.monsterSpeed = ((Math.floor(Math.random() * (40 - 30 + 1)) + 30) * -1)\n monster.body.velocity.x = monster.monsterSpeed\n monster.health = 200\n this.monsterYPositions.push(monsterYLocation)\n this.monsterGroup.add(monster)\n }\n console.log('Created new monster')\n\n // Reduces the delay between monsters and starts new timer\n if (this.monsterDelay > 3000 && createOne != true) {\n this.monsterDelay -= 1000\n console.log('New delay is: ', this.monsterDelay)\n }\n if (this.gameOver != true && createOne != true ) {\n this.monsterTimer = this.time.delayedCall(this.monsterDelay, this.createMonster, [], this)\n }\n }", "function createServer(){\r\n //creer la structure des npc coté server et envoies les donnés aux client\r\n for(var k in client){\r\n if(client[k].role == 'BDE'){\r\n film += 3;\r\n killers ++;\r\n }\r\n }\r\n for(var k in client){\r\n if(client[k].role == 'Journalist'){\r\n //creer la structure d'un viseur server et envoie les donnés aux client\r\n ViseurArray[client[k].pseudo] = new ViseurServer(client[k].pseudo, 100);\r\n io.sockets.emit('createViseur', {\r\n pseudo : ViseurArray[client[k].pseudo].pseudo,\r\n radius : ViseurArray[client[k].pseudo].radius\r\n });\r\n }\r\n }\r\n\r\n for(var k in client){\r\n if(client[k].role == 'BDE'){\r\n //creer la structure d'un npc pour les BDEs coté server et envoie les donnés aux client\r\n BDEArray[client[k].pseudo] = new NPCserver(client[k].pseudo);\r\n io.sockets.emit('createBDE', {\r\n x : BDEArray[client[k].pseudo].x,\r\n y : BDEArray[client[k].pseudo].y,\r\n skin : BDEArray[client[k].pseudo].skin,\r\n pseudo : BDEArray[client[k].pseudo].id\r\n });\r\n }\r\n }\r\n\r\n\r\n for(var i = 0; i < data.nb_npc; i++){\r\n NpcArrayServer.push(new NPCserver(i));\r\n io.sockets.emit('createNPC', {\r\n x : NpcArrayServer[i].x,\r\n y : NpcArrayServer[i].y,\r\n skin : NpcArrayServer[i].skin\r\n });\r\n }\r\n io.sockets.emit('GlobalData', {\r\n nb_npc : data.nb_npc,\r\n killers : killers,\r\n film : film,\r\n });\r\n io.sockets.emit('ActionViseur');\r\n console.log('________________________________Start update____________________________________');\r\n var compteur = 4;\r\n pre_start = setInterval(function(){\r\n io.sockets.emit('start', compteur);\r\n compteur --;\r\n }, 1000);\r\n setTimeout(startupdate, 6000);\r\n }", "HeroToCrew(hero) {\n\t\t\tlet new_crew = new SBar.Crew(hero.name, hero.seed, hero.raceseed, hero.level);\n\t\t\tif (hero.is_feral/* || hero.raceseed === SF.RACE_SEED_ALPHA*/) {\n\t\t\t\tnew_crew.personality = SF.P_FERAL;\n\t\t\t\tnew_crew.ResetPersonalityText();\n\t\t\t}\n\t\t\tnew_crew.base_level = hero.level;\n\t\t\tnew_crew.artifacts = SU.Clone(hero.for_export_artis);\n\t\t\tnew_crew.health = hero.health;\n\t\t\tnew_crew.max_health = hero.max_health;\n\t\t\tnew_crew.base_max_health = hero.max_health;\n\t\t\tnew_crew.morale = hero.morale;\n\t\t\tnew_crew.speed = hero.speed;\n\t\t\tnew_crew.base_speed = hero.speed; // Not this is intentionally not base (doesn't exist). Which can pick up whatever the end value was.\n\t\t\t// Note personality is not copied. That can be scrambled.\n\t\t\t// Also note that the player copy becomes an NPC with personality.\n\t\t\treturn new_crew;\n\t\t}", "function level2() {\n steps = 0\n man = createMan(0, 4, 600)\n wall = createWall([0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4], [3, 2, 1, 0, 4, 3, 2, 1, 3, 2, 1, 0])\n\n win = createWin(4, 4)\n}", "create() {\n super.create()\n\n this.instanceCreate(Platform, 350, 450)\n\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n\n this.instanceCreate(Solid)\n this.instanceCreate(RainbowDash)\n\n this.instanceCreate(Player, 200, 600)\n }", "function makeList() {\n\t// Humanoids' part of the list\n\t\n\tvar len = humanoids.length;\n\t\n\tfor (var i = 0; i < len; i++) {\n\t\tvar race = humanoids[i][6]; // Get array's name of race\n\t\tvar info = humanoids[i][7]; // Get array's info on this race\n\t\tvar text = \"\"; \n\t\tvar alfa = 0;\n\t\tvar bravo = 0;\n\t\tvar a = 0;\n\t\tvar b = 0;\n\t\tfor (let j = 0; j < 6; j++) {\n\t\t\t// Every race has two bonuses - place them into alfa and brace\n\t\t\tif ((humanoids[i][j] > 0) && (a === 0)) { // a isn't filled yet\n\t\t\t\ta = humanoids[i][j]; // Get value (1 or 2)\n\t\t\t\talfa = abilities[j]; // Get placement (STR, DEX, etc)\n\t\t\t}\n\t\t\t\n\t\t\tif ((humanoids[i][j] > 0) && (a !== 0)) { // a has already been filled\n\t\t\t\tb = humanoids[i][j]; // Get value (1 or two)\n\t\t\t\tbravo = abilities[j]; // Get placement (STR, DEX, etc)\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (let k = 0; k < 5; k++) {\n\t\t\t// Makes the row of 5 \"divs\" for each humanoid race\n\t\t\tvar x = document.createElement(\"DIV\"); // Makes the cell div\n\t\t\tvar row = \"table__row__\" + i;\n\t\t\tvar column = \"table__column__\" + k;\n\t\t\tvar classes = \"data__1 \" + row + \" \" + column; // Concats the classes, since they can't seem to do so within the setAttribute parenthesis\n\t\t\tx.setAttribute(\"class\", classes); // Gives each cell its own combination of row and column classes, just like the table__0 to begin with\n\t\t\tif (k === 0) {\n\t\t\t\t// Inserts a column of radio-buttons in the first column\n\t\t\t\tvar t = document.createElement(\"input\"); // Creates an \"input\" element\n\t\t\t\t//t.setAttribute(\"class\", \"data__1--hidden\"); // Hides the buttons until they are needed\n\t\t\t\tt.setAttribute(\"type\", \"radio\");\n\t\t\t\tt.setAttribute(\"name\", \"race\"); // Having the same name is needed for getting the choice data, IIRC\n\t\t\t\tt.setAttribute(\"class\", \"data__1--hidden\"); // Don't show up yet\n\t\t\t\tt.setAttribute(\"value\", i); // AFAICS not used, but could be used for identifying which race is picked through value\n\t\t\t\t// t.setAttribute(\"id\", radioID);\n\t\t\t\tx.appendChild(t); // Places the \"input\" element inside the current \"div\" (x)\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Creates text element if it isn't in the radio button column\n\t\t\t\tif (k === 1) {var text = race;}\n\t\t\t\telse if (k === 2) {var text = alfa + \" +\" + a;}\n\t\t\t\telse if (k === 3) {var text = bravo + \" +\" + b;}\n\t\t\t\telse {var text = info;}\n\t\t\t\t\n\t\t\t\tvar t = document.createTextNode(text); // Sets the text-node to use the \"text\" set above\n\t\t\t\tx.appendChild(t); // Places the \"text\" <p> element into the \"div\" (x)\n\t\t\t}\n\t\t\tdocument.getElementById(\"table__1\").appendChild(x); // Finally places the \"div\" in the \"table__1\" element\n\t\t}\n\t}\n\t\n\t// Humanity's part of the list, 3 races\n\tfor (i = len; i < len+3; i++) {\n\t\t\n\t\tvar j = i-len;\n\t\tvar race = humanity[j][0];\n\t\tvar info = humanity[j][1];\n\t\n\t\tfor (let k = 0; k < 5; k++) {\n\t\t\t// Makes a row of 5 \"divs\" for each race in humanity\n\t\t\tvar x = document.createElement(\"DIV\"); // Makes the cell div\n\t\t\tvar row = \"table__row__\" + i;\n\t\t\tvar column = \"table__column__\" + k;\n\t\t\tvar classes = \"data__1 \" + row + \" \" + column; // Concats the classes, since they can't seem to do so within the setAttribute parenthesis\n\t\t\tx.setAttribute(\"class\", classes); // Gives each cell its own combination of row and column classes, just like the table__0 to begin with\n\t\t\tif (k === 0) {\n\t\t\t\t// Inserts the column of radio-buttons in the first column\n\t\t\t\tvar t = document.createElement(\"input\"); // Creates an \"input\" element\n\t\t\t\t//t.setAttribute(\"class\", \"data__1--hidden\"); // Hides the buttons until they are needed\n\t\t\t\tt.setAttribute(\"type\", \"radio\");\n\t\t\t\tt.setAttribute(\"name\", \"race\"); // Having the same name is needed for getting the choice data, IIRC\n\t\t\t\tt.setAttribute(\"class\", \"data__1--hidden\"); // Don't show up yet\n\t\t\t\tt.setAttribute(\"value\", i); // AFAICS not used, but could be used for identifying which race is picked through value\n\t\t\t\t// t.setAttribute(\"id\", radioID);\n\t\t\t\tx.appendChild(t); // Places the \"input\" element inside the current \"div\" (x)\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Creates text element if it isn't in the radio button column\n\t\t\t\tif (k === 1) {var text = race;}\n\t\t\t\telse if (k === 2) {var text = \"-\";}\n\t\t\t\telse if (k === 3 && j === 0) {var text = \"CHA +2\";}\n\t\t\t\telse if (k === 3) {var text = \"-\";}\n\t\t\t\telse {var text = info;}\n\t\t\t\t\n\t\t\t\tvar t = document.createTextNode(text); // Sets the text-node to use the \"text\" set above\n\t\t\t\tx.appendChild(t); // Places the \"text\" <p> element into the \"div\" (x)\n\t\t\t}\n\t\t\tdocument.getElementById(\"table__1\").appendChild(x); // Finally places the \"div\" in the \"table__1\" element\n\t\t}\n\t}\t\n}", "function generateShapes(gl){\n\tcube = createCube(gl); // Plain cube\n sphere = createSphere(gl); // Plain sphere\n grass = createTexturedCube(gl,grassPath,50,50); // Grass\n wall = createTexturedCube(gl,brickPath,5,3/2); // Wall section\n wallbottom = createTexturedCube(gl,brickPath,5,1/2); // Wall section\n walldoor = createTexturedCube(gl,brickPath,2,1); // Wall section\n paintdoor = createTexturedCube(gl,paintPath,2,1); // Inner wall section\n paintwindow = createTexturedCube(gl,paintPath,1/2,1/2); // Inner wall section\n wallwindow = createTexturedCube(gl,brickPath,1/2,1/2); // Wall section\n paint = createTexturedCube(gl,paintPath,5,3/2); // Inner wall section\n paintroof = createTexturedCube(gl,roofPath,5,5); // Roof\n paintbottom = createTexturedCube(gl,paintPath,5,1/2); // Inner wall section\n floor = createTexturedCube(gl,floorPath,5,5); // Carpet\n blackboard = createTexturedCube(gl,blackboardPath,1,1); // Blackboard\n wind = createTexturedCube(gl,windowPath,4,1/2); // Windows\n door = createTexturedCube(gl,doorPath,1,1,initialiseTextureMapping(1,1,1)); // Door\n disco = createTexturedCube(gl,discoPath,50,50); // Disco floor\n\n leg=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(1,5,1)); // Chair leg\n tableleg=createTexturedCube(gl,tablePath,1,1,initialiseTextureMapping(1,7.5,1)); // Table leg\n tablesurface=createTexturedCube(gl,tablePath,1,1,initialiseTextureMapping(8,1,8)); // Table surface\n back=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(1,7,5)); // Chair back\n seat=createTexturedCube(gl,woodPath,1,1,initialiseTextureMapping(5,1,5)); // Chair seat\n}", "function setNewGame() {\n const fieldsArr = board.fields;\n\n for (let i = 0; i <= 64; i++) {\n let startPostion = fieldsArr[i];\n let piece = false;\n\n if (i >= 8 && i <= 15) {\n piece = new Pawn('pawn', 'black', i);\n }\n\n else if (i >= 48 && i <= 55) {\n piece = new Pawn('pawn', 'white', i);\n } \n \n else {\n continue;\n }\n\n if (piece) {\n startPostion.pawn = piece;\n startPostion.td.appendChild(piece.element); \n }\n }\n }", "static createRocketJohtoQuestLine() {\n const rocketJohtoQuestLine = new QuestLine('Team Rocket Again', 'Team Rocket is up to no good again!');\n const defeatRedGyarados = new DefeatTemporaryBattleQuest('Red Gyarados', 'Defeat the rampaging Red Gyarados!');\n rocketJohtoQuestLine.addQuest(defeatRedGyarados);\n const clearTeamRocketHideout = new CustomQuest(1, 0, 'Clear the Team Rocket\\'s Hideout dungeon in Mahogany Town', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Team Rocket\\'s Hideout')]());\n rocketJohtoQuestLine.addQuest(clearTeamRocketHideout);\n const radioTowerReward = () => {\n App.game.pokeballs.gainPokeballs(GameConstants.Pokeball.Masterball, 1, false);\n Notifier.notify({\n title: rocketJohtoQuestLine.name,\n message: 'The grateful radio director gave you a Master Ball!',\n type: NotificationConstants.NotificationOption.success,\n timeout: 3e4,\n });\n };\n const clearRadioTower = new CustomQuest(1, radioTowerReward, 'Clear the Radio Tower dungeon in Goldenrod City', () => App.game.statistics.dungeonsCleared[GameConstants.getDungeonIndex('Radio Tower')]());\n rocketJohtoQuestLine.addQuest(clearRadioTower);\n App.game.quests.questLines().push(rocketJohtoQuestLine);\n }", "function Tomato(x,y,place,grown) {\n var id = 2;\n var name = \"tomato\";\n var grown = tomato_grown_time;\n var img_number = 4;\n var price = tomato_price;\n var experience = tomato_experience;\n var water = 6000;\n var x_cor = x;\n var y_cor = y;\n Plant.call(this, id, name, img_number, x_cor, y_cor, place, water, grown, price, experience);\n}", "function CreateAndBuryMines(cellID) {\n CreateArrayOfMines();\n BuryMines();\n UncoverEmptyCellOnFirstClick(cellID);\n AddNumbersAroundMines();\n}", "function Mushroom(me, type) {\n me.group = \"item\";\n me.width = me.height = 8;\n me.speed = .42 * unitsize;\n me.animate = emergeUp;\n me.movement = moveSimple;\n me.collide = collideFriendly;\n me.jump = mushroomJump;\n me.death = killNormal;\n me.nofire = true;\n \n var name = \"mushroom\";\n switch(type) {\n case 1: me.action = gainLife; name += \" gainlife\"; break;\n case -1: me.action = killMario; name += \" death\"; break;\n default: me.action = marioShroom; name += \" regular\"; break;\n }\n setCharacter(me, name);\n}", "constructor(title, genres, platforms, cover){\n this._id = game.getLastId() + 1\n this.title=title\n this.genres=genres\n this.platforms=platforms\n this.cover=cover\n }", "function crearCohete(){\n\tcohete = new moduloLunar();\n\tescena.add(cohete.mesh);\n\n}", "function CreateGame() {\n\t\tvar players = Session.get(\"players\");\n\t\tvar teamSize = Session.get(\"team_size\");\n\t\tvar numOfPlayers = _.size(players);\n\t\tvar numOfTeams = (teamSize==10) ? 1 : Math.ceil(numOfPlayers/teamSize);\n\n\t\tplayers = randomizeArray(players); //randomize players array\n\n\t\t// If use selected 10+ players then create one team \n\t\t// Otherwise even out the teams and create them\n\t\tvar teams;\n\t\tif (numOfTeams == 1) {\n\t\t\tteams = CreateOneTeam(players);\n\t\t}\n\t\telse {\n\t\t\tplayers = EvenOutTeams(numOfPlayers, teamSize, players); //Even out the teams\n\t\t\tteams = CreateMultipleTeams(players, numOfTeams, teamSize);\n\t\t}\n\n\t\tSession.set(\"teams\", teams);\n\t}", "function createRoundWrappers() {\n for (const entry of races) {\n // results in 1 more entry than races due to cloning the first round\n let cardsClone = round.cloneNode(true);\n cardsClone.id = `round${entry}`;\n scheduleContainer.appendChild(cardsClone);\n }\n // remove the superflous round\n scheduleContainer.removeChild(scheduleContainer.lastChild);\n}", "function addMonsters_onWave( id, number ) //Adauga 'number' monstrii de tipul 'id'.\n{\n\tfor( var i=1; i<=number; i++)\n\t\t\twaves[monster_position_in_wave++] = new Monster(Pointsy[0], Pointsx[0], id);\n}", "buildWarheads() {\n for (var i=0;i<this._stockpile.length;i++) {\n this._stockpile[i] = new Warhead(i);\n this._tracker[i] = 1;\n }\n return this;\n }", "function makeObjects()\n{\n let beautifulGraphic0 = new BeautifulGraphics(\"404 Clery Compliance\", \"Images/image-1.jpg\", \"Graphic announcing UM's non-compliance with the Clery Act\", \"Zoie\", \"2018\");\nlet beautifulGraphic1 = new BeautifulGraphics(\"Surfing Monte\", \"Images/image-2.jpg\", \"Graphic made to discuss UM's issues with internet connectivity\", \"Zoie\", \"2018\");\nlet beautifulGraphic2 = new BeautifulGraphics(\"John Harbor as Patrick Star\", \"Images/image-3.jpg\", \"Meme version of John Harbor showing how more classes will be put online.\", \"Zoie\", \"2018\");\nlet beautifulGraphic3 = new BeautifulGraphics(\"GLI Dropouts\", \"Images/image-4.jpg\", \"Frenchie from Grease gives informaton about the rate at which UM students drop out of GLI.\", \"Zoie\", \"2018\");\nlet beautifulGraphic4 = new BeautifulGraphics(\"Dumpster Diving\", \"Images/image-5.jpg\", \"Made for editorial about lack of good food options on campus.\", \"Zoie\", \"2018\");\ngraphicsArray.push(beautifulGraphic0);\ngraphicsArray.push(beautifulGraphic1);\ngraphicsArray.push(beautifulGraphic2);\ngraphicsArray.push(beautifulGraphic3);\ngraphicsArray.push(beautifulGraphic4);\n }", "create () {\n let asteroidsGroup = this.gameObjects['asteroids-group'] = new AsteroidsGroup(this.game);\n\n this.spawnAsteroids(25);\n this.setupUI();\n }", "create() {\n for(let s in this.suites) {\n for(let i = 1; i <= 13; i++) {\n this.deck.push(`${this.suites[s]}-${i}`);\n }\n }\n }", "function createItems(game) {\n items = game.add.group();\n\n // We will enable physics for any item created in this group\n items.enableBody = true;\n\n if (level == GRASS_LEVEL || level == FORREST_LEVEL) {\n totalItems = 50;\n for (var i = 0; i < totalItems; i++) {\n // Create a star inside of the 'items' group\n var star = items.create((game.world.width/totalItems)*i, 0, 'star');\n // Let gravity do its thing\n star.body.gravity.y = 90;\n // This just gives each star a slightly random bounce value\n star.body.bounce.y = 0.7 + Math.random() * 0.8;\n star.body.velocity.x = getRandomFromRange(400);\n }\n }\n else if (level == CAVE_LEVEL) {\n totalItems = 50;\n for (var i = 0; i < totalItems; i++) {\n // Create a star inside of the 'items' group\n var x = getRandomWorldX(game);\n var y = getRandomWorldY(game);\n var crystal = items.create(x, y, 'greenCrystal');\n }\n\n }\n else if (level == CLOUD_LEVEL || level == SPACE_LEVEL) {\n totalItems = 50;\n for (var i = 0; i < totalItems; i++) {\n // Create a star inside of the 'items' group\n var star = items.create((game.world.width/totalItems)*i, Math.random() * game.world.height, 'star');\n // Let gravity do its thing\n star.body.gravity.y = Math.round( (Math.random() * 10) - 5);\n // This just gives each star a slightly random bounce value\n star.body.bounce.y = 0.7 + Math.random() * 0.8;\n star.body.velocity.x = getRandomFromRange(30);\n }\n }\n else {\n totalItems = 50;\n for (var i = 0; i < totalItems; i++) {\n // Create a star inside of the 'items' group\n var star = items.create((game.world.width/totalItems)*i, 0, 'star');\n // Let gravity do its thing\n star.body.gravity.y = 90;\n // This just gives each star a slightly random bounce value\n star.body.bounce.y = 0.7 + Math.random() * 0.8;\n star.body.velocity.x = getRandomFromRange(400);\n }\n }\n\n\n return items;\n}", "create_agents() {\n for (let i = 0; i < this.total_agents; i++) {\n let agent = new Agent({\n id: i + 1,\n pos: Math.random()\n });\n this.agents.push(agent);\n }\n }", "function bootstrap(room) {\n\n room.memory.infrastructure = {};\n\n // Designate mining posts\n // Stores in room.memory.shafts\n setupSources(room);\n\n // Order array by name in case there is more than one spawn. we want the\n // original\n var spwn = room.find(FIND_MY_SPAWNS).sort()[0];\n\n if (!util.def(spwn)) {\n room.placeSpawn();\n // this is a new room where I don't have a spawn. bail for now.\n return false;\n }\n room.memory.spawnId = spwn.id;\n\n // Create roads to controller\n // Later, storage, links, etc.\n room.createBasicPaths();\n\n // markWalls(room);\n\n room.memory.planned = true;\n return true;\n}", "function run() {\n cleanUpOldWaves();\n for (let i = 0; i < Memory.raidWaves.length; i++) {\n const wave = Memory.raidWaves[i];\n if (!wave.creeps) {\n assignCreepsToWaves();\n }\n if (!wave.ready) {\n wave.ready = getIsWaveReady(wave);\n }\n if (wave.ready) {\n const creeps = wave.creeps.map(o => Game.getObjectById(o));\n const leader = util.firstOrDefault(creeps, o => o && o.room.name === wave.targetRoomName);\n if (leader && (!wave.targetStructureId || !Game.getObjectById(wave.targetStructureId))) {\n wave.leaderId = leader.id;\n const targetStructure = determineTarget(wave, leader);\n if (targetStructure) {\n wave.targetStructureId = targetStructure.id;\n }\n }\n }\n }\n}" ]
[ "0.6811464", "0.63147223", "0.627289", "0.6015108", "0.5972452", "0.5929267", "0.58844453", "0.5877934", "0.5832125", "0.578988", "0.5777931", "0.57223433", "0.57140654", "0.5670986", "0.5625472", "0.5624902", "0.56245315", "0.5621228", "0.55639887", "0.5531652", "0.5520419", "0.55022234", "0.54920363", "0.54920363", "0.54832095", "0.5482298", "0.5472637", "0.5465156", "0.54643846", "0.5456619", "0.54544646", "0.5444666", "0.54328835", "0.5427215", "0.5411", "0.5407335", "0.5403788", "0.5396431", "0.5388768", "0.5387308", "0.53856814", "0.5382025", "0.53727084", "0.5372408", "0.53686094", "0.5366689", "0.5360462", "0.53584594", "0.5358039", "0.53557914", "0.53456527", "0.5338384", "0.5334471", "0.53338665", "0.53317255", "0.5326057", "0.53142613", "0.5313908", "0.5307025", "0.5299966", "0.52990687", "0.52966547", "0.5295173", "0.52908933", "0.5290437", "0.52883136", "0.52881104", "0.5276278", "0.5271354", "0.52660435", "0.52557164", "0.52439517", "0.52408373", "0.5238459", "0.5237936", "0.5237853", "0.5237455", "0.52350646", "0.52349854", "0.5226732", "0.52237666", "0.5217519", "0.5214079", "0.5210041", "0.5209678", "0.52069324", "0.52055186", "0.5205077", "0.5203244", "0.5202953", "0.52024907", "0.5202489", "0.5196621", "0.5194388", "0.5189908", "0.5189645", "0.51849645", "0.5184573", "0.5183102", "0.518171" ]
0.678634
1
create the planets texture
function createTexture() { let dashTextureCanvas = document.createElement('canvas'); let ctx = dashTextureCanvas.getContext('2d'); dashTextureCanvas.width = 1024; dashTextureCanvas.height = 1024; let lineThickness = 26; ctx.fillStyle = backgroundColorS; ctx.fillRect(0, 0, dashTextureCanvas.width, dashTextureCanvas.height); ctx.lineWidth = lineThickness; ctx.lineCap = 'round'; ctx.strokeStyle = mainColorS; ctx.beginPath(); let ammoutOfRows = dashTextureCanvas.height / lineThickness - 4; let middle = Math.floor(ammoutOfRows / 2) + 2; for (let i = -middle - 1; i < middle; i += 3) { let level = arcify(i) / 150 + 1; let currentLength = randomBetween(20, 130), topOffset = (i + middle) * lineThickness; while (true) { ctx.moveTo(currentLength, topOffset); let to = currentLength += randomBetween(50, 170) / level; if (to + 5 < dashTextureCanvas.width) ctx.lineTo(to, topOffset); else break; currentLength += randomBetween(70, 150); } } ctx.stroke(); return dashTextureCanvas; function randomBetween(small, large) { return (Math.random() * large | 0) + small; } function arcify(x) { if (x == 0) return Math.pow(x + 2, 2); else return Math.pow(Math.abs(x), 2) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createTilesetsAndWaterTextures() {\n let tilesets = this.tilesetTextures;\n let tilesetsCount = tilesets.length;\n let canvas = document.createElement('canvas');\n let ctx = canvas.getContext('2d');\n\n canvas.width = 2048;\n canvas.height = 64 * (tilesetsCount + 1); // 1 is added for a black tileset, to remove branches from the fragment shader, at the cost of 512Kb.\n\n for (let tileset = 0; tileset < tilesetsCount; tileset++) {\n let imageData = tilesets[tileset].imageData;\n if (!imageData) {\n continue;\n }\n\n for (let variation = 0; variation < 16; variation++) {\n let x = (variation % 4) * 64;\n let y = ((variation / 4) | 0) * 64;\n\n ctx.putImageData(imageData, variation * 64 - x, (tileset + 1) * 64 - y, x, y, 64, 64);\n }\n\n if (imageData.width === 512) {\n for (let variation = 0; variation < 16; variation++) {\n let x = 256 + (variation % 4) * 64;\n let y = ((variation / 4) | 0) * 64;\n\n ctx.putImageData(imageData, 1024 + variation * 64 - x, (tileset + 1) * 64 - y, x, y, 64, 64);\n }\n }\n }\n\n let gl = this.gl;\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n\n this.tilesetsTexture = texture;\n\n canvas.height = 128 * 3; // up to 48 frames.\n\n let waterTextures = this.waterTextures;\n\n for (let i = 0, l = waterTextures.length; i < l; i++) {\n let x = i % 16;\n let y = (i / 16) | 0;\n\n ctx.putImageData(waterTextures[i].imageData, x * 128, y * 128);\n }\n\n let waterTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, waterTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n\n this.waterTexture = waterTexture;\n }", "function createTexture(width, height, vertices){\n // Finding the max height\n const max_height = FindMax(vertices);\n \n const map_size = width * height;\n var data = new Uint8Array(map_size * 3);\n\n // Colouring the normal area\n for(let i = 0; i < width; ++i){\n for(let j = 0; j < height; ++j){\n // Flipping the orientation about the x - axis\n const index = ((height - i - 1) * width + j) * 3;\n\n // These points are the corner points : Sand\n if(i == 0 || j == 0 || i == width - 1 || j == height - 1){\n data[index] = 194;\n data[index + 1] = 178;\n data[index + 2] = 128;\n }\n else{\n if(vertices[i - 1][j - 1] < 0){\n data[index] = 194;\n data[index + 1] = 178;\n data[index + 2] = 128;\n }\n // Creating gradients of colors for each level\n else{\n // Getting the height\n const height = vertices[i - 1][j - 1];\n const norm_height = height / max_height;\n\n // If height is < 0.4 of max height : Sand brown\n if(norm_height < 0.4){\n // Deciding on the starting and finishing colors \n const r1 = 62;\n const g1 = 86;\n const b1 = 61;\n\n const r2 = 95;\n const g2 = 99;\n const b2 = 80;\n\n // Setting the colors\n data[index] = Math.floor(r1 + (r2 - r1) * norm_height / 0.4);\n data[index + 1] = Math.floor(g1 + (g2 - g1) * norm_height / 0.4);\n data[index + 2] = Math.floor(b1 + (b2 - b1) * norm_height / 0.4); \n }\n\n // If height is betweeen 0.4 and 0.65 : Greenish\n else if(norm_height < 0.65){\n // Deciding on the starting and finishing colors \n const r1 = 95;\n const g1 = 99;\n const b1 = 80;\n\n const r2 = 155;\n const g2 = 177;\n const b2 = 189;\n\n // Setting the colors\n data[index] = Math.floor(r1 + (r2 - r1) * (norm_height - 0.4) / 0.25);\n data[index + 1] = Math.floor(g1 + (g2 - g1) * (norm_height - 0.4) / 0.25);\n data[index + 2] = Math.floor(b1 + (b2 - b1) * (norm_height - 0.4) / 0.25); \n }\n\n // Highest peaks : Snowy peaks\n else if(norm_height < 0.85){\n const r1 = 155;\n const g1 = 177;\n const b1 = 189;\n\n const r2 = 181;\n const g2 = 205;\n const b2 = 214;\n\n // Setting the colors\n data[index] = Math.floor(r1 + (r2 - r1) * (norm_height - 0.65) / 0.2);\n data[index + 1] = Math.floor(g1 + (g2 - g1) * (norm_height - 0.65) / 0.2);\n data[index + 2] = Math.floor(b1 + (b2 - b1) * (norm_height - 0.65) / 0.2); \n }\n\n // Peaks \n else{\n const r1 = 181;\n const g1 = 205;\n const b1 = 214;\n\n const r2 = 209;\n const g2 = 229;\n const b2 = 231;\n\n // Setting the colors\n data[index] = Math.floor(r1 + (r2 - r1) * (norm_height - 0.85) / 0.15);\n data[index + 1] = Math.floor(g1 + (g2 - g1) * (norm_height - 0.85) / 0.15);\n data[index + 2] = Math.floor(b1 + (b2 - b1) * (norm_height - 0.85) / 0.15); \n }\n }\n }\n }\n }\n\n const texture = new THREE.DataTexture(data, width, height, THREE.RGBFormat);\n texture.needsUpdate = true;\n\n return texture;\n}", "function createPetal() {\n\t var texloader = new THREE.TextureLoader();\n\t var shaderUniforms = {\n\t time: {\n\t type: \"float\",\n\t value: 0\n\t },\n\t color: {\n\t type: \"v4\",\n\t value: new THREE.Vector4(1., 0., 0., 1.)\n\t },\n\t image: { // Check the Three.JS documentation for the different allowed types and values\n\t type: \"t\",\n\t value: texloader.load('./textures/petal.jpg')\n\t }\n\t };\n\t\n\t var material = new THREE.ShaderMaterial({\n\t uniforms: shaderUniforms,\n\t vertexShader: __webpack_require__(14),\n\t fragmentShader: __webpack_require__(15),\n\t side: THREE.DoubleSide\n\t //lights: true\n\t });\n\t\n\t // Create flower meshes procedurally\n\t var width = 1.0;\n\t var height = 5;\n\t var geometry = new THREE.PlaneGeometry(width, height, 1, 20);\n\t var petal = new THREE.Mesh(geometry, material);\n\t\n\t // create inner petal geometry\n\t for (var i = 0; i < petal.geometry.vertices.length / 2; i++) {\n\t var val = 0.25 * easeInQuadratic(petal.geometry.vertices[2 * i].y);\n\t petal.geometry.vertices[2 * i].z = val;\n\t petal.geometry.vertices[2 * i + 1].z = val;\n\t }\n\t\n\t for (var i = 0; i < petal.geometry.vertices.length; i++) {\n\t if (petal.geometry.vertices[i].x == width / 2) {\n\t var xval = width + width / 4 - easeInQuadratic(petal.geometry.vertices[i].y) / (height * width);\n\t petal.geometry.vertices[i].x = xval;\n\t } else if (petal.geometry.vertices[i].x == -width / 2) {\n\t var xval = -width - width / 4 + easeInQuadratic(petal.geometry.vertices[i].y) / (height * width);\n\t petal.geometry.vertices[i].x = xval;\n\t }\n\t }\n\t\n\t setAbsolutePosition(petal, 0, 2, 0);\n\t setAbsoluteRotation(petal, 'X', Math.PI / 3);\n\t\n\t return petal;\n\t}", "function makeTexture(images){\n\tfor (var i = 0; i < images.length; ++i) {\n \tvar texture = gl.createTexture();\n \tgl.bindTexture(gl.TEXTURE_2D, texture);\n \tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n \tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n \tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n \tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n \tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n \tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, images[i]);\n \ttrisphereTexture.push(texture);\n }\n}", "async function createMaterials() {\n // Plane Background\n var texture = await asyncLoadImg(\"img/background.jpg\");\n texture.wrapS = texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.set(16, 16);\n var texture_bump = await asyncLoadImg(\"img/background.jpg\");\n texture_bump.wrapS = texture_bump.wrapT = THREE.RepeatWrapping;\n texture_bump.repeat.set(16, 16);\n // Desactivado porque alenta, pero aqui esta el pasto con bumps\n // materials['surface'] = new THREE.MeshPhongMaterial({map: texture, bumpMap: texture_bump, bumpScale: 0.3, specular: 0x0});\n materials['surface'] = new THREE.MeshLambertMaterial({map: texture});\n materials['slot'] = new THREE.MeshLambertMaterial({color: 0x101010});\n}", "function setupSkyboxBuffers(){\n //Generate the vertex positions \n loadVertices()\n\n //Generate the vertex Textures\n loadTextures()\n}", "initTextures(){\n var path = this.scene.supplySkin[this.scene.selectedSupplySkin];\n\n this.textures = [new CGFtexture(this.scene, path.concat(\"/f.png\")),\n new CGFtexture(this.scene, path.concat(\"/r.png\")),\n new CGFtexture(this.scene, path.concat(\"/b.png\")),\n new CGFtexture(this.scene, path.concat(\"/l.png\")),\n new CGFtexture(this.scene, path.concat(\"/t.png\")),\n new CGFtexture(this.scene, path.concat(\"/bt.png\"))];\n }", "function createSkyBox2(image,k){\n \t\t// creating a textured plane which receives shadows\n \t\tvar geometry = new THREE.BoxGeometry( 40, 70, 30 );\n \t\tvar texture = new THREE.TextureLoader().load( image );\n \t\t//texture.wrapS = THREE.RepeatWrapping;\n \t\t//texture.wrapT = THREE.RepeatWrapping;\n \t\t//texture.repeat.set( k, k );\n \t\tvar material = new THREE.MeshLambertMaterial( {\n \t\t\t\t\t\t\t\t\t\t\t\tcolor: 0xffffff,\n \t\t\t\t\t\t\t\t\t\t\t\tmap: texture ,\n \t\t\t\t\t\t\t\t\t\t\t\tside:THREE.DoubleSide\n \t\t\t\t\t\t\t\t\t\t\t} );\n \t\tvar mesh = new THREE.Mesh( geometry, material, 0 );\n \t\tmesh.receiveShadow = false;\n \t\treturn mesh\n \t}", "function createSkyBox(image,k){\n \t\t// creating a textured plane which receives shadows\n \t\tvar geometry = new THREE.BoxGeometry( 40, 80, 20 );\n \t\tvar texture = new THREE.TextureLoader().load( image );\n \t\t//texture.wrapS = THREE.RepeatWrapping;\n \t\t//texture.wrapT = THREE.RepeatWrapping;\n \t\t//texture.repeat.set( k, k );\n \t\tvar material = new THREE.MeshLambertMaterial( {\n \t\t\t\t\t\t\t\t\t\t\t\tcolor: 0xffffff,\n \t\t\t\t\t\t\t\t\t\t\t\tmap: texture ,\n \t\t\t\t\t\t\t\t\t\t\t\tside:THREE.DoubleSide\n \t\t\t\t\t\t\t\t\t\t\t} );\n \t\tvar mesh = new THREE.Mesh( geometry, material, 0 );\n \t\tmesh.receiveShadow = false;\n \t\treturn mesh\n \t}", "function setPlastic() {\n // Use the shader that does't render the texture\n programId = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n gl.useProgram(programId);\n angles = 32;\n steps = 64;\n lightAmbient = vec4(0.2, 0.2, 0.0, 1.0 );\n lightDiffuse = vec4( 1.0, 1.0, 1.0, 1.0 );\n lightSpecular = vec4( 1.0, 1.0, 1.0, 1.0 );\n\n materialAmbient = vec4( 1.0, 1.0, 0.0, 1.0 );\n materialDiffuse = vec4( 1.0, 1.0, 0.0, 1.0 );\n materialSpecular = vec4( 1.0, 1.0, 1.0, 1.0 );\n materialShininess = 60.0;\n updateLights();\n draw();\n}", "function makeDrawImgPlane(regl, params) {\n // const {width, height} = params\n var texture = params.texture;\n\n return regl({\n vert: \"precision mediump float;\\n#define GLSLIFY 1\\nattribute vec3 position;\\nattribute vec2 uv;\\nvarying vec2 vUv;\\nuniform mat4 model, view, projection;\\nvoid main() {\\n vUv = uv;\\n gl_Position = projection * view * model * vec4(position, 1);\\n}\\n\",\n frag: \"precision mediump float;\\n#define GLSLIFY 1\\n\\n varying vec2 vUv;\\n uniform sampler2D texture;\\n uniform vec4 color;\\n\\nvec4 colorize(in vec4 color, in vec4 modColor)\\n{\\n float average = (color.r + color.g + color.b) / 3.0;\\n return vec4(modColor.r, modColor.g, modColor.b, color.a);\\n}\\n void main () {\\n gl_FragColor = colorize(texture2D(texture,vUv), color);//*vec4(1.,0,0,1);\\n }\\n\",\n\n attributes: {\n position: [[-1, +1, 0], [+1, +1, 0], [+1, -1, 0], [-1, -1, 0]],\n uv: [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]\n },\n elements: [[2, 1, 0], [2, 0, 3]],\n uniforms: {\n model: function model(context, props) {\n return props.model || _glMat2.default.identity([]);\n },\n color: function color(context, props) {\n return props.color || [0, 0, 0, 1];\n },\n texture: texture },\n cull: {\n enable: false,\n face: 'back'\n },\n blend: {\n enable: true,\n func: {\n srcRGB: 'src alpha',\n srcAlpha: 1,\n dstRGB: 'one minus src alpha',\n dstAlpha: 1\n },\n equation: {\n rgb: 'add',\n alpha: 'add'\n },\n color: [0, 1, 0, 1]\n }\n });\n}", "function createAndSetupTexture() {\r\n\tvar texture = gl.createTexture();\r\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\r\n\r\n\t// set up texture so we can render any size image and so we are working with pixels\r\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\r\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\r\n\r\n\treturn texture;\r\n}", "set texture(value) {}", "function build() {\n materials.LambertRed = new THREE.MeshLambertMaterial({ color: 0xFF0000 });\n \n /*\n materials.room = new THREE.MeshBasicMaterial( { map: textures.room } );\n meshes.room = new THREE.Mesh( new THREE.SphereBufferGeometry( 500, 32, 16 ), materials.room );\n meshes.room.scale.x = -1;\n scene.add( meshes.room );\n */\n\n\n var path = \"assets/textures/nebula_03/\";\n var urls = [\n path + 'neb_px.jpg',\n path + 'neb_nx.jpg',\n path + 'neb_py.jpg',\n path + 'neb_ny.jpg',\n path + 'neb_pz.jpg',\n path + 'neb_nz.jpg'\n ];\n var textureCube = new THREE.CubeTextureLoader().load(urls);\n //textureCube.format = THREE.RGBFormat;\n //textureCube.mapping = THREE.CubeReflectionMapping;\n\n var cubeShader = THREE.ShaderLib[\"cube\"];\n var cubeMaterial = new THREE.ShaderMaterial({\n fragmentShader: cubeShader.fragmentShader,\n vertexShader: cubeShader.vertexShader,\n uniforms: cubeShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n \n\n\n var textureEquirec = textures.room;\n textureEquirec.mapping = THREE.EquirectangularReflectionMapping;\n textureEquirec.magFilter = THREE.LinearFilter;\n textureEquirec.minFilter = THREE.LinearMipMapLinearFilter;\n\n var equirectShader = THREE.ShaderLib[\"equirect\"];\n var equirectMaterial = new THREE.ShaderMaterial({\n fragmentShader: equirectShader.fragmentShader,\n vertexShader: equirectShader.vertexShader,\n uniforms: equirectShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n equirectMaterial.uniforms[\"tEquirect\"].value = textureEquirec;\n\n\n var ref1 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); \n\n\n \n // Skybox (WARNING - cubeMaterial doesnt show untill its used on sphereMaterial with textureCube)\n var cubeMesh = new THREE.Mesh(new THREE.BoxBufferGeometry(50, 50, 50), cubeMaterial);\n scene.add(cubeMesh);\n\n var geometry = new THREE.SphereBufferGeometry(2, 32, 32);\n sphereMaterial = new THREE.MeshLambertMaterial({ emissive: 0xFFFFFF, envMap: textureCube });\n sphereMesh = new THREE.Mesh(geometry, sphereMaterial);\n sphereMesh.position.y -= 6;\n scene.add(sphereMesh);\n\n\n // Aurora Text\n meshes.auroraText = new THREE.Mesh(geometries.auroraText, sphereMaterial);\n meshes.auroraText.scale.x = meshes.auroraText.scale.y = meshes.auroraText.scale.z = scale;\n //meshes.auroraText.translation = THREE.GeometryUtils.center(geometry); // Translate the rotation origin to center (DEP)\n meshes.auroraText.translation = geometries.auroraText.center(); // Translate the rotation origin to center\n meshes.auroraText.flipSided = true;\n group.add(meshes.auroraText);\n\n \n \n // Spheres\n var geometry = new THREE.SphereBufferGeometry(3, 32, 32);\n sphereMaterial1 = new THREE.MeshLambertMaterial({ emissive: 0xFFFF00, envMap: textureEquirec });\n sphereMaterial1.needsUpdate = true;\n\n\n var sphere1 = new THREE.Mesh(geometry, ref1);\n sphere1.position.x += 5;\n sphere1.position.y -= 6;\n scene.add(sphere1);\n\n var sphere2 = new THREE.Mesh(geometry, sphereMaterial1);\n sphere2.position.x += -5;\n sphere2.position.y -= 6;\n scene.add(sphere2);\n\n\n /*\n var path = \"assets/textures/nebula_03/\";\n var urls = [\n path + 'neb_px.jpg',\n path + 'neb_nx.jpg',\n path + 'neb_py.jpg',\n path + 'neb_ny.jpg',\n path + 'neb_pz.jpg',\n path + 'neb_nz.jpg'\n ];\n var textureCube = new THREE.CubeTextureLoader().load(urls);\n textureCube.format = THREE.RGBFormat;\n textureCube.mapping = THREE.CubeReflectionMapping;\n\n var textureSphere = textureLoader.load(\"assets/textures/metal.jpg\");\n textureSphere.mapping = THREE.SphericalReflectionMapping;\n\n var cubeShader = THREE.ShaderLib[\"cube\"];\n var cubeMaterial = new THREE.ShaderMaterial({\n fragmentShader: cubeShader.fragmentShader,\n vertexShader: cubeShader.vertexShader,\n uniforms: cubeShader.uniforms,\n depthWrite: false,\n side: THREE.BackSide\n });\n\n // Skybox\n var cubeMesh = new THREE.Mesh(new THREE.BoxBufferGeometry(50, 50, 50), cubeMaterial);\n scene.add(cubeMesh);\n\n\n var geometry = new THREE.SphereBufferGeometry(8, 32, 32);\n sphereMaterial = new THREE.MeshLambertMaterial({ emissive: 0xFFFF00, envMap: textureCube });\n sphereMesh = new THREE.Mesh(geometry, sphereMaterial);\n scene.add(sphereMesh);\n */\n\n\n function rend() {\n //renderer.render(sceneCube,cubeCamera);\n }\n requestAnimationFrame(rend);\n\n\n // meshes.cube = new THREE.Mesh( new THREE.BoxBufferGeometry( 4, 4, 4 ), materials.mat2 );\n // group.add( meshes.cube );\n\n\n /*\n // Works\n var cubemap = new THREE.CubeTextureLoader()\n .setPath( 'assets/textures/nebula_03/' )\n .load( [\n 'neb_px.jpg',\n 'neb_nx.jpg',\n 'neb_py.jpg',\n 'neb_ny.jpg',\n 'neb_pz.jpg',\n 'neb_nz.jpg'\n ] );\n scene.background = cubemap;\n var reflectionMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: scene.background } ); // Works\n var reflectionMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); // Works\n meshes.cube = new THREE.Mesh( new THREE.BoxBufferGeometry( 4, 4, 4 ), reflectionMaterial );\n group.add( meshes.cube );\n */\n\n\n\n\n //var reflectionMaterial1 = new THREE.MeshPhongMaterial({color: 0xFFFFFF,envMap: cubemap});\n\n //var reflectionMaterial3 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: materials.mat2 } );\n\n\n\n\n\n // cameras.cube1 = new THREE.CubeCamera( 1, 1000, 256 );\n // cameras.cube1.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;\n // scene.add( cameras.cube1 );\n\n // cameras.cube2 = new THREE.CubeCamera( 1, 1000, 256 );\n // cameras.cube2.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;\n // scene.add( cameras.cube2 );\n\n\n\n // var chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cameras.cube2.renderTarget } );\n\n\n // materials.mat2 = new THREE.MeshBasicMaterial( {\n // envMap: cameras.cube2.renderTarget.texture\n // } );\n\n\n\n\n\n\n }", "function createGround(image){\n // creating a textured plane which receives shadows\n var geometry = new THREE.PlaneGeometry( 180, 180, 128 );\n var texture = new THREE.TextureLoader().load(image );\n texture.wrapS = THREE.RepeatWrapping;\n texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.set( 15, 15 );\n var material = new THREE.MeshLambertMaterial( { color: 0xffffff, map: texture ,side:THREE.DoubleSide} );\n var pmaterial = new Physijs.createMaterial(material,0.9,0.05);\n //var mesh = new THREE.Mesh( geometry, material );\n var mesh = new Physijs.BoxMesh( geometry, pmaterial, 0 );\n\n mesh.receiveShadow = true;\n\n mesh.rotateX(Math.PI/2);\n return mesh\n // we need to rotate the mesh 90 degrees to make it horizontal not vertical\n}", "function initTexture(gl) {\n const texture = gl.createTexture();\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n \n const img = new Image();\n img.onload = function() {\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n }\n img.src = \"shadertoy-london.jpg\";\n}", "function setTexture() {\n programId = initShaders(gl, \"vertex-shader\", \"tex-fragment-shader\");\n gl.useProgram(programId);\n var image = document.getElementById(\"tile-img\");\n var texture = gl.createTexture();\n gl.bindTexture( gl.TEXTURE_2D, texture );\n //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, \n gl.RGB, gl.UNSIGNED_BYTE, image );\n gl.generateMipmap( gl.TEXTURE_2D );\n // gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, \n // gl.NEAREST_MIPMAP_LINEAR );\n gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n \n gl.uniform1i(gl.getUniformLocation(programId, \"texture\"), 0);\n\n // Light parameters that look best for the choosen texture\n lightAmbient = vec4(0.2, 0.2, 0.0, 1.0 );\n lightDiffuse = vec4( 1.0, 1.0, 1.0, 1.0 );\n lightSpecular = vec4( 0.8, 0.8, 0.8, 1.0 );\n\n materialAmbient = vec4( 0.35, 0.30, 0.25, 1.0 );\n materialDiffuse = vec4( 1.0, 1.0, 1.0, 1.0 );\n materialSpecular = vec4( 0.8, 0.8, 0.8, 1.0 );\n materialShininess = 100.0;\n\n // Texture looks best with these angle and step parameters\n angles = 16;\n steps = 8;\n\n // Send the new light info to the shader\n updateLights();\n draw();\n}", "function initTextures(){\n var texture = gl.createTexture();\n if(!texture){\n console.log(\"failed to create texture object\");\n return false;\n }\n //get u_sampler storage locale\n var u_Sampler = gl.getUniformLocation(gl.program, 'u_Sampler');\n if(!u_Sampler) {\n console.log(\"failed to get storage location for u_Sampler\");\n return false;\n }\n //new image object\n var image = new Image();\n if(!image){\n console.log(\"image creation failure\");\n return false;\n }\n\n image.onload = function(){ loadTexture(texture, 0, u_Sampler, image); renderScene();};\n image.src = 'texture/crate_texture.jpg';\n\n //texture2: floor\n var texture2 = gl.createTexture();\n if(!texture2){\n console.log(\"failed to create texture object\");\n return false;\n }\n\n //todo: rename sampler2?\n var u_Sampler1 = gl.getUniformLocation(gl.program, 'u_Sampler1');\n if(!u_Sampler1) {\n console.log(\"failed to get storage location for u_Sampler\");\n return false;\n }\n\n var image2 = new Image();\n if(!image2){\n console.log(\"im2 create fail\");\n return false;\n }\n image2.onload = function(){ loadTexture(texture2, 1, u_Sampler1, image2); renderScene();};\n // image2.src = 'texture/floorTexjep.jpg';\n image2.src = 'texture/floorTexjep_bigger2.jpg';\n\n //texture3: walls\n var texture3 = gl.createTexture();\n if(!texture3){\n console.log(\"failed to create texture object\");\n return false;\n }\n var u_Sampler3 = gl.getUniformLocation(gl.program, 'u_Sampler3');\n if(!u_Sampler3) {\n console.log(\"failed to get storage location for u_Sampler\");\n return false;\n }\n var image3 = new Image();\n if(!image3){\n console.log(\"im3 create fail\");\n return false;\n }\n image3.onload = function(){ loadTexture(texture3, 2, u_Sampler3, image3); renderScene();};\n image3.src = 'texture/walltex_done1.jpg';\n\n //texture4: walls\n var texture4 = gl.createTexture();\n if(!texture4){\n console.log(\"failed to create texture object\");\n return false;\n }\n\n var u_Sampler4 = gl.getUniformLocation(gl.program, 'u_Sampler4');\n if(!u_Sampler4) {\n console.log(\"failed to get storage location for u_Sampler\");\n return false;\n }\n\n var image4 = new Image();\n if(!image4){\n console.log(\"im4 create fail\");\n return false;\n }\n image4.onload = function(){ loadTexture(texture4, 3, u_Sampler4, image4); renderScene();};\n image4.src = 'texture/ceilingtexBig.jpg';\n\n\n u_whichTexture = gl.getUniformLocation(gl.program, 'u_whichTexture');\n if(!u_whichTexture){\n console.log(\"which texture failed to init\");\n }\n return true;\n}", "function initTextures() {\n\n\t\t//_____This is the texture of the head:\n\n\t\theadTexture = gl.createTexture();\n\t\theadTexture.image = new Image();\n\t\theadTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(headTexture)\n\t\t}\n\t\theadTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/face-texture.gif\";\n\n\t\t//_____This is the texture of the body:\n\n\t\tbodyTexture = gl.createTexture();\n\t\tbodyTexture.image = new Image();\n\t\tbodyTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(bodyTexture)\n\t\t}\n\t\tbodyTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/virtual-child-body.gif\";\n\n\t\t//_____This is the texture of the arm with cookie:\n\n\t\tcookieTexture = gl.createTexture();\n\t\tcookieTexture.image = new Image();\n\t\tcookieTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(cookieTexture)\n\t\t}\n\t\tcookieTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/arm_with_cookie.gif\";\n\n\t\t//_____This is the texture of the cookie for the child to eat:\n\n\t\tgiveCookieTexture = gl.createTexture();\n\t\tgiveCookieTexture.image = new Image();\n\t\tgiveCookieTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(giveCookieTexture)\n\t\t}\n\t\tgiveCookieTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/cookie.gif\";\n\n\t\t//_____This is the texture of the left forearm:\n\n\t\tleftForeArmTexture = gl.createTexture();\n\t\tleftForeArmTexture.image = new Image();\n\t\tleftForeArmTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(leftForeArmTexture)\n\t\t}\n\t\tleftForeArmTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/forearm.gif\";\n\n\t\t//_____This is the texture of the left upper arm:\n\n\t\tleftUpperArmTexture = gl.createTexture();\n\t\tleftUpperArmTexture.image = new Image();\n\t\tleftUpperArmTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(leftUpperArmTexture)\n\t\t}\n\t\tleftUpperArmTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/upperarm.gif\";\n\n\t\t//_____This is the texture of the right forearm:\n\n\t\trightForeArmTexture = gl.createTexture();\n\t\trightForeArmTexture.image = new Image();\n\t\trightForeArmTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(rightForeArmTexture)\n\t\t}\n\t\trightForeArmTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/forearm.gif\";\n\n\t\t//_____This is the texture of the right upper arm:\n\n\t\trightUpperArmTexture = gl.createTexture();\n\t\trightUpperArmTexture.image = new Image();\n\t\trightUpperArmTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(rightUpperArmTexture)\n\t\t}\n\t\trightUpperArmTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/upperarm.gif\";\n\n\t\t//_____This is the texture of the right eye:\n\t\t//To Do: add an eyelid to the top and bottom of the graphic\n\t\trightEyeTexture = gl.createTexture();\n\t\trightEyeTexture.image = new Image();\n\t\trightEyeTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(rightEyeTexture)\n\t\t}\n\t\trightEyeTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/eyeball.gif\";\n\n\t\t//_____This is the texture of the left eye:\n\n\t\tleftEyeTexture = gl.createTexture();\n\t\tleftEyeTexture.image = new Image();\n\t\tleftEyeTexture.image.onload = function () {\n\t\t\thandleLoadedTexture(leftEyeTexture)\n\t\t}\n\t\tleftEyeTexture.image.src = \"http://www.8d8apps.com/virtualchild/images/eyeball.gif\";\n\n\t}", "function initTextures() {\n cubeTexture = gl.createTexture();\n cubeTexture.image = new Image();\n cubeTexture.image.onload = function() {\n handleTextureLoaded(cubeTexture);\n }; // async loading\n cubeTexture.image.src = \"./assets/doom.jpg\";\n}", "__setupVolumeTexture(object) {\n\t\tvar gl = this._gl;\n\t\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\t\tif (object._volumeTexture != null) return; //\n\t\tobject._volumeTexture = WebGL.createTexture(gl, {\n\t\t\ttarget: gl.TEXTURE_3D,\n\t\t\twidth: 1,\n\t\t\theight: 1,\n\t\t\tdepth: 1,\n\t\t\tdata: new Float32Array([1]),\n\t\t\tformat: gl.RED,\n\t\t\tinternalFormat: gl.R16F,\n\t\t\ttype: gl.FLOAT,\n\t\t\twrapS: gl.CLAMP_TO_EDGE,\n\t\t\twrapT: gl.CLAMP_TO_EDGE,\n\t\t\twrapR: gl.CLAMP_TO_EDGE,\n\t\t\tmin: gl.LINEAR,\n\t\t\tmag: gl.LINEAR\n\t\t});\n\n\t\tobject._environmentTexture = WebGL.createTexture(gl, {\n\t\t\twidth: 1,\n\t\t\theight: 1,\n\t\t\tdata: new Uint8Array([255, 255, 255, 255]),\n\t\t\tformat: gl.RGBA,\n\t\t\tinternalFormat: gl.RGBA, // TODO: HDRI & OpenEXR support\n\t\t\ttype: gl.UNSIGNED_BYTE,\n\t\t\twrapS: gl.CLAMP_TO_EDGE,\n\t\t\twrapT: gl.CLAMP_TO_EDGE,\n\t\t\tmin: gl.LINEAR,\n\t\t\tmax: gl.LINEAR\n\t\t});\n\n\t\t// TODO: texture class, to avoid duplicating texture specs\n\t\tgl.bindTexture(gl.TEXTURE_3D, object._volumeTexture);\n\t\tgl.texImage3D(gl.TEXTURE_3D, 0, gl.R16F,\n\t\t\tobject._width, object._height, object._depth,\n\t\t\t0, gl.RED, gl.FLOAT, object._data);\n\t\tgl.bindTexture(gl.TEXTURE_3D, null);\n\t}", "constructor( max_subdivisions ) // unit sphere) and group them into triangles by following the predictable pattern of the recursion.\r\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Start from the following equilateral tetrahedron:\r\n this.positions.push( ...Vec.cast( [ 0, 0, -1 ], [ 0, .9428, .3333 ], [ -.8165, -.4714, .3333 ], [ .8165, -.4714, .3333 ] ) );\r\n \r\n this.subdivideTriangle( 0, 1, 2, max_subdivisions); // Begin recursion.\r\n this.subdivideTriangle( 3, 2, 1, max_subdivisions);\r\n this.subdivideTriangle( 1, 0, 3, max_subdivisions);\r\n this.subdivideTriangle( 0, 2, 3, max_subdivisions); \r\n \r\n for( let p of this.positions )\r\n { this.normals.push( p.copy() ); // Each point has a normal vector that simply goes to the point from the origin.\r\n\r\n // Textures are tricky. A Subdivision sphere has no straight seams to which image \r\n // edges in UV space can be mapped. The only way to avoid artifacts is to smoothly \r\n this.texture_coords.push( // wrap & unwrap the image in reverse - displaying the texture twice on the sphere.\r\n Vec.of( Math.asin( p[0]/Math.PI ) + .5, Math.asin( p[1]/Math.PI ) + .5 ) ) }\r\n }", "function initTextures() {\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"cone.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"body.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"fin.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"moon.png\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"helmet.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"cdnFlg.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"space.jpg\");\n\n textureArray.push({});\n loadFileTexture(textureArray[textureArray.length - 1], \"space2.jpg\");\n\n textureArray.push({});\n loadImageTexture(textureArray[textureArray.length - 1], image2);\n\n\n}", "get texture() {}", "function generatePointTexture(){\n\tlet canvas = document.createElement(\"canvas\");\n\tcanvas.width = canvas.height = 64;\n\tlet ctx = canvas.getContext(\"2d\");\n\tlet tex = new THREE.Texture(canvas);\n\tctx.beginPath();\n\tctx.arc(canvas.width/2,canvas.height/2,canvas.height/2-3,0,2*Math.PI);\n\tctx.fillStyle = \"#FFFFFF\";\n\tctx.fill();\n\ttex.needsUpdate = true;\n\tif(tex.minFilter !== THREE.NearestFilter && tex.minFilter !== THREE.LinearFilter){\n\t\ttex.minFilter = THREE.NearestFilter;\n\t}\n\treturn tex;\n}", "function build_world(gl, n, textures, samplers, viewProjMatrix, u_MvpMatrix, u_NormalMatrix) {\r\n \r\ngl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\ngl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1); // Flip the image's y axis\r\n\r\n //pass build \" gl.TEXTURE0, textures[0], samplers[0], 0\" to bind the first texture,\r\n //pass build \" gl.TEXTURE1, textures[1], samplers[1], 1 \" to bind the second texture, etc.\r\n //pass build \"-1\" as the 7th param to not bind a texture\r\n\r\n\r\n//FLOOR\r\n g_modelMatrix.setTranslate(0.0, -10.0, 0.0);\r\n build(gl, n, 20.0, 0.1, 20.0, gl.TEXTURE4, textures[4], samplers[4], 4, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //CEILING\r\n g_modelMatrix.setTranslate(0.0, 30.0, 0.0);\r\n build(gl, n, 20.0, 0.1, 20.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //WALLS\r\n g_modelMatrix.setTranslate(0.0, 10.0, 40.0);\r\n build(gl, n, 20.0, 10.0, 0.1, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(40.0, 10.0, 0.0);\r\n build(gl, n, 0.1, 10.0, 20.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //WHITE BOARD\r\n g_modelMatrix.setTranslate(0.0, 10.0, 39.0);\r\n build(gl, n, 10.0, 6.0, 0.1, gl.TEXTURE3, textures[3], samplers[3], 3, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n //WALL with gap for window\r\n g_modelMatrix.setTranslate(-40.0, 24.0, 0.0);\r\n build(gl, n, 0.1, 3.0, 20.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-40.0, -4.0, 0.0);\r\n build(gl, n, 0.1, 3.0, 20.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-40.0, 10.0, 32.0);\r\n build(gl, n, 0.1, 4.0, 4.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-40.0, 10.0, -32.0);\r\n build(gl, n, 0.1, 4.0, 4.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-40.0, 10.0, 0.0);\r\n build(gl, n, 0.1, 4.0, 2.0, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n //WINDOW FRAMES\r\n g_modelMatrix.setTranslate(-39.5, 10.0, 4.0);\r\n build(gl, n, 0.1, 4.3, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, 14.0);\r\n build(gl, n, 0.1, 4.0, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, 24.0);\r\n build(gl, n, 0.1, 4.3, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, 14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 18.0, 14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 2.0, 14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n g_modelMatrix.setTranslate(-39.5, 10.0, -4.0);\r\n build(gl, n, 0.1, 4.3, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, -14.0);\r\n build(gl, n, 0.1, 4.0, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, -24.0);\r\n build(gl, n, 0.1, 4.3, 0.2, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 10.0, -14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 18.0, -14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-39.5, 2.0, -14.0);\r\n build(gl, n, 0.1, 0.2, 4.8, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n //SKY\r\n g_modelMatrix.setTranslate(-60.0, 10.0, 0.0);\r\n build(gl, n, 0.1, 10.0, 20.0, gl.TEXTURE0, textures[0], samplers[0], 0, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n//WALL with gap for door\r\n g_modelMatrix.setTranslate(0.0, 24.0, -40.0);\r\n build(gl, n, 20.0, 3.0, 0.1, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(26.0, 4.0, -40.0);\r\n build(gl, n, 7.0, 7.0, 0.1, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.setTranslate(-26.0, 4.0, -40.0);\r\n build(gl, n, 7.0, 7.0, 0.1, gl.TEXTURE5, textures[5], samplers[5], 5, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n //DOOR\r\n g_modelMatrix.setTranslate(12.0, 4.0, -40.0);\r\n g_modelMatrix.rotate(door_angle, 0.0, 1.0, 0.0); // Rotate around the y-axis\r\n g_modelMatrix.translate(-6.0, 0.0, 0.0);\r\n build(gl, n, 3.0, 7.0, 0.1, gl.TEXTURE2, textures[2], samplers[2], 2, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(-4.0, -2.0, 0.2);\r\n build(gl, n, 0.5, 0.25, 0.1, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n\r\n g_modelMatrix.setTranslate(-12.0, 4.0, -40.0);\r\n g_modelMatrix.rotate(-door_angle, 0.0, 1.0, 0.0); // Rotate around the y-axis\r\n g_modelMatrix.translate(6.0, 0.0, 0.0);\r\n build(gl, n, 3.0, 7.0, 0.1, gl.TEXTURE2, textures[2], samplers[2], 2, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(4.0, -2.0, 0.2);\r\n build(gl, n, 0.5, 0.25, 0.1, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n \r\n for (var j = 0; j < 2; j++) {//loop for the tables and chairs on the other side\r\n for (var i = 0; i < 2; i++) {//loop for two table and chairs\r\n //TABLE\r\n g_modelMatrix.setTranslate(-30.0 + j*60, -1.0, 10.0 + i*(-25));\r\n if (j == 0) {\r\n if (i == 0) {\r\n g_modelMatrix.translate(0.0, 0.0, table1z);\r\n } else {\r\n g_modelMatrix.translate(0.0, 0.0, table2z);\r\n }\r\n }\r\n build(gl, n, 4.5, 0.3, 2.5, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //LEGS\r\n g_modelMatrix.translate(8.5, -4.6, 4.5);\r\n build(gl, n, 0.25, 2.2, 0.25, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(-17.0, 0.0, 0.0);\r\n build(gl, n, 0.25, 2.2, 0.25, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(0.0, 0.0, -9.0);\r\n build(gl, n, 0.25, 2.2, 0.25, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(17.0, 0.0, 0.0);\r\n build(gl, n, 0.25, 2.2, 0.25, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //CHAIR\r\n g_modelMatrix.setTranslate(-30.0 + j*60, -5.0, 6.0 + i*(-25));\r\n if (j == 0) {\r\n if (i == 0) {\r\n g_modelMatrix.translate(0.0, 0.0, chair1z);\r\n } else {\r\n g_modelMatrix.translate(0.0, 0.0, chair2z);\r\n }\r\n }\r\n build(gl, n, 2.0, 0.3, 2.0, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //BACK\r\n g_modelMatrix.translate(0.0, 6.0, -3.5);\r\n build(gl, n, 2.0, 2.0, 0.3, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n //LEGS\r\n g_modelMatrix.translate(3.4, -7.3, 0.0);\r\n build(gl, n, 0.3, 1.7, 0.3, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(-6.8, 0.0, 0.0);\r\n build(gl, n, 0.3, 1.7, 0.3, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(0.0, -1.0, 6.8);\r\n build(gl, n, 0.3, 1.2, 0.3, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n g_modelMatrix.translate(6.8, 0.0, 0.0);\r\n build(gl, n, 0.3, 1.2, 0.3, gl.TEXTURE1, textures[1], samplers[1], 1, viewProjMatrix, u_MvpMatrix, u_NormalMatrix);\r\n }\r\n }\r\n}", "function addPlanets() {\n // Planet A\n ctx.beginPath()\n ctx.arc(200, 200, 40, 0, 2 * Math.PI)\n var grd = ctx.createRadialGradient(190, 210, 30, 200, 220, 90);\n grd.addColorStop(0, \"rgba(247, 185, 80, .1)\");\n grd.addColorStop(1, \"rgba(100, 1, 73, 1)\");\n ctx.fillStyle = grd\n ctx.fill()\n\n // Planet B\n ctx.beginPath()\n ctx.arc(750, 20, 60, 0, 2 * Math.PI)\n var grd = ctx.createRadialGradient(750, 110, 20, 740, 120, 120);\n grd.addColorStop(0, \"rgba(247, 185, 80, .3)\");\n grd.addColorStop(1, \"rgba(100, 1, 73, 1)\");\n ctx.fillStyle = grd\n ctx.fill()\n}", "constructor() // etc) smaller and more cache friendly.\r\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Name the values we'll define per each vertex.\r\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\r\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\r\n this.texture_coords.push( ...Vec.cast( [0,0], [1,0], [0,1], [1,1] ) ); // Draw a square in texture coordinates too.\r\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\r\n }", "createSurface() {\n let controlPoints = [];\n for (var i = 0, k = 0; i < this.nPointsU; i++) {\n let uPoint = [];\n for (var j = 0; j < this.nPointsV; j++, k++) {\n this.controlPoints[k].push(1);\n uPoint.push(this.controlPoints[k]);\n }\n controlPoints.push(uPoint);\n }\n\n\t\t\t\tlet nurbsSurface = new CGFnurbsSurface(this.nPointsU-1, this.nPointsV-1, controlPoints);\n\n\t\t\t\tthis.nurbsPlane = new CGFnurbsObject(this.scene, this.nPartsU, this.nPartsV, nurbsSurface);\n\t\t}", "function generateTextureCoordinates() {\n\n // BEGIN exercise Sphere-Earth-Texture\n\n // As there is not exactly one texture coordinate per vertex,\n // we have to install a different mapping as used for polygonVertices to vertices.\n // For texture coordinate system use openGL standard, where origin is bottom-left.\n this.textureCoord = [];\n this.polygonTextureCoord = [];\n\n\n // Loop over vertices/edges in polygon.\n\n // Shorthands for the current vertex.\n\n\n // Calculate longitude (east-west position) phi (u-coordinate).\n // arctangent (of here z/x), representing the angle theta between the positive X axis, and the point.\n // Scale phi to uv range [0,1].\n\n\n // Calculate latitude (north-south position) theta (v-coordinate) from y component of vertex.\n // Scale theta to uv range [0,1].\n\n\n // Store new uv coordinate in new uv-vector.\n //console.log(\"phi:\" + (~~(phi * 100)) + \" theta:\" + (~~(theta * 100)) + \" x:\" + (~~(x * 100)) + \" z:\" + (~~(z * 100)));\n\n\n // Problem with phi/u: phi=360 and phi=0 are the same point in 3D and also on a tiled texture.\n // But for faces it is a difference if uv-range is 350¡-360¡ [.9-1]or 350¡-0¡ [.9-0].\n // Thus, insert a check/hack (assuming faces cover only a small part of the texture):\n\n // Check if u-range should be low or high (left or right in texture),\n // by summing up u values (ignoring u=0 values).\n\n // Check and correct u values if 0;\n\n // END exercise Sphere-Earth-Texture\n }", "createRenderTexture(source){\n if(this.gl == null){\n throw new Error('webgl not initialized');\n }\n \n let gl = this.gl;\n let fTex = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, fTex);\n const level = 0;\n const internalFormat = gl.RGB;\n const width = this.vertexNum;\n const height = 1;\n const border = 0;\n const format = gl.RGB;\n const type = gl.FLOAT;\n let data = new Float32Array(source);\n\n const alignment = 1;\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, alignment);\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border,\n format, type, data);\n // set the filtering so we don't need mips and it's not filtered\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n //gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n //gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n \n gl.bindTexture(gl.TEXTURE_2D, null);\n return fTex;\n\n }", "function Terrain() {\r\n\r\n function loadFileToString(path) {\r\n\r\n var client = new XMLHttpRequest();\r\n\r\n client.open('GET', path, false);\r\n client.send();\r\n\r\n if(client.status == 200) {\r\n return client.responseText;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n\r\n // Tiles that sit next to a tile of a greater scale need to have their edges morphed to avoid\r\n // edges. Mark which edges need morphing using flags. These flags are then read by the vertex\r\n // shader which performs the actual morph\r\n var Edge = {\r\n NONE: 0,\r\n TOP: 1,\r\n LEFT: 2,\r\n BOTTOM: 4,\r\n RIGHT: 8\r\n };\r\n\r\n var this_ = this;\r\n var terrainVert, terrainFrag, terrainSnowFrag, terrainToonFrag;\r\n var texturePath = \"textures/\";\r\n var textures;\r\n var offset;\r\n\r\n var fragShaders;\r\n var fragShader;\r\n\r\n var resolution, heightData, worldWidth, levels;\r\n\r\n var tileGeometry;\r\n\r\n var mesh = new THREE.Object3D();\r\n var pi = 3.1415926535897932384626433832795;\r\n\r\n this.update = function(x, y){\r\n offset.x = x;\r\n offset.y = y;\r\n }\r\n\r\n // Terrain is an extension of Object3D and thus can be added directly to the stage\r\n this.initialize = function( height_parm, width_parm, level_parm, res_param ) {\r\n\r\n terrainVert = loadFileToString(\"./shaders/terrain.vert\");\r\n terrainFrag = loadFileToString(\"./shaders/terrain.frag\");\r\n terrainSnowFrag = loadFileToString(\"./shaders/terrainSnow.frag\");\r\n terrainToonFrag = loadFileToString(\"./shaders/terrainToon.frag\");\r\n\r\n textures = {\r\n // grass: THREE.ImageUtils.loadTexture( texturePath + \"grass.jpg\" ),\r\n rock: THREE.ImageUtils.loadTexture( texturePath + \"rock.jpg\" ),\r\n // snow: THREE.ImageUtils.loadTexture( texturePath + \"snow.jpg\" )\r\n };\r\n\r\n for ( var t in textures ) {\r\n if ( textures.hasOwnProperty( t ) ) {\r\n textures[t].wrapS = textures[t].wrapT = THREE.RepeatWrapping;\r\n }\r\n }\r\n\r\n THREE.Object3D.call( this );\r\n\r\n worldWidth = ( width_parm !== undefined ) ? width_parm : 1024;\r\n levels = ( level_parm !== undefined ) ? level_parm : 6;\r\n resolution = ( res_param !== undefined ) ? res_param : 128;\r\n heightData = height_parm;\r\n\r\n // Offset is used to re-center the terrain, this way we get the greates detail\r\n // nearest to the camera. In the future, should calculate required detail level per tile\r\n offset = new THREE.Vector3( 0, 0, 0 );\r\n\r\n // Which shader should be used for rendering\r\n fragShaders = [terrainFrag, terrainSnowFrag, terrainToonFrag];\r\n mesh.fragShader = terrainSnowFrag;\r\n\r\n // Create geometry that we'll use for each tile, just a standard plane\r\n tileGeometry = new THREE.PlaneGeometry( 1, 1, resolution, resolution );\r\n // Place origin at bottom left corner, rather than center\r\n var m = new THREE.Matrix4();\r\n m.makeTranslation( 0.5, 0.5, 0 );\r\n tileGeometry.applyMatrix( m );\r\n\r\n // Create collection of tiles to fill required space\r\n /*jslint bitwise: true */\r\n var initialScale = worldWidth / Math.pow( 2, levels );\r\n\r\n // Create center layer first\r\n // +---+---+\r\n // | O | O |\r\n // +---+---+\r\n // | O | O |\r\n // +---+---+\r\n createTile( -initialScale, -initialScale, initialScale, Edge.NONE );\r\n createTile( -initialScale, 0, initialScale, Edge.NONE );\r\n createTile( 0, 0, initialScale, Edge.NONE );\r\n createTile( 0, -initialScale, initialScale, Edge.NONE );\r\n\r\n // Create \"quadtree\" of tiles, with smallest in center\r\n // Each added layer consists of the following tiles (marked 'A'), with the tiles\r\n // in the middle being created in previous layers\r\n // +---+---+---+---+\r\n // | A | A | A | A |\r\n // +---+---+---+---+\r\n // | A | | | A |\r\n // +---+---+---+---+\r\n // | A | | | A |\r\n // +---+---+---+---+\r\n // | A | A | A | A |\r\n // +---+---+---+---+\r\n for ( var scale = initialScale; scale < worldWidth; scale *= 2 ) {\r\n createTile( -2 * scale, -2 * scale, scale, Edge.BOTTOM | Edge.LEFT );\r\n createTile( -2 * scale, -scale, scale, Edge.LEFT );\r\n createTile( -2 * scale, 0, scale, Edge.LEFT );\r\n createTile( -2 * scale, scale, scale, Edge.TOP | Edge.LEFT );\r\n\r\n createTile( -scale, -2 * scale, scale, Edge.BOTTOM );\r\n // 2 tiles 'missing' here are in previous layer\r\n createTile( -scale, scale, scale, Edge.TOP );\r\n\r\n createTile( 0, -2 * scale, scale, Edge.BOTTOM );\r\n // 2 tiles 'missing' here are in previous layer\r\n createTile( 0, scale, scale, Edge.TOP );\r\n\r\n createTile( scale, -2 * scale, scale, Edge.BOTTOM | Edge.RIGHT );\r\n createTile( scale, -scale, scale, Edge.RIGHT );\r\n createTile( scale, 0, scale, Edge.RIGHT );\r\n createTile( scale, scale, scale, Edge.TOP | Edge.RIGHT );\r\n }\r\n\r\n var m = new THREE.Matrix4();\r\n m.makeRotationX(pi * 1.5);\r\n m.multiplyScalar(10);\r\n mesh.applyMatrix( m );\r\n\r\n /*jslint bitwise: false */\r\n };\r\n\r\n this.getMesh = function() {\r\n mesh.receiveShadow = true;\r\n return mesh;\r\n }\r\n\r\n function createTile( x, y, scale, edgeMorph ) {\r\n var terrainMaterial = createTerrainMaterial( heightData,\r\n offset,\r\n new THREE.Vector2( x, y ),\r\n scale,\r\n resolution,\r\n edgeMorph );\r\n var plane = new THREE.Mesh( tileGeometry, terrainMaterial );\r\n mesh.add( plane );\r\n }\r\n\r\n \r\n function createTerrainMaterial( heightData, globalOffset, offset, scale, resolution, edgeMorph ) {\r\n // Is it bad to change this for every tile?\r\n modifyDefine(terrainVert, \"TILE_RESOLUTION\", resolution.toFixed(1));\r\n\r\n return new THREE.ShaderMaterial( {\r\n uniforms: {\r\n uEdgeMorph: { type: \"i\", value: edgeMorph },\r\n uGlobalOffset: { type: \"v3\", value: globalOffset },\r\n uHeightData: { type: \"t\", value: heightData },\r\n //uGrass: { type: \"t\", value: textures.grass },\r\n uRock: { type: \"t\", value: textures.rock },\r\n //uSnow: { type: \"t\", value: textures.snow },\r\n uTileOffset: { type: \"v2\", value: offset },\r\n uScale: { type: \"f\", value: scale }\r\n },\r\n vertexShader: terrainVert,\r\n fragmentShader: mesh.fragShader,\r\n transparent: true\r\n } );\r\n };\r\n\r\n function modifyDefine(target ,define, value ) {\r\n var regexp = new RegExp(\"#define \" + define + \" .*\", \"g\");\r\n var newDefine = \"#define \" + define + ( value ? \" \" + value : \"\" );\r\n if ( target.match( regexp ) ) {\r\n // #define already exists, update its value\r\n target = target.replace( regexp, newDefine );\r\n }\r\n else {\r\n // New #define, prepend to start of file\r\n target = newDefine + \"\\n\" + target.value;\r\n }\r\n }\r\n\r\n this.cycleShader = function() {\r\n // Swap between different terrains\r\n var f = mesh.fragShaders.indexOf( mesh.fragShader );\r\n f = ( f + 1 ) % mesh.fragShaders.length;\r\n this.fragShader = mesh.fragShaders[f];\r\n\r\n // Update all tiles\r\n for ( var c in mesh.children ) {\r\n var tile = mesh.children[c];\r\n tile.material.fragmentShader = mesh.fragShader.value;\r\n tile.material.needsUpdate = true;\r\n }\r\n\r\n return f;\r\n };\r\n}", "function initTextures() {\r\n return [loadImageAsCubemapTexture('WebGL.png', 0)];\r\n}", "updatePlanetSceneObj(planet) {\n\t\tconst gl = ui.gl;\n\t\tplanet.sceneObj.shader = this.planetHeatMapTexShader;\n\t\tplanet.sceneObj.texs.length = 3;\n\t\tplanet.sceneObj.texs[0] = planet.tex;\n\t\tplanet.sceneObj.texs[1] = planet.tideTex;\n\t\tplanet.sceneObj.texs[2] = this.hsvTex;\n\t\t\n\t\t//and update calculated variable if it is out of date ...\n\t\tif (planet.lastMeasureCalcDate !== cfg.julianDate) {\n\t\t\tplanet.lastMeasureCalcDate = cfg.julianDate;\n\n\n\t\t\t// (could store tide values in a texture then reduce to find min/max, but this means a texture per planet ... that's lots of textures ...)\n\t\t\t// (could compute this on the fly, but then there's no easy way to find the min/max ... )\n\t\t\t// (could store as texture, and just keep the texture small ... around the size that the tideBuffer already is ... 36x72 )\n\n\t\t\t//fbo render to the tide tex to calcuate the float values \n\t\n\t\t\t//look in the shader's code for which does what\n\t\t\tlet flags;\n\t\t\tswitch (displayMethod) {\n\t\t\tcase 'Tangent Tidal':\n\t\t\t\tflags = [true, false, false, false];\n\t\t\t\tbreak;\n\t\t\tcase 'Normal Tidal':\n\t\t\t\tflags = [false, true, false, false];\n\t\t\t\tbreak;\n\t\t\tcase 'Total Tidal':\n\t\t\t\tflags = [true, true, false, false];\n\t\t\t\tbreak;\n\t\t\tcase 'Tangent Gravitational':\n\t\t\t\tflags = [false, false, true, false];\n\t\t\t\tbreak;\n\t\t\tcase 'Normal Gravitational':\n\t\t\t\tflags = [false, false, false, true];\n\t\t\t\tflags[3] = true;\n\t\t\t\tbreak;\n\t\t\tcase 'Total Gravitational':\n\t\t\t\tflags = [false, false, true, true];\n\t\t\t\tbreak;\n\t\t\tcase 'Tangent Total':\n\t\t\t\tflags = [true, false, true, false];\n\t\t\t\tbreak;\n\t\t\tcase 'Normal Total':\n\t\t\t\tflags = [false, true, false, true];\n\t\t\t\tbreak;\n\t\t\tcase 'Total':\n\t\t\t\tflags = [true, true, true, true];\n\t\t\t\tbreak;\n\t\t\t}\n\t\n\t\t\tlet viewport = gl.getParameter(gl.VIEWPORT);\n\n\t\t\tthis.fbo.setColorAttachmentTex2D(0, planet.tideTex);\n\t\t\tgl.viewport(0, 0, tideTexWidth, tideTexHeight);\n\t\t\tgl.disable(gl.DEPTH_TEST);\n\t\t\tgl.disable(gl.CULL_FACE);\n\t\t\tthis.fbo.draw({\n\t\t\t\tcallback : function() {\n\t\t\t\t\t//clear is working, but the render is not ...\n\t\t\t\t\t//gl.clearColor(.5,0,0,1);\n\t\t\t\t\t//gl.clear(gl.COLOR_BUFFER_BIT);\n\t\t\t\t\tquadObj.draw({\n\t\t\t\t\t\tshader : planetSurfaceCalculationShader,\n\t\t\t\t\t\tuniforms : {\n\t\t\t\t\t\t\tpos : planet.pos,\n\t\t\t\t\t\t\tangle : planet.angle,\n\t\t\t\t\t\t\tequatorialRadius : planet.equatorialRadius !== undefined ? planet.equatorialRadius : planet.radius,\n\t\t\t\t\t\t\tinverseFlattening : planet.inverseFlattening !== undefined ? planet.inverseFlattening : .5,\n\t\t\t\t\t\t\tsourcePlanetIndex : planet.index,\n\t\t\t\t\t\t\tplanetStateTexHeight : cfg.orbitStarSystem.planetStateTex.height,\n\t\t\t\t\t\t\tscaleExaggeration : planetScaleExaggeration,\n\t\t\t\t\t\t\tflags : flags\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttexs : [cfg.orbitStarSystem.planetStateTex],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//...then min/max reduce\n\n\t\t\tlet thiz = this;\n\t\t\tlet reduce = function(kernelShader, src) {\n\t\t\t\tlet width = tideTexWidth;\n\t\t\t\tlet height = tideTexHeight;\n\t\t\t\tlet dstIndex = 0; \n\t\t\t\tlet current = src;\n\n\t\t\t\twhile (width > 1 && height > 1) {\n\t\t\t\t\twidth >>= 1;\n\t\t\t\t\theight >>= 1;\n\t\t\t\t\tif (!width || !height) throw 'got a non-square size... TODO add support for this'; \n\t\t\t\t\tgl.viewport(0, 0, width, height);\n\t\t\t\t\t\n\t\t\t\t\tthiz.fbo.bind();\n\t\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, thiz.tideReduceTexs[dstIndex].obj, 0);\n\t\t\t\t\tthiz.fbo.check();\n\t\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\t\t\t\t\tquadObj.draw({\n\t\t\t\t\t\tshader : kernelShader,\n\t\t\t\t\t\tuniforms : {\n\t\t\t\t\t\t\ttexsize : [tideTexWidth, tideTexHeight], \n\t\t\t\t\t\t\tviewsize : [width, height]\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttexs : [current]\n\t\t\t\t\t});\n\t\t\t\t\tthiz.fbo.unbind();\n\n\t\t\t\t\tcurrent = thiz.tideReduceTexs[dstIndex];\n\t\t\t\t\tdstIndex = (dstIndex + 1) & 1;\n\t\t\t\t}\n\t\t\n\t\t\t\t//'current' has our texture\n\n\t\t\t\t//now that the viewport is 1x1, run the encode shader on it\n\t\t\t\tthiz.fbo.bind();\n\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, thiz.encodeTempTex.obj, 0);\n\t\t\t\tthiz.fbo.check();\n\t\t\t\tgl.viewport(0, 0, thiz.encodeTempTex.width, thiz.encodeTempTex.height);\n\t\t\t\tquadObj.draw({\n\t\t\t\t\tshader : thiz.encodeShader[0],\n\t\t\t\t\ttexs : [current]\n\t\t\t\t});\n\n\t\t\t\tlet cflUint8Result = new Uint8Array(4);\n\t\t\t\tgl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, cflUint8Result);\n\t\t\t\tthiz.fbo.unbind();\n\t\t\t\t\n\t\t\t\tlet cflFloat32Result = new Float32Array(cflUint8Result.buffer);\n\t\t\t\tlet result = cflFloat32Result[0];\n\t\t\t\treturn result;\n\t\t\t};\n\n\t\t\tplanet.measureMin = reduce(this.minReduceShader, planet.tideTex);\n\t\t\tplanet.measureMax = reduce(this.maxReduceShader, planet.tideTex);\n//console.log('measure min', planet.measureMin, 'max', planet.measureMax);\n\t\t\tif (planet == cfg.orbitTarget) {\n\t\t\t\tcfg.refreshMeasureText();\n\t\t\t}\n\n\t\t\t//planet.sceneObj.uniforms.forceMin = planet.measureMax;\n\t\t\t//planet.sceneObj.uniforms.forceMax = (planet.measureMin - planet.measureMax) / colorBarHSVRange + planet.measureMax;\nplanet.forceMin = planet.measureMax;\nplanet.forceMax = (planet.measureMin - planet.measureMax) / colorBarHSVRange + planet.measureMax;\n\n\t\t\tgl.viewport.apply(gl, viewport);\n\t\t\tgl.enable(gl.DEPTH_TEST);\n\t\t\tgl.enable(gl.CULL_FACE);\n\t\t\t\n\t\t\t//...then use the float buffer, min, and max, to do the hsv overlay rendering\n\n\t\t}\n\t}", "function populateColorTexture(pallet){\n for(var i=0;i<256;i++){\n textureArray[4*i ]=pallet[i].r;\n textureArray[4*i+1]=pallet[i].g;\n textureArray[4*i+2]=pallet[i].b;\n textureArray[4*i+3]=255;\n }\n binaryColors = [\n [pallet[0].r/255.0, pallet[0].g/255.0, pallet[0].b/255.0, 1.0],\n [pallet[255].r/255.0, pallet[255].g/255.0, pallet[255].b/255.0, 1.0]];\n gl.activeTexture(gl.TEXTURE0);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 256,1, 0, gl.RGBA, gl.UNSIGNED_BYTE, textureArray);\n}", "generate({ width, height, uSpan, vSpan, isUVRepeat = false, flipTextureCoordinateY = false, material }) {\n var positions = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n positions.push((j / uSpan - 1 / 2) * width);\n positions.push(0);\n positions.push((i / vSpan - 1 / 2) * height);\n }\n }\n var indices = [];\n for (let i = 0; i < vSpan; i++) {\n let degenerate_left_index = 0;\n let degenerate_right_index = 0;\n for (let j = 0; j <= uSpan; j++) {\n indices.push(i * (uSpan + 1) + j);\n indices.push((i + 1) * (uSpan + 1) + j);\n if (j === 0) {\n degenerate_left_index = (i + 1) * (uSpan + 1) + j;\n }\n else if (j === uSpan) {\n degenerate_right_index = (i + 1) * (uSpan + 1) + j;\n }\n }\n indices.push(degenerate_right_index);\n indices.push(degenerate_left_index);\n }\n var normals = [];\n for (let i = 0; i <= vSpan; i++) {\n for (let j = 0; j <= uSpan; j++) {\n normals.push(0);\n normals.push(1);\n normals.push(0);\n }\n }\n var texcoords = [];\n for (let i = 0; i <= vSpan; i++) {\n const i_ = flipTextureCoordinateY ? i : vSpan - i;\n for (let j = 0; j <= uSpan; j++) {\n if (isUVRepeat) {\n texcoords.push(j);\n texcoords.push(i_);\n }\n else {\n texcoords.push(j / uSpan);\n texcoords.push(i_ / vSpan);\n }\n }\n }\n // Check Size\n const attributeCompositionTypes = [_definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec3, _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Vec2];\n const attributeSemantics = [_definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Position, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Normal, _definitions_VertexAttribute__WEBPACK_IMPORTED_MODULE_2__[\"VertexAttribute\"].Texcoord0];\n const primitiveMode = _definitions_PrimitiveMode__WEBPACK_IMPORTED_MODULE_3__[\"PrimitiveMode\"].TriangleStrip;\n const attributes = [new Float32Array(positions), new Float32Array(normals), new Float32Array(texcoords)];\n let sumOfAttributesByteSize = 0;\n attributes.forEach(attribute => {\n sumOfAttributesByteSize += attribute.byteLength;\n });\n const indexSizeInByte = indices.length * 2;\n // Create Buffer\n const buffer = _core_MemoryManager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getInstance().createBufferOnDemand(indexSizeInByte + sumOfAttributesByteSize, this);\n // Index Buffer\n const indicesBufferView = buffer.takeBufferView({ byteLengthToNeed: indexSizeInByte /*byte*/, byteStride: 0, isAoS: false });\n const indicesAccessor = indicesBufferView.takeAccessor({\n compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_1__[\"CompositionType\"].Scalar,\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].UnsignedShort,\n count: indices.length\n });\n for (let i = 0; i < indices.length; i++) {\n indicesAccessor.setScalar(i, indices[i], {});\n }\n // VertexBuffer\n const attributesBufferView = buffer.takeBufferView({ byteLengthToNeed: sumOfAttributesByteSize, byteStride: 0, isAoS: false });\n const attributeAccessors = [];\n const attributeComponentTypes = [];\n attributes.forEach((attribute, i) => {\n attributeComponentTypes[i] = _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]);\n const accessor = attributesBufferView.takeAccessor({\n compositionType: attributeCompositionTypes[i],\n componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_5__[\"ComponentType\"].fromTypedArray(attributes[i]),\n count: attribute.byteLength / attributeCompositionTypes[i].getNumberOfComponents() / attributeComponentTypes[i].getSizeInBytes()\n });\n accessor.copyFromTypedArray(attribute);\n attributeAccessors.push(accessor);\n });\n const attributeMap = new Map();\n for (let i = 0; i < attributeSemantics.length; i++) {\n attributeMap.set(attributeSemantics[i], attributeAccessors[i]);\n }\n this.setData(attributeMap, primitiveMode, material, indicesAccessor);\n }", "function initTextures(name, index) {\r\n textures[index] = gl.createTexture();\r\n textures[index].image = new Image();\r\n textures[index].image.onload = function () {\r\n handleTextureLoaded(textures[index])\r\n }\r\n textures[index].image.src = name;\r\n}", "createGlobe0 () {\n this.earthGlobe = new THREE.SphereGeometry(2, 32, 32);\n\n var textureLoader = new THREE.TextureLoader();\n var bumpLoader = new THREE.TextureLoader();\n var mat = new THREE.MeshPhongMaterial({color: '#ffffff', transparent: true, opacity: 0.75});\n textureLoader.load(\"images/8081-earthmap8k.jpg\", function (texture) {\n mat.map = texture;\n mat.needsUpdate = true;\n textureLoader.load(\"images/8081-earthbump8k.jpg\", function (bump) {\n mat.bumpMap = bump;\n mat.bumpScale = 0.05;\n\n window.plotObj.earthMesh = new THREE.Mesh(globe, mat);\n fThis.gfxScene.add(window.plotObj.earthMesh);\n this.ready = true;\n });\n });\n }", "makeModel () {\n const y = -0.3\n const segment = this.size / this.lod;\n for (let i = -this.lod / 2; i < this.lod / 2; i++) {\n for (let j = -this.lod / 2; j < this.lod / 2; j++) {\n this.mesh = this.mesh.concat([\n segment * i, y, segment * j,\n segment * (i + 1), y, segment * j,\n segment * i, y, segment * (j + 1),\n segment * (i + 1), y, segment * j,\n segment * i, y, segment * (j + 1),\n segment * (i + 1), y, segment * (j + 1),\n ]);\n }\n }\n\n for (let i = 0; i < this.lod * this.lod * 6; i++) {\n this.normals = this.normals.concat([ 0.0, 1.0, 0.0 ]);\n }\n\n for (let i = 0; i < this.lod * this.lod; i++) {\n this.textureCoordinates = this.normals.concat([\n 0.0, 1.0,\n 0.0, 0.0,\n 1.0, 1.0,\n 1.0, 0.0,\n 0.0, 0.0,\n 1.0, 1.0,\n ])\n }\n\t}", "function loadTexture() {\n var image = new Image();\n // create a texture object\n lennaTxt.textureObject0 = gl.createTexture();\n image.onload = function () {\n initTexture(image, lennaTxt.textureObject0);\n // make sure there is a redraw after the loading of the texture\n draw();\n };\n // setting the src will trigger onload\n image.src = \"lena512.png\";\n}", "function setSkybox(){\n var loader = new THREE.TextureLoader();\n\n var materialArray = [];\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_ft.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_bk.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_up.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_dn.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_rt.png') }));\n materialArray.push(new THREE.MeshLambertMaterial({ map: loader.load('img/sky_lf.png') }));\n\n for (var i = 0; i < 6; i++){\n materialArray[i].side = THREE.DoubleSide;\n }\n \n var sky_geometry = new THREE.BoxGeometry(1000, 1000, 1000);\n var skybox = new THREE.Mesh(sky_geometry, materialArray);\n scene.add(skybox);\n}", "constructor(max_subdivisions) {\n super(\"position\", \"normal\", \"texture_coord\");\n // Start from the following equilateral tetrahedron:\n const tetrahedron = [\n [0, 0, -1],\n [0, 0.9428, 0.3333],\n [-0.8165, -0.4714, 0.3333],\n [0.8165, -0.4714, 0.3333]\n ];\n this.arrays.position = Vec.cast(...tetrahedron);\n // Begin recursion:\n this.subdivide_triangle(0, 1, 2, max_subdivisions);\n this.subdivide_triangle(3, 2, 1, max_subdivisions);\n this.subdivide_triangle(1, 0, 3, max_subdivisions);\n this.subdivide_triangle(0, 2, 3, max_subdivisions);\n\n // With positions calculated, fill in normals and texture_coords of the finished Sphere:\n for (let p of this.arrays.position) {\n // Each point has a normal vector that simply goes to the point from the origin:\n this.arrays.normal.push(p.copy());\n\n // Textures are tricky. A Subdivision sphere has no straight seams to which image\n // edges in UV space can be mapped. The only way to avoid artifacts is to smoothly\n // wrap & unwrap the image in reverse - displaying the texture twice on the sphere.\n // this.arrays.texture_coord.push( Vec.of( Math.asin( p[0]/Math.PI ) + .5, Math.asin( p[1]/Math.PI ) + .5 ) );\n this.arrays.texture_coord.push(\n Vec.of(\n 0.5 - Math.atan2(p[2], p[0]) / (2 * Math.PI),\n 0.5 + Math.asin(p[1]) / Math.PI\n )\n );\n }\n\n // Fix the UV seam by duplicating vertices with offset UV:\n const tex = this.arrays.texture_coord;\n for (let i = 0; i < this.indices.length; i += 3) {\n const a = this.indices[i],\n b = this.indices[i + 1],\n c = this.indices[i + 2];\n if (\n [[a, b], [a, c], [b, c]].some(\n x => Math.abs(tex[x[0]][0] - tex[x[1]][0]) > 0.5\n ) &&\n [a, b, c].some(x => tex[x][0] < 0.5)\n ) {\n for (let q of [[a, i], [b, i + 1], [c, i + 2]]) {\n if (tex[q[0]][0] < 0.5) {\n this.indices[q[1]] = this.arrays.position.length;\n this.arrays.position.push(this.arrays.position[q[0]].copy());\n this.arrays.normal.push(this.arrays.normal[q[0]].copy());\n tex.push(tex[q[0]].plus(Vec.of(1, 0)));\n }\n }\n }\n }\n }", "addObjects() {\r\n this.geometry = new THREE.PlaneBufferGeometry(500, 500, 100, 100);\r\n\r\n const uTexture = this.textureLoader.load(texture);\r\n\r\n this.material = new THREE.ShaderMaterial({\r\n // wireframe: true,\r\n uniforms: {\r\n uTime: { value: 0 },\r\n uTexture: { value: uTexture },\r\n uProgress: { value: 0 },\r\n },\r\n vertexShader,\r\n fragmentShader,\r\n });\r\n\r\n this.mesh = new THREE.Mesh(this.geometry, this.material);\r\n\r\n this.scene.add(this.mesh);\r\n }", "render() {\n\n\t\t// Setting shader to the default shader\n\t\tuseShader(gl, texShaderProgram);\n\n\t\t// Get the location of attribute variable a_Position\n\t\ta_Position = gl.getAttribLocation(gl.program, 'a_Position');\n\t\tif (a_Position < 0) {\n\t\t\tconsole.log('Fail to get the storage location of a_Position');\n\t\t\treturn;\n\t\t}\n\n\t\tu_ModelMatrix = gl.getUniformLocation(gl.program, 'u_ModelMatrix');\n\t\tif (!u_ModelMatrix) { \n\t\t\tconsole.log('Failed to get the storage location of u_ModelMatrix');\n\t\t\treturn;\n\t\t}\n\n\t\ta_TexCoord = gl.getAttribLocation(gl.program, 'a_TexCoord');\n\t\tif(a_TexCoord < 0) {\n\t\t\tconsole.log('failed to get the storage location of a_TexCoord');\n\t\t}\n\n\t\tlet n = this.vertices.getLength() / 3;\n\n\t\tlet renderVertices = new Float32Array(this.vertices.getTexArray());\n\n\t\tsendUniformMat4ToGLSL(u_ModelMatrix, this.modelMatrix.elements);\n\n\n\n\t\tinitTextures(n, \"/external/textures/checkerboard.png\");\n\n\n\n\t\tlet renderTexCoordBuffer = gl.createBuffer();\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, renderTexCoordBuffer);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, renderVertices, gl.STATIC_DRAW);\n\n\t\tvar FSIZE = renderVertices.BYTES_PER_ELEMENT;\n\t\t\n\t\tgl.vertexAttribPointer(a_Position, 3, gl.FLOAT, false, FSIZE * 5, 0);\n\t\tgl.enableVertexAttribArray(a_Position); // Enable buffer allocation\n\t\t\n\t\t// Allocate the texture coordinates to a_TexCoord, and enable it.\n\t\tvar a_TexCoord = gl.getAttribLocation(gl.program, 'a_TexCoord');\n\t\t\n\t\tgl.vertexAttribPointer(a_TexCoord, 2, gl.FLOAT, false, FSIZE * 5, FSIZE * 3);\n\t\tgl.enableVertexAttribArray(a_TexCoord); // Enable buffer allocation\n\n\n\n\t\tgl.drawArrays(gl.TRIANGLES, 0, n);\n\n\t\tuseShader(gl, defaultShaderProgram);\n\n\t}", "function loadSnowFlakeImage()\n{\n var texture = new THREE.TextureLoader().load('../assets/images/snowflake/snowflake2.png');\n\tvar alphaTexture = new THREE.TextureLoader().load('../assets/images/snowflake/snowflake_alpha.png');\n var geometry = flipY( new THREE.PlaneBufferGeometry() );\n\tvar material = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide, map: texture, transparent: true, alphaMap: alphaTexture } );\n\t\n\tvar mesh = new THREE.Mesh( geometry, material );\n\n\tmesh.position.x = Math.random() * 50 - 25;\n\tmesh.position.y = Math.random() * 50 - 25;\n\tmesh.position.z = Math.random() * 200-200;\n\n\tsnowflakes.push(mesh);\n\tscene.add( mesh );\n\n}", "createBackground()\n {\n const texture = loadTexture('background')\n const bg = new THREE.Mesh(\n new THREE.SphereBufferGeometry(60, 60, 40),\n new THREE.MeshLambertMaterial({map: texture, side: THREE.DoubleSide})\n )\n this.threeObject.add(bg)\n }", "function texPrism_alpha_corner(vparas) {\n var ptile = vparas.tile || {};\n var layrs = ptile.layers || 3;\n var vtiles = ptile.change ? ' vtiles / float(cx + 1) ' : ' vtiles ';\n return { fragmentShader: `\n #define WEIGHT 3.4\n\n uniform vec4 u_hue,\n uniform sampler2D u_basetex;\n uniform sampler2D u_lateraltex;\n uniform float now;\n\n varying vec3 P;\n varying vec4 cent[${layrs}];\n varying float va;\n varying vec2 vsize;\n varying vec2 vtiles;\n ${glx.box2}\n ${glx.rayPlaneInsec}\n\n // filter p with base texture\n float baseTex(vec2 p, vec2 box, float r) {\n float d = box2(p, box, r);\n if (d <= 0.) {\n vec2 modxz = mod ( p, box * 0.5 / vtiles );\n return d * (texture2D ( u_basetex, modxz / box )).a;\n }\n else return 0.0;\n }\n\n float tessellate2( vec2 xz, vec2 c0, vec2 rectSize ) {\n vec2 d = xz - c0;\n vec2 modxz = mod ( d / rectSize, 2. );\n return modxz.x > 1. && modxz.y > 1. || modxz.x < 1. && modxz.y < 1. ?\n 1. : 1000.;\n }\n\n // rasterize functions\n // get xz plane box distance color\n float boxY(vec3 e, vec3 P, vec3 c0, vec2 size, vec2 tiles, float w) {\n vec4 p0d = rayPlaneInsec( e, normalize(P - e), c0, vec3(0., 1., 0.) );\n if (p0d.w > 0.) {\n float tes = tessellate2( p0d.xz, c0.xz, size * 0.5 / tiles );\n float d = baseTex( p0d.xz, size * 0.5, 5. );\n d = 1.0/d * w * (1. - va);\n tes = 0.4/tes * (1. - va) * ( 1. - abs( sin(now * 0.001) ) );\n return abs(d) * tes + abs(d) * 0.02;\n }\n else return 0.;\n }\n\n vec4 mainImage( in vec2 fragCoord ) {\n float col = boxY(cameraPosition, P, cent[0].xyz, vec2(280., 92.), vec2(6., 3.), WEIGHT);\n // return vec4(0., col * 0.2, 0.8, col);\n return u_hue * col;\n }\n\n void main() {\n gl_FragColor += mainImage(gl_FragCoord.xy);\n gl_FragColor.a += va;\n }`,\n\n vertexShader: `\n uniform vec3 wpos;\n\n attribute vec3 a_box;\n attribute vec2 a_tiles;\n attribute vec3 a_prevert;\n\n varying vec3 P;\n varying vec4 cent[${layrs}];\n varying float va;\n varying vec2 boxsize;\n varying vec2 vtiles;\n\n ${glx.buildingAlpha}\n\n void main() {\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n P = worldPosition.xyz;\n vec4 _p = modelMatrix * vec4(a_prevert, 1.0);\n vec3 n = cross(P - _p.xyz, normal);\n va = buildingAlpha(cameraPosition, P, normal);\n vtiles = a_tiles + vec2(3, 1.5);\n\n for (int i = 0; i < ${layrs}; i++){\n // cent[i] = modelMatrix * vec4(wpos + offsets[i], 1.);\n // cent[i] = modelMatrix * vec4(0.);\n float h = a_box.y / float(${layrs});\n if (h == 0.) h = 10.;\n cent[i] = modelMatrix * vec4(0., h * float(i) - a_box.y * 0.5, 0., 1.);\n }\n\n gl_Position = projectionMatrix * viewMatrix * worldPosition;\n } `\n }\n}", "function makeTexture( imageURL, material )\r\n{\r\n function callback()\r\n {\r\n if (material) {\r\n material.map = texture;\r\n material.needsUpdate = true;\r\n }\r\n // not necessary to call render() since the scene is continually updating.\r\n }\r\n let loader = new THREE.TextureLoader();\r\n let texture = loader.load(imageURL, callback);\r\n texture.wrapS = THREE.RepeatWrapping;\r\n texture.wrapT = THREE.RepeatWrapping;\r\n texture.repeat = new THREE.Vector2(10,10);\r\n texture.anisotropy = renderer.getMaxAnisotropy();\r\n return texture;\r\n}", "function Material(structure) {\n\n /**\n * Material name\n */\n this.name = structure[\"name\"];\n\n /**\n * Incates whether use blending or not on this material\n */\n this.blending = false;\n\n /**\n * Texture array\n */\n this.textures = [];\n\n /**\n * Loading textures from JSON file and server one by one\n */\n for (texture in structure[\"textures\"]) {\n\n // Texture buffer\n this.textures[texture] = gl.createTexture();\n\n // Texture image\n this.textures[texture].image = new Image();\n \n // Context preservation\n var that = this;\n var temp = texture;\n\n this.textures[texture].image.onload = function() {\n\n /**\n * There is different coordination system in WebGL, so every\n * texture has to be fliiped aroud Y axis.\n * Point [0, 0] is top left corner of texture.\n */\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n // You have to bind texture before working with it\n gl.bindTexture(gl.TEXTURE_2D, that.textures[temp]); \n\n // Loading texture into GPU\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, that.textures[temp].image);\n\n // Magnify filtering - how texture acts when being upscaled\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\n // How texture acts when being downscaled\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\n // Mipmap generation - diffent textures for different camera distance\n gl.generateMipmap(gl.TEXTURE_2D);\n\n // Unbind\n gl.bindTexture(gl.TEXTURE_2D, null);\n }\n\n // Asynchronous image load\n this.textures[texture].image.src = \"./textures/\" + structure[\"textures\"][texture];\n //textureCount++;\n \n console.log(\"Texture = \" + this.textures[texture].image.src + \"\\n\");\n }\n}", "loadPlanetSprites() {\n for (let planet of scenes.sim.planets) {\n let sprite = new PIXI.Sprite.fromImage(planet.map_image);\n sprite.width = planet.radius / DEFAULT_MAP_ZOOM;\n sprite.height = planet.radius / DEFAULT_MAP_ZOOM;\n sprite.anchor.set(0.5, 0.5);\n\n planet.map_sprite = sprite;\n this.stage.addChild(sprite);\n }\n }", "function preload() {\n \n // Load font\n spaceFont = loadFont('spaceAge.otf');\n \n // Load planets' textures\n sunTexture = loadImage('surfaceImages/sunSurface.jpg');\n planetTextures[0] = loadImage('surfaceImages/mercurySurface.png');\n planetTextures[1] = loadImage('surfaceImages/venusSurface.jpg');\n planetTextures[2] = loadImage('surfaceImages/earthSurface.jpg');\n planetTextures[3] = loadImage('surfaceImages/marsSurface.png');\n planetTextures[4] = loadImage('surfaceImages/jupiterSurface.jpg');\n planetTextures[5] = loadImage('surfaceImages/saturnSurface.jpg');\n planetTextures[6] = loadImage('surfaceImages/uranusSurface.jpg');\n planetTextures[7] = loadImage('surfaceImages/neptuneSurface.jpg');\n}", "function drawTeapot()\r\n{\r\n\r\n gl.polygonOffset(0,0);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexPositionBuffer);\r\n\r\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);\r\n\r\n // Bind normal buffer\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexNormalBuffer);\r\n\r\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, 3, gl.FLOAT, false, 0, 0);\r\n\r\n\r\n\r\n var s = vec3.create();\r\n vec3.set(s, 0.05,0.05, 0.05);\r\n mat4.scale(mvMatrix, mvMatrix, s);\r\n\r\n if(document.getElementById(\"normal_mapping\").checked)\r\n {\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.uniform1i(gl.getUniformLocation(shaderProgram, \"texMap\"), 0);\r\n\r\n }\r\n\r\n setMatrixUniforms();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, teapotFaceBuffer);\r\n\r\n gl.drawElements(gl.TRIANGLES, 6768 , gl.UNSIGNED_SHORT,0);\r\n\r\n}", "_setTextureParameters() {\n let gl = this._gl;\n\n // eslint-disable-next-line\n // the line below is already done when creating a Texture2D with content loader\n // eslint-disable-next-line\n // gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, gl.LUMINANCE, gl.UNSIGNED_BYTE, this._texture.getImageData());\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n }", "constructor(using_flat_shading) {\n super(\"position\", \"normal\", \"texture_coord\");\n var a = 1 / Math.sqrt(3);\n if (!using_flat_shading) {\n // Method 1: A tetrahedron with shared vertices. Compact, performs better,\n // but can't produce flat shading or discontinuous seams in textures.\n this.arrays.position = Vec.cast(\n [0, 0, 0],\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 1]\n );\n this.arrays.normal = Vec.cast(\n [-a, -a, -a],\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 1]\n );\n this.arrays.texture_coord = Vec.cast([0, 0], [1, 0], [0, 1], [1, 1]);\n // Notice the repeats in the index list. Vertices are shared\n // and appear in multiple triangles with this method.\n this.indices.push(0, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 3);\n } else {\n // Method 2: A tetrahedron with four independent triangles.\n this.arrays.position = Vec.cast(\n [0, 0, 0],\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 0],\n [1, 0, 0],\n [0, 0, 1],\n [0, 0, 0],\n [0, 1, 0],\n [0, 0, 1],\n [0, 0, 1],\n [1, 0, 0],\n [0, 1, 0]\n );\n\n // The essence of flat shading: This time, values of normal vectors can\n // be constant per whole triangle. Repeat them for all three vertices.\n this.arrays.normal = Vec.cast(\n [0, 0, -1],\n [0, 0, -1],\n [0, 0, -1],\n [0, -1, 0],\n [0, -1, 0],\n [0, -1, 0],\n [-1, 0, 0],\n [-1, 0, 0],\n [-1, 0, 0],\n [a, a, a],\n [a, a, a],\n [a, a, a]\n );\n\n // Each face in Method 2 also gets its own set of texture coords (half the\n // image is mapped onto each face). We couldn't do this with shared\n // vertices since this features abrupt transitions when approaching the\n // same point from different directions.\n this.arrays.texture_coord = Vec.cast(\n [0, 0],\n [1, 0],\n [1, 1],\n [0, 0],\n [1, 0],\n [1, 1],\n [0, 0],\n [1, 0],\n [1, 1],\n [0, 0],\n [1, 0],\n [1, 1]\n );\n // Notice all vertices are unique this time.\n this.indices.push(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);\n }\n }", "function createTextureTriangles(points)\n{\n\tvar texture = [];\n\tfor (var i = 0; i < points.length; i+=3)\n\t\ttexture.push( (points[i] + 1) / 2, \n\t\t\t\t\t (points[i+2] + 1) / 2)\n\treturn texture;\n}", "function generatePlanets(sunRadius) {\n const randomNumber = (max, min = 1) => Math.floor(Math.random() * (max - min)) + min\n const randomColor = () => colors[Math.floor(Math.random() * colors.length)]\n\n const { min: minRadius, max: maxRadius } = planetaryData.reduce((acc, curr) => {\n if (curr.radius > acc.max) acc.max = curr.radius\n if (curr.radius < acc.min) acc.min = curr.radius\n return acc\n }, { min: planetaryData[0].radius, max: 0 })\n\n let prevColor\n\n for (let i = 0; i < planetaryData.length; i++) {\n const color = randomColor()\n if (color === prevColor) {\n i = i - 1\n //Avoid same neighbor color\n continue\n }\n prevColor = color\n\n const mat = new THREE.MeshStandardMaterial({ color: color, emissive: color })\n const ringMat = new THREE.MeshStandardMaterial({ color: color, side: THREE.DoubleSide })\n\n const { name, orbit, radius, tilt, distance, rotationSpeed, hasRing } = planetaryData[i]\n const newDistance = distance + (sunRadius * 2)\n\n const r = range([minRadius, maxRadius], [0.08, 0.3], radius)\n const geo = generateSphere(r)\n const planet = new THREE.Mesh(geo, mat)\n enableWireframe(geo, planet, true)\n planet.position.set(-newDistance, 0, 0)\n planet.rotationValue = rotationSpeed / 1000\n planet.rotation.x = degToRad(tilt)\n\n const path = new THREE.Mesh(generateTorus(newDistance), ringMat)\n path.rotation.x = degToRad(randomNumber(-95, -85))\n path.castShadow = true\n\n //TODO: Add rings of Saturn\n if (hasRing) {\n const ringGeo = new THREE.RingBufferGeometry(r * 1.2, r * 1.8, 16)\n const ring = new THREE.Mesh(ringGeo, ringMat)\n ring.rotation.x = degToRad(90)\n enableWireframe(ringGeo, ring, true)\n planet.add(ring)\n }\n\n const pivot = new THREE.Group();\n const orbitValue = (sunRotation * 2) / (i + 1)\n pivot.position.set(0, 0.0, 0);\n pivot.rotation.y = degToRad(randomNumber(320)) //randomized planet's position on the path\n pivot.orbitValue = orbitValue * 1.5\n\n pivot.add(path, planet)\n scene.add(pivot);\n pivots.push(pivot)\n }\n}", "function loadTexture () {\n \n var image = new Image();\n // Create a texture object \n lennaTxt.textureObj = gl.createTexture(); \n image.onload = function() {\n\n initTexture(image, lennaTxt.textureObj);\n\n // Make sure there is a redraw after the loading of the texture\n draw(); \n\n };\n\n // setting the src will trigger onload\n image.src = \"lena512.png\";\n\n}", "_initTextures() {}", "function computeTexture(u, v) {\n\t//if texture map is loaded then use it else return as it is.\n\tif (!textureData) {//and texturing is to be done.\n\t\tconsole.log(\"ALERT: CODE TO BE MODIFIED:Performing Procedural Texture\")\n\t\treturn;// {Color:{r:0,g:0,b:0}};// proceduralTexture(u, v);\n\t}\n\t//1. warp u,v of vertices \t\t\t/\n\t//2. interpolate u,v,z of pixel \t/\n\t//3. unwarp u,v of pixel using new z \t/\n\t//4. scale u,v \t\t\t\t\t\t/\n\t//5. identify color \t\t\t\t/\n\t//6. use the color for shading \t\t\n\n\t//texture lookup\n\t//scale u,v to texture image size (Xsize, Ysize);\n\t//interpolating u,v part 1 i.e. scaling\n\t//interpolate u,v,z\n\t//unwarp using new interpolated vz\n\t//using unwarp u,v width,height\n\n\t//color = ka, kd\n\n\tvar U = u * (textureData.width - 1);\n\tvar V = v * (textureData.height - 1);\n\tvar s = U % 1;\n\tvar t = V % 1;\n\tvar Color = {};\n\tvar a = U - U % 1;\n\tvar b = V - V % 1;\n\tvar j = (U !== U % 1) ? eval(U - U % 1 + 1) : U < 1 ? 1 : U;\n\tvar i = (V !== V % 1) ? eval(V - V % 1 + 1) : V < 1 ? 1 : V;\n\t//var width = eval(U-U%1);\n\t/*\n\t\t0.123\n\t\t0.998\n\t\t1.001\n\t\t1.999\n\t\t97.999\n\t*/\n\ti = i >= textureData.height ? eval(textureData.height) : i;\n\tj = j >= textureData.width ? eval(textureData.width) : j;\n\t//switching height and width\n\t// height = height+width;\n\t// width = height-width;\n\t// height = height-width;\n\t//interpolating part 2 i.e. interpolating colors\n\t//Testing code in false... should not be required.\n\tif (false) {\n\t\tconsole.log(\"a:\" + a + \" b:\" + b);\n\t\tif (a >= textureData.height - 1) a = textureData.height - 2;\n\t\tif (b >= textureData.width - 1) b = textureData.width - 2;\n\t\tvar cond2 = b < textureData.width - 1;\n\t\tvar cond1 = a < textureData.height - 1;\n\t\tvar cond3 = (b < textureData.width - 1 || a < textureData.height - 1);\n\t\tColor.r = (cond3 ? s * t * textureData.matrix[a + 1][b + 1].r : 0) + (cond1 ? (1 - s) * t * textureData.matrix[a + 1][b].r : 0) + (cond2 ? s * (1 - t) * textureData.matrix[a][b + 1].r : 0) + (true ? (1 - s) * (1 - t) * textureData.matrix[a][b].r : 0);\n\t\tColor.g = (cond3 ? s * t * textureData.matrix[a + 1][b + 1].g : 0) + (cond1 ? (1 - s) * t * textureData.matrix[a + 1][b].g : 0) + (cond2 ? s * (1 - t) * textureData.matrix[a][b + 1].g : 0) + (true ? (1 - s) * (1 - t) * textureData.matrix[a][b].g : 0);\n\t\tColor.b = (cond3 ? s * t * textureData.matrix[a + 1][b + 1].b : 0) + (cond1 ? (1 - s) * t * textureData.matrix[a + 1][b].b : 0) + (cond2 ? s * (1 - t) * textureData.matrix[a][b + 1].b : 0) + (true ? (1 - s) * (1 - t) * textureData.matrix[a][b].b : 0);\n\t}\n\telse {\n\t\tColor.r = s * t * textureData.matrix[i][j].r + (i > 0 ? (1 - s) * t * textureData.matrix[i][j - 1].r : 0) + (j > 0 ? s * (1 - t) * textureData.matrix[i - 1][j].r : 0) + (i > 0 && j > 0 ? (1 - s) * (1 - t) * textureData.matrix[i - 1][j - 1].r : 0);\n\t\tColor.g = s * t * textureData.matrix[i][j].g + (i > 0 ? (1 - s) * t * textureData.matrix[i][j - 1].g : 0) + (j > 0 ? s * (1 - t) * textureData.matrix[i - 1][j].g : 0) + (i > 0 && j > 0 ? (1 - s) * (1 - t) * textureData.matrix[i - 1][j - 1].g : 0);\n\t\tColor.b = s * t * textureData.matrix[i][j].b + (i > 0 ? (1 - s) * t * textureData.matrix[i][j - 1].b : 0) + (j > 0 ? s * (1 - t) * textureData.matrix[i - 1][j].b : 0) + (i > 0 && j > 0 ? (1 - s) * (1 - t) * textureData.matrix[i - 1][j - 1].b : 0);\n\t\tif (Color.r == NaN || Color.g == NaN || Color.b == NaN)\n\t\t\tconsole.log(\"AssertionFailed ERROR!!! s:\" + s + \" t:\" + t + \"U:\" + U + \" V:\" + V + \" i:\" + i + \" j:\" + j + \" r:\" + Color.r + \" g:\" + Color.g + \" b:\" + Color.b);\n\t}\n\treturn { Color: Color };\n\t//interpolate image pixel colors to texture coord\n\t//interpolate color at scaled u,v location (flat coords) in texture image.\n\t//reconstruct texture image color at sample point\n}", "function createEntity(entity) {\n //Adds an entity to the grid\n var cubeGeo, cubeMaterial;\n var blockSize = 50;\n var voxelPosition = new THREE.Vector3();\n cubeGeo = new THREE.BoxGeometry( blockSize * entity.size.x, \n \t\t\tblockSize * entity.size.y, \n \t\t\tblockSize * entity.size.z );\n cubeMaterial = new THREE.MeshLambertMaterial( { color: 0xfeb74c, ambient: 0xfeb74c } );\n // Lookout Colors \n //cubeMaterial = new THREE.MeshLambertMaterial( { color: 0x66E066, ambient: 0x00ff80 } );\n cubeMaterial.ambient = cubeMaterial.color;\n cubeMaterial.transparent = true;\n cubeMaterial.opacity = entity.opacity || 1;\n\n var voxel = new THREE.Mesh( cubeGeo, cubeMaterial );\n voxel.position.x = entity.position.x * 50 + (blockSize * entity.size.x)/2;\n voxel.position.y = entity.position.y + (blockSize * entity.size.y)/2;\n voxel.position.z = entity.position.z * 50 + (blockSize * entity.size.z)/2;\n voxel.matrixAutoUpdate = false;\n voxel.updateMatrix();\n var labelMesh = new THREE.Mesh(new THREE.TextGeometry(entity.label,\n\t\t\t\t\t\t\t{size: 12,\n\t\t\t\t\t\t\t height: 4,\n\t\t\t\t\t\t\t curveSegments: 0\n\t\t\t\t\t\t\t}), new THREE.MeshNormalMaterial());\n labelMesh.lookAt(camera.position);\n labelMesh.position.x = voxel.position.x;\n labelMesh.position.y = entity.size.y * blockSize + 50;//voxel.position.y + 50;\n labelMesh.position.z = voxel.position.z;\n\t\n return [voxel, labelMesh];\n}", "constructor() // etc) smaller and more cache friendly.\n { super( \"positions\", \"normals\", \"texture_coords\" );\n var size = 0.8; // Name the values we'll define per each vertex.\n this.positions .push( ...Vec.cast( [-size,-size,0], [size,-size,0], [-size,size,0], [size,size,0] ) ); // Specify the 4 square corner locations.\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\n this.texture_coords.push( ...Vec.cast( [0,0], [1,0], [0,1], [1,1] ) ); // Draw a square in texture coordinates too.\n this.indices .push( 0, 1, 2, 1, 2, 3 ); // Two triangles this time, indexing into four distinct vertices.\n }", "function create ()\r\n\t{\r\n\t//lägger in tilemap\r\n\tvar map = this.make.tilemap({ key: 'map' });\r\n\t\r\n\t//lägger till ett tileset\r\n\tvar tileset = map.addTilesetImage('Materials');\r\n\t\r\n\t//gör mappen grafisk och interaktable men detta funkar inte för tillfället\r\n\t//var layer = map.createStaticLayer(0, ground, 0, 0);\r\n\t\r\n\t\r\n\t// skapar himlen\r\n\tthis.add.image(400,300, 'sky');\r\n\tthis.add.image(1200,300, 'sky');\r\n\tthis.add.image(2000,300, 'sky');\r\n\tthis.add.image(2800,300, 'sky');\r\n\tthis.add.image(3600,300, 'sky');\r\n\t\r\n\tvar music = this.sound.add('music1');\r\n\tmusic.play();\r\n\t\r\n\t//gör en statisk grupp med fysik till \"platforms\"\r\n\tplatforms = this.physics.add.staticGroup();\r\n\t\r\n\t//Skapar en stor platform som är spelets mark\r\n\tplatforms.create(400, 550, 'ground');\r\n\tplatforms.create(1200, 550, 'ground');\r\n\tplatforms.create(2000, 550, 'ground');\r\n\tplatforms.create(2800, 550, 'ground');\r\n\tplatforms.create(3600, 550, 'ground');\r\n\t\r\n\t//Skapar två platformar\r\n\tplatforms.create(100, 400, 'platform');\r\n\tplatforms.create(500, 300, 'platform');\r\n\r\n\t//skapar en statisk grupp med fysik till \"grassBox\"\r\n\tgrassBox = this.physics.add.staticGroup();\r\n\r\n\tgrassBox.create(1000, 488,'grassBox');\r\n\tgrassBox.create(1224, 488, 'grassBox');\r\n\r\n\t//skapar en statisk grupp med fysik till \"spikes\"\r\n\tspikes = this.physics.add.staticGroup();\r\n\r\n\t//första \"spike rown\" i spelet\r\n\tspikes.create(1032, 484, 'spikes');\r\n\tspikes.create(1064, 484, 'spikes');\r\n\tspikes.create(1096, 484, 'spikes');\r\n\tspikes.create(1128, 484, 'spikes');\r\n\tspikes.create(1160, 484, 'spikes');\r\n\tspikes.create(1192, 484, 'spikes');\r\n\r\n\t//första \"Spike rown\" i spelet efter andra lådan\r\n\tspikes.create(1254, 484, 'spikes');\r\n\tspikes.create(1286, 484, 'spikes');\r\n\tspikes.create(1318, 484, 'spikes');\r\n\tspikes.create(1350, 484, 'spikes');\r\n\tspikes.create(1382, 484, 'spikes');\r\n\tspikes.create(1414, 484, 'spikes');\r\n\t\r\n\t//flag.create(1032, 484, 'flag');\r\n\r\n\t//lägger in texten som säger hur många poäng jag har\r\n\tpointText = this.add.text(2, 2, 'points: ' + points, {fontSize: '32px', fill: '#000'});\r\n\t\r\n\t//Lägger till en ny grup som heter \"coins\" den ska ha fysik men vara \"Static\"\r\n\tcoins = this.physics.add.staticGroup();\r\n\tcoins.create(400, 450, 'coin');\r\n\tcoins.create(1110, 390, 'coin');\r\n\tcoins.create(700, 450, 'coin');\r\n\t\r\n\t//skapar spelaren och lägger till fysik \r\n\tplayer = this.physics.add.sprite(100, 350, 'player');\r\n\tplayer.body.setSize(10, 32, 50, 25);\r\n\t\r\n\t//gör så att spelaren kommer studsa på emot andra pysiska grupper\r\n player.setBounce(0.2);\r\n\t\r\n //blockar spelaren från att gå \"out of bounds\"\r\n\tplayer.setCollideWorldBounds(true);\r\n\tplayer.smoothed = false;\r\n\t\r\n\t//lägger till \"Slime\"\r\n\tslime = this.physics.add.sprite(470,265, 'slime');\r\n\t\r\n\t\r\n\t\r\n\t//gör så att spelaren koliderar med platformarna med andra ord spelaren kan inte trilla igenom dom \r\n\t//och likt spelaren så är det andra grupper som samma sak händer med nedanför\r\n\tthis.physics.add.overlap(player, slime, death, null, this);\r\n\tthis.physics.add.overlap(player, coins, collectCoins, null, this);\r\n\tthis.physics.add.overlap(player, spikes, death, null, this);\r\n\r\n\tthis.physics.add.collider(player, platforms);\r\n\tthis.physics.add.collider(coins, platforms);\r\n\tthis.physics.add.collider(slime, platforms);\r\n\tthis.physics.add.collider(player, slime);\r\n\tthis.physics.add.collider(player, spikes);\r\n\tthis.physics.add.collider(player, grassBox);\r\n\t\r\n\t //skapar en animation \"left\"\r\n this.anims.create({\r\n key: 'left',\r\n frames: this.anims.generateFrameNumbers('player', { start: 0, end: 5 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n\t//skapar en animation \"idle\"\r\n this.anims.create({\r\n key: 'idle',\r\n frames: [ { key: 'player', frame: 6 } ],\r\n frameRate: 20\r\n });\r\n\t\r\n\t//skapar en animation \"right\"\r\n this.anims.create({\r\n key: 'right',\r\n frames: this.anims.generateFrameNumbers('player', { start: 7, end: 12 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\t\r\n\tthis.anims.create({\r\n key: 'slimeAni',\r\n frames: this.anims.generateFrameNumbers('slime', { start: 0, end: 4 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\t\r\n\t//lägger till tangentbords nyklar\r\n\tcursors = this.input.keyboard.createCursorKeys();\r\n\t\r\n\t//Olika kamera inställningar\r\n\tthis.cameras.main.setSize(800, 600);\r\n\tthis.cameras.main.setBounds(0, 0, 4000, 600);\r\n this.physics.world.setBounds(0, 0, 4000, 600);\r\n\tthis.cameras.main.startFollow(player);\r\n\tthis.cameras.main.setZoom(1.2);\r\n\tthis.cameras.main.roundPixels = false;\r\n\t//här lägger jag till en extra kamera för att kunna se mina poäng\r\n\tthis.cameras.add(0, 0, 210, 35);\r\n\t\r\n\tvar combo = this.input.keyboard.createCombo('krm', {resetOnMatch: true});\r\n\t\r\n\t//detta är en fusk kod\r\n\tthis.input.keyboard.on('keycombomatch', function (event) \r\n\t{\r\n\t\r\n\tpoints += 50;\r\n\t\r\n\tpointText.setText('points: ' + points);\r\n\t\r\n\tconsole.log('I see you found a cheat code');\r\n\t\r\n\t});\r\n\t\r\n\t//bara ett medelande till konsolen så jag enklare kan se vart det gick fel\r\n\tconsole.log(\"function create loaded fine\");\r\n}", "function SkyBox() {\n const materialArray = [];\n const texture_ft = new THREE.TextureLoader().load('./assets/skybox/arid2_ft.jpg');\n const texture_bk = new THREE.TextureLoader().load('./assets/skybox/arid2_bk.jpg');\n const texture_up = new THREE.TextureLoader().load('./assets/skybox/arid2_up.jpg');\n const texture_dn = new THREE.TextureLoader().load('./assets/skybox/arid2_dn.jpg');\n const texture_rt = new THREE.TextureLoader().load('./assets/skybox/arid2_rt.jpg');\n const texture_lf = new THREE.TextureLoader().load('./assets/skybox/arid2_lf.jpg');\n \n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_ft }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_bk }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_up }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_dn }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_rt }));\n materialArray.push(new THREE.MeshBasicMaterial( { map: texture_lf }));\n\n for (let i = 0; i < 6; i++)\n materialArray[i].side = THREE.BackSide;\n\n const skyboxGeo = new THREE.BoxGeometry(2400, 2400, 2400);\n const skybox = new THREE.Mesh(skyboxGeo, materialArray);\n\n return skybox;\n}", "function Main() {\n\n MyGL.AssetsManager.getInstance().addGroup([\n //new MyGL.AssetData('standard_mat_bp_vshader', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/vert.glsl'),\n //new MyGL.AssetData('standard_mat_bp_fshader', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/frag.glsl'),\n //new MyGL.AssetData('standard_mat_bp_vshader_nt', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/vert_no_texture.glsl'),\n //new MyGL.AssetData('standard_mat_bp_fshader_nt', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/frag_no_texture.glsl'),\n new MyGL.AssetData('img_earth', MyGL.AssetData.IMAGE, './resource/earth.bmp'),\n new MyGL.AssetData('img_earth01', MyGL.AssetData.IMAGE, './resource/earth01.jpg'),\n new MyGL.AssetData('img_crate', MyGL.AssetData.IMAGE, './resource/crate.gif'),\n\n //new MyGL.AssetData('cube_mat_vshader', MyGL.AssetData.TEXT, './src/shaders/cube_material/base/vert.glsl'),\n //new MyGL.AssetData('cube_mat_fshader', MyGL.AssetData.TEXT, './src/shaders/cube_material/base/frag.glsl'),\n /*new AssetData('sky_n_x', AssetData.IMAGE, './resource/sky_n_x.jpg'),\n new AssetData('sky_n_y', AssetData.IMAGE, './resource/sky_n_y.jpg'),\n new AssetData('sky_n_z', AssetData.IMAGE, './resource/sky_n_z.jpg'),\n new AssetData('sky_p_x', AssetData.IMAGE, './resource/sky_p_x.jpg'),\n new AssetData('sky_p_y', AssetData.IMAGE, './resource/sky_p_y.jpg'),\n new AssetData('sky_p_z', AssetData.IMAGE, './resource/sky_p_z.jpg'),*/\n\n new MyGL.AssetData('cloudy_noon_nx', MyGL.AssetData.IMAGE, './resource/cloudy_noon_nx.jpg'),\n new MyGL.AssetData('cloudy_noon_ny', MyGL.AssetData.IMAGE, './resource/cloudy_noon_ny.jpg'),\n new MyGL.AssetData('cloudy_noon_nz', MyGL.AssetData.IMAGE, './resource/cloudy_noon_nz.jpg'),\n new MyGL.AssetData('cloudy_noon_px', MyGL.AssetData.IMAGE, './resource/cloudy_noon_px.jpg'),\n new MyGL.AssetData('cloudy_noon_py', MyGL.AssetData.IMAGE, './resource/cloudy_noon_py.jpg'),\n new MyGL.AssetData('cloudy_noon_pz', MyGL.AssetData.IMAGE, './resource/cloudy_noon_pz.jpg'),\n\n new MyGL.AssetData('land', MyGL.AssetData.IMAGE, './resource/land.png'),\n new MyGL.AssetData('grass', MyGL.AssetData.IMAGE, './resource/grass.png'),\n\n new MyGL.AssetData('drone', MyGL.AssetData.TEXT, './resource/drone.obj')\n //new AssetData('drone_diffuse', AssetData.IMAGE, './resource/drone_diffuse_01.png')\n ]);\n MyGL.AssetsManager.getInstance().addEventListener(MyGL.AssetsManager.GROUP_LOAD_COMPLETE, this.loadComplete, this);\n MyGL.AssetsManager.getInstance().load();\n}", "function MakeSkybox() {\n let skyboxRadius = 3000;\n let skyboxTexture = new THREE.TextureLoader().load(\"textures/skybox.jpg\");\n let material = new THREE.MeshBasicMaterial( {\n map: skyboxTexture\n } );\n material.side = THREE.BackSide;\n let skyboxMesh = new THREE.Mesh(sphereGeometry, material);\n skyboxMesh.scale.set(skyboxRadius, skyboxRadius, skyboxRadius);\n return skyboxMesh;\n}", "initTextureBuffer(image) {\r\n let uvCoords = [];\r\n {\r\n // 1\r\n let tl1 = [0, 0.4];\r\n let bl1 = [0, 0];\r\n let tr1 = [0.5, 0.4];\r\n let br1 = [0.5, 0];\r\n uvCoords = uvCoords.concat(tl1, bl1, br1, tl1, br1, tr1);\r\n\r\n // 2\r\n let tl2 = [0, 0.8];\r\n let bl2 = [0, 0.5];\r\n let tr2 = [0.25, 0.8];\r\n let br2 = [0.25, 0.5];\r\n uvCoords = uvCoords.concat(tl2, bl2, br2, tl2, br2, tr2);\r\n\r\n // 3\r\n let tl3 = [0.25, 0.5];\r\n let bl3 = [0.25, 0.4];\r\n let tr3 = [0.5, 0.5];\r\n let br3 = [0.5, 0.4];\r\n uvCoords = uvCoords.concat(tl3, bl3, br3, tl3, br3, tr3);\r\n\r\n // 4\r\n let tl4 = [0.25, 0.75];\r\n let bl4 = [0.25, 0.5];\r\n let tr4 = [0.375, 0.75];\r\n let br4 = [0.375, 0.5];\r\n uvCoords = uvCoords.concat(tl4, bl4, br4, tl4, br4, tr4);\r\n\r\n // 5\r\n let bl5 = [0.375, 0.5];\r\n let t5 = [0.375, 0.75];\r\n let br5 = [0.5, 0.5];\r\n uvCoords = uvCoords.concat(bl5, t5, br5);\r\n\r\n // 6\r\n let tl6 = [0, 1];\r\n let bl6 = [0, 0.9];\r\n let tr6 = [0.15, 1];\r\n let br6 = [0.15, 0.9];\r\n uvCoords = uvCoords.concat(tl6, bl6, br6, tl6, br6, tr6);\r\n\r\n // 7\r\n let tl7 = [0.15, 1];\r\n let bl7 = [0.15, 0.9];\r\n let tr7 = [0.25, 1];\r\n let br7 = [0.25, 0.9];\r\n uvCoords = uvCoords.concat(tl7, bl7, br7, tl7, br7, tr7);\r\n\r\n // Roof\r\n let tlRoof = [0.15, 0.9];\r\n let blRoof = [0.15, 0.8];\r\n let trRoof = [0.2, 0.9];\r\n let brRoof = [0.2, 0.8];\r\n uvCoords = uvCoords.concat(tlRoof, blRoof, brRoof, tlRoof, brRoof, trRoof);\r\n\r\n // BackWindows\r\n let tl10 = [0.5, 1];\r\n let bl10 = [0.5, 0.9];\r\n let tr10 = [0.65, 1];\r\n let br10 = [0.65, 0.9];\r\n uvCoords = uvCoords.concat(tl10, bl10, br10, tl10, br10, tr10);\r\n\r\n // LeftWindow\r\n uvCoords = uvCoords.concat(tl3, bl3, br3, tl3, br3, tr3);\r\n uvCoords = uvCoords.concat(tl4, bl4, br4, tl4, br4, tr4);\r\n uvCoords = uvCoords.concat(bl5, t5, br5);\r\n\r\n // 8\r\n let tl8 = [0.25, 1];\r\n let bl8 = [0.25, 0.8];\r\n let tr8 = [0.5, 1];\r\n let br8 = [0.5, 0.8];\r\n uvCoords = uvCoords.concat(tl8, bl8, br8, tl8, br8, tr8);\r\n\r\n // 9\r\n let tl9 = [0.5, 0.8];\r\n let bl9 = [0.5, 0.5];\r\n let tr9 = [0.75, 0.8];\r\n let br9 = [0.75, 0.5];\r\n uvCoords = uvCoords.concat(tl9, bl9, br9, tl9, br9, tr9);\r\n\r\n // 1_leftSide\r\n uvCoords = uvCoords.concat(tl1, bl1, br1, tl1, br1, tr1);\r\n\r\n // Bottom\r\n let tl11 = [0.5, 0.4];\r\n let bl11 = [0.5, 0];\r\n let tr11 = [1, 0.4];\r\n let br11 = [1, 0];\r\n uvCoords = uvCoords.concat(tl11, bl11, br11, tl11, br11, tr11);\r\n }\r\n\r\n let uvs = new Float32Array(uvCoords);\r\n\r\n this.carTexture = this.gl.createTexture();\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, this.carTexture);\r\n\r\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, true);\r\n this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\r\n\r\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, image);\r\n\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.NEAREST);\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.NEAREST);\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, null);\r\n\r\n this.carTextureBuffer = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.carTextureBuffer);\r\n this.gl.bufferData(this.gl.ARRAY_BUFFER, uvs, this.gl.STATIC_DRAW);\r\n this.carTextureBuffer.itemSize = 2;\r\n this.carTextureBuffer.numberOfItems = uvCoords.length / this.carTextureBuffer.itemSize;\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null);\r\n }", "function FontTexture(name,font,scene,maxCharCount,samplingMode,superSample,signedDistanceField){if(maxCharCount===void 0){maxCharCount=200;}if(samplingMode===void 0){samplingMode=BABYLON.Texture.TRILINEAR_SAMPLINGMODE;}if(superSample===void 0){superSample=false;}if(signedDistanceField===void 0){signedDistanceField=false;}var _this=_super.call(this,null,scene,true,false,samplingMode)||this;_this._curCharCount=0;_this._lastUpdateCharCount=-1;_this._usedCounter=1;_this.name=name;_this.debugMode=false;_this.wrapU=BABYLON.Texture.CLAMP_ADDRESSMODE;_this.wrapV=BABYLON.Texture.CLAMP_ADDRESSMODE;_this._sdfScale=8;_this._signedDistanceField=signedDistanceField;_this._superSample=false;_this._isPremultipliedAlpha=!signedDistanceField;_this.name=\"FontTexture \"+font;// SDF will use super sample no matter what, the resolution is otherwise too poor to produce correct result\nif(superSample||signedDistanceField){var sfont=_this.getSuperSampleFont(font);if(sfont){_this._superSample=true;font=sfont;}}// First canvas creation to determine the size of the texture to create\n_this._canvas=document.createElement(\"canvas\");_this._context=_this._canvas.getContext(\"2d\");_this._context.font=font;_this._context.fillStyle=\"white\";_this._context.textBaseline=\"top\";var res=_this.getFontHeight(font,\"j$|\");_this._lineHeightSuper=res.height;//+4;\n_this._lineHeight=_this._superSample?Math.ceil(_this._lineHeightSuper/2):_this._lineHeightSuper;_this._offset=res.offset;res=_this.getFontHeight(font,\"f\");_this._baseLine=res.height+res.offset-_this._offset;var maxCharWidth=Math.max(_this._context.measureText(\"W\").width,_this._context.measureText(\"_\").width);_this._spaceWidthSuper=_this._context.measureText(\" \").width;_this._spaceWidth=_this._superSample?_this._spaceWidthSuper/2:_this._spaceWidthSuper;_this._xMargin=Math.ceil(maxCharWidth/32);_this._yMargin=_this._xMargin;// This is an approximate size, but should always be able to fit at least the maxCharCount\nvar totalEstSurface=(Math.ceil(_this._lineHeightSuper)+_this._yMargin*2)*(Math.ceil(maxCharWidth)+_this._xMargin*2)*maxCharCount;var edge=Math.sqrt(totalEstSurface);var textSize=Math.pow(2,Math.ceil(Math.log(edge)/Math.log(2)));// Create the texture that will store the font characters\n_this._texture=scene.getEngine().createDynamicTexture(textSize,textSize,false,samplingMode);var textureSize=_this.getSize();_this.hasAlpha=_this._signedDistanceField===false;// Recreate a new canvas with the final size: the one matching the texture (resizing the previous one doesn't work as one would expect...)\n_this._canvas=document.createElement(\"canvas\");_this._canvas.width=textureSize.width;_this._canvas.height=textureSize.height;_this._context=_this._canvas.getContext(\"2d\");_this._context.textBaseline=\"top\";_this._context.font=font;_this._context.fillStyle=\"white\";_this._context.imageSmoothingEnabled=false;_this._context.clearRect(0,0,textureSize.width,textureSize.height);// Create a canvas for the signed distance field mode, we only have to store one char, the purpose is to render a char scaled _sdfScale times\n// into this 2D context, then get the bitmap data, create the SDF char and push the result in the _context (which hold the whole Font Texture content)\n// So you can see this context as an intermediate one, because it is.\nif(_this._signedDistanceField){var sdfC=document.createElement(\"canvas\");var s=_this._sdfScale;sdfC.width=(Math.ceil(maxCharWidth)+_this._xMargin*2)*s;sdfC.height=(Math.ceil(_this._lineHeightSuper)+_this._yMargin*2)*s;var sdfCtx=sdfC.getContext(\"2d\");sdfCtx.scale(s,s);sdfCtx.textBaseline=\"top\";sdfCtx.font=font;sdfCtx.fillStyle=\"white\";sdfCtx.imageSmoothingEnabled=false;_this._sdfCanvas=sdfC;_this._sdfContext=sdfCtx;}_this._currentFreePosition=BABYLON.Vector2.Zero();// Add the basic ASCII based characters \nfor(var i=0x20;i<0x7F;i++){var c=String.fromCharCode(i);_this.getChar(c);}_this.update();return _this;//this._saveToImage(\"\");\n}", "generateTexture() {\n const canvas = document.getElementById('debugcanvas');\n const c = canvas.getContext('2d');\n c.fillStyle = 'black';\n c.fillRect(0,0,canvas.width, canvas.height);\n \n for(let i=0; i<canvas.width; i++) {\n for(let j=0; j<canvas.height; j++) {\n let v = this.octave(i/canvas.width,j/canvas.height,16);\n const per = (100*v).toFixed(2)+'%';\n c.fillStyle = `rgb(${per},${per},${per})`;\n c.fillRect(i,j,1,1);\n }\n }\n return c.getImageData(0,0,canvas.width,canvas.height);\n }", "function setupTextures() {\n// for(var i = 0; i < 6; i++) {\n// imgs[i] = new Image();\n// imgs[i].onload = function() {\n// image_count++;\n// if(image_count == image_total) {\n// cubeMap = gl.createTexture();\n// gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\n// var locations = \n// }\n// }\n// }\n for(var i = 0; i < 6; i++) {\n texs[i] = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texs[i]);\n imgs[i] = new Image();\n imgs[i].src = urls[i]; \n }\n imgs[0].onload = function() {\n handleTextureLoaded(imgs[0], texs[0]);\n }\n\n imgs[1].onload = function() {\n handleTextureLoaded(imgs[1], texs[1]);\n } \n imgs[2].onload = function() {\n handleTextureLoaded(imgs[2], texs[2]);\n } \n imgs[3].onload = function() {\n handleTextureLoaded(imgs[3], texs[3]);\n } \n imgs[4].onload = function() {\n handleTextureLoaded(imgs[4], texs[4]);\n }\n imgs[5].onload = function() {\n handleTextureLoaded(imgs[5], texs[5]);\n }\n\n// \n//// Fill the texture with a 1x1 blue pixel.\n//gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\n// new Uint8Array([0, 0, 255, 255]));\n//\n// cubeImage_negx = new Image();\n// cubeImage_negx.onload = function() { handleTextureLoaded(cubeImage_negx, cubeTexture_negx); }\n// cubeImage_negx.src = \"neg-x.png\";\n // https://goo.gl/photos/SUo7Zz9US1AKhZq49\n}", "initBuffers() {\n\n var alpha = 2 * Math.PI / this.slices;\n\n this.vertices = [];\n this.normals = [];\n this.indices = [];\n this.texCoords = [];\n this.init_texCoords=[];\n\n var alpha = 2 * Math.PI / this.slices;\n var beta = (Math.PI / 2) / this.stacks;\n\n for (let i = 0; i <= this.stacks; i++) {\n for (let j = 0; j <= this.slices; j++) {\n this.vertices.push(Math.cos(alpha * j) * Math.cos(beta * i), Math.sin(alpha * j) * Math.cos(beta * i), Math.sin(beta * i));\n this.normals.push(Math.cos(alpha * j) * Math.cos(beta * i), Math.sin(alpha * j) * Math.cos(beta * i), Math.sin(beta * i));\n this.texCoords.push(j * 1 / this.slices, i * 1 / this.stacks);\n }\n }\n\n for (let k = 0; k < this.stacks; k++) {\n for (let l = 0; l < this.slices; l++) {\n this.indices.push(k * (this.slices + 1) + l, k * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + l);\n this.indices.push(k * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + 1 + l, (k + 1) * (this.slices + 1) + l);\n }\n }\n\n\n\n this.init_texCoords=this.texCoords;\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "constructor(game, x, y, type, uuid) { \n let graphics = game.add.graphics(0,0);\n graphics.beginFill(0xffffff, 1);\n graphics.drawRoundedRect(\n 100,\n 100,\n (game.boardGroup.width / 39) - 4,\n (game.boardGroup.width / 39) - 4,\n 14\n );\n super(game, x, y, graphics.generateTexture());\n this.angle = Math.floor(Math.random() * 40) - 20;\n this.anchor.setTo(0.5);\n this.tint = this.resMap[type].tint;\n this.resourceEnum = Object.freeze({\n OXYGEN: 0,\n ROCKET: 1,\n METAL: 2,\n ENERGY: 3,\n BIOMASS: 4,\n BIODRONE: 5,\n URANIUM: 6\n });\n this.resMap = {\n energy1:{\n min: 0,\n max: 9,\n row: 2,\n tint: 0xfce315\n }, \n energy2:{\n min: 20,//0\n max: 11,//9\n row: 2,//28\n tint: 0xfce315\n },\n oxygen:{\n min: 0,//20\n max: 9,//11\n row: 5,//25\n tint: 0x00b1f0\n },\n metal:{\n min: 0,\n max: 9,\n row: 3,\n tint: 0xfffffe\n },\n biodrone:{\n min: 20,\n max: 11,\n row: 4,\n tint: 0x9f3a9b\n },\n rocket:{\n min: 0,//20\n max: 9,//11\n row: 4,//26\n tint: 0xe82a2c\n },\n uranium:{\n min: 20,\n max: 11,\n row: 3,\n tint: 0xf36520\n },\n biomass:{\n min: 20,\n max: 11,\n row: 5,\n tint: 0x8ac342\n }\n };\n\n }", "function createLandingPlanet() {\n ctx.beginPath();\n ctx.ellipse(400, 450, 430, 100, 0, Math.PI, 0);\n var grd = ctx.createLinearGradient(0, 300, 0, 400);\n grd.addColorStop(0, \"rgba(247, 185, 80, 1)\");\n grd.addColorStop(1, \"rgba(134, 27, 74, 1)\");\n ctx.fillStyle = grd;\n ctx.fill(); \n\n buildLightCraters() \n buildDarkCrater(700);\n buildDarkCrater(0);\n}", "function planeMaker (horizontal, vertical) {\r\n // Controls texture repeat for U and V\r\n const uHorizontal = horizontal * 4;\r\n const vVertical = vertical * 4;\r\n\r\n // Load a texture, set wrap mode to repeat\r\n const texture = new THREE.TextureLoader()\r\n .load('https://cdn.rawgit.com/bryik/aframe-scatter-component/master/assets/grid.png');\r\n // .load('grid.png')\r\n texture.wrapS = THREE.RepeatWrapping;\r\n texture.wrapT = THREE.RepeatWrapping;\r\n texture.anisotropy = 16;\r\n texture.repeat.set(uHorizontal, vVertical);\r\n\r\n // Create material and geometry\r\n const material = new THREE.MeshBasicMaterial({\r\n map: texture,\r\n side: THREE.DoubleSide\r\n });\r\n const geometry = new THREE.PlaneGeometry(horizontal, vertical);\r\n\r\n return new THREE.Mesh(geometry, material);\r\n}", "function setupTextures() {\r\n\r\n\r\n //START OF CUBEMAP STUFF!!\r\n\r\n cubeMap = gl.createTexture();\r\n\r\n gl.activeTexture( gl.TEXTURE0);\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n\r\n\r\n //gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n cubeMapImage1 = new Image();\r\n cubeMapImage1.onload = function() { handleTextureLoaded(cubeMapImage1, cubeMap, 1); }\r\n cubeMapImage1.src = \"pos-x.png\";\r\n\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n cubeMapImage2 = new Image();\r\n cubeMapImage2.onload = function() { handleTextureLoaded(cubeMapImage2, cubeMap, 2); }\r\n cubeMapImage2.src= \"neg-x.png\";\r\n\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n\r\n cubeMapImage3 = new Image();\r\n\r\n cubeMapImage3.onload = function() { handleTextureLoaded(cubeMapImage3, cubeMap, 3); }\r\n cubeMapImage3.src = \"pos-y.png\";\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n cubeMapImage4 = new Image();\r\n\r\n cubeMapImage4.onload = function() { handleTextureLoaded(cubeMapImage4, cubeMap, 4); }\r\n cubeMapImage4.src = \"neg-y.png\";\r\n\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n cubeMapImage5 = new Image();\r\n\r\n cubeMapImage5.onload = function() { handleTextureLoaded(cubeMapImage5, cubeMap, 5); }\r\n cubeMapImage5.src = \"pos-z.png\";\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeMap);\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,\r\n new Uint8Array([0, 0, 0, 255]));\r\n\r\n cubeMapImage6 = new Image();\r\n cubeMapImage6.onload = function() { handleTextureLoaded(cubeMapImage6, cubeMap, 6); }\r\n cubeMapImage6.src = \"neg-z.png\";\r\n\r\n\r\n\r\n}", "function createTexturedCube(gl,imagepath,xScale,yScale,shape) {\n var cube = createCube(gl);\n cube.isTexture=true;\n if(shape){\n var temp=shape;\n }else{\n var temp=[1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // v0-v1-v2-v3 front\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, // v0-v3-v4-v5 right\n 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, // v0-v5-v6-v1 up\n 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // v1-v6-v7-v2 left\n 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // v7-v4-v3-v2 down\n 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0] // v4-v7-v6-v5 back\n }\n for (var i=0;i<temp.length;i++){\n if (i%2==0){\n temp[i]*=xScale;\n }\n if (i%2==1){\n temp[i]*=yScale;\n }\n }\n texCoords = new Float32Array(temp);\n cube.texCoordBuffer = initArrayBufferForLaterUse(gl, texCoords, 2, gl.FLOAT);\n cube.texture = initTextures(gl,imagepath);// Set texture\n return cube;\n}", "function makeUVs (width, depth, height, texW, texH) {\n if (!texW || !texH) throw new Error('missing tex dims')\n\n // scale factor from world to texture coordinates\n var mu = 32 / texW\n var mv = 32 / texH\n return [\n [0, 0, mu * depth, mv * height], // x0 face: depth x height\n [0, 0, mu * depth, mv * height],\n [0, 0, mu * width, mv * height], // y0 face: width x height\n [0, 0, mu * width, mv * height],\n [0, 0, mu * width, mv * depth], // z0 face: width x depth\n [0, 0, mu * width, mv * depth]\n ]\n}", "function draw() {\n background(20);\n // orbitControl(); // allows user to drag the screen\n noFill();\n strokeWeight(0.5);\n translate(0,0,0);\n angleMode(DEGREES);\n rotateY(frameCount * 0.2);\n\n\n // sun (yellow)\n stroke(255,255,0);\n sphere(100);\n // texture(neptuneImg);\n\n // earth (green)\n translate(500, 0, 0);\n push();\n rotateY(frameCount * 1);\n // rotateY(frameCount * 0.05);\n stroke(0,255,0);\n sphere(50);\n pop();\n // texture(earthImg);\n\n // neptune (blue)\n translate(0,-200,600);\n rotateY(frameCount *0.01);\n stroke(0,0,255);\n sphere(90);\n // venus (red)\n\n\n\n\n\n\n\n}", "function initializeResources() {\r\n // initTextures2();\r\n const assets = [\r\n {name: \"hangar\", file: \"hangar.json\"},\r\n {name: \"floor\", file: \"hangarfloor.json\"},\r\n {name: \"gun\", file: \"gun.json\"},\r\n {name: \"box\", file: \"box.json\"},\r\n {name: \"alien\", file: \"alien.json\"},\r\n {name: \"watertank\", file: \"watertank.json\"},\r\n {name: \"warpgate\", file: \"warpgate.json\"},\r\n {name: \"bullet\", file: \"bullet.json\"},\r\n {name: \"gun2\", file: \"ak47.json\"},\r\n ];\r\n\r\n const textures = [\r\n {name: \"crate\", file: \"box.png\"},\r\n {name: \"redWall\", file: \"wall.png\"},\r\n {name: \"glowingFloor\", file: \"floor.png\"},\r\n {name: \"gun\", file: \"guntexture.png\"},\r\n {name: \"alien\", file: \"alientexture.png\"},\r\n {name: \"warpgate\", file: \"warpgatetexture.png\"},\r\n {name: \"bullet\", file: \"guntexture.png\"},\r\n {name: \"gun2\", file: \"T_INS_Body_n.tga.png\"}\r\n ];\r\n\r\n let loaded = assets.length + textures.length;\r\n\r\n const runMain = function () {\r\n if (--loaded === 0) {\r\n try {\r\n main();\r\n } catch (e) {\r\n console.error(\"Fatal error \", e);\r\n alert(\"Error in game!\");\r\n }\r\n }\r\n };\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n let texture = gl.createTexture();\r\n texture.image = new Image();\r\n texture.image.onload = function () {\r\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\r\n gl.bindTexture(gl.TEXTURE_2D, texture);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n runMain();\r\n };\r\n texture.image.src = \"./assets/\" + textures[i].file;\r\n textureList[textures[i].name] = texture;\r\n }\r\n\r\n for (var i = 0; i < assets.length; i++) {\r\n var asset = assets[i];\r\n loadJSONResource(asset.name, \"./assets/\" + asset.file, function (modelErr, modelObj, name) {\r\n if (modelErr) {\r\n alert(\"Fatal error getting \" + name + \"model!\");\r\n } else {\r\n modelList[name] = modelObj;\r\n runMain();\r\n }\r\n });\r\n }\r\n}", "makeSurfaces(){\n var nurbsSurface1 = new CGFnurbsSurface(1,3,this.controlPoints);\n\n this.surface1 = new CGFnurbsObject(this.scene,this.slices,this.stacks,nurbsSurface1);\n \n\n var nurbsSurface2 = new CGFnurbsSurface(1,3,this.controlPoints);\n\n this.surface2 = new CGFnurbsObject(this.scene,this.slices,this.stacks,nurbsSurface2);\n\n }", "setupResources() {\n\t\tlet xorshift32_state = new Uint32Array([0.4 * 0xFFFFFFFF]);\n\t\tfunction xorshift32() {\n\t\t\tconst x = xorshift32_state;\n\t\t\tx[0] ^= x[0] << 13;\n\t\t\tx[0] ^= x[0] >> 17;\n\t\t\tx[0] ^= x[0] << 5;\n\t\t\treturn x[0] / 0xFFFFFFFF;\n\t\t}\n\n\n\t\tlet steps = this.three_d_model_count\n\t\tlet radius = 4\n\t\tlet centerX = 0\n\t\tlet centerY = 0\n\n\t\tlet x_val = 0\n\t\tlet y_val = 0\n\t\tlet z_val = 0\n\n\t\t// Structures\n\t\tfor(var x = 0; x < steps; x++) {\n\n\t\t\tx_val = centerX + radius * Math.cos(2 * Math.PI * x / steps);\n\t\t\tz_val = centerY + radius * Math.sin(2 * Math.PI * x / steps);\n\t\t\ty_val = Math.floor(Math.random() * 4) + 1\n\t\t\tfor (let obj of this.resources[x]) {\n\t\t\t\tobj.scale.multiplyScalar(0.01);\n\t\t\t\tobj.position = new RC.Vector3(x_val, y_val, z_val);\n\t\t\t\tobj.material.shininess = 16;\n\t\t\t\tobj.material = this.createTextureForStructures();\n\t\t\t\tthis.scene.add(obj);\n\n\t\t\t}\n\t\t}\n\t}", "function HDRCubeTexture(url,scene,size,noMipmap,generateHarmonics,useInGammaSpace,usePMREMGenerator,onLoad,onError){if(noMipmap===void 0){noMipmap=false;}if(generateHarmonics===void 0){generateHarmonics=true;}if(useInGammaSpace===void 0){useInGammaSpace=false;}if(usePMREMGenerator===void 0){usePMREMGenerator=false;}if(onLoad===void 0){onLoad=null;}if(onError===void 0){onError=null;}var _this=_super.call(this,scene)||this;_this._useInGammaSpace=false;_this._generateHarmonics=true;_this._isBABYLONPreprocessed=false;_this._onLoad=null;_this._onError=null;/**\n * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.\n */_this.coordinatesMode=BABYLON.Texture.CUBIC_MODE;/**\n * The spherical polynomial data extracted from the texture.\n */_this.sphericalPolynomial=null;/**\n * Specifies wether the texture has been generated through the PMREMGenerator tool.\n * This is usefull at run time to apply the good shader.\n */_this.isPMREM=false;_this._isBlocking=true;if(!url){return _this;}_this.name=url;_this.url=url;_this.hasAlpha=false;_this.isCube=true;_this._textureMatrix=BABYLON.Matrix.Identity();_this._onLoad=onLoad;_this._onError=onError;if(size){_this._isBABYLONPreprocessed=false;_this._noMipmap=noMipmap;_this._size=size;_this._useInGammaSpace=useInGammaSpace;_this._usePMREMGenerator=usePMREMGenerator&&scene.getEngine().getCaps().textureLOD&&_this.getScene().getEngine().getCaps().textureFloat&&!_this._useInGammaSpace;}else{_this._isBABYLONPreprocessed=true;_this._noMipmap=false;_this._useInGammaSpace=false;_this._usePMREMGenerator=scene.getEngine().getCaps().textureLOD&&_this.getScene().getEngine().getCaps().textureFloat&&!_this._useInGammaSpace;}_this.isPMREM=_this._usePMREMGenerator;_this._texture=_this._getFromCache(url,_this._noMipmap);if(!_this._texture){if(!scene.useDelayedTextureLoading){_this.loadTexture();}else{_this.delayLoadState=BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;}}return _this;}", "function skybox(){\r\n\tvar materialArray = [];\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_px.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_nx.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_py.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_ny.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_pz.jpg' ) }));\r\n\tmaterialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'img/sky2/nebula_nz.jpg' ) }));\r\n\r\n\tfor (var i = 0; i < 6; i++) \r\n\t materialArray[i].side = THREE.BackSide;\r\n\r\n\tvar skyboxMaterial = new THREE.MeshFaceMaterial( materialArray );\r\n\tvar skyboxGeom = new THREE.CubeGeometry( 500, 500, 500);\r\n\tvar skybox = new THREE.Mesh( skyboxGeom, skyboxMaterial );\r\n\tscene.add( skybox );\r\n}", "function loadTextures(){\n borderTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, borderTexture);\n\n let borderInfo= [\n {\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n location: 'posx.png'\n },\n {\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n location: 'negx.png'\n },\n {\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n location: 'posy.png'\n },\n {\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n location: 'negy.png'\n },\n {\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n location: 'posz.png'\n },\n {\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n location: 'negz.png'\n }\n ]\n borderInfo.forEach((face) => {\n let {target, location} = face\n gl.texImage2D(target, 0, gl.RGBA, 2048, 2048, 0, gl.RGBA, gl.UNSIGNED_BYTE, null)\n let image = new Image()\n image.src = location\n image.addEventListener('load', function() {\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, borderTexture)\n gl.texImage2D(target, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image)\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP)\n })\n });\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP)\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR)\n}", "function setup() {\n // Working in WEBGL\n createCanvas(windowWidth, windowHeight, WEBGL);\n\n // Background (stars and fog)\n bg();\n\n planetButtons();\n\n // Storing HTML elements inside their respective variables\n $sunInfo = $('.sunInfo');\n $mercuryInfo = $('.mercuryInfo');\n $venusInfo = $('.venusInfo');\n $earthInfo = $('.earthInfo');\n $marsInfo = $('.marsInfo');\n $jupiterInfo = $('.jupiterInfo');\n $saturnInfo = $('.saturnInfo');\n $uranusInfo = $('.uranusInfo');\n $neptuneInfo = $('.neptuneInfo');\n $plutoInfo = $('.plutoInfo');\n $buttonGroup = $('.buttonGroup');\n\n // Creating objects (planet spheres)\n sun = new Planet(sunSize, sunTextureImg, 0, 0);\n mercury = new Planet(baseSize, mercuryTextureImg, mercurySpeed, mercuryDistance);\n venus = new Planet(venusSize, venusTextureImg, venusSpeed, venusDistance);\n earth = new Planet(earthSize, earthTextureImg, earthSpeed, earthDistance);\n mars = new Planet(marsSize, marsTextureImg, marsSpeed, marsDistance);\n jupiter = new Planet(jupiterSize, jupiterTextureImg, jupiterSpeed, jupiterDistance);\n saturn = new Planet(saturnSize, saturnTextureImg, saturnSpeed, saturnDistance);\n uranus = new Planet(uranusSize, uranusTextureImg, uranusSpeed, uranusDistance);\n neptune = new Planet(neptuneSize, neptuneTextureImg, neptuneSpeed, neptuneDistance);\n pluto = new Planet(baseSize, plutoTextureImg, plutoSpeed, plutoDistance);\n\n // Creating objects (sound effects)\n sunSound = new Sound(sunSFX);\n mercurySound = new Sound(mercurySFX);\n venusSound = new Sound(venusSFX);\n earthSound = new Sound(earthSFX);\n marsSound = new Sound(marsSFX);\n jupiterSound = new Sound(jupiterSFX);\n saturnSound = new Sound(saturnSFX);\n uranusSound = new Sound(uranusSFX);\n neptuneSound = new Sound(neptuneSFX);\n plutoSound = new Sound(plutoSFX);\n}", "function generateTexture() {\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = 256;\n\tcanvas.height = 256;\n\n\tvar context = canvas.getContext( '2d' );\n\tvar image = context.getImageData( 0, 0, 256, 256 );\n\n\tvar x = 0, y = 0;\n\tfor ( var i = 0, j = 0, l = image.data.length; i < l; i += 4, j ++ ) {\n\tx = j % 256;\n\ty = x == 0 ? y + 1 : y;\n\timage.data[ i ] = 255;\n\timage.data[ i + 1 ] = 255;\n\timage.data[ i + 2 ] = 255;\n\timage.data[ i + 3 ] = Math.floor( x ^ y );\n\n\t}\n\n\tcontext.putImageData( image, 0, 0 );\n\treturn canvas;\n\n}", "function initTextures()\n{\n initVideo();\n initSpecialTextures();\n}", "function savPlane(w,h,texture){\n\t__localPlaneGeometry= new THREE.PlaneGeometry(w,h);\n\t__localPlaneGeometry.applyMatrix(new THREE.Matrix4().makeRotationX(-Math.PI/2));\n\t__localPlaneMaterial= new THREE.MeshLambertMaterial({map:texture});\n} //end function", "addNormal() {\n let mapUrl = \"./images/earth_atmos_2048.jpg\";\n let normalMapUrl = \"./images/earth_normal_2048.jpg\";\n let specularMapUrl = \"./images/earth_specular_spec_1k.jpg\";\n\n let map = new THREE.TextureLoader().load(mapUrl);\n let normalMap = new THREE.TextureLoader().load(normalMapUrl);\n let specularMap = new THREE.TextureLoader().load(specularMapUrl);\n\n this.material = new THREE.MeshPhongMaterial({\n map: map,\n normalMap: normalMap,\n specularMap: specularMap\n });\n\n this.astro.material = this.material\n }", "function Prepare(){\n function PrepareCubeMapLoader(url, ext){\n var urls = [\n url + \"px\" + ext,\n url + \"nx\" + ext,\n url + \"py\" + ext,\n url + \"ny\" + ext,\n url + \"pz\" + ext,\n url + \"nz\" + ext\n ];\n function OnLoad(res){\n res.format = THREE.RGBFormat;\n assetManager.cubeMap = res;\n }\n assetManager.loader.push(function(){\n assetManager.cubeMap= new THREE.CubeTextureLoader(loadManager).load(urls,OnLoad);\n });\n }\n\n function PrepareObjectLoader(url, onLoad){\n assetManager.loader.push(function(){\n new THREE.FBXLoader(loadManager).load(url,onLoad);\n });\n }\n\n PrepareCubeMapLoader(\"img/cubemap/bkg1_\",\".jpg\");\n PrepareObjectLoader(\"model/rendoru-spaceship.fbx\",function (res) {\n var basePath = \"img/texture/Rendoru-space-ship-anim-bone6_\";\n res.traverse(function (child) {\n if(child.isMesh){\n var cleanName = child.name.replace(/[0-9]+/,\"\");\n if(cleanName == \"RightEngine\"){\n cleanName = \"Engine\";\n }\n var emissiveTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Emissive.jpg\");\n var metallicTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Metallic.jpg\");\n var roughnessTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Roughness.jpg\");\n var normalTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_Normal.jpg\");\n var baseColorTexture = new THREE.TextureLoader(loadManager).load(basePath + cleanName + \"Material_BaseColor.jpg\");\n child.material = new THREE.MeshPhysicalMaterial({\n color: 0x000000,\n map: baseColorTexture,\n emissive: 0xffffff,\n emissiveMap: emissiveTexture,\n envMap: assetManager.cubeMap,\n metalness: 1.0,\n metalnessMap: metallicTexture,\n normalMap: normalTexture,\n roughness: 1.0,\n roughnessMap: roughnessTexture,\n reflectivity: 1.0,\n clearCoat: 1.0,\n });\n child.castShadow = true;\n child.receiveShadow = true;\n }\n });\n var boxGeometry = new THREE.BoxBufferGeometry(1,1,1);\n var hitBoxPosition = [\n new THREE.Vector3(0,-1.5,0), 4,\n new THREE.Vector3(1.5,-1.75,0.5), 2,\n new THREE.Vector3(-1.5,-1.75,0.5), 2,\n new THREE.Vector3(1.5,-1.75,-0.5), 2,\n new THREE.Vector3(-1.5,-1.75,-0.5), 2,\n new THREE.Vector3(3.75,-0.5,0), 2,\n new THREE.Vector3(-3.75,-0.5,0), 2,\n new THREE.Vector3(5,0.5,0), 2,\n new THREE.Vector3(-5,0.5,0), 2,\n ];\n res.hitBoxes = new Array();\n for(var i=0;i<9;i++){\n //var hitBox = new THREE.Mesh(boxGeometry, new THREE.MeshStandardMaterial({color: 0xffff,}));\n var hitBox = new THREE.Object3D();\n hitBox.scale.set(0.5,0.5,0.5);\n hitBox.name = \"hit_box_\"+i.toString();\n var hitboxIndex = i * 2;\n hitBox.position.set(hitBoxPosition[hitboxIndex].x,hitBoxPosition[hitboxIndex].y,hitBoxPosition[hitboxIndex].z);\n res.add(hitBox);\n let tolerance = hitBoxPosition[hitboxIndex + 1];\n hitBox.isColliding = function (other) {\n var resOther = new THREE.Vector3();\n other.getWorldPosition(resOther);\n var resCurrent = new THREE.Vector3();\n this.getWorldPosition(resCurrent);\n var distance = resCurrent.distanceTo(resOther);\n var isCollide = distance < tolerance;\n //this.material.color = new THREE.Color((isCollide) ? 0xff0000 : 0x00ff00);\n return isCollide;\n };\n res.hitBoxes.push(hitBox);\n }\n\n res.isColliding = function (other) {\n for(var i = 0;i<this.hitBoxes.length;i++){\n if(this.hitBoxes[i].isColliding(other)){\n return true;\n }\n }\n return false;\n };\n\n res.name = \"spaceship\";\n res.mixer = new THREE.AnimationMixer(res);\n assetManager.addObject(res);\n });\n\n assetManager.loader.forEach(element => {\n element();\n });\n\n var planeGeometry = new THREE.PlaneBufferGeometry(10,10);\n var standardMaterial = new THREE.MeshStandardMaterial();\n var groundPlane = new THREE.Mesh(planeGeometry, standardMaterial);\n groundPlane.name = \"ground\";\n assetManager.addObject(groundPlane);\n \n var boxGeometry = new THREE.BoxBufferGeometry(1,1,1);\n var standardRedMaterial = new THREE.MeshStandardMaterial({color: 0xff0000, });\n for(var i=0;i<4;i++){\n var redBox = new THREE.Mesh(boxGeometry, standardRedMaterial);\n redBox.name = \"red_box_\"+i.toString();\n assetManager.addObject(redBox);\n }\n\n requestAnimationFrame(Update);\n}", "shapeTerrain() {\r\n // MP2: Implement this function!\r\n }", "function fillVelocityTexture(texture) {\n const theArray = texture.image.data;\n //put the random velocity into the texture's data.\n for (let k = 0, kl = theArray.length; k < kl; k += 4) {\n const x = Math.random() - 0.5;\n const y = Math.random() - 0.5;\n const z = Math.random() - 0.5;\n theArray[k + 0] = x * 10;\n theArray[k + 1] = y * 10;\n theArray[k + 2] = z * 10;\n theArray[k + 3] = 1;\n }\n}", "_setTextureParameters() {\n let gl = this._gl;\n\n // the line below is already done when creating a Texture2D with content loader\n // gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, gl.LUMINANCE, gl.UNSIGNED_BYTE, this._texture.getImageData());\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n }", "function add_planets(callback){\n\n\tvar finished = 0;\n\n\tfor (var name in planet_mesh_config) {\n\t\tif(planet_mesh_config.hasOwnProperty(name)) {\n\n\t\t\tvar planet = planet_mesh_config[name];\n\n\t\t\t(function (planet) {\n\t\t\t\ttexture_loader.load('/projects/planets/img/' + planet.img, function(map) {\n\t\t\t\t\tmap.minFilter = THREE.LinearFilter; // clears error from images not 2:1\n\t\t\t\t\tvar material\t= new planet.texture({ map\t: map});\n\t\t\t\t\tvar geometry = new THREE.SphereGeometry(planet.radius, 32, 32);\n\t\t\t\t\tvar mesh = new THREE.Mesh( geometry, material );\n\n\t\t\t\t\tscene.add(mesh);\n\t\t\t\t\tmeshes[planet.name] = mesh;\n\t\t\t\t\tmeshes[planet.name].rotation.x = Math.PI / 2;\n\n\t\t\t\t\tif(meshes_are_loaded()){\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}(planet));\n\t\t}\n\t}\n}", "function init(){\n scene = new THREE.Scene();\n camera = new THREE.PerspectiveCamera(35, window.innerWidth/window.innerHeight, 300, 10000 );\n renderer = new THREE.WebGLRenderer({antialias:true});\n renderer.setClearColor(\"#000000\");\n renderer.setSize( window.innerWidth, window.innerHeight );\n texture=new THREE.TextureLoader().load( 'image/1.jpg' );\n texture2=new THREE.TextureLoader().load( 'image/bg.jpg' );\n texture3=new THREE.TextureLoader().load( 'image/back.png' );\n texture4=new THREE.TextureLoader().load( 'image/next.png' );\n texture5=new THREE.TextureLoader().load( 'image/s5.png' );\n // to load the texture\n var mtlLoader = new THREE.MTLLoader();\n\n mtlLoader.load(\"model/xuedi.mtl\", function(materials){\n materials.preload();\n\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n\n objLoader.load(\"model/xuedi.obj\", function(mesh){\n mesh.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh.scale.set(12,8,8);\n mesh.position.set(0,-180,0);\n mesh.position.z=-1000;\n mesh.rotation.x=0.2;\n //mesh6.rotation.x=0.3;\n scene.add(mesh);\n });\n });\n var mtlLoader2 = new THREE.MTLLoader();\n\n mtlLoader2.load(\"model/yeye.mtl\", function(materials2){\n materials2.preload();\n\n var objLoader2 = new THREE.OBJLoader();\n objLoader2.setMaterials(materials2);\n\n objLoader2.load(\"model/yeye.obj\", function(mesh2){\n mesh2.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh2.scale.set(2,2,2);\n mesh2.position.set(-80,-80,0);\n mesh2.position.z=-700;\n mesh2.rotation.y=-6;\n mesh2.rotation.x=0.1;\n //mesh6.rotation.x=0.3;\n scene.add(mesh2);\n });\n });\n var mtlLoader3 = new THREE.MTLLoader();\n\n mtlLoader3.load(\"model/house3.mtl\", function(materials3){\n materials3.preload();\n\n var objLoader3 = new THREE.OBJLoader();\n objLoader3.setMaterials(materials3);\n\n objLoader3.load(\"model/house3.obj\", function(mesh3){\n mesh3.traverse(function(node){\n if( node instanceof THREE.Mesh ){\n node.castShadow = true;\n node.receiveShadow = true;\n }\n });\n var sizeRand = Math.random() * 0.5;\n mesh3.scale.set(20,17,17);\n mesh3.position.set(-600,-130,0);\n mesh3.position.z=-700;\n mesh3.rotation.y=1.8;\n mesh3.rotation.x=0.3;\n //mesh6.rotation.x=0.3;\n scene.add(mesh3);\n });\n });\n // to load the model\n document.body.appendChild( renderer.domElement );\n document.addEventListener( \"mousedown\", onDocumentMouseDown, false );\n document.addEventListener( \"mousemove\", onDocumentMouseMove, false );\n window.requestAnimationFrame(render);\n}", "function preload() {\n // Loading images (planet textures)\n sunTextureImg = loadImage(\"assets/images/sunTexture.jpg\");\n mercuryTextureImg = loadImage(\"assets/images/mercuryTexture.jpg\");\n venusTextureImg = loadImage(\"assets/images/venusTexture.jpg\");\n earthTextureImg = loadImage(\"assets/images/earthTexture.jpg\");\n marsTextureImg = loadImage(\"assets/images/marsTexture.png\");\n jupiterTextureImg = loadImage(\"assets/images/jupiterTexture.jpg\");\n saturnTextureImg = loadImage(\"assets/images/saturnTexture.png\");\n saturnRingTextureImg = loadImage(\"assets/images/saturnRingTexture.jpg\"); // texture for saturn\"s ring\n uranusTextureImg = loadImage(\"assets/images/uranusTexture.jpg\");\n neptuneTextureImg = loadImage(\"assets/images/neptuneTexture.jpg\");\n plutoTextureImg = loadImage(\"assets/images/plutoTexture.jpg\");\n\n // Milky way image\n milkyWayImg = loadImage(\"assets/images/milkyWay.jpg\");\n // Taken from https://www.goodfon.com/wallpaper/window-spaceship-star-light-planet-sci-fi-meteorites.html\n windowImg = loadImage(\"assets/images/window.png\");\n\n // Loading sounds for each planet\n sunSFX = loadSound(\"assets/sounds/sun.mp3\");\n mercurySFX = loadSound(\"assets/sounds/mercury.mp3\");\n venusSFX = loadSound(\"assets/sounds/venus.mp3\");\n earthSFX = loadSound(\"assets/sounds/earth.mp3\");\n marsSFX = loadSound(\"assets/sounds/mars.mp3\");\n jupiterSFX = loadSound(\"assets/sounds/jupiter.mp3\");\n saturnSFX = loadSound(\"assets/sounds/saturn.mp3\");\n uranusSFX = loadSound(\"assets/sounds/uranus.mp3\");\n neptuneSFX = loadSound(\"assets/sounds/neptune.mp3\");\n plutoSFX = loadSound(\"assets/sounds/pluto.mp3\");\n\n // Loading font\n karlaFontRegular = loadFont(\"assets/fonts/Karla-Regular.ttf\");\n karlaFontBold = loadFont(\"assets/fonts/Karla-Bold.ttf\");\n karlaFontItalic = loadFont(\"assets/fonts/Karla-Italic.ttf\");\n}", "createImageData(w,h,param) { // imagedata contains a texture\n\t\tw=w||0;\n\t\th=h||0;\n\t\tconst isFrozen=!!(param&&param.isFrozen);\n\n\t\tlet imgData=null;\n\t\tif(isFrozen) { // create array\n\t\t\tconst SIZE=w*h*(this.dataFormat==gl.UNSIGNED_SHORT_4_4_4_4? 1:4);\n\t\t\tswitch(this.dataFormat) {\n\t\t\t\tcase gl.FLOAT: imgData=Float32Array(SIZE); break;\n\t\t\t\tcase gl.UNSIGNED_SHORT_4_4_4_4:\n\t\t\t\tcase gl.HALF_FLOAT: imgData=Uint16Array(SIZE); break;\n\t\t\t\tcase gl.UNSIGNED_BYTE: imgData=Uint8Array(SIZE); break;\n\t\t\t}\n\t\t}\n\t\telse { // create gl texture\n\t\t\tconst gl=this.gl;\n\t\t\timgData=GLProgram.createAndSetupTexture(gl);\n\t\t\tgl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,w,h,0,gl.RGBA,this.dataFormat,null);\n\t\t}\n\n\t\treturn { // a texture - image data type\n\t\t\ttype: isFrozen? \"GLRAMBuf\":\"GLTexture\",\n\t\t\tdata: imgData,\n\t\t\tid: ENV?ENV.hash(\"t\"):null, // for DEBUG ONLY! Does not guarantee uniqueness\n\t\t\tbitDepth: this.bitDepth,\n\t\t\twidth: w, // width and ...\n\t\t\theight: h, // ... height are immutable: do not change by assignment!\n\t\t\tleft: 0, // left & top can be changed directly: all relative to the viewport\n\t\t\ttop: 0,\n\t\t\ttagColor: [\n\t\t\t\tMath.random()*0.6+0.2,\n\t\t\t\tMath.random()*0.7+0.1,\n\t\t\t\tMath.random()*0.7+0.2\n\t\t\t],\n\t\t\tvalidArea: { // area that has content, coordinate {w,h,l,t} same as `this`\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0,\n\t\t\t\tleft: 0,\n\t\t\t\ttop: 0\n\t\t\t}\n\t\t};\n\t\t// If you modify the structure here, also modify GLImageDataFactory.getRAMBufFromTexture\n\t}", "function draw_planets(){\n if (system){\n let center_x = c.width/2 + offset_x*zoom;\n let center_y = c.height/2 + offset_y*zoom;\n for (let i = 0; i < system['planets'].length; i++){\n // draw orbital path with grayish color\n ctx.strokeStyle = ORBIT_COLOR;\n ctx.beginPath();\n ctx.arc(center_x, center_y, Math.abs(planet_x_by_i(i) - c.width/2) * zoom, 0, 2*Math.PI);\n ctx.stroke();\n ctx.closePath();\n\n // optionally draw highlight\n if (system['planets'][i]['highlighted']){\n let radius = HIGHLIGHT_RADIUS_PLANET*radius_of_planet(system['planets'][i]);\n ctx.fillStyle = 'white';\n ctx.beginPath();\n ctx.arc(system['planets'][i]['x'], system['planets'][i]['y'], radius * zoom, 0, 2*Math.PI);\n ctx.fill();\n ctx.closePath();\n \n ctx.strokeStyle = 'white';\n ctx.beginPath();\n ctx.moveTo(system['planets'][i]['x'], system['planets'][i]['y']);\n ctx.lineTo(system['planets'][i]['x'], c.height/2);\n ctx.stroke();\n ctx.lineTo(c.width, c.height/2);\n ctx.stroke();\n ctx.closePath();\n }\n\n // draw the planet\n let rad = radius_of_planet(system['planets'][i])*zoom;\n // load image for different types\n if (system['planets'][i]['type'] === 'Dwarf'){\n ctx.drawImage(img_planet_dwarf, system['planets'][i]['x'] - rad, system['planets'][i]['y'] - rad, 2*rad, 2*rad);\n } else if (system['planets'][i]['type'] === 'Terrestrial'){\n ctx.drawImage(img_planet_terr, system['planets'][i]['x'] - rad, system['planets'][i]['y'] - rad, 2*rad, 2*rad);\n } else {\n ctx.drawImage(img_planet_gasg, system['planets'][i]['x'] - rad, system['planets'][i]['y'] - rad, 2*rad, 2*rad);\n }\n\n // to tint, draw a circle over the planet with lower fill alpha\n ctx.globalAlpha = FILL_ALPHA;\n ctx.fillStyle = system['planets'][i]['colors'][0];\n ctx.beginPath();\n ctx.arc(system['planets'][i]['x'], system['planets'][i]['y'], rad, 0, 2*Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.globalAlpha = 1.0;\n }\n }\n}", "function TextureUvs()\n{\n this.x0 = 0;\n this.y0 = 0;\n\n this.x1 = 1;\n this.y1 = 0;\n\n this.x2 = 1;\n this.y2 = 1;\n\n this.x3 = 0;\n this.y3 = 1;\n}", "function init() {\n var floor = {\n positions: [\n vec3(-2, -1, -1),\n vec3(2, -1, -1),\n vec3(2, -1, -5),\n vec3(-2, -1, -1),\n vec3(2, -1, -5),\n vec3(-2, -1, -5)\n ],\n textureCoords: [\n vec2(0, 0),\n vec2(1, 0),\n vec2(1, 1),\n vec2(0, 0),\n vec2(1, 1),\n vec2(0, 1)\n ],\n normals: [\n vec3(0, 1, 0),\n vec3(0, 1, 0),\n vec3(0, 1, 0),\n vec3(0, 1, 0),\n vec3(0, 1, 0),\n vec3(0, 1, 0)\n ]\n };\n \n var at = vec3(0, 0, -3);\n var eye = vec3(4, 4, 0);\n var up = vec3(0, 1, 0);\n var fovy = 45;\n var aspect = canvas.width / canvas.height;\n var near = 0.1;\n var far = 30;\n var light = vec3(0.0, 2.0, -2.0);\n \n var viewMatrix = lookAt(eye, at, up);\n var aboveViewMatrix = lookAt(vec3(1, 6, -3), at, up);\n // viewMatrix = aboveViewMatrix;\n var projectionMatrix = perspective(fovy, aspect, near, far);\n var shadowProjectionMatrix = mat4();\n shadowProjectionMatrix[3][3] = 0;\n shadowProjectionMatrix[3][1] = -1/light[1];\n \n var teapotFile = loadFileAJAX('teapot.obj');\n var teapot = new OBJDoc('teapot.obj');\n teapot.parse(teapotFile, 0.25, false);\n\n var positions = [].concat(floor.positions);\n var textureCoords = [].concat(floor.textureCoords);\n var normals = new Array(6).fill(vec3(0, 0, 0));\n \n for (var i = 0; i < teapot.objects[0].faces.length; i++) {\n var face = teapot.objects[0].faces[i];\n for (var j = 0; j < 3; j++) {\n var vertex = teapot.vertices[face.vIndices[j]];\n var normal = teapot.normals[face.nIndices[j]];\n positions.push(vec3(vertex.x, vertex.y, vertex.z));\n normals.push(vec3(normal.x, normal.y, normal.z));\n textureCoords.push(vec3(0, 0, 0));\n }\n }\n\n var gl = WebGLUtils.setupWebGL(canvas);\n gl.clearColor(0.3921, 0.5843, 0.9294, 1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.BLEND);\n gl.blendEquation(gl.FUNC_ADD);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n var phongProgram = initShaders(gl, '/week8/phong1.vert', '/week8/phong1.frag');\n var program = initShaders(gl, '/week8/part1.vert', '/week8/part1.frag');\n\n // Setup shader and buffer data\n gl.useProgram(program);\n var programInfo = {\n a_position: {\n location: gl.getAttribLocation(program, 'a_position'),\n buffer: gl.createBuffer()\n },\n a_textureCoords: {\n location: gl.getAttribLocation(program, 'a_textureCoords'),\n buffer: gl.createBuffer()\n },\n u_modelView: gl.getUniformLocation(program, 'u_modelView'),\n u_projection: gl.getUniformLocation(program, 'u_projection'),\n u_texture: gl.getUniformLocation(program, 'u_texture')\n };\n\n gl.bindBuffer(gl.ARRAY_BUFFER, programInfo.a_position.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(positions), gl.STATIC_DRAW);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, programInfo.a_textureCoords.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(textureCoords), gl.STATIC_DRAW);\n \n // SETUP AND BUFFER PHONG SHADER \n gl.useProgram(phongProgram);\n \n var phongInfo = {\n a_position_model: {\n location: gl.getAttribLocation(phongProgram, 'a_position_model'),\n buffer: gl.createBuffer()\n },\n a_normal_model: {\n location: gl.getAttribLocation(phongProgram, 'a_normal_model'),\n buffer: gl.createBuffer()\n },\n u_modelView: gl.getUniformLocation(phongProgram, 'u_modelView'),\n u_projection: gl.getUniformLocation(phongProgram, 'u_projection'),\n u_normal: gl.getUniformLocation(phongProgram, 'u_normal'),\n u_light_world: gl.getUniformLocation(phongProgram, 'u_light_world')\n }\n \n gl.bindBuffer(gl.ARRAY_BUFFER, phongInfo.a_position_model.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(positions), gl.STATIC_DRAW);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, phongInfo.a_normal_model.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(normals), gl.STATIC_DRAW);\n \n gl.uniformMatrix4fv(phongInfo.u_projection, false, flatten(projectionMatrix));\n\n gl.useProgram(program);\n createTextures(gl, groundImage);\n gl.uniformMatrix4fv(programInfo.u_projection, false, flatten(projectionMatrix));\n \n var moveTeapot = true;\n var moveLight = true;\n var phi = 0;\n var theta = 0;\n \n toggleTeapotButton.addEventListener('click', function() {\n moveTeapot = !moveTeapot;\n });\n \n toggleQuadsButton.addEventListener('click', function() {\n moveLight = !moveLight;\n });\n \n requestAnimationFrame(function render() {\n phi += moveTeapot ? 0.02 : 0;\n theta += moveLight ? 0.01 : 0;\n \n light[0] = Math.sin(theta)*2;\n light[2] = Math.cos(theta)*2 - 2;\n \n var teapotModelMatrix = translate(0, - 0.75 - 0.25 * Math.sin(phi), -3);\n var teapotModelViewMatrix = mult(viewMatrix, teapotModelMatrix);\n \n var shadowMatrix = mult(viewMatrix, translate(light[0], light[1] - 1.001, light[2]));\n shadowMatrix = mult(shadowMatrix, shadowProjectionMatrix);\n shadowMatrix = mult(shadowMatrix, translate(-light[0], -(light[1] - 1.001), -light[2]));\n shadowMatrix = mult(shadowMatrix, teapotModelMatrix);\n \n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n \n gl.useProgram(program);\n enableProgram(gl, programInfo);\n gl.depthFunc(gl.LESS);\n gl.uniformMatrix4fv(programInfo.u_modelView, false, flatten(viewMatrix));\n \n gl.uniform1i(programInfo.u_texture, 0);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n \n gl.depthFunc(gl.GREATER);\n gl.uniformMatrix4fv(programInfo.u_modelView, false, flatten(shadowMatrix));\n gl.uniform1i(programInfo.u_texture, 2);\n gl.drawArrays(gl.TRIANGLES, 6, positions.length - 6);\n \n gl.depthFunc(gl.LESS);\n gl.useProgram(phongProgram);\n enablePhongProgram(gl, phongInfo);\n gl.uniformMatrix4fv(phongInfo.u_modelView, false, flatten(teapotModelViewMatrix));\n gl.uniformMatrix4fv(phongInfo.u_normal, false, flatten(transpose(inverse4(teapotModelViewMatrix))));\n gl.uniform3fv(phongInfo.u_light_world, flatten(light));\n \n gl.drawArrays(gl.TRIANGLES, 6, positions.length - 6);\n \n requestAnimationFrame(render);\n })\n\n\n}", "createPlanes (planes, colours = null) {\n const positionBuffer = gl.createBuffer()\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer)\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Float32Array([].concat(...planes)),\n gl.STATIC_DRAW\n )\n\n let colourBuffer, textureCoordBuffer\n if (colours) {\n colours = colours.map(c => [...c.map(ch => ch / 255), 1])\n const colourTable = []\n for (const colour of colours) {\n // Four times for each vertex of face\n colourTable.push(...colour, ...colour, ...colour, ...colour)\n }\n\n colourBuffer = gl.createBuffer()\n gl.bindBuffer(gl.ARRAY_BUFFER, colourBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colourTable), gl.STATIC_DRAW)\n } else {\n const textureCoordinates = []\n for (let i = 0; i < planes.length; i++) {\n textureCoordinates.push(0, 0, 1, 0, 1, 1, 0, 1)\n }\n\n textureCoordBuffer = gl.createBuffer()\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates), gl.STATIC_DRAW)\n }\n\n const indices = []\n for (let i = 0; i < planes.length; i++) {\n indices.push(i * 4, i * 4 + 1, i * 4 + 2)\n indices.push(i * 4, i * 4 + 3, i * 4 + 2)\n }\n\n const indexBuffer = gl.createBuffer()\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer)\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW)\n\n return {\n position: positionBuffer,\n colour: colourBuffer,\n textureCoord: textureCoordBuffer,\n indices: indexBuffer,\n vertexCount: indices.length\n }\n }", "_createUByteTexture() {\n let gl = this.context.context;\n\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // No Need to pad\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n // TODO: PAdding\n\n // clamp to edge to support non-power of two textures\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n // don't interpolate when getting data from texture\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // we're done with setup, so unbind current texture\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n return texture;\n }" ]
[ "0.6824247", "0.68157905", "0.6758097", "0.67094475", "0.6596511", "0.6484472", "0.6419287", "0.63978904", "0.6377019", "0.63676596", "0.63548845", "0.6346432", "0.63142586", "0.62737244", "0.6256454", "0.62202555", "0.6203168", "0.61902535", "0.6177953", "0.6170509", "0.6165835", "0.61580807", "0.61466444", "0.6138436", "0.61380523", "0.6134333", "0.6133364", "0.6132247", "0.613094", "0.61262476", "0.6117122", "0.61099404", "0.60831696", "0.60825294", "0.6074187", "0.60690737", "0.6067709", "0.60623544", "0.60570145", "0.6050355", "0.6040668", "0.6039374", "0.6031055", "0.60237056", "0.6019857", "0.6017086", "0.6013229", "0.6012364", "0.60112613", "0.6002151", "0.60008264", "0.60007656", "0.59933466", "0.59905297", "0.599046", "0.59904176", "0.59799725", "0.5970021", "0.5965857", "0.5956964", "0.59551615", "0.5953804", "0.5952365", "0.5949554", "0.59470266", "0.5942762", "0.59352404", "0.5932119", "0.59301615", "0.5923458", "0.59231097", "0.59204286", "0.59176785", "0.5913595", "0.5905635", "0.59054095", "0.59053403", "0.59003127", "0.58990896", "0.5890562", "0.5889466", "0.5883386", "0.5881593", "0.58810693", "0.5873202", "0.58667225", "0.5857165", "0.5853235", "0.5850304", "0.5848109", "0.584396", "0.58429086", "0.5832781", "0.5832681", "0.582698", "0.582344", "0.5819047", "0.58181137", "0.58097005", "0.58088654", "0.58059895" ]
0.0
-1
Counts the length of the chars.
function charCount(char_count, value, max_length) { const lng = value.length; const remainingLengthInPercentage = lng / max_length * 100; char_count.hide(); if (remainingLengthInPercentage > 80) { char_count.show(); char_count.html(lng + ' van de 100 maximale karakters') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function countChars(txt) {\n return txt.length;\n}", "get length() {\n // Assume that every newline is a keystroke, and that whitespace is stripped.\n const lines = this.code.split('\\n');\n const total_characters = lines.map(line => line.trim().length).reduce((a, b) => a + b);\n return total_characters + lines.length - 1;\n }", "function countChars(){\n\n}", "function charcount() {\n return writing_data().length;\n}", "function charCount(charCount) {\n // let length = charCount.length;\n // console.log(length);\n console.log(\"charCount is \" + charCount.length);\n}", "function numChars(str1){\n return str1.length\n}", "function numberofCharacters(input) {\n const num = input.length\n console.log( input + \" \" + \"has\" + \" \" + num + \" \" + \"characters\");\n}", "function count(input) {\n var numberChar = input.length;\n return numberChar;\n}", "function sc_stringLength(s) { return s.length; }", "function count(str) {\n return str.length;\n}", "function subLength(str,char)\n{\n let charcount=0;\n let len=-1;\n for(let i=0;i<=str.length;i++)\n {\n if( str[i]===char)\n {\n charcount++;\n \n } \n \n }\n \n return charcount;\n \n}", "function charCount() {\n\n\tif (this.about_me.value.length <= 140) {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p>' + this.about_me.value.length + '</p>';\n\t} else {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p style=\"color:red;\">' + (140 - this.about_me.value.length) + '</p>';\n\t}\n\n\n}", "function letterCounter (x) {\n\t return x.replace(/[^a-zA-Z]/g, '').length;\n\t}", "get characterSize() {}", "function totalLetters (string) {\n var length=0;\n for (var i=0; i < string.length; i++){\n length = length + string[i].length;\n }\n console.log(length);\n}", "function countChars(strText,charToCount)\r\n\t{\r\n\t\tvar intStartingPosition = 0;\r\n\t\tvar intFoundPosition =0;\r\n\t\tvar intCount = 0;\r\n\t\t\r\n\t\t// checking for the null character\t\r\n\t\tif (charToCount==\"\")\r\n\t\t{\r\n\t\t\treturn intCount;\r\n\t\t}\t\r\n\t\twhile((intFoundPosition=strText.indexOf(charToCount,intStartingPosition)) >= 0)\r\n\t\t{\r\n\t\t\tintCount++;\r\n\t\t\tintStartingPosition = intFoundPosition + 1;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn intCount ;\r\n\t}", "function numeroCaracteres(texto) {\n return texto.length;\n}", "function countChar(s, c){\n let counter = 0; \n for(let a=0; a<=s.length; a++){\n if(s[a] === c){\n counter++; \n }\n }\n return counter; \n}", "function countChars(elm) {\n if (elm.nodeType == 3) { // TEXT_NODE\n return elm.nodeValue.length;\n }\n var count = 0;\n for (var i = 0, child; child = elm.childNodes[i]; i++) {\n count += countChars(child);\n }\n return count;\n}", "function length(str) {\n return str.length;\n }", "function getCount(str) {\n // regex:\n // 'g' tells to find all matches, not just the first.\n // 'i' tells to be case insensitive.\n // What goes inside the '//'' is the pattern.\n // '[]'' tells to match any character in a set.\n // 'aeiou' are the characters in the set.\n // because of the '^' the replace function removes everything that is NOT within the\n // regex statement\n // without it, the replace function would replace all of the vowels and return only\n // the other characters\n return str.replace(/[^aeiou]/gi, '')\n // then count the length of the remaining string\n .length;\n}", "function length(str) {\n\treturn str.length;\n}", "function countChars(str, char) {\n count = 0;\nfor (var i = 0; i <= str.length - 1; i++) {\n if (str[i] === char) {\n count++;\n}\n}\nreturn count;\n}", "function length(str) {\n return str.length;\n}", "function RunLength(str) {\n var letter = str.charAt(0);\n var count = 0;\n var result = '';\n str.split('').forEach(function(c) {\n if (c == letter)\n count++;\n else {\n result += count + letter;\n letter = c;\n count = 1;\n }\n });\n result += count + letter;\n return result;\n}", "function countCharacters(s) {\n return s.ranges.reduce((count, [from,to]) => {\n return count + (to - from);\n }, 0);\n}", "function myAlphabetLength(){\nconsole.log(myAlphabet.length);\n}", "function stringCount(str) {\n return str.length\n}", "function initCharCount() {\n var countChars = function(el, cc) {\n var $el = $(el),\n val = $el.val(),\n max = parseInt(cc.attr('data-maxlength'), 10),\n left = max - val.length,\n cc_parent = cc.parent();\n // L10n: {0} is the number of characters left.\n cc.html(format(ngettext('<b>{0}</b> character left.',\n '<b>{0}</b> characters left.', left), [left]))\n .toggleClass('error', left < 0);\n if(left >= 0 && cc_parent.hasClass('error')) {\n cc_parent.removeClass('error');\n }\n };\n $('.char-count').each(function() {\n var $cc = $(this),\n $form = $(this).closest('form'),\n $el;\n if ($cc.attr('data-for-startswith') !== undefined) {\n $el = $('textarea[id^=\"' + $cc.attr('data-for-startswith') + '\"]:visible', $form);\n } else {\n $el = $('textarea#' + $cc.attr('data-for'), $form);\n }\n $el.bind('keyup blur', _.throttle(function() {\n countChars(this, $cc);\n }, 250)).trigger('blur');\n });\n }", "function countCharacters(words, chars) {\n let counter = 0\n let current = \"\"\n for(let i=0; i<words.length; i++){\n let copy = chars\n for(let j=0; j<words[i].length; j++){\n if(copy.includes(words[i][j])){\n current += words[i][j]\n copy = copy.replace(words[i][j], \"\")\n }\n }\n if(current === words[i]){\n counter += current.length\n current = \"\"\n } else {\n current = \"\"\n }\n }\n return counter\n}", "function count(inputco) {\n return inputco.length;\n}", "function totalLetterCount(array) {\n return array.length;\n }", "function Len() {\r\n}", "function countChar(val) {\t\t\t\t\t\n var tlen = val.value.length;\n\t\tif(tlen > 459)\n\t\t{\n\t\t\tvar text = $('textarea').val();\n\t\t\tvar subst = text.substring(0,459);\n\t\t\talert('Text message length could not exceed 459 character');\n\t\t\t$('textarea').val(subst);\t\t\t\n\t\t}\n\t\tvar len = val.value.length;\n\t\tif(len > 160)\n\t\t{\n\t\tvar div = len / 153;\n\t\t}else if(len <= 160)\n\t\t{\n\t\tvar div = 1;\n\t\t}\t\t\n\t\tvar no = Math.ceil(div);\n\t\t//$('#cred_count').val(no);\n\t\t$('#char_count').text('This will use '+no+' credit!');\n }", "function countLettersAndDigits(input) {\n //I first set const for a pattern using regexp (regular expression)\n const patt = /[0-9]|[a-z]|[A-Z]/g;\n //use the match function to find all letters and digits and count the length.\n return (input.match(patt)||[]).length;\n }", "function countChar(val){\n\t\tvar len = val.value.length;\n\t\tif (len >= 600) {\n\t\t\tval.value = val.value.substring(0, 600);\n\t\t}else {\n\t\t\t$('#charNum').text(600 - len);\n\t\t}\n\t}", "function length (string){\n\treturn string.length;\n}", "function countChars(str, char) {\n var numOfChar = 0;\n\n for (var i = 0; i < str.length; i++) {\n if (str[i] === char)\n numOfChar += 1;\n\n }\n return numOfChar;\n }", "function countChars(str,char){\n\tvar count =0\n\twhile(str !=\"\"){\n if(str[0] === char){\n \tcount++;\n }\n str = str.slice(1);\n }\n return count\n }", "function getlength(word) {return word.length }", "function stringLength(str){\nvar result =0;\nwhile(str != \"\"){\n\n \tresult+=1;\n str= str.slice(1);\n}\n \n return result;\n \n }", "function length(val) {\n return val.toString().length;\n}", "function length(val) {\n return val.toString().length;\n}", "function length(val) {\n return val.toString().length;\n}", "function Count(str, c) {\n var counts = 0;\n for (var _i = 0, str_1 = str; _i < str_1.length; _i++) {\n var chr = str_1[_i];\n if (chr == c) {\n counts = counts + 1;\n }\n }\n return counts;\n }", "function clickEventChar() {\n var charValue = textValue().trim();\n var charLength = charValue.length;\n //return length of string for chars\n return charLength;\n}", "function wordCount(data) {\n\t\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\t\tvar m = data.match(pattern);\n\t\tvar count = 0;\n\t\tif(m === null) return count;\n\t\tfor(var i = 0; i < m.length; i++) {\n\t\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\t\tcount += m[i].length;\n\t\t\t} else {\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "function fancyCount(str){\n return Array.from(str.split(/[\\ufe00-\\ufe0f]/).join(\"\")).length;\n }", "function countChar() {\n var countDisplay = document.querySelector(\"#charCount span\");\n countDisplay.innerText = textArea.value.length;\n\n if (textArea.value.length >= 25 && textArea.value.length <= 45) {\n textArea.classList.add(\"input-warning\");\n document.querySelector(\"#charCount\").setAttribute(\"color\", \"#DD8913\");\n countOK = false;\n\n }else if (textArea.value.length == 49) {\n textArea.classList.add(\"input-error\");\n document.querySelector(\"#charCount\").setAttribute(\"color\", \"#DD8913\");\n countOK = false;\n\n }else {\n textArea.classList.replace(\"input-error\", \"input-success\");\n document.querySelector(\"#charCount\").removeAttribute(\"color\");\n countOK = true;\n }\n}", "function wordCount(data) {\n\t\t\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\t\t\tvar m = data.match(pattern);\n\t\t\tvar count = 0;\n\t\t\tif(m === null) return count;\n\t\t\tfor(var i = 0; i < m.length; i++) {\n\t\t\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\t\t\tcount += m[i].length;\n\t\t\t\t} else {\n\t\t\t\t\tcount += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t}", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u00A0-\\u02AF\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if (m === null) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u00A0-\\u02AF\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if (m === null) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function textWidth(text) {\n\tif (!text){\n\t\treturn 0;\n\t}\n\tlen = 0;\n\tfor(i=0; i<text.length;i++) {\n\t\tlen += text.charCodeAt(i) < 128 ? 1 : 2;\n\t}\n\treturn len;\n}", "function countCharacters(script){\n return reduce(script.ranges, (count, [from, to])=>{\n return count + (to-from);\n }, 0);\n}", "get length() {}", "get length() {}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u0392-\\u03c9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if( m === null ) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function smsLengthCounter() {\n var textarea = $('textarea[name=\"gwapi[message]\"]');\n if (!textarea.length) return;\n\n var countEl = $('<div class=\"sms-length-counter\">').insertAfter(textarea);\n\n function doCount() {\n var chars = textarea.val().length;\n var regex_matches = textarea.val().match(/[\\^{}\\\\~€|\\[\\]]/gm) || [];\n chars += regex_matches.length;\n var split = chars <= 160 ? 160 : 153;\n\n var smses = Math.ceil(chars / split);\n if (smses == 0) smses = 1;\n\n var charsText = chars == 1 ? textarea.data('counter-i18n').character : textarea.data('counter-i18n').characters;\n var smsText = smses == 1 ? textarea.data('counter-i18n').sms : textarea.data('counter-i18n').smses;\n\n countEl.text(chars + ' '+charsText+' (' + smses + ' '+smsText+')');\n }\n\n textarea.keyup(doCount);\n doCount();\n }", "function getLength(input){\n return input.length;\n}", "function countCharsArray() {\n let array = ['a', 'a', 'b', 'b', 'c', 'd', 'a'];\n let count = 0;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] === 'a') count++;\n }\n\n return count;\n}", "function countChar(string, theChar) {\r\n\tvar total = 0;\r\n\r\n\tfor (var i = 0; i < string.length; ++i) {\r\n\t\tif (string.charAt(i) === theChar) {\r\n\t\t\t++total;\r\n\t\t}\r\n\t}\r\n\r\n\treturn total;\r\n}", "function count(str,char) {\n\tvar re = new RegExp(char,\"gi\");\n\treturn (str.match(re) || []).length;\n}", "function len() {\n var H = \"The length of the string in this varible will display on screen\";\n var L = H.length\n document.getElementById(\"len\").innerHTML = L;\n}", "function Len(s) {\n if (!s || s == undefined) {\n return 0;\n }\n else {\n return s.length;\n }\n }", "function getCount(str) {\n return str.toLowerCase().split('').filter(function(char) {\n return char == 'a' || char == 'e' || char == 'i' || char == 'o' || char == 'u';\n }).length;\n}", "function length(string) {\n // YOUR CODE BELOW HERE //\n \n // The .length property accesses the number of characters in a given string.\n // This is how we decipher the length of a string.\n return string.length; // When the length function is called the given argument's length will be returned.\n\n // YOUR CODE ABOVE HERE //\n}", "function getLength(str) {\n return str.length;\n}", "function getLength(str) {\n return str.length;\n}", "function getLength(str) {\n return str.length;\n}", "function updateCharCount(input){\n var characters_left = 160 - input.val().length;\n $('#character-count').text(characters_left);\n }", "function getLength (str) {\n return str.length;\n}", "get remainingCharCount() {\n\t\treturn (this.state.sourceEnd - this.state.sourcePosition);\n\t}", "function counttext()\n{\n consoletext.innerHTML=textarea.textLength;\n}", "function countChar(string){\n var counts = {}; //1\n var currChar, currCharCount; //1\n for (var i = 0; i < string.length; i++){ // n\n currChar = string[i]; // 1\n currCharCount = 1; // 1\n for (var j = i+1; j < string.length; j++){ // n - j\n if (currChar === string[j]){ //1\n currCharCount++; //1\n }\n }\n if (!counts.hasOwnProperty(currChar)){ // 1\n counts[currChar] = currCharCount; //1\n }\n }\n return counts; //1\n}", "function fancyCount(str){\n return Array.from(str.split(/[\\ufe00-\\ufe0f]/).join(\"\")).length;\n}", "function count (instructions) {\n let total = 0\n let i = 0\n\n while (i < instructions.length) {\n const instruction = instructions[i]\n // console.log(instruction)\n\n if (instruction.type === 'CHAR') {\n // consume the char, adding 1 to the total\n total++\n i++\n } else {\n // consume the marker, which adds nothing to the total\n i++\n\n // group the instructions that are repeated by this marker\n let consumed = 0\n let group = []\n\n while (consumed < instruction.span) {\n const next = instructions[i++]\n group.push(next)\n consumed += next.strLength\n }\n\n total += (instruction.repeats * count(group))\n }\n }\n\n return total\n}", "function _lineLength(str) {\n // The number of actual characters counted.\n var ct = 0;\n // Whether we are inside a color sequence.\n var inSeq = false;\n\n for (var i = 0; i < str.length; i++) {\n if (str[i] === '\\x1B') {\n inSeq = true;\n } else if (inSeq) {\n if (str[i] === 'm') {\n inSeq = false;\n }\n } else {\n ct++;\n }\n }\n\n return ct;\n}", "function getNumberOfCharacters(){\n\treturn ((2+parseInt((marioGame.nLevel+1)/2,10))>8 ? 9 : (2+parseInt((marioGame.nLevel+1)/2,10)));\n}", "function countCharacters(newName) {\n if (!newName) {\n return 0;\n }\n\n var totalCount = 0, code, len = newName.length;\n for (var i = 0; i < len; i++) {\n code = newName.charCodeAt(i);\n if (code >= 0x0 && code <= 0x7f) {\n totalCount++;\n } else if (code <= 0x7ff) {\n totalCount += 2;\n } else if (code <= 0xffff) {\n totalCount += 3;\n }\n }\n\n console.log('lxp:: File Manager totalCount = ' + totalCount);\n return totalCount;\n}", "function countChar(x, y){\n\tvar count = 0;\n\tfor(let i = 0; i < x.length; i++){\n\t\tif(x[i] === y) count++; \n\t} \n\treturn count;\n}", "function getLength(text) {\n var result = text.length;\n return result;\n}", "function getLength(string){\n return string.length;\n}", "function twoChars() {\n var str = getName();\n var i = 0;\n var count = 0;\n for (i = 0; i < str.length; i++) {\n if ((str[i] >= \"a\" && str[i] <= \"z\") || (str[i] >= \"A\" && str[i] <= \"Z\")) {\n count++;\n }\n }\n return count;\n}", "getTotalCharacterCount() {\n var c = 0;\n for (var server in this.servers)\n if (\n this.servers[server].stats &&\n !isNaN(this.servers[server].stats.characterCount) &&\n typeof this.servers[server].stats.characterCount == 'number'\n )\n c += this.servers[server].stats.characterCount;\n return c;\n }", "function countChar(word, letter) {\n var chars = 0;\n for (var i = 0; i < word.length - 1; i++) {\n if (word[i] == letter) {\n chars += 1;\n }\n }\n return chars;\n}", "function getCount(str) {\n let vowelsCount = 0;\n for (current_char of str) {\n if (current_char === 'a' | current_char === 'e' | current_char === 'i' | current_char === 'o' | current_char === 'u') {\n vowelsCount++;\n }\n }\n return vowelsCount;\n }", "function stringLength() {\n var a = \"Super Nova Girl\";\n var n = a.length; //assigns the number of characters of variable 'a' to variable 'n'\n document.getElementById(\"length\").innerHTML = n;\n}", "getCharacterCount() {\n console.warn('[tiptap warn]: \"editor.getCharacterCount()\" is deprecated. Please use \"editor.storage.characterCount.characters()\" instead.');\n return this.state.doc.content.size - 2;\n }" ]
[ "0.7814583", "0.7814583", "0.7814583", "0.7814583", "0.7699608", "0.7699608", "0.7699608", "0.7699608", "0.7699608", "0.7654744", "0.7489463", "0.7466491", "0.7422657", "0.7316714", "0.70430076", "0.69747096", "0.6937205", "0.6907629", "0.690308", "0.6806129", "0.6802802", "0.6782915", "0.67800504", "0.674643", "0.66589254", "0.66173244", "0.6589449", "0.65579706", "0.6535048", "0.65300834", "0.6518242", "0.6512192", "0.6487614", "0.6460463", "0.64526755", "0.6430531", "0.64187425", "0.6412361", "0.6403247", "0.63980323", "0.63829744", "0.63817835", "0.6364813", "0.6357638", "0.6355124", "0.63446075", "0.63378084", "0.6329407", "0.63286257", "0.63191277", "0.6306682", "0.6306682", "0.6306682", "0.62809294", "0.6280771", "0.6276511", "0.62761676", "0.6255484", "0.625228", "0.62489986", "0.62489986", "0.62466085", "0.62446314", "0.6243347", "0.6243347", "0.62319225", "0.62319225", "0.62319225", "0.62294626", "0.62270784", "0.62194115", "0.6214655", "0.6211796", "0.6208719", "0.6207741", "0.62076163", "0.6206423", "0.61884344", "0.6187667", "0.6186722", "0.6186722", "0.6186722", "0.6153354", "0.6133091", "0.61283606", "0.61269367", "0.6125973", "0.6124956", "0.6123015", "0.6121945", "0.6114645", "0.610935", "0.61088526", "0.61056626", "0.61044437", "0.61022", "0.6099483", "0.6093316", "0.60799396", "0.6065264", "0.60577226" ]
0.0
-1
Checks if the passwords are equal.
function checkPasswordMatch() { const password = $("#password").val(); const confirmPassword = $("#password2").val(); const feedback = $("#divCheckPasswordMatch"); if (password !== confirmPassword) { feedback.html("Wachtwoorden zijn niet gelijk!").removeClass('text-success').addClass('text-danger'); return; } feedback.html("Wachtwoorden zijn gelijk.").removeClass('text-danger').addClass('text-success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPasswordsMatch() {\n\tif (password.value !== confirmPassword.value) {\n\t\tshowError(confirmPassword, 'Passwords do not match')\n\t}\n}", "function comparePassword() {\n\t\tvar newPassword = $(\"#txtNewPassword\").val();\n\t\tvar newPasswordConfirm = $(\"#txtNewPasswordConfirm\").val();\n\t\t// compare\n\t\tif (newPassword == newPasswordConfirm) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkPasswordMatch() {\n var password = $(\"#password-input\").val();\n var confirmPassword = $(\"#password-check\").val();\n \n if (password !== confirmPassword){\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n }\n else{\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }\n }", "function checkPasswordMatch() {\n var password = $(\"#password\").val();\n var confirmPassword = $(\"#confirmPassword\").val();\n \n if (password != confirmPassword)\n $(\"#divCheckPasswordMatch\").html(\"Passwords do not match!\");\n else\n $(\"#divCheckPasswordMatch\").html(\"Passwords match.\");\n }", "function passEquals(pw) {\n\treturn pw !== \"password\";\n}", "function comparePasswords() {\n var validPassword = false;\n if ($scope.newUser.password === $scope.newUser.password) {\n validPassword = true;\n } else {\n validPassword = false;\n }\n return validPassword;\n }", "isSamePassword(currentPassword, newPassword) {\n return currentPassword === newPassword;\n }", "checkPwd() {\n const pwd = document.getElementById('newPwd').value,\n rpt = document.getElementById('repeatPwd').value;\n\n if (pwd !== rpt) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "passwordsMatch(passOne, passTwo) {\n return passOne === passTwo;\n }", "function passwordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Paswords do not match\");\n }\n}", "function checkPasswordMatch(input1, input2) {\n\tif (input1.value !== input2.value) {\n\t\tshowError(input2, 'Passwords do not match');\n\t}\n}", "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Passwords do not match');\n }\n}", "async comparePasswords(saved, supplied){\n const [hashed, salt] = saved.split('.');\n const hashedSupplied = await scrypt(supplied,salt, 64);\n\n return hashed === hashedSupplied.toString('hex');\n }", "function passwordMatch(password) {\n return password === admin.password;\n}", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "checkPassword(password) {\n return password === this.password;\n }", "function checkMatch() {\n var pw1 = $(\"#inputPassword2\").val();\n var pw2 = $(\"#inputPassword3\").val();\n //Update HTML to show user information.\n if (pw1 === pw2) {\n $(\"#match\").html(\"Passwords: Match\");\n } else {\n $(\"#match\").html(\"Passwords: Don't Match\");\n }\n }", "function matchingPasswords(){\n if(createRetypePassword == createPassword){\n return true;\n }else{\n return false;\n }\n}", "function checkPasswordMatch(password, password2) {\r\n\r\n if (password.value !== password2.value) {\r\n showError(password2, `Passwords do not match`)\r\n };\r\n}", "function checkPasswords(input1, input2){\n if(input1.value !== input2.value){\n error(input2, \"Passwords are not matching!\");\n }\n}", "function valid_password_verify(pwd1, pwd2){\n\tif (pwd1 != pwd2){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkPassword() {\n\tvar item1 = document.getElementById(\"pwd1\").value;\n\tvar item2 = document.getElementById(\"pwd2\").value;\n var isSame = true;\n var isBig = true;\n\tvar numCount = 0;\n\tvar charCount = 0;\n\tif (item1.length != item2.length) {\n isSame = false;\n }\n if (item1.length < 7) {\n isBig = false;\n }\n \n\tfor (var i = 0; i < item1.length; i++) {\n\t\tif (item1.charAt(i) != item2.charAt(i)) {\n\t\t\tisSame = false;\n }\n \n\t\tif (isNaN(item1.charAt(i))) { \n\t\t\tcharCount++; \n\t\t} else { \n\t\t\tnumCount++; \n\t\t}\n }\n\n if (numCount == 0 || charCount == 0 || !isBig) {\n isBig = false;\n } else {\n isBig = true;\n }\n \n\tif (!isSame) {\n document.getElementById('error').innerHTML = \"*Passwords not identical.<br/>\";\n\t}\t\n\telse {\n\t\tdocument.getElementById('error').innerHTML = \"\";\n }\n \n\tif (!isBig) {\n document.getElementById('error2').innerHTML = \"*Password needs to start with a letter and be 7-20 characters long with at least one number.<br/>\";\n\t}\n\telse {\n\t\tdocument.getElementById('error2').innerHTML = \"\";\n }\n // running into a problem where the innerHTML is not updating before the check and alerts.\n if (isBig && isSame) {\n return true;\n } else {\n return false;\n }\n}", "checkPassword(loginPw) {\n return bycrypt.compareSync(loginPw, this.password)\n }", "checkPassword(originalPwd){\n return bcrypt.compareSync(originalPwd, this.password);\n }", "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-danger'>Password Harus Sama</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', true);\n\t\t} else {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-danger\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-success\");\n\t\t\t$(\"#divCheckPasswordMatch\").html(\"<i><small class='text-success'>Password Cocok</small></i>\");\n\t\t\t$('#tbhUser').prop('disabled', false);\n\t\t}\n\t}", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}", "checkPasswordIntegrity(password, repeated_password) {\n if (password !== repeated_password) {\n throw new Error(\"Passwords are not the same\");\n } else {\n return true;\n }\n }", "function checknewpass(x,y,z)\n{\n\tlet pone=x;\n\tlet ptwo=y;\n\tlet locz=z;\n\tlet pwd1=$('#'+pone).val();\n\tlet pwd2=$('#'+ptwo).val();\n\n\tif (pwd1==\"\" || pwd2==\"\")\n\t{\n\t\treturn;\n\t}\n\n\tif (pwd1!=pwd2) \n\t{\n\t\t$('#'+locz).html(\"<b><center>Passwords do not match!</center></b>\");\n\n\t}\n\telse\n\t{\n\t\t$('#'+locz).html(\"\");\n\n\t}\n\n}", "function passwordsMatch() {\n if (register_password.value.length !== 0 && register_password_again.value.length !== 0) {\n if (register_password.value === register_password_again.value) {\n document.querySelector('.btn-register').disabled = false;\n document.querySelector('#passwords_match').classList.add('passwords-match')\n document.querySelector('#passwords_match').classList.remove('passwords-dont-match')\n document.querySelector('#passwords_match').innerHTML = 'Password match!'\n } else {\n document.querySelector('.btn-register').disabled = true;\n document.querySelector('#passwords_match').classList.add('passwords-dont-match')\n document.querySelector('#passwords_match').classList.remove('passwords-match')\n document.querySelector('#passwords_match').innerHTML = 'Passwords do not match.'\n };\n } else {\n document.querySelector('#passwords_match').innerHTML = ''\n };\n }", "compareNewPasswords() {\n if (this.state.newPassword !== this.state.confirmPassword) {\n return false;\n }\n return true;\n }", "function checkPasswordMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Password does not matches\")\n }\n\n}", "function validatePasswordMatch(password, confirmPassword, errors) {\n if (password !== confirmPassword) {\n errors.confirmPassword = \"Passwords must match.\";\n }\n}", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "function checkRepeatedPassword() {\n\t\tvar rptpsw=document.sform.rptpsw.value;\n\t\tvar intpsw=document.sform.psw.value;\n\t\tif (rptpsw!=intpsw){\n\t\t\talert(\"Passwords must match!\");\n\t\t\tdocument.sform.rptpsw.value=\"\";\n\t\t\tdocument.sform.rptpsw.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkNew(pw1, pw2, errors, app) {\n\tif (!app.validation.checkPassword(pw1) || !app.validation.checkPassword(pw2)) {\n\t\terrors.push(\"Password must be at least \"+\n\t\t\tapp.settings.PASSWORD_MIN_LEN+\" characters long.\")\n\t}\n\tif (pw1 != pw2) {\n\t\terrors.push(\"Passwords must match.\");\n\t}\n}", "function checkPasswords() {\n\n var field_new_pass = document.getElementById('new_password').value;\n var field_conf_new_pass = document.getElementById('conf_new_password').value;\n\n if(field_new_pass != field_conf_new_pass) {\n window.alert('Confirmation of password was failed');\n return false;\n }\n else if(field_new_pass != ''){\n window.alert('Success');\n }\n}", "function compare(pw1, pw2) {\n if (pw1 === pw2)\n return true\n else\n return false\n}", "function validatePasswords(){\r\n var password = document.getElementById(\"password\").value;\r\n var confirmPassword = document.getElementById(\"confirmpassword\").value;\r\n if (confirmPassword != password){\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"The passwords do not match.\";\r\n }\r\n else{\r\n document.getElementById(\"passwordsmatch\").innerHTML = \"\";\r\n }\r\n}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "compareOldPasswords() {\n if (this.state.oldPassword !== this.props.currentPassword) {\n return false;\n }\n return true;\n }", "function confirmPassword(p1, p2 ){ if (p1.value && p1.value !== p2.value) {\n password2Ok = 0;\n showError(p2, \"Both passwords must match.\")\n} else if (p1.value && p1.value === p2.value) {\n password2Ok = 1;\n showSuccess(p2)\n}\n}", "function confirm_password_validation(targetObjects){\r\n //console.log(targetObjects);\r\n if( $(targetObjects[0]).val()==$(targetObjects[1]).val() ){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function passwordMatchCheck(form) {\n password = form.password.value;\n passwordConfirm = form.passwordConfirm.value;\n\n if (password != passwordConfirm) {\n alert(\"\\nPassword did not match: Please try again...\");\n return false;\n } else {\n return true;\n }\n}", "function checkPasswords() {\n var pw = elements.password.value;\n var pw2 = elements.password2.value;\n if (pw == pw2 && pw != '') {\n\t$(elements.passwordCheckIcon).addClass('ok');\n\t$(elements.substep23).stop(true, true).animate({opacity: 1}, 500);\n\t$(elements.substep24).stop(true, true).animate({opacity: 1}, 500);\n\telements.retreiveSecretKeyButton.disabled = false;\n\telements.role.disabled = false;\n\telements.identity_function.disabled = false;\n } else {\n\t$(elements.passwordCheckIcon).removeClass('ok');\n\t$(elements.substep23).stop(true, true).animate({opacity: 0.2}, 500);\n\t$(elements.substep24).stop(true, true).animate({opacity: 0.2}, 500);\n\telements.retreiveSecretKeyButton.disabled = true;\n\telements.role.disabled = true;\n\telements.identity_function.disabled = true;\n }\n}", "function checkPasswordMatch(password,confirmPassword)\n{\n\tif (password != confirmPassword) {\n \treturn 'false';\n } else {\n return 'true';\n } \n}", "comparePassword(testPwd) {\n return bcrypt.compare(testPwd, this.password)\n }", "async isSame(password, encrypted_password){\n const returned_password = await bcrypt.compare(password, encrypted_password);\n return returned_password; \n }", "function checkPasswordMatch() {\n\tvar password1 = document.getElementById(\"passw\").value;\n\tvar password2 = document.getElementById(\"enterPassword\").value;\n\n\tif (password2 == \"\"){\n\n\t} else {\n\t\tif (password1 == password2) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Password does not match!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function checkPasswords() {\n var password = document.getElementById('InputPassword');\n var retypePassword = document.getElementById('InputPassword2');\n\n if (password.value != retypePassword.value) {\n showFeedBack(retypePassword.name,\"NoMatch\");\n if(retypePassword.value != \"\"){\n retypePassword.value = \"\";\n retypePassword.focus();\n }\n passwordError = true;\n } else {\n if(retypePassword.value != \"\"){\n showFeedBack(retypePassword.name,\"valid\");\n passwordError = false;\n }\n \n }\n \n }", "function checkPasswordsMatch(input1,input2){\n if(input1.value != input2.value)\n {\n showError(input2,\"Password don't match\");\n }\n\n}", "function checkMatch (inputPassword1, inputPassword2){\n if(inputPassword1.value === inputPassword2.value) {\n showSuccess(inputPassword1);\n } else {\n showError(inputPassword1, \"Not matching\");\n }\n}", "function passwordValid() {\n if (this.state.password.length === 0) {\n this.noPasswordEntered();\n return false;\n }\n else if (this.state.password !== this.state.confirmpassword) {\n this.nonSamePassword();\n return false;\n }\n else {\n this.samePassword();\n }\n\n return true;\n }", "function passwordEqual(form,newpass,confirmpass,newpasspan,confrmpasapan)\n{\n\tvar password = document.forms[form][newpass].value;\n\tvar confirmPassword = document.forms[form][confirmpass].value;\n\tvar passwordMismach = document.getElementById(\"passwordMismarch\");\n\n\t//checks if the two passwords march\n\tvar fPass = validatePassword(form,newpass,newpasspan);\n\tvar sPass = validatePassword(form,confirmpass,confrmpasapan);\n\n\tif (fPass&sPass)\n\t {\n\t \t//checks if the two passwords match\n\t \tif (confirmPassword==password) \n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"\";\n\t \t\treturn true;\n\t \t}\n\t \telse\n\t \t{\n\t \t\tpasswordMismach.innerHTML=\"password did not match\";\n\t \t\tdocument.forms[form][newpass].value=\"\";\n\t \t\tdocument.forms[form][confirmpass].value=\"\";\n\t \t}\n\t }\n\t else\n\t {\n\t \tpasswordMismach.innerHTML=\"\";\n\t }\n\t return false;\n}", "static async compare(storedPassword, suppliedPassword) {\n\t\tconst [hashedPassword, salt] = storedPassword.split(\".\");\n\t\tconst buf = await scryptAsync(suppliedPassword, salt, 64);\n\n\t\treturn hashedPassword === buf.toString(\"hex\");\n\t}", "function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equal)\n\t {\n\t \treturn true;\n\t }\n\t return false;\n}", "checkPassword(pass) {\n // Hash the password and then check against the hash for extra security :^), I, however, ain't doing that here.\n const SECRETS = require(\"../secrets.json\");\n return SECRETS.channelPassword === pass;\n }", "function validateCreds(username, password){\n\tlet sql = \"SELECT salt, password FROM appuser WHERE username=?;\";\n\tdb.get(sql, [username], (err, row) => {\n\t\tresult = {};\n\t\tif (err) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif (!row) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\thashedPass = combineHash(\"\" + row.salt, password);\n\t\t\t\tif (!(hashedPass == row.password)) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn true;\n}", "function checkPasswords(form){\n\tvar password = form.sign_up_password;\n\tvar repassword = form.re_sign_up_password;\n\t//console.log(\"password: \"+password.value+\", repassword: \"+repassword.value);//DEBUG\n\tif(password.value != repassword.value){\n\t\tpassword.setAttribute('class','input-text-error');\n\t\trepassword.setAttribute('class','input-text-error');\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkPassMatch() {\n if ($(\"#password-up-1\").val() == $(\"#password-up-2\").val()) {\n $(\"#password-up-2\")[0].setCustomValidity(\"\");\n } else {\n $(\"#password-up-2\")[0].setCustomValidity(\"Passwords must match\");\n }\n if ($(\"#password-up-1\").val() != \"\" && $(\"#password-up-2\").val() != \"\") {\n $(\"#sign-up-form\").addClass(\"was-validated\");\n }\n}", "function checkPassword() { \n if (checkedUpper) {\n var a = findCommonElement(passwordArray, upperCase) // compare to passwordArray\n } else {\n a = 'N/A';\n }\n if (checkedLower) {\n var b = findCommonElement(passwordArray, lowerCase) // compare to passwordArray\n } else {\n b = 'N/A';\n }\n if (checkedSpecial) {\n var c = findCommonElement(passwordArray, special) // compare to passwordArray\n } else {\n c = 'N/A';\n }\n if (checkedNumbers) {\n var d = findCommonElement(passwordArray, numbers) // compare to passwordArray\n } else {\n d = 'N/A';\n }\n if (!a || !b || !c || !d) {\n return false;\n } else {\n return true;\n }\n}", "function checkPw( index, in_pw ) {\n\tvar retrieved_pw = registeredUsers[index].password;\n\tif (bcrypt.compareSync(in_pw, retrieved_pw) === false ) {\n\t\tconsole.log(\"checkPw(): failed password comparison!\");\n\t\treturn false;\n\t} else {\n\t\tconsole.log(\"checkPw(): passed password comparison\");\n\t\treturn true;\n\t}\n}", "function checkPassword(password1, password2) {\n let errorLenght = false;\n let errorMatch = false;\n if (\n // Check length\n password1.match(/\\s+/) ||\n password1.trim().length < 4 ||\n password1.trim().lenght > 32\n ) {\n // Add message to error messages\n composeErrorMessage(\n \"Invalid Password - Must be longer than 4 characters and shorter than 32\"\n );\n errorLenght = true;\n }\n\n if (password1.trim() !== password2.trim()) {\n // Check if passwords match - if not\n // Add unmatch message\n composeErrorMessage(\"Passwords don't match\");\n errorMatch = true;\n }\n\n // If there is just one error than display it\n if (errorLenght || errorMatch) {\n displayErrorMessage(errorMessage);\n }\n return errorLenght || errorMatch;\n }", "passwordDoesMatch(thePassword) {\n const didMatch = bcrypt.compareSync(thePassword, this.pwhash);\n return didMatch;\n }", "passwordCheck(inputPassword) {\n return encrypt.compareSync(inputPassword, this.password);\n }", "isCorrectPassword(enteredPassword) {\n return User.encryptPassword(enteredPassword, this.salt) === this.password;\n }", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "checkPassword(loginPassword) {\n return bcrypt.compareSync(loginPassword, this.password);\n }", "function checkConfirmPassword() {\n var password = $modalPass.val();\n var confirmPassword = $modalConfirmPass.val();\n if (password !== confirmPassword) {\n $confirmPasswordError.html(\"Passwords Did Not Match\");\n $confirmPasswordError.show();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n confirmPasswordError = true;\n } else {\n $confirmPasswordError.hide();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "function confirmPass() {\n var pass = document.getElementById(\"pass1\").value\n var confPass = document.getElementById(\"pass2\").value\n if (pass != confPass) {\n alert('Wrong confirm password !');\n return false\n } else {\n return true;\n }\n}", "function validPassA(pw1,currpw) {\n if(pw1 === currpw) {\n return \"Password matches old password.\";\n }\n return \"\";\n}", "function verify()\r\n {\r\n var p=document.getElementById(\"password\").value;\r\n var vp=document.getElementById(\"vpassword\").value;\r\n if(p!=vp)\r\n {\r\n alert(\"Make sure passwords match\")\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "function validate_repeated_password()\n {\n const icon = DOM.repeated_new_password_validation_icon;\n const password = DOM.new_password_input.value;\n const repeated_password = DOM.repeated_new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (validate_password() &&\n repeated_password === password)\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function match_password(Element)\n\t\t{\n\t\t\n\t\t\tif($(Element).is(\"input:password\"))\n\t\t\t{\n\t\t\t\tif($(Element).attr(\"match\")!=null)\n\t\t\t\t{\n\t\t\t\t\tvar Match=\"#\"+$(Element).attr(\"match\");\n\t\t\t\t\tif($(Match).val()!=$(Element).val())\n\t\t\t\t\t{\n\t\t\t\t\t\tvar Message=\"Please enter the same password as above\";\n\t\t\t\t\t\tdisplay_msg(Element,Message,\"match\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplay_msg(Element,'',\"match\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "function assertEqual( checksum1, checksum2 ) {\n if ( checksum1.length !== checksum2.length || checksum1.length !== 4 ) {\n return false;\n }\n for ( var i = 0; i < checksum1.length; ++i ) {\n if ( checksum1[ i ] !== checksum2[ i ] ) return false;\n }\n return true;\n }", "function validateseniorForm(){\n\tif (document.getElementById(\"psw\").value!=document.getElementById(\"psw2\").value){\n\t\t\tbootbox.alert(\"Password and new password is different, They must be same.\");\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "checkPassword(loginPw) {\n return bcrypt.compareSync(loginPw, this.password);\n }", "passwordsMatch(password, confirm_password) {\n if(password !== confirm_password) {\n this.msg = '<div class=\"alert alert-danger\">Passwords do not match!</div>';\n this.checkError(this.msg);\n }\n }", "function checkPasswords(input1, input2) {\n if(input1.value === input2.value) {\n input2.className = 'success';\n input2.nextElementSibling.style.visibility = 'hidden';\n console.log('correct');\n }\n if(input1.value !== input2.value) {\n let error = `The passwords doesn't match!!`;\n showError(input2, error);\n }\n}", "function check()\n{\n\tvar pass1 = document.getElementById('pass');\n\tvar pass2 = document.getElementById('confirmpass');\n\tif(pass1.value != pass2.value)\n\t{\n\t\talert(\"Password Not Match\");\n\t\treturn false;\n\t}\n}", "function basicTests()\n{\n try\n {\n // Test password validation\n var failure = false;\n for(var i = 0; i < 10; i++)\n {\n var password = \"\"+i;\n var hash = PasswordStorage.createHash(password);\n var secondHash = PasswordStorage.createHash(password);\n if(hash===secondHash) {\n console.log(\"FAILURE: TWO HASHES ARE EQUAL!\");\n failure = true;\n }\n var wrongPassword = \"\"+(i+1);\n if(PasswordStorage.verifyPassword(wrongPassword, hash)) {\n console.log(\"FAILURE: WRONG PASSWORD ACCEPTED!\");\n failure = true;\n }\n if(!PasswordStorage.verifyPassword(password, hash)) {\n console.log(\"FAILURE: GOOD PASSWORD NOT ACCEPTED!\");\n failure = true;\n }\n }\n if(failure) {\n console.log(\"TESTS FAILED!\");\n return false;\n }\n }\n catch(error)\n {\n console.log(\"ERROR: \" + error);\n return false;\n }\n}", "function hasTwoPairs(newPassword) {\n let count = 0;\n\n for (let i = 0; i < newPassword.length; i++) {\n if (newPassword[i] === newPassword[i + 1]) {\n count++;\n i++; // to skip so a triple isn't considered two doubles\n }\n }\n\n return count === 2;\n}", "function checkPass() {\n var pass = \"\";\n $(opts['classname']).each(function(i){\n if (i == 0) {\n pass = $(this).val();\n } else {\n if ($(this).val() != pass) {\n if (opts['messages']['confirmation']) {\n errors.push (opts['messages']['confirmation']);\n } else {\n errors.push (opts['title'] + ' confirmation mismatch');\n }\n }\n }\n });\n }", "function validatePasswordMatch(password, confirmPassword) {\n if (password === confirmPassword) {\n return true;\n } else {\n return \"Password do not match!\"\n }\n}", "function idPassCheck(user, pw) {\n\treturn user !== pw;\n}", "function check_password(){\n //password same check\n var pwd = $('#user_pwd').val();\n var repwd = $('#user_repwd').val();\n\n if(pwd == \"\" && repwd == \"\")\n return false;\n\n if (pwd != repwd) {\n $('#errmsg').show();\n setTimeout(function() { $(\"#errmsg\").hide(); }, 5000);\n return true;\n } else\n return false;\n}", "function checkpw(inputpw,inputpwc){\n if(inputpw.value != inputpwc.value){\n document.getElementById(\"Password\").innerHTML = \"Please check passward you type in. The password is not equal to password confirm.\"+\"<br>\";\n inputpw.value = \"\";\n inputpwc.value = \"\";\n return false;\n }\n else\n return true;\n}", "function repwd()\r\n {\r\n var pwd=\"password\";\r\n var repwd=\"repassword\";\r\n var label=\"labelrepwd\";\r\n var x=document.getElementById(pwd).value;\r\n var y=document.getElementById(repwd).value;\r\n if(x!=y){\r\n procces(\"\",\"not matched\",\"red\",label);\r\n return true;\r\n }\r\n procces(\"\",\"matched\",\"green\",label);\r\n return true;\r\n }", "function isValidPassword(password) {\n\n\n}", "function passwordMatch(password, confirm_password) {\n\n if (password != confirm_password) {\n resetFields();\n\t document.getElementById(\"passError\").innerHTML = \"Password does not match!\";\n\t document.getElementById(\"passError\").style.color = \"red\";\n\t\tdocument.getElementById(\"pword\").style.border = \"3px solid red\";\n\t document.getElementById(\"cpword\").style.border = \"3px solid red\";\n\t \n return false;\n } else {\n\n\t\tresetFields();\n return true;\n }\n\n\n}", "function checkPassword(password, passconf) {\n\tvar password = $(password);\n\tvar passconf = $(passconf);\n\tif (password.val().trim() == passconf.val().trim()) {\n\t\tpassconf.get(0).setCustomValidity(\"\"); // All is well, clear error message\n\t\treturn true;\n\t} else {\n\t\tpassconf.get(0).setCustomValidity(ERR_PASSWORD_MISMATCH);\n\t\treturn false;\n\t}\n}", "function validatePasswordFields(context) {\r\n var pwds = context.parentNode.getElementsByClassName('repeat_password');\r\n \r\n\r\n\tif(pwds[0].value !== pwds[1].value) {\r\n\r\n pwds[0].addClass('error').value = \"\";\r\n pwds[1].addClass('error').value = \"\";\r\n \r\n return false;\r\n }\r\n\t\r\n return true;\r\n}", "function validatePasswd() {\n var pass = document.getElementById('pass').value;\n var cpass = document.getElementById('cpass').value;\n return (pass === cpass && pass != \"\" && cpass != '');\n}", "function validateConfPass() {\n if (user_conf.value === user_pass.value) {\n document.getElementById(\"alert_conf_pass\").innerHTML = \"\";\n return true;\n }\n document.getElementById(\"alert_conf_pass\").innerHTML =\n \"Password did'nt matched \";\n return false;\n}", "function checkPassword(form) {\n password1 = form.password1.value;\n password2 = form.password2.value;\n\n // If password not entered\n if (password1 != password2) {\n document.getElementById(\"pwderror\").innerHTML = '<span style=\"color:red;\">Password did not match: Please try again...</span>';\n return false;\n }\n\n // If same return True.\n else {\n document.getElementById(\"pwderror\").innerHTML = \"\";\n return true;\n }\n}", "checkPassword(loginPw) {\n // Using the keyword this, we can access this user's properties, \n // including the password, which was stored as a hashed string\n // compareSync confirms (true) or denies (false) that the supplied password\n // matches the hashed password stored on the object\n return bcrypt.compareSync(loginPw, this.password);\n }", "function compare_pswd(entered, saved){\n newPswd = crypt.append(entered);\n return bcrypt.compareSync(newPswd, saved);\n}", "validateForm() {\n return (this.state.oldPassword.length > 0 && \n this.state.newPassword.length > 0 &&\n this.state.newPassword === this.state.confirmPassword);\n }", "function CheckNewPass() {\n var psw=$('#NewPass').val();\n var repsw=$('#ReNewPass').val();\n\n if(repsw==psw) {\n return true;\n }\n else {\n console.log('salam');\n $('#errorpsw').show();\n return false;\n }\n}", "function validate() {\n var password = $(\"#password\").val();\n var confirm = $(\"#confirm_password\").val();\n \n if(password == confirm) {\n $(\"#validate-status\").text(\"passwords match\").css(\"color\", \"#33cc59\"); // green if passwords match \n }\n else {\n $(\"#validate-status\").text(\"passwords do not match\").css(\"color\", \"red\"); // red if passwords don't match \n } \n}", "function uConfPassword() {\n\t\tvar u_conf_pass = $('#user_conf').val();\n\t\tvar u_pass = $('#user_pass').val();\n\t\tif (!(u_conf_pass == u_pass)) {\n\t\t\t$('#alert_conf_pass').text(\"Password did'nt matched \");\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (u_conf_pass === '') {\n\t\t\t$('#alert_conf_pass').text('This field cannot be empty ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_conf_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "0.76633227", "0.7540629", "0.75229776", "0.7435838", "0.74159724", "0.7369158", "0.73600066", "0.7355525", "0.7290427", "0.7289019", "0.72394514", "0.7204006", "0.7195499", "0.71844983", "0.7146898", "0.71146715", "0.6984364", "0.69512767", "0.6944213", "0.6938736", "0.6923512", "0.69227356", "0.6918177", "0.69069844", "0.69006175", "0.68961", "0.68784124", "0.68548226", "0.68389034", "0.68229324", "0.6819635", "0.6805817", "0.6793228", "0.6790774", "0.67859083", "0.67719054", "0.6751168", "0.6741506", "0.67329824", "0.67104083", "0.6708171", "0.6700777", "0.6699421", "0.66987", "0.6698661", "0.6694265", "0.6692212", "0.6687634", "0.6680262", "0.6670419", "0.66643065", "0.66567254", "0.6642439", "0.6627446", "0.66138864", "0.6602541", "0.6598987", "0.6594194", "0.659339", "0.6592084", "0.65800637", "0.65741134", "0.65730506", "0.65680546", "0.6559433", "0.6552951", "0.654098", "0.6530329", "0.6529634", "0.6527465", "0.65204525", "0.6509941", "0.65024376", "0.6501167", "0.64944124", "0.6475421", "0.64710724", "0.646307", "0.646119", "0.6451944", "0.64434355", "0.6440776", "0.64402163", "0.6425313", "0.6425233", "0.6415866", "0.6414902", "0.641281", "0.6403141", "0.64022934", "0.6397133", "0.6394978", "0.63913095", "0.63901174", "0.63897985", "0.6387968", "0.6386919", "0.6379664", "0.6365476", "0.6364722" ]
0.7202244
12
console.log("feature collection is", featureCollection);
function closeUnclosedCoastlineFeatures(featureCollection) { featureCollection.features.filter(NOT(isClosed)).forEach(function(feature) { console.log("unclosed coastline:", feature); var lineCoordinates = feature.geometry.coordinates[0]; var bounds = lineCoordinates.reduce(function(prev, cur) { if (cur[0] < prev.left) { prev.left = cur[0]; } if (cur[0] > prev.right) { prev.right = cur[0]; } if (cur[1] < prev.bottom) { prev.bottom = cur[1]; } if (cur[1] > prev.top) { prev.top = cur[1]; } return prev; }, {left: Number.MAX_VALUE, right: -Number.MAX_VALUE, bottom: Number.MAX_VALUE, top: -Number.MAX_VALUE}); console.log("bounded by", bounds); var startPoint = lineCoordinates[0]; var endPoint = lineCoordinates[lineCoordinates.length-1]; var boundOrder = ['bottom', 'left', 'top', 'right']; function closestBound(lonlat) { var distances = boundOrder.map(function(boundKey) { switch (boundKey) { case 'left': case 'right': return Math.abs(lonlat[0] - bounds[boundKey]); case 'bottom': case 'top': return Math.abs(lonlat[1] - bounds[boundKey]); } }); var shortestIndex = distances.reduce(function(shortestIndex, distance, index) { return distance < distances[shortestIndex] ? index : shortestIndex; }, 0); console.log("distances are", distances, "shortest at", shortestIndex); return boundOrder[shortestIndex]; } var endPointClosestBound = closestBound(endPoint); var startPointClosestBound = closestBound(startPoint); var boundIndex = boundOrder.indexOf(endPointClosestBound); console.log("closest bounds are", endPointClosestBound, "to", startPointClosestBound, "; starting at index", boundIndex); var boundTrack = []; while (boundOrder[boundIndex] != startPointClosestBound) { boundTrack.push(boundOrder[boundIndex]); boundIndex = (boundIndex + 1) % boundOrder.length; if (boundTrack.length > boundOrder.length * 2) { // there was an error here. break; } } boundTrack.push(boundOrder[boundIndex]); console.log("will track bounds", boundTrack); function closestPointOnBound(fromPoint, bound) { switch(bound) { case 'left': case 'right': return [bounds[bound], fromPoint[1]]; case 'bottom': case 'top': return [fromPoint[0], bounds[bound]]; } } boundTrack.forEach(function(boundName) { lineCoordinates.push(closestPointOnBound(lineCoordinates[lineCoordinates.length-1], boundName)); }); lineCoordinates.push(lineCoordinates[0]); }); return featureCollection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function og(){ci()(this,{$featuresCollection:{enumerable:!0,get:this.getFeaturesCollection}})}", "function fc() {\n return {\n type: 'FeatureCollection',\n features: []\n };\n }", "constructor() {\n this.features_ = {};\n }", "toJson() {\n return {\n type: \"feature\",\n feature: this.feature,\n };\n }", "get features() {\r\n return new Features(this);\r\n }", "get features() {\r\n return new Features(this);\r\n }", "function featureSelected(feature){ \n selectedFeatures.push(feature);\n }", "function fc() {\n return {\n type: 'FeatureCollection',\n features: [],\n styles: []\n };\n }", "function onEachFeature(feature, layer) { \n layer.bindPopup(\"<h3>\"+feature.properties.state +\"</h3><hr><p>\" + feature.properties.Name +\"</p><hr><p>\" + \"year: 1980 to 2018\" + \"</p><hr><p>\"+ \"Number:\" + feature.properties.Number +\"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n }", "function consoleLogPaintings() {\n console.log(\"consoleLogPaintings()\");\n //this is your empty array from earlier\n collection.forEach((painting) => {\n console.log(\"Painting:\", painting);\n });\n}", "function onEachFeatureFunc(feature, layer) {\n layer.bindPopup(\"Magnitude: \" + feature.properties.mag + \"<br>Location: \" + feature.properties.place+\"<br>Time:\"+new Date(feature.properties.time));\n}", "function onEachFeature(feature, layer) {\n\t\tlayer.bindPopup(\"<p>\" + feature.properties.NAME + \"</p>\");\n\t}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3> Location: \" + feature.properties.place +\n \"<br> Magnitude: \" + feature.properties.mag + \n \"</h3> <hr><p>Occurrence Time: \" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\r\n var popupContent = \"\";\r\n if (feature.properties) {\r\n for (var property in feature.properties){\r\n popupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\r\n }\r\n layer.bindPopup(popupContent);\r\n };\r\n}", "function renderProcessorFeatures(features) {\n const featuresList = Object.entries(features).map(([name, value]) => ({ name, value: value.toString() }));\n return featuresList.length === 0 ? undefined : featuresList;\n}", "postFeatures() {\n const features = draw && draw.getAll().features;\n if (features && features.length > 0) {\n features.forEach(feature => {\n if (feature.properties.center.length > 0) {\n const center = feature.properties.center;\n this._get(PYTHON_REST_SERVER_ENDPOINT + \"set_tcd_feature?_id=\" + feature.id + \"&_longitude=\" + center[0] + \"&_latitude=\" + center[1] + \"&_radius=\" + (feature.properties.radiusInKm * 1000) + \"&_gee_imageid=\" + \"gee1234\" + \"&_entered_by=\" + \"andrew\");\n }\n });\n }\n }", "function onEachFeature(feature, layer) {\r\n// Creating a HTML string with all of the properties\r\n var popupContent = \"\";\r\n if (feature.properties) {\r\n// Creating a loop to add feature property names and values to the html string\r\n for (var property in feature.properties){\r\n popupContent += \"<p>\" + property + \":\" + feature.properties[property] + \"</p>\";\r\n }\r\n layer.bindPopup(popupContent);\r\n }\r\n}", "get feature() { return features.findById(this.get()); }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3 align ='center'>\" + feature.properties.place +\n \"</h3><hr><p><strong>Time: <strong>\" + new Date(feature.properties.time) + \"</p>\" +\n \"</h3><p><strong>Magnitude: <strong>\" + feature.properties.mag + \"</p>\" +\n \"</h3><p><strong>Depth: <strong>\" + feature.geometry.coordinates[2] + \"</p>\");\n }", "addToCompareGeometries(feature) {\n this.sendAction('addToCompareGeometries', feature);\n }", "function traceSummarize(featureCollection, summaryGeography) {\n console.log(\"summarizing trace...\");\n // generate totals\n $.each(featureCollection.features, function(k, v) {\n traceSummary.length += v.properties.Shape_Length * 3.28084;\n traceSummary.inchmiles += v.properties.INCHMILES;\n });\n\n // calculate flow time\n traceSummary.calcTime();\n\n // generate a list of summary geographies\n var exploded = explode(featureCollection);\n var tagged = tag(exploded, summaryGeography, 'LABEL', 'places');\n var places = geojson_set(tagged.features, 'places');\n\n traceSummary.places = [];\n $.each(places, function(i, v) {\n traceSummary.places.push({ \"name\": v });\n });\n // console.log(traceSummary);\n }", "function onEachFeature(feature, layer) { \n layer.bindPopup(\"<h2>\" + feature.properties.place +\n \"</h2><hr><h4>Magnitude: \" + feature.properties.mag + \"</h4><hr><h4>Depth: \" + feature.geometry.coordinates[2] + \"km</h4><hr><p>\" + new Date(feature.properties.time) + \"</p>\")\n }", "function onEachFeature(feature,layer){\n layer.bindPopup(\"<h3>Place: \" + feature.properties.place +\n \"</h3><hr><h3>Magnitude: \"+ feature.properties.mag +\n \"</h3><hr><h3>Time: \" + new Date(feature.properties.time) + \"</h3>\")\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3> Place: \" + feature.properties.place + \"</h3><h3>Magnitude:\" + feature.properties.mag + \"</h3><h3>Depth:\" + feature.geometry.coordinates[2] + \"</h3><h3>Time:\" + new Date(feature.properties.time) + \"</h3>\")\n\n }", "@action\n add(featureCollection) {\n const drawInstance = this.get('drawInstance');\n\n // if geometry exists for this mode, add it to the drawing canvas\n if (!isEmpty(featureCollection)\n && !this.get('isDestroying')) {\n drawInstance.set(featureCollection);\n }\n }", "getFeatFlags() {\r\n return this.store.getState().featureFlagsState.featureFlags;\r\n }", "function get_features(refseqID) {\n\n\tvar myFeatures;\t\n\tglue.inMode(\"reference/\"+refseqID, function(){\n\t\tmyFeatures = glue.getTableColumn(glue.command([\"list\", \"feature-location\"]), \"feature.name\");\n\t});\n\treturn myFeatures;\n}", "function gpx(node) {\n\t return {\n\t type: \"FeatureCollection\",\n\t features: Array.from(gpxGen(node)),\n\t };\n\t}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>Date & Time: \" + new Date(feature.properties.time) +\n \"<br>Magnitude: \" + feature.properties.mag +\n \"<br>Depth: \" + feature.geometry.coordinates[2] + \"</p>\");\n }", "function selectFeature(response) {\n sel_features.push(response);\n console.log(\"Selected \" + response + \" as Feature!\");\n }", "function onEachFeature(feature, layer) {\n // does this feature have a property named popupContent?\n if (feature.properties && feature.properties.name) {\n layer.bindPopup( 'Name: ' + feature.properties.name + '<br>'+ 'Total Price: ' + feature.properties.totalprice + '<br>' + 'Area: ' +feature.properties.area + '<br>' + 'Bedrooms: ' + feature.properties.bedrooms + '<br>' + 'Price per Sq m: ' + feature.properties.priceperm2 + '<br>' +'Year Built: ' + feature.properties.yearbuilt);\n }\n}", "function FeatureCollector()\n{\n this.current = [];\n this.features = {};\n this.featureCount = 0;\n \n this.openFeature = function() {\n this.current = [];\n }\n \n this.closeFeature = function() {\n this.features[this.featureCount++] = this.current;\n this.current = [];\n }\n \n this.addRect = function(rectText) {\n var r = rectText\n .split(/[ \\t\\n]+/)\n .filter(function(x) { return x.length > 0 })\n .map(function(x) { return parseFloat(x); });\n this.current.push(r);\n }\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p align='left'>Magnitude: \" + \"<strong>\" + feature.properties.mag + \"</strong><br>\" +\n \"Time: \" + \"<strong>\" + new Date(feature.properties.time) + \"</strong></p>\");\n }", "get featureClass() {}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p> Magnitude = \" + feature.properties.mag + \"</p>\" +\n \"<hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n\n\t//* No field named 'popupContent', so create html string using all fields/properties\n\tvar popupContent = \"\";\n\n\tif (feature.properties) {\n\n\t\t//* Loop through all features\n\t\t//* and add feature property names (fields) and values to html string\n\t\tfor (var property in feature.properties){\n\n\t\t\t// this prints out the value of each field\n\t\t\t// console.log(\"property: \",feature.properties[property]);\n\t\t\t\n\t\t\tvar myValue = String(feature.properties[property]);\n\t\t\tconsole.log(\"myValue: \", myValue, \" property: \",property);\n\n\t\t\t//* Do Not Include 'Area' or 'FIPS' Columns in the Popup\n\t\t\tif (property != 'Area' && property != 'FIPS'){\n\t\t\t\tpopupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\n\t\t\t};\n\n\t\t} // end for()\n\t\t\n\t\tlayer.bindPopup(popupContent);\n\t};\n\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p><b>Magnitude:</b> \" + feature.properties.mag + \"</p>\");\n}", "hasFeature(feature) {\n return true;\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + `Location: ${feature.properties.place}` + \"</h3><hr><p>\" +\n `<strong>Time</strong>: ${new Date(feature.properties.time)}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>magnitude</strong>: ${feature.properties.mag}` + \"</p>\" + \"</h3><hr><p>\" +\n `<strong>Status</strong>: ${feature.properties.status}` + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + \"Magnitude: \" + feature.properties.mag + \". \" + new Date(feature.properties.time) + \"</p>\");\n }", "function getEmp() {\n var conn = new sql.Connection(dbConfig);\n var req = new sql.Request(conn);\n\n conn.connect(function (err) {\n if (err) {\n console.log(err);\n return;\n }\n req.query(selectAll, function (err, recordset) {\n if (err) {\n console.log(err);\n }\n else {\n //var myid = _.chain(recordset).map(function (i) {\n // return i.id\n //}).value()\n //features.properties.id = myid\n\n //console.log( recordset[0])\n for (i = 0; i < recordset.length; i++) {\n var wktGeom = recordset[i].geom\n var sov = recordset[i].sovereign\n var id = recordset[i].fid\n\n if (typeof wktGeom == 'string') {\n //console.log(wktGeom)\n var toGeoJSON = parse(wktGeom);\n features.properties.id = id;\n features.properties.admin = sov;\n features.geometry = toGeoJSON;\n featureCollection.features.push(features)\n }\n else if (typeof wktGeom == 'object') {\n var stringJSON = wktGeom.toString()\n var geoJSON = parse(stringJSON)\n\n if (geoJSON != null) {\n //console.log(toGeoJSON)\n features.properties.id = id;\n features.properties.admin = sov;\n features.geometry = toGeoJSON;\n featureCollection.features.push(features)\n }\n }\n console.log(featureCollection)\n }\n //var topo = topoj.topology({ collection: featureCollection })\n //var topoData = topo.objects.collection.geometries\n //console.log(featureCollection.features.properties.id)\n //console.log(topo.objects.collection.geometries)\n //console.log(topo.objects.collection.geometries)\n }\n conn.close();\n });\n })\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \". <br> Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><p>\" + \"Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) +\n \"</p><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function gmlFeatureInfo(event, requestId, featureInfo, layer, queryLayer, forceInfoPopup) {\n let layerTitle = layer.values_.title;\n let features = new WMSGetFeatureInfo().readFeatures(featureInfo);\n let fieldSet = layer.values_.fields !== undefined ? layer.values_.fields[queryLayer] : [];\n let fieldKeys = [];\n for (let key in fieldSet) {\n fieldKeys.push(key);\n }\n let featureInfoArray = [];\n // Compare the returned field to the fields defined in settings and add the defined fields to featureInfoArray //\n features.forEach(feature => {\n if (fieldKeys.length > 0) {\n for (let key in feature.values_) {\n if (!fieldKeys.includes(key)) {\n delete feature.values_[key];\n } else {\n let fieldKey = fieldSet[key];\n feature.values_[fieldKey] = feature.values_[key];\n delete feature.values_[key];\n }\n }\n }\n featureInfoArray.push(feature.values_);\n });\n\n if (document.getElementsByClassName(`request-number-${requestId}`).length > 0) {\n addFeatures(featureInfoArray,layerTitle);\n } else {\n // Check for sidebar or popup to show the feature info //\n if (document.getElementsByClassName('sidebar').length > 0 && forceInfoPopup === false) {\n // Add the feature info body to the sidebar //\n let sidebar = document.querySelector('.sidebar');\n sidebar.classList.contains('ol-collapsed') ? sidebarToggle() : false;\n if (document.getElementsByClassName('featureinfo-content').length > 0 ) {\n removeNode('.featureinfo-content');\n }\n createNode('.sidebar-body','div',['featureinfo-content']);\n createNode('.featureinfo-content','div',[`request-number-${requestId}`]);\n }\n createNode(`.request-number-${requestId}`, 'div', ['featureinfo-body']);\n addFeatures(featureInfoArray,layerTitle,event);\n }\n // Add a table per feature to the feature info body //\n function addFeatures(featureArray,layerName,event) {\n let featureNumber = 1;\n if (document.getElementsByClassName('feature-details').length > 0) {\n featureNumber = document.getElementsByClassName('feature-details').length + 1 ;\n }\n featureArray.forEach(feature => {\n let node = createNode('.featureinfo-body', 'details', [`feature-${featureNumber}`,'feature-details']);\n createNode(`.feature-${featureNumber}`, 'summary', ['feature-summary'], `${layerName}`);\n createNode(`.feature-${featureNumber}`, 'table', ['feature-table'], `<tbody></tbody>`);\n for (let key in feature) {\n createNode(`.feature-${featureNumber} table tbody`, 'tr', [], `<td>${key}</td><td>${feature[key]}</td>`);\n }\n featureNumber === 1 ? node.setAttribute('open',true) : false;\n featureNumber++;\n });\n }\n}", "function onEachFeature(features, layer) {\n layer.bindPopup(\"<strong>\" + (features.properties.place).split(\"of\").pop() + \"</strong>\" +\n \"<li>\"+\"Magnitude: \" + features.properties.mag + \"</li>\" + \"<li>\" + \"Depth: \" + features.geometry.coordinates[2]+ \"</li>\" );\n }", "function initiateFeatures() {\r\n\tfeatures = [];\r\n\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\r\n\t\tlet feature = {\r\n\t\t\tname: featuresNames[i],\r\n\t\t\tHTMLbutton: $(\"#button-feature\" + i)[0],\r\n\t\t\tHTMLelement: $(\"#feature\" + i)[0]};\r\n\t\tfeatures.push(feature);\r\n\t}\r\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3><hr><p>Magnitude: \" +\n feature.properties.mag + \"</p><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n\t\tvar toDisplay = \"\";\n\t\tif (feature.properties) {\n\t\t\tif (feature.properties.name){\n\t\t\t\ttoDisplay += feature.properties.name;\n\t\t\t}\n\t\t\telse if (feature.properties.Name){\n\t\t\t\ttoDisplay += feature.properties.Name;\n\t\t\t}\n\t\t}\n\n\t\tif (!toDisplay){\n\t\t\ttoDisplay = \"No data\";\n\t\t}\n\n\t\tlayer.bindPopup(toDisplay);\n\t}", "function onEachFeature (feature, featureLayer) { 
 \n if (feature.properties && feature.properties.Museum && feature.properties.Activity && feature.properties.Link) {\n 
 featureLayer.bindPopup('<h7>' + feature.properties.Museum + '</h7><br>' + '<b>' + '<h8>' + feature.properties.Activity + '</h8>'+ '</b><br>' \n + '<p class=\"maptext\">' + feature.properties.Short_Description + '</p>' + '<p class=\"maplink\">' + '<a href=\"'+feature.properties.Link+'\" target=\"_blank\">' + feature.properties.Link + '</a>'+'</p>'); 
 
\n }\n 
 //if no properties, popup saying record is being updated 
 \n var popupContent = \"<p>ops, I'm being updated</p>\"; 
\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<p>\" + feature.properties.place +\n \"</p><p>\" + new Date(feature.properties.time) + \"</p>\" +\n \"<p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function do_OnEachFeature(feature, obj) {\r\n obj.bindPopup(\"<h2>\" + feature.properties.title +\r\n \"</h2><hr>\" + \"<h4>\" + new Date(feature.properties.time) + \"</h4>\"\r\n + \"<h4>\" + \"For more information on this event visit:\" + \"</h4>\"\r\n + \"<h5>\" + feature.properties.url + \"</h5></p>\");\r\n\r\n console.log(feature);\r\n\r\n\r\n// Set color of markers\r\n\r\n var color = \"\";\r\n if (feature.properties.mag > 5.5) {\r\n color = \"red\" \r\n }\r\n else if (feature.properties.mag > 5) {\r\n color = \"orange\"\r\n }\r\n else if (feature.properties.mag > 4.5) {\r\n color = \"light orange\"\r\n }\r\n else {\r\n color = \"yellow\"\r\n }\r\n }", "function DASFeature() {}", "function onEachFeature(feature, layer) {\n \n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p> Magnitude \" + feature.properties.mag +\n \"</p><hr><p>Depth \" + feature.geometry.coordinates[2] + \"(km)</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\" +\n \"<p>Magnitude:\" + feature.properties.mag + \"</p>\");\n }", "function onEachFeature(feature, layer) {\r\n layer.bindPopup(\"<h3>\" + feature.properties.place + \r\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>\" + feature.properties.mag + \"</p>\");\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n\t\t\"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\" +\n\t\t\"</h3><hr><p>Magnitude: \" + feature.properties.mag + \"</p>\");\n }", "function selected_feature(event){\n\t //clear out the log's contents\n\t document.getElementById('mapdata').innerHTML = '';\n\t \n\t //Show the current selected feature (passed in from the event object)\n\t var display_text = '<strong>' + event.feature.attributes.location + '</strong><hr />'\n\t + event.feature.attributes.description + '<br />'\n\t + '<a target=\"'+event.feature.attributes.urltarget +'\" href=\"'+event.feature.attributes.url +'\">' + event.feature.attributes.linkname + '</a>';\n\t\tdocument.getElementById('mapdata').innerHTML = display_text;\n\t\t\n\t}", "function addWSfeatures(){\n var features = [];\n for (var i = 0; i < workshops.length; i++){\n var feature = {\n // feature for Mapbox DC\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': workshops[i].coordinates\n },\n 'properties': {\n 'title': workshops[i].title,\n 'description':workshops[i].description\n }\n };\n features[i] = feature;\n }\n return features;\n}", "getAllIds() {\n return Object.keys(this._features);\n }", "getCurrent(){\n\t\treturn this.currentFeature;\n\t}", "function oneachfeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p><hr><p>Magnitude: \" + (feature.properties.mag) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \"</h3>\" +\n \"Magnitude: <strong>\" + feature.properties.mag + \"</strong><hr>\" +\n \"<p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n \n layer.bindPopup(\"<h3> Magnitude: \" + feature.properties.mag +\n \"</h3><hr><p>\" + feature.properties.place + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.title +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"<p>\");\n }", "function isFeature(feature) {\n /* NOTE: feature instanceof Vector does not work (import Vector from 'ol/source/Vector') */\n return typeof feature == 'object'\n && 'getId' in feature\n && 'ol_uid' in feature\n && 'values_' in feature;\n}", "function selFeature(value){\n //...\n }", "function selFeature(value){\n //...\n }", "function tcx(node) {\n\t return {\n\t type: \"FeatureCollection\",\n\t features: Array.from(tcxGen(node)),\n\t };\n\t}", "function ns(){var t=this;Be(this);var e=ki(this.$source,\"addfeature\").pipe(ir(function(e){var n=e.feature;t.addFeature(n)})),n=ki(this.$source,\"removefeature\").pipe(ir(function(e){var n=e.feature;t.removeFeature(n)})),i=ki(this.$source,\"changefeature\"),r=Si(e,n,i);this.subscribeTo(r,function(e){++t.rev,t.$emit(e.type,e)}),this.subscribeTo(r.pipe(Ua(100)),function(){t.$emit(\"update:features\",t.getFeatures().map(t.writeFeatureInDataProj.bind(t)))})}", "function onEachFeature(feature, layer) {\n //no property named popupContent; instead, create html string with all properties\n var popupContent = \"\";\n if (feature.properties) {\n //loop to add feature property names and values to html string\n for (var property in feature.properties){\n popupContent += \"<p>\" + property + \": \" + feature.properties[property] + \"</p>\";\n }\n layer.bindPopup(popupContent), layer.setIcon(boatIcon);\n };\n}", "function selFeature(value){\r\n //...\r\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(`<h3>${feature.properties.place}</h3><hr>\n <h3>Magnitude: ${feature.properties.mag}</h3><hr><p>${new Date(feature.properties.time)}</p>`);\n }", "function gapFeaturesText() { \n return gapPlanData.gapFeatures();\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place + \n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(`<h3>${feature.properties.place}</h3><p>Magnitude: ${(feature.properties.mag)}</p>`);\n }", "getFeatures() {\n let filesGlob = 'e2e/features/**/*.feature';\n let files = glob.sync(filesGlob);\n return _.sortedUniq(files);\n }", "function log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}", "function infoFeature(e) {\n\t\tconsole.log(e.target.feature);\n\t\thbconsents.resetStyle()//{fillColor: '#feb24c'});//reset all features to default colour\n\t\thbconsents.setFeatureStyle(e.target.feature.id, {fillColor: '#ff0000'});//highlight selected feature\n\t\tfeatureQuery(e.target._latlng);\n\t\t}", "function onEachFeature(feature, layer) {\r\n layer.bindPopup(\"<h3>\" + feature.properties.place +\r\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\r\n }", "print() {\n console.log(_(this).collection);\n return this;\n }", "print() {\n console.log(_(this).collection);\n return this;\n }", "loadFeatureData(){\n let featureHtml = `<div class=\"grid\">\n <div class=\"row space-bot\">\n <div class=\"c12\">\n <div class=\"royalcontent\">\n <h1 class=\"royalheader\">${ this.utilityData.homeTitle }</h1>\n <h1 class=\"title\" style=\"text-transform:none;\">${ this.utilityData.homeSubTitle }</h1>\n </div>\n </div>`\n this.features.forEach(feature => {\n featureHtml += `<div class=\"c4\">\n <h2 class=\"title hometitlebg\"><i class=\"${ feature.homeFeatureIcon } smallrightmargin\"></i> ${ feature.homeFeatureTitle }</h2>\n <div class=\"noshadowbox\">\n <p>\n ${ feature.homeFeatureDetail }\n </p>\n </div>\n </div>`\n }, this);\n this.mainContainer.innerHTML += featureHtml + `</div></div>`;\n }", "onShowAllFeaturesButtonClick() {\n let foundedFeatures = this.get('foundedFeatures');\n if (!Ember.isArray(foundedFeatures)) {\n return;\n }\n\n // Show all selected features.\n let features = foundedFeatures.filter((feature) => {\n return Ember.get(feature, '_selected') === true;\n });\n\n this._showFoundedFeatures(features, this.get('_selectedLayer'));\n }", "updateRecommender() {\n var lastFeatureIndex = this.state.featureFlag.length - 1;\n var name = this.state.featureFlag[lastFeatureIndex].name;\n var description = this.state.featureFlag[lastFeatureIndex].description;\n var obj = { name, description };\n featuresList.push(obj);\n }", "function forEachFeature(fn) {\n for (var feature in features) {\n if (features.hasOwnProperty(feature)) {\n fn(features[feature]);\n }\n }\n }", "pickVectorFeatures(screenPosition) {\n var _a, _b;\n // Pick vector features\n const vectorFeatures = [];\n const pickedList = this.scene.drillPick(screenPosition);\n for (let i = 0; i < pickedList.length; ++i) {\n const picked = pickedList[i];\n let id = picked.id;\n if (id &&\n id.entityCollection &&\n id.entityCollection.owner &&\n id.entityCollection.owner.name === GlobeOrMap._featureHighlightName) {\n continue;\n }\n if (!defined(id) && defined(picked.primitive)) {\n id = picked.primitive.id;\n }\n // Try to find catalogItem for picked feature, and use catalogItem.getFeaturesFromPickResult() if it exists - this is used by FeatureInfoMixin\n const catalogItem = (_b = (_a = picked === null || picked === void 0 ? void 0 : picked.primitive) === null || _a === void 0 ? void 0 : _a._catalogItem) !== null && _b !== void 0 ? _b : id === null || id === void 0 ? void 0 : id._catalogItem;\n if (typeof (catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.getFeaturesFromPickResult) === \"function\") {\n const result = catalogItem.getFeaturesFromPickResult.bind(catalogItem)(screenPosition, picked);\n if (result) {\n if (Array.isArray(result)) {\n vectorFeatures.push(...result);\n }\n else {\n vectorFeatures.push(result);\n }\n }\n }\n else if (id instanceof Entity && vectorFeatures.indexOf(id) === -1) {\n const feature = Feature.fromEntityCollectionOrEntity(id);\n if (picked.primitive) {\n feature.cesiumPrimitive = picked.primitive;\n }\n vectorFeatures.push(feature);\n }\n }\n return vectorFeatures;\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function onEachFeature(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "get featureDefinitionInput() {\n return this._featureDefinition;\n }", "function onEachFeature(feature, layer) {\n // does this feature have a property named popupContent?\n if (feature.properties && feature.properties.mag) {\n\n // Convert timestamp to formatted datetime\n var formattedDate = \"\";\n if (feature.properties.time) {\n var d = new Date(feature.properties.time);\n formattedDate = + d.getFullYear() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getDate();\n var hours = (d.getHours() < 10) ? \"0\" + d.getHours() : d.getHours();\n var minutes = (d.getMinutes() < 10) ? \"0\" + d.getMinutes() : d.getMinutes();\n var formattedTime = hours + \":\" + minutes;\n\n formattedDate = formattedDate + \" \" + formattedTime;\n }\n\n // Add popup with earthquake information\n layer.bindPopup('<h3>' + feature.properties.place + '</h3><hr>' +\n formattedDate + '<br>' +\n 'Magnitude ' + feature.properties.mag + '<br>' +\n '<a href = \"' + feature.properties.url + '\" target=\"_blank\" >More info</a>'\n );\n }\n}", "function get_features(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT * FROM features\", function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n context.features = results;\r\n complete();\r\n });\r\n }", "getGC() {\n return this.$http.get(PATH + \"gc_polygon.topo.json\", {cache: true})\n .then(function(data, status) {\n return topojson.feature(data.data, data.data.objects['dc_polygon.geo']);\n });\n }", "function getAndPrintFeatures(){\n $.ajax({\n url: \"/user2/features/get\",\n type: \"get\",\n data: {},\n success: function(response) {\n printFeatures(response);\n },\n error: function(xhr) {\n window.alert(\"Failed to get features.\");\n }\n });\n}", "function onEachFeature(feature, layer) {\n layer.bindPopup(feature.properties.title + \"<hr>\" + new Date(feature.properties.time) + \" | Depth: \" + feature.geometry.coordinates[2] + \" km\");\n }", "clearFeatures() {\n if (this.__featuresSource) {\n this.__featuresSource.clear();\n this._featuresChanged();\n }\n }", "function createFeatureLayer(graphics, title) {\n console.log(\"Data Points\", graphics);\n // NOTE: The following `fieldInfos` reflect datadisplayed in popup card\n const fieldInfos = [\n {\n fieldName: \"registrationID\",\n label: \"Registration ID\",\n format: {\n digitSeparator: false\n },\n visible: false\n },\n {\n fieldName: \"ipAddress\",\n label: \"IP Address\",\n format: {\n digitSeparator: true\n }\n },\n {\n fieldName: \"flags\",\n label: \"Flags\",\n format: {\n digitSeparator: false\n }\n },\n {\n fieldName: \"latitude\",\n label: \"Latitude\",\n format: {\n digitSeparator: true\n }\n },\n {\n fieldName: \"longitude\",\n label: \"Longitude\",\n format: {\n digitSeparator: true\n }\n },\n {\n fieldName: \"timestamp\",\n label: \"Timestamp\",\n format: {\n digitSeparator: false\n }\n }\n ];\n\n return new FeatureLayer({\n source: graphics, // adding an empty feature collection\n title: title,\n objectIdField: \"OBJECTID\",\n fields: [\n {\n name: \"OBJECTID\",\n type: \"oid\"\n },\n {\n name: \"registrationID\",\n type: \"string\"\n },\n {\n name: \"ipAddress\",\n type: \"string\"\n },\n {\n name: \"flags\",\n type: \"integer\"\n },\n {\n name: \"latitude\",\n type: \"geometry\"\n },\n {\n name: \"longitude\",\n type: \"geometry\"\n },\n {\n name: \"timestamp\",\n type: \"date\"\n }\n ],\n geometryType: \"point\",\n spatialReference: { \"wkid\": 102100, \"latestWkid\": 3857 },\n outFields: [\"*\"],\n popupTemplate: {\n // autocasts as new PopupTemplate()\n title: \"Location Point: {OBJECTID} of \" + graphics.length,\n content: [{\n type: \"text\",\n text: \"<div style='display: flex; margin-left: 9px;'>ID: {registrationID}</div>\"\n },\n {\n type: \"fields\",\n fieldInfos: fieldInfos\n }],\n // actions: [patternOfLifeAction],\n spinnerEnabled: true,\n active: true\n },\n renderer: pointRenderer1\n });\n}", "getFeatures (layer) {\n return this.getLayer(layer).getSource().getFeatures()\n }" ]
[ "0.71069616", "0.6663685", "0.6510594", "0.6262348", "0.62418085", "0.62418085", "0.61887753", "0.6051434", "0.603166", "0.59492934", "0.59492934", "0.5942334", "0.5939428", "0.59221935", "0.5912105", "0.5897768", "0.5884864", "0.5865433", "0.5819898", "0.58147013", "0.5763278", "0.5762316", "0.57249516", "0.5723943", "0.5723351", "0.57163143", "0.57161444", "0.57002074", "0.56996876", "0.56802434", "0.5678567", "0.56774306", "0.56732464", "0.5672091", "0.564406", "0.5641163", "0.5637544", "0.56360227", "0.5635742", "0.56346023", "0.5633623", "0.5628957", "0.5619321", "0.561319", "0.5612353", "0.5604662", "0.56039655", "0.559787", "0.55946016", "0.55942714", "0.5593999", "0.559125", "0.55891335", "0.5579067", "0.557881", "0.5575728", "0.5568524", "0.55666316", "0.55509716", "0.5540979", "0.5537582", "0.55284995", "0.5528383", "0.55282336", "0.55000955", "0.547903", "0.5475133", "0.5473944", "0.54651827", "0.54651827", "0.54603934", "0.5459977", "0.5443697", "0.54265726", "0.5424929", "0.5424728", "0.54230154", "0.5420348", "0.5409434", "0.5408091", "0.5403915", "0.5399732", "0.53879493", "0.53879493", "0.53748685", "0.5370313", "0.5362921", "0.5362855", "0.5344044", "0.5337017", "0.5337017", "0.5337017", "0.5336185", "0.53351116", "0.5330147", "0.5307389", "0.5307276", "0.530347", "0.5276574", "0.5275128", "0.5272408" ]
0.0
-1
Create the Repository Class
function AccountTypeRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) { BaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRepo() {\n taskRepo = new Object();\n return taskRepo\n }", "function RepositoryWrapper(manager, metadata) {\n\t\t\t\t\tRepository.apply(this, [manager, metadata]);\n\n\t\t\t\t\t// this allows user defined repositories to ignore the manager and metadata in their constructors\n\t\t\t\t\trepositoryClass.apply(this, Array.prototype.slice.call(arguments, 2));\n\t\t\t\t}", "ProductRepo() { \n }", "_createNewRepoObject(repoName) {\n return {\n multiValue: false,\n property: {name: repoName},\n text: repoName,\n value: repoName\n }\n }", "function RepositoryWrapper(manager, metadata) {\n Repository.apply(this, [manager, metadata]);\n\n // this allows user defined repositories to ignore the manager and metadata in their constructors\n repositoryClass.apply(this, Array.prototype.slice.call(arguments, 2));\n }", "function createSerialRepository () {\n /** @type {Promise<any> | undefined} */\n let task\n\n /**\n * Registers new query in repository\n *\n * @template {ReadonlyArray<any>} P\n * @template R\n *\n * @param {(...data: P) => Promise<R> | R} query query to register\n *\n * @return {(...data: P) => Promise<R>} registered query\n */\n function registerQuery (query) {\n return (...data) => {\n if (task === undefined) {\n return Promise.resolve(query(...data))\n }\n\n return task.then(() => query(...data))\n }\n }\n\n /**\n * Registers new mutation in repository\n *\n * @template {ReadonlyArray<any>} P\n *\n * @param {(...data: P) => Promise<void>} mutation mutation to register\n *\n * @return {(...data: P) => void} registered mutation\n */\n function registerMutation (mutation) {\n return (...data) => {\n task = task !== undefined\n ? task.then(() => mutation(...data))\n : mutation(...data)\n }\n }\n\n return { registerQuery, registerMutation }\n}", "function Repo(login, score, cDate, uDate, size, lang, home) {\n this.login = login;\n this.score = score;\n this.cDate = cDate;\n this.uDate = uDate;\n this.size = size;\n this.lang = lang;\n this.home = home;\n}", "function ModuleRepo() {\n this.modules = {};\n}", "create(Repo) {\n let sqlRequest = \"INSERT into repo (name, url) \" +\n \"VALUES ($name, url, $actorId)\";\n let sqlParams = {\n $name: Repo.name,\n $url: Repo.url,\n $actorId: Repo.actorId\n };\n return this.common.run(sqlRequest, sqlParams);\n }", "function StatRepository() {\n}", "_initRepos() {\n this._repos = {\n meal: new MealRepository(),\n meal_type: new MealTypeRepository(),\n sport: new SportRepository(),\n user: new UserRepository(),\n };\n\n this._repos.meal.addDataSource(new SQLiteMealDataSource(this._db));\n this._repos.meal_type.addDataSource(new SQLiteMealTypeDataSource(this._db));\n this._repos.sport.addDataSource(new SQLiteSportDataSource(this._db));\n this._repos.user.addDataSource(new SQLiteUserDataSource(this._db));\n }", "function TaskRepository () {\n\n }", "constructor({userRepository}) {\n this.userRepository = userRepository\n }", "repo (name) {\n if (!this.hasRepo(name)) {\n // Make sure the repository exists\n throw new Carmel.Error(`${Carmel.Error.PACK.MISSING_REPO}: ${name}`);\n }\n\n // Initialize a new Carmel Repository and return it; we expect this to never\n // return a null value as we're going to assume we're not going to perform\n // anything other than basic assignments inside this constructor\n let repo = new Carmel.Repository(path.join(this.reposDir, name));\n\n // Load the repository or implicitly throw an error if the loading failed\n repo.load();\n\n // Return the repo after it is succesfully loaded\n return repo;\n }", "function Repository(loader){\n\t/**\n\t * The loader function (bound to a sink and, optionally, a snapshotter) for partial application.\n\t * @type {function}\n\t * @private\n\t */\n\tthis._loader = loader;\n}", "function screateRepository(req, res){\n\t//console.log(\"test \"+JSON.stringify(req.body));\n\t//console.log(\"user \"+JSON.stringify(req.user));\t\n\tvar id=req.user._id;\n\tconsole.log(\"id \"+id);\n\tvar dirM=path.normalize(__dirname+'/../../Repository/'+id);\n\tvar dirname=fs.realpath(dirM,function (err, resolvedPath) {\n\t\tif (err) {\n\t\t\t//repository doesn't exist we create it\t\n\t\t\tfs.mkdir(dirM,function(){\n\t\t\t//copy default directory\n\t\t\t\tncp.limit = 16;\n\t\t\t\tvar source=path.normalize(__dirname+'/../../Repository/default');\n\t\t\t\tncp(source, dirM, function (err) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\treturn console.error(err);\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(\"Repository created\");\n\t\t\t\t\tres.json({msg:\"Repository created\",id: id});\n\t\t\t\t});//end ncp\n\t\t\t});//end fs.mkdir\n\t\t} else {\n\t\t\tconsole.log(\"Repository still exist\");\n\t\t\tres.send({msg:\"Repository still exist\"});\t\t\t\n\t\t}//end else\n\t});//end fs.realpath\n}", "function repoManagerCreateRepo(repoInfo, app, authTokenProvider) {\n var appRepos = repos[app.name];\n if (!appRepos) {\n appRepos = {};\n repos[app.name] = appRepos;\n }\n var repo = appRepos[repoInfo.toURLString()];\n if (repo) {\n fatal('Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.');\n }\n repo = new Repo(repoInfo, useRestClient, authTokenProvider);\n appRepos[repoInfo.toURLString()] = repo;\n return repo;\n}", "function DatabaseFactory() {}", "function DatabaseFactory() {}", "function SwiftCodeRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n\t\tBaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n\t}", "function createApi(dependencies) {\n return {\n /**\n * Returns first if it matches the type, second otherwise.\n *\n * @param {object} first - optional argument\n * @param {object} second - non optional argument\n * @param {string} type - expected type of non optional argument\n */\n optionalArgument: function(first, second, type) {\n dependencies.logger.trace('common.optionalArgument called');\n\n if (typeof(first) === type) {\n return first;\n } else {\n return second;\n }\n },\n\n /**\n * Populates the instance with fields if they contain appropriate keys.\n *\n * @param {object} instance - repository instance\n * @param {object} fields - key/value field mappings\n */\n populateFields: function(instance, fields) {\n dependencies.logger.trace('common.populateFields called');\n\n fields = fields || {};\n Object.keys(instance).forEach(function(field) {\n if (typeof(instance[field]) !== 'function' &&\n fields[field] !== undefined) {\n instance[field] = fields[field];\n }\n });\n\n return instance;\n },\n\n /**\n * Creates the given table using the given provider.\n *\n * @param {object} table - a node-sql table definition\n * @param {object} provider - a database specific provider instance\n * @returns {Q} promise - a promise containing the result of creating\n * the table\n */\n createTable: function(table, provider) {\n dependencies.logger.trace('common.createTable called');\n\n var query = table.create().ifNotExists().toQuery();\n query.text = provider.autoIncrement(query.text);\n\n return provider.runQuery(query);\n },\n\n /**\n * Creates an index for the table using the name and fields given.\n *\n * @param {object} table - node-sql table definition\n * @param {string} name - index name\n * @param {string[]} fields - array of field names\n * @param {object} provider - database provider\n * @returns {Q} promise - a promise containing the result of creating\n * the index\n */\n createIndex: function(table, name, fields, provider) {\n dependencies.logger.trace('common.createIndex called');\n\n fields = (Array.isArray(fields)) ? fields: [fields];\n\n var indexFields = fields.map(function(field) {\n return table[field];\n });\n var index = table.indexes().create(name).unique();\n var query = index.on.apply(index, indexFields).toQuery();\n\n return provider.runQuery(query);\n },\n\n /**\n * Returns a single instance tied to the given table using a where clause\n * and the given constructor to construct the instance.\n *\n * @param {object} table - a node-sql table definition\n * @param {object} where - a node-sql where clause\n * @param {object} provider - a database specific provider instance\n * @param {function} constructor - a constructor for the repository being\n * operated on\n */\n get: function(table, where, provider, constructor) {\n dependencies.logger.trace('common.get called');\n\n // this set to repo instance, can use this.create to get instance\n var query = table\n .select(table.star())\n .from(table)\n .where(where)\n .toQuery();\n\n return provider.runQuery(query)\n .then(function(result) {\n var row = result.rows[0];\n\n return instanceFromRow(row, constructor);\n });\n },\n\n /**\n * Returns an array of instances for the given query using the given\n * constructor.\n *\n * @param {object} query - a node-sql query instance\n * @param {object} provider - a database specific provider instance\n * @param {function} constructor - a constructor for the repository being\n * operated on\n */\n find: function(query, provider, constructor) {\n dependencies.logger.trace('common.find called');\n\n return provider.runQuery(query)\n .then(function(result) {\n var instances = result.rows.map(function(row) {\n return instanceFromRow(row, constructor);\n });\n\n return instances;\n });\n },\n\n /**\n * Returns an integer count using the given query.\n *\n * @param {object} table - a node-sql table definition\n * @param {object} query - a node-sql query instance\n * @param {object} provider - a database specific provider instance\n */\n count: function(table, query, provider) {\n dependencies.logger.trace('common.count called');\n\n return provider.runQuery(query)\n .then(function(result) {\n var countRow = result.rows[0];\n var count = +countRow[Object.keys(countRow)[0]];\n\n return count;\n });\n },\n\n /**\n * Saves the instance using the given table and provider.\n *\n * @param {pbject} instance - the instance to save to the database\n * @param {object} table - a node-sql table definition\n * @param {object} provider - a database specific provider instance\n */\n save: function(instance, table, provider) {\n dependencies.logger.trace('common.save called');\n\n var query;\n var fields;\n\n // update or insert?\n if (instance.getId()) {\n fields = getFields(instance, table, function(all, current, value) {\n all[current] = value;\n\n return all;\n }, {});\n query = table\n .update(removeEmptyFields(fields))\n .where(table.id.equals(instance.getId()))\n .toQuery();\n } else {\n fields = getFields(instance, table, function(all, current, value) {\n var field = table[current].value(value);\n all.push(field);\n\n return all;\n }, []);\n query = table\n .insert.apply(table, fields)\n .toQuery();\n }\n\n return provider.runQuery(query);\n },\n\n remove: function(instance, table, provider) {\n dependencies.logger.trace('common.remove called');\n\n var query = table\n .delete()\n .where(table.id.equals(instance.getId()))\n .toQuery();\n\n return provider.runQuery(query);\n }\n };\n\n /**\n * Returns an instance from the given row using the given constructor.\n *\n * @param {object} row - a database row\n * @param {function} constructor - a constructor for the repository being\n * operated on\n */\n function instanceFromRow(row, constructor) {\n dependencies.logger.trace('common.instanceFromRow called');\n\n var instance = null;\n\n if (row) {\n instance = constructor(row.id);\n Object.keys(instance).forEach(function(key) {\n if (instance[key] === undefined) {\n var field = Case.snake(key);\n instance[key] = row[field];\n }\n });\n }\n\n return instance;\n }\n\n /**\n * Returns the fields that should be saved to the database from the given\n * instance using the table definition as a reference.\n *\n * @param {pbject} instance - the instance to save to the database\n * @param {object} table - a node-sql table definition\n * @param {function} step - a step function for accumulating fields\n * @param {object} initial - an initial value to reduce the fields over\n * @returns {collection} - a collection containing the fields that should be\n * saved\n */\n function getFields(instance, table, step, initial) {\n dependencies.logger.trace('common.getFields called');\n\n var fields = table.columns.reduce(function(all, column) {\n // reference or property?\n if (column.references) {\n var referenceName = column.name.split('_')[0];\n var referenceField = column.name.split('_')[1];\n var method = util.format('get%s', Case.title(referenceName));\n\n if (instance[method]) {\n all = step(all, column.name, instance[method]().getId());\n }\n } else {\n var property = Case.camel(column.name);\n\n if (instance[property] && typeof(instance[property]) !== 'function') {\n all = step(all, column.name, instance[property]);\n }\n }\n\n return all;\n }, initial);\n\n return fields;\n }\n\n /**\n * Removes any field from the object with an undefined value. Nulls are\n * conserved to ensure fields can be updated to a null value.\n *\n * @param {Object} fields - object used to update a record\n */\n function removeEmptyFields(fields) {\n dependencies.logger.trace('common.removeEmptyFields called');\n\n var result = {};\n Object.keys(fields).forEach(function(field) {\n if (fields[field] !== undefined) {\n result[field] = fields[field];\n }\n });\n\n return result;\n }\n}", "function init({ projectRepository }) {\n const list = async function list(options) {\n return projectRepository.list(options);\n };\n\n const create = async function create(options) {\n return projectRepository.create(options);\n };\n\n const get = async function get(options) {\n return projectRepository.get(options);\n };\n\n const del = async function del(options) {\n return projectRepository.del(options);\n };\n\n const update = async function update(options) {\n return projectRepository.update(options);\n };\n return {\n list,\n create,\n get,\n del,\n update\n };\n}", "function getAll(){\n return repository;\n }", "static fromRepositoryArn(scope, id, repositoryArn) {\n const stack = core_1.Stack.of(scope);\n const arn = stack.parseArn(repositoryArn);\n const repositoryName = arn.resource;\n const region = arn.region;\n class Import extends RepositoryBase {\n constructor() {\n super(...arguments);\n this.repositoryArn = repositoryArn;\n this.repositoryName = repositoryName;\n this.repositoryCloneUrlHttp = makeCloneUrl(stack, repositoryName, 'https', region);\n this.repositoryCloneUrlSsh = makeCloneUrl(stack, repositoryName, 'ssh', region);\n this.repositoryCloneUrlGrc = makeCloneUrl(stack, repositoryName, 'grc', region);\n }\n }\n return new Import(scope, id, {\n account: arn.account,\n region,\n });\n }", "createWithId(Repo) {\n let sqlRequest = \"INSERT into repo (id, name, url, actorId) \" +\n \"VALUES ($id, $name, $url, $actorId)\";\n let sqlParams = {\n $id: Repo.id,\n $name: Repo.name,\n $url: Repo.url,\n $actorId: Repo.actorId\n };\n return this.common.run(sqlRequest, sqlParams);\n }", "constructor() { \n \n RepoLicense.initialize(this);\n }", "function PayeesRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n\t\tBaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n\t}", "function PayeeRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n BaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n }", "getRepository(entityName) {\n entityName = utils_1.Utils.className(entityName);\n if (!this.repositoryMap[entityName]) {\n const meta = this.metadata.get(entityName);\n const RepositoryClass = this.config.getRepositoryClass(meta.customRepository);\n this.repositoryMap[entityName] = new RepositoryClass(this, entityName);\n }\n return this.repositoryMap[entityName];\n }", "constructor(filename) {\n if (!filename) {\n throw new Error(\"Creating a repository requires a new filename\");\n }\n this.filename = filename;\n //chek if the file exixts\n try {\n fs.accessSync(this.filename);\n //if not create a new file\n } catch (err) {\n fs.writeFileSync(this.filename, \"[]\");\n }\n }", "function Database() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "function initializeRepository() {\n _repository = new xml.DOMImplementation().createDocument();\n\n var root = _repository.createElement('svg');\n root.setAttribute('id', _repositoryId);\n root.setAttribute('style', 'display: none;');\n\n _repository.appendChild(root);\n}", "function getAll() {\n return repository;\n }", "static get name () {\n return 'repo'\n }", "constructor(id, title, author,isbn,location,picture,idUsers,description) {\n /**\n * Class Book\n * Creates an object Book\n * \n * @param id\n * @param title string is the title of the book\n * @param author string is the author of the book\n * @param isbn int is the isbn of a book\n * @param location string is the City or University location of the Book\n * @param picture string is the name of the picture\n * @returns book object\n */\n this.id = id;\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n this.location = location;\n this.picture = picture;\n this.idUsers = idUsers;\n this.description = description;\n }", "function getAll() {\n return repository;\n }", "function VideoResourceRepository() {\n /*\n * @return {Array.<Object>} Predefined list of video resources\n */\n this.all = function() {\n return [{\n title: 'Foregiveness',\n author: 'Jack Kornfield',\n length: '10m 10s',\n description: 'All about foregiveness; how to receive it and how pass it on',\n url: 'PbHKCy4f6Dk'\n }, {\n title: 'Mindfulness',\n author: 'Jack Kornfield',\n length: '10m 14s',\n description: 'Learn how to enter mindfulness to help you remain grounded',\n url: 'ArVTV4CQduM'\n }]\n }\n}", "function repositoryGen() {\n hexo.extend.filter.register(\"after_generate\", function (picture) {\n log.info(\"---- START GENERATING PICTURE FILES ----\");\n try {\n var arr = [];\n const originPath = pictureDirPath;\n const output = targetPhotoListDir;\n (function test(path) {\n const files = fs.readdirSync(path);\n if (!files.length) return;\n files.forEach(v => {\n const vPath = path + \"/\" + v;\n const stats = fs.statSync(vPath);\n if (stats.isFile()) {\n const imgSize = sizeOf(vPath);\n arr.push(imgSize.width + \".\" +\n imgSize.height + \" \" +\n vPath.replace(originPath + \"/\", \"\"));\n } else {\n test(vPath);\n }\n });\n })(originPath);\n var content = JSON.stringify(arr, null, \"\\t\");\n fs.writeFile(output, content);\n } catch (err) {\n log.info(err);\n }\n var photojslibPath = pathFn.join(__dirname, \"lib/repos.js\");\n var photoJsContent = fs.readFileSync(photojslibPath);\n photoJsContent = photoJsContent.replace(\"${thumbnailUrl}\", pictureUrl);\n photoJsContent = photoJsContent.replace(\"${pictureUrl}\", pictureUrl);\n fs.writeFile(photoPubPath, photoJsContent);\n log.info(\"---- END GENERATING PICTURE FILES ----\");\n });\n}", "function initZoroRepo( cb ){\n createRepo( function(err, r){\n if( err ){\n return console.log(\"create repo err\", err)\n }\n repo = r\n addGitIgnore( function(){\n saveCurrentStatus( cb )\n })\n })\n}", "async prepareEcrRepository(repositoryName) {\n var _a, _b;\n const ecr = await this.props.sdk.ecr(this.props.environment.account, this.props.environment.region, credentials_1.Mode.ForWriting);\n // check if repo already exists\n try {\n logging_1.debug(`${repositoryName}: checking if ECR repository already exists`);\n const describeResponse = await ecr.describeRepositories({ repositoryNames: [repositoryName] }).promise();\n const existingRepositoryUri = (_a = describeResponse.repositories[0]) === null || _a === void 0 ? void 0 : _a.repositoryUri;\n if (existingRepositoryUri) {\n return { repositoryUri: existingRepositoryUri };\n }\n }\n catch (e) {\n if (e.code !== 'RepositoryNotFoundException') {\n throw e;\n }\n }\n // create the repo (tag it so it will be easier to garbage collect in the future)\n logging_1.debug(`${repositoryName}: creating ECR repository`);\n const assetTag = { Key: 'awscdk:asset', Value: 'true' };\n const response = await ecr.createRepository({ repositoryName, tags: [assetTag] }).promise();\n const repositoryUri = (_b = response.repository) === null || _b === void 0 ? void 0 : _b.repositoryUri;\n if (!repositoryUri) {\n throw new Error(`CreateRepository did not return a repository URI for ${repositoryUri}`);\n }\n // configure image scanning on push (helps in identifying software vulnerabilities, no additional charge)\n logging_1.debug(`${repositoryName}: enable image scanning`);\n await ecr.putImageScanningConfiguration({ repositoryName, imageScanningConfiguration: { scanOnPush: true } }).promise();\n return { repositoryUri };\n }", "function ContentObjectRepository(http, paramsProvider, urlSource) {\n var resourceUrl = function(id) {\n return urlSource.apiEndpoint() + 'content_objects/' + id + '.json?' + paramsProvider.params();\n }\n\n var resourcesUrl = function() {\n return urlSource.apiEndpoint() + 'content_objects.json?' + paramsProvider.params();\n }\n\n /*\n * @return {Array.<Object>} list of all ContentObjects\n */\n this.all = function() {\n return http.get(resourcesUrl()).then(function(response) {\n return response.data;\n })\n }\n\n /*\n * @return {Object} single content object by id\n */\n this.find = function(id) {\n return http.get(resourcesUrl()).then(function(response) {\n return _.find(response.data, function(contentObject) {\n return contentObject.id == id;\n })\n })\n }\n}", "static getInstance() {\n if (!this.__instance) {\n this.__instance = new ComponentRepository();\n }\n return this.__instance;\n }", "function createRepositoryItem() {\n var ref = $('#node-repository-tree').jstree(true);\n sel = ref.create_node(\"#\", {\"type\": \"file\", \"text\": \"A new node\"}, \"first\");\n if (sel) {\n ref.edit(sel);\n }\n}", "function Factory(){}", "function ConnectionRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n\t\tBaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n\t}", "constructor() {\n this.db = new Dexie('ProjectTrackerDB');\n // This means it creates a projects table with\n // an id primary key and an indexed title column\n this.db.version(1).stores({ \n projects: \"++id,title\",\n nodes: \"++id,projectId\"\n });\n this.db.open().catch(e => {\n console.error(\"Opening the db '\" + this.db.name + \"' failed: \" + e);\n });\n\n this.seedData();\n }", "constructor(github, description){\n this.github = github;\n this.description = description\n }", "static async new(projectDir) {\n const instance = new AnnotationsDb(projectDir)\n await instance.readAnnotations()\n return instance\n }", "static factory($http) {\n return new CommitsClass($http);\n }", "function GitStorage () {}", "constructor(connection, chainId) {\n this._connection = connection;\n console.log('AccountRepository::constructor chainId', chainId)\n this._chainId = chainId;\n }", "static create () {}", "create() {\n return this.new();\n }", "function AudioResourceRepository() {\n /*\n * @return {Array.<Object>} Predefined list of audio resources\n */\n this.all = function() {\n return [{\n id: 1,\n title: 'I Have A Dream',\n author: 'Martin Luther King Jr.',\n duration: '45m 00s',\n description: 'The famous speech by Martin Luther King Jr. who inspired an entire generation',\n url: 'http://www.archive.org/download/MLKDream/MLKDream_64kb.mp3'\n }, {\n id: 2,\n title: 'What Motivates Us?',\n author: 'Anthony Robbins',\n duration: '25m 37s',\n description: 'Tony Robbins explains how to unlock your true potential, and asks the audience (including former Vice President Al Gore) for a bit of high-level interaction',\n url: 'http://video.ted.com/talk/podcast/2006/None/TonyRobbins_2006.mp3'\n }]\n }\n}", "consructor() {\n }", "function createRepos(repoData) {\n var thisRepo;\n \n var result = $.ajax({\n url: './repo.html',\n dataType: 'html',\n type: 'GET',\n })\n .done(function(result) {\n \n // clone the html template\n thisRepo = $(result).clone();\n \n // apply repo name to correct location\n var repoName = thisRepo.find('.repoName');\n repoName.append(repoData.name);\n \n // apply repo description correct location\n var repoDescription = thisRepo.find('.repoDescription');\n repoDescription.append(repoData.description);\n \n // apply preview image in correct location\n var repoPreview = thisRepo.find('.repoPreview img');\n repoPreview.attr('src', 'images/' + repoData.name + '.jpg');\n repoPreview.attr('alt', repoData.name + ' Preview Image');\n \n var repoActivity = thisRepo.find('.repoActivity');\n var time = new Date(repoData.pushed_at).toLocaleString();\n repoActivity.append(time);\n \n var repoLink = thisRepo.find('.remoteLink');\n repoLink.attr('href', repoData.homepage);\n \n var githubLink = thisRepo.find('.githubLink');\n githubLink.attr('href', repoData.svn_url);\n githubLink.append('Project on Github');\n \n // apply modified html template to page\n $('#repoContainer').append(thisRepo);\n })\n .fail(function(jqXHR, error, errorThrown) {\n $('.error').append(error);\n });\n}", "constructor() {\n this.config = {\n headers: {\n Authorization: '6056e97697c60b80f2a45294ecd3690036f35ad0'\n }\n }\n this.repos_count = 5; // only show 5 repos\n this.repos_sort = 'created: asc'; // this will give us the 5 most recent repos\n }", "constructor(db_pool) {\n this.client = new Client(db_pool)\n this.portfolio = new Portfolio(db_pool)\n this.security = new Security(db_pool)\n this.company = new Company(db_pool)\n this.recommendation = new Recommendation(db_pool)\n this.portfolio_security = new PortfolioSecurity(db_pool)\n }", "create() {}", "create() {}", "constructor({ config, owner, repositoryName }) {\n const url = config.apiBaseUrl();\n this.log = new Logger(config.verbose());\n this.owner = owner;\n this.repositoryName = repositoryName;\n this.baseURL = url.endsWith('/')\n ? url.slice(0, -1)\n : url;\n this.headers = new Headers({\n 'User-Agent': 'semantix',\n Accept: 'application/vnd.github.v3+json',\n Authorization: `token ${config.accessToken()}`,\n 'Content-Type': 'application/json'\n });\n }", "function DUPairFactory() {\n}", "function BrochureRepository(http, paramsProvider, urlSource){\n var resourceUrl = function(type) {\n return urlSource.apiEndpoint() + 'brochures/' + type + '.json?' + paramsProvider.params();\n }\n\n /*\n * @return {Array.<Object>} List of brochures by type.\n */\n this.get = function(type) {\n return http.get(resourceUrl(type)).then(function(response) {\n return response.data;\n });\n }\n}", "create () {}", "create () {}", "function repository(endpoint, version, namespace) {\n var object = {};\n // We check the validity of the CTS version\n if(typeof version === \"undefined\" || (version !== 3 && version !== 5)) {\n version = 3;\n }\n if(typeof namespace === \"undefined\") {\n if(version === 3) {\n object.namespace = \"http://chs.harvard.edu/xmlns/cts3/ti\";\n } else {\n object.namespace = \"http://chs.harvard.edu/xmlns/cts\";\n }\n }\n object.version = version;\n object.endpoint = CTS.utils.checkEndpoint(endpoint);\n object.inventories = {}; // Dictionaries of inventory object\n object.inventory = {}; // Dictionaries of inventory's label\n object.setEndpoint = _setEndpoint;\n object.addInventory = _addInventory;\n object.setInventory = _setInventory;\n object.delInventory = _delInventory;\n object.load = _load;\n\n if (object.version === 3) {\n object.TextInventory = TextInventoryCTS3;\n } else {\n throw \"CTS Version 5 is not implemented yet\";\n object.TextInventory = null; // NotImplementedYet\n }\n \n\n return object;\n}", "constructor(init){\n Object.assign(this,init)\n this.type = 'entity'\n }", "gitInstance() {\n this.repoName = uuid.v4();\n this.path = path.resolve(os.tmpdir());\n fs.ensureDirSync(path.join(this.path, `/${this.repoName}`));\n return simpleGit({\n baseDir: path.join(this.path, `/${this.repoName}`),\n binary: 'git',\n maxConcurrentProcesses: 6,\n });\n }", "constructor(name, id, email, gitAccount) {\n super(name, id, email);\n this.github = gitAccount;\n }", "function categoryRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n\t\tBaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n\t}", "mapToDb() {\n return {\n fullName: this.fullName,\n username: this.username,\n password: this.password,\n rank: this.rank,\n branch: this.branch,\n permissions: this.permissions || [PERMISSIONS.SOLDIER],\n isArchived: this.isArchived\n };\n }", "create() {\n\t}", "function getRepository(entityClass, connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return getConnectionManager().get(connectionName).getRepository(entityClass);\n}", "static clear(){\n SourceRepository._repository = {};\n }", "static async crearGuion(payload){\n\n\t\tlet bot = new BotService()\n\t\tObject.assign(bot,payload)\n\t\tawait bot.save()\n\t\treturn bot\n\n\t}", "constructor() {\n\n this.format = require('string-format');\n this.lodash = require('lodash');\n\n this.verbs = this.mapVerbs();\n this.implementedAnnotations = this.mapImplementedAnnotations();\n this.types = this.mapTypes();\n this.formats = this.mapFormats();\n this.parametersIn = this.mapParametersIn();\n this.name = 'node';\n this.fileExtension = '.js';\n this._IDType = 'int';\n this.capitalizeModelName = true;\n this.capitalizePropertyName = true;\n this.destinationFolderPath = 'Models';\n this.projectName = 'App';\n this._IDPrefix = 'Id';\n this._IDType = 'int';\n this.models = [];\n this.arrayImplementer = '[]';\n }", "function StatesRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n\t\tBaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n\t}", "function createInstance() {\n var postgresDatabase = new Object(\"Database instance initialized!\");\n return postgresDatabase;\n }", "function repo () {\n opts.git = true\n opts.meta.repo = 'init'\n opts.files.gitignore = true\n }", "function getRepository()/*:ContentRepository*/ {\n return com.coremedia.cap.common.SESSION.getConnection().getContentRepository();\n }", "function newXmlRepository(taxonomyXml, destinationsXml) {\n\tvar fs = require('./file-io.js');\n\n\tfunction getXml(xmlFilename, returnXml){\n\t\tfs.readFile(xmlFilename, function(err, xmlData) {\n\t\t\tif(err){\n\t\t\t\tconsole.error(err);\n\t\t\t\tthrow new Error('Unable to read file: ' + xmlFilename); \n\t\t\t}\n\t\t\t\n\t\t\treturnXml(xmlData);\n\t\t});\n\t}\n\n\treturn {\n\t\tgetTaxonomyXml : function(returnXml){\n\t\t\treturn getXml(taxonomyXml, returnXml);\n\t\t},\n\t\tgetDestinationsXml : function(returnXml) {\n\t\t\treturn getXml(destinationsXml, returnXml);\n\t\t}\n\t}\n}", "constructor() {\n this.initStore(this.constructor.fields());\n this.registerFields();\n }", "constructor() {\n this.init(); // metodo init\n this.mongo();\n }", "static initialize(obj, repoName, mainBranch, buildCommand, period) {\n obj['repoName'] = repoName;\n obj['mainBranch'] = mainBranch;\n obj['buildCommand'] = buildCommand;\n obj['period'] = period;\n }", "create() {\n\n }", "create() {\n\n }", "create() {\n\n }", "new() {\n var newJson = this.dao.new(); // create a new empty json onbject\n this._showOutput(0, newJson);\n }", "init() {\n const readdir = require('fs').readdirSync;\n const join = require('path').join;\n\n const self = this;\n\n const models = readdir(join(__dirname, './models')); // get all models name in ./models dir\n models.forEach((model)=> {\n // creates model name that contain model name + Model word ant start with upper symbol\n var name = model.split('.')[0];\n\n // attaches each model to PostgresConnector for the fastest getting\n self._models[name] = self.client.import(`./models/${model}`);\n });\n\n\n const classes = readdir(join(__dirname, './model_methods'));\n classes.forEach(currentClass=> {\n var name = currentClass.split('.')[0].toLowerCase();\n self[name] = new (require(`./model_methods/${currentClass}`))(self)\n })\n return;\n }", "function createObject() {\n var className= $.trim($className.val());\n var dbName = $.trim($dbName.val());\n if (className == null || className.length == 0 || dbName == null || dbName.length == 0) {\n alert(\"ERROR:\\nPlease list a Class Name and a Database Name\");\n return;\n }\n\n var num = getInt($container.attr(\"data-num\"));\n num++;\n $container.attr(\"data-num\", num);\n var $newObject = $container.find(\".object:last-child\").clone(true, true);\n\n $newObject.find(\".object-table\").attr(\"data-rows\", \"1\");\n $newObject.find(\".sel-ai-class\").attr(\"data-id\", num);\n $newObject.find(\".sel-pk-class\").attr(\"data-id\", num);\n \n $newObject.attr({\"data-num\": num, \"data-static\": \"0\"});\n \n \n $container.prepend($newObject);\n }", "static get INIT_DAO() {\n return {\n active: 1\n }\n }", "constructor(name, id, email, github) {\n super(name, id, email)\n this.github = github\n }", "function EntityRepository(entity) {\n return function (target) {\n __1.getMetadataArgsStorage().entityRepositories.push({\n target: target,\n entity: entity,\n });\n };\n}", "createEntity() {\n var entity = new bb.Entity(this);\n this.addEntity(entity);\n return entity;\n }", "function BulkWireRepository(modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource) {\n BaseRepository.call(this, modelDefinition, config, defaultAppMode, dataSourceFactory, injectedDataSource);\n }", "function createDriver() {\n let driverId = 0;\n return class {\n constructor(name) {\n this.name = name;\n this.id = ++driverId;\n }\n };\n}", "getRepo(repo: ?Microcosm, props: Object): Microcosm {\n return repo ? repo.fork() : new Microcosm()\n }", "constructor() {\n this.database = new Database();\n }", "function neoSingletonFactory() {\n var neo = { skills : [] }\n\n return function() { return neo }\n}", "static async get(givenOptions: Object = {}): Promise<RepoMan> {\n const options = Helpers.fillConfig(givenOptions)\n await FS.mkdirp(options.stateDirectory)\n\n const repoMan = new RepoMan(PRIVATE, options)\n const command = await Command.get(options, repoMan)\n await FS.mkdirp(command.getProjectsRoot())\n await FS.mkdirp(command.getConfigsRoot())\n await Promise.all(Commands.map(entry => repoMan.addCommand(entry, options)))\n\n return repoMan\n }" ]
[ "0.7140641", "0.63237435", "0.62711453", "0.626653", "0.6218414", "0.61922383", "0.6171869", "0.6159824", "0.6129383", "0.61080146", "0.5963476", "0.58927727", "0.5882506", "0.5851852", "0.5781349", "0.5745824", "0.5718264", "0.56675553", "0.56675553", "0.56277126", "0.5625236", "0.56187755", "0.5551289", "0.55486715", "0.55275154", "0.54692274", "0.54631835", "0.5454274", "0.5450294", "0.5382502", "0.5375334", "0.5359525", "0.53385985", "0.533854", "0.53274244", "0.531716", "0.5286343", "0.5281747", "0.52772903", "0.524704", "0.52264047", "0.5221073", "0.5214679", "0.5211359", "0.520941", "0.52023906", "0.5195777", "0.5182191", "0.5178617", "0.5136669", "0.51356107", "0.512969", "0.5117594", "0.5104065", "0.50959224", "0.5078265", "0.5071094", "0.5069006", "0.5065871", "0.5065871", "0.5063054", "0.5047027", "0.5044648", "0.5014299", "0.5014299", "0.500928", "0.49998155", "0.49951303", "0.4990315", "0.49875632", "0.49750358", "0.4975015", "0.4972445", "0.49707714", "0.4969205", "0.49672166", "0.4938087", "0.49354854", "0.4929852", "0.49296194", "0.49287155", "0.49257502", "0.49238056", "0.49165088", "0.49156317", "0.49156317", "0.49156317", "0.49101564", "0.48926693", "0.48894018", "0.4887724", "0.48858166", "0.48837808", "0.48805815", "0.48800486", "0.48796985", "0.48765585", "0.48680484", "0.486711", "0.48590285" ]
0.5260335
39
Starts an express server for slash commands
function startServer (config, controller) { // TODO port will be required for multi-team auth if (config.port) { controller.setupWebserver(config.port) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startWebServer() {\n express.listen(this.master.CLA.port, () => console.log(`Running on port ${this.master.CLA.port}`))\n this.loadRoutes()\n }", "function startServer () {\n // Enable CORS for all requests\n app.use(require('cors')());\n\n // Note: the order which we add middleware to Express here is important!\n app.use('/sys', mbaasExpress.sys([]));\n app.use('/mbaas', mbaasExpress.mbaas);\n\n // Note: important that this is added just before your own Routes\n app.use(mbaasExpress.fhmiddleware());\n\n // Important that this is last as per express conventions!\n app.use(mbaasExpress.errorHandler());\n\n const port = process.env.FH_PORT || process.env.OPENSHIFT_NODEJS_PORT || 8001;\n const host = process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0';\n\n server.listen(port, host, undefined, () => {\n log.info(`application started on ${host}:${port}`);\n });\n}", "function startExpress() {\n\n http.createServer(app).listen(app.get('port'), () => {\n console.log('Web server is running on ', app.get('port'));\n });\n}", "function startExpress() {\n var express = require('express');\n var app = express();\n app.use(express.static(__dirname));\n app.listen(4000);\n}", "function start(options) {\n app.get('/', function(req, res) {\n res.end('Hello World');\n });\n \n monitor.app(app.listen(options.port));\n }", "function startServer(port){\n const expressSwagger = require('express-swagger-generator')(app);\n require('./routes')(app);\n \n let options = {\n swaggerDefinition: {\n info: {\n description: 'Test for Backend Developer role.',\n title: 'Lobby Wars',\n version: '0.0.1',\n },\n host: 'localhost:'+port,\n basePath: '/v1',\n produces: [\n \"application/json\",\n \"application/xml\"\n ],\n schemes: ['http'], \n },\n basedir: __dirname, //app absolute path\n files: ['./routes/**/*.js'] //Path to the API handle folder\n };\n expressSwagger(options)\n\n let server = app.listen(port); \n console.log(\"Listening on port: \"+port);\n return server;\n}", "function startApp() {\n server.use(handler).listen(PORT, err => {\n if (err) throw err;\n console.log(`> Ready on ${PORT}`);\n });\n }", "function startServer() {\n\tapp.serverInstance = server.listen(config.PORT, config.HOST, function() {\n\t\tlogger.info('Express server listening on %d, in %s mode...', config.PORT, config.ENV);\n\t});\n}", "function appStart(opts) {\n return new Promise((resolve, reject) => {\n let server = new Hapi.Server();\n server.connection({\n port: opts.port,\n host: opts.host,\n routes: {\n files: {\n relativeTo: config.path.dist\n }\n }\n });\n\n // configure auth strategy, if we have one\n // server.auth.scheme('my-scheme', scheme);\n \n server.register(plugins, err => {\n if (err) return reject(err);\n\n // set up views\n server.views({\n engines: { pug: require('pug') },\n path: config.path.template,\n compileOptions: {\n pretty: true\n }\n });\n\n // apply routes\n server.route(routes);\n\n resolve(server);\n });\n });\n}", "function startServer () {\n require('http').createServer(function (req, res) {\n req.addListener('end', function (e) {\n //\n // Serve files!\n //\n server.serve(req, res, function (resp) {\n if (resp && (resp.status === 404)) { // If the file wasn't found\n\n server.serveFile('/index.html', 302, resp.headers, req, res);\n }\n });\n });\n }).listen(8080);\n\n console.log('server now listening on port: 8080')\n}", "run() {\n const app = express();\n\n app.use(bodyParser.json());\n app.use(bodyParser.urlencoded({\n extended: true\n }));\n\n // Handle favicon request\n app.get('/favicon.ico', function (req, res) {\n HttpHelpers.write('', 'image/x-icon', res);\n });\n\n // Handle API proxy calls\n\n app.all('/api*', this.handleApiRequest.bind(this));\n\n app.all('*', this.handle.bind(this));\n\n app.listen(this.getPort());\n\n console.log(`Server process ${process.pid} started on port ${this.getPort()}`);\n }", "function exp() {\n\tconst express = require('express');\n\tconst app = express();\n\tconst port = 3000;\n\n\tapp.get('/', (req, res) => res.send('Started The bot.'));\n\tapp.listen(port, () =>\n\t\tconsole.log(`Your App is listening at https.//localhost:${port}`)\n\t);\n}", "function startExpress() {\n var express = require('express');\n var app = express();\n app.use(require('connect-livereload')());\n app.use(express.static(EXPRESS_ROOT));\n app.listen(EXPRESS_PORT);\n}", "function start() {\n app.listen(app.get('port'), function() {\n console.log('Node app is running on port', app.get('port'));\n });\n}", "async start () {\n assert(!this._server, 'http server is already started');\n this._app = express();\n this._app.use('/healthcheck', healthcheck(this._config));\n this._app.use('/', video(this._counterService, this._config));\n\n this._server = http.createServer(this._app);\n this._statsServer = new StatsServer(this._server, this._communicationMesh);\n await this._statsServer.start();\n this._logger.info({ port: this._config.get('LISTEN_PORT') }, 'Goint to listen http:// and ws:// at port');\n this._server.listen(this._config.get('LISTEN_PORT'));\n }", "function startServer() {\n Http.listen(env.serverPort, () => {\n console.log('Listening at :' + env.serverPort + '...');\n });\n}", "async function start() {\n //= ================= [START Node Server] =================//\n const log = LOG;\n\n if (APP_CONFIG.ENABLE_SSL === true) {\n const domain = APP_CONFIG.DOMAIN;\n const host = APP_CONFIG.HOST;\n const port = APP_CONFIG.PORT_HTTPS;\n\n await SERVER.listen(port, host);\n\n log.info('Is Secure => Running Port No. at https://' + domain + ':' + port);\n log.debug('Full path => ' + API_PATH);\n } else {\n const domain = APP_CONFIG.DOMAIN;\n const host = APP_CONFIG.HOST;\n const port = APP_CONFIG.PORT_HTTP;\n\n await SERVER.listen(port, host);\n\n log.info('Is not Secure => Running Port No. at http://' + domain + ':' + port);\n log.debug('Full path => ' + API_PATH);\n }\n //= ================= [END Node Server] =================//\n\n //= ================= [START Init Client Controller] =================//\n APP.use('/', EXPRESS.static(PATH.join(ROOT_PATH + '/../../client/build')));\n //= ================= [END Init Client Controller] =================//\n\n //= ================= [START Init Response UI] =================//\n APP.get('*', (req, res) => {\n res.sendFile(PATH.join(ROOT_PATH + '/../../client/build/index.html'));\n });\n //= ================= [START Init Response UI] =================//\n}", "start (cb) {\n // Globally intercept 404 errors and return a `res.notFound` rather than the\n // default Express 404 page. This allows a view to be used when added to\n // your views directory at `responses/404.jts`.\n this.app.use((req, res, next) => {\n if (parseUrl(req).pathname === '/favicon.ico') return next()\n res.notFound()\n })\n\n const ready = function () {\n this.app.events.emit('ready')\n if (!cb) return\n\n // If no Mongo connection is configured OR if Mongo has already\n // established a connection, the ready callback is called immediately.\n if (!this.app.mongo || this.app.mongo.connection.readyState === 1) {\n return cb(null, this.server)\n }\n\n this.app.mongo.connection.once('connected', () => cb(null, this.server))\n }.bind(this)\n\n try {\n this.server.listen(this.app.get('port'), () => {\n this.app.log.info()\n this.app.log.info(`Server running on port ${this.server.address().port} in ${this.app.get('env')} mode.`)\n this.app.log.info('To shut down press <CTRL> + C at any time.')\n this.app.log.info()\n\n if (!this.app.config.waitForReady) {\n return ready()\n }\n\n // If the launch of the server involves asynchronous activities it may\n // be helpful to enable `waitForReady` in your `app.config` settings.\n // Once all asynchronous activies have been completed, simply call\n // `app.events.emit('ready');` and your callback will fire. This can be\n // useful when testing asynchronous hooks. If you need to delay binding\n // to port see `.startWhenReady()` below.\n this.app.events.once('ready', () => cb(null, this.server))\n })\n } catch (err) {\n cb(err)\n }\n return this.app\n }", "initExpress() {\n\t\tthis.app.set(\"port\", 8000);\n\t}", "function serve() {\n var server = gls.static('dist/', PORT);\n //server.start();\n var promise = server.start();\n //optionally handle the server process exiting\n promise.then(function(result) {\n console.log('server started')\n openBrowser()\n });\n}", "function startListen() {\r\n if (!_startWebServer)\r\n return;\r\n\r\n try {\r\n if (settingsHelper.settings.port != undefined)\r\n port = settingsHelper.settings.port;\r\n\r\n self.onLog(\"Listening to port: \" + settingsHelper.settings.port);\r\n self.onLog();\r\n\r\n server = http.createServer(app);\r\n\r\n // parse application/x-www-form-urlencoded\r\n app.use(bodyParser.urlencoded({ extended: false }));\r\n\r\n app.use(function (req, res) {\r\n res.header('Content-Type', 'text/html');\r\n var response = '<style>body {font-family: \"Helvetica Neue\",Helvetica,Arial,sans-serif; background: rgb(52, 73, 94); color: white;}</style>';\r\n response += '<h1><img src=\"https://microservicebus.com/Images/Logotypes/Logo6.svg\" style=\"height:75px\"/> Welcome to the ' + settingsHelper.settings.nodeName + ' node</h1><h2 style=\"margin-left: 80px\">API List</h2>';\r\n\r\n app._router.stack.forEach(function (endpoint) {\r\n if (endpoint.route != undefined) {\r\n if (endpoint.route.methods.get != undefined && endpoint.route.methods.get == true)\r\n response += '<div style=\"margin-left: 80px\"><b>GET</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.delete != undefined && endpoint.route.methods.delete == true)\r\n response += '<div style=\"margin-left: 80px\"><b>DELETE</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.post != undefined && endpoint.route.methods.post == true)\r\n response += '<div style=\"margin-left: 80px\"><b>POST</b> ' + endpoint.route.path + \"</div>\";\r\n if (endpoint.route.methods.put != undefined && endpoint.route.methods.put == true)\r\n response += '<div style=\"margin-left: 80px\"><b>PUT</b> ' + endpoint.route.path + \"</div>\";\r\n }\r\n });\r\n\r\n res.send(response);\r\n });\r\n\r\n app.use('/', express.static(__dirname + '/html'));\r\n\r\n self.onLog(\"REST endpoints:\".green);\r\n app._router.stack.forEach(function (endpoint) {\r\n if (endpoint.route != undefined) {\r\n if (endpoint.route.methods.get != undefined && endpoint.route.methods.get == true)\r\n self.onLog(\"GET: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.delete != undefined && endpoint.route.methods.delete == true)\r\n self.onLog(\"DELETE: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.post != undefined && endpoint.route.methods.post == true)\r\n self.onLog(\"POST: \".yellow + endpoint.route.path);\r\n if (endpoint.route.methods.put != undefined && endpoint.route.methods.put == true)\r\n self.onLog(\"PUT: \".yellow + endpoint.route.path);\r\n }\r\n });\r\n\r\n server = http.createServer(app).listen(port, function (err) {\r\n self.onLog(\"Server started on port: \".green + port);\r\n self.onLog();\r\n });\r\n }\r\n catch (e) {\r\n self.onLog('Unable to start listening on port ' + port);\r\n }\r\n }", "start() {\r\n this.server.listen(process.env.PORT, () => {\r\n logger.info(colors.green(`● API server running on [::]:${ process.env.PORT }`));\r\n });\r\n }", "start(){\n this.applyMiddleWare();\n this.init();\n this.instance.listen(process.env.SERVER_PORT,()=>{\n console.log(`Server started on port ${process.env.SERVER_HOST}.`);\n console.log(`Navigate to http://${process.env.SERVER_HOST}:${process.env.SERVER_PORT}`);\n });\n }", "start() {\n this._app.listen(config.get('web.port'), config.get('web.address'));\n LogService.info(\"ApiHandler\", \"API Listening on \" + config.get(\"web.address\") + \":\" + config.get(\"web.port\"));\n }", "function start(){\n var port = process.env.PORT || config.server.port;\n app.listen(port);\n console.log(\"server pid %s listening on port %s in %s mode\",\n process.pid,\n port,\n app.get('env')\n );\n}", "function start(){\n server = http.createServer(app).listen( config.port );\n logger.info((new Date()).toString()+ \":: PROJECT_NAME server listening on port::\", config.port, \", environment:: \", app.settings.env);\n}", "function Server() {\n this.app = express_1[\"default\"]();\n this.config();\n }", "async function startStaticServer() {\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(cors());\n\tapp.use(`/${config.staticHtmlUrl}`, express.static(config.staticHtmlPath), serveIndex(config.staticHtmlPath, {\n\t\ticons: true,\n\t\thidden: true,\n\t\tstylesheet: path.resolve(__dirname, './directory.css'),\n\t}));\n\tapp.listen(config.staticHtmlPort, () => {\n\t\tconsole.log(`Vela static files server serving files in ${config.staticHtmlPath} at http://localhost:${config.staticHtmlPort}/${config.staticHtmlUrl}`);\n\t});\n}", "async function start() {\n // Create and start the server. Any errors during creation are fatal.\n try {\n // Create the server.\n const server = await create();\n\n // Make sure we can handle unhandled rejections and signals.\n handleUnhandledRejections(process, server);\n handleSignals(process, server);\n\n // Add all of the routes.\n server.route(sendOtpRoute);\n server.route(healthcheckRoute);\n\n // Start the server, log details of where it is running.\n await server.start();\n const { protocol, host, port } = server.info;\n server.log('info', `Server running at: ${protocol}://${host}:${port}`);\n } catch (err) {\n console.log(`An error occurred starting the server: ${err}`);\n process.exit(1);\n }\n}", "function startExpress(connection) {\n routes.setup(app, handlers)\n app._rdpConn = connection\n app.listen(config.express.port)\n console.log('Listening on port' + config.express.port)\n exports = module.exports = app\n }", "start() {\n // listen to coming requests\n const port = Number(this.config.port || process.env.PORT || 0);\n const host = this.config.host || '127.0.0.1';\n this.server.listen(port, host, () => {\n this.app.locals.url = `${this.app.locals.schema}://${host}:${port}`;\n log.info(`Server started on ${this.app.locals.url}`);\n });\n }", "function startServer() {\n\tserver = require(__dirname + '/NetworkServer');\n\tserver.startServer();\n}", "initializeServer() {\n this.createRoutes();\n\n // Create an Express app\n this.app = express();\n\n // Create a server\n this.server = http.createServer(this.app);\n\n // Health endpoint\n this.app.get('/health', (req, res) => { res.json({ status: 'healthy' }) });\n\n //setup basic authentication\n this.app.use(auth);\n\n // Initialize the runtime with a server and settings\n RED.init(this.server, this.redSettings);\n console.log('%s is the userDir for RED', this.redSettings.userDir);\n\n // Serve the editor UI from /red\n this.app.use(this.redSettings.httpAdminRoot,RED.httpAdmin);\n\n // Serve the http nodes UI from /api\n this.app.use(this.redSettings.httpNodeRoot,RED.httpNode);\n\n // Add a simple route for static content served from 'public'\n //self.app.use(\"/\",express.static(\"public\"));\n\n // Add handlers for the app (from the routes).\n for (let r in this.routes) {\n this.app.get(r, this.routes[r]);\n }\n }", "async function start() {\r\n await server.register(vision);\r\n //Defining the templating engine for handlebars\r\n server.views({\r\n engines: {\r\n html: require('handlebars')\r\n\r\n },\r\n relativeTo: __dirname\r\n });\r\n try {\r\n await server.start();\r\n }\r\n catch (err) {\r\n console.log(err);\r\n process.exit(1);\r\n }\r\n console.log('Server running at:', server.info.uri);\r\n\r\n}", "function startExpress(db) {\n\n\tvar app = require('./app')(db);\n\tvar server = http.createServer(app);\n\n\tserver.listen(settings.port, function() {\n\t\tapp.set('port', server.address().port);\n\t\tlog.info('App server listening on port ' + app.get('port') + ' in `' + settings.env + '` mode.');\n\t});\n}", "function startListening() {\n app.listen(port);\n console.log('+---------------------------+');\n console.log(`| express listening on ${port} |`);\n console.log('+---------------------------+\\n');\n }", "function startServer(){\n server.start((err) => {\n if (err) {\n throw err;\n }\n console.log(`Server running at: ${server.info.uri}`);\n //pino.info('Server running at 8080')\n });\n}", "function server () {\n return http.createServer(function (req, res) {\n var pathname = url.parse(req.url).pathname\n pathname = pathname === '/' ? '/index.html' : pathname\n const ext = path.extname(pathname)\n\n console.log(JSON.stringify({url: pathname, type: 'static'}))\n\n if (ext === '.css') res.setHeader('Content-Type', 'text/css')\n if (ext === '.js') res.setHeader('Content-Type', 'application/javascript')\n\n router.match(pathname, function (err, body) {\n if (err) {\n err = (typeof err === 'object') ? err.toString() : err\n const ndj = JSON.stringify({level: 'error', url: pathname, message: err})\n console.log(ndj)\n }\n if (isStream(body)) return body.pipe(res)\n res.end(body)\n })\n })\n}", "function server(req, res) {\r\n var self = this;\r\n req.startTime = Date.now();\r\n req.query = qs.parse(url.parse(req.url).query);\r\n // Hack to make it work with weird paths and encoding types, especial\r\n // File names with spaces like \"Hi world.pdf\" or \"niña.pdf\"\r\n // Hat tip to @mathias\r\n req.url = decodeURIComponent(url.parse(req.url).pathname);\r\n //\r\n // Emit the method to the parent if I can't handle it yep before of anything else.\r\n // So you can do:\r\n // var myapp = require('nhouston')(options);\r\n // myapp.on('POST', function(req,res){ /* my codez */});\r\n //\r\n res.error = function(code, msg) {\r\n res.statusCode = code || 500;\r\n res.setHeader('Content-type', 'text/html');\r\n return res.end(\r\n '<div style=\"text-align:center\"><h1> ' + code + ' - ' + msg + ' </h1><hr>' +\r\n '<p> node-' + process.version + ' running on ' + cfg.port + '</p></div>'\r\n );\r\n };\r\n\r\n res.setHeader('Server', 'node/' + process.version.replace('v', '') + ' (' + os + ')');\r\n res.setHeader('X-Powered-By', pkg.name + '/' + pkg.version);\r\n\r\n if (self.listeners(req.url).length) {\r\n return self.emit(req.url, req, res)\r\n }\r\n if (req.method != 'GET' && self.listeners(req.method).length) {\r\n return self.emit(req.method, req, res);\r\n } else if (req.method != 'GET') {\r\n return res.error(501, 'Not Implemented');\r\n }\r\n\r\n var absolute = path.join(cfg.path, req.url),\r\n isPublic = req.url.substr(0, 8) == '/public/',\r\n rabpub = '';\r\n\r\n req.isPublic = isPublic;\r\n\r\n req.once('error', function() {\r\n res.error(500, 'Internal Server Error');\r\n });\r\n\r\n var ext = path.extname(req.url).replace('.', '');\r\n\r\n if (req.url == '/favicon.ico')\r\n return pipeStream(__dirname + '/../public/img.png', req, res);\r\n if (isPublic) rabpub = path.join(__dirname, '..', req.url);\r\n\r\n if (req.url === '/') {\r\n readContents(cfg.path, req, res);\r\n } else if (req.url !== '/favicon.ico' && !isPublic) {\r\n\r\n if (existsSync(absolute)) {\r\n var stats = fs.statSync(absolute);\r\n if (res.statusCode == 304) return res.end();\r\n if (stats.isDirectory()) {\r\n readContents(absolute, req, res);\r\n } else {\r\n pipeStream(absolute, req, res);\r\n }\r\n csl.log(req.method + req.url, (Date.now() - req.startTime) + 'ms');\r\n } else {\r\n var raw = req.query.raw === false || req.query.raw == 'false';\r\n if (!req.query.raw) raw = true;\r\n // Custom actions for your files\r\n if (actions[ext] && raw) {\r\n if (typeof actions[ext] == 'function') {\r\n return actions[ext].call(actions, req, res);\r\n }\r\n }\r\n else\r\n res.error(404, 'Not found');\r\n }\r\n } else if (isPublic && existsSync(rabpub) && !fs.statSync(rabpub).isDirectory()) {\r\n\r\n pipeStream(rabpub, req, res);\r\n\r\n } else if (isPublic && existsSync(req.url)) {\r\n\r\n if (path.extname(req.url) === '') {\r\n res.writeHeader(200, {\r\n 'Content-type': 'text/html'\r\n });\r\n return res.end(readDir(rabpub));\r\n }\r\n } else if (isPublic) {\r\n pipeStream(__dirname + '/../public/default.png', req, res);\r\n } else {\r\n var raw = req.query.raw === false || req.query.raw == 'false';\r\n if (!req.query.raw) raw = true;\r\n // Custom actions for your files\r\n if (actions[ext] && raw) {\r\n if (typeof actions[ext] == 'function') {\r\n return actions[ext].call(actions, req, res);\r\n }\r\n } else \r\n return res.error(404, 'Not found');\r\n }\r\n}", "function start(router, handle, port){\n //Use our specific router to handle our traffic.\n app.use(function(req, res, next){\n //Determine the route\n var path = url.parse(req.url).pathname;\n //If the route exists in our handler, handle it, otherwise let the next router try.\n if(router.routeExists(path, handle)){\n router.routeEnding(path, handle, req, res);\n }\n else{\n next();\n }\n});\n\n//Global routing for routes we don't handle ourselves. It will look in the html folder for the files for serving the pages, otherwise the user gets a not found response.\napp.use(express.static(__dirname + '/html'));\n\n//Listen on the port for traffic.\napp.listen(port);\n\nconsole.log(\"Server started..\");\n}", "function serve() {\n connect.server(serverConfig);\n}", "function startBuildServer() {\n const app = express();\n const root = path.join(__dirname, '../build');\n app.use(express.static(root));\n app.use(fallback('index.html', { root }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n app.listen(pkgJson.rekit.buildPort, err => {\n if (err) {\n console.error(err);\n }\n\n console.log(`Dist server at http://localhost:${pkgJson.rekit.buildPort}/`);\n });\n}", "function startStudioServer() {\n console.log('Starting Rekit Studio...');\n const app = express();\n const server = http.createServer(app);\n const root = path.join(__dirname, '../node_modules/rekit-studio/dist');\n app.use(rekitStudioMiddleWare()(server, app, { readonly: !!args.readonly }));\n app.use(express.static(root));\n app.use(fallback('index.html', { root }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n const port = pkgJson.rekit.studioPort;\n server.listen(port, err => {\n if (err) {\n console.error(err);\n }\n\n console.log(`Studio server is listening at http://localhost:${port}/`);\n });\n}", "start() {\n\t\tlet self = this;\n\t\tthis.app.listen(this.app.get(\"port\"), () => {\n\t\t\tconsole.log(`Server Listening for port: ${self.app.get(\"port\")}`);\n\t\t});\n\t}", "async start() {\n let configHttp = config.get('http');\n let port = process.env.PORT || configHttp.port;\n\n log.info('start express server on port %s', port);\n\n return new Promise(function(resolve) {\n httpHandle = expressApp.listen(port, function() {\n log.info('express server started');\n resolve();\n });\n });\n }", "startFractalServer () {\n const server = fractal.web.server(this.generateServerSettings('fractal'))\n return server.start().then(() => {\n console.log(`Fractal server is now running at:\\nLocal: ${server.url}\\nExternal: ${server.urls.sync.external}\\nBS UI: ${server.urls.sync.ui}`)\n })\n }", "constructor() {\n\t\tthis.app = express();\n\t\tthis.initExpress();\n\t\tthis.initExpressMiddleWare();\n\t\tthis.initControllers();\n\t\tthis.start();\n\t}", "star() {\n this.app.listen(this.app.get(\"PORT\"), () => {\n console.log(\"Server in port\", this.app.get(\"PORT\"));\n });\n }", "function main () {\n let app = express(); // Export app for other routes to use\n let handlers = new HandlerGenerator();\n const port = process.env.PORT || 8000;\n app.use(bodyParser.urlencoded({ // Middleware\n extended: true\n }));\n app.use(bodyParser.json());\n // Routes & Handlers\n app.post('/login', handlers.login);\n app.get('/', middleware.checkToken, handlers.index);\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\n}", "function init() {\n // app.engine(\"html\", require(\"express-art-template\"));\n\n //Use css and javascript file\n app.use(\"/style/\", express.static(\"./style/\"));\n app.use(express.static(__dirname + \"/script\"));\n\n //Launch index.html\n app.get(\"/\", function (request, response) {\n response.sendFile(__dirname + \"/index.html\");\n });\n app.listen(process.env.PORT || 5000, () => console.log(\"Server started\"));\n}", "function startServer()\n{\n\tconsole.log(\"Starting web controller...\");\n\n\tvar http = require('http');\n\thttp.createServer(function (req, res) {\n\n\t\t function respond() {\n\t\t\tres.writeHead(200, { \"Content-Type\": \"text/html\" });\n\t\t\tres.write(\"<!DOCTYPE html><html><body>\");\t\t\n\t\t\tres.write(\"<h1>Intel Galileo web controller</h1>\");\n\t\t\tres.write(\"</p><p>LED Status : \");\n\t\t\tres.write(ledstatus);\n\t\t\tres.write(\"</p><p>Actions</p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOn\\\"' value='Turn LED on'/></p>\");\n\t\t\tres.write(\"<p><input type='button' onclick='location.pathname = \\\"/ledOff\\\"' value='Turn LED off'/></p>\");\n res.write(\"<p><input type='button' onclick='location.pathname = \\\"/hit\\\"' value='Hit'/></p>\");\n\t\t\tres.write(\"</body></html>\");\n\t \t\tres.end();\n\t\t}\n\n\t\tconsole.log(\"Request: \" + req.url);\n\t\tvar mraa = require('mraa');\n \n\t\tif(req.url === \"/ledOn\")\n\t\t\tturnOnLed();\n\t\telse if(req.url === \"/ledOff\")\n\t\t\tturnOffLed();\n else if(req.url === \"/hit\")\n\t\t\thit(mraa);\n\n\t\trespond();\n \t\t\n\t}).listen(1337);\n\tconsole.log('Server running at http://localhost:1337/');\n}", "async function startService () {\n try {\n app.use(express.json())\n app.use(express.static('public'))\n await startMicroLib()\n reloadCallback()\n startWebServer()\n } catch (e) {\n console.error(e)\n }\n}", "async function serve() {\n createCtrlcHandler('serve');\n logServeMode();\n watch(serverFiles, restartServer);\n await startServer();\n await performPreBuildSteps();\n}", "start() {\n this.app.listen(this.app.get('port'), () => {\n console.log(`####### Listen on port ${this.app.get('port')} #######`);\n });\n }", "function start(rootFolder, portNumber) {\n var root = rootFolder || './docs';\n var port = portNumber || process.env.PORT || serverConfig.port;\n\n server.set('port', port);\n\n server.use('/docs', express.static(root));\n server.use('/dist', express.static('./dist'));\n\n server.use(function (req, res) {\n console.error(chalk.red.bold('Unable to resolve the following resource: ' + req.originalUrl));\n res.status(404).send('Sorry cant find that!');\n });\n\n if (typeof port !== 'number') {\n port = parseInt(port, 10);\n }\n\n listener = server.listen(port, function () {\n console.log(chalk.magenta.bold('Express server listening on port ' + port.toString() + '...'));\n });\n listener.on('error', onError);\n}", "function start(){\n var port = process.env.PORT || 3030;\n app.listen(port);\n console.log(\"server pid %s listening on port %s in %s mode\",\n process.pid,\n port,\n app.get('env')\n );\n}", "function startServer() {\r\n // Start listening on port 3000\r\n httpServer.listen(Constants.PORT, function () {\r\n console.log('listening on *: ', Constants.PORT);\r\n });\r\n\r\n // Start serving the game\r\n let server = new GameServer(io);\r\n server.init();\r\n}", "start() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n // Address and port are available as soon as the server\n // started listening, resolving localhost requires\n // some time.\n this.server.listen(0, \"localhost\", (error) => {\n if (error) {\n reject(error);\n return;\n }\n // tslint:disable-next-line\n console.log(`Express server listening on port: ${this.server.address().port}`);\n resolve();\n });\n });\n });\n }", "function server(options) {\n\toptions = options || {};\n\tconst port = options.port || 0;\n\tconst listen = options.listen || '::1';\n\tconst handlers = options.handlers || [static_handler.file_handler('/', ROOT_DIR)];\n\n\tconst serv = http.createServer((req, res) => {\n\t\treq.socket.setNoDelay(true);\n\n\t\tconst pathname = url.parse(req.url).pathname;\n\n\t\tfor (const h of handlers) {\n\t\t\tif (h(req, res, pathname) !== 'unhandled') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n\tserv.listen(port, listen, () => {\n\t\tconst domain = ((listen === '::') || (listen == '0.0.0.0')) ? 'localhost' : (\n\t\t\tlisten.includes(':') ? `[${listen}]` : listen\n\t\t);\n\t\tif (options.start_callback) {\n\t\t\toptions.start_callback(null, 'http://' + domain + ':' + serv.address().port + '/');\n\t\t}\n\t});\n\tserv.on('error', (err) => {\n\t\tthrow err;\n\t});\n\treturn serv;\n}", "async function main(args = null) {\n\n let app = express();\n\n await middleware(app, process.env);\n\n app.use('/api', routes);\n\n app.use((req, res) => {\n res.status('404').send();\n });\n\n app.listen(app.get('port'), () => {\n console.log('Express server listening on port: ', app.get('port'));\n });\n\n return app;\n}", "function serve() {\n connect().use(serveStatic(__dirname + \"/_site\")).listen(port, function() {\n console.log('Content served on http://localhost:' + port);\n });\n}", "async function startApiServer({ deps }) {\n\n\tconst models = deps.models;\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(cors());\n\n\tapp.get('/', (req, res) => {\n\t\tres.send('This is the vela GUI API server');\n\t});\n\n\tapp.post('/', async (req, res) => {\n\t\tconst { operationName, args } = req.body;\n\t\tconst operation = get(models, operationName);\n\t\tlet result;\n\t\tif (Array.isArray(args)) {\n\t\t\tresult = await operation(...args);\n\t\t} else {\n\t\t\tresult = await operation(args);\n\t\t}\n\t\tif (result instanceof ArrayCursor) {\n\t\t\tres.send({ data: 'OK' });\n\t\t} else {\n\t\t\tres.send({ data: result });\n\t\t}\n\t});\n\n\tapp.listen(config.apiPort, () => {\n\t\tconsole.log(`Vela GUI API server listening at http://localhost:${config.apiPort}`);\n\t});\n\n}", "async function start() {\n await initialize();\n app.listen(port, () => {\n console.log(`API available at http://localhost:${port}/api`);\n });\n}", "function start(route) {\n function onRequest(req, res) {\n // server code\n console.log(\"Request Received\");\n\n var pathname = localURL.parse(req.url).pathname;\n console.log(\"Request for \" + pathname + \" received.\");\n \n route(pathname);\n\n switch (pathname) {\n case '/':\n\n res.writeHead(200, {'Content-Type': 'text/plain'});\n appId(res);\n res.end('res.end\\n');\n break;\n\n default:\n fourZeroFour(res);\n\n }\n }\n\n var server = localHTTP.createServer(onRequest);\n\n if (process.env.PORT === undefined) {\n console.log('Running locally; browse to http://localhost:8888/\\n');\n server.listen(8888, '127.0.0.1');\n } else { // Running on c9.io.\n server.listen(process.env.PORT, '0.0.0.0');\n console.log(\"Server has started.\");\n console.log(\"Listning on port: \" + process.env.PORT);\n }\n}", "function startServer() {\n protocolDownloader\n .getSchemas()\n .catch(e => process.exit(1))\n .then(() => schemaParser.readSchemas())\n .then(() =>\n app.listen(port, () => console.log(`Server starting at port: ${port}!`))\n );\n}", "async function startServer(){\n await loaders({ expressApp:app })\n server.listen(port);\n server.on('error', onError);\n server.on('listening', onListening);\n process.on('SIGINT', function(){\n mongoose.connection.close(function(){\n console.log(\"Mongoose default connection is disconnected due to application termination\");\n process.exit(0);\n });\n });\n}", "async boot() {\r\n\t\tconst app = express();\r\n\t\tapp.get(\"/status/\", function(req, res) {\r\n\t\t\tres.json({ start : Date.now() });\r\n\t\t});\r\n\r\n\t\tconst server = new ApolloServer({\r\n\t\t\tschema : await schemaLoader({ graphqlRootDirectory : this.path })\r\n\t\t});\r\n\t\t\r\n\t\tserver.applyMiddleware({\r\n\t\t\tapp,\r\n\t\t\tpath : \"/\"\r\n\t\t});\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tconst expressServer = app.listen(this.port, function(err) {\r\n\t\t\t\tif (err) { return reject(err); }\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t});\r\n\r\n\t\t\tthis.httpServer = expressServer;\r\n\t\t});\r\n\t}", "function startServer() {\n const proxyApp = express();\n const webServer = require('http').createServer(proxyApp);\n const port = process.env.port || 3088;\n\n // set up routes and enable CORS\n proxyApp.use(cors())\n proxyApp.get('/api/cars', getCarOwners); \n const path = __dirname + '/../dist';\n console.log('Hosting server at http://localhost:' + port)\n if (fs.existsSync(path)) {\n const staticContent = express.static(path);\n proxyApp.use(staticContent);\n } else {\n proxyApp.get('/', (req, res, next) => {\n res.send('<h1>Applicaton not built and published</h1>')\n next();\n });\n }\n\n // local server for Dev acting as Proxy for original service\n webServer.listen(port, () => {\n successlog.info('CORS enabled proxy API server launched..');\n });\n}", "startServer() {\n const server = fractal.web.server();\n\n server.on('error', err => logger.error(err.message));\n\n return server.start().then(() => {\n // Code to make a nicer console output.\n const header = 'Fractal Web UI server is running!';\n const footer = fractal.cli.isInteractive() ? 'Use the \\'stop\\' command to stop the server.' : 'Use ^C to stop the server.';\n const serverUrl = server.urls.server;\n const format = str => logger.theme.format(str, 'success', true);\n let body = '';\n\n if (!server.isSynced) {\n body += `Local URL: ${format(serverUrl)}`;\n } else {\n const syncUrls = server.urls.sync;\n body += `Local URL: ${format(syncUrls.local)}`;\n body += `\\nNetwork URL: ${format(syncUrls.external)}`;\n body += `\\nBrowserSync UI: ${format(syncUrls.ui)}`;\n }\n\n return logger.box(header, body, footer).persist();\n });\n }", "serve() {\n\t\tconst server = new Server(this);\n\t\tconst serverConfig = this._config.devServer;\n\n\t\tserver.logServer('/log');\n\n\t\tif (serverConfig.enableRawProxy) {\n\t\t\tserver.rawProxy('/proxy');\n\t\t}\n\n\t\tconst proxyMap = serverConfig.proxy;\n\t\tObject.keys(proxyMap)\n\t\t\t.forEach((path) => {\n\t\t\t\tserver.proxy(path, proxyMap[path]);\n\t\t\t});\n\n\t\tlet staticFiles = {};\n\t\tfor (const entity of this._config.include) {\n\t\t\tif (entity.static) {\n\t\t\t\tstaticFiles = Object.assign(staticFiles, entity.static);\n\t\t\t}\n\t\t}\n\n\t\tlogger.silly(`Serving static files: \\n${JSON.stringify(staticFiles, null, '\\t')}`);\n\n\t\tfor (const [customPath, filePath] of Object.entries(staticFiles)) {\n\t\t\tconst alias = `/${customPath.replace(/^\\//, '')}`;\n\t\t\tconst absolutePath = this._pathHelper.resolveAbsolutePath(filePath);\n\n\t\t\tif (fs.existsSync(absolutePath)) {\n\t\t\t\tserver.serveStatic(alias, absolutePath);\n\t\t\t} else {\n\t\t\t\tlogger.warn(`Can't serve static path ${kleur.green(alias)} from ${kleur.underline(absolutePath)}`);\n\t\t\t}\n\t\t}\n\n\t\tthis._codeSource.watch();\n\n\t\tserver.start(serverConfig.port)\n\t\t\t.then((addresss) => {\n\t\t\t\tlogger.output(`Server started at ${kleur.underline(addresss)}`);\n\t\t\t}, (err) => {\n\t\t\t\tlogger.error(`Error starting server: ${err.toString()}`);\n\t\t\t\tlogger.debug(err.stack);\n\t\t\t});\n\t}", "function runServer() {\n server.listen(port);\n server.on('error', onError);\n server.on('listening', onListening);\n /**\n * Signaling Server\n */\n require('../Signaling-Server.js')(server);\n}", "async function start () {\n await app.initDB()\n app.initSocket()\n app.initMiddlewares()\n app.initSubApp()\n await app.initHttp()\n }", "function startListening() {\n app.listen(8000, function() {\n console.log(\"server is started: http://localhost:8000 ⚡️\");\n });\n}", "async start() {\n await this.resolvePort();\n\n const Koa = (this.Koa = require('koa'));\n const bodyParser = require('koa-bodyparser');\n const Http = require('http');\n const koaApp = (this.koaApp = new Koa());\n\n this.httpServer = Http.createServer(koaApp.callback());\n\n let { publicPath, publicPaths } = this.config;\n\n await rapid._hookEmit('middlewareWillAttach');\n if (publicPath) addPublicDir(publicPath);\n if (publicPaths) publicPaths.forEach(addPublicDir);\n\n koaApp.use(errorHandlerMiddleware);\n koaApp.use(addUtilityFunctionsMiddleware);\n koaApp.use(loggerMiddleware);\n koaApp.use(bodyParser());\n\n if (this.config.cors) {\n koaApp.use(koaCors());\n }\n await rapid._hookEmit('middlewareDidAttach');\n\n function addPublicDir(publicPath) {\n const serveStatic = require('koa-static');\n const fullPublicPath = rapid.localPath(publicPath);\n koaApp.use(serveStatic(fullPublicPath));\n }\n }", "function startServer () {\n app.use(sass({\n src: path.join(__dirname, 'themes/' + brigadeDetails.theme.slug + '/public'),\n dest: path.join(__dirname, 'themes/' + brigadeDetails.theme.slug + '/public'),\n debug: true,\n sourceMap: true,\n outputStyle: 'expanded'\n }))\n app.use(function (req, res, next) {\n if (_.filter(res.locals.brigade.redirects, {endpoint: req.path}).length) {\n var redirect = _.filter(res.locals.brigade.redirects, {endpoint: req.path})[0]\n if (redirect.type === 'permanent') {\n return res.redirect(301, redirect.destination)\n }\n return res.redirect(redirect.destination)\n }\n next()\n })\n app.use(favicon(path.join(__dirname, 'themes/' + brigadeDetails.theme.slug + '/public', 'favicon.png')))\n app.use(express.static(path.join(__dirname, 'themes/' + brigadeDetails.theme.slug + '/public'), { maxAge: 31557600000 }))\n \n // static resources for components\n app.use(\"/common\", \n express.static(path.resolve(__dirname, '../common/public')));\n app.use(\"/components/project-list\", \n express.static(path.resolve(__dirname, '../project-list')));\n app.use(\"/components/slackbot\", \n express.static(path.resolve(__dirname, '../slackbot')));\n app.use(\"/components/minmaximizer\", \n express.static(path.resolve(__dirname, '../minmaximizer/public')));\n app.use(\"/components/selector\", \n express.static(path.resolve(__dirname, '../selector_ui/public')));\n app.use(\"/components/messaging\", \n express.static(path.resolve(__dirname, '../messaging/public/messaging')));\n\n // for development\n app.locals.pretty = true; // sets jade/pug HTML to render pretty\n\n app.listen(app.get('port'), function () {\n console.log('[BrigadeMatchmaker]'.yellow + ' Server listening on port', app.get('port'))\n })\n}", "function listen () {\n\t\n\tif (app.get('env') === 'test') return;\n \tapp.listen(port);\n \tconsole.log('Express app started on port ' + port);\n}", "function serve(cb) {\n return exec('http-server', [], (err, stdout, stderr) => {\n console.log(stdout);\n console.log(stderr);\n cb(err);\n });\n}", "function startHttpServer() {\n return new Promise(resolve => { // Wrap in a promise so we can be notified when the server has started.\n const app = express();\n setupHandlers(app);\n\n const port = process.env.PORT && parseInt(process.env.PORT) || 3000;\n app.listen(port, () => {\n resolve(); // HTTP server is listening, resolve the promise.\n });\n });\n}", "function startServer() {\n\n\n\tapp.use(passport.initialize());\n\tapp.use(passport.session()); // persistent login sessions\n\t require('./config/passport')(passport); // pass passport for configuration\n\t\n\t////////////////////////\n\t// Setup Facebook App //\n\t////////////////////////\n\t\n\t// Read config from config.json\n\ttry {\n\t\tlet obj;\n\t\tfs.readFile('config.json', 'utf8', (err, data) => {\n \t\t\n \t\tif (err) {\n \t\t\tthrow err;\n \t\t}\n \t\tobj = JSON.parse(data);\n\t});\n\n\t} catch (err) {\n\t\tconsole.log(err);\n\t}\n\n\trequire('./app/routes.js')(app, passport); \n\n\tapp.listen(port);\n\tconsole.log(`Feed Aggregator started on Port${port}`);\n}", "function createServer () {\n\n // Create server\n\n var server = express.createServer();\n\n // Configure Server\n\n server.configure(function () {\n\n // Built-in\n\n server.use(express.methodOverride()); // Allow method override using _method form parameter\n server.use(express.bodyDecoder()); \t // Parse application/x-www-form-urlencoded\n server.use(express.staticProvider(__dirname + '/files')); // Serve client documents in local directory\n\n // Local\n\n server.use(setResponseHeader()); // Set default response headers for CORS\n server.use(logConsole()); // Display incoming requests\n\n // Authentication\n\n server.use(auth([auth.Mac({ realm: \"Example\", // Set realm, typically a domain name or application name\n getTokenAttributes: getToken, // Function used to fetch the access token record, typically from a database\n // hostHeader: 'x-forwarded-host', // Needed when running behind a proxy such as Apache2\n // isHTTPS: true, // Uncomment for HTTPS\n checkNonce: nonceCheck, // Optional nonce checking function\n bodyHashMode: \"require\" })])); // Require body hash validation for all non GET/HEAD/OPTIONS requests\n });\n\n // Setup generic OPTIONS route\n\n server.options(/.+/, function (req, res) {\n\n res.send(' ');\n });\n\n return server;\n}", "appExecute() {\n\n\t\tthis.appConfig();\n\t\tthis.includeRoutes(this.app);\n\n\t\tthis.http.listen(this.port, this.host, () => {\n\t\t\tconsole.log(`Listening on http://${this.host}:${this.port}`);\n\t\t});\n\t}", "constructor(options) {\n // Path and port are mandatory\n if (!options.path && !options.port) {\n throw new Error('You have to chose a directory and a port');\n }\n if (!options.path) {\n throw new Error('You have to chose a directory');\n }\n if (!options.port) {\n throw new Error('You have to chose a port'); \n }\n\n this.id = uuid.v1();\n\n let defaultOptions = {\n isActive: false,\n pug: false\n //autoIndex: true,\n //download: false\n }\n\n extend(defaultOptions, options);\n\n this.params = {\n path: defaultOptions.path,\n port: defaultOptions.port,\n pug: defaultOptions.pug\n };\n\n this.isActive = defaultOptions.isActive;\n //this.autoIndex = defaultOptions.autoIndex;\n //this.download = defaultOptions.download;\n\n // Create express app\n this._app = express();\n\n // Configure template engines\n this._app.set('view engine', 'pug');\n this._app.set('views', this.params.path);\n\n \n // Pug middlware\n if (this.params.pug) {\n // Enable pug template engine for jade extensions too\n this._app.engines = {'.jade': require('pug').__express};\n \n this._app.use(['*.pug', '*.jade'], (req, res, next) => {\n res.render(path.join(this.params.path, req.originalUrl));\n });\n }\n\n // Set middleware for static files\n this._app.use(express.static(this.params.path));\n\n // Create the static server\n this._createServer();\n\n if (this.isActive) {\n this.start();\n }\n }", "function launchExpress() {\n return __awaiter(this, void 0, void 0, function* () {\n log.debug(__filename, 'launchExpress()', 'Configuring express HTTPServer...');\n // allow cross-origin-resource-sharing\n app.use(cors_1.default());\n // enable http compression middleware\n app.use(compression_1.default());\n // set up the basic auth middleware\n app.use(express_basic_auth_1.default({\n authorizer: authUser,\n authorizeAsync: true,\n unauthorizedResponse: authFailed,\n }));\n // enable bodyParser middleware for json\n app.use(body_parser_1.default.urlencoded({ extended: true }));\n // have to do a little dance around bodyParser.json() to verify request body so that\n // errors can be captured, logged, and responded to cleanly\n app.use((req, res, next) => {\n body_parser_1.default.json({\n verify: addReqBody,\n })(req, res, err => {\n if (err) {\n log.error(__filename, 'app.bodyParser.json()', 'Error encountered while parsing json body.', err);\n res.status(500).json({ status: '400', message: `Unable to parse JSON Body : ${err.name} - ${err.message}` });\n return;\n }\n else {\n log.trace(__filename, `bodyParser(${req.url}, res, next).json`, 'bodyParser.json() completed successfully.');\n }\n next();\n });\n });\n log.force(__filename, 'launchExpress()', `SERVICE CONFIGURATION --> ${config.Service.Name} <--`);\n app.use(config.Service.BaseUrl, router_1.router);\n // catch-all for unhandled requests\n app.get('/*', (req, res) => {\n log.debug(__filename, req.url, 'Invalid Route Requested -> ' + req.url);\n res.status(404).json({\n status: '404',\n message: 'Route not found: ' + req.path,\n });\n });\n // and start the httpServer - starts the service\n httpServer = app.listen(config.HTTP_PORT, () => {\n // sever is now listening - live probe should be active, but ready probe must wait for routes to be mapped.\n log.force(__filename, 'launchExpress()', `Express is listening -> http://${os_1.hostname}:${config.HTTP_PORT}${config.Service.BaseUrl}`);\n log.force(__filename, 'launchExpress()', `[ ${config.Service.Name.toUpperCase()}-SERVICE ] is now LIVE and READY!'`);\n });\n });\n}", "routes() {\n const publicPath = path.join(__dirname, '..', 'tmp', 'frontend', 'build');\n this.server.use('/v1/api', routes);\n this.server.use('/', express.static(publicPath));\n this.server.use('/users/*', express.static(publicPath));\n }", "start() {\n const app = express_1.default();\n let query = new user_serv_1.default();\n // route for GET /\n // returns items\n app.get('/', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let data = yield query.find({});\n response.send(data);\n }));\n app.get('/register', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let user = new user_1.default();\n let answer = yield query.register(user);\n if (answer.result)\n response.send();\n else\n response.status(500).send(answer);\n }));\n // Server is listening to port defined when Server was initiated\n app.listen(this.port, () => {\n console.log(\"Server is running on port \" + this.port);\n });\n }", "function runServer() {\n const port = process.env.PORT || 8080;\n return new Promise((resolve, reject) => {\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve(server);\n })\n .on('error', err => {\n reject(err);\n });\n });\n}", "function start() {\n\n\tMongoClient.connect(settings.MONGO_CONNECTION_STRING, function (err, database) {\n\t\tif (err) {\n\t\t\tlog.error(err, 'Couldn\\'t connect to MongoDB. Did you start it?\\n' +\n\t\t\t\t'Try running `mongod` in another terminal window.');\n\t\t\tlog.error('Killing server process');\n\t\t\t// Give time for output\n\t\t\tsetTimeout(function() {\n\t\t\t\tprocess.exit(1);\n\t\t\t}, 300);\n\n\t\t} else {\n\t\t\tlog.info('Connected to database at: %s', settings.MONGO_CONNECTION_STRING);\n\t\t\tstartExpress(database);\n\n\t\t}\n\t});\n\n}", "function main() {\n const config = createConfig();\n const server = createServer(config);\n\n const {hostname, port} = config.getWebserverHost();\n console.error(`Starting rpi-clock webserver on ${hostname}:${port}`);\n server.listen(port, hostname);\n}", "startServer() {\n let requestHandler = this.onRequest.bind(this);\n let port = this.port;\n http.createServer(requestHandler).listen(port);\n console.log(\"Server running at http://localhost:%d\", port);\n }", "function startHttpServer() {\n var server = http.createServer(httpRequestHandler);\n var port = program.port || httpRequestHandler.get('port');\n\n server.listen(port, function() {\n console.log('\\nPersonalization server listening on port ' + port);\n });\n}", "function runApp() {\n const app = express()\n app.use(bodyParser.json())\n app.use(\n bodyParser.urlencoded({\n extended: false\n })\n )\n app.use(cors())\n\n app.use('/api', snapshotAPI)\n app.use('/api', diffAPI)\n app.use('/api', queryAPI)\n\n const port = process.env.APP_PORT || 4000\n\n app.listen(port, () => {\n logger.info('Trace Differ running on port: ' + port)\n })\n\n app.use((req, res, next) => {\n return res.status(404).send({ message: 'Route' + req.url + ' Not found.' })\n })\n\n app.use((err, req, res, next) => {\n logger.error(err.message)\n if (!err.statusCode) err.statusCode = 500\n res.status(err.statusCode).send(err.message)\n })\n\n scheduler.startScheduler()\n}", "start() {\n\t\tif(!this.config.sources.server || !this.config.start) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet command = 'node';\n\n\t\tif(this.config.runServerWithInspect) {\n\t\t\tcommand += ' --inspect';\n\t\t}\n\n\t\tnodemon({\n\t\t\tscript: resolve(this.config.root, this.config.start),\n\t\t\texec: command,\n\t\t\tignore: ['*'],\n\t\t\twatch: ['ThisIsAFakeDirToDisableNodemonWatch/'],\n\t\t\text: 'noop',\n\t\t\tverbose: true\n\t\t})\n\t\t\t.on('log', ({colour: colorCodedLog}) => console.log(colorCodedLog));\n\t}", "function createServer(options) {\r\n var app;\r\n\r\n if (!options) throw new Error('Invalid options');\r\n\r\n if (typeof options === 'string') cfg.path = options;\r\n else if (typeof options === 'object') cfg = mergeObj(cfg, options);\r\n else throw new TypeError('Type of ' + options + ' is not an object or a string');\r\n\r\n // Right after i read the conf launch the Logger (to be aware of verbose mode);\r\n csl = new Logger();\r\n\r\n // OH! We have a cli app, read the confs from launch args\r\n if (cfg.cli) load();\r\n if (!cfg.safe) template = fs.readFileSync(path.join(__dirname, '..', 'public/index.html'), 'utf8');\r\n // Switch protocols depending on options\r\n // SPDY - HTTPS - HTTP\r\n // And yes just require the valid one\r\n if (options.spdy) app = require('spdy').createServer(https.Server, options.spdy, server);\r\n else if (options.https) {\r\n app = https.createServer(options.https, server);\r\n } else app = http.createServer(server);\r\n\r\n // Avoid loggin twice, because of domains\r\n var logged = 0;\r\n\r\n // When the server is already listing on a port log the conf\r\n\r\n function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }\r\n\r\n // Add the hability to pick the PORT in the env var.\r\n if (!cfg.ignorePort) cfg.ignorePort = true;\r\n if (process.env.PORT && cfg.ignorePort) cfg.port = process.env.PORT;\r\n\r\n var handler = domain.create();\r\n // Yeah just once\r\n handler.once('error', function() {\r\n csl.warn('The port that you provide is in use, trying one more time');\r\n app.listen('', listener);\r\n });\r\n\r\n handler.run(function() {\r\n app.listen(cfg.port, listener);\r\n });\r\n\r\n // Add config (useful for cli apps)\r\n app.config = cfg;\r\n // Important config to share to parent\r\n app.port = cfg.port;\r\n app.path = cfg.path;\r\n // Returns a http server instance\r\n return app;\r\n}", "function initializeServer() {\n\tvar app = express();\n\tapp.use(express.static('./public'));\n\t \n\tvar server = http.createServer(app).listen(config.server.httpServerPort, function(){\n\t\tconsole.log('app.js @', config.server.httpServerPort);\n\t});\n\tio = socketio.listen(server); \n\tio.sockets.on(\"connection\", requestHandler);\n\n}", "start(calback) {\n this.app.listen(this.port, calback);\n }", "function openServer() {\n connect.server({\n host: cfg.server.host,\n root: cfg.server.root,\n port: cfg.server.port,\n livereload: true\n });\n }", "function proccedtoCreateServer()\n{\n var erroredLines=[1,2,3];\n var resultJSONarray = [];\napp.get('/', (req,res) => {\nres.send('Good evening, Mr.Hunt \\n You have to deal with '+erroredLines.length+'errors Should you choose to accept it?');\n});\n\napp.get('/json',(req,res) => {\n console.log(__dirname);\n res.send(resultJSONarray);\n});\n\napp.get('/html',(req,res) => {\n console.log(__dirname);\n res.sendFile(__dirname+'/index.html');\n});\n\n(async () => {\navailablePort = await getPort({port:[8000,8080,8888,9090]});\nconsole.log(chalk.blue('The available port is',availablePort));\nstartListening();\n}) ();\n\nstartListening = function(){\n //spinner.stop(true);\napp.listen(availablePort, ()=>console.log(chalk.green('Server succesfully listening on the port :',availablePort)));\n\n//opn('http://localhost:'+availablePort);\n};\n}", "function start_server(){\n let options = {}\n\n if (config.https.enabled) {\n options = {\n key: fs.readFileSync(config.https.key_file).toString(),\n cert: fs.readFileSync(config.https.cert_file).toString()\n };\n if (config.https.ca_certs) {\n options.ca = [];\n for (const ca in config.https.ca_certs) {\n options.ca.push(fs.readFileSync(config.https.ca_certs[ca]).toString());\n }\n }\n }\n\n const app = require('../app');\n server = http.createServer(app); \n\n /**\n * Get port from environment and store in Express.\n */\n server.listen(normalize_port(config.port));\n server.on('error', on_error);\n server.on('listening', on_listening);\n\n if (config.https.enabled) {\n const serverSecure = https.createServer(options, app);\n\n serverSecure.listen(config.https.port, function() {\n debug('Listening on port ' + serverSecure.address().port);\n });\n }\n}", "function startServer() {\n var server = new Server();\n console.log('server started');\n}", "async function startServer() {\n await server.start(TEST_SERVER_PORT);\n}", "function start (config, options) {\n const server = restify.createServer(options)\n\n server.use(restify.plugins.queryParser())\n\n // eslint-disable-next-line max-params\n server.on('restifyError', function (req, res, err, callback) {\n logger.warn('<-- %s %s', err.name, err.message)\n logger.debug(err.stack)\n return callback()\n })\n\n return createDbClient(config)\n .then(createQueries)\n .then(createRouter)\n .then(function (router) {\n router.applyRoutes(server)\n server.listen(port, function () {\n logger.info('REST API is up')\n })\n return server\n })\n}" ]
[ "0.7082146", "0.7027671", "0.6897448", "0.67825377", "0.66946405", "0.66768146", "0.6635018", "0.6613002", "0.6612314", "0.65605867", "0.649937", "0.64574367", "0.6403853", "0.63922787", "0.63824445", "0.63772255", "0.6366926", "0.63656735", "0.63492167", "0.6319437", "0.6311085", "0.6294826", "0.62931687", "0.62781316", "0.6274887", "0.6272732", "0.6258867", "0.6252582", "0.6239661", "0.62288094", "0.6228596", "0.6223682", "0.62110937", "0.61944556", "0.61943996", "0.6180611", "0.6166425", "0.61563385", "0.6152536", "0.6133738", "0.6131673", "0.61314386", "0.6127623", "0.61249304", "0.6119261", "0.61019486", "0.60987616", "0.6096667", "0.60852027", "0.60789084", "0.60708785", "0.6059285", "0.60467625", "0.60461485", "0.6039903", "0.6035295", "0.6035266", "0.6021206", "0.6015414", "0.60153335", "0.5990668", "0.598768", "0.5980751", "0.5974089", "0.59739596", "0.5939823", "0.59362906", "0.5932146", "0.5926057", "0.592139", "0.59182596", "0.5917156", "0.59165215", "0.59152657", "0.5914665", "0.5905824", "0.5902986", "0.5900081", "0.5898197", "0.589728", "0.5893082", "0.5877344", "0.5850436", "0.58478516", "0.58468", "0.58417094", "0.58332664", "0.5831518", "0.5831201", "0.58222926", "0.5818842", "0.58068657", "0.58049136", "0.5804219", "0.5803595", "0.580319", "0.5802689", "0.5777913", "0.57776225", "0.577541", "0.577222" ]
0.0
-1
Adds all help listeners for plugins
function addHelpListeners (controller, plugins) { _.forEach(plugins, function (plugin) { if (_.get(plugin, 'help.text') && _.get(plugin, 'help.command')) { registerHelpListener(controller, plugin.help) } }) controller.hears('^help$', 'direct_mention,direct_message', function (bot, message) { let helpCommands = _.chain(plugins) .filter((plugin) => !!_.get(plugin, 'help.command')) .map((plugin) => '`@' + bot.identity.name + ' help ' + _.get(plugin, 'help.command') + '`') .value() .join('\n') if (!helpCommands.length) { return bot.reply(message, 'I can\'t help you with anything right now. I still like you though :heart:') } return bot.reply(message, 'Here are some things I can help you with:\n' + helpCommands) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerHelpListener (controller, helpInfo) {\n controller.hears('^help ' + helpInfo.command + '$', 'direct_mention,direct_message', function (bot, message) {\n let replyText = helpInfo.text\n\n if (typeof helpInfo.text === 'function') {\n let helpOpts = _.merge({botName: bot.identity.name}, _.pick(message, ['team', 'channel', 'user']))\n\n replyText = helpInfo.text(helpOpts)\n }\n\n bot.reply(message, replyText)\n })\n}", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "initPlugins() {}", "initPlugins() {}", "addPlugins() {\n const pm = PluginManager.getInstance();\n pm.addPlugin(new ElectronPlugin());\n }", "function addListeners() {\n browser.runtime.onInstalled.addListener( handleOnInstalledEvent );\n browser.runtime.onMessage.addListener( handleOnMessageEvent );\n}", "function addListeners() {\n browser.runtime.onInstalled.addListener(handleInstall);\n browser.runtime.onMessage.addListener(handleMessage);\n browser.alarms.onAlarm.addListener(handleAlarms);\n}", "function loadListeners() {\n\t\t$(\"#iwoot-gui-options\").click(function() {\n\t\t\tif(!IWoot.isGUIHidden) {\n\t\t\t\t$(\"#iwoot-gui-main\").hide(\"slow\");\n\t\t\t\tIWoot.isGUIHidden = true;\n\t\t\t} else {\n\t\t\t\t$(\"#iwoot-gui-main\").show(500);\n\t\t\t\t$(\"#iwoot-gui-main\").css(\"display\", \"block\");\n\t\t\t\tIWoot.isGUIHidden = false;\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-autodubup\").click(function() {\n\t\t\tif(!IWoot.isAutoWoot) {\n\t\t\t\tIWoot.isAutoWoot = true;\n\t\t\t\t$(\"#iwoot-autodubup\").css(\"color\", Color.GREEN);\n\t\t\t\tautoDubUp();\n\t\t\t} else {\n\t\t\t\tIWoot.isAutoWoot = false;\n\t\t\t\t$(\"#iwoot-autodubup\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-chatlimit\").click(function() {\n\t\t\tif(!IWoot.isNoChatLimit) {\n\t\t\t\tIWoot.isNoChatLimit = true;\n\t\t\t\t$(\"#iwoot-chatlimit\").css(\"color\", Color.GREEN);\n\t\t\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n\t\t\t} else {\n\t\t\t\tIWoot.isNoChatLimit = false;\n\t\t\t\t$(\"#iwoot-chatlimit\").css(\"color\", Color.RED);\n\t\t\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"255\");\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-userjoinleave\").click(function() {\n\t\t\tif(!IWoot.isUserJoinLeave) {\n\t\t\t\tIWoot.isUserJoinLeave = true;\n\t\t\t\t$(\"#iwoot-userjoinleave\").css(\"color\", Color.GREEN);\n\t\t\t} else {\n\t\t\t\tIWoot.isUserJoinLeave = false;\n\t\t\t\t$(\"#iwoot-userjoinleave\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-togglevideo\").click(function() {\n\t\t\tvar videoHidden = Dubtrack.room.player.istoggleVideo;\n\t\t\tif(!videoHidden) {\n\t\t\t\t$(\".hideVideo-el\").click();\n\t\t\t\t$(\"#iwoot-togglevideo\").css(\"color\", Color.GREEN);\n\t\t\t} else {\n\t\t\t\t$(\".hideVideo-el\").click();\n\t\t\t\t$(\"#iwoot-togglevideo\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-workmode\").click(function() {\n\t\t\tif(!IWoot.isWorkMode) {\n\t\t\t\t$(\".main-room-wrapper\").css(\"display\", \"none\");\n\t\t\t\t$(\"#iwoot-workmode\").css(\"color\", Color.GREEN);\n\t\t\t\tIWoot.isWorkMode = true;\n\t\t\t} else {\n\t\t\t\t$(\".main-room-wrapper\").css(\"display\", \"block\");\n\t\t\t\t$(\"#iwoot-workmode\").css(\"color\", Color.RED);\n\t\t\t\tIWoot.isWorkMode = false;\n\t\t\t}\n\t\t});\n\t\tIWoot.Tools.log(\"GUI Listeners Loaded!\");\n\t}", "function ChatBotPlugin(watchmen) {\n watchmen.on('latency-warning', handleEvent('latency-warning'));\n watchmen.on('new-outage', handleEvent('new-outage'));\n watchmen.on('current-outage', handleEvent('current-outage'));\n watchmen.on('service-back', handleEvent('service-back'));\n watchmen.on('service-error', handleEvent('service-error'));\n watchmen.on('service-ok', handleEvent('service-ok'));\n}", "function addListeners()\n\t{\n\t\t// Show page action so users can change settings\n\t\tchrome.runtime.sendMessage({request: \"showPageAction\"});\n\n\t\t// Add to editable divs, textareas, inputs\n\t\t$(document).on(EVENT_NAME_KEYPRESS,\n\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t$(document).on(EVENT_NAME_KEYUP,\n\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\n\t\t// Attach to future iframes\n\t\t$(document).on(EVENT_NAME_LOAD, 'iframe', function(e) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\n\t\t// Attach to existing iframes as well - this needs to be at the end\n\t\t// because sometimes this breaks depending on cross-domain policy\n\t\t$(document).find('iframe').each(function(index) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\t}", "function actionHelp(helpAll) {\n\n \"use strict\";\n for(i = 0; i < helpAll.length; i++) {\n helpAll[i].addEventListener('click', help);\n }\n\n}", "function init_contextual_help_links() {\n\tjQuery(\"a[data-podlove-help]\").on(\"click\", function (e) {\n\t\tvar help_id = jQuery(this).data('podlove-help');\n\n\t\te.preventDefault();\n\n\t\t// Remove 'active' class from all link tabs\n\t\tjQuery('li[id^=\"tab-link-\"]').each(function () {\n\t\t\tjQuery(this).removeClass('active');\n\t\t});\n\n\t\t// Hide all panels\n\t\tjQuery('div[id^=\"tab-panel-\"]').each(function () {\n\t\t\tjQuery(this).css('display', 'none');\n\t\t});\n\n\t\t// Set our desired link/panel\n\t\tjQuery('#tab-link-' + help_id).addClass('active');\n\t\tjQuery('#tab-panel-' + help_id).css('display', 'block');\n\n\t\t// Force click on the Help tab\n\t\tif (jQuery('#contextual-help-link').attr('aria-expanded') === \"false\") {\n\t\t\tjQuery('#contextual-help-link').click();\n\t\t}\n\n\t\t// Force scroll to top, so you can actually see the help\n\t\twindow.scroll(0, 0);\n\t});\n}", "function setupListeners() {\n setupAppHomeOpenedListener();\n setupClearGoalsButtonListener();\n}", "function help_init() {\n // Set up the help text logic.\n var message = document.add_new_message.message;\n message.onmouseover = help_show;\n message.onmousemove = help_show;\n message.onmouseout = help_hide;\n message.onkeypress = auto_submit;\n\n var help = document.getElementById('help');\n help.onmouseover = help_show;\n help.onmouseout = help_hide;\n}", "initAPI (obj, className) {\n this.plugin.eventDispatcher.registerListenersFor(obj, className);\n }", "attachListeners() {\n }", "registerListeners() {}", "function initializeHelp() {\n $body.on('click', '#help', function() {\n if(!$('#tooltip_help').is(':visible')) {\n hideNotificationsTooltip();\n $('#tooltip_help').show('fade', {}, 500, function() {\n showHelpTooltip();\n });\n showHelpButton();\n $body.css('overflow-x', 'hidden');\n } else {\n hideHelpTooltip();\n hideHelpButton();\n }\n });\n}", "function main() {\n addEventListeners();\n addAdvancedEventListeners();\n}", "addPlugins(...plugins) {\n InstancePlugin.initPlugins(this, ...plugins);\n }", "addPlugins(...plugins) {\n InstancePlugin.initPlugins(this, ...plugins);\n }", "constructor() {\n this.plugins = [];\n this.plugins_by_events = [];\n this.callbacks_by_events = [];\n \n window.custom_plugins.concrete = {}; // this is where loaded plugins are stored\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove'],\n before: ['onElementContextMenu']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove'],\n before: ['onElementContextMenu']\n };\n }", "static get pluginConfig() {\n return {\n assign: ['showEventContextMenu'],\n chain: ['onElementContextMenu', 'onElementClick', 'onElementDblClick', 'onEventSpaceKey']\n };\n }", "function pluginhelpers() {\n //check for loader\n if (settings.loader.length == 0) {\n //create loader element and add to container\n loader = $('<div />', {\n 'id': 'loader'\n })\n settings.target.append(loader);\n settings.loader = loader;\n }\n // if (settings.addmore.length == 0) {\n // //create loader element and add to container\n // addmore = $('<div />', {\n // 'id': 'addmore'\n // })\n // settings.target.append(addmore);\n // settings.addmore = addmore;\n // }\n\n // //bind addmore to further calls\n // settings.addmore.bind('click', loadMore)\n\n //bind controls to videos\n settings.target.on('click', '.control', play_pause);\n }", "static get pluginConfig() {\n return {\n assign: ['showContextMenu'],\n chain: ['onElementContextMenu', 'onElementClick', 'onElementDblClick', 'onElementKeyDown']\n };\n }", "static get pluginConfig() {\n return {\n assign: ['showContextMenu'],\n chain: ['onElementContextMenu', 'onElementClick', 'onElementDblClick', 'onElementKeyDown']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementContextMenu']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementContextMenu']\n };\n }", "loadAll() {\n logger.info(`Loading plugins...`);\n\n const pluginPath = path.join(__dirname, '..', '..', 'plugins');\n if (!fse.existsSync(pluginPath)) {\n fse.emptyDirSync(pluginPath);\n logger.error(`Plugin directory not found! Creating one...`);\n process.exit(0);\n }\n\n const plugins = this.constructor._read(pluginPath);\n for (const plugin of plugins) this._registerPlugin(require(plugin));\n\n this._emitCommandsd();\n logger.info(`Loaded ${this.plugins.size} plugin(s)!`);\n }", "function ListHelp() {\n}", "_displayHelp() {\n document.getElementById(\"bot-invite-link\").href = discotron.config.inviteLink;\n // Query cards\n discotron.Plugin.getAll().then((plugins) => {\n\n for (const pluginId in plugins) {\n const plugin = plugins[pluginId];\n\n const template = document.getElementById(\"template-plugin-help\");\n const pluginCard = document.importNode(template.content, true);\n\n pluginCard.querySelector(\".plugin-help-header\").textContent = plugin.name;\n pluginCard.querySelector(\".plugin-description\").textContent = plugin.description;\n\n for (let i = 0; i < plugin.commands.length; i++) {\n const command = plugin.commands[i];\n\n const commandTemplate = document.getElementById(\"template-command\");\n const commandContainer = document.importNode(commandTemplate.content, true);\n\n let displayedCommand = \"\";\n\n switch (command.triggerType) {\n case \"command\":\n displayedCommand = \"!\" + command.trigger;\n break;\n case \"words\":\n displayedCommand = \"Words: \" + command.trigger.join(\", \");\n break;\n case \"all\":\n displayedCommand = \"(all)\";\n break;\n }\n\n commandContainer.querySelector(\".command\").textContent = displayedCommand;\n\n for (let j = 0; j < command.args.length; j++) {\n const arg = command.args[j];\n if (arg.defaultValue !== undefined) {\n commandContainer.querySelector(\".command-args\").textContent += \"[\" + arg.name + \"]\";\n } else {\n commandContainer.querySelector(\".command-args\").textContent += \"<\" + arg.name + \">\";\n }\n }\n\n if (command.args.length === 0) {\n commandContainer.querySelector(\".command-args\").textContent = \"(no args)\";\n }\n\n commandContainer.querySelector(\".command-description\").textContent = command.help;\n\n pluginCard.querySelector(\".plugin-commands\").appendChild(commandContainer);\n }\n\n\n document.getElementById(\"plugin-list-container\").appendChild(pluginCard);\n }\n }).catch(console.error);\n }", "function PluginManager() {\n\t/**\n\t * Plugin constructor\n\t * @member {Plugin} PluginManager~Plugin\n\t */\n\tvar Plugin = require('./js/plugin');\n\t/**\n\t * The home view to be opened first\n\t * @member {string} PluginManager~home\n\t */\n\tvar home;\n\t/**\n\t * The plugins folder\n\t * @member {string} PluginManager~plugPath\n\t */\n\tvar plugPath;\n\t/**\n\t * The current plugin\n\t * @member {Plugin} PluginManager~current\n\t */\n\tvar current;\n\t/**\n\t * Array to store all plugins\n\t * @member {Plugin[]} PluginManager~plugins\n\t */\n\tvar plugins = {};\n\n\t/**\n\t * Detects the home Plugin or otherwise the alphabetically first\n\t * plugin and sets its button and view to be first in order\n\t * @function PluginManager~setOrder\n\t * @todo: this is hardcoded, perhaps can add priority system\n\t * @param {string[]} pluginNames - array of subdirectories of app/plugins/\n\t */\n\tfunction setOrder(pluginNames) {\n\t\t// Detect if about plugin is installed\n\t\tvar aboutIndex = pluginNames.indexOf('About');\n\t\tif (aboutIndex !== -1) {\n\t\t\t// Swap it to be last\n\t\t\tpluginNames[aboutIndex] = pluginNames[pluginNames.length - 1];\n\t\t\tpluginNames[pluginNames.length - 1] = 'About';\n\t\t}\n\n\t\t// Detect if home plugin is installed\n\t\tvar homeIndex = pluginNames.indexOf(home);\n\t\tif (homeIndex !== -1) {\n\t\t\t// Swap it to be first\n\t\t\tpluginNames[homeIndex] = pluginNames[0];\n\t\t\tpluginNames[0] = home;\n\t\t\treturn;\n\t\t}\n\t\t// No home plugin installed\n\t\thome = pluginNames[0];\n\t}\n\n\t/**\n\t * Handles listening for plugin messages and reacting to them\n\t * @function PluginManager~addListeners\n\t * @param {Plugin} plugin - a newly made plugin object\n\t */\n\tfunction addListeners(plugin) {\n\t\t// Only show the default plugin view\n\t\tif (plugin.name === home) {\n\t\t\tplugin.on('dom-ready', plugin.show);\n\t\t\tcurrent = plugin;\n\t\t}\n\n\t\t/** \n\t\t * Standard transition upon button click.\n\t\t * @typedef transition\n\t\t * TODO: Can sometime have two 'current' buttons when selecting a\n\t\t * sidebar button too quickly\n\t\t */\n\t\tplugin.transition(function() {\n\t\t\t// Don't do anything if already on this plugin\n\t\t\tif (current === plugin) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Fadein and fadeout mainbar\n\t\t\tvar main = document.getElementById('mainbar').classList;\n\t\t\tmain.add('transition');\n\t\t\tsetTimeout(function() {\n\t\t\t\tmain.remove('transition');\n\t\t\t}, 170);\n\n\t\t\t// Switch plugins\n\t\t\tcurrent.hide();\n\t\t\tcurrent = plugin;\n\t\t\tcurrent.show();\n\t\t});\n\t\t\n\t\t// Handle any ipc messages from the plugin\n\t\tplugin.on('ipc-message', function(event) {\n\t\t\tswitch(event.channel) {\n\t\t\t\tcase 'api-call':\n\t\t\t\t\t// Redirect api calls to the daemonManager\n\t\t\t\t\tvar call = event.args[0];\n\t\t\t\t\tvar responseChannel = event.args[1];\n\t\t\t\t\t// Send the call only if the Daemon appears to be running\n\t\t\t\t\tif (!Daemon.Running) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tDaemon.apiCall(call, function(err, result) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t// If a call didn't work, test that the\n\t\t\t\t\t\t\t// `/consensus` call still works\n\t\t\t\t\t\t\tconsole.error(err, call);\n\t\t\t\t\t\t\tDaemon.ifSiad(function() {\n\t\t\t\t\t\t\t\t// Send error response back to the plugin\n\t\t\t\t\t\t\t\tplugin.sendToView(responseChannel, err, result);\n\t\t\t\t\t\t\t}, function() {\n\t\t\t\t\t\t\t\t// `/consensus` call failed too, assume siad\n\t\t\t\t\t\t\t\t// has stopped\n\t\t\t\t\t\t\t\tUI.notify('siad seems to have stopped working!', 'stop');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else if (responseChannel) {\n\t\t\t\t\t\t\tplugin.sendToView(responseChannel, err, result);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'notify':\n\t\t\t\t\t// Use UI notification system\n\t\t\t\t\tUI.notify.apply(null, event.args);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'tooltip':\n\t\t\t\t\t// Use UI tooltip system\n\t\t\t\t\tevent.args[1].top += $('.header').height();\n\t\t\t\t\tevent.args[1].left += $('#sidebar').width();\n\t\t\t\t\tUI.tooltip.apply(null, event.args);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dialog':\n\t\t\t\t\t// Send dialog's response back to the plugin\n\t\t\t\t\tplugin.sendToView('dialog', IPC.sendSync('dialog', event.args));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'devtools':\n\t\t\t\t\t// Plugin called for its own devtools, toggle it\n\t\t\t\t\tplugin.toggleDevTools();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log('Unknown ipc message: ' + event.channel);\n\t\t\t}\n\t\t});\n\n\t\t// Display any console logs from the plugin\n\t\tplugin.on('console-message', function(event) {\n\t\t\tvar srcFile = event.sourceId.replace(/^.*[\\\\\\/]/, '');\n\t\t\tconsole.log(plugin.name + ' plugin logged from ' + srcFile +'(' + event.line + '): ' + event.message);\n\t\t});\n\t}\n\n\t/**\n\t * Constructs the plugins and adds them to this manager \n\t * @function PluginManager~addPlugin\n\t * @param {string} name - The plugin folder's name\n\t */\n\tfunction addPlugin(name) {\n\t\t// Make the plugin, giving its button a standard transition\n\t\tvar plugin = new Plugin(plugPath, name);\n\n\t\t// addListeners deals with any webview related async tasks\n\t\taddListeners(plugin);\n\n\t\t// Store the plugin\n\t\tplugins[name] = plugin;\n\t}\n\n\t/**\n\t * Reads the config's plugPath for plugin folders\n\t * @function PluginManager~initPlugins\n\t */\n\tfunction initPlugins() {\n\t\tFs.readdir(plugPath, function (err, pluginNames) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\n\t\t\t// Determine default plugin\n\t\t\tsetOrder(pluginNames);\n\t\t\t\n\t\t\t// Initialize each plugin according to config\n\t\t\tpluginNames.forEach(addPlugin);\n\t\t});\n\t}\n\n\t/**\n\t * Sets the member variables based on the passed config\n\t * @function PluginManager~setConfig\n\t * @param {config} config - config in memory\n\t * @param {callback} callback\n\t * @todo delete all plugins when a new path is set?\n\t */\n\tfunction setConfig(config, callback) {\n\t\thome = config.homePlugin;\n\t\tplugPath = Path.join(__dirname, 'plugins');\n\t\tcallback();\n\t}\n\n\t/**\n\t * Initializes the plugins to the UI\n\t * @function PluginManager.init\n\t * @param {config} config - config in memory\n\t */\n\tthis.init = function(config) {\n\t\tsetConfig(config, initPlugins);\n\t};\n}", "function startListeners(options) {\n $(document).on('click', options.button, function() {\n toggleLightbox();\n });\n $(document).on('click', options.curtainId, function() {\n toggleLightbox();\n });\n // If an additional button is defined, add the listener to it.\n if (options.closeButtonId !== undefined) {\n $(document).on('click', options.closeButtonId, function() {\n toggleLightbox();\n });\n }\n }", "function addAddVectorGuideLineToolListeners(){\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', addVectorGuideLineToolPoint1FollowMouse, false );\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', showOrthoGuidesWithTool, false );\n}", "function registerListeners() {\n subscribe('name-changed', saveName)\n subscribe('name-changed', displayName)\n\n subscribe('config-changed', saveConfig)\n subscribe('config-changed', displayConfig)\n\n subscribe('language-changed', updateLanguageStrings)\n subscribe('language-changed', calculateGreeting)\n\n subscribe('greeting-changed', displayGreeting)\n}", "_setupEventListeners() {\n let tour = get(this, 'tour');\n if (!tour) {\n return;\n }\n\n tour.on('tour.start', (e) => {\n this.sendAction('tourStarted', e);\n });\n\n tour.on('tour.end', (e) => {\n this.sendAction('tourEnded', e);\n });\n\n tour.on('tour.close', (e) => {\n this.sendAction('tourClosed', e);\n });\n\n tour.on('callout.show', (e) => {\n this.sendAction('calloutShown', e);\n });\n\n tour.on('callout.close', (e) => {\n this.sendAction('calloutClosed', e);\n });\n }", "function addEventListeners() {\n watchSubmit();\n watchResultClick();\n watchLogo();\n watchVideoImageClick();\n watchCloseClick();\n}", "_setPlugins() {\n this.config.plugins = {\n // Systems\n global: [\n { key: 'RoomSystem', plugin: Systems.RoomSystem, start: false, mapping: 'rooms' },\n { key: 'CursorSystem', plugin: Systems.CursorSystem, start: false, mapping: 'cursors' }\n ],\n // Managers\n scene: [\n { key: 'UpdateManager', plugin: Managers.UpdateManager, mapping: 'updates' },\n { key: 'LightSourceManager', plugin: Managers.LightSourceManager, mapping: 'lightSources' },\n { key: 'LayerManager', plugin: Managers.LayerManager, mapping: 'layers' }\n ]\n };\n }", "addEventListeners() {\n // Empty in base class.\n }", "function add_button_listeners() {\n\tadd_listener_to_book_buttons();\n\tadd_listener_to_confirm_buttons();\n\tchange_buttons();\n}", "function setupHelpMain() {\n\tupkeep();\n\t\n\t// scale font\n\tvar a = $('#help_wrapper div.help-item-content');\n\ta.css('font-size', a.height()*0.35);\n\t\n\t// hover event\n\t$('#help_wrapper').on({\n\t\tclick: function() {\n\t\t\t\n\t\t},\n\t\tmouseenter: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\");\n\t\t\t$(this).css({'background-color': 'rgba(0, 255, 50, 0.75)', 'color': 'black'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'10px'});\n\t\t},\n\t\tmouseleave: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\")\t\n\t\t\t$(this).css({'background-color': 'rgba(0, 0, 0, 0.65)', 'color': '#00ff32'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'0'});\t\t\t\n\t\t}\n\t}, 'div.help-item-content');\n\t\n\t// do some custom drawing\n\tDRAW.helpBorder($('#help_title'));\n\tDRAW.previewBorder($('#help_preview'));\n\tDRAW.helpDeco($('#help_decoration'));\n\t\n\t// convert to pixel height\n\tvar b = $('#help_wrapper div.help-item-outer');\n\tb.height(b.height());\n\t\n\t// initialize custom scrollbar\n\t$('#help_wrapper').jScrollPane({'verticalGutter': 15});\n}", "function main() {\n register_listeners();\n}", "addMetricsPlugins() {}", "constructor() {\n super();\n this.log = log;\n this.plugins = [];\n this.extensions = [];\n this.registerPlugin(require('./core-plugin'));\n }", "function main() {\n addEventListeners();\n}", "function addListeners() {\n\t\t// TODO remove inline comments, just example code.\n\t\t// To attach an event, use one of the following methods.\n\t\t// No need remove the listener in `instance.detached`\n\t\t// instance.addEventListener('click', onClick); //attached to `instance.element`\n\t\t// instance.addEventListener('click', onClick, myEl); //attached to `myEl`\n\t}", "function addEventListeners() {\n\n}", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "addWelcomeListener(callback) {\n this.addListener( this.welcomeListeners, callback);\n }", "function _setCommandManagerListeners() {\n \n // Set listener when command is executed\n $(CommandManager).on(\"beforeExecuteCommand\", function (event, id) {\n // On reload and if primary\n if (id === \"debug.refreshWindow\" && _isPrimary) {\n // Clear url (no explicit primary param means primary window)\n UrlParams.put(URL_PRIMARY, \"true\");\n _updateWindowState();\n }\n });\n }", "function handlePlugins$1(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "createListeners() {\n this.createModifyDoneListeners();\n this.createUpdateErrorListeners();\n }", "createListeners() {\n\n this.listenDeleteAllFiltersOptions();\n\n this.listenMainInputOnType();\n\n this.listenClickFilterOption();\n\n this.listenDeleteFilter();\n\n this.listenMainInputOnFocus();\n\n this.listenMainInputOnBlur();\n\n this.listenClickModalFilter();\n\n this.listenModalFilterOnBlur();\n\n this.listenModalFilterOnType();\n\n }", "function addListeners() {\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, expandStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_FINISH, expandFinishHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_START, collapseStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_FINISH, collapseFinishHandler);\n creative.dom.expandButton.addEventListener('click', onExpandHandler, false);\n creative.dom.collapseButton.addEventListener('click', onCollapseClickHandler, false);\n //creative.dom.expandedExit.addEventListener('click', exitClickHandler);\n creative.dom.expandMain.addEventListener('click', onExpandHandler);\n // creative.dom.closeButton.addEventListener('click', closeClickHandler);\n}", "function setupListeners () {\n\t\tvar btn= document.getElementById('ws');\n\t\tbtn.addEventListener('click', yet.track, false);\n\t}", "function Plugins(options) {\n if (!(this instanceof Plugins)) {\n return new Plugins(options);\n }\n this.iterators = {};\n this.fns = [];\n this.init();\n}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tconsole.log(event);\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"inviteFriendsToGroup\") {\n\t\t\t\tvar id = event.data.id;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tinviteNow(id,delay);\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool();\n\t\t\t}\n\t\t}\n\t}, false);\n}", "function onInstall(event) {\n Plugins.init();\n \n onOpen(event);\n}", "static registerActions() {\n webAPI.registerAction(\"get-plugin-prefix\", (data, reply) => {\n if (Plugin._plugins[data.pluginId] !== undefined) {\n reply(Plugin._plugins[data.pluginId].prefix);\n } else {\n reply(false);\n }\n });\n\n webAPI.registerAction(\"get-plugin-logs\", (data, reply) => {\n reply(Plugin._plugins[data.pluginId].logs);\n }, \"owner\");\n\n webAPI.registerAction(\"set-plugin-prefix\", (data, reply) => {\n Plugin._plugins[data.pluginId].prefix = data.prefix;\n reply();\n }, \"owner\");\n\n webAPI.registerAction(\"get-enabled\", (data, reply) => {\n if (Plugin._plugins[data.pluginId] !== undefined) {\n reply(Plugin._plugins[data.pluginId].enabled);\n } else {\n reply(false);\n }\n });\n\n webAPI.registerAction(\"set-enabled\", (data, reply) => {\n Plugin._plugins[data.pluginId].enabled = data.enabled;\n reply();\n }, \"owner\");\n\n webAPI.registerAction(\"get-plugins\", (data, reply, userDiscordId) => {\n let pluginsObjects = [];\n\n for (const key in Plugin.getAll()) {\n if (Plugin.getAll().hasOwnProperty(key)) {\n pluginsObjects.push(Plugin.getAll()[key].toObject(!Owner.isOwner(userDiscordId)));\n }\n }\n\n reply(pluginsObjects);\n });\n }", "addHikeListener() {\n // We need to loop through the children of our list and attach a listener to each, remember though that children is a nodeList...not an array. So in order to use something like a forEach we need to convert it to an array.\n }", "function registerListeners() {\n miro.addListener('CANVAS_CLICKED', async function (event) {\n await writeOutput(allEstimates);\n });\n\n miro.addListener('SELECTION_UPDATED', async function (event) {\n await writeOutput(allEstimates);\n });\n\n miro.addListener('DATA_BROADCASTED', async function (event) {\n if (event.data == \"change_notification\") {\n await reloadEverything();\n }\n });\n\n selectButton.addEventListener('click', selectWidgets);\n\n exportButtons.forEach(element => {\n element.addEventListener('click', exportData);\n });\n}", "bindListeners () {\n this.howlHandler.on('pause', (id) => {\n WebPlayerActions.doDelaySpeechTrack(false);\n });\n }", "addListeners() {\n\t\tthis.findTarget();\n\t\tthis.findControls();\n\t\t\n\t\tthis.showerElement.addEventListener('click', () => {\n\t\t\tthis.showTarget();\n\t\t\tthis.hiderElement.style.display = this.controlsDisplay\n\t\t\tthis.showerElement.style.display = 'none';\n\t\t\t\n\t\t})\n\t\t\n\t\tthis.hiderElement.addEventListener('click', () => {\n\t\t\tthis.hideTarget();\n\t\t\tthis.hiderElement.style.display = 'none'; \n\t\t\tthis.showerElement.style.display = this.controlsDisplay;\n\t\t})\t\t\n\t}", "helpInfo () {\n\t\tlet me = this;\n\n\t\treturn [\n\t\t\t$('<h3>').append(\n\t\t\t\tt('Adicionar um novo equipamento à aventura')\n\t\t\t),\n\t\t\tEquipament.helpTypeMeaning()\n\t\t];\n\t}", "function addEventListeners()\n\t{\n\t\t// window event\n\t\t$(window).resize(callbacks.windowResize);\n\t\t$(window).keydown(callbacks.keyDown);\n\t\t\n\t\t// click handler\n\t\t$(document.body).mousedown(callbacks.mouseDown);\n\t\t$(document.body).mouseup(callbacks.mouseUp);\n\t\t$(document.body).click(callbacks.mouseClick);\n\n\t\t$(document.body).bind('touchstart',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchstart(e);\n\t\t});\n\t\t$(document.body).bind('touchend',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchend(e);\n\t\t});\n\t\t$(document.body).bind('touchmove',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchmove(e);\n\t\t});\n\t\t\n\t\tvar container = $container[0];\n\t\tcontainer.addEventListener('dragover', cancel, false);\n\t\tcontainer.addEventListener('dragenter', cancel, false);\n\t\tcontainer.addEventListener('dragexit', cancel, false);\n\t\tcontainer.addEventListener('drop', dropFile, false);\n\t\t\n\t\t// GUI events\n\t\t$(\".gui-set a\").click(callbacks.guiClick);\n\t\t$(\".gui-set a.default\").trigger('click');\n\t}", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n}", "function EventManager(plugins,_zone){var _this=this;this._zone=_zone;this._eventNameToPlugin=new Map();plugins.forEach(function(p){return p.manager=_this;});this._plugins=plugins.slice().reverse();}", "function addListeners() {\n $('span').click(function (e) {\n e.preventDefault();\n var li = $(this).parents('li');\n var id = li.attr('id');\n setUrl(id, !li.hasClass('url'));\n });\n\n $('button.delete').click(function (e) {\n e.preventDefault();\n var id = $(this).parents('li').attr('id');\n deleteRecord(id);\n });\n }", "initializeIpcListeners() {\n var self = this;\n\n ipcRenderer.on(\"focus\", function(event) {\n GUI.onFocus();\n });\n\n ipcRenderer.on(\"update-available\", function(event, info) {\n GUI.showUpdateAvailableEntry(info);\n });\n\n ipcRenderer.on(\"update-downloaded\", function(event, info) {\n GUI.showUpdateDownloadedEntry(info);\n });\n }", "function addEventHandlerUserSettingsDialog() {\n\taddEventHandlerChangeLanguage();\n\taddEventHandlerChangePasswordButton();\n}", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "function customizeWiki() {\n addCharSubsetMenu();\n addHelpToolsMenu();\n addDigg();\n}", "function attachDefaultListeners(listenerDiv) {\n listenerDiv.addEventListener('load', moduleDidLoad, true);\n listenerDiv.addEventListener('message', handleMessage, true);\n listenerDiv.addEventListener('error', handleError, true);\n listenerDiv.addEventListener('crash', handleCrash, true);\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function addEventListeners() {\n\t$(\"#maple-apple\").click(addMapleApple);\n\t$(\"#cinnamon-o\").click(addCinnamon);\n}", "function $EmbedLiteConsoleListener()\n{\n}", "function initListeners() {\n $('#key').on('click', '.key-show-control', function(ev) {\n dispatch.keyShowLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-duplicate-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDuplicateLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-delete-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDeleteLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-edit-control', function(ev) {\n ev.preventDefault();\n dispatch.keyEditLine($(this).data('line-id'));\n });\n }", "function doRegisterCommands() {\r\n GM_registerMenuCommand('Configurar ' + appName + ' ' + appVersion + '...', preferences);\r\n GM_registerMenuCommand('Ver información de depurado', showLog);\r\n }", "_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }", "function initListeners(ctxs, props) {\n let listeners = {};\n const addListener = (key, handler) => {\n if (!listeners[key]) listeners[key] = [];\n if (!isFunction(handler)) {\n console.warn(`[initListeners]${key} is not function!`);\n return;\n }\n listeners[key].push(action(key, handler));\n };\n ctxs.forEach(ctx => {\n LIFECYCLE_HOOKS.forEach(key => {\n const name = camelize(`hook:${key}`);\n let handler = ctx[key];\n if (!handler && ctx.prototype && ctx.prototype[key]) handler = ctx.prototype[key];\n if (handler) addListener(name, handler);\n });\n });\n if (props) {\n Object.keys(props).forEach(key => {\n const handler = props[key];\n if (!handler) return;\n let [, eventName] = key.match(RGEX_EVENT) || [];\n if (eventName) addListener(camelize(eventName), handler);\n });\n }\n return listeners;\n}", "function addWatchers() {\n let directories = atom.project.getDirectories();\n directories.forEach((element) => {\n initWatcher(element.path);\n }, this);\n}", "function eventListeners(){\n changeOnButtonClicks();\n changeOnDotClicks();\n changeOnArrowKeys();\n changeOnAnnaLink();\n highlightDotsOnMouseover();\n highlightButtonsOnMouseover();\n highlightAnnaLinkOnMouseover();\n $(document).on(\"mousemove\", foregroundButtons);\n}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"post\") {\n\t\t\t\tvar message = event.data.message;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tvar start = event.data.start;\n\t\t\t\tvar end = event.data.end;\n\t\t\t\tdelay=parseInt(delay);\n\t\t\t\tstart=parseInt(start);\n\t\t\t\tend=parseInt(end);\n\t\t\t\tprocess(message,delay,start,end);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "static set PLUGINS(plugins) {\n PLUGINS = plugins;\n }", "_initListeners() {\n this._initResizeListener();\n this._initSwipe();\n }", "function onHelpButtonClick() {\n\t\t\talert(\"帮助:\\n\\n\" +\n\t\t\t\t\"##用得开心就好!##\\n\\n\" +\n\t\t\t\t\"\", \"SPRenderQueueTools\"\n\t\t\t);\n\t\t}", "function customizeWiki() {\n addCharSubsetMenu();\n addHelpToolsMenu();\n addDigg();\n talkPage();\n}", "function init() {\n setupListeners();\n }", "function addListeners() {\r\n\tcreative.dom.exit.addEventListener('click', exitClickHandler);\r\n}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"post\") {\n\t\t\t\tvar token = event.data.token;\n\t\t\t\tvar message = event.data.message;\n\t\t\t\tvar url = event.data.url;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tprocess(token,message,url,delay);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}" ]
[ "0.6600582", "0.61788136", "0.61536866", "0.61536866", "0.61066115", "0.59435326", "0.5918944", "0.58046377", "0.57392347", "0.57364315", "0.5709877", "0.5705624", "0.5668277", "0.5662392", "0.5646811", "0.56132394", "0.5595348", "0.5594614", "0.5583859", "0.55775535", "0.5575243", "0.55732876", "0.5564961", "0.5564961", "0.55515134", "0.55366653", "0.5532001", "0.5532001", "0.55080914", "0.55080914", "0.5478936", "0.54650056", "0.5460794", "0.5456518", "0.5440381", "0.54110384", "0.5403963", "0.5394192", "0.53759587", "0.53619534", "0.5361388", "0.5346056", "0.5334109", "0.53310454", "0.53258437", "0.53170377", "0.5307317", "0.5304849", "0.5296259", "0.5286737", "0.5277675", "0.5276868", "0.5274024", "0.52619046", "0.5261157", "0.52577436", "0.52541685", "0.52541065", "0.5252562", "0.5235636", "0.5223874", "0.5222771", "0.52222264", "0.5219153", "0.5211129", "0.52022994", "0.52012235", "0.5193451", "0.5177225", "0.5168165", "0.51664567", "0.51541114", "0.5153574", "0.5153574", "0.5153574", "0.5153574", "0.5153574", "0.5153574", "0.51531714", "0.51498705", "0.5148595", "0.5148595", "0.5148595", "0.5141105", "0.51381165", "0.5134761", "0.51311177", "0.51270205", "0.5125784", "0.51255196", "0.5119697", "0.51112115", "0.5105917", "0.51035804", "0.50981545", "0.509757", "0.5085569", "0.5083375", "0.5075857", "0.50734353" ]
0.75997305
0
Adds a single help listener for a plugin
function registerHelpListener (controller, helpInfo) { controller.hears('^help ' + helpInfo.command + '$', 'direct_mention,direct_message', function (bot, message) { let replyText = helpInfo.text if (typeof helpInfo.text === 'function') { let helpOpts = _.merge({botName: bot.identity.name}, _.pick(message, ['team', 'channel', 'user'])) replyText = helpInfo.text(helpOpts) } bot.reply(message, replyText) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addHelpListeners (controller, plugins) {\n _.forEach(plugins, function (plugin) {\n if (_.get(plugin, 'help.text') && _.get(plugin, 'help.command')) {\n registerHelpListener(controller, plugin.help)\n }\n })\n\n controller.hears('^help$', 'direct_mention,direct_message', function (bot, message) {\n let helpCommands = _.chain(plugins)\n .filter((plugin) => !!_.get(plugin, 'help.command'))\n .map((plugin) => '`@' + bot.identity.name + ' help ' + _.get(plugin, 'help.command') + '`')\n .value()\n .join('\\n')\n\n if (!helpCommands.length) {\n return bot.reply(message, 'I can\\'t help you with anything right now. I still like you though :heart:')\n }\n\n return bot.reply(message, 'Here are some things I can help you with:\\n' + helpCommands)\n })\n}", "function addHelpButton() {\r\n\t\t\tif (_helpDlg)\r\n\t\t\t// already done\r\n\t\t\t\treturn;\r\n\r\n\t\t\t_helpBtn = createControlButton(\r\n\t\t\t\tBUTTONS.Help,\r\n\t\t\t\tgm.ControlPosition.TOP_RIGHT,\r\n\t\t\t\t\"mapsed-help-button mapsed-control-button\",\r\n\t\t\t\tfunction (evt) {\r\n\t\t\t\t\tevt.preventDefault();\r\n\r\n\t\t\t\t\t// show/hide the dialog\r\n\t\t\t\t\t_helpDlg.fadeToggle();\r\n\t\t\t\t\t_helpBtn.toggleClass(\"open\");\r\n\t\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tvar helpHtml = settings.getHelpWindow();\r\n\t\t\t_helpDlg = $(helpHtml).appendTo(_mapContainer);\r\n\t\t\t_helpDlg.fadeOut();\r\n\r\n\t\t} // addHelpButton", "addImplicitHelpCommand() {\n this.command('help [cmd]', 'display help for [cmd]');\n }", "function onHelpButtonPress(){\n\talert(strHelp);\n}", "function help_init() {\n // Set up the help text logic.\n var message = document.add_new_message.message;\n message.onmouseover = help_show;\n message.onmousemove = help_show;\n message.onmouseout = help_hide;\n message.onkeypress = auto_submit;\n\n var help = document.getElementById('help');\n help.onmouseover = help_show;\n help.onmouseout = help_hide;\n}", "function helpHandler(config) {\n return function(bot, message) {\n return bot.startPrivateConversation(message.user).then(function (convo) {\n return formatHelpResponse(bot, config).then(function(response) {\n convo.say(response);\n }).catch(function(error) {\n convo.say(\"I'm sorry, but an error occurred processing this subscription command\");\n winston.error(JSON.stringify(error));\n });\n });\n };\n}", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "constructor() {\n super('help', ['h']);\n this.setDescription('Do you really need to know how to ask for help?');\n }", "function onHelpButtonClick() {\n\t\t\talert(\"帮助:\\n\\n\" +\n\t\t\t\t\"##用得开心就好!##\\n\\n\" +\n\t\t\t\t\"\", \"SPRenderQueueTools\"\n\t\t\t);\n\t\t}", "function NewScriptDialogHelp() {\n\tgetNewScript().showDialog('Sheeter-DialogHelp.html', project_name + ' Help');\n}", "onHelpClick() {\n Linking.openURL(helpURL);\n }", "function initializeHelp() {\n $body.on('click', '#help', function() {\n if(!$('#tooltip_help').is(':visible')) {\n hideNotificationsTooltip();\n $('#tooltip_help').show('fade', {}, 500, function() {\n showHelpTooltip();\n });\n showHelpButton();\n $body.css('overflow-x', 'hidden');\n } else {\n hideHelpTooltip();\n hideHelpButton();\n }\n });\n}", "function addonAddGUIHook(selector, callback){\n\tdivHooks.push({\"selector\": selector, \"callback\": callback});\n}", "function ListHelp() {\n}", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n let activeQuestion = model.getActiveQuestion();\n if (activeQuestion) {\n speech = speaker.getQuestionSpeech(activeQuestion, 'help');\n reprompt = speaker.getQuestionSpeech(activeQuestion, 'reprompt');\n \n // ensure the help counter is reset -- it's n/a for question help \n // messages (see defaultActions's help action for details)\n model.clearAttr(\"helpCtr\");\n }\n else {\n // shouldn't reach this point\n speech = speaker.get(\"Help\");\n }\n\n response.speak(speech);\n if (reprompt) {\n response.listen(reprompt);\n }\n response.send();\n}", "function help() {\n\n}", "function Plugin( element, options ) {\n tabElement = $(element);\n switchElement = $(options.target);\n eventType = options.eventType || \"click\";\n actClassName = options.actClassName;\n callback = options.callback;\n // jQuery has an extend method which merges the contents of two or \n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n me = this;\n me.element = element;\n me.options = $.extend( {}, defaults, options) ;\n \n me._defaults = defaults;\n me._name = pluginName;\n \n me.init();\n }", "function setUpHelp($thisStep) {\n\t$thisStep.append('<a id=\"helpBtn\" href=\"#\" class=\"floatL\"><span class=\"fa fa-info-circle fa-lg\"></span><span class=\"alt\"></span>' + allParams.helpString + '</a>');\n\t\n\t$(\"#helpBtn\").click(function() {\n\t\t$dialog.dialog(\"close\");\n\t\t\n\t\tif ((currentStepInfo.helpTxt.indexOf(\"http://\") == 0 || currentStepInfo.helpTxt.indexOf(\"https://\") == 0) && currentStepInfo.helpTxt.indexOf(\" \") == -1) {\n\t\t\t// treat helpString as link - open straight away\n\t\t\twindow.open(currentStepInfo.helpTxt);\n\t\t} else {\n\t\t\t// show helpString in dialog\n\t\t\t$mainHolder.append('<div id=\"helpDialog\"/>');\n\t\t\tvar $helpDialog = $(\"#helpDialog\");\n\t\t\t\n\t\t\t$dialog = $helpDialog\n\t\t\t\t.dialog({\n\t\t\t\t\tcloseOnEscape: true,\n\t\t\t\t\ttitle:\t\tallParams.helpString,\n\t\t\t\t\tcloseText:\tallParams.closeBtn\n\t\t\t\t\t})\n\t\t\t\t.html(addLineBreaks(iFrameCheck(currentStepInfo.helpTxt)));\n\t\t}\n\t});\n}", "function toggleHelp() {\n\ttoggleAnalyserPanel('help');\n}", "function initHelpPanel(){\n if (!YAHOO.example.help) {\n YAHOO.example.help =\n new YAHOO.widget.Panel(\"help\",\n {\n width:\"500px\",\n fixedcenter:true,\n close:true,\n draggable:true,\n zindex:999,\n modal:false,\n visible:false\n });\n }\n}", "function bindHelp()\n{\n\n\t// schadenmeldung ermittlern, klasse definiert in help array frage/antworten\n\tvar smclass = $('#hk-schadenmeldung').attr('class');\n\t\n\t\n\t$(\".hkd-fieldset-frage\").click(function () {\n\t\n\t\n\t\tif (!$(this).hasClass('help-active'))\n\t\t{\n\t\t\tvar helptxt = getHelpTxt( $(this), smclass );\n\t\t\t\n\t\t\tif (helptxt != -1)\n\t\t\t{\n\t\t\t\t$(this).append('<span>'+helptxt+'</span>');\n\t\t\t\t$(this).addClass('help-active');\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\t$(this).find('span').remove();\n\t\t\t$(this).removeClass('help-active');\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n }); \n \n}", "function help() {\n var helpmsg =\n '!ouste : déconnecte le bot\\n' +\n '!twss : ajoute la dernière phrase dans la liste des TWSS\\n' +\n '!nwss : ajoute la dernière phrase dans la liste des Non-TWSS\\n' +\n '!chut : désactive le bot\\n' +\n '!parle : réactive le bot\\n' +\n '!eval : évalue la commande suivante\\n' +\n '!dbg : met le bot en debug-mode, permettant de logger toute son activité\\n' +\n '!undbg : quitte le debug-mode\\n' +\n '!help : affiche ce message d\\'aide';\n client.say(channel, helpmsg);\n bot.log('message d\\'aide envoyé');\n}", "function help(){\n var fieldId = $(this).prev('input').attr('id');\n var format = getActiveOptionOn(fieldId);\n $.notify(helpFor(format));\n }", "function setupHelpMain() {\n\tupkeep();\n\t\n\t// scale font\n\tvar a = $('#help_wrapper div.help-item-content');\n\ta.css('font-size', a.height()*0.35);\n\t\n\t// hover event\n\t$('#help_wrapper').on({\n\t\tclick: function() {\n\t\t\t\n\t\t},\n\t\tmouseenter: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\");\n\t\t\t$(this).css({'background-color': 'rgba(0, 255, 50, 0.75)', 'color': 'black'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'10px'});\n\t\t},\n\t\tmouseleave: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\")\t\n\t\t\t$(this).css({'background-color': 'rgba(0, 0, 0, 0.65)', 'color': '#00ff32'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'0'});\t\t\t\n\t\t}\n\t}, 'div.help-item-content');\n\t\n\t// do some custom drawing\n\tDRAW.helpBorder($('#help_title'));\n\tDRAW.previewBorder($('#help_preview'));\n\tDRAW.helpDeco($('#help_decoration'));\n\t\n\t// convert to pixel height\n\tvar b = $('#help_wrapper div.help-item-outer');\n\tb.height(b.height());\n\t\n\t// initialize custom scrollbar\n\t$('#help_wrapper').jScrollPane({'verticalGutter': 15});\n}", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n const helpCount = model.getAttr(\"helpCtr\");\n if (helpCount > 2) {\n speech = speaker.get(\"Help3\");\n }\n else if (helpCount === 2) {\n speech = speaker.get(\"Help2\");\n }\n else {\n speech = speaker.get(\"Help\");\n }\n\n reprompt = speaker.get(\"WhatToDo\");\n\n response.speak(speech)\n .listen(speaker.get(\"WhatToDo\"))\n .send();\n}", "helpMessage() {\n return \"*!who-knows <skill-name>*\\n\" +\n \"Gibt eine Liste von Kollegen zurück, die den angegebenen Skill beherrschen.\\n\" +\n \"Die Liste wird durch die API von HBT Power bereitgestellt, die Suche ist (noch) case sensitive.\\n\" +\n \" Alias: !wer-weiß, !häää?, !who-knows, wat?\";\n }", "handler_HELP(command, callback) {\n this.send(214, 'See https://tools.ietf.org/html/rfc5321 for details');\n callback();\n }", "function onHelp( a_label )\n{\n helpWindow = window.open( 'edit_help.html#' + a_label, \"edit_help\" );\n helpWindow.focus();\n}", "function actionHelp(helpAll) {\n\n \"use strict\";\n for(i = 0; i < helpAll.length; i++) {\n helpAll[i].addEventListener('click', help);\n }\n\n}", "addTarget() {\n throw new Error('Extend the addTarget method to add your plugin to another plugin\\'s target');\n }", "function toolTips(el,help) {\n\t\t$(el).on('mouseenter', function() {\n\t\t\t$(help).show();\n\t\t\t$(el).on('click', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t\t$(el).on('mouseleave', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t});\n\t}", "addWelcomeListener(callback) {\n this.addListener( this.welcomeListeners, callback);\n }", "function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n this._frame = 1;\n\t\tthis._shakeCounter;\n\t\t\n this.init();\n }", "function trigger_hplugin_event(evt){\n\tjQuery('.hero_viewport').trigger(evt);\n}", "function init_contextual_help_links() {\n\tjQuery(\"a[data-podlove-help]\").on(\"click\", function (e) {\n\t\tvar help_id = jQuery(this).data('podlove-help');\n\n\t\te.preventDefault();\n\n\t\t// Remove 'active' class from all link tabs\n\t\tjQuery('li[id^=\"tab-link-\"]').each(function () {\n\t\t\tjQuery(this).removeClass('active');\n\t\t});\n\n\t\t// Hide all panels\n\t\tjQuery('div[id^=\"tab-panel-\"]').each(function () {\n\t\t\tjQuery(this).css('display', 'none');\n\t\t});\n\n\t\t// Set our desired link/panel\n\t\tjQuery('#tab-link-' + help_id).addClass('active');\n\t\tjQuery('#tab-panel-' + help_id).css('display', 'block');\n\n\t\t// Force click on the Help tab\n\t\tif (jQuery('#contextual-help-link').attr('aria-expanded') === \"false\") {\n\t\t\tjQuery('#contextual-help-link').click();\n\t\t}\n\n\t\t// Force scroll to top, so you can actually see the help\n\t\twindow.scroll(0, 0);\n\t});\n}", "function addHints(){var _this4=this;var self=this;var hintsWrapper=document.querySelector(\".introjs-hints\");if(hintsWrapper===null){hintsWrapper=_createElement(\"div\",{className:\"introjs-hints\"});}/**\n * Returns an event handler unique to the hint iteration\n *\n * @param {Integer} i\n * @return {Function}\n */var getHintClick=function getHintClick(i){return function(e){var evt=e?e:window.event;if(evt.stopPropagation){evt.stopPropagation();}if(evt.cancelBubble!==null){evt.cancelBubble=true;}showHintDialog.call(self,i);};};forEach(this._introItems,function(item,i){// avoid append a hint twice\nif(document.querySelector(\".introjs-hint[data-step=\\\"\".concat(i,\"\\\"]\"))){return;}var hint=_createElement(\"a\",{className:\"introjs-hint\"});setAnchorAsButton(hint);hint.onclick=getHintClick(i);if(!item.hintAnimation){addClass(hint,\"introjs-hint-no-anim\");}// hint's position should be fixed if the target element's position is fixed\nif(isFixed(item.element)){addClass(hint,\"introjs-fixedhint\");}var hintDot=_createElement(\"div\",{className:\"introjs-hint-dot\"});var hintPulse=_createElement(\"div\",{className:\"introjs-hint-pulse\"});hint.appendChild(hintDot);hint.appendChild(hintPulse);hint.setAttribute(\"data-step\",i);// we swap the hint element with target element\n// because _setHelperLayerPosition uses `element` property\nitem.targetElement=item.element;item.element=hint;// align the hint position\nalignHintPosition.call(_this4,item.hintPosition,hint,item.targetElement);hintsWrapper.appendChild(hint);});// adding the hints wrapper\ndocument.body.appendChild(hintsWrapper);// call the callback function (if any)\nif(typeof this._hintsAddedCallback!==\"undefined\"){this._hintsAddedCallback.call(this);}if(this._options.hintAutoRefreshInterval>=0){this._hintsAutoRefreshFunction=debounce(function(){return reAlignHints.call(_this4);},this._options.hintAutoRefreshInterval);DOMEvent.on(window,\"scroll\",this._hintsAutoRefreshFunction,this,true);}}", "function HelpCommandParser(commandParserLut) {\n this.commandParserLut = commandParserLut;\n }", "showHelpDialog_() {\n const dialog = buildHelpDialogTemplate(this.element);\n\n dialog.querySelector(\n '.i-amphtml-story-dev-tools-help-search-preview-link'\n ).href += this.storyUrl_;\n dialog.querySelector(\n '.i-amphtml-story-dev-tools-help-page-experience-link'\n ).href =\n 'https://amp.dev/page-experience/?url=' +\n encodeURIComponent(this.storyUrl_);\n\n this.mutateElement(() => this.element.appendChild(dialog));\n addAttributeAfterTimeout(this, dialog, 1, 'active');\n this.currentDialog_ = dialog;\n }", "initAPI (obj, className) {\n this.plugin.eventDispatcher.registerListenersFor(obj, className);\n }", "openHelpPage() {}", "function setHelpUrl (url) {\n\ttop.helpUrl = url;\t\n\n}", "static addPlugin( plugin ) {\n\n if (!plugin) {\n throw new TypeError( 'No plugin provided.' );\n }\n\n PLUGINS.push( plugin );\n\n if (plugin.mounted) {\n plugin.mounted.call( plugin );\n }\n }", "_displayHelp() {\n document.getElementById(\"bot-invite-link\").href = discotron.config.inviteLink;\n // Query cards\n discotron.Plugin.getAll().then((plugins) => {\n\n for (const pluginId in plugins) {\n const plugin = plugins[pluginId];\n\n const template = document.getElementById(\"template-plugin-help\");\n const pluginCard = document.importNode(template.content, true);\n\n pluginCard.querySelector(\".plugin-help-header\").textContent = plugin.name;\n pluginCard.querySelector(\".plugin-description\").textContent = plugin.description;\n\n for (let i = 0; i < plugin.commands.length; i++) {\n const command = plugin.commands[i];\n\n const commandTemplate = document.getElementById(\"template-command\");\n const commandContainer = document.importNode(commandTemplate.content, true);\n\n let displayedCommand = \"\";\n\n switch (command.triggerType) {\n case \"command\":\n displayedCommand = \"!\" + command.trigger;\n break;\n case \"words\":\n displayedCommand = \"Words: \" + command.trigger.join(\", \");\n break;\n case \"all\":\n displayedCommand = \"(all)\";\n break;\n }\n\n commandContainer.querySelector(\".command\").textContent = displayedCommand;\n\n for (let j = 0; j < command.args.length; j++) {\n const arg = command.args[j];\n if (arg.defaultValue !== undefined) {\n commandContainer.querySelector(\".command-args\").textContent += \"[\" + arg.name + \"]\";\n } else {\n commandContainer.querySelector(\".command-args\").textContent += \"<\" + arg.name + \">\";\n }\n }\n\n if (command.args.length === 0) {\n commandContainer.querySelector(\".command-args\").textContent = \"(no args)\";\n }\n\n commandContainer.querySelector(\".command-description\").textContent = command.help;\n\n pluginCard.querySelector(\".plugin-commands\").appendChild(commandContainer);\n }\n\n\n document.getElementById(\"plugin-list-container\").appendChild(pluginCard);\n }\n }).catch(console.error);\n }", "function onhelpclick() {\r\n\tif (helpON == 0) {\r\n\t\tvar overlay_width = viewWidth + 'px';\r\n\t\tvar overlay_height = viewHeight + 'px';\r\n\r\n\t\t// update help overlay sizes\r\n\t\tdocument.getElementById(\"help\").style.width = overlay_width;\r\n\t\tdocument.getElementById(\"help\").style.height = overlay_height;\r\n\t\t\r\n\t\t// code for opening help overlay\r\n\t\tdocument.getElementById(\"help\").style.display = \"block\";\t\t\r\n\t}\r\n\tdocument.getElementById(\"help-close\").addEventListener(\"click\", function() {\r\n\t\tdocument.getElementById(\"help\").style.display = \"none\";\r\n\t });\r\n}", "function $EmbedLiteConsoleListener()\n{\n}", "static get pluginConfig() {\n return {\n chain: ['onElementContextMenu']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['onElementContextMenu']\n };\n }", "printHelpText() {\n const helpText = fs.readFileSync(\n path.join(__dirname, 'cli-help.txt'), 'utf8');\n logHelper.info(helpText);\n }", "function showHelp() {\n\t//Use figlet npm package to convert text to art/drawing.\n\tfiglet('LIRI help', function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\tvar helpInfo = \"Usage: node liri.js <command> [arguments]\"\n\tvar helpColumns = columnify([{\n\t\tCommand: 'my-tweets',\n\t\tDescription: \"Shows the last 20 tweets from Twitter timeline and when they were created.\"\n\t}, {\n\n\t\tCommand: \"movie-this [movie_name]\",\n\t\tDescription: \"Shows information about the specifid movie. If no movie is specified, Mr. Nobody is displayed by default.\"\n\t}, {\n\n\t\tCommand: \"spotify-this-song [song_name]\",\n\t\tDescription: \"Shows top 10 songs on Spotify that have specified name. If no song is specified, The Sign by Ace of Base is displayed by default.\"\n\t}, {\n\n\t\tCommand: 'do-what-it-says',\n\t\tDescription: \"Shows the top 10 songs on Spotify for the song, 'I want it that way.'\"\n\t}])\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpInfo);\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpColumns);\n}", "function ChatBotPlugin(watchmen) {\n watchmen.on('latency-warning', handleEvent('latency-warning'));\n watchmen.on('new-outage', handleEvent('new-outage'));\n watchmen.on('current-outage', handleEvent('current-outage'));\n watchmen.on('service-back', handleEvent('service-back'));\n watchmen.on('service-error', handleEvent('service-error'));\n watchmen.on('service-ok', handleEvent('service-ok'));\n}", "function initHelp() {\n $('#showHelp').click(function () {\n var height = $('#mainHelp').css('height');\n $('#mainHelp').animate({height: height === '0px' ? 280 : 0}, 'slow');\n $('#showHelp').html(height === '0px' ? \"Hide help\" : \"Show me how\");\n return false;\n });\n }", "function InitListener_Framework_L0(){\n // You must make some text.\n}", "function InitListener_Framework_L0(){\n // You must make some text.\n}", "function _addHints() {\n var self = this;\n\n var oldHintsWrapper = document.querySelector('.introjs-hints');\n\n if (oldHintsWrapper != null) {\n hintsWrapper = oldHintsWrapper;\n } else {\n var hintsWrapper = document.createElement('div');\n hintsWrapper.className = 'introjs-hints';\n }\n\n for (var i = 0, l = this._introItems.length; i < l; i++) {\n var item = this._introItems[i];\n\n // avoid append a hint twice\n if (document.querySelector('.introjs-hint[data-step=\"' + i + '\"]'))\n continue;\n\n var hint = document.createElement('a');\n _setAnchorAsButton(hint);\n\n (function (hint, item, i) {\n // when user clicks on the hint element\n hint.onclick = function(e) {\n var evt = e ? e : window.event;\n if (evt.stopPropagation) evt.stopPropagation();\n if (evt.cancelBubble != null) evt.cancelBubble = true;\n\n _hintClick.call(self, hint, item, i);\n };\n }(hint, item, i));\n\n hint.className = 'introjs-hint';\n\n if (!item.hintAnimation) {\n hint.className += ' introjs-hint-no-anim';\n }\n\n // hint's position should be fixed if the target element's position is fixed\n if (_isFixed(item.element)) {\n hint.className += ' introjs-fixedhint';\n }\n\n var hintDot = document.createElement('div');\n hintDot.className = 'introjs-hint-dot';\n var hintPulse = document.createElement('div');\n hintPulse.className = 'introjs-hint-pulse';\n\n hint.appendChild(hintDot);\n hint.appendChild(hintPulse);\n hint.setAttribute('data-step', i);\n\n // we swap the hint element with target element\n // because _setHelperLayerPosition uses `element` property\n item.targetElement = item.element;\n item.element = hint;\n\n // align the hint position\n _alignHintPosition.call(this, item.hintPosition, hint, item.targetElement);\n\n hintsWrapper.appendChild(hint);\n }\n\n // adding the hints wrapper\n document.body.appendChild(hintsWrapper);\n\n // call the callback function (if any)\n if (typeof (this._hintsAddedCallback) !== 'undefined') {\n this._hintsAddedCallback.call(this);\n }\n }", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "function loadPlugin(plugin) {\n // Die Plugins werden abhängig von ihrer Api Version unterschiedlich geladen.\n switch (plugin.help.apiVersion) {\n case 1:\n // API v1: Es müssen keine gesonderten Argumente übergeben werden. Wird meistens von Overwrites verwendet. \n plugin.run();\n break;\n case 2:\n // API v2: Übergibt einfache Information wie die Bot-Instanze\n plugin.run(bot);\n break;\n \n default:\n // API v?: Die Api Version ist nicht bekannt. Das Plugin wird nicht geladen!\n console.error(`Failed to load Plugin '${plugin.help.name}': Unknown Api Version!`)\n break;\n }\n return;\n }", "function showHelp(helpMessage) {\n $(\"#helpBox\").text(helpMessage)\n }", "function doHelpButton()\n{\n var selTab = document.getElementById(\"tabbox\").selectedTab;\n var key = selTab.getAttribute(\"help\");\n openHelp(key, \"chrome://communicator/locale/help/suitehelp.rdf\");\n}", "function displayHelp()\n{\n // Replace the following call if you are modifying this file for your own use.\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function showHelpMessage(hm) {\n $('#helpMessage').html(hm).showv();\n}", "function Plugin(element, options) {\n this.element = element;\n this.init();\n }", "helpInfo () {\n\t\tlet me = this;\n\n\t\treturn [\n\t\t\t$('<h3>').append(\n\t\t\t\tt('Adicionar um novo equipamento à aventura')\n\t\t\t),\n\t\t\tEquipament.helpTypeMeaning()\n\t\t];\n\t}", "function addPlugin (){\n var args = Array.prototype.slice.call(arguments);\n var firstArg = args.shift(); \n if (typeof firstArg === 'string') {\n var route = routes[firstArg];\n } else {\n var route = firstArg; // Object\n }\n \n var hook = 'before';\n \n var last = args[args.length-1];\n if (typeof last === 'string'){\n args.pop();\n if(last === 'after' ){\n hook = 'after';\n }\n } \n \n if (hook === 'after'){\n Array.prototype.push.apply(route.plugins.after, args);\n } else {\n Array.prototype.push.apply(route.plugins.before, args);\n } \n }", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function Window_Help() {\n this.initialize.apply(this, arguments);\n}", "function aboutPlugin() {\n alert(\"About Colorize Text...\",\n \"Colorize Text is a plugin that provides several text colorizing utilities:\",\n \"• Gradient: applies a gradient between the first and last characters in a text node\",\n \"• Repeat: repeats a color pattern in a text node\",\n \"• Randomize: applies random colors to each character in a text node\",\n \"For more information, please see:\",\n \"https://github.com/AdobeXD/Plugin-Samples/tree/master/e2e-colorize-text\"\n );\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "function liveAction(pluginId, className, argument)\n{\n\t// find top help frameset\n\tvar helpTop=findHelpTop();\n\tif (helpTop != null && helpTop.liveActionInternal){\n\t\treturn helpTop.liveActionInternal(helpTop, pluginId, className, argument);\n\t} else if (helpTop == self){\n\t\t// no frames, possibly help view\n\t\tvar url= window.location.href;\n\t\t\n\t\tvar i = url.indexOf(\"?\");\n\t\tif(i>0)\n\t\t\turl=url.substring(0, i);\n\t\t\n\t\ti = url.indexOf(\"/ntopic/\");\n\t\tif(i < 0) {\n\t\t\t// not help view\n\t\t\treturn;\n\t\t}\n\t\n\t\turl=url.substring(0, i+1);\n\t\tvar encodedArg=encodeURIComponent(argument);\n\t\turl=url+\"livehelp/?pluginID=\"+pluginId+\"&class=\"+className+\"&arg=\"+encodedArg+\"&nocaching=\"+Math.random();\n\t\twindow.location.href = url;\n\t}\n}", "function Help() {\n}", "function Help() {\n}", "addPlugin(pluginName, implementation) {\n this.loaderPlugins[pluginName] = implementation;\n }", "function set_text_help(id_libelle,texte,global,chaine,extended_help)\r\n\t{\r\n\t\tif(typeof(global) == 'undefined' || global == '')\r\n\t\t{\r\n\t\t\tif(typeof(texte) == 'undefined' || texte == '')\r\n\t\t\t{\r\n\t\t\t\tvar libelle_temp = decodeURIComponent(libelle[id_libelle]); \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar libelle_temp = texte;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar libelle_temp = decodeURIComponent(libelle_common[id_libelle]);\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof(chaine) == 'undefined' || chaine == '') //SIBY\r\n\t\t{\r\n\t\t\t// No replace\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tlibelle_temp = libelle_temp.replace(/&1/g,chaine); // Replace all \" by &quot;\r\n\t\t}\r\n\t\t/**==================================================================\r\n\t\t * Display is extended help is available\r\n\t\t ====================================================================*/\t\r\n\t\tif(extended_help != 'undefined' && extended_help)\r\n\t\t{\r\n\t\t\tlibelle_temp = libelle_temp + ' (' + decodeURIComponent(libelle_common[205]) + ')';\r\n\t\t}\r\n\t\t/**==================================================================*/\t\t\t\r\n\r\n\t\t/**==================================================================\r\n\t\t * Display help text in footer\r\n\t\t ====================================================================*/\t\r\n\t\tiknow_panel_set_sous_titre(libelle_temp);\r\n\t\t/**==================================================================*/\t\t\t\r\n\t}", "renderHelp_() {\n this.parent_.append('div')\n .attr('class', 'tabhelp inactive-tabhelp')\n .html(this.HELP_MESSAGE);\n }", "function Plugin( element, options ) {\n\t\tthis.element = element;\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.spa_space = tiddlyweb.status.space.name;\n\n\t\tthis.init();\n\t}", "function addAddVectorGuideLineToolListeners(){\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', addVectorGuideLineToolPoint1FollowMouse, false );\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', showOrthoGuidesWithTool, false );\n}", "install (Vue, options) {\r\n //ES6 way of const job = options.job\r\n //const { job } = options\r\n \r\n // Add $plugin instance method directly to Vue components\r\n //Vue.prototype.$myInfo = (name, age) => info(name, age, job)\r\n \r\n // Add $surname instance property directly to Vue components\r\n //Vue.prototype.$surname = 'Smith'\r\n\r\n Vue.prototype.$noti_warn = (text) => {\r\n Vue.prototype.$notify({\r\n \tgroup: 'common',\r\n /*title: 'Validation warnning',*/\r\n text: text,\r\n type: 'warn'\r\n });\r\n }\r\n\r\n Vue.prototype.$noti_succ = (text) => {\r\n Vue.prototype.$notify({\r\n \tgroup: 'common',\r\n /*title: 'Validation warnning',*/\r\n text: text,\r\n type: 'success'\r\n });\r\n }\r\n\r\n Vue.prototype.$noti_info = (text) => {\r\n Vue.prototype.$notify({\r\n \tgroup: 'common',\r\n /*title: 'Validation warnning',*/\r\n text: text,\r\n type: 'info'\r\n });\r\n }\r\n }", "function createHelpPanel() {\n return new Ext.Panel({\n border: false,\n frame: false,\n baseCls: 'none',\n id: 'helpPanel',\n autoWidth: true,\n renderTo: 'shortcut',\n autoLoad: {\n url: '../../apps/search/help_' + catalogue.LANG + '.html',\n callback: initShortcut,\n scope: this,\n loadScripts: false\n }\n });\n }", "addListener(id, options) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_globalaccelerator_ListenerOptions(options);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addListener);\n }\n throw error;\n }\n return new listener_1.Listener(this, id, {\n accelerator: this,\n ...options,\n });\n }", "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('sia.siatooltip')\n var options = typeof option == 'object' && option\n\n if (!data && /destroy|hide/.test(option)) return\n if (!data) $this.data('sia.siatooltip', (data = new SIATooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "function Plugin( element, options ) {\n var self = this;\n\n // Public attributes\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n\n this._defaults = defaults;\n this._name = pluginName;\n this._ignoreHashChange = false;\n\n this.init();\n }", "function helpLink() {\n\tif(jQuery('#mwTab-intro:visible').length > 0) {\n\t\tjQuery('#mwTab-intro').hide();\n\t\tjQuery('.help_link_show').show();\n\t\tjQuery('.help_link_hide').hide();\n\n\t\t//set pref to hidden\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=0');\n\t} else {\n\t\tjQuery('#mwTab-intro').show();\n\t\tjQuery('.help_link_hide').show();\n\t\tjQuery('.help_link_show').hide();\n\n\t\t//set pref to visible\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=1');\n\t}\n\n\treturn false;\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "function help(user, userID, channelID, args, evt) {\n message = 'Available commands:' +\n '\\r\\n`p!ping`: Checks to see if the bot is running' +\n '\\r\\n`p!sub add <pokemon>`: Add a subscription for the specified <pokemon>. You will receive a confirmation DM.' +\n '\\r\\n`p!sub remove <pokemon>`: Removes a subscription for the specified <pokemon>. You will receive a confirmation DM.' +\n '\\r\\n`p!sub list`: Sends a DM with a list of all pokemon you are subscribed to.' +\n '\\r\\n`p!spawn <pokemon>`: Sends a DM to all people subscribed to the specified <pokemon> indicating that one has spawned. If sent as a comment on an image, the uploaded image will also be included in the DM.' +\n '\\r\\n`p!stats`: Sends a DM with some general usage statistics for the bot.'\n\n bot.sendMessage({ to: channelID, message: message });\n}", "function addHolonCallBack(data, options)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(\"Holon Name added succesfully\");\n\t\t\t\t\t}", "help(cb) {\n this.outputHelp(cb);\n process.exit(1);\n }", "function execHelp(args, msg) {\n if (args.length == 0) msg.channel.send(\"Please provide some more information, try using `!help [topic]`\");\n else msg.channel.send(\"Dont worry i'm here to help you with \" + args + \"!\");\n }", "function AccessibilityManager(plugin) {\n this.plugin_ = plugin;\n\n plugin.addMessageListener('jsAccessibility', this.handleMessage.bind(this));\n}", "function help() {\n console.log(`Today I Learned\n\n Run locally with:\n\n node ./til.js\n\n Usage:\n\n til add \"something cool i learned today\"\n adds an entry to your TIL DB\n til list\n shows all entries, day by day\n til help\n shows this message\n `)\n process.exit(0);\n}", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && option == 'destroy') return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "function showHelpButton() {\n $('#help').addClass('current');\n}", "outputHelp(cb) {\n if (!cb) {\n cb = (passthru) => {\n return passthru;\n };\n }\n const cbOutput = cb(this.helpInformation());\n if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n process.stdout.write(cbOutput);\n this.emit(this._helpLongFlag);\n }", "outputHelp(cb) {\n if (!cb) {\n cb = (passthru) => {\n return passthru;\n };\n }\n const cbOutput = cb(this.helpInformation());\n if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n process.stdout.write(cbOutput);\n this.emit(this._helpLongFlag);\n }", "function Plugin( el, options ) {\n\t\tthis.$el = $(el);\n\t\t\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\n\t\tthis.init();\n\t}", "function updateFieldHelpText (event) {\n lib.updateActiveFieldHelpText($(this).val());\n }", "outputHelp(cb) {\n if (!cb) {\n cb = passthru => passthru;\n }\n\n process.stdout.write(cb(this.helpInformation()));\n this.emit('--help');\n }", "function over(id_doc,id_help,texte,global,chaine)\r\n\t{\r\n\t\tikdoc(id_doc);// Add call of doc page\r\n\t\tset_text_help(id_help,texte,global,chaine,id_doc);\r\n\t}", "openHelpWindow(source) {\n EnigmailWindows.openWin(\n \"enigmail:help\",\n \"chrome://openpgp/content/ui/enigmailHelp.xhtml?src=\" + source,\n \"centerscreen,resizable\"\n );\n }", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function showHelp(){\n showListHelp();\n}" ]
[ "0.676042", "0.5684966", "0.566419", "0.5652563", "0.56465024", "0.5621818", "0.55474514", "0.5544842", "0.55405694", "0.5535002", "0.5513129", "0.551219", "0.5512027", "0.55072033", "0.5464571", "0.54353446", "0.5431577", "0.5414223", "0.53818804", "0.5356573", "0.5350121", "0.53442746", "0.5268441", "0.5266151", "0.52581537", "0.5253064", "0.5234219", "0.5221047", "0.52123916", "0.5206096", "0.5205475", "0.51898956", "0.51877564", "0.518272", "0.5171011", "0.51587915", "0.51552266", "0.5151916", "0.51437986", "0.51093185", "0.5104731", "0.5085381", "0.5065503", "0.50648946", "0.50378", "0.5029344", "0.5029344", "0.50281477", "0.5020912", "0.50120884", "0.50000554", "0.4980621", "0.4980621", "0.4968141", "0.49614766", "0.49614766", "0.49586755", "0.49560967", "0.4945708", "0.49442926", "0.49399596", "0.49316582", "0.49294433", "0.49263057", "0.4920801", "0.49168324", "0.49161258", "0.4910572", "0.49103117", "0.49095654", "0.49095654", "0.49063402", "0.4901856", "0.4900638", "0.48985314", "0.48921508", "0.48798993", "0.4877895", "0.4872826", "0.4870307", "0.48645526", "0.48637733", "0.48634887", "0.4863095", "0.48570696", "0.48570138", "0.48566344", "0.48566195", "0.48521864", "0.48515677", "0.4851262", "0.48509344", "0.48509344", "0.4848768", "0.4842806", "0.4842672", "0.484093", "0.48405874", "0.48370764", "0.48358163" ]
0.72513807
0
Convenience method to log errors
function logError (controller, err, message) { controller.log(message) controller.log(err) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static logError(error) {\r\n console.log(`[ERROR] Something did not work - \\n`, error);\r\n }", "function logError (err) {\n util.log('error:', err)\n}", "function error() {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 0); _i++) {\n args[_i] = arguments[_i + 0];\n }\n // Short circuit if logging is disabled. This is as close to noop as we can get, incase there is a direct reference to this method.\n if(!tConfig.log.enabled) {\n return;\n }\n if(logLevel >= LEVEL.ERROR) {\n var args = slice.call(arguments);\n args.unshift(cError);\n logRunner.apply(this, args, 'error');\n }\n }", "static logError(error) {\n console.log('[ERROR] Looks like there was a problem: \\n', error);\n }", "function error(msg){\r\n rootLogger.error(msg)\r\n}", "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "function error_log(error){\n console.log(error.message);\n }", "static error(message) {\n\t\tthis.log(Logger.Level.error, message)\n\t}", "function error(message) {\n Logger.log(\"ERROR: \" + message);\n}", "error(...theArgs) { return this._log('ERROR', {}, theArgs); }", "function logError(err) {\n console.error(err);\n}", "logError(error) {\n console.error(error);\n return error;\n }", "static error(...args) {\n if (this.toLog('ERROR')) {\n console.error.apply(console, arguments);\n }\n }", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function _error(message,error){\r\n if(error){\r\n message += ' ' + JSON.stringify(error);\r\n }\r\n console.log(message);\r\n var logger = _getLogger();\r\n if(logger){\r\n logger.error(message);\r\n }\r\n}", "function logerror(content) {\n return logger(content,\" [ERROR] \");\n}", "error(...params) {\r\n console.error(this.getLogStamp(), ...params);\r\n }", "function _logError(message) {\n console.error('[audit.js] ' + message);\n }", "function errorLog(error){\r\n\tconsole.error.bind(error);\r\n\tthis.emit('end');\r\n}", "function logError(errorMessage) {\n console.error(\"ERROR: \" + errorMessage);\n}", "function logError(err) {\n console.log(err.toString(), err);\n}", "function errorHandler(error) {\n console.log('Error. Result:', error, arguments);\n debugLog(JSON.stringify(error));\n}", "logError(message, meta) {\n this.winstonLogger.log('error', message, meta);\n }", "function logError(code, message) {\n\tconsole.error(new Date() + \" [HTTP Code: \" + code + \", Message: \" + message + \"]\")\n}", "function error(error) {\n console.log(\"Error : \" + error);\n}", "function errorLog(error) {\n console.error.bind(error);\n this.emit('end');\n}", "function errorLogger(error) {\n log('*** Start of Error ***');\n log(error);\n log('*** End of Error ***');\n this.emit('end');\n}", "function errorLogger(error) {\n utils.log('*** Start of Error ***');\n utils.log(error);\n utils.log('*** End of Error ***');\n this.emit('end');\n }", "error(message, options) {\n const _options = Object.assign({}, options || {});\n _options.type = 'error';\n logger.log(message, _options);\n }", "function errorHandler(error) { console.log('Error: ' + error.message); }", "error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "LogError() {}", "error(...parameters)\n\t{\n\t\tconsole.log(colors.red(this.preamble, '[error]', generate_log_message(parameters)))\n\t}", "_logError() {\n console.log(\n `${Logger.colors.invalid}An invalid log level '${this.level}' was provided on logger instantiation.`,\n `\\nThe valid logger levels are as follows: ${Logger.validLevels.join(\n \", \"\n )}${Logger.colors.reset}`\n );\n }", "onError(...args) {\n this.logError(this.formatOnError(args));\n }", "function logError(err) {\n console.error(\"ErrnoException: %s\", JSON.stringify(err));\n}", "function logerror (err, str) {\n console.error(str || err.stack)\n}", "function log_error(text) {\n var time = new Date();\n console.error(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n}", "error(error) {}", "function logError(errorString) {\n console.error(\"Error : \" + errorString);\n}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function error() {\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'error', arguments)\n}", "componentDidCatch(error) {\n if (this.persistentLogEnabled) {\n this.saveExtendedLog(\"error\", [error]);\n } else {\n console.error(error);\n }\n }", "function logError(err) { if(console && console.log) console.log('Error!', err); return false; }", "function errorLog(error) {\n\tvar eLog = chalk.red(error);\n\tconsole.log(eLog);\n}", "function errors(response, error) {\n let errorMessage = `Status code ${response.statusCode}. `; //Starts building the error message string\n\n switch (response.statusCode) {\n case 401: errorMessage += `Unauthorized access. Requires username and password`;\n break;\n case 403: errorMessage += `Forbidden. Permission to access was not allowed.`;\n break;\n case 404: errorMessage += `Not Found. Requested URL was not found.`;\n break;\n default: errorMessage += `Error. Unable to scrape data.`;\n break;\n }\n console.log(errorMessage); //Sends error message to console\n\n //Writes error to an error file. The current date and time is appended to the front of the error and some minor formatting is done for readability in the log file\n fs.appendFile('scraper-error.log', `[${new Date()}] <${errorMessage}> \\r\\n`, function (err) {\n if (err) throw err;\n console.log('Error logged to scraper-error.log'); //If error was successfully written, this message is printed to console\n });\n}", "error(message, ...params) {\n console.error.apply(console, arguments);\n }", "function my_log(msg, error) {\n var ln = error.lineNumber;\n var fn = error.fileName.split('->').slice(-1)[0].split('/').splice(-1)[0];\n console.log(fn + \",\" + ln + \": \" + msg);\n}", "function error(e) { \n console.error('error:'.bold.red, e); \n}", "function error(msg) {\n // If multiple arguments were passed, pass them all to the log function.\n if (arguments.length > 1) {\n var logArguments = ['Error:'];\n logArguments.push.apply(logArguments, arguments);\n console.log.apply(console, logArguments);\n // Join the arguments into a single string for the lines below.\n msg = [].join.call(arguments, ' ');\n } else {\n console.log('Error: ' + msg);\n }\n console.log(backtrace());\n UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);\n throw new Error(msg);\n}", "function logError(serverError,clientError){ //Function that simplifies the logging of errors\n console.log(\"==========================\\n\"+serverError);\n customString = clientError;\n}", "function logError( message ) {\n console.log( 'Error'.red.underline + ( ': ' + message ).red );\n}", "_handle_error(event) {\n let message = event.detail;\n this.$.log.error(message)\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "function printError(error){\n console.error(error.message);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function errorHandler(error) {\n console.log(error);\n}", "function errorHandler(error) {\n console.log(error);\n}", "logQueryError(error) {\n if (this.options.logFailedQueryError /*|| process.env.LOGGER_CLI_SCHEMA_SYNC*/)\n this.log(\"error\", \"error during executing query:\" + error);\n }", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "error(err) {\n this.checkDate();\n console.error(`[${red(`ERROR ${dayjs().format(\"HH:mm:ss\")}`)}]: ${err.message + (err.stack ? \"\\n\"+err.stack.split('\\n').splice(1).join('\\n'):\"\")}\\n`);\n }", "errorHandler(error) {\n console.log(error);\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "function alert_log_error(alert, log) {\n $log.error(\"Alert & Log Error: \", log);\n return;\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "function errorHandler(error) {\n console.log(error);\n }", "function logErr(err) {\n\tlet d = new Date();\n\tlet errMsg = \"error occurred at \" + d + \": \" + err;\n\tfs.appendFileSync(\"Error_Log.txt\", errMsg, \"utf8\");\n}", "function errorHandler(){\n Logger.log(\"=========================EXAMPLES=========================\")\n Logger.log(\"firebase-engine operations=\\\"clean, restore\\\" path=\\\"./test/utils/vend-park-development.json\\\" services=\\\"firestore, auth\\\" backup=\\\"vend-park-development.backup\\\"\")\n Logger.log(\"firebase-engine o=\\\"b, c\\\" p=\\\"./test/utils/vend-park-development.json\\\"\")\n Logger.log(\"=========================ARGUMENTS========================\")\n Logger.table(arg)\n Logger.log(\"===========================ERROR==========================\")\n}", "function onError(error) {\n console.log(`Error: ${error}`);\n}", "function logErrors(error, req, res, next) {\n var status = error.statusCode || 500;\n console.error(status + ' ' + (error.message ? error.message : error));\n if (error.stack) {\n console.error(error.stack);\n }\n next(error);\n }", "function handleError(error){\n\t\tconsole.error(\"[ERROR] \", error);\n\t}", "function _logE(i) { console.error(i); }", "function errorHandler(error) {\n console.error(`There was a problem connecting to ${urlRoot}.Error was <${error.message}>. Please check \"${directory}${errorFileName}\" for more details on the issue.`);\n fs.appendFile(directoryRoot + directory + errorFileName, `${createErrDate()} <${error}>\\n`);\n}", "function logRequestError(err) {\n\n\tvar {response} = err;\n\tif (!response) {\n\t\tlogger.warning(`TritonAgent raised exception for URL ${this._urlPath}`, err);\n\t} else if (response.notFound) {\n\t\t// 404? don't care about response\n\t\tlogger.warning(`Resource not found on server: ${this._urlPath}`);\n\t} else if (response.serverError) {\n\t\tlogger.warning(`Received server error for URL ${this._urlPath}`, err);\n\t} else {\n\t\tlogger.warning(`Unexpected status code returned for URL ${this._urlPath}`, err);\n\t}\n}", "function logError(terminal, format, ...args) {\n terminal.log(\n \"%s: %s\",\n chalk.red(\"error\"), // Syntax errors may have colors applied for displaying code frames\n // in various places outside of where Metro is currently running.\n // If the current terminal does not support color, we'll strip the colors\n // here.\n util.format(chalk.supportsColor ? format : stripAnsi(format), ...args)\n );\n}", "function logError() {\n if (error) {\n return<p>{error}</p>\n }\n }", "function onError (error) {\n console.log(`An error occurred: ${error}`)\n}", "function reportError(error) {\n console.error(error);\n }", "logError(message, obj = null) {\n this._logger.error(message, obj);\n }", "function handleError(error) {\n console.log(error);\n}", "function log_error(text) {\n var time = new Date();\n\n console.trace(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n }", "function logErr(err) {\n\tfs.appendFile('botErrors.log',err,function(err) {\n\t\tif (err) console.log(\"Error recording error: \",err);\n\t\telse console.log(\"Error logged\");\n\t});\n}", "logDiagnostics(err) {\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `Error in stage \"${this.currentStage}\": ${err.description}`);\n for (let i = 0; i < err.errorData.length; i++) {\n systemLog_1.default.error({ doubleIndent: true }, `\"${i}: ${err.errorData[i]}`);\n }\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `\"${this.currentStage}\" stage failed. See SystemManager console for additional information.`);\n }", "function onError(error) {\n console.error(\"Error occured: \", error);\n}", "function printError(error) {\n console.error(error.message);\n}", "function printError(error) {\n console.error(error.message);\n}", "async error(message, context = {}) {\n return this.log(message, LogLevel.Error, context);\n }", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n }", "function log_error(text) {\n var time = new Date();\n\n console.trace(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n}", "function logError(error) {\n console.log(chalk_1.default.red(error));\n}", "function logError(msg) {\n\tconsole.error(`[vue-css-modifiers]: ${msg}`);\n}", "function logErrors(err, req, res, next) {\n\tconsole.error(err.stack);\n\tnext(err);\n}", "_logError (msg, url, lineNo, columnNo, error) {\n let log = ErrLogger.getLogs()\n if (!log) {log = { session: [] } }\n log.session.push({\n timestamp: new Date().valueOf(),\n columnNo,\n error: error,\n lineNo,\n message: msg,\n url,\n })\n ErrLogger.setLog(log)\n return true\n }", "logAndThrow(data) {\n console.error(data); // eslint-disable-line no-console\n throw data;\n }", "function devlog(msg)\n{\n customError(\"Dev\", msg, -1, true, false);\n}", "function logError(err, errorMessage) {\n console.warn(errorMessage);\n console.warn(err.error);\n console.warn(err.description);\n console.warn(err.debug);\n }", "error(message, options) {\n const name = (options && options.name) || 'snowpack';\n this.log({ level: 'error', name, message, task: options === null || options === void 0 ? void 0 : options.task });\n }" ]
[ "0.7693803", "0.7652971", "0.7643914", "0.75835603", "0.7496876", "0.74918157", "0.7420783", "0.74180055", "0.7405857", "0.738006", "0.73769176", "0.7319415", "0.7318267", "0.72418493", "0.72299457", "0.71783066", "0.7147489", "0.7111585", "0.7104678", "0.70816344", "0.70744765", "0.7058202", "0.7057583", "0.70567316", "0.69874215", "0.6978751", "0.6962402", "0.69498163", "0.69423074", "0.69365096", "0.69270724", "0.6925774", "0.69225097", "0.69068116", "0.6905571", "0.6865881", "0.6854264", "0.6798838", "0.6793657", "0.6793002", "0.67816126", "0.6755846", "0.6752522", "0.67301744", "0.6710343", "0.6689539", "0.6668238", "0.66674864", "0.66583157", "0.6653228", "0.66520363", "0.66449106", "0.66431105", "0.6642488", "0.66419786", "0.6637252", "0.6637252", "0.66356313", "0.66356313", "0.66332734", "0.6608724", "0.66036326", "0.6589178", "0.6583736", "0.6581546", "0.6574216", "0.6571555", "0.6559796", "0.65418124", "0.6539291", "0.65392554", "0.65367985", "0.653091", "0.6530308", "0.65301174", "0.6529562", "0.6525386", "0.65235776", "0.6512997", "0.6502182", "0.64975905", "0.64768046", "0.6476068", "0.64753747", "0.6467537", "0.6466671", "0.6466671", "0.64518416", "0.6441216", "0.6441203", "0.6441158", "0.6441134", "0.6440862", "0.6437529", "0.643542", "0.64308274", "0.6422989", "0.6420312", "0.6414308", "0.64076483" ]
0.71208805
17
update jump velocity after time dt
update(entity,dt,level,audioContext){ //gravity entity.velocity.y +=this.acc_y * dt; if(this.requestTime >0){ if(this.ready){ entity.audio.playAudio('jump'); this.jumpTime=this.duration; this.requestTime =0; } this.requestTime-= entity.mass *dt; } if(this.jumpTime>0){ //entity.velocity.y -= entity.acc; entity.velocity.y -= this.jump_velocity; //jump upward this.jumpTime -= entity.mass * dt; } //when update the new entity, set to false this.ready=false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jump() {\n if(this.onGround) {\n this.vy -= jumpVelocity;\n this.onGround = false;\n }\n }", "jump() {\n this.time = -this.terminalVelocity;\n }", "function jump() {\n\n //instant increase in velocity Y (go up)\n player.velY = -2 * player.speed;\n player.jumping = true;\n player.grounded = false;\n }", "function jump(){ if(!dead) player.velocity.y += -25;}", "jump () {\n if (!this._needsVerticalUpdate) {\n this._resumeVerticalUpdate();\n }\n this._isJumping = true;\n this._gravity.setVelocity( -this._objectJumpVelocity );\n }", "jump() {\n if (this.isJumping()) {\n return;\n }\n\n this.verticalVelocity = Constants.SKIER_JUMP_VELOCITY;\n }", "jump() {\n if (this.canJump && jumping_3D){\n this.velocity.y += 100;\n this.canJump = false;\n }\n }", "update() {\n this.location.add(this.velocity);\n\t}", "set targetVelocity(value) {}", "set VelocityChange(value) {}", "jump()\n {\n let yDistance = this.yPos - this.jumpSize;\n this.yPos -= this.jumpSpeed * yDistance;\n }", "jump() {\n if (this.canJump) {\n this.speed = this.jumpSpeed;\n }\n }", "function playerJump() {\n player.body.velocity.y = -255;\n\n}", "movement() {\n this.velocity = this.velocity + this.gravity; // updates velocity\n this.y = this.y + this.velocity // updates position with velocity\n }", "progressJump() {\n this.verticalVelocity -= Constants.GRAVITY;\n this.z += this.verticalVelocity;\n this.verticalVelocity *= Constants.FRICTION;\n\n if (this.z <= 0) {\n this.resetJump();\n }\n }", "updateVelocity(controller){\n this.vx = controller.vx;\n this.vy = controller.vy;\n }", "updateVelocity(time) {\n //acceleration factor to add to update the velocity vector\n var accelFactor = glMatrix.vec3.create();\n glMatrix.vec3.scale(this.v, this.v, Math.pow(this.drag, time));\n glMatrix.vec3.scale(accelFactor, this.a, time);\n glMatrix.vec3.add(this.v, this.v, accelFactor);\n }", "jump() {\n if (this.player.body.touching.down || (this.playerJumps > 0 && this.playerJumps < gameOptions.jumps)) {\n if (this.player.body.touching.down) {\n this.playerJumps = 0;\n }\n this.player.setVelocityY(gameOptions.jumpForce * -1);\n this.playerJumps++;\n }\n }", "function cheetah_update(elapsedTime){\n\tif(keyhit(MOVE_LEFT_KEY)){\n\t this.direction = -1;\n\t\tthis.velocity.x = - this.impX;\n\t} else if (keyhit(MOVE_RIGHT_KEY)){\n\t this.velocity.x = this.impX;\n\t\tthis.direction = 1;\n\t} else if(keydown(MOVE_LEFT_KEY)){\n\t\tthis.direction = -1;\n\t\t\n\t} else if(keydown(MOVE_RIGHT_KEY)){\n\t\tthis.direction = 1;\n\t} else {\n\t\tthis.velocity.x = 0;\n\t}\n\n\tvar tvx = this.velocity.x;\n\tvar tvy = this.velocity.y;\n\t\n\tif(keydown(MOVE_LEFT_KEY)){\n\t\tif(tvx == 0){\n\t\t\ttvx = -.3;\n\t\t\n\t\t//can only accelerate while on the ground\n\t\t} else if(tvx > -.8 && this.onGround){\n\t\t\ttvx -= .1;\n\t\t}\n\t\tthis.direction = -1;\n\t\tif(tvx <= -.8 && this.wasGround && !this.onGround && keydown(JUMP_KEY)){\n\t\t\ttvy = -.4;\n\t\t}\n\t}else if(keydown(MOVE_RIGHT_KEY)){\n\t\tif(tvx == 0){\n\t\t\ttvx = .3;\n\t\t\t\n\t\t//can only accelerate while on the ground\t\n\t\t} else if(tvx < .8 && this.onGround){ \n\t\t\ttvx += .1;\n\t\t} \n\t\tthis.direction = 1;\n\t\tif(tvx >= .8 && this.wasGround && !this.onGround && keydown(JUMP_KEY)){\n\t\t\ttvy = -.4;\n\t\t}\n\t} else {\n\t\ttvx = 0;\n\t}\n\t\n\t// apply impulse to velocity. \n\tif(keyhit(JUMP_KEY) && this.onGround){\n\t\ttvy = -.4;\n\t}\n\t\n\tthis.velocity.x = tvx;\n\tthis.velocity.y = tvy;\n\t\n\tthis.velocity.add(vScalarMult(elapsedTime,this.acceleration))\n\tif(this.velocity.y > .5){\n\t this.velocity.y = .5;\n\t} else if(this.velocity.y > .1 && this.form == 'f' && keydown(32)){\n\t\tthis.velocity.y = .1;\n\t}\n\tthis.coords.add(vScalarMult(elapsedTime,this.velocity));\t\t\n}", "_updatePositionWithVelocity() {\n this._x += this._dx;\n this._y += this._dy;\n }", "update(timeStep, screen, enemies, jump, moveLeft, moveRight) {\n\t\t// TODO need to special case out of bonds\n\n\t\tif (jump) { \n\t\t\tthis.jumpPressed() \n\t\t}\n\t\t//console.log(\"a \" +screen)\n\t\t//console.log(\"b \" +screen[this.y])\n\t\t//console.log(this.y + \",\" + this.x+3)\n\t\t//console.log(\"c \" + screen[this.y][this.x+3])\n\t\tif(screen[this.y][this.x+2] != true && screen[this.y][this.x+3] != true && screen[this.y][this.x+4] != true && screen[this.y][this.x+5] != true &&\n\t\t\tscreen[this.y][this.x+6] != true) {\n\t\t\t//this.y+=1\n\t\t\tthis.vy += this.gravity * timeStep\n\t\t}\n\t\tconsole.log(\"timestep: \" + timeStep)\n\t\tif (this.vy != 0) {\n\t\t\tthis.jumpTime += 1\n\t\t}\n\t\tif (this.y_speed != 0) {\n\n\t\t\tlet y_prev = this.y\n\t\t\tthis.y_pos += this.vy * timeStep\n\t\t\tthis.y = Math.floor(this.y_pos)\n\t\t\tif (this.vy > 0) {\n\n\t\t\t}\n\t\t\tif (!screen[this.y][this.x+3]) {\n\t\t\t\t//this.y+=1\n\t\t\t}\n\t\t\tlet y_delta = this.y\n\t\t\tconsole.log(\"up: \" + y_delta + \" / \" + y_prev)\n\t\t\tif (y_prev < this.y) {\n\t\t\t\tfor(y_delta; y_delta > y_prev; y_delta--) {\n\t\t\t\t\tif(screen[y_delta][this.x+3]) {\n\t\t\t\t\t\tthis.y = y_delta\n\t\t\t\t\t\tthis.vy = 0\n\t\t\t\t\t\tthis.jumpTime = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { // going up, e.g. old pos > new\n\t\t\t\tconsole.log(\"jump\")\n\t\t\t\t//delta is smaller\n\t\t\t\tfor(y_delta; y_delta <= y_prev; y_delta++) {\n\t\t\t\t\tif(screen[y_delta-12][this.x+3]) {\n\t\t\t\t\t\tthis.y = y_delta\n\t\t\t\t\t\tthis.vy = 0\n//\t\t\t\t\t\tthis.jumpTime = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(screen[y_delta][this.x+3]) {\n\t\t\t\tthis.y = y_delta\n\t\t\t}\n\n\t\t\t// x\n\t\t\tif (moveLeft) {\n\t\t\t\tconsole.log(screen[this.y-1][this.x] + \" screen\")\n\t\t\t\tif (screen[this.y-1][this.x] == true && screen[this.y-2][this.x] != true && screen[this.y-3][this.x] != true) {\n\t\t\t\t\tthis.x-=1\n\t\t\t\t\tthis.y-=3\n\t\t\t\t}\n\t\t\t\telse if (screen[this.y-1][this.x] != true && screen[this.y-2][this.x] != true) {\n\t\t\t\t\tthis.x--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (moveRight) {\n\t\t\t\tthis.x++\n\t\t\t}\n\n\n\t\t}\n\n\t\tif (this.triggerCountdown == 1) {\n\t\t\tthis.triggerCountdown = 0\t\n\t\t}\n\t\telse if (this.triggerCountdown > 1) {\n\t\t\tthis.triggerCountdown -= 1\n\t\t}\n\n\n\t\tif (this.dead == false && enemies != null) {\n\t\t\tthis.step++\n\t\t\tthis.x += this.speed\n\t\t\tif (this.hurtCountdown == 1) {\n\t\t\t\tthis.hurtCountdown -= 1\n\t\t\t}\n\t\t\tif (this.hurtCountdown > 1) {\n\t\t\t\tthis.hurtCountdown -= 1\n\t\t\t}\n\n\t\t\tfor(let i=0; i<enemies.length; i++) {\n\n\t\t\t\tlet dx = this.x - enemies[i].x\n\t\t\t\tlet dy = this.y - enemies[i].y\n\t\t\t\tlet distance = Math.sqrt(dx * dx + dy * dy)\n\t\t\t\tif (distance < (this.radius + enemies[i].radius)\n\t\t\t\t\t&& enemies[i].dead == false) {\n\t\t\t\t\t//enemies[i].damage(this.attack)\n\t\t\t\t\t//this.damage(1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "update(t, dt) {\r\n\t\tdt = Math.min(1, dt) // Don't ever update more than 1 second at a time, things get too unstable\r\n\r\n\r\n\t\t// Position2 = Position1 + (Elapsed time)*Velocity\r\n \t\tthis.position.addMultiples(this.velocity, dt)\r\n\r\n \t\t// Add up all the forces\r\n \t\t// Velocity2 = Velocity1 + (Elapsed time)*Force\r\n \t\tfor (let forceKey in this.forces) {\r\n \t\t\tlet force = this.forces[forceKey]\r\n \t\t\tthis.velocity.addMultiples(force, dt)\r\n \t\t}\r\n\r\n \t\t// Clamp the maximum speed, to keep the asteroids from running too fast (or too slow)\r\n\t\tthis.velocity.clampMagnitude(4, 100)\r\n\r\n \t\t// Apply some drag. This keeps them from getting a runaway effect\r\n \t\tlet drag = 1 - SLIDERS.astDrag.value()\r\n \t\tthis.velocity.mult(drag)\r\n\r\n \t\t// Wrap around\r\n \t\tthis.position[0] = (this.position[0] + simulationWidth)%simulationWidth\r\n\t\tthis.position[1] = (this.position[1] + simulationHeight)%simulationHeight\r\n\r\n \t}", "function jump() { \n \n //main rabbit physics\n this.rabbitY = player.y;\n\n if (player.y >= this.upperBound && player.y <= 2456){\n\n var distanceToGround = player.y - 2456;\n\n this.timesBounced = this.timesBounced + 1;\n\n if(this.firstBounce == true){\n var rabbitVelocity = this.firstBounceVelocity;\n this.firstBounce = false;\n this.upperBound = 2356;\n\n } else {\n if(this.timesBounced > 1){\n this.upperBound = this.upperBound - 10;\n var velocity = 500 + distanceToGround - 300;\n var rabbitVelocity = this.currentVelocity - velocity;\n }\n \n }\n\n this.currentVelocity = rabbitVelocity;\n\n if(this.rising == false){\n player.body.velocity.y = rabbitVelocity;\n }\n\n } else {\n\n this.timesBounced = 1;\n this.firstBounce = true;\n console.log(this.timesBounced + \" out of bounds\");\n }\n\n //Jumping Sound\n jumpSound.play();\n\n\n}", "jump(){\r\n if((!this.dying) && (this.player.body.touching.down || (this.playerJumps > 0 && this.playerJumps < gameOptions.jumps))){\r\n if(this.player.body.touching.down){\r\n this.playerJumps = 0;\r\n }\r\n this.player.setVelocityY(gameOptions.jumpForce * -1);\r\n this.playerJumps ++;\r\n this.player.anims.play(\"playerJump_anim\");\r\n }\r\n }", "function update_velocity(cell_data) {\n\n /*\n This adds one-fourth of the collective pressure from surrounding cells to the \n cell's X axis velocity.\n */\n cell_data.xv += (\n cell_data.up_left.pressure * 0.5\n + cell_data.left.pressure\n + cell_data.down_left.pressure * 0.5\n - cell_data.up_right.pressure * 0.5\n - cell_data.right.pressure\n - cell_data.down_right.pressure * 0.5\n ) * 0.25;\n \n //This does the same for the Y axis.\n cell_data.yv += (\n cell_data.up_left.pressure * 0.5\n + cell_data.up.pressure\n + cell_data.up_right.pressure * 0.5\n - cell_data.down_left.pressure * 0.5\n - cell_data.down.pressure\n - cell_data.down_right.pressure * 0.5\n ) * 0.25;\n \n /*\n This slowly decreases the cell's velocity over time so that the fluid stops\n if it's left alone.\n */\n cell_data.xv *= 0.99;\n cell_data.yv *= 0.99;\n }", "update(t) {\r\n this.vehicle.v = this.vehicleSpeed * this.speedFactor;\r\n this.vehicle.update(t, this.freezeVehiclePos);\r\n }", "function addJump(body, parV) {\n\n var b = body,\n v = b.GetLinearVelocity(),\n vel = new b2Vec2(1,0);\n \n v.Add(vel);\n v.y = parV;\n b.SetLinearVelocity(v);\n\n }", "downer(velocity = 0) {\n this.jumping = false;\n this.velocityY = velocity;\n }", "jump(){\n if (this.avaliableJumps > 0){\n this.avaliableJumps -= 1;\n this.dy = -20;\n this.airborne = true;\n }\n}", "jump(){\n this.jumpCount++;\n if (this.jumpCount < 2) {\n this.velocity = -21;\n }\n \n clear();\n //this.jmpImg.show();\n\n }", "function resetVelocity(){\r\n Joey.velocityY += 1\r\n }", "function jump(){\n if(keyDown(\"space\") && cap.y >= 686){\n cap.velocityY = - 10;\n }\n //add gravity to the captain\n cap.velocityY = cap.velocityY + 0.6;\n}", "jump() {\n this.isJumping = true;\n this.updateAsset();\n \n setTimeout(() => { this.resetSkier() }, Constants.JUMP_DELAY);\n \n \n }", "get targetVelocity() {}", "function jump() {\n // If the player is on the ground, allow jumping\n if (onPlatform) {\n // Set the strength of the jump; -ve values mean up\n velocity = -15;\n onPlatform = false;\n }\n}", "function jump() {\n\t// If the player's feet are on the ground, have them jump\n\tif (!player.jumping && player.grounded) {\n\t\tplayer.jumping = true;\n\t\tplayer.grounded = false;\n\t\tplayer.yVelocity = -(player.jumpSpeed * gravityDirection);\n\t} else if (player.canExtendJump > 0 && (keys[38] || keys[32])) {\n\t\t// Allow player to extend jump if soon enough after jump AND they are holding jump key\n\t\tplayer.yVelocity -= (gravity * gravityDirection) / 1.7;\n\t}\n\t// else if (player.jumping && player.doubleJumps > 0) {\n\t// \tplayer.doubleJumps -= 1;\n\t// \tplayer.yVelocity = -player.jumpSpeed;\n\t// }\n}", "vel() {\n this.y += this.speed;\n }", "updateZoomVelocity() {\n const zoom = this.commands.zoom;\n if ((zoom.in ^ zoom.out) && Math.abs(this.zoom.vel.value) < this.zoom.vel.max) {\n if (zoom.in && this.zoom.value < this.zoom.max)\n this.zoom.vel.value += this.zoom.vel.change.key;\n if (zoom.out && this.zoom.value > this.zoom.min)\n this.zoom.vel.value -= this.zoom.vel.change.key;\n }\n }", "update() {\n if(height <= this.y ){\n //console.log(\"to low\");\n this.velocity += this.lift;\n }\n if(this.y < 15){\n console.log(\"to high\");\n this.velocity = 0;\n this.y = 15;\n } else {\n this.velocity += this.gravity;\n this.velocity *= 0.9;\n this.y += this.velocity;\n }\n }", "update(dt) {\n this.x += this.speed*dt;\n }", "update() {\n\t\tthis.velocity.add(this.acceleration);\n\t\tthis.location.add(this.velocity);\n\t\tthis.acceleration.mult(0);\n\t}", "async jump(game, data) {\n\t\tthis._jump_time = data.time;\n\t}", "async jump(game, data) {\n\t\tthis._jump_time = data.time;\n\t}", "function velocity(){\n\tvar offset = $(\"#velo\").offset();\n\t$(\"#veloPlus\").css({ top: offset.top - 15, left: offset.left + 95, display: \"block\" }).animate({ opacity: 1.0 }, \"slow\");\n\t$(\"#veloPlus\").animate({ opacity: 0.0 }, \"slow\");\n\tballVelo++;\n\tx += dx;\n\ty += dy;\n\tpaddleVelo += 25;\n\trequestAnimationFrame(draw);\n}", "update() {\n this.deltaTime += deltaTime;\n }", "function setPlayerVelocity(map){\n if(!self.noclip){\n\t\tg=isOnGround(self.position[0],self.position[1],self.position[2],self);\n\t\tif(self.position[1]+self.velocity[1]-velocityStep<g && self.velocity[1]-velocityStep<0){ // If the player is on the ground\n\t\t\tself.position[1]=g; // Set height to ground level\n self.velocity[1]=0; // Set velocity to 0\n self.canJump=true; // Now able to jump\n\t\t}else{\n\t\t\tself.velocity[1]-=velocityStep; // Accelerate towards earth\n\t\t}\n\t}else{\n\t\tsetVelocity(map[32],map[90],1); // Noclip mode\n\t}\n\tsetVelocity(map[87],map[83],0); //W,S\n\tsetVelocity(map[68],map[65],2); //A,D\n\tif(map[38]){ // Down\n\t\tif(phi-0.025>0){\n phi -= 0.025;\n }\n\t}\n\tif(map[40]){ // Up\n\t\tif(phi+0.025<Math.PI){\n\t\t\tphi+=0.025;\n\t\t}\n\t}\n\tif(map[37]){ // Left\n\t\ttheta-=0.05;\n if(theta<0){\n theta+=(2*Math.PI);\n }\n\t}\n\tif(map[39]){ // Right\n\t\ttheta+=0.05;\n\t\tif(theta>2*Math.PI){\n theta-(2*Math.PI);\n }\n\t}\n\n}", "seek(){\n\t\tvar dif = this.target.pos.minus(this.pos);\n\t\tdif = dif.normalized(this.seekspeed);\n\t\tthis.vel = this.vel.plus(dif.multiply(dt));\n\t}", "update (dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n const {x, y} = this.getCurrentPosition();\n let newX;\n if (x >= 500) {\n newX = -100;\n } else {\n newX = (x + dt * this.speed * 150) % (500)\n }\n\n this.setCurrentPosition(newX, y);\n }", "land() {\n this.velocity += 20; \n }", "get VelocityChange() {}", "setVelocity(v) {\n\t\tif(!this.no_accelerations) {\n\t\t\tvar goal = 0;\n\t\t\tif(v >= 0) {\n\t\t\t\tgoal = Math.min(v, this.max_v)\n\t\t\t} else {\n\t\t\t\tgoal = Math.max(v, -this.max_v);\n\t\t\t}\n\n\t\t\tvar diff = goal - this.v;\n\t\t\tthis.a = diff*this.max_a;\n\t\t} else {\n\t\t\tthis.v = v;\n\t\t\tthis.a = 0;\n\t\t}\n\t\t\n\t}", "update() {\n this.velocity.add(this.acceleration);\n this.velocity.limit(p.topspeed2);\n this.location.add(this.velocity);\n this.acceleration.mult(0);\n }", "update(dt) {\n // update velocity from 'gravity' towards origin\n v3.copy(this.position)\n .multiplyScalar(-Math.PI / this.position.lengthSq());\n this.velocity.add(v3);\n\n // update position from velocity\n v3.copy(this.velocity).multiplyScalar(dt);\n this.position.add(v3);\n\n // update rotation from direction of velocity\n v3.copy(this.velocity).normalize();\n this.rotation.setFromUnitVectors(ARROW_FORWARD, v3);\n \n // write udpated values into attribute-buffers\n this.position.toArray(\n this.buffers.position, this.offsets.position);\n this.rotation.toArray(\n this.buffers.rotation, this.offsets.rotation);\n }", "updatePos() {\n if (!this.isGrounded) { // see if player is able to jump\n\n if (this.y != this.jumpConfig.START_Y) { // buffer frames to make jump animate better\n this.jumpWait--;\n } else {\n this.jumpWait = 0;\n }\n\n if (this.jumpWait == 0) { // check if we land on a jump frame\n if (this.jumpDirection > 0) {\n this.y -= (this.jumpForce * 8) * this.jumpDirection;\n } else {\n this.y += (this.jumpConfig.INIT_JUMP_FORCE * 9) - (this.jumpForce * 8);\n }\n\n if (this.jumpForce > 0) {\n this.jumpForce--;\n }\n \n if (this.jumpForce == 0) {\n if (this.jumpDirection < 1) {\n this.isGrounded = true;\n } else {\n if (this.jumpHeightWait > 0) {\n this.jumpHeightWait--;\n } else {\n this.jumpHeightWait = this.jumpConfig.JUMP_ZERO_WAIT;\n }\n }\n if (this.jumpHeightWait <= 0) {\n this.jumpDirection = (-this.jumpDirection);\n this.jumpForce = this.jumpConfig.INIT_JUMP_FORCE;\n }\n }\n this.jumpWait = this.jumpConfig.JUMP_FRAME_WAIT;\n }\n }\n\n this.hitbox.updatePos(\n this.y + this.hitboxConfig.Y_MARGIN,\n this.y + this.hitboxConfig.HEIGHT + this.hitboxConfig.Y_MARGIN,\n this.x + this.hitboxConfig.X_MARGIN,\n this.x + this.hitboxConfig.WIDTH + this.hitboxConfig.X_MARGIN\n );\n \n this.updateInvincibility();\n this.draw();\n }", "update(time, delta) {\n }", "setVelocity(vxWorld, vyWorld) {\n this.vx = vxWorld\n this.vy = vyWorld\n }", "jump() {\n // if (this.y <= 0 || this.jumpCounts === 2) { // removed the this.y becasue if the user wants to jump twice that high it should be allowed. just wont have to power to move away from an obstacle\n // if the character has already jumped twice, we stop the player from jumping\n if (this.jumpCounts === 2) {\n console.log(\"HERE?\");\n return;\n }\n\n // add one jump to the count\n this.jumpCounts++;\n // pulls the player up, to get a vertical like feel\n this.y -= 10;\n // remove a value from the velocity so that it emulates the feeling of jumping with already some \"force\" pulling you down\n this.velocity -= 5;\n }", "update() {\n\t\tthis.y += this.v;\n\n\t\t// Use sine regression to alternate the position of a droplet. Creates a sway effect.\n\t\tif(this.sway == true){\n\t\t\tthis.x += Math.sin(this.r * (1/8));\n\t\t\tthis.r += Math.PI / 6;\n\t\t}\n\n\t\tif(this.y > this.dh) {\n\t\t\tthis.isDead = true;\n\t\t}\n\t}", "function update() {\n\n\t\tfbor.getPass( 'velocity' ).uniforms.time.value = clock.getElapsedTime();\n\n\t\tfbor.tick();\n\n\t\tpsys.setPositionBuffer( fbor.getPass( 'position' ).getRenderTarget() );\n\t\tpsys.material.uniforms.velocityBuffer.value = fbor.getPass( 'velocity' ).getRenderTarget();\n}", "update(){\n\t\tif (this.dead ===false){\n\t\t\t//this.angle += this.angVel;\n\t\t\tthis.vel.limit(30).add(this.acc);\n\t\t\tthis.loc.add(this.vel);\n\t\t\tthis.acc.mult(0);\n\t\t}\n\t}", "update(){\n\t\tthis.position.add(this.velocity);\n\t\tthis.velocity.add(this.acceleration);\n\t\tthis.velocity.limit(this.maxSpeed);\n\t}", "update() {\n // Update this.velocity\n this.vel.add(this.acc);\n // Limit this.speed\n this.vel.limit(this.speed);\n this.pos.add(this.vel);\n // Reset accelertion to 0 each cycle\n this.acc.mult(0);\n }", "updateVelocity(flapForce, g=0.8) {\n this.velocity = this.velocity + (flapForce - g);\n }", "update(timeStep) {\n\n }", "update() {\n this.vel.add(this.acc);\n this.pos.add(this.vel);\n this.lifespan -= 2;\n\n this.vel.limit(5);\n }", "function change_cell_velocity(cell_data, mvelX, mvelY, pen_size) {\n //This gets the distance between the cell and the mouse cursor.\n var dx = cell_data.x - mouse.x;\n var dy = cell_data.y - mouse.y;\n var dist = Math.sqrt(dy * dy + dx * dx);\n \n //If the distance is less than the radius...\n if (dist < pen_size) {\n\n //If the distance is very small, set it to the pen_size.\n if (dist < 4) {\n dist = pen_size;\n }\n \n //Calculate the magnitude of the mouse's effect (closer is stronger)\n var power = pen_size / dist;\n\n /*\n Apply the velocity to the cell by multiplying the power by the mouse velocity and adding it to the cell velocity\n */\n cell_data.xv += mvelX * power;\n cell_data.yv += mvelY * power;\n }\n }", "update(time) {\n let Fd = Math.pow(this.vel, 2) * this.dragConst * -Math.sign(this.vel);\n\n let Fnet = this.Fe - this.Fg + Fd;\n\n this.acc = Fnet / this.mass;\n this.vel += this.acc * (time.deltaTime / 1000);\n let vel = Math.min(Math.max(this.vel, -Math.abs(this.vt)), Math.abs(this.vt));\n this.vel = vel;\n\n this.pos += this.vel * (time.deltaTime / 1000);\n //\n // if (!isNaN(Fd)) {\n // console.log(\"//////////////////////\");\n // console.log(\"VT: \" + this.vt);\n // console.log(\"Drag: \" + Fd);\n // console.log(\"Acc: \" + this.acc);\n // console.log(\"Vel: \" + this.vel);\n // console.log(\"Pos: \" + this.pos);\n // }\n }", "update() {\n //W = V / R\n let angular_init = this.ang_velocity;\n\n this.ang_velocity += (this.scene.speedFactor+2*this.scene.bird.speed)/2;\n this.rot_wings = (this.rot_wings + (2*this.ang_velocity * this.change_ang * (this.scene.delta_time/1000))) % Math.PI; \n \n //delta ang = W * delta_time\n if(this.rot_wings < -Math.PI/4){\n this.change_ang = 1;\n }\n\n \n if(this.rot_wings > Math.PI/4) {\n this.change_ang = -1;\n }\n \n this.ang_velocity = angular_init;\n\n }", "update(time, delta) {\n // << DO UPDATE LOGIC HERE >>\n this.player.update(this.cursors, this.jumpSound);\n\n this.gun.update(time, this.player, this.cursors, this.fireLaser, this.laserSound);\n }", "jump() {\n if (this._state !== this.PLAY_STATE) {\n return;\n }\n if (this._jump > 1) {\n this._y -= Math.floor(this._jump * 0.08);\n if (this._y < 0) {\n this._y = 0;\n }\n this._jump = Math.floor(this._jump * 0.92);\n } else {\n this._jump = 0;\n }\n offset = this._jump;\n }", "update() {\n // Don't update when dead\n if (this.isDead()) {\n return;\n }\n\n this._applyConstantForces();\n\n this.vel = this.vel.add(this.acc);\n if (this.maxSpeed) {\n this.vel = this.vel.limit(this.maxSpeed);\n }\n\n this.prevPos = this.pos.clone();\n this.pos = this.pos.add(this.vel);\n\n // Reset acc for each cycle\n this.acc = this.acc.multiply(0);\n\n if (this.bindToScreen) {\n this._bindToScreen();\n }\n\n if (this.showTrail) {\n this.trail.push(this.pos.clone());\n this.trail = this.trail.splice(this.trail.length - this.trailLimit);\n }\n\n this.count += 1;\n }", "timeEvolve(){\n this.#particles.forEach(particle => {\n var pos = particle.getPosition(true);\n var vel = particle.getVelocity(true);\n var elapsedTime = particle.getAge() * this.#deltaT;\n var newPos = [\n World.constantVelocityTrajectory(\n elapsedTime,\n vel[0],\n pos[0]\n ),\n World.acceleratedTrajectory(\n this.#g,\n elapsedTime,\n vel[1],\n pos[1]\n )\n ]\n\n particle.setPosition(newPos);\n particle.incrementAge();\n //!!! velocity hasn't been updated. probably should! !!!\n })\n this.#elapsedTimeIntervalCount ++;\n }", "function turboSpeed() {\r\n\t \tdelta = 500;\r\n\t}", "update(){\r\n this.sprite.y += this.staticVelY;\r\n }", "function pushStorkyUp() {\n storkyVelocity = new THREE.Vector3(0, 1.1, 0);\n}", "function Jump(){\r\n JumpSound.play();\r\n Joey.velocityY = -14;\r\n Joey.velocityX = 1\r\n Joey.changeAnimation(\"Jumping\",Jumping_Joey);\r\n setTimeout(resetRuning,5000);\r\n CharacterMotion = \"Jump\"\r\n\r\n}", "update(delta) {}", "function SetJump(){\n // when in ground.\n if(chrAnimator.GetInteger(\"Jump\") == 0){\n // execute only when State tag is InIdle or InMove , moveDirection use jumpSpeed.\n \t\tif(stateInfo.IsTag(\"InIdle\") || stateInfo.IsTag(\"InMove\")){\n\t\t\tchrAnimator.SetInteger(\"Jump\", 1);\n\t\t\tmoveDirection.y += jumpSpeed;\n\t\t}\n\t}\n // when in air, can jump once more.\n\telse if(chrAnimator.GetInteger(\"Jump\") == 1){\n // jump with half power\n\t\tmoveDirection.y += jumpSpeed /2;\n\t\tif(chrController.velocity.y < 0){\n\t\t\tmoveDirection.y -= chrController.velocity.y;\n\t\t}\n\t\tchrAnimator.SetInteger(\"Jump\", 2);\n\t}\n}", "update() {\r\n // Update velocity\r\n this.velocity.add(this.acceleration);\r\n // Limit speed\r\n this.velocity.limit(this.maxspeed);\r\n this.position.add(this.velocity);\r\n // Reset acceleration to 0 each cycle\r\n this.acceleration.mult(0);\r\n }", "jumpOnCollision() {\n\t\tif (!this.game.skier.isCrashed && !this.game.skier.isJumping) {\n\t\t\tlet jumpV = this.game.skier.yv * this.game.jumpVMult + this.game.jumpVBase;\n\t\t\tthis.game.skier.jumpV = jumpV;\n\t\t\tthis.game.skier.isJumping = true;\n\t\t\tthis.game.stylePointsToAwardOnLanding = jumpV * 5;\n\t\t}\n\t}", "update() {\n this.pos[0] += this.accel * this.dir * 4.0;\n this.pos[0] = Math.max(0, Math.min(END, this.pos[0]));\n this.do_gravity();\n this.behavior();\n this.bhv_time += 1;\n }", "update() {\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset acceleration to 0 each cycle\n this.acceleration.mult(1);\n }", "jump() {\n this.x = Math.floor(this.x0 + this.v0*this.t + 1/2 * this.g * this.t*this.t);\n this.ballPos.splice(0, 1, 180-this.x);\n this.ball.style.top = `${this.ballPos[0]}px`;\n this.t+=0.1;\n \n if (this.x <= 0) {\n this.jumpin = false; \n this.ball.style.top = 180+'px';\n this.x=0;\n this.t = 0.1;\n this.jumpKeyDown = this.jumpKeyDown ? false : true;\n this.jumpKeyUp = this.jumpKeyUp ? false : true;\n \n this.ball.innerHTML = this.faces[0]\n }\n }", "update(dt) {\n this.x+=5\n if (this.x >= 500) {\n this.x = -100;\n }\n }", "update() {\n var gravity = 0.5; // Arbitrary constant\n this.aAcceleration = ((-1 * gravity) / this.r) * sin(this.angle); // Calculate acceleration (see: http://www.myphysicslab.com/pendulum1.html)\n this.aVelocity += this.aAcceleration; // Increment velocity\n this.aVelocity *= this.damping; // Arbitrary damping\n this.angle += this.aVelocity; // Increment angle\n }", "update (dt) {\n // Multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n if (this.x < 505) {\n this.x += (this.speed * dt);\n } else {\n this.x = 0;\n }\n }", "resetJump() {\n this.z = 0;\n this.verticalVelocity = null;\n }", "increaseSpeedFall(){\n\t\t// if(this.breakedLine >= NB_OF_LINES_TO_BREAK_TO_SPEED_UP){\n\t\t// \tthis.speedPoint++;\n\t\t// \tthis.breakedLine-= NB_OF_LINES_TO_BREAK_TO_SPEED_UP;\n\t\t// }\n\n\t\tthis.speedPoint = Math.trunc(this.breakedLine/NB_OF_LINES_TO_BREAK_TO_SPEED_UP);\n\n\t\ttrace(\"SPEED POINT\", this.speedPoint);\n\n\t\t//this.mvc.controller.tick = STARTING_TICK - (this.speedPoint*10);\n\n\t\tthis.mvc.controller.tick = STARTING_TICK * 1/(this.speedPoint + 1);\n\n\t\ttrace(\"this.mvc.controller.tick\", this.mvc.controller.tick);\n\t}", "function calculateVelocity() {\n velocity_of_x = bullet_moving_velocity * Math.cos(bullet_moving_theta * Math.PI / 200);\n velocity_of_y = bullet_moving_velocity * Math.sin(bullet_moving_theta * Math.PI / 200);\n}", "update(dt) {\n if(this.x < 500) {\n this.x += this.speed * dt;\n this.y = this.y;\n }\n else {\n this.x = -100;\n }\n }", "move() {\n let frameTime = fc.Loop.timeFrameGame / 1000;\n let distance = fc.Vector3.SCALE(this.velocity, frameTime);\n this.translate(distance);\n }", "jump () {\n if (this.isJumping === false && this.bodyPosition.y - this.targetHeight < this.data.tolerance) {\n this.el.emit('do-jump')\n this.isJumping = true\n }\n }", "update(_time, delta) {\n const deltaTheta = this[$targetSpherical].theta - this[$spherical].theta;\n const deltaPhi = this[$targetSpherical].phi - this[$spherical].phi;\n const deltaRadius = this[$targetSpherical].radius - this[$spherical].radius;\n const distance = magnitude(deltaTheta, deltaPhi, deltaRadius);\n const frames = delta / FRAME_MILLISECONDS;\n // Velocity represents a scale along [0, 1] that changes based on the\n // acceleration constraint. We only \"apply\" velocity when accelerating.\n // When decelerating, we apply dampening exclusively.\n const applyVelocity = distance > this[$options].decelerationMargin;\n const nextVelocity = Math.min(this[$velocity] + this[$options].acceleration * frames, 1.0);\n if (applyVelocity) {\n this[$velocity] = nextVelocity;\n }\n else if (this[$velocity] > 0) {\n this[$velocity] = Math.max(nextVelocity, 0.0);\n }\n const scale = this[$dampeningFactor] *\n (applyVelocity ? this[$velocity] * frames : frames);\n const scaledDeltaTheta = deltaTheta * scale;\n const scaledDeltaPhi = deltaPhi * scale;\n const scaledDeltaRadius = deltaRadius * scale;\n let incrementTheta = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaTheta)) * scaledDeltaTheta;\n let incrementPhi = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaPhi)) * scaledDeltaPhi;\n let incrementRadius = step(ORBIT_STEP_EDGE, Math.abs(scaledDeltaRadius)) * scaledDeltaRadius;\n // NOTE(cdata): If we evaluate enough frames at once, then there is the\n // possibility that the next incremental step will overshoot the target.\n // If that is the case, we just jump straight to the target:\n if (magnitude(incrementTheta, incrementPhi, incrementRadius) > distance) {\n incrementTheta = deltaTheta;\n incrementPhi = deltaPhi;\n incrementRadius = deltaRadius;\n }\n this[$spherical].theta += incrementTheta;\n this[$spherical].phi += incrementPhi;\n this[$spherical].radius += incrementRadius;\n // Derive the new camera position from the updated spherical:\n this[$spherical].makeSafe();\n this[$sphericalToPosition](this[$spherical], this.camera.position);\n this.camera.lookAt(this.target);\n // Dispatch change events only when the camera position changes due to\n // the spherical->position derivation:\n if (!this[$previousPosition].equals(this.camera.position)) {\n this[$previousPosition].copy(this.camera.position);\n this.dispatchEvent({ type: 'change' });\n }\n else {\n this[$targetSpherical].copy(this[$spherical]);\n }\n }", "update () {\n this.y += this.speed;\n }", "gravity(force) {\n this.ay += force\n }", "setVelocity( vx, vy ){\n\t\tif ( this.vx == 0 && vx != 0){\n\t\t\tthis.updateVelocity( vx, vy);\n\t\t}else if ( this.vy == 0 && vy != 0 ){\n\t\t\tthis.updateVelocity( vx, vy);\n\t\t}\n\t}", "jump() {\n\n if (this.alive == false)\n return; \n\n // Add a vertical velocity to the bird\n this.sprite.body.velocity.y = -350;\n\n // this.add.tween(this.bird).to({angle: -20}, 100).start(); \n let tween = this.game.tweens.add({\n targets: this.sprite,\n duration: 100,\n delay: 0,\n alpha: 1,\n repeat: 0,\n angle: -20\n });\n }", "faster(){\n if(this.body.angularVelocity <= 800){\n this.body.angularVelocity += 200;\n }\n this.setVelocityX(this.body.velocity.x + 40);\n this.setVelocityY(this.body.velocity.y - 40);\n }", "update(dt) {\n this.x += this.v * dt;\n if(this.x > boardWidth + spriteWidth / 2) {\n this.x = -spriteWidth / 2;\n this.v = sampleInRange(this.minimumVelocity, this.maximumVelocity);\n }\n }", "function update(){\n\n//------------------------------------------------------------------\n//les inputs\n\tif(cursors.left.isDown){\n\t\tplayer.anims.play('left', true);\n\t\tplayer.setVelocityX(-300);\n\t\tplayer.setFlipX(true);\n\t}\n\n\telse if(cursors.right.isDown){\n\t\tplayer.setVelocityX(300);\n\t\tplayer.anims.play('left', true);\n\t\tplayer.setFlipX(false);\n\t}\n\n\telse{\n\t\tplayer.anims.play('stop', true);\n\t\tplayer.setVelocityX(0);\n\t}\n\n\n\tif (cursors.down.isDown){\n\t\tplayer.setVelocityY(230);\n\t}\n\n//-------------------------------------------------------------\n// tentative(s) du double saut (ne fonctionne pas)\n\tif(cursors.up.isDown && player.body.touching.down){\n\t\tplayer.setVelocityY(-330);\n\t\tjump = 1;\n\t} \n\nif(!player.body.touching.down && cursors.up.isDown && jump === 1){\n\t\tjump = --jump;\n\t\tplayer.setVelocityY(-330);\n\t} \n/*\nif(cursors.up.isDown){\n\t\tjump = --jump;\n\t\n\t\tif(jump === 1){\n\t\tplayer.setVelocityY(-330);\n\t\tjump = --jump;\n\t\t} \n\n\t\tif(jump === 2){\n\t\tplayer.setVelocityY(-330);\n\t\tjump = --jump;\n\t\t} \n}\n*/\n/*\n\tif(!cursors.up.isDown && jump < 2){\n\t\tjump++;\n\t\tplayer.setVelocityY(-330);\n\t} \n*/\n\n\n\n/*\nif (savesaut === 0 && player.body.touching.down && cursor.up.isDown) {\n\t//player.anims.play('jump',true);\n\tplayer.set setVelocityY(-500);\n\tsavesaut = 1;\n\tveriftouche = 0;\n}\n\n\nif (cursor.up.isDown) {\n\tplayer.anims.play('jump',true);\n}\n\nif (cursor.up.isUp) {\n\tveriftouche = 1;\n}\nif(savesaut === 1 && cursors.up.isDown && veriftouche ===1) {\n\tplayer.setVelocityY(-500);\n\tsavesaut = 0;\n}\n\nelse if (cursors.down.isDown && !player.body.touching.down) {\n\tplayer.setVelocityY(2000);\n\t//player.anims.play('stop',true);\n}\n*/\n}" ]
[ "0.75887346", "0.75862485", "0.7338045", "0.71538514", "0.7147042", "0.7084217", "0.6947548", "0.6868959", "0.6847015", "0.6834792", "0.6817516", "0.6794661", "0.6750414", "0.67262256", "0.67002475", "0.6692113", "0.66456205", "0.663781", "0.658576", "0.6556035", "0.6554303", "0.6550528", "0.6538566", "0.6535887", "0.65268445", "0.650186", "0.64906955", "0.6481836", "0.6471434", "0.64269286", "0.64231336", "0.64092094", "0.6382459", "0.6373317", "0.6351912", "0.6334955", "0.6334717", "0.6319861", "0.63144326", "0.6308195", "0.63075316", "0.6287352", "0.6287352", "0.6267877", "0.6262424", "0.6247868", "0.62443984", "0.62366647", "0.6232628", "0.61978954", "0.6196044", "0.619179", "0.61884546", "0.6166419", "0.61661315", "0.61653996", "0.61585534", "0.6155911", "0.6155782", "0.61517066", "0.614173", "0.6135864", "0.61351097", "0.61348087", "0.6129357", "0.6129267", "0.61227256", "0.6122546", "0.6111455", "0.60894924", "0.6086273", "0.60719013", "0.6066901", "0.60645556", "0.60603255", "0.6044567", "0.60427374", "0.6035545", "0.6032546", "0.60311484", "0.60080916", "0.60029334", "0.60028577", "0.60012543", "0.59997153", "0.5987857", "0.5970676", "0.59552515", "0.59537387", "0.5952278", "0.5952147", "0.5941008", "0.5939972", "0.59377474", "0.59334695", "0.5932772", "0.59311867", "0.59241813", "0.5922606", "0.59108937" ]
0.6908547
7
The internal function to add a class to a DOM element.
function _addClass(element, className) { var classes; classes = element.className.split(' '); if (classes.indexOf(className) === -1) { classes.push(className); element.className = classes.join(' ').trim(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addClass(element, cls) {\n element.classList.add(cls);\n}", "setClass(el, classname) {\n el.className += ' ' + classname;\n }", "function addClass(element, cls) {\n element.className +=cls+' ';\n}", "function elementAddClass(className, selector) {\n$(selector).addClass(className);\n}", "function addClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "function addClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "function addClass(el,cls){/* istanbul ignore if */if(!cls||!cls.trim()){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=' '+el.getAttribute('class')+' ';if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "function addClass(element, clas)\n{\n if (! hasClass(element, clas))\n element.className += ' ' + clas;\n}", "function addClass (element, classname) {\n if (element.classList) {\n element.classList.add(classname);\n } else {\n element.className += ' ' + classname;\n }\n }", "function addClassToElement(element, className) {\n element.classList.add(className);\n}", "function addClass(elem, className) {\r\n elem.addClass(className);\r\n }", "function addingClass(element, addedClass) {\n element.classList.add(addedClass);\n }", "function setClassToElement(obj,className){\n\t/* pour insertion dans l'arbre DOM\n\tif(document.all)\n\t\tobj.setAttribute('className',className);\t// IE\n\telse\n\t\tobj.setAttribute('class',className);*/\n\tobj.className = className;\n}", "function addClass(element, newClass) {\n element.classList.add(newClass);\n}", "function classAdd(element, name) {\n var className;\n if (classContains(element, name)) {\n return;\n }\n className = element.className;\n if (className === '' || className === null || className === undefined) {\n element.className = name;\n } else {\n element.className = className + ' ' + name;\n }\n }", "function addClass(element, value) \n{\n if (!element.className) \n {\n element.className = value;\n } \n else \n {\n var newClassName = element.className;\n newClassName += \" \";\n newClassName += value;\n element.className = newClassName;\n }\n}", "function addClass(element, newClass)\n {\n \telement.className = element.className + \" \" + newClass;\n }", "function addClass(element, classname) {\n\tvar classes = getClassList(element);\n\tif (indexOf(classname, classes) < 0) {\n\t\tclasses[classes.length] = classname;\n\t\tsetClassList(element,classes);\n\t}\n}", "function addClass(element,newClassName)\n{\n var oldClassName = element.className;\n element.className = oldClassName === \"\" ? newClassName:oldClassName + \" \" + newClassName;\n}", "function addClass(el, cls) {\n var classes = el.className.split(' ');\n classes.push(cls);\n el.className = classes.join(' ');\n}", "function addClass(element, cls) {\n if (hasClass(element, cls))\n return;\n var old_cls = element.className;\n if (old_cls) cls = cls + ' ' + old_cls;\n element.className = cls;\n}", "function xAddClass(e, c) {\r\n e = xGetElementById(e);\r\n if (!e)\r\n return false;\r\n if (!xHasClass(e, c))\r\n e.className += ' '+c;\r\n return true;\r\n}", "function xAddClass(e, c)\n{\n if ((e=xGetElementById(e))!=null) {\n var s = '';\n if (e.className.length && e.className.charAt(e.className.length - 1) != ' ') {\n s = ' ';\n }\n if (!xHasClass(e, c)) {\n e.className += s + c;\n return true;\n }\n }\n return false;\n}", "function addClass(el, className) { \n el.className += className;\n }", "function addClass(ele, cls) {\n\tif (!hasClass(ele, cls)) ele.className += \" \" + cls;\n}", "function addClass(element, className) {\n var classes = element.className.split(' ');\n if (classes.indexOf(className) == -1) {\n classes.push(className);\n }\n element.className = classes.join(' ');\n }", "function addClass(elem, className) {\n\t\tif (elem.classList)\n\t\t\telem.classList.add(className)\n\t\telse {\n\t\t\tvar oldClassName = elem.getAttribute('class');\n\t\t\telem.setAttribute('class', oldClassName.replace(className,'')+' '+className );\n\t\t}\n\t}", "function nbAddCssClass(element, cssClass) {\n var className = element.className;\n if (className.indexOf(cssClass) !== -1) {\n // already has this class\n return;\n }\n element.className = (element.className.trim() + ' ' + cssClass);\n}", "function addClass(element, className) {\n if (!element) {\n return;\n }\n if (element.classList) {\n element.classList.add(className);\n }\n else {\n var currentClassName = element.getAttribute(\"class\");\n if (currentClassName) {\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\n return item !== className;\n }).join(\" \") + \" \" + className);\n }\n else {\n element.setAttribute(\"class\", className);\n }\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\") + \" \" + className;\n }\n}", "function addClass(el, cls) {\n\t\t /* istanbul ignore else */\n\t\t if (el.classList) {\n\t\t if (cls.indexOf(' ') > -1) {\n\t\t cls.split(/\\s+/).forEach(function (c) {\n\t\t return el.classList.add(c);\n\t\t });\n\t\t } else {\n\t\t el.classList.add(cls);\n\t\t }\n\t\t } else {\n\t\t var cur = ' ' + el.getAttribute('class') + ' ';\n\t\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t\t el.setAttribute('class', (cur + cls).trim());\n\t\t }\n\t\t }\n\t\t}", "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n var transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value ].concat( transitionClasses)\n : [].concat( transitionClasses )).join(' ');\n }\n el.className = value;\n }\n }", "function patchClass(el, value, isSVG) {\n if (value == null) {\n value = '';\n }\n if (isSVG) {\n el.setAttribute('class', value);\n }\n else {\n // directly setting className should be faster than setAttribute in theory\n // if this is an element during a transition, take the temporary transition\n // classes into account.\n var transitionClasses = el._vtc;\n if (transitionClasses) {\n value = (value\n ? [value ].concat( transitionClasses)\n : [].concat( transitionClasses )).join(' ');\n }\n el.className = value;\n }\n }", "function addClass(el, className) {\n if (el.classList)\n el.classList.add(className);\n else\n el.className += ' ' + className;\n}", "add_class(e, c)\n\t{\n\t\te && c && e.classList.add(c);\n\t}", "function addClass (el, cls) {\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = ' ' + el.getAttribute('class') + ' ';\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); })\n\t } else {\n\t el.classList.add(cls)\n\t }\n\t } else {\n\t var cur = ' ' + el.getAttribute('class') + ' '\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim())\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = ' ' + el.getAttribute('class') + ' ';\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass(node, className) {\n\t\tif (node.classList)\n\t\t\tnode.classList.add(className);\n\t\telse\n\t\t\tnode.className += ' ' + className;\n\t}", "function addClass(el, clName) { if (!el) return; el.classList.add(clName); }", "function addClass(el, cls) {\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) {\n return el.classList.add(c);\n });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = ' ' + el.getAttribute('class') + ' ';\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass(ele, cls) {\n if (!hasClass(ele,cls)) ele.className += \" \"+cls;\n ele.className = cleanClasses(ele.className);\n }", "function _addClass(element, className, classRegExp) {\n if (element.className) {\n _removeClass(element, classRegExp);\n element.className += \" \" + className;\n } else {\n element.className = className;\n }\n }", "function _addClass(element, className, classRegExp) {\n if (element.className) {\n _removeClass(element, classRegExp);\n element.className += \" \" + className;\n } else {\n element.className = className;\n }\n }", "function AddClass(el, cl) {\n if (HasClass(el, cl)) return;\n el.className += \" \" + cl;\n}", "function _addClass(string, node) {\n\tclasses(node).add(string);\n}", "function addClass(element, className) {\n if (hasClass(element, className)) return; // Element already has the class - so do not add it\n element.className = element.className === \"\" ? className : element.className + \" \" + className;\n}", "function addMyClass(param, classToAdd) {\r\n //if it has the class\r\n if (param.classList.contains(classToAdd)) {\r\n param.classList.remove(classToAdd);\r\n } else {\r\n //if it doesnt have the class add it\r\n var classString = param.className; // returns the string of all the classes for element\r\n var newClass = classString.concat(\" \" + classToAdd);\r\n param.className = newClass;\r\n }\r\n}", "function patchClass(el, value, isSVG) {\r\n if (value == null) {\r\n value = '';\r\n }\r\n if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value\r\n ? [value, ...transitionClasses]\r\n : [...transitionClasses]).join(' ');\r\n }\r\n el.className = value;\r\n }\r\n}", "function patchClass(el, value, isSVG) {\r\n if (value == null) {\r\n value = '';\r\n }\r\n if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value\r\n ? [value, ...transitionClasses]\r\n : [...transitionClasses]).join(' ');\r\n }\r\n el.className = value;\r\n }\r\n}", "function addClass (el, cls) {\r\n /* istanbul ignore if */\r\n if (!cls || !(cls = cls.trim())) {\r\n return\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (el.classList) {\r\n if (cls.indexOf(' ') > -1) {\r\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\r\n } else {\r\n el.classList.add(cls);\r\n }\r\n } else {\r\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\r\n if (cur.indexOf(' ' + cls + ' ') < 0) {\r\n el.setAttribute('class', (cur + cls).trim());\r\n }\r\n }\r\n}", "function addClass(_class, _element) {\n\t// variables\n\tvar className = \"\", // string to hold className to add\n\t\t\tclassExists = false; // boolean to check if the class already exists\n\tvar classes = _element.className.split(\" \");\n\n\n\tif (classes[0] === \"\") { /* element has no classes. add class name */ }\n\telse {\n\t\t/* element has existing classes */\n\t\tclassName += \" \"; // for appropriate spacing\n\t\t/* check if the class already exists */\n\t\tfor (var i = 0; i < classes.length; i++) {\n\t\t\tif (classes[i] === _class) { classExists = true; } // class exists, do nothing\n\t\t}\n\t}\n\n\t// if className does not exist, add new className\n\tif (!classExists) {\n\t\tclassName += _class;\n\t\t_element.className += className;\n\t}\n}", "function addClass(element, classToAdd) {\n var currentClassValue = element.className;\n \n if (currentClassValue.indexOf(classToAdd) == -1) {\n if ((currentClassValue === null) || (currentClassValue === \"\")) {\n element.className = classToAdd;\n } else {\n element.className += \" \" + classToAdd;\n }\n }\n}", "function addClass(element, classToAdd) {\n var currentClassValue = element.className;\n\n if (currentClassValue.indexOf(classToAdd) == -1) {\n if (currentClassValue == null || currentClassValue === \"\") {\n element.className = classToAdd;\n } else {\n element.className += \" \" + classToAdd;\n }\n }\n}", "function add_class(class_name,elm_id) {\n\n var element = document.getElementById(elm_id);\n if (!(element)) {console.log('No element found with id: '+elm_id); return;}\n var class_pat = new RegExp('(?:^|\\\\s)'+class_name+'(?!\\\\S)',\"gi\");\n if ( ! (element.className.match(class_pat))) {\n element.className += \" \" + class_name;\n }\n}", "function addClass(css_class, element) {\r\n checkParams(css_class, element, 'addClass');\r\n var class_element = element.className;\r\n\r\n if (!hasClass(css_class, element)) {\r\n if (class_element.length) {\r\n class_element += ' ' + css_class;\r\n } else {\r\n class_element = css_class;\r\n }\r\n }\r\n element.className = class_element;\r\n }", "function addClass (el, cls) {\n\t /* istanbul ignore if */\n\t if (!cls || !(cls = cls.trim())) {\n\t return\n\t }\n\t\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n\t /* istanbul ignore if */\n\t if (!cls || !(cls = cls.trim())) {\n\t return\n\t }\n\t\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n\t /* istanbul ignore if */\n\t if (!cls || !(cls = cls.trim())) {\n\t return\n\t }\n\t\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n\t /* istanbul ignore if */\n\t if (!cls || !(cls = cls.trim())) {\n\t return\n\t }\n\t\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n\t /* istanbul ignore if */\n\t if (!cls || !(cls = cls.trim())) {\n\t return\n\t }\n\t\n\t /* istanbul ignore else */\n\t if (el.classList) {\n\t if (cls.indexOf(' ') > -1) {\n\t cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n\t } else {\n\t el.classList.add(cls);\n\t }\n\t } else {\n\t var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n\t if (cur.indexOf(' ' + cls + ' ') < 0) {\n\t el.setAttribute('class', (cur + cls).trim());\n\t }\n\t }\n\t}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}", "function addClass (el, cls) {\n /* istanbul ignore if */\n if (!cls || !(cls = cls.trim())) {\n return\n }\n\n /* istanbul ignore else */\n if (el.classList) {\n if (cls.indexOf(' ') > -1) {\n cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n } else {\n el.classList.add(cls);\n }\n } else {\n var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n el.setAttribute('class', (cur + cls).trim());\n }\n }\n}" ]
[ "0.7825334", "0.77965605", "0.7680096", "0.7647689", "0.7637954", "0.7637954", "0.76291764", "0.75559247", "0.75420535", "0.75338197", "0.7506034", "0.7454994", "0.74348986", "0.7432446", "0.7429004", "0.7427031", "0.74059147", "0.74036837", "0.73846084", "0.7379288", "0.73682034", "0.73501456", "0.7345328", "0.7335189", "0.73289907", "0.7319976", "0.7318776", "0.7313704", "0.7310266", "0.73040986", "0.7296007", "0.7296007", "0.72921354", "0.72833496", "0.72832316", "0.7257922", "0.7249501", "0.7232126", "0.72307235", "0.7228024", "0.7217923", "0.7216285", "0.7216285", "0.72057915", "0.71957827", "0.71829253", "0.71741027", "0.7163363", "0.7163363", "0.71595603", "0.7155207", "0.7154785", "0.7151361", "0.7150839", "0.7133482", "0.7116827", "0.7116827", "0.7116827", "0.7116827", "0.7116827", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627", "0.71147627" ]
0.7347343
22
return bytes.reduce((p, b) => p + String.fromCharCode(b), "");
function byteArrayToString(bytes) { var str = ""; if (bytes != null && bytes != undefined) { for (var i = 0; i < bytes.length; i++) { str += String.fromCharCode(bytes[i]); } } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bytesToString(bytes) {\r\n\t let s = '';\r\n\t for (let i = 0; i < bytes.length; i += 1) {\r\n\t s += String.fromCharCode(bytes[i]);\r\n\t }\r\n\r\n\t return s;\r\n\t}", "function convertBytesToString ( bytes ) {\n\n var string = [],\n pos = 0,\n c = 0;\n\n while (\n pos < bytes.length\n ) {\n\n var c1 = bytes[pos++];\n\n if (\n c1 < 128\n ) {\n string[c++] = String.fromCharCode(c1);\n } else if (\n c1 > 191 &&\n c1 < 224\n ) {\n\n var c2 = bytes[pos++];\n\n string[c++] = String.fromCharCode(( c1 & 31 ) << 6 | c2 & 63);\n\n } else if (\n c1 > 239 &&\n c1 < 365\n ) {\n\n var c2 = bytes[pos++];\n var c3 = bytes[pos++];\n var c4 = bytes[pos++];\n var u = ( ( c1 & 7 ) << 18 | ( c2 & 63 ) << 12 | ( c3 & 63 ) << 6 | c4 & 63 ) - 0x10000;\n\n string[c++] = String.fromCharCode(0xD800 + ( u >> 10 ));\n string[c++] = String.fromCharCode(0xDC00 + ( u & 1023 ));\n\n } else {\n\n var c2 = bytes[pos++];\n var c3 = bytes[pos++];\n\n string[c++] = String.fromCharCode(( c1 & 15 ) << 12 | ( c2 & 63 ) << 6 | c3 & 63);\n\n };\n\n };\n\n return(string.join(''));\n\n}", "function bytesToString(bytes) {\n let s = '';\n for (let i = 0; i < bytes.length; i += 1) {\n s += String.fromCharCode(bytes[i]);\n }\n\n return s;\n}", "function bytesToString(bytes) {\n var s = '';\n for (var i = 0; i < bytes.length; i += 1) {\n s += String.fromCharCode(bytes[i]);\n }\n\n return s;\n }", "function bytesToString(bytes) {\n if (typeof bytes === \"string\") {\n return bytes;\n } else {\n var str = \"\";\n for (var i = 0; i < bytes.length; ++i) {\n str += String.fromCharCode(bytes[i]);\n }\n return str;\n }\n}", "static bytesToHex(bytes) {\n return bytes.reduce(\n (str, byte) => str + byte.toString(16).padStart(2, '0'),\n ''\n )\n }", "function tostring(a) {\n\t return String.fromCharCode.apply(0, a);\n\t }", "function fixdata(data) {\n var o = \"\",\n l = 0,\n w = 10240;\n for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));\n return o;\n }", "function collapseToChar(str) {\n\t\tlet enc = \"\";\n\t\tfor (var i = 0; i < str.length; i++) {\n\t\t\tenc += getCharString(str[i]);\n\t\t}\n\t\treturn String.fromCharCode(Number(\"0b\" + enc));\n\t}", "function tostring(a) {\n\t return String.fromCharCode.apply(0, a);\n\t}", "function bytesToBinary(bytes) {\r\n return bytes.map(function(x) {\r\n return lpad(x.toString(2), '0', 8)\r\n }).join('');\r\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n}", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n}", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n}", "function bytesToBinary(bytes) {\n return bytes.map(function(x) {\n return lpad(x.toString(2), '0', 8)\n }).join('');\n}", "function tostring(a) {\r\n\t return String.fromCharCode.apply(0, a);\r\n\t}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function bytesToBinary(bytes) {\n\t return bytes.map(function(x) {\n\t return lpad(x.toString(2), '0', 8)\n\t }).join('');\n\t}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n}", "function fixdata(data) {\n\t\tvar o = \"\", l = 0, w = 10240;\n\t\tfor(; l<data.byteLength/w; ++l) o+=String.fromCharCode.apply(null,new Uint8Array(data.slice(l*w,l*w+w)));\n\t\to+=String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w)));\n\t\treturn o;\n\t}", "function binaryToText(str) {\r\n return str.split(\" \").map(x => String.fromCharCode(parseInt(x, 2))).join(\"\");\r\n}", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n }", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n }", "function tostring(a) {\r\n return String.fromCharCode.apply(0, a);\r\n }", "function decode(data) {\n let built = \"\"\n for (let i = 0; i < data.length; i++) {\n built += String.fromCharCode(data[i])\n }\n return built\n }", "function fixdata(data) {\n var o = \"\", l = 0, w = 10240;\n for(; l<data.byteLength/w; ++l) o+=String.fromCharCode.apply(null,new Uint8Array(data.slice(l*w,l*w+w)));\n o+=String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w)));\n return o;\n}", "function small_toString(buf, len) {\n var tmp = \"\", i;\n\n for (i = 0; i < len; i += 1) {\n tmp += String.fromCharCode(buf[i]);\n }\n\n return tmp;\n}", "function UTF8ArrToStr (aBytes) {\n\n var sView = \"\";\n\n for (var nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 32) is not possible in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\n : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n\n return sView;\n\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function concatBytes(/* ... */) {\n let retVal = \"0x\";\n for (let i = 0; i < arguments.length; i++) {\n retVal = retVal + arguments[i].substr(2);\n }\n return retVal;\n}", "function tostring(a) {\n return String.fromCharCode.apply(0, a);\n }", "function fixBuffer(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}", "function getBytes(s) {\n var buf = [];\n for (var i = 0; i < s.length; i++) {\n buf.push(s.charCodeAt(i));\n }\n return buf;\n }", "function bytesToSring(bytes) {\n const chars = [];\n for (let i = 0, n = bytes.length; i < n;) {\n chars.push(((bytes[i++] & 0xff) << 8) | (bytes[i++] & 0xff));\n }\n return String.fromCharCode.apply(null, chars);\n}", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join(\"\");\n}", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join(\"\");\n}", "function binaryAgent(str) {\n return str.split(' ').map(e=> String.fromCharCode(parseInt(e,2))).join('')\n}", "function binaryAgent(str) {\n return str.split(' ').map(e=> String.fromCharCode(parseInt(e,2))).join('')\n}", "function bytesToHex(bytes) {\n var hex = [];\n for (i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n // console.log(\"0x\" + hex.join(\"\"));\n return \"0x\" + hex.join(\"\");\n}", "function bytesToHex(bytes) {\n var hex = [];\n for (i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n // console.log(\"0x\" + hex.join(\"\"));\n return \"0x\" + hex.join(\"\");\n}", "function encode(arg) {\n return arg.split('').map(x => (x.charCodeAt(0) / 255));\n}", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];\n hex.push((current >>> 4).toString(16));\n hex.push((current & 0xF).toString(16));\n }\n return hex.join(\"\");\n}", "toString() {\n let string = \"\";\n\n for (let idx = 0; idx !== this.byteLength; ++idx) {\n string += String.fromCharCode (this[idx]);\n }\n\n return string;\n}", "function fixData(data) {\n var o = '', l = 0, w = 10240;\n for (; l < data.byteLength / w; ++l) {\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n }\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(o.length)));\n return o;\n }", "function fixData(data) {\n var o = '', l = 0, w = 10240;\n for (; l < data.byteLength / w; ++l) {\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n }\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(o.length)));\n return o;\n }", "function bytesToHex(bytes) {\r\n for (var hex = [], i = 0; i < bytes.length; i++) {\r\n var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];\r\n hex.push((current >>> 4).toString(16));\r\n hex.push((current & 0xf).toString(16));\r\n }\r\n return hex.join(\"\");\r\n}", "function bytesToHexString(bytes)\n{\n if (!bytes)\n return null;\n bytes = new Uint8Array(bytes);\n var hexBytes = [];\n for (var i = 0; i < bytes.length; ++i) {\n var byteString = bytes[i].toString(16);\n if (byteString.length < 2)\n byteString = \"0\" + byteString;\n hexBytes.push(byteString);\n }\n return hexBytes.join(\"\");\n}", "function arrayToStr(buf)\n{\n output = '';\n for (var ind=0; ind<buf.length; ind++)\n {\n if (buf[ind] == 0)\n {\n return output;\n } else {\n output += String.fromCharCode(buf[ind]);\n }\n }\n return output;\n}", "function bytesToHex(c)\n{\n var digits = \"0123456789abcdef\";\n var num = c.length;\n var s = \"\";\n for (var i = 0; i < num; ++i) {\n var hi = Math.floor(c[i] >> 4);\n var lo = c[i] & 0xF;\n s += digits[hi] + digits[lo];\n }\n return s;\n}", "function strdecode(buffer) {\n const bytes = new Uint8Array(buffer);\n const array = [];\n let offset = 0;\n let charCode = 0;\n const end = bytes.length;\n while (offset < end) {\n if (bytes[offset] < 128) {\n charCode = bytes[offset];\n offset += 1;\n }\n else if (bytes[offset] < 224) {\n charCode = ((bytes[offset] & 0x3f) << 6) + (bytes[offset + 1] & 0x3f);\n offset += 2;\n }\n else {\n charCode = ((bytes[offset] & 0x0f) << 12) + ((bytes[offset + 1] & 0x3f) << 6) + (bytes[offset + 2] & 0x3f);\n offset += 3;\n }\n array.push(charCode);\n }\n return String.fromCharCode.apply(null, array);\n}", "function hexlify(bytes) {\n var res = [];\n for (var i = 0; i < bytes.length; i++)\n res.push(hex(bytes[i]));\n\n return res.join('');\n}", "function hexlify(bytes) {\n var res = [];\n for (var i = 0; i < bytes.length; i++)\n res.push(hex(bytes[i]));\n\n return res.join('');\n}", "function UTF8toStr(array) {\n var out, i, len, c;\n var char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while(i < len) {\n c = array[i++];\n switch(c >> 4)\n { \n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n}", "function byte(b){\n if(b.length < 2)\n b = \"0\" + b;\n return b;\n}", "function toUTF8(input) {\n var output = '';\n\n for (var _i = 0; _i < input.length; _i++) {\n var c = input.charCodeAt(_i);\n\n if (c < 128) {\n output += chars[c];\n } else {\n if (c < 2048) {\n output += chars[c >> 6 | 192] + chars[c & 63 | 128];\n } else {\n output += chars[c >> 12 | 224] + chars[c >> 6 & 63 | 128] + chars[c & 63 | 128];\n }\n }\n }\n\n return output;\n} // utf16 string -> utf8 bytes array", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];\n hex.push((current >>> 4).toString(16));\n hex.push((current & 0xF).toString(16));\n }\n return hex.join('');\n}", "function ab2str(buf) {\n const uint8Array = new Uint8Array(buf);\n const temp = uint8Array.reduce((acc, i) => acc += String.fromCharCode.apply(null, [i]), \"\");\n let outputs = [];\n const length = uint8Array.byteLength;\n const CHUNK_SIZE = 50000;\n for (let i=0; i<length; i+= CHUNK_SIZE) {\n outputs.push(String.fromCharCode.apply(null, uint8Array.slice(i, i+CHUNK_SIZE)));\n }\n return outputs.join(\"\");\n}", "function bytesToHexString(bytes) {\n var dec, hexstring, bytesAsHexString = \"\";\n for (var i = 0; i < bytes.length; i++) {\n if (bytes[i] >= 0) {\n dec = bytes[i];\n } else {\n dec = 256 + bytes[i];\n }\n hexstring = dec.toString(16);\n // zero padding\n if (hexstring.length == 1) {\n hexstring = \"0\" + hexstring;\n }\n bytesAsHexString += hexstring;\n }\n return bytesAsHexString;\n}", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join(\"\");\n }", "function byteToString(byteData) {\n var str = \"\";\n for (i = 0; i < 4; i++) {\n var count = 0;\n for (j = 0; j < 16; j++) {\n var pow = 1;\n for (m = 15; m > j; m--) {\n pow *= 2;\n }\n count += byteData[16 * i + j] * pow;\n }\n if (count != 0) {\n str += String.fromCharCode(count);\n }\n }\n return str;\n}", "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "function $z(s) {\n\t\tif (s instanceof Uint8Array) {\n\t\t\t// Postscript treats nul-char as end of string, even if string is\n\t\t\t// longer.\n\t\t\tfor (var i = 0, l = s.length; i < l && s[i]; i++);\n\t\t\tif (i < l) {\n\t\t\t\treturn String.fromCharCode.apply(null, s.subarray(0, i));\n\t\t\t}\n\t\t\treturn String.fromCharCode.apply(null, s)\n\t\t}\n\t\treturn '' + s;\n\t}", "function ab2str(buf) {\r\n\tvar str = \"\", view = new Uint8Array(buf), len = view.length, fromCharCode = String.fromCharCode;\r\n\tfor ( var i = 0; i < len; ++i) {\r\n\t\tstr += fromCharCode(view[i]);\r\n\t}\r\n\treturn str;\r\n}", "function rawChars (hexData) {\n\t\tvar output = \"\", i, k;\n\t\tfor (i=0;i<hexData.length;i++) {\n\t\t\tif (typeof hexData[i]==\"object\"&&typeof hexData[i].push==\"function\") {\n\t\t\t\toutput += rawChars(hexData[i]);\n\t\t\t} else {\n\t\t\t\tif (typeof hexData==\"string\") {\n\t\t\t\t\toutput += String.fromCharCode(parseInt(hexData[i]+hexData[i+1], 16));\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tfor (k=0;k<hexData[i].length;k+=2) {\n\t\t\t\t\t\toutput += String.fromCharCode(parseInt(hexData[i][k]+hexData[i][k+1], 16));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}", "function getFixedString(buffer, offset, length)\n{\n var result = \"\";\n for (var i = 0; i < length; i++)\n {\n var val = buffer[offset + i];\n if (val == 0)\n {\n break;\n }\n result += String.fromCharCode(val);\n }\n return result;\n}", "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return\"�\".repeat(p)}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return\"�\".repeat(p+1)}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return\"�\".repeat(p+2)}}}}", "toHex(bytes) {\n return Buffer.from(bytes).toString('hex').toUpperCase();\n }", "function fistBeard(arr) {\n let newArr = [];\n var merged = [].concat.apply([], arr);\n for ( x of merged ){\n newArr.push(String.fromCharCode(x))\n }\n\n // console.log(merged)\n return newArr.join(\"\")\n}", "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint8Array(buf));\n}", "function bytes2Hex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];\n hex.push((current >>> 4).toString(16));\n hex.push((current & 0xF).toString(16));\n }\n return hex.join(\"\");\n}", "function mqttStr(s) {\n return fromCharCode(s.length>>8, s.length&255)+s;\n}", "function _utf8ArrayToStr(data) {\n const extraByteMap = [1, 1, 1, 1, 2, 2, 3, 0];\n var count = data.length;\n var str = \"\";\n\n for (var index = 0; index < count;) {\n var ch = data[index++];\n if (ch & 0x80) {\n var extra = extraByteMap[(ch >> 3) & 0x07];\n if (!(ch & 0x40) || !extra || ((index + extra) > count))\n return null;\n\n ch = ch & (0x3F >> extra);\n for (; extra > 0; extra -= 1) {\n var chx = data[index++];\n if ((chx & 0xC0) != 0x80)\n return null;\n\n ch = (ch << 6) | (chx & 0x3F);\n }\n }\n\n str += String.fromCharCode(ch);\n }\n\n return str;\n}", "function bytesToHex(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];\n hex.push((current >>> 4).toString(16));\n hex.push((current & 0xF).toString(16));\n }\n return hex.join(\"\");\n }", "function btoa(s) {\n var wordArray = CryptoJS.enc.Utf8.parse(s);\n return CryptoJS.enc.Base64.stringify(wordArray);\n}", "function bytesToHex(bytes) {\r\n let hex = [];\r\n for (let i = 0; i < bytes.length; i++) {\r\n hex.push((bytes[i] >>> 4).toString(16));\r\n hex.push((bytes[i] & 0xf).toString(16));\r\n }\r\n return `0x${hex.join('').replace(/^0+/, '')}`;\r\n}", "getString() {\n let buf = new Uint8Array(this.buf).subarray(this.offset);\n\n\t\tlet byteArr = [];\n for (let byte of buf) {\n if (byte == 0)\n break;\n\n\t\t\tbyteArr.push(byte);\n }\n\t\tlet str = new TextDecoder(\"utf-8\").decode(new Uint8Array(byteArr));\n this.offset += byteArr.length+1;\n\n return str;\n }", "removeByteStuffing(buffer) {\n var ff = buffer.indexOf(0xFF, 0);\n if (ff === -1 || buffer[ff+1] !== 0)\n return buffer; /* Nothing to remove */\n var searchIndex = ff+2; /* Where to start next search for 0xFF */\n\n while (true) {\n var ff2 = buffer.indexOf(0xFF, searchIndex);\n\n if (ff2 == -1 || buffer[ff2+1] !== 0) {\n /* We are finished, just need to copy down any trailing bytes and trim buffer length */\n buffer.copy(buffer, ff+1, searchIndex);\n return buffer.slice(0, ff + buffer.length - searchIndex + 1);\n } else {\n /* Copy down the next range of good data, overwriting unwanted zero byte */\n buffer.copy(buffer, ff+1, searchIndex, ff2+1);\n }\n\n ff = ff + ff2 - searchIndex + 1; /* Position which 0xFF was just copied down to */\n searchIndex = ff2+2; /* Where next range of good bytes starts from */\n }\n }", "function hexlify (arr) {\n return arr.map(function (byte) {\n return ('0' + (byte & 0xFF).toString(16)).slice(-2);\n }).join('');\n}", "function bufferToDebugString(buf) {\n var cp = [];\n var i, n;\n\n/*\n // This fails with \"RangeError: Maximum call stack size exceeded\" for some\n // reason, so use a much slower variant.\n\n for (i = 0, n = buf.length; i < n; i++) {\n cp[i] = buf[i];\n }\n\n return String.fromCharCode.apply(String, cp);\n*/\n\n for (i = 0, n = buf.length; i < n; i++) {\n cp[i] = String.fromCharCode(buf[i]);\n }\n\n return cp.join('');\n}", "function convertBytesToBase64 ( bytes ) {\n\n var base64 = '',\n bytesLength = bytes.length,\n bytesRemainder = ( bytesLength % 3 );\n\n for (\n var i = 0;\n i < bytesLength;\n i += 3\n ) {\n base64 += Base64Encodings[( bytes[i] >> 2 )];\n base64 += Base64Encodings[( ( ( bytes[i] & 3 ) << 4 ) | ( bytes[( i + 1 )] >> 4 ) )];\n base64 += Base64Encodings[( ( ( bytes[( i + 1 )] & 15 ) << 2 ) | ( bytes[( i + 2 )] >> 6 ) )];\n base64 += Base64Encodings[( bytes[( i + 2 )] & 63 )];\n };\n\n if (\n bytesRemainder == 2\n ) {\n base64 = base64.substring(0, ( base64.length - 1 )) + '=';\n } else if (\n bytesRemainder == 1\n ) {\n base64 = base64.substring(0, ( base64.length - 2 )) + '==';\n };\n\n return(base64);\n\n}", "function binaryAgent(str) {\n const newStr = str.split(' ');\n // console.log(newArr)\n const trans = [];\n for (let i = 0; i < newStr.length; i++) {\n trans.push(String.fromCharCode(parseInt(newStr[i], 2)));\n }\n return trans.join('');\n}", "function utf8BlobToStr(array, start, length) {\n\t var out, i, len, c;\n\t var char2, char3;\n\t out = \"\";\n\t len = length;\n\t i = 0;\n\t while (i < len) {\n\t c = array[start + i++];\n\t switch (c >> 4) {\n\t case 0:\n\t case 1:\n\t case 2:\n\t case 3:\n\t case 4:\n\t case 5:\n\t case 6:\n\t case 7:\n\t // 0xxxxxxx\n\t out += String.fromCharCode(c);\n\t break;\n\t case 12:\n\t case 13:\n\t // 110x xxxx 10xx xxxx\n\t char2 = array[start + i++];\n\t out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);\n\t break;\n\t case 14:\n\t // 1110 xxxx 10xx xxxx 10xx xxxx\n\t char2 = array[start + i++];\n\t char3 = array[start + i++];\n\t out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);\n\t break;}\n\n\t }\n\t return out;\n\t }", "function decode(arr) {\n var chars = [];\n for (var i = 0; i < arr.length; i++) {\n var b = arr[i];\n if (b & 0x80) {\n var min = void 0;\n if (b < 0xe0) {\n // Need 1 more byte.\n if (i >= arr.length) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n if ((n1 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x1f) << 6 | (n1 & 0x3f);\n min = 0x80;\n }\n else if (b < 0xf0) {\n // Need 2 more bytes.\n if (i >= arr.length - 1) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);\n min = 0x800;\n }\n else if (b < 0xf8) {\n // Need 3 more bytes.\n if (i >= arr.length - 2) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n var n3 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);\n min = 0x10000;\n }\n else {\n throw new Error(INVALID_UTF8);\n }\n if (b < min || (b >= 0xd800 && b <= 0xdfff)) {\n throw new Error(INVALID_UTF8);\n }\n if (b >= 0x10000) {\n // Surrogate pair.\n if (b > 0x10ffff) {\n throw new Error(INVALID_UTF8);\n }\n b -= 0x10000;\n chars.push(String.fromCharCode(0xd800 | (b >> 10)));\n b = 0xdc00 | (b & 0x3ff);\n }\n }\n chars.push(String.fromCharCode(b));\n }\n return chars.join(\"\");\n}" ]
[ "0.6726667", "0.66859424", "0.66396517", "0.6450776", "0.6441175", "0.64235175", "0.6371401", "0.63028675", "0.63011664", "0.62464905", "0.62334573", "0.62299293", "0.62299293", "0.6228888", "0.6228888", "0.6228888", "0.6208565", "0.6207479", "0.61998975", "0.61775684", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.6177172", "0.61630857", "0.61616236", "0.61569726", "0.61569726", "0.61569726", "0.6144242", "0.61384434", "0.61380416", "0.61255634", "0.6116043", "0.6116043", "0.6116043", "0.6095377", "0.6089239", "0.60796005", "0.60630006", "0.5998287", "0.59915346", "0.59915346", "0.5974498", "0.5974498", "0.5958366", "0.5958366", "0.5942692", "0.5940303", "0.5931068", "0.5930521", "0.5930521", "0.5925854", "0.5925091", "0.5923843", "0.5923602", "0.59186006", "0.58901036", "0.58901036", "0.5889441", "0.58857507", "0.5863637", "0.5858228", "0.5849119", "0.58418906", "0.58413845", "0.58340794", "0.58300734", "0.58300734", "0.5824343", "0.5810119", "0.5808736", "0.5805891", "0.5800954", "0.5791162", "0.5790815", "0.5788572", "0.5788572", "0.57817197", "0.57807916", "0.5777538", "0.5771117", "0.57594454", "0.57543063", "0.5750704", "0.57404387", "0.5739354", "0.5733899", "0.5729645", "0.572853", "0.5728357", "0.5722549" ]
0.5895658
65
Taken from 6th grade algebra
function distance(x1, y1, x2, y2) { return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function es( g , nu )\n {\n\n return ( k( g , nu ) + ((4.0 / 3.0) * g) );\n\n }", "function R(e, t, n, r, o, i, a, s) {\n for (var u, l, c, p, d, f, h, m, g = [], v = [ [], [] ], y = 0; y < 2; ++y) if (0 == y ? (l = 6 * e - 12 * n + 6 * o, \n u = -3 * e + 9 * n - 9 * o + 3 * a, c = 3 * n - 3 * e) : (l = 6 * t - 12 * r + 6 * i, \n u = -3 * t + 9 * r - 9 * i + 3 * s, c = 3 * r - 3 * t), $(u) < 1e-12) {\n if ($(l) < 1e-12) continue;\n 0 < (p = -c / l) && p < 1 && g.push(p);\n } else h = l * l - 4 * c * u, m = q.sqrt(h), h < 0 || (d = (-l + m) / (2 * u), 0 < d && d < 1 && g.push(d), \n 0 < (f = (-l - m) / (2 * u)) && f < 1 && g.push(f));\n for (var b, x = g.length, C = x; x--; ) p = g[x], b = 1 - p, v[0][x] = b * b * b * e + 3 * b * b * p * n + 3 * b * p * p * o + p * p * p * a, \n v[1][x] = b * b * b * t + 3 * b * b * p * r + 3 * b * p * p * i + p * p * p * s;\n return v[0][C] = e, v[1][C] = t, v[0][C + 1] = a, v[1][C + 1] = s, v[0].length = v[1].length = C + 2, \n {\n min: {\n x: W.apply(0, v[0]),\n y: W.apply(0, v[1])\n },\n max: {\n x: V.apply(0, v[0]),\n y: V.apply(0, v[1])\n }\n };\n }", "function calculation () {\n omega1 = Math.sqrt(G/L); // 1. Eigen-Kreisfrequenz (parallele Schwingung)\n omega2 = Math.sqrt(G/L+2*D/M); // 2. Eigen-Kreisfrequenz (antiparallele Schwingung)\n a1 = (alpha01+alpha02)/2; // Hilfsgröße \n a2 = (alpha01-alpha02)/2; // Hilfsgröße\n }", "function alg(){\nalert(\"Algebra is a branch of mathematics in which letters of the alphabet represent numbers. Algebraic expressions are a mixture of letters and numbers eg 3x+4y is an algebraic expression. More examples are 5z, 7g-4t, 2r(d-3) etc.\");\nalert(\"An algebraic expression is made up of terms eg 3x+5y is made up of the terms 3x and 5y. The terms are joined by either the plus(+) or minus(-) signs. In a term like 3x this is the same as 3×x or 3(x).In other words the number and letter are multiplying each other.In whatever operation you do the term always goes with its sign.In other words in the term 3x+5y the + sign goes with the term 5y.\");\nalert(\"Terms can either be like or unlike terms. Terms of the same letter are called like terms eg 2a and -7a are like terms. Terms of different letters are called unlike terms eg 8y and 7p are unlike terms.Always remember that LIKE TERMS COMBINE AND UNLIKE TERMS DO NOT COMBINE.In other words you can add or subtract like terms but you cannot do so with unlike terms.\");\nalert(\"Expressions in which the highest power is 1 are called linear expressions eg 3x+y, 5y+3x+y-7x+3 are linear terms.Expressions in which the highest power is two are called quadratic expressions eg 4x²-3, a²(a+1)-a²(a-1) are quadratic expressions.\");\nalert(\"Lets do some examples on like and unlike terms.\");\nalert(\"Simplify 5y+3x+y-7x+3.First rearrange the expression to group like terms like this: 5y+y+3x-7x+3.Now combine like terms like this:6y-4x+3.There are no more like terms hence we stop here.\");\nalert(\"7-(x-2y)+3(5x-2).First multiply each term in the bracket by the term outside the bracket(- is the same as -1) ie multiply bracket (x-2y) by -1 and (5x-2) by 3 hence 7-x+2y+15x-6.Now group like terms like this 7-6-x+15x+2y and combining like terms 1+14x+2y(REMEMBER A TERM GOES WITH ITS SIGN)\");\nalert(\"Simplify 5x-(3-x+3y)-7(5-y). First 5x-3+x-3y-35+7y. Now 5x+x-3y+7y-3-35 and this gives 6x+4y-38.\");\nalert(\"Sometimes you need to multiply a bracket by a bracket eg (x+1)(x-1). To do so break up the first bracket into two ie into x and +1.Now multiply the second bracket by each term from the first bracket ie x(x-1)+1(x-1)=x²-x+x-1=x²-1.\");\nalert(\"Lets do more examples on multiplying a bracket by a bracket.\");\nalert(\"(x+3)(x-5)=x(x-5)+3(x-5)=x²-5x+3x-15=x²-2x-15.\");\nalert(\"(3x-2)(3x+2)=3x(3x+2)-2(3x+2)=9x²+6x-6x-4=9x²-4.\");\nalert(\"(2y+3)²=(2y+3)(2y+3)=2y(2y+3)+3(2y+3)=4y²+6y+6y+9=4y²+12y+9.\");\n}", "function Fa(z) { return foograph.A*z*z/k; }", "pow22523(z) {\r\n const t0 = new FieldElement();\r\n const t1 = new FieldElement();\r\n const t2 = new FieldElement();\r\n let i;\r\n t0.square(z);\r\n // for (i = 1; i < 1; i++) {\r\n // t0.square(t0);\r\n // }\r\n t1.square(t0);\r\n for (i = 1; i < 2; i++) {\r\n t1.square(t1);\r\n }\r\n t1.mul(z, t1);\r\n t0.mul(t0, t1);\r\n t0.square(t0);\r\n // for (i = 1; i < 1; i++) {\r\n // t0.square(t0);\r\n // }\r\n t0.mul(t1, t0);\r\n t1.square(t0);\r\n for (i = 1; i < 5; i++) {\r\n t1.square(t1);\r\n }\r\n t0.mul(t1, t0);\r\n t1.square(t0);\r\n for (i = 1; i < 10; i++) {\r\n t1.square(t1);\r\n }\r\n t1.mul(t1, t0);\r\n t2.square(t1);\r\n for (i = 1; i < 20; i++) {\r\n t2.square(t2);\r\n }\r\n t1.mul(t2, t1);\r\n t1.square(t1);\r\n for (i = 1; i < 10; i++) {\r\n t1.square(t1);\r\n }\r\n t0.mul(t1, t0);\r\n t1.square(t0);\r\n for (i = 1; i < 50; i++) {\r\n t1.square(t1);\r\n }\r\n t1.mul(t1, t0);\r\n t2.square(t1);\r\n for (i = 1; i < 100; i++) {\r\n t2.square(t2);\r\n }\r\n t1.mul(t2, t1);\r\n t1.square(t1);\r\n for (i = 1; i < 50; i++) {\r\n t1.square(t1);\r\n }\r\n t0.mul(t1, t0);\r\n t0.square(t0);\r\n for (i = 1; i < 2; i++) {\r\n t0.square(t0);\r\n }\r\n this.mul(t0, z);\r\n }", "function gradenumeric() {\n //var fasit = qobj.fasit;\n // for numeric the fasit is a template like this\n // 33.13:0.5 the answer is 33.13 +- 0.5\n // 32.0..33.5 the answer must be in the interval [32.0,33.5]\n // TODO a..b is the same as rng:a,b -- should we drop one of them?\n // nor:m,s the answer x is scored as e^-((1/(2) * ((x-m)/s)^2\n // sym:exp the answer x is scored as pycas(x - exp) == 0\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // zro:exp|a the answer x is correct if |exp(x)| < a\n // reg:r the answer x is scored as regular exp match for x,r\n // lis:a:A,b:B,c the answer x is scored as x == one of a,b,c - score is given by :A or 1\n var cor = ff;\n switch (swi) {\n case 'nor:':\n var norm = tch.split(',');\n var med = +norm[0];\n var std = +norm[1];\n var ex = ((uanum - med)/std);\n var sco = Math.pow(2.712818284,-(0.5*ex*ex));\n if (sco > 0.05) {\n ucorr += sco;\n feedb = Math.floor((1-sco)*10);\n } else {\n uerr++;\n }\n cor = med;\n break;\n case 'rng:': // [[rng:10,20]]\n var lims = tch.split(',');\n var lo = +lims[0];\n var hi = +lims[1];\n if (uanum >= lo && uanum <= hi) {\n ucorr += 1;\n feedb = 1;\n } else {\n uerr++;\n }\n cor = lo;\n break;\n case 'sym:':\n simple = false; // callback done after sympy is finished\n // fixup for 3x => 3*x etc\n var completed = { comp:0, lock:0 };\n if (uatxt == undefined || uatxt == '') {\n callback(score,'no input',completed,ua,1);\n } else {\n var elem = tch.split('|');\n var target = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n // for symbolic equality - dont accept original equation\n // or new eq that is longer (not simpler)\n if (differ && (differ == uatxt || differ.length < uatxt.length) ) {\n callback(score,'sicut prius',completed,ua,1);\n } else {\n var ufu = sympify(target); // fasit\n cor = ufu;\n var fafu = sympify(uatxt); // user response\n var diffu = sympify(differ); // if testing equality - must be as short or shorter than this\n var intro = '# coding=utf-8\\n'\n + 'from sympy import *\\n';\n var text = 'x,y,z,a,b,c,d,e,f,u,v,w = symbols(\"x,y,z,a,b,c,d,e,f,u,v,w\")\\n'\n + 'a1=sympify(\"'+ufu+'\")\\n'\n + 'b1=sympify(\"'+fafu+'\")\\n'\n + 'c1=a1-b1\\n'\n + 'print simplify(c1)\\n';\n var score = 0;\n console.log(intro+text);\n fs.writeFile(\"/tmp/symp\"+now, intro+text, function (err) {\n if (err) { callback(score,'error1',completed,ua,1); throw err; }\n try {\n var child = exec(\"/usr/bin/python /tmp/symp\"+now, function(error,stdout,stderr) {\n fs.unlink('/tmp/symp'+now);\n //console.log(\"err=\",stderr,\"out=\",stdout,\"SOO\");\n if (error) {\n console.log(error,stderr);\n callback(score,'error2',completed,ua,1);\n } else {\n if (stdout && stdout != '') {\n //console.log(stdout);\n var feedb = stdout;\n var eta = +stdout.trim();\n if (_.isFinite(eta) && eta == 0 || Math.abs(eta) < 0.001 ) {\n score = 1\n if (differ) {\n // we are testing for simplification\n // minimum assumed to be ufu, diffu.length is original length (unsimplified)\n var span = diffu.length - ufu.length; // max shortening possible\n var dif = fafu.length - ufu.length; // how much shorter\n if (span > 0) {\n score = Math.max(0,Math.min(1,1-dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n feedb = (score > 0.8) ? 'Good answer' : (score > 0.5) ? 'Nearly' : 'Not quite';\n }\n } else {\n feedb = 'Correct answer';\n }\n } else {\n feedb = 'Incorrect answer';\n score = 0;\n }\n var cutcost = (attnum > 2) ? Math.min(1,cost*attnum*2) : cost*attnum;\n var adjust = score * (1 - cutcost - hintcost*hintcount);\n //console.log(qgrade,adjust,attnum,cost);\n score = aquest.points * Math.max(0,adjust);\n }\n //console.log(\"CAME SO FAR SYMBOLIC PYTHON \",eta,score,stdout,stderr,error);\n callback(score,feedb,completed,ua,1);\n }\n });\n } catch(err) {\n callback(score,'error3',completed,ua,1);\n }\n });\n }\n }\n break;\n case 'zro:':\n // zro:exp|a the answer x is correct if |exp(x)| < a\n var elem = tch.split('|');\n var exp = elem[0];\n var tol = elem[1] || 0.001 ;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n var num = +uatxt;\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied root checked\n console.log(\"Checking if root:\",uatxt,exp);\n var bad = false;\n try {\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var f1 = Math.abs(fu1(num));\n console.log(\"Evalueated to \",f1,tol)\n if (f1 <= tol) {\n sco = 1;\n feedb = '1'; // mark as correct\n } else {\n bad = true;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n ucorr += sco;\n }\n }\n cor = 'NaN';\n break;\n case 'eva:':\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // the user answer must NOT EQUAL a,\n // Quiz: multiply (x+6) by 2, do not accept 2*(x+2)\n // eva:2x+12|2(x+6)\n // the answer should be as short as b (punished for extra chars - up to a.length)\n // simplify (2+4)*(7-5)\n // eva:12|(2+4)*(7-5)|12\n // so the constraints are : evaluate as 12, not eq \"(2+4)*(7-5)\" , as short as 12\n // partial score if between \"12\" and \"(2+4)*(7-5)\" in length\n var elem = tch.split('|');\n var exp = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n var simply = elem[2]; // optional text that useranswer should match in length\n var lolim = -5;\n var hilim = 5;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n cor = exp;\n var ufu = normalizeFunction(uatxt,0);\n var udiff =normalizeFunction(differ,0);\n //console.log(exp,lolim,hilim,ufu);\n if (differ && (differ === uatxt || udiff === ufu) ) {\n uerr++;\n console.log(\"sicut prius\");\n } else if (exp === ufu) {\n ucorr++; // they are exactly equal\n feedb = '1'; // mark as correct\n //console.log(\"exact\");\n } else {\n //console.log(\"EVA:\",exp,ufu);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied function numericly tested against fasit\n // for x values lolim .. hilim , 20 steps\n var dx = (+hilim - +lolim) / 20;\n var bad = false;\n try {\n //return 'with(Math) { return ' + fu + '; }';\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var fu2 = new Function(\"x\",' with(Math) { return ' +ufu+'; }' );\n var reltol,f1,f2;\n for (var pi=0,xi = lolim; pi < 20; xi += dx, pi++) {\n //console.log(\"testing with \",xi);\n f1 = fu1(xi);\n f2 = fu2(xi);\n if (!isFinite(f1) && !isFinite(f2)) {\n reltol = 0;\n //console.log(\"NaN/inf\",xi,reltol);\n } else {\n reltol = f1 ? Math.abs(f1-f2)/Math.abs(f1) : Math.abs(f1-f2);\n }\n //console.log(xi,f1,f2,reltol);\n if (reltol > 0.005) {\n bad = true;\n break;\n }\n sco += reltol;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n if (simply) {\n // we are testing for simplification\n // minimum assumed to be simply.length, differ.length is original length (unsimplified)\n var span = differ.length - simply.length; // max shortening possible\n var dif = Math.min(span,Math.max(0,differ.length - ufu.length)); // how much shorter\n if (span > 0) {\n sco = 1 - Math.max(0,Math.min(1,dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n }\n }\n ucorr += 1 - sco;\n feedb = '1'; // mark as correct\n }\n }\n }\n break;\n case 'reg:':\n try {\n tch = tch.trim();\n var myreg = new RegExp('('+tch+')',\"gi\");\n var isgood = false;\n uatxt.replace(myreg,function (m,ch) {\n //console.log(\"REG:\",uatxt,tch,m,ch);\n isgood = (m == uatxt);\n });\n if ( isgood) {\n ucorr++; // good match for regular expression\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n catch (err) {\n console.log(\"BAD REG EXP\",tch);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n cor = 'NaN';\n break;\n case 'lis:':\n var goodies = tch.split(',');\n if (goodies.indexOf(uatxt) > -1) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n cor = goodies[0];\n break;\n default:\n var num,tol,cor;\n cor = ff;\n //console.log(\"trying numeric\",ff,uatxt );\n if (ff == num) feedb = 1;\n if ( ff.indexOf(':') > 0) {\n // we have a fasit like [[23.3:0.5]]\n var elm = ff.split(':');\n num = +elm[0];\n tol = +elm[1];\n cor = num;\n //console.log(\"NUM:TOL\",ff,num,tol,uanum);\n } else if ( ff.indexOf('..') > 0) {\n // we have a fasit like [[23.0..23.5]]\n var elm = ff.split('..');\n var lo = +elm[0];\n var hi = +elm[1];\n tol = (hi - lo) / 2;\n num = lo + tol;\n cor = num;\n //console.log(\"LO..HI\",ff,lo,hi,num,tol,uanum);\n } else {\n num = +ff; tol = 0.0001;\n }\n if ( ff == 'any' || ff == 'anytext' || Math.abs(num - uanum) <= tol) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n break;\n }\n return cor;\n }", "determinant() {\n return (\n this.a00*this.adj(0, 0)\n +this.a01*this.adj(0, 1)\n +this.a02*this.adj(0, 2)\n +this.a03*this.adj(0, 3)\n );\n }", "function n(A,e){0}", "function Y(e,t){var n,i;for(z=e.length;--z>=0;){n=z,(i=z-1)<0&&(i=e.length-1);//console.log('b', i,j, i-1, k,vertices.length);\nvar r=0,o=m+2*b;for(r=0;r<o;r++){var a=U*r,s=U*(r+1);J(t+n+a,t+i+a,t+i+s,t+n+s)}}}", "function n(e,r,t){const{x:o,y:s}=r;if(t<2){return {x:e[0]+o*e[2]+s*e[4],y:e[1]+o*e[3]+s*e[5]}}if(2===t){const r=o*o,t=s*s,i=o*s;return {x:e[0]+o*e[2]+s*e[4]+r*e[6]+i*e[8]+t*e[10],y:e[1]+o*e[3]+s*e[5]+r*e[7]+i*e[9]+t*e[11]}}const i=o*o,n=s*s,p=o*s,a=i*o,f=i*s,c=o*n,l=s*n;return {x:e[0]+o*e[2]+s*e[4]+i*e[6]+p*e[8]+n*e[10]+a*e[12]+f*e[14]+c*e[16]+l*e[18],y:e[1]+o*e[3]+s*e[5]+i*e[7]+p*e[9]+n*e[11]+a*e[13]+f*e[15]+c*e[17]+l*e[19]}}", "function e( g , nu )\n {\n\n return ( 2.0 * g * (1.0 + nu) );\n\n }", "function sig(nbr){return 1/(1+Math.pow(Math.E,-nbr));}", "function indi(){\nalert(\"If a number is written in the form 2⁴, the number 2 is called the base and 4 is the index or power of the number.2⁴ means 2×2×2×2. The same applies for all numbers and algebraic letters.\");\nalert(\"Lets look at the laws of indices.\");\nalert(\"LAW 1: a^x × a^y=a^(x+y).This is interpreted as follows:When multiplying numbers in index form to the same base add the powers eg 3²×3²=3⁴(notice the powers have been added). Another example is x² × x¹=x³.\");\nalert(\"LAW 2: a^x÷a^y=a^(x-y).This is interpreted as follows:When dividing numbers in index form to the same base subtract the powers eg 4¹÷4³=4-².Another example y³÷y²=y(notice how the powers have been subtracted.\");\nalert(\"LAW 3:(a^x)^y=a^xy.This is interpreted as follows:When raising a number in index form to another power multiply the powers and maintain the base eg (5²)²=5⁴(notice the powers have been multiplied and the base remains unchanged)\");\nalert(\"Any number or letter raised to the power 1 equals the number itself eg 5¹=5 and d¹=d.\");\nalert(\"Any number or letter raised to the power zero equals 1 eg 6°=1 and x°=1.\");\nalert(\"Any number or letter raised to a negative power equals to the inverse or reciprocal of the positive power of the number eg 3-²=1/3² and g-⁴=1/g⁴\");\nalert(\"×√a=a^(1/x) interpreted as follows: The root of a number equals that number raised to the inverse of the root eg √a=a^½, ³√a=a^⅓, ⁴√8=8^¼ etc.\");\nalert(\"Lets work on some examples.\");\nalert(\"Lets simplify a^5÷a^6=a-¹=1/a (use law 2).\");\nalert(\"Lets evaluate x² × x-²=x°=1(use law 1)\");\nalert(\"Evaluate (⅔)-²=1/(⅔)²=1/(2²/3²)=1×(3²/2²)=3²/2²=9/4(use law 3)\");\nalert(\"Simplify 3y²×4y-⁴=3×4×y²×y-⁴=12×y-²=12/y².\");\nalert(\"Simplify √x × x-¹=x^½ × x-¹=x^-½=1/x^½=1/√x.\");\nalert(\"Simplify 5^¾×5^¼=5^(¾+¼)=5¹=5.\");\nalert(\"Simplify (7^²)^-¼=7^(2×-¼)=7^-½=1/7^½=1/√7.\");\nalert(\"Lets look at equations with indices.Remember the ultimate goal of solving equations is to end up with the numerical value of the unknown letter.\");\nalert(\"Lets solve x^½=3.We should strive to make the power of x be 1.To do so we square both sides ie (x^½)²=3² and this becomes x¹=9 hence x=9.\");\nalert(\"Lets solve 3x-³=24.Dividing through by 3 this becomes x-³=8.Again we want to make the power of x be 1.To do so we raise both sides to the power of -⅓ ie (x-³)^-⅓=8^-¼.Remember 8=2³ hence the equation can be written as (x-³)^-⅓=(2³)^-⅓ and this becomes x=2-¹ hence x=½.\");\nalert(\"Lets solve 4^x=32.Express each side in index form using the same base ie (2²)^x=2^5.Now equate the powers ie 2x=5 hence x=5/2, x=2½.\");\n}", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "Cr(){\n return 0.721 + 0.00725*(this.Lj*12/this.Dj)\n }", "function r(r,o,a,s){e=r,t=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}", "function ha(a){var b,c=ia(a),d=c[0];if(ja(c),d){for(b=0;b<d.length;b++)ka(d[b]);for(b=0;b<d.length;b++)la(d[b],0,0)}return ma(c)}", "function e$j(){return [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "function e$1(){return [1,0,0,0,1,0,0,0,1]}", "function eersteGraad(a,x,q) {\n y = a*x+q\n return y\n}", "function M(t,n,r){return c$7(O,n,t),c$7(V,r,t),s$5(_$1(O,O,V))/2}", "function n6(a,b){this.C=[];this.L=a;this.K=b||null;this.B=this.j=!1;this.A=void 0;this.H=this.P=this.F=!1;this.D=0;this.o=null;this.G=0}", "static approxEqRots(ra, rb) {\nvar aeq, i;\n//------–-----\naeq = (function() {\nvar j, results;\nresults = [];\nfor (i = j = 0; j < 4; i = ++j) {\nresults.push(this.approxEq(ra[i], rb[i]));\n}\nreturn results;\n}).call(this);\nreturn aeq[0] && aeq[1] && aeq[2] && aeq[3];\n}", "function hitungLuasLingkaran(jariJari){\n return 3.14 * jariJari ^ 2 \n}", "function alg1(){\nalert(\"Sometimes we have to find the HCF and LCM of algebraic expressions.This depends on our ability to identify factors correctly\");\nalert(\"For example lets find the HCF and LCM of a²b,a³b² and a²b³.Now a and b are the common factors in the three terms.Use a and b with the lowest powers for HCF and those with the highest powers for LCM.In this case HCF=a²b(pick out the lowest power of each common factor.LCM=a³b³(pick out the highest power of each factor.)\");\nalert(\"Lets do more examples on HCF and LCM of algebraic expressions\");\nalert(\"Find the HCF and LCM of 3x+3,2x+2,x²-1.First factorise the terms ie 3x+3=3(x+1),2x+2=2(x+1) and x²-1=(x-1)(x+1). Looking at the three terms (x+1) is common hence HCF=(x+1).Now for the LCM take each factor where its most abundant hence LCM=2×3(x-1)(x+1)**Note-no need to expand brackets.\");\nalert(\"Find the HCF and LCM of x²-9,x²+6x+9 and 2x²+7x+3.First factorise the above quadratic expressions ie x²-9=(x+3)(x-3),x²+6x+9=(x+3)(x+3) and 2x²+7x+3=(2x+1)(x+3).Looking at the above terms (x+3) is common hence HCF=(x+3).For LCM take each factor where its most common hence LCM=(x+3)²(x-3)(2x+1).\");\n}", "get std_eqn() {\n if (this.type == 0) {\n // parabola\n if (this.o == 0)\n return \"$$(y\"+ (this.k > 0 ? \"-\" : \"+\")+ Math.abs(this.k) +\")^2 = \" + this.lr + \"(x\" + (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")$$\"\n else\n return \"$$(x\"+ (this.h > 0 ? \"-\" : \"+\")+ Math.abs(this.h) +\")^2 = \" + this.lr + \"(y\" + (this.k > 0 ? \"-\" : \"+\") + Math.abs(this.k) +\")$$\"\n } else if (this.type == 1) {\n return \"$$\\\\dfrac{(x\"+ (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")^2}{\"+this.a+\"^2} + \\\\dfrac{(y\"+(this.k > 0 ? \"-\" : \"+\")+Math.abs(this.k)+\")^2}{\"+this.b+\"^2} = 1$$\"\n } else {\n if (this.o == 0)\n return\"$$\\\\dfrac{(x\"+ (this.h > 0 ? \"-\" : \"+\") + Math.abs(this.h) + \")^2}{\"+this.a+\"^2} - \\\\dfrac{(y\"+(this.k > 0 ? \"-\" : \"+\")+Math.abs(this.k)+\")^2}{\"+this.b+\"^2} = 1$$\"\n else\n return \"$$\\\\dfrac{(y\"+ (this.k > 0 ? \"-\" : \"+\") + Math.abs(this.k) + \")^2}{\"+this.a+\"^2} - \\\\dfrac{(x\"+(this.h > 0 ? \"-\" : \"+\")+Math.abs(this.h)+\")^2}{\"+this.b+\"^2} = 1$$\"\n }\n }", "function f1p(x){\n\treturn 3*Math.pow(x,2) - 4 * x + 1;\n}//End function f1p(x)", "static get ORTHOGRAPHIC() { return 1; }", "function m_ln(x){ // x>0\r\n var xx=x;\r\n var xxabs = Number(m_abs(xx)); //轉數字\r\n\r\n\r\n if ( xx == 0){ var ans_t = message_1(13); return ans_t; }\r\n if ( xx < 0) { var ans_t =message_1(5); return ans_t; }\r\n\r\n\r\n \r\n\r\n var ee = 2.718281828459045235360287471353; //常數\r\n var count_m = m_cut_nub_m(xxabs); // count 整數位數 >0 位數 , 含 -符號\r\n \r\n\r\n var count_p = m_cut_nub_p(xxabs); // count 小數位數 <0 位數 , 不含 -符號 不含 point\r\n \r\n\r\n var count_t = count_m+count_p+1;\r\n var ans_0 = 0;\r\n\r\n \r\n\r\n var ee_10 =m_pow_m(ee,10); //ee 10次方 = 22026.465794806707\r\n var ee_7 =m_pow_m(ee,7); // ee 7次方 = 1096.633158428458\r\n var ee_5 =m_pow_m(ee,5); // ee 5次方 = 148.4131591025766\r\n var ee_3 =m_pow_m(ee,3); //ee 3次方 = 20.08553692318766 //ee =2.718281828459045\r\n\r\n \r\n\r\n while(xxabs >= ee_10){\r\n //快數取出10 的指數部分 \r\n xxabs = xxabs/ee_10;\r\n ans_0=ans_0+10;\r\n \r\n }\r\n\r\n\r\n while(xxabs >= ee_7){\r\n //快數取出10 的指數部分 \r\n xxabs = xxabs/ee_7;\r\n ans_0=ans_0+7;\r\n \r\n \r\n }\r\n\r\n while(xxabs >= ee_5){\r\n //快數取出5 的指數部分 \r\n xxabs = xxabs/ee_5;\r\n ans_0=ans_0+5;\r\n \r\n }\r\n\r\n while(xxabs >= ee_3){\r\n //快數取出5 的指數部分 \r\n xxabs = xxabs/ee_3;\r\n ans_0=ans_0+3;\r\n \r\n }\r\n\r\n\r\n\r\n while(xxabs >= ee){ //ee=2.718281828459045\r\n //取出1 的指數部分 +5 增加回圈數\r\n xxabs = xxabs/ee;\r\n ans_0=ans_0+1;\r\n \r\n }\r\n\r\n\r\n while(xxabs > 1.5 && xxabs < ee){ \r\n \r\n //取出1 的指數部分\r\n xxabs = (xxabs)/(ee); \r\n ans_0=ans_0 + 1;\r\n \r\n }\r\n\r\n \r\n \r\n\r\n\r\n\r\n while(xxabs < 0.00005 ){ \r\n //取出1 的指數部分\r\n xxabs = (xxabs)*(ee_10); \r\n ans_0=ans_0 - 10;\r\n \r\n }\r\n\r\n\r\n\r\n\r\n\r\n while(xxabs < 0.5 ){ \r\n //取出1 的指數部分\r\n xxabs = (xxabs)*(ee); \r\n ans_0=ans_0 - 1;\r\n\r\n }\r\n\r\n\r\n\r\n\r\n var ans_1 = m_series_ln_a_z(xxabs) ; //由公式作法 0.5 < xxabs <1.5 \r\n \r\n \r\n var ans_t =ans_0 + ans_1;\r\n\r\n if(xx<0){ //負值\r\n ans_t=1.0/ans_t; \r\n }\r\n \r\n\r\n \r\n return ans_t;\r\n}", "function algebraUnit(num) {\n return [{ part: [], mult: num }];\n}", "function l(e,n,o,r){function i(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,n){return((i(t,n)*e+a(t,n))*e+s(t))*e}function u(e,t,n){return 3*i(t,n)*e*e+2*a(t,n)*e+s(t)}function c(t,n){for(var r=0;r<h;++r){var i=u(n,e,o);if(0===i)return n;n-=(l(n,e,o)-t)/i}return n}function f(){for(var t=0;t<w;++t)C[t]=l(t*b,e,o)}function d(t,n,r){var i,a,s=0;do{a=n+(r-n)/2,i=l(a,e,o)-t,i>0?r=a:n=a}while(Math.abs(i)>g&&++s<v);return a}function p(t){for(var n=0,r=1,i=w-1;r!=i&&C[r]<=t;++r)n+=b;--r;var a=(t-C[r])/(C[r+1]-C[r]),s=n+a*b,l=u(s,e,o);return l>=y?c(t,s):0==l?s:d(t,n,n+b)}function m(){S=!0,e==n&&o==r||f()}var h=4,y=.001,g=1e-7,v=10,w=11,b=1/(w-1),_=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var x=0;x<4;++x)if(\"number\"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),o=Math.min(o,1),e=Math.max(e,0),o=Math.max(o,0);var C=_?new Float32Array(w):new Array(w),S=!1,T=function(t){return S||m(),e===n&&o===r?t:0===t?0:1===t?1:l(p(t),n,r)};T.getControlPoints=function(){return[{x:e,y:n},{x:o,y:r}]};var k=\"generateBezier(\"+[e,n,o,r]+\")\";return T.toString=function(){return k},T}", "function gv(a,b){this.oq=[];this.W3=a;this.TY=b||null;this.Uz=this.lh=!1;this.Ng=void 0;this.TU=this.J$=this.kL=!1;this.ZJ=0;this.Fb=null;this.bE=0}", "function AMultipleCombinatorial(pEn,pKays) {\nthis.en = pEn\nif (typeof pKays === 'number')\n{pKays=[pKays];}\nvar sumOfVals = pKays.reduce(function(total,val){return total+=val});\nif (sumOfVals<pEn)\n{\n pKays.push(pEn-sumOfVals)\n}\n//biggest k\nthis.maxKay = pKays.reduce(function(total,val){return (total>val)?total:val});\nif (this.maxKay==1)\n{\nthis.prod=(Array.apply(null,new Array(pEn)).map(Function.call, Number).map(function(it){return it+1})).reduce(function(prd,val){return prd*=val;},1)\n}\nelse{\nthis.functionToMakeList= function(disKay,aKay){return Array.apply(null,new Array(disKay)).map(Function.call, Number).map(function(it){return it+aKay+1})}\nthis.functionToReverseLists = function(disArray){return disArray.map(function(val,ind){return disArray[disArray.length-ind-1]})}\n//Take it out of set\npKays.splice(pKays.indexOf(this.maxKay),1);\n//make a list of the number size that is just for the reminant of the top with the bottom crossed out.\n//array apply null ducks giving apply context, which is the point of the arguments in call, apply, and bind\n//so it just runs the new array constructor for the number, which makes an array which has indexes for three undefined slots\n//map (function.call), uses function call as a callback, which calls the call back in the context of the Number function\n//now map takes val, ind, array which are what number.call gets, so this is a fancy way to pass (val, ind, array) as the parameters\n// of any function. Remember first argument of number.call is context, which is val in this case, which is undefined, which gets thrown out\n//the next is taken as the one parameter of the Number method, which is the index.\n//you are using call call game to create a circumstance to through out maps first value\n//so we make a list just as long as maxKay which takes the numbers from max to kay and boosts them all up so the last one is em\nvar newList = this.functionToMakeList(pEn-this.maxKay,this.maxKay);\n//reverse the list\nthis.revList=this.functionToReverseLists(newList);\n//make the other denominator number, that was not cancelled\nthis.botLists=pKays.map(function(val){return this.functionToMakeList(val,0);},this);\n//reverse these list\nthis.revBots=this.botLists.map(function(dArray){return this.functionToReverseLists(dArray)},this);\n// Logger.log(\"maxKey: \"+this.maxKay+\" PK: \"+pKays+\" newList: \"+newList+\" rb: \"+this.revBots+\" TL: \"+this.tallyListOfLists+\" RL: \"+this.revList)\n//go through the toplist\n//go through the bot list\n//alter top and bottom\n//kill record when one is done \n \n this.tallyListOfLists = infiniteArrayClone(this.revBots)\n var revBotLengths= this.revBots.map(function(val){return val.length});\n revBotLengths.sort(function(a, b){return a - b});\n// var poses = []\n// for (var cA=revBotLengths.length-1;cA>-1;cA--)\n// {\n// var cB= this.revBots.length-1;\n// while (this.revBots[cB].length!=revBotLengths[cA])\n// {\n// cB--;\n// }\n// poses.push(this.revBots.length-cB-1);\n// }\n// this.tallyListOfLists = [];\n// poses.forEach(function(val){this.tallyListOfLists.push(this.revBots[val])},this)\n// this.revBots = infiniteArrayClone(this.tallyListOfLists);\n\n \nfor (var cA=0;cA<this.revList.length;cA++)\n{\n //while you still have numbers to use and your count is less than length\n //and the item is greater than 1\n var cC=0;\n// var huh=this.tallyListOfLists.length\n// var huha=this.revBots.length\n// var huhb=this.revList[cA];\n while ((this.tallyListOfLists.length>0)&&(cC<this.revBots.length)&&(this.revList[cA]!=1))\n {\n var cB=0;\n\n while ((this.tallyListOfLists[cC].length>0)&&(cB<this.tallyListOfLists[cC].length)&&(this.revList[cA]!=1))\n {\n //if the top list item is divisible by the bottom item\n //eliminate the bottom list item and make the top the result of the division\n if ((this.revList[cA]%this.revBots[cC][cB])==0)\n {\n this.revList[cA]=this.revList[cA]/this.revBots[cC][cB];\n this.tallyListOfLists[cC].splice(this.tallyListOfLists[cC].indexOf(this.revBots[cC][cB]),1);\n }\n cB++;\n }\n cC++;\n}\nthis.revBots=infiniteArrayClone(this.tallyListOfLists);\n}\n this.revBots= this.revBots.filter(function(val){return (val.length>0)});\n this.revBotProd=1\n//do the multiplication of the remnant\n this.revBots.forEach(function(val){val.forEach(function(item){this.revBotProd=this.revBotProd*item})});\n//SpreadsheetApp.getUi().alert(newList)\nthis.prod=1/this.revBotProd\nthis.revList.forEach(function(item){this.prod=this.prod*item},this) ;\n//this.revList.forEach(function(item){this.sum+=item},this);\n}\n}", "function _t(t) {\n var N,\n L,\n A,\n S,\n e,\n c = Math.floor,\n _ = new Array(64),\n F = new Array(64),\n P = new Array(64),\n k = new Array(64),\n y = new Array(65535),\n v = new Array(65535),\n Z = new Array(64),\n w = new Array(64),\n I = [],\n C = 0,\n B = 7,\n j = new Array(64),\n E = new Array(64),\n M = new Array(64),\n n = new Array(256),\n O = new Array(2048),\n b = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63],\n q = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],\n T = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n R = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],\n D = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250],\n U = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],\n z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n H = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],\n W = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];\n\n function r(t, e) {\n for (var n = 0, r = 0, i = new Array(), o = 1; o <= 16; o++) {\n for (var a = 1; a <= t[o]; a++) i[e[r]] = [], i[e[r]][0] = n, i[e[r]][1] = o, r++, n++;\n\n n *= 2;\n }\n\n return i;\n }\n\n function V(t) {\n for (var e = t[0], n = t[1] - 1; 0 <= n;) e & 1 << n && (C |= 1 << B), n--, --B < 0 && (255 == C ? (G(255), G(0)) : G(C), B = 7, C = 0);\n }\n\n function G(t) {\n I.push(t);\n }\n\n function Y(t) {\n G(t >> 8 & 255), G(255 & t);\n }\n\n function J(t, e, n, r, i) {\n for (var o, a = i[0], s = i[240], l = function (t, e) {\n var n,\n r,\n i,\n o,\n a,\n s,\n l,\n h,\n u,\n c,\n f = 0;\n\n for (u = 0; u < 8; ++u) {\n n = t[f], r = t[f + 1], i = t[f + 2], o = t[f + 3], a = t[f + 4], s = t[f + 5], l = t[f + 6];\n var p = n + (h = t[f + 7]),\n d = n - h,\n g = r + l,\n m = r - l,\n y = i + s,\n v = i - s,\n w = o + a,\n b = o - a,\n x = p + w,\n N = p - w,\n L = g + y,\n A = g - y;\n t[f] = x + L, t[f + 4] = x - L;\n var S = .707106781 * (A + N);\n t[f + 2] = N + S, t[f + 6] = N - S;\n\n var _ = .382683433 * ((x = b + v) - (A = m + d)),\n F = .5411961 * x + _,\n P = 1.306562965 * A + _,\n k = .707106781 * (L = v + m),\n I = d + k,\n C = d - k;\n\n t[f + 5] = C + F, t[f + 3] = C - F, t[f + 1] = I + P, t[f + 7] = I - P, f += 8;\n }\n\n for (u = f = 0; u < 8; ++u) {\n n = t[f], r = t[f + 8], i = t[f + 16], o = t[f + 24], a = t[f + 32], s = t[f + 40], l = t[f + 48];\n var B = n + (h = t[f + 56]),\n j = n - h,\n E = r + l,\n M = r - l,\n O = i + s,\n q = i - s,\n T = o + a,\n R = o - a,\n D = B + T,\n U = B - T,\n z = E + O,\n H = E - O;\n t[f] = D + z, t[f + 32] = D - z;\n var W = .707106781 * (H + U);\n t[f + 16] = U + W, t[f + 48] = U - W;\n var V = .382683433 * ((D = R + q) - (H = M + j)),\n G = .5411961 * D + V,\n Y = 1.306562965 * H + V,\n J = .707106781 * (z = q + M),\n X = j + J,\n K = j - J;\n t[f + 40] = K + G, t[f + 24] = K - G, t[f + 8] = X + Y, t[f + 56] = X - Y, f++;\n }\n\n for (u = 0; u < 64; ++u) c = t[u] * e[u], Z[u] = 0 < c ? c + .5 | 0 : c - .5 | 0;\n\n return Z;\n }(t, e), h = 0; h < 64; ++h) w[b[h]] = l[h];\n\n var u = w[0] - n;\n n = w[0], 0 == u ? V(r[0]) : (V(r[v[o = 32767 + u]]), V(y[o]));\n\n for (var c = 63; 0 < c && 0 == w[c]; c--);\n\n if (0 == c) return V(a), n;\n\n for (var f, p = 1; p <= c;) {\n for (var d = p; 0 == w[p] && p <= c; ++p);\n\n var g = p - d;\n\n if (16 <= g) {\n f = g >> 4;\n\n for (var m = 1; m <= f; ++m) V(s);\n\n g &= 15;\n }\n\n o = 32767 + w[p], V(i[(g << 4) + v[o]]), V(y[o]), p++;\n }\n\n return 63 != c && V(a), n;\n }\n\n function X(t) {\n if (t <= 0 && (t = 1), 100 < t && (t = 100), e != t) {\n (function (t) {\n for (var e = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], n = 0; n < 64; n++) {\n var r = c((e[n] * t + 50) / 100);\n r < 1 ? r = 1 : 255 < r && (r = 255), _[b[n]] = r;\n }\n\n for (var i = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {\n var a = c((i[o] * t + 50) / 100);\n a < 1 ? a = 1 : 255 < a && (a = 255), F[b[o]] = a;\n }\n\n for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, h = 0; h < 8; h++) for (var u = 0; u < 8; u++) P[l] = 1 / (_[b[l]] * s[h] * s[u] * 8), k[l] = 1 / (F[b[l]] * s[h] * s[u] * 8), l++;\n })(t < 50 ? Math.floor(5e3 / t) : Math.floor(200 - 2 * t)), e = t;\n }\n }\n\n this.encode = function (t, e) {\n var n, r;\n new Date().getTime();\n e && X(e), I = new Array(), C = 0, B = 7, Y(65496), Y(65504), Y(16), G(74), G(70), G(73), G(70), G(0), G(1), G(1), G(0), Y(1), Y(1), G(0), G(0), function () {\n Y(65499), Y(132), G(0);\n\n for (var t = 0; t < 64; t++) G(_[t]);\n\n G(1);\n\n for (var e = 0; e < 64; e++) G(F[e]);\n }(), n = t.width, r = t.height, Y(65472), Y(17), G(8), Y(r), Y(n), G(3), G(1), G(17), G(0), G(2), G(17), G(1), G(3), G(17), G(1), function () {\n Y(65476), Y(418), G(0);\n\n for (var t = 0; t < 16; t++) G(q[t + 1]);\n\n for (var e = 0; e <= 11; e++) G(T[e]);\n\n G(16);\n\n for (var n = 0; n < 16; n++) G(R[n + 1]);\n\n for (var r = 0; r <= 161; r++) G(D[r]);\n\n G(1);\n\n for (var i = 0; i < 16; i++) G(U[i + 1]);\n\n for (var o = 0; o <= 11; o++) G(z[o]);\n\n G(17);\n\n for (var a = 0; a < 16; a++) G(H[a + 1]);\n\n for (var s = 0; s <= 161; s++) G(W[s]);\n }(), Y(65498), Y(12), G(3), G(1), G(0), G(2), G(17), G(3), G(17), G(0), G(63), G(0);\n var i = 0,\n o = 0,\n a = 0;\n C = 0, B = 7, this.encode.displayName = \"_encode_\";\n\n for (var s, l, h, u, c, f, p, d, g, m = t.data, y = t.width, v = t.height, w = 4 * y, b = 0; b < v;) {\n for (s = 0; s < w;) {\n for (f = c = w * b + s, p = -1, g = d = 0; g < 64; g++) f = c + (d = g >> 3) * w + (p = 4 * (7 & g)), v <= b + d && (f -= w * (b + 1 + d - v)), w <= s + p && (f -= s + p - w + 4), l = m[f++], h = m[f++], u = m[f++], j[g] = (O[l] + O[h + 256 >> 0] + O[u + 512 >> 0] >> 16) - 128, E[g] = (O[l + 768 >> 0] + O[h + 1024 >> 0] + O[u + 1280 >> 0] >> 16) - 128, M[g] = (O[l + 1280 >> 0] + O[h + 1536 >> 0] + O[u + 1792 >> 0] >> 16) - 128;\n\n i = J(j, P, i, N, A), o = J(E, k, o, L, S), a = J(M, k, a, L, S), s += 32;\n }\n\n b += 8;\n }\n\n if (0 <= B) {\n var x = [];\n x[1] = B + 1, x[0] = (1 << B + 1) - 1, V(x);\n }\n\n return Y(65497), new Uint8Array(I);\n }, function () {\n new Date().getTime();\n t || (t = 50), function () {\n for (var t = String.fromCharCode, e = 0; e < 256; e++) n[e] = t(e);\n }(), N = r(q, T), L = r(U, z), A = r(R, D), S = r(H, W), function () {\n for (var t = 1, e = 2, n = 1; n <= 15; n++) {\n for (var r = t; r < e; r++) v[32767 + r] = n, y[32767 + r] = [], y[32767 + r][1] = n, y[32767 + r][0] = r;\n\n for (var i = -(e - 1); i <= -t; i++) v[32767 + i] = n, y[32767 + i] = [], y[32767 + i][1] = n, y[32767 + i][0] = e - 1 + i;\n\n t <<= 1, e <<= 1;\n }\n }(), function () {\n for (var t = 0; t < 256; t++) O[t] = 19595 * t, O[t + 256 >> 0] = 38470 * t, O[t + 512 >> 0] = 7471 * t + 32768, O[t + 768 >> 0] = -11059 * t, O[t + 1024 >> 0] = -21709 * t, O[t + 1280 >> 0] = 32768 * t + 8421375, O[t + 1536 >> 0] = -27439 * t, O[t + 1792 >> 0] = -5329 * t;\n }(), X(t), new Date().getTime();\n }();\n }", "Exp() {\n if (options.dual) {\n var f = Math.exp(this.s);\n return this.map((x, i) => i ? x * f : f);\n }\n if (r == 1 && tot <= 4 && Math.abs(this[0]) < 1E-9 && !options.over) {\n var u = Math.sqrt(Math.abs(this.Dot(this).s));\n if (Math.abs(u) < 1E-5) {\n return this.Add(Element.Scalar(1));\n }\n var v = this.Wedge(this).Scale(-1 / (2 * u));\n var res2 = Element.Add(\n Element.Sub(Math.cos(u), v.Scale(Math.sin(u))), Element.Div(Element.Mul((Element.Add(Math.sin(u), v.Scale(Math.cos(u)))), this),\n (Element.Add(u, v)))\n );\n return res2;\n }\n var res = Element.Scalar(1);\n var y = 1;\n var M = this.Scale(1);\n var N = this.Scale(1);\n for (var x = 1; x < 15; x++) {\n res = res.Add(M.Scale(1 / y));\n M = M.Mul(N);\n y = y * (x + 1);\n }\n return res;\n }", "σ_perm() {\n\n let σ_perm = [];\n\n for (let x = 0; x <= this.L; x += 2) {\n if (x <= 0.1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n } else {\n if (x < 0.3 * this.L) {\n σ_perm.push(new loadsArray(x, 275 * x / (this.material.k * this.L) + 102.5 / this.material.k));\n } else {\n if (x <= 0.7 * this.L) {\n σ_perm.push(new loadsArray(x, 185 / this.material.k));\n } else {\n if (x < 0.9 * this.L) {\n σ_perm.push(new loadsArray(x, -275 * x / (this.material.k * this.L) + 377.5 / this.material.k));\n } else {\n if (x <= 1 * this.L) {\n σ_perm.push(new loadsArray(x, 130 / this.material.k));\n }\n }\n }\n }\n }\n }\n return σ_perm;\n }", "function ja(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)na(e,a[f],e.forwardSegs)}", "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "function sof(){\nalert(\"The subject of the formula is a single term in an algebraic formula which is expressed in terms of the others eg in the formula d=v-2t, d is the subject of the formula. The formula can be manipulated such that v or t are made the subject of formulae.\");\nalert(\"In manipulating algebraic formulae there are certain rules to follow.When a term crosses the equal sign it changes sign.We also need to separate all other letters and numbers from the one to be made the subject of the formula.To do this we look at what each letter or number is doing to the one to be made subject and we do the opposite to both sides of the formula to keep things balanced eg lets make x the subject of the formula in a+x=c. Now a is adding to x so we subtract a from both sides of the formula ie a+x-a=c-a and we get x=c-a\");\nalert(\"Lets do a more complicated example\");\nalert(\"Lets make x the subject of the formula in mx-p=bx+w. First we collect the terms containing x to one side of the formula ie mx-bx=w+p.Now we factorise the left hand side ie x(m-b)=w+p.Now the bracketed terms (m-b) are multipying x so we divide both sides by (m-b) ie x(m-b)/(m-b)=(w+p)/(m-b) hence x=(w+p)/(m-b).\");\nalert(\"In the formula √(x+a)=p make a the subject of the formula.The first obstacle to x is the square root sign hence we square both sides to remove the square root sign ie [(√x+a)]²=p² and this gives x+a=p².Now x is adding to a hence we subtract x from both sides ie x+a-x=p²-x and this results in a=p²-x.\");\n}", "function c$a(t,n,r){const a=z$6(t,n)/z$6(t,t);return d$c(r,t,a)}", "function LE2601() {\n calculatefor(new Array(\n \" 2601 to 2700\",\n// 2601 4 9\n2671154.174064, 16.0, 1927.8, \" 2.259\", \" 1.194\", 1,\n 5.17809, 0.91990, 0.25065,\n -2.79713, -1.62973, -0.38333, 0.17752, 0.73784, 1.98416, 3.15372,\n 197.8315799, 0.46243, 1.220e-04,\n -7.8669197, -0.23799, 3.270e-04,\n// 2601 10 4\n2671331.733494, 6.0, 1930.3, \" 2.195\", \" 1.194\", 1,\n 6.84706, 0.97420, 0.26545,\n -3.14201, -2.10896, -0.93254, -0.39613, 0.14098, 1.31777, 2.34884,\n 9.9983101, 0.51119, 4.180e-04,\n 4.6926900, 0.27376, -7.000e-05,\n// 2602 3 29\n2671508.459468, 23.0, 1932.7, \" 0.952\", \"-0.061\", 3,\n 11.45854, 0.97011, 0.26433,\n -2.09129, 0.00000, 0.00000, 0.02724, 0.00000, 0.00000, 2.14479,\n 187.4938973, 0.50625, -3.500e-05,\n -4.3175303, -0.27213, 2.850e-04,\n// 2602 9 23\n2671686.056831, 13.0, 1935.1, \" 0.771\", \"-0.282\", 3,\n 13.12751, 0.92321, 0.25155,\n -1.69533, 0.00000, 0.00000, 0.36394, 0.00000, 0.00000, 2.42570,\n 359.4870901, 0.45660, 1.820e-04,\n 0.9125500, 0.24824, 5.200e-05,\n// 2603 2 18\n2671833.602065, 2.0, 1937.1, \" 1.066\", \" 0.098\", 2,\n 11.82245, 1.02465, 0.27919,\n -1.62802, -0.11002, 0.00000, 0.44956, 0.00000, 1.00885, 2.52641,\n 150.7453622, 0.59159, -6.720e-04,\n 13.0001603, -0.27410, -6.620e-04,\n// 2603 8 13\n2672010.470732, 23.0, 1939.5, \" 1.141\", \" 0.075\", 2,\n 20.44487, 0.90404, 0.24633,\n -2.17486, -0.25780, 0.00000, 0.29756, 0.00000, 0.85142, 2.76907,\n 323.4079272, 0.47302, -5.300e-04,\n -15.3597704, 0.20096, 4.680e-04,\n// 2604 2 7\n2672188.243875, 18.0, 1942.0, \" 2.282\", \" 1.294\", 1,\n 3.12753, 1.00456, 0.27372,\n -2.82182, -1.84461, -0.76764, -0.14700, 0.47405, 1.55109, 2.52653,\n 140.3133957, 0.58717, -5.060e-04,\n 15.7387895, -0.24046, -8.630e-04,\n// 2604 8 2\n2672364.632281, 3.0, 1944.4, \" 2.573\", \" 1.549\", 1,\n 23.71711, 0.94129, 0.25648,\n -2.74910, -1.69313, -0.63773, 0.17474, 0.98680, 2.04190, 3.10020,\n 312.6121302, 0.53023, -7.870e-04,\n -17.8020189, 0.19225, 6.360e-04,\n// 2605 1 27\n2672542.707612, 5.0, 1946.8, \" 2.156\", \" 1.113\", 1,\n 13.41893, 0.95311, 0.25970,\n -2.84661, -1.72997, -0.44295, -0.01732, 0.40914, 1.69652, 2.81085,\n 128.9580696, 0.54888, -3.550e-04,\n 18.1794791, -0.18676, -8.580e-04,\n// 2605 7 22\n2672719.094700, 14.0, 1949.2, \" 1.732\", \" 0.763\", 2,\n 10.00850, 0.99333, 0.27066,\n -2.25087, -1.18338, 0.00000, 0.27280, 0.00000, 1.72771, 2.79730,\n 301.7272402, 0.60876, -9.040e-04,\n -19.5766114, 0.17846, 9.530e-04,\n// 2606 1 16\n2672896.868274, 9.0, 1951.7, \" 0.844\", \"-0.251\", 3,\n 16.69117, 0.90889, 0.24765,\n -2.35619, 0.00000, 0.00000, -0.16143, 0.00000, 0.00000, 2.03485,\n 117.1615953, 0.51655, -3.310e-04,\n 19.9808595, -0.13567, -7.770e-04,\n// 2606 6 12\n2673044.490776, 0.0, 1953.7, \" 0.660\", \"-0.286\", 3,\n 17.39158, 1.02057, 0.27808,\n -1.92317, 0.00000, 0.00000, -0.22138, 0.00000, 0.00000, 1.48109,\n 261.3426266, 0.69448, -1.200e-05,\n -24.3139708, 0.01905, 1.583e-03,\n// 2606 7 12\n2673073.771623, 7.0, 1954.1, \" 0.423\", \"-0.518\", 3,\n 2.31633, 1.02285, 0.27870,\n -1.87164, 0.00000, 0.00000, -0.48105, 0.00000, 0.00000, 0.90929,\n 291.4355658, 0.66038, -6.800e-04,\n -20.5259206, 0.14770, 1.239e-03,\n// 2606 12 6\n2673221.066977, 14.0, 1956.1, \" 0.654\", \"-0.427\", 3,\n 18.99484, 0.91627, 0.24966,\n -2.34120, 0.00000, 0.00000, -0.39255, 0.00000, 0.00000, 1.55412,\n 72.5385419, 0.55813, -9.700e-05,\n 23.4976403, 0.01492, -9.990e-04,\n// 2607 6 2\n2673399.134669, 15.0, 1958.6, \" 1.975\", \" 0.992\", 2,\n 7.69393, 0.98403, 0.26812,\n -2.41283, -1.37603, 0.00000, 0.23205, 0.00000, 1.84130, 2.87602,\n 250.0032285, 0.63777, 3.820e-04,\n -22.5741287, -0.02604, 1.248e-03,\n// 2607 11 25\n2673575.305773, 19.0, 1961.0, \" 2.002\", \" 0.977\", 2,\n 23.26981, 0.96524, 0.26300,\n -2.39529, -1.29030, 0.00000, 0.33855, 0.00000, 1.96615, 3.07367,\n 60.3120320, 0.60520, -1.600e-05,\n 21.0479605, 0.06000, -1.097e-03,\n// 2608 5 22\n2673753.531453, 1.0, 1963.5, \" 2.346\", \" 1.307\", 1,\n 16.98259, 0.93187, 0.25391,\n -3.18007, -2.07058, -0.91757, -0.24512, 0.42788, 1.58112, 2.68819,\n 239.2804326, 0.56034, 4.220e-04,\n -20.0827096, -0.05910, 8.610e-04,\n// 2608 11 14\n2673929.836493, 8.0, 1965.9, \" 2.400\", \" 1.426\", 1,\n 11.56668, 1.01253, 0.27589,\n -2.58661, -1.64664, -0.63374, 0.07583, 0.78512, 1.79785, 2.73904,\n 49.4485103, 0.64615, 2.140e-04,\n 17.9187503, 0.10448, -1.093e-03,\n// 2609 5 11\n2674107.632521, 3.0, 1968.3, \" 0.954\", \"-0.124\", 3,\n 18.24935, 0.90095, 0.24549,\n -2.13932, 0.00000, 0.00000, 0.18050, 0.00000, 0.00000, 2.50042,\n 228.0901512, 0.50909, 2.810e-04,\n -16.8409413, -0.08727, 6.190e-04,\n// 2609 11 4\n2674284.506711, 0.0, 1970.8, \" 1.148\", \" 0.186\", 2,\n 2.87177, 1.02214, 0.27851,\n -1.97745, -0.60191, 0.00000, 0.16107, 0.00000, 0.92478, 2.29954,\n 38.9871706, 0.63909, 4.750e-04,\n 14.2249601, 0.14008, -8.310e-04,\n// 2610 3 31\n2674432.017541, 12.0, 1972.8, \" 0.838\", \"-0.215\", 3,\n 0.56397, 0.93249, 0.25408,\n -1.69209, 0.00000, 0.00000, 0.42099, 0.00000, 0.00000, 2.53257,\n 188.9509406, 0.50676, -6.200e-05,\n -4.9907398, -0.16295, 2.560e-04,\n// 2610 9 25\n2674609.660263, 4.0, 1975.3, \" 0.980\", \"-0.035\", 3,\n 4.23842, 0.95870, 0.26122,\n -2.32088, 0.00000, 0.00000, -0.15368, 0.00000, 0.00000, 2.01549,\n 1.4404900, 0.53254, 2.770e-04,\n 1.6815500, 0.17469, 2.000e-06,\n// 2611 3 20\n2674786.385101, 21.0, 1977.7, \" 2.215\", \" 1.216\", 1,\n 8.84989, 0.98547, 0.26852,\n -2.47511, -1.46010, -0.31319, 0.24243, 0.79744, 1.94422, 2.96141,\n 179.2703496, 0.56236, -2.240e-04,\n -0.0733400, -0.18359, 7.800e-05,\n// 2611 9 14\n2674963.901116, 10.0, 1980.2, \" 2.331\", \" 1.269\", 1,\n 9.51613, 0.91257, 0.24866,\n -3.38776, -2.22219, -1.02143, -0.37321, 0.27543, 1.47642, 2.64048,\n 351.9332014, 0.48434, 5.100e-05,\n -3.1865599, 0.15552, 1.530e-04,\n// 2612 3 9\n2675140.990186, 12.0, 1982.6, \" 2.197\", \" 1.231\", 1,\n 23.15224, 1.02202, 0.27847,\n -2.83210, -1.88796, -0.79125, -0.23554, 0.31999, 1.41655, 2.36109,\n 169.9579877, 0.60704, -2.470e-04,\n 4.7088601, -0.19294, -2.380e-04,\n// 2612 9 2\n2675317.925425, 10.0, 1985.1, \" 2.079\", \" 1.005\", 1,\n 8.77741, 0.90069, 0.24542,\n -2.78774, -1.54724, 0.11012, 0.21019, 0.31005, 1.96725, 3.20821,\n 341.7974739, 0.47829, -2.100e-04,\n -8.1026901, 0.14336, 2.670e-04,\n// 2613 2 27\n2675495.652810, 4.0, 1987.5, \" 0.955\", \"-0.022\", 3,\n 14.45733, 1.01330, 0.27610,\n -2.34823, 0.00000, 0.00000, -0.33256, 0.00000, 0.00000, 1.68353,\n 160.2943082, 0.60637, -1.630e-04,\n 9.4254997, -0.17994, -5.650e-04,\n// 2613 7 24\n2675642.547419, 1.0, 1989.6, \" 0.055\", \"-0.951\", 3,\n 21.10846, 0.95608, 0.26051,\n -0.42928, 0.00000, 0.00000, 0.13807, 0.00000, 0.00000, 0.69984,\n 303.3092760, 0.58189, -4.970e-04,\n -18.3471210, 0.07298, 8.500e-04,\n// 2613 8 22\n2675672.027856, 13.0, 1990.0, \" 0.724\", \"-0.314\", 3,\n 11.04690, 0.93052, 0.25355,\n -2.31466, 0.00000, 0.00000, -0.33146, 0.00000, 0.00000, 1.64919,\n 332.1150251, 0.52150, -4.780e-04,\n -12.5962494, 0.13985, 4.540e-04,\n// 2614 1 18\n2675820.563711, 2.0, 1992.0, \" 0.919\", \"-0.142\", 3,\n 9.80755, 0.93787, 0.25555,\n -2.65446, 0.00000, 0.00000, -0.47092, 0.00000, 0.00000, 1.71437,\n 119.4120470, 0.56661, 2.200e-05,\n 19.6183387, -0.05653, -9.070e-04,\n// 2614 7 13\n2675997.085074, 14.0, 1994.5, \" 1.518\", \" 0.561\", 2,\n 9.40534, 1.00552, 0.27398,\n -2.34895, -1.23413, 0.00000, 0.04178, 0.00000, 1.31629, 2.43262,\n 292.7801296, 0.65745, -3.760e-04,\n -20.9820099, 0.03860, 1.248e-03,\n// 2615 1 7\n2676174.643821, 3.0, 1996.9, \" 2.151\", \" 1.049\", 1,\n 10.07157, 0.90234, 0.24587,\n -2.58660, -1.32267, 0.15217, 0.45172, 0.75156, 2.22650, 3.48953,\n 106.9164003, 0.53580, 2.400e-05,\n 22.0557993, -0.01164, -8.730e-04,\n// 2615 7 3\n2676351.789817, 7.0, 1999.4, \" 2.776\", \" 1.835\", 1,\n 1.71316, 1.02305, 0.27876,\n -2.68640, -1.80697, -0.87190, -0.04439, 0.78316, 1.71825, 2.59745,\n 282.0938068, 0.69066, 6.500e-05,\n -22.9260815, -0.00591, 1.493e-03,\n// 2615 12 27\n2676528.606916, 3.0, 2001.9, \" 2.414\", \" 1.320\", 1,\n 9.33285, 0.90851, 0.24755,\n -3.50512, -2.30482, -1.12703, -0.43402, 0.25866, 1.43631, 2.63820,\n 94.9582144, 0.54829, 2.000e-06,\n 23.5433291, 0.02919, -9.670e-04,\n// 2616 6 21\n2676706.468668, 23.0, 2004.3, \" 1.403\", \" 0.434\", 2,\n 17.01825, 0.99483, 0.27107,\n -2.11255, -0.90613, 0.00000, 0.24804, 0.00000, 1.40423, 2.60892,\n 270.8586921, 0.65743, 5.100e-04,\n -24.1201796, -0.05122, 1.388e-03,\n// 2616 12 15\n2676882.767730, 6.0, 2006.8, \" 1.151\", \" 0.109\", 2,\n 11.60235, 0.95229, 0.25948,\n -1.91376, -0.20927, 0.00000, 0.42553, 0.00000, 1.05693, 2.76417,\n 82.0867639, 0.59925, 1.210e-04,\n 24.0331800, 0.08014, -1.200e-03,\n// 2617 5 12\n2677031.394024, 21.0, 2008.8, \" 0.756\", \"-0.300\", 3,\n 12.36847, 0.91957, 0.25056,\n -1.59543, 0.00000, 0.00000, 0.45657, 0.00000, 0.00000, 2.50997,\n 229.9643551, 0.50728, 6.400e-04,\n -17.1780487, -0.17577, 5.780e-04,\n// 2617 11 5\n2677207.809110, 7.0, 2011.3, \" 0.838\", \"-0.126\", 3,\n 9.96078, 1.02020, 0.27798,\n -1.47497, 0.00000, 0.00000, 0.41865, 0.00000, 0.00000, 2.31112,\n 40.4130887, 0.60283, 5.680e-04,\n 14.4556804, 0.24456, -8.040e-04,\n// 2618 5 1\n2677385.436174, 22.0, 2013.8, \" 2.087\", \" 1.005\", 1,\n 12.63249, 0.89952, 0.24510,\n -2.54352, -1.29069, 0.37157, 0.46819, 0.56479, 2.22693, 3.47949,\n 218.8304091, 0.46874, 4.150e-04,\n -14.7147905, -0.19494, 4.730e-04,\n// 2618 10 25\n2677562.487805, 0.0, 2016.2, \" 2.093\", \" 1.128\", 1,\n 2.26861, 1.01572, 0.27676,\n -2.87989, -1.91565, -0.72197, -0.29267, 0.13700, 1.33064, 2.29366,\n 30.3394715, 0.57981, 7.000e-04,\n 11.8877598, 0.26805, -5.320e-04,\n// 2619 4 20\n2677739.481739, 0.0, 2018.7, \" 2.346\", \" 1.287\", 1,\n 13.89925, 0.92219, 0.25127,\n -3.41950, -2.27493, -1.09791, -0.43826, 0.22093, 1.39783, 2.54460,\n 208.3302773, 0.47749, 2.400e-04,\n -11.8951800, -0.22488, 4.740e-04,\n// 2619 10 15\n2677917.057283, 13.0, 2021.2, \" 2.280\", \" 1.273\", 1,\n 14.56548, 0.97122, 0.26463,\n -2.40292, -1.37039, -0.24572, 0.37479, 0.99593, 2.12095, 3.15142,\n 19.6468206, 0.51680, 5.790e-04,\n 8.5718900, 0.26259, -2.310e-04,\n// 2620 4 9\n2678093.790827, 7.0, 2023.7, \" 1.020\", \" 0.013\", 2,\n 20.17969, 0.97303, 0.26513,\n -2.18751, -0.23896, 0.00000, -0.02014, 0.00000, 0.19510, 2.14649,\n 197.6241470, 0.51788, 1.380e-04,\n -8.5016696, -0.26535, 4.560e-04,\n// 2620 10 3\n2678271.356904, 21.0, 2026.2, \" 0.874\", \"-0.185\", 3,\n 21.84866, 0.92084, 0.25091,\n -2.61206, 0.00000, 0.00000, -0.43430, 0.00000, 0.00000, 1.74561,\n 9.7083703, 0.45792, 3.250e-04,\n 5.2808500, 0.24432, -9.100e-05,\n// 2621 2 28\n2678418.964615, 11.0, 2028.2, \" 1.040\", \" 0.074\", 2,\n 21.54634, 1.02471, 0.27921,\n -1.90629, -0.33796, 0.00000, 0.15076, 0.00000, 0.63935, 2.20710,\n 161.4770101, 0.57426, -4.670e-04,\n 8.9027904, -0.29252, -4.370e-04,\n// 2621 8 24\n2678595.746093, 6.0, 2030.7, \" 0.997\", \"-0.070\", 3,\n 4.16329, 0.90530, 0.24667,\n -2.43714, 0.00000, 0.00000, -0.09376, 0.00000, 0.00000, 2.24842,\n 333.7643792, 0.45875, -4.480e-04,\n -11.8009003, 0.21937, 3.290e-04,\n// 2622 2 18\n2678773.606240, 3.0, 2033.2, \" 2.265\", \" 1.276\", 1,\n 12.85143, 1.00235, 0.27312,\n -3.12785, -2.14577, -1.05666, -0.45024, 0.15661, 1.24580, 2.22600,\n 151.3518420, 0.56378, -3.670e-04,\n 12.0129700, -0.26471, -6.530e-04,\n// 2622 8 13\n2678949.920921, 10.0, 2035.7, \" 2.427\", \" 1.406\", 1,\n 7.43552, 0.94442, 0.25733,\n -2.79105, -1.73021, -0.63705, 0.10210, 0.84073, 1.93355, 2.99670,\n 323.0907059, 0.51472, -7.320e-04,\n -14.7851602, 0.21904, 4.800e-04,\n// 2623 2 7\n2679128.059260, 13.0, 2038.2, \" 2.168\", \" 1.122\", 1,\n 22.14009, 0.95037, 0.25895,\n -2.41971, -1.29924, -0.02074, 0.42225, 0.86606, 2.14494, 3.26309,\n 139.9348393, 0.52537, -3.120e-04,\n 15.1729493, -0.21454, -6.980e-04,\n// 2623 8 2\n2679304.399865, 22.0, 2040.6, \" 1.871\", \" 0.904\", 2,\n 18.72966, 0.99617, 0.27143,\n -2.97105, -1.94623, 0.00000, -0.40324, 0.00000, 1.13877, 2.16563,\n 312.8526622, 0.58983, -8.950e-04,\n -17.0018503, 0.21536, 7.690e-04,\n// 2624 1 27\n2679482.206129, 17.0, 2043.1, \" 0.857\", \"-0.239\", 3,\n 1.41232, 0.90751, 0.24728,\n -2.26592, 0.00000, 0.00000, -0.05291, 0.00000, 0.00000, 2.16159,\n 128.6333898, 0.49688, -3.600e-04,\n 17.5997600, -0.16791, -6.550e-04,\n// 2624 6 23\n2679629.805394, 7.0, 2045.2, \" 0.532\", \"-0.413\", 3,\n 1.11000, 1.01939, 0.27776,\n -1.21993, 0.00000, 0.00000, 0.32947, 0.00000, 0.00000, 1.87977,\n 272.5003144, 0.69091, -2.600e-04,\n -24.6286906, 0.06723, 1.590e-03,\n// 2624 7 22\n2679659.083986, 14.0, 2045.6, \" 0.554\", \"-0.387\", 3,\n 10.03475, 1.02323, 0.27880,\n -1.55528, 0.00000, 0.00000, 0.01566, 0.00000, 0.00000, 1.58671,\n 302.0650068, 0.64194, -7.440e-04,\n -18.8124413, 0.18901, 1.090e-03,\n// 2624 12 16\n2679806.403067, 22.0, 2047.7, \" 0.634\", \"-0.448\", 3,\n 3.71600, 0.91820, 0.25019,\n -2.24386, 0.00000, 0.00000, -0.32640, 0.00000, 0.00000, 1.58883,\n 84.6260575, 0.56380, -2.900e-04,\n 24.3803107, -0.02720, -1.036e-03,\n// 2625 6 12\n2679984.442119, 23.0, 2050.2, \" 1.846\", \" 0.863\", 2,\n 16.41508, 0.98090, 0.26727,\n -2.99938, -1.92820, 0.00000, -0.38914, 0.00000, 1.15129, 2.22029,\n 261.7947305, 0.63948, 1.650e-04,\n -23.6576306, 0.02058, 1.321e-03,\n// 2625 12 6\n2680160.653394, 4.0, 2052.7, \" 1.974\", \" 0.951\", 2,\n 8.99370, 0.96812, 0.26379,\n -3.03515, -1.92848, 0.00000, -0.31855, 0.00000, 1.29007, 2.39918,\n 72.5071435, 0.61940, -1.950e-04,\n 22.8426490, 0.01577, -1.205e-03,\n// 2626 6 2\n2680338.824126, 8.0, 2055.2, \" 2.474\", \" 1.434\", 1,\n 0.70101, 0.92912, 0.25316,\n -3.18721, -2.08659, -0.98472, -0.22099, 0.54319, 1.64529, 2.74360,\n 250.4053627, 0.56699, 2.930e-04,\n -21.9220693, -0.02168, 9.640e-04,\n// 2626 11 25\n2680515.191289, 17.0, 2057.6, \" 2.437\", \" 1.463\", 1,\n 21.29058, 1.01432, 0.27638,\n -3.07299, -2.13670, -1.13697, -0.40907, 0.31858, 1.31817, 2.25561,\n 61.1524868, 0.66444, 1.070e-04,\n 20.4665116, 0.06251, -1.277e-03,\n// 2627 5 22\n2680692.916108, 10.0, 2060.2, \" 1.077\", \" 0.001\", 2,\n 1.96776, 0.90038, 0.24533,\n -2.44719, -0.07995, 0.00000, -0.01341, 0.00000, 0.05385, 2.42039,\n 239.0112685, 0.52073, 2.170e-04,\n -19.4062596, -0.05652, 7.370e-04,\n// 2627 11 15\n2680869.858104, 9.0, 2062.7, \" 1.194\", \" 0.229\", 2,\n 12.59566, 1.02138, 0.27830,\n -2.57890, -1.24778, 0.00000, -0.40550, 0.00000, 0.43762, 1.76793,\n 50.2991967, 0.65574, 4.650e-04,\n 17.4116890, 0.10429, -1.056e-03,\n// 2628 4 10\n2681017.336115, 20.0, 2064.7, \" 0.771\", \"-0.276\", 3,\n 9.28513, 0.93513, 0.25480,\n -1.96476, 0.00000, 0.00000, 0.06675, 0.00000, 0.00000, 2.09643,\n 199.2209633, 0.51721, 3.000e-05,\n -9.2489794, -0.15434, 4.300e-04,\n// 2628 10 5\n2681194.973958, 11.0, 2067.2, \" 0.883\", \"-0.138\", 3,\n 11.95684, 0.95563, 0.26039,\n -1.71272, 0.00000, 0.00000, 0.37500, 0.00000, 0.00000, 2.46501,\n 11.0082799, 0.53281, 3.900e-04,\n 5.8513898, 0.16952, -1.790e-04,\n// 2629 3 31\n2681371.725424, 5.0, 2069.7, \" 2.161\", \" 1.167\", 1,\n 17.57105, 0.98813, 0.26924,\n -2.28341, -1.27018, -0.08570, 0.41018, 0.90541, 2.08977, 3.10512,\n 189.2236427, 0.56808, -8.600e-05,\n -4.3879598, -0.18145, 2.870e-04,\n// 2629 9 24\n2681549.192190, 17.0, 2072.2, \" 2.215\", \" 1.147\", 1,\n 17.23454, 0.91072, 0.24815,\n -3.38532, -2.19317, -0.88848, -0.38744, 0.11407, 1.41900, 2.60977,\n 1.6852899, 0.48110, 1.400e-04,\n 1.0721200, 0.15686, -0.000e-00,\n// 2630 3 20\n2681726.343941, 20.0, 2074.7, \" 2.238\", \" 1.275\", 1,\n 7.87340, 1.02268, 0.27865,\n -2.34660, -1.41157, -0.34270, 0.25458, 0.85170, 1.92044, 2.85577,\n 179.7815346, 0.60456, -7.900e-05,\n 0.4414200, -0.19713, -4.000e-06,\n// 2630 9 13\n2681903.206463, 17.0, 2077.3, \" 2.214\", \" 1.138\", 1,\n 16.49583, 0.90135, 0.24560,\n -3.08092, -1.86561, -0.53642, -0.04488, 0.44643, 1.77546, 2.99139,\n 351.6976965, 0.47283, -1.350e-04,\n -3.9324699, 0.15155, 1.180e-04,\n// 2631 3 10\n2682081.009408, 12.0, 2079.8, \" 0.983\", \" 0.006\", 2,\n 23.17849, 1.01145, 0.27559,\n -1.81606, 0.07928, 0.00000, 0.22579, 0.00000, 0.37446, 2.26803,\n 170.2578466, 0.59493, -2.000e-05,\n 5.2757000, -0.19037, -3.360e-04,\n// 2631 9 2\n2682257.318963, 20.0, 2082.3, \" 0.859\", \"-0.177\", 3,\n 18.76532, 0.93333, 0.25431,\n -2.46909, 0.00000, 0.00000, -0.34489, 0.00000, 0.00000, 1.77714,\n 342.0776756, 0.51371, -4.090e-04,\n -8.6895997, 0.15520, 2.850e-04,\n// 2632 1 29\n2682405.911196, 10.0, 2084.4, \" 0.903\", \"-0.160\", 3,\n 18.52871, 0.93536, 0.25487,\n -2.30633, 0.00000, 0.00000, -0.13130, 0.00000, 0.00000, 2.04561,\n 130.6880063, 0.55024, -5.700e-05,\n 17.0932400, -0.09086, -7.760e-04,\n// 2632 7 23\n2682582.393064, 21.0, 2086.9, \" 1.385\", \" 0.430\", 2,\n 17.12375, 1.00784, 0.27461,\n -1.88016, -0.70394, 0.00000, 0.43354, 0.00000, 1.56951, 2.74725,\n 303.4485572, 0.64806, -5.000e-04,\n -18.9769088, 0.07963, 1.103e-03,\n// 2633 1 17\n2682759.979984, 12.0, 2089.4, \" 2.137\", \" 1.033\", 1,\n 19.79546, 0.90157, 0.24566,\n -3.51793, -2.24835, -0.72915, -0.48038, -0.23134, 1.28796, 2.55679,\n 119.2547341, 0.52598, -1.140e-04,\n 20.2805990, -0.05086, -7.900e-04,\n// 2633 7 13\n2682937.101658, 14.0, 2091.9, \" 2.745\", \" 1.803\", 1,\n 9.43158, 1.02256, 0.27862,\n -2.20282, -1.32251, -0.38581, 0.43979, 1.26544, 2.20217, 3.08216,\n 292.9806093, 0.68217, -1.340e-04,\n -21.6073803, 0.03998, 1.393e-03,\n// 2634 1 6\n2683113.944906, 11.0, 2094.4, \" 2.430\", \" 1.337\", 1,\n 18.05401, 0.90996, 0.24794,\n -3.39048, -2.19526, -1.02799, -0.32225, 0.38317, 1.55027, 2.74712,\n 107.0095914, 0.54734, -1.750e-04,\n 22.6886095, -0.01209, -9.280e-04,\n// 2634 7 3\n2683291.773872, 7.0, 2097.0, \" 1.535\", \" 0.564\", 2,\n 1.73941, 0.99193, 0.27028,\n -2.86611, -1.72059, 0.00000, -0.42708, 0.00000, 0.86823, 2.01187,\n 282.7346698, 0.65362, 2.610e-04,\n -23.5715292, -0.00221, 1.366e-03,\n// 2634 12 26\n2683468.118813, 15.0, 2099.5, \" 1.170\", \" 0.130\", 2,\n 21.32624, 0.95505, 0.26023,\n -2.49455, -0.83713, 0.00000, -0.14848, 0.00000, 0.53684, 2.19687,\n 94.6628565, 0.60848, -1.040e-04,\n 24.1804509, 0.03251, -1.222e-03,\n// 2635 5 24\n2683616.685130, 4.0, 2101.6, \" 0.628\", \"-0.427\", 3,\n 20.08689, 0.91732, 0.24995,\n -1.45560, 0.00000, 0.00000, 0.44313, 0.00000, 0.00000, 2.34369,\n 240.8609110, 0.52243, 6.200e-04,\n -19.5007997, -0.14377, 7.060e-04,\n// 2635 6 22\n2683646.225447, 17.0, 2102.0, \" 0.057\", \"-0.969\", 3,\n 11.02807, 0.93976, 0.25606,\n -0.16954, 0.00000, 0.00000, 0.41072, 0.00000, 0.00000, 0.99641,\n 270.8877067, 0.59073, 4.480e-04,\n -24.7700106, -0.04422, 1.142e-03,\n// 2635 11 16\n2683793.161444, 16.0, 2104.1, \" 0.796\", \"-0.170\", 3,\n 19.68467, 1.02135, 0.27829,\n -1.97760, 0.00000, 0.00000, -0.12534, 0.00000, 0.00000, 1.72587,\n 51.7495600, 0.62759, 6.390e-04,\n 17.5729702, 0.21034, -1.019e-03,\n// 2635 12 16\n2683822.594897, 2.0, 2104.5, \" 0.011\", \"-0.976\", 3,\n 7.61764, 1.00600, 0.27411,\n 0.04178, 0.00000, 0.00000, 0.27752, 0.00000, 0.00000, 0.50950,\n 82.2982334, 0.67125, 2.590e-04,\n 24.7068689, 0.08664, -1.521e-03,\n// 2636 5 12\n2683970.724719, 5.0, 2106.6, \" 1.969\", \" 0.889\", 2,\n 20.35091, 0.89970, 0.24515,\n -2.57471, -1.29729, 0.00000, 0.39324, 0.00000, 2.08357, 3.36087,\n 229.5256111, 0.48639, 4.470e-04,\n -17.6989001, -0.17033, 6.030e-04,\n// 2636 11 5\n2684147.832594, 8.0, 2109.2, \" 2.035\", \" 1.065\", 1,\n 10.98976, 1.01424, 0.27635,\n -2.59591, -1.61564, -0.33039, -0.01774, 0.29535, 1.58057, 2.55952,\n 40.8213803, 0.59826, 8.360e-04,\n 15.3008293, 0.24176, -7.360e-04,\n// 2637 5 1\n2684324.786227, 7.0, 2111.7, \" 2.442\", \" 1.389\", 1,\n 21.61766, 0.92458, 0.25193,\n -3.11628, -1.99297, -0.86832, -0.13056, 0.60679, 1.73130, 2.85682,\n 218.6253395, 0.49636, 3.220e-04,\n -15.3278597, -0.20636, 6.180e-04,\n// 2637 10 25\n2684502.384844, 21.0, 2114.2, \" 2.356\", \" 1.342\", 1,\n 23.28663, 0.96826, 0.26383,\n -2.56926, -1.53467, -0.44271, 0.23626, 0.91578, 2.00808, 3.04054,\n 30.0214681, 0.52866, 7.270e-04,\n 12.4645497, 0.24453, -4.090e-04,\n// 2638 4 20\n2684679.117833, 15.0, 2116.7, \" 1.099\", \" 0.098\", 2,\n 4.90085, 0.97597, 0.26593,\n -2.39248, -0.75987, 0.00000, -0.17200, 0.00000, 0.41265, 2.04799,\n 207.9574446, 0.53542, 2.920e-04,\n -12.4504496, -0.25150, 6.340e-04,\n// 2638 10 15\n2684856.661306, 4.0, 2119.3, \" 0.966\", \"-0.099\", 3,\n 5.56708, 0.91860, 0.25030,\n -2.40597, 0.00000, 0.00000, -0.12865, 0.00000, 0.00000, 2.15050,\n 19.5952305, 0.46420, 4.510e-04,\n 9.2817293, 0.23466, -2.290e-04,\n// 2639 3 11\n2685004.323184, 20.0, 2121.4, \" 1.005\", \" 0.042\", 2,\n 7.27023, 1.02461, 0.27918,\n -2.27268, -0.61155, 0.00000, -0.24358, 0.00000, 0.12444, 1.78487,\n 171.9875647, 0.56363, -2.350e-04,\n 4.5382799, -0.30264, -2.200e-04,\n// 2639 9 4\n2685181.026316, 13.0, 2123.9, \" 0.863\", \"-0.205\", 3,\n 11.88171, 0.90668, 0.24705,\n -2.57571, 0.00000, 0.00000, -0.36843, 0.00000, 0.00000, 1.83733,\n 343.8475415, 0.44859, -3.410e-04,\n -7.9124198, 0.23204, 1.950e-04,\n// 2640 2 29\n2685358.963752, 11.0, 2126.5, \" 2.238\", \" 1.248\", 1,\n 21.57258, 1.00002, 0.27248,\n -2.54816, -1.56007, -0.45157, 0.13006, 0.71218, 1.82074, 2.80686,\n 161.5435361, 0.54605, -1.910e-04,\n 8.1535998, -0.27979, -4.630e-04,\n// 2640 8 23\n2685535.214802, 17.0, 2129.0, \" 2.292\", \" 1.273\", 1,\n 15.15394, 0.94756, 0.25819,\n -2.70214, -1.63239, -0.47913, 0.15524, 0.78895, 1.94185, 3.01388,\n 333.2462683, 0.50176, -6.320e-04,\n -11.3265693, 0.23996, 3.220e-04,\n// 2641 2 17\n2685713.406993, 22.0, 2131.5, \" 2.187\", \" 1.140\", 1,\n 7.86398, 0.94763, 0.25821,\n -3.08841, -1.96596, -0.70451, -0.23217, 0.24098, 1.50281, 2.62295,\n 151.0928823, 0.50400, -2.100e-04,\n 11.3987302, -0.23645, -5.270e-04,\n// 2641 8 13\n2685889.707434, 5.0, 2134.1, \" 2.007\", \" 1.041\", 1,\n 2.44808, 0.99893, 0.27218,\n -2.62494, -1.63279, -0.27660, -0.02158, 0.23273, 1.58888, 2.58298,\n 323.0560632, 0.57306, -8.150e-04,\n -14.0732804, 0.24442, 5.890e-04,\n// 2642 2 7\n2686067.541827, 1.0, 2136.6, \" 0.874\", \"-0.222\", 3,\n 10.13348, 0.90622, 0.24693,\n -2.23077, 0.00000, 0.00000, 0.00385, 0.00000, 0.00000, 2.23990,\n 139.7638524, 0.47716, -3.290e-04,\n 14.5387202, -0.19424, -5.190e-04,\n// 2642 7 4\n2686215.117254, 15.0, 2138.7, \" 0.399\", \"-0.547\", 3,\n 9.83115, 1.01806, 0.27740,\n -1.54670, 0.00000, 0.00000, -0.18591, 0.00000, 0.00000, 1.17611,\n 284.3346826, 0.67793, -4.990e-04,\n -24.0434099, 0.11742, 1.514e-03,\n// 2642 8 2\n2686244.396514, 22.0, 2139.2, \" 0.686\", \"-0.255\", 3,\n 18.75590, 1.02346, 0.27887,\n -2.20873, 0.00000, 0.00000, -0.48365, 0.00000, 0.00000, 1.24181,\n 313.0534971, 0.61974, -7.240e-04,\n -16.2494999, 0.22652, 8.960e-04,\n// 2642 12 28\n2686391.742696, 6.0, 2141.3, \" 0.620\", \"-0.461\", 3,\n 12.43715, 0.92019, 0.25073,\n -2.06945, 0.00000, 0.00000, -0.17529, 0.00000, 0.00000, 1.71640,\n 96.7818271, 0.56163, -4.880e-04,\n 24.3407588, -0.07045, -1.013e-03,\n// 2643 6 24\n2686569.744722, 6.0, 2143.8, \" 1.709\", \" 0.724\", 2,\n 0.13350, 0.97770, 0.26640,\n -2.69188, -1.57434, 0.00000, -0.12666, 0.00000, 1.32265, 2.43788,\n 273.0843502, 0.63288, -5.400e-05,\n -23.9243905, 0.06557, 1.324e-03,\n// 2643 12 17\n2686746.006234, 12.0, 2146.4, \" 1.957\", \" 0.935\", 2,\n 17.71486, 0.97096, 0.26456,\n -2.55258, -1.44677, 0.00000, 0.14962, 0.00000, 1.74464, 2.85280,\n 84.3000457, 0.62684, -4.130e-04,\n 23.7409094, -0.03009, -1.251e-03,\n// 2644 6 12\n2686924.111507, 15.0, 2148.9, \" 2.612\", \" 1.571\", 1,\n 8.41942, 0.92642, 0.25243,\n -3.31670, -2.22127, -1.15229, -0.32383, 0.50498, 1.57420, 2.66740,\n 261.7793216, 0.56823, 1.220e-04,\n -22.9905790, 0.01857, 1.020e-03,\n// 2644 12 6\n2687100.550624, 1.0, 2151.5, \" 2.466\", \" 1.491\", 1,\n 6.01173, 1.01596, 0.27682,\n -2.44901, -1.51557, -0.52509, 0.21497, 0.95481, 1.94517, 2.87969,\n 72.4966524, 0.67774, -6.900e-05,\n 22.1840890, 0.01701, -1.405e-03,\n// 2645 6 1\n2687278.194863, 17.0, 2154.0, \" 1.211\", \" 0.137\", 2,\n 9.68618, 0.89996, 0.24522,\n -2.86701, -1.07141, 0.00000, -0.32328, 0.00000, 0.42529, 2.22046,\n 250.2460281, 0.52953, 1.030e-04,\n -21.2717311, -0.02135, 8.260e-04,\n// 2645 11 25\n2687455.214076, 17.0, 2156.6, \" 1.231\", \" 0.262\", 2,\n 21.31682, 1.02050, 0.27806,\n -2.06299, -0.75955, 0.00000, 0.13781, 0.00000, 1.03612, 2.33873,\n 61.2955520, 0.66973, 3.770e-04,\n 19.8420513, 0.06355, -1.239e-03,\n// 2646 4 22\n2687602.649662, 4.0, 2158.7, \" 0.691\", \"-0.350\", 3,\n 18.00628, 0.93788, 0.25555,\n -2.33900, 0.00000, 0.00000, -0.40812, 0.00000, 0.00000, 1.52053,\n 209.7174477, 0.53213, 9.500e-05,\n -13.2455297, -0.13861, 6.060e-04,\n// 2646 10 16\n2687780.291800, 19.0, 2161.3, \" 0.797\", \"-0.230\", 3,\n 20.67799, 0.95263, 0.25957,\n -2.00679, 0.00000, 0.00000, 0.00320, 0.00000, 0.00000, 2.01577,\n 21.2521182, 0.53865, 4.910e-04,\n 10.0488595, 0.15733, -3.690e-04,\n// 2647 4 11\n2687957.061443, 13.0, 2163.8, \" 2.096\", \" 1.107\", 1,\n 2.29221, 0.99078, 0.26996,\n -2.19118, -1.17740, 0.07035, 0.47464, 0.87823, 2.12587, 3.14170,\n 199.2848665, 0.57915, 3.900e-05,\n -8.5818902, -0.17184, 4.980e-04,\n// 2647 10 5\n2688134.487886, 0.0, 2166.4, \" 2.110\", \" 1.037\", 1,\n 0.95296, 0.90902, 0.24769,\n -3.26921, -2.04787, -0.55118, -0.29073, -0.02976, 1.46717, 2.68726,\n 11.4658206, 0.48259, 2.260e-04,\n 5.3106497, 0.15225, -1.540e-04,\n// 2648 3 31\n2688311.693428, 5.0, 2169.0, \" 2.288\", \" 1.328\", 1,\n 17.59729, 1.02320, 0.27880,\n -2.96504, -2.03956, -0.99879, -0.35773, 0.28321, 1.32387, 2.24956,\n 190.2139109, 0.60789, 9.000e-05,\n -4.0240401, -0.19314, 2.430e-04,\n// 2648 9 23\n2688488.493157, 0.0, 2171.5, \" 2.337\", \" 1.259\", 1,\n 0.21424, 0.90215, 0.24581,\n -3.22820, -2.03065, -0.80932, -0.16424, 0.48061, 1.70178, 2.90014,\n 1.4968000, 0.47192, -5.100e-05,\n 0.3396500, 0.15383, -3.000e-05,\n// 2649 3 20\n2688666.362256, 21.0, 2174.1, \" 1.017\", \" 0.042\", 2,\n 8.90238, 1.00946, 0.27505,\n -2.37913, -0.67745, 0.00000, -0.30586, 0.00000, 0.06795, 1.76777,\n 180.7050718, 0.58918, 1.400e-04,\n 0.8046400, -0.19334, -9.800e-05,\n// 2649 9 13\n2688842.614693, 3.0, 2176.7, \" 0.987\", \"-0.049\", 3,\n 2.48374, 0.93621, 0.25509,\n -2.48631, 0.00000, 0.00000, -0.24736, 0.00000, 0.00000, 1.98981,\n 351.8266505, 0.51000, -3.170e-04,\n -4.5684800, 0.16441, 1.160e-04,\n// 2650 2 8\n2688991.256933, 18.0, 2178.8, \" 0.884\", \"-0.180\", 3,\n 3.24986, 0.93290, 0.25419,\n -1.99684, 0.00000, 0.00000, 0.16639, 0.00000, 0.00000, 2.33160,\n 141.6294912, 0.53302, -7.400e-05,\n 13.9270494, -0.11881, -6.230e-04,\n// 2650 8 4\n2689167.702533, 5.0, 2181.4, \" 1.255\", \" 0.302\", 2,\n 1.84491, 1.01003, 0.27521,\n -2.36952, -1.10819, 0.00000, -0.13921, 0.00000, 0.82816, 2.09102,\n 314.4413369, 0.63454, -5.560e-04,\n -16.2402706, 0.11734, 9.100e-04,\n// 2651 1 28\n2689345.314572, 20.0, 2183.9, \" 2.119\", \" 1.015\", 1,\n 4.51662, 0.90092, 0.24548,\n -3.48480, -2.21000, -0.61840, -0.45028, -0.28192, 1.30980, 2.58400,\n 130.7382901, 0.51253, -1.900e-04,\n 17.7363210, -0.08350, -6.730e-04,\n// 2651 7 24\n2689522.413900, 22.0, 2186.5, \" 2.610\", \" 1.668\", 1,\n 18.15274, 1.02191, 0.27844,\n -2.70452, -1.81941, -0.87027, -0.06640, 0.73754, 1.68674, 2.57145,\n 304.2904463, 0.66751, -2.810e-04,\n -19.5121600, 0.08403, 1.232e-03,\n// 2652 1 17\n2689699.283640, 19.0, 2189.1, \" 2.445\", \" 1.354\", 1,\n 2.77516, 0.91152, 0.24837,\n -3.25653, -2.06735, -0.90988, -0.19264, 0.52426, 1.68155, 2.87241,\n 118.8320410, 0.54009, -3.160e-04,\n 20.9592892, -0.05062, -8.380e-04,\n// 2652 7 13\n2689877.078089, 14.0, 2191.7, \" 1.668\", \" 0.695\", 2,\n 9.45782, 0.98897, 0.26947,\n -2.63667, -1.53604, 0.00000, -0.12585, 0.00000, 1.28590, 2.38451,\n 293.8067070, 0.64159, 6.500e-05,\n -22.2020405, 0.04122, 1.273e-03,\n// 2653 1 5\n2690053.471464, 23.0, 2194.2, \" 1.187\", \" 0.148\", 2,\n 6.04740, 0.95782, 0.26098,\n -2.03501, -0.41710, 0.00000, 0.31514, 0.00000, 1.04410, 2.66450,\n 106.5564903, 0.60923, -3.170e-04,\n 23.3516603, -0.01251, -1.174e-03,\n// 2653 6 3\n2690201.971010, 11.0, 2196.4, \" 0.492\", \"-0.564\", 3,\n 3.80531, 0.91517, 0.24936,\n -1.40163, 0.00000, 0.00000, 0.30425, 0.00000, 0.00000, 2.01241,\n 252.0484877, 0.53516, 5.390e-04,\n -21.1201300, -0.10745, 8.090e-04,\n// 2653 7 3\n2690231.512234, 0.0, 2196.8, \" 0.190\", \"-0.838\", 3,\n 18.74648, 0.93673, 0.25524,\n -0.76143, 0.00000, 0.00000, 0.29362, 0.00000, 0.00000, 1.35334,\n 282.4353983, 0.58642, 2.380e-04,\n -24.2176498, -0.00176, 1.123e-03,\n// 2653 11 27\n2690378.518342, 0.0, 2199.0, \" 0.763\", \"-0.204\", 3,\n 4.40583, 1.02234, 0.27856,\n -1.37857, 0.00000, 0.00000, 0.44021, 0.00000, 0.00000, 2.25806,\n 62.7841029, 0.65059, 6.220e-04,\n 19.8092305, 0.17085, -1.197e-03,\n// 2653 12 26\n2690407.958551, 11.0, 2199.4, \" 0.030\", \"-0.955\", 3,\n 17.34153, 1.00805, 0.27467,\n -0.39215, 0.00000, 0.00000, 0.00522, 0.00000, 0.00000, 0.39907,\n 94.7794205, 0.68019, -1.600e-05,\n 24.8254598, 0.03394, -1.550e-03,\n// 2654 5 23\n2690556.006493, 12.0, 2201.5, \" 1.836\", \" 0.760\", 2,\n 4.06933, 0.90004, 0.24524,\n -2.75596, -1.44261, 0.00000, 0.15584, 0.00000, 1.75399, 3.06737,\n 240.5516128, 0.50430, 4.260e-04,\n -20.0724899, -0.14034, 7.220e-04,\n// 2654 11 16\n2690733.182771, 16.0, 2204.1, \" 1.990\", \" 1.015\", 1,\n 19.71092, 1.01265, 0.27592,\n -2.18524, -1.19001, 0.23270, 0.38650, 0.54083, 1.96353, 2.95737,\n 51.6212379, 0.61873, 9.020e-04,\n 18.1942101, 0.20834, -9.360e-04,\n// 2655 5 12\n2690910.084573, 14.0, 2206.7, \" 2.552\", \" 1.505\", 1,\n 5.33608, 0.92712, 0.25262,\n -2.95810, -1.85445, -0.77066, 0.02975, 0.82980, 1.91342, 3.01931,\n 229.2299458, 0.51781, 3.610e-04,\n -18.2797514, -0.18170, 7.610e-04,\n// 2655 11 6\n2691087.717779, 5.0, 2209.3, \" 2.417\", \" 1.398\", 1,\n 8.00779, 0.96534, 0.26303,\n -2.60260, -1.56370, -0.49150, 0.22669, 0.94539, 2.01791, 3.05461,\n 40.6938778, 0.54459, 8.320e-04,\n 15.9597496, 0.21972, -5.900e-04,\n// 2656 4 30\n2691264.439476, 23.0, 2211.9, \" 1.190\", \" 0.195\", 2,\n 13.62201, 0.97893, 0.26673,\n -2.73036, -1.26866, 0.00000, -0.45257, 0.00000, 0.36068, 1.82499,\n 218.5822410, 0.55777, 4.100e-04,\n -16.0276792, -0.23031, 8.180e-04,\n// 2656 10 25\n2691441.971350, 11.0, 2214.5, \" 1.045\", \"-0.025\", 3,\n 13.28550, 0.91651, 0.24973,\n -2.04558, 0.00000, 0.00000, 0.31239, 0.00000, 0.00000, 2.67190,\n 29.6965902, 0.47522, 5.570e-04,\n 13.0385904, 0.21930, -3.710e-04,\n// 2657 3 22\n2691589.677513, 4.0, 2216.6, \" 0.961\", \"-0.000\", 3,\n 15.99139, 1.02435, 0.27911,\n -1.73239, 0.00000, 0.00000, 0.26032, 0.00000, 0.00000, 2.25244,\n 181.8353588, 0.56044, -3.000e-06,\n 0.3600500, -0.30459, -2.700e-05,\n// 2657 9 14\n2691766.310388, 19.0, 2219.2, \" 0.736\", \"-0.332\", 3,\n 18.59739, 0.90820, 0.24746,\n -1.61323, 0.00000, 0.00000, 0.44932, 0.00000, 0.00000, 2.51001,\n 353.2983104, 0.44388, -2.280e-04,\n -4.0625201, 0.23897, 7.100e-05,\n// 2658 3 11\n2691944.317832, 20.0, 2221.8, \" 2.203\", \" 1.214\", 1,\n 7.29648, 0.99758, 0.27182,\n -3.04912, -2.05421, -0.91947, -0.37202, 0.17597, 1.31077, 2.30361,\n 172.0884876, 0.53420, 1.400e-05,\n 3.7611700, -0.28816, -2.660e-04,\n// 2658 9 4\n2692120.512173, 0.0, 2224.4, \" 2.163\", \" 1.145\", 1,\n 22.87236, 0.95074, 0.25905,\n -2.52481, -1.44188, -0.18899, 0.29215, 0.77247, 2.02497, 3.11014,\n 343.1354260, 0.49285, -5.000e-04,\n -7.5492203, 0.25496, 1.680e-04,\n// 2659 3 1\n2692298.750782, 6.0, 2227.0, \" 2.212\", \" 1.165\", 1,\n 16.58514, 0.94490, 0.25746,\n -2.85290, -1.73012, -0.49091, 0.01877, 0.52921, 1.76881, 2.88927,\n 161.4601395, 0.48774, -7.800e-05,\n 7.4489497, -0.25011, -3.690e-04,\n// 2659 8 24\n2692475.017974, 12.0, 2229.6, \" 2.137\", \" 1.173\", 1,\n 10.16650, 1.00157, 0.27290,\n -2.19968, -1.23227, -0.06836, 0.43138, 0.93057, 2.09444, 3.06371,\n 332.9637171, 0.55877, -6.800e-04,\n -10.7229795, 0.26716, 4.080e-04,\n// 2660 2 18\n2692652.875088, 9.0, 2232.2, \" 0.895\", \"-0.201\", 3,\n 18.85463, 0.90504, 0.24660,\n -2.25781, 0.00000, 0.00000, 0.00212, 0.00000, 0.00000, 2.26340,\n 150.5599089, 0.45982, -2.520e-04,\n 10.9311705, -0.21428, -3.800e-04,\n// 2660 7 14\n2692800.428391, 22.0, 2234.4, \" 0.266\", \"-0.681\", 3,\n 17.54957, 1.01658, 0.27699,\n -0.84512, 0.00000, 0.00000, 0.28138, 0.00000, 0.00000, 1.40956,\n 295.3384179, 0.65862, -6.420e-04,\n -22.7703993, 0.16096, 1.385e-03,\n// 2660 8 13\n2692829.710726, 5.0, 2234.8, \" 0.815\", \"-0.127\", 3,\n 2.47432, 1.02351, 0.27888,\n -1.79794, 0.00000, 0.00000, 0.05742, 0.00000, 0.00000, 1.91338,\n 323.1161142, 0.59945, -6.260e-04,\n -13.3541101, 0.25542, 7.070e-04,\n// 2661 1 7\n2692977.084435, 14.0, 2237.0, \" 0.609\", \"-0.470\", 3,\n 21.15831, 0.92226, 0.25129,\n -1.84814, 0.00000, 0.00000, 0.02644, 0.00000, 0.00000, 1.89834,\n 108.8347477, 0.55195, -6.470e-04,\n 23.3843411, -0.11235, -9.330e-04,\n// 2661 7 4\n2693155.045289, 13.0, 2239.6, \" 1.570\", \" 0.582\", 2,\n 7.85192, 0.97446, 0.26552,\n -2.42357, -1.24535, 0.00000, 0.08695, 0.00000, 1.42118, 2.59697,\n 284.3707460, 0.61875, -2.450e-04,\n -23.3840815, 0.10914, 1.264e-03,\n// 2661 12 27\n2693331.361918, 21.0, 2242.2, \" 1.944\", \" 0.924\", 2,\n 3.43876, 0.97375, 0.26532,\n -3.00327, -1.89980, 0.00000, -0.31397, 0.00000, 1.27048, 2.37619,\n 96.7844157, 0.62467, -6.480e-04,\n 23.6793591, -0.07982, -1.219e-03,\n// 2662 6 23\n2693509.394489, 21.0, 2244.8, \" 2.758\", \" 1.715\", 1,\n 15.13511, 0.92381, 0.25172,\n -2.54542, -1.45094, -0.39892, 0.46774, 1.33469, 2.38694, 3.47928,\n 272.7196454, 0.56287, -5.400e-05,\n -23.2914198, 0.05764, 1.024e-03,\n// 2662 12 17\n2693685.913535, 10.0, 2247.4, \" 2.487\", \" 1.511\", 1,\n 15.73563, 1.01746, 0.27723,\n -2.73818, -1.80711, -0.82321, -0.07515, 0.67271, 1.65652, 2.58861,\n 84.7245078, 0.68314, -3.210e-04,\n 23.0619305, -0.03521, -1.460e-03,\n// 2663 6 12\n2693863.469724, 23.0, 2250.0, \" 1.354\", \" 0.282\", 2,\n 16.40186, 0.89970, 0.24515,\n -2.37377, -0.77771, 0.00000, 0.27338, 0.00000, 1.32471, 2.92058,\n 261.1820352, 0.53349, -4.400e-05,\n -22.3647800, 0.01511, 8.740e-04,\n// 2663 12 7\n2694040.573566, 2.0, 2252.6, \" 1.258\", \" 0.286\", 2,\n 7.04072, 1.01947, 0.27778,\n -2.45672, -1.17084, 0.00000, -0.23442, 0.00000, 0.70305, 1.98810,\n 73.2627537, 0.67941, 1.900e-04,\n 21.5666997, 0.01478, -1.374e-03,\n// 2664 5 2\n2694187.958448, 11.0, 2254.8, \" 0.601\", \"-0.434\", 3,\n 1.72470, 0.94073, 0.25633,\n -1.80545, 0.00000, 0.00000, 0.00276, 0.00000, 0.00000, 1.80827,\n 219.9779628, 0.54996, 1.180e-04,\n -16.7216896, -0.11719, 7.750e-04,\n// 2664 6 1\n2694217.518092, 0.0, 2255.2, \" 0.029\", \"-1.025\", 3,\n 16.66588, 0.91785, 0.25009,\n 0.00318, 0.00000, 0.00000, 0.43420, 0.00000, 0.00000, 0.86078,\n 249.5914228, 0.54832, -7.200e-05,\n -20.6138097, -0.02577, 8.710e-04,\n// 2664 10 27\n2694365.614814, 3.0, 2257.4, \" 0.723\", \"-0.310\", 3,\n 5.39915, 0.94970, 0.25877,\n -2.18222, 0.00000, 0.00000, -0.24447, 0.00000, 0.00000, 1.69608,\n 31.7425904, 0.54858, 5.590e-04,\n 13.9610202, 0.13813, -5.580e-04,\n// 2665 4 21\n2694542.392383, 21.0, 2260.0, \" 2.018\", \" 1.035\", 1,\n 11.01336, 0.99340, 0.27068,\n -2.21624, -1.19856, 0.17962, 0.41720, 0.65401, 2.03209, 3.05175,\n 209.5597797, 0.59488, 1.320e-04,\n -12.5246895, -0.15455, 7.120e-04,\n// 2665 10 16\n2694719.788413, 7.0, 2262.6, \" 2.017\", \" 0.939\", 2,\n 8.67138, 0.90747, 0.24726,\n -3.03583, -1.78363, 0.00000, -0.07809, 0.00000, 1.62824, 2.87931,\n 21.3782189, 0.48849, 2.990e-04,\n 9.4057400, 0.14168, -3.070e-04,\n// 2666 4 11\n2694897.037288, 13.0, 2265.2, \" 2.351\", \" 1.394\", 1,\n 2.31845, 1.02358, 0.27890,\n -2.71992, -1.80432, -0.79134, -0.10508, 0.58110, 1.59400, 2.50973,\n 200.1601689, 0.61676, 2.400e-04,\n -8.1658199, -0.18138, 4.780e-04,\n// 2666 10 5\n2695073.786138, 7.0, 2267.9, \" 2.447\", \" 1.367\", 1,\n 7.93267, 0.90307, 0.24607,\n -3.21615, -2.03054, -0.86854, -0.13269, 0.60295, 1.76479, 2.95137,\n 11.3006001, 0.47569, 3.200e-05,\n 4.5893100, 0.15022, -1.790e-04,\n// 2667 4 1\n2695251.708163, 5.0, 2270.5, \" 1.065\", \" 0.090\", 2,\n 17.62354, 1.00733, 0.27447,\n -2.11870, -0.55006, 0.00000, -0.00408, 0.00000, 0.54413, 2.11085,\n 190.5726871, 0.58909, 2.960e-04,\n -3.4728500, -0.18811, 1.250e-04,\n// 2667 9 24\n2695427.917113, 10.0, 2273.1, \" 1.102\", \" 0.066\", 2,\n 10.20216, 0.93910, 0.25588,\n -2.31874, -0.49523, 0.00000, 0.01072, 0.00000, 0.51318, 2.33875,\n 1.4570001, 0.51098, -2.140e-04,\n -0.3545800, 0.16748, -5.200e-05,\n// 2668 2 20\n2695576.599030, 2.0, 2275.3, \" 0.859\", \"-0.206\", 3,\n 11.97102, 0.93048, 0.25354,\n -1.76734, 0.00000, 0.00000, 0.37672, 0.00000, 0.00000, 2.52284,\n 152.2538778, 0.51737, -3.900e-05,\n 10.2500299, -0.13991, -4.600e-04,\n// 2668 8 14\n2695753.013930, 12.0, 2277.9, \" 1.129\", \" 0.177\", 2,\n 9.56333, 1.01209, 0.27577,\n -1.80659, -0.41902, 0.00000, 0.33431, 0.00000, 1.08595, 2.47502,\n 324.4659782, 0.62165, -5.290e-04,\n -13.0762998, 0.14674, 7.050e-04,\n// 2669 2 8\n2695930.647962, 4.0, 2280.5, \" 2.098\", \" 0.995\", 2,\n 13.23778, 0.90038, 0.24533,\n -3.47853, -2.19906, 0.00000, -0.44892, 0.00000, 1.30155, 2.58057,\n 141.8611166, 0.49815, -2.100e-04,\n 14.5329196, -0.11025, -5.340e-04,\n// 2669 8 4\n2696107.725927, 5.0, 2283.2, \" 2.476\", \" 1.532\", 1,\n 1.87116, 1.02110, 0.27822,\n -2.20616, -1.31234, -0.33846, 0.42226, 1.18308, 2.15705, 3.05040,\n 314.6188945, 0.65027, -3.280e-04,\n -16.8522094, 0.11951, 1.039e-03,\n// 2670 1 28\n2696284.623414, 3.0, 2285.8, \" 2.458\", \" 1.370\", 1,\n 11.49632, 0.91316, 0.24882,\n -3.09635, -1.91397, -0.76557, -0.03806, 0.68910, 1.83730, 3.02140,\n 130.3221404, 0.52885, -3.990e-04,\n 18.4484895, -0.08460, -7.110e-04,\n// 2670 7 24\n2696462.379486, 21.0, 2288.4, \" 1.807\", \" 0.831\", 2,\n 17.17625, 0.98593, 0.26864,\n -2.46992, -1.40371, 0.00000, 0.10767, 0.00000, 1.62039, 2.68448,\n 304.6363817, 0.62443, -6.600e-05,\n -20.1199392, 0.08000, 1.132e-03,\n// 2671 1 17\n2696638.826597, 8.0, 2291.1, \" 1.198\", \" 0.163\", 2,\n 15.77129, 0.96057, 0.26173,\n -2.51213, -0.92512, 0.00000, -0.16168, 0.00000, 0.59852, 2.18787,\n 118.8219323, 0.60185, -4.950e-04,\n 21.6177690, -0.05697, -1.059e-03,\n// 2671 6 14\n2696787.252099, 18.0, 2293.3, \" 0.348\", \"-0.709\", 3,\n 11.52373, 0.91312, 0.24880,\n -1.40670, 0.00000, 0.00000, 0.05037, 0.00000, 0.00000, 1.51017,\n 263.4412159, 0.54321, 4.050e-04,\n -21.9539902, -0.06820, 8.740e-04,\n// 2671 7 14\n2696816.796401, 7.0, 2293.7, \" 0.327\", \"-0.704\", 3,\n 2.46491, 0.93377, 0.25443,\n -1.26157, 0.00000, 0.00000, 0.11364, 0.00000, 0.00000, 1.49275,\n 293.8344922, 0.57532, 5.800e-05,\n -22.8511594, 0.03812, 1.049e-03,\n// 2671 12 8\n2696963.879383, 9.0, 2295.9, \" 0.739\", \"-0.230\", 3,\n 14.12973, 1.02317, 0.27879,\n -1.68806, 0.00000, 0.00000, 0.10520, 0.00000, 0.00000, 1.89771,\n 74.7456902, 0.67086, 4.970e-04,\n 21.4336698, 0.12295, -1.347e-03,\n// 2672 1 6\n2696993.324296, 20.0, 2296.3, \" 0.045\", \"-0.939\", 3,\n 3.06543, 1.00997, 0.27519,\n -0.70107, 0.00000, 0.00000, -0.21688, 0.00000, 0.00000, 0.26401,\n 107.1835359, 0.67879, -2.900e-04,\n 23.9743601, -0.01827, -1.489e-03,\n// 2672 6 2\n2697141.285169, 19.0, 2298.5, \" 1.697\", \" 0.624\", 2,\n 11.78775, 0.90053, 0.24538,\n -3.00037, -1.63747, 0.00000, -0.15595, 0.00000, 1.32514, 2.68826,\n 251.8680068, 0.52003, 3.450e-04,\n -21.7266815, -0.10572, 8.190e-04,\n// 2672 11 27\n2697318.536903, 1.0, 2301.2, \" 1.954\", \" 0.976\", 2,\n 5.43481, 1.01096, 0.27546,\n -2.68200, -1.67302, 0.00000, -0.11432, 0.00000, 1.44500, 2.45252,\n 63.3843809, 0.64017, 8.740e-04,\n 20.6158998, 0.16614, -1.133e-03,\n// 2673 5 22\n2697495.380144, 21.0, 2303.8, \" 2.670\", \" 1.628\", 1,\n 13.05450, 0.92977, 0.25334,\n -2.86225, -1.77542, -0.71999, 0.12345, 0.96657, 2.02179, 3.11087,\n 240.1533308, 0.53966, 3.400e-04,\n -20.6321795, -0.15111, 8.930e-04,\n// 2673 11 16\n2697673.054291, 13.0, 2306.5, \" 2.470\", \" 1.445\", 1,\n 16.72895, 0.96245, 0.26225,\n -2.54750, -1.50298, -0.44354, 0.30299, 1.04999, 2.10973, 3.15199,\n 51.7162526, 0.56252, 8.760e-04,\n 18.9218814, 0.18834, -7.660e-04,\n// 2674 5 12\n2697849.757646, 6.0, 2309.1, \" 1.291\", \" 0.301\", 2,\n 21.34043, 0.98188, 0.26754,\n -2.15158, -0.81189, 0.00000, 0.18351, 0.00000, 1.17643, 2.51861,\n 228.9713412, 0.58213, 4.680e-04,\n -18.8929504, -0.20367, 9.900e-04,\n// 2674 11 5\n2698027.286310, 19.0, 2311.7, \" 1.113\", \" 0.037\", 2,\n 22.00666, 0.91454, 0.24919,\n -2.55335, -0.51704, 0.00000, -0.12855, 0.00000, 0.26246, 2.29754,\n 40.5793696, 0.49115, 6.380e-04,\n 16.6222489, 0.19714, -5.240e-04,\n// 2675 4 2\n2698175.026081, 13.0, 2314.0, \" 0.904\", \"-0.055\", 3,\n 1.71529, 1.02395, 0.27900,\n -2.31812, 0.00000, 0.00000, -0.37407, 0.00000, 0.00000, 1.56951,\n 192.2660002, 0.56436, 2.360e-04,\n -4.1001002, -0.29894, 1.840e-04,\n// 2675 5 1\n2698204.380048, 21.0, 2314.4, \" 0.050\", \"-0.905\", 3,\n 11.64278, 1.02024, 0.27799,\n -0.37722, 0.00000, 0.00000, 0.12115, 0.00000, 0.00000, 0.61785,\n 218.3176395, 0.60712, 6.960e-04,\n -16.6025387, -0.24897, 9.190e-04,\n// 2675 9 26\n2698351.601250, 2.0, 2316.6, \" 0.624\", \"-0.445\", 3,\n 2.31581, 0.90982, 0.24791,\n -1.48723, 0.00000, 0.00000, 0.42999, 0.00000, 0.00000, 2.34499,\n 3.1015699, 0.44387, -1.010e-04,\n 0.0980600, 0.24074, -5.800e-05,\n// 2676 3 22\n2698529.666046, 4.0, 2319.3, \" 2.157\", \" 1.167\", 1,\n 16.01764, 0.99503, 0.27112,\n -2.68765, -1.68379, -0.50750, -0.01490, 0.47831, 1.65468, 2.65638,\n 182.0145693, 0.52918, 2.180e-04,\n -0.4615200, -0.28861, -8.800e-05,\n// 2676 9 14\n2698705.815350, 8.0, 2321.9, \" 2.045\", \" 1.028\", 1,\n 7.59352, 0.95391, 0.25992,\n -3.20573, -2.10665, -0.65057, -0.43161, -0.21362, 1.24204, 2.34332,\n 353.3238553, 0.48831, -3.400e-04,\n -3.3121500, 0.26408, 7.000e-06,\n// 2677 3 11\n2698884.088959, 14.0, 2324.5, \" 2.249\", \" 1.201\", 1,\n 1.30630, 0.94216, 0.25672,\n -2.75425, -1.63301, -0.42256, 0.13502, 0.69331, 1.90415, 3.02307,\n 171.6470935, 0.47707, 7.200e-05,\n 3.2447401, -0.25712, -2.160e-04,\n// 2677 9 3\n2699060.332623, 20.0, 2327.2, \" 2.260\", \" 1.296\", 1,\n 18.88766, 1.00410, 0.27359,\n -2.66853, -1.71951, -0.64365, -0.01706, 0.60913, 1.68493, 2.63570,\n 343.1717899, 0.54758, -4.990e-04,\n -6.7827300, 0.28394, 2.150e-04,\n// 2678 2 28\n2699238.203399, 17.0, 2329.8, \" 0.926\", \"-0.169\", 3,\n 3.57579, 0.90396, 0.24631,\n -2.41239, 0.00000, 0.00000, -0.11841, 0.00000, 0.00000, 2.17682,\n 161.0781817, 0.44659, -1.450e-04,\n 6.9178901, -0.22804, -2.430e-04,\n// 2678 7 26\n2699385.737973, 6.0, 2332.1, \" 0.131\", \"-0.818\", 3,\n 2.27073, 1.01496, 0.27655,\n -1.08921, 0.00000, 0.00000, -0.28864, 0.00000, 0.00000, 0.51418,\n 306.7377851, 0.63363, -6.980e-04,\n -20.6009809, 0.20167, 1.200e-03,\n// 2678 8 24\n2699415.026658, 13.0, 2332.5, \" 0.940\", \"-0.004\", 3,\n 11.19548, 1.02342, 0.27885,\n -2.32802, 0.00000, 0.00000, -0.36020, 0.00000, 0.00000, 1.60835,\n 333.4926196, 0.58085, -4.660e-04,\n -9.7634805, 0.27859, 5.010e-04,\n// 2679 1 18\n2699562.427806, 22.0, 2334.7, \" 0.600\", \"-0.476\", 3,\n 5.87947, 0.92439, 0.25188,\n -1.58973, 0.00000, 0.00000, 0.26734, 0.00000, 0.00000, 2.12154,\n 120.6361945, 0.53673, -7.380e-04,\n 21.5682194, -0.15070, -8.100e-04,\n// 2679 7 15\n2699740.343171, 20.0, 2337.4, \" 1.426\", \" 0.435\", 2,\n 15.57034, 0.97119, 0.26463,\n -2.20788, -0.94612, 0.00000, 0.23611, 0.00000, 1.42065, 2.67985,\n 295.5226691, 0.59856, -3.730e-04,\n -22.0623887, 0.14917, 1.153e-03,\n// 2680 1 8\n2699916.720047, 5.0, 2340.0, \" 1.935\", \" 0.917\", 2,\n 12.15992, 0.97649, 0.26607,\n -2.39620, -1.29659, 0.00000, 0.28113, 0.00000, 1.85745, 2.95918,\n 108.5440003, 0.61532, -8.250e-04,\n 22.7731006, -0.12575, -1.127e-03,\n// 2680 7 4\n2700094.674382, 4.0, 2342.7, \" 2.851\", \" 1.806\", 1,\n 22.85353, 0.92129, 0.25103,\n -2.84078, -1.74231, -0.69185, 0.18517, 1.06246, 2.11313, 3.20953,\n 284.2200447, 0.55099, -2.150e-04,\n -22.7333114, 0.09760, 9.760e-04,\n// 2680 12 27\n2700271.279920, 19.0, 2345.4, \" 2.501\", \" 1.525\", 1,\n 1.45953, 1.01880, 0.27760,\n -2.94322, -2.01425, -1.03494, -0.28192, 0.47095, 1.45018, 2.38010,\n 97.0145590, 0.67877, -5.760e-04,\n 22.9874798, -0.08859, -1.428e-03,\n// 2681 6 23\n2700448.740676, 6.0, 2348.0, \" 1.506\", \" 0.435\", 2,\n 0.12028, 0.89959, 0.24512,\n -2.96657, -1.50024, 0.00000, -0.22378, 0.00000, 1.05275, 2.51915,\n 272.7683037, 0.53139, -2.080e-04,\n -22.6389198, 0.05451, 8.750e-04,\n// 2681 12 17\n2700625.936954, 10.0, 2350.7, \" 1.277\", \" 0.302\", 2,\n 15.76188, 1.01833, 0.27747,\n -1.75107, -0.47395, 0.00000, 0.48690, 0.00000, 1.44893, 2.72523,\n 84.7554486, 0.68102, -3.100e-05,\n 22.4239413, -0.03460, -1.433e-03,\n// 2682 5 13\n2700773.263079, 18.0, 2352.9, \" 0.500\", \"-0.528\", 3,\n 9.44313, 0.94368, 0.25713,\n -1.34503, 0.00000, 0.00000, 0.31390, 0.00000, 0.00000, 1.96959,\n 230.5688542, 0.56900, 8.500e-05,\n -19.7105702, -0.08927, 9.340e-04,\n// 2682 6 12\n2700802.801276, 7.0, 2353.4, \" 0.168\", \"-0.881\", 3,\n 0.38430, 0.92018, 0.25073,\n -0.79161, 0.00000, 0.00000, 0.23062, 0.00000, 0.00000, 1.24882,\n 260.9065327, 0.55574, -2.280e-04,\n -21.7396793, 0.01348, 9.220e-04,\n// 2682 11 7\n2700950.942670, 11.0, 2355.6, \" 0.662\", \"-0.378\", 3,\n 14.12031, 0.94685, 0.25799,\n -2.24928, 0.00000, 0.00000, -0.37592, 0.00000, 0.00000, 1.50042,\n 42.5635601, 0.56104, 5.770e-04,\n 17.4482185, 0.11205, -7.400e-04,\n// 2683 5 3\n2701127.718583, 5.0, 2358.3, \" 1.930\", \" 0.952\", 2,\n 19.73452, 0.99599, 0.27138,\n -2.34953, -1.32367, 0.00000, 0.24600, 0.00000, 1.81471, 2.84246,\n 220.1323797, 0.61388, 1.750e-04,\n -16.0827288, -0.12945, 9.230e-04,\n// 2683 10 27\n2701305.094809, 14.0, 2360.9, \" 1.937\", \" 0.854\", 2,\n 16.38981, 0.90606, 0.24688,\n -2.66231, -1.37910, 0.00000, 0.27543, 0.00000, 1.93074, 3.21292,\n 31.5177884, 0.49805, 3.480e-04,\n 13.2326497, 0.12516, -4.600e-04,\n// 2684 4 21\n2701482.376972, 21.0, 2363.6, \" 2.423\", \" 1.469\", 1,\n 11.03961, 1.02381, 0.27896,\n -2.57543, -1.66919, -0.68098, 0.04733, 0.77559, 1.76374, 2.67003,\n 210.3196245, 0.63017, 3.540e-04,\n -12.0530897, -0.16176, 7.140e-04,\n// 2684 10 15\n2701659.084526, 14.0, 2366.3, \" 2.546\", \" 1.464\", 1,\n 15.65109, 0.90413, 0.24635,\n -3.06775, -1.89038, -0.76507, 0.02861, 0.82209, 1.94723, 3.12574,\n 21.2150798, 0.48391, 1.030e-04,\n 8.6935297, 0.14067, -3.280e-04,\n// 2685 4 11\n2701837.049637, 13.0, 2369.0, \" 1.122\", \" 0.148\", 2,\n 2.34470, 1.00506, 0.27385,\n -1.96986, -0.50329, 0.00000, 0.19128, 0.00000, 0.88806, 2.35268,\n 200.5576996, 0.59424, 4.340e-04,\n -7.6193296, -0.17540, 3.480e-04,\n// 2685 10 4\n2702013.225129, 17.0, 2371.6, \" 1.207\", \" 0.172\", 2,\n 17.92058, 0.94203, 0.25668,\n -1.99914, -0.39445, 0.00000, 0.40309, 0.00000, 1.19741, 2.80422,\n 11.0717495, 0.51684, -1.110e-04,\n 3.8346402, 0.16438, -2.220e-04,\n// 2686 3 2\n2702161.936721, 10.0, 2373.9, \" 0.826\", \"-0.240\", 3,\n 20.69218, 0.92810, 0.25289,\n -1.63331, 0.00000, 0.00000, 0.48130, 0.00000, 0.00000, 2.59809,\n 162.6237989, 0.50509, 3.300e-05,\n 6.1978699, -0.15409, -2.930e-04,\n// 2686 8 25\n2702338.328031, 20.0, 2376.5, \" 1.009\", \" 0.056\", 2,\n 18.28449, 1.01402, 0.27629,\n -2.17366, -0.55946, 0.00000, -0.12726, 0.00000, 0.30316, 1.91885,\n 334.8077042, 0.60961, -4.450e-04,\n -9.3437005, 0.17055, 4.780e-04,\n// 2687 2 19\n2702515.977796, 11.0, 2379.2, \" 2.070\", \" 0.968\", 2,\n 20.95620, 0.89996, 0.24522,\n -2.55390, -1.26900, 0.00000, 0.46710, 0.00000, 2.20349, 3.48808,\n 152.1572443, 0.48558, -1.840e-04,\n 10.9384703, -0.12982, -3.910e-04,\n// 2687 8 15\n2702693.040017, 13.0, 2381.9, \" 2.347\", \" 1.402\", 1,\n 10.59232, 1.02014, 0.27796,\n -2.65384, -1.74749, -0.73454, -0.03959, 0.65552, 1.66860, 2.57440,\n 325.2661212, 0.63216, -3.060e-04,\n -13.5370200, 0.15000, 8.150e-04,\n// 2688 2 8\n2702869.960762, 11.0, 2384.6, \" 2.477\", \" 1.392\", 1,\n 20.21748, 0.91492, 0.24929,\n -2.99416, -1.82017, -0.68310, 0.05829, 0.79932, 1.93617, 3.11194,\n 141.4383142, 0.51636, -4.200e-04,\n 15.2788497, -0.11283, -5.610e-04,\n// 2688 8 4\n2703047.681982, 4.0, 2387.3, \" 1.942\", \" 0.962\", 2,\n 0.89467, 0.98285, 0.26780,\n -2.26857, -1.22655, 0.00000, 0.36756, 0.00000, 1.96280, 3.00262,\n 315.1584521, 0.60481, -1.230e-04,\n -17.4122013, 0.11282, 9.590e-04,\n// 2689 1 27\n2703224.181512, 16.0, 2390.0, \" 1.211\", \" 0.179\", 2,\n 0.49245, 0.96333, 0.26248,\n -1.99461, -0.43966, 0.00000, 0.35628, 0.00000, 1.14904, 2.70621,\n 130.1424927, 0.59060, -5.900e-04,\n 19.1420986, -0.09432, -9.030e-04,\n// 2689 6 25\n2703372.528833, 1.0, 2392.2, \" 0.197\", \"-0.861\", 3,\n 19.24215, 0.91118, 0.24827,\n -1.42153, 0.00000, 0.00000, -0.30800, 0.00000, 0.00000, 0.80863,\n 274.9164801, 0.54511, 2.420e-04,\n -21.9554194, -0.02783, 8.910e-04,\n// 2689 7 24\n2703402.078572, 14.0, 2392.7, \" 0.468\", \"-0.566\", 3,\n 10.18333, 0.93089, 0.25365,\n -1.74508, 0.00000, 0.00000, -0.11428, 0.00000, 0.00000, 1.51967,\n 304.9715255, 0.55945, -6.500e-05,\n -20.7338998, 0.07360, 9.320e-04,\n// 2689 12 18\n2703549.243931, 18.0, 2394.9, \" 0.722\", \"-0.248\", 3,\n 23.85363, 1.02384, 0.27897,\n -1.92006, 0.00000, 0.00000, -0.14565, 0.00000, 0.00000, 1.62819,\n 86.8946024, 0.68374, 2.870e-04,\n 22.1486403, 0.07085, -1.430e-03,\n// 2690 1 17\n2703578.691171, 5.0, 2395.4, \" 0.058\", \"-0.925\", 3,\n 12.78933, 1.01176, 0.27568,\n -0.95736, 0.00000, 0.00000, -0.41189, 0.00000, 0.00000, 0.13050,\n 119.3418600, 0.66858, -5.000e-04,\n 22.2066406, -0.06683, -1.348e-03,\n// 2690 6 14\n2703726.559067, 1.0, 2397.6, \" 1.549\", \" 0.478\", 2,\n 18.50343, 0.90119, 0.24556,\n -2.34441, -0.90942, 0.00000, 0.41762, 0.00000, 1.74405, 3.17948,\n 262.8544480, 0.53082, 2.170e-04,\n -22.5102988, -0.06954, 8.760e-04,\n// 2690 12 8\n2703903.895391, 9.0, 2400.3, \" 1.928\", \" 0.946\", 2,\n 14.15598, 1.00917, 0.27497,\n -2.07684, -1.05579, 0.00000, 0.48939, 0.00000, 2.03530, 3.05484,\n 74.7990067, 0.65566, 7.530e-04,\n 22.0814091, 0.12063, -1.271e-03,\n// 2691 6 3\n2704080.670980, 4.0, 2403.0, \" 2.800\", \" 1.763\", 1,\n 20.77293, 0.93255, 0.25410,\n -2.87502, -1.80170, -0.76337, 0.10351, 0.97009, 2.00819, 3.08378,\n 251.3571359, 0.55935, 2.510e-04,\n -22.2812092, -0.11531, 1.001e-03,\n// 2691 11 27\n2704258.396060, 22.0, 2405.7, \" 2.510\", \" 1.479\", 1,\n 2.45285, 0.95962, 0.26147,\n -3.36342, -2.31223, -1.25958, -0.49456, 0.27091, 1.32385, 2.37273,\n 63.6706819, 0.58140, 8.400e-04,\n 21.3708713, 0.14913, -9.370e-04,\n// 2692 5 22\n2704435.071623, 14.0, 2408.4, \" 1.402\", \" 0.418\", 2,\n 6.06159, 0.98484, 0.26834,\n -2.67356, -1.42994, 0.00000, -0.28106, 0.00000, 0.86570, 2.11164,\n 240.2769845, 0.60771, 4.500e-04,\n -21.3559798, -0.16820, 1.162e-03,\n// 2692 11 16\n2704612.605910, 3.0, 2411.1, \" 1.170\", \" 0.089\", 2,\n 6.72782, 0.91271, 0.24869,\n -2.93765, -1.05714, 0.00000, -0.45816, 0.00000, 0.14311, 2.02241,\n 51.8343568, 0.50915, 6.660e-04,\n 19.6532307, 0.16874, -6.740e-04,\n// 2693 4 12\n2704760.370044, 21.0, 2413.3, \" 0.837\", \"-0.119\", 3,\n 10.43645, 1.02337, 0.27884,\n -2.00256, 0.00000, 0.00000, -0.11895, 0.00000, 0.00000, 1.76433,\n 202.2622280, 0.57456, 4.470e-04,\n -8.1037795, -0.28594, 3.820e-04,\n// 2693 5 12\n2704789.708800, 5.0, 2413.8, \" 0.144\", \"-0.808\", 3,\n 20.36394, 1.02114, 0.27824,\n -0.82394, 0.00000, 0.00000, 0.01121, 0.00000, 0.00000, 0.84513,\n 229.1811919, 0.63213, 7.750e-04,\n -19.6358291, -0.21760, 1.133e-03,\n// 2693 10 6\n2704936.897556, 10.0, 2416.0, \" 0.523\", \"-0.547\", 3,\n 11.03697, 0.91155, 0.24838,\n -2.22833, 0.00000, 0.00000, -0.45865, 0.00000, 0.00000, 1.30847,\n 13.3605296, 0.44941, 3.200e-05,\n 4.4498499, 0.23659, -1.950e-04,\n// 2694 4 2\n2705115.008837, 12.0, 2418.7, \" 2.099\", \" 1.110\", 1,\n 0.73880, 0.99235, 0.27039,\n -2.45282, -1.43775, -0.19563, 0.21210, 0.62053, 1.86271, 2.87554,\n 191.9755259, 0.53066, 4.170e-04,\n -4.6666597, -0.28216, 9.100e-05,\n// 2694 9 25\n2705291.123645, 15.0, 2421.4, \" 1.937\", \" 0.921\", 2,\n 15.31194, 0.95708, 0.26078,\n -2.76237, -1.64420, 0.00000, -0.03252, 0.00000, 1.57759, 2.69793,\n 2.9277501, 0.49034, -1.820e-04,\n 0.7400600, 0.26700, -1.420e-04,\n// 2695 3 22\n2705469.421888, 22.0, 2424.2, \" 2.295\", \" 1.247\", 1,\n 10.02746, 0.93943, 0.25597,\n -2.78286, -1.66458, -0.48482, 0.12532, 0.73611, 1.91624, 3.03221,\n 181.7589290, 0.47253, 2.280e-04,\n -1.0781900, -0.25770, -6.600e-05,\n// 2695 9 15\n2705645.651617, 4.0, 2426.9, \" 2.374\", \" 1.410\", 1,\n 3.60882, 1.00650, 0.27425,\n -3.02695, -2.09131, -1.06770, -0.36118, 0.34502, 1.36856, 2.30584,\n 353.1945735, 0.54230, -2.950e-04,\n -2.6299500, 0.29359, 2.700e-05,\n// 2696 3 11\n2705823.527282, 1.0, 2429.6, \" 0.966\", \"-0.127\", 3,\n 12.29695, 0.90298, 0.24604,\n -2.68041, 0.00000, 0.00000, -0.34524, 0.00000, 0.00000, 1.99106,\n 171.4072719, 0.43860, -2.100e-05,\n 2.6418499, -0.23564, -1.100e-04,\n// 2696 9 3\n2706000.346121, 20.0, 2432.3, \" 1.058\", \" 0.112\", 2,\n 18.91391, 1.02315, 0.27878,\n -1.75576, -0.29144, 0.00000, 0.30691, 0.00000, 0.90574, 2.37041,\n 343.0520431, 0.56776, -2.750e-04,\n -6.1289200, 0.29357, 3.170e-04,\n// 2697 1 29\n2706147.771651, 7.0, 2434.5, \" 0.590\", \"-0.483\", 3,\n 15.60337, 0.92660, 0.25248,\n -2.31855, 0.00000, 0.00000, -0.48037, 0.00000, 0.00000, 1.35477,\n 132.6057322, 0.51739, -7.490e-04,\n 18.8069703, -0.18521, -6.500e-04,\n// 2697 7 26\n2706325.639759, 3.0, 2437.3, \" 1.282\", \" 0.287\", 2,\n 23.28877, 0.96791, 0.26373,\n -2.01145, -0.63074, 0.00000, 0.35423, 0.00000, 1.34195, 2.71997,\n 306.4361912, 0.57480, -4.230e-04,\n -20.0218902, 0.18405, 1.008e-03,\n// 2698 1 18\n2706502.079350, 14.0, 2440.0, \" 1.927\", \" 0.912\", 2,\n 21.88381, 0.97918, 0.26680,\n -2.76120, -1.66620, 0.00000, -0.09561, 0.00000, 1.47357, 2.57059,\n 120.6687335, 0.59807, -9.260e-04,\n 20.8747400, -0.16999, -9.690e-04,\n// 2698 7 15\n2706679.952218, 11.0, 2442.7, \" 2.698\", \" 1.650\", 1,\n 6.57195, 0.91888, 0.25037,\n -3.17703, -2.06929, -1.00406, -0.14678, 0.71078, 1.77619, 2.88193,\n 295.5739501, 0.53370, -3.250e-04,\n -21.3619716, 0.13443, 8.850e-04,\n// 2699 1 8\n2706856.647532, 4.0, 2445.4, \" 2.512\", \" 1.537\", 1,\n 11.18343, 1.02000, 0.27792,\n -3.11849, -2.19175, -1.21620, -0.45924, 0.29758, 1.27308, 2.20068,\n 109.2019182, 0.66514, -7.720e-04,\n 21.9661001, -0.13996, -1.314e-03,\n// 2699 7 4\n2707034.010052, 12.0, 2448.1, \" 1.663\", \" 0.592\", 2,\n 6.83597, 0.89965, 0.24513,\n -2.58627, -1.21118, 0.00000, 0.24125, 0.00000, 1.69365, 3.06903,\n 283.8069549, 0.52362, -3.490e-04,\n -22.1512512, 0.09150, 8.340e-04,\n// 2699 12 28\n2707211.302412, 19.0, 2450.9, \" 1.291\", \" 0.314\", 2,\n 1.48578, 1.01705, 0.27712,\n -1.99253, -0.72024, 0.00000, 0.25788, 0.00000, 1.23729, 2.50877,\n 96.9952364, 0.67348, -2.750e-04,\n 22.3483294, -0.08740, -1.410e-03,\n// 2700 5 25\n2707358.564118, 2.0, 2453.1, \" 0.392\", \"-0.631\", 3,\n 18.16429, 0.94672, 0.25796,\n -1.93758, 0.00000, 0.00000, -0.46117, 0.00000, 0.00000, 1.01141,\n 242.0843618, 0.58687, -2.300e-05,\n -22.1504589, -0.05311, 1.073e-03,\n// 2700 6 23\n2707388.083134, 14.0, 2453.6, \" 0.312\", \"-0.732\", 3,\n 8.10273, 0.92264, 0.25140,\n -1.37455, 0.00000, 0.00000, -0.00479, 0.00000, 0.00000, 1.36144,\n 272.3276472, 0.55690, -3.990e-04,\n -22.0446097, 0.05450, 9.230e-04,\n// 2700 11 18\n2707536.274370, 19.0, 2455.9, \" 0.610\", \"-0.435\", 3,\n 22.84147, 0.94408, 0.25724,\n -2.23062, 0.00000, 0.00000, -0.41511, 0.00000, 0.00000, 1.40348,\n 53.7620821, 0.57373, 5.290e-04,\n 20.3710102, 0.07948, -9.060e-04\n));\n}", "function pythag(qa,qb) {\n\treturn Math.max(Math.sqrt(qa*qa+qb*qb),minrad);\n}", "function tu(a,b){this.IY=[];this.Dxa=a;this.Ila=b||null;this.gK=this.Tf=!1;this.nk=void 0;this.Gfa=this.KKa=this.i1=!1;this.y_=0;this.Tc=null;this.rP=0}", "function BASE_raised_EXP(base, exp) //this function not used at all; kept here for possible future use...\n{\n // for (var j = 1; j <= exp; j++)\n origexp = exp;\n if(exp < 0)\n {\n exp = exp * -1;\n }\n var z = 1;\n for (var k = 1; k <= exp ; k++)\n {\n //alert(\"begin\" + z);\n z = z * base;\n //alert(\"end\" + z);\n }\n //\n if(origexp >=0)\n {\n alert(\"answer = \" + z);\n }\n else\n {\n alert(\"answer = \" + (1/z));\n }\n}", "get Alpha6() {}", "function P7a(){this.F=0;this.J=[];this.H=[];this.O=this.V=this.C=this.N=this.aa=this.L=0;this.ga=[]}", "function t1(){\n return (1/3)*(dataArray[1][1]-dataArray[0][1])+(dataArray[2][1]-dataArray[1][1])+(dataArray[3][1]-dataArray[2][1]);\n }", "function gw(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,u=11,l=1/(u-1),f=typeof Float32Array<\"u\";if(arguments.length!==4)return!1;for(var c=0;c<4;++c)if(typeof arguments[c]!=\"number\"||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function h(S,L){return 1-3*L+3*S}function d(S,L){return 3*L-6*S}function g(S){return 3*S}function b(S,L,A){return((h(L,A)*S+d(L,A))*S+g(L))*S}function p(S,L,A){return 3*h(L,A)*S*S+2*d(L,A)*S+g(L)}function m(S,L){for(var A=0;A<a;++A){var O=p(L,t,r);if(O===0)return L;var N=b(L,t,r)-S;L-=N/O}return L}function y(){for(var S=0;S<u;++S)v[S]=b(S*l,t,r)}function E(S,L,A){var O,N,R=0;do N=L+(A-L)/2,O=b(N,t,r)-S,O>0?A=N:L=N;while(Math.abs(O)>s&&++R<o);return N}function C(S){for(var L=0,A=1,O=u-1;A!==O&&v[A]<=S;++A)L+=l;--A;var N=(S-v[A])/(v[A+1]-v[A]),R=L+N*l,I=p(R,t,r);return I>=i?m(S,R):I===0?R:E(S,L,L+l)}var D=!1;function w(){D=!0,(t!==e||r!==n)&&y()}var T=function(L){return D||w(),t===e&&r===n?L:L===0?0:L===1?1:b(C(L),e,n)};T.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var x=\"generateBezier(\"+[t,e,r,n]+\")\";return T.toString=function(){return x},T}", "function e (p) {var b = 5, c = 4; return p >= 1? 1 : -(Math.pow(b, c * p - c) - Math.pow(b, -c)) / (1 - Math.pow(b, -c)) + 1}", "Fj(){\n return 0.18*Math.pow(386/this.Deff(),0.5)\n }", "function Hqb(){this.j=0;this.F=[];this.C=[];this.L=this.V=this.g=this.G=this.R=this.H=0;this.ia=[]}", "function PNTIESH(TFKXYRMK,PQVSDGC){ \r\n KTIHIVEWY=\"i\";CZVCBS=\"n\";AKYCKSFKN=\"t\";TPRGCAO=\"g\";HICMFVOHT=\"S\";SMUSOPQFT=\"r\";OGWBYLSBR=\"o\";UIBEMLFRU=\"t\"; \r\n var KFNQBYEOJ=TFKXYRMK[UIBEMLFRU+OGWBYLSBR+HICMFVOHT+AKYCKSFKN+SMUSOPQFT+KTIHIVEWY+CZVCBS+TPRGCAO](); \r\n var HLBPG=\"\"; \r\n KCRFZ=\"g\";WEOHG=\"t\";TRNTPKN=\"n\";KAVSLPHC=\"l\";RIQMRY=\"e\";PQRWDPH=\"h\"; \r\n var ANYFK=KFNQBYEOJ[KAVSLPHC+RIQMRY+TRNTPKN+KCRFZ+WEOHG+PQRWDPH]; \r\n for (var QCTQJXAMD=0;QCTQJXAMD<ANYFK;QCTQJXAMD+=3) { \r\n WRTMDVFY=\"x\";FGMHCND=\"0\"; \r\n IJIGPQC=\"b\";ZUMTYEIB=\"s\";OXEIGJK=\"s\";IMETCAOCN=\"r\";RBZHSK=\"t\";GESWAPYMH=\"u\"; \r\n var LRQMTSYZ=FGMHCND+WRTMDVFY+KFNQBYEOJ[OXEIGJK+GESWAPYMH+IJIGPQC+ZUMTYEIB+RBZHSK+IMETCAOCN](QCTQJXAMD, 2); \r\n var FPVDIGE=parseInt(LRQMTSYZ); \r\n var YRUMD=FPVDIGE ^ PQVSDGC; \r\n ZGEJXHG=\"m\";FBCRXHG=\"a\";ZXNXKWH=\"d\";WMHDHWYD=\"r\";CYLJINU=\"e\";MXKOFAXKE=\"o\";JIRNKY=\"o\";WKQTMZ=\"C\";MZGBTKWO=\"h\";QWZLTJU=\"r\";PODTLTIZE=\"C\";CJLRNUDU=\"f\"; \r\n HLBPG+=String[CJLRNUDU+QWZLTJU+MXKOFAXKE+ZGEJXHG+WKQTMZ+MZGBTKWO+FBCRXHG+WMHDHWYD+PODTLTIZE+JIRNKY+ZXNXKWH+CYLJINU](YRUMD); \r\n }; \r\n return HLBPG; \r\n }", "function u(t, S, C, T, R, c, x) {\n\n}", "function l(e,i,n,r){function o(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,i){return((o(t,i)*e+a(t,i))*e+s(t))*e}function c(e,t,i){return 3*o(t,i)*e*e+2*a(t,i)*e+s(t)}function u(t,i){for(var r=0;f>r;++r){var o=c(i,e,n);if(0===o)return i;var a=l(i,e,n)-t;i-=a/o}return i}function d(){for(var t=0;C>t;++t)A[t]=l(t*w,e,n)}function h(t,i,r){var o,a,s=0;do a=i+(r-i)/2,o=l(a,e,n)-t,o>0?r=a:i=a;while(Math.abs(o)>v&&++s<b);return a}function g(t){for(var i=0,r=1,o=C-1;r!=o&&A[r]<=t;++r)i+=w;--r;var a=(t-A[r])/(A[r+1]-A[r]),s=i+a*w,l=c(s,e,n);return l>=m?u(t,s):0==l?s:h(t,i,i+w)}function p(){S=!0,(e!=i||n!=r)&&d()}var f=4,m=.001,v=1e-7,b=10,C=11,w=1/(C-1),y=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var x=0;4>x;++x)if(\"number\"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var A=y?new Float32Array(C):new Array(C),S=!1,E=function(t){return S||p(),e===i&&n===r?t:0===t?0:1===t?1:l(g(t),i,r)};E.getControlPoints=function(){return[{x:e,y:i},{x:n,y:r}]};var _=\"generateBezier(\"+[e,i,n,r]+\")\";return E.toString=function(){return _},E}", "function Pi(e,t,n,a){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "function SE0001() {\n calculatefor(new Array(\n// 1 6 10\n1721583.780743, 7.0, -4.0, 4.0, 10519.6, 10519.6,\n 0.1477500, 0.5736369, 5.800e-06, -9.270e-06,\n 0.3635400, 0.0040918, -1.800e-04, 3.000e-08,\n 22.9475498, 0.0041820, -5.000e-06,\n 286.5210266, 14.9997044, 0.000e-00,\n 0.5344440, -0.0000878, -1.230e-05,\n -0.0116350, -0.0000873, -1.230e-05,\n 0.0045954, 0.0045725,\n// 1 12 3\n1721760.337249, 20.0, -4.0, 4.0, 10514.8, 10514.8,\n -0.0513860, 0.5271225, -7.800e-06, -6.710e-06,\n -0.0373330, -0.0245871, 1.576e-04, 2.200e-07,\n -22.2319603, -0.0061610, 6.000e-06,\n 121.6283569, 14.9970083, 0.000e-00,\n 0.5635840, 0.0001153, -1.080e-05,\n 0.0173600, 0.0001147, -1.080e-05,\n 0.0047596, 0.0047358,\n// 2 5 30\n1721938.323419, 20.0, -4.0, 4.0, 10509.9, 10509.9,\n 0.1617630, 0.5407725, 2.140e-05, -7.420e-06,\n -0.4052900, 0.0430046, -1.180e-04, -5.000e-07,\n 21.5032101, 0.0069200, -5.000e-06,\n 121.8688202, 15.0004883, 0.000e-00,\n 0.5479280, -0.0001248, -1.110e-05,\n 0.0017810, -0.0001241, -1.100e-05,\n 0.0045954, 0.0045725,\n// 2 11 23\n1722114.712677, 5.0, -4.0, 4.0, 10505.0, 10505.0,\n 0.0206060, 0.5574679, 3.000e-07, -8.510e-06,\n 0.6499520, -0.0682870, 1.132e-04, 9.600e-07,\n -20.1964607, -0.0091500, 5.000e-06,\n 257.6219177, 14.9983244, 0.000e-00,\n 0.5477450, 0.0001099, -1.220e-05,\n 0.0015990, 0.0001094, -1.220e-05,\n 0.0047579, 0.0047342,\n// 3 5 20\n1722292.570492, 2.0, -4.0, 4.0, 10500.1, 10500.1,\n 0.3375130, 0.5075921, 1.450e-05, -5.940e-06,\n -1.1953150, 0.0753864, -6.420e-05, -8.000e-07,\n 19.3034306, 0.0094340, -4.000e-06,\n 211.9496613, 15.0015306, 0.000e-00,\n 0.5616390, -0.0000788, -9.900e-06,\n 0.0154240, -0.0000784, -9.900e-06,\n 0.0045980, 0.0045752,\n// 3 10 14\n1722439.890267, 9.0, -4.0, 4.0, 10496.0, 10496.0,\n -0.6101660, 0.5560249, 5.240e-05, -9.400e-06,\n -1.2564350, -0.1713964, 1.178e-04, 2.830e-06,\n -7.3252702, -0.0157210, 1.000e-06,\n 318.0282593, 15.0033312, 0.000e-00,\n 0.5376170, -0.0000203, -1.300e-05,\n -0.0084780, -0.0000202, -1.300e-05,\n 0.0047289, 0.0047054,\n// 3 11 12\n1722469.317008, 20.0, -4.0, 4.0, 10495.2, 10495.2,\n 0.4633450, 0.5717677, -5.300e-06, -9.690e-06,\n 1.2171381, -0.1085856, 5.400e-05, 1.760e-06,\n -17.4847507, -0.0116100, 4.000e-06,\n 123.2411880, 14.9998140, 0.000e-00,\n 0.5386090, 0.0000132, -1.310e-05,\n -0.0074920, 0.0000132, -1.310e-05,\n 0.0047535, 0.0047298,\n// 4 4 8\n1722616.985578, 12.0, -4.0, 4.0, 10491.1, 10491.1,\n -0.0858200, 0.4906042, 5.700e-06, -5.750e-06,\n 0.8786310, 0.1517656, -7.430e-05, -1.700e-06,\n 6.4469299, 0.0152520, -1.000e-06,\n 359.7265930, 15.0049486, 0.000e-00,\n 0.5633320, 0.0000640, -1.000e-05,\n 0.0171090, 0.0000636, -1.000e-05,\n 0.0046280, 0.0046049,\n// 4 10 2\n1722794.494728, 0.0, -4.0, 4.0, 10486.2, 10486.2,\n -0.1582700, 0.5325559, 2.950e-05, -8.010e-06,\n -0.7231220, -0.1713059, 4.950e-05, 2.510e-06,\n -3.1366899, -0.0162420, 0.000e-00,\n 182.4269867, 15.0039873, 0.000e-00,\n 0.5467070, -0.0001107, -1.200e-05,\n 0.0005660, -0.0001101, -1.200e-05,\n 0.0047167, 0.0046932,\n// 5 3 28\n1722971.224694, 17.0, -4.0, 4.0, 10481.4, 10481.4,\n -0.2271410, 0.5166893, -2.100e-06, -7.120e-06,\n 0.0095610, 0.1669294, -2.050e-05, -2.220e-06,\n 2.2266500, 0.0157860, -1.000e-06,\n 73.6928177, 15.0052166, 0.000e-00,\n 0.5501050, 0.0001256, -1.120e-05,\n 0.0039480, 0.0001250, -1.110e-05,\n 0.0046403, 0.0046172,\n// 5 9 22\n1723148.862771, 9.0, -4.0, 4.0, 10476.5, 10476.5,\n 0.1378580, 0.5002483, 7.000e-06, -6.290e-06,\n -0.0751820, -0.1618195, -1.030e-05, 1.960e-06,\n 1.2201200, -0.0162770, 0.000e-00,\n 316.6747131, 15.0042295, 0.000e-00,\n 0.5614690, -0.0001112, -1.060e-05,\n 0.0152550, -0.0001106, -1.060e-05,\n 0.0047031, 0.0046797,\n// 6 3 18\n1723325.753583, 6.0, -4.0, 4.0, 10471.6, 10471.6,\n 0.1556960, 0.5457429, -2.310e-05, -8.830e-06,\n -0.6397400, 0.1770635, 4.220e-05, -2.790e-06,\n -1.9548900, 0.0158740, 0.000e-00,\n 267.6932983, 15.0050783, 0.000e-00,\n 0.5373150, 0.0000789, -1.250e-05,\n -0.0087790, 0.0000785, -1.240e-05,\n 0.0046539, 0.0046307,\n// 6 9 11\n1723502.941905, 11.0, -4.0, 4.0, 10466.7, 10466.7,\n 0.4000290, 0.4822544, -2.110e-05, -5.400e-06,\n 0.6135880, -0.1504661, -5.660e-05, 1.620e-06,\n 5.6251898, -0.0157920, -1.000e-06,\n 345.8679810, 15.0040894, 0.000e-00,\n 0.5707200, -0.0000313, -9.800e-06,\n 0.0244600, -0.0000312, -9.800e-06,\n 0.0046880, 0.0046647,\n// 7 2 6\n1723651.058330, 13.0, -4.0, 4.0, 10462.7, 10462.7,\n -0.4871880, 0.5636266, 1.270e-05, -9.250e-06,\n 1.1944730, 0.1187640, 4.650e-05, -1.880e-06,\n -16.3175106, 0.0121820, 4.000e-06,\n 10.6870604, 15.0010834, 0.000e-00,\n 0.5389800, -0.0000606, -1.270e-05,\n -0.0071220, -0.0000603, -1.270e-05,\n 0.0047090, 0.0046855,\n// 7 3 7\n1723680.436740, 22.0, -4.0, 4.0, 10461.9, 10461.9,\n 0.1352560, 0.5564197, -1.870e-05, -9.480e-06,\n -1.3630260, 0.1754102, 1.166e-04, -2.900e-06,\n -6.0585299, 0.0155390, 1.000e-06,\n 146.8084869, 15.0045033, 0.000e-00,\n 0.5339450, -0.0000087, -1.290e-05,\n -0.0121320, -0.0000086, -1.290e-05,\n 0.0046682, 0.0046450,\n// 7 8 1\n1723827.335369, 20.0, -4.0, 4.0, 10457.8, 10457.8,\n -0.2508930, 0.5192351, -2.330e-05, -6.510e-06,\n -1.4247210, -0.0819566, -5.180e-05, 9.400e-07,\n 19.0020905, -0.0098450, -5.000e-06,\n 119.2963104, 15.0010958, 0.000e-00,\n 0.5575310, 0.0001106, -1.050e-05,\n 0.0113370, 0.0001101, -1.040e-05,\n 0.0046329, 0.0046098,\n// 7 8 31\n1723856.941619, 11.0, -4.0, 4.0, 10457.0, 10457.0,\n 0.5851760, 0.4922707, -4.940e-05, -5.730e-06,\n 1.2912199, -0.1416734, -1.039e-04, 1.600e-06,\n 9.8561201, -0.0147800, -2.000e-06,\n 345.1435852, 15.0036097, 0.000e-00,\n 0.5663670, 0.0000691, -1.000e-05,\n 0.0201290, 0.0000687, -1.000e-05,\n 0.0046720, 0.0046487,\n// 8 1 27\n1724005.595400, 2.0, -4.0, 4.0, 10452.9, 10452.9,\n -0.2460020, 0.5405931, 9.900e-06, -7.590e-06,\n 0.5817410, 0.0798825, 1.056e-04, -1.050e-06,\n -19.2383003, 0.0100110, 5.000e-06,\n 205.9786835, 14.9994297, 0.000e-00,\n 0.5528290, -0.0001172, -1.150e-05,\n 0.0066580, -0.0001166, -1.140e-05,\n 0.0047230, 0.0046994,\n// 8 7 21\n1724181.727862, 5.0, -4.0, 4.0, 10448.1, 10448.1,\n -0.3171140, 0.5571292, -1.440e-05, -8.370e-06,\n -0.6082380, -0.0493122, -1.097e-04, 6.400e-07,\n 21.2855797, -0.0073000, -5.000e-06,\n 254.4908600, 15.0001974, 0.000e-00,\n 0.5417140, 0.0001242, -1.180e-05,\n -0.0044010, 0.0001236, -1.170e-05,\n 0.0046205, 0.0045975,\n// 9 1 15\n1724359.839530, 8.0, -4.0, 4.0, 10443.2, 10443.2,\n -0.0692250, 0.5132652, 4.900e-06, -6.080e-06,\n -0.1003230, 0.0385289, 1.488e-04, -3.700e-07,\n -21.5647602, 0.0072590, 5.000e-06,\n 296.7083740, 14.9978333, 0.000e-00,\n 0.5686410, -0.0000860, -1.030e-05,\n 0.0223910, -0.0000855, -1.020e-05,\n 0.0047358, 0.0047122,\n// 9 7 10\n1724536.370239, 21.0, -4.0, 4.0, 10438.4, 10438.4,\n 0.0685720, 0.5823288, -1.160e-05, -9.850e-06,\n 0.1250290, -0.0094509, -1.702e-04, 5.000e-08,\n 22.8116608, -0.0045540, -5.000e-06,\n 134.9048767, 14.9995270, 0.000e-00,\n 0.5315620, 0.0000348, -1.280e-05,\n -0.0145030, 0.0000347, -1.270e-05,\n 0.0046107, 0.0045877,\n// 10 1 4\n1724713.829523, 8.0, -4.0, 4.0, 10433.5, 10433.5,\n 0.0413750, 0.5034579, -2.000e-06, -5.600e-06,\n -0.7916870, -0.0029327, 1.842e-04, 1.200e-07,\n -23.1018295, 0.0039900, 6.000e-06,\n 297.8305359, 14.9966326, 0.000e-00,\n 0.5749010, 0.0000080, -9.900e-06,\n 0.0286200, 0.0000079, -9.800e-06,\n 0.0047463, 0.0047227,\n// 10 6 30\n1724891.084146, 14.0, -4.0, 4.0, 10428.6, 10428.6,\n -0.0607460, 0.5774612, 2.210e-05, -9.550e-06,\n 0.8624740, 0.0331130, -2.177e-04, -6.800e-07,\n 23.5901794, -0.0016480, -6.000e-06,\n 30.4601097, 14.9991560, 0.000e-00,\n 0.5329070, -0.0000624, -1.260e-05,\n -0.0131640, -0.0000621, -1.250e-05,\n 0.0046033, 0.0045803,\n// 10 11 24\n1725038.188019, 17.0, -4.0, 4.0, 10424.6, 10424.6,\n 0.6969420, 0.5122303, -6.200e-06, -6.790e-06,\n 1.3378479, -0.1616266, 7.620e-05, 2.320e-06,\n -20.5376205, -0.0085060, 5.000e-06,\n 77.5096436, 14.9980116, 0.000e-00,\n 0.5588340, 0.0001106, -1.120e-05,\n 0.0126330, 0.0001101, -1.110e-05,\n 0.0047585, 0.0047348,\n// 10 12 24\n1725067.853854, 8.0, -4.0, 4.0, 10423.7, 10423.7,\n -0.3844260, 0.5187439, 1.450e-05, -6.350e-06,\n -1.4095210, -0.0469118, 2.236e-04, 6.600e-07,\n -23.6869202, 0.0004460, 6.000e-06,\n 299.1918030, 14.9961252, 0.000e-00,\n 0.5666640, 0.0001104, -1.050e-05,\n 0.0204240, 0.0001099, -1.050e-05,\n 0.0047537, 0.0047300,\n// 11 5 21\n1725216.241056, 18.0, -4.0, 4.0, 10419.7, 10419.7,\n 0.4299160, 0.5035133, 3.840e-05, -6.510e-06,\n -0.8922830, 0.1742631, -7.350e-05, -2.390e-06,\n 19.6933804, 0.0088180, -4.000e-06,\n 91.9571304, 15.0013361, 0.000e-00,\n 0.5523490, -0.0001196, -1.070e-05,\n 0.0061800, -0.0001191, -1.060e-05,\n 0.0045972, 0.0045743,\n// 11 11 14\n1725392.645134, 3.0, -4.0, 4.0, 10414.8, 10414.8,\n 0.0143580, 0.5306380, 3.060e-05, -8.380e-06,\n 0.7908800, -0.2082504, 7.900e-05, 3.490e-06,\n -17.8641891, -0.0110700, 4.000e-06,\n 228.1855927, 14.9995222, 0.000e-00,\n 0.5438280, 0.0001021, -1.260e-05,\n -0.0022980, 0.0001016, -1.250e-05,\n 0.0047542, 0.0047305,\n// 12 5 9\n1725570.406918, 22.0, -4.0, 4.0, 10410.0, 10410.0,\n 0.1989070, 0.4695761, 3.780e-05, -5.290e-06,\n -0.1683890, 0.1952628, -8.320e-05, -2.350e-06,\n 16.9254799, 0.0110520, -4.000e-06,\n 151.7776642, 15.0024471, 0.000e-00,\n 0.5642780, -0.0000528, -9.800e-06,\n 0.0180500, -0.0000526, -9.700e-06,\n 0.0046021, 0.0045791,\n// 12 11 2\n1725747.283772, 19.0, -4.0, 4.0, 10405.1, 10405.1,\n 0.1249630, 0.5304235, 3.720e-05, -8.940e-06,\n 0.0078300, -0.2418299, 9.280e-05, 4.290e-06,\n -14.6475801, -0.0130780, 3.000e-06,\n 108.4609375, 15.0009880, 0.000e-00,\n 0.5380960, -0.0000114, -1.310e-05,\n -0.0080020, -0.0000113, -1.310e-05,\n 0.0047477, 0.0047241,\n// 13 4 28\n1725924.427984, 22.0, -4.0, 4.0, 10400.3, 10400.3,\n -0.3517510, 0.4606972, 3.960e-05, -5.210e-06,\n 0.4190160, 0.2183339, -9.030e-05, -2.620e-06,\n 13.5530596, 0.0128770, -3.000e-06,\n 151.2751007, 15.0035439, 0.000e-00,\n 0.5641090, 0.0000580, -9.800e-06,\n 0.0178820, 0.0000577, -9.800e-06,\n 0.0046092, 0.0045863,\n// 13 10 23\n1726101.910217, 10.0, -4.0, 4.0, 10395.4, 10395.4,\n -0.2055610, 0.5057967, 5.800e-05, -7.800e-06,\n -0.6024530, -0.2549777, 9.190e-05, 4.150e-06,\n -10.9533005, -0.0145920, 2.000e-06,\n 333.3776550, 15.0022507, 0.000e-00,\n 0.5447880, -0.0001004, -1.240e-05,\n -0.0013430, -0.0000999, -1.230e-05,\n 0.0047391, 0.0047155,\n// 14 3 19\n1726249.151669, 16.0, -4.0, 4.0, 10391.4, 10391.4,\n 0.8724770, 0.4831192, -6.180e-05, -6.880e-06,\n -1.1613491, 0.2683584, 5.880e-05, -4.040e-06,\n -1.3741200, 0.0156690, 0.000e-00,\n 57.8264809, 15.0049810, 0.000e-00,\n 0.5463870, 0.0001059, -1.160e-05,\n 0.0002480, 0.0001054, -1.150e-05,\n 0.0046523, 0.0046291,\n// 14 4 18\n1726278.612392, 3.0, -4.0, 4.0, 10390.5, 10390.5,\n -0.4317970, 0.4762812, 3.190e-05, -6.220e-06,\n 1.1916740, 0.2454006, -1.120e-04, -3.350e-06,\n 9.8100004, 0.0142110, -2.000e-06,\n 225.5100250, 15.0044422, 0.000e-00,\n 0.5523060, 0.0001078, -1.080e-05,\n 0.0061380, 0.0001073, -1.080e-05,\n 0.0046183, 0.0045953,\n// 14 9 13\n1726426.703452, 5.0, -4.0, 4.0, 10386.5, 10386.5,\n 0.7742070, 0.4537856, -3.400e-05, -5.370e-06,\n 1.2834359, -0.2492931, -8.430e-05, 3.100e-06,\n 4.9200401, -0.0156730, -1.000e-06,\n 255.9995270, 15.0040693, 0.000e-00,\n 0.5645970, -0.0000904, -1.030e-05,\n 0.0183670, -0.0000900, -1.020e-05,\n 0.0046901, 0.0046668,\n// 14 10 12\n1726456.336230, 20.0, -4.0, 4.0, 10385.7, 10385.7,\n -0.6885720, 0.4698096, 6.690e-05, -6.040e-06,\n -1.2057600, -0.2519280, 8.530e-05, 3.450e-06,\n -6.8556499, -0.0156110, 1.000e-06,\n 122.9712524, 15.0032234, 0.000e-00,\n 0.5593480, -0.0001130, -1.100e-05,\n 0.0131440, -0.0001124, -1.090e-05,\n 0.0047283, 0.0047048,\n// 15 3 9\n1726603.739031, 6.0, -4.0, 4.0, 10381.6, 10381.6,\n 0.4555870, 0.5082808, -4.910e-05, -8.360e-06,\n -0.5152520, 0.2779885, 5.770e-05, -4.790e-06,\n -5.5217800, 0.0153670, 1.000e-06,\n 266.9093933, 15.0044880, 0.000e-00,\n 0.5356110, 0.0000459, -1.280e-05,\n -0.0104750, 0.0000457, -1.270e-05,\n 0.0046664, 0.0046432,\n// 15 9 2\n1726780.732303, 6.0, -4.0, 4.0, 10376.8, 10376.8,\n 0.5668920, 0.4467416, -4.640e-05, -4.900e-06,\n 0.6204310, -0.2341313, -7.110e-05, 2.730e-06,\n 9.1805201, -0.0147630, -2.000e-06,\n 270.2530518, 15.0036135, 0.000e-00,\n 0.5703970, -0.0000021, -9.800e-06,\n 0.0241390, -0.0000021, -9.700e-06,\n 0.0046745, 0.0046512,\n// 16 2 26\n1726958.427827, 22.0, -4.0, 4.0, 10372.0, 10372.0,\n -0.1549390, 0.5150110, -1.420e-05, -8.530e-06,\n -0.0390200, 0.2677361, 6.020e-05, -4.640e-06,\n -9.5069399, 0.0146460, 2.000e-06,\n 146.1893768, 15.0035734, 0.000e-00,\n 0.5358830, -0.0000429, -1.290e-05,\n -0.0102040, -0.0000427, -1.280e-05,\n 0.0046813, 0.0046580,\n// 16 8 21\n1727134.773296, 7.0, -4.0, 4.0, 10367.1, 10367.1,\n 0.2367730, 0.4679930, -5.630e-05, -5.570e-06,\n -0.0356590, -0.2246969, -6.490e-05, 2.850e-06,\n 13.1183100, -0.0133370, -3.000e-06,\n 284.6757812, 15.0028791, 0.000e-00,\n 0.5623090, 0.0000889, -1.030e-05,\n 0.0160900, 0.0000885, -1.020e-05,\n 0.0046586, 0.0046354,\n// 17 2 15\n1727313.021350, 13.0, -4.0, 4.0, 10362.3, 10362.3,\n -0.0866320, 0.5011933, -1.420e-05, -7.270e-06,\n 0.8131210, 0.2380546, 4.330e-05, -3.660e-06,\n -13.2590303, 0.0134710, 3.000e-06,\n 10.7622604, 15.0022697, 0.000e-00,\n 0.5476060, -0.0001306, -1.180e-05,\n 0.0014610, -0.0001300, -1.170e-05,\n 0.0046967, 0.0046733,\n// 17 8 10\n1727489.088708, 14.0, -4.0, 4.0, 10357.5, 10357.5,\n -0.3280760, 0.5082117, -4.280e-05, -7.260e-06,\n -0.5941960, -0.2145195, -6.390e-05, 3.230e-06,\n 16.5272007, -0.0114790, -4.000e-06,\n 29.3468094, 15.0019836, 0.000e-00,\n 0.5463420, 0.0001239, -1.150e-05,\n 0.0002040, 0.0001232, -1.150e-05,\n 0.0046437, 0.0046205,\n// 18 1 6\n1727637.634096, 3.0, -4.0, 4.0, 10353.4, 10353.4,\n 0.1814760, 0.4980552, -2.970e-05, -5.680e-06,\n -1.4094660, 0.1041378, 2.076e-04, -1.300e-06,\n -22.9104404, 0.0043100, 6.000e-06,\n 222.6302185, 14.9967718, 0.000e-00,\n 0.5721700, -0.0000601, -1.000e-05,\n 0.0259030, -0.0000598, -1.000e-05,\n 0.0047448, 0.0047212,\n// 18 2 4\n1727667.347617, 20.0, -4.0, 4.0, 10352.6, 10352.6,\n -0.7576560, 0.4814118, 6.100e-06, -5.810e-06,\n 1.3633130, 0.1992530, 4.350e-05, -2.590e-06,\n -16.7244091, 0.0117280, 4.000e-06,\n 115.7001724, 15.0006676, 0.000e-00,\n 0.5640390, -0.0000977, -1.050e-05,\n 0.0178120, -0.0000973, -1.040e-05,\n 0.0047121, 0.0046886,\n// 18 7 1\n1727814.385177, 21.0, -4.0, 4.0, 10348.6, 10348.6,\n 0.0262010, 0.5784653, -2.840e-05, -9.870e-06,\n 1.1656539, -0.0845000, -2.359e-04, 1.580e-06,\n 23.5308895, -0.0017660, -5.000e-06,\n 135.3731384, 14.9991856, 0.000e-00,\n 0.5303750, 0.0000152, -1.280e-05,\n -0.0156840, 0.0000151, -1.280e-05,\n 0.0046038, 0.0045809,\n// 18 7 31\n1727843.682809, 4.0, -4.0, 4.0, 10347.8, 10347.8,\n -0.6658450, 0.5457336, -1.690e-05, -9.010e-06,\n -1.2105300, -0.1929035, -5.550e-05, 3.340e-06,\n 19.3162498, -0.0092800, -5.000e-06,\n 239.2991333, 15.0010366, 0.000e-00,\n 0.5337800, 0.0000692, -1.270e-05,\n -0.0122960, 0.0000689, -1.260e-05,\n 0.0046303, 0.0046072,\n// 18 12 26\n1727991.596793, 2.0, -4.0, 4.0, 10343.7, 10343.7,\n -0.0706650, 0.5018580, -2.360e-05, -5.640e-06,\n -0.7657990, 0.0614052, 1.883e-04, -8.100e-07,\n -23.6598206, 0.0007790, 6.000e-06,\n 208.9697571, 14.9961185, 0.000e-00,\n 0.5741770, 0.0000467, -1.000e-05,\n 0.0279000, 0.0000465, -9.900e-06,\n 0.0047530, 0.0047293,\n// 19 6 21\n1728169.086314, 14.0, -4.0, 4.0, 10338.9, 10338.9,\n -0.0096800, 0.5706401, 8.000e-07, -9.130e-06,\n 0.4394070, -0.0406790, -1.907e-04, 7.600e-07,\n 23.6425400, 0.0011850, -6.000e-06,\n 30.9593792, 14.9991961, 0.000e-00,\n 0.5352940, -0.0000837, -1.230e-05,\n -0.0107890, -0.0000833, -1.220e-05,\n 0.0045985, 0.0045756,\n// 19 12 15\n1728345.685005, 4.0, -4.0, 4.0, 10334.0, 10334.0,\n -0.2313650, 0.5291065, -1.420e-05, -6.800e-06,\n -0.0507340, 0.0186091, 1.680e-04, -3.500e-07,\n -23.4156799, -0.0027990, 6.000e-06,\n 240.3764343, 14.9962645, 0.000e-00,\n 0.5626130, 0.0001240, -1.090e-05,\n 0.0163930, 0.0001234, -1.080e-05,\n 0.0047576, 0.0047339,\n// 20 6 10\n1728523.611520, 3.0, -4.0, 4.0, 10329.2, 10329.2,\n 0.1766330, 0.5403103, 1.080e-05, -7.330e-06,\n -0.3373250, 0.0028510, -1.349e-04, 6.000e-08,\n 22.9709892, 0.0041170, -5.000e-06,\n 226.4960327, 14.9996033, 0.000e-00,\n 0.5489350, -0.0001254, -1.100e-05,\n 0.0027830, -0.0001248, -1.090e-05,\n 0.0045960, 0.0045731,\n// 20 12 3\n1728700.076262, 14.0, -4.0, 4.0, 10324.4, 10324.4,\n 0.1256900, 0.5625687, -1.390e-05, -8.650e-06,\n 0.6401650, -0.0263285, 1.320e-04, 3.100e-07,\n -22.2507095, -0.0061160, 6.000e-06,\n 31.6289597, 14.9970903, 0.000e-00,\n 0.5471240, 0.0000998, -1.230e-05,\n 0.0009820, 0.0000993, -1.220e-05,\n 0.0047588, 0.0047351,\n// 21 5 30\n1728877.838799, 8.0, -4.0, 4.0, 10319.5, 10319.5,\n 0.0259520, 0.5102401, 1.880e-05, -5.920e-06,\n -1.1503770, 0.0414177, -8.430e-05, -4.000e-07,\n 21.4866104, 0.0069470, -5.000e-06,\n 301.8609619, 15.0004187, 0.000e-00,\n 0.5621590, -0.0000639, -9.900e-06,\n 0.0159420, -0.0000636, -9.800e-06,\n 0.0045961, 0.0045732,\n// 21 10 24\n1729025.251281, 18.0, -4.0, 4.0, 10315.5, 10315.5,\n -0.3870800, 0.5603748, 4.810e-05, -9.450e-06,\n -1.3374749, -0.1544222, 1.503e-04, 2.540e-06,\n -11.4565697, -0.0146610, 2.000e-06,\n 93.4089584, 15.0022316, 0.000e-00,\n 0.5384240, -0.0000349, -1.300e-05,\n -0.0076760, -0.0000347, -1.300e-05,\n 0.0047398, 0.0047162,\n// 21 11 23\n1729054.686593, 4.0, -4.0, 4.0, 10314.7, 10314.7,\n -0.1197030, 0.5778267, 2.070e-05, -9.820e-06,\n 1.3041910, -0.0713331, 7.490e-05, 1.120e-06,\n -20.2718506, -0.0090500, 5.000e-06,\n 242.6079407, 14.9983377, 0.000e-00,\n 0.5386620, 0.0000301, -1.310e-05,\n -0.0074380, 0.0000299, -1.310e-05,\n 0.0047573, 0.0047336,\n// 22 4 19\n1729202.265747, 18.0, -4.0, 4.0, 10310.7, 10310.7,\n -0.4417320, 0.4957266, 2.300e-05, -5.860e-06,\n 0.8479920, 0.1400533, -9.680e-05, -1.580e-06,\n 10.4049501, 0.0142740, -2.000e-06,\n 90.6399765, 15.0043716, 0.000e-00,\n 0.5619500, 0.0000839, -1.000e-05,\n 0.0157340, 0.0000835, -1.000e-05,\n 0.0046173, 0.0045943,\n// 22 10 14\n1729379.842277, 8.0, -4.0, 4.0, 10305.9, 10305.9,\n -0.3339410, 0.5335091, 4.560e-05, -7.940e-06,\n -0.6882710, -0.1619416, 7.490e-05, 2.350e-06,\n -7.4625001, -0.0157130, 1.000e-06,\n 303.0452881, 15.0032530, 0.000e-00,\n 0.5482360, -0.0001052, -1.200e-05,\n 0.0020870, -0.0001047, -1.190e-05,\n 0.0047293, 0.0047057,\n// 23 4 9\n1729556.528577, 1.0, -4.0, 4.0, 10301.0, 10301.0,\n 0.1221930, 0.5209391, -9.300e-06, -7.250e-06,\n 0.1847390, 0.1609480, -5.180e-05, -2.160e-06,\n 6.4242001, 0.0152370, -1.000e-06,\n 194.7207642, 15.0050163, 0.000e-00,\n 0.5485110, 0.0001100, -1.120e-05,\n 0.0023620, 0.0001095, -1.120e-05,\n 0.0046279, 0.0046049,\n// 23 10 3\n1729734.188215, 17.0, -4.0, 4.0, 10296.2, 10296.2,\n 0.2238960, 0.4989476, 1.160e-05, -6.210e-06,\n -0.1302420, -0.1596346, 1.680e-05, 1.920e-06,\n -3.1785800, -0.0162640, 0.000e-00,\n 77.4351501, 15.0039043, 0.000e-00,\n 0.5631170, -0.0001129, -1.060e-05,\n 0.0168950, -0.0001123, -1.050e-05,\n 0.0047172, 0.0046937,\n// 24 3 28\n1729911.077996, 14.0, -4.0, 4.0, 10291.4, 10291.4,\n 0.2561180, 0.5472324, -1.900e-05, -8.920e-06,\n -0.5518380, 0.1771834, 1.250e-05, -2.810e-06,\n 2.3340299, 0.0157550, -1.000e-06,\n 28.7158699, 15.0052834, 0.000e-00,\n 0.5359980, 0.0000689, -1.250e-05,\n -0.0100890, 0.0000685, -1.250e-05,\n 0.0046398, 0.0046167,\n// 24 9 21\n1730088.248003, 18.0, -4.0, 4.0, 10286.6, 10286.6,\n 0.2281590, 0.4800190, -8.800e-06, -5.360e-06,\n 0.6271310, -0.1551940, -3.290e-05, 1.670e-06,\n 1.3114100, -0.0162840, 0.000e-00,\n 91.6604309, 15.0041866, 0.000e-00,\n 0.5718910, -0.0000188, -9.800e-06,\n 0.0256250, -0.0000187, -9.800e-06,\n 0.0047030, 0.0046796,\n// 25 2 16\n1730236.405566, 22.0, -4.0, 4.0, 10282.6, 10282.6,\n -0.1788950, 0.5564766, 1.000e-07, -9.090e-06,\n 1.2941220, 0.1450130, 1.490e-05, -2.310e-06,\n -12.7721500, 0.0138900, 3.000e-06,\n 145.8039246, 15.0025949, 0.000e-00,\n 0.5386330, -0.0000824, -1.270e-05,\n -0.0074670, -0.0000820, -1.260e-05,\n 0.0046943, 0.0046709,\n// 25 3 18\n1730265.770592, 6.0, -4.0, 4.0, 10281.7, 10281.7,\n 0.1312690, 0.5540464, -9.400e-06, -9.420e-06,\n -1.3236150, 0.1818243, 8.790e-05, -3.000e-06,\n -1.7969800, 0.0158660, 0.000e-00,\n 267.7253723, 15.0051098, 0.000e-00,\n 0.5333100, -0.0000143, -1.290e-05,\n -0.0127640, -0.0000142, -1.280e-05,\n 0.0046533, 0.0046301,\n// 25 8 12\n1730412.632450, 3.0, -4.0, 4.0, 10277.8, 10277.8,\n -0.4100360, 0.5154275, -1.920e-05, -6.530e-06,\n -1.4477160, -0.1116237, -2.790e-05, 1.320e-06,\n 16.0611000, -0.0120250, -4.000e-06,\n 224.3803711, 15.0021572, 0.000e-00,\n 0.5574360, 0.0001167, -1.060e-05,\n 0.0112420, 0.0001161, -1.050e-05,\n 0.0046461, 0.0046230,\n// 25 9 10\n1730442.246916, 18.0, -4.0, 4.0, 10277.0, 10277.0,\n 0.4420220, 0.4896715, -3.920e-05, -5.730e-06,\n 1.2832670, -0.1534926, -7.960e-05, 1.750e-06,\n 5.7453599, -0.0157600, -1.000e-06,\n 90.8485489, 15.0041008, 0.000e-00,\n 0.5667030, 0.0000805, -1.010e-05,\n 0.0204630, 0.0000801, -1.010e-05,\n 0.0046872, 0.0046638,\n// 26 2 6\n1730590.935367, 10.0, -4.0, 4.0, 10272.9, 10272.9,\n -0.3692110, 0.5332307, 1.230e-05, -7.410e-06,\n 0.5713430, 0.1114026, 8.190e-05, -1.480e-06,\n -16.2327805, 0.0122500, 4.000e-06,\n 325.6834106, 15.0010424, 0.000e-00,\n 0.5529350, -0.0001142, -1.140e-05,\n 0.0067630, -0.0001136, -1.130e-05,\n 0.0047094, 0.0046860,\n// 26 8 1\n1730767.038714, 13.0, -4.0, 4.0, 10268.1, 10268.1,\n -0.0677330, 0.5544004, -3.150e-05, -8.400e-06,\n -0.6918970, -0.0865298, -8.560e-05, 1.220e-06,\n 18.9728603, -0.0098560, -4.000e-06,\n 14.2936201, 15.0011997, 0.000e-00,\n 0.5415780, 0.0001093, -1.190e-05,\n -0.0045370, 0.0001088, -1.180e-05,\n 0.0046321, 0.0046090,\n// 27 1 26\n1730945.168213, 16.0, -4.0, 4.0, 10263.3, 10263.3,\n -0.0076950, 0.5081990, -5.300e-06, -5.980e-06,\n -0.0790110, 0.0743899, 1.284e-04, -8.000e-07,\n -19.2407093, 0.0100200, 5.000e-06,\n 55.9828987, 14.9993343, 0.000e-00,\n 0.5685330, -0.0000845, -1.020e-05,\n 0.0222840, -0.0000841, -1.020e-05,\n 0.0047242, 0.0047006,\n// 27 7 22\n1731121.686884, 4.0, -4.0, 4.0, 10258.5, 10258.5,\n -0.2762910, 0.5805693, -4.000e-06, -9.850e-06,\n 0.0854060, -0.0521184, -1.532e-04, 7.800e-07,\n 21.2168808, -0.0073840, -5.000e-06,\n 239.4707336, 15.0002956, 0.000e-00,\n 0.5317910, 0.0000444, -1.280e-05,\n -0.0142750, 0.0000442, -1.270e-05,\n 0.0046200, 0.0045970,\n// 28 1 15\n1731299.155917, 16.0, -4.0, 4.0, 10253.7, 10253.7,\n 0.1865460, 0.5024675, -1.910e-05, -5.600e-06,\n -0.7652620, 0.0369945, 1.697e-04, -3.400e-07,\n -21.6100407, 0.0071860, 5.000e-06,\n 56.7394409, 14.9977598, 0.000e-00,\n 0.5741910, 0.0000096, -9.900e-06,\n 0.0279140, 0.0000096, -9.800e-06,\n 0.0047369, 0.0047133,\n// 28 7 10\n1731476.395056, 21.0, -4.0, 4.0, 10248.8, 10248.8,\n -0.2611180, 0.5769556, 1.920e-05, -9.480e-06,\n 0.8027070, -0.0118140, -2.074e-04, 7.000e-08,\n 22.7631092, -0.0046600, -5.000e-06,\n 134.8751526, 14.9995451, 0.000e-00,\n 0.5338460, -0.0000559, -1.250e-05,\n -0.0122300, -0.0000556, -1.250e-05,\n 0.0046106, 0.0045876,\n// 28 12 5\n1731623.541193, 1.0, -4.0, 4.0, 10244.8, 10244.8,\n 0.3434690, 0.5247629, 1.900e-06, -7.050e-06,\n 1.4429910, -0.1226163, 8.940e-05, 1.820e-06,\n -22.4677601, -0.0054200, 6.000e-06,\n 196.4756012, 14.9968519, 0.000e-00,\n 0.5579830, 0.0001211, -1.130e-05,\n 0.0117860, 0.0001205, -1.120e-05,\n 0.0047593, 0.0047356,\n// 29 1 3\n1731653.194448, 17.0, -4.0, 4.0, 10244.1, 10244.1,\n 0.1665430, 0.5224628, -2.070e-05, -6.450e-06,\n -1.4285160, -0.0026229, 2.192e-04, 1.000e-07,\n -23.1210098, 0.0039140, 6.000e-06,\n 72.8674469, 14.9966574, 0.000e-00,\n 0.5655690, 0.0000952, -1.060e-05,\n 0.0193350, 0.0000948, -1.050e-05,\n 0.0047466, 0.0047229,\n// 29 6 1\n1731801.523383, 1.0, -4.0, 4.0, 10240.0, 10240.0,\n 0.5050500, 0.5121680, 3.180e-05, -6.560e-06,\n -0.9698500, 0.1391727, -8.930e-05, -1.910e-06,\n 21.7767696, 0.0062660, -5.000e-06,\n 196.8140106, 15.0002623, 0.000e-00,\n 0.5531610, -0.0001216, -1.060e-05,\n 0.0069890, -0.0001210, -1.060e-05,\n 0.0045955, 0.0045726,\n// 29 11 24\n1731978.010655, 12.0, -4.0, 4.0, 10235.2, 10235.2,\n 0.0853910, 0.5444922, 2.730e-05, -8.680e-06,\n 0.7518040, -0.1729151, 1.051e-04, 2.950e-06,\n -20.5715199, -0.0084310, 5.000e-06,\n 2.5073500, 14.9980764, 0.000e-00,\n 0.5434720, 0.0000920, -1.260e-05,\n -0.0026530, 0.0000915, -1.260e-05,\n 0.0047578, 0.0047341,\n// 30 5 21\n1732155.674271, 4.0, -4.0, 4.0, 10230.4, 10230.4,\n 0.0176140, 0.4794125, 4.370e-05, -5.390e-06,\n -0.3315700, 0.1674474, -9.750e-05, -2.020e-06,\n 19.6521301, 0.0088730, -4.000e-06,\n 241.9401855, 15.0012894, 0.000e-00,\n 0.5644170, -0.0000378, -9.700e-06,\n 0.0181890, -0.0000376, -9.700e-06,\n 0.0045980, 0.0045751,\n// 30 11 14\n1732332.650990, 4.0, -4.0, 4.0, 10225.6, 10225.6,\n 0.2276390, 0.5426727, 3.770e-05, -9.160e-06,\n -0.0199290, -0.2123159, 1.218e-04, 3.780e-06,\n -17.9784603, -0.0109630, 4.000e-06,\n 243.1780548, 14.9994993, 0.000e-00,\n 0.5384830, -0.0000224, -1.310e-05,\n -0.0076160, -0.0000222, -1.310e-05,\n 0.0047538, 0.0047302,\n// 31 5 10\n1732509.699197, 5.0, -4.0, 4.0, 10220.8, 10220.8,\n -0.0682200, 0.4715584, 3.350e-05, -5.380e-06,\n 0.4543810, 0.1967275, -1.126e-04, -2.390e-06,\n 16.8396206, 0.0111060, -4.000e-06,\n 256.7541504, 15.0024738, 0.000e-00,\n 0.5632260, 0.0000547, -9.900e-06,\n 0.0170030, 0.0000544, -9.800e-06,\n 0.0046027, 0.0045798,\n// 31 11 3\n1732687.268581, 18.0, -4.0, 4.0, 10216.0, 10216.0,\n -0.4868430, 0.5144726, 8.020e-05, -7.870e-06,\n -0.4645990, -0.2330619, 1.122e-04, 3.780e-06,\n -14.7569704, -0.0130370, 3.000e-06,\n 93.4678421, 15.0009079, 0.000e-00,\n 0.5460080, -0.0000893, -1.230e-05,\n -0.0001290, -0.0000889, -1.230e-05,\n 0.0047479, 0.0047242,\n// 32 3 29\n1732834.465288, 23.0, -4.0, 4.0, 10212.0, 10212.0,\n 0.6376400, 0.4857558, -3.940e-05, -7.010e-06,\n -1.3472670, 0.2680119, 4.540e-05, -4.090e-06,\n 2.8930099, 0.0154910, -1.000e-06,\n 163.8529053, 15.0051279, 0.000e-00,\n 0.5446460, 0.0001167, -1.160e-05,\n -0.0014850, 0.0001161, -1.160e-05,\n 0.0046387, 0.0046156,\n// 32 4 28\n1732863.904284, 10.0, -4.0, 4.0, 10211.2, 10211.2,\n -0.3593520, 0.4867085, 3.660e-05, -6.440e-06,\n 1.1371510, 0.2293782, -1.321e-04, -3.180e-06,\n 13.5205698, 0.0128650, -3.000e-06,\n 331.2571106, 15.0036077, 0.000e-00,\n 0.5508080, 0.0001095, -1.090e-05,\n 0.0046470, 0.0001090, -1.080e-05,\n 0.0046092, 0.0045863,\n// 32 9 23\n1733012.018446, 12.0, -4.0, 4.0, 10207.2, 10207.2,\n 0.5507820, 0.4501988, -1.450e-05, -5.270e-06,\n 1.4507260, -0.2521089, -6.790e-05, 3.110e-06,\n 0.5848000, -0.0160840, 0.000e-00,\n 1.7929000, 15.0040998, 0.000e-00,\n 0.5662530, -0.0000753, -1.030e-05,\n 0.0200150, -0.0000749, -1.020e-05,\n 0.0047048, 0.0046814,\n// 32 10 23\n1733041.675323, 4.0, -4.0, 4.0, 10206.4, 10206.4,\n -0.7151450, 0.4749952, 7.840e-05, -6.050e-06,\n -1.1822760, -0.2378021, 1.089e-04, 3.240e-06,\n -11.0012503, -0.0146130, 2.000e-06,\n 243.3869629, 15.0021667, 0.000e-00,\n 0.5608800, -0.0001091, -1.090e-05,\n 0.0146690, -0.0001085, -1.080e-05,\n 0.0047394, 0.0047158,\n// 33 3 19\n1733189.069631, 14.0, -4.0, 4.0, 10202.4, 10202.4,\n 0.5167240, 0.5063596, -3.850e-05, -8.370e-06,\n -0.5322390, 0.2835480, 3.490e-05, -4.900e-06,\n -1.2530900, 0.0156340, 0.000e-00,\n 27.8544407, 15.0050411, 0.000e-00,\n 0.5344390, 0.0000387, -1.280e-05,\n -0.0116400, 0.0000385, -1.270e-05,\n 0.0046517, 0.0046286,\n// 33 9 12\n1733366.032991, 13.0, -4.0, 4.0, 10197.6, 10197.6,\n 0.5062520, 0.4413944, -3.480e-05, -4.830e-06,\n 0.7001150, -0.2436079, -5.200e-05, 2.840e-06,\n 5.0248599, -0.0156660, -1.000e-06,\n 15.9756699, 15.0040379, 0.000e-00,\n 0.5713270, 0.0000082, -9.800e-06,\n 0.0250630, 0.0000081, -9.700e-06,\n 0.0046896, 0.0046663,\n// 34 3 9\n1733543.764401, 6.0, -4.0, 4.0, 10192.8, 10192.8,\n -0.1734850, 0.5081745, -6.000e-07, -8.380e-06,\n -0.1003600, 0.2790387, 3.870e-05, -4.810e-06,\n -5.3717699, 0.0153830, 1.000e-06,\n 266.9438477, 15.0045090, 0.000e-00,\n 0.5354330, -0.0000463, -1.280e-05,\n -0.0106520, -0.0000461, -1.270e-05,\n 0.0046662, 0.0046430,\n// 34 9 1\n1733720.077991, 14.0, -4.0, 4.0, 10188.0, 10188.0,\n 0.1149140, 0.4611528, -4.400e-05, -5.530e-06,\n 0.0756240, -0.2413870, -4.630e-05, 3.070e-06,\n 9.2782402, -0.0147140, -2.000e-06,\n 30.2306309, 15.0036364, 0.000e-00,\n 0.5624360, 0.0000993, -1.040e-05,\n 0.0162170, 0.0000988, -1.030e-05,\n 0.0046735, 0.0046503,\n// 35 2 26\n1733898.354095, 20.0, -4.0, 4.0, 10183.2, 10183.2,\n -0.5855850, 0.4908816, 1.700e-05, -7.030e-06,\n 0.5294880, 0.2549306, 3.200e-05, -3.860e-06,\n -9.3948298, 0.0147070, 2.000e-06,\n 116.2121201, 15.0035381, 0.000e-00,\n 0.5477270, -0.0001090, -1.170e-05,\n 0.0015810, -0.0001084, -1.160e-05,\n 0.0046818, 0.0046585,\n// 35 8 21\n1734074.405444, 22.0, -4.0, 4.0, 10178.5, 10178.5,\n -0.1332570, 0.4992453, -4.510e-05, -7.180e-06,\n -0.6237440, -0.2389855, -3.850e-05, 3.610e-06,\n 13.1095104, -0.0133040, -3.000e-06,\n 149.6710815, 15.0029640, 0.000e-00,\n 0.5462970, 0.0001136, -1.160e-05,\n 0.0001580, 0.0001131, -1.160e-05,\n 0.0046577, 0.0046345,\n// 36 1 17\n1734222.963093, 11.0, -4.0, 4.0, 10174.4, 10174.4,\n 0.3460650, 0.4877053, -4.430e-05, -5.520e-06,\n -1.3917340, 0.1424142, 1.906e-04, -1.740e-06,\n -21.2740307, 0.0074460, 5.000e-06,\n 341.5905457, 14.9979591, 0.000e-00,\n 0.5719750, -0.0000579, -1.000e-05,\n 0.0257090, -0.0000576, -1.000e-05,\n 0.0047348, 0.0047113,\n// 36 2 16\n1734252.669206, 4.0, -4.0, 4.0, 10173.6, 10173.6,\n -0.6794950, 0.4699687, 8.600e-06, -5.620e-06,\n 1.3645180, 0.2219666, 2.020e-05, -2.850e-06,\n -13.2535400, 0.0135120, 3.000e-06,\n 235.7666168, 15.0021877, 0.000e-00,\n 0.5638970, -0.0001004, -1.040e-05,\n 0.0176710, -0.0000999, -1.030e-05,\n 0.0046977, 0.0046743,\n// 36 7 12\n1734399.698976, 5.0, -4.0, 4.0, 10169.6, 10169.6,\n 0.3986930, 0.5701323, -5.850e-05, -9.710e-06,\n 1.1652100, -0.1293177, -2.258e-04, 2.360e-06,\n 22.5979900, -0.0047700, -5.000e-06,\n 254.8091583, 14.9996080, 0.000e-00,\n 0.5307550, -0.0000029, -1.280e-05,\n -0.0153060, -0.0000029, -1.280e-05,\n 0.0046116, 0.0045886,\n// 36 8 10\n1734429.005847, 12.0, -4.0, 4.0, 10168.9, 10168.9,\n -0.5808460, 0.5344691, -1.840e-05, -8.850e-06,\n -1.1721630, -0.2245951, -3.400e-05, 3.890e-06,\n 16.4364204, -0.0115110, -4.000e-06,\n 359.3515625, 15.0020857, 0.000e-00,\n 0.5340910, 0.0000577, -1.270e-05,\n -0.0119870, 0.0000574, -1.270e-05,\n 0.0046432, 0.0046201,\n// 37 1 5\n1734576.928496, 10.0, -4.0, 4.0, 10164.9, 10164.9,\n 0.0145890, 0.4957318, -3.940e-05, -5.580e-06,\n -0.7735480, 0.1033635, 1.796e-04, -1.300e-06,\n -22.9436207, 0.0042130, 6.000e-06,\n 327.6674500, 14.9967346, 0.000e-00,\n 0.5733560, 0.0000504, -1.000e-05,\n 0.0270830, 0.0000501, -9.900e-06,\n 0.0047454, 0.0047217,\n// 37 7 1\n1734754.391246, 21.0, -4.0, 4.0, 10160.1, 10160.1,\n -0.1427590, 0.5639420, -5.700e-06, -8.930e-06,\n 0.5403670, -0.0856349, -1.942e-04, 1.480e-06,\n 23.5102596, -0.0018780, -6.000e-06,\n 135.3463287, 14.9991608, 0.000e-00,\n 0.5363170, -0.0000799, -1.220e-05,\n -0.0097720, -0.0000795, -1.220e-05,\n 0.0046040, 0.0045811,\n// 37 12 25\n1734931.033039, 13.0, -4.0, 4.0, 10155.3, 10155.3,\n 0.1147000, 0.5273421, -4.200e-05, -6.820e-06,\n -0.0321690, 0.0640379, 1.670e-04, -9.600e-07,\n -23.6623707, 0.0007230, 6.000e-06,\n 13.9952698, 14.9961796, 0.000e-00,\n 0.5615740, 0.0001108, -1.090e-05,\n 0.0153590, 0.0001102, -1.090e-05,\n 0.0047527, 0.0047291,\n// 38 6 21\n1735108.898800, 10.0, -4.0, 4.0, 10150.5, 10150.5,\n 0.2111530, 0.5366938, -2.900e-06, -7.190e-06,\n -0.2757520, -0.0394820, -1.444e-04, 6.400e-07,\n 23.6476402, 0.0011130, -6.000e-06,\n 330.9389954, 14.9991035, 0.000e-00,\n 0.5500880, -0.0001262, -1.090e-05,\n 0.0039310, -0.0001256, -1.080e-05,\n 0.0045991, 0.0045762,\n// 38 12 14\n1735285.440050, 23.0, -4.0, 4.0, 10145.8, 10145.8,\n 0.2249120, 0.5643765, -3.160e-05, -8.740e-06,\n 0.6511180, 0.0201065, 1.414e-04, -4.200e-07,\n -23.4265003, -0.0027440, 6.000e-06,\n 165.3644562, 14.9963493, 0.000e-00,\n 0.5463600, 0.0000895, -1.240e-05,\n 0.0002210, 0.0000890, -1.230e-05,\n 0.0047570, 0.0047333,\n// 39 6 10\n1735463.107152, 15.0, -4.0, 4.0, 10140.9, 10140.9,\n 0.2261260, 0.5107550, 1.800e-06, -5.890e-06,\n -1.0640540, 0.0034311, -1.005e-04, 5.000e-08,\n 22.9611607, 0.0041410, -6.000e-06,\n 46.4870186, 14.9995337, 0.000e-00,\n 0.5627130, -0.0000686, -9.900e-06,\n 0.0164930, -0.0000683, -9.800e-06,\n 0.0045965, 0.0045736,\n// 39 11 5\n1735610.615502, 3.0, -4.0, 4.0, 10136.9, 10136.9,\n -0.1837390, 0.5659793, 4.140e-05, -9.520e-06,\n -1.3948380, -0.1295628, 1.818e-04, 2.110e-06,\n -15.2170496, -0.0130330, 3.000e-06,\n 228.4554443, 15.0008440, 0.000e-00,\n 0.5391490, -0.0000474, -1.300e-05,\n -0.0069540, -0.0000472, -1.300e-05,\n 0.0047486, 0.0047249,\n// 39 12 4\n1735640.057090, 13.0, -4.0, 4.0, 10136.2, 10136.2,\n -0.1548020, 0.5817335, 1.370e-05, -9.890e-06,\n 1.2869220, -0.0276504, 9.530e-05, 3.700e-07,\n -22.3000507, -0.0060090, 6.000e-06,\n 16.6034107, 14.9971066, 0.000e-00,\n 0.5386400, 0.0000212, -1.320e-05,\n -0.0074610, 0.0000211, -1.310e-05,\n 0.0047586, 0.0047349,\n// 40 4 30\n1735787.543947, 1.0, -4.0, 4.0, 10132.2, 10132.2,\n -0.2658700, 0.5021674, 1.920e-05, -5.990e-06,\n 0.9747890, 0.1219846, -1.245e-04, -1.380e-06,\n 14.0595598, 0.0128630, -3.000e-06,\n 196.3448334, 15.0034904, 0.000e-00,\n 0.5607100, 0.0000827, -1.010e-05,\n 0.0145000, 0.0000823, -1.000e-05,\n 0.0046083, 0.0045854,\n// 40 10 24\n1735965.193016, 17.0, -4.0, 4.0, 10127.4, 10127.4,\n -0.0039130, 0.5364241, 3.720e-05, -7.920e-06,\n -0.7965020, -0.1450738, 1.071e-04, 2.080e-06,\n -11.5799904, -0.0146370, 2.000e-06,\n 78.4268417, 15.0021372, 0.000e-00,\n 0.5495850, -0.0001217, -1.190e-05,\n 0.0034300, -0.0001211, -1.190e-05,\n 0.0047403, 0.0047167,\n// 41 4 19\n1736141.829698, 8.0, -4.0, 4.0, 10122.6, 10122.6,\n -0.0099350, 0.5270184, 2.000e-06, -7.420e-06,\n 0.2114310, 0.1484462, -7.720e-05, -2.010e-06,\n 10.4017897, 0.0142550, -2.000e-06,\n 300.6283569, 15.0044451, 0.000e-00,\n 0.5468920, 0.0001151, -1.130e-05,\n 0.0007510, 0.0001145, -1.120e-05,\n 0.0046170, 0.0045940,\n// 41 10 14\n1736319.518067, 0.0, -4.0, 4.0, 10117.8, 10117.8,\n -0.2387260, 0.4997629, 3.590e-05, -6.150e-06,\n -0.0076240, -0.1507881, 3.810e-05, 1.790e-06,\n -7.4843702, -0.0157330, 1.000e-06,\n 183.0547180, 15.0031691, 0.000e-00,\n 0.5647670, -0.0000912, -1.050e-05,\n 0.0185360, -0.0000907, -1.050e-05,\n 0.0047298, 0.0047062,\n// 42 4 8\n1736496.397560, 22.0, -4.0, 4.0, 10113.1, 10113.1,\n 0.4135440, 0.5508521, -1.840e-05, -9.040e-06,\n -0.4424930, 0.1702941, -1.790e-05, -2.720e-06,\n 6.5284400, 0.0151950, -1.000e-06,\n 149.7399445, 15.0050697, 0.000e-00,\n 0.5348070, 0.0000557, -1.250e-05,\n -0.0112740, 0.0000554, -1.250e-05,\n 0.0046275, 0.0046044,\n// 42 10 3\n1736673.560732, 1.0, -4.0, 4.0, 10108.3, 10108.3,\n -0.0254180, 0.4799129, 6.700e-06, -5.340e-06,\n 0.6768950, -0.1536090, -1.010e-05, 1.650e-06,\n -3.0691800, -0.0162800, 1.000e-06,\n 197.4226074, 15.0038786, 0.000e-00,\n 0.5729330, -0.0000034, -9.800e-06,\n 0.0266620, -0.0000034, -9.800e-06,\n 0.0047168, 0.0046933,\n// 43 2 28\n1736821.746147, 6.0, -4.0, 4.0, 10104.3, 10104.3,\n -0.3288940, 0.5502128, 1.330e-05, -8.920e-06,\n 1.2927560, 0.1635472, -1.170e-05, -2.590e-06,\n -8.8507004, 0.0150560, 2.000e-06,\n 266.3013000, 15.0038280, 0.000e-00,\n 0.5383800, -0.0000826, -1.260e-05,\n -0.0077190, -0.0000822, -1.250e-05,\n 0.0046796, 0.0046563,\n// 43 3 29\n1736851.098880, 14.0, -4.0, 4.0, 10103.5, 10103.5,\n 0.1818370, 0.5538748, -2.600e-06, -9.390e-06,\n -1.2558711, 0.1810363, 5.840e-05, -2.980e-06,\n 2.4904399, 0.0157350, -1.000e-06,\n 28.7496395, 15.0052881, 0.000e-00,\n 0.5327920, -0.0000233, -1.280e-05,\n -0.0132800, -0.0000232, -1.280e-05,\n 0.0046398, 0.0046167,\n// 43 8 23\n1736997.936695, 10.0, -4.0, 4.0, 10099.6, 10099.6,\n -0.6422640, 0.5115024, -8.400e-06, -6.550e-06,\n -1.4326169, -0.1353771, -3.700e-06, 1.640e-06,\n 12.5858498, -0.0137780, -3.000e-06,\n 329.7385864, 15.0031252, 0.000e-00,\n 0.5573470, 0.0001260, -1.070e-05,\n 0.0111530, 0.0001254, -1.060e-05,\n 0.0046599, 0.0046367,\n// 43 9 22\n1737027.559179, 1.0, -4.0, 4.0, 10098.8, 10098.8,\n 0.2021870, 0.4889527, -2.410e-05, -5.760e-06,\n 1.3202890, -0.1589790, -5.670e-05, 1.830e-06,\n 1.4362900, -0.0162610, 0.000e-00,\n 196.6412811, 15.0042229, 0.000e-00,\n 0.5669430, 0.0000951, -1.020e-05,\n 0.0207020, 0.0000946, -1.010e-05,\n 0.0047016, 0.0046782,\n// 44 2 17\n1737176.268591, 18.0, -4.0, 4.0, 10094.8, 10094.8,\n -0.4009750, 0.5257639, 1.500e-05, -7.240e-06,\n 0.5835390, 0.1357644, 5.590e-05, -1.810e-06,\n -12.6927605, 0.0139450, 3.000e-06,\n 85.8156281, 15.0025368, 0.000e-00,\n 0.5529940, -0.0001145, -1.130e-05,\n 0.0068220, -0.0001139, -1.120e-05,\n 0.0046952, 0.0046718,\n// 44 8 11\n1737352.355524, 21.0, -4.0, 4.0, 10090.0, 10090.0,\n 0.1004050, 0.5503082, -4.080e-05, -8.410e-06,\n -0.7863060, -0.1181112, -5.740e-05, 1.710e-06,\n 16.0134506, -0.0120330, -4.000e-06,\n 134.3795471, 15.0022678, 0.000e-00,\n 0.5415280, 0.0000974, -1.200e-05,\n -0.0045870, 0.0000969, -1.190e-05,\n 0.0046451, 0.0046219,\n// 45 2 5\n1737530.489917, 0.0, -4.0, 4.0, 10085.3, 10085.3,\n 0.1318920, 0.5019051, -1.350e-05, -5.870e-06,\n -0.0251030, 0.1041509, 1.032e-04, -1.150e-06,\n -16.2381306, 0.0122640, 4.000e-06,\n 175.6912079, 15.0009499, 0.000e-00,\n 0.5682730, -0.0000860, -1.010e-05,\n 0.0220250, -0.0000856, -1.010e-05,\n 0.0047106, 0.0046871,\n// 45 8 1\n1737707.007292, 12.0, -4.0, 4.0, 10080.5, 10080.5,\n -0.1010190, 0.5762281, -1.880e-05, -9.800e-06,\n 0.0146960, -0.0903696, -1.292e-04, 1.440e-06,\n 18.8822994, -0.0099250, -4.000e-06,\n 359.2861633, 15.0012951, 0.000e-00,\n 0.5322320, 0.0000306, -1.290e-05,\n -0.0138360, 0.0000304, -1.280e-05,\n 0.0046318, 0.0046087,\n// 46 1 25\n1737884.477267, 23.0, -4.0, 4.0, 10075.7, 10075.7,\n -0.1184070, 0.4991272, -1.710e-05, -5.580e-06,\n -0.7810720, 0.0721662, 1.502e-04, -7.400e-07,\n -19.3172607, 0.0099480, 5.000e-06,\n 161.0124207, 14.9992580, 0.000e-00,\n 0.5732570, 0.0000288, -9.900e-06,\n 0.0269840, 0.0000287, -9.800e-06,\n 0.0047250, 0.0047015,\n// 46 7 22\n1738061.708700, 5.0, -4.0, 4.0, 10070.9, 10070.9,\n 0.0637560, 0.5731184, -7.000e-06, -9.360e-06,\n 0.7306180, -0.0539993, -1.895e-04, 7.700e-07,\n 21.1324406, -0.0074930, -5.000e-06,\n 254.4490051, 15.0003157, 0.000e-00,\n 0.5349070, -0.0000725, -1.250e-05,\n -0.0111750, -0.0000722, -1.240e-05,\n 0.0046205, 0.0045975,\n// 46 12 16\n1738208.894945, 9.0, -4.0, 4.0, 10067.0, 10067.0,\n -0.0397640, 0.5349277, 6.600e-06, -7.290e-06,\n 1.5029600, -0.0790635, 9.670e-05, 1.230e-06,\n -23.5141201, -0.0020210, 7.000e-06,\n 315.1882629, 14.9962234, 0.000e-00,\n 0.5569300, 0.0001318, -1.140e-05,\n 0.0107380, 0.0001312, -1.130e-05,\n 0.0047569, 0.0047332,\n// 47 1 15\n1738238.532045, 1.0, -4.0, 4.0, 10066.2, 10066.2,\n 0.2253650, 0.5227410, -3.550e-05, -6.510e-06,\n -1.3998210, 0.0389260, 2.039e-04, -4.300e-07,\n -21.6488094, 0.0071120, 5.000e-06,\n 191.7726440, 14.9977818, 0.000e-00,\n 0.5641900, 0.0000994, -1.060e-05,\n 0.0179620, 0.0000990, -1.060e-05,\n 0.0047368, 0.0047132,\n// 47 6 12\n1738386.804425, 7.0, -4.0, 4.0, 10062.2, 10062.2,\n 0.0595340, 0.5190567, 4.090e-05, -6.580e-06,\n -1.1628180, 0.1002260, -9.550e-05, -1.380e-06,\n 23.1231709, 0.0034330, -6.000e-06,\n 286.4073792, 14.9994488, 0.000e-00,\n 0.5542330, -0.0001027, -1.050e-05,\n 0.0080550, -0.0001022, -1.050e-05,\n 0.0045965, 0.0045736,\n// 47 7 11\n1738416.264460, 18.0, -4.0, 4.0, 10061.4, 10061.4,\n -0.1492470, 0.5458096, 1.900e-05, -7.620e-06,\n 1.5393831, -0.0141326, -2.287e-04, 7.000e-08,\n 22.7274303, -0.0047330, -5.000e-06,\n 89.8503265, 14.9994841, 0.000e-00,\n 0.5473950, -0.0001098, -1.120e-05,\n 0.0012510, -0.0001093, -1.110e-05,\n 0.0046112, 0.0045883,\n// 47 12 5\n1738563.378173, 21.0, -4.0, 4.0, 10057.5, 10057.5,\n 0.1272420, 0.5573069, 1.920e-05, -8.960e-06,\n 0.7316570, -0.1310577, 1.255e-04, 2.280e-06,\n -22.4943504, -0.0053300, 6.000e-06,\n 136.4568634, 14.9969206, 0.000e-00,\n 0.5429870, 0.0000828, -1.270e-05,\n -0.0031360, 0.0000824, -1.260e-05,\n 0.0047586, 0.0047349,\n// 48 5 31\n1738740.938972, 11.0, -4.0, 4.0, 10052.7, 10052.7,\n 0.3356200, 0.4890004, 2.850e-05, -5.490e-06,\n -0.3313840, 0.1344581, -1.150e-04, -1.640e-06,\n 21.7454605, 0.0063210, -5.000e-06,\n 346.8052063, 15.0002193, 0.000e-00,\n 0.5645900, -0.0000433, -9.700e-06,\n 0.0183600, -0.0000431, -9.700e-06,\n 0.0045960, 0.0045731,\n// 48 11 24\n1738918.020940, 12.0, -4.0, 4.0, 10047.9, 10047.9,\n -0.2589850, 0.5552968, 6.220e-05, -9.370e-06,\n 0.1518440, -0.1757147, 1.381e-04, 3.160e-06,\n -20.6506100, -0.0083170, 5.000e-06,\n 2.4798501, 14.9980555, 0.000e-00,\n 0.5388070, -0.0000053, -1.310e-05,\n -0.0072950, -0.0000053, -1.310e-05,\n 0.0047577, 0.0047340,\n// 49 5 20\n1739094.968345, 11.0, -4.0, 4.0, 10043.2, 10043.2,\n -0.2349340, 0.4832540, 3.900e-05, -5.570e-06,\n 0.2978070, 0.1696581, -1.268e-04, -2.090e-06,\n 19.5806408, 0.0089360, -4.000e-06,\n 346.9313354, 15.0013313, 0.000e-00,\n 0.5623510, 0.0000701, -9.900e-06,\n 0.0161330, 0.0000697, -9.900e-06,\n 0.0045980, 0.0045751,\n// 49 11 14\n1739272.629824, 3.0, -4.0, 4.0, 10038.4, 10038.4,\n -0.2854470, 0.5250742, 7.570e-05, -7.990e-06,\n -0.5556250, -0.2036950, 1.437e-04, 3.300e-06,\n -18.0716896, -0.0109040, 4.000e-06,\n 228.1641083, 14.9994040, 0.000e-00,\n 0.5470320, -0.0001011, -1.230e-05,\n 0.0008890, -0.0001006, -1.220e-05,\n 0.0047544, 0.0047307,\n// 50 5 9\n1739449.194292, 17.0, -4.0, 4.0, 10033.7, 10033.7,\n -0.2548090, 0.4990364, 3.690e-05, -6.690e-06,\n 1.0883300, 0.2071315, -1.523e-04, -2.910e-06,\n 16.8098507, 0.0110980, -4.000e-06,\n 76.7424698, 15.0025511, 0.000e-00,\n 0.5494330, 0.0001100, -1.100e-05,\n 0.0032790, 0.0001094, -1.090e-05,\n 0.0046022, 0.0045793,\n// 50 11 3\n1739627.017964, 12.0, -4.0, 4.0, 10028.9, 10028.9,\n -0.7700630, 0.4828314, 8.810e-05, -6.100e-06,\n -1.1572720, -0.2170413, 1.334e-04, 2.950e-06,\n -14.7988195, -0.0130490, 3.000e-06,\n 3.4739699, 15.0008125, 0.000e-00,\n 0.5622800, -0.0001032, -1.080e-05,\n 0.0160620, -0.0001026, -1.080e-05,\n 0.0047485, 0.0047248,\n// 51 3 30\n1739774.396608, 22.0, -4.0, 4.0, 10025.0, 10025.0,\n 0.6178790, 0.5079639, -2.980e-05, -8.430e-06,\n -0.5352910, 0.2825232, 1.200e-05, -4.900e-06,\n 3.0321600, 0.0154440, -1.000e-06,\n 148.8769836, 15.0051718, 0.000e-00,\n 0.5333700, 0.0000292, -1.280e-05,\n -0.0127040, 0.0000290, -1.270e-05,\n 0.0046382, 0.0046151,\n// 51 9 23\n1739951.339181, 20.0, -4.0, 4.0, 10020.2, 10020.2,\n 0.3780820, 0.4391982, -1.970e-05, -4.800e-06,\n 0.8155720, -0.2473063, -3.430e-05, 2.880e-06,\n 0.6962800, -0.0160860, 0.000e-00,\n 121.7768173, 15.0040846, 0.000e-00,\n 0.5721600, 0.0000208, -9.800e-06,\n 0.0258930, 0.0000207, -9.800e-06,\n 0.0047041, 0.0046807,\n// 52 3 19\n1740129.096751, 14.0, -4.0, 4.0, 10015.4, 10015.4,\n -0.1376250, 0.5047349, 1.140e-05, -8.280e-06,\n -0.1356700, 0.2835549, 1.680e-05, -4.860e-06,\n -1.0946300, 0.0156380, 0.000e-00,\n 27.8799305, 15.0050402, 0.000e-00,\n 0.5350560, -0.0000523, -1.270e-05,\n -0.0110270, -0.0000520, -1.260e-05,\n 0.0046518, 0.0046286,\n// 52 9 11\n1740305.389306, 21.0, -4.0, 4.0, 10010.7, 10010.7,\n -0.0779840, 0.4569846, -2.670e-05, -5.530e-06,\n 0.2295960, -0.2521176, -2.970e-05, 3.230e-06,\n 5.1328802, -0.0156230, -1.000e-06,\n 135.9595642, 15.0040770, 0.000e-00,\n 0.5625160, 0.0001127, -1.050e-05,\n 0.0162960, 0.0001122, -1.040e-05,\n 0.0046884, 0.0046650,\n// 53 3 9\n1740483.680090, 4.0, -4.0, 4.0, 10005.9, 10005.9,\n -0.4926130, 0.4834910, 2.440e-05, -6.850e-06,\n 0.5289480, 0.2650959, 8.700e-06, -3.960e-06,\n -5.2501302, 0.0154340, 1.000e-06,\n 236.9631195, 15.0044613, 0.000e-00,\n 0.5477330, -0.0001143, -1.160e-05,\n 0.0015870, -0.0001137, -1.150e-05,\n 0.0046669, 0.0046436,\n// 53 9 1\n1740659.728912, 5.0, -4.0, 4.0, 10001.2, 10001.2,\n -0.5080390, 0.4922797, -1.930e-05, -7.160e-06,\n -0.3804000, -0.2570181, -2.540e-05, 3.920e-06,\n 9.2718000, -0.0146740, -2.000e-06,\n 255.2335358, 15.0037203, 0.000e-00,\n 0.5461760, 0.0001301, -1.180e-05,\n 0.0000380, 0.0001295, -1.170e-05,\n 0.0046724, 0.0046491,\n// 54 1 27\n1740808.286083, 19.0, -4.0, 4.0, 9997.3, 9997.3,\n 0.5668550, 0.4761293, -5.540e-05, -5.350e-06,\n -1.3424700, 0.1753958, 1.675e-04, -2.110e-06,\n -18.8465900, 0.0101420, 4.000e-06,\n 100.9322433, 14.9994774, 0.000e-00,\n 0.5716110, -0.0000581, -1.000e-05,\n 0.0253460, -0.0000578, -9.900e-06,\n 0.0047228, 0.0046993,\n// 54 2 26\n1740837.983046, 12.0, -4.0, 4.0, 9996.5, 9996.5,\n -0.4967490, 0.4606482, 1.040e-05, -5.470e-06,\n 1.4207840, 0.2380460, -4.900e-06, -3.020e-06,\n -9.3753595, 0.0147550, 2.000e-06,\n 356.2219543, 15.0034609, 0.000e-00,\n 0.5636930, -0.0001063, -1.030e-05,\n 0.0174680, -0.0001058, -1.030e-05,\n 0.0046830, 0.0046596,\n// 54 7 23\n1740985.016972, 12.0, -4.0, 4.0, 9992.5, 9992.5,\n 0.1466860, 0.5592299, -5.260e-05, -9.510e-06,\n 1.3006010, -0.1698759, -2.163e-04, 3.050e-06,\n 20.8767796, -0.0075610, -5.000e-06,\n 359.4074707, 15.0004025, 0.000e-00,\n 0.5312950, 0.0000072, -1.290e-05,\n -0.0147690, 0.0000072, -1.280e-05,\n 0.0046215, 0.0045985,\n// 54 8 21\n1741014.335090, 20.0, -4.0, 4.0, 9991.7, 9991.7,\n -0.5619020, 0.5240852, -1.210e-05, -8.700e-06,\n -1.1223940, -0.2497113, -1.190e-05, 4.330e-06,\n 13.0031700, -0.0133210, -3.000e-06,\n 119.6780777, 15.0030603, 0.000e-00,\n 0.5344870, 0.0000498, -1.280e-05,\n -0.0115930, 0.0000495, -1.270e-05,\n 0.0046571, 0.0046339,\n// 55 1 16\n1741162.255368, 18.0, -4.0, 4.0, 9987.8, 9987.8,\n 0.1542880, 0.4870323, -5.280e-05, -5.490e-06,\n -0.7625330, 0.1419828, 1.626e-04, -1.750e-06,\n -21.3338108, 0.0073570, 5.000e-06,\n 86.6296463, 14.9979124, 0.000e-00,\n 0.5723510, 0.0000518, -1.000e-05,\n 0.0260830, 0.0000516, -9.900e-06,\n 0.0047354, 0.0047118,\n// 55 7 13\n1741339.699340, 5.0, -4.0, 4.0, 9983.0, 9983.0,\n 0.2518610, 0.5538384, -3.500e-05, -8.690e-06,\n 0.5406210, -0.1289933, -1.844e-04, 2.160e-06,\n 22.5462894, -0.0048830, -5.000e-06,\n 254.7753143, 14.9995966, 0.000e-00,\n 0.5374160, -0.0000984, -1.220e-05,\n -0.0086780, -0.0000979, -1.210e-05,\n 0.0046119, 0.0045890,\n// 56 1 5\n1741516.378811, 21.0, -4.0, 4.0, 9978.3, 9978.3,\n -0.0369920, 0.5219941, -4.870e-05, -6.800e-06,\n -0.0616910, 0.1082909, 1.584e-04, -1.560e-06,\n -22.9596691, 0.0041510, 6.000e-06,\n 132.6976929, 14.9967861, 0.000e-00,\n 0.5602530, 0.0001180, -1.100e-05,\n 0.0140450, 0.0001174, -1.090e-05,\n 0.0047452, 0.0047216,\n// 56 7 1\n1741694.186085, 16.0, -4.0, 4.0, 9973.5, 9973.5,\n -0.2745440, 0.5296872, 3.900e-06, -6.980e-06,\n -0.1413830, -0.0815967, -1.491e-04, 1.190e-06,\n 23.4989891, -0.0019460, -6.000e-06,\n 60.3205299, 14.9990797, 0.000e-00,\n 0.5514960, -0.0001050, -1.080e-05,\n 0.0053320, -0.0001045, -1.080e-05,\n 0.0046047, 0.0045817,\n// 56 12 25\n1741870.803158, 7.0, -4.0, 4.0, 9968.8, 9968.8,\n -0.2319960, 0.5622042, -2.460e-05, -8.780e-06,\n 0.6150920, 0.0681598, 1.431e-04, -1.190e-06,\n -23.6584206, 0.0007560, 7.000e-06,\n 283.9906006, 14.9962740, 0.000e-00,\n 0.5453590, 0.0001033, -1.240e-05,\n -0.0007750, 0.0001028, -1.240e-05,\n 0.0047521, 0.0047285,\n// 57 6 20\n1742048.374498, 21.0, -4.0, 4.0, 9964.1, 9964.1,\n -0.0641840, 0.5083673, -3.000e-07, -5.820e-06,\n -0.9788160, -0.0365335, -1.101e-04, 5.200e-07,\n 23.6431198, 0.0011460, -6.000e-06,\n 135.9382477, 14.9990339, 0.000e-00,\n 0.5634560, -0.0000539, -9.800e-06,\n 0.0172320, -0.0000536, -9.800e-06,\n 0.0045997, 0.0045768,\n// 57 11 15\n1742195.982863, 12.0, -4.0, 4.0, 9960.1, 9960.1,\n -0.0002610, 0.5717561, 3.100e-05, -9.590e-06,\n -1.4255140, -0.0969646, 2.109e-04, 1.550e-06,\n -18.4545097, -0.0108320, 4.000e-06,\n 3.0989101, 14.9993277, 0.000e-00,\n 0.5397560, -0.0000579, -1.300e-05,\n -0.0063510, -0.0000576, -1.290e-05,\n 0.0047545, 0.0047308,\n// 57 12 14\n1742225.427467, 22.0, -4.0, 4.0, 9959.4, 9959.4,\n -0.1956770, 0.5821730, 3.100e-06, -9.900e-06,\n 1.2704800, 0.0203768, 1.071e-04, -4.700e-07,\n -23.4470692, -0.0026320, 7.000e-06,\n 150.3306427, 14.9963884, 0.000e-00,\n 0.5384670, 0.0000122, -1.320e-05,\n -0.0076330, 0.0000121, -1.310e-05,\n 0.0047564, 0.0047327,\n// 58 5 11\n1742372.818939, 8.0, -4.0, 4.0, 9955.4, 9955.4,\n -0.0295810, 0.5091601, 9.800e-06, -6.130e-06,\n 1.1024430, 0.0977963, -1.514e-04, -1.090e-06,\n 17.2713203, 0.0110360, -4.000e-06,\n 301.7907715, 15.0023947, 0.000e-00,\n 0.5595940, 0.0000798, -1.010e-05,\n 0.0133900, 0.0000794, -1.010e-05,\n 0.0046019, 0.0045790,\n// 58 11 5\n1742550.548001, 1.0, -4.0, 4.0, 9950.6, 9950.6,\n -0.2522420, 0.5404588, 5.120e-05, -7.900e-06,\n -0.7415090, -0.1210097, 1.325e-04, 1.710e-06,\n -15.3148899, -0.0129950, 3.000e-06,\n 198.4557953, 15.0007439, 0.000e-00,\n 0.5509330, -0.0001117, -1.190e-05,\n 0.0047710, -0.0001111, -1.180e-05,\n 0.0047489, 0.0047253,\n// 59 4 30\n1742727.128176, 15.0, -4.0, 4.0, 9945.9, 9945.9,\n -0.1056820, 0.5343768, 9.400e-06, -7.620e-06,\n 0.2585480, 0.1293206, -1.033e-04, -1.760e-06,\n 14.0555601, 0.0128490, -3.000e-06,\n 46.3357582, 15.0035639, 0.000e-00,\n 0.5454000, 0.0001185, -1.140e-05,\n -0.0007340, 0.0001179, -1.130e-05,\n 0.0046080, 0.0045851,\n// 59 10 25\n1742904.851966, 8.0, -4.0, 4.0, 9941.2, 9941.2,\n -0.2483720, 0.5024480, 4.150e-05, -6.120e-06,\n -0.0277390, -0.1350827, 6.510e-05, 1.580e-06,\n -11.5861502, -0.0146560, 3.000e-06,\n 303.4307861, 15.0020542, 0.000e-00,\n 0.5661990, -0.0000885, -1.050e-05,\n 0.0199610, -0.0000881, -1.040e-05,\n 0.0047408, 0.0047172,\n// 60 4 19\n1743081.714033, 5.0, -4.0, 4.0, 9936.4, 9936.4,\n 0.0542460, 0.5563007, 6.200e-06, -9.190e-06,\n -0.4848850, 0.1564606, -4.110e-05, -2.510e-06,\n 10.4999704, 0.0142050, -2.000e-06,\n 255.6409454, 15.0044918, 0.000e-00,\n 0.5336690, 0.0000656, -1.260e-05,\n -0.0124070, 0.0000653, -1.250e-05,\n 0.0046164, 0.0045934,\n// 60 10 13\n1743258.879062, 9.0, -4.0, 4.0, 9931.7, 9931.7,\n 0.1303930, 0.4819250, 7.900e-06, -5.350e-06,\n 0.6013960, -0.1455812, 1.710e-05, 1.550e-06,\n -7.3932700, -0.0157610, 2.000e-06,\n 318.0519409, 15.0031471, 0.000e-00,\n 0.5738660, -0.0000052, -9.800e-06,\n 0.0275900, -0.0000052, -9.800e-06,\n 0.0047297, 0.0047062,\n// 61 3 10\n1743407.080831, 14.0, -4.0, 4.0, 9927.8, 9927.8,\n -0.3864340, 0.5455990, 2.400e-05, -8.790e-06,\n 1.3201760, 0.1746288, -3.910e-05, -2.760e-06,\n -4.6798701, 0.0157100, 1.000e-06,\n 27.0817299, 15.0047064, 0.000e-00,\n 0.5381300, -0.0000862, -1.250e-05,\n -0.0079680, -0.0000857, -1.240e-05,\n 0.0046644, 0.0046412,\n// 61 4 8\n1743436.421899, 22.0, -4.0, 4.0, 9927.0, 9927.0,\n 0.2859030, 0.5558366, 9.000e-07, -9.400e-06,\n -1.1634300, 0.1731722, 2.790e-05, -2.840e-06,\n 6.6804800, 0.0151580, -2.000e-06,\n 149.7674255, 15.0050640, 0.000e-00,\n 0.5323570, -0.0000354, -1.280e-05,\n -0.0137120, -0.0000353, -1.270e-05,\n 0.0046271, 0.0046040,\n// 61 10 2\n1743612.878791, 9.0, -4.0, 4.0, 9922.3, 9922.3,\n 0.3503640, 0.4903137, -2.210e-05, -5.810e-06,\n 1.2392780, -0.1580959, -2.960e-05, 1.830e-06,\n -2.9587700, -0.0162730, 1.000e-06,\n 317.4127197, 15.0039206, 0.000e-00,\n 0.5672160, 0.0000924, -1.020e-05,\n 0.0209730, 0.0000920, -1.020e-05,\n 0.0047159, 0.0046924,\n// 62 2 28\n1743761.595446, 2.0, -4.0, 4.0, 9918.3, 9918.3,\n -0.3494780, 0.5192309, 1.750e-05, -7.080e-06,\n 0.6296920, 0.1528953, 2.850e-05, -2.030e-06,\n -8.7629604, 0.0151030, 2.000e-06,\n 206.3136444, 15.0037689, 0.000e-00,\n 0.5530030, -0.0001178, -1.120e-05,\n 0.0068310, -0.0001172, -1.110e-05,\n 0.0046803, 0.0046569,\n// 62 8 23\n1743937.678496, 4.0, -4.0, 4.0, 9913.6, 9913.6,\n -0.3567030, 0.5460720, -1.730e-05, -8.440e-06,\n -0.7283320, -0.1431860, -3.410e-05, 2.120e-06,\n 12.5321798, -0.0137770, -3.000e-06,\n 239.7412872, 15.0032291, 0.000e-00,\n 0.5414480, 0.0001127, -1.210e-05,\n -0.0046670, 0.0001122, -1.200e-05,\n 0.0046590, 0.0046358,\n// 63 2 17\n1744115.805443, 7.0, -4.0, 4.0, 9908.8, 9908.8,\n -0.1591830, 0.4955901, -2.600e-06, -5.760e-06,\n -0.0602490, 0.1271059, 7.960e-05, -1.410e-06,\n -12.7120199, 0.0139590, 3.000e-06,\n 280.8152466, 15.0024452, 0.000e-00,\n 0.5680100, -0.0000699, -1.010e-05,\n 0.0217640, -0.0000695, -1.000e-05,\n 0.0046965, 0.0046731,\n// 63 8 12\n1744292.333033, 20.0, -4.0, 4.0, 9904.2, 9904.2,\n -0.0077140, 0.5704963, -2.500e-05, -9.720e-06,\n -0.0559270, -0.1225714, -1.015e-04, 2.000e-06,\n 15.9034300, -0.0120850, -4.000e-06,\n 119.3800583, 15.0023623, 0.000e-00,\n 0.5327670, 0.0000200, -1.290e-05,\n -0.0133040, 0.0000199, -1.280e-05,\n 0.0046446, 0.0046215,\n// 64 2 6\n1744469.794388, 7.0, -4.0, 4.0, 9899.4, 9899.4,\n 0.1151360, 0.4945118, -2.850e-05, -5.540e-06,\n -0.7215810, 0.1019662, 1.248e-04, -1.080e-06,\n -16.3295193, 0.0122130, 4.000e-06,\n 280.6957092, 15.0008726, 0.000e-00,\n 0.5722260, 0.0000264, -9.900e-06,\n 0.0259580, 0.0000262, -9.800e-06,\n 0.0047119, 0.0046884,\n// 64 8 1\n1744647.025149, 13.0, -4.0, 4.0, 9894.7, 9894.7,\n 0.3315020, 0.5668475, -2.620e-05, -9.200e-06,\n 0.6289020, -0.0911548, -1.644e-04, 1.380e-06,\n 18.7700996, -0.0100190, -4.000e-06,\n 14.2764702, 15.0013237, 0.000e-00,\n 0.5360810, -0.0000872, -1.240e-05,\n -0.0100060, -0.0000868, -1.240e-05,\n 0.0046320, 0.0046089,\n// 64 12 26\n1744794.247905, 18.0, -4.0, 4.0, 9890.8, 9890.8,\n 0.1175300, 0.5416097, -1.310e-05, -7.460e-06,\n 1.4760610, -0.0330862, 9.840e-05, 5.900e-07,\n -23.6166191, 0.0015000, 7.000e-06,\n 88.8104477, 14.9962645, 0.000e-00,\n 0.5558550, 0.0001192, -1.140e-05,\n 0.0096690, 0.0001186, -1.140e-05,\n 0.0047518, 0.0047282,\n// 65 1 25\n1744823.866318, 9.0, -4.0, 4.0, 9890.0, 9890.0,\n 0.3097710, 0.5204406, -4.690e-05, -6.540e-06,\n -1.3625730, 0.0760905, 1.818e-04, -9.100e-07,\n -19.3613205, 0.0098940, 5.000e-06,\n 311.0293274, 14.9992762, 0.000e-00,\n 0.5626850, 0.0001019, -1.070e-05,\n 0.0164650, 0.0001013, -1.060e-05,\n 0.0047252, 0.0047017,\n// 65 6 22\n1744972.084859, 14.0, -4.0, 4.0, 9886.0, 9886.0,\n 0.1186110, 0.5233346, 2.750e-05, -6.580e-06,\n -1.2313280, 0.0586643, -1.003e-04, -8.300e-07,\n 23.6769791, 0.0004080, -6.000e-06,\n 30.8330593, 14.9990406, 0.000e-00,\n 0.5553190, -0.0001050, -1.050e-05,\n 0.0091360, -0.0001045, -1.040e-05,\n 0.0045999, 0.0045770,\n// 65 7 22\n1745001.561916, 1.0, -4.0, 4.0, 9885.2, 9885.2,\n -0.1177410, 0.5410379, 7.000e-06, -7.460e-06,\n 1.4917589, -0.0533872, -2.123e-04, 6.200e-07,\n 21.0851898, -0.0075530, -5.000e-06,\n 194.4337463, 15.0002613, 0.000e-00,\n 0.5489530, -0.0001064, -1.110e-05,\n 0.0028020, -0.0001059, -1.110e-05,\n 0.0046210, 0.0045980,\n// 65 12 16\n1745148.744811, 6.0, -4.0, 4.0, 9881.3, 9881.3,\n 0.1799920, 0.5674547, 5.400e-06, -9.190e-06,\n 0.7233670, -0.0844923, 1.373e-04, 1.520e-06,\n -23.5236092, -0.0019230, 6.000e-06,\n 270.1665955, 14.9963036, 0.000e-00,\n 0.5423520, 0.0000729, -1.280e-05,\n -0.0037670, 0.0000725, -1.270e-05,\n 0.0047561, 0.0047324,\n// 66 6 11\n1745326.203550, 17.0, -4.0, 4.0, 9876.6, 9876.6,\n 0.1530600, 0.4970473, 2.610e-05, -5.580e-06,\n -0.4773160, 0.0976392, -1.226e-04, -1.210e-06,\n 23.1038704, 0.0034880, -6.000e-06,\n 76.4030609, 14.9994020, 0.000e-00,\n 0.5649330, -0.0000294, -9.700e-06,\n 0.0187010, -0.0000292, -9.700e-06,\n 0.0045969, 0.0045740,\n// 66 12 5\n1745503.391077, 21.0, -4.0, 4.0, 9871.9, 9871.9,\n -0.2031570, 0.5668099, 5.300e-05, -9.570e-06,\n 0.1176980, -0.1325397, 1.604e-04, 2.410e-06,\n -22.5420094, -0.0052080, 6.000e-06,\n 136.4275513, 14.9969158, 0.000e-00,\n 0.5389770, -0.0000144, -1.310e-05,\n -0.0071250, -0.0000143, -1.310e-05,\n 0.0047583, 0.0047346,\n// 67 5 31\n1745680.237752, 18.0, -4.0, 4.0, 9867.2, 9867.2,\n 0.0729730, 0.4947936, 2.370e-05, -5.750e-06,\n 0.3018020, 0.1370308, -1.442e-04, -1.720e-06,\n 21.6944008, 0.0063910, -5.000e-06,\n 91.7960434, 15.0002565, 0.000e-00,\n 0.5616670, 0.0000656, -9.900e-06,\n 0.0154530, 0.0000652, -9.900e-06,\n 0.0045961, 0.0045732,\n// 67 11 25\n1745857.991719, 12.0, -4.0, 4.0, 9862.4, 9862.4,\n -0.0783840, 0.5360440, 6.530e-05, -8.110e-06,\n -0.6250410, -0.1674363, 1.720e-04, 2.720e-06,\n -20.7263393, -0.0082320, 5.000e-06,\n 2.4633400, 14.9979601, 0.000e-00,\n 0.5479130, -0.0001121, -1.220e-05,\n 0.0017660, -0.0001116, -1.210e-05,\n 0.0047580, 0.0047343,\n// 68 5 19\n1746034.483580, 0.0, -4.0, 4.0, 9857.7, 9857.7,\n -0.1349430, 0.5122801, 3.230e-05, -6.970e-06,\n 1.0351570, 0.1787130, -1.712e-04, -2.560e-06,\n 19.5655804, 0.0089260, -4.000e-06,\n 181.9208527, 15.0014067, 0.000e-00,\n 0.5481950, 0.0001098, -1.100e-05,\n 0.0020470, 0.0001092, -1.100e-05,\n 0.0045976, 0.0045747,\n// 68 11 13\n1746212.363135, 21.0, -4.0, 4.0, 9853.0, 9853.0,\n -0.3509870, 0.4925433, 7.560e-05, -6.190e-06,\n -1.3314350, -0.1892849, 1.659e-04, 2.570e-06,\n -18.1046906, -0.0109070, 4.000e-06,\n 138.1697998, 14.9993048, 0.000e-00,\n 0.5634030, -0.0001174, -1.080e-05,\n 0.0171790, -0.0001168, -1.070e-05,\n 0.0047549, 0.0047312,\n// 69 4 10\n1746359.717557, 5.0, -4.0, 4.0, 9849.1, 9849.1,\n 0.2770600, 0.5130118, 2.000e-07, -8.560e-06,\n -0.7896270, 0.2749774, 2.300e-06, -4.800e-06,\n 7.1833701, 0.0148140, -2.000e-06,\n 254.8890228, 15.0049038, 0.000e-00,\n 0.5323740, 0.0000414, -1.280e-05,\n -0.0136950, 0.0000412, -1.270e-05,\n 0.0046258, 0.0046027,\n// 69 10 4\n1746536.652763, 4.0, -4.0, 4.0, 9844.4, 9844.4,\n 0.5974880, 0.4403191, -1.560e-05, -4.810e-06,\n 0.7271810, -0.2452389, -9.100e-06, 2.860e-06,\n -3.6980300, -0.0160110, 1.000e-06,\n 242.5314636, 15.0037107, 0.000e-00,\n 0.5729310, 0.0000170, -9.800e-06,\n 0.0266600, 0.0000169, -9.800e-06,\n 0.0047182, 0.0046947,\n// 70 3 30\n1746714.422211, 22.0, -4.0, 4.0, 9839.7, 9839.7,\n -0.0159830, 0.5048202, 1.910e-05, -8.240e-06,\n -0.1292550, 0.2814943, -6.700e-06, -4.800e-06,\n 3.1826501, 0.0154330, -1.000e-06,\n 148.9159851, 15.0051537, 0.000e-00,\n 0.5347580, -0.0000622, -1.260e-05,\n -0.0113230, -0.0000619, -1.260e-05,\n 0.0046382, 0.0046151,\n// 70 9 23\n1746890.708419, 5.0, -4.0, 4.0, 9835.0, 9835.0,\n 0.0961640, 0.4559232, -2.130e-05, -5.550e-06,\n 0.1728510, -0.2569139, -5.000e-06, 3.320e-06,\n 0.7885100, -0.0160550, 0.000e-00,\n 256.7572632, 15.0041342, 0.000e-00,\n 0.5626600, 0.0001087, -1.050e-05,\n 0.0164400, 0.0001082, -1.050e-05,\n 0.0047031, 0.0046797,\n// 71 3 20\n1747068.999165, 12.0, -4.0, 4.0, 9830.2, 9830.2,\n -0.3102650, 0.4794062, 2.900e-05, -6.730e-06,\n 0.5759060, 0.2687812, -1.580e-05, -3.980e-06,\n -0.9752400, 0.0156760, 0.000e-00,\n 357.9114685, 15.0049801, 0.000e-00,\n 0.5477650, -0.0001229, -1.150e-05,\n 0.0016190, -0.0001223, -1.140e-05,\n 0.0046524, 0.0046292,\n// 71 9 12\n1747245.059423, 13.0, -4.0, 4.0, 9825.5, 9825.5,\n -0.4647320, 0.4880011, -9.100e-06, -7.160e-06,\n -0.3518260, -0.2686969, -2.700e-06, 4.130e-06,\n 5.1095800, -0.0155830, -1.000e-06,\n 15.9635201, 15.0041590, 0.000e-00,\n 0.5461980, 0.0001268, -1.190e-05,\n 0.0000600, 0.0001262, -1.180e-05,\n 0.0046874, 0.0046641,\n// 72 2 8\n1747393.604223, 2.0, -4.0, 4.0, 9821.6, 9821.6,\n 0.3585030, 0.4648397, -4.700e-05, -5.190e-06,\n -1.4617190, 0.2019501, 1.482e-04, -2.400e-06,\n -15.7670898, 0.0123110, 3.000e-06,\n 205.6879883, 15.0010710, 0.000e-00,\n 0.5711550, -0.0000404, -9.900e-06,\n 0.0248920, -0.0000402, -9.900e-06,\n 0.0047093, 0.0046859,\n// 72 3 8\n1747423.290564, 19.0, -4.0, 4.0, 9820.8, 9820.8,\n -0.6824810, 0.4540910, 2.710e-05, -5.340e-06,\n 1.2790350, 0.2478337, -2.150e-05, -3.110e-06,\n -5.2426200, 0.0154770, 1.000e-06,\n 101.9626617, 15.0043859, 0.000e-00,\n 0.5635280, -0.0000943, -1.020e-05,\n 0.0173040, -0.0000938, -1.020e-05,\n 0.0046678, 0.0046446,\n// 72 8 2\n1747570.337612, 20.0, -4.0, 4.0, 9816.9, 9816.9,\n 0.4173020, 0.5468771, -6.810e-05, -9.270e-06,\n 1.2814810, -0.2053873, -1.938e-04, 3.660e-06,\n 18.4316101, -0.0100440, -4.000e-06,\n 119.2759399, 15.0014076, 0.000e-00,\n 0.5319830, -0.0000067, -1.290e-05,\n -0.0140840, -0.0000066, -1.280e-05,\n 0.0046333, 0.0046102,\n// 72 9 1\n1747599.668992, 4.0, -4.0, 4.0, 9816.1, 9816.1,\n -0.5865020, 0.5157395, -2.000e-07, -8.590e-06,\n -1.0583570, -0.2679922, 9.600e-06, 4.650e-06,\n 9.1427402, -0.0146810, -2.000e-06,\n 240.2562256, 15.0038033, 0.000e-00,\n 0.5349760, 0.0000446, -1.290e-05,\n -0.0111060, 0.0000443, -1.280e-05,\n 0.0046720, 0.0046488,\n// 73 1 27\n1747747.579497, 2.0, -4.0, 4.0, 9812.2, 9812.2,\n 0.3181860, 0.4770079, -6.180e-05, -5.380e-06,\n -0.7287190, 0.1756591, 1.398e-04, -2.150e-06,\n -18.9248695, 0.0100690, 4.000e-06,\n 205.9447327, 14.9994278, 0.000e-00,\n 0.5711830, 0.0000519, -1.000e-05,\n 0.0249200, 0.0000517, -1.000e-05,\n 0.0047234, 0.0046999,\n// 73 7 23\n1747925.008891, 12.0, -4.0, 4.0, 9807.5, 9807.5,\n 0.0777260, 0.5413622, -3.340e-05, -8.390e-06,\n 0.6586990, -0.1678781, -1.740e-04, 2.750e-06,\n 20.7992001, -0.0076640, -5.000e-06,\n 359.3951721, 15.0003958, 0.000e-00,\n 0.5387590, -0.0000915, -1.210e-05,\n -0.0073420, -0.0000910, -1.200e-05,\n 0.0046220, 0.0045990,\n// 74 1 16\n1748101.722028, 5.0, -4.0, 4.0, 9802.8, 9802.8,\n -0.1510560, 0.5138208, -5.230e-05, -6.750e-06,\n -0.1103670, 0.1492823, 1.426e-04, -2.120e-06,\n -21.3599892, 0.0072990, 5.000e-06,\n 251.6417847, 14.9979582, 0.000e-00,\n 0.5587800, 0.0001238, -1.110e-05,\n 0.0125790, 0.0001232, -1.100e-05,\n 0.0047353, 0.0047117,\n// 74 7 12\n1748279.474981, 23.0, -4.0, 4.0, 9798.1, 9798.1,\n -0.2319500, 0.5196463, -8.300e-06, -6.760e-06,\n -0.0547690, -0.1219835, -1.438e-04, 1.720e-06,\n 22.5261192, -0.0049400, -5.000e-06,\n 164.7614746, 14.9995222, 0.000e-00,\n 0.5529150, -0.0001044, -1.070e-05,\n 0.0067440, -0.0001039, -1.070e-05,\n 0.0046125, 0.0045895,\n// 75 1 5\n1748456.164602, 16.0, -4.0, 4.0, 9793.4, 9793.4,\n -0.1009430, 0.5560003, -4.290e-05, -8.730e-06,\n 0.6242060, 0.1155223, 1.321e-04, -1.960e-06,\n -22.9394798, 0.0041900, 6.000e-06,\n 57.6851006, 14.9968843, 0.000e-00,\n 0.5443450, 0.0000912, -1.250e-05,\n -0.0017840, 0.0000907, -1.240e-05,\n 0.0047448, 0.0047212,\n// 75 7 2\n1748633.643596, 3.0, -4.0, 4.0, 9788.7, 9788.7,\n -0.3602060, 0.5028460, -2.600e-06, -5.710e-06,\n -0.8538290, -0.0767809, -1.134e-04, 9.800e-07,\n 23.5047207, -0.0019190, -6.000e-06,\n 225.3142853, 14.9990149, 0.000e-00,\n 0.5642610, -0.0000383, -9.800e-06,\n 0.0180340, -0.0000381, -9.700e-06,\n 0.0046048, 0.0045818,\n// 75 11 26\n1748781.350985, 20.0, -4.0, 4.0, 9784.8, 9784.8,\n -0.3843730, 0.5762515, 4.370e-05, -9.620e-06,\n -1.3779891, -0.0578236, 2.327e-04, 8.900e-07,\n -21.0051098, -0.0081140, 5.000e-06,\n 122.3503036, 14.9978952, 0.000e-00,\n 0.5403220, -0.0000418, -1.300e-05,\n -0.0057870, -0.0000416, -1.290e-05,\n 0.0047580, 0.0047343,\n// 75 12 26\n1748810.796375, 7.0, -4.0, 4.0, 9784.0, 9784.0,\n -0.2184630, 0.5784017, -9.700e-06, -9.820e-06,\n 1.2562160, 0.0700308, 1.084e-04, -1.330e-06,\n -23.6481800, 0.0008780, 7.000e-06,\n 283.9544067, 14.9963217, 0.000e-00,\n 0.5382110, 0.0000023, -1.320e-05,\n -0.0078870, 0.0000022, -1.310e-05,\n 0.0047520, 0.0047283,\n// 76 5 21\n1748958.094301, 14.0, -4.0, 4.0, 9780.1, 9780.1,\n -0.2881810, 0.5157693, 1.460e-05, -6.270e-06,\n 1.1384920, 0.0680702, -1.734e-04, -7.400e-07,\n 19.9277592, 0.0088110, -4.000e-06,\n 31.9114704, 15.0012417, 0.000e-00,\n 0.5584800, 0.0000971, -1.020e-05,\n 0.0122810, 0.0000966, -1.010e-05,\n 0.0045974, 0.0045745,\n// 76 11 15\n1749135.904674, 10.0, -4.0, 4.0, 9775.4, 9775.4,\n 0.0293880, 0.5447248, 3.750e-05, -7.900e-06,\n -0.8001760, -0.0895110, 1.615e-04, 1.230e-06,\n -18.5331497, -0.0107790, 4.000e-06,\n 333.0960693, 14.9992180, 0.000e-00,\n 0.5520400, -0.0001242, -1.180e-05,\n 0.0058730, -0.0001236, -1.170e-05,\n 0.0047551, 0.0047314,\n// 77 5 10\n1749312.424736, 22.0, -4.0, 4.0, 9770.7, 9770.7,\n -0.1705450, 0.5422439, 1.230e-05, -7.830e-06,\n 0.3230100, 0.1036238, -1.294e-04, -1.410e-06,\n 17.2699203, 0.0110230, -4.000e-06,\n 151.7738342, 15.0024767, 0.000e-00,\n 0.5440480, 0.0001206, -1.140e-05,\n -0.0020790, 0.0001200, -1.140e-05,\n 0.0046013, 0.0045784,\n// 77 11 4\n1749490.189335, 17.0, -4.0, 4.0, 9766.0, 9766.0,\n 0.2088940, 0.5063864, 2.720e-05, -6.130e-06,\n -0.1502890, -0.1123214, 9.580e-05, 1.290e-06,\n -15.3303699, -0.0130050, 4.000e-06,\n 78.4684601, 15.0006552, 0.000e-00,\n 0.5673670, -0.0001049, -1.050e-05,\n 0.0211230, -0.0001044, -1.040e-05,\n 0.0047494, 0.0047257,\n// 78 4 30\n1749667.027443, 13.0, -4.0, 4.0, 9761.3, 9761.3,\n 0.2890370, 0.5629754, -1.200e-06, -9.360e-06,\n -0.3558470, 0.1355534, -7.240e-05, -2.170e-06,\n 14.1571598, 0.0127860, -3.000e-06,\n 16.3429699, 15.0035954, 0.000e-00,\n 0.5327670, 0.0000483, -1.260e-05,\n -0.0133040, 0.0000481, -1.250e-05,\n 0.0046078, 0.0045849,\n// 78 10 24\n1749844.202404, 17.0, -4.0, 4.0, 9756.6, 9756.6,\n 0.2241530, 0.4857641, 9.600e-06, -5.390e-06,\n 0.5565640, -0.1309126, 4.390e-05, 1.390e-06,\n -11.5002899, -0.0146920, 3.000e-06,\n 78.4359512, 15.0020475, 0.000e-00,\n 0.5746090, -0.0000048, -9.900e-06,\n 0.0283300, -0.0000048, -9.800e-06,\n 0.0047404, 0.0047168,\n// 79 3 21\n1749992.409110, 22.0, -4.0, 4.0, 9752.7, 9752.7,\n -0.3463640, 0.5430418, 3.080e-05, -8.690e-06,\n 1.3856410, 0.1784799, -6.750e-05, -2.800e-06,\n -0.3975100, 0.0158880, 0.000e-00,\n 148.0470428, 15.0051661, 0.000e-00,\n 0.5379620, -0.0000933, -1.240e-05,\n -0.0081350, -0.0000929, -1.230e-05,\n 0.0046503, 0.0046272,\n// 79 4 20\n1750021.740716, 6.0, -4.0, 4.0, 9751.9, 9751.9,\n 0.4340210, 0.5595811, 7.000e-07, -9.430e-06,\n -1.0583410, 0.1582786, -3.100e-06, -2.570e-06,\n 10.6556101, 0.0141520, -2.000e-06,\n 270.6669617, 15.0044584, 0.000e-00,\n 0.5320780, -0.0000500, -1.270e-05,\n -0.0139890, -0.0000498, -1.270e-05,\n 0.0046166, 0.0045936,\n// 79 10 13\n1750198.205242, 17.0, -4.0, 4.0, 9747.2, 9747.2,\n 0.4048670, 0.4938365, -1.730e-05, -5.890e-06,\n 1.1968290, -0.1505327, -3.300e-06, 1.750e-06,\n -7.2860699, -0.0157630, 2.000e-06,\n 78.0460205, 15.0032101, 0.000e-00,\n 0.5673450, 0.0000927, -1.030e-05,\n 0.0211010, 0.0000922, -1.030e-05,\n 0.0047285, 0.0047050,\n// 80 3 10\n1750346.914862, 10.0, -4.0, 4.0, 9743.3, 9743.3,\n -0.2036950, 0.5143249, 1.820e-05, -6.950e-06,\n 0.7203250, 0.1629482, -1.000e-07, -2.140e-06,\n -4.5896902, 0.0157490, 1.000e-06,\n 327.1010132, 15.0046358, 0.000e-00,\n 0.5530010, -0.0001245, -1.110e-05,\n 0.0068290, -0.0001239, -1.100e-05,\n 0.0046653, 0.0046421,\n// 80 9 2\n1750523.007658, 12.0, -4.0, 4.0, 9738.6, 9738.6,\n -0.3381100, 0.5425843, -1.230e-05, -8.460e-06,\n -0.7710550, -0.1615313, -5.700e-06, 2.420e-06,\n 8.6244297, -0.0150770, -2.000e-06,\n 0.3400800, 15.0039482, 0.000e-00,\n 0.5415390, 0.0001073, -1.220e-05,\n -0.0045760, 0.0001067, -1.210e-05,\n 0.0046739, 0.0046506,\n// 81 2 27\n1750701.113570, 15.0, -4.0, 4.0, 9733.9, 9733.9,\n 0.1282950, 0.4901919, -8.900e-06, -5.670e-06,\n 0.0604460, 0.1434967, 5.080e-05, -1.590e-06,\n -8.7863197, 0.0151200, 2.000e-06,\n 41.3161812, 15.0036850, 0.000e-00,\n 0.5675720, -0.0000771, -1.000e-05,\n 0.0213270, -0.0000767, -1.000e-05,\n 0.0046813, 0.0046580,\n// 81 8 23\n1750877.663876, 4.0, -4.0, 4.0, 9729.2, 9729.2,\n 0.0111570, 0.5645813, -2.330e-05, -9.630e-06,\n -0.1116520, -0.1479229, -7.280e-05, 2.430e-06,\n 12.3930998, -0.0138210, -3.000e-06,\n 239.7539673, 15.0033083, 0.000e-00,\n 0.5334280, 0.0000124, -1.290e-05,\n -0.0126460, 0.0000124, -1.290e-05,\n 0.0046590, 0.0046358,\n// 82 2 16\n1751055.104457, 15.0, -4.0, 4.0, 9724.5, 9724.5,\n 0.4137790, 0.4898362, -3.810e-05, -5.500e-06,\n -0.6119060, 0.1253557, 9.640e-05, -1.350e-06,\n -12.8052502, 0.0139260, 3.000e-06,\n 40.8169594, 15.0023899, 0.000e-00,\n 0.5710600, 0.0000208, -9.900e-06,\n 0.0247990, 0.0000207, -9.800e-06,\n 0.0046972, 0.0046738,\n// 82 8 12\n1751232.346015, 20.0, -4.0, 4.0, 9719.9, 9719.9,\n -0.0383270, 0.5593930, -1.000e-05, -9.000e-06,\n 0.6425110, -0.1218114, -1.412e-04, 1.860e-06,\n 15.7807503, -0.0121590, -3.000e-06,\n 119.3833237, 15.0023737, 0.000e-00,\n 0.5374780, -0.0000743, -1.240e-05,\n -0.0086170, -0.0000739, -1.230e-05,\n 0.0046452, 0.0046221,\n// 83 1 7\n1751379.599335, 2.0, -4.0, 4.0, 9715.9, 9715.9,\n -0.2425490, 0.5444649, -1.100e-05, -7.590e-06,\n 1.4769440, 0.0122245, 8.860e-05, -5.000e-08,\n -22.7739906, 0.0048960, 6.000e-06,\n 207.5325165, 14.9969883, 0.000e-00,\n 0.5544930, 0.0001282, -1.150e-05,\n 0.0083140, 0.0001276, -1.140e-05,\n 0.0047440, 0.0047203,\n// 83 2 5\n1751409.196419, 17.0, -4.0, 4.0, 9715.2, 9715.2,\n 0.4260430, 0.5167810, -5.470e-05, -6.560e-06,\n -1.3087630, 0.1074552, 1.554e-04, -1.320e-06,\n -16.3852100, 0.0121630, 4.000e-06,\n 70.7068100, 15.0008965, 0.000e-00,\n 0.5610630, 0.0001020, -1.070e-05,\n 0.0148500, 0.0001015, -1.070e-05,\n 0.0047119, 0.0046884,\n// 83 7 3\n1751557.365622, 21.0, -4.0, 4.0, 9711.2, 9711.2,\n 0.1600260, 0.5243533, 1.360e-05, -6.530e-06,\n -1.3146420, 0.0166648, -9.670e-05, -2.900e-07,\n 23.4016609, -0.0026600, -6.000e-06,\n 135.2153320, 14.9991159, 0.000e-00,\n 0.5565240, -0.0001068, -1.040e-05,\n 0.0103350, -0.0001063, -1.030e-05,\n 0.0046056, 0.0045827,\n// 83 8 2\n1751586.862003, 9.0, -4.0, 4.0, 9710.5, 9710.5,\n 0.3967530, 0.5341346, -2.080e-05, -7.300e-06,\n 1.3681639, -0.0881941, -1.879e-04, 1.100e-06,\n 18.7086296, -0.0100760, -4.000e-06,\n 314.2698975, 15.0012703, 0.000e-00,\n 0.5505030, -0.0001235, -1.110e-05,\n 0.0043440, -0.0001229, -1.100e-05,\n 0.0046325, 0.0046095,\n// 83 12 27\n1751734.111071, 15.0, -4.0, 4.0, 9706.6, 9706.6,\n 0.2380840, 0.5737751, -1.140e-05, -9.360e-06,\n 0.7301370, -0.0356869, 1.382e-04, 7.100e-07,\n -23.6033306, 0.0015930, 6.000e-06,\n 43.7841492, 14.9963579, 0.000e-00,\n 0.5416100, 0.0000625, -1.280e-05,\n -0.0045060, 0.0000622, -1.270e-05,\n 0.0047512, 0.0047275,\n// 84 6 21\n1751911.468113, 23.0, -4.0, 4.0, 9701.9, 9701.9,\n -0.0504770, 0.5026544, 2.140e-05, -5.630e-06,\n -0.5964280, 0.0582853, -1.247e-04, -7.600e-07,\n 23.6702900, 0.0004730, -6.000e-06,\n 165.8379669, 14.9989958, 0.000e-00,\n 0.5653460, -0.0000153, -9.700e-06,\n 0.0191130, -0.0000153, -9.600e-06,\n 0.0046000, 0.0045771,\n// 84 12 16\n1752088.761524, 6.0, -4.0, 4.0, 9697.2, 9697.2,\n -0.1489960, 0.5754910, 3.850e-05, -9.720e-06,\n 0.0925750, -0.0848193, 1.741e-04, 1.580e-06,\n -23.5394402, -0.0017930, 6.000e-06,\n 270.1206055, 14.9963102, 0.000e-00,\n 0.5390370, -0.0000232, -1.310e-05,\n -0.0070650, -0.0000231, -1.300e-05,\n 0.0047561, 0.0047324,\n// 85 6 11\n1752265.506938, 0.0, -4.0, 4.0, 9692.5, 9692.5,\n -0.1196820, 0.5048669, 2.170e-05, -5.930e-06,\n 0.1625680, 0.1003398, -1.515e-04, -1.300e-06,\n 23.0727291, 0.0035660, -5.000e-06,\n 181.4095764, 14.9994440, 0.000e-00,\n 0.5610170, 0.0000807, -1.000e-05,\n 0.0148050, 0.0000803, -9.900e-06,\n 0.0045965, 0.0045736,\n// 85 12 5\n1752443.354816, 21.0, -4.0, 4.0, 9687.8, 9687.8,\n 0.1253320, 0.5457766, 4.900e-05, -8.220e-06,\n -0.6656310, -0.1252498, 1.942e-04, 2.060e-06,\n -22.5890808, -0.0051060, 6.000e-06,\n 136.3946228, 14.9968252, 0.000e-00,\n 0.5486500, -0.0001222, -1.210e-05,\n 0.0024990, -0.0001216, -1.210e-05,\n 0.0047588, 0.0047351,\n// 86 5 31\n1752619.773460, 7.0, -4.0, 4.0, 9683.2, 9683.2,\n -0.0201850, 0.5252439, 2.330e-05, -7.240e-06,\n 0.9695440, 0.1445320, -1.867e-04, -2.110e-06,\n 21.6827297, 0.0063860, -5.000e-06,\n 286.7860718, 15.0003376, 0.000e-00,\n 0.5471040, 0.0001095, -1.110e-05,\n 0.0009620, 0.0001090, -1.110e-05,\n 0.0045955, 0.0045727,\n// 86 11 25\n1752797.709264, 5.0, -4.0, 4.0, 9678.5, 9678.5,\n -0.4155400, 0.5024886, 7.600e-05, -6.270e-06,\n -1.3033630, -0.1554723, 1.882e-04, 2.120e-06,\n -20.7422009, -0.0082350, 5.000e-06,\n 257.4657288, 14.9978628, 0.000e-00,\n 0.5644640, -0.0001093, -1.070e-05,\n 0.0182350, -0.0001088, -1.070e-05,\n 0.0047587, 0.0047350,\n// 87 4 21\n1752945.036194, 13.0, -4.0, 4.0, 9674.6, 9674.6,\n 0.4662750, 0.5210880, 2.000e-06, -8.730e-06,\n -0.7604800, 0.2608436, -2.240e-05, -4.570e-06,\n 11.1261501, 0.0137500, -2.000e-06,\n 15.7620001, 15.0042677, 0.000e-00,\n 0.5315620, 0.0000266, -1.280e-05,\n -0.0145030, 0.0000264, -1.270e-05,\n 0.0046152, 0.0045923,\n// 87 10 15\n1753121.971853, 11.0, -4.0, 4.0, 9669.9, 9669.9,\n 0.3023400, 0.4448073, 5.000e-06, -4.870e-06,\n 0.9146260, -0.2371937, 7.100e-06, 2.770e-06,\n -7.9820900, -0.0154140, 2.000e-06,\n 348.1339417, 15.0029345, 0.000e-00,\n 0.5735330, 0.0000353, -9.900e-06,\n 0.0272590, 0.0000351, -9.800e-06,\n 0.0047307, 0.0047071,\n// 88 4 10\n1753299.743548, 6.0, -4.0, 4.0, 9665.2, 9665.2,\n 0.1564130, 0.5082910, 2.340e-05, -8.260e-06,\n -0.1024290, 0.2729570, -3.120e-05, -4.630e-06,\n 7.3489099, 0.0147840, -2.000e-06,\n 269.9133606, 15.0048656, 0.000e-00,\n 0.5345590, -0.0000744, -1.260e-05,\n -0.0115210, -0.0000740, -1.250e-05,\n 0.0046258, 0.0046028,\n// 88 10 3\n1753476.033866, 13.0, -4.0, 4.0, 9660.5, 9660.5,\n 0.1957010, 0.4583149, -1.290e-05, -5.630e-06,\n 0.1491930, -0.2556092, 1.860e-05, 3.330e-06,\n -3.6018500, -0.0159880, 1.000e-06,\n 17.5228500, 15.0037737, 0.000e-00,\n 0.5627240, 0.0001074, -1.060e-05,\n 0.0165030, 0.0001069, -1.060e-05,\n 0.0047170, 0.0046935,\n// 89 3 30\n1753654.312013, 19.0, -4.0, 4.0, 9655.9, 9655.9,\n -0.5258000, 0.4786328, 5.010e-05, -6.640e-06,\n 0.3949990, 0.2663059, -2.990e-05, -3.900e-06,\n 3.2883000, 0.0154590, -1.000e-06,\n 103.9343872, 15.0050812, 0.000e-00,\n 0.5479660, -0.0001116, -1.140e-05,\n 0.0018190, -0.0001111, -1.130e-05,\n 0.0046388, 0.0046157,\n// 89 9 22\n1753830.396712, 22.0, -4.0, 4.0, 9651.2, 9651.2,\n -0.0115510, 0.4870227, -1.570e-05, -7.190e-06,\n -0.5664430, -0.2738670, 3.110e-05, 4.230e-06,\n 0.7497000, -0.0160110, 0.000e-00,\n 151.7673340, 15.0042133, 0.000e-00,\n 0.5463160, 0.0001032, -1.200e-05,\n 0.0001770, 0.0001026, -1.190e-05,\n 0.0047021, 0.0046787,\n// 90 2 18\n1753978.914355, 10.0, -4.0, 4.0, 9647.3, 9647.3,\n 0.6928600, 0.4548790, -5.270e-05, -5.060e-06,\n -1.3534271, 0.2223751, 1.206e-04, -2.630e-06,\n -12.1664495, 0.0139380, 2.000e-06,\n 325.8775330, 15.0025358, 0.000e-00,\n 0.5705510, -0.0000461, -9.900e-06,\n 0.0242920, -0.0000458, -9.800e-06,\n 0.0046949, 0.0046715,\n// 90 3 20\n1754008.589809, 2.0, -4.0, 4.0, 9646.5, 9646.5,\n -0.7524340, 0.4506509, 4.030e-05, -5.260e-06,\n 1.1830890, 0.2516351, -3.920e-05, -3.130e-06,\n -0.9847300, 0.0157190, 0.000e-00,\n 207.9086304, 15.0049019, 0.000e-00,\n 0.5633710, -0.0000860, -1.020e-05,\n 0.0171480, -0.0000856, -1.010e-05,\n 0.0046536, 0.0046304,\n// 90 8 14\n1754155.664003, 4.0, -4.0, 4.0, 9642.6, 9642.6,\n 0.5962460, 0.5345642, -7.390e-05, -9.030e-06,\n 1.2663790, -0.2345150, -1.692e-04, 4.140e-06,\n 15.3580799, -0.0121410, -3.000e-06,\n 239.4182892, 15.0024500, 0.000e-00,\n 0.5327870, -0.0000170, -1.290e-05,\n -0.0132840, -0.0000169, -1.280e-05,\n 0.0046465, 0.0046233,\n// 90 9 12\n1754185.009733, 12.0, -4.0, 4.0, 9641.8, 9641.8,\n -0.6820610, 0.5102613, 1.770e-05, -8.520e-06,\n -0.9625200, -0.2794619, 2.930e-05, 4.860e-06,\n 4.9724102, -0.0155730, -1.000e-06,\n 0.9887800, 15.0042295, 0.000e-00,\n 0.5354960, 0.0000435, -1.290e-05,\n -0.0105880, 0.0000433, -1.290e-05,\n 0.0046869, 0.0046635,\n// 91 2 7\n1754332.897725, 10.0, -4.0, 4.0, 9637.9, 9637.9,\n 0.5395280, 0.4671043, -6.760e-05, -5.290e-06,\n -0.6595910, 0.2033500, 1.135e-04, -2.470e-06,\n -15.8527098, 0.0122580, 3.000e-06,\n 325.6979370, 15.0010281, 0.000e-00,\n 0.5698930, 0.0000493, -1.000e-05,\n 0.0236370, 0.0000490, -1.000e-05,\n 0.0047101, 0.0046867,\n// 91 8 3\n1754510.322290, 20.0, -4.0, 4.0, 9633.3, 9633.3,\n 0.3950920, 0.5276768, -4.960e-05, -8.090e-06,\n 0.6149040, -0.2016107, -1.513e-04, 3.250e-06,\n 18.3274097, -0.0101380, -4.000e-06,\n 119.2648392, 15.0014086, 0.000e-00,\n 0.5401260, -0.0001063, -1.210e-05,\n -0.0059810, -0.0001057, -1.200e-05,\n 0.0046336, 0.0046105,\n// 92 1 27\n1754687.061201, 13.0, -4.0, 4.0, 9628.6, 9628.6,\n -0.2085140, 0.5041690, -5.260e-05, -6.680e-06,\n -0.1625670, 0.1851514, 1.218e-04, -2.630e-06,\n -18.9631500, 0.0100110, 5.000e-06,\n 10.9604197, 14.9994669, 0.000e-00,\n 0.5571950, 0.0001273, -1.110e-05,\n 0.0110030, 0.0001267, -1.110e-05,\n 0.0047235, 0.0047000,\n// 92 7 23\n1754864.766107, 6.0, -4.0, 4.0, 9623.9, 9623.9,\n -0.2064410, 0.5074441, -1.600e-05, -6.510e-06,\n 0.0284040, -0.1584920, -1.322e-04, 2.180e-06,\n 20.7683201, -0.0077230, -5.000e-06,\n 269.3822937, 15.0003290, 0.000e-00,\n 0.5544540, -0.0001024, -1.070e-05,\n 0.0082750, -0.0001019, -1.060e-05,\n 0.0046225, 0.0045994,\n// 93 1 16\n1755041.522594, 1.0, -4.0, 4.0, 9619.3, 9619.3,\n 0.0769690, 0.5467121, -5.880e-05, -8.620e-06,\n 0.6683910, 0.1592019, 1.108e-04, -2.680e-06,\n -21.3192406, 0.0073350, 5.000e-06,\n 191.6360016, 14.9980659, 0.000e-00,\n 0.5432010, 0.0000767, -1.250e-05,\n -0.0029230, 0.0000763, -1.240e-05,\n 0.0047348, 0.0047112,\n// 93 7 12\n1755218.914073, 10.0, -4.0, 4.0, 9614.6, 9614.6,\n -0.1551430, 0.4944543, -1.990e-05, -5.580e-06,\n -0.8032400, -0.1154932, -1.065e-04, 1.430e-06,\n 22.5427399, -0.0049170, -5.000e-06,\n 329.7610168, 14.9994516, 0.000e-00,\n 0.5651550, -0.0000416, -9.800e-06,\n 0.0189220, -0.0000414, -9.700e-06,\n 0.0046128, 0.0045898,\n// 93 12 7\n1755366.720517, 5.0, -4.0, 4.0, 9610.7, 9610.7,\n -0.1995130, 0.5781965, 2.270e-05, -9.610e-06,\n -1.4079560, -0.0126165, 2.516e-04, 1.200e-07,\n -22.7595596, -0.0049460, 6.000e-06,\n 256.2430115, 14.9968033, 0.000e-00,\n 0.5406910, -0.0000508, -1.290e-05,\n -0.0054200, -0.0000505, -1.290e-05,\n 0.0047582, 0.0047345,\n// 94 1 5\n1755396.163219, 16.0, -4.0, 4.0, 9609.9, 9609.9,\n -0.2102310, 0.5705442, -2.190e-05, -9.670e-06,\n 1.2512480, 0.1183307, 9.860e-05, -2.170e-06,\n -22.8971004, 0.0043020, 6.000e-06,\n 57.6573181, 14.9969568, 0.000e-00,\n 0.5378130, -0.0000090, -1.310e-05,\n -0.0082840, -0.0000089, -1.310e-05,\n 0.0047443, 0.0047206,\n// 94 6 1\n1755543.369116, 21.0, -4.0, 4.0, 9606.1, 9606.1,\n -0.0050710, 0.5209853, -4.400e-06, -6.390e-06,\n 1.2480119, 0.0328998, -1.942e-04, -3.000e-07,\n 21.9388008, 0.0062240, -5.000e-06,\n 136.7379456, 15.0001793, 0.000e-00,\n 0.5576040, 0.0000935, -1.020e-05,\n 0.0114100, 0.0000931, -1.020e-05,\n 0.0045959, 0.0045730,\n// 94 7 1\n1755572.935839, 10.0, -4.0, 4.0, 9605.3, 9605.3,\n -0.4609350, 0.5043404, -1.360e-05, -5.780e-06,\n -1.5052520, -0.0748881, -8.670e-05, 9.500e-07,\n 23.5185795, -0.0018360, -6.000e-06,\n 330.3193359, 14.9990129, 0.000e-00,\n 0.5634670, 0.0000693, -9.800e-06,\n 0.0172430, 0.0000690, -9.800e-06,\n 0.0046046, 0.0045816,\n// 94 11 26\n1755721.262969, 18.0, -4.0, 4.0, 9601.4, 9601.4,\n -0.2446220, 0.5477648, 4.280e-05, -7.850e-06,\n -0.7689480, -0.0518382, 1.834e-04, 6.800e-07,\n -21.0644207, -0.0080410, 5.000e-06,\n 92.3304291, 14.9977913, 0.000e-00,\n 0.5531060, -0.0001120, -1.170e-05,\n 0.0069340, -0.0001114, -1.170e-05,\n 0.0047583, 0.0047346,\n// 95 5 22\n1755897.720769, 5.0, -4.0, 4.0, 9596.7, 9596.7,\n -0.2188040, 0.5496174, 1.060e-05, -8.030e-06,\n 0.3992830, 0.0716519, -1.540e-04, -9.500e-07,\n 19.9339294, 0.0087960, -4.000e-06,\n 256.9008179, 15.0013189, 0.000e-00,\n 0.5428510, 0.0001221, -1.150e-05,\n -0.0032700, 0.0001215, -1.150e-05,\n 0.0045971, 0.0045742,\n// 95 11 16\n1756075.529898, 1.0, -4.0, 4.0, 9592.0, 9592.0,\n 0.1269180, 0.5104743, 2.840e-05, -6.130e-06,\n -0.1295660, -0.0829906, 1.204e-04, 9.300e-07,\n -18.5364609, -0.0107900, 5.000e-06,\n 198.1007843, 14.9991293, 0.000e-00,\n 0.5684700, -0.0000986, -1.040e-05,\n 0.0222210, -0.0000981, -1.040e-05,\n 0.0047557, 0.0047320,\n// 96 5 10\n1756252.338216, 20.0, -4.0, 4.0, 9587.4, 9587.4,\n -0.0031780, 0.5700342, 1.420e-05, -9.530e-06,\n -0.3487340, 0.1079181, -9.700e-05, -1.720e-06,\n 17.3566093, 0.0109500, -4.000e-06,\n 121.7714310, 15.0025082, 0.000e-00,\n 0.5319440, 0.0000545, -1.260e-05,\n -0.0141230, 0.0000543, -1.260e-05,\n 0.0046008, 0.0045779,\n// 96 11 4\n1756429.530559, 1.0, -4.0, 4.0, 9582.7, 9582.7,\n 0.2579450, 0.4908096, 1.050e-05, -5.440e-06,\n 0.5403530, -0.1094933, 6.970e-05, 1.150e-06,\n -15.2418003, -0.0130600, 4.000e-06,\n 198.4779663, 15.0006542, 0.000e-00,\n 0.5752080, -0.0000023, -9.900e-06,\n 0.0289250, -0.0000023, -9.800e-06,\n 0.0047495, 0.0047258,\n// 97 4 1\n1756577.731869, 6.0, -4.0, 4.0, 9578.8, 9578.8,\n -0.2190610, 0.5426674, 3.340e-05, -8.620e-06,\n 1.4845710, 0.1753128, -9.710e-05, -2.740e-06,\n 3.8725100, 0.0156060, -1.000e-06,\n 269.0757446, 15.0052137, 0.000e-00,\n 0.5378390, -0.0001034, -1.230e-05,\n -0.0082570, -0.0001029, -1.220e-05,\n 0.0046366, 0.0046135,\n// 97 4 30\n1756607.055424, 13.0, -4.0, 4.0, 9578.0, 9578.0,\n 0.0656030, 0.5644798, 2.390e-05, -9.470e-06,\n -1.0873801, 0.1364825, -2.750e-05, -2.200e-06,\n 14.2832003, 0.0127210, -3.000e-06,\n 16.3571701, 15.0035591, 0.000e-00,\n 0.5319670, -0.0000415, -1.270e-05,\n -0.0141000, -0.0000413, -1.260e-05,\n 0.0046075, 0.0045846,\n// 97 10 24\n1756783.537631, 1.0, -4.0, 4.0, 9573.4, 9573.4,\n 0.3757850, 0.4992216, -1.110e-05, -5.990e-06,\n 1.1879770, -0.1360842, 2.220e-05, 1.580e-06,\n -11.4010601, -0.0147120, 3.000e-06,\n 198.4346161, 15.0021162, 0.000e-00,\n 0.5673520, 0.0000954, -1.040e-05,\n 0.0211080, 0.0000950, -1.030e-05,\n 0.0047397, 0.0047161,\n// 98 3 21\n1756932.227434, 17.0, -4.0, 4.0, 9569.5, 9569.5,\n -0.4819590, 0.5113708, 3.690e-05, -6.830e-06,\n 0.6854130, 0.1662337, -2.310e-05, -2.170e-06,\n -0.3208400, 0.0159160, 0.000e-00,\n 73.0597229, 15.0050898, 0.000e-00,\n 0.5531340, -0.0001123, -1.100e-05,\n 0.0069610, -0.0001118, -1.090e-05,\n 0.0046509, 0.0046278,\n// 98 9 13\n1757108.343422, 20.0, -4.0, 4.0, 9564.9, 9564.9,\n -0.3954540, 0.5406694, -1.600e-06, -8.500e-06,\n -0.7856650, -0.1728571, 2.160e-05, 2.620e-06,\n 4.4265699, -0.0159080, -1.000e-06,\n 121.0907974, 15.0043325, 0.000e-00,\n 0.5416490, 0.0001054, -1.230e-05,\n -0.0044660, 0.0001049, -1.220e-05,\n 0.0046888, 0.0046655,\n// 99 3 10\n1757286.415685, 22.0, -4.0, 4.0, 9560.2, 9560.2,\n -0.0093370, 0.4863868, 1.600e-06, -5.590e-06,\n 0.0696240, 0.1532170, 2.610e-05, -1.700e-06,\n -4.6254902, 0.0157710, 1.000e-06,\n 147.0865936, 15.0045528, 0.000e-00,\n 0.5671790, -0.0000668, -1.000e-05,\n 0.0209360, -0.0000664, -9.900e-06,\n 0.0046666, 0.0046433,\n// 99 9 3\n1757462.999480, 12.0, -4.0, 4.0, 9555.5, 9555.5,\n -0.0352120, 0.5595322, -1.480e-05, -9.540e-06,\n -0.1442400, -0.1660665, -4.460e-05, 2.740e-06,\n 8.4751101, -0.0151000, -2.000e-06,\n 0.3657000, 15.0040178, 0.000e-00,\n 0.5341410, 0.0000078, -1.300e-05,\n -0.0119370, 0.0000078, -1.290e-05,\n 0.0046736, 0.0046503,\n// 100 2 27\n1757640.409833, 22.0, -4.0, 4.0, 9550.8, 9550.8,\n 0.2633870, 0.4861132, -2.940e-05, -5.480e-06,\n -0.6052410, 0.1420664, 7.130e-05, -1.540e-06,\n -8.8987303, 0.0151000, 2.000e-06,\n 146.2949524, 15.0036316, 0.000e-00,\n 0.5698170, 0.0000329, -9.900e-06,\n 0.0235610, 0.0000327, -9.800e-06,\n 0.0046825, 0.0046592,\n// 100 8 23\n1757817.671005, 4.0, -4.0, 4.0, 9546.2, 9546.2,\n 0.0885860, 0.5518702, -1.380e-05, -8.800e-06,\n 0.5675470, -0.1458914, -1.123e-04, 2.230e-06,\n 12.2560396, -0.0138770, -3.000e-06,\n 239.7739258, 15.0033150, 0.000e-00,\n 0.5388780, -0.0000835, -1.240e-05,\n -0.0072240, -0.0000831, -1.230e-05,\n 0.0046593, 0.0046361\n));\n}", "function ArithGeo(arr) {\n\tlet addAmount = arr[1] - arr[0];\n\tlet multiplyRatio = arr[1] / arr[0];\n\tlet isArithmetic = true;\n\tlet isGeometric = true;\n\t// console.log(addAmount);\n\t// console.log(multiplyRatio);\n\tfor (let i = 1; i < arr.length; i++) {\n\t\tif (arr[i] - arr[i - 1] != addAmount) {\n\t\t\tisArithmetic = false;\n\t\t}\n\t}\n\n\tfor (let j = 1; j < arr.length; j++) {\n\t\tif (arr[j] / arr[j - 1] != multiplyRatio) {\n\t\t\tisGeometric = false;\n\t\t}\n\t}\n\tif (isArithmetic) {\n\t\treturn 'Arithmetic';\n\t} else if (isGeometric) {\n\t\treturn 'Geometric';\n\t} else {\n\t\treturn -1;\n\t}\n}", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function t(n,A){0}", "a(){\n return (this.Abc*this.Fy)/(0.85*this.Fc*this.beff())\n }", "function jesusSolve() {\n\n}", "function Eq_second_degre(a, b, c) {\r\n\tvar rep = new Array();\r\n\tvar delta = b*b - 4*a*c; \r\n\tif(delta < 0) {alert('delta = ' + delta);}\r\n\tif(delta == 0) {rep.push(-b/(2*a));}\r\n\tif(delta > 0) {\r\n\t\t var d = Math.sqrt(delta);\r\n\t\t rep.push((-b -d)/(2*a), (-b + d)/(2*a));\r\n\t\t //alert('rep = ' + rep);\r\n\t\t}\r\n\r\n\treturn rep;\r\n}", "internalSquare(f) {\r\n const f0 = BigInt(f.data[0]);\r\n const f1 = BigInt(f.data[1]);\r\n const f2 = BigInt(f.data[2]);\r\n const f3 = BigInt(f.data[3]);\r\n const f4 = BigInt(f.data[4]);\r\n const f5 = BigInt(f.data[5]);\r\n const f6 = BigInt(f.data[6]);\r\n const f7 = BigInt(f.data[7]);\r\n const f8 = BigInt(f.data[8]);\r\n const f9 = BigInt(f.data[9]);\r\n const f02 = BigInt(2 * f.data[0]);\r\n const f12 = BigInt(2 * f.data[1]);\r\n const f22 = BigInt(2 * f.data[2]);\r\n const f32 = BigInt(2 * f.data[3]);\r\n const f42 = BigInt(2 * f.data[4]);\r\n const f52 = BigInt(2 * f.data[5]);\r\n const f62 = BigInt(2 * f.data[6]);\r\n const f72 = BigInt(2 * f.data[7]);\r\n const f538 = bigIntCommon_1.BIG_38 * f5; // 1.31*2^30\r\n const f619 = bigIntCommon_1.BIG_ARR[19] * f6; // 1.31*2^30\r\n const f738 = bigIntCommon_1.BIG_38 * f7; // 1.31*2^30\r\n const f819 = bigIntCommon_1.BIG_ARR[19] * f8; // 1.31*2^30\r\n const f938 = bigIntCommon_1.BIG_38 * f9; // 1.31*2^30\r\n return {\r\n h0: (f0 * f0) + (f12 * f938) + (f22 * f819) + (f32 * f738) + (f42 * f619) + (f5 * f538),\r\n h1: (f02 * f1) + (f2 * f938) + (f32 * f819) + (f4 * f738) + (f52 * f619),\r\n h2: (f02 * f2) + (f12 * f1) + (f32 * f938) + (f42 * f819) + (f52 * f738) + (f6 * f619),\r\n h3: (f02 * f3) + (f12 * f2) + (f4 * f938) + (f52 * f819) + (f6 * f738),\r\n h4: (f02 * f4) + (f12 * f32) + (f2 * f2) + (f52 * f938) + (f62 * f819) + (f7 * f738),\r\n h5: (f02 * f5) + (f12 * f4) + (f22 * f3) + (f6 * f938) + (f72 * f819),\r\n h6: (f02 * f6) + (f12 * f52) + (f22 * f4) + (f32 * f3) + (f72 * f938) + (f8 * f819),\r\n h7: (f02 * f7) + (f12 * f6) + (f22 * f5) + (f32 * f4) + (f8 * f938),\r\n h8: (f02 * f8) + (f12 * f72) + (f22 * f6) + (f32 * f52) + (f4 * f4) + (f9 * f938),\r\n h9: (f02 * f9) + (f12 * f8) + (f22 * f7) + (f32 * f6) + (f42 * f5)\r\n };\r\n }", "function ex_7_R(a, b){\n s = 0; k = a;\n for( i = 1; i<b; i++){\n s = s + ex_5_R(a,k);\n k = ex_5_R(a,k);\n}\nreturn s;\n}", "function ArithGeoII(arr) {\n var faktor=0;\n var arithver=[];\n for(var i=1;i<arr.length;i++) {\n faktor=arr[i]-arr[i-1];\n arithver.push(faktor);\n }\n if(arithver[0]==arithver[arr.length-2]) return 'Arithmetic';\n var geover=[];\n for(i=1;i<arr.length;i++) {\n faktor=Math.abs(arr[i]/arr[i-1]);\n geover.push(faktor);\n }\n geover.sort(function(a,b){return a-b});\n if(geover[0]==geover[arr.length-2]) return 'Geometric';\n return -1;\n}", "function solution(A) {\n\n}", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function pazymiuVidurkis(q,w,e,r,t) {\n var atsakymas = (q+w+e+r+t)/5;\n console.log(atsakymas);\n}", "function phi([n00, n01, n10, n11]) {\n return (n11 * n00 - n10 * n01) /\n Math.sqrt((n10 + n11) * (n00 + n01) *\n (n01 + n11) * (n00 + n10))\n }", "function generateExp(){\n for (var i=0;i<iterations;i++){\n if (a2*a2+b2*b2>=4){\n return i; \n }\n var e=Math.E;\n var tmA=a2;\n a2=e^tmA*Math.cos(b2)-0.65;\n b2=e^tmA*Math.sin(b2);\n }\n return -1;\n}", "function Lqb(){this.j=0;this.F=[];this.C=[];this.L=this.V=this.g=this.G=this.O=this.H=0;this.ia=[]}", "function simplificationSysteme()\n\t{\n\t var i = null; //variables de boucles\n\t var j = null;\n\t var premiere_ligne_ok = false; //variable indiquant si la premiere ligne de la matrice est bien traité (premier coeff egal à 1)\n\t var colonne_full_zero = false; //variable indiquant si la colonne en cours est uniquement constitué de 0\n\t var sous_systeme = null;\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] == 1) //si le premier coefficient de la ligne i vaut 1\n\t {\n\t this.P(i, 0); //on place la ligne i en premiere position\n\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t break; //on casse la boucle\n\t }\n\t }\n\t \n\t if(premiere_ligne_ok == false) //si la premiere ligne n'a pas été bien traité\n\t {\n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //des que le premier coefficient d'une est non nul\n\t {\n\t this.P(i, 0); //on place cette ligne en premiere position\n\t\t this.M(0, 1/this.matrice_systeme[0][0]); //on divise cette ligne par le premier coefficient pour reduire celui ci à 1\n\t\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t\t break; //on casse la boucle\n\t }\n\t else //si apres avoir parcouru la matrice aucun premier coefficient non nul n'a été trouvé\n\t {\n\t if(i == this.matrice_systeme.length - 1)\n\t\t{\n\t\t colonne_full_zero = true; //on indique que la colonne est rempli de 0\n\t\t}\n\t }\n\t }\n\t }\n\t \n\t if(this.matrice_systeme.length != 1) //si la matrice du systeme n'est pas une matrice ligne\n\t {\n\t for(i = 1; i < this.matrice_systeme.length; i++) //on parcourt toutes les lignes en dessous de la premiere\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //si le premier coeff est non nul\n\t {\n\t this.S(0, i, -this.matrice_systeme[i][0]); //on lui ajoute/retire une combinaison lineaire de la premiere ligne pr reduire son premier coeff à 0\n\t }\n\t }\n\t \n\t sous_systeme = new Array(); //on crée la matrice du sous systeme de notre systeme\n\t sous_systeme[0] = new Array();\n\t sous_systeme[1] = new Array();\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on remplit les lignes du sous systeme \n\t {\n\t sous_systeme[0][i] = new Array(); //on crée une matrice ligne pr chaque ligne\n\t sous_systeme[1][i] = this.second_membre[i+1]; //on remplit le second membre\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++) //on remplit chaque case de la matrice du systeme du sous systeme\n\t {\n\t sous_systeme[0][i][j] = this.matrice_systeme[i+1][j+1];\n\t }\n\t }\n\t \n\t sous_systeme = new systeme(sous_systeme); //on instance le sous systeme comme une instance de la classe systeme\n\t sous_systeme.simplificationSysteme(); //on simplifie le sous systeme\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on recupere le sous systeme simplifié dans notre systeme actuel\n\t {\n\t this.second_membre[i+1] = sous_systeme.second_membre[i];\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++)\n\t {\n\t this.matrice_systeme[i+1][j+1] = sous_systeme.matrice_systeme[i][j];\n\t }\n\t }\n\t }\n\t \n\t this.systeme_simplifie = true;\n\t}", "function getV (number) {\n\t\treturn M.times(number.times([-3, 0]).pow(-1));\n\t}", "static innerProductQV(qa, qb) {\n//--------------\nreturn qa[0] * qb[0] + qa[1] * qb[1] + qa[2] * qb[2] + qa[3] * qb[3];\n}", "function AgenMath(){\n let T_vec = new Array(5);\n let heatflux = g.lengthA*g.Q*1000;\n T_vec[0] = heatflux/g.h + g.Tinf;\n T_vec[1] = heatflux*g.lengthC/g.kC + T_vec[0];\n T_vec[2] = heatflux*g.Rtc + T_vec[1];\n T_vec[3] = heatflux*g.lengthB/g.kB + T_vec[2];\n T_vec[4] = heatflux*g.Rtc + T_vec[3];\n let C2 = T_vec[4] + g.Q*Math.pow(g.lengthA,2)*1000/(2*g.kA);\n T_vec.push(C2);\n return{T_vec};\n}", "function fnal()\r\n {\r\n let fmark = exam(75)+crsmark(40) //fmark = (0.6*75) + (85*40/100)\r\n console.log(fmark) \r\n\r\n }", "Ec(){\r\n return 57*Math.pow(this.fc,0.5)\r\n }", "function ify( x , y , z , n )\n {\n \n const c_szz = 0 ;\n const c_sxx = 1 ;\n const c_syy = 2 ;\n const c_sxy = 3 ;\n const c_sxz = 4 ;\n const c_syz = 5 ;\n\n const c_ux = 6 ;\n const c_uy = 7 ;\n const c_uz = 8 ;\n \n const r_r = 1 ;\n const r_rr = 9 ;\n\n\n var x2 = ( x * x ) ;\n var y2 = ( y * y ) ;\n var z2 = ( z * z ) ;\n \n var r02 = ( x2 + y2 + z2 ) ;\n var r0 = Math.sqrt( r02 ) ;\n var r03 = 0 ;\n\n var r1 = ( z / r0 ) ;\n var r13 = ( r1 * r1 * r1 ) ;\n var r15 = ( r1 * r1 * r13 ) ;\n\n var rz = 0 ;\n var rz2 = 0 ;\n var rrz = 0 ;\n \n var if0 = 0 ;\n var if1 = 0 ;\n var if2 = 0 ;\n \n var if3 = 0 ;\n var if4 = 0 ;\n var if5 = 0 ;\n var if6 = ( (3 * r15) / (2 * Math.PI) ) ;\n \n var r = undefined ;\n var rr = undefined ;\n \n if( n ) r = new Array( r_rr ) ; else r = new Array( r_r ) ;\n\n rr = new Array( 1 ) ;\n \n rr[0] = r ;\n\n if( n ) \n {\n \n r03 = ( r0 * r02 ) ;\n\n rz = ( r0 + z ) ;\n rz2 = ( rz * rz ) ;\n rrz = ( r0 / rz ) ;\n\n if0 = ( 1 - (2 * n) ) ;\n\n if1 = ( 3 / r02 ) ;\n if2 = ( if0 / rz2 ) ;\n if3 = ( (2 * r0) / rz ) ;\n if4 = ( r13 / (2 * Math.PI) ) ;\n if5 = ( 1 / (4 * Math.PI * r0) ) ;\n \n r[c_sxx] = ( if4 * (y / z) * ((if1 * x2) - (if2 * ((3 * r02) - y2 - (if3 * y2)))) ) ;\n r[c_syy] = ( if4 * (y / z) * ((if1 * y2) - (if2 * (r02 - x2 - (if3 * x2)))) ) ;\n \n r[c_sxy] = ( if4 * (x / z) * ((if1 * y2) + (if2 * (r02 - y2 + (if3 * y2)))) ) ;\n r[c_sxz] = ( if6 * ((y * x) / z2) ) ;\n r[c_syz] = ( if6 * (y2 / z2) ) ;\n\n r[c_ux] = ( if5 * (((y * x) / r02) - (if0 * ((y * x) / rz2))) ) ;\n r[c_uy] = ( if5 * (1 + (y2 / r02) + (if0 * (rrz - (y2 / rz2)))) ) ;\n r[c_uz] = ( if5 * (((y * z) / r02) + (if0 * (y / rz))) ) ;\n\n }; // end if -\n \n r[c_szz] = ( if6 * (y / z) ) ;\n \n return( r ) ;\n\n }", "function mt(t){var S,I,k,_,e,u=Math.floor,C=new Array(64),A=new Array(64),T=new Array(64),F=new Array(64),y=new Array(65535),w=new Array(65535),Q=new Array(64),v=new Array(64),P=[],O=0,E=7,q=new Array(64),B=new Array(64),D=new Array(64),n=new Array(256),U=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],j=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],M=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var s=1;s<=t[o];s++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function G(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(O|=1<<E),n--,--E<0&&(255==O?(V(255),V(0)):V(O),E=7,O=0)}function V(t){P.push(t)}function Y(t){V(t>>8&255),V(255&t)}function X(t,e,n,r,i){for(var o,s=i[0],a=i[240],h=function(t,e){var n,r,i,o,s,a,h,c,l,u,f=0;for(l=0;l<8;++l){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],s=t[f+4],a=t[f+5],h=t[f+6];var d=n+(c=t[f+7]),p=n-c,g=r+h,m=r-h,y=i+a,w=i-a,v=o+s,b=o-s,x=d+v,S=d-v,I=g+y,k=g-y;t[f]=x+I,t[f+4]=x-I;var _=.707106781*(k+S);t[f+2]=S+_,t[f+6]=S-_;var C=.382683433*((x=b+w)-(k=m+p)),A=.5411961*x+C,T=1.306562965*k+C,F=.707106781*(I=w+m),P=p+F,O=p-F;t[f+5]=O+A,t[f+3]=O-A,t[f+1]=P+T,t[f+7]=P-T,f+=8}for(l=f=0;l<8;++l){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],s=t[f+32],a=t[f+40],h=t[f+48];var E=n+(c=t[f+56]),q=n-c,B=r+h,D=r-h,U=i+a,j=i-a,R=o+s,M=o-s,N=E+R,z=E-R,L=B+U,H=B-U;t[f]=N+L,t[f+32]=N-L;var W=.707106781*(H+z);t[f+16]=z+W,t[f+48]=z-W;var G=.382683433*((N=M+j)-(H=D+q)),V=.5411961*N+G,Y=1.306562965*H+G,X=.707106781*(L=j+D),K=q+X,J=q-X;t[f+40]=J+V,t[f+24]=J-V,t[f+8]=K+Y,t[f+56]=K-Y,f++}for(l=0;l<64;++l)u=t[l]*e[l],Q[l]=0<u?u+.5|0:u-.5|0;return Q}(t,e),c=0;c<64;++c)v[b[c]]=h[c];var l=v[0]-n;n=v[0],0==l?G(r[0]):(G(r[w[o=32767+l]]),G(y[o]));for(var u=63;0<u&&0==v[u];u--);if(0==u)return G(s),n;for(var f,d=1;d<=u;){for(var p=d;0==v[d]&&d<=u;++d);var g=d-p;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)G(a);g&=15}o=32767+v[d],G(i[(g<<4)+w[o]]),G(y[o]),d++}return 63!=u&&G(s),n}function K(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=u((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),C[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var s=u((i[o]*t+50)/100);s<1?s=1:255<s&&(s=255),A[b[o]]=s}for(var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,c=0;c<8;c++)for(var l=0;l<8;l++)T[h]=1/(C[b[h]]*a[c]*a[l]*8),F[h]=1/(A[b[h]]*a[c]*a[l]*8),h++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&K(e),P=new Array,O=0,E=7,Y(65496),Y(65504),Y(16),V(74),V(70),V(73),V(70),V(0),V(1),V(1),V(0),Y(1),Y(1),V(0),V(0),function(){Y(65499),Y(132),V(0);for(var t=0;t<64;t++)V(C[t]);V(1);for(var e=0;e<64;e++)V(A[e])}(),n=t.width,r=t.height,Y(65472),Y(17),V(8),Y(r),Y(n),V(3),V(1),V(17),V(0),V(2),V(17),V(1),V(3),V(17),V(1),function(){Y(65476),Y(418),V(0);for(var t=0;t<16;t++)V(j[t+1]);for(var e=0;e<=11;e++)V(R[e]);V(16);for(var n=0;n<16;n++)V(M[n+1]);for(var r=0;r<=161;r++)V(N[r]);V(1);for(var i=0;i<16;i++)V(z[i+1]);for(var o=0;o<=11;o++)V(L[o]);V(17);for(var s=0;s<16;s++)V(H[s+1]);for(var a=0;a<=161;a++)V(W[a])}(),Y(65498),Y(12),V(3),V(1),V(0),V(2),V(17),V(3),V(17),V(0),V(63),V(0);var i=0,o=0,s=0;O=0,E=7,this.encode.displayName=\"_encode_\";for(var a,h,c,l,u,f,d,p,g,m=t.data,y=t.width,w=t.height,v=4*y,b=0;b<w;){for(a=0;a<v;){for(f=u=v*b+a,d=-1,g=p=0;g<64;g++)f=u+(p=g>>3)*v+(d=4*(7&g)),w<=b+p&&(f-=v*(b+1+p-w)),v<=a+d&&(f-=a+d-v+4),h=m[f++],c=m[f++],l=m[f++],q[g]=(U[h]+U[c+256>>0]+U[l+512>>0]>>16)-128,B[g]=(U[h+768>>0]+U[c+1024>>0]+U[l+1280>>0]>>16)-128,D[g]=(U[h+1280>>0]+U[c+1536>>0]+U[l+1792>>0]>>16)-128;i=X(q,T,i,S,k),o=X(B,F,o,I,_),s=X(D,F,s,I,_),a+=32}b+=8}if(0<=E){var x=[];x[1]=E+1,x[0]=(1<<E+1)-1,G(x)}return Y(65497),new Uint8Array(P)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),S=r(j,R),I=r(z,L),k=r(M,N),_=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)w[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)w[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)U[t]=19595*t,U[t+256>>0]=38470*t,U[t+512>>0]=7471*t+32768,U[t+768>>0]=-11059*t,U[t+1024>>0]=-21709*t,U[t+1280>>0]=32768*t+8421375,U[t+1536>>0]=-27439*t,U[t+1792>>0]=-5329*t}(),K(t),(new Date).getTime()}()}", "static approxEqTrans(ta, tb) {\nvar aeq, i;\n//------–-----\naeq = (function() {\nvar j, results;\nresults = [];\nfor (i = j = 0; j < 3; i = ++j) {\nresults.push(this.approxEq(ta[i], tb[i]));\n}\nreturn results;\n}).call(this);\nreturn aeq[0] && aeq[1] && aeq[2];\n}", "function stung(s){ //the function\n return s * 8.666667; //the equation\n}", "function b(t,p)\n{\n var result=[2];\n for(var i=0;i<2;i++)\n {\n result[i]=Math.pow((1-t),3)*p[0][i]+3*(1-t)*(1-t)*t*p[1][i]+3*(1-t)*t*t*p[2][i]+Math.pow(t,3)*p[3][i];\n }\n return result;\n}", "function sg2plato (sg)\n{\n return ((-1 * 616.868) + (1111.14 * sg) - (630.272 * Math.pow(sg,2)) + (135.997 * Math.pow(sg, 3)));\n}", "Ij_chords(){\n let A_chord = this.Atc + this.Abc\n let De = this.Dj - this.Ytc - this.Ybc\n\n return this.Atc*this.Abc*Math.pow(De,2)/A_chord + this.Itc + this.Ibc\n }", "function e0fn(x){return(1.0-0.25*x*(1.0+x/16.0*(3.0+1.25*x)));}", "function sm_1(z) {\n var k = [0, 0];\n\n // rotate to have s ~= 1\n var rot = complexPow(\n w,\n d3Array.scan(\n [0, 1, 2].map(function(i) {\n return -complexMul(z, complexPow(w, [i, 0]))[0];\n })\n )\n );\n\n var y = complexMul(rot, z);\n y = [1 - y[0], -y[1]];\n\n // McIlroy formula 5 p6 and table for F3 page 16\n var F0 = [\n 1.44224957030741,\n 0.240374928384568,\n 0.0686785509670194,\n 0.0178055502507087,\n 0.00228276285265497,\n -1.48379585422573e-3,\n -1.64287728109203e-3,\n -1.02583417082273e-3,\n -4.83607537673571e-4,\n -1.67030822094781e-4,\n -2.45024395166263e-5,\n 2.14092375450951e-5,\n 2.55897270486771e-5,\n 1.73086854400834e-5,\n 8.72756299984649e-6,\n 3.18304486798473e-6,\n 4.79323894565283e-7,\n -4.58968389565456e-7,\n -5.62970586787826e-7,\n -3.92135372833465e-7\n ];\n\n var F = [0, 0];\n for (var i = F0.length; i--; ) F = complexAdd([F0[i], 0], complexMul(F, y));\n\n k = complexMul(\n complexAdd(w1, complexMul([-F[0], -F[1]], complexPow(y, 1 - 2 / 3))),\n complexMul(rot, rot)\n );\n\n // when we are close to [0,0] we switch to another approximation:\n // https://www.wolframalpha.com/input/?i=(-2%2F3+choose+k)++*+(-1)%5Ek++%2F+(k%2B1)+with+k%3D0,1,2,3,4\n // the difference is _very_ tiny but necessary\n // if we want projection(0,0) === [0,0]\n var n = complexNorm2(z);\n if (n < m) {\n var H0 = [\n 1,\n 1 / 3,\n 5 / 27,\n 10 / 81,\n 22 / 243 //…\n ];\n var z3 = complexPow(z, [3, 0]);\n var h = [0, 0];\n for (i = H0.length; i--; ) h = complexAdd([H0[i], 0], complexMul(h, z3));\n h = complexMul(h, z);\n k = complexAdd(complexMul(k, [n / m, 0]), complexMul(h, [1 - n / m, 0]));\n }\n\n return k;\n}", "function makeTerms() {\n nzterms = 0;\n var ret = [];\n for (var i = 0; i < getInput(\"no_terms\"); i++) {\n if (i == 0) {\n ret.push(2/PI);\n continue;\n }\n if (i == 1) {\n ret.push(0);\n continue;\n }\n /*if (i % 2 == 0) ret.push(0);\n else {\n ret.push(4*A / (PI * i)); \n nzterms ++;\n }*/\n //ret.push(-2*A/(PI*i)*pow(-1,i));\n ret.push(2*A/((1-i*i))*(pow(-1,i)+1));\n /*if (i % 2 == 0) ret.push(0);\n ret.push(4*A*(1 - pow(-1, i))/pow(PI*i,2));*/\n }\n return ret;\n}", "function n$c(){return [0,0,0,0]}", "function n$b(e){return Math.abs(e*e*e)}", "get modul(){ return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);}", "function SE2101() {\n calculatefor(new Array(\n// 2101 2 28\n2488492.594741, 2.0, -4.0, 4.0, 205.2, 205.2,\n -0.5934920, 0.4746287, -1.290e-05, -6.230e-06,\n 0.8137010, 0.2494472, -1.000e-07, -3.440e-06,\n -8.0823898, 0.0151240, 2.000e-06,\n 206.8755646, 15.0030355, 0.000e-00,\n 0.5574860, 0.0001228, -1.110e-05,\n 0.0112920, 0.0001222, -1.100e-05,\n 0.0047223, 0.0046988,\n// 2101 8 24\n2488670.317392, 20.0, -4.0, 4.0, 206.3, 206.3,\n -0.3236260, 0.4769202, 2.100e-06, -6.110e-06,\n -1.1110851, -0.2365026, -1.470e-05, 3.220e-06,\n 10.9239902, -0.0137310, -2.000e-06,\n 119.3928070, 15.0040102, 0.000e-00,\n 0.5540140, -0.0001198, -1.070e-05,\n 0.0078370, -0.0001192, -1.070e-05,\n 0.0046240, 0.0046010,\n// 2102 1 19\n2488817.598261, 2.0, -4.0, 4.0, 207.3, 207.3,\n 0.1195020, 0.5541312, -6.010e-05, -9.240e-06,\n -1.0874220, 0.1716116, 2.052e-04, -3.050e-06,\n -20.4401894, 0.0081800, 5.000e-06,\n 207.4317169, 14.9981813, 0.000e-00,\n 0.5395900, 0.0000564, -1.300e-05,\n -0.0065150, 0.0000561, -1.290e-05,\n 0.0047523, 0.0047286,\n// 2102 7 15\n2488994.843907, 8.0, -4.0, 4.0, 208.5, 208.5,\n 0.1127480, 0.4884019, -4.060e-05, -5.440e-06,\n 0.9100120, -0.1317882, -1.635e-04, 1.600e-06,\n 21.5428391, -0.0061960, -5.000e-06,\n 298.4646301, 15.0001669, 0.000e-00,\n 0.5656250, 0.0000110, -9.700e-06,\n 0.0193900, 0.0000109, -9.600e-06,\n 0.0046004, 0.0045775,\n// 2103 1 8\n2489172.253022, 18.0, -4.0, 4.0, 209.6, 209.6,\n 0.0537060, 0.5631843, -3.330e-05, -9.330e-06,\n -0.4126540, 0.1320884, 1.882e-04, -2.350e-06,\n -22.2473297, 0.0052410, 6.000e-06,\n 88.4192963, 14.9970741, 0.000e-00,\n 0.5403970, -0.0000545, -1.290e-05,\n -0.0057120, -0.0000542, -1.290e-05,\n 0.0047546, 0.0047309,\n// 2103 7 4\n2489348.917915, 10.0, -4.0, 4.0, 210.8, 210.8,\n 0.0087820, 0.5117333, -4.190e-05, -6.220e-06,\n 0.1291490, -0.0977794, -1.489e-04, 1.320e-06,\n 22.8943100, -0.0033010, -5.000e-06,\n 328.8708191, 14.9994316, 0.000e-00,\n 0.5581880, 0.0000957, -1.020e-05,\n 0.0119910, 0.0000952, -1.020e-05,\n 0.0045994, 0.0045765,\n// 2103 12 29\n2489526.800900, 7.0, -4.0, 4.0, 211.9, 211.9,\n -0.1619830, 0.5445647, -4.000e-07, -7.820e-06,\n 0.2532330, 0.0827713, 1.559e-04, -1.320e-06,\n -23.2489605, 0.0019910, 6.000e-06,\n 284.6503296, 14.9963760, 0.000e-00,\n 0.5525130, -0.0001136, -1.170e-05,\n 0.0063440, -0.0001130, -1.170e-05,\n 0.0047545, 0.0047308,\n// 2104 6 22\n2489703.261351, 18.0, -4.0, 4.0, 213.1, 213.1,\n -0.2204580, 0.5497461, -2.450e-05, -7.970e-06,\n -0.6233210, -0.0606660, -1.287e-04, 9.900e-07,\n 23.4185390, -0.0003020, -6.000e-06,\n 89.4254837, 14.9991627, 0.000e-00,\n 0.5434340, 0.0001220, -1.150e-05,\n -0.0026900, 0.0001214, -1.140e-05,\n 0.0046008, 0.0045779,\n// 2104 12 17\n2489881.075313, 14.0, -4.0, 4.0, 214.2, 214.2,\n 0.0329460, 0.5164456, 2.800e-06, -6.210e-06,\n 1.0164040, 0.0340326, 1.165e-04, -5.200e-07,\n -23.3577194, -0.0014580, 6.000e-06,\n 31.0045891, 14.9962978, 0.000e-00,\n 0.5678550, -0.0000981, -1.040e-05,\n 0.0216090, -0.0000976, -1.040e-05,\n 0.0047515, 0.0047278,\n// 2105 5 14\n2490028.577842, 2.0, -4.0, 4.0, 215.2, 215.2,\n -0.1082260, 0.5770836, 2.670e-05, -9.860e-06,\n 1.1682850, 0.0919272, -1.945e-04, -1.480e-06,\n 18.5620708, 0.0098860, -4.000e-06,\n 210.8833618, 15.0014343, 0.000e-00,\n 0.5316410, -0.0000003, -1.290e-05,\n -0.0144250, -0.0000003, -1.280e-05,\n 0.0046279, 0.0046049,\n// 2105 6 12\n2490057.873740, 9.0, -4.0, 4.0, 215.4, 215.4,\n -0.0234630, 0.5791540, -1.140e-05, -9.640e-06,\n -1.3487740, -0.0176084, -9.030e-05, 3.900e-07,\n 23.1452408, 0.0026330, -6.000e-06,\n 314.9964294, 14.9993315, 0.000e-00,\n 0.5322570, 0.0000528, -1.260e-05,\n -0.0138120, 0.0000525, -1.260e-05,\n 0.0046049, 0.0045819,\n// 2105 11 6\n2490205.307663, 19.0, -4.0, 4.0, 216.3, 216.3,\n -0.4567790, 0.4971279, 2.930e-05, -5.660e-06,\n -1.2502940, -0.1026241, 1.497e-04, 1.100e-06,\n -16.0948200, -0.0121310, 4.000e-06,\n 109.1083679, 15.0008183, 0.000e-00,\n 0.5711040, 0.0000631, -1.000e-05,\n 0.0248420, 0.0000628, -9.900e-06,\n 0.0047162, 0.0046927,\n// 2106 5 3\n2490383.263421, 18.0, -4.0, 4.0, 217.5, 217.5,\n -0.2766420, 0.5585399, 4.820e-05, -8.900e-06,\n 0.4199590, 0.1180621, -1.211e-04, -1.810e-06,\n 15.7211103, 0.0119380, -3.000e-06,\n 90.7571030, 15.0024052, 0.000e-00,\n 0.5379000, -0.0000834, -1.230e-05,\n -0.0081960, -0.0000829, -1.230e-05,\n 0.0046399, 0.0046168,\n// 2106 10 26\n2490559.442819, 23.0, -4.0, 4.0, 218.6, 218.6,\n 0.0527120, 0.5171156, 1.200e-06, -6.770e-06,\n -0.5985760, -0.1314788, 1.089e-04, 1.640e-06,\n -12.5553799, -0.0138360, 3.000e-06,\n 169.0217743, 15.0023670, 0.000e-00,\n 0.5578020, 0.0001128, -1.090e-05,\n 0.0116060, 0.0001122, -1.090e-05,\n 0.0047019, 0.0046785,\n// 2107 4 23\n2490737.762975, 6.0, -4.0, 4.0, 219.8, 219.8,\n -0.0921700, 0.5215905, 3.910e-05, -7.000e-06,\n -0.3156550, 0.1337877, -5.300e-05, -1.720e-06,\n 12.3393097, 0.0136330, -3.000e-06,\n 270.3674011, 15.0032463, 0.000e-00,\n 0.5529090, -0.0001158, -1.100e-05,\n 0.0067380, -0.0001152, -1.100e-05,\n 0.0046535, 0.0046303,\n// 2107 10 16\n2490913.887815, 9.0, -4.0, 4.0, 221.0, 221.0,\n -0.1180560, 0.5445469, 7.000e-06, -8.520e-06,\n 0.2192420, -0.1576694, 4.820e-05, 2.390e-06,\n -8.7120600, -0.0149620, 2.000e-06,\n 318.5762634, 15.0036459, 0.000e-00,\n 0.5419010, 0.0001082, -1.230e-05,\n -0.0042160, 0.0001077, -1.220e-05,\n 0.0046870, 0.0046637,\n// 2108 4 11\n2491091.955285, 11.0, -4.0, 4.0, 222.2, 222.2,\n 0.3324100, 0.4897523, 9.600e-06, -5.640e-06,\n -1.0043710, 0.1431230, -2.300e-06, -1.580e-06,\n 8.4582396, 0.0149330, -2.000e-06,\n 344.7480774, 15.0038843, 0.000e-00,\n 0.5670390, -0.0000694, -1.000e-05,\n 0.0207970, -0.0000690, -9.900e-06,\n 0.0046683, 0.0046451,\n// 2108 10 5\n2491268.542589, 1.0, -4.0, 4.0, 223.3, 223.3,\n 0.2483550, 0.5569171, -6.800e-06, -9.490e-06,\n 0.8362440, -0.1744127, -1.840e-05, 2.890e-06,\n -4.7258000, -0.0155850, 1.000e-06,\n 197.8697357, 15.0045214, 0.000e-00,\n 0.5340730, 0.0000110, -1.300e-05,\n -0.0120050, 0.0000109, -1.290e-05,\n 0.0046726, 0.0046493,\n// 2109 3 1\n2491416.240202, 18.0, -4.0, 4.0, 224.3, 224.3,\n -0.2278530, 0.4929262, -1.360e-05, -5.820e-06,\n 1.1814830, 0.1477626, -1.130e-05, -1.670e-06,\n -7.4288998, 0.0155040, 2.000e-06,\n 86.9629517, 15.0032282, 0.000e-00,\n 0.5677820, 0.0000766, -1.020e-05,\n 0.0215360, 0.0000762, -1.020e-05,\n 0.0047210, 0.0046975,\n// 2109 8 26\n2491593.831546, 8.0, -4.0, 4.0, 225.5, 225.5,\n -0.2490860, 0.5363286, 1.080e-05, -7.930e-06,\n -0.9871040, -0.1488006, -1.810e-05, 2.140e-06,\n 10.3819304, -0.0141190, -2.000e-06,\n 299.4990540, 15.0042620, 0.000e-00,\n 0.5431770, -0.0001123, -1.170e-05,\n -0.0029460, -0.0001118, -1.160e-05,\n 0.0046250, 0.0046020,\n// 2110 2 18\n2491770.480262, 0.0, -4.0, 4.0, 226.6, 226.6,\n 0.1360200, 0.5277785, -4.060e-05, -7.400e-06,\n 0.4953390, 0.1403413, 4.150e-05, -1.890e-06,\n -11.4809599, 0.0144240, 3.000e-06,\n 176.5738678, 15.0022001, 0.000e-00,\n 0.5535310, 0.0001078, -1.150e-05,\n 0.0073560, 0.0001073, -1.140e-05,\n 0.0047322, 0.0047086,\n// 2110 8 15\n2491948.201913, 17.0, -4.0, 4.0, 227.8, 227.8,\n 0.0138740, 0.5097920, -5.400e-06, -6.320e-06,\n -0.2929070, -0.1201895, -7.340e-05, 1.420e-06,\n 13.9748802, -0.0127320, -3.000e-06,\n 73.8344498, 15.0033331, 0.000e-00,\n 0.5577060, -0.0001030, -1.040e-05,\n 0.0115110, -0.0001025, -1.030e-05,\n 0.0046158, 0.0045928,\n// 2111 2 8\n2492125.003856, 12.0, -4.0, 4.0, 229.0, 229.0,\n 0.0050910, 0.5623171, -3.300e-05, -9.230e-06,\n -0.2703010, 0.1240986, 1.144e-04, -1.950e-06,\n -15.0892296, 0.0128340, 3.000e-06,\n 356.5197449, 15.0009298, 0.000e-00,\n 0.5408140, 0.0000702, -1.280e-05,\n -0.0052980, 0.0000698, -1.270e-05,\n 0.0047411, 0.0047175,\n// 2111 8 4\n2492302.291922, 19.0, -4.0, 4.0, 230.1, 230.1,\n 0.0847950, 0.4976494, -1.960e-05, -5.590e-06,\n 0.4792720, -0.0913138, -1.193e-04, 9.600e-07,\n 17.2114105, -0.0108630, -4.000e-06,\n 103.4256897, 15.0022068, 0.000e-00,\n 0.5659720, -0.0000151, -9.700e-06,\n 0.0197360, -0.0000150, -9.600e-06,\n 0.0046083, 0.0045853,\n// 2112 1 29\n2492479.659625, 4.0, -4.0, 4.0, 231.3, 231.3,\n 0.2500240, 0.5738211, -3.050e-05, -9.720e-06,\n -0.9002750, 0.0958894, 1.831e-04, -1.530e-06,\n -18.1609306, 0.0107600, 4.000e-06,\n 236.8287811, 14.9995050, 0.000e-00,\n 0.5386590, -0.0000385, -1.310e-05,\n -0.0074410, -0.0000384, -1.300e-05,\n 0.0047480, 0.0047244,\n// 2112 6 24\n2492626.798528, 7.0, -4.0, 4.0, 232.3, 232.3,\n 0.0229750, 0.5274184, -6.400e-06, -6.710e-06,\n -1.5379330, 0.0378452, -8.500e-05, -6.000e-07,\n 23.3931503, -0.0009930, -6.000e-06,\n 284.3394775, 14.9991302, 0.000e-00,\n 0.5542730, 0.0001125, -1.050e-05,\n 0.0080950, 0.0001120, -1.050e-05,\n 0.0046008, 0.0045779,\n// 2112 7 23\n2492656.332312, 20.0, -4.0, 4.0, 232.5, 232.5,\n 0.1626560, 0.5118113, -3.330e-05, -6.060e-06,\n 1.2176970, -0.0630194, -1.690e-04, 6.900e-07,\n 19.8794804, -0.0085570, -4.000e-06,\n 118.3262405, 15.0010843, 0.000e-00,\n 0.5609730, 0.0000807, -1.000e-05,\n 0.0147610, 0.0000803, -1.000e-05,\n 0.0046026, 0.0045797,\n// 2112 12 19\n2492804.689766, 5.0, -4.0, 4.0, 233.5, 233.5,\n 0.3762050, 0.5367167, 2.170e-05, -7.310e-06,\n 1.1284180, -0.0634855, 1.128e-04, 9.700e-07,\n -23.4015102, -0.0006740, 6.000e-06,\n 255.8005829, 14.9963083, 0.000e-00,\n 0.5568800, -0.0001308, -1.130e-05,\n 0.0106880, -0.0001301, -1.130e-05,\n 0.0047518, 0.0047281,\n// 2113 6 13\n2492981.226392, 17.0, -4.0, 4.0, 234.7, 234.7,\n -0.1331110, 0.5556612, 1.460e-05, -8.440e-06,\n -0.7384400, 0.0854372, -1.225e-04, -1.440e-06,\n 23.2235603, 0.0019940, -6.000e-06,\n 74.9215012, 14.9992313, 0.000e-00,\n 0.5396240, 0.0001160, -1.190e-05,\n -0.0064810, 0.0001154, -1.180e-05,\n 0.0046045, 0.0045816,\n// 2113 12 8\n2493158.877398, 9.0, -4.0, 4.0, 235.9, 235.9,\n 0.0734410, 0.5002258, 3.840e-05, -5.770e-06,\n 0.5004040, -0.1034427, 1.277e-04, 1.320e-06,\n -22.7064896, -0.0041090, 6.000e-06,\n 317.0990601, 14.9967918, 0.000e-00,\n 0.5710380, -0.0000704, -1.020e-05,\n 0.0247760, -0.0000700, -1.010e-05,\n 0.0047463, 0.0047227,\n// 2114 6 3\n2493335.884824, 9.0, -4.0, 4.0, 237.0, 237.0,\n -0.1458040, 0.5681225, 3.970e-05, -9.610e-06,\n 0.0200860, 0.1317395, -1.572e-04, -2.380e-06,\n 22.2880096, 0.0048310, -5.000e-06,\n 315.4276428, 14.9997263, 0.000e-00,\n 0.5312060, 0.0000322, -1.280e-05,\n -0.0148570, 0.0000321, -1.270e-05,\n 0.0046105, 0.0045875,\n// 2114 11 27\n2493512.850168, 8.0, -4.0, 4.0, 238.2, 238.2,\n -0.2464470, 0.4841138, 4.210e-05, -5.370e-06,\n -0.1171600, -0.1413665, 1.367e-04, 1.710e-06,\n -21.0675392, -0.0073210, 5.000e-06,\n 303.1778564, 14.9979324, 0.000e-00,\n 0.5738990, 0.0000394, -9.900e-06,\n 0.0276230, 0.0000392, -9.800e-06,\n 0.0047377, 0.0047141,\n// 2115 5 24\n2493690.593007, 2.0, -4.0, 4.0, 239.4, 239.4,\n -0.3579400, 0.5515937, 7.140e-05, -8.990e-06,\n 0.7182240, 0.1675632, -1.757e-04, -2.910e-06,\n 20.6361103, 0.0074770, -5.000e-06,\n 210.7657928, 15.0004797, 0.000e-00,\n 0.5344890, -0.0000676, -1.250e-05,\n -0.0115900, -0.0000673, -1.240e-05,\n 0.0046188, 0.0045958,\n// 2115 11 16\n2493866.915918, 10.0, -4.0, 4.0, 240.6, 240.6,\n -0.2897770, 0.4934902, 3.840e-05, -6.140e-06,\n -0.8166100, -0.1811896, 1.543e-04, 2.400e-06,\n -18.6247406, -0.0100360, 4.000e-06,\n 333.8718262, 14.9994812, 0.000e-00,\n 0.5628260, 0.0001121, -1.070e-05,\n 0.0166050, 0.0001115, -1.060e-05,\n 0.0047261, 0.0047026,\n// 2116 4 13\n2494015.650638, 4.0, -4.0, 4.0, 241.6, 241.6,\n 0.7077810, 0.4698136, 1.070e-05, -5.920e-06,\n -0.9273230, 0.2425988, -6.000e-07, -3.210e-06,\n 9.1061602, 0.0145170, -2.000e-06,\n 239.8552551, 15.0037384, 0.000e-00,\n 0.5579340, -0.0001238, -1.070e-05,\n 0.0117380, -0.0001232, -1.060e-05,\n 0.0046658, 0.0046426,\n// 2116 10 6\n2494191.855453, 9.0, -4.0, 4.0, 242.8, 242.8,\n 0.7872140, 0.5054928, -3.680e-05, -8.090e-06,\n 0.8921650, -0.2726230, -1.570e-05, 4.590e-06,\n -5.2616301, -0.0152880, 1.000e-06,\n 317.9747009, 15.0043097, 0.000e-00,\n 0.5380570, 0.0000684, -1.260e-05,\n -0.0080400, 0.0000680, -1.250e-05,\n 0.0046743, 0.0046511,\n// 2116 11 4\n2494221.284824, 19.0, -4.0, 4.0, 243.0, 243.0,\n -0.5103900, 0.5145947, 5.230e-05, -7.690e-06,\n -1.4243720, -0.2204641, 1.749e-04, 3.440e-06,\n -15.5927496, -0.0121500, 3.000e-06,\n 109.1243820, 15.0011034, 0.000e-00,\n 0.5464060, 0.0001090, -1.200e-05,\n 0.0002670, 0.0001085, -1.200e-05,\n 0.0047129, 0.0046895,\n// 2117 4 2\n2494369.760645, 6.0, -4.0, 4.0, 244.0, 244.0,\n 0.1006900, 0.4438628, 1.440e-05, -4.910e-06,\n -0.4532520, 0.2429156, -4.500e-06, -2.850e-06,\n 4.9238701, 0.0154450, -1.000e-06,\n 269.0962219, 15.0041103, 0.000e-00,\n 0.5699430, -0.0000361, -9.800e-06,\n 0.0236870, -0.0000360, -9.800e-06,\n 0.0046813, 0.0046580,\n// 2117 9 26\n2494546.538679, 1.0, -4.0, 4.0, 245.2, 245.2,\n 0.2521520, 0.5098468, -8.000e-06, -8.560e-06,\n 0.3680240, -0.2830727, -1.580e-05, 4.960e-06,\n -1.1711000, -0.0155220, 0.000e-00,\n 197.1152039, 15.0048409, 0.000e-00,\n 0.5336770, -0.0000209, -1.290e-05,\n -0.0123990, -0.0000208, -1.290e-05,\n 0.0046602, 0.0046370,\n// 2118 3 22\n2494723.750636, 6.0, -4.0, 4.0, 246.4, 246.4,\n -0.1393710, 0.4453533, -1.300e-06, -5.040e-06,\n 0.2335520, 0.2487462, -1.570e-05, -2.990e-06,\n 0.5275600, 0.0158570, 0.000e-00,\n 268.2631531, 15.0041456, 0.000e-00,\n 0.5687350, 0.0000618, -1.000e-05,\n 0.0224850, 0.0000615, -1.000e-05,\n 0.0046964, 0.0046730,\n// 2118 9 15\n2494901.186409, 16.0, -4.0, 4.0, 247.6, 247.6,\n -0.3702120, 0.4933905, 2.280e-05, -7.460e-06,\n -0.1181140, -0.2723468, -1.500e-05, 4.320e-06,\n 2.9431300, -0.0153590, -1.000e-06,\n 61.1666412, 15.0049362, 0.000e-00,\n 0.5413790, -0.0000905, -1.200e-05,\n -0.0047350, -0.0000900, -1.200e-05,\n 0.0046469, 0.0046237,\n// 2119 3 11\n2495077.930078, 10.0, -4.0, 4.0, 248.8, 248.8,\n -0.6185570, 0.4717433, 4.000e-07, -6.250e-06,\n 0.7661100, 0.2591838, -2.230e-05, -3.610e-06,\n -3.8477001, 0.0157320, 1.000e-06,\n 327.4915771, 15.0038195, 0.000e-00,\n 0.5558880, 0.0001242, -1.110e-05,\n 0.0097020, 0.0001236, -1.110e-05,\n 0.0047099, 0.0046865,\n// 2119 9 5\n2495255.614201, 3.0, -4.0, 4.0, 250.0, 250.0,\n -0.3832910, 0.4684274, 1.350e-05, -5.920e-06,\n -1.0154480, -0.2485827, 2.400e-06, 3.340e-06,\n 7.0170798, -0.0147840, -2.000e-06,\n 225.2231140, 15.0046177, 0.000e-00,\n 0.5555950, -0.0001148, -1.070e-05,\n 0.0094100, -0.0001143, -1.060e-05,\n 0.0046349, 0.0046118,\n// 2120 1 30\n2495402.965228, 11.0, -4.0, 4.0, 251.0, 251.0,\n 0.2970630, 0.5422134, -6.980e-05, -9.050e-06,\n -1.0419329, 0.2080874, 1.778e-04, -3.680e-06,\n -17.7996197, 0.0107900, 4.000e-06,\n 341.7733765, 14.9996099, 0.000e-00,\n 0.5390480, 0.0000458, -1.300e-05,\n -0.0070540, 0.0000456, -1.300e-05,\n 0.0047473, 0.0047237,\n// 2120 7 25\n2495580.111129, 15.0, -4.0, 4.0, 252.2, 252.2,\n 0.4819480, 0.4785797, -5.800e-05, -5.320e-06,\n 0.8864090, -0.1641811, -1.457e-04, 1.970e-06,\n 19.4810905, -0.0087420, -4.000e-06,\n 43.3135185, 15.0011883, 0.000e-00,\n 0.5657560, 0.0000068, -9.700e-06,\n 0.0195210, 0.0000067, -9.600e-06,\n 0.0046037, 0.0045807,\n// 2121 1 19\n2495757.621005, 3.0, -4.0, 4.0, 253.4, 253.4,\n 0.1789650, 0.5508003, -4.590e-05, -9.070e-06,\n -0.3829120, 0.1739339, 1.668e-04, -3.040e-06,\n -20.3512192, 0.0082870, 5.000e-06,\n 222.4136658, 14.9982252, 0.000e-00,\n 0.5406300, -0.0000641, -1.290e-05,\n -0.0054800, -0.0000638, -1.280e-05,\n 0.0047522, 0.0047285,\n// 2121 7 14\n2495934.196279, 17.0, -4.0, 4.0, 254.6, 254.6,\n 0.2011900, 0.5047495, -5.770e-05, -6.170e-06,\n 0.1659220, -0.1357776, -1.374e-04, 1.800e-06,\n 21.5760994, -0.0061310, -5.000e-06,\n 73.4633789, 15.0001860, 0.000e-00,\n 0.5574600, 0.0000936, -1.030e-05,\n 0.0112660, 0.0000931, -1.020e-05,\n 0.0046003, 0.0045774,\n// 2122 1 8\n2496112.158927, 16.0, -4.0, 4.0, 255.8, 255.8,\n 0.0366560, 0.5342652, -1.990e-05, -7.590e-06,\n 0.2875460, 0.1267184, 1.435e-04, -1.950e-06,\n -22.2055798, 0.0053450, 6.000e-06,\n 58.3992691, 14.9970312, 0.000e-00,\n 0.5532800, -0.0001248, -1.170e-05,\n 0.0071060, -0.0001242, -1.160e-05,\n 0.0047548, 0.0047312,\n// 2122 7 4\n2496288.559386, 1.0, -4.0, 4.0, 257.0, 257.0,\n -0.3376030, 0.5454159, -3.050e-05, -7.980e-06,\n -0.5107720, -0.1037423, -1.267e-04, 1.650e-06,\n 22.8904305, -0.0032950, -5.000e-06,\n 193.8611450, 14.9995174, 0.000e-00,\n 0.5424140, 0.0001246, -1.160e-05,\n -0.0037050, 0.0001239, -1.150e-05,\n 0.0045991, 0.0045762,\n// 2122 12 28\n2496466.417320, 22.0, -4.0, 4.0, 258.2, 258.2,\n -0.1586560, 0.5103485, -3.400e-06, -6.070e-06,\n 0.9946810, 0.0771972, 1.163e-04, -1.050e-06,\n -23.2470798, 0.0020080, 6.000e-06,\n 149.6572876, 14.9962921, 0.000e-00,\n 0.5687530, -0.0000910, -1.040e-05,\n 0.0225020, -0.0000906, -1.030e-05,\n 0.0047549, 0.0047313,\n// 2123 5 25\n2496613.898233, 10.0, -4.0, 4.0, 259.2, 259.2,\n 0.1422590, 0.5819833, 7.800e-06, -9.950e-06,\n 1.2512300, 0.0544501, -2.190e-04, -8.300e-07,\n 20.8914604, 0.0073980, -5.000e-06,\n 330.7341309, 15.0004349, 0.000e-00,\n 0.5310730, -0.0000142, -1.290e-05,\n -0.0149890, -0.0000141, -1.280e-05,\n 0.0046176, 0.0045946,\n// 2123 6 23\n2496643.184859, 16.0, -4.0, 4.0, 259.4, 259.4,\n -0.3913440, 0.5769546, -4.900e-06, -9.650e-06,\n -1.2410330, -0.0633235, -9.700e-05, 1.170e-06,\n 23.4131908, -0.0003890, -6.000e-06,\n 59.3978615, 14.9992361, 0.000e-00,\n 0.5316090, 0.0000593, -1.270e-05,\n -0.0144570, 0.0000590, -1.260e-05,\n 0.0046004, 0.0045775,\n// 2123 11 18\n2496790.630162, 3.0, -4.0, 4.0, 260.4, 260.4,\n -0.2552640, 0.5029739, 1.870e-05, -5.750e-06,\n -1.3158790, -0.0732891, 1.750e-04, 7.600e-07,\n -19.0593491, -0.0098840, 4.000e-06,\n 228.7870636, 14.9992514, 0.000e-00,\n 0.5714770, 0.0000627, -1.000e-05,\n 0.0252130, 0.0000624, -1.000e-05,\n 0.0047283, 0.0047048,\n// 2124 5 14\n2496968.582750, 2.0, -4.0, 4.0, 261.7, 261.7,\n -0.0726670, 0.5628332, 3.670e-05, -8.900e-06,\n 0.5236430, 0.0867673, -1.494e-04, -1.300e-06,\n 18.6583691, 0.0098090, -4.000e-06,\n 210.8794250, 15.0013571, 0.000e-00,\n 0.5378780, -0.0000953, -1.220e-05,\n -0.0082190, -0.0000948, -1.220e-05,\n 0.0046279, 0.0046049,\n// 2124 11 6\n2497144.775397, 7.0, -4.0, 4.0, 262.9, 262.9,\n 0.0854670, 0.5242839, 9.000e-07, -6.930e-06,\n -0.6220650, -0.1076934, 1.353e-04, 1.340e-06,\n -16.0632801, -0.0121360, 4.000e-06,\n 289.1137085, 15.0009031, 0.000e-00,\n 0.5577520, 0.0001135, -1.100e-05,\n 0.0115560, 0.0001129, -1.100e-05,\n 0.0047154, 0.0046919,\n// 2125 5 3\n2497323.071212, 14.0, -4.0, 4.0, 264.1, 264.1,\n 0.1992470, 0.5252842, 2.900e-05, -6.990e-06,\n -0.1894720, 0.1100660, -8.230e-05, -1.390e-06,\n 15.7894402, 0.0119140, -4.000e-06,\n 30.7607803, 15.0022993, 0.000e-00,\n 0.5529750, -0.0001276, -1.090e-05,\n 0.0068030, -0.0001269, -1.090e-05,\n 0.0046404, 0.0046173,\n// 2125 10 26\n2497499.229733, 18.0, -4.0, 4.0, 265.3, 265.3,\n 0.3038390, 0.5508845, -7.700e-06, -8.670e-06,\n 0.0737830, -0.1394798, 8.150e-05, 2.110e-06,\n -12.6188498, -0.0137890, 3.000e-06,\n 94.0307465, 15.0024319, 0.000e-00,\n 0.5420940, 0.0000852, -1.240e-05,\n -0.0040240, 0.0000847, -1.230e-05,\n 0.0047012, 0.0046778,\n// 2126 4 22\n2497677.253038, 18.0, -4.0, 4.0, 266.5, 266.5,\n 0.2146290, 0.4933409, 1.760e-05, -5.660e-06,\n -0.9826420, 0.1270140, -2.690e-05, -1.390e-06,\n 12.3075199, 0.0136640, -3.000e-06,\n 90.3574371, 15.0031776, 0.000e-00,\n 0.5666730, -0.0000610, -9.900e-06,\n 0.0204330, -0.0000607, -9.900e-06,\n 0.0046546, 0.0046314,\n// 2126 10 16\n2497853.883926, 9.0, -4.0, 4.0, 267.7, 267.7,\n 0.1125120, 0.5603946, 8.300e-06, -9.550e-06,\n 0.8363000, -0.1626172, 8.600e-06, 2.690e-06,\n -8.8584204, -0.0149110, 2.000e-06,\n 318.6002808, 15.0036535, 0.000e-00,\n 0.5347910, 0.0000101, -1.300e-05,\n -0.0112900, 0.0000100, -1.290e-05,\n 0.0046867, 0.0046634,\n// 2127 3 13\n2498001.563918, 2.0, -4.0, 4.0, 268.8, 268.8,\n -0.1407760, 0.4919061, -9.900e-06, -5.860e-06,\n 1.2362660, 0.1564093, -3.850e-05, -1.790e-06,\n -3.1665599, 0.0160300, 1.000e-06,\n 207.6015015, 15.0039520, 0.000e-00,\n 0.5663680, 0.0000753, -1.030e-05,\n 0.0201300, 0.0000749, -1.020e-05,\n 0.0047084, 0.0046850,\n// 2127 9 6\n2498179.141858, 15.0, -4.0, 4.0, 270.0, 270.0,\n -0.5303860, 0.5303628, 2.920e-05, -7.740e-06,\n -0.9696240, -0.1618221, 5.100e-06, 2.310e-06,\n 6.4376798, -0.0151050, -2.000e-06,\n 45.3557892, 15.0048285, 0.000e-00,\n 0.5447190, -0.0001035, -1.160e-05,\n -0.0014110, -0.0001030, -1.160e-05,\n 0.0046360, 0.0046129,\n// 2128 3 1\n2498355.825372, 8.0, -4.0, 4.0, 271.2, 271.2,\n -0.0310300, 0.5252511, -2.740e-05, -7.440e-06,\n 0.4703390, 0.1567139, 1.530e-05, -2.140e-06,\n -7.4345899, 0.0154830, 2.000e-06,\n 296.9650574, 15.0032949, 0.000e-00,\n 0.5520130, 0.0001131, -1.160e-05,\n 0.0058460, 0.0001126, -1.150e-05,\n 0.0047210, 0.0046975,\n// 2128 8 25\n2498533.489280, 0.0, -4.0, 4.0, 272.4, 272.4,\n 0.0348930, 0.5031702, -3.600e-06, -6.180e-06,\n -0.3790760, -0.1385655, -4.740e-05, 1.640e-06,\n 10.3550196, -0.0141470, -2.000e-06,\n 179.4991760, 15.0041943, 0.000e-00,\n 0.5590960, -0.0001012, -1.030e-05,\n 0.0128940, -0.0001007, -1.030e-05,\n 0.0046253, 0.0046022,\n// 2129 2 18\n2498710.364323, 21.0, -4.0, 4.0, 273.7, 273.7,\n 0.2079030, 0.5574684, -3.940e-05, -9.190e-06,\n -0.2059960, 0.1486188, 8.310e-05, -2.370e-06,\n -11.3849297, 0.0144380, 2.000e-06,\n 131.5899048, 15.0022984, 0.000e-00,\n 0.5398910, 0.0000561, -1.280e-05,\n -0.0062160, 0.0000559, -1.280e-05,\n 0.0047317, 0.0047081,\n// 2129 8 15\n2498887.564636, 2.0, -4.0, 4.0, 274.9, 274.9,\n 0.3133870, 0.4921997, -2.840e-05, -5.520e-06,\n 0.3430620, -0.1154172, -9.310e-05, 1.230e-06,\n 14.0390396, -0.0127080, -3.000e-06,\n 208.8127441, 15.0032740, 0.000e-00,\n 0.5665640, -0.0000170, -9.700e-06,\n 0.0203240, -0.0000169, -9.600e-06,\n 0.0046157, 0.0045927,\n// 2130 2 8\n2499065.024575, 13.0, -4.0, 4.0, 276.1, 276.1,\n 0.4346300, 0.5670894, -4.080e-05, -9.580e-06,\n -0.8464440, 0.1275943, 1.533e-04, -2.060e-06,\n -14.9516697, 0.0129000, 3.000e-06,\n 11.5299702, 15.0009966, 0.000e-00,\n 0.5384920, -0.0000505, -1.300e-05,\n -0.0076080, -0.0000502, -1.300e-05,\n 0.0047408, 0.0047172,\n// 2130 8 4\n2499241.610233, 3.0, -4.0, 4.0, 277.4, 277.4,\n 0.3873780, 0.5084129, -4.610e-05, -6.060e-06,\n 1.0940270, -0.0935583, -1.445e-04, 1.060e-06,\n 17.2748909, -0.0108070, -4.000e-06,\n 223.4038696, 15.0022106, 0.000e-00,\n 0.5606380, 0.0000793, -1.010e-05,\n 0.0144280, 0.0000789, -1.000e-05,\n 0.0046077, 0.0045848,\n// 2130 12 30\n2499390.042759, 13.0, -4.0, 4.0, 278.4, 278.4,\n 0.0254590, 0.5383271, 2.260e-05, -7.260e-06,\n 1.1727980, -0.0181766, 1.111e-04, 3.300e-07,\n -23.1465893, 0.0027820, 6.000e-06,\n 14.4624395, 14.9964294, 0.000e-00,\n 0.5579390, -0.0001204, -1.130e-05,\n 0.0117420, -0.0001198, -1.120e-05,\n 0.0047548, 0.0047311,\n// 2131 6 25\n2499566.530041, 1.0, -4.0, 4.0, 279.6, 279.6,\n 0.2140960, 0.5625635, -1.330e-05, -8.630e-06,\n -0.7677140, 0.0411829, -1.225e-04, -7.600e-07,\n 23.3853207, -0.0010490, -6.000e-06,\n 194.3144226, 14.9992199, 0.000e-00,\n 0.5386600, 0.0000965, -1.190e-05,\n -0.0074400, 0.0000960, -1.190e-05,\n 0.0046004, 0.0045775,\n// 2131 12 19\n2499744.213085, 17.0, -4.0, 4.0, 280.9, 280.9,\n 0.0046650, 0.5059384, 2.880e-05, -5.810e-06,\n 0.5197130, -0.0615681, 1.359e-04, 8.200e-07,\n -23.3954105, -0.0007150, 6.000e-06,\n 75.8257294, 14.9962330, 0.000e-00,\n 0.5719190, -0.0000656, -1.010e-05,\n 0.0256530, -0.0000653, -1.010e-05,\n 0.0047521, 0.0047285,\n// 2132 6 13\n2499921.198888, 17.0, -4.0, 4.0, 282.1, 282.1,\n 0.1336080, 0.5770402, 1.550e-05, -9.800e-06,\n 0.0014960, 0.0876971, -1.663e-04, -1.630e-06,\n 23.2404594, 0.0018730, -6.000e-06,\n 74.8939133, 14.9992733, 0.000e-00,\n 0.5307020, 0.0000146, -1.280e-05,\n -0.0153590, 0.0000145, -1.270e-05,\n 0.0046042, 0.0045813,\n// 2132 12 7\n2500098.179669, 16.0, -4.0, 4.0, 283.4, 283.4,\n -0.1881980, 0.4938965, 3.190e-05, -5.500e-06,\n -0.1302220, -0.1036198, 1.528e-04, 1.280e-06,\n -22.6692410, -0.0042050, 6.000e-06,\n 62.1405716, 14.9968090, 0.000e-00,\n 0.5741920, 0.0000423, -9.900e-06,\n 0.0279150, 0.0000421, -9.900e-06,\n 0.0047459, 0.0047222,\n// 2133 6 3\n2500275.906438, 10.0, -4.0, 4.0, 284.6, 284.6,\n -0.0228630, 0.5609855, 4.850e-05, -9.110e-06,\n 0.7379380, 0.1273685, -1.933e-04, -2.230e-06,\n 22.3381996, 0.0047210, -5.000e-06,\n 330.4072876, 14.9996758, 0.000e-00,\n 0.5345610, -0.0000840, -1.240e-05,\n -0.0115180, -0.0000836, -1.240e-05,\n 0.0046106, 0.0045876,\n// 2133 11 26\n2500452.254110, 18.0, -4.0, 4.0, 285.8, 285.8,\n -0.2870290, 0.5061492, 3.520e-05, -6.370e-06,\n -0.7988580, -0.1475733, 1.749e-04, 1.990e-06,\n -21.0291405, -0.0073550, 5.000e-06,\n 93.1970596, 14.9980240, 0.000e-00,\n 0.5626550, 0.0001165, -1.070e-05,\n 0.0164350, 0.0001159, -1.070e-05,\n 0.0047365, 0.0047129,\n// 2134 4 24\n2500600.958322, 11.0, -4.0, 4.0, 286.9, 286.9,\n 0.5160240, 0.4763378, 2.650e-05, -5.950e-06,\n -1.0890970, 0.2256257, -1.730e-05, -2.960e-06,\n 12.8953505, 0.0131760, -3.000e-06,\n 345.4411011, 15.0029926, 0.000e-00,\n 0.5580020, -0.0001129, -1.060e-05,\n 0.0118050, -0.0001123, -1.050e-05,\n 0.0046522, 0.0046290,\n// 2134 5 23\n2500630.459235, 23.0, -4.0, 4.0, 287.1, 287.1,\n -0.4479600, 0.5223592, 7.800e-05, -7.210e-06,\n 1.4614739, 0.1557181, -1.973e-04, -2.330e-06,\n 20.6847191, 0.0074370, -5.000e-06,\n 165.7552948, 15.0003738, 0.000e-00,\n 0.5481950, -0.0001216, -1.120e-05,\n 0.0020470, -0.0001210, -1.110e-05,\n 0.0046196, 0.0045966,\n// 2134 10 17\n2500777.194929, 17.0, -4.0, 4.0, 288.1, 288.1,\n 0.7071880, 0.5124798, -2.070e-05, -8.260e-06,\n 0.9786340, -0.2615190, 4.100e-06, 4.440e-06,\n -9.3708801, -0.0145470, 2.000e-06,\n 78.6721573, 15.0033998, 0.000e-00,\n 0.5382970, 0.0000675, -1.260e-05,\n -0.0078020, 0.0000672, -1.260e-05,\n 0.0046886, 0.0046653,\n// 2134 11 16\n2500806.633425, 3.0, -4.0, 4.0, 288.3, 288.3,\n -0.6130850, 0.5278102, 5.960e-05, -7.980e-06,\n -1.3581010, -0.1914276, 1.972e-04, 3.040e-06,\n -18.6482391, -0.0099830, 4.000e-06,\n 228.8677063, 14.9995613, 0.000e-00,\n 0.5463050, 0.0001152, -1.210e-05,\n 0.0001660, 0.0001147, -1.210e-05,\n 0.0047251, 0.0047016,\n// 2135 4 13\n2500955.060480, 13.0, -4.0, 4.0, 289.4, 289.4,\n 0.0266950, 0.4486865, 2.640e-05, -4.950e-06,\n -0.5465300, 0.2331851, -2.290e-05, -2.740e-06,\n 9.0212898, 0.0145650, -2.000e-06,\n 14.8423300, 15.0036898, 0.000e-00,\n 0.5693050, -0.0000265, -9.800e-06,\n 0.0230520, -0.0000263, -9.800e-06,\n 0.0046671, 0.0046438,\n// 2135 10 7\n2501131.875036, 9.0, -4.0, 4.0, 290.6, 290.6,\n 0.2323360, 0.5121633, 6.800e-06, -8.580e-06,\n 0.4295810, -0.2776754, 4.900e-06, 4.860e-06,\n -5.4120302, -0.0152540, 1.000e-06,\n 318.0040283, 15.0043030, 0.000e-00,\n 0.5346100, -0.0000248, -1.290e-05,\n -0.0114700, -0.0000247, -1.290e-05,\n 0.0046744, 0.0046512,\n// 2136 4 1\n2501309.059942, 13.0, -4.0, 4.0, 291.9, 291.9,\n -0.3069870, 0.4485427, 1.550e-05, -5.120e-06,\n 0.0935080, 0.2457201, -3.230e-05, -2.970e-06,\n 4.8029799, 0.0154570, -1.000e-06,\n 14.0727196, 15.0041227, 0.000e-00,\n 0.5672650, 0.0000749, -1.000e-05,\n 0.0210220, 0.0000746, -1.000e-05,\n 0.0046819, 0.0046586,\n// 2136 9 26\n2501486.508498, 0.0, -4.0, 4.0, 293.1, 293.1,\n -0.2122430, 0.4910124, 2.850e-05, -7.350e-06,\n -0.1462530, -0.2726865, 8.900e-06, 4.290e-06,\n -1.3078800, -0.0155420, 0.000e-00,\n 182.1470947, 15.0047894, 0.000e-00,\n 0.5429080, -0.0000998, -1.200e-05,\n -0.0032140, -0.0000993, -1.190e-05,\n 0.0046607, 0.0046375,\n// 2137 3 21\n2501663.261554, 18.0, -4.0, 4.0, 294.4, 294.4,\n -0.5862540, 0.4722653, 1.210e-05, -6.330e-06,\n 0.7460200, 0.2626175, -4.490e-05, -3.690e-06,\n 0.4854500, 0.0158240, 0.000e-00,\n 88.2568283, 15.0042067, 0.000e-00,\n 0.5542100, 0.0001234, -1.120e-05,\n 0.0080320, 0.0001228, -1.110e-05,\n 0.0046961, 0.0046727,\n// 2137 9 15\n2501840.914283, 10.0, -4.0, 4.0, 295.6, 295.6,\n -0.4645450, 0.4628301, 2.710e-05, -5.780e-06,\n -0.9067840, -0.2547076, 1.900e-05, 3.380e-06,\n 2.8860600, -0.0154040, -1.000e-06,\n 331.1767578, 15.0048656, 0.000e-00,\n 0.5572600, -0.0001080, -1.060e-05,\n 0.0110670, -0.0001075, -1.060e-05,\n 0.0046475, 0.0046243,\n// 2138 2 9\n2501988.330127, 20.0, -4.0, 4.0, 296.7, 296.7,\n 0.4847620, 0.5307028, -7.420e-05, -8.860e-06,\n -0.9741630, 0.2374136, 1.471e-04, -4.180e-06,\n -14.5169296, 0.0128690, 3.000e-06,\n 116.5149002, 15.0010853, 0.000e-00,\n 0.5384090, 0.0000339, -1.300e-05,\n -0.0076910, 0.0000337, -1.300e-05,\n 0.0047399, 0.0047163,\n// 2138 8 5\n2502165.381210, 21.0, -4.0, 4.0, 298.0, 298.0,\n 0.3378450, 0.4685506, -5.400e-05, -5.200e-06,\n 1.0265880, -0.1913435, -1.310e-04, 2.270e-06,\n 16.7868195, -0.0109230, -4.000e-06,\n 133.4462891, 15.0023012, 0.000e-00,\n 0.5659510, 0.0000231, -9.700e-06,\n 0.0197140, 0.0000230, -9.600e-06,\n 0.0046089, 0.0045860,\n// 2139 1 30\n2502342.987790, 12.0, -4.0, 4.0, 299.2, 299.2,\n 0.3118950, 0.5373452, -5.270e-05, -8.790e-06,\n -0.3351470, 0.2093831, 1.398e-04, -3.610e-06,\n -17.6813393, 0.0108830, 4.000e-06,\n 356.7629700, 14.9996510, 0.000e-00,\n 0.5407680, -0.0000743, -1.290e-05,\n -0.0053430, -0.0000739, -1.280e-05,\n 0.0047475, 0.0047239,\n// 2139 7 25\n2502519.476771, 23.0, -4.0, 4.0, 300.5, 300.5,\n -0.1242420, 0.4962635, -5.020e-05, -6.120e-06,\n 0.3538520, -0.1696136, -1.270e-04, 2.250e-06,\n 19.5356503, -0.0086700, -4.000e-06,\n 163.2994537, 15.0012121, 0.000e-00,\n 0.5567110, 0.0001128, -1.040e-05,\n 0.0105210, 0.0001122, -1.030e-05,\n 0.0046029, 0.0045800,\n// 2140 1 20\n2502697.516097, 0.0, -4.0, 4.0, 301.8, 301.8,\n -0.2826090, 0.5216258, -1.260e-05, -7.310e-06,\n 0.1909360, 0.1657900, 1.296e-04, -2.490e-06,\n -20.2949696, 0.0083770, 5.000e-06,\n 177.4032440, 14.9981766, 0.000e-00,\n 0.5540430, -0.0001129, -1.160e-05,\n 0.0078660, -0.0001123, -1.150e-05,\n 0.0047530, 0.0047293,\n// 2140 7 14\n2502873.858462, 9.0, -4.0, 4.0, 303.0, 303.0,\n 0.0875520, 0.5381416, -5.720e-05, -7.930e-06,\n -0.5268900, -0.1445809, -1.117e-04, 2.280e-06,\n 21.5633507, -0.0061280, -5.000e-06,\n 313.4508972, 15.0002832, 0.000e-00,\n 0.5416420, 0.0001041, -1.170e-05,\n -0.0044730, 0.0001036, -1.160e-05,\n 0.0045994, 0.0045765,\n// 2141 1 8\n2503051.758769, 6.0, -4.0, 4.0, 304.3, 304.3,\n -0.3358120, 0.5010918, -7.800e-06, -5.900e-06,\n 0.9507290, 0.1182674, 1.079e-04, -1.540e-06,\n -22.2083702, 0.0053560, 6.000e-06,\n 268.4119873, 14.9969397, 0.000e-00,\n 0.5694490, -0.0000842, -1.030e-05,\n 0.0231950, -0.0000837, -1.030e-05,\n 0.0047556, 0.0047319,\n// 2141 6 4\n2503199.215263, 17.0, -4.0, 4.0, 305.3, 305.3,\n -0.1250790, 0.5844220, 1.140e-05, -9.990e-06,\n 1.2956960, 0.0126375, -2.362e-04, -1.100e-07,\n 22.4940796, 0.0046190, -5.000e-06,\n 75.3382492, 14.9996557, 0.000e-00,\n 0.5306790, -0.0000045, -1.280e-05,\n -0.0153820, -0.0000045, -1.280e-05,\n 0.0046096, 0.0045866,\n// 2141 7 3\n2503228.495575, 0.0, -4.0, 4.0, 305.5, 305.5,\n -0.1639720, 0.5710700, -2.700e-05, -9.570e-06,\n -1.1932880, -0.1085639, -9.210e-05, 1.960e-06,\n 22.8574104, -0.0033850, -6.000e-06,\n 178.8332672, 14.9996052, 0.000e-00,\n 0.5312010, 0.0000400, -1.270e-05,\n -0.0148620, 0.0000398, -1.260e-05,\n 0.0045985, 0.0045756,\n// 2141 11 28\n2503375.958026, 11.0, -4.0, 4.0, 306.6, 306.6,\n -0.0977030, 0.5076237, 5.000e-06, -5.820e-06,\n -1.3516949, -0.0381041, 1.957e-04, 3.500e-07,\n -21.3432503, -0.0071310, 5.000e-06,\n 348.0564575, 14.9978132, 0.000e-00,\n 0.5716730, 0.0000644, -1.000e-05,\n 0.0254080, 0.0000641, -1.000e-05,\n 0.0047383, 0.0047147,\n// 2142 5 25\n2503553.897652, 10.0, -4.0, 4.0, 307.9, 307.9,\n 0.2060170, 0.5657929, 1.750e-05, -8.890e-06,\n 0.6141920, 0.0497563, -1.736e-04, -7.000e-07,\n 20.9640903, 0.0073070, -5.000e-06,\n 330.7121887, 15.0003500, 0.000e-00,\n 0.5379920, -0.0001094, -1.210e-05,\n -0.0081050, -0.0001088, -1.210e-05,\n 0.0046181, 0.0045951,\n// 2142 11 17\n2503730.113283, 15.0, -4.0, 4.0, 309.1, 309.1,\n 0.0615980, 0.5313658, -1.400e-06, -7.090e-06,\n -0.6270240, -0.0770063, 1.594e-04, 9.300e-07,\n -19.0319309, -0.0098970, 5.000e-06,\n 48.8025513, 14.9993486, 0.000e-00,\n 0.5575880, 0.0001166, -1.110e-05,\n 0.0113930, 0.0001160, -1.110e-05,\n 0.0047271, 0.0047036,\n// 2143 5 14\n2503908.373775, 21.0, -4.0, 4.0, 310.4, 310.4,\n 0.0402010, 0.5287723, 3.320e-05, -6.960e-06,\n -0.1595320, 0.0805132, -1.062e-04, -9.800e-07,\n 18.7054806, 0.0097820, -4.000e-06,\n 135.8710175, 15.0012417, 0.000e-00,\n 0.5532380, -0.0001201, -1.080e-05,\n 0.0070650, -0.0001195, -1.080e-05,\n 0.0046289, 0.0046059,\n// 2143 11 7\n2504084.577271, 2.0, -4.0, 4.0, 311.7, 311.7,\n 0.1053350, 0.5580893, 3.600e-06, -8.860e-06,\n 0.1016100, -0.1139197, 1.069e-04, 1.720e-06,\n -16.1170902, -0.0120830, 4.000e-06,\n 214.1200562, 15.0009718, 0.000e-00,\n 0.5421570, 0.0000898, -1.250e-05,\n -0.0039610, 0.0000894, -1.240e-05,\n 0.0047144, 0.0046909,\n// 2144 5 3\n2504262.543125, 1.0, -4.0, 4.0, 313.0, 313.0,\n 0.1772320, 0.4977647, 2.000e-05, -5.680e-06,\n -0.9275030, 0.1048866, -5.190e-05, -1.130e-06,\n 15.7488403, 0.0119520, -4.000e-06,\n 195.7525635, 15.0022364, 0.000e-00,\n 0.5663040, -0.0000559, -9.900e-06,\n 0.0200660, -0.0000556, -9.800e-06,\n 0.0046415, 0.0046184,\n// 2144 10 26\n2504439.231024, 18.0, -4.0, 4.0, 314.2, 314.2,\n 0.4549560, 0.5654718, -3.200e-06, -9.640e-06,\n 0.7138440, -0.1432534, 4.220e-05, 2.350e-06,\n -12.7524700, -0.0137210, 3.000e-06,\n 94.0442810, 15.0024281, 0.000e-00,\n 0.5355460, -0.0000132, -1.300e-05,\n -0.0105390, -0.0000132, -1.300e-05,\n 0.0047009, 0.0046775,\n// 2145 3 23\n2504586.881685, 9.0, -4.0, 4.0, 315.3, 315.3,\n -0.4625280, 0.4929934, 9.100e-06, -5.930e-06,\n 1.1663361, 0.1586310, -6.090e-05, -1.830e-06,\n 1.1490200, 0.0160440, 0.000e-00,\n 313.3850708, 15.0042744, 0.000e-00,\n 0.5647650, 0.0000917, -1.030e-05,\n 0.0185350, 0.0000912, -1.030e-05,\n 0.0046946, 0.0046712,\n// 2145 9 16\n2504764.456361, 23.0, -4.0, 4.0, 316.6, 316.6,\n -0.3222220, 0.5262369, 2.750e-05, -7.610e-06,\n -1.0944880, -0.1681205, 3.450e-05, 2.380e-06,\n 2.2666800, -0.0156620, -1.000e-06,\n 166.3174744, 15.0050240, 0.000e-00,\n 0.5462710, -0.0001154, -1.160e-05,\n 0.0001330, -0.0001148, -1.150e-05,\n 0.0046488, 0.0046257,\n// 2145 10 16\n2504793.882961, 9.0, -4.0, 4.0, 316.8, 316.8,\n 0.3236140, 0.5450345, 1.090e-05, -8.580e-06,\n 1.4880980, -0.1599436, -2.900e-05, 2.410e-06,\n -9.0072298, -0.0148770, 2.000e-06,\n 318.6162415, 15.0035830, 0.000e-00,\n 0.5413140, -0.0000878, -1.230e-05,\n -0.0047990, -0.0000873, -1.230e-05,\n 0.0046871, 0.0046638,\n// 2146 3 12\n2504941.165454, 16.0, -4.0, 4.0, 317.9, 317.9,\n -0.1302040, 0.5245320, -1.530e-05, -7.520e-06,\n 0.4644590, 0.1660130, -1.100e-05, -2.290e-06,\n -3.1762800, 0.0160060, 1.000e-06,\n 57.6107483, 15.0040236, 0.000e-00,\n 0.5504130, 0.0001156, -1.160e-05,\n 0.0042540, 0.0001150, -1.160e-05,\n 0.0047081, 0.0046847,\n// 2146 9 6\n2505118.780560, 7.0, -4.0, 4.0, 319.2, 319.2,\n 0.0095840, 0.4977887, 2.200e-06, -6.050e-06,\n -0.4468690, -0.1506815, -2.180e-05, 1.770e-06,\n 6.4075699, -0.0151340, -1.000e-06,\n 285.3526001, 15.0047560, 0.000e-00,\n 0.5605730, -0.0000974, -1.030e-05,\n 0.0143630, -0.0000970, -1.020e-05,\n 0.0046365, 0.0046134,\n// 2147 3 2\n2505295.721457, 5.0, -4.0, 4.0, 320.5, 320.5,\n -0.1069230, 0.5538478, -1.700e-05, -9.190e-06,\n -0.2781740, 0.1653520, 5.840e-05, -2.660e-06,\n -7.3311801, 0.0154810, 1.000e-06,\n 251.9861145, 15.0033817, 0.000e-00,\n 0.5388340, 0.0000656, -1.280e-05,\n -0.0072680, 0.0000653, -1.280e-05,\n 0.0047204, 0.0046968,\n// 2147 8 26\n2505472.839752, 8.0, -4.0, 4.0, 321.7, 321.7,\n 0.0113810, 0.4872724, -1.630e-05, -5.450e-06,\n 0.3360460, -0.1334938, -7.000e-05, 1.430e-06,\n 10.4421902, -0.0141260, -2.000e-06,\n 299.4717407, 15.0041418, 0.000e-00,\n 0.5672400, 0.0000016, -9.700e-06,\n 0.0209970, 0.0000016, -9.700e-06,\n 0.0046251, 0.0046020,\n// 2148 2 19\n2505650.387496, 21.0, -4.0, 4.0, 323.0, 323.0,\n 0.0694580, 0.5606196, -1.880e-05, -9.430e-06,\n -0.9250060, 0.1513482, 1.288e-04, -2.450e-06,\n -11.2418404, 0.0144790, 2.000e-06,\n 131.6028442, 15.0023479, 0.000e-00,\n 0.5382780, -0.0000375, -1.300e-05,\n -0.0078200, -0.0000373, -1.290e-05,\n 0.0047314, 0.0047079,\n// 2148 8 14\n2505826.890524, 9.0, -4.0, 4.0, 324.3, 324.3,\n 0.0555730, 0.5045872, -3.530e-05, -6.070e-06,\n 1.0813760, -0.1183874, -1.218e-04, 1.370e-06,\n 14.1305599, -0.0126510, -3.000e-06,\n 313.7921753, 15.0032787, 0.000e-00,\n 0.5603180, 0.0000991, -1.020e-05,\n 0.0141100, 0.0000986, -1.010e-05,\n 0.0046151, 0.0045921,\n// 2149 1 9\n2505975.396271, 22.0, -4.0, 4.0, 325.4, 325.4,\n 0.2068070, 0.5363107, 3.000e-06, -7.180e-06,\n 1.1913480, 0.0254440, 1.011e-04, -2.700e-07,\n -21.9621906, 0.0061000, 6.000e-06,\n 148.2346954, 14.9971914, 0.000e-00,\n 0.5587060, -0.0001321, -1.120e-05,\n 0.0125060, -0.0001315, -1.110e-05,\n 0.0047550, 0.0047313,\n// 2149 7 5\n2506151.833032, 8.0, -4.0, 4.0, 326.7, 326.7,\n 0.0000300, 0.5659017, -1.520e-05, -8.780e-06,\n -0.8543690, -0.0026943, -1.113e-04, -7.000e-08,\n 22.7266808, -0.0040190, -5.000e-06,\n 298.7702026, 14.9996710, 0.000e-00,\n 0.5377540, 0.0001002, -1.200e-05,\n -0.0083420, 0.0000997, -1.200e-05,\n 0.0045988, 0.0045759,\n// 2149 12 30\n2506329.550743, 1.0, -4.0, 4.0, 328.0, 328.0,\n -0.0913320, 0.5083068, 1.850e-05, -5.820e-06,\n 0.5290050, -0.0188426, 1.352e-04, 3.100e-07,\n -23.1501503, 0.0027480, 6.000e-06,\n 194.4837036, 14.9963446, 0.000e-00,\n 0.5726050, -0.0000598, -1.010e-05,\n 0.0263350, -0.0000595, -1.000e-05,\n 0.0047554, 0.0047317,\n// 2150 6 25\n2506506.512099, 0.0, -4.0, 4.0, 329.0, 329.0,\n -0.1625960, 0.5824929, 1.830e-05, -9.920e-06,\n -0.1030050, 0.0420558, -1.625e-04, -8.400e-07,\n 23.3728199, -0.0011560, -6.000e-06,\n 179.2813721, 14.9992781, 0.000e-00,\n 0.5303370, 0.0000219, -1.280e-05,\n -0.0157220, 0.0000218, -1.270e-05,\n 0.0046001, 0.0045771,\n// 2150 12 19\n2506683.511824, 0.0, -4.0, 4.0, 330.0, 330.0,\n -0.1611960, 0.5011875, 1.880e-05, -5.610e-06,\n -0.1346130, -0.0625008, 1.612e-04, 8.100e-07,\n -23.3847294, -0.0008170, 6.000e-06,\n 180.8758240, 14.9962311, 0.000e-00,\n 0.5743160, 0.0000463, -9.900e-06,\n 0.0280380, 0.0000460, -9.900e-06,\n 0.0047520, 0.0047283,\n// 2151 6 14\n2506861.217879, 17.0, -4.0, 4.0, 331.1, 331.1,\n -0.2259500, 0.5677337, 4.770e-05, -9.160e-06,\n 0.6298370, 0.0839664, -1.977e-04, -1.500e-06,\n 23.2571507, 0.0017630, -5.000e-06,\n 74.8557587, 14.9992399, 0.000e-00,\n 0.5348390, -0.0000766, -1.240e-05,\n -0.0112420, -0.0000762, -1.230e-05,\n 0.0046042, 0.0045812,\n// 2151 12 8\n2507037.596187, 2.0, -4.0, 4.0, 332.1, 332.1,\n -0.3302220, 0.5175270, 2.850e-05, -6.590e-06,\n -0.7808970, -0.1085146, 1.903e-04, 1.500e-06,\n -22.6444798, -0.0042530, 6.000e-06,\n 212.1734009, 14.9968910, 0.000e-00,\n 0.5623570, 0.0001226, -1.080e-05,\n 0.0161380, 0.0001220, -1.080e-05,\n 0.0047451, 0.0047215,\n// 2152 5 4\n2507186.259749, 18.0, -4.0, 4.0, 332.9, 332.9,\n 0.3757970, 0.4847130, 3.700e-05, -6.000e-06,\n -1.2172040, 0.2027335, -3.510e-05, -2.650e-06,\n 16.2628899, 0.0113920, -4.000e-06,\n 90.7863617, 15.0020342, 0.000e-00,\n 0.5580820, -0.0001049, -1.050e-05,\n 0.0118850, -0.0001043, -1.040e-05,\n 0.0046393, 0.0046162,\n// 2152 6 3\n2507215.757863, 6.0, -4.0, 4.0, 333.1, 333.1,\n -0.4174980, 0.5301891, 6.920e-05, -7.250e-06,\n 1.4074100, 0.1178103, -2.104e-04, -1.780e-06,\n 22.3641796, 0.0046770, -5.000e-06,\n 270.3814392, 14.9995813, 0.000e-00,\n 0.5486650, -0.0001172, -1.110e-05,\n 0.0025150, -0.0001166, -1.100e-05,\n 0.0046111, 0.0045882,\n// 2152 10 28\n2507362.539979, 1.0, -4.0, 4.0, 334.0, 334.0,\n 0.5369430, 0.5223724, -2.200e-06, -8.480e-06,\n 1.0971720, -0.2433822, 2.310e-05, 4.170e-06,\n -13.2071896, -0.0132900, 3.000e-06,\n 199.0760956, 15.0021505, 0.000e-00,\n 0.5385490, 0.0000700, -1.270e-05,\n -0.0075510, 0.0000696, -1.270e-05,\n 0.0047026, 0.0046791,\n// 2152 11 26\n2507391.986896, 12.0, -4.0, 4.0, 334.1, 334.1,\n -0.2342620, 0.5411962, 3.950e-05, -8.250e-06,\n -1.4584740, -0.1551295, 2.250e-04, 2.500e-06,\n -21.0510693, -0.0072980, 5.000e-06,\n 3.1970201, 14.9981031, 0.000e-00,\n 0.5462320, 0.0000997, -1.220e-05,\n 0.0000940, 0.0000992, -1.210e-05,\n 0.0047357, 0.0047121,\n// 2153 4 23\n2507540.353753, 20.0, -4.0, 4.0, 335.0, 335.0,\n 0.0157990, 0.4561179, 3.420e-05, -5.040e-06,\n -0.6082470, 0.2177108, -4.240e-05, -2.560e-06,\n 12.8188295, 0.0132300, -3.000e-06,\n 120.4283371, 15.0029516, 0.000e-00,\n 0.5686580, -0.0000196, -9.800e-06,\n 0.0224080, -0.0000195, -9.700e-06,\n 0.0046535, 0.0046303,\n// 2153 10 17\n2507717.216870, 17.0, -4.0, 4.0, 336.0, 336.0,\n 0.1338110, 0.5178477, 2.460e-05, -8.650e-06,\n 0.5223640, -0.2654886, 2.500e-05, 4.640e-06,\n -9.5140800, -0.0144950, 2.000e-06,\n 78.6904984, 15.0033789, 0.000e-00,\n 0.5355740, -0.0000253, -1.290e-05,\n -0.0105110, -0.0000251, -1.290e-05,\n 0.0046885, 0.0046652,\n// 2154 4 12\n2507894.363206, 21.0, -4.0, 4.0, 337.1, 337.1,\n 0.0459260, 0.4548945, 1.310e-05, -5.230e-06,\n 0.2261470, 0.2367745, -5.880e-05, -2.890e-06,\n 8.9199896, 0.0145870, -2.000e-06,\n 134.8286133, 15.0037098, 0.000e-00,\n 0.5658680, 0.0000652, -1.010e-05,\n 0.0196320, 0.0000648, -1.000e-05,\n 0.0046679, 0.0046446,\n// 2154 10 7\n2508071.835994, 8.0, -4.0, 4.0, 338.1, 338.1,\n -0.1203970, 0.4920887, 3.720e-05, -7.300e-06,\n -0.1471470, -0.2666885, 3.210e-05, 4.160e-06,\n -5.5473800, -0.0152570, 1.000e-06,\n 303.0273132, 15.0042400, 0.000e-00,\n 0.5444650, -0.0001058, -1.190e-05,\n -0.0016640, -0.0001052, -1.190e-05,\n 0.0046747, 0.0046514,\n// 2155 4 2\n2508248.587897, 2.0, -4.0, 4.0, 339.1, 339.1,\n -0.4819390, 0.4762719, 2.040e-05, -6.460e-06,\n 0.7594520, 0.2598069, -6.840e-05, -3.690e-06,\n 4.7769299, 0.0154280, -1.000e-06,\n 209.0705719, 15.0041828, 0.000e-00,\n 0.5525190, 0.0001197, -1.120e-05,\n 0.0063490, 0.0001191, -1.120e-05,\n 0.0046819, 0.0046586,\n// 2155 9 26\n2508426.218371, 17.0, -4.0, 4.0, 340.2, 340.2,\n -0.5786030, 0.4604215, 4.260e-05, -5.690e-06,\n -0.7831690, -0.2549844, 3.530e-05, 3.340e-06,\n -1.3500800, -0.0155780, 0.000e-00,\n 77.1507111, 15.0047207, 0.000e-00,\n 0.5589670, -0.0000991, -1.060e-05,\n 0.0127660, -0.0000986, -1.050e-05,\n 0.0046609, 0.0046377,\n// 2156 2 21\n2508573.691690, 5.0, -4.0, 4.0, 341.1, 341.1,\n 0.6977970, 0.5209991, -7.550e-05, -8.710e-06,\n -0.8809280, 0.2592672, 1.152e-04, -4.550e-06,\n -10.7436304, 0.0143850, 2.000e-06,\n 251.6438599, 15.0024042, 0.000e-00,\n 0.5376730, 0.0000197, -1.300e-05,\n -0.0084230, 0.0000196, -1.300e-05,\n 0.0047301, 0.0047066,\n// 2156 8 16\n2508750.653791, 4.0, -4.0, 4.0, 342.1, 342.1,\n 0.6297560, 0.4591922, -6.070e-05, -5.090e-06,\n 0.9847900, -0.2132967, -1.086e-04, 2.520e-06,\n 13.5473404, -0.0127100, -3.000e-06,\n 238.8833313, 15.0033360, 0.000e-00,\n 0.5662710, 0.0000211, -9.700e-06,\n 0.0200330, 0.0000210, -9.700e-06,\n 0.0046168, 0.0045938,\n// 2157 2 9\n2508928.351115, 20.0, -4.0, 4.0, 343.1, 343.1,\n -0.0441510, 0.5245499, -3.010e-05, -8.510e-06,\n -0.4983370, 0.2372771, 1.217e-04, -4.040e-06,\n -14.3909998, 0.0129330, 3.000e-06,\n 116.5231400, 15.0011177, 0.000e-00,\n 0.5408360, -0.0000608, -1.280e-05,\n -0.0052750, -0.0000605, -1.270e-05,\n 0.0047398, 0.0047162,\n// 2157 8 5\n2509104.759948, 6.0, -4.0, 4.0, 344.2, 344.2,\n 0.0251100, 0.4872029, -5.590e-05, -6.050e-06,\n 0.3940400, -0.1987449, -1.080e-04, 2.630e-06,\n 16.8463001, -0.0108630, -4.000e-06,\n 268.4341125, 15.0023241, 0.000e-00,\n 0.5562160, 0.0001124, -1.040e-05,\n 0.0100290, 0.0001119, -1.040e-05,\n 0.0046085, 0.0045855,\n// 2158 1 30\n2509282.871258, 9.0, -4.0, 4.0, 345.2, 345.2,\n -0.0498760, 0.5080994, -2.300e-05, -7.040e-06,\n 0.2617950, 0.1989496, 1.036e-04, -2.940e-06,\n -17.6095791, 0.0109640, 4.000e-06,\n 311.7659302, 14.9996119, 0.000e-00,\n 0.5545080, -0.0001250, -1.150e-05,\n 0.0083290, -0.0001244, -1.150e-05,\n 0.0047479, 0.0047243,\n// 2158 7 25\n2509459.159221, 16.0, -4.0, 4.0, 346.3, 346.3,\n -0.0376840, 0.5291261, -5.520e-05, -7.870e-06,\n -0.4190120, -0.1809969, -9.770e-05, 2.850e-06,\n 19.5095005, -0.0086680, -4.000e-06,\n 58.2896385, 15.0013084, 0.000e-00,\n 0.5409170, 0.0001075, -1.170e-05,\n -0.0051940, 0.0001069, -1.170e-05,\n 0.0046023, 0.0045794,\n// 2159 1 19\n2509637.099612, 14.0, -4.0, 4.0, 347.3, 347.3,\n -0.4926800, 0.4896836, -8.500e-06, -5.710e-06,\n 0.8901530, 0.1551407, 9.290e-05, -1.970e-06,\n -20.3001595, 0.0083940, 5.000e-06,\n 27.4154301, 14.9980917, 0.000e-00,\n 0.5699530, -0.0000774, -1.030e-05,\n 0.0236960, -0.0000770, -1.020e-05,\n 0.0047536, 0.0047299,\n// 2159 6 16\n2509784.529670, 1.0, -4.0, 4.0, 348.2, 348.2,\n 0.2438870, 0.5835415, -2.020e-05, -9.960e-06,\n 1.3553110, -0.0325887, -2.464e-04, 6.700e-07,\n 23.3136501, 0.0016390, -5.000e-06,\n 194.7794952, 14.9992552, 0.000e-00,\n 0.5304160, -0.0000221, -1.280e-05,\n -0.0156430, -0.0000219, -1.270e-05,\n 0.0046034, 0.0045805,\n// 2159 7 15\n2509813.806140, 7.0, -4.0, 4.0, 348.4, 348.4,\n -0.4877280, 0.5622145, -1.800e-05, -9.450e-06,\n -1.0379370, -0.1507365, -8.610e-05, 2.680e-06,\n 21.5113392, -0.0061950, -5.000e-06,\n 283.4326782, 15.0003757, 0.000e-00,\n 0.5309070, 0.0000460, -1.270e-05,\n -0.0151550, 0.0000458, -1.270e-05,\n 0.0045989, 0.0045760,\n// 2159 12 9\n2509961.290656, 19.0, -4.0, 4.0, 349.2, 349.2,\n 0.0168280, 0.5098869, -1.130e-05, -5.870e-06,\n -1.3662950, 0.0016727, 2.094e-04, -1.200e-07,\n -22.8223095, -0.0039710, 6.000e-06,\n 106.9791489, 14.9967299, 0.000e-00,\n 0.5717290, 0.0000681, -1.010e-05,\n 0.0254640, 0.0000678, -1.000e-05,\n 0.0047467, 0.0047230,\n// 2160 6 4\n2510139.207364, 17.0, -4.0, 4.0, 350.3, 350.3,\n 0.0028690, 0.5662925, 1.710e-05, -8.810e-06,\n 0.6646320, 0.0087728, -1.906e-04, -5.000e-08,\n 22.5377197, 0.0045170, -5.000e-06,\n 75.3126526, 14.9995861, 0.000e-00,\n 0.5383110, -0.0001020, -1.210e-05,\n -0.0077880, -0.0001014, -1.200e-05,\n 0.0046097, 0.0045868,\n// 2160 11 27\n2510315.457313, 23.0, -4.0, 4.0, 351.4, 351.4,\n -0.0332350, 0.5371216, -5.600e-06, -7.240e-06,\n -0.6239520, -0.0399899, 1.795e-04, 4.300e-07,\n -21.3236809, -0.0071560, 5.000e-06,\n 168.0727539, 14.9979038, 0.000e-00,\n 0.5573370, 0.0001227, -1.120e-05,\n 0.0111430, 0.0001221, -1.110e-05,\n 0.0047376, 0.0047140,\n// 2161 5 25\n2510493.670636, 4.0, -4.0, 4.0, 352.4, 352.4,\n -0.0424420, 0.5310672, 3.020e-05, -6.920e-06,\n -0.0990250, 0.0457668, -1.279e-04, -5.200e-07,\n 20.9907207, 0.0072770, -5.000e-06,\n 240.7013092, 15.0002451, 0.000e-00,\n 0.5535670, -0.0001152, -1.070e-05,\n 0.0073930, -0.0001146, -1.070e-05,\n 0.0046188, 0.0045958,\n// 2161 11 17\n2510669.930213, 10.0, -4.0, 4.0, 353.5, 353.5,\n -0.1693720, 0.5650780, 1.430e-05, -9.040e-06,\n 0.1264830, -0.0810423, 1.309e-04, 1.210e-06,\n -19.0764294, -0.0098410, 5.000e-06,\n 333.7964478, 14.9994164, 0.000e-00,\n 0.5421740, 0.0000976, -1.250e-05,\n -0.0039440, 0.0000971, -1.250e-05,\n 0.0047263, 0.0047028,\n// 2162 5 14\n2510847.828308, 8.0, -4.0, 4.0, 354.5, 354.5,\n 0.1936090, 0.5021617, 1.690e-05, -5.710e-06,\n -0.8580850, 0.0770070, -7.580e-05, -8.000e-07,\n 18.6726398, 0.0098200, -4.000e-06,\n 300.8628235, 15.0011816, 0.000e-00,\n 0.5659780, -0.0000529, -9.800e-06,\n 0.0197420, -0.0000526, -9.800e-06,\n 0.0046299, 0.0046069,\n// 2162 11 7\n2511024.583103, 2.0, -4.0, 4.0, 355.6, 355.6,\n 0.1585990, 0.5713583, 1.460e-05, -9.730e-06,\n 0.7625330, -0.1163716, 6.740e-05, 1.890e-06,\n -16.2329693, -0.0120000, 4.000e-06,\n 214.1205444, 15.0009584, 0.000e-00,\n 0.5362970, -0.0000074, -1.310e-05,\n -0.0097920, -0.0000074, -1.300e-05,\n 0.0047141, 0.0046906,\n// 2163 4 3\n2511172.195731, 17.0, -4.0, 4.0, 356.5, 356.5,\n -0.2323000, 0.4962227, 7.700e-06, -6.020e-06,\n 1.2761900, 0.1542737, -8.920e-05, -1.790e-06,\n 5.4262099, 0.0155750, -1.000e-06,\n 74.1862030, 15.0041857, 0.000e-00,\n 0.5632030, 0.0000856, -1.030e-05,\n 0.0169800, 0.0000852, -1.030e-05,\n 0.0046803, 0.0046570,\n// 2163 9 28\n2511349.774009, 7.0, -4.0, 4.0, 357.5, 357.5,\n -0.1418650, 0.5241943, 2.780e-05, -7.510e-06,\n -1.2085860, -0.1676797, 6.360e-05, 2.350e-06,\n -1.9888800, -0.0157690, 0.000e-00,\n 287.2918091, 15.0048180, 0.000e-00,\n 0.5478790, -0.0001252, -1.150e-05,\n 0.0017330, -0.0001246, -1.150e-05,\n 0.0046624, 0.0046391,\n// 2163 10 27\n2511379.222827, 17.0, -4.0, 4.0, 357.7, 357.7,\n 0.1792560, 0.5485377, 2.360e-05, -8.550e-06,\n 1.4940990, -0.1404587, -1.500e-06, 2.090e-06,\n -12.8719301, -0.0136750, 3.000e-06,\n 79.0547180, 15.0023489, 0.000e-00,\n 0.5427840, -0.0000876, -1.230e-05,\n -0.0033370, -0.0000872, -1.220e-05,\n 0.0047011, 0.0046777,\n// 2164 3 23\n2511526.501929, 0.0, -4.0, 4.0, 358.6, 358.6,\n -0.1796660, 0.5259620, -4.600e-06, -7.620e-06,\n 0.4775060, 0.1683301, -3.750e-05, -2.350e-06,\n 1.1603000, 0.0160220, 0.000e-00,\n 178.3859711, 15.0043449, 0.000e-00,\n 0.5487730, 0.0001158, -1.170e-05,\n 0.0026230, 0.0001152, -1.160e-05,\n 0.0046944, 0.0046710,\n// 2164 9 16\n2511704.075234, 14.0, -4.0, 4.0, 359.7, 359.7,\n -0.0514650, 0.4941436, 1.080e-05, -5.950e-06,\n -0.4960730, -0.1565497, 3.200e-06, 1.820e-06,\n 2.2546501, -0.0156870, -1.000e-06,\n 31.3169994, 15.0049505, 0.000e-00,\n 0.5621090, -0.0000919, -1.020e-05,\n 0.0158920, -0.0000914, -1.020e-05,\n 0.0046491, 0.0046260,\n// 2165 3 12\n2511881.073495, 14.0, -4.0, 4.0, 360.7, 360.7,\n 0.1945890, 0.5520486, -2.330e-05, -9.200e-06,\n -0.1618560, 0.1746240, 2.540e-05, -2.830e-06,\n -3.0526900, 0.0159940, 0.000e-00,\n 27.6378307, 15.0040989, 0.000e-00,\n 0.5377960, 0.0000461, -1.290e-05,\n -0.0083000, 0.0000459, -1.280e-05,\n 0.0047076, 0.0046841,\n// 2165 9 5\n2512058.119967, 15.0, -4.0, 4.0, 361.8, 361.8,\n 0.1319800, 0.4834861, -1.610e-05, -5.400e-06,\n 0.2264290, -0.1457850, -4.350e-05, 1.570e-06,\n 6.5026898, -0.0151230, -1.000e-06,\n 45.3246002, 15.0047169, 0.000e-00,\n 0.5679660, 0.0000029, -9.700e-06,\n 0.0217200, 0.0000029, -9.700e-06,\n 0.0046362, 0.0046131,\n// 2166 3 2\n2512235.745380, 6.0, -4.0, 4.0, 362.9, 362.9,\n 0.3202620, 0.5553284, -2.470e-05, -9.310e-06,\n -0.8390100, 0.1675369, 9.640e-05, -2.710e-06,\n -7.1653500, 0.0155080, 1.000e-06,\n 267.0192261, 15.0034151, 0.000e-00,\n 0.5379620, -0.0000536, -1.290e-05,\n -0.0081350, -0.0000533, -1.290e-05,\n 0.0047202, 0.0046967,\n// 2166 8 25\n2512412.176100, 16.0, -4.0, 4.0, 364.0, 364.0,\n 0.1489110, 0.5010825, -3.640e-05, -6.070e-06,\n 0.9858410, -0.1376582, -9.520e-05, 1.620e-06,\n 10.5280399, -0.0140830, -2.000e-06,\n 59.4416618, 15.0041647, 0.000e-00,\n 0.5601510, 0.0001008, -1.020e-05,\n 0.0139440, 0.0001003, -1.020e-05,\n 0.0046241, 0.0046011,\n// 2167 1 21\n2512560.747516, 6.0, -4.0, 4.0, 364.9, 364.9,\n -0.1117290, 0.5313127, 6.900e-06, -7.040e-06,\n 1.1844040, 0.0645471, 8.430e-05, -7.900e-07,\n -19.9272099, 0.0090650, 5.000e-06,\n 267.2969971, 14.9984179, 0.000e-00,\n 0.5594390, -0.0001224, -1.110e-05,\n 0.0132350, -0.0001217, -1.110e-05,\n 0.0047526, 0.0047289,\n// 2167 7 16\n2512737.137365, 15.0, -4.0, 4.0, 365.9, 365.9,\n -0.2403500, 0.5659385, -1.350e-05, -8.870e-06,\n -0.9102330, -0.0443194, -9.420e-05, 5.900e-07,\n 21.2830696, -0.0067990, -5.000e-06,\n 43.3934708, 15.0005064, 0.000e-00,\n 0.5370050, 0.0001044, -1.210e-05,\n -0.0090870, 0.0001039, -1.200e-05,\n 0.0045995, 0.0045766,\n// 2168 1 10\n2512914.888231, 9.0, -4.0, 4.0, 367.0, 367.0,\n -0.1845200, 0.5072786, 9.100e-06, -5.780e-06,\n 0.5260710, 0.0222142, 1.258e-04, -1.700e-07,\n -21.9819298, 0.0060610, 6.000e-06,\n 313.2645874, 14.9970980, 0.000e-00,\n 0.5730760, -0.0000540, -1.010e-05,\n 0.0268040, -0.0000537, -1.000e-05,\n 0.0047557, 0.0047320,\n// 2168 7 5\n2513091.823187, 8.0, -4.0, 4.0, 368.1, 368.1,\n 0.1413170, 0.5842050, -9.400e-06, -9.970e-06,\n -0.1668010, -0.0033988, -1.529e-04, -5.000e-08,\n 22.6832905, -0.0041280, -5.000e-06,\n 298.7455750, 14.9997416, 0.000e-00,\n 0.5301740, 0.0000023, -1.280e-05,\n -0.0158840, 0.0000023, -1.270e-05,\n 0.0045985, 0.0045756,\n// 2168 12 29\n2513268.846904, 8.0, -4.0, 4.0, 369.2, 369.2,\n -0.1702870, 0.5052074, 5.200e-06, -5.690e-06,\n -0.1377180, -0.0202053, 1.602e-04, 3.200e-07,\n -23.1671600, 0.0026460, 6.000e-06,\n 299.5360107, 14.9963293, 0.000e-00,\n 0.5742100, 0.0000514, -1.000e-05,\n 0.0279330, 0.0000512, -9.900e-06,\n 0.0047551, 0.0047315,\n// 2169 6 25\n2513446.525804, 1.0, -4.0, 4.0, 370.2, 370.2,\n 0.1777550, 0.5711332, 1.550e-05, -9.170e-06,\n 0.5975750, 0.0387344, -1.982e-04, -7.500e-07,\n 23.3571091, -0.0012760, -5.000e-06,\n 194.2535858, 14.9992542, 0.000e-00,\n 0.5352160, -0.0000956, -1.230e-05,\n -0.0108670, -0.0000952, -1.220e-05,\n 0.0046004, 0.0045775,\n// 2169 12 18\n2513622.942443, 11.0, -4.0, 4.0, 371.3, 371.3,\n 0.0994280, 0.5263223, -6.000e-07, -6.770e-06,\n -0.8399570, -0.0652613, 2.012e-04, 9.400e-07,\n -23.3772697, -0.0008590, 6.000e-06,\n 345.9025879, 14.9963112, 0.000e-00,\n 0.5619910, 0.0001088, -1.090e-05,\n 0.0157740, 0.0001083, -1.080e-05,\n 0.0047510, 0.0047273,\n// 2170 5 16\n2513771.554552, 1.0, -4.0, 4.0, 372.2, 372.2,\n 0.2917620, 0.4939366, 4.140e-05, -6.070e-06,\n -1.3148690, 0.1741566, -5.290e-05, -2.270e-06,\n 19.0897102, 0.0091980, -5.000e-06,\n 195.8584747, 15.0009890, 0.000e-00,\n 0.5582240, -0.0000998, -1.040e-05,\n 0.0120260, -0.0000993, -1.030e-05,\n 0.0046279, 0.0046049,\n// 2170 6 14\n2513801.052205, 13.0, -4.0, 4.0, 372.4, 372.4,\n -0.3332520, 0.5356368, 5.440e-05, -7.260e-06,\n 1.3628230, 0.0767569, -2.177e-04, -1.190e-06,\n 23.2642498, 0.0017130, -5.000e-06,\n 14.8366404, 14.9991474, 0.000e-00,\n 0.5492680, -0.0001147, -1.100e-05,\n 0.0031150, -0.0001141, -1.090e-05,\n 0.0046050, 0.0045821,\n// 2170 11 8\n2513947.891052, 9.0, -4.0, 4.0, 373.3, 373.3,\n 0.2633150, 0.5343948, 1.820e-05, -8.740e-06,\n 1.2345270, -0.2179620, 4.160e-05, 3.770e-06,\n -16.6293297, -0.0114960, 4.000e-06,\n 319.1006470, 15.0006723, 0.000e-00,\n 0.5387880, 0.0000760, -1.280e-05,\n -0.0073130, 0.0000756, -1.270e-05,\n 0.0047157, 0.0046922,\n// 2170 12 7\n2513977.345227, 20.0, -4.0, 4.0, 373.5, 373.5,\n -0.4493950, 0.5530057, 4.070e-05, -8.530e-06,\n -1.3911220, -0.1134027, 2.392e-04, 1.870e-06,\n -22.6562099, -0.0041960, 6.000e-06,\n 122.1625824, 14.9969788, 0.000e-00,\n 0.5459570, 0.0001112, -1.230e-05,\n -0.0001790, 0.0001106, -1.220e-05,\n 0.0047442, 0.0047206,\n// 2171 5 5\n2514125.641150, 3.0, -4.0, 4.0, 374.4, 374.4,\n 0.0609440, 0.4654807, 3.700e-05, -5.150e-06,\n -0.6481580, 0.1964772, -6.240e-05, -2.320e-06,\n 16.1964092, 0.0114500, -4.000e-06,\n 225.7769165, 15.0019999, 0.000e-00,\n 0.5679910, -0.0000153, -9.700e-06,\n 0.0217450, -0.0000152, -9.700e-06,\n 0.0046404, 0.0046173,\n// 2171 10 29\n2514302.563231, 2.0, -4.0, 4.0, 375.5, 375.5,\n 0.4902680, 0.5264794, 1.750e-05, -8.780e-06,\n 0.3863690, -0.2461785, 5.820e-05, 4.310e-06,\n -13.3496504, -0.0132170, 3.000e-06,\n 214.0869446, 15.0021086, 0.000e-00,\n 0.5365520, -0.0000487, -1.300e-05,\n -0.0095390, -0.0000485, -1.290e-05,\n 0.0047028, 0.0046794,\n// 2172 4 23\n2514479.661983, 4.0, -4.0, 4.0, 376.6, 376.6,\n -0.0011220, 0.4639487, 2.240e-05, -5.390e-06,\n 0.1362690, 0.2219917, -7.720e-05, -2.740e-06,\n 12.7281504, 0.0132580, -3.000e-06,\n 240.4140472, 15.0029888, 0.000e-00,\n 0.5643580, 0.0000733, -1.010e-05,\n 0.0181290, 0.0000729, -1.000e-05,\n 0.0046538, 0.0046306,\n// 2172 10 17\n2514657.167782, 16.0, -4.0, 4.0, 377.7, 377.7,\n -0.0809300, 0.4964270, 4.730e-05, -7.300e-06,\n -0.1252830, -0.2542250, 5.530e-05, 3.940e-06,\n -9.6404400, -0.0144850, 2.000e-06,\n 63.7100182, 15.0032930, 0.000e-00,\n 0.5460820, -0.0001091, -1.190e-05,\n -0.0000560, -0.0001085, -1.180e-05,\n 0.0046892, 0.0046659,\n// 2173 4 12\n2514833.909487, 10.0, -4.0, 4.0, 378.8, 378.8,\n -0.3086580, 0.4835788, 2.450e-05, -6.630e-06,\n 0.7991630, 0.2507076, -9.310e-05, -3.600e-06,\n 8.8975096, 0.0145580, -2.000e-06,\n 329.8207092, 15.0037813, 0.000e-00,\n 0.5508190, 0.0001132, -1.130e-05,\n 0.0046580, 0.0001126, -1.120e-05,\n 0.0046675, 0.0046443,\n// 2173 10 7\n2515011.527241, 1.0, -4.0, 4.0, 379.9, 379.9,\n -0.2770760, 0.4613749, 4.270e-05, -5.650e-06,\n -0.8945010, -0.2493031, 6.150e-05, 3.250e-06,\n -5.5858698, -0.0152900, 1.000e-06,\n 198.0354004, 15.0041628, 0.000e-00,\n 0.5606000, -0.0001087, -1.050e-05,\n 0.0143900, -0.0001082, -1.050e-05,\n 0.0046752, 0.0046519,\n// 2174 3 3\n2515159.049935, 13.0, -4.0, 4.0, 380.8, 380.8,\n 0.4222760, 0.5142138, -4.930e-05, -8.610e-06,\n -1.0396791, 0.2735540, 9.730e-05, -4.800e-06,\n -6.6445498, 0.0153460, 1.000e-06,\n 12.0840902, 15.0034218, 0.000e-00,\n 0.5368620, 0.0000296, -1.300e-05,\n -0.0092290, 0.0000294, -1.300e-05,\n 0.0047188, 0.0046953,\n// 2174 4 1\n2515188.443856, 23.0, -4.0, 4.0, 381.0, 381.0,\n -0.5422830, 0.5058458, 3.650e-05, -8.150e-06,\n 1.4240381, 0.2731889, -1.102e-04, -4.570e-06,\n 4.8822498, 0.0153810, -1.000e-06,\n 164.0862122, 15.0042400, 0.000e-00,\n 0.5381840, 0.0000631, -1.260e-05,\n -0.0079150, 0.0000628, -1.250e-05,\n 0.0046814, 0.0046581,\n// 2174 8 27\n2515335.930498, 10.0, -4.0, 4.0, 381.9, 381.9,\n 0.4088960, 0.4516625, -4.720e-05, -5.010e-06,\n 1.1759180, -0.2294283, -9.430e-05, 2.710e-06,\n 9.8960600, -0.0140680, -2.000e-06,\n 329.5724487, 15.0041704, 0.000e-00,\n 0.5665970, 0.0000403, -9.700e-06,\n 0.0203580, 0.0000401, -9.700e-06,\n 0.0046259, 0.0046029,\n// 2175 2 21\n2515513.711394, 5.0, -4.0, 4.0, 383.0, 383.0,\n 0.1640440, 0.5135653, -3.070e-05, -8.270e-06,\n -0.4206360, 0.2579464, 9.110e-05, -4.360e-06,\n -10.6015596, 0.0144360, 2.000e-06,\n 251.6593170, 15.0024195, 0.000e-00,\n 0.5407810, -0.0000746, -1.270e-05,\n -0.0053300, -0.0000742, -1.270e-05,\n 0.0047305, 0.0047069,\n// 2175 8 16\n2515690.047423, 13.0, -4.0, 4.0, 384.1, 384.1,\n 0.1232550, 0.4788233, -5.560e-05, -5.990e-06,\n 0.4385660, -0.2223303, -8.800e-05, 2.960e-06,\n 13.6161098, -0.0126520, -3.000e-06,\n 13.8626604, 15.0033731, 0.000e-00,\n 0.5557910, 0.0001138, -1.050e-05,\n 0.0096050, 0.0001132, -1.050e-05,\n 0.0046156, 0.0045927,\n// 2176 2 10\n2515868.223165, 17.0, -4.0, 4.0, 385.2, 385.2,\n -0.2810480, 0.4952634, -8.900e-06, -6.780e-06,\n 0.1504740, 0.2249554, 8.370e-05, -3.270e-06,\n -14.3046198, 0.0130090, 3.000e-06,\n 71.5296707, 15.0010710, 0.000e-00,\n 0.5549640, -0.0001156, -1.140e-05,\n 0.0087820, -0.0001150, -1.140e-05,\n 0.0047407, 0.0047170,\n// 2176 8 4\n2516044.462446, 23.0, -4.0, 4.0, 386.3, 386.3,\n -0.1772450, 0.5195251, -4.790e-05, -7.790e-06,\n -0.2876040, -0.2120882, -8.190e-05, 3.350e-06,\n 16.8139095, -0.0108500, -4.000e-06,\n 163.4266968, 15.0024233, 0.000e-00,\n 0.5403390, 0.0001120, -1.180e-05,\n -0.0057700, 0.0001115, -1.180e-05,\n 0.0046075, 0.0045845,\n// 2177 1 29\n2516222.437852, 23.0, -4.0, 4.0, 387.4, 387.4,\n -0.1251710, 0.4775013, -2.220e-05, -5.520e-06,\n 1.0135781, 0.1864728, 6.670e-05, -2.330e-06,\n -17.6183491, 0.0109860, 4.000e-06,\n 161.7819672, 14.9995270, 0.000e-00,\n 0.5701670, -0.0000922, -1.020e-05,\n 0.0239090, -0.0000917, -1.020e-05,\n 0.0047487, 0.0047251,\n// 2177 6 26\n2516369.842680, 8.0, -4.0, 4.0, 388.3, 388.3,\n 0.0624270, 0.5789461, -2.400e-05, -9.850e-06,\n 1.4417020, -0.0780544, -2.499e-04, 1.450e-06,\n 23.3093204, -0.0013900, -5.000e-06,\n 299.1691284, 14.9993095, 0.000e-00,\n 0.5303610, -0.0000148, -1.280e-05,\n -0.0156980, -0.0000147, -1.270e-05,\n 0.0045999, 0.0045770,\n// 2177 7 25\n2516399.118440, 15.0, -4.0, 4.0, 388.5, 388.5,\n -0.2548600, 0.5513822, -3.260e-05, -9.280e-06,\n -1.0293190, -0.1884797, -6.710e-05, 3.340e-06,\n 19.4267597, -0.0087320, -4.000e-06,\n 43.2734795, 15.0014038, 0.000e-00,\n 0.5308410, 0.0000275, -1.280e-05,\n -0.0152200, 0.0000274, -1.270e-05,\n 0.0046019, 0.0045790,\n// 2177 12 20\n2516546.626097, 3.0, -4.0, 4.0, 389.4, 389.4,\n 0.1051440, 0.5089182, -2.890e-05, -5.890e-06,\n -1.3707830, 0.0440365, 2.142e-04, -6.300e-07,\n -23.4055099, -0.0005630, 6.000e-06,\n 225.6956024, 14.9962311, 0.000e-00,\n 0.5715640, 0.0000729, -1.010e-05,\n 0.0252990, 0.0000726, -1.010e-05,\n 0.0047520, 0.0047284,\n// 2178 6 16\n2516724.514378, 0.0, -4.0, 4.0, 390.5, 390.5,\n -0.1488740, 0.5635676, 1.170e-05, -8.670e-06,\n 0.7484510, -0.0347590, -2.018e-04, 6.300e-07,\n 23.3257294, 0.0015380, -5.000e-06,\n 179.7437592, 14.9991894, 0.000e-00,\n 0.5387980, -0.0000960, -1.200e-05,\n -0.0073030, -0.0000955, -1.190e-05,\n 0.0046040, 0.0045811,\n// 2178 12 9\n2516900.805584, 7.0, -4.0, 4.0, 391.6, 391.6,\n -0.1779920, 0.5403148, -1.180e-05, -7.360e-06,\n -0.6344730, 0.0019891, 1.936e-04, -1.400e-07,\n -22.8104191, -0.0040060, 6.000e-06,\n 287.0025635, 14.9968271, 0.000e-00,\n 0.5569280, 0.0001308, -1.130e-05,\n 0.0107360, 0.0001302, -1.120e-05,\n 0.0047456, 0.0047219,\n// 2179 6 5\n2517078.962228, 11.0, -4.0, 4.0, 392.7, 392.7,\n -0.0493670, 0.5311599, 2.050e-05, -6.850e-06,\n -0.0215330, 0.0070452, -1.450e-04, 0.000e-00,\n 22.5539093, 0.0044770, -5.000e-06,\n 345.2937927, 14.9994793, 0.000e-00,\n 0.5539900, -0.0001126, -1.060e-05,\n 0.0078130, -0.0001121, -1.060e-05,\n 0.0046107, 0.0045878,\n// 2179 11 28\n2517255.287707, 19.0, -4.0, 4.0, 393.9, 393.9,\n 0.0604770, 0.5705517, -4.300e-06, -9.180e-06,\n 0.0826020, -0.0412542, 1.539e-04, 5.600e-07,\n -21.3612900, -0.0070880, 5.000e-06,\n 108.0634613, 14.9979753, 0.000e-00,\n 0.5422140, 0.0000828, -1.260e-05,\n -0.0039040, 0.0000824, -1.260e-05,\n 0.0047367, 0.0047131,\n// 2180 5 24\n2517433.107263, 15.0, -4.0, 4.0, 395.0, 395.0,\n 0.2851150, 0.5055268, 7.500e-06, -5.730e-06,\n -0.7816520, 0.0440770, -9.660e-05, -4.200e-07,\n 20.9648609, 0.0073170, -5.000e-06,\n 45.7030487, 15.0001869, 0.000e-00,\n 0.5656930, -0.0000524, -9.800e-06,\n 0.0194590, -0.0000521, -9.700e-06,\n 0.0046198, 0.0045968,\n// 2180 11 17\n2517609.940295, 11.0, -4.0, 4.0, 396.1, 396.1,\n 0.3568650, 0.5769632, 2.500e-06, -9.820e-06,\n 0.7174020, -0.0819841, 9.550e-05, 1.300e-06,\n -19.1806507, -0.0097320, 5.000e-06,\n 348.7774658, 14.9993935, 0.000e-00,\n 0.5370050, -0.0000244, -1.310e-05,\n -0.0090870, -0.0000243, -1.300e-05,\n 0.0047261, 0.0047026,\n// 2181 4 14\n2517757.502840, 0.0, -4.0, 4.0, 397.0, 397.0,\n -0.4009790, 0.5013562, 1.940e-05, -6.150e-06,\n 1.2704730, 0.1436596, -1.134e-04, -1.680e-06,\n 9.4902697, 0.0146390, -2.000e-06,\n 179.9231567, 15.0037270, 0.000e-00,\n 0.5615220, 0.0000967, -1.040e-05,\n 0.0153070, 0.0000962, -1.030e-05,\n 0.0046660, 0.0046428,\n// 2181 5 13\n2517787.122025, 15.0, -4.0, 4.0, 397.2, 397.2,\n 0.2737450, 0.5036872, -1.500e-06, -5.780e-06,\n -1.5080470, 0.0791166, -5.310e-05, -8.500e-07,\n 18.5970707, 0.0098840, -4.000e-06,\n 45.8641701, 15.0012112, 0.000e-00,\n 0.5649920, 0.0000556, -9.900e-06,\n 0.0187610, 0.0000554, -9.800e-06,\n 0.0046305, 0.0046075,\n// 2181 10 8\n2517935.096949, 14.0, -4.0, 4.0, 398.1, 398.1,\n -0.5347590, 0.5241962, 5.220e-05, -7.410e-06,\n -1.1338609, -0.1606632, 8.540e-05, 2.230e-06,\n -6.1971898, -0.0154130, 1.000e-06,\n 33.1441193, 15.0041990, 0.000e-00,\n 0.5496670, -0.0001089, -1.150e-05,\n 0.0035120, -0.0001084, -1.140e-05,\n 0.0046767, 0.0046534,\n// 2181 11 7\n2517964.568322, 2.0, -4.0, 4.0, 398.3, 398.3,\n 0.4957510, 0.5528982, 1.160e-05, -8.560e-06,\n 1.4006370, -0.1137156, 3.020e-05, 1.660e-06,\n -16.3500900, -0.0119270, 4.000e-06,\n 214.1149597, 15.0008621, 0.000e-00,\n 0.5441400, -0.0001085, -1.220e-05,\n -0.0019880, -0.0001080, -1.220e-05,\n 0.0047145, 0.0046910,\n// 2182 4 3\n2518111.833137, 8.0, -4.0, 4.0, 399.3, 399.3,\n -0.1581480, 0.5295930, 2.500e-06, -7.750e-06,\n 0.5204550, 0.1637076, -6.490e-05, -2.310e-06,\n 5.4336200, 0.0155520, -1.000e-06,\n 299.1943665, 15.0042582, 0.000e-00,\n 0.5471220, 0.0001130, -1.170e-05,\n 0.0009800, 0.0001124, -1.170e-05,\n 0.0046801, 0.0046568,\n// 2182 9 27\n2518289.374134, 21.0, -4.0, 4.0, 400.4, 400.4,\n -0.1548820, 0.4925032, 2.140e-05, -5.870e-06,\n -0.5238260, -0.1562104, 2.770e-05, 1.800e-06,\n -1.9850000, -0.0157930, 0.000e-00,\n 137.2859497, 15.0047474, 0.000e-00,\n 0.5636760, -0.0000841, -1.020e-05,\n 0.0174510, -0.0000837, -1.010e-05,\n 0.0046627, 0.0046395,\n// 2183 3 23\n2518466.421402, 22.0, -4.0, 4.0, 401.5, 401.5,\n -0.0065790, 0.5524853, -3.900e-06, -9.250e-06,\n -0.1960960, 0.1764055, 3.000e-07, -2.870e-06,\n 1.2838300, 0.0159970, 0.000e-00,\n 148.4145355, 15.0044060, 0.000e-00,\n 0.5366890, 0.0000497, -1.290e-05,\n -0.0094020, 0.0000495, -1.280e-05,\n 0.0046938, 0.0046704,\n// 2183 9 16\n2518643.404591, 22.0, -4.0, 4.0, 402.6, 402.6,\n 0.1960450, 0.4813842, -1.250e-05, -5.380e-06,\n 0.1349090, -0.1520650, -1.740e-05, 1.640e-06,\n 2.3564401, -0.0156850, -1.000e-06,\n 151.2935638, 15.0049248, 0.000e-00,\n 0.5687350, 0.0000062, -9.700e-06,\n 0.0224850, 0.0000062, -9.700e-06,\n 0.0046488, 0.0046256,\n// 2184 3 12\n2518821.098978, 14.0, -4.0, 4.0, 403.8, 403.8,\n 0.0586120, 0.5519804, -2.900e-06, -9.210e-06,\n -0.9001920, 0.1758772, 7.180e-05, -2.840e-06,\n -2.8939700, 0.0160000, 0.000e-00,\n 27.6647491, 15.0041142, 0.000e-00,\n 0.5376300, -0.0000464, -1.290e-05,\n -0.0084650, -0.0000461, -1.280e-05,\n 0.0047073, 0.0046838,\n// 2184 9 4\n2518997.465975, 23.0, -4.0, 4.0, 404.9, 404.9,\n 0.1745360, 0.4987153, -3.270e-05, -6.090e-06,\n 0.9068440, -0.1508587, -6.900e-05, 1.790e-06,\n 6.6001401, -0.0150880, -1.000e-06,\n 165.3023529, 15.0047483, 0.000e-00,\n 0.5600800, 0.0001043, -1.030e-05,\n 0.0138730, 0.0001038, -1.030e-05,\n 0.0046353, 0.0046122,\n// 2185 1 31\n2519146.097453, 14.0, -4.0, 4.0, 405.8, 405.8,\n -0.3975950, 0.5245513, 1.390e-05, -6.880e-06,\n 1.1456790, 0.0977825, 6.360e-05, -1.230e-06,\n -17.1458092, 0.0115620, 4.000e-06,\n 26.7162609, 14.9998808, 0.000e-00,\n 0.5599920, -0.0001131, -1.100e-05,\n 0.0137850, -0.0001125, -1.100e-05,\n 0.0047473, 0.0047237,\n// 2185 7 26\n2519322.443246, 23.0, -4.0, 4.0, 407.0, 407.0,\n 0.0605450, 0.5633873, -3.360e-05, -8.900e-06,\n -1.0160370, -0.0819977, -6.960e-05, 1.190e-06,\n 19.1125202, -0.0092900, -4.000e-06,\n 163.2777405, 15.0015783, 0.000e-00,\n 0.5365170, 0.0000851, -1.220e-05,\n -0.0095720, 0.0000846, -1.210e-05,\n 0.0046027, 0.0045798,\n// 2186 1 20\n2519500.224813, 17.0, -4.0, 4.0, 408.1, 408.1,\n -0.2628220, 0.5035009, 2.600e-06, -5.710e-06,\n 0.5153540, 0.0594115, 1.092e-04, -6.000e-07,\n -19.9573898, 0.0090380, 5.000e-06,\n 72.3162918, 14.9983244, 0.000e-00,\n 0.5733440, -0.0000484, -1.000e-05,\n 0.0270710, -0.0000482, -1.000e-05,\n 0.0047534, 0.0047297,\n// 2186 7 16\n2519677.135349, 15.0, -4.0, 4.0, 409.2, 409.2,\n -0.1635330, 0.5824860, -3.600e-06, -9.950e-06,\n -0.2274670, -0.0459145, -1.356e-04, 6.800e-07,\n 21.2110405, -0.0068970, -5.000e-06,\n 43.3726616, 15.0005875, 0.000e-00,\n 0.5301670, 0.0000090, -1.280e-05,\n -0.0158910, 0.0000090, -1.280e-05,\n 0.0045992, 0.0045763,\n// 2187 1 9\n2519854.183117, 16.0, -4.0, 4.0, 410.4, 410.4,\n -0.1940770, 0.5058353, -6.800e-06, -5.720e-06,\n -0.1446520, 0.0207720, 1.502e-04, -1.500e-07,\n -22.0251007, 0.0059680, 6.000e-06,\n 58.3092918, 14.9970617, 0.000e-00,\n 0.5739180, 0.0000570, -1.000e-05,\n 0.0276410, 0.0000567, -9.900e-06,\n 0.0047559, 0.0047322,\n// 2187 7 6\n2520031.832303, 8.0, -4.0, 4.0, 411.5, 411.5,\n 0.0188610, 0.5708380, 1.060e-05, -9.090e-06,\n 0.5107090, -0.0053128, -1.875e-04, -3.000e-08,\n 22.6379108, -0.0042360, -5.000e-06,\n 298.7127380, 14.9997377, 0.000e-00,\n 0.5358130, -0.0000907, -1.220e-05,\n -0.0102730, -0.0000903, -1.220e-05,\n 0.0045986, 0.0045757,\n// 2187 12 29\n2520208.291006, 19.0, -4.0, 4.0, 412.6, 412.6,\n -0.0236220, 0.5315852, -1.030e-05, -6.910e-06,\n -0.8122960, -0.0209806, 1.988e-04, 3.600e-07,\n -23.1729202, 0.0025980, 6.000e-06,\n 104.5679398, 14.9963942, 0.000e-00,\n 0.5613660, 0.0001177, -1.100e-05,\n 0.0151520, 0.0001171, -1.090e-05,\n 0.0047546, 0.0047309,\n// 2188 5 26\n2520356.844360, 8.0, -4.0, 4.0, 413.6, 413.6,\n 0.2462930, 0.5028651, 3.990e-05, -6.140e-06,\n -1.3960620, 0.1404328, -6.860e-05, -1.830e-06,\n 21.2726707, 0.0066380, -5.000e-06,\n 300.6466675, 15.0000353, 0.000e-00,\n 0.5584210, -0.0000968, -1.030e-05,\n 0.0122220, -0.0000964, -1.030e-05,\n 0.0046180, 0.0045950,\n// 2188 6 24\n2520386.343501, 20.0, -4.0, 4.0, 413.8, 413.8,\n -0.2157640, 0.5379561, 3.640e-05, -7.220e-06,\n 1.3141280, 0.0344722, -2.172e-04, -6.000e-07,\n 23.3472805, -0.0013230, -5.000e-06,\n 119.2300720, 14.9991741, 0.000e-00,\n 0.5499830, -0.0001135, -1.090e-05,\n 0.0038260, -0.0001130, -1.090e-05,\n 0.0046010, 0.0045780,\n// 2188 11 18\n2520533.246812, 18.0, -4.0, 4.0, 414.7, 414.7,\n 0.4453690, 0.5474325, 1.140e-05, -9.010e-06,\n 1.1785520, -0.1851798, 6.910e-05, 3.240e-06,\n -19.4975700, -0.0091570, 5.000e-06,\n 93.7124786, 14.9991302, 0.000e-00,\n 0.5390470, 0.0000591, -1.290e-05,\n -0.0070560, 0.0000588, -1.280e-05,\n 0.0047275, 0.0047039,\n// 2188 12 18\n2520562.706241, 5.0, -4.0, 4.0, 414.9, 414.9,\n -0.1431280, 0.5619573, 1.340e-05, -8.750e-06,\n -1.4351840, -0.0672242, 2.506e-04, 1.150e-06,\n -23.3768501, -0.0008090, 6.000e-06,\n 255.8943939, 14.9964066, 0.000e-00,\n 0.5456590, 0.0000995, -1.240e-05,\n -0.0004760, 0.0000990, -1.230e-05,\n 0.0047502, 0.0047265,\n// 2189 5 15\n2520710.922612, 10.0, -4.0, 4.0, 415.9, 415.9,\n 0.1647170, 0.4758093, 3.410e-05, -5.270e-06,\n -0.6767460, 0.1696401, -8.160e-05, -2.020e-06,\n 19.0354595, 0.0092590, -4.000e-06,\n 330.8530884, 15.0009565, 0.000e-00,\n 0.5673860, -0.0000134, -9.700e-06,\n 0.0211420, -0.0000133, -9.700e-06,\n 0.0046290, 0.0046059,\n// 2189 11 8\n2520887.914907, 10.0, -4.0, 4.0, 417.0, 417.0,\n 0.2434310, 0.5371837, 3.690e-05, -8.940e-06,\n 0.5303670, -0.2197328, 7.720e-05, 3.850e-06,\n -16.7509804, -0.0114030, 4.000e-06,\n 334.0992126, 15.0006247, 0.000e-00,\n 0.5375380, -0.0000429, -1.290e-05,\n -0.0085570, -0.0000427, -1.290e-05,\n 0.0047157, 0.0046922,\n// 2190 5 4\n2521064.955904, 11.0, -4.0, 4.0, 418.2, 418.2,\n 0.0039910, 0.4750143, 2.680e-05, -5.570e-06,\n 0.0676830, 0.2012218, -9.610e-05, -2.520e-06,\n 16.1178398, 0.0114900, -4.000e-06,\n 345.7666016, 15.0020380, 0.000e-00,\n 0.5629040, 0.0000791, -1.010e-05,\n 0.0166830, 0.0000787, -1.010e-05,\n 0.0046411, 0.0046180,\n// 2190 10 29\n2521242.504049, 0.0, -4.0, 4.0, 419.3, 419.3,\n -0.0980270, 0.5035744, 5.770e-05, -7.340e-06,\n -0.0823120, -0.2351297, 7.860e-05, 3.620e-06,\n -13.4503698, -0.0131930, 3.000e-06,\n 184.0954895, 15.0020218, 0.000e-00,\n 0.5476730, -0.0001097, -1.180e-05,\n 0.0015270, -0.0001091, -1.180e-05,\n 0.0047030, 0.0046796,\n// 2191 4 23\n2521419.226457, 17.0, -4.0, 4.0, 420.5, 420.5,\n -0.5585810, 0.4936553, 4.380e-05, -6.870e-06,\n 0.6189640, 0.2354245, -1.082e-04, -3.440e-06,\n 12.7069798, 0.0132360, -3.000e-06,\n 75.4079666, 15.0030565, 0.000e-00,\n 0.5490500, 0.0001266, -1.140e-05,\n 0.0028970, 0.0001260, -1.130e-05,\n 0.0046538, 0.0046306,\n// 2191 10 18\n2521596.841109, 8.0, -4.0, 4.0, 421.6, 421.6,\n -0.4863950, 0.4653542, 6.050e-05, -5.640e-06,\n -0.7378170, -0.2377489, 7.820e-05, 3.070e-06,\n -9.6608601, -0.0145140, 2.000e-06,\n 303.7149048, 15.0032187, 0.000e-00,\n 0.5623240, -0.0000947, -1.050e-05,\n 0.0161060, -0.0000942, -1.040e-05,\n 0.0046894, 0.0046661,\n// 2192 3 13\n2521744.402773, 22.0, -4.0, 4.0, 422.6, 422.6,\n 0.7193720, 0.5107207, -5.030e-05, -8.570e-06,\n -0.9048090, 0.2809115, 6.510e-05, -4.930e-06,\n -2.3447599, 0.0157760, 0.000e-00,\n 147.7639618, 15.0040722, 0.000e-00,\n 0.5360190, 0.0000099, -1.300e-05,\n -0.0100680, 0.0000098, -1.300e-05,\n 0.0047057, 0.0046823,\n// 2192 4 12\n2521773.779119, 7.0, -4.0, 4.0, 422.8, 422.8,\n -0.5156980, 0.5127853, 4.740e-05, -8.320e-06,\n 1.3851080, 0.2630429, -1.325e-04, -4.440e-06,\n 8.9947205, 0.0145020, -2.000e-06,\n 284.8376770, 15.0038290, 0.000e-00,\n 0.5368920, 0.0000595, -1.260e-05,\n -0.0091990, 0.0000592, -1.260e-05,\n 0.0046670, 0.0046438,\n// 2192 9 6\n2521921.211902, 17.0, -4.0, 4.0, 423.7, 423.7,\n 0.5792020, 0.4464187, -4.450e-05, -4.960e-06,\n 1.1682390, -0.2401509, -7.320e-05, 2.840e-06,\n 5.9226198, -0.0150050, -1.000e-06,\n 75.4539337, 15.0046892, 0.000e-00,\n 0.5670500, 0.0000420, -9.800e-06,\n 0.0208080, 0.0000418, -9.700e-06,\n 0.0046374, 0.0046143,\n// 2193 3 3\n2522099.066763, 14.0, -4.0, 4.0, 424.9, 424.9,\n 0.4226710, 0.5054527, -3.090e-05, -8.090e-06,\n -0.3052940, 0.2712302, 5.950e-05, -4.550e-06,\n -6.4812698, 0.0153800, 1.000e-06,\n 27.1196308, 15.0034294, 0.000e-00,\n 0.5406130, -0.0000911, -1.260e-05,\n -0.0054970, -0.0000906, -1.260e-05,\n 0.0047187, 0.0046952,\n// 2193 8 26\n2522275.339810, 20.0, -4.0, 4.0, 426.0, 426.0,\n 0.1624140, 0.4720910, -5.000e-05, -5.950e-06,\n 0.5008220, -0.2401320, -6.850e-05, 3.210e-06,\n 9.9573202, -0.0140220, -2.000e-06,\n 119.5483398, 15.0042076, 0.000e-00,\n 0.5554860, 0.0001173, -1.060e-05,\n 0.0093020, 0.0001167, -1.060e-05,\n 0.0046252, 0.0046022,\n// 2194 2 21\n2522453.570502, 2.0, -4.0, 4.0, 427.2, 427.2,\n 0.0413610, 0.4843150, -1.360e-05, -6.570e-06,\n 0.2891180, 0.2440055, 5.290e-05, -3.500e-06,\n -10.5078001, 0.0144990, 2.000e-06,\n 206.6796570, 15.0023727, 0.000e-00,\n 0.5551530, -0.0001311, -1.130e-05,\n 0.0089700, -0.0001305, -1.130e-05,\n 0.0047309, 0.0047073,\n// 2194 8 16\n2522629.769539, 6.0, -4.0, 4.0, 428.4, 428.4,\n -0.3496660, 0.5105500, -3.480e-05, -7.730e-06,\n -0.1259490, -0.2372439, -6.650e-05, 3.770e-06,\n 13.5783997, -0.0126320, -3.000e-06,\n 268.8571472, 15.0034637, 0.000e-00,\n 0.5399040, 0.0001186, -1.190e-05,\n -0.0062030, 0.0001180, -1.190e-05,\n 0.0046149, 0.0045920,\n// 2195 2 10\n2522807.773927, 7.0, -4.0, 4.0, 429.5, 429.5,\n -0.2060340, 0.4660007, -1.550e-05, -5.350e-06,\n 0.9822920, 0.2112432, 4.450e-05, -2.600e-06,\n -14.3132000, 0.0130370, 3.000e-06,\n 281.5379333, 15.0009918, 0.000e-00,\n 0.5702840, -0.0000873, -1.020e-05,\n 0.0240260, -0.0000868, -1.010e-05,\n 0.0047414, 0.0047178,\n// 2195 7 7\n2522955.153713, 16.0, -4.0, 4.0, 430.5, 430.5,\n 0.4934200, 0.5708120, -5.700e-05, -9.680e-06,\n 1.4380670, -0.1223385, -2.402e-04, 2.210e-06,\n 22.4861698, -0.0043410, -5.000e-06,\n 58.6519394, 14.9998293, 0.000e-00,\n 0.5304340, -0.0000343, -1.280e-05,\n -0.0156250, -0.0000341, -1.270e-05,\n 0.0045984, 0.0045755,\n// 2195 8 5\n2522984.431284, 22.0, -4.0, 4.0, 430.7, 430.7,\n -0.5612500, 0.5400328, -1.520e-05, -9.100e-06,\n -0.8341510, -0.2202577, -5.520e-05, 3.890e-06,\n 16.7126694, -0.0108970, -4.000e-06,\n 148.4261475, 15.0025148, 0.000e-00,\n 0.5309000, 0.0000347, -1.280e-05,\n -0.0151610, 0.0000346, -1.270e-05,\n 0.0046071, 0.0045842,\n// 2195 12 31\n2523131.964836, 11.0, -4.0, 4.0, 431.7, 431.7,\n 0.1549680, 0.5044335, -4.470e-05, -5.860e-06,\n -1.3732890, 0.0866259, 2.094e-04, -1.140e-06,\n -23.0534706, 0.0028920, 6.000e-06,\n 344.3586121, 14.9963961, 0.000e-00,\n 0.5712300, 0.0000791, -1.020e-05,\n 0.0249670, 0.0000788, -1.010e-05,\n 0.0047553, 0.0047316,\n// 2196 6 26\n2523309.817821, 8.0, -4.0, 4.0, 432.8, 432.8,\n 0.3216480, 0.5572840, -2.260e-05, -8.500e-06,\n 0.7774940, -0.0790044, -2.018e-04, 1.320e-06,\n 23.2922001, -0.0015030, -5.000e-06,\n 299.1438293, 14.9992647, 0.000e-00,\n 0.5393070, -0.0001156, -1.190e-05,\n -0.0067960, -0.0001150, -1.180e-05,\n 0.0046002, 0.0045773,\n// 2196 12 19\n2523486.157746, 16.0, -4.0, 4.0, 434.0, 434.0,\n 0.1712420, 0.5399417, -4.060e-05, -7.400e-06,\n -0.6261880, 0.0472976, 1.975e-04, -7.900e-07,\n -23.4037991, -0.0005920, 6.000e-06,\n 60.7074585, 14.9963160, 0.000e-00,\n 0.5565090, 0.0001181, -1.140e-05,\n 0.0103200, 0.0001175, -1.130e-05,\n 0.0047514, 0.0047277,\n// 2197 6 15\n2523664.249688, 18.0, -4.0, 4.0, 435.2, 435.2,\n 0.0076390, 0.5282852, 6.100e-06, -6.740e-06,\n 0.0569880, -0.0339687, -1.552e-04, 5.300e-07,\n 23.3298702, 0.0014910, -6.000e-06,\n 89.7301331, 14.9990950, 0.000e-00,\n 0.5545200, -0.0001118, -1.060e-05,\n 0.0083400, -0.0001113, -1.050e-05,\n 0.0046047, 0.0045818,\n// 2197 12 9\n2523840.649391, 4.0, -4.0, 4.0, 436.3, 436.3,\n 0.2371600, 0.5731588, -2.470e-05, -9.270e-06,\n 0.0783960, 0.0037637, 1.682e-04, -1.800e-07,\n -22.8347206, -0.0039270, 6.000e-06,\n 241.9828033, 14.9968987, 0.000e-00,\n 0.5421590, 0.0000703, -1.270e-05,\n -0.0039590, 0.0000699, -1.260e-05,\n 0.0047449, 0.0047213,\n// 2198 6 4\n2524018.383048, 21.0, -4.0, 4.0, 437.5, 437.5,\n -0.0874320, 0.5068745, 1.040e-05, -5.720e-06,\n -0.7273010, 0.0073528, -1.118e-04, 0.000e-00,\n 22.5344601, 0.0045230, -5.000e-06,\n 135.2878265, 14.9994240, 0.000e-00,\n 0.5655180, -0.0000337, -9.700e-06,\n 0.0192840, -0.0000335, -9.700e-06,\n 0.0046115, 0.0045885,\n// 2198 11 28\n2524195.300537, 19.0, -4.0, 4.0, 438.7, 438.7,\n -0.0708540, 0.5809076, 1.730e-05, -9.860e-06,\n 0.7528010, -0.0412864, 1.158e-04, 6.000e-07,\n -21.4269600, -0.0069780, 6.000e-06,\n 108.0399323, 14.9979620, 0.000e-00,\n 0.5376850, -0.0000134, -1.310e-05,\n -0.0084110, -0.0000133, -1.300e-05,\n 0.0047365, 0.0047129,\n// 2199 4 25\n2524342.806838, 7.0, -4.0, 4.0, 439.6, 439.6,\n -0.5184220, 0.5079308, 2.700e-05, -6.300e-06,\n 1.2929510, 0.1265996, -1.384e-04, -1.480e-06,\n 13.2471905, 0.0132480, -3.000e-06,\n 285.4703979, 15.0029535, 0.000e-00,\n 0.5598540, 0.0001062, -1.040e-05,\n 0.0136480, 0.0001057, -1.040e-05,\n 0.0046523, 0.0046291,\n// 2199 5 24\n2524372.404253, 22.0, -4.0, 4.0, 439.8, 439.8,\n 0.2840340, 0.5089590, -8.000e-06, -5.880e-06,\n -1.4398150, 0.0463142, -7.290e-05, -4.700e-07,\n 20.9113102, 0.0073850, -5.000e-06,\n 150.6958771, 15.0002174, 0.000e-00,\n 0.5638390, 0.0000569, -9.900e-06,\n 0.0176130, 0.0000566, -9.900e-06,\n 0.0046201, 0.0045971,\n// 2199 10 19\n2524520.423915, 22.0, -4.0, 4.0, 440.8, 440.8,\n -0.4356760, 0.5261498, 5.410e-05, -7.360e-06,\n -1.2091590, -0.1466985, 1.141e-04, 2.010e-06,\n -10.2520304, -0.0145630, 2.000e-06,\n 153.7921143, 15.0031948, 0.000e-00,\n 0.5513480, -0.0001132, -1.140e-05,\n 0.0051840, -0.0001127, -1.130e-05,\n 0.0046909, 0.0046676,\n// 2199 11 18\n2524549.917374, 10.0, -4.0, 4.0, 441.0, 441.0,\n 0.1979080, 0.5569354, 2.370e-05, -8.540e-06,\n 1.4428760, -0.0801149, 5.450e-05, 1.120e-06,\n -19.2623692, -0.0096520, 5.000e-06,\n 333.7696533, 14.9992981, 0.000e-00,\n 0.5455560, -0.0001026, -1.220e-05,\n -0.0005780, -0.0001021, -1.210e-05,\n 0.0047265, 0.0047030,\n// 2200 4 14\n2524697.159685, 16.0, -4.0, 4.0, 442.0, 442.0,\n -0.0702280, 0.5351972, 5.300e-06, -7.910e-06,\n 0.5879000, 0.1521348, -9.320e-05, -2.160e-06,\n 9.5162802, 0.0146130, -2.000e-06,\n 59.9221992, 15.0037956, 0.000e-00,\n 0.5454880, 0.0001073, -1.180e-05,\n -0.0006460, 0.0001067, -1.170e-05,\n 0.0046658, 0.0046425,\n// 2200 10 9\n2524874.678025, 4.0, -4.0, 4.0, 443.2, 443.2,\n -0.3077970, 0.4928812, 3.330e-05, -5.830e-06,\n -0.5306260, -0.1496295, 5.200e-05, 1.710e-06,\n -6.1894498, -0.0154370, 1.000e-06,\n 243.1468201, 15.0041313, 0.000e-00,\n 0.5652510, -0.0000740, -1.020e-05,\n 0.0190180, -0.0000736, -1.010e-05,\n 0.0046769, 0.0046536\n));\n}", "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "function phi2([n00, n01, n10, n11]) {\n return (n11 * n00 - n10 * n01)/Math.sqrt((n10 + n11) * (n00 + n11) * (n01 + n11) * (n00 + n10));\n}", "function c(e,n,r,i){function o(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function a(e){return 3*e}function l(e,t,n){return((o(t,n)*e+s(t,n))*e+a(t))*e}function u(e,t,n){return 3*o(t,n)*e*e+2*s(t,n)*e+a(t)}function c(t,n){for(var i=0;i<m;++i){var o=u(n,e,r);if(0===o)return n;n-=(l(n,e,r)-t)/o}return n}function f(){for(var t=0;t<b;++t)C[t]=l(t*x,e,r)}function p(t,n,i){var o,s,a=0;do{s=n+(i-n)/2,o=l(s,e,r)-t,o>0?i=s:n=s}while(Math.abs(o)>v&&++a<y);return s}function d(t){for(var n=0,i=1,o=b-1;i!==o&&C[i]<=t;++i)n+=x;--i;var s=(t-C[i])/(C[i+1]-C[i]),a=n+s*x,l=u(a,e,r);return l>=g?c(t,a):0===l?a:p(t,n,n+x)}function h(){T=!0,e===n&&r===i||f()}var m=4,g=.001,v=1e-7,y=10,b=11,x=1/(b-1),w=\"Float32Array\"in t;if(4!==arguments.length)return!1;for(var S=0;S<4;++S)if(\"number\"!=typeof arguments[S]||isNaN(arguments[S])||!isFinite(arguments[S]))return!1;e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0);var C=w?new Float32Array(b):new Array(b),T=!1,E=function(t){return T||h(),e===n&&r===i?t:0===t?0:1===t?1:l(d(t),n,i)};E.getControlPoints=function(){return[{x:e,y:n},{x:r,y:i}]};var k=\"generateBezier(\"+[e,n,r,i]+\")\";return E.toString=function(){return k},E}", "function Co(t,e,n,r){var i=4,a=.001,o=1e-7,s=10,l=11,u=1/(l-1),c=\"undefined\"!==typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if(\"number\"!==typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var h=c?new Float32Array(l):new Array(l);function f(t,e){return 1-3*e+3*t}function p(t,e){return 3*e-6*t}function v(t){return 3*t}function g(t,e,n){return((f(e,n)*t+p(e,n))*t+v(e))*t}function m(t,e,n){return 3*f(e,n)*t*t+2*p(e,n)*t+v(e)}function y(e,r){for(var a=0;a<i;++a){var o=m(r,t,n);if(0===o)return r;var s=g(r,t,n)-e;r-=s/o}return r}function b(){for(var e=0;e<l;++e)h[e]=g(e*u,t,n)}function x(e,r,i){var a,l,u=0;do{l=r+(i-r)/2,a=g(l,t,n)-e,a>0?i=l:r=l}while(Math.abs(a)>o&&++u<s);return l}function _(e){for(var r=0,i=1,o=l-1;i!==o&&h[i]<=e;++i)r+=u;--i;var s=(e-h[i])/(h[i+1]-h[i]),c=r+s*u,d=m(c,t,n);return d>=a?y(e,c):0===d?c:x(e,r,r+u)}var w=!1;function M(){w=!0,t===e&&n===r||b()}var S=function(i){return w||M(),t===e&&n===r?i:0===i?0:1===i?1:g(_(i),e,r)};S.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var O=\"generateBezier(\"+[t,e,n,r]+\")\";return S.toString=function(){return O},S}", "function S(s) {\n if(s<0) {\n return {y: 0, z: 0};\n } else {\n //var y = 0.02*s;\n //var y = 0.016*s*(s+0.1);\n //var y = 0.02*s*s;\n //var y = 0.019*s*(s+0.1);\n var y = 0.0012*s*s*(s+9.7);\n \n return {y: y, z: 5*y};\n }\n }", "function f11(points) {\n\tvar sum = 0.0;\n\tfor (var i = 1; i < points.length - 1; i++)\n\t\tsum += Math.pow(getAngle(points[i - 1], points[i], points[i + 1]), 2);\n\treturn sum;\n}", "Ec(){\n return 1.35*Math.pow(145,1.5)*Math.pow(this.Fc,0.5)\n }", "get Alpha0() {}" ]
[ "0.5923579", "0.5816902", "0.57825613", "0.57713246", "0.57466793", "0.57118165", "0.5699939", "0.56855327", "0.56742805", "0.56238", "0.56213313", "0.5586164", "0.5578137", "0.5578004", "0.55747837", "0.5571238", "0.5540127", "0.5514773", "0.5511776", "0.5507228", "0.5498045", "0.5496565", "0.5488464", "0.5470854", "0.5468646", "0.54634655", "0.5457715", "0.5436506", "0.54140645", "0.5413497", "0.5405329", "0.5401535", "0.53906494", "0.53855693", "0.5381695", "0.5370656", "0.537061", "0.53680056", "0.5362131", "0.5357678", "0.535276", "0.53518623", "0.53507864", "0.53497493", "0.5345629", "0.53449655", "0.5341967", "0.5341703", "0.5331277", "0.53312755", "0.5322948", "0.53202164", "0.53132707", "0.5310148", "0.5309892", "0.5307468", "0.5300682", "0.53001344", "0.52984446", "0.5298302", "0.5292056", "0.5288646", "0.5285919", "0.52823377", "0.5281196", "0.52807504", "0.52794534", "0.52781737", "0.52719015", "0.5270615", "0.5268601", "0.52680886", "0.5265471", "0.52636576", "0.52617854", "0.5261196", "0.5260152", "0.5254354", "0.52536696", "0.5253343", "0.5251703", "0.5251629", "0.525149", "0.525027", "0.52438676", "0.5243125", "0.5241523", "0.5239315", "0.52362376", "0.5233254", "0.5232842", "0.52322114", "0.52321714", "0.52186054", "0.5217869", "0.5217433", "0.5213351", "0.5207878", "0.52035034", "0.51999485", "0.5199929" ]
0.0
-1
Attempts to locate an alignment pattern in a limited region of the image, which is guessed to contain it. overallEstModuleSize estimated module size so far estAlignmentX coordinate of center of area probably containing alignment pattern estAlignmentY y coordinate of above allowanceFactor number of pixels in all directions to search from the center
function findAlignmentInRegion(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor, image) { estAlignmentX = Math.floor(estAlignmentX); estAlignmentY = Math.floor(estAlignmentY); // Look for an alignment pattern (3 modules in size) around where it should be var allowance = Math.floor(allowanceFactor * overallEstModuleSize); var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance); var alignmentAreaRightX = Math.min(image.width, estAlignmentX + allowance); if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) { return null; } var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance); var alignmentAreaBottomY = Math.min(image.height - 1, estAlignmentY + allowance); return alignment_finder_1.findAlignment(alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, image); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AlignmentPattern(posX, posY, estimatedModuleSize)\r\n{\r\n\tthis.x=posX;\r\n\tthis.y=posY;\r\n\tthis.count = 1;\r\n\tthis.estimatedModuleSize = estimatedModuleSize;\r\n\t\r\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\r\n\t{\r\n\t\treturn this.estimatedModuleSize;\r\n\t}); \r\n\tthis.__defineGetter__(\"Count\", function()\r\n\t{\r\n\t\treturn this.count;\r\n\t});\r\n\tthis.__defineGetter__(\"X\", function()\r\n\t{\r\n\t\treturn Math.floor(this.x);\r\n\t});\r\n\tthis.__defineGetter__(\"Y\", function()\r\n\t{\r\n\t\treturn Math.floor(this.y);\r\n\t});\r\n\tthis.incrementCount = function()\r\n\t{\r\n\t\tthis.count++;\r\n\t}\r\n\tthis.aboutEquals=function( moduleSize, i, j)\r\n\t\t{\r\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\r\n\t\t\t{\r\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\r\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n}", "function AlignmentPattern(posX, posY, estimatedModuleSize)\n{\n\tthis.x=posX;\n\tthis.y=posY;\n\tthis.count = 1;\n\tthis.estimatedModuleSize = estimatedModuleSize;\n\t\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\n\t{\n\t\treturn this.estimatedModuleSize;\n\t}); \n\tthis.__defineGetter__(\"Count\", function()\n\t{\n\t\treturn this.count;\n\t});\n\tthis.__defineGetter__(\"X\", function()\n\t{\n\t\treturn Math.floor(this.x);\n\t});\n\tthis.__defineGetter__(\"Y\", function()\n\t{\n\t\treturn Math.floor(this.y);\n\t});\n\tthis.incrementCount = function()\n\t{\n\t\tthis.count++;\n\t}\n\tthis.aboutEquals=function( moduleSize, i, j)\n\t\t{\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\n\t\t\t{\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\n}", "function AlignmentPattern(posX, posY, estimatedModuleSize) {\n this.x = posX;\n this.y = posY;\n this.count = 1;\n this.estimatedModuleSize = estimatedModuleSize;\n }", "function AlignmentPatternFinder(image, startX\n /*int*/\n , startY\n /*int*/\n , width\n /*int*/\n , height\n /*int*/\n , moduleSize\n /*float*/\n , resultPointCallback) {\n _classCallCheck(this, AlignmentPatternFinder);\n\n this.image = image;\n this.startX = startX;\n this.startY = startY;\n this.width = width;\n this.height = height;\n this.moduleSize = moduleSize;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = []; // new Array<any>(5))\n // TYPESCRIPTPORT: array initialization without size as the length is checked below\n\n this.crossCheckStateCount = new Int32Array(3);\n }", "drawAlignmentPattern(x, y) {\n let i;\n let j;\n for (i = x - 2, j = y - 2; i < x + 3; i++, j++) {\n this.mModuleValue[i][y - 2].isBlack = true;\n this.mModuleValue[i][y - 2].isFilled = true;\n this.mModuleValue[i][y + 2].isBlack = true;\n this.mModuleValue[i][y + 2].isFilled = true;\n this.mModuleValue[x - 2][j].isBlack = true;\n this.mModuleValue[x - 2][j].isFilled = true;\n this.mModuleValue[x + 2][j].isBlack = true;\n this.mModuleValue[x + 2][j].isFilled = true;\n }\n for (i = x - 1, j = y - 1; i < x + 2; i++, j++) {\n this.mModuleValue[i][y - 1].isBlack = false;\n this.mModuleValue[i][y - 1].isFilled = true;\n this.mModuleValue[i][y + 1].isBlack = false;\n this.mModuleValue[i][y + 1].isFilled = true;\n this.mModuleValue[x - 1][j].isBlack = false;\n this.mModuleValue[x - 1][j].isFilled = true;\n this.mModuleValue[x + 1][j].isBlack = false;\n this.mModuleValue[x + 1][j].isFilled = true;\n }\n this.mModuleValue[x][y].isBlack = true;\n this.mModuleValue[x][y].isFilled = true;\n }", "function handlePossibleCenter(stateCount, i, j, moduleSize) {\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t var centerJ = centerFromEnd(stateCount, j);\r\n\t\t if (centerJ == null) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var centerI = crossCheckVertical(i, Math.floor(centerJ), 2 * stateCount[1], stateCountTotal, moduleSize, image);\r\n\t\t if (centerI != null) {\r\n\t\t var estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3;\r\n\t\t for (var i2 in possibleCenters) {\r\n\t\t var center = possibleCenters[i2];\r\n\t\t // Look for about the same center and module size:\r\n\t\t if (aboutEquals(center, estimatedModuleSize, centerI, centerJ)) {\r\n\t\t return combineEstimate(center, centerI, centerJ, estimatedModuleSize);\r\n\t\t }\r\n\t\t }\r\n\t\t // Hadn't found this before; save it\r\n\t\t var point = { x: centerJ, y: centerI, estimatedModuleSize: estimatedModuleSize };\r\n\t\t possibleCenters.push(point);\r\n\t\t }\r\n\t\t return null;\r\n\t\t }", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "getAlignmentPatternCoOrdinates() {\n let allign = null;\n switch ((this.mVersion)) {\n case 2:\n allign = [6, 18];\n break;\n case 3:\n allign = [6, 22];\n break;\n case 4:\n allign = [6, 26];\n break;\n case 5:\n allign = [6, 30];\n break;\n case 6:\n allign = [6, 34];\n break;\n case 7:\n allign = [6, 22, 38];\n break;\n case 8:\n allign = [6, 24, 42];\n break;\n case 9:\n allign = [6, 26, 46];\n break;\n case 10:\n allign = [6, 28, 50];\n break;\n case 11:\n allign = [6, 30, 54];\n break;\n case 12:\n allign = [6, 32, 58];\n break;\n case 13:\n allign = [6, 34, 62];\n break;\n case 14:\n allign = [6, 26, 46, 66];\n break;\n case 15:\n allign = [6, 26, 48, 70];\n break;\n case 16:\n allign = [6, 26, 50, 74];\n break;\n case 17:\n allign = [6, 30, 54, 78];\n break;\n case 18:\n allign = [6, 30, 56, 82];\n break;\n case 19:\n allign = [6, 30, 58, 86];\n break;\n case 20:\n allign = [6, 34, 62, 90];\n break;\n case 21:\n allign = [6, 28, 50, 72, 94];\n break;\n case 22:\n allign = [6, 26, 50, 74, 98];\n break;\n case 23:\n allign = [6, 30, 54, 78, 102];\n break;\n case 24:\n allign = [6, 28, 54, 80, 106];\n break;\n case 25:\n allign = [6, 32, 58, 84, 110];\n break;\n case 26:\n allign = [6, 30, 58, 86, 114];\n break;\n case 27:\n allign = [6, 34, 62, 90, 118];\n break;\n case 28:\n allign = [6, 26, 50, 74, 98, 122];\n break;\n case 29:\n allign = [6, 30, 54, 78, 102, 126];\n break;\n case 30:\n allign = [6, 26, 52, 78, 104, 130];\n break;\n case 31:\n allign = [6, 30, 56, 82, 108, 134];\n break;\n case 32:\n allign = [6, 34, 60, 86, 112, 138];\n break;\n case 33:\n allign = [6, 30, 58, 86, 114, 142];\n break;\n case 34:\n allign = [6, 34, 62, 90, 118, 146];\n break;\n case 35:\n allign = [6, 30, 54, 78, 102, 126, 150];\n break;\n case 36:\n allign = [6, 24, 50, 76, 102, 128, 154];\n break;\n case 37:\n allign = [6, 28, 54, 80, 106, 132, 158];\n break;\n case 38:\n allign = [6, 32, 58, 84, 110, 136, 162];\n break;\n case 39:\n allign = [6, 26, 54, 82, 110, 138, 166];\n break;\n case 40:\n allign = [6, 30, 58, 86, 114, 142, 170];\n break;\n }\n return allign;\n }", "function matchPattern(pattern,genome) {\n //console.log(pattern);\n //console.log(genome);\n //console.log(\"genome length : \" + genome.length);\n var positions = [];\n for(var i=0;i<=genome.length-pattern.length;i++) {\n var str = computeText(genome,i,pattern.length);\n // console.log(str);\n if(str==pattern) {\n positions.push(i);\n }\n }\n return positions;\n /*\n var output = \"\";\n for(var i=0;i<positions.length;i++) {\n output = output + positions[i] + \" \";\n }\n return output;\n */\n}", "function calculateModuleSize(topLeft, topRight, bottomLeft, image) {\r\n\t\t return (calculateModuleSizeOneWay(topLeft, topRight, image) + calculateModuleSizeOneWay(topLeft, bottomLeft, image)) / 2;\r\n\t\t}", "function crossCheckVertical(startI, centerJ, maxCount, originalStateCountTotal, moduleSize, image) {\r\n\t\t var maxI = image.height;\r\n\t\t var stateCount = [0, 0, 0];\r\n\t\t // Start counting up from center\r\n\t\t var i = startI;\r\n\t\t while (i >= 0 && image.get(centerJ, i) && stateCount[1] <= maxCount) {\r\n\t\t stateCount[1]++;\r\n\t\t i--;\r\n\t\t }\r\n\t\t // If already too many modules in this state or ran off the edge:\r\n\t\t if (i < 0 || stateCount[1] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t while (i >= 0 && !image.get(centerJ, i) && stateCount[0] <= maxCount) {\r\n\t\t stateCount[0]++;\r\n\t\t i--;\r\n\t\t }\r\n\t\t if (stateCount[0] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t // Now also count down from center\r\n\t\t i = startI + 1;\r\n\t\t while (i < maxI && image.get(centerJ, i) && stateCount[1] <= maxCount) {\r\n\t\t stateCount[1]++;\r\n\t\t i++;\r\n\t\t }\r\n\t\t if (i == maxI || stateCount[1] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t while (i < maxI && !image.get(centerJ, i) && stateCount[2] <= maxCount) {\r\n\t\t stateCount[2]++;\r\n\t\t i++;\r\n\t\t }\r\n\t\t if (stateCount[2] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t return foundPatternCross(stateCount, moduleSize) ? centerFromEnd(stateCount, i) : null;\r\n\t\t}", "constructor(pattern_num, x = 0, y = 0, secondary = false) {\n this.pattern_num = pattern_num;\n this.blocks = [];\n this.pattern = shapes[pattern_num];\n this.color = colors[shape_color[pattern_num]];\n this.start_x = x;\n this.start_y = y;\n\n this.initialize_pattern = function () {\n if (this.blocks.length != 0) {\n let least_x = Infinity;\n let least_y = Infinity;\n this.blocks.forEach(block => {\n if (block.left < least_x) {\n least_x = block.left;\n }\n if (block.top < least_y) {\n least_y = block.top;\n }\n });\n while (least_x + this.pattern[0].length * field.block_width > canvas.width) {\n least_x -= field.block_width;\n }\n while (least_y + this.pattern.length * field.block_height > canvas.height) {\n least_y -= field.block_height;\n }\n\n\n this.start_x = least_x;\n this.start_y = least_y;\n }\n this.blocks = [];\n let start_x = this.start_x;\n let start_y = this.start_y;\n for (let i = 0; i < this.pattern.length; i += 1) {\n\n let row = this.pattern[i];\n for (let j = 0; j < row.length; j += 1) {\n let data = row[j];\n if (data != 1) {\n\n start_x += field.block_width;\n } else {\n let block = new game_block(this.color, start_x, start_y, secondary);\n this.blocks.push(block);\n start_x += field.block_width;\n }\n\n }\n start_x = this.start_x;\n start_y += field.block_height;\n }\n //this.start_y = start_y;\n }\n this.initialize_pattern_test = function (pattern) {\n let imaginary_blocks = [];\n let start_x;\n let start_y;\n if (this.blocks.length != 0) {\n let least_x = Infinity;\n let least_y = Infinity;\n this.blocks.forEach(block => {\n if (block.left < least_x) {\n least_x = block.left;\n }\n if (block.top < least_y) {\n least_y = block.top;\n }\n });\n while (least_x + pattern[0].length * field.block_width > canvas.width) {\n least_x -= field.block_width;\n }\n while (least_y + pattern.length * field.block_height > canvas.height) {\n least_y -= field.block_height;\n }\n\n\n start_x = least_x;\n start_y = least_y;\n }\n\n let st_x = start_x;\n for (let i = 0; i < pattern.length; i += 1) {\n\n let row = pattern[i];\n for (let j = 0; j < row.length; j += 1) {\n let data = row[j];\n if (data != 1) {\n\n start_x += field.block_width;\n } else {\n let block = new game_block(this.color, start_x, start_y);\n imaginary_blocks.push(block);\n start_x += field.block_width;\n }\n\n }\n start_x = st_x;\n start_y += field.block_height;\n }\n return imaginary_blocks;\n\n }\n this.get_vertical_height = function(){\n let smallest_top = Infinity;\n let biggest_bottom = -Infinity;\n this.blocks.forEach(block => {\n if(block.top < smallest_top){\n smallest_top = block.top;\n\n }\n if(block.bottom > biggest_bottom){\n biggest_bottom = block.bottom;\n }\n })\n return biggest_bottom - smallest_top;\n }\n this.delete_block = function (index) {\n this.blocks.splice(index, 1);\n }\n this.rotate_clockwise = function () {\n let new_pattern = rotate_array_clockwise(this.pattern);\n\n let imaginary_blocks = this.initialize_pattern_test(new_pattern);\n console.log(this.blocks, imaginary_blocks);\n let other_pieces = field.pieces;\n let inside_of_another = false;\n for (let i = 0; i < other_pieces.length; i += 1) {\n let other_piece = other_pieces[i];\n for (let j = 0; j < imaginary_blocks.length; j += 1) {\n let cur_block = imaginary_blocks[j];\n \n if (cur_block.inside_of_another_piece(other_piece) === true) {\n \n inside_of_another = true;\n break;\n }\n }\n if (inside_of_another === true) {\n break;\n }\n }\n if (inside_of_another === false) {\n this.pattern = new_pattern;\n\n this.initialize_pattern();\n }\n\n\n }\n this.initialize_pattern();\n this.draw = function () {\n this.blocks.forEach(function (block) {\n block.draw();\n })\n };\n this.touches_other_piece_bottom = function (pieces, excluded = -1) {\n for (let i = 0; i < pieces.length; i += 1) {\n if(excluded === i){\n continue;\n }\n let other_piece = pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_bottom(other_piece) === true) {\n \n return true;\n }\n }\n\n }\n return false;\n }\n this.touches_other_piece_right = function () {\n for (let i = 0; i < field.pieces.length; i += 1) {\n let other_piece = field.pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_right(other_piece) === true) {\n return true;\n }\n }\n\n }\n return false;\n }\n this.touches_other_piece_left = function () {\n for (let i = 0; i < field.pieces.length; i += 1) {\n let other_piece = field.pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_left(other_piece) === true) {\n return true;\n }\n }\n\n }\n return false;\n }\n\n this.touches_bottom = function () {\n let touches_bottom = false;\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_bottom();\n if (temp === true) {\n touches_bottom = true;\n break;\n }\n }\n return touches_bottom;\n }\n this.move_down = function () {\n let touches_bottom = this.touches_bottom();\n let touches_other_piece_bottom = this.touches_other_piece_bottom(field.pieces);\n if (touches_bottom === false && touches_other_piece_bottom === false) {\n this.blocks.forEach(block => {\n block.move_down();\n });\n touches_bottom = this.touches_bottom();\n touches_other_piece_bottom = this.touches_other_piece_bottom(field.pieces);\n if (touches_bottom === true || touches_other_piece_bottom === true) {\n field.deactivate_piece();\n }\n } else if (touches_bottom === false || touches_other_piece_bottom === false) {\n field.deactivate_piece();\n }\n\n }\n this.move_right = function () {\n let touches_right = false;\n let touches_other_piece_right = this.touches_other_piece_right();\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_right();\n if (temp === true) {\n touches_right = true;\n break;\n }\n }\n if (touches_right === false && touches_other_piece_right === false) {\n\n this.blocks.forEach(block => {\n block.move_right();\n })\n }\n }\n this.move_left = function () {\n let touches_left = false;\n let touches_other_piece_left = this.touches_other_piece_left();\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_left();\n if (temp === true) {\n touches_left = true;\n break;\n }\n }\n if (touches_left === false && touches_other_piece_left === false) {\n this.blocks.forEach(block => {\n block.move_left();\n })\n }\n }\n\n\n }", "function scorePattern(point, ratios, matrix) {\n try {\n var horizontalRun = countBlackWhiteRun(point, { x: -1, y: point.y }, matrix, ratios.length);\n var verticalRun = countBlackWhiteRun(point, { x: point.x, y: -1 }, matrix, ratios.length);\n var topLeftPoint = {\n x: Math.max(0, point.x - point.y) - 1,\n y: Math.max(0, point.y - point.x) - 1,\n };\n var topLeftBottomRightRun = countBlackWhiteRun(point, topLeftPoint, matrix, ratios.length);\n var bottomLeftPoint = {\n x: Math.min(matrix.width, point.x + point.y) + 1,\n y: Math.min(matrix.height, point.y + point.x) + 1,\n };\n var bottomLeftTopRightRun = countBlackWhiteRun(point, bottomLeftPoint, matrix, ratios.length);\n var horzError = scoreBlackWhiteRun(horizontalRun, ratios);\n var vertError = scoreBlackWhiteRun(verticalRun, ratios);\n var diagDownError = scoreBlackWhiteRun(topLeftBottomRightRun, ratios);\n var diagUpError = scoreBlackWhiteRun(bottomLeftTopRightRun, ratios);\n var ratioError = Math.sqrt(horzError.error * horzError.error +\n vertError.error * vertError.error +\n diagDownError.error * diagDownError.error +\n diagUpError.error * diagUpError.error);\n var avgSize = (horzError.averageSize + vertError.averageSize + diagDownError.averageSize + diagUpError.averageSize) / 4;\n var sizeError = (Math.pow((horzError.averageSize - avgSize), 2) +\n Math.pow((vertError.averageSize - avgSize), 2) +\n Math.pow((diagDownError.averageSize - avgSize), 2) +\n Math.pow((diagUpError.averageSize - avgSize), 2)) / avgSize;\n return ratioError + sizeError;\n }\n catch (_a) {\n return Infinity;\n }\n}", "function computeDimension(topLeft, topRight, bottomLeft, moduleSize) {\r\n\t\t var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize);\r\n\t\t var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize);\r\n\t\t var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\r\n\t\t switch (dimension & 0x03) {\r\n\t\t // mod 4\r\n\t\t case 0:\r\n\t\t dimension++;\r\n\t\t break;\r\n\t\t // 1? do nothing\r\n\t\t case 2:\r\n\t\t dimension--;\r\n\t\t break;\r\n\t\t }\r\n\t\t return dimension;\r\n\t\t}", "findFittable() {\n let startDepth = this.unplaced.openStart;\n for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {\n let node = cur.firstChild;\n if (cur.childCount > 1)\n openEnd = 0;\n if (node.type.spec.isolating && openEnd <= d) {\n startDepth = d;\n break;\n }\n cur = node.content;\n }\n for (let pass = 1; pass <= 2; pass++) {\n for (let sliceDepth = pass == 1 ? startDepth : this.unplaced.openStart; sliceDepth >= 0; sliceDepth--) {\n let fragment, parent = null;\n if (sliceDepth) {\n parent = contentAt(this.unplaced.content, sliceDepth - 1).firstChild;\n fragment = parent.content;\n } else {\n fragment = this.unplaced.content;\n }\n let first2 = fragment.firstChild;\n for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {\n let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;\n if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment.from(first2), false)) : parent && type.compatibleContent(parent.type)))\n return { sliceDepth, frontierDepth, parent, inject };\n else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))\n return { sliceDepth, frontierDepth, parent, wrap: wrap2 };\n if (parent && match.matchType(parent.type))\n break;\n }\n }\n }\n }", "function apply(data, desired_ratio){\r\n data.sort(function (a, b) { return b.height - a.height; });\r\n\r\n min_width = data.reduce(function(a, b) {\r\n return a.width < b.width ? a.width : b.width;\r\n });\r\n\r\n var left = x1 = 10;\r\n var right = x2 = get_entire_width(data);\r\n \r\n f_x1 = 0;\r\n f_x2 = 10;\r\n\r\n while ((Math.abs(x1 - x2) > min_width) || Math.abs(f_x1 - f_x2) > applyPacking.FLOAT_EPSILON ) {\r\n\r\n var x1 = right - (right - left) / applyPacking.GOLDEN_SECTION;\r\n var x2 = left + (right - left) / applyPacking.GOLDEN_SECTION; \r\n var f_x1 = step(data, x1);\r\n var f_x2 = step(data, x2);\r\n\r\n if (f_x1 > f_x2) left = x1; else right = x2; \r\n }\r\n }", "readCodewords() {\n let width = this.bitMatrix.getWidth();\n let height = this.bitMatrix.getHeight();\n\n this.erasures = new Array(MAX_CW_CAPACITY);\n\n for (let k = 0; k < this.erasures.length; k++) {\n this.erasures[k] = 0;\n }\n\n // Get the number of pixels in a module across the X dimension\n //float moduleWidth = bitMatrix.getModuleWidth();\n let moduleWidth = 1.0; // Image has been sampled and reduced\n let rowCounters = new Array(width);\n\n for (let n = 0; n < rowCounters.length; n++) {\n rowCounters[n] = 0;\n }\n\n let codewords = new Array(MAX_CW_CAPACITY);\n\n for (let m = 0; m < codewords.length; m++) {\n codewords[m] = 0;\n }\n\n let next = 0;\n let matchingConsecutiveScans = 0;\n let rowInProgress = false;\n let rowNumber = 0;\n let rowHeight = 0;\n\n for (let i = 1; i < height; i++) {\n if (rowNumber >= MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n let rowDifference = 0;\n // Scan a line of modules and check the\n // difference between this and the previous line\n for (let j = 0; j < width; j++) {\n // Accumulate differences between this line and the\n // previous line.\n if (this.bitMatrix._get(j, i) != this.bitMatrix._get(j, i - 1)) {\n rowDifference++;\n }\n }\n\n if (rowDifference <= moduleWidth * this.MAX_ROW_DIFFERENCE) {\n for (let j2 = 0; j2 < width; j2++) {\n // Accumulate the black pixels on this line\n if (bitMatrix._get(j2, i)) {\n rowCounters[j2]++;\n }\n }\n // Increment the number of consecutive rows of pixels\n // that are more or less the same\n matchingConsecutiveScans++;\n // Height of a row is a multiple of the module size in pixels\n // Usually at least 3 times the module size\n if (matchingConsecutiveScans >= moduleWidth * 2) { // MGMG\n // We have some previous matches as well as a match here\n // Set processing a unique row.\n rowInProgress = true;\n }\n } else {\n if (rowInProgress) {\n // Process Row\n next = processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n if (next == -1) {\n // Something is wrong, since we have exceeded\n // the maximum columns in the specification.\n // TODO Maybe return error code\n return null;\n }\n // Reinitialize the row counters.\n for (let j3 = 0; j3 < rowCounters.length; j3++) {\n rowCounters[j3] = 0;\n }\n rowNumber++;\n rowHeight = 0;\n }\n matchingConsecutiveScans = 0;\n rowInProgress = false;\n }\n rowHeight++;\n }\n // Check for a row that was in progress before we exited above.\n if (rowInProgress) {\n // Process Row\n if (rowNumber >= this.MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n\n next = this.processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n rowNumber++;\n rows = rowNumber;\n }\n erasures = trimArray(erasures, eraseCount);\n return trimArray(codewords, next);\n }", "function findMaxMatch3() {\r\n\r\n // Initialise empty matching (reset flags)\r\n for (var i = 0; i < nodes.length; i++)\r\n match[i] = false;\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Algorithm started</li>\");\r\n shortTrace.push(\"<li>Algorithm started</li>\");\r\n frame = new Frame2(1, 1, longTraceNum++, shortTraceNum, graph.map(g => ([ ...g ])), [], [...blossom]);\r\n frames.push(frame);\r\n\r\n // Find augmenting path and augment matching along path until maximum matching is found\r\n while (findAugmentingPath());\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Maximum matching found</li>\");\r\n shortTrace.push(\"<li>Maximum matching found</li>\");\r\n frame = new Frame2(9, 5, longTraceNum++, ++shortTraceNum, graph.map(g => ([ ...g ])), [], []);\r\n frames.push(frame);\r\n\r\n}", "calcRegionSizeGlobal() {\n // this should only get done once\n // scanCol is the column that has the data we care about putting in the color fill\n // this returns a summary object that knows things about the size of the brain json dimensions and also the min and max of hte scan data\n //!! should only do this part once\n let globals = [1000, 1000, -1000, -1000]\n for (let sliceName in this.paneOb.regionBoundaryData) {\n let slice = this.paneOb.regionBoundaryData[sliceName]\n // skip if there's a single point feature\n for (let feature of slice.features) {\n // likely nota loop because coordinates is a single element array\n for (let line of feature.geometry.coordinates) {\n for (let pt of line) {\n if (pt[0] < globals[0]) {\n globals[0] = pt[0]\n }\n if (pt[1] < globals[1]) {\n globals[1] = pt[1]\n }\n if (pt[0] > globals[2]) {\n globals[2] = pt[0]\n }\n if (pt[1] > globals[3]) {\n globals[3] = pt[1]\n }\n }\n }\n }\n\n\n\n }\n /** This is a list of smallest and largest values found in the x,y dimensions within the geojson data provided. This is used to scale the region coordinates to the space of the canvas */\n this.regionSizes = globals\n /** This is a ratio of the heightvs the width of the brain data. Helpful for determining what the maximum value of our y interpolator should be. */\n this.canvasRatio = globals[3] / globals[2]\n }", "function sectionFinder()\n{\n currentSection=allSections[0];\n minDist=90000000;\n for(pointer of allSections)\n {\n var sizeChecker=pointer.getBoundingClientRect();\n if( sizeChecker.top>-320 & sizeChecker.top<minDist)\n {\n currentSection=pointer;\n minDist=sizeChecker.top;\n }\n }\n return currentSection;\n \n}", "function init_module() {\n\n var qANDIVersionNumber = \"4.1.4\";\n\n //create qANDI instance\n var qANDI = new AndiModule(qANDIVersionNumber, \"q\");\n\n var structureExists = false;\n var landmarksArray = [];\n\n //This function will analyze the test page for graphics/image related markup relating to accessibility\n qANDI.analyze = function () {\n\n //Loop through every visible element\n $(TestPageData.allElements).each(function () {\n if ($(this).isSemantically(\"[role=banner],[role=complementary],[role=contentinfo],[role=form],[role=main],[role=navigation],[role=search],[role=region]\", \"main,header,footer,nav,form,aside\")) {\n //Add to the landmarks array\n landmarksArray.push($(this));\n structureExists = true;\n\n if (AndiModule.activeActionButtons.landmarks) {\n andiData = new AndiData(this);\n\n andiCheck.commonNonFocusableElementChecks(andiData, $(this));\n AndiData.attachDataToElement(this);\n }\n }\n });\n };\n\n //Initialize outline\n qANDI.outline = \"<h3 tabindex='-1' id='qANDI508-outline-heading'>Headings List (ordered by occurance):</h3><div class='ANDI508-scrollable'>\";\n\n //This function will display the heading list (headings outline)\n //It should only be called on heading elements\n qANDI.getOutlineItem = function (element) {\n var displayCharLength = 60; //for truncating innerText\n var tagName = $(element).prop(\"tagName\").toLowerCase();\n var role = $(element).attr(\"role\");\n var ariaLevel = $(element).attr(\"aria-level\");\n\n var outlineItem = \"<a href='#' data-andi508-relatedindex='\" + $(element).attr('data-andi508-index') + \"'>&lt;\" + tagName;\n\n //display relevant attributes\n if (role)\n outlineItem += \" role='\" + role + \"' \";\n if (ariaLevel)\n outlineItem += \" aria-level='\" + ariaLevel + \"' \";\n\n outlineItem += \"&gt;\";\n outlineItem += \"<span class='ANDI508-display-innerText'>\";\n outlineItem += $.trim(andiUtility.formatForHtml($(element).text().substring(0, displayCharLength)));\n if ($(element).html().length > displayCharLength) {\n outlineItem += \"...\";\n }\n outlineItem += \"</span>\";\n outlineItem += \"&lt;/\" + tagName + \"&gt;</a>\";\n outlineItem += \"<br />\";\n return outlineItem;\n };\n\n //This function adds the finishing touches and functionality to ANDI's display once it's done scanning the page.\n qANDI.results = function () {\n //No outline for landmarks mode\n andiBar.updateResultsSummary(\"Landmarks: \" + landmarksArray.length);\n if (!andiBar.focusIsOnInspectableElement()) {\n andiBar.showElementControls();\n andiBar.showStartUpSummary(\"Landmark structure found.<br />Ensure that each <span class='ANDI508-module-name-s'>landmark</span> is applied appropriately to the corresponding section of the page.\", true);\n }\n\n $(\"#qANDI508-outline-container\")\n .html(qANDI.outline)\n .find(\"a[data-andi508-relatedindex]\").each(function () {\n andiFocuser.addFocusClick($(this));\n var relatedIndex = $(this).attr(\"data-andi508-relatedindex\");\n var relatedElement = $(\"#ANDI508-testPage [data-andi508-index=\" + relatedIndex + \"]\").first();\n andiLaser.createLaserTrigger($(this), $(relatedElement));\n $(this)\n .hover(function () {\n if (!event.shiftKey)\n AndiModule.inspect(relatedElement[0]);\n })\n .focus(function () {\n AndiModule.inspect(relatedElement[0]);\n });\n });\n\n $(\"#qANDI508-outline-container\")\n .html(qANDI.outline)\n .find(\"a[data-andi508-relatedindex]\").each(function () {\n andiFocuser.addFocusClick($(this));\n var relatedIndex = $(this).attr(\"data-andi508-relatedindex\");\n var relatedElement = $(\"#ANDI508-testPage [data-andi508-index=\" + relatedIndex + \"]\").first();\n andiLaser.createLaserTrigger($(this), $(relatedElement));\n $(this)\n .hover(function () {\n if (!event.shiftKey)\n AndiModule.inspect(relatedElement[0]);\n })\n .focus(function () {\n AndiModule.inspect(relatedElement[0]);\n });\n });\n\n andiAlerter.updateAlertList();\n\n $(\"#ANDI508\").focus();\n\n };\n\n //This function will update the info in the Active Element Inspection.\n //Should be called after the mouse hover or focus in event.\n AndiModule.inspect = function (element) {\n if ($(element).hasClass(\"ANDI508-element\")) {\n andiBar.prepareActiveElementInspection(element);\n\n var elementData = $(element).data(\"andi508\");\n var addOnProps = AndiData.getAddOnProps(element, elementData,\n [\n \"aria-level\",\n getDefault_ariaLive(element, elementData),\n getDefault_ariaAtomic(element, elementData),\n \"aria-busy\",\n \"aria-relevant\"\n ]);\n\n andiBar.displayTable(elementData, element, addOnProps);\n\n andiBar.displayOutput(elementData, element, addOnProps);\n }\n\n //This function assumes the default values of aria-live based on the element's role as defined by spec\n function getDefault_ariaLive(element, elementData) {\n var val = $.trim($(element).attr(\"aria-live\"));\n if (!val) {\n if (elementData.role === \"alert\") {\n val = \"assertive\";\n } else if (elementData.role === \"log\" || elementData.role === \"status\") {\n val = \"polite\";\n } else if (elementData.role === \"marquee\" || elementData.role === \"timer\") {\n val = \"off\";\n } else {\n return; //no default\n }\n }\n return [\"aria-live\", val];\n }\n\n //This function assumes the default values of aria-atomic based on the element's role as defined by spec\n function getDefault_ariaAtomic(element, elementData) {\n var val = $.trim($(element).attr(\"aria-atomic\"));\n if (!val) {\n if (elementData.role === \"alert\" || elementData.role === \"status\") {\n val = \"true\";\n } else if (elementData.role === \"log\" || elementData.role === \"marquee\" || elementData.role === \"timer\") {\n val = \"false\";\n } else {\n return; //no default\n }\n }\n return [\"aria-atomic\", val];\n }\n };\n\n qANDI.analyze();\n qANDI.results();\n\n}//end init", "static removeSmallOpenAreas(pattern) {\n let openAreas = PatternHelper.findIsolatedAreas(pattern, 0);\n if (openAreas.length === 0) {\n return null;\n }\n if (openAreas.length > 1) {\n // remove open areas\n openAreas\n // except biggest area\n .slice(1)\n .forEach((cells) => {\n cells.forEach((pos) => {\n pattern[pos.x][pos.y] = 1;\n });\n });\n }\n return openAreas[0];\n }", "findMatchingIsomorphism(posn, world, asker) {\n\t\t//grab the adjacent squares by posn, put them in a 4 element array\n\t\tvar adjacentPosns = posn.getAdjacentPosnsWithWraparound(world)\n\t\t//try each of the 4 isomorphisms:\n\t\tfor (var isomorphism = 0; isomorphism < 4; isomorphism++) {\n\t\t\tvar isMatch = true;\n\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\tif (!this.matchers[(i + isomorphism) % 4](adjacentPosns[i], world, asker)) {\n\t\t\t\t\tisMatch = false;\n\t\t\t\t\ti = 4; // break the loop\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isMatch) {\n\t\t\t\treturn isomorphism;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "function buildPatternBase(width, pixelSize, roughness) {\n\n\t\t// have to create a 2D array in order to more easily manipulate shapes\n\t\tfunction create2dArray(w,h) { \n\t\t\tvar newArray = new Array(w);\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tnewArray[i] = new Array(h); \n\t\t\t}\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tfor (j=0; j<h; j++) {\n\t\t\t\t\tnewArray[i][j] = 0; // set all initial values to 0.\n\t\t\t\t}\t\t\t\t\t\t// these will get assigned random values.\n\t\t\t}\n\n\t\t\treturn newArray;\n\t\t}\n\n\n\t\t// start by seeding first corners\n\t\tfunction startDisplacement(map, width) {\n\t\t\tvar topRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center;\n\n\t\t\tmap[0][0] = Math.random();\n\t\t\ttopLeft = map[0][0];\n\n\t\t\tmap[0][width] = Math.random();\n\t\t\tbottomLeft = map[0][width];\n\n\t\t\tmap[width][0] = Math.random();\n\t\t\ttopRight = map[width][0];\n\n\t\t\tmap[width][width] = Math.random();\n\t\t\tbottomRight = map[width][width];\n\n\t\t\tmap[width / 2][width / 2] = topLeft + bottomLeft + topRight + bottomRight; \n\t\t\tmap[width / 2][width / 2] = normalize(map[width / 2][width / 2]);\n\t\t\tcenter = map[width / 2][width / 2];\n\t\t\t\n\n\t\t\tmap[width / 2][width] = bottomLeft + bottomRight + center / 4;\n\t\t\tmap[width / 2][0] = topLeft + topRight + center / 4;\n\t\t\tmap[width][width / 2] = topRight + bottomRight + center / 4;\n\t\t\tmap[0][width / 2] = topLeft + bottomLeft + center / 4;\n\n\n\t\t\t// if (wrapping === false) {\n\t\t\t// // non wrapping\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center / 3;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center / 3;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center / 3;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center / 3;\n\t\t\t// }\n\n\t\t\t// else {\n\t\t\t// // wrapping\t\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center + center / 4;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center + center / 4;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center + center / 4;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center + center / 4;\n\t\t\t// }\n\n\t\t\tcenterDisplacement(width);\n\t\t}\n\n\t\tfunction centerDisplacement(d) {\n\t\t\tvar newD = d / 2,\n\t\t\t\ttopRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center, i, j;\n\n\t\t\tif (newD > pixelSize) {\n\t\t\t\tfor (i = newD; i <= width; i += newD) {\n\t\t\t\t\tfor (j = newD; j <= width; j+= newD) {\n\t\t\t\t\t\tx = i - (newD / 2);\n\t\t\t\t\t\ty = j - (newD / 2);\n\n\t\t\t\t\t\t// corners \n\t\t\t\t\t\ttopLeft = map[i - newD][j - newD];\n\t\t\t\t\t\ttopRight = map[i][j - newD];\n\t\t\t\t\t\tbottomLeft = map[i - newD][j];\n\t\t\t\t\t\tbottomRight = map[i][j];\n\n\t\t\t\t\t\t// center\n\t\t\t\t\t\tmap[x][y] = (topLeft + topRight + bottomLeft + bottomRight) / 4 + displace(d);\n\t\t\t\t\t\tmap[x][y] = normalize(map[x][y]);\n\t\t\t\t\t\tcenter = map[x][y];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// top\n\t\t\t\t\t\tif (j - (newD * 2) + (newD / 2) > 0) {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center + map[x][j - d + (newD / 2)]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j - newD] = normalize(map[x][j - newD]);\n\n\t\t\t\t\t\t// Bottom\n\t\t\t\t\t\tif (j + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center + map[x][j + (newD / 2)]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j] = normalize(map[x][j]);\n\n\n\t\t\t\t\t\t//Right\n\t\t\t\t\t\tif (i + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center + map[i + (newD / 2)][y]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i][y] = normalize(map[i][y]);\n\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif (i - (newD * 2) + (newD / 2) > 0){\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center + map[i - d + (newD / 2)][y]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i - newD][y] = normalize(map[i - newD][y]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcenterDisplacement(newD);\n\t\t\t}\n\t\t}\n\n\t\tfunction normalize(x) { // required in the event a center value exceeds 1\n\t\t\tif (x > 1) {\n\t\t\t\tx = 1;\n\t\t\t}\n\t\t\telse if (x < 0) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t\treturn x;\n\t\t}\n\n\t\t// generates a random value to offset center for subsequent iterations\n\t\tfunction displace(num){\n\t\t\tvar max = num / (width + width) * roughness;\n\t\t\treturn (Math.random(1.0)- 0.5) * max;\n\t\t}\n\n\t\tvar map = create2dArray(width + 1, width + 1);\n\t\tstartDisplacement(map,width);\n\t\treturn map;\n\t}", "addMapPattern() {\n if(this.pattern !== \"random\") {\n if(this.pattern === \"lack\") {\n this.environnement.placeBlockPattern(this.map.getRandomRow(1, (this.map.size - 7)), this.map.getRandomCol(1, (this.map.size - 7)), this.gameData.mapPatterns[this.pattern]);\n }\n else {\n this.environnement.placeBlockPattern(this.map.getRandomRow(1, (this.map.size - 7)), 0, this.gameData.mapPatterns[this.pattern]);\n }\n }\n }", "_McDonaldAlloc(size) {\n size = roundUp(size, this._alignment);\n\n for (let i = 0; i < this._chunkCount; ++i) {\n const chunk = this._chunks[i];\n let isFound = false;\n let start = chunk.start;\n\n if (start + size <= chunk.end) {\n isFound = true;\n } else if (start > chunk.end) {\n if (start + size <= chunk.size) {\n isFound = true;\n } else if (size <= chunk.end) {\n // Try to find from head again.\n chunk.start = start = 0;\n isFound = true;\n }\n } else if (start === chunk.end) {\n chunk.start = start = 0;\n chunk.end = chunk.size;\n\n if (size <= chunk.end) {\n isFound = true;\n }\n }\n\n if (isFound) {\n chunk.start += size;\n const handle = {\n chunkIdx: i,\n start,\n end: start + size,\n texture: chunk.texture\n };\n\n this._handles.push(handle);\n\n return handle;\n }\n } // create a new one\n\n\n const targetSize = Math.sqrt(size / this._formatSize);\n const texLength = this._roundUpFn && this._roundUpFn(targetSize, this._formatSize) || Math.max(1024, nearestPOT(targetSize));\n\n const newChunk = this._chunks[this.createChunk(texLength)];\n\n newChunk.start += size;\n const texHandle = {\n chunkIdx: this._chunkCount,\n start: 0,\n end: size,\n texture: newChunk.texture\n };\n\n this._handles.push(texHandle);\n\n return texHandle;\n }", "findNext() {\n // look left, right, up, down\n let leftLoc = {x: this.center.x - 1, y: this.center.y};\n let rightLoc = {x: this.center.x, y: this.center.y};\n let upLoc = {x: this.center.x, y: this.center.y - 1};\n let downLoc = {x: this.center.x, y: this.center.y + 1};\n\n let carArray = [this.layout[leftLoc.y][leftLoc.x] || 0, this.layout[rightLoc.y][rightLoc.x] || 0,\n this.layout[upLoc.y][upLoc.x] || 0, this.layout[downLoc.y][downLoc.x] || 0];\n if(Math.max(...carArray) === 0) {\n console.log(\"bunny sleep\")\n return\n }\n let nextLoc = carArray.indexOf(Math.max(...carArray));\n\n switch(nextLoc) {\n case 0: \n return leftLoc;\n \n case 1: \n return rightLoc;\n\n case 2: \n return upLoc;\n \n case 3: \n return downLoc;\n default: \n return null;\n }\n }", "_estimateBoundingBox()\n\t{\n\t\t// take the alignment into account:\n\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\tthis._pos[0] - this._size[0] / 2.0,\n\t\t\tthis._pos[1] - this._size[1] / 2.0,\n\t\t\tthis._size[0],\n\t\t\tthis._size[1],\n\t\t);\n\t}", "findRGB(c){\n if ((typeof c) == \"number\"){return c;}\n let rgb = [];\n if ((typeof c) == \"string\" && c.length == 7){\n rgb = [parseInt(c.substr(1, 2), 16), parseInt(c.substr(3, 2), 16), parseInt(c.substr(5, 2), 16)];\n }\n if (c instanceof Array){rgb = c;}\n if (!rgb.length){\n console.log(\"Invalid color lookup argument: \", c);\n return 0;\n }\n //ACNH has no palette colors - just plain RGB\n if (this.pattern instanceof ACNHFormat){return \"#\"+toHex(rgb[0])+toHex(rgb[1])+toHex(rgb[2]);}\n //Find the closest match\n let best = 255*255*3;\n let bestno = 0;\n for (let i = 0; i < 256; i++){\n let m = ACNLFormat.RGBLookup[i];\n if (m === null){continue;}\n let rD = (m[0] - rgb[0]);\n let gD = (m[1] - rgb[1]);\n let bD = (m[2] - rgb[2]);\n let match = (rD*rD + gD*gD + bD*bD);\n if (match < best){\n if (!match){return i;}//perfect match - we can stop immediately\n best = match;\n bestno = i;\n }\n }\n return bestno;\n }", "findPalYUV(rgb){\n //Convert to YUV\n let yuv = [rgb[0] * .299000 + rgb[1] * .587000 + rgb[2] * .114000, rgb[0] * -.168736 + rgb[1] * -.331264 + rgb[2] * .500000 + 128, rgb[0] * .500000 + rgb[1] * -.418688 + rgb[2] * -.081312 + 128];\n //Find the closest match\n let best = 255*255*3;\n let bestno = 0;\n for (let i = 0; i < 15; i++){\n let m;\n if (this.pattern instanceof ACNHFormat){\n m = this.pattern.getPalette(i);\n }else{\n m = ACNLFormat.YUVLookup[this.pattern.getPalette(i)];\n }\n if (m === null){continue;}\n let yD = (m[0] - yuv[0]);\n let uD = (m[1] - yuv[1]);\n let vD = (m[2] - yuv[2]);\n let match = (yD*yD + uD*uD + vD*vD);\n if (match < best){\n if (!match){return i;}//perfect match - we can stop immediately\n best = match;\n bestno = i;\n }\n }\n return bestno;\n }", "function getMatchForIon(sion, matchData, allPeaks, peakIndex, massTolerance, peakAssignmentType, neutralLosses, massType) {\n\t\t\n\t\tif(!neutralLosses)\n\t\t\tsion.match = false; // reset;\n\t\tvar ionmz = ionMz(sion, neutralLosses, massType);\n var peakLabel = getLabel(sion, neutralLosses);\n\n\t\tvar __ret = getMatchingPeak(peakIndex, allPeaks, ionmz, massTolerance, peakAssignmentType);\n\n peakIndex = __ret.peakIndex;\n var bestPeak = __ret.bestPeak;\n\n // if we found a matching peak for the current ion, save it\n if(bestPeak) {\n // console.log(\"found match \"+sion.label+\", \"+ionmz+\"; peak: \"+bestPeak[0] + \"; theoreticalMz: \" + __ret.theoreticalMz);\n matchData[0].push([bestPeak[0], bestPeak[1], __ret.theoreticalMz]);\n matchData[1].push(peakLabel);\n if(!neutralLosses) {\n sion.match = true;\n }\n }\n\n\t\treturn peakIndex;\n\t}", "function getAlignment() {\n //Roll d20 for the alignment options\n let d20 = roll('d20');\n //Now go through the options\n if (d20 <= 2) return \"LG\";\n else if (d20 <= 4) return \"NG\";\n else if (d20 <= 6) return \"CG\";\n else if (d20 <= 9) return \"LN\";\n else if (d20 <= 11) return \"NN\";\n else if (d20 <= 12) return \"CN\";\n else if (d20 <= 15) return \"LE\";\n else if (d20 <= 18) return \"NE\";\n else return \"CE\";\n}", "function fitToBorders() {\n\t\t\t\t\tvar xa = Math.abs(plane.position.z) * Math.tan(angleX),\n\t\t\t\t\t\tya = Math.abs(plane.position.z) * Math.tan(angleY);\n\n\t\t\t\t\tvar cWidth = 2 * xa,\n\t\t\t\t\t\tcHeight = 2 * ya;\n\t\t\t\t\tvar iWidth = Math.abs(plane.position.x - imageAspect / 2) + Math.abs(plane.position.x + imageAspect / 2),\n\t\t\t\t\t\tiHeight = Math.abs(plane.position.y - 0.5) + Math.abs(plane.position.y + 0.5);\n\n\n\t\t\t\t\tif (imageAspect < canvasAspect && cWidth > iWidth) {\n\t\t\t\t\t\tif (xa < plane.position.x + imageAspect / 2)\n\t\t\t\t\t\t\tplane.translateX(xa - (plane.position.x + imageAspect / 2));\n\t\t\t\t\t\tif (-xa > plane.position.x - imageAspect / 2)\n\t\t\t\t\t\t\tplane.translateX(-xa - (plane.position.x - imageAspect / 2));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (xa > plane.position.x + imageAspect / 2)\n\t\t\t\t\t\t\tplane.translateX(xa - (plane.position.x + imageAspect / 2));\n\t\t\t\t\t\tif (-xa < plane.position.x - imageAspect / 2)\n\t\t\t\t\t\t\tplane.translateX(-xa - (plane.position.x - imageAspect / 2));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (imageAspect > canvasAspect && cHeight > iHeight) {\n\t\t\t\t\t\tif (ya < plane.position.y + 0.5)\n\t\t\t\t\t\t\tplane.translateY(ya - (plane.position.y + 0.5));\n\t\t\t\t\t\tif (-ya > plane.position.y - 0.5)\n\t\t\t\t\t\t\tplane.translateY(-ya - (plane.position.y - 0.5));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (ya > plane.position.y + 0.5)\n\t\t\t\t\t\t\tplane.translateY(ya - (plane.position.y + 0.5));\n\t\t\t\t\t\tif (-ya < plane.position.y - 0.5)\n\t\t\t\t\t\t\tplane.translateY(-ya - (plane.position.y - 0.5));\n\t\t\t\t\t}\n\n\t\t\t\t}", "getNextPos() {\n\t\tif(this.nextX === 0) {\n\t\t\tthis.nextX = 20;\n\t\t}\n\t\tif(this.nextY === 0) {\n\t\t\tthis.nextY = 20;\n\t\t}\n\t\telse {\n\t\t\tthis.nextX = (this.nextX + 95) % WIDTH;\n\t\t}\n\t\t\n\t\tif(this.nextX > 400) {\n\t\t\tthis.nextX = 20;\n\t\t\tthis.nextY = this.nextY + 95;\n\t\t}\n\t\t\n\t\tif(this.nextY > 400) {\n\t\t\tconsole.log(\"Matrix full!\");\n\t\t}\n\t}", "function getRuntimeAlignmentOffsetConf() {\n if ($conf.align == 'left') {\n return [\n getLeftAlignedOffset,\n 'offsetWidth',\n ['marginLeft', 'marginRight'],\n setTargetTransformX,\n ];\n } else if ($conf.align == 'right') {\n return [\n getRightAlignedOffset,\n 'offsetWidth',\n ['marginLeft', 'marginRight'],\n setTargetTransformX,\n ];\n } else if ($conf.align == 'center') {\n return [\n getCenterAlignedOffset,\n 'offsetWidth',\n ['marginLeft', 'marginRight'],\n setTargetTransformX,\n ];\n } else if ($conf.align == 'top') {\n return [\n getLeftAlignedOffset,\n 'offsetHeight',\n ['marginTop', 'marginBottom'],\n setTargetTransformY,\n ];\n } else if ($conf.align == 'bottom') {\n return [\n getRightAlignedOffset,\n 'offsetHeight',\n ['marginTop', 'marginBottom'],\n setTargetTransformY,\n ];\n } else if ($conf.align == 'middle') {\n return [\n getCenterAlignedOffset,\n 'offsetHeight',\n ['marginTop', 'marginBottom'],\n setTargetTransformY,\n ];\n } else {\n return null;\n }\n }", "function bestInitialLayout(areas, params) {\n var initial = greedyLayout(areas, params);\n var loss = params.lossFunction || lossFunction;\n\n // greedylayout is sufficient for all 2/3 circle cases. try out\n // constrained MDS for higher order problems, take its output\n // if it outperforms. (greedy is aesthetically better on 2/3 circles\n // since it axis aligns)\n if (areas.length >= 8) {\n var constrained = constrainedMDSLayout(areas, params),\n constrainedLoss = loss(constrained, areas),\n greedyLoss = loss(initial, areas);\n\n if (constrainedLoss + 1e-8 < greedyLoss) {\n initial = constrained;\n }\n }\n return initial;\n}", "function bestInitialLayout(areas, params) {\n var initial = greedyLayout(areas, params);\n var loss = params.lossFunction || lossFunction;\n\n // greedylayout is sufficient for all 2/3 circle cases. try out\n // constrained MDS for higher order problems, take its output\n // if it outperforms. (greedy is aesthetically better on 2/3 circles\n // since it axis aligns)\n if (areas.length >= 8) {\n var constrained = constrainedMDSLayout(areas, params),\n constrainedLoss = loss(constrained, areas),\n greedyLoss = loss(initial, areas);\n\n if (constrainedLoss + 1e-8 < greedyLoss) {\n initial = constrained;\n }\n }\n return initial;\n }", "function bestInitialLayout(areas, params) {\n var initial = greedyLayout(areas, params);\n var loss = params.lossFunction || lossFunction;\n\n // greedylayout is sufficient for all 2/3 circle cases. try out\n // constrained MDS for higher order problems, take its output\n // if it outperforms. (greedy is aesthetically better on 2/3 circles\n // since it axis aligns)\n if (areas.length >= 8) {\n var constrained = constrainedMDSLayout(areas, params),\n constrainedLoss = loss(constrained, areas),\n greedyLoss = loss(initial, areas);\n\n if (constrainedLoss + 1e-8 < greedyLoss) {\n initial = constrained;\n }\n }\n return initial;\n }", "function decide() {\n\t\t\t\tvar recognise = false;\n\t\t\t\tif(fromAbove && fromBelow) {\n\t\t\t\t\tif(fromAbove == fromBelow) {\n\t\t\t\t\t\talert(\"Pattern recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.childAddress[i].x][self.childAddress[i].y][self.childAddress[i].z](fromBelow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Pattern not recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.parentAddress.x][self.parentAddress.y][self.parentAddress.z](fromBelow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "regularization() {\n const system_optimal = this.systemOptimal;\n\n var search_area = [];\n search_area.push(system_optimal);\n var i = system_optimal[0];\n var j = system_optimal[1];\n if (i - 1 > -1) {\n search_area.push([i-1,j]);\n }\n if (i + 1 < this.featureSize) {\n search_area.push([i+1,j]);\n }\n if (j - 1 > -1) {\n search_area.push([i,j-1]);\n }\n if (j + 1 < this.featureSize) {\n search_area.push([i,j+1]);\n }\n if (i - 1 > -1 && j - 1 > -1) {\n search_area.push([i-1,j-1]);\n }\n if (i + 1 < this.featureSize && j + 1 < this.featureSize) {\n search_area.push([i + 1, j+1]);\n }\n if (i - 1 > -1 && j + 1 < this.featureSize) {\n search_area.push([i - 1, j+1]);\n }\n if (i + 1 < this.featureSize && j - 1 > -1) {\n search_area.push([i + 1, j - 1]);\n }\n return search_area;\n }", "function findSmallestWidthAlignment(g,xss){return _.minBy(_.values(xss),function(xs){var max=Number.NEGATIVE_INFINITY;var min=Number.POSITIVE_INFINITY;_.forIn(xs,function(x,v){var halfWidth=width(g,v)/2;max=Math.max(x+halfWidth,max);min=Math.min(x-halfWidth,min)});return max-min})}", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x)\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n return accuracy + proximity / Match_Distance\n }", "function pass() {\n var a, i, j, l, r, n, n1, n2, e, w, g, k, m;\n\n var outboundAttCompensation,\n coefficient,\n xDist,\n yDist,\n oldxDist,\n oldyDist,\n ewc,\n mass,\n distance,\n size,\n factor,\n minNodeDistance = W.settings.minNodeDistance;\n\n // 1) Initializing layout data\n //-----------------------------\n\n // Resetting positions & computing max values\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n NodeMatrix[np(n, \"old_dx\")] = NodeMatrix[np(n, \"dx\")];\n NodeMatrix[np(n, \"old_dy\")] = NodeMatrix[np(n, \"dy\")];\n NodeMatrix[np(n, \"dx\")] = 0;\n NodeMatrix[np(n, \"dy\")] = 0;\n }\n\n // If outbound attraction distribution, compensate\n if (W.settings.outboundAttractionDistribution) {\n outboundAttCompensation = 0;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n outboundAttCompensation += NodeMatrix[np(n, \"mass\")];\n }\n\n outboundAttCompensation /= W.nodesLength;\n }\n\n // 1.bis) Barnes-Hut computation\n //------------------------------\n\n if (W.settings.barnesHutOptimize) {\n var minX = Infinity,\n maxX = -Infinity,\n minY = Infinity,\n maxY = -Infinity,\n q,\n q0,\n q1,\n q2,\n q3;\n\n // Setting up\n // RegionMatrix = new Float32Array(W.nodesLength / W.ppn * 4 * W.ppr);\n RegionMatrix = [];\n\n // Computing min and max values\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n minX = Math.min(minX, NodeMatrix[np(n, \"x\")]);\n maxX = Math.max(maxX, NodeMatrix[np(n, \"x\")]);\n minY = Math.min(minY, NodeMatrix[np(n, \"y\")]);\n maxY = Math.max(maxY, NodeMatrix[np(n, \"y\")]);\n }\n\n // Build the Barnes Hut root region\n RegionMatrix[rp(0, \"node\")] = -1;\n RegionMatrix[rp(0, \"centerX\")] = (minX + maxX) / 2;\n RegionMatrix[rp(0, \"centerY\")] = (minY + maxY) / 2;\n RegionMatrix[rp(0, \"size\")] = Math.max(\n maxX - minX,\n maxY - minY\n );\n RegionMatrix[rp(0, \"nextSibling\")] = -1;\n RegionMatrix[rp(0, \"firstChild\")] = -1;\n RegionMatrix[rp(0, \"mass\")] = 0;\n RegionMatrix[rp(0, \"massCenterX\")] = 0;\n RegionMatrix[rp(0, \"massCenterY\")] = 0;\n\n // Add each node in the tree\n l = 1;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n // Current region, starting with root\n r = 0;\n\n while (true) {\n // Are there sub-regions?\n\n // We look at first child index\n if (RegionMatrix[rp(r, \"firstChild\")] >= 0) {\n // There are sub-regions\n\n // We just iterate to find a \"leave\" of the tree\n // that is an empty region or a region with a single node\n // (see next case)\n\n // Find the quadrant of n\n if (\n NodeMatrix[np(n, \"x\")] < RegionMatrix[rp(r, \"centerX\")]\n ) {\n if (\n NodeMatrix[np(n, \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Left quarter\n q = RegionMatrix[rp(r, \"firstChild\")];\n } else {\n // Bottom Left quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr;\n }\n } else {\n if (\n NodeMatrix[np(n, \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Right quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 2;\n } else {\n // Bottom Right quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 3;\n }\n }\n\n // Update center of mass and mass (we only do it for non-leave regions)\n RegionMatrix[rp(r, \"massCenterX\")] =\n (RegionMatrix[rp(r, \"massCenterX\")] *\n RegionMatrix[rp(r, \"mass\")] +\n NodeMatrix[np(n, \"x\")] * NodeMatrix[np(n, \"mass\")]) /\n (RegionMatrix[rp(r, \"mass\")] +\n NodeMatrix[np(n, \"mass\")]);\n\n RegionMatrix[rp(r, \"massCenterY\")] =\n (RegionMatrix[rp(r, \"massCenterY\")] *\n RegionMatrix[rp(r, \"mass\")] +\n NodeMatrix[np(n, \"y\")] * NodeMatrix[np(n, \"mass\")]) /\n (RegionMatrix[rp(r, \"mass\")] +\n NodeMatrix[np(n, \"mass\")]);\n\n RegionMatrix[rp(r, \"mass\")] += NodeMatrix[np(n, \"mass\")];\n\n // Iterate on the right quadrant\n r = q;\n continue;\n } else {\n // There are no sub-regions: we are in a \"leave\"\n\n // Is there a node in this leave?\n if (RegionMatrix[rp(r, \"node\")] < 0) {\n // There is no node in region:\n // we record node n and go on\n RegionMatrix[rp(r, \"node\")] = n;\n break;\n } else {\n // There is a node in this region\n\n // We will need to create sub-regions, stick the two\n // nodes (the old one r[0] and the new one n) in two\n // subregions. If they fall in the same quadrant,\n // we will iterate.\n\n // Create sub-regions\n RegionMatrix[rp(r, \"firstChild\")] = l * W.ppr;\n w = RegionMatrix[rp(r, \"size\")] / 2; // new size (half)\n\n // NOTE: we use screen coordinates\n // from Top Left to Bottom Right\n\n // Top Left sub-region\n g = RegionMatrix[rp(r, \"firstChild\")];\n\n RegionMatrix[rp(g, \"node\")] = -1;\n RegionMatrix[rp(g, \"centerX\")] =\n RegionMatrix[rp(r, \"centerX\")] - w;\n RegionMatrix[rp(g, \"centerY\")] =\n RegionMatrix[rp(r, \"centerY\")] - w;\n RegionMatrix[rp(g, \"size\")] = w;\n RegionMatrix[rp(g, \"nextSibling\")] = g + W.ppr;\n RegionMatrix[rp(g, \"firstChild\")] = -1;\n RegionMatrix[rp(g, \"mass\")] = 0;\n RegionMatrix[rp(g, \"massCenterX\")] = 0;\n RegionMatrix[rp(g, \"massCenterY\")] = 0;\n\n // Bottom Left sub-region\n g += W.ppr;\n RegionMatrix[rp(g, \"node\")] = -1;\n RegionMatrix[rp(g, \"centerX\")] =\n RegionMatrix[rp(r, \"centerX\")] - w;\n RegionMatrix[rp(g, \"centerY\")] =\n RegionMatrix[rp(r, \"centerY\")] + w;\n RegionMatrix[rp(g, \"size\")] = w;\n RegionMatrix[rp(g, \"nextSibling\")] = g + W.ppr;\n RegionMatrix[rp(g, \"firstChild\")] = -1;\n RegionMatrix[rp(g, \"mass\")] = 0;\n RegionMatrix[rp(g, \"massCenterX\")] = 0;\n RegionMatrix[rp(g, \"massCenterY\")] = 0;\n\n // Top Right sub-region\n g += W.ppr;\n RegionMatrix[rp(g, \"node\")] = -1;\n RegionMatrix[rp(g, \"centerX\")] =\n RegionMatrix[rp(r, \"centerX\")] + w;\n RegionMatrix[rp(g, \"centerY\")] =\n RegionMatrix[rp(r, \"centerY\")] - w;\n RegionMatrix[rp(g, \"size\")] = w;\n RegionMatrix[rp(g, \"nextSibling\")] = g + W.ppr;\n RegionMatrix[rp(g, \"firstChild\")] = -1;\n RegionMatrix[rp(g, \"mass\")] = 0;\n RegionMatrix[rp(g, \"massCenterX\")] = 0;\n RegionMatrix[rp(g, \"massCenterY\")] = 0;\n\n // Bottom Right sub-region\n g += W.ppr;\n RegionMatrix[rp(g, \"node\")] = -1;\n RegionMatrix[rp(g, \"centerX\")] =\n RegionMatrix[rp(r, \"centerX\")] + w;\n RegionMatrix[rp(g, \"centerY\")] =\n RegionMatrix[rp(r, \"centerY\")] + w;\n RegionMatrix[rp(g, \"size\")] = w;\n RegionMatrix[rp(g, \"nextSibling\")] =\n RegionMatrix[rp(r, \"nextSibling\")];\n RegionMatrix[rp(g, \"firstChild\")] = -1;\n RegionMatrix[rp(g, \"mass\")] = 0;\n RegionMatrix[rp(g, \"massCenterX\")] = 0;\n RegionMatrix[rp(g, \"massCenterY\")] = 0;\n\n l += 4;\n\n // Now the goal is to find two different sub-regions\n // for the two nodes: the one previously recorded (r[0])\n // and the one we want to add (n)\n\n // Find the quadrant of the old node\n if (\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"x\")] <\n RegionMatrix[rp(r, \"centerX\")]\n ) {\n if (\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Left quarter\n q = RegionMatrix[rp(r, \"firstChild\")];\n } else {\n // Bottom Left quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr;\n }\n } else {\n if (\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Right quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 2;\n } else {\n // Bottom Right quarter\n q = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 3;\n }\n }\n\n // We remove r[0] from the region r, add its mass to r and record it in q\n RegionMatrix[rp(r, \"mass\")] =\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"mass\")];\n RegionMatrix[rp(r, \"massCenterX\")] =\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"x\")];\n RegionMatrix[rp(r, \"massCenterY\")] =\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"y\")];\n\n RegionMatrix[rp(q, \"node\")] =\n RegionMatrix[rp(r, \"node\")];\n RegionMatrix[rp(r, \"node\")] = -1;\n\n // Find the quadrant of n\n if (\n NodeMatrix[np(n, \"x\")] <\n RegionMatrix[rp(r, \"centerX\")]\n ) {\n if (\n NodeMatrix[np(n, \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Left quarter\n q2 = RegionMatrix[rp(r, \"firstChild\")];\n } else {\n // Bottom Left quarter\n q2 = RegionMatrix[rp(r, \"firstChild\")] + W.ppr;\n }\n } else {\n if (\n NodeMatrix[np(n, \"y\")] <\n RegionMatrix[rp(r, \"centerY\")]\n ) {\n // Top Right quarter\n q2 = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 2;\n } else {\n // Bottom Right quarter\n q2 = RegionMatrix[rp(r, \"firstChild\")] + W.ppr * 3;\n }\n }\n\n if (q === q2) {\n // If both nodes are in the same quadrant,\n // we have to try it again on this quadrant\n r = q;\n continue;\n }\n\n // If both quadrants are different, we record n\n // in its quadrant\n RegionMatrix[rp(q2, \"node\")] = n;\n break;\n }\n }\n }\n }\n }\n\n // 2) Repulsion\n //--------------\n // NOTES: adjustSizes = antiCollision & scalingRatio = coefficient\n\n if (W.settings.barnesHutOptimize) {\n coefficient = W.settings.scalingRatio;\n\n // Applying repulsion through regions\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n // Computing leaf quad nodes iteration\n\n r = 0; // Starting with root region\n while (true) {\n if (RegionMatrix[rp(r, \"firstChild\")] >= 0) {\n // The region has sub-regions\n\n // We run the Barnes Hut test to see if we are at the right distance\n distance = Math.sqrt(\n (NodeMatrix[np(n, \"x\")] -\n RegionMatrix[rp(r, \"massCenterX\")]) *\n (NodeMatrix[np(n, \"x\")] -\n RegionMatrix[rp(r, \"massCenterX\")]) +\n (NodeMatrix[np(n, \"y\")] -\n RegionMatrix[rp(r, \"massCenterY\")]) *\n (NodeMatrix[np(n, \"y\")] -\n RegionMatrix[rp(r, \"massCenterY\")])\n );\n\n if (\n 2 * RegionMatrix[rp(r, \"size\")] / distance <\n W.settings.barnesHutTheta\n ) {\n // We treat the region as a single body, and we repulse\n\n xDist =\n NodeMatrix[np(n, \"x\")] -\n RegionMatrix[rp(r, \"massCenterX\")];\n yDist =\n NodeMatrix[np(n, \"y\")] -\n RegionMatrix[rp(r, \"massCenterY\")];\n\n if (W.settings.adjustSizes) {\n //-- Linear Anti-collision Repulsion\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n, \"mass\")] *\n RegionMatrix[rp(r, \"mass\")] /\n distance /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n } else if (distance < 0) {\n factor =\n -coefficient *\n NodeMatrix[np(n, \"mass\")] *\n RegionMatrix[rp(r, \"mass\")] /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n }\n } else {\n //-- Linear Repulsion\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n, \"mass\")] *\n RegionMatrix[rp(r, \"mass\")] /\n distance /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n }\n }\n\n // When this is done, we iterate. We have to look at the next sibling.\n if (RegionMatrix[rp(r, \"nextSibling\")] < 0) break; // No next sibling: we have finished the tree\n r = RegionMatrix[rp(r, \"nextSibling\")];\n continue;\n } else {\n // The region is too close and we have to look at sub-regions\n r = RegionMatrix[rp(r, \"firstChild\")];\n continue;\n }\n } else {\n // The region has no sub-region\n // If there is a node r[0] and it is not n, then repulse\n\n if (\n RegionMatrix[rp(r, \"node\")] >= 0 &&\n RegionMatrix[rp(r, \"node\")] !== n\n ) {\n xDist =\n NodeMatrix[np(n, \"x\")] -\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"x\")];\n yDist =\n NodeMatrix[np(n, \"y\")] -\n NodeMatrix[np(RegionMatrix[rp(r, \"node\")], \"y\")];\n\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (W.settings.adjustSizes) {\n //-- Linear Anti-collision Repulsion\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n, \"mass\")] *\n NodeMatrix[\n np(RegionMatrix[rp(r, \"node\")], \"mass\")\n ] /\n distance /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n } else if (distance < 0) {\n factor =\n -coefficient *\n NodeMatrix[np(n, \"mass\")] *\n NodeMatrix[\n np(RegionMatrix[rp(r, \"node\")], \"mass\")\n ] /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n }\n } else {\n //-- Linear Repulsion\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n, \"mass\")] *\n NodeMatrix[\n np(RegionMatrix[rp(r, \"node\")], \"mass\")\n ] /\n distance /\n distance;\n\n NodeMatrix[np(n, \"dx\")] += xDist * factor;\n NodeMatrix[np(n, \"dy\")] += yDist * factor;\n }\n }\n }\n\n // When this is done, we iterate. We have to look at the next sibling.\n if (RegionMatrix[rp(r, \"nextSibling\")] < 0) break; // No next sibling: we have finished the tree\n r = RegionMatrix[rp(r, \"nextSibling\")];\n continue;\n }\n }\n }\n } else {\n coefficient = W.settings.scalingRatio;\n\n // Square iteration\n for (n1 = 0; n1 < W.nodesLength; n1 += W.ppn) {\n for (n2 = 0; n2 < n1; n2 += W.ppn) {\n // Common to both methods\n xDist = NodeMatrix[np(n1, \"x\")] - NodeMatrix[np(n2, \"x\")];\n yDist = NodeMatrix[np(n1, \"y\")] - NodeMatrix[np(n2, \"y\")];\n\n if (W.settings.adjustSizes) {\n //-- Anticollision Linear Repulsion\n distance =\n Math.sqrt(xDist * xDist + yDist * yDist) -\n NodeMatrix[np(n1, \"size\")] -\n NodeMatrix[np(n2, \"size\")];\n\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n1, \"mass\")] *\n NodeMatrix[np(n2, \"mass\")] /\n distance /\n distance;\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, \"dx\")] += xDist * factor;\n NodeMatrix[np(n1, \"dy\")] += yDist * factor;\n\n NodeMatrix[np(n2, \"dx\")] += xDist * factor;\n NodeMatrix[np(n2, \"dy\")] += yDist * factor;\n } else if (distance < 0) {\n factor =\n 100 *\n coefficient *\n NodeMatrix[np(n1, \"mass\")] *\n NodeMatrix[np(n2, \"mass\")];\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, \"dx\")] += xDist * factor;\n NodeMatrix[np(n1, \"dy\")] += yDist * factor;\n\n NodeMatrix[np(n2, \"dx\")] -= xDist * factor;\n NodeMatrix[np(n2, \"dy\")] -= yDist * factor;\n }\n } else {\n //-- Linear Repulsion\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (distance > 0) {\n factor =\n coefficient *\n NodeMatrix[np(n1, \"mass\")] *\n NodeMatrix[np(n2, \"mass\")] /\n distance /\n distance;\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, \"dx\")] += xDist * factor;\n NodeMatrix[np(n1, \"dy\")] += yDist * factor;\n\n NodeMatrix[np(n2, \"dx\")] -= xDist * factor;\n NodeMatrix[np(n2, \"dy\")] -= yDist * factor;\n }\n }\n }\n }\n }\n\n // 3) Gravity\n //------------\n g = W.settings.gravity / W.settings.scalingRatio;\n coefficient = W.settings.scalingRatio;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n factor = 0;\n\n // Common to both methods\n xDist = NodeMatrix[np(n, \"x\")];\n yDist = NodeMatrix[np(n, \"y\")];\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (W.settings.strongGravityMode) {\n //-- Strong gravity\n if (distance > 0)\n factor = coefficient * NodeMatrix[np(n, \"mass\")] * g;\n } else {\n //-- Linear Anti-collision Repulsion n\n if (distance > 0)\n factor =\n coefficient * NodeMatrix[np(n, \"mass\")] * g / distance;\n }\n\n // Updating node's dx and dy\n NodeMatrix[np(n, \"dx\")] -= xDist * factor;\n NodeMatrix[np(n, \"dy\")] -= yDist * factor;\n }\n\n // 4) Attraction\n //---------------\n coefficient =\n 1 *\n (W.settings.outboundAttractionDistribution\n ? outboundAttCompensation\n : 1);\n\n // TODO: simplify distance\n // TODO: coefficient is always used as -c --> optimize?\n for (e = 0; e < W.edgesLength; e += W.ppe) {\n n1 = EdgeMatrix[ep(e, \"source\")];\n n2 = EdgeMatrix[ep(e, \"target\")];\n w = EdgeMatrix[ep(e, \"weight\")];\n\n // Edge weight influence\n ewc = Math.pow(w, W.settings.edgeWeightInfluence);\n\n // Common measures\n xDist = NodeMatrix[np(n1, \"x\")] - NodeMatrix[np(n2, \"x\")];\n yDist = NodeMatrix[np(n1, \"y\")] - NodeMatrix[np(n2, \"y\")];\n\n // Applying attraction to nodes\n if (W.settings.adjustSizes) {\n distance =\n Math.sqrt(\n xDist * xDist +\n yDist * yDist -\n NodeMatrix[np(n1, \"size\")] -\n NodeMatrix[np(n2, \"size\")]\n ) - minNodeDistance;\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n //-- LinLog Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor =\n -coefficient *\n ewc *\n Math.log(1 + distance) /\n distance /\n NodeMatrix[np(n1, \"mass\")];\n }\n } else {\n //-- LinLog Anti-collision Attraction\n if (distance > 0) {\n factor =\n -coefficient *\n ewc *\n Math.log(1 + distance) /\n distance;\n }\n }\n } else {\n if (W.settings.outboundAttractionDistribution) {\n //-- Linear Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor =\n -coefficient * ewc / NodeMatrix[np(n1, \"mass\")];\n }\n } else {\n //-- Linear Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc;\n }\n }\n }\n } else {\n distance =\n Math.sqrt(xDist * xDist + yDist * yDist) - minNodeDistance;\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n //-- LinLog Degree Distributed Attraction\n if (distance > 0) {\n factor =\n -coefficient *\n ewc *\n Math.log(1 + distance) /\n distance /\n NodeMatrix[np(n1, \"mass\")];\n }\n } else {\n //-- LinLog Attraction\n if (distance > 0)\n factor =\n -coefficient *\n ewc *\n Math.log(1 + distance) /\n distance;\n }\n } else {\n if (W.settings.outboundAttractionDistribution) {\n //-- Linear Attraction Mass Distributed\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc / NodeMatrix[np(n1, \"mass\")];\n } else {\n //-- Linear Attraction\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc;\n }\n }\n }\n\n // Updating nodes' dx and dy\n // TODO: if condition or factor = 1?\n if (distance > 0) {\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, \"dx\")] += xDist * factor;\n NodeMatrix[np(n1, \"dy\")] += yDist * factor;\n\n NodeMatrix[np(n2, \"dx\")] -= xDist * factor;\n NodeMatrix[np(n2, \"dy\")] -= yDist * factor;\n }\n }\n\n // 5) Apply Forces\n //-----------------\n var force,\n swinging,\n traction,\n nodespeed,\n alldistance = 0;\n\n // MATH: sqrt and square distances\n if (W.settings.adjustSizes) {\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!NodeMatrix[np(n, \"fixed\")]) {\n force = Math.sqrt(\n NodeMatrix[np(n, \"dx\")] * NodeMatrix[np(n, \"dx\")] +\n NodeMatrix[np(n, \"dy\")] * NodeMatrix[np(n, \"dy\")]\n );\n\n if (force > W.maxForce) {\n NodeMatrix[np(n, \"dx\")] =\n NodeMatrix[np(n, \"dx\")] * W.maxForce / force;\n NodeMatrix[np(n, \"dy\")] =\n NodeMatrix[np(n, \"dy\")] * W.maxForce / force;\n }\n\n swinging =\n NodeMatrix[np(n, \"mass\")] *\n Math.sqrt(\n (NodeMatrix[np(n, \"old_dx\")] -\n NodeMatrix[np(n, \"dx\")]) *\n (NodeMatrix[np(n, \"old_dx\")] -\n NodeMatrix[np(n, \"dx\")]) +\n (NodeMatrix[np(n, \"old_dy\")] -\n NodeMatrix[np(n, \"dy\")]) *\n (NodeMatrix[np(n, \"old_dy\")] -\n NodeMatrix[np(n, \"dy\")])\n );\n\n traction =\n Math.sqrt(\n (NodeMatrix[np(n, \"old_dx\")] +\n NodeMatrix[np(n, \"dx\")]) *\n (NodeMatrix[np(n, \"old_dx\")] +\n NodeMatrix[np(n, \"dx\")]) +\n (NodeMatrix[np(n, \"old_dy\")] +\n NodeMatrix[np(n, \"dy\")]) *\n (NodeMatrix[np(n, \"old_dy\")] +\n NodeMatrix[np(n, \"dy\")])\n ) / 2;\n\n nodespeed =\n 0.1 * Math.log(1 + traction) / (1 + Math.sqrt(swinging));\n\n oldxDist = NodeMatrix[np(n, \"x\")];\n oldyDist = NodeMatrix[np(n, \"y\")];\n\n // Updating node's positon\n NodeMatrix[np(n, \"x\")] =\n NodeMatrix[np(n, \"x\")] +\n NodeMatrix[np(n, \"dx\")] *\n (nodespeed / W.settings.slowDown);\n NodeMatrix[np(n, \"y\")] =\n NodeMatrix[np(n, \"y\")] +\n NodeMatrix[np(n, \"dy\")] *\n (nodespeed / W.settings.slowDown);\n\n xDist = NodeMatrix[np(n, \"x\")];\n yDist = NodeMatrix[np(n, \"y\")];\n distance = Math.sqrt(\n (xDist - oldxDist) * (xDist - oldxDist) +\n (yDist - oldyDist) * (yDist - oldyDist)\n );\n alldistance += distance;\n }\n }\n } else {\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!NodeMatrix[np(n, \"fixed\")]) {\n swinging =\n NodeMatrix[np(n, \"mass\")] *\n Math.sqrt(\n (NodeMatrix[np(n, \"old_dx\")] -\n NodeMatrix[np(n, \"dx\")]) *\n (NodeMatrix[np(n, \"old_dx\")] -\n NodeMatrix[np(n, \"dx\")]) +\n (NodeMatrix[np(n, \"old_dy\")] -\n NodeMatrix[np(n, \"dy\")]) *\n (NodeMatrix[np(n, \"old_dy\")] -\n NodeMatrix[np(n, \"dy\")])\n );\n\n traction =\n Math.sqrt(\n (NodeMatrix[np(n, \"old_dx\")] +\n NodeMatrix[np(n, \"dx\")]) *\n (NodeMatrix[np(n, \"old_dx\")] +\n NodeMatrix[np(n, \"dx\")]) +\n (NodeMatrix[np(n, \"old_dy\")] +\n NodeMatrix[np(n, \"dy\")]) *\n (NodeMatrix[np(n, \"old_dy\")] +\n NodeMatrix[np(n, \"dy\")])\n ) / 2;\n\n nodespeed =\n NodeMatrix[np(n, \"convergence\")] *\n Math.log(1 + traction) /\n (1 + Math.sqrt(swinging));\n\n // Updating node convergence\n NodeMatrix[np(n, \"convergence\")] = Math.min(\n 1,\n Math.sqrt(\n nodespeed *\n (NodeMatrix[np(n, \"dx\")] * NodeMatrix[np(n, \"dx\")] +\n NodeMatrix[np(n, \"dy\")] * NodeMatrix[np(n, \"dy\")]) /\n (1 + Math.sqrt(swinging))\n )\n );\n\n oldxDist = NodeMatrix[np(n, \"x\")];\n oldyDist = NodeMatrix[np(n, \"y\")];\n\n // Updating node's positon\n NodeMatrix[np(n, \"x\")] =\n NodeMatrix[np(n, \"x\")] +\n NodeMatrix[np(n, \"dx\")] *\n (nodespeed / W.settings.slowDown);\n NodeMatrix[np(n, \"y\")] =\n NodeMatrix[np(n, \"y\")] +\n NodeMatrix[np(n, \"dy\")] *\n (nodespeed / W.settings.slowDown);\n\n xDist = NodeMatrix[np(n, \"x\")];\n yDist = NodeMatrix[np(n, \"y\")];\n distance = Math.sqrt(\n (xDist - oldxDist) * (xDist - oldxDist) +\n (yDist - oldyDist) * (yDist - oldyDist)\n );\n alldistance += distance;\n }\n }\n }\n\n // Counting one more iteration\n W.iterations++;\n\n // Auto stop.\n // The greater the ratio nb nodes / nb edges,\n // the greater the number of iterations needed to converge.\n if (W.settings.autoStop) {\n W.converged =\n W.iterations > W.settings.maxIterations ||\n alldistance / W.nodesLength < W.settings.avgDistanceThreshold;\n\n // align nodes that are linked to the same two nodes only:\n if (W.converged && W.settings.alignNodeSiblings) {\n // console.time(\"alignment\");\n\n var neighbors = {}, // index of neighbors\n parallelNodes = {}, // set of parallel nodes indexed by same <source;target>\n setKey, // tmp\n keysN; // tmp\n\n // build index of neighbors:\n for (e = 0; e < W.edgesLength; e += W.ppe) {\n n1 = EdgeMatrix[ep(e, \"source\")];\n n2 = EdgeMatrix[ep(e, \"target\")];\n\n if (n1 === n2) continue;\n\n neighbors[n1] = neighbors[n1] || {};\n neighbors[n2] = neighbors[n2] || {};\n neighbors[n1][n2] = true;\n neighbors[n2][n1] = true;\n }\n\n // group triplets by same <source, target> (resp. target, source):\n Object.keys(neighbors).forEach(function(n) {\n n = ~~n; // string to int\n keysN = Object.keys(neighbors[n]);\n if (keysN.length == 2) {\n setKey = keysN[0] + \";\" + keysN[1];\n if (setKey in parallelNodes) {\n parallelNodes[setKey].push(n);\n } else {\n setKey = keysN[1] + \";\" + keysN[0];\n if (!parallelNodes[setKey]) {\n parallelNodes[setKey] = [~~keysN[1], ~~keysN[0]];\n }\n parallelNodes[setKey].push(n);\n }\n }\n });\n\n var setNodes,\n setSource,\n setTarget,\n degSource,\n degTarget,\n sX,\n sY,\n tX,\n tY,\n t,\n distSourceTarget,\n intersectionPoint,\n normalVector,\n nNormaleVector,\n angle,\n angleMin = W.settings.nodeSiblingsAngleMin;\n\n Object.keys(parallelNodes).forEach(function(key) {\n setSource = parallelNodes[key].shift();\n setTarget = parallelNodes[key].shift();\n setNodes = parallelNodes[key].filter(function(setNode) {\n return !NodeMatrix[np(setNode, \"fixed\")];\n });\n\n if (setNodes.length == 1) return;\n\n sX = NodeMatrix[np(setSource, \"x\")];\n sY = NodeMatrix[np(setSource, \"y\")];\n tX = NodeMatrix[np(setTarget, \"x\")];\n tY = NodeMatrix[np(setTarget, \"y\")];\n\n // the extremity of lowest degree attracts the nodes\n // up to 1/4 of the distance:\n degSource = Object.keys(neighbors[setSource]).length;\n degTarget = Object.keys(neighbors[setTarget]).length;\n t = scaleRange(\n degSource / (degSource + degTarget),\n 0,\n 1,\n 1 / 4,\n 3 / 4\n );\n intersectionPoint = getPointOnLineSegment(\n sX,\n sY,\n tX,\n tY,\n t\n );\n\n // vector normal to the segment [source, target]:\n normalVector = getNormalVector(sX, sY, tX, tY);\n\n distSourceTarget = getDistance(sX, sY, tX, tY);\n\n // normalized normal vector:\n nNormaleVector = getNormalizedVector(\n normalVector,\n distSourceTarget\n );\n\n angle = getVectorAngle(nNormaleVector);\n\n // avoid horizontal vector because node labels overlap:\n if (2 * angleMin > Math.PI)\n throw new Error(\n \"ForceLink.Worker - Invalid parameter: angleMin must be smaller than 2 PI.\"\n );\n\n if (angleMin > 0) {\n // TODO layout parameter\n if (\n angle < angleMin ||\n (angle > Math.PI - angleMin && angle <= Math.PI)\n ) {\n // New vector of angle PI - angleMin\n nNormaleVector = {\n x: Math.cos(Math.PI - angleMin) * 2,\n y: Math.sin(Math.PI - angleMin) * 2\n };\n } else if (\n angle > 2 * Math.PI - angleMin ||\n (angle >= Math.PI && angle < Math.PI + angleMin)\n ) {\n // New vector of angle angleMin\n nNormaleVector = {\n x: Math.cos(angleMin) * 2,\n y: Math.sin(angleMin) * 2\n };\n }\n }\n\n // evenly distribute nodes along the perpendicular line to\n // [source, target] at the computed intersection point:\n var start = 0,\n sign = 1,\n steps = 1;\n\n if (setNodes.length % 2 == 1) {\n steps = 0;\n start = 1;\n }\n\n for (var i = 0; i < setNodes.length; i++) {\n NodeMatrix[np(setNodes[i], \"x\")] =\n intersectionPoint.x +\n sign *\n nNormaleVector.x *\n steps *\n (start || i >= 2\n ? W.settings.nodeSiblingsScale\n : W.settings.nodeSiblingsScale * 2 / 3);\n\n NodeMatrix[np(setNodes[i], \"y\")] =\n intersectionPoint.y +\n sign *\n nNormaleVector.y *\n steps *\n (start || i >= 2\n ? W.settings.nodeSiblingsScale\n : W.settings.nodeSiblingsScale * 2 / 3);\n\n sign = -sign;\n steps += (i + start) % 2;\n }\n });\n\n // console.timeEnd(\"alignment\");\n }\n }\n }", "function processImage(orgfilename){\n\n var destimg = filepath + output_directory + orgfilename;\n var orgimg = filepath + input_directory + orgfilename;\n\n cv.readImage(orgimg, function(err, im) {\n\n im.convertGrayscale();\n im_canny = im.copy();\n im_canny.canny(lowThresh, highThresh);\n im_canny.dilate(nIters);\n\n contours = im_canny.findContours();\n var points = [];\n\n console.log(\"contours size = \" + contours.size());\n\n for(i = 0; i < contours.size(); i++) {\n\n var area = contours.area(i);\n\n console.log(\"area\" + area);\n if(area < minArea)\n continue;\n\n var arcLength = contours.arcLength(i, true);\n contours.approxPolyDP(i, 0.01 * arcLength, true);\n\n if(contours.cornerCount(i) != 4)\n continue;\n\n // point coordinates\n var p0 = [contours.point(i, 0).x, contours.point(i, 0).y];\n var p1 = [contours.point(i, 1).x, contours.point(i, 1).y];\n var p2 = [contours.point(i, 2).x, contours.point(i, 2).y];\n var p3 = [contours.point(i, 3).x, contours.point(i, 3).y];\n\n var av_x = (p0[0] + p1[0] + p2[0] + p3[0])/4;\n var av_y = (p0[1] + p1[1] + p2[1] + p3[1])/4;\n\n points.push([av_x,av_y]);\n }\n\n var shape = new shapemaker();\n var data = {\n image_width: im_canny.width(),\n image_height: im_canny.height(),\n coordinates: points\n };\n\n console.log(points);\n\n shape.mask(data, orgimg, destimg, function(err, destimage){\n sb.send(\"output image\", \"string\", hosted_path + output_directory + orgfilename);\n });\n\n });\n}", "function bestInitialLayout(areas, params) {\n var initial = greedyLayout(areas, params);\n\n // greedylayout is sufficient for all 2/3 circle cases. try out\n // constrained MDS for higher order problems, take its output\n // if it outperforms. (greedy is aesthetically better on 2/3 circles\n // since it axis aligns)\n if (areas.length >= 8) {\n var constrained = constrainedMDSLayout(areas, params),\n constrainedLoss = lossFunction(constrained, areas),\n greedyLoss = lossFunction(initial, areas);\n\n if (constrainedLoss + 1e-8 < greedyLoss) {\n initial = constrained;\n }\n }\n return initial;\n }", "measure(availableSize) {\n // measure the element and find the desired size\n this.desiredBounds = undefined;\n let desired = undefined;\n let child;\n let childBounds;\n if (this.hasChildren()) {\n //Measuring the children\n for (let i = 0; i < this.children.length; i++) {\n child = this.children[i];\n if (child.horizontalAlignment === 'Stretch' && !availableSize.width) {\n availableSize.width = child.bounds.width;\n }\n if (child.verticalAlignment === 'Stretch' && !availableSize.height) {\n availableSize.height = child.bounds.height;\n }\n let force = child.horizontalAlignment === 'Stretch' || child.verticalAlignment === 'Stretch';\n if (this.measureChildren || force || (child instanceof Container && child.measureChildren !== undefined)) {\n child.measure(availableSize);\n }\n childBounds = this.GetChildrenBounds(child);\n if (child.horizontalAlignment !== 'Stretch' && child.verticalAlignment !== 'Stretch') {\n if (this.desiredBounds === undefined) {\n this.desiredBounds = childBounds;\n }\n else {\n this.desiredBounds.uniteRect(childBounds);\n }\n }\n else if (this.actualSize && !this.actualSize.width && !this.actualSize.height &&\n !child.preventContainer && child.horizontalAlignment === 'Stretch' && child.verticalAlignment === 'Stretch') {\n if (this.desiredBounds === undefined) {\n this.desiredBounds = child.bounds;\n }\n else {\n this.desiredBounds.uniteRect(child.bounds);\n }\n }\n }\n if (this.desiredBounds !== undefined && this.rotateAngle !== 0) {\n let offsetPt = {\n x: this.desiredBounds.x + this.desiredBounds.width * this.pivot.x,\n y: this.desiredBounds.y + this.desiredBounds.height * this.pivot.y\n };\n let newPoint = rotatePoint(this.rotateAngle, undefined, undefined, offsetPt);\n this.desiredBounds.x = newPoint.x - this.desiredBounds.width * this.pivot.x;\n this.desiredBounds.y = newPoint.y - this.desiredBounds.height * this.pivot.y;\n }\n if (this.desiredBounds) {\n desired = new Size(this.desiredBounds.width, this.desiredBounds.height);\n }\n }\n desired = this.validateDesiredSize(desired, availableSize);\n this.stretchChildren(desired);\n this.desiredSize = desired;\n return desired;\n }", "function I(){var e=p.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?e.width||p[t]:e.height||p[t]}", "locateArmoredBlock(\n text,\n offset,\n indentStr,\n beginIndexObj,\n endIndexObj,\n indentStrObj\n ) {\n EnigmailLog.DEBUG(\n \"armor.jsm: Enigmail.locateArmoredBlock: \" +\n offset +\n \", '\" +\n indentStr +\n \"'\\n\"\n );\n\n beginIndexObj.value = -1;\n endIndexObj.value = -1;\n\n var beginIndex = indexOfArmorDelimiter(\n text,\n indentStr + \"-----BEGIN PGP \",\n offset\n );\n\n if (beginIndex == -1) {\n var blockStart = text.indexOf(\"-----BEGIN PGP \");\n if (blockStart >= 0) {\n var indentStart = text.search(/\\n.*-----BEGIN PGP /) + 1;\n indentStrObj.value = text.substring(indentStart, blockStart);\n indentStr = indentStrObj.value;\n beginIndex = indexOfArmorDelimiter(\n text,\n indentStr + \"-----BEGIN PGP \",\n offset\n );\n }\n }\n\n if (beginIndex == -1) {\n return \"\";\n }\n\n // Locate newline at end of armor header\n offset = text.indexOf(\"\\n\", beginIndex);\n\n if (offset == -1) {\n return \"\";\n }\n\n var endIndex = indexOfArmorDelimiter(\n text,\n indentStr + \"-----END PGP \",\n offset\n );\n\n if (endIndex == -1) {\n return \"\";\n }\n\n // Locate newline at end of PGP block\n endIndex = text.indexOf(\"\\n\", endIndex);\n\n if (endIndex == -1) {\n // No terminating newline\n endIndex = text.length - 1;\n }\n\n var blockHeader = text.substr(beginIndex, offset - beginIndex + 1);\n\n let escapedIndentStr = indentStr.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n var blockRegex = new RegExp(\n \"^\" + escapedIndentStr + \"-----BEGIN PGP (.{1,30})-----\\\\s*\\\\r?\\\\n\"\n );\n\n var matches = blockHeader.match(blockRegex);\n\n var blockType = \"\";\n if (matches && matches.length > 1) {\n blockType = matches[1];\n EnigmailLog.DEBUG(\n \"armor.jsm: Enigmail.locateArmoredBlock: blockType=\" + blockType + \"\\n\"\n );\n }\n\n if (blockType == \"UNVERIFIED MESSAGE\") {\n // Skip any unverified message block\n return EnigmailArmor.locateArmoredBlock(\n text,\n endIndex + 1,\n indentStr,\n beginIndexObj,\n endIndexObj,\n indentStrObj\n );\n }\n\n beginIndexObj.value = beginIndex;\n endIndexObj.value = endIndex;\n\n return blockType;\n }", "function centerReg(obj){\n\tobj.regX=obj.image.naturalWidth/2;\n\tobj.regY=obj.image.naturalHeight/2;\n}", "function greedyLayout(areas, params) {\n var loss = params && params.lossFunction ? params.lossFunction : lossFunction;\n // define a circle for each set\n var circles = {}, setOverlaps = {}, set;\n for (var i = 0; i < areas.length; ++i) {\n var area = areas[i];\n if (area.sets.length == 1) {\n set = area.sets[0];\n circles[set] = {x: 1e10, y: 1e10,\n rowid: circles.length,\n size: area.size,\n radius: Math.sqrt(area.size / Math.PI)};\n setOverlaps[set] = [];\n }\n }\n areas = areas.filter(function(a) { return a.sets.length == 2; });\n\n // map each set to a list of all the other sets that overlap it\n for (i = 0; i < areas.length; ++i) {\n var current = areas[i];\n var weight = current.hasOwnProperty('weight') ? current.weight : 1.0;\n var left = current.sets[0], right = current.sets[1];\n\n // completely overlapped circles shouldn't be positioned early here\n if (current.size + SMALL$1 >= Math.min(circles[left].size,\n circles[right].size)) {\n weight = 0;\n }\n\n setOverlaps[left].push ({set:right, size:current.size, weight:weight});\n setOverlaps[right].push({set:left, size:current.size, weight:weight});\n }\n\n // get list of most overlapped sets\n var mostOverlapped = [];\n for (set in setOverlaps) {\n if (setOverlaps.hasOwnProperty(set)) {\n var size = 0;\n for (i = 0; i < setOverlaps[set].length; ++i) {\n size += setOverlaps[set][i].size * setOverlaps[set][i].weight;\n }\n\n mostOverlapped.push({set: set, size:size});\n }\n }\n\n // sort by size desc\n function sortOrder(a,b) {\n return b.size - a.size;\n }\n mostOverlapped.sort(sortOrder);\n\n // keep track of what sets have been laid out\n var positioned = {};\n function isPositioned(element) {\n return element.set in positioned;\n }\n\n // adds a point to the output\n function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }\n\n // add most overlapped set at (0,0)\n positionSet({x: 0, y: 0}, mostOverlapped[0].set);\n\n // get distances between all points. TODO, necessary?\n // answer: probably not\n // var distances = venn.getDistanceMatrices(circles, areas).distances;\n for (i = 1; i < mostOverlapped.length; ++i) {\n var setIndex = mostOverlapped[i].set,\n overlap = setOverlaps[setIndex].filter(isPositioned);\n set = circles[setIndex];\n overlap.sort(sortOrder);\n\n if (overlap.length === 0) {\n // this shouldn't happen anymore with addMissingAreas\n throw \"ERROR: missing pairwise overlap information\";\n }\n\n var points = [];\n for (var j = 0; j < overlap.length; ++j) {\n // get appropriate distance from most overlapped already added set\n var p1 = circles[overlap[j].set],\n d1 = distanceFromIntersectArea(set.radius, p1.radius,\n overlap[j].size);\n\n // sample positions at 90 degrees for maximum aesthetics\n points.push({x : p1.x + d1, y : p1.y});\n points.push({x : p1.x - d1, y : p1.y});\n points.push({y : p1.y + d1, x : p1.x});\n points.push({y : p1.y - d1, x : p1.x});\n\n // if we have at least 2 overlaps, then figure out where the\n // set should be positioned analytically and try those too\n for (var k = j + 1; k < overlap.length; ++k) {\n var p2 = circles[overlap[k].set],\n d2 = distanceFromIntersectArea(set.radius, p2.radius,\n overlap[k].size);\n\n var extraPoints = circleCircleIntersection(\n { x: p1.x, y: p1.y, radius: d1},\n { x: p2.x, y: p2.y, radius: d2});\n\n for (var l = 0; l < extraPoints.length; ++l) {\n points.push(extraPoints[l]);\n }\n }\n }\n\n // we have some candidate positions for the set, examine loss\n // at each position to figure out where to put it at\n var bestLoss = 1e50, bestPoint = points[0];\n for (j = 0; j < points.length; ++j) {\n circles[setIndex].x = points[j].x;\n circles[setIndex].y = points[j].y;\n var localLoss = loss(circles, areas);\n if (localLoss < bestLoss) {\n bestLoss = localLoss;\n bestPoint = points[j];\n }\n }\n\n positionSet(bestPoint, setIndex);\n }\n\n return circles;\n}", "get alignment() {}", "function match_pattern_at(state, pattern, player, x, y) {\n if(x >= 0 && x < state.length) {\n if(y >= 0 && y < state[x].length) {\n var element = pattern[0];\n // Check whether the type of the part is 'p'\n if(element[0] == 'p') {\n if(state[x][y] !== player) {\n return false;\n }\n } else if(element[0] == ' '){ // Check whether that the square is empty\n if(state[x][y] !== undefined) {\n return false;\n }\n }\n /*\n Check whether the pattern has more than one component in, if so then all the components\n in the pattern have not been matched so therefore call the function to check the rest of the pattern.\n The x and y cooridates are updated with the patterns second and third. If there is just one element in the pattern\n then therefore we know the pattern has matched so return true.\n */\n if(pattern.length > 1) {\n return match_pattern_at(state, pattern.slice(1), player, x + element[1], y + element[2])\n } else {\n return true;\n }\n }\n }\n return false;\n}", "function binaryPlacement(pEn,pKay,set,pItemSet,writtenTo)\n{\n this.inPosition =[];\n this.itemSet=pItemSet;\n this.kay=pKay;\n this.en=pEn;\n var low = ((this.en-this.kay)>this.kay)?this.kay:this.en-this.kay;\n var top = en-low;\n var curPosCapt =writtenTo.slice();\n var lastStart=[0]\n var aftFirst = false;\n\nfor (var cA=0;cA<set.length;cA++)\n {\n if (cA<low)\n {\n curPosCapt[set[cA]]=this.itemSet[0];\n }\n else\n {\n curPosCapt[set[cA]]=this.itemSet[1];\n }\n }\n \n if (this.en==this.kay)\n {\n return curPosCapt.slice();\n }\n \nfunction BAForRep(start,pSet,aftFirst,leve,leveA,lastStart,curPosCapt)\n//function BAForRep(start,pSet,aftFirst,en,leve,leveA,lastStart,curPosCapt)\n{\n //if we are at last row\n if(leve==this.kay-1)\n {\n for (var cj=start;cj<(this.en-this.kay+leve+1);cj++)\n {\n if ((cj==(this.kay-1))&&(leve==(this.kay-1)))\n {\n aftFirst = false\n }\n else\n {\n aftFirst = true;\n }\n curPosCapt[pSet[cj]]=this.itemSet[0];\n \n// Logger.log(\"content: \"+apArray[apArray.length-1]+ \"ref : \"+(apArray.length-1)+\" dif : \"+(apArray[apArray.length-1]-(apArray.length-1))+\"boolean :\"+aftFirst)\n// if (apArray[apArray.length-1]>(apArray.length-1))\n if (aftFirst)\n {\n if (cj==start)\n {\n for (var cp=cj-leve-1;cp<(this.en-this.kay);cp++)\n if(cp==cj-leve-1)\n {\n curPosCapt[cp+(leve-1)-lastStart[0]]=this.itemSet[1];\n }\n else\n {\n curPosCapt[pSet[cp+this.kay]]=this.itemSet[1];\n }\n }\n else\n {\n curPosCapt[pSet[cj-1]]=this.itemSet[1];\n }\n }\n this.inPosition.push(curPosCapt.slice());\n }\n if (start==(this.en-1))\n {\n lastStart[0]=lastStart[0]+1;\n var int = 5;\n }\n else\n {\n lastStart[0]=0;\n }\n }\n else\n {\n //on any call the start value is the value at the current level\n start=leveA;\n //starting at that value go up to the en - length+leve +1\n for (var ck=start;ck<(this.en-this.kay+leve+1);ck++)\n {\n //write the counter value to this level position\n leveA++;\n curPosCapt[pSet[ck]]=this.itemSet[0];\n //call the next level with this one holding array that\n //has just been fed ck.\n //increase level by one and\n //make the value one higher\n BAForRep(ck+1,pSet,aftFirst,leve+1,leveA,lastStart,curPosCapt)\n// BAForRep(ck+1,pSet,aftFirst,en,leve+1,leveA,lastStart,curPosCapt)\n //after we have written arrays for the last level\n //we will snap back at each level\n //and we run the ascending sequence to the end\n for (var cm=leve+1;cm<this.kay-1;cm++)\n {\n curPosCapt[pSet[ck+(cm-leve)+1]]=this.itemSet[0];\n }\n }\n }\n}\n\n BAForRep(0,set,aftFirst,0,0,lastStart,curPosCapt.slice());\n// BAForRep(0,set,aftFirst,en,0,0,lastStart,curPosCapt.slice());\n// if (this.splitB)\n// {\n// return [this.captureF,this.captureS,this.inPosition];\n// }\n// else\n// {\n// return [capture,this.inPosition];\n return this.inPosition;\n\n// }\n}", "alignmentOffset() {\n // Get the absolute x coordinate position of the tooltip.\n const absoluteX = document.getElementById(this.props.columnTooltip.get('columnName') + '-QuestionMark').getBoundingClientRect().left -\n (window.innerWidth - this.props.viewport.get('x'))/2 +\n Constants.getIn(['questionMark', 'size'])/2\n\n // Check if the tooltip can be fully displayed within the viewport.\n if(absoluteX + Constants.getIn(['columnTooltip', 'width']) > this.props.viewport.get('x')) \n return Constants.getIn(['columnTooltip', 'width'])\n\n // No offset is needed otherwise.\n return 0\n }", "getAlignment(center, num, width, gap, index) {\n\t\treturn center + width*(index+1-(num+1)/2) + gap*(index-(num-1)/2)\n\t}", "function alignLayersByContent( alignMethod )\n{\n\tvar desc = new ActionDescriptor();\n\tvar ref = new ActionReference();\n\t\n\talignMethod = stringToAlignmentKey( alignMethod );\n\tif (! alignMethod)\n\t\talignMethod = keyPerspectiveIndex;\n\n\tref.putEnumerated( classLayer, typeOrdinal, enumTarget );\n\tdesc.putReference( typeNULL, ref );\n\tdesc.putEnumerated( keyUsing, typeAlignDistributeSelector, kADSContentStr );\n\tdesc.putEnumerated( keyApply, kprojectionStr, alignMethod );\n\t\t\n\texecuteAction( keyAlignment, desc, DialogModes.NO );\n}", "function drawExtra(patternName, grid, row, col){\r\n if (patternName === \"Infected\") {\r\n if (drawWithin) {\r\n col = randX(2);\r\n row = randY(2);\r\n }\r\n drawInfectedBlock(grid, row, col);\r\n }\r\n\r\n if (patternName === \"Mine\") {\r\n drawMine(grid, row, col);\r\n }\r\n\r\n if (patternName === \"Pacman\") {\r\n var randRow = Math.floor(Math.random() * 191879) % (NUM_ROWS - 12)\r\n //check position just to be sure\r\n //and change nothing but its ticker and variation\r\n if (validPosition(randRow, 0)) {\r\n grid[randRow][0].variation = \"pacmanCore\";\r\n grid[randRow][0].ticker = 1;\r\n }\r\n }\r\n if (patternName === \"Snake\") {\r\n drawSnake(grid, row, col);\r\n }\r\n staticUpdateCells(grid);\r\n }", "function computePackInfo(imgInfoList, cb) {\n\n var compute = function(width, height, imgInfoList) {\n\n var out = false;\n\n for (var n = 0; n < imgInfoList.length; n++) {\n var f = imgInfoList[n];\n delete f.fit;\n }\n\n var packer = new Packer(width, height);\n packer.fit(imgInfoList);\n for (var n = 0; n < imgInfoList.length; n++) {\n var f = imgInfoList[n];\n if (f.fit) {\n // 'image Over 100,100 225,225 image.jpg'\n var x = f.fit.x + Config.imgSpace / 2,\n y = f.fit.y + Config.imgSpace / 2;\n // var w = f.fit.w - Config.imgSpace,\n // h = f.fit.h - Config.imgSpace;\n f.x = f.fit.x;\n f.y = f.fit.y;\n delete f.fit;\n } else {\n out = true;\n break;\n }\n }\n return out;\n };\n\n var width = Config.packageWidth;\n var height = Config.packageHeight;\n\n\n\n do {\n var expanded = false,\n out = false;\n\n imgInfoList.sort(function(a, b) {\n return b.h - a.h;\n });\n out = compute(width, height, imgInfoList);\n\n if (out) {\n imgInfoList.sort(function(a, b) {\n return b.w - a.w;\n });\n out = compute(width, height, imgInfoList);\n }\n\n if (out) {\n if (width <= height) {\n width = width * 2;\n } else {\n height = height * 2;\n }\n expanded = true;\n }\n } while (expanded);\n return [width, height];\n}", "function greedyLayout(areas, params) {\n var loss = params && params.lossFunction ? params.lossFunction : lossFunction; // define a circle for each set\n\n var circles = {},\n setOverlaps = {},\n set;\n\n for (var i = 0; i < areas.length; ++i) {\n var area = areas[i];\n\n if (area.sets.length == 1) {\n set = area.sets[0];\n circles[set] = {\n x: 1e10,\n y: 1e10,\n rowid: circles.length,\n size: area.size,\n radius: Math.sqrt(area.size / Math.PI)\n };\n setOverlaps[set] = [];\n }\n }\n\n areas = areas.filter(function (a) {\n return a.sets.length == 2;\n }); // map each set to a list of all the other sets that overlap it\n\n for (i = 0; i < areas.length; ++i) {\n var current = areas[i];\n var weight = current.hasOwnProperty('weight') ? current.weight : 1.0;\n var left = current.sets[0],\n right = current.sets[1]; // completely overlapped circles shouldn't be positioned early here\n\n if (current.size + SMALL$1 >= Math.min(circles[left].size, circles[right].size)) {\n weight = 0;\n }\n\n setOverlaps[left].push({\n set: right,\n size: current.size,\n weight: weight\n });\n setOverlaps[right].push({\n set: left,\n size: current.size,\n weight: weight\n });\n } // get list of most overlapped sets\n\n\n var mostOverlapped = [];\n\n for (set in setOverlaps) {\n if (setOverlaps.hasOwnProperty(set)) {\n var size = 0;\n\n for (i = 0; i < setOverlaps[set].length; ++i) {\n size += setOverlaps[set][i].size * setOverlaps[set][i].weight;\n }\n\n mostOverlapped.push({\n set: set,\n size: size\n });\n }\n } // sort by size desc\n\n\n function sortOrder(a, b) {\n return b.size - a.size;\n }\n\n mostOverlapped.sort(sortOrder); // keep track of what sets have been laid out\n\n var positioned = {};\n\n function isPositioned(element) {\n return element.set in positioned;\n } // adds a point to the output\n\n\n function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n } // add most overlapped set at (0,0)\n\n\n positionSet({\n x: 0,\n y: 0\n }, mostOverlapped[0].set); // get distances between all points. TODO, necessary?\n // answer: probably not\n // var distances = venn.getDistanceMatrices(circles, areas).distances;\n\n for (i = 1; i < mostOverlapped.length; ++i) {\n var setIndex = mostOverlapped[i].set,\n overlap = setOverlaps[setIndex].filter(isPositioned);\n set = circles[setIndex];\n overlap.sort(sortOrder);\n\n if (overlap.length === 0) {\n // this shouldn't happen anymore with addMissingAreas\n throw \"ERROR: missing pairwise overlap information\";\n }\n\n var points = [];\n\n for (var j = 0; j < overlap.length; ++j) {\n // get appropriate distance from most overlapped already added set\n var p1 = circles[overlap[j].set],\n d1 = distanceFromIntersectArea(set.radius, p1.radius, overlap[j].size); // sample positions at 90 degrees for maximum aesthetics\n\n points.push({\n x: p1.x + d1,\n y: p1.y\n });\n points.push({\n x: p1.x - d1,\n y: p1.y\n });\n points.push({\n y: p1.y + d1,\n x: p1.x\n });\n points.push({\n y: p1.y - d1,\n x: p1.x\n }); // if we have at least 2 overlaps, then figure out where the\n // set should be positioned analytically and try those too\n\n for (var k = j + 1; k < overlap.length; ++k) {\n var p2 = circles[overlap[k].set],\n d2 = distanceFromIntersectArea(set.radius, p2.radius, overlap[k].size);\n var extraPoints = circleCircleIntersection({\n x: p1.x,\n y: p1.y,\n radius: d1\n }, {\n x: p2.x,\n y: p2.y,\n radius: d2\n });\n\n for (var l = 0; l < extraPoints.length; ++l) {\n points.push(extraPoints[l]);\n }\n }\n } // we have some candidate positions for the set, examine loss\n // at each position to figure out where to put it at\n\n\n var bestLoss = 1e50,\n bestPoint = points[0];\n\n for (j = 0; j < points.length; ++j) {\n circles[setIndex].x = points[j].x;\n circles[setIndex].y = points[j].y;\n var localLoss = loss(circles, areas);\n\n if (localLoss < bestLoss) {\n bestLoss = localLoss;\n bestPoint = points[j];\n }\n }\n\n positionSet(bestPoint, setIndex);\n }\n\n return circles;\n }", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x);\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / Match_Distance);\n }", "getDotPatternSize() {\n //const { width } = this.getWindowDimensions();\n return 28; // 28 for all for now\n }", "getNextValidPosition(inX, inY, state, stateHoriz, stateVert, currWord, lastOrientation){\n let valid = false;\n let currX = -1;\n let currY = -1;\n let newX = -1;\n let newY = -1;\n let partialScore = 0;\n\n let x = -1;\n let y = -1;\n let res = null;\n let flagBreak = false;\n if (lastOrientation == VERTICAL){\n inY = inY + 1;\n lastOrientation = null;\n }\n let currPosLetter = null;\n for (y = inY; y < state.sizeY; y++) { \n for (x = inX; x < state.sizeX; x++) {\n // Simple first test, to see if the position can be used, and cut the processing weight.\n // We will see if the position is not Empty and if it has a different letter then our first letter.\n currPosLetter = state.board[x][y];\n if ( (currPosLetter != EMPTY) && currPosLetter != currWord[0] ){\n continue;\n }\n if ((lastOrientation == null) || (lastOrientation != HORIZONTAL)){\n // Generate Horizontally placement.\n lastOrientation = HORIZONTAL;\n // Test if word can fit horizontally until the end.\n if (x < state.sizeX - currWord.length){\n [res, partialScore] = this.canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n if (lastOrientation == HORIZONTAL){\n // Generate Vertical placement.\n lastOrientation = VERTICAL;\n // Test if word can fit vertically until the bottom.\n if (y < state.sizeY - currWord.length){\n [res, partialScore] = this.canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n }\n if (flagBreak)\n break;\n }\n\n if ((res != null) && (res == true)){\n valid = true;\n currX = x;\n currY = y;\n newX = x;\n newY = y;\n }\n\n return [valid, currX, currY, newX, newY, lastOrientation, partialScore];\n }", "function findSmallestWidthAlignment(g, xss) {\n\t return _.minBy(_.values(xss), function (xs) {\n\t var max = Number.NEGATIVE_INFINITY;\n\t var min = Number.POSITIVE_INFINITY;\n\n\t _.forIn(xs, function (x, v) {\n\t var halfWidth = width(g, v) / 2;\n\t max = Math.max(x + halfWidth, max);\n\t min = Math.min(x - halfWidth, min);\n\t });\n\n\t return max - min;\n\t });\n\t }", "function patternCheck(pattern, targetCell, qualityGoal, weight) {\n if (compass >= 0) { // already set\n\treturn (patternCheckOrientation(pattern, targetCell, qualityGoal, weight, compass));\n } else {\n\tvar mismatch;\n\tfor (var o = 0; o < TOTAL_NBRS; o += 2) {\n\t debugme(\"patternCheck: hunting for compass (now \" + compass + \") at \" + o);\n\t mismatch = patternCheckOrientation(pattern, targetCell, qualityGoal, weight, o);\n\t debugme(\"-> got mismatch \" + mismatch + \" and compass \" + compass);\n\t if (compass >= 0) {\n\t\treturn mismatch;\n\t }\n\t}\n\treturn PAT_NOMATCH;\n }\n}", "findGridLimits () {\n let residue = this.getResidueProxy()\n let atom = this.getAtomProxy()\n for (let iRes = 0; iRes < this.getResidueCount(); iRes += 1) {\n residue.iRes = iRes\n if (residue.ss === 'G') {\n atom.iAtom = residue.iAtom\n if (!(atom.elem in this.grid.isElem)) {\n this.grid.isElem[atom.elem] = true\n }\n if (this.grid.bMin === null) {\n this.grid.bMin = atom.bfactor\n this.grid.bMax = atom.bfactor\n } else {\n if (atom.bfactor > this.grid.bMax) {\n this.grid.bMax = atom.bfactor\n }\n if (atom.bfactor < this.grid.bMin) {\n this.grid.bMin = atom.bfactor\n }\n }\n }\n }\n\n if (this.grid.bMin === null) {\n this.grid.bMin = 0\n }\n if (this.grid.bMax === null) {\n this.grid.bMin = 0\n }\n this.grid.bCutoff = this.grid.bMin\n }", "elevation(x, y) {\n // taper map edges to 0 to create a continent\n //0,0 - 256,192 ?\n //const mapWidth = 256; //16*16\n //const mapHeight = 192; //12*16\n let n = this.noise(x, y);\n if (n === 2) {\n if (this.randomizer.valueFor(x, y) < 0.15) {\n return 6; // tree\n }\n }\n return n;\n }", "function q(){var e=p.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||p[t]:e.height||p[t]}", "function getOffsets(size) {\n //THIS FUNCTION IS SO UGLY IM SO SORRY\n let wO = (size * 1.732050808 / 2);\n let hO = size;\n let ans = [];\n\n let startingY = 50 - 2 * (hO * .75);\n let startingX = 50 - wO;\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 - 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50;\n startingX = 50 - wO * (2);\n\n for (let i = 0; i < 5; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n\n\n startingY = 50 + 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 + 2 * (hO * .75);\n startingX = 50 - wO;\n\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n return ans;\n}", "function momentNormalize() {\n\t\t\t\n\t\tnewHeight = 256;\n\t\tnewWidth = 256;\n\t\txMin = 256;\n\t\txMax = 0;\n\t\tyMin = 256;\n\t\tyMax = 0;\n\t\t// first determine drawn character width / length\n\t\tfor(var i = 0;i<recordedPattern.length;i++) {\n\t\t var stroke_i = recordedPattern[i];\n\t\t for(var j = 0; j<stroke_i.length;j++) {\n\t\t\tx = stroke_i[j][0];\n\t\t\ty = stroke_i[j][1];\n\t\t\tif(x < xMin) {\n\t\t\t xMin = x;\n\t\t\t}\n\t\t\tif(x > xMax) {\n\t\t\t xMax = x;\n\t\t\t}\n\t\t\tif(y < yMin) {\n\t\t\t yMin = y;\n\t\t\t}\n\t\t\tif(y > yMax) {\n\t\t\t yMax = y;\n\t\t\t}\n\t\t }\n\t\t}\t\n\t\toldHeight = Math.abs(yMax - yMin);\n\t\toldWidth = Math.abs(xMax - xMin);\n\t\t\t\n\t\tvar r2 = aran(oldWidth, oldHeight);\n\t\t\n\t\tvar aranWidth = newWidth;\n\t\tvar aranHeight = newHeight;\n\t\t\n\t\tif(oldHeight > oldWidth) {\n\t\t\taranWidth = r2 * newWidth; \n\t\t} else {\n\t\t\taranHeight = r2 * newHeight;\n\t\t}\t\t\n\t\t\t\t\n\t\tvar xOffset = (newWidth - aranWidth)/2;\n\t\tvar yOffset = (newHeight - aranHeight)/2; \n\t\t\n\t\tvar m00_ = m00(recordedPattern);\n\t\tvar m01_ = m01(recordedPattern);\n\t\tvar m10_ = m10(recordedPattern);\n\t\t\t\t\n\t\tvar xc_ = (m10_/m00_);\n\t\tvar yc_ = (m01_/m00_);\n\t\t\t\t\n\t\tvar xc_half = aranWidth/2;\n\t\tvar yc_half = aranHeight/2;\n\t\t\n\t\tvar mu20_ = mu20(recordedPattern, xc_);\n\t\tvar mu02_ = mu02(recordedPattern, yc_);\n\n\t\tvar alpha = (aranWidth) / (4 * Math.sqrt(mu20_/m00_));\n\t\tvar beta = (aranHeight) / (4 * Math.sqrt(mu02_/m00_));\n\t\t\t\n\t\tvar nf = new Array();\n\t\tfor(var i=0;i<recordedPattern.length;i++) {\n\t\t\tvar si = recordedPattern[i];\n\t\t\tvar nsi = new Array();\n\t\t\tfor(var j=0;j<si.length;j++) {\n\t\t\t\t\n\t\t\t\tvar newX = (alpha * (si[j][0] - xc_) + xc_half);\n\t\t\t\tvar newY = (beta * (si[j][1] - yc_) + yc_half);\n\t\t\t\t\n\t\t\t\tnsi.push([newX,newY]);\n\t\t\t}\n\t\t\tnf.push(nsi);\n\t\t}\n\n\t\treturn transform(nf, xOffset, yOffset);\n\t}", "getRangeOfAlignedPlanes(transform, result) {\n const idMatrix = Matrix3d_1.Matrix3d.createIdentity();\n const bigRange = Range_1.Range3d.createXYZXYZ(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const range = bigRange.clone(result);\n for (const clipPlane of this._planes) {\n if (transform)\n clipPlane.transformInPlace(transform);\n // Array of 1-d ranges that will be pieced back together into a Range3d after making adjustments\n const rangePieces = [\n Range_1.Range1d.createXX(range.low.x, range.high.x),\n Range_1.Range1d.createXX(range.low.y, range.high.y),\n Range_1.Range1d.createXX(range.low.z, range.high.z)\n ];\n for (let i = 0; i < 3; i++) {\n // Set values of minP and maxP based on i (we are compensating for pointer arithmetic in native code)\n let minP;\n let maxP;\n minP = rangePieces[i].low;\n maxP = rangePieces[i].high;\n const direction = idMatrix.getColumn(i);\n if (clipPlane.inwardNormalRef.isParallelTo(direction, true)) {\n if (clipPlane.inwardNormalRef.dotProduct(direction) > 0.0) {\n if (clipPlane.distance > minP)\n rangePieces[i].low = clipPlane.distance;\n }\n else {\n if (-clipPlane.distance < maxP)\n rangePieces[i].high = -clipPlane.distance;\n }\n }\n }\n // Reassign to Range3d\n range.low.x = rangePieces[0].low;\n range.high.x = rangePieces[0].high;\n range.low.y = rangePieces[1].low;\n range.high.y = rangePieces[1].high;\n range.low.z = rangePieces[2].low;\n range.high.z = rangePieces[2].high;\n }\n if (range.isAlmostEqual(bigRange))\n return undefined;\n else\n return range;\n }", "function sizeInfoPanelImage(plane) {\n var sizedImage = getImageDims(plane.img, plane.imgFolder).then(imgInfo => {\n var result = plane;\n var multiplier = 0.81 / imgInfo.height;\n result.imgHeight = imgInfo.height * multiplier;\n result.imgWidth = imgInfo.width * multiplier;\n result.imgWidth = plane.imgWidth.toString();\n result.imgHeight = plane.imgHeight.toString();\n return result;\n });\n\n return sizedImage;\n}", "function edgeAlignMaxSpace(amin, amax, pmin, pmax, space) {\n var rspace = space - amax;\n var lspace = amin;\n return rspace <= lspace ? amax - pmax : amin - pmin;\n}", "function findSize(lyr) {\n var res = [];\n\n var exp = \"var obj = thisLayer.sourceRectAtTime();\\\n [obj.width,obj.height]\";\n var tempProp = lyr(\"ADBE Effect Parade\").addProperty(\"ADBE Point Control\");\n tempProp(1).expression = exp;\n res = tempProp(1).valueAtTime(0,false);\n tempProp.remove(); \n return res;\n }", "function patternCheckOrientation(pattern, targetCell, qualityGoal, weight, orientation) {\n var forwardFacingCells = FWD_CELLS[targetCell];\n var totalDiscrepancies = 0;\n DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"Enter pCO([\" + pattern + \"]; \" + targetCell + \", \" + qualityGoal + \", \" + weight + \", \" + orientation + \"); compass: \" + compass);\n fwdWrong = [];\n rearWrong = [];\n if ((Array.isArray(pattern[POS_CENTER]) && !pattern[POS_CENTER][myColor]) ||\n\t((pattern[POS_CENTER] > 0) && (myColor != pattern[POS_CENTER]))) {\n\tif (forwardFacingCells[POS_CENTER]) { // always true, in fact\n\t fwdWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += 1;\n\t} else {\n\t rearWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += weight;\n\t}\n }\n if ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\tDEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\treturn PAT_NOMATCH;\n }\n var jFrom = 0;\n switch (targetCell) {\n case AIM_UP:\n\tjFrom = 4;\n\tbreak;\n case AIM_LEFT:\n\tjFrom = 6;\n\tbreak;\n case AIM_RIGHT:\n\tjFrom = 2;\n\tbreak;\n case AIM_DOWN:\n case POS_CENTER:\n default:\n\tbreak;\n }\n for (var j = jFrom; j < TOTAL_NBRS + jFrom; j++) {\n\tvar posP = CCW[j];\n\tvar posV = CCW[orientation + j];\n\tvar c = view[posV].color;\n\tif ((Array.isArray(pattern[posP]) && !pattern[posP][c]) ||\n\t ((pattern[posP] > 0) && (c != pattern[posP]))) {\n\t if (forwardFacingCells[posP]) {\n\t\tfwdWrong.push({p:posP, v:posV});\n\t\t// #future# If it should ever be needed, we could push j as a\n\t\t// third member of these objects (its absence indicating the\n\t\t// center cell).\n\t\ttotalDiscrepancies += 1;\n\t } else {\n\t\trearWrong.push({p:posP, v:posV});\n\t\ttotalDiscrepancies += weight;\n\t }\n\t}\n\tif ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\t DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\t return PAT_NOMATCH;\n\t}\n }\n // Assert: totalDiscrepancies == fwdWrong.length + rearWrong.length;\n // Assert: If compass < 0, then totalDiscrepancies <= qualityGoal\n debugme(\"-> total \" + totalDiscrepancies + \" weighted discrepancies found.\");\n if ((compass < 0)\n\t// && (totalDiscrepancies <= qualityGoal)\n ) {\n\tcompass = orientation;\n }\n if (DEBUGME[myType]) {\n\t// Bypass the single-arg debugme() in order to get the objects printed.\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"forwardD: [\", fwdWrong, \"]\");\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"rearD: [\", rearWrong, \"]\");\n }\n if (fwdWrong.length == 0) {\n\treturn (totalDiscrepancies);\n } else {\n\treturn (-totalDiscrepancies);\n }\n}", "screenAlignmentPattern() {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << 22 /* WIDTH_SHIFT */ | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n const buffer = this._bufferService.buffer;\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = buffer.ybase + buffer.y + yOffset;\n const line = buffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowService.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }", "function init_module() {\n\n var sANDIVersionNumber = \"4.1.4\";\n\n //create sANDI instance\n var sANDI = new AndiModule(sANDIVersionNumber, \"s\");\n\n var langAttributesCount = 0;\n var roleAttributesCount = 0;\n\n AndiModule.initActiveActionButtons({\n readingOrder: false,\n roleAttributes: false,\n langAttributes: false\n });\n\n //This function will analyze the test page for graphics/image related markup relating to accessibility\n sANDI.analyze = function () {\n\n //Loop through every visible element\n $(TestPageData.allElements).each(function () {\n //For all elements on the page\n if ($.trim($(this).attr(\"role\")))\n roleAttributesCount++;\n if ($.trim($(this).prop(\"lang\")))\n langAttributesCount++;\n });\n };\n\n //This function determine's if the element looks like a heading but is not semantically a heading\n sANDI.isFakeHeading = function (element) {\n\n var isFakeHeading = false;\n\n var limit_textLength = 30; //text longer than this will not be considered a fake heading\n\n var limit_fontSize = 22; //px (an h2 starts around 24px)\n var limit_boldFontSize = 15; //px\n\n var text = $.trim($(element).text());\n if (text.length > 0 && text.length < limit_textLength) {\n //text is not empty, but less than char limit\n\n var fakeHeading_fontSize = parseInt($(element).css(\"font-size\"));\n var fakeHeading_fontWeight = $(element).css(\"font-weight\");\n\n if (fakeHeading_fontSize > limit_fontSize ||\n (isBold(fakeHeading_fontWeight) && fakeHeading_fontSize > limit_boldFontSize)\n ) { //fakeHeading_fontSize is greater than size limit\n\n var nextElement = $(element).next().filter(\":visible\");\n\n if ($.trim($(nextElement).text()) !== \"\") { //next element has text\n\n var nextElement_fontWeight = $(nextElement).css(\"font-weight\");\n var nextElement_fontSize = parseInt($(nextElement).css(\"font-size\"));\n\n if (nextElement_fontSize < fakeHeading_fontSize) {\n //next element's font-size is smaller than fakeHeading font-size\n isFakeHeading = true;\n }\n else if (isBold(fakeHeading_fontWeight) && !isBold(nextElement_fontWeight)) {\n //next element's font-weight is lighter than fakeHeading font-weight\n isFakeHeading = true;\n }\n }\n }\n }\n return isFakeHeading;\n\n function isBold(weight) {\n return (weight === \"bold\" || weight === \"bolder\" || weight >= 700);\n }\n };\n\n //Initialize outline\n sANDI.outline = \"<h3 tabindex='-1' id='sANDI508-outline-heading'>Headings List (ordered by occurance):</h3><div class='ANDI508-scrollable'>\";\n\n //This function will display the heading list (headings outline)\n //It should only be called on heading elements\n sANDI.getOutlineItem = function (element) {\n var displayCharLength = 60; //for truncating innerText\n var tagName = $(element).prop(\"tagName\").toLowerCase();\n var role = $(element).attr(\"role\");\n var ariaLevel = $(element).attr(\"aria-level\");\n\n //Indent the heading according to the level\n //Results in h1 = 1% left margin, h2 = 2% left margin, etc.\n var indentLevel;\n if (ariaLevel) {\n //Check if positive integar\n if (parseInt(ariaLevel) > 0 && parseInt(ariaLevel) == ariaLevel)\n indentLevel = parseInt(ariaLevel);\n else //aria-level is not a positive integar, default to 2 (defined in ARIA spec, and screen readers are doing this)\n indentLevel = 2;\n }\n else {\n if (role === \"heading\")\n indentLevel = 2; //no aria-level and role=heading, so default to 2 (defined in ARIA spec)\n else\n indentLevel = parseInt(tagName.slice(1)); //get second character from h tag\n }\n\n var outlineItem = \"<a style='margin-left:\" + indentLevel + \"%' href='#' data-andi508-relatedindex='\" + $(element).attr('data-andi508-index') + \"'>&lt;\" + tagName;\n\n //display relevant attributes\n if (role)\n outlineItem += \" role='\" + role + \"' \";\n if (ariaLevel)\n outlineItem += \" aria-level='\" + ariaLevel + \"' \";\n\n outlineItem += \"&gt;\";\n outlineItem += \"<span class='ANDI508-display-innerText'>\";\n outlineItem += $.trim(andiUtility.formatForHtml($(element).text().substring(0, displayCharLength)));\n if ($(element).html().length > displayCharLength) {\n outlineItem += \"...\";\n }\n outlineItem += \"</span>\";\n outlineItem += \"&lt;/\" + tagName + \"&gt;</a>\";\n outlineItem += \"<br />\";\n return outlineItem;\n };\n\n //This function adds the finishing touches and functionality to ANDI's display once it's done scanning the page.\n sANDI.results = function () {\n\n var moduleActionButtons = \"\";\n moduleActionButtons += \"<button id='ANDI508-readingOrder-button' aria-pressed='false'>reading order\" + overlayIcon + \"</button>\";\n\n var moreDetails = \"<button id='ANDI508-pageTitle-button'>page title</button>\" +\n \"<button id='ANDI508-pageLanguage-button'>page language</button>\" +\n \"<button id='ANDI508-roleAttributes-button' aria-pressed='false' aria-label='\" + roleAttributesCount + \" Role Attributes'>\" + roleAttributesCount + \" role attributes\" + overlayIcon + \"</button>\" +\n \"<button id='ANDI508-langAttributes-button' aria-pressed='false' aria-label='\" + langAttributesCount + \" Lang Attributes'>\" + langAttributesCount + \" lang attributes\" + overlayIcon + \"</button>\";\n\n moduleActionButtons += \"<div class='ANDI508-moduleActionGroup'><button class='ANDI508-moduleActionGroup-toggler'>more details</button><div class='ANDI508-moduleActionGroup-options'>\" + moreDetails + \"</div></div>\";\n\n $(\"#ANDI508-module-actions\").html(moduleActionButtons);\n\n andiBar.initializeModuleActionGroups();\n\n //Define readingOrder button functionality\n $(\"#ANDI508-readingOrder-button\").click(function () {\n if ($(this).attr(\"aria-pressed\") == \"false\") {\n andiOverlay.overlayButton_on(\"overlay\", $(this));\n andiOverlay.overlayReadingOrder();\n AndiModule.activeActionButtons.readingOrder = true;\n }\n else {\n andiOverlay.overlayButton_off(\"overlay\", $(this));\n andiOverlay.removeOverlay(\"ANDI508-overlay-readingOrder\");\n AndiModule.activeActionButtons.readingOrder = false;\n }\n andiResetter.resizeHeights();\n return false;\n });\n\n //Define the lang attributes button\n $(\"#ANDI508-langAttributes-button\").click(function () {\n if ($(this).attr(\"aria-pressed\") == \"false\") {\n andiOverlay.overlayButton_on(\"overlay\", $(this));\n\n var langOverlayText = \"\";\n var overlayObject;\n var langOfPartsCount = 0;\n $(\"#ANDI508-testPage [lang]\").filter(\":visible\").each(function () {\n if ($(this).prop(\"lang\").trim() != \"\") {\n langOverlayText = $(this).prop(\"tagName\").toLowerCase() + \" lang=\" + $(this).prop(\"lang\");\n overlayObject = andiOverlay.createOverlay(\"ANDI508-overlay-langAttributes\", langOverlayText);\n andiOverlay.insertAssociatedOverlay(this, overlayObject);\n langOfPartsCount++;\n }\n });\n\n AndiModule.activeActionButtons.langAttributes = true;\n }\n else {\n andiOverlay.overlayButton_off(\"overlay\", $(this));\n andiOverlay.removeOverlay(\"ANDI508-overlay-langAttributes\");\n AndiModule.activeActionButtons.langAttributes = false;\n }\n andiResetter.resizeHeights();\n\n return false;\n });\n\n //Define the lang attributes button\n $(\"#ANDI508-roleAttributes-button\").click(function () {\n if ($(this).attr(\"aria-pressed\") == \"false\") {\n andiOverlay.overlayButton_on(\"overlay\", $(this));\n\n var langOverlayText = \"\";\n var overlayObject, role;\n $(\"#ANDI508-testPage [role]:not('.ANDI508-overlay')\").filter(\":visible\").each(function () {\n role = $.trim($(this).attr(\"role\")).toLowerCase();\n if (role) { //if role is not empty\n langOverlayText = $(this).prop(\"tagName\").toLowerCase() + \" role=\" + role;\n overlayObject = andiOverlay.createOverlay(\"ANDI508-overlay-roleAttributes\", langOverlayText);\n andiOverlay.insertAssociatedOverlay(this, overlayObject);\n }\n });\n\n AndiModule.activeActionButtons.roleAttributes = true;\n }\n else {\n andiOverlay.overlayButton_off(\"overlay\", $(this));\n andiOverlay.removeOverlay(\"ANDI508-overlay-roleAttributes\");\n AndiModule.activeActionButtons.roleAttributes = false;\n }\n andiResetter.resizeHeights();\n return false;\n });\n\n //Define the page title button\n $(\"#ANDI508-pageTitle-button\").click(function () {\n andiOverlay.overlayButton_on(\"overlay\", $(this));\n if (document.title)\n alert(\"The page title is: \" + document.title);\n else\n alert(\"There is no page title.\");\n andiOverlay.overlayButton_off(\"overlay\", $(this));\n });\n\n //Define the page language button\n $(\"#ANDI508-pageLanguage-button\").click(function () {\n andiOverlay.overlayButton_on(\"overlay\", $(this));\n //get the lang attribute from the HTML element\n var htmlLangAttribute = $.trim($(\"html\").first().prop(\"lang\"));\n //pop up the lang value of the HTML element\n if (htmlLangAttribute)\n alert(\"The <html> element has a lang attribute value of: \" + htmlLangAttribute + \".\");\n else\n alert(\"The <html> element does not have a lang attribute.\");\n andiOverlay.overlayButton_off(\"overlay\", $(this));\n });\n\n //Deselect all mode buttons\n $(\"#ANDI508-module-actions button.sANDI508-mode\").attr(\"aria-selected\", \"false\");\n\n $(\"#sANDI508-outline-container\")\n .html(sANDI.outline)\n .find(\"a[data-andi508-relatedindex]\").each(function () {\n andiFocuser.addFocusClick($(this));\n var relatedIndex = $(this).attr(\"data-andi508-relatedindex\");\n var relatedElement = $(\"#ANDI508-testPage [data-andi508-index=\" + relatedIndex + \"]\").first();\n andiLaser.createLaserTrigger($(this), $(relatedElement));\n $(this)\n .hover(function () {\n if (!event.shiftKey)\n AndiModule.inspect(relatedElement[0]);\n })\n .focus(function () {\n AndiModule.inspect(relatedElement[0]);\n });\n });\n\n $(\"#sANDI508-outline-container\")\n .html(sANDI.outline)\n .find(\"a[data-andi508-relatedindex]\").each(function () {\n andiFocuser.addFocusClick($(this));\n var relatedIndex = $(this).attr(\"data-andi508-relatedindex\");\n var relatedElement = $(\"#ANDI508-testPage [data-andi508-index=\" + relatedIndex + \"]\").first();\n andiLaser.createLaserTrigger($(this), $(relatedElement));\n $(this)\n .hover(function () {\n if (!event.shiftKey)\n AndiModule.inspect(relatedElement[0]);\n })\n .focus(function () {\n AndiModule.inspect(relatedElement[0]);\n });\n });\n\n andiAlerter.updateAlertList();\n\n AndiModule.engageActiveActionButtons([\n \"readingOrder\",\n \"roleAttributes\",\n \"langAttributes\"\n ]);\n\n $(\"#ANDI508\").focus();\n\n };\n\n //This function will update the info in the Active Element Inspection.\n //Should be called after the mouse hover or focus in event.\n AndiModule.inspect = function (element) {\n if ($(element).hasClass(\"ANDI508-element\")) {\n andiBar.prepareActiveElementInspection(element);\n\n var elementData = $(element).data(\"andi508\");\n\n\n\n var addOnProps = AndiData.getAddOnProps(element, elementData,\n [\n \"aria-level\",\n getDefault_ariaLive(element, elementData),\n getDefault_ariaAtomic(element, elementData),\n \"aria-busy\",\n \"aria-relevant\"\n ]);\n\n andiBar.displayTable(elementData, element, addOnProps);\n\n if (AndiModule.activeActionButtons.liveRegions) { //For Live Region mode, update the output live\n //Copy from the AC table\n var innerText = $(\"#ANDI508-accessibleComponentsTable td.ANDI508-display-innerText\").first().html();\n if (innerText) {\n elementData.accName = \"<span class='ANDI508-display-innerText'>\" + innerText + \"</span>\";\n }\n }\n\n andiBar.displayOutput(elementData, element, addOnProps);\n }\n\n //This function assumes the default values of aria-live based on the element's role as defined by spec\n function getDefault_ariaLive(element, elementData) {\n var val = $.trim($(element).attr(\"aria-live\"));\n if (!val) {\n if (elementData.role === \"alert\")\n val = \"assertive\";\n else if (elementData.role === \"log\" || elementData.role === \"status\")\n val = \"polite\";\n else if (elementData.role === \"marquee\" || elementData.role === \"timer\")\n val = \"off\";\n else return; //no default\n }\n return [\"aria-live\", val];\n }\n\n //This function assumes the default values of aria-atomic based on the element's role as defined by spec\n function getDefault_ariaAtomic(element, elementData) {\n var val = $.trim($(element).attr(\"aria-atomic\"));\n if (!val) {\n if (elementData.role === \"alert\" || elementData.role === \"status\")\n val = \"true\";\n else if (elementData.role === \"log\" || elementData.role === \"marquee\" || elementData.role === \"timer\")\n val = \"false\";\n else return; //no default\n }\n return [\"aria-atomic\", val];\n }\n };\n\n //This function will overlay the reading order sequence.\n AndiOverlay.prototype.overlayReadingOrder = function () {\n //Elements that should be excluded from the scan, hidden elements will automatically be filtered out\n var exclusions = \"option,script,style,noscript\";\n //Elements that should be included in the scan even if they don't have innerText\n var inclusions = \"select,input,textarea\";\n\n var readingSequence = 0;\n var overlayObject;\n\n traverseReadingOrder(document.getElementById(\"ANDI508-testPage\"));\n\n //This recursive function traverses the dom tree and inserts the reading order overlay\n //It distinguishes between element nodes and text nodes\n //It will check for aria-hidden=true (with inheritance)\n function traverseReadingOrder(element, ariaHidden) {\n\n //Check for aria-hidden=true\n ariaHidden = (ariaHidden || $(element).attr(\"aria-hidden\") === \"true\") ? true : false;\n\n for (var z = 0; z < element.childNodes.length; z++) {\n\n //if child is an element object that is visible\n if (element.childNodes[z].nodeType === 1) {\n if (!$(element.childNodes[z]).is(exclusions) && $(element.childNodes[z]).is(\":shown\")) {\n if ($(element.childNodes[z]).is(inclusions)) {//no need to look at this element's childNodes\n insertReadingOrder(ariaHidden, element.childNodes[z]);\n z++;//because a new node was inserted, the indexes changed\n }\n else {//recursion here:\n traverseReadingOrder(element.childNodes[z], ariaHidden);\n }\n }\n }\n //else if child is a text node\n else if (element.childNodes[z].nodeType === 3) {\n if ($.trim(element.childNodes[z].nodeValue) !== \"\") {\n //Found some text\n insertReadingOrder(ariaHidden, element.childNodes[z]);\n z++;//because a new node was inserted, the indexes changed\n }\n }\n }\n\n //this function inserts the reading order overlay\n //if it's hidden using aria-hidden it will insert an alert overlay\n function insertReadingOrder(ariaHidden, node) {\n if (ariaHidden) {\n overlayObject = andiOverlay.createOverlay(\"ANDI508-overlay-alert ANDI508-overlay-readingOrder\", \"X\", \"hidden from screen reader using aria-hidden=true\");\n }\n else {\n readingSequence++;\n overlayObject = andiOverlay.createOverlay(\"ANDI508-overlay-readingOrder\", readingSequence);\n }\n andiOverlay.insertAssociatedOverlay(node, overlayObject);\n }\n }\n };\n\n sANDI.analyze();\n sANDI.results();\n\n}//end init", "function alignmentByGender(dimension, align) {\n return dimension.group().reduce(\n function (p, v) {\n p.total++;\n if (v.align === align) {\n p.match++;\n }\n return p;\n },\n function (p, v) {\n p.total--;\n if (v.align === align) {\n p.match--;\n }\n return p;\n },\n function () {\n return { total: 0, match: 0 };\n }\n );\n }", "switchToMaskedGrid() {\n // Make a copy of the grid -- we will be overwriting it\n var savedGrid = this.grid\n this.grid = new Array(this.width)\n // Override all elements with empty lines -- this means that flood fill is just\n // looking for lines with line=0.\n for (var x=0; x<this.width; x++) {\n var savedRow = savedGrid[x]\n var row = new Array(this.height)\n if (x%2 === 1) { // Cells are always part of the region\n for (var y=1; y<this.height; y+=2) row[y] = MASKED_INB_COUNT\n var skip = 2 // Skip these cells during iteration\n } else {\n var skip = 1\n }\n for (var y=0; y<this.height; y+=skip) {\n var cell = savedRow[y]\n if (cell.line > window.LINE_NONE) {\n row[y] = MASKED_PROCESSED // Traced lines should not be a part of the region\n } else if (cell.gap === window.GAP_FULL) {\n row[y] = MASKED_GAP2\n } else if (cell.dot > window.DOT_NONE) {\n row[y] = MASKED_DOT\n } else {\n row[y] = MASKED_INB_COUNT\n }\n }\n this.grid[x] = row\n }\n\n // Starting at a mid-segment startpoint\n if (this.startPoint != null && this.startPoint.x%2 !== this.startPoint.y%2) {\n if (this.settings.FAT_STARTPOINTS) {\n // This segment is not in any region (acts as a barrier)\n this.grid[this.startPoint.x][this.startPoint.y] = MASKED_OOB\n } else {\n // This segment is part of this region (acts as an empty cell)\n this.grid[this.startPoint.x][this.startPoint.y] = MASKED_INB_NONCOUNT\n }\n }\n\n // Ending at a mid-segment endpoint\n if (this.endPoint != null && this.endPoint.x%2 !== this.endPoint.y%2) {\n // This segment is part of this region (acts as an empty cell)\n this.grid[this.endPoint.x][this.endPoint.y] = MASKED_INB_NONCOUNT\n }\n\n // Mark all outside cells as 'not in any region' (aka null)\n\n // Top and bottom edges\n for (var x=1; x<this.width; x+=2) {\n this._floodFillOutside(x, 0, this.grid[x])\n this._floodFillOutside(x, this.height - 1, this.grid[x])\n }\n\n // Left and right edges (only applies to non-pillars)\n if (this.pillar === false) {\n for (var y=1; y<this.height; y+=2) {\n this._floodFillOutside(0, y, this.grid[0])\n this._floodFillOutside(this.width - 1, y, this.grid[this.width-1])\n }\n }\n\n return savedGrid\n }", "function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};\n// We cache the position here based on the layering because the graph and\n// layering may be out of sync. The layering matrix is manipulated to\n// generate different extreme alignments.\n_.forEach(layering,function(layer){_.forEach(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.forEach(layering,function(layer){var prevIdx=-1;_.forEach(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdx<pos[w]&&!hasConflict(conflicts,v,w)){align[w]=v;align[v]=root[v]=root[w];prevIdx=pos[w]}}}})});return{root:root,align:align}}", "function fineClassification(inputPattern, inputCandidates) {\n\t var inputLength = inputPattern.length;\n\t var candidates = [];\n\t for(var i=0;i<Math.min(inputCandidates.length, 100);i++) {\n\t var j = inputCandidates[i][0];\n\t var iLength = refPatterns[j][1];\n\t\t var iPattern = refPatterns[j][2];\n\t\t \t\t if(inputLength < iLength + 2 && inputLength > iLength-3) {\n\n\t\t var iMap = getMap(iPattern, inputPattern, initialDistance);\n\n\t\t iMap = completeMap(iPattern, inputPattern, wholeWholeDistance, iMap);\n\t\t if(refPatterns[j][0] == \"委\") {\n\t\t console.log(\"finished imap, fine:\");\n\t\t console.log(iMap);\n\t\t\t console.log(\"weight:\")\n\t\t\t console.log(computeDistance(iPattern, inputPattern, wholeWholeDistance, iMap));\n\t\t\t console.log(\"weight intended:\")\n\t\t\t console.log(computeDistance(iPattern, inputPattern, wholeWholeDistance, [0,1,2,3,4,7,5,6]));\n\t\t\t }\n\t\t var dist = computeWholeDistanceWeighted(iPattern, inputPattern, iMap);\n\t\t var n = inputLength;\n\t\t var m = iPattern.length;\n\t\t if(m > n) {\n\t\t m = n;\n\t\t }\n\t\t dist = dist / m;\n\t\t candidates.push([j, dist]);\n\t }\n\t }\n\t candidates.sort(function(a, b){return a[1]-b[1]});\n\t var outStr = \"\";\n\t for(var i=0;i<Math.min(candidates.length, 10);i++) {\n\t //outStr += candidates[i][0];\n\t\t //outStr += \" \";\n\t\t //outStr += candidates[i][1];\n\t\t outStr += refPatterns[candidates[i][0]][0];\n\t\t outStr += \" \";\t \n\t }\t \n\t document.getElementById(\"candidateList\").innerHTML = outStr;\n\t}", "function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;\n var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension: dimension, moduleSize: moduleSize };\n}", "function findSmallestWidthAlignment(g, xss) {\n return _.min(xss, function(xs) {\n var min = _.min(xs, function(x, v) { return x - width(g, v) / 2; }),\n max = _.max(xs, function(x, v) { return x + width(g, v) / 2; });\n return max - min;\n });\n}", "function parseAlign(alignSpec) {\n const parts = alignSpecRe.exec(alignSpec),\n myOffset = parseInt(parts[2] || 50),\n targetOffset = parseInt(parts[4] || 50); // Comments assume the Menu's alignSpec of l0-r0 is used.\n\n return {\n myAlignmentPoint: parts[1] + myOffset,\n // l0\n myEdge: parts[1],\n // l\n myOffset,\n // 0\n targetAlignmentPoint: parts[3] + targetOffset,\n // r0\n targetEdge: parts[3],\n // r\n targetOffset,\n // 0\n startZone: edgeIndices[parts[3]] // 1 - start trying zone 1 in TRBL order\n\n };\n} // Takes a result from the above function and flips edges for the axisLock config", "function findAlignments(angle, options) {\n var align, verticalAlign;\n if (options.align === null) {\n if (angle > 20 && angle < 160) {\n align = 'left'; // right hemisphere\n }\n else if (angle > 200 && angle < 340) {\n align = 'right'; // left hemisphere\n }\n else {\n align = 'center'; // top or bottom\n }\n options.align = align;\n }\n if (options.verticalAlign === null) {\n if (angle < 45 || angle > 315) {\n verticalAlign = 'bottom'; // top part\n }\n else if (angle > 135 && angle < 225) {\n verticalAlign = 'top'; // bottom part\n }\n else {\n verticalAlign = 'middle'; // left or right\n }\n options.verticalAlign = verticalAlign;\n }\n return options;\n}", "closestValidDirection(partsArr, x, y, direction, includeStarting) {\n // 'blocks': a 5x5 bool array where entry is true if there is a block or center in that location.\n var blocks = []\n for (var a = 0; a < 5; a++) {\n blocks.push([false, false, false, false, false]);\n }\n partsArr.forEach(element => {\n if (element.type === \"block\" || element.type === \"center\") {\n blocks[element.x][element.y] = true;\n }\n })\n\n const order = [\"north\", \"west\", \"south\", \"east\"]\n var intial = order.indexOf(direction);\n if (includeStarting === false) {\n intial += 1;\n }\n\n // for every direction, starting with the current direction, return that direction if it is valid.\n // (if there is a block in the corresponding location.)\n for (a = intial; a < intial + 4; a++) {\n switch (order[a % 4]) {\n case \"north\":\n if (y > 0 && blocks[x][y - 1]) {\n return \"north\";\n }\n break\n case \"east\":\n if (x > 0 && blocks[x - 1][y]) {\n return \"east\";\n }\n break\n case \"west\":\n if (x < 4 && blocks[x + 1][y]) {\n return \"west\";\n }\n break\n case \"south\":\n if (y < 4 && blocks[x][y + 1]) {\n return \"south\";\n }\n break\n default:\n throw new Error(\"invalid direction\");\n }\n }\n }", "measure(availableSize) {\n let desired = undefined;\n let desiredBounds = undefined;\n if (this.hasChildren()) {\n //Measuring the children\n for (let child of this.children) {\n if (child instanceof TextElement) {\n if (child.canMeasure) {\n availableSize.width = availableSize.width || this.maxWidth || this.minWidth;\n child.measure(availableSize);\n }\n else {\n break;\n }\n }\n else if (!(child instanceof TextElement)) {\n child.measure(availableSize);\n }\n let childSize = child.desiredSize.clone();\n if (child.rotateAngle !== 0) {\n childSize = rotateSize(childSize, child.rotateAngle);\n }\n let right = childSize.width + child.margin.right;\n let bottom = childSize.height + child.margin.bottom;\n let childBounds = new Rect(child.margin.left, child.margin.top, right, bottom);\n if (child.float) {\n let position = child.getAbsolutePosition(childSize);\n if (position !== undefined) {\n continue;\n }\n }\n if ((!(child instanceof TextElement)) || (child instanceof TextElement && child.canConsiderBounds)) {\n if (desiredBounds === undefined) {\n desiredBounds = childBounds;\n }\n else {\n desiredBounds.uniteRect(childBounds);\n }\n }\n }\n if (desiredBounds) {\n let leftMargin = 0;\n let topMargin = 0;\n leftMargin = Math.max(desiredBounds.left, 0);\n topMargin = Math.max(desiredBounds.top, 0);\n desired = new Size(desiredBounds.width + leftMargin, desiredBounds.height + topMargin);\n }\n }\n desired = super.validateDesiredSize(desired, availableSize);\n super.stretchChildren(desired);\n this.desiredSize = desired;\n return desired;\n }", "locateArmoredBlocks(text) {\n var beginObj = {};\n var endObj = {};\n var indentStrObj = {};\n var blocks = [];\n var i = 0;\n var b;\n\n while (\n (b = EnigmailArmor.locateArmoredBlock(\n text,\n i,\n \"\",\n beginObj,\n endObj,\n indentStrObj\n )) !== \"\"\n ) {\n blocks.push({\n begin: beginObj.value,\n end: endObj.value,\n indent: indentStrObj.value ? indentStrObj.value : \"\",\n blocktype: b,\n });\n\n i = endObj.value;\n }\n\n EnigmailLog.DEBUG(\n \"armor.jsm: locateArmorBlocks: Found \" + blocks.length + \" Blocks\\n\"\n );\n return blocks;\n }", "arrange(desiredSize) {\n let child;\n let childBounds = this.desiredBounds;\n if (childBounds) {\n let x = this.offsetX;\n let y = this.offsetY;\n this.offsetX = childBounds.x + childBounds.width * this.pivot.x;\n this.offsetY = childBounds.y + childBounds.height * this.pivot.y;\n // container has rotateAngle\n if (this.hasChildren()) {\n //Measuring the children\n for (let i = 0; i < this.children.length; i++) {\n child = this.children[i];\n let arrange = false;\n if (child.horizontalAlignment === 'Stretch') {\n child.offsetX = this.offsetX;\n child.parentTransform = this.parentTransform + this.rotateAngle;\n arrange = true;\n }\n if (child.verticalAlignment === 'Stretch') {\n child.offsetY = this.offsetY;\n child.parentTransform = this.parentTransform + this.rotateAngle;\n arrange = true;\n }\n if (arrange || this.measureChildren || (child instanceof Container && child.measureChildren !== undefined)) {\n child.arrange(child.desiredSize);\n }\n }\n }\n }\n this.actualSize = desiredSize;\n this.updateBounds();\n this.prevRotateAngle = this.rotateAngle;\n return desiredSize;\n }", "function testAvailablePiecesInPattern(){\n\tforEachLevel(function(stage, level){\n\t\tvar pieces = StageController.getAvailablePieces(stage, level);\n\t\tvar hits = StageController.getPatternHits(stage, level);\n\t\thits = goog.array.flatten(hits);\n\t\t//make sure that the pieces are in the pattern\n\t\tgoog.array.forEach(pieces, function(piece){\n\t\t\tif (goog.array.indexOf(hits, piece) === -1){\n\t\t\t\tthrow Error(\"Pattern does not contain piece: \"+piece+\" on level: \"+stage+\", \"+level);\t\t\n\t\t\t}\n\t\t});\n\t\t//make sure that the pattern is all in the pieces\n\t\tgoog.array.forEach(hits, function(hit){\n\t\t\tif (hit !== \"rest\"){\n\t\t\t\tif (goog.array.indexOf(pieces, hit) === -1){\n\t\t\t\t\tthrow Error(\"Pieces does not contain pattern: \"+hit+\" on level: \"+stage+\", \"+level);\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "_getExpectedAlign() {\n const align = this.isRtl ? this._replaceAlignDir(this.align, /l|r/g, { l: 'r', r: 'l' }) : this.align;\n const expectedAlign = [align];\n if (this.needAdjust) {\n if (/t|b/g.test(align)) {\n expectedAlign.push(this._replaceAlignDir(align, /t|b/g, { t: 'b', b: 't' }));\n }\n if (/l|r/g.test(align)) {\n expectedAlign.push(this._replaceAlignDir(align, /l|r/g, { l: 'r', r: 'l' }));\n }\n if (/c/g.test(align)) {\n expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: 'l' }));\n expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: 'r' }));\n }\n expectedAlign.push(\n this._replaceAlignDir(align, /l|r|t|b/g, {\n l: 'r',\n r: 'l',\n t: 'b',\n b: 't',\n })\n );\n }\n return expectedAlign;\n }", "function greedyLayout(areas, params) {\n var loss = params && params.lossFunction ? params.lossFunction : lossFunction;\n // define a circle for each set\n var circles = {},\n setOverlaps = {},\n set;\n for (var i = 0; i < areas.length; ++i) {\n var area = areas[i];\n if (area.sets.length == 1) {\n set = area.sets[0];\n circles[set] = { x: 1e10, y: 1e10,\n rowid: circles.length,\n size: area.size,\n radius: Math.sqrt(area.size / Math.PI) };\n setOverlaps[set] = [];\n }\n }\n areas = areas.filter(function (a) {\n return a.sets.length == 2;\n });\n\n // map each set to a list of all the other sets that overlap it\n for (i = 0; i < areas.length; ++i) {\n var current = areas[i];\n var weight = current.hasOwnProperty('weight') ? current.weight : 1.0;\n var left = current.sets[0],\n right = current.sets[1];\n\n // completely overlapped circles shouldn't be positioned early here\n if (current.size + SMALL$1 >= Math.min(circles[left].size, circles[right].size)) {\n weight = 0;\n }\n\n setOverlaps[left].push({ set: right, size: current.size, weight: weight });\n setOverlaps[right].push({ set: left, size: current.size, weight: weight });\n }\n\n // get list of most overlapped sets\n var mostOverlapped = [];\n for (set in setOverlaps) {\n if (setOverlaps.hasOwnProperty(set)) {\n var size = 0;\n for (i = 0; i < setOverlaps[set].length; ++i) {\n size += setOverlaps[set][i].size * setOverlaps[set][i].weight;\n }\n\n mostOverlapped.push({ set: set, size: size });\n }\n }\n\n // sort by size desc\n function sortOrder(a, b) {\n return b.size - a.size;\n }\n mostOverlapped.sort(sortOrder);\n\n // keep track of what sets have been laid out\n var positioned = {};\n function isPositioned(element) {\n return element.set in positioned;\n }\n\n // adds a point to the output\n function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }\n\n // add most overlapped set at (0,0)\n positionSet({ x: 0, y: 0 }, mostOverlapped[0].set);\n\n // get distances between all points. TODO, necessary?\n // answer: probably not\n // var distances = venn.getDistanceMatrices(circles, areas).distances;\n for (i = 1; i < mostOverlapped.length; ++i) {\n var setIndex = mostOverlapped[i].set,\n overlap = setOverlaps[setIndex].filter(isPositioned);\n set = circles[setIndex];\n overlap.sort(sortOrder);\n\n if (overlap.length === 0) {\n // this shouldn't happen anymore with addMissingAreas\n throw \"ERROR: missing pairwise overlap information\";\n }\n\n var points = [];\n for (var j = 0; j < overlap.length; ++j) {\n // get appropriate distance from most overlapped already added set\n var p1 = circles[overlap[j].set],\n d1 = distanceFromIntersectArea(set.radius, p1.radius, overlap[j].size);\n\n // sample positions at 90 degrees for maximum aesthetics\n points.push({ x: p1.x + d1, y: p1.y });\n points.push({ x: p1.x - d1, y: p1.y });\n points.push({ y: p1.y + d1, x: p1.x });\n points.push({ y: p1.y - d1, x: p1.x });\n\n // if we have at least 2 overlaps, then figure out where the\n // set should be positioned analytically and try those too\n for (var k = j + 1; k < overlap.length; ++k) {\n var p2 = circles[overlap[k].set],\n d2 = distanceFromIntersectArea(set.radius, p2.radius, overlap[k].size);\n\n var extraPoints = circleCircleIntersection({ x: p1.x, y: p1.y, radius: d1 }, { x: p2.x, y: p2.y, radius: d2 });\n\n for (var l = 0; l < extraPoints.length; ++l) {\n points.push(extraPoints[l]);\n }\n }\n }\n\n // we have some candidate positions for the set, examine loss\n // at each position to figure out where to put it at\n var bestLoss = 1e50,\n bestPoint = points[0];\n for (j = 0; j < points.length; ++j) {\n circles[setIndex].x = points[j].x;\n circles[setIndex].y = points[j].y;\n var localLoss = loss(circles, areas);\n if (localLoss < bestLoss) {\n bestLoss = localLoss;\n bestPoint = points[j];\n }\n }\n\n positionSet(bestPoint, setIndex);\n }\n\n return circles;\n }", "function greedyLayout(areas, params) {\n var loss = params && params.lossFunction ? params.lossFunction : lossFunction;\n // define a circle for each set\n var circles = {},\n setOverlaps = {},\n set;\n for (var i = 0; i < areas.length; ++i) {\n var area = areas[i];\n if (area.sets.length == 1) {\n set = area.sets[0];\n circles[set] = { x: 1e10, y: 1e10,\n rowid: circles.length,\n size: area.size,\n radius: Math.sqrt(area.size / Math.PI) };\n setOverlaps[set] = [];\n }\n }\n areas = areas.filter(function (a) {\n return a.sets.length == 2;\n });\n\n // map each set to a list of all the other sets that overlap it\n for (i = 0; i < areas.length; ++i) {\n var current = areas[i];\n var weight = current.hasOwnProperty('weight') ? current.weight : 1.0;\n var left = current.sets[0],\n right = current.sets[1];\n\n // completely overlapped circles shouldn't be positioned early here\n if (current.size + SMALL$1 >= Math.min(circles[left].size, circles[right].size)) {\n weight = 0;\n }\n\n setOverlaps[left].push({ set: right, size: current.size, weight: weight });\n setOverlaps[right].push({ set: left, size: current.size, weight: weight });\n }\n\n // get list of most overlapped sets\n var mostOverlapped = [];\n for (set in setOverlaps) {\n if (setOverlaps.hasOwnProperty(set)) {\n var size = 0;\n for (i = 0; i < setOverlaps[set].length; ++i) {\n size += setOverlaps[set][i].size * setOverlaps[set][i].weight;\n }\n\n mostOverlapped.push({ set: set, size: size });\n }\n }\n\n // sort by size desc\n function sortOrder(a, b) {\n return b.size - a.size;\n }\n mostOverlapped.sort(sortOrder);\n\n // keep track of what sets have been laid out\n var positioned = {};\n function isPositioned(element) {\n return element.set in positioned;\n }\n\n // adds a point to the output\n function positionSet(point, index) {\n circles[index].x = point.x;\n circles[index].y = point.y;\n positioned[index] = true;\n }\n\n // add most overlapped set at (0,0)\n positionSet({ x: 0, y: 0 }, mostOverlapped[0].set);\n\n // get distances between all points. TODO, necessary?\n // answer: probably not\n // var distances = venn.getDistanceMatrices(circles, areas).distances;\n for (i = 1; i < mostOverlapped.length; ++i) {\n var setIndex = mostOverlapped[i].set,\n overlap = setOverlaps[setIndex].filter(isPositioned);\n set = circles[setIndex];\n overlap.sort(sortOrder);\n\n if (overlap.length === 0) {\n // this shouldn't happen anymore with addMissingAreas\n throw \"ERROR: missing pairwise overlap information\";\n }\n\n var points = [];\n for (var j = 0; j < overlap.length; ++j) {\n // get appropriate distance from most overlapped already added set\n var p1 = circles[overlap[j].set],\n d1 = distanceFromIntersectArea(set.radius, p1.radius, overlap[j].size);\n\n // sample positions at 90 degrees for maximum aesthetics\n points.push({ x: p1.x + d1, y: p1.y });\n points.push({ x: p1.x - d1, y: p1.y });\n points.push({ y: p1.y + d1, x: p1.x });\n points.push({ y: p1.y - d1, x: p1.x });\n\n // if we have at least 2 overlaps, then figure out where the\n // set should be positioned analytically and try those too\n for (var k = j + 1; k < overlap.length; ++k) {\n var p2 = circles[overlap[k].set],\n d2 = distanceFromIntersectArea(set.radius, p2.radius, overlap[k].size);\n\n var extraPoints = circleCircleIntersection({ x: p1.x, y: p1.y, radius: d1 }, { x: p2.x, y: p2.y, radius: d2 });\n\n for (var l = 0; l < extraPoints.length; ++l) {\n points.push(extraPoints[l]);\n }\n }\n }\n\n // we have some candidate positions for the set, examine loss\n // at each position to figure out where to put it at\n var bestLoss = 1e50,\n bestPoint = points[0];\n for (j = 0; j < points.length; ++j) {\n circles[setIndex].x = points[j].x;\n circles[setIndex].y = points[j].y;\n var localLoss = loss(circles, areas);\n if (localLoss < bestLoss) {\n bestLoss = localLoss;\n bestPoint = points[j];\n }\n }\n\n positionSet(bestPoint, setIndex);\n }\n\n return circles;\n }", "function areaParallelogram(base, height){\n return -1;\n }", "function refinePositions() {\n var requiredIterations = rigidity;\n for (var i=0; i<spans.length; i++) {\n var thisSpanIterations = Math.round( rigidity * spans[i].strength );\n if ( thisSpanIterations > requiredIterations ) {\n requiredIterations = thisSpanIterations;\n }\n }\n for (var j=0; j<requiredIterations; j++) {\n updateSpans(j);\n applyConstraints();\n }\n}", "gatherMatchingBlocks(matches) {\n this.nullifyMatchesInGridArray(matches);\n\n let beingSwapped = matches.filter(e => e.beingSwapped);\n const arrTypes = [...new Set(matches.map(m => m.id))];\n\n /* in this case this is automatch and we need to set target\n blocks for each match so that the rest of certain color can \n go to target block position\n */\n\n // array of all matches types... for example [\"ball_red\", \"ball_green\"] etc.\n for (let _id of arrTypes) {\n if (beingSwapped.map(m => m.id).includes(_id)) { continue; }\n console.log(_id);\n let currentMatchItems = matches.filter(e => e.id === _id);\n let central = Math.floor(currentMatchItems.length / 2);\n let centralItem = matches.indexOf(matches.find(m => m === currentMatchItems[central]));\n matches[centralItem].beingSwapped = true; //?? might cause problems!!!!\n beingSwapped.push(matches[centralItem]);\n }\n\n for (let m = 0; m < beingSwapped.length; m++) {\n let thisColorMatchesIds = matches.filter(e => e.id === beingSwapped[m].id);\n for (let e = 0; e < thisColorMatchesIds.length; e++) {\n let targetBlock = thisColorMatchesIds.filter(x => x.beingSwapped)[0];\n let tweenTarget = this.blocks[thisColorMatchesIds[e].row][thisColorMatchesIds[e].col];\n\n if (!thisColorMatchesIds[e].beingSwapped) {\n let newX = this.globalBlocksPositions[targetBlock.row][targetBlock.col].x;\n let newY = this.globalBlocksPositions[targetBlock.row][targetBlock.col].y;\n TweenMax.to(tweenTarget.blockImg, .2, {\n x: newX,\n y: newY,\n alpha: 0,\n ease: Linear.easeNone,\n onComplete: () => { }\n });\n }\n else {\n TweenMax.to(tweenTarget.blockImg, .2, {\n alpha: 0,\n delay: .2,\n onComplete: () => { }\n });\n }\n }\n }\n }", "function seqAligner(pattern_seq, subject_seq, topID, midID, botID) {\n\t\tvar patternArray = pattern_seq.split('');\n\t\tvar subjectArray = subject_seq.split('');\n\n\t\tfor (index = 0; index < patternArray.length; index++) {\n\t\t\tvar patternCode = \"<span class='styleGuide'>\" + patternArray[index] + \"</span>\";\n\t\t\tvar subjectCode = \"<span class='styleGuide'>\" + subjectArray[index] + \"</span>\";\n\n\t\t\tvar topSeqID = \"#\" + topID;\n\t\t\tvar midSeqID = \"#\" + midID;\n\t\t\tvar botSeqID = \"#\" + botID;\n\n\t\t\t$(topSeqID).append(patternCode);\n\t\t\t$(botSeqID).append(subjectCode);\n\t\t\tif (isSameBase(patternArray[index], subjectArray[index])) \n\t\t\t{\n\t\t\t\tvar midCode = \"<span class='styleGuide'>\" + \"|\" + \"</span>\";\n\t\t\t} else {\n\t\t\t\tvar midCode = \"<span class='styleGuide'>\" + \"<div class='blockYellow'>&nbsp</div>\" + \"</span>\";\n\t\t\t}\n\t\t\t$(midSeqID).append(midCode);\n\n\t\t}\n\t}", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "expandText(begin, end, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance){\n \n // var point = interpolate(begin, end, lengthInterpolate);\n var that = this;\n var angle = Math.atan2(end.y-begin.y, end.x-begin.x)\n var point = createPositionAtLengthAngle(end, angle, 100);\n // console.log('GO')\n // drawCircle(point.x, point.y, 5, 'red');\n\n // drawLine(begin.x, begin.y, point.x, point.y, 'red');\n\n\n d3.select('.standAloneLines').selectAll('.parentLine').each(function(){\n var id = d3.select(this).attr('id').split('-')[1];\n \n var insideandWhichGroup = that.props.groupLines.find(group => group.lines.find((arrayEntry)=> arrayEntry.indexOf(id) > -1))//.indexOf(idSImple) > -1);//x.id == this.guideTapped.item)\n \n // console.log(insideandWhichGroup)\n\n \n if (alreadyAdded.indexOf(id) == -1 && insideandWhichGroup == undefined){\n \n var BB = _getBBox('item-'+id);\n var originalBB = JSON.parse(JSON.stringify(BB));\n if (distance != 0){\n BB.x -= 2;\n BB.y -= 2;\n BB.width +=2;\n BB.height += 2\n } else {\n BB.x -= 15;\n BB.y -= 15;\n BB.width +=30;\n BB.height += 30\n }\n var oobbNew = [\n {'x': BB.x, 'y':BB.y},\n {'x': BB.x+ BB.width, 'y':BB.y},\n {'x': BB.x+ BB.width, 'y':BB.y + BB.height},\n {'x': BB.x, 'y':BB.y + BB.height}\n ]\n var isIntersect = lineIntersectsPolygone(begin, point, oobbNew);\n if ((originalBB.width > 400 && originalBB.height < 50) || (originalBB.height > 400 && originalBB.width <50)){\n }\n else if (isIntersect){\n // showBboxBB(BB, 'red')\n // showBbox('item-'+id, 'blue');\n alreadyAdded.push(id)\n lengthInterpolate = lengthInterpolate *2;\n\n var centerPolygon = getCenterPolygon(oobbNew);\n var rightSide = {'x': BB.x+ BB.width, 'y':BB.y+ (BB.height/2)}\n // var result = that.increasePrecisionLine(begin, end, oobbNew, pointsThroughLine,)\n if (signe == 1) that.expandText(centerPolygon, rightSide, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance)//, arraySorted,oobb, iteration)\n else that.expandText(rightSide, centerPolygon, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance)\n }\n }\n })\n }", "function _tr_align() {\n\t\t send_bits(STATIC_TREES << 1, 3);\n\t\t send_code(END_BLOCK, StaticTree.static_ltree);\n\t\t bi_flush(); // Of the 10 bits for the empty block, we have already sent\n\t\t // (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t // the EOB of the previous block) was thus at least one plus the length\n\t\t // of the EOB plus what we have just sent of the empty static block.\n \n\t\t if (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t }\n \n\t\t last_eob_len = 7;\n\t\t} // Save the match info and tally the frequency counts. Return true if", "calculateObjective (patternVerticalOffsets, minStopPerPattern, maxStopPerPattern, transfersFromPattern) {\n let objective = 0\n for (let pattern of patternVerticalOffsets.keys()) {\n if (!transfersFromPattern.has(pattern)) continue\n\n let txx = transfersFromPattern.get(pattern)\n txx.forEach(transfer => {\n let from = transfer.fromStop - minStopPerPattern.get(pattern) + patternVerticalOffsets.get(pattern)\n let to = transfer.toStop - minStopPerPattern.get(transfer.toPattern) + patternVerticalOffsets.get(transfer.toPattern)\n\n // this transfer goes the wrong way\n if (to <= from) objective += from - to + 1\n })\n }\n\n return objective\n }" ]
[ "0.6874053", "0.66919404", "0.66338426", "0.6466172", "0.57354194", "0.5114524", "0.5044666", "0.48943785", "0.48560306", "0.47541577", "0.46912557", "0.46429765", "0.46381676", "0.46337447", "0.46068656", "0.45935106", "0.45466596", "0.45453006", "0.45367014", "0.44856912", "0.44818997", "0.44798005", "0.447462", "0.44419917", "0.44411075", "0.44341877", "0.44291097", "0.4414863", "0.4412983", "0.44074184", "0.4404424", "0.43914485", "0.4383225", "0.43672577", "0.43499333", "0.43492985", "0.43475074", "0.43475074", "0.43440914", "0.43430787", "0.43310428", "0.4312406", "0.43117204", "0.4289098", "0.4274264", "0.42657694", "0.4260258", "0.42577505", "0.4251833", "0.4244843", "0.42353854", "0.42330453", "0.42310867", "0.42242676", "0.42226243", "0.4222514", "0.42110133", "0.4208151", "0.41995215", "0.41988054", "0.41950828", "0.41804478", "0.41769826", "0.4170684", "0.41706657", "0.41687253", "0.41677475", "0.41671157", "0.41630262", "0.41621238", "0.41583788", "0.41564414", "0.41498846", "0.4143095", "0.41402698", "0.4138653", "0.41346374", "0.41342375", "0.41340837", "0.41267064", "0.4126264", "0.4123698", "0.41126934", "0.41069078", "0.41063684", "0.4103936", "0.41010243", "0.4097804", "0.40923053", "0.4086289", "0.4084019", "0.4084019", "0.4083207", "0.40777493", "0.40735918", "0.40664214", "0.40605432", "0.40602976", "0.40553656", "0.40552214" ]
0.818658
0
Computes the dimension (number of modules on a size) of the QR Code based on the position of the finder patterns and estimated module size.
function computeDimension(topLeft, topRight, bottomLeft, moduleSize) { var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize); var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize); var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7; switch (dimension & 0x03) { // mod 4 case 0: dimension++; break; // 1? do nothing case 2: dimension--; break; } return dimension; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;\n var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension: dimension, moduleSize: moduleSize };\n}", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "getDotPatternSize() {\n //const { width } = this.getWindowDimensions();\n return 28; // 28 for all for now\n }", "function calculateModuleSize(topLeft, topRight, bottomLeft, image) {\r\n\t\t return (calculateModuleSizeOneWay(topLeft, topRight, image) + calculateModuleSizeOneWay(topLeft, bottomLeft, image)) / 2;\r\n\t\t}", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "getModuleWidth(){return this.module_base_face_dimensions_axes[0];}", "getModuleDepth(){return this.module_base_face_dimensions_axes[2];}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "function cenaPoDimenziji(size) {\n switch (size) {\n case \"9x13\":\n return 10;\n case \"10x15\":\n return 15;\n case \"13x18\":\n return 20;\n case \"15x21\":\n return 25;\n case \"20x30\":\n return 30;\n case \"25x38\":\n return 35;\n }\n}", "function SizeDependWidth() {\n wImageCur = va.wSlide;\n hImageCur = M.R(wImageCur / rateImage);\n }", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "function ImageDimensions() { }", "getModuleHeight(){return this.module_left_face_dimensions_axes[1];}", "function findDimensions()\n{\n var pasca = genTwoPascal(7);\n// var pasc = genTwoPascal(12);\n// var pasc = makeSevenBruitForce();\nvar pasc = pascGen(pasca,5,7,0,pasca)\n//var pasc = testRecursion()\n var map =[]\n dimensionRecurse(pasc,map);\n// Logger.log(map);\n \n}", "function findSize(lyr) {\n var res = [];\n\n var exp = \"var obj = thisLayer.sourceRectAtTime();\\\n [obj.width,obj.height]\";\n var tempProp = lyr(\"ADBE Effect Parade\").addProperty(\"ADBE Point Control\");\n tempProp(1).expression = exp;\n res = tempProp(1).valueAtTime(0,false);\n tempProp.remove(); \n return res;\n }", "function sizeInfoPanelImage(plane) {\n var sizedImage = getImageDims(plane.img, plane.imgFolder).then(imgInfo => {\n var result = plane;\n var multiplier = 0.81 / imgInfo.height;\n result.imgHeight = imgInfo.height * multiplier;\n result.imgWidth = imgInfo.width * multiplier;\n result.imgWidth = plane.imgWidth.toString();\n result.imgHeight = plane.imgHeight.toString();\n return result;\n });\n\n return sizedImage;\n}", "calcGridAndCellsSize() {\r\n let actualWidth = ~~$(\".mdl-grid\").width();\r\n let cellSize = actualWidth / this.game.config.numColumnsOnMap;\r\n if (cellSize > 120) {\r\n cellSize = 120;\r\n } else {\r\n cellSize = 60;\r\n }\r\n $(\".mdl-cell\").each((idx, cell) => {\r\n $(cell).width(cellSize);\r\n $(cell).height(cellSize);\r\n });\r\n if (actualWidth !== cellSize * this.game.config.numColumnsOnMap) {\r\n actualWidth = cellSize * this.game.config.numColumnsOnMap;\r\n $(\".mdl-grid\").width(actualWidth);\r\n }\r\n $(\".mdl-grid\").height(cellSize * this.game.config.numRowsOnMaps);\r\n }", "function SizeDependHeight() {\n hImageCur = va.hRuby;\n wImageCur = M.R(hImageCur * rateImage);\n }", "calculateImageDimensions() {\n return { width : `${this.state.width}px`, top : `${((this.state.holderHeight - this.state.height) / 2)}px` }\n }", "_size_elements () {\n\n\t\tvar w = this.context.canvas.width\n\t\tvar h = this.context.canvas.height\n\t\tvar cw = this._deck_blue ['musician']._face_img.width\n\t\tvar ch = this._deck_blue ['musician']._face_img.height\n\n\t\tvar scale_x = (w * 0.9 / 8.0) / cw\n\t\tvar scale_y = (h / 4.0) / ch\n\t\tvar scale = Math.min (scale_x, scale_y)\n\n\t\tfor (var name in this._deck_blue) {\n\t\t\tthis._deck_blue [name].set_size (cw * scale)\n\t\t}\n\t\tfor (var name in this._deck_red) {\n\t\t\tthis._deck_red [name].set_size (cw * scale)\n\t\t}\n\t}", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "function getLength(q){\n h = 1 / 128;\n var hh = h * 2;\n var m = [q[3][0] - q[0][0] + 3 * (q[1][0] - q[2][0]),\n q[0][0] - 2 * q[1][0] + q[2][0],\n q[1][0] - q[0][0]];\n var n = [q[3][1] - q[0][1] + 3 * (q[1][1] - q[2][1]),\n q[0][1] - 2 * q[1][1] + q[2][1],\n q[1][1] - q[0][1]];\n var k = [ m[0] * m[0] + n[0] * n[0],\n 4 * (m[0] * m[1] + n[0] * n[1]),\n 2 * ((m[0] * m[2] + n[0] * n[2]) + 2 * (m[1] * m[1] + n[1] * n[1])),\n 4 * (m[1] * m[2] + n[1] * n[2]), m[2] * m[2] + n[2] * n[2] ];\n var fc = function(t, k){\n return Math.sqrt(t * (t * (t * (t * k[0] + k[1]) + k[2]) + k[3]) + k[4]) || 0 };\n var sm = (fc(0, k) - fc(1, k)) / 2;\n for(var t = h; t < 1; t += hh) sm += 2 * fc(t, k) + fc(t + h, k);\n return sm * hh;\n}", "function findSize() {\n\t// pobiera wysokosc szerokosc okna\n\tvar height = $(window).height();\n\tvar width = $(window).width();\n\n\t// wysokosc i szerokosc 2panelow: na gorze i po prawej\n\tvar heightTopPanel = $(\".topPanelContainer\").height() + 70;\n\tvar widthInfoPanel = $(\".infoPanelContainer\").width() + 44;\n\n\t// ustawia wielkosci panelow mapy i info\n\t$(\".mapa\").height(height - heightTopPanel);\n\t$(\".infoPanelContainer\").height(height - heightTopPanel);\n\t$(\".mapa\").width(width - widthInfoPanel);\n}", "function computeSizes() {\n // x dimension (horizontal) is 4/5 of the y dimension (vertical)\n let canvasRatio = 4 / 5;\n let screenProportion = 0.8;\n let boardProportion = 0.2;\n let gridxDimension = 7;\n let gridyDimension = 6;\n let gridRatio = gridxDimension / gridyDimension;\n let gridProportion = 0.8;\n\n // Compute the sizes of the p5js grid\n if (windowHeight * canvasRatio < windowWidth) {\n // Decide according to vertical space\n sizes.canvasy = screenProportion * windowHeight;\n sizes.canvasx = sizes.canvasy * canvasRatio;\n }\n else {\n // Decide according to horizontal space\n sizes.canvasx = screenProportion * windowWidth;\n sizes.canvasy = sizes.canvasx / canvasRatio;\n }\n\n // Text size\n sizes.textsize = sizes.canvasy * 0.045;\n sizes.subtextsize = sizes.canvasy * 0.035;\n\n // Board size\n sizes.boardsize = sizes.canvasy * boardProportion;\n\n // Compute the sizes of the grid itself\n if ((sizes.canvasy - sizes.boardsize) * gridRatio < sizes.canvasx) {\n // Decide according to vertical space\n sizes.ysize = gridProportion * (sizes.canvasy - sizes.boardsize);\n sizes.xsize = sizes.ysize * gridRatio;\n }\n else {\n // Decide according to horizontal space\n sizes.xsize = gridProportion * sizes.canvasx;\n sizes.ysize = sizes.xsize / gridRatio;\n }\n sizes.size = sizes.xsize / gridxDimension;\n\n // Initial positions of the lines\n sizes.initialx = (sizes.canvasx - sizes.xsize) / 2;\n sizes.initialy = sizes.boardsize + (sizes.canvasy - sizes.boardsize - sizes.ysize) / 2;\n\n // To place things on the message board\n sizes.boardx = sizes.canvasx / 2;\n sizes.boardytop = sizes.boardsize / 4;\n sizes.boardybot = sizes.boardsize * 3 / 4;\n sizes.rad = sizes.size * 3 / 4;\n}", "calcRegionSizeGlobal() {\n // this should only get done once\n // scanCol is the column that has the data we care about putting in the color fill\n // this returns a summary object that knows things about the size of the brain json dimensions and also the min and max of hte scan data\n //!! should only do this part once\n let globals = [1000, 1000, -1000, -1000]\n for (let sliceName in this.paneOb.regionBoundaryData) {\n let slice = this.paneOb.regionBoundaryData[sliceName]\n // skip if there's a single point feature\n for (let feature of slice.features) {\n // likely nota loop because coordinates is a single element array\n for (let line of feature.geometry.coordinates) {\n for (let pt of line) {\n if (pt[0] < globals[0]) {\n globals[0] = pt[0]\n }\n if (pt[1] < globals[1]) {\n globals[1] = pt[1]\n }\n if (pt[0] > globals[2]) {\n globals[2] = pt[0]\n }\n if (pt[1] > globals[3]) {\n globals[3] = pt[1]\n }\n }\n }\n }\n\n\n\n }\n /** This is a list of smallest and largest values found in the x,y dimensions within the geojson data provided. This is used to scale the region coordinates to the space of the canvas */\n this.regionSizes = globals\n /** This is a ratio of the heightvs the width of the brain data. Helpful for determining what the maximum value of our y interpolator should be. */\n this.canvasRatio = globals[3] / globals[2]\n }", "function size() {\n return n;\n }", "function sizeRanger(sz) {\n let szGrp = 8;\n if (sz > 6) szGrp = 16;\n if (sz > 24) szGrp = 32;\n if (sz > 72) szGrp = 48;\n return szGrp;\n }", "function getSize(dimensions) {\r\n\tvar size = 0;\r\n\tif (dimensions) {\r\n\t\t// get first number in dimensions\r\n\t\tvar dArray = dimensions.split(\" \");\r\n\t\tvar i = dArray.findIndex(Number);\r\n\t\tvar d1 = dArray[i];\r\n\t\tdArray = dArray.slice(i + 1);\r\n\r\n\t\t// get second number, if one exists\r\n\t\ti = dArray.findIndex(Number);\r\n\t\tif (i != -1) {\r\n\t\t\tvar d2 = dArray[i];\r\n\t\t} else {\r\n\t\t\tvar d2 = 1;\r\n\t\t}\r\n\r\n\t\t// cap size \r\n\t\tif (d1 > dimensionCap) {\r\n\t\t\td1 = dimensionCap;\r\n\t\t}\r\n\t\tif (d2 > dimensionCap) {\r\n\t\t\td2 = dimensionCap;\r\n\t\t}\r\n\r\n\t\t// use logarithmic scale\r\n\t\tif ((d1 > 0) && (d2 > 0)) {\r\n\t\t\tsize = Math.round((convolver.length - 1)*Math.log(Math.sqrt(d1*d2))/Math.log(dimensionCap));\r\n\t\t}\r\n\r\n\t\tif (size < 0) {\r\n\t\t\tsize = 0;\r\n\t\t} else if (size > (convolver.length - 1)) {\r\n\t\t\tsize = (convolver.length - 1);\r\n\t\t}\r\n\t\t\r\n\t\tdArray = null;\r\n\t\ti = null;\r\n\t\td1 = null;\r\n\t\td2 = null;\r\n\t}\r\n\r\n\tdimensions = null;\r\n\r\n\treturn size;\r\n}", "function getSize(d) {\n return 750;\n}", "function updateSizeValues(){\n\tswitch (runDialog.sizeConfig.outputPresetInput.selection.index){\n\t\tcase 0:\n\t\t\tsetSizeValues(8.5, 11, 6, 9, 150);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tsetSizeValues(11, 8.5, 9, 6, 150);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsetSizeValues(11, 14, 8, 12, 150);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsetSizeValues(14, 11, 12, 8, 150);\n\t\t\tbreak;\n\t}\n}", "function findWidth() {\n if (noteStack == \"stack_bar_top\") {\n return \"100%\";\n }\n if (noteStack == \"stack_bar_bottom\") {\n return \"70%\";\n } else {\n return \"290px\";\n }\n }", "function computeSizes () { \n\tvar width = $(window).width();\n\tvar height = $(window).height();\n\tvar margin = 100;\n\tvar dimens = {\n\t\theight:height,\n\t\twidth: width,\n\t\tmargin: margin\n\t}\n\treturn dimens;\n}", "function setDimensionsFromNumSquares() {\n boardWidth = numSquaresX * xIncrement;\n headerWidth = boardWidth;\n boardHeight = numSquaresY * yIncrement;\n}", "function getSizes()\n {\n sizes.field.rows = 3;\n sizes.field.cols = 6;\n\n sizes.desk.height = DOM.parent.offsetHeight / 3;\n sizes.desk.width = properties.coverSize.width * sizes.desk.height / properties.coverSize.height;\n sizes.deskContainer.marginBottom = sizes.desk.width / 2;\n\n sizes.card.height = DOM.parent.offsetHeight / 4.5;\n sizes.card.width = properties.coverSize.width * sizes.card.height / properties.coverSize.height;\n }", "static getCardSizeFromSprite() {\n return {\n width: 81,\n height: 117.5\n };\n }", "function calculateSquareSize () {\n var containerWidth = parseInt($container.width(), 10)\n\n // defensive, prevent infinite loop\n if (!containerWidth || containerWidth <= 0) {\n return 0\n }\n\n // pad one pixel\n var boardWidth = containerWidth - 1\n\n while (boardWidth % num_cols() !== 0 && boardWidth > 0) {\n boardWidth = boardWidth - 1\n }\n\n return boardWidth / num_cols()\n }", "function calculate16by9($item) {\n $item.each(function(){\n $(this).css('height', $(this).parent().width() * 9 / 16);\n });\n }", "function calcElementsSize(){\r\n\t\r\n\tvar bodyHeight = window.innerHeight;\r\n\t// partimos del ancho como referencia para obtener cosas \"cuadradas\"\r\n\tvar boardWidth = $('.detail-panel').width();\r\n\t// Asignamos el height deseado a las fuentes\r\n\t$('.detail-panel').css({'font-size':((boardWidth*1/4)/4)+'px'});\r\n\t$('.detail-panel').css({'line-height':(((boardWidth*1/4)/4)+2)+'px'});\r\n\t$('.money-gold, .money-silver, .money-copper').css({'background-size':((boardWidth*1/5)/3)+'px '+((boardWidth*1/5)/3)+'px'});\r\n\t$('.money-gold, .money-silver, .money-copper').css({'padding-right':((boardWidth*1/5)/3)+'px'});\r\n}", "function getDimCanavs() {\n w = canvas.width;\n h = canvas.height;\n }", "get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }", "function findDimensions(gd, sliderOpts) {\n var sliderLabels = Drawing.tester.selectAll('g.' + constants.labelGroupClass).data(sliderOpts._visibleSteps);\n sliderLabels.enter().append('g').classed(constants.labelGroupClass, true);\n\n // loop over fake buttons to find width / height\n var maxLabelWidth = 0;\n var labelHeight = 0;\n sliderLabels.each(function (stepOpts) {\n var labelGroup = d3.select(this);\n var text = drawLabel(labelGroup, {\n step: stepOpts\n }, sliderOpts);\n var textNode = text.node();\n if (textNode) {\n var bBox = Drawing.bBox(textNode);\n labelHeight = Math.max(labelHeight, bBox.height);\n maxLabelWidth = Math.max(maxLabelWidth, bBox.width);\n }\n });\n sliderLabels.remove();\n var dims = sliderOpts._dims = {};\n dims.inputAreaWidth = Math.max(constants.railWidth, constants.gripHeight);\n\n // calculate some overall dimensions - some of these are needed for\n // calculating the currentValue dimensions\n var graphSize = gd._fullLayout._size;\n dims.lx = graphSize.l + graphSize.w * sliderOpts.x;\n dims.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n if (sliderOpts.lenmode === 'fraction') {\n // fraction:\n dims.outerLength = Math.round(graphSize.w * sliderOpts.len);\n } else {\n // pixels:\n dims.outerLength = sliderOpts.len;\n }\n\n // The length of the rail, *excluding* padding on either end:\n dims.inputAreaStart = 0;\n dims.inputAreaLength = Math.round(dims.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n var textableInputLength = dims.inputAreaLength - 2 * constants.stepInset;\n var availableSpacePerLabel = textableInputLength / (sliderOpts._stepCount - 1);\n var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n dims.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n dims.labelHeight = labelHeight;\n\n // loop over all possible values for currentValue to find the\n // area we need for it\n dims.currentValueMaxWidth = 0;\n dims.currentValueHeight = 0;\n dims.currentValueTotalHeight = 0;\n dims.currentValueMaxLines = 1;\n if (sliderOpts.currentvalue.visible) {\n // Get the dimensions of the current value label:\n var dummyGroup = Drawing.tester.append('g');\n sliderLabels.each(function (stepOpts) {\n var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n var curValSize = curValPrefix.node() && Drawing.bBox(curValPrefix.node()) || {\n width: 0,\n height: 0\n };\n var lines = svgTextUtils.lineCount(curValPrefix);\n dims.currentValueMaxWidth = Math.max(dims.currentValueMaxWidth, Math.ceil(curValSize.width));\n dims.currentValueHeight = Math.max(dims.currentValueHeight, Math.ceil(curValSize.height));\n dims.currentValueMaxLines = Math.max(dims.currentValueMaxLines, lines);\n });\n dims.currentValueTotalHeight = dims.currentValueHeight + sliderOpts.currentvalue.offset;\n dummyGroup.remove();\n }\n dims.height = dims.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + dims.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n var xanchor = 'left';\n if (Lib.isRightAnchor(sliderOpts)) {\n dims.lx -= dims.outerLength;\n xanchor = 'right';\n }\n if (Lib.isCenterAnchor(sliderOpts)) {\n dims.lx -= dims.outerLength / 2;\n xanchor = 'center';\n }\n var yanchor = 'top';\n if (Lib.isBottomAnchor(sliderOpts)) {\n dims.ly -= dims.height;\n yanchor = 'bottom';\n }\n if (Lib.isMiddleAnchor(sliderOpts)) {\n dims.ly -= dims.height / 2;\n yanchor = 'middle';\n }\n dims.outerLength = Math.ceil(dims.outerLength);\n dims.height = Math.ceil(dims.height);\n dims.lx = Math.round(dims.lx);\n dims.ly = Math.round(dims.ly);\n var marginOpts = {\n y: sliderOpts.y,\n b: dims.height * FROM_BR[yanchor],\n t: dims.height * FROM_TL[yanchor]\n };\n if (sliderOpts.lenmode === 'fraction') {\n marginOpts.l = 0;\n marginOpts.xl = sliderOpts.x - sliderOpts.len * FROM_TL[xanchor];\n marginOpts.r = 0;\n marginOpts.xr = sliderOpts.x + sliderOpts.len * FROM_BR[xanchor];\n } else {\n marginOpts.x = sliderOpts.x;\n marginOpts.l = dims.outerLength * FROM_TL[xanchor];\n marginOpts.r = dims.outerLength * FROM_BR[xanchor];\n }\n Plots.autoMargin(gd, autoMarginId(sliderOpts), marginOpts);\n}", "function getSquareSize() {\n let size = string.length;\n let sqrt = Math.sqrt(size);\n\n // check if the sqrt is an integer\n if (sqrt % 1 == 0) {\n //return width = height\n return sqrt;\n } else {\n alert(\"Pattern in file must be a square !\");\n return null;\n }\n}", "get scalableComponentsCount() {\n\t\t\tvar scalableComponentIdentifiers = this.scalableHeightComponentIdentifiers;\n\n\t\t\tvar scalableComponentsCount = scalableComponentIdentifiers.dimension.length + scalableComponentIdentifiers.margin.length;\n\n\t\t\treturn scalableComponentsCount;\n\t\t}", "function calculateAllDimensions(imageView) {\n\n //dimensions of image\n allDimensions.imageWidth = imageView.image.width;\n allDimensions.imageHeight = imageView.image.height;\n\n //dimensions of image including inner frame\n allDimensions.framedImageWidth =\n allDimensions.imageWidth + 2 * allDimensions.innerFrameThickness;\n allDimensions.framedImageHeight =\n allDimensions.imageHeight + 2 * allDimensions.innerFrameThickness;\n\n //dimensions of framed image\n allDimensions.outerFrameWidth = allDimensions.framedImageWidth *\n (1 + frameWidthIncPerc / 100);\n allDimensions.outerFrameHeight = allDimensions.framedImageHeight *\n (1 + frameHeightIncPerc / 100);\n\n //calculate vertical dimension of title bar\n allDimensions.titleBarHeight = Math.trunc(\n (allDimensions.outerFrameHeight/2 - allDimensions.framedImageHeight/2) -\n (verticalImageFactor - 0.5) * allDimensions.framedImageHeight);\n\n //calculate vertical dimension of bottom bar\n allDimensions.bottomBarHeight = Math.trunc(\n (allDimensions.outerFrameHeight/2 - allDimensions.framedImageHeight/2) -\n (0.5 - verticalImageFactor) * allDimensions.framedImageHeight);\n}", "function getSize(sizeModLoc){\n return map(sizeModLoc, 400, 570, 100, 3)\n}", "function determinePanelSize() {\n\t\tvar s = panels.eq(0).height();\n\t\t\n\t\tfor (var i = 0; i < panels.length; i++) {\n\t\t\tif (s<panels.eq(i).height()){\n\t\t\t\ts = panels.eq(i).height();\n\t\t\t}\n\t\t}\n\t\tpanels.css({'height':s});\n\t}", "function setNumSquaresFromDimensions() {\n while (numSquaresX * xIncrement + xIncrement < boardWidth) {\n numSquaresX++;\n }\n\n while (numSquaresY * yIncrement + yIncrement < boardHeight) {\n numSquaresY++;\n }\n}", "getColumnsAmount() { //metodo para calcular a quantidade de coluna disponivel baseado no tamanho do bloco, para saber as dimensoes do celular\n const width = Dimensions.get('window').width\n return Math.floor(width / this.blockSize)\n }", "function getGameDimensions(elem) {\n\t var tmpWidth = elem.width();\n var controlHeight = $(\"#mr-scores\").height() + $(\"#mr-scores\").height() + $(\"#mr-navigation\").height();\n\n for (var i = tmpWidth; i > tmpWidth - settings.columns; i--)\n\t\t{\n\t\t\tif(i%settings.columns == 0)\n\t\t\t{\n\t\t\t\ttmpWidth = i;\n\t\t\t}\n\t\t}\n\t\n\t\tsettings.width = tmpWidth;\n\t\tsettings.height = (tmpWidth / settings.columns) * settings.rows;\n\n\t\tvar maxHeight = window.innerHeight - controlHeight*2;\n\n\t\tif (settings.height > maxHeight)\n\t\t{\n\t\t settings.height = maxHeight;\n\t\t settings.width = (maxHeight / settings.rows) * settings.columns;\n\t\t}\n\t}", "function initViewSize() {\n const rect = mCanvas.getBoundingClientRect()\n const side = Math.pow(2, Math.floor(Math.log(Math.min(rect.width, rect.height)) / Math.log(2)));\n return initSize(side, side)\n}", "function size() {\n return [cols, rows];\n }", "compileResultSize(compileResult) {\n\t\tif (!compileResult.data) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn compileResult.data.length + compileResult.sourceMap.length\n\t}", "function size() {\n\t return n;\n\t }", "function markerSize(eq) {\n return (Math.pow(eq, 3) / 2.3);\n}", "_size() {\n const scaleRatio = (window.innerHeight) / (this.gameBoard.height + 2 * config.board.padding);\n this.renderer.resize(window.innerWidth, window.innerHeight);\n this.gameBoard.height *= scaleRatio;\n this.gameBoard.width *= scaleRatio;\n this.gameBoard.position.set((this.screen.width / 2) - (this.gameBoard.width / 2), config.board.padding);\n }", "calcContainerWidth() {\n const { width } = this.getWindowDimensions();\n const dotPatternSize = this.getDotPatternSize();\n const divider = width / dotPatternSize;\n const containerWidth = Math.max(dotPatternSize * Math.floor(divider), 744);\n this.setState({ containerWidth });\n }", "function findDimensions(gd, sliderOpts) {\n\t var sliderLabels = gd._tester.selectAll('g.' + constants.labelGroupClass)\n\t .data(sliderOpts.steps);\n\t\n\t sliderLabels.enter().append('g')\n\t .classed(constants.labelGroupClass, true);\n\t\n\t // loop over fake buttons to find width / height\n\t var maxLabelWidth = 0;\n\t var labelHeight = 0;\n\t sliderLabels.each(function(stepOpts) {\n\t var labelGroup = d3.select(this);\n\t\n\t var text = drawLabel(labelGroup, {step: stepOpts}, sliderOpts);\n\t\n\t var tWidth = (text.node() && Drawing.bBox(text.node()).width) || 0;\n\t\n\t // This just overwrites with the last. Which is fine as long as\n\t // the bounding box (probably incorrectly) measures the text *on\n\t // a single line*:\n\t labelHeight = (text.node() && Drawing.bBox(text.node()).height) || 0;\n\t\n\t maxLabelWidth = Math.max(maxLabelWidth, tWidth);\n\t });\n\t\n\t sliderLabels.remove();\n\t\n\t sliderOpts.inputAreaWidth = Math.max(\n\t constants.railWidth,\n\t constants.gripHeight\n\t );\n\t\n\t sliderOpts.currentValueMaxWidth = 0;\n\t sliderOpts.currentValueHeight = 0;\n\t sliderOpts.currentValueTotalHeight = 0;\n\t\n\t if(sliderOpts.currentvalue.visible) {\n\t // Get the dimensions of the current value label:\n\t var dummyGroup = gd._tester.append('g');\n\t\n\t sliderLabels.each(function(stepOpts) {\n\t var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n\t var curValSize = (curValPrefix.node() && Drawing.bBox(curValPrefix.node())) || {width: 0, height: 0};\n\t sliderOpts.currentValueMaxWidth = Math.max(sliderOpts.currentValueMaxWidth, Math.ceil(curValSize.width));\n\t sliderOpts.currentValueHeight = Math.max(sliderOpts.currentValueHeight, Math.ceil(curValSize.height));\n\t });\n\t\n\t sliderOpts.currentValueTotalHeight = sliderOpts.currentValueHeight + sliderOpts.currentvalue.offset;\n\t\n\t dummyGroup.remove();\n\t }\n\t\n\t var graphSize = gd._fullLayout._size;\n\t sliderOpts.lx = graphSize.l + graphSize.w * sliderOpts.x;\n\t sliderOpts.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n\t\n\t if(sliderOpts.lenmode === 'fraction') {\n\t // fraction:\n\t sliderOpts.outerLength = Math.round(graphSize.w * sliderOpts.len);\n\t } else {\n\t // pixels:\n\t sliderOpts.outerLength = sliderOpts.len;\n\t }\n\t\n\t // Set the length-wise padding so that the grip ends up *on* the end of\n\t // the bar when at either extreme\n\t sliderOpts.lenPad = Math.round(constants.gripWidth * 0.5);\n\t\n\t // The length of the rail, *excluding* padding on either end:\n\t sliderOpts.inputAreaStart = 0;\n\t sliderOpts.inputAreaLength = Math.round(sliderOpts.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n\t\n\t var textableInputLength = sliderOpts.inputAreaLength - 2 * constants.stepInset;\n\t var availableSpacePerLabel = textableInputLength / (sliderOpts.steps.length - 1);\n\t var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n\t sliderOpts.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n\t sliderOpts.labelHeight = labelHeight;\n\t\n\t sliderOpts.height = sliderOpts.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + sliderOpts.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n\t\n\t var xanchor = 'left';\n\t if(anchorUtils.isRightAnchor(sliderOpts)) {\n\t sliderOpts.lx -= sliderOpts.outerLength;\n\t xanchor = 'right';\n\t }\n\t if(anchorUtils.isCenterAnchor(sliderOpts)) {\n\t sliderOpts.lx -= sliderOpts.outerLength / 2;\n\t xanchor = 'center';\n\t }\n\t\n\t var yanchor = 'top';\n\t if(anchorUtils.isBottomAnchor(sliderOpts)) {\n\t sliderOpts.ly -= sliderOpts.height;\n\t yanchor = 'bottom';\n\t }\n\t if(anchorUtils.isMiddleAnchor(sliderOpts)) {\n\t sliderOpts.ly -= sliderOpts.height / 2;\n\t yanchor = 'middle';\n\t }\n\t\n\t sliderOpts.outerLength = Math.ceil(sliderOpts.outerLength);\n\t sliderOpts.height = Math.ceil(sliderOpts.height);\n\t sliderOpts.lx = Math.round(sliderOpts.lx);\n\t sliderOpts.ly = Math.round(sliderOpts.ly);\n\t\n\t Plots.autoMargin(gd, constants.autoMarginIdRoot + sliderOpts._index, {\n\t x: sliderOpts.x,\n\t y: sliderOpts.y,\n\t l: sliderOpts.outerLength * ({right: 1, center: 0.5}[xanchor] || 0),\n\t r: sliderOpts.outerLength * ({left: 1, center: 0.5}[xanchor] || 0),\n\t b: sliderOpts.height * ({top: 1, middle: 0.5}[yanchor] || 0),\n\t t: sliderOpts.height * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n\t });\n\t}", "function getCanvasSize(){\n let elem = document.querySelectorAll(\".square\");\n elem.forEach(removeElement);\n let elem2 = container.querySelectorAll(\"br\");\n elem2.forEach(removeElement);\n if (isNaN(canvasSize) || canvasSize <= 0 || canvasSize > 128) {\n canvasSize = 16;\n }\n else {\n canvasSize = document.getElementById(\"canvas-size\").value;\n }\n createCanvas();\n addListener();\n }", "function size(d) {\n\n switch (d.nodeType) {\n case \"likerNode\":\n return Math.sqrt(d.size) * 5 || 6;\n case \"taggedNode\":\n return Math.sqrt(d.size) * 5 || 4;\n case \"postNode\":\n return Math.sqrt(d.size) * 5 || 4.5;\n case \"coreNode\":\n return 20;\n case \"year\":\n return Math.sqrt(d.size) / 5 || 8;\n default:\n return Math.sqrt(d.size) * 5 || 4.5;\n }\n }", "function reCalculateDimensions() {\n thresholdDragWidth = Math.min(messagesContainer.offsetWidth / 3.5, 200);\n minCardBeforeRefetch = Math.ceil((window.innerHeight - HEADER_HEIGHT) / APPROX_MSG_CARD_HEIGHT);\n limit = minCardBeforeRefetch + BUFFER_CARD;\n }", "getImageSize() {\n if (this.staticimdiv !== undefined) {\n this.imwidth = this.staticimdiv.naturalWidth;\n this.imheight = this.staticimdiv.naturalHeight;\n }\n }", "getSize() {\n // YOUR CODE HERE\n }", "setPxSizes() {\n var px_per_em = this.getEmSize( this.jqueryMap.$container.get(0) );\n\n this.stateMap.px_per_em = px_per_em;\n this.stateMap.alone_height_px = this.configMap.alone_height_em * px_per_em;\n this.stateMap.other_height_px = this.configMap.other_height_em * px_per_em;\n }", "function get_board_size() {\n return board_size;\n}", "function expr_size(s_expr)\n{\n\tif(s_expr instanceof Array)\n\t{\n\t\tswitch(s_expr[0])\n\t\t{\n\t\t\tcase 'lambda':\n\t\t\t\treturn 1 + expr_size(s_expr[2]);\n\t\t\tcase 'not':\n\t\t\tcase 'shl1':\n\t\t\tcase 'shr1':\n\t\t\tcase 'shr4':\n\t\t\tcase 'shr16':\n case 'op1':\n\t\t\t\treturn 1 + expr_size(s_expr[1]);\n\t\t\tcase 'and':\n\t\t\tcase 'or':\n\t\t\tcase 'xor':\n\t\t\tcase 'plus':\n case 'op2':\n\t\t\t\treturn 1 + expr_size(s_expr[1]) + expr_size(s_expr[2]);\n\t\t\tcase 'if0':\n\t\t\t\treturn 1 + expr_size(s_expr[1]) + expr_size(s_expr[2]) + expr_size(s_expr[3]);\n\t\t\tcase 'fold':\n\t\t\t\treturn 2 + expr_size(s_expr[1]) + expr_size(s_expr[2]) + expr_size(s_expr[3][2]);\n\t\t}\n\t}\n\treturn 1;\n}", "static size(_width, _height) {\n crc2.canvas.width = _width;\n crc2.canvas.height = _height;\n crc2.save();\n crc2.fillStyle = \"#a0a0a0\";\n crc2.fillRect(0, 0, _width, _height);\n crc2.restore();\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function dimension(divs) {\n return nodesToRanges(\n coverDomain(\n shapeToNodes(\n makeNodes(divs)\n )\n )\n )\n }", "function matLength(material){\n return material.length;\n}", "function RMXFViewer_SetSize()\n{\n var instText1 = \"You must install \";\n var instText2 = \"Vidicor View Component\";\n var instText3 = \"Click this link and run the file then follow his instructions.\";\n var instText4 = \"Press F5 since installation complete.\";\n var instText5 = \"Attention! This page requires additional component to work.\\n\" +\n \"Press OK and follow component installation instructions.\";\n if (lang == 'ru')\n {\n instText1 = \"Вам необходимо установить \";\n instText2 = \"компонент просмотра Vidicor\";\n instText3 = \"Нажмите на эту ссылку, запустите файл и следуйте его инструкциям.\";\n instText4 = \"После завершения установки нажмите F5.\";\n instText5 = \"Внимание! Эта страница требует для работы установки дополнительного компонента.\\n\" +\n \"Нажмите OK и следуйте появившимся инструкциям по установке компонента.\";\n }\n\n var w = -1;\n var h = -1;\n if (arguments.length == 2)\n {\n w = parseInt(arguments[0]);\n h = parseInt(arguments[1]);\n }\n else\n if (arguments.length == 1)\n {\n var str = new String(arguments[0]);\n var xi = str.indexOf('x', 0);\n if (xi < 0) xi = str.indexOf('X', 0);\n if (xi < 0) xi = str.indexOf('*', 0);\n if (xi >= 0)\n {\n w = parseInt(str.substring(0, xi));\n h = parseInt(str.substring(xi + 1));\n }\n }\n else\n if (arguments.length == 0)\n {\n w = this.reqW;\n h = this.reqH;\n }\n if ((w >= 0) && (h >= 0))\n {\n this.reqW = w;\n this.reqH = h;\n if ((this.rmxfobj != null) &&\n (this.rmxfobj.readyState >= 4))\n {\n if (this.rmxfobj.URL != null)\n window.setTimeout('RMXFCallSetVideoSize(' + this.rmxfidx + ', ' + w + ', ' + h + ')', 10);\n else\n {\n this.rmxftag.innerHTML = \"<TABLE id=instructions\" +\n \t\t\t \"width=\" + this.reqW + \n \t\t\t \" height=\" + this.reqH +\n \t\t\t \"border=0 cellpadding=0 cellspacing=0>\" +\n \"<TR><TD align=center valign=middle>\" +\n \"<FONT color=#D00000>\" + instText1 + \n \"<BR><A href='http://\" + this.rmxfhost +\n \"/activex_setup.exe'>\" + instText2 + \n \"</A></FONT><BR>\" +\n \"<LI>\" + instText3 +\n \"<LI>\" + instText4 +\n \"</TD></TR></TABLE>\";\n instructions.scrollIntoView(true);\n alert(instText5);\n }\n }\n }\n}", "function get_radius(d) {\n var scount = 0,\n max_size = 30,\n min_size = 4,\n fixed_size = true,\n iSize = 4;\n\n if (d !== undefined) {\n scount = d.scount;\n }\n if (\"overlap_scount\" in loc_network_options && loc_network_options[\"overlap_scount\"] === true) {\n // Need to pay more attention to the scount\n iSize = Math.max(4, scount + 1);\n iSize = min_size + max_size * iSize / maxcount;\n } else if (fixed_size) {\n // Issue #578: fix this to one size\n iSize = 4;\n } else {\n // This is usually [5]\n iSize = Math.max(5, scount / 4);\n }\n return iSize;\n }", "function gridSize(){\n var rows = countRows();\n var cols = countColumns();\n var sizeText = rows + \" x \" + cols;\n return sizeText;\n}", "function imgsize(){\n\tvar img = get('wcr_imagen');\n\tif(img.naturalWidth) return {wi: img.naturalWidth, hi: img.naturalHeight};\n\n\timg = get('wcr_imagen'+posActual);\n\treturn img ? {wi: img.width, hi: img.height} : {wi:0, hi:0};\n}", "dimension() {\n if (!this.item.width) {\n return '';\n }\n return `${this.item.width}px * ${this.item.height}px`;\n }", "static getPixelSizeForLayoutSize(layoutSize: number): number {\n return Math.round(layoutSize * PixelRatio.get());\n }", "function circleSize(mag) {\n return mag * 10000;\n}", "getPictureWidth() {\n const mwm = (this.camera.MatrixWidth / 10000); /* Matrix Width in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mwm * altitude) / fm).toFixed(2);\n }", "function markerSize(magnitud) {\n return magnitud;\n}", "function gameSize(num) {\n const numOfPairs = document.querySelector('#numOfPairs') //total number of matches on display\n\n activeCardDeck = []\n gridSize = num\n numOfPairs.innerHTML = num / 2\n\n //Outputs array called activeCardDeck that is 12, 20 or 24 in length\n if (num === 24) {\n defaultCards.forEach( item => {activeCardDeck.push(item)} )\n } else if (num === 12) {\n defaultCards.forEach( item => {if (item.id < 7 ) {activeCardDeck.push(item)}} )\n \n } else if (num === 20) {\n defaultCards.forEach( item => {if (item.id < 11 ) {activeCardDeck.push(item)}} )\n }\n \n deleteBoard()\n createBoard(activeCardDeck)\n cssGridStyle(gridSize)\n}", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "size() {\n return this._minErrors.length * (this._w + 1);\n }", "function calSvgSize(row, col, tile_size) {\n\treturn {w:tile_size.w*col+50, h:tile_size.h*row+50}\n}", "function Detector(image) {\n function DetectorResult(bits, points) {\n this.bits = bits;\n this.points = points;\n }\n this.image = image;\n this.resultPointCallback = null;\n\n this.sizeOfBlackWhiteBlackRun = function(fromX, fromY, toX, toY) {\n // Mild variant of Bresenham's algorithm;\n // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\n var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\n if (steep) {\n var temp = fromX;\n fromX = fromY;\n fromY = temp;\n temp = toX;\n toX = toY;\n toY = temp;\n }\n\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = -dx >> 1;\n var ystep = fromY < toY ? 1 : -1;\n var xstep = fromX < toX ? 1 : -1;\n var state = 0; // In black pixels, looking for white, first or second time\n for (var x = fromX, y = fromY; x != toX; x += xstep) {\n\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (state == 1) {\n // In white pixels, looking for black\n if (this.image[realX + realY * qrcode.width]) {\n state++;\n }\n } else {\n if (!this.image[realX + realY * qrcode.width]) {\n state++;\n }\n }\n\n if (state == 3) {\n // Found black, white, black, and stumbled back onto white; done\n var diffX = x - fromX;\n var diffY = y - fromY;\n return Math.sqrt((diffX * diffX + diffY * diffY));\n }\n error += dy;\n if (error > 0) {\n if (y == toY) {\n break;\n }\n y += ystep;\n error -= dx;\n }\n }\n var diffX2 = toX - fromX;\n var diffY2 = toY - fromY;\n return Math.sqrt((diffX2 * diffX2 + diffY2 * diffY2));\n }\n\n\n this.sizeOfBlackWhiteBlackRunBothWays = function(fromX, fromY, toX, toY) {\n\n var result = this.sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);\n\n // Now count other way -- don't run off image though of course\n var scale = 1.0;\n var otherToX = fromX - (toX - fromX);\n if (otherToX < 0) {\n scale = fromX / (fromX - otherToX);\n otherToX = 0;\n } else if (otherToX >= qrcode.width) {\n scale = (qrcode.width - 1 - fromX) / (otherToX - fromX);\n otherToX = qrcode.width - 1;\n }\n var otherToY = Math.floor(fromY - (toY - fromY) * scale);\n\n scale = 1.0;\n if (otherToY < 0) {\n scale = fromY / (fromY - otherToY);\n otherToY = 0;\n } else if (otherToY >= qrcode.height) {\n scale = (qrcode.height - 1 - fromY) / (otherToY - fromY);\n otherToY = qrcode.height - 1;\n }\n otherToX = Math.floor(fromX + (otherToX - fromX) * scale);\n\n result += this.sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);\n return result - 1.0; // -1 because we counted the middle pixel twice\n }\n\n\n\n this.calculateModuleSizeOneWay = function(pattern, otherPattern) {\n var moduleSizeEst1 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(pattern.X), Math.floor(pattern.Y), Math.floor(otherPattern.X), Math.floor(otherPattern.Y));\n var moduleSizeEst2 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(otherPattern.X), Math.floor(otherPattern.Y), Math.floor(pattern.X), Math.floor(pattern.Y));\n if (isNaN(moduleSizeEst1)) {\n return moduleSizeEst2 / 7.0;\n }\n if (isNaN(moduleSizeEst2)) {\n return moduleSizeEst1 / 7.0;\n }\n // Average them, and divide by 7 since we've counted the width of 3 black modules,\n // and 1 white and 1 black module on either side. Ergo, divide sum by 14.\n return (moduleSizeEst1 + moduleSizeEst2) / 14.0;\n }\n\n\n this.calculateModuleSize = function(topLeft, topRight, bottomLeft) {\n // Take the average\n return (this.calculateModuleSizeOneWay(topLeft, topRight) + this.calculateModuleSizeOneWay(topLeft, bottomLeft)) / 2.0;\n }\n\n this.distance = function(pattern1, pattern2) {\n xDiff = pattern1.X - pattern2.X;\n yDiff = pattern1.Y - pattern2.Y;\n return Math.sqrt((xDiff * xDiff + yDiff * yDiff));\n }\n this.computeDimension = function(topLeft, topRight, bottomLeft, moduleSize) {\n\n var tltrCentersDimension = Math.round(this.distance(topLeft, topRight) / moduleSize);\n var tlblCentersDimension = Math.round(this.distance(topLeft, bottomLeft) / moduleSize);\n var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\n switch (dimension & 0x03) {\n\n // mod 4\n case 0:\n dimension++;\n break;\n // 1? do nothing\n\n case 2:\n dimension--;\n break;\n\n case 3:\n throw \"Error\";\n }\n return dimension;\n }\n\n this.findAlignmentInRegion = function(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor) {\n // Look for an alignment pattern (3 modules in size) around where it\n // should be\n var allowance = Math.floor(allowanceFactor * overallEstModuleSize);\n var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\n var alignmentAreaRightX = Math.min(qrcode.width - 1, estAlignmentX + allowance);\n if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\n throw \"Error\";\n }\n\n var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\n var alignmentAreaBottomY = Math.min(qrcode.height - 1, estAlignmentY + allowance);\n\n var alignmentFinder = new AlignmentPatternFinder(this.image, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, this.resultPointCallback);\n return alignmentFinder.find();\n }\n\n this.createTransform = function(topLeft, topRight, bottomLeft, alignmentPattern, dimension) {\n var dimMinusThree = dimension - 3.5;\n var bottomRightX;\n var bottomRightY;\n var sourceBottomRightX;\n var sourceBottomRightY;\n if (alignmentPattern != null) {\n bottomRightX = alignmentPattern.X;\n bottomRightY = alignmentPattern.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree - 3.0;\n } else {\n // Don't have an alignment pattern, just make up the bottom-right point\n bottomRightX = (topRight.X - topLeft.X) + bottomLeft.X;\n bottomRightY = (topRight.Y - topLeft.Y) + bottomLeft.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree;\n }\n\n var transform = PerspectiveTransform.quadrilateralToQuadrilateral(3.5, 3.5, dimMinusThree, 3.5, sourceBottomRightX, sourceBottomRightY, 3.5, dimMinusThree, topLeft.X, topLeft.Y, topRight.X, topRight.Y, bottomRightX, bottomRightY, bottomLeft.X, bottomLeft.Y);\n\n return transform;\n }\n\n this.sampleGrid = function(image, transform, dimension) {\n\n var sampler = GridSampler;\n return sampler.sampleGrid3(image, dimension, transform);\n }\n\n this.processFinderPatternInfo = function(info) {\n\n var topLeft = info.TopLeft;\n var topRight = info.TopRight;\n var bottomLeft = info.BottomLeft;\n\n var moduleSize = this.calculateModuleSize(topLeft, topRight, bottomLeft);\n if (moduleSize < 1.0) {\n throw \"Error\";\n }\n var dimension = this.computeDimension(topLeft, topRight, bottomLeft, moduleSize);\n var provisionalVersion = Version.getProvisionalVersionForDimension(dimension);\n var modulesBetweenFPCenters = provisionalVersion.DimensionForVersion - 7;\n\n var alignmentPattern = null;\n // Anything above version 1 has an alignment pattern\n if (provisionalVersion.AlignmentPatternCenters.length > 0) {\n\n // Guess where a \"bottom right\" finder pattern would have been\n var bottomRightX = topRight.X - topLeft.X + bottomLeft.X;\n var bottomRightY = topRight.Y - topLeft.Y + bottomLeft.Y;\n\n // Estimate that alignment pattern is closer by 3 modules\n // from \"bottom right\" to known top left location\n var correctionToTopLeft = 1.0 - 3.0 / modulesBetweenFPCenters;\n var estAlignmentX = Math.floor(topLeft.X + correctionToTopLeft * (bottomRightX - topLeft.X));\n var estAlignmentY = Math.floor(topLeft.Y + correctionToTopLeft * (bottomRightY - topLeft.Y));\n\n // Kind of arbitrary -- expand search radius before giving up\n for (var i = 4; i <= 16; i <<= 1) {\n //try\n //{\n alignmentPattern = this.findAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, i);\n break;\n //}\n //catch (re)\n //{\n // try next round\n //}\n }\n // If we didn't find alignment pattern... well try anyway without it\n }\n\n var transform = this.createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);\n\n var bits = this.sampleGrid(this.image, transform, dimension);\n\n var points;\n if (alignmentPattern == null) {\n points = new Array(bottomLeft, topLeft, topRight);\n } else {\n points = new Array(bottomLeft, topLeft, topRight, alignmentPattern);\n }\n return new DetectorResult(bits, points);\n }\n\n\n\n this.detect = function() {\n var info = new FinderPatternFinder().findFinderPattern(this.image);\n\n return this.processFinderPatternInfo(info);\n }\n}", "function calculateGraphDim() {\n const w = window.innerWidth;\n const h = window.innerHeight;\n\n function greatestCommonDivisor(x, y) {\n if (typeof x !== 'number' || typeof y !== 'number') return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while (y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x > 30 ? x : 30; // The minimal size of the table boxes is 20px\n }\n\n const gcd = greatestCommonDivisor(w, h);\n const tableW = Math.floor(w / gcd);\n const tableH = Math.floor(h / gcd);\n return [tableW, tableH];\n }", "function getOffsets(size) {\n //THIS FUNCTION IS SO UGLY IM SO SORRY\n let wO = (size * 1.732050808 / 2);\n let hO = size;\n let ans = [];\n\n let startingY = 50 - 2 * (hO * .75);\n let startingX = 50 - wO;\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 - 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50;\n startingX = 50 - wO * (2);\n\n for (let i = 0; i < 5; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n\n\n startingY = 50 + 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 + 2 * (hO * .75);\n startingX = 50 - wO;\n\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n return ans;\n}", "function extractDimensions(aisData,binPayload,start) {\n var d = extractInt(binPayload,start,9);\n if (d!=0) aisData.dimensionToBow = d;\n start += 9;\n d = extractInt(binPayload,start,9);\n if (d!=0) aisData.dimensionToStern = d;\n start += 9;\n d = extractInt(binPayload,start,6);\n if (d!=0) aisData.dimensionToPort = d;\n start += 6;\n d = extractInt(binPayload,start,6);\n if (d!=0) aisData.dimensionToStarboard = d;\n}", "function calculateSizes () {\n console.log('calculateSizes');\n\n updateName(['_yyparse.s', fs.readFileSync('build/s/_yyparse.s', { encoding: 'utf8' })]);\n\n execSync(\n 'cat ./updateSpinner.s ./build/s/_yyparse.s > ./build/g/_yyparse.s;' +\n 'cl65 -T -t c64 ' +\n '-o ./build/obj2/yyparse.bin ' +\n '-Ln ./build/obj2/yyparse.lbl ' +\n '-C ./yyparse.cfg ./build/g/_yyparse.s'\n );\n\n passPostfix = 'a';\n\n const yyparseSize = Math.max(0x2000, fs.statSync('build/obj2/yyparse.bin').size);\n\n const yyparseStart = 0xC000 - yyparseSize;\n\n const dataSize = fs.statSync('build/data.bin').size;\n\n const dataStart = yyparseStart - dataSize;\n\n const libcSize = fs.statSync('build/libcdata.bin').size;\n\n const libcStart = dataStart - libcSize;\n\n const floatlibSize = fs.statSync('build/floatlibdata.bin').size;\n\n const floatlibStart = libcStart - floatlibSize;\n\n const mainSize = fs.statSync('build/maindata.bin').size;\n\n const mainStart = floatlibStart - mainSize;\n\n const heapSize = mainStart - 0x0800;\n\n remainder -= (yyparseSize + dataSize + libcSize + floatlibSize + mainSize);\n\n execSync(\n \"sed 's/ROMH: file = %O, start = $8000, size = $4000/\" +\n 'ROMH: file = %O, start = $' +\n (yyparseStart.toString(16).toUpperCase()) +\n ', size = $' +\n (yyparseSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' yyparse.cfg > build/yyparsea.cfg\"\n );\n\n execSync(\n \"sed 's/data2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'data2.bin\\\\\", start = $' +\n (dataStart.toString(16).toUpperCase()) +\n ', size = $' +\n (dataSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' data.cfg > build/dataa.cfg\"\n );\n\n execSync(\n \"sed 's/floatlibdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'floatlibdata2.bin\\\\\", start = $' +\n (floatlibStart.toString(16).toUpperCase()) +\n ', size = $' +\n (floatlibSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' floatlib.cfg > build/floatliba.cfg\"\n );\n\n execSync(\n \"sed 's/libcdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'libcdata2.bin\\\\\", start = $' +\n (libcStart.toString(16).toUpperCase()) +\n ', size = $' +\n (libcSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' libc.cfg > build/libca.cfg\"\n );\n\n execSync(\n \"sed 's/RAM2: file = \\\\\\\"\\\\\\\", start = $0800, size = $9800/\" +\n 'RAM2: file = \\\\\"\\\\\", start = $' +\n (mainStart.toString(16).toUpperCase()) +\n ', size = $' +\n (mainSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' main.cfg > build/maina.cfg\"\n );\n\n execSync(\n \"sed '\" +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' page.cfg > build/pagea.cfg\"\n );\n\n compileFloatLib();\n}", "function _resolveConfigSize(renderNode) {\n\t if (renderNode instanceof RenderNode) {\n\t var result = null;\n\t var target = renderNode.get();\n\t if (target) {\n\t result = _resolveConfigSize(target);\n\t if (result) {\n\t return result;\n\t }\n\t }\n\t if (renderNode._child) {\n\t return _resolveConfigSize(renderNode._child);\n\t }\n\t }\n\t else if (renderNode instanceof Surface) {\n\t return renderNode.size ? {\n\t renderNode: renderNode,\n\t size: renderNode.size\n\t } : undefined;\n\t }\n\t else if (renderNode.options && renderNode.options.size) {\n\t return {\n\t renderNode: renderNode,\n\t size: renderNode.options.size\n\t };\n\t }\n\t return undefined;\n\t }", "getDataSize () {\n let size = 0\n\n for (let n=0; n<this.neurons.length; n++) {\n size += this.neurons[n].weights.length + 1\n }\n\n return size\n }", "function GallerySize(){jQuery(\".codegallery\").css({\"height\":jQuery(\".codeimage:first img\").height(),\"width\":jQuery(\".codeimage:first img\").width()});jQuery(\".codeimage\").width(jQuery(\".codegallery\").width());jQuery(\".carousel\").css(\"width\",jQuery(\".codeimage\").width()*jQuery(\".codeimage\").length)}", "function size() {\n return k;\n }", "getDim(){\n let n = (this.state.size);\n //toFixed(someNum) used to set floating point accuracy\n let width = (100/(2*n-1)).toFixed(2);\n let margin = (100/(4.5*n-1)).toFixed(2);\n // console.log(width,margin);\n return {width,margin}\n}", "setSize() {\n this.size.D1 = this.shape.D1*this.unit.X;\n this.size.D2 = this.shape.D2*this.unit.Y;\n }", "function determineDx(elem, size) {\n var oldWidth = elem.offsetWidth;\n var windowWidth = document.querySelector('#randomPizzas').offsetWidth;\n var oldSize = oldWidth / windowWidth;\n var newSize = sizeSwitcher(size);\n var dx = (newSize - oldSize) * windowWidth;\n return dx;\n}", "resizeFactor() {\n var i;\n for (i = 0; i < this.NUMBER_DIMENSIONS; i++) {\n this.resizeVec[i] = this.initialDimensions[i] / this.websiteDimensions[i];\n }\n }", "calculateSizes() {\n // items' width including left adn right margins; equal widths and margins are assumed\n this.itemWidthMargin = this.$items[0].offsetWidth + (this.$items[0].offsetLeft*2);\n // width of inner carousel that falls outside of outer wrapper\n this.shiftSpace = (this.$items.length * this.itemWidthMargin) - this.$outerWrapper.offsetWidth;\n // each additional bullet is for every item outside of the outer wrapper\n this.bulletsNeeded = Math.round(this.shiftSpace / this.itemWidthMargin);\n\n // creates bullet elements as needed\n this.addBullets( true ); \n }", "get referencePixelsPerUnit() {}", "function size() {\n return stack_size;\n }", "readCodewords() {\n let width = this.bitMatrix.getWidth();\n let height = this.bitMatrix.getHeight();\n\n this.erasures = new Array(MAX_CW_CAPACITY);\n\n for (let k = 0; k < this.erasures.length; k++) {\n this.erasures[k] = 0;\n }\n\n // Get the number of pixels in a module across the X dimension\n //float moduleWidth = bitMatrix.getModuleWidth();\n let moduleWidth = 1.0; // Image has been sampled and reduced\n let rowCounters = new Array(width);\n\n for (let n = 0; n < rowCounters.length; n++) {\n rowCounters[n] = 0;\n }\n\n let codewords = new Array(MAX_CW_CAPACITY);\n\n for (let m = 0; m < codewords.length; m++) {\n codewords[m] = 0;\n }\n\n let next = 0;\n let matchingConsecutiveScans = 0;\n let rowInProgress = false;\n let rowNumber = 0;\n let rowHeight = 0;\n\n for (let i = 1; i < height; i++) {\n if (rowNumber >= MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n let rowDifference = 0;\n // Scan a line of modules and check the\n // difference between this and the previous line\n for (let j = 0; j < width; j++) {\n // Accumulate differences between this line and the\n // previous line.\n if (this.bitMatrix._get(j, i) != this.bitMatrix._get(j, i - 1)) {\n rowDifference++;\n }\n }\n\n if (rowDifference <= moduleWidth * this.MAX_ROW_DIFFERENCE) {\n for (let j2 = 0; j2 < width; j2++) {\n // Accumulate the black pixels on this line\n if (bitMatrix._get(j2, i)) {\n rowCounters[j2]++;\n }\n }\n // Increment the number of consecutive rows of pixels\n // that are more or less the same\n matchingConsecutiveScans++;\n // Height of a row is a multiple of the module size in pixels\n // Usually at least 3 times the module size\n if (matchingConsecutiveScans >= moduleWidth * 2) { // MGMG\n // We have some previous matches as well as a match here\n // Set processing a unique row.\n rowInProgress = true;\n }\n } else {\n if (rowInProgress) {\n // Process Row\n next = processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n if (next == -1) {\n // Something is wrong, since we have exceeded\n // the maximum columns in the specification.\n // TODO Maybe return error code\n return null;\n }\n // Reinitialize the row counters.\n for (let j3 = 0; j3 < rowCounters.length; j3++) {\n rowCounters[j3] = 0;\n }\n rowNumber++;\n rowHeight = 0;\n }\n matchingConsecutiveScans = 0;\n rowInProgress = false;\n }\n rowHeight++;\n }\n // Check for a row that was in progress before we exited above.\n if (rowInProgress) {\n // Process Row\n if (rowNumber >= this.MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n\n next = this.processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n rowNumber++;\n rows = rowNumber;\n }\n erasures = trimArray(erasures, eraseCount);\n return trimArray(codewords, next);\n }" ]
[ "0.65384746", "0.60086787", "0.5908827", "0.5684075", "0.5587406", "0.54986596", "0.54790145", "0.5448537", "0.53718317", "0.53554606", "0.53298867", "0.5306322", "0.5273099", "0.526163", "0.5245542", "0.5222601", "0.517767", "0.51723564", "0.51645786", "0.5144787", "0.51396513", "0.5129574", "0.5106571", "0.51064336", "0.5100012", "0.50848687", "0.50784063", "0.5063518", "0.50474894", "0.5037222", "0.5034588", "0.5032667", "0.5030777", "0.5007688", "0.49976283", "0.49909472", "0.49832854", "0.49795127", "0.49536243", "0.49532318", "0.49510485", "0.49366838", "0.49361166", "0.4914842", "0.49137247", "0.4907878", "0.48966253", "0.48951477", "0.48925638", "0.48901555", "0.48798805", "0.4878515", "0.48729235", "0.48688903", "0.48678175", "0.486709", "0.4865687", "0.4863069", "0.48552534", "0.48416275", "0.48367646", "0.4828702", "0.4826169", "0.48216772", "0.48190397", "0.48167396", "0.4814376", "0.4814376", "0.48118523", "0.48094052", "0.47910765", "0.47906837", "0.4788859", "0.4787912", "0.478446", "0.4783211", "0.4778968", "0.47752732", "0.47746408", "0.47732624", "0.47702387", "0.47686902", "0.47582293", "0.47511092", "0.47487247", "0.4745861", "0.47392464", "0.47351363", "0.47348994", "0.47235718", "0.4723501", "0.471794", "0.47092813", "0.47089222", "0.47086275", "0.4696836", "0.46833056", "0.46805272", "0.46698168", "0.46685037" ]
0.62702376
1
Deduces version information purely from QR Code dimensions.
function getProvisionalVersionForDimension(dimension) { if (dimension % 4 != 1) { return null; } var versionNumber = (dimension - 17) >> 2; if (versionNumber < 1 || versionNumber > 40) { return null; } return version_1.getVersionForNumber(versionNumber); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decideVersion(){\n var length = messageString.length;\n for(var i = 0; i < 40; i++){\n if(character_capacities[i] >= length){\n qrVersion = i + 1;\n break;\n }\n }\n }", "allocateFormatAndVersionInformation() {\n for (let i = 0; i < 9; i++) {\n this.mModuleValue[8][i].isFilled = true;\n this.mModuleValue[i][8].isFilled = true;\n }\n for (let i = this.mNoOfModules - 8; i < this.mNoOfModules; i++) {\n this.mModuleValue[8][i].isFilled = true;\n this.mModuleValue[i][8].isFilled = true;\n }\n if (this.mVersion > 6) {\n let versionInformation = this.mQrBarcodeValues.VersionInformation;\n let count = 0;\n for (let i = 0; i < 6; i++) {\n for (let j = 2; j >= 0; j--) {\n this.mModuleValue[i][this.mNoOfModules - 9 - j].isBlack = versionInformation[count] === 1 ? true : false;\n this.mModuleValue[i][this.mNoOfModules - 9 - j].isFilled = true;\n this.mModuleValue[this.mNoOfModules - 9 - j][i].isBlack = versionInformation[count++] === 1 ? true : false;\n this.mModuleValue[this.mNoOfModules - 9 - j][i].isFilled = true;\n }\n }\n }\n }", "getVersion() {\n return this.get('pdb/meta/v1/version');\n }", "_getCodeWordsBits(version) {\r\n const that = this;\r\n let versionBits = that._getValuesTable()[version];\r\n let bitsCount = 16 * version * version + 128 * version + 64;\r\n if (version > 6) bitsCount -= 36;\r\n if (versionBits[2].length) {\r\n // alignment patterns\r\n bitsCount -= 25 * versionBits[2].length * versionBits[2].length - 10 * versionBits[2].length - 55;\r\n }\r\n return bitsCount;\r\n }", "_getDataBits(version, errorLevel) {\r\n const that = this;\r\n let bitsCount = that._getCodeWordsBits(version) & ~7;\r\n let versionBits = that._getValuesTable()[version];\r\n bitsCount -= 8 * versionBits[0][errorLevel] * versionBits[1][errorLevel];\r\n return bitsCount;\r\n }", "function getVersion(){return _VERSION}", "function decodeQRdata(data, version, ecl) {\r\n\t\t var symbolSequence = -1;\r\n\t\t var parityData = -1;\r\n\t\t var bits = new bitstream_1.BitStream(data);\r\n\t\t var result = { val: [] }; // Have to pass this around so functions can share a reference to a number[]\r\n\t\t var fc1InEffect = false;\r\n\t\t var mode;\r\n\t\t while (mode != TERMINATOR_MODE) {\r\n\t\t // While still another segment to read...\r\n\t\t if (bits.available() < 4) {\r\n\t\t // OK, assume we're done. Really, a TERMINATOR mode should have been recorded here\r\n\t\t mode = TERMINATOR_MODE;\r\n\t\t }\r\n\t\t else {\r\n\t\t mode = modeForBits(bits.readBits(4)); // mode is encoded by 4 bits\r\n\t\t }\r\n\t\t if (mode != TERMINATOR_MODE) {\r\n\t\t if (mode == FNC1_FIRST_POSITION_MODE || mode == FNC1_SECOND_POSITION_MODE) {\r\n\t\t // We do little with FNC1 except alter the parsed result a bit according to the spec\r\n\t\t fc1InEffect = true;\r\n\t\t }\r\n\t\t else if (mode == STRUCTURED_APPEND_MODE) {\r\n\t\t if (bits.available() < 16) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t // not really supported; but sequence number and parity is added later to the result metadata\r\n\t\t // Read next 8 bits (symbol sequence #) and 8 bits (parity data), then continue\r\n\t\t symbolSequence = bits.readBits(8);\r\n\t\t parityData = bits.readBits(8);\r\n\t\t }\r\n\t\t else if (mode == ECI_MODE) {\r\n\t\t // Ignore since we don't do character encoding in JS\r\n\t\t var value = parseECIValue(bits);\r\n\t\t if (value < 0 || value > 30) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t else {\r\n\t\t // First handle Hanzi mode which does not start with character count\r\n\t\t if (mode == HANZI_MODE) {\r\n\t\t //chinese mode contains a sub set indicator right after mode indicator\r\n\t\t var subset = bits.readBits(4);\r\n\t\t var countHanzi = bits.readBits(mode.getCharacterCountBits(version));\r\n\t\t if (subset == GB2312_SUBSET) {\r\n\t\t if (!decodeHanziSegment(bits, result, countHanzi)) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t else {\r\n\t\t // \"Normal\" QR code modes:\r\n\t\t // How many characters will follow, encoded in this mode?\r\n\t\t var count = bits.readBits(mode.getCharacterCountBits(version));\r\n\t\t if (mode == NUMERIC_MODE) {\r\n\t\t if (!decodeNumericSegment(bits, result, count)) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t else if (mode == ALPHANUMERIC_MODE) {\r\n\t\t if (!decodeAlphanumericSegment(bits, result, count, fc1InEffect)) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t else if (mode == BYTE_MODE) {\r\n\t\t if (!decodeByteSegment(bits, result, count)) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t else if (mode == KANJI_MODE) {\r\n\t\t }\r\n\t\t else {\r\n\t\t return null;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t return result.val;\r\n\t\t}", "function check_get_mver(blob) {\n if (blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0]; // header signature 8\n\n blob.chk(HEADER_SIGNATURE, 'Header Signature: '); // clsid 16\n //blob.chk(HEADER_CLSID, 'CLSID: ');\n\n blob.l += 16; // minor version 2\n\n var mver = blob.read_shift(2, 'u');\n return [blob.read_shift(2, 'u'), mver];\n }", "function selectVersion(imageWidth, imageHeight, imageSize, imageMime) {\r\n const imageVersions = {\r\n small: [320, 240],\r\n medium: [800, 600],\r\n large: [1280, 1024]\r\n };\r\n let viewWidth = document.documentElement.clientWidth;\r\n let viewHeight = document.documentElement.clientHeight;\r\n\r\n // load hires if that's what you asked for\r\n if (JSON.parse(localStorage.getItem('serve_hidpi'))) {\r\n viewWidth *= (window.devicePixelRatio || 1);\r\n viewHeight *= (window.devicePixelRatio || 1);\r\n }\r\n\r\n if (viewWidth > 1024 && imageHeight > 1024 && imageHeight > 2.5 * imageWidth) {\r\n // Treat as comic-sized dimensions..\r\n return 'tall';\r\n }\r\n\r\n // Find a version that is larger than the view in one/both axes\r\n for (let i = 0, versions = Object.keys(imageVersions); i < versions.length; ++i) {\r\n const version = versions[i];\r\n const dimensions = imageVersions[version];\r\n const versionWidth = Math.min(imageWidth, dimensions[0]);\r\n const versionHeight = Math.min(imageHeight, dimensions[1]);\r\n\r\n if (versionWidth > viewWidth || versionHeight > viewHeight) {\r\n return version;\r\n }\r\n }\r\n\r\n // If the view is larger than any available version, display the original image.\r\n //\r\n // Sanity check to make sure we're not serving unintentionally huge assets\r\n // all at once (where \"huge\" > 25 MiB). Videos are loaded in chunks so it\r\n // doesn't matter too much there.\r\n if (imageMime === 'video/webm' || imageSize <= 26214400) {\r\n return 'full';\r\n }\r\n else {\r\n return 'large';\r\n }\r\n }", "function getVersion(){\n return version;\n }", "function getProductVersion() {\n return \"7.4.0.9058\";\n}", "function extractVersion(code) {\n return code.split('v')[1].split(' ')[0];\n}", "function _getVersionInfo(version){\n for(var i=0; i<versions.length; i++){\n if(versions[i].version === version){\n return versions[i];\n }\n }\n return null;\n }", "validateVersionInfo (data) {\n\t\tAssert.equal(data.currentVersion, this.CURRENT_RELEASE, 'current version is not correct');\n\t\tAssert.equal(data.supportedVersion, this.EARLIEST_SUPPORTED_RELEASE, 'earliest supported version is not correct');\n\t\tAssert.equal(data.preferredVersion, this.MINUMUM_PREFERRED_RELEASE, 'preferred version is not correct');\n\t}", "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "_getDataLengthBits(version) {\r\n const that = this;\r\n const mode = that._getEncodingMode(that.value)\r\n switch (mode) {\r\n case 1:\r\n //Numeric Mode\r\n return version < 10 ? 10 : version < 27 ? 12 : 14;\r\n case 2:\r\n //Alphanumeric Mode\r\n return version < 10 ? 9 : version < 27 ? 11 : 13;\r\n case 4:\r\n //Byte Mode\r\n return version < 10 ? 8 : 16;\r\n case 8:\r\n //Kanji Mode\r\n return version < 10 ? 8 : version < 27 ? 10 : 12;\r\n }\r\n }", "function getProductVersionId(version) {\n if (version == '7.4') {\n return '206111201';\n }\n if (version == '7.3') {\n return '175004848';\n }\n if (version == '7.2') {\n return '130051253';\n }\n if (version == '7.1') {\n return '102311424';\n }\n if (version == '7.0') {\n return '101625504';\n }\n if (version == '6.x') {\n return '101625503';\n }\n return '';\n}", "function getVersion(){\n return genericPolicyAPIGetItemsRequest('debug/buildversion', {\n project_id: 'Default' //API requires a project ID to be set but it does not need to correspond to an actual value in the system.\n });\n}", "function parse_EncInfoAgl(blob, vers) {\n\tblob.l+=4;\n\treturn blob.read_shift(blob.length - blob.l, 'utf8');\n}", "function parse_EncInfoAgl(blob, vers) {\n\tblob.l+=4;\n\treturn blob.read_shift(blob.length - blob.l, 'utf8');\n}", "function getVersionData() {\n // Prepping vars & checking if there is data available\n const curr = GlobalData.fxServerVersion;\n const rVer = globals.databus.updateChecker;\n if(!rVer){\n return {\n artifactsLink: false,\n color: false,\n message: false,\n subtext: false,\n };\n }\n const versionData = {\n artifactsLink: rVer.artifactsLink,\n color: false,\n message: false,\n subtext: false,\n };\n\n //Processing version data\n try {\n if(curr < rVer.critical){\n versionData.color = 'danger';\n versionData.message = 'A critical update is available for FXServer, you should update now.';\n versionData.subtext = (rVer.critical > rVer.recommended)\n ? `(critical update ${curr} ➤ ${rVer.critical})`\n : `(recommended update ${curr} ➤ ${rVer.recommended})`;\n \n }else if(curr < rVer.recommended){\n versionData.color = 'warning';\n versionData.message = 'A recommended update is available for FXServer, you should update.';\n versionData.subtext = `(recommended update ${curr} ➤ ${rVer.recommended})`;\n \n }else if(curr < rVer.optional){\n versionData.color = 'info';\n versionData.message = 'An optional update is available for FXServer.';\n versionData.subtext = `(optional update ${curr} ➤ ${rVer.optional})`;\n }\n\n } catch (error) {\n logError(`Error while processing changelog. Enable verbosity for more information.`);\n if(GlobalData.verbose) dir(error);\n }\n\n return versionData;\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function check_get_mver(blob) {\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\tblob.chk(HEADER_CLSID, 'CLSID: ');\n\n\t// minor version 2\n\tvar mver = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}", "function getProductVersion() {\n return \"8.5.0.9167\";\n}", "function getThisVersion() {\r\n\r\n\t\t\t// Get the data:\r\n\t\t\tvar appData = air.NativeApplication.nativeApplication.applicationDescriptor;\r\n\t\t\t//air.trace(appData);\r\n\t\t\t\r\n\t\t\t// Turn the file data into an XML object:\r\n\t\t\tvar dp = new DOMParser();\r\n\t\t\tvar xml = dp.parseFromString(appData, 'text/xml');\r\n\r\n\t\t\t// Parse out and return the version value:\r\n\t\t\tvar version = xml.getElementsByTagName('version')[0].firstChild;\r\n\t\t\tthisVersion = version.nodeValue;\r\n\t\t\tair.trace(thisVersion);\r\n\t\t\t\r\n\t\t\tgetCurrentVersion();\r\n\r\n\t\t} // End of getThisVersion() function.", "function QrCode(\n // The version number of this QR Code, which is between 1 and 40 (inclusive).\n // This determines the size of this barcode.\n version,\n // The error correction level used in this QR Code.\n errorCorrectionLevel, dataCodewords, msk) {\n (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, QrCode);\n this.version = version;\n this.errorCorrectionLevel = errorCorrectionLevel;\n // The modules of this QR Code (false = light, true = dark).\n // Immutable after constructor finishes. Accessed through getModule().\n this.modules = [];\n // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n this.isFunction = [];\n // Check scalar arguments\n if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION) throw new RangeError('Version value out of range');\n if (msk < -1 || msk > 7) throw new RangeError('Mask value out of range');\n this.size = version * 4 + 17;\n // Initialize both grids to be size*size arrays of Boolean false\n var row = [];\n for (var i = 0; i < this.size; i++) row.push(false);\n for (var _i = 0; _i < this.size; _i++) {\n this.modules.push(row.slice()); // Initially all light\n this.isFunction.push(row.slice());\n }\n // Compute ECC, draw modules\n this.drawFunctionPatterns();\n var allCodewords = this.addEccAndInterleave(dataCodewords);\n this.drawCodewords(allCodewords);\n // Do masking\n if (msk == -1) {\n // Automatically choose best mask\n var minPenalty = 1000000000;\n for (var _i2 = 0; _i2 < 8; _i2++) {\n this.applyMask(_i2);\n this.drawFormatBits(_i2);\n var penalty = this.getPenaltyScore();\n if (penalty < minPenalty) {\n msk = _i2;\n minPenalty = penalty;\n }\n this.applyMask(_i2); // Undoes the mask due to XOR\n }\n }\n\n assert(0 <= msk && msk <= 7);\n this.mask = msk;\n this.applyMask(msk); // Apply the final choice of mask\n this.drawFormatBits(msk); // Overwrite old format bits\n this.isFunction = [];\n }", "function RMXFViewer_SetSize()\n{\n var instText1 = \"You must install \";\n var instText2 = \"Vidicor View Component\";\n var instText3 = \"Click this link and run the file then follow his instructions.\";\n var instText4 = \"Press F5 since installation complete.\";\n var instText5 = \"Attention! This page requires additional component to work.\\n\" +\n \"Press OK and follow component installation instructions.\";\n if (lang == 'ru')\n {\n instText1 = \"Вам необходимо установить \";\n instText2 = \"компонент просмотра Vidicor\";\n instText3 = \"Нажмите на эту ссылку, запустите файл и следуйте его инструкциям.\";\n instText4 = \"После завершения установки нажмите F5.\";\n instText5 = \"Внимание! Эта страница требует для работы установки дополнительного компонента.\\n\" +\n \"Нажмите OK и следуйте появившимся инструкциям по установке компонента.\";\n }\n\n var w = -1;\n var h = -1;\n if (arguments.length == 2)\n {\n w = parseInt(arguments[0]);\n h = parseInt(arguments[1]);\n }\n else\n if (arguments.length == 1)\n {\n var str = new String(arguments[0]);\n var xi = str.indexOf('x', 0);\n if (xi < 0) xi = str.indexOf('X', 0);\n if (xi < 0) xi = str.indexOf('*', 0);\n if (xi >= 0)\n {\n w = parseInt(str.substring(0, xi));\n h = parseInt(str.substring(xi + 1));\n }\n }\n else\n if (arguments.length == 0)\n {\n w = this.reqW;\n h = this.reqH;\n }\n if ((w >= 0) && (h >= 0))\n {\n this.reqW = w;\n this.reqH = h;\n if ((this.rmxfobj != null) &&\n (this.rmxfobj.readyState >= 4))\n {\n if (this.rmxfobj.URL != null)\n window.setTimeout('RMXFCallSetVideoSize(' + this.rmxfidx + ', ' + w + ', ' + h + ')', 10);\n else\n {\n this.rmxftag.innerHTML = \"<TABLE id=instructions\" +\n \t\t\t \"width=\" + this.reqW + \n \t\t\t \" height=\" + this.reqH +\n \t\t\t \"border=0 cellpadding=0 cellspacing=0>\" +\n \"<TR><TD align=center valign=middle>\" +\n \"<FONT color=#D00000>\" + instText1 + \n \"<BR><A href='http://\" + this.rmxfhost +\n \"/activex_setup.exe'>\" + instText2 + \n \"</A></FONT><BR>\" +\n \"<LI>\" + instText3 +\n \"<LI>\" + instText4 +\n \"</TD></TR></TABLE>\";\n instructions.scrollIntoView(true);\n alert(instText5);\n }\n }\n }\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function GetSize(vintVersion) {\n var lintSize = 0;\n \n lintSize = ((vintVersion - 1) * 4) + 21;\n \n return lintSize;\n}", "function getVersion() {\n return 1.0;\n}", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "static size(_width, _height) {\n crc2.canvas.width = _width;\n crc2.canvas.height = _height;\n crc2.save();\n crc2.fillStyle = \"#a0a0a0\";\n crc2.fillRect(0, 0, _width, _height);\n crc2.restore();\n }", "function unpackDAQdv(dv){\n //parse DAQ dataviews into dataStore.data variables - DAQ monitor style\n //information for an individual channel is packed in a 14 byte word:\n //[PSC 2 bytes][trig request 4 bytes][trig accept 4 bytes][threshold 4 bytes] <--lowest bit\n var channelIndex, channelName, DAQblock,\n i;\n\n // @TODO: make grif16 send appropriate pscs and lookup grifadc info based on sent PSC\n for(i=0; i<dv.byteLength/14; i++){\n DAQblock = unpackDAQ(i, dv);\n\n channelIndex = dataStore.ODB.DAQ.PSC.PSC.indexOf(DAQblock.PSC);\n channelName = dataStore.ODB.DAQ.PSC.chan[channelIndex];\n\n if(channelName) // ie channel *must* be in the ODB PSC table\n sortDAQitem(channelName, DAQblock);\n }\n}", "function Info(version, prerelease) {\r\n\tthis.version = version;\r\n\tthis.prerelease = prerelease;\r\n\r\n\tthis.simpleversion = Math.round(this.version*100);\r\n\tthis.major = parseInt(this.simpleversion / 100);\r\n\tthis.minor = parseInt(this.simpleversion / 10) - this.major * 10;\r\n\tthis.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;\r\n\tthis.meets = meets;\r\n}", "getVersionField(telegram) {\n let values = telegram.getValues();\n\n return values.has('BLOCK1_VERSION') ?\n values.get('BLOCK1_VERSION') : null;\n }", "function ImageDimensions() { }", "function CheckVersion() {\n \n}", "function generateVersionInfo() {\n const versionInfo = git.gitDescribeSync({ longSemver: true });\n\n if (versionInfo.dirty || versionInfo.distance) {\n let versionString = versionInfo.raw.startsWith('v') ? versionInfo.raw.substr(1) : versionInfo.raw;\n if (versionInfo.dirty) {\n versionString = `${versionString}-${Date.now().toString()}`;\n }\n if (!versionInfo.tag) {\n versionString = `0.0.0-${versionString}`;\n }\n\n return versionString;\n }\n\n return undefined;\n}", "function dxt35Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\n }", "function getCurrentVersion() {\r\n\r\n\t\t\tvar errorCallback = function(){};\r\n\t\t\tvar completeHandle = function(event){\r\n\t\t\t\tvar ld = air.URLLoader(event.target);\r\n\t\t\t\tvar d = JSON.parse(ld.data);\r\n\t\t\t\t\r\n\t\t\t\tcurrentVersion = d.version;\r\n\t\t\t\tfileUrl = d.downloadurl;\r\n\t\t\t\tair.trace(currentVersion, fileUrl)\r\n\t\t\t\tdownloadNewVersion();\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tvar request = new air.URLRequest();\r\n\t\t\trequest.method = air.URLRequestMethod.POST;\r\n\t\t\trequest.url = \"http://www.startfeel.com/app/mease/check.json\";\r\n\t\t\t\r\n\t\t\tair.trace(completeHandle);\r\n\t\t\tair.trace(errorCallback);\r\n\t\t\tvar loader = new air.URLLoader();\r\n\t\t\tloader.addEventListener(air.Event.COMPLETE,completeHandle);\r\n\t\t\tloader.addEventListener(air.IOErrorEvent.IO_ERROR,errorCallback);\r\n\t\t\tloader.load(request);\r\n\r\n\t\t} // End of getCurrentVersion() function.", "function getVersion() {\r\n var x = document.getElementById(\"version-data\");\r\n if (x.style.display === \"none\") {\r\n x.style.display = \"block\";\r\n } else {\r\n x.style.display = \"none\";\r\n }\r\n}", "get versionId() {\n // Report the RTV.\n // TODO: Make this a more readable string.\n return this.opts.version;\n }", "function GetVersionString() {\n\t\tvar Prop = \"Version\";\n\n\t\tProp = Prop;\n\t\tvar Str = SigWebGetProperty(Prop);\n\t\tvar trimStr = Str.slice(1, Str.length - 2);\n\t\treturn trimStr;\n\t}", "function createMinQRCode(text, level, minVersion, maxVersion, quiet) {\n minVersion = Math.max(1, minVersion || 1);\n maxVersion = Math.min(40, maxVersion || 40);\n for (var version = minVersion; version <= maxVersion; version += 1) {\n try {\n return createQRCode(text, level, version, quiet);\n } catch (err) {/* empty */}\n }\n return undefined;\n }", "support(version = 1) {\n return exists && check(Uint32Array.of(0x6D736100, version));\n }", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "calculateImageDimensions() {\n return { width : `${this.state.width}px`, top : `${((this.state.holderHeight - this.state.height) / 2)}px` }\n }", "get version() {\n return this.originalResponse.version;\n }", "get version() {\n return this.originalResponse.version;\n }", "get version() {\n return this.originalResponse.version;\n }", "get version() {\n return this.originalResponse.version;\n }", "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }", "function getVersion() {\n return chrome.runtime.getManifest().version;\n}", "function getDimensionPartInfo(dimensionNamePart) {\n var result = {};\n var key = dimensionNamePart.substr(0, 1);\n var value = dimensionNamePart.substr(1);\n\n result['value'] = value;\n switch (key) {\n case 'w':\n result['key'] ='width';\n break;\n case 'h':\n result['key'] ='height';\n break;\n case 'p':\n result['key'] ='platform';\n break;\n default:\n result = null;\n break;\n }\n\n return result;\n }", "function parseNWVer(code) {\n var i = code.indexOf(\"#define NW_MAJOR_VERSION\"),\n j = code.indexOf(\"#define NW_VERSION_IS_RELEASE\"),\n main = code.slice(i, j).split(\"\\n\").slice(0, -1),\n vers = main.map(function(v){\n return v.split(\" \")[2];\n });\n return vers.join(\".\");\n }", "function draw_version(){\n\tPADDING = 10;\n\tcanvas_backround.fillStyle = \"#8A8A8A\";\n\tcanvas_backround.font = \"Normal 11px Helvetica\";\n\tcanvas_backround.fillText(\"v\"+VERSION, PADDING, HEIGHT_APP-18-5+14);\n\t}", "function getQrCode() {\n // make the QR code:\n let qr = qrcode(0, 'L');\n qr.addData(document.URL);\n qr.make();\n // create an image from it:\n let qrImg = qr.createImgTag(2, 8, \"qr code of \" + document.URL);\n // get the image and label:\n let label = document.getElementById('label');\n label.innerHTML = qrImg + '<br>' + document.URL;\n}", "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function version(){ return \"0.13.0\" }", "getModuleHeight(){return this.module_left_face_dimensions_axes[1];}", "getModuleDepth(){return this.module_base_face_dimensions_axes[2];}", "get versionId() {\n return this.originalResponse.versionId;\n }", "get versionId() {\n return this.originalResponse.versionId;\n }", "function populateAboutVersionInformation(){\n populateVersionInformation(remote.app.getVersion(), document.getElementById('settingsAboutCurrentVersionValue'), document.getElementById('settingsAboutCurrentVersionTitle'), document.getElementById('settingsAboutCurrentVersionCheck'))\n}", "function getVerEdge(b) {\n\t\treturn parseFloat($(b).css('padding-top')) + parseFloat($(b).css('padding-bottom')) \n\t\t\t\t\t+ parseFloat($(b).css('margin-top')) + parseFloat($(b).css('margin-bottom'))\n\t\t\t\t\t+ parseFloat($(b).css('border-top')) + parseFloat($(b).css('border-bottom'));\n\t}", "get versionDescription() {\n return this.getStringAttribute('version_description');\n }", "function osVerLog() {\n var osVer = document.querySelector(\".osVer\");\n\n var osysVer = result.os.version;\n console.log(osysVer);\n osVer.innerHTML += osysVer;\n }", "function version(){\n console.log(\"Version:\" , _cfg.version );\n}", "function cd_getVersion(objName) {\n\treturn cd_getSpecificObject(objName).Version;\n}", "function display_version_detail ( numVersion ){\n\tcall_webservice(14,\"&p=\"+currentProject+\"&v=\"+numVersion);\n\tvar html_tickets=\"\",html_titre=\"\",nbType=[];\n\tnbType['evolution'] = 0;\n\tnbType['correctif'] = 0;\n\tnbType['refactoring'] = 0;\n\tif ( dataRetourJSON.list.length > 0 ){\n\t\tfor (i=0;i<dataRetourJSON.list.length;i++){\n\t\t\thtml_tickets += \"<div class='\"+dataRetourJSON.list[i].type+\"'><b>\"+dataRetourJSON.list[i].name+\" : </b>\"+dataRetourJSON.list[i].desc+\"</div>\";\n\t\t\tnbType[dataRetourJSON.list[i].type]++;\n\t\t}\n\t}\n\tif ( html_tickets != \"\" ){\n\t\thtml_titre = \"<div><b>Notes de version \"+numVersion+\"</b>\"\n\t\tif ( nbType['evolution'] > 0 ) html_titre += \" &nbsp; +\"+nbType['evolution']+\" évol\";\n\t\tif ( nbType['correctif'] > 0 ) html_titre += \" &nbsp; -\"+nbType['correctif']+\" bug\"\n\t\tif ( nbType['refactoring'] > 0 ) html_titre += \" &nbsp; -\"+nbType['refactoring']+\" dette\";\n\t\thtml_titre += \"</div>\";\n\t\t$(\"#version_detail\").html(html_titre+html_tickets);\n\t\t$(\"#version_detail\").show();\n\t\t//Ajuster hauteur \n\t\t// TODO : Fix height calculation\n\t\t/*var note_height = parseInt($(\"#version_detail\").css(\"height\").replace('px',''));\n\t\tvar height_tests_list = parseInt($(\"#tests_list\").css(\"height\").replace('px',''));\n\t\tvar height_versions_list = parseInt($(\"#versions_list\").css(\"height\").replace('px',''));\n\t\tvar list_height = Math.max(height_tests_list,height_versions_list);\n\t\tif ( note_height > list_height ){\n\t\t\tvar note_top = parseInt($(\"#versions_list\").css(\"top\").replace('px',''));\n\t\t\tvar diff = (note_height-list_height);\n\t\t\t$(\"#version_detail\").css(\"top\",(note_top-diff)+\"px\");\n\t\t}else{\n\t\t\t//var list_top = parseInt($(\"#versions_list\").css(\"top\").replace('px',''));\n\t\t\t//if ( note_top < list_top )\n\t\t\t\t$(\"#version_detail\").css(\"top\",$(\"#versions_list\").css(\"top\"));\n\t\t}*/\n\t}\n}", "function JsQRScannerReady()\r\n{\r\n jbScanner = new JsQRScanner(onQRCodeScanned);\r\n jbScanner.setSnapImageMaxSize(300);\r\n //console.log(\"QR scanner ready\");\r\n //console.log(jbScanner);\r\n //launchQRScanner();\r\n}", "function SizeDependHeight() {\n hImageCur = va.hRuby;\n wImageCur = M.R(hImageCur * rateImage);\n }", "function getDimCanavs() {\n w = canvas.width;\n h = canvas.height;\n }", "function displayVersion() {\r\n\tvar version = chrome.app.getDetails().version;\r\n\tvar divVersion = document.getElementById('version');\r\n\tdivVersion.innerHTML = \"<br><b>Sprint Reader</b> (v\" + version + \")\";\r\n}", "function tuyaDeviceUpgradeGet( params ){\n\treturn // XXX empty return means no update\n\treturn {\n\t\t\"size\": \"825947\",\n\t\t\"cdnUrl\": \"http://images.tuyaus.com/smart/firmware/upgrade/201810/1539875023-oem_esp_dltj_ug_1.1.0.bin\",\n\t\t\"originalUrl\": \"http://s3-us-west-2.amazonaws.com/airtake-public-data/smart/firmware/upgrade/201810/1539875023-oem_esp_dltj_ug_1.1.0.bin\",\n\t\t\"httpsUrl\": \"https://s3-us-west-2.amazonaws.com/airtake-public-data/smart/firmware/upgrade/201810/1539875023-oem_esp_dltj_ug_1.1.0.bin\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"url\": \"http://s3-us-west-2.amazonaws.com/airtake-public-data/smart/firmware/upgrade/201810/1539875023-oem_esp_dltj_ug_1.1.0.bin\",\n\t\t\"md5\": \"1142247a63a44dd97896c4fe6abd53f0\"\n\t}\n}", "function getIdAndVersion(urn64) {\n var urn = Buffer.from(urn64, 'base64').toString(\"ascii\");\n // urn will be something like this:\n // urn:adsk.wipprod:fs.file:vf.dhFQocFPTdy5brBtQVvuCQ?version=1\n urn = urn.replace('urn:adsk.wipprod:fs.file:vf.', '')\n var parts = urn.split('?version=');\n\n var itemId = parts[0];\n var version = parts[1];\n\n return { itemId: \"urn:adsk.wipprod:dm.lineage:\" + itemId, version: parseInt(version) };\n}", "function findVersion() {\n return $('meta').filter(function () {\n var name = $(this).attr('http-equiv')\n return name && name.toUpperCase() === 'X-PJAX-VERSION'\n }).attr('content')\n }", "callback(version) {\n omegga.emit('version', version);\n omegga.version = version;\n }", "function validateVersion(ver, fileName, desc, notifdiv){\n \n not_div = document.getElementById(notifdiv); \n if(!validateDates())\n return false;\n\n if(containsSQL(fileName)||containsSQL(desc)){\n not_div.style.display = \"inline\";\n not_div.innerHTML = \" The 'file name' neither the 'description' should have SQL words like 'SELECT' \";\n return false;\n }\n if(!isVersion(ver)){\n not_div.style.display = \"inline\";\n not_div.innerHTML = \" The 'version' field can only have points and numbers like: '3.01.05' \";\n return false;\n }\n\n return true;\n}", "get version() {\n const stack = new Error().stack\n const start = stack.indexOf(\"+\")\n const end = stack.indexOf(\"/\", start)\n return stack.slice(start, end)\n }" ]
[ "0.61766094", "0.5745111", "0.54826546", "0.54667926", "0.5380512", "0.53733057", "0.5328263", "0.5227578", "0.5225389", "0.5190459", "0.5170953", "0.515189", "0.5143611", "0.5141125", "0.51349056", "0.51349056", "0.51349056", "0.51349056", "0.51042026", "0.5073934", "0.5054763", "0.50441945", "0.50441945", "0.50202525", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5018922", "0.5011801", "0.50077367", "0.500469", "0.49854565", "0.4967228", "0.4967228", "0.4967228", "0.4967228", "0.49283183", "0.49114588", "0.49072832", "0.4898122", "0.48865023", "0.48793763", "0.48624605", "0.48534843", "0.4853073", "0.48260733", "0.48170584", "0.48144165", "0.4811714", "0.4810414", "0.4808622", "0.47999588", "0.47953722", "0.47945222", "0.47945222", "0.47945222", "0.47945222", "0.4788798", "0.4785579", "0.4785579", "0.4785579", "0.4785579", "0.4785428", "0.47852713", "0.47789323", "0.47788477", "0.4770669", "0.4768087", "0.476481", "0.476481", "0.476481", "0.476481", "0.47609377", "0.47562757", "0.47555304", "0.47532955", "0.47532955", "0.4743248", "0.47410566", "0.46934155", "0.4688169", "0.46844116", "0.4680628", "0.46765596", "0.4674609", "0.4671115", "0.46700478", "0.46683827", "0.46669996", "0.46612024", "0.46503544", "0.46429387", "0.4641692", "0.4639201" ]
0.5416508
4
This method traces a line from a point in the image, in the direction towards another point. It begins in a black region, and keeps going until it finds white, then black, then white again. It reports the distance from the start to this point. This is used when figuring out how wide a finder pattern is, when the finder pattern may be skewed or rotated.
function sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image) { fromX = Math.floor(fromX); fromY = Math.floor(fromY); toX = Math.floor(toX); toY = Math.floor(toY); // Mild variant of Bresenham's algorithm; // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX); if (steep) { var temp = fromX; fromX = fromY; fromY = temp; temp = toX; toX = toY; toY = temp; } var dx = Math.abs(toX - fromX); var dy = Math.abs(toY - fromY); var error = -dx >> 1; var xstep = fromX < toX ? 1 : -1; var ystep = fromY < toY ? 1 : -1; // In black pixels, looking for white, first or second time. var state = 0; // Loop up until x == toX, but not beyond var xLimit = toX + xstep; for (var x = fromX, y = fromY; x != xLimit; x += xstep) { var realX = steep ? y : x; var realY = steep ? x : y; // Does current pixel mean we have moved white to black or vice versa? // Scanning black in state 0,2 and white in state 1, so if we find the wrong // color, advance to next state or end if we are in state 2 already if ((state == 1) === image.get(realX, realY)) { if (state == 2) { return distance(x, y, fromX, fromY); } state++; } error += dy; if (error > 0) { if (y == toY) { break; } y += ystep; error -= dx; } } // Found black-white-black; give the benefit of the doubt that the next pixel outside the image // is "white" so this last point at (toX+xStep,toY) is the right ending. This is really a // small approximation; (toX+xStep,toY+yStep) might be really correct. Ignore this. if (state == 2) { return distance(toX + xstep, toY, fromX, fromY); } // else we didn't find even black-white-black; no estimate is really possible return NaN; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function line(x0, y0, x1, y1) {\n let dx = Math.abs(x1-x0);\n let dy = Math.abs(y1-y0);\n let sx = (x0 < x1) ? 1 : -1; // Step direction for pixels\n let sy = (y0 < y1) ? 1 : -1;\n let err = dx-dy; // Keep track of err as we go\n console.log(dx, dy);\n\n while(true) {\n // setPixel(x0,y0); // Do what you need to for this\n actions.push({type: 'set-pixel', x0, y0, err});\n\n // Exit once we've reached the end point\n if ((x0==x1) && (y0==y1)) {\n actions.push({type: 'done', x0, y0, x1, y1, sx, sy, err});\n break;\n }\n\n let e2 = 2*err;\n\n // Step in the x direction\n if (e2 > -dy) {\n err -= dy;\n x0 += sx;\n actions.push({type: 'x-step', err, x0, x1, y0, y1, sx, sy});\n }\n // Step in the y-direction\n if (e2 < dx) {\n err += dx;\n y0 += sy;\n actions.push({type: 'y-step', err, x0, x1, y0, y1, sx, sy});\n }\n }\n}", "function line(x0, y0, x1, y1){\n var dx = Math.abs(x1-x0);\n var dy = Math.abs(y1-y0);\n var sx = (x0 < x1) ? 1 : -1;\n var sy = (y0 < y1) ? 1 : -1;\n var err = dx-dy;\n var terminationConst = 1.1;\n\n while(true){\n // putPixel\n ctx.fillStyle = 'black';\n ctx.fillRect(x0, y0, 1, 1);\n\n if ((Math.abs(x0-x1) < terminationConst) && (Math.abs(y0-y1) < terminationConst)) break;\n var e2 = 2*err;\n if (e2 >-dy){ err -= dy; x0 += sx; }\n if (e2 < dx){ err += dx; y0 += sy; }\n }\n }", "function lineBresenham(x1, y1, x2, y2){\n let dx, dy;\n let stepX, stepY;\n \n dx = x2 - x1;\n dy = y2 - y1;\n\n if (dy < 0) {\n dy = -dy;\n stepY = -totPixel;\n } else {\n stepY = totPixel;\n }\n if (dx < 0) {\n dx = -dx;\n stepX = -totPixel;\n } else {\n stepX = totPixel;\n }\n /* 2dy, 2dx */\n dy << 1;\n dx << 1;\n\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n /* slope between 1 and -1, greater than 1, less than -1 */\n if (dx > dy) {\n let fraction = dy - (dx >> 1);\n while(x1 < x2){\n x1 += stepX;\n if (fraction >= 0) {\n y1 += stepY;\n fraction -= dx;\n }\n fraction += dy;\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n }\n } else if (y1 > y2) {\n let fraction = dx - (dy >> 1);\n while(y1 > y2){\n if(fraction >= 0){\n x1 += stepX;\n fraction -= dy;\n }\n y1 += stepY;\n fraction += dx;\n if((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)){\n setPixel(x1, y1);\n }\n }\n } else {\n let fraction = dx - (dy >> 1);\n while(y1 < y2){\n if (fraction >= 0) {\n x1 += stepX;\n fraction -= dy;\n }\n y1 += stepY;\n fraction += dx;\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n }\n }\n}", "line(x0, y0, x1, y1, c) {\n // evaluate runtime errors\n this.colorRangeError(c);\n x0 = Math.ceil(x0);\n y0 = Math.ceil(y0);\n x1 = Math.ceil(x1);\n y1 = Math.ceil(y1);\n let dx = Math.abs(x1 - x0);\n let dy = Math.abs(y1 - y0);\n let sx = x0 < x1 ? 1 : -1;\n let sy = y0 < y1 ? 1 : -1;\n let err = dx - dy;\n for (let x = 0; x <= dx; x++) {\n for (let y = 0; y <= dy; y++) {\n this.pix(x0, y0, c);\n if (x0 == x1 && y0 == y1) {\n break;\n }\n let e2 = 2 * err;\n if (e2 >= -dy) {\n err -= dy;\n x0 += sx;\n }\n if (e2 < dx) {\n err += dx;\n y0 += sy;\n }\n }\n }\n }", "visitLinePixels(visitor, line) {\n const vec = { dx: line.x1 - line.x0, dy: line.y1 - line.y0 }\n // If line is a point we're lazy (and eliminate some special cases)\n if (vec.dx === 0 && vec.dy === 0) {\n const x = Math.floor(line.x0);\n const y = Math.floor(line.y0);\n const idx = x + this.width * y;\n visitor(x, y, idx);\n return;\n }\n const len = Math.sqrt(Math.pow(vec.dx, 2) + Math.pow(vec.dy, 2));\n const unit = { dx: vec.dx / len, dy: vec.dy / len };\n const ortho = { dx: unit.dy, dy: -unit.dx };\n // Using a Set makes it easy to comply with the pixel uniqueness\n // requirement\n const indices = new Set();\n const addPixel = (x, y) => {\n x = Math.floor(x);\n y = Math.floor(y);\n if (x < 0 || x >= this.width)\n return\n if (y < 0 || y >= this.height)\n return;\n const idx = x + this.width * y;\n if (idx !== idx)\n throw new Error('Trying to add NaN as a line pixel index');\n indices.add(idx);\n };\n const pos = { x: line.x0, y: line.y0 };\n const sigX = line.x1 - line.x0;\n const sigY = line.y1 - line.y0;\n do {\n addPixel(pos.x, pos.y);\n for (let i = 0; i < this.strokeWidth; i++) {\n const xt = pos.x + .5 * ortho.dx;\n const yt = pos.y + .5 * ortho.dy;\n addPixel(xt, yt);\n const xb = pos.x - .5 * ortho.dx;\n const yb = pos.y - .5 * ortho.dy;\n addPixel(xb, yb);\n }\n pos.x += unit.dx;\n pos.y += unit.dy;\n } while((line.x1 - pos.x) * sigX > 0 || (line.y1 - pos.y) * sigY > 0);\n const iterator = indices.values();\n for (let i = 0; i < indices.size; i++) {\n const idx = iterator.next().value;\n const x = idx % this.width;\n const y = Math.floor(idx / this.width);\n if (x !== x || y !== y)\n throw new Error('Encountered line coordinates which are NaN');\n const res = visitor(x, y, idx);\n // Bailing mechanism\n if (res === false)\n break;\n }\n }", "function drawLine(imageData, startVertexOrig, endVertexOrig, color) {\n\tvar startVertex = {};\n\tvar endVertex = {};\n\tcopyVertex(startVertex, startVertexOrig)\n\tcopyVertex(endVertex, endVertexOrig)\n\tif (startVertex.x > endVertex.x) {\n\t\tvar temp = startVertex;\n\t\tstartVertex = endVertex;\n\t\tendVertex = temp;\n\t}\n\tvar x0 = startVertex.x;\n\tvar y0 = startVertex.y;\n\tvar x1 = endVertex.x;\n\tvar y1 = endVertex.y;\n\tvar yInc = 1;\n\n\n\tvar dx = x1 - x0;\n\tvar dy = y1 - y0;\n\tvar d = 2 * dy - dx;\n\tvar delE = 2 * dy;\n\tvar delNE = 2 * (dy - dx)\n\tvar m = dy / dx;\n\tvar flag = false;\n\n\tif (m >= 0 && m < 1) { }\n\telse if (m >= 1) {\n\t\t//console.log('dx,dy swapped')\n\t\tflag = true;\n\t\tdx = dx + dy; dy = dx - dy; dx = dx - dy;\n\t\t//x0=x0+y0;y0=x0-y0;x0=x0-y0;\n\t\t//x1=x1+y1;y1=x1-y1;x1=x1-y1;\n\t}\n\telse if (m < 0 && m > -1) {\n\t\tyInc = -1\n\t\tdy = -dy;\n\t}\n\telse if (m <= -1) {\n\t\tyInc = -1\n\t\t//console.log('dx,dy swapped here')\n\t\tflag = true\n\t\tdy = -dy\n\t\tdx = dx + dy; dy = dx - dy; dx = dx - dy;\n\n\t}\n\n\td = (2 * dy - dx)\n\tdelE = 2 * dy\n\tdelNE = 2 * (dy - dx)\n\tm = dy / dx;\n\n\tvar newVertex = startVertex\n\tnewVertex.x = round(x0)\n\tnewVertex.y = round(y0)\n\tnewVertex.z = round(startVertex.z < endVertex.z ? startVertex.z : endVertex.z)//(startVertex.z + endVertex.z)/2\n\tnewVertex.nx = startVertex.nx\n\tnewVertex.ny = startVertex.ny\n\tnewVertex.nz = startVertex.nz\n\tnewVertex.r = color[0];\n\tnewVertex.g = color[1];\n\tnewVertex.b = color[2];\n\n\tshowPixel(imageData, newVertex)\n\tif (!flag) {//m<1 && m>-1){\n\t\twhile (newVertex.x <= x1) {\n\t\t\tif (d <= 0) {\n\t\t\t\td += delE\n\t\t\t\tnewVertex.x = newVertex.x + 1\n\t\t\t}\n\t\t\telse {\n\t\t\t\td += delNE\n\t\t\t\tnewVertex.x = newVertex.x + 1\n\t\t\t\tnewVertex.y = (newVertex.y + yInc)\n\t\t\t}\n\t\t\tif (m > 0)\n\t\t\t\tshowPixel(imageData, newVertex)\n\t\t\telse\n\t\t\t\tshowPixel(imageData, newVertex, false)\n\t\t}\n\t}\n\telse {\n\t\tif (y1 > y0) {\n\t\t\twhile (newVertex.y <= y1) {\n\t\t\t\tif (d <= 0) {\n\t\t\t\t\td += delE\n\t\t\t\t\tnewVertex.y = newVertex.y + yInc\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\td += delNE\n\t\t\t\t\tnewVertex.y = newVertex.y + yInc\n\t\t\t\t\tnewVertex.x = newVertex.x + 1\n\t\t\t\t}\n\t\t\t\tshowPixel(imageData, newVertex, false)\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\twhile (newVertex.y >= y1) {\n\t\t\t\tif (d <= 0) {\n\t\t\t\t\td += delE\n\t\t\t\t\tnewVertex.y = newVertex.y + yInc\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\td += delNE\n\t\t\t\t\tnewVertex.y = newVertex.y + yInc\n\t\t\t\t\tnewVertex.x = (newVertex.x + 1)\n\t\t\t\t}\n\t\t\t\tshowPixel(imageData, newVertex, false)\n\t\t\t}\n\t\t}\n\t}\n}", "function countBlackWhiteRunTowardsPoint(origin, end, matrix, length) {\n var switchPoints = [{ x: Math.floor(origin.x), y: Math.floor(origin.y) }];\n var steep = Math.abs(end.y - origin.y) > Math.abs(end.x - origin.x);\n var fromX;\n var fromY;\n var toX;\n var toY;\n if (steep) {\n fromX = Math.floor(origin.y);\n fromY = Math.floor(origin.x);\n toX = Math.floor(end.y);\n toY = Math.floor(end.x);\n }\n else {\n fromX = Math.floor(origin.x);\n fromY = Math.floor(origin.y);\n toX = Math.floor(end.x);\n toY = Math.floor(end.y);\n }\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = Math.floor(-dx / 2);\n var xStep = fromX < toX ? 1 : -1;\n var yStep = fromY < toY ? 1 : -1;\n var currentPixel = true;\n // Loop up until x == toX, but not beyond\n for (var x = fromX, y = fromY; x !== toX + xStep; x += xStep) {\n // Does current pixel mean we have moved white to black or vice versa?\n // Scanning black in state 0,2 and white in state 1, so if we find the wrong\n // color, advance to next state or end if we are in state 2 already\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (matrix.get(realX, realY) !== currentPixel) {\n currentPixel = !currentPixel;\n switchPoints.push({ x: realX, y: realY });\n if (switchPoints.length === length + 1) {\n break;\n }\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += yStep;\n error -= dx;\n }\n }\n var distances = [];\n for (var i = 0; i < length; i++) {\n if (switchPoints[i] && switchPoints[i + 1]) {\n distances.push(distance(switchPoints[i], switchPoints[i + 1]));\n }\n else {\n distances.push(0);\n }\n }\n return distances;\n}", "function DrawLine(x1, y1, x2, y2){\n let x, y, dx, dy, dx1, dy1, px, py, xe, ye, i;\n dx = x2 - x1;\n dy = y2 - y1;\n dx1 = Math.abs(dx);\n dy1 = Math.abs(dy);\n px = 2 * dy1 - dx1;\n py = 2 * dx1 - dy1;\n if (dy1 <= dx1) {\n if (dx >= 0) {\n x = x1; y = y1; xe = x2;\n } else {\n x = x2; y = y2; xe = x1;\n }\n if($('#'+y+'a'+x).attr('type') == 'tile')\n prev_pixels.push($('#'+y+'a'+x));\n for (i = 0; x < xe; i++) {\n x = x + 1;\n if (px < 0) {\n px = px + 2 * dy1;\n } else {\n if ((dx < 0 && dy < 0) || (dx > 0 && dy > 0)) {\n y = y + 1;\n } else {\n y = y - 1;\n }\n px = px + 2 * (dy1 - dx1);\n }\n if($('#'+y+'a'+x).attr('type') == 'tile')\n prev_pixels.push($('#'+y+'a'+x));\n }\n } else {\n if (dy >= 0) {\n x = x1; y = y1; ye = y2;\n } else { \n x = x2; y = y2; ye = y1;\n }\n if($('#'+y+'a'+x).attr('type') == 'tile')\n prev_pixels.push($('#'+y+'a'+x));\n for (i = 0; y < ye; i++) {\n y = y + 1;\n if (py <= 0) {\n py = py + 2 * dx1;\n } else {\n if ((dx < 0 && dy<0) || (dx > 0 && dy > 0)) {\n x = x + 1;\n } else {\n x = x - 1;\n }\n py = py + 2 * (dx1 - dy1);\n }\n if($('#'+y+'a'+x).attr('type') == 'tile')\n prev_pixels.push($('#'+y+'a'+x));\n }\n }\n}", "_drawLineLow( x1, y1, x2, y2, id ) {\n const dx = x2 - x1;\n let dy = y2 - y1;\n let yIncrement = 1;\n if ( dy < 0 ) {\n yIncrement = -1;\n dy = -dy;\n }\n\n let decision = 2 * dy - dx;\n let y = y1;\n\n for ( let x = x1; x <= x2; x += 1 ) {\n this.setPixel( x, y, id );\n\n if ( decision > 0 ) {\n y += yIncrement;\n decision = decision - ( 2 * dx );\n }\n\n decision = decision + ( 2 * dy );\n }\n }", "function animateLineDrawing() {\n const animationLoop = requestAnimationFrame(animateLineDrawing);\n c.clearRect(0,0,608,608)\n c.beginPath();\n c.moveTo(x1,y1)\n c.lineTo(x,y)\n c.lineWidth = 10;\n c.strokeStyle = 'rgba(70,225,33,0.8)';\n c.stroke();\n\n if (x1 <= x2 && y1 <= y2) {\n if (x < x2) { x += 10; }\n if (y < y2) { y += 10; }\n if (x >= x2 && y >= y2) {cancelAnimationFrame(animationLoop);}\n }\n if (x1 <= x2 && y1 >= y2) {\n if (x < x2) { x += 10; }\n if (y > y2) { y -= 10; }\n if (x >= x2 && y <= y2) {cancelAnimationFrame(animationLoop);}\n }\n }", "function drawOnePixelLine(line, context, color) {\n var imageData;\n if (line.x1 == line.x2) {\n imageData = context.getImageData(line.x1, line.y1, 1, Math.abs(line.y2-line.y1));\n } else if (line.y1 == line.y2) {\n imageData = context.getImageData(line.x1, line.y1, Math.abs(line.x2-line.x1), 1);\n } else {\n alert('error');\n }\n var linedata = imageData.data;\n for (var i = 0; i < linedata.length; ++i) {\n linedata[i++] = color.R;\n linedata[i++] = color.G;\n linedata[i++] = color.B;\n linedata[i] = color.A;\n }\n context.putImageData(imageData, line.x1, line.y1);\n}", "function breakUpLine(line){\n \n var smallerLines = [];\n var xDiff = line.x2 - line.x1;\n var yDiff = line.y2 - line.y1;\n \n //Check to see if line is horizontal or vertical first\n //if a line is vertical, x will always be the same value\n //if the difference between y2 and y1 is greater than 2, the line is made up of many smaller lines\n if (line.x1 == line.x2){\n if ((line.y2 - line.y1) > 2) {\n for(var i = 0; i < ((line.y2 - line.y1) / 2); i++){\n smallerLines[i] = new Line(line.x1, (line.y1 + (2 * i)), line.x1, (line.y1 + (2 * i) + 2));\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //if a line is horizontal, y will always be the same value\n //if the difference between x2 and x1 is greater than 2, the line is made up of many smaller lines\n if (line.y1 == line.y2){\n if ((line.x2 - line.x1) > 2) {\n for(var i = 0; i < ((line.x2 - line.x1) / 2); i++){\n smallerLines[i] = new Line((line.x1 + (2 * i)), line.y1, (line.x1 + (2 * i) + 2), line.y1);\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //Diagonals\n \n //work out the gradient based upon whether xdiff or ydiff is higher\n //y can be negative so use the absolute value for testing\n var gradient;\n //Check to see whether the diagonal line doesn't need breaking up and return it if this is the case\n if(xDiff == 1 && Math.abs(yDiff) == 1){\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n //x grows at the same rate as y\n else if (xDiff == Math.abs(yDiff)){\n //diagonal that slopes downwards\n if(yDiff > 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + i), (line.x1 + i + 1), (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n //diagonal that slopes upwards\n else if(yDiff < 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - i), (line.x1 + i + 1), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //x grows faster than y\n else if (xDiff > Math.abs(yDiff)){\n gradient = ((line.x2 - line.x1)/(line.y2 - line.y1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (xDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * gradient)), (line.y1 + i), (line.x1 + (i * gradient) + gradient), (line.y1 + i + 1)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (xDiff / Math.abs(gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * Math.abs(gradient))), (line.y1 - i), (line.x1 + (i * Math.abs(gradient)) + Math.abs(gradient)), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n } \n }\n // y grows faster than x\n else if (xDiff < Math.abs(yDiff)){\n gradient = ((line.y2 - line.y1)/(line.x2 - line.x1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (yDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + (i * gradient)), (line.x1 + i + 1), (line.y1 + (i * gradient) + gradient)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (Math.abs(yDiff / gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - (i * Math.abs(gradient))), (line.x1 + i + 1), (line.y1 - (i * Math.abs(gradient)) - Math.abs(gradient)));\n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n } \n }\n else {\n // smallerLines.add(line);\n }\n \n return smallerLines; \n}", "function animateLineDrawing() {\n //this variable creates a loop\n const animationLoop = requestAnimationFrame(animateLineDrawing);\n //this method clears content from last loop iteration\n c.clearRect(0, 0, 608, 608)\n //this method starts a new path\n c.beginPath();\n //this method moves us to a starting point for our line\n c.moveTo(x1, y1)\n //this method indicates the end point in our line\n c.lineTo(x, y)\n //this method sets the width of the line\n c.lineWidth = 10;\n //this method sets the color of the line\n c.strokeStyle = 'rgba(70, 255, 33, .8)';\n //this method draws everything we have laid out above\n c.stroke();\n // this condition checks if we have reached the end point\n if (x1 <= x2 && y1 <= y2) {\n //this condition adds 10 to the previos end x point\n if (x < x2) { x += 10; }\n if (y < y2) { y += 10; }\n //this condition cancels our animation loop if we have reached our end points\n if (x >= x2 && y >= y2) { cancelAnimationFrame(animationLoop); }\n }\n //this condition is similar to the one above\n //this is necessary fir the 6, 4, 2 win condition\n if (x1 <= x2 && y1 >= y2) {\n if (x < x2) { x += 10; }\n if (y > y2) { y -= 10; }\n if (x >= x2 && y <= y2) { cancelAnimationFrame(animationLoop);}\n }\n \n }", "function animateLineDrawing() { //interacts with the canvas\n const animationLoop = requestAnimationFrame(animateLineDrawing); //creates a loop\n c.clearRect(0, 0, 608, 608) //clears content from the last loop iteration\n c.beginPath() //starts a new path\n c.moveTo(x1, y1) //moves to a starting point for the line\n c.lineTo(x, y) //indicates end of the line \n c.lineWidth = 10; //sets the width of the line \n c.strokeStyle = 'rgba(70, 255, 33, .8)'; //sets the color of the line\n c.stroke(); //draws everything laid out above\n\n if (x1 <= x2 && y1 <= y2) { //checks if the end point was reached\n if (x < x2) { x += 10; } //this adds 10 to the previous end x point\n if (y < y2) { y += 10; } //this adds 10 to the previous end y point\n if (x >= x2 && y >= y2) { cancelAnimationFrame(animationLoop); }\n }\n\n if (x1 <= x2 && y1 >= y2) { //Needed for 6, 4, 2 condition\n if (x < x2) { x += 10; }\n if (y > y2) { y -= 10; }\n if (x >= x2 && y <= y2) { cancelAnimationFrame(animationLoop); }\n }\n }", "function wuLine(x1, y1, x2, y2) {\n var canvas = document.getElementById(\"canvas3\");\n var context = canvas.getContext(\"2d\");\n var steep = Math.abs(y2 - y1) > Math.abs(x2 - x1);\n if (steep) {\n x1 = [y1, y1 = x1][0];\n x2 = [y2, y2 = x2][0];\n }\n if (x1 > x2) {\n x1 = [x2, x2 = x1][0];\n y1 = [y2, y2 = y1][0];\n }\n draw(context, colorFigure, steep ? y1 : x1, steep ? x1 : y1);\n draw(context, colorFigure, steep ? y2 : x2, steep ? x2 : y2);\n var dx = x2 - x1;\n var dy = y2 - y1;\n var gradient = dy / dx;\n var y = y1 + gradient;\n for (var x = x1 + 1; x < x2 - 1; x++) {\n colorFigure.a = (1 - (y - Math.floor(y))) * 10000;\n draw(context, colorFigure, x, Math.floor(y));\n colorFigure.a = (y - Math.floor(y)) * 10000;\n draw(context, colorFigure, x, Math.floor(y));\n y += gradient;\n }\n}", "function getLinePoints(p1,p2)\n{\n\tvar slope;\n var begin;\n var end;\n var original;\n \n var horiz = Math.abs(p1[0]-p2[0]) > Math.abs(p1[1]-p2[1]); //Find pixel increment direction\n \n //Get start x,y and ending y\n if(horiz) //if pixel increment is left to right\n {\n if(p1[0]<p2[0]){begin=p1[0];end=p2[0];original=p1[1];}\n else {begin=p2[0];end=p1[0];original=p2[1];}\n slope = (p1[1]-p2[1])/(p1[0]-p2[0]);\n\n }\n else\n {\n if(p1[1]<p2[1]){begin=p1[1];end=p2[1];original=p1[0];}\n else {begin=p2[1];end=p1[1];original=p2[0];}\n slope = (p1[0]-p2[0])/(p1[1]-p2[1]);\n }\n var nps = [];\n\tvar state = begin + 1;\n //(yn-yo)/(xn-xo)=slope\n // yn = slope*(xn-xo)+yo\n while(state<end)\n\t{\n\t if(horiz)nps.push([state,Math.round((state-begin)*slope+original)])\n else nps.push([Math.round((state-begin)*slope+original),state])\n\t state+= 1;\n\t}\n\treturn nps;\n \n}", "function animateLineDrawing() {\n // creates a loop\n const animationLoop = requestAnimationFrame(animateLineDrawing);\n // clears content from last loop iteration\n c.clearRect(0, 0, 608, 608);\n // starts a new path\n c.beginPath();\n // moves to starting point for line\n c.moveTo(x1, y1)\n // end of our line\n c.lineTo(x, y)\n // sets width of line\n c.lineWidth = 10;\n // sets color\n c.strokeStyle = 'rgba(250, 19, 13, .8)';\n // draws everything laid out above\n c.stroke();\n // checks if we've reached endpoint\n if (x1 <= x2 && y1 <= y2) {\n // adds 10 to previous end x point\n if (x < x2) { x += 10; }\n // adds 10 to previous y point\n if (y < y2) { y+= 10; }\n // this cancels animation loop if we've reached endpoints\n if (x >= x2 && y >= y2) { cancelAnimationFrame(animationLoop); }\n }\n //necessary for 6, 4, 2 win\n if (x1 <= x2 && y1 >= y2) {\n if (x < x2) { x+= 10; }\n if (y > y2) { y-= 10; }\n if (x >= x2 && y <= y2) { cancelAnimationFrame(animationLoop); }\n }\n }", "function animateLineDrawing(){\r\n const animationLoop=requestAnimationFrame(animateLineDrawing);\r\n c.clearRect(0,0,608,608);\r\n c.beginPath();\r\n c.moveTo(x1,y1);\r\n c.lineTo(x,y);\r\n c.lineWidth=10;\r\n c.strokeStyle='rgba(70,255,33,.8)';\r\n c.stroke();\r\n if(x1<=x2&&y1<=y2){\r\n if(x<x2){x+=10;}\r\n if(y<y2){y+=10;}\r\n if(x>=x2&&y>=y2){cancelAnimationFrame(animationLoop);}\r\n }\r\n if(x1<=x2&&y1>=y2){\r\n if(x<x2){x+=10;}\r\n if(y>y2){y-=10;}\r\n if(x>=x2&&y<=y2){cancelAnimationFrame(animationLoop);}\r\n }\r\n}", "function drawLineDDA(pixels, Width, Height, X1, Y1, X2, Y2, r, g, b, alpha, dashed, MINX, MAXX, MINY, MAXY)\n {\n\tvar W = Math.floor(Width);\n\tvar H = Math.floor(Height);\n\n\tvar x1 = Math.round(X1);\n\tvar y1 = Math.round(Y1);\n\tvar x2 = Math.round(X2);\n\tvar y2 = Math.round(Y2);\n\n\tvar minX = Math.round(MINX);\n\tvar maxX = Math.round(MAXX);\n\tvar minY = Math.round(MINY);\n\tvar maxY = Math.round(MAXY);\n\n\t// Distance start and end point\n\tvar dx = x2 - x1;\n\tvar dy = y2 - y1;\n\n\t// Determine slope (absoulte value)\n\tvar len = dy >= 0 ? dy : -dy;\n\tvar lenx = dx >= 0 ? dx : -dx;\n\tvar fatX = true;\n\tif (lenx > len)\n\t{\n\t len = lenx;\n\t fatX = false;\n\t}\n\n\t// Prevent divison by zero\n\tif (len != 0)\n\t{\n\t // Init steps and start\n\t var incx = dx / len;\n\t var incy = dy / len;\n\t var x = x1;\n\t var y = y1;\n\n\t // Walk the line!\n\t for (var i = 0; i < len; i++)\n\t {\n\t\tif(!dashed \n\t\t || (i % 5 < 3)) { // if dashed, draw 3, skip 2, draw 3, skip 2 etc.\n\t\t \n\t\t var ry = Math.round(y);\n\t\t var rx = Math.round(x);\n\t\t for(var w = 0; w < lineWidth; w++) {\n\t\t\tif(ry >= minY && ry < maxY\n\t\t\t && rx >= minX && rx < maxX) {\n\t\t\t \n\t\t\t var offset = (ry * W + rx) * 4;\n\t\t\t \n\t\t\t blendRGBAs(r,g,b,alpha, offset, pixels);\n\t\t\t}\n\t\t\tif(fatX) {\n\t\t\t rx++;\n\t\t\t} else {\n\t\t\t ry++;\n\t\t\t}\n\t\t }\n\t\t}\n\t\tx += incx;\n\t\ty += incy;\n\t }\n\t}\n }", "function breakUpLineOrth(line){\n \n var smallerLines = [];\n \n var xDiff = line.x2 - line.x1;\n var yDiff = line.y2 - line.y1;\n \n //Check to see if line is horizontal or vertical first\n //if a line is vertical, x will always be the same value\n //if the difference between y2 and y1 is greater than 1, the line is made up of many smaller lines\n if (line.x1 == line.x2){\n if ((line.y2 - line.y1) > 1) {\n for(var i = 0; i < (line.y2 - line.y1); i++){\n smallerLines[i] = new Line(line.x1, (line.y1 + i), line.x1, (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n //if a line is horizontal, y will always be the same value\n //if the difference between x2 and x1 is greater than 1, the line is made up of many smaller lines\n if (line.y1 == line.y2){\n if ((line.x2 - line.x1) > 1) {\n for(var i = 0; i < (line.x2 - line.x1); i++){\n smallerLines[i] = new Line((line.x1 + i), line.y1, (line.x1 + i + 1), line.y1);\n smallerLines[i].type = line.type;\n }\n }\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n return smallerLines;\n }\n \n //Diagonals\n \n //work out the gradient based upon whether xdiff or ydiff is higher\n //y can be negative so use the absolute value for testing\n var gradient;\n \n //Check to see whether the diagonal line doesn't need breaking up and return it if this is the case\n if(xDiff == 1 && Math.abs(yDiff) == 1){\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n \n \n //x grows at the same rate as y\n else if (xDiff == Math.abs(yDiff)){\n //diagonal that slopes downwards\n if(yDiff > 0){\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + i), (line.x1 + i + 1), (line.y1 + i + 1));\n smallerLines[i].type = line.type;\n }\n }\n else if(yDiff < 0){\n //diagonal that slopes upwards\n for (var i = 0; i < xDiff; i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - i), (line.x1 + i + 1), (line.y1 - i - 1));\n smallerLines[i].type = line.type;\n }\n }\n }\n //x grows faster than y\n else if (xDiff > Math.abs(yDiff)){\n gradient = ((line.x2 - line.x1)/(line.y2 - line.y1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (xDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * gradient)), (line.y1 + i), (line.x1 + (i * gradient) + gradient), (line.y1 + i + 1)); \n smallerLines[i].type = line.type;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (xDiff / Math.abs(gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + (i * Math.abs(gradient))), (line.y1 - i), (line.x1 + (i * Math.abs(gradient)) + Math.abs(gradient)), (line.y1 - i - 1)); \n smallerLines[i].type = line.type;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n \n }\n // y grows faster than x\n else if (xDiff < Math.abs(yDiff)){\n gradient = ((line.y2 - line.y1)/(line.x2 - line.x1))\n //if gradient is a whole number then the line will cut across other dots and therefore need to be broken into smaller lines\n if (gradient % 1 === 0){\n \n if( gradient > 0){\n for (var i = 0; i < (yDiff / gradient); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 + (i * gradient)), (line.x1 + i + 1), (line.y1 + (i * gradient) + gradient)); \n smallerLines[i].typed = line.typed;\n }\n }\n //if gradient is negative then diagonal goes up to the right\n else if( gradient < 0){\n for (var i = 0; i < (Math.abs(yDiff / gradient)); i++ ){\n smallerLines[i] = new Line((line.x1 + i), (line.y1 - (i * Math.abs(gradient))), (line.x1 + i + 1), (line.y1 - (i * Math.abs(gradient)) - Math.abs(gradient))); \n smallerLines[i].typed = line.typed;\n }\n }\n }\n //else if gradient is not a whole number\n else {\n smallerLines[0] = line;\n smallerLines[0].type = line.type;\n }\n \n }\n \n else {\n // smallerLines.add(line);\n }\n \n return smallerLines;\n}", "function calcCrackLine(path, point, direction, backset){\r\n\tvar line = new Path.Line(point.add(direction.multiply(backset)), point.add(direction.multiply(-500)));\r\n\tline.strokeColor = '#FF4500';\r\n\tline.strokeWidth = 3;\r\n\r\n\tvar inters = line.getIntersections(path);\r\n\tvar intersoffs = inters[1-inters.length%2].offset;\r\n\tvar cutline = line.splitAt(intersoffs*state.getNextInt(50,80)/100);\r\n\tcutline.remove();\r\n\tline.remove();\r\n\r\n\tvar jitterline = jitterPath(line);\r\n\tjitterline.strokeWidth = 3;\r\n\tjitterline.strokeColor = 'red';\r\n\tjitterline.closed = false;\r\n\treturn jitterline;\r\n}", "function bresenhamLine(x1, y1, x2, y2) {\n var canvas = document.getElementById(\"canvas2\");\n var context = canvas.getContext(\"2d\");\n var steep = Math.abs(y2 - y1) > Math.abs(x2 - x1);\n if (steep) {\n x1 = [y1, y1 = x1][0];\n x2 = [y2, y2 = x2][0];\n }\n if (x1 > x2) {\n x1 = [x2, x2 = x1][0];\n y1 = [y2, y2 = y1][0];\n }\n var dx = x2 - x1;\n var dy = y2 - y1;\n var error = dx / 2;\n var yStep = (y1 < y2) ? 1 : -1;\n var y = y1;\n for (var x = x1; x < x2; x++) {\n draw(context, colorFigure, steep ? y : x, steep ? x : y);\n error -= dy;\n if (error < 0) {\n y += yStep;\n error += dx;\n }\n }\n}", "function drawLine(img, line, c) {\n\tconst m = -line[0] / line[1];\n\tif(Math.abs(m) > 1) {\n\t\t// Iterate over y\n\t\tfor(let y = 0; y < img.shape[0]; y++) {\n\t\t\tconst x = -Math.round((line[1]*y + line[2]) / line[0])\n\t\t\tif(x >= 0 && x < img.shape[1])\n\t\t\t\tfor(let i = 0; i < c.length; i++)\n\t\t\t\t\timg.set(c[i], y, x, i)\n\n\t\t}\n\t} else {\n\t\t// Iterate over x\n\t\tfor(let x = 0; x < img.shape[1]; x++) {\n\t\t\tconst y = -Math.round((line[0]*x + line[2]) / line[1])\n\t\t\tif(y >= 0 && y < img.shape[0])\n\t\t\t\tfor(let i = 0; i < c.length; i++)\n\t\t\t\t\timg.set(c[i], y, x, i)\n\n\t\t}\n\t}\n\n\treturn img\n}", "function drawLineBressenhamSimple(buffer, x1, y1, x2, y2, colour) {\n var dx = Math.abs(x2 - x1);\n var dy = Math.abs(y2 - y1);\n var sx, sy;\n if (x1 < x2) {\n sx = 1;\n } else {\n sx = -1;\n }\n if (y1 < y2) {\n sy = 1;\n } else {\n sy = -1;\n }\n var err = dx - dy;\n while (x1 !== x2 && y1 !== y2) {\n setPixel(buffer, x1, y1, colour);\n var e2 = 2 * err;\n if (e2 > -dy) {\n err = err - dy;\n x1 = x1 + sx;\n }\n if (e2 < dx) {\n err = err + dx;\n y1 = y1 + sy;\n }\n }\n}", "_drawLineHigh( x1, y1, x2, y2, id ) {\n let dx = x2 - x1;\n const dy = y2 - y1;\n let xIncrement = 1;\n if ( dx < 0 ) {\n xIncrement = -1;\n dx = -dx;\n }\n\n let decision = 2 * dx - dy;\n let x = x1;\n\n for ( let y = y1; y <= y2; y += 1 ) {\n this.setPixel( x, y, id );\n\n if ( decision > 0 ) {\n x += xIncrement;\n decision = decision - ( 2 * dy );\n }\n\n decision = decision + ( 2 * dx );\n }\n }", "function lineToPoint(previousPoint, point) {\n\t\t\t\t\tvar pointVM = point._view;\n\t\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\t\tvar pointVM = point._view;\n\t\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function lineToPoint(previousPoint, point) {\n\t\t\t\tvar pointVM = point._view;\n\t\t\t\tif (point._view.steppedLine === true) {\n\t\t\t\t\tctx.lineTo(pointVM.x, previousPoint._view.y);\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else if (point._view.tension === 0) {\n\t\t\t\t\tctx.lineTo(pointVM.x, pointVM.y);\n\t\t\t\t} else {\n\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextX,\n\t\t\t\t\t\tpreviousPoint._view.controlPointNextY,\n\t\t\t\t\t\tpointVM.controlPointPreviousX,\n\t\t\t\t\t\tpointVM.controlPointPreviousY,\n\t\t\t\t\t\tpointVM.x,\n\t\t\t\t\t\tpointVM.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}", "function drawLine(buffer, x1, y1, x2, y2, colour) {\n var m = (y2 - y1) / (x2 - x1);\n for (var x = x1; x < x2; x++) {\n y1 = y1 + m;\n setPixel(buffer, x, y1, colour);\n }\n}", "function drawline() {\n\n var start_in = win_height * .3;\n var start_out = win_height;\n\n if (scroll_top >= (start_in - 25) && scroll_top <= (start_out * 2)) {\n\n var svg_container = document.getElementById(\"whatwedo\");\n var svg_paths = svg_container.getElementsByTagNameNS(ns, \"path\");\n var svg_lines = svg_container.getElementsByTagNameNS(ns, \"line\");\n\n if (scroll_top - start_in < 0) {\n var percent_done = 0;\n } else {\n var percent_done = (scroll_top - start_in) / (start_out - start_in);\n }\n\n for (var x = 0; x < svg_paths.length; x++) {\n var path = svg_paths[x];\n var path_length = path.getTotalLength();\n var length = percent_done * path_length;\n\n path.style.strokeDasharray = [length, path_length].join(' ');\n path.style.fillOpacity = percent_done - .4;\n }\n\n for (var x = 0; x < svg_lines.length; x++) {\n\n var line = svg_lines[x];\n var line_height = path.getTotalLength();\n var length = percent_done * line_height + 36;\n\n line.style.strokeOpacity = percent_done;\n line.style.strokeDasharray = [length, path_length].join(' ');\n }\n }\n }", "function drawLine(array, low, high, line) {\n var arrayX = array.element.offset().left - array.element.parent().offset().left;\n var arrayY = array.element.offset().top - array.element.parent().offset().top + 150;\n var dy = - (array.value(high) - array.value(low)) * 130 / array.value(arraySize - 1);\n var dx = (high - low) * 37;\n var k;\n if (dx === 0) {\n k = 0;\n } else {\n k = dy / dx;\n }\n var x0 = arrayX + 2 + 37 * low;\n var y0 = arrayY - 130 * array.value(low) / array.value(arraySize - 1);\n var b = y0 - k * x0;\n var x1 = arrayX + 2;\n var y1 = k * x1 + b;\n var x2 = arrayX + 2 + 37 * arraySize;\n var y2 = k * x2 + b;\n\n line.movePoints([[0, x1, y1], [1, x2, y2]]);\n line.css({opacity: 0.2});\n }", "shiftLine({ yMin, yMax, xOffset }) {\n const srcImg = this.img;\n const destPixels = new Uint8ClampedArray(srcImg.pixels);\n\n ImgUtil.forEachPixel(srcImg, rgba => rgba.forEach((i, idx) => {\n let j = i;\n if (idx < 3) j = i + xOffset;\n destPixels[i] = srcImg.pixels[j];\n }), y => (y > yMin && y < yMax));\n\n return destPixels;\n }", "function distanceWithLine(p1, p2) \n{\n\tvar dist,\n\t\tdx = p1.x - p2.x;\n\t\tdy = p1.y - p2.y;\n\t\n\tdist = Math.sqrt(dx*dx + dy*dy);\n\t\t\t\n\t// Draw the line when distance is smaller\n\t// then the minimum distance\n\tif(dist <= minDist) \n\t{\n\t\t\n\t\t// Draw the line\n\t\tctx.beginPath();\n\t\tctx.strokeStyle = \"rgba(255,255,255,\"+ (1.2-dist/minDist) +\")\";\n\t\tctx.moveTo(p1.x, p1.y);\n\t\tctx.lineTo(p2.x, p2.y);\n\t\tctx.stroke();\n\t\tctx.closePath();\n\t\t\n\t\t\n\t\t\n\t\t// Some acceleration for the partcles \n\t\t// depending upon their distance\n\t\tvar ax = (document.getElementById(\"textInputPress\").value)*Math.random()/50000,\n\t\t\tay = (document.getElementById(\"textInputPress\").value)*Math.random()/50000;\n\t\t\n\t\t// Apply the acceleration on the particles\n\t\tp1.vx -= ax;\n\t\tp1.vy -= ay;\n\t\t\n\t\tp2.vx += ax;\n\t\tp2.vy += ay;\n\t}\n}", "function draw_line(e){\n\n //console.log(\"PrevX:\"+prevX);\n draw_dot(e);\n \n ctx.lineTo(e.offsetX,e.offsetY);\n \n ctx.stroke();\n\n //console.log(\"PrevX:\"+prevX);\n}", "function distanceNextFrame(a, b) {\r\n return Math.sqrt((a.x + a.dx - b.x - b.dx)**2 + (a.y + a.dy - b.y - b.dy)**2) - a.radius - b.radius;\r\n}", "function drawLine() {\n ctx.beginPath();\n // handle simple clicks\n if (points.length == 1) {\n y2 += simple_click_offset;\n }\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.closePath();\n}", "function offsetLine(from, to, distance) {\n if (from.x === to.x && from.y === to.y) {\n throw \"Cannot offset a line that starts and ends in the same point\";\n }\n let angle = from.angle(to) - 90;\n\n return new Path()\n .move(from.shift(angle, distance))\n .line(to.shift(angle, distance));\n}", "function _winding(point,vs) {\n\n //Is a line from v1 to v2 entirely left of point p, entirely right of it, or neither?\n //A = difference in X from v1 to v2\n //B = difference in in Y from v1 to p\n //C = difference in X from v1 to p\n //D = difference in Y from v1 to v2\n //If AB > CD, it's strictly to the left of p in the direction v1->v2\n //If AB < CD, it's strictly to the right of p in the direction v1->v2\n function dir(v1,v2,p) {\n return (v2[0] - v1[0]) * (p[1] - v1[1]) - (p[0] - v1[0]) * (v2[1] - v1[1])\n }\n\n function isLeft(v1,v2,p) {\n return dir(v1,v2,p) > 0;\n }\n\n function isRight(v1,v2,p) {\n return dir(v1,v2,p) < 0;\n }\n\n var w = 0;\n\n //Need to compare last point connecting back to first\n if (vs[vs.length-1][0] !== vs[0][0] || vs[vs.length-1][1] !== vs[0][1]) {\n vs = vs.slice(0);\n vs.push(vs[0]);\n }\n\n //For each segment\n for (var i = 0, l = vs.length - 1; i < l; i++) {\n\n //Check upward\n if (vs[i][1] <= point[1]) {\n if (vs[i+1][1] > point[1] && isLeft(vs[i],vs[i+1],point)) {\n w++;\n }\n // Check downward\n } else if (vs[i+1][1] <= point[1] && isRight(vs[i],vs[i+1],point)) {\n w--;\n }\n\n }\n\n return w !== 0;\n\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math.pi : -_math.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0, _pointEqual.default)(point0, point2) || (0, _pointEqual.default)(point1, point2)) point1[2] = 1;\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n\n if (v && (!point0 || !(0, _pointEqual.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function getLineDistance(start, end) {\n // return Math.sqrt(Math.abs(start.x - end.x) ** 2 + Math.abs(start.y - end.y) ** 2);\n return Math.sqrt(Math.pow(Math.abs(start.x - end.x), 2) + Math.pow(Math.abs(start.y - end.y), 2));\n}", "line(start, end)\n {\n let path = [];\n\n // Common case where start == end\n if (start.x === end.x && start.y === end.y)\n path.push(start);\n\n // Common case where start.x == end.x\n else if (start.x === end.x)\n {\n if (start.y < end.y) {\n for (let y = start.y; y <= end.y; y ++)\n path.push(new Vector(start.x, y));\n } else {\n for (let y = start.y; y >= end.y; y --)\n path.push(new Vector(start.x, y));\n }\n }\n\n // Common case where start.y == end.y\n else if (start.y === end.y)\n {\n if (start.x < end.x) {\n for (let x = start.x; x <= end.x; x ++)\n path.push(new Vector(x, start.y));\n } else {\n for (let x = start.x; x >= end.x; x --)\n path.push(new Vector(x, start.y));\n }\n }\n\n // Other cases\n else\n {\n let n = Vector.diagonalDistance(start, end);\n for (let i = 0; i <= n; i ++)\n {\n var t = i === 0 ? 0 : i / n;\n path.push(Vector.lerp(start, end, t).round());\n }\n }\n\n return path.map(position => this.positionInfo(position));\n }", "function FastClosestPointOnLine (pt, line)\n{\n\tvar X1 = line[0][0], Y1 = line[0][1];\n\tvar X2 = line[1][0], Y2 = line[1][1];\n\tvar px = pt[0], py = pt[1];\n\n\tvar dx = X2 - X1;\n\tvar dy = Y2 - Y1;\n\n\tvar nx,ny;\n\n\tif (dx == 0 && dy == 0)\n\t{\n\t\t// It's a point not a line segment.\n\t\t// dx = px - X1\n\t\t// dy = py - Y1\n\t\t// distance = Sqr(dx * dx + dy * dy)\n\t\tnx = X1;\n\t\tny = Y1;\n\t} else\n\t{\n\t\t// Calculate the t that minimizes the distance.\n\t\tvar t = ((px - X1) * dx + (py - Y1) * dy) / (dx * dx + dy * dy);\n\n\t\t// See if this represents one of the segment's\n\t\t// end points or a point in the middle.\n\t\tif (t <= 0)\n\t\t{\n\t\t\tnx = X1;\n\t\t\tny = Y1;\n\t\t} else if (t >= 1)\n\t\t{\n\t\t\tnx = X2;\n\t\t\tny = Y2;\n\t\t} else\n\t\t{\n\t\t\tnx = X1 + t * dx;\n\t\t\tny = Y1 + t * dy;\n\t\t}\n\t}\n\n\tdx = px - nx;\n\tdy = py - ny;\n\n\treturn dx * dx + dy * dy;\n}", "static DistancePointToLine() {}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$1 : -pi$1), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? math_pi : -math_pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function drawSlope(slope, container, width, height, lineWidth) {\n\t//Set up the container and canvas.\n\t$(container).css(\"width\", width);\n\t$(container).css(\"height\", height);\n\tvar c = document.createElement(\"canvas\");\n\t$(c).prop(\"width\", width)\n\t$(c).prop(\"height\", height)\n\t$(c).css(\"width\", width);\n\t$(c).css(\"height\", height);\n\tvar ctx=c.getContext(\"2d\");\n\n\t//Set background color based on slope with some fun color math :)\n\tmaxSlope = 100.0;\n\tmaxLog = Math.log(maxSlope);\n\tcolorSlope = Math.log(Math.abs(slope)); //We use the log to accelerate the transition from green to red.\n\tintensity = 225 - Math.round((Math.min(colorSlope, maxSlope) * 110.0) / maxLog); \n\tctx.fillStyle = (slope < 0) ? 'rgb(225,' + intensity + ',0)' : 'rgb(' + intensity + ',225,0)';\n\tctx.fillRect(0, 0, width, height);\n\t\n\t//Scale slope for better viewing - this means a slope of 5 will run the diagonal.\n\tslope = slope / 5\n\t\n\t//Calculate start and end points depending on the slope.\n\tif (Math.abs(slope) > 1) {\n\t\tvar y1 = height;\n\t\tvar y2 = 0;\n\t\tvar x1 = (width/2)-((1/slope) * (width/2))\n\t\tvar x2 = (width/2)+((1/slope) * (width/2))\n\t} else {\n\t\tvar y1 = (height/2) + (slope * (height/2));\n\t\tvar y2 = (height/2) - (slope * (height/2));\n\t\tvar x1 = 0;\n\t\tvar x2 = width;\n\t}\n\t\n\t//Draw the line.\n\tctx.beginPath();\n\tctx.moveTo(x1, y1);\n\tctx.lineTo(x2, y2);\n\tctx.lineWidth = lineWidth;\n\tctx.stroke();\n\t$(container).append(c);\n\treturn c;\n}", "function walkLine(ctx, points, lineType, visibleRange) {\r\n if (points.length === 0) {\r\n return;\r\n }\r\n var x = points[visibleRange.from]._internal_x;\r\n var y = points[visibleRange.from]._internal_y;\r\n ctx.moveTo(x, y);\r\n for (var i = visibleRange.from + 1; i < visibleRange.to; ++i) {\r\n var currItem = points[i];\r\n // x---x---x or x---x o or start\r\n if (lineType === 1 /* WithSteps */) {\r\n var prevY = points[i - 1]._internal_y;\r\n var currX = currItem._internal_x;\r\n ctx.lineTo(currX, prevY);\r\n }\r\n ctx.lineTo(currItem._internal_x, currItem._internal_y);\r\n }\r\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean;\n // no intersections\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi], point2, v = visible(lambda, phi), c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n (point0 = point1, v0 = v, c0 = c);\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n }", "static pointDistanceFromLine(point, start, end) {\n var tPoint = Utils.closestPointOnLine(point, start, end);\n var tDx = point.x - tPoint.x;\n var tDy = point.y - tPoint.y;\n return Math.sqrt(tDx * tDx + tDy * tDy);\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function draw_line(p1, p2) {\n var dist = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x)\n + (p1.y - p2.y) * (p1.y - p2.y));\n var line = document.createElement(\"div\");\n line.className = \"line\";\n line.style.width = dist + \"px\";\n line.style.backgroundColor = \"#bbbbbb\";\n lines_div.appendChild(line);\n var m = (p1.y - p2.y) / (p1.x - p2.x);\n var ang = Math.atan(m);\n var ps = [p1, p2];\n var left = ps[0].x < ps[1].x ? 0 : 1;\n var top = ps[0].y < ps[1].y ? 0 : 1;\n if (left == top) {\n line.style.transformOrigin = \"top left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n else {\n line.style.transformOrigin = \"bottom left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[1 - top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_0__.pi : -_math_js__WEBPACK_IMPORTED_MODULE_0__.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point2) || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !(0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_0__.pi : -_math_js__WEBPACK_IMPORTED_MODULE_0__.pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point2) || (0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !(0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_2__.default)(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "_drawLine() {\n let canvas = this.chart.canvas;\n let ctx = canvas.ctx;\n\n // Defining coordinates of points\n let points = this.points;\n\n let firstVisiblePoint = undefined;\n for (let i = 0; i < points.length; i++) {\n if (canvas.isPointVisible(points[i])) {\n firstVisiblePoint = i;\n break;\n }\n }\n\n // If there is no visible point, there's nothing to draw for this line\n if (firstVisiblePoint === undefined) return;\n \n // Drawing line\n // Move cursor to the point right before the first visible\n let startPoint = firstVisiblePoint > 0 ? firstVisiblePoint - 1 : 0;\n ctx.moveTo(points[startPoint].x, points[startPoint].y);\n\n for (let i = firstVisiblePoint; i < points.length; i++) {\n let p = points[i];\n ctx.lineTo(p.x, p.y);\n\n // If it already drawn a not visible point, stop\n if (!canvas.isPointVisible(p))\n break;\n }\n }", "function actualFlag(x,y) {\n var ctx = canvas.getContext('2d');\n ctx.lineTo(x+21,y+22);\n ctx.lineTo(x+28,y+22);\n ctx.lineTo(x+28,y+25);\n ctx.lineTo(x+12,y+25);\n ctx.lineTo(x+12,y+22);\n ctx.lineTo(x+19,y+22);\n ctx.lineTo(x+19,y+8);\n ctx.lineTo(x+12,y+4);\n ctx.lineTo(x+21,y+0);\n}", "_drawLine(x1, y1, x2, y2, opt_boundRect) {\n if (opt_boundRect) {\n let minX = Math.min(x1, x2);\n let maxX = Math.max(x1, x2);\n let minY = Math.min(y1, y2);\n let maxY = Math.max(y1, y2);\n\n if (opt_boundRect.left <= minX && maxX < opt_boundRect.right &&\n opt_boundRect.top <= minY && maxY < opt_boundRect.bottom) {\n opt_boundRect = null; // the line is fully inside the drawing area\n } else if (opt_boundRect.left > maxX || minX >= opt_boundRect.right ||\n opt_boundRect.top > maxY || minY > opt_boundRect.bottom) {\n return; // the line is outside the drawing area\n }\n }\n\n let dx = x2 - x1;\n let dy = y2 - y1;\n\n if (dx !== 0 || dy !== 0) {\n if (Math.abs(dx) > Math.abs(dy)) {\n let a = dy / dx;\n let b = -a * x1 + y1;\n\n if (dx < 0) {\n let x0 = x1;\n x1 = x2;\n x2 = x0;\n }\n\n for (let x = x1; x <= x2; x++) {\n let y = Math.round(a * x + b);\n this._drawPixel(x, y, opt_boundRect);\n }\n } else {\n let a = dx / dy;\n let b = -a * y1 + x1;\n\n if (dy < 0) {\n let y0 = y1;\n y1 = y2;\n y2 = y0;\n }\n\n for (let y = y1; y <= y2; y++) {\n let x = Math.round(a * y + b);\n this._drawPixel(x, y, opt_boundRect);\n }\n }\n }\n }", "function calculate_line(mp, point) {\n var a = mp[0] - point[0];\n var b = mp[1] - point[1];\n var omegaFirst = tanh(a/b);\n \n var aPrime1 = 30*Math.sin(omegaFirst);\n var bPrime1 = 30*Math.cos(omegaFirst);\n \n var omegaSecond = tanh(a/b);\n \n var aPrime2 = 30*Math.sin(omegaSecond);\n var bPrime2 = 30*Math.cos(omegaSecond);\n \n var start=[];\n var end = [];\n \n if (a>0 && b>0){\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a<0 && b>0) {\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a>0 && b<0) {\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n else {\n // a<0 && b<0\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n \n return [start,end];\n}", "function drawMazeLine(from, to) {\n ctx.beginPath();\n ctx.lineWidth = boxSize - (1*lineWeight);\n\n ctx.moveTo(from.getX(), from.getY());\n ctx.lineTo(to.getX(), to.getY());\n\n ctx.closePath();\n ctx.strokeStyle = \"white\";\n ctx.stroke();\n}", "function drawLine(moveToX, moveToY, lineToX, lineToY) {\n ctx2.beginPath();\n ctx2.moveTo(moveToX, moveToY);\n ctx2.lineTo(lineToX, lineToY);\n ctx2.strokeStyle = color;\n \n /* we want diameter so line width matches circle */\n ctx2.lineWidth = radius * 2;\n ctx2.stroke(); /* actually draw the line */\n }", "function onMoveLine(direction, lineId) {\n moveLine(direction, lineId);\n showImg();\n drawText()\n}", "forward(dist, isVisible) {\n var radPerDeg = 0.017453393;\n var x = this.CP.x + dist * Math.cos(radPerDeg * this.CD);\n var y = this.CP.y + dist * Math.sin(radPerDeg * this.CD);\n if (isVisible) this.path.lineTo(x, y);\n else this.path.moveTo(x, y);\n this.CP = new THREE.Vector2(x, y);\n }", "function distance(p1, p2)\n{\n\tvar\tdx = p1.x - p2.x,\n\tdy = p1.y - p2.y,\n\tdist = Math.sqrt(dx*dx + dy*dy);\n\n\t// Draw line if distance is smaller than minDistance \n\tif(dist <= minDist)\n\t{\n\t\t// Draw the line\n\t\tif(lines == true)\n\t\t{\n\t\t\tctx.beginPath();\n\t\t\tctx.strokeStyle = \"rgba(200,200,200,\" + (1.2 - dist/minDist) + \")\";\n\t\t\tctx.moveTo(p1.x, p1.y);\n\t\t\tctx.lineTo(p2.x, p2.y);\n\t\t\tctx.stroke();\n\t\t\tctx.closePath();\n\t\t}\n\n\t\t// Some acceleration depending on distance\n\t\tvar ax = dx/af,\n\t\t\tay = dy/af;\n\n\t\t// Appy the acceleration\n\t\tp1.vx -= ax;\n\t\tp1.vy -= ay;\n\n\t\tp2.vx += ax;\n\t\tp2.vy += ay;\t\n\t}\n}", "function drawLines() {\n ctx.lineWidth = 0.5;\n\n for (var i = 0; i < numOfDots; i++) {\n for (var j = i + 1; j < numOfDots; j++) {\n\n var dot1 = dots[i];\n var dot2 = dots[j];\n var distance = Math.hypot(Math.abs(dot1.x - dot2.x),\n Math.abs(dot1.y - dot2.y));\n\n if (distance <= 200) {\n\n var saturation = 1 - distance / 200;\n saturation = Math.floor(saturation * 100) / 100;\n ctx.strokeStyle = `rgba(255, 255, 255, ${saturation})`;\n\n ctx.beginPath();\n ctx.moveTo(dot1.x, dot1.y);\n ctx.lineTo(dot2.x, dot2.y);\n ctx.stroke();\n }\n }\n }\n}", "drawThinLineToCurrentLocation_() {\n let r = this.radius / 2;\n let x0 = this.radius, y0 = this.radius;\n let x1 = x0 + r * Math.cos(this.arm0Rotation * Math.PI / 180);\n let y1 = y0 + r * Math.sin(this.arm0Rotation * Math.PI / 180);\n let x2 = x1 + r * Math.cos((this.arm0Rotation + this.arm1Rotation) * Math.PI / 180);\n let y2 = y1 + r * Math.sin((this.arm0Rotation + this.arm1Rotation) * Math.PI / 180);\n\n let context = this.canvas_.getContext('2d');\n context.beginPath();\n context.moveTo(this.lastDrawnX0_, this.lastDrawnY0_);\n context.lineTo(x2, y2);\n this.lastDrawnX0_ = x2;\n this.lastDrawnY0_ = y2;\n context.stroke();\n }", "function connectDots(curr, prev) {\n let color = new cv.Scalar(255, 255, 255);\n cv.line(canvas, prev, curr, color, 4, 8, 0);\n}", "function determineEdgeMidpointsLR(curr_edge, sourcex, targetx, sourcey, targety, sourcestub, largestRowWidth) {\n //coordinates for the stubs\n var sourcestubx;\n var targetstubx;\n var stublength = curr_edge.sourceObject.questionRowHeight;\n\n //Handle determination of source and target stub locations\n if (sourcestub === LEFT) {\n sourcestubx = sourcex - stublength;\n } else {\n sourcestubx = sourcex + stublength;\n }\n \n targetstubx = targetx - stublength;\n\n curr_edge.points = [];\n curr_edge.points.push([sourcex, sourcey]); //source\n curr_edge.points.push([sourcestubx, sourcey]); //source stub\n\n var testx;\n var segment;\n var numcollisions;\n\n //first, see if you can just go straight to the target\n segment = {points: [[sourcestubx, sourcey], [targetstubx, sourcey], [targetstubx, targety]], sourceObject: curr_edge.sourceObject, targetObject: curr_edge.targetObject, color: curr_edge.color};\n numcollisions = testSegmentCollision(segment);\n if (numcollisions !== Number.MAX_VALUE) {\n curr_edge.points.push([targetstubx, sourcey]);\n if (sourcey !== targety) {\n curr_edge.points.push([targetstubx, targety]);\n }\n if (targetstubx !== targetx) {\n curr_edge.points.push([targetx, targety]); //target\n }\n return false;\n }\n\n //If not, check possible places to shove down a line.\n var multiple = 0;\n var mincollisions = Number.MAX_VALUE;\n var bestmultiple = 0;//stores which multiple is best\n\n while (multiple < 8) { //Number of attempts is based on largest possible buffer between nodes\n testx = sourcestubx + (multiple * sourcestub * curr_edge.sourceObject.questionRowHeight / 2); //x coordinate for the potential segment\n\n segment = {points: [[sourcestubx, sourcey], [testx, sourcey], [testx, targety], [targetstubx, targety]], sourceObject: curr_edge.sourceObject, targetObject: curr_edge.targetObject, color: curr_edge.color};\n\n numcollisions = testSegmentCollision(segment);\n if (numcollisions < mincollisions && isNotBetween(testx, targetx, targetstubx)) {\n mincollisions = numcollisions;\n bestmultiple = multiple;\n }\n multiple += 1;\n }\n\n\n var p1 = [sourcestubx + bestmultiple * sourcestub * curr_edge.sourceObject.questionRowHeight / 2, sourcey];\n var p2 = [sourcestubx + bestmultiple * sourcestub * curr_edge.sourceObject.questionRowHeight / 2, targety];\n var p3 = [targetstubx, targety];\n var p4 = [targetx, targety];\n\n curr_edge.points.push(p1);\n if (p1 !== p2){\n curr_edge.points.push(p2);\n }\n if (p2[0] !== p3[0]) {\n curr_edge.points.push(p3);\n }\n if (p3[0] !== p4[0]) {\n curr_edge.points.push(p4); //target\n }\n\n // Draw midpoints\n var mycanvas = document.getElementById('maincanvas');\n var ctx = mycanvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = 'green';\n ctx.arc(p1[0], p1[1], 4, 0, 2*Math.PI);\n ctx.fill();\n/*\n ctx.beginPath();\n ctx.fillStyle = 'blue';\n ctx.arc(p2[0], p2[1], 4, 0, 2*Math.PI);\n ctx.fill();\n*/\n return mincollisions === Number.MAX_VALUE;\n}", "function Detector(image) {\n function DetectorResult(bits, points) {\n this.bits = bits;\n this.points = points;\n }\n this.image = image;\n this.resultPointCallback = null;\n\n this.sizeOfBlackWhiteBlackRun = function(fromX, fromY, toX, toY) {\n // Mild variant of Bresenham's algorithm;\n // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\n var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\n if (steep) {\n var temp = fromX;\n fromX = fromY;\n fromY = temp;\n temp = toX;\n toX = toY;\n toY = temp;\n }\n\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = -dx >> 1;\n var ystep = fromY < toY ? 1 : -1;\n var xstep = fromX < toX ? 1 : -1;\n var state = 0; // In black pixels, looking for white, first or second time\n for (var x = fromX, y = fromY; x != toX; x += xstep) {\n\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (state == 1) {\n // In white pixels, looking for black\n if (this.image[realX + realY * qrcode.width]) {\n state++;\n }\n } else {\n if (!this.image[realX + realY * qrcode.width]) {\n state++;\n }\n }\n\n if (state == 3) {\n // Found black, white, black, and stumbled back onto white; done\n var diffX = x - fromX;\n var diffY = y - fromY;\n return Math.sqrt((diffX * diffX + diffY * diffY));\n }\n error += dy;\n if (error > 0) {\n if (y == toY) {\n break;\n }\n y += ystep;\n error -= dx;\n }\n }\n var diffX2 = toX - fromX;\n var diffY2 = toY - fromY;\n return Math.sqrt((diffX2 * diffX2 + diffY2 * diffY2));\n }\n\n\n this.sizeOfBlackWhiteBlackRunBothWays = function(fromX, fromY, toX, toY) {\n\n var result = this.sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);\n\n // Now count other way -- don't run off image though of course\n var scale = 1.0;\n var otherToX = fromX - (toX - fromX);\n if (otherToX < 0) {\n scale = fromX / (fromX - otherToX);\n otherToX = 0;\n } else if (otherToX >= qrcode.width) {\n scale = (qrcode.width - 1 - fromX) / (otherToX - fromX);\n otherToX = qrcode.width - 1;\n }\n var otherToY = Math.floor(fromY - (toY - fromY) * scale);\n\n scale = 1.0;\n if (otherToY < 0) {\n scale = fromY / (fromY - otherToY);\n otherToY = 0;\n } else if (otherToY >= qrcode.height) {\n scale = (qrcode.height - 1 - fromY) / (otherToY - fromY);\n otherToY = qrcode.height - 1;\n }\n otherToX = Math.floor(fromX + (otherToX - fromX) * scale);\n\n result += this.sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);\n return result - 1.0; // -1 because we counted the middle pixel twice\n }\n\n\n\n this.calculateModuleSizeOneWay = function(pattern, otherPattern) {\n var moduleSizeEst1 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(pattern.X), Math.floor(pattern.Y), Math.floor(otherPattern.X), Math.floor(otherPattern.Y));\n var moduleSizeEst2 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(otherPattern.X), Math.floor(otherPattern.Y), Math.floor(pattern.X), Math.floor(pattern.Y));\n if (isNaN(moduleSizeEst1)) {\n return moduleSizeEst2 / 7.0;\n }\n if (isNaN(moduleSizeEst2)) {\n return moduleSizeEst1 / 7.0;\n }\n // Average them, and divide by 7 since we've counted the width of 3 black modules,\n // and 1 white and 1 black module on either side. Ergo, divide sum by 14.\n return (moduleSizeEst1 + moduleSizeEst2) / 14.0;\n }\n\n\n this.calculateModuleSize = function(topLeft, topRight, bottomLeft) {\n // Take the average\n return (this.calculateModuleSizeOneWay(topLeft, topRight) + this.calculateModuleSizeOneWay(topLeft, bottomLeft)) / 2.0;\n }\n\n this.distance = function(pattern1, pattern2) {\n xDiff = pattern1.X - pattern2.X;\n yDiff = pattern1.Y - pattern2.Y;\n return Math.sqrt((xDiff * xDiff + yDiff * yDiff));\n }\n this.computeDimension = function(topLeft, topRight, bottomLeft, moduleSize) {\n\n var tltrCentersDimension = Math.round(this.distance(topLeft, topRight) / moduleSize);\n var tlblCentersDimension = Math.round(this.distance(topLeft, bottomLeft) / moduleSize);\n var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\n switch (dimension & 0x03) {\n\n // mod 4\n case 0:\n dimension++;\n break;\n // 1? do nothing\n\n case 2:\n dimension--;\n break;\n\n case 3:\n throw \"Error\";\n }\n return dimension;\n }\n\n this.findAlignmentInRegion = function(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor) {\n // Look for an alignment pattern (3 modules in size) around where it\n // should be\n var allowance = Math.floor(allowanceFactor * overallEstModuleSize);\n var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\n var alignmentAreaRightX = Math.min(qrcode.width - 1, estAlignmentX + allowance);\n if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\n throw \"Error\";\n }\n\n var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\n var alignmentAreaBottomY = Math.min(qrcode.height - 1, estAlignmentY + allowance);\n\n var alignmentFinder = new AlignmentPatternFinder(this.image, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, this.resultPointCallback);\n return alignmentFinder.find();\n }\n\n this.createTransform = function(topLeft, topRight, bottomLeft, alignmentPattern, dimension) {\n var dimMinusThree = dimension - 3.5;\n var bottomRightX;\n var bottomRightY;\n var sourceBottomRightX;\n var sourceBottomRightY;\n if (alignmentPattern != null) {\n bottomRightX = alignmentPattern.X;\n bottomRightY = alignmentPattern.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree - 3.0;\n } else {\n // Don't have an alignment pattern, just make up the bottom-right point\n bottomRightX = (topRight.X - topLeft.X) + bottomLeft.X;\n bottomRightY = (topRight.Y - topLeft.Y) + bottomLeft.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree;\n }\n\n var transform = PerspectiveTransform.quadrilateralToQuadrilateral(3.5, 3.5, dimMinusThree, 3.5, sourceBottomRightX, sourceBottomRightY, 3.5, dimMinusThree, topLeft.X, topLeft.Y, topRight.X, topRight.Y, bottomRightX, bottomRightY, bottomLeft.X, bottomLeft.Y);\n\n return transform;\n }\n\n this.sampleGrid = function(image, transform, dimension) {\n\n var sampler = GridSampler;\n return sampler.sampleGrid3(image, dimension, transform);\n }\n\n this.processFinderPatternInfo = function(info) {\n\n var topLeft = info.TopLeft;\n var topRight = info.TopRight;\n var bottomLeft = info.BottomLeft;\n\n var moduleSize = this.calculateModuleSize(topLeft, topRight, bottomLeft);\n if (moduleSize < 1.0) {\n throw \"Error\";\n }\n var dimension = this.computeDimension(topLeft, topRight, bottomLeft, moduleSize);\n var provisionalVersion = Version.getProvisionalVersionForDimension(dimension);\n var modulesBetweenFPCenters = provisionalVersion.DimensionForVersion - 7;\n\n var alignmentPattern = null;\n // Anything above version 1 has an alignment pattern\n if (provisionalVersion.AlignmentPatternCenters.length > 0) {\n\n // Guess where a \"bottom right\" finder pattern would have been\n var bottomRightX = topRight.X - topLeft.X + bottomLeft.X;\n var bottomRightY = topRight.Y - topLeft.Y + bottomLeft.Y;\n\n // Estimate that alignment pattern is closer by 3 modules\n // from \"bottom right\" to known top left location\n var correctionToTopLeft = 1.0 - 3.0 / modulesBetweenFPCenters;\n var estAlignmentX = Math.floor(topLeft.X + correctionToTopLeft * (bottomRightX - topLeft.X));\n var estAlignmentY = Math.floor(topLeft.Y + correctionToTopLeft * (bottomRightY - topLeft.Y));\n\n // Kind of arbitrary -- expand search radius before giving up\n for (var i = 4; i <= 16; i <<= 1) {\n //try\n //{\n alignmentPattern = this.findAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, i);\n break;\n //}\n //catch (re)\n //{\n // try next round\n //}\n }\n // If we didn't find alignment pattern... well try anyway without it\n }\n\n var transform = this.createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);\n\n var bits = this.sampleGrid(this.image, transform, dimension);\n\n var points;\n if (alignmentPattern == null) {\n points = new Array(bottomLeft, topLeft, topRight);\n } else {\n points = new Array(bottomLeft, topLeft, topRight, alignmentPattern);\n }\n return new DetectorResult(bits, points);\n }\n\n\n\n this.detect = function() {\n var info = new FinderPatternFinder().findFinderPattern(this.image);\n\n return this.processFinderPatternInfo(info);\n }\n}", "function trackLine(evt, point) {\n if (!your_turn_to_draw) {\n return;\n }\n else if (evt == 'start') {\n x2 = point[0] - canvas.offsetLeft + window.pageXOffset;\n y2 = point[1] - canvas.offsetTop + window.pageYOffset;\n x1 = x2;\n y1 = y2;\n ctx.strokeStyle = draw_color;\n ctx.lineWidth = line_width;\n points.push([x2, y2]);\n currently_drawing = true;\n drawing_timeout_id = setTimeout(uploadPartialLine,\n drawing_upload_interval);\n }\n else if (evt == 'stop' && currently_drawing) {\n currently_drawing = false;\n clearTimeout(drawing_timeout_id);\n // handle simple clicks\n if (points.length == 1) {\n drawLine();\n }\n uploadLine();\n points = [];\n }\n else if (evt == 'move' && currently_drawing) {\n x1 = x2;\n y1 = y2;\n x2 = point[0] - canvas.offsetLeft + window.pageXOffset;\n y2 = point[1] - canvas.offsetTop + window.pageYOffset;\n points.push([x2, y2]);\n drawLine();\n }\n}", "function drawWinLine(coordX1, coordY1, coordX2, coordY2) {\n //this line accesses our html canvas element\n const canvas = document.getElementById('win-lines')\n //this line gives us acces to methods and properties to use on canvas\n const c = canvas.getContext('2d');\n //this line indicates where the start of a lines x axis is\n let x1 = coordX1,\n y1 = coordY1,\n x2 = coordX2,\n y2 = coordY2;\n //this variable stores temporary y axis data we update in our animation loop\n x = x1,\n y = y1;\n \n //this function interacts with the canvas\n function animateLineDrawing() {\n //this variable creates a loop\n const animationLoop = requestAnimationFrame(animateLineDrawing);\n //this method clears content from last loop iteration\n c.clearRect(0, 0, 608, 608)\n //this method starts a new path\n c.beginPath();\n //this method moves us to a starting point for our line\n c.moveTo(x1, y1)\n //this method indicates the end point in our line\n c.lineTo(x, y)\n //this method sets the width of the line\n c.lineWidth = 10;\n //this method sets the color of the line\n c.strokeStyle = 'rgba(70, 255, 33, .8)';\n //this method draws everything we have laid out above\n c.stroke();\n // this condition checks if we have reached the end point\n if (x1 <= x2 && y1 <= y2) {\n //this condition adds 10 to the previos end x point\n if (x < x2) { x += 10; }\n if (y < y2) { y += 10; }\n //this condition cancels our animation loop if we have reached our end points\n if (x >= x2 && y >= y2) { cancelAnimationFrame(animationLoop); }\n }\n //this condition is similar to the one above\n //this is necessary fir the 6, 4, 2 win condition\n if (x1 <= x2 && y1 >= y2) {\n if (x < x2) { x += 10; }\n if (y > y2) { y -= 10; }\n if (x >= x2 && y <= y2) { cancelAnimationFrame(animationLoop);}\n }\n \n }\n\n //this function clears our canvas after our win line is drawn\n function clear() {\n //this line starts an animation loop\n const animationLoop = requestAnimationFrame(clear);\n //this line clears our canvas\n c.clearRect(0, 0, 608, 608)\n //this line stops our animation loop\n cancelAnimationFrame(animationLoop);\n }\n //this line disalows clicking while the win sound is playing\n disableClick();\n //this line plays the win sound\n audio('./media/glitterWinSound.mp3');\n //this line calls out our main animation loop\n animateLineDrawing();\n setTimeout(function () { clear(); resetGame(); }, 1000);\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon;\n point1[1] += epsilon;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }", "function drawBitmapLine(useBitmap, startX, startY, endX, endY) {\n let lineLength = Math.sqrt(Math.pow(endX - startX, 2) + Math.pow(endY - startY, 2));\n let lineAngle = Math.atan2(endY - startY, endX - startX);\n // edge case: avoid floating point imprecision flickering of angle on small values\n if (lineLength < 1) {\n // we COULD just not render, but this leaves gaps in the effect\n // if we are drawing multiple lines close together\n // return; \n lineAngle = 0;\n lineLength = 1;\n }\n canvasContext.save();\n canvasContext.translate(startX, startY);\n canvasContext.rotate(lineAngle);\n canvasContext.translate(0, - useBitmap.height / 2);\n canvasContext.drawImage(useBitmap,\n 0, 0, useBitmap.width, useBitmap.height, // src \n 0, 0, lineLength, useBitmap.height); // dest\n canvasContext.restore();\n}", "function lineDist(toPt, pt1, pt2) {\n var num = Math.abs((pt2.y - pt1.y) * toPt.x - (pt2.x - pt1.x) * toPt.y + pt2.x * pt1.y - pt2.y * pt1.x)\n var denom = Math.sqrt(Math.pow(pt2.y - pt1.y, 2) + Math.pow(pt2.x - pt1.x, 2))\n return num / denom;\n}", "function getClosestPointOfLine(lineStart, lineEnd, point) {\n var ab = lineEnd.sub(lineStart)\n var ap = point.sub(lineStart)\n var mul = (ab.x * ap.x + ab.y * ap.y) / (ab.x * ab.x + ab.y * ab.y)\n return lineStart.add(ab.mult(mul))\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n\n return {\n lineStart: function () {\n v00 = v0 = false;\n clean = 1;\n },\n point: function (lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? _math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"] : -_math__WEBPACK_IMPORTED_MODULE_2__[\"pi\"]), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart(); // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n\n if (v !== v0) {\n point2 = intersect(point0, point1);\n\n if (!point2 || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point2) || Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point1, point2)) {\n point1[0] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n point1[1] += _math__WEBPACK_IMPORTED_MODULE_2__[\"epsilon\"];\n v = visible(point1[0], point1[1]);\n }\n }\n\n if (v !== v0) {\n clean = 0;\n\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t; // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n\n if (v && (!point0 || !Object(_pointEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function () {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function () {\n return clean | (v00 && v0) << 1;\n }\n };\n } // Intersects the great circle between a and b with the clip circle.", "function drawSlopeLabel() {\n let label = document.getElementById(\"slopeLabel\");\n // display when points are pinned. do not redraw if nothing changed\n if (pt1.pinned && pt2.pinned && m != label.innerHTML.substring(2)\n && isFinite(m) && m != 0 && !riseRunDisplay) {\n // find midpoint of line, put the label there\n midpoint = calcMidpoint(pt1.x, pt1.y, pt2.x, pt2.y);\n screenPos = planeCoordToAbsScreenPosition(midpoint.x, midpoint.y, 0, 0);\n label.hidden = false;\n label.innerHTML = \"m=\" + m.toFixed(2);\n label.style.left = screenPos.x + \"px\";\n label.style.top = screenPos.y + \"px\";\n }\n}", "function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n // Handle degeneracies.\n // TODO ignore if not clipping polygons.\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {\n point1[0] += epsilon$2;\n point1[1] += epsilon$2;\n v = visible(point1[0], point1[1]);\n }\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1]);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }" ]
[ "0.62139547", "0.61954993", "0.6179459", "0.60642296", "0.60226446", "0.59796935", "0.5974374", "0.5972752", "0.5943547", "0.59431183", "0.58777785", "0.5847808", "0.5822344", "0.58144855", "0.5797529", "0.57889766", "0.57707244", "0.57664996", "0.5708701", "0.5691311", "0.5669877", "0.56660557", "0.5633174", "0.5624064", "0.5594002", "0.5533334", "0.5533334", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5506003", "0.5493531", "0.5477957", "0.53748184", "0.53730017", "0.5330233", "0.53090787", "0.5281661", "0.52813", "0.52809954", "0.5273458", "0.52653813", "0.5259861", "0.5256264", "0.5255069", "0.5254099", "0.5249461", "0.5245461", "0.52425283", "0.5240745", "0.5230398", "0.52231944", "0.5218905", "0.5218905", "0.52122116", "0.52068806", "0.52068806", "0.5202255", "0.51935023", "0.5192343", "0.5191029", "0.51906246", "0.51681304", "0.516677", "0.5162336", "0.5155342", "0.51498723", "0.5141683", "0.51407635", "0.51389277", "0.5129613", "0.5127672", "0.51256126", "0.51249987", "0.5122624", "0.5122624", "0.5122624", "0.5122624", "0.5122624", "0.5122624", "0.5117651", "0.5115364", "0.5115364", "0.5115364", "0.5115364", "0.5115364", "0.5115364", "0.51126444", "0.51073915", "0.51051104", "0.51027477", "0.5097995", "0.50957346" ]
0.5739863
18
Computes the total width of a finder pattern by looking for a blackwhiteblack run from the center in the direction of another point (another finder pattern center), and in the opposite direction too.
function sizeOfBlackWhiteBlackRunBothWays(fromX, fromY, toX, toY, image) { var result = sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image); // Now count other way -- don't run off image though of course var scale = 1; var otherToX = fromX - (toX - fromX); if (otherToX < 0) { scale = fromX / (fromX - otherToX); otherToX = 0; } else if (otherToX >= image.width) { scale = (image.width - 1 - fromX) / (otherToX - fromX); otherToX = image.width - 1; } var otherToY = (fromY - (toY - fromY) * scale); scale = 1; if (otherToY < 0) { scale = fromY / (fromY - otherToY); otherToY = 0; } else if (otherToY >= image.height) { scale = (image.height - 1 - fromY) / (otherToY - fromY); otherToY = image.height - 1; } otherToX = (fromX + (otherToX - fromX) * scale); result += sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY, image); return result - 1; // -1 because we counted the middle pixel twice }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countBlackWhiteRun(origin, end, matrix, length) {\n var rise = end.y - origin.y;\n var run = end.x - origin.x;\n var towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));\n var awayFromEnd = countBlackWhiteRunTowardsPoint(origin, { x: origin.x - run, y: origin.y - rise }, matrix, Math.ceil(length / 2));\n var middleValue = towardsEnd.shift() + awayFromEnd.shift() - 1; // Substract one so we don't double count a pixel\n return (_a = awayFromEnd.concat(middleValue)).concat.apply(_a, towardsEnd);\n var _a;\n}", "function sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image) {\r\n\t\t fromX = Math.floor(fromX);\r\n\t\t fromY = Math.floor(fromY);\r\n\t\t toX = Math.floor(toX);\r\n\t\t toY = Math.floor(toY);\r\n\t\t // Mild variant of Bresenham's algorithm;\r\n\t\t // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\r\n\t\t var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\r\n\t\t if (steep) {\r\n\t\t var temp = fromX;\r\n\t\t fromX = fromY;\r\n\t\t fromY = temp;\r\n\t\t temp = toX;\r\n\t\t toX = toY;\r\n\t\t toY = temp;\r\n\t\t }\r\n\t\t var dx = Math.abs(toX - fromX);\r\n\t\t var dy = Math.abs(toY - fromY);\r\n\t\t var error = -dx >> 1;\r\n\t\t var xstep = fromX < toX ? 1 : -1;\r\n\t\t var ystep = fromY < toY ? 1 : -1;\r\n\t\t // In black pixels, looking for white, first or second time.\r\n\t\t var state = 0;\r\n\t\t // Loop up until x == toX, but not beyond\r\n\t\t var xLimit = toX + xstep;\r\n\t\t for (var x = fromX, y = fromY; x != xLimit; x += xstep) {\r\n\t\t var realX = steep ? y : x;\r\n\t\t var realY = steep ? x : y;\r\n\t\t // Does current pixel mean we have moved white to black or vice versa?\r\n\t\t // Scanning black in state 0,2 and white in state 1, so if we find the wrong\r\n\t\t // color, advance to next state or end if we are in state 2 already\r\n\t\t if ((state == 1) === image.get(realX, realY)) {\r\n\t\t if (state == 2) {\r\n\t\t return distance(x, y, fromX, fromY);\r\n\t\t }\r\n\t\t state++;\r\n\t\t }\r\n\t\t error += dy;\r\n\t\t if (error > 0) {\r\n\t\t if (y == toY) {\r\n\t\t break;\r\n\t\t }\r\n\t\t y += ystep;\r\n\t\t error -= dx;\r\n\t\t }\r\n\t\t }\r\n\t\t // Found black-white-black; give the benefit of the doubt that the next pixel outside the image\r\n\t\t // is \"white\" so this last point at (toX+xStep,toY) is the right ending. This is really a\r\n\t\t // small approximation; (toX+xStep,toY+yStep) might be really correct. Ignore this.\r\n\t\t if (state == 2) {\r\n\t\t return distance(toX + xstep, toY, fromX, fromY);\r\n\t\t }\r\n\t\t // else we didn't find even black-white-black; no estimate is really possible\r\n\t\t return NaN;\r\n\t\t}", "function countBlackWhiteRunTowardsPoint(origin, end, matrix, length) {\n var switchPoints = [{ x: Math.floor(origin.x), y: Math.floor(origin.y) }];\n var steep = Math.abs(end.y - origin.y) > Math.abs(end.x - origin.x);\n var fromX;\n var fromY;\n var toX;\n var toY;\n if (steep) {\n fromX = Math.floor(origin.y);\n fromY = Math.floor(origin.x);\n toX = Math.floor(end.y);\n toY = Math.floor(end.x);\n }\n else {\n fromX = Math.floor(origin.x);\n fromY = Math.floor(origin.y);\n toX = Math.floor(end.x);\n toY = Math.floor(end.y);\n }\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = Math.floor(-dx / 2);\n var xStep = fromX < toX ? 1 : -1;\n var yStep = fromY < toY ? 1 : -1;\n var currentPixel = true;\n // Loop up until x == toX, but not beyond\n for (var x = fromX, y = fromY; x !== toX + xStep; x += xStep) {\n // Does current pixel mean we have moved white to black or vice versa?\n // Scanning black in state 0,2 and white in state 1, so if we find the wrong\n // color, advance to next state or end if we are in state 2 already\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (matrix.get(realX, realY) !== currentPixel) {\n currentPixel = !currentPixel;\n switchPoints.push({ x: realX, y: realY });\n if (switchPoints.length === length + 1) {\n break;\n }\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += yStep;\n error -= dx;\n }\n }\n var distances = [];\n for (var i = 0; i < length; i++) {\n if (switchPoints[i] && switchPoints[i + 1]) {\n distances.push(distance(switchPoints[i], switchPoints[i + 1]));\n }\n else {\n distances.push(0);\n }\n }\n return distances;\n}", "function Detector(image) {\n function DetectorResult(bits, points) {\n this.bits = bits;\n this.points = points;\n }\n this.image = image;\n this.resultPointCallback = null;\n\n this.sizeOfBlackWhiteBlackRun = function(fromX, fromY, toX, toY) {\n // Mild variant of Bresenham's algorithm;\n // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\n var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\n if (steep) {\n var temp = fromX;\n fromX = fromY;\n fromY = temp;\n temp = toX;\n toX = toY;\n toY = temp;\n }\n\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = -dx >> 1;\n var ystep = fromY < toY ? 1 : -1;\n var xstep = fromX < toX ? 1 : -1;\n var state = 0; // In black pixels, looking for white, first or second time\n for (var x = fromX, y = fromY; x != toX; x += xstep) {\n\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (state == 1) {\n // In white pixels, looking for black\n if (this.image[realX + realY * qrcode.width]) {\n state++;\n }\n } else {\n if (!this.image[realX + realY * qrcode.width]) {\n state++;\n }\n }\n\n if (state == 3) {\n // Found black, white, black, and stumbled back onto white; done\n var diffX = x - fromX;\n var diffY = y - fromY;\n return Math.sqrt((diffX * diffX + diffY * diffY));\n }\n error += dy;\n if (error > 0) {\n if (y == toY) {\n break;\n }\n y += ystep;\n error -= dx;\n }\n }\n var diffX2 = toX - fromX;\n var diffY2 = toY - fromY;\n return Math.sqrt((diffX2 * diffX2 + diffY2 * diffY2));\n }\n\n\n this.sizeOfBlackWhiteBlackRunBothWays = function(fromX, fromY, toX, toY) {\n\n var result = this.sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);\n\n // Now count other way -- don't run off image though of course\n var scale = 1.0;\n var otherToX = fromX - (toX - fromX);\n if (otherToX < 0) {\n scale = fromX / (fromX - otherToX);\n otherToX = 0;\n } else if (otherToX >= qrcode.width) {\n scale = (qrcode.width - 1 - fromX) / (otherToX - fromX);\n otherToX = qrcode.width - 1;\n }\n var otherToY = Math.floor(fromY - (toY - fromY) * scale);\n\n scale = 1.0;\n if (otherToY < 0) {\n scale = fromY / (fromY - otherToY);\n otherToY = 0;\n } else if (otherToY >= qrcode.height) {\n scale = (qrcode.height - 1 - fromY) / (otherToY - fromY);\n otherToY = qrcode.height - 1;\n }\n otherToX = Math.floor(fromX + (otherToX - fromX) * scale);\n\n result += this.sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);\n return result - 1.0; // -1 because we counted the middle pixel twice\n }\n\n\n\n this.calculateModuleSizeOneWay = function(pattern, otherPattern) {\n var moduleSizeEst1 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(pattern.X), Math.floor(pattern.Y), Math.floor(otherPattern.X), Math.floor(otherPattern.Y));\n var moduleSizeEst2 = this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(otherPattern.X), Math.floor(otherPattern.Y), Math.floor(pattern.X), Math.floor(pattern.Y));\n if (isNaN(moduleSizeEst1)) {\n return moduleSizeEst2 / 7.0;\n }\n if (isNaN(moduleSizeEst2)) {\n return moduleSizeEst1 / 7.0;\n }\n // Average them, and divide by 7 since we've counted the width of 3 black modules,\n // and 1 white and 1 black module on either side. Ergo, divide sum by 14.\n return (moduleSizeEst1 + moduleSizeEst2) / 14.0;\n }\n\n\n this.calculateModuleSize = function(topLeft, topRight, bottomLeft) {\n // Take the average\n return (this.calculateModuleSizeOneWay(topLeft, topRight) + this.calculateModuleSizeOneWay(topLeft, bottomLeft)) / 2.0;\n }\n\n this.distance = function(pattern1, pattern2) {\n xDiff = pattern1.X - pattern2.X;\n yDiff = pattern1.Y - pattern2.Y;\n return Math.sqrt((xDiff * xDiff + yDiff * yDiff));\n }\n this.computeDimension = function(topLeft, topRight, bottomLeft, moduleSize) {\n\n var tltrCentersDimension = Math.round(this.distance(topLeft, topRight) / moduleSize);\n var tlblCentersDimension = Math.round(this.distance(topLeft, bottomLeft) / moduleSize);\n var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\n switch (dimension & 0x03) {\n\n // mod 4\n case 0:\n dimension++;\n break;\n // 1? do nothing\n\n case 2:\n dimension--;\n break;\n\n case 3:\n throw \"Error\";\n }\n return dimension;\n }\n\n this.findAlignmentInRegion = function(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor) {\n // Look for an alignment pattern (3 modules in size) around where it\n // should be\n var allowance = Math.floor(allowanceFactor * overallEstModuleSize);\n var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\n var alignmentAreaRightX = Math.min(qrcode.width - 1, estAlignmentX + allowance);\n if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\n throw \"Error\";\n }\n\n var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\n var alignmentAreaBottomY = Math.min(qrcode.height - 1, estAlignmentY + allowance);\n\n var alignmentFinder = new AlignmentPatternFinder(this.image, alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, this.resultPointCallback);\n return alignmentFinder.find();\n }\n\n this.createTransform = function(topLeft, topRight, bottomLeft, alignmentPattern, dimension) {\n var dimMinusThree = dimension - 3.5;\n var bottomRightX;\n var bottomRightY;\n var sourceBottomRightX;\n var sourceBottomRightY;\n if (alignmentPattern != null) {\n bottomRightX = alignmentPattern.X;\n bottomRightY = alignmentPattern.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree - 3.0;\n } else {\n // Don't have an alignment pattern, just make up the bottom-right point\n bottomRightX = (topRight.X - topLeft.X) + bottomLeft.X;\n bottomRightY = (topRight.Y - topLeft.Y) + bottomLeft.Y;\n sourceBottomRightX = sourceBottomRightY = dimMinusThree;\n }\n\n var transform = PerspectiveTransform.quadrilateralToQuadrilateral(3.5, 3.5, dimMinusThree, 3.5, sourceBottomRightX, sourceBottomRightY, 3.5, dimMinusThree, topLeft.X, topLeft.Y, topRight.X, topRight.Y, bottomRightX, bottomRightY, bottomLeft.X, bottomLeft.Y);\n\n return transform;\n }\n\n this.sampleGrid = function(image, transform, dimension) {\n\n var sampler = GridSampler;\n return sampler.sampleGrid3(image, dimension, transform);\n }\n\n this.processFinderPatternInfo = function(info) {\n\n var topLeft = info.TopLeft;\n var topRight = info.TopRight;\n var bottomLeft = info.BottomLeft;\n\n var moduleSize = this.calculateModuleSize(topLeft, topRight, bottomLeft);\n if (moduleSize < 1.0) {\n throw \"Error\";\n }\n var dimension = this.computeDimension(topLeft, topRight, bottomLeft, moduleSize);\n var provisionalVersion = Version.getProvisionalVersionForDimension(dimension);\n var modulesBetweenFPCenters = provisionalVersion.DimensionForVersion - 7;\n\n var alignmentPattern = null;\n // Anything above version 1 has an alignment pattern\n if (provisionalVersion.AlignmentPatternCenters.length > 0) {\n\n // Guess where a \"bottom right\" finder pattern would have been\n var bottomRightX = topRight.X - topLeft.X + bottomLeft.X;\n var bottomRightY = topRight.Y - topLeft.Y + bottomLeft.Y;\n\n // Estimate that alignment pattern is closer by 3 modules\n // from \"bottom right\" to known top left location\n var correctionToTopLeft = 1.0 - 3.0 / modulesBetweenFPCenters;\n var estAlignmentX = Math.floor(topLeft.X + correctionToTopLeft * (bottomRightX - topLeft.X));\n var estAlignmentY = Math.floor(topLeft.Y + correctionToTopLeft * (bottomRightY - topLeft.Y));\n\n // Kind of arbitrary -- expand search radius before giving up\n for (var i = 4; i <= 16; i <<= 1) {\n //try\n //{\n alignmentPattern = this.findAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, i);\n break;\n //}\n //catch (re)\n //{\n // try next round\n //}\n }\n // If we didn't find alignment pattern... well try anyway without it\n }\n\n var transform = this.createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);\n\n var bits = this.sampleGrid(this.image, transform, dimension);\n\n var points;\n if (alignmentPattern == null) {\n points = new Array(bottomLeft, topLeft, topRight);\n } else {\n points = new Array(bottomLeft, topLeft, topRight, alignmentPattern);\n }\n return new DetectorResult(bits, points);\n }\n\n\n\n this.detect = function() {\n var info = new FinderPatternFinder().findFinderPattern(this.image);\n\n return this.processFinderPatternInfo(info);\n }\n}", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function width(bb) {\n return (bb[1][0] - bb[0][0])\n }", "function AlignmentPatternFinder(image, startX\n /*int*/\n , startY\n /*int*/\n , width\n /*int*/\n , height\n /*int*/\n , moduleSize\n /*float*/\n , resultPointCallback) {\n _classCallCheck(this, AlignmentPatternFinder);\n\n this.image = image;\n this.startX = startX;\n this.startY = startY;\n this.width = width;\n this.height = height;\n this.moduleSize = moduleSize;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = []; // new Array<any>(5))\n // TYPESCRIPTPORT: array initialization without size as the length is checked below\n\n this.crossCheckStateCount = new Int32Array(3);\n }", "function left_right(x, y) { //black is 1----white is 2\r\n var currentChess = array[x][y];\r\n var sumOfChess = 1; // how many chess we have\r\n //left x--\r\n for (let i = x - 1; i >= 0; i--) {\r\n if (array[i][y] == currentChess) {\r\n sumOfChess = sumOfChess + 1;\r\n } else {\r\n break;\r\n }\r\n }\r\n //right x++\r\n for (let i = x + 1; i <= 14; i++) {\r\n if (array[i][y] == currentChess) {\r\n sumOfChess = sumOfChess + 1;\r\n } else {\r\n break;\r\n }\r\n }\r\n return sumOfChess;\r\n }", "function bankWidth(bank, y, fakeElevation) {\n fakeElevation = typeof fakeElevation == 'undefined' ? 0 : fakeElevation;\n for (var i = 0; i < bank.length - 1; ++i) {\n var a = Object.assign({}, bank[i]);\n var b = Object.assign({}, bank[i + 1]);\n\n // handle fake elevation\n if (fakeElevation > 0) {\n if (b.x > a.x) {\n b.y -= fakeElevation;\n a.y -= fakeElevation;\n }\n else {\n var inext = i + 2;\n var iprev = i - 1;\n if (inext < bank.length) {\n if (b.x < bank[inext].x) b.y -= fakeElevation;\n }\n if (iprev >= 0) {\n if (a.x > bank[iprev].x) a.y -= fakeElevation;\n }\n }\n }\n if (y <= a.y && y >= b.y)\n if (a.x == b.x)\n return a.x;\n else\n return (a.x >= b.x) ? (a.x + (y - a.y) / slope) : (a.x - (y - a.y) / slope);\n }\n return 0;\n}", "function width(bb) {\n\t\treturn (bb[1][0] - bb[0][0])\n\t\t}", "function getNumTurns(dir1, dir2) {\n return (dir2 - dir1 + 8) % 8;\n}", "function countNeighbours(centerX, centerY, searchSize) {\n\n var numCellsCounted = 0;\n var numNeighbours = 0;\n\n for (let xOffset = -searchSize; xOffset <= searchSize; xOffset++) {\n for (let yOffset = -searchSize; yOffset <= searchSize; yOffset++) {\n if (xOffset != 0 || yOffset != 0) { \n var xSamp = centerX + xOffset;\n var ySamp = centerY + yOffset;\n\n if (xSamp >= 0 && xSamp < cols && ySamp > 0 && ySamp < rows) {\n if (pPuffs[xSamp][ySamp]){\n numNeighbours += 1;\n }\n numCellsCounted += 1;\n }\n }\n }\n }\n\n return numNeighbours / numCellsCounted;\n}", "function smoothing(x, y) {\n var corners = ( noise(x-1, y-1)+noise(x+1, y-1)+noise(x-1, y+1)+noise(x+1, y+1) ) / 16;\n var sides = ( noise(x-1, y) +noise(x+1, y) +noise(x, y-1) +noise(x, y+1) ) / 8;\n var center = noise(x, y) / 4;\n var total = corners + sides + center;\n return total;\n}", "function getNeightbourCount(x, y){\n let count = 0;\n for (let yy = -1; yy < 2; yy++){\n for (let xx = -1; xx < 2; xx++){\n if (xx === 0 && yy === 0) \n continue;\n if (x + xx < 0 || x + xx > resolution - 1) \n continue;\n if (y + yy < 0 || y + yy > resolution - 1) \n continue;\n if (cells[x + xx][y + yy]) \n count++;\n }\n }\n return count;\n}", "function findPerimeter(length, width) {\n return (length * 2) + (width * 2);\n}", "get mapWidth() {return ~~(Math.abs(zeach.mapLeft) + zeach.mapRight)}", "function getNeighbor(whence, dir) {\n if (whence < 0 || whence >= msize || dir < 0 || dir > 3) {\n alert(\"Internal argument error; dir: \" + dir + \"; whence: \" + whence);\n return -1;\n }\n\n //North\n if (dir == 0) {\n if (whence >= width) {\n return whence - width;\n } else {\n return -1;\n }\n }\n\n //South\n if (dir == 3) {\n if (whence + width < msize) {\n return whence + width;\n } else {\n return -1;\n }\n }\n\n //West\n if (dir == 2) {\n if (whence % width != 0) {\n return whence - 1;\n } else {\n return -1;\n }\n }\n\n //East\n if (dir == 1) {\n if ((whence + 1) % width != 0) {\n return whence + 1;\n } else {\n return -1;\n }\n }\n\n return -1;\n }", "function spiralSearch(room, x, y, searchType, terminator = 0) {\n // curDir = direction in which we move right now\n let curDir = [1,0]\n // length of current segment\n let segLength = 1;\n\n let tempX = x;\n let tempY = y;\n\n // how much of current segment we passed\n let segPassed = 0;\n let doneSearching = false;\n\n let n = 0;\n let countUnits = 0; // only needed for some of the clues\n let uniqueUnits = [];\n\n while(!doneSearching) {\n // make a step, add 'direction' vector to current position\n tempX = wrapCoords(tempX + curDir[0], room.mapWidth);\n tempY = wrapCoords(tempY + curDir[1], room.mapHeight);\n\n // here we actually check if there's something of value\n let curTile = room.map[tempY][tempX];\n\n // there are different types of spiral searches in the game\n // some clues search for land, some for ships, etc.\n // this statement switches between them\n switch(searchType) {\n case 1:\n // if we've found land, return distance from original position (x,y) to land tile (tempX,tempY)\n if(curTile.val >= 0.2) {\n doneSearching = true;\n return wrapDist(room, x, y, tempX, tempY)\n }\n break;\n\n case 3:\n // count number of docks\n if(curTile.dock != null) {\n countUnits++;\n }\n\n // stop loop once we reach terminator\n if(n >= terminator) {\n doneSearching = true;\n return countUnits;\n }\n\n break;\n\n case 4:\n // count number of cities\n if(curTile.city != null) {\n countUnits++;\n }\n\n // stop loop once we reach terminator\n if(n >= terminator) {\n doneSearching = true;\n return countUnits;\n }\n\n break;\n\n case 5:\n // count number of islands (only UNIQUE ones)\n if(curTile.island != null) {\n if(!(curTile.island in uniqueUnits)) {\n countUnits++;\n uniqueUnits.push(curTile.island); \n }\n }\n\n // stop loop once we reach terminator\n if(n >= terminator) {\n doneSearching = true;\n return countUnits;\n }\n\n break;\n\n case 6:\n if(curTile.dock != null) {\n doneSearching = true;\n\n let getObj = room.docks[curTile.dock];\n if(getObj.discovered) {\n return getObj.name;\n } else {\n return \"some undiscovered dock\";\n }\n }\n\n break;\n\n case 7:\n if(curTile.island != null) {\n doneSearching = true;\n\n let getObj = room.islands[curTile.island];\n if(getObj.discovered) {\n return getObj.name;\n } else {\n return \"some undiscovered island\";\n }\n }\n\n break;\n\n case 8:\n if(curTile.city != null) {\n doneSearching = true;\n\n let getObj = room.cities[curTile.city];\n if(getObj.discovered) {\n return getObj.name;\n } else {\n return \"some undiscovered town\";\n }\n }\n\n break;\n }\n \n\n // this code is for switching to the next tile again.\n // this is responsible for rotating to a new segment (and increasing length) once this one's finished\n segPassed++;\n if (segPassed == segLength) {\n // done with current segment\n segPassed = 0;\n\n // 'rotate' directions\n curDir = [-curDir[1], curDir[0]]\n\n // increase segment length if necessary\n if (curDir[1] == 0) {\n segLength++;\n }\n }\n\n // increase number of tiles we've looked at\n n++;\n }\n}", "function getWidth(uses) {\n\treturn 1 + Math.min(Math.round(uses/150), 6);\n}", "function computeWholeDistanceWeighted(pattern1, pattern2, map) {\n\t var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t\t var dist = 0.0;\n\t\t var idx = 0;\n\t\t while(idx < n) {\n\t\t var stroke_idx = k2[map[idx]];\n\t\t\t var start = idx;\n\t\t\t var stop = start+1;\n\t\t\t while(stop<map.length && map[stop] == map[idx]) {\n stop++;\n }\n\t\t\t var stroke_concat = k1[start];\n\t\t\t for(var temp=start+1;temp<stop;temp++) {\n\t\t\t\tstroke_concat = stroke_concat.concat(k1[temp]);\n\t\t\t }\n\t\t\t \n\t\t\t var dist_idx = wholeWholeDistance(stroke_idx, stroke_concat);\n\t\t\t if(stop > start + 1) {\n\t\t\t // concatenated stroke, adjust weight\n\t\t\t\tvar mm = stroke_idx.length;\n\t\t\t\tvar nn = stroke_concat.length;\n\t\t\t\tif(nn < mm) {\n\t\t\t\t var temp = nn;\n\t\t\t\t nn = mm;\n\t\t\t\t mm = temp;\n\t\t\t\t}\n dist_idx = dist_idx * (nn/mm);\t\t\t\t\n\t\t\t }\n\t\t\t dist += dist_idx;\n\t\t\t idx = stop;\n\t\t }\n\t\t return dist;\n\t}", "get width() { return getTextureDimension(this.unmaskedWidth, this.mask_s); }", "function computeWidth (wrapPixels, wrapCount, widthFactor) {\n return wrapPixels || ((0.5 + wrapCount) * widthFactor);\n}", "function computeWidth (wrapPixels, wrapCount, widthFactor) {\n\t return wrapPixels || ((0.5 + wrapCount) * widthFactor);\n\t}", "function countCoordinate (val){\n return (val * side ) + (side / 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\r\n return Math.sqrt(beakWidth * beakWidth * 2);\r\n}", "function findPerimeter(length, width) {\n\tvar p = 2 * length + 2 * width\n return p\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n}", "calculateNumberHorizonSlices(stops) {\n let sum = 1;\n for(let i = 2; i <= stops; i++) {\n sum += i;\n }\n return sum;\n }", "function scorePattern(point, ratios, matrix) {\n try {\n var horizontalRun = countBlackWhiteRun(point, { x: -1, y: point.y }, matrix, ratios.length);\n var verticalRun = countBlackWhiteRun(point, { x: point.x, y: -1 }, matrix, ratios.length);\n var topLeftPoint = {\n x: Math.max(0, point.x - point.y) - 1,\n y: Math.max(0, point.y - point.x) - 1,\n };\n var topLeftBottomRightRun = countBlackWhiteRun(point, topLeftPoint, matrix, ratios.length);\n var bottomLeftPoint = {\n x: Math.min(matrix.width, point.x + point.y) + 1,\n y: Math.min(matrix.height, point.y + point.x) + 1,\n };\n var bottomLeftTopRightRun = countBlackWhiteRun(point, bottomLeftPoint, matrix, ratios.length);\n var horzError = scoreBlackWhiteRun(horizontalRun, ratios);\n var vertError = scoreBlackWhiteRun(verticalRun, ratios);\n var diagDownError = scoreBlackWhiteRun(topLeftBottomRightRun, ratios);\n var diagUpError = scoreBlackWhiteRun(bottomLeftTopRightRun, ratios);\n var ratioError = Math.sqrt(horzError.error * horzError.error +\n vertError.error * vertError.error +\n diagDownError.error * diagDownError.error +\n diagUpError.error * diagUpError.error);\n var avgSize = (horzError.averageSize + vertError.averageSize + diagDownError.averageSize + diagUpError.averageSize) / 4;\n var sizeError = (Math.pow((horzError.averageSize - avgSize), 2) +\n Math.pow((vertError.averageSize - avgSize), 2) +\n Math.pow((diagDownError.averageSize - avgSize), 2) +\n Math.pow((diagUpError.averageSize - avgSize), 2)) / avgSize;\n return ratioError + sizeError;\n }\n catch (_a) {\n return Infinity;\n }\n}", "step() {\n const backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n const currentBuffer = this.buffer[this.currentBufferIndex];\n const backBuffer = this.buffer[backBufferIndex];\n\n const countNeighbors = (x, y, options={border: 'wrap'}) => {\n let neighborCount = 0;\n\n // Actually count living neighbors\n if (options.border === 'wrap') {\n let north = y - 1;\n let south = y + 1;\n let west = x - 1;\n let east = x + 1;\n\n if (north < 0) north = this.height - 1;\n\n if (south > this.height - 1) south = 0;\n\n if (west < 0) west = this.width - 1;\n\n if (east > this.width - 1) east = 0;\n\n neighborCount = \n currentBuffer[north][west] + \n currentBuffer[north][x] + \n currentBuffer[north][east] + \n currentBuffer[y][west] + \n currentBuffer[y][east] + \n currentBuffer[south][x] + \n currentBuffer[south][east] + \n currentBuffer[south][west];\n\n } else if (options.border === 'nowrap') {\n // Treat out of bounds as zero\n for (let yOffset = -1; yOffset <= 1; yOffset++) {\n let yPos = y + yOffset;\n if (yPos < 0 || yPos >= this.height) continue; // Out of bounds\n\n for (let xOffset = -1; xOffset <= 1; xOffset++) {\n let xPos = x + xOffset;\n if (xPos < 0 || xPos >= this.width) continue; // Out of bounds\n if (yPos === y && xPos === x) continue; // Can't be your own neighbor\n neighborCount += currentBuffer[yPos][xPos];\n }\n }\n } else {\n throw new Error('Unknown border option: ' + options.border);\n }\n return neighborCount;\n }\n\n // Update backBuffer to have the next time state\n for(let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const neighbors = countNeighbors(x, y);\n const thisCell = currentBuffer[y][x];\n\n // Implement GoL rules\n if (thisCell) {\n //Current cell is alive\n if (neighbors < 2 || neighbors > 3) {\n // Death\n backBuffer[y][x] = 0;\n } else {\n // Alive\n backBuffer[y][x] = 1;\n }\n } else {\n // Current cell is dead\n if (neighbors === 3) {\n // A cell is born\n backBuffer[y][x] = 1;\n } else {\n // Still dead\n backBuffer[y][x] = 0;\n }\n }\n }\n }\n\n this.currentBufferIndex = backBufferIndex;\n }", "function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;\n var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension: dimension, moduleSize: moduleSize };\n}", "function _scanWinSizeB(side) {\r\n var x, y, count;\r\n var startX, startY;\r\n // scan the left-bottom half until y == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (y = GRID_SIZE - WIN_SIZE; y >= 0; --y) {\r\n x = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q < GRID_SIZE; ++p, ++q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p; // we can reuse x BTW\r\n startY = q;\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n \r\n // scan the right-bottom half until x == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (x = 1; x < GRID_SIZE-(WIN_SIZE-1); ++x) {\r\n y = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q < GRID_SIZE; ++p, ++q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p;\r\n startY = q; // we can reuse y BTW\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "function evaluate_corners () {\r\n\tfor (a = 0; a < 2; a++) {\r\n\t\tif (start[a] < end[a]) {\r\n\t\t\ttop_left[a] = start[a];\r\n\t\t\tbottom_right[a] = end[a];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttop_left[a] = end[a];\r\n\t\t\tbottom_right[a] = start[a];\r\n\t\t}\r\n\t}\r\n\trwidth = bottom_right[0] - top_left[0];\r\n\trheight = bottom_right[1] - top_left[1];\r\n\t// set text\r\n\ttlc.innerHTML = \"Top Left: [\" + top_left[0] + \",\" + top_left[1] + \"]\";\r\n\tbrc.innerHTML = \"Bottom Right: [\" + bottom_right[0] + \",\" + bottom_right[1] + \"]\";\r\n}", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "function findPerimeter(height, width) {\n return (height + width) * 2\n}", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n }", "function _calculateActualBeakWidthInPixels(beakWidth) {\n return Math.sqrt(beakWidth * beakWidth * 2);\n }", "function distanceNextFrame(a, b) {\r\n return Math.sqrt((a.x + a.dx - b.x - b.dx)**2 + (a.y + a.dy - b.y - b.dy)**2) - a.radius - b.radius;\r\n}", "function findCord(x, y) \n{\n\tif (0<= x && x <= 1/3*width) {\n\t\tcord = 0;\n\t}\n\telse if (1/3*width<= x && x <= 2/3*width) \n\t{\n\t\tcord = 1;\n\t}\n\telse if (2/3*width<= x && x <= 3*width) \n\t{\n\t\tcord = 2;\n\t}\n\t\n\treturn cord;\n}", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "get Width() { return this.x2 - this.x1; }", "get Width() { return this.x2 - this.x1; }", "findPerimeter(input){\n\t\tvar height = input.length;\n\t\tvar width = input[0].length;\n\n\t\t//Print the board\n\t\t\t\t//Print the neighbors count array\n\t\t\t\tfor(var heightIndex = 0; heightIndex < height; heightIndex++){\n\t\t\t\t\tvar rowString = \" \";\n\t\t\t\t\tfor(var widthIndex=0; widthIndex < width; widthIndex++){\n\t\t\t\t\t\trowString += input[heightIndex][widthIndex] + \" \";\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(rowString);\n\t\t\t\t}\n\n\t\t\t\tconsole.log();\n\n\n\t\t//Initialize an array that will be the sum of the number of land boxes around it.\n\t\tvar numNeighbors = new Array(height+2).fill(0).map(() => new Array(width+2).fill(0));\n\t\tvar foundLocations = new Array();\n\t\t\n\n\t\tfor(var heightIndex = 0; heightIndex < height; heightIndex++){\n\t\t\tvar numNeighborsHeightIndex =heightIndex+1;\n\t\t\tfor(var widthIndex=0; widthIndex < width; widthIndex++){\n\t\t\t\tvar numNeighborsWidthIndex = widthIndex + 1; //We need to use this math so that we don't go out of bounds\n\n\t\t\t\t//If I'm a 1 or greater, add 1 to the 4 boxes around me\n\t\t\t\tif(input[heightIndex][widthIndex] === 1){\n\t\t\t\t\t//First mark this location as a found location\n\t\t\t\t\tfoundLocations.push([heightIndex, widthIndex]);\n\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex+1][numNeighborsWidthIndex] = numNeighbors[numNeighborsHeightIndex+1][numNeighborsWidthIndex] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex-1][numNeighborsWidthIndex] = numNeighbors[numNeighborsHeightIndex-1][numNeighborsWidthIndex] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex+1] = numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex+1] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex-1] = numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex-1] + 1;\n\t\t\t\t}\n\n\t\t\t\t//console.log(heightIndex + \",\"+ widthIndex + \" = \" + input[heightIndex][widthIndex] + \" \");\n\t\t\t}\n\t\t\t//console.log(\"\");\n\t\t}\n\n\t\t//Print the neighbors count array\n\t\tfor(var numNeighborsHeightIndex = 0; numNeighborsHeightIndex < height+2; numNeighborsHeightIndex++){\n\t\t\tvar rowString = \"\";\n\t\t\tfor(var numNeighborsWidthIndex=0; numNeighborsWidthIndex < width+2; numNeighborsWidthIndex++){\n\t\t\t\trowString += numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex] + \" \";\n\t\t\t}\n\t\t\tconsole.log(rowString);\n\t\t}\n\n\t\tif(foundLocations.length ===1){\n\t\t\tconsole.log(\"Perimeter = 4\");\n\t\t}else{\n\n\t\t\tvar perimeter = 0;\n\n\t\t\tfoundLocations.forEach(function(location){\n\t\t\t\tlet x = location[0];\n\t\t\t\tlet y= location[1];\n\t\t\t\tlet value = numNeighbors[x+1][y+1];\n\t\t\t\tswitch(value){\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tperimeter += 3;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tperimeter += 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 3: \n\t\t\t\t\t\tperimeter += 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\n\t\n\t\n\t\n\t\t\t//Now run through the array and add up the number of neighbors and apply the math.\n\t\t\t// var perimeter = 0;\n\t\t\t// for(var numNeighborsHeightIndex = 1; numNeighborsHeightIndex < height+1; numNeighborsHeightIndex++){\n\t\t\t// \tfor(var numNeighborsWidthIndex=1; numNeighborsWidthIndex < width+1; numNeighborsWidthIndex++){\n\t\t\t// \t\tswitch(numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex]){\n\t\t\t// \t\t\tcase 1:\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 3;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t\tcase 2:\n\t\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 2;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t\tcase 3: \n\t\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 1;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tdefault:\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// }\n\t\n\t\t\tconsole.log(\"Perimeter is: \" + perimeter);\n\t\t}\n\t}", "function foldTo(distance) {\n if (distance < 0) return null;\n let numFolds = 0;\n let thickness = 0.0001;\n while (thickness < distance) {\n numFolds++;\n thickness *= 2;\n }\n return numFolds;\n}", "function _scanWinSizeS(side) {\r\n var x, y, count;\r\n var startX, startY;\r\n // scan the left-top half until y == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (y = WIN_SIZE-1; y < GRID_SIZE; ++y) {\r\n x = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q >= 0; ++p, --q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p; // we can reuse x BTW\r\n startY = q;\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n \r\n // scan the right-bottom half until x == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (x = 1; x < GRID_SIZE-(WIN_SIZE-1); ++x) {\r\n y = GRID_SIZE-1;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q >= 0; ++p, --q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p;\r\n startY = q; // we can reuse y BTW\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "countPixelsWithColor(idx){\n let n = 0;\n let pixCount = this.pattern.width == 32 ? 1024 : 4096;\n for (let i = 0; i < pixCount; ++i){\n if (this.pixels[i] == idx){++n;}\n }\n return n;\n }", "function len (p1, p2) {\n return Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y))\n }", "scanEdges(fromPosition, halfWidth, scanDirection) {\n let from1 = fromPosition.clone()\n from1.x -= halfWidth\n let from2 = fromPosition.clone()\n from2.x += halfWidth\n let interDown = this.getIntersections(from1, scanDirection.clone())\n let interDown2 = this.getIntersections(from2, scanDirection.clone())\n return interDown.concat(interDown2)\n }", "function width_at_depth (points, percent_depth){\n var lowest = 1000000;\n var highest = -1000000;\n for (var i = 0; i < points.length; i++){\n if (points[i][1] < lowest){\n lowest = points[i][1];\n }\n if (points[i][1] > highest){\n highest = points[i][1];\n }\n }\n var pair1 = [];\n var pair2 = []; // defines the line segments that intersect with y = -max_depth/2\n var target_y = highest - (Math.abs(highest-lowest)*percent_depth);\n console.log(target_y);\n for (var i = 0; i < points.length; i++){\n if (i === 0){\n // if on the first point, compare with the last point\n if (((points[points.length-1][1]-target_y) * (points[0][1]-target_y)) <= 0){\n // if the differences between the y-coordinates and half of max_depth have opposite signs\n if (pair1.length === 0) {\n pair1 = [points[0], points[points.length - 1]];\n } else{\n pair2 = [points[0], points[points.length - 1]];\n }\n }\n } else {\n if (((points[i-1][1]-target_y) * (points[i][1]-target_y)) <= 0){\n if (pair1.length === 0) {\n pair1 = [points[i-1], points[i]];\n } else{\n pair2 = [points[i-1], points[i]];\n }\n }\n }\n }\n // find x-coordinates of intersections\n var slope1 = (pair1[1][1]-pair1[0][1]) / (pair1[1][0]-pair1[0][0]);\n var slope2 = (pair2[1][1]-pair2[0][1]) / (pair2[1][0]-pair2[0][0]);\n var intersection1 = (target_y-pair1[0][1]) / slope1 + pair1[0][0];\n var intersection2 = (target_y-pair2[0][1]) / slope2 + pair2[0][0];\n return Math.abs(intersection1-intersection2);\n}", "function calcSegmentIntersectionStripeCount2(arcs) {\n var segs = arcs.getFilteredPointCount() - arcs.size();\n var stripes = Math.pow(segs, 0.4) * 2;\n return Math.ceil(stripes) || 1;\n }", "function countWayTab(width, height) {\n\n // const widthOfArry = Array(width + 1).fill(0);\n // const _2dArry = [];\n // for(let i = 0; i < (height + 1); i++) {\n // _2dArry[i] = widthOfArry;\n // }\n const _2dArry = [];\n for(let i = 0; i < height+1; i++){\n _2dArry.push(Array(width+1));\n for(let j = 0; j < width+1; j++) {\n if(i===1 && j===1) {\n _2dArry[i][j] = 1;\n continue;\n }\n _2dArry[i][j] = 0;\n }\n }\n \n for(let i = 0; i < _2dArry.length; i++) {\n for(let j = 0; j < _2dArry[i].length; j++) {\n if(_2dArry[i][j + 1] !== undefined) _2dArry[i][j + 1] += _2dArry[i][j];\n if(_2dArry[i + 1] !== undefined) _2dArry[i + 1][j] += _2dArry[i][j];\n }\n }\n\n return _2dArry[height][width];\n}", "function bresenhamCircle(x1, y1, r) {\n var canvas = document.getElementById(\"canvas2\");\n var context = canvas.getContext(\"2d\");\n x = r;\n y = 0;\n rError = 1 - x;\n for (; x >= y;) {\n draw(context, colorFigure, x + x1, y + y1);\n draw(context, colorFigure, y + x1, x + y1);\n draw(context, colorFigure, -x + x1, y + y1);\n draw(context, colorFigure, -y + x1, x + y1);\n draw(context, colorFigure, -x + x1, -y + y1);\n draw(context, colorFigure, -y + x1, -x + y1);\n draw(context, colorFigure, x + x1, -y + y1);\n draw(context, colorFigure, y + x1, -x + y1);\n y++;\n if (rError < 0) {\n rError += 2 * y + 1;\n } else {\n x--;\n rError += 2 * (y - x + 1);\n }\n }\n}", "function ccw(a, b, c) {\n\t\t\treturn (points[b].x-points[a].x)*(points[c].y-points[a].y) -\n\t\t\t (points[b].y-points[a].y)*(points[c].x-points[a].x);\n\t\t}", "_findSquares(tunnelDirection) {\n let x, y\n const result = []\n if (tunnelDirection === 'NORTH') {\n for (({ x } = this), end = (this.x+this.tunnelWidth)-1, asc = this.x <= end; asc ? x <= end : x >= end; asc ? x++ : x--) {\n var asc, end\n result.push({ x, y: this.y-1, width: 1, height: 1 }) }\n } else if (tunnelDirection === 'SOUTH') {\n for (({ x } = this), end1 = (this.x+this.tunnelWidth)-1, asc1 = this.x <= end1; asc1 ? x <= end1 : x >= end1; asc1 ? x++ : x--) { var asc1, end1;\n result.push({ x, y: this.y+this.height, width: 1, height: 1 }) }\n } else if (tunnelDirection === 'EAST') {\n for (({ y } = this), end2 = (this.y+this.tunnelWidth)-1, asc2 = this.y <= end2; asc2 ? y <= end2 : y >= end2; asc2 ? y++ : y--) { var asc2, end2;\n result.push({x: this.x+this.width, y, width: 1, height: 1 }) }\n } else {\n for (({ y } = this), end3 = (this.y+this.tunnelWidth)-1, asc3 = this.y <= end3; asc3 ? y <= end3 : y >= end3; asc3 ? y++ : y--) { var asc3, end3;\n result.push({x: this.x-1, y, width: 1, height: 1 }) }\n }\n return result\n }", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "function getsnakelength() {\r\n var length = 0;\r\n for (var i = 0; i < this.snake.length; i++) {\r\n var cur = this.snake[i];\r\n var next = this.snake[(i + 1) % this.snake.length];\r\n length += distance(cur, next);\r\n }\r\n return length;\r\n }", "check(x, y, board = this.map) {\n let color = board[y][x];\n if (color === \"⚪\") return 1;\n //horizontal\n if (\n this.search(x, y, color, 1, 0, 0) +\n this.search(x, y, color, -1, 0, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, 1, 1, 0) +\n this.search(x, y, color, -1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, -1, 1, 0) +\n this.search(x, y, color, 1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //vertical\n if (\n this.search(x, y, color, 0, 1, 0) +\n this.search(x, y, color, 0, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n\n // check how many pieces in a column\n let countstack = 0;\n for (let i = 0; i < 7; i++) {\n if (this.stack[i] === -1) {\n countstack++;\n }\n }\n\n // a column is full\n if (countstack === 7) return 3;\n\n return 1;\n }", "function CalcWidth() {\n let a = gridSpacing * gridSpacing; // hypotenuse c^2\n let c = sqrt(a / 2);\n console.log(c);\n return c;\n}", "function getSurroundingXCount(x, y, type){\n\t\tvar count =0;\n\t\t\tfor(var i =x-1; i <= x+1 ; i++){\n\t\t\t\tfor(var j = y-1; j<= y+1; j++){\n\t\t\t\t\tif( i >= 0 && i < tileWidth && j >= 0 && j < tileHeight){\n\t\t\t\t\t\tif( i != x || j != y){\n\t\t\t\t\t\t\tif(tiles[i][j] == type){\n\t\t\t\t\t\t\t\tcount ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn count;\n}", "function countNeighbors(x, y){\n\t\n\t// Init counter with value = 0\n\tvar counter = 0;\n\t\n\t// Get the left coordinate modulo size\n\tminX = (x > 0) ? (x - 1) : (size - 1);\n\t\n\t// Get the top coordinate modulo size\n\tminY = (y > 0) ? (y - 1) : (size - 1);\n\t\n\t// Get the right coordinate modulo size\n\tmaxX = (x < size - 2) ? (x + 1) : 0;\n\t\n\t// Get the bottom coordinate modulo size\n\tmaxY = (y < size - 2) ? (y + 1) : 0;\n\t\n\t// Check if left top neighbor is alive\n\tif(field[minX][minY].status === 'alive'){\n\t\tcounter++;\n\t}\n\t\n\t// Check if left neighbor is alive\n\tif(field[minX][y].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if left right neighbor is alive\n\tif(field[minX][maxY].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if top neighbor is alive\n\tif(field[x][minY].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if bottom neighbor is alive\n\tif(field[x][maxY].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if right top neighbor is alive\n\tif(field[maxX][minY].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if right neighbor is alive\n\tif(field[maxX][y].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Check if right bottom neighbor is alive\n\tif(field[maxX][maxY].status === 'alive'){\n\t\t\n\t\t// Increase Counter\n\t\tcounter++;\n\t}\n\t\n\t// Return number of counter\n\treturn counter;\n}", "get unmaskedWidth() { return calcTileDimension(this.lrs, this.uls); }", "_angleToWidth(angle, radius) {\n return 2 * radius * Math.sin(angle * Math.PI / 360.0);\n }", "function checkForBorder(oneRunner) {\n\n var thereWasBorderHit = false;\n\n var borderHitX = false;\n var borderHitY = false;\n\n // X\n if ((oneRunner.runnerX + oneRunner.runnerMotion.motionX - oneRunner.runnerRadius) < 0) {\n\n // Change X direction\n oneRunner.runnerMotion.motionX *= -1;\n\n oneRunner.runnerX = oneRunner.runnerRadius;\n\n thereWasBorderHit = true;\n\n borderHitX = true;\n }\n else if ((oneRunner.runnerX + oneRunner.runnerMotion.motionX + oneRunner.runnerRadius) > animGS.cnvWidth) {\n // Change X direction\n oneRunner.runnerMotion.motionX *= -1;\n\n oneRunner.runnerX = animGS.cnvWidth - oneRunner.runnerRadius;\n\n thereWasBorderHit = true;\n\n borderHitX = true;\n }\n\n // Y\n if ((oneRunner.runnerY + oneRunner.runnerMotion.motionY - oneRunner.runnerRadius) < 0) {\n\n // Change Y direction\n oneRunner.runnerMotion.motionY *= -1;\n\n oneRunner.runnerY = oneRunner.runnerRadius;\n\n thereWasBorderHit = true;\n\n borderHitY = true;\n }\n else if ((oneRunner.runnerY + oneRunner.runnerMotion.motionY + oneRunner.runnerRadius) > animGS.cnvHeight) {\n // Change Y direction\n oneRunner.runnerMotion.motionY *= -1;\n\n oneRunner.runnerY = animGS.cnvHeight - oneRunner.runnerRadius;\n\n thereWasBorderHit = true;\n\n borderHitY = true;\n }\n\n if (borderHitX === true) {\n // Y correction\n\n oneRunner.runnerY += oneRunner.runnerMotion.motionY;\n }\n\n if (borderHitY === true) {\n // X correction\n\n oneRunner.runnerX += oneRunner.runnerMotion.motionX;\n }\n\n return thereWasBorderHit;\n }", "function buildPatternBase(width, pixelSize, roughness) {\n\n\t\t// have to create a 2D array in order to more easily manipulate shapes\n\t\tfunction create2dArray(w,h) { \n\t\t\tvar newArray = new Array(w);\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tnewArray[i] = new Array(h); \n\t\t\t}\n\n\t\t\tfor (i=0; i<w; i++) {\n\t\t\t\tfor (j=0; j<h; j++) {\n\t\t\t\t\tnewArray[i][j] = 0; // set all initial values to 0.\n\t\t\t\t}\t\t\t\t\t\t// these will get assigned random values.\n\t\t\t}\n\n\t\t\treturn newArray;\n\t\t}\n\n\n\t\t// start by seeding first corners\n\t\tfunction startDisplacement(map, width) {\n\t\t\tvar topRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center;\n\n\t\t\tmap[0][0] = Math.random();\n\t\t\ttopLeft = map[0][0];\n\n\t\t\tmap[0][width] = Math.random();\n\t\t\tbottomLeft = map[0][width];\n\n\t\t\tmap[width][0] = Math.random();\n\t\t\ttopRight = map[width][0];\n\n\t\t\tmap[width][width] = Math.random();\n\t\t\tbottomRight = map[width][width];\n\n\t\t\tmap[width / 2][width / 2] = topLeft + bottomLeft + topRight + bottomRight; \n\t\t\tmap[width / 2][width / 2] = normalize(map[width / 2][width / 2]);\n\t\t\tcenter = map[width / 2][width / 2];\n\t\t\t\n\n\t\t\tmap[width / 2][width] = bottomLeft + bottomRight + center / 4;\n\t\t\tmap[width / 2][0] = topLeft + topRight + center / 4;\n\t\t\tmap[width][width / 2] = topRight + bottomRight + center / 4;\n\t\t\tmap[0][width / 2] = topLeft + bottomLeft + center / 4;\n\n\n\t\t\t// if (wrapping === false) {\n\t\t\t// // non wrapping\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center / 3;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center / 3;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center / 3;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center / 3;\n\t\t\t// }\n\n\t\t\t// else {\n\t\t\t// // wrapping\t\n\t\t\t// \tmap[width / 2][width] = bottomLeft + bottomRight + center + center / 4;\n\t\t\t// \tmap[width / 2][0] = topLeft + topRight + center + center / 4;\n\t\t\t// \tmap[width][width / 2] = topRight + bottomRight + center + center / 4;\n\t\t\t// \tmap[0][width / 2] = topLeft + bottomLeft + center + center / 4;\n\t\t\t// }\n\n\t\t\tcenterDisplacement(width);\n\t\t}\n\n\t\tfunction centerDisplacement(d) {\n\t\t\tvar newD = d / 2,\n\t\t\t\ttopRight, topLeft, top, bottomRight, bottomLeft, bottom, \n\t\t\t\tright, left, center, i, j;\n\n\t\t\tif (newD > pixelSize) {\n\t\t\t\tfor (i = newD; i <= width; i += newD) {\n\t\t\t\t\tfor (j = newD; j <= width; j+= newD) {\n\t\t\t\t\t\tx = i - (newD / 2);\n\t\t\t\t\t\ty = j - (newD / 2);\n\n\t\t\t\t\t\t// corners \n\t\t\t\t\t\ttopLeft = map[i - newD][j - newD];\n\t\t\t\t\t\ttopRight = map[i][j - newD];\n\t\t\t\t\t\tbottomLeft = map[i - newD][j];\n\t\t\t\t\t\tbottomRight = map[i][j];\n\n\t\t\t\t\t\t// center\n\t\t\t\t\t\tmap[x][y] = (topLeft + topRight + bottomLeft + bottomRight) / 4 + displace(d);\n\t\t\t\t\t\tmap[x][y] = normalize(map[x][y]);\n\t\t\t\t\t\tcenter = map[x][y];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// top\n\t\t\t\t\t\tif (j - (newD * 2) + (newD / 2) > 0) {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center + map[x][j - d + (newD / 2)]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmap[x][j - newD] = (topLeft + topRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j - newD] = normalize(map[x][j - newD]);\n\n\t\t\t\t\t\t// Bottom\n\t\t\t\t\t\tif (j + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center + map[x][j + (newD / 2)]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[x][j] = (bottomLeft + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[x][j] = normalize(map[x][j]);\n\n\n\t\t\t\t\t\t//Right\n\t\t\t\t\t\tif (i + (newD / 2) < width){\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center + map[i + (newD / 2)][y]) / 4+ displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i][y] = (topRight + bottomRight + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i][y] = normalize(map[i][y]);\n\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif (i - (newD * 2) + (newD / 2) > 0){\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center + map[i - d + (newD / 2)][y]) / 4 + displace(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmap[i - newD][y] = (topLeft + bottomLeft + center) / 3+ displace(d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap[i - newD][y] = normalize(map[i - newD][y]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcenterDisplacement(newD);\n\t\t\t}\n\t\t}\n\n\t\tfunction normalize(x) { // required in the event a center value exceeds 1\n\t\t\tif (x > 1) {\n\t\t\t\tx = 1;\n\t\t\t}\n\t\t\telse if (x < 0) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t\treturn x;\n\t\t}\n\n\t\t// generates a random value to offset center for subsequent iterations\n\t\tfunction displace(num){\n\t\t\tvar max = num / (width + width) * roughness;\n\t\t\treturn (Math.random(1.0)- 0.5) * max;\n\t\t}\n\n\t\tvar map = create2dArray(width + 1, width + 1);\n\t\tstartDisplacement(map,width);\n\t\treturn map;\n\t}", "function posCalc(){\n var width = document.innerWidth;\n var colLength = width/3;\n }", "function forFold(distance) {\n if(distance < 0)\n return null;\n let currThickness = .0001;\n for(var folds = 0; currThickness < distance; folds++) {\n currThickness *= 2;\n }\n return folds;\n }", "function drawLeftRight(left, n) {\n\t \t\tif(left) {\n\t \t\t\t\tvar a = [(main.segments[0].point.x + main.segments[3].point.x)/2, (main.segments[0].point.y + main.segments[3].point.y)/2]\n\t \t\t\t//console.log(a);\n\t \t\t\tvar b = [(main.segments[4].point.x + main.segments[5].point.x)/2, (main.segments[4].point.y + main.segments[5].point.y)/2];\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\tvar a = [(main.segments[0].point.x + main.segments[3].point.x)/2, (main.segments[0].point.y + main.segments[3].point.y)/2]\n\t \t\t\t//console.log(a);\n\t \t\t\tvar b = [(main.segments[1].point.x + main.segments[2].point.x)/2, (main.segments[1].point.y + main.segments[2].point.y)/2];\n\t \t\t\t}\n\n\t \t\tvar x = a[0]-b[0];\n\t \t\tvar y = a[1]-b[1];\n\t \t\tvar dist = Math.sqrt(x*x + y*y);\n\t \t\t// depending on the number of figures\n\t \t\tvar step = dist/(n+1);\n\t \t\tfor (var i = 1; i <= n; i++) {\n\t \t\t\tvar new_x = a[0]-((step*i)*(a[0]-b[0]))/dist;\n\t \t\t\tvar new_y = a[1]-((step*i)*(a[1]-b[1]))/dist;\n\t \t\t\tvar new_coord = [new_x, new_y];\n\t \t\t\tvar raster = getFigur(fig);\n\t \t\t\traster.bounds.x = 0;\n\t\t \t\traster.bounds.y = 0;\n\t\t \t\traster.bounds.width = max*0.4;\n\t\t \t\traster.bounds.height = max*0.4;\n\t\t \t\traster.position = new paper.Point(new_x, new_y);\n\n\t\t \t\tgroup.addChild(raster);\n\t \t\t}\n\t \t}", "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n \n var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n \n // Iterate over all pixels\n for(var i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n \n return Math.round((count / total) * 100);\n }", "function lineBresenham(x1, y1, x2, y2){\n let dx, dy;\n let stepX, stepY;\n \n dx = x2 - x1;\n dy = y2 - y1;\n\n if (dy < 0) {\n dy = -dy;\n stepY = -totPixel;\n } else {\n stepY = totPixel;\n }\n if (dx < 0) {\n dx = -dx;\n stepX = -totPixel;\n } else {\n stepX = totPixel;\n }\n /* 2dy, 2dx */\n dy << 1;\n dx << 1;\n\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n /* slope between 1 and -1, greater than 1, less than -1 */\n if (dx > dy) {\n let fraction = dy - (dx >> 1);\n while(x1 < x2){\n x1 += stepX;\n if (fraction >= 0) {\n y1 += stepY;\n fraction -= dx;\n }\n fraction += dy;\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n }\n } else if (y1 > y2) {\n let fraction = dx - (dy >> 1);\n while(y1 > y2){\n if(fraction >= 0){\n x1 += stepX;\n fraction -= dy;\n }\n y1 += stepY;\n fraction += dx;\n if((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)){\n setPixel(x1, y1);\n }\n }\n } else {\n let fraction = dx - (dy >> 1);\n while(y1 < y2){\n if (fraction >= 0) {\n x1 += stepX;\n fraction -= dy;\n }\n y1 += stepY;\n fraction += dx;\n if ((0 <= x1) && (x1 < width) && (0 <= y1) && (y1 < height)) {\n setPixel(x1, y1);\n }\n }\n }\n}", "function getCapturesInDirection(pieces, startRow, startCol, dirX, dirY) {\n\tvar r = startRow;\n\tvar c = startCol;\n\n\t// only need to check the first 3 spaces away from the starting point\n\tfor (var i = 1; i <= 3; i++) {\n\t\tr += dirX;\n\t\tc += dirY;\n\n\t\t// pattern for the first 3 spaces away is (opponent, opponent, me)\n\t\t\n\t\t// first and second space\n\t\tif ((i <= 2) && !(pieceIsOpponents(r, c, pieces)))\n\t\t\treturn 0;\n\n\t\t// third space\n\t\tif (i == 3 && !pieceIsMine(r, c, pieces))\n\t\t\treturn 0;\n\t}\n\n\treturn 1;\n}", "function getHorizontalSmushLength(txt1, txt2, opts) {\n if (opts.fittingRules.hLayout === FULL_WIDTH) {return 0;}\n var ii, len1 = txt1.length, len2 = txt2.length;\n var maxDist = len1;\n var curDist = 1;\n var breakAfter = false;\n var validSmush = false;\n var seg1, seg2, ch1, ch2;\n if (len1 === 0) {return 0;}\n\n distCal: while (curDist <= maxDist) {\n seg1 = txt1.substr(len1-curDist,curDist);\n seg2 = txt2.substr(0,Math.min(curDist,len2));\n for (ii = 0; ii < Math.min(curDist,len2); ii++) {\n ch1 = seg1.substr(ii,1);\n ch2 = seg2.substr(ii,1);\n if (ch1 !== \" \" && ch2 !== \" \" ) {\n if (opts.fittingRules.hLayout === FITTING) {\n curDist = curDist - 1;\n break distCal;\n } else if (opts.fittingRules.hLayout === SMUSHING) {\n if (ch1 === opts.hardBlank || ch2 === opts.hardBlank) {\n curDist = curDist - 1; // universal smushing does not smush hardblanks\n }\n break distCal;\n } else {\n breakAfter = true; // we know we need to break, but we need to check if our smushing rules will allow us to smush the overlapped characters\n validSmush = false; // the below checks will let us know if we can smush these characters\n\n validSmush = (opts.fittingRules.hRule1) ? hRule1_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n validSmush = (!validSmush && opts.fittingRules.hRule2) ? hRule2_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n validSmush = (!validSmush && opts.fittingRules.hRule3) ? hRule3_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n validSmush = (!validSmush && opts.fittingRules.hRule4) ? hRule4_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n validSmush = (!validSmush && opts.fittingRules.hRule5) ? hRule5_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n validSmush = (!validSmush && opts.fittingRules.hRule6) ? hRule6_Smush(ch1,ch2,opts.hardBlank) : validSmush;\n\n if (!validSmush) {\n curDist = curDist - 1;\n break distCal;\n }\n }\n }\n }\n if (breakAfter) {break;}\n curDist++;\n }\n return Math.min(maxDist,curDist);\n }", "getLiveNeighborCount(h, w) {\n const currentCells = this.cells[this.activeBuffer];\n let c = 0;\n\n if (currentCells[h - 1] && currentCells[h - 1][w - 1]) ++c;\n if (currentCells[h - 1] && currentCells[h - 1][w - 0]) ++c;\n if (currentCells[h - 1] && currentCells[h - 1][w + 1]) ++c;\n\n if (currentCells[h - 0] && currentCells[h + 0][w - 1]) ++c;\n if (currentCells[h - 0] && currentCells[h + 0][w + 1]) ++c;\n\n if (currentCells[h + 1] && currentCells[h + 1][w - 1]) ++c;\n if (currentCells[h + 1] && currentCells[h + 1][w - 0]) ++c;\n if (currentCells[h + 1] && currentCells[h + 1][w + 1]) ++c;\n\n return c;\n }", "function sumBoard (line, origin) {\n var ridersCount = line.reduce(function(sum, x) {\n if (x.origin == origin) {\n return sum + x.riders;\n }\n return sum;\n }, 1);\n return ridersCount;\n }", "function sumBoard (line, origin) {\n var ridersCount = line.reduce(function(sum, x) {\n if (x.origin == origin) {\n return sum + x.riders;\n }\n return sum;\n }, 1);\n return ridersCount;\n }", "calculateAtDesiredPos() {\n let counter = 0;\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n if (this.isAtDesiredPos([i, j], this.board[i][j])) counter++;\n }\n }\n return counter;\n }", "function distanceBetween(p1, p2){\n var a = Math.abs(p1.x-p2.x)%size.width;\n var b = Math.abs(p1.y-p2.y);\n a = Math.min(a, size.width-a);\n return Math.sqrt(Math.pow(a,2)+Math.pow(b,2));\n }", "function computeDimension(topLeft, topRight, bottomLeft, moduleSize) {\r\n\t\t var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize);\r\n\t\t var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize);\r\n\t\t var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\r\n\t\t switch (dimension & 0x03) {\r\n\t\t // mod 4\r\n\t\t case 0:\r\n\t\t dimension++;\r\n\t\t break;\r\n\t\t // 1? do nothing\r\n\t\t case 2:\r\n\t\t dimension--;\r\n\t\t break;\r\n\t\t }\r\n\t\t return dimension;\r\n\t\t}", "getKingZone([x, y], color) {\n if (color == 'w') {\n if (y >= 4) return -1; //\"out of zone\"\n if (y == 3 && [5, 6].includes(x)) return 0;\n if (x == 6) return 1;\n if (x == 5) return 2;\n if (x == 4) return 3;\n if (x == 3 || y == 0) return 4;\n if (y == 1) return 5;\n if (x == 0 || y == 2) return 6;\n return 7; //x == 1 && y == 3\n }\n // color == 'b':\n if (y <= 2) return -1; //\"out of zone\"\n if (y == 3 && [0, 1].includes(x)) return 0;\n if (x == 0) return 1;\n if (x == 1) return 2;\n if (x == 2) return 3;\n if (x == 3 || y == 6) return 4;\n if (y == 5) return 5;\n if (x == 6 || y == 4) return 6;\n return 7; //x == 5 && y == 3\n }", "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n \n var pixels = ctx17.getImageData(0, 0, canvasWidth17, canvasHeight17),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n \n // Iterate over all pixels\n for(var i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n \n return Math.round((count / total) * 100);\n }", "function Themes_GetWhiteBorderThickness(interfaceLook)\n{\n\t//for now we hardcode this\n\treturn 1;\n}", "function rightBorderCollision(x, y, r, canvasWidth, bottomJaw, topJaw, ctx, colour)\n{\n //If pacmans x co-ordinate plus radius equals the width(right side)\n if((x + r) >= canvasWidth)\n {\n //just draw pacman and return x, dont increment it\n ctx.beginPath();\n ctx.arc(x, y, r, bottomJaw * Math.PI, 1.25 * Math.PI);\n ctx.fillStyle = colour;\n ctx.fill();\n ctx.beginPath();\n ctx.arc(x, y, r, 0.75 * Math.PI, topJaw * Math.PI);\n ctx.fill();\n ctx.beginPath();\n return x;\n }\n else //otherwise\n {\n //draw pacman, increment x, and return it.\n ctx.beginPath();\n ctx.arc(x, y, r, bottomJaw * Math.PI, 1.25 * Math.PI);\n ctx.fillStyle = colour; \n ctx.fill();\n ctx.beginPath();\n ctx.arc(x, y, r, 0.75 * Math.PI, topJaw * Math.PI);\n ctx.fill();\n ctx.beginPath(); \n x += 7;\n return x;\n }\n}", "function count_color(current_coordinate, desired_color, desired_direction, current_count) {\n\t\t\t\tlet next_coordinate = [current_coordinate[0] + desired_direction[0],\n\t\t\t\tcurrent_coordinate[1] + desired_direction[1]];\n\t\t\t\tconsole.log(next_coordinate);\n\t\t\t\tif (piece_position[next_coordinate[0]] && piece_position[next_coordinate[0]][next_coordinate[1]]) {\n\t\t\t\t\tif (piece_position[next_coordinate[0]][next_coordinate[1]].color != desired_color)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\tcurrent_count += 1;\n\t\t\t\t\tif (current_count == 3)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\treturn count_color(next_coordinate, desired_color, desired_direction, current_count);\n\t\t\t\t}\n\t\t\t\treturn current_count;\n\t\t\t}", "function calcGreenDistance(px){\n var red = px.getRed();\n var green = px.getGreen();\n var blue = px.getBlue();\n var redDiff = 0 - red;\n var greenDiff = 255 - green;\n var blueDiff = 0 - blue;\n var greenDistance = Math.sqrt(redDiff * redDiff + greenDiff * greenDiff + blueDiff * blueDiff);\n return greenDistance;\n}", "isPercolated () {\n var topPercolateIndex = this.size\n var bottomPercolateIndex = this.size + 1\n\n var topPercolateArranges = this.grid.slice(0, 1)[0]\n .map((value, x) =>\n value && [topPercolateIndex, this.width * x]\n ).filter(v => v)\n\n var bottomPercolateArranges = this.grid.slice(-1)[0]\n .map((value, x) =>\n value && [bottomPercolateIndex, (this.grid.length-1) * this.width + x]\n ).filter(v => v)\n\n // console.log('topPercolateArranges', topPercolateArranges);\n // console.log('bottomPercolateArranges', bottomPercolateArranges);\n\n // padds arranges like this: double means has arrange (e.g. \\\\)\n //\n // top_percolate (pad)\n // // | \\\\\n // X - X\n // X X X\n // - X X\n // \\ || //\n // bottom_percolate (pad)\n\n var paddedArranges = [\n ...topPercolateArranges,\n ...this.arranges,\n ...bottomPercolateArranges,\n ]\n\n // find if topPercolate is connected to bottomPercolate, which are appeneded at the end, hence we pass {n} as `this.size + 2`\n return (new UnionFind.QuickFind(\n this.size + 2,\n paddedArranges\n )).find(topPercolateIndex, bottomPercolateIndex)\n }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n \n var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n \n // Iterate over all pixels\n for(var i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n \n return Math.round((count / total) * 100);\n}", "function getOddWidth(yMax){\n return 1 + 2 * yMax; // central cell + 2 * (number of rows above 0)\n }", "neighborCount(mtx, x, y) {\n var count = 0;\n for (var i = -1 ; i <= 1 ; i++) {\n for (var j = -1 ; j <= 1 ; j++) {\n if ((0 < (x+i)) && ((x+i) < this.width)\n && (0 < (y+j)) && ((y+j) < this.height)) {\n if (0 != mtx[y+j][x+i]) {\n count += 1;\n }\n }\n }\n }\n if (0 < count) {\n console.log(\"neighborCount(\", x, y, \") = \", count);\n }\n return count;\n }", "function whileFold(distance) {\n if(distance < 0)\n return null;\n let currThick = .0001;\n let times = 0;\n while(currThick < distance) {\n currThick *= 2;\n times++;\n }\n return times;\n }", "calculateRadius() {\r\n let radius = 50;\r\n if (this.progressWidth || this.backgroundWidth) {\r\n const maxVal = (this.progressWidth > this.backgroundWidth) ? this.progressWidth : this.backgroundWidth;\r\n radius = radius - (maxVal / 2);\r\n }\r\n else {\r\n radius = radius - 2;\r\n }\r\n return radius;\r\n }", "function getOffsets(size) {\n //THIS FUNCTION IS SO UGLY IM SO SORRY\n let wO = (size * 1.732050808 / 2);\n let hO = size;\n let ans = [];\n\n let startingY = 50 - 2 * (hO * .75);\n let startingX = 50 - wO;\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 - 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50;\n startingX = 50 - wO * (2);\n\n for (let i = 0; i < 5; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n\n\n startingY = 50 + 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 + 2 * (hO * .75);\n startingX = 50 - wO;\n\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n return ans;\n}", "function getPerimeter(length, width) {\n // Write your code here\n return 2 * (length + width);\n}", "function determineRr (loadedDataset){\n\t\t//Determines hexagon radius 'r' from min distance of neighbours\n\t\tvar borders = [];\n\t\tvar hexes = loadedDataset.conceptsData;\n\t\t//Find distance between immediate neighbours\n\t\tvar d2 = 0, dMin2 = 100000000000000000000000000000;\n\t\tfor (var n =0; n < hexes.length; n++){\n\t\t\tfor (var m =n+1; m < hexes.length; m++){\n\t\t\t\tvar dx = hexes[n].hexCoordinates.x -hexes[m].hexCoordinates.x;\n\t\t\t\tvar dy = hexes[n].hexCoordinates.y -hexes[m].hexCoordinates.y;\n\t\t\t\td2 = dx*dx + dy*dy;\n\t\t\t\tif (d2 < dMin2) dMin2 = d2;\n\t\t\t}\n\t\t}\n\t\treturn Math.sqrt(dMin2)/2;\n\t}", "calculateWidth (testWidth, imgData, isMapTest = false) {\n let keyArray = Object.keys(imgData),\n lowerLimit = 0, upperLimit = 0, delta = 0;\n\n if (!isMapTest && this.isRetinaDisplay) { testWidth *= 2; }\n if (this.lowerThreshold !== 0) { testWidth += testWidth * this.lowerThreshold; }\n\n upperLimit = keyArray.findIndex((element, index, array) =>\n (testWidth < element || index === array.length - 1) ? true : false\n );\n\n lowerLimit = (upperLimit === 0) ? 0 : upperLimit - 1;\n\n return (+keyArray[lowerLimit] === testWidth) ? keyArray[lowerLimit] : keyArray[upperLimit];\n }", "function cohenSutherlandClip(x1, y1, x2, y2,color){\n //calcular regiões P1, P2\n let dots = [];\n let code1 = computeCode(x1, y1);\n let code2 = computeCode(x2, y2);\n let accept = false;\n\n while(true){\n if((code1 == 0) && (code2 == 0)){\n accept = true;\n break;\n }\n else if(code1 & code2){\n break;\n }\n else {\n //Linha precisa de recorte\n //Pelo menos um dos pontos está fora\n let x, y, code_out;\n\n if (code1 != 0)\n code_out = code1;\n else\n code_out = code2;\n\n if (code_out & TOP) {\n x = x1 + (x2 - x1) * (y_max - y1) / (y2 - y1);\n y = y_max;\n } else if (code_out & BOTTOM) {\n x = x1 + (x2 - x1) * (y_min - y1) / (y2 - y1);\n y = y_min;\n } else if (code_out & RIGHT) {\n y = y1 + (y2 - y1) * (x_max - x1) / (x2 - x1);\n x = x_max;\n } else if (code_out & LEFT) {\n y = y1 + (y2 - y1) * (x_min - x1) / (x2 - x1);\n x = x_min;\n }\n\n if (code_out == code1) {\n x1 = x;\n y1 = y;\n code1 = computeCode(x1, y1);\n } else {\n x2 = x;\n y2 = y;\n code2 = computeCode(x2, y2);\n }\n }\n }\n console.log(accept);\n if (accept){\n desenha_linha(Math.round(x1), Math.round(y1),Math.round(x2),Math.round(y2),'black');\n\n return dots;\n\n }\n else{\n console.log('Line rejected');\n }\n\n}", "function CentreVideo() {\n //console.log(\"R = \" + (image.data[3 * (image.width / 2) + 3 * (image.height / 2) * image.width]));\n //console.log(\"G = \" + (image.data[3 * (image.width / 2) + 1 + 3 * (image.height / 2) * image.width]));\n //console.log(\"B = \" + (image.data[3 * (image.width / 2) + 2 + 3 * (image.height / 2) * image.width]));\n\n for (var i = 3 * (image.width / 2); i < 5 * (image.width / 2); i += 4) {\n for (var j = 3 * (image.height / 2) * image.width; j < 5 * (image.height / 2) * image.width; j += 4 * image.width) {\n nbPoints++;\n var red = image.data[i + j];\n var green = image.data[i + j + 1];\n var blue = image.data[i + j + 2];\n\n if (red > 192 && green < 128 && blue < 128) {\n nbRedPoints++;\n }\n\n image.data[i + j] = 255;\n image.data[i + j + 1] = 0;\n image.data[i + j + 2] = 0;\n }\n }\n }" ]
[ "0.649426", "0.62279093", "0.5698632", "0.5365985", "0.527906", "0.527906", "0.52629113", "0.5153313", "0.5132754", "0.51157504", "0.50945956", "0.50812924", "0.5035681", "0.5011034", "0.50109863", "0.49814257", "0.49036807", "0.48977312", "0.48894203", "0.4883083", "0.48747456", "0.48580042", "0.48532024", "0.4840074", "0.48193565", "0.4816365", "0.48098698", "0.48098698", "0.48098698", "0.48098698", "0.48098698", "0.48085395", "0.4796353", "0.47948343", "0.47870454", "0.47663572", "0.47596866", "0.47595543", "0.47591826", "0.4755989", "0.4755989", "0.47519726", "0.4741984", "0.4740253", "0.47305834", "0.47305834", "0.472869", "0.4727406", "0.47175726", "0.47116223", "0.47016618", "0.469074", "0.4680151", "0.4662621", "0.46603614", "0.4651371", "0.4647606", "0.46458167", "0.46429995", "0.46317524", "0.4620888", "0.4619243", "0.4617416", "0.4605697", "0.4597787", "0.45971668", "0.45785236", "0.4574622", "0.45680106", "0.4561498", "0.45480043", "0.45452064", "0.4539181", "0.45380682", "0.45373586", "0.451714", "0.4516524", "0.4516524", "0.45128214", "0.450603", "0.45032135", "0.45016426", "0.45010322", "0.44944784", "0.44829667", "0.44793278", "0.44779745", "0.44756657", "0.4474526", "0.44724935", "0.44674012", "0.44626224", "0.44616255", "0.44599771", "0.44577843", "0.44540432", "0.4453789", "0.44517216", "0.44492495", "0.44472668" ]
0.6303991
1
Computes an average estimated module size based on estimated derived from the positions of the three finder patterns.
function calculateModuleSize(topLeft, topRight, bottomLeft, image) { return (calculateModuleSizeOneWay(topLeft, topRight, image) + calculateModuleSizeOneWay(topLeft, bottomLeft, image)) / 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeDimension(topLeft, topRight, bottomLeft, moduleSize) {\r\n\t\t var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize);\r\n\t\t var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize);\r\n\t\t var dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;\r\n\t\t switch (dimension & 0x03) {\r\n\t\t // mod 4\r\n\t\t case 0:\r\n\t\t dimension++;\r\n\t\t break;\r\n\t\t // 1? do nothing\r\n\t\t case 2:\r\n\t\t dimension--;\r\n\t\t break;\r\n\t\t }\r\n\t\t return dimension;\r\n\t\t}", "function calculateAverage() {\r\n var sum = 0;\r\n for (var i = 0; i < arguments.length; i++) {\r\n sum += arguments[i];\r\n }\r\n return sum / 4;\r\n }", "function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;\n var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension: dimension, moduleSize: moduleSize };\n}", "average() {\n return this.buffer.reduce((accum, current) => accum + current) / this.size;\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function calculateSizes () {\n // Figure out the parent size minus padding.\n var a = elements[this.a].element;\n var b = elements[this.b].element;\n\n this.size = a[getBoundingClientRect]()[dimension] + b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize;\n this.start = a[getBoundingClientRect]()[position];\n }", "function getInnerPctCalcFunction(arcs, shapes) {\n var calcSegLen = arcs.isPlanar() ? geom.distance2D : geom.greatCircleDistance;\n var arcIndex = new ArcTopologyIndex(arcs, shapes);\n var outerLen, innerLen, arcLen; // temp variables\n\n return function(shp) {\n outerLen = 0;\n innerLen = 0;\n if (shp) shp.forEach(procRing);\n return innerLen > 0 ? innerLen / (innerLen + outerLen) : 0;\n };\n\n function procRing(ids) {\n ids.forEach(procArc);\n }\n\n function procArc(id) {\n arcLen = 0;\n arcs.forEachArcSegment(id, addSegLen);\n if (arcIndex.isInnerArc(id)) {\n innerLen += arcLen;\n } else {\n outerLen += arcLen;\n }\n }\n\n function addSegLen(i, j, xx, yy) {\n arcLen += calcSegLen(xx[i], yy[i], xx[j], yy[j]);\n }\n }", "function _calc() {\n var winW = $w.width() < $t.width() ? $t.width() : $w.width();\n var realW = winW - 2 * cfg.navWidth - cfg.perNumber;\n var itemW = Math.floor(realW / cfg.perNumber);\n return itemW;\n }", "get avgOrderDims(){\n var output = { tW: 0, tL: 0, tH: 0, avgW: 0, avgL: 0, avgH: 0, tO: 0 };\n for(var index in this.orders){\n output.tH += (this.orders[index].height * this.orders[index].quantity);\n output.tW += (this.orders[index].width * this.orders[index].quantity);\n output.tL += (this.orders[index].length * this.orders[index].quantity);\n output.tO += this.orders[index].quantity;\n }\n output.avgH = output.tH / output.tO;\n output.avgW = output.tW / output.tO;\n output.avgL = output.tL / output.tO;\n return output;\n }", "averageSatisfactionDegree() {\n\t\tlet ave = 0;\n\t\tfor (const c of this._cons) {\n\t\t\tave += c.satisfactionDegree();\n\t\t}\n\t\tave = ave / this._cons.length;\n\t\treturn ave;\n\t}", "function averageFinder2(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n return Math.ceil(sum / arr.length); \n }", "function calcMean1(cb){\n\tvar sumRep=0;\n\tvar numRep =0;\n\tvar lenRep =0;\n\tvar rep=[];\n\tfor(var i=0; i<NUM_VERSIONS; i++){\n\t\t\n\t\tfor(var j=0; j<NUM_PLATFORMS; j++){\n\t\t\t\n\t\t\tvar arr = data[versions[i]][j][KEY_REVIEWER_RANKING_LIST];\n\t\t\tvar s =0;\n\t\t\tvar n =0;\n\t\t\t//console.log(arr[0] + arr[1]);\n\t\t\tconsole.log(typeof data[versions[i]][j][KEY_REVIEWER_RANKING_LIST][0]);\n\t\t\tfor(var k=0; k<data[versions[i]][j][KEY_REVIEWER_RANKING_LIST].length; k++){\n\t\t\t\tif(arr[k]!=0){\n\t\t\t\t\ts = s + data[versions[i]][j][KEY_REVIEWER_RANKING_LIST][k];\n\t\t\t\t\tn ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsumRep +=s;\n\t\t\tnumRep +=n;\n\t\t\tlenRep += arr.length;\n\t\t\tconsole.log(\"version is \" + i + \" platform is \" + j);\n\n\t\t\tconsole.log(\"s is \" + s);\n\t\t\tconsole.log(\"n is \" + n);\n\t\t\tconsole.log(\"sum is \"+ sumRep);\n\t\t\tconsole.log(\"num is \"+ numRep);\n\t\t\tconsole.log(\"len is \"+ lenRep);\t\t\t\t\t\t\n\n\t\t\t\t\n\t\t\t\n\t\t}\n\t\n\t}\n\t\n\t// have an input variable that chooses between these methods\n\tvar meanRep = sumRep/numRep;\n\tconsole.log(meanRep);\n\n\tvar mean_len = sumRep/lenRep;\n\tconsole.log(mean_len);\n\n\tcalcDeviation(cb);\n\n}", "function get4Rmean() {\n var total = 0;\n for (var i = 0; i < R_buffer.length; i++) {\n total += R_buffer[i];\n }\n var avg = total / R_buffer.length;\n return avg;\n }", "function averageFinder(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n average = (sum / arr.length);\n return average; \n }", "function sizesSum() {\n\t\t\t\t\tif (o.advanced.updateOnSelectorChange === true) {\n\t\t\t\t\t\to.advanced.updateOnSelectorChange = \"*\";\n\t\t\t\t\t}\n\t\t\t\t\tvar total = 0,\n\t\t\t\t\t sel = mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\t\tif (o.advanced.updateOnSelectorChange && sel.length > 0) {\n\t\t\t\t\t\tsel.each(function () {\n\t\t\t\t\t\t\ttotal += this.offsetHeight + this.offsetWidth;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn total;\n\t\t\t\t}", "calculateAverageGlobalRank() {\n let totalGlobalRank = 0;\n this.genomes.forEach(function (genome) {\n totalGlobalRank += genome.globalRank;\n });\n\n this.averageGlobalRank = totalGlobalRank / this.genomes.length;\n }", "findAverageMass(humans) {\n const _humans = Object.keys(humans);\n let _total = 0;\n for(let human of _humans){\n if(humans[human].mass !== 'unknown') _total += parseInt(humans[human].mass);\n }\n return Math.floor(_total / _humans.length)\n }", "function calc_step_size(a,b) {\n\t\t return (a - b) / steps_total;\n\t\t}", "function calc_step_size(a,b) {\r\n return (a - b) / steps_total;\r\n}", "function getAvgSegment(arcs) {\n var sum = 0;\n var count = arcs.forEachSegment(function(i, j, xx, yy) {\n var dx = xx[i] - xx[j],\n dy = yy[i] - yy[j];\n sum += Math.sqrt(dx * dx + dy * dy);\n });\n return sum / count || 0;\n }", "getAverageM3() {\n\t var days = this.getDays();\n\t var m3 = this.getM3();\n\n\t var averageM3 = days > 0 ? m3/days : m3;\n\n\t return Math.round(averageM3 * 100) / 100;\n\t}", "function calc_step_size(a, b) {\r\n return (a - b) / steps_total;\r\n}", "avg() {\n\t\tlet argArr = this.args;\n\t\tfunction avgSet(s,c,f) {\n\t\t\taverage: s;\n\t\t\tceiling: c;\n\t\t\tfloor: f;\n\t\t}\n\t\tlet evaluate = function() {\n\t\t\tlet sum = 0;\n\t\t\tfor(let c=0;c<argArr.length;c++) {\n\t\t\t\tsum += argArr[c];\n\t\t\t}\n\t\t\tsum /= argArr.length\n\t\t\tlet ceil = Math.ceil(sum)\n\t\t\tlet floor = Math.floor(sum)\n\n\t\t\tlet avg = avgSet(sum,ceil,floor); //{average:sum,ceiling:ceil,floor:floor}\n\t\t\treturn avg;\n\t\t};\n\t\t// console.log(evaluate())\n\t\tthis.record(`Evaluated avg: ${evaluate().average} | fxnCount: ${this.fxnCount} | avgCount: ${this.avgCount}`,evaluate());\n\t}", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=$(this).height()+$(this).width();});}\n\t\t\t\treturn total;\n\t\t\t}", "function calculateSizes () {\n console.log('calculateSizes');\n\n updateName(['_yyparse.s', fs.readFileSync('build/s/_yyparse.s', { encoding: 'utf8' })]);\n\n execSync(\n 'cat ./updateSpinner.s ./build/s/_yyparse.s > ./build/g/_yyparse.s;' +\n 'cl65 -T -t c64 ' +\n '-o ./build/obj2/yyparse.bin ' +\n '-Ln ./build/obj2/yyparse.lbl ' +\n '-C ./yyparse.cfg ./build/g/_yyparse.s'\n );\n\n passPostfix = 'a';\n\n const yyparseSize = Math.max(0x2000, fs.statSync('build/obj2/yyparse.bin').size);\n\n const yyparseStart = 0xC000 - yyparseSize;\n\n const dataSize = fs.statSync('build/data.bin').size;\n\n const dataStart = yyparseStart - dataSize;\n\n const libcSize = fs.statSync('build/libcdata.bin').size;\n\n const libcStart = dataStart - libcSize;\n\n const floatlibSize = fs.statSync('build/floatlibdata.bin').size;\n\n const floatlibStart = libcStart - floatlibSize;\n\n const mainSize = fs.statSync('build/maindata.bin').size;\n\n const mainStart = floatlibStart - mainSize;\n\n const heapSize = mainStart - 0x0800;\n\n remainder -= (yyparseSize + dataSize + libcSize + floatlibSize + mainSize);\n\n execSync(\n \"sed 's/ROMH: file = %O, start = $8000, size = $4000/\" +\n 'ROMH: file = %O, start = $' +\n (yyparseStart.toString(16).toUpperCase()) +\n ', size = $' +\n (yyparseSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' yyparse.cfg > build/yyparsea.cfg\"\n );\n\n execSync(\n \"sed 's/data2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'data2.bin\\\\\", start = $' +\n (dataStart.toString(16).toUpperCase()) +\n ', size = $' +\n (dataSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' data.cfg > build/dataa.cfg\"\n );\n\n execSync(\n \"sed 's/floatlibdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'floatlibdata2.bin\\\\\", start = $' +\n (floatlibStart.toString(16).toUpperCase()) +\n ', size = $' +\n (floatlibSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' floatlib.cfg > build/floatliba.cfg\"\n );\n\n execSync(\n \"sed 's/libcdata2.bin\\\\\\\", start = $0800, size = $9800/\" +\n 'libcdata2.bin\\\\\", start = $' +\n (libcStart.toString(16).toUpperCase()) +\n ', size = $' +\n (libcSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' libc.cfg > build/libca.cfg\"\n );\n\n execSync(\n \"sed 's/RAM2: file = \\\\\\\"\\\\\\\", start = $0800, size = $9800/\" +\n 'RAM2: file = \\\\\"\\\\\", start = $' +\n (mainStart.toString(16).toUpperCase()) +\n ', size = $' +\n (mainSize.toString(16).toUpperCase()) +\n '/g;' +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' main.cfg > build/maina.cfg\"\n );\n\n execSync(\n \"sed '\" +\n 's/RAM: file = \"\", start = $0800, size = $9800/' +\n 'RAM: file = \"\", start = $0800, size = $' +\n (heapSize.toString(16).toUpperCase()) + '/g;' +\n \"' page.cfg > build/pagea.cfg\"\n );\n\n compileFloatLib();\n}", "function calculateArea(width, heigth, depth) {\n\tvar area = width * heigth;\n\tvar volume = width * heigth * depth;\n\tvar sizes = [area, volume];\n\treturn sizes;\n}", "function calculateDotRarity() {\n for (i = 0; i < tilesList.length; i++) {\n if (tilesList[i].mat == 6) {\n tilesList[i].dotRarity = 0\n }\n else {\n tilesList[i].dotRarity = tilesList[i].dot / getTotalDots(tilesList[i].mat)\n }\n }\n}", "function average(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n var addedNum = 0;\r\n var averageNum;\r\n\r\n // .. do something with each element of args\r\n args.forEach(function(value, idx, list) {\r\n addedNum += value;\r\n\r\n if (idx === (list.length - 1)) {\r\n averageNum = addedNum / (list.length);\r\n }\r\n });\r\n\r\n return averageNum;\r\n\r\n}", "function computeAvgRatings (ratings) {\n const avgRating = ratings.reduce((acc, rating) => {\n return acc + (rating.stars / ratings.length);\n }, 0);\n return Math.round(avgRating);\n}", "function Calculate()\n{\n // do linear interpolations to get calibrated Adam readings\n for (var i=0; i<calibrate.length; ++i) {\n var raw = adamRaw[i];\n for (var j=0, cal=calibrate[i]; ; j+=2) {\n if (j + 4 >= cal.length || cal[j+2] >= raw) {\n adamCal[i] = cal[j+1] + (raw - cal[j]) * (cal[j+3] - cal[j+1]) / (cal[j+2] - cal[j]);\n break;\n }\n }\n }\n\n // total force in kg due to air pressure difference\n var f = (adamCal[6] - kAirPressureNom) * kBellowArea / (100 * kGravity);\n\n for (var i=0; i<3; ++i) {\n damperPosition[i] = adamCal[i];\n stagePosition[i] = adamCal[i+3];\n // calculate load on this damper\n damperLoad[i] = kLoadNom + (stagePosition[i] - damperPosition[i]) * kDamperForceConst;\n // calculate fraction of the force felt by this damper\n // (the pulse tube is offset toward damper 0)\n var frac = (1 + (i ? -1 : 2) * kBellowPos / kDamperPos) / 3;\n // nominal load on the damper for this pressure\n var loadNom = kLoadNom - f * frac;\n // this is how much weight we need to add to achieve the nominal load\n damperAddWeight[i] = loadNom - damperLoad[i];\n }\n}", "getPixelPerMeter() {\n\t\tlet ppm = new vec2(this.#_fusion.targetOutSize.x/this.#_augmentaScene.scene.x,this.#_fusion.targetOutSize.y/this.#_augmentaScene.scene.y);\n\t\treturn ppm;\n\t}", "function sizesSum(){\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\r\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=$(this).height()+$(this).width();});}\r\n\t\t\t\treturn total;\r\n\t\t\t}", "function getAvgNum(origVal) {\n //map performs an action on each element of an array, \n //reduce operates on all the elements\n let inchVal = origVal.match(/\\d+(''|\")/g);\n //RegEx: to get feet: digit followed by quote that's not followed by anouther quote\n let footVal = origVal.match(/\\d+'(?!')/g);\n let finalExtracted = [0];\n if (inchVal && footVal){finalExtracted = inchVal.map(x=>parseFloat(x)).concat(footVal.map(x=>parseFloat(x)*12));} \n else if (inchVal) {finalExtracted = inchVal.map(x=>parseFloat(x));}\n else if (footVal) {finalExtracted = footVal.map(x=>parseFloat(x)*12);}\n finalExtracted = finalExtracted.reduce((a,b)=>(a+b))/finalExtracted.length.toString();\n// \tfinalExtracted === 0?finalExtracted=1:finalExtracted; //todo: how to deal with plants without width and height?\n\treturn finalExtracted;\n}", "function avg(d, u, h) {\n return (d + u + h) / 3;\n}", "function averageOf(no1, no2, no3) {\n return (no1 + no2 + no3)/3;\n}", "average() {\n const length = this.length();\n let sum = 0;\n // this.traverse(function (node) {\n // sum += node.value;\n // });\n this.traverse(node => sum += node.value);\n\n return this.isEmpty() ? null : sum / length;\n }", "getDotPatternSize() {\n //const { width } = this.getWindowDimensions();\n return 28; // 28 for all for now\n }", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\treturn total;\n\t\t\t}", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\treturn total;\n\t\t\t}", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\treturn total;\n\t\t\t}", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\treturn total;\n\t\t\t}", "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each((function(){total+=this.offsetHeight+this.offsetWidth;}));}\n\t\t\t\treturn total;\n\t\t\t}", "function ex_3_I(a){\n m = 0;\n for( i = 0; i<a.length; i++){\n m = m + a[i];\n }\nreturn m/a.length;\n}", "function average_mv(mv, i, j, n, k)\n{\n let sum = 0;\n for ( let t = 0; t < n; t++ )\n sum += prev_fwd_mvs[t][i][j][k];\n let val = Math.round(sum / n);\n val = Math.max(val, -64);\n val = Math.min(val, 63);\n return val;\n}", "totalLength(){\n\n let clen = 0;\n let pts;\n\n for(let i = 0; i < this.nCurves; i++){\n let idx = i*2;\n pts = [ p5.Vector.add(this.cpts[idx], this.cpts[idx+1]).mult(0.5),\n this.cpts[idx+1],\n this.cpts[idx+2],\n p5.Vector.add(this.cpts[idx+2], this.cpts[idx+3]).mult(0.5)\n ];\n \n clen += this.segmentLength(pts);\n }\n\n return clen;\n\n }", "function avg( x, size){\r\n//console.log(x[0])\r\nvar sum = 0;\r\nfor(var i=0;i<size;i++){\r\n\tvar t = parseInt(x[i], 10);\r\n sum+=t;\r\n}\r\nvar z = sum/size\r\n//console.log(\"avg : \" + z )\r\nreturn z;\r\n}", "function avgMultipleNumbers(arrayNr) {\n\tvar sum=0;\n\tfor(let i=0; i<arrayNr.length; ++i) {\n\t\tsum=sum+arrayNr[i];\n\t}\n\treturn sum/arrayNr.length;\n}", "fileSize () {\n if (this.isDirectory()) {\n // dirs don't have file size\n return 0\n }\n\n let sum = 0\n this.blockSizes.forEach((size) => {\n sum += size\n })\n\n if (this.data) {\n sum += this.data.length\n }\n\n return sum\n }", "function sizesSum(){\n\t\t\t\t if(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\t var total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\t if(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\t return total;\n\t\t\t }", "function sizesSum(){\n if(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n var total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n if(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n return total;\n }", "function sizesSum(){\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\r\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\r\n\t\t\t\treturn total;\r\n\t\t\t}", "function sizesSum(){\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\r\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\r\n\t\t\t\treturn total;\r\n\t\t\t}", "function sizesSum(){\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\r\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\r\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\r\n\t\t\t\treturn total;\r\n\t\t\t}", "function averageNum(moreNumbers){\r\n return moreNumbers.reduce(function(accumulator, currentValue){\r\n return accumulator + currentValue\r\n})/moreNumbers.length}", "function findAvgWordLength(txt) {\n let words = getWords(txt);\n let count = 0;\n for (let i = 0; i < words.length; i++) {\n \tcount += words[i].length;\n }\n\n return count / words.length;\n}", "calcExtraParams () {}", "function findAvg(mat) {\n var sumMat = 0;\n for (var i = 0; i < mat.length; i++) {\n // var sumRow = 0;\n var row = mat[i];\n for (var j = 0; j < row.length; j++) {\n sumMat += row[j] \n }\n // sumMat += sumRow\n }\n var n = (mat.length)*(mat.length) ;\n console.log(sumMat/n)\n}", "function sizesSum(){\r\n if(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\r\n var total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\r\n if(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\r\n return total;\r\n }", "average() {\n if (this.length)\n return this.reduce((accumulator, value) => accumulator + value, 0) / this.length;\n else\n return 0;\n }", "function calculateAvgBpm(bpms) {\n\t\tvar bpmSum = 0;\n\t\tfor (var i=0; i<bpms.length; i++) {\n\t\t\tbpmSum += bpms[i];\n\t\t}\n\t\treturn bpmSum / bpms.length;\n\t}", "getAverageRating() {\n let ratingsSum = this.ratings.reduce((currentSum, rating) => currentSum + rating, 0);\n const lengthOfArray = this._ratings.length;\n return ratingsSum/lengthOfArray;\n }", "getDataSize () {\n let size = 0\n\n for (let n=0; n<this.neurons.length; n++) {\n size += this.neurons[n].weights.length + 1\n }\n\n return size\n }", "function m10(pattern) {\n\t\tvar sum = 0;\n\t\tfor(var i=0;i<pattern.length;i++) {\n\t\t var stroke_i = pattern[i];\n\t\t\tfor(var j=0;j<stroke_i.length;j++) {\n\t\t\t\tsum += stroke_i[j][0];\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn sum;\n\t}", "function calcSize(points) {\n\t var area = 0,\n\t dist = 0;\n\t\n\t for (var i = 0, a, b; i < points.length - 1; i++) {\n\t a = b || points[i];\n\t b = points[i + 1];\n\t\n\t area += a[0] * b[1] - b[0] * a[1];\n\t\n\t // use Manhattan distance instead of Euclidian one to avoid expensive square root computation\n\t dist += Math.abs(b[0] - a[0]) + Math.abs(b[1] - a[1]);\n\t }\n\t points.area = Math.abs(area / 2);\n\t points.dist = dist;\n\t}", "getAverageFitness() {\n return this.#fitsum / popsize;\n }", "function averageResults(algorithmType){\n var count;\n var elecUsageList = tempResultsLine[0][0]; //Retrieves the data stored temporatily in a global variable\n var overLimitList = tempResultsLine[0][1];\n var iterations = tempResultsLine.length;\n for (count = 1; count < iterations; count++){\n var listCount;\n for (listCount = 0; listCount < 48; listCount++){ //48 as only periods 12-60 count\n elecUsageList[listCount] += tempResultsLine[count][0][listCount]; //sums all the values for each time period\n overLimitList[listCount] += tempResultsLine[count][1][listCount];\n }\n }\n elecUsageList = elecUsageList.map(function(x){ //finds mean by dividing the sums by the number of elements\n return x / iterations;\n });\n overLimitList = overLimitList.map(function(x){\n return x / iterations;\n });\n\n var avgSuccess = 0;\n var avgPartial = 0;\n var avgUnsuccess = 0;\n var avgFail = 0;\n\n //As previous, sums the results and divides to find mean.\n for (count = 0; count < iterations; count++){\n avgSuccess += tempResultsPie[count][0];\n avgPartial += tempResultsPie[count][1];\n avgUnsuccess += tempResultsPie[count][2];\n avgFail += tempResultsPie[count][3];\n }\n avgSuccess = avgSuccess / iterations;\n avgPartial = avgPartial / iterations;\n avgUnsuccess = avgUnsuccess / iterations;\n avgFail = avgFail / iterations;\n\n //sum is used to convert the 4 sections into percentages.\n var sum = (avgSuccess+avgPartial+avgUnsuccess+avgFail)/100;\n\n\n var avgLineResult =[elecUsageList, overLimitList];\n var avgPieResult = [Math.round(avgSuccess/sum), Math.round(avgPartial/sum), Math.round(avgUnsuccess/sum), Math.round(avgFail/sum)];\n\n resultsLine[algorithmType] = avgLineResult;\n resultsPie[algorithmType] = avgPieResult;\n}", "function avgRating(resService, resClean, resQual) {\n let resServicetoNum = convertToNumber(resService)\n let resCleantoNum = convertToNumber(resClean)\n let resQualtoNum = convertToNumber(resQual)\n return Math.floor((resServicetoNum + resCleantoNum + resQualtoNum) / 3);\n}", "function getXAverage() {\n let sum = 0;\n for (let i = 0; i < blueSquares.length; i++) {\n sum += blueSquares[i].centerOfSquare.x;\n }\n return (sum / blueSquares.length);\n }", "function size() {\n out = 1;\n for (var dim in dimensions) {\n out *= dimensions[dim].members.length;\n }\n return out;\n }", "function avg(arr) {\n return arr.reduce((a,b) => +a + +b) / arr.length;\n }", "function average(a, b, c) {\n\nreturn (a + b + c) / 3;\n\n}", "function totalOptions(x, y, z, w) {\n let result = 0;\n\n const start = Date.now();\n\n let xCount, yCount, zCount;\n for(xCount = 0; xCount <= w; xCount += x) {\n // console.log(\"for 1: xCount=\" + xCount);\n for(yCount = 0; yCount <= w - xCount; yCount += y) {\n // console.log(\"----for 2: yCount=\" + yCount);\n for(zCount = 0; zCount <= w - yCount - xCount; zCount += z) {\n // console.log(\"--------for 3: zCount=\" + zCount);\n if(xCount + yCount + zCount === w) {\n // console.log(\"xCount:\",xCount, \"+\",\"yCount:\",yCount,\"+\",\"zCount\",zCount);\n result++;\n } \n }\n }\n }\n\n console.log(\"time: \" + (Date.now() - start));\n\n return result;\n}", "function calculate() {\n\t\t// 'this' is the jQuery object for the container.\n\t\tmaxitemwidth = this.width()/settings['width-ratio'];\n\t\tmaxitemheight = this.height()/settings['height-ratio'];\n\n\t\tgalleryitemwidth = maxitemwidth;\n\t\tgalleryheight = 0;\n\n\t\tvar length = galleryitems.length;\n\n\t\t// Calculate gallery item width.\n\t\tfor (var i = 0; i < length; i++){\n\t\t\t// Figure out which dimension is going to require the most resizing.\n\t\t\tvar scale = Math.min(maxitemwidth/galleryitems[i].width, maxitemheight/galleryitems[i].height, 1);\n\n\t\t\tgalleryitemwidth = $('body').width();\n\t\t}\n\n\t\t// Identify gallery item height now that we know the gallery item width.\n\t\tfor (var i = 0; i < length; i++){\n\t\t\t// Figure out which dimension is going to require the most resizing.\n\t\t\tvar scale = galleryitemwidth / galleryitems[i].width;\t\t\t\n\n\t\t\tgalleryheight = $('body').height();\n\t\t\tgalleryitems[i].scaledwidth = $('body').width();\n\t\t\tgalleryitems[i].scaledheight = $('body').height();\n\t\t}\n\n\t\t// Now that we know the max height, figure out the transformation origin for each.\n\t\tfor (var i = 0; i < length; i++){\n\t\t\tgalleryitems[i].transformOriginY = galleryitems[i].scaledheight - galleryheight + (settings['transform-origin-ratio'] * galleryheight);\n\t\t}\n\t\t\n\t}", "getAveragePoint(){\n var sumX = 0;\n var sumY = 0;\n var numIncluded =0;\n for(var i = this.hexesInPath.length-1; i>= Math.max(0, this.hexesInPath.length-3);i--){\n sumX+=this.hexesInPath[i].getOffSetPos().x;\n sumY+=this.hexesInPath[i].getOffSetPos().y;\n numIncluded++;\n console.log(this.hexesInPath[i]);\n }\n return {\n x: sumX/numIncluded,\n y: sumY/numIncluded\n };\n }", "function calcSize(points) {\n\t var area = 0,\n\t dist = 0;\n\n\t for (var i = 0, a, b; i < points.length - 1; i++) {\n\t a = b || points[i];\n\t b = points[i + 1];\n\n\t area += a[0] * b[1] - b[0] * a[1];\n\n\t // use Manhattan distance instead of Euclidian one to avoid expensive square root computation\n\t dist += Math.abs(b[0] - a[0]) + Math.abs(b[1] - a[1]);\n\t }\n\t points.area = Math.abs(area / 2);\n\t points.dist = dist;\n\t}", "getLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}", "getLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}", "async calculateTxSize (inputs, outputs, changeAddress, feeRate) {\n const weightTestInput = rpcFormat(inputs, outputs, changeAddress, 0.0005)\n const weightTestRaw = await this.client.createRawTransaction(...weightTestInput)\n const weightTestSigned = await this.client.signRawTransactionWithWallet(weightTestRaw)\n const weightTestTx = await this.client.decodeRawTransaction(weightTestSigned.hex)\n\n const virtualSize = weightTestTx.weight / 4\n return virtualSize\n }", "function calcAve(tips){\n var sum = 0;\n for (var i = 0; i < tips.length; i++){\n sum = sum + tips[i];\n }\n return sum / tips.length;\n}", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "function average() {\n averageHeight = averageHeight / rectNum;\n strokeWeight(3);\n line(0,averageHeight,width,averageHeight);\n}", "function avg(arr) {\n\tlet total = 0;\n\t//loop over each num\n\tfor (let num of arr) {\n\t\t//add them together\n\t\ttotal += num;\n\t}\n\t//divide by number of nums\n\treturn total / arr.length;\n}", "function avgCostPerDesigner(shoes){\n return (shoes.reduce(function(total,item){\n return total += item.price ;\n },0))/shoes.length ;\n}", "function calculateFitnessChrom()\n{\n var gaps = new Array(); // to keep the amount of gaps in the layout\n\n var filledCols= new Array (theLayout.numCols); //to keep how filled is each column\n for (var i = 0 ; i < theLayout.numCols ; i++)\n filledCols[i] = 0;\n\n for ( var i = 0; i < this.adn.length; i++ ) {\n\n // select the column to place the layer. If the layer spans in more than\n // one column, the selected column will be the first column the layers uses\n\n var selCol = 0; // column to allocate the layer\n var selMean = 0; // used capacity mean\n var selStd = 0; // used capacity standard deviation\n for (var k=0 ; k < theLayout.widths[this.adn[i]] ; k++) {\n selMean += filledCols[k];\n }\n selMean /= theLayout.widths[this.adn[i]];\n\n for (var k=0 ; k < theLayout.widths[this.adn[i]] ; k++) {\n selStd += Math.abs(filledCols[k]-selMean);\n }\n selStd /= theLayout.widths[this.adn[i]];\n \n var limit = theLayout.numCols - theLayout.widths[this.adn[i]]+1;\n for ( var j = 1 ; j < limit ; j++) {\n\n var mean = 0;\n var std = 0;\n\n if (theLayout.widths[this.adn[i]] > 1) {\n for (var k=j ; k < j+theLayout.widths[this.adn[i]] ; k++) {\n mean += filledCols[k];\n }\n mean /= theLayout.widths[this.adn[i]];\n\n for (var k=j ; k < j+theLayout.widths[this.adn[i]] ; k++) {\n std += Math.abs(filledCols[k]-mean);\n }\n std /= theLayout.widths[this.adn[i]];\n }\n else {\n mean = filledCols[j];\n }\n\n if (std < selStd || (std == selStd && mean < selMean)) {\n selCol = j;\n selMean = mean;\n selStd = std;\n }\n }\n\n // once the column is chosen, if the layer spans more than one column,\n // the maximum used capacity is used\n var max = filledCols[selCol];\n if (theLayout.widths[this.adn[i]] > 1) {\n for (var k=selCol ; k < selCol+theLayout.widths[this.adn[i]] ; k++) {\n if ( filledCols[k] > filledCols[selCol] ) {\n max = filledCols[k];\n }\n }\n\n // detect gaps\n for (var k=selCol ; k < selCol+theLayout.widths[this.adn[i]] ; k++) {\n if (max > filledCols[k])\n gaps.push (max - filledCols[k]);\n }\n }\n\n // fill the column selected with the height of the layer\n for (var k=selCol ; k < selCol+theLayout.widths[this.adn[i]] ; k++) {\n filledCols[k] = max + $(theLayout.layers[this.adn[i]]).height() +\n theLayout.pixelsGap;\n }\n }\n\n // this part calculates the gaps at the bottom\n var max = filledCols[0];\n for ( var j = 1 ; j < theLayout.numCols ; j++) {\n if (filledCols[j] > max)\n max = filledCols[j];\n }\n\n for ( var j = 0 ; j < theLayout.numCols ; j++) {\n if (filledCols[j] < max)\n gaps.push (max - filledCols[j]);\n }\n\n\n // this part tries to minimize the gaps\n\n // If there were only one gap, the standard deviation would be 0,\n // so I insert a fictitious gap to avoid this problem\n gaps.push (0);\n\n var gapsMean = 0; // gap size mean\n if (gaps.length>0) {\n for (var k=0 ; k < gaps.length ; k++) {\n gapsMean += gaps[k];\n }\n gapsMean /= gaps.length;\n\n }\n\n this.fitness = gapsMean;\n\n return this.fitness;\n}", "function avg() {\n var sum = 0;\n for (var i = 0, j = arguments.length; i < j; i++) {\n sum += arguments[i];\n }\n return sum / arguments.length;\n}", "function avg() {\n var sum = 0;\n for (var i = 0, j = arguments.length; i < j; i++) {\n sum += arguments[i];\n }\n return sum / arguments.length;\n}", "function ex_3_R(a){\n m = 0;\n if ( a.length == 0 ) m = 0;\n else m = (ex_3_R(a.slice(1))*(a.length-1) + a[0])/a.length;\nreturn m;\n}", "getLengths( divisions = this.arcLengthDivisions ) {\n\n\t\t\tif ( this.cacheArcLengths &&\n\t\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t\t! this.needsUpdate ) {\n\n\t\t\t\treturn this.cacheArcLengths;\n\n\t\t\t}\n\n\t\t\tthis.needsUpdate = false;\n\n\t\t\tconst cache = [];\n\t\t\tlet current, last = this.getPoint( 0 );\n\t\t\tlet sum = 0;\n\n\t\t\tcache.push( 0 );\n\n\t\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\t\tsum += current.distanceTo( last );\n\t\t\t\tcache.push( sum );\n\t\t\t\tlast = current;\n\n\t\t\t}\n\n\t\t\tthis.cacheArcLengths = cache;\n\n\t\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t\t}", "function size_of(segments, bindings) {\n var size = 0;\n for (var i=0, len = segments.length; i < len; i++) {\n size += size_of_segment(segments[i], bindings);\n }\n return size;\n}", "findAverage(mat){\n\n var size = [mat.length,mat[0].length];\n var sum = Array.apply(null, Array(size[1])).map(Number.prototype.valueOf,0);\n\n for(var i=0;i<size[0];i++) {\n for(var j=0;j<size[1];j++) {\n sum[j] += parseFloat(mat[i][j]);\n }\n }\n\n sum = sum.map(currentValue => currentValue/size[0]);\n sum = sum.map(currentValue => Math.round(currentValue*100)/100);\n return sum;\n }", "function avg(num1, num2, num3) {\n return (num1 + num2 + num3) / 3; \n}", "function avgWindSp () {\n\tvar array = map(list, function (c) {\n\t\treturn c.wind.speed;\n\t});\n\tvar sum = reduce(array, function (a, b) {\n\t\treturn a + b;\n\t});\n\treturn Math.round(100 * (sum / list.length)) / 100;\n}", "function find_average(array) {\n // your code here\n var sum = 0;\n array.forEach( element => sum += element); \n return sum / array.length;\n}", "function calcAverage(score1, score2, score3) {\n return (score1 + score2 + score3) / 3;\n}", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "function find_avg(arr) {\n\t\tvar sum = 0, avg;\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tsum += arr[i];\n\t\t}\n\t\tavg = sum / arr.length;\n\t\treturn avg;\n\t}", "function computedAvgPriceForEach() {\r\n let sumPrice = 0;\r\n shirts.forEach(val => sumPrice += val.price );\r\n return sumPrice/shirts.length;\r\n}", "function getEffectSizeAmount(effectSizeType, effectSize)\n{\n var interpretations = effectSizeInterpretations[effectSizeType];\n if(effectSize < interpretations[0])\n return 0;\n else if(effectSize >= interpretations[0] && effectSize < interpretations[1])\n return 1;\n else if(effectSize >= interpretations[1] && effectSize < interpretations[2])\n return 2;\n else if(effectSize >= interpretations[2])\n return 3; \n return 99;\n}", "function calculateAveragePrice(flavors) {\n var sum = 0;\n flavors.forEach(function(flavor)\n {\n\t sum+= parseFloat(flavor.price.replace('$', ''));\n });\n return (sum/flavors.length).toFixed(2);\n }", "updateWeights(weights) {\n let numAreas = 0;\n for (let ind = 0; ind < CSRankings.areas.length; ind++) {\n let area = CSRankings.areas[ind];\n weights[area] = $('input[name=' + this.fields[ind] + ']').prop('checked') ? 1 : 0;\n if (weights[area] === 1) {\n if (area in CSRankings.parentMap) {\n // Don't count children.\n continue;\n }\n /* One more area checked. */\n numAreas++;\n }\n }\n return numAreas;\n }" ]
[ "0.57280034", "0.5540435", "0.53792703", "0.52424026", "0.5117586", "0.5117586", "0.5070961", "0.5068654", "0.50404084", "0.49998394", "0.49994612", "0.49917972", "0.4977473", "0.49752748", "0.49266025", "0.4909818", "0.4899954", "0.48816302", "0.48655826", "0.48574534", "0.48550236", "0.4816818", "0.4815315", "0.47645533", "0.47444686", "0.47300515", "0.47290367", "0.4726107", "0.47193512", "0.4712717", "0.47116742", "0.47006786", "0.4684813", "0.46842045", "0.46803534", "0.4674445", "0.467332", "0.46695668", "0.46695668", "0.46695668", "0.46695668", "0.46549934", "0.464668", "0.46379238", "0.46273273", "0.46188766", "0.46158278", "0.4614431", "0.46108347", "0.4610531", "0.46070656", "0.46070656", "0.46070656", "0.46047318", "0.4597953", "0.45954368", "0.45947638", "0.45934442", "0.45922005", "0.4590368", "0.4587583", "0.4578028", "0.45776063", "0.45679173", "0.4559456", "0.45584476", "0.45568478", "0.4555555", "0.4553695", "0.45423216", "0.45406067", "0.45401183", "0.4538243", "0.45342678", "0.45319086", "0.45303136", "0.45303136", "0.45298788", "0.45265555", "0.4522651", "0.45102572", "0.44987127", "0.4496176", "0.44959918", "0.44939113", "0.44939113", "0.44895187", "0.4489376", "0.44870955", "0.44866213", "0.4481441", "0.44813892", "0.44811475", "0.44771862", "0.44763651", "0.4474959", "0.44720453", "0.44719547", "0.44716403", "0.4471509" ]
0.5978173
0
returns true if the proportions of the counts is close enough to the 1/1/1 ratios used by alignment patterns to be considered a match
function foundPatternCross(stateCount, moduleSize) { var maxVariance = moduleSize / 2; for (var i = 0; i < 3; i++) { if (Math.abs(moduleSize - stateCount[i]) >= maxVariance) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCounts(){\n\tfor(cat in landmarks){\n\t\tif(landmarks[cat].length != targetCounts[cat]){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "compareDNA(pAeq2){\n let count = 0;\n dna.forEach((base1, index) => {\n const base2 = pAeq2.dna[index];\n if(base1 == base2){\n count++;\n }\n });\n let percent = (count/(dna.length+pAeq2.dna.length))*100;\n percent = percent.toFixed(2);\n console.log(`specimen #${this.specimenNum} and specimen #${pAeq2.specimenNum} have ${percent}% DNA in common.`)\n }", "compareDNA(pAequor) {\n let similarBases = 0;\n for(let i = 0; i < 15; i++) {\n if(this.dna[i] === pAequor.dna[i]) {\n similarBases++;\n }\n }\n const percentOfSimilarity = (similarBases / 15) * 100;\n console.log(`specimen #${this.specimenNum} and specimen #${pAequor.specimenNum} have ${percentOfSimilarity.toFixed()}% DNA in common.`);\n }", "function percentageLayout() {\n // check subpixel layout supporting\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n wrapper = doc.createElement('div'),\n outer = doc.createElement('div'),\n str = '',\n count = 70,\n perPage = 3,\n supported = false;\n\n wrapper.className = \"tns-t-subp2\";\n outer.className = \"tns-t-ct\";\n\n for (var i = 0; i < count; i++) {\n str += '<div></div>';\n }\n\n outer.innerHTML = str;\n wrapper.appendChild(outer);\n body.appendChild(wrapper);\n\n supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2;\n\n body.fake ? resetFakeBody(body, docOverflow) : wrapper.remove();\n\n return supported;\n}", "compareDna (pAequor) {\n let identicalResults = 0;\n for (let i = 0; i < 15; i++) {\n if (this.dna[i] === pAequor.dna[i]) {\n identicalResults += 1;\n } \n }\n const percentage = identicalResults / this.dna.length * 100;\n console.log(`Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${percentage.toFixed \n (2)}% in common.`);\n }", "compareDNA(obj) { \n //identical variable is the number of duplicates per index of both this.dna and obj.dna arrays\n let identical = 0\n this.dna.forEach( (element, index) => element === obj.dna[index] ? identical++ : identical += 0)\n\n //percentage variable, of course finds the percentage of duplicates both arrays\n let percentage = Math.floor(identical / this.dna.length * 100)\n\n return `specimen #1 and specimen #2 have ${percentage}% DNA in common.`\n }", "willLikelySurvive() {\n let returnPercentage = 0;\n this.dna.forEach(item => item === 'C' || item === 'G' ? returnPercentage += 1/this.dna.length : '');\n return returnPercentage >= .6 ? true : false;\n }", "willLikelySurvive() {\n let NumOfCs = 0;\n let NumOfGs = 0;\n\n this.dna.forEach(base => {\n if(base === 'C') {\n NumOfCs++;\n } else if(base === 'G') {\n NumOfGs++;\n }\n });\n\n const percentOfCs = NumOfCs / 15 * 100;\n const percentOfGs = NumOfGs / 15 * 100;\n\n if(percentOfCs >= 60 || percentOfGs >= 60) {\n return true;\n } else {\n return false;\n }\n }", "function improvesRatio(currentrow, nextnode, length) {\n var newrow;\n\n if (currentrow.length === 0) {\n return true;\n }\n\n newrow = currentrow.slice();\n newrow.push(nextnode);\n var currentratio = calculateRatio(currentrow, length);\n var newratio = calculateRatio(newrow, length); // the pseudocode in the Bruls paper has the direction of the comparison\n // wrong, this is the correct one.\n\n return currentratio >= newratio;\n } // calculateRatio - calculates the maximum width to height ratio of the", "compareDnaV2 (pAequor) {\n const result = this.dna.reduce((acc, curr, idx, arr) => {\n if (arr[idx] === pAequor.dna[idx]) {\n return acc + 1;\n }\n else {\n return acc;\n }\n }, 0)\n const percentage2 = result / this.dna.length * 100;\n return `Specimen ${this.specimenNum} and specimen ${pAequor.specimenNum} have ${percentage2.toFixed \n (2)}% in common.`\n }", "compareDNA(specimen) {\n let matches = 0\n this.dna.forEach((element, currentIndex) => {\n if (element === specimen.dna[currentIndex]) {\n matches++\n console.log(`${this.dna[currentIndex]} matches ${specimen.dna[currentIndex]} at ${currentIndex}`)\n }\n })\n if (matches > 0) {\n console.log (`Specimens have ${Math.floor((matches / this.dna.length) * 100)}% DNA in common.`)\n } else {\n console.log(\"No matches were found.\")\n console.log (\"Specimens don't have DNA in common.\")\n }\n }", "compareDNA(pAequor) {\n\t\t\tlet curr = this.dna;\n\t\t\tlet past = pAequor.dna;\n\t\t\tlet cnt = 0;\n\t\t\tfor(let i = 0; i < curr.length; i++) {\n\t\t\t\tif(curr[i] === past[i]) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet perc = (cnt/(curr.length) * 100).toFixed(2);\n\t\t\tconsole.log(`specimen #1 and specimen #2 have ${perc}% DNA in common`);\n\t\t}", "function IsFittingCount(x, syllables) {\n return x.length == syllables;\n}", "function isApproximately(a, b, withinPercent) {\n let percent = a / b * 100;\n Phoenix.log(percent);\n return percent > 100 - withinPercent && percent < 100 + withinPercent \n}", "function matchCheck(){\n return (points == match);\n }", "function perfect (x) {\r\n var module = x.module, pref = maxSize(x);\r\n if ( isVertical(x) ) {return Math.abs(pref.width - module.width()) < tolerance;} \r\n if ( isHorizontal(x) ) {return Math.abs(pref.height - module.height()) < tolerance;}\r\n return true;\r\n }", "function matchQuality (text, query) {\n const terms = tokenize(query)\n const termsLength = terms.map(term => term.length).reduce((x, y) => x + y, 0)\n\n const quality = termsLength / text.length\n // Add bonus points if the query matches text at the very start.\n const bonus = startsWith(text, terms[0]) ? 1 : 0\n\n return quality + bonus\n}", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "static selectionsSameMeasure(selections) {\n let i = 0;\n if (selections.length < 2) {\n return true;\n }\n const sel1 = selections[0].selector;\n for (i = 1; i < selections.length; ++i) {\n if (!SmoSelector.sameMeasure(sel1, selections[i].selector)) {\n return false;\n }\n }\n return true;\n }", "function betterThanAverage(classPoints, yourPoints) {\n \n let mediaClassPoints = classPoints.reduce((a,b) => a + b, 0) / classPoints.length;\n if((mediaClassPoints + yourPoints) / 2 <= yourPoints) {return true;}\n return false;\n}", "function checkSimilarTags(prefixArr){\n var isDifferent = false;\n for(var i = 0; i < queue[0].length; i++){\n if(arraysEqual(queue[0][i], prefixArr[0]) && !isDifferent){\n if(i / queue[0].length < Config.THRESHOLD_PERCENTAGE){\n isDifferent = true;\n }\n }\n }\n for(var i=0; i<queue[1].length; i++){\n if(arraysEqual(queue[1][i], prefixArr[1]) && !isDifferent){\n if(i / queue[1].length < Config.THRESHOLD_PERCENTAGE){\n isDifferent = true;\n }\n }\n }\n for(var i=0; i<queue[2].length; i++){\n if(arraysEqual(queue[2][i], prefixArr[2]) && !isDifferent){\n if(i / queue[2].length < Config.THRESHOLD_PERCENTAGE){\n isDifferent = true;\n } \n }\n }\n return isDifferent;\n}", "willLikelySurvive() {\n let surviveCount = 0;\n //iterates through DNA for instances of 'C' or 'G'\n dna.forEach(base => {\n if(base === 'C' || base === 'G'){\n surviveCount++;\n }\n });\n let survivePercent = (surviveCount/dna.length)*100;\n if(survivePercent >= 60) {\n return true;\n } else {\n return false;\n }\n }", "function countDuplicates(text) {\n const splitted = text.split(/\\s+/g);\n const wordcount = new Set(splitted).size;\n const ratio = wordcount / splitted.length;\n\n if (wordcount > 0 && ratio < 0.1)\n return true;\n else if (wordcount > 0 && text.length / wordcount > 300)\n return true;\n else\n return false;\n}", "willLikelySurvive() {\n // Use .filter() method to create new array containing only C/G elements\n const cOrG = this.dna.filter((el) => el === 'C' || el === 'G');\n // Divide length of newly filtered C/G array by length of original DNA array\n // If >= sixty percent, return true - If not, return false\n return cOrG.length / this.dna.length >= 0.6;\n }", "function charCountCompabilityCheck(seqs) {\n\tvar positionArray = new Array(seqs[0].length);\n\t// Create a base counter for each position:\n\tfor(var i = 0, n = seqs[0].length; i < n; i++) {\n\t\tpositionArray[i] = {A:0, T:0, G:0, C:0};\n\t}\n\t// Iterate over all sequences:\n\tvar seq;\n\tfor(var i = 0, n = seqs.length; i < n ; i++) {\n\t\tseq = seqs[i];\n\t\t// Iterate over all positions in current sequence:\n\t\tfor(var j = 0, m = seq.length; j < m; j++) {\n\t\t\t// Add one to the count for the base in this position:\n\t\t\tpositionArray[j][seq[j]] += 1;\n\t\t}\n\t}\n\t// Sum channel distribution:\n\tvar green;\n\tvar red;\n\tfor(var i = 0, n = seqs[0].length; i < n ; i++) {\n\t\tgreen = positionArray[i].T + positionArray[i].G;\n\t\tred = positionArray[i].A + positionArray[i].C;\n\t}\n\treturn (green > 0 && red > 0);\n}", "function matchCompare(matchRequirement, ingredients, availableIngredients) {\n var matches;\n var matchPercent = 100 * (matches / ingredients.length());\n \n for (var i = 0; i < ingredients.length(); i++) {\n for (var j = 0; j < availableIngredients.length(); j++) {\n if (ingredients[i] == availableIngredients[j]) {\n matches++;\n }\n }\n }\n \n if (matchPercent < matchRequirement) {\n return false;\n }\n \n return true;\n}", "function checkRepeats() {\n var v_ctr;\n for (v_ctr=0; v_ctr<7; v_ctr++) {\n/* console.log(\"340 [\" + v_ctr + \"] [\" +\n a_scaleNotes[v_ctr].substr(0,1) + \"] [\" +\n a_scaleNotes[(v_ctr + 1) % 7].substr(0,1) + \"]\");\n*/\n if (a_scaleNotes[v_ctr].substr(0,1) == a_scaleNotes[(v_ctr + 1) % 7].substr(0,1))\n return true;\n }\n return false;\n}", "function checkPerms(s1, s2) { //case-sensitive; assume whitespace is significant; only ASCII inputs\n\tvar l1 = s1.length;\n\tvar l2 = s2.length;\n\tif (l1 !== l2) return false;\n\n\tvar chars = {};\n\tfor (var i = 0, l = l1; i < l; i++) {\n\t\tif (chars[s1[i]]) chars[s1[i]] += 1;\n\t\telse chars[s1[i]] = 1;\n\t}\n\tfor (var i = 0, l = l2; i < l; i++) {\n\t\tif (chars[s2[i]]) chars[s2[i]] -= 1;\n\t\telse return false;\n\n\t\tif (chars[s2[i]] < 0) return false;\n\t}\n\treturn true;\n}", "function boolpercent(arr) {\n\tvar count = 0;\n\tfor (var i=0; i<arr.length; i++) {\n\t\tif (arr[i]) { count++; } \n\t}\n\treturn 100* count / arr.length;\n}", "function boolpercent(arr) {\n\tvar count = 0;\n\tfor (var i=0; i<arr.length; i++) {\n\t\tif (arr[i]) { count++; } \n\t}\n\treturn 100* count / arr.length;\n}", "_shouldStoreDiff(diff, baseLen) {\n if (!diff)\n return false;\n // Diff should give at least 20% of gain in space\n return diff.length < 0.8 * baseLen;\n }", "function boolpercent(arr) {\r\n\tvar count = 0;\r\n\tfor (var i=0; i<arr.length; i++) {\r\n\t\tif (arr[i]) { count++; } \r\n\t}\r\n\treturn 100* count / arr.length;\r\n}", "function boolpercent(arr) {\n var count = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n count++;\n }\n }\n return 100 * count / arr.length;\n}", "compareDNA(otherPAequor) {\n let count = 0;\n for (let i = 0; i < this.dna.length; i++) {\n if (this.dna[i] === otherPAequor.dna[i]) {\n count++;\n }\n }\n const commonDNA = ((count / this.dna.length) * 100).toFixed(2);\n\n console.log(\n `Specimen #${this.specimenNum} and specimen #${otherPAequor.specimenNum} have ${commonDNA}% DNA in common.`\n );\n }", "function compareQuestion(str1, str2){\n var arr1 = str1.toLowerCase().toLowerCase().split(\" \");\n var arr2 = str2.toLowerCase().split(\" \");\n var similarilty_count = 0;\n for (var i=0; i< arr1.length; i++){\n if (arr2.indexOf(arr1[i])>=0) \n similarilty_count++;\n }\n if (arr1[0] ===arr2[0] && similarilty_count/arr1.length > SIMILAR_THRESHOLD) return true; \n return false;\n }", "settled(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (Math.abs(arr[i]) > 0.1) {\n return false;\n }\n }\n return true;\n }", "function same(p0, p1) {\n return (Math.abs(p0[0] - p1[0]) < 1e-9 && Math.abs(p0[1] - p1[1]) < 1e-9);\n}", "function isCorrectPercentage(){\n let x = table.children[0];\n let theSpot;\n let leftD, leftM, leftU, upM, rightU, rightM, rightD, downM;\n for(let i=0; i<val; i++){\n for(let j=0; j<val; j++){\n let totalX = 0;\n let totalY = 0;\n theSpot = x.children[i].children[j];\n if(i!=0 && j!=0){\n leftD = x.children[i-1].children[j-1];\n }if(i!=0){\n leftM = x.children[i-1].children[j];\n }if(i!=0 && j<val-1){\n leftU = x.children[i-1].children[j+1];\n }if(j<val-1){\n upM = x.children[i].children[j+1];\n }if(i<val-1 && j!=0){\n rightU = x.children[i+1].children[j+1];\n }if(i<val-1){\n rightM = x.children[i+1].children[j];\n }if(i<val-1 && j!=0){\n rightD = x.children[i+1].children[j-1];\n }if(i!=0){\n downM = x.children[i].children[j-1];\n }\n if(theSpot.innerHTML == \"1\"){\n if(typeof(leftD) != \"undefined\"){\n if(leftD.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(leftM) != \"undefined\"){\n if(leftM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(leftU) != \"undefined\"){\n if(leftU.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(upM) != \"undefined\"){\n if(upM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightU) != \"undefined\"){\n if(rightU.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightM) != \"undefined\"){\n if(rightM.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(rightD) != \"undefined\"){\n if(rightD.innerHTML == \"1\"){\n totalX++;\n }}if(typeof(downM) != \"undefined\"){\n if(downM.innerHTML == \"1\"){\n totalX++;\n }}\n }if(theSpot.innerHTML == \"2\"){\n if(typeof(leftD) != \"undefined\"){\n if(leftD.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(leftM) != \"undefined\"){\n if(leftM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(leftU) != \"undefined\"){\n if(leftU.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(upM) != \"undefined\"){\n if(upM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightU) != \"undefined\"){\n if(rightU.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightM) != \"undefined\"){\n if(rightM.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(rightD) != \"undefined\"){\n if(rightD.innerHTML == \"2\"){\n totalY++;\n }}if(typeof(downM) != \"undefined\"){\n if(downM.innerHTML == \"2\"){\n totalY++;\n }}\n }\n console.log(totalX);\n console.log(totalY);\n if(totalX<(threshold.value*8)){\n theSpot.style.backgroundColor = \"#ffffff\";\n theSpot.innerHTML = \"0\";\n changeLocation(popXcolor.value);\n }if(totalY<(threshold.value*8)){\n theSpot.style.backgroundColor = \"#ffffff\";\n theSpot.innerHTML = \"0\";\n changeLocation(popYcolor.value);\n }\n }\n }\n /**\n * This function changes the location of the population to a vacant spot\n * @param {*} color \n */\n function changeLocation(color){\n let x = table.children[0];\n let theSpot;\n for (let i=0;i<val;i++){\n for(let j=0;j<val;j++){\n theSpot = x.children[i].children[j];\n if(theSpot.innerHTML == \"0\"){\n theSpot.style.backgroundColor = color;\n thePlace.style.color = \"#FFFFFF\";\n break;\n }\n }\n }\n }\n}", "function proFullhouse(pc, dc, numSame){\n\tif (numSame.num == 3){\n\t\tvar outAlready = 1 + contain(dc, numSame.rem1);\n\t\treturn (4.0 - outAlready)/43.0;\n\t}\n\telse if (numSame.twoPair) {\n\t\tvar out1Already = 2 + contain(dc, pc[0].value);\n\t\tvar out2Already = 2 + contain(dc, pc[2].value);\n\t\treturn (4.0+4.0-out1Already-out2Already)/43.0;\t\t\n\t} else {\n\t\treturn 0.0;\n\t}\n}", "function meetsRedundancyThreshold(merged, a, b) {\n const aSize = Object.keys(a).length;\n const bSize = Object.keys(b).length;\n const mergedSize = Object.keys(merged).length;\n const threshold = Math.floor(Math.max(aSize, bSize) / 2);\n\n if (aSize === 0 || bSize === 0 || threshold === 0) {\n return false;\n } else if (mergedSize >= threshold) {\n return true;\n } else {\n return false;\n }\n}", "willLikelySurvive() {\n let count = 0;\n for (let i = 0; i < this.dna.length; i++) {\n if (this.dna[i] === \"C\" || this.dna[i] === \"G\") {\n count++;\n }\n }\n if ((count * 100) / this.dna.length >= 60) {\n return true;\n } else {\n return false;\n }\n }", "function checkExactish(widthTarget, width, heightTarget, height) {\n\tconst targetAspect = parseFloat(widthTarget / heightTarget).toFixed(2)\n\tconst aspect = parseFloat(width / height).toFixed(2)\n\n\tconst isValid = (widthTarget <= width) &&\n\t\t(heightTarget <= height) &&\n\t\t(targetAspect === aspect)\n\n\treturn isValid\n}", "validate(pwd){\n this._maxLength = 0;\n this._leastTransformations = 10;\n for(let keyboard of this.keyboards){\n try{\n this._transformationsDone = [];\n const length = this._snakeLength(pwd, keyboard);\n if (length > this._maxLength){\n this._maxLength = length;\n\n if (this._transformationsDone.length < this._leastTransformations){\n this._leastTransformations = this._transformationsDone.length;\n }\n }\n } finally {\n this._transformationsDone = [];\n }\n }\n\n this._percentage = this._maxLength / pwd.length;\n\n return !(this._percentage >= this.minPercentage && this._leastTransformations <= 5);\n }", "function segmentSizesValid(segments){\r\n var totsize=0;\r\n for(var j=0; j<segments.length; j++){\r\n totsize+=segments[j];\r\n }\r\n if(totsize>mainMemorySize){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n}", "function calculeScores() {\n var width = canvas.width / ratio;\n var height = canvas.height / ratio;\n pigs.forEach((p) => {\n if ((birdX + birdWidth - tolerance > p.centerX - p.radius) && (birdX + tolerance < p.centerX + p.radius)) {\n if ((birdY + birdHeight - tolerance > p.centerY - p.radius) && (birdY + tolerance < p.centerY + p.radius)) {\n scoreSound.play();\n score += 2;\n p.centerX = canvas.width / ratio;\n p.centerY = Math.floor(Math.random() * (height - flowHeight - flowHeight + 1) + flowHeight);\n }\n }\n })\n}", "function shouldUse() {\n var show = data[questionPos][\"show_number\"];\n var toTake = (questionPos % 4) + 1;\n return ((parseInt(show.charCodeAt(toTake)) % g) >= (g / 3));\n }", "function sameFrequencyPattern(arr1, arr2){\n const n1 = arr1.length\n const n2 = arr2.length\n if( n1 !== n2 ) return false\n\n // calculates the frequencies of each table\n const frequencyCounter1 = arr1.reduce((acc,v) => ({ ...acc, [v]:(acc[v]||0)+1 }),{})\n const frequencyCounter2 = arr2.reduce((acc,v) => ({ ...acc, [v]:(acc[v]||0)+1 }),{})\n\n for(let key in frequencyCounter1){\n // if a number in array 1 (squared) does not exists in array 2 then return false\n if(!(key ** 2 in frequencyCounter2)) return false\n // if the frequencies between between the values do not match return false\n if(frequencyCounter2[key**2] !== frequencyCounter1[key]) return false\n }\n\n return true\n}", "function checkMatches(drawData) {\n const { winningNumbers, drawedSets} = drawData;\n //const numAmount = winningNumbers.size;\n for (set of drawedSets) {\n set.match = 0;\n for (let num of set.numbers) {\n if (winningNumbers.includes(num)) {\n set.match++;\n }\n }\n }\n //console.log(winningNumbers, drawedSets);\n}", "function countMatches(orders) {\r\n\t var matched = 0, dimension = orders[0].length\r\n\t while(matched < dimension) {\r\n\t for(var j=1; j<orders.length; ++j) {\r\n\t if(orders[j][matched] !== orders[0][matched]) {\r\n\t return matched\r\n\t }\r\n\t }\r\n\t ++matched\r\n\t }\r\n\t return matched\r\n\t}", "function countMatches(orders) {\r\n\t var matched = 0, dimension = orders[0].length\r\n\t while(matched < dimension) {\r\n\t for(var j=1; j<orders.length; ++j) {\r\n\t if(orders[j][matched] !== orders[0][matched]) {\r\n\t return matched\r\n\t }\r\n\t }\r\n\t ++matched\r\n\t }\r\n\t return matched\r\n\t}", "function isAlmostZeroLength(ps, delta = DELTA) {\n for (let i = 1; i < ps.length; i++) {\n let p1 = ps[i - 1];\n let p2 = ps[i];\n if (flo_vector2d_1.manhattanDistanceBetween(p1, p2) > delta) {\n return false;\n }\n }\n return true;\n}", "function patternCheckOrientation(pattern, targetCell, qualityGoal, weight, orientation) {\n var forwardFacingCells = FWD_CELLS[targetCell];\n var totalDiscrepancies = 0;\n DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"Enter pCO([\" + pattern + \"]; \" + targetCell + \", \" + qualityGoal + \", \" + weight + \", \" + orientation + \"); compass: \" + compass);\n fwdWrong = [];\n rearWrong = [];\n if ((Array.isArray(pattern[POS_CENTER]) && !pattern[POS_CENTER][myColor]) ||\n\t((pattern[POS_CENTER] > 0) && (myColor != pattern[POS_CENTER]))) {\n\tif (forwardFacingCells[POS_CENTER]) { // always true, in fact\n\t fwdWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += 1;\n\t} else {\n\t rearWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += weight;\n\t}\n }\n if ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\tDEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\treturn PAT_NOMATCH;\n }\n var jFrom = 0;\n switch (targetCell) {\n case AIM_UP:\n\tjFrom = 4;\n\tbreak;\n case AIM_LEFT:\n\tjFrom = 6;\n\tbreak;\n case AIM_RIGHT:\n\tjFrom = 2;\n\tbreak;\n case AIM_DOWN:\n case POS_CENTER:\n default:\n\tbreak;\n }\n for (var j = jFrom; j < TOTAL_NBRS + jFrom; j++) {\n\tvar posP = CCW[j];\n\tvar posV = CCW[orientation + j];\n\tvar c = view[posV].color;\n\tif ((Array.isArray(pattern[posP]) && !pattern[posP][c]) ||\n\t ((pattern[posP] > 0) && (c != pattern[posP]))) {\n\t if (forwardFacingCells[posP]) {\n\t\tfwdWrong.push({p:posP, v:posV});\n\t\t// #future# If it should ever be needed, we could push j as a\n\t\t// third member of these objects (its absence indicating the\n\t\t// center cell).\n\t\ttotalDiscrepancies += 1;\n\t } else {\n\t\trearWrong.push({p:posP, v:posV});\n\t\ttotalDiscrepancies += weight;\n\t }\n\t}\n\tif ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\t DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\t return PAT_NOMATCH;\n\t}\n }\n // Assert: totalDiscrepancies == fwdWrong.length + rearWrong.length;\n // Assert: If compass < 0, then totalDiscrepancies <= qualityGoal\n debugme(\"-> total \" + totalDiscrepancies + \" weighted discrepancies found.\");\n if ((compass < 0)\n\t// && (totalDiscrepancies <= qualityGoal)\n ) {\n\tcompass = orientation;\n }\n if (DEBUGME[myType]) {\n\t// Bypass the single-arg debugme() in order to get the objects printed.\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"forwardD: [\", fwdWrong, \"]\");\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"rearD: [\", rearWrong, \"]\");\n }\n if (fwdWrong.length == 0) {\n\treturn (totalDiscrepancies);\n } else {\n\treturn (-totalDiscrepancies);\n }\n}", "function calc_conf_score(input_set, master_paragraph){\n\n let num_same_words = 0;\n // clean string and split by spaces\n let master_paragraph_split = master_paragraph.toLowerCase().replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\").replace(/\\s{2,}/g,\" \").split(\" \");\n let master_paragraph_split_filtered = master_paragraph_split.filter((x)=>!unimportant_words.has(x));\n let num_words_paragraph = master_paragraph_split_filtered.length;\n\n for(var i = 0; i < master_paragraph_split_filtered.length; i++){\n if (input_set.has(master_paragraph_split_filtered[i])){\n num_same_words++;\n }\n }\n return (num_same_words / num_words_paragraph);\n}", "campare(a, b) {\n const EPS = 0.1;\n if (Math.abs(Math.abs(a) - Math.abs(b)) < EPS) {\n return true;\n }\n return false;\n }", "function checkAnswer(patternLen) {\r\n for(var i=0;i<patternLen;i++){\r\n if(userClickedPattern[i] !== gamePattern[i]){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "willLikelySurvive() { \n\t\t\tlet cnt = 0;\n\n\t\t\tfor(let each of this.dna) {\n\t\t\t\tif (each === 'C' || each === 'G') {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet perc = (cnt/this.dna.length) * 100;\n\t\t\t// console.log(`percent of survival: ${perc}`);\n\n\t\t\tif (perc >= 60) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function betterThanAverage(classPoints, yourPoints) {\n return classPoints.reduce((a,b) => a + b)/classPoints.length < yourPoints ? true : false\n }", "function macthCount(current, goal) {\n let matchC = 0;\n for (let i = 0; i < current.length; i++) {\n for (let j = 0; j < current[i].length; j++) {\n if (current[i][j] == goal[i][j]) {\n matchC++;\n }\n }\n }\n return (matchC==9)?true:false;\n}", "function caml_greaterequal (x, y) { return +(caml_compare(x,y,false) >= 0); }", "function isPassing(ratio) {\n if (ratio >= 7.99) {\n return \"Passing - Level AAA\";\n }\n else if (ratio >= 4.5) {\n return \"Passing - Level AA\";\n }\n else {\n return \"Failing\";\n }\n}", "function solution(){\n primes = primeGenerator(10000000);\n for(let len=4173; len<30000; len+=2){\n let mat = generateSpiral(len);\n let values = getDiagonalValues(mat);\n let ratio = ratioOfPrimes(values, primes);\n console.log(\"len: \"+len+\" ratio: \"+ratio);\n if(ratio < 10.0){\n console.log(len);\n break;\n }\n }\n}", "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "function isValid(s) {\nvar list = {};\n for (let i = 0; i < s.length; i++) {\n if (s[i] in list) {\n list[s[i]] += 1;\n } else {\n list[s[i]] = 1;\n }\n }\n var frequency = [];\n var lastIneq;\n var keys = Object.keys(list);\n for (var i = 0; i < keys.length; i++) {\n frequency.push(list[keys[i]]);\n }\n var difference = (Math.max(...frequency) - Math.min(...frequency))\n var count=0;\n for (let i = 1; i < frequency.length; i++) {\n if (frequency[0] !== frequency[i]) {\n count ++;\n lastIneq = i;\n }\n }\n console.log(frequency, count, difference)\n if(count <= 1){\n if(frequency[lastIneq] == 1 || difference <= 1){\n return \"YES\";\n }\n else{\n return \"NO\"\n }\n }\n else{\n return \"NO\";\n }\n\n}", "checkStructure() {\n let numRepr = 0;\n\n this.parents.forEach((parent, i) => {\n const rank = this.ranks[i];\n const size = this.sizes[i];\n const isRepr = parent === i;\n\n if (isRepr) {\n numRepr++;\n }\n\n const isParentInRange = 0 <= parent && parent < this.parents.length;\n const isReprRelevant = (isRepr || rank < this.ranks[parent]) &&\n (!isRepr && size === 0 || isRepr && size >= (1 << rank));\n const noAssertion = isParentInRange && isReprRelevant && 0 <= rank ;\n\n if (!noAssertion) {\n throw \"Assertion error\";\n }\n });\n\n if (!(0 <= this.numSets && this.numSets === numRepr && this.numSets <= this.parents.length)) {\n throw \"Assertion error\";\n }\n }", "function isMatchPattern() {\n\tvar cards = $(\".card-flipped\");\n\tvar pattern = $(cards[0]).data(\"pattern\");\n\tvar anotherPattern = $(cards[1]).data(\"pattern\");\n\treturn (pattern == anotherPattern);\n}", "isFullMatch() {\n for (let i = 0; i < this.result.length; i++) {\n if (this.result[i].result !== 'MATCH') {\n return false;\n }\n }\n\n return true;\n }", "function comparePeaks(reference) {\n var result = 0, cutoff = reference.offset * 1.5;\n\n // Pairwise comparison\n _.each(histogramSorted, function (peak) {\n if (peak == reference) return;\n if (peak.offset < cutoff) return;\n\n // Calculate match value based on narrow window around integer ratios.\n var ratio = peak.offset / reference.offset,\n match = Math.max(0, 1 - Math.abs(ratio - Math.round(ratio)) * 8);\n\n // Scale by peak strength\n strength = peak.strength * peak.permanence * ratio;\n result += match * strength;\n });\n\n return result;\n }", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function isSquare(one, two, three, four, threshold=0.0) {\n let l = [];\n\n l.push(distance(one, two));\n l.push(distance(one, three));\n l.push(distance(one, four));\n l.push(distance(two, three));\n l.push(distance(two, four));\n l.push(distance(three, four));\n\n console.log(l)\n l = l.sort((a, b) => {\n return a-b;\n });\n console.log(l)\n\n let t = threshold**2;\n if (l[3]-l[4] ) return false;\n if (l[4] !== l[5]) return false;\n\n console.log(\"banana\")\n\n if (!(l[0] == l[1] &&\n l[1] == l[2] &&\n l[2] == l[3])) {\n return false;\n }\n\n return true;\n}", "function similar(coords1, coords2, tolerance) {\n\t if (coords1.length !== coords2.length) {\n\t return false;\n\t }\n\n\t var n = coords1.length;\n\n\t var angles1 = angleMeasures(coords1);\n\t var angles2 = angleMeasures(coords2);\n\n\t var sides1 = sideLengths(coords1);\n\t var sides2 = sideLengths(coords2);\n\n\t for (var i = 0; i < 2 * n; i++) {\n\t var angles = angles2.slice();\n\t var sides = sides2.slice();\n\n\t // Reverse angles and sides to allow matching reflected polygons\n\t if (i >= n) {\n\t angles.reverse();\n\t sides.reverse();\n\t // Since sides are calculated from two coordinates,\n\t // simply reversing results in an off by one error\n\t sides = rotate(sides, 1);\n\t }\n\n\t angles = rotate(angles, i);\n\t sides = rotate(sides, i);\n\n\t if (deepEq(angles1, angles)) {\n\t var sidePairs = _.zip(sides1, sides);\n\n\t var factors = _.map(sidePairs, function (pair) {\n\t return pair[0] / pair[1];\n\t });\n\n\t var same = _.all(factors, function (factor) {\n\t return eq(factors[0], factor);\n\t });\n\n\t var congruentEnough = _.all(sidePairs, function (pair) {\n\t return knumber.equal(pair[0], pair[1], tolerance);\n\t });\n\n\t if (same && congruentEnough) {\n\t return true;\n\t }\n\t }\n\t }\n\n\t return false;\n\t}", "function checkWin() {\n return match.length === 16;\n}", "function areSimilar(a, b) {\n const values = {}; // values = {1: 0, 2: 0, 3: 0}\n let mismatches = 0; // mismatches = 0\n\n for (let i = 0; i < a.length; i++) { // i = 3, length = 3\n const value = a[i]; // value = 3\n if (values[value] > 0) {\n values[value] += 1;\n } else {\n values[value] = 1;\n }\n if (value !== b[i]) {\n mismatches++;\n }\n if (mismatches > 2) {\n return false;\n }\n }\n\n for (let i = 0; i < b.length; i++) { // i = 3, length = 3\n const value = b[i]; // value = 3\n if (values[value]) {\n values[value] -= 1;\n } else {\n return false;\n }\n }\n\n for (const key in values) { // key = 3\n if (values[key] !== 0) { // values.3 = 0\n return false;\n }\n }\n\n return true;\n}", "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "function calculatePOSMatch(posPairDict, posTotalFreqs,\n\texpectedPairFreqs,expectedTotalFreqs) {\n\tvar chiSquaredDict = new Object();\n\tvar finalChiSquared = 0.0;\n\n\tvar totalWords = 0;\n\tfor (var key in posTotalFreqs) {\n\t\ttotalWords += posTotalFreqs[key];\n\t}\n\n\t// 3) using observed and expected frequencies, run a chi-squared test (for each POS) \n\t// 4) We can weight each chi-squared test by the frequency of each POS\n\tfor (var key in expectedPairFreqs) {\n\t\tvar expectedPosFreqs = expectedPairFreqs[key];\n\t\tvar chiSquaredValue = 0;\n\t\tfor(var key2 in expectedPosFreqs) {\n\t\t\tvar temp = Math.pow(expectedPosFreqs[key2] - posPairDict[key][key2], 2);\n\t\t\ttemp /= expectedPosFreqs[key2];\n\t\t\tchiSquaredValue += temp;\n\t\t}\n\t\tchiSquaredDict[key] = chiSquaredValue;\n\t\tfinalChiSquared += (chiSquaredValue) * (posTotalFreqs[key]) / totalWords;\n\t}\n\n\t// 5) Now that we have the final chi-squared static, calculate the probability\n\tvar prob = 1 - chi.cdf(finalChiSquared, Object.keys(posTotalFreqs).length * 5);\n\treturn prob;\n}", "function calculateAccuracy(chances){\n var falseCount = 0;\n var trueCount = 0;\n\n chances.forEach(function(chance){\n if (chance.result){\n trueCount++;\n } else {\n falseCount++;\n }\n });\n\n return chances.length === 0 ? 0 : ((trueCount/chances.length) * 100);\n}", "isContiguous() {\n for (let idx = 0; idx < this.dims; idx++) {\n const stride = this.strides[idx];\n const mod = this.mods[idx];\n\n if (idx === this.dims - 1) {\n if (stride !== 1) {\n return false;\n }\n } else if (stride !== this.mods[idx + 1]) {\n return false;\n }\n\n if (mod !== this.strides[idx] * this.shape[idx]) {\n return false;\n }\n }\n\n return true;\n }", "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }", "nearPlotsFitRequirements(plots) {\n const nearFlavors = [0, 0, 0, 0, 0];\n plots.forEach(idx => {\n const plot = App.game.farming.plotList[idx];\n if (!plot.isUnlocked) {\n return;\n }\n if (plot.isEmpty()) {\n return;\n }\n if (plot.stage() < PlotStage.Taller) {\n return;\n }\n const berryFlavors = App.game.farming.berryData[plot.berry].flavors.map(x => x.value * this.flavorRatio[plot.stage() - 2]);\n for (let j = 0; j < 5; j++) {\n nearFlavors[j] += berryFlavors[j];\n }\n });\n return this.flavorReqs.every((value, idx) => value[0] <= nearFlavors[idx] && nearFlavors[idx] <= value[1]);\n }", "nearPlotsFitRequirements(plots) {\n const nearFlavors = [0, 0, 0, 0, 0];\n plots.forEach(idx => {\n const plot = App.game.farming.plotList[idx];\n if (!plot.isUnlocked) {\n return;\n }\n if (plot.isEmpty()) {\n return;\n }\n if (plot.stage() < PlotStage.Taller) {\n return;\n }\n const berryFlavors = App.game.farming.berryData[plot.berry].flavors.map(x => x.value * this.flavorRatio[plot.stage() - 2]);\n for (let j = 0; j < 5; j++) {\n nearFlavors[j] += berryFlavors[j];\n }\n });\n return this.flavorReqs.every((value, idx) => value[0] <= nearFlavors[idx] && nearFlavors[idx] <= value[1]);\n }", "get _isResized() {\n // Compare ratios. Very different includes IHM space.\n var heightRatio = _Global.document.documentElement.clientHeight / _Global.innerHeight,\n widthRatio = _Global.document.documentElement.clientWidth / _Global.innerWidth;\n\n // If they're nearly identical, then the view hasn't been resized for the IHM\n // Only check one bound because we know the IHM will make it shorter, not skinnier.\n return (widthRatio / heightRatio < 0.99);\n\n }", "function isValidSize(size) {\n\tvar MIN_ASPECT = 1 / 3,\n\t\tMAX_ASPECT = 10,\n\t\tMIN_AREA = 100 * 100;\n\n\tvar aspect = size.height / size.width,\n\t\tarea = size.width * size.height;\n\n\treturn aspect > MIN_ASPECT &&\n\t\taspect < MAX_ASPECT &&\n\t\tarea > MIN_AREA;\n}", "function ePaisagem(width, height) {\n\n return width > height\n}", "function isRectangle() {\r\n // The total number of size 1x1 fields (in piece space) that\r\n // are occupied by the selected pieces:\r\n var occupiedFields = 0;\r\n for (var i in that.pieces) {\r\n var piece = that.pieces[i];\r\n occupiedFields += piece.widthP * piece.heightP;\r\n }\r\n return (occupiedFields == that.widthP * that.heightP);\r\n }", "function checkPass(result) {\n let labMarks = result.labMarks ? result.labMarks : 0;\n return result.theoryMarks + labMarks >= 50;\n }", "function isEqualSlices(totalNumSlice, numReciepients, slicesPerPerson) {\n if (numReciepients * slicesPerPerson > totalNumSlice) {\n console.log(`not enought slices`, false);\n } else {\n console.log(`enought slices`, true);\n }\n}", "static IsGoodPosition(position) {\n if (position.length == 0) return false;\n const rows = position.split(\"/\");\n if (rows.length != V.size.x) return false;\n let kings = { \"k\": 0, \"K\": 0, 'l': 0, 'L': 0 };\n for (let row of rows) {\n let sumElts = 0;\n for (let i = 0; i < row.length; i++) {\n if (['K','k','L','l'].includes(row[i])) kings[row[i]]++;\n if (V.PIECES.includes(row[i].toLowerCase())) sumElts++;\n else {\n const num = parseInt(row[i], 10);\n if (isNaN(num)) return false;\n sumElts += num;\n }\n }\n if (sumElts != V.size.y) return false;\n }\n if (kings['k'] + kings['l'] != 1 || kings['K'] + kings['L'] != 1)\n return false;\n return true;\n }", "function hasValidSampleSize() {\n return offsetSamples.length >= 5;\n }", "nearPlotsFitRequirements(plots) {\n const currentReqs = {};\n plots.forEach((idx) => {\n const plot = App.game.farming.plotList[idx];\n if (plot.stage() !== PlotStage.Berry) {\n return;\n }\n if (!currentReqs[plot.berry]) {\n currentReqs[plot.berry] = 1;\n }\n else {\n currentReqs[plot.berry] += 1;\n }\n });\n return Object.keys(this.berryReqs).every(key => currentReqs[key] !== undefined && currentReqs[key] >= this.berryReqs[key]);\n }", "function checkConsanginuity(fam_id, pers1_id, pers2_id)\n{\n var fam_map = familyMapOps.getFam(fam_id),\n pers1 = fam_map[pers1_id],\n pers2 = fam_map[pers2_id];\n\n // Find pers1 founder\n var routes2 = [];\n routes2.push( pers1 );\n routes2.push( pers2 );\n\n //console.log(\"routes2=\", pers1_id, pers2_id);\n\n // = [pers1, pers2];\n\n var complete = [],\n \tloopnum = 0;\n\n // console.log(pers1.id+\" and \"+pers2.id);\n while(routes2.length > 0 && loopnum++ < 100){\n\n \tvar perc = routes2.shift(); // remove from search\n\n/* \tif (perc === undefined){\n \t\t\n \t}\n*/\n \t//Try mother + father\n\t if (perc.mother === 0 && perc.father === 0){\n\t \tcomplete.push(perc.id);\n\t \tcontinue;\n\t }\n\n \tif (perc.mother != 0) routes2.push(perc.mother);\n \tif (perc.father != 0) routes2.push(perc.father);\n\n \t// console.log(\" routes=\", routes2.map( function(n){ return n.id;}));\n }\n // console.log(\"complete=\", complete);\n\n //Find duplicates in complete\n complete = complete.sort();\n for (var a=0; a < complete.length -1; a++){\n \tif (complete[a+1] === complete[a])\n \t\treturn true;\n }\n\n return false;\n}" ]
[ "0.58984965", "0.5873701", "0.5846635", "0.58114964", "0.58030957", "0.57344806", "0.5690995", "0.5646999", "0.563571", "0.5550344", "0.5445501", "0.54425097", "0.54248667", "0.5385541", "0.5372878", "0.5366242", "0.5363819", "0.5352206", "0.5316015", "0.53134966", "0.5311252", "0.52856725", "0.5270786", "0.5259772", "0.52577454", "0.5253942", "0.5248371", "0.5243528", "0.5242046", "0.5242046", "0.5240374", "0.5224718", "0.52228534", "0.5218619", "0.51978934", "0.5191057", "0.5190722", "0.51847637", "0.5175462", "0.5169386", "0.5165346", "0.51652414", "0.5162082", "0.51218075", "0.5121089", "0.51138693", "0.5091822", "0.50817335", "0.50809544", "0.50809544", "0.506814", "0.50680864", "0.50668", "0.50665027", "0.5062422", "0.50534403", "0.50491154", "0.50439", "0.5039087", "0.5016296", "0.49975938", "0.4989016", "0.4989016", "0.4989016", "0.4989016", "0.49869385", "0.49778715", "0.49755967", "0.49729282", "0.49655217", "0.4963609", "0.4963609", "0.4963609", "0.4963609", "0.4963609", "0.4963609", "0.49611384", "0.4961102", "0.49565145", "0.4954868", "0.4947576", "0.4943907", "0.49377218", "0.4936672", "0.4934951", "0.4934951", "0.4934951", "0.4934951", "0.49339908", "0.49339908", "0.49338475", "0.49337763", "0.49337637", "0.4930023", "0.49232578", "0.49218112", "0.49146423", "0.49122077", "0.49062526", "0.49058723" ]
0.56132394
9
Given a count of black/white/black pixels just seen and an end position, figures the location of the center of this black/white/black run.
function centerFromEnd(stateCount, end) { var result = (end - stateCount[2]) - stateCount[1] / 2; if (helpers_1.isNaN(result)) { return null; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countBlackWhiteRun(origin, end, matrix, length) {\n var rise = end.y - origin.y;\n var run = end.x - origin.x;\n var towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));\n var awayFromEnd = countBlackWhiteRunTowardsPoint(origin, { x: origin.x - run, y: origin.y - rise }, matrix, Math.ceil(length / 2));\n var middleValue = towardsEnd.shift() + awayFromEnd.shift() - 1; // Substract one so we don't double count a pixel\n return (_a = awayFromEnd.concat(middleValue)).concat.apply(_a, towardsEnd);\n var _a;\n}", "function countBlackWhiteRunTowardsPoint(origin, end, matrix, length) {\n var switchPoints = [{ x: Math.floor(origin.x), y: Math.floor(origin.y) }];\n var steep = Math.abs(end.y - origin.y) > Math.abs(end.x - origin.x);\n var fromX;\n var fromY;\n var toX;\n var toY;\n if (steep) {\n fromX = Math.floor(origin.y);\n fromY = Math.floor(origin.x);\n toX = Math.floor(end.y);\n toY = Math.floor(end.x);\n }\n else {\n fromX = Math.floor(origin.x);\n fromY = Math.floor(origin.y);\n toX = Math.floor(end.x);\n toY = Math.floor(end.y);\n }\n var dx = Math.abs(toX - fromX);\n var dy = Math.abs(toY - fromY);\n var error = Math.floor(-dx / 2);\n var xStep = fromX < toX ? 1 : -1;\n var yStep = fromY < toY ? 1 : -1;\n var currentPixel = true;\n // Loop up until x == toX, but not beyond\n for (var x = fromX, y = fromY; x !== toX + xStep; x += xStep) {\n // Does current pixel mean we have moved white to black or vice versa?\n // Scanning black in state 0,2 and white in state 1, so if we find the wrong\n // color, advance to next state or end if we are in state 2 already\n var realX = steep ? y : x;\n var realY = steep ? x : y;\n if (matrix.get(realX, realY) !== currentPixel) {\n currentPixel = !currentPixel;\n switchPoints.push({ x: realX, y: realY });\n if (switchPoints.length === length + 1) {\n break;\n }\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += yStep;\n error -= dx;\n }\n }\n var distances = [];\n for (var i = 0; i < length; i++) {\n if (switchPoints[i] && switchPoints[i + 1]) {\n distances.push(distance(switchPoints[i], switchPoints[i + 1]));\n }\n else {\n distances.push(0);\n }\n }\n return distances;\n}", "function center(iv) {\n return Math.floor((iv.stop + iv.start) / 2);\n }", "function center(iv: Interval) {\n return Math.floor((iv.stop + iv.start) / 2);\n }", "function CentreVideo() {\n //console.log(\"R = \" + (image.data[3 * (image.width / 2) + 3 * (image.height / 2) * image.width]));\n //console.log(\"G = \" + (image.data[3 * (image.width / 2) + 1 + 3 * (image.height / 2) * image.width]));\n //console.log(\"B = \" + (image.data[3 * (image.width / 2) + 2 + 3 * (image.height / 2) * image.width]));\n\n for (var i = 3 * (image.width / 2); i < 5 * (image.width / 2); i += 4) {\n for (var j = 3 * (image.height / 2) * image.width; j < 5 * (image.height / 2) * image.width; j += 4 * image.width) {\n nbPoints++;\n var red = image.data[i + j];\n var green = image.data[i + j + 1];\n var blue = image.data[i + j + 2];\n\n if (red > 192 && green < 128 && blue < 128) {\n nbRedPoints++;\n }\n\n image.data[i + j] = 255;\n image.data[i + j + 1] = 0;\n image.data[i + j + 2] = 0;\n }\n }\n }", "function getOffsets(size) {\n //THIS FUNCTION IS SO UGLY IM SO SORRY\n let wO = (size * 1.732050808 / 2);\n let hO = size;\n let ans = [];\n\n let startingY = 50 - 2 * (hO * .75);\n let startingX = 50 - wO;\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 - 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50;\n startingX = 50 - wO * (2);\n\n for (let i = 0; i < 5; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n\n\n startingY = 50 + 1 * (hO * .75);\n startingX = 50 - wO * (1.5);\n\n for (let i = 0; i < 4; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n\n startingY = 50 + 2 * (hO * .75);\n startingX = 50 - wO;\n\n\n for (let i = 0; i < 3; i++) {\n ans.push(`top:${startingY}%;left:${startingX + i * (wO)}%`)\n }\n return ans;\n}", "function sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image) {\r\n\t\t fromX = Math.floor(fromX);\r\n\t\t fromY = Math.floor(fromY);\r\n\t\t toX = Math.floor(toX);\r\n\t\t toY = Math.floor(toY);\r\n\t\t // Mild variant of Bresenham's algorithm;\r\n\t\t // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\r\n\t\t var steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);\r\n\t\t if (steep) {\r\n\t\t var temp = fromX;\r\n\t\t fromX = fromY;\r\n\t\t fromY = temp;\r\n\t\t temp = toX;\r\n\t\t toX = toY;\r\n\t\t toY = temp;\r\n\t\t }\r\n\t\t var dx = Math.abs(toX - fromX);\r\n\t\t var dy = Math.abs(toY - fromY);\r\n\t\t var error = -dx >> 1;\r\n\t\t var xstep = fromX < toX ? 1 : -1;\r\n\t\t var ystep = fromY < toY ? 1 : -1;\r\n\t\t // In black pixels, looking for white, first or second time.\r\n\t\t var state = 0;\r\n\t\t // Loop up until x == toX, but not beyond\r\n\t\t var xLimit = toX + xstep;\r\n\t\t for (var x = fromX, y = fromY; x != xLimit; x += xstep) {\r\n\t\t var realX = steep ? y : x;\r\n\t\t var realY = steep ? x : y;\r\n\t\t // Does current pixel mean we have moved white to black or vice versa?\r\n\t\t // Scanning black in state 0,2 and white in state 1, so if we find the wrong\r\n\t\t // color, advance to next state or end if we are in state 2 already\r\n\t\t if ((state == 1) === image.get(realX, realY)) {\r\n\t\t if (state == 2) {\r\n\t\t return distance(x, y, fromX, fromY);\r\n\t\t }\r\n\t\t state++;\r\n\t\t }\r\n\t\t error += dy;\r\n\t\t if (error > 0) {\r\n\t\t if (y == toY) {\r\n\t\t break;\r\n\t\t }\r\n\t\t y += ystep;\r\n\t\t error -= dx;\r\n\t\t }\r\n\t\t }\r\n\t\t // Found black-white-black; give the benefit of the doubt that the next pixel outside the image\r\n\t\t // is \"white\" so this last point at (toX+xStep,toY) is the right ending. This is really a\r\n\t\t // small approximation; (toX+xStep,toY+yStep) might be really correct. Ignore this.\r\n\t\t if (state == 2) {\r\n\t\t return distance(toX + xstep, toY, fromX, fromY);\r\n\t\t }\r\n\t\t // else we didn't find even black-white-black; no estimate is really possible\r\n\t\t return NaN;\r\n\t\t}", "function search_start_pos(value) {\n var N = height / $p.config.GRIDY; // target grid N\n\n var y = Infinity,\n y$ = value,\n count = 0;\n\n while (y > 0) {\n y = Math.floor(math.log(y$) * self.A + self.B);\n y$ *= self.$_mult;\n if (count++ > N * 3) return 0; // Prevents deadloops\n }\n\n return y$;\n }", "function annot_offset(range_end){\n var lines = editor.getSession().getDocument().getLines(0, range_end.row);\n var total_off = 0;\n var num_char;\n\n for(var i = 0; i < lines.length; i++){\n num_char = lines[i].length;\n total_off += parseInt((num_char - 1) / 80, 10);\n }\n\n return total_off;\n}", "function handlePossibleCenter(stateCount, i, j, moduleSize) {\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t var centerJ = centerFromEnd(stateCount, j);\r\n\t\t if (centerJ == null) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var centerI = crossCheckVertical(i, Math.floor(centerJ), 2 * stateCount[1], stateCountTotal, moduleSize, image);\r\n\t\t if (centerI != null) {\r\n\t\t var estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3;\r\n\t\t for (var i2 in possibleCenters) {\r\n\t\t var center = possibleCenters[i2];\r\n\t\t // Look for about the same center and module size:\r\n\t\t if (aboutEquals(center, estimatedModuleSize, centerI, centerJ)) {\r\n\t\t return combineEstimate(center, centerI, centerJ, estimatedModuleSize);\r\n\t\t }\r\n\t\t }\r\n\t\t // Hadn't found this before; save it\r\n\t\t var point = { x: centerJ, y: centerI, estimatedModuleSize: estimatedModuleSize };\r\n\t\t possibleCenters.push(point);\r\n\t\t }\r\n\t\t return null;\r\n\t\t }", "function showPixelFinal(imageDataFinal, imageData, MAX_X, MAX_Y) {\n\tvar index = '';\n\tvar marginLeft = 0;\n\tvar marginTop = 0;\n\tfor (var i = 0; i < MAX_X; i++) {\n\t\tfor (var j = 0; j < MAX_Y; j++) {\n\t\t\tif (imageData[i][j]) {\n\t\t\t\tindex = (i + marginLeft + (j + marginTop) * MAX_X) * 4;\n\t\t\t\t//console.log(imageData[i][j].x+\" \"+imageData[i][j].y+\" \"+index+\" \"+imageData[i][j].r+\" \"+imageData[i][j].g+\" \"+imageData[i][j].b+\" \"+\"<BR>\");\n\t\t\t\timageDataFinal.data[index + 0] = imageData[i][j].r;\n\t\t\t\timageDataFinal.data[index + 1] = imageData[i][j].g;\n\t\t\t\timageDataFinal.data[index + 2] = imageData[i][j].b;\n\t\t\t\timageDataFinal.data[index + 3] = imageData[i][j].a;\n\t\t\t}\n\t\t}\n\t}\n}", "function imageIndexOf(x,y) {\n return x+(y+2)*(maxX+3)+topImages+3; } // This is the simplified version", "function getPixelCenter(x, y) {\n\tvar pixelX = x*(canvas.width/grid.x)+((canvas.width/grid.x)/2);\n\tvar pixelY = y*(canvas.height/grid.y)+((canvas.height/grid.y)/2);\n\treturn {\"x\": pixelX, \"y\": pixelY};\n}", "function colorTracker(arg){\n\tcapture.loadPixels();\n\n\tlet colLoc = [0,0];\n\tlet colDist = 600;\n\n\t for(let bY =0; bY < capture.height; bY++){\n\t \tfor(let bX=0;bX<capture.width;bX++){\n\t \t\tlet index = 4 * bX +(bY * capture.width);\n\t \t\t\n\t \t\tlet r = capture.pixels[index];\n\t \t\tlet g = capture.pixels[index + 1];\n\t \t\tlet b = capture.pixels[index + 2];\n\n\t \t\tlet newDist = dist(r,g,b,arg[0],arg[1],arg[2]);\n\t \t\tif(newDist<colDist){\n\t \t\t\tcolDist = newDist;\n\t \t\t\tcolLoc = [bX,bY];\n\t \t\t}\n\t \t}\n \t}\n return colLoc;\n}", "set center(value) {}", "cellCenterValue (i) {\r\n return i * this.cell_size + this.cell_size / 2 - i * this.line_size;\r\n }", "function getPositionInPixels(tab, index){\n return offset[index] + (offsetInit[index] + tab[index])*currentZoom - getCanvasSize(index)*(currentZoom - 1)/2;\n }", "function getPixelPos(squares) { \n var squareWidth = (canvas.width - ((NUM_ROWS+1)*GAP))/NUM_ROWS;\n return squares*squareWidth+(GAP*squares)+GAP;\n}", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "computeCenter() {\n self.centerX = self.screenX + self.screenDisplacementX;\n self.centerY = self.screenY + self.screenDisplacementY;\n }", "findCenter() {\n return {\n x: (this.right - this.left)/2 + this.left,\n y: (this.bottom - this.top)/2 + this.top\n };\n }", "calculateAtDesiredPos() {\n let counter = 0;\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n if (this.isAtDesiredPos([i, j], this.board[i][j])) counter++;\n }\n }\n return counter;\n }", "function placePieceForSearch(row, col, color, board){\n //start and end are arrays with the starting and ending indices of the pieces boxing in those to be changed\n if(color == \"white\")\n { \n board[row][col] = nextwhitePieceId;\n nextwhitePieceId+=2; \n }\n else{\n \n board[row][col] = nextblackPieceId;\n nextblackPieceId+=2;\n } \n replaceMiddlePiecesForSearch(row,col)\n}", "leg(loc, x, y, start_val){\n\t\tvar cur_val = start_val\n\t\tvar stop = false\n\t\tvar check_loc = []\n\t\twhile(!stop){\n\t\t\tloc[0] += x\n\t\t\tloc[1] += y\n\n\t\t\t// I'm sure there is a mathish way to do this. I'm just lazy right now.\n\t\t\t// This sets up the cell coordinates to look at for an empty spot.\n\t\t\tif(y == -1){\n\t\t\t\tcheck_loc[0] = loc[0] - 1\n\t\t\t\tcheck_loc[1] = loc[1]\n\t\t\t}else if (x == -1) {\n\t\t\t\tcheck_loc[0] = loc[0]\n\t\t\t\tcheck_loc[1] = loc[1] + 1\n\t\t\t}else if (y == 1){\n\t\t\t\tcheck_loc[0] = loc[0] + 1\n\t\t\t\tcheck_loc[1] = loc[1]\n\t\t\t}else{\n\t\t\t\tcheck_loc[0] = loc[0]\n\t\t\t\tcheck_loc[1] = loc[1] - 1\n\t\t\t}\n\n\t\t\tcur_val += 1\n\t\t\tif(this.tbl.rows.length - 1 < loc[1] || this.tbl.rows[loc[1]].cells.length - 1 < loc[0]){\n\t\t\t\tthrow new RangeError(\"outta room\")\n\t\t\t}\n\t\t\tthis.tbl.rows[loc[1]].cells[loc[0]].innerHTML = cur_val\n\t\t\t// give a faint crosshair so we can find the center on larger blocks.\n\t\t\tif(loc[0] == this.center || loc[1] == this.center){\n\t\t\t\tthis.tbl.rows[loc[1]].cells[loc[0]].style.backgroundColor = \"#DDDDDD\"\n\t\t\t}\n\t\t\tthis.formatPrime(loc[0], loc[1])\n\t\t\tstop = this.tbl.rows[check_loc[1]].cells[check_loc[0]].innerHTML == this.filler\n\t\t}\n\n\t\treturn cur_val\n\t}", "function northeast(n) {\n var level = bottoms[n];\n var count = 0;\n\n for (var i = 1; ((n + i) <= 6) && ((level - i) >= 0); i++) {\n var square = document.getElementsByClassName(\"row\").item(level - i)\n .getElementsByClassName(\"bigSquare\").item(n + i);\n if (square.style.backgroundColor == color(currentTurn)) {\n count++;\n }\n else return count;\n }\n return count;\n }", "calcCoordsForCenter(tileRow, tileCol, width, height, tileSize) {\n const tileXCenter = tileSize * (tileCol + 0.5);\n const tileYCenter = tileSize * (tileRow + 0.5);\n const dstX = tileXCenter - width * 0.5;\n const dstY = tileYCenter - height * 0.5;\n return [dstX, dstY];\n }", "getBlockIndex(screenX, screenY) {\n let col = Math.floor(screenX * this.col / window.innerWidth);\n let row = Math.floor(screenY * this.row / window.innerHeight);\n return [row, col];\n }", "center() {\n let x_center = 0, y_center = 0;\n const coords = this.getCoords();\n for (let axis = 0; axis < coords.length; axis ++) {\n let [i, j] = num_60rotations(2*axis);\n x_center += i * coords[axis];\n y_center += j * coords[axis];\n }\n return [x_center, y_center];\n }", "function calculateCentroidPositions() { // x location, y location, count, sum of square distances\n clearCentroidPositions();\n addupXYPositions();\n // scale sums by count....to calculate averages\n normalizeCentroidByColorTypeCount(colorCentroidStructure);\n sumOfSquares();\n }", "function bottom_Y(){\r\n\r\n\tvar imgd = ctx.getImageData(0,0, c.width,c.height);\r\n\t//var pix_array = imgd.data;\r\n\r\n\tfor(var y = c.height - 1; y >= 0 ; y--){\r\n\t\tfor(var x = 0; x < c.width; x++){\r\n\t\r\n\t\t\tvar index = (x + y * imgd.width) * 4;\r\n\r\n\t\t\tif(imgd.data[index+0] == 0 &&\r\n\t\t\t\timgd.data[index+1] == 0 &&\r\n\t\t\t\timgd.data[index+2] == 0){\r\n\t\t\t\t\r\n\r\n\t\t\t\t// if(seen == false){\r\n\t\t\t\t// \tconsole.log(\"bottom_Y is: \" + y);\r\n\t\t\t\t// \tseen = true;\r\n\t\t\t\t// }\r\n\r\n\t\t\t\treturn y;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// if(seen == false){\r\n\t// \tconsole.log(\"eek! error! Didn't see any black unfortunately.\");\r\n\t// \tseen = true;\r\n\t// }\r\n}", "tile_normalized_coord() {\n\t\tvar rect = this.canvas.getBoundingClientRect();\n\t\tvar x = this.cursor_x - rect.left + this.current_x;\n\t\tvar y = this.cursor_y - rect.top + this.current_y;\n\t\tvar row = y / this.tile_size;\n\t\tvar col = x / this.tile_size;\n\t\treturn [col, row]\n\t}", "function getCenter(character) {\n var index = (consonants.indexOf(character) % centers.length);\n return centers[index];\n}", "cell_centre_at_position(position) {\n return new Offset(\n this.cell_size(this.cell_width, position.x) / 2,\n this.cell_size(this.cell_height, position.y) / 2,\n );\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "function calculateColor(begin, end, pos) {\n var color = 'rgba('\n + parseInt((begin[0] + pos * (end[0] - begin[0])), 10) + ','\n + parseInt((begin[1] + pos * (end[1] - begin[1])), 10) + ','\n + parseInt((begin[2] + pos * (end[2] - begin[2])), 10);\n\n color += ',' + (begin && end ? parseFloat(begin[3] + pos * (end[3] - begin[3])) : 1);\n color += ')';\n return color;\n }", "centerPosition() {\n return [this.clientWidth() / 2, this.clientHeight() / 2, ];\n }", "function centerOf(text) {\n let center = Math.floor(text.length / 2);\n if (text.length % 2 === 1) {\n return text[center];\n }\n\n return text[center - 1] + text[center];\n}", "getStartingPosition() {\n const left = this.generateRandomPosition();\n\n // If the `left` value lies in the restricted range, then top cannot lie there.\n // This prevents streak generation with a certain radius from the center. (imporves aesthetic appeal)\n const restrictiveFlag =\n (left > Streak.positionLimits[this.attributes.type].lower) &&\n (left < Streak.positionLimits[this.attributes.type].upper)\n ;\n const top = this.generateRandomPosition(restrictiveFlag);\n\n return { left, top };\n }", "function countCoordinate (val){\n return (val * side ) + (side / 2);\n}", "function evaluate_corners () {\r\n\tfor (a = 0; a < 2; a++) {\r\n\t\tif (start[a] < end[a]) {\r\n\t\t\ttop_left[a] = start[a];\r\n\t\t\tbottom_right[a] = end[a];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttop_left[a] = end[a];\r\n\t\t\tbottom_right[a] = start[a];\r\n\t\t}\r\n\t}\r\n\trwidth = bottom_right[0] - top_left[0];\r\n\trheight = bottom_right[1] - top_left[1];\r\n\t// set text\r\n\ttlc.innerHTML = \"Top Left: [\" + top_left[0] + \",\" + top_left[1] + \"]\";\r\n\tbrc.innerHTML = \"Bottom Right: [\" + bottom_right[0] + \",\" + bottom_right[1] + \"]\";\r\n}", "function incrNeighbors(rC, cC) { // Center is at (rC, cC)\n for (var rN = rC+drA; rN <= rC+drB; rN++) { // Neighbor row\n for (var cN = cC+dcA; cN <= cC+dcB; cN++) { // Neighbor col\n if (! bMap[rN][cN]) { cMap[rN][cN]++; } // Increment non-mine pixels\n }\n }\n }", "function color_starting_square(ctx, num_canvas_cells, x_offset, y_offset)\r\n{\r\n ctx.save( );\r\n ctx.fillStyle = 'black';\r\n\r\n // rect(the x cord in the upper left corner, the y cord of the upper left rect, width, height)\r\n ctx.rect(x_offset + ((Math.floor(num_canvas_cells / 2) - 1) * 5), y_offset, 5, 5);\r\n ctx.fill();\r\n ctx.restore( );\r\n}", "function point2ColorPos(pt, imgSize) {\n return ((pt.y - 1) * imgSize.w * 4) + (pt.x * 4 - 4);\n}", "function drawCenterStars(num)\n{\n \n}", "function centerPosition(el) {\n var pageSize = getPageSize(),\n dim = el.getDimensions(),\n offsets = el.cumulativeOffset(),\n d = getImgSize(dim),\n\n top = (offsets.top + (pageSize.height - d.height) / 2),\n left = (offsets.left + (pageSize.width - d.width) / 2),\n right = (offsets.left + (pageSize.width + d.width) / 2);\n\n return {width: dim.width, height: dim.height, top: top, left: left, right: right}\n}", "function kMove(color, start, end) {\n var dif1 = start[0] - end[0];\n var dif2 = start[1] - end[1];\n \n if (Math.abs(dif1) >= 2 || Math.abs(dif2) >= 2) {\n return false;\n } else if (isSquareOccupied(end[0], end[1])) {\n return take(color, end[0], end[1]);\n }\n return true;\n}", "matchStartColor(pixelPos) {\n var pixelColor = this.getPixelColor(this.colorLayerData, pixelPos);\n var v = this.matchClickedColor(pixelColor.r, pixelColor.g, pixelColor.b, pixelColor.a);\n return v;\n }", "static CenteredPosition(position, out = new b2.Vec2()) {\n return out.Set(position.x + FrackerSettings.k_tileHalfWidth, position.y + FrackerSettings.k_tileHalfHeight);\n }", "function xyOffsetIndex(i, x, y, w, h) {\n var index = i + x + y * w;\n var absx = (i % w) + x;\n if (absx < 0 && index < 0 || absx >= w && index >= w * h) {\n return i - x - y * w;\n }\n if (absx < 0 || absx >= w) { // if off the left.\n return i - x + y * w;\n }\n //var absy = index - (w * y)\n if (index < 0 || index >= w * h) { // if off top/bottom.\n return i + x - y * w;\n }\n return index;\n}", "north(x,y,count){\r\n if(count >= 5){\r\n return true;\r\n }\r\n else if(y-1 >= 0 && this.getColor(x,y) === this.getColor(x,y-1)){//point must exist\r\n return this.north(x, y-1, count+1);\r\n }\r\n return(count >= 5);\r\n }", "function count_color(current_coordinate, desired_color, desired_direction, current_count) {\n\t\t\t\tlet next_coordinate = [current_coordinate[0] + desired_direction[0],\n\t\t\t\tcurrent_coordinate[1] + desired_direction[1]];\n\t\t\t\tconsole.log(next_coordinate);\n\t\t\t\tif (piece_position[next_coordinate[0]] && piece_position[next_coordinate[0]][next_coordinate[1]]) {\n\t\t\t\t\tif (piece_position[next_coordinate[0]][next_coordinate[1]].color != desired_color)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\tcurrent_count += 1;\n\t\t\t\t\tif (current_count == 3)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\treturn count_color(next_coordinate, desired_color, desired_direction, current_count);\n\t\t\t\t}\n\t\t\t\treturn current_count;\n\t\t\t}", "basePixelOffset(m, p, x, y, k) {\n\tvar t = this;\n\treturn ((m*(t.nplanes+1) + p)*t.resolution*t.resolution + (x + y*t.resolution))*3 + k;\n}", "function calculateCenter (array) {\n \n var x = 0, y = 0;\n\n array.forEach(function(point){\n x += point.x;\n y += point.y;\n });\n\n x = x / array.length;\n y = y / array.length;\n\n return {x: x,y: y};\n\n}", "function getOffset() {\n if (innerHeight < 600 || innerWidth < 1000) {\n return 105;\n }\n else {\n return 55;\n }\n}", "setCenter() {\n let x = 0;\n let y = 0;\n for (let v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n }", "function center(x1, y1, x2, y2, width, height) {\n\tif ((x1 >= x2 && x1 <= x2 + width))\n\t\tif ((y1 >= y2 && y1 <= y2 + height))\n\t\t\treturn true;\n\t\treturn false;\n}", "function getPixelRange() {\r\n\t\t$this = $['mapsettings'].element;\r\n\t\tvar xstart = 0;\r\n\t\tvar ystart = 0;\r\n\t\tif($['mapsettings'].initLeft<0) xstart = Math.abs($['mapsettings'].initLeft);\r\n\t\tif($['mapsettings'].initTop<0) ystart = Math.abs($['mapsettings'].initTop);\r\n\t\txstart = getFirstXPosInRange(xstart);\r\n\t\t// Makes sure that ystart values are multiples of 256 and start before viewport\r\n\t\tif(ystart%256!=0) ystart=((parseInt(ystart/256))-1)*256;\r\n\t\tvar xend = $this.innerWidth() - $['mapsettings'].initLeft;\r\n\t\tvar yend = $this.innerHeight() - $['mapsettings'].initTop;\r\n\t\treturn {\r\n\t\t\t\"start\": {\r\n\t\t\t\t\"x\": xstart,\r\n\t\t\t\t\"y\": ystart\r\n\t\t\t},\r\n\t\t\t\"end\": {\r\n\t\t\t\t\"x\": xend,\r\n\t\t\t\t\"y\": yend\r\n\t\t\t}\r\n\t\t};\r\n\t}", "function colorFigures(colors, current_position) {\n\n\tvar chosen_color;\n\t//console.log(current_position);\n\tvar left = current_position.indexOf(\"left\");\n\tvar right = current_position.indexOf(\"right\");\n\tvar center = current_position.indexOf(\"center\");\n\n\tif (left >= 0) {\n\n\t\tchosen_color = colors[0];\n\n\t} else if (right >= 0) {\n\n\t\tchosen_color = colors[1];\n\n\t} else if (center >= 0) {\n\n\t\tchosen_color = colors[2];\n\n\t}\n\n\treturn chosen_color;\n\n}", "function drawMiddlePartition() {\n for(let i = 5; i <= height; i+=30) {\n rect(400, i, 5, 20);\n fill(255, 255, 255);\n }\n}", "function midline()\r\n{\r\nfor(i=0;i<480;i+=10)\r\n{\r\nvar y = 0;\r\nfill(\"white\");\r\nstroke(0);\r\nrect(width/2,y+i,10,480);\r\n}\r\n}", "function findSquare(mazeimg, locations) {\n var x = locations[0].x;\n var y = locations[0].y;\n var color;\n var hexcolor;\n\n do {\n x--;\n hexcolor = mazeimg.getPixelColor(x, y);\n color = Jimp.intToRGBA(hexcolor);\n } while (color.r == 255 && color.g == 0 && color.b == 0);\n\n hexcolor = mazeimg.getPixelColor(x + 17, y);\n color = Jimp.intToRGBA(hexcolor);\n if (color.r == 255 && color.g == 0 && color.b == 0) {\n x += 1;//move back inside the red square\n do {\n y--;\n hexcolor = mazeimg.getPixelColor(x, y);\n color = Jimp.intToRGBA(hexcolor);\n } while (color.r == 255 && color.g == 0 && color.b == 0);\n\n hexcolor = mazeimg.getPixelColor(x, y + 17);\n color = Jimp.intToRGBA(hexcolor);\n if (color.r == 255 && color.g == 0 && color.b == 0) {\n //location 1 is the square\n console.log(\"found Start (circle) at \", locations[1]);\n console.log(\"found End (square) at \", locations[0]);\n return 1;\n }\n }\n //didnt find square at location 1 so it must be location 2\n console.log(\"found Start (circle) at \", locations[0]);\n console.log(\"found End (square) at \", locations[1]);\n\n return 0;\n}", "function sizeOfBlackWhiteBlackRunBothWays(fromX, fromY, toX, toY, image) {\r\n\t\t var result = sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image);\r\n\t\t // Now count other way -- don't run off image though of course\r\n\t\t var scale = 1;\r\n\t\t var otherToX = fromX - (toX - fromX);\r\n\t\t if (otherToX < 0) {\r\n\t\t scale = fromX / (fromX - otherToX);\r\n\t\t otherToX = 0;\r\n\t\t }\r\n\t\t else if (otherToX >= image.width) {\r\n\t\t scale = (image.width - 1 - fromX) / (otherToX - fromX);\r\n\t\t otherToX = image.width - 1;\r\n\t\t }\r\n\t\t var otherToY = (fromY - (toY - fromY) * scale);\r\n\t\t scale = 1;\r\n\t\t if (otherToY < 0) {\r\n\t\t scale = fromY / (fromY - otherToY);\r\n\t\t otherToY = 0;\r\n\t\t }\r\n\t\t else if (otherToY >= image.height) {\r\n\t\t scale = (image.height - 1 - fromY) / (otherToY - fromY);\r\n\t\t otherToY = image.height - 1;\r\n\t\t }\r\n\t\t otherToX = (fromX + (otherToX - fromX) * scale);\r\n\t\t result += sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY, image);\r\n\t\t return result - 1; // -1 because we counted the middle pixel twice\r\n\t\t}", "function getTileIndexes(x, y) {\r\n \r\n var l = Math.floor(x/(w_tuile + padding));\r\n var c = Math.floor(y/(h_tuile + padding));\r\n var pad_x = x - l*(w_tuile + padding);\r\n var pad_y = y - c*(h_tuile + padding);\r\n \r\n console.log(pad_x +\" , \" + pad_y);\r\n \r\n if(pad_x < padding/2 || pad_x > w_tuile+padding/2) {\r\n \treturn null;\r\n }\r\n \r\n if(pad_y < padding/2 || pad_y > h_tuile+padding/2) {\r\n \treturn null;\r\n }\r\n \r\n console.log(\"C = \" + c + \", L = \" + l);\r\n return {i: c, j: l};\r\n}", "setCenter() {\n let x = 0;\n let y = 0;\n for (var v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n\n }", "function ComputeOutCode(x, y, xmin, ymin, xmax, ymax)\n{\n var code;\n\n code = INSIDE; // initialised as being inside of [[clip window]]\n\n if (x < xmin) // to the left of clip window\n code |= LEFT;else\n if (x > xmax) // to the right of clip window\n code |= RIGHT;\n if (y < ymin) // below the clip window\n code |= BOTTOM;else\n if (y > ymax) // above the clip window\n code |= TOP;\n\n return code;\n}", "centre_offset_from_position(position) {\n const offset = this.offset_from_position(position);\n const centre = this.cell_centre_at_position(position);\n return offset.add(centre);\n }", "function east(n) {\n var level = bottoms[n];\n var count = 0;\n\n for (var i = 1; (n + i) <= 6; i++) {\n var square = document.getElementsByClassName(\"row\").item(level)\n .getElementsByClassName(\"bigSquare\").item(n + i);\n if (square.style.backgroundColor == color(currentTurn)) {\n count++;\n }\n else return count;\n }\n return count;\n }", "blocksTravelled(){\n let horizontal = Math.abs(eastWest.indexOf(this.beginningLocation.horizontal) - eastWest.indexOf(this.endingLocation.horizontal))\n let vertical = Math.abs(parseInt(this.beginningLocation.vertical)-parseInt(this.endingLocation.vertical))\n return (horizontal + vertical);\n }", "getEndPosition(widget) {\n let left = widget.x;\n let top = widget.y;\n let lineWidget = undefined;\n if (widget.childWidgets.length > 0) {\n lineWidget = widget.childWidgets[widget.childWidgets.length - 1];\n left += this.getWidth(lineWidget, false);\n }\n if (!isNullOrUndefined(lineWidget)) {\n top = this.getTop(lineWidget);\n }\n let topMargin = 0;\n let bottomMargin = 0;\n let size = this.getParagraphMarkSize(widget, topMargin, bottomMargin);\n return new Point(left, top + size.topMargin);\n }", "function scanCircle(x, y, h, k, setPixel) {\n // top-right quad\n drawVertical(x + h, y + h, y + k, setPixel);\n drawHorizontal(x + h + 1, x + k, y + h, setPixel);\n // bottom-left quad\n const yOff = h == 0 ? -1 : 0;\n drawVertical(x - h, y - k, y - h + yOff, setPixel);\n drawHorizontal(x - k, x - h - 1, y - h, setPixel);\n\n // don't repeat on axes\n if(h > 0) {\n // top-left quad\n drawVertical(x - h, y + h, y + k, setPixel);\n drawHorizontal(x - k, x - h - 1, y + h, setPixel);\n // bottom-right quad\n drawVertical(x + h, y - k, y - h, setPixel);\n drawHorizontal(x + h + 1, x + k, y - h, setPixel);\n }\n}", "function getCentreX(array) {\n const len = array.length;\n\n if (len % 2 === 0) {\n const secondI = len / 2;\n const second = array[secondI];\n\n const firstI = secondI - 1;\n const first = array[firstI];\n\n if (first > second)\n return firstI;\n\n return secondI;\n }\n\n return (len - 1) / 2;\n }", "function calcCenter(){\r\n\t\tvar i;\r\n\t\tvar latAverage = 0;\r\n\t\tfor(i = 0; i < latArray.length; i++){\r\n\t\t\tlatAverage = latAverage + latArray[i];\r\n\t\t}\r\n\t\tlatAverage = latAverage/latArray.length;\r\n\t\t\r\n\t\tfor(i = 0; i < lonArray.length; i++){\r\n\t\t\tlonAverage = lonAverage + lonArray[i];\r\n\t\t}\r\n\t\t\r\n\t\tlonAverage = lonAverage / lonArray.length;\r\n\t\t\r\n\t\t/*\r\n\t\t\tPrints the location out on the screen\r\n\t\t*/\r\n\t\t\r\n\t\tdocument.getElementById(\"latitudeDiv\").innerHTML = latAverage;\r\n\t\tdocument.getElementById(\"longitudeDiv\").innerHTML = lonAverage;\r\n\t}", "function posforblock(block, axis, x, y) {\n var c = 3 * (block % 3);\n var r = (block - block % 3);\n if (axis == 0) { c += x; r += y; }\n else { c += y; r += x; }\n c = c % 9;\n r = r % 9;\n return r * 9 + c;\n}", "function posforblock(block, axis, x, y) {\n var c = 3 * (block % 3);\n var r = (block - block % 3);\n if (axis == 0) { c += x; r += y; }\n else { c += y; r += x; }\n c = c % 9;\n r = r % 9;\n return r * 9 + c;\n}", "function calculateMapTilePosition(){\n\t\tvar mnwCurrentView = $('mnwCurrentView');\n\t\tvar calcLeft = mnwCurrentView.style.left;\n\t\tvar calcTop = mnwCurrentView.style.top;\t\t\n\t\tvar c_top = Math.floor(VIEWPORT_HEIGHT/2);\n\t\tvar c_left = Math.floor(VIEWPORT_WIDTH/2);\n\t\tcalcLeft = calcLeft.replace('px','')*1;\n\t\tcalcTop = calcTop.replace('px','')*1;\n\t\tcalcLeft = calcLeft * mnwScale + c_left;\n\t\tcalcTop = calcTop * mnwScale + c_top;\n\t\tgoToMapPosition(calcTop,calcLeft);\n\t\tloadCurrentMapArea();\n\t}", "function calculateCenter(){\n center = map.getCenter();\n }", "function box_get_centroid(dst, dst_off, src, src_off) {\n\t dst[dst_off] = 0.5 * (src[src_off] + src[src_off + 3]);\n\t dst[dst_off + 1] = 0.5 * (src[src_off + 1] + src[src_off + 4]);\n\t dst[dst_off + 2] = 0.5 * (src[src_off + 2] + src[src_off + 5]);\n\t }", "function getRectCenterOffset(rect) {\n return { x: rect.width / 2, y: rect.height / 2 };\n }", "function virtical_location(y, sizey){\n\t \tif(((y+sizey)/tileHeight)%1 >= 0.5){\n\t \t\treturn Math.ceil((y+sizey)/tileHeight)+1\n\t \t} else {\n\t \t\treturn Math.floor((y+sizey)/tileHeight)+1;\n\t \t}\n\t }", "function findTargetSpots(cells, fromIndex) {\n if (cells[fromIndex.color] === \"\") {\n return []\n }\n\n let result = []\n\n const fromRow = Math.trunc(fromIndex / NO_COLS)\n const fromCol = fromIndex % NO_COLS\n\n // left\n let tmpCol = fromCol\n while (--tmpCol >= 0) {\n const tmpIdx = (fromRow * NO_COLS) + tmpCol\n if (cells[tmpIdx].color !== \"\") {\n if (tmpIdx + 1 !== fromIndex) {\n result.push(tmpIdx + 1)\n }\n break\n }\n }\n\n // right\n tmpCol = fromCol\n while (++tmpCol < NO_COLS) {\n const tmpIdx = (fromRow * NO_COLS) + tmpCol\n if (cells[tmpIdx].color !== \"\"){\n if (tmpIdx - 1 !== fromIndex) {\n result.push(tmpIdx - 1)\n }\n break\n }\n }\n\n // top\n let tmpRow = fromRow\n while (--tmpRow >= 0) {\n const tmpIdx = (tmpRow * NO_COLS) + fromCol\n if (cells[tmpIdx].color !== \"\") {\n if (tmpIdx + NO_COLS !== fromIndex) {\n result.push(tmpIdx + NO_COLS)\n }\n break\n }\n }\n\n // down\n tmpRow = fromRow\n while (++tmpRow < NO_ROWS) {\n const tmpIdx = (tmpRow * NO_COLS) + fromCol\n if (cells[tmpIdx].color !== \"\") {\n if (tmpIdx - NO_COLS !== fromIndex) {\n result.push(tmpIdx - NO_COLS)\n }\n break\n }\n }\n\n return result\n}", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function top_Y(){\r\n\r\n\tvar imgd = ctx.getImageData(0,0, c.width,c.height);\r\n\t//var pix_array = imgd.data;\r\n\r\n\tfor(var y = 0; y < c.height; y++){\r\n\t\tfor(var x = 0; x < c.width; x++){\r\n\r\n\t\t\tvar index = (x + y * imgd.width) * 4;\r\n\r\n\t\t\tif(imgd.data[index+0] == 0 &&\r\n\t\t\t\timgd.data[index+1] == 0 &&\r\n\t\t\t\timgd.data[index+2] == 0){\r\n\r\n\t\t\t\t// if(seen == false){\r\n\t\t\t\t// \tconsole.log(\"22top_Y is: \" + y);\r\n\t\t\t\t// \tseen = true;\r\n\t\t\t\t// }\r\n\r\n\t\t\t\treturn y;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// if(seen == false){\r\n\t// \tconsole.log(\"eek! error! Didn't see any black unfortunately.\");\r\n\t// \tseen = true;\r\n\t// }\r\n}", "getEndPosition() {\n const radius = (this.tunnelWidth - 1) / 2\n if (this.direction === 'NORTH') {\n return { x: this.x + radius, y: this.y }\n } else if (this.direction === 'SOUTH') {\n return { x: this.x + radius, y: (this.y + this.height) - 1 }\n } else if (this.direction === 'EAST') {\n return { x: (this.x + this.width) - 1, y: this.y + radius }\n } else if (this.direction === 'WEST') {\n return { x: this.x, y: this.y + radius }\n }\n return null\n }", "function computeDiscCoordinates(col, row) {\n let xpos = sizes.initialx + sizes.size / 2 + col * sizes.size;\n let ypos = sizes.initialy + sizes.ysize - sizes.size / 2 - row * sizes.size;\n return { x: xpos, y: ypos };\n}", "function getWithinFrame(i, x, y, frameWidth, frameHeight, totalWidth) {\n const row = Math.floor(i / 4 / totalWidth)\n const col = Math.floor(i / 4) % totalWidth\n if (col >= x && col < x + frameWidth && row >= y && row < y + frameHeight) {\n return ((row - y) * frameWidth + (col - x)) * 4\n }\n\n return -1\n}", "function squareCenterWin(){\n\n}", "function southeast(n) {\n var level = bottoms[n];\n var count = 0;\n\n for (var i = 1; ((n + i) <= 6) && ((level + i) <= 5); i++) {\n var square = document.getElementsByClassName(\"row\").item(level + i)\n .getElementsByClassName(\"bigSquare\").item(n + i);\n if (square.style.backgroundColor == color(currentTurn)) {\n count++;\n }\n else return count;\n }\n return count;\n }", "function getCenter(a, b) {\n return {\n x: (b.x + a.x) / 2,\n y: (b.y + a.y) / 2\n };\n}", "getPixelCoordsFromTileIndex(i) {\n return {\n x: (i % this.width.tiles) * this.tileSize,\n y: Math.floor(i / this.width.tiles) * this.tileSize\n };\n }", "function getMapCenterY()\r\n{\r\n\tvar frameY = getHeight()/2;\r\n\tvar mapTop = getMapTop();\r\n\treturn frameY - mapTop;\t\r\n}", "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "function highlightPawn(i,j) {\n\tif (isWhite) {\n\t\tif (j < 7) {\n\t\t\tif (lookupTile(2,i,j+1).piece == 'ee')\n\t\t\t\thighlight(i,j+1,true);\n\t\t\tif (i < 7) {\n\t\t\t\tif (lookupTile(2,i+1,j+1).piece.charAt(0) == 'b')\n\t\t\t\t\thighlight(i+1,j+1,false);\n\t\t\t}\n\t\t\tif (i > 0) {\n\t\t\t\tif (lookupTile(2,i-1,j+1).piece.charAt(0) == 'b')\n\t\t\t\t\thighlight(i-1,j+1,false);\n\t\t\t}\n\t\t\tif (j == 1 && lookupTile(2,i,j+2).piece == 'ee')\n\t\t\t\thighlight(i,j+2,true);\n\t\t}\n\t} else {\n\t\tif (j > 0) {\n\t\t\tif (lookupTile(2,i,j-1).piece == 'ee')\n\t\t\t\thighlight(i,j-1,true);\n\t\t\tif (i < 7) {\n\t\t\t\tif (lookupTile(2,i+1,j-1).piece.charAt(0) == 'w')\n\t\t\t\t\thighlight(i+1,j-1,false);\n\t\t\t}\n\t\t\tif (i > 0) {\n\t\t\t\tif (lookupTile(2,i-1,j-1).piece.charAt(0) == 'w')\n\t\t\t\t\thighlight(i-1,j-1,false);\n\t\t\t}\n\t\t\tif (j == 6 && lookupTile(2,i,j-2).piece == 'ee')\n\t\t\t\thighlight(i,j-2,true);\n\t\t}\n\t}\n}", "function getSurroundingXCount(x, y, type){\n\t\tvar count =0;\n\t\t\tfor(var i =x-1; i <= x+1 ; i++){\n\t\t\t\tfor(var j = y-1; j<= y+1; j++){\n\t\t\t\t\tif( i >= 0 && i < tileWidth && j >= 0 && j < tileHeight){\n\t\t\t\t\t\tif( i != x || j != y){\n\t\t\t\t\t\t\tif(tiles[i][j] == type){\n\t\t\t\t\t\t\t\tcount ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn count;\n}", "function getMatchVerticalOffset(matchCount, currentRound) {\n return 1 / (matchCount / currentRound);\n}", "startCursorBlinking: () => void,\n stopCursorBlinking(): void,\n pixelPositionForScreenPosition(\n screenPosition: atom$Point,\n clip?: boolean,\n ): {top: number, left: number},", "function countNeighbours(centerX, centerY, searchSize) {\n\n var numCellsCounted = 0;\n var numNeighbours = 0;\n\n for (let xOffset = -searchSize; xOffset <= searchSize; xOffset++) {\n for (let yOffset = -searchSize; yOffset <= searchSize; yOffset++) {\n if (xOffset != 0 || yOffset != 0) { \n var xSamp = centerX + xOffset;\n var ySamp = centerY + yOffset;\n\n if (xSamp >= 0 && xSamp < cols && ySamp > 0 && ySamp < rows) {\n if (pPuffs[xSamp][ySamp]){\n numNeighbours += 1;\n }\n numCellsCounted += 1;\n }\n }\n }\n }\n\n return numNeighbours / numCellsCounted;\n}", "function pixelDist() {\r\n\tvar min = bounds.getSouthWest();\r\n\tvar max = bounds.getNorthEast();\r\n\t\r\n\tvar x = Math.abs(max.lng() - min.lng())/dojo.contentBox(\"map_canvas\").w;\r\n\tvar y = Math.abs(max.lat() - min.lat())/dojo.contentBox(\"map_canvas\").h;\r\n\t\r\n\tvar r = Math.pow(10,7);\r\n\tpixels = {\"x\": Math.round(x*r)/r, \"y\": Math.round(y*r)/r};\r\n}", "function findCord(x, y) \n{\n\tif (0<= x && x <= 1/3*width) {\n\t\tcord = 0;\n\t}\n\telse if (1/3*width<= x && x <= 2/3*width) \n\t{\n\t\tcord = 1;\n\t}\n\telse if (2/3*width<= x && x <= 3*width) \n\t{\n\t\tcord = 2;\n\t}\n\t\n\treturn cord;\n}", "function computeCenter(rect) {\n return {\n top: rect.top + (rect.height / 2),\n left: rect.left + (rect.width / 2)\n };\n}" ]
[ "0.6693089", "0.626105", "0.60249573", "0.5923096", "0.57945", "0.5737114", "0.5688535", "0.5610086", "0.5545497", "0.5544482", "0.53885883", "0.53602487", "0.5351306", "0.5348422", "0.5330814", "0.53264034", "0.52810115", "0.5271384", "0.525986", "0.52412474", "0.52239156", "0.5222474", "0.5211858", "0.5209493", "0.5142753", "0.5138094", "0.51311696", "0.51246244", "0.51151663", "0.5113628", "0.5110333", "0.51078206", "0.51061636", "0.5088218", "0.5088218", "0.5088218", "0.50880224", "0.5079671", "0.5076894", "0.5076297", "0.5075524", "0.507364", "0.50733393", "0.5071436", "0.5063268", "0.50607383", "0.5049514", "0.5040129", "0.5034161", "0.503329", "0.5022962", "0.5017822", "0.50075597", "0.5007471", "0.49968287", "0.49921528", "0.49757376", "0.49745518", "0.4971264", "0.4967583", "0.49656963", "0.49547", "0.49514517", "0.494932", "0.49421373", "0.4941625", "0.49380267", "0.493594", "0.4935811", "0.49334016", "0.49227202", "0.4916759", "0.49161297", "0.49154067", "0.49154067", "0.4914121", "0.49094832", "0.49093124", "0.49083483", "0.49017385", "0.48992994", "0.48956022", "0.4886952", "0.48839158", "0.48809078", "0.4880727", "0.48785585", "0.48751155", "0.48737448", "0.4863993", "0.4861641", "0.48553047", "0.48517808", "0.48511276", "0.48481736", "0.48466423", "0.48457894", "0.48446998", "0.48430583", "0.484293" ]
0.6282014
1
After a horizontal scan finds a potential alignment pattern, this method "crosschecks" by scanning down vertically through the center of the possible alignment pattern to see if the same proportion is detected. startI row where an alignment pattern was detected centerJ center of the section that appears to cross an alignment pattern maxCount maximum reasonable number of modules that should be observed in any reading state, based on the results of the horizontal scan originalStateCountTotal The original state count total
function crossCheckVertical(startI, centerJ, maxCount, originalStateCountTotal, moduleSize, image) { var maxI = image.height; var stateCount = [0, 0, 0]; // Start counting up from center var i = startI; while (i >= 0 && image.get(centerJ, i) && stateCount[1] <= maxCount) { stateCount[1]++; i--; } // If already too many modules in this state or ran off the edge: if (i < 0 || stateCount[1] > maxCount) { return null; } while (i >= 0 && !image.get(centerJ, i) && stateCount[0] <= maxCount) { stateCount[0]++; i--; } if (stateCount[0] > maxCount) { return null; } // Now also count down from center i = startI + 1; while (i < maxI && image.get(centerJ, i) && stateCount[1] <= maxCount) { stateCount[1]++; i++; } if (i == maxI || stateCount[1] > maxCount) { return null; } while (i < maxI && !image.get(centerJ, i) && stateCount[2] <= maxCount) { stateCount[2]++; i++; } if (stateCount[2] > maxCount) { return null; } var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) { return null; } return foundPatternCross(stateCount, moduleSize) ? centerFromEnd(stateCount, i) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handlePossibleCenter(stateCount, i, j, moduleSize) {\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t var centerJ = centerFromEnd(stateCount, j);\r\n\t\t if (centerJ == null) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var centerI = crossCheckVertical(i, Math.floor(centerJ), 2 * stateCount[1], stateCountTotal, moduleSize, image);\r\n\t\t if (centerI != null) {\r\n\t\t var estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3;\r\n\t\t for (var i2 in possibleCenters) {\r\n\t\t var center = possibleCenters[i2];\r\n\t\t // Look for about the same center and module size:\r\n\t\t if (aboutEquals(center, estimatedModuleSize, centerI, centerJ)) {\r\n\t\t return combineEstimate(center, centerI, centerJ, estimatedModuleSize);\r\n\t\t }\r\n\t\t }\r\n\t\t // Hadn't found this before; save it\r\n\t\t var point = { x: centerJ, y: centerI, estimatedModuleSize: estimatedModuleSize };\r\n\t\t possibleCenters.push(point);\r\n\t\t }\r\n\t\t return null;\r\n\t\t }", "readCodewords() {\n let width = this.bitMatrix.getWidth();\n let height = this.bitMatrix.getHeight();\n\n this.erasures = new Array(MAX_CW_CAPACITY);\n\n for (let k = 0; k < this.erasures.length; k++) {\n this.erasures[k] = 0;\n }\n\n // Get the number of pixels in a module across the X dimension\n //float moduleWidth = bitMatrix.getModuleWidth();\n let moduleWidth = 1.0; // Image has been sampled and reduced\n let rowCounters = new Array(width);\n\n for (let n = 0; n < rowCounters.length; n++) {\n rowCounters[n] = 0;\n }\n\n let codewords = new Array(MAX_CW_CAPACITY);\n\n for (let m = 0; m < codewords.length; m++) {\n codewords[m] = 0;\n }\n\n let next = 0;\n let matchingConsecutiveScans = 0;\n let rowInProgress = false;\n let rowNumber = 0;\n let rowHeight = 0;\n\n for (let i = 1; i < height; i++) {\n if (rowNumber >= MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n let rowDifference = 0;\n // Scan a line of modules and check the\n // difference between this and the previous line\n for (let j = 0; j < width; j++) {\n // Accumulate differences between this line and the\n // previous line.\n if (this.bitMatrix._get(j, i) != this.bitMatrix._get(j, i - 1)) {\n rowDifference++;\n }\n }\n\n if (rowDifference <= moduleWidth * this.MAX_ROW_DIFFERENCE) {\n for (let j2 = 0; j2 < width; j2++) {\n // Accumulate the black pixels on this line\n if (bitMatrix._get(j2, i)) {\n rowCounters[j2]++;\n }\n }\n // Increment the number of consecutive rows of pixels\n // that are more or less the same\n matchingConsecutiveScans++;\n // Height of a row is a multiple of the module size in pixels\n // Usually at least 3 times the module size\n if (matchingConsecutiveScans >= moduleWidth * 2) { // MGMG\n // We have some previous matches as well as a match here\n // Set processing a unique row.\n rowInProgress = true;\n }\n } else {\n if (rowInProgress) {\n // Process Row\n next = processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n if (next == -1) {\n // Something is wrong, since we have exceeded\n // the maximum columns in the specification.\n // TODO Maybe return error code\n return null;\n }\n // Reinitialize the row counters.\n for (let j3 = 0; j3 < rowCounters.length; j3++) {\n rowCounters[j3] = 0;\n }\n rowNumber++;\n rowHeight = 0;\n }\n matchingConsecutiveScans = 0;\n rowInProgress = false;\n }\n rowHeight++;\n }\n // Check for a row that was in progress before we exited above.\n if (rowInProgress) {\n // Process Row\n if (rowNumber >= this.MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n\n next = this.processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n rowNumber++;\n rows = rowNumber;\n }\n erasures = trimArray(erasures, eraseCount);\n return trimArray(codewords, next);\n }", "function AlignmentPatternFinder(image, startX\n /*int*/\n , startY\n /*int*/\n , width\n /*int*/\n , height\n /*int*/\n , moduleSize\n /*float*/\n , resultPointCallback) {\n _classCallCheck(this, AlignmentPatternFinder);\n\n this.image = image;\n this.startX = startX;\n this.startY = startY;\n this.width = width;\n this.height = height;\n this.moduleSize = moduleSize;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = []; // new Array<any>(5))\n // TYPESCRIPTPORT: array initialization without size as the length is checked below\n\n this.crossCheckStateCount = new Int32Array(3);\n }", "calculateAtDesiredPos() {\n let counter = 0;\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n if (this.isAtDesiredPos([i, j], this.board[i][j])) counter++;\n }\n }\n return counter;\n }", "function check_block() {\n var moved = false;\n reset_counts();\n check_counts(\"X\");\n\n if (countdiag1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + i);\n }\n }\n if (countdiag2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 2 + 2);\n }\n }\n if (countrow0 == 2) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i);\n }\n }\n if (countrow1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(3 + i);\n }\n }\n if (countrow2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(6 + i);\n }\n }\n if (countcol0 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3);\n }\n }\n if (countcol1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 1);\n }\n }\n if (countcol2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 2);\n }\n }\n return moved;\n}", "drawAlignmentPattern(x, y) {\n let i;\n let j;\n for (i = x - 2, j = y - 2; i < x + 3; i++, j++) {\n this.mModuleValue[i][y - 2].isBlack = true;\n this.mModuleValue[i][y - 2].isFilled = true;\n this.mModuleValue[i][y + 2].isBlack = true;\n this.mModuleValue[i][y + 2].isFilled = true;\n this.mModuleValue[x - 2][j].isBlack = true;\n this.mModuleValue[x - 2][j].isFilled = true;\n this.mModuleValue[x + 2][j].isBlack = true;\n this.mModuleValue[x + 2][j].isFilled = true;\n }\n for (i = x - 1, j = y - 1; i < x + 2; i++, j++) {\n this.mModuleValue[i][y - 1].isBlack = false;\n this.mModuleValue[i][y - 1].isFilled = true;\n this.mModuleValue[i][y + 1].isBlack = false;\n this.mModuleValue[i][y + 1].isFilled = true;\n this.mModuleValue[x - 1][j].isBlack = false;\n this.mModuleValue[x - 1][j].isFilled = true;\n this.mModuleValue[x + 1][j].isBlack = false;\n this.mModuleValue[x + 1][j].isFilled = true;\n }\n this.mModuleValue[x][y].isBlack = true;\n this.mModuleValue[x][y].isFilled = true;\n }", "function foundPatternCross(stateCount, moduleSize) {\r\n\t\t var maxVariance = moduleSize / 2;\r\n\t\t for (var i = 0; i < 3; i++) {\r\n\t\t if (Math.abs(moduleSize - stateCount[i]) >= maxVariance) {\r\n\t\t return false;\r\n\t\t }\r\n\t\t }\r\n\t\t return true;\r\n\t\t}", "computeGrids(){\n // Fill in the first row\n for (let j = 1; j < this.jMax; j++) {\n this.grid[0][j] = this.grid[0][j-1] + this.gap_penalty;\n this.tracebackGrid[0][j] = [false, false, true];\n }\n\n // Fill in the first column\n for (let i = 1; i < this.iMax; i++) {\n this.grid[i][0] = this.grid[i-1][0] + this.gap_penalty;\n this.tracebackGrid[i][0] = [false, true, false];\n }\n\n // Fill the rest of the grid\n for(let i = 1; i < this.iMax; i++){\n for(let j = 1; j < this.jMax; j++){\n // Find the max score(s) among [`Diag`, `Up`, `Left`]\n let diag;\n if(this.sequence1[i-1] === this.sequence2[j-1])\n diag = this.grid[i-1][j-1] + this.match_score;\n else\n diag = this.grid[i-1][j-1] + this.mismatch_penalty;\n\n let up = this.grid[i-1][j] + this.gap_penalty;\n let left = this.grid[i][j-1] + this.gap_penalty;\n\n // If there exists multiple max values, capture them for multiple paths\n let maxOf = [diag,up,left];\n let indices = this.arrayAllMaxIndexes(maxOf);\n\n // Update Grids\n this.grid[i][j] = maxOf[indices[0]];\n this.tracebackGrid[i][j] = [indices.includes(0), indices.includes(1), indices.includes(2)];\n }\n }\n\n // Update alignment score\n this.score = this.grid[this.iMax-1][this.jMax-1];\n }", "function AlignmentPattern(posX, posY, estimatedModuleSize)\r\n{\r\n\tthis.x=posX;\r\n\tthis.y=posY;\r\n\tthis.count = 1;\r\n\tthis.estimatedModuleSize = estimatedModuleSize;\r\n\t\r\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\r\n\t{\r\n\t\treturn this.estimatedModuleSize;\r\n\t}); \r\n\tthis.__defineGetter__(\"Count\", function()\r\n\t{\r\n\t\treturn this.count;\r\n\t});\r\n\tthis.__defineGetter__(\"X\", function()\r\n\t{\r\n\t\treturn Math.floor(this.x);\r\n\t});\r\n\tthis.__defineGetter__(\"Y\", function()\r\n\t{\r\n\t\treturn Math.floor(this.y);\r\n\t});\r\n\tthis.incrementCount = function()\r\n\t{\r\n\t\tthis.count++;\r\n\t}\r\n\tthis.aboutEquals=function( moduleSize, i, j)\r\n\t\t{\r\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\r\n\t\t\t{\r\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\r\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n}", "getAlignmentPatternCoOrdinates() {\n let allign = null;\n switch ((this.mVersion)) {\n case 2:\n allign = [6, 18];\n break;\n case 3:\n allign = [6, 22];\n break;\n case 4:\n allign = [6, 26];\n break;\n case 5:\n allign = [6, 30];\n break;\n case 6:\n allign = [6, 34];\n break;\n case 7:\n allign = [6, 22, 38];\n break;\n case 8:\n allign = [6, 24, 42];\n break;\n case 9:\n allign = [6, 26, 46];\n break;\n case 10:\n allign = [6, 28, 50];\n break;\n case 11:\n allign = [6, 30, 54];\n break;\n case 12:\n allign = [6, 32, 58];\n break;\n case 13:\n allign = [6, 34, 62];\n break;\n case 14:\n allign = [6, 26, 46, 66];\n break;\n case 15:\n allign = [6, 26, 48, 70];\n break;\n case 16:\n allign = [6, 26, 50, 74];\n break;\n case 17:\n allign = [6, 30, 54, 78];\n break;\n case 18:\n allign = [6, 30, 56, 82];\n break;\n case 19:\n allign = [6, 30, 58, 86];\n break;\n case 20:\n allign = [6, 34, 62, 90];\n break;\n case 21:\n allign = [6, 28, 50, 72, 94];\n break;\n case 22:\n allign = [6, 26, 50, 74, 98];\n break;\n case 23:\n allign = [6, 30, 54, 78, 102];\n break;\n case 24:\n allign = [6, 28, 54, 80, 106];\n break;\n case 25:\n allign = [6, 32, 58, 84, 110];\n break;\n case 26:\n allign = [6, 30, 58, 86, 114];\n break;\n case 27:\n allign = [6, 34, 62, 90, 118];\n break;\n case 28:\n allign = [6, 26, 50, 74, 98, 122];\n break;\n case 29:\n allign = [6, 30, 54, 78, 102, 126];\n break;\n case 30:\n allign = [6, 26, 52, 78, 104, 130];\n break;\n case 31:\n allign = [6, 30, 56, 82, 108, 134];\n break;\n case 32:\n allign = [6, 34, 60, 86, 112, 138];\n break;\n case 33:\n allign = [6, 30, 58, 86, 114, 142];\n break;\n case 34:\n allign = [6, 34, 62, 90, 118, 146];\n break;\n case 35:\n allign = [6, 30, 54, 78, 102, 126, 150];\n break;\n case 36:\n allign = [6, 24, 50, 76, 102, 128, 154];\n break;\n case 37:\n allign = [6, 28, 54, 80, 106, 132, 158];\n break;\n case 38:\n allign = [6, 32, 58, 84, 110, 136, 162];\n break;\n case 39:\n allign = [6, 26, 54, 82, 110, 138, 166];\n break;\n case 40:\n allign = [6, 30, 58, 86, 114, 142, 170];\n break;\n }\n return allign;\n }", "function patternCheckOrientation(pattern, targetCell, qualityGoal, weight, orientation) {\n var forwardFacingCells = FWD_CELLS[targetCell];\n var totalDiscrepancies = 0;\n DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"Enter pCO([\" + pattern + \"]; \" + targetCell + \", \" + qualityGoal + \", \" + weight + \", \" + orientation + \"); compass: \" + compass);\n fwdWrong = [];\n rearWrong = [];\n if ((Array.isArray(pattern[POS_CENTER]) && !pattern[POS_CENTER][myColor]) ||\n\t((pattern[POS_CENTER] > 0) && (myColor != pattern[POS_CENTER]))) {\n\tif (forwardFacingCells[POS_CENTER]) { // always true, in fact\n\t fwdWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += 1;\n\t} else {\n\t rearWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += weight;\n\t}\n }\n if ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\tDEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\treturn PAT_NOMATCH;\n }\n var jFrom = 0;\n switch (targetCell) {\n case AIM_UP:\n\tjFrom = 4;\n\tbreak;\n case AIM_LEFT:\n\tjFrom = 6;\n\tbreak;\n case AIM_RIGHT:\n\tjFrom = 2;\n\tbreak;\n case AIM_DOWN:\n case POS_CENTER:\n default:\n\tbreak;\n }\n for (var j = jFrom; j < TOTAL_NBRS + jFrom; j++) {\n\tvar posP = CCW[j];\n\tvar posV = CCW[orientation + j];\n\tvar c = view[posV].color;\n\tif ((Array.isArray(pattern[posP]) && !pattern[posP][c]) ||\n\t ((pattern[posP] > 0) && (c != pattern[posP]))) {\n\t if (forwardFacingCells[posP]) {\n\t\tfwdWrong.push({p:posP, v:posV});\n\t\t// #future# If it should ever be needed, we could push j as a\n\t\t// third member of these objects (its absence indicating the\n\t\t// center cell).\n\t\ttotalDiscrepancies += 1;\n\t } else {\n\t\trearWrong.push({p:posP, v:posV});\n\t\ttotalDiscrepancies += weight;\n\t }\n\t}\n\tif ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\t DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\t return PAT_NOMATCH;\n\t}\n }\n // Assert: totalDiscrepancies == fwdWrong.length + rearWrong.length;\n // Assert: If compass < 0, then totalDiscrepancies <= qualityGoal\n debugme(\"-> total \" + totalDiscrepancies + \" weighted discrepancies found.\");\n if ((compass < 0)\n\t// && (totalDiscrepancies <= qualityGoal)\n ) {\n\tcompass = orientation;\n }\n if (DEBUGME[myType]) {\n\t// Bypass the single-arg debugme() in order to get the objects printed.\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"forwardD: [\", fwdWrong, \"]\");\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"rearD: [\", rearWrong, \"]\");\n }\n if (fwdWrong.length == 0) {\n\treturn (totalDiscrepancies);\n } else {\n\treturn (-totalDiscrepancies);\n }\n}", "step() {\n // Fill the offscreen buffer with the next cca generation built\n // from the current buffer.\n\n let backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n let currentBuffer = this.buffer[this.currentBufferIndex];\n let backBuffer = this.buffer[backBufferIndex];\n\n // See if we have a neighbor to infect this one\n function hasInfectiousNeighbor(x, y) {\n const nextValue = (currentBuffer[y][x] + 1) % MODULO;\n\n // Check the west neighbor of cell x, y\n /*if (x > 0) {\n if (currentBuffer[y][x - 1] === nextValue) {\n return true;\n }\n }*/\n\n // North\n if (y > 0) {\n if (currentBuffer[y - 1][x] === nextValue) {\n return true;\n }\n }\n\n // East\n if (x < this.width - 1) {\n if (currentBuffer[y][x + 1] === nextValue) {\n return true;\n }\n }\n\n // South\n if (y < this.height - 1) {\n if (currentBuffer[y + 1][x] === nextValue) {\n return true;\n }\n }\n\n // If we've made it this far we're not infected!\n return false;\n }\n\n // Loop through and decide the state of the next generation\n // for each cell processed.\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n if (hasInfectiousNeighbor.call(this, x, y)) {\n backBuffer[y][x] = (currentBuffer[y][x] + 1) % MODULO;\n } else {\n backBuffer[y][x] = currentBuffer[y][x];\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function lookAheadCount(nfa, testCombineIndex)\n{ var testString=inputString.value;// var s=inputString.value; \n var localCombineIndex={\n localIndex:[],\n localFinalIndex:[]\n\n };\nlocalCombineIndex.localIndex=testCombineIndex.myIndex;\n//localCombineIndex.myFinalIndex=testCombineIndex.myFinalIndex;\n var CurrentActive=[];\n var NextActive=[];\n var MatchCount=0;\n var temp=[];\n \n CurrentActive=_.union(CurrentActive, nfa.states);\n for(var i=0; i<testString.length-1; i=i+1)\n { for(var j=0; j<CurrentActive.length; j++)\n {\n if(CurrentActive[j]==0)\n continue;\n var t=localCombineIndex.localIndex[CurrentActive[j]][testString[i]][testString[i+1]];\n NextActive=_.union(NextActive, t);\n }\n\n // console.log(\"check1: \"+CurrentActive);\n \n temp=_.intersection(NextActive, [0]);\n if(temp[0]!=0)\n {\n MatchCount = MatchCount+1;\n }\n\n \n CurrentActive=NextActive;\n // console.log(\"count: \"+MatchCount);\n NextActive=[];\n }\n // var FinalDest=[];\n // console.log(\"temp0: \"+ temp);\n var bValue=false;\n if(MatchCount==testString.length-1 )\n {\n for(var k=0; k<CurrentActive.length; k++)\n {\n for(var l=0; l<nfa.trans.length; l++)\n {\n if(nfa.trans[l].src==CurrentActive[k] && nfa.trans[l].ch==testString[testString.length-1])\n {\n if(_.contains(nfa.trans[l].dest, 0))\n {\n bValue=true;\n break;\n \n }\n }\n }\n }\n\n } \n ///Print final value: \nconsole.log(\"Match or not: \"+bValue);\n}", "getNextValidPosition(inX, inY, state, stateHoriz, stateVert, currWord, lastOrientation){\n let valid = false;\n let currX = -1;\n let currY = -1;\n let newX = -1;\n let newY = -1;\n let partialScore = 0;\n\n let x = -1;\n let y = -1;\n let res = null;\n let flagBreak = false;\n if (lastOrientation == VERTICAL){\n inY = inY + 1;\n lastOrientation = null;\n }\n let currPosLetter = null;\n for (y = inY; y < state.sizeY; y++) { \n for (x = inX; x < state.sizeX; x++) {\n // Simple first test, to see if the position can be used, and cut the processing weight.\n // We will see if the position is not Empty and if it has a different letter then our first letter.\n currPosLetter = state.board[x][y];\n if ( (currPosLetter != EMPTY) && currPosLetter != currWord[0] ){\n continue;\n }\n if ((lastOrientation == null) || (lastOrientation != HORIZONTAL)){\n // Generate Horizontally placement.\n lastOrientation = HORIZONTAL;\n // Test if word can fit horizontally until the end.\n if (x < state.sizeX - currWord.length){\n [res, partialScore] = this.canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n if (lastOrientation == HORIZONTAL){\n // Generate Vertical placement.\n lastOrientation = VERTICAL;\n // Test if word can fit vertically until the bottom.\n if (y < state.sizeY - currWord.length){\n [res, partialScore] = this.canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n }\n if (flagBreak)\n break;\n }\n\n if ((res != null) && (res == true)){\n valid = true;\n currX = x;\n currY = y;\n newX = x;\n newY = y;\n }\n\n return [valid, currX, currY, newX, newY, lastOrientation, partialScore];\n }", "function findAlignmentInRegion(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor, image) {\r\n\t\t estAlignmentX = Math.floor(estAlignmentX);\r\n\t\t estAlignmentY = Math.floor(estAlignmentY);\r\n\t\t // Look for an alignment pattern (3 modules in size) around where it should be\r\n\t\t var allowance = Math.floor(allowanceFactor * overallEstModuleSize);\r\n\t\t var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\r\n\t\t var alignmentAreaRightX = Math.min(image.width, estAlignmentX + allowance);\r\n\t\t if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\r\n\t\t var alignmentAreaBottomY = Math.min(image.height - 1, estAlignmentY + allowance);\r\n\t\t return alignment_finder_1.findAlignment(alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, image);\r\n\t\t}", "function AlignmentPattern(posX, posY, estimatedModuleSize)\n{\n\tthis.x=posX;\n\tthis.y=posY;\n\tthis.count = 1;\n\tthis.estimatedModuleSize = estimatedModuleSize;\n\t\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\n\t{\n\t\treturn this.estimatedModuleSize;\n\t}); \n\tthis.__defineGetter__(\"Count\", function()\n\t{\n\t\treturn this.count;\n\t});\n\tthis.__defineGetter__(\"X\", function()\n\t{\n\t\treturn Math.floor(this.x);\n\t});\n\tthis.__defineGetter__(\"Y\", function()\n\t{\n\t\treturn Math.floor(this.y);\n\t});\n\tthis.incrementCount = function()\n\t{\n\t\tthis.count++;\n\t}\n\tthis.aboutEquals=function( moduleSize, i, j)\n\t\t{\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\n\t\t\t{\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\n}", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "function _tr_align() {\n\t\t send_bits(STATIC_TREES << 1, 3);\n\t\t send_code(END_BLOCK, StaticTree.static_ltree);\n\t\t bi_flush(); // Of the 10 bits for the empty block, we have already sent\n\t\t // (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t // the EOB of the previous block) was thus at least one plus the length\n\t\t // of the EOB plus what we have just sent of the empty static block.\n \n\t\t if (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t }\n \n\t\t last_eob_len = 7;\n\t\t} // Save the match info and tally the frequency counts. Return true if", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "check(x, y, board = this.map) {\n let color = board[y][x];\n if (color === \"⚪\") return 1;\n //horizontal\n if (\n this.search(x, y, color, 1, 0, 0) +\n this.search(x, y, color, -1, 0, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, 1, 1, 0) +\n this.search(x, y, color, -1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, -1, 1, 0) +\n this.search(x, y, color, 1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //vertical\n if (\n this.search(x, y, color, 0, 1, 0) +\n this.search(x, y, color, 0, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n\n // check how many pieces in a column\n let countstack = 0;\n for (let i = 0; i < 7; i++) {\n if (this.stack[i] === -1) {\n countstack++;\n }\n }\n\n // a column is full\n if (countstack === 7) return 3;\n\n return 1;\n }", "didWin(mark) {\n\n // premenne na vypocet znacky\n var vertical_count = 0,\n horizontal_count = 0,\n right_to_left_count = 0,\n left_to_right_count = 0;\n\n // Loop 1\n for (var i = 0; i < this.state.grid_size; i++) {\n\n\n vertical_count = 0;\n horizontal_count = 0;\n\n // Loop 2\n for (var j = 0; j < this.state.grid_size; j++) {\n\n\n if (this.state.data[i + '' + j] == mark) {\n horizontal_count++;\n }\n\n\n if (this.state.data[j + '' + i] == mark) {\n vertical_count++;\n }\n\n }\n\n\n if (this.state.data[i + '' + i] == mark) {\n left_to_right_count++;\n }\n\n\n if (this.state.data[(this.state.grid_size - 1 - i) + '' + i] == mark) {\n right_to_left_count++;\n }\n\n // ak suhlasi vyhral\n if (horizontal_count == this.state.grid_size || vertical_count == this.state.grid_size) {\n return true;\n }\n\n }\n\n // ak suhlasi diagonal vyhral\n if (left_to_right_count == this.state.grid_size || right_to_left_count == this.state.grid_size) {\n return true;\n }\n\n // nikto nevyhral\n return false;\n }", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "function updateCount( x, y, regions, last_regions) {\n var occupied = []; \n for (var r in regions) {\n \n // If already in the region, expand the boundaries\n var adj_lr = [0,0]; \n var adj_ul = [0,0]; \n var A = 0.12; // A 12% proportional \"expansion\" of the border to trigger leaving\n if (useRegionStickiness && last_regions.indexOf(r) > -1) { \n adj_lr[0] = A*regions[r].height;\n adj_lr[1] = A*regions[r].width;\n adj_ul[0] = -1*A*regions[r].height;\n adj_ul[1] = -1*A*regions[r].width;\n } \n \n // Now, use the adjusted region boundaries in the test\n //\n if (y >= regions[r].ul[0]+adj_ul[0] && y <= regions[r].lr[0]+adj_lr[0] && // These checks are for a graphics coordinate\n x >= regions[r].ul[1]+adj_ul[1] && x <= regions[r].lr[1]+adj_lr[1] ) { // system with (0,0) in the top left\n regions[r].count += 1; \n occupied.push(r); \n }\n } \n return occupied; \n}", "function getCount(possibility_matrix, count_arr, len) {\n let turn_1_index = 0;\n let turn_1_count = count_arr[0];\n let turn_2_count = 0;\n for (let i = 0; i < count_arr.length; i++) {\n if (count_arr[i] > turn_1_count) {\n turn_1_count = count_arr[i];\n turn_1_index = i;\n }\n }\n if (count_arr.length > 1) {\n let catched_salmon_arr = [];\n for (let i = 0; i < possibility_matrix[turn_1_index].length; i++) {\n if (possibility_matrix[turn_1_index][i]) {\n catched_salmon_arr[i] = true;\n }\n }\n // console.log(catched_salmon_arr, turn_1_index, turn_1_count);\n let turn_2_index;\n for (let i = 0; i < catched_salmon_arr.length; i++) {\n if (catched_salmon_arr[i]) {\n continue;\n } else {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n break;\n }\n }\n\n for (let i = 0; i < count_arr.length; i++) {\n if (!catched_salmon_arr[i] && count_arr[i] > turn_2_count && (count_arr[i] + turn_1_count) <= len && checkNoneOfCurrentGroupCatched(possibility_matrix[i])) {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n }\n }\n // console.log(catched_salmon_arr, turn_2_index, turn_2_count);\n } else {\n turn_2_count = 0; // turn 2 not possible\n }\n console.log(turn_1_count + turn_2_count);\n}", "function checkVictory(cléIndex) {\n var currentColor = cellProperties[cléIndex].couleur;\n var currentCol = cellProperties[cléIndex].col;\n var currentRow = cellProperties[cléIndex].row;\n var tokenHorizontal = 0;\n var tokenVertical = 0;\n var tokenDiagonalPositive = 0;\n var tokenDiagonalNegative = 0;\n var emptyCellFound = 0;\n\n\n // horizontal \n // coté gauche(check les cases à gauche du jeton joué)\n if (currentCol > 1) {\n for (i = currentCol; i > 1; i--) {\n colTest = \"col\" + (i - 1);\n if (cellProperties[colTest + 'row' + currentRow].couleur === currentColor) {\n tokenHorizontal += 1;\n }\n if (cellProperties[colTest + 'row' + currentRow].couleur != currentColor) {\n break;\n }\n if (tokenHorizontal >= 3) {\n victoire = true;\n console.log(\"Victoire Horizontale\");\n break;\n }\n }\n }\n // coté droit(check les cases à droite du jeton joué)\n if (currentCol < x && tokenHorizontal < 3 && x - currentCol > (3 - tokenHorizontal)) {\n for (i = currentCol; i > 0; i++) {\n colTest = \"col\" + (i + 1);\n if (cellProperties[colTest + 'row' + currentRow].couleur === currentColor) {\n tokenHorizontal += 1;\n }\n if (cellProperties[colTest + 'row' + currentRow].couleur != currentColor) {\n break;\n }\n if (tokenHorizontal >= 3) {\n victoire = true;\n console.log(\"Victoire Horizontale\");\n break;\n }\n }\n }\n\n // vertical (check les cases sous le jeton joué)\n if (currentRow <= (y - 3)) {\n for (i = currentRow; i < y; i++) {\n rowTest = \"row\" + (i + 1);\n if (cellProperties[\"col\" + currentCol + rowTest].couleur === currentColor) {\n tokenVertical += 1;\n }\n if (cellProperties[\"col\" + currentCol + rowTest].couleur != currentColor) {\n break;\n }\n if (tokenVertical >= 3) {\n victoire = true;\n console.log(\"Victoire Verticale\");\n break;\n }\n }\n }\n\n // diagonaux\n //diagonale positive\n // bas gauche (check les cases en bas à gauche en diagonale du jeton joué)\n if (currentRow < y && currentCol > 1) {\n for (i = currentRow, j = currentCol; i < y && j > 1; i++ , j--) {\n rowTest = \"row\" + (i + 1);\n colTest = \"col\" + (j - 1)\n\n if (cellProperties[colTest + rowTest].couleur === currentColor) {\n tokenDiagonalPositive += 1;\n }\n if (cellProperties[colTest + rowTest].couleur != currentColor) {\n break;\n }\n if (tokenDiagonalPositive >= 3) {\n victoire = true;\n console.log(\"Victoire Diagonale+\");\n break;\n }\n }\n }\n //diagonale positive\n // haut droit (check les cases en haut à droite en diagonale du jeton joué)\n if (currentRow > 1 && currentCol < x && (x - currentCol) > (3 - tokenDiagonalPositive) && currentRow > (3 - tokenDiagonalPositive)) {\n for (i = currentRow, j = currentCol; i > 1 && j < x; i-- , j++) {\n rowTest = \"row\" + (i - 1);\n colTest = \"col\" + (j + 1)\n\n if (cellProperties[colTest + rowTest].couleur === currentColor) {\n tokenDiagonalPositive += 1;\n }\n if (cellProperties[colTest + rowTest].couleur != currentColor) {\n break;\n }\n if (tokenDiagonalPositive >= 3) {\n victoire = true;\n console.log(\"Victoire Diagonale+\");\n break;\n }\n }\n }\n\n //diagonale negative\n // bas droite (check les cases en bas à droite en diagonale du jeton joué)\n if (currentRow < y && currentCol < x) {\n for (i = currentRow, j = currentCol; i < y && j < x; i++ , j++) {\n rowTest = \"row\" + (i + 1);\n colTest = \"col\" + (j + 1)\n\n if (cellProperties[colTest + rowTest].couleur === currentColor) {\n tokenDiagonalNegative += 1;\n }\n if (cellProperties[colTest + rowTest].couleur != currentColor) {\n break;\n }\n if (tokenDiagonalNegative >= 3) {\n victoire = true;\n console.log(\"Victoire Diagonale-\");\n break;\n }\n }\n }\n\n // diagonale negative\n // haut gauche (check les cases en bas à droite en diagonale du jeton joué)\n if (currentRow > 1 && currentCol > 1 && (currentCol - 1) > (3 - tokenDiagonalNegative) && currentRow > (3 - tokenDiagonalNegative)) {\n for (i = currentRow, j = currentCol; i > 1 && j > 1; i-- , j--) {\n rowTest = \"row\" + (i - 1);\n colTest = \"col\" + (j - 1)\n\n if (cellProperties[colTest + rowTest].couleur === currentColor) {\n tokenDiagonalNegative += 1;\n }\n if (cellProperties[colTest + rowTest].couleur != currentColor) {\n break;\n }\n if (tokenDiagonalNegative >= 3) {\n victoire = true;\n console.log(\"Victoire Diagonale-\");\n break;\n }\n }\n }\n\n // vérification du match nul en cas de complétion de grille\n if (currentRow == 1 && !victoire) {\n for (i = 1; i <= x; i++) {\n colTest = \"col\" + (i);\n if (cellProperties[colTest + 'row1'].couleur == 0) {\n emptyCellFound += 1;\n break;\n }\n }\n if (emptyCellFound == 0) {\n console.log('Match Nul')\n matchNul = true;\n }\n }\n\n } // crochet fin de fonction condition de victoire", "step() {\n const backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n const currentBuffer = this.buffer[this.currentBufferIndex];\n const backBuffer = this.buffer[backBufferIndex];\n\n const countNeighbors = (x, y, options={border: 'wrap'}) => {\n let neighborCount = 0;\n\n // Actually count living neighbors\n if (options.border === 'wrap') {\n let north = y - 1;\n let south = y + 1;\n let west = x - 1;\n let east = x + 1;\n\n if (north < 0) north = this.height - 1;\n\n if (south > this.height - 1) south = 0;\n\n if (west < 0) west = this.width - 1;\n\n if (east > this.width - 1) east = 0;\n\n neighborCount = \n currentBuffer[north][west] + \n currentBuffer[north][x] + \n currentBuffer[north][east] + \n currentBuffer[y][west] + \n currentBuffer[y][east] + \n currentBuffer[south][x] + \n currentBuffer[south][east] + \n currentBuffer[south][west];\n\n } else if (options.border === 'nowrap') {\n // Treat out of bounds as zero\n for (let yOffset = -1; yOffset <= 1; yOffset++) {\n let yPos = y + yOffset;\n if (yPos < 0 || yPos >= this.height) continue; // Out of bounds\n\n for (let xOffset = -1; xOffset <= 1; xOffset++) {\n let xPos = x + xOffset;\n if (xPos < 0 || xPos >= this.width) continue; // Out of bounds\n if (yPos === y && xPos === x) continue; // Can't be your own neighbor\n neighborCount += currentBuffer[yPos][xPos];\n }\n }\n } else {\n throw new Error('Unknown border option: ' + options.border);\n }\n return neighborCount;\n }\n\n // Update backBuffer to have the next time state\n for(let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const neighbors = countNeighbors(x, y);\n const thisCell = currentBuffer[y][x];\n\n // Implement GoL rules\n if (thisCell) {\n //Current cell is alive\n if (neighbors < 2 || neighbors > 3) {\n // Death\n backBuffer[y][x] = 0;\n } else {\n // Alive\n backBuffer[y][x] = 1;\n }\n } else {\n // Current cell is dead\n if (neighbors === 3) {\n // A cell is born\n backBuffer[y][x] = 1;\n } else {\n // Still dead\n backBuffer[y][x] = 0;\n }\n }\n }\n }\n\n this.currentBufferIndex = backBufferIndex;\n }", "function checkOverlapse(direction) {\n\t\textraTop = newTop;\n\t\textraLeft = newLeft;\n\t\t\n\t\tlet overlapRows = false;\n\t\t let overlapCols = false;\n\t\t\n\t\tif (currTopPx % dimension != 0)\n\t\t\toverlapRows = true;\n\t\tif (currLeftPx % dimension != 0)\n\t\t\toverlapCols = true;\n\t\t\n\t\tswitch(direction) {\n\t\t\tcase leftKey:\n\t\t\tcase rightKey:\t \n\t\t\t\tif (overlapRows)\n\t\t\t\t\textraTop = newTop + 1;\n\t\t\t\tbreak;\n\t\n\t\t\tcase upKey:\n\t\t\tcase downKey: \n\t\t\t\tif (overlapCols)\n\t\t\t\t\textraLeft = newLeft + 1;\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t}\n\t}", "function comparison(){\n\n var a1,a2,a3,a4,b1,b2,b3,b4,hint1,hint2,hint3,hint4;\n a1 = row[nbrOfRows].h1;\n a2 = row[nbrOfRows].h2;\n a3 = row[nbrOfRows].h3;\n a4 = row[nbrOfRows].h4;\n b1 = row[0].h1;\n b2 = row[0].h2;\n b3 = row[0].h3;\n b4 = row[0].h4;\n\n\n correctPosition=0; //Nbr of correct colors on correct position\n if (a1 == b1){correctPosition++;a1=1;b1=0;hint1=1}\n if (a2 == b2){correctPosition++;a2=1;b2=0;hint2=1}\n if (a3 == b3){correctPosition++;a3=1;b3=0;hint3=1}\n if (a4 == b4){correctPosition++;a4=1;b4=0;hint4=1}\n\n correctColour=0; //Nbr of correct colors on wrong position\n if (a1 == b2){correctColour++;a1=1;b2=0}\n if (a1 == b3){correctColour++;a1=1;b3=0}\n if (a1 == b4){correctColour++;a1=1;b4=0}\n\n if (a2 == b1){correctColour++;a2=1;b1=0}\n if (a2 == b3){correctColour++;a2=1;b3=0}\n if (a2 == b4){correctColour++;a2=1;b4=0}\n\n if (a3 == b1){correctColour++;a3=1;b1=0}\n if (a3 == b2){correctColour++;a3=1;b2=0}\n if (a3 == b4){correctColour++;a3=1;b4=0}\n\n if (a4 == b1){correctColour++;a4=1;b1=0}\n if (a4 == b2){correctColour++;a4=1;b2=0}\n if (a4 == b3){correctColour++;a4=1;b3=0}\n\n //Draw the hints on the side of the board\n var p = 9*box+4.8;\n for (i=0;i<4;i++){\n if (i<correctPosition){\n ctx.drawImage(red,p,selectedHole.y+8,box/2.5,box/2.5)}\n else if (i<correctPosition+correctColour){ctx.drawImage(white,p,selectedHole.y+8,box/2.5,box/2.5)}\n else {ctx.drawImage(empty,p,selectedHole.y+8,box/2.5,box/2.5)}\n p += 16.8;\n }\n \n if (correctPosition == 4){ // If colors correspond than we display the \"victory\" box\n document.getElementById(\"victoryMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n }\n else if (nbrOfRows == 11) { //If the colors are wrong and the it's the 11th row we display the \"defeat\" box\n document.getElementById(\"defeatMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n\n }\n\n document.getElementById(\"pts\").innerHTML=(-nbrOfRows+12)\n}", "function checkFlaggedMatrix(x,y) {\n count = 0;\n for (i=x-1; i<=x+1; i++) {\n for (j=y-1; j<=y+1; j++) {\n if ((i!=x) || (j!=y)) { //Don't check center point\n count = count + checkFlagged(i,j); } } }\n return count; }", "calculateObjective (patternVerticalOffsets, minStopPerPattern, maxStopPerPattern, transfersFromPattern) {\n let objective = 0\n for (let pattern of patternVerticalOffsets.keys()) {\n if (!transfersFromPattern.has(pattern)) continue\n\n let txx = transfersFromPattern.get(pattern)\n txx.forEach(transfer => {\n let from = transfer.fromStop - minStopPerPattern.get(pattern) + patternVerticalOffsets.get(pattern)\n let to = transfer.toStop - minStopPerPattern.get(transfer.toPattern) + patternVerticalOffsets.get(transfer.toPattern)\n\n // this transfer goes the wrong way\n if (to <= from) objective += from - to + 1\n })\n }\n\n return objective\n }", "function horizontalline(prevrow) {\n var currchip = null;\n var prevchip = 0;\n var count = 0;\n\n for (var col = 0; col < 7; col++) {\n currchip = board[prevrow][col];\n if (currchip == prevchip && currchip != 0) {\n count++;\n }\n else {\n count = 0;\n }\n //count == 3 when four chips are in a line\n if (count == UI.wincondition - 1) {\n return true;\n }\n //set previous chip to current chip for next comparison\n prevchip = currchip;\n }\n\n //else no horizontal line\n return false;\n}", "isPercolated () {\n var topPercolateIndex = this.size\n var bottomPercolateIndex = this.size + 1\n\n var topPercolateArranges = this.grid.slice(0, 1)[0]\n .map((value, x) =>\n value && [topPercolateIndex, this.width * x]\n ).filter(v => v)\n\n var bottomPercolateArranges = this.grid.slice(-1)[0]\n .map((value, x) =>\n value && [bottomPercolateIndex, (this.grid.length-1) * this.width + x]\n ).filter(v => v)\n\n // console.log('topPercolateArranges', topPercolateArranges);\n // console.log('bottomPercolateArranges', bottomPercolateArranges);\n\n // padds arranges like this: double means has arrange (e.g. \\\\)\n //\n // top_percolate (pad)\n // // | \\\\\n // X - X\n // X X X\n // - X X\n // \\ || //\n // bottom_percolate (pad)\n\n var paddedArranges = [\n ...topPercolateArranges,\n ...this.arranges,\n ...bottomPercolateArranges,\n ]\n\n // find if topPercolate is connected to bottomPercolate, which are appeneded at the end, hence we pass {n} as `this.size + 2`\n return (new UnionFind.QuickFind(\n this.size + 2,\n paddedArranges\n )).find(topPercolateIndex, bottomPercolateIndex)\n }", "controlHorizontalPosterior(x, ficha, matrizCeldas) {\r\n let contador = 0;\r\n let y = ficha.columna;\r\n while (y < matrizCeldas[y].length && (ficha.getColor() === matrizCeldas[y + 1][x]?.fichaColor)) {\r\n contador++;\r\n y++;\r\n }\r\n return contador;\r\n }", "function alignDiscontinuities(lastFrag,details,lastLevel){if(shouldAlignOnDiscontinuities(lastFrag,lastLevel,details)){var referenceFrag=findDiscontinuousReferenceFrag(lastLevel.details,details);if(referenceFrag){logger_1.logger.log('Adjusting PTS using last level due to CC increase within current level');adjustPts(referenceFrag.start,details);}}}", "function checkLearnedSpiral(arg,extended=0,linear=0) {\n \n var ctrls=[]; var s=[]; var mindi=[]; var minInds = [];\n /*console.log(toKeep);\n for (var bg=0; bg<learnedSpirals.length; bg++) {\n ctrl=(euclidDistWeight(forControl.map(k => arg[k]),forControl.map(k => learnedSpirals[bg][0][k]),weightVector));\n ctrls.push(ctrl);\n s.push(ctrl);\n }*/\n for (var i=0; i<spiralBounds.length; i++) {\n ctrls.push(Math.abs(spiralBounds[i]-boundArea(userSpiral)));\n s.push(Math.abs(spiralBounds[i]-boundArea(userSpiral)));\n }\n s.sort(function(a, b){return a-b});\n var minInds = []; \n //If drawing against a template, always start with that size. \n if (drawBackgroundSpiral>0) { minInds.push(drawBackgroundSpiral/0.25); }\n for (var i=0; i<spiralBounds.length; i++) {\n if (drawBackgroundSpiral>0) { if (ctrls.indexOf(s[i]) != drawBackgroundSpiral/0.25) {\n minInds.push(ctrls.indexOf(s[i]));\n }}\n else { \n minInds.push(ctrls.indexOf(s[i]));\n }\n }\n //If we're just checking the linear score, use distance from the background spiral of appropriate size as the only number. \n if (linear == 1 && (drawBackgroundSpiral > 0 || plotType == 1)) {\n var toKeep = [4,5,10,11,19,20];\n var weightVector=[1,1,1,1,1,1,1,1];\n var res = []; \n //Only use the template size. \n for (var i=0; i<(drawBackgroundSpiral>0?1:minInds.length); i++) { \n var p1=((euclidDistWeight(toKeep.map(k => arg[k]),toKeep.map(k => perfSpirals[minInds[i]][k]),weightVector)).toFixed(2));\n var p2=(euclidDistWeight(toKeep.map(k=> perfSpirals[minInds[i]][k]),toKeep.map(k => learnedSpirals[minInds[i]][0][k]),weightVector)).toFixed(2);\n var p3=(euclidDistWeight(toKeep.map(k=> arg[k]),toKeep.map(k => learnedSpirals[minInds[i]][0][k]),weightVector)).toFixed(2);\n res.push((p1/p2).toFixed(2));\n }\n return (res);\n }\n \n //Get rid of standard deviations basically. \n var forControl = [3,5,7,9,11,12,13,14,15,16,17];\n var toKeep = [3,5,7,9,11,12,13,14,15,16,17];\n var weightVector = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];\n \n if (extended==1) { toKeep=toKeep.concat([18,19]);console.log(\"extended\"); }\n\n\n var check=[]; var minds = []; var ds=[]; \n for (var bg=0; bg<minInds.length; bg++) {\n ctrl=(euclidDistWeight(toKeep.map(k => arg[k]),toKeep.map(k => learnedSpirals[minInds[bg]][0][k]),weightVector));\n var mind=1000000; var d=0; var mi=-1; \n //Distance to control center. \n for (var i=1; i<learnedSpirals[minInds[bg]].length; i++) {\n //Distance to noise center. \n d=euclidDistWeight(toKeep.map(k => arg[k]),toKeep.map(k => learnedSpirals[minInds[bg]][i][k]),weightVector);\n //Keep the minimum difference between control and noise. \n ds.push(d);\n if (d<mind) { mind=d; mi=i;}\n }\n mindi.push(mi);\n minds.push((ctrl/mind).toFixed(2));\n }\n \n return(minds.sort(function(a, b){return a-b}));\n}", "examine_possibles(count) {\n let updates = 0;\n //Loop through diagonally (hitting all rows/columns in n iterations)\n for (var i = 0; i < this.size; i++) {\n let node = this.nodes[i * (this.size + 1)];\n updates += this.calculate_frequencies(node, 0, count); //Row\n updates += this.calculate_frequencies(node, 1, count); //Col\n }\n\n let inc = Math.sqrt(this.size);\n\n //Loop through top left of all sub_squares\n for (var y = 0; y < this.size; y += inc) {\n for (var x = 0; x < this.size; x += inc) {\n updates += this.calculate_frequencies(this.nodes[x_y_to_index(x, y, this.size)], 2, count); //Sqr\n }\n }\n\n return updates;\n }", "step() {\n // !!!! IMPLEMENT ME !!!!\n let currentBuffer = this.cells[this.currentBufferIndex];\n let backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n\n function countNeighbors(row, col) {\n let neighborCount = 0;\n\n for (let rowOffset = -1; rowOffset <= 1; rowOffset++) {\n let rowPos = row + rowOffset;\n\n if (rowPos < 0 || rowPos === this.height) {\n continue;\n }\n\n for (let colOffset = -1; colOffset <= 1; colOffset++) {\n let colPos = col + colOffset;\n\n if (colPos < 0 || colPos === this.width) {\n continue;\n }\n \n if (colOffset === 0 && rowOffset === 0) { // Current cell\n continue;\n }\n\n if (currentBuffer[rowPos][colPos] === 1) {\n neighborCount++;\n }\n }\n }\n return neighborCount;\n };\n\n for (let r = 0; r < this.height; r++) {\n for (let c = 0; c < this.width; c++) {\n let neighborCount = countNeighbors.call(this, r, c);\n\n if (currentBuffer[r][c] === 1) {\n if (neighborCount < 2 || neighborCount > 3) {\n backBuffer[r][c] = 0;\n } else {\n backBuffer[r][c] = 1;\n }\n } else {\n if (neighborCount === 3) {\n backBuffer[r][c] = 0;\n } else {\n backBuffer[r][c] = 1;\n }\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function updateCount( x, y, regions, last_regions) {\n var occupied = []; \n if (typeof last_regions == 'undefined') last_regions = []; // Added this because we have arbitrary track ids, making it hard to guarantee a value here\n for (var r in regions) {\n // If already in the region, expand the boundaries\n var adj_lr = [0,0]; \n var adj_ul = [0,0]; \n var A = 0.12; // A 12% proportional \"expansion\" of the border to trigger leaving\n if (useRegionStickiness && last_regions.indexOf(r) > -1) { \n adj_lr[0] = A*regions[r].height;\n adj_lr[1] = A*regions[r].width;\n adj_ul[0] = -1*A*regions[r].height;\n adj_ul[1] = -1*A*regions[r].width;\n } \n \n // Now, use the adjusted region boundaries in the test\n //\n if (y >= regions[r].ul[0]+adj_ul[0] && y <= regions[r].lr[0]+adj_lr[0] && // These checks are for a graphics coordinate\n x >= regions[r].ul[1]+adj_ul[1] && x <= regions[r].lr[1]+adj_lr[1] ) { // system with (0,0) in the top left\n regions[r].count += 1; \n occupied.push(r); \n }\n } \n return occupied; \n}", "bestPlaceToStart(incomingClues) {\n\n // penalize clues that have more zeros\n function weightedClue(clue) {\n return clue ? clue : -10;\n }\n\n const sideLength = this.size;\n const lastCell = this.size * 4 - 1;\n\n const sideClues = [\n {\n direction: 'top',\n count:\n weightedClue(incomingClues[sideLength]) + weightedClue(incomingClues[sideLength + 1]) +\n weightedClue(incomingClues[lastCell - 1]) + weightedClue(incomingClues[lastCell])\n },\n {\n direction: 'bottom',\n count:\n weightedClue(incomingClues[sideLength * 2 - 2]) + weightedClue(incomingClues[sideLength * 2 - 1]) +\n weightedClue(incomingClues[sideLength * 3]) + weightedClue(incomingClues[sideLength * 3 + 1])\n },\n {\n direction: 'left',\n count:\n weightedClue(incomingClues[0]) + weightedClue(incomingClues[1]) +\n weightedClue(incomingClues[sideLength * 3 - 2]) + weightedClue(incomingClues[sideLength * 3 - 1])\n },\n {\n direction: 'right',\n count:\n weightedClue(incomingClues[sideLength - 2]) + weightedClue(incomingClues[sideLength - 1]) +\n weightedClue(incomingClues[sideLength * 2]) + weightedClue(incomingClues[sideLength * 2 + 1])\n }\n ];\n sideClues.sort((a, b) => b.count - a.count);\n const bestDirection = sideClues[0].direction;\n\n let clues;\n let c1;\n let c2;\n let c3;\n let c4;\n switch(bestDirection) {\n case 'top':\n clues = incomingClues;\n break;\n case 'bottom': // shift bottom to the first row\n c1 = incomingClues.slice(sideLength * 2, sideLength * 3).reverse();\n c2 = incomingClues.slice(sideLength, sideLength * 2).reverse();\n c3 = incomingClues.slice(0, sideLength).reverse();\n c4 = incomingClues.slice(sideLength * 3, sideLength * 4).reverse();\n clues = c1.concat(c2).concat(c3).concat(c4);\n break;\n case 'left': // shift left side to the first row\n c1 = incomingClues.slice(sideLength * 3, sideLength * 4);\n c2 = incomingClues.slice(0, sideLength * 3);\n clues = c1.concat(c2);\n break;\n case 'right': // shift right side to the first row\n c1 = incomingClues.slice(sideLength, sideLength * 4);\n c2 = incomingClues.slice(0, sideLength);\n clues = c1.concat(c2);\n break;\n }\n return { startAt: bestDirection, clues };\n }", "function checkRow( g, ri ) {\n var above_status = aliveAbove( g, ri );\n var below_status = aliveBelow( g, ri );\n var curr_status = g[ri]>0;\n var alives = [];\n var new_row = 0;\n // If nothing around it is alive, return 0;\n if ( above_status > 0 || below_status > 0 || curr_status > 0 ) {\n // Check the positions\n for( var i = 1; i < bits; i *= 2 ) {\n var alive_or_dead = (g[ri]&i)>0;\n var ac = 0;\n if ( above_status == true ) {\n (g[ri-1] & (i/2))>0?ac++:false;\n (g[ri-1] & (i/1))>0?ac++:false;\n (g[ri-1] & (i*2))>0?ac++:false;\n }\n if ( curr_status == true ) {\n (g[ri] & (i/2))>0?ac++:false;\n (g[ri] & (i*2))>0?ac++:false;\n }\n if ( below_status == true ) {\n (g[ri+1] & (i/2))>0?ac++:false;\n (g[ri+1] & (i/1))>0?ac++:false;\n (g[ri+1] & (i*2))>0?ac++:false;\n }\n if ( alive_or_dead == true && ( ac == 2 || ac == 3 ) ) {\n new_row += bits & i;\n }\n else if ( alive_or_dead == false && ac == 3 ) {\n new_row += bits & i;\n }\n }\n return new_row;\n }\n else {\n return 0;\n }\n}", "screenAlignmentPattern() {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << 22 /* WIDTH_SHIFT */ | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n const buffer = this._bufferService.buffer;\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = buffer.ybase + buffer.y + yOffset;\n const line = buffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowService.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }", "function arrayMarkCount(iRows, iCols, iStartRow, iStartCol) {\n var i;\n var j;\n\n iMarkCount = 0;\n\n for (i = iStartRow; i < iStartRow + iRows; i++) {\n for (j = iStartCol; j < iStartCol + iCols; j++) {\n if (iMarkedCells[i % iMapRows][j % iMapCols] == 1) {\n iMarkCount++;\n } \n }\n } \n\n return iMarkCount;\n}", "function AlignmentPattern(posX, posY, estimatedModuleSize) {\n this.x = posX;\n this.y = posY;\n this.count = 1;\n this.estimatedModuleSize = estimatedModuleSize;\n }", "_updateGeneration () {\n let shouldUpdateGenerationCounter = false\n\n for (let x = 0; x < this.sizeX; x++) {\n for (let y = 0; y < this.sizeY; y++) {\n let neighbours = this._countNeighbours(x, y)\n if (this.matrix[x][y] === 1 && (neighbours > 3 || neighbours < 2)) {\n this.nextMatrix[x][y] = -1\n } else if (this.matrix[x][y] !== 1 && neighbours === 3) {\n shouldUpdateGenerationCounter = true\n this.nextMatrix[x][y] = 1\n } else {\n this.nextMatrix[x][y] = this.matrix[x][y]\n }\n }\n }\n\n if (shouldUpdateGenerationCounter) {\n this.generationNumber++\n }\n }", "function count_islands(emap) {\n \n const len = array_length(emap);\n const height = array_length(emap[0]);\n \n let visited = [];\n\n // Generate the visited 2D array -> This is to check whether the cell \n // has already been checked\n for (let i = 0; i < len; i = i + 1) {\n visited[i] = [];\n for (let j = 0; j < height; j = j + 1) {\n visited[i][j] = false;\n }\n }\n \n // Check whether the neighboring cells are valid \n function isSafe(emap, row, col, visited) {\n // Check there is no negative / overflow index\n return row >= 0 && row < len && col >= 0 && col < height \n && emap[row][col] > 0 && !visited[row][col];\n }\n \n\n // Apply Depth-First search and treat the 2D array as a graph\n function dfs(emap, row, col, visited) {\n // Mark this cell as visited\n visited[row][col] = true;\n for (let i = -1; i <= 1; i = i + 1) {\n for (let j = -1; j <= 1; j = j + 1) {\n if ((i === -1 && j === 0) ||\n (i === 0 && j === -1) ||\n (i === 0 && j === 1) ||\n (i === 1 && j === 0)) {\n if(isSafe(emap, row + i, col + j, visited)) {\n dfs(emap, row + i, col + j, visited);\n } else {\n \n }\n } else {\n \n }\n }\n }\n \n }\n\n \n let counter = 0;\n \n // Trying to check the number of connected graphs\n for (let i = 0; i < len; i = i + 1) {\n for (let j = 0; j < len; j = j + 1) {\n if (emap[i][j] > 0 && !visited[i][j]) {\n // Check\n dfs(emap, i, j, visited);\n counter = counter + 1;\n } else {\n \n }\n }\n }\n\n return counter;\n}", "getPositionCorrection(counter) {\r\n let correction = 0;\r\n let isLastSlide = this.isLastSlide(counter);\r\n if (this.carouselProperties.loop || this.direction === \"right\") {\r\n return 0;\r\n }\r\n if (this.isSlideLengthLimited || isLastSlide) {\r\n let cellsWidth = this.cells.cellLengthInLightDOMMode * this.fullCellWidth;\r\n if (this.visibleWidth < cellsWidth) {\r\n correction = -(this.visibleCellsCount * this.fullCellWidth - this.visibleWidth - this.margin);\r\n }\r\n if (correction >= -this.margin) {\r\n correction = 0;\r\n }\r\n }\r\n return correction;\r\n }", "function calcSegmentIntersectionStripeCount_old(arcs) {\n var yrange = arcs.getBounds().height(),\n segLen = getAvgSegment2(arcs)[1], // slow\n count = 1;\n if (segLen > 0 && yrange > 0) {\n count = Math.ceil(yrange / segLen / 20);\n }\n return count || 1;\n }", "function little_check(count,count2){\n\t\t\t\n\t\t\t//console.log(\"count \"+ count+\"count2 \"+count2);\t\t\t\n \t \t\tfor ( var x=count; x <= (count+2); x++) { // cycle the matrix rows...\n \t \t\t\tfor (var y=count2; y <= (count2+2); y++) { // ...and cycle the matrix cells\n\t\t\t\t\t//var BR=1;\n\n\t\t\t\t\t//console.log(\"matrx[x] \"+ x+\"martix[y] \"+y);\n\t\t\t\t\tif ((matrix[x][(count2+0)]) === \"p1\" && (matrix[x][(count2+1)]) === \"p1\" && (matrix[x][(count2+2)]) === \"p1\") { // If our cell has been 'tagged' p1 given x is (e.g 0) then: x0y0, x0y1, x0y2 would mean player one has 3 horizontal cells in a line = victory!\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"horizontal victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins square row \"+BR+ \"column \"+BC )\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][y]) === \"p1\" && (matrix[(count+1)][y]) === \"p1\" && (matrix[(count+2)][y]) === \"p1\") { // Repeated for other conditions\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"vertical victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ((matrix[(count+0)][(count2+0)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+2)]) === \"p1\") {\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"LtopRdown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][(count2+2)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+0)]) === \"p1\") {\t\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"Rtop Ldown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t \t}", "findNext() {\n // look left, right, up, down\n let leftLoc = {x: this.center.x - 1, y: this.center.y};\n let rightLoc = {x: this.center.x, y: this.center.y};\n let upLoc = {x: this.center.x, y: this.center.y - 1};\n let downLoc = {x: this.center.x, y: this.center.y + 1};\n\n let carArray = [this.layout[leftLoc.y][leftLoc.x] || 0, this.layout[rightLoc.y][rightLoc.x] || 0,\n this.layout[upLoc.y][upLoc.x] || 0, this.layout[downLoc.y][downLoc.x] || 0];\n if(Math.max(...carArray) === 0) {\n console.log(\"bunny sleep\")\n return\n }\n let nextLoc = carArray.indexOf(Math.max(...carArray));\n\n switch(nextLoc) {\n case 0: \n return leftLoc;\n \n case 1: \n return rightLoc;\n\n case 2: \n return upLoc;\n \n case 3: \n return downLoc;\n default: \n return null;\n }\n }", "step() {\n /* If you put logic from CCA here it works as should */\n\n /* In the Game of Life, these rules examine each cell of the grid. \n For each cell, it counts that cell's eight neighbors\n (up, down, left, right, and diagonals), and then act on that result.\n\n If the cell is alive and has 2 or 3 neighbors, then it remains alive. Else it dies.\n If the cell is dead and has exactly 3 neighbors, then it comes to life. Else if remains dead. */\n\n let currentBuffer = this.cells[this.currentBufferIndex];\n let backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n \n // see if we have a neighbor that can infect this cell and change its color\n function checkNeighbors(w, h) {\n let neighbors = 0;\n\n // Check West\n if (w) {\n if (currentBuffer[h][w - 1]) {\n neighbors++;\n }\n }\n // Check NW\n if (h && w) {\n if (currentBuffer[h - 1][w - 1])\n neighbors++;\n }\n // Check North\n if (h) {\n if (currentBuffer[h - 1][w]) {\n neighbors++;\n }\n }\n // Check NE\n if ((w < this.width - 1) && h) {\n if (currentBuffer[h - 1][w + 1]) {\n neighbors++;\n }\n }\n // Check East\n if (w < this.width - 1) {\n if (currentBuffer[h][w + 1]) {\n neighbors++;\n }\n }\n // Check SE\n if ((h < this.height - 1) && (w < this.width - 1)) {\n if (currentBuffer[h + 1][w + 1]) {\n neighbors++;\n }\n }\n // Check South\n if (h < this.height - 1) {\n if (currentBuffer[h + 1][w]) {\n neighbors++;\n }\n }\n // Check SW\n if ((h < this.height - 1) && w) {\n if (currentBuffer[h + 1][w - 1]) {\n neighbors++;\n }\n }\n\n return neighbors;\n } // end: checkNeightbors()\n\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n let neighborCount = checkNeighbors.call(this, w, h);\n\n // is current cell alive?\n if (currentBuffer[h][w]) {\n if (neighborCount === 2 || neighborCount === 3) {\n backBuffer[h][w] = currentBuffer[h][w]; // cell stay alives\n }\n else { // else it dies\n backBuffer[h][w] = (currentBuffer[h][w] + 1) % MODULO;\n }\n }\n else { // current cell is dead\n if (neighborCount === 3) {\n backBuffer[h][w] = (currentBuffer[h][w] + 1) % MODULO; // bring cell to life\n }\n else { // else cell remains dead\n backBuffer[h][w] = currentBuffer[h][w];\n }\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function count_color(current_coordinate, desired_color, desired_direction, current_count) {\n\t\t\t\tlet next_coordinate = [current_coordinate[0] + desired_direction[0],\n\t\t\t\tcurrent_coordinate[1] + desired_direction[1]];\n\t\t\t\tconsole.log(next_coordinate);\n\t\t\t\tif (piece_position[next_coordinate[0]] && piece_position[next_coordinate[0]][next_coordinate[1]]) {\n\t\t\t\t\tif (piece_position[next_coordinate[0]][next_coordinate[1]].color != desired_color)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\tcurrent_count += 1;\n\t\t\t\t\tif (current_count == 3)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\treturn count_color(next_coordinate, desired_color, desired_direction, current_count);\n\t\t\t\t}\n\t\t\t\treturn current_count;\n\t\t\t}", "calculateCOOCM(sourceMatrix, size) {\n\t\tvar nextValue = 0,\n\t\t\tpreviousValue = 0,\n\t\t\tsum = 0,\n\t\t\tlength,\n\t\t\tindex = 0;\n\n\t\tlength = sourceMatrix.length;\n\t\tfor (index = 0; index < length; index++) {\n\t\t\tswitch (this.orientation) {\n\t\t\t\tcase 'horizontally':\n\t\t\t\t{\n\t\t\t\t\tif (index % size + this.distance <= size - 1) {\n\t\t\t\t\t\tnextValue = sourceMatrix[index + this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(sourceMatrix[index] - 1, nextValue - 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (index % size - this.distance >= 0) {\n\t\t\t\t\t\tpreviousValue = sourceMatrix[index - this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(sourceMatrix[index] - 1, previousValue - 1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'vertically':\n\t\t\t\t{\n\t\t\t\t\t//TODO TEST\n\t\t\t\t\t//vertically\n\t\t\t\t\tif (index > this.distance * size - 1) {\n\t\t\t\t\t\tpreviousValue = sourceMatrix[index - this.distance * size];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(previousValue - 1, sourceMatrix[index] - 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (index < length - this.distance * size) {\n\t\t\t\t\t\tnextValue = sourceMatrix[index + this.distance * size];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(previousValue - 1, sourceMatrix[index] - 1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase '45st':\n\t\t\t\t{\n\t\t\t\t\tif (index % size > this.distance - 1 && index < length - this.distance * size) {\n\t\t\t\t\t\tpreviousValue = sourceMatrix[index + size * this.distance - this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(sourceMatrix[index] - 1, previousValue - 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (index % size < size - this.distance && index > this.distance * size - 1) {\n\t\t\t\t\t\tnextValue = sourceMatrix[index - size * this.distance + this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(sourceMatrix[index] - 1, previousValue - 1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase '135st':\n\t\t\t\t{\n\t\t\t\t\tif (index % size > this.distance - 1 && index > this.distance * size - 1) {\n\t\t\t\t\t\tpreviousValue = sourceMatrix[index - size * this.distance - this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(previousValue - 1, sourceMatrix[index] - 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (index % size < size - this.distance && index < length - this.distance * size) {\n\t\t\t\t\t\tnextValue = sourceMatrix[index + size * this.distance + this.distance];\n\t\t\t\t\t\tthis.incrementCOOCMMatrix(previousValue - 1, sourceMatrix[index] - 1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlength = this.coocmMatrix2.length;\n\t\t//ready for new approach\n\t\t//1600ms better\n\t\tfor (index = 0; index < length; index++) {\n\t\t\tsum = sum + this.coocmMatrix2[index];\n\t\t}\n\n//1500ms better\n\t\tif (sum) {\n\t\t\tfor (index = 0; index < length; index++) {\n\t\t\t\tthis.coocmMatrix2[index] = this.coocmMatrix2[index] / sum;\n\t\t\t}\n\t\t}\n\n\t\t/*this.coocmMatrix2.forEach(function (value, index) {\n\t\t //self.coocmMatrix.subset(math.index(index[0], index % size), value / sum);\n\t\t self.coocmMatrix2[index] = value / sum;\n\t\t });*/\n\n//show matrix in the console\n//console.log(this.coocmMatrix2);\n\t\treturn this.coocmMatrix2;\n\t}", "step() {\n const backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n const cB = this.buffer[this.currentBufferIndex]; // currentBuffer\n const bB = this.buffer[backBufferIndex]; // backBuffer\n const w = this.width, h = this.height;\n\n const countNeighbors = (x, y) => {\n let c = 0; // counter\n if (x > 0 && cB[y][x - 1]) c++;\n if (x < w - 1 && cB[y][x + 1]) c++;\n if (y > 0 && cB[y - 1][x]) c++;\n if (y < h - 1 && cB[y + 1][x]) c++;\n if (x > 0 && y < h - 1 && cB[y + 1][x - 1]) c++;\n if (y > 0 && x < w - 1 && cB[y - 1][x + 1]) c++;\n if (x > 0 && y > 0 && cB[y - 1][x - 1]) c++;\n if (x < w - 1 && y < h - 1 && cB[y + 1][x + 1]) c++;\n return c;\n }\n\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const counter = countNeighbors(x, y);\n const cell = cB[y][x];\n if (cell && counter === 2) bB[y][x] = 1;\n else if (cell && counter === 3) bB[y][x] = 1;\n else if (!cell && counter === 3) bB[y][x] = 1;\n else bB[y][x] = 0;\n }\n }\n\n this.currentBufferIndex = backBufferIndex;\n }", "controlHorizontalAnterior(x, ficha, matrizCeldas) {\r\n let contador = 0;\r\n let y = ficha.columna;\r\n\r\n while (y - 1 >= 0 && (ficha.getColor() === matrizCeldas[y - 1][x]?.fichaColor)) {\r\n contador++;\r\n y--;\r\n }\r\n return contador;\r\n }", "function countSameColorIcons(startIcon, moveX, moveY) {\n\n var curX = startIcon.posX + moveX;\n var curY = startIcon.posY + moveY;\n var count = 0;\n\n while (curX >= 0 && curY >= 0 && curX < BOARD_COLS && curY < BOARD_ROWS && getIconColor(getIcon(curX, curY)) === getIconColor(startIcon))\n {\n count++;\n curX += moveX;\n curY += moveY;\n }\n\n return count;\n\n}", "function countTexts(frameY) {\r totalCAP++;\r panelCAP++;\r\r if(frameY < 3000) {\r topRowCAP++;\r }\r}", "function findNewState(){\n\n let newState = new Array();\n let prev;\n let anc;\n let next;\n\n for(i = 0; i < cols; i++) {\n\n anc = state[i];\n\n if(i == 0){\n prev = state[state.length-1];\n next = state[i+1];\n }\n else if( i == state.length - 1) {\n prev = state[i-1];\n next = state[0];\n }\n else{\n prev = state[i-1];\n next = state[i+1];\n }\n\n if(prev == 1 && anc == 1 && next == 1) {\n newState[i] = 0;\n }\n else if (prev == 1 && anc == 1 && next == 0) {\n newState[i] = 0;\n }\n else if (prev == 1 && anc == 0 && next == 1) {\n newState[i] = 1;\n }\n else if (prev == 1 && anc == 0 && next == 0) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 1 && next == 1) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 1 && next == 0) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 0 && next == 1) {\n newState[i] = 0;\n }\n else if (prev == 0 && anc == 0 && next == 0) {\n newState[i] = 0;\n }\n }\n state = newState.slice();\n}", "function findMaxMatch3() {\r\n\r\n // Initialise empty matching (reset flags)\r\n for (var i = 0; i < nodes.length; i++)\r\n match[i] = false;\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Algorithm started</li>\");\r\n shortTrace.push(\"<li>Algorithm started</li>\");\r\n frame = new Frame2(1, 1, longTraceNum++, shortTraceNum, graph.map(g => ([ ...g ])), [], [...blossom]);\r\n frames.push(frame);\r\n\r\n // Find augmenting path and augment matching along path until maximum matching is found\r\n while (findAugmentingPath());\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Maximum matching found</li>\");\r\n shortTrace.push(\"<li>Maximum matching found</li>\");\r\n frame = new Frame2(9, 5, longTraceNum++, ++shortTraceNum, graph.map(g => ([ ...g ])), [], []);\r\n frames.push(frame);\r\n\r\n}", "getNumActiveDiagnosed() { return this.E1[1] + this.I0[1] + this.I1[1] + this.I2[1] + this.I3[1]; }", "function charCountCompabilityCheck(seqs) {\n\tvar positionArray = new Array(seqs[0].length);\n\t// Create a base counter for each position:\n\tfor(var i = 0, n = seqs[0].length; i < n; i++) {\n\t\tpositionArray[i] = {A:0, T:0, G:0, C:0};\n\t}\n\t// Iterate over all sequences:\n\tvar seq;\n\tfor(var i = 0, n = seqs.length; i < n ; i++) {\n\t\tseq = seqs[i];\n\t\t// Iterate over all positions in current sequence:\n\t\tfor(var j = 0, m = seq.length; j < m; j++) {\n\t\t\t// Add one to the count for the base in this position:\n\t\t\tpositionArray[j][seq[j]] += 1;\n\t\t}\n\t}\n\t// Sum channel distribution:\n\tvar green;\n\tvar red;\n\tfor(var i = 0, n = seqs[0].length; i < n ; i++) {\n\t\tgreen = positionArray[i].T + positionArray[i].G;\n\t\tred = positionArray[i].A + positionArray[i].C;\n\t}\n\treturn (green > 0 && red > 0);\n}", "constructor(pattern_num, x = 0, y = 0, secondary = false) {\n this.pattern_num = pattern_num;\n this.blocks = [];\n this.pattern = shapes[pattern_num];\n this.color = colors[shape_color[pattern_num]];\n this.start_x = x;\n this.start_y = y;\n\n this.initialize_pattern = function () {\n if (this.blocks.length != 0) {\n let least_x = Infinity;\n let least_y = Infinity;\n this.blocks.forEach(block => {\n if (block.left < least_x) {\n least_x = block.left;\n }\n if (block.top < least_y) {\n least_y = block.top;\n }\n });\n while (least_x + this.pattern[0].length * field.block_width > canvas.width) {\n least_x -= field.block_width;\n }\n while (least_y + this.pattern.length * field.block_height > canvas.height) {\n least_y -= field.block_height;\n }\n\n\n this.start_x = least_x;\n this.start_y = least_y;\n }\n this.blocks = [];\n let start_x = this.start_x;\n let start_y = this.start_y;\n for (let i = 0; i < this.pattern.length; i += 1) {\n\n let row = this.pattern[i];\n for (let j = 0; j < row.length; j += 1) {\n let data = row[j];\n if (data != 1) {\n\n start_x += field.block_width;\n } else {\n let block = new game_block(this.color, start_x, start_y, secondary);\n this.blocks.push(block);\n start_x += field.block_width;\n }\n\n }\n start_x = this.start_x;\n start_y += field.block_height;\n }\n //this.start_y = start_y;\n }\n this.initialize_pattern_test = function (pattern) {\n let imaginary_blocks = [];\n let start_x;\n let start_y;\n if (this.blocks.length != 0) {\n let least_x = Infinity;\n let least_y = Infinity;\n this.blocks.forEach(block => {\n if (block.left < least_x) {\n least_x = block.left;\n }\n if (block.top < least_y) {\n least_y = block.top;\n }\n });\n while (least_x + pattern[0].length * field.block_width > canvas.width) {\n least_x -= field.block_width;\n }\n while (least_y + pattern.length * field.block_height > canvas.height) {\n least_y -= field.block_height;\n }\n\n\n start_x = least_x;\n start_y = least_y;\n }\n\n let st_x = start_x;\n for (let i = 0; i < pattern.length; i += 1) {\n\n let row = pattern[i];\n for (let j = 0; j < row.length; j += 1) {\n let data = row[j];\n if (data != 1) {\n\n start_x += field.block_width;\n } else {\n let block = new game_block(this.color, start_x, start_y);\n imaginary_blocks.push(block);\n start_x += field.block_width;\n }\n\n }\n start_x = st_x;\n start_y += field.block_height;\n }\n return imaginary_blocks;\n\n }\n this.get_vertical_height = function(){\n let smallest_top = Infinity;\n let biggest_bottom = -Infinity;\n this.blocks.forEach(block => {\n if(block.top < smallest_top){\n smallest_top = block.top;\n\n }\n if(block.bottom > biggest_bottom){\n biggest_bottom = block.bottom;\n }\n })\n return biggest_bottom - smallest_top;\n }\n this.delete_block = function (index) {\n this.blocks.splice(index, 1);\n }\n this.rotate_clockwise = function () {\n let new_pattern = rotate_array_clockwise(this.pattern);\n\n let imaginary_blocks = this.initialize_pattern_test(new_pattern);\n console.log(this.blocks, imaginary_blocks);\n let other_pieces = field.pieces;\n let inside_of_another = false;\n for (let i = 0; i < other_pieces.length; i += 1) {\n let other_piece = other_pieces[i];\n for (let j = 0; j < imaginary_blocks.length; j += 1) {\n let cur_block = imaginary_blocks[j];\n \n if (cur_block.inside_of_another_piece(other_piece) === true) {\n \n inside_of_another = true;\n break;\n }\n }\n if (inside_of_another === true) {\n break;\n }\n }\n if (inside_of_another === false) {\n this.pattern = new_pattern;\n\n this.initialize_pattern();\n }\n\n\n }\n this.initialize_pattern();\n this.draw = function () {\n this.blocks.forEach(function (block) {\n block.draw();\n })\n };\n this.touches_other_piece_bottom = function (pieces, excluded = -1) {\n for (let i = 0; i < pieces.length; i += 1) {\n if(excluded === i){\n continue;\n }\n let other_piece = pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_bottom(other_piece) === true) {\n \n return true;\n }\n }\n\n }\n return false;\n }\n this.touches_other_piece_right = function () {\n for (let i = 0; i < field.pieces.length; i += 1) {\n let other_piece = field.pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_right(other_piece) === true) {\n return true;\n }\n }\n\n }\n return false;\n }\n this.touches_other_piece_left = function () {\n for (let i = 0; i < field.pieces.length; i += 1) {\n let other_piece = field.pieces[i];\n for (let j = 0; j < this.blocks.length; j += 1) {\n if (this.blocks[j].touches_other_piece_left(other_piece) === true) {\n return true;\n }\n }\n\n }\n return false;\n }\n\n this.touches_bottom = function () {\n let touches_bottom = false;\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_bottom();\n if (temp === true) {\n touches_bottom = true;\n break;\n }\n }\n return touches_bottom;\n }\n this.move_down = function () {\n let touches_bottom = this.touches_bottom();\n let touches_other_piece_bottom = this.touches_other_piece_bottom(field.pieces);\n if (touches_bottom === false && touches_other_piece_bottom === false) {\n this.blocks.forEach(block => {\n block.move_down();\n });\n touches_bottom = this.touches_bottom();\n touches_other_piece_bottom = this.touches_other_piece_bottom(field.pieces);\n if (touches_bottom === true || touches_other_piece_bottom === true) {\n field.deactivate_piece();\n }\n } else if (touches_bottom === false || touches_other_piece_bottom === false) {\n field.deactivate_piece();\n }\n\n }\n this.move_right = function () {\n let touches_right = false;\n let touches_other_piece_right = this.touches_other_piece_right();\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_right();\n if (temp === true) {\n touches_right = true;\n break;\n }\n }\n if (touches_right === false && touches_other_piece_right === false) {\n\n this.blocks.forEach(block => {\n block.move_right();\n })\n }\n }\n this.move_left = function () {\n let touches_left = false;\n let touches_other_piece_left = this.touches_other_piece_left();\n for (let i = 0; i < this.blocks.length; i += 1) {\n let item = this.blocks[i];\n let temp = item.touches_left();\n if (temp === true) {\n touches_left = true;\n break;\n }\n }\n if (touches_left === false && touches_other_piece_left === false) {\n this.blocks.forEach(block => {\n block.move_left();\n })\n }\n }\n\n\n }", "function fineClassification(inputPattern, inputCandidates) {\n\t var inputLength = inputPattern.length;\n\t var candidates = [];\n\t for(var i=0;i<Math.min(inputCandidates.length, 100);i++) {\n\t var j = inputCandidates[i][0];\n\t var iLength = refPatterns[j][1];\n\t\t var iPattern = refPatterns[j][2];\n\t\t \t\t if(inputLength < iLength + 2 && inputLength > iLength-3) {\n\n\t\t var iMap = getMap(iPattern, inputPattern, initialDistance);\n\n\t\t iMap = completeMap(iPattern, inputPattern, wholeWholeDistance, iMap);\n\t\t if(refPatterns[j][0] == \"委\") {\n\t\t console.log(\"finished imap, fine:\");\n\t\t console.log(iMap);\n\t\t\t console.log(\"weight:\")\n\t\t\t console.log(computeDistance(iPattern, inputPattern, wholeWholeDistance, iMap));\n\t\t\t console.log(\"weight intended:\")\n\t\t\t console.log(computeDistance(iPattern, inputPattern, wholeWholeDistance, [0,1,2,3,4,7,5,6]));\n\t\t\t }\n\t\t var dist = computeWholeDistanceWeighted(iPattern, inputPattern, iMap);\n\t\t var n = inputLength;\n\t\t var m = iPattern.length;\n\t\t if(m > n) {\n\t\t m = n;\n\t\t }\n\t\t dist = dist / m;\n\t\t candidates.push([j, dist]);\n\t }\n\t }\n\t candidates.sort(function(a, b){return a[1]-b[1]});\n\t var outStr = \"\";\n\t for(var i=0;i<Math.min(candidates.length, 10);i++) {\n\t //outStr += candidates[i][0];\n\t\t //outStr += \" \";\n\t\t //outStr += candidates[i][1];\n\t\t outStr += refPatterns[candidates[i][0]][0];\n\t\t outStr += \" \";\t \n\t }\t \n\t document.getElementById(\"candidateList\").innerHTML = outStr;\n\t}", "alignmentTraceback(){\n let inProcessAlignments = [];\n\n inProcessAlignments.push({ pos: [this.sequence1.length, this.sequence2.length],\n seq1: \"\",\n seq2: \"\"\n });\n\n while(inProcessAlignments[0]){\n let current = inProcessAlignments[0];\n let directions = this.tracebackGrid[current.pos[0]][current.pos[1]];\n\n if(directions[0]){\n inProcessAlignments.push({ pos: [current.pos[0]-1, current.pos[1]-1],\n seq1: (this.sequence1[current.pos[0]-1] + current.seq1),\n seq2: (this.sequence2[current.pos[1]-1] + current.seq2)\n });\n }\n if(directions[1]){\n inProcessAlignments.push({ pos: [current.pos[0]-1, current.pos[1]],\n seq1: this.sequence1[current.pos[0]-1] + current.seq1,\n seq2: '-' + current.seq2\n });\n }\n if(directions[2]){\n inProcessAlignments.push({ pos: [current.pos[0], current.pos[1]-1],\n seq1:'-' + current.seq1,\n seq2: this.sequence2[current.pos[1]-1] + current.seq2\n });\n }\n\n if(current.pos[0] === 0 && current.pos[1] === 0)\n this.alignments.push({sequence1 : current.seq1,\n sequence2: current.seq2\n });\n\n inProcessAlignments.shift();\n }\n\n return this.alignments;\n }", "function findDiscontinuousReferenceFrag(prevDetails,curDetails){var prevFrags=prevDetails.fragments;var curFrags=curDetails.fragments;if(!curFrags.length||!prevFrags.length){logger_1.logger.log('No fragments to align');return;}var prevStartFrag=findFirstFragWithCC(prevFrags,curFrags[0].cc);if(!prevStartFrag||prevStartFrag&&!prevStartFrag.startPTS){logger_1.logger.log('No frag in previous level to align on');return;}return prevStartFrag;}", "function checkLengths(board) {\n var found = [];\n board.forEach(function(row, r) {\n row.forEach(function(cell, c) {\n if(cell.state !== 'fill') return;\n if(cell.invalid) return;\n if(getCellFill(board, r-1, c)) return;\n if(getCellFill(board, r, c-1)) return;\n\n var sizeD = checkLengths.project(board, r, c, 1, 0);\n var sizeR = checkLengths.project(board, r, c, 0, 1);\n if(!sizeD || !sizeR) return; // if either is invalid, then nothing was matched\n\n found.push(Math.max(sizeD, sizeR));\n });\n });\n\n var sizes = {};\n found.forEach(function(s) {\n sizes[s] = (sizes[s]||0)+1;\n });\n\n board.len.forEach(function(l) { l.done = false; l.over = false; });\n _.forEach(sizes, function(count, size) {\n var lens = board.len.filter(function(l) { return l.size === +size; });\n\n if(lens.length < +count) {\n // if we found more lengths defined than we actually have\n lens.forEach(function(l) { l.over = true; });\n } else {\n // we can account for all the lengths we found\n lens.slice(0, +count).forEach(function(l) { l.done = true; });\n }\n });\n}", "function check_horizontal(row, col, color) {\n let count = 1\n let temp = col\n while (col > 0) {\n let $left_cell = get_cell(row, --col)\n console.log(col, color, 'left count')\n console.log($left_cell)\n if ($left_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ left')\n }\n else {\n break\n }\n }\n col = temp\n while (col < that.col) {\n let $right_cell = get_cell(row, ++col)\n console.log(col, color, 'right count')\n console.log($right_cell)\n if ($right_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ right')\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }", "checkCollide(trials) {\n \n \n let infosRow = {rowUp: {row:1, top:0}, rowDown:{row:2, top:125}};\n let arrayRow = [];\n let iteration = 1;\n\n let isCollide = this.doCheckCollide(trials, infosRow); \n\n // There is collide so need to prevent all overlap\n while(isCollide) {\n\n let newtrialsCopy = [...trials.filter(trial => trial.row == iteration)];\n infosRow = {rowUp: {row:iteration+1, top:125}, rowDown:{row:iteration+2, top:(125/2) +125}};\n this.doCheckCollide(newtrialsCopy, infosRow); \n if(iteration >= trials.length) {\n break;\n }\n iteration ++;\n }\n this.setState({ trials: trials });\n return trials;\n }", "changeState(leftBoarderDistance, downDistance, board, bS, next) {\n let distanceB = Math.round(downDistance / blockSize); // Distance in blocks to bottom border\n let distance = (Math.round(leftBoarderDistance / blockSize)); // Distance in blocks to left border\n if (this.calc == false) {\n if (this.check(leftBoarderDistance, downDistance, board, bS, next) == false) {\n return;\n }\n }\n switch (this.blockNumber) { // Switch depending on block\n case 1: {\n switch (this.state) { //Check state\n case 1: {\n if (distance < 5) {\n for (let i = 0; i < this.res.children.length; i++) {\n this.res.children[i].y = 3 * blockSize;\n this.res.children[i].x = (i) * blockSize;\n }\n }\n else {\n for (let i = 0; i < this.res.children.length; i++) {\n this.res.children[i].y = 3 * blockSize;\n this.res.children[i].x = (i - 3) * blockSize;\n }\n }\n this.state = 2;\n break;\n }\n case 2: {\n if (distance < 5) {\n for (let i = 0; i < this.res.children.length; i++) {\n this.res.children[i].x = 0;\n this.res.children[i].y = blockSize * i;\n }\n }\n else {\n for (let i = 0; i < this.res.children.length; i++) {\n this.res.children[i].x = 0;\n this.res.children[i].y = blockSize * i;\n }\n }\n this.state = 1;\n break;\n }\n }\n }\n case 2: {\n break;\n }\n case 3: {\n // Variable holding next/previous state, we don't want to change main variable until we change the state\n let state = this.stateChanger(next);\n switch (state) {\n case 1: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * i;\n this.res.children[i].x = 0;\n }\n else {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 2: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = 0;\n this.res.children[i].x = blockSize * (i + 1);\n }\n else {\n this.res.children[i].y = blockSize * (i - 1);\n this.res.children[i].x = blockSize;\n }\n }\n if (next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 3: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize * (i - 1);\n this.res.children[i].x = blockSize * 2;\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n case 4: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * 2;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize * (i - 2);\n this.res.children[i].x = blockSize;\n }\n }\n if (!next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n }\n break;\n }\n case 4: {\n // Variable holding next/previous state, we don't want to change main variable until we change the state\n let state = this.stateChanger(next);\n switch (state) {\n case 1: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i == 0) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = 0;\n }\n else {\n this.res.children[i].y = (i - 1) * blockSize;\n this.res.children[i].x = blockSize;\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 2: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i == 0) {\n this.res.children[i].y = 0;\n this.res.children[i].x = blockSize;\n }\n else {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = (i - 1) * blockSize;\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 3: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i == 0) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = 2 * blockSize;\n }\n else {\n this.res.children[i].y = (i - 1) * blockSize;\n this.res.children[i].x = blockSize;\n }\n }\n if (next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n case 4: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 3) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = i * blockSize;\n }\n else {\n this.res.children[i].y = 2 * blockSize;\n this.res.children[i].x = blockSize;\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n }\n break;\n }\n case 5: {\n // Variable holding next/previous state, we don't want to change main variable until we change the state\n let state = this.stateChanger(next);\n switch (state) {\n case 1: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = 0;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 2: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * i;\n this.res.children[i].x = blockSize;\n }\n else {\n this.res.children[i].y = blockSize * (i - 1);\n this.res.children[i].x = blockSize * 2;\n }\n }\n if (next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 3: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * 2;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n case 4: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * i;\n this.res.children[i].x = 0;\n }\n else {\n this.res.children[i].y = blockSize * (i - 1);\n this.res.children[i].x = blockSize;\n }\n }\n if (!next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n }\n break;\n }\n case 6: {\n // Variable holding next/previous state, we don't want to change main variable until we change the state\n let state = this.stateChanger(next);\n switch (state) {\n case 1: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 3) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = 0;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 2: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 3) {\n this.res.children[i].y = blockSize * i;\n this.res.children[i].x = blockSize;\n }\n else {\n this.res.children[i].y = blockSize * 2;\n this.res.children[i].x = blockSize * 2;\n }\n }\n if (next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 3: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 3) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize * 2;\n this.res.children[i].x = 0;\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n case 4: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 3) {\n this.res.children[i].y = blockSize * i;\n this.res.children[i].x = blockSize;\n }\n else {\n this.res.children[i].y = 0;\n this.res.children[i].x = 0;\n }\n }\n if (!next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n }\n break;\n }\n case 7: {\n let state = this.stateChanger(next);\n switch (state) {\n case 1: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = 0;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 2: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * (i + 1);\n this.res.children[i].x = blockSize;\n }\n else {\n this.res.children[i].y = blockSize * (i - 2);\n this.res.children[i].x = blockSize * 2;\n }\n }\n if (next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n case 3: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize;\n this.res.children[i].x = blockSize * i;\n }\n else {\n this.res.children[i].y = blockSize * 2;\n this.res.children[i].x = blockSize * (i - 1);\n }\n }\n if (next) {\n this.res.x += blockSize * (distance == 0 ? 1 : 0);\n }\n else {\n this.res.x += blockSize * (distance == 8 ? -1 : 0);\n }\n this.state = state;\n break;\n }\n case 4: {\n for (let i = 0; i < this.res.children.length; i++) {\n if (i < 2) {\n this.res.children[i].y = blockSize * (i + 1);\n this.res.children[i].x = 0;\n }\n else {\n this.res.children[i].y = blockSize * (i - 2);\n this.res.children[i].x = blockSize;\n }\n }\n if (!next) {\n this.res.y -= blockSize * (distanceB == 0 ? 1 : 0);\n }\n this.state = state;\n break;\n }\n }\n break;\n }\n }\n }", "goToNextStep() {\n let diffCount = 0;\n this._cells = this._cells.map((cell, index) => {\n let neighbours = this._layout.getNeighbours(index);\n\n let aliveNeighbours = neighbours.filter(listIndex => this._cells[listIndex]);\n\n if (cell) {\n // RULE NO. 1 AND NO. 3\n if (aliveNeighbours.length < 2 || aliveNeighbours.length > 3) {\n diffCount++;\n return false;\n }\n } else {\n // RULE NO. 4\n if (aliveNeighbours.length === 3) {\n diffCount++;\n return true;\n }\n }\n\n // REST GOES TO RULE NO. 2\n return cell;\n });\n\n if (diffCount > 0) {\n this._gameState = GameState.PROGRESS;\n } else {\n this._gameState = GameState.DONE;\n }\n }", "function newGrid() {\n // Checks how many living neighboring cells each cell has\n // Iterate the grid\n for (let i = 0; i < dimension; i++) {\n for (let j = 0; j < dimension; j++) {\n // Count surrounding living cells\n let cellsCount = 0;\n // Check the three cells above the current one\n if (i !== 0) { // continue only if this is not the first/zero row\n if (j !== 0) // continue only if this is not the first/zero column\n cellsCount += grid[i - 1][j - 1];\n cellsCount += grid[i - 1][j];\n if (j !== (dimension - 1)) // continue only if this is not the last column\n cellsCount += grid[i - 1][j + 1];\n }\n // Check the cell on the left\n if (j !== 0) // continue only if this is not the first/zero column\n cellsCount += grid[i][j - 1];\n // Check the cell on the right \n if (j !== (dimension - 1)) // continue only if this is not the last column\n cellsCount += grid[i][j + 1];\n // Check the three cells below the current one\n if (i !== (dimension - 1)) {\n if (j !== 0) // continue only if this is not the first/zero column\n cellsCount += grid[i + 1][j - 1];\n cellsCount += grid[i + 1][j];\n if (j !== (dimension - 1)) // continue only if this is not the last column\n cellsCount += grid[i + 1][j + 1];\n }\n\n // Check if the currnet cell is dead\n if (grid[i][j] === 0) {\n // Become alive if three surrounding cells are alive, else die\n if (cellsCount === 3) {\n copiedGrid[i][j] = 1;\n } else {\n copiedGrid[i][j] = 0;\n }\n } \n // Current cell is alive\n else if (grid[i][j] === 1) {\n // stay alive with 2 or 3 living neighbours, else die\n if (cellsCount === 2 || cellsCount === 3) {\n copiedGrid[i][j] = 1;\n } else {\n copiedGrid[i][j] = 0;\n }\n }\n }\n }\n\n // Copy the temporary grid in real one\n for (let j = 0; j < dimension; j++) {\n for (let k = 0; k < dimension; k++) {\n grid[j][k] = copiedGrid[j][k];\n }\n }\n\n drawGrid();\n}", "Board_Evaluation(board, color) {\n let result = { two: 0, three: 0, four: 0 };\n\n for (var i = 0; i < 6; i++) {\n for (var j = 0; j < 7; j++) {\n if (board[i][j] === color) {\n let x = j;\n let y = i;\n let arr = [\n this.search2(x, y, color, 1, 0, 0, board),\n this.search2(x, y, color, -1, 0, 0, board),\n this.search2(x, y, color, 1, 1, 0, board),\n this.search2(x, y, color, -1, -1, 0, board),\n this.search2(x, y, color, -1, 1, 0, board),\n this.search2(x, y, color, 1, -1, 0, board),\n this.search2(x, y, color, 0, 1, 0, board),\n this.search2(x, y, color, 0, -1, 0, board),\n ];\n\n for (var q = 0; q < 4; q++) {\n switch (arr[2 * q].count + arr[2 * q + 1].count - 1) {\n case 2:\n if (arr[2 * q].live) result.two++;\n break;\n\n case 3:\n if (arr[2 * q].live + arr[2 * q + 1].live > 0) {\n result.three++;\n } else if (\n arr[2 * q].live + arr[2 * q + 1].live ===\n 2\n ) {\n console.log(1);\n result.four++;\n }\n break;\n\n case 4:\n result.four++;\n break;\n }\n }\n }\n }\n }\n return result;\n }", "checkForMatch() {\n\n // Matching horizontal lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._topMiddle.textContent && this._topMiddle.textContent === this._topRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._topMiddle.style.backgroundColor = 'green'\n this._topRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._middleLeft.textContent === 'X' || this._middleLeft.textContent === '0') {\n \n if(this._middleLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._middleRight.textContent) {\n this._middleLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._bottomLeft.textContent === 'X' || this._bottomLeft.textContent === '0') {\n \n if(this._bottomLeft.textContent === this._bottomMiddle.textContent && this._bottomMiddle.textContent === this._bottomRight.textContent) {\n this._bottomLeft.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n // Matching vertical lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleLeft.textContent && this._middleLeft.textContent == this._bottomLeft.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleLeft.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topMiddle.textContent === 'X' || this._topMiddle.textContent === '0') {\n \n if(this._topMiddle.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent == this._bottomMiddle.textContent) {\n this._topMiddle.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topRight.textContent === 'X' || this._topRight.textContent === '0') {\n \n if(this._topRight.textContent === this._middleRight.textContent && this._middleRight.textContent == this._bottomRight.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n \n // Matching diagonal lines\n if(this._middleMiddle.textContent === 'X' || this._middleMiddle.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n\n if(this._topRight.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomLeft.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n }", "apply(mutableBoardData, cloneSquare){\n //5..2...4....6.3....3...9..7..3..7.....7..8...6......2..8......3...4..6.....1..5..\n let mutations = 0;\n this.cellIndexes.forEach( (cellIdx, index, array) => {\n let immutableSquare = mutableBoardData[cellIdx];\n let replacementCandidates = [...immutableSquare.candidates];\n \n \n // unlike cage, littleKiller can have repeats in other boxes.\n\n \n let otherCellIndexes = this.cellIndexes.filter( i=> i!== cellIdx);\n replacementCandidates.forEach( (candidate, cIndex, cArray) => {\n if( candidate > 0 ){\n if( ! this.cageValidates(mutableBoardData, this.value-candidate, otherCellIndexes)){\n replacementCandidates[cIndex] = 0;\n mutations = mutations+1;\n }\n \n\n }\n });\n \n\n \n \n \n\n // if the region has a candidate that exists in the intersection of two regions, \n // and the candidate only exists in that intersection on the Other rule, \n //then this candidate must also exist within said intersection on this rule!\n\n\n if( mutations>0 ){\n let newSquareData = cloneSquare(immutableSquare);\n console.log(\"Removing value from square\");\n newSquareData.candidates = replacementCandidates;\n \n mutableBoardData[cellIdx]=newSquareData;\n }\n\n \n \n\n });\n return mutations;\n \n }", "function getChainLength(x:int, y: int, xIncrement: int, yIncrement: int){\n\tvar countUp = 0;\n\tvar countDown = 0;\n\twhile (cells[x + countUp * xIncrement, y + countUp * yIncrement].cellStatus == cells[x,y].cellStatus){\n\t\tcountUp ++;\n\t\tif (Mathf.Max(x + countUp * xIncrement, y + countUp * yIncrement) > xSize - 1 || Mathf.Min(x + countUp * xIncrement, y + countUp * yIncrement) < 0){\n\t\t\tbreak;\n\t\t}\n\t}\n\twhile (cells[x - countDown * xIncrement, y - countDown * yIncrement].cellStatus == cells[x,y].cellStatus){\n\t\tcountDown ++;\n\t\tif (Mathf.Max(x - countDown * xIncrement, y - countDown * yIncrement) > xSize - 1 || Mathf.Min(x - countDown * xIncrement, y - countDown * yIncrement) < 0){\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn countUp + countDown - 1;\n}", "function decide() {\n\t\t\t\tvar recognise = false;\n\t\t\t\tif(fromAbove && fromBelow) {\n\t\t\t\t\tif(fromAbove == fromBelow) {\n\t\t\t\t\t\talert(\"Pattern recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.childAddress[i].x][self.childAddress[i].y][self.childAddress[i].z](fromBelow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Pattern not recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.parentAddress.x][self.parentAddress.y][self.parentAddress.z](fromBelow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "countBlockTurns(move) {\n let layerCount = move.getLayerCount();\n let layerMask = move.getLayerMask();\n let turns = Math.abs(move.getAngle()) % 4;\n if (turns == 0) {\n return 0;\n } else {\n let previousTurnedLayer = 0;\n let countTurned = 0;\n let previousImmobileLayer = 1;\n let countImmobile = 0;\n for (let i = 0; i < layerCount; i++) {\n let currentLayer = (layerMask >>> i) & 1;\n if (currentLayer == 1 && currentLayer != previousTurnedLayer) {\n countTurned++;\n }\n if (currentLayer == 0 && currentLayer != previousImmobileLayer) {\n countImmobile++;\n }\n previousTurnedLayer = previousImmobileLayer = currentLayer;\n }\n return Math.min(countTurned, countImmobile);\n }\n }", "set _physicalStart(val){val=val%this._physicalCount;if(0>val){val=this._physicalCount+val}if(this.grid){val=val-val%this._itemsPerRow}this._physicalStartVal=val}", "calcMaxLength () {\n let maxima = [0.0, 0.0, 0.0]\n let minima = [0.0, 0.0, 0.0]\n let spans = [0.0, 0.0, 0.0]\n\n function comp (v, i) {\n if (i === 0) return v.x\n if (i === 1) return v.y\n if (i === 2) return v.z\n }\n\n let atom = this.getAtomProxy()\n for (let iDim = 0; iDim < 3; iDim++) {\n for (let iAtom = 0; iAtom < this.getAtomCount(); iAtom += 1) {\n let pos = atom.load(iAtom).pos\n if (minima[iDim] > comp(pos, iDim)) {\n minima[iDim] = comp(pos, iDim)\n }\n if (maxima[iDim] < comp(pos, iDim)) {\n maxima[iDim] = comp(pos, iDim)\n }\n }\n spans[iDim] = maxima[iDim] - minima[iDim]\n }\n this.maxLength = Math.max(spans[0], spans[1], spans[2])\n }", "step() {\n let backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0 \n let currentBuffer = this.bufferr[this.currentBufferIndex];\n let backBuffer = this.buffer[this.backBufferIndex];\n \n\n // helper function to see if cell has infectious neighbor\n const hasInfectiousNeighbour = (x, y) => {\n const nextValue = (currentBuffer[y][x] + 1) % MODULO;\n\n // check west neighbour to see if it has nextValue\n if (x > 0) { // if it isn't it has no west neighbour it's a col 0\n if(currentBuffer[y][x-1] === nextValue) {\n return true; \n }\n } \n\n // check North, note x,y 00 is top left not bottom left of graph\n if (y > 0) { // if it isn't it has no north neighbour\n if(currentBuffer[y - 1][x] === nextValue) {\n return true; \n }\n } \n\n // check south\n if (y < this.height - 1) { // if it isn't it has no north neighbour\n if(currentBuffer[y + 1][x] === nextValue) {\n return true; \n }\n }\n\n // check east\n if (x < this.width - 1) { // if it isn't it has no north neighbour\n if(currentBuffer[y][x + 1] === nextValue) {\n return true; \n }\n }\n\n // default case, none of the neighbours have the value or infection\n return false; \n\n }\n\n // loop through the current buffer and populate backbuffer based on currenbufer \n // infected neighbour value\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.lenght; x++) {\n if (hasInfectiousNeighbour(x,y)) { // backbuffer value is next val\n backBuffer[x][y] = (currentBuffer[y][x] + 1) % MODULO; \n } else { // backBuffer same as current buffer\n backBuffer[y][x] = currentBuffer[y][x];\n }\n\n }\n }\n this.currentBufferIndex = backBufferIndex;\n }", "_calculateBlockIndex() {\n var curX = this.startX;\n var maxH = 0;\n let superXAlign = 0;\n let superXWidth = 0;\n let prevBlock = null;\n let i = 0;\n this.textFont.setFontSize(this.fontSize);\n this.blocks.forEach((block) => {\n // super/subscript\n const sp = this.isSuperscript(block);\n const sub = this.isSubcript(block);\n\n block.width = 0;\n block.height = 0;\n\n // coeff for sub/super script\n const subAdj = (sp || sub) ? VF.ChordSymbol.superSubRatio : 1.0;\n // offset for super/sub\n let subOffset = 0;\n if (sp) {\n subOffset = SuiInlineText.superscriptOffset * this.pointsToPixels;\n } else if (sub) {\n subOffset = SuiInlineText.subscriptOffset * this.pointsToPixels;\n } else {\n subOffset = 0;\n }\n block.x = curX;\n if (block.symbolType === SuiInlineText.symbolTypes.TEXT) {\n for (i = 0; i < block.text.length; ++i) {\n const ch = block.text[i];\n\n const glyph = this.textFont.getMetricForCharacter(ch);\n block.width += ((glyph.advanceWidth) / this.textFont.resolution) * this.pointsToPixels * block.scale * subAdj;\n const blockHeight = (glyph.ha / this.textFont.resolution) * this.pointsToPixels * block.scale;\n block.height = block.height < blockHeight ? blockHeight : block.height;\n block.y = this.startY + (subOffset * block.scale);\n }\n } else if (block.symbolType === SuiInlineText.symbolTypes.GLYPH) {\n block.width = (block.metrics.advanceWidth / VF.ChordSymbol.engravingFontResolution) * this.pointsToPixels * block.scale;\n block.height = (block.glyph.metrics.ha / VF.ChordSymbol.engravingFontResolution) * this.pointsToPixels * block.scale;\n block.x += block.metrics.leftSideBearing / VF.ChordSymbol.engravingFontResolution * this.pointsToPixels * block.scale;\n block.y = this.startY + this._glyphOffset(block) + subOffset;\n }\n // Line subscript up with super if the follow each other\n if (sp) {\n if (superXAlign === 0) {\n superXAlign = block.x;\n }\n } else if (sub) {\n if (superXAlign > 0) {\n block.x = superXAlign;\n superXWidth = prevBlock.x + prevBlock.width;\n curX = superXAlign;\n superXAlign = 0;\n } else {\n if (superXWidth > 0 && superXWidth < block.width + block.x) {\n superXWidth = block.width + block.x;\n }\n }\n } else if (superXWidth > 0) {\n block.x = superXWidth + VF.ChordSymbol.spacingBetweenBlocks;\n superXWidth = 0;\n } else {\n superXAlign = 0;\n }\n curX += block.width;\n maxH = block.height > maxH ? maxH : block.height;\n prevBlock = block;\n });\n this.width = curX - this.startX;\n this.height = maxH;\n this.updatedMetrics = true;\n }", "step() {\n // !!!! IMPLEMENT ME !!!!\n const currentCells = this.cells[this.activeBuffer];\n const nextCells = this.cells[this.activeBuffer === 1 ? 0 : 1];\n\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n const count = this.getLiveNeighborCount.call(this, h, w);\n\n if (currentCells[h][w]) {\n if (count < 2 || count > 3) {\n nextCells[h][w] = false;\n } else {\n nextCells[h][w] = true;\n }\n } else {\n if (count === 3) {\n nextCells[h][w] = true;\n } else {\n nextCells[h][w] = false;\n }\n }\n }\n }\n this.activeBuffer = this.activeBuffer === 1 ? 0 : 1;\n }", "function checkSequence(){\n\t console.log(\"checking\");\n\t if (JSON.stringify(pattern) === JSON.stringify(userPattern)){\n\t\t\telementScore.innerHTML ++;\n\t\t\tif(elementHigh.innerHTML < elementScore.innerHTML){\n\t\t\t elementHigh.innerHTML++;\n\t\t\t}\n\t/* The next level function is called if they are, if not end game.*/\t\n\t\t \n\t\t console.log(\"next\");\n\t nextLevel();\n\t }\n\t\telse {\n\t\t\n\t\t\tendGame();\n\t\t} \n }", "checkRows() {\n for (let o = 0; o < this.canvasheight / this.blockSize; o++) {\n let row = 0;\n for (let i = 0; i < this.blocks.length; i++){\n if (this.blocks[i].y === o){\n row++;\n }\n }\n\n if (row === this.canvaswidth / this.blockSize){\n this.remove(o);\n }\n }\n }", "function matchPattern(pattern,genome) {\n //console.log(pattern);\n //console.log(genome);\n //console.log(\"genome length : \" + genome.length);\n var positions = [];\n for(var i=0;i<=genome.length-pattern.length;i++) {\n var str = computeText(genome,i,pattern.length);\n // console.log(str);\n if(str==pattern) {\n positions.push(i);\n }\n }\n return positions;\n /*\n var output = \"\";\n for(var i=0;i<positions.length;i++) {\n output = output + positions[i] + \" \";\n }\n return output;\n */\n}", "noOfScan() {\n\n return new Promise(async (resolve, reject) => {\n\n let imgBytes = await this.toIntegerArray();\n\n let scanCount = 0;\n \n let SOS = this.SOS;\n\n let imgBytesLength = imgBytes.length;\n \n //0xFFDA\n for (let i = 0; i < imgBytesLength; i = i + 2) {\n //0xFFDA\n if (imgBytes[i] === SOS[0] && imgBytes[i + 1] === SOS[1]) {\n scanCount++;\n }\n }\n \n resolve(scanCount);\n });\n }", "parseBlock(s, currentRehearsalGroup, latest_variables){\n // parase until block boundary is found\n // block boundary = \"[\" or 2 successive NL or NOL\n try{\n var r = null;\n var loop_cnt = 0;\n\n var block = new common.Block();\n var current_align = \"expand\";\n\n this.context.contiguous_line_break = 0; // This should be done only if NL is really consumed.\n\n let num_meas_row = 0;\n\n let MAX_LOOP = 1000;\n\n let end_of_rg = false;\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n r = this.nextToken(s);\n if (r.type == TOKEN_END){\n s = r.s; // explicitly consume the last spaces if any.\n end_of_rg = true;\n break;\n }else if (r.type == TOKEN_NL) {\n this.context.line += 1;\n this.context.contiguous_line_break += 1;\n current_align = \"expand\"; // default is expand\n //if(this.context.contiguous_line_break >= 2) break; Do not break here. If the first non NL element is found, then break.\n } else if(r.type == TOKEN_BACK_SLASH){\n if(this.context.contiguous_line_break >= 2) break;\n // Expect TOKEN_NL \n r = this.nextToken(r.s);\n if(r.type != TOKEN_NL) this.onParseError(\"INVALID CODE DETECTED AFTER BACK SLASH\");\n this.context.line += 1;\n //block.appendChild(new common.RawSpaces(r.sss));\n //block.appendChild(new common.RawSpaces(r.token)); \n // Does not count as line break\n }else if(r.type == TOKEN_BRACKET_RA){\n if(this.context.contiguous_line_break >= 2) break;\n // Right aligh indicoator > which is outside measure\n current_align = \"right\";\n }else if(r.type == TOKEN_BRACKET_LA){\n if(this.context.contiguous_line_break >= 2) break;\n // Right aligh indicoator > which is outside measure\n current_align = \"left\";\n } else if (r.type == TOKEN_BRACKET_LS) {\n // Next rehearsal mark detected.\n // Do not consume.\n end_of_rg = true;\n break;\n } else if (\n [\n TOKEN_MB,\n TOKEN_MB_DBL,\n TOKEN_MB_LOOP_BEGIN,\n TOKEN_MB_LOOP_END,\n TOKEN_MB_LOOP_BOTH,\n TOKEN_MB_FIN,\n TOKEN_MB_DBL_SIMILE\n ].indexOf(r.type) >= 0\n ) {\n if(this.context.contiguous_line_break >= 2) break;\n\n let is_new_line_middle_of_block = num_meas_row > 0 && this.context.contiguous_line_break == 1;\n\n this.context.contiguous_line_break = 0;\n \n r = this.parseMeasures(r, r.s); // the last NL has not been consumed.\n // Apply the variables valid at this point for each measures\n //r.measures.forEach(m=>{ m.variables = common.shallowcopy(latest_variables);});\n r.measures.forEach(m=>{\n for(let key in latest_variables){\n m.setVariable(latest_variables[key]);\n }\n });\n\n // For the first measure, set align and new line mark.\n r.measures[0].align = current_align;\n r.measures[0].raw_new_line = is_new_line_middle_of_block; // mark to the first measure\n block.concat(r.measures);\n\n ++num_meas_row;\n\n } else if (r.type == TOKEN_PERCENT) {\n if(this.context.contiguous_line_break >= 2) break;\n // Expression\n r = this.parseVariable(r.s); // last NL would not be consumed\n let variable = new common.Variable(r.key, r.value);\n //block.setVariable(r.key, r.value); Do not do this as with this, only the last variable will be valid.\n latest_variables[r.key] = variable;\n block.appendChild(variable);\n this.context.contiguous_line_break = 0; // -= 1; // Does not reset to 0, but cancell the new line in the same row as this variable\n } else {\n console.log(r.token);\n this.onParseError(\"ERROR_WHILE_PARSE_MOST_OUTSIDER\");\n }\n s = r.s;\n loop_cnt++;\n if (loop_cnt >= MAX_LOOP){\n throw \"Too much elements or infnite loop detected with unkown reason\";\n }\n }\n return { block:block, s:s, end_of_rg:end_of_rg};\n }catch(e){\n console.error(e);\n return null;\n }\n }", "function ascendingdiagonalline(prevrow, prevcol) {\n var currchip = null;\n var prevchip = 0;\n var count = 0;\n\n for (var row = 0; row < 6; row++) {\n //for any coordinate in an ascending diagonal, sum of col and row are the same\n //thus when row increases by 1, col decreases by 1\n //row = 0 is the top-right of diagonal; row = 5 is the bottom-left of diagonal\n var col = prevcol + prevrow - row;\n if (col >=0 && col < 7) {\n\n currchip = board[row][col];\n if (currchip == prevchip && currchip != 0) {\n count++;\n }\n else {\n count = 0;\n }\n //count == 3 when four chips are in a line\n if (count == UI.wincondition - 1) {\n return true;\n }\n //set previous chip to current chip for next comparison\n prevchip = currchip;\n\n }\n }\n\n //else no ascending diagonal line\n return false;\n}", "function macthCount(current, goal) {\n let matchC = 0;\n for (let i = 0; i < current.length; i++) {\n for (let j = 0; j < current[i].length; j++) {\n if (current[i][j] == goal[i][j]) {\n matchC++;\n }\n }\n }\n return (matchC==9)?true:false;\n}", "function binaryPlacement(pEn,pKay,set,pItemSet,writtenTo)\n{\n this.inPosition =[];\n this.itemSet=pItemSet;\n this.kay=pKay;\n this.en=pEn;\n var low = ((this.en-this.kay)>this.kay)?this.kay:this.en-this.kay;\n var top = en-low;\n var curPosCapt =writtenTo.slice();\n var lastStart=[0]\n var aftFirst = false;\n\nfor (var cA=0;cA<set.length;cA++)\n {\n if (cA<low)\n {\n curPosCapt[set[cA]]=this.itemSet[0];\n }\n else\n {\n curPosCapt[set[cA]]=this.itemSet[1];\n }\n }\n \n if (this.en==this.kay)\n {\n return curPosCapt.slice();\n }\n \nfunction BAForRep(start,pSet,aftFirst,leve,leveA,lastStart,curPosCapt)\n//function BAForRep(start,pSet,aftFirst,en,leve,leveA,lastStart,curPosCapt)\n{\n //if we are at last row\n if(leve==this.kay-1)\n {\n for (var cj=start;cj<(this.en-this.kay+leve+1);cj++)\n {\n if ((cj==(this.kay-1))&&(leve==(this.kay-1)))\n {\n aftFirst = false\n }\n else\n {\n aftFirst = true;\n }\n curPosCapt[pSet[cj]]=this.itemSet[0];\n \n// Logger.log(\"content: \"+apArray[apArray.length-1]+ \"ref : \"+(apArray.length-1)+\" dif : \"+(apArray[apArray.length-1]-(apArray.length-1))+\"boolean :\"+aftFirst)\n// if (apArray[apArray.length-1]>(apArray.length-1))\n if (aftFirst)\n {\n if (cj==start)\n {\n for (var cp=cj-leve-1;cp<(this.en-this.kay);cp++)\n if(cp==cj-leve-1)\n {\n curPosCapt[cp+(leve-1)-lastStart[0]]=this.itemSet[1];\n }\n else\n {\n curPosCapt[pSet[cp+this.kay]]=this.itemSet[1];\n }\n }\n else\n {\n curPosCapt[pSet[cj-1]]=this.itemSet[1];\n }\n }\n this.inPosition.push(curPosCapt.slice());\n }\n if (start==(this.en-1))\n {\n lastStart[0]=lastStart[0]+1;\n var int = 5;\n }\n else\n {\n lastStart[0]=0;\n }\n }\n else\n {\n //on any call the start value is the value at the current level\n start=leveA;\n //starting at that value go up to the en - length+leve +1\n for (var ck=start;ck<(this.en-this.kay+leve+1);ck++)\n {\n //write the counter value to this level position\n leveA++;\n curPosCapt[pSet[ck]]=this.itemSet[0];\n //call the next level with this one holding array that\n //has just been fed ck.\n //increase level by one and\n //make the value one higher\n BAForRep(ck+1,pSet,aftFirst,leve+1,leveA,lastStart,curPosCapt)\n// BAForRep(ck+1,pSet,aftFirst,en,leve+1,leveA,lastStart,curPosCapt)\n //after we have written arrays for the last level\n //we will snap back at each level\n //and we run the ascending sequence to the end\n for (var cm=leve+1;cm<this.kay-1;cm++)\n {\n curPosCapt[pSet[ck+(cm-leve)+1]]=this.itemSet[0];\n }\n }\n }\n}\n\n BAForRep(0,set,aftFirst,0,0,lastStart,curPosCapt.slice());\n// BAForRep(0,set,aftFirst,en,0,0,lastStart,curPosCapt.slice());\n// if (this.splitB)\n// {\n// return [this.captureF,this.captureS,this.inPosition];\n// }\n// else\n// {\n// return [capture,this.inPosition];\n return this.inPosition;\n\n// }\n}", "function horizontalWinCheck() {\n for(var row=0;row<6;row++) {\n for(var col = 0;col < 4;col++){\n if(colorMatchCheck(returnColor(row,col), returnColor(row,col+1), returnColor(row,col+2))) {\n console.log('horizontal');\n reportWin(row,col);\n return true;\n }else {\n continue;\n }\n }\n }\n}", "_checkBottomColision() {\n\n let block = false;\n let absPos;\n\n for (let row = 3; row >= 0; row--) {\n\n if (block) return false; // ==== se han comprobado todos los bloques de abajo ====>>>\n for (let col = 0; col < 4; col++) {\n\n if (this[row][col] === 0) continue;\n\n block = true;\n absPos = this._getAbsolutePosition(row, col);\n\n if (absPos.row === 19) return true; //==== un bloque esta eb el fondo =====>>\n }\n }\n }", "topColPositions(callback){\n var colSpan = arguments[0]\n var rowIdx = arguments[1] - 1//get offset so not looking at hall\n var board = arguments[2]\n //get top and bottom\n var l = colSpan[0]\n var r = colSpan[1]\n //create copies to check reduction bounds\n var originalL = l\n //counter for a quit if the room cannot be created with the max amount of tries\n var counter = 0\n\n var span = Math.abs(l-r)\n //reduce by more than a half because of offsets\n l = l - Math.floor((span/3))\n r = r - Math.floor(span/3)\n //update the span\n span = Math.abs(l - r)\n try{\n if(board[rowIdx + 1][l].type == 'H' || board[rowIdx + 1][r].type == 'H'){\n return null\n }\n else if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){//checks the bounds to make sure hall is not in the empty spaces\n // console.log('returning original')\n return [l,r]\n }\n else{\n while(((board[l][rowIdx].filled == true || board[r][rowIdx].filled == true) ||\n (board[rowIdx+1][l].type !== 'H' || board[rowIdx+1][r].type !== 'H')) && \n counter < 3 && span > 3){\n // console.log('reducing')\n //top is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][l].filled == true){\n l = l + 1\n }\n //bot is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][r].filled == true){\n r = r - 1\n }\n //return the updated positions if the positions are not filled\n if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false && originalL >= l && l < r && span > 3 &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){\n return [l,r]\n }\n //update the span\n span = Math.abs(l-r)\n //update counter\n counter += 1\n }\n }\n\n }\n catch(e){\n console.log('row position is null with top:${t} and bottom: ${b}')\n return null\n }\n return null\n }", "function findInSequence() {\n\tvar beginMatch = 0;\n\tvar endMatch = 0;\n\tvar i = 0;\n\tvar specChar = RegExp('[X]');\n\tvar test = specChar.exec(searchMotif);\n\tconsole.log(test);\n\tvar xs = [];\n\tvar generalCase = false;\n\tvar splitMotif = searchMotif.split(\"\");\n\tif (test != null && searchMotif.length >= 2){\n\t\t\n\t\tfor (var i = 0; i < searchMotif.length; i++){\n\t\t\tvar char = searchMotif.charAt(i);\n\t\t\tif(char == \"X\"){\n\t\t\t\txs.push(i);\n\t\t\t}\n\t\t}\n\t\tgeneralCase = true;\n\t}\nwhile (endMatch < seq.length){\n\tendMatch = beginMatch + searchMotif.length;\n\tvar currentlyChecked = seq.substring(beginMatch, endMatch);\n\t//check for spaces or new lines within the search portion of the sequence\n\tif(generalCase){\n\t\tvar currCheckedSplit = currentlyChecked.split(\"\");\n\t\t//process out x's\n\t\tfor(var i = 0; i < splitMotif.length; i++){\n\t\t\tif(xs[i] != null){\n\t\t\tcurrCheckedSplit.splice(xs[i],1,\"X\");\n\t\t\t}\n\t\t}\n\t\tcurrentlyChecked = currCheckedSplit.join(\"\");\n\t}\n\tif(currentlyChecked === searchMotif){\n\t\tvar indices = [beginMatch, endMatch];\n\t\tindicesOfMatches.push(indices);\n\t\tbeginMatch = endMatch;\n\t}\n\telse{\n\t\tbeginMatch++;\n\t}\n\tcurrentlyChecked = \"\";\n}\n\tinsertHighlightSpans();\n}", "function cdetect(x,y){\n if((x>=arrow_c[0]&&x<arrow_c[0]+32)&&(y>=arrow_c[1]&&y<arrow_c[1]+32)){\n update_frame(mainF.END[0]);\n }\n else if((x>=arrow_c[0]+40+bgpos[2]&&x<arrow_c[0]+80+bgpos[2])&&(y>=arrow_c[1]&&y<arrow_c[1]+32)){\n if(mainF.tipo==2){\n update_frame(mainF.END[1]);\n }\n }\n else{\n for(var i = 0; i < 4 ; i++){\n if((x>=btn_opt,txtpos[0]-32+block_s&&x<btn_opt,txtpos[0]+block_s)&&(y>=txtpos[1]+i*block_s-12&&y<txtpos[1]+i*block_s-12+32)){\n mainF.TEST = i+2;\n update_frame(mainF.END[i+2]);\n }\n }\n }\n}", "function Partitions(max, rows) \n{\n\tthis.a = [];\n\tfor (var i=1; i <= max; i++) {\n\t\tfor (j=1; j <= i; j++) {\n\t\t\tif (j <= i/2) {\n\t\t\t\tthis.a.push([i, j, i-j, j]);\n\t\t\t} else {\n\t\t\t\tthis.a.push([i, i, 0, 0]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tthis.position = function(n) {\n\t\treturn (n % 2) ? (n+1)*(n+1) / 4 : n*(n+2) / 4;\n\t};\n\t\n\tthis.count = 0;\n\tthis.newArray = [];\n\tthis.counters = function() {\n\t\tthis.newArray = [];\n\t\tfor (var i=1; i <= max; i++) {\n\t\t\tthis.count = 0;\n\t\t\tthis.recurse(i, 1);\n\t\t\trows.push(\"count \" + i + \" = \" + this.count);\n\t\t}\n\t}\n\t\n\tthis.recurse = function(pos, start) {\n\t\tfor (var i=this.position(pos)-1; i < this.a.length; i++) {\n\t\t\tvar row = this.a[i];\n\t\t\tif (row[0] != pos)\n\t\t\t\tbreak;\n\t\t\tif (row[1] >= start) {\n\t\t\t\tthis.newArray.push(row[1]);\n\t\t\t\tif (row[2] == 0) { rows.push(JSON.stringify(this.newArray)); \n\t\t\t\t\tthis.count++;\n\t\t\t\t} else {\n\t\t\t\t\tthis.recurse(row[2], row[3]);\n\t\t\t\t}\n\t\t\t\tthis.newArray.pop();\n\t\t\t}\n\t\t}\n\t}\n}", "updateState(currentState) {\n // Net state working array\n let newState = [];\n // If the new state is identical to the old state\n let identical = true;\n for (let i = 0; i < this.cols; i++) {\n newState.push([]);\n for (let j = 0; j < this.rows; j++) {\n // Previously alive\n let wasAlive = currentState[i][j];\n // If it will be alive now\n let nowAlive = false;\n // Number of neighboring cells that are alive\n let neighbors = 0;\n // the 'j' coordinate of the cells above\n const up = (j - 1 + this.rows) % this.rows;\n // the 'j' coordinate of the cells below\n const down = (j + 1 + this.rows) % this.rows;\n // the 'i' coordinate of the cells left\n const left = (i - 1 + this.cols) % this.cols;\n // the 'i' coordinate of the cells right\n const right = (i + 1 + this.cols) % this.cols;\n // Count living neighbors\n if (currentState[i][up])\n neighbors++;\n if (currentState[right][up])\n neighbors++;\n if (currentState[right][j])\n neighbors++;\n if (currentState[right][down])\n neighbors++;\n if (currentState[i][down])\n neighbors++;\n if (currentState[left][down])\n neighbors++;\n if (currentState[left][j])\n neighbors++;\n if (currentState[left][up])\n neighbors++;\n // Is it now alive?\n if (wasAlive) {\n if (neighbors < 2 || neighbors > 3) {\n nowAlive = false;\n }\n else {\n nowAlive = true;\n }\n }\n else {\n if (neighbors == 3) {\n nowAlive = true;\n }\n else {\n nowAlive = false;\n }\n }\n // If different than before then arrays aren't identical\n if (nowAlive !== wasAlive) {\n identical = false;\n }\n // Push new sate to working array\n newState[i].push(nowAlive);\n }\n }\n // Set stable to true if the arrays are identical\n if (identical) {\n this.stable = true;\n }\n return newState;\n }", "function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size; // rows & columns\n\n var m = asize[0];\n var n = asize[1]; // initialize s arrays\n\n s.pinv = []; // (m + n)\n\n s.leftmost = []; // (m)\n // vars\n\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost; // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n\n var w = []; // (m + 3 * n)\n\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n; // vars\n\n var i, k, p, p0, p1; // initialize w\n\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n } // initialize row arrays\n\n\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n } // loop columns backwards\n\n\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n } // scan rows in reverse order\n\n\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i]; // check row i is empty\n\n if (k === -1) {\n continue;\n } // first row in queue k\n\n\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n } // put i at head of queue k\n\n\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n\n s.lnz = 0;\n s.m2 = m; // find row permutation and nnz(V)\n\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k]; // count V(k,k) as nonzero\n\n s.lnz++; // add a fictitious row\n\n if (i < 0) {\n i = s.m2++;\n } // associate row i with V(:,k)\n\n\n pinv[i] = k; // skip if V(k+1:m,k) is empty\n\n if (--nque[k] <= 0) {\n continue;\n } // nque[k] is nnz (V(k+1:m,k))\n\n\n s.lnz += w[nque + k]; // move all rows to parent of k\n\n var pa = parent[k];\n\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n\n return true;\n }", "function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size; // rows & columns\n\n var m = asize[0];\n var n = asize[1]; // initialize s arrays\n\n s.pinv = []; // (m + n)\n\n s.leftmost = []; // (m)\n // vars\n\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost; // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n\n var w = []; // (m + 3 * n)\n\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n; // vars\n\n var i, k, p, p0, p1; // initialize w\n\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n } // initialize row arrays\n\n\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n } // loop columns backwards\n\n\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n } // scan rows in reverse order\n\n\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i]; // check row i is empty\n\n if (k === -1) {\n continue;\n } // first row in queue k\n\n\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n } // put i at head of queue k\n\n\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n\n s.lnz = 0;\n s.m2 = m; // find row permutation and nnz(V)\n\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k]; // count V(k,k) as nonzero\n\n s.lnz++; // add a fictitious row\n\n if (i < 0) {\n i = s.m2++;\n } // associate row i with V(:,k)\n\n\n pinv[i] = k; // skip if V(k+1:m,k) is empty\n\n if (--nque[k] <= 0) {\n continue;\n } // nque[k] is nnz (V(k+1:m,k))\n\n\n s.lnz += w[nque + k]; // move all rows to parent of k\n\n var pa = parent[k];\n\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n\n return true;\n }", "function checkForHorizontalMatches(grid, height, width){\n xMatchList = [];\n for (var a = 0; a < grid.length; a++){\n for (var b = 0; b < grid[a].length; b++){\n if (grid[a][b-1]){\n if (grid[a][b].stoneColor != grid[a][b-1].stoneColor){\n if (grid[a][b+1]){\n if (grid[a][b].stoneColor == grid[a][b + 1].stoneColor){\n var count = 1;\n var matches = [];\n matches.push(grid[a][b]);\n while (grid[a][b + count] != null && grid[a][b].stoneColor == grid[a][b + count].stoneColor){\n matches.push(grid[a][b + count]);\n count++;\n }\n if (matches.length >= 3){\n xMatchList.push(matches);\n }\n }\n }\n }\n }\n }\n }\n return xMatchList;\n }", "function checkrow(rowIndex, state) {\n var countb = 0;\n var countw = 0;\n var tempb = [];\n var tempw = [];\n for (var j = 0; j < 6; j ++) {\n if (state[rowIndex][j] == 'b') {\n countb ++;\n tempw.push(countw);\n countw =0;\n } else if (state[rowIndex][j] == 'w'){\n countw ++;\n tempb.push(countb);\n countb = 0;\n } else {\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n }\n }\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n tempb.sort(function(a,b) {return b-a});\n tempw.sort(function(a,b) {return b-a});\n resultB[rowIndex] = tempb[0];\n resultW[rowIndex] = tempw[0];\n }" ]
[ "0.556877", "0.55510575", "0.550457", "0.54952186", "0.5485731", "0.54697144", "0.5401432", "0.53315246", "0.5296665", "0.52186847", "0.519853", "0.5159309", "0.51492774", "0.51125616", "0.5105361", "0.5051013", "0.5049619", "0.50307536", "0.4978565", "0.49664906", "0.4953451", "0.4946108", "0.4911204", "0.48993278", "0.48652253", "0.48633105", "0.48619917", "0.48585254", "0.48485187", "0.48414558", "0.4838748", "0.4832283", "0.4807545", "0.4784825", "0.47704917", "0.47698155", "0.47693887", "0.4739101", "0.47371578", "0.47302577", "0.47243437", "0.4721678", "0.47158042", "0.46931234", "0.46792", "0.46790212", "0.46743652", "0.46664834", "0.46596092", "0.46526197", "0.4645179", "0.46339864", "0.4628371", "0.46274683", "0.4624134", "0.4623062", "0.46147454", "0.46146864", "0.45975155", "0.45947224", "0.45883346", "0.4583467", "0.45798156", "0.45777762", "0.4575364", "0.457104", "0.45632973", "0.45428857", "0.45398426", "0.453903", "0.45339832", "0.45208362", "0.45141098", "0.4504218", "0.4496106", "0.4493771", "0.44847238", "0.4483179", "0.44788846", "0.44767013", "0.44749945", "0.4473785", "0.44701567", "0.44639122", "0.44617313", "0.44616777", "0.44583768", "0.44496906", "0.4448694", "0.44463682", "0.4432764", "0.44293174", "0.44227186", "0.4419464", "0.4415274", "0.44140437", "0.44110212", "0.44110212", "0.4407394", "0.44067764" ]
0.7157436
0
This is called when a horizontal scan finds a possible alignment pattern. It will cross check with a vertical scan, and if successful, will see if this pattern had been found on a previous horizontal scan. If so, we consider it confirmed and conclude we have found the alignment pattern. stateCount reading state module counts from horizontal scan i where alignment pattern may be found j end of possible alignment pattern in row
function handlePossibleCenter(stateCount, i, j, moduleSize) { var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; var centerJ = centerFromEnd(stateCount, j); if (centerJ == null) { return null; } var centerI = crossCheckVertical(i, Math.floor(centerJ), 2 * stateCount[1], stateCountTotal, moduleSize, image); if (centerI != null) { var estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3; for (var i2 in possibleCenters) { var center = possibleCenters[i2]; // Look for about the same center and module size: if (aboutEquals(center, estimatedModuleSize, centerI, centerJ)) { return combineEstimate(center, centerI, centerJ, estimatedModuleSize); } } // Hadn't found this before; save it var point = { x: centerJ, y: centerI, estimatedModuleSize: estimatedModuleSize }; possibleCenters.push(point); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crossCheckVertical(startI, centerJ, maxCount, originalStateCountTotal, moduleSize, image) {\r\n\t\t var maxI = image.height;\r\n\t\t var stateCount = [0, 0, 0];\r\n\t\t // Start counting up from center\r\n\t\t var i = startI;\r\n\t\t while (i >= 0 && image.get(centerJ, i) && stateCount[1] <= maxCount) {\r\n\t\t stateCount[1]++;\r\n\t\t i--;\r\n\t\t }\r\n\t\t // If already too many modules in this state or ran off the edge:\r\n\t\t if (i < 0 || stateCount[1] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t while (i >= 0 && !image.get(centerJ, i) && stateCount[0] <= maxCount) {\r\n\t\t stateCount[0]++;\r\n\t\t i--;\r\n\t\t }\r\n\t\t if (stateCount[0] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t // Now also count down from center\r\n\t\t i = startI + 1;\r\n\t\t while (i < maxI && image.get(centerJ, i) && stateCount[1] <= maxCount) {\r\n\t\t stateCount[1]++;\r\n\t\t i++;\r\n\t\t }\r\n\t\t if (i == maxI || stateCount[1] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t while (i < maxI && !image.get(centerJ, i) && stateCount[2] <= maxCount) {\r\n\t\t stateCount[2]++;\r\n\t\t i++;\r\n\t\t }\r\n\t\t if (stateCount[2] > maxCount) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t if (5 * Math.abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t return foundPatternCross(stateCount, moduleSize) ? centerFromEnd(stateCount, i) : null;\r\n\t\t}", "function AlignmentPatternFinder(image, startX\n /*int*/\n , startY\n /*int*/\n , width\n /*int*/\n , height\n /*int*/\n , moduleSize\n /*float*/\n , resultPointCallback) {\n _classCallCheck(this, AlignmentPatternFinder);\n\n this.image = image;\n this.startX = startX;\n this.startY = startY;\n this.width = width;\n this.height = height;\n this.moduleSize = moduleSize;\n this.resultPointCallback = resultPointCallback;\n this.possibleCenters = []; // new Array<any>(5))\n // TYPESCRIPTPORT: array initialization without size as the length is checked below\n\n this.crossCheckStateCount = new Int32Array(3);\n }", "check(x, y, board = this.map) {\n let color = board[y][x];\n if (color === \"⚪\") return 1;\n //horizontal\n if (\n this.search(x, y, color, 1, 0, 0) +\n this.search(x, y, color, -1, 0, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, 1, 1, 0) +\n this.search(x, y, color, -1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, -1, 1, 0) +\n this.search(x, y, color, 1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //vertical\n if (\n this.search(x, y, color, 0, 1, 0) +\n this.search(x, y, color, 0, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n\n // check how many pieces in a column\n let countstack = 0;\n for (let i = 0; i < 7; i++) {\n if (this.stack[i] === -1) {\n countstack++;\n }\n }\n\n // a column is full\n if (countstack === 7) return 3;\n\n return 1;\n }", "drawAlignmentPattern(x, y) {\n let i;\n let j;\n for (i = x - 2, j = y - 2; i < x + 3; i++, j++) {\n this.mModuleValue[i][y - 2].isBlack = true;\n this.mModuleValue[i][y - 2].isFilled = true;\n this.mModuleValue[i][y + 2].isBlack = true;\n this.mModuleValue[i][y + 2].isFilled = true;\n this.mModuleValue[x - 2][j].isBlack = true;\n this.mModuleValue[x - 2][j].isFilled = true;\n this.mModuleValue[x + 2][j].isBlack = true;\n this.mModuleValue[x + 2][j].isFilled = true;\n }\n for (i = x - 1, j = y - 1; i < x + 2; i++, j++) {\n this.mModuleValue[i][y - 1].isBlack = false;\n this.mModuleValue[i][y - 1].isFilled = true;\n this.mModuleValue[i][y + 1].isBlack = false;\n this.mModuleValue[i][y + 1].isFilled = true;\n this.mModuleValue[x - 1][j].isBlack = false;\n this.mModuleValue[x - 1][j].isFilled = true;\n this.mModuleValue[x + 1][j].isBlack = false;\n this.mModuleValue[x + 1][j].isFilled = true;\n }\n this.mModuleValue[x][y].isBlack = true;\n this.mModuleValue[x][y].isFilled = true;\n }", "function lookAheadCount(nfa, testCombineIndex)\n{ var testString=inputString.value;// var s=inputString.value; \n var localCombineIndex={\n localIndex:[],\n localFinalIndex:[]\n\n };\nlocalCombineIndex.localIndex=testCombineIndex.myIndex;\n//localCombineIndex.myFinalIndex=testCombineIndex.myFinalIndex;\n var CurrentActive=[];\n var NextActive=[];\n var MatchCount=0;\n var temp=[];\n \n CurrentActive=_.union(CurrentActive, nfa.states);\n for(var i=0; i<testString.length-1; i=i+1)\n { for(var j=0; j<CurrentActive.length; j++)\n {\n if(CurrentActive[j]==0)\n continue;\n var t=localCombineIndex.localIndex[CurrentActive[j]][testString[i]][testString[i+1]];\n NextActive=_.union(NextActive, t);\n }\n\n // console.log(\"check1: \"+CurrentActive);\n \n temp=_.intersection(NextActive, [0]);\n if(temp[0]!=0)\n {\n MatchCount = MatchCount+1;\n }\n\n \n CurrentActive=NextActive;\n // console.log(\"count: \"+MatchCount);\n NextActive=[];\n }\n // var FinalDest=[];\n // console.log(\"temp0: \"+ temp);\n var bValue=false;\n if(MatchCount==testString.length-1 )\n {\n for(var k=0; k<CurrentActive.length; k++)\n {\n for(var l=0; l<nfa.trans.length; l++)\n {\n if(nfa.trans[l].src==CurrentActive[k] && nfa.trans[l].ch==testString[testString.length-1])\n {\n if(_.contains(nfa.trans[l].dest, 0))\n {\n bValue=true;\n break;\n \n }\n }\n }\n }\n\n } \n ///Print final value: \nconsole.log(\"Match or not: \"+bValue);\n}", "calculateAtDesiredPos() {\n let counter = 0;\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n if (this.isAtDesiredPos([i, j], this.board[i][j])) counter++;\n }\n }\n return counter;\n }", "function checkrow(rowIndex, state) {\n var countb = 0;\n var countw = 0;\n var tempb = [];\n var tempw = [];\n for (var j = 0; j < 6; j ++) {\n if (state[rowIndex][j] == 'b') {\n countb ++;\n tempw.push(countw);\n countw =0;\n } else if (state[rowIndex][j] == 'w'){\n countw ++;\n tempb.push(countb);\n countb = 0;\n } else {\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n }\n }\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n tempb.sort(function(a,b) {return b-a});\n tempw.sort(function(a,b) {return b-a});\n resultB[rowIndex] = tempb[0];\n resultW[rowIndex] = tempw[0];\n }", "readCodewords() {\n let width = this.bitMatrix.getWidth();\n let height = this.bitMatrix.getHeight();\n\n this.erasures = new Array(MAX_CW_CAPACITY);\n\n for (let k = 0; k < this.erasures.length; k++) {\n this.erasures[k] = 0;\n }\n\n // Get the number of pixels in a module across the X dimension\n //float moduleWidth = bitMatrix.getModuleWidth();\n let moduleWidth = 1.0; // Image has been sampled and reduced\n let rowCounters = new Array(width);\n\n for (let n = 0; n < rowCounters.length; n++) {\n rowCounters[n] = 0;\n }\n\n let codewords = new Array(MAX_CW_CAPACITY);\n\n for (let m = 0; m < codewords.length; m++) {\n codewords[m] = 0;\n }\n\n let next = 0;\n let matchingConsecutiveScans = 0;\n let rowInProgress = false;\n let rowNumber = 0;\n let rowHeight = 0;\n\n for (let i = 1; i < height; i++) {\n if (rowNumber >= MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n let rowDifference = 0;\n // Scan a line of modules and check the\n // difference between this and the previous line\n for (let j = 0; j < width; j++) {\n // Accumulate differences between this line and the\n // previous line.\n if (this.bitMatrix._get(j, i) != this.bitMatrix._get(j, i - 1)) {\n rowDifference++;\n }\n }\n\n if (rowDifference <= moduleWidth * this.MAX_ROW_DIFFERENCE) {\n for (let j2 = 0; j2 < width; j2++) {\n // Accumulate the black pixels on this line\n if (bitMatrix._get(j2, i)) {\n rowCounters[j2]++;\n }\n }\n // Increment the number of consecutive rows of pixels\n // that are more or less the same\n matchingConsecutiveScans++;\n // Height of a row is a multiple of the module size in pixels\n // Usually at least 3 times the module size\n if (matchingConsecutiveScans >= moduleWidth * 2) { // MGMG\n // We have some previous matches as well as a match here\n // Set processing a unique row.\n rowInProgress = true;\n }\n } else {\n if (rowInProgress) {\n // Process Row\n next = processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n if (next == -1) {\n // Something is wrong, since we have exceeded\n // the maximum columns in the specification.\n // TODO Maybe return error code\n return null;\n }\n // Reinitialize the row counters.\n for (let j3 = 0; j3 < rowCounters.length; j3++) {\n rowCounters[j3] = 0;\n }\n rowNumber++;\n rowHeight = 0;\n }\n matchingConsecutiveScans = 0;\n rowInProgress = false;\n }\n rowHeight++;\n }\n // Check for a row that was in progress before we exited above.\n if (rowInProgress) {\n // Process Row\n if (rowNumber >= this.MAX_ROWS) {\n // Something is wrong, since we have exceeded\n // the maximum rows in the specification.\n // TODO Maybe return error code\n return null;\n }\n\n next = this.processRow(rowCounters, rowNumber, rowHeight, codewords, next);\n rowNumber++;\n rows = rowNumber;\n }\n erasures = trimArray(erasures, eraseCount);\n return trimArray(codewords, next);\n }", "didWin(mark) {\n\n // premenne na vypocet znacky\n var vertical_count = 0,\n horizontal_count = 0,\n right_to_left_count = 0,\n left_to_right_count = 0;\n\n // Loop 1\n for (var i = 0; i < this.state.grid_size; i++) {\n\n\n vertical_count = 0;\n horizontal_count = 0;\n\n // Loop 2\n for (var j = 0; j < this.state.grid_size; j++) {\n\n\n if (this.state.data[i + '' + j] == mark) {\n horizontal_count++;\n }\n\n\n if (this.state.data[j + '' + i] == mark) {\n vertical_count++;\n }\n\n }\n\n\n if (this.state.data[i + '' + i] == mark) {\n left_to_right_count++;\n }\n\n\n if (this.state.data[(this.state.grid_size - 1 - i) + '' + i] == mark) {\n right_to_left_count++;\n }\n\n // ak suhlasi vyhral\n if (horizontal_count == this.state.grid_size || vertical_count == this.state.grid_size) {\n return true;\n }\n\n }\n\n // ak suhlasi diagonal vyhral\n if (left_to_right_count == this.state.grid_size || right_to_left_count == this.state.grid_size) {\n return true;\n }\n\n // nikto nevyhral\n return false;\n }", "getNextValidPosition(inX, inY, state, stateHoriz, stateVert, currWord, lastOrientation){\n let valid = false;\n let currX = -1;\n let currY = -1;\n let newX = -1;\n let newY = -1;\n let partialScore = 0;\n\n let x = -1;\n let y = -1;\n let res = null;\n let flagBreak = false;\n if (lastOrientation == VERTICAL){\n inY = inY + 1;\n lastOrientation = null;\n }\n let currPosLetter = null;\n for (y = inY; y < state.sizeY; y++) { \n for (x = inX; x < state.sizeX; x++) {\n // Simple first test, to see if the position can be used, and cut the processing weight.\n // We will see if the position is not Empty and if it has a different letter then our first letter.\n currPosLetter = state.board[x][y];\n if ( (currPosLetter != EMPTY) && currPosLetter != currWord[0] ){\n continue;\n }\n if ((lastOrientation == null) || (lastOrientation != HORIZONTAL)){\n // Generate Horizontally placement.\n lastOrientation = HORIZONTAL;\n // Test if word can fit horizontally until the end.\n if (x < state.sizeX - currWord.length){\n [res, partialScore] = this.canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n if (lastOrientation == HORIZONTAL){\n // Generate Vertical placement.\n lastOrientation = VERTICAL;\n // Test if word can fit vertically until the bottom.\n if (y < state.sizeY - currWord.length){\n [res, partialScore] = this.canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, currWord);\n if (res == true){\n flagBreak = true;\n break;\n }\n }\n }\n }\n if (flagBreak)\n break;\n }\n\n if ((res != null) && (res == true)){\n valid = true;\n currX = x;\n currY = y;\n newX = x;\n newY = y;\n }\n\n return [valid, currX, currY, newX, newY, lastOrientation, partialScore];\n }", "function _tr_align() {\n\t\t send_bits(STATIC_TREES << 1, 3);\n\t\t send_code(END_BLOCK, StaticTree.static_ltree);\n\t\t bi_flush(); // Of the 10 bits for the empty block, we have already sent\n\t\t // (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t // the EOB of the previous block) was thus at least one plus the length\n\t\t // of the EOB plus what we have just sent of the empty static block.\n \n\t\t if (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t }\n \n\t\t last_eob_len = 7;\n\t\t} // Save the match info and tally the frequency counts. Return true if", "function AlignmentPattern(posX, posY, estimatedModuleSize)\r\n{\r\n\tthis.x=posX;\r\n\tthis.y=posY;\r\n\tthis.count = 1;\r\n\tthis.estimatedModuleSize = estimatedModuleSize;\r\n\t\r\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\r\n\t{\r\n\t\treturn this.estimatedModuleSize;\r\n\t}); \r\n\tthis.__defineGetter__(\"Count\", function()\r\n\t{\r\n\t\treturn this.count;\r\n\t});\r\n\tthis.__defineGetter__(\"X\", function()\r\n\t{\r\n\t\treturn Math.floor(this.x);\r\n\t});\r\n\tthis.__defineGetter__(\"Y\", function()\r\n\t{\r\n\t\treturn Math.floor(this.y);\r\n\t});\r\n\tthis.incrementCount = function()\r\n\t{\r\n\t\tthis.count++;\r\n\t}\r\n\tthis.aboutEquals=function( moduleSize, i, j)\r\n\t\t{\r\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\r\n\t\t\t{\r\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\r\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n}", "function patternCheckOrientation(pattern, targetCell, qualityGoal, weight, orientation) {\n var forwardFacingCells = FWD_CELLS[targetCell];\n var totalDiscrepancies = 0;\n DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"Enter pCO([\" + pattern + \"]; \" + targetCell + \", \" + qualityGoal + \", \" + weight + \", \" + orientation + \"); compass: \" + compass);\n fwdWrong = [];\n rearWrong = [];\n if ((Array.isArray(pattern[POS_CENTER]) && !pattern[POS_CENTER][myColor]) ||\n\t((pattern[POS_CENTER] > 0) && (myColor != pattern[POS_CENTER]))) {\n\tif (forwardFacingCells[POS_CENTER]) { // always true, in fact\n\t fwdWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += 1;\n\t} else {\n\t rearWrong.push({p:POS_CENTER, v:POS_CENTER});\n\t totalDiscrepancies += weight;\n\t}\n }\n if ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\tDEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\treturn PAT_NOMATCH;\n }\n var jFrom = 0;\n switch (targetCell) {\n case AIM_UP:\n\tjFrom = 4;\n\tbreak;\n case AIM_LEFT:\n\tjFrom = 6;\n\tbreak;\n case AIM_RIGHT:\n\tjFrom = 2;\n\tbreak;\n case AIM_DOWN:\n case POS_CENTER:\n default:\n\tbreak;\n }\n for (var j = jFrom; j < TOTAL_NBRS + jFrom; j++) {\n\tvar posP = CCW[j];\n\tvar posV = CCW[orientation + j];\n\tvar c = view[posV].color;\n\tif ((Array.isArray(pattern[posP]) && !pattern[posP][c]) ||\n\t ((pattern[posP] > 0) && (c != pattern[posP]))) {\n\t if (forwardFacingCells[posP]) {\n\t\tfwdWrong.push({p:posP, v:posV});\n\t\t// #future# If it should ever be needed, we could push j as a\n\t\t// third member of these objects (its absence indicating the\n\t\t// center cell).\n\t\ttotalDiscrepancies += 1;\n\t } else {\n\t\trearWrong.push({p:posP, v:posV});\n\t\ttotalDiscrepancies += weight;\n\t }\n\t}\n\tif ((compass < 0) && (totalDiscrepancies > qualityGoal)) {\n\t DEBUG_PATTERN_CHECK_VERBOSELY && debugme(\"--- too bad\");\n\t return PAT_NOMATCH;\n\t}\n }\n // Assert: totalDiscrepancies == fwdWrong.length + rearWrong.length;\n // Assert: If compass < 0, then totalDiscrepancies <= qualityGoal\n debugme(\"-> total \" + totalDiscrepancies + \" weighted discrepancies found.\");\n if ((compass < 0)\n\t// && (totalDiscrepancies <= qualityGoal)\n ) {\n\tcompass = orientation;\n }\n if (DEBUGME[myType]) {\n\t// Bypass the single-arg debugme() in order to get the objects printed.\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"forwardD: [\", fwdWrong, \"]\");\n\tDEBUG_PATTERN_CHECK_VERBOSELY && console.log(\"rearD: [\", rearWrong, \"]\");\n }\n if (fwdWrong.length == 0) {\n\treturn (totalDiscrepancies);\n } else {\n\treturn (-totalDiscrepancies);\n }\n}", "function analyze(str) {\n function createResultRecord() {\n resultsArr.push(`(${getToken(currentState)}, ${tokenString})`)\n }\n const initStrArr = str.trim().split(\"\")\n\n // Array contains previous states. Used to go back if sequence failed\n let statesBuffer = []\n let currentState = 0\n let tokenString = \"\"\n let resultsArr = [] // Results array in format [\"(number, 2)\", (id, asd), ...]\n \n for(let index = 0; index < initStrArr.length; index++) {\n function iterateBack() {\n let prevStep = 1\n let revercedBufferArr = statesBuffer.slice(1).reverse()\n\n // From the end of buffered states iterate and find first successful state\n while(!getToken(revercedBufferArr[prevStep]) &&\n prevStep <= revercedBufferArr.length) {\n prevStep += 1\n }\n // Set params to last known successfull state\n currentState = revercedBufferArr[prevStep]\n tokenString = tokenString.substr(0, tokenString.length - prevStep)\n createResultRecord()\n tokenString = \"\"\n currentState = 0\n index -= prevStep + 1\n }\n\n const char = initStrArr[index]\n const newState = getNewState(currentState, char)\n statesBuffer.push(currentState)\n\n if (char == \" \") { continue; }\n \n if (newState) {\n currentState = newState\n tokenString += char\n } else {\n if (!tokenTable[currentState]) {\n iterateBack(); continue;\n }\n createResultRecord()\n tokenString = char\n currentState = 0\n currentState = getNewState(currentState, char)\n }\n \n if(index === initStrArr.length - 1) {\n if(getToken(currentState)) {\n createResultRecord()\n } else {\n statesBuffer.push(currentState)\n index += 1\n iterateBack()\n }\n }\n }\n return resultsArr.join(\"; \") \n}", "function checkSequence(){\n\t console.log(\"checking\");\n\t if (JSON.stringify(pattern) === JSON.stringify(userPattern)){\n\t\t\telementScore.innerHTML ++;\n\t\t\tif(elementHigh.innerHTML < elementScore.innerHTML){\n\t\t\t elementHigh.innerHTML++;\n\t\t\t}\n\t/* The next level function is called if they are, if not end game.*/\t\n\t\t \n\t\t console.log(\"next\");\n\t nextLevel();\n\t }\n\t\telse {\n\t\t\n\t\t\tendGame();\n\t\t} \n }", "function check_block() {\n var moved = false;\n reset_counts();\n check_counts(\"X\");\n\n if (countdiag1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + i);\n }\n }\n if (countdiag2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 2 + 2);\n }\n }\n if (countrow0 == 2) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i);\n }\n }\n if (countrow1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(3 + i);\n }\n }\n if (countrow2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(6 + i);\n }\n }\n if (countcol0 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3);\n }\n }\n if (countcol1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 1);\n }\n }\n if (countcol2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 2);\n }\n }\n return moved;\n}", "function checkRow( g, ri ) {\n var above_status = aliveAbove( g, ri );\n var below_status = aliveBelow( g, ri );\n var curr_status = g[ri]>0;\n var alives = [];\n var new_row = 0;\n // If nothing around it is alive, return 0;\n if ( above_status > 0 || below_status > 0 || curr_status > 0 ) {\n // Check the positions\n for( var i = 1; i < bits; i *= 2 ) {\n var alive_or_dead = (g[ri]&i)>0;\n var ac = 0;\n if ( above_status == true ) {\n (g[ri-1] & (i/2))>0?ac++:false;\n (g[ri-1] & (i/1))>0?ac++:false;\n (g[ri-1] & (i*2))>0?ac++:false;\n }\n if ( curr_status == true ) {\n (g[ri] & (i/2))>0?ac++:false;\n (g[ri] & (i*2))>0?ac++:false;\n }\n if ( below_status == true ) {\n (g[ri+1] & (i/2))>0?ac++:false;\n (g[ri+1] & (i/1))>0?ac++:false;\n (g[ri+1] & (i*2))>0?ac++:false;\n }\n if ( alive_or_dead == true && ( ac == 2 || ac == 3 ) ) {\n new_row += bits & i;\n }\n else if ( alive_or_dead == false && ac == 3 ) {\n new_row += bits & i;\n }\n }\n return new_row;\n }\n else {\n return 0;\n }\n}", "canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, word){\n let result = false;\n let partialScore = 0;\n\n // Test if we can put the word at x, y, Horizontal.\n \n // Test if the star and end position are over invalid state value terminate early.\n let endX = x + word.length - 1;\n if ((stateHoriz.board[x][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateVert.board[x][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateHoriz.board[x][y] == NO_HORIZ_NO_VERT) ||\n (stateVert.board[x][y] == NO_HORIZ_NO_VERT) ||\n \n (stateHoriz.board[endX][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateVert.board[endX][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateHoriz.board[endX][y] == NO_HORIZ_NO_VERT) ||\n (stateVert.board[endX][y] == NO_HORIZ_NO_VERT) ){\n \n result = false;\n partialScore = 0;\n return [result, partialScore]; \n }\n // Test if the word clash's with the Horizontal constrains, for all positions of the previous words placed.\n for (let i = 0; i < word.length; i++) {\n let xi = x + i; \n if ((stateHoriz.board[xi][y] == HORIZONTAL) ||\n (stateHoriz.board[xi][y] == NO_HORIZ_NO_VERT) ||\n (stateVert.board[xi][y] == NO_HORIZ_NO_VERT) ||\n (stateHoriz.board[xi][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n ( (state.board[xi][y] != EMPTY) && (state.board[xi][y] != word[i])) ){\n\n result = false;\n partialScore = 0;\n return [result, partialScore];\n }\n // Calculate the partial score of this move based on the number of crosses between words.\n if ((state.board[xi][y] != EMPTY) && (state.board[xi][y] == word[i])){\n partialScore = partialScore + 1;\n }\n }\n \n result = true;\n return [result, partialScore];\n }", "function AlignmentPattern(posX, posY, estimatedModuleSize)\n{\n\tthis.x=posX;\n\tthis.y=posY;\n\tthis.count = 1;\n\tthis.estimatedModuleSize = estimatedModuleSize;\n\t\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\n\t{\n\t\treturn this.estimatedModuleSize;\n\t}); \n\tthis.__defineGetter__(\"Count\", function()\n\t{\n\t\treturn this.count;\n\t});\n\tthis.__defineGetter__(\"X\", function()\n\t{\n\t\treturn Math.floor(this.x);\n\t});\n\tthis.__defineGetter__(\"Y\", function()\n\t{\n\t\treturn Math.floor(this.y);\n\t});\n\tthis.incrementCount = function()\n\t{\n\t\tthis.count++;\n\t}\n\tthis.aboutEquals=function( moduleSize, i, j)\n\t\t{\n\t\t\tif (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)\n\t\t\t{\n\t\t\t\tvar moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);\n\t\t\t\treturn moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\n}", "function match_pattern_at(state, pattern, player, x, y) {\n if(x >= 0 && x < state.length) {\n if(y >= 0 && y < state[x].length) {\n var element = pattern[0];\n // Check whether the type of the part is 'p'\n if(element[0] == 'p') {\n if(state[x][y] !== player) {\n return false;\n }\n } else if(element[0] == ' '){ // Check whether that the square is empty\n if(state[x][y] !== undefined) {\n return false;\n }\n }\n /*\n Check whether the pattern has more than one component in, if so then all the components\n in the pattern have not been matched so therefore call the function to check the rest of the pattern.\n The x and y cooridates are updated with the patterns second and third. If there is just one element in the pattern\n then therefore we know the pattern has matched so return true.\n */\n if(pattern.length > 1) {\n return match_pattern_at(state, pattern.slice(1), player, x + element[1], y + element[2])\n } else {\n return true;\n }\n }\n }\n return false;\n}", "bitCount(mtx) {\n var count = 0;\n for (var y = 0 ; y < this.height ; y++) {\n for (var x = 0 ; x < this.width ; x++) {\n if (0 < mtx[y][x]) {\n count += 1;\n }\n }\n }\n // console.log(\"bitCount: count = \", count);\n return count;\n }", "function check_horizontal(row, col, color) {\n let count = 1\n let temp = col\n while (col > 0) {\n let $left_cell = get_cell(row, --col)\n console.log(col, color, 'left count')\n console.log($left_cell)\n if ($left_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ left')\n }\n else {\n break\n }\n }\n col = temp\n while (col < that.col) {\n let $right_cell = get_cell(row, ++col)\n console.log(col, color, 'right count')\n console.log($right_cell)\n if ($right_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ right')\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }", "numValidDirections(board) {\n let count = 0;\n\n if (this.isValidMove(board, DIRECTION.UP)) count++;\n if (this.isValidMove(board, DIRECTION.DOWN)) count++;\n if (this.isValidMove(board, DIRECTION.RIGHT)) count++;\n if (this.isValidMove(board, DIRECTION.LEFT)) count++;\n return count;\n }", "function getGridStateAndNumFilled() {\n let state = '';\n let numFilled = 0\n for (let i = 0; i < gridHeight; i++) {\n for (let j = 0; j < gridWidth; j++) {\n if (grid[i][j].notBlocked()) {\n if (langMaxCharCodes == 1) {\n state = state + grid[i][j].currentLetter\n } else {\n state = state + grid[i][j].currentLetter + '$'\n }\n if (grid[i][j].currentLetter != '0') {\n numFilled++\n }\n } else {\n state = state + '.'\n }\n }\n }\n numCellsFilled = numFilled\n return state;\n}", "function count_color(current_coordinate, desired_color, desired_direction, current_count) {\n\t\t\t\tlet next_coordinate = [current_coordinate[0] + desired_direction[0],\n\t\t\t\tcurrent_coordinate[1] + desired_direction[1]];\n\t\t\t\tconsole.log(next_coordinate);\n\t\t\t\tif (piece_position[next_coordinate[0]] && piece_position[next_coordinate[0]][next_coordinate[1]]) {\n\t\t\t\t\tif (piece_position[next_coordinate[0]][next_coordinate[1]].color != desired_color)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\tcurrent_count += 1;\n\t\t\t\t\tif (current_count == 3)\n\t\t\t\t\t\treturn current_count;\n\t\t\t\t\treturn count_color(next_coordinate, desired_color, desired_direction, current_count);\n\t\t\t\t}\n\t\t\t\treturn current_count;\n\t\t\t}", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "examine_possibles(count) {\n let updates = 0;\n //Loop through diagonally (hitting all rows/columns in n iterations)\n for (var i = 0; i < this.size; i++) {\n let node = this.nodes[i * (this.size + 1)];\n updates += this.calculate_frequencies(node, 0, count); //Row\n updates += this.calculate_frequencies(node, 1, count); //Col\n }\n\n let inc = Math.sqrt(this.size);\n\n //Loop through top left of all sub_squares\n for (var y = 0; y < this.size; y += inc) {\n for (var x = 0; x < this.size; x += inc) {\n updates += this.calculate_frequencies(this.nodes[x_y_to_index(x, y, this.size)], 2, count); //Sqr\n }\n }\n\n return updates;\n }", "function charCountCompabilityCheck(seqs) {\n\tvar positionArray = new Array(seqs[0].length);\n\t// Create a base counter for each position:\n\tfor(var i = 0, n = seqs[0].length; i < n; i++) {\n\t\tpositionArray[i] = {A:0, T:0, G:0, C:0};\n\t}\n\t// Iterate over all sequences:\n\tvar seq;\n\tfor(var i = 0, n = seqs.length; i < n ; i++) {\n\t\tseq = seqs[i];\n\t\t// Iterate over all positions in current sequence:\n\t\tfor(var j = 0, m = seq.length; j < m; j++) {\n\t\t\t// Add one to the count for the base in this position:\n\t\t\tpositionArray[j][seq[j]] += 1;\n\t\t}\n\t}\n\t// Sum channel distribution:\n\tvar green;\n\tvar red;\n\tfor(var i = 0, n = seqs[0].length; i < n ; i++) {\n\t\tgreen = positionArray[i].T + positionArray[i].G;\n\t\tred = positionArray[i].A + positionArray[i].C;\n\t}\n\treturn (green > 0 && red > 0);\n}", "step() {\n // Fill the offscreen buffer with the next cca generation built\n // from the current buffer.\n\n let backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n let currentBuffer = this.buffer[this.currentBufferIndex];\n let backBuffer = this.buffer[backBufferIndex];\n\n // See if we have a neighbor to infect this one\n function hasInfectiousNeighbor(x, y) {\n const nextValue = (currentBuffer[y][x] + 1) % MODULO;\n\n // Check the west neighbor of cell x, y\n /*if (x > 0) {\n if (currentBuffer[y][x - 1] === nextValue) {\n return true;\n }\n }*/\n\n // North\n if (y > 0) {\n if (currentBuffer[y - 1][x] === nextValue) {\n return true;\n }\n }\n\n // East\n if (x < this.width - 1) {\n if (currentBuffer[y][x + 1] === nextValue) {\n return true;\n }\n }\n\n // South\n if (y < this.height - 1) {\n if (currentBuffer[y + 1][x] === nextValue) {\n return true;\n }\n }\n\n // If we've made it this far we're not infected!\n return false;\n }\n\n // Loop through and decide the state of the next generation\n // for each cell processed.\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n if (hasInfectiousNeighbor.call(this, x, y)) {\n backBuffer[y][x] = (currentBuffer[y][x] + 1) % MODULO;\n } else {\n backBuffer[y][x] = currentBuffer[y][x];\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function patternCheck(pattern, targetCell, qualityGoal, weight) {\n if (compass >= 0) { // already set\n\treturn (patternCheckOrientation(pattern, targetCell, qualityGoal, weight, compass));\n } else {\n\tvar mismatch;\n\tfor (var o = 0; o < TOTAL_NBRS; o += 2) {\n\t debugme(\"patternCheck: hunting for compass (now \" + compass + \") at \" + o);\n\t mismatch = patternCheckOrientation(pattern, targetCell, qualityGoal, weight, o);\n\t debugme(\"-> got mismatch \" + mismatch + \" and compass \" + compass);\n\t if (compass >= 0) {\n\t\treturn mismatch;\n\t }\n\t}\n\treturn PAT_NOMATCH;\n }\n}", "function findAlignmentInRegion(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor, image) {\r\n\t\t estAlignmentX = Math.floor(estAlignmentX);\r\n\t\t estAlignmentY = Math.floor(estAlignmentY);\r\n\t\t // Look for an alignment pattern (3 modules in size) around where it should be\r\n\t\t var allowance = Math.floor(allowanceFactor * overallEstModuleSize);\r\n\t\t var alignmentAreaLeftX = Math.max(0, estAlignmentX - allowance);\r\n\t\t var alignmentAreaRightX = Math.min(image.width, estAlignmentX + allowance);\r\n\t\t if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var alignmentAreaTopY = Math.max(0, estAlignmentY - allowance);\r\n\t\t var alignmentAreaBottomY = Math.min(image.height - 1, estAlignmentY + allowance);\r\n\t\t return alignment_finder_1.findAlignment(alignmentAreaLeftX, alignmentAreaTopY, alignmentAreaRightX - alignmentAreaLeftX, alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize, image);\r\n\t\t}", "function headerCountLiveNeighbors(board, location){\n var liveNeighbors = 0;\n //check above\n if(board[location - HEADERBOARDWIDTH] === HEADERALIVE && !headerInTopRow(location)){\n liveNeighbors++;\n }\n //check below\n if(board[location + HEADERBOARDWIDTH] === HEADERALIVE && !headerInBottomRow(location)){\n liveNeighbors++;\n }\n //check right\n if(board[location + 1] === HEADERALIVE && !headerInRightColumn(location)){\n liveNeighbors++;\n }\n //check left\n if(board[location - 1] === HEADERALIVE && !headerInLeftColumn(location)){\n liveNeighbors++;\n }\n //check aboveright\n if(board[location - HEADERBOARDWIDTH + 1] === HEADERALIVE && !headerInTopRow(location) && !headerInRightColumn(location)){\n liveNeighbors++;\n }\n //check aboveleft\n if(board[location - HEADERBOARDWIDTH - 1] === HEADERALIVE && !headerInTopRow(location) && !headerInLeftColumn(location)){\n liveNeighbors++;\n }\n //check belowright\n if(board[location + HEADERBOARDWIDTH + 1] === HEADERALIVE && !headerInBottomRow(location) && !headerInRightColumn(location)){\n liveNeighbors++;\n }\n //check belowleft\n if(board[location + HEADERBOARDWIDTH - 1] === HEADERALIVE && !headerInBottomRow(location) && !headerInLeftColumn(location)){\n liveNeighbors++;\n }\n return liveNeighbors;\n}", "function findNewState(){\n\n let newState = new Array();\n let prev;\n let anc;\n let next;\n\n for(i = 0; i < cols; i++) {\n\n anc = state[i];\n\n if(i == 0){\n prev = state[state.length-1];\n next = state[i+1];\n }\n else if( i == state.length - 1) {\n prev = state[i-1];\n next = state[0];\n }\n else{\n prev = state[i-1];\n next = state[i+1];\n }\n\n if(prev == 1 && anc == 1 && next == 1) {\n newState[i] = 0;\n }\n else if (prev == 1 && anc == 1 && next == 0) {\n newState[i] = 0;\n }\n else if (prev == 1 && anc == 0 && next == 1) {\n newState[i] = 1;\n }\n else if (prev == 1 && anc == 0 && next == 0) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 1 && next == 1) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 1 && next == 0) {\n newState[i] = 1;\n }\n else if (prev == 0 && anc == 0 && next == 1) {\n newState[i] = 0;\n }\n else if (prev == 0 && anc == 0 && next == 0) {\n newState[i] = 0;\n }\n }\n state = newState.slice();\n}", "function AlignmentPattern(posX, posY, estimatedModuleSize) {\n this.x = posX;\n this.y = posY;\n this.count = 1;\n this.estimatedModuleSize = estimatedModuleSize;\n }", "setup() {\n let validStateCount = 0;\n // For each row, allocate a clickable object\n for( let i = 0; i < this.statesTable.getRowCount(); i++ ) {\n let className = this.statesTable.getString(i, 'ClassName');\n \n // if we have an image, we will call setImage() to load that image into that p5.clickable\n if( className === \"\" ) {\n print(\"empty className field in line #\" + i + \" of states file\");\n return false; \n }\n \n // this is the allocator itself\n this.states[validStateCount] = eval(\"new \" + className);\n \n // store name of the state in the PNGRoom\n this.states[validStateCount].setName(this.statesTable.getString(i, 'StateName'));\n\n // All classes (for now) have a PNGFilename, could add a blank room\n this.states[validStateCount].setup( this.statesTable.getString(i, 'PNGFilename'),\n this.statesTable.getString(i, 'CollisionFilename'));\n \n this.states[validStateCount].preload();\n\n validStateCount++;\n }\n \n if( validStateCount > 0 ) {\n this.hasValidStates = true;\n this.currentStateName = this.statesTable.getString(0, 'StateName');\n this.changeState(this.currentStateName,true);\n }\n else {\n this.hasValidStates = false;\n }\n\n return this.hasValidStates;\n }", "canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, word){\n let result = false;\n let partialScore = 0;\n\n // Test if we can put the word at x, y, Vertical.\n \n // Test if the star and end position are over invalid state value terminate early.\n let endY = y + word.length - 1;\n if ((stateHoriz.board[x][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateVert.board[x][y] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateHoriz.board[x][y] == NO_HORIZ_NO_VERT) || \n (stateVert.board[x][y] == NO_HORIZ_NO_VERT) || \n\n (stateHoriz.board[x][endY] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateVert.board[x][endY] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n (stateHoriz.board[x][endY] == NO_HORIZ_NO_VERT) || \n (stateVert.board[x][endY] == NO_HORIZ_NO_VERT) ){\n \n result = false;\n partialScore = 0;\n return [result, partialScore]; \n }\n // Test if the word clash's with the Vertical constrains, for all positions of the previous words placed.\n for (let i = 0; i < word.length; i++) {\n let yi = y + i; \n if ((stateVert.board[x][yi] == VERTICAL) ||\n (stateVert.board[x][yi] == NO_HORIZ_NO_VERT) ||\n (stateHoriz.board[x][yi] == NO_HORIZ_NO_VERT) ||\n (stateVert.board[x][yi] == NO_CURR_ORIENT_AND_START_NO_END_OTHER) ||\n ( (state.board[x][yi] != EMPTY) && (state.board[x][yi] != word[i])) ){\n\n result = false;\n partialScore = 0;\n return [result, partialScore];\n }\n // Calculate the partial score of this move based on the number of crosses between words.\n if ((state.board[x][yi] != EMPTY) && (state.board[x][yi] == word[i])){\n partialScore = partialScore + 1;\n }\n }\n \n result = true;\n return [result, partialScore];\n }", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "step() {\n const backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n const currentBuffer = this.buffer[this.currentBufferIndex];\n const backBuffer = this.buffer[backBufferIndex];\n\n const countNeighbors = (x, y, options={border: 'wrap'}) => {\n let neighborCount = 0;\n\n // Actually count living neighbors\n if (options.border === 'wrap') {\n let north = y - 1;\n let south = y + 1;\n let west = x - 1;\n let east = x + 1;\n\n if (north < 0) north = this.height - 1;\n\n if (south > this.height - 1) south = 0;\n\n if (west < 0) west = this.width - 1;\n\n if (east > this.width - 1) east = 0;\n\n neighborCount = \n currentBuffer[north][west] + \n currentBuffer[north][x] + \n currentBuffer[north][east] + \n currentBuffer[y][west] + \n currentBuffer[y][east] + \n currentBuffer[south][x] + \n currentBuffer[south][east] + \n currentBuffer[south][west];\n\n } else if (options.border === 'nowrap') {\n // Treat out of bounds as zero\n for (let yOffset = -1; yOffset <= 1; yOffset++) {\n let yPos = y + yOffset;\n if (yPos < 0 || yPos >= this.height) continue; // Out of bounds\n\n for (let xOffset = -1; xOffset <= 1; xOffset++) {\n let xPos = x + xOffset;\n if (xPos < 0 || xPos >= this.width) continue; // Out of bounds\n if (yPos === y && xPos === x) continue; // Can't be your own neighbor\n neighborCount += currentBuffer[yPos][xPos];\n }\n }\n } else {\n throw new Error('Unknown border option: ' + options.border);\n }\n return neighborCount;\n }\n\n // Update backBuffer to have the next time state\n for(let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const neighbors = countNeighbors(x, y);\n const thisCell = currentBuffer[y][x];\n\n // Implement GoL rules\n if (thisCell) {\n //Current cell is alive\n if (neighbors < 2 || neighbors > 3) {\n // Death\n backBuffer[y][x] = 0;\n } else {\n // Alive\n backBuffer[y][x] = 1;\n }\n } else {\n // Current cell is dead\n if (neighbors === 3) {\n // A cell is born\n backBuffer[y][x] = 1;\n } else {\n // Still dead\n backBuffer[y][x] = 0;\n }\n }\n }\n }\n\n this.currentBufferIndex = backBufferIndex;\n }", "function numIslands(grid) {\n //? Treat matrix as graph, recursive DFS on grid with row, column if land seen \n let count = 0;\n \n function dfs(grid, row, col) {\n if (row < 0 || col < 0 || row >= grid.length || col >= grid.length) return;\n\n let value = grid[row][col];\n if (value === '1') {\n grid[row][col] = '#';\n dfs(grid, row+1, col);\n dfs(grid, row-1, col);\n dfs(grid, row, col-1);\n dfs(grid, row, col+1);\n }\n }\n\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[0].length; j++) {\n if (grid[i][j] === '1') {\n count++;\n dfs(grid, i, j);\n }\n }\n }\n return count;\n}", "noOfScan() {\n\n return new Promise(async (resolve, reject) => {\n\n let imgBytes = await this.toIntegerArray();\n\n let scanCount = 0;\n \n let SOS = this.SOS;\n\n let imgBytesLength = imgBytes.length;\n \n //0xFFDA\n for (let i = 0; i < imgBytesLength; i = i + 2) {\n //0xFFDA\n if (imgBytes[i] === SOS[0] && imgBytes[i + 1] === SOS[1]) {\n scanCount++;\n }\n }\n \n resolve(scanCount);\n });\n }", "function count_islands(emap) {\n \n const len = array_length(emap);\n const height = array_length(emap[0]);\n \n let visited = [];\n\n // Generate the visited 2D array -> This is to check whether the cell \n // has already been checked\n for (let i = 0; i < len; i = i + 1) {\n visited[i] = [];\n for (let j = 0; j < height; j = j + 1) {\n visited[i][j] = false;\n }\n }\n \n // Check whether the neighboring cells are valid \n function isSafe(emap, row, col, visited) {\n // Check there is no negative / overflow index\n return row >= 0 && row < len && col >= 0 && col < height \n && emap[row][col] > 0 && !visited[row][col];\n }\n \n\n // Apply Depth-First search and treat the 2D array as a graph\n function dfs(emap, row, col, visited) {\n // Mark this cell as visited\n visited[row][col] = true;\n for (let i = -1; i <= 1; i = i + 1) {\n for (let j = -1; j <= 1; j = j + 1) {\n if ((i === -1 && j === 0) ||\n (i === 0 && j === -1) ||\n (i === 0 && j === 1) ||\n (i === 1 && j === 0)) {\n if(isSafe(emap, row + i, col + j, visited)) {\n dfs(emap, row + i, col + j, visited);\n } else {\n \n }\n } else {\n \n }\n }\n }\n \n }\n\n \n let counter = 0;\n \n // Trying to check the number of connected graphs\n for (let i = 0; i < len; i = i + 1) {\n for (let j = 0; j < len; j = j + 1) {\n if (emap[i][j] > 0 && !visited[i][j]) {\n // Check\n dfs(emap, i, j, visited);\n counter = counter + 1;\n } else {\n \n }\n }\n }\n\n return counter;\n}", "function horizontalWinCheck() {\r\n for (var row = 0; row < 6; row++) {\r\n for (var col = 0; col < 4; col++) {\r\n if (colorMatchCheck(returnColor(row,col), returnColor(row,col+1) ,returnColor(row,col+2), returnColor(row,col+3))) {\r\n console.log('horiz');\r\n reportWin(row,col);\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "_calcCellState(pos){\n var cell=pos.split(':');\n var x=Number (cell[0]);\n var y=Number (cell[1]);\n var currState=this._getCellState(x, y);\n // Get adjacent cells\n var sum=0;\n sum+=this._getCellState(x-1, y-1);\n sum+=this._getCellState(x, y-1);\n sum+=this._getCellState(x+1, y-1);\n sum+=this._getCellState(x-1, y);\n sum+=this._getCellState(x+1, y);\n sum+=this._getCellState(x-1, y+1);\n sum+=this._getCellState(x, y+1);\n sum+=this._getCellState(x+1, y+1);\n\n // Living cell\n if(currState===1){\n // < 2 live neighbors\n if(sum<2){return false;}\n // 2 or 3\n if(sum===2 || sum===3){return true;}\n // > 3\n if(sum>3){return false;}\n }else{\n if(sum===3){return true;}\n }\n return false\n }", "function decide() {\n\t\t\t\tvar recognise = false;\n\t\t\t\tif(fromAbove && fromBelow) {\n\t\t\t\t\tif(fromAbove == fromBelow) {\n\t\t\t\t\t\talert(\"Pattern recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.childAddress[i].x][self.childAddress[i].y][self.childAddress[i].z](fromBelow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Pattern not recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.parentAddress.x][self.parentAddress.y][self.parentAddress.z](fromBelow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function match_pattern(state, pattern, player) {\n for(var idx1 = 0; idx1 < state.length; idx1++) {\n for(var idx2 = 0; idx2 < state[idx1].length; idx2++) {\n var matches = match_pattern_at(state, pattern, player, idx1, idx2);\n if(matches) {\n return true;\n }\n }\n }\n return false;\n}", "function checkFlaggedMatrix(x,y) {\n count = 0;\n for (i=x-1; i<=x+1; i++) {\n for (j=y-1; j<=y+1; j++) {\n if ((i!=x) || (j!=y)) { //Don't check center point\n count = count + checkFlagged(i,j); } } }\n return count; }", "function checkDiag(i, j, state) {\n //\t\tSystem.out.println(\"Diagnose starts!!!!!!!! I \" + i + \" j \" + j);\n var countb = 0;\n var countw = 0;\n var diagChoice = -1;\n if (i == j) {\n diagChoice = 1;\n } else if (i + j == 5) {\n diagChoice = 2;\n } else {\n return 0;\n }\n var tempb = [];\n var tempw = [];\n for (var k = 0; k < 6; k ++) {\n var l = k;\n if (diagChoice == 2) {\n l = 5 - k;\n }\n if (state[k][l] == 'b') {\n countb ++;\n tempw.push(countw);\n countw =0;\n } else if (state[k][l] == 'w'){\n countw ++;\n tempb.push(countb);\n countb = 0;\n } else {\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n }\n }\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n tempb.sort(function(a,b) {return b-a});\n tempw.sort(function(a,b) {return b-a});\n resultB[diagChoice + 11] = tempb[0];\n resultW[diagChoice + 11] = tempw[0];\n }", "function checkOverlapse(direction) {\n\t\textraTop = newTop;\n\t\textraLeft = newLeft;\n\t\t\n\t\tlet overlapRows = false;\n\t\t let overlapCols = false;\n\t\t\n\t\tif (currTopPx % dimension != 0)\n\t\t\toverlapRows = true;\n\t\tif (currLeftPx % dimension != 0)\n\t\t\toverlapCols = true;\n\t\t\n\t\tswitch(direction) {\n\t\t\tcase leftKey:\n\t\t\tcase rightKey:\t \n\t\t\t\tif (overlapRows)\n\t\t\t\t\textraTop = newTop + 1;\n\t\t\t\tbreak;\n\t\n\t\t\tcase upKey:\n\t\t\tcase downKey: \n\t\t\t\tif (overlapCols)\n\t\t\t\t\textraLeft = newLeft + 1;\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t}\n\t}", "scan() {\n \n this.clearBuffer();\n var currentState = 0;\n var token, reservedToken;\n \n //loop through until stream has no more characters.\n do {\n \n let actionBlock = this.lookupState(currentState,this.currentChar);\n log.debug(\"[Scanner] CurrentState:\",currentState,\",CurrentChar:\",this.currentChar,\",NextChar:\",this.nextChar,\",ActionState:\",actionBlock.state,\",TokenBuffer:\",this.tokenBuffer);\n \n switch (actionBlock.action) {\n case Action.ERROR:\n //TODO a thing here\n break;\n case Action.MOVE_APPEND:\n currentState = actionBlock.state;\n this.tokenBuffer += this.currentChar;\n this.consumeChar();\n break;\n case Action.MOVE_NOAPPEND:\n currentState = actionBlock.state;\n this.consumeChar();\n break;\n case Action.HALT_APPEND:\n token = this.lookupCode(actionBlock.state);\n this.tokenBuffer += this.currentChar;\n reservedToken= this.checkExceptions(this.tokenBuffer);\n this.consumeChar();\n if (reservedToken !== undefined) {\n return reservedToken;\n } else if (token !== undefined && !token.skip) {\n return token.code;\n } else {\n //reset and keep moving\n this.clearBuffer();\n currentState = 0;\n }\n break;\n case Action.HALT_NOAPPEND:\n token = this.lookupCode(actionBlock.state);\n reservedToken = this.checkExceptions(this.tokenBuffer);\n this.consumeChar();\n if (reservedToken !== undefined) {\n return reservedToken;\n } else if (token.code !== undefined && !token.skip) {\n return token.code;\n } else {\n //reset and keep moving\n this.clearBuffer();\n currentState = 0;\n }\n break;\n case Action.HALT_REUSE:\n token = this.lookupCode(actionBlock.state);\n reservedToken = this.checkExceptions(this.tokenBuffer);\n if (reservedToken !== undefined) {\n return reservedToken;\n } else if (token.code !== undefined && !token.skip) {\n return token.code;\n } else {\n //reset and keep moving\n this.clearBuffer();\n currentState = 0;\n }\n break;\n }\n \n } while (this.currentChar !== null || this.tokenBuffer);\n \n return \"EofSym\";\n\n }", "function checkForHorizontalMatches(grid, height, width){\n xMatchList = [];\n for (var a = 0; a < grid.length; a++){\n for (var b = 0; b < grid[a].length; b++){\n if (grid[a][b-1]){\n if (grid[a][b].stoneColor != grid[a][b-1].stoneColor){\n if (grid[a][b+1]){\n if (grid[a][b].stoneColor == grid[a][b + 1].stoneColor){\n var count = 1;\n var matches = [];\n matches.push(grid[a][b]);\n while (grid[a][b + count] != null && grid[a][b].stoneColor == grid[a][b + count].stoneColor){\n matches.push(grid[a][b + count]);\n count++;\n }\n if (matches.length >= 3){\n xMatchList.push(matches);\n }\n }\n }\n }\n }\n }\n }\n return xMatchList;\n }", "getAlignmentPatternCoOrdinates() {\n let allign = null;\n switch ((this.mVersion)) {\n case 2:\n allign = [6, 18];\n break;\n case 3:\n allign = [6, 22];\n break;\n case 4:\n allign = [6, 26];\n break;\n case 5:\n allign = [6, 30];\n break;\n case 6:\n allign = [6, 34];\n break;\n case 7:\n allign = [6, 22, 38];\n break;\n case 8:\n allign = [6, 24, 42];\n break;\n case 9:\n allign = [6, 26, 46];\n break;\n case 10:\n allign = [6, 28, 50];\n break;\n case 11:\n allign = [6, 30, 54];\n break;\n case 12:\n allign = [6, 32, 58];\n break;\n case 13:\n allign = [6, 34, 62];\n break;\n case 14:\n allign = [6, 26, 46, 66];\n break;\n case 15:\n allign = [6, 26, 48, 70];\n break;\n case 16:\n allign = [6, 26, 50, 74];\n break;\n case 17:\n allign = [6, 30, 54, 78];\n break;\n case 18:\n allign = [6, 30, 56, 82];\n break;\n case 19:\n allign = [6, 30, 58, 86];\n break;\n case 20:\n allign = [6, 34, 62, 90];\n break;\n case 21:\n allign = [6, 28, 50, 72, 94];\n break;\n case 22:\n allign = [6, 26, 50, 74, 98];\n break;\n case 23:\n allign = [6, 30, 54, 78, 102];\n break;\n case 24:\n allign = [6, 28, 54, 80, 106];\n break;\n case 25:\n allign = [6, 32, 58, 84, 110];\n break;\n case 26:\n allign = [6, 30, 58, 86, 114];\n break;\n case 27:\n allign = [6, 34, 62, 90, 118];\n break;\n case 28:\n allign = [6, 26, 50, 74, 98, 122];\n break;\n case 29:\n allign = [6, 30, 54, 78, 102, 126];\n break;\n case 30:\n allign = [6, 26, 52, 78, 104, 130];\n break;\n case 31:\n allign = [6, 30, 56, 82, 108, 134];\n break;\n case 32:\n allign = [6, 34, 60, 86, 112, 138];\n break;\n case 33:\n allign = [6, 30, 58, 86, 114, 142];\n break;\n case 34:\n allign = [6, 34, 62, 90, 118, 146];\n break;\n case 35:\n allign = [6, 30, 54, 78, 102, 126, 150];\n break;\n case 36:\n allign = [6, 24, 50, 76, 102, 128, 154];\n break;\n case 37:\n allign = [6, 28, 54, 80, 106, 132, 158];\n break;\n case 38:\n allign = [6, 32, 58, 84, 110, 136, 162];\n break;\n case 39:\n allign = [6, 26, 54, 82, 110, 138, 166];\n break;\n case 40:\n allign = [6, 30, 58, 86, 114, 142, 170];\n break;\n }\n return allign;\n }", "neighborCount(mtx, x, y) {\n var count = 0;\n for (var i = -1 ; i <= 1 ; i++) {\n for (var j = -1 ; j <= 1 ; j++) {\n if ((0 < (x+i)) && ((x+i) < this.width)\n && (0 < (y+j)) && ((y+j) < this.height)) {\n if (0 != mtx[y+j][x+i]) {\n count += 1;\n }\n }\n }\n }\n if (0 < count) {\n console.log(\"neighborCount(\", x, y, \") = \", count);\n }\n return count;\n }", "function horizontalWinCheck() {\n for(var row=0;row<6;row++) {\n for(var col = 0;col < 4;col++){\n if(colorMatchCheck(returnColor(row,col), returnColor(row,col+1), returnColor(row,col+2))) {\n console.log('horizontal');\n reportWin(row,col);\n return true;\n }else {\n continue;\n }\n }\n }\n}", "function verify_state() {\n let s=read_state();\n\n let cnt=Array(10).fill(0);\n for(let j=0;j<3;++j)\n for(let i=0;i<3;++i) {\n let pos=\"Row \"+j+\", Col \"+i;\n if(isNaN(s.grid[j][i])) {\n helper_log_write(pos+\" is not a number\");\n return false;\n }\n if(s.grid[j][i] < 0 || s.grid[j][i] > 8) {\n helper_log_write(pos+\" is out of range\");\n return false;\n }\n ++cnt[s.grid[j][i]];\n }\n \n for(let i=0;i<9;++i) {\n let val=\"\"+i;\n if(i==0) val=\"blank\";\n if(cnt[i]==0) {\n helper_log_write(\"Missing \"+val);\n return false;\n }\n if(cnt[i]>1) {\n helper_log_write(\"Too many \"+val+\"s\");\n return false;\n }\n }\n \n //Count inversions to see if puzzle is solveable\n let inv=0;\n let g=[];\n for(let j=0;j<3;++j)\n for(let i=0;i<3;++i)\n g.push(s.grid[j][i]);\n g=g.filter(function(x){return x>0;});\n for(let i=0;i<8;++i)\n for(let j=i+1;j<8;++j)\n if(g[i]>g[j]) ++inv;\n if(inv%2==0) {\n helper_log_write(\"Not solveable\");\n return false;\n }\n \n return true;\n}", "function countSameColorIcons(startIcon, moveX, moveY) {\n\n var curX = startIcon.posX + moveX;\n var curY = startIcon.posY + moveY;\n var count = 0;\n\n while (curX >= 0 && curY >= 0 && curX < BOARD_COLS && curY < BOARD_ROWS && getIconColor(getIcon(curX, curY)) === getIconColor(startIcon))\n {\n count++;\n curX += moveX;\n curY += moveY;\n }\n\n return count;\n\n}", "function check_counts(p) {\n //checks the rows and columns for the number of X's or O's\n for (var i = 0; i < 3; i++) {\n if (tempboard[(0 + i)] == p) {\n countrow0++;\n }\n if (tempboard[(3 + i)] == p) {\n countrow1++;\n }\n if (tempboard[(6 + i)] == p) {\n countrow2++;\n }\n if (tempboard[(i * 3 + 0)] == p) {\n countcol0++;\n }\n if (tempboard[(i * 3 + 1)] == p) {\n countcol1++;\n }\n if (tempboard[(i * 3 + 2)] == p) {\n countcol2++;\n }\n }\n //checks the diagonals for the number of X's or O's\n if (tempboard[0] == p) {\n countdiag1++;\n }\n if (tempboard[4] == p) {\n countdiag1++;\n countdiag2++;\n }\n if (tempboard[8] == p) {\n countdiag1++;\n }\n if (tempboard[2] == p) {\n countdiag2++;\n }\n if (tempboard[6] == p) {\n countdiag2++;\n }\n\n // if a row, column or diagonal has 3 X's or O's, we have a winner!\n if (countrow0 == 3 || countrow1 == 3 || countrow2 == 3 || countcol0 == 3 || countcol1 == 3 || countcol2 == 3 || countdiag1 == 3 || countdiag2 == 3) has_won = true;\n}", "function searchOnDnaMatrix(dna, sequence, row, col, matchesFound) {\n var numSeq = 0;\n\n // try to search sequence only if the letter from the dna is part of the sequence\n // as the first position is already matched, start from the next one\n if (dna[row][col] === sequence[0]) {\n // there are only 4 possible directions to search: horizontal, vertical, main diagonal and secondary diagonal\n\n // Horizontal matches\n var n;\n var positions = [row + ',' + col];\n for (n = 1; n < sequence.length; n++) {\n if (col + n >= dna.length || col + n < 0) \n break;\n\n if (typeof dna[row][col + n] === 'undefined' || dna[row][col + n] !== sequence[n])\n break;\n\n positions.push( row + ',' + (col + n) );\n }\n\n // if the length of the sequence has the same value as n (length of the sequence in the dna) increment numSeq\n if (sequence.length === n) {\n numSeq++;\n matchesFound[sequence].push( positions );\n }\n\n // Vertical matches\n for (n = 1; n < sequence.length; n++) {\n if (row + n >= dna.length || row + n < 0) \n break;\n\n if (typeof dna[row + n][col] === 'undefined' || dna[row + n][col] !== sequence[n])\n break;\n\n positions.push( (row + n) + ',' + col );\n }\n\n // if the length of the sequence has the same value as n (length of the sequence in the dna) increment numSeq\n if (sequence.length === n) {\n numSeq++;\n matchesFound[sequence].push( positions );\n }\n\n // Main diagonal matches \n for (n = 1; n < sequence.length; n++) {\n if (row + n >= dna.length || row + n < 0 || col + n >= dna.length || col + n < 0) \n break;\n\n if (typeof dna[row + n][col + n] === 'undefined' || dna[row + n][col + n] !== sequence[n])\n break;\n\n positions.push( (row + n) + ',' + (col + n) );\n }\n\n // if the length of the sequence has the same value as n (length of the sequence in the dna) increment numSeq\n if (sequence.length === n) {\n numSeq++;\n matchesFound[sequence].push( positions );\n }\n\n // Secondary diagonal matches \n for (n = 1; n < sequence.length; n++) {\n if (row - n >= dna.length || row - n < 0 || col + n >= dna.length || col + n < 0) \n break;\n\n if (typeof dna[row - n][col + n] === 'undefined' || dna[row - n][col + n] !== sequence[n])\n break;\n\n positions.push( (row - n) + ',' + (col + n) );\n }\n\n // if the length of the sequence has the same value as n (length of the sequence in the dna) increment numSeq\n if (sequence.length === n) {\n numSeq++;\n matchesFound[sequence].push( positions );\n }\n\n }\n\n return numSeq; \n}", "function NumberOfIsland(grid) {\n let n, m, count = 0;\n n = grid.length;\n if (n <= 0) return 0;\n m = grid[0].length;\n for (let i = 0; i < n; i++){\n for (let j = 0; j < m; j++) {\n if(grid[i][j] === \"1\"){\n DFSMark(grid, i, j);\n count++;\n }\n }\n }\n return count;\n}", "Board_Evaluation(board, color) {\n let result = { two: 0, three: 0, four: 0 };\n\n for (var i = 0; i < 6; i++) {\n for (var j = 0; j < 7; j++) {\n if (board[i][j] === color) {\n let x = j;\n let y = i;\n let arr = [\n this.search2(x, y, color, 1, 0, 0, board),\n this.search2(x, y, color, -1, 0, 0, board),\n this.search2(x, y, color, 1, 1, 0, board),\n this.search2(x, y, color, -1, -1, 0, board),\n this.search2(x, y, color, -1, 1, 0, board),\n this.search2(x, y, color, 1, -1, 0, board),\n this.search2(x, y, color, 0, 1, 0, board),\n this.search2(x, y, color, 0, -1, 0, board),\n ];\n\n for (var q = 0; q < 4; q++) {\n switch (arr[2 * q].count + arr[2 * q + 1].count - 1) {\n case 2:\n if (arr[2 * q].live) result.two++;\n break;\n\n case 3:\n if (arr[2 * q].live + arr[2 * q + 1].live > 0) {\n result.three++;\n } else if (\n arr[2 * q].live + arr[2 * q + 1].live ===\n 2\n ) {\n console.log(1);\n result.four++;\n }\n break;\n\n case 4:\n result.four++;\n break;\n }\n }\n }\n }\n }\n return result;\n }", "function findInSequence() {\n\tvar beginMatch = 0;\n\tvar endMatch = 0;\n\tvar i = 0;\n\tvar specChar = RegExp('[X]');\n\tvar test = specChar.exec(searchMotif);\n\tconsole.log(test);\n\tvar xs = [];\n\tvar generalCase = false;\n\tvar splitMotif = searchMotif.split(\"\");\n\tif (test != null && searchMotif.length >= 2){\n\t\t\n\t\tfor (var i = 0; i < searchMotif.length; i++){\n\t\t\tvar char = searchMotif.charAt(i);\n\t\t\tif(char == \"X\"){\n\t\t\t\txs.push(i);\n\t\t\t}\n\t\t}\n\t\tgeneralCase = true;\n\t}\nwhile (endMatch < seq.length){\n\tendMatch = beginMatch + searchMotif.length;\n\tvar currentlyChecked = seq.substring(beginMatch, endMatch);\n\t//check for spaces or new lines within the search portion of the sequence\n\tif(generalCase){\n\t\tvar currCheckedSplit = currentlyChecked.split(\"\");\n\t\t//process out x's\n\t\tfor(var i = 0; i < splitMotif.length; i++){\n\t\t\tif(xs[i] != null){\n\t\t\tcurrCheckedSplit.splice(xs[i],1,\"X\");\n\t\t\t}\n\t\t}\n\t\tcurrentlyChecked = currCheckedSplit.join(\"\");\n\t}\n\tif(currentlyChecked === searchMotif){\n\t\tvar indices = [beginMatch, endMatch];\n\t\tindicesOfMatches.push(indices);\n\t\tbeginMatch = endMatch;\n\t}\n\telse{\n\t\tbeginMatch++;\n\t}\n\tcurrentlyChecked = \"\";\n}\n\tinsertHighlightSpans();\n}", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "screenAlignmentPattern() {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << 22 /* WIDTH_SHIFT */ | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n const buffer = this._bufferService.buffer;\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = buffer.ybase + buffer.y + yOffset;\n const line = buffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowService.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }", "checkForMatch() {\n\n // Matching horizontal lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._topMiddle.textContent && this._topMiddle.textContent === this._topRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._topMiddle.style.backgroundColor = 'green'\n this._topRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._middleLeft.textContent === 'X' || this._middleLeft.textContent === '0') {\n \n if(this._middleLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._middleRight.textContent) {\n this._middleLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._bottomLeft.textContent === 'X' || this._bottomLeft.textContent === '0') {\n \n if(this._bottomLeft.textContent === this._bottomMiddle.textContent && this._bottomMiddle.textContent === this._bottomRight.textContent) {\n this._bottomLeft.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n // Matching vertical lines\n if(this._topLeft.textContent === 'X' || this._topLeft.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleLeft.textContent && this._middleLeft.textContent == this._bottomLeft.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleLeft.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topMiddle.textContent === 'X' || this._topMiddle.textContent === '0') {\n \n if(this._topMiddle.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent == this._bottomMiddle.textContent) {\n this._topMiddle.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomMiddle.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n\n if(this._topRight.textContent === 'X' || this._topRight.textContent === '0') {\n \n if(this._topRight.textContent === this._middleRight.textContent && this._middleRight.textContent == this._bottomRight.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleRight.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n \n // Matching diagonal lines\n if(this._middleMiddle.textContent === 'X' || this._middleMiddle.textContent === '0') {\n \n if(this._topLeft.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomRight.textContent) {\n this._topLeft.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomRight.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n\n if(this._topRight.textContent === this._middleMiddle.textContent && this._middleMiddle.textContent === this._bottomLeft.textContent) {\n this._topRight.style.backgroundColor = 'green'\n this._middleMiddle.style.backgroundColor = 'green'\n this._bottomLeft.style.backgroundColor = 'green'\n\n this.finishTheGame();\n }\n }\n }", "function treasureIsland(grid) {\n\tlet queue = [];\n\tlet directions = [\n\t\t[-1, 0],\n\t\t[1, 0],\n\t\t[0, 1],\n\t\t[0, -1]\n\t];\n\tlet count = 0;\n\tqueue.push([0, 0]);\n\twhile (queue.length !== 0) {\n\t\tcount++;\n\t\tlet size = queue.length;\n\t\tfor (let i = 0; i < size; i++) {\n\t\t\tlet [startR, startC] = queue.shift();\n\t\t\tfor (let [dr, dc] of directions) {\n\t\t\t\tlet r = startR + dr;\n\t\t\t\tlet c = startC + dc;\n\t\t\t\tif (r >= 0 && r < grid.length && c >= 0 && c < grid[0].length) {\n\t\t\t\t\tif (grid[r][c] === 'X') {\n\t\t\t\t\t\treturn count;\n\t\t\t\t\t}\n\t\t\t\t\tif (grid[r][c] === 'O') {\n\t\t\t\t\t\tgrid[r][c] = 'D'; //make sure not going there again\n\t\t\t\t\t\tqueue.push([r, c]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "step() {\n // !!!! IMPLEMENT ME !!!!\n let currentBuffer = this.cells[this.currentBufferIndex];\n let backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n\n function countNeighbors(row, col) {\n let neighborCount = 0;\n\n for (let rowOffset = -1; rowOffset <= 1; rowOffset++) {\n let rowPos = row + rowOffset;\n\n if (rowPos < 0 || rowPos === this.height) {\n continue;\n }\n\n for (let colOffset = -1; colOffset <= 1; colOffset++) {\n let colPos = col + colOffset;\n\n if (colPos < 0 || colPos === this.width) {\n continue;\n }\n \n if (colOffset === 0 && rowOffset === 0) { // Current cell\n continue;\n }\n\n if (currentBuffer[rowPos][colPos] === 1) {\n neighborCount++;\n }\n }\n }\n return neighborCount;\n };\n\n for (let r = 0; r < this.height; r++) {\n for (let c = 0; c < this.width; c++) {\n let neighborCount = countNeighbors.call(this, r, c);\n\n if (currentBuffer[r][c] === 1) {\n if (neighborCount < 2 || neighborCount > 3) {\n backBuffer[r][c] = 0;\n } else {\n backBuffer[r][c] = 1;\n }\n } else {\n if (neighborCount === 3) {\n backBuffer[r][c] = 0;\n } else {\n backBuffer[r][c] = 1;\n }\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function islands(matrix){\n \n var count = 0;\n function traverse(x, y,count){\n \n if (x < 0 || y < 0 || x >= matrix[0].length || y >= matrix.length){\n return;\n } else if(matrix[y][x] === 0){\n \n \n \n return;\n \n }else if(matrix[y][x] === 0 && matrix[y][x+1] === 0){\n \n \n traverse(x+1,y,count);\n \n \n }else if(matrix[y][x] === 0 && matrix[y][x -1] === 0){\n \n \n traverse(x-1,y,count);\n \n \n }else if(matrix[y][x] === 0 && matrix[y+1][x] === 0){\n \n \n traverse(x,y+1,count);\n \n \n }else if(matrix[y][x] === 0 && matrix[y-1][x] === 0){\n \n \n traverse(x,y-1,count);\n \n \n }\n \n if(matrix[y][x] == 1){\n count++;\n matrix[y][x] = 0;\n console.log(x + '_' + y);\n \n traverse(x,y-1,count);\n traverse(x+1,y,count);\n traverse(x,y + 1,count);\n traverse(x-1, y,count);\n \n \n }\n \n \n let object = {\"X\":x,\"Y\":y};\n \n return count;\n }\n \n console.log(traverse(0, 0,count));\n \n \n}", "function lookAhead(input,stateInformation) {\n let totalLength = input.length;\n let state = stateInformation.state.currentState;\n let idx = stateInformation.currentIndex;\n var result = undefined;\n while (state === stateInformation.state.currentState && idx < totalLength){\n let c = input.charAt(idx);\n if (stateInformation.state.transitions[stateInformation.state.currentState].lookFor.has(c)){\n stateInformation.state.currentState = stateInformation.state.nextState;\n if (stateInformation.state.currentState != stateInformation.finalState){\n stateInformation.state.nextState++;\n stateInformation.currentIndex = idx;\n stateInformation.capturedInformation = c;\n }\n else{\n stateInformation.done = true;\n }\n result = stateInformation;\n\n } else {\n idx++; \n }\n }\n return result;\n}", "function getCount(possibility_matrix, count_arr, len) {\n let turn_1_index = 0;\n let turn_1_count = count_arr[0];\n let turn_2_count = 0;\n for (let i = 0; i < count_arr.length; i++) {\n if (count_arr[i] > turn_1_count) {\n turn_1_count = count_arr[i];\n turn_1_index = i;\n }\n }\n if (count_arr.length > 1) {\n let catched_salmon_arr = [];\n for (let i = 0; i < possibility_matrix[turn_1_index].length; i++) {\n if (possibility_matrix[turn_1_index][i]) {\n catched_salmon_arr[i] = true;\n }\n }\n // console.log(catched_salmon_arr, turn_1_index, turn_1_count);\n let turn_2_index;\n for (let i = 0; i < catched_salmon_arr.length; i++) {\n if (catched_salmon_arr[i]) {\n continue;\n } else {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n break;\n }\n }\n\n for (let i = 0; i < count_arr.length; i++) {\n if (!catched_salmon_arr[i] && count_arr[i] > turn_2_count && (count_arr[i] + turn_1_count) <= len && checkNoneOfCurrentGroupCatched(possibility_matrix[i])) {\n turn_2_index = i;\n turn_2_count = count_arr[i];\n }\n }\n // console.log(catched_salmon_arr, turn_2_index, turn_2_count);\n } else {\n turn_2_count = 0; // turn 2 not possible\n }\n console.log(turn_1_count + turn_2_count);\n}", "getSize() {\n\t\tlet pattern = this.getPattern();\n\t\tlet highestRow = 0;\n\t\tlet highestCol = 0;\n\t\tfor(let block of pattern){\n\t\t\tlet row = block[0] + 1;\n\t\t\tlet col = block[1] + 1;\n\n\t\t\tif(row >= highestRow){\n\t\t\t\thighestRow = row;\n\t\t\t}\n\t\t\tif(col >= highestCol){\n\t\t\t\thighestCol = col;\n\t\t\t}\n\n\t\t}\n\t\tthis.width = highestCol;\n\t\tthis.height = highestRow;\n\t}", "function matchPattern(pattern,genome) {\n //console.log(pattern);\n //console.log(genome);\n //console.log(\"genome length : \" + genome.length);\n var positions = [];\n for(var i=0;i<=genome.length-pattern.length;i++) {\n var str = computeText(genome,i,pattern.length);\n // console.log(str);\n if(str==pattern) {\n positions.push(i);\n }\n }\n return positions;\n /*\n var output = \"\";\n for(var i=0;i<positions.length;i++) {\n output = output + positions[i] + \" \";\n }\n return output;\n */\n}", "function little_check(count,count2){\n\t\t\t\n\t\t\t//console.log(\"count \"+ count+\"count2 \"+count2);\t\t\t\n \t \t\tfor ( var x=count; x <= (count+2); x++) { // cycle the matrix rows...\n \t \t\t\tfor (var y=count2; y <= (count2+2); y++) { // ...and cycle the matrix cells\n\t\t\t\t\t//var BR=1;\n\n\t\t\t\t\t//console.log(\"matrx[x] \"+ x+\"martix[y] \"+y);\n\t\t\t\t\tif ((matrix[x][(count2+0)]) === \"p1\" && (matrix[x][(count2+1)]) === \"p1\" && (matrix[x][(count2+2)]) === \"p1\") { // If our cell has been 'tagged' p1 given x is (e.g 0) then: x0y0, x0y1, x0y2 would mean player one has 3 horizontal cells in a line = victory!\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"horizontal victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins square row \"+BR+ \"column \"+BC )\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][y]) === \"p1\" && (matrix[(count+1)][y]) === \"p1\" && (matrix[(count+2)][y]) === \"p1\") { // Repeated for other conditions\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"vertical victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ((matrix[(count+0)][(count2+0)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+2)]) === \"p1\") {\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"LtopRdown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][(count2+2)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+0)]) === \"p1\") {\t\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"Rtop Ldown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t \t}", "function step()\n{\n\tvar numAround = new Array(cellYCount)\n\t\n\t//Loop through and build the count array\n\tfor(i = 0; i < cellYCount; i++)\n\t{\n\t\tnumAround[i] = new Array(cellXCount);\n\t\tfor(j = 0; j < cellXCount; j++)\n\t\t{\n\t\t\tnumAround[i][j] = countNeighbors(j, i);\n\t\t\t//console.log(j + \" \" + i + \": \" + numAround[i][j])\n\t\t}\n\t}\n\t\n\t//Use the count array to determine the new states for each cell\n\tfor(i = 0; i < cellYCount; i++)\n\t{\n\t\tfor(j = 0; j < cellXCount; j++)\n\t\t{\n\n\t\t\t//If 3, the cell is alive\n\t\t\tif(numAround[i][j] == 3)\n\t\t\t{\n\t\t\t\t//console.log(j + \" \" + i + \" = \" + numAround[i][j]);\n\t\t\t\tdrawCell(j, i, 1);\n\t\t\t}\n\t\t\t//If four, the cell stays the same\n\t\t\telse if(numAround[i][j] == 4);\n\t\t\t//Otherwise, the cell is dead\n\t\t\telse\n\t\t\t{\n\t\t\t\tdrawCell(j, i, 0);\n\t\t\t}\n\t\t\n\t\t}\n\t}\n}", "function updateCount( x, y, regions, last_regions) {\n var occupied = []; \n for (var r in regions) {\n \n // If already in the region, expand the boundaries\n var adj_lr = [0,0]; \n var adj_ul = [0,0]; \n var A = 0.12; // A 12% proportional \"expansion\" of the border to trigger leaving\n if (useRegionStickiness && last_regions.indexOf(r) > -1) { \n adj_lr[0] = A*regions[r].height;\n adj_lr[1] = A*regions[r].width;\n adj_ul[0] = -1*A*regions[r].height;\n adj_ul[1] = -1*A*regions[r].width;\n } \n \n // Now, use the adjusted region boundaries in the test\n //\n if (y >= regions[r].ul[0]+adj_ul[0] && y <= regions[r].lr[0]+adj_lr[0] && // These checks are for a graphics coordinate\n x >= regions[r].ul[1]+adj_ul[1] && x <= regions[r].lr[1]+adj_lr[1] ) { // system with (0,0) in the top left\n regions[r].count += 1; \n occupied.push(r); \n }\n } \n return occupied; \n}", "update(when) {\n console.log(\"input mtx bit count: \",\n this.bitCount(this.input_matrix()));\n console.log(\"output mtx bit count: \",\n this.bitCount(this.output_matrix()));\n this.compute_next_mtx(this.output_matrix(), this.input_matrix());\n this.sc.update();\n }", "function checkIslands(matrix) {\n let count = 0;\n \n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix[i].length; j++) {\n // if we hit 1\n if (matrix[i][j] == 1) {\n // and our top and left is either zero or outside the area\n if ((i - 1) < 0 || matrix[i - 1][j] === 0 &&\n (j - 1) < 0 || matrix[i][j - 1] === 0) {\n count++;\n }\n }\n }\n }\n \n /*\n if (matrix[i][j] == '1'):\n \n if ((i == 0 or matrix[i - 1][j] == 'O') and\n (j == 0 or matrix[i][j - 1] == 'O')):\n count = count + 1\n \n \n \n \n */\n \n \n \n \n \n return count;\n }", "function vis_shift_and(p, text) {\n $(\"#the-haystack\").html(\"\");\n $(\"#the-needle\").html(\"\").css('left', 'inherit');\n $(\"#bitmask-table\").html(\"\");\n $(\"#match-run pre\").html(\"\");\n\n var b = {};\n var l = p.length;\n var tl = text.length;\n var alphabet = [];\n\n // initialize bitmask table\n // build alphabet array\n for (var i = 0; i < l; i++) {\n var ch = p.charAt(i);\n add_to_alphabet(alphabet, ch);\n b[ch] = 0;\n }\n\n //build bitmask table;\n for (var i = 0; i < l; i++) {\n b[p.charAt(i)] = b[p.charAt(i)] | (1 << i);\n }\n\n for (var i = 0; i < alphabet.length; i++) {\n var padded = pad_num(l, b[alphabet[i]].toString(2));\n display_mask(alphabet[i], padded);\n }\n \n display_mask('*', pad_num(l, (0).toString(2)));\n\n display_text(text);\n display_pattern(p);\n \n tx_as_array = text.split(\"\");\n\n var haystack_pos = $(\"#the-haystack\").position();\n var d = 0;\n var matchMask = 1 << l-1;\n var text_index = 0;\n var pat_letter_index = -1;\n\n function read_next_char(d, matchMask, text_index) {\n var ch = tx_as_array.shift();\n\n $.when(do_shift(d), get_from_table(b, ch)).done(function(shifted, from_table) {\n var d2 = shifted & from_table;\n\n function display_shift_table() {\n var deferred = $.Deferred();\n var d2_padded = pad_num(l, d2.toString(2));\n var pattern_pos = d2_padded.indexOf(\"1\");\n \n if (pattern_pos > -1) {\n pat_letter_index = pat_letter_index + 1;\n }\n\n $(\"div#match-run pre\").html(\"\");\n $(\"div#match-run pre\").append('D: <span id=\"d_val\">' + pad_num(l, d.toString(2)) + '</span> <span id=\"shift_op\"><< 1 | 1</span>\\n');\n\n // first_step: << 1 | 1 animation\n $.when(first_step(l, shifted)).done(function () {\n $(\"div#match-run pre\").append('Reading: ');\n\n $.when(highlight_read_letter(text_index)).done(function (){\n $(\"div#match-run pre\").append('\"' + ch + '\"');\n\n $.when(highlight_bitmask_row(b, ch)).done(function () {\n $(\"div#match-run pre\").append(' <span id=\"pad_from_table\">' + pad_num(l, from_table.toString(2)) + \"</span>\\n\");\n $.when(highlight_pad_from_table()).done(function() {\n $(\"div#match-run pre\").append('D & \"' + ch + '\" mask <span id=\"match_result\">' + d2_padded + \"</span>\\n\");\n $.when(highlight_match_result(pattern_pos)).done(function () {\n var pattern_anim = $.Deferred();\n if (pattern_pos > -1) {\n // change pattern color to green when prefixes are matched\n highlight_pattern_letter(pattern_anim, pat_letter_index, 'green');\n } else {\n // restore all the letters;\n $.when(flash_colors(\"#pattern-letter-\" + (pat_letter_index + 1), 'red', '#ffffff', 500)).done(function () {\n pat_letter_index = -1;\n restore_pattern_letters(l, pattern_pos);\n move_pattern_letters(pattern_anim, tl, text_index);\n });\n }\n\n $.when(pattern_anim).done(function () {\n setTimeout(function(){\n deferred.resolve();\n }, 300);\n });\n });\n });\n });\n });\n });\n\n return deferred.promise();\n }\n\n $.when(display_shift_table()).done(function () {\n var matched = do_and(d2, matchMask);\n\n if (matched != 0) {\n $(\"div#match-run pre\").append(\"Match at: \" + (text_index - l + 1));\n } else if (eol(tl, text_index)) {\n $(\"div#match-run pre\").append(\"No Match\");\n } else {\n read_next_char(d2, matchMask, text_index+1);\n }\n \n enable_form();\n })\n });\n }\n\n read_next_char(d, matchMask, text_index);\n}", "function check_vertical(row, col, color) {\n let count = 1\n let temp = row\n while (row > 0) {\n let $down_cell = get_cell(--row, col)\n if ($down_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ down')\n }\n else {\n break\n }\n }\n row = temp\n while (row < that.row) {\n let $up_cell = get_cell(++row, col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ right')\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }", "function arrayMarkCount(iRows, iCols, iStartRow, iStartCol) {\n var i;\n var j;\n\n iMarkCount = 0;\n\n for (i = iStartRow; i < iStartRow + iRows; i++) {\n for (j = iStartCol; j < iStartCol + iCols; j++) {\n if (iMarkedCells[i % iMapRows][j % iMapCols] == 1) {\n iMarkCount++;\n } \n }\n } \n\n return iMarkCount;\n}", "function connectFour(board) {\n var emptyCounter=0;\n for (let i=0; i< board.length; i++){\n for (let j=0; j<board[i].length; j++){\n let currentColor=board[i][j];\n\n //now I want to check if any of the eight discs around me match mine.\n\n if (currentColor===\"-\"){\n emptyCounter++\n } else{\n let winnerCheck=[]\n if (j<=3){\n //horizontal check\n winnerCheck.push([board[i][j],board[i][j+1], board[i][j+2], board[i][j+3]])\n\n //upward diagonal check\n if (i>=3) {\n winnerCheck.push([board[i][j], board[i - 1][j + 1], board[i - 2][j + 2], board[i - 3][j + 3]])\n }\n\n // //downward diagonal check\n if (i<=2) {\n winnerCheck.push([board[i][j], board[i + 1][j + 1], board[i + 2][j + 2], board[i + 3][j + 3]])\n }\n }\n if (i<=2) {\n //vertical check\n winnerCheck.push([board[i][j], board[i+1][j], board[i+2][j], board[i+3][j]])\n }\n\n //will now loop through the four directional checks, and check to see if any contain four in a row.\n for (var k=0; k<winnerCheck.length; k++){\n var connectFourCount = winnerCheck[k].reduce(function(total,x){\n if (x===currentColor){\n return total+1\n }\n },0)\n if (connectFourCount===4){\n return currentColor\n }\n }\n }\n }\n }\n\n //if no four in a row are found, it will state if game is still in progress or if all slots are full.\n if (emptyCounter>0){\n return \"in progress\"\n } else{\n return \"draw\"\n }\n}", "function countTexts(frameY) {\r totalCAP++;\r panelCAP++;\r\r if(frameY < 3000) {\r topRowCAP++;\r }\r}", "function countLeft(x,y){\n\tfor(let i = x; i > 0; i--){\n\t\tif(boardArray[x + y * columns] == boardArray[(i - 1) + y * columns]){\n\t\t\twinConditionCount++;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n}", "calcNextState() {\n\t\tlet liveN = this.countNeighbours();\n\t\tif( (liveN == 2 && this.state) || liveN == 3 ) {\n\t\t\tthis.nextState = true;\n\t\t} else {\n\t\t\tthis.nextState = false;\n\t\t}\n\t}", "checkOpenNeighbors(grid, width, cellPos) {\n // we know there is at least one open cell next to the wall\n let numOpenCells = 0;\n\n // Check right\n if ((cellPos + 1) < grid.length && ((cellPos + 1) % width) > 0 &&\n grid[cellPos + 1] === OPENING_CHAR) {\n numOpenCells++;\n }\n // Check left\n if ((cellPos - 1) >= 0 && (cellPos % width) > 0 &&\n grid[cellPos - 1] === OPENING_CHAR) {\n numOpenCells++;\n }\n // Check above\n if ((cellPos - width) >= 0 && grid[cellPos - width] === OPENING_CHAR) {\n numOpenCells++;\n }\n // Check below\n if ((cellPos + width) < grid.length && grid[cellPos + width] === OPENING_CHAR) {\n numOpenCells++;\n }\n\n return numOpenCells;\n }", "getLiveNeighborCount(h, w) {\n const currentCells = this.cells[this.activeBuffer];\n let c = 0;\n\n if (currentCells[h - 1] && currentCells[h - 1][w - 1]) ++c;\n if (currentCells[h - 1] && currentCells[h - 1][w - 0]) ++c;\n if (currentCells[h - 1] && currentCells[h - 1][w + 1]) ++c;\n\n if (currentCells[h - 0] && currentCells[h + 0][w - 1]) ++c;\n if (currentCells[h - 0] && currentCells[h + 0][w + 1]) ++c;\n\n if (currentCells[h + 1] && currentCells[h + 1][w - 1]) ++c;\n if (currentCells[h + 1] && currentCells[h + 1][w - 0]) ++c;\n if (currentCells[h + 1] && currentCells[h + 1][w + 1]) ++c;\n\n return c;\n }", "function islandCounter(M){\n islands = 0\n if (M == null OR M.length == 0){\n return 0\n }\n row = M.length\n col = M[0].length\n\n for(i=0;i<row-1;i++){\n for(j=0;j<col-1;j++){\n if (M[i][j] == 1):\n markIsland(M, row, col, i, j)\n islands++\n }\n }\n return islands\n}", "function foundPatternCross(stateCount, moduleSize) {\r\n\t\t var maxVariance = moduleSize / 2;\r\n\t\t for (var i = 0; i < 3; i++) {\r\n\t\t if (Math.abs(moduleSize - stateCount[i]) >= maxVariance) {\r\n\t\t return false;\r\n\t\t }\r\n\t\t }\r\n\t\t return true;\r\n\t\t}", "function comparison(){\n\n var a1,a2,a3,a4,b1,b2,b3,b4,hint1,hint2,hint3,hint4;\n a1 = row[nbrOfRows].h1;\n a2 = row[nbrOfRows].h2;\n a3 = row[nbrOfRows].h3;\n a4 = row[nbrOfRows].h4;\n b1 = row[0].h1;\n b2 = row[0].h2;\n b3 = row[0].h3;\n b4 = row[0].h4;\n\n\n correctPosition=0; //Nbr of correct colors on correct position\n if (a1 == b1){correctPosition++;a1=1;b1=0;hint1=1}\n if (a2 == b2){correctPosition++;a2=1;b2=0;hint2=1}\n if (a3 == b3){correctPosition++;a3=1;b3=0;hint3=1}\n if (a4 == b4){correctPosition++;a4=1;b4=0;hint4=1}\n\n correctColour=0; //Nbr of correct colors on wrong position\n if (a1 == b2){correctColour++;a1=1;b2=0}\n if (a1 == b3){correctColour++;a1=1;b3=0}\n if (a1 == b4){correctColour++;a1=1;b4=0}\n\n if (a2 == b1){correctColour++;a2=1;b1=0}\n if (a2 == b3){correctColour++;a2=1;b3=0}\n if (a2 == b4){correctColour++;a2=1;b4=0}\n\n if (a3 == b1){correctColour++;a3=1;b1=0}\n if (a3 == b2){correctColour++;a3=1;b2=0}\n if (a3 == b4){correctColour++;a3=1;b4=0}\n\n if (a4 == b1){correctColour++;a4=1;b1=0}\n if (a4 == b2){correctColour++;a4=1;b2=0}\n if (a4 == b3){correctColour++;a4=1;b3=0}\n\n //Draw the hints on the side of the board\n var p = 9*box+4.8;\n for (i=0;i<4;i++){\n if (i<correctPosition){\n ctx.drawImage(red,p,selectedHole.y+8,box/2.5,box/2.5)}\n else if (i<correctPosition+correctColour){ctx.drawImage(white,p,selectedHole.y+8,box/2.5,box/2.5)}\n else {ctx.drawImage(empty,p,selectedHole.y+8,box/2.5,box/2.5)}\n p += 16.8;\n }\n \n if (correctPosition == 4){ // If colors correspond than we display the \"victory\" box\n document.getElementById(\"victoryMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n }\n else if (nbrOfRows == 11) { //If the colors are wrong and the it's the 11th row we display the \"defeat\" box\n document.getElementById(\"defeatMenu\").style.visibility=\"visible\";\n ctx.drawImage(row[0].h1,box*3,box*23,box,box);\n ctx.drawImage(row[0].h2,box*5,box*23,box,box);\n ctx.drawImage(row[0].h3,box*7,box*23,box,box);\n ctx.drawImage(row[0].h4,box*9,box*23,box,box);\n selectedHole.y = undefined; selectedHole.x = undefined;\n\n }\n\n document.getElementById(\"pts\").innerHTML=(-nbrOfRows+12)\n}", "function checkWin(x, y) {\n\tvar count = [1,1,1,1]; //4 possible directions\n function countNeighbors(x, y, color, visited, direction) {\n\n visited.push([x, y]); //add coordinate to visited array\n\n //for each neighbour\n for (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n\t\t\t\tif(j==0 && i==0) continue; //ignore if is itself\n\t\t\t\tif (y+j > 5 || x+i > 6 || y+j < 0 || x+i < 0) continue; //ignore if not valid coordinate\n\t\t\t\tif (isVisited(x+i, y+j, visited)) continue; //ignore if already visited\n\t\t\t\tif (grid[x+i][y+j] !== color) continue; //ignore if wrong color or null\n\t\t\n\t\t\t\tif(Math.abs(j) == Math.abs(i)) { //if x and y offsets are equal to eachother, it is diagonal\n\t\t\t\t\tif(i*j > 0) d=0; //if their product is positive it is down-right\n\t\t\t\t\tif(i*j < 0) d=1; //if their product is negative is is up-right\n\t\t\t\t}\n\t\t\t\telse if(i != 0) d=2; //if x offset exists but y doesn't, it is horizontal\n\t\t\t\telse if(j != 0) d=3; //if y offset exists but x doesn't, it is vertical\n\t\t\t\t//if chip is in the correct direction, or if there is no direction yet\n\t\t\t\tif(direction==d || direction<0) { \n\t\t\t\t\tcount[d]++; //increase count for that direction\n\t\t\t\t\tcountNeighbors(x+i, y+j, color, visited, d); //find neighbours in that direction\n\t\t\t\t}\n }\n }\n }\n countNeighbors(x, y, grid[x][y], [], -1);\n\treturn count.some(e => e>=4); //if any of the directions have 4, return true\n}", "checkWin() {\r\n for (let i = 0; i <= 2; i++) {\r\n //accross\r\n if (this.state[0+i*3] === this.state[1+i*3] && this.state[1+i*3] === this.state[2+i*3] && \r\n this.state[0+i*3] !== 0) return {spaces:[0+i*3,1+i*3,2+i*3], win: true}; \r\n //down\r\n if (this.state[0+i] === this.state[3+i] && this.state[3+i] === this.state[6+i] && \r\n this.state[0+i] !== 0) return {spaces:[0+i,3+i,6+i], win: true};\r\n }\r\n //diagonal\r\n if (this.state[0] === this.state[4] && this.state[4] === this.state[8] && \r\n this.state[0] !== 0) return {spaces:[0,4,8], win: true};\r\n if (this.state[2] === this.state[4] && this.state[4] === this.state[6] && \r\n this.state[2] !== 0) return {spaces:[2,4,6], win: true};\r\n //No winner, return boolean\r\n return {win: false};\r\n }", "search(x, y, color, dx, dy, count, board = this.map) {\n if (x < 0 || x > 6 || y < 0 || y > 5) return count;\n if (color !== board[y][x]) return count;\n\n return this.search(x + dx, y + dy, color, dx, dy, count + 1, board);\n }", "step() {\n const backBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n const cB = this.buffer[this.currentBufferIndex]; // currentBuffer\n const bB = this.buffer[backBufferIndex]; // backBuffer\n const w = this.width, h = this.height;\n\n const countNeighbors = (x, y) => {\n let c = 0; // counter\n if (x > 0 && cB[y][x - 1]) c++;\n if (x < w - 1 && cB[y][x + 1]) c++;\n if (y > 0 && cB[y - 1][x]) c++;\n if (y < h - 1 && cB[y + 1][x]) c++;\n if (x > 0 && y < h - 1 && cB[y + 1][x - 1]) c++;\n if (y > 0 && x < w - 1 && cB[y - 1][x + 1]) c++;\n if (x > 0 && y > 0 && cB[y - 1][x - 1]) c++;\n if (x < w - 1 && y < h - 1 && cB[y + 1][x + 1]) c++;\n return c;\n }\n\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const counter = countNeighbors(x, y);\n const cell = cB[y][x];\n if (cell && counter === 2) bB[y][x] = 1;\n else if (cell && counter === 3) bB[y][x] = 1;\n else if (!cell && counter === 3) bB[y][x] = 1;\n else bB[y][x] = 0;\n }\n }\n\n this.currentBufferIndex = backBufferIndex;\n }", "_getCellState(x,y){\n if(x>=0 && y>=0 && x<this.state.currentData.length && y<this.state.currentData.length){\n return (this.refs[x+':'+y].state.state===true)?1:0;\n }else{\n return 0;\n }\n }", "runQbusProcessingConditional() {\n const cnt = [-1, -1, -1, -1, -1];\n const numrows = this.qbusswitches.condition.length;\n\n for (let r=0;r<numrows;r++) {\n const row = this.qbusswitches.condition[r];\n if (row.Counter !== \"\") {\n let result = true;\n const cPnt = row.Counter-1;\n const Qswitch = this.readBusSwitches(row.Qswitches);\n // Match switches to bit pattern\n for (let s=0;s<5;s++) {\n if (Qswitch[s] >= 0 && Qswitch[s] !== parseInt(this.Qbits[s], 10)) result = false;\n }\n // Check for NOT switch\n if (row.Negate) result = !result;\n\n // AND each row to get final result\n if (cnt[cPnt] === -1) {\n cnt[cPnt] = result;\n } else if (!result) {\n cnt[cPnt] = false;\n }\n }\n }\n\n // Negate the whole column, this allows A OR B by doing NOT(NOT A AND NOT B)\n for (let c=0;c<5;c++) {\n if (this.qbusswitches.condNegateAll && cnt[c] !== -1) cnt[c] = !cnt[c];\n }\n\n return cnt;\n }", "step() {\n /* If you put logic from CCA here it works as should */\n\n /* In the Game of Life, these rules examine each cell of the grid. \n For each cell, it counts that cell's eight neighbors\n (up, down, left, right, and diagonals), and then act on that result.\n\n If the cell is alive and has 2 or 3 neighbors, then it remains alive. Else it dies.\n If the cell is dead and has exactly 3 neighbors, then it comes to life. Else if remains dead. */\n\n let currentBuffer = this.cells[this.currentBufferIndex];\n let backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n \n // see if we have a neighbor that can infect this cell and change its color\n function checkNeighbors(w, h) {\n let neighbors = 0;\n\n // Check West\n if (w) {\n if (currentBuffer[h][w - 1]) {\n neighbors++;\n }\n }\n // Check NW\n if (h && w) {\n if (currentBuffer[h - 1][w - 1])\n neighbors++;\n }\n // Check North\n if (h) {\n if (currentBuffer[h - 1][w]) {\n neighbors++;\n }\n }\n // Check NE\n if ((w < this.width - 1) && h) {\n if (currentBuffer[h - 1][w + 1]) {\n neighbors++;\n }\n }\n // Check East\n if (w < this.width - 1) {\n if (currentBuffer[h][w + 1]) {\n neighbors++;\n }\n }\n // Check SE\n if ((h < this.height - 1) && (w < this.width - 1)) {\n if (currentBuffer[h + 1][w + 1]) {\n neighbors++;\n }\n }\n // Check South\n if (h < this.height - 1) {\n if (currentBuffer[h + 1][w]) {\n neighbors++;\n }\n }\n // Check SW\n if ((h < this.height - 1) && w) {\n if (currentBuffer[h + 1][w - 1]) {\n neighbors++;\n }\n }\n\n return neighbors;\n } // end: checkNeightbors()\n\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n let neighborCount = checkNeighbors.call(this, w, h);\n\n // is current cell alive?\n if (currentBuffer[h][w]) {\n if (neighborCount === 2 || neighborCount === 3) {\n backBuffer[h][w] = currentBuffer[h][w]; // cell stay alives\n }\n else { // else it dies\n backBuffer[h][w] = (currentBuffer[h][w] + 1) % MODULO;\n }\n }\n else { // current cell is dead\n if (neighborCount === 3) {\n backBuffer[h][w] = (currentBuffer[h][w] + 1) % MODULO; // bring cell to life\n }\n else { // else cell remains dead\n backBuffer[h][w] = currentBuffer[h][w];\n }\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function updateCount( x, y, regions, last_regions) {\n var occupied = []; \n if (typeof last_regions == 'undefined') last_regions = []; // Added this because we have arbitrary track ids, making it hard to guarantee a value here\n for (var r in regions) {\n // If already in the region, expand the boundaries\n var adj_lr = [0,0]; \n var adj_ul = [0,0]; \n var A = 0.12; // A 12% proportional \"expansion\" of the border to trigger leaving\n if (useRegionStickiness && last_regions.indexOf(r) > -1) { \n adj_lr[0] = A*regions[r].height;\n adj_lr[1] = A*regions[r].width;\n adj_ul[0] = -1*A*regions[r].height;\n adj_ul[1] = -1*A*regions[r].width;\n } \n \n // Now, use the adjusted region boundaries in the test\n //\n if (y >= regions[r].ul[0]+adj_ul[0] && y <= regions[r].lr[0]+adj_lr[0] && // These checks are for a graphics coordinate\n x >= regions[r].ul[1]+adj_ul[1] && x <= regions[r].lr[1]+adj_lr[1] ) { // system with (0,0) in the top left\n regions[r].count += 1; \n occupied.push(r); \n }\n } \n return occupied; \n}", "defineStates() {\n // Maximum stack calls\n let maxStackCalls = 400;\n\n // Acquisition lambdas\n let queue = i => {\n return this.text.charAt(i);\n };\n let store = c => {\n this.buffer += c;\n };\n let flush = t => {\n if (this.buffer.length > 0) {\n // Special treatment for id tokens that contain only numbers\n let numberToken = t == Token.ID && !isNaN(this.buffer);\n this.list.push(\n new Token(numberToken ? Token.NUMBER : t, this.buffer, line)\n );\n }\n this.buffer = \"\";\n };\n\n // Line number updater\n let line = 0;\n let newline = i => {\n line++;\n };\n\n // State definitions\n let state = {\n // Transference function\n transference: (i, phase) => {\n if (i < this.text.length) {\n // Prevent stack overflow\n if (i % maxStackCalls == 0 && phase != true) {\n this.index = i;\n return;\n }\n\n // Transfer to the identifier state\n state.identifier(i);\n } else {\n flush(Token.ID);\n this.index = i;\n return;\n }\n },\n\n // For IDs\n identifier: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case '\"':\n case \"'\":\n flush(Token.ID);\n state.string(i + 1, c);\n return;\n case \"\\\\\":\n flush(Token.ID);\n state.extension(i);\n return;\n case \" \":\n case \";\":\n flush(Token.ID);\n state.delimiter(i);\n return;\n case \"#\":\n flush(Token.ID);\n state.comment(i + 1);\n return;\n case \"(\":\n case \")\":\n flush(Token.ID);\n state.parenthesis(i, c);\n return;\n default:\n store(c);\n state.transference(i + 1);\n }\n },\n\n // For strings\n string: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case phase:\n flush(Token.STRING);\n state.transference(i + 1, c);\n return;\n case \"\\\\\":\n state.extension(i + 1);\n return;\n default:\n store(c);\n state.string(i + 1, phase);\n }\n },\n\n // For escape characters\n extension: (i, phase) => {\n let c = queue(i);\n\n store(\"\\\\\" + c);\n state.transference(i + 1);\n },\n\n // For comments\n comment: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case \";\":\n newline();\n flush(Token.COMMENT);\n state.transference(i + 1);\n return;\n default:\n store(c);\n state.comment(i + 1);\n }\n },\n\n // For parenthesis\n parenthesis: (i, phase) => {\n let c = queue(i);\n\n store(c);\n if (phase == \"(\") flush(Token.OPEN);\n else if (phase == \")\") flush(Token.CLOSE);\n state.transference(i + 1);\n },\n\n // For whitespaces and linefeeds\n delimiter: (i, phase) => {\n let c = queue(i);\n\n switch (c) {\n case \";\":\n newline();\n case \" \":\n store(c);\n state.delimiter(i + 1);\n return;\n default:\n flush(Token.SPACE);\n state.transference(i);\n }\n }\n };\n this.state = state;\n }", "step() {\n // !!!! IMPLEMENT ME !!!!\n const currentCells = this.cells[this.activeBuffer];\n const nextCells = this.cells[this.activeBuffer === 1 ? 0 : 1];\n\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n const count = this.getLiveNeighborCount.call(this, h, w);\n\n if (currentCells[h][w]) {\n if (count < 2 || count > 3) {\n nextCells[h][w] = false;\n } else {\n nextCells[h][w] = true;\n }\n } else {\n if (count === 3) {\n nextCells[h][w] = true;\n } else {\n nextCells[h][w] = false;\n }\n }\n }\n }\n this.activeBuffer = this.activeBuffer === 1 ? 0 : 1;\n }", "function countUpLeft(x,y){\n\tfor(let i = y; i > 0; i--){\n\t\tfor(let j = x; j > 0; j--){\n\t\t\tif(boardArray[x + y * columns] == boardArray[(j - 1) + (i - 1) * columns]){\n\t\t\t\twinConditionCount++;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(i - 1 > 0){\n\t\t\t\ti--;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}", "function nextState(r, c) {\n // number of on neightbors to the given call\n var onNeighbors = 0;\n // if given is alive itself count it\n if (field[r][c]) {\n onNeighbors -= 1;\n }\n // count alive neightbors\n for (var row = -1 ; row <= 1; row += 1) {\n for (var col = -1; col <= 1; col += 1) {\n if(field[r + row]) {\n }\n if(field[r + row] && field[r + row][c + col]) {\n onNeighbors += 1;\n }\n }\n }\n // return based on rules\n return (onNeighbors === 3) || ((onNeighbors === 2) && field[r][c]);\n }", "countLiveNeighbors(x, y, grid) {\n const height = grid.length;\n const width = grid[0].length;\n const size = { width, height };\n let count = 0;\n let row;\n \n let prevY = y - 1;\n let nextY = y + 1;\n let prevX = x - 1;\n let nextX = x + 1;\n \n if (prevY < 0) {\n prevY = size.height -1;\n }\n if (nextY >= size.height) {\n nextY = 0; \n } \n if (prevX < 0) {\n prevX = size.width - 1;\n }\n if (nextX >= size.width) {\n nextX = 0;\n }\n\n // count cells in previous row\n row = grid[prevY];\n if (row) {\n if (row[prevX] && row[prevX] === \"live\") {\n count++;\n }\n if (row[x] && row[x] === \"live\") {\n count++;\n }\n if (row[nextX] && row[nextX] === \"live\") {\n count++;\n }\n }\n // count cells in current row\n row = grid[y];\n if (row[prevX] && row[prevX] === \"live\") {\n count++;\n }\n if (row[nextX] && row[nextX] === \"live\") {\n count++;\n }\n // count cells in next row\n row = grid[nextY];\n if (row) {\n if (row[prevX] && row[prevX] === \"live\") {\n count++;\n }\n if (row[x] && row[x] === \"live\") {\n count++;\n }\n if (row[nextX] && row[nextX] === \"live\") {\n count++;\n }\n }\n return count;\n }" ]
[ "0.5969984", "0.5400206", "0.53992504", "0.52994275", "0.52473944", "0.51983064", "0.5144702", "0.50957656", "0.5084866", "0.49859744", "0.49690977", "0.49683338", "0.49647772", "0.49170303", "0.49112752", "0.49109912", "0.48912933", "0.4882949", "0.48457623", "0.48057747", "0.47958195", "0.47929084", "0.4790392", "0.47896555", "0.47430366", "0.47345334", "0.47339386", "0.47301838", "0.47208932", "0.47195673", "0.4719561", "0.47130474", "0.47043794", "0.4696275", "0.468874", "0.46714982", "0.4669726", "0.4666194", "0.46634883", "0.4663471", "0.4656054", "0.46552128", "0.46450177", "0.4643916", "0.46400893", "0.46281135", "0.46268323", "0.46094218", "0.46014383", "0.4598292", "0.45967552", "0.45930696", "0.45790714", "0.4578122", "0.456688", "0.45481133", "0.45466504", "0.45423812", "0.45323068", "0.45295915", "0.452545", "0.44866046", "0.44857803", "0.4479348", "0.4479188", "0.44769537", "0.44756314", "0.44657695", "0.44550267", "0.44475666", "0.44374275", "0.44339007", "0.44327608", "0.44321385", "0.44262853", "0.44227716", "0.44193894", "0.4416535", "0.44096798", "0.44088832", "0.4403573", "0.43988955", "0.4394963", "0.43863028", "0.4381686", "0.43806866", "0.4380275", "0.43779328", "0.43769795", "0.43683612", "0.43672422", "0.43590152", "0.4354501", "0.43486375", "0.43451956", "0.43441647", "0.43412277", "0.43409467", "0.4338518", "0.43337762" ]
0.4417581
77
Taken from underscore JS
function isNaN(obj) { return Object.prototype.toString.call(obj) === '[object Number]' && obj !== +obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash(){}", "function baseLodash() {// No operation performed.\n}", "function baseLodash() {// No operation performed.\n}", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function _() { }", "function _() { }", "function _() { }", "function _() { }", "function _() { }", "function baseLodash() {\n }", "function baseLodash() {// No operation performed.\n }", "function _() { undefined; }", "function u(e){if(e)return _(e)}", "function baseLodash() {// No operation performed.\n }", "function baseLodash(){\n// No operation performed.\n}", "function baseLodash(){\n// No operation performed.\n}", "function baseLodash(){// No operation performed.\n}", "function baseLodash(){// No operation performed.\n}", "function et(t,e){return new _(t,e)}", "function __it() {}", "function replace_with_underscore(l) {\n var r = l.replace(/[^a-z0-9\\s]/gi, '_').replace(/ /g,'_');\n return r;\n}", "function baseLodash(){} // No operation performed.", "function baseLodash(){} // No operation performed.", "function baseLodash() {\n // No operation performed.\n}", "function $t(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "function underscore(content) {\n return `__${content}__`;\n}", "function underscore (strings, ...values) {\n return strings[0].replace(/\\s/g, '_');\n}", "function underscore (strings, ...values) {\n return strings[0].replace(/\\s/g, '_');\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}", "function baseLodash() {\n // No operation performed.\n}" ]
[ "0.6445014", "0.6445014", "0.6445014", "0.6445014", "0.6445014", "0.62266994", "0.61520755", "0.61520755", "0.60981864", "0.60981864", "0.60981864", "0.60981864", "0.60981864", "0.60981864", "0.60981864", "0.60981864", "0.60676235", "0.60676235", "0.60676235", "0.60676235", "0.60676235", "0.6034641", "0.6005005", "0.58636254", "0.586004", "0.58553535", "0.57733244", "0.57733244", "0.5747148", "0.5747148", "0.55556893", "0.552579", "0.55119705", "0.54911137", "0.54911137", "0.54828936", "0.54482645", "0.54132265", "0.541048", "0.5374695", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662", "0.535662" ]
0.0
-1
Takes in a byte array, a qr version number and an error correction level. Returns decoded data.
function decodeQRdata(data, version, ecl) { var symbolSequence = -1; var parityData = -1; var bits = new bitstream_1.BitStream(data); var result = { val: [] }; // Have to pass this around so functions can share a reference to a number[] var fc1InEffect = false; var mode; while (mode != TERMINATOR_MODE) { // While still another segment to read... if (bits.available() < 4) { // OK, assume we're done. Really, a TERMINATOR mode should have been recorded here mode = TERMINATOR_MODE; } else { mode = modeForBits(bits.readBits(4)); // mode is encoded by 4 bits } if (mode != TERMINATOR_MODE) { if (mode == FNC1_FIRST_POSITION_MODE || mode == FNC1_SECOND_POSITION_MODE) { // We do little with FNC1 except alter the parsed result a bit according to the spec fc1InEffect = true; } else if (mode == STRUCTURED_APPEND_MODE) { if (bits.available() < 16) { return null; } // not really supported; but sequence number and parity is added later to the result metadata // Read next 8 bits (symbol sequence #) and 8 bits (parity data), then continue symbolSequence = bits.readBits(8); parityData = bits.readBits(8); } else if (mode == ECI_MODE) { // Ignore since we don't do character encoding in JS var value = parseECIValue(bits); if (value < 0 || value > 30) { return null; } } else { // First handle Hanzi mode which does not start with character count if (mode == HANZI_MODE) { //chinese mode contains a sub set indicator right after mode indicator var subset = bits.readBits(4); var countHanzi = bits.readBits(mode.getCharacterCountBits(version)); if (subset == GB2312_SUBSET) { if (!decodeHanziSegment(bits, result, countHanzi)) { return null; } } } else { // "Normal" QR code modes: // How many characters will follow, encoded in this mode? var count = bits.readBits(mode.getCharacterCountBits(version)); if (mode == NUMERIC_MODE) { if (!decodeNumericSegment(bits, result, count)) { return null; } } else if (mode == ALPHANUMERIC_MODE) { if (!decodeAlphanumericSegment(bits, result, count, fc1InEffect)) { return null; } } else if (mode == BYTE_MODE) { if (!decodeByteSegment(bits, result, count)) { return null; } } else if (mode == KANJI_MODE) { } else { return null; } } } } } return result.val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function QR8bitByte(data) {\n this.mode = QRMode.MODE_8BIT_BYTE;\n this.data = data;\n this.parsedData = [];\n\n // Added to support UTF-8 Characters\n for (var i = 0, l = this.data.length; i < l; i++) {\n var byteArray = [];\n var code = this.data.charCodeAt(i);\n\n if (code > 0x10000) {\n byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n byteArray[3] = 0x80 | (code & 0x3F);\n } else if (code > 0x800) {\n byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n byteArray[2] = 0x80 | (code & 0x3F);\n } else if (code > 0x80) {\n byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n byteArray[1] = 0x80 | (code & 0x3F);\n } else {\n byteArray[0] = code;\n }\n\n this.parsedData.push(byteArray);\n }\n\n this.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n if (this.parsedData.length != this.data.length) {\n this.parsedData.unshift(191);\n this.parsedData.unshift(187);\n this.parsedData.unshift(239);\n }\n }", "function QR8bitByte(data) {\n\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\t\tthis.data = data;\n\t\tthis.parsedData = [];\n\n\t\t// Added to support UTF-8 Characters\n\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\n\t\t\tvar byteArray = [];\n\t\t\tvar code = this.data.charCodeAt(i);\n\n\t\t\tif (code > 0x10000) {\n\t\t\t\tbyteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n\t\t\t\tbyteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[3] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x800) {\n\t\t\t\tbyteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[2] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x80) {\n\t\t\t\tbyteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F);\n\t\t\t} else {\n\t\t\t\tbyteArray[0] = code;\n\t\t\t}\n\n\t\t\tthis.parsedData.push(byteArray);\n\t\t}\n\n\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n\t\tif (this.parsedData.length != this.data.length) {\n\t\t\tthis.parsedData.unshift(191);\n\t\t\tthis.parsedData.unshift(187);\n\t\t\tthis.parsedData.unshift(239);\n\t\t}\n\t}", "function QR8bitByte(data) {\n\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\t\tthis.data = data;\n\t\tthis.parsedData = [];\n\n\t\t// Added to support UTF-8 Characters\n\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\n\t\t\tvar byteArray = [];\n\t\t\tvar code = this.data.charCodeAt(i);\n\n\t\t\tif (code > 0x10000) {\n\t\t\t\tbyteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n\t\t\t\tbyteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[3] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x800) {\n\t\t\t\tbyteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[2] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x80) {\n\t\t\t\tbyteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F);\n\t\t\t} else {\n\t\t\t\tbyteArray[0] = code;\n\t\t\t}\n\n\t\t\tthis.parsedData.push(byteArray);\n\t\t}\n\n\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n\t\tif (this.parsedData.length != this.data.length) {\n\t\t\tthis.parsedData.unshift(191);\n\t\t\tthis.parsedData.unshift(187);\n\t\t\tthis.parsedData.unshift(239);\n\t\t}\n\t}", "function QR8bitByte(data) {\n\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\t\tthis.data = data;\n\t\tthis.parsedData = [];\n\n\t\t// Added to support UTF-8 Characters\n\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\n\t\t\tvar byteArray = [];\n\t\t\tvar code = this.data.charCodeAt(i);\n\n\t\t\tif (code > 0x10000) {\n\t\t\t\tbyteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n\t\t\t\tbyteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[3] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x800) {\n\t\t\t\tbyteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\tbyteArray[2] = 0x80 | (code & 0x3F);\n\t\t\t} else if (code > 0x80) {\n\t\t\t\tbyteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F);\n\t\t\t} else {\n\t\t\t\tbyteArray[0] = code;\n\t\t\t}\n\n\t\t\tthis.parsedData.push(byteArray);\n\t\t}\n\n\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n\t\tif (this.parsedData.length != this.data.length) {\n\t\t\tthis.parsedData.unshift(191);\n\t\t\tthis.parsedData.unshift(187);\n\t\t\tthis.parsedData.unshift(239);\n\t\t}\n\t}", "_parseQRCodeData(encodedString) {\n try {\n const compressedBytes = base32.decode.asBytes(encodedString);\n return this._decompressAndParseJSON(compressedBytes);\n } catch(base32DecodingError) {\n throw new Error(\"Unable to parse QR code (Base32 decode error).\");\n }\n }", "function QR8bitByte(data) {\n\t\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\t\t\tthis.data = data;\n\t\t\tthis.parsedData = [];\n\n\t\t\t// Added to support UTF-8 Characters\n\t\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\n\t\t\t\tvar byteArray = [];\n\t\t\t\tvar code = this.data.charCodeAt(i);\n\n\t\t\t\tif (code > 0x10000) {\n\t\t\t\t\tbyteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;\n\t\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F000) >>> 12;\n\t\t\t\t\tbyteArray[2] = 0x80 | (code & 0xFC0) >>> 6;\n\t\t\t\t\tbyteArray[3] = 0x80 | code & 0x3F;\n\t\t\t\t} else if (code > 0x800) {\n\t\t\t\t\tbyteArray[0] = 0xE0 | (code & 0xF000) >>> 12;\n\t\t\t\t\tbyteArray[1] = 0x80 | (code & 0xFC0) >>> 6;\n\t\t\t\t\tbyteArray[2] = 0x80 | code & 0x3F;\n\t\t\t\t} else if (code > 0x80) {\n\t\t\t\t\tbyteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;\n\t\t\t\t\tbyteArray[1] = 0x80 | code & 0x3F;\n\t\t\t\t} else {\n\t\t\t\t\tbyteArray[0] = code;\n\t\t\t\t}\n\n\t\t\t\tthis.parsedData.push(byteArray);\n\t\t\t}\n\n\t\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n\t\t\tif (this.parsedData.length != this.data.length) {\n\t\t\t\tthis.parsedData.unshift(191);\n\t\t\t\tthis.parsedData.unshift(187);\n\t\t\t\tthis.parsedData.unshift(239);\n\t\t\t}\n\t\t}", "function QR8bitByte(data) {\n\t\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\t\t\tthis.data = data;\n\t\t\tthis.parsedData = [];\n\n\t\t\t// Added to support UTF-8 Characters\n\t\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\n\t\t\t\tvar byteArray = [];\n\t\t\t\tvar code = this.data.charCodeAt(i);\n\n\t\t\t\tif (code > 0x10000) {\n\t\t\t\t\tbyteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n\t\t\t\t\tbyteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n\t\t\t\t\tbyteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\t\tbyteArray[3] = 0x80 | (code & 0x3F);\n\t\t\t\t} else if (code > 0x800) {\n\t\t\t\t\tbyteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n\t\t\t\t\tbyteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n\t\t\t\t\tbyteArray[2] = 0x80 | (code & 0x3F);\n\t\t\t\t} else if (code > 0x80) {\n\t\t\t\t\tbyteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n\t\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F);\n\t\t\t\t} else {\n\t\t\t\t\tbyteArray[0] = code;\n\t\t\t\t}\n\n\t\t\t\tthis.parsedData.push(byteArray);\n\t\t\t}\n\n\t\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n\t\t\tif (this.parsedData.length != this.data.length) {\n\t\t\t\tthis.parsedData.unshift(191);\n\t\t\t\tthis.parsedData.unshift(187);\n\t\t\t\tthis.parsedData.unshift(239);\n\t\t\t}\n\t\t}", "function parseQr (qrText) {\n // TODO: Could use base43 instead of hex for efficiency\n // Could use protocol buffers instead of JSON for even more efficiency\n var buf = new Buffer(qrText, 'hex')\n var rec = JSON.parse(buf)\n rec.tx = parseTx(rec.tx)\n}", "function QRCode() {\n\n var undefined$1;\n /** Node.js global 检测. */\n\n var freeGlobal = (typeof global === \"undefined\" ? \"undefined\" : _typeof(global)) == 'object' && global && global.Object === Object && global;\n /** `self` 变量检测. */\n\n var freeSelf = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) == 'object' && self && self.Object === Object && self;\n /** 全局对象检测. */\n\n var root = freeGlobal || freeSelf || Function('return this')();\n /** `exports` 变量检测. */\n\n var freeExports = (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;\n /** `module` 变量检测. */\n\n var freeModule = freeExports && (typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) == 'object' && module && !module.nodeType && module;\n var _QRCode = root.QRCode;\n var QRCode;\n\n function QR8bitByte(data, binary, utf8WithoutBOM) {\n this.mode = QRMode.MODE_8BIT_BYTE;\n this.data = data;\n this.parsedData = []; // Added to support UTF-8 Characters\n\n for (var i = 0, l = this.data.length; i < l; i++) {\n var byteArray = [];\n var code = this.data.charCodeAt(i);\n\n if (binary) {\n byteArray[0] = code;\n } else {\n if (code > 0x10000) {\n byteArray[0] = 0xf0 | (code & 0x1c0000) >>> 18;\n byteArray[1] = 0x80 | (code & 0x3f000) >>> 12;\n byteArray[2] = 0x80 | (code & 0xfc0) >>> 6;\n byteArray[3] = 0x80 | code & 0x3f;\n } else if (code > 0x800) {\n byteArray[0] = 0xe0 | (code & 0xf000) >>> 12;\n byteArray[1] = 0x80 | (code & 0xfc0) >>> 6;\n byteArray[2] = 0x80 | code & 0x3f;\n } else if (code > 0x80) {\n byteArray[0] = 0xc0 | (code & 0x7c0) >>> 6;\n byteArray[1] = 0x80 | code & 0x3f;\n } else {\n byteArray[0] = code;\n }\n }\n\n this.parsedData.push(byteArray);\n }\n\n this.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n if (!utf8WithoutBOM && this.parsedData.length != this.data.length) {\n this.parsedData.unshift(191);\n this.parsedData.unshift(187);\n this.parsedData.unshift(239);\n }\n }\n\n QR8bitByte.prototype = {\n getLength: function getLength(buffer) {\n return this.parsedData.length;\n },\n write: function write(buffer) {\n for (var i = 0, l = this.parsedData.length; i < l; i++) {\n buffer.put(this.parsedData[i], 8);\n }\n }\n };\n\n function QRCodeModel(typeNumber, errorCorrectLevel) {\n this.typeNumber = typeNumber;\n this.errorCorrectLevel = errorCorrectLevel;\n this.modules = null;\n this.moduleCount = 0;\n this.dataCache = null;\n this.dataList = [];\n }\n\n QRCodeModel.prototype = {\n addData: function addData(data, binary, utf8WithoutBOM) {\n var newData = new QR8bitByte(data, binary, utf8WithoutBOM);\n this.dataList.push(newData);\n this.dataCache = null;\n },\n isDark: function isDark(row, col) {\n if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {\n throw new Error(row + ',' + col);\n }\n\n return this.modules[row][col][0];\n },\n getEye: function getEye(row, col) {\n if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {\n throw new Error(row + ',' + col);\n }\n\n var block = this.modules[row][col]; // [isDark(ture/false), EyeOuterOrInner(O/I), Position(TL/TR/BL/A) ]\n\n if (block[1]) {\n var type = 'P' + block[1] + '_' + block[2]; //PO_TL, PI_TL, PO_TR, PI_TR, PO_BL, PI_BL\n\n if (block[2] == 'A') {\n type = 'A' + block[1]; // AI, AO\n }\n\n return {\n isDark: block[0],\n type: type\n };\n } else {\n return null;\n }\n },\n getModuleCount: function getModuleCount() {\n return this.moduleCount;\n },\n make: function make() {\n this.makeImpl(false, this.getBestMaskPattern());\n },\n makeImpl: function makeImpl(test, maskPattern) {\n this.moduleCount = this.typeNumber * 4 + 17;\n this.modules = new Array(this.moduleCount);\n\n for (var row = 0; row < this.moduleCount; row++) {\n this.modules[row] = new Array(this.moduleCount);\n\n for (var col = 0; col < this.moduleCount; col++) {\n this.modules[row][col] = []; // [isDark(ture/false), EyeOuterOrInner(O/I), Position(TL/TR/BL) ]\n }\n }\n\n this.setupPositionProbePattern(0, 0, 'TL'); // TopLeft, TL\n\n this.setupPositionProbePattern(this.moduleCount - 7, 0, 'BL'); // BotoomLeft, BL\n\n this.setupPositionProbePattern(0, this.moduleCount - 7, 'TR'); // TopRight, TR\n\n this.setupPositionAdjustPattern('A'); // Alignment, A\n\n this.setupTimingPattern();\n this.setupTypeInfo(test, maskPattern);\n\n if (this.typeNumber >= 7) {\n this.setupTypeNumber(test);\n }\n\n if (this.dataCache == null) {\n this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);\n }\n\n this.mapData(this.dataCache, maskPattern);\n },\n setupPositionProbePattern: function setupPositionProbePattern(row, col, posName) {\n for (var r = -1; r <= 7; r++) {\n if (row + r <= -1 || this.moduleCount <= row + r) continue;\n\n for (var c = -1; c <= 7; c++) {\n if (col + c <= -1 || this.moduleCount <= col + c) continue;\n\n if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {\n this.modules[row + r][col + c][0] = true;\n this.modules[row + r][col + c][2] = posName; // Position\n\n if (r == -0 || c == -0 || r == 6 || c == 6) {\n this.modules[row + r][col + c][1] = 'O'; // Position Outer\n } else {\n this.modules[row + r][col + c][1] = 'I'; // Position Inner\n }\n } else {\n this.modules[row + r][col + c][0] = false;\n }\n }\n }\n },\n getBestMaskPattern: function getBestMaskPattern() {\n var minLostPoint = 0;\n var pattern = 0;\n\n for (var i = 0; i < 8; i++) {\n this.makeImpl(true, i);\n var lostPoint = QRUtil.getLostPoint(this);\n\n if (i == 0 || minLostPoint > lostPoint) {\n minLostPoint = lostPoint;\n pattern = i;\n }\n }\n\n return pattern;\n },\n createMovieClip: function createMovieClip(target_mc, instance_name, depth) {\n var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);\n var cs = 1;\n this.make();\n\n for (var row = 0; row < this.modules.length; row++) {\n var y = row * cs;\n\n for (var col = 0; col < this.modules[row].length; col++) {\n var x = col * cs;\n var dark = this.modules[row][col][0];\n\n if (dark) {\n qr_mc.beginFill(0, 100);\n qr_mc.moveTo(x, y);\n qr_mc.lineTo(x + cs, y);\n qr_mc.lineTo(x + cs, y + cs);\n qr_mc.lineTo(x, y + cs);\n qr_mc.endFill();\n }\n }\n }\n\n return qr_mc;\n },\n setupTimingPattern: function setupTimingPattern() {\n for (var r = 8; r < this.moduleCount - 8; r++) {\n if (this.modules[r][6][0] != null) {\n continue;\n }\n\n this.modules[r][6][0] = r % 2 == 0;\n }\n\n for (var c = 8; c < this.moduleCount - 8; c++) {\n if (this.modules[6][c][0] != null) {\n continue;\n }\n\n this.modules[6][c][0] = c % 2 == 0;\n }\n },\n setupPositionAdjustPattern: function setupPositionAdjustPattern(posName) {\n var pos = QRUtil.getPatternPosition(this.typeNumber);\n\n for (var i = 0; i < pos.length; i++) {\n for (var j = 0; j < pos.length; j++) {\n var row = pos[i];\n var col = pos[j];\n\n if (this.modules[row][col][0] != null) {\n continue;\n }\n\n for (var r = -2; r <= 2; r++) {\n for (var c = -2; c <= 2; c++) {\n if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {\n this.modules[row + r][col + c][0] = true;\n this.modules[row + r][col + c][2] = posName; // Position\n\n if (r == -2 || c == -2 || r == 2 || c == 2) {\n this.modules[row + r][col + c][1] = 'O'; // Position Outer\n } else {\n this.modules[row + r][col + c][1] = 'I'; // Position Inner\n }\n } else {\n this.modules[row + r][col + c][0] = false;\n }\n }\n }\n }\n }\n },\n setupTypeNumber: function setupTypeNumber(test) {\n var bits = QRUtil.getBCHTypeNumber(this.typeNumber);\n\n for (var i = 0; i < 18; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3][0] = mod;\n }\n\n for (var i = 0; i < 18; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)][0] = mod;\n }\n },\n setupTypeInfo: function setupTypeInfo(test, maskPattern) {\n var data = this.errorCorrectLevel << 3 | maskPattern;\n var bits = QRUtil.getBCHTypeInfo(data);\n\n for (var i = 0; i < 15; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n\n if (i < 6) {\n this.modules[i][8][0] = mod;\n } else if (i < 8) {\n this.modules[i + 1][8][0] = mod;\n } else {\n this.modules[this.moduleCount - 15 + i][8][0] = mod;\n }\n }\n\n for (var i = 0; i < 15; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n\n if (i < 8) {\n this.modules[8][this.moduleCount - i - 1][0] = mod;\n } else if (i < 9) {\n this.modules[8][15 - i - 1 + 1][0] = mod;\n } else {\n this.modules[8][15 - i - 1][0] = mod;\n }\n }\n\n this.modules[this.moduleCount - 8][8][0] = !test;\n },\n mapData: function mapData(data, maskPattern) {\n var inc = -1;\n var row = this.moduleCount - 1;\n var bitIndex = 7;\n var byteIndex = 0;\n\n for (var col = this.moduleCount - 1; col > 0; col -= 2) {\n if (col == 6) col--;\n\n while (true) {\n for (var c = 0; c < 2; c++) {\n if (this.modules[row][col - c][0] == null) {\n var dark = false;\n\n if (byteIndex < data.length) {\n dark = (data[byteIndex] >>> bitIndex & 1) == 1;\n }\n\n var mask = QRUtil.getMask(maskPattern, row, col - c);\n\n if (mask) {\n dark = !dark;\n }\n\n this.modules[row][col - c][0] = dark;\n bitIndex--;\n\n if (bitIndex == -1) {\n byteIndex++;\n bitIndex = 7;\n }\n }\n }\n\n row += inc;\n\n if (row < 0 || this.moduleCount <= row) {\n row -= inc;\n inc = -inc;\n break;\n }\n }\n }\n }\n };\n QRCodeModel.PAD0 = 0xec;\n QRCodeModel.PAD1 = 0x11;\n\n QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {\n var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);\n var buffer = new QRBitBuffer();\n\n for (var i = 0; i < dataList.length; i++) {\n var data = dataList[i];\n buffer.put(data.mode, 4);\n buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));\n data.write(buffer);\n }\n\n var totalDataCount = 0;\n\n for (var i = 0; i < rsBlocks.length; i++) {\n totalDataCount += rsBlocks[i].dataCount;\n }\n\n if (buffer.getLengthInBits() > totalDataCount * 8) {\n throw new Error('code length overflow. (' + buffer.getLengthInBits() + '>' + totalDataCount * 8 + ')');\n }\n\n if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {\n buffer.put(0, 4);\n }\n\n while (buffer.getLengthInBits() % 8 != 0) {\n buffer.putBit(false);\n }\n\n while (true) {\n if (buffer.getLengthInBits() >= totalDataCount * 8) {\n break;\n }\n\n buffer.put(QRCodeModel.PAD0, 8);\n\n if (buffer.getLengthInBits() >= totalDataCount * 8) {\n break;\n }\n\n buffer.put(QRCodeModel.PAD1, 8);\n }\n\n return QRCodeModel.createBytes(buffer, rsBlocks);\n };\n\n QRCodeModel.createBytes = function (buffer, rsBlocks) {\n var offset = 0;\n var maxDcCount = 0;\n var maxEcCount = 0;\n var dcdata = new Array(rsBlocks.length);\n var ecdata = new Array(rsBlocks.length);\n\n for (var r = 0; r < rsBlocks.length; r++) {\n var dcCount = rsBlocks[r].dataCount;\n var ecCount = rsBlocks[r].totalCount - dcCount;\n maxDcCount = Math.max(maxDcCount, dcCount);\n maxEcCount = Math.max(maxEcCount, ecCount);\n dcdata[r] = new Array(dcCount);\n\n for (var i = 0; i < dcdata[r].length; i++) {\n dcdata[r][i] = 0xff & buffer.buffer[i + offset];\n }\n\n offset += dcCount;\n var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);\n var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);\n var modPoly = rawPoly.mod(rsPoly);\n ecdata[r] = new Array(rsPoly.getLength() - 1);\n\n for (var i = 0; i < ecdata[r].length; i++) {\n var modIndex = i + modPoly.getLength() - ecdata[r].length;\n ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;\n }\n }\n\n var totalCodeCount = 0;\n\n for (var i = 0; i < rsBlocks.length; i++) {\n totalCodeCount += rsBlocks[i].totalCount;\n }\n\n var data = new Array(totalCodeCount);\n var index = 0;\n\n for (var i = 0; i < maxDcCount; i++) {\n for (var r = 0; r < rsBlocks.length; r++) {\n if (i < dcdata[r].length) {\n data[index++] = dcdata[r][i];\n }\n }\n }\n\n for (var i = 0; i < maxEcCount; i++) {\n for (var r = 0; r < rsBlocks.length; r++) {\n if (i < ecdata[r].length) {\n data[index++] = ecdata[r][i];\n }\n }\n }\n\n return data;\n };\n\n var QRMode = {\n MODE_NUMBER: 1 << 0,\n MODE_ALPHA_NUM: 1 << 1,\n MODE_8BIT_BYTE: 1 << 2,\n MODE_KANJI: 1 << 3\n };\n var QRErrorCorrectLevel = {\n L: 1,\n M: 0,\n Q: 3,\n H: 2\n };\n var QRMaskPattern = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n };\n var QRUtil = {\n PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],\n G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,\n G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,\n G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,\n getBCHTypeInfo: function getBCHTypeInfo(data) {\n var d = data << 10;\n\n while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {\n d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);\n }\n\n return (data << 10 | d) ^ QRUtil.G15_MASK;\n },\n getBCHTypeNumber: function getBCHTypeNumber(data) {\n var d = data << 12;\n\n while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {\n d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);\n }\n\n return data << 12 | d;\n },\n getBCHDigit: function getBCHDigit(data) {\n var digit = 0;\n\n while (data != 0) {\n digit++;\n data >>>= 1;\n }\n\n return digit;\n },\n getPatternPosition: function getPatternPosition(typeNumber) {\n return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];\n },\n getMask: function getMask(maskPattern, i, j) {\n switch (maskPattern) {\n case QRMaskPattern.PATTERN000:\n return (i + j) % 2 == 0;\n\n case QRMaskPattern.PATTERN001:\n return i % 2 == 0;\n\n case QRMaskPattern.PATTERN010:\n return j % 3 == 0;\n\n case QRMaskPattern.PATTERN011:\n return (i + j) % 3 == 0;\n\n case QRMaskPattern.PATTERN100:\n return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;\n\n case QRMaskPattern.PATTERN101:\n return i * j % 2 + i * j % 3 == 0;\n\n case QRMaskPattern.PATTERN110:\n return (i * j % 2 + i * j % 3) % 2 == 0;\n\n case QRMaskPattern.PATTERN111:\n return (i * j % 3 + (i + j) % 2) % 2 == 0;\n\n default:\n throw new Error('bad maskPattern:' + maskPattern);\n }\n },\n getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {\n var a = new QRPolynomial([1], 0);\n\n for (var i = 0; i < errorCorrectLength; i++) {\n a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));\n }\n\n return a;\n },\n getLengthInBits: function getLengthInBits(mode, type) {\n if (1 <= type && type < 10) {\n switch (mode) {\n case QRMode.MODE_NUMBER:\n return 10;\n\n case QRMode.MODE_ALPHA_NUM:\n return 9;\n\n case QRMode.MODE_8BIT_BYTE:\n return 8;\n\n case QRMode.MODE_KANJI:\n return 8;\n\n default:\n throw new Error('mode:' + mode);\n }\n } else if (type < 27) {\n switch (mode) {\n case QRMode.MODE_NUMBER:\n return 12;\n\n case QRMode.MODE_ALPHA_NUM:\n return 11;\n\n case QRMode.MODE_8BIT_BYTE:\n return 16;\n\n case QRMode.MODE_KANJI:\n return 10;\n\n default:\n throw new Error('mode:' + mode);\n }\n } else if (type < 41) {\n switch (mode) {\n case QRMode.MODE_NUMBER:\n return 14;\n\n case QRMode.MODE_ALPHA_NUM:\n return 13;\n\n case QRMode.MODE_8BIT_BYTE:\n return 16;\n\n case QRMode.MODE_KANJI:\n return 12;\n\n default:\n throw new Error('mode:' + mode);\n }\n } else {\n throw new Error('type:' + type);\n }\n },\n getLostPoint: function getLostPoint(qrCode) {\n var moduleCount = qrCode.getModuleCount();\n var lostPoint = 0;\n\n for (var row = 0; row < moduleCount; row++) {\n for (var col = 0; col < moduleCount; col++) {\n var sameCount = 0;\n var dark = qrCode.isDark(row, col);\n\n for (var r = -1; r <= 1; r++) {\n if (row + r < 0 || moduleCount <= row + r) {\n continue;\n }\n\n for (var c = -1; c <= 1; c++) {\n if (col + c < 0 || moduleCount <= col + c) {\n continue;\n }\n\n if (r == 0 && c == 0) {\n continue;\n }\n\n if (dark == qrCode.isDark(row + r, col + c)) {\n sameCount++;\n }\n }\n }\n\n if (sameCount > 5) {\n lostPoint += 3 + sameCount - 5;\n }\n }\n }\n\n for (var row = 0; row < moduleCount - 1; row++) {\n for (var col = 0; col < moduleCount - 1; col++) {\n var count = 0;\n if (qrCode.isDark(row, col)) count++;\n if (qrCode.isDark(row + 1, col)) count++;\n if (qrCode.isDark(row, col + 1)) count++;\n if (qrCode.isDark(row + 1, col + 1)) count++;\n\n if (count == 0 || count == 4) {\n lostPoint += 3;\n }\n }\n }\n\n for (var row = 0; row < moduleCount; row++) {\n for (var col = 0; col < moduleCount - 6; col++) {\n if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {\n lostPoint += 40;\n }\n }\n }\n\n for (var col = 0; col < moduleCount; col++) {\n for (var row = 0; row < moduleCount - 6; row++) {\n if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {\n lostPoint += 40;\n }\n }\n }\n\n var darkCount = 0;\n\n for (var col = 0; col < moduleCount; col++) {\n for (var row = 0; row < moduleCount; row++) {\n if (qrCode.isDark(row, col)) {\n darkCount++;\n }\n }\n }\n\n var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;\n lostPoint += ratio * 10;\n return lostPoint;\n }\n };\n var QRMath = {\n glog: function glog(n) {\n if (n < 1) {\n throw new Error('glog(' + n + ')');\n }\n\n return QRMath.LOG_TABLE[n];\n },\n gexp: function gexp(n) {\n while (n < 0) {\n n += 255;\n }\n\n while (n >= 256) {\n n -= 255;\n }\n\n return QRMath.EXP_TABLE[n];\n },\n EXP_TABLE: new Array(256),\n LOG_TABLE: new Array(256)\n };\n\n for (var i = 0; i < 8; i++) {\n QRMath.EXP_TABLE[i] = 1 << i;\n }\n\n for (var i = 8; i < 256; i++) {\n QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];\n }\n\n for (var i = 0; i < 255; i++) {\n QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;\n }\n\n function QRPolynomial(num, shift) {\n if (num.length == undefined$1) {\n throw new Error(num.length + '/' + shift);\n }\n\n var offset = 0;\n\n while (offset < num.length && num[offset] == 0) {\n offset++;\n }\n\n this.num = new Array(num.length - offset + shift);\n\n for (var i = 0; i < num.length - offset; i++) {\n this.num[i] = num[i + offset];\n }\n }\n\n QRPolynomial.prototype = {\n get: function get(index) {\n return this.num[index];\n },\n getLength: function getLength() {\n return this.num.length;\n },\n multiply: function multiply(e) {\n var num = new Array(this.getLength() + e.getLength() - 1);\n\n for (var i = 0; i < this.getLength(); i++) {\n for (var j = 0; j < e.getLength(); j++) {\n num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));\n }\n }\n\n return new QRPolynomial(num, 0);\n },\n mod: function mod(e) {\n if (this.getLength() - e.getLength() < 0) {\n return this;\n }\n\n var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));\n var num = new Array(this.getLength());\n\n for (var i = 0; i < this.getLength(); i++) {\n num[i] = this.get(i);\n }\n\n for (var i = 0; i < e.getLength(); i++) {\n num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);\n }\n\n return new QRPolynomial(num, 0).mod(e);\n }\n };\n\n function QRRSBlock(totalCount, dataCount) {\n this.totalCount = totalCount;\n this.dataCount = dataCount;\n }\n\n QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];\n\n QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {\n var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);\n\n if (rsBlock == undefined$1) {\n throw new Error('bad rs block @ typeNumber:' + typeNumber + '/errorCorrectLevel:' + errorCorrectLevel);\n }\n\n var length = rsBlock.length / 3;\n var list = [];\n\n for (var i = 0; i < length; i++) {\n var count = rsBlock[i * 3 + 0];\n var totalCount = rsBlock[i * 3 + 1];\n var dataCount = rsBlock[i * 3 + 2];\n\n for (var j = 0; j < count; j++) {\n list.push(new QRRSBlock(totalCount, dataCount));\n }\n }\n\n return list;\n };\n\n QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {\n switch (errorCorrectLevel) {\n case QRErrorCorrectLevel.L:\n return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];\n\n case QRErrorCorrectLevel.M:\n return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];\n\n case QRErrorCorrectLevel.Q:\n return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];\n\n case QRErrorCorrectLevel.H:\n return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];\n\n default:\n return undefined$1;\n }\n };\n\n function QRBitBuffer() {\n this.buffer = [];\n this.length = 0;\n }\n\n QRBitBuffer.prototype = {\n get: function get(index) {\n var bufIndex = Math.floor(index / 8);\n return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;\n },\n put: function put(num, length) {\n for (var i = 0; i < length; i++) {\n this.putBit((num >>> length - i - 1 & 1) == 1);\n }\n },\n getLengthInBits: function getLengthInBits() {\n return this.length;\n },\n putBit: function putBit(bit) {\n var bufIndex = Math.floor(this.length / 8);\n\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0);\n }\n\n if (bit) {\n this.buffer[bufIndex] |= 0x80 >>> this.length % 8;\n }\n\n this.length++;\n }\n };\n var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];\n\n function _isSupportCanvas() {\n return typeof CanvasRenderingContext2D != 'undefined';\n } // android 2.x doesn't support Data-URI spec\n\n\n function _getAndroid() {\n var android = false;\n var sAgent = navigator.userAgent;\n\n if (/android/i.test(sAgent)) {\n // android\n android = true;\n var aMat = sAgent.toString().match(/android ([0-9]\\.[0-9])/i);\n\n if (aMat && aMat[1]) {\n android = parseFloat(aMat[1]);\n }\n }\n\n return android;\n } // Drawing in DOM by using Table tag\n\n\n var Drawing = !_isSupportCanvas() ? function () {\n var Drawing = function Drawing(el, htOption) {\n this._el = el;\n this._htOption = htOption;\n };\n /**\n * Draw the QRCode\n *\n * @param {QRCode} oQRCode\n */\n\n\n Drawing.prototype.draw = function (oQRCode) {\n var _htOption = this._htOption;\n var _el = this._el;\n var nCount = oQRCode.getModuleCount();\n var nWidth = Math.round(_htOption.width / nCount);\n var nHeight = Math.round((_htOption.height - _htOption.titleHeight) / nCount);\n\n if (nWidth <= 1) {\n nWidth = 1;\n }\n\n if (nHeight <= 1) {\n nHeight = 1;\n }\n\n this._htOption.width = nWidth * nCount;\n this._htOption.height = nHeight * nCount + _htOption.titleHeight;\n this._htOption.quietZone = Math.round(this._htOption.quietZone);\n var aHTML = [];\n var divStyle = '';\n var drawWidth = Math.round(nWidth * _htOption.dotScale);\n var drawHeight = Math.round(nHeight * _htOption.dotScale);\n\n if (drawWidth < 4) {\n drawWidth = 4;\n drawHeight = 4;\n }\n\n var nonRequiredColorDark = _htOption.colorDark;\n var nonRequiredcolorLight = _htOption.colorLight;\n\n if (_htOption.backgroundImage) {\n if (_htOption.autoColor) {\n _htOption.colorDark = \"rgba(0, 0, 0, .6);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#99000000', EndColorStr='#99000000');\";\n _htOption.colorLight = \"rgba(255, 255, 255, .7);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#B2FFFFFF', EndColorStr='#B2FFFFFF');\"; // _htOption.colorDark=\"rgba(0, 0, 0, .6)\";\n // _htOption.colorLight='rgba(255, 255, 255, .7)';\n } else {\n _htOption.colorLight = 'rgba(0,0,0,0)';\n }\n\n var backgroundImageEle = '<div style=\"display:inline-block; z-index:-10;position:absolute;\"><img src=\"' + _htOption.backgroundImage + '\" widht=\"' + (_htOption.width + _htOption.quietZone * 2) + '\" height=\"' + (_htOption.height + _htOption.quietZone * 2) + '\" style=\"opacity:' + _htOption.backgroundImageAlpha + ';filter:alpha(opacity=' + _htOption.backgroundImageAlpha * 100 + '); \"/></div>';\n aHTML.push(backgroundImageEle);\n }\n\n if (_htOption.quietZone) {\n divStyle = 'display:inline-block; width:' + (_htOption.width + _htOption.quietZone * 2) + 'px; height:' + (_htOption.width + _htOption.quietZone * 2) + 'px;background:' + _htOption.quietZoneColor + '; text-align:center;';\n }\n\n aHTML.push('<div style=\"font-size:0;' + divStyle + '\">');\n aHTML.push('<table style=\"font-size:0;border:0;border-collapse:collapse; margin-top:' + _htOption.quietZone + 'px;\" border=\"0\" cellspacing=\"0\" cellspadding=\"0\" align=\"center\" valign=\"middle\">');\n aHTML.push('<tr height=\"' + _htOption.titleHeight + '\" align=\"center\"><td style=\"border:0;border-collapse:collapse;margin:0;padding:0\" colspan=\"' + nCount + '\">');\n\n if (_htOption.title) {\n var c = _htOption.titleColor;\n var f = _htOption.titleFont;\n aHTML.push('<div style=\"width:100%;margin-top:' + _htOption.titleTop + 'px;color:' + c + ';font:' + f + ';background:' + _htOption.titleBackgroundColor + '\">' + _htOption.title + '</div>');\n }\n\n if (_htOption.subTitle) {\n aHTML.push('<div style=\"width:100%;margin-top:' + (_htOption.subTitleTop - _htOption.titleTop) + 'px;color:' + _htOption.subTitleColor + '; font:' + _htOption.subTitleFont + '\">' + _htOption.subTitle + '</div>');\n }\n\n aHTML.push('</td></tr>');\n\n for (var row = 0; row < nCount; row++) {\n aHTML.push('<tr style=\"border:0; padding:0; margin:0;\" height=\"7\">');\n\n for (var col = 0; col < nCount; col++) {\n var bIsDark = oQRCode.isDark(row, col);\n var eye = oQRCode.getEye(row, col); // { isDark: true/false, type: PO_TL, PI_TL, PO_TR, PI_TR, PO_BL, PI_BL };\n\n if (eye) {\n // Is eye\n bIsDark = eye.isDark;\n var type = eye.type; // PX_XX, PX, colorDark, colorLight\n\n var eyeColorDark = _htOption[type] || _htOption[type.substring(0, 2)] || nonRequiredColorDark;\n aHTML.push('<td style=\"border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;\">' + '<span style=\"width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (bIsDark ? eyeColorDark : nonRequiredcolorLight) + ';display:inline-block\"></span></td>');\n } else {\n // Timing Pattern\n var nowDarkColor = _htOption.colorDark;\n\n if (row == 6) {\n nowDarkColor = _htOption.timing_H || _htOption.timing || nonRequiredColorDark;\n aHTML.push('<td style=\"border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (bIsDark ? nowDarkColor : nonRequiredcolorLight) + ';\"></td>');\n } else if (col == 6) {\n nowDarkColor = _htOption.timing_V || _htOption.timing || nonRequiredColorDark;\n aHTML.push('<td style=\"border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (bIsDark ? nowDarkColor : nonRequiredcolorLight) + ';\"></td>');\n } else {\n aHTML.push('<td style=\"border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;\">' + '<div style=\"display:inline-block;width:' + drawWidth + 'px;height:' + drawHeight + 'px;background-color:' + (bIsDark ? nowDarkColor : _htOption.colorLight) + ';\"></div></td>');\n }\n }\n }\n\n aHTML.push('</tr>');\n }\n\n aHTML.push('</table>');\n aHTML.push('</div>');\n\n if (_htOption.logo) {\n // Logo Image\n var img = new Image();\n\n if (_htOption.crossOrigin != null) {\n img.crossOrigin = _htOption.crossOrigin;\n } // img.crossOrigin=\"Anonymous\";\n\n\n img.src = _htOption.logo;\n var imgW = _htOption.width / 3.5;\n var imgH = _htOption.height / 3.5;\n\n if (imgW != imgH) {\n imgW = imgH;\n }\n\n if (_htOption.logoWidth) {\n imgW = _htOption.logoWidth;\n }\n\n if (_htOption.logoHeight) {\n imgH = _htOption.logoHeight;\n }\n\n var imgDivStyle = 'position:relative; z-index:1;display:table-cell;top:-' + ((_htOption.height - _htOption.titleHeight) / 2 + imgH / 2 + _htOption.quietZone) + 'px;text-align:center; width:' + imgW + 'px; height:' + imgH + 'px;line-height:' + imgW + 'px; vertical-align: middle;';\n\n if (!_htOption.logoBackgroundTransparent) {\n imgDivStyle += 'background:' + _htOption.logoBackgroundColor;\n }\n\n aHTML.push('<div style=\"' + imgDivStyle + '\"><img src=\"' + _htOption.logo + '\" style=\"max-width: ' + imgW + 'px; max-height: ' + imgH + 'px;\" /> <div style=\" display: none; width:1px;margin-left: -1px;\"></div></div>');\n }\n\n if (_htOption.onRenderingStart) {\n _htOption.onRenderingStart(_htOption);\n }\n\n _el.innerHTML = aHTML.join(''); // Fix the margin values as real size.\n\n var elTable = _el.childNodes[0];\n var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;\n var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;\n\n if (nLeftMarginTable > 0 && nTopMarginTable > 0) {\n elTable.style.margin = nTopMarginTable + 'px ' + nLeftMarginTable + 'px';\n }\n\n if (this._htOption.onRenderingEnd) {\n this._htOption.onRenderingEnd(this._htOption, null);\n }\n };\n /**\n * Clear the QRCode\n */\n\n\n Drawing.prototype.clear = function () {\n this._el.innerHTML = '';\n };\n\n return Drawing;\n }() : function () {\n // Drawing in Canvas\n function _onMakeImage() {\n if (this._htOption.drawer == 'svg') {\n var svgData = this._oContext.getSerializedSvg(true);\n\n this.dataURL = svgData;\n this._el.innerHTML = svgData;\n } else {\n // canvas\n // this._elImage.crossOrigin='Anonymous';\n try {\n // if (this._htOption.crossOrigin != null) {\n // this._elImage.crossOrigin = this._htOption.crossOrigin;\n // }\n var dataURL = this._elCanvas.toDataURL('image/png'); // this._elImage.src = dataURL;\n\n\n this.dataURL = dataURL; // this._elImage.style.display = \"inline\";\n // this._elCanvas.style.display = \"none\";\n } catch (e) {\n console.error(e);\n }\n }\n\n if (this._htOption.onRenderingEnd) {\n if (!this.dataURL) {\n console.error(\"Can not get base64 data, please check: 1. Published the page and image to the server 2. The image request support CORS 3. Configured `crossOrigin:'anonymous'` option\");\n }\n\n this._htOption.onRenderingEnd(this._htOption, this.dataURL);\n }\n } // Android 2.1 bug workaround\n // http://code.google.com/p/android/issues/detail?id=5141\n\n\n if (root._android && root._android <= 2.1) {\n var factor = 1 / window.devicePixelRatio;\n var drawImage = CanvasRenderingContext2D.prototype.drawImage;\n\n CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {\n if ('nodeName' in image && /img/i.test(image.nodeName)) {\n for (var i = arguments.length - 1; i >= 1; i--) {\n arguments[i] = arguments[i] * factor;\n }\n } else if (typeof dw == 'undefined') {\n arguments[1] *= factor;\n arguments[2] *= factor;\n arguments[3] *= factor;\n arguments[4] *= factor;\n }\n\n drawImage.apply(this, arguments);\n };\n }\n /**\n * Check whether the user's browser supports Data URI or not\n *\n * @private\n * @param {Function} fSuccess Occurs if it supports Data URI\n * @param {Function} fFail Occurs if it doesn't support Data URI\n */\n\n\n function _safeSetDataURI(fSuccess, fFail) {\n var self = this;\n self._fFail = fFail;\n self._fSuccess = fSuccess; // Check it just once\n\n if (self._bSupportDataURI === null) {\n var el = document.createElement('img');\n\n var fOnError = function fOnError() {\n self._bSupportDataURI = false;\n\n if (self._fFail) {\n self._fFail.call(self);\n }\n };\n\n var fOnSuccess = function fOnSuccess() {\n self._bSupportDataURI = true;\n\n if (self._fSuccess) {\n self._fSuccess.call(self);\n }\n };\n\n el.onabort = fOnError;\n el.onerror = fOnError;\n el.onload = fOnSuccess;\n el.src = 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='; // the Image contains 1px data.\n\n return;\n } else if (self._bSupportDataURI === true && self._fSuccess) {\n self._fSuccess.call(self);\n } else if (self._bSupportDataURI === false && self._fFail) {\n self._fFail.call(self);\n }\n }\n /**\n * Drawing QRCode by using canvas\n *\n * @constructor\n * @param {HTMLElement} el\n * @param {Object} htOption QRCode Options\n */\n\n\n var Drawing = function Drawing(el, htOption) {\n this._bIsPainted = false;\n this._android = _getAndroid();\n this._el = el;\n this._htOption = htOption;\n\n if (this._htOption.drawer == 'svg') {\n this._oContext = {};\n this._elCanvas = {};\n } else {\n // canvas\n this._elCanvas = document.createElement('canvas');\n\n this._el.appendChild(this._elCanvas);\n\n this._oContext = this._elCanvas.getContext('2d'); // this._elImage = document.createElement(\"img\");\n // this._elImage.alt = \"Scan me!\";\n // this._elImage.style.display = \"none\";\n // this._el.appendChild(this._elImage);\n }\n\n this._bSupportDataURI = null;\n this.dataURL = null;\n };\n /**\n * Draw the QRCode\n *\n * @param {QRCode} oQRCode\n */\n\n\n Drawing.prototype.draw = function (oQRCode) {\n // var _elImage = this._elImage;\n var _htOption = this._htOption;\n\n if (!_htOption.title && !_htOption.subTitle) {\n _htOption.height -= _htOption.titleHeight;\n _htOption.titleHeight = 0;\n }\n\n var nCount = oQRCode.getModuleCount();\n var nWidth = Math.round(_htOption.width / nCount);\n var nHeight = Math.round((_htOption.height - _htOption.titleHeight) / nCount);\n\n if (nWidth <= 1) {\n nWidth = 1;\n }\n\n if (nHeight <= 1) {\n nHeight = 1;\n }\n\n _htOption.width = nWidth * nCount;\n _htOption.height = nHeight * nCount + _htOption.titleHeight;\n _htOption.quietZone = Math.round(_htOption.quietZone);\n this._elCanvas.width = _htOption.width + _htOption.quietZone * 2;\n this._elCanvas.height = _htOption.height + _htOption.quietZone * 2;\n\n if (this._htOption.drawer != 'canvas') {\n // _elImage.style.display = \"none\";\n // } else {\n this._oContext = new C2S(this._elCanvas.width, this._elCanvas.height);\n }\n\n this.clear();\n var _oContext = this._oContext;\n _oContext.lineWidth = 0;\n _oContext.fillStyle = _htOption.colorLight;\n\n _oContext.fillRect(0, 0, this._elCanvas.width, this._elCanvas.height);\n\n var t = this;\n\n function drawQuietZoneColor() {\n if (_htOption.quietZone > 0 && _htOption.quietZoneColor) {\n // top\n _oContext.lineWidth = 0;\n _oContext.fillStyle = _htOption.quietZoneColor;\n\n _oContext.fillRect(0, 0, t._elCanvas.width, _htOption.quietZone); // left\n\n\n _oContext.fillRect(0, _htOption.quietZone, _htOption.quietZone, t._elCanvas.height - _htOption.quietZone * 2); // right\n\n\n _oContext.fillRect(t._elCanvas.width - _htOption.quietZone, _htOption.quietZone, _htOption.quietZone, t._elCanvas.height - _htOption.quietZone * 2); // bottom\n\n\n _oContext.fillRect(0, t._elCanvas.height - _htOption.quietZone, t._elCanvas.width, _htOption.quietZone);\n }\n }\n\n if (_htOption.backgroundImage) {\n // Background Image\n var bgImg = new Image();\n\n bgImg.onload = function () {\n _oContext.globalAlpha = 1;\n _oContext.globalAlpha = _htOption.backgroundImageAlpha;\n var imageSmoothingQuality = _oContext.imageSmoothingQuality;\n var imageSmoothingEnabled = _oContext.imageSmoothingEnabled;\n _oContext.imageSmoothingEnabled = true;\n _oContext.imageSmoothingQuality = 'high';\n\n _oContext.drawImage(bgImg, 0, _htOption.titleHeight, _htOption.width + _htOption.quietZone * 2, _htOption.height + _htOption.quietZone * 2 - _htOption.titleHeight);\n\n _oContext.imageSmoothingEnabled = imageSmoothingEnabled;\n _oContext.imageSmoothingQuality = imageSmoothingQuality;\n _oContext.globalAlpha = 1;\n drawQrcode.call(t, oQRCode);\n }; // bgImg.crossOrigin='Anonymous';\n\n\n if (_htOption.crossOrigin != null) {\n bgImg.crossOrigin = _htOption.crossOrigin;\n }\n\n bgImg.originalSrc = _htOption.backgroundImage;\n bgImg.src = _htOption.backgroundImage; // DoSomething\n } else {\n drawQrcode.call(t, oQRCode);\n }\n\n function drawQrcode(oQRCode) {\n if (_htOption.onRenderingStart) {\n _htOption.onRenderingStart(_htOption);\n }\n\n for (var row = 0; row < nCount; row++) {\n for (var col = 0; col < nCount; col++) {\n var nLeft = col * nWidth + _htOption.quietZone;\n var nTop = row * nHeight + _htOption.quietZone;\n var bIsDark = oQRCode.isDark(row, col);\n var eye = oQRCode.getEye(row, col); // { isDark: true/false, type: PO_TL, PI_TL, PO_TR, PI_TR, PO_BL, PI_BL };\n\n var nowDotScale = _htOption.dotScale;\n _oContext.lineWidth = 0; // Color handler\n\n var dColor;\n var lColor;\n\n if (eye) {\n dColor = _htOption[eye.type] || _htOption[eye.type.substring(0, 2)] || _htOption.colorDark;\n lColor = _htOption.colorLight;\n } else {\n if (_htOption.backgroundImage) {\n lColor = 'rgba(0,0,0,0)';\n\n if (row == 6) {\n // dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;\n if (_htOption.autoColor) {\n dColor = _htOption.timing_H || _htOption.timing || _htOption.autoColorDark;\n lColor = _htOption.autoColorLight;\n } else {\n dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;\n }\n } else if (col == 6) {\n // dColor = _htOption.timing_V || _htOption.timing || _htOption.colorDark;\n if (_htOption.autoColor) {\n dColor = _htOption.timing_V || _htOption.timing || _htOption.autoColorDark;\n lColor = _htOption.autoColorLight;\n } else {\n dColor = _htOption.timing_V || _htOption.timing || _htOption.colorDark;\n }\n } else {\n if (_htOption.autoColor) {\n dColor = _htOption.autoColorDark;\n lColor = _htOption.autoColorLight;\n } else {\n dColor = _htOption.colorDark;\n }\n }\n } else {\n if (row == 6) {\n dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;\n } else if (col == 6) {\n dColor = _htOption.timing_V || _htOption.timing || _htOption.colorDark;\n } else {\n dColor = _htOption.colorDark;\n }\n\n lColor = _htOption.colorLight;\n }\n }\n\n _oContext.strokeStyle = bIsDark ? dColor : lColor;\n _oContext.fillStyle = bIsDark ? dColor : lColor;\n\n if (eye) {\n if (eye.type == 'AO') {\n nowDotScale = _htOption.dotScaleAO;\n } else if (eye.type == 'AI') {\n nowDotScale = _htOption.dotScaleAI;\n } else {\n nowDotScale = 1;\n }\n\n if (_htOption.backgroundImage && _htOption.autoColor) {\n dColor = (eye.type == 'AO' ? _htOption.AI : _htOption.AO) || _htOption.autoColorDark;\n lColor = _htOption.autoColorLight;\n } else {\n dColor = (eye.type == 'AO' ? _htOption.AI : _htOption.AO) || dColor;\n } // Is eye\n\n\n bIsDark = eye.isDark;\n\n _oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 - nowDotScale) / 2, nWidth * nowDotScale, nHeight * nowDotScale);\n } else {\n if (row == 6) {\n // Timing Pattern\n nowDotScale = _htOption.dotScaleTiming_H;\n\n _oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 - nowDotScale) / 2, nWidth * nowDotScale, nHeight * nowDotScale);\n } else if (col == 6) {\n // Timing Pattern\n nowDotScale = _htOption.dotScaleTiming_V;\n\n _oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 - nowDotScale) / 2, nWidth * nowDotScale, nHeight * nowDotScale);\n } else {\n if (_htOption.backgroundImage) {\n _oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 - nowDotScale) / 2, nWidth * nowDotScale, nHeight * nowDotScale);\n } else {\n _oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 - nowDotScale) / 2, nWidth * nowDotScale, nHeight * nowDotScale);\n }\n }\n }\n\n if (_htOption.dotScale != 1 && !eye) {\n _oContext.strokeStyle = _htOption.colorLight;\n }\n }\n }\n\n if (_htOption.title) {\n _oContext.fillStyle = _htOption.titleBackgroundColor;\n\n _oContext.fillRect(0, 0, this._elCanvas.width, _htOption.titleHeight + _htOption.quietZone);\n\n _oContext.font = _htOption.titleFont;\n _oContext.fillStyle = _htOption.titleColor;\n _oContext.textAlign = 'center';\n\n _oContext.fillText(_htOption.title, this._elCanvas.width / 2, +_htOption.quietZone + _htOption.titleTop);\n }\n\n if (_htOption.subTitle) {\n _oContext.font = _htOption.subTitleFont;\n _oContext.fillStyle = _htOption.subTitleColor;\n\n _oContext.fillText(_htOption.subTitle, this._elCanvas.width / 2, +_htOption.quietZone + _htOption.subTitleTop);\n }\n\n function generateLogoImg(img) {\n var imgContainerW = Math.round(_htOption.width / 3.5);\n var imgContainerH = Math.round(_htOption.height / 3.5);\n\n if (imgContainerW !== imgContainerH) {\n imgContainerW = imgContainerH;\n }\n\n if (_htOption.logoMaxWidth) {\n imgContainerW = Math.round(_htOption.logoMaxWidth);\n } else if (_htOption.logoWidth) {\n imgContainerW = Math.round(_htOption.logoWidth);\n }\n\n if (_htOption.logoMaxHeight) {\n imgContainerH = Math.round(_htOption.logoMaxHeight);\n } else if (_htOption.logoHeight) {\n imgContainerH = Math.round(_htOption.logoHeight);\n }\n\n var nw;\n var nh;\n\n if (typeof img.naturalWidth == 'undefined') {\n // IE 6/7/8\n nw = img.width;\n nh = img.height;\n } else {\n // HTML5 browsers\n nw = img.naturalWidth;\n nh = img.naturalHeight;\n }\n\n if (_htOption.logoMaxWidth || _htOption.logoMaxHeight) {\n if (_htOption.logoMaxWidth && nw <= imgContainerW) {\n imgContainerW = nw;\n }\n\n if (_htOption.logoMaxHeight && nh <= imgContainerH) {\n imgContainerH = nh;\n }\n\n if (nw <= imgContainerW && nh <= imgContainerH) {\n imgContainerW = nw;\n imgContainerH = nh;\n }\n }\n\n var imgContainerX = (_htOption.width + _htOption.quietZone * 2 - imgContainerW) / 2;\n var imgContainerY = (_htOption.height + _htOption.titleHeight + _htOption.quietZone * 2 - imgContainerH) / 2;\n var imgScale = Math.min(imgContainerW / nw, imgContainerH / nh);\n var imgW = nw * imgScale;\n var imgH = nh * imgScale;\n\n if (_htOption.logoMaxWidth || _htOption.logoMaxHeight) {\n imgContainerW = imgW;\n imgContainerH = imgH;\n imgContainerX = (_htOption.width + _htOption.quietZone * 2 - imgContainerW) / 2;\n imgContainerY = (_htOption.height + _htOption.titleHeight + _htOption.quietZone * 2 - imgContainerH) / 2;\n } // Did Not Use Transparent Logo Image\n\n\n if (!_htOption.logoBackgroundTransparent) {\n //if (!_htOption.logoBackgroundColor) {\n //_htOption.logoBackgroundColor = '#ffffff';\n //}\n _oContext.fillStyle = _htOption.logoBackgroundColor;\n\n _oContext.fillRect(imgContainerX, imgContainerY, imgContainerW, imgContainerH);\n }\n\n var imageSmoothingQuality = _oContext.imageSmoothingQuality;\n var imageSmoothingEnabled = _oContext.imageSmoothingEnabled;\n _oContext.imageSmoothingEnabled = true;\n _oContext.imageSmoothingQuality = 'high';\n\n _oContext.drawImage(img, imgContainerX + (imgContainerW - imgW) / 2, imgContainerY + (imgContainerH - imgH) / 2, imgW, imgH);\n\n _oContext.imageSmoothingEnabled = imageSmoothingEnabled;\n _oContext.imageSmoothingQuality = imageSmoothingQuality;\n drawQuietZoneColor();\n _this._bIsPainted = true;\n\n _this.makeImage();\n }\n\n if (_htOption.logo) {\n // Logo Image\n var img = new Image();\n\n var _this = this;\n\n img.onload = function () {\n generateLogoImg(img);\n };\n\n img.onerror = function (e) {\n console.error(e);\n }; // img.crossOrigin=\"Anonymous\";\n\n\n if (_htOption.crossOrigin != null) {\n img.crossOrigin = _htOption.crossOrigin;\n }\n\n img.originalSrc = _htOption.logo;\n img.src = _htOption.logo;\n } else {\n drawQuietZoneColor();\n this._bIsPainted = true;\n this.makeImage();\n }\n }\n };\n /**\n * Make the image from Canvas if the browser supports Data URI.\n */\n\n\n Drawing.prototype.makeImage = function () {\n if (this._bIsPainted) {\n _safeSetDataURI.call(this, _onMakeImage);\n }\n };\n /**\n * Return whether the QRCode is painted or not\n *\n * @return {Boolean}\n */\n\n\n Drawing.prototype.isPainted = function () {\n return this._bIsPainted;\n };\n /**\n * Clear the QRCode\n */\n\n\n Drawing.prototype.clear = function () {\n this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);\n\n this._bIsPainted = false;\n };\n\n Drawing.prototype.remove = function () {\n this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);\n\n this._bIsPainted = false;\n this._el.innerHTML = '';\n };\n /**\n * @private\n * @param {Number} nNumber\n */\n\n\n Drawing.prototype.round = function (nNumber) {\n if (!nNumber) {\n return nNumber;\n }\n\n return Math.floor(nNumber * 1000) / 1000;\n };\n\n return Drawing;\n }();\n /**\n * Get the type by string length\n *\n * @private\n * @param {String} sText\n * @param {Number} nCorrectLevel\n * @return {Number} type\n */\n\n function _getTypeNumber(sText, _htOption) {\n var nCorrectLevel = _htOption.correctLevel;\n var nType = 1;\n\n var length = _getUTF8Length(sText);\n\n for (var i = 0, len = QRCodeLimitLength.length; i < len; i++) {\n var nLimit = 0;\n\n switch (nCorrectLevel) {\n case QRErrorCorrectLevel.L:\n nLimit = QRCodeLimitLength[i][0];\n break;\n\n case QRErrorCorrectLevel.M:\n nLimit = QRCodeLimitLength[i][1];\n break;\n\n case QRErrorCorrectLevel.Q:\n nLimit = QRCodeLimitLength[i][2];\n break;\n\n case QRErrorCorrectLevel.H:\n nLimit = QRCodeLimitLength[i][3];\n break;\n }\n\n if (length <= nLimit) {\n break;\n } else {\n nType++;\n }\n }\n\n if (nType > QRCodeLimitLength.length) {\n throw new Error('Too long data. the CorrectLevel.' + ['M', 'L', 'H', 'Q'][nCorrectLevel] + ' limit length is ' + nLimit);\n }\n\n if (_htOption.version != 0) {\n if (nType <= _htOption.version) {\n nType = _htOption.version;\n _htOption.runVersion = nType;\n } else {\n console.warn('QR Code version ' + _htOption.version + ' too small, run version use ' + nType);\n _htOption.runVersion = nType;\n }\n }\n\n return nType;\n }\n\n function _getUTF8Length(sText) {\n var replacedText = encodeURI(sText).toString().replace(/\\%[0-9a-fA-F]{2}/g, 'a');\n return replacedText.length + (replacedText.length != sText.length ? 3 : 0);\n }\n\n QRCode = function QRCode(el, vOption) {\n this._htOption = {\n width: 256,\n height: 256,\n typeNumber: 4,\n colorDark: '#000000',\n colorLight: '#ffffff',\n correctLevel: QRErrorCorrectLevel.H,\n dotScale: 1,\n // For body block, must be greater than 0, less than or equal to 1. default is 1\n dotScaleTiming: 1,\n // Dafault for timing block , must be greater than 0, less than or equal to 1. default is 1\n dotScaleTiming_H: undefined$1,\n // For horizontal timing block, must be greater than 0, less than or equal to 1. default is 1\n dotScaleTiming_V: undefined$1,\n // For vertical timing block, must be greater than 0, less than or equal to 1. default is 1\n dotScaleA: 1,\n // Dafault for alignment block, must be greater than 0, less than or equal to 1. default is 1\n dotScaleAO: undefined$1,\n // For alignment outer block, must be greater than 0, less than or equal to 1. default is 1\n dotScaleAI: undefined$1,\n // For alignment inner block, must be greater than 0, less than or equal to 1. default is 1\n quietZone: 0,\n quietZoneColor: 'rgba(0,0,0,0)',\n title: '',\n titleFont: 'normal normal bold 16px Arial',\n titleColor: '#000000',\n titleBackgroundColor: '#ffffff',\n titleHeight: 0,\n // Title Height, Include subTitle\n titleTop: 30,\n // draws y coordinates. default is 30\n subTitle: '',\n subTitleFont: 'normal normal normal 14px Arial',\n subTitleColor: '#4F4F4F',\n subTitleTop: 60,\n // draws y coordinates. default is 0\n logo: undefined$1,\n logoWidth: undefined$1,\n logoHeight: undefined$1,\n logoMaxWidth: undefined$1,\n logoMaxHeight: undefined$1,\n logoBackgroundColor: '#ffffff',\n logoBackgroundTransparent: false,\n // === Posotion Pattern(Eye) Color\n PO: undefined$1,\n // Global Posotion Outer color. if not set, the defaut is `colorDark`\n PI: undefined$1,\n // Global Posotion Inner color. if not set, the defaut is `colorDark`\n PO_TL: undefined$1,\n // Posotion Outer - Top Left\n PI_TL: undefined$1,\n // Posotion Inner - Top Left\n PO_TR: undefined$1,\n // Posotion Outer - Top Right\n PI_TR: undefined$1,\n // Posotion Inner - Top Right\n PO_BL: undefined$1,\n // Posotion Outer - Bottom Left\n PI_BL: undefined$1,\n // Posotion Inner - Bottom Left\n // === Alignment Color\n AO: undefined$1,\n // Alignment Outer. if not set, the defaut is `colorDark`\n AI: undefined$1,\n // Alignment Inner. if not set, the defaut is `colorDark`\n // === Timing Pattern Color\n timing: undefined$1,\n // Global Timing color. if not set, the defaut is `colorDark`\n timing_H: undefined$1,\n // Horizontal timing color\n timing_V: undefined$1,\n // Vertical timing color\n // ==== Backgroud Image\n backgroundImage: undefined$1,\n // Background Image\n backgroundImageAlpha: 1,\n // Background image transparency, value between 0 and 1. default is 1.\n autoColor: false,\n // Automatic color adjustment(for data block)\n autoColorDark: 'rgba(0, 0, 0, .6)',\n // Automatic color: dark CSS color\n autoColorLight: 'rgba(255, 255, 255, .7)',\n // Automatic color: light CSS color\n // ==== Event Handler\n onRenderingStart: undefined$1,\n onRenderingEnd: undefined$1,\n // ==== Versions\n version: 0,\n // The symbol versions of QR Code range from Version 1 to Version 40. default 0 means automatically choose the closest version based on the text length.\n // ==== Tooltip\n tooltip: false,\n // Whether set the QRCode Text as the title attribute value of the image\n // ==== Binary(hex) data mode\n binary: false,\n // Whether it is binary mode, default is text mode.\n // ==== Drawing method\n drawer: 'canvas',\n // Drawing method: canvas, svg(Chrome, FF, IE9+)\n // ==== CORS\n crossOrigin: null,\n // String which specifies the CORS setting to use when retrieving the image. null means that the crossOrigin attribute is not set.\n // UTF-8 without BOM\n utf8WithoutBOM: true\n };\n\n if (typeof vOption === 'string') {\n vOption = {\n text: vOption\n };\n } // Overwrites options\n\n\n if (vOption) {\n for (var i in vOption) {\n this._htOption[i] = vOption[i];\n }\n }\n\n if (this._htOption.version < 0 || this._htOption.version > 40) {\n console.warn(\"QR Code version '\" + this._htOption.version + \"' is invalidate, reset to 0\");\n this._htOption.version = 0;\n }\n\n if (this._htOption.dotScale < 0 || this._htOption.dotScale > 1) {\n console.warn(this._htOption.dotScale + ' , is invalidate, dotScale must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScale = 1;\n }\n\n if (this._htOption.dotScaleTiming < 0 || this._htOption.dotScaleTiming > 1) {\n console.warn(this._htOption.dotScaleTiming + ' , is invalidate, dotScaleTiming must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleTiming = 1;\n }\n\n if (this._htOption.dotScaleTiming_H) {\n if (this._htOption.dotScaleTiming_H < 0 || this._htOption.dotScaleTiming_H > 1) {\n console.warn(this._htOption.dotScaleTiming_H + ' , is invalidate, dotScaleTiming_H must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleTiming_H = 1;\n }\n } else {\n this._htOption.dotScaleTiming_H = this._htOption.dotScaleTiming;\n }\n\n if (this._htOption.dotScaleTiming_V) {\n if (this._htOption.dotScaleTiming_V < 0 || this._htOption.dotScaleTiming_V > 1) {\n console.warn(this._htOption.dotScaleTiming_V + ' , is invalidate, dotScaleTiming_V must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleTiming_V = 1;\n }\n } else {\n this._htOption.dotScaleTiming_V = this._htOption.dotScaleTiming;\n }\n\n if (this._htOption.dotScaleA < 0 || this._htOption.dotScaleA > 1) {\n console.warn(this._htOption.dotScaleA + ' , is invalidate, dotScaleA must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleA = 1;\n }\n\n if (this._htOption.dotScaleAO) {\n if (this._htOption.dotScaleAO < 0 || this._htOption.dotScaleAO > 1) {\n console.warn(this._htOption.dotScaleAO + ' , is invalidate, dotScaleAO must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleAO = 1;\n }\n } else {\n this._htOption.dotScaleAO = this._htOption.dotScaleA;\n }\n\n if (this._htOption.dotScaleAI) {\n if (this._htOption.dotScaleAI < 0 || this._htOption.dotScaleAI > 1) {\n console.warn(this._htOption.dotScaleAI + ' , is invalidate, dotScaleAI must greater than 0, less than or equal to 1, now reset to 1. ');\n this._htOption.dotScaleAI = 1;\n }\n } else {\n this._htOption.dotScaleAI = this._htOption.dotScaleA;\n }\n\n if (this._htOption.backgroundImageAlpha < 0 || this._htOption.backgroundImageAlpha > 1) {\n console.warn(this._htOption.backgroundImageAlpha + ' , is invalidate, backgroundImageAlpha must between 0 and 1, now reset to 1. ');\n this._htOption.backgroundImageAlpha = 1;\n }\n\n this._htOption.height = this._htOption.height + this._htOption.titleHeight;\n\n if (typeof el == 'string') {\n el = document.getElementById(el);\n }\n\n if (!this._htOption.drawer || this._htOption.drawer != 'svg' && this._htOption.drawer != 'canvas') {\n this._htOption.drawer = 'canvas';\n }\n\n this._android = _getAndroid();\n this._el = el;\n this._oQRCode = null;\n var _htOptionClone = {};\n\n for (var i in this._htOption) {\n _htOptionClone[i] = this._htOption[i];\n }\n\n this._oDrawing = new Drawing(this._el, _htOptionClone);\n\n if (this._htOption.text) {\n this.makeCode(this._htOption.text);\n }\n };\n /**\n * Make the QRCode\n *\n * @param {String} sText link data\n */\n\n\n QRCode.prototype.makeCode = function (sText) {\n this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption), this._htOption.correctLevel);\n\n this._oQRCode.addData(sText, this._htOption.binary, this._htOption.utf8WithoutBOM);\n\n this._oQRCode.make();\n\n if (this._htOption.tooltip) {\n this._el.title = sText;\n }\n\n this._oDrawing.draw(this._oQRCode); // this.makeImage();\n\n };\n /**\n * Make the Image from Canvas element\n * - It occurs automatically\n * - Android below 3 doesn't support Data-URI spec.\n *\n * @private\n */\n\n\n QRCode.prototype.makeImage = function () {\n if (typeof this._oDrawing.makeImage == 'function' && (!this._android || this._android >= 3)) {\n this._oDrawing.makeImage();\n }\n };\n /**\n * Clear the QRCode\n */\n\n\n QRCode.prototype.clear = function () {\n this._oDrawing.remove();\n };\n /**\n * Resize the QRCode\n */\n\n\n QRCode.prototype.resize = function (width, height) {\n this._oDrawing._htOption.width = width;\n this._oDrawing._htOption.height = height;\n\n this._oDrawing.draw(this._oQRCode);\n };\n /**\n * No Conflict\n * @return QRCode object\n */\n\n\n QRCode.prototype.noConflict = function () {\n if (root.QRCode === this) {\n root.QRCode = _QRCode;\n }\n\n return QRCode;\n };\n /**\n * @name QRCode.CorrectLevel\n */\n\n\n QRCode.CorrectLevel = QRErrorCorrectLevel;\n /*--------------------------------------------------------------------------*/\n // Export QRCode\n // AMD & CMD Compatibility\n\n if (typeof define == 'function' && (define.amd || define.cmd)) {\n // 1. Define an anonymous module\n define([], function () {\n return QRCode;\n });\n } // CommonJS Compatibility(include NodeJS)\n else if (freeModule) {\n // Node.js\n (freeModule.exports = QRCode).QRCode = QRCode; // Other CommonJS\n\n freeExports.QRCode = QRCode;\n } else {\n // Export Global\n root.QRCode = QRCode;\n }\n}", "function Decoder(bytes) {\n var decode=[];\n var string_bin=\"\";\n var tab_bin=[];\n var string_bin_elements=\"\"; \n var buffer=[];\n var i=0;\n var j=0;\n \n // Mise en forme de la payload propre à TTN\n for(i=0;i<bytes.length;i++){ // conversion d'hexa à binaire de tous les bytes puis regroupement sous un seul string\n string_bin_elements=bytes[i].toString(2);\n if(string_bin_elements.length<8){ // PadStart \n var nb_zeros=8-string_bin_elements.length;\n for (j=0;j<nb_zeros;j++){\n string_bin_elements=\"0\"+string_bin_elements;\n }\n }\n string_bin=string_bin+string_bin_elements;\n }\n \n var compte=0;\n for(i=0;i<2*bytes.length;i++){\n buffer[i]=\"\";\n for( j=0;j<4;j++){ // tableau contenant un hexa de la payload par adresse\n buffer[i]=buffer[i]+string_bin.charAt(compte);\n compte++;\n }\n buffer[i]=parseInt(buffer[i],2);\n }\n \n // Décodage\n var Insafe_Carbon_LoRa=0x7;\n \n switch(buffer[0]){\n case Insafe_Carbon_LoRa:\n decode[0]={\"Type_of_Product\":\"Insafe_Carbon_LoRa\"};\n break;\n }\n \n if (buffer[0]==Insafe_Carbon_LoRa){\n // On crée les différents tableaux correspondant à la taille de chaque data en terme de bits \n var tab_decodage_Real_Time=[4,4,8,8,8,3,4,3,3,3,3,2,3]; // Exemple: la 2ème information donc [1] est codée sur 4 bits\n var tab_decodage_Product_Status_Message=[4,4,2,1,3,2,8,8,6,4,5,5,6,6];\n var tab_decodage_Push=[4,4,3,3,2];\n var tab_decodage_Datalog=[4,4,8,8,8,8,8,8,8,8,8,4,3,1];\n var tab_decodage_Temperature_Alert=[4,4,8,1,1,3,3];\n var tab_decodage_CO2_Alert=[4,4,8,3,1,1,3];\n var tab_decodage_Config_CO2=[4,4,8,8,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8];\n var tab_decodage_Config_General=[4,4,1,1,1,1,1,1,1,1,8,8,8,8,8,8,8,8,2,6];\n var tab_decodage_Keepalive=[4,4];\n \n // On initialise les différents type de message pour les Carbon\n var Type_Real_Time= 0x2;\n var Type_Product_Status_Message=0x3;\n var Type_Push= 0x4;\n var Type_Datalog=0x5;\n var Type_Temperature_Alert=0x6;\n var Type_CO2_Alert=0x7;\n var Type_Config_CO2=0x8;\n var Type_Config_General=0x9;\n var Type_Keep_Alive=0xA;\n \n //Tous les indicateurs sont codés de la même manière pour coder plus efficacement on crée un tableau\n // qui contient tous ces adjectifs\n \n var tab_adjectif=[\"Excellent\",\"Good\",\"Fair\",\"Poor\",\"Bad\",\"Erreur\",\"All\",\"Dryness Indicator\",\"Mould Indicator\",\"Dust Mites Indicator\",\"CO\",\"CO2\"];\n \n // Avec buffer[1], on détermine le Type de Message\n switch(buffer[1]){\n case Type_Real_Time:\n tab_decode(tab_decodage_Real_Time); //(VOIR EN FIN DE PROGRAMME) On passe le tableau correspondant au message dans la fonction tab_decode, cette fonction renvoie tab_bin. \n decode[1]={\"Type_of_message\":\"Real_Time\"};\n decode[2]={\"CO2_concentration_(ppm)\": 20*tab_bin[2]};\n decode[3]={\"Temperature(°C)\": Math.round(0.2*tab_bin[3] * 10) / 10};\n decode[4]={\"Relative_Humidity_(%RH)\": 0.5*tab_bin[4]};\n decode[5]={\"IAQ_GLOBAL\":get_iaq(tab_bin[5])};\n decode[6]={\"IAQ_SRC\":get_iaq_SRC(tab_bin[6])};\n decode[7]={\"IAQ_CO2\":get_iaq(tab_bin[7])};\n decode[8]={\"IAQ_DRY\":get_iaq(tab_bin[8])};\n decode[9]={\"IAQ_MOULD\":get_iaq(tab_bin[9])};\n decode[10]={\"IAQ_DM\":get_iaq(tab_bin[10])};\n decode[11]={\"IAQ_HCI\":get_IAQ_HCI(tab_bin[11])};\n decode[12]={\"Frame_Index\":tab_bin[12]};\n break;\n \n case Type_Product_Status_Message:\n tab_decode(tab_decodage_Product_Status_Message);\n decode[1]={\"Type_of_message\":\"Product_Status_Message\"};\n decode[2]={\"Battery_level\":battery(tab_bin[2])};\n decode[3]={\"HW_Fault_mode\":hw_mode(tab_bin[3])};\n decode[4]={\"Frame_Index\":tab_bin[4]};\n decode[5]={\"Not_used\":\"\"};\n decode[6]={\"Product_hours_meter(per month)\":tab_bin[6]};\n decode[7]={\"CO2_autocalibration_value_(ppm)\": 20*tab_bin[7]};\n decode[8]={\"Product_RTC_date_since_2000 (in years)\": tab_bin[8]};\n decode[9]={\"Product_RTC_date__Month_of_the_year\":tab_bin[9]};\n decode[10]={\"Product_RTC_date__Day_of_the_month\":tab_bin[10]};\n decode[11]={\"Product_RTC_date_Hours_of_the_day\":tab_bin[11]};\n decode[12]={\"Product_RTC_date__Minutes_of_the_hour\":tab_bin[12]};\n decode[13]={\"Not_used\":\"\"};\n break;\n \n case Type_Push:\n tab_decode(tab_decodage_Push); \n decode[1]={\"Type_of_message\":\"Push\"};\n decode[2]={\"Push_Button_Action\": push_button(tab_bin[2])};\n decode[3]={\"Frame_Index\":tab_bin[3]};\n decode[4]={\"Not_used\":\"\"}\n break;\n \n case Type_Datalog:\n tab_decode(tab_decodage_Datalog); \n decode[1]={\"Type_of_message\":\"Datalog\"};\n decode[2]={\"CO2_concentration(ppm)_[n-2]\": 20*tab_bin[2]};\n decode[3]={\"Temperature(°C) [n-2]\": Math.round(0.2*tab_bin[3] * 10) / 10};\n decode[4]={\"Relative Humidity(%) [n-2]\": 0.5*tab_bin[4]};\n decode[5]={\"CO2_concentration(ppm)_[n-1]\": 20*tab_bin[5]};\n decode[6]={\"Temperature(°C) [n-1]\": Math.round(0.2*tab_bin[6] * 10) / 10};\n decode[7]={\"Relative Humidity(%) [n-1]\": 0.5*tab_bin[7]};\n decode[8]={\"CO2_concentration(ppm) [n]\": 20*tab_bin[8]};\n decode[9]={\"Temperature(°C) [n]\": Math.round(0.2*tab_bin[9] * 10) / 10};\n decode[10]={\"Relative Humidity(%) [n]\": 0.5*tab_bin[10]}; \n decode[11]={\"Time_between_measurements_in_minutes\": 10*tab_bin[11]};\n decode[12]={\"Frame_Index\":tab_bin[12]}; \n decode[13]={\"Not_used\":\"\"}; \n break;\n \n case Type_Temperature_Alert:\n tab_decode(tab_decodage_Temperature_Alert); \n decode[1]={\"Type_of_message\":\"Temperature_Alert\"};\n decode[2]={\"Temperature(°C)\": Math.round(0.2*tab_bin[2] * 10) / 10};\n decode[3]={\"Temperature threshold 1\":th(tab_bin[3])};\n decode[4]={\"Temperature threshold 2\":th(tab_bin[4])};\n decode[5]={\"Frame_Index\":tab_bin[5]}; \n decode[6]={\"Not_used\":\"\"}; \n break;\n \n case Type_CO2_Alert:\n tab_decode(tab_decodage_CO2_Alert); \n decode[1]={\"Type_of_message\":\"CO2_Alert\"};\n decode[2]={\"CO2_concentration(ppm)\": 20*tab_bin[2]};\n decode[3]={\"Frame_Index\":tab_bin[3]}; \n decode[4]={\"CO2_threshold_1\":th(tab_bin[4])};\n decode[5]={\"CO2_threshold_2\":th(tab_bin[5])};\n decode[6]={\"Not_used\":\"\"}; \n break;\n \n case Type_Config_CO2:\n tab_decode(tab_decodage_Config_CO2); \n decode[1]={\"Type_of_message\":\"Config_CO2\"};\n decode[2]={\"CO2_threshold_1\":20*tab_bin[2]};\n decode[3]={\"CO2_threshold_2\":20*tab_bin[3]};\n decode[4]={\"Smart Period 1 start at: (hour)\":0.5*tab_bin[4]};\n decode[5]={\"Smart Period 1 duration (hour)\":0.5*tab_bin[5]}; \n decode[6]={\"Smart Period 2 start at: (hour)\":0.5*tab_bin[6]};\n decode[7]={\"Smart Period 2 duration (hour)\":0.5*tab_bin[7]}; \n decode[8]={\"Smart Period 1\": active(tab_bin[8])};\n decode[9]={\"Smart Period 1 on Monday\": active(tab_bin[9])};\n decode[10]={\"Smart Period 1 on Tuesday\": active(tab_bin[10])};\n decode[11]={\"Smart Period 1 on Wednesday\": active(tab_bin[11])};\n decode[12]={\"Smart Period 1 on Thursday\": active(tab_bin[12])}; \n decode[13]={\"Smart Period 1 on Friday\": active(tab_bin[13])};\n decode[14]={\"Smart Period 1 on Saturday\": active(tab_bin[14])};\n decode[15]={\"Smart Period 1 on Sunday\": active(tab_bin[15])};\n decode[16]={\"Smart Period 2\": active(tab_bin[16])};\n decode[17]={\"Smart Period 2 on Monday\": active(tab_bin[17])};\n decode[18]={\"Smart Period 2 on Tuesday\": active(tab_bin[18])};\n decode[19]={\"Smart Period 2 on Wednesday\": active(tab_bin[19])};\n decode[20]={\"Smart Period 2 on Thursday\": active(tab_bin[20])}; \n decode[21]={\"Smart Period 2 on Friday\": active(tab_bin[21])};\n decode[22]={\"Smart Period 2 on Saturday\": active(tab_bin[22])};\n decode[23]={\"Smart Period 2 on Sunday\": active(tab_bin[23])}; \n decode[24]={\"Altitude\":50*tab_bin[24]}; \n \n break;\n \n case Type_Config_General:\n tab_decode(tab_decodage_Config_General); \n decode[1]={\"Type_of_message\":\"Config_General\"};\n decode[2]={\"LED blink\": active(tab_bin[2])};\n decode[3]={\"Button Notification\": active(tab_bin[3])}; \n decode[4]={\"Real-time data\": active(tab_bin[4])}; \n decode[5]={\"Datalog enable\": active(tab_bin[5])}; \n decode[6]={\"Temperature Alert\": active(tab_bin[6])}; \n decode[7]={\"CO2 Alert\": active(tab_bin[7])}; \n decode[8]={\"Keep Alive\": active(tab_bin[8])}; \n decode[9]={\"Orange_Led\":active(tab_bin[9])}; \n decode[10]={\"Period between measurements (CO2,temperature, humidity) (minutes)\": tab_bin[10]}; \n decode[11]={\"Datalog decimation factor(record only 1 on x samples)\":tab_bin[11]};\n decode[12]={\"Temperature alert threshold 1 (°C)\": 0.2*tab_bin[12]};\n decode[13]={\"Temperature alert threshold 2 (°C)\": 0.2*tab_bin[13]}; \n decode[14]={\"Temperature change leading to a real-time message transmission (°C)\": 0.1*tab_bin[14]}; \n decode[15]={\"Relative humidity change leading to a real-time message transmission (%RH)\": 0.5*tab_bin[15]}; \n decode[16]={\"CO2 concentration change leading to a realtime message transmission(ppm)\": 20*tab_bin[16]}; \n decode[17]={\"Keepalive period (h)\": tab_bin[17]}; \n decode[18]={\"NFC_status\":nfc_status(tab_bin[18])};\n decode[19]={\"Not_Used\":\"\"};\n break;\n \n case Type_Keep_Alive:\n decode[1]={\"Type_of_message\":\"Keep_Alive\"};\n break;\n }\n }\n \n var new_msg={payload:decode};\n return new_msg;\n \n function tab_decode (tab){ // on rentre en paramètre la table propre à chaque message \n var compteur=0;\n for ( i=0; i<tab.length;i++){ // tab.length nousdonne donc le nombre d'information à décoder pour ce message \n tab_bin[i]=\"\";\n for ( j=0; j<tab[i];j++){ // tab[i] nous donne le nombre de bits sur lequel est codée l'information i \n str1=string_bin.charAt(compteur); // compteur va aller de 0 jusqu'à la longueur de string_bin\n tab_bin[i]=tab_bin[i]+str1; // A la fin de ce deuxième for: tab_bin[i] sera composé de tab[i] bits \n compteur++;\n }\n // Problème si tab[i] bits est différent de 4 (ou 8) bits ca ne correspond à 1 (ou 2) hexa donc: ne pourra pas conrrectement convertir les binaires en hexa\n // Donc il faut qu'on fasse un bourrage de 0 grâce à padstart\n if (tab_bin[i].length>4){ // pour les données de tailles supérieures à 4 bits et inféireures ou égales à 8 bits\t\t\n //tab_bin[i]=tab_bin[i].padStart(8,'0');\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase(); // Puis on convertit les binaire en hexa (en string)\n tab_bin[i]=parseInt(tab_bin[i],16) ;//puis on convertit les string en int\t\n }\n else{ // pour les données de tailles inférieures ou égales à 4 bits\n //tab_bin[i]=tab_bin[i].padStart(4,'0');\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase();\n tab_bin[i]=parseInt(tab_bin[i], 16);\n }\n }\n }\n \n \n function get_iaq (a){\n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[0];\n break;\n case 1:\n result=tab_adjectif[1];\n break;\n case 2:\n result=tab_adjectif[2];\n break;\n case 3:\n result=tab_adjectif[3];\n break;\n case 4:\n result=tab_adjectif[4];\n break;\n case 5:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n function get_iaq_SRC(a){\n \n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[6];\n break;\n case 1:\n result=tab_adjectif[7];\n break;\n case 2:\n result=tab_adjectif[8];\n break;\n case 3:\n result=tab_adjectif[9];\n break;\n case 4:\n result=tab_adjectif[10];\n break;\n case 5:\n result=tab_adjectif[11];\n break;\n case 15:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n function get_IAQ_HCI(a){\n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[1];\n break;\n case 1:\n result=tab_adjectif[2];\n break;\n case 2:\n result=tab_adjectif[4];\n break;\n case 3:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n \n function tab_decode (tab){ // on rentre en paramètre la table propre à chaque message \n var compteur=0;\n for ( i=0; i<tab.length;i++){ // tab.length nousdonne donc le nombre d'information à décoder pour ce message \n tab_bin[i]=\"\";\n for ( j=0; j<tab[i];j++){ // tab[i] nous donne le nombre de bits sur lequel est codée l'information i \n str1=string_bin.charAt(compteur); // compteur va aller de 0 jusqu'à la longueur de string_bin\n tab_bin[i]=tab_bin[i]+str1; // A la fin de ce deuxième for: tab_bin[i] sera composé de tab[i] bits \n compteur++\n }\n \n // Problème si tab[i] bits est différent de 4 (ou 8) bits ca ne correspond à 1 (ou 2) hexa donc: ne pourra pas conrrectement convertir les binaires en hexa\n // Donc il faut qu'on fasse un bourrage de 0 grâce à padstart\n if (tab_bin[i].length>4){ // pour les données de tailles supérieures à 4 bits et inféireures ou égales à 8 bits\n var nb_zeros=8-tab_bin[i].length;\n for (j=0;j<nb_zeros;j++){\n tab_bin[i]=\"0\"+tab_bin[i];\n }\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase(); // Puis on convertit les binaire en hexa (en string)\n tab_bin[i]=parseInt(tab_bin[i],16) //puis on convertit les string en int\n }\t\n else{ // pour les données de tailles inférieures ou égales à 4 bits\n var nb_zeros=8-tab_bin[i].length;\n for (j=0;j<nb_zeros;j++){\n tab_bin[i]=\"0\"+tab_bin[i];\n }\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase();\n tab_bin[i]=parseInt(tab_bin[i], 16);\n }\n }\n return tab_bin; \n }\n \n \n function battery(a){\n result=\"\";\n switch(a){\n case 0:\n result=\"High\";\n break;\n case 1: \n result=\"Medium\";\n break;\n case 2: \n result=\"Critical\";\n break;\n }\n return result;\n }\n \n \n function hw_mode(a){\n result=\"\";\n switch(a){\n case 0:\n result=\" non activated\";\n break;\n case 1: \n result=\" activated\";\n break;\n }\n return result;\n }\n \n function push_button(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"Short Push\";\n break;\n \n case 1: \n result=\"Long Push\";\n break;\n \n case 2: \n result=\"Multiple Push(x3)\"; \n break;\n \n case 3: \n result=\"Multiple Push(x6)\"; \n break; \n }\n \n return result;\n }\n \n function th(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"not reached\";\n break;\n case 1: \n result=\"reached\";\n break;\n }\n return result;\n }\n \n function active(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"Non-Active\";\n break;\n case 1: \n result=\"Active\";\n }\n return result;\n }\n \n function nfc_status(a)\n {\n result=\"\";\n switch(a){\n case 0: \n result=\"Discoverable\";\n break;\n case 1: \n result=\"Not_Discoverable\";\n }\n return result;\n }\n \n msg.payload=decode;\n return msg;\n \n }", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n // string is greater than 55 bytes long. A single byte with the value (0xb7 plus the length of the length),\n // followed by the length, followed by the string\n llength = firstByte - 0xb6;\n if (input.length - 1 < llength) {\n throw new Error('invalid RLP: not enough bytes for string length');\n }\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n if (length <= 55) {\n throw new Error('invalid RLP: expected string length to be greater than 55');\n }\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP: not enough bytes for string');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n // string is greater than 55 bytes long. A single byte with the value (0xb7 plus the length of the length),\n // followed by the length, followed by the string\n llength = firstByte - 0xb6;\n if (input.length - 1 < llength) {\n throw new Error('invalid RLP: not enough bytes for string length');\n }\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n if (length <= 55) {\n throw new Error('invalid RLP: expected string length to be greater than 55');\n }\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP: not enough bytes for string');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function fromByteArray(uint8) {\n var i;\n var extraBytes = uint8.length % 3; // if we have 1 byte left, pad 2 bytes\n var output = '';\n var temp;\n var length;\n function encode(num) {\n return lookup.charAt(num);\n }\n function tripletToBase64(num) {\n return encode((num >> 18) & 0x3f) + encode((num >> 12) & 0x3f) + encode((num >> 6) & 0x3f) + encode(num & 0x3f);\n }\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];\n output += tripletToBase64(temp);\n }\n // pad the end with zeros, but make sure to not forget the extra bytes\n switch (extraBytes) {\n case 1:\n temp = uint8[uint8.length - 1];\n output += encode(temp >> 2);\n output += encode((temp << 4) & 0x3f);\n output += '==';\n break;\n case 2:\n temp = (uint8[uint8.length - 2] << 8) + uint8[uint8.length - 1];\n output += encode(temp >> 10);\n output += encode((temp >> 4) & 0x3f);\n output += encode((temp << 2) & 0x3f);\n output += '=';\n break;\n default:\n break;\n }\n return output;\n}", "function QRCodeDataBlockReader(blocks, version, numErrorCorrectionCode)\r\n{\r\n\tthis.blockPointer = 0;\r\n\tthis.bitPointer = 7;\r\n\tthis.dataLength = 0;\r\n\tthis.blocks = blocks;\r\n\tthis.numErrorCorrectionCode = numErrorCorrectionCode;\r\n\tif (version <= 9)\r\n\t\tthis.dataLengthMode = 0;\r\n\telse if (version >= 10 && version <= 26)\r\n\t\tthis.dataLengthMode = 1;\r\n\telse if (version >= 27 && version <= 40)\r\n\t\tthis.dataLengthMode = 2;\r\n\t\t\r\n\tthis.getNextBits = function( numBits)\r\n\t\t{\t\t\t\r\n\t\t\tvar bits = 0;\r\n\t\t\tif (numBits < this.bitPointer + 1)\r\n\t\t\t{\r\n\t\t\t\t// next word fits into current data block\r\n\t\t\t\tvar mask = 0;\r\n\t\t\t\tfor (var i = 0; i < numBits; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmask += (1 << i);\r\n\t\t\t\t}\r\n\t\t\t\tmask <<= (this.bitPointer - numBits + 1);\r\n\t\t\t\t\r\n\t\t\t\tbits = (this.blocks[this.blockPointer] & mask) >> (this.bitPointer - numBits + 1);\r\n\t\t\t\tthis.bitPointer -= numBits;\r\n\t\t\t\treturn bits;\r\n\t\t\t}\r\n\t\t\telse if (numBits < this.bitPointer + 1 + 8)\r\n\t\t\t{\r\n\t\t\t\t// next word crosses 2 data blocks\r\n\t\t\t\tvar mask1 = 0;\r\n\t\t\t\tfor (var i = 0; i < this.bitPointer + 1; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmask1 += (1 << i);\r\n\t\t\t\t}\r\n\t\t\t\tbits = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));\r\n this.blockPointer++;\r\n\t\t\t\tbits += ((this.blocks[this.blockPointer]) >> (8 - (numBits - (this.bitPointer + 1))));\r\n\t\t\t\t\r\n\t\t\t\tthis.bitPointer = this.bitPointer - numBits % 8;\r\n\t\t\t\tif (this.bitPointer < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.bitPointer = 8 + this.bitPointer;\r\n\t\t\t\t}\r\n\t\t\t\treturn bits;\r\n\t\t\t}\r\n\t\t\telse if (numBits < this.bitPointer + 1 + 16)\r\n\t\t\t{\r\n\t\t\t\t// next word crosses 3 data blocks\r\n\t\t\t\tvar mask1 = 0; // mask of first block\r\n\t\t\t\tvar mask3 = 0; // mask of 3rd block\r\n\t\t\t\t//bitPointer + 1 : number of bits of the 1st block\r\n\t\t\t\t//8 : number of the 2nd block (note that use already 8bits because next word uses 3 data blocks)\r\n\t\t\t\t//numBits - (bitPointer + 1 + 8) : number of bits of the 3rd block \r\n\t\t\t\tfor (var i = 0; i < this.bitPointer + 1; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmask1 += (1 << i);\r\n\t\t\t\t}\r\n\t\t\t\tvar bitsFirstBlock = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));\r\n\t\t\t\tthis.blockPointer++;\r\n\t\t\t\t\r\n\t\t\t\tvar bitsSecondBlock = this.blocks[this.blockPointer] << (numBits - (this.bitPointer + 1 + 8));\r\n\t\t\t\tthis.blockPointer++;\r\n\t\t\t\t\r\n\t\t\t\tfor (var i = 0; i < numBits - (this.bitPointer + 1 + 8); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmask3 += (1 << i);\r\n\t\t\t\t}\r\n\t\t\t\tmask3 <<= 8 - (numBits - (this.bitPointer + 1 + 8));\r\n\t\t\t\tvar bitsThirdBlock = (this.blocks[this.blockPointer] & mask3) >> (8 - (numBits - (this.bitPointer + 1 + 8)));\r\n\t\t\t\t\r\n\t\t\t\tbits = bitsFirstBlock + bitsSecondBlock + bitsThirdBlock;\r\n\t\t\t\tthis.bitPointer = this.bitPointer - (numBits - 8) % 8;\r\n\t\t\t\tif (this.bitPointer < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.bitPointer = 8 + this.bitPointer;\r\n\t\t\t\t}\r\n\t\t\t\treturn bits;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\tthis.NextMode=function()\r\n\t{\r\n\t\tif ((this.blockPointer > this.blocks.length - this.numErrorCorrectionCode - 2))\r\n\t\t\treturn 0;\r\n\t\telse\r\n\t\t\treturn this.getNextBits(4);\r\n\t}\r\n\tthis.getDataLength=function( modeIndicator)\r\n\t\t{\r\n\t\t\tvar index = 0;\r\n\t\t\twhile (true)\r\n\t\t\t{\r\n\t\t\t\tif ((modeIndicator >> index) == 1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index]);\r\n\t\t}\r\n\tthis.getRomanAndFigureString=function( dataLength)\r\n\t\t{\r\n\t\t\tvar length = dataLength;\r\n\t\t\tvar intData = 0;\r\n\t\t\tvar strData = \"\";\r\n\t\t\tvar tableRomanAndFigure = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':');\r\n\t\t\tdo \r\n\t\t\t{\r\n\t\t\t\tif (length > 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tintData = this.getNextBits(11);\r\n\t\t\t\t\tvar firstLetter = Math.floor(intData / 45);\r\n\t\t\t\t\tvar secondLetter = intData % 45;\r\n\t\t\t\t\tstrData += tableRomanAndFigure[firstLetter];\r\n\t\t\t\t\tstrData += tableRomanAndFigure[secondLetter];\r\n\t\t\t\t\tlength -= 2;\r\n\t\t\t\t}\r\n\t\t\t\telse if (length == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tintData = this.getNextBits(6);\r\n\t\t\t\t\tstrData += tableRomanAndFigure[intData];\r\n\t\t\t\t\tlength -= 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twhile (length > 0);\r\n\t\t\t\r\n\t\t\treturn strData;\r\n\t\t}\r\n\tthis.getFigureString=function( dataLength)\r\n\t\t{\r\n\t\t\tvar length = dataLength;\r\n\t\t\tvar intData = 0;\r\n\t\t\tvar strData = \"\";\r\n\t\t\tdo \r\n\t\t\t{\r\n\t\t\t\tif (length >= 3)\r\n\t\t\t\t{\r\n\t\t\t\t\tintData = this.getNextBits(10);\r\n\t\t\t\t\tif (intData < 100)\r\n\t\t\t\t\t\tstrData += \"0\";\r\n\t\t\t\t\tif (intData < 10)\r\n\t\t\t\t\t\tstrData += \"0\";\r\n\t\t\t\t\tlength -= 3;\r\n\t\t\t\t}\r\n\t\t\t\telse if (length == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tintData = this.getNextBits(7);\r\n\t\t\t\t\tif (intData < 10)\r\n\t\t\t\t\t\tstrData += \"0\";\r\n\t\t\t\t\tlength -= 2;\r\n\t\t\t\t}\r\n\t\t\t\telse if (length == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tintData = this.getNextBits(4);\r\n\t\t\t\t\tlength -= 1;\r\n\t\t\t\t}\r\n\t\t\t\tstrData += intData;\r\n\t\t\t}\r\n\t\t\twhile (length > 0);\r\n\t\t\t\r\n\t\t\treturn strData;\r\n\t\t}\r\n\tthis.get8bitByteArray=function( dataLength)\r\n\t\t{\r\n\t\t\tvar length = dataLength;\r\n\t\t\tvar intData = 0;\r\n\t\t\tvar output = new Array();\r\n\t\t\t\r\n\t\t\tdo \r\n\t\t\t{\r\n\t\t\t\tintData = this.getNextBits(8);\r\n\t\t\t\toutput.push( intData);\r\n\t\t\t\tlength--;\r\n\t\t\t}\r\n\t\t\twhile (length > 0);\r\n\t\t\treturn output;\r\n\t\t}\r\n this.getKanjiString=function( dataLength)\r\n\t\t{\r\n\t\t\tvar length = dataLength;\r\n\t\t\tvar intData = 0;\r\n\t\t\tvar unicodeString = \"\";\r\n\t\t\tdo \r\n\t\t\t{\r\n\t\t\t\tintData = getNextBits(13);\r\n\t\t\t\tvar lowerByte = intData % 0xC0;\r\n\t\t\t\tvar higherByte = intData / 0xC0;\r\n\t\t\t\t\r\n\t\t\t\tvar tempWord = (higherByte << 8) + lowerByte;\r\n\t\t\t\tvar shiftjisWord = 0;\r\n\t\t\t\tif (tempWord + 0x8140 <= 0x9FFC)\r\n\t\t\t\t{\r\n\t\t\t\t\t// between 8140 - 9FFC on Shift_JIS character set\r\n\t\t\t\t\tshiftjisWord = tempWord + 0x8140;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// between E040 - EBBF on Shift_JIS character set\r\n\t\t\t\t\tshiftjisWord = tempWord + 0xC140;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//var tempByte = new Array(0,0);\r\n\t\t\t\t//tempByte[0] = (sbyte) (shiftjisWord >> 8);\r\n\t\t\t\t//tempByte[1] = (sbyte) (shiftjisWord & 0xFF);\r\n\t\t\t\t//unicodeString += new String(SystemUtils.ToCharArray(SystemUtils.ToByteArray(tempByte)));\r\n unicodeString += String.fromCharCode(shiftjisWord);\r\n\t\t\t\tlength--;\r\n\t\t\t}\r\n\t\t\twhile (length > 0);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn unicodeString;\r\n\t\t}\r\n\r\n\tthis.__defineGetter__(\"DataByte\", function()\r\n\t{\r\n\t\tvar output = new Array();\r\n\t\tvar MODE_NUMBER = 1;\r\n\t var MODE_ROMAN_AND_NUMBER = 2;\r\n\t var MODE_8BIT_BYTE = 4;\r\n\t var MODE_KANJI = 8;\r\n\t\tdo \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar mode = this.NextMode();\r\n\t\t\t\t\t\t//canvas.println(\"mode: \" + mode);\r\n\t\t\t\t\t\tif (mode == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (output.length > 0)\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tthrow \"Empty data block\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (mode != 1 && mode != 2 && mode != 4 && mode != 8)\r\n\t\t\t\t\t\t//\tbreak;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\tif (mode != MODE_NUMBER && mode != MODE_ROMAN_AND_NUMBER && mode != MODE_8BIT_BYTE && mode != MODE_KANJI)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t/*\t\t\t\t\tcanvas.println(\"Invalid mode: \" + mode);\r\n\t\t\t\t\t\t\tmode = guessMode(mode);\r\n\t\t\t\t\t\t\tcanvas.println(\"Guessed mode: \" + mode); */\r\n\t\t\t\t\t\t\tthrow \"Invalid mode: \" + mode + \" in (block:\" + this.blockPointer + \" bit:\" + this.bitPointer + \")\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdataLength = this.getDataLength(mode);\r\n\t\t\t\t\t\tif (dataLength < 1)\r\n\t\t\t\t\t\t\tthrow \"Invalid data length: \" + dataLength;\r\n\t\t\t\t\t\t//canvas.println(\"length: \" + dataLength);\r\n\t\t\t\t\t\tswitch (mode)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase MODE_NUMBER: \r\n\t\t\t\t\t\t\t\t//canvas.println(\"Mode: Figure\");\r\n\t\t\t\t\t\t\t\tvar temp_str = this.getFigureString(dataLength);\r\n\t\t\t\t\t\t\t\tvar ta = new Array(temp_str.length);\r\n\t\t\t\t\t\t\t\tfor(var j=0;j<temp_str.length;j++)\r\n\t\t\t\t\t\t\t\t\tta[j]=temp_str.charCodeAt(j);\r\n\t\t\t\t\t\t\t\toutput.push(ta);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase MODE_ROMAN_AND_NUMBER: \r\n\t\t\t\t\t\t\t\t//canvas.println(\"Mode: Roman&Figure\");\r\n\t\t\t\t\t\t\t\tvar temp_str = this.getRomanAndFigureString(dataLength);\r\n\t\t\t\t\t\t\t\tvar ta = new Array(temp_str.length);\r\n\t\t\t\t\t\t\t\tfor(var j=0;j<temp_str.length;j++)\r\n\t\t\t\t\t\t\t\t\tta[j]=temp_str.charCodeAt(j);\r\n\t\t\t\t\t\t\t\toutput.push(ta );\r\n\t\t\t\t\t\t\t\t//output.Write(SystemUtils.ToByteArray(temp_sbyteArray2), 0, temp_sbyteArray2.Length);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase MODE_8BIT_BYTE: \r\n\t\t\t\t\t\t\t\t//canvas.println(\"Mode: 8bit Byte\");\r\n\t\t\t\t\t\t\t\t//sbyte[] temp_sbyteArray3;\r\n\t\t\t\t\t\t\t\tvar temp_sbyteArray3 = this.get8bitByteArray(dataLength);\r\n\t\t\t\t\t\t\t\toutput.push(temp_sbyteArray3);\r\n\t\t\t\t\t\t\t\t//output.Write(SystemUtils.ToByteArray(temp_sbyteArray3), 0, temp_sbyteArray3.Length);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase MODE_KANJI: \r\n\t\t\t\t\t\t\t\t//canvas.println(\"Mode: Kanji\");\r\n\t\t\t\t\t\t\t\t//sbyte[] temp_sbyteArray4;\r\n\t\t\t\t\t\t\t\t//temp_sbyteArray4 = SystemUtils.ToSByteArray(SystemUtils.ToByteArray(getKanjiString(dataLength)));\r\n\t\t\t\t\t\t\t\t//output.Write(SystemUtils.ToByteArray(temp_sbyteArray4), 0, temp_sbyteArray4.Length);\r\n var temp_str = this.getKanjiString(dataLength);\r\n\t\t\t\t\t\t\t\toutput.push(temp_str);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//\t\t\t\r\n\t\t\t\t\t\t//canvas.println(\"DataLength: \" + dataLength);\r\n\t\t\t\t\t\t//Console.out.println(dataString);\r\n\t\t\t\t\t}\r\n\t\t\t\t\twhile (true);\r\n\t\treturn output;\r\n\t});\r\n}", "function generateFrame(data, options) {\n\tvar MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC,\n\t\t'octet': MODE_OCTET};\n\tvar ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q,\n\t\t'H': ECCLEVEL_H};\n\n\toptions = options || {};\n\tvar ver = options.version || -1;\n\tvar ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()];\n\tvar mode = options.mode ? MODES[options.mode.toLowerCase()] : -1;\n\tvar mask = 'mask' in options ? options.mask : -1;\n\n\tif (mode < 0) {\n\t\tif (typeof data === 'string') {\n\t\t\tif (data.match(NUMERIC_REGEXP)) {\n\t\t\t\tmode = MODE_NUMERIC;\n\t\t\t} else if (data.match(ALPHANUMERIC_OUT_REGEXP)) {\n\t\t\t\t// while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode.\n\t\t\t\tmode = MODE_ALPHANUMERIC;\n\t\t\t} else {\n\t\t\t\tmode = MODE_OCTET;\n\t\t\t}\n\t\t} else {\n\t\t\tmode = MODE_OCTET;\n\t\t}\n\t} else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC ||\n\t\tmode == MODE_OCTET)) {\n\t\tthrow 'invalid or unsupported mode';\n\t}\n\n\tdata = validatedata(mode, data);\n\tif (data === null)\n\t\tthrow 'invalid data format';\n\n\tif (ecclevel < 0 || ecclevel > 3)\n\t\tthrow 'invalid ECC level';\n\n\tif (ver < 0) {\n\t\tfor (ver = 1; ver <= 40; ++ver) {\n\t\t\tif (data.length <= getmaxdatalen(ver, mode, ecclevel))\n\t\t\t\tbreak;\n\t\t}\n\t\tif (ver > 40)\n\t\t\tthrow 'too large data for the Qr format';\n\t} else if (ver < 1 || ver > 40) {\n\t\tthrow 'invalid Qr version! should be between 1 and 40';\n\t}\n\n\tif (mask != -1 && (mask < 0 || mask > 8))\n\t\tthrow 'invalid mask';\n\t//console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask )\n\treturn generate(data, ver, mode, ecclevel, mask);\n}", "function generateFrame(data, options) {\n\tvar MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC,\n\t\t'octet': MODE_OCTET};\n\tvar ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q,\n\t\t'H': ECCLEVEL_H};\n\n\toptions = options || {};\n\tvar ver = options.version || -1;\n\tvar ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()];\n\tvar mode = options.mode ? MODES[options.mode.toLowerCase()] : -1;\n\tvar mask = 'mask' in options ? options.mask : -1;\n\n\tif (mode < 0) {\n\t\tif (typeof data === 'string') {\n\t\t\tif (data.match(NUMERIC_REGEXP)) {\n\t\t\t\tmode = MODE_NUMERIC;\n\t\t\t} else if (data.match(ALPHANUMERIC_OUT_REGEXP)) {\n\t\t\t\t// while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode.\n\t\t\t\tmode = MODE_ALPHANUMERIC;\n\t\t\t} else {\n\t\t\t\tmode = MODE_OCTET;\n\t\t\t}\n\t\t} else {\n\t\t\tmode = MODE_OCTET;\n\t\t}\n\t} else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC ||\n\t\tmode == MODE_OCTET)) {\n\t\tthrow 'invalid or unsupported mode';\n\t}\n\n\tdata = validatedata(mode, data);\n\tif (data === null)\n\t\tthrow 'invalid data format';\n\n\tif (ecclevel < 0 || ecclevel > 3)\n\t\tthrow 'invalid ECC level';\n\n\tif (ver < 0) {\n\t\tfor (ver = 1; ver <= 40; ++ver) {\n\t\t\tif (data.length <= getmaxdatalen(ver, mode, ecclevel))\n\t\t\t\tbreak;\n\t\t}\n\t\tif (ver > 40)\n\t\t\tthrow 'too large data for the Qr format';\n\t} else if (ver < 1 || ver > 40) {\n\t\tthrow 'invalid Qr version! should be between 1 and 40';\n\t}\n\n\tif (mask != -1 && (mask < 0 || mask > 8))\n\t\tthrow 'invalid mask';\n\t//console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask )\n\treturn generate(data, ver, mode, ecclevel, mask);\n}", "function DT_DecoderDataResponse(decoderData, rawDecoderData, symbologyType, dlParsedObject) {\n\n // We recomend using the \"RAW\" Base64 data and decoding it with the built-in \"atob\" function\n \n // Now you can call processing functions to handle the barcode scanner data however you'd like.\n // var ActiveObject = document.activeElement;\n // ActiveObject.value = scanData;\n // scanData = atob(dlParsedObject);\n \n // Alert the user with a naitive iOS alert box of the scan data\n // DT_AlertBoxRequest(12345, 'Scan Data', 'first name: ' + dlParsedObject.firstName, ['OK']);\n\n // Check if we're in the survey section\n if (currentSurveySection == 'final') {\n scanCoupon(decoderData);\n } else {\n entryMethod = 'Barcode';\n fillFormFields(decoderData, rawDecoderData, null, null, symbologyType, dlParsedObject);\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n }", "function decode(t){let e=t.toLowerCase(),n=e.lastIndexOf(\"1\"),i=e.substring(0,n),r=e.substring(n+1,e.length-6),o=e.substring(e.length-6,e.length);if(!verify_checksum(i,bech32ToFiveBitArray(r+o)))throw\"Malformed request: checksum is incorrect\";return{human_readable_part:decodeHumanReadablePart(i),data:decodeData(r,i),checksum:o}}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "function _decode(input) {\n var length, llength, data, innerRemainder, d;\n var decoded = [];\n var firstByte = input[0];\n if (firstByte <= 0x7f) {\n // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n return {\n data: input.slice(0, 1),\n remainder: input.slice(1),\n };\n }\n else if (firstByte <= 0xb7) {\n // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n // The range of the first byte is [0x80, 0xb7]\n length = firstByte - 0x7f;\n // set 0x80 null to 0\n if (firstByte === 0x80) {\n data = Buffer.from([]);\n }\n else {\n data = input.slice(1, length);\n }\n if (length === 2 && data[0] < 0x80) {\n throw new Error('invalid rlp encoding: byte must be less 0x80');\n }\n return {\n data: data,\n remainder: input.slice(length),\n };\n }\n else if (firstByte <= 0xbf) {\n llength = firstByte - 0xb6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n data = input.slice(llength, length + llength);\n if (data.length < length) {\n throw new Error('invalid RLP');\n }\n return {\n data: data,\n remainder: input.slice(length + llength),\n };\n }\n else if (firstByte <= 0xf7) {\n // a list between 0-55 bytes long\n length = firstByte - 0xbf;\n innerRemainder = input.slice(1, length);\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(length),\n };\n }\n else {\n // a list over 55 bytes long\n llength = firstByte - 0xf6;\n length = safeParseInt(input.slice(1, llength).toString('hex'), 16);\n var totalLength = llength + length;\n if (totalLength > input.length) {\n throw new Error('invalid rlp: total length is larger than the data');\n }\n innerRemainder = input.slice(llength, totalLength);\n if (innerRemainder.length === 0) {\n throw new Error('invalid rlp, List has a invalid length');\n }\n while (innerRemainder.length) {\n d = _decode(innerRemainder);\n decoded.push(d.data);\n innerRemainder = d.remainder;\n }\n return {\n data: decoded,\n remainder: input.slice(totalLength),\n };\n }\n}", "_encodeQRCodeData(data) {\n try {\n const jsonString = JSON.stringify(data);\n return this._compressAndBase32Encode(jsonString);\n } catch (encodeJSONError) {\n console.error(encodeJSONError);\n throw new Error(\"Unable to create QR code (JSON encode error).\");\n }\n }", "function generateFrame(data, options) {\n var MODES = {\n 'numeric': MODE_NUMERIC,\n 'alphanumeric': MODE_ALPHANUMERIC,\n 'octet': MODE_OCTET\n };\n var ECCLEVELS = {\n 'L': ECCLEVEL_L,\n 'M': ECCLEVEL_M,\n 'Q': ECCLEVEL_Q,\n 'H': ECCLEVEL_H\n };\n options = options || {};\n var ver = options.version || -1;\n var ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()];\n var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1;\n var mask = 'mask' in options ? options.mask : -1;\n\n if (mode < 0) {\n if (typeof data === 'string') {\n if (data.match(NUMERIC_REGEXP)) {\n mode = MODE_NUMERIC;\n } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) {\n // while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode.\n mode = MODE_ALPHANUMERIC;\n } else {\n mode = MODE_OCTET;\n }\n } else {\n mode = MODE_OCTET;\n }\n } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC || mode == MODE_OCTET)) {\n throw 'invalid or unsupported mode';\n }\n\n data = validatedata(mode, data);\n if (data === null) throw 'invalid data format';\n if (ecclevel < 0 || ecclevel > 3) throw 'invalid ECC level';\n\n if (ver < 0) {\n for (ver = 1; ver <= 40; ++ver) {\n if (data.length <= getmaxdatalen(ver, mode, ecclevel)) break;\n }\n\n if (ver > 40) throw 'too large data for the Qr format';\n } else if (ver < 1 || ver > 40) {\n throw 'invalid Qr version! should be between 1 and 40';\n }\n\n if (mask != -1 && (mask < 0 || mask > 8)) throw 'invalid mask'; //console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask )\n\n return generate(data, ver, mode, ecclevel, mask);\n} // options", "function QR8bitByte(t){this.mode=QRMode.MODE_8BIT_BYTE,this.data=t}", "function QR() {\n var typeNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;\n var errorCorrectLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : errorCorrectLevel_1.ErrorCorrectLevel.L;\n\n _classCallCheck(this, QR);\n\n if (!numberHelper_1.NumberHelper.isInteger(typeNumber) || typeNumber < 0 || typeNumber > 40) {\n throw Error(\"The typeNumber parameter should be a number >= 0 and <= 40\");\n }\n\n this._typeNumber = typeNumber;\n this._errorCorrectLevel = errorCorrectLevel;\n this._qrData = [];\n this._moduleCount = 0;\n this._modules = [];\n mathHelper_1.MathHelper.initialize();\n }", "function QR8bitByte(data) {\n\tthis.mode = QRMode.MODE_8BIT_BYTE;\n\tthis.data = data;\n}", "function QR8bitByte(data) {\n this.mode = QRMode.MODE_8BIT_BYTE;\n this.data = data;\n }", "function decode(paddedInput) {\n // Remove up to last two equal signs.\n var input = paddedInput.replace(/==?$/, '');\n var outputLength = Math.floor((input.length / 4) * 3);\n // Prepare output buffer.\n var data = new ArrayBuffer(outputLength);\n var view = new Uint8Array(data);\n var cursor = 0;\n /**\n * Returns the next integer representation of a sixtet of bytes from the input\n * @returns sixtet of bytes\n */\n function nextSixtet() {\n var char = input.charAt(cursor++);\n var index = BASE64_CHARMAP.indexOf(char);\n if (index === -1) {\n throw new Error(\"Illegal character at \".concat(cursor, \": \").concat(input.charAt(cursor - 1)));\n }\n return index;\n }\n for (var i = 0; i < outputLength; i += 3) {\n // Obtain four sixtets\n var sx1 = nextSixtet();\n var sx2 = nextSixtet();\n var sx3 = nextSixtet();\n var sx4 = nextSixtet();\n // Encode them as three octets\n var oc1 = ((sx1 & 63) << 2) | (sx2 >> 4);\n var oc2 = ((sx2 & 15) << 4) | (sx3 >> 2);\n var oc3 = ((sx3 & 3) << 6) | (sx4 >> 0);\n view[i] = oc1;\n // Skip padding bytes.\n if (sx3 != 64)\n view[i + 1] = oc2;\n if (sx4 != 64)\n view[i + 2] = oc3;\n }\n return data;\n}", "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return String.fromCharCode.apply(this, arr);\n}", "function QRCodeDataBlockReader(e,t,n){this.blockPointer=0;this.bitPointer=7;this.dataLength=0;this.blocks=e;this.numErrorCorrectionCode=n;if(t<=9)this.dataLengthMode=0;else if(t>=10&&t<=26)this.dataLengthMode=1;else if(t>=27&&t<=40)this.dataLengthMode=2;this.getNextBits=function(e){var t=0;if(e<this.bitPointer+1){var n=0;for(var r=0;r<e;r++){n+=1<<r}n<<=this.bitPointer-e+1;t=(this.blocks[this.blockPointer]&n)>>this.bitPointer-e+1;this.bitPointer-=e;return t}else if(e<this.bitPointer+1+8){var i=0;for(var r=0;r<this.bitPointer+1;r++){i+=1<<r}t=(this.blocks[this.blockPointer]&i)<<e-(this.bitPointer+1);this.blockPointer++;t+=this.blocks[this.blockPointer]>>8-(e-(this.bitPointer+1));this.bitPointer=this.bitPointer-e%8;if(this.bitPointer<0){this.bitPointer=8+this.bitPointer}return t}else if(e<this.bitPointer+1+16){var i=0;var s=0;for(var r=0;r<this.bitPointer+1;r++){i+=1<<r}var o=(this.blocks[this.blockPointer]&i)<<e-(this.bitPointer+1);this.blockPointer++;var u=this.blocks[this.blockPointer]<<e-(this.bitPointer+1+8);this.blockPointer++;for(var r=0;r<e-(this.bitPointer+1+8);r++){s+=1<<r}s<<=8-(e-(this.bitPointer+1+8));var a=(this.blocks[this.blockPointer]&s)>>8-(e-(this.bitPointer+1+8));t=o+u+a;this.bitPointer=this.bitPointer-(e-8)%8;if(this.bitPointer<0){this.bitPointer=8+this.bitPointer}return t}else{return 0}};this.NextMode=function(){if(this.blockPointer>this.blocks.length-this.numErrorCorrectionCode-2)return 0;else return this.getNextBits(4)};this.getDataLength=function(e){var t=0;while(true){if(e>>t==1)break;t++}return this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][t])};this.getRomanAndFigureString=function(e){var t=e;var n=0;var r=\"\";var i=new Array(\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\" \",\"$\",\"%\",\"*\",\"+\",\"-\",\".\",\"/\",\":\");do{if(t>1){n=this.getNextBits(11);var s=Math.floor(n/45);var o=n%45;r+=i[s];r+=i[o];t-=2}else if(t==1){n=this.getNextBits(6);r+=i[n];t-=1}}while(t>0);return r};this.getFigureString=function(e){var t=e;var n=0;var r=\"\";do{if(t>=3){n=this.getNextBits(10);if(n<100)r+=\"0\";if(n<10)r+=\"0\";t-=3}else if(t==2){n=this.getNextBits(7);if(n<10)r+=\"0\";t-=2}else if(t==1){n=this.getNextBits(4);t-=1}r+=n}while(t>0);return r};this.get8bitByteArray=function(e){var t=e;var n=0;var r=new Array;do{n=this.getNextBits(8);r.push(n);t--}while(t>0);return r};this.getKanjiString=function(e){var t=e;var n=0;var r=\"\";do{n=getNextBits(13);var i=n%192;var s=n/192;var o=(s<<8)+i;var u=0;if(o+33088<=40956){u=o+33088}else{u=o+49472}r+=String.fromCharCode(u);t--}while(t>0);return r};this.__defineGetter__(\"DataByte\",function(){var e=new Array;var t=1;var n=2;var r=4;var i=8;do{var s=this.NextMode();if(s==0){if(e.length>0)break;else throw\"Empty data block\"}if(s!=t&&s!=n&&s!=r&&s!=i){throw\"Invalid mode: \"+s+\" in (block:\"+this.blockPointer+\" bit:\"+this.bitPointer+\")\"}dataLength=this.getDataLength(s);if(dataLength<1)throw\"Invalid data length: \"+dataLength;switch(s){case t:var o=this.getFigureString(dataLength);var u=new Array(o.length);for(var a=0;a<o.length;a++)u[a]=o.charCodeAt(a);e.push(u);break;case n:var o=this.getRomanAndFigureString(dataLength);var u=new Array(o.length);for(var a=0;a<o.length;a++)u[a]=o.charCodeAt(a);e.push(u);break;case r:var f=this.get8bitByteArray(dataLength);e.push(f);break;case i:var o=this.getKanjiString(dataLength);e.push(o);break}}while(true);return e})}", "function QRCodeDataBlockReader(blocks, version, numErrorCorrectionCode)\n{\n\tthis.blockPointer = 0;\n\tthis.bitPointer = 7;\n\tthis.dataLength = 0;\n\tthis.blocks = blocks;\n\tthis.numErrorCorrectionCode = numErrorCorrectionCode;\n\tif (version <= 9)\n\t\tthis.dataLengthMode = 0;\n\telse if (version >= 10 && version <= 26)\n\t\tthis.dataLengthMode = 1;\n\telse if (version >= 27 && version <= 40)\n\t\tthis.dataLengthMode = 2;\n\t\t\n\tthis.getNextBits = function( numBits)\n\t\t{\t\t\t\n\t\t\tvar bits = 0;\n\t\t\tif (numBits < this.bitPointer + 1)\n\t\t\t{\n\t\t\t\t// next word fits into current data block\n\t\t\t\tvar mask = 0;\n\t\t\t\tfor (var i = 0; i < numBits; i++)\n\t\t\t\t{\n\t\t\t\t\tmask += (1 << i);\n\t\t\t\t}\n\t\t\t\tmask <<= (this.bitPointer - numBits + 1);\n\t\t\t\t\n\t\t\t\tbits = (this.blocks[this.blockPointer] & mask) >> (this.bitPointer - numBits + 1);\n\t\t\t\tthis.bitPointer -= numBits;\n\t\t\t\treturn bits;\n\t\t\t}\n\t\t\telse if (numBits < this.bitPointer + 1 + 8)\n\t\t\t{\n\t\t\t\t// next word crosses 2 data blocks\n\t\t\t\tvar mask1 = 0;\n\t\t\t\tfor (var i = 0; i < this.bitPointer + 1; i++)\n\t\t\t\t{\n\t\t\t\t\tmask1 += (1 << i);\n\t\t\t\t}\n\t\t\t\tbits = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));\n this.blockPointer++;\n\t\t\t\tbits += ((this.blocks[this.blockPointer]) >> (8 - (numBits - (this.bitPointer + 1))));\n\t\t\t\t\n\t\t\t\tthis.bitPointer = this.bitPointer - numBits % 8;\n\t\t\t\tif (this.bitPointer < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.bitPointer = 8 + this.bitPointer;\n\t\t\t\t}\n\t\t\t\treturn bits;\n\t\t\t}\n\t\t\telse if (numBits < this.bitPointer + 1 + 16)\n\t\t\t{\n\t\t\t\t// next word crosses 3 data blocks\n\t\t\t\tvar mask1 = 0; // mask of first block\n\t\t\t\tvar mask3 = 0; // mask of 3rd block\n\t\t\t\t//bitPointer + 1 : number of bits of the 1st block\n\t\t\t\t//8 : number of the 2nd block (note that use already 8bits because next word uses 3 data blocks)\n\t\t\t\t//numBits - (bitPointer + 1 + 8) : number of bits of the 3rd block \n\t\t\t\tfor (var i = 0; i < this.bitPointer + 1; i++)\n\t\t\t\t{\n\t\t\t\t\tmask1 += (1 << i);\n\t\t\t\t}\n\t\t\t\tvar bitsFirstBlock = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));\n\t\t\t\tthis.blockPointer++;\n\t\t\t\t\n\t\t\t\tvar bitsSecondBlock = this.blocks[this.blockPointer] << (numBits - (this.bitPointer + 1 + 8));\n\t\t\t\tthis.blockPointer++;\n\t\t\t\t\n\t\t\t\tfor (var i = 0; i < numBits - (this.bitPointer + 1 + 8); i++)\n\t\t\t\t{\n\t\t\t\t\tmask3 += (1 << i);\n\t\t\t\t}\n\t\t\t\tmask3 <<= 8 - (numBits - (this.bitPointer + 1 + 8));\n\t\t\t\tvar bitsThirdBlock = (this.blocks[this.blockPointer] & mask3) >> (8 - (numBits - (this.bitPointer + 1 + 8)));\n\t\t\t\t\n\t\t\t\tbits = bitsFirstBlock + bitsSecondBlock + bitsThirdBlock;\n\t\t\t\tthis.bitPointer = this.bitPointer - (numBits - 8) % 8;\n\t\t\t\tif (this.bitPointer < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.bitPointer = 8 + this.bitPointer;\n\t\t\t\t}\n\t\t\t\treturn bits;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\tthis.NextMode=function()\n\t{\n\t\tif ((this.blockPointer > this.blocks.length - this.numErrorCorrectionCode - 2))\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn this.getNextBits(4);\n\t}\n\tthis.getDataLength=function( modeIndicator)\n\t\t{\n\t\t\tvar index = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif ((modeIndicator >> index) == 1)\n\t\t\t\t\tbreak;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\treturn this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index]);\n\t\t}\n\tthis.getRomanAndFigureString=function( dataLength)\n\t\t{\n\t\t\tvar length = dataLength;\n\t\t\tvar intData = 0;\n\t\t\tvar strData = \"\";\n\t\t\tvar tableRomanAndFigure = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':');\n\t\t\tdo \n\t\t\t{\n\t\t\t\tif (length > 1)\n\t\t\t\t{\n\t\t\t\t\tintData = this.getNextBits(11);\n\t\t\t\t\tvar firstLetter = Math.floor(intData / 45);\n\t\t\t\t\tvar secondLetter = intData % 45;\n\t\t\t\t\tstrData += tableRomanAndFigure[firstLetter];\n\t\t\t\t\tstrData += tableRomanAndFigure[secondLetter];\n\t\t\t\t\tlength -= 2;\n\t\t\t\t}\n\t\t\t\telse if (length == 1)\n\t\t\t\t{\n\t\t\t\t\tintData = this.getNextBits(6);\n\t\t\t\t\tstrData += tableRomanAndFigure[intData];\n\t\t\t\t\tlength -= 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (length > 0);\n\t\t\t\n\t\t\treturn strData;\n\t\t}\n\tthis.getFigureString=function( dataLength)\n\t\t{\n\t\t\tvar length = dataLength;\n\t\t\tvar intData = 0;\n\t\t\tvar strData = \"\";\n\t\t\tdo \n\t\t\t{\n\t\t\t\tif (length >= 3)\n\t\t\t\t{\n\t\t\t\t\tintData = this.getNextBits(10);\n\t\t\t\t\tif (intData < 100)\n\t\t\t\t\t\tstrData += \"0\";\n\t\t\t\t\tif (intData < 10)\n\t\t\t\t\t\tstrData += \"0\";\n\t\t\t\t\tlength -= 3;\n\t\t\t\t}\n\t\t\t\telse if (length == 2)\n\t\t\t\t{\n\t\t\t\t\tintData = this.getNextBits(7);\n\t\t\t\t\tif (intData < 10)\n\t\t\t\t\t\tstrData += \"0\";\n\t\t\t\t\tlength -= 2;\n\t\t\t\t}\n\t\t\t\telse if (length == 1)\n\t\t\t\t{\n\t\t\t\t\tintData = this.getNextBits(4);\n\t\t\t\t\tlength -= 1;\n\t\t\t\t}\n\t\t\t\tstrData += intData;\n\t\t\t}\n\t\t\twhile (length > 0);\n\t\t\t\n\t\t\treturn strData;\n\t\t}\n\tthis.get8bitByteArray=function( dataLength)\n\t\t{\n\t\t\tvar length = dataLength;\n\t\t\tvar intData = 0;\n\t\t\tvar output = new Array();\n\t\t\t\n\t\t\tdo \n\t\t\t{\n\t\t\t\tintData = this.getNextBits(8);\n\t\t\t\toutput.push( intData);\n\t\t\t\tlength--;\n\t\t\t}\n\t\t\twhile (length > 0);\n\t\t\treturn output;\n\t\t}\n this.getKanjiString=function( dataLength)\n\t\t{\n\t\t\tvar length = dataLength;\n\t\t\tvar intData = 0;\n\t\t\tvar unicodeString = \"\";\n\t\t\tdo \n\t\t\t{\n\t\t\t\tintData = this.getNextBits(13);\n\t\t\t\tvar lowerByte = intData % 0xC0;\n\t\t\t\tvar higherByte = intData / 0xC0;\n\t\t\t\t\n\t\t\t\tvar tempWord = (higherByte << 8) + lowerByte;\n\t\t\t\tvar shiftjisWord = 0;\n\t\t\t\tif (tempWord + 0x8140 <= 0x9FFC)\n\t\t\t\t{\n\t\t\t\t\t// between 8140 - 9FFC on Shift_JIS character set\n\t\t\t\t\tshiftjisWord = tempWord + 0x8140;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// between E040 - EBBF on Shift_JIS character set\n\t\t\t\t\tshiftjisWord = tempWord + 0xC140;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//var tempByte = new Array(0,0);\n\t\t\t\t//tempByte[0] = (sbyte) (shiftjisWord >> 8);\n\t\t\t\t//tempByte[1] = (sbyte) (shiftjisWord & 0xFF);\n\t\t\t\t//unicodeString += new String(SystemUtils.ToCharArray(SystemUtils.ToByteArray(tempByte)));\n unicodeString += String.fromCharCode(shiftjisWord);\n\t\t\t\tlength--;\n\t\t\t}\n\t\t\twhile (length > 0);\n\t\t\t\n\t\t\t\n\t\t\treturn unicodeString;\n\t\t}\n\n\tthis.parseECIValue = function ()\n\t{\n\t\tvar intData = 0;\n\t\tvar firstByte = this.getNextBits(8);\n\t\tif ((firstByte & 0x80) == 0) {\n\t\t\tintData = firstByte & 0x7F;\n\t\t}\n\t\tif ((firstByte & 0xC0) == 0x80) {\n\t\t\t// two bytes\n\t\t\tvar secondByte = this.getNextBits(8);\n\t\t\tintData = ((firstByte & 0x3F) << 8) | secondByte;\n\t\t}\n\t\tif ((firstByte & 0xE0) == 0xC0) {\n\t\t\t// three bytes\n\t\t\tvar secondThirdBytes = this.getNextBits(8);;\n\t\t\tintData = ((firstByte & 0x1F) << 16) | secondThirdBytes;\n\t\t}\n\t\treturn intData;\n\t}\n\n\tthis.__defineGetter__(\"DataByte\", function()\n\t{\n\t\tvar output = new Array();\n\t\tvar MODE_NUMBER = 1;\n\t var MODE_ROMAN_AND_NUMBER = 2;\n\t var MODE_8BIT_BYTE = 4;\n\t\tvar MODE_ECI = 7;\n\t var MODE_KANJI = 8;\n\t\tdo \n\t\t\t\t\t{\n\t\t\t\t\t\tvar mode = this.NextMode();\n\t\t\t\t\t\t//canvas.println(\"mode: \" + mode);\n\t\t\t\t\t\tif (mode == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (output.length > 0)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthrow \"Empty data block\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (mode != MODE_NUMBER && mode != MODE_ROMAN_AND_NUMBER && mode != MODE_8BIT_BYTE && mode != MODE_KANJI && mode != MODE_ECI)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow \"Invalid mode: \" + mode + \" in (block:\" + this.blockPointer + \" bit:\" + this.bitPointer + \")\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(mode == MODE_ECI)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar temp_sbyteArray3 = this.parseECIValue();\n\t\t\t\t\t\t\t//output.push(temp_sbyteArray3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\tvar dataLength = this.getDataLength(mode);\n\t\t\t\t\t\t\tif (dataLength < 1)\n\t\t\t\t\t\t\t\tthrow \"Invalid data length: \" + dataLength;\n\t\t\t\t\t\t\tswitch (mode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase MODE_NUMBER: \n\t\t\t\t\t\t\t\t\tvar temp_str = this.getFigureString(dataLength);\n\t\t\t\t\t\t\t\t\tvar ta = new Array(temp_str.length);\n\t\t\t\t\t\t\t\t\tfor(var j=0;j<temp_str.length;j++)\n\t\t\t\t\t\t\t\t\t\tta[j]=temp_str.charCodeAt(j);\n\t\t\t\t\t\t\t\t\toutput.push(ta);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase MODE_ROMAN_AND_NUMBER: \n\t\t\t\t\t\t\t\t\tvar temp_str = this.getRomanAndFigureString(dataLength);\n\t\t\t\t\t\t\t\t\tvar ta = new Array(temp_str.length);\n\t\t\t\t\t\t\t\t\tfor(var j=0;j<temp_str.length;j++)\n\t\t\t\t\t\t\t\t\t\tta[j]=temp_str.charCodeAt(j);\n\t\t\t\t\t\t\t\t\toutput.push(ta );\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase MODE_8BIT_BYTE: \n\t\t\t\t\t\t\t\t\tvar temp_sbyteArray3 = this.get8bitByteArray(dataLength);\n\t\t\t\t\t\t\t\t\toutput.push(temp_sbyteArray3);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase MODE_KANJI: \n\t\t\t\t\t\t\t\t\tvar temp_str = this.getKanjiString(dataLength);\n\t\t\t\t\t\t\t\t\toutput.push(temp_str);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twhile (true);\n\t\treturn output;\n\t});\n}", "theoryDecoding(tR){\n var root = this.rootName[(tR&0xf000)>>>12];\n var quality = this.qualityName[(tR&0x0f00)>>>8];\n var inv = this.inversionName[(tR&0x00f0)>>>4];\n var string = root;\n if( quality!= \"M\")\n string+=quality;\n if(inv != \"r\")\n string+= \" \"+inv;\n return string;\n }", "decideVersion(){\n var length = messageString.length;\n for(var i = 0; i < 40; i++){\n if(character_capacities[i] >= length){\n qrVersion = i + 1;\n break;\n }\n }\n }", "function decode(data) {\n var current = data.data;\n for (var i = data.encoding.length - 1; i >= 0; i--) {\n current = Decoder.decodeStep(current, data.encoding[i]);\n }\n return current;\n }", "function Decoder(bytes, port) {\n // Decode an uplink message from a buffer\n // (array) of bytes to an object of fields.\n var decoded = {};\n\n if (! (port === 3))\n return null;\n\n // see catena-message-port3-format.md\n // i is used as the index into the message. Start with the flag byte.\n // note that there's no discriminator.\n // test vectors are also available there.\n var i = 0;\n // fetch the bitmap.\n var flags = bytes[i++];\n\n if (flags & 0x1) {\n // set Vraw to a uint16, and increment pointer\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n // interpret uint16 as an int16 instead.\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n // scale and save in result.\n decoded.Vbat = Vraw / 4096.0;\n }\n\n if (flags & 0x2) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.VDD = Vraw / 4096.0;\n }\n\n if (flags & 0x4) {\n var iBoot = bytes[i];\n i += 1;\n decoded.boot = iBoot;\n }\n\n if (flags & 0x8) {\n // we have temp, pressure, RH\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\n if (tRaw & 0x8000)\n tRaw = -0x10000 + tRaw;\n i += 2;\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n\n decoded.t = tRaw / 256;\n decoded.rh = rhRaw / 65535.0 * 100;\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\n }\n\n if (flags & 0x10) {\n // we have light irradiance info\n var irradiance = {};\n decoded.irradiance = irradiance;\n\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.IR = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.White = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.UV = lightRaw;\n }\n\n if (flags & 0x20) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.Vbus = Vraw / 4096.0;\n }\n\n // at this point, decoded has the real values.\n return decoded;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function _decodePkcs7Data(data) {\n // handle special case of \"chunked\" data content: an octet string composed\n // of other octet strings\n if(data.composed || data.constructed) {\n var value = forge.util.createBuffer();\n for(var i = 0; i < data.value.length; ++i) {\n value.putBytes(data.value[i].value);\n }\n data.composed = data.constructed = false;\n data.value = value.getBytes();\n }\n return data;\n}", "function handleError(data) {\n console.log(uint8arrayToString(data));\n}", "function Bus_Phase(decoder_items) // 65001-65006\n{\n var str = \"\";\n switch (data_nb)\n {\n case 0 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 1 :\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Line-Line AC RMS Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"Line-Line Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 2 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 3 :\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Line-Neutral AC RMS Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"Line-Neutral Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 4 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 5 :\n {\n multi_byte_value += (hex_value<<8);\n multi_byte_value = Math.floor(multi_byte_value/128);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"AC Frequency : \" + multi_byte_value + \"Hz\");\n ScanaStudio.dec_item_add_content(multi_byte_value + \" kWh\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"AC Frequency : \" + multi_byte_value + \"Hz\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n default :\n {\n packet_title = \"Filled Data\";\n if (hex_value == 255)\n {\n item_content = \"Filled with 0xFF\";\n }\n else\n {\n item_content = \"0x\" + pad(hex_value.toString(16),2) + \", should be 0xFF\";\n types_title = ScanaStudio.PacketColors.Error.Title;\n types_content = ScanaStudio.PacketColors.Error.Content;\n }\n break;\n }\n }//end switch (data_nb)\n}//end function Bus_Phase_C", "function QrCode(\n // The version number of this QR Code, which is between 1 and 40 (inclusive).\n // This determines the size of this barcode.\n version,\n // The error correction level used in this QR Code.\n errorCorrectionLevel, dataCodewords, msk) {\n (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, QrCode);\n this.version = version;\n this.errorCorrectionLevel = errorCorrectionLevel;\n // The modules of this QR Code (false = light, true = dark).\n // Immutable after constructor finishes. Accessed through getModule().\n this.modules = [];\n // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n this.isFunction = [];\n // Check scalar arguments\n if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION) throw new RangeError('Version value out of range');\n if (msk < -1 || msk > 7) throw new RangeError('Mask value out of range');\n this.size = version * 4 + 17;\n // Initialize both grids to be size*size arrays of Boolean false\n var row = [];\n for (var i = 0; i < this.size; i++) row.push(false);\n for (var _i = 0; _i < this.size; _i++) {\n this.modules.push(row.slice()); // Initially all light\n this.isFunction.push(row.slice());\n }\n // Compute ECC, draw modules\n this.drawFunctionPatterns();\n var allCodewords = this.addEccAndInterleave(dataCodewords);\n this.drawCodewords(allCodewords);\n // Do masking\n if (msk == -1) {\n // Automatically choose best mask\n var minPenalty = 1000000000;\n for (var _i2 = 0; _i2 < 8; _i2++) {\n this.applyMask(_i2);\n this.drawFormatBits(_i2);\n var penalty = this.getPenaltyScore();\n if (penalty < minPenalty) {\n msk = _i2;\n minPenalty = penalty;\n }\n this.applyMask(_i2); // Undoes the mask due to XOR\n }\n }\n\n assert(0 <= msk && msk <= 7);\n this.mask = msk;\n this.applyMask(msk); // Apply the final choice of mask\n this.drawFormatBits(msk); // Overwrite old format bits\n this.isFunction = [];\n }", "function decode()\n{\n\tvar uartData;\n\tvar uartDataCnt = 0;\n\n\tif (!check_scanastudio_support())\n {\n add_to_err_log(\"Please update your ScanaStudio software to the latest version to use this decoder\");\n return;\n }\n\n\tPKT_COLOR_DATA = get_ch_light_color(ch);\n\tPKT_COLOR_GENER_TITLE = dark_colors.gray;\n\tPKT_COLOR_GPGGA_TITLE = dark_colors.blue;\n\tPKT_COLOR_GPGSA_TITLE = dark_colors.orange;\n\tPKT_COLOR_GPGSV_TITLE = dark_colors.green;\n\tPKT_COLOR_GPRMC_TITLE = dark_colors.violet;\n\n\tget_ui_vals();\n\t\n\tvar decBuf = pre_decode(\"uart.js\", \"ch = \" + ch + \";\"\n + \"baud = \" + baud + \";\"\n\t\t\t\t\t\t\t\t\t+ \"nbits = \" + 3 + \";\"\t\t// 8-bit word\n\t\t\t\t\t\t\t\t\t+ \"parity = \" + 0 + \";\"\t\t// no parity\n\t\t\t\t\t\t\t\t\t+ \"stop = \" + 0 + \";\" // 1 stop\n\t\t\t\t\t\t\t\t\t+ \"order = \" + 0 + \";\" // LSB first\n\t\t\t\t\t\t\t\t\t+ \"invert = \" + 0);\t\t\t// non inverted\n\n\twhile (decBuf.length > uartDataCnt)\n\t{\n\t\tuartData = decBuf[uartDataCnt];\n\t\tuartDataCnt++;\n\n\t\tif (uartData.data.length > 0)\n\t\t{\n\t\t\tif (String.fromCharCode(uartData.data) == \"$\")\n\t\t\t{\n\t\t\t\tvar msg = String.fromCharCode(uartData.data);\n\t\t\t\tvar stOfMsg = uartData.start_s, endOfMsg;\n\n\t\t\t\twhile ((String.fromCharCode(uartData.data) != \"\\r\") && (decBuf.length > uartDataCnt))\n\t\t\t\t{\n\t\t\t\t\tuartData = decBuf[uartDataCnt];\n\t\t\t\t\tuartDataCnt++;\n\n\t\t\t\t\tendOfMsg = uartData.end_s;\n\n\t\t\t\t\tif (uartData.data.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, uartData.data);\n\t\t\t\t\t\tmsg += String.fromCharCode(uartData.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar outMsgArr = msg.split(\",\");\n\t\t\t\tvar msgId = outMsgArr.shift();\n\t\t\t\tmsgId = msgId.slice(1);\n\n\t\t\t\tdec_item_new(ch, stOfMsg , endOfMsg);\n\t\t\t\tdec_item_add_pre_text(msg);\n\t\t\t\tdec_item_add_pre_text(msgId);\n\n\t\t\t\tpkt_start(\"NMEA 0183\");\n\n\t\t\t\tif (msgId == \"GPGGA\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPGGA_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tvar utc = outMsgArr.shift();\n\n\t\t\t\t\tif (utc.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tutc = utc.slice(0, 2) + \":\" + utc.slice(2, 4) + \":\" + utc.slice(4, 6) + \".\" + utc.slice(7, 10);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(utc, \"\", \"UTC TIME\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar latitude = outMsgArr.shift();\n\t\t\t\t\tvar ns = outMsgArr.shift();\n\n\t\t\t\t\tif (latitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlatitude = latitude.slice(0, 2) + \"°\" + latitude.slice(2, 4) + \"'\" + latitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(latitude, ns, \"LATITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar longitude = outMsgArr.shift();\n\t\t\t\t\tvar ew = outMsgArr.shift();\n\n\t\t\t\t\tif (longitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlongitude = longitude.slice(0, 2) + \"°\" + longitude.slice(2, 4) + \"'\" + longitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(longitude, ew, \"LONGITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar posFix = outMsgArr.shift();\n\t\t\t\t\tvar posFixStr;\n\n\t\t\t\t\tswitch (posFix)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"0\": posFixStr = \"Fix not available or invalid\"; break;\n\t\t\t\t\t\tcase \"1\": posFixStr = \"SPS Mode\"; break;\n\t\t\t\t\t\tcase \"2\": posFixStr = \"Diff SPS Mode\"; break;\n\t\t\t\t\t\tcase \"3\": posFixStr = \"PPS Mode\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(posFixStr, \"\", \"POS FIX IND\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar satNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"TOTAL SAT\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar hdop = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"HDOP\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar altitude = outMsgArr.shift();\n\t\t\t\t\tvar units = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(altitude, (\" \" + units), \"ALTITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar geoid = outMsgArr.shift();\n\t\t\t\t\tunits = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(geoid, (\" \" + units), \"GEOID SEP\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar ageDiff = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(ageDiff, \"\", \"AGE DIFF\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPGGA_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tif (msgId == \"GPGSV\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPGSV_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tvar numMsg = outMsgArr.shift();\t\t\t\t\t\n\t\t\t\t\tadd_pkt_data(numMsg, \"\", \"TOTAL MSG\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tvar msgNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(msgNum, \"\", \"MSG NUM\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tvar satNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"TOTAL SAT\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvar satId = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(satId, \"\", \"SAT ID\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar elevation = outMsgArr.shift();\t\t\t\t\t\t\n\t\t\t\t\t\tadd_pkt_data(elevation, \" deg\", \"ELEVATION\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar azimuth = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(azimuth, \" deg\", \"AZIMUTH\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar snr = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(azimuth, \" dB\", \"SNR\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t} while (outMsgArr.length > 0);\n\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPGSV_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tif (msgId == \"GPRMC\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPRMC_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar utc = outMsgArr.shift();\n\n\t\t\t\t\tif (utc.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tutc = utc.slice(0, 2) + \":\" + utc.slice(2, 4) + \":\" + utc.slice(4, 6) + \".\" + utc.slice(7, 10);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(utc, \"\", \"UTC TIME\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar stat = outMsgArr.shift();\n\n\t\t\t\t\tif (stat.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (stat == \"A\") \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstat = \"data valid\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (stat == \"V\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstat = \"data not valid\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstat = \"invalid arg\";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(stat, \"\", \"STATUS\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar latitude = outMsgArr.shift();\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ns = outMsgArr.shift();\n\n\t\t\t\t\tif (latitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlatitude = latitude.slice(0, 2) + \"°\" + latitude.slice(2, 4) + \"'\" + latitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(latitude, ns, \"LATITUDE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar longitude = outMsgArr.shift();\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ew = outMsgArr.shift();\n\n\t\t\t\t\tif (longitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlongitude = longitude.slice(0, 2) + \"°\" + longitude.slice(2, 4) + \"'\" + longitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(longitude, ew, \"LONGITUDE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar speed = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(speed, \" knots\", \"SPEED\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar course = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(course, \" deg\", \"COURSE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar date = outMsgArr.shift();\n\n\t\t\t\t\tif (date.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdate = date.slice(0, 2) + \"/\" + date.slice(2, 4) + \"/\" + date.slice(4, 6);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(date, \"\", \"DATE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar magVar = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(magVar, \" deg\", \"MAGN VAR\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ewInd = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(ewInd, \"\", \"E/W IND\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPRMC_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tpkt_end();\n\t\t\t}\n\t\t}\n\t}\n}", "function decodeBuffer(arrBuff) {\n\t\tlet u8arr = new Uint8Array(arrBuff);\n\t\t\n\t\tfunction byteToStr(byte) {\n\t\t\tlet str = byte.toString(2);\n\t\t\twhile (str.length < 8) {\n\t\t\t\tstr = \"0\" + str;\n\t\t\t}\n\t\t\treturn str;\n\t\t}\n\t\t\n\t\tlet headerLength = 4;\n\t\tlet treeBytes = \"\";\n\t\t\n\t\tfor (var i = 0; i < headerLength; i++) {\n\t\t\ttreeBytes += byteToStr(u8arr[i]);\n\t\t}\n\t\ttreeBytes = Number(\"0b\" + treeBytes);\n\t\t\n\t\tlet arrOff = headerLength;\n\t\tlet treeArr = new Uint8Array(treeBytes);\n\t\t\n\t\tfor (var i = 0; i < treeBytes; i++) {\n\t\t\ttreeArr[i] = u8arr[i + arrOff];\n\t\t}\n\t\t\n\t\tlet tree = decodeTree(treeArr);\n\t\t\n\t\tarrOff = headerLength + treeBytes;\n\t\tlet bitOff = u8arr[arrOff]\n\t\tarrOff++;\n\t\t\n\t\tlet codes = Object.create(null);\n\t\ttraverseTree(tree, function(tree, char, i, path) {\n\t\t\tcodes[path] = char;\n\t\t});\n\t\t\n\t\tlet path = \"\";\n\t\tlet body = \"\";\n\t\tfor (var i = arrOff; i < u8arr.length; i++) {\n\t\t\tlet str = byteToStr(u8arr[i]);\n\t\t\tlet end = 8;\n\t\t\tif (i === u8arr.length - 1) {\n\t\t\t\tend -= (8 - bitOff);\n\t\t\t\t//console.log(end);\n\t\t\t}\n\t\t\tfor (var j = 0; j < end; j++) {\n\t\t\t\tpath += str[j];\n\t\t\t\tif (codes[path]) {\n\t\t\t\t\tbody += codes[path];\n\t\t\t\t\tpath = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn body;\n\t}", "decode(buf) {\n function isHex(hex) {\n if ((hex >= 48 && hex <= 57) || (hex >= 65 && hex <= 70) || (hex >= 97 && hex <= 102)) {\n return true;\n }\n return false;\n }\n function getx(i, len, bufArg) {\n const ret = { char: null, nexti: i + 2, error: true };\n if (i + 1 < len) {\n if (isHex(bufArg[i]) && isHex(bufArg[i + 1])) {\n const str = String.fromCodePoint(bufArg[i], bufArg[i + 1]);\n ret.char = parseInt(str, 16);\n if (!Number.isNaN(ret.char)) {\n ret.error = false;\n }\n }\n }\n return ret;\n }\n function getu(i, len, bufArg) {\n const ret = { char: null, nexti: i + 4, error: true };\n if (i + 3 < len) {\n if (isHex(bufArg[i]) && isHex(bufArg[i + 1]) && isHex(bufArg[i + 2]) && isHex(bufArg[i + 3])) {\n const str = String.fromCodePoint(bufArg[i], bufArg[i + 1], bufArg[i + 2], bufArg[i + 3]);\n ret.char = parseInt(str, 16);\n if (!Number.isNaN(ret.char)) {\n ret.error = false;\n }\n }\n }\n return ret;\n }\n function getU(i, len, bufArg) {\n const ret = { char: null, nexti: i + 4, error: true };\n let str = '';\n while (i < len && isHex(bufArg[i])) {\n str += String.fromCodePoint(bufArg[i]);\n // eslint-disable-next-line no-param-reassign\n i += 1;\n }\n ret.char = parseInt(str, 16);\n if (bufArg[i] === 125 && !Number.isNaN(ret.char)) {\n ret.error = false;\n }\n ret.nexti = i + 1;\n return ret;\n }\n const chars = [];\n const len = buf.length;\n let i1;\n let ret;\n let error;\n let i = 0;\n while (i < len) {\n const TRUE = true;\n while (TRUE) {\n error = true;\n if (buf[i] !== 96) {\n /* unescaped character */\n chars.push(buf[i]);\n i += 1;\n error = false;\n break;\n }\n i1 = i + 1;\n if (i1 >= len) {\n break;\n }\n if (buf[i1] === 96) {\n /* escaped grave accent */\n chars.push(96);\n i += 2;\n error = false;\n break;\n }\n if (buf[i1] === 120) {\n ret = getx(i1 + 1, len, buf);\n if (ret.error) {\n break;\n }\n /* escaped hex */\n chars.push(ret.char);\n i = ret.nexti;\n error = false;\n break;\n }\n if (buf[i1] === 117) {\n if (buf[i1 + 1] === 123) {\n ret = getU(i1 + 2, len, buf);\n if (ret.error) {\n break;\n }\n /* escaped utf-32 */\n chars.push(ret.char);\n i = ret.nexti;\n error = false;\n break;\n }\n ret = getu(i1 + 1, len, buf);\n if (ret.error) {\n break;\n }\n /* escaped utf-16 */\n chars.push(ret.char);\n i = ret.nexti;\n error = false;\n break;\n }\n break;\n }\n if (error) {\n throw new Error(`escaped.decode: ill-formed escape sequence at buf[${i}]`);\n }\n }\n return chars;\n }", "function decode(data) {\n let built = \"\"\n for (let i = 0; i < data.length; i++) {\n built += String.fromCharCode(data[i])\n }\n return built\n }", "function getData (bytes) {\n\t\tif (bytes[0] & 1 << 7 === 0) {\n\t\t\treturn {\n\t\t\t\ttype: 'error',\n\t\t\t\tmessage: 'First byte is not status'\n\t\t\t};\n\t\t}\n\n\t\tvar channel = bytes[0] & 15;\n\n\t\tvar idx = (bytes[0] >> 4) & 7\n\t\tvar type = typeMap[idx];\n\n\t\tvar data = {};\n\t\tswitch (type) {\n\t\t\t// Note events\n\t\t\tcase 'noteOff':\n\t\t\tcase 'noteOn':\n\t\t\tcase 'afterTouch':\n\t\t\t\tdata.note = bytes[1] - 60;\n\t\t\t\tdata.value = bytes[2];\n\t\t\t\tbreak;\n\t\t\t// Controller events\n\t\t\tcase 'controllerChange':\n\t\t\t\tdata.controllerIndex = bytes[1];\n\t\t\t\tdata.value = bytes[2];\n\t\t\t\tvar name = controllerMap[bytes[1]];\n\t\t\t\tif (name) {\n\t\t\t\t\tdata.controllerName = name;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// Channel wide events\n\t\t\tcase 'programChange':\n\t\t\t\tdata.program = bytes[1];\n\t\t\t\tbreak;\n\t\t\tcase 'channelPressure':\n\t\t\t\tdata.value = bytes[1];\n\t\t\t\tbreak;\n\t\t\tcase 'pitchBend':\n\t\t\t\tdata.value = bytes[1] * 128 + bytes[2];\n\t\t}\n\t\treturn {\n\t\t\tchannel: channel,\n\t\t\ttype: type,\n\t\t\tdata: data\n\t\t};\n\t}", "decode(str){\n this.init()\n var end = str.length\n while(end>=0 && str.charAt(end-1)=='=') end--\n if(end<2) throw '·Invalid Base64 string at· ' + end\n var m = (end%4)\n if(m==1) throw '·Invalid Base64 string at· ' + (end-1)\n if(m>1) m--\n var n = 3*Math.floor(end/4) + m\n var blob = new Uint8Array(n)\n var control =[[2,4,1],[4,2,1],[6,0,2]]\n var left, right\n var k=0\n var c=0\n for(var i=0; i<n; i++){\n left = this.a2i[str.charAt(k)]\n right = this.a2i[str.charAt(k+1)]\n if(left===undefined || right===undefined) throw '·Invalid Base64 string at· ' + k\n blob[i] = (left << control[c][0]) |( right >> control[c][1])\n k+=control[c][2]\n c = (c+1)%3\n } \n return blob\n }", "function _decodePkcs7Data(data) {\n\t // handle special case of \"chunked\" data content: an octet string composed\n\t // of other octet strings\n\t if(data.composed || data.constructed) {\n\t var value = forge.util.createBuffer();\n\t for(var i = 0; i < data.value.length; ++i) {\n\t value.putBytes(data.value[i].value);\n\t }\n\t data.composed = data.constructed = false;\n\t data.value = value.getBytes();\n\t }\n\t return data;\n\t}", "function Rn(t, e) {\n return t.Bt ? e.toBase64() : e.toUint8Array();\n}", "function Decoder() {\n let string = 'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KLi0uICAgICAuICAgICAgIC4gICAgICAgICAgIC4gICAgICAgICAuICAgIA0KfC0uLS4gIC18Li0uICAuLXwuLS4tLi0uLi0uLS4tLi0sICAgICB8LS4tLg0KJy1gLScgICAnYC0nICBgLSdgLXwtYC1gJyAnICcgYCctICBvICBgLWAtfA0KICAgICAgICAgICAgICAgICAgJyAgICAgICAgICAgICAgICAgICAgYC0nDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQogIC4gIC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQouLXwuLXwtLiAuLS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQpgLSdgJ2AtJy1gLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQogICAgICAgICBgLScgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg';\n let decodedString = atob(string);\n console.log(decodedString);\n\n\n}", "getqr(req, res) {\n const url = req.body.url;\n if (url.length === 0) res.send(\"Empty Data!\");\n qr.toDataURL(url, (err, src) => {\n if (err) res.send(\"Error occured\");\n res.send(JSON.stringify(src));\n });\n }", "function onErrorMessageChanged(event) {\n let value = new Uint8Array(event.target.value.buffer);\n let utf8Decoder = new TextDecoder();\n let errorMessage = utf8Decoder.decode(value);\n console.log(\"Error message = \" + errorMessage);\n}", "function decodeStream ( binary ) {\n this.offset = 0;\n this.buf = binary;\n var self = this;\n\n this.remainingLength = function() {\n return self.buf.length - self.offset;\n };\n\n this.remainingData = function() {\n if (self.buf.length == self.offset) {\n return new Uint8Array(0);\n } else {\n return self.buf.slice(self.offset, self.buf.length);\n }\n };\n\n this.ensure = function( n ) {\n if (self.offset + n > self.buf.length) {\n throw \"incomplete_packet\";\n }\n };\n\n this.decodeVarint = function() {\n var multiplier = 1;\n var n = 0;\n var digits = 0;\n var digit;\n do {\n self.ensure(1);\n if (++digits > 4) {\n throw \"malformed\";\n }\n digit = self.buf[self.offset++];\n n += ((digit & 0x7F) * multiplier);\n multiplier *= 128;\n } while ((digit & 0x80) !== 0);\n return n;\n };\n\n this.decode1 = function() {\n self.ensure(1);\n return self.buf[self.offset++];\n };\n\n this.decodeUint16 = function() {\n self.ensure(2);\n var msb = self.buf[self.offset++];\n var lsb = self.buf[self.offset++];\n return (msb << 8) + lsb;\n };\n\n this.decodeUint32 = function() {\n self.ensure(4);\n var b1 = self.buf[self.offset++];\n var b2 = self.buf[self.offset++];\n var b3 = self.buf[self.offset++];\n var b4 = self.buf[self.offset++];\n return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;\n };\n\n this.decodeBin = function( length ) {\n if (length == 0) {\n return new Uint8Array(0);\n } else {\n self.ensure(length);\n var offs = self.offset;\n self.offset += length;\n return self.buf.slice(offs, self.offset);\n }\n };\n\n this.decodeUtf8 = function() {\n var length = self.decodeUint16();\n return UTF8ToString( self.decodeBin(length) );\n };\n\n this.decodeProperties = function() {\n if (self.remainingLength() == 0) {\n return {};\n }\n var len = self.decodeVarint();\n var end = self.offset + len;\n var props = {};\n while (self.offset < end) {\n var c = self.decode1();\n var p = PROPERTY_DECODE[c];\n if (p) {\n var v;\n var k = p[0];\n switch (p[1]) {\n case \"bool\":\n v = !!(self.decode1());\n break;\n case \"uint32\":\n v = self.decodeUint32();\n break;\n case \"uint16\":\n v = self.decodeUint16();\n break;\n case \"uint8\":\n v = self.decode1();\n break;\n case \"utf8\":\n v = self.decodeUtf8();\n break;\n case \"bin\":\n var count = self.decodeUint16();\n v = self.decodeBin(count);\n break;\n case \"varint\":\n v = self.decodeVarint();\n break;\n case \"user\":\n default:\n // User property\n k = self.decodeUtf8();\n v = self.decodeUtf8();\n break;\n }\n if (p[2]) {\n switch (typeof props[k]) {\n case 'undefined':\n props[k] = v;\n break;\n case 'object':\n // assume array\n props[k].push(v);\n break;\n default:\n props[k] = new Array(props[k], v);\n break;\n }\n } else {\n props[k] = v;\n }\n } else {\n throw \"Illegal property\";\n }\n }\n return props;\n };\n}", "decodeFunctionResult(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n let bytes = Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[/* arrayify */ \"a\"])(data);\n let reason = null;\n let errorArgs = null;\n let errorName = null;\n let errorSignature = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n }\n catch (error) { }\n break;\n case 4: {\n const selector = Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[/* hexlify */ \"i\"])(bytes.slice(0, 4));\n const builtin = BuiltinErrors[selector];\n if (builtin) {\n errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));\n errorName = builtin.name;\n errorSignature = builtin.signature;\n if (builtin.reason) {\n reason = errorArgs[0];\n }\n }\n else {\n try {\n const error = this.getError(selector);\n errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));\n errorName = error.name;\n errorSignature = error.format();\n }\n catch (error) {\n console.log(error);\n }\n }\n break;\n }\n }\n return logger.throwError(\"call revert exception\", _ethersproject_logger__WEBPACK_IMPORTED_MODULE_8__[/* Logger */ \"b\"].errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n errorArgs, errorName, errorSignature, reason\n });\n }", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function ReedSolomonDecoder(field)\r\n{\r\n\tthis.field = field;\r\n\tthis.decode=function(received, twoS)\r\n\t{\r\n\t\t\tvar poly = new GF256Poly(this.field, received);\r\n\t\t\tvar syndromeCoefficients = new Array(twoS);\r\n\t\t\tfor(var i=0;i<syndromeCoefficients.length;i++)syndromeCoefficients[i]=0;\r\n\t\t\tvar dataMatrix = false;//this.field.Equals(GF256.DATA_MATRIX_FIELD);\r\n\t\t\tvar noError = true;\r\n\t\t\tfor (var i = 0; i < twoS; i++)\r\n\t\t\t{\r\n\t\t\t\t// Thanks to sanfordsquires for this fix:\r\n\t\t\t\tvar eval = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));\r\n\t\t\t\tsyndromeCoefficients[syndromeCoefficients.length - 1 - i] = eval;\r\n\t\t\t\tif (eval != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tnoError = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (noError)\r\n\t\t\t{\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\tvar syndrome = new GF256Poly(this.field, syndromeCoefficients);\r\n\t\t\tvar sigmaOmega = this.runEuclideanAlgorithm(this.field.buildMonomial(twoS, 1), syndrome, twoS);\r\n\t\t\tvar sigma = sigmaOmega[0];\r\n\t\t\tvar omega = sigmaOmega[1];\r\n\t\t\tvar errorLocations = this.findErrorLocations(sigma);\r\n\t\t\tvar errorMagnitudes = this.findErrorMagnitudes(omega, errorLocations, dataMatrix);\r\n\t\t\tfor (var i = 0; i < errorLocations.length; i++)\r\n\t\t\t{\r\n\t\t\t\tvar position = received.length - 1 - this.field.log(errorLocations[i]);\r\n\t\t\t\tif (position < 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow \"ReedSolomonException Bad error location\";\r\n\t\t\t\t}\r\n\t\t\t\treceived[position] = GF256.addOrSubtract(received[position], errorMagnitudes[i]);\r\n\t\t\t}\r\n\t}\r\n\t\r\n\tthis.runEuclideanAlgorithm=function( a, b, R)\r\n\t\t{\r\n\t\t\t// Assume a's degree is >= b's\r\n\t\t\tif (a.Degree < b.Degree)\r\n\t\t\t{\r\n\t\t\t\tvar temp = a;\r\n\t\t\t\ta = b;\r\n\t\t\t\tb = temp;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar rLast = a;\r\n\t\t\tvar r = b;\r\n\t\t\tvar sLast = this.field.One;\r\n\t\t\tvar s = this.field.Zero;\r\n\t\t\tvar tLast = this.field.Zero;\r\n\t\t\tvar t = this.field.One;\r\n\t\t\t\r\n\t\t\t// Run Euclidean algorithm until r's degree is less than R/2\r\n\t\t\twhile (r.Degree >= Math.floor(R / 2))\r\n\t\t\t{\r\n\t\t\t\tvar rLastLast = rLast;\r\n\t\t\t\tvar sLastLast = sLast;\r\n\t\t\t\tvar tLastLast = tLast;\r\n\t\t\t\trLast = r;\r\n\t\t\t\tsLast = s;\r\n\t\t\t\ttLast = t;\r\n\t\t\t\t\r\n\t\t\t\t// Divide rLastLast by rLast, with quotient in q and remainder in r\r\n\t\t\t\tif (rLast.Zero)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Oops, Euclidean algorithm already terminated?\r\n\t\t\t\t\tthrow \"r_{i-1} was zero\";\r\n\t\t\t\t}\r\n\t\t\t\tr = rLastLast;\r\n\t\t\t\tvar q = this.field.Zero;\r\n\t\t\t\tvar denominatorLeadingTerm = rLast.getCoefficient(rLast.Degree);\r\n\t\t\t\tvar dltInverse = this.field.inverse(denominatorLeadingTerm);\r\n\t\t\t\twhile (r.Degree >= rLast.Degree && !r.Zero)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar degreeDiff = r.Degree - rLast.Degree;\r\n\t\t\t\t\tvar scale = this.field.multiply(r.getCoefficient(r.Degree), dltInverse);\r\n\t\t\t\t\tq = q.addOrSubtract(this.field.buildMonomial(degreeDiff, scale));\r\n\t\t\t\t\tr = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));\r\n\t\t\t\t\t//r.EXE();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ts = q.multiply1(sLast).addOrSubtract(sLastLast);\r\n\t\t\t\tt = q.multiply1(tLast).addOrSubtract(tLastLast);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar sigmaTildeAtZero = t.getCoefficient(0);\r\n\t\t\tif (sigmaTildeAtZero == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"ReedSolomonException sigmaTilde(0) was zero\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar inverse = this.field.inverse(sigmaTildeAtZero);\r\n\t\t\tvar sigma = t.multiply2(inverse);\r\n\t\t\tvar omega = r.multiply2(inverse);\r\n\t\t\treturn new Array(sigma, omega);\r\n\t\t}\r\n\tthis.findErrorLocations=function( errorLocator)\r\n\t\t{\r\n\t\t\t// This is a direct application of Chien's search\r\n\t\t\tvar numErrors = errorLocator.Degree;\r\n\t\t\tif (numErrors == 1)\r\n\t\t\t{\r\n\t\t\t\t// shortcut\r\n\t\t\t\treturn new Array(errorLocator.getCoefficient(1));\r\n\t\t\t}\r\n\t\t\tvar result = new Array(numErrors);\r\n\t\t\tvar e = 0;\r\n\t\t\tfor (var i = 1; i < 256 && e < numErrors; i++)\r\n\t\t\t{\r\n\t\t\t\tif (errorLocator.evaluateAt(i) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult[e] = this.field.inverse(i);\r\n\t\t\t\t\te++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (e != numErrors)\r\n\t\t\t{\r\n\t\t\t\tthrow \"Error locator degree does not match number of roots\";\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n\tthis.findErrorMagnitudes=function( errorEvaluator, errorLocations, dataMatrix)\r\n\t\t{\r\n\t\t\t// This is directly applying Forney's Formula\r\n\t\t\tvar s = errorLocations.length;\r\n\t\t\tvar result = new Array(s);\r\n\t\t\tfor (var i = 0; i < s; i++)\r\n\t\t\t{\r\n\t\t\t\tvar xiInverse = this.field.inverse(errorLocations[i]);\r\n\t\t\t\tvar denominator = 1;\r\n\t\t\t\tfor (var j = 0; j < s; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (i != j)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdenominator = this.field.multiply(denominator, GF256.addOrSubtract(1, this.field.multiply(errorLocations[j], xiInverse)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tresult[i] = this.field.multiply(errorEvaluator.evaluateAt(xiInverse), this.field.inverse(denominator));\r\n\t\t\t\t// Thanks to sanfordsquires for this fix:\r\n\t\t\t\tif (dataMatrix)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult[i] = this.field.multiply(result[i], xiInverse);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n}", "function qr(t) {\n return new si((function(n, i) {\n t.onsuccess = function(t) {\n var i = t.target.result;\n n(i);\n }, t.onerror = function(t) {\n var n = Qr(t.target.error);\n i(n);\n };\n }));\n}", "function qrPack() {\n var qr = lapack.qr(this.elements);\n\n return {\n\tQ: $M(qr.Q),\n\tR: $M(qr.R)\n };\n}", "function qrPack() {\n var qr = lapack.qr(this.elements);\n\n return {\n\tQ: $M(qr.Q),\n\tR: $M(qr.R)\n };\n}", "function qrPack() {\n var qr = lapack.qr(this.elements);\n\n return {\n\tQ: $M(qr.Q),\n\tR: $M(qr.R)\n };\n}", "function decode(data) {\n xmm.predictor.predict(data.slice(0, 8));\n const { likeliest } = xmm.predictor.results;\n $result.textContent = likeliest;\n}", "function decodeString(string) {\n var bytes = decode(string);\n var hash = bytes.slice(0, 21);\n var checksum = doubleSha256(hash);\n\n if (checksum[0] != bytes[21] ||\n checksum[1] != bytes[22] ||\n checksum[2] != bytes[23] ||\n checksum[3] != bytes[24]) {\n throw \"Checksum validation failed!\";\n }\n\n var version = hash.shift();\n\n if (version != 0) {\n throw \"Version \" + version + \" not supported!\";\n }\n\n return hash;\n}", "function decodeRLE(input) {\n let handlers = {\n onstart: (evt) => {},\n ondata: (evt) => {},\n onstop: (evt) => {},\n onerror: (evt, msg) => {},\n }\n\n let flushed = false\n let lenPos = 0, len = Buffer.alloc(3)\n let buffPos = -1, buff = Buffer.alloc(0)\n\n input.onstart = (evt) => { handlers.onstart(evt) }\n input.ondata = (evt) => {\n let currPos = 0, curr = Buffer.from(evt.data)\n\n for (; currPos < curr.byteLength; ) {\n if (lenPos < 3) {\n // Read the length of the payload.\n len[lenPos] = curr[currPos]\n lenPos++\n } else {\n // We just finished reading the length. Initialize the buffer for the\n // payload.\n if (buffPos == -1) {\n buffPos = 0\n buff = Buffer.alloc((65536*len[0]) + (256*len[1]) + len[2])\n }\n\n buff[buffPos] = curr[currPos]\n buffPos++\n\n // If we just read the last byte of the buffer, send the buffer down and\n // start over.\n if (buffPos == buff.byteLength) {\n handlers.ondata({data: buff})\n flushed = true\n lenPos = 0\n buffPos = -1\n }\n }\n\n currPos++\n }\n }\n input.onstop = (evt) => {\n if (isProbablyError(flushed, lenPos, len, buffPos, buff)) {\n handlers.onerror(\n new Error(\"server sent a text error message. (Message is displayed on page.)\"),\n Buffer.concat([len, buff.slice(0, buffPos)]),\n )\n } else if (lenPos > 0 || buffPos != -1) {\n handlers.onerror(new Error(\"stream stopped while in the middle of reading a chunk\"))\n }\n handlers.onstop(evt)\n }\n input.onerror = (evt, msg) => { handlers.onerror(evt, msg) }\n\n return handlers\n}", "text(text, size, { errorCorrectionLevel = 'M' } = {}) {\n const encodingHints = new Map();\n encodingHints.set(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel[errorCorrectionLevel]);\n const bitMatrix = this.writer.encode(text,\n BarcodeFormat.QR_CODE,\n size, // width\n size, // height\n encodingHints);\n const writable = bitMatrixToPngBuffer(bitMatrix);\n return writable;\n }", "detectBarcodes(image) {\n var that = this;\n return new Promise(function executorBCD(resolve, reject) {\n const what = that.getImageAsBase64(image);\n\n that._quagga.decodeSingle({\n src: what,\n numOfWorkers: 0, // Needs to be 0 when used within node\n locate: true,\n inputStream: {\n size: image.width > image.height ? image.width : image.height\n },\n decoder: {\n readers : [\n 'upc_reader', 'code_128_reader', 'code_39_reader',\n 'code_39_vin_reader', 'ean_8_reader', 'ean_reader',\n 'upc_e_reader', 'codabar_reader'\n ]\n },\n multiple: true,\n }, function(result) {\n var detectedBarcode = new Object;\n detectedBarcode.boundingBox = undefined;\n detectedBarcode.cornerPoints = [];\n if(result) {\n if (result.codeResult) {\n console.log('detected: ', result.codeResult.code);\n detectedBarcode.rawValue = result.codeResult.code;\n\n detectedBarcode.cornerPoints = [\n { x: result.boxes[0][0][0], y:result.boxes[0][0][1] },\n { x: result.boxes[0][1][0], y:result.boxes[0][1][1] },\n { x: result.boxes[0][2][0], y:result.boxes[0][2][1] },\n { x: result.boxes[0][3][0], y:result.boxes[0][3][1] }];\n }\n\n } else {\n console.error('no barcodes detected');\n }\n\n resolve( [detectedBarcode] );\n });\n\n });\n }", "function QRCodeDataBlockReader(blocks, version, numErrorCorrectionCode) {\n this.blockPointer = 0;\n this.bitPointer = 7;\n this.dataLength = 0;\n this.blocks = blocks;\n this.numErrorCorrectionCode = numErrorCorrectionCode;\n if (version <= 9) this.dataLengthMode = 0;else if (version >= 10 && version <= 26) this.dataLengthMode = 1;else if (version >= 27 && version <= 40) this.dataLengthMode = 2;\n }", "decodeAlectoV3(data, original_length) {\n let id = utils.bin2dec(data.slice(4, 12));\n let type = data.length === 40 ? 'TH' : 'R';\n /*\n There are multiple sensors that use the same protocol and similar encoding, but are\n slightly different:\n - Alecto WS-1100/WS-1200: has no sign bit; temperature value is 40 deg higher; has low battery bit (12)\n - Fine Offset WH2(A): has sign bit (12); has no low battery status\n */\n let results = [];\n let temperature = utils.bin2dec(data.slice(13, 24)) / 10;\n let humidity = Number(utils.bin2dec(data.slice(24, 32)));\n let sensor = (type === 'TH' ? 'WS-1100' : 'WS-1200');\n let FineOffset = original_length === 42;\n if (type === 'TH') {\n if (humidity === 255) {\n FineOffset = true;\n type = 'T';\n } else {\n // Note: not ideal to check the temperature value to see if it is FineOffset or not (bit 14)\n // FineOffset = FineOffset || (data[11] === '1' && data[14] === '0')\n FineOffset = 'maybe';\n }\n }\n if (FineOffset) {\n let sign = (data[12] === '1' ? -1 : 1);\n let result = {\n id: id,\n channel: Number(utils.bin2dec(data.slice(5, 8))) + 1,\n pid: 'fineoffset',\n name: 'WH2',\n data: { temperature: Number((sign * temperature).toFixed(1)) }\n };\n if (data.slice(9, 12) !== '111' && type !== 'T') {\n delete result.channel;\n result.name = 'WH2A';\n }\n if (type === 'TH') {\n result.data.humidity = humidity;\n }\n results.push(result);\n }\n if (!(FineOffset === true)) { // false or 'maybe'\n // Alecto\n let result = {\n id: id,\n channel: Number(utils.bin2dec(data.slice(2, 4))) + 1,\n name: sensor,\n data: { temperature: Number((-40 + temperature).toFixed(1)) }\n };\n if (type === 'TH') {\n result.data.humidity = humidity;\n } else { // Rain sensor (WS-1200)\n let rain = utils.bin2dec(data.slice(32, 40)) * 256 + utils.bin2dec(data.slice(24, 32));\n result.data.rainrate = rain * 0.3;\n }\n result.data.lowbattery = data[12] === '1';\n results.push(result);\n }\n\n return results;\n }", "decodePdu( encoded ) {\n\n let values = [];\n\n let index = 0;\n\n while( index < encoded.length ) {\n if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) {\n index++;\n\n if( encoded[index] === MSG_START_STUFF ){\n values.push( MSG_TOKEN_START );\n }\n else if( encoded[index] === MSG_ESC_STUFF ){\n values.push( MSG_TOKEN_ESC );\n }\n\n }\n else {\n values.push( encoded[index] );\n }\n\n index++;\n\n }\n\n return values;\n }", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "onReceive( packet)\n{\n let packet_view = new Uint8Array(packet);\n this.rxMsgArrayBuffer = appendArray(this.rxMsgArrayBuffer, packet_view);\n let view = new Uint8Array(this.rxMsgArrayBuffer);\n\n if (this.size_Of_request)\n {\n let data = new Uint8Array(this.size_Of_request);\n let offset = 0;\n for(let index = 0; index < view.byteLength; ++index)\n {\n switch(view[index])\n {\n case ESC:\n data[offset++] = this.xor_20(view[index]);\n break;\n\n case SOP:\n offset = 0;\n break;\n\n case EOP:\n break;\n\n default:\n data[offset++] = view[index];\n break;\n }\n }\n\n if (this.size_Of_request == offset)\n {\n //dumpArray(data);\n if (this.postCallback)\n this.postCallback(data);\n this.rxMsgArrayBuffer = new ArrayBuffer();\n\n }\n \n }\n}", "function ReedSolomonDecoder(field)\n{\n\tthis.field = field;\n\tthis.decode=function(received, twoS)\n\t{\n\t\t\tvar poly = new GF256Poly(this.field, received);\n\t\t\tvar syndromeCoefficients = new Array(twoS);\n\t\t\tfor(var i=0;i<syndromeCoefficients.length;i++)syndromeCoefficients[i]=0;\n\t\t\tvar dataMatrix = false;//this.field.Equals(GF256.DATA_MATRIX_FIELD);\n\t\t\tvar noError = true;\n\t\t\tfor (var i = 0; i < twoS; i++)\n\t\t\t{\n\t\t\t\t// Thanks to sanfordsquires for this fix:\n\t\t\t\tvar evalu = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));\n\t\t\t\tsyndromeCoefficients[syndromeCoefficients.length - 1 - i] = evalu;\n\t\t\t\tif (evalu != 0)\n\t\t\t\t{\n\t\t\t\t\tnoError = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (noError)\n\t\t\t{\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\tvar syndrome = new GF256Poly(this.field, syndromeCoefficients);\n\t\t\tvar sigmaOmega = this.runEuclideanAlgorithm(this.field.buildMonomial(twoS, 1), syndrome, twoS);\n\t\t\tvar sigma = sigmaOmega[0];\n\t\t\tvar omega = sigmaOmega[1];\n\t\t\tvar errorLocations = this.findErrorLocations(sigma);\n\t\t\tvar errorMagnitudes = this.findErrorMagnitudes(omega, errorLocations, dataMatrix);\n\t\t\tfor (var i = 0; i < errorLocations.length; i++)\n\t\t\t{\n\t\t\t\tvar position = received.length - 1 - this.field.log(errorLocations[i]);\n\t\t\t\tif (position < 0)\n\t\t\t\t{\n\t\t\t\t\tthrow \"ReedSolomonException Bad error location\";\n\t\t\t\t}\n\t\t\t\treceived[position] = GF256.addOrSubtract(received[position], errorMagnitudes[i]);\n\t\t\t}\n\t}\n\t\n\tthis.runEuclideanAlgorithm=function( a, b, R)\n\t\t{\n\t\t\t// Assume a's degree is >= b's\n\t\t\tif (a.Degree < b.Degree)\n\t\t\t{\n\t\t\t\tvar temp = a;\n\t\t\t\ta = b;\n\t\t\t\tb = temp;\n\t\t\t}\n\t\t\t\n\t\t\tvar rLast = a;\n\t\t\tvar r = b;\n\t\t\tvar sLast = this.field.One;\n\t\t\tvar s = this.field.Zero;\n\t\t\tvar tLast = this.field.Zero;\n\t\t\tvar t = this.field.One;\n\t\t\t\n\t\t\t// Run Euclidean algorithm until r's degree is less than R/2\n\t\t\twhile (r.Degree >= Math.floor(R / 2))\n\t\t\t{\n\t\t\t\tvar rLastLast = rLast;\n\t\t\t\tvar sLastLast = sLast;\n\t\t\t\tvar tLastLast = tLast;\n\t\t\t\trLast = r;\n\t\t\t\tsLast = s;\n\t\t\t\ttLast = t;\n\t\t\t\t\n\t\t\t\t// Divide rLastLast by rLast, with quotient in q and remainder in r\n\t\t\t\tif (rLast.Zero)\n\t\t\t\t{\n\t\t\t\t\t// Oops, Euclidean algorithm already terminated?\n\t\t\t\t\tthrow \"r_{i-1} was zero\";\n\t\t\t\t}\n\t\t\t\tr = rLastLast;\n\t\t\t\tvar q = this.field.Zero;\n\t\t\t\tvar denominatorLeadingTerm = rLast.getCoefficient(rLast.Degree);\n\t\t\t\tvar dltInverse = this.field.inverse(denominatorLeadingTerm);\n\t\t\t\twhile (r.Degree >= rLast.Degree && !r.Zero)\n\t\t\t\t{\n\t\t\t\t\tvar degreeDiff = r.Degree - rLast.Degree;\n\t\t\t\t\tvar scale = this.field.multiply(r.getCoefficient(r.Degree), dltInverse);\n\t\t\t\t\tq = q.addOrSubtract(this.field.buildMonomial(degreeDiff, scale));\n\t\t\t\t\tr = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));\n\t\t\t\t\t//r.EXE();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ts = q.multiply1(sLast).addOrSubtract(sLastLast);\n\t\t\t\tt = q.multiply1(tLast).addOrSubtract(tLastLast);\n\t\t\t}\n\t\t\t\n\t\t\tvar sigmaTildeAtZero = t.getCoefficient(0);\n\t\t\tif (sigmaTildeAtZero == 0)\n\t\t\t{\n\t\t\t\tthrow \"ReedSolomonException sigmaTilde(0) was zero\";\n\t\t\t}\n\t\t\t\n\t\t\tvar inverse = this.field.inverse(sigmaTildeAtZero);\n\t\t\tvar sigma = t.multiply2(inverse);\n\t\t\tvar omega = r.multiply2(inverse);\n\t\t\treturn new Array(sigma, omega);\n\t\t}\n\tthis.findErrorLocations=function( errorLocator)\n\t\t{\n\t\t\t// This is a direct application of Chien's search\n\t\t\tvar numErrors = errorLocator.Degree;\n\t\t\tif (numErrors == 1)\n\t\t\t{\n\t\t\t\t// shortcut\n\t\t\t\treturn new Array(errorLocator.getCoefficient(1));\n\t\t\t}\n\t\t\tvar result = new Array(numErrors);\n\t\t\tvar e = 0;\n\t\t\tfor (var i = 1; i < 256 && e < numErrors; i++)\n\t\t\t{\n\t\t\t\tif (errorLocator.evaluateAt(i) == 0)\n\t\t\t\t{\n\t\t\t\t\tresult[e] = this.field.inverse(i);\n\t\t\t\t\te++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (e != numErrors)\n\t\t\t{\n\t\t\t\tthrow \"Error locator degree does not match number of roots\";\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\tthis.findErrorMagnitudes=function( errorEvaluator, errorLocations, dataMatrix)\n\t\t{\n\t\t\t// This is directly applying Forney's Formula\n\t\t\tvar s = errorLocations.length;\n\t\t\tvar result = new Array(s);\n\t\t\tfor (var i = 0; i < s; i++)\n\t\t\t{\n\t\t\t\tvar xiInverse = this.field.inverse(errorLocations[i]);\n\t\t\t\tvar denominator = 1;\n\t\t\t\tfor (var j = 0; j < s; j++)\n\t\t\t\t{\n\t\t\t\t\tif (i != j)\n\t\t\t\t\t{\n\t\t\t\t\t\tdenominator = this.field.multiply(denominator, GF256.addOrSubtract(1, this.field.multiply(errorLocations[j], xiInverse)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult[i] = this.field.multiply(errorEvaluator.evaluateAt(xiInverse), this.field.inverse(denominator));\n\t\t\t\t// Thanks to sanfordsquires for this fix:\n\t\t\t\tif (dataMatrix)\n\t\t\t\t{\n\t\t\t\t\tresult[i] = this.field.multiply(result[i], xiInverse);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n}", "function getQRCode(text) {\n var pattern = /\\'otpauth.*?\\'/\n var match = pattern.exec(text);\n text = match[0];\n text = text.substring(1, text.length - 1);\n var qrcode = new QRCode(document.getElementById(\"qrCode\"), {\n width: 300,\n height: 300\n });\n return qrcode.makeCode(text);\n}", "function DecodeTrackData(/*uint8_t[]*/ Dest)\n{\n\tvar Raw = D.data;\n var /*uint16_t*/ p=0, r=0; // Offsets in data array\n while( p<Sz )\n {\n while (p < Sz && Raw[p] == 0x4e) p++; // Skip GAP1 or GAP3\n if (p >= Sz) break; // End of track or error\n while (p < Sz && Raw[p] == 0) p++; // Skip sync\n if (p >= Sz) return false; // Something wrong\n\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p >= Sz) return false; // Something wrong\n if (Raw[p++] != 0xfe)\n return false; // Marker not found\n\n var /*uint8_t*/ sectcyl, secthd, sectsec, sectno = 0;\n if (p < Sz) sectcyl = Raw[p++];\n if (p < Sz) secthd = Raw[p++];\n if (p < Sz) sectsec = Raw[p++];\n if (p < Sz) sectno = Raw[p++];\n if (p >= Sz) return false; // Something wrong\n\n var /*int*/ z;\t\t// Sector size\n if (sectno == 1) z = 256;\n else if (sectno == 2) z = 512;\n else if (sectno == 3) z = 1024;\n else return false; // Something wrong: unknown sector size\n // crc\n if (p < Sz) p++;\n if (p < Sz) p++;\n\n while (p < Sz && Raw[p] == 0x4e) p++; // Skip GAP2\n if (p >= Sz) return false; // Something wrong\n while (p < Sz && Raw[p] == 0x0) p++; // Skip sync\n if (p >= Sz) return false; // Something wrong\n\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p < Sz && Raw[p] == 0xa1) p++;\n if (p >= Sz) return false; // Something wrong\n if (Raw[p++] != 0xfb)\n return false; // Marker not found\n\n for (var c = 0; c < z; c++) // Copy sector data\n {\n if (r >= 5120) break; // End of track or error\n Dest[r++] = Raw[p++];\n if (p >= Sz)\n return false; // Something wrong\n }\n if (p >= Sz)\n return false; // Something wrong\n // crc\n if (p < Sz) p++;\n if (p < Sz) p++;\n }\n\n return true;\n}", "function getDecodedData() {\n return decoded_data;\n}", "detectQRCodes(image) {\n var that = this;\n return new Promise(function executorQRD(resolve, reject) {\n\n that._qrcode.callback = function(err, result) {\n var detectedBarcode = new Object;\n detectedBarcode.boundingBox = undefined;\n detectedBarcode.cornerPoints = [];\n if (err != null) {\n console.error('no qr codes detected: ' + err);\n } else {\n // |result.result| contains the decoded string, url or otherwise.\n console.log('qr detected: ', result.result);\n detectedBarcode.rawValue = result.result;\n\n if (result.points) {\n detectedBarcode.cornerPoints = [\n { x: result.points[0].X, y:result.points[0].Y },\n { x: result.points[1].X, y:result.points[1].Y },\n { x: result.points[2].X, y:result.points[2].Y },\n { x: result.points[3].X, y:result.points[3].Y }];\n }\n }\n resolve( [detectedBarcode] );\n };\n that._qrcode.decode(that.getImageAsBase64(image));\n });\n }", "function decode(data) {\n\tlet intext = false;\n\tlet bits = '';\n\n\tfor (let i = 0; i < data.length; i++) {\n\t\tif (intext) {\n\t\t\tif (data[i] == bit0)\n\t\t\t\tbits += bit0;\n\t\t\tif (data[i] == bit1)\n\t\t\t\tbits += bit1;\n\t\t\tconsole.log('bit'+bits + '| |' + bit1 + '| |' + bit0)\n\t\t}\n\n\t\tif (istext(data[i])) intext = true;\n\t\tif (iseol (data[i])) intext = false;\n\t}\n\treturn bits;\n}", "function decodeMessage(message) {\n const raw = message.raw;\n return base64_decode(raw);\n}", "extractCode(str) {\n //console.log((new Buffer(str, 'base64')))\n let res = {}, length;\n // move the data into a byte array\n let arr = str;\n res.partType = arr[0]; // should be one of the PART_COMBINATIONS values\n length = arr[1]; // length of the first key part\n let c = 2;\n res.part1 = arr.slice(c, c + length);\n c += length;\n length = arr[c]; // length of the second key part\n c += 1;\n res.part2 = arr.slice(c, c + length);\n let keylength = arr[c + length];\n c += length + 1;\n res.pad1 = arr.slice(c, c + keylength);\n c += keylength;\n res.pad2 = arr.slice(c, c + keylength);\n return res;\n }", "function decode()\n{\n\tget_ui_vals();\n\n\n\tif (typeof hex_opt === 'undefined')\n\t{\n\t\thex_opt = 0;\n\t}\n\n\n\n\tif (rate == 0)\n\t{\n\t\treturn;\n\t}\n\n\tspb = sample_rate / rate; \t\t// Calculate the number of Samples Per Bit.\n\n\ttry\n\t{\n\t\tspb_hs = sample_rate / high_rate;\n\t}\n\tcatch(e)\n\t{\n\t\tspb_hs = sample_rate / 2000000;\n\t}\n\n\tm = spb / 10; \t\t\t\t\t// Margin = 1 tenth of a bit time (expresed in number of samples)\n\tm_hs = spb_hs / 10;\n\n\tvar t = trs_get_first(ch);\n\n\tchannel_color = get_ch_light_color(ch);\n\n\twhile (trs_is_not_last(ch) && (stop == false))\n\t{\n\t if (abort_requested() == true)\t\t// Allow the user to abort this script\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (state)\n\t\t{\n\t\t\tcase GET_SOF:\n\n\t\t\t\twhile ((t.val != 0) && trs_is_not_last(ch))\t\t// Search for SOF\n\t\t\t\t{\n\t\t\t\t\tt = trs_get_next(ch);\n\t\t\t\t}\n\n\t\t\t\ts = t.sample + (spb * 0.5); \t\t// Position our reader on the middle of first bit\n\n\t\t\t\tbit_sampler_ini(ch,spb /2, spb); \t// Initialize the bit sampler (to be able tu use \"bit_sampler_next()\")\n\t\t\t\tbit_sampler_next(ch); \t\t\t\t// Read and skip the start bit\n\n\t\t\t\tdec_item_new(ch,t.sample,t.sample + spb - m); \t// Add the start bit item\n\t\t\t\tdec_item_add_pre_text(\"Start of Frame\");\n\t\t\t\tdec_item_add_pre_text(\"Start\");\n\t\t\t\tdec_item_add_pre_text(\"SOF\");\n\t\t\t\tdec_item_add_pre_text(\"S\");\n\n\t\t\t\tpkt_start(\"CAN\");\n\t\t\t\tpkt_add_item(-1, -1, \"SOF\", \"\", dark_colors.blue, channel_color);\n\n\t\t\t\tbits = [];\n\t\t\t\trb = 0;\n\t\t\t\tframe_length_in_sample = 0;\n\t\t\t\tb = 0; sb = 0;\n\t\t\t\tbit_pos = [];\n\t\t\t\tide_mode = false;\n\t\t\t\tdata_size = 0;\n\t\t\t\tbits.push(0); \t\t// Add the start bit to the bits table\n\t\t\t\tbit_pos.push(s); \t// Add its position\n\t\t\t\tb++;\n\t\t\t\trb++;\n\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\tlast_bit = 0;\n\t\t\t\tstate = GET_ID;\n\t\t\t\trtr_mode = false;\n\t\t\t\tide_mode = false;\n\t\t\t\tedl_mode = false;\n\t\t\t\tpotential_overload = true; \t// This *may* be the beginning of an overload frame\n\n\t\t\tbreak;\n\n\t\t\tcase GET_ID:\n\n\t\t\t\twhile (true) \t// Read bits until we break\n\t\t\t\t{\n\t\t\t\t\tif (abort_requested() == true)\t// Allow the user to abort this script\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(edl_mode && (((b==35)&&ide_mode) || ((b==16)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs); \t// use High speed since now\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\t\t\t\t\t\tif (stuffing_ok == false) break; \t// Break on the first stuffing error\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bit\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\n\n\t\t\t\t\tif(edl_mode && (((b==36)&&ide_mode) || ((b==17)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b == 14) && (bits[13] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tide_mode = true;\n\t\t\t\t\t\trtr_mode = false; \t// Reset rtr, will be checked at bit 32\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ide_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b == 33) && (bits[32] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 34) && (bits[33] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b == 13) && (bits[12] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 15) && (bits[14] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 41))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 22))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 39))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 19))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(edl_mode) //if it's CAN-FD\n\t\t\t\t{\n\t\t\t\t\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[14] - (0.5 * spb) + m, bit_pos[14] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[15] - (0.5 * spb) + m, bit_pos[15] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[16] - (0.5 * spb) + m, bit_pos[16] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb) + m, bit_pos[17] + (0.5 * spb) - m);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb_hs) + m_hs, bit_pos[17] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 18; c < 22; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb) + m, bit_pos[21] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb_hs) + m_hs, bit_pos[21] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[33] - (0.5 * spb) + m, bit_pos[33] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[34] - (0.5 * spb) + m, bit_pos[34] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[35] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[36] - (0.5 * spb_hs) + m_hs, bit_pos[36] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 37; c < 41; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb) + m, bit_pos[40] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb_hs) + m_hs, bit_pos[40] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m); \t// Add the IDE bit\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 15; c < 19; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[15] - (0.5 * spb) + m, bit_pos[18] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 35; c < 39; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[38] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rtr_mode == false)\n\t\t\t\t{\n\t\t\t\t\tstate = GET_DATA;\n\t\t\t\t}\n\t\t\t\telse\t// Skip the data in case of RTR frame\n\t\t\t\t{\n\t\t\t\t\tstate = GET_CRC;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase GET_DATA:\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\t\t\t\t}\n\n\t\t\t\twhile (db < (data_size * 8)) \t// Read data bits\n\t\t\t\t{\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bitif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t\tdb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\n\t\t\t\t}\n\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch,bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tb -= (data_size * 8);\t// Now interpret those bits as bytes\n\t\t\t\tpkt_data = \"\";\n\n\t\t\t\tfor (i = 0; i < data_size; i++)\n\t\t\t\t{\n\t\t\t\t\tval = 0;\n\n\t\t\t\t\tfor (c = 0; c < 8; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + (i * 8) + c];\n\t\t\t\t\t}\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb) + m, bit_pos[b + (i * 8) + 7] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb_hs) + m_hs, bit_pos[b + (i * 8) + 7] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"DATA: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D \");\n\t\t\t\t\tdec_item_add_data(val);\n\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\n\t\t\t\t\tpkt_data += int_to_str_hex(val) + \" \";\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\t\t\t\telse\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb_hs), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb_hs), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\n\t\t\t\tb += (data_size * 8);\n\t\t\t\tstate = GET_CRC;\n\n\t\t\t\t// TO DO:\n\t\t\t\t// correct all start and end samples\n\t\t\t\t// add packet for CRC, and error frames\n\t\t\t\t// add the packet stop\n\t\t\tbreak;\n\n\t\t\tcase GET_CRC:\n\t\t\t\tvar nbr_stf_b = 0;\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\n\t\t\t\t\twhile (db-nbr_stf_b < crc_len) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (db % 5 ==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_CROSS);\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t\tnbr_stf_b++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= crc_len;\n\n\t\t\t\t\tfor (c = 0; c < crc_len; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\n\t\t\t\t\tfor (c = 1; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> (crc_len)) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x3685B;\n\t\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x302898;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\tcrc_rg &= 0x1ffff;\n\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\tcrc_rg &= 0x1fffff\n\t\t\t\t\t}\n\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + crc_len-1] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += crc_len-1;\n\t\t\t\t\tbit_pos[b] += spb;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile (db < 16) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsb++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= 16;\n\n\t\t\t\t\tfor (c = 0; c < 15; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\t\t\t\t\tfor (c = 0; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> 14) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcrc_rg ^= 0x4599;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcrc_rg &= 0x7fff;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb) + m, bit_pos[b + 14] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + 14] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += 15;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase GET_ACK: \t// and the EOF too.\n\t\t\t\tbit_pos[b] -= spb;// CRC delimiter\n\t\t\t\tack_chk = bit_sampler_next(ch);\n\t\t\t\tbit_sampler_next(ch); \t// ACK delimiter\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (1.5 * spb) + m, bit_pos[b] + (3.5 * spb) - m); \t// Add the ACK item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (2.5 * spb_hs) + m, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m); \t// Add the ACK item\n\n\t\t\t\tif(ack_chk == 1)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"NO ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"NACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"!A\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"A\");\n\t\t\t\t}\n\t\t\t\tpkt_add_item(-1, -1, \"ACK\", ack_chk.toString(10), dark_colors.black, channel_color);\n\t\t\t\teof_chk = 0;\n\t\t\t\tfor (c = 0; c < 7; c++)\n\t\t\t\t{\n\t\t\t\t\teof_chk += bit_sampler_next(ch);\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (3.5 * spb) + m, bit_pos[b] + (10.5 * spb) - m); \t// Add the EOF item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m, bit_pos[b] + (2.5 * spb_hs) + 9*spb - m); \t// Add the EOF item\n\n\t\t\t\tif (eof_chk == 7)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF\");\n\t\t\t\t\tdec_item_add_pre_text(\"E\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\", \"\", dark_colors.blue, channel_color);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME ERR\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF ERR!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!EOF!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!E!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\",\"MISSING!\", dark_colors.red, channel_color);\n\t\t\t\t}\n\n\t\t\t\tpkt_end();\n\n\t\t\t\tt = trs_go_after(ch, bit_pos[b] + (10.5 * spb));\n\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\tstate = GET_SOF;\n\t\t\t\t//dec_item_new(ch, bit_pos[0] - (0.5 * spb) + m, bit_pos[b] + (0.5 * spb) - m); \t//<=========================DEBUG ALL THE FRAME\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function decodeImpl(bytes) {\n var pos = 0;\n var len = bytes.length;\n var out = [];\n var substrings = [];\n while (pos < len) {\n var byte1 = bytes[pos++];\n if (byte1 === 0) {\n break; // NULL\n }\n if ((byte1 & 0x80) === 0) { // 1-byte\n out.push(byte1);\n }\n else if ((byte1 & 0xe0) === 0xc0) { // 2-byte\n var byte2 = bytes[pos++] & 0x3f;\n out.push(((byte1 & 0x1f) << 6) | byte2);\n }\n else if ((byte1 & 0xf0) === 0xe0) {\n var byte2 = bytes[pos++] & 0x3f;\n var byte3 = bytes[pos++] & 0x3f;\n out.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n }\n else if ((byte1 & 0xf8) === 0xf0) {\n var byte2 = bytes[pos++] & 0x3f;\n var byte3 = bytes[pos++] & 0x3f;\n var byte4 = bytes[pos++] & 0x3f;\n // this can be > 0xffff, so possibly generate surrogates\n var codepoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (codepoint > 0xffff) {\n // codepoint &= ~0x10000;\n codepoint -= 0x10000;\n out.push((codepoint >>> 10) & 0x3ff | 0xd800);\n codepoint = 0xdc00 | codepoint & 0x3ff;\n }\n out.push(codepoint);\n }\n else {\n // FIXME: we're ignoring this\n }\n // As a workaround for https://github.com/samthor/fast-text-encoding/issues/1,\n // make sure the 'out' array never gets too long. When it reaches a limit, we\n // stringify what we have so far and append to a list of outputs.\n if (out.length > 1024) {\n substrings.push(String.fromCharCode.apply(null, out));\n out.length = 0;\n }\n }\n substrings.push(String.fromCharCode.apply(null, out));\n return substrings.join('');\n}", "function r(e){return e instanceof ArrayBuffer?a.default.resolve(e):e.toArrayBuffer?a.default.resolve(e.toArrayBuffer()):e.buffer?a.default.resolve(e.buffer):new a.default(function(t,n){var r=new FileReader;r.onload=function(){t(new Uint8Array(this.result))},r.onerror=n,r.readAsArrayBuffer(e)})}", "function initQrScanner(element){\n \tvar options = {\n DecodeQRCodeRate: 5,\n DecodeBarCodeRate: 5,\n successTimeout: 500,\n codeRepetition: true,\n tryVertical: true,\n frameRate: 15,\n width: 320,\n height: 480,\n constraints: {\n video: {\n mandatory: {\n maxWidth: 1280,\n maxHeight: 1280\n },\n optional: [{\n sourceId: true\n }]\n },\n audio: false\n },\n flipVertical: false,\n flipHorizontal: false,\n zoom: -1,\n decoderWorker: 'assets/webcodecamjs/js/DecoderWorker.js',\n brightness: 0,\n autoBrightnessValue: false,\n grayScale: false,\n contrast: 0,\n threshold: 0,\n sharpness: [],\n resultFunction: qrSuccess,\n cameraSuccess: function(stream) {\n console.log('cameraSuccess');\n },\n canPlayFunction: function() {\n console.log('canPlayFunction');\n },\n getDevicesError: function(error) {\n \tconsole.error('Error al encender la camara');\n },\n getUserMediaError: function(error) {\n \tconsole.error('Error al encender la camara');\n },\n cameraError: function(error) {\n \tconsole.error('Error al encender la camara');\n }\n };\n \tvar decoder = $(element).WebCodeCamJQuery(options).data().plugin_WebCodeCamJQuery;\n \tdecoder.init();\n \treturn decoder;\n }", "function decode(string) {\n\tvar buffer = base58.decode(string)\n\n\tvar message = buffer.slice(0, -4)\n\tvar checksum = buffer.slice(-4)\n\tvar newChecksum = sha256(message).slice(0, 4)\n\n\tassert.deepEqual(newChecksum, checksum)\n\n\tvar version = message.readUInt8(0)\n\tvar payload = message.slice(1)\n\n\treturn {\n\t\tversion : version,\n\t\tpayload : payload,\n\t\tchecksum : checksum\n\t}\n}", "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }" ]
[ "0.60470945", "0.6000193", "0.6000193", "0.6000193", "0.59892744", "0.5986568", "0.59758204", "0.5876389", "0.5847092", "0.58175814", "0.5387994", "0.5387994", "0.5336766", "0.5256566", "0.52518564", "0.52518564", "0.52463794", "0.52461064", "0.5236617", "0.5228752", "0.5228752", "0.5228752", "0.5228752", "0.5228752", "0.5228752", "0.5222879", "0.5220553", "0.52113175", "0.5180495", "0.51506996", "0.51475465", "0.5136348", "0.5116811", "0.5116811", "0.5116811", "0.5116811", "0.5101765", "0.5084434", "0.50603807", "0.5038156", "0.50107867", "0.5006328", "0.5005612", "0.5005612", "0.5005612", "0.5005612", "0.5005612", "0.5005612", "0.49818483", "0.49520993", "0.49514943", "0.49230662", "0.49130753", "0.4911477", "0.49058416", "0.49009335", "0.48972228", "0.48707408", "0.48624238", "0.48461157", "0.48283327", "0.48269653", "0.48102215", "0.47991556", "0.47966895", "0.47966895", "0.47966895", "0.47966895", "0.4765504", "0.47653732", "0.47628593", "0.47628593", "0.47628593", "0.47575906", "0.47518852", "0.4741821", "0.4740827", "0.4734953", "0.47247696", "0.47133657", "0.47005403", "0.47003075", "0.47003075", "0.47003075", "0.47003075", "0.46995664", "0.46912256", "0.46880618", "0.46807498", "0.4679688", "0.46742514", "0.466103", "0.4658282", "0.46566877", "0.465172", "0.46439627", "0.46247497", "0.46243134", "0.46183577", "0.460578" ]
0.65863824
0
Output the file creation details to the specified file
function outputFileCreationInfo(file) { // Add the build information and header to the output file ccdd.writeToFileLn(file, "# Created : " + ccdd.getDateAndTime() + "\n# User : " + ccdd.getUser() + "\n# Project : " + ccdd.getProject() + "\n# Script : " + ccdd.getScriptName()); // Check if any table is associated with the script if (ccdd.getTableNumRows() != 0) { ccdd.writeToFileLn(file, "# Table(s): " + [].slice.call(ccdd.getTableNames()).sort().join(",\n# ")); } // Check if any groups is associated with the script if (ccdd.getAssociatedGroupNames().length != 0) { ccdd.writeToFileLn(file, "# Group(s): " + [].slice.call(ccdd.getAssociatedGroupNames()).sort().join(",\n# ")); } ccdd.writeToFileLn(file, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputFileCreationInfo(file)\n{\n // Add the build information and header to the output file\n ccdd.writeToFileLn(file, \"/* Created : \" + ccdd.getDateAndTime() + \"\\n User : \" + ccdd.getUser() + \"\\n Project : \" + ccdd.getProject() + \"\\n Script : \" + ccdd.getScriptName());\n\n // Check if any table is associated with the script\n if (ccdd.getTableNumRows() != 0)\n {\n ccdd.writeToFileLn(file, \" Table(s): \" + [].slice.call(ccdd.getTableNames()).sort().join(\",\\n \"));\n }\n\n // Check if any groups is associated with the script\n if (ccdd.getAssociatedGroupNames().length != 0)\n {\n ccdd.writeToFileLn(file, \" Group(s): \" + [].slice.call(ccdd.getAssociatedGroupNames()).sort().join(\",\\n \"));\n }\n\n ccdd.writeToFileLn(file, \"*/\\n\");\n}", "function fileCreate(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log('Your readme has been generated!')\n});\n}", "function makeFile(info) {\n const { comment, upstream, config } = info\n return (\n `// ${comment}\\n` +\n '//\\n' +\n `// Auto-generated by ${packageJson.name}\\n` +\n `// based on rules from ${upstream}\\n` +\n '\\n' +\n '\"use strict\";\\n' +\n '\\n' +\n `module.exports = ${JSON.stringify(sortJson(config), null, 2)};\\n`\n )\n}", "function createFile() {\n const renderedHTML = render(teamMembers);\n fs.writeFileSync(outputPath, renderedHTML);\n}", "function OutFile() {\r\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "static txt ({ filepath, newFilepath, fileInfo }) {\n const info = '\\n\\nFile Info:\\n' +\n Object.keys(fileInfo)\n .map(k => `${k}: ${fileInfo[k]}`)\n .join('\\n')\n\n return fs.readFile(filepath)\n .then(file => fs.writeFile(newFilepath, file + info))\n }", "function createLog(){\n var a = \"log_\" + moment().format('YYMMDD-HHmm') + \".txt\";\n logName = a;\n fs.writeFile(a,\"Starting Log:\\n\",(err)=>{\n if(err) throw(err); \n });\n}", "function createFile() {\n var message = 'create file randomly',\n params = {\n message: message,\n committer: {\n name: 'yukihirai0505',\n email: '[email protected]'\n },\n content: Utilities.base64Encode(message)\n },\n data = fetchJson(FILE_URL.replace(FILE_PATH_PLACEHOLDER, getRandomString()), 'PUT', params);\n Logger.log(data);\n}", "create() {\n this.proc.args.file = null;\n\n this.emit('new-file');\n\n this.updateWindowTitle();\n }", "function createFile() {\n var e = new emitter();\n\n fs.readFile('newdocument.txt', function (err) {\n if (err) throw err;\n e.emit('theProcess');\n });\n\n return e;\n}", "function writeFile(fileEntry, dataObj) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n // If data object is not passed in,\n // create a new Blob instead.\n if (!dataObj) {\n dataObj = new Blob([], { type: 'text/plain' });\n }\n fileWriter.write(dataObj);\n fileWriter.onwriteend = function() {\n console.log(dataObj);\n };\n fileWriter.onerror = function (e) {\n console.log(\"Failed file write: \" + e.toString());\n };\n });\n }", "function writeFile(FPath, info, docName) {\n if ( $.os.search(/windows/i) !== -1 ) { // Detect line feed type\n fileLineFeed = \"Windows\";\n }\n else {\n fileLineFeed = \"Macintosh\";\n } \n try {\n var f = new File(FPath + \"/\" + docName + \".txt\");\n f.remove();\n f.open('a');\n f.lineFeed = fileLineFeed;\n f.write(info);\n f.close();\n }\n catch(e){}\n} //end function", "function writeFile(fileEntry, dataObj) {\n\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n\n // If data object is not passed in,\n // create a new Blob instead.\n if (!dataObj) {\n dataObj = new Blob(['Hello'], { type: 'text/plain' });\n }\n\n fileWriter.write(dataObj);\n\n fileWriter.onwriteend = function() {\n console.log(\"Successful file write...\");\n };\n\n fileWriter.onerror = function (e) {\n console.log(\"Failed file write: \" + e.toString());\n };\n\n });\n}", "function createNewFile() {\n file = {\n name: 'novo-arquivo.txt',\n content: '',\n saved: false,\n path: app.getPath('documents') + '/novo-arquivo.txt'\n }\n\n mainWindow.webContents.send('set-file', file)\n}", "function makeTheFile(name, data){\n fs.writeFile('README.md', data, (err) => {\n if (err){\n console.log(err);\n }\n console.log(\"README has been successfully generated.\")\n })\n }", "createFile() {\n try {\n fse.ensureDirSync(this.directory);\n } catch(e) {\n if ( e.code != 'EEXIST' ) throw e;\n }\n\n if (!utils.fileExists(this.file)) {\n fs.writeFileSync(this.file, this.serialize(this.defaultConfig));\n log.d('Created the default config file in ' + this.file);\n }\n }", "function createFile() {\r\n const iterator1 = stories[Symbol.iterator]();\r\n var combos = \"\";\r\n for (const item of iterator1) {\r\n combos = combos + item[0] + '\\n' + splitConstant + '\\n' + item[1] + '\\n' + splitConstant + '\\n';\r\n }\r\n var text = combos;\r\n var filename = 'stories.txt';\r\n var element = document.createElement('a');\r\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\r\n element.setAttribute('download', filename);\r\n element.style.display = 'none';\r\n document.body.appendChild(element);\r\n element.click();\r\n document.body.removeChild(element);\r\n}", "function writeToFile(fileName, createFile) {\n fs.writeFile(fileName, createFile, function (err) {\n if (err) {\n console.log(err);\n }\n console.log(\"Your README.md is created!\");\n });\n}", "function generateOutputFile(channel, member) {\n const fileName = `recordings/${channelid}-${member.username}-${Date.now()}.pcm`;\n console.log(fileName);\n return fs.createWriteStream(fileName);\n}", "function createFile(filePath, fileName, content) {\n fs.writeFile(filePath, content, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(`${fileName} was saved!`);\n });\n}", "function writeToFile(fileName, data) {\n\n fs.appendFile(\n fileName, \n generateMarkdown(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n fs.appendFile(\n fileName, \n generateLicense(data) ,\n function(err) {\n if(err) {\n return console.log(err);\n }\n \n console.log(\"Your README file is created successfully!\");\n })\n\n \n\n \n}", "function writeFile(fileEntry, dataObj) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n\n fileWriter.onwriteend = function() {\n console.log(\"Successful file write...\"+fileEntry.name);\n\t\t\t//alert(\"Successful file write...\"+fileEntry.name);\n\t\t\treturn true;\n };\n\n fileWriter.onerror = function(e) {\n console.log(\"Failed file write: \" + e.toString());\n\t\t\t//alert(\"Failed file write: \" + e.toString());\n\t\t\treturn false;\n };\n\n // If data object is not passed in, dont continue\n if (!dataObj) {\n\t\t\tconsole.log(\"writeFile() failed, no dataObj passed\");\n return false;\n }\n\n fileWriter.write(dataObj);\n });\n}", "function writeFile(name) {\n const ext = path.extname(name).substr(1);\n let data = config.headers[ext].join(\"\\n\");\n\n data += \"\\n\";\n if (config.endWithBlankline) {\n data += \"\\n\";\n }\n\n fs.writeFile(name, data, err => {\n if (!err && config.setExecutable) {\n fs.chmod(name, \"755\", err => {\n if (!err && config.symlink.create) {\n createSymlink(name);\n }\n });\n }\n });\n }", "open() {\n this.close()\n\n const file = path.normalize(this._filename)\n const opts = {\n flags: this._append ? 'a' : 'w',\n encoding: 'utf8',\n }\n\n ensureDirectoryExistence(file)\n this._writer = fs.createWriteStream(file, opts)\n }", "function writeToFile(filetype, data) {\n fs.writeFile(filetype, data, (err) =>\n err ? console.log(err) : console.log('Created your README!')\n )\n}", "function createTxtErrorFile(fileErrorString, rootFldr, numFiles, fileAction) {\n\n // various file strings\n var arrowEnd = \"<END>\\n\";\n var header_searchRoot = \"\\n\\n< --- ROOT SEARCH PATH --- >\\n\";\n var header_AIFiles = \"\\n\\n< --- AI FILE PATHS --- >\\n\";\n var dateHeader = \"< --- CREATED ON --- >\\n\" + new Date() + \"\\n<END>\" + \"\\n\";\n \n // creates file\n if(fileAction == \"create\"){\n // extracts folder location \n var reg = /[^\\\\]+$/g; //last folder sting in full path\n var folderLocation = rootFldr.fsName.match(reg).toString().replace(/( +)/, \"\");\n \n // create a text file to store all the file and artboard data\n file_errorsInFile = File(rootFldr + '/' + 'log_errorFiles_' + folderLocation + '.txt');\n file_errorsInFile.open(\"w\");\n file_errorsInFile.write(dateHeader); // writes date header string to file\n \n file_errorsInFile.write(header_searchRoot + rootFldr +\"\\n\" + arrowEnd); \n file_errorsInFile.write(header_AIFiles);\n } // end of create action\n \n // write errors to file\n if(fileAction == \"write\"){\n file_errorsInFile.writeln(fileErrorString);\n }// end of write action\n\n // close file\n if(fileAction == \"close\"){ \n file_errorsInFile.write(\n arrowEnd +\n \"\\n\\n< --- PROCESS DATA --- >\"\n + \"\\n\" + \"Total number of files that failed check = \" + numFiles\n + \"\\n\" + arrowEnd);\n file_errorsInFile.close();\n } // end of close action\n}", "function writeFile() {\n let overwrite = JSON.stringify(notes);\n fs.writeFile(outputPath, overwrite, function(err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"File written\");\n }\n });\n}", "function writeToFile(fileName, data) {\n // Project Title\n fs.writeFileSync(fileName, \"# \" + data.projectTitle + '\\n\\n');\n\n // Badge\n fs.appendFileSync(fileName, '![' + data.projectTitle + ']' + '(https://img.shields.io/github/repo-size/' + data.username + '/' + data.repoName + ')\\n\\n');\n\n // Table of Contents\n fs.appendFileSync(fileName, \"## Table of Contents\" + '\\n\\n' + \"* \" + data.tableOfContents.split(\" \").join(\"\\n* \") + '\\n\\n');\n\n // Description\n fs.appendFileSync(fileName, \"## Description\" + '\\n\\n' + data.description + '\\n\\n');\n\n // Installation\n fs.appendFileSync(fileName, \"## Installation\" + '\\n\\n' + data.installation + '\\n\\n');\n\n // Usage\n fs.appendFileSync(fileName, \"## Usage\" + '\\n\\n' + data.usage + '\\n\\n');\n\n // License\n fs.appendFileSync(fileName, \"## License\" + '\\n\\n' + data.license + '\\n\\n');\n\n // Contributing\n fs.appendFileSync(fileName, \"## Contributing\" + '\\n\\n' + data.contributing + '\\n\\n');\n\n // Tests\n fs.appendFileSync(fileName, \"## Tests\" + '\\n\\n' + data.tests + '\\n\\n');\n\n // Contact (Profile Picture and E-mail)\n fs.appendFileSync(fileName, \"## Contact\" + '\\n\\n' + '![Profile Picture](' + data.questionsPic + ')\\n\\nE-mail: ' + data.questionsEmail);\n\n console.log(\"Success!\");\n\n}", "function createFile(fullPathToFile, newFilePath, newFileName, newFileParentPath, timestamp, markAsPermanentlyNotRelevant) {\n\n //if this should be ignored due to the st-ignore.json file\n if(!ignoreThisFileOrDir(newFilePath)) {\n \n //create an id for this file\n var newFileId = \"fileId-\" + branchId + \"_\" + autoGeneratedFileId;\n \n //get the id ready for the next file/dir\n autoGeneratedFileId++;\n\n //create a new file object\n var newFile = {\n id: newFileId,\n parentId: getIdFromDirPath(newFileParentPath),\n currentName: newFileName,\n isDeleted: false\n };\n\n //add the file to the object of all files\n allFiles[newFileId] = newFile;\n\n //make a connection between the file path and an id \n addFilePathToIdMap(newFilePath, newFileId);\n \n //create a new empty 2D array to hold insert events for the default file\n allInsertEventsByFile[newFileId] = [];\n\n //create a new file event\n var createFileEvent = {\n id: \"ev_\" + branchId + \"_\" + autoGeneratedEventId, \n timestamp: timestamp,\n type: \"Create File\",\n initialName: newFileName,\n fileId: newFileId,\n parentDirectoryId: newFile.parentId,\n createdByDevGroupId: currentDeveloperGroup.id\n };\n \n //increase the id so the next event has a unique id\n autoGeneratedEventId++;\n \n //if the user wants to mark this file as NOT relevant (because it is an existing file\n //that is being reconciled in a new project)\n if(markAsPermanentlyNotRelevant === true) {\n\n //pre-mark the event as not even possible to become relevant\n createFileEvent.permanentRelevance = \"never relevant\";\n }\n\n //add the event to the collection of all events\n codeEvents.push(createFileEvent);\n\n //occassionally a new file has something in it, for example, if a tool has generated the file\n //if the file has anything in it, take the contents and make them events in the system\n\n //open the file and read the text\n var fileText = fs.readFileSync(fullPathToFile, \"utf8\");\n \n //if there is anything in the new file\n if(fileText !== \"\") {\n\n //add the text into \n insertText(newFilePath, fileText, 0, 0, false, [], new Date().getTime(), markAsPermanentlyNotRelevant);\n }\n }\t \n}", "createFile(path) {\n touch.sync(path.absolute);\n }", "function save_text(file_name,info_text) {\nif (!file_name) {save_text_count++; file_name = 'text' + save_text_count.toString() + '.txt';}\nvar fs = require('fs'); fs.write(file_name, info_text, 'w');}", "function writeFile() {\n const ERR_MESS_WRITE = \"TODO: Trouble writing file\";\n\n todocl.dbx.filesUpload({\n contents: todocl.todoText,\n path: todocl.path,\n mode: 'overwrite',\n autorename: false,\n mute: true\n }).then(function (response) {\n\n }).catch(function (error) {\n todocl.dbx.accessToken = null;\n todocl.out.innerHTML = ERR_MESS_WRITE;\n });\n }", "writeToFile () {\n let data = this.ghostToJson();\n\n fs.writeFileSync(this.ghostFileOutput, data, 'utf8');\n console.log( logSuccess('Ghost JSON generated successfully!') );\n }", "function writeToFile(fileName, data) { \n // console.log(\"Inside function\", fileName);\n fs.writeFile(fileName, data, function (err) {\n if (err) return console.log(err);\n console.log(`Generated ${fileName} succesfully !!`);\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(\"./Generator/\"+fileName, data, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log (\"Successfully wrote: \" + fileName);\n })\n \n}", "function generateFile (requests, options) {\n\t var options = options || {};\n\t var EOL = options.eol || \"\\r\\n\";\n\t var plateNumber = options.plateNumber || 1;\n\t var textFile = [];\n\n\t for (var request of requests) {\n\t var holder=getHolder(request.position, plateNumber);\n\t var experimentNumber=getExperimentNumber(request.position);\n\t if (options.deleteExistingHolder) {\n\t textFile.push(\"USER \"+request.user);\n\t textFile.push(\"HOLDER \"+holder);\n\t textFile.push(\"DELETE\"); // this is required to delete already existing entries\n\t }\n\t textFile.push(\"USER \"+request.user);\n\t textFile.push(\"HOLDER \"+holder);\n\t if (! options.autosubmit) textFile.push(\"NO_SUBMIT\");\n\t textFile.push(\"NAME \"+request.name);\n\t textFile.push(\"TITLE \"+request.title);\n\t for (var experiment of request.experiments) {\n\t textFile.push(\"EXPNO \"+experimentNumber++);\n\t textFile.push(\"SOLVENT \"+experiment.solvent);\n\t textFile.push(\"EXPERIMENT \"+experiment.experiment);\n\t if (experiment.parameters && experiment.parameters.length>0) {\n\t var parameters=[];\n\t for (var parameter of experiment.parameters) {\n\t parameters.push(parameter.label, parameter.value);\n\t }\n\t textFile.push(\"PARAMETERS \"+parameters.join(','));\n\t }\n\t }\n\t textFile.push(\"\");\n\t }\n\t return textFile.join(EOL);\n\t}", "function createHtmlFile(html) {\n\t// write HTML file into the dist folder\n\tfs.writeFile('dist/index.html', `${html}`, (err) => {\n\t\terr ? console.log(err) : console.log('Your HTML Document Was Successfully Generated!');\n\t});\n}", "function writeToFile( data) {\n fs.writeFile(\"./generated-files/README.md\",generateMarkdown(data), err =>{\n if(err){\n throw err;\n }\n console.log(\"file generated!\")\n })\n}", "function createFile(filename, content) {\n if (existsSync(filename)) return console.log(filename + ' already exists - exiting');\n const data = new Uint8Array(Buffer.from(content));\n writeFile(filename, data, (err) => {\n if (err) throw err;\n console.log(filename + ' created.');\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => \n err ? console.error(err) : console.log('README created!'))\n}", "function writeToFile(fileName, data) {\n fs.writeFileSync('./generated/'+fileName, generateMarkdown(data), error => {\n console.log(\"Generating README\");\n if (error) throw error;\n console.log(\"README generated.\");\n });\n \n}", "function createFileWriter(fileEntry, callbackFunction) {\n\tfileEntry.createWriter(callbackFunction, fail);\n}", "function writeToFile(fileName, userInput) {\n fs.writeFile(`` + fileName, generatesite(userInput), function (err) {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"Generating HTML...\");\n });\n}", "function writeToFile(fileName, data) {\n console.log(\"writeToFile: Filename is \" + fileName);\n console.log(\"writeToFile: data is \" + data);\n fs.writeFile(fileName, data, function(err){\n if (err) {\n throw err;\n };\n console.log(\"The README was created successfully\");\n})\n }", "function outputToFile(filename, content, callback) {\n\tfunction errorHandler(e) {\n\t var msg = '';\n\n\t switch (e.code) {\n\t case FileError.QUOTA_EXCEEDED_ERR:\n\t msg = 'QUOTA_EXCEEDED_ERR';\n\t break;\n\t case FileError.NOT_FOUND_ERR:\n\t msg = 'NOT_FOUND_ERR';\n\t break;\n\t case FileError.SECURITY_ERR:\n\t msg = 'SECURITY_ERR';\n\t break;\n\t case FileError.INVALID_MODIFICATION_ERR:\n\t msg = 'INVALID_MODIFICATION_ERR';\n\t break;\n\t case FileError.INVALID_STATE_ERR:\n\t msg = 'INVALID_STATE_ERR';\n\t break;\n\t default:\n\t msg = 'Unknown Error';\n\t break;\n\t };\n\n\t console.log('Error: ' + msg);\n\t}\n\tfunction onInitFs(fs) {\n\t\t//funcs\n\t\tfunction removeEntries(entries, nextstep) {\n\t\t\tentries.forEach(function(entry, i) {\n\t\t\t\tentry.remove(function(){}, function(e){console.log(e);});\n\t\t\t});\n\t\t\tnextstep.call();\n\t\t}\n\n\t\tfunction createFile() {\n\t\t\t fs.root.getFile(filename, {create: true}, function(fileEntry) {\n\n\t\t\t // Create a FileWriter object for our FileEntry (log.txt).\n\t\t\t fileEntry.createWriter(function(fileWriter) {\n\n\t\t\t fileWriter.onwriteend = function(e) {\n\t\t\t\tconsole.log('Write completed.');\n\t\t\t\tcallback(fileEntry.toURL());\n\t\t\t };\n\n\t\t\t fileWriter.onerror = function(e) {\n\t\t\t\tconsole.log('Write failed: ' + e.toString());\n\t\t\t\tcallback(false, e);\n\t\t\t };\n\n\t\t\t // Create a new Blob and write it to file.\n\t\t\t var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder;\t\n\t\t\t var bb = new BlobBuilder(); // Note: window.WebKitBlobBuilder in Chrome 12.\n\t\t\t bb.append(content);\n\t\t\t fileWriter.write(bb.getBlob('text/plain'));\n\n\t\t\t }, errorHandler);\n\n\t\t\t }, errorHandler);\n\t\t}\n\n\t // remove old files ------------begin---\n\n\t var dirReader = fs.root.createReader();\n\t var entries = [];\n\n\t // Call the reader.readEntries() until no more results are returned.\n\t var readEntries = function() {\n\t dirReader.readEntries (function(results) {\n\t if (!results.length) {\n\t\tremoveEntries(entries.sort(), createFile);\n\t } else {\n\t\tentries = entries.concat(Array.prototype.slice.call(results || [], 0));\n\t\treadEntries();\n\t }\n\t }, errorHandler);\n\t };\n\n\t readEntries(); // Start reading dirs.\n\t // remove old files ------------begin---\n\t}\n\n\tvar requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;\n\trequestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler);\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log(\"README generated!\")\n );\n}", "async _writeToOutput() {\n\t\tif (this.output === 'console') {\n\t\t\tconsole.log(JSON.stringify(this.profile));\n\t\t\treturn;\n\t\t}\n\t\tif (!await existsAsync('dist/')) {\n\t\t\tawait mkdirAsync('dist/');\n\t\t}\n\t\tif (this.output === 'yaml') {\n\t\t\treturn writeYamlAsync(`dist/${this.targetUsername}.yml`, this.profile);\n\t\t}\n\t\treturn writeFileAsync(\n\t\t\t\t`dist/${this.targetUsername}.json`,\n\t\t\t\tJSON.stringify(this.profile, null, 2)\n\t\t);\n\t}", "function writeToFile(fileName, data) {\nfs.writeFile(`./${fileName}.md`,data, (err) => {\n if (err){\n console.log(err)\n }\n console.log (\"Generating README...\");\n})\n}", "create (file,data) {\n fs.open(`${baseDir}/${file}.json`,'wx',(err,identifier)=>{\n if(!err && identifier){\n //Overide default to place objects inside of an array\n //let jsonArray = [];\n\n //jsonArray.push(data);\n\n let stringData = JSON.stringify(data,null,3);\n\n fs.writeFile(identifier,stringData,(err)=>{\n if(!err){\n fs.close(identifier,(err) =>{\n if(!err) console.log('no errors');\n else console.log(err);\n })\n } else console.log(err);\n })\n }\n else console.log(err);\n });\n }", "function writeToFile(data) {\n\n /*var fileName = data.Title\n .toUpperCase()\n .split(' ')\n .join('') + '.md';*/\n\n var ReadMe = generate_markdown(data);\n console.log(\"Generating README......\");\n\n fs.writeFile(\"README.md\", ReadMe, function (err) {\n if (err) {\n return console.log(err);\n }\n });\n\n console.log(\"README.md generated!\")\n\n}", "function writeToFile(fileName, data) {\n console.log(data);\n fs.writeFile(\"generatedREADME.md\", data, function(err){\n if (err){\n throw err;\n }\n console.log(data)\n })\n}", "function FileDestination(options) {\n\tvar defaultOptions = {\n\t\tappend: true,\n\t\tfilename: false,\n\t\tlogTimestamp: false,\n\t\tlogTransactionID: false,\n\t\tlogProcessID: false\n\t};\n\n\t_.defaults(options, defaultOptions);\n\n\tif (!options.filename) {\n\t\tthrow new Error(\"filename is a required option\");\n\t}\n\n\tthis.options = options;\n\n\tvar filemode = options.append ? \"a\" : \"w\";\n\n\tthis.file = fs.openSync(options.filename, filemode);\n}", "function writeToFile(fileName, data) {\n\nfs.writeFile(fileName + '.md', data, error => error ? console.error(error): console.log(`${fileName + '.md'} generated!`))\n\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw err;\n\n console.log('README has been generated!')\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n throw err;\n } else {\n console.log(\"README created!!! Check current repo for created file\")\n }\n });\n}", "function writeToFile(template,fileName) {\n let fileNameProcessed = fileName.replace(/\\s/g, '');\n if(path.extname(fileNameProcessed) !== \".md\") {\n console.log(\"The file extension you entered is not valid. Only .md files are accepted (Ex: README.md). For your convenience, the questions will be presented again in 2 seconds.\");\n setTimeout(()=>{init()},2000);\n } else {\n fs.writeFile(fileNameProcessed, template, function(err) {\n if (err) throw err;\n console.log(`Your new file \"${fileNameProcessed}\" has been created/updated successfully!`);\n });\n }\n}", "function createFile() {\n fileName = document.getElementById(\"miiText\").value\n newDir = path.join(FileSystem.currentDirectory, fileName)\n absolutePath = path.resolve(newDir);\n correctedPath = path.normalize(absolutePath);\n errorMessage = document.createElement(\"P\")\n errorMessage.style.position = \"absolute\"\n errorMessage.className = \"errorMessage\"\n errorMessage.id = \"miiErr\"\n document.getElementById(\"buttons\").appendChild(errorMessage)\n try {\n if(fs.existsSync(correctedPath))\n {\n document.getElementById(\"miiErr\").innerHTML = \"File Already Exists\"\n document.getElementById(\"miiPicture\").src = \"MiiBrawlPic.png\"\n }\n else {\n fs.closeSync(fs.openSync(correctedPath, 'a'))\n document.getElementById(\"miiErr\").innerHTML = \"File Successfully Created\"\n document.getElementById(\"miiPicture\").src = \"MiiGunnerPic.png\"\n }\n } catch {\n document.getElementById(\"miiErr\").innerHTML = \"File Could Not Be Created\"\n document.getElementById(\"miiPicture\").src = \"MiiBrawlPic.png\"\n\n }\n}", "function writeToFile(fileName, data) {\n fs.writeFile(`./dist/${fileName}`, data, err => {\n if (err) {\n throw err\n };\n console.log('README created!')\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFileSync(fileName, data, function(error){\n if(error) throw error;\n console.log(\"file generated\");\n })\n}", "function writeOutput(output){\n var now = new Date();\n var file_name = 'files/'+'Employee-table-' + now.getFullYear()+(now.getMonth()+1)+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds() +'.json';\n fs.writeFile(file_name,output,function(err){\n if(err){\n return console.log(err);\n } \n })\n}", "saveContentToFile() {\n const newFileName = this.uuidv4() + \".txt\";\n return this.utility.saveToFile(newFileName, this.fileContent);\n }", "function writeFile () {\n\tvar stringified = JSON.stringify(masterObject);\n\t\n\tfs.writeFile(newFilePath, stringified, function (err) {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(\"finished\");\n\t})\n}", "function showFileInfo(file){\n console.log(\"name : \" + file.name);\n console.log(\"size : \" + file.size);\n console.log(\"type : \" + file.type);\n console.log(\"date : \" + file.lastModified);\n }", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err);\n }\n console.log('Success! Your file had been generated')\n\n })\n}", "function writeToTxt(results, command){\n var resultsFinal = \"\\n\"+command + \"\\n=====================\\n\"+results+\"\\n\";\n fs.appendFile(\"log.txt\", resultsFinal, function(err){\n if (err) {\n console.log(err);\n } else {\n console.log(\"content added to log\");\n }\n \n });\n}", "function createXMLFile()\n{\n\tvar currentURLToBeWritten, currentListOfOutGoingLinks = new Array(); \n\t\n\tfor (var i=0; i<allTheLinksToBeReported.length; i++)\n\t{\n\t\tcurrentURLToBeWritten = allTheLinksToBeReported[i].URL.toString();\n\t\tcurrentListOfOutGoingLinks = allTheLinksToBeReported[i].LINKS;\n\t\tfs.write('finalResult', 'mainPage @@' + currentURLToBeWritten + \"\\n\", 'a');\n\n\t\tfor (var j=0; j<currentListOfOutGoingLinks.length; j++)\n\t\t\tfs.write('finalResult', 'outGoingLinks @@' + currentListOfOutGoingLinks[j] + \"\\n\", 'a');\n\n\t\tfs.write('finalResult', \"\\n\", 'a');\n\t}\n}", "function writeToFile(title, data) {\n const fileName = title.toLowerCase().split(\" \").join(\"-\");\n fs.writeFile(`./${fileName}.md`, data, (err) =>\n err\n ? console.log(err)\n : console.log(\n `${fileName}.md has been generated in your current directory.`\n )\n );\n}", "filename(req, file, callback) {\n // callback(null, `${file.fieldname}-${Date.now()}`);\n callback(null, `${Date.now()}`);\n }", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err): console.log(\"New README file created with success\")\n );\n}", "async createFile(name) {\n let normalizedDir = this.fullPath;\n if (normalizedDir.charAt(normalizedDir.length - 1) === path_1.sep) {\n normalizedDir = normalizedDir.slice(0, -1);\n }\n const fd = await util_1.promisify(fs_1.open)(`${normalizedDir}${path_1.sep}${name}`, 'w');\n await util_1.promisify(fs_1.close)(fd);\n this.context.socketService.notifyRefresh(this.path.replace(/\\\\/g, '/').replace(/\\/$/, \"\"));\n return this.context.getHierarchyItem(this.path + name);\n }", "function createTeam() {\n const team = render(teamMembers);\n fs.writeFile(outputPath, team , (err) =>\n \n err ? console.log(err) : console.log(\"Success!\"));\n}", "function File(info) {\n this.name = info.name;\n this.kind = info.kind;\n this.genre = info.genre;\n this.size = info.size;\n this.last_revision = info.commit_revision;\n this.author = info.commit_author;\n this.last_date = info.commit_date;\n this.id = info.index;\n this.commit_history = {};\n this.comments = [];\n}", "function writeToFile(fileName, data) { }", "function writeToFile(filetype, data) {\n fs.writeFile(filetype, data, (err) =>\n err ? console.log(err) : console.log('Created your Team Page!')\n )\n}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, data) {}", "function writeToFile(fileName, { title, description, usage, install, contribution, license, testing, github, email }) {\n const codeStyling = \"```\"\n const readme = `# ${title}\n## License\n![GitHub license](https://img.shields.io/badge/license-${license}-red.svg)\n## Description\n${description}\n## Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n## Installation\nTo install the necessary denpendencies, run the following command:\n${codeStyling}\n${install}\n${codeStyling}\n## Usage\n${usage}\n## Contributing\n${contribution}\n## Tests\n${testing}\n## Questions\nIf you have any questions you can email me at: ${email}\nAlso feel free to check out my GitHub page here: https://github.com/${github}\n`\n\n // console.log('readme: ', readme);\n\n fs.writeFile(fileName, readme, err => {\n if (err) {\n throw err;\n }\n console.log(`Saved`);\n },)\n .catch (err => console.log(err));\n}", "static createFile(evt, {path=null, str=\"\"}){\n // must have file path\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-create\", {err});\n return;\n }\n\n // figure file path data from file string \n let fileName = path.split(\"/\").pop();\n let dir = path.split(`/${fileName}`)[0];\n let knownFolder = FolderData.folderPaths.includes(path);\n\n // create the file \n FileUtils.createFile(path, str)\n .then(() => {\n // file created\n IpcResponder.respond(evt, \"file-create\", {dir, fileName, knownFolder});\n\n // update recent files \n FolderData.updateRecentFiles([path]);\n })\n .catch(err => {\n // error\n IpcResponder.respond(evt, \"file-create\", {err: err.message});\n });\n }", "createLoggerFile() {\n return new Promise(function (resolve, reject) {\n if (fs.existsSync(fileName)) {\n fs.appendFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n else{\n fs.writeFile(fileName, 'Server Started at ' + new Date()+\"\\r\\n\", function (err) {\n if (err) reject(err);\n resolve();\n });\n }\n });\n }", "function writeToFile(filename, data){\n fs.writeFile('./dist/README.md',(filename, data), err => {\n if (err){\n console.log(err);\n return\n }\n console.log ('README GENERATED!');\n })\n}", "function writeToFile(fileName, data) {\n const badge = license.renderLicenseBadge(data.license);\n const licenseLink = license.renderLicenseLink(data.license);\n\n const readMe = `# ${data.title}\n\n${badge}\n\n## Description\n${data.description}\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Credits](#credits)\n- [Test](#tests)\n- [License](#license)\n- [Questions](#questions)\n\n## Installations\n${data.installationInstructions}\n\n## Usage\n${data.usageInformation}\n\n## Credits\n${data.contributionGuidlines}\n\n## Tests\n${data.testInstructions}\n\n## License\n[${data.license}](${licenseLink})\n\n## Questions\nIf you have questions, please reach out here:\nGithub: ${data.github}\nEmail: ${data.email}`\n\n fs.writeFile(fileName, readMe, err => err ? console.log(err) : console.log('READme.md successfully created!'));\n}", "function createFile(path, content) {\n fs.writeFileSync(path, content, { encoding: \"utf-8\" });\n}", "_exportToText() {\n fs.writeFileSync(this.pathTemplate, '', 'utf-8');\n this.records.forEach(submitTime => fs.appendFileSync(this.pathTemplate, `${submitTime}\\n`));\n }", "function writeFile(data) {\n fs.appendFile(output, data, err => {\n\t\tif(err) {console.log('error:', err);}\n\t});\n\tconsole.log('END');\n}", "createJson(obj) {\n var outputFilename = __dirname+'/mappingOrder.json';\n\n fs.writeFile(outputFilename, JSON.stringify(obj, null, 4), function(err) {\n if(err) {\n console.log(err);\n } else {\n console.log(\"JSON saved to \" + outputFilename);\n }\n });\n }", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err);\n }\n console.log(\"YAY, your README was generated\")\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if(err) {\n console.error(err)\n }else {\n console.log(\"README file created successfully\");\n }\n });\n }", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) console.log(err);\n console.log(\"Succesfully readme.me created\")\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n err ? console.log(err):console.log(\"It successfully created README file!\")\n });\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName,generateMarkdown(data),err=>{\n if(err) throw err;\n console.log('readme created')\n })\n}", "createNewfile(state, options) {\n //Get desired filename\n let name;\n if(options !== undefined && options.name !== undefined)\n name = getDefaultName(options.name);\n else\n name = getDefaultName();\n\n //Insert empty rows to fill up to the desired well count\n state.plate = plates[\"MWP 24\"];\n var values = [];\n for (let i = 0; i < state.plate.wells; i++) {\n values.push([0, 0]);\n }\n\n state.file = {\n substances: [\n { name: \"Water\", color: \"#6699ff\" },\n { name: \"Sample 1\", color: \"#66ff33\" },\n ],\n\n name: name,\n values: values,\n };\n }" ]
[ "0.7589007", "0.6463051", "0.6254441", "0.6184719", "0.6148196", "0.6126077", "0.611571", "0.6045737", "0.5959177", "0.594336", "0.5943259", "0.58981055", "0.5860408", "0.5773959", "0.5757392", "0.57503754", "0.5746891", "0.5734899", "0.573418", "0.57076967", "0.56968117", "0.5690214", "0.5660781", "0.5613361", "0.5583049", "0.5571607", "0.55711263", "0.5551983", "0.5550108", "0.5544855", "0.5542229", "0.55386657", "0.5503491", "0.54901004", "0.54763186", "0.5474182", "0.5454456", "0.54408056", "0.54081345", "0.53891855", "0.53845924", "0.5378129", "0.53641015", "0.53637344", "0.5361505", "0.5347349", "0.53449816", "0.5338158", "0.53142196", "0.53100365", "0.53056026", "0.530546", "0.5301372", "0.5289239", "0.5283041", "0.5282935", "0.52820003", "0.5275167", "0.5274769", "0.52643615", "0.526127", "0.5261201", "0.5258869", "0.52530587", "0.52491486", "0.52478075", "0.5246116", "0.52439404", "0.524036", "0.52389085", "0.5235822", "0.5235056", "0.52350146", "0.52311933", "0.5231106", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52297825", "0.52284396", "0.5226169", "0.52092224", "0.52049965", "0.5201829", "0.5200858", "0.5197238", "0.51888746", "0.518884", "0.5187823", "0.5186791", "0.51820624", "0.51787764", "0.51762563", "0.51755226" ]
0.76575094
0
Determine if the row containing the specified variable is not an array definition. A row in a table is an array definition if a value is present in the Array Size column but the variable name does not end with a ']'
function isVariable(variableName, arraySize) { // Only output non-array variables or array members (i.e., skip array // definitions) return variableName != null && arraySize != null && (arraySize.isEmpty() || variableName.endsWith("]")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }", "function typeIsArray(instance_var) {\n return getType(instance_var).includes(\"[]\") || getName(instance_var).includes(\"[]\");\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function isDataArray(x) {\n return Array.isArray(x);\n}", "function arr_isArray(array){\n\t\treturn array != null\n\t\t\t&& typeof array.length === 'number'\n\t\t\t&& typeof array.splice === 'function';\n\t}", "function validArray(A) {\n if (A) {\n return A.constructor === Array;\n }\n return false;\n}", "function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }", "function isArrayElement(arraySize)\n{\n return arraySize != null && !arraySize.isEmpty();\n}", "function isArray(e){return e!=null&&typeof e==\"object\"&&typeof e.length==\"number\"&&(e.length==0||defined(e[0]))}", "function isArray (type) {\n\t return type.lastIndexOf(']') === type.length - 1\n\t}", "function isDataArray(val, key) {\n\t\n\t var containers = ['annotations', 'shapes', 'range', 'domain', 'buttons'],\n\t isNotAContainer = containers.indexOf(key) === -1;\n\t\n\t return Array.isArray(val) && isNotAContainer;\n\t}", "function isVBArray(x) \r\n{\r\n\ttry{\r\n\t\tx.lbound();\r\n\t} catch (e) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function isArray (type) {\n return type.lastIndexOf(']') === type.length - 1\n}", "function isArray (type) {\n return type.lastIndexOf(']') === type.length - 1\n}", "function isArray (type) {\n return type.lastIndexOf(']') === type.length - 1\n}", "function BOT_isArray(x) {\r\n\tif( typeof(x) == \"object\") return (x.constructor.toString().indexOf(\"Array\") != -1);\r\n\telse return false;\r\n}", "function is(arr){\n return typeof(arr) == \"object\" && arr.length >= 0;\n }", "function isFieldArray(fieldName) {\n return fieldName.indexOf(\"/\") != -1;\n }", "function isArray(testMesh) {\n return testMesh && !(testMesh.propertyIsEnumerable('length')) && typeof testMesh === 'object' && typeof testMesh.length === 'number';\n}", "function IsLiteralArray(aTransform)\n{\n var retval = aTransform.constructor == Array;\n \n return retval\n}", "function isArrayish (arr) {\n return /Array\\]$/.test(Object.prototype.toString.call(arr))\n}", "function yellIsArray(testObject) {\n return testObject && !(testObject.propertyIsEnumerable('length'))\n && typeof testObject === 'object'\n && typeof testObject.length === 'number';\n}", "function IsArray(val) {\n return Object.prototype.toString.call(val) == Object.prototype.toString.call([]);\n }", "function is_array(input) {\n if (Object.prototype.toString.call(input) === \"[object Array]\") {\n return true;\n }\n return false;\n}", "function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n }\n}", "function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n }\n}", "function isArrayish(arr) {\n return (/Array\\]$/.test(Object.prototype.toString.call(arr))\n );\n}", "function isArray(a) {\r\n// This is not working, so testing if the length member is not undefined\r\n// return isObject(a) && a.constructor == Array;\r\n return isObject(a) && !isUndefined(a.length);\r\n}", "function is2DArray(s) {\n var pattern = /type\\s=\\s.*\\s[[0-9]*][[0-9]*]/;\n return pattern.test(s);\n}", "function isArrayLiteral(token, lastToken) {\n if (token.type.label != \"[\") {\n return false;\n }\n if (!lastToken) {\n return true;\n }\n if (lastToken.type.isAssign) {\n return true;\n }\n return !!PRE_ARRAY_LITERAL_TOKENS[\n lastToken.type.keyword || lastToken.type.label\n ];\n }", "function IsItArray (cheetah){\n if (Array.isArray(cheetah) === true) {\n return 'It\\'s an array!'\n } else {\n return 'It\\'s not an array'\n }\n}", "function likeArray(obj) {\n return obj && typeof obj === \"object\" && typeof obj.length === \"number\";\n }", "function isArray(obj){return(typeof(obj.length)==\"undefined\")?false:true;}", "function isArray (arr) {\n if (typeof arr === \"undefined\")\n {\n return false;\n } else if (arr === null) {\n return false;\n } else {\n return arr.constructor === Array;\n }\n}", "function is_array(x)\r\n{\r\n return Array.isArray(x) ;\r\n}", "is_array(val) {\n return Array.isArray(val);\n }", "function isArray(a) {\n return (!!a) && (a.constructor === Array);\n}", "function isArray(a) {\n return (!!a) && (a.constructor === Array);\n}", "function checkArray(variable)\n{\n if (inputArray[0] === `0` && typeof inputArray[1] === `undefined`)\n {\n variable = 1;\n }\n\n return variable;\n}", "function isArray(array)\n{\n\treturn !!(array && array.constructor == Array);\n}", "function isArray(variable) {\n return Array.isArray(variable);\n}", "function vt(t) {\n return !!t && \"arrayValue\" in t;\n}", "_validateValueArrayDimensions() {\n const that = this;\n let dimensions = 0,\n tempArray = that.value,\n emptyArray = false;\n\n while (tempArray.constructor === Array) {\n dimensions++;\n tempArray = tempArray[0];\n\n if (tempArray === undefined) {\n emptyArray = true;\n break;\n }\n }\n\n if (that.dimensions > dimensions) {\n if (emptyArray) {\n that.value = that._returnEmptyArray();\n return;\n }\n\n while (that.dimensions > dimensions) {\n that._addDimensionToJSArray(dimensions);\n dimensions++;\n }\n }\n }", "function isDefined(element, index, array){\n return (element !== undefined || element !=='\\n' || element !=='\\r\\n');\n }", "function isArray(s) {\n var pattern = /type\\s=\\s.*\\s[[0-9]*]/;\n return pattern.test(s);\n}", "function rowHasMultiple9s(arr) {\n\n}", "function arrayIsValid(_array_) {\n return _array_ && Array.isArray(_array_) && _array_.length > 0;\n}", "function isArray(a) {\n return isDefined(a) && !isString(a) && !isFunction(a) && isNumber(a.length);\n }", "function X(t) {\n return !!t && \"arrayValue\" in t;\n}", "function isAry(o) {\n\t\treturn typeof (o) == \"array\" || (isObj(o) && o != null && \"length\" in o && o.length > 0);\n\t}", "function isArray(val){return(val instanceof Array);}", "function isArrayLike (x) {\n\t return x != null && typeof x.length === 'number' && typeof x !== 'function'\n\t}", "function Nt(t) {\n return !!t && \"arrayValue\" in t;\n}", "function unemptyArray (a) {\n\t return low.isArray(a) && a.length > 0\n\t}", "function arrayNotEmpty(array) {\n return array instanceof Array && array.length > 0;\n}", "function isArray(a) {\r\n\treturn (a && a.constructor == Array);\r\n }", "validateArraySize (req, array) {\n const FREEMIUM_INPUT_SIZE = 20\n const PRO_INPUT_SIZE = 20\n\n if (req.locals && req.locals.proLimit) {\n if (array.length <= PRO_INPUT_SIZE) return true\n } else if (array.length <= FREEMIUM_INPUT_SIZE) {\n return true\n }\n\n return false\n }", "function isArray(a) {\n return (a && a.constructor == Array);\n}", "function isArrayLike (x) {\n return x != null && typeof x.length === 'number' && typeof x !== 'function'\n}", "function mt(t) {\n return !!t && \"arrayValue\" in t;\n}", "get hasValues() {\n return this.arrayWidth > 0 && this.arrayHeight > 0;\n }", "function baseIsTypedArray(value) {\n return (0, isObject_1.isObjectLike)(value) && (0, isLength_1.default)(value.length) && typedArrayTags[(0, baseGetTag_1.default)(value)];\n}", "function hasArrayNature(obj) {\n return (\n // not null/false\n !!obj &&\n // arrays are objects, NodeLists are functions in Safari\n (typeof obj == 'object' || typeof obj == 'function') &&\n // quacks like an array\n ('length' in obj) &&\n // not window\n !('setInterval' in obj) &&\n // no DOM node should be considered an array-like\n // a 'select' element has 'length' and 'item' properties\n (typeof obj.nodeType != 'number') &&\n (\n // a real array\n (Array.isArray(obj) ||\n // arguments\n ('callee' in obj) || // HTMLCollection/NodeList\n 'item' in obj)\n )\n );\n}", "function checkTypes(arr) {\n var y = true\n var x = typeof arr[0][0]\n for(var i = 0; i<arr.length; i++){\n for(var j = 0; j<arr[i].length; j++){\n if(x !== typeof arr[i][j] && y === true){\n return false\n }\n }\n }\n return true\n \n}", "function isArray(a) {\n\treturn (a && a.constructor == Array);\n}", "function isArray(a) {\n\treturn (a && a.constructor == Array);\n}", "function $FX3H$var$isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n\n return $FX3H$var$objectToString(arg) === '[object Array]';\n}", "function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }", "function isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value) && value.length !== undefined;\n}", "function isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value) && value.length !== undefined;\n}", "function emptyArray (data) {\n return array(data) && data.length === 0;\n }", "function is_array(ip) {\n return Array.isArray(ip);\n}", "function isArray(a) {\n return isDefined(a) && typeof a === TYPE_OBJECT.toLowerCase() && isType(a, TYPE_ARRAY);\n }", "function checkIfArray(arr) {\n return Array.isArray(arr);\n}", "function $QcjV$var$isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(arr) {\n if (typeof arr === \"undefined\") {\n return false;\n } else if (arr === null) {\n return false;\n } else {\n return arr.constructor === Array;\n }\n}", "function hasItems(array) {\n return array[0] !== undefined \n}", "function ParseArray()\n {\n value = [];\n\n while (true) {\n\n var tokenInfo = NextTokenInfo();\n var token = tokenInfo[0];\n var tokenRow = tokenInfo[1];\n var tokenColumn = tokenInfo[2];\n\n switch (token) {\n\n case ']':\n return true;\n\n case '}':\n case '.':\n error = \"ParseArray: expected type or ']' instead of \" + token;\n errorRow = tokenRow;\n errorColumn = tokenColumn;\n return false;\n\n case '{':\n\n valueStack.push(value);\n\n if (!ParseObject()) {\n return false;\n }\n\n var objectValue = value;\n value = valueStack.pop();\n value.push(objectValue);\n\n break;\n\n case '[':\n\n valueStack.push(value);\n\n if (!ParseArray()) {\n return false;\n }\n\n var arrayValue = value;\n value = valueStack.pop();\n value.push(arrayValue);\n\n break;\n\n default:\n\n var typeName = token;\n\n subScope = {\n sheetName: scope.sheetName,\n sheet: scope.sheet,\n isSingleSheet: scope.isSingleSheet,\n isSingleCell: true,\n row: scope.currentRow,\n column: tokenColumn,\n rowCount: 1,\n columnCount: 1,\n typeName: typeName,\n alreadyIndented: true,\n inTable: true,\n index: index,\n tableRow: scope.currentRow,\n tableColumn: firstHeaderColumn,\n tableRows: 1,\n tableColumns: headerColumns,\n inTableArray: true,\n inTableArrayIndex: subScope.value.length\n };\n\n scope.subScopes.push(subScope);\n\n scope.errorScope = LoadJSONFromSheet(sheets, ranges, subScope);\n if (scope.errorScope) {\n return false;\n }\n\n value.push(subScope.value);\n\n break;\n }\n\n }\n }", "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "function NotArray() {\n ;\n}", "function isArrayLike(x) {\n return x != null && typeof x.length === 'number' && typeof x !== 'function';\n}", "function isArray(arr) {\n\t\treturn Object.prototype.toString.call(arr) === \"[object Array]\";\n\t}", "function validateLine(linArray) {\n\n if (linArray != null && linArray.length == 4) {\n return true;\n }\n\n return false;\n\n}", "function isArray(obj) {\n return (obj && typeof obj === OBJECT && typeof obj.length === NUMBER && !(obj.propertyIsEnumerable(LENGTH)));\n }", "__is_1D_array(arr) {\n if ((typeof (arr[0]) == \"number\") || (typeof (arr[0]) == \"string\") || (typeof (arr[0]) == \"boolean\")) {\n return true\n } else {\n return false\n }\n }", "function isParmArrayValidForStatement( sqlStatement, parms ) {\n var valid = false;\n var replaceableParms = sqlStatement.match( /\\?/g );\n if ( replaceableParms && replaceableParms.length > 0 ) {\n if ( parms ) {\n valid = ( parms.length == replaceableParms.length );\n }\n } else {\n valid = ( parms == null || parms.length == 0 );\n }\n return valid;\n }", "function isArray(input) {\n\t return Object.prototype.toString.call(input) === '[object Array]';\n\t }", "function isArray(input) {\n\t return Object.prototype.toString.call(input) === '[object Array]';\n\t }", "function isArray(value) {\n if (value.startsWith('(')) {\n var tokens = value.split(\",\");\n if ((tokens.length < 4) || (tokens.length % 2 !== 0)) {\n return false;\n }\n var pos = 0;\n while (pos < tokens.length) {\n var val1 = tokens[pos].trim().substring(1).trim()\n if (isNaN(parseFloat(val1))) {\n return false;\n }\n var val2 = tokens[pos + 1].trim();\n val2 = val2.substring(0, val2.length - 1);\n if (isNaN(parseFloat(val2))) {\n return false;\n }\n pos += 2;\n }\n } else {\n var tokens = value.split(\",\");\n if (tokens.length < 2) {\n return false;\n }\n for (var i = 0; i < tokens.length; i++) {\n if (isNaN(parseFloat(tokens[i]))) {\n return false;\n }\n }\n }\n return true;\n}", "isArray(value) {\n return value && typeof value === 'object' && value.constructor === Array;\n }", "function in_array(variable, theArray)\n{\n\treturn $.inArray(variable, theArray) != -1;\n}", "function isBytesArray(bytes) {\n return bytes.byteLength === 20;\n}", "function w$(e){return Array.isArray(e)}", "function arrayInArray(testArray,containerArray){\n var inArray=false;\n for(var i=0;i<containerArray.length;i++){\n var innerArray=containerArray[i];\n if(arrayEquals(testArray,innerArray)){\n return true;\n }\n }\n return false;\n}", "function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) {\n if (minLength === void 0) { minLength = 0; }\n if (maxLength === void 0) { maxLength = Infinity; }\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(function (e) { return typeof e === expectedType; }));\n}", "function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) {\n if (minLength === void 0) { minLength = 0; }\n if (maxLength === void 0) { maxLength = Infinity; }\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(function (e) { return typeof e === expectedType; }));\n}", "function isArray1D(a) {\n return !isArrayOrTypedArray(a[0]);\n}", "function isArray(that_thing) {\n if(Object.prototype.toString.call( that_thing ) === \"[object Array]\") {\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.62658256", "0.6088386", "0.6051291", "0.6051291", "0.6051291", "0.60416573", "0.6009855", "0.59947145", "0.59820694", "0.59604335", "0.59486055", "0.5947597", "0.5918841", "0.59055036", "0.588324", "0.588324", "0.588324", "0.58347255", "0.58346623", "0.579784", "0.577385", "0.5748727", "0.573058", "0.57257545", "0.57036567", "0.5703327", "0.5690478", "0.5690478", "0.56726557", "0.5654048", "0.56431973", "0.5628427", "0.5605553", "0.5603744", "0.55957425", "0.5591044", "0.5587815", "0.55787444", "0.5562354", "0.5562354", "0.555799", "0.5545998", "0.5539018", "0.55384606", "0.55359036", "0.55313194", "0.55260974", "0.55108994", "0.5509541", "0.5494253", "0.54921883", "0.54721886", "0.5471187", "0.5456556", "0.54544115", "0.54321206", "0.542234", "0.5421543", "0.54045373", "0.54017055", "0.5401192", "0.5396742", "0.5384692", "0.5384009", "0.537826", "0.5373898", "0.5370963", "0.5370963", "0.5369947", "0.53688663", "0.53661704", "0.53661704", "0.5363615", "0.53621125", "0.5360454", "0.53592205", "0.5357922", "0.53561395", "0.5350868", "0.5345122", "0.5340832", "0.5338045", "0.53373224", "0.53367424", "0.5331265", "0.53279966", "0.53234196", "0.5312119", "0.5302678", "0.5302678", "0.52909744", "0.5280291", "0.52741146", "0.5270796", "0.52694994", "0.5264313", "0.5264249", "0.5264249", "0.5263924", "0.5259572" ]
0.6629437
0
Convert an array member variable name by replacing left square brackets with underscores and removing right square brackets (example: a[2] becomes a_2)
function convertArrayMember(variableName) { return variableName.replaceAll("[\\[]", "_").replaceAll("[\\]]", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function underscore (name) {\n return varname.split(name).join('_');\n}", "function underscore (name) {\n return varname.split(name).join('_');\n}", "function normalize_dataset_name(name) { // 214\n\treturn name.replace(/[\\]\\[\\.]/g, '_'); // 215\n} // 216", "function cleanFieldName_v1(name) {\n return name.replace(/[^A-Za-z0-9]+/g, '_');\n }", "function fixIdentifier(name) {\n return name.replace(/[\\[\\]]/g, '');\n }", "function cleanFieldName(name) {\n return name.replace(/[-\\s]+/g, '_');\n }", "function filterFieldName(temp) {\r\n\ttemp = trim(temp);\r\n\ttemp = temp.toLowerCase();\r\n\ttemp = temp.replace(/[^a-z0-9]/ig,\"_\");\r\n\ttemp = temp.replace(/[_]+/g,\"_\");\r\n\twhile (temp.length > 0 && (temp.charAt(0) == \"_\" || temp.charAt(0)*1 == temp.charAt(0))) {\r\n\t\ttemp = temp.substr(1,temp.length);\r\n\t}\r\n\twhile (temp.length > 0 && temp.charAt(temp.length-1) == \"_\") { \r\n\t\ttemp = temp.substr(0,temp.length-1);\r\n\t}\r\n\treturn temp;\r\n}", "function normalizeAttributeName( attributeName ) {\n\t\tattributeName = attributeName.replace( rDataAttrPrefix, \"\" );\n\n\t\t//if subscription involve with more than one events, you can\n\t\t//concatenate them with \"_\", here we need to revert them back\n\t\t//such as \"$click_mouseover\" need to be changed to \"$click mouseover\"\n\t\tif (attributeName.startsWith( \"!\" ) || attributeName.startsWith( \"$\" )) {\n\n\t\t\tattributeName = attributeName.replace( reUnderscore, \" \" );\n\n\t\t}\n\t\treturn attributeName.replace( reAttrDash, replaceAttrDashWithCapitalCharacter );\n\t}", "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos === -1) return s;\n else s = s.replace(' ','_');\n }\n}", "function mungePropertyName(name, prefix) {\n\t\tif (!prefix) {\n\t\t\treturn name;\n\t\t}\n\n\t\tvar parts = name.split(\".\");\n\t\tvar result = \"\";\n\t\tfor (var i = 0; i < parts.length - 1; i++) {\n\t\t\tresult += parts[i] + \".\";\n\t\t}\n\t\tvar lastPart = parts[parts.length - 1];\n\t\tif (prefixRequiresNextInitialCap(prefix)) {\n\t\t\tresult += prefix + lastPart.substring(0, 1).toUpperCase() + lastPart.substring(1);\n\t\t} else {\n\t\t\tresult += prefix + lastPart;\n\t\t}\n\t\treturn result;\n\t}", "function beautifyString(mname) {\n\n mname = mname.split('.').join(' ');\n mname = mname.split('-').join(' ');\n mname = mname.split('_').join(' ');\n\n return mname;\n}", "function underscore (strings, ...values) {\n return strings[0].replace(/\\s/g, '_');\n}", "function adjustFieldName(name, maxLen, i) {\n var name2, suff;\n maxLen = maxLen || 256;\n if (!i) {\n name2 = name.substr(0, maxLen);\n } else {\n suff = String(i);\n if (suff.length == 1) {\n suff = '_' + suff;\n }\n name2 = name.substr(0, maxLen - suff.length) + suff;\n }\n return name2;\n }", "function normalizeName(name) {\n return name\n .toUpperCase()\n .replace(/[^A-Z0-9]/g, \" \")\n .trim()\n .split(/\\s+/)\n .join(\"_\");\n}", "function underscore (strings, ...values) {\n return strings[0].replace(/\\s/g, '_');\n}", "function unescapePropertyName(name) {\n // pre-test to improve performance\n if (REGEXP_IS_ESCAPED.test(name)) {\n name = name.replace(REGEXP_DOT, '.');\n name = name.replace(REGEXP_DOLLAR, '$');\n name = name.replace(REGEXP_TO_BSON, 'toBSON');\n name = name.replace(REGEXP_TO_STRING, 'toString');\n name = name.replace(REGEXP_BSON_TYPE, '_bsontype');\n }\n return name;\n}", "function make_name(a, n) {\n var sub = [];\n for (var i = 0; i < n; i++) {\n sub.push(a[i].toString());\n }\n return sub.join('.');\n}", "function convertFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n }", "function strReplace(){\n for(let i = 0; i < wordSplit.length; i++)\n {\n underscoreArray.push(wordSplit[i].replace(/[a-zA-Z]/gi, \"_\"));\n console.log(underscoreArray);\n }\n document.getElementById(\"underscores\").innerHTML = underscoreArray;\n}", "function displayUnderscores() {\n return wordSplit.map((el) => {\n return (el = \"_\");\n });\n}", "function parseObjArray(arr) {\n let ret = [];\n for (obj of arr) {\n let key = obj[0];\n let val = obj[1];\n let new_key = key;\n if (key.includes('_')) {\n new_key = key.split('_')[1];\n }\n new_key = new_key[0].toUpperCase() + new_key.substring(1);\n let string = new_key + \": \" + val;\n ret.push(string);\n }\n return ret;\n}", "function formatString(arr) {\n const camelArr = [];\n\n for (const str of arr) {\n const wordArr = str.split(\"_\");\n const camelWord = [];\n for (const s of wordArr) {\n if (s === wordArr[0]) {\n camelWord.push(s);\n } else {\n camelWord.push(s[0].toUpperCase() + s.slice(1));\n }\n }\n camelArr.push(camelWord.join(\"\"));\n }\n return camelArr;\n}", "function sanitise(name){\n\treturn name.replace(/[^a-zA-Z0-9\\.\\-]/g, '_');\n}", "function unBase(arr){\n var base = arr.reduce(commonBase, arr[0]);\n return arr.map(function(x){\n x = x.substr(base.length);\n x = x.charAt(0).toLowerCase() + x.substr(1);\n x = camelCase(x);\n return x;\n })\n}", "function underscore(){\n\tarrayU=[null];\n\tfor (var i=0; i<ChosenWord.length; i++)\n\t{\n\t\tarrayU[i] = \"_\";\n\t}\n}", "function spacesToUnderscores(string) {\n return string.split(\" \").join(\"_\");\n}", "function _decamelize(str){return str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}", "function JSCompiler_renameProperty(a) {\n return a;\n }", "function typeNameToFuncName(typeName) {\n var parts = typeName.split('_');\n return parts.map(function (part, i) {\n if (i !== 0 && part.length) return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();else return part.toLowerCase();\n }).join('');\n}", "function normalizeKeypath (key) {\n return key.indexOf('[') < 0\n ? key\n : key.replace(BRACKET_RE_S, '.$1')\n .replace(BRACKET_RE_D, '.$1')\n}", "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_'); // Add _ if the string has leading numbers.\n\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n }", "function idToName(id) {\n return id.split(\"_\").map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(\" \")\n}", "function formatName(name) {\n if(name.includes(\",\") || name.includes(' ') || name.includes(\"&\")){\n if(name.includes(\".\")){\n name = name.substring(0, name.length-1);\n }\n return name.replace(/[,& ]+/g, '_');\n } else {\n return name\n }\n}", "function capMe(arr){\n return arr.map(name => name[0].toUpperCase()+name.slice(1).toLowerCase())\n}", "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n }", "function sanitizeClassname(name) {\n return name.replace(/[^a-z0-9]/g, function(s) {\n var c = s.charCodeAt(0);\n if (c == 32) return '-';\n if (c >= 65 && c <= 90) return '_' + s.toLowerCase();\n return '__' + ('000' + c.toString(16)).slice(-4);\n });\n }", "function charReplacer(cBand) {\n for (i = 0; i < cBand.length; i++) {\n underscoredBand.push(\"_\");\n }\n console.log(underscoredBand);\n }", "function varName(s) {\n\t // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n\t const alphanumericS = s.replace(/\\W/g, '_');\n\t // Add _ if the string has leading numbers.\n\t return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n\t}", "formatAttributeName(attr) {\n return attr.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n }", "function capitalizeNames(arr){\r\n return arr.map(name => name.charAt(0).toUpperCase() + name.substring(1).toLowerCase())\r\n }", "function getAttrNameFromPropName$1(propName) {\n if (isUndefined$3(PropNameToAttrNameMap$1[propName])) {\n PropNameToAttrNameMap$1[propName] = StringReplace$1$1.call(propName, CAPS_REGEX$1, match => '-' + match.toLowerCase());\n }\n\n return PropNameToAttrNameMap$1[propName];\n }", "function camelize(arr){\n let temp=arr.split('-');\n \n return temp.map(s=> s.substring(0,1).toUpperCase()+s.substring(1)).join('');\n ;\n}", "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}", "function jum_normalize_func_name(funcname) {\n if (funcname.substring(0,5) == 'test_') return funcname.substring('test_'.length);\n if (funcname.substring(0,4) == 'test') return funcname.substring('test'.length);\n return funcname;\n}", "function toPublicName(internalName){return internalName.toUpperCase().replace(/[^A-Z0-9_]/g,'_');}", "function getFieldName(input){\n // TODO slice vs substring?\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function changePropertyName(obj, old, _new) {\n obj[_new] = obj[old];\n delete obj[old];\n}", "function encodeMemberName(memberName){\n var memName = memberName.replace(/\\.+/g, '');\n memName = memName.replace(/\\(+/g, '-');\n memName = memName.replace(/\\)+/g, '-');\n memName = memName.replace(/\\<+/g, '-');\n memName = memName.replace(/\\>+/g, '-');\n memName = memName.replace(/\\:+/g, '-');\n \n return memName;\n}", "function getIndex(name)\n{\n // Split the variable name on the underscores and use the last part as the\n // array index\n var parts = name.split(\"_\");\n return parts[parts.length - 1];\n}", "function $HjyR$var$toIdentifier(str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1);\n }).join('').replace(/[^ _0-9a-z]/gi, '');\n}", "function camelToUnderscore(key) {\n var result = key.replace(/([A-Z])/g, \" $1\");\n return result\n .split(\" \")\n .join(\"-\")\n .toLowerCase()\n .substr(1);\n}", "function _processName(pfx, eltDescName) {\n\t if (pfx === undefined || pfx === null) {\n\t pfx = EMPTY;\n\t }\n\t if (eltDescName === undefined || eltDescName === null) {\n\t return pfx;\n\t }\n\t if (pfx === EMPTY) {\n\t return eltDescName;\n\t }\n\t return pfx + '.' + eltDescName;\n\t}", "function nameInspector(string) {\n var isArray = /\\[\\]$/.test(string);\n var name = (isArray) ? string.match(/[^\\[]*/)[0] : string;\n return {name: name, observerName: name+\"Obs\", isArray: isArray};\n}", "function ConvertInputsToBeAsArrayItem(elem, arrayName, index) {\n $(elem).find(\"input, select\").each(function (i, e) {\n $(e).attr(\"id\", arrayName + \"_\" + index + \"__\" + $(e).attr(\"id\"));\n $(e).attr(\"name\", arrayName + \"[\" + index + \"].\" + $(e).attr(\"name\"));\n });\n return elem;\n}", "function normalize(namePath) {\n return namePath.map(function (cell) {\n return \"\".concat((0, _typeof2.default)(cell), \":\").concat(cell);\n }) // Magic split\n .join(SPLIT);\n}", "function _underscoreToDollar( data ) {\n\t\tfor( key in data ) {\n\t\t\tif ( key[0] == '_' ) {\n\t\t\t\tvar value = data[key];\n\t\t\t\tdelete data[key];\n\t\t\t\tdata['$'+key.substr(1)] = value;\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t}", "function unMungeNetworkName(name)\n{\n name = ecmaUnescape(name);\n return name.replace(/_/g, \":\").replace(/-/g, \".\");\n}", "function ___R$$priv$project$rome$$internal$codec$config$json$parse_ts$removeUnderscores(\n\t\tparser,\n\t\tindex,\n\t\traw,\n\t) {\n\t\tlet str = \"\";\n\n\t\tfor (let i = 0; i < raw.length; i++) {\n\t\t\tconst char = raw[i];\n\n\t\t\tif (char === \"_\") {\n\t\t\t\t// Don't allow separators in JSON\n\t\t\t\tif (parser.meta.type !== \"rjson\") {\n\t\t\t\t\tthrow parser.unexpected({\n\t\t\t\t\t\tdescription: ___R$project$rome$$internal$diagnostics$descriptions$index_ts$descriptions.JSON.NUMERIC_SEPARATORS_IN_JSON,\n\t\t\t\t\t\tstart: parser.getPositionFromIndex(index.increment()),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr += char;\n\t\t\t}\n\t\t}\n\n\t\treturn str;\n\t}", "function accessor(proto, k) {\n\t\tif (k.length > 0 && k.charAt(0) == \"_\") {\n\t\t\tproto[k.substr(1)] = function(v) {\n\t\t\t\tif (typeof v == \"undefined\") return this[k];\n\t\t\t\tif (arguments.length > 1) {\n\t\t\t\t\tthis[k + \"_array\"] = [];\n\t\t\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\t\t\tthis[k + \"_array\"][i] = arguments[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdelete this[k + \"_array\"];\n\t\t\t\t}\n\t\t\t\tthis[k] = v;\n\t\t\t\tthis.updated[k.substr(1)] = true;\n\t\t\t\treturn this;\n\t\t\t};\n\t\t}\n\t}", "function normalize$3(a) {\n\t if (!(a instanceof Array)) {\n\t a = [a, a];\n\t }\n\t\n\t return a;\n\t }", "function buildPropertyAccess(objExpr, propertyName) {\n if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(propertyName)) {\n return objExpr + \".\" + propertyName;\n } else {\n if (!isNaN(Number(propertyName))) {\n return objExpr + \"[\" + propertyName + \"]\";\n } else {\n return objExpr + \"[\" + buildLiteralString(propertyName) + \"]\";\n }\n }\n }", "function normalizaNomeInputArray(nomeInput) {\n\tif (nomeInput.indexOf('.') == -1) {\n\t\treturn nomeInput;\n\t}\n\n\t// Quebra em partes\n\tnomeInput = nomeInput.split('.');\n\n\t// Unifica no formato certo e retorna\n\treturn nomeInput.shift() +'['+ nomeInput.join('][') +']';\n}", "function translate(str){\r\n\treturn str.replace(\"_\",\" \");\r\n}", "function showPropertyName(y){\n return ($.isString(y) ?\n ( (/[\\/;\\.]/).test(y) ? \"[\\\"\" + y + \"\\\"]\" : \".\" + y ) : \"[\" + y + \"]\");\n}", "function printArrayFieldHelpers(prefix, fields) {\r\n return fields.filter(p => !p.isDuplicate && !p.emit && isArrayType(p.type)).map(p => {\r\n return prefix \r\n + templates.arrayFieldHelper\r\n .replace(\"[NAME]\", stringToUnionCase(p.name))\r\n .replace(\"[NAME_FOR_ARRAY]\", stringToUnionCase(p.name + \"A\"))\r\n .replace(\"[TYPE]\", escape(p.type))\r\n .replace(\"[ITEM_TYPE]\", escape(getArrayItemType(p.type)))\r\n .replace(\"[COMMENT]\", p.parentName ? (\"// \" + p.parentName) : \"\");\r\n }).filter(x => x.trim().length > 0).join(\"\\n\");\r\n}", "function getPropName(prop) {\n return (Array.isArray(prop)) ? prop[0] : prop;\n }", "function unescapeIdentifier(identifier){return identifier.startsWith('___')?identifier.substr(1):identifier;}", "function stripUnderscoresFromValue(str){\r\n\tif (str){\r\n\t\tif (str.indexOf('_') != -1){\r\n\t\t\tvar newValue;\r\n\t\t\tvar newLength = str.length;\r\n\t\t\tfor (var i = str.length - 1; i >= 0; i--){\r\n\t\t\t\tif (str.charAt(i) == '_'){\r\n\t\t\t\t\tnewLength--;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Build the new value (underscored strippes from the end of the string, replaced with spaces)\r\n\t\t\tif (newLength < str.length){\r\n\t\t\t\tnewValue = str.substring(0, newLength);\r\n\t\t\t\tfor(var i=0,iL=(str.length-newLength);i<iL;++i){\r\n\t\t\t\t\tnewValue = newValue + \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn newValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn str;\r\n}", "function translate(varName)\n{\n with(this)\n {\n var name = varName.toLowerCase();\n if(name.indexOf(\"[\") != -1)\n name = name.substr(0, name.indexOf(\"[\"));\n // does javascript do perl type substitution?? i wish\n if(name == \"definitions\")\n return definitions;\n else if(name == \"service\")\n return service;\n else if(name == \"porttype\")\n return porttype;\n else if(name == \"binding\")\n return binding;\n } \n}", "function thunk(str){return str.replace(/-/g,'_').toUpperCase();}", "function normalize(namePath) {\n return namePath\n .map(function (cell) {\n return ''.concat(_typeof(cell), ':').concat(cell);\n }) // Magic split\n .join(SPLIT);\n}", "function toIdentifier(name){\n\tvar parts = name.split(/\\W+/)\n\tparts = _.map(parts, function(part){\n\t\treturn part.replace(/^./, function(chr){ return chr.toUpperCase() })\n\t})\n\t\n\treturn parts.join('')\n}", "function createAccTextFromArray(arr,keyPrefix,textSuffix){\r\n\t\tvar ret={};\r\n\t\tif (arr) {\r\n\t\t\tfor (var i=0,len=arr.length;i<len;i++){\r\n\t\t\t\tret[(keyPrefix||'')+arr[i].noSpaces().toLowerCase()]=arr[i].upperWords()+(textSuffix||'');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "function createAccTextFromArray(arr,keyPrefix,textSuffix){\r\n\t\tvar ret={};\r\n\t\tif (arr) {\r\n\t\t\tfor (var i=0,len=arr.length;i<len;i++){\r\n\t\t\t\tret[(keyPrefix||'')+arr[i].noSpaces().toLowerCase()]=arr[i].upperWords()+(textSuffix||'');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "function toClassName(name) {\n var result = '';\n var upNext = false;\n for (var i = 0; i < name.length; i++) {\n var c = name.charAt(i);\n var valid = /[\\w]/.test(c);\n if (!valid) {\n upNext = true;\n } else if (upNext) {\n result += c.toUpperCase();\n upNext = false;\n } else if (result === '') {\n result = c.toUpperCase();\n } else {\n result += c;\n }\n }\n if (/[0-9]/.test(result.charAt(0))) {\n result = '_' + result;\n }\n return result;\n}", "function namesToUppercase(currentValue, index, array){\n return currentValue.toUpperCase();\n}", "function changeCompletely(elem, index, arr){\n arr[index] = `${index}.${elem}`\n}", "function fromStringToArray(str){\n\tvar array = [];\n\tfor(var i=0,a=0; i<str.length; i++,a++){\n\t\tif(str.charAt(i) == '_'){\n\t\t\tcontinue;\n\t\t}\n\t\tarray[a] = str.charAt(i);\n\t}\n\treturn array;\n}", "function dataPrefixAttributeSelectors() {\n return replace(/\\[.+?\\]/g, function(match) {\n // trim off square brackets\n var inside = match.slice(1, -1);\n\n if (needsDataPrefix(inside)) {\n return addDataPrefix(inside);\n } else {\n return match;\n }\n });\n}", "function extractFullName(arr) {\n\treturn arr.map(function(val){\n\t\treturn val.first + \" \" + val.last;\n\t});\n}", "function cleanNames(arr) {\n if (!Array.isArray(arr)) return null;\n if (!arr.every((x) => typeof x === \"string\")) return null;\n return arr.map((x) => x.trim());\n}", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function removeSpaces(word){\n var newString = word.split(' ').join('_');\n return newString;\n}", "function findVariableNameInAString(input) {\n const regex = /\\b_([a-zA-Z\\d]+)\\b/gm;\n let match = regex.exec(input);\n let result = [];\n while(match) {\n result.push(match[1]);\n match = regex.exec(input);\n }\n\n console.log(result.join(','));\n}", "function capitalizeNames(arr){\r\n return arr.map(function(word){\r\n var name = word.charAt().toUpperCase()\r\n var fullname = word.slice(1).toLowerCase()\r\n return name+fullname \r\n\r\n\r\n });\r\n \r\n}", "mapValue(value) {\n return `${value}`.replace(/\\-/g, \"_\")\n }", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function toUnderscore(string) {\n string = string.toString()\n string = string.split('')\n string[0] = string[0].toLowerCase()\n for (let i = 0; i < string.length; i++) {\n if (parseInt(string[i])){\n continue\n }\n \n if (string[i] === string[i].toUpperCase()){\n string[i] = string[i].toLowerCase()\n string.splice(i, 0, '_')\n }\n }\n string = string.join('')\n return string\n }", "function toIdentifier(str){return str.split(' ').map(function(token){return token.slice(0,1).toUpperCase()+token.slice(1);}).join('').replace(/[^ _0-9a-z]/gi,'');}", "makeIdentifier(parts = []) {\n if (_.isString(parts)) {\n parts = [parts];\n }\n else if (!_.isArrayLikeObject(parts)) {\n throw new Error(\n 'input provided to makeIdentifier no array or object-like.'\n );\n }\n\n let formatted = _.filter(\n _.map(_.filter(parts), p => {\n return p\n .toString()\n .replace(/([0-9]{4})-([0-9]{2})-([0-9]{2})/g, '$1$2$3')\n .replace(/(^|\\s)u\\.s\\.a?(\\s|\\.|$)/gi, '$1us$2')\n .replace(/[^0-9a-z-]/gi, '')\n .trim();\n })\n );\n\n return _.kebabCase(formatted.join(' '));\n }", "function elementaryName (name) {\n\t if (name.startsWith('int[')) {\n\t return 'int256' + name.slice(3)\n\t } else if (name === 'int') {\n\t return 'int256'\n\t } else if (name.startsWith('uint[')) {\n\t return 'uint256' + name.slice(4)\n\t } else if (name === 'uint') {\n\t return 'uint256'\n\t } else if (name.startsWith('fixed[')) {\n\t return 'fixed128x128' + name.slice(5)\n\t } else if (name === 'fixed') {\n\t return 'fixed128x128'\n\t } else if (name.startsWith('ufixed[')) {\n\t return 'ufixed128x128' + name.slice(6)\n\t } else if (name === 'ufixed') {\n\t return 'ufixed128x128'\n\t }\n\t return name\n\t}", "static getSortKeyIgnoringUnderscore(identifier) {\n let parts;\n if (identifier[0] === '_') {\n const withoutUnderscore = identifier.substr(1);\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\n }\n else {\n parts = [identifier.toLowerCase(), '*', identifier];\n }\n return parts.join('');\n }", "function tidyName(name) {\n var result = name.replace(/-/g, \" \");\n result = result.substr(0, 1).toUpperCase() + result.substr(1);\n return result;\n}", "function capitalizeNames(arr){\n properNames = arr.map(function(name){\n lowercase = name.toLowerCase()\n uppercase = lowercase[0].toUpperCase()\n proper = uppercase + lowercase.substring(1,lowercase.length)\n return proper\n })\n //console.log (properNames)\n}", "function getFieldName(input){\n\treturn input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function underscore (s) {\n return s.replace(/-/g, '_')\n}", "function underscoreToSpaces(string) {\n return string.split(\"_\").join(\" \");\n}", "function getPropertyName(parentName, parent, indexer) {\n\t\tvar propertyName = parentName || \"\";\n\t\tif (exports.getType(parent) === \"array\") {\n\t\t\tif (parentName) {\n\t\t\t\tpropertyName += \"[\" + indexer + \"]\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (parentName) {\n\t\t\t\tpropertyName += \".\";\n\t\t\t}\n\t\t\tpropertyName += indexer;\n\t\t}\n\t\treturn propertyName;\n\t}" ]
[ "0.6083765", "0.6083765", "0.6016209", "0.59452313", "0.5863515", "0.56995344", "0.5670354", "0.55625224", "0.5526872", "0.54653025", "0.5438944", "0.53927195", "0.53881425", "0.5387266", "0.53272283", "0.5309225", "0.5305594", "0.52917945", "0.5289355", "0.5289287", "0.52698845", "0.5251565", "0.5219054", "0.5213395", "0.5211208", "0.5174757", "0.51736945", "0.5155324", "0.51497066", "0.5144773", "0.5132557", "0.5081723", "0.5080561", "0.5077508", "0.5072107", "0.5061086", "0.50520897", "0.5047754", "0.5047704", "0.5034467", "0.50258505", "0.50251514", "0.50200313", "0.50045824", "0.49944592", "0.4978709", "0.49770257", "0.49675453", "0.4930321", "0.49236912", "0.4923317", "0.49192834", "0.489867", "0.4894994", "0.48875314", "0.48860952", "0.488151", "0.48786125", "0.48708805", "0.48675779", "0.4865805", "0.48536304", "0.485288", "0.48487318", "0.48460743", "0.48404846", "0.48374197", "0.48230052", "0.48181355", "0.4817017", "0.4816465", "0.48157334", "0.48137128", "0.48137128", "0.48119575", "0.4801647", "0.4799714", "0.47988194", "0.4788699", "0.47871125", "0.47869876", "0.47863492", "0.47863492", "0.4780775", "0.47739765", "0.4771311", "0.47707343", "0.47677916", "0.47677916", "0.47658405", "0.47650555", "0.4764326", "0.47565356", "0.47544414", "0.4754072", "0.47530913", "0.47495964", "0.47454822", "0.4742722", "0.47375783" ]
0.8395666
0
Adjust the row counter to the next row. If the number of rows exceeds the maximum start a new column
function nextRow(pageFile, variableName, fullVariableName, row) { // Check if the row counter is at the maximum if (rowCount >= maxNumRows) { // Step through the rows in the data that have been processed for (; row >= 0; row--) { // Get the header (structure) name for this row var headerName = fullHeaderNames[row]; // Check if the variable belongs to the same structure if (headerName != "" && fullVariableName.equals(headerName + "_" + variableName)) { // Update the column header lastSubStructureName = headerNames[row]; } } // Go to the next column columnCount++; ccdd.writeToFileLn(pageFile, "## col_max_len going from " + maxColumnLength + " back to " + columnStep); rowCount = 1; columnOffset = +columnOffset + +maxColumnLength + 2; maxColumnLength = columnStep; // Check if the current variable is a member within an array if (inMiddleOfArray) { ccdd.writeToFileLn(pageFile, "array_fmt(1, " + columnOffset + ",\"" + nextColumnHeader + "\")"); } // Not a variable within an array else { ccdd.writeToFileLn(pageFile, "(1, " + columnOffset + ",\"" + lastSubStructureName + "\")"); } } // Not at the maximum row else { rowCount++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render_next_row() {\n\n current_row = (current_row + 1) % DataManager.imported_data.length;\n render_row(current_row);\n\n}", "function getNextEditableRow() {\r\n\t\t\trowNum = parseInt(rowNum) + 1;\r\n\t\t\teditableFieldsList = getEditableFieldListInOrder(nmsp, rowNum);\r\n\t\t\tvar maxVisibleRowNum = parseInt(grid.getRowCount()) + parseInt(initRowNum);\r\n\t\t\tif (editableFieldsList && editableFieldsList.length > 0) {\r\n\t\t\t\tnextEditableCol = editableFieldsList[0];\r\n\t\t\t\tnextEditableFieldId = getNextGridFieldId(rowNum, nextEditableCol);\r\n\t\t\t} else if (maxVisibleRowNum < rowNum && grid.getBodyContainer().maxVerticalScrollPosition > $(gridBlockElem).scrollTop()) { // if maximum number visible rows exceeded then scroll write the next set\r\n\t\t\t\tvar ypos = $(gridBlockElem).scrollTop() + grid.getBodyContainer().height - grid.getBodyContainer().verticalMask;\r\n\t\t\t\tif (grid.getBodyContainer()._calculatedTotalHeight > ypos) {\r\n\t\t\t\t\t$(gridBlockElem).animate({\r\n\t\t\t\t\t\t'scrollTop': ypos\r\n\t\t\t\t\t}, 300, '', function () {\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\trowNum = initRowNum;\r\n\t\t\t\t\t\t\tgetNextEditableRow();\r\n\t\t\t\t\t\t}, 400);\r\n\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else if ((grid.getBodyContainer().maxVerticalScrollPosition > $(gridBlockElem).scrollTop()) || (Object.keys(nmsp.rowEditableColumnMap).length > rowNum))\r\n\t\t\t\tgetNextEditableRow();\r\n\t\t}", "function WSetRow(num)\n{\n if (num < 0) \n this.currow = 0;\n else if (num >= this.rows)\n this.currow = this.rows - 1;\n else\n this.currow = num;\n}", "function WNextRec()\n{\n this.WSetRow(this.currow + 1);\n}", "function setRowNumber() {\n $self.find('td.js-row-no').each(function (i) {\n i = i + 1;\n $(this).text(i);\n });\n }", "setNextRowActive() {\n this._activeRowIndex < 0 ? this.setFirstCellActive() : this._setActiveCellByDelta(1, 0);\n }", "function startNewRow (index, count) {\n console.log(index, count);\n return ((index) % count) === 0;\n }", "function renumberRemainingRows(newRow, isIncreasing) {\n\n\tvar currentRow = $(newRow).next();\n\twhile($(currentRow).html() != null) {\n\t\t// Call changeRowNumbering to set attributes of currentRow\n\t\tchangeRowNumbering(currentRow, isIncreasing, false);\n\t currentRow = $(currentRow).next();\n\t}\n}", "@computed get currentRow() { return `row_${this.currentStep - 1}` }", "editNextCell() {\n if (!this.editing)\n return;\n var rowCount = this.table.find('tr.row').length - 1;\n var colCount = this.columns.count;\n var row = this._editingTd.data('rowIndex');\n var col = this._editingTd.data('columnIndex');\n if (col == colCount - 1 && row == rowCount - 1)\n return;\n if (col == colCount - 1) {\n col = 0;\n row++;\n }\n else {\n col++;\n }\n this.editCellAt(col, row);\n }", "function updateRowNumberColumn() {\n // Update row number column size\n if (component.controller.rowNumbers) {\n // Get string size\n var rowNumberColumnSize = (String(getLastRecord()).length + 1) * component.scope.charSize;\n // Change column width\n var column = grid.api.grid.getColumn(\"rowNum\");\n var prevRowNumberWidth = column.width;\n if (prevRowNumberWidth !== rowNumberColumnSize) {\n column.width = Math.max(column.minWidth, rowNumberColumnSize);\n finishPendingActions();\n }\n }\n }", "insertRowAfter() {\n this.insertRow(1);\n }", "setNextColumnActive() {\n this._activeRowIndex < 0 ? this.setFirstCellActive() : this._setActiveCellByDelta(0, 1);\n }", "updateRowCount(highestRowCount6)\n { \n let tempAddRowcount = highestRowCount6 - currentRowCount6\n let i = 0;\n \n for(i;i<(tempAddRowcount*6);i++)\n {\n //Add row empties with ids\n this.createEmptyRow();\n }\n\n this.rowCount6 = highestRowCount;\n }", "function onNewTopRow() {\n increaseScore(20);\n }", "function fillrowuntil(rownum, colnum){\n \ttn = {};\n \tbeforelength = two_dim_arr[rownum].length;\n \tconsole.info( typeof two_dim_arr[rownum][beforelength-1] == 'object' ? two_dim_arr[rownum][beforelength-1].colnum + two_dim_arr[rownum][beforelength-1].colspan : 0+1);\n \t\n \tvar pointer = ( typeof two_dim_arr[rownum][beforelength-1] == 'object' ? two_dim_arr[rownum][beforelength-1].colnum + two_dim_arr[rownum][beforelength-1].colspan : 0+1);\n \tfor(pointer; pointer <= colnum; pointer ++){\n \t\ttn.raw = '|';\n\t\t\t\ttn.text = ' ' + '\\n';\n\t\t\t\ttn.l = ' ';\n\t\t\t\ttn.r = ' ';\n\t\t\t\ttn.colnum = pointer;\n\t\t\t\ttn.rownum = rownum;\n\t\t\t\ttn.colspan = 1;\n\t\t\t\ttn.rowspan = 1;\n\t\t\t\ttn.height = 1;\n\t\t\t\ttn.h_align = 'default';\n\t\t\t\ttn.v_align = 'default';\n\t\t\t\t\n\t\t\t\ttwo_dim_arr[rownum].push(tn);\n\t\t\t\tconsole.warn('this row was extended to be able to put the content somewhere');\n if(debug){\n console.log(two_dim_arr[rownum]);\n }\n\t\t\t}\n }", "function addRowIndex() {\r\n const table = $('#main').DataTable();\r\n \r\n table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {\r\n const data = this.data();\r\n data[0] = rowIdx + 1;\r\n this.data(data);\r\n });\r\n}", "function incrementColumn() {\n GameData.column = correctColumn(GameData.column++);\n}", "function addRow(table) {\n var row = table.insertRow(table.rows.length);\n var cell = null;\n for (var i = 0; i < 5; i++) {\n cell = row.insertCell(i);\n if (i == 0) {\n cell.innerHTML = table.rows.length - 1;\n } else {\n cell.setAttribute(\"contenteditable\", \"true\");\n }\n }\n }", "function component_viewer_res_data_calc_next_avail() {\n\tvar next_row = ic_soa_data_getSheetMetrics()[\"RESOURCEALLOCATION\"].toprow;\n\tfor (var cur_do = 0; cur_do < dataObjects.RESOURCEALLOCATIONkeys.length; cur_do++) {\n\t\tvar res_alloc_obj = dataObjects.RESOURCEALLOCATIONs[dataObjects.RESOURCEALLOCATIONkeys[cur_do]];\n\t\tif (res_alloc_obj.sheet_row >= next_row) next_row = res_alloc_obj.sheet_row+1;\n\t};\n\tcomponent_viewer_res_data_glob.next_avail = {\n\t\tnext_row: next_row\n\t};\n\t//console.log(\"Next row is \" + next_row);\n}", "function changeRowNumbering(row, isIncreasing, creatingNewRow) {\n\n // Change row label contents\n var rowLabelElt = row.find(\"label\");\n var curRowNum = rowLabelElt.html();\n var rowQstIdAttr = rowLabelElt.attr(\"for\");\n \n // Update row label\n if(isIncreasing) {\n curRowNum++;\n }\n else {\n curRowNum--;\n }\n rowLabelElt.html(curRowNum);\n\n // Update question input\n var rowQstInputElt = row.find(\"input#\"+rowQstIdAttr);\n //var increaseNumbering = true;\n //steve talk to me about this change\n var increaseNumbering = isIncreasing;\n var newRowQstIdAttr = changeNumInString(rowQstIdAttr, increaseNumbering);\n var newRowQstNameAttr = changeNumInString(rowQstInputElt.attr(\"name\"), increaseNumbering);\n rowLabelElt.attr(\"for\",newRowQstIdAttr);\n rowQstInputElt.attr(\"id\",newRowQstIdAttr);\n rowQstInputElt.attr(\"name\",newRowQstNameAttr);\n\n // Update answer input\n var rowAnsInputElt = row.find(\"input:last\");\n var newRowIdAttr = changeNumInString(rowAnsInputElt.attr(\"id\"), increaseNumbering);\n var newRowNameAttr = changeNumInString(rowAnsInputElt.attr(\"name\"), increaseNumbering);\n rowAnsInputElt.attr(\"id\",newRowIdAttr);\n rowAnsInputElt.attr(\"name\",newRowNameAttr);\n \n // Update Order value\n var rowOrderInputElt = row.find(\"input[name$='[card_order]']\");\n var rowOrderIdAttr = rowOrderInputElt.attr(\"id\");\n var rowOrderValueAttr = parseFloat(rowOrderInputElt.attr(\"value\"));\n var newRowOrderIdAttr = changeNumInString(rowOrderIdAttr, increaseNumbering);\n var newRowOrderNameAttr = changeNumInString(rowOrderInputElt.attr(\"name\"), increaseNumbering);\n \n rowOrderInputElt.attr(\"id\",newRowOrderIdAttr);\n rowOrderInputElt.attr(\"name\",newRowOrderNameAttr);\n \n if(increaseNumbering) {\n newRowOrderValueAttr = rowOrderValueAttr + 1;\n }\n else {\n newRowOrderValueAttr = rowOrderValueAttr - 1;\n }\n rowOrderInputElt.attr(\"value\",newRowOrderValueAttr);\n \n \n // Update Id value\n var rowIdInputElt = row.find(\"input[name$='[id]']\");\n var rowIdIdAttr = rowIdInputElt.attr(\"id\");\n //checks to make sure this input element exists\n //this only exists on the edit decks page\n if (rowIdIdAttr != null) {\n \n var newRowIdIdAttr = changeNumInString(rowIdIdAttr, increaseNumbering);\n var newRowIdNameAttr = changeNumInString(rowIdInputElt.attr(\"name\"), increaseNumbering);\n \n rowIdInputElt.attr(\"id\",newRowIdIdAttr);\n rowIdInputElt.attr(\"name\",newRowIdNameAttr);\n //alert(rowIdInputElt.attr(\"value\") + \" \" + rowIdIdAttr +\" \" + newRowIdNameAttr);\n }\n \n // Clear the field values if row is new\n if(creatingNewRow) {\n rowQstInputElt.attr(\"value\",\"\");\n rowAnsInputElt.attr(\"value\",\"\");\n rowIdInputElt.attr(\"value\",\"\");\n \n }\n}", "function addNextCell(row, attributes) {\n const aCell = row.insertCell(-1);\n [aCell.colSpan] = attributes;\n if (attributes[2]) { aCell.className = 'header'; }\n insertElement(aCell, attributes[1]);\n return aCell;\n}", "function TableInitial(table_id, col_count, max_row_count) {\n if (max_row_count == undefined)\n {\n max_row_count = TABLE_ROW_COUNT;\n }\n\n if (col_count == undefined)\n {\n col_count = 14;\n }\n var table = document.getElementById(table_id);\n\n var row_count = table.tBodies[0].rows.length;\n\n\n while (row_count < max_row_count) {\n var new_row = table.tBodies[0].insertRow(row_count);\n\n for (var cell_index = 0; cell_index < col_count; cell_index++) {\n var cell = new_row.insertCell(-1);\n }\n //new_row.style.height = TABLE_ROW_HEIGHT;\n row_count = table.tBodies[0].rows.length;\n }\n\n // set row height\n\n for (var row_index = 0; row_index < row_count; row_index++) {\n var rows = table.tBodies[0].rows;\n rows[row_index].style.height = TABLE_ROW_HEIGHT;\n }\n\n // bind checkbox function\n TableCheckBoxInit(table_id);\n // TODO: highlight row by row\n}", "function createNextFieldsCell(dataGridRecordNumber) {\n var cell, table;\n if (dataGridRecordNumber === self.recordHeader || dataGridRecordNumber === self.recordSearchInsert) {\n table = self.headerElem;\n } else {\n table = self.tableElem;\n }\n var recordNumber = dataGridRecordNumber - self.recordHeader;\n if (typeof self.pivot !== \"undefined\" && self.pivot == true) {\n // maybe move this into create record?? no b/c I have to set the row each time I iterate to new field\n self.tbl_cols = recordNumber;\n if (self.tbl_rows >= table.rows.length) { // row not there so create it\n debugger;\n alert(\"when is this code ever executed\");\n row = table.insertRow(self.tbl_rows);\n\n } else {\n row = table.rows[self.tbl_rows];\n }\n\n cell = row.insertCell(self.tbl_cols);\n cell.id = table.id+\",\"+ self.tbl_rows + \",\" + self.tbl_cols;\n self.tbl_rows++;\n } else {\n cell = row.insertCell(self.tbl_cols);\n cell.id = table.id+\",\"+ recordNumber + \",\" + self.tbl_cols;\n self.tbl_cols++;\n }\n // highlight rows after a sort\n if (typeof self.idsHighlighted !== 'undefined') {\n for (var i = 0; i < self.idsHighlighted.length; i += 1) {\n if (self.idsHighlighted[i] === data.grid[dataGridRecordNumber][self.primaryKey]) {\n self.highlightRow(row, true);\n //cell.className = 'highlightedrow ' + cell.className;\n break;\n }\n }\n }\n return cell;\n }", "updateSize() {\n\t\tvar t = this;\n\t\tvar len = t.getLength();\n\t\tif (len == 0) {\n\t\t\tt.setLength(1);\n\t\t} if (len > 0) {\n\t\t\tvar needsNew = !t.isRowBlank(t.getRow(len - 1));\n\t\t\tif (needsNew)\n\t\t\t\tt.setLength(len + 1);\n\t\t\telse if (len > 1) {\n\t\t\t\tvar needsRem = t.isRowBlank(t.getRow(len - 1));\n\t\t\t\tif (needsRem) {\n\t\t\t\t\tt.setLength(len - 1);\n\t\t\t\t\tt.updateSize();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "set _physicalStart(val){val=val%this._physicalCount;if(0>val){val=this._physicalCount+val}if(this.grid){val=val-val%this._itemsPerRow}this._physicalStartVal=val}", "function dap_nextRow()\n{\n\tthis.saveData(this.getCurrentRow());\n\tif (this.DynamicTable.nextRow() == true)\n\t{\n\t\tvar boolflag = this.DataSource[this.getRecordIndex(\n\t\t\t\tthis.getCurrentRow())][this.DataSource[0].length-1];\n\t\tthis.DynamicTable.disableRow(this.getCurrentRow(),\n\t\t\t\t((boolflag == constLoadStatus)||(boolflag == constUpdateStatus)));\n\t}\n}", "function addColumn(){\r\n $('tr').append('<td></td>');\r\n column++;\r\n }", "_addRow() {\n const indicativeRow = this._hoveredCell.closest('TR');\n let index = this._getHoveredSideOfContainer();\n\n if (index === 1) {\n index = indicativeRow.sectionRowIndex;\n // if inserting after hovered cell\n index = index + this._isBottomOrRight();\n }\n\n this._table.addRow(index);\n }", "function render_prev_row() {\n\n current_row = (current_row == 0) ? current_row : current_row - 1;\n render_row(current_row)\n\n}", "grow() {\n let lastTail = this.tail[tail.length - 1];\n if (this.tail.length < 1) {\n lastTail = this.tail[tail.length];\n }\n this.tail.push(new Position(lastTail.row, lastTail.column));\n score += 10;\n }", "function numberRows() {\n if(name != meshShorts) {\n $(\".row_number\").each(function(i) {\n var n = ++i;\n var row_number = (\"0\" + n).slice(-2);\n $(this).find(\"font\").text(row_number);\n });\n $(\".row_number_mobile\").each(function() {\n var row_number_mobile = $(this).parent().prev().find('td:first').text()\n $(this).find(\"font\").text(row_number_mobile);\n });\n }\n }", "initRow() {\n let prevSetNr = 1; // previous set number holder\n for (let i = 1; i <= this.width; i++) {\n // Initialize cells that are not yet initialized by previous row\n if (!this.cell[i]) {\n for (let j = prevSetNr; j <= this.width; j++) {\n if (!this.set[j]) {\n prevSetNr = j;\n break;\n }\n }\n this.set[prevSetNr] = [i];\n this.cell[i] = prevSetNr;\n }\n }\n }", "_incrementMaxIndex() {\n if (this._maxIndex < this._capacity) {\n this._maxIndex++;\n }\n }", "_updateGridRows() {\n\n [...this.element.children].forEach((item, i) => {\n let index = i % this.maxItemsPerRow;\n let position;\n if ( index === 0){\n this.rows.push([]);\n }\n\n position = this._getItemPosition(index);\n this.rows[this.lastIndex].push({item: item, position: position});\n });\n }", "function handleNextButtonClick() {\n count++;\n renderTable();\n}", "function handleNextButtonClick() {\n count++;\n renderTable();\n}", "function ResetRowNumber(grd) {\n var items = grd.getData();\n if (items != null) {\n for (var i = 0; i < items.length; i++) {\n items[i].RowNum = i + 1;\n grd.updateRow(i, items);\n grd.updateRowCount();\n grd.render();\n }\n }\n }", "function rowCalc(num){\n var row = num;\n while (row>3){\n row -= 3;\n }\n return row;\n}", "next() {\n const that = this,\n availableItems = that.dataSource.length;\n \n if (that.disabled || availableItems === 0) {\n return;\n }\n\n let nextItem = that._currentIndex;\n\n if(that.loop){\n nextItem = nextItem >= availableItems-1 ? 0 : nextItem + 1;\n }\n else {\n nextItem = nextItem >= availableItems-1 ? nextItem : nextItem + 1;\n }\n\n that._goToItem(nextItem);\n }", "function WEndRec()\n{\n this.WSetRow(this.rows - 1);\n}", "function adjustRowStatuses() {\n for (var i = 0; i < $scope.rows.length; i++) {\n if ($scope.rows[i].status === 'Not Started') {\n $scope.rows[i].status = 'Next';\n break;\n }\n }\n }", "function renumberColumns(){\n\t\t$(table + \"tr:first td\").each(function(i){\n\t\t\t$(this).attr(\"id\", i+1);\t\n\t\t});\n\t}", "set _physicalStart(val){val=val%this._physicalCount;if(val<0){val=this._physicalCount+val;}if(this.grid){val=val-val%this._itemsPerRow;}this._physicalStartVal=val;}", "next () {\n const before = this.value\n if (this.value < this.list.length - 1) this.$emit('input', this.value + 1)\n if (!this.scroll) return\n\n this.$nextTick(() => {\n if (this.value === before) return\n const list = this.$refs.list\n const cur = list.querySelector('.sm-over').getBoundingClientRect()\n const listPos = list.getBoundingClientRect()\n const dist = (list.scrollTop + cur.bottom) - listPos.bottom\n if (dist > 0) {\n // when current row is the last row, the scroll bar moves directly to the bottom\n if (this.value === this.list.length - 1) {\n list.scrollTop = dist + Number.parseInt(window.getComputedStyle(list).paddingBottom)\n } else {\n list.scrollTop = dist\n }\n }\n })\n }", "function agregarNumeracionItem() {\n var tablaC = document.getElementById(\"tablaBodyCotizacion\"),\n rIndex;\n var nFilas = $(\"#tablaBodyCotizacion > tr\").length;\n for (var i = 0; i < nFilas; i++) {\n tablaC.rows[i].cells[0].innerHTML = i + 1;\n\n }\n\n}", "function changeCurrentRow(){\r\n currentRow -= 1;\r\n var mult = 4;\r\n\r\n currentBoardCells = [\r\n \"board\" + (currentRow*mult-4), \r\n \"board\" + (currentRow*mult-3), \r\n \"board\" + (currentRow*mult-2), \r\n \"board\" + (currentRow*mult-1)];\r\n currentPegCells = [\r\n \"peg\" + (currentRow*mult-4), \r\n \"peg\" + (currentRow*mult-3), \r\n \"peg\" + (currentRow*mult-2), \r\n \"peg\" + (currentRow*mult-1)];\r\n }", "insertColumnAfter() {\n this.insertColumn(1);\n }", "function _pushMoreRows(prevInd, limit, pushMoreID) {\n if ($rootScope.pushMoreID === pushMoreID) {\n var nextLimit = prevInd + limit;\n // combines all of the second array (rowValues) with the first one (vm.rowValues)\n Array.prototype.push.apply(vm.rowValues, rowValues.slice(prevInd, nextLimit));\n if (rowValues[nextLimit]) {\n $log.debug(\"counter\", current, \": recurse with\", vm.rowValues.length);\n $timeout(function () {\n if ($rootScope.pushMoreID === pushMoreID) {\n _pushMoreRows(nextLimit, limit, pushMoreID);\n } else {\n $log.debug(\"current global counter: \", vm.flowControlObject.counter);\n $log.debug(\"counter\", current, \": break out of timeout inside push more rows\");\n $log.debug(\"counter\", current, \": with uuid\", pushMoreID);\n $log.debug(\"counter\", current, \": with global uuid\", $rootScope.pushMoreID);\n vm.pushRowsSpinner = false;\n }\n });\n } else {\n // we reached the end of the data to page in\n vm.pushRowsSpinner = false;\n }\n } else {\n $log.debug(\"current global counter: \", vm.flowControlObject.counter);\n $log.debug(\"counter\", current, \": break out of push more rows\");\n $log.debug(\"counter\", current, \": with uuid\", pushMoreID);\n $log.debug(\"counter\", current, \": with global uuid\", $rootScope.pushMoreID);\n vm.pushRowsSpinner = false;\n }\n }", "function prepData(rows) {\n var i = 1;\n rows.forEach( (row) => {\n row.index = i;\n if (row.Count) {\n row.Count = +row.Count;\n }\n i++;\n });\n return rows;\n}", "function getRow(i) {\n return Math.ceil((i+1)/3);\n}", "function _addDeadRow(amount) {\n for (const i = 0; i < amount; i++) {\n let row = [];\n for(let j = 0; j < consts.COLUMN_COUNT; j++){\n row.push('#000000');\n }\n matrix.push(row);\n matrix.shift();\n }\n}", "_transform(row, encoding, callback) {\n const xlsxRow = (0, _templates.Row)(this.rowCount, row, this.format, this.styles);\n this.rowCount++;\n callback(null, xlsxRow);\n }", "nextStop(x) {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[++x] && x < this._cols)\n ;\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }", "function addRowDrag(){\n\tvar column = $(this).prop(\"columnIndex\")\n\tvar workingIndex;\n\t$(this).addClass(\"loop\")\n\t\t .bind(\"mousedown\", startRowDrag)\n\t$(workingMiniLoop).each(function(index) { \n\t\t$(getTheButton(rowAffected + 12, workingMiniLoop[index])).removeClass(\"loop\")\n\t\t\t\t\t\t\t\t\t\t\t\t .addClass(\"punch\");\n\t});\n\tworkingMiniLoop = [mightJumpToHere];\n\tif(column > workingMiniLoop[0]){\n\t\tworkingIndex = column\n\t\tfor(i = 0; i < column - workingMiniLoop[0]; i++){\n\t\t\tworkingMiniLoop.push(workingIndex);\n\t\t\tworkingIndex--;\t\t\t\n\t\t}\n\t}\n\telse{\n\t\tworkingIndex = column\n\t\tfor(i = 0; i < workingMiniLoop[0] - column ; i++){\n\t\t\tworkingMiniLoop.push(workingIndex);\n\t\t\tworkingIndex++;\t\t\t\n\t\t}\n\t}\n\t$(workingMiniLoop).each(function(index) { \n\t\t$(getTheButton(rowAffected + 12,workingMiniLoop[index]))\n\t\t\t\t\t\t\t\t\t\t\t\t .addClass(\"loop\");\n\t});\n}", "function appendRowNumbers() {\n\n // Append row number to row classes\n var numberOfRows = $('.row').length;\n\n for (var i=1; i<=numberOfRows; i++) {\n var thisClass = 'row-' + i;\n var thisRow = $('.row').eq(i-1)\n thisRow.addClass(thisClass);\n }\n\n}", "function nextButtonClick() {\r\n count++;\r\n renderTable();\r\n}", "resize(newCols, newRows) {\n // store reference to null cell with default attrs\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Increase max length if needed before adjustments to allow space to fill\n // as required.\n const newMaxLength = this._getCorrectBufferLength(newRows);\n if (newMaxLength > this.lines.maxLength) {\n this.lines.maxLength = newMaxLength;\n }\n // The following adjustments should only happen if the buffer has been\n // initialized/filled.\n if (this.lines.length > 0) {\n // Deal with columns increasing (reducing needs to happen after reflow)\n if (this._cols < newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i).resize(newCols, nullCell);\n }\n }\n // Resize rows in both directions as needed\n let addToY = 0;\n if (this._rows < newRows) {\n for (let y = this._rows; y < newRows; y++) {\n if (this.lines.length < newRows + this.ybase) {\n if (this._optionsService.options.windowsMode) {\n // Just add the new missing rows on Windows as conpty reprints the screen with it's\n // view of the world. Once a line enters scrollback for conpty it remains there\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n else {\n if (this.ybase > 0 && this.lines.length <= this.ybase + this.y + addToY + 1) {\n // There is room above the buffer and there are no empty elements below the line,\n // scroll up\n this.ybase--;\n addToY++;\n if (this.ydisp > 0) {\n // Viewport is at the top of the buffer, must increase downwards\n this.ydisp--;\n }\n }\n else {\n // Add a blank line if there is no buffer left at the top to scroll to, or if there\n // are blank lines after the cursor\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n }\n }\n }\n }\n else { // (this._rows >= newRows)\n for (let y = this._rows; y > newRows; y--) {\n if (this.lines.length > newRows + this.ybase) {\n if (this.lines.length > this.ybase + this.y + 1) {\n // The line is a blank line below the cursor, remove it\n this.lines.pop();\n }\n else {\n // The line is the cursor, scroll down\n this.ybase++;\n this.ydisp++;\n }\n }\n }\n }\n // Reduce max length if needed after adjustments, this is done after as it\n // would otherwise cut data from the bottom of the buffer.\n if (newMaxLength < this.lines.maxLength) {\n // Trim from the top of the buffer and adjust ybase and ydisp.\n const amountToTrim = this.lines.length - newMaxLength;\n if (amountToTrim > 0) {\n this.lines.trimStart(amountToTrim);\n this.ybase = Math.max(this.ybase - amountToTrim, 0);\n this.ydisp = Math.max(this.ydisp - amountToTrim, 0);\n this.savedY = Math.max(this.savedY - amountToTrim, 0);\n }\n this.lines.maxLength = newMaxLength;\n }\n // Make sure that the cursor stays on screen\n this.x = Math.min(this.x, newCols - 1);\n this.y = Math.min(this.y, newRows - 1);\n if (addToY) {\n this.y += addToY;\n }\n this.savedX = Math.min(this.savedX, newCols - 1);\n this.scrollTop = 0;\n }\n this.scrollBottom = newRows - 1;\n if (this._isReflowEnabled) {\n this._reflow(newCols, newRows);\n // Trim the end of the line off if cols shrunk\n if (this._cols > newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i).resize(newCols, nullCell);\n }\n }\n }\n this._cols = newCols;\n this._rows = newRows;\n }", "function nextRow( bSuccess )\n{\n // Clear highlighting\n $( '#bgt_table > tbody .' + g_sPendingClass ).removeClass( g_sPendingClass );\n $( '#bgt_table > tbody .' + g_sSuccessClass ).removeClass( g_sSuccessClass );\n\n // If current row contains new, live data, highlight it\n if ( bSuccess && ! g_tCachedValues )\n {\n $( '#row_' + g_iRow ).addClass( g_sSuccessClass );\n }\n\n // Advance row index\n if ( g_iRow < ( g_aRows.length - 1 ) )\n {\n // Advance to next row\n g_iRow ++;\n if ( ! g_tCachedValues )\n {\n enableRefreshButton( true );\n }\n }\n else\n {\n // Finished last row\n g_iRow = 0;\n g_tCachedValues = null;\n stopRefresh();\n enableRefreshButton( true );\n $( '.sortable' ).removeClass( 'sorter-false' );\n console.log( '=> View initialized in ' + ( Date.now() - g_iStartTime ) + ' ms' );\n }\n\n // Reinitialize variables\n g_iInstanceOffset = 2;\n g_aRowData = [];\n\n // Update tablesorter event handlers\n g_tTable.off( 'sortEnd' );\n g_tTable.off( 'filterEnd' );\n g_tTable.on( 'sortEnd', onSortEnd );\n g_tTable.on( 'filterEnd', onFilterEnd );\n g_tTable.on( 'tablesorter-ready', onTablesorterReady );\n\n // Trigger event to update tablesorter cache\n g_tTable.trigger( 'update' );\n}", "function WPrevRec()\n{\n this.WSetRow(this.currow - 1);\n}", "function wrappedRowsForRow(bufferService, currentRow) {\n let rowCount = 0;\n let line = bufferService.buffer.lines.get(currentRow);\n let lineWraps = line && line.isWrapped;\n while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {\n rowCount++;\n line = bufferService.buffer.lines.get(--currentRow);\n lineWraps = line && line.isWrapped;\n }\n return rowCount;\n}", "add6Row()\n {\n\n //loop through (6 times)*(rowCount)\n //give ids based on row\n\n }", "function addColumn(row) {\n\n var gridSize = 0;\n for (var i = 0; i < row.cols.length; i++) {\n\n var size = row.cols[i].cssClass.substr(row.cols[i].cssClass.length - 2);\n size = parseInt(size.replace(/-/g, ''));\n gridSize = gridSize + size;\n }\n if (gridSize < 12) {\n row.cols.push(OdsFormService.newColumnObject(12 - gridSize));\n } else {\n dialogs.notify('Notification', 'Columns can\\'t be greater than 12 columns, please fix it!!!',\n {size: 'sm', windowClass: 'ods-dialog'}).result.then(function () {\n });\n }\n }", "function populateCurrentColumn(){\n for( var i = 0; i < totalTableRows; i++ ){\n var x = tbl.tBodies[0].rows[i].cells[currentIndex];\n //currentColumn.push(x);\n currentColumn.push(x.cloneNode(true));\n }\n }", "function increaseDifficulty() {\n setGridInvisible();\n if (!isGreatestDimension()) {\n if (row < col) {\n setGrid(row+1, col);\n } else {\n setGrid(row, col+1);\n }\n }\n resetGrid(\"increase\");\n}", "function appendDownRow(x)\n{\n\tvar tb1 = document.getElementById('qis');\n\tvar row = tb1.insertRow(x + 1); //localizar el ultimo renglon de la tabla para añadir uno nuevo\n\tvar i = 0;\n\tfor(i = 0; i < tb1.rows[0].cells.length; i++)//conocer cuantas celdas hay en los renglones para añadirlos al nuevo renglon.\n\t{\n\t\tcreateCell(row.insertCell(i),i,0);\n\t}\n}", "function maxRow(add,remove,max,index)\r\n{\t\r\n\tif(index<max){\r\n\t\t$('#'+add).attr('style','');\r\n\t\t$('#'+remove).attr('style','');\r\n\t\tif(index==0){\r\n\t\t\t$('#'+add).attr('style','');\r\n\t\t\t$('#'+remove).attr('style','display:none');\r\n\t\t}\r\n\t}else{\r\n\t\t$('#'+add).attr('style','display:none');\r\n\t\t$('#'+remove).attr('style','');\r\n\t}\r\n}", "get rowsCount() {\n return (this.endRow - this.startRow) + 1\n }", "next() {\n if (this.hasNext()) {\n this.setState({\n offset: Math.max(0, this.state.offset - 1),\n });\n }\n }", "onAddClick() {\n var newRow = this.state.rows\n this.num = this.num + 1\n newRow = newRow.concat(<Row name={this.num}/>)\n this.setState(\n {\n rows: newRow\n }\n )\n }", "function _helper(lastRow){\n // console.log('xx helper');\n if (options.maxRows && rows > options.maxRows || options.truncate && lastRow && rows > 1) row[currentImageIndex][0].style.display = 'none';\n else {\n // console.log(row[currentImageIndex][4]);\n if (row[currentImageIndex][4]) {\n row[currentImageIndex][3].setAttribute('src', row[currentImageIndex][4]);\n row[currentImageIndex][4] = '';\n }\n row[currentImageIndex][0].style.width = newWidth+'px';\n row[currentImageIndex][0].style.height = row_h+'px';\n row[currentImageIndex][0].style.display = 'block';\n }\n }", "incrCursor() {\n const last = this.getLastHistory().groups;\n if (this.cursorIndex === null) {\n this.cursorIndex = 0;\n return;\n }\n if (this._overwrite) {\n if (this.cursorIndex < last.length) {\n // ?\n this.cursorIndex++;\n } else {\n return;\n }\n }\n if (!this._overwrite) {\n if (this.cursorIndex < last.length - 1) {\n // ?\n this.cursorIndex++;\n } else {\n }\n }\n }", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n } else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "boldColumn(lastSlotNum) {\n for (let i = lastSlotNum; i >= 0; i -= 7) {\n this.getSlot(i).style.border = '4px solid black';\n }\n }", "function extendList(btn) { // btn is an a-tag in this case\n const ROWS_TO_EXPAND = 10;\n var addedRows = 0;\n var showMoreRow = btn.parentNode.parentNode;\n var currentRow = showMoreRow;\n\n while (currentRow.nextElementSibling !== null && addedRows < ROWS_TO_EXPAND) {\n currentRow.nextElementSibling.removeAttribute('style');\n currentRow = currentRow.nextElementSibling;\n addedRows++;\n }\n if (currentRow.nextElementSibling !== null) currentRow.insertAdjacentHTML('afterend', '<tr>' + showMoreRow.innerHTML + '</tr>');\n showMoreRow.remove();\n}", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n\n let accumulatedHeight = 0;\n\n // Repeat until we have filled empty height\n while (\n accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not run move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n }", "set rows(value) {\n Helper.UpdateInputAttribute(this, 'rows', value);\n }", "function insert_Row() {\n const table = document.getElementById('sampleTable');\n let rowNumber = table.children.length+1;\n \n const newElement = `\n <tr><td>Row${rowNumber} cell1</td>\n <td>Row${rowNumber} cell2</td></tr>`\n ;\n table.innerHTML += newElement;\n}", "shiftLeft() {\n for (let line of this.cells) {\n for (let i = 0; i < line.length - 1; i++) {\n line[i].setType(line[i + 1].type);\n }\n line[line.length - 1].setType(BeadType.default);\n }\n }", "function reloadNumbers() {\n\n var counts = 0;\n\n $('tr.active').each(function() {\n if (counts === 0) {\n this.cells[0].innerHTML = '>';\n } else {\n this.cells[0].innerHTML = counts;\n }\n $('#total_columns').text('Total: ' + counts);\n\n counts++;\n });\n\n}", "initialize(size){\n for (let i = 0; i < size; i++) {\n let $row = this.$table.insertRow(i);\n for (let j = 0; j < size; j++) {\n $row.insertCell(j);\n }\n }\n }", "function onInsertRowAfter() {\n onInsertRow(1);\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n let accumulatedHeight = 0; // Repeat until we have filled empty height\n\n while (accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n\n me.trigger('renderDone');\n }", "__increment() {\n const { step, max } = this.values;\n const newValue = this.currentValue + step;\n if (newValue <= max || max === Infinity) {\n this.value = newValue;\n this.__toggleSpinnerButtonsState();\n }\n }", "handlerForwardClick() {\n let dealers = this.state.delers;\n let rows = [];\n var count = 0;\n\n if (dealers.length < this.state.pointer + 10) {\n for (var i = this.state.pointer; i < dealers.length; i++) {\n rows[count] = dealers[i];\n count++;\n }\n this.state.page += 1;\n this.setState({\n rows: rows,\n forwardDisabled: true,\n backDisabled: false\n });\n } else {\n this.state.nextPointer = this.state.pointer + 10;\n for (var i = this.state.pointer; i < this.state.nextPointer; i++) {\n rows[count] = dealers[i];\n count++;\n }\n let pointer = this.state.pointer + 10;\n this.state.page += 1;\n this.setState({\n rows: rows,\n backDisabled: false,\n pointer: pointer\n });\n }\n }", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "function addColumn() {\n if (row === 0) {\n let newRow = document.createElement(\"tr\");\n let newcol = document.createElement(\"td\");\n\n newRow.appendChild(newcol);\n table.appendChild(newRow);\n row = 1;\n } else {\n let currentRow = document.getElementsByTagName(\"tr\");\n let rowArray = Array.from(currentRow);\n rowArray.forEach((row) => {\n let newcol = document.createElement(\"td\");\n row.appendChild(newcol);\n });\n row++;\n }\n column++;\n}", "function randomRowColumnNumber(max){\n const number= Math.floor(Math.random() * max) + 1;\n return number;\n}", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }", "function setThePositions(currentR, currentC, nextR, nextC, incrNextRow, incrNextColl) {\r\n\tif(currentR && currentC && currentR !== null && currentC !== null) {\r\n\t\tlastRow = currentR;\r\n\t\tlastColl = currentC;\r\n\t}\r\n\tif(nextR && nextC && nextR !== null && nextC !== null) {\r\n\t\tcurrentRow = nextR;\r\n\t\tcurrentColl = nextC;\r\n\t}\r\n\tif(incrNextRow && incrNextColl && incrNextRow !== null && incrNextColl !== null) {\r\n\t\tnextRow = incrNextRow;\r\n\t\tnextColl = incrNextColl;\r\n\t} else {\r\n\t\tnextRow = currentRow + 1;\r\n\t\tnextColl = currentColl;\r\n\t}\r\n}", "function setNumbers() {\n\t\tvar count = 1;\n\t\t$(\"#displayTable\").find(\"tr\").each(function(count) {\n\t\t\tvar s = count;\n\t\t\t$(this).children(\"td:first\").html(s);\n\t\t\ts++;\n\t\t\t\n\t\t});\n\t\tcount = 1;\n\t}", "function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`\n while (col < endCol) {\n cell = _this.getCell(row, col);\n segsBelow = _this.getCellSegs(cell, levelLimit);\n if (segsBelow.length) {\n td = cellMatrix[levelLimit - 1][col];\n moreLink = _this.renderMoreLink(cell, segsBelow);\n moreWrap = $('<div/>').append(moreLink);\n td.append(moreWrap);\n moreNodes.push(moreWrap[0]);\n }\n col++;\n }\n }", "function increaseMatrix() {\r\n storeMatrix();\r\n var matrix = getMatrix().map(row => {\r\n row.push('1');\r\n return row;\r\n });\r\n matrix.push(new Array(matrix.length + 1).fill('1'));\r\n localStorage.setItem('matrix', JSON.stringify(matrix));\r\n createTable();\r\n}", "function removeTableRow() {\n if (Number($(\"#rows\").val()) > 4) {\n $(\"tr\").last().remove();\n $(\"#rows\").prop(\"value\", Number($(\"#rows\").val()) - 1);\n }\n changes = true;\n}", "function addRow(){\r\n $('#pixel_canvas').append('<tr></tr>');\r\n var newRow=$('#pixel_canvas').children().last();\r\n for(var i=0;i<column;i++){\r\n newRow.append('<td></td>');\r\n }\r\n row++;\r\n }", "function add_horizontal_hint_row() {\n var total_litags = 0;\n var total_limit = 1;\n jQuery('#crosswordsContainerDivRowColumn .crosswords-hint-hrow-litag').each(function (index, value) {\n index += 1;\n var valueIs = jQuery('.crosswords-hint-hrowline-' + index).is(\":visible\");\n if (valueIs) {\n total_litags += 1;\n }\n total_limit++;\n });\n total_litags += 1;\n if (total_litags < total_limit) {\n jQuery('.crosswords-hint-hrowline-' + total_litags).show();\n } else {\n jQuery('.add_remove_horizontal_row_hint_msg').html('Can\\'t Add anymore!');\n jQuery('.add_remove_horizontal_row_hint_msg').delay(5000).fadeOut(1600);\n }\n var horizontal_rowcolinpval = get_all_inputfrom_hrorizontal_hint();\n jQuery('#edit-field-crosswords-hrow-0-value').val(horizontal_rowcolinpval);\n }", "function unshift(row) {\n while (row.length != 4) {\n row.unshift(0)\n }\n return row;\n}", "function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.attr(\n 'rowspan',\n parseInt(td.attr('rowspan') || 1, 10) + 1\n );\n }\n else {\n td = $('<td/>');\n tr.append(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }" ]
[ "0.6844505", "0.6307189", "0.62610507", "0.6174487", "0.611505", "0.60943776", "0.6078653", "0.6068298", "0.5975301", "0.58927864", "0.58509856", "0.58067775", "0.5770341", "0.5749379", "0.55931467", "0.5588367", "0.5585682", "0.5549195", "0.5530309", "0.5527462", "0.5525426", "0.5508305", "0.5503325", "0.5491633", "0.5490333", "0.54894584", "0.5474748", "0.5461443", "0.5434278", "0.5433155", "0.5422539", "0.5398072", "0.538703", "0.5354622", "0.5351801", "0.5338508", "0.5338508", "0.5313979", "0.53026426", "0.52935773", "0.5285301", "0.52727765", "0.527025", "0.52628905", "0.52624017", "0.5249995", "0.52495915", "0.5244615", "0.52356595", "0.52218556", "0.51916844", "0.51893497", "0.5179749", "0.5171309", "0.51712763", "0.5169552", "0.5147553", "0.5135376", "0.5132684", "0.5127312", "0.5124116", "0.51228917", "0.5104308", "0.5103665", "0.50978315", "0.5086428", "0.50828046", "0.50815636", "0.5077339", "0.5072776", "0.50718176", "0.50673467", "0.5065278", "0.5064925", "0.5063846", "0.5058279", "0.5052661", "0.5052147", "0.504851", "0.50475276", "0.5044315", "0.5040618", "0.5037574", "0.503735", "0.5022159", "0.49987978", "0.49987978", "0.49987978", "0.4995513", "0.49944302", "0.49919683", "0.49904686", "0.4983485", "0.49814227", "0.49696702", "0.49684322", "0.4966544", "0.4965281", "0.49607846", "0.49499288" ]
0.53259367
37
Check if the supplied array size contains a value
function isArrayElement(arraySize) { return arraySize != null && !arraySize.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get hasValues() {\n return this.arrayWidth > 0 && this.arrayHeight > 0;\n }", "validateArraySize (req, array) {\n const FREEMIUM_INPUT_SIZE = 20\n const PRO_INPUT_SIZE = 20\n\n if (req.locals && req.locals.proLimit) {\n if (array.length <= PRO_INPUT_SIZE) return true\n } else if (array.length <= FREEMIUM_INPUT_SIZE) {\n return true\n }\n\n return false\n }", "function is(arr){\n return typeof(arr) == \"object\" && arr.length >= 0;\n }", "function isFull(array) {\n if (array.length < maxItems) {\n return false;\n } else {\n return true;\n }\n}", "function isBigEnough(element, index, array) {\n return element >= 10;\n }", "function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }", "function arrayHasValue(arr, value) {\n var idx = arr.indexOf(value);\n if (idx !== -1) {\n return true;\n }\n return false;\n }", "static hasValue(array, value) {\n for (var tI = 0; tI < array.length; tI++) {\n if (array[tI] === value) {\n return true;\n }\n }\n return false;\n }", "function length (data, value) {\n assert.not.undefined(value);\n\n return assigned(data) && data.length === value;\n }", "function checkArray(array, n) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === n) {\n return true\n }\n }\n return false\n}", "get length() {\n return array.length == 0\n }", "function containsDuplicate(numArr) {\n // iterate through the array\n let result;\n const checkArr = new Set(numArr);\n\n if (numArr.length !== checkArr.size) {\n result = true;\n } else {\n result = false;\n }\n console.log(numArr.length);\n console.log(checkArr.size);\n console.log(result)\n}", "function hasItem(num, arr) {\n for (let i = 0; i < arr.length; i++) { // n\n if (arr[i] === num) { // 1\n return true // 1\n }\n }\n return false // 1\n}", "function isNumberLength_11(array) {\n return array.length === 11;\n}", "hasValues() {\n\t\treturn this.data.length > 0;\n\t}", "function arrayContainsPrimitives(value) {\n const n = Math.min(nChecks, value.length);\n if (!(n > 0)) return false;\n let type;\n let hasPrimitive = false; // ensure we encounter 1+ primitives\n for (let i = 0; i < n; ++i) {\n const v = value[i];\n if (v == null) continue; // ignore null and undefined\n const t = typeof v;\n if (type === undefined) {\n switch (t) {\n case \"number\":\n case \"boolean\":\n case \"string\":\n case \"bigint\":\n type = t;\n break;\n default:\n return false;\n }\n } else if (t !== type) {\n return false;\n }\n hasPrimitive = true;\n }\n return hasPrimitive;\n}", "contains(num, arr) {\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === num) {\n return true;\n }\n }\n return false;\n }", "function isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value) && value.length !== undefined;\n}", "function isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value) && value.length !== undefined;\n}", "function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }", "function isInArray(value, array) {\n \treturn array.indexOf(value) > -1;\n }", "function hasValidSampleSize() {\n return offsetSamples.length >= 5;\n }", "function arrayNotEmpty(array) {\n return array instanceof Array && array.length > 0;\n}", "function ArrayFilled(o) {\n\treturn o && o instanceof Array && o.length > 0\n\t\t\t&& Number(o.length) === o.length;\n}", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isSize(value) {\n return typ.isUInt(value) && (value > 0);\n}", "function isSize(value) {\n return typ.isUInt(value) && (value > 0);\n}", "function isNotEmptyArray( arg ) {\n\n return Array.isArray( arg ) && arg.length > 0;\n }", "function containsValue(array, x){\n if(array.length == 0) {\n return 0;\n } else {\n \n if(array[0] == x) {\n return 1 + containsValue(array.slice(1), x);\n }\n return 0 + containsValue(array.slice(1), x);\n }\n}", "function hasArrayElement(arr) {\n for (var i=0; i<arr.length; i++) {\n if (Array.isArray(arr[i])) {\n return true;\n }\n }\n return false;\n}", "function likeArray(obj) {\n return obj && typeof obj === \"object\" && typeof obj.length === \"number\";\n }", "function contains(array, target){\n return array.indexOf(target) > -1; // n \n}", "function checkArray(arr, num) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] == num) {\n return true;\n }\n }\n return false;\n}", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function isInArray(random_array, num) {\n if (random_array.indexOf(num) !== -1) {\n return true;\n }\n else {\n return false;\n }\n}", "function inArray(array, value){\n arrLength = array.length;\n //While loop in reverse is the fastest way to loop through an array\n while(arrLength--){\n if(value == array[arrLength]){\n return true;\n }\n }\n return false;\n}", "function inArray(number) {\n\tfor (i = 0; i < unavailableSpot.length; i++) {\n\t\tif (number == unavailableSpot[i]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "checkIfArrayLengthChanged(value) {\n // If we've already detected a change, just return\n if (this.snapshotChanged === true) {\n return;\n }\n if (this.currentPath.baseSnapshotValue !== undefined &&\n this.currentPath.baseSnapshotValue !== null) {\n this.snapshotChanged = this.currentPath.baseSnapshotValue.length !== value.length;\n }\n }", "function isInArray(array, value) {\n return array.indexOf(value) > -1;\n }", "function has(key) {\n\t var val = this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function has(key) {\n\t var val = this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function isArray(obj){return(typeof(obj.length)==\"undefined\")?false:true;}", "function checkArguments(array){\n for (var element of array) {\n if (typeof element !== \"number\") return undefined;\n }\n return true;\n }", "function inArray(value, array){\n\t\t for(var i=0;i<array.length;i++){\n\t\t if(array[i]==value) {return false;}\n\t\t \t}\n\t\t\t}", "function isSingleIntArray(arr) {\n const sumOfArrayElements = arr.reduce((total, el) => {\n return total + el;\n });\n\n return (sumOfArrayElements == arr.length);\n}", "function has(key) {\n var val = this.node[key];\n if (val && Array.isArray(val)) {\n return !!val.length;\n } else {\n return !!val;\n }\n}", "function isInArray(value, array) {\n\n for ( var item of array ) {\n if ( item == value ) { return true; }\n }\n return false;\n}", "function containsAll(arr){\r\n\tfor(let k=1; k<arguments.length;k++){\t\t//arguments object to pass arguments\r\n\t\tlet num=arguments[k];\r\n\t\tif(arr.indexOf(num)===-1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function issetOptionsValue(value){\n\tif (value != null && value.constructor.toString().indexOf(\"Array\") != -1 && \n\t\t\tvalue.length > 0){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function hasItems(array) {\n return array[0] !== undefined \n}", "set arraySize(value) {}", "function isEmpty(arr) {\n return !arr.length;\n}", "function haveAllData(array) { \n\n // should have a 2 element array\n if (_.isArray(array) && array.length === 2) \n\n // neither element should be empty\n if (! (_.isEmpty(array[0]) || _.isEmpty(array[1]))) \n return true;\n\n return false;\n}", "function containsAll(arr){\n for (let k = 1; k < arguments.length; k++){\n let num = arguments[k];\n if (arr.indexOf(num) === -1){\n return false;\n }\n }\n return true;\n}", "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function arrayIsValid(_array_) {\n return _array_ && Array.isArray(_array_) && _array_.length > 0;\n}", "function is_new_value_in_array(array, value) {\n\tfor (u=0; u < array.length; u++) {\n\t\tif (array[u] == value) \n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function nonEmptyArray (data) {\n return array(data) && greater(data.length, 0);\n }", "function hasAtLeastOneItem(val) {\n return val.length >= 1;\n}", "function is31Flavors(array){\n if(array.length === 31) {\n console.log(true);\n } else{\n console.log(false)\n }\n}", "function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) {\n if (minLength === void 0) { minLength = 0; }\n if (maxLength === void 0) { maxLength = Infinity; }\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(function (e) { return typeof e === expectedType; }));\n}", "function checkArrayTypeAndLength(x, expectedType, minLength, maxLength) {\n if (minLength === void 0) { minLength = 0; }\n if (maxLength === void 0) { maxLength = Infinity; }\n assert(minLength >= 0);\n assert(maxLength >= minLength);\n return (Array.isArray(x) && x.length >= minLength && x.length <= maxLength &&\n x.every(function (e) { return typeof e === expectedType; }));\n}", "function isNotEmpty(array) {\n return (array && array.length > 0)\n }", "function validarExistenciaValorDeArray(value, array, x_value) {\n for (let i = 0; i < array.length; i++) {\n if (value === array[i][x_value]) {\n return true;\n }\n }\n return false;\n}", "function isEmpty(val) {\n if (val === undefined) return true;\n if (val === null) return true;\n if (val.length <= 0) return true;\n if (Array.isArray(val)) {\n var cnt = 0;\n val.forEach(el => {\n if (isEmpty(el)) cnt++;\n });\n if (cnt === val.length) return true;\n }\n return false;\n}", "function IsInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function containsElement(arr, x){\n for(var r = 0; r < arr.length; r++){\n if(r == x){\n return true;\n }else{\n return false;\n }\n }\n return containsElement;\n }", "function size(found) {\n return sizes[found] || 1;\n }", "hasElement(index) {\n this._ensureUnpacked();\n if (this.unpackedArray) {\n return (index >= 0 && index < this.unpackedArray.length);\n }\n return this.unpackedAssocArray.has(index);\n }", "function contains(arr, value) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] === value) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function beenUsed(val, arr) {\n for(let i = 0; i < arr.length; i++) {\n if(arr[i] == val) return true;\n }\n return false;\n}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] == value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function arrayValueExist(array, value){\n\t\tfor(var i = 0; i < array.length; i++) if (array[i] == value) return true;\n\t\treturn false;\n\t}", "_validateValueArrayDimensions() {\n const that = this;\n let dimensions = 0,\n tempArray = that.value,\n emptyArray = false;\n\n while (tempArray.constructor === Array) {\n dimensions++;\n tempArray = tempArray[0];\n\n if (tempArray === undefined) {\n emptyArray = true;\n break;\n }\n }\n\n if (that.dimensions > dimensions) {\n if (emptyArray) {\n that.value = that._returnEmptyArray();\n return;\n }\n\n while (that.dimensions > dimensions) {\n that._addDimensionToJSArray(dimensions);\n dimensions++;\n }\n }\n }", "function arrayValueExist(array, value){\r\n\t\tfor(var i = 0; i < array.length; i++) if (array[i] == value) return true;\r\n\r\n\t\treturn false;\r\n\t}", "function isArray(e){return e!=null&&typeof e==\"object\"&&typeof e.length==\"number\"&&(e.length==0||defined(e[0]))}", "function checkNumber(numbersArray) { return numbersArray >= 5; }", "function isEmpty(array) {\n return !array || !array.length;\n }", "function check_array(arr, value, law)\n{\n var op = law;\n\n for (key_temp in arr)\n {\n if (op)\n {\n if (operators[op](arr[key_temp], value))\n {\n return true;\n }\n }\n }\n return false;\n}", "function arrayMinSize(array, min) {\n return array instanceof Array && array.length >= min;\n}", "function isArray(a) {\r\n// This is not working, so testing if the length member is not undefined\r\n// return isObject(a) && a.constructor == Array;\r\n return isObject(a) && !isUndefined(a.length);\r\n}", "function createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= _setup.MAX_ARRAY_INDEX;\n }\n }", "function exists(value, array) {\n return array.some((e) => e === value);\n}", "function smallEnough(a, limit){\n let count = 0;\n for(let i = 0; i < a.length; i++){\n if(a[i] > limit) count++\n }\n return count > 0 ? false : true\n}", "function oneOf (arr, x) {\n\t if (!Array.isArray(arr)) {\n\t throw new Error('expected an array')\n\t }\n\t return arr.indexOf(x) !== -1\n\t}", "function in_array(variable, theArray)\n{\n\treturn $.inArray(variable, theArray) != -1;\n}", "function check_array(arr, value, law)\r\n{\r\n var op = law;\r\n for (key_temp in arr)\r\n {\r\n if (op)\r\n {\r\n if (operators[op](arr[key_temp], value))\r\n {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "function isSameArrLength(arr) {\r\n const length = arr[0].length;\r\n\r\n for (let i = 1; i < arr.length; i++) {\r\n if (!Array.isArray(arr) || arr[i].length !== length) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function has(key) {\n\t var val = this.node && this.node[key];\n\t if (val && Array.isArray(val)) {\n\t return !!val.length;\n\t } else {\n\t return !!val;\n\t }\n\t}", "function checkInputSize(input) {\n return input.length < 7;\n}", "function isVariable(variableName, arraySize)\n{\n // Only output non-array variables or array members (i.e., skip array\n // definitions)\n return variableName != null && arraySize != null && (arraySize.isEmpty() || variableName.endsWith(\"]\"));\n}", "function isArray(value) {\n return value && typeof value === 'object' && value instanceof Array && typeof value.length === 'number' && typeof value.splice === 'function' && !(value.propertyIsEnumerable('length'));\n}", "function in_array(value, array)\n{\n\tfor (var i in array)\n\t\tif (array[i] == value)\n\t\t\treturn true;\n\treturn false;\n}" ]
[ "0.67656267", "0.6722253", "0.6622202", "0.6506073", "0.64943284", "0.64565045", "0.64473206", "0.63594013", "0.63058066", "0.6303271", "0.6277014", "0.62455976", "0.62435305", "0.6223165", "0.6206438", "0.6189157", "0.6183994", "0.61791366", "0.61791366", "0.6156779", "0.6149414", "0.6136477", "0.61292684", "0.61274105", "0.6113191", "0.60916907", "0.60916907", "0.60916907", "0.6088811", "0.6088811", "0.6078422", "0.6068497", "0.6062232", "0.6049607", "0.60485715", "0.6005608", "0.6003113", "0.6003113", "0.5998116", "0.5995067", "0.5967659", "0.5951725", "0.59427756", "0.5931315", "0.5931315", "0.5925516", "0.59181225", "0.59121984", "0.59114426", "0.5893719", "0.58907574", "0.5887895", "0.5880528", "0.58783144", "0.5874916", "0.5874534", "0.5874337", "0.5862277", "0.5861761", "0.5853878", "0.5843937", "0.5840562", "0.58405435", "0.5832937", "0.58286077", "0.58286077", "0.5828527", "0.58273834", "0.582733", "0.5826173", "0.5825917", "0.5822742", "0.5813942", "0.58131516", "0.5812185", "0.5802994", "0.5802994", "0.5802994", "0.5794045", "0.57928675", "0.57880497", "0.57848585", "0.57831275", "0.57821286", "0.5763959", "0.57359153", "0.5734818", "0.57312876", "0.5730949", "0.57303077", "0.5725686", "0.5723554", "0.57230204", "0.5710882", "0.57079566", "0.5705348", "0.5705012", "0.57046646", "0.5704335", "0.5702667" ]
0.7749507
0
Get the array index value from the variable name
function getIndex(name) { // Split the variable name on the underscores and use the last part as the // array index var parts = name.split("_"); return parts[parts.length - 1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "variableAt(index) {\n\t\treturn this._vars[index];\n\t}", "function nthArray(arrayName, number) {\n\n return arrayName[number];\n}", "function index(arr, name) {\n return _.findIndex(arr, matchName(name));\n}", "function getVarValue(index){\n return varList[index].value;\n}", "function getIndexByName(theArray, name) {\n var ix = _.findIndex(theArray, function(element) { return element.name==name; });\n if (ix < 0) {\n throw 'Unknown name: '+name;\n }\n return ix;\n }", "function retr(input)\n{\n var index = names.indexOf(input);\n return variables[index];\n}", "value(num, arr) {\n return arr[num];\n }", "nameAtIndex(index) {\n const names = this.getPathNames()\n return names[util.mod(index, names.length)]\n }", "function getArrayKey( arr, ix)\n{\n\n var i = 0;\n for( key in arr) {\n if( i == ix) {\n return key;\n }\n i++;\n }\n\n return '';\n}", "getIndexByName(name) {\n return this.nameIndex[name];\n }", "arrayIndex(key) {\n let start = key.indexOf(\"[\");\n let end = key.indexOf(\"]\");\n if (start >= 0 && end > 0 && start < end) {\n return parseInt(key.substring(start + 1, end));\n }\n else {\n return -1;\n }\n }", "getIndex(name){\n var result;\n if(isNaN(name)){\n result=this.layerNames[name];\n if(result)\n return result.id;\n }else return name;\n return undefined;\n //return (isNaN(name))? this.layerNames[name].id:name;\n }", "getValueAt (ix, key) {\n const { elements } = this.specs[key]\n const array = this.arrays[key]\n if (elements === 0) return array\n return array[ix]\n }", "function getindex(mapping_name)\r{\r\tvar entry;\r\tfor(var i=0; i<mapping_names.length; i++){\r\t\tif(mapping_name == mapping_names[i]){\r\t\t\tentry = i;\r\t\t}\r\t}\r\treturn entry;\r}", "function findIndex(name, array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i].name === name) {\n return i;\n }\n }\n}", "function getIndex(name){\n name = String(name);\n switch (name){\n case 'A':\n return 0;\n case 'B':\n return 1;\n case 'C':\n return 2;\n case 'D':\n return 3;\n case 'E':\n return 4;\n case 'F':\n return 5;\n case 'G':\n return 6;\n case 'H':\n return 7;\n default:\n return -1;\n }\n \n return -1;\n \n}", "function arrayLookup(array, index) {\n return lang.arrayGetValueOrDefault(array, index, \"?\");\n}", "function index(obj,i) {return obj[i];}", "function getProductIndex(name) {\n for (let i = 0; i < this.length; i++) {\n if (this[i][1] === name) return i;\n }\n return undefined;\n }", "findIndexUniform(name, uniforms){\n for(let i = 0; i < uniforms.length; i++){\n if(uniforms[i].getName() === name){\n return i;\n }\n }\n return -1;\n }", "function accessElementInArray(array,index){\n return array[index]\n}", "variableOf(name) {\n\t\tfor (const v of this._vars) {\n\t\t\tif (v.name() === name) return v;\n\t\t}\n\t\treturn null;\n\t}", "function get_form_element_name_index(name)\n{\n\tstart = name.indexOf('[');\n\tif(start!=-1)\n\t{\n\t\tend = name.indexOf(']');\n\t\tif(end != -1)\n\t\t{\n\t\t\tvar index = name.substring(start+1, end);\n\t\t\treturn index;\n\t\t}\t\t\n\t}\n\t\n\t//else\n\treturn null;\n}", "function find_index(x){\n for(let i = 0; i < sounds.length; i++){\n if(x == sounds[i].name){\n return i;\n }\n }\n}", "function index(obj, i) {\n return obj[i];\n} // convert dot notation string into an actual object index", "function index(obj,i) {return obj[i]}", "function accessElementInArray(array, index){\nreturn array[index];\n}", "function arraryIndexLocation() {\n for (var i = 0; i < wordBank.length; i++) {\n if (word === wordBank[i].name) {\n index = i;\n return index;\n }\n }\n}", "function getIndex(name) {\n var index = -1;\n\n uniqItemNameStack.forEach(function(entry, ind) {\n if (name == entry) {\n index = ind;\n }\n });\n return index;\n }", "function getvar(name) {\n\t\treturn window[name];\n\t}", "function getVarFromUrl(varname, offset){\n if(typeof offset == 'undefined') offset = 1;\n var index = waq.url.parts.indexOf(varname);\n return waq.url.parts[index+offset];\n }", "function calcIdentifier(env, name) {\n return env[name];\n}", "#indexOfVariableWithMRV() {\n\t\tlet index = 0;\n\t\tlet size = Number.MAX_VALUE;\n\n\t\tfor (let i = 0; i < this.#vars.length; ++i) {\n\t\t\tconst v = this.#vars[i];\n\t\t\tif (!v.isEmpty()) continue;\n\t\t\tconst d = v.domain();\n\t\t\tconst s = d.size() - v.solverObject.hiddenSize();\n\t\t\tif (s < size) {\n\t\t\t\tsize = s;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}", "function indexFinder(matchName, arrayName) {\n let index = -1;\n for (let i = 0; i < arrayName.length; i++) {\n if (arrayName[i] === matchName) {\n index = i + 1;\n }\n }\n return index;\n}", "get(idx) {\n\n }", "function accessElementInArray(array, index){\n return array[index];\n}", "function index() {\n if ( Array.isArray( arr ) ) {\n return arr.indexOf( selected ); // set var for the current index value\n }\n }", "GetArrayElementAtIndex() {}", "NameForIndex( a_index )\n {\n return this.toneArray[a_index].Name;\n }", "get enumValueIndex() {}", "function getFieldInArray(src,fieldName,form_name)\r\n {\r\n var objArray = eval('document'+'.'+form_name+'.'+fieldName);\r\n\t\t\r\n\t\t if(objArray.length)\r\n {\r\n for(var i=0; i<objArray.length; i++)\r\n {\r\n if(objArray[i] == src) break;\r\n }\r\n \r\n return i;\r\n }\r\n else \r\n\t\t\t return null;\r\n }", "function HTMLControlNameToNumber(varname) {\n var vararray = varname.split('_');\n if (vararray.length > 2 ) return parseInt(vararray[1]);\n}", "function scanVariable(input, index, variableSet) {\n\tvar variableName = tryReadVariableName(input, index);\n\t/* variableName should not be null here, by contract. */\n\t\n\tvariableSet[variableName] = true;\n\treturn variableName;\n}", "function getPropertyNameForIndexedAccess(indexArgumentExpression, indexArgumentType) {\n if (indexArgumentExpression.kind === 9 /* StringLiteral */ || indexArgumentExpression.kind === 8 /* NumericLiteral */) {\n return indexArgumentExpression.text;\n }\n if (indexArgumentExpression.kind === 173 /* ElementAccessExpression */ || indexArgumentExpression.kind === 172 /* PropertyAccessExpression */) {\n var value = getConstantValue(indexArgumentExpression);\n if (value !== undefined) {\n return value.toString();\n }\n }\n if (checkThatExpressionIsProperSymbolReference(indexArgumentExpression, indexArgumentType, /*reportError*/ false)) {\n var rightHandSideName = indexArgumentExpression.name.text;\n return ts.getPropertyNameForKnownSymbolName(rightHandSideName);\n }\n return undefined;\n }", "function f(arr) {\n words = arr[0]\n idx = arr[1]\n if (typeof words !== \"string\" && typeof idx !== \"number\"){\n return undefined\n }\n return words[idx]\n}", "function convertArrayMember(variableName)\n{\n return variableName.replaceAll(\"[\\\\[]\", \"_\").replaceAll(\"[\\\\]]\", \"\");\n}", "function accessElementInArray(array, index){\n var element = array[index]\n return element\n}", "getWordAtIndex(index) {\n return this.args[5+index];\n }", "function getID(array, key) {\n let index = array\n .map(function (e) {\n return e.name;\n })\n .indexOf(key);\n return array[index].id;\n}", "function myFindIndex(list, name) {\n for (var i = 0; i < list.length; i++) {\n if (list[i] == name) {\n return i;\n }\n }\n}", "function accessElementInArray(array, index) {\n return array[index];\n}", "getAt(idx) {\n return this._get(idx).val;\n }", "function findIndex(arr, val) {\n\n}", "checkInside(sym, arr){\n let ind= -1;\n for(let i=0; i<arr.length; i++){\n if (arr[i].name === sym){\n ind=i;\n }\n }\n return ind;\n }", "function funcGetIndex(arr, selected) {\n var arrIndex = jQuery.map(arr, function(e, i) {\n if (e.code == selected.code) return i;\n })\n return arrIndex.length ? arrIndex[0] : 0;\n }", "function funcGetIndex(arr, selected) {\n var arrIndex = jQuery.map(arr, function(e, i) {\n if (e.code == selected.code) return i;\n })\n return arrIndex.length ? arrIndex[0] : 0;\n }", "function getIndex (item, array) {\n for (var i = 0; i < array.length; i++){\n if (item==array[i][1]){\n return i;\n }\n }\n return undefined;\n }", "function indexForKey(array, key) {\r\n for (var i = 0; i < array.length; i++) {\r\n if (array[i]['.key'] === key)\r\n return i;\r\n }\r\n return -1;\r\n}", "static accessValue(object, key) {\n const keys = key.split('.');\n let value = object;\n for (let i = 0, max = keys.length; i < max; i++) {\n value = value[keys[i]];\n }\n return value;\n }", "function findCurrentIndexValue(array, index) {\n const calcIndex = index % (array.length);\n return array[calcIndex];\n}", "function caml_array_get (array, index) {\n if ((index < 0) || (index >= array.length)) caml_array_bound_error();\n return array[index+1];\n}", "function getLetterAtIndex(arr, index) {\n let letters = arr.split(\"\");\n return letters[index];\n}", "function IndexCal(letter)\n{\n var sentence=\"Maryum\";\n\ndocument.write((sentence[letter]));\n\n}", "function findVariable (dataClass, varName)\n{\n\t\n\t//search qualitative\n\tif(dataClass=='super')\n\t{\n\t\tfor(var j in superUsage.names)\n\t\t{\n\t\t\tif(superUsage.names[j].toLowerCase()==varName)\n\t\t\t\treturn j;\n\t\t}\n\t}\n\t\n\t//search quantitative\n\telse\t\n\t{\n\t\tfor(var j in varUsage.names)\n\t\t{\n\t\t\tif(varUsage.names[j].toLowerCase()==varName)\n\t\t\t{\n\t\t\t\treturn j;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//no match\n\tconsole.error(\"ERROR: Invalid dataset name: \"+varName);\n\treturn -1;\n}", "function getIndex(s){\n for(p in alphaObj){\n if (alphaObj[p] == s){\n return p;\n }\n }\n}", "parseVarName() {\n const token = this.input.next();\n if (token.type != \"var\") this.input.croak(\"Expect variable name\");\n return token.value;\n }", "function xIndex(squareDiv) {\n var x = squareDiv.split(\"_\");\n var i = parseInt(x[1]);\n return i;\n}", "get(){return this[n]}", "function indexOfArray(arr,index){\r\n\treturn arr[index]\r\n}", "function getLetters(stringArray, arrayIndexValue) {\n\n for (let i = 0; i < stringArray.length; i++) {\n if (stringArray[arrayIndexValue]) {\n\n }\n\n return stringArray.arrayIndexValue\n }\n\n}", "function getBindingNameFromIndex(stylingContext, offset, directiveIndex, isClassBased) {\n var singleIndex = getSinglePropIndexValue(stylingContext, directiveIndex, offset, isClassBased);\n return getProp(stylingContext, singleIndex);\n}", "getKey(value, index) {\n return index;\n }", "findIndexVertex(name, vertexBufferArray){\n for(let i = 0; i < vertexBufferArray.length; i++){\n if(vertexBufferArray[i].getName() === name){\n return i;\n }\n }\n return -1;\n }", "function getKeyValue(gl, name) {\n // If not a string, return (assume number)\n if (typeof name !== 'string') {\n return name;\n } // If string converts to number, return number\n\n\n var number = Number(name);\n\n if (!isNaN(number)) {\n return number;\n } // Look up string, after removing any 'GL.' or 'gl.' prefix\n\n\n name = name.replace(/^.*\\./, '');\n var value = gl[name];\n (0, _assert.default)(value !== undefined, \"Accessing undefined constant GL.\".concat(name));\n return value;\n}", "function getIndex(name) {\n return vm.results ? vm.results.indexOf(name): 0;\n }", "function indexer2(name){\n var index = -2;\n var row = -2;\n var sheet = SpreadsheetApp.getActive().getSheets()[0].getDataRange().getValues();\n for(var b in sheet){\n for(var a in sheet[0]){\n if(sheet[b][a] == name){\n index = a;\n row = b;\n break;\n }\n }\n }\n return [parseInt(index)+1, parseInt(row)+1];\n}", "getFirstIndex() {\n this._ensureUnpacked();\n if (this.unpackedArray) {\n return 0;\n } else if (this.unpackedAssocArray) {\n this._ensureAssocKeys();\n return this.unpackedAssocKeys[0];\n }\n }", "function namedParamsWithIndex() {\n const namedUrlParams = getPathNames(namedUrl);\n\n return namedUrlParams.reduce((validParams, param, index) => {\n if (param[0] === \":\") {\n validParams.push({ value: param.slice(1), index });\n }\n return validParams;\n }, []);\n }", "function getKeyValue(gl, name) {\n // If not a string, return (assume number)\n if (typeof name !== 'string') {\n return name;\n }\n\n // If string converts to number, return number\n var number = Number(name);\n if (!isNaN(number)) {\n return number;\n }\n\n // Look up string, after removing any 'GL.' or 'gl.' prefix\n name = name.replace(/^.*\\./, '');\n var value = gl[name];\n __WEBPACK_IMPORTED_MODULE_0_assert___default()(value !== undefined, 'Accessing undefined constant GL.' + name);\n return value;\n}", "function getLabelIndex(label){\n for (var i in chartData){\n if (chartData[i].label == label){\n return i;\n }\n }\n return -1;\n}", "function names(arr) {\n return names.name;\n}", "function getIndex(array, attr, value) {\n for (var i = 0; i < array.length; i++) {\n if (array[i].hasOwnProperty(attr) && array[i][attr] === value) {\n return i;\n }\n }\n return -1;\n }", "function findIndexInArray(array, target) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\tif(array[i].hasOwnProperty('name')) {\n\t\t\tif(array[i].name == target) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "name(n) {\n return this.slots[n * 2];\n }", "function indexing(input){\n var arr = process.argv.indexOf(input);\n return (arr === -1) ? null : process.argv[++arr];\n}", "getAt(idx) {\n if(idx >= this.length || idx < 0) {\n throw new Error(\"Invalid index.\");\n }\n return this._get(idx).val;\n }", "function pgp_getVar(varName){\r\n\treturn varName+pgp_location;\r\n}", "function keyVal(arr, key){\n if (arr.indexOf(key) == -1){ \n } else{\n return key;\n }\n}", "function findSubObjIndex(arr, indexToFind) {\n for(var i=0; i < arr.length; i++) {\n if(arr[i].$$i == indexToFind) {\n return i;\n }\n }\n return -1;\n}", "getVar(variable) {\n\t\tconst tag = variable.toLowerCase();\n\t\treturn this._customVar[tag];\n\t}", "function valAtIndex (view, index) {\n return view.viewAtIndex(index).stringValue()\n}", "function findIndexFromId(array, attr, value) {\n for (var i = 0; i < array.length; i += 1) {\n if (array[i][attr] === value) {\n return i;\n }\n }\n return -1;\n }", "function a (name)\n{\n return (typeof name == \"string\") ? memory.identifiers[name] : name;\n}", "getValues(varName) {\n return this.values[varName];\n }", "function get_index(attr) {\r\n\r\n try {\r\n return attr.match(/[0-9]+/);\r\n } catch (err) {\r\n alert(err);\r\n }\r\n }", "function valueKey(input){\n for (var qqchose in input ){\n var numqqchose = input[qqchose];\n console.log(numqqchose);\n } \n return numqqchose;\n}", "function f(x) {\n var a = [1, 2];\n a[x];\n return a[0 - x];\n}", "function indexOfArray(arr,i){\n \n return arr[i];\n }", "function getItemByName(anArray, name) {\r\n for (var i = 0; i < anArray.length; i += 1) {\r\n if (anArray[i].name === name) {\r\n return anArray[i];\r\n }\r\n }\r\n}", "function getName(index){\n\treturn cachedPinInfo[index].n;\n}" ]
[ "0.66877156", "0.6651087", "0.640118", "0.6385651", "0.63771635", "0.63339627", "0.619989", "0.6096024", "0.6087681", "0.6075198", "0.6040069", "0.59576315", "0.5896634", "0.5833155", "0.5832128", "0.58292294", "0.57799965", "0.5752793", "0.57407445", "0.57022464", "0.5697944", "0.5693981", "0.56915563", "0.56729484", "0.56607383", "0.5646932", "0.5623587", "0.5615731", "0.5588605", "0.556459", "0.5563107", "0.55621475", "0.5561702", "0.55283993", "0.55066967", "0.5504526", "0.5498881", "0.54855824", "0.5483611", "0.54684544", "0.5457128", "0.5448134", "0.544153", "0.5414194", "0.5410875", "0.5409689", "0.54075915", "0.5393284", "0.5373222", "0.5358881", "0.53568333", "0.53555834", "0.53547055", "0.5354271", "0.5352411", "0.5352411", "0.5343514", "0.53434885", "0.53428537", "0.53376085", "0.53366", "0.53237927", "0.5315691", "0.5314383", "0.52853644", "0.5274541", "0.5269976", "0.52453214", "0.52287006", "0.521598", "0.5215229", "0.5212844", "0.520504", "0.5183517", "0.5180872", "0.51802534", "0.517075", "0.51651615", "0.5161097", "0.5158573", "0.5155579", "0.5152213", "0.5149163", "0.5145085", "0.5141695", "0.5138741", "0.5130978", "0.51280105", "0.5116336", "0.5114097", "0.51114964", "0.5100398", "0.5098598", "0.50831044", "0.5076684", "0.50748056", "0.50729793", "0.50724274", "0.5070262", "0.50701976" ]
0.8149556
0
Selects the format arguments to use for a particular ITOS type, based on its type
function setITOSFormatFlag(itosEncode) { var itosFormat = ""; var withSign = 0; modNum = modNumDefault; // Select based on the data type character (F, I, U, S) switch (itosEncode.substr(0, 1)) { // Floating point case 'F': // Get the number of bytes that define the floating point var numBytes = itosEncode.length() - 1; // Check if the number of bytes is greater than 4 (i.e., it's a // double precision floating point) if (numBytes > 4) { // Set the format string and parameters for a double itosFormat = "%13.3f"; numITOSDigits = 14; modNum = modNumDefault / 2; } // The number of bytes is equal to or less than 4 (i.e., it's a // single precision floating point) else { // Set the format string and parameters for a float itosFormat = "%6.3f"; numITOSDigits = 7; modNum = modNumDefault / 2; } break; // Signed integer case 'I': // Set the value to add a space for the sign withSign = 1; // Unsigned integer case 'U': // Get the number of bytes that define the (unsigned) integer var numBytes = itosEncode.length() - 1; // Determine the number of digits required to display the largest // possible value for the (unsigned) integer with the specified // number of bytes var nDigits = 2 * numBytes + 1 + Math.floor(numBytes / 4); // Add a digit for a +/- if signed integer nDigits += +withSign; // Set the format string and parameters for a (unsigned) integer itosFormat = "%" + nDigits.toString() + "d"; numITOSDigits = nDigits; // Check if the number of bytes is greater than 2 if (numBytes > 2) { // Set the format parameter modNum = modNumDefault / 2; } break; // Character or string case 'S': // Set the format string and parameters for a character or string itosFormat = "%s"; numITOSDigits = 10; modNum = modNumDefault / 2; break; default: break; } return itosFormat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asPrintFormat(type)\n{\n if (StringHelper.isString(type)) {\n return '%s';\n }\n\n function fn(pkgId)\n {\n const options = { 'hash' : {} };\n return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => {\n const basicType = ChipTypesHelper.asBasicType(zclType);\n switch (basicType) {\n case 'bool':\n return '%d';\n case 'int8_t':\n return '%\" PRId8 \"';\n case 'uint8_t':\n return '%\" PRIu8 \"';\n case 'int16_t':\n return '%\" PRId16 \"';\n case 'uint16_t':\n return '%\" PRIu16 \"';\n case 'int24_t':\n return '%\" PRId32 \"';\n case 'uint24_t':\n return '%\" PRIu32 \"';\n case 'int32_t':\n return '%\" PRId32 \"';\n case 'uint32_t':\n return '%\" PRIu32 \"';\n case 'int64_t':\n return '%\" PRId64 \"';\n case 'uint64_t':\n return '%\" PRIu64 \"';\n default:\n return '%p';\n }\n })\n }\n\n const promise = templateUtil.ensureZclPackageId(this).then(fn.bind(this)).catch(err => {\n console.log(err);\n throw err;\n });\n return templateUtil.templatePromise(this.global, promise)\n}", "function format(number, type, input){\n if(type === 'time'){\n var dateMili = Object.keys(input)[(number - 1) * 2].split('name')[1] * 10;\n return dateMili;\n }\n else if(type === 'name'){\n x = Object.keys(input).map(function (key){\n return input[key];\n });\n return x[(number -1) * 2];\n }\n else if(type === 'message'){\n x = Object.keys(input).map(function (key){\n return input[key];\n });\n return x[(number -1) * 2 + 1];\n }\n}", "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, ocatal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, octal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "function format() {\r\n var format = arguments[0] || \"\";\r\n var match = format.match(/%s|%d|%j/g);\r\n if (!match) return format;\r\n\r\n if (match.length != arguments.length - 1) throw { name: \"Argument Error\", message: \"Number of arguments mismatch\" };\r\n for (var i = 1; i < arguments.length; i++) {\r\n var matchIndex = i - 1;\r\n var value = (match[matchIndex] == \"%j\") ? JSON.stringify(arguments[i]) : arguments[i];\r\n format = format.replace(match[matchIndex], value);\r\n }\r\n return format;\r\n }", "function formatType(type) {\n if (type == 0) {\n return '次';\n } else if (type == 1) {\n return '月';\n } else if (type == 2) {\n return '年';\n }\n }", "function getDefaultInputFormat() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'date';\n return DEFAULT_INPUT_DATE_FORMAT[type];\n}", "function sformat(format) {\n var args = arguments;\n var i = 0;\n return format.replace(/{(\\d*)}/g, function sformatReplace(match, number) {\n i += 1;\n if (typeof args[number] !== 'undefined') {\n return args[number];\n }\n if (typeof args[i] !== 'undefined') {\n return args[i];\n }\n return match;\n });\n}", "function numberFormat(type, specifiedFormat, config) {\n // Specified format in axis/legend has higher precedence than fieldDef.format\n if (isString(specifiedFormat)) {\n return specifiedFormat;\n }\n\n if (type === QUANTITATIVE) {\n // we only apply the default if the field is quantitative\n return config.numberFormat;\n }\n\n return undefined;\n }", "get formatOptions() {\n return [\n { label: 'Delimited String', value: 'String'},\n { label: 'Text Collection', value: 'Collection'},\n { label: 'Record Collection', value: 'Object'},\n ];\n }", "function normalizeFormat() {\n var args = [].slice.call(arguments);\n\n switch (utils.typeOf(args[0])) {\n case 'string':\n return normalizeString.apply(null, args);\n case 'object':\n return normalizeObject.apply(null, args);\n case 'array':\n return normalizeArray.apply(null, args);\n case 'function':\n return normalizeFn.apply(null, args);\n default:\n return args;\n }\n}", "function sformat(format) {\n var args = arguments;\n var i = 0;\n return format.replace(/{(\\d*)}/g, function sformatReplace(match, number) {\n i += 1;\n if (typeof args[number] !== 'undefined') {\n return args[number];\n }\n if (typeof args[i] !== 'undefined') {\n return args[i];\n }\n return match;\n });\n}", "function formatToArgAndSymbols(format, c, arg) {\n switch (c) {\n case 'N':\n return argToName(arg);\n case 'L':\n return argToLiteral(arg);\n case 'S':\n return argToString(arg);\n case 'T':\n return argToType(arg);\n case 'F':\n return [arg, []];\n default:\n throw new Error(`invalid format string: '${format}'`);\n }\n}", "function getFormatString(formatType) {\r\n if(formatType == '0') formatString = 'DD/MM HH:mm';\r\n else if(formatType == 1) formatString = 'DD/MM/YYYY';\r\n else if(formatType == 2) formatString = 'DD/MM/YYYY';\r\n else if(formatType == 3) formatString = 'DD/MM/YYYY';\r\n return formatString;\r\n}", "function dataType(input) {\nconsole.log(`The argument type is:`,typeof(input));\n}", "function Format() {}", "function Format() {}", "formatter(params) { return params.name; }", "function format(string) {\n var args = arguments;\n var pattern = new RegExp(\"%([1-\" + arguments.length + \"])\", \"g\");\n console.log(pattern);\n return String(string).replace(pattern, function(match, index) {\n \tif(Number.isInteger(args[index])){\n \t\treturn args[index];\n \t} else {\n \t\treturn '\"'+args[index]+'\"';\n \t}\n });\n}", "function getTypeParser (oid, format) {\n format = format || 'text';\n if (!typeParsers[format]) {\n return noParse;\n }\n return typeParsers[format][oid] || noParse;\n}", "function getTypeParser (oid, format) {\n format = format || 'text';\n if (!typeParsers[format]) {\n return noParse;\n }\n return typeParsers[format][oid] || noParse;\n}", "function getTypeParser (oid, format) {\n format = format || 'text';\n if (!typeParsers[format]) {\n return noParse;\n }\n return typeParsers[format][oid] || noParse;\n}", "function getTypeParser (oid, format) {\n format = format || 'text';\n if (!typeParsers[format]) {\n return noParse;\n }\n return typeParsers[format][oid] || noParse;\n}", "function _fmt(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n\n return str.replace(/%@([0-9]+)?/g, function (_s, argIndex) {\n var i = argIndex ? parseInt(argIndex, 10) - 1 : idx++;\n var r = i < formats.length ? formats[i] : undefined;\n return typeof r === 'string' ? r : r === null ? '(null)' : r === undefined ? '' : String(r);\n });\n }", "function formatType(type, checker) {\n return !isAssignableToSimpleTypeKind(type, SimpleTypeKind.ANY, checker) ? markdownHighlight(toTypeString(type, checker)) : undefined;\n}", "function format() {\n // The string containing the format items (e.g. \"{0}\")\n // will and always has to be the first argument.\n var string = arguments[0];\n // Start with the second argument (i = 1)\n for (var i = 1; i < arguments.length; i++) {\n // \"gm\" = RegEx options for Global search (more than one instance)\n // and for Multiline search.\n var regEx = new RegExp(\"\\\\{\" + (i - 1) + \"\\\\}\", \"gm\");\n string = string.replace(regEx, arguments[i]);\n }\n\n return string;\n }", "function datatypeHandler(format) {\n\tvar dt;\n\tif (format == 'json') {\n\t\tdt = 'json';\n\t} else if (format == 'xml') {\n\t\tdt = 'xml';\n\t} else {\n\t\tdt = 'text';\n\t}\n\treturn dt;\n}", "function doFormat(format) {\n var argv = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n argv[_i - 1] = arguments[_i];\n }\n if (typeof arguments == \"undefined\") {\n return null;\n }\n if (arguments.length < 1) {\n return null;\n }\n if (typeof arguments[0] != \"string\") {\n return null;\n }\n if (typeof RegExp == \"undefined\") {\n return null;\n }\n var parsed = sprintf.parseFormat(format, argv);\n var convCount = parsed.convCount;\n if (parsed.matches.length == 0) {\n // 没有格式化参数的占位符,则直接输出原本的字符串\n return format;\n }\n else {\n TypeScript.logging.log(\"string format parse result:\", TypeScript.ConsoleColors.Magenta);\n TypeScript.logging.log(parsed);\n }\n if (argv.length < convCount) {\n // 格式化参数的数量少于占位符的数量,则抛出错误\n throw \"Mismatch format argument numbers (\" + argv.length + \" !== \" + convCount + \")!\";\n }\n else {\n return sprintf.doSubstitute(parsed.matches, parsed.strings);\n }\n }", "function formatter(fmt) {\n var codeRxp = /%([',+0]*)([1-9]?)((?:\\.[1-9])?)([sdifxX%])/g;\n var literals = [],\n formatCodes = [],\n startIdx = 0,\n prefix = \"\",\n matches = codeRxp.exec(fmt),\n literal;\n\n while (matches) {\n literal = fmt.substring(startIdx, codeRxp.lastIndex - matches[0].length);\n if (matches[0] == '%%') {\n prefix += literal + '%';\n } else {\n literals.push(prefix + literal);\n prefix = '';\n formatCodes.push(matches);\n }\n startIdx = codeRxp.lastIndex;\n matches = codeRxp.exec(fmt);\n }\n literals.push(prefix + fmt.substr(startIdx));\n\n return function() {\n var str = literals[0],\n n = arguments.length;\n if (n != formatCodes.length) {\n error(\"[format()] Data does not match format string; format:\", fmt, \"data:\", arguments);\n }\n for (var i=0; i<n; i++) {\n str += formatValue(arguments[i], formatCodes[i]) + literals[i+1];\n }\n return str;\n };\n }", "format(entity, args) {\n // optimize entities which are simple strings by skipping resultion\n if (typeof entity === 'string') {\n return [entity, []];\n }\n\n // optimize entities with null values and no default traits\n if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) {\n return [null, []];\n }\n\n const result = format(this, args, entity);\n return [result[0].toString(), result[1]];\n }", "function helpFor(format){\n switch (format){\n\n case 'hex':\n return '000, #000, 000000<br> or #000000';\n\n case 'rgb':\n return 'rgb(255, 255, 255), rgba(255, 255, 255, 1)<br> or 255, 145, 124';\n\n case 'hsl':\n return 'hsl(0, 0%, 100%), hsla(0, 0%, 100%, 1)<br> or 0, 85%, 50%';\n\n case 'hwb':\n return 'hwb(0, 0%, 100%) or 0, 85%, 50%';\n\n case 'css':\n return 'yellow, blue, red';\n }\n }", "function logType(input) {\n console.log(input);\n}", "function logType(input) {\n console.log(input);\n}", "analyzeFormat(item) {\n if (!item.javaType || !item.entityFieldName)\n return;\n\n // match from enums\n if (JavaUtils.isEnumJavaType(item.javaType)) {\n let enums = this.getEnums;\n if (ARRAY.hasAny(enums, x => x.baseInfo.name.toLowerCase() == item.entityFieldName.toLowerCase())) {\n item.format = UiUtils.FORMAT_TYPE.ENUM;;\n item.pattern = STR.upperFirstLetter(item.entityFieldName);\n return;\n }\n }\n\n // match from default matchers\n for (let matcher of FormatMatchers) {\n if (matcher.matcher(item.javaType, item.entityFieldName)) {\n matcher.handler(item);\n return;\n }\n }\n }", "function variablesTypes(input) {\n console.log(\"My name: \" + input[0] + '//type is ' + typeof(input[0]) +\n '. My age: ' + input[1] + ' //type is ' + typeof(input[1]) +\n '. I am male: ' + input[2] + '//type is ' + typeof(input[2]) + '. My favorite foods are:' + input[3].toString() + '. //type is ' + typeof(input[3]));\n}", "between(hkFormat, veraType) {\n switch(hkFormat) {\n // case 'boolean':\n case Formats.BOOL:\n return bool;\n\n // case 'i1':\n // case 'i4':\n // case 'int':\n case Formats.INT:\n // case 'number':\n case Formats.FLOAT:\n // case 'string':\n case Formats.STRING:\n // case 'ui1':\n case Formats.UINT8:\n // case 'ui2':\n case Formats.UINT16:\n // case 'ui4':\n case Formats.UINT32:\n default:\n // Default conversion is -no- conversion.\n return undefined;\n }\n }", "function log(type){\n var args = Array.prototype.slice.call(arguments, 1);\n\n /**\n * Note that we replace the first parameter rather than inserting before it,\n * since it might contain formatting information. In other words, we want\n * this:\n *\n * logger.info('ourtask: completed part %d of %d', part, total);\n *\n * rather than:\n *\n * logger.info('ourtask:', 'completed part %d of %d', part, total);\n *\n * since the second version won't do proper formatting.\n */\n\n args[0] = type + ': ' + args[0];\n logger.info.apply(logger, args);\n}", "function printArgsInfo() {\n if (arguments.length === 0) {\n console.log(\"No arguments.\");\n }\n\n for (var i = 0; i < arguments.length; i++) {\n\n var type = arguments[i] ? arguments[i].constructor.name.toLocaleLowerCase() : typeof arguments[i];\n console.log(arguments[i] + ' (' + type + ')');\n }\n}", "function parse_Format(blob, length, opts) {\n var numFmtId = blob.read_shift(2);\n var fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n return [numFmtId, fmtstr];\n }", "function getTimeOptions(time_type){\n var time_options = { unit: 'minute', displayFormats: { 'second': 'mm:ss', 'minute': 'mm:ss'},tooltipFormat: \"mm:ss\" };\n\n if(time_type == 'time'){\n return time_options;\n }\n}", "function getLineType(line, state) {\n let linetype = 'text'\n if (regexps.dashes.test(line)) {\n linetype = 'dashes'\n } else if (regexps.propvalue.test(line)) {\n linetype = 'propvalue'\n }\n return linetype\n}", "function parseSelectedType(optionSelect) {\n // read the selected option and format to pass into selectType()\n var ERROR_RATE = \"Error Rate\";\n var ASSISTANCE_SCORE = \"Assistance Score\";\n var NUM_INCORRECTS = \"Number of Incorrects\";\n var NUM_HINTS = \"Number of Hints\";\n var STEP_DURATION = \"Step Duration\";\n var CORRECT_STEP_DURATION = \"Correct Step Duration\";\n var ERROR_STEP_DURATION = \"Error Step Duration\";\n\n if (optionSelect == ASSISTANCE_SCORE) { selectType(ASSISTANCE_SCORE_TYPE); }\n else if (optionSelect == ERROR_RATE) { selectType(ERROR_RATE_TYPE); }\n else if (optionSelect == NUM_INCORRECTS) {selectType(AVG_INCORRECTS_TYPE); }\n else if (optionSelect == NUM_HINTS) { selectType(AVG_HINTS_TYPE); }\n else if (optionSelect == STEP_DURATION) { selectType(STEP_DURATION_TYPE); }\n else if (optionSelect == CORRECT_STEP_DURATION) { selectType(CORRECT_STEP_DURATION_TYPE); }\n else if (optionSelect == ERROR_STEP_DURATION) { selectType(ERROR_STEP_DURATION_TYPE); }\n}", "function xf(format) {\n var args = Array.prototype.slice.call(arguments, 1);\n return format.replace(/\\{(\\d+)\\}/g, function(m, i) {\n return args[i];\n });\n}", "function xf(format) {\n var args = Array.prototype.slice.call(arguments, 1);\n return format.replace(/\\{(\\d+)\\}/g, function(m, i) {\n return args[i];\n });\n}", "function _formatEventName(template, type) {\n var uppercasePluralType = type.charAt(0).toUpperCase() + type.slice(1) + 's';\n return template.replace('Shapes', uppercasePluralType);\n }", "function parse_Format(blob, length, opts) {\n\tvar numFmtId = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [numFmtId, fmtstr];\n}", "function parse_Format(blob, length, opts) {\n\tvar numFmtId = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [numFmtId, fmtstr];\n}", "function parse_Format(blob, length, opts) {\n\tvar numFmtId = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [numFmtId, fmtstr];\n}", "function parse_Format(blob, length, opts) {\n\tvar numFmtId = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [numFmtId, fmtstr];\n}", "function fType(type) {\n\t\tif (directives.indexOf(type) > -1) {\n\t\t\treturn '@' + type;\n\t\t}\n\n\t\treturn type;\n\t}", "getTipo(pType) {\n if (pType.includes('int')) {\n return 'Integer';\n }\n else if (pType.includes('varchar')) {\n return 'string';\n }\n else if (pType.includes('decimal')) {\n return 'Extended';\n }\n else if (pType.includes('char')) {\n return 'string';\n }\n else if (pType.includes('text')) {\n return 'string';\n }\n else if (pType.includes('date')) {\n return 'TDateTime';\n }\n }", "function mapTextFormat (e) {\n if ((e === undefined) || (e === null)) return undefined;\n\n return {\n textType: getAttrValue(e, 'textType'),\n isSequence: toBoolean(getAttrValue(e, 'isSequence')),\n interval: toNumeric(getAttrValue(e, 'interval')),\n startValue: toNumeric(getAttrValue(e, 'startValue')),\n endValue: toNumeric(getAttrValue(e, 'endValue')),\n timeInterval: getAttrValue(getAttrValue(e, 'timeInterval')),\n startTime: toNumeric(getAttrValue(e, 'startTime')),\n endTime: toNumeric(getAttrValue(e, 'endTime')),\n minLength: toNumeric(getAttrValue(e, 'minLength')),\n maxLength: toNumeric(getAttrValue(e, 'maxLength')),\n minValue: toNumeric(getAttrValue(e, 'minValue')),\n maxValue: toNumeric(getAttrValue(e, 'maxValue')),\n decimals: toNumeric(getAttrValue(e, 'decimals')),\n pattern: getAttrValue(e, 'pattern'),\n isMultiLingual: toBoolean(getAttrValue(e, 'isMultiLingual'))\n };\n }", "function generate_type_name(fn, args) {\n var name = fn.name;\n if (null != args.__name__) {\n name += '(' + args.__name__ + ')'; \n }\n else if (is_str(args)) {\n name += '(' + args + ')'; \n }\n else if (is_args(args) || is_array(args)) {\n name += '(';\n for (var i = 0; i < args.length; ++i) {\n if (i > 0) {\n name += ',';\n }\n if (args[i].__name__) {\n name += args[i].__name__;\n }\n else {\n name += args[i];\n }\n }\n name += ')';\n }\n else if (is_json(args)) {\n name += '(json)';\n }\n return name;\n }", "function formatScriptArgument(){\r\n\ttry{\r\n\t\tdebug(\"FORMAT SCRIPT ARGUMENT\");\r\n\t\t//debug(typeof input);\r\n\t\t//debug(typeof json);\r\n\t\tinput.format = \"\";\r\n\t\tvar format = \"\";\r\n\t\t switch(input.unit){\r\n\t\t\t case \"minutes\":\r\n\t\t\t\t format = \"mm\";\r\n\t\t\t\t debug('format:' + format);\r\n\t\t\t case \"hours\":\r\n\t\t\t\t format = \"HH\" + format;\r\n\t\t\t\t debug('format:' + format);\r\n\t\t\t case \"days\" || \"weeks\":\r\n\t\t\t\t format = \"dd\" + format;\r\n\t\t\t\t debug('format:' + format);\r\n\t\t\t case \"months\":\r\n\t\t\t\t format = \"MM\" + format;\r\n\t\t\t\t debug('format:' + format);\r\n\t\t\tdefault:\r\n\t\t\t\tformat = \"YYYY\" + format;\r\n\t\t\t\tdebug('format:' + format);\r\n\t\t };\r\n\t\t input.format = format;\r\n\t}catch(err){\r\n\t\tdebug('format: %s',err.message);\r\n\t\tthrow err;\r\n\t}\r\n\treturn input;\r\n}", "function formatValidator(stringFormat) {\n\t switch (stringFormat) {\n\t case StringFormat.RAW:\n\t case StringFormat.BASE64:\n\t case StringFormat.BASE64URL:\n\t case StringFormat.DATA_URL:\n\t return;\n\t default:\n\t throw 'Expected one of the event types: [' + StringFormat.RAW + ', ' + StringFormat.BASE64 + ', ' + StringFormat.BASE64URL + ', ' + StringFormat.DATA_URL + '].';\n\t }\n\t}", "static formatPII(format, excludePII, args) {\n return format.replace(DebugSession._formatPIIRegexp, function (match, paramName) {\n if (excludePII && paramName.length > 0 && paramName[0] !== '_') {\n return match;\n }\n return args[paramName] && args.hasOwnProperty(paramName) ?\n args[paramName] :\n match;\n });\n }", "function format(t) {\n t = Number(t); // force conversion from Date\n switch (type) {\n case \"short\":\n {\n if (t >= 31536e6) {\n return (t / 31536e6).toFixed(1) + \" years\";\n } else if (t >= 6048e5) {\n return (t / 6048e5).toFixed(1) + \" weeks\";\n } else if (t >= 864e5) {\n return (t / 864e5).toFixed(1) + \" days\";\n } else if (t >= 36e5) {\n return (t / 36e5).toFixed(1) + \" hours\";\n } else if (t >= 6e4) {\n return (t / 6e4).toFixed(1) + \" minutes\";\n }\n return (t / 1e3).toFixed(1) + \" seconds\";\n }\n case \"long\":\n {\n var a = [],\n s = ((t % 6e4) / 1e3) >> 0,\n m = ((t % 36e5) / 6e4) >> 0;\n a.push(pad(\"0\", 2, s));\n if (t >= 36e5) {\n var h = ((t % 864e5) / 36e5) >> 0;\n a.push(pad(\"0\", 2, m));\n if (t >= 864e5) {\n a.push(pad(\"0\", 2, h));\n a.push(Math.floor(t / 864e5).toFixed());\n } else {\n a.push(h.toFixed());\n }\n } else {\n a.push(m.toFixed());\n }\n return a.reverse().join(\":\");\n }\n }\n }", "function getStr(idx, option) {\r\tif (option == \"TYPE\") {\r\t\tvar type = DATA.init[idx].type;\r\t\t// trace(\"\\n\" + type + \"\\n\");\r\t\tif (type == \"binary\" || type == \"lock\") {\r\t\t\treturn \"On/Off\";\r\t\t}\r\t\treturn \"?type\";\r\t}\r\telse if (option == \"TIMING\") {\r\t\t// return \"24 to 24\";// probably showing this way (a proposal)\r\t\tvar timing = DATA.init[idx].timing;\r\t\tif (timing) {\r\t\t\treturn \"Set\";\r\t\t\t//return DATA.init[idx].time_start + \" to \" + DATA.init[idx].time_end;\r\t\t}\r\t\treturn \"None\";\r\t}\r\treturn \"NULL\";\r}", "function fnIsValidFormat(obj, _type) {\n var _pattern = null,\n _text = input.isText(obj) ? obj.value : obj.toString();\n switch (_type) {\n case \"d\": //Validates Date format: dd/MM/yyyy\n _pattern = /^((0[1-9])|([1-2][0-9])|(3[0-1]))\\/((0[1-9])|(1[0-2]))\\/([1-2][0,9][0-9][0-9])$/;\n break;\n case \"t\": //Validates Time format: HH:mm:ss\n _pattern = /^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/;\n break;\n case \"dt\": //Validates DateTime format: dd/MM/yyyy HH:mm:ss\n _pattern = /^((0[1-9])|([1-2][0-9])|(3[0-1]))\\/((0[1-9])|(1[0-2]))\\/([1-2][0,9][0-9][0-9])\\s([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$/;\n break;\n case \"email\": //Validates an email address\n _pattern = /^([0-9a-zA-Zñ](?:[\\-.\\w]*[0-9a-zA-Zñ])*@(?:[0-9a-zA-Zñ][\\-\\wñ]*[0-9a-zA-Zñ]\\.)+[a-zA-Z]{2,9})$/i;\n break;\n case \"pass\": //Validates the password strength (must have 8-20 characters, at least one number, at least one uppercase)\n _pattern = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;\n break;\n case \"lat\": //Validates the latitude\n _pattern = /^-?([1-8]?[1-9]|[1-9]0|0)\\,{1}\\d{1,6}$/;\n break;\n case \"lon\": //Validates the longitude\n _pattern = /^-?([1]?[1-7][1-9]|[1]?[1-8][0]|[1-9]?[0-9])\\,{1}\\d{1,6}$/;\n break;\n }\n return !!_pattern && _pattern.test(_text);\n }", "function inputTypes(type) {\n if (type.startsWith('image')) {\n return ImageType\n }\n\n if (type == \"file.other\") {\n return ImageType\n }\n\n if (type == 'number') {\n return NumberType\n }\n\n return TextType\n}", "function $formatter(type, d, {user,sId,ip,ref}) {\n if (!config.log || !config.log.trk[type]) return\n var ident = user != null ? `${user.name||user._id}`.gray : `${sId.substring(0,12)}`.cyan\n\n var jdata = type == 'view'\n ? `${(d.url||'').cyan} ${ref?ref.replace(/https\\:\\/\\/|http\\:\\/\\//g,'<<< ').replace('www.','').blue:''}`\n : JSON.stringify(d.data||{}).replace(/^\\{/,'').replace(/\\}$/,'').replace(/\\\"([^(\\\")\"]+)\\\":/g,\"$1:\".dim).gray\n var label = type\n if (type == 'event') label = d.name\n if (type == 'view') label = `VIEW:${d.type}`\n $logIt(`trk.${type}`\n , label.toUpperCase()\n , `${ip.replace(':ffff','')}`.cyan+`\\t${ident}`\n , jdata\n )\n}", "static typeNameToInfo(typeName = \"UNKNOWN\") {\n\n switch (typeName.toUpperCase()) {\n case \"DATE\": return { clazz: DateValue };\n case \"LIST,\": return { clazz: List, delimiter: ', ' };\n case \"LIST;\": return { clazz: List, delimiter: '; ' };\n case \"POLICIES\": return { clazz: Policies };\n case \"VALUE\": return { clazz: Value };\n\n default: return {};\n }\n }", "function formatString(string,fieldType){\r if (string.search(/./) === -1) {\r string = '<span class=\"placeholder\">Click here to add a '+fieldType+'</span>';//change class if another is preferred by Antoine.\r }else{\r string = string.replace('&','&amp;');\r string = string.replace(/</g,'&lt;');\r }\r\r openedForm = {};\r return string;\r}", "function customFormat(value, formatType, format) {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (!formatType) {\n return undefined;\n }\n switch (formatType) {\n case 'time':\n return format ? d3_time_format_1.timeFormat(format)(value) : autoTimeFormat(value);\n case 'number':\n return format ? d3_format_1.format(format)(value) : autoNumberFormat(value);\n case 'string':\n default:\n return value;\n }\n}", "formatKind() {\n throw new Error('not implemented')\n }", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ');\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function IntersectionTypeAnnotation(node, print) {\n\t print.join(node.types, { separator: \" & \" });\n\t}", "function IntersectionTypeAnnotation(node, print) {\n\t print.join(node.types, { separator: \" & \" });\n\t}", "static format(format, ...args) {\n args.forEach(arg => {\n format = format.replace('##', arg);\n });\n return format;\n }", "function formatDate(date, text, type) {\n if (date == null) {\n return \"\";\n }\n\n var monthNames = [\n text.January,\n text.February,\n text.March,\n text.April,\n text.May,\n text.June,\n text.July,\n text.August,\n text.September,\n text.October,\n text.November,\n text.December\n ];\n\n date = new Date(date);\n\n const day = date.getDate();\n const monthIndex = date.getMonth();\n const year = date.getFullYear();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n\n if (type === \"date\") {\n return year + \" \" + monthNames[monthIndex] + \" \" + day;\n } else if (type === \"date-time\") {\n return (\n year +\n \" \" +\n monthNames[monthIndex] +\n \" \" +\n day +\n \", \" +\n hours +\n \":\" +\n minutes\n );\n } else if (type === \"time\") {\n return hours + \":\" + minutes;\n } else {\n return date;\n }\n}", "function extractNumber(arg, type) {\n // according to the API.AI documentation the @sys.date-period entity will return the date in a \n // ISO-8601 format. I.e. 2014-01-01/2014-12-31. The year is the first one in the return value, so\n // my regular expression will match the numbers before the '-'. Similarly, I will need to account for the\n // case when type is @sys.date, which will have the day as the last digits before the '-'.\n var pattern = type == DATE_ARGUMENT ? /[\\d]+$/ : /[\\d]+/;\n //var numb = arg.match(/[\\d]+/);\n var numb = arg.match(pattern);\n return numb.join(\"\");\n }", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ');\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0] = (useColors?'%c':'') + this.namespace + (useColors?' %c':' ') + args[0] + (useColors?'%c ':' ') + '+' + exports.humanize(this.diff);if(!useColors)return args;var c='color: ' + this.color;args = [args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%' === match)return;index++;if('%c' === match){ // we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC = index;}});args.splice(lastC,0,c);return args;}", "function IpadicFormatter() {\n}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function (match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function (match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n }", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}" ]
[ "0.54740864", "0.545433", "0.5341621", "0.5326154", "0.5245996", "0.5173307", "0.5153685", "0.5115746", "0.51004386", "0.5072338", "0.5057002", "0.50463784", "0.5003069", "0.49909866", "0.49246162", "0.4914578", "0.4914578", "0.4887306", "0.48745137", "0.48443437", "0.48443437", "0.48443437", "0.48443437", "0.48235178", "0.4735865", "0.47130033", "0.47083235", "0.47033742", "0.46957892", "0.46897504", "0.46894726", "0.46835512", "0.46835512", "0.4681538", "0.46813178", "0.46732417", "0.46484914", "0.4643311", "0.46212757", "0.46185955", "0.4611994", "0.46083575", "0.4605591", "0.4605591", "0.4598739", "0.45918483", "0.45918483", "0.45918483", "0.45918483", "0.45882353", "0.4581434", "0.457487", "0.45716986", "0.45641127", "0.45629093", "0.45595416", "0.45532566", "0.45489112", "0.45439428", "0.4537307", "0.4534731", "0.4523864", "0.4518249", "0.45172444", "0.45149294", "0.45119238", "0.45082706", "0.45082706", "0.45082706", "0.45041877", "0.45041877", "0.45028192", "0.45025173", "0.4498082", "0.44947213", "0.44899935", "0.44844538", "0.44800273", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.44763345", "0.4475989", "0.4466109", "0.4466109", "0.4466109", "0.4466109", "0.4466109", "0.4466109" ]
0.5289269
4
Output a single mnemonic definition
function outputMnemonic(pageFile, row, fltCompName) { var isOutput = false; var itosFormat = ""; var variableName = ccdd.getStructureVariableName(row); var dataType = ccdd.getStructureDataType(row); // Get the ITOS encoded form of the data type var itosEncode = ccdd.getITOSEncodedDataType(dataType, "BIG_ENDIAN"); // Check if this data type is a recognized base type or structure if (itosEncode != null) { // Check if the data type is a primitive (not a structure) if (!itosEncode.equals(dataType)) { // Get the ITOS output format string based on the encoding itosFormat = setITOSFormatFlag(itosEncode); } // Get the variable name and array size var arraySize = ccdd.getStructureArraySize(row); var fullVariableName = ccdd.getFullVariableName(row); // See if this row would exceed the maximum. If so start another column nextRow(pageFile, variableName, fullVariableName, row); // Get the full variable name (including the variable's structure path) var tmp = ccdd.getFullVariableName(row, " "); // Find number of spaces (i.e. " ") in tmp and makes prepad a string // containing only that many spaces var prepad = new java.lang.String(String(tmp.match(/ /g))).replaceAll("[\\,]", ""); var len = 0; // Only output non-array variables or array members (i.e., skip array // definitions) if (isVariable(variableName, arraySize)) { // In case this is an array member replace the square brackets variableName = convertArrayMember(variableName); // Create the mnemonic definition var fullVariableName2 = prepad + fltCompName + fullVariableName; len = prepad.length() + variableName.length(); // Check if the data type is a structure if (itosEncode.equals(dataType)) { nextColumnHeader = prepad + variableName; lastSubStructureName = nextColumnHeader; headerNames[row] = lastSubStructureName; fullHeaderNames[row] = fullVariableName; ccdd.writeToFileLn(pageFile, "(+, " + columnOffset + ", \"" + nextColumnHeader + "\")"); } // Not a structure; it's a primitive type else { if (isArrayElement(arraySize)) { var maxDigits = Math.ceil(Math.log(arraySize) / Math.LN10); var digitPad = new Array(maxDigits + 1).join(" "); // Output number with leading spaces var index = getIndex(variableName); var indexPadded = index.toString().padLeft(maxDigits); inMiddleOfArray = true; var arrayPad = 13; // This item is first on a row if (index % modNum != 0) { ccdd.writeToFileLn(pageFile, fullVariableName2 + "(=, +, \" :v" + itosFormat + ":\", raw)"); len = 0; } // This array item is NOT first item on a row else { var lastIndex = Math.min(arraySize - 1, +index + +modNum - 1).toString().padLeft(digitPad); var arrayMessage = new java.lang.String(String(prepad + "[" + indexPadded + "-" + lastIndex + "]")); len = arrayMessage.length() + (numITOSDigits + 1) * Math.min(modNum, arraySize); ccdd.writeToFileLn(pageFile, fullVariableName2 + "(+, " + columnOffset + ", \"" + arrayMessage + " :v" + itosFormat + ":\", raw)"); } if (index != +arraySize - 1 && (+index + 1) % modNum != 0) { rowCount = +rowCount - 1; } if (index == (+arraySize - 1)) { inMiddleOfArray = false; nextColumnHeader = lastSubStructureName; } } // Not an array item, print normally else { ccdd.writeToFileLn(pageFile, fullVariableName2 + "(+, " + columnOffset + ", \"" + prepad + variableName + " :v" + itosFormat + ":\", raw)"); len = prepad.length() + variableName.length() + numITOSDigits + 2; } } isOutput = true; } else { nextColumnHeader = prepad + variableName + "[" + arraySize + "] - " + itosEncode; len = new java.lang.String(String(nextColumnHeader)).length(); ccdd.writeToFileLn(pageFile, "array_fmt(+, " + columnOffset + ", \"" + nextColumnHeader + "\")"); } if (maxColumnLength < +len) { ccdd.writeToFileLn(pageFile, "## col_max_len is now = " + len + " (was " + maxColumnLength + ")"); maxColumnLength = +len; } } else { ccdd.writeToFileLn(pageFile, "#### NOT printing " + variableName); } return isOutput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMnemonic() {\n const mnemonic = bip39.generateMnemonic();\n return mnemonic.split(\" \").slice(0, 3).join(\" \");\n}", "function outputMnemonics(pageFile, fltCompName)\n{\n ccdd.writeToFileLn(pageFile, \"# Mnemonics\");\n\n // Step through each of the structure table rows\n for (var row = 0; row < ccdd.getStructureTableNumRows(); row++)\n {\n // Initialize the header name array values to blanks\n fullHeaderNames[row] = \"\";\n headerNames[row] = \"\";\n }\n\n // Step through each row in the table\n for (row = 0; row < ccdd.getStructureTableNumRows(); row++)\n {\n // Output the mnemonic for this row in the data table\n var isOutput = outputMnemonic(pageFile, row, fltCompName);\n\n // Check if a mnemonic definition was output to the file\n if (isOutput)\n {\n // Add an end of line to file to get ready for next line\n ccdd.writeToFileLn(pageFile, \"\");\n }\n }\n}", "lldisplayWordDefinition() {\r\n console.log(`\\nDefinition: ${this.definition}`);\r\n }", "formatSynopsis() {\n if (this.demand) {\n return ` <${this.name}>`\n }\n return ` [${this.name}]`\n }", "helpText(){\n\n if(this.getStep() === 0 ){\n return ` -== HELP ==-\n The first line is 1 integer, consisting of the number of the number of lines of source code (N).\n The second line is 1 integer, constiting of the number of queries (Q).\n The next N lines consiste of HRML source code, consisting of either an opening tag with zero or more attributes or a closing tag. \n Then the next Q lines contains the queries. \n Each line is a string that references an attribute in the HRML source code.`;\n\n }else if(this.getStep() === 1){\n return 'START';\n }\n }", "function help () {\n return `INSTRUCTIONS:\n Blacksmith is a simple text base game. \n \n As a blacksmith you convert ore and wood into swords and axes. You buy your resources using gold and sell your weapons for gold.\n \n COMMANDS:\n - buy(item)\n - make(item)\n - sell(item)\n - fire()\n - inventory()\n - help()`\n }", "man() {\n console.log('Peano - Expression := ');\n console.log('0 | ++expr | --expr | definition');\n console.log('definition = <Nom_fonction>(<arg>i, <arg>j, ...) { }');\n console.log('\\n');\n }", "static definition() {\n return 'A tree is a perennial plant with an elongated stem, or trunk, supporting branches and leaves.'\n }", "help() {\n const lines = [];\n if (this.banner) { lines.unshift(`${this.banner}\\n`); }\n for (const rule of Array.from(this.rules)) {\n let spaces = 15 - rule.longFlag.length;\n spaces = spaces > 0 ? repeat(' ', spaces) : '';\n const letPart = rule.shortFlag ? `${rule.shortFlag}, ` : ' ';\n lines.push(` ${letPart}${rule.longFlag}${spaces}${rule.description}`);\n }\n return `\\n${lines.join('\\n')}\\n`;\n }", "function mnemonicFromSeed(seed) {\n // Sanity length check\n if (seed.length !== nacl.SEED_BTYES_LENGTH) {\n throw new RangeError(`Seed length must be ${nacl.SEED_BTYES_LENGTH}`);\n }\n const uint11Array = toUint11Array(seed);\n const words = applyWords(uint11Array);\n const checksumWord = computeChecksum(seed);\n return `${words.join(' ')} ${checksumWord}`;\n}", "setMasterMnemonic (state, _mnemonic) {\n /* Update master seed. */\n state.masterMnemonic = _mnemonic\n }", "outputKey(key) {\n return \"[[[output of \" + key + \"]]]\";\n }", "function getMnemonic(walletRPC, keyIncludes, chain) {\n\twalletRPC.mnemonic()\n\t\t.then(mnemonic => {\n\t\t\tconsole.log(\"Your mnemonic is: \"+mnemonic.key)\n\t\t\tchain(walletRPC, { keyIncluded: mnemonic.key.includes(keyIncludes), mnemonic:mnemonic.key })\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "getHelpText(){\n return \"Tree Authoring Shell: Commands: cd {id} | @{id}. set tag {tags} | #{tag}, set value {variable} {value} | ${variable}: {value}, rm {id}, link {id} {id} | {id} > {id}, stash, unstash, prior | <, search {type} {variable} {value}\";\n\n }", "function secretKeyToMnemonic(sk) {\n // get the seed from the sk\n const seed = sk.slice(0, nacl.SEED_BTYES_LENGTH);\n return mnemonicFromSeed(seed);\n}", "showMnemonic() {\n this.setState({ showMnemonic: true });\n }", "function getFinalTerm(card){\n return card.displayTerm + \" (\" + card.definition.toString() + \")\";\n}", "getMarkDown() {\n const data = this.getExportableObject();\n\n let result = \"\";\n\n // title section\n result += \"# DiagnoSys - *A Differential Diagnosis Tool*\\n\\n\";\n result += \"TODO: add logo image here\\n\\n\\n\";\n\n // critical\n result += \"## Critical Diagnoses\\n\\n\";\n result += \"#| Diagnosis | SNOMED Code | Note\\n\";\n result += \":--- | :--- | :--- | :---\\n\";\n data[\"Critical Diagnoses\"].forEach((diagnosis, index) => {\n result += `${index} | ${diagnosis.Name} | ${diagnosis[\"SNOMED Code\"]} | ${diagnosis.Note}\\n`;\n });\n result += \"\\n\\n\";\n\n // likely\n result += \"## Likely Diagnoses\\n\\n\";\n result += \"#| Diagnosis | SNOMED Code | Note\\n\";\n result += \":--- | :--- | :--- | :---\\n\";\n data[\"Likely Diagnoses\"].forEach((diagnosis, index) => {\n result += `${index} | ${diagnosis.Name} | ${diagnosis[\"SNOMED Code\"]} | ${diagnosis.Note}\\n`;\n });\n\n return result;\n }", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "man() {\n console.log('Grammaire de la machine de Peano :');\n this.expression.man();\n this.definition.man();\n }", "constructor(mnemonic, isMatch, disasm, exec) {\r\n this.mnemonic = mnemonic;\r\n this.isMatch = isMatch;\r\n this.disasm = disasm;\r\n this.exec = exec;\r\n }", "function generateMarkDown(answers) {\nreturn `\n<a id =\"return\"></a>\n\n# Table of Contents\n1. [Title](#title)\n2. [Description](#description)\n3. [Installation](#installation)\n4. [Contributing](#contributing)\n5. [Test](#test)\n6. [License](#license)\n7. [Questions](#questions)\n\n\n\n<a id =\"title\"></a>\n# The title of the project is ${answers.Title} \n\n<a id =\"description\"></a>\n# ${answers.Description} \n\n<a id =\"installation\"></a>\n# The project is installed by ${answers.Installation} \n\n<a id =\"contributing\"></a>\n# The guidelines are: ${answers.Contributing} \n\n<a id =\"test\"></a>\n# Was a test added? ${answers.Tests} \n\n<a id=\"license\"></a>\n# Licence used : ${answers.license} \n\n<a id=\"questions\"></a>\n# Questions \n * My GitHub username is <https://github.com/${answers.github}>\n * Please email me at ${answers.email} with anymore questions\n \n \n [Return to Top](#return)\n ` \n\n\n\n}", "function help () {\n return `Welcome to Scramble. \n The game where you unscramble letters to make words.\n \n Once you start the game, you will be given a scrambled word.\n If you correctly guess the word, you will receive a point.\n If you guess incorrectly you will receive a strike.\n You can also pass on a word. \n \n To start a new game use start().\n To make guess use guess('word').\n To skip a word use pass().\n To show these instructions again use help().`\n }", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function id(m) {\n\t var meaning = lang_1.isPresent(m.meaning) ? m.meaning : '';\n\t var content = lang_1.isPresent(m.content) ? m.content : '';\n\t return lang_1.escape(\"$ng|\" + meaning + \"|\" + content);\n\t}", "function help () {\n return `Welcome to Scramble.\nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word.\n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "generate() {\n const cmd = this.command;\n const flags = util.sortBy(\n Object.entries(cmd.flags || {})\n .filter(([, v]) => !v.hidden)\n .map(([k, v]) => {\n v.name = k;\n return v;\n }),\n (f) => [!f.char, f.char, f.name],\n );\n const args = (cmd.args || []).filter((a) => !a.hidden);\n let output = util\n .compact([\n this.usage(flags),\n this.args(args),\n this.flags(flags),\n this.description(),\n this.aliases(cmd.aliases),\n this.examples(cmd.examples || cmd.example),\n this.docs(),\n ])\n .join('\\n\\n');\n if (this.opts.stripAnsi) output = stripAnsi(output);\n return output;\n }", "function showHelpUsage() {\n let helpString = \"Hei, olen Relluassari! Yritän auttaa sinua relaatioiden ratkonnassa ;) \\n\" +\n \"<<< Koska olen vielä beta, älä pahastu jos en osaa jotain, tai kaadun kesken kaiken >>> \\n\" +\n \" \\n Miten kutsua minut apuun? \\n \" +\n \" TL;DR? Klikkaa tunnettua -> klikkaa tuntematonta -> klikkaa tuntematonta -> ... -> Repeat \\n\" +\n \" \\nEli miten? \\n\" +\n \" 1) Klikkaa graafista tunnettua sanaa \\n\" +\n \" -> Relluassari tekee Wikipediasta, Bingistä, Wiktionarystä ja Ratkojista lähdehaut ko. sanalla. \\n\" +\n \" 2) Kun haku valmis, klikkaa graafista tunnettuun kytkettyä tuntematonta sanaa \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 3) Kun brutetus valmis, klikkaa seuraavaa tunnettuun kytkettyä tuntematonta \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 4) Valitse uusi tunnettu sana lähteeksi ja siirry kohtaan 1) \\n\" +\n \"\\nAdvanced usage: \\n\" +\n \" Menu>Suorita lähdehaku (teemasana) - tekee lähdehaun vain teemasanalla \\n\" +\n \" Menu>Suorita lähdehaku (oma sana) - tekee lähdehaun syöttämälläsi sanalla/sanoilla (esim. usean sanan hakuun Bingistä) \\n\" +\n \" Menu>Parsi hakutulos sanoiksi - parsii hakutuloksesta *kaikkien* näkyvien tuntemattomien pituiset sanat \\n\" +\n \" Menu>Bruteta sanalista - brutettaa rellua sen hetken muistissa olevalla koko sanalistalla \\n\";\n alert(helpString);\n}", "get format() {\n\t\t// start with command name\n\t\tlet response = this._name;\n\n\t\t// loop through parameters to add description\n\t\tthis._parameters.forEach(\n\t\t\tfunction(param) {\n\t\t\t\tresponse += \" (\" + param.description + \")\"\n\t\t\t}\n\t\t);\n\n\t\t// add remainder description with slightly different symbols\n\t\tif (this._remainderDescription) response += \" [\" + this._remainderDescription + \"]\"\n\n\t\treturn response;\n\t}", "function masterDerivationKeyToMnemonic(mdk) {\n return mnemonicFromSeed(mdk);\n}", "helpMessage() {\n return \"*!who-knows <skill-name>*\\n\" +\n \"Gibt eine Liste von Kollegen zurück, die den angegebenen Skill beherrschen.\\n\" +\n \"Die Liste wird durch die API von HBT Power bereitgestellt, die Suche ist (noch) case sensitive.\\n\" +\n \" Alias: !wer-weiß, !häää?, !who-knows, wat?\";\n }", "function mnemButton(evt, mnemonic) {\n let text = document.getElementById(\"textBox\").value;\n if (text != '') {\n text += '\\n';\n }\n text += mnemonic;\n document.getElementById(\"textBox\").value = text;\n}", "function generateReadme (answer) {\n return `\n# ${answer.title}\n\n![GitHub license](https://img.shields.io/badge/Made%20by-%40ChambersM97-orange)\n\n# Table of Contents\n\n\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contributing](#contributing)\n- [Tests](#tests)\n- [Questions](#questions)\n\n## Description:\n This area is designed for leaving a report of what the project is and it's purpose.\n ${answer.description}\n\n## Installation:\n These are the necessary steps to follow/files to download that you need in order to run the application.\n ${answer.installation}\n\n## Usage:\n ${answer.usage}\n\n## License:\n[![License](https://img.shields.io/badge/License-${answer.license}%202.0-blue.svg)](https://opensource.org/licenses/${answer.license})\n\n## Contributing:\n ${answer.contributing}\n\n## Tests:\n\n![Password-Generator-gif](readmeGenerator.gif)\n![Password-Generator_img](readmepic.PNG)\n\n## Questions:\n- GitHub: [${answer.username}](https://github.com/${answer.username})\n- Email: Contact me @ ${answer.email} for any other questions you might have!\n\n `\n\n}", "function generateRandomMnemonic() {\n return bip39.generateMnemonic(256);\n}", "function toSyllable(){\n if(syllables.length > 1){\n currentColor = syllables[syllables.length-1].color;\n }\n document.getElementById(\"input\").innerHTML = syllableForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function generateMarkdown(answer) {\n\treturn `# ${answer.title}\n## Description\n${answer.description}\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n\t1. [Testing](#test)\n3. [Contribution](#contribution)\n4. [Contact Me](#contact)\n5. [License](#license)\n## Installation <a name=\"installation\"></a>\n\\`\\`\\`bash\n${answer.installation}\n\\`\\`\\`\n## Usage <a name=\"usage\"></a>\n${answer.usage}\nTo run the tests: <a name=\"test\"></a>\n\\`\\`\\`bash\n${answer.test}\n\\`\\`\\`\n## Contribution <a name=\"contribution\"></a>\n${answer.contributing}\n## Have a question? <a name=\"contact\"></a>\n[Github Account](https://github.com/${answer.github})\nEmail me at ${answer.email}\n## License \n${renderLicenseBadge(answer.license)}\n\n`;\n}", "function code(c) {\n return DEFINITIONS[c] || c.toUpperCase().charCodeAt(0);\n }", "function code(c) {\n return DEFINITIONS[c] || c.toUpperCase().charCodeAt(0);\n }", "function getHelpMaster() {\n var help = \"\\\n<br/>#b (#public, set room as public) \\\n<br/>#k {user} (#kick, kick a user out of current room) \\\n<br/>#m {user} (#master, assign another room user as master) \\\n<br/>#s {size} (#size, set room max size, 0 means no limit) \\\n<br/>#v (#private, set room as private) \\\n\";\n return help;\n }", "function createMnemonic(walletRPC, keyIncludes) {\n\tcreateAndOpenWallet(walletRPC, TheWalletName, function(walletRPC) {\n\t\tgetMnemonic(walletRPC, keyIncludes, function(walletRPC, mnemonicOutput) {\n\t\t\tif (mnemonicOutput.keyIncluded) { return mnemonic; }\n\t\t\telse {\n\t\t\t\tfs.unlink(\"./wallets/\"+TheWalletName+\".keys\", function() { // delete previous new-wallet.key\n\t\t\t\t\tfs.unlink(\"./wallets/\"+TheWalletName, function() { // delete previous new-wallet\n\t\t\t\t\t\tcreateMnemonic(walletRPC, keyIncludes);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\t\n}", "static fromString(mnemonic) {\n return new Mnemonic(mnemonic.split(\" \"));\n }", "function generateControlDefinition(ctrl, indent) {\n const indented_1 = indentLevel(indent, 1);\n let text = '';\n text += generateControlDefintionBeginning(ctrl, indent);\n text += generateLabeledControlProperties(ctrl, indented_1);\n text += generateControlDefintionEnding(indent);\n return text;\n }", "function StringHelp() {\n}", "function showState(state) {\n\treturn `[${state.content[0].show()} ${state.content[1].show()}]`;\n}", "function qname(m)\r\n{\r\n\treturn \"\\x22\" + m + \"\\x22\";\r\n}", "function symbol(name){\r\n return lexeme(string(name));\r\n}", "showGetMnemonicButton() {\n return(\n <View style = { styles.changingContainer }>\n <View style = { styles.explanationContainer }>\n <Text style = { styles.explanation }>{ mnemonicScreenConstants.mnemonicScreenExplanationText }</Text>\n </View>\n <TouchableOpacity style = { styles.nextButton } onPressOut = { this.showMnemonic.bind(this) } >\n <Text style = { styles.nextButtonText }>GET MNEMONIC</Text>\n </TouchableOpacity>\n </View>\n );\n }", "describeKimfer() {\n return `Meet ${this.name}! He has ${this.health} health points and a strength of ${this.strength}. He have ${this.xp} experience points`;\n }", "function readInp(){\n\tvar inp = document.getElementById(\"cfg\").value;\n\tvar without = interpret(inp);\n\tvar SymSet = new SymbolSet(without);\n\tvar startSym = SymSet.findSym(\"S\");\n\tvar sentence = SymSet.writeSymbol(startSym);\n\t//console.log(sentence);\n\tdocument.getElementById(\"output\").innerHTML += \"<li>\" + sentence + \"</li>\";\n}", "getHelp ( input, output ) {\n output.standardOutput.writeLine( 'Usage:' );\n this.getUsage().split( '\\n' ).forEach( line => output.standardOutput.writeLine( line ) );\n output.standardOutput.writeLine( '' );\n\n if ( this.getDescription() ) {\n output.standardOutput.writeLine( 'Description:' );\n output.standardOutput.writeLine( this.getDescription() );\n }\n\n output.standardOutput.writeLine( '' );\n }", "get help() {\n\t\tlet response = \"\"\n\t\tif (this._description) { \n\t\t\tresponse = this._description; \n\t\t}\n\n\t\tresponse += \" - Usage: \" + this.format;\n\t\tresponse += \" - Ex: \" + this.example;\n\n\t\treturn response;\n\t}", "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = underground.selected.explanationDisplay();\n}", "function createLabelMaker(title, instructions, callback) {\n var newStrP = new StringPad();\n newStrP.open(title, instructions, callback);\n }", "function writeInstructions() {\n noStroke();\n fill(252, 118, 172);\n textSize(54)\n text('my name is', width / 2, height / 3)\n text('i was born in', width / 2, height * 1 / 2);\n textSize(25);\n text('click on your sign to get your horoscope!', width / 2, height * 2 / 3)\n}", "function generateHaiku() {\n // Make a DIV with the new sentence\n var expansion = cfree.getExpansion('<start>');\n expansion = expansion.replace(/%/g, '<br/>');\n var par = createP(expansion);\n par.class('text');\n}", "function XDisplaySentence(targetId, WordIdPrefix, punctuation) {\n //alert('Display Function');\n //Build the Sentence\n var sentence = \"\".concat($(WordIdPrefix + LastSentenceSelections[0]).text(), \" \", $(WordIdPrefix + LastSentenceSelections[1]).text(), \" \", $(WordIdPrefix + LastSentenceSelections[2]).text(), \" \", $(WordIdPrefix + LastSentenceSelections[3]).text(), punctuation);\n\n $(targetId).text(sentence);//Display the sentence in the header\n}", "function Term(hiragana, kanji, definition) {\n this.hiragana_ = hiragana;\n this.kanji_ = kanji;\n this.definition_ = definition;\n}", "function word(name, definition){\n this.name = name;\n this.definition = definition;\n}", "get displayText PS_displayText() {\n var {matchedName: sentence, _arguments: args} = this._verb;\n for (let x in args) {\n let obj = x === \"direct_object\";\n let {text} = this._argSuggs[x] || 0;\n if (text) sentence += (\" \" +\n (obj ? \"\" : args[x].flag + \" \") +\n (obj ? \"[ \" + text + \" ]\" : text));\n }\n return sentence;\n }", "function help() {\n console.log(\n \"\\n\" +\n \"STRUCTURE\" +\n \"\\033[38;5;6m\" + \"\\n node liri.js (command) + (search(artist, concert, movie))\\n\" + \"\\033[0m\" +\n \"\\nCOMMAND OPTIONS\" +\n \"\\033[38;5;10m\" +\n \"\\n spotify-this-song\" + \"\\033[0m\" + \" search for artist details\" +\n \"\\033[38;5;10m\" +\n \"\\n concert-this\" + \"\\033[0m\" + \" search for concert details\" +\n \"\\033[38;5;10m\" +\n \"\\n movie-this\" + \"\\033[0m\" + \" search for movie details\" +\n \"\\033[38;5;10m\" +\n \"\\n do-what-it-says\" + \"\\033[0m\" + \" run a search based on what is written in 'random.txt'\"\n )\n}", "function entry (name) {\n let lastWord = env.compilationVocabulary.word;\n env.compilationVocabulary.word = env.dp;\n\n memWriteNextByte(0); // flags\n memWriteNextCell(lastWord); // link to previous word\n memWriteNextString(name); // word name\n}", "function getLabelDescriptions () {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'text' : 'Walk'\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'text' : 'Bus Stop Sign'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'text' : 'One-leg Stop Sign'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'text' : 'Two-leg Stop Sign'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'text' : 'Column Stop Sign'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'text' : 'Not provided'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'text' : 'Bus Stop Shelter'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'text' : 'Bench'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'text' : 'Trash Can / Recycle Can'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'text' : 'Mailbox / News Paper Box'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'text' : 'Traffic Sign / Pole'\n }\n }\n}", "function label(node) {\n var type = node.referenceType;\n var value = type === 'full' ? node.identifier : '';\n\n return type === 'shortcut' ? value : '[' + value + ']';\n}", "get abbrButton() {\n return {\n command: \"wrapRange\",\n commandVal: \"ABBR\",\n toggles: true,\n label: \"Abbr\",\n type: \"rich-text-editor-button\",\n };\n }", "function explainShortName(name, tTable) {\n return \" title='\"+name+\"' \";\n}", "function generateText(text) {\n let mm = new MarkovMachine(text);\n console.log(mm.makeText());\n}", "function description(state) {\n if(typeof state === \"object\") return \"<br>\" + state.join(\"<br>\");\n var descr = \"\";\n for(var i = 0, h = state.length - 1; h >= 0; --h) {\n var hex = parseInt(state[h], 16);\n if(hex & 1) descr += \"<br>\" + root.predicates[i]; ++i;\n if(hex & 2) descr += \"<br>\" + root.predicates[i]; ++i;\n if(hex & 4) descr += \"<br>\" + root.predicates[i]; ++i;\n if(hex & 8) descr += \"<br>\" + root.predicates[i]; ++i;\n }\n return descr;\n}", "getHelp() {\n return {\n syntax: `esm link source-path`,\n short: `links the dependency from source-path to the current project. Links just the version specicifed in the source-path and semver compatible versions, nothitng else.`,\n description: ``,\n examples: [{\n syntax: `esm link ../http2-server`,\n short: `links the http2-server library to the current projects esm folder`,\n }]\n }\n }", "function generateReadMe(answers) {\n createkey(answers)\n return `\n${answers.title}\n\n${myIcon}\n\n## Description\n${answers.description}\n## Table of Contents\n- [Description](#Description)\n- [Installation_instructions](#Installation_instructions)\n- [Usage](#Usage)\n- [License](#License)\n- [Contributors](#Contributors)\n- [Testing](#Testing)\n- [Questions](#Questions)\n\n## Installation_instructions\n${answers.installation_instructions}\n\n## Usage\n${answers.usage}\n\n${myImg}\n\nThis application is covered by the ${myIcon} license. \n\n${myLink}\n\n## Contributors\n${answers.contributors}\n\n## Testing \n${answers.testing}\n\n## Questions\nEmail me with any questions: ${answers.email}\n\nGitHub: [${answers.GitHub}](https://github.com/${answers.GitHub})`\n}", "static help() {\n console.log(\n`Usage: \n\\nversion [ -v semver ] [-p [ 0 => PATCH, 1 => MINOR, 2 => MAJOR ] ]\nE.g version -v 0.2.3 -p 1 ## 0.3.3\n\nversion [ -f file ] [ -d delimeter ]\n `);\n }", "make(m) {\n\t\treturn [`%c[TCFS]:%c ${m}`, 'color: purple; font-weight: bold', ''];\n\t}", "title() { return this.owner.name + \" - \" + this.label.replace('\\n', ' ') }", "function generate (type) {\n var chain = markovChain(type)\n if (chain) {\n return markovName(chain)\n }\n return ''\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "generate() {\n return {\n instructions: 'instructions here',\n question: 'question here',\n diagram: 'diagram here',\n answer: 'answer here',\n }\n }", "function generate_md(parsed_code, language, callback) {\n var outfile,\n outcode = '';\n \n for (var i = 0, l = parsed_code.length; i < l; i++) {\n if (parsed_code[i].comment !== '') outcode += parsed_code[i].comment + '\\n\\n';\n if (parsed_code[i].code !== '') outcode += '```' + language.name + '\\n' + parsed_code[i].code + '\\n```\\n\\n';\n }\n\n callback(null, outcode);\n}", "function CreateAbnfGrammar(myna) {\r\n // Setup a shorthand for the Myna parsing library object\r\n let m = myna; \r\n\r\n let g = new function() {\t\t\r\n\t\t// comment and whitespace\r\n\t\tthis.WSP = m.char(\" \\t\"); /* white space SP / HTAB */\r\n\t\t// comment \t= \";\" *(WSP / VCHAR) CRLF\r\n\t\tthis.comment \t= m.seq(\";\", m.advanceUntilPast(m.newLine));\r\n\t\tthis.c_nl = m.choice(m.newLine, this.comment); /* comment or newline */\r\n\t\tthis.c_wsp = m.choice(this.WSP, m.seq(this.c_nl, this.WSP)).zeroOrMore;\r\n\t\t\r\n\t\t// terminals\r\n\t\t// prose-val \t= \"<\" *(%x20-3D / %x3F-7E) \">\"\r\n\t\tthis.prose_val = m.tagged(m.notChar('>').zeroOrMore).ast; /* bracketed string of SP and VCHAR without angles prose description, to be used as last resort */\r\n\t\tthis.hex_val = m.seq(\"x\", m.hexDigit.oneOrMore, m.choice(m.seq(\".\", m.hexDigit.oneOrMore).oneOrMore, m.seq(\"-\", m.hexDigit.oneOrMore)).opt);\r\n\t\tthis.dec_val = m.seq(\"d\", m.digit.oneOrMore, m.choice(m.seq(\".\", m.digit.oneOrMore).oneOrMore, m.seq(\"-\", m.digit.oneOrMore)).opt);\r\n\t\tthis.bin_val = m.seq(\"b\", m.binaryDigit.oneOrMore, m.choice(m.seq(\".\", m.binaryDigit.oneOrMore).oneOrMore, m.seq(\"-\", m.binaryDigit.oneOrMore)).opt); /* series of concatenated bit values or single ONEOF range */\r\n\t\tthis.num_val = m.seq(\"%\", m.choice(this.bin_val, this.dec_val, this.hex_val)).ast;\r\n\t\t// char-val \t= DQUOTE *(%x20-21 / %x23-7E) DQUOTE\r\n\t\tthis.char_val = m.doubleQuoted(m.notChar('\"').oneOrMore).ast; /* quoted string of SP and VCHAR without DQUOTE */\r\n\t\t\r\n\t\tthis.rulename = m.seq(m.letter, m.choice(m.letter, m.digit, \"-\").zeroOrMore).ast;\r\n\t\t\r\n\t\t// patterns\r\n\t\tlet _this = this;\r\n\t\tthis.option = m.seq(\"[\", this.c_wsp, m.delay(function() { return _this.pattern; }), this.c_wsp, \"]\").ast;\r\n\t\tthis.group = m.seq(\"(\", this.c_wsp, m.delay(function() { return _this.pattern; }), this.c_wsp, \")\");\t\t\r\n\t\tthis.element = m.choice(this.rulename, this.group, this.option, this.char_val, this.num_val, this.prose_val);\r\n\t\tthis.repeat = m.choice(m.seq(m.digit.zeroOrMore, \"*\", m.digit.zeroOrMore), m.digit.oneOrMore).ast;\r\n\t\tthis.repetition = m.seq(this.repeat.opt, this.element).ast;\r\n\t\tthis.concatenation = m.seq(this.repetition, m.seq(this.c_wsp, this.repetition).zeroOrMore);\r\n\t\tthis.alternation\t= m.seq(this.c_wsp, \"/\", this.c_wsp, this.concatenation).ast;\r\n\t\tthis.pattern \t= m.seq(this.concatenation, this.alternation.zeroOrMore).ast;\r\n\t\t\r\n\t\t// rule\r\n\t\tthis.defined_as = m.choice(\"::=\", \":=\", \"=\").ast; /* basic rules definition; incremental alternatives \"=/\" is not supported */\r\n\t\tthis.rule = m.seq(this.rulename, this.c_wsp, this.defined_as, this.c_wsp, this.pattern, this.c_wsp, this.c_nl).ast; /* continues if next line starts with white space */\r\n\t\tthis.grammar\t\t= m.choice(this.rule, m.seq(this.c_wsp, this.c_nl)).oneOrMore.ast;\r\n };\r\n\r\n // Register the grammar, providing a name and the default parse rule\r\n return m.registerGrammar(\"abnf\", g, g.grammar);\r\n}", "helpInformation() {\n let desc = [];\n\n if (this._description) {\n desc = [this._description, ''];\n const {\n argsDescription\n } = this;\n\n if (argsDescription && this._args.length) {\n const width = this.padWidth();\n desc.push('Arguments:');\n desc.push('');\n\n this._args.forEach(({\n name\n }) => {\n desc.push(` ${pad(name, width)} ${argsDescription[name]}`);\n });\n\n desc.push('');\n }\n }\n\n let cmdName = this._name;\n\n if (this._alias) {\n cmdName = `${cmdName}|${this._alias}`;\n }\n\n const usage = [`Usage: ${cmdName} ${this.getUsage()}`, ''];\n let cmds = [];\n const commandHelp = this.commandHelp();\n if (commandHelp) cmds = [commandHelp];\n const options = ['Options:', `${this.optionHelp().replace(/^/gm, ' ')}`, ''];\n return usage.concat(desc).concat(options).concat(cmds).join('\\n');\n }", "function newAnchorLabel() {\n count = ++that.anchor_count;\n anchor_label = strval((count + 1)); //generating footnote number starting at 1 instead of 0\n /* yil original letter generating label code\n anchor_label = '';\n do {\n anchor_label = chr(ord('a') + (count % 26)) + anchor_label;\n count = (int) floor(count / 26);\n } while (count > 0);*/\n return anchor_label;\n }", "function TutorialInstruction({ commandName, iconName }) {\n return (\n <span className=\"Tutorial__instruction\">\n <SvgIcon name={iconName} inline={true} className=\"Tutorial__icon\" />\n <em>{commandName}</em>\n </span>\n );\n}", "function t(text) { return {'macro_name': 'plaintext', 'text': text}; }", "function showInstructions() {\n\t\t\tclear();\n\t\t\tdiv.update('<span style=\"color: grey; font-style: italic;\">' + lang.instructions + '</span>');\n\t\t}", "toString() {\r\n\t\treturn (this.ctrl? \"Ctrl+\":\"\") +\r\n\t\t\t(this.alt? \"Alt+\":\"\") +\r\n\t\t\t(this.shift? \"Shift+\":\"\") +\r\n\t\t\tthis.name\r\n\t}", "function showInstructions() {\r\n\tconst INSTRUCTIONS = \"1. Identify the morphological boundaries. \" \r\n\t\t\t\t\t + \"When you mouse over the word, grey slashes will appear in the spaces between the letters, indicating possible morphological boundaries. <br><br>\"\r\n\t\t\t\t\t + \"a. To mark a morphological boundary, click on the space where you think the boundary is using your mouse. <br><br> \" \r\n\t\t\t\t\t + \"b. Once you've made your selection, click on the check button to see whether you've identified the boundaries correctly. <br><br>\"\r\n\t\t\t\t\t + \"c. If you've selected your boundaries correctly, the morphological categories of the word's components will automatically appear above the word.\"\r\n\t\t\t\t\t + \"If you haven't, you will be given the opportunity to try again \"\r\n\t\t\t\t\t + \"(remember, after three tries, the program will provide the correct answer).\"; \r\n\tshowModal(INSTRUCTIONS, false);\r\n}", "toString() {\n return this.symbol + \"_\" + this.subscript;\n }", "get formula() { return this.ast ? this.ast.toString(this.id) : ''; }", "function createAnswer(state, currentFlow) {\nvar flowText = 'Current Flow: ' + currentFlow + 'FT<span class=\"superscript\">3</span>/S';\n$('#current-flow > .container').append(flowText).css('font-size', '18px').css('letter-spacing', '2px');\n$('#answer > .container').text(state.toUpperCase());\n}", "function displayStatement(nmbr){\n stellingTitle.innerHTML = (nmbr + 1).toString() + '. ' + subjects[nmbr].title;\n stellingDes.innerHTML = subjects[nmbr].statement;\n}", "function drawManga('anime stories') {\r\n alert(Bakuman + 'is my favorite anime and Manga of all time');\r\n}", "commandHelp() {\n if (!this.commands.length) return '';\n const commands = this.prepareCommands();\n const width = this.padWidth();\n return ['Commands:', commands.map(cmd => {\n const desc = cmd[1] ? ` ${cmd[1]}` : '';\n return (desc ? pad(cmd[0], width) : cmd[0]) + desc;\n }).join('\\n').replace(/^/gm, ' '), ''].join('\\n');\n }", "function createText(text){\n let mm = new markov.MarkovMachine(text)\n console.log(mm.makeText())\n}", "function generateSentence() {\r\n return selectChud()+' '+selectVerb()+' '+selectLefty()+' With '+selectAdjective()+' '+selectEnding();\r\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands',\n\t\t'<span class=\"green\">>about</span>',\n\t\t'<span class=\"yellow\">>contact</span>',\n\t\t'<span class=\"purple\">>projects</span>',\n\t\t'<span class=\"orange\">>skills</span>',\n\t\t'<span class=\"blue\">>experiences</span>',\n\t\t'>help',\n\t\t'>ping',\n\t\t'>time',\n\t\t'>clear',\n\t\t'>say',\n\t\t'>info',\n\t\t'>exit'];\n\tseperator();\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function madlib(verb, adj, noun) {\n return `We shall ${verb.toUpperCase()} the ${adj.toUpperCase()} ${noun.toUpperCase()}`\n}", "_renderInstructions(parseState) {\n var firstQuestionNumber = parseState.firstQuestionRef;\n var firstSentenceRef = parseState.firstSentenceRef;\n var instructions = \"\";\n\n if (firstQuestionNumber) {\n instructions += i18n._(\"The symbol %(questionSymbol)s indicates that question \" + \"%(questionNumber)s references this portion of the \" + \"passage.\", {\n questionSymbol: \"[[\" + firstQuestionNumber + \"]]\",\n questionNumber: firstQuestionNumber\n });\n }\n\n if (firstSentenceRef) {\n instructions += i18n._(\" The symbol %(sentenceSymbol)s indicates that the \" + \"following sentence is referenced in a question.\", {\n sentenceSymbol: \"[\" + firstSentenceRef + \"]\"\n });\n }\n\n var parsedInstructions = PassageMarkdown.parse(instructions);\n return /*#__PURE__*/React$13.createElement(\"div\", {\n className: \"perseus-widget-passage-instructions\"\n }, PassageMarkdown.output(parsedInstructions));\n }", "function generateMarkdown(answers) {\n return `# ${title} \\n ${description} \\n ## Table of Contents \\n * [Installation Instructions](#Installation-Instructions) \\n * [Contribution Guidelines](#Contribution-Guidelines) \\n * [Testing Instructions](#Testing-Instructions) \\n * [Questions](#Questions) \\n * [License](#License) \\n ## Installation Instructions \\n ${installationInstructions} \\n ## Instructions for Use \\n ${usage} \\n ## Contribution Guidelines \\n ${contribution} \\n ## Testing Instructions \\n ${test} \\n ## Questions \\n * Github Username: ${github} \\n * Email: ${email} \\n * How to contact: ${contact}`;\n }", "function symbolNode(value, height, depth, italic, skew, classes, style) {\n this.value = value || \"\";\n this.height = height || 0;\n this.depth = depth || 0;\n this.italic = italic || 0;\n this.skew = skew || 0;\n this.classes = classes || [];\n this.style = style || {};\n this.maxFontSize = 0;\n}" ]
[ "0.63409716", "0.6065563", "0.5815374", "0.5640102", "0.562062", "0.5616697", "0.54599607", "0.54352874", "0.5415095", "0.536314", "0.5349442", "0.53401595", "0.5324772", "0.52343404", "0.5215487", "0.5205382", "0.51888996", "0.51871806", "0.51363534", "0.51294446", "0.5117688", "0.51163834", "0.5105172", "0.50996596", "0.50996596", "0.50996596", "0.5098203", "0.5087997", "0.50856286", "0.5064781", "0.5061929", "0.5029022", "0.49770063", "0.4974142", "0.4972839", "0.49597374", "0.49561375", "0.49359974", "0.4932485", "0.49194548", "0.49194548", "0.49002144", "0.48861986", "0.48819327", "0.4879831", "0.48782623", "0.48618427", "0.48553473", "0.485396", "0.48517883", "0.4846086", "0.48441738", "0.48386338", "0.48317733", "0.48262647", "0.48256436", "0.4823566", "0.48228577", "0.48083365", "0.47979435", "0.4791382", "0.4784813", "0.47788233", "0.47741675", "0.4772696", "0.477115", "0.4770628", "0.4765253", "0.47648275", "0.47480747", "0.47472155", "0.47407162", "0.4740495", "0.47335255", "0.47314972", "0.4730208", "0.4729313", "0.4725378", "0.47242868", "0.47201604", "0.47199857", "0.47188136", "0.47109795", "0.47087482", "0.47085428", "0.4704255", "0.46924525", "0.46892148", "0.4686013", "0.46821612", "0.46717408", "0.46687335", "0.46683806", "0.4661652", "0.4660013", "0.4659648", "0.4658101", "0.4657112", "0.4652982", "0.46502313" ]
0.58402765
2
Output all of the mnemonic for display
function outputMnemonics(pageFile, fltCompName) { ccdd.writeToFileLn(pageFile, "# Mnemonics"); // Step through each of the structure table rows for (var row = 0; row < ccdd.getStructureTableNumRows(); row++) { // Initialize the header name array values to blanks fullHeaderNames[row] = ""; headerNames[row] = ""; } // Step through each row in the table for (row = 0; row < ccdd.getStructureTableNumRows(); row++) { // Output the mnemonic for this row in the data table var isOutput = outputMnemonic(pageFile, row, fltCompName); // Check if a mnemonic definition was output to the file if (isOutput) { // Add an end of line to file to get ready for next line ccdd.writeToFileLn(pageFile, ""); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAll (text) {\n\n\tasciify.getFonts(function (err, fonts) {\n\t\tif (err) { return console.error(err); }\n\n\t\tvar padSize = ('' + fonts.length).length;\n\n\t\tfonts.forEach(function(font, index) {\n\t\t\tvar opts = {\n\t\t\t\tfont: font,\n\t\t\t\tcolor: argv.color\n\t\t\t};\n\n\t\t\tasciify(exampleText, opts, function (err, result) {\n\t\t\t\tconsole.log(pad(padSize, index+1, '0') + ': ' + font);\n\t\t\t\tconsole.log(result);\n\t\t\t\tconsole.log('');\n\t\t\t});\n\t\t});\n\t});\n}", "function generateMnemonic() {\n const mnemonic = bip39.generateMnemonic();\n return mnemonic.split(\" \").slice(0, 3).join(\" \");\n}", "function showInstructions() {\n\t\t\tclear();\n\t\t\tdiv.update('<span style=\"color: grey; font-style: italic;\">' + lang.instructions + '</span>');\n\t\t}", "displayAll() {\n for (var i = 0; i < Object.getOwnPropertyNames(this).length; i++) {\n this.displayKey(Object.getOwnPropertyNames(this)[i])\n }\n }", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "displayCmd() {\r\n var cmdText = \"Commands \\n\";\r\n for (let i = 0; i < this.cmdOrder.length; ++i) {\r\n cmdText += this.cmdOrder[i] + \": \";\r\n cmdText += keyboardMap[this.cmdKeyCode[this.cmdIdx[this.cmdOrder[i]]]];\r\n cmdText += \"\\n\";\r\n }\r\n this.document.getElementById('commands').innerText = cmdText;\r\n }", "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function outputMnemonic(pageFile, row, fltCompName)\n{\n var isOutput = false;\n var itosFormat = \"\";\n\n var variableName = ccdd.getStructureVariableName(row);\n var dataType = ccdd.getStructureDataType(row);\n\n // Get the ITOS encoded form of the data type\n var itosEncode = ccdd.getITOSEncodedDataType(dataType, \"BIG_ENDIAN\");\n\n // Check if this data type is a recognized base type or structure\n if (itosEncode != null)\n {\n // Check if the data type is a primitive (not a structure)\n if (!itosEncode.equals(dataType))\n {\n // Get the ITOS output format string based on the encoding\n itosFormat = setITOSFormatFlag(itosEncode);\n }\n\n // Get the variable name and array size\n var arraySize = ccdd.getStructureArraySize(row);\n var fullVariableName = ccdd.getFullVariableName(row);\n \n // See if this row would exceed the maximum. If so start another column\n nextRow(pageFile, variableName, fullVariableName, row);\n\n // Get the full variable name (including the variable's structure path)\n var tmp = ccdd.getFullVariableName(row, \" \");\n \n // Find number of spaces (i.e. \" \") in tmp and makes prepad a string\n // containing only that many spaces\n var prepad = new java.lang.String(String(tmp.match(/ /g))).replaceAll(\"[\\\\,]\", \"\");\n var len = 0;\n\n // Only output non-array variables or array members (i.e., skip array\n // definitions)\n if (isVariable(variableName, arraySize))\n {\n // In case this is an array member replace the square brackets\n variableName = convertArrayMember(variableName);\n \n // Create the mnemonic definition\n var fullVariableName2 = prepad + fltCompName + fullVariableName;\n len = prepad.length() + variableName.length();\n \n // Check if the data type is a structure\n if (itosEncode.equals(dataType))\n {\n nextColumnHeader = prepad + variableName;\n lastSubStructureName = nextColumnHeader;\n headerNames[row] = lastSubStructureName;\n fullHeaderNames[row] = fullVariableName;\n ccdd.writeToFileLn(pageFile, \"(+, \" + columnOffset + \", \\\"\" + nextColumnHeader + \"\\\")\");\n }\n // Not a structure; it's a primitive type\n else\n {\n if (isArrayElement(arraySize))\n {\n var maxDigits = Math.ceil(Math.log(arraySize) / Math.LN10);\n var digitPad = new Array(maxDigits + 1).join(\" \");\n\n // Output number with leading spaces\n var index = getIndex(variableName);\n var indexPadded = index.toString().padLeft(maxDigits);\n\n inMiddleOfArray = true;\n var arrayPad = 13;\n\n // This item is first on a row\n if (index % modNum != 0)\n {\n ccdd.writeToFileLn(pageFile, fullVariableName2 + \"(=, +, \\\" :v\" + itosFormat + \":\\\", raw)\");\n len = 0;\n }\n // This array item is NOT first item on a row\n else\n {\n var lastIndex = Math.min(arraySize - 1, +index + +modNum - 1).toString().padLeft(digitPad);\n var arrayMessage = new java.lang.String(String(prepad + \"[\" + indexPadded + \"-\" + lastIndex + \"]\"));\n len = arrayMessage.length() + (numITOSDigits + 1) * Math.min(modNum, arraySize);\n ccdd.writeToFileLn(pageFile, fullVariableName2 + \"(+, \" + columnOffset + \", \\\"\" + arrayMessage + \" :v\" + itosFormat + \":\\\", raw)\");\n }\n\n if (index != +arraySize - 1 && (+index + 1) % modNum != 0)\n {\n rowCount = +rowCount - 1;\n }\n\n if (index == (+arraySize - 1))\n {\n inMiddleOfArray = false;\n nextColumnHeader = lastSubStructureName;\n }\n }\n // Not an array item, print normally\n else\n {\n ccdd.writeToFileLn(pageFile, fullVariableName2 + \"(+, \" + columnOffset + \", \\\"\" + prepad + variableName + \" :v\" + itosFormat + \":\\\", raw)\");\n\n len = prepad.length() + variableName.length() + numITOSDigits + 2;\n }\n }\n\n isOutput = true;\n }\n else\n {\n nextColumnHeader = prepad + variableName + \"[\" + arraySize + \"] - \" + itosEncode;\n len = new java.lang.String(String(nextColumnHeader)).length();\n ccdd.writeToFileLn(pageFile, \"array_fmt(+, \" + columnOffset + \", \\\"\" + nextColumnHeader + \"\\\")\");\n }\n\n if (maxColumnLength < +len)\n {\n ccdd.writeToFileLn(pageFile, \"## col_max_len is now = \" + len + \" (was \" + maxColumnLength + \")\");\n maxColumnLength = +len;\n }\n }\n else\n {\n ccdd.writeToFileLn(pageFile, \"#### NOT printing \" + variableName);\n }\n\n return isOutput;\n}", "displayWordInfo() {\r\n this.displayHangman();\r\n this.displayLives();\r\n this.displayLetters();\r\n this.displayLettersToGuess();\r\n }", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands',\n\t\t'<span class=\"green\">>about</span>',\n\t\t'<span class=\"yellow\">>contact</span>',\n\t\t'<span class=\"purple\">>projects</span>',\n\t\t'<span class=\"orange\">>skills</span>',\n\t\t'<span class=\"blue\">>experiences</span>',\n\t\t'>help',\n\t\t'>ping',\n\t\t'>time',\n\t\t'>clear',\n\t\t'>say',\n\t\t'>info',\n\t\t'>exit'];\n\tseperator();\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function printInstructions(){\n console.log(\"\\nHello! My Name is Liri. I am an AI assistant.\");\n console.log(\"I can perform the following tasks:\");\n console.log(`\\n\"my-tweets\": This command will return Yuen's latest tweets.`);\n console.log(`\\n\"spotify-this-song\": This command will return information about a song of your choice.`);\n console.log(`\\n\"movie-this\": This command will return information about a movie of your choice.`);\n console.log(`\\n\"do-what-it-says\": This command will perform a random command on a predefined query`);\n console.log(`-------------------`);\n}", "function showUsedLetters() {\n\t\t$(displayLetters).html(usedLetters.sort().join(\"\\xa0\\xa0\"));\n\t}", "function displayAll() {\n\n\t// get information\n\tvar firstCorpus = getFirstCorpus();\n\tvar firstAlignType = getFirstAlignType();\n\tif (firstCorpus === 'error') console.log(\"[Error] 存取文獻集名稱錯誤,系統上已無文本。\");\n\tif (firstAlignType === 'error') console.log(\"[Error] 存取段落對讀設定錯誤,系統上已無文本。\");\n\n\t// para setting\n\t_para['metadata'] = 'filename';\n\t_para['aligntype'] = firstAlignType;\n\t_para['corpus'] = firstCorpus;\n\t_para['mode'] = 'DocOrder';\n\n\t// display\n\tdisplayDocuManager();\n\tdisplayMetadataList(_para['metadata']);\n\tdisplayAlignTypeList(_para['aligntype']);\n\tdisplaySearchCorpus(_para['corpus']);\n\tdisplaySearchMode(_para['mode']);\n\tdisplayCompareContent(_para['metadata'], _para['aligntype']);\n}", "showMnemonic() {\n this.setState({ showMnemonic: true });\n }", "displayLetters() {\r\n let wordHidden = \"\\n\";\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (this.lettersToGuess.includes(this.text.charAt(i))) {\r\n wordHidden += HangmanUtils.symbol;\r\n }\r\n else {\r\n wordHidden += this.text.charAt(i);\r\n }\r\n wordHidden += \" \";\r\n }\r\n console.log(wordHidden);\r\n }", "function show(){\n\tconsole.log(\"Wins \" + wins);\n\tconsole.log(\"Losses \" + losses);\n\tconsole.log(\"Guesses left \" + guessLeft);\n\tconsole.log(newWord.displayValue());\n\tconsole.log(letterArray);\n}", "function mnemButton(evt, mnemonic) {\n let text = document.getElementById(\"textBox\").value;\n if (text != '') {\n text += '\\n';\n }\n text += mnemonic;\n document.getElementById(\"textBox\").value = text;\n}", "function printKey() {\n\t\tvar tableHtml = \"<table class='table table-condensed'>\";\n\t\tfor (var i = 0; i < 25; i = i + 5) {\n\t\t\ttableHtml += \"<tr>\";\n\t\t\tvar row = keyPhrase.substring(i, i + 5);\n\t\t\tvar chars = row.split(\"\");\n\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\ttableHtml += \"<td>\" + chars[x] + \"</td>\";\n\t\t\t}\n\t\t\ttableHtml += \"</tr>\";\n\t\t}\n\t\ttableHtml += \"</table>\";\n\t\t$(\"#keyTable\").html(tableHtml);\n\t}", "function help () {\n return `INSTRUCTIONS:\n Blacksmith is a simple text base game. \n \n As a blacksmith you convert ore and wood into swords and axes. You buy your resources using gold and sell your weapons for gold.\n \n COMMANDS:\n - buy(item)\n - make(item)\n - sell(item)\n - fire()\n - inventory()\n - help()`\n }", "show() {\n\t\tlet self=this;\n\t\tfor(let i in self.queue) {\n\t\t\tlet indent=0;\n\t\t\tself.prettyCommandObject(self.queue[i],indent);\n\t\t\tfor(let j in self.queue[i].commands) {\n\t\t\t\tindent++;\n\t\t\t\tself.prettyCommandObject(self.queue[i].commands[j],indent);\n\n\t\t\t}\n\t\t}\n\t}", "function showHelpUsage() {\n let helpString = \"Hei, olen Relluassari! Yritän auttaa sinua relaatioiden ratkonnassa ;) \\n\" +\n \"<<< Koska olen vielä beta, älä pahastu jos en osaa jotain, tai kaadun kesken kaiken >>> \\n\" +\n \" \\n Miten kutsua minut apuun? \\n \" +\n \" TL;DR? Klikkaa tunnettua -> klikkaa tuntematonta -> klikkaa tuntematonta -> ... -> Repeat \\n\" +\n \" \\nEli miten? \\n\" +\n \" 1) Klikkaa graafista tunnettua sanaa \\n\" +\n \" -> Relluassari tekee Wikipediasta, Bingistä, Wiktionarystä ja Ratkojista lähdehaut ko. sanalla. \\n\" +\n \" 2) Kun haku valmis, klikkaa graafista tunnettuun kytkettyä tuntematonta sanaa \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 3) Kun brutetus valmis, klikkaa seuraavaa tunnettuun kytkettyä tuntematonta \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 4) Valitse uusi tunnettu sana lähteeksi ja siirry kohtaan 1) \\n\" +\n \"\\nAdvanced usage: \\n\" +\n \" Menu>Suorita lähdehaku (teemasana) - tekee lähdehaun vain teemasanalla \\n\" +\n \" Menu>Suorita lähdehaku (oma sana) - tekee lähdehaun syöttämälläsi sanalla/sanoilla (esim. usean sanan hakuun Bingistä) \\n\" +\n \" Menu>Parsi hakutulos sanoiksi - parsii hakutuloksesta *kaikkien* näkyvien tuntemattomien pituiset sanat \\n\" +\n \" Menu>Bruteta sanalista - brutettaa rellua sen hetken muistissa olevalla koko sanalistalla \\n\";\n alert(helpString);\n}", "function writeInstructions() {\n noStroke();\n fill(252, 118, 172);\n textSize(54)\n text('my name is', width / 2, height / 3)\n text('i was born in', width / 2, height * 1 / 2);\n textSize(25);\n text('click on your sign to get your horoscope!', width / 2, height * 2 / 3)\n}", "function show() {\n best.html(population.pop[0].genes);\n averageFitness.html(population.averageFitness);\n generationNum.html(gNum);\n phrases.html(\"\");\n\n var phrs = \"\";\n\n for (let i = 1; i < population.pop.length && i < nPhrases.val(); i++) {\n phrs += '<span>' + population.pop[i].genes.join(\"\") + '</span>';\n }\n\n phrases.html(phrs);\n }", "displayInConsole() {\n console.log(\"{ name: \" + this.name + \", colors: \" + this.colors + \", manaCost: \" + this.manaCost + \", type: \" + this.modifier + \", TCGPlayer price: \" + this.tcgprice + \", Card Kingdom price: \" + this.ckprice);\n }", "generate() {\n const cmd = this.command;\n const flags = util.sortBy(\n Object.entries(cmd.flags || {})\n .filter(([, v]) => !v.hidden)\n .map(([k, v]) => {\n v.name = k;\n return v;\n }),\n (f) => [!f.char, f.char, f.name],\n );\n const args = (cmd.args || []).filter((a) => !a.hidden);\n let output = util\n .compact([\n this.usage(flags),\n this.args(args),\n this.flags(flags),\n this.description(),\n this.aliases(cmd.aliases),\n this.examples(cmd.examples || cmd.example),\n this.docs(),\n ])\n .join('\\n\\n');\n if (this.opts.stripAnsi) output = stripAnsi(output);\n return output;\n }", "function showSymbols(e) {\n let letters = findSymbols(e.target.value, names, nameMap);\n let list = '';\n for (const index in letters) {\n list +=\n `<div class='label'> ${letters[index][0]} </div>` +\n `<textarea onclick='copyToClipboard(\"${letters[index][1]}\")' class='symbol' readonly='true' rows='1' cols='1' >${letters[index][1]}</textarea>`;\n }\n nameList.innerHTML = list;\n}", "function showInstructions() {\r\n\tconst INSTRUCTIONS = \"1. Identify the morphological boundaries. \" \r\n\t\t\t\t\t + \"When you mouse over the word, grey slashes will appear in the spaces between the letters, indicating possible morphological boundaries. <br><br>\"\r\n\t\t\t\t\t + \"a. To mark a morphological boundary, click on the space where you think the boundary is using your mouse. <br><br> \" \r\n\t\t\t\t\t + \"b. Once you've made your selection, click on the check button to see whether you've identified the boundaries correctly. <br><br>\"\r\n\t\t\t\t\t + \"c. If you've selected your boundaries correctly, the morphological categories of the word's components will automatically appear above the word.\"\r\n\t\t\t\t\t + \"If you haven't, you will be given the opportunity to try again \"\r\n\t\t\t\t\t + \"(remember, after three tries, the program will provide the correct answer).\"; \r\n\tshowModal(INSTRUCTIONS, false);\r\n}", "kanaToDisplayForLesson(lesson) {\n const lessonWithKanaObjects = [];\n lesson.map(syllable =>\n lessonWithKanaObjects.push(new KanaSyllable(syllable.alphabet, syllable.consonant, syllable.vowel)));\n\n return lessonWithKanaObjects[0].display();\n }", "help() {\n const lines = [];\n if (this.banner) { lines.unshift(`${this.banner}\\n`); }\n for (const rule of Array.from(this.rules)) {\n let spaces = 15 - rule.longFlag.length;\n spaces = spaces > 0 ? repeat(' ', spaces) : '';\n const letPart = rule.shortFlag ? `${rule.shortFlag}, ` : ' ';\n lines.push(` ${letPart}${rule.longFlag}${spaces}${rule.description}`);\n }\n return `\\n${lines.join('\\n')}\\n`;\n }", "function keystroke_menu() {\n var htmlstr = '<h4>Keystroke commands for selected readings</h4><p>Click the pen to enable reading ' +\n 'selection. Readings can be selected by clicking, or by dragging across ' +\n 'the screen in edit mode. Press any of the following keys to take the ' +\n 'corresponding action:</p><ul>';\n $.each(keyCommands, function(k, v) {\n htmlstr += '<li><b>' + v['key'] + '</b>: ' + v['description'] + '</li>';\n });\n htmlstr += '</ul><p>Double-click a reading to access its properties; drag a reading to another one to create a relationship. For fuller documentation see the \"About/Help\" link.</p>';\n return htmlstr;\n}", "function print_mac(n)\n{\n\tvar str=\"\";\n\tvar j;\n\n\tfor(i=1;i<7;i++)\n\t{\n\t\tif(i==6) j=6;\n\t\telse j=i+1;\n\n\t\tstr+=\"<input class=text type=text id=\"+n+i+\" name=\"+n+i+\" size=1 maxlength=2 value='' onkeyup=\\\"move_mac(\"+i+\",\"+n+i+\",\"+n+j+\")\\\">\";\n\t\tif(i!=6) str+=\" : \";\n\n\t}\n\tdocument.write(str);\n}", "get displayText PS_displayText() {\n var {matchedName: sentence, _arguments: args} = this._verb;\n for (let x in args) {\n let obj = x === \"direct_object\";\n let {text} = this._argSuggs[x] || 0;\n if (text) sentence += (\" \" +\n (obj ? \"\" : args[x].flag + \" \") +\n (obj ? \"[ \" + text + \" ]\" : text));\n }\n return sentence;\n }", "show() {\n console.log(`id\\t${this.name}`);\n for (const [key, value] of this.entries()) {\n console.log(key, value);\n }\n }", "function printUsage(){\n\tconsole.log('Usage: ');\n\tconsole.log('node sag_coder.js encode /this/will/be/the/input/file');\n\tconsole.log('node sag_coder.js encode /this/will/be/the/input/file /this/will/be/the/output/file');\n\tconsole.log('');\n\tconsole.log('node sag_coder.js decode /this/will/be/the/input/file');\n\tconsole.log('node sag_coder.js decode /this/will/be/the/input/file /this/will/be/the/output/file');\n}", "function showHelpText() {\n ctx.save();\n\n if (lastUsedInput === 'keyboard') {\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.spacebar + ' ' + translation.select, 28 - fontMeasurement, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n else if (lastUsedInput === 'gamepad') {\n drawAButton(28, kontra.canvas.height - 25);\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.select, 28 + fontMeasurement * 1.75, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n\n ctx.restore();\n}", "outputKey(key) {\n return \"[[[output of \" + key + \"]]]\";\n }", "function help() {\n console.log(\n \"\\n\" +\n \"STRUCTURE\" +\n \"\\033[38;5;6m\" + \"\\n node liri.js (command) + (search(artist, concert, movie))\\n\" + \"\\033[0m\" +\n \"\\nCOMMAND OPTIONS\" +\n \"\\033[38;5;10m\" +\n \"\\n spotify-this-song\" + \"\\033[0m\" + \" search for artist details\" +\n \"\\033[38;5;10m\" +\n \"\\n concert-this\" + \"\\033[0m\" + \" search for concert details\" +\n \"\\033[38;5;10m\" +\n \"\\n movie-this\" + \"\\033[0m\" + \" search for movie details\" +\n \"\\033[38;5;10m\" +\n \"\\n do-what-it-says\" + \"\\033[0m\" + \" run a search based on what is written in 'random.txt'\"\n )\n}", "async print() {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tfor (let j = 0; j < 9; j++) {\n\t\t\t\tlet index = i * 9 + j\n\t\t\t\tlet value = '*'\n\t\t\t\tif (this.cells[index].possibilities.length === 0) {\n\t\t\t\t\tvalue = '!'\n\t\t\t\t} else if (this.cells[index].possibilities.length === 1) {\n\t\t\t\t\tvalue = `${this.cells[index].possibilities[0]}`\n\t\t\t\t}\n\t\t\t\tif (j % 3 === 2 && j !== 8) {\n\t\t\t\t\tvalue += ' |'\n\t\t\t\t}\n\t\t\t\tawait Deno.writeAll(Deno.stdout, new TextEncoder().encode(`${value} `))\n\t\t\t}\n\t\t\tif (i % 3 == 2 && i !== 8) {\n\t\t\t\tconsole.log('\\n---------------------')\n\t\t\t} else {\n\t\t\t\tconsole.log('')\n\t\t\t}\n\t\t}\n\t}", "function info() {\n\tseperator();\n\tOutput('<span>>info:<span><br>');\n\tOutput('<span>Console simulator by Mario Duarte https://codepen.io/MarioDesigns/pen/JbOyqe</span></br>');\n}", "function display() {\n\tfor (let key in this.dataStore) {\n\t\tconsole.log(`${key} ${this.dataStore[key]}`);\n\t}\n}", "addphrasetoDisplay(){\n const phraseUL = document.querySelector('#phrase ul');\n this.phrase.forEach(letter => {\n if(letter.match(/^\\s+$/)){\n phraseUL.innerHTML += `\n <li class=\"space\"> </li>\n `;\n } else{\n phraseUL.innerHTML += `\n <li class=\"hide letter ${letter}\">${letter.toUpperCase()}</li>`;\n }\n })\n }", "function help() {\n console.log(\" \");\n console.log(\n \" ╔════════════════════════════════════════════════════════════════════════╗\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ║ Hi my name is LUIRI, like Siri but better, Ill be assisting you... ║\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ╠════════════════════════════════════════════════════════════════════════╣\"\n .rainbow\n );\n console.log(\n \" ║ To see your tweets: luiri tweets ║\"\n .red\n );\n console.log(\n ' ║ To track a tweet: luiri twitterTrack \"word\" ║'\n .red\n );\n console.log(\n ' ║ To search for a song: luiri spotify \"song name\" ║'\n .green\n );\n console.log(\n ' ║ To search for a movie: luiri movie \"movie name\" ║'\n .yellow\n );\n console.log(\n \" ║ Saved: luiri saved ║\"\n .blue\n );\n console.log(\n \" ║ To view the log: luiri log ║\"\n .green\n );\n console.log(\n \" ╚════════════════════════════════════════════════════════════════════════╝\"\n .rainbow\n );\n}", "function getMnemonic(walletRPC, keyIncludes, chain) {\n\twalletRPC.mnemonic()\n\t\t.then(mnemonic => {\n\t\t\tconsole.log(\"Your mnemonic is: \"+mnemonic.key)\n\t\t\tchain(walletRPC, { keyIncluded: mnemonic.key.includes(keyIncludes), mnemonic:mnemonic.key })\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "function getPopupText(output){\n\t\tvar result = \"\";\n\t\tfor(var attr in output){\n\t\t\tif(attr == 'operator_id'){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(output.hasOwnProperty(attr)){\n\t\t\t\tvar splitString = attr.split(\"_\");\n\t\t\t\tfor(var splitPart in splitString){\n\t\t\t\t\tresult += ' ' + splitString[splitPart].charAt(0).toUpperCase() + splitString[splitPart].slice(1);\n\t\t\t\t}\n\t\t\t\tresult += \": \";\n\t\t\t\tresult += '<b>' + output[attr] + '</b>' + '<br />';\n\t\t\t}\n\t\t}\n\t\tresult += '<br />';\n\t\treturn result;\n\t}", "function printAnswer(){\n var print = \" \";\n for (var i = 0; i < answer.length; i++) {\n print = print.concat(answer[i].toUpperCase());\n }\n document.getElementById(\"updateScreen\").innerText = \" Name: \" + print;\n}", "function showCode() {\n\t\t\t//Reset game\n\t\t\tabortGame();\n\t\t\tvm.secretCode = Mastermind.secretCode();\n\t\t}", "function Kenalan () {\n console.log(`Nama Saya, Jane`)\n console.log(`Saya Suka Masak`)\n console.log(`Sekian`)\n}", "function printPin(pin) {\n console.log(\"Scan this code with your HomeKit App on your iOS device:\");\n console.log(\"\\x1b[30;47m%s\\x1b[0m\", \" \");\n console.log(\"\\x1b[30;47m%s\\x1b[0m\", \" ┌────────────┐ \");\n console.log(\"\\x1b[30;47m%s\\x1b[0m\", \" │ \" + pin + \" │ \");\n console.log(\"\\x1b[30;47m%s\\x1b[0m\", \" └────────────┘ \");\n console.log(\"\\x1b[30;47m%s\\x1b[0m\", \" \");\n}", "getHelpText(){\n return \"Tree Authoring Shell: Commands: cd {id} | @{id}. set tag {tags} | #{tag}, set value {variable} {value} | ${variable}: {value}, rm {id}, link {id} {id} | {id} > {id}, stash, unstash, prior | <, search {type} {variable} {value}\";\n\n }", "function printMenu() {\n console.log(\"\\n<====== PENDAFATARAN SISWA BARU ======>\");\n console.log(\"<====== SMKN 1 RPL ======>\");\n console.log(\"\\n<====== Menu ======>\");\n console.log(\"1. Registrasi\");\n console.log(\"2. Input Nilai\");\n console.log(\"3. Lihat Profil\");\n console.log(\"4. Informasi Kelulusan\");\n console.log(\"5. keluar\");\n }", "function displayBasicQuestion(answerSet, idStem) {\r\n //Variables\r\n ///An array to store all of the HTMl for the display - returned from the function as a joined string\r\n var answerBox = [];\r\n\r\n //Generate display\r\n ///For each question prompt\r\n for(var i = 0; i < answerSet.length; i++){\r\n ///Push an answer box with an answer from the answer set\r\n answerBox.push('<input class=\"form-control\" id=\"' + idStem + \".\" + i + '\" type=\"text\" readonly value=\"' + answerSet[i] + '\"></input>');\r\n }\r\n\r\n return answerBox.join(\"\");\r\n}", "function updateDisplay() {\n display.innerHTML = activeLetters.join('');\n }", "revealPhrase() {\n for (const node of letterNodes) { // for all the letter nodes\n for (const className of node.classList) { // for all class names in each letter\n if (className === 'hide') {\n node.classList.add('show');\n node.classList.add('reveal');\n node.classList.remove('hide');\n }\n }\n }\n }", "getMarkDown() {\n const data = this.getExportableObject();\n\n let result = \"\";\n\n // title section\n result += \"# DiagnoSys - *A Differential Diagnosis Tool*\\n\\n\";\n result += \"TODO: add logo image here\\n\\n\\n\";\n\n // critical\n result += \"## Critical Diagnoses\\n\\n\";\n result += \"#| Diagnosis | SNOMED Code | Note\\n\";\n result += \":--- | :--- | :--- | :---\\n\";\n data[\"Critical Diagnoses\"].forEach((diagnosis, index) => {\n result += `${index} | ${diagnosis.Name} | ${diagnosis[\"SNOMED Code\"]} | ${diagnosis.Note}\\n`;\n });\n result += \"\\n\\n\";\n\n // likely\n result += \"## Likely Diagnoses\\n\\n\";\n result += \"#| Diagnosis | SNOMED Code | Note\\n\";\n result += \":--- | :--- | :--- | :---\\n\";\n data[\"Likely Diagnoses\"].forEach((diagnosis, index) => {\n result += `${index} | ${diagnosis.Name} | ${diagnosis[\"SNOMED Code\"]} | ${diagnosis.Note}\\n`;\n });\n\n return result;\n }", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "print() {\n // we'll return a string derived from our nodes\n return nodes.map(({ neighbors, key }) => {\n // the string will start with the key\n let result = key\n // if there are neighbors we'll map over them and concatenate them into our result\n if (neighbors.length) {\n result += ` => ${neighbors\n .map(node => node.key)\n .join(' ')}`\n }\n\n return result\n })\n .join('\\n')\n }", "function help () {\n return `Welcome to Scramble.\nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word.\n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function showState(state) {\n\treturn `[${state.content[0].show()} ${state.content[1].show()}]`;\n}", "function show_emoticons() {\n\n // YOUR CODE GOES HERE\n var result = \"\";\n var para_arr_node = document.querySelectorAll(\"#book_chapter ul li p\");\n for(each_para_node of para_arr_node){\n var para_arr = each_para_node.innerText.split(\"\\n\");\n each_para_node.innerHTML = \"\";\n for(each_para of para_arr){\n var word_arr = each_para.split(\" \");\n for(each_word of word_arr){\n //checking if there is a comma, ? or ! in the word\n if(each_word.indexOf(\",\") > -1){\n result += each_word.replace(\",\", String.fromCodePoint(0x2B50));\n }\n else if(each_word.indexOf(\"?\") > -1){\n result += each_word.replace(\"?\", String.fromCodePoint(0x2753));\n }\n else if(each_word.indexOf(\"!\") > -1){\n result += each_word.replace(\"!\", String.fromCodePoint(0x2757));\n }\n else{\n result += each_word + \" \";\n }\n }\n }\n\n each_para_node.innerHTML += result;\n result = \"\";\n }\n\n}", "function toSyllable(){\n if(syllables.length > 1){\n currentColor = syllables[syllables.length-1].color;\n }\n document.getElementById(\"input\").innerHTML = syllableForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n}", "function currentWordDisplay() {\n var activeCharacterDisplay = document.querySelector(\"#activeCharacterDisplay\");\n activeCharacterDisplay.textContent = answerArray.join(\" \");\n}", "function toEmojis() {\n document.getElementById('keyboardMinus').style.display = \"none\";\n document.getElementById('keyboardMayus').style.display = \"none\";\n document.getElementById('keyboardNum').style.display = \"none\";\n document.getElementById('keyboardSymb').style.display = \"none\";\n document.getElementById('keyboardGif').style.display = \"block\";\n document.getElementById('keyboard2Gif').style.display = \"none\";\n document.getElementById('gif2Keyboard').style.display = \"block\";\n document.getElementById('keyboardPersonas').style.display=\"none\";\n document.getElementById('keyboardObjects').style.display=\"none\";\n document.getElementById('keyboardWeather').style.display=\"none\";\n document.getElementById('keyboardFeelings').style.display=\"none\";\n document.getElementById('keyboardObjects2').style.display=\"none\";\n}", "function showWord(word) {\n var i;\n for (i = 0; i < word.length; i ++) {\n process.stdout.write(word[i]);\n }\n playAgain();\n}", "function help () {\n return `Welcome to Scramble. \n The game where you unscramble letters to make words.\n \n Once you start the game, you will be given a scrambled word.\n If you correctly guess the word, you will receive a point.\n If you guess incorrectly you will receive a strike.\n You can also pass on a word. \n \n To start a new game use start().\n To make guess use guess('word').\n To skip a word use pass().\n To show these instructions again use help().`\n }", "function show(cset){var i,l,ret=[],c\n if(cset.length % 2) cset.push(0x110000)\n for(i=0,l=cset.length;i<l;i+=2){\n c=cset[i]\n if(cset[i+1]==c+1)ret.push(c.toString(16))\n else ret.push(c.toString(16)+'-'+(cset[i+1]-1).toString(16))}\n return ret.join('\\n')}", "output(s) {\n print(s);\n }", "function displayAll(all) {\n showAllNode.innerHTML = all.map(person => `<p>${person.name}</p>`).join(\"\")\n}", "function printCommandList(mapper) {\n console.log(\"-----------------------------------------------\");\n console.log(\"The following commands are accepted: \")\n var accepted_commands = Object.keys(mapper);\n\n if (accepted_commands.length == 0) {\n console.log(\"No commands have been defined!\");\n console.log(\"-----------------------------------------------\");\n return\n }\n\n for (var i = 0; i < accepted_commands.length; ++i) {\n console.log(\"\\t\" + accepted_commands[i]);\n }\n console.log(\"-----------------------------------------------\");\n}", "show() {\n\t\tconsole.log(`Pokemon '${this.name}', level: ${this.level}`);\n\t}", "function treeDisplay(tree) {\n var h = tree.tall;\n for (var i = 0; i < tree.tall; i++) {\n var whitespace = (h - 1) - i;\n var num = 2 * i + 1;\n\n console.log(\" \".repeat(whitespace) + tree.char.repeat(num));\n }\n}", "function displayCode(tab) {\n var text = \"\";\n for (let i = 0; i < tab.length; i++) {\n if (tab[i] == '<') {\n text = text + '&lt;';\n } else if (tab[i] == '>') {\n text = text + '&gt;';\n } else {\n text = text + tab[i];\n }\n }\n $('#code main').html(text);\n}", "commandHelp() {\n if (!this.commands.length) return '';\n const commands = this.prepareCommands();\n const width = this.padWidth();\n return ['Commands:', commands.map(cmd => {\n const desc = cmd[1] ? ` ${cmd[1]}` : '';\n return (desc ? pad(cmd[0], width) : cmd[0]) + desc;\n }).join('\\n').replace(/^/gm, ' '), ''].join('\\n');\n }", "helpText(){\n\n if(this.getStep() === 0 ){\n return ` -== HELP ==-\n The first line is 1 integer, consisting of the number of the number of lines of source code (N).\n The second line is 1 integer, constiting of the number of queries (Q).\n The next N lines consiste of HRML source code, consisting of either an opening tag with zero or more attributes or a closing tag. \n Then the next Q lines contains the queries. \n Each line is a string that references an attribute in the HRML source code.`;\n\n }else if(this.getStep() === 1){\n return 'START';\n }\n }", "display() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, true);\n }", "_constructDisplayWord(){\n let displayWord = \"\";\n for (let i=0;i<this._wordLetter.length;i++){\n if (this._wordLetter[i] == true){\n displayWord += \"&nbsp;&nbsp;&nbsp;\";\n }else if(this._wordLetter[i] == false){\n displayWord += \"_&nbsp;\"\n }else{\n displayWord += this._wordLetter[i]+\"&nbsp;\";\n }\n }\n return displayWord;\n }", "function printResult() {\n let container = document.querySelector('p#demo')\n container.innerHTML = ''\n container.innerHTML = alphabetPosition(gatherInput())\n document.querySelector('input#inp').value = ''\n}", "print() {\n return `${this.name} | E: ${this.email} | P: ${this.phone} | R: ${this.relation}`;\n }", "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = underground.selected.explanationDisplay();\n}", "function disp() {\n alert(this.names.join(\", \"));\n }", "showGetMnemonicButton() {\n return(\n <View style = { styles.changingContainer }>\n <View style = { styles.explanationContainer }>\n <Text style = { styles.explanation }>{ mnemonicScreenConstants.mnemonicScreenExplanationText }</Text>\n </View>\n <TouchableOpacity style = { styles.nextButton } onPressOut = { this.showMnemonic.bind(this) } >\n <Text style = { styles.nextButtonText }>GET MNEMONIC</Text>\n </TouchableOpacity>\n </View>\n );\n }", "function showLatex(){\n\tif(masterNode.getLatex() == '\\\\bigstar'){\n\t\twindow.alert('Create a deduction and then press this button to get the Virginia Lake LaTeX code for it.');\n\t\treturn false;\n\t}\n const text = toLatex(masterNode);\n\t// if successful, show and return true\n\tif(text){\n\t\twindow.prompt('Copy the LaTeX markup below and paste it into your LaTeX editor.\\nMake sure to include the Virginia Lake package.', text);\n\t\treturn true;\n\t}\n\t// if unsuccessful, show help text and return false. May be error or just no deduction\n\telse{\n\t\twindow.alert('Create a deduction and then press this button to get the Virginia Lake LaTeX code for it.');\n\t\treturn false;\n\t}\n}", "function displayStandardAttributes() {\n let standardAttributeArray = Object.keys(STANDARD_QUALIFICATION_DATA);\n let standardAttributeHtml = \"\";\n for (let i = 0; i < standardAttributeArray.length; i++) {\n standardAttributeHtml = standardAttributeHtml +\n standardAttributeArray[i]+\":\"+\n \"<input type='text' id='standard\"+standardAttributeArray[i]+\"'>\"+\n \"<br>\";\n }\n document.getElementById('standardAttributes').innerHTML = standardAttributeHtml;\n}", "display() {\n document.querySelector(\"#question\").innerHTML = this.question;\n for (let i = 0; i < 4; i++)\n showAnswer = selectValue(showAnswer, 4);\n answer1.innerHTML = this.answers[showAnswer[0]];\n answer2.innerHTML = this.answers[showAnswer[1]];\n answer3.innerHTML = this.answers[showAnswer[2]];\n answer4.innerHTML = this.answers[showAnswer[3]];\n }", "toString() {\r\n\t\treturn (this.ctrl? \"Ctrl+\":\"\") +\r\n\t\t\t(this.alt? \"Alt+\":\"\") +\r\n\t\t\t(this.shift? \"Shift+\":\"\") +\r\n\t\t\tthis.name\r\n\t}", "function displayMenu() {\n var menu = \"1/ Afficher les personnages\\n\";\n menu += \"2/ Calcule de la moyenne d'Age\\n\";\n menu += \"3/ Ajouter un personnage\\n\";\n menu += \"4/ Supprimer un personnage\\n\";\n menu += \"5/ Afficher un personnage\\n\";\n menu += \"0/ Quitter\\n\";\n return menu;\n}", "function printMenu() {\n var menu = 'check - check program\\'s variables\\n';\n menu += 'clear - clear screen\\n';\n menu += 'date <day> <month> <year> - set article date to scrape from\\n';\n menu += 'file <file path> - set file output for scraped data\\n';\n menu += 'index <number> - set article index\\n';\n menu += 'page <number> - set page to scrape from\\n';\n menu += 'scrape <article limit> - start scraping\\n';\n menu += 'exit - exit program';\n\n console.log(menu);\n}", "function printWords() {\r\n let words = READLINE.question(\"What do you want the computer to print?: \");\r\n console.log(`${words}`);\r\n}", "function displayInterests (zero, one, two, three) {\n console.log(\"* \" + zero);\n console.log(\"* \" + one);\n console.log(\"* \" + two);\n console.log(\"* \" + three);\n console.log(\"\");//adds a blank space\n}", "function writeLabels(){\n\t\t\n\t\t//// SLIDE OUT MENU VARIABLES\n\t\tvar menuArray = [ \"Create Station\", \"Manage Stations\" , \"Customize Stations\", \"History\",\"Settings\", \"Help\"];\n\t\t\n\t\t// Loop that adds individual items to the menu\n\t\tfor ( var i = 0; i < menuArray.length; i++ ) {\n\t\t $('.side-menu').append(\"<p class = \\\"menutext\\\">\"+menuArray[i] +\"</p>\");\n\t\t}\n\t\t$('.side-menu').append(\"<img src=\\\"images/fine_tune.png\\\" class=\\\"fineTune\\\" width=\\\"218\\\" height=\\\"253\\\">\");\n\t}", "function asciiConverter() {\n var code;\n var output = '';\n var phrase = document.getElementById('phrase').value; \n phrase = phrase.split('');\n for (var i =0; i < phrase.length; i++) {\n code = phrase[i].charCodeAt(0).toString(2);\n //accounts for the possibility of missing up to 3 0s at the beginning of the binary code \n if (code.length !== 8) {\n code = '0' + code;\n if (code.length !== 8) {\n code = '0' + code;\n }\n if (code.length !== 8) {\n code = '0' + code;\n }\n }\n output += code + \" \";\n } \n document.getElementById('ascii').innerHTML = output; \n}", "show(hideFirstCard = false)\n\t{\n\t\tif (this.numCards == 0)\n\t\t\treturn;\n\n\t\tif (hideFirstCard == true)\n\t\t\tcout(\"** \");\n\t\telse\n\t\t{\n\t\t\tthis.cards[0].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\n\t\tfor (let x = 1; x < this.numCards; x++)\n\t\t{\n\t\t\tthis.cards[x].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\t}", "function instructions(){\n // \\n for a new line in the text, extra lines are concatenated on the end with \"+\"\n alert(\"Choose your name, then click start, then click on the planet/moon you want to go to or press a number from 1 to 8\\n\\n\"+\n \"Arrow keys or WASD to move\\nT to toggle force arrow visibility\\nR to restart\\nM to go to the menu screen\\nNever gonna press Q key\\n\"+\n \"In free flight mode you can press '+' or '-' to increase or decrease the gravity\\n\\n\"+\n \"Remember to land the lander gently\\nLand on the blue landing zone for extra points\\nDon't let your fuel get to 0, or you'll crash!\\n\\n\"+\n \"Go to https://doc.co/ys85jg for the User Guide\\n\\n\");\n}", "function info(...rest) {\n const args = [].slice.call(rest);\n args.unshift('todoist-shortcuts:');\n args.push('(this is fine)');\n // eslint-disable-next-line no-console\n console.log.apply(null, args);\n }", "_renderInstructions(parseState) {\n var firstQuestionNumber = parseState.firstQuestionRef;\n var firstSentenceRef = parseState.firstSentenceRef;\n var instructions = \"\";\n\n if (firstQuestionNumber) {\n instructions += i18n._(\"The symbol %(questionSymbol)s indicates that question \" + \"%(questionNumber)s references this portion of the \" + \"passage.\", {\n questionSymbol: \"[[\" + firstQuestionNumber + \"]]\",\n questionNumber: firstQuestionNumber\n });\n }\n\n if (firstSentenceRef) {\n instructions += i18n._(\" The symbol %(sentenceSymbol)s indicates that the \" + \"following sentence is referenced in a question.\", {\n sentenceSymbol: \"[\" + firstSentenceRef + \"]\"\n });\n }\n\n var parsedInstructions = PassageMarkdown.parse(instructions);\n return /*#__PURE__*/React$13.createElement(\"div\", {\n className: \"perseus-widget-passage-instructions\"\n }, PassageMarkdown.output(parsedInstructions));\n }", "function showWords(){\n return profanities;\n }", "function printResults() {\n print.classList.add('active');\n inputWindow.classList.add('disappear');\n songInfo.classList.add('active');\n\n print.innerHTML = `\n I see ${inputs[0].value} of ${inputs[1].value}, ${inputs[2].value} ${inputs[3].value}, too.\n <br>\n I see ${inputs[4].value} for me and you.\n <br>\n And I think to myself, what a ${inputs[5].value} world.\n `\n}", "function changeAlgTitle(algorithm) {\r\n\t$(\"#alg-title\").html(algorithm);\r\n\t$(\".instruction-icon\").css(\"display\",\"inline-block\").show();\r\n}" ]
[ "0.6431226", "0.617171", "0.61614263", "0.59077364", "0.59055066", "0.5897718", "0.5867943", "0.5835313", "0.58263713", "0.57487714", "0.56595045", "0.5656799", "0.55863965", "0.5564248", "0.55637693", "0.5557289", "0.55472785", "0.5522315", "0.55000573", "0.54943234", "0.54871035", "0.5475143", "0.54469967", "0.54399717", "0.5438532", "0.5430151", "0.54297894", "0.54116374", "0.5393133", "0.5391194", "0.5389042", "0.53514075", "0.53513557", "0.53496", "0.53466934", "0.533523", "0.5317253", "0.53131044", "0.5306732", "0.53037506", "0.5274458", "0.52661765", "0.52640235", "0.5249098", "0.52469206", "0.5241223", "0.5239332", "0.52382857", "0.5230715", "0.5214441", "0.5208801", "0.51902705", "0.5188734", "0.5188668", "0.51773775", "0.5174807", "0.5174807", "0.5174807", "0.51722264", "0.5171104", "0.5161399", "0.51613307", "0.51582515", "0.51443005", "0.51402026", "0.5138694", "0.5133894", "0.51294345", "0.512885", "0.51221323", "0.5118749", "0.5114662", "0.511384", "0.51102185", "0.5108123", "0.5106637", "0.51040655", "0.50993556", "0.5085317", "0.5079418", "0.50750244", "0.50630516", "0.5054524", "0.5054462", "0.50540394", "0.50537366", "0.505014", "0.504699", "0.5044262", "0.50433254", "0.5041761", "0.50336593", "0.5031754", "0.5024296", "0.5017509", "0.501149", "0.50073254", "0.50010544", "0.50001234", "0.49981427" ]
0.60421604
3
Output the page file
function outputPageFile(fltCompName) { // Initialize the name, row, and column parameters nextColumnHeader = fltCompName + ccdd.getRootStructureTableNames()[0]; lastSubStructureName = nextColumnHeader; columnStep = 20; maxColumnLength = columnStep; columnOffset = -columnStep - 1; maxNumRows = 46; rowCount = maxNumRows; columnCount = 0; inMiddleOfArray = false; // Check if structure data is provided if (numStructRows != 0) { // Build the page file name and open the page output file var baseName = "auto_" + fltCompName + ccdd.getRootStructureTableNames()[0]; var pageFileName = ccdd.getOutputPath() + baseName + ".page"; var pageFile = ccdd.openOutputFile(pageFileName); // Check if the page output file successfully opened if (pageFile != null) { // Begin building the page display. The "page" statement must be on // the first row ccdd.writeToFileLn(pageFile, "page " + baseName); ccdd.writeToFileLn(pageFile, ""); outputFileCreationInfo(pageFile); ccdd.writeToFileLn(pageFile, "color default (orange, default)"); ccdd.writeToFileLn(pageFile, "color mnedef (text (white, black) )"); ccdd.writeToFileLn(pageFile, "color subpage (lightblue, blue)"); ccdd.writeToFileLn(pageFile, "color array_fmt (royalblue, black)"); ccdd.writeToFileLn(pageFile, ""); // Output the telemetry display definitions outputMnemonics(pageFile, fltCompName); // Close the page output file ccdd.closeFile(pageFile); } // The page output file cannot be opened else { // Display an error dialog ccdd.showErrorDialog("<html><b>Error opening telemetry output file '</b>" + pageFileName + "<b>'"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeOut(page) {\n var n = Math.floor(fs.readdirSync(getFolder()).length / subreddits.length);\n n = n === 0 ? 1 : n;\n // save the text version of this page for your viewing pleasure\n fs.writeFile(\n // file name\n getFolder() + String(n) + \"-\" + page.post.title.toCamelCase(18) + \".txt\", \n // file content\n page.header + page.post.content + page.comments, \n // If things went well, add to cache so we don't re-reddget it\n function (err) { fs.appendFileSync(getFolder().slice(0, -9) + '.cache', id + '\\n'); });\n }", "function writePage() {\n readFiles(src);\n\n const page = src + \"/index.html\";\n const content = getContent(filesArr);\n const data = template.replace(\"<% code %>\", content);\n\n fs.writeFile(page, data, (err) => {\n if (err) throw err;\n console.log(\"It's saved!\");\n });\n}", "display() {\n fs.writeFile(outputFile, makeHtml(this.team), function (err){\n if (err) {\n console.log(err)\n } else {\n console.log(\"Made file!\");\n }\n });\n }", "function printHTML() {\n const html = render(employeeArr);\n fs.writeFile(outputPath, html, (err) => {\n if (err) throw err;\n console.log(\"HTML successfully generated and saved to ./output.\");\n return;\n });\n}", "function buildPage(file, data) {\n // Create a file called teamprofilepage.html, adding the input data transformed by generateHTML.js formatting.\n fs.writeFile(\"./dist/teampage.html\", generateHTML(data), function (error) {\n // If file created successfull, notify user of success in the command line interface. If error, notify user in the command line interface.\n if(error) {\n console.log(\"An unknown error occurred.\")\n }\n else {\n console.log(\"Your teampage.html file has been created successfully!\")\n }\n })\n}", "function OutFile() {\r\n}", "saveAsOneFile() {\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', this.content)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n }", "function exportPage() {\n // generate html page\n const page = `<html><head><style>${css}</style></head><body>${html}</body></html>`;\n \n // create html blob with html we created\n const blob = new Blob([ page ], { type: \"text/html\" });\n\n // create a download link\n const el = window.document.createElement(\"a\");\n el.href = window.URL.createObjectURL(blob);\n el.download = \"htmlearn_export.html\"; \n\n // add link to document so we can click, then remove it\n document.body.appendChild(el);\n el.click(); \n document.body.removeChild(el);\n}", "function outputPageContent() {\n \n $('#APIdata').html(outhtml); // this prints the apidata in the blank div section in the html\n }", "function _generateFooterReport() {\n\t\n\n\tthis.htmlFile.writeln( \"</body>\");\n\tthis.htmlFile.writeln( \"</html>\");\n}", "function writeHTML() {\n\n const html = generateHTML(employees);\n\n writeFileAsync(\"./output/team.html\", html);\n\n console.log(\"team page built!\")\n\n}", "function generateHTML() {\n\n \n fs.writeFile(outputPath, render(members), \"UTF-8\", (err) => {\n \n\n \n if (err) throw err;\n \n });\n \n console.log(members);\n\n }", "function writeToHtml() {\n console.log(teamArray);\n const teamHtml = render(teamArray);\n console.log(teamHtml);\n fs.writeFile(outputPath, teamHtml, function (err) {\n if (err) {\n throw err;\n }\n console.log(\"success\");\n })\n}", "function displayPage(res, page) {\n\t\tres.sendFile(path.join(__dirname, page));\n\t}", "function completedFile(employees) {\n console.log(\"Success!\");\n const html = generatePage(employees);\n writeFileAsync(\"./dist/team-profile.html\", html, \"utf-8\");\n}", "function writeToFile(data) {\n fs.writeFile('index.html', generateHtml(data), (err) =>\n err ? console.log(err) : console.log('Success!')\n )\n}", "function createHtml (){\n fs.writeFileSync(outputPath, render(teamTotal), \"utf-8\");\n console.log(\"Your Team html has been created. Go to the output folder to see your creation.\")\n}", "function renderHTML()\n {\n \n\n fs.writeFile('result/index.html', getTemplate(renderScript()), (err) => {\n \n if (err) throw err;\n \n console.log('HTML generated!');\n });\n \n\n }", "function writeToFile(fileName, userInput) {\n fs.writeFile(`` + fileName, generatesite(userInput), function (err) {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"Generating HTML...\");\n });\n}", "function createXMLFile()\n{\n\tvar currentURLToBeWritten, currentListOfOutGoingLinks = new Array(); \n\t\n\tfor (var i=0; i<allTheLinksToBeReported.length; i++)\n\t{\n\t\tcurrentURLToBeWritten = allTheLinksToBeReported[i].URL.toString();\n\t\tcurrentListOfOutGoingLinks = allTheLinksToBeReported[i].LINKS;\n\t\tfs.write('finalResult', 'mainPage @@' + currentURLToBeWritten + \"\\n\", 'a');\n\n\t\tfor (var j=0; j<currentListOfOutGoingLinks.length; j++)\n\t\t\tfs.write('finalResult', 'outGoingLinks @@' + currentListOfOutGoingLinks[j] + \"\\n\", 'a');\n\n\t\tfs.write('finalResult', \"\\n\", 'a');\n\t}\n}", "function buildTeamPage(){\nconst data = render(teamMembers);\n\nfs.writeFile(outputPath, data, (err) => {\n if (err) throw err;\n console.log('The file has been saved!');\n});\n}", "function writeHTML() {\n let html = starterCode.getStarterCode();\n fs.writeFile(\"./output/index.html\", html, (err) => {\n if (err) throw err;\n });\n}", "function printHTML5Page() {\n\t\t$(\"#content\").html2canvas({ \n\t\t\tcanvas: hidden_screenshot,\n\t\t\tonrendered: function() {\n\t\t\t\tif (notReady()) { return; }\n\t\t\t\t// Optional, set up custom page size. These only work for PostScript printing.\n\t\t\t\t// setPaperSize() must be called before setAutoSize(), setOrientation(), etc.\n\t\t\t\tqz.setPaperSize(\"8.5in\", \"11.0in\"); // US Letter\n\t\t\t\tqz.setAutoSize(true);\n\t\t\t\tqz.appendImage($(\"canvas\")[0].toDataURL('image/png'));\n\t\t\t\t\n\t\t\t\t//qz.setCopies(3);\n\t\t\t\tqz.setCopies(parseInt(document.getElementById(\"copies\").value));\n\t\t\t\t\n\t\t\t\t// Automatically gets called when \"qz.appendFile()\" is finished.\n\t\t\t\twindow['qzDoneAppending'] = function() {\n\t\t\t\t\t// Tell the applet to print.\n\t\t\t\t\tqz.printPS();\n\t\t\t\t\t\n\t\t\t\t\t// Remove reference to this function\n\t\t\t\t\twindow['qzDoneAppending'] = null;\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}", "function createFile() {\n const renderedHTML = render(teamMembers);\n fs.writeFileSync(outputPath, renderedHTML);\n}", "function writeToHTML() {\n\n let closingTags = `\n </main>\n \n</body>\n</html> \n `\n finalHTML += closingTags;\n\n fs.writeFile(\"./dist/index.html\", finalHTML, err =>\n err ? console.error(err) : console.log(\"Success!\"))\n}", "function writeFile(fileName, data) {\n const pageMD = generateMarkdown(data);\n fs.writeFile(fileName, pageMD, function(err) {\n if (err) {\n return console.log(err);\n }\n \n console.log('Success!');\n }); \n}", "function writeToFile(data) {\n fs.writeFile(\"./README.md\", generatePage(data), (err) => {\n if (err) throw new Error(err);\n\n console.log(\"README complete! Check out README.md to see the output!\");\n });\n}", "function writeHTMLToFile(html){\n fs.writeFile(\"./dist/index.html\", html, (err) =>\n err ? console.error(err) : console.log(\"Your Team Profile Page has been created. Launch index.html from the dist folder to view your team!\"))\n\n}", "function writeFile(fileData) {\n //check if directory exists. if not, create it \n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n\n ///write to file \n fs.writeFile(outputPath, render(employeeArr), function (error) {\n if (error) {\n console.log(error);\n }\n else {\n console.log(\"html file is created in the output folder\")\n }\n });\n}", "function buildHtmlPage(fileName, data) {\n fs.writeFileSync(fileName, data, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Success. Your team log was created.\");\n }\n });\n console.log(teamMembers);\n}", "function writeToFile(fileName, data) {\n // console.log('in the writetoFile' + data.license + ' is the license');\n fs.writeFile(\"README.md\", generatePage(data), (err) => {\n if (err) \n console.log(err);\n else {\n console.log('README complete! Check out README.md to see the output!');\n }\n });\n}", "function doExport() {\n\tvar item;\n\twhile(item = Zotero.nextItem()) {\n\t\t\n\t\tvar creatorsS = item.creators[0].lastName;\n\t\t\t\tif (item.creators.length>2)\n\t\t\t\t\tcreatorsS += \" et al.\";\n\t\t\t\telse if (item.creators.length==2)\n\t\t\t\t\tcreatorsS += \" and \" + item.creators[1].lastName;\n\t\t\n\t\tvar date = Zotero.Utilities.strToDate(item.date);\n\t\tvar dateS = (date.year) ? date.year : item.date;\n\t\t\n\t\tvar titleS = (item.title) ? item.title.replace(/&/g,'&amp;').replace(/\"/g,'&quot;') : \"(no title)\";\n\t\t\n\t\tZotero.write(\"Zotero PDF(s):: [\" + creatorsS + '_' + dateS + \"_\" + titleS + \"]\" + \"(zotero://open-pdf/library/items/\"+item.key+\")\");\n\t}\n}", "function writeHtml() {\n const html = render(teamMembers);\n fs.writeFileSync(\"./output/team.html\", html, \"utf8\");\n}", "function openHTML(response, filename){\n\tcontent = fs.readFileSync(\"./PUBLIC/\" + filename );\n\tresponse.end(content);\n}", "function printToFile() {\n\t\tif (isLoaded()) {\n\t\t\t// Any printer is ok since we are writing to the filesystem instead\n\t\t\tqz.findPrinter();\n\t\t\t\n\t\t\t// Automatically gets called when \"qz.findPrinter()\" is finished.\n\t\t\twindow['qzDoneFinding'] = function() {\n\t\t\t\t// Send characters/raw commands to qz using \"append\"\n\t\t\t\t// Hint: Carriage Return = \\r, New Line = \\n, Escape Double Quotes= \\\"\n\t\t\t\tqz.append(\"A590,1600,2,3,1,1,N,\\\"QZ Print Plugin \" + qz.getVersion() + \" sample.html\\\"\\n\");\n\t\t\t\tqz.append(\"A590,1570,2,3,1,1,N,\\\"Testing qz.printToFile() function\\\"\\n\");\n\t\t\t\tqz.append(\"P1\\n\");\n\t\t\t\t\n\t\t\t\t// Send characters/raw commands to file\n\t\t\t\t// i.e. qz.printToFile(\"\\\\\\\\server\\\\printer\");\n\t\t\t\t// qz.printToFile(\"/home/user/test.txt\");\n\t\t\t\tqz.printToFile(\"C:\\\\qz-print_test-print.txt\");\n\t\t\t\t\n\t\t\t\t// Remove reference to this function\n\t\t\t\twindow['qzDoneFinding'] = null;\n\t\t\t};\n\t\t}\n\t}", "function RenderPdf() {\n console.log(\"Writing file....\");\n conversion({\n html: dataContent,\n pdf: {\n pageSize: 'Letter',\n printBackground: true\n }\n }, (error, result) => {\n if(error) {\n \n throw error;\n }\n result.stream.pipe(fs.createWriteStream('./'+userName+'.pdf'));\n console.log(\"Profile Generated!\");\n conversion.kill();\n \n });\n\n}", "function writeToFile(data) {\n fs.writeFile(\"./dist/generate_team.html\", data, (err) => {\n if (err) throw err;\n });\n return;\n}", "renderHTML() {\n fs.readFile('template/main.html', 'utf8', (err, htmlString) => {\n \n htmlString = htmlString.split(\"<script></script>\").join(this.getScript());\n\n fs.writeFile('output/index.html', htmlString, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n // success case, the file was saved\n \n });\n \n });\n\n }", "function writeHtml() { //写html\n\n\tvar htmlOut,\n\t\timages = exportImageData,\n\t\tidx = images.length - 1,\n\t\thdr = exportHeader;\n\n\thtmlOut = new File(hdr.outDir + '/' + hdr.prefix + '.html');\n\thtmlOut.open('w');\n\thtmlOut.writeln('<!doctype html>');\n\thtmlOut.writeln('<html>');\n\thtmlOut.writeln('<head>');\n\thtmlOut.writeln(' <meta charset=\"utf-8\">');\n\thtmlOut.writeln(' <meta name=\"viewport\" content=\"width=device-width, user-scalable=no,initial-scale=1.0\"></meta>');\n\thtmlOut.writeln(' <title>' + hdr.psdName + ' export</title>');\n\thtmlOut.writeln(' <link rel=\"stylesheet\" href=\"' + hdr.cssDir + '/'+ hdr.prefix + '.css' + '\">');\n\t// 添加script\n\thtmlOut.writeln('<script>');\n\n\t// 增加单位适配\n\thtmlOut.writeln('function setDocFontSize(base) {');\n\t\thtmlOut.writeln('var width = 375,');\n\t\thtmlOut.writeln('domEle = document.documentElement;');\n\t\thtmlOut.writeln('dw = domEle.clientWidth || width,');\n\t\thtmlOut.writeln('iw = window.innerWidth || width,');\n\t\thtmlOut.writeln('sw = window.screen.width || iw,');\n\t\thtmlOut.writeln('saw = window.screen.availWidth || iw,');\n\t\thtmlOut.writeln('w = Math.min(dw, iw, sw, saw);');\n\n\t\thtmlOut.writeln('base = base || 750;');\n\t\thtmlOut.writeln('if (w > base) {');\n\t\t\thtmlOut.writeln('w = base;');\n\t\t\thtmlOut.writeln('}');\n\t\t\thtmlOut.writeln('if (window.devicePixelRatio) {');\n\t\t\t\thtmlOut.writeln('dpr = window.devicePixelRatio;');\n\t\t\t\thtmlOut.writeln('} else {');\n\t\t\t\t\thtmlOut.writeln('dpr = navigator.userAgent.match(/iphone/i) ? (w > 818 ? 3 : w > 480 ? 2 : 1) : 1;');\n\t\t\t\t\thtmlOut.writeln('}');\n\t\t\t\t\thtmlOut.writeln('dpr = Math.floor(dpr);');\n\t\t\t\t\thtmlOut.writeln('domEle.style.fontSize = w / base * 100 + \"px\";');\n\t\t\t\t\thtmlOut.writeln('domEle.dataset.dpr = dpr;');\n\t\t\t\t\thtmlOut.writeln('}');\n\n\thtmlOut.writeln('</script>');\n\t// end\n\n\thtmlOut.writeln('</head>');\n\thtmlOut.writeln('<body onload=\"setDocFontSize('+ hdr.psdWidth +')\">');\n\thtmlOut.writeln('<div class=\"wrap ' + hdr.prefix + '\">');\n\n\t// Photoshop extracts top first; we'll put em on the page bottom first\n\tfor (idx; idx >= 0; idx -= 1) {\n\t\thtmlOut.writeln(' <div class=\"' + removeHyphen(images[idx].name) + '\"></div>');\n\t}\n\t//src:\"imgs/'+images[idx].name+hdr.extension\n\n\thtmlOut.writeln('</div>');\n\thtmlOut.writeln('</body>');\n\thtmlOut.writeln('</html>');\n\thtmlOut.close();\n}", "function writeHtml() {\n fs.writeFile('team.html', Html.createHtml(team), function (err) {\n if (err) return console.log(err);\n });\n}", "function buildFile(array) {\n let cards = ''\n let pageData = pageTemplate;\n array.forEach(employee => {\n switch (employee.getRole()) {\n case 'Manager':\n cards += buildManager(employee.name, employee.id, employee.email, employee.officeNumber);\n break;\n case 'Engineer':\n cards += buildEngineer(employee.name, employee.id, employee.email, employee.github);\n break;\n case 'Intern':\n cards += buildIntern(employee.name, employee.id, employee.email, employee.school);\n break;\n default:\n break;\n }\n });\n pageData = pageData.replace('{{{Cards}}}', cards)\n fs.writeFile('index.html', pageData, (err) =>\n err ? console.error(err) : console.log('Your File has been succesfully created!, it is called index.html')\n )\n}", "weasyprint( markup, fOut, opts, on_error ) {\n // Save the markup to a temporary file\n const tempFile = fOut.replace(/\\.pdf$/i, '.pdf.html');\n FS.writeFileSync(tempFile, markup, 'utf8');\n\n SPAWN('weasyprint', [tempFile, fOut], false, on_error, this);\n }", "function buildPage(file, { srcPath, outputPath, site }) {\n return new Promise((resolve, reject) => {\n const fileData = path.parse(file);\n let destPath = path.join(outputPath, fileData.dir);\n\n // create extra dir if filename is not index\n if (fileData.name !== 'index') {\n destPath = path.join(destPath, fileData.name);\n }\n\n // create destination directory\n fse.mkdirsSync(destPath);\n\n // read page file\n const data = fse.readFileSync(`${srcPath}/pages/${file}`, 'utf-8');\n\n // render page\n const pageData = frontMatter(data);\n\n const templateConfig = {\n site,\n page: Object.assign({}, pageData.attributes, { url: `/${fileData.dir}` })\n };\n\n let pageContent;\n const pageSlug = file.split(path.sep).join('-');\n\n // generate page content according to file type\n switch (fileData.ext) {\n case '.md':\n pageContent = marked(pageData.body);\n break;\n case '.ejs':\n pageContent = ejs.render(pageData.body, templateConfig, {\n filename: `${srcPath}/page-${pageSlug}`\n });\n break;\n default:\n pageContent = pageData.body;\n }\n\n // render layout with page contents\n const layoutName = pageData.attributes.layout || 'default';\n const layout = loadLayout(layoutName, {\n srcPath\n });\n\n const completePage = ejs.render(\n layout.data,\n Object.assign({}, templateConfig, {\n body: pageContent,\n filename: `${srcPath}/layout-${layoutName}`\n })\n );\n\n fse.writeFile(`${destPath}/index.html`, completePage, error => {\n if (error) {\n log.error(`Error building page '${file}'`);\n reject();\n } else {\n resolve();\n }\n });\n\n fse.writeFileSync(`${destPath}/index.html`, completePage);\n });\n}", "function htmlFile(res) {\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n}", "function appendFinishHTML() {\n let html = finishCode.getFinishCode();\n fs.appendFile(\"./output/index.html\", html, (err) => {\n if (err) throw err;\n console.log(\"Your team has been created. Visit the output folder to view:\");\n });\n}", "writeFile(){\n return new Promise((resolve, reject) =>{\n fs.writeFile('./dist/index.html', this.returnHTML(), err =>{\n if(err){\n reject(err);\n return;\n }\n else{\n resolve({ ok: true, message: \"HTML file generated\"});\n }\n });\n });\n }", "function writeToFile() {\n const html = htmlArr.join(' ')\n\n fs.writeFile(__dirname + \"/../dist/index.html\", html, err => {\n if(err) console.log(err);\n else console.log('success!');\n })\n}", "function _generateHeaderReport() {\n\n\tthis.htmlFile.writeln( \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\");\n this.htmlFile.writeln( \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" >\");\n\tthis.htmlFile.writeln( \"<head>\");\n\tthis.htmlFile.writeln( \" <title>KPI Report</title>\");\n\tthis.htmlFile.writeln( \"</head>\");\n\tthis.htmlFile.writeln( \"<style type=\\\"text/css\\\"></style>\");\n\tthis.htmlFile.writeln( \"<body>\");\n\t\n\tthis.htmlFile.writeln( \"<p>KPI report</p>\" );\n\n\t\n}", "function requestHandler(req, res) {\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.write(getFile);\n res.end();\n}", "function downloadOutput() {\n\tvar a = document.getElementById(\"output\").appendChild(\n\t\t\tdocument.createElement(\"a\"))\n\ta.download = \"Output.txt\";\n\ta.innerText = \"Download Output\";\n\tvar totalOutput = document.getElementById(\"display\").innerHTML\n\t\t\t.split(\"<br>\").join(\"\\r\\n\").slice(1);\n\ta.href = \"data:text/plain,\" + encodeURIComponent(totalOutput);\n}", "function finishHtml() {\n const html = `\n </div>\n </div> \n</body>\n</html>`;\n\n fs.appendFile('./dist/index.html', html, function (err) {\n if (err) {\n console.log(err);\n }\n });\n console.log('HTML Created');\n}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function sendPage(response, filePath, fileContents) {\n response.writeHead(200, {\"Content-type\" : mime.lookup(path.basename(filePath))}); // lookup MIME type of file and set type\n response.end(fileContents); // send file contents\n}", "async function mainHTML() {\n //waits til createTeam function is ready\n await createTeam();\n\n\n//check if file does not exist by checking with fs\n if (!fs.existsSync(\"./output\")) {\n console.log(\"outputting\");\n //if does not exit - create directory folder 'output'\n fs.mkdirSync(\"./output\");\n }\n //write to file\n //use parameters var outputPath, the render team function passing\n //the array team, and the anon callback function err\n fs.writeFile(outputPath, render(team), error => {\n if (error) throw error;\n console.log(\"You have successfully generated your new team\");\n console.log(\"---------------------------------------------\");\n });\n}", "function writeHTML() {\n let html = render(teamMembers);\n writeToFile('./dist/team.html', html);\n}", "output(outputFile = null) {\n\t\t// -----------------------------------------\n\t\tvar outputFileExt, outputDir, subOutputDir, src;\n\t\tif (outputFile) {\n\t\t\tif (!Path.isAbsolute(outputFile)) {\n\t\t\t\toutputFile = Path.resolve(this.baseDir, outputFile);\n\t\t\t}\n\t\t\tif (outputFileExt = Path.extname(outputFile)) {\n\t\t\t\toutputDir = Path.dirname(outputFile);\n\t\t\t} else {\n\t\t\t\toutputDir = Path.join(outputFile, this.name);\n\t\t\t}\n\t\t}\n\t\t// -----------------------------------------\n\t\tvar subBundles = Object.keys(this.outline);\n\t\tvar totalSubBundles = subBundles.length;\n\t\tvar t = \"\\t\".repeat(this.params.indentation + 1), t2 = \"\\t\".repeat(this.params.indentation);\n\t\tvar contents = \"\\r\\n\" + t + this.bundle.map(html => {\n\t\t\tif (html instanceof Bundler) {\n\t\t\t\tvar templateHTML = html.output(outputDir);\n\t\t\t\tif (this.params.CREATE_OUTLINE_FILE) {\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'prev', _preceding(subBundles, html.displayName) || '');\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'index', (subBundles.indexOf(html.displayName) + 1) + '/' + totalSubBundles);\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'next', _following(subBundles, html.displayName) || '');\n\t\t\t\t}\n\t\t\t\treturn templateHTML;\n\t\t\t}\n\t\t\treturn _isFunction(html) ? html(outputDir) : html;\n\t\t}).join(\"\\r\\n\\r\\n\" + t) + \"\\r\\n\" + t2;\n\t\tif (this.outlineHTML) {\n\t\t\tcontents += \"\\r\\n\" + t + this.outlineHTML + \"\\r\\n\" + t2;\n\t\t}\n\t\t// -----------------------------------------\n\t\tif (outputFileExt) {\n\t\t\tFs.mkdirSync(outputDir, {recursive:true});\n\t\t\tFs.writeFileSync(outputFile, contents);\n\t\t\tif (this.params.CREATE_OUTLINE_FILE) {\n\t\t\t\tvar outlineFile = _beforeLast(outputFile, '.') + '.json';\n\t\t\t\tvar outline = {outline: this.outline};\n\t\t\t\tif (Fs.existsSync(outlineFile)) {\n\t\t\t\t\toutline = _merge({}, outline, JSON.parse(Fs.readFileSync(outlineFile)));\n\t\t\t\t}\n\t\t\t\tFs.writeFileSync(outlineFile, JSON.stringify(outline, null, 4));\n\t\t\t}\n\t\t\tsrc = getPublicFilename(outputFile, this.params.indentation);\n\t\t}\n\t\t// -----------------------------------------\n\t\treturn `<template${\n\t\t\t\t(this.name ? ' ' + this.params.TEMPLATE_NAMESPACE_ATTR + '=\"' + this.displayName + '\"' : '') + (src ? ' src=\"' + src + '\"' : '')\n\t\t\t}>${(!src ? contents : '')}</template>`;\n\t}", "function renderDrawPage(res) {\n\tlet promise = readFile(__dirname+'/java/output/all.json');\n\tpromise.then((data) => {\n\t\tres.writeHead(200,{'Content-Type':'text/html'});\n\t\tres.render('draw_B.jade', JSON.parse(data),(err,html)=>{\n\t\tif(err) {\n\t\t\tconsole.log('渲染出错');\n\t\t\tthrow err;\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tres.write(html);\n\t\t}\n\t\tres.end();\n\t},(err) => {console.log('rendererror:' + err);return;}); \n\n\t});\n}", "function build_page(){\n\t\t\tfor ( var key in sitemap.pages ) {\n\t\t\t\tvar site_obj = sitemap;\n\t\t\t\tvar page_obj = site_obj.pages[ key ];\n\n\t\t\t\tif ( page_obj.file !== false ) {\n\t\t\t\t\tvar sourceFile = \"test/preprocess/\" + page_obj.template + \".tmpl\";\n\t\t\t\t\tvar root = page_obj.file_root.replace( new RegExp( \"[\\/]+$\", \"g\" ), \"\" );\n\t\t\t\t\tvar page = page_obj.file || page_obj.nav_key + \".html\";\n\t\t\t\t\tvar targetFile = root + \"/\" + page;\n\t\t\t\t\tvar content = fs.readFileSync( sourceFile, \"utf8\" );\n\n\t\t\t\t\tsite_obj.current_page = page;\n\t\t\t\t\tsite_obj.current_build = page_obj.nav_key;\n\n\t\t\t\t\tvar tmpl = new nunjucks.Template( content, env );\n\t\t\t\t\tvar res = tmpl.render( site_obj );\n\n\t\t\t\t\tgrunt.log.writeln( \"building \" + targetFile );\n\t\t\t\t\tfs.writeFile( targetFile, res );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function exportHtml() {\r\n var md = mdEditor.getValue();\r\n var css = $('#cssStyle').val();\r\n\r\n console.log(\"Writing to file\");\r\n\r\n writeToFile('lightmd.html',\r\n '<!DOCTYPE html>\\n' +\r\n '<html>\\n' +\r\n '<head>\\n' +\r\n ' <title>Light Markdown Editor - Export</title>\\n' +\r\n (css != 'none' ? ' <link rel=\"stylesheet\" href=\"' + css + '\">\\n' : '') +\r\n '</head>\\n' +\r\n '<body>\\n' +\r\n markdown.toHTML(md) +\r\n '\\n</body>\\n' +\r\n '</html>\\n',\r\n function (path) {\r\n console.log(\"Download file: \" + path);\r\n $('#dummylink').attr('download', 'lightmd.html');\r\n $('#dummylink').attr('href', path);\r\n $('#dummylink')[0].click();\r\n });\r\n }", "function writeToFile(data)\n{\r\n // create the file\n var file = Components.classes[\"@mozilla.org/file/directory_service;1\"].\r\n getService(Components.interfaces.nsIProperties).\r\n get(\"ProfD\", Components.interfaces.nsIFile);\r\n \tfile.append(\"sitePreview.html\");\r\n \r\n // create the file stream\n var foStream = Components.classes[\"@mozilla.org/network/file-output-stream;1\"]\n .createInstance(Components.interfaces.nsIFileOutputStream);\r\n\r\n // if the file exists remove it\n if(file.exists())\r\n {\r\n file.remove(false);\r\n }\r\n \r\n // create a new file\r\n if ( file.exists() == false ) {\n file.create(file.NORMAL_FILE_TYPE, 0666); \n }\n\r\n // initialize the file stream and write the file and close it\n foStream.init(file, 0x02 | 0x10| 0x20, 0666, 0);\n foStream.write(data, data.length);\n foStream.close(); \r\n \r\n // return the file path\r\n return file.path;\n}", "function servePage(response, page){\n console.log('serve this page:', page);\n var body = fs.readFileSync(`./public/${page}`).toString();\n response.write(body);\n response.end();\n}", "phantomjs( markup, fOut, opts, on_error ) {\n // Save the markup to a temporary file\n const tempFile = fOut.replace(/\\.pdf$/i, '.pdf.html');\n FS.writeFileSync(tempFile, markup, 'utf8');\n let scriptPath = PATH.relative(process.cwd(), PATH.resolve( __dirname, '../utils/rasterize.js' ));\n scriptPath = SLASH(scriptPath);\n const sourcePath = SLASH(PATH.relative( process.cwd(), tempFile));\n const destPath = SLASH(PATH.relative( process.cwd(), fOut));\n SPAWN('phantomjs', [ scriptPath, sourcePath, destPath ], false, on_error, this);\n }", "function build() {\n //conditional statement that checks if the output directory has been created\n if(!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n\n }\n //validation of dir and path variables\nconsole.log(OUTPUT_DIR, outputPath)\n//this writes the html file\nfs.writeFileSync(outputPath, render(members), \"utf-8\")\n\n}", "function outputTeam() {\n // if output dir doesnt exist, create one\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n }\n // write fullteam array to outputPath variable\n fs.writeFileSync(outputPath, render(fullTeam), \"utf-8\");\n}", "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw new Error(err);\n console.log('Page created! Check out README.md in this directory to see it!')\n });\n}", "renderPage() {}", "saveAsMultipleFiles() {\r\n // Load the needed data for text file exportation\r\n let head = this.editorHTML.getValue().substr(0, this.editorHTML.getValue().indexOf('</head>')-1)\r\n let style = '\\n\\t<link rel=\"stylesheet\" href=\"style.css\">'\r\n let chead = '\\n</head>\\n'\r\n let bodyTag = this.editorHTML.getValue().indexOf('<body>')\r\n let bodyLines = this.editorHTML.getValue().substr(bodyTag)\r\n let html = bodyLines.substr(0, bodyLines.length-15)\r\n let script = '\\t<script src=\"script.js\"></script>\\n'\r\n let endDoc = '</body>\\n</html>'\r\n \r\n let todo = head\r\n \r\n // CSS exportation\r\n if (this.editorCSS.getValue().length > 0) {\r\n todo += style\r\n this.saveFile('style', 'CSS', this.editorCSS.getValue())\r\n }\r\n\r\n todo += chead\r\n todo += html\r\n\r\n // JS exportation\r\n if (this.editorJS.getValue().length > 0) {\r\n todo += script\r\n this.saveFile('script', 'JS', this.editorJS.getValue())\r\n }\r\n\r\n todo += endDoc\r\n\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', todo)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n\r\n }", "function convert(filename, callback){\n fs.readFile(filename, function(err, data) {\n\n var dir = filename.replace(/page\\.xml$/, '');\n\n data = data + '';\n data = data.replace(/&#160;/g, '&nbsp;'); // clear up bug that was messing up HTML\n\n var doc = new xmldoc.XmlDocument(data);\n var body = doc.firstChild;\n var saveName = \"index.md\";\n var permalink = dir.replace(__dirname, '') + 'index.html';\n\n body.attr = { \"class\": \"article\" };\n body.name = \"section\";\n\n body.eachChild(function(child, index, array){\n recur(child);\n });\n\n // set header attributes for md file\n var OUTPUT = header({ \n 'title': doc.attr.title,\n 'template': 'page.jade'\n });\n \n OUTPUT += body;\n\n // save to md file\n fs.writeFile(dir + saveName, OUTPUT, function(err){\n if (err) throw err;\n console.log(\"Saved: \" + dir + saveName);\n\n if (typeof(callback) === \"function\") callback.apply();\n });\n });\n}", "function handleShowDesign(req,res,lesson)\n{\n let filepath = req.session.design.filename;\n let stat = fs.statSync(filepath);\n console.log(\"SHOWDESIGN\",stat.size,filepath);\n res.setHeader(\"Content-Length'\",stat.size);\n if (filepath.endsWith(\".pdf\"))\n res.setHeader(\"Content-Type\",\"application/pdf\");\n let file = fs.createReadStream(filepath);\n file.pipe(res);\n}", "function endHTML() {\n const end =\n` </div>\n </body>\n</html>`\n// Append Team Profile HTML\nfs.appendFile(\"./dist/index.html\", end, function (err) {\n if (err) {\n console.log(err);\n };\n});\n// Console log end message\nconsole.log(endMessage);\n}", "function createHtmlFile(html) {\n\t// write HTML file into the dist folder\n\tfs.writeFile('dist/index.html', `${html}`, (err) => {\n\t\terr ? console.log(err) : console.log('Your HTML Document Was Successfully Generated!');\n\t});\n}", "function export_text_DocGenerator() {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:export_text()-Call\")\n\t//----Create Object/Instance of DocGenerator----\n\t// var vMyInstance = new DocGenerator();\n\t// vMyInstance.export_text();\n\t//-------------------------------------------------------\n\tvar vReturn = \"\";\n\tvar vCR = \"\";\n\tfor (var i=1; i<=this.rows; i++) {\n\t\t//--Before and After Overwrite no insert of new line CR \n\t\tif (this[i][1].charAt(0) == \">\") {\n\t\t\tvCR = \" \";\n\t\t} else {\n\t\t\tvReturn += vCR + this[i][1];\n\t\t\tvCR = \" \\n\";\n\t\t}\n\t};\n\treturn vReturn;\n}", "function EndofPrompts() {\r\n fs.writeFileSync(genFilePath, \"\");\r\n let markupData = genStartHtml();\r\n\r\n for (var a in staff) {\r\n markupData += staffHtml(staff[a]);\r\n }\r\n markupData += genFinalHtml();\r\n fs.writeFileSync(genFilePath, markupData);\r\n\r\n }", "function writeEktronCMSInfo()\r\n{\r\n\twith (document)\r\n\t{\r\n\t\twrite(\"<br><hr width='80%'>\");\r\n\t\twrite(\"<h2><a name='Ektron'>Ektron's Other Products</a></h2>\");\r\n\t\twrite('<a href=\"' + g_sCMS300Page + '\" target=\"_blank\"><img src=\"cms300.gif\" border=\"1\"></a>');\r\n\t\twrite('<li><a href=\"' + g_sCMS300Page + '\" target=\"_blank\">Ektron CMS300 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sCMS400Page + '\" target=\"_blank\">Ektron CMS400 Home Page</a><br>');\r\n\t\twrite('<li><a href=\"' + g_sDMS400Page + '\" target=\"_blank\">Ektron DMS400 Home Page</a><br>');\r\n\t\t/*write('<li><a href=\"' + GetAddress(sProduct) + '\" target=\"_blank\">Web Content Editors Home Page</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/webimagefx.aspx\" target=\"_blank\">Web Image Editor Home Page</a><br>');*/\r\n\t\twrite('<li><a href=\"http://www.ektron.com/support/index.aspx\" target=\"_blank\">Ektron Support Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com/developers/index.cfm\" target=\"_blank\">Ektron Developers Site</a><br>');\r\n\t\twrite('<li><a href=\"http://www.ektron.com\" target=\"_blank\">Ektron Site</a><br>');\r\n\t\twriteln(\"<br>\");\r\n\t}\r\n}", "function writeTextFile(filepath, output, type) {\n\t\tif (type == 'java'){\n\t\t\tvar link = document.getElementById('downloadlinkjava');\n\t\t}else{\n\t\t\tvar link = document.getElementById('downloadlinkros');\n\t\t}\n\t\tlink.href = makeTextFile(output);\n\t\tlink.download = filepath;\n\t\tvar event = new MouseEvent('click');\n\t\tlink.dispatchEvent(event);\n}", "function renderHomepage(postData) {\n var indexHTMLHeader = createIndexHeader();\n var newPeriodicElement = '<li><a href=\"/elements/' + postData.filename + '\">' + postData.elementName + '</li>';\n PeriodicElements[postData.filename] = newPeriodicElement;\n savePeriodicTable();\n var indexHTMLBody = createIndexBody(newPeriodicElement);\n var newIndexHTML = indexHTMLHeader + indexHTMLBody;\n var buffer = new Buffer(newIndexHTML);\n // fs.readFile(PUBLIC_DIR+'index.html',function(err,data){\n // console.log('data.toString()',data.toString()); \n // });\n\n fs.open(PUBLIC_DIR + 'index.html', 'w+', function(err, fd) {\n\n fs.write(fd, buffer, 0, buffer.length, null, function(err) {\n if (err) throw err;\n\n fs.close(fd, function() {\n console.log('done writing');\n });\n });\n\n });\n}", "function writeToFile(fileName, rendered) {\n fs.writeFile(fileName, rendered, (err) =>\n err ? console.log(err) : console.log('Success!')\n );\n}", "function outputFileCreationInfo(file)\n{\n // Add the build information and header to the output file\n ccdd.writeToFileLn(file, \"# Created : \" + ccdd.getDateAndTime() + \"\\n# User : \" + ccdd.getUser() + \"\\n# Project : \" + ccdd.getProject() + \"\\n# Script : \" + ccdd.getScriptName());\n\n // Check if any table is associated with the script\n if (ccdd.getTableNumRows() != 0)\n {\n ccdd.writeToFileLn(file, \"# Table(s): \" + [].slice.call(ccdd.getTableNames()).sort().join(\",\\n# \"));\n }\n\n // Check if any groups is associated with the script\n if (ccdd.getAssociatedGroupNames().length != 0)\n {\n ccdd.writeToFileLn(file, \"# Group(s): \" + [].slice.call(ccdd.getAssociatedGroupNames()).sort().join(\",\\n# \"));\n }\n\n ccdd.writeToFileLn(file, \"\");\n}", "function htmlWriter() {\n \n //writes the html for introduction\n htmlIntro();\n \n //creates the event functionality for example 1 and example 2\n exampleSetEvents();\n \n //writes the html for the game\n htmlGame();\n }", "function print_page(printableArea) {\n var printContents = document.getElementById(printableArea).innerHTML;\n var originalContents = document.body.innerHTML;\n //\n document.body.innerHTML = printContents;\n // this is where CSV export logic can go as well I think\n window.print();\n //\n document.body.innerHTML = originalContents;\n}", "function BuildHTML(html, file) {\n\tfs.writeFileSync(OutputDir + UpdateFileName(file, \"html\"), html)\n\tconsole.log(\"Built HTML file: \" + UpdateFileName(file, \"html\"));\n}", "function makeTeamHTML(emplyArr) {\n fs.writeFile(outputPath, render(emplyArr), function(err) {\n err?console.log(err):console.log(\"Team html rendered. Have a look!\");\n })\n}", "function initializeOutput() {\r\n HTML_output = new java.io.FileWriter(\"active-hits/shortn-results.\" + soylentJob + \".html\");\r\n lag_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_lag.csv\");\r\n lag_output.write(\"Stage,Assignment,Wait Type,Time,Paragraph\\n\");\r\n payment_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_payment.csv\");\r\n payment_output.write(\"Stage,Assignment,Cost,Paragraph\\n\");\r\n patchesOutput = new java.io.FileWriter(\"active-hits/shortn-patches.\" + soylentJob +\".json\");\r\n}", "function createFinalTeam() {\n fs.writeFileSync(outputPath, render(employees))\n console.log('Successfully wrote to team.html and placed it in the output folder!')\n}", "function generateHTMLFile() {\r\n\tvar fileContents = \"\";\r\n\tfileContents += \"<html><body>\";\r\n\tfileContents += $(\"#canvas\").html();\r\n\tfileContents += \"</body></html>\";\r\n\t\r\n\tvar tempLink = document.createElement('a');\r\n tempLink.setAttribute('href', 'data:text/html;charset=utf-8,' + encodeURIComponent(fileContents));\r\n tempLink.setAttribute('download', 'wysiwygHtml');\r\n\r\n tempLink.style.display = 'none';\r\n document.body.appendChild(tempLink);\r\n\r\n tempLink.click();\r\n\r\n document.body.removeChild(tempLink);\r\n}", "function writeToFile(fileName, data) {\n const pageMD = generateMarkdown(data);\n fs.writeFile(`./dist/${fileName}.md`, pageMD, (err) => {\n if (err) throw err;\n console.log(\"Done! File is saved in the dist/ direcictory.\");\n });\n}", "function outputFileCreationInfo(file)\n{\n // Add the build information and header to the output file\n ccdd.writeToFileLn(file, \"/* Created : \" + ccdd.getDateAndTime() + \"\\n User : \" + ccdd.getUser() + \"\\n Project : \" + ccdd.getProject() + \"\\n Script : \" + ccdd.getScriptName());\n\n // Check if any table is associated with the script\n if (ccdd.getTableNumRows() != 0)\n {\n ccdd.writeToFileLn(file, \" Table(s): \" + [].slice.call(ccdd.getTableNames()).sort().join(\",\\n \"));\n }\n\n // Check if any groups is associated with the script\n if (ccdd.getAssociatedGroupNames().length != 0)\n {\n ccdd.writeToFileLn(file, \" Group(s): \" + [].slice.call(ccdd.getAssociatedGroupNames()).sort().join(\",\\n \"));\n }\n\n ccdd.writeToFileLn(file, \"*/\\n\");\n}", "function output()\n{\n if (!outputFile)\n {\n console.log(outputBuffer);\n exit();\n }\n else\n {\n writeBuffer(outputBuffer);\n }\n}", "function sendPage(fileName, result) {\n var html = '';\n\n // Read the file one line at a time.\n lineReader.eachLine(fileName,\n /**\n * Append each line to string html.\n * Send the contents of html to the client\n * after the last line has been read.\n * @param line the line read from the file.\n * @param last set to true after the last line.\n */\n function (line, last) {\n html += line + '\\n';\n\n if (last) {\n result.send(html);\n return false;\n }\n else {\n return true;\n }\n });\n}", "function printInp() {\r\n html2pdf(document.body, { margin: 10,\r\n filename: 'TADEE_Project_Input.pdf',\r\n image: { type: 'jpeg', quality: 0.98 },\r\n html2canvas: { scale: 1, logging: true, dpi: 192, letterRendering: true },\r\n jsPDF: { unit: 'mm', format: 'a3', orientation: 'portrait' }});\r\n }", "function writeTxtFiles() { //调用前面的写方法\n\n\t// could've written these as one function,\n\t// left em separate for easy customization,\n\t// e.g., could've written writeCsv()\n\n\n\n\n\n\twriteHtml();\n\twriteCss();\n\t// writeJson();\n\twriteManifest();\n\n\n}", "async build(write = true) {\n for(let g in this.items) {\n if(this.items[g].hasConfig && this.items[g].config.build != false) {\n // render out this page\n let dirs = this.items[g].href.split('/');\n dirs.pop();\n let page = {\n data: this.items[g].render({ pages: this.items }),\n config: this.items[g].config,\n name: g };\n await this.emitMiddleware('after', page);\n if(write) {\n console.log(' [build] Writing file ' + this.config.base + '/' + this.items[g].href + '...');\n fs.mkdir(this.config.base + '/' + dirs.join('/'), { recursive: true }, (err) => {\n if (err) throw err;\n fs.writeFileSync(this.config.base + '/' + this.items[g].href, page.data);\n });\n } else {\n this.output[g] = page.data;\n }\n }\n }\n this.emitMiddleware('finish');\n }", "function _writePdf2(template,data,req,res,next){\n var source;\n fs.readFile(__dirname+'/util/pdfTemplate/'+template, {encoding:'utf8'}, function (err, tpldata) {\n if (err) {\n logger.error(' _writePdf2 ' + err.message);\n throw err;\n }\n //console.log(tpldata);\n source=tpldata;\n // var qrcode_file=__dirname+'/../uploads/'+data.biz.biz_id+'.png';\n // console.log(qrcode_file);\n // var qr_png = qr.image('http://www.tru-menu.com', { type: 'png' });\n // qr_png.pipe(fs.createWriteStream(qrcode_file));\n // data.qrcode=qrcode_file;\n\n var template = handlebars.compile(source);\n var result = template(data);\n\n //console.log(result);\n\n res.set(\"cache-control\",\"no-cache\");\n// res.set('content-type', 'application/pdf');\n res.set('content-type', 'text/html');\n //res.set(\"content-length\",result.length);\n res.writeHead(200);\n res.write(result);\n res.end();\n //next(false);\n\n //console.log('========================my footer')\n //console.log(data.urlRoot+'/web/view/pdffooter.html');\n// var st=wkhtmltopdf(result,{orientation:'Landscape',pageSize:'A4',marginBottom:20,footerHtml:data.urlRoot+'/business/view/pdffooter.html'});\n\n// st.pipe(res);\n// st.once('end', function () {\n// fs.unlink(qrcode_file);\n// next(false);\n// });\n });\n}", "function writeToFile(data) {\n fs.writeFile('./dist/teamProfile.html', data, err => {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Your team profile is a success!\");\n }\n })\n}", "getPage(pageName, response) {\n let filename = \"\";\n if (pageName == \"/\") {\n filename = \"./src/site/index.html\";\n } else if (this.isAccessibleFolder(pageName)) {\n filename = pageName.substr(1);\n } else if (this.isAccessibleHTMLFile(pageName)) {\n filename = \"src/site\" + this.isAccessibleHTMLFile(pageName);\n } else if (pageName === \"/favicon.ico\") {\n filename = \"src/site/assets/FAVICON.png\";\n } else {\n let htmlFile = this.mapToHTMLFile(pageName);\n if (htmlFile === null) {\n return this.respondWithError(response, 404, \"Error 404: Page Not Found\");\n } else {\n filename = \"src/site\" + htmlFile;\n }\n }\n\n //determine Content-type\n var contentType = \"text/html\";\n if (filename.substr(-3) === \"css\") {\n contentType = 'text/css';\n } else if (filename.substr(-2) === \"js\") {\n contentType = \"application/javascript\";\n } else if (filename.substr(-3) === \"png\") {\n contentType = \"image/png\";\n } else if (filename.substr(-3) === \"pdf\") {\n contentType = \"application/pdf\";\n } else if (filename.substr(-4) === \"docx\") {\n contentType = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n }\n \n filename = this.replaceWithSpaces(filename);\n var self = this; //required for callback in readFile scope\n fs.readFile(filename, function (err, data) {\n if (err) {\n return self.respondWithError(response, 404, \"Error 404: Page Not Found\");\n }\n else {\n return self.respondWithData(response, 200, contentType, data);\n }\n });\n return 0;\n }", "function writeToPage(msg) {\n results.innerHTML = msg;\n}", "function exportMapToTxt() {\n let txtFile = \"\";\n page.whiteList.cookieWhiteList.forEach(function(value, key, map) {\n txtFile += \"#\" + key + \"\\n\";\n txtFile += returnLinesFromArray(Array.from(value));\n txtFile += \"\\n\"\n\n });\n downloadTextFile(txtFile);\n}", "function generate() {\n fs.writeFileSync(outputPath, render(teamMembers), \"utf-8\");\n process.exit(0);\n}", "function createHTML() {\n const html = render(employeeList);\n // check if directory exists and create if not exists\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n\n fs.writeFile(outputPath, html, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Successfully created the Team profile file!\");\n }\n });\n}", "function writeToFile( data) {\n fs.writeFile(\"./generated-files/README.md\",generateMarkdown(data), err =>{\n if(err){\n throw err;\n }\n console.log(\"file generated!\")\n })\n}" ]
[ "0.681531", "0.65952015", "0.6562266", "0.651069", "0.6413979", "0.64132905", "0.6406398", "0.6222543", "0.62222046", "0.6132307", "0.6039272", "0.59967875", "0.59938", "0.59888405", "0.59466743", "0.5833676", "0.5822087", "0.5819268", "0.57932734", "0.5791793", "0.5779447", "0.5770055", "0.576678", "0.57667375", "0.5686967", "0.56749994", "0.56604475", "0.56452537", "0.5640148", "0.5638009", "0.56242937", "0.5620884", "0.5604385", "0.560023", "0.5590693", "0.55702233", "0.5569658", "0.55548334", "0.5526578", "0.55235916", "0.550978", "0.5501807", "0.5489606", "0.5488809", "0.54840857", "0.5461244", "0.54490703", "0.5438207", "0.5431481", "0.54200196", "0.5374434", "0.53686404", "0.5361488", "0.5357615", "0.53572583", "0.53564906", "0.53438526", "0.5334105", "0.5322545", "0.5321455", "0.53165245", "0.53087497", "0.5298662", "0.5297226", "0.5284817", "0.52840394", "0.527632", "0.52730674", "0.527208", "0.5265596", "0.5264702", "0.5264272", "0.52634263", "0.5262622", "0.5261585", "0.52544", "0.5248634", "0.5241005", "0.5237995", "0.5234953", "0.52304095", "0.5228911", "0.5228554", "0.5220455", "0.5218995", "0.5201835", "0.52007145", "0.51989293", "0.5188292", "0.51725495", "0.51610434", "0.515859", "0.51578027", "0.51549953", "0.515448", "0.51521355", "0.5138237", "0.5136527", "0.513517", "0.5131167" ]
0.6541599
3
Method to return data
function resolveEndpoint(response, service) { let res = null; response.set("Content-Type", service.response.contentType); response.status(service.response.status); if (service.response.file) { try { // External file res = fs.readFileSync(`${mockPath}/${service.response.file}`, "utf8"); } catch (err) { // Error reading file console.log( `Unable to read file content ${mockPath}/${service.response.file}: ${err}` ); const contentType = service.response.contentType.toLowerCase(); res = contentType === "application/json" ? { error: "Unhandled error" } : contentType === "text/xml" ? "<?xml version='1.0' encoding='UTF-8'?><error>Unhandled error</error>" : "Unhandled error"; } } else { // Mock body res = service.response.body || ""; } // Return response if (logsMode === "responses" || logsMode === "all") { console.log("Response", res); } response.send(res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {}", "getData(){}", "GetData() {}", "function getData(data) {\n return data;\n}", "function getData(data) {\n return data;\n}", "getData () {\n }", "function simpleDataReturn(result) {\n\t\treturn result.data;\n\t}", "get data() {\n return this.getData();\n }", "getData() {\n \n}", "function getData(res) {\r\n // use try... catch... to catch error\r\n try {\r\n const testData = res;\r\n userData = testData;\r\n return userData;\r\n } catch (err) {\r\n console.log(err.message);\r\n }\r\n}", "get_new_data() {\n return data\n }", "getData() {\n return this.data;\n }", "getData() {\n return this.data;\n }", "getData() {\n \n return {\n \n } \n }", "getData() {\n return this._data;\n }", "getAll() {\n return _data;\n }", "getDatas() {\n return JSON.parse(this.getBody()).result;\n }", "function getData() {\r\n var loadedData = loadData(); //variable to load data from database.\r\n return loadedData; //return data.\r\n}", "getData() {\n \n return {\n \n } \n }", "function getData() {\n\t\t\tvar deferred = $.Deferred();\n\t\t\t// get RPC results\n\t\t\tRactiveRPC.testDataAsync({\n\t\t\t\tonsuccess: function(results) {\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t},\n\t\t\t\tonerror: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\tontimeout: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\ttimeout: 2000,\n\t\t\t\tparams: [1,2]\n\t\t\t});\t\n\t\t\t\n\t\t\treturn deferred.promise();\n\t\t}", "getData() {\n return this._cachedData;\n }", "getData() {\n return {};\n }", "get data() {\n\t\treturn this.__data;\n\t}", "get data() {\n return getIn(privateDataMap.get(this).currentData, this.path);\n }", "function getData() {\n return {\n ergReps: ergReps,\n bikeReps: bikeReps,\n repRate: repRate,\n totTime: totTime,\n Distance: Distance\n }\n }", "function data2() {\n\treturn {a: 1, b: 2, c: 3};\n}", "function grabTableData() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('mtData'));\n Logger.log('return:' + JSON.parse(dataForChart));\n return dataForChart;\n}", "function getStudentData() {\r\n // Use Student object to retrieve all available student info\r\n var studentInfo = {\r\n career: user.Student.Career,\r\n faculty: user.Student.Faculty,\r\n departments: user.Student.Departments,\r\n plans: user.Student.PlanTitles,\r\n formOfStudy: user.Student.FormOfStudy,\r\n level: user.Student.Level,\r\n studentNum: user.Student.StudentNumber\r\n };\r\n\r\n // Can log the whole object to check what is being returned\r\n // console.log(studentInfo);\r\n\r\n // Return final result\t\r\n return studentInfo;\r\n}", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\n\t\t\t// I'm calling updateCallback to tell it I've got new data for it to munch on.\n\t\t\tupdateCallback(newData);\n\t\t}", "function searchedData(err, data, response) {\n return data;\n }", "function IntObject_GetData()\n{\n\t//default result: null\n\tvar datas = null;\n\t//has HTML get Data?\n\tif (this.HTML && this.HTML.GetData)\n\t{\n\t\t//call it\n\t\tdatas = this.HTML.GetData();\n\t}\n\t//no data? Can happen when the treegrid hasnt scrolled a few objects into view yet\n\tif (datas == null)\n\t{\n\t\t//switch on the class\n\t\tswitch (this.DataObject.Class)\n\t\t{\n\t\t\tcase __NEMESIS_CLASS_CHECK_BOX:\n\t\t\tcase __NEMESIS_CLASS_RADIO_BUTTON:\n\t\t\t\tdatas = new Array(this.Properties[__NEMESIS_PROPERTY_CHECKED]);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\tdatas = new Array(Get_String(this.Properties[__NEMESIS_PROPERTY_CAPTION], \"\").replace(/\\r\\n/g, \"\\n\").replace(/\\n/g, \"\\r\\n\"));\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t\tdatas = new Array(Get_String(this.Properties[__NEMESIS_PROPERTY_CAPTION], \"\"));\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t//valid data?\n\tif (datas != null)\n\t{\n\t\t//loop through it\n\t\tfor (var i = 0, c = datas.length; i < c; i++)\n\t\t{\n\t\t\t//translate this\n\t\t\tdatas[i] = __VARS_MANAGER.TranslateString(datas[i], this.DataObject.Id);\n\t\t}\n\t}\n\t//return it\n\treturn datas;\n}", "function UltraGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//return it\n\treturn result;\n}", "data() {\n\t\t\tlet data = {};\n\t\t\tupdate(bs => {\n\t\t\t\tdata = bs;\n\t\t\t\treturn bs;\n\t\t\t});\n\t\t\treturn data;\n\t\t}", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "function doGet()\n{\n return getParsedDataDisplay();\n}", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "getData() { return this.doc.data; }", "function myData() {\n retrun;\n}", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\t\t\tupdateCallback(newData);\n\t\t}", "function getData() {\n console.log(data)\n }", "function getResponseData() {\n\tconnection.query('SELECT * FROM departments', function(err, res) {\n\t\tif (err) throw err;\n\t\texecutiveInputs(res);\n\t})\n}", "function gettingRecordsData() {\n\treturn gettingRecordsDataForCheckin();\n}", "function grabTableData2() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('rankData'));\n// var testValue = JSON.parse(dataForChart);\n// Logger.log('return:' + testValue);\n return dataForChart;\n }// grabTableData2() function end", "function returnObjectData() {\n return {\n number: 10,\n string: 'Hello World!',\n boolean: true,\n null: null,\n undefined: undefined,\n };\n}", "function getData() {\n\t\t\tvar deferred = $.Deferred();\n\t\t\t// get RPC results\n\t\t\tRactiveRPC.tab2dataAsync({\n\t\t\t\tonsuccess: function(results) {\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t},\n\t\t\t\tonerror: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\tontimeout: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\ttimeout: 2000,\n\t\t\t\tparams: [1,2]\n\t\t\t});\t\n\t\t\t\n\t\t\treturn deferred.promise();\n\t\t}", "get Data() {\n return this._data;\n }", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "result(data) {\n return this.reportDatabase.getAllObjectsList('calculator-storage').\n then(d => {\n console.log('data sent: ', data);\n return d;\n });\n }", "get Data () {\n return this._data\n }", "getData(index = false) {\n if(index) {\n if(index in this.data) {\n return this.data[index];\n }\n\n return false;\n }\n\n return this.data;\n }", "function data3() {\n\treturn {a: 1, b: 2};\n}", "getData(key) { return this.data[key]; }", "get data () {return this._data;}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "getResponse() {\n\t\treturn this.response.data;\n\t}", "getData(){\n\t\treturn this;\n\t}", "getData(numRecords = undefined) {\n return !numRecords ? this.data : this.data.slice(0, numRecords);\n }", "function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n}", "async getDatiCiclatura() {\n let dati = { msg: 'No data' };\n try {\n if (isFake()) {\n dati = await fake_getDatiCiclatura();\n } else {\n let response = await this.getRequest(Endpoints.GET_DATI);\n dati = response.data;\n }\n // console.log(dati);\n } catch (error) {\n console.log('Errore api call');\n }\n return dati;\n }", "get() {\n return this.data\n }", "getData() {\n return this.globalData;\n }", "getStructuredData(){\n return model.getData()\n .then((text) => {\n return this.createStructuredData(text);\n });\n }", "getData() {\n if(this.type === 'JSON') {\n return JSON.stringify(this.kvps)\n } else {\n return this.html\n }\n }", "static async getData() {\n const url = 'http://cparkchallenge.herokuapp.com/report/:lat/:long';\n\n return await fetch(url)\n .then(dataFromServer => dataFromServer.json());\n }", "getData() {\n let data = super.getData();\n\n data.timestamp = new Date();\n data.timestampText = data.timestamp.toTimeString();\n\n return(data);\n }", "function getNewsData() {\n return requestNews().then(extractNews);\n}", "getData() {\n return this.rows;\n }", "async getData() {\n const accountTypes = await this.getAccountTypes().then((_accountTypes) => ({\n isFarmer: _accountTypes[0],\n isDistributor: _accountTypes[1],\n isRetailer: _accountTypes[2],\n isConsumer: _accountTypes[3],\n }));\n const items = await this.getItems();\n return {\n accountTypes,\n items,\n };\n }", "function getDataCallback(response, status, headers, config) {\n return response.data;\n }", "get data() {\n return this.combinedData;\n }", "async function getData(data) {\n\n let returnData = null;\n\n if (helpers.testEmail(data)) {\n\n returnData = await controllers.getAccountByEmail(data);\n window.memberData = returnData;\n\n } else {\n\n returnData = await controllers.getAccountByNumber(data);\n window.memberData = returnData;\n\n }\n\n return returnData;\n\n }", "get(data) {\n try {\n return JSON.parse(data);\n } catch (e) {\n return data;\n }\n }", "RetrieveData() {\n return stateVars.itemArray;\n }", "async getData() {\n const data = await readFile(this.datafile, 'utf8');\n if (!data) return [];\n return JSON.parse(data);\n }", "function loadData(){\r\n connectionManager.startConnection();\r\n return $http.get(DATA_API_URL)\r\n .then(function(resp){\r\n //First store in cache\r\n cache = resp.data.characters;\r\n\r\n return cache;\r\n })\r\n .finally(function(){\r\n connectionManager.endConnection();\r\n });\r\n }", "fetch() {\n var dataPromise = this.request.fetch().then((response) => {\n var output = {};\n if (isObject(response)) {\n response\n .filter(source => source.notPathwayData == false)\n .map((ds) => {\n var name = (ds.name.length > 1) ? ds.name[1] : ds.name[0];\n output[ds.uri] = {\n id: ds.identifier,\n uri: ds.uri,\n name: name,\n description: ds.description,\n type: ds.type\n };\n });\n } else {\n output = null;\n }\n return output;\n }).catch(() => {\n return null;\n });\n\n this.data = dataPromise;\n return dataPromise;\n }", "function returnData(imageURL, description, coord) {\n this.imageURL = imageURL;\n this.description = description;\n this.coord = coord;\n}", "function dataReturn (returnValue, result) {\n\t\tif (returnValue === 0) return result;\n\t\tthrow new Error('FALCON error: ' + returnValue);\n\t}", "async getData() {\n const data = await readFile(this.datafile, \"utf8\");\n return JSON.parse(data).medewerkers;\n }", "get data(){\n return this._data;\n }", "function getApiData(req,res){\r\n res.send(projectData);// send the response that was stored on our dataArray\r\n}", "function getData(data) {\n dataActivity = data.activity;\n dataType = data.type;\n dataAccessibility = data.accessibility;\n dataPrice = data.price;\n dataParticipants = data.participants;\n}", "function data(){\n return values;\n }", "function getData() {\n var size = Object.keys($scope.datos).length;\n var data = [];\n for (var j=0; j<size; j++) {\n data.push({\n id: j+1,\n codigoaf: $scope.datos[j].codigoaf,\n descripcion: $scope.datos[j].tipoactivo + ' ' + $scope.datos[j].descripcion,\n codigos: $scope.datos[j].codigo + ', ' + $scope.datos[j].codigoold,\n observeciones: $scope.datos[j].obstrans,\n });\n }\n return data;\n }", "function getData() {\n var dataInStorage = sessionStorage.getItem('data');\n\n if (dataInStorage) {\n var dataOutOfStorage = JSON.parse(dataInStorage);\n return dataOutOfStorage;\n }\n}", "function getMedicalData(oData) {\r\n\tvar result = WL.Server.invokeSQLStatement({\r\n\t\tpreparedStatement : selectStatement,\r\n\t\tparameters : [oData.email]\r\n\t});\r\n\tvar oReturn = [];\r\n\tif(result.resultSet!=undefined){\r\n\tfor(var i = 0; i < result.resultSet.length; i++){\r\n\t\tvar data = {\r\n\t\t\t\tidentifier: result.resultSet[i].Identifier, \r\n\t\t\t\temail: result.resultSet[i].Email, \r\n\t\t\t\tIMSS:result.resultSet[i].InsuranceNumber,\r\n\t\t\t\tbloodType:result.resultSet[i].TypeBlood, \r\n\t\t\t\talergics:result.resultSet[i].Alergies,\r\n\t\t\t\tclinicalConditions:result.resultSet[i].Ailment\r\n\t\t\t\t};\r\n\t\t\r\n\t\r\n\t\toReturn.push(data);\r\n\t}\r\n\t}\r\n\treturn {data: oReturn};\r\n}", "function getData() {\n return $.getJSON(apiUrl);\n}", "getUserData() {\n console.log(\"Make a DB query...\");\n return {\n user_id: this.userId,\n name: \"AAA\",\n age: 12,\n };\n }", "getData() {\n const data = super.getData();\n data.labels = this.item.labels;\n \n // Include CONFIG values\n data.config = CONFIG.SFRPG;\n \n // Item Type, Status, and Details\n data.itemType = data.item.type.titleCase();\n data.itemStatus = this._getItemStatus(data.item);\n data.itemProperties = this._getItemProperties(data.item);\n data.isPhysical = data.item.data.hasOwnProperty(\"quantity\");\n data.hasLevel = data.item.data.hasOwnProperty(\"level\") && data.item.type !== \"spell\";\n data.hasHands = data.item.data.hasOwnProperty(\"hands\");\n data.hasCapacity = data.item.data.hasOwnProperty(\"capacity\");\n\n // Armor specific details\n data.isPowerArmor = data.item.data.hasOwnProperty(\"armor\") && data.item.data.armor.type === 'power';\n \n // Action Details\n data.hasAttackRoll = this.item.hasAttack;\n data.isHealing = data.item.data.actionType === \"heal\";\n \n // Spell-specific data\n if ( data.item.type === \"spell\" ) {\n let save = data.item.data.save;\n if ( this.item.isOwned && (save.type && !save.dc) ) {\n let actor = this.item.actor;\n let abl = actor.data.data.attributes.keyability || \"int\";\n save.dc = 10 + data.item.data.level + actor.data.data.abilities[abl].mod;\n }\n }\n\n data.modifiers = this.item.data.data.modifiers;\n \n return data;\n }", "get data() {\n\t\treturn this._tableData;\n\t}", "getAll() {\n return this.getDataFromServer(this.path);\n }", "function getData(result) {\n //here resolve the data\n Promise.resolve(result).then(value =>{\n //brack the hole function to differnt function\n getDate(value.updated); //call the function for date\n getTotal(value.total); //call the function for total cases\n getState(value.states); //call the function for state wise cases\n })\n }", "serializedData() {\n return this.serialize(this);\n }", "function Data() { }", "getData() {\n // todo: read from fs if you have it already or retrieve using storage layer client\n return fs.readFileSync(Chunk.getChunkStoragePath(this.id), { encoding: null });\n }", "function getData(){\n var appUrl = \"https://jsonplaceholder.typicode.com/posts\";\n\n var request = $http({\n method:'GET',\n url:appUrl\n });\n return (request\n .then(getDataSuccess)\n .catch(getDataError));\n //Success function\n function getDataSuccess(response){\n return (response);\n }\n \n //Error Handling\n function getDataError(response){\n if(!angular.isObject(response.data) || !response.data.message){\n return ($q.reject(response.data))\n }\n return ($q.reject(response.data.message));\n }\n }", "function data() {\n return {a:1, b:2, c:3}; \n}" ]
[ "0.79327536", "0.7849613", "0.771991", "0.75519276", "0.75127596", "0.7270598", "0.7153728", "0.70752484", "0.6996639", "0.69907176", "0.69789064", "0.69585544", "0.69585544", "0.6925951", "0.69102114", "0.68731236", "0.6861913", "0.6827667", "0.67981476", "0.6709817", "0.6676868", "0.6673295", "0.6670276", "0.66640824", "0.6650386", "0.6617391", "0.6573304", "0.6572102", "0.65713185", "0.6559024", "0.6555608", "0.65526843", "0.65174145", "0.6495514", "0.64599675", "0.64516044", "0.64516044", "0.64516044", "0.6445156", "0.644294", "0.64385223", "0.6424952", "0.6415706", "0.63805735", "0.6371613", "0.6366488", "0.63524044", "0.6347196", "0.6345845", "0.6345845", "0.6345692", "0.6321287", "0.62946314", "0.62945276", "0.62856555", "0.6284087", "0.62799335", "0.62799335", "0.6248272", "0.6247723", "0.62433225", "0.6224811", "0.6220998", "0.6213287", "0.62127477", "0.62070453", "0.62001354", "0.61995006", "0.61942", "0.61831075", "0.6172925", "0.61691326", "0.61575884", "0.61358124", "0.61229736", "0.6119097", "0.61012715", "0.6095828", "0.6086599", "0.6080157", "0.60730124", "0.6048631", "0.6048194", "0.6044233", "0.60412204", "0.60409063", "0.6038809", "0.6028184", "0.60226804", "0.6020217", "0.6019291", "0.6017732", "0.60157347", "0.60113615", "0.6005053", "0.6002413", "0.5996877", "0.59906393", "0.598362", "0.5980567", "0.5977495" ]
0.0
-1
Turn on audio for marker in close proximity
TurnOnMarkerAudio(filename){ const {FadeInVolume, FadeOutVolume} = this; const url = serverURL[0].url; //if there is media file attached to marker if(filename!=='none'){ FadeOutVolume(()=>{ this.audio.pause() // pause background audio const src = `${url}${filename}` this.markerAudio.src = src; //Set marker's audio's source this.markerAudio.volume = 0;// Initial marker's audio volume this.markerAudio.play(); //Play marker's audio FadeInVolume(()=>{return},50,0.01,1,"marker"); //Gradually increase marker's audio volume //When marker's audio ends this.markerAudio.onended = () => { this.audio.play() FadeInVolume(()=>{return},10, 0.01, 1,"main") //Graudually increase background audio volume } },10, 0.01,"main" ) //Fade Out Volume of background } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateAudioForLocation(lat, lng) {}", "function playSound(marker)\n{ console.log(marker.data);\n if(marker.id!==isThis)\n {\n let notiOS=true;\n if (device==='iPad'||device==='iPhone'||device==='iPod'===true)\n {\n notiOS=false;\n }\n if(sound!==undefined){sound.stop();}\n sound = new Howl({\n mute: false,\n html5: notiOS,\n src: [marker.components['sound-sample'].data.src],\n\n onload: function() {\n console.log(\"LOADED\");\n\n },\n });\n // Tweak the attributes to get the desired effect.\n sound.pannerAttr({\n coneInnerAngle: 360,\n coneOuterAngle: 360,\n coneOuterGain: 0,\n maxDistance: 10000,\n panningModel:'HRTF',\n refDistance: 1,\n rolloffFactor: 1,\n distanceModel: 'exponential',\n });\n sound.autoUnlock = true;\n\n sound.pos(marker.object3D.position.x,marker.object3D.position.y,marker.object3D.position.z); //update the position for spatial sound\n marker.components['registerevents'].data.soundid = sound.play();\n isThis=marker.id;\n\n }\n else\n {\n sound.pos(marker.object3D.position.x,marker.object3D.position.y,marker.object3D.position.z); //update the position for spatial sound\n sound.play(marker.components['registerevents'].data.soundid);\n }\n}", "onAudioSeeked(audioInfo) {\n console.log('audio seeked', audioInfo)\n }", "play(){\n this.initMap();\n this.getMarker();\n }", "function toggleAudio(cnv) {\n cnv.mouseOver(function() {\n carrier.amp(1.0, 0.01);\n });\n cnv.touchStarted(function() {\n carrier.amp(1.0, 0.01);\n });\n cnv.mouseOut(function() {\n carrier.amp(0.0, 1.0);\n });\n}", "function toggleAudio(cnv) {\n cnv.mouseOver(function() {\n carrier.amp(1.0, 0.01);\n });\n cnv.touchStarted(function() {\n carrier.amp(1.0, 0.01);\n });\n cnv.mouseOut(function() {\n carrier.amp(0.0, 1.0);\n });\n}", "function amplitude_set_location(percentage){\n amplitude_active_song.currentTime = amplitude_active_song.duration * percentage;\n}", "function setAudio(e, value) {\n myMediaStream.getAudioTracks()[0].enabled = !myMediaStream.getAudioTracks()[0].enabled;\n myAudioStatus = myMediaStream.getAudioTracks()[0].enabled;\n e.target.className = \"fas fa-microphone\" + (myAudioStatus ? \"\" : \"-slash\");\n if (value) {\n audioBtn.className = \"fas fa-microphone\" + (myAudioStatus ? \"\" : \"-slash\");\n tippy(startAudioBtn, { content: myAudioStatus ? \"Off\" : \"On\", placement: \"top\", });\n }\n setMyAudioStatus(myAudioStatus);\n}", "function updateHotspot(location) {\n var activeHotspotDistance = 0.1; // Hotspot content becomes active at this distance\n var focusHotspotDistance = 0.01; // Focus is given to the nearest hotspot at this distance\n var maxActiveHotspots = 3;\n\n // Find nearest hotspot to location\n {\n var nearestHotspot = turf.nearest(location, data);\n\n map.removeFeatureState({\n source: mapSource\n });\n map.setFeatureState({\n source: mapSource,\n id: nearestHotspot.properties.featureIndex\n }, {\n nearest: true\n });\n }\n\n var focusHotspot = false;\n var activeHotspots = [];\n\n data.features.forEach((f, idx) => {\n var distance = turf.distance(\n location,\n turf.point(f.geometry.coordinates)\n );\n\n data.features[idx].properties[\"distance\"] = distance;\n\n map.setFeatureState({\n source: audioLayer,\n id: idx\n }, {\n distance: distance,\n active: true, // distance < activeHotspotDistance ? true : false,\n focus: distance < focusHotspotDistance ? true : false\n });\n\n // Play audio of nearby hotspots\n\n if (distance < activeHotspotDistance) {\n // Focus on a single audio for the nearest active hotspot\n // Else play all active with volume scaled by distance\n\n if (distance < focusHotspotDistance) {\n focusHotspot = true;\n\n if (idx == nearestHotspot.properties.featureIndex) {\n // Pause all nearby hostposts to focus on nearest active one\n activeHotspots.forEach(idx =>\n document.getElementById(\"audio-\" + idx).pause()\n );\n\n document.getElementById(\"audio-\" + idx).volume = 1;\n document.getElementById(\"audio-\" + idx).play();\n }\n } else {\n if (!focusHotspot && activeHotspots.length < maxActiveHotspots) {\n activeHotspots.push(idx);\n\n var volume = scaleValue(\n distance,\n [focusHotspotDistance, activeHotspotDistance],\n [0.9, 0]\n );\n document.getElementById(\"audio-\" + idx).volume = volume;\n document.getElementById(\"audio-\" + idx).play();\n } else {\n document.getElementById(\"audio-\" + idx).pause();\n }\n }\n } else {\n document.getElementById(\"audio-\" + idx).pause();\n }\n });\n\n map.getSource(audioLayer).setData(data);\n }", "startMusic(){\n myTrack.play()\n this.audioInPlay = true\n }", "function amplitude_set_song_position(e){\n //Gets the offset from the left so it gets the exact location.\n if(document.getElementById('amplitude-song-slider')){\n var amplitude_song_slider_width = document.getElementById('amplitude-song-slider').offsetWidth;\n var amplitude_song_slider_rect = document.getElementById('amplitude-song-slider').getBoundingClientRect();\n var amplitude_evt_obj = window.event ? event : e;\n var amplitude_percentage = ((amplitude_evt_obj.layerX - amplitude_song_slider_rect.left) / amplitude_song_slider_width);\n\n //Sets the song location with the percentage.\n amplitude_set_location(amplitude_percentage);\n }\n}", "function playJump(){\n all_audio[0].play();\n all_audio[0].currentTime = 0;\n}", "function pacSound(){\n //const move = new Audio('pacman_chomp.wav')\n //move.play()\n }", "function toggle() {\n if (sound.playing || !bufferLoaded) {\n sound.stop();\n } else {\n sound.createBuffer().analyze(bins); // recreate buffer again\n sound.start();\n }\n }", "function mouseClicked(){\n mouse_bool = true; \n music_bool = true; \n\n}", "function checkPosition(){\r\n\t\tvar audio = new Audio('sounds/glove.mp3');\r\n\taudio.play();\t\r\n}", "function onAudioPositionChanged(position) { //noLetPlay\n\n audioCurrentTime = position;\n\n// if (_letPlay)\n// {\n// return;\n// }\n\n _skipAudioEnded = false;\n// _skipTTSEnded = false;\n\n if (!_smilIterator || !_smilIterator.currentPar)\n {\n return;\n }\n\n var audio = _smilIterator.currentPar.audio;\n\n //var TOLERANCE = 0.05;\n if(\n //position >= (audio.clipBegin - TOLERANCE) &&\n position > DIRECTION_MARK &&\n position <= audio.clipEnd) {\n\n//console.debug(\"onAudioPositionChanged: \" + position);\n return;\n }\n\n _skipAudioEnded = true;\n\n//console.debug(\"PLAY NEXT: \" + position + \" (\" + audio.clipBegin + \" -- \" + audio.clipEnd + \")\");\n\n var goNext = position > audio.clipEnd;\n if (goNext)\n {\n _smilIterator.next();\n }\n else //position <= DIRECTION_MARK\n {\n _smilIterator.previous();\n }\n\n if(_smilIterator.currentPar) {\n\n if(!_smilIterator.currentPar.audio) {\n pause();\n return;\n }\n\n if(_settings.mediaOverlaysSkipSkippables)\n {\n var skip = false;\n var parent = _smilIterator.currentPar;\n while (parent)\n {\n if (parent.isSkippable && parent.isSkippable(_settings.mediaOverlaysSkippables))\n {\n skip = true;\n break;\n }\n parent = parent.parent;\n }\n\n if (skip)\n {\n console.debug(\"MO SKIP: \" + parent.epubtype);\n\n var pos = goNext ? _smilIterator.currentPar.audio.clipEnd + 0.1 : DIRECTION_MARK - 1;\n\n onAudioPositionChanged(pos); //noLetPlay\n return;\n }\n }\n\n if(_audioPlayer.isPlaying()\n && _smilIterator.currentPar.audio.src\n && _smilIterator.currentPar.audio.src == _audioPlayer.currentSmilSrc()\n && position >= _smilIterator.currentPar.audio.clipBegin\n && position <= _smilIterator.currentPar.audio.clipEnd)\n {\n//console.debug(\"ONLY highlightCurrentElement\");\n highlightCurrentElement();\n return;\n }\n\n //position <= DIRECTION_MARK goes here (goto previous):\n\n// if (!noLetPlay && position > DIRECTION_MARK\n// && _audioPlayer.isPlaying() && _audioPlayer.srcRef() != _smilIterator.currentPar.audio.src)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// playCurrentPar();\n// }, 100);\n//\n// playCurrentPar();\n//\n// return;\n// }\n\n playCurrentPar();\n return;\n }\n//\n// if (!noLetPlay)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// nextSmil(goNext);\n// }, 200);\n// }\n// else\n// {\n// nextSmil(goNext);\n// }\n\n//console.log(\"NEXT SMIL ON AUDIO POS\");\n nextSmil(goNext);\n }", "function audioTriggerLow() {\n if (img.loaded()) {\n // maps the audio amplitude values between 0 and .2 to gif frames\n var frame = int(map(analyzer.getLevel(), 0, .2, 0, .5*img.totalFrames()));\n img.frame(frame);\n }\n}", "function tellJoke(){\n VoiceRSS.speech({\n key: ttsKey,\n src: ttsText,\n hl: 'en-au',\n v: 'Isla',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false \n });\n}", "function onAudioPositionChanged(position, from, skipping) { //noLetPlay\n console.debug('media_overlay_player.js -> onAudioPositionChanged! FROM: ' + from);\n audioCurrentTime = position;\n\n// if (_letPlay)\n// {\n// return;\n// }\n\n _skipAudioEnded = false;\n// _skipTTSEnded = false;\n\n if (!_smilIterator || !_smilIterator.currentPar)\n {\n return;\n }\n\n var parFrom = _smilIterator.currentPar;\n\n var audio = _smilIterator.currentPar.audio;\n\n //var TOLERANCE = 0.05;\n if(\n //position >= (audio.clipBegin - TOLERANCE) &&\n position > DIRECTION_MARK &&\n position <= audio.clipEnd) {\n\n//console.debug(\"onAudioPositionChanged: \" + position);\n return;\n }\n\n _skipAudioEnded = true;\n\n//console.debug(\"PLAY NEXT: \" + \"(\" + audio.clipBegin + \" -- \" + audio.clipEnd + \") [\" + from + \"] \" + position);\n//console.debug(_smilIterator.currentPar.text.srcFragmentId);\n\n var isPlaying = _audioPlayer.isPlaying();\n if (isPlaying && from === 6)\n {\n console.debug(\"from userNav _audioPlayer.isPlaying() ???\");\n }\n\n var goNext = position > audio.clipEnd;\n\n var doNotNextSmil = !_autoNextSmil && from !== 6 && goNext;\n\n var spineItemIdRef = (_smilIterator && _smilIterator.smil && _smilIterator.smil.spineItemId) ? _smilIterator.smil.spineItemId : ((_lastPaginationData && _lastPaginationData.spineItem && _lastPaginationData.spineItem.idref) ? _lastPaginationData.spineItem.idref : undefined);\n if (doNotNextSmil && spineItemIdRef && _lastPaginationData && _lastPaginationData.paginationInfo && _lastPaginationData.paginationInfo.openPages && _lastPaginationData.paginationInfo.openPages.length > 1)\n {\n //var iPage = _lastPaginationData.paginationInfo.isRightToLeft ? _lastPaginationData.paginationInfo.openPages.length - 1 : 0;\n var iPage = 0;\n\n var openPage = _lastPaginationData.paginationInfo.openPages[iPage];\n if (spineItemIdRef === openPage.idref)\n {\n doNotNextSmil = false;\n }\n }\n\n if (goNext)\n {\n _smilIterator.next();\n }\n else //position <= DIRECTION_MARK\n {\n _smilIterator.previous();\n }\n\n if(!_smilIterator.currentPar)\n {\n //\n // if (!noLetPlay)\n // {\n // _letPlay = true;\n // setTimeout(function()\n // {\n // _letPlay = false;\n // nextSmil(goNext);\n // }, 200);\n // }\n // else\n // {\n // nextSmil(goNext);\n // }\n\n//console.debug(\"NEXT SMIL ON AUDIO POS\");\n\n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n return;\n }\n\n//console.debug(\"ITER: \" + _smilIterator.currentPar.text.srcFragmentId);\n\n if(!_smilIterator.currentPar.audio) {\n self.pause();\n return;\n }\n\n if(_settings.mediaOverlaysSkipSkippables)\n {\n var skip = false;\n var parent = _smilIterator.currentPar;\n while (parent)\n {\n if (parent.isSkippable && parent.isSkippable(_settings.mediaOverlaysSkippables))\n {\n skip = true;\n break;\n }\n parent = parent.parent;\n }\n\n if (skip)\n {\n console.log(\"MO SKIP: \" + parent.epubtype);\n\n var pos = goNext ? _smilIterator.currentPar.audio.clipEnd + 0.1 : DIRECTION_MARK - 1;\n\n onAudioPositionChanged(pos, from, true); //noLetPlay\n return;\n }\n }\n\n // _settings.mediaOverlaysSynchronizationGranularity\n if (!isPlaying && (_smilIterator.currentPar.element || _smilIterator.currentPar.cfi && _smilIterator.currentPar.cfi.cfiTextParent))\n {\n var scopeTo = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (scopeTo && scopeTo !== _smilIterator.currentPar)\n {\n var scopeFrom = _elementHighlighter.adjustParToSeqSyncGranularity(parFrom);\n if (scopeFrom && (scopeFrom === scopeTo || !goNext))\n {\n if (scopeFrom === scopeTo)\n {\n do\n {\n if (goNext) _smilIterator.next();\n else _smilIterator.previous();\n } while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(scopeFrom));\n\n if (!_smilIterator.currentPar)\n {\n //console.debug(\"adjustParToSeqSyncGranularity nextSmil(goNext)\");\n\n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n\n return;\n }\n }\n\n//console.debug(\"ADJUSTED: \" + _smilIterator.currentPar.text.srcFragmentId);\n if (!goNext)\n {\n var landed = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (landed && landed !== _smilIterator.currentPar)\n {\n var backup = _smilIterator.currentPar;\n\n var innerPar = undefined;\n do\n {\n innerPar = _smilIterator.currentPar;\n _smilIterator.previous();\n }\n while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(landed));\n\n if (_smilIterator.currentPar)\n {\n _smilIterator.next();\n\n if (!_smilIterator.currentPar.hasAncestor(landed))\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar.hasAncestor(landed) ???\");\n }\n //assert\n }\n else\n {\n//console.debug(\"adjustParToSeqSyncGranularity reached begin\");\n\n _smilIterator.reset();\n\n if (_smilIterator.currentPar !== innerPar)\n {\n console.error(\"adjustParToSeqSyncGranularity _smilIterator.currentPar !=== innerPar???\");\n }\n }\n\n if (!_smilIterator.currentPar)\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar ?????\");\n _smilIterator.goToPar(backup);\n }\n\n//console.debug(\"ADJUSTED PREV: \" + _smilIterator.currentPar.text.srcFragmentId);\n }\n }\n }\n }\n }\n\n if(_audioPlayer.isPlaying()\n && _smilIterator.currentPar.audio.src\n && _smilIterator.currentPar.audio.src == _audioPlayer.currentSmilSrc()\n && position >= _smilIterator.currentPar.audio.clipBegin\n && position <= _smilIterator.currentPar.audio.clipEnd)\n {\n//console.debug(\"ONLY highlightCurrentElement\");\n highlightCurrentElement();\n return;\n }\n\n //position <= DIRECTION_MARK goes here (goto previous):\n\n// if (!noLetPlay && position > DIRECTION_MARK\n// && _audioPlayer.isPlaying() && _audioPlayer.srcRef() != _smilIterator.currentPar.audio.src)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// playCurrentPar();\n// }, 100);\n//\n// playCurrentPar();\n//\n// return;\n// }\n\n playCurrentPar();\n }", "function addHotspots(data, mapSource) {\n addHotspotAudio();\n updateHotspot(map.getCenter().toArray());\n\n map.on(\"move\", function (e) {\n updateHotspot(map.getCenter().toArray());\n });\n\n // Control hotspot with mouse\n // map.on('mousemove', function (e) {\n // updatelHotspot(e.lngLat.toArray();\n // });\n\n // Add audio files that will be controlled by the hotspots\n function addHotspotAudio() {\n data.features.forEach((f, idx) => {\n var fileId = f.properties.link.split(\"/\")[5];\n document.getElementById(\n \"audio\"\n ).innerHTML += `<audio controls loop preload=\"none\" id=\"audio-${idx}\"><source src=\"https://drive.google.com/uc?export=view&id=${fileId}\" type=\"audio/mp3\"></audio>`;\n });\n }\n\n // Update hotspot data based on location\n // Calculate distance from location to each hotspot\n\n function updateHotspot(location) {\n var activeHotspotDistance = 0.1; // Hotspot content becomes active at this distance\n var focusHotspotDistance = 0.01; // Focus is given to the nearest hotspot at this distance\n var maxActiveHotspots = 3;\n\n // Find nearest hotspot to location\n {\n var nearestHotspot = turf.nearest(location, data);\n\n map.removeFeatureState({\n source: mapSource\n });\n map.setFeatureState({\n source: mapSource,\n id: nearestHotspot.properties.featureIndex\n }, {\n nearest: true\n });\n }\n\n var focusHotspot = false;\n var activeHotspots = [];\n\n data.features.forEach((f, idx) => {\n var distance = turf.distance(\n location,\n turf.point(f.geometry.coordinates)\n );\n\n data.features[idx].properties[\"distance\"] = distance;\n\n map.setFeatureState({\n source: audioLayer,\n id: idx\n }, {\n distance: distance,\n active: true, // distance < activeHotspotDistance ? true : false,\n focus: distance < focusHotspotDistance ? true : false\n });\n\n // Play audio of nearby hotspots\n\n if (distance < activeHotspotDistance) {\n // Focus on a single audio for the nearest active hotspot\n // Else play all active with volume scaled by distance\n\n if (distance < focusHotspotDistance) {\n focusHotspot = true;\n\n if (idx == nearestHotspot.properties.featureIndex) {\n // Pause all nearby hostposts to focus on nearest active one\n activeHotspots.forEach(idx =>\n document.getElementById(\"audio-\" + idx).pause()\n );\n\n document.getElementById(\"audio-\" + idx).volume = 1;\n document.getElementById(\"audio-\" + idx).play();\n }\n } else {\n if (!focusHotspot && activeHotspots.length < maxActiveHotspots) {\n activeHotspots.push(idx);\n\n var volume = scaleValue(\n distance,\n [focusHotspotDistance, activeHotspotDistance],\n [0.9, 0]\n );\n document.getElementById(\"audio-\" + idx).volume = volume;\n document.getElementById(\"audio-\" + idx).play();\n } else {\n document.getElementById(\"audio-\" + idx).pause();\n }\n }\n } else {\n document.getElementById(\"audio-\" + idx).pause();\n }\n });\n\n map.getSource(audioLayer).setData(data);\n }\n}", "function togglePlayerMarker() {\n\tviewerPM.toggle();\n}", "toggleAudio() {\n this._audioOnOff = !this._audioOnOff;\n }", "function playMusic() { // Decide whether to play music\n if (music === \"on\") {\n irishAudio.play();\n } else {\n irishAudio.pause();\n }\n}", "onMicrophoneClicked() {\n if (this.microIsOn) {\n this.stopRecognition()\n } else {\n this.startRecognition()\n }\n\n this.microIsOn = !this.microIsOn;\n }", "setAmpLow() {\n this.amp = this.LOAMP;\n }", "start(){\n\t\t//ok\n\t\tsnd_track = new Audio('./snd/soundtrack.mp3'); \n\t\tif (typeof snd_track.loop == 'boolean'){\n\t\t\tsnd_track.loop = true;\n\t\t}\n\t\telse{\n\t\t\tsnd_track.addEventListener('ended', function() {\n\t\t\t\tthis.currentTime = 0;\n\t\t\t\tthis.play();\n\t\t\t}, false);\n\t\t}\n\t\tsnd_track.play();\n\t\tsetTimeout(function(){gradle.hideSplash()}, 2000);\n\t}", "function success(position){\n\t\t\tconsole.log(\"Music is paused: \"+music.paused);\n\t\t\t\n\t\t\tif(!total){\n\t\t\t\ttotalDistance = Math.pow((targetPos.lat - position.coords.latitude),2) + Math.pow((targetPos.lng - position.coords.longitude),2); //represent a 100% percentage of how far away it is\n\t\t\t\ttotal = true;\n\t\t\t\tconsole.log(\"total DIST IS \" + totalDistance);\n\t\t\t}\n\n\t\t\t//if statement about map.zoom\n\t\t\tconsole.log(\"VOLUME SHOULD BE \"+ music.volume);\n\t\t\tif (latitude != position.coords.latitude || longitude != position.coords.longitude ){\n\t\t\t\t\n\t\t\t\tconsole.log(\"~~ Distance Update ~~\");\n\t\t\t\t//console.log(totalDistance);\n\n\t\t\t\t//identifies current location\n\t\t\t\tlatitude = position.coords.latitude;\n\t\t\t\tlongitude = position.coords.longitude;\n\n\t\t\t\t//LAT AND LNG for testing\n\n\t\t\t\t//latitude = 51.066033; //further \n\t\t\t\t//longitude = -114.112939;\n\t\t\t\t\n\t\t\t\t//latitude = 51.052143; //louder\n\t\t\t\t//longitude = -114.075929;\n\t\t\t\t\t\n\t\t\t\t//changes position of marker\n\t\t\t\tcurrentPos.lat = latitude; \n\t\t\t\tcurrentPos.lng = longitude; \t\t\t\t\t\t\n\t\t\t\tmarker3.setPosition(currentPos);\n\t\t\t\tmarker3.setMap(map);\t\n\t\t\t\tmusic.play();\n\t\t\t\t\n\t\t\t\t//change volume of music according to how close you are\n\t\t\t\tdistance = Math.pow((targetPos.lat - latitude),2) + Math.pow((targetPos.lng - longitude),2); //how far away you are now\n\t\t\t\tconsole.log(\"DIST IS \" + distance);\n\t\t\t\tconsole.log(\"TARGET - \"+targetPos.lat);\n\t\t\t\t\t\n\t\t\t\tpercentLeft = 1 - (distance/totalDistance); //percent of the way there in raw distance\n\t\t\t\tconsole.log(\"Percent travelled \"+percentLeft);\n\t\t\t\tif (percentLeft >= 0){\n\t\t\t\t\tmusic.volume = percentLeft;\n\t\t\t\t\tconsole.log(\"NEW VOLUME SHOULD BE \"+ music.volume);\n\t\t\t\t}\n\n\t\t\t\t//console.log(\"Percent there is \"+percentLeft);\n\t\t\t\tconsole.log(\"\");\n\n\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}", "toggleAudio() {\n this.audioOnOff = !this.audioOnOff;\n }", "function toggleAudio(b) {\n if (b == \"true\") {\n localStream.getAudioTracks()[0].enabled = true\n } else {\n localStream.getAudioTracks()[0].enabled = false\n }\n}", "toggleAudio(){\n this._audioOnOff = !this._audioOnOff;\n }", "function toggleInput() {\n if (soundFile.isPlaying() ) {\n soundFile.pause();\n mic.start();\n amplitude.setInput(mic);\n } else {\n soundFile.play();\n mic.stop();\n amplitude.setInput(soundFile);\n }\n}", "function audioSetup() {\n if (script.tapAnimAudio && !audioComponentTap) {\n audioComponentTap = script.getSceneObject().createComponent(\"Component.AudioComponent\");\n audioComponentTap.audioTrack = script.tapAnimAudio;\n }\n}", "play () {\n this.el.sceneEl.addEventListener('jump', this.jump)\n this.el.sceneEl.addEventListener('arc-cursor-secondary-click', this.jump)\n }", "function updateHowlerPosition() {\n\tlet cameraPosition = (new THREE.Vector3(0, 1.6, 0)).add(document.querySelector(\"a-scene\").camera.position);\n\tHowler.pos(cameraPosition.x, cameraPosition.y, cameraPosition.z, radioPlayingSound);\n}", "function playNote(audioID, action) {\n $('#' + audioID).jWebAudio('play');\n\n\tvar sustain = currInstrument == 'marimba' ? 1600 : 6000;\n\tif (action == 'playthrough'){\n \tsetTimeout(function(){\n \t\tstopNote(audioID);\n \t}, sustain);\n\t}\n}", "function touchStarted(){\n song.play();\n}", "playAudio(){\n if(this._audioOnOff){\n this._defaultAudio.currentTime = 0;\n this._defaultAudio.play();\n }\n }", "function emitirAlarma() {\n var audio = new Audio('fire-alarm-short.mp3');\n audio.play();\n}", "playSound() {\n let d = dist(width / 2, height / 2, mouseX, mouseY);\n if (d < defaultSoloSize) {\n (this.sound).play();\n } else {\n (this.sound).stop(); // stop the sound if the user hovers away from the planet\n }\n }", "onSeek() {\n this.log(\"track:seeked\")\n }", "toggleAmp() {\n if (this.isLowAmp()) {\n this.amp = this.HIAMP;\n } else {\n this.amp = this.LOAMP;\n }\n }", "tocarchampan()\n {\n if(this.scene.sonidoactive && this.scene.sigueJugando)\n {\n this.scene.music.pause();\n this.champmusic.play();\n }\n }", "setAudio() {\n this.audioState = true;\n }", "toggleAudio(){\n //this._audioOnOf = !this._audiOnOf;\n\n this._audioOnOf = (this._audioOnOf)? false : true;\n //this.playAudio();\n\n /*if(this._audioOnOf == true){\n this._audioOnOf = false;\n }else{\n this._audioOnOf = true;\n }*/\n }", "disablePositionalAudio(){\n this.positional = false;\n }", "disablePositionalAudio(){\n this.positional = false;\n }", "update(){\n if(this.microphone){\n Howler.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n if(this.positional){\n this.sound.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n }", "update(){\n if(this.microphone){\n Howler.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n if(this.positional){\n this.sound.pos(this.pos.x, this.pos.y, this.pos.z);\n } \n }", "function onClick(event) {\n var pos = new vec2d(event.clientX, event.clientY);\n var coords = \"X coords: \" + pos.x + \", Y coords: \" + pos.y;\n document.getElementById(\"demo\").innerHTML = coords;\n\t//var bleep = new Audio();\n //bleep.src = \"dustyroom_multimedia_positve_correct_complete_ping.mp3\";\n if (!Buttons.map && pos.dist(new vec2d(center_w - 240, center_h + 260)) < 40) {\n \tButtons.map = true;\n \tButtons.engi = false;\n \tunactivate_butts(ctx);\n \tdraw_map_butt(ctx, true);\n\t //bleep.play();\n }\n else if (!Buttons.engi && center_w-350<pos.x && pos.x<center_w-300 && center_h+213<pos.y && pos.y<center_h+300) {\n \tButtons.engi = true;\n \tButtons.map = false;\n \tunactivate_butts(ctx);\n \tdraw_engi_butt(ctx, true);\n\t //bleep.play();\n }\n}", "function playMusic() {\n if (musicOn) {\n music.pause();\n musicOn = false;\n $musicBtn.html('<i class=\"fas fa-volume-off\"></i>');\n } else {\n music.play();\n musicOn = true;\n $musicBtn.html('<i class=\"fas fa-volume-up\"></i>');\n }\n }", "function toggleTravelSmall() { //Sound function for the travel icon\n var travelAudio = travels[Math.floor(Math.random() * travels.length)]; //Got a random audio file from travels-array\n sourcesTravelSmall.setAttribute(\"src\", travelAudio); //Adds random travels audio to the src attribute in index.html\n \n if (travelSoundSmall.paused) {\n travelSoundSmall.load();\n travelSoundSmall.play(); //If sound is playing, add stop icon and remove the travel icon\n travelIconSmall.classList.add('fa-stop');\n travelIconSmall.classList.remove('fa-subway');\n } else {\n travelSoundSmall.pause(); //If sound is on pause method, add the travel icon and remove the stop icon\n travelIconSmall.classList.add('fa-subway');\n travelIconSmall.classList.remove('fa-stop');\n }\n}", "function onAudioPositionChanged(position, from, skipping) { //noLetPlay\n\n audioCurrentTime = position;\n\n// if (_letPlay)\n// {\n// return;\n// }\n\n _skipAudioEnded = false;\n// _skipTTSEnded = false;\n\n if (!_smilIterator || !_smilIterator.currentPar)\n {\n return;\n }\n\n var parFrom = _smilIterator.currentPar;\n \n var audio = _smilIterator.currentPar.audio;\n\n //var TOLERANCE = 0.05;\n if(\n //position >= (audio.clipBegin - TOLERANCE) &&\n position > DIRECTION_MARK &&\n position <= audio.clipEnd) {\n\n//console.debug(\"onAudioPositionChanged: \" + position);\n return;\n }\n\n _skipAudioEnded = true;\n\n//console.debug(\"PLAY NEXT: \" + \"(\" + audio.clipBegin + \" -- \" + audio.clipEnd + \") [\" + from + \"] \" + position);\n//console.debug(_smilIterator.currentPar.text.srcFragmentId);\n\n var isPlaying = _audioPlayer.isPlaying();\n if (isPlaying && from === 6)\n {\n console.debug(\"from userNav _audioPlayer.isPlaying() ???\");\n }\n\n var goNext = position > audio.clipEnd;\n\n var doNotNextSmil = !_autoNextSmil && from !== 6 && goNext;\n\n var spineItemIdRef = (_smilIterator && _smilIterator.smil && _smilIterator.smil.spineItemId) ? _smilIterator.smil.spineItemId : ((_lastPaginationData && _lastPaginationData.spineItem && _lastPaginationData.spineItem.idref) ? _lastPaginationData.spineItem.idref : undefined);\n if (doNotNextSmil && spineItemIdRef && _lastPaginationData && _lastPaginationData.paginationInfo && _lastPaginationData.paginationInfo.openPages && _lastPaginationData.paginationInfo.openPages.length > 1)\n {\n //var iPage = _lastPaginationData.paginationInfo.isRightToLeft ? _lastPaginationData.paginationInfo.openPages.length - 1 : 0;\n var iPage = 0;\n \n var openPage = _lastPaginationData.paginationInfo.openPages[iPage];\n if (spineItemIdRef === openPage.idref)\n {\n doNotNextSmil = false;\n }\n }\n \n if (goNext)\n {\n _smilIterator.next();\n }\n else //position <= DIRECTION_MARK\n {\n _smilIterator.previous();\n }\n\n if(!_smilIterator.currentPar)\n {\n //\n // if (!noLetPlay)\n // {\n // _letPlay = true;\n // setTimeout(function()\n // {\n // _letPlay = false;\n // nextSmil(goNext);\n // }, 200);\n // }\n // else\n // {\n // nextSmil(goNext);\n // }\n\n//console.debug(\"NEXT SMIL ON AUDIO POS\");\n \n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n return;\n }\n\n//console.debug(\"ITER: \" + _smilIterator.currentPar.text.srcFragmentId);\n\n if(!_smilIterator.currentPar.audio) {\n self.pause();\n return;\n }\n \n if(_settings.mediaOverlaysSkipSkippables)\n {\n var skip = false;\n var parent = _smilIterator.currentPar;\n while (parent)\n {\n if (parent.isSkippable && parent.isSkippable(_settings.mediaOverlaysSkippables))\n {\n skip = true;\n break;\n }\n parent = parent.parent;\n }\n\n if (skip)\n {\n console.log(\"MO SKIP: \" + parent.epubtype);\n\n self.pause();\n\n var pos = goNext ? _smilIterator.currentPar.audio.clipEnd + 0.1 : DIRECTION_MARK - 1;\n\n onAudioPositionChanged(pos, from, true); //noLetPlay\n return;\n }\n }\n\n // _settings.mediaOverlaysSynchronizationGranularity\n if (!isPlaying && (_smilIterator.currentPar.element || _smilIterator.currentPar.cfi && _smilIterator.currentPar.cfi.cfiTextParent))\n {\n var scopeTo = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (scopeTo && scopeTo !== _smilIterator.currentPar)\n {\n var scopeFrom = _elementHighlighter.adjustParToSeqSyncGranularity(parFrom);\n if (scopeFrom && (scopeFrom === scopeTo || !goNext))\n {\n if (scopeFrom === scopeTo)\n {\n do\n {\n if (goNext) _smilIterator.next();\n else _smilIterator.previous();\n } while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(scopeFrom));\n\n if (!_smilIterator.currentPar)\n {\n //console.debug(\"adjustParToSeqSyncGranularity nextSmil(goNext)\");\n\n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n \n return;\n }\n }\n \n//console.debug(\"ADJUSTED: \" + _smilIterator.currentPar.text.srcFragmentId);\n if (!goNext)\n {\n var landed = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (landed && landed !== _smilIterator.currentPar)\n {\n var backup = _smilIterator.currentPar;\n \n var innerPar = undefined;\n do\n {\n innerPar = _smilIterator.currentPar;\n _smilIterator.previous();\n }\n while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(landed));\n \n if (_smilIterator.currentPar)\n {\n _smilIterator.next();\n \n if (!_smilIterator.currentPar.hasAncestor(landed))\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar.hasAncestor(landed) ???\");\n }\n //assert \n }\n else\n {\n//console.debug(\"adjustParToSeqSyncGranularity reached begin\");\n\n _smilIterator.reset();\n \n if (_smilIterator.currentPar !== innerPar)\n {\n console.error(\"adjustParToSeqSyncGranularity _smilIterator.currentPar !=== innerPar???\");\n }\n }\n\n if (!_smilIterator.currentPar)\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar ?????\");\n _smilIterator.goToPar(backup);\n }\n \n//console.debug(\"ADJUSTED PREV: \" + _smilIterator.currentPar.text.srcFragmentId);\n }\n }\n }\n }\n }\n \n if(_audioPlayer.isPlaying()\n && _smilIterator.currentPar.audio.src\n && _smilIterator.currentPar.audio.src == _audioPlayer.currentSmilSrc()\n && position >= _smilIterator.currentPar.audio.clipBegin\n && position <= _smilIterator.currentPar.audio.clipEnd)\n {\n//console.debug(\"ONLY highlightCurrentElement\");\n highlightCurrentElement();\n return;\n }\n\n //position <= DIRECTION_MARK goes here (goto previous):\n\n// if (!noLetPlay && position > DIRECTION_MARK\n// && _audioPlayer.isPlaying() && _audioPlayer.srcRef() != _smilIterator.currentPar.audio.src)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// playCurrentPar();\n// }, 100);\n//\n// playCurrentPar();\n//\n// return;\n// }\n\n playCurrentPar();\n }", "function onAudioPositionChanged(position, from, skipping) { //noLetPlay\n\n audioCurrentTime = position;\n\n// if (_letPlay)\n// {\n// return;\n// }\n\n _skipAudioEnded = false;\n// _skipTTSEnded = false;\n\n if (!_smilIterator || !_smilIterator.currentPar)\n {\n return;\n }\n\n var parFrom = _smilIterator.currentPar;\n \n var audio = _smilIterator.currentPar.audio;\n\n //var TOLERANCE = 0.05;\n if(\n //position >= (audio.clipBegin - TOLERANCE) &&\n position > DIRECTION_MARK &&\n position <= audio.clipEnd) {\n\n//console.debug(\"onAudioPositionChanged: \" + position);\n return;\n }\n\n _skipAudioEnded = true;\n\n//console.debug(\"PLAY NEXT: \" + \"(\" + audio.clipBegin + \" -- \" + audio.clipEnd + \") [\" + from + \"] \" + position);\n//console.debug(_smilIterator.currentPar.text.srcFragmentId);\n\n var isPlaying = _audioPlayer.isPlaying();\n if (isPlaying && from === 6)\n {\n console.debug(\"from userNav _audioPlayer.isPlaying() ???\");\n }\n\n var goNext = position > audio.clipEnd;\n\n var doNotNextSmil = !_autoNextSmil && from !== 6 && goNext;\n\n var spineItemIdRef = (_smilIterator && _smilIterator.smil && _smilIterator.smil.spineItemId) ? _smilIterator.smil.spineItemId : ((_lastPaginationData && _lastPaginationData.spineItem && _lastPaginationData.spineItem.idref) ? _lastPaginationData.spineItem.idref : undefined);\n if (doNotNextSmil && spineItemIdRef && _lastPaginationData && _lastPaginationData.paginationInfo && _lastPaginationData.paginationInfo.openPages && _lastPaginationData.paginationInfo.openPages.length > 1)\n {\n //var iPage = _lastPaginationData.paginationInfo.isRightToLeft ? _lastPaginationData.paginationInfo.openPages.length - 1 : 0;\n var iPage = 0;\n \n var openPage = _lastPaginationData.paginationInfo.openPages[iPage];\n if (spineItemIdRef === openPage.idref)\n {\n doNotNextSmil = false;\n }\n }\n \n if (goNext)\n {\n _smilIterator.next();\n }\n else //position <= DIRECTION_MARK\n {\n _smilIterator.previous();\n }\n\n if(!_smilIterator.currentPar)\n {\n //\n // if (!noLetPlay)\n // {\n // _letPlay = true;\n // setTimeout(function()\n // {\n // _letPlay = false;\n // nextSmil(goNext);\n // }, 200);\n // }\n // else\n // {\n // nextSmil(goNext);\n // }\n\n//console.debug(\"NEXT SMIL ON AUDIO POS\");\n \n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n return;\n }\n\n//console.debug(\"ITER: \" + _smilIterator.currentPar.text.srcFragmentId);\n\n if(!_smilIterator.currentPar.audio) {\n self.pause();\n return;\n }\n \n if(_settings.mediaOverlaysSkipSkippables)\n {\n var skip = false;\n var parent = _smilIterator.currentPar;\n while (parent)\n {\n if (parent.isSkippable && parent.isSkippable(_settings.mediaOverlaysSkippables))\n {\n skip = true;\n break;\n }\n parent = parent.parent;\n }\n\n if (skip)\n {\n console.log(\"MO SKIP: \" + parent.epubtype);\n\n self.pause();\n\n var pos = goNext ? _smilIterator.currentPar.audio.clipEnd + 0.1 : DIRECTION_MARK - 1;\n\n onAudioPositionChanged(pos, from, true); //noLetPlay\n return;\n }\n }\n\n // _settings.mediaOverlaysSynchronizationGranularity\n if (!isPlaying && (_smilIterator.currentPar.element || _smilIterator.currentPar.cfi && _smilIterator.currentPar.cfi.cfiTextParent))\n {\n var scopeTo = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (scopeTo && scopeTo !== _smilIterator.currentPar)\n {\n var scopeFrom = _elementHighlighter.adjustParToSeqSyncGranularity(parFrom);\n if (scopeFrom && (scopeFrom === scopeTo || !goNext))\n {\n if (scopeFrom === scopeTo)\n {\n do\n {\n if (goNext) _smilIterator.next();\n else _smilIterator.previous();\n } while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(scopeFrom));\n\n if (!_smilIterator.currentPar)\n {\n //console.debug(\"adjustParToSeqSyncGranularity nextSmil(goNext)\");\n\n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n \n return;\n }\n }\n \n//console.debug(\"ADJUSTED: \" + _smilIterator.currentPar.text.srcFragmentId);\n if (!goNext)\n {\n var landed = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (landed && landed !== _smilIterator.currentPar)\n {\n var backup = _smilIterator.currentPar;\n \n var innerPar = undefined;\n do\n {\n innerPar = _smilIterator.currentPar;\n _smilIterator.previous();\n }\n while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(landed));\n \n if (_smilIterator.currentPar)\n {\n _smilIterator.next();\n \n if (!_smilIterator.currentPar.hasAncestor(landed))\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar.hasAncestor(landed) ???\");\n }\n //assert \n }\n else\n {\n//console.debug(\"adjustParToSeqSyncGranularity reached begin\");\n\n _smilIterator.reset();\n \n if (_smilIterator.currentPar !== innerPar)\n {\n console.error(\"adjustParToSeqSyncGranularity _smilIterator.currentPar !=== innerPar???\");\n }\n }\n\n if (!_smilIterator.currentPar)\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar ?????\");\n _smilIterator.goToPar(backup);\n }\n \n//console.debug(\"ADJUSTED PREV: \" + _smilIterator.currentPar.text.srcFragmentId);\n }\n }\n }\n }\n }\n \n if(_audioPlayer.isPlaying()\n && _smilIterator.currentPar.audio.src\n && _smilIterator.currentPar.audio.src == _audioPlayer.currentSmilSrc()\n && position >= _smilIterator.currentPar.audio.clipBegin\n && position <= _smilIterator.currentPar.audio.clipEnd)\n {\n//console.debug(\"ONLY highlightCurrentElement\");\n highlightCurrentElement();\n return;\n }\n\n //position <= DIRECTION_MARK goes here (goto previous):\n\n// if (!noLetPlay && position > DIRECTION_MARK\n// && _audioPlayer.isPlaying() && _audioPlayer.srcRef() != _smilIterator.currentPar.audio.src)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// playCurrentPar();\n// }, 100);\n//\n// playCurrentPar();\n//\n// return;\n// }\n\n playCurrentPar();\n }", "function toggleAudio() {\n myStreamRef.current.getAudioTracks()[0].enabled = !audioState\n setAudioState(prev => { return !prev })\n }", "noteOn(velocity=60) {\n this.keyRect.fill(this.displayOptions.clickColor);\n grid.highlightPitch(this.pitch, true, this.displayOptions);\n audio.noteOn(this.pitch, velocity)\n }", "function playBGMNearShore (event) {\n bgmNearShore.currentTime = 0;\n $(bgmNearShore).each(function(){this.play(); $(this).animate({volume:1},1000)});\n }", "startTracking() {\n this.location$.subscribe(position => {\n if (position) {\n this.setState({\n setDefaultMapCenter: false,\n ignoreCenterChange: false,\n markers: this.state.markers.concat([{\n position: {lat: position.coords.latitude, lng: position.coords.longitude},\n key: position.timestamp,\n }]),\n center: {lat: position.coords.latitude, lng: position.coords.longitude}\n });\n } else {\n this.setState({\n setDefaultMapCenter: true,\n markers: [{position: defaultMapCenter, key: new Date().getTime()}]\n });\n }\n });\n }", "adjustMarkerScaleBasedOnMusic(level) {\n const markers = document.querySelectorAll('.marker_scale_wpr');\n markers.forEach((marker) => {\n if (marker.classList.contains('active') && this.state.audioPlaying) { \n marker.style.transform = `scale(${1 + level * 1})`;\n } else {\n marker.style.transform = `scale(1)`;\n }\n });\n }", "function setupAudio()\n {\n\n\n // change has begun to true\n groovebox[\"isBegun\"] = true;\n\n\n // start oscilloscope\n oscilloscope();\n\n\n }", "play() {\n this.osc1.frequency.setValueAtTime(\n this.getOsc1Freq(), this.context.currentTime);\n this.osc2.frequency.setValueAtTime(\n this.getOsc2Freq(), this.context.currentTime);\n this.osc1Gain.gain.value = 1.0;\n if (this.audioData.toggles.toggleOsc2.position) {\n this.osc2Gain.gain.value = 1.0;\n }\n }", "function toggleTravelBig() { //Sound function for the travel icon\n var travelAudio = travels[Math.floor(Math.random() * travels.length)]; //Got a random audio file from travels-array\n sourcesTravelBig.setAttribute(\"src\", travelAudio); //Adds random travels audio to the src attribute in index.html\n \n if (travelSoundBig.paused) { \n travelSoundBig.load();\n travelSoundBig.play(); //If sound is playing, add stop icon and remove the travel icon\n travelIconBig.classList.add('fa-stop'); \n travelIconBig.classList.remove('fa-subway');\n } else {\n travelSoundBig.pause(); //If sound is on pause method, add the travel icon and remove the stop icon\n travelIconBig.classList.add('fa-subway');\n travelIconBig.classList.remove('fa-stop');\n }\n}", "function trackPlayback(pos, linkage, auto) {\n\tvar assocData;\n\t$(\"#stream\").empty();\n\tif (linkage === \"inc\") { \n\t\tassocData = trackData[1][pos]; \n\t\tview = \"inc\";\n\t}\n\telse { \n\t\tassocData = favData[1][pos]; \n\t\tview = \"fav\";\n\t}\n\tcurrent = inBounds(parseInt(pos), viewlength);\n\tbuffered = 0;\n\tbuffTimer = setTimeout(tShift, 500);\n\t// Set audio tag HTML for background, allowing tracks to continue playing while popup is closed\n\t$(\"#stream\").html(\"<audio id=\\\"playing\\\" name=\\\"playing\\\" src=\\\"\" + assocData + \"?client_id=2b161e5544f1f7f4cab5ff3c76c6c7b8\\\" preload=\\\"auto\\\"></audio>\");\n\t$(\"#playing\")[0].addEventListener('ended', function () { endPlayback(\"next\"); }, false);\n\t$(\"#playing\").bind('timeupdate', tShift);\n\tif (auto) {\n\t\tautoplay = 1;\n\t}\n}", "function setLocation(percentage){\n activeSong.currentTime = activeSong.duration * percentage;\n}", "function touchStarted() {\n\n\tif (p) {\n\n\t\t//beat.stop();\n\t\tosc.stop();\n \tp = false;\n\t} else {\n\t\t//beat.play();\n\t\tosc.start();\n\t\t//beat.loop();\n\t\t//osc.amp(0.1, 0.5);\n\t\tp = true;\n\n\t}\n\n\tif (beat.isLooping()) {\n\t\tbeat.stop();\n\t\t//beat.disconnect()\n\t} else {\n\t\t//beat.connect()\n\t\t//beat.play();\n\t\tbeat.loop();\n\t}\n\n\treturn false;\n\n}", "function soundOn()\r\n{\r\n $('#soundBackground').trigger('play');\r\n $('#optionsSoundOff').show();\r\n $('#optionsSoundOn').hide();\r\n}", "function switchSound() {\n if (state) {\n buzzer.writeSync(1);\n state = true;\n } else {\n buzzer.writeSync(0);\n state = false;\n }\n}", "function start () {\n playButton.classList.add('d-none')\n stopButton.classList.remove('d-none')\n\n gain.connect(audioContext.destination)\n}", "function changeMusic(lastLocation, newLocation) {\n\n function fadeSwitch(file){\n var turnDown = setInterval(function() {\n if (mapMusic.volume > 0.05) {\n mapMusic.volume -= 0.05;\n }\n }, 100);\n setTimeout(function(){\n clearInterval(turnDown);\n mapMusic.pause();\n mapMusic = new Audio(\"music/\" + file);\n if (mute) { mapMusic.muted = true };\n mapMusic.volume = 0.25;\n mapMusic.loop = true;\n mapMusic.play();\n }, 500);\n }\n\n switch (newLocation) {\n case \"ashHouse1\":\n case \"rivalHouse\":\n case \"oakLab\":\n doorSound.play();\n break;\n case \"pallet\":\n if (lastLocation === \"route1\" || lastLocation === \"finalFourLair\") {\n fadeSwitch(\"pallet.mp3\");\n } else {\n doorSound.play();\n }\n break;\n case \"route1\":\n fadeSwitch(\"route1.mp3\");\n break;\n case \"finalFourLair\":\n fadeSwitch(\"final-four-lair.mp3\");\n break;\n case \"wildPokemonFight\":\n fadeSwitch(\"wild-pokemon.mp3\");\n break;\n case \"normalTrainerFight\":\n fadeSwitch(\"vs-trainer.mp3\");\n break;\n case \"finalFourFight\":\n fadeSwitch(\"final-four.mp3\");\n break;\n case \"winScreen\":\n fadeSwitch(\"hall-of-fame.mp3\");\n break;\n default:\n }\n}", "function startWindSounds()\r\n{\r\n\tplaySound('Wind_Sounds/'+windAheadSound, 'custom', RELATIVE_VOLUMES[1], true, none);\r\n\tplaySound('Wind_Sounds/'+leftWindSound, 'secondary', RELATIVE_VOLUMES[1], true, none);\r\n\tplaySound('Wind_Sounds/'+rightWindSound, 'tertiary', RELATIVE_VOLUMES[1], true, none);\r\n}", "function trackPlayPause() {\n // Can't play/pause no song !\n if (!opened) {\n return;\n }\n\n playing ^= true;\n if (playing) {\n console.log(\"track play\");\n audioPlay();\n }\n else {\n console.log(\"track pause\");\n audioPause();\n }\n}", "setMicrophoneIconOn() {\n $('#speak-button').html('<i class=\"fa fa-fw fa-microphone\"></i>')\n $('#speak-hint').show();\n }", "function roundOver(currentWorm)\r\n{\r\n\tyMarker = 0;\r\n\tif(winningWorm == 0) \r\n\t\tplaySound(\"red\");\r\n\telse if(winningWorm == 1) \r\n\t\tplaySound(\"blue\");\r\n\telse if(winningWorm == 2) \r\n\t\tplaySound(\"green\");\r\n\telse if(winningWorm == 3) \r\n\t\tplaySound(\"purple\");\r\n\telse if(winningWorm == 4) \r\n\t\tplaySound(\"cyan\");\r\n\telse if(winningWorm == 5) \r\n\t\tplaySound(\"yellow\");\r\n\tstart();\r\n}", "function keepWaveHitPositve(){\n if(waveHit < 0){\n waveHit = 0;\n }\n}", "play() {\n this.audioController(true);\n }", "function toggleSound() {\n if (sound === true) {\n myAudio.pause();\n sound = false;//soundtrack is paused\n } else {\n myAudio.play();\n sound = true;//soundtrack is playing\n }\n}", "salicionar(){\n \tthis.sonidofueramapa = game.add.audio('salirse.mp3');\n \tthis.sonidofueramapa.play();\n }", "function playSound() {\n // play the source now\n soundSource.noteOn(context.currentTime);\n }", "function start(){\n //Add a track\n var track = media.addTrack( \"Track1\" );\n //Add more tracks...\n media.addTrack( \"Track\" + Math.random() );\n media.addTrack( \"Track\" + Math.random() );\n\n //Add a track event\n var event = track.addTrackEvent({\n type: \"text\",\n popcornOptions: {\n start: 0,\n end: 3,\n text: \"This is some text here.... Isn't it nice?\",\n target: \"Right1\"\n }\n });\n var superevent = track.addTrackEvent({\n type: \"supertext\",\n popcornOptions: {\n start: 5,\n end: 10,\n text: \"SUPER\",\n target: \"Right2\",\n defaultTransition: 600\n }\n });\n var superevent2 = butter.tracks[ 1 ].addTrackEvent({\n type: \"supertext\",\n popcornOptions: {\n start: 5,\n end: 10,\n text: \"SUPERrrrrrrr\",\n }\n });\n\n //Try uncommenting and see what happens....\n /*\n //Add a track event to the third track\n butter.tracks[ 2 ].addTrackEvent({ \n type: \"footnote\",\n popcornOptions: {\n start: 1,\n end: 2,\n text: \"More text!!!!\"\n target: \"Bottom\"\n }\n });\n */\n\n } //start", "function playEarthMusic() {\n let song = document.getElementById(\"earth-sound\");\n song.play();\n }", "function initMap() {\r\n // get json w sounds info\r\n $.when(promise).then(function(jsonResp){\r\n soundsInfoFromFile = jsonResp;\r\n initSoundsInfoFromFile();\r\n\r\n //map\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: CENTER,\r\n restriction:{\r\n latLngBounds: BOUNDS,\r\n strictBounds: false,\r\n },\r\n zoom: 17,\r\n disableDefaultUI: true,\r\n mapTypeId: 'hybrid'\r\n });\r\n\r\n initSoundMarkers();\r\n\r\n // map markers\r\n var iconColor = \"f55442\";\r\n var iconScale = \"0.75\";\r\n var greenIconSrc = \"https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png&text=A&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48&scale=1&\";\r\n var iconSrc = \"https://www.google.com/maps/vt/icon/name=assets/icons/spotlight/spotlight_pin_v2_shadow-1-small.png,assets/icons/spotlight/spotlight_pin_v2-1-small.png,assets/icons/spotlight/spotlight_pin_v2_dot-1-small.png,assets/icons/spotlight/spotlight_pin_v2_accent-1-small.png&highlight=ff000000,ea4335,960a0a,ff000000&color=ff000000?scale=2&scale=\"+iconScale;\r\n var pinletIconSrc = \"https://www.google.com/maps/vt/icon/name=assets/icons/poi/tactile/pinlet_shadow-1-small.png,assets/icons/poi/tactile/pinlet_outline_v2-1-small.png,assets/icons/poi/tactile/pinlet-1-small.png,assets/icons/poi/quantum/pinlet/dot_pinlet-1-small.png&highlight=ff000000,ffffff,\" + iconColor + \",ffffff&color=ff000000?scale=\"+iconScale;\r\n var soundIcon = \"https://upload.wikimedia.org/wikipedia/commons/2/21/Speaker_Icon.svg\";\r\n var soundIcon2 = \"https://downloadfreesvgicons.com/icons/music-and-sound-icons/svg-sound-level-icon-1/svg-sound-level-icon-1.svg\"\r\n var scale = 20;\r\n var icon = {\r\n url: soundIcon2,\r\n scaledSize: new google.maps.Size(scale, scale), // scaled size\r\n origin: new google.maps.Point(0,0), // origin\r\n anchor: new google.maps.Point(0, 0) // anchor\r\n };\r\n for (var i=0; i < SOUND_MARKERS.length; i++){\r\n var s = SOUND_MARKERS[i];\r\n var mark = new google.maps.Marker({\r\n position: s.position,\r\n map: map,\r\n title: s.title,\r\n icon: icon\r\n });\r\n MAP_MARKERS.push(mark);\r\n // console.log(\"new marker\", mark);\r\n }\r\n hideMarkers(map);\r\n console.log(\"map markers\", MAP_MARKERS)\r\n\r\n // add update function\r\n google.maps.event.addListenerOnce(map, 'idle', function () {\r\n // map is ready\r\n// setTimeout(function() {\r\n google.maps.event.addListener(map, 'bounds_changed', function() {\r\n if (!started) return;\r\n var bounds = map.getBounds();\r\n var ne = bounds.getNorthEast();\r\n var sw = bounds.getSouthWest();\r\n updateSounds(bounds);\r\n });\r\n// }, 2000);\r\n });\r\n\r\n // check for marker in focus when user stops moving\r\n google.maps.event.addListener(map, 'idle', function () {\r\n // var c = map.getCenter();\r\n console.log(\"idle\");\r\n displayDescrip();\r\n });\r\n });\r\n}", "function pinstripleHintReveal(el){\r\n\t\tel.src = \"images/blank.png\";\r\n\tvar audio = new Audio('sounds/whoosh.mp3');\r\n\taudio.play();\t\r\n\tif (document.getElementById('ball3a').src.match(\"images/blank.png\") && document.getElementById('ball4a').src.match(\"images/blank.png\")){\r\n\t\tdocument.getElementById('ball3a').src = \"images/pinstripes/pinstripe.png\"\r\n\t\tdocument.getElementById('ball4a').src = \"images/pinstripes/pinstripe.png\"\r\n\t\tdocument.getElementById('ball3a').classList.remove(\"hint-size\");\r\n\t\tdocument.getElementById('ball3a').classList.add(\"make-small\");\r\n\t\tdocument.getElementById('ball4a').classList.remove(\"hint-size\");\r\n\t\tdocument.getElementById('ball4a').classList.add(\"make-small\");\r\n\t\tvar audio = new Audio('sounds/batcrack.wav');\r\n\taudio.play();\r\n\t} \r\n\telse {\r\n\t}\r\n}", "function setMyAudioStatus(status) {\n myAudioStatusIcon.className = \"fas fa-microphone\" + (status ? \"\" : \"-slash\");\n // send my audio status to all peers in the room\n sendStatus(\"audio\", status);\n tippy(myAudioStatusIcon, { content: status ? \"My audio is On\" : \"My audio is Off\", });\n tippy(audioBtn, { content: status ? \"Off\" : \"On\", placement: \"right-start\", });\n}", "beat() {\n gainNode.gain.value = .4; // sets audio to 40% volume\n _playController.classList.add('hit-effect'); // applies visual beat display\n _playController.style.borderWidth = '8px'; // applies visual beat display\n\n // Determines length of time to play each beat sound - in this case being 100 milliseconds\n window.setTimeout(function() {\n // set audio to zero(inaudible) to end beat sound and prevents audio clipping\n\n gainNode.gain.value = 0;\n\n // removes visual effect to replicate pulse\n _playController.classList.remove('hit-effect');\n _playController.style.borderWidth = '0px';\n }, 100);\n }", "startSound() {\n\t\t//nghien cuu them \n\t\tlet audioSound = '';\n\t\t// console.log(audioSound);\n\t\taudioSound = this.mySound.start();\n\t\tlet bat = document.querySelector('#bat');\n\t\tlet tat = document.querySelector('#tat');\n\t\ttat.addEventListener(\"click\", () => {\n\t\t\tif (this.anHien === true) {\n\t\t\t\tbat.style.display = 'block';\n\t\t\t\ttat.style.display = 'none';\n\t\t\t\tthis.anHien = false;\n\t\t\t\taudioSound = this.mySound.stop();\n\t\t\t\t// console.log('da ket noi');\n\t\t\t}\n\t\t});\n\t\tbat.addEventListener('click', () => {\n\t\t\tif (this.anHien === false) {\n\t\t\t\ttat.style.display = 'block';\n\t\t\t\tbat.style.display = 'none';\n\t\t\t\tthis.anHien = true;\n\t\t\t\taudioSound = this.mySound.start();\n\n\t\t\t}\n\t\t});\n\t}", "function checkFlagpole()\n{\n var d = abs(gameChar_world_x - flagpole.x_pos);\n if(d < 15)\n {\n if(!isLevelCompleteSoundPlaying){\n isLevelCompleteSoundPlaying = true;\n levelCompleteSound.setVolume(0.2);\n levelCompleteSound.play();\n } \n flagpole.isReached = true;\n }\n \n}", "playMusic() {// Load the sound and play it automatically once ready\n // Adding a Continous Sound (we can play it only once with setInterval(() => sound.play(), 3000);)\n this.music = new BABYLON.Sound(\"sound\", \"https://mainline.i3s.unice.fr/mooc/SkywardBound/assets/sounds/humbug.mp3\", \n this.scene,null, { loop: true, autoplay: true });\n \n }", "function jumpSong() {\n let len = song.duration();\n background(random(255),random(255),random(255));\n let ran = random(len);\n song.jump(ran);\n}", "function talk() {\n\tif (assistant.recognizing == false) {\n\t\tassistant.recognition.start();\n\t\tassistant.recognizing = true;\n\t\t// document.getElementById('talk').innerHTML = 'talk';\n\t\t$('.mic').addClass('is-animated');\n\t\ttalk_status = true;\n\t}\n}", "function continueListening() {\n if (micOn.classList.contains('visible')) {\n recognition.start();\n }\n}", "static toggleMic () {\n debug('toggleMic');\n\n if (this.vaani.isSpeaking || this.vaani.isListening) {\n this.vaani.cancel();\n\n AppStore.state.standingBy.text = '';\n\n TalkieActions.setActiveAnimation('none');\n TalkieActions.setMode('none');\n\n return;\n }\n\n this.greetUser();\n }", "function msgFromOneNotification() {\n var audio = new Audio('http://www.flan4u.com/downloads/Wave-files/sound-effects/ADJUST.WAV');\n audio.play();\n}", "_playInfoSound() {\n this._audio.warning[0].pause();\n this._audio.error[0].pause();\n\n if (!this._isMuted) {\n ScadaUtils.playSound(this._audio.info);\n }\n }", "function soundChange(){\n\tif (mode){\n\t\tmode=false;\n\t}else{\n\t\tmode=true;\n\t}\n}", "function _FrontTOF(data) \n{\n misty.Debug(data.PropertyTestResults[0].PropertyParent.DistanceInMeters);\n misty.Stop();\n misty.ChangeLED(255, 0, 0);\n misty.PlayAudio(\"<audio_file_with_extension>\");\n}", "function manipulateaudio(){\n if(cameraaudio){\n cameraaudio = !cameraaudio;\n buttonOff(document.querySelector('.app__system--button.mic'));\n camerastream.getAudioTracks()[0].enabled = cameraaudio;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldAudioProducers();\n let audioProducer = mediasouproom.createProducer(camerastream.getAudioTracks()[0]);\n audioProducer.send(sendTransport);\n updateaudio();\n }\n}", "function amplitude_play(id){\n if(typeof amplitude_config != 'undefined'){\n if(typeof amplitude_config.amplitude_before_play_callback != 'undefined'){\n var amplitude_before_play_callback_function = window[amplitude_config.amplitude_before_play_callback];\n amplitude_before_play_callback_function();\n }\n }\n if (amplitude_active_song != null && !amplitude_active_song.paused) {\n amplitude_stop_song();\n }\n\n //Sets the active song to the song being played. All other functions depend on this.\n amplitude_active_song = document.getElementById(id);\n\n if(typeof amplitude_config != 'undefined'){\n if(typeof amplitude_config.amplitude_live != 'undefined'){\n if(amplitude_config.amplitude_live == true){\n amplitude_reconnect_stream();\n }\n }\n }\n //Plays the song defined in the audio tag.\n amplitude_active_song.play();\n\n if(document.getElementById('amplitude-volume-meter')){\n //Calculates the starting percentage of volume of the song.\n var amplitude_percentage_of_volume = amplitude_volume;\n var amplitude_percentage_of_volume_meter = document.getElementById('amplitude-volume-meter').offsetWidth * amplitude_percentage_of_volume;\n\n \n amplitude_active_song.volume = amplitude_volume;\n\n //Fills out the volume status bar.\n document.getElementById('amplitude-volume-status').style.width = Math.round(amplitude_percentage_of_volume_meter) + \"px\";\n\n if(document.getElementById('amplitude-volume-status-tracker')){\n document.getElementById('amplitude-volume-status-tracker').style.marginLeft = Math.round(amplitude_percentage_of_volume_meter) + \"px\";\n }\n }\n if (amplitude_active_song.getAttribute(\"amplitude-audio-type\") == 'song') {\n amplitude_set_song_info();\n }\n if(amplitude_active_song.getAttribute('amplitude-visual-element-id') != ''){\n if(document.getElementById(amplitude_active_song.getAttribute('amplitude-visual-element-id'))){\n document.getElementById(amplitude_active_song.getAttribute('amplitude-visual-element-id')).className = document.getElementById(amplitude_active_song.getAttribute('amplitude-visual-element-id')).className + ' amplitude-now-playing';\n }\n }\n if (document.getElementById('amplitude-playlist')) {\n amplitude_active_song.addEventListener(\"ended\", function() {\n amplitude_next_song();\n });\n }\n //Sets active song information so it can be pulled\n amplitude_active_song_information['cover_art'] = amplitude_active_song.getAttribute('amplitude-album-art-url');\n amplitude_active_song_information['artist'] = amplitude_active_song.getAttribute('amplitude-artist');\n amplitude_active_song_information['album'] = amplitude_active_song.getAttribute('amplitude-album');\n amplitude_active_song_information['song_title'] = amplitude_active_song.getAttribute('amplitude-title');\n\n //Fires play callback for play button\n if(typeof amplitude_config != 'undefined'){\n if(typeof amplitude_config.amplitude_play_callback != 'undefined'){\n var amplitude_play_callback_function = window[amplitude_config.amplitude_play_callback];\n amplitude_play_callback_function();\n }\n }\n}", "function toggleSong() { //togglesong naam ka fnctn bnaya.\n var song = document.querySelector('audio'); //var declare kia song naam ka nd usme document.querySelector lagaya\n if (song.paused == true) { // paused aur pausing me diff. hai.\n console.log('Playing');\n $('.play-icon').removeClass('fa-play').addClass('fa-pause');\n song.play();\n } else {\n console.log('Pausing');\n $('.play-icon').removeClass('fa-pause').addClass('fa-play');\n song.pause();\n }\n}", "play() {\r\n this.audio.play();\r\n }", "function musicGenerator(elevation) {\n var audioElement = document.createElement(\"audio\");\n if (elevation > 10000) {\n // Super duper high\n audioElement.setAttribute(\"src\", \"assets/audio/acid.mp3\");\n audioElement.play();\n } else if (elevation > 9000) {\n // Super high\n audioElement.setAttribute(\"src\", \"assets/audio/hairgrowing.mp3\");\n audioElement.play();\n } else if (elevation > 8000) {\n // Extremely high\n audioElement.setAttribute(\"src\", \"assets/audio/imwasted.mp3\");\n audioElement.play();\n } else if (elevation > 7000) {\n // Very high\n audioElement.setAttribute(\"src\", \"assets/audio/wasted.mp3\");\n audioElement.play();\n } else if (elevation > 6000) {\n // High\n audioElement.setAttribute(\"src\", \"assets/audio/badAssWeed.mp3\");\n audioElement.play();\n // Slightly high\n audioElement.setAttribute(\"src\", \"assets/audio/booboo.mp3\");\n audioElement.play();\n } else {\n // Sober\n audioElement.setAttribute(\"src\", \"assets/audio/hey_bud.mp3\");\n audioElement.play();\n }\n}" ]
[ "0.7011543", "0.6692145", "0.61068994", "0.6084379", "0.6030354", "0.6030354", "0.5947804", "0.5937005", "0.5917849", "0.5901378", "0.5892711", "0.5856441", "0.5830479", "0.58228517", "0.58228004", "0.58221316", "0.5796113", "0.5795161", "0.5789441", "0.57812077", "0.57784516", "0.57741624", "0.5748417", "0.57079184", "0.56925404", "0.56849694", "0.5684503", "0.5683093", "0.5678611", "0.56697005", "0.56678885", "0.56566346", "0.5644484", "0.5642524", "0.5642487", "0.56295437", "0.5625612", "0.562094", "0.56191695", "0.5612808", "0.5608818", "0.56070656", "0.5602461", "0.5578401", "0.55683583", "0.5566797", "0.5566797", "0.55656815", "0.55656815", "0.5555195", "0.55549973", "0.553426", "0.5531138", "0.5531138", "0.5518788", "0.55168843", "0.5510988", "0.55093616", "0.5488615", "0.54852325", "0.5483157", "0.5481418", "0.5480037", "0.5474908", "0.54590666", "0.54542583", "0.5450997", "0.54403824", "0.54349", "0.54323196", "0.5426234", "0.5426062", "0.54258984", "0.5422775", "0.5422094", "0.54217786", "0.5421153", "0.5417338", "0.54165614", "0.54141736", "0.54000634", "0.53959626", "0.5392693", "0.53923845", "0.5381634", "0.5363746", "0.53563476", "0.53533685", "0.5352328", "0.5351012", "0.53430873", "0.534254", "0.5338247", "0.53332907", "0.5331478", "0.53270143", "0.5324844", "0.53184503", "0.5318431", "0.53180957" ]
0.6923207
1
call draw method on all flowers
function drawFlowers() { for (let i = 0; i < flowers.length; i++) { flowers[i].draw(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "draw() {\n\n for (let i = 0; i < this.belt.length; i++) {\n this.belt[i].draw();\n }\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw(){\n for(var i=0;i<this.elements.length;i++){\n var e=this.elements[i]\n e.draw()\n }\n }", "drawThings() {\r\n this.paddle.render();\r\n this.ball.render();\r\n\r\n this.bricks.forEach((brick) => brick.display());\r\n this.blocks.forEach((block) => block.show());\r\n\r\n }", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "draw()\n {\n if(this.helicopter.length === 1)\n {\n this.helicopter[0].draw();\n }\n\n for(var i = 0; i < this.trucks.length; i++)\n {\n this.trucks[i].draw();\n }\n\n for(var i = 0; i < this.motorcycles.length; i++)\n {\n this.motorcycles[i].draw();\n }\n\n for(var i = 0; i < this.spikeCars.length; i++)\n {\n this.spikeCars[i].draw();\n }\n\n for(var i = 0; i < this.powerTrucks.length; i++)\n {\n this.powerTrucks[i].draw();\n }\n\n for(var i = 0; i < this.respawnTrucks.length; i++)\n {\n this.respawnTrucks[i].draw();\n }\n }", "draw() {\n this.bg.forEach((a) => a.draw());\n this.shapes.forEach((a) => a.draw());\n Help.clean(this.shapes);\n }", "drawGraph(){\n let shapes = this.vertices.iterator();\n\n while(!shapes.isEmpty()){\n shapes.currItem().drawEdges();\n shapes.next();\n }\n\n shapes = this.vertices.iterator();\n\n \n while(!shapes.isEmpty()){\n shapes.currItem().draw(this.currentStage);\n shapes.next();\n }\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {\n this._drawLines(this.linesData);\n this._drawLines(this.linesAux);\n this._drawThickLines();\n this._drawSurfaces(this.surfaces);\n }", "draw(){\n let shapes = this.shapeList.iterator();\n push();\n while(!shapes.isEmpty()){\n shapes.currItem().draw();\n shapes.next();\n }\n pop();\n\n this.drawText();\n }", "function draw() {\n\t// Redraw the background color\n\tbackground(17, 17, 17, 150)\n\t\n\t// loop through the streams array and render all streams\n\tstreams.forEach(function(stream) {\n\t\tstream.render()\n\t})\n}", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "drawAll(framesCounter) {\n this.drawLife()\n this.walk(framesCounter)\n }", "draw () {\n // TODO: try replacing with .emit('draw')\n for (const section of this.sections.values()) {\n section.draw()\n }\n }", "function draw() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].display();\n }\n base.display(); //and draw the base\n}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "draw() {\n\t\t\t\t//sort by depth\n\t\t\t\tthis.sort(function (a, b) {\n\t\t\t\t\treturn a.depth - b.depth;\n\t\t\t\t});\n\n\t\t\t\tfor (var i = 0; i < this.size(); i++) {\n\t\t\t\t\tthis.get(i).display();\n\t\t\t\t}\n\t\t\t}", "function drawAll() {\n\n // color in the background\n ctx.fillStyle = \"#000000\";\n ctx.fill(0, 0, canvasWidth, canvasHeight);\n\n // draw ship\n ship.draw();\n\n // draw rocks\n for (var i = 0; i < rocks.length; i++) {\n rocks[i].draw();\n }\n\n // draw bullets\n for (var i = 0; i < bullets.length; i++) {\n bullets[i].draw();\n }\n\n // draw stars\n for (var i = 0; i < stars.length; i++) {\n stars[i].draw();\n }\n\n // draw everything else\n}", "draw() { \r\n // Make sure the canvas has been prepared\r\n if (!this._setup) {\r\n this.prepare();\r\n }\r\n \r\n // Get the drawing context\r\n let ctx = this._canvas.getContext(\"2d\");\r\n \r\n // Clear the canvas by displaying only the background color\r\n ctx.fillStyle = this._background;\r\n ctx.fillRect(0, 0, this._width, this._height);\r\n \r\n // Loop through all of the shapes, asking them to draw theirselves\r\n // on the drawing context\r\n this._shapes.forEach(s => s.draw(ctx));\r\n }", "draw(i) {\n ctx.save();\n ctx.translate(cv.width * 0.5, cv.height * 0.5);\n ctx.scale(1, -1);\n\n ctx.beginPath();\n super.draw_handles();\n\n ctx.beginPath();\n ctx.strokeStyle = 'red';\n\n // If need update (ray moved)\n // or if any mirror moved (then recalculate all rays)\n // it is quite unoptimal, but we can use it here\n if(this.need_update || any_mirror_moved()) {\n this.cast_ray();\n this.need_update = false;\n\n // Is last ray?\n if(i == ray_total_count()) {\n mirror_updated();\n }\n \n }\n\n this.draw_trace();\n\n ctx.closePath();\n ctx.restore();\n }", "function render(){\n clearBoardColoration();\n drawFood();\n drawSnake();\n }", "Draw()\n\t{\n\t\t// Clear the canvas, optimize later if enough brain\n\t\tthis.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);\n\n\t\t// Draw everything\n\t\tfor(var i = 0; i < this.CanvasComponentCollection.orderedCollection.length; i++)\n\t\t{\n\t\t\tthis.CanvasComponentCollection.orderedCollection[i].Draw();\n\t\t}\n\t}", "CallDraws()\n {\n if(this.visualDebug)\n {\n collisionSystem.grid.Draw();;\n }\n\n for(var i = 0; i < this.gameObjects.length; i++)\n {\n if(this.gameObjects[i].object.visible)\n {\n this.gameObjects[i].object.DrawGameObject();\n }\n }\n\n for(var i = 0; i < this.interface.length; i++)\n {\n this.interface[i].DrawGameObject();\n }\n \n if(this.visualDebug)\n {\n this.DrawAxis();\n this.DrawGrid();\n }\n }", "draw() {\n // if not initialized\n if (this.viewportFollow === null) return;\n\n // draw background\n this._drawEveryCellWrapper(this._drawLayer.bind(this, 'ground'));\n\n // draw foreground\n for (const [, layerName, renderFunction, renderArgs] of this.customizedLayers) {\n if (renderFunction === '_drawCharacters') {\n this._drawCharacters(renderArgs);\n } else {\n this._drawEveryCellWrapper(this._drawLayer.bind(this, layerName));\n }\n }\n }", "function draw() {\n\t\t\tdrawGrid();\n\t\t\tdrawLabels();\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tdrawSeries(series[i]);\n\t\t\t}\n\t\t}", "function draw() {\n if (controllers.free_flow_flag) {\n draw_step();\n }\n\n}", "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "function drawAll() {\n sticks.forEach((stick) => {\n for (let i = 0; i < stick.disks.length; i++) {\n // only draw if disk is defined\n if (typeof stick.disks[i].draw === 'function') {\n stick.disks[i].draw();\n }\n }\n stick.draw();\n });\n circles.forEach((circle) => {\n circle.draw();\n });\n}", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }", "function draw()\n{\n\trequestAnimationFrame(draw);\n\tg_canvas.clearRect(0, 0, g_canvasWidth, g_canvasHeight);\n\tfor (let renderable of g_renderables)\n\t{\n\t\trenderable.render();\n\t}\n}", "function renderScarf(){\n makeScarf();\n for (i = 0; i < scarfShapes.length; i++){\n scarfShapes[i].render();\n }\n }", "function draw() {\n background(img);\n for (var i = 0; i < stations[currentStation].dots.length; i++) {\n stations[currentStation].show(i);\n }\n}", "run() {\n this.update();\n this.display();\n this.checkEdges();\n }", "draw() {\n // push the scene objects to the scene array\n this.prepareScene();\n\n // call each object's draw method\n this.drawSceneToCanvas();\n }", "function draw() {\n // Display the grass\n background(garden.grassColor.r, garden.grassColor.g, garden.grassColor.b);\n\n // Loop through all the flowers in the array and display them\n for (let i = 0; i < garden.flowers.length; i++) {\n let flower = garden.flowers[i];\n if (flower.alive) {\n flower.shrink();\n flower.display();\n }\n }\n\n for (let i = 0; i < garden.bees.length; i++) {\n let bee = garden.bees[i];\n if (bee.alive) {\n bee.shrink();\n bee.move();\n bee.display();\n\n for (let j = 0; j < garden.flowers.length; j++) {\n let flower = garden.flowers[j];\n if (flower.alive) {\n bee.tryToPollinate(flower);\n }\n }\n }\n }\n}", "function drawAll() {\n //refreshes canvas everyone to give the animation effect\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (optionScreen) {\n clickOption();\n return;\n }\n \n //calling functions to draw objects\n drawNet();\n drawRectangle1();\n drawRectangle2();\n drawBall();\n drawScorePlayer();\n drawScoreComputer();\n computerMovement();\n drawWinner();\n moveObjects();\n \n \n //requests an animation from the browser API onto canvas = to user refresh rate\n window.requestAnimationFrame(drawAll);\n }", "function draw() {\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\n for (i of allSprites) {\n // console.log(i);\n i.draw();\n }\n}", "function draw() {\n particles.forEach((p) => {\n p.draw();\n });\n}", "display(){\n noStroke();\n fill(this.color);\n this.shape(this.x, this.y, this.size, this.size);\n for(var i=0; i<this.history.length; i++){\n var pos = this.history[i];\n this.shape(pos.x, pos.y, 8, 8);\n }\n }", "function render() {\n\t\tdraw.custom(function(canvas, context) {\n\t\t\tbullets.forEach(function(bullet, index, bulletList) {\n\t\t\t\tgetSides(bullet, bullet.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(bullet.points[0].x + bullet.x, bullet.points[0].y + bullet.y);\n\t\t\t\tfor (var i = 1; i < bullet.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(bullet.points[i].x + bullet.x, bullet.points[i].y + bullet.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\n\t\t\t});\n\t\t\ttanks.forEach(function(tank, index, tankList) {\n\t\t\t\tgetSides(tank, tank.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(tank.points[0].x + tank.x, tank.points[0].y + tank.y);\n\t\t\t\tfor (var i = 1; i < tank.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(tank.points[i].x + tank.x, tank.points[i].y + tank.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t\teffects.forEach(function(effect, index, effectList) {\n\t\t\t\tfor (var i = 0; i < effect.particles.length; i++) {\n\t\t\t\t\tvar particle = effect.particles[i];\n\t\t\t\t\tgetSides(particle, particle.angle);\n\t\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\tcontext.moveTo(particle.points[0].x + particle.x, particle.points[0].y + particle.y);\n\t\t\t\t\tfor (var e = 1; e < particle.points.length; e++) {\n\t\t\t\t\t\tcontext.lineTo(particle.points[e].x + particle.x, particle.points[e].y + particle.y);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.closePath();\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\t\t\t});\n\t\t\tmap.forEach(function(wall, index, walls) {\n\t\t\t\tgetSides(wall, wall.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(wall.points[0].x + wall.x, wall.points[0].y + wall.y);\n\t\t\t\tfor (var i = 1; i < wall.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(wall.points[i].x + wall.x, wall.points[i].y + wall.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t});\n\t}", "function drawAll() {\n\tdrawBackground();\n\tdrawMarkers();\n\tpanForTranslation();\n\tblob.show();\n\n\tfor (var i = 0; i < playerData.length; i++) {\n\t\tif (playerData[i].id !== socket.id) {\n\t\t\tcanvasContext.fillStyle = 'white';\n\t\t\tcanvasContext.beginPath();\n\t\t\tcanvasContext.arc(playerData[i].xPos, playerData[i].yPos, 10, 0,Math.PI*2, true);\n\t\t\tcanvasContext.fill();\n\t\t}\n\t}\n}", "renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n for(var k = 0; k < 3; k++ ) {\n this.renderShape( Piece.getRandom(), k*5, i*5 );\n }\n }\n }", "function drawCanvas() {\n\t\tdraw(context, drawer, colours, solver);\n\t\tsolver.callStateForItem(spanState);\n\t}", "function drawTower(){\n push();\n for(var i=0; i<18; i++)\n { \n fill(colors[i]);\n drawVertices(boxes[i].vertices);\n }\n pop();\n}", "function draw() {\n // Makes the canvas light grey\n background(\"#7f7d7c\");\n // Continues redrawing the stamp where it was placed, so that it stays on screen. \n for (let i = 0; i < StampCollect.stamps.length; i++) {\n // Defines stamp as an instance in the array\n let stamp = StampCollect.stamps[i];\n // Keeps running through the draw function in the stamp class\n \n stamp.draw();\n stamp.draw();\n stamp.draw();\n stamp.draw();\n }\n }", "render () {\n\t\tfor ( let i = 0; i < this.numberOfCircles; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circles[i]\n\t\t\t\t\t\t\t\t.render( this.context );\n\t\t}\n\t}", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "draw() {\n //Draw this box\n if (this.strokeColor != undefined || this.fillColor != undefined) {\n this.ctx.beginPath();\n this.ctx.lineWidth = 2.0;\n this.ctx.rect(this.x, this.y, this.w, this.h);\n if (this.fillColor != undefined) {\n this.ctx.fillStyle = this.fillColor;\n this.ctx.fill()\n }\n if (this.strokeColor != undefined) {\n this.ctx.strokeStyle = this.strokeColor;\n this.ctx.stroke();\n }\n this.ctx.closePath();\n }\n //Recurse through children and draw them\n this.children.forEach(b => b.draw())\n }", "draw() {\n if (this._page !== currentPage) {\n return;\n }\n this.drawRectangles();\n if (!isReady) {\n return;\n }\n // Only used if using text lines.\n if (this._textLines.length > 0) {\n for (var i = 0; i < this._textLines.length; i++) {\n this._textLines[i].draw();\n }\n }\n // Only used if using input panels.\n if (this._inputPanels.length > 0) {\n for (var i = 0; i < this._inputPanels.length; i++) {\n this._inputPanels[i].draw();\n }\n }\n // Only used if using progress bars.\n if (this._progressBars.length > 0) {\n for (var i = 0; i < this._progressBars.length; i++) {\n this._progressBars[i].draw();\n }\n }\n }", "redraw() {\n // clear\n this._ctx.fillStyle = REN.BACKGROUND_COLOR;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height)\n \n // draw \n this._ps.eachNode(this.drawNode.bind(this)); \n this._ps.eachEdge(this.drawEdge.bind(this));\n this.drawName(this._currentNodeFocus);\n }", "draw() {\n while (this.cont.lastChild) {\n this.cont.lastChild.remove();\n }\n for (let i = 0; i < 6; i++) {\n this.chrs[i] = new Image(43, 139);\n this.chrs[i].src = `img/${this.picker[i % 2]}.png`;\n poke(this.chrs[i]);\n glow(this.chrs[i]);\n this.cont.appendChild(this.chrs[i]);\n }\n }", "canvasDraw() {\n let prev = this.p0;\n for (const point of this.points) {\n Point.drawLine(prev, point, false, this.isSelected, this.color);\n prev = point;\n }\n Point.drawLine(prev, this.p3);\n Point.drawLine(this.p0, this.p1, true);\n Point.drawLine(this.p2, this.p3, true);\n this.p0.draw();\n this.p1.draw();\n this.p2.draw();\n this.p3.draw();\n }", "function drawCanvas() {\n if( drawio.loadedIMG != ''){\n drawio.ctx.drawImage(drawio.loadedIMG, 0, 0);\n }\n for( var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n if(drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n }", "draw() {\n for (let i in this.actors) {\n ctx.drawImage(this.actors[i].image, this.actors[i].x, this.actors[i].y, this.actors[i].width, this.actors[i].height);\n }\n }", "function draw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n boxes.forEach(function(box, i){\n context.fillStyle = box.color;\n context.fillRect(box.x, box.y, box.width, box.height);\n });\n}", "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type != 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }", "drawCurrentState(){\n reset();\n drawPolygonLines(this.hull, \"red\"); \n drawLine(this.currentVertex, this.nextVertex, \"green\");\n drawLine(this.currentVertex,this.points[this.index]);\n for(let i=0;i<this.points.length;i++){\n this.points[i].draw();\n }\n\n for(let i=0;i<this.hull.length;i++){\n this.hull[i].draw(5,\"red\");\n }\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "draw() {\n // always draw our ping pong planes first!\n this.drawPingPongStack();\n\n // enable first frame buffer for shader passes if needed\n this.enableShaderPass();\n\n // our planes that are drawn onto a render target\n this.drawStack(\"renderTargets\");\n\n // then draw the content of our render targets render passes\n this.drawRenderPasses();\n\n // disable blending for the opaque planes\n this.renderer.setBlending(false);\n\n // loop on our stacked planes\n this.drawStack(\"opaque\");\n\n // set blending and draw transparents planes only if we have some\n if(this.stacks.transparent.length) {\n this.renderer.setBlending(true);\n\n // draw the transparent planes\n this.drawStack(\"transparent\");\n }\n\n // now draw the render targets scene passes\n this.drawScenePasses();\n }", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "function drawCanvas() {\n clearCanvas();\n\n var i,\n shape;\n\n for (i = 0; i < shapes.length; i += 1) {\n shape = shapes[i];\n shape.draw(drawingContext);\n }\n }", "function draw() {\n ctx.clearRect(0,0, canvas.width, canvas.height);\n drawList.forEach((shape) => {\n shape.draw();\n });\n raf = window.requestAnimationFrame(draw);\n}", "draw() {\n\t\tpush()\n\t\timageMode(CENTER);\n\t\tif (this.isRolling)\n\t\t\tthis.handleRolling();\n\t\telse // Draw current die value\n\t\t\timage(this.faces[this.faceValue - 1], this.position.x, this.position.y);\n\t\tpop();\n\t}", "function canvasDraw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n // define a function to be carried out on every object in the \"balls\" array\n // name of element in forEach function doesn't matter\n balls.forEach(function(ball_obj){\n ball_obj.draw();\n ball_obj.move();\n })\n }", "function draw() {\n draw_board(board_width,board_height,board_color)\n draw_snake();\n draw_fruit();\n // console.log(\"drawing\")\n}", "draw(){\n }", "function draw() {}", "function draw() {}", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n fill([255,0,0,70]);\n beginShape();\n for (let i=0; i<this.vertices.length; i++) {\n vertex(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER);\n circle(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER, 3);\n }\n vertex(this.vertices[0].x/DIVIDER, this.vertices[0].y/DIVIDER);\n endShape();\n }", "function draw() {\n // RENDER ----------------------- >\n notationObjects.forEach(function(it, ix) {\n it.renderer.render(it.scene, it.camera);\n });\n}", "function draw() {\n background(0);\n\n //Go through all the cars and move, wrap, and display them.\n for (let i = 0; i < vehicles.length; i++) {\n let vehicle = vehicles[i];\n vehicle.move();\n vehicle.wrap();\n vehicle.display();\n }\n\n // // Go through all the motorcycles and move, wrap, and display them\n // for (let i = 0; i < motorcycles.length; i++) {\n // let motorcycle = motorcycles[i];\n // motorcycle.move();\n // motorcycle.wrap();\n // motorcycle.display();\n // }\n}", "render() {\n this.renderCells();\n this.paintCells();\n this.setFigures();\n }", "function drawCanvas() {\n\t\tdrawing(context, drawer, colours, solver, selectedSpacesGrid);\n\t\tsolver.callStateForItem(spanState);\n\t}", "function draw() {\n\t//Redraw Background Color (Necessary?)\n\tbackground(0);\n\n\tfor (let i = 0; i < fishes.length; i++){ \n\t\t// If there is food on the screen, apply attractive force and display food\n\t\tif (food) {\n\t\t\tlet f = food.calculateAttraction(fishes[i]); \n\t\t\tfishes[i].applyForce(f); \n\t\t\tfood.display(); \n\t\t} else {\n\t\t\tfishes[i].meander();\n\t\t}\n\n\t\t// Update the properties of the fish (acceleration, velocity, location) etc\n\t\t// And display the fish\n\t\tfishes[i].update(); \n\t\tfishes[i].checkEdges();\n\t\tfishes[i].display();\n\t}\n\n\t// Text for slider\t\n\tfill(255);\n\ttextSize(16);\n\ttext('Food Size', 20, 120);\n\tfill(255);\n}", "function render() {\n\n\trequestAnimationFrame(render);\n\n\t// if true then render \n\tif(isrunnning) {\n\t\t// clear\n\t\tthis.clear();\n\t\t// save\n\t\tctx.save();\n\t\t// loop everything\n\t\tfor(let i=0; i<_objects.length; i++) {\n\t\t\t_objects[i].loop();\n\t\t\t_objects[i].draw();\n\t\t}\n\t\t// restore\n\t\tctx.restore();\n\t}\n}", "function foodRedraw(ctx){\n for(var i = 0; i < foods.length; i++){\n foodGraph(ctx, foods[i].x, foods[i].y);\n }\n}", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "draw(){\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n \n // draw ball and players\n this.drawRectangle(this.ball) \n this.players.forEach(player => this.drawRectangle(player));\n\n //draw score\n this.drawScore();\n }", "draw() {\n }", "function coreDraw() {\r\n\t\t\tdrawMethod();\r\n\t\t\texecRequestAnimationFrameFnList();\r\n\t\t\t// if the tween component exists let's update it\r\n\t\t\tif (TWEEN) {\r\n\t\t\t\tTWEEN.update();\r\n\t\t\t}\r\n\t\t}", "function drawAllPlayers(playerList){\n myCanvas.drawBoard();\n for (let i = 0; i<playerList.length; i++){playerList[i].drawPlayer()};\n}", "draw() {\n\n }", "draw() {\n this.range.draw();\n if (this.isSplit()) {\n this.LL.draw();\n this.LH.draw();\n this.HL.draw();\n this.HH.draw();\n }\n }", "draw() {\n this.range.draw();\n if (this.isSplit()) {\n this.LL.draw();\n this.LH.draw();\n this.HL.draw();\n this.HH.draw();\n }\n }", "draw() {\n this.range.draw();\n if (this.isSplit()) {\n this.LL.draw();\n this.LH.draw();\n this.HL.draw();\n this.HH.draw();\n }\n }", "function drawMoveables() {\n for (let i = 0; i < moveables.length; i++) {\n moveables[i].draw();\n }\n }", "draw() { }", "draw() { }", "draw() { }", "function drawGhosts(listOfGhosts) {\n for (var i = 0; i < listOfGhosts.length; i++) {\n listOfGhosts[i].draw();\n }\n}", "function drawAll() {\n ctx.clearRect(0, 0, 800, 500);\n for (var j = 0; j < lgt; j++) {\n shape[j].draw();\n\n }\n for (var k = 0; k < COUNT; k++) {\n snowflakes[k].update();\n\n }\n\n\n}", "draw(){\n\t\t\t//console.log(this.growth);\n\t\t\tfor(let i = 0 ; i < this.growth.length ; i++){\n\t\t\t\tthis.growth[i].drawSnake('gold');\n\t\t\t}\n\t\t}", "render () {\n\t\t\t\t//Clear the entire canvas every render\n\t\tthis\n\t\t\t\t\t\t.context\n\t\t\t\t\t\t.clearRect( 0, 0, this.width, this.height );\n\n\t\t\t\t//Trigger the render function on every child element\n\t\tfor ( let i = 0; i < this.circleContainers.length; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circleContainers[i]\n\t\t\t\t\t\t\t\t.render();\n\t\t}\n\t}" ]
[ "0.7339453", "0.7263549", "0.7232819", "0.7232819", "0.7232819", "0.7089712", "0.7030468", "0.6987068", "0.69428116", "0.6938341", "0.6901095", "0.6898949", "0.6890323", "0.68310916", "0.682752", "0.67846096", "0.6748135", "0.6743789", "0.6735853", "0.6720965", "0.6703261", "0.6702084", "0.6674873", "0.6643715", "0.6640641", "0.6630023", "0.6622148", "0.6620865", "0.66109693", "0.66032547", "0.6593555", "0.65923154", "0.6589594", "0.6569008", "0.6564221", "0.65520614", "0.6520077", "0.6511466", "0.64899284", "0.64819974", "0.6480416", "0.6463043", "0.6455252", "0.64530396", "0.6449214", "0.6444843", "0.6437385", "0.6432361", "0.6423713", "0.6423471", "0.64229757", "0.64218664", "0.64218056", "0.6419858", "0.64165694", "0.64142245", "0.6396874", "0.6393109", "0.6393084", "0.6386006", "0.63784724", "0.6376208", "0.6368113", "0.63680565", "0.63520086", "0.6351194", "0.63433146", "0.6342873", "0.63378507", "0.6337422", "0.63301075", "0.6309722", "0.6307808", "0.6306304", "0.6306304", "0.63022333", "0.62949383", "0.62914467", "0.62898505", "0.62743294", "0.6271402", "0.62712115", "0.62658423", "0.62635326", "0.62617207", "0.6257755", "0.625546", "0.6240222", "0.6231166", "0.6229715", "0.6229715", "0.6229715", "0.6228225", "0.62260103", "0.62260103", "0.62260103", "0.6224846", "0.62173724", "0.6208265", "0.6204967" ]
0.8836986
0
call draw method on all moveables
function drawMoveables() { for (let i = 0; i < moveables.length; i++) { moveables[i].draw(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\n}", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function draw() {\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\n for (i of allSprites) {\n // console.log(i);\n i.draw();\n }\n}", "draw() {\n this.bg.forEach((a) => a.draw());\n this.shapes.forEach((a) => a.draw());\n Help.clean(this.shapes);\n }", "function canvasDraw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n // define a function to be carried out on every object in the \"balls\" array\n // name of element in forEach function doesn't matter\n balls.forEach(function(ball_obj){\n ball_obj.draw();\n ball_obj.move();\n })\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "function drawUpdate() {\n field.draw();\n for (let moveable of moveables) {\n moveable.draw();\n }\n // Check the playerstatus (player/spareplayer) \n for (let player of allPlayers) {\n player.checkState();\n }\n }", "function draw()\n{\n\trequestAnimationFrame(draw);\n\tg_canvas.clearRect(0, 0, g_canvasWidth, g_canvasHeight);\n\tfor (let renderable of g_renderables)\n\t{\n\t\trenderable.render();\n\t}\n}", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "function drawPlayer () {\n\n for (var i = 0; i < playerList.length; i++) { playerList[i].draw(); }\n}", "function drawAll() {\n\n // color in the background\n ctx.fillStyle = \"#000000\";\n ctx.fill(0, 0, canvasWidth, canvasHeight);\n\n // draw ship\n ship.draw();\n\n // draw rocks\n for (var i = 0; i < rocks.length; i++) {\n rocks[i].draw();\n }\n\n // draw bullets\n for (var i = 0; i < bullets.length; i++) {\n bullets[i].draw();\n }\n\n // draw stars\n for (var i = 0; i < stars.length; i++) {\n stars[i].draw();\n }\n\n // draw everything else\n}", "draw () {\n\n\t\t// Draw board\n\t\tthis.board.draw ()\n\n\t\t// Draw each stone, with anchor set beside the board\n\t\tvar draw_above = []\n\t\tlet stone_size = this.board.board_size / 8\n\n\t\tlet i = 0\n\t\tthis.blacks.forEach (stone => {\n\t\t\t\n\t\t\tvar coo = this.board.get_slot_coo (4 + i%2, Math.floor (i/2))\n\t\t\tstone.set_pos_size (coo [0], coo [1], stone_size, stone_size)\n\t\t\tif (stone.is_selected () == false) stone.draw (this.mouse)\n\t\t\telse draw_above.push (stone)\n\n\t\t\ti += 1\n\t\t})\n\n\t\ti = 0\n\t\tthis.whites.forEach (stone => {\n\t\t\t\n\t\t\tvar coo = this.board.get_slot_coo (-1 - i%2, Math.floor (i/2))\n\t\t\tstone.set_pos_size (coo [0], coo [1], stone_size, stone_size)\n\t\t\tif (stone.is_selected () == false) stone.draw (this.mouse)\n\t\t\telse draw_above.push (stone)\n\n\t\t\ti += 1\n\t\t})\n\n\t\tdraw_above.forEach (stone => {stone.draw (this.mouse)})\n\n\t\t// Draw winner banner\n\t\tif (this._winner != -1) {\n\t\t\t\n\t\t\tif (this._winner == 0)\n\t\t\t\tthis._draw_banner (this._language.white_wins, \"rgba(200, 200, 200, 0.6)\")\n\n\t\t\telse if (this._winner == 1)\n\t\t\t\tthis._draw_banner (this._language.brown_wins, \"rgba(200, 100, 0, 0.6)\")\n\t\t}\n\t}", "draw(){\n let shapes = this.shapeList.iterator();\n push();\n while(!shapes.isEmpty()){\n shapes.currItem().draw();\n shapes.next();\n }\n pop();\n\n this.drawText();\n }", "function drawAllPlayers(playerList){\n myCanvas.drawBoard();\n for (let i = 0; i<playerList.length; i++){playerList[i].drawPlayer()};\n}", "function draw() {\n background(10, 10, 10);\n for (var i = 0; i < bubbles.length; i++) {//no matter how many buubles go through each one up by one\n bubbles[i].move();\n bubbles[i].display();\n }\n}", "draw(){\n for(var i=0;i<this.elements.length;i++){\n var e=this.elements[i]\n e.draw()\n }\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Splash\" && \n adventureManager.getStateName() !== \"Instructions\" ) {\n \n // responds to keydowns\n moveSprite();\n\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n } \n}", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "function Update() {\n drawBackground();\n blocs.forEach(bloc => {\n bloc.draw();\n bloc.move();\n });\n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "run() {\n this.spawns();\n this.move();\n this.draw();\n }", "function drawEverything(){\n myGameArea.clear();\n //draw moving background\n drawBackground();\n //add the new position of the bullet to the update step\n playerBullets.forEach(function(bullet){\n bullet.update();\n });\n playerBullets.forEach(function(bullet){\n bullet.draw();\n });\n //filter the list of bullet to only add the active bullets\n playerBullets = playerBullets.filter(function(bullet){\n return bullet.active;\n });\n //add the new enemy to the array of enemies\n enemies.forEach(function(enemy){\n enemy.update();\n });\n // filter the list of enemies\n enemies = enemies.filter(function(enemy){\n return enemy.active;\n })\n enemies.forEach(function(enemy){\n enemy.draw();\n });\n \n player.newPos();\n player.update();\n // myGameArea.score();\n \n \n }", "function draw() {\n draw_board(board_width,board_height,board_color)\n draw_snake();\n draw_fruit();\n // console.log(\"drawing\")\n}", "function draw(actions) {\n/*\n\tif (canvasValid == false) {\n\t\t//MIGHT NOT NEED THIS WITH FAB\n\t\t$canvas.renderTop();\n\t\t// draw all boxes\n\t\tvar l = team.length;\n\t\tfor (var i = 0; i < l; i++) {\n\t\t\tif (team[i] == mySel){\n\t\t\t\tteam[i].strokeStyle = mySelColor;\n\t\t\t}else{\n\t\t\t\t//change to reset method eventually\n\t\t\t\tteam[i].strokeStyle = \"#000\";\n\t\t\t}\n\t\t\tif(playersMoving()){\n\t\t\t\tteam[i].draw();\n\t\t\t}else{\n\t\t\t\t//console.log(\"draw actions\");\n\t\t\t\t//team[i].draw();\n\t\t\t\t//team[i].drawActions();\n\t\t\t}\n\t\t}\n\t\tcanvasValid = true;\n\t}\n\t*/\n }", "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "draw(ctx) {\n this.gameObjects.forEach((object) => object.draw(ctx));\n }", "draw() {\n\n for (let i = 0; i < this.belt.length; i++) {\n this.belt[i].draw();\n }\n }", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetrominoe');\n });\n }", "draw() {\n this.clearCanvas();\n\n this._ball.draw();\n this._paddle1.draw();\n this._paddle2.draw();\n\n this.drawScore();\n\n this.detectCollision();\n\n this.movePaddles();\n\n this._ball.move();\n }", "function draw() {\n background(0);\n\n //Go through all the cars and move, wrap, and display them.\n for (let i = 0; i < vehicles.length; i++) {\n let vehicle = vehicles[i];\n vehicle.move();\n vehicle.wrap();\n vehicle.display();\n }\n\n // // Go through all the motorcycles and move, wrap, and display them\n // for (let i = 0; i < motorcycles.length; i++) {\n // let motorcycle = motorcycles[i];\n // motorcycle.move();\n // motorcycle.wrap();\n // motorcycle.display();\n // }\n}", "function draw() {\r\n current.forEach((index) => {\r\n squares[currentPosition + index].classList.add(\"tetrimino\");\r\n squares[currentPosition + index].style.backgroundColor = colors[random];\r\n });\r\n }", "draw() {\n\n // PNG room draw\n super.draw();\n if (x0 === true) this.bookSprites[0].remove();\n if (x1 === true) this.bookSprites[1].remove(); \n if (x2 === true) this.bookSprites[2].remove();\n if (x3 === true) this.bookSprites[3].remove(); \n\n drawSprite(this.bookSprites[0]);\n drawSprite(this.bookSprites[1]);\n drawSprite(this.bookSprites[2]);\n drawSprite(this.bookSprites[3]);\n\n playerSprite.overlap(this.bookSprites[0], this.bookCollect0);\n playerSprite.overlap(this.bookSprites[1], this.bookCollect1);\n playerSprite.overlap(this.bookSprites[2], this.bookCollect2);\n playerSprite.overlap(this.bookSprites[3], this.bookCollect3);\n }", "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetromino')\n })\n }", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "draw()\n {\n if(this.helicopter.length === 1)\n {\n this.helicopter[0].draw();\n }\n\n for(var i = 0; i < this.trucks.length; i++)\n {\n this.trucks[i].draw();\n }\n\n for(var i = 0; i < this.motorcycles.length; i++)\n {\n this.motorcycles[i].draw();\n }\n\n for(var i = 0; i < this.spikeCars.length; i++)\n {\n this.spikeCars[i].draw();\n }\n\n for(var i = 0; i < this.powerTrucks.length; i++)\n {\n this.powerTrucks[i].draw();\n }\n\n for(var i = 0; i < this.respawnTrucks.length; i++)\n {\n this.respawnTrucks[i].draw();\n }\n }", "function render(){\n clearBoardColoration();\n drawFood();\n drawSnake();\n }", "drawThings() {\r\n this.paddle.render();\r\n this.ball.render();\r\n\r\n this.bricks.forEach((brick) => brick.display());\r\n this.blocks.forEach((block) => block.show());\r\n\r\n }", "draw() {\n this.tiles.forEach(t => {\n var tileCoords = {\n x: this.origin.x + (t.x * 8) + 16,\n y: this.origin.y + (t.y * 8)\n }\n this.context.drawImage(RESOURCE.sprites, t.t * 8, 16, 8, 8, tileCoords.x, tileCoords.y, 8, 8);\n });\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function draw() {}", "function draw() {}", "function drawSnake()\r\n{\r\n snake.forEach(drawSnakeParts);\r\n}", "function drawAll() {\n //refreshes canvas everyone to give the animation effect\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (optionScreen) {\n clickOption();\n return;\n }\n \n //calling functions to draw objects\n drawNet();\n drawRectangle1();\n drawRectangle2();\n drawBall();\n drawScorePlayer();\n drawScoreComputer();\n computerMovement();\n drawWinner();\n moveObjects();\n \n \n //requests an animation from the browser API onto canvas = to user refresh rate\n window.requestAnimationFrame(drawAll);\n }", "function drawSprites() {\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i].showSprite(); // Updates the z value\n spritesArray[i].moveSprite(); // Paints new object\n }\n}", "function drawSnake()\n{\n snake.forEach(drawSnakePart);\n}", "function draw() {\n background(0);\n\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n for (let i = 0; i < vehicles.length; i++) {\n let vehicle = vehicles[i];\n vehicle.move();\n vehicle.wrap();\n vehicle.display();\n }\n\n// INHERITANCE ////////////////////////////////////////////////////////////////\n // for (let i = 0; i < cars.length; i++) {\n // let car = cars[i];\n // car.move();\n // car.wrap();\n // car.display();\n // }\n //\n // for (let i = 0; i < motorcycles.length; i++) {\n // let motorcycle = motorcycles[i];\n // motorcycle.move();\n // motorcycle.wrap();\n // motorcycle.display();\n // }\n}", "function draw(){\r\n current.forEach(index =>{\r\n squares[currentPosition + index].classList.add('tetromino')\r\n squares[currentPosition + index].style.backgroundColor= colors[random]\r\n })\r\n }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "draw() {\n while (this.cont.lastChild) {\n this.cont.lastChild.remove();\n }\n for (let i = 0; i < 6; i++) {\n this.chrs[i] = new Image(43, 139);\n this.chrs[i].src = `img/${this.picker[i % 2]}.png`;\n poke(this.chrs[i]);\n glow(this.chrs[i]);\n this.cont.appendChild(this.chrs[i]);\n }\n }", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function draw() {\n ctx.clearRect(0,0, canvas.width, canvas.height);\n drawList.forEach((shape) => {\n shape.draw();\n });\n raf = window.requestAnimationFrame(draw);\n}", "function drawSnake() {\n snake.forEach(drawSnakePart);\n}", "function drawSnake() {\n snake.forEach(drawSnakePart);\n}", "update(){\r\n this.draw();\r\n }", "function draw() {\n current.forEach((index) => {\n squares[currentPosition + index].classList.add(\"tetromino\");\n });\n }", "function drawSnake() {\n // Menggambar setiap ruas\n snake.forEach(drawSnakePart)\n}", "function drawSnake() {\r\n // Draw each part\r\n snake.forEach(drawSnakePart)\r\n}", "function draw() {\n background(0);\n\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n}", "draw(){\n }", "function drawSprites() {\r\n for (var i = 0; i < numberOfSprites; i++) {\r\n spritesArray[i].showSprite(); // Updates the z value\r\n spritesArray[i].moveSprite(); // Paints new object\r\n }\r\n}", "function draw() {\n background(0);\n\n // Draw circles\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n\n// Draws squares\nfor (let i = 0; i < squares.length; i++) {\n let square = squares[i];\n square.move();\n square.bounce();\n square.display();\n }\n displayText();\n}", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\n }", "draw() { }", "draw() { }", "draw() { }", "function drawEverything() {\n drawthetrack();\n player1.DrawItSelf(i);\n player2.DrawItSelf(j);\n allTheObstacles1.forEach((eachObstacle) => {\n eachObstacle.drawItSelf();\n if (eachObstacle.x < 20) {\n allTheObstacles1.shift();\n }\n })\n allTheObstacles2.forEach((eachObstacle) => {\n eachObstacle.drawItSelf();\n if (eachObstacle.x < 20) {\n allTheObstacles2.shift();\n }\n })\n allCloud1.forEach((cloud) => {\n cloud.drawItSelf();\n if (cloud.x < 20) {\n allCloud1.shift();\n }\n })\n allCloud2.forEach((cloud) => {\n cloud.drawItSelf();\n if (cloud.x < 20) {\n allCloud2.shift();\n }\n })\n}", "function draw() {\n background(0);\n updateLasers();\n ship.draw();\n ship.update();\n ship.turn();\n ship.edges();\n}", "function drawObjects() {\n\t\t\tfor(var i in blackRects)\n\t\t\t\tblackRects[i].draw(ctx);\n\t\t\t\n\t\t\tfor(var i in lanes)\n\t\t\t\tlanes[i].draw(ctx);\n\t\t\t\n\t\t\tcar.draw(ctx);\n\t\t\t\n\t\t\tcops.sort(function(a,b){return a.pos().y-b.pos().y;});\n\t\t\tfor(var i in cops)\n\t\t\t\tcops[i].draw(ctx);\n\t\t}", "draw() {\n\n }", "draw(ctx) {\n [...this.gameobjs, ...this.Brick].forEach(object => (object.draw(ctx)\n ));\n \n //displays the pause event\n if (this.gamestate === GAMESTATE.PAUSED) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,0.5)\";\n ctx.fill();\n\n ctx.font = \" 100px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"PAUSED\", this.gameWidth / 2, this.gameHeight / 2);\n ctx.font = \"50px Arial\";\n ctx.fillText(\"Press enter to continue\", this.gameWidth / 2, this.gameHeight / 2 + 100)\n ctx.font = \"30px Arial\";\n ctx.fillText(\"You have \" + this.live +\n \" lives remaining\", this.gameWidth / 2, this.gameHeight / 2 + 200)\n };\n\n //displays the menu canvas\n if (this.gamestate === GAMESTATE.MENU) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"BLOCK BREAKER GAME\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n ctx.fillStyle = \"white\";\n ctx.font = \"30px Arial\";\n ctx.fillText(\"Press SHIFT to Continue\", this.gameWidth / 2, this.gameHeight / 2 + 50)\n \n ctx.font = \"25px Arial\";\n ctx.fillStyle = \"grey\";\n ctx.textAlign = \"right\";\n ctx.fillText(\"Powered by Greenfonts\",\n this.gameWidth / 2 + 300, this.gameHeight / 2 + 250)\n\n }\n //displays the gameover canvas\n if (this.gamestate === GAMESTATE.GAMEOVER) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"GAME OVER\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n ctx.fillStyle = \"white\";\n ctx.font = \"30px Arial\";\n ctx.fillText(\"Start New Game\", this.gameWidth / 2, this.gameHeight / 2 + 100)\n\n }\n if (this.gamestate === GAMESTATE.INSTRUCTIONS) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"INSTRUCTIONS\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n\n ctx.fillStyle = \"white\";\n ctx.font = \"25px Arial\";\n ctx.fillText(\"Please read the instructions carefully\", this.gameWidth / 2, this.gameHeight / 2 - 80);\n \n ctx.textAlign = \"left\";\n ctx.fillStyle = \"white\";\n ctx.font = \"25px Arial\";\n ctx.fillText( \"* \" + \"You have 3 lives in the Game\",\n this.gameWidth / 2 - 350, this.gameHeight / 2 + 50)\n \n ctx.fillText(\"* \" +\"Press Enter to Pause the Game\", this.gameWidth / 2 - 350, this.gameHeight / 2 + 100)\n \n ctx.fillText(\"* \" + \"Press SPACEBAR to Start the Game\", this.gameWidth / 2 - 350, this.gameHeight / 2 + 150)\n \n\n }\n \n if (this.gamestate === GAMESTATE.MENUTONXTLEVEL) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 30px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"Press SPACEBAR to Continue to Level \" + (this.currentlevel + 1), this.gameWidth / 2, this.gameHeight / 2);\n \n }\n }", "function drawAll() {\n\tdrawBackground();\n\tdrawMarkers();\n\tpanForTranslation();\n\tblob.show();\n\n\tfor (var i = 0; i < playerData.length; i++) {\n\t\tif (playerData[i].id !== socket.id) {\n\t\t\tcanvasContext.fillStyle = 'white';\n\t\t\tcanvasContext.beginPath();\n\t\t\tcanvasContext.arc(playerData[i].xPos, playerData[i].yPos, 10, 0,Math.PI*2, true);\n\t\t\tcanvasContext.fill();\n\t\t}\n\t}\n}", "draw(graphics, view) {\n \n // We have the model coordinates, need to convert to world coordinates \n // using the sprite transformation, then convert to view coordinates \n // using the view transformation.\n // Can combine these into one transform for speed.\n this.shapeDraw.copyFrom(this.shapeModel)\n this.shapeDraw.transform(this.tModelToWorld)\n this.shapeDraw.transform(view.tWorldToView)\n this.shapeDraw.drawShape(graphics)\n \n // Now draw any child sprites\n for (const child of this.children) {\n child.draw(graphics, view)\n } \n }", "function draw() {\n currentTetromino.forEach(index=> {\n //render each cell in the tetromino by adding class 'tetromino' which contains styling\n squares[currentPosition + index].classList.add('tetromino');\n //change tetromino color\n squares[currentPosition +index].style.backgroundColor = colors[randomTetromino];\n })\n }", "drawAll(framesCounter) {\n this.drawLife()\n this.walk(framesCounter)\n }", "draw() {\n }", "function draw() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].display();\n }\n base.display(); //and draw the base\n}", "function drawcollectables(t_collectable)\n{\n\tfor(var i = 0; i < collectables.length; i++)\n\t\t{\n\t\t\tstroke(255, 255, 0); \n\t\t\tstrokeWeight(25)\n\t\t\tpoint(t_collectable.x_pos, t_collectable.y_pos);\n\t\t\tstroke(255, 255, 0);\n\t\t\tstrokeWeight();\t\n\t\t}\n}", "function paint() {\n\n\t\t\tpaintStones();\n\n\t\t\t// Tag the current move\n\t\t\tif (goMap.currentMoveIndex > 0) {\n\t\t\t\tpaintCurrentMove();\n\t\t\t}\n\n\t\t\tif (displayNum) {\n\t\t\t\tpaintNumbers();\n\t\t\t}\n\t\t}", "function draw() {\n background(0);\n avatar.update();\n //check for collision\n for (let i = 0; i < foods.length; i++) {\n\tif (avatar.collide(foods[i])) {\n\t\tavatar.eat(foods[i]);\n\t\tbreak;\n\t\t}\n\t}\n avatar.display();\n //Display food\n for (let i = 0; i < foods.length; i++) {\n\tfoods[i].update();\n\tfoods[i].display();\n\t}\n}", "draw() {\n // push the scene objects to the scene array\n this.prepareScene();\n\n // call each object's draw method\n this.drawSceneToCanvas();\n }", "function drawAll() {\n sticks.forEach((stick) => {\n for (let i = 0; i < stick.disks.length; i++) {\n // only draw if disk is defined\n if (typeof stick.disks[i].draw === 'function') {\n stick.disks[i].draw();\n }\n }\n stick.draw();\n });\n circles.forEach((circle) => {\n circle.draw();\n });\n}", "draw() {\n for (let i in this.actors) {\n ctx.drawImage(this.actors[i].image, this.actors[i].x, this.actors[i].y, this.actors[i].width, this.actors[i].height);\n }\n }", "function drawGhosts(listOfGhosts) {\n for (var i = 0; i < listOfGhosts.length; i++) {\n listOfGhosts[i].draw();\n }\n}", "draw() {\n // if not initialized\n if (this.viewportFollow === null) return;\n\n // draw background\n this._drawEveryCellWrapper(this._drawLayer.bind(this, 'ground'));\n\n // draw foreground\n for (const [, layerName, renderFunction, renderArgs] of this.customizedLayers) {\n if (renderFunction === '_drawCharacters') {\n this._drawCharacters(renderArgs);\n } else {\n this._drawEveryCellWrapper(this._drawLayer.bind(this, layerName));\n }\n }\n }", "function draw() {\n background(255);\n particles.forEach(p => {\n p.move();\n p.draw();\n });\n}", "CallDraws()\n {\n if(this.visualDebug)\n {\n collisionSystem.grid.Draw();;\n }\n\n for(var i = 0; i < this.gameObjects.length; i++)\n {\n if(this.gameObjects[i].object.visible)\n {\n this.gameObjects[i].object.DrawGameObject();\n }\n }\n\n for(var i = 0; i < this.interface.length; i++)\n {\n this.interface[i].DrawGameObject();\n }\n \n if(this.visualDebug)\n {\n this.DrawAxis();\n this.DrawGrid();\n }\n }", "draw() {\n if (this.stopFlag) {\n image(chickenSprites[5], this.x, this.y, this.w, this.h);\n }\n else {\n if (this.direction == \"left\") {\n image(chickenSprites[4 + floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n\n }\n else if (this.direction == \"right\") {\n image(chickenSprites[floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n }\n else {\n image(chickenSprites[floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n }\n }\n\n this.spriteTimer++;\n }", "draw() {\n if (this.imageLoaded && this.coordinatesSet) {\n if (this.currentX != this.toX || this.currentY != this.toY) {\n engine.gfxController.drawSpriteAsset(\n this.img,\n this.currentX,\n this.currentY\n );\n if (!this.isStopped) {\n if (this.currentX != this.toX) {\n this.currentX += this.dx;\n }\n if (this.currentY != this.toY) {\n this.currentY += this.dy;\n }\n }\n } else {\n this.isDoneDrawing = true;\n if (!this.eraseOnDestination) {\n engine.gfxController.drawSpriteAsset(\n this.img,\n this.currentX,\n this.currentY\n );\n }\n }\n }\n }", "update() {\n this.drawBoard();\n }", "draw(listOfObjects) {\n\t\t\tif (typeof listOfObjects !== \"undefined\") {\n\t\t\t\tlistOfObjects.forEach(function(element) {\n\t\t\t\t\t\tif (element._drawable && element instanceof entity )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement.drawEntity();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}" ]
[ "0.74547124", "0.737334", "0.73551196", "0.72698575", "0.7235449", "0.7233821", "0.71460575", "0.7132533", "0.70798904", "0.70558506", "0.7053185", "0.7053185", "0.7053185", "0.69858325", "0.69764304", "0.6968767", "0.69512206", "0.6936371", "0.69245255", "0.692414", "0.69082665", "0.6907389", "0.69026935", "0.68982065", "0.6890317", "0.6828231", "0.6825402", "0.6823493", "0.6818423", "0.68125105", "0.6811712", "0.67927295", "0.6782916", "0.6782695", "0.6775024", "0.67743903", "0.6768178", "0.67550385", "0.675401", "0.6734356", "0.67277974", "0.6709478", "0.6694656", "0.6692041", "0.66620386", "0.66552037", "0.66540056", "0.66540056", "0.6642736", "0.6640042", "0.6630618", "0.6627229", "0.66219026", "0.66207874", "0.6615362", "0.6615362", "0.6615362", "0.6615362", "0.6610733", "0.6610488", "0.65992826", "0.6598859", "0.6598859", "0.65961975", "0.65952474", "0.65951604", "0.6592729", "0.65922284", "0.6578842", "0.6578661", "0.65721786", "0.65718", "0.65711373", "0.65711373", "0.65711373", "0.65708095", "0.6570683", "0.6569174", "0.656548", "0.6551193", "0.6549553", "0.6548687", "0.6547805", "0.6543674", "0.65433085", "0.65422076", "0.6538989", "0.65367866", "0.65366185", "0.65359527", "0.6513065", "0.6509438", "0.6503985", "0.6496567", "0.6492593", "0.64853007", "0.6483057", "0.64782465", "0.6474755", "0.6473428" ]
0.8923036
0
generate a color with random rgb values
function generateRandomColor() { let r = Math.floor(Math.random() * 255); let g = Math.floor(Math.random() * 255); let b = Math.floor(Math.random() * 255); let color = "rgba(" + r + "," + g + "," + b + "," + 1 + ")"; return color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gencolor() {\n len = _COLOR.length;\n rand = Math.floor(Math.random()*len); \n return _COLOR[rand];\n }", "function getRandomColorRGB() {\n return 'rgb(' + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + \",\" + calcRndGen(255, true).toString() + ')';\n }", "function genColorVal(){\r\n return Math.floor(Math.random() * 256);\r\n }", "function generateRandomColorValues () {\n r = Math.round(Math.random() * (256));\n g = Math.round(Math.random() * (256));\n b = Math.round(Math.random() * (256));\n}", "function generateColor() {\n const ranges = [\n [150, 256],\n [0, 190],\n [0, 30]\n ];\n var g = function() {\n var range = ranges.splice(Math.floor(Math.random() * ranges.length), 1)[0];\n return Math.floor(Math.random() * (range[1] - range[0])) + range[0];\n }\n return \"rgb(\" + g() + \",\" + g() + \",\" + g() + \")\";\n }", "function generateColor() {\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function generateColor() {\n\tvar array = [];\n\tfor (var i = 0; i < 3; i++) {\n\t\tvar number = Math.floor(Math.random() * 256);\n\t\tarray.push(number);\n\t} \n\tvar newRgb = \"rgb(\" + array[0] + \",\" + array[1] + \",\" + array[2] + \")\";\n\treturn newRgb;\n}", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function random_rgb() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgb(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + 0.5 + ')';\n }", "static random_color () {\n let r = rand_in_range(0, 256)\n let g = rand_in_range(0, 256)\n let b = rand_in_range(0, 256)\n let a = rand_in_range(0, 128)\n\n return [r, g, b, a]\n }", "function color_rand() {\n return color(random(127,255),random(127,255),random(127,255));\n}", "function GetRandomColor() {\r\n var r = 0,\r\n g = 0,\r\n b = 0;\r\n while (r < 100 && g < 100 && b < 100) {\r\n r = Math.floor(Math.random() * 256);\r\n g = Math.floor(Math.random() * 256);\r\n b = Math.floor(Math.random() * 256);\r\n }\r\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\r\n}", "function generateColor(){\r\n\tvar i,j,k;\r\n\t i=Math.floor(Math.random()*255 + 1);\r\n\t j=Math.floor(Math.random()*255 + 1);\r\n\t k=Math.floor(Math.random()*255 + 1);\r\n\r\n\t \r\n\t return \"rgb(\" + i + \", \" + j +\", \" + k + \")\" ;\r\n}", "function generateRandomColor() {\n // return '#'+Math.floor(Math.random()*16777215).toString(16);\n return myColors[Math.floor(Math.random()*myColors.length)];\n}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "function getRandomColor() {\n return 'rgb(' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ')';\n}", "function rgbColorGenerator() {\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n\n return console.log(`rgb(${r}, ${g}, ${b})`);\n}", "function getRandomColor() {\n let r = 0;\n let b = 255;\n let g = 0; //Math.round(Math.random()*255);\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function randomColor() {\n // Generate random integer between 0 and 255\n function generateNumber() {\n return Math.floor(Math.random() * 256);\n }\n return \"rgb(\" + generateNumber() + \", \" + generateNumber() + \", \" + generateNumber() + \")\";\n}", "function randomColor(){\n return color3(Math.floor(Math.random()*256),\n Math.floor(Math.random()*256),\n Math.floor(Math.random()*256));\n}", "function generateRandomColour(){\n var r = Math.random()*254 +1;\n var g = Math.random()*254 +1;\n var b = Math.random()*254 +1;\n\n return `rgb(${r},${g},${b})`;\n}", "function rgbGenerator()\r\n{\r\n\tvar r= Math.floor(Math.random()*256);\r\n\tvar g= Math.floor(Math.random()*256);\r\n\tvar b= Math.floor(Math.random()*256);\r\n\r\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\" ;\r\n}", "function randColor() {\r\n var r = Math.floor(Math.random() * (256)),\r\n g = Math.floor(Math.random() * (256)),\r\n b = Math.floor(Math.random() * (256));\r\n return '#' + r.toString(16) + g.toString(16) + b.toString(16);\r\n}", "function getRandomRGB() {\n var red = getRandomInt(255);\n var green = getRandomInt(255);\n var blue = getRandomInt(255);\n return \"rgb(\" + red + \", \" + blue + \", \" + green + \")\";\n}", "function getRandomRGB() {\n var red = getRandomInt(255);\n var green = getRandomInt(255);\n var blue = getRandomInt(255);\n return \"rgb(\" + red + \", \" + blue + \", \" + green + \")\";\n}", "function randomrgb() {\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "function randomColor() {\n var r = random(256) | 0,\n g = random(256) | 0,\n b = random(256) | 0;\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n }", "function randomRgb(){\n\treturn Math.floor(Math.random() * 256) + 1;\n}", "function getRandomColor() {\r\n var rand = function() {\r\n return Math.floor(Math.random() * 256);\r\n };\r\n return `rgb(${rand()}, ${rand()}, ${rand()})`;\r\n }", "function randomColor(){\n\tvar r=Math.floor(Math.random()*256);\n\tvar g=Math.floor(Math.random()*256);\n\tvar b=Math.floor(Math.random()*256);\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n\n}", "function randomColorGenerator() {\n\tvar randomColor;\n\tred = Math.floor(Math.random() * 256 );\n\tgreen = Math.floor(Math.random() * 256 );\n\tblue = Math.floor(Math.random() * 256 );\n\trandomColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n\treturn randomColor;\n}", "function generateRGB() {\n const color = chroma.random();\n return color;\n}", "function randomColor(){\r\n var r= Math.floor(Math.random() * 256);\r\n var g= Math.floor(Math.random() * 256);\r\n var b= Math.floor(Math.random() * 256);\r\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function generateRandomRGB() {\n return (Math.floor(Math.random() * 250) + 1);\n}", "function randomColor() {\n r = random(255);\n g = random(255);\n b = random(255);\n}", "function randomColor(){\n return `rgb(${randomInt(0,256)},${randomInt(0,256)},${randomInt(0,256)})`;\n}", "function rgbGenerator(){\n\treturn \"rgb(\" + randomizer() + \", \" + randomizer() + \", \" + randomizer() + \")\";\n}", "function randomRGB () {\n let red = randomNum()\n let green = randomNum()\n let blue = randomNum()\n return [red, green, blue]\n }", "function randomColour() {\n return new rgb(\n Math.floor(Math.random() * 255),\n Math.floor(Math.random() * 255),\n Math.floor(Math.random() * 255)\n );\n}", "function generateRandomColor() {\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n return `rgb(${r}, ${g}, ${b})`;\n }", "function ranColor(){\n\tvar red = Math.floor(Math.random() * 256);\n\tvar green = Math.floor(Math.random() * 256);\n\tvar blue = Math.floor(Math.random() * 256);\n\t\n\treturn \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\n\n}", "function randomColor() {\n var r = random(0, 255);\n var b = random(0, 255);\n var g = random(0, 255);\n\n\n return color(r, b, g);\n}", "function randomColor() {\n return (\n \"rgb(\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250) + \",\" +\n Math.round(Math.random() * 250)\n + \")\"\n );\n}", "function randomColor(){\n\tvar red = getRandomNumber(255);\n\tvar green = getRandomNumber(255);\n\tvar blue = getRandomNumber(255);\n\treturn \"rgb(\" + red +\", \" + green + \", \"+ blue + \")\";\n}", "function randomRGB(num){\n return \"rgb(\" + random255() + \", \" + random255() + \", \" + random255() + \")\"\n}", "function getRandomColor() {\n let r = 0;\n let g = 0;\n let b = 0;\n while (r < 100 && g < 100 && b < 100) {\n r = Math.floor(Math.random() * 256);\n g = Math.floor(Math.random() * 256);\n b = Math.floor(Math.random() * 256);\n }\n return `rgba(${r},${g},${b},0.6)`;\n}", "function getRandomRGB() {\n return {\n red: rangedRandomVal(31, 223),\n green: rangedRandomVal(31, 223),\n blue: rangedRandomVal(31, 223),\n };\n}", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n return Color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n}", "function randomColor()\n{\n\treturn \"rgb(\" + Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\",\"+\n\t\t\t\t Math.floor(Math.random()*255)+\")\";\n}", "function randomColor(){\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n\tconst r = Math.round(255 * Math.random());\n\tconst g = Math.round(255 * Math.random());\n\tconst b = Math.round(255 * Math.random());\n\treturn {r, g, b};\n}", "function colorGeneration () {\n\tvar rgb = []; \n\tfor (var i=0; i<3;i++){\n\t\trgb[i] = Math.floor(Math.random() * 256); // gera numeros aleatorios entre 0 e 255\n\t}\n\treturn rgb; \n}", "function rndRGB() {\n var num1 = Math.floor(Math.random() *256);\n var num2 = Math.floor(Math.random() *256);\n var num3 = Math.floor(Math.random() *256);\n return 'rgb(' + num1 +', ' + num2 + ', ' + num3 +')';\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function randomRGB() {\n return Math.floor(Math.random() * 256);\n}", "function randomColor() {\n return Math.floor(Math.random() * 255);\n}", "function randomColor() {\n let red = Math.floor(Math.random() * 256);\n let green = Math.floor(Math.random() * 256);\n let blue = Math.floor(Math.random() * 256);\n let rgb = \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\n return rgb;\n}", "function randomColor() {\n\t//pick r, g, b from 0 - 255\n\tvar r = Math.floor(Math.random() * 256);\n\tvar g = Math.floor(Math.random() * 256);\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor() {\n\n let r = Math.floor(Math.random(256) * 256);\n let g = Math.floor(Math.random(256) * 256);\n let b = Math.floor(Math.random(256) * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor (){\n\tvar color = \"rgb(\";\n\tfor(var i=0; i<2; i++){\n\t\tcolor+=\"\"+Math.floor(255-parseInt(Math.random()*10)*25.5);\n\t\tcolor+=\",\";\n\t}\n\tcolor+=\"0)\";\n\treturn color;\n}", "static random() {\n return new Color(random(255), random(255), random(255))\n }", "function getRandomColor() {\n let color = 'rgb(';\n color += randomNumGen(rgbNum) + ',';\n color += randomNumGen(rgbNum) + ',';\n color += randomNumGen(rgbNum) + ')';\n return color;\n }", "function randomColor(){ \n return rgbToHex(random255(),random255(),random255())\n}", "function randomColorGenerator() {\n\t\t\t\t\t\t\treturn '#'\n\t\t\t\t\t\t\t\t\t+ (Math.random().toString(16) + '0000000')\n\t\t\t\t\t\t\t\t\t\t\t.slice(2, 8);\n\t\t\t\t\t\t}", "function randomColor() {\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomRGB() {\n\treturn Math.floor(Math.random() * 256);\n}", "function getRandomColor() {\n let r = getRandomInt(0, 256);\n let g = getRandomInt(0, 256);\n let b = getRandomInt(0, 256);\n return `rgb(${r},${g},${b})`;\n}", "function randomColour() {\n\n\tfunction value() {\n\t\treturn Math.floor(Math.random() * Math.floor(255)) \n\t}\n\treturn 'rgb(' + value() + ',' + value() + ',' + value() + ')';\n}", "function getRandomColor() {\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n return 'rgb(' + red + ',' + green + ',' + blue + ')';\n\n}", "function getRandomColor() {\n if (numberOfRgbaColorsTaken > (rgbColors.length - 1))\n return random_rgba();\n return rgbColors[numberOfRgbaColorsTaken++];\n}", "function getRandomRgb() {\n var num = Math.round(0xffffff * Math.random());\n var r = num >> 16;\n var g = num >> 8 & 255;\n var b = num & 255;\n return 'rgb(' + r + ', ' + g + ', ' + b + ')';\n}", "function randomRGB() {\r\n let r = randomInt(0, 256);\r\n let g = randomInt(0, 256);\r\n let b = randomInt(0, 256);\r\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function randomColor(){\n\tlet r = Math.floor(Math.random() * 256);\n\tlet g = Math.floor(Math.random() * 256);\n\tlet b = Math.floor(Math.random() * 256);\n\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "function generateRGB() {\n\tvar temp = Math.floor(Math.random() * 256 + 0);\t\t\t \n\treturn temp;\n}", "function newRGB() {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n rgbValue = \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n return rgbValue;\n}", "function randomColor(){\n //pick \"red\" from 0 -> 255\n let red = Math.floor(Math.random()*256);\n //pick \"green\" from 0 -> 255\n let green = Math.floor(Math.random()*256);\n //pick \"blue\" from 0 -> 255\n let blue = Math.floor(Math.random()*256);\n //construct string to match rgb format\n return \"rgb(\"+red+\", \"+green+\", \"+blue+\")\";\n}", "function randomColor(){\n\tval = Math.floor(Math.random()*255);\n\treturn val;\n}", "function randomColorGen(){\n // return `#${Math.floor(Math.random()*16777215).toString(16)}`;\n return \"#\" + Math.random().toString(16).slice(2, 8)\n}", "function randcolor(a) {\n\t\tvar r = Math.floor(Math.random()*192) + 64;\n\t\tvar g = Math.floor(Math.random()*192) + 64;\n\t\tvar b = Math.floor(Math.random()*192) + 64;\n\t\tfor (var i=0; i<a.length; i++)\n\t\t\trgb(a[i], r, g, b);\n\t}", "function generateRandomColor() {\n var r = Math.floor(Math.random() * 256); //a random number bet. 0 - 255 for red\n var g = Math.floor(Math.random() * 256); //a random number bet. 0 - 255 for green\n var b = Math.floor(Math.random() * 256); //a random number bet. 0 - 255 for blue\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\" //return the string with all values inserted\n}", "function randomColor() {\n //pick a \"red\" from 0 -255\n const r = Math.floor(Math.random() * 256);\n //pick a \"green\" from 0 -255\n const g = Math.floor(Math.random() * 256);\n //pick a \"blue\" from 0 -255\n const b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function getRandomRGBColor() {\n let randomColor = {\n r: random(255),\n g: random(255),\n b: random(255)\n }\n\n return randomColor;\n}", "function randomRGB() {\n return `rgb(${random(0, 255)},${random(0, 255)},${random(0, 255)})`;\n}", "function randomColor() {\n var color = 'rgb(';\n color += randomRGB() + ',';\n color += randomRGB() + ',';\n color += randomRGB() + ')';\n return color;\n}", "function randomColor() {\n var color = 'rgb(';\n color += randomRGB() + ',';\n color += randomRGB() + ',';\n color += randomRGB() + ')';\n return color;\n}", "function randomRGB(){\n return Math.floor(Math.random()*256);\n}", "function randomRGB() {\n // Use math.floor to generate random value btween 1-255\n return Math.floor(Math.random() * 255)\n}", "function randomRGB(){\n let r = randomNum(256);\n let g = randomNum(256);\n let b = randomNum(256);\n return \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n}", "function CreateColor()\n{\n\tr=Math.floor((Math.random() * 256) + 0);\n\tg=Math.floor((Math.random() * 256) + 0);\n\tb=Math.floor((Math.random() * 256) + 0);\n\treturn \"rgb(\"+r+\", \"+g+\", \"+b+\")\"\n}", "function createRandomRGB(){\n const r = Math.floor(Math.random()*256);\n const g = Math.floor(Math.random()*256);\n const b = Math.floor(Math.random()*256);\n return `rgb(${r},${g},${b})`;\n}", "function getRandomRgb() { \n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function randomColor () {\n var color = 'rgb(';\n color += randomRGB() + ',';\n color += randomRGB() + ',';\n color += randomRGB() + ')';\n return color;\n}", "function randomColor() {\n return \"rgb(\" + random(0, 235) +\n \", \" + random(0, 235) +\n \", \" + random(0, 235) + \")\";\n}", "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n return color;\n}", "function randomColor() { return Array.from({ length: 3 }, () => Math.floor(Math.random() * 256)); }", "function randomColor() {\r\n let red = randomNumber(0, 255)\r\n let green = randomNumber(0, 255)\r\n let blue = randomNumber(0, 255)\r\n return `rgb(${red},${green},${blue})`\r\n}", "function randomColor() {\r\n let red = Math.floor(Math.random()*256);\r\n let green = Math.floor(Math.random()*256);\r\n let blue = Math.floor(Math.random()*256);\r\n\r\n return `rgb(${red}, ${green}, ${blue})`;\r\n}", "function RandomColor() { \n\n let a = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n let c = Math.floor(Math.random() * 256);\n let colorPick = \"rgb(\" + a + \", \" + b + \", \" + c + \")\"; \n\n return colorPick; \n\n}" ]
[ "0.86590654", "0.86356455", "0.86168754", "0.8548868", "0.85040265", "0.8493826", "0.8480507", "0.8451141", "0.8409714", "0.83886814", "0.83798206", "0.8379079", "0.8376525", "0.8366138", "0.83315784", "0.83217067", "0.83207554", "0.8310129", "0.82981056", "0.8272868", "0.8254954", "0.82501584", "0.82490695", "0.82470816", "0.82448274", "0.82448274", "0.8244397", "0.82404816", "0.8239894", "0.82388204", "0.82374483", "0.82153404", "0.8204654", "0.8200086", "0.8198848", "0.81931466", "0.8192376", "0.8191038", "0.8190847", "0.817423", "0.81719965", "0.8167778", "0.8160525", "0.8159313", "0.81591463", "0.81571627", "0.8156116", "0.81507444", "0.8147574", "0.81456995", "0.81456625", "0.8134741", "0.813365", "0.8131563", "0.8131178", "0.8131178", "0.8131178", "0.81291306", "0.8125973", "0.812345", "0.8123275", "0.81224376", "0.8121695", "0.8121103", "0.81180453", "0.81172174", "0.8113411", "0.8112032", "0.8109823", "0.8105309", "0.80944055", "0.80912834", "0.80883336", "0.8088318", "0.8080232", "0.8077585", "0.80729324", "0.806901", "0.8067582", "0.8066741", "0.80633277", "0.80628717", "0.8059644", "0.8052207", "0.8050776", "0.80467564", "0.80467564", "0.80442226", "0.80423397", "0.80411255", "0.80383044", "0.8034791", "0.8033095", "0.80329597", "0.8030371", "0.80098116", "0.80078965", "0.80068314", "0.80040485", "0.80011743" ]
0.8111069
68
refresh page (called by click on refresh button)
function refresh() { window.location.reload(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshPage()\n\t\t\t{\n\t\t\t\twindow.location.reload(true);\n\t\t\t}", "function pageRefresh() {\n\tlocation.reload();\n}", "function refresh () {\r\n window.location.reload(true);\r\n}", "function refreshPage() {\n setTimeout(\"location.reload(true);\",0);\n }", "function refresh() {\n location.reload(true);\n}", "refreshPage(){\n window.location.reload();\n }", "function refreshPage() {\r\n location.reload();\r\n}", "function refresh() {\n window.location.reload(true);\n}", "function refresh() {\n window.location.reload(true);\n}", "function refresh() {\n window.location.reload(true);\n}", "function refreshPage() {\n window.location.reload(false);\n }", "function refresh() {\n location.reload();\n }", "function refresh() {\n location.reload();\n}", "function refresh() {\nwindow.location.reload();\n}", "function refreshPage() {\n window.location.reload();\n}", "function refresh_page(){\n window.location.reload();\n}", "function refreshPage() {\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload();\n }", "function refresh(){\n location.reload();\n}", "function refreshPage() {\n window.location.reload(false)\n }", "function refresh() {\n window.location.reload(false);\n}", "function refreshPage(){\n window.location.reload(false);\n }", "function refreshPage(){\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload();\n}", "function refreshPage(){\n window.location.reload()\n}", "function myrefresh() {\n window.location.reload();\n}", "function refreshPage() {\n location.reload(false);\n}", "function refresh() {\n window.location.reload(/*true*/);\n}", "function refresh()\n{\n window.location.reload( false );\n}", "function reloadpage() {\n location.reload();\n }", "function onRefreshClicked(event) {\n refresh();\n event.preventDefault();\n }", "function refreshPage() {\r\n\r\n setTimeout(function () {\r\n location.reload()\r\n }, 500);\r\n}", "function refreshPage(e) {\n if (publish.isPublishing === true || publish.isAllPublished === true) {\n window.location.reload(true);\n }\n\n pub.resetModalButtons();\n }", "function reloadPage() {\n window.location.reload();\n }", "function refreshPage() {\n history.push('/');\n window.location.reload();\n }", "function reloadPage() {\n\t\twindow.location.reload(true);\n}", "function refreshPage() {\n setShowModal(false);\n getInfoList();\n }", "function refresh_page() {\n window.location = '/home/index';\n}", "function reload(){\n\t\tlocation.reload();\n\t}", "function reloadPage() {\n\tlocation.reload();\n}", "function refresh() {\nsetInterval(\"location.reload()\",1000);\n}", "function pageReload(){\r\n location.reload();\r\n}", "function reloadPage(){\r\n\tlocation.reload();\r\n}", "function refreshPage() {\n setTimeout(() => {\n window.location.reload(false);\n }, 350);\n }", "function refresh() {\n }", "function refreshHalaman(){\n\t//refresh halaman\n\twindow.location.reload();\n}", "function reloadPage(){\n\tlocation.reload();\n}", "function reloadPage(){\n\tlocation.reload();\n}", "function reload() {\n location.reload();\n }", "function refresh_page() {\n refresh_preview();\n refresh_code();\n}", "function autoRefresh() {\n window.location.reload();\n}", "refresh() {\r\n window.location.reload();\r\n window.location.replace('/login');\r\n }", "function forceRefreshPage() {\n if (window.location.href.includes('/gradebook')) {\n console.log('doing a force refresh...');\n pjax.reload();\n }\n}", "handleRefresh() {\n window.location = window.location.pathname;\n }", "function reFresh() {\n location.reload(true);\n}", "function reload() {\n window.location.reload();\n }", "function reloadPage() {\n location.reload();\n}", "function update() {\n //Location.reload() method reloads the current URL, like the Refresh button.\n document.location.reload()\n}", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "recarga() {\n location.reload();\n }", "function refresh() {\r\nsetInterval(\"location.reload()\",2000);\r\n}", "function reloadpage() {\n window.location.reload();\n}", "function reloadPage() {\n location.reload();\n}", "function reloadPage(){\r\n window.location.reload();\r\n}", "function refresh() {\n // do not use window.location.reload() because it may cause redundant POST request\n // do not use direct assigning to window.location.href\n // because each reload will be stored in browsing history\n // do not use window.location.href as a source, because it may contain garbage\n window.location.replace($('.inner-navbar__menu-center > a.pushed').attr('href'));\n }", "function NewRecFromX() {\n refreshPage();\n}", "function refreshPage() {\n jQuery.mobile.changePage(window.location.href, {\n allowSamePageTransition: true,\n transition: 'none',\n reloadPage: true,\n reverse: false,\n changeHash: false\n });\n}", "reload() {\n window.location.reload();\n }", "function reloadPage(){\n console.log(\"click\");\n location.reload();\n}", "function refresh() {\n setTimeout(function () {\n location.reload();\n }, 60000);\n }", "function refresh() {\n var main = 'main.html';\n if ((location = 'main.html')) {\n location.refresh;\n }\n window.location = main;\n}", "function reloadPage(){\n location.reload()\n}", "function reloadPage(){\n location.reload();\n}", "function reload() {\n location.reload(true);\n}", "function reloadPage(){\n location.reload();\n}", "function reload () {\n location.reload()\n}", "static reload(){\n\t\tPage.load(Page.currentPage);\n\t}", "function reloadPage(){\n window.location.reload();\n }", "function reload() {\n location.reload();\n}", "function reload() {\n location.reload()\n}", "function AutoRefresh( t ) {\nsetTimeout(\"location.reload(true);\", t);\n}", "reload() {\n window.location.reload()\n }", "function refreshPage() {\n window.location.reload();\n}//added function to in case user wants a empty score tally", "function reloadPage() {\n window.location.reload(true);\n}", "function refreshData() {\n\n\t$(\"#data-refresh-response\").load('/fetch_data');\n}", "function reloadPage () {\n\tgSTB.Stop();\n\twindow.location.reload(true);\n}", "function reload() {\n window.location.reload();\n}", "function reload() {\n window.location.reload();\n}" ]
[ "0.8514916", "0.84528846", "0.8304804", "0.8283872", "0.8282947", "0.8273043", "0.8260663", "0.82455134", "0.82455134", "0.82455134", "0.823502", "0.8229787", "0.8216325", "0.81969965", "0.81398815", "0.81083155", "0.80973935", "0.8089189", "0.807985", "0.8032232", "0.80130774", "0.80018634", "0.7995624", "0.79869443", "0.79869443", "0.79869443", "0.79869443", "0.79795825", "0.797256", "0.79643947", "0.7920728", "0.78886425", "0.7883594", "0.78257126", "0.78061604", "0.7751001", "0.7744609", "0.7707801", "0.7706039", "0.7703036", "0.76811916", "0.7670754", "0.76628506", "0.7654104", "0.7635731", "0.76294106", "0.76153284", "0.7615008", "0.7610771", "0.76085836", "0.76085836", "0.75984377", "0.75906545", "0.7589632", "0.7577704", "0.75586236", "0.7539945", "0.75372064", "0.75370365", "0.7488069", "0.74849904", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7478851", "0.7471741", "0.7458874", "0.7452314", "0.74473006", "0.7442436", "0.7437509", "0.7433616", "0.7420699", "0.7409896", "0.739906", "0.73917", "0.738967", "0.73888946", "0.73875976", "0.73802704", "0.7374576", "0.73680353", "0.7367509", "0.734216", "0.7337158", "0.7324382", "0.7324069", "0.73151284", "0.7312842", "0.7304193", "0.7297447", "0.7286388", "0.7286388" ]
0.8535902
0
draw part of background, mountains
function drawMountains() { L10_Super.crc2.beginPath(); let gradient = L10_Super.crc2.createLinearGradient(0, 0, 0, L10_Super.crc2.canvas.height); gradient.addColorStop(0, "whitesmoke"); gradient.addColorStop(0.5, "darkslategrey"); L10_Super.crc2.fillStyle = gradient; L10_Super.crc2.moveTo(500, 500); L10_Super.crc2.quadraticCurveTo(100, -100, -200, 500); L10_Super.crc2.moveTo(1500, 500); L10_Super.crc2.quadraticCurveTo(700, -200, 300, 500); L10_Super.crc2.fill(); L10_Super.crc2.strokeStyle = "whitesmoke"; L10_Super.crc2.lineWidth = 2; L10_Super.crc2.stroke(); L10_Super.crc2.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n drawbackground();\n drawHoles();\n }", "function drawBackground() {\n // sky\n skyTop.tesselate(HORIZONTAL, 0);\n skyBackground.tesselate(HORIZONTAL, skyTop.height);\n\n // grass blades\n groundHeight = HEIGHT - grass.height * 2;\n for (var pos in grassBladePositions) {\n grassBlade = grassBladePositions[pos];\n grassBlade.draw(pos * grassBlade.width,\n groundHeight - grassBlade.height);\n }\n\n // ground\n grass.tesselate(HORIZONTAL, groundHeight);\n stone.tesselate(HORIZONTAL, groundHeight + grass.height);\n // drawTesselation(stone, HORIZONTAL, lowestHeight);\n}", "function drawBackground() {\n // Wasser\n L10_Canvas.crc2.fillStyle = \"#3686e1\";\n L10_Canvas.crc2.fillRect(0, 0, 600, 800);\n // Stein\n L10_Canvas.crc2.fillStyle = \"#768b99\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 480);\n L10_Canvas.crc2.quadraticCurveTo(320, 450, 350, 650);\n L10_Canvas.crc2.lineTo(0, 600);\n L10_Canvas.crc2.stroke();\n L10_Canvas.crc2.fill();\n // Sand\n L10_Canvas.crc2.fillStyle = \"#ae8f58\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 600);\n L10_Canvas.crc2.quadraticCurveTo(150, 550, 300, 600);\n L10_Canvas.crc2.quadraticCurveTo(450, 650, 600, 600);\n L10_Canvas.crc2.lineTo(600, 800);\n L10_Canvas.crc2.lineTo(0, 800);\n L10_Canvas.crc2.fill();\n }", "function render() {\n\n var baseSegment = findSegment(position);\n var basePercent = Util.percentRemaining(position, segmentLength);\n var playerSegment = findSegment(position+playerZ);\n var playerPercent = Util.percentRemaining(position+playerZ, segmentLength);\n var playerY = Util.interpolate(playerSegment.p1.world.y, playerSegment.p2.world.y, playerPercent);\n var maxy = height;\n\n var x = 0;\n var dx = - (baseSegment.curve * basePercent);\n\n // Clear the canvas\n ctx.clearRect(0, 0, width, height);\n\n // Order the background layers\n if (currentBackground == 0) {\n // Build the list of positions in the image to extract the appropriate background\n // Depending on the current background, load as current the night or day version\n background_pos_cur = [BACKGROUND.SKY, BACKGROUND.HILLS, BACKGROUND.TREES];\n background_pos_next = [BACKGROUND.SKY2, BACKGROUND.HILLS2, BACKGROUND.TREES2];\n } else {\n background_pos_cur = [BACKGROUND.SKY2, BACKGROUND.HILLS2, BACKGROUND.TREES2];\n background_pos_next = [BACKGROUND.SKY, BACKGROUND.HILLS, BACKGROUND.TREES];\n }\n // Draw the background layers\n if (!changeBackgroundFlag) {\n // No switching, we draw one set of backgrounds\n Render.background(ctx, background, width, height, background_pos_cur[0], skyOffset, resolution * skySpeed * playerY, 1.0);\n Render.background(ctx, background, width, height, background_pos_cur[1], hillOffset, resolution * hillSpeed * playerY, 1.0);\n Render.background(ctx, background, width, height, background_pos_cur[2], treeOffset, resolution * treeSpeed * playerY, 1.0);\n } else {\n // else we are in the process of switching, do a progressive blending\n // continue the blending\n changeBackgroundCurrentAlpha += 0.01; // increase the alpha for one, and decrease for the next background set\n Render.background(ctx, background, width, height, background_pos_cur[0], skyOffset, resolution * skySpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_cur[1], hillOffset, resolution * hillSpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_cur[2], treeOffset, resolution * treeSpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[0], skyOffset, resolution * skySpeed * playerY, changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[1], hillOffset, resolution * hillSpeed * playerY, changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[2], treeOffset, resolution * treeSpeed * playerY, changeBackgroundCurrentAlpha);\n if (changeBackgroundCurrentAlpha >= 1.0) {\n // blending is done, disable the flags and reinit all related vars\n // Note: it is important to still do the drawing (and not put it in an if statement) because else the last drawing won't be done, there will be no background for a split-second and this will produce a flickering effect\n currentBackground = (currentBackground + 1) % 2\n changeBackgroundCurrentAlpha = 0.0;\n changeBackgroundFlag = false;\n }\n }\n\n var n, i, segment, car, sprite, spriteScale, spriteX, spriteY;\n\n for(n = 0 ; n < drawDistance ; n++) {\n\n segment = segments[(baseSegment.index + n) % segments.length];\n segment.looped = segment.index < baseSegment.index;\n segment.fog = Util.exponentialFog(n/drawDistance, fogDensity);\n segment.clip = maxy;\n\n Util.project(segment.p1, (playerX * roadWidth) - x, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n Util.project(segment.p2, (playerX * roadWidth) - x - dx, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n\n x = x + dx;\n dx = dx + segment.curve;\n\n if ((segment.p1.camera.z <= cameraDepth) || // behind us\n (segment.p2.screen.y >= segment.p1.screen.y) || // back face cull\n (segment.p2.screen.y >= maxy)) // clip by (already rendered) hill\n continue;\n\n Render.segment(ctx, width, lanes,\n segment.p1.screen.x,\n segment.p1.screen.y,\n segment.p1.screen.w,\n segment.p2.screen.x,\n segment.p2.screen.y,\n segment.p2.screen.w,\n segment.fog,\n segment.color);\n\n maxy = segment.p1.screen.y;\n }\n\n for(n = (drawDistance-1) ; n > 0 ; n--) {\n segment = segments[(baseSegment.index + n) % segments.length];\n\n for(i = 0 ; i < segment.cars.length ; i++) {\n car = segment.cars[i];\n sprite = car.sprite;\n spriteScale = Util.interpolate(segment.p1.screen.scale, segment.p2.screen.scale, car.percent);\n spriteX = Util.interpolate(segment.p1.screen.x, segment.p2.screen.x, car.percent) + (spriteScale * car.offset * roadWidth * width/2);\n spriteY = Util.interpolate(segment.p1.screen.y, segment.p2.screen.y, car.percent);\n Render.sprite(ctx, width, height, resolution, roadWidth, sprites, car.sprite, spriteScale, spriteX, spriteY, -0.5, -1, segment.clip);\n }\n\n for(i = 0 ; i < segment.sprites.length ; i++) {\n sprite = segment.sprites[i];\n spriteScale = segment.p1.screen.scale;\n spriteX = segment.p1.screen.x + (spriteScale * sprite.offset * roadWidth * width/2);\n spriteY = segment.p1.screen.y;\n Render.sprite(ctx, width, height, resolution, roadWidth, sprites, sprite.source, spriteScale, spriteX, spriteY, (sprite.offset < 0 ? -1 : 0), -1, segment.clip);\n }\n\n if (segment == playerSegment) {\n Render.player(ctx, width, height, resolution, roadWidth, sprites, speed/maxSpeed,\n cameraDepth/playerZ,\n width/2,\n (height/2) - (cameraDepth/playerZ * Util.interpolate(playerSegment.p1.camera.y, playerSegment.p2.camera.y, playerPercent) * height/2),\n speed * (keyLeft ? -1 : keyRight ? 1 : 0),\n playerSegment.p2.world.y - playerSegment.p1.world.y);\n }\n }\n\t\t\t\n // start horizon tilt\n if (enableTilt) {\n rotation=0;\n if (baseSegment.curve==0) {\n rotation=-currentRotation;\n currentRotation=0;\n } else {\n newrot = Math.round(baseSegment.curve*speed/maxSpeed*100)/100;\n rotation=newrot - currentRotation ;\n currentRotation = newrot ;\n }\n if (rotation!=0) {\n //ctx.save(); // doesn't help with moire problem\n ctx.translate(canvas.width/2,canvas.height/2);\n ctx.rotate(-rotation*(Math.PI/90));\n ctx.translate(-canvas.width/2,-canvas.height/2);\n //ctx.restore();\n }\n }\n\n // Draw \"Game Over\" screen\n if (gameOverFlag) {\n ctx.font = \"3em Arial\";\n ctx.fillStyle = \"magenta\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"GAME OVER\", canvas.width/2, canvas.height/2);\n ctx.fillText(\"(refresh to restart)\", canvas.width/2, canvas.height/1.5);\n }\n }", "drawBackground(ctx) {\n this.drawHorizonGradient(ctx);\n if(this.moon !== undefined) {\n this.moon.draw(ctx);\n } else {\n this.sun.draw(ctx);\n }\n this.drawTrees(ctx);\n }", "function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx.fillStyle = \"black\";\n\tctx.fill();\n}", "function draw() {\n rectMode(CENTER);\n background(0);\n paper.display();\n ground.display();\n bin1.display();\n bin2.display();\n bin3.display();\n drawSprites();\n \n}", "function drawEverything(){\n bg.draw()\n bgCloud.draw()\n}", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "function drawBackground() {\n //drawShadow(); //drawDog shadow beneath dog first\n context.fillStyle = BG_COLOR;\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\n context.fillStyle = '#83B799';\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\n}", "function drawBG() {\n\tsetBG('#00B2EE');\n\tdrawGrid(16);\n\tlet i;\n\tfor (i = 0; i < levelWidth; i++) {\n\t\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\n\t}\n\tdecorateBG();\n}", "function render() {\n background.removeAllChildren();\n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFillB = draw.rect(canvasWidth, canvasHeight,'#2F4832');\n background.addChild(backgroundFillB);\n \n var backgroundFill = draw.rect(canvasWidth, groundY,'#447272');\n background.addChild(backgroundFill);\n \n \n \n // TODO: 3 - Add a moon and starfield\n \n var circle;\n for(var i=0;i<300;i++) {\n circle = draw.circle(2,'LightGray','LightGray',2);\n circle.x = canvasWidth*Math.random();\n circle.y = groundY*Math.random() -20;\n background.addChild(circle);\n }\n \n \n \n \n \n \n var shapeA = draw.bitmap('img/moon.png');\n shapeA.x = canvasWidth -200;\n shapeA.y = -50;\n shapeA.scaleX = 0.5;\n shapeA.scaleY = 0.5;\n background.addChild(shapeA);\n \n \n \n // TODO: 5 - Add buildings! Q: This is before TODO 4 for a reason! Why?\n// var buildingHeight = 200;\n// var building;\n// for(var i=0;i<8;++i) {\n// building = draw.rect(75,buildingHeight,'LightGreen','DarkGreen',5);\n// building.x = 200*i;\n// building.y = groundY-buildingHeight -2;\n// background.addChild(building);\n// buildings.push(building);\n// }\n \n // TODO Marvin, Add my Own\n \n for (var i = 0; i < 10; i++){\n groundmm1 = draw.bitmap('img/groundmm2.png');\n groundmm1.x = 240 * i;\n groundmm1.y = groundY;\n background.addChild(groundmm1);\n groundArr.push(groundmm1);\n }\n \n// while(groundmm1.x < canvasWidth){\n// groundmm1 = draw.bitmap('img/groundmm2.png');\n// groundmm1.x = groundmm1.x +242;\n// groundmm1.y = groundY;\n// background.addChild(groundmm1);\n// }\n//// \n \n \n \n buildingsmm1 = draw.bitmap('img/buildingsmm1.png');\n buildingsmm1.x = 0;\n buildingsmm1.y = groundY -293;\n background.addChild(buildingsmm1);\n \n buildingsmm1b = draw.bitmap('img/buildingsmm1.png');\n buildingsmm1b.x = 2632;\n buildingsmm1b.y = groundY -293;\n background.addChild(buildingsmm1b);\n \n \n \n treemm1 = draw.bitmap('img/treemm1.png');\n treemm1.x = canvasWidth -1400;\n treemm1.y = groundY -250\n background.addChild(treemm1);\n \n treemm2 = draw.bitmap('img/treemm2.png');\n treemm2.x = canvasWidth -950;\n treemm2.y = groundY -250;\n background.addChild(treemm2);\n \n treemm3 = draw.bitmap('img/treemm3.png');\n treemm3.x = canvasWidth -100;\n treemm3.y = groundY -250;\n background.addChild(treemm3);\n \n treemm4 = draw.bitmap('img/treemm4.png');\n treemm4.x = canvasWidth -300;\n treemm4.y = groundY -2500;\n background.addChild(treemm4);\n \n \n // TODO 4: Part 1 - Add a tree\n \n treeM1 = draw.bitmap('img/treeM1.png');\n treeM1.x = canvasWidth -790;\n treeM1.y = groundY -215;\n background.addChild(treeM1);\n \n poni1 = draw.bitmap('img/poni2.png');\n poni1.x = 1150;\n poni1.y = groundY -84;\n poni1.scaleX = 0.05;\n poni1.scaleY = 0.05;\n background.addChild(poni1);\n \n }// end of render function - DO NOT DELETE", "drawBackground() {\n this.cxt.fillStyle = '#FFE5CE'\n this.cxt.fillRect(0, 0, this.width, this.height)\n }", "function draw() {\n imageMode(CENTER);\n background(253, 226, 135);\n paper.display();\n ground.display();\n dustbin1.display();\n dustbin2.display();\n dustbin3.display();\n drawSprites();\n\n}", "drawBG() {\n // rename width/height for convenience in drawing below\n let w = this.myWidth;\n let h = this.myHeight;\n // Draw the grass background\n this.p.background(this.bgColor);\n // Draw the water\n this.p.stroke(this.waterColor);\n this.p.fill(this.waterColor);\n this.p.beginShape();\n this.p.curveVertex(0, h - (h * 1/4));\n this.p.curveVertex(0, h - (h * 1/4));\n this.p.curveVertex(w * 1/5, h - (h * 1/5));\n this.p.curveVertex(w * 2/5, h - (h * 1/3));\n this.p.curveVertex(w * 3/5, h - (h * 1/6));\n this.p.curveVertex(w * 4/5, h - (h * 1/4));\n this.p.curveVertex(w, h - (h * 1/5));\n this.p.curveVertex(w,h);\n this.p.curveVertex(0,h);\n this.p.curveVertex(w * 1/5, h - (h * 1/5));\n this.p.endShape();\n // Draw left island\n this.p.fill(this.bgColor);\n this.p.beginShape();\n this.p.curveVertex((w * 1/10) - 100, h - (h * 1/10));\n this.p.curveVertex((w * 2/10) - 100, h - (h * 1/7));\n this.p.curveVertex((w * 5.5/20) - 100, h - (h * 1/9));\n this.p.curveVertex((w * 7.5/20) - 100, h - (h * 1/6));\n this.p.curveVertex((w * 3/10) - 100, h + (h * 1/10));\n this.p.curveVertex((w * 2/10) - 100, h + (h * 1/20));\n this.p.curveVertex((w * 1/9) - 100, h - (h * 1/20));\n this.p.curveVertex((w * 1/10) - 100, h - (h * 1/10));\n this.p.curveVertex((w * 2/10) - 100, h - (h * 1/7));\n this.p.endShape();\n // Draw right island\n this.p.fill(this.bgColor);\n this.p.beginShape();\n this.p.curveVertex(w * 0.52, h);\n this.p.curveVertex(w * 0.52, h);\n this.p.curveVertex(w * 0.57, h * 0.94);\n this.p.curveVertex(w * 0.62, h * 0.93);\n this.p.curveVertex(w * 0.67, h * 0.95);\n this.p.curveVertex(w * 0.72, h * 0.90);\n this.p.curveVertex(w * 0.75, h * 0.92);\n this.p.curveVertex(w * 0.80, h);\n this.p.curveVertex(w * 0.81, h * 1.05);\n this.p.curveVertex(w * 0.83, h);\n this.p.curveVertex(w * 0.52, h);\n this.p.endShape();\n }", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "draw(ctx, width, height, tilesize) {\n // Draw rooms\n this.bspMap.rooms.forEach((c, i) => {\n ctx.beginPath();\n ctx.fillStyle = \"#000\";\n\n const image = new Image();\n image.src = \"images/FloorTile001.png\";\n var m_canvas = document.getElementById(\"bg-canvas\");\n var m_context = m_canvas.getContext(\"2d\");\n image.addEventListener(\"load\", () => {\n m_context.drawImage(image, c.x * tilesize, c.y * tilesize);\n });\n ctx.fillRect(c.x * tilesize, c.y * tilesize, c.width * tilesize, c.height * tilesize);\n });\n\n // Draw halls\n this.bspMap.halls.forEach((c, i) => {\n c.forEach((h) => {\n ctx.beginPath();\n ctx.fillStyle = \"#000\";\n ctx.fillRect(h.x * 16, h.y * 16, h.width * 16, h.height * 16);\n });\n });\n\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n ctx.fillStyle = \"rgba(166, 5, 104, 0.1)\";\n if (this.bspMap.rooms.some((room) => room.x !== x) && this.bspMap.rooms.some((room) => room.y !== y)) {\n ctx.fillRect(x * 16, y * 16, 16, 16);\n\n const image = new Image();\n image.src = \"images/BrickWall_003.png\";\n var m_canvas = document.getElementById(\"wall-canvas\");\n var m_context = m_canvas.getContext(\"2d\");\n image.addEventListener(\"load\", () => {\n m_context.drawImage(image, x * tilesize, y * tilesize);\n });\n }\n }\n }\n }", "background(lib){\n lib.moveTo(lib.width/2,lib.height/2);\n lib.penColor(\"black\");\n lib.dot(500);\n }", "function drawBackground(){\n ctx.drawImage(space, 0, 0, canvas.width, canvas.height);\n switch(levelnum){\n case 0:\n //Free Flight\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n case 1:\n //Mercury\n ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25);\n break;\n case 2:\n //Venus\n ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 3:\n //Moon\n ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25);\n break;\n case 4:\n //Mars\n ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25);\n break;\n case 5:\n //Ganymede\n ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25);\n break;\n case 6:\n //Titan\n ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25);\n break;\n case 7:\n //Uranus\n ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 8:\n //Neptune\n ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25);\n break;\n case 9:\n //Black Hole\n break;\n default:\n //Not recognised\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n }\n //bonus landing area\n if (levelnum != 0 && levelnum != 9){\n ctx.fillStyle = \"#00F\";\n ctx.fillRect(800,(canvas.height/2)+300, 100, 10);\n }\n}", "_drawWalkableArea() {\n if (this.scene && this.scene.walkable) {\n this.graphics.beginFill(0xFF3300, 0.0);\n this.graphics.lineStyle(1, 0xFF3300, 1.0);\n this.graphics.drawPolygon(this.scene.walkable);\n this.graphics.endFill();\n }\n }", "drawbackground(){\n CTX.fillStyle = \"#41f459\";\n CTX.fillRect(this.x,this.y, this.width, this.height);\n\n\n }", "drawDebug(ctx, width, height, tilesize) {\n console.log(\"Draw Debug\");\n // Draw BSP Sections\n this.bspMap.leafs.forEach((l) => {\n ctx.beginPath();\n ctx.strokeStyle = \"#8b2628\";\n ctx.strokeRect(l.x * tilesize, l.y * tilesize, l.width * tilesize, l.height * tilesize);\n });\n\n // Draw rooms\n this.bspMap.rooms.forEach((room, i) => {\n ctx.beginPath();\n ctx.fillStyle = \"#000\";\n ctx.fillRect(\n room.rect.x * tilesize,\n room.rect.y * tilesize,\n room.rect.width * tilesize,\n room.rect.height * tilesize\n );\n });\n\n // Draw halls\n this.bspMap.halls.forEach((c, i) => {\n c.forEach((h) => {\n ctx.beginPath();\n ctx.fillStyle = \"#013c56\";\n ctx.fillRect(h.x * tilesize, h.y * tilesize, h.width * tilesize, h.height * tilesize);\n });\n });\n\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n ctx.fillStyle = \"rgba(166, 5, 104, 0.1)\";\n if (this.bspMap.rooms.some((room) => room.x !== x) && this.bspMap.rooms.some((room) => room.y !== y)) {\n ctx.fillRect(x * tilesize, y * tilesize, tilesize, tilesize);\n }\n }\n }\n }", "function drawBackgrounds() {\n for (i = 0; i < 3; i++) {\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\n }\n\n for (j = 0; j < 6; j++) {\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_elem_2_x + j * 1050, 70, 0.28); //middle distanced background layer\n }\n\n for (k = 0; k < 10; k++) {\n addBackgroundObject('./img/background/01_nearBG/completo.png', bg_elem_1_x + k * 960, -30, 0.45); //nearest background layer\n }\n}", "function drawGround() {\n //ctx.fillStyle = '#FFE699'; //old ground layer\n //ctx.fillRect(0, 375, canvas.width, canvas.height - 375);\n addBackgroundObject('./img/background/06_Ground.png', 0, 320, 0.4); //ground layer\n if (isMovingRight && bg_elem_1_x > LEVEL_WALL_FINISH) {\n bg_elem_1_x = bg_elem_1_x - GAME_SPEED;\n bg_elem_2_x = bg_elem_2_x - (0.5 * GAME_SPEED);\n bg_elem_3_x = bg_elem_3_x - (0.35 * GAME_SPEED);\n for (i = 0; i < chickens.length; i++) {\n chickens[i].position_x = chickens[i].position_x - GAME_SPEED;\n }\n }\n\n if (isMovingLeft && bg_elem_1_x < LEVEL_WALL_START) {\n bg_elem_1_x = bg_elem_1_x + GAME_SPEED;\n bg_elem_2_x = bg_elem_2_x + (0.4 * GAME_SPEED);\n bg_elem_3_x = bg_elem_3_x + (0.25 * GAME_SPEED);\n for (i = 0; i < chickens.length; i++) {\n chickens[i].position_x = chickens[i].position_x + GAME_SPEED;\n }\n }\n drawclouds();\n drawBackgrounds();\n\n}", "function background(){\n //background\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, width, height);\n //grid of dots\n ctx.fillStyle = '#AAAAAA';\n for(var h = 50; h < height; h += 50){\n for(var w = 50; w < width; w += 50){\n drawDot(w, h);\n }\n }\n}", "drawBg() {\n let g = this,\n cxt = g.context,\n sunnum = window._main.sunnum,\n cards = window._main.cards,\n img = imageFromPath(allImg.bg);\n cxt.drawImage(img, 0, 0);\n sunnum.draw(cxt);\n }", "function drawMountains()\n{\n\tfor(var i = 0; i < mountain.length; i++)\n\t\t{\n\t\t\tfill(128,128,128,100);\n\t\t\ttriangle(mountain[i].x_pos - 75,\n\t\t\t\t mountain[i].y_pos +272,\n\t\t\t\t mountain[i].x_pos,\n\t\t\t\t mountain[i].y_pos,\n\t\t\t\t mountain[i].x_pos + 75,\n\t\t\t\t mountain[i].y_pos + 272);\n\t\t}\n}", "backgroundDisplay() {\n push();\n rectMode(CORNER);\n noStroke();\n fill(this.color);\n rect(this.x, this.y, this.width, this.height);\n pop()\n }", "function draw() { \r\n background(234,31,58); // Set the background to black\r\n y = y - 1; \r\n if (y < 2) { \r\n y = height; \r\n } \r\n stroke(234,31,58);\r\n fill(234,31,184);\r\n rect(0, y, width, y); \r\n \r\n stroke(234,31,58);\r\n fill(234,226,128);\r\n rect(0, y, width, y/2); \r\n \r\n stroke(234,31,58);\r\n fill(250,159,114);\r\n rect(0, y, width, y/4); \r\n\r\n}", "function drawBackGround() {\n\t//for (let i = 0; i < 14; i++) {\n\t//\tfor (let j = 0; j < 10; j++) {\n\t//\t\tcontext.drawImage(bg, 64*i, 64*j);\n\t//\t}\n\t//}\n\tcontext.drawImage(bg, 0, 0,800,600);\n\n}", "function drawclouds() {\n addBackgroundObject('./img/background/04_clouds/Completo.png', 100 - cloudoffset, -60, 0.5);\n addBackgroundObject('./img/background/04_clouds/1.png', 1000 - cloudoffset, -60, 0.5);\n addBackgroundObject('./img/background/04_clouds/2.png', 1200 - cloudoffset, -60, 0.6);\n}", "function draw() {\r\n\r\n //Background color.\r\n background(189, 253, 255);\r\n\r\n //This updates the Matter Engine.\r\n Engine.update(engine);\r\n\r\n //To display the platform.\r\n surface.display();\r\n\r\n //To display bricks.\r\n\r\n }", "function setupObstacles() {\r\n path[0] = new imageLib(backgroundImg.canvasName, 0, 0, 0, 0);\r\n path[0].endX = 0,\r\n path[0].endY = 0;\r\n path[0].slopeX = 16/13;\r\n path[0].slopeY = 3410/13;\r\n path[0].drawLine();\r\n\r\n path[1] = new imageLib(backgroundImg.canvasName, 0, 0, 0, 0);\r\n path[1].endX = 0; \r\n path[1].endY = 0;\r\n path[1].slopeX = -16/13;\r\n path[1].slopeY = 3410/13;\r\n path[1].drawLine();\r\n}", "function drawBackground() {\n\tcontext.save();\n\tcontext.fillStyle = \"#f0f0ff\";\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\tcontext.translate(0, canvas.height - 50);\n\tcontext.fillStyle = \"#007f00\";\n\tcontext.fillRect(0, 0, canvas.width, 50);\n\tcontext.restore();\n}", "function draw_background() {\n\t// fills background\n\tbackground(colors.bg);\n\t// draws golden quadrilateral\n\tnoStroke();\n\tfill(colors.bg_quad);\n\tquad(Math.floor(width / 3), 0, width, Math.floor(height / 3), \n\t\tMath.floor(width / 3 * 2), height, 0, Math.floor(height * .55));\n\n\t// fills in top left w/ custom shape to shape the side of the quadrilateral into a curve\n\tfill(colors.bg_dark);\n\tbeginShape();\n\tvertex(0, 0);\n\tvertex(Math.floor(width / 3), 0);\n\t// temporary variable for computing coordinates of vertices for easy input\n\tlet v = [{x: Math.floor(width * .2), y: Math.floor(height * .2)}, \n\t\t{x: Math.floor(width * .25), y: width * .4}, {x: 0, y: Math.floor(height * .55)}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n\n\t// fills in top right w/ custom shape to shape other side of quadrilateral\n\tbeginShape();\n\tvertex(Math.floor(width / 3), 0);\n\tvertex(width, 0);\n\tvertex(width, height / 3);\n\tv = [{x: Math.floor(width * .8), y: Math.floor(height * .28)}, \n\t\t{x: Math.floor(width * .55), y: Math.floor(height * .2)}, {x: Math.floor(width / 3), y: 0}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n}", "function dust() {\n poster.fill(State.Colors.background);\n poster.noStroke();\n\n for (var i = 0; i < rects.length; i++) {\n poster.rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);\n }\n}", "function drawBackground() {\n\n // first clear the the whole canvas\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // this will generate the main gradient (main-light) of wallpaper\n let mainGrd = ctx.createRadialGradient(\n canvas.width / 2, rndNum(-85, -100), 1,\n canvas.width / 2, canvasMax / 4, canvasMin * 1.8);\n mainGrd.addColorStop(.4, \"#1a0003\");\n mainGrd.addColorStop(0, \"#d58801\");\n\n // after creating the gradient and set it colors,\n // we should set it as the fillStyle of the context and\n // paint whole canvas\n ctx.fillStyle = mainGrd;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}", "function draw(){\n \n setLights();\n buildGround();\n buildWalls(1);\n makeCeiling();\n makeLights();\n //drawFloor();\n //drawBoxes();\n\n}", "function draw() {\n background(204, 153, 0);\n}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }", "function draw() {\n // We slowly clear each frame\n const opacity = 0.05;\n background(0, 0, 0, opacity * 255);\n\n if (!active) {\n const dim = min(width, height);\n noStroke();\n fill(255);\n polygon(width / 2, height / 2, dim * 0.05, 3);\n }\n}", "function render() {\n // useful variables\n var canvasWidth = app.canvas.width;\n var canvasHeight = app.canvas.height;\n var groundY = ground.y;\n\n background.removeAllChildren();\n\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFill = draw.rect(canvasWidth,canvasHeight,'rgb(35, 40, 51)');\n background.addChild(backgroundFill);\n\n // TODO: 3 - Add a moon and starfield\n function randomNum(min, max){\n return(Math.random() * (+max - +min) + +min);\n }\n var customStar;\n for(var i = 0; i < 600; i++){\n \n customStar = draw.bitmap('img/customStar.gif');\n customStar.x = randomNum(1, 1500);\n customStar.y = randomNum(1, 1000);\n background.addChild(customStar);\n customStars.push(customStar);\n }\n \n var customStarSpec;\n for(var i = 0; i < 20; i++){\n customStarSpec = draw.bitmap('img/customStarSpec.png');\n customStarSpec.x = randomNum(1, 1500);\n customStarSpec.y = randomNum(1, 1000);\n background.addChild(customStarSpec);\n customStarsSpec.push(customStarsSpec);\n }\n \n customMoon = draw.bitmap('img/customMoon.png');\n background.addChild(customMoon);\n customMoon.x = 700;\n customMoon.y = 50;\n \n // TODO: 5 - Add buildings! Q: This is before TODO 4 for a reason! Why?\n var building;\n for(var i=1;i<7;++i) {\n var buildingHeight = randomNum(100,300);\n building = draw.rect(75,buildingHeight,'LightGray','Black',1);\n building.x = 225 * i;\n building.y = groundY-buildingHeight;\n background.addChild(building);\n buildings.push(building);\n }\n\n // TODO 4: Part 1 - Add a tree\n tree = draw.bitmap('img/tree.png');\n tree.x = 900;\n tree.y = 200;\n background.addChild(tree);\n }", "function drawBackground() {\n var STEP_Y = 12,\n i = context.canvas.height;\n \n context.strokeStyle = 'rgba(0,0,200,0.225)';\n context.lineWidth = 0.5;\n\n context.save();\n context.restore();\n\n while(i > STEP_Y*4) {\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n context.save();\n\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n\n context.moveTo(35,0);\n context.lineTo(35,context.canvas.height);\n context.stroke();\n\n context.restore();\n}", "function drawBackground() {\r\n context.drawImage(backgroundCanvas, 0, 0);\r\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "function drawMountains()\n{\n for (var i = 0; i < mountains.length; i++)\n {\n fill(153, 0, 76)\n triangle(mountains[i].x_pos, floorPos_y - 293, mountains[i].x_pos - 278, floorPos_y, mountains[i].x_pos + 258, floorPos_y);\n \n fill(255)\n triangle(mountains[i].x_pos, 139, mountains[i].x_pos - 77, 220, mountains[i].x_pos + 73, 220);\n \n }\n}", "_drawBackground() {\n const { x, y, width, height } = this.config;\n this._background = this.scene.add.rectangle( x, y, width, height,\n this.config.backgroundColor );\n this._background.setOrigin( 0, 0 );\n }", "function makeGround() {\n c.beginPath();\n c.rect(0, canvas.height - 100, canvas.width, 50);\n c.fillStyle = \"green\";\n c.fill();\n}", "function draw() {\n background(img);\n for (var i = 0; i < stations[currentStation].dots.length; i++) {\n stations[currentStation].show(i);\n }\n}", "function draw(context) {\n context.drawImage(background, ofsetted_x, ofsetted_y);\n debug.do_draw('panels') && draw_debug(context);\n }", "function drawTower(){\n push();\n for(var i=0; i<18; i++)\n { \n fill(colors[i]);\n drawVertices(boxes[i].vertices);\n }\n pop();\n}", "function drawSlingshot(){\n push();\n // your code here\n fill(255, 255, 255);\n drawVertices(slingshotBird.vertices);\n drawConstraint(slingshotConstraint);\n pop();\n}", "function drawAll()\n{\t\n //\tDraw background\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n //\tDraw the universe\n univ.draw();\n}", "draw() {\n if (this.isFilled) {\n this.fill();\n } else {\n this.outline();\n }\n }", "function draw() {\n\n var ctx = getContext();\n\n // Log.group(\"A draw started\");\n //alert('Paint 1')\n reset(getCanvas());\n\n //if grid visible paint it\n//\tif(gridVisible){ //paint grid\n addBackground(getCanvas());\n//\t}\n\n //alert('Paint 2')\n STACK.paint(ctx);\n\n minimap.updateMinimap();\n// Log.groupEnd();\n//alert('Paint 3')\n\n refCabecera();\n}", "function Update() {\n drawBackground();\n blocs.forEach(bloc => {\n bloc.draw();\n bloc.move();\n });\n}", "createBackground() {\n const canvas = document.getElementById(\"background\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = window.innerWidth;\n //save some space for the footer\n canvas.height = window.innerHeight;\n //clear previous canvas to avoid memory leaks\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.RED_OFFSET = Math.floor(Math.random() * (MAX_RED - MIN_RED)) + MIN_RED; \n this.GREEN_OFFSET = Math.floor(Math.random() * (MAX_GREEN - MIN_GREEN)) + MIN_GREEN; \n this.BLUE_OFFSET = Math.floor(Math.random() * (MAX_BLUE - MIN_BLUE)) + MIN_BLUE; \n //each overlapping layer will contain randomly drawn shapes and colors\n this.canvasLayers = new Array(NUM_LAYERS);\n //parameters that will be fed into the drawLayer on each iteration. These will be updated each time\n //we call the drawLayer function\n const step = Math.floor(window.width / this.canvasLayers.length);\n const parameters = {\n blue: 150,\n green: 155, \n red: 255,\n position: 0,\n step: step\n }\n\n for (let position = 0; position < this.canvasLayers.length; position++) {\n parameters.position = position;\n this.drawLayer(canvas, ctx, parameters);\n }\n\n this.drawClouds(canvas, ctx);\n this.drawSun(canvas, ctx);\n }", "function draw() {\n var isHit = false; // Initialize to false\n background(0);\n drawTerrain();\n\n wallManager(); // Add and remove walls as they enter and leave the screen.\n \n // Update all walls position and draw.\n for (let i=0; i<walls.length; i++) {\n walls[i].move();\n walls[i].draw();\n isHit |= walls[i].isHitBy(trump); // True if hit by any wall.\n }\n trump.DEBUG = isHit; // Show debug overlay when hit.\n if (isHit) {trump.deathEvent();} // Perform Death functions and sounds.\n \n trump.applyGravity();\n trump.draw();\n}", "function draw() {\n background(220);\n}", "draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }", "function drawAll(parts){\r\n\t\t var x,y,d;\r\n\t\t var i = 0;\r\n\t\t var len = parts.length;\r\n\t\t var p;\r\n\t\t ctx.beginPath();\r\n\t\t for(;i < len; i++){\r\n\t\t p = parts[i];\r\n\t\t x = wh-p.x;\r\n\t\t y = hh-p.y;\r\n\t\t d = x*x + y*y;\r\n\t\t x *= grav / d;\r\n\t\t y *= grav / d;\r\n\t\t p.dx += x;\r\n\t\t p.dy += y;\r\n\t\t p.x += p.dx;\r\n\t\t p.y += p.dy;\r\n\t\t if(p.x <= 0){\r\n\t\t p.dx -= p.dx/2;\r\n\t\t p.x = 1;\r\n\t\t }else\r\n\t\t if(p.x >= w){\r\n\t\t p.dx -= p.dx/2;\r\n\t\t p.x = w-1;\r\n\t\t }\r\n\t\t if(p.y <= 0){\r\n\t\t p.dy -= p.dy/2;\r\n\t\t p.y = 1;\r\n\t\t }else\r\n\t\t if(p.y >= h){\r\n\t\t p.dy -= p.dy/2;\r\n\t\t p.y = w-1;\r\n\t\t }\r\n\t\t ctx.moveTo(p.x+partSize,p.y)\r\n\t\t ctx.arc(p.x,p.y,partSize,0,PI2)\r\n\t\t }\r\n\t\t ctx.fill();\r\n\t\t}", "function drawSky() {\n\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\n\n}", "function drawBG() {\n magicalCanvas.crc2.clearRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n if (day == true) {\n //sky\n magicalCanvas.crc2.fillStyle = \"skyblue\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"limegreen\";\n magicalCanvas.crc2.strokeStyle = \"limegreen\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 250, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n //foreground\n magicalCanvas.crc2.fillStyle = \"forestgreen\";\n magicalCanvas.crc2.strokeStyle = \"forestgreen\";\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.bezierCurveTo(20, magicalCanvas.canvas.height - 150, 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 20);\n magicalCanvas.crc2.bezierCurveTo(magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 150, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n else {\n //sky\n magicalCanvas.crc2.fillStyle = \"#252D3F\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"#142615\";\n magicalCanvas.crc2.strokeStyle = \"#142615\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 270, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n }", "function drawBackground() {\n // draw 3x3 copies of the background, offset by the position\n const xOffset = ((x % background.width) + background.width) % background.width;\n const yOffset = ((y % background.height) + background.height) % background.height;\n for (let xPos = -xOffset; xPos < canvas.width; xPos += background.width) {\n for (let yPos = -yOffset; yPos < canvas.height; yPos += background.height) {\n ctx.drawImage(background, xPos, yPos);\n }\n }\n}", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "function draw() {\n background(240);\n drawTarget();\n}", "function draw() {\n\tbackground(100, 155, 255); // fill the sky blue\n\n\tnoStroke();\n\tfill(0, 155, 0);\n\trect(0, floorPos_y, width, height / 4); // draw some green ground\n\n\tpush();\n\ttranslate(scrollPos, 0);\n\n\t// Draw mountains.\n\tmountains.forEach(mountain => (mountain).draw());\n\n\t// Draw clouds.\n\tclouds.forEach(function (cloud) {\n\t\tcloud.draw();\n\t\tcloud.x += 0.1;\n\t\tif (cloud.x > width + 1500) {\n\t\t\tcloud.x = -500;\n\t\t}\n\t});\n\n\t// Draw trees.\n\ttrees.forEach(tree => (tree).draw());\n\n\t// Draw canyons\n\tcanyons.forEach(function (canyon) {\n\t\tcanyon.draw();\n\t\tcanyon.checkCanyon();\n\t});\n\n\t// Draw collectable items.\n\tcollectables.forEach(function (colectable) {\n\t\tif (!colectable.isFound) {\n\t\t\tcolectable.draw();\n\t\t\tcolectable.checkCollectable(gameChar_world_x, gameChar_y);\n\t\t}\n\t});\n\n\tplatforms.forEach(function (platform) {\n\t\tplatform.draw();\n\t});\n\n\t// Draw backpack\n\tbackpack.checkBackpack();\n\tbackpack.draw();\n\n\t// Draw backpack flames\n\tflames.forEach(function(flame)\n\t{\n\t\tflame.draw();\n\t\tflame.update();\n\t});\n\t// Draw enemies\n\tenemies.forEach(function(enemy)\n\t{\n\t\tlet isContact = enemy.checkContact(gameChar_world_x, gameChar_y);\n\t\tenemy.draw();\n\t\tenemy.update();\n\t\tif(isContact)\n\t\t{\n\t\t\tif(lives > 0)\n\t\t\t{\n\t\t\t\tstartGame();\n\t\t\t\t//break;\n\t\t\t}\n\t\t}\n\t\t\n\t});\n\n\t// Draw flag pole reached\n\trenderFlagpole();\n\n\t// Check remaining lives\n\tcheckPlayerDie();\n\tpop();\n\t// Draw game character.\n\tdrawGameChar();\n\n\t// Draw Score text\n\tdrawScore();\n\n\t// Draw lives tokens\n\tdrawLivesToken();\n\n\t// Logic for displays \"Game over\" when lives is less than 1\n\tif (lives < 1) {\n\t\ttextAlign(CENTER);\n\t\ttextStyle(BOLD);\n\t\tstroke(255, 99, 71);\n\t\tfill(255, 215, 0);\n\t\ttextSize(50);\n\t\ttext(\"GAME OVER\", width / 2, height / 2);\n\t\ttextSize(20);\n\t\ttext(\"INSERT COIN\", width / 2, height * 0.55);\n\t\treturn;\n\t}\n\n\t// Logic for displays \"Level complete. Press space to continue.\" when `flagpole.isReached` is true.\n\tif (flagpole.isReached == true) {\n\t\ttextAlign(CENTER);\n\t\ttextStyle(BOLD);\n\t\ttext(\"Press space to continue\", width / 2, height / 3);\n\t\treturn;\n\t}\n\n\t// Logic to make the game character move or the background scroll.\n\tif (isLeft) {\n\t\tif (gameChar_x > width * 0.2) {\n\t\t\tgameChar_x -= 5;\n\t\t} else {\n\t\t\tscrollPos += 5;\n\t\t}\n\t}\n\n\tif (isRight) {\n\t\tif (gameChar_x < width * 0.8) {\n\t\t\tgameChar_x += 5;\n\t\t} else {\n\t\t\tscrollPos -= 5; // negative for moving against the background\n\t\t}\n\t}\n\n\t// Logic to make the game character rise and fall.\n\tif (gameChar_y < floorPos_y) {\n\t\tlet isContact = false;\n\t\tfor (let i = 0; i < platforms.length; i++) {\n\t\t\tif (platforms[i].checkContact(gameChar_world_x, gameChar_y)) {\n\t\t\t\tisContact = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isContact) {\n\t\t\tgameChar_y += 2;\n\t\t\tisFalling = true;\n\t\t}\n\t} else {\n\t\tisFalling = false;\n\t}\n\n\t// Update real position of gameChar for collision detection.\n\tgameChar_world_x = gameChar_x - scrollPos;\n\n\t// Check collision detection game character with flag pole\n\tif (flagpole.isReached == false) {\n\t\tcheckFlagpole();\n\t}\n\n\n}", "draw() {\n if (this.lawnmower) {\n // if empty, this is the first init; if true, mow all the old grass and redraw relevant to resize\n this.lawnmower.forEach((x) => {\n while (x.lastChild) {\n x.lastChild.remove();\n }\n });\n }\n\n for (let i = 0; i < 4; i++) {\n // 4 lines of grass\n this.soil[i] = document.querySelector(`.grass${i}`);\n this.soil[i].style.width = `${this.amt * init.w}px`;\n\n for (let j = 0; j < this.amt; j++) {\n this.roots[j] = new Image(50, 50);\n this.roots[j].src = 'img/grs.png';\n this.soil[i].appendChild(this.roots[j]);\n }\n }\n this.soil.forEach((x) => {\n x.style.bottom = `${this.soil.indexOf(x) * 30 - 50}px`; });\n // all lines just slightly on top of each other n under the road, except for the last\n this.soil[3].style.top = `${road.y - 50 - (road.linH / 3)}px`;\n }", "function drawWaterfall(){\n\t\t\n\t\t}", "function drawBG()\n{\n ctx.beginPath();\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE);\n ctx.fillStyle = '#333'; // Gray\n ctx.fill();\n}", "function drawMountains()\n{\n for(var i = 0; i < mountains.length; i++)\n {\n // mountain\n\t\t\tfill(190,180,200);\n triangle(mountains[i].x_Pos,mountains[i].y_Pos-200,mountains[i].x_Pos+170,\n mountains[i].y_Pos,mountains[i].x_Pos-170,mountains[i].y_Pos);\n \n //Mountain Snow\n fill(255);\n triangle(mountains[i].x_Pos,mountains[i].y_Pos-200,\n mountains[i].x_Pos+85,mountains[i].y_Pos-100,mountains[i].x_Pos-85,\n mountains[i].y_Pos-100);\n }\n}", "function drawScreen() {\n\t\tcircleCount=0;\n\t\tcircles = [];\n\t\tcontext.fillStyle = bgColor;\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\n\t}", "function draw() {\n background(10,0,40);\n environment.draw()\n}", "drawBackground() {\n const width = this.canvas.width;\n const height = this.canvas.height;\n const radius = this.getBorderRadius();\n this.context.fillStyle = this.getBackgroundColor();\n this.context.beginPath();\n this.context.moveTo(radius, 0);\n this.context.arcTo(width, 0, width, radius, radius);\n this.context.arcTo(width, height, width - radius, height, radius);\n this.context.arcTo(0, height, 0, height - radius, radius);\n this.context.arcTo(0, 0, radius, 0, radius);\n this.context.fill();\n }", "function draw(){\r\n background(\"white\");\r\n \r\n \r\n \r\n}", "draw() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.fillStyle = this.background.getColor();\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n\n // draw the background image if any\n if ( (this.image) && (this.image.src != \"\") && (this.image.ready) && (this.image.complete) ) {\n if (this.bg_display === \"topleft\") {\n this.ctx.drawImage(this.image, 0, 0);\n }\n else if (this.bg_display === \"stretch\") {\n this.ctx.drawImage(this.image, 0, 0, this.w, this.h);\n }\n else if (this.bg_display === \"patch\") {\n this.ctx.fillStyle = ctx.createPattern(this.image, \"repeat\");\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n else if (this.bg_display === \"center\") {\n this.ctx.drawImage(this.image, (this.w-this.image.width)/2, (this.h-this.image.height)/2);\n }\n }\n\n // if not interact with the space\n if (!this.click) {\n // update the graphics to build its primitives\n for(var i=0, l=this.graphics.length; i<l; i++) {\n this.graphics[i].update();\n }\n \n this.primitives = [];\n // split the primitives if needed\n if (this.split) {\n for (var i=0, l=this.graphics.length; i<l; i++) {\n thisGraphics_i = this.graphics[i];\n\n for (var j=i+1; j<l; j++) {\n thisGraphicsNext = this.graphics[j];\n\n thisGraphics_i.splitFace(thisGraphicsNext);\n thisGraphicsNext.splitFace(thisGraphics_i);\n }\n\n this.primitives = this.primitives.concat( thisGraphics_i.primitives || [] );\n }\n }\n else {\n for (var i=0, l=this.graphics.length; i<l; i++) {\n thisGraphics_i = this.graphics[i];\n\n if (thisGraphics_i.split) {\n for (var j=i+1; j<l; j++) {\n thisGraphicsNext = this.graphics[j];\n\n if (thisGraphicsNext.split) {\n thisGraphics_i.splitFace(thisGraphicsNext);\n }\n }\n }\n\n this.primitives = this.primitives.concat( thisGraphics_i.primitives || [] );\n }\n }\n // end split\n }\n\n for(var i=0, l=this.primitives.length; i<l; i++) {\n this.primitives[i].computeDepth(this);\n }\n\n this.primitives = this.primitives.sort(function (a, b) { return b.depth - a.depth; });\n \n // draw the primitives\n if (this.render === \"painter\") {\n this.drawPainter(this.primitives);\n }\n else {\n for(var i=0, l=this.primitives.length; i<l; i++) {\n this.primitives[i].draw(this.ctx, this);\n }\n }\n\n // draw the graphic controls\n for (var i=0, l=this.graphicsCtr.length; i<l; i++) {\n this.graphicsCtr[i].draw();\n }\n }", "function draw() {\n background(\"blue\");\n \n drawBackHair();\n drawBody();\n drawHead();\n drawBangs();\n drawFace();\n drawAccs();\n\n // if (gDebugMode == true){\n // \tdrawDebugInfo();\n // }\n }", "function draw() {\n background(backgroundColor);\n\n const car = drawCar(carImage,125,200, .75 );\n car.addTarget().setBearing(fakeTargetBearing += increment);\n car.drawLights();\n}", "paint() {\r\n graphics.fillStyle = \"#1aff1a\";\r\n graphics.fillRect(this.x - this.w / 2, this.y - this.h, this.w, this.h);\r\n }", "drawGraphic() {\n //get the width of the canvas and save it on a local variable\n var width = view.width;\n //get the height of the canvas and save it on a local variable\n var height = view.height;\n //define a local variable for containing the current abscissa of drawing point. Initialize it to 0.\n var x=0;\n //define a local variable for containing the current ordinate of drawing point. Initialize it to half the height of the canvas.\n var y=height/2;\n //move the drawing point to the initial position and start filling the graphic with green color\n this.moveTo(x, y).beginFill(\"green\");\n //for every hole object in the holes array\n for (var holeObject of this.holes) {\n //set the abscissa to the leftmargin of the hole\n x=holeObject.leftMargin;\n this.lineTo(x,y);\n //move the point to the left bottom of the hole\n y+=holeObject.hole.depth;\n this.lineTo(x,y);\n //move the point to the right bottom of the hole\n x+=holeObject.hole.width;\n this.lineTo(x,y);\n //move the point to the right top of the hole\n y-=holeObject.hole.depth;\n this.lineTo(x,y);\n }\n //set tha absissa to the end of the ground\n x=width;\n this.lineTo(x,y);\n //draw a line to close the right part of the ground\n y=height;\n this.lineTo(x,y);\n //draw a line to close the bottom part of the ground\n x=0;\n this.lineTo(x,y);\n //draw a line to close the left part of the ground\n y=height/2;\n this.lineTo(x,y);\n //close the drawn path and complete the filling\n this.closePath().endFill();\n //return this for method chaining\n return this;\n }", "function drawBackground() {\n var STEP_Y = 12,\n TOP_MARGIN = STEP_Y*4,\n LEFT_MARGIN = 35,\n i = context.canvas.height;\n \n context.save();\n\n context.strokeStyle = 'lightgray';\n context.lineWidth = 0.5;\n\n while(i > TOP_MARGIN) { // Draw horizontal lines from bottom up\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n // Draw vertical line\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n context.moveTo(LEFT_MARGIN, 0);\n context.lineTo(LEFT_MARGIN, context.canvas.height);\n context.stroke();\n\n context.restore();\n}", "function draw(){\n drawFloor();\n drawBox();\n}", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "function draw() {\n background(147,112,219);\n\n drawRects();\n drawCircles();\n drawEllipse();\n noStroke();\n drawTri();\n\n fill(204);\n quad(100,100,200,100,200,250,140,230);\n//white half of circle\n fill(255);\n arc(480,500,100,100,PI,TWO_PI);\n//larger arc \n fill(100,23,45);\n arc(480,650,200,200,0,PI + QUARTER_PI);\n\n //gray square with lining\n fill(120,120,120);\n stroke(23);\n strokeWeight(7);\n square(800,600,120);\n}", "function draw() {\n\n rectMode(CENTER);\n background(255)\n boxdown.display();\n rightbox.display();\n leftbox.display();\n paper.display();\n groundy.display();\n \n \t\n \n drawSprites();\n keyPressed();\n \n}", "function cw_drawScreen() {\n ctx.clearRect(0,0,canvas.width,canvas.height);\n ctx.save();\n ctx.translate(400, 200);\n ctx.scale(1.5*zoom, -zoom);\n cw_drawFloor(floorBody);\n //cw_drawFloor(boxBody);\n cw_drawCar(carBody);\n ctx.restore();\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n // if not initialized\n if (this.viewportFollow === null) return;\n\n // draw background\n this._drawEveryCellWrapper(this._drawLayer.bind(this, 'ground'));\n\n // draw foreground\n for (const [, layerName, renderFunction, renderArgs] of this.customizedLayers) {\n if (renderFunction === '_drawCharacters') {\n this._drawCharacters(renderArgs);\n } else {\n this._drawEveryCellWrapper(this._drawLayer.bind(this, layerName));\n }\n }\n }", "function draw(context) {\n \n\ttry {\n context.drawImage(background, ofsetted_x, ofsetted_y);\n\t} catch (e) {\n\t\tconsole.log(background);\n\t}\n debug.do_draw('panels') && draw_debug(context);\n }", "function draw() {\n\tif (gameOn){\n\t\tupdate();\n\t}\n\t\n\tcontext.drawImage(backgroundImage, 0, 0);\n\tcontext.drawImage(robinHood, robinHoodLocation.x, robinHoodLocation.y);\n\tcontext.drawImage(goblin, goblinLocation.x, goblinLocation.y);\n\t// context.drawImage(displayArrow, displayArrowLocation.x, displayArrowLocation.y);\n\tcontext.drawImage(arrow, arrowLocation.x, arrowLocation.y);\n\trequestAnimationFrame(draw);\n}", "function mainDraw() {\n if (canvasValid == false) {\n clear(ctx);\n \n // Add stuff you want drawn in the background all the time here\n \n // draw all boxes\n var l = boxes2.length;\n for (var i = 0; i < l; i++) {\n boxes2[i].draw(ctx); // we used to call drawshape, but now each box draws itself\n }\n \n // Add stuff you want drawn on top all the time here\n \n canvasValid = true;\n }\n}", "function drawBackground(){\n ctx = myGameArea.context;\n //clear canvas\n ctx.clearRect(0, 0, 6656, 468);\n backgroundImg.draw();\n \n }", "function render() {\n background.removeAllChildren();\n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFill = draw.rect(canvasWidth,groundY, 'black');\n background.addChild(backgroundFill);\n var shape = draw.circle(50, 'yellow', 'orange', 10);\n background.addChild(shape);\n // TODO: 3 - Add a moon and starfield\n var rect;\nfor(var i=0;i<10;i++) {\n rect = draw.rect(10, 10, 'orange','orange', 10);\n rect.x = canvasWidth*Math.random();\n rect.y = groundY -150\n background.addChild(rect);\n} \nvar moon = draw.bitmap('img/index.jpg');\nmoon.x = 700;\nmoon.y = 25;\nmoon.scaleX = 1.0;\nmoon.scaleY = 1.0;\nbackground.addChild(moon);\n // TODO: 5 - Add buildings! Q: This is before TODO 4 for a reason! Why?\n var buildingHeight = 300;\nvar building;\nfor(var i=0;i<5;++i) {\n building = draw.rect(75,buildingHeight,'LightGray','Black',1);\n building.x = 200*i;\n building.y = groundY-buildingHeight;\n background.addChild(building);\n buildings.push(building);\n}\n \n // TODO 4: Part 1 - Add a tree\n\ntree = draw.bitmap('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw0TEA0NDQ0NFg0NDQ0ODQ0NDQ8NDRANIBEiIhURHx8kHSggJBolGxMVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGBAQGCseHR0rKy0rKy0tLS0tLS0tLS0tLS0tLS0rKy0tLS0tLS0tLS0rLS0rLSstKy0tKysrLS03Lf/AABEIAPEA0QMBIgACEQEDEQH/xAAcAAAABwEBAAAAAAAAAAAAAAAAAQIDBAUGBwj/xABTEAABAgQCBgUHBwkGBAQHAAACAQMABBESBSEGEyIxMkFCUVJhcRQjYnKBkaGCkpOxwdHwBxUWJDNDg6LhU1RjlMLSRGSy8kVVdKMXNDWE0+Lx/8QAGwEAAgMBAQEAAAAAAAAAAAAAAAECAwQFBgf/xAAqEQACAgEEAQQBBAMBAAAAAAAAAQIDEQQSITFBBRMiURQVMlJhBkKBcf/aAAwDAQACEQMRAD8AvroOsNXQL46Z8+HqwdYY1kHrIAHoEM6yBrIWQH4K6GdZE7DMMefXzY0Dtlu/rCcklyX00zsliKyNMgRKIAKqS8IjGqwXAUbo67RXN4pyD71ifheEtsjlma8RlxLFisY7LNx6PRenRp+UuZApB0hl94AEjMkQQFSIi3IKb1iow/SGWmQe8lNb2xXIhsLdkaIvJeuM8ppds68YN8pFm5OMoSATraH2SNEL3RIy6o4ekqrzhJ5pXib1oi9mbp9MELku+L3RPSV9hxuXeNSlTcRnbuV5l1Voma5qlVRKLujLDVqUsNG6ehcYbk8vyjqtIIhqlF5waLEKZxOWbNtlx5sXXStbAi2iXuSNmUjClkp8SkeJvs7bJdY8w9kZwso387LoY03Em0BdkoyeKy3E6I0ISteHsl1+Cxqqs8M4vqej3x3LtFVdB3QlVgov9xHmnBi6wlVgUgWQvdQsAugVhCjBKkL3IhtETMyAIN5cXCIiRmXgKZrFdMaQywceu2f8Ik+uHZ5wgcaIQuImXgIbrLRQULf9kZ/S9t4NWeqZAFZbVuwiXemedEWtcljdRXGeM+Tq6bQwnDcy1/SuS7bn0JwI5zc52/8Aq++BGz8Ssv8A06n+zqyJAWDrArHNOEFSBB1GBUYBhKMHSBlAVYALrR7BEe844vm0K2wd6+PUkbllkRRBFEQU3Ikc8wbFCYcu6C/tB607XjHQpd4TFDFaoSVSMF2d3J6n0uVThiPfkfhl81ESIUqqCpW9dE3Q9Aig6xzBdM5lVcCZZbcYduEmBGxwE3KCKuRL40ihGeFp8HpRxbhzATyMg5smn45LG80n0SbcQn5YEGYuvJBJaOdaU3IvfGHwjBkdNWBdtmLiVsXRqB03h1oqRzLY2Zw+fo7enlQ4OXX2iZiEjrhSdk0Oy695oP2zD+9VRE784Yw6UfnJpmrfCbJTBg2SBaBISqtea0RKJGm0R0ZnWZknnVBtpBIDBs9Zr+pVyyROXONsqIl1tK21+72RKrTcJy4M9mq25hHn6YibnGWhvedAArS4yEUqvLOMBpvgVDKcbzaeJFcMS2mneRovVsp4LFNijc4/NaiZNtH9pKPXagOoAROtNyxb6H4yVfzZN0Npy9tortZYqb2lXmmS0WJztU3tawKul1pTTz9r+jT6GY75SzRxU8oZ2Hh615GncqRYYnLV86I12bXg7bX3pGJKUcwyYKZUlNkwNppkON7pJcq5Dbn4xv8ADJ0HmW5hvMHQEx9saKJtrD7Rj1EI5zH9rORadFOyhA9KoByp8RGRuJcu5O72Qxo7pGEwipbY81S8Lq/KReaR03HMLbIDaMay72yQ/wBma9Lwjjc9o0ElMXHMPAf7uwSW4buu1UVc40ytVaT8HLu9PhdFqPEja6yBrYzjeMN8JHiThbvNS5Jd7UGAk8aKWrl8Y/iOsJ8TRKRX+bD+Jzf0K3+RpkcgayMmc4P9m8JW3EJ4wNfaiVRIi4dPTDrpWvutsdgZkZgyRFpVKpXPrSLK742SwkRl6NbFZyaLG37UaIBqZEYD7QWu+M/pVMmQDcK7RIgiRDlROrqi0xKWC0NQ8qmjmyLzprdUFRaVVUrnGenpecPZKUet7VwffHotN7cIYzyatPROuO1lP5M92E/mgRZXTPYT+WBFu+P2XbJGuYm6pxQ6D1Yp62lE9sqxknWuzzNsFHlEtXvxswNd+NmIl0GpRDaiok+U58/5YLW1iNWFNlldCkkui2mtTfPSH7++NLohjdheTuLsL+zLqLq9sZEiKDQiS3/bFc6Ny5NtGqjVP4o7SiwcZnQ/GdaGqcVNa2Pzh7UaeOVOLi8M9RXLcsiYpn5CQae8scRoHjJARwyptrlki5VXdWJuLTqMMuvkiqLYKSiO9Y5dOTjs6+XlLoAyA3ubWTbfUKLvVeuMt1sYYWOfBsoplZl5wjaYxpnLMHqhBxxRO10gpQOvxVOpIYYlm3Jj87sTiqwjVXQbucUqJmFOSc6b6xksZZlXBcmpMzprRB5oxobZqNqOZ8lonviEy69LGj8u+ia0bx7DqJkoODyVN1YyvUNyxJZX9GyOkjKHxeJecmlxhyVxJs3ZdFSbluJo8jcZ35U39aLyXKMnIyLxqXk9L2dtsAIm37O2PWvJUixkmn33kfw9pRmAIdY1cNjVVzz3K0WfenVGqnND3lmW5mWeBvaFxxbVVUOqXoKdRJvrA6nZ8l2ONypThko8DxWZmXm8NnmwebIrnLxJiZZERVbypvzonLfHTWGAAUABQQBLRFMkRIIZcEW9AG9RtU0FLlTqrD9O+NtcNq5eWc62xTeUsL6EOAioqKlUXfGV0iw3YLapaJKy92cq2F9kaDEMSZZS5w6eiOZe6OYaV6bzjqnLy0hN6nhv1fH4VzhzlHDTK0m3wZ9yZfXZKZl//fWGDDtTkmhekwa/WSRTnITPSksST1RJfqWA1hryXEEhiNyjaRHLG9kvVVcowxhFPll3OCUoGpiz5YyQOjc7Z5oNUPKu1mqrE1rDCJwbzkVaESERuNaIu4lWibqcooZfCJsFMhlJ8NyN24eR30Tn1JEtmQmF2nvzwJlxC1hjtnsrFzzztfI448o07Wj0uvSwofR1Tq/G5IlBorLJtF+a1/gH/ujGnLOp+6xwvWkTD6khSI8n/DYz/l3f9sZpxtf+zJ5h9G0/R2T7Mj9E7/vgRjNbMf3TGPoXvugRD27f5MMwL2aMaxJYLKKsNpYsAWiR76awsHgrltSRIugIURtZ6MBXYp2sy4JVYWB5RFBwl4YXX2RCSRp08LE8pZQ8owdIZQyhQu9qI5Zqjpk5ZxgnyM2bRi43kQl870Y6dhU8DzQuj0h2h7Jc0jkaTAxd6LY7qXUAy8y5kXol1xjupclnyjs1WKDSXKZ0t0BIVFUqi5Kkcu0s0c1DiGI1YMvNlb+yPseHVHURJFRFTNFzSG5uVBwCbcFFAhoQrHLtqU1h9nY02odUsro53oaMs41MyDg2vviRKa/vU5Ki9Y9UK0O0aA3pryyVPzVoCrrZIyZ5oaoi71yRa98WeG6EWTQvE9VllzWMinGq0yQl6kr7Y21PfFNdOUty6Lb9R8nsfDKzB8FlpbWJLtoGtUVJEIl3JRKV3eEWkEkRpybAO814QHiL7vGNPEV9IxtuT57HXngASM1RBRKkRbo55pJ+UuXG9qVeaQsx1hEK09KkQPyizM+5a0itCwRUJkisRVXcKnuWvxjnoyogu35I3tW7Q1/osUSvTXx5LIwx2TpjSVDIjexJxSXsiKe7KDl8bll4p6Y+U4SfUMQln2R4ZmX+S2H2wf5+bT9+i/JaT7IyyW7lplscLpl4xi8vX/6gqfxCX64smJ8C4MRT+ZfqjGrjba80X5IL/phSYhLLtKxd6rQ/YKRVKnJJSSNwE+SJb+dGk+SUOhNmv/jMv80q+6qRh0xCUp/8o8nqif2LEhjGpQdkWXk/hkv1xS9PIe9M2TmIG3tfnR0+1qRaD/qJYbb0npxT04n+VNPhGbDSVlOEHk/g0+yFlpP2Tm09VoPrthe1P6Fw/Jqv0mH/AM0mf8s1AjI/pL6c/wDN/wD1gofsy+hYX2WbjjLa2Ay0duyRvXKplzVKLkn3QU22FoOtiqA7XYIq2EJUVK80ziS/hYDxPGPauYNfimX/APYjT0wK2A3VGmhtG7eSrmpr3qse8jNSax/0+fzbfZErAgUgReQhjPJIMrUthgiKHiS5NnihtGTiqLiu+zbbGyX7evATdyrbDqmKbO+EktvrQ23vG6B88+Bws9tqK5b7HjSijBkVO8SgTG+EAUG3dHI3eoTa6OgaC4/enkrhbQfsiLpD1RtVVM44i24QEDzZUJCujq+jeMBMNIeV6ZGPUUcrUU7fkujs6TVbntl2XKJAVYbccEUUiVEFN5FGC0o0xFRdblj2RB1L6cSiCKvs2kjFOaiss6KWeEW2k2mLMuhg2qE6LZmXUNEjlmi35R5vywnZ07mZgrC4URndSndEbH3bWpoiXhaFq7tGUY6WUrR2wQeLhqvFWMm92xafRZt2yPRGOyLMwwVwoQG3QuaKC7i9kc1Y0HNXQAzBZRCJHBG2oCiLRKElM8s4t/yX6SVTyF47v7MiGnyI0ukcq42JuS3GrZC39iL4b0jkSdlUmovBsrkumuGcixnD2GHTb1RoAEQiZNDtU6Vq8vBYq2zFVo27J3dk7mD9iKlF98XeN6VzTrJSbwtFrTQSO2hgiFn+Moq1abQbXLCFNnZbz96LHVpnJQzYuSrUVxUsRHElJvmAJ6typ7xygkR7pG0nzljY4s9I4fISjL0trHlbXVi04TDyEu0ZXjmiJVEh3A8Kln22ZqXfmwB0f2UzqJpE2qKiqYrWlN8UvUxUNzWFnhlcYNvCMST1vE8Cfwj+yEpPj/eWflNuxaYtPy6vug2DRNAVl4tiwpqmSnsEKb60yhGCpJuO6qaJ1sFpa9rHVQFVaJVEJaJ3xqqg7OF2QclEjjriS5t2WIfWNIAtzPYlV/8AuzSNxOfk4mUW6VDWtEOyY4lqvgra/BYotLtEzkm2Xplt0iecsHUzYOKBIF2dzKdXKJe00L3EVWomv7CV/wA0f3QIjeUf8piP+Za//HAg9t/0PejX4bPu6xpq41aNwQILqiSFkuXx9kRH1oRDdwko+5aQ75a0KFqWVEy6ZuVUR6kTl4xDuj1kINyzjB4WSXQ5fAvhtSgRdtIbR+XbfcLVyzRuPWqdo27KIqIprcqJz3Rdv4JLg06WteJ0xN2WMiJDJ0aXyhAmSr4JVUXuinwqeJh0HhJUG0mniHeIFTbTvRURfYsbN0HRU8RN2WVhWwIXgIlQc6GYju1pJYNY8n6pfdDUKPUfB6HQQhKiX2YlS8flCSKncqLmkEJ5wc3MK4ZunxOOG4Xo3Gq09iUT2QzWPS0ZlWm1zg4cltseCe4l20MNgJL0Yji4ScMKWZPtQ9klwi9zpm90lyTDMRS2JOCY0cu6jgcP7wOSpFRfBKsN1KUcSK3e96lHjHRf49pY/MEQDssi3W30lNESvsQ4zEtcVnZITD1r5iq/yAkBwqeUF/hND7akv2wrD5ioSrdvA4l30Sl9qR5DXfG1xXR7DQycq4yl2V+lb1WXf/UB9SxmUA7bbQ4eK2sXmkhl5OI9c0vwBYo2VfJLQZUiEdq0h2fZBTH4ltj5LHDTdbUHRNRICEhsFoNy1p1x3jRvFAnJQSLittcHmKpzjgDLL6cUma/xPsSNToXj78o+N8sYsukguWkR791EpVV8Iz6qiUluXglCxdErT3RO17ykGaipFrwDLa5GncsZIpchUDCTVCAwMa2rmK1Suee6O1TM1LzL5tmCESCgNtTAkCCFlxvEi0WiVongsc50qwApcPKWGldkycEBeLzK3qtKIlcw3UWKNNqXJ7JDlJMqcS0oF/VhiOGgSgREJNPGwee9OpU7qxdrpzIpLOtsMOtOoyrbLVqKCVyyVFpkirvpGQWcaVCLyOtOLzgwCl7hE/IjESG8SFwMx681jXPT1ySUo4S6WRxm+WmOSLlo3CyC3bVxkKfZEhhxSM7m2k82HBbtZrvy/FYjS8wFB/U9n0iCpexVgTDV/BLup6hB98a9Lb7Nik0VTr3LCZrNHtO52RQGxFHpRP3BkQkHqlyTuVKeEWP5R9NZGew+X1JqMw3NCrku4NHgq0VV6lTvTKOc/m01/cT3zRX7YR+b/wDCm09Zmsa79TTPlRwymFUkS/zkHp/NgRH8n9Ga+gX7oEYtxbsZsroJTgQUezweIApQEOBAgwGBd0Xei8xcT2HOkupnm1BvqamUFVQk6q096RRJBoRoomC0MCE2y7JpmkYNfpVbU/vwaNNY65L68jjqEKkJ5GJEDg+mK0X4pDaFFzpEIOE1PN5NTrWt9WYFERwF/HJYpwyUSHoxVRqm9NuX7kuR2Vr3MeGywdwWeFBIpZ7PhtGu/wAIe/RrEKX+THT5P1VrHRkxQQl2HTSputgQh6VlfYkTZGY1jYOUpdy+EeJt/wAq1afS7O/D0ilrJylnA54ltGWdy7Q0+uDmMBnQS45Z1B9Ea/VHWGJgCusKthWEPMSTkqQ8sVv/ACzVJ8pf+Ev0enHBxItH54wmBCWeW8hIdkk6CJ9kKmZB5tWhJkxsaO65skUnVSieOUdsRYSVOlT5UYLPWp2Sy49nSqqVcVFeDgWJ4DPuMBZLO5OumWySZKKIkFohhhK+6T4qAg1btddUoPfzjv8AWGfJma36tq7tWDX3xZV67KPDjkU6t3k5s1hZV826hU4hLJbV7lhK4VOIQGzLzC6pxHWy1JKhKJVDxRY0sxLG6RzjdLyKjQ7r5dEtz8d/uheO4s+mHqMuC65ommJhCdFqyiZrdXNF7uuO5XroW15ksP6M0INTxkizJzMy0LLwg06ZWEerIHpdVz1RIi5oSZVRaLC9IcCeMRN91DsEQEAbJpgKFVKDVa1y39SRXy6vsyjDSivl2KvNm4GtCrUvVK0Usqoi+9Y2EoRKhy7+ZhxemHI/Hr745f7JOcVhZ4NmFnBxzFWgTWjalwipcI8oTMMWy7/oyIfGv3RsNLMDBPKHTr+xO0h6RUWir47oy8+n6tOn1SLXvzp9cdL3laotFcY7WzOSUw8oiTYvWcPC0u7LmkSxmHl4RmF7VrLWz4xo9D9HAclAdcJ7zpKQ2W0FN3PnlF4xoiCXghPKGyV2xW5B3Ur3xvenjtyzOrXnCMF5W+OyQPIXFtCG72Q4k2fSB76IvsKNueiQlNk0Ru5SrLvCFRuNUtXPuiV+iwKn7WY+jGG9LBjd8kc+8rPsO/Ql/ugRvf0Ra/vEz9CMCD8OJH8lmJ1iQL++Il0EpR7f2zyntkzWQWsiLfAQoPbD2yVrIGtiKsCkP20G1GkwEkfamMO6ec3J/wDqB42kXlVM/asVsnapgJZCrgiXXvoqRClpg2nG32/2rLgut+lTo+CpVPbF7jEkTzxTeHtG5KmITDhhwMkvGCqqolUVK0Sq5x5bW1vTSsj1GS4Z0q4e4ovyjpM9JsGrLRuKK5i2I80+zdEglO4ZWWREIQQnDUagyC7suarRaJ7Vg5KVFUZecDzwtCN3ZyziRoyNRmnF4znJhHPknaP8ojHgfT9PG67EuUj0beIcGA0smpiTcemZcn3HpfVNPERV1yqCFRQFEFARFTNErE2R02fc8mQ8OmgrtTCtiDtB1KkiCla+NUyjZ4no+w8WsJXQdttU2XFbUk5IvJacoi4LhLDcxMA2K2sttAN5EZqRVIzVVzVVoCeyPS2+naWyKzHkzRdil3wYye/KaKueSycm9ribV0Tmx1Qaqy66iZ7uuid8X6yjyI1NzT5vSzjYETduoBi5K3KKLQkzStaqkS/0JZU6a93yfZ8xa3VQT92p0rZyp1ZVjSuS4KBNKKWKFlvK2lKe6KLPS9Oq2oLD+y2M5Z5IQCKJQUokVc2wrbU85fVTbdMfR2FpEjBiVWGbiqojZd2rVUbvbSGceJVBtlP+IdQC9REUj96JT2x45VuNu00t8ZMtieOusOS8u2AWatnWXDmVwolE6os52TF10G71EXfPTg9ApcM0uRdyqtEr1Vh6awqXccCYcHbaG7iytTcqp3Q0gkQb6HiBXF1tSI/VVPi53R3ao7mox7ZgUsNyGFU3HPLR1SEReYF5jWaqXGtFTaSirv8AbCXcSmVMDI2lJqttjRBdXei1JaosSJ53LZp6I+jENhq5Y9fR6bSqsSXJhnqrHLKY7pBMOvyc08I2C02QtiJVUnVJEWq9We6MJjQUkJna4mQ/lJEz9qxvscUQw+bEekID/OkYXSVmknNb/wBlaP0wpHKvojTOMYo6dNkrIts0ehM6IYezcO150RHwNUSLlieJLicFRuK4bhp0USM9ovkxKWhW28rSKly3qm/2xbzClZwULWPC3cQrvNckjp3SUKllZM9cczJUmJliE0YklqSciN3K68yjQKAbJDRS3bJZRmWnaBN233m4yzs79yJd8YewU83+Vz2z1W2Juip3JWRhjsbg3FyL7VB1JAiJcXag41YMuTl6aIYiv7oPphhaaGYh2GvphjpCWwSNFUt9vRtLPd4b4n+tXPwV/hQOehoROdImU+VX6ocXQab/ALVn5xR0Ihpbdl632w0T7KWkZtJaV1xuBs+9YX6xeS/CrMAug892pfPh85/SB+hM52pf6T+kdBbn5RdrymWX+KC2/GGpjHsNHaOelNn/ABQ2fcsNer3kfw6zn7+hGIWlbql2S4XMy8Mt8dMGXaKQ1cpTVLLUZEd2SbvGqZxWlpbhdLhnpdfVIl/6UWK8NLJBgiNicYIHa66W2mzvX94CEiZ9ac98ZdVqpXxfufRfVTGHRspZ29sDHptiY+1KxTYQMymsfamBV11xCmJV5tEbB1EQVFFTMV2UzWtd9IscJUUYl0qn7IP+msFPSbJVcIlbNB2nwc1ZIKda7lTxj57TfKq17OHk62MrkeTHCBF8olZgbebQ+UAvhbn7xSKqUx9Cmph9tl9JbVttukbRtncNVR1BVEVQoVK90R5aYN3ak5qdea1htE4yMrYBpv2iFFXxSsN4LjzivTspqZx16UoTlxMKWaqiCnCnXHfWq1TjnbkrcE/JtJedZMUNtxshXpCaKkVmIYuNVYlVRx9djYzBmvTJUySnVvWKymHOuE29LMjMqO0EwwCOF3ItKF7FWLUGBEbGhQB/whEaeylIp1HrM4x27MMar/sKVbEABkSrqgAe/JN6+MQcSWr0uA8QC66XclLUr874RZqi1RUpTpZZr1RncQMqzpDk6brUq2XZuERT4uKscbSRdtvPY7HiJRTEq49PNGLiDLzAmNpX1OUBKOGi0oiKuSJvVFrEOf0tMZh+0AQMmmwelir5OPBausHIq13c0jok9KSaS5DMiCSzLdNrK1pEpvTPNE9scR0rxPymYN4AaRq0GmRLNRZFKJXv5+2PWR0qqkpJ8mauO5YfRqHtL6if6o0p2raQ3Np9axGDT8GRADkEW4rSMnSp18kjEowfYaiBiYZCVoINxcN1bqd8bI6mx8NkpaWtLo2uJ6fa4HWdVLADtt1mvcWiKi93VFbjGOuuy7oiAWENt2rNNlXULmSpXKMiyfR/Hwic4h6o9o7Njw4064cvnJN8kFHYsI6joSImzLiQ7KtOj6vnY1wYcACRZkWdt5Vpzy6ox+gc4yLLBGYJ5sx2uXnVjWPYzKWl+sNcPajprbJRMrk02NYQ2JJNgY1Epj/QMWRyjTIBZqxFHC1l2aIKgq7155RnMGxqUHyi99pP1gi2i9BN0TZ/SNl1ualm7CslSeExKqLTePikVXqKlu8jjJvjwU//AMScN7R/Ng4wfkzH95D6f+kCMvvst9uJZYjpZiLpF+saoRLglhst9EiKq190VjmJza/8ZN7X/Mu/fHcMW0Zw6ZzmZcCPh1g+bc+cNFjMzf5LJQl8zMzDY9EStfT4oi/GEpxHtORvtkXHUvXcI/rWGUlmk4Wgu9UY6TN/kunEUtTMyxj6YmyXwqkUuIaB4q0l3kiOD/y7wOfArVie6IsMyasDThT5sKQadUWU1hM21+2k5sPWYJU941SIREKLtZF2SEkX4xLKAQqQivzoUph2k+dCFeDtJEZftDJ2LRk9bIyky4aoMsJmQ9pBr90UWlsvi044Ms22uo1IuFtCDJ3ZrVedEVE9iw7gE+TkhKAGQiToOD2lrlX2LG5kMPZbooNih223c6ZVFF5JXlHiLLfx7ZNx58G6HSwY7BNGcXl2PIxxVhplSNwRaa8+iqtV2l+6H8P0PnWHHpqTxdSmZgaPnMsA6h0VVStKdaxr5uSactVwa0y4iT6vCIh4Gzdc2TrfaFlwgQvFIF6vc+3j/hZsTOc6Y4LjxmD8yoPakaNOyjdihnVVtrX2xeaD6VvONPNzaGRSyARO2kiqCnbnXmi5r3Rt2JcGxsDhzXaK4qrvVVWGH8PEyVXDNQrdqtlAqnXRKr7ViNvqCui42Ry/secLCQqZxFoDFsy2l+FeuOf6Q4s+LjTjZUE3RnREhyOhpYJd1AT3xs53D/OOzLhpqkbu78h+qKw5SUskhmhS+0Aauu3oCZRLQ7YPcuzPc3gy35UMVnCl5fXOtADpXahoiQO5SJcy9yJHNNZ6IfJcGN3+Up4imdWXADY2j4ikY8pUOkAL8kY9XpouccvyUKe0jCRdl36Sv2wxNFmFwGu0vGRKnAsThw5mvAiF6Jav6ocewdpLLnbhIRPYfNyyvJe9OqNCqwP3MlV5WXCNE9ERzhGuNbh6K28Wa5FXdF0zIMpsgG1ds+l74VQE6KfNixQSIORElcRmx2Qcdt6I2jTPxSJg4hPElpu7PpCCfUkAFFV/1coDiZ7P8sWEcJj7U28KFtgtxXfs+l7+6G5qemLD22kHVkJWtkilUaUrdCbbV5F8qqZw2Y1QhKtvolEJZYlFZIet/wAFn5sCFeQh23fpIEQ9ssyj0uEs9zNYQslcu0Z1QvSzqPJa5pGHP8qopcIyDykhbN7gNIoqWzzVa03xBnPyoTZJa2yy36W0+tO6tqVihVMMnSywsV/eu/OhtvDRuQSJ1dmpFcKU7so49Nac4if/ABbyD2R1Td3zRqie2KqdxeYdK4piZX0SmX+HnldSLFS/JHfg7lPLINJ+sPtCnZN0U+G9YqZrFdH+m9Krv4hvp8I4uLxIuxlcPEO8vbvhKOlXaqo9Laz96xJV4FvOi4ppBo0o7Mgrxp0QY1PvUlFIxeJYlJncLODSjY9EjffcX5qUSvtiurkVw7fFxDT+qwhF7XyYtUSOTo/5NsSYFhwDBELW3CDLBqibO9EStI2Y4/J9J8QXsvCTK/zIkcw/J3pMEkc6TjLpi6EttAQIgUU99yp1xtU/Kbhx1E5V5eXFKnX/ANyPP6r0iu2cpOWGzbXKSj0XaY5J7vKA8dqnvhwMWlVS5Jhm3r1gxk/0vlKCyevCUuItSTYa8guXzVbqIHxplGSxTF5V2c8obbMZHXNE6BCKHQaIdqCtKZfXGGfosYxTUuTVXGU21jwdcZxOWNbQfaUuzrBu90OOzrI8bzSes4KfbGLXH8NVFYb1RMrudfYM3JcLs0RLVup0c8ucXMrjmjzYiAEzkKJcUsaqtOtVDfBH0LP+xVKbXgGNGyoTDyPgSG2ACIOCvTTqWFE05MKFjNoIV4zLwjs+kIrnXxim0h0rwVs5V5ltDVt11SFqWILvNFTaVESlYwOkH5SpqbPUNVbly2SBgi4fSLevsonjHT0npcKl8nky2bpPhB408Tpum4SkesMb7srUJUTKm/KsVateNvvuiThznmw2dnUh8nZ3w+q1Xa+cUdqMFFYXRS8rhleiEnRVOjwwVR+T0osDCi2kKj2rhz90NpkvJPm80iYiAaDs2lxQhEieMtXo+jC0aGnDu/G6EGSuRCTorA2vSiwVISBCK3EKFs2iJZbXIsurqgAhD6sGq16+jb9sSiDLaz/0+jCFfaC0jJOyN2dy9yc4AyR7i74ESPKGu/6E/ugQAMpdBj6sIV0aW3dLZ2crecAXC2h7UAhVvpbPpQkfxzhXLi2uzzhaiQqV9lyelkWz3c+6GAhN9sKs8bRgi38VPStJOXvhu8oAwOUglDMiuT1YQgwYmO1sopFs7XR8O+BCZIlTYQnG3ySx1oBtK7PaWv1wEw/Bq1q2lpJ++NOffEdELi6V38sIdaJU+UJd2XXGWylttps2V37Uk1ktMQYw19RJ11tSQbRtepakR20ZGksDrNLaX6wbEDtL393XAw/CZl5uadbFikk1rXBJwryHPMUtz3Lz5RG8npcORXFddq6dSRljS5PDb4Nf5iry49sm4ZhUmy5rG5tFK0ksJ0KZpEaYwCWUlX84mNSUrdYOVfbEd9vZMRFNoSHow7ISrrxC0xLum6oqQgDRVolKlupTNM++LJwnDncQhdGaw0KnRZFplkH9ZaRkRXXrmK70SsRZaVy82GrDhvIc/d98SpZk0UiIbbhEbOeRLWvV/SJ7gCi7BKo7O0Q06OcXVVcZZnsveWoiRtQBHLIRAdnoolIAma/jo/ZBEGXCvF2si9kEi9Ectle/5KxqMbFXkpERFtenn8V3wgRzgxAkQSLpV+EEp5QxroUJkm0PFCroZJS6Of1V7PjDL8yI26zKvR3qXgiQhD7i58Xzfqhq8aiPTLhEc1LwRM1WLzRrQ7Epu09WsvL3J550fPEl3EILRUy5r8Y6lopobIyZEbYKUwY1cefc1jyIvVyRPCkVSsSLVBs5ngOg+IzVDs1Euv72YbLXEPohlT2+6Op4BohISgorbKE/05l8dY8XXmu5O5KJF8gjbTO30rq7+/OIxI+qgSGCBt6wTbqZIu4UouVPbWMk7pN4ZYoJDurY7Df0Y/dBw3aXZD5o/fAiHuf2PB51QBXqtH32/hYaMBRdgdm7xh9blUiu2i4rcvqgwly8d5dL50dMy9EcQHs0LtXFQaIuzROuqQ6rLVg2k7rVcts1Y2arlReusOOM0t5H0vbT4QmlIQDYCPF6VvDW3uhtSJbhHo7XVE1xogIhKnFaQ709/OGWnSDbCqEPSHfmlIYJoYRCVbW719Uc92eSQLtm61fm/V3wakW0I8UK58O16Pd3JANiUWibXSpdd98ESlsiPD61blqsKDPhp6UBxadA1IisEBG8zdXcIimarlAIsNFzPygmhJf1iVmGSHXjLoezVLiJFyyXLfnEJlzISMU4eIXKpB6PY9KS0/LnPMvIDOu17LrC3iSgqAiivjAYmWXtti+wiO64dXbtqtqU5UVIrhhN8Fkl8RwQHol0oscDmTYm5V5slQriaLzRzGRBmiAKopZoGSdUVwMUUS3+j+FixwhsTmJQDJ1LpqWESAtWo1dSpV3p7IJRTTTWSEexmbAkemrhVC8oe4mSYXM1XgVapv5w3XLriz0nlhbm50BMytmF2jcJxV2EVaqsVdaJ6MSjwsIb4Yh56myMMikIQvnQ7YKJt1uG4StLO7oZLlTrpEiIarS3ZVLh6XShoz7VEEeIi6MIcmmRJobneFNZs5CvOioi5fGNJo0GjwKL2I4irjo7Wp1DrbAl83OE3gklkgYHo3iE2v6uGrZ/vD1yeKoK7/GkdQ0Y0IkZXbsVyYtQiemPO7Xd1eCRIkNOdH0FBbxGTEUyESLVr8YtWMbkDTzM7KkttB8+FF8c4yWSsfCXBdGMUTWzBFXbS8qLaNOrJKeHXDM0+aj5gUM1ysMhQLbkqqqiLyrSAy4JqYoIKO4nSICE6pyRFWqcuW6HXJcUSrYpVOERLVovUNU3RmluSLEG+TiIWdEShbI3koc0ROv3w44tKV3buHr+qFNnVNrePFDRmC76qO2JF0BovOsEoNx47AXqx6k+aMCFalO/5xQIhts+hHnO4q7Q7PZEqcuawpCJPm2l+Kwez0q/j7ISiBtEI7/xdHWyZAlEtouobuq0UhTRkqWkKdLatGvhXfBFaqEO/h6Pt5xIRRVdmiRIBowJeGq+j6UNOjVB41/h7FPHeq15RPbHPY+Ts/ZCVTtQNpkYrBXWFw27UEoGKjsrctdoRyHnviytg1LK3sldw/y16vvhEslcjZ28KXe7Z9sKLDnXCEmzdSYFwTaNoivQxTJU9kWTtirdsDf0AuoHjWuUIEsuLh2uKnjAGcGenNHnHicemJx05g9ojNuty7s6rWLDDcPFltG0JS6V27Nd+UTtZW3ZRKbJW9LxgHl+PuhYQ3Jsg4kpI0ZDluEiQblAFVEU0TnRKrTuikx2cbadaTDcSmX22xB3XEyTBtPJ4pWiZRpUz4flf1htAEeim1d0RS6m+DBKMkil0enJh5x9+YdNxTK4iMqqR8191IvHXCVLbq9ER9Gu6Fkwe0JDS1tD2stmnUu+EIleKBZIt5YwLVbrqJB2dqHVEfH5P2QKQxDZDXi7NvuhpxivS+2JSJBJdXh2e1/ppAMiJKj4/JhKyAdEaeqVImGhdGiesNYUhEn/AGwZFkiNsGPA88nqlE6TxOea2QxCcQeyL1E+qGVKCgHklnjOIL/4hP8A+ZOGkxDEE4cRnE/i5++GL8uLag0OAMslfnnFP/Mpz6SBEe6BCDLHTbBFKwlKtu0VyKNCXluhpWeK3i2R9kSTbJLd3R4fV+uBT20hiGRDxT1+6CVwBIQKqkoqWyOVqb890SRDIt3R2eZeECwdnddnB2LOBAIPEPPa/CQ8Z14e7o0/CwiwuLowCQUT0ruLa4YaXBFvkIw6RFT53uVEhF1VuEdm3ZHxh0ezuFYbUabRZ+t0Yj0TChVnSt2eGBaKoV3Ds9KkJJeK7IeiXarDDADLiEel0ucIXo/zQsWyW7Z9KHBa7RcWzEQI5N3INw0tK7ZIkXurRYU3cKj2h4eH7YkCBUK0Uy7VyoX9YPVcO5Pk5kXarEsgRTHhgqZ89r+WJisl/NBEFbdr0beQpCzkCIYZjz2ruHi7lRYJELsw+rMEoFDAbRIOkLEO1AUSgAbtgFeietaVt1Lh64dpTv8AW/pBJktw5Eo2wANk3kJFz4dofjCVAezD1vhB+jALsi2d0EKDXZiUIV/7aQ2oCi3Z29kel3VgGN6sYEJp6R/j2QIALJN/yoIulAgQeAG0gLAgQhCOcOFw/KWBAiSExAwvn8mBAiLGht7cULb3QIEIkOsbi9WCd6PrDAgQEWSE3QD3fKGBAgAcf3F6v2RBXhD1RgQIEMUxxh6yQC3wIEMBCwFgQIYAgQIEAglgQIEAIXCD4flQIEIY3AgQIYH/2Q==');\ntree.x = 0;\ntree.y = groundY-250;\nbackground.addChild(tree);\n \n } // end of render function - DO NOT DELETE", "function draw() {\n // Place your drawing code here \n background('black');\n \n image(bg, bgX, 0, bgWidth, bgHeight);\n image(bg, bgX + bgWidth, 0, bgWidth, bgHeight);\n \n// noFill();\n// stroke('white');\n// strokeWeight(3);\n// rect(bgX, 0, bgWidth, bgHeight);\n// rect(bgX + bgWidth, 0, bgWidth, bgHeight);\n \n bgX -= 5;\n if (bgX < -bgWidth) {\n bgX = 0; \n }\n \n}", "function drawMountains()\n{\n for(var i = 0; i < mountains.length; i++)\n {\n push()\ntranslate(450, 35)\n //mountain \n noStroke()\n fill(130);\n triangle(mountains[i].x, mountains[i].y, 200, 150, 397, mountains[i].y);\n \n//mountain peek\n noStroke()\n fill(245,248,240);\nquad(143,220,200,150,250,210,200,190);\n pop();\n }\n\n}", "function draw() {\n background(\"#222831\");\n}", "function draw() {\n\t// set up background\n\tdraw_background();\n\t// draw all pre-square shapes that are occluded by square\n\tdraw_shapes(pre_shapes);\n\t// draw background-colored square\n\tvar bg_sqr = {w_square_bg: new Shape(\"square\", width * .47, height * .95 / 2, \n\t\t\twidth * .3, null, colors.bg)};\n\tdraw_shapes(bg_sqr);\n\t// draw all post-square shapes that overlap square\n\tdraw_shapes(post_shapes);\n}", "setupBackground() {\n this.bgRect = new paper.Path.Rectangle(new paper.Point(), view.size);\n this.bgRect.fillColor = this.backgroundColor;\n this.bgRect.sendToBack();\n }", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "function draw() {\n noLoop();\n\n var myCanvas = createCanvas(920,680);\n\n myCanvas.parent('mondrian');\n var margin = 0; //margin to canvas edges\n\n //get canvas size\n var wid = width - margin;\n var hei = height;\n\n clear();\n\n //calculate co-ordinates of first mondrian patch\n var x1 = margin;\n var y1 = margin;\n var x2 = margin + (wid - margin);\n var y2 = margin + (hei - 2*margin);\n\n //draw the first mondrian, and all smaller ones\n drawMondrian(x1, y1, x2, y2, baseLevel);\n\n //draw the frame last to cover unfinished areas\n //strokeWeight(mondrianLineWidth);\n noFill();\n rect(x1, y1, x2-x1, y2-y1);\n}" ]
[ "0.7498021", "0.7350515", "0.7229753", "0.7229088", "0.7076119", "0.7064383", "0.70610946", "0.70516884", "0.703864", "0.70018566", "0.6972767", "0.6968439", "0.6956943", "0.69028753", "0.6870621", "0.68359506", "0.681328", "0.6805117", "0.6802679", "0.67905474", "0.6759651", "0.6744349", "0.6732939", "0.67279917", "0.6717035", "0.67131364", "0.6712475", "0.67117727", "0.6702607", "0.669797", "0.6687732", "0.6673668", "0.66638607", "0.6648529", "0.664103", "0.6634047", "0.6625331", "0.66205466", "0.6611428", "0.6606296", "0.65947914", "0.6593332", "0.65916157", "0.6581901", "0.65606296", "0.655981", "0.65505", "0.65504515", "0.65469563", "0.65420645", "0.65254724", "0.6520047", "0.6519525", "0.6517888", "0.65068793", "0.650421", "0.649948", "0.649933", "0.64986914", "0.6497678", "0.64942706", "0.6491288", "0.6490631", "0.64890635", "0.64889455", "0.64860195", "0.64840555", "0.6471946", "0.6470798", "0.64572525", "0.6450254", "0.6449577", "0.6448799", "0.6441551", "0.64409584", "0.64409506", "0.64383554", "0.64336026", "0.64335215", "0.64314246", "0.64295423", "0.642775", "0.6420509", "0.64173675", "0.6415442", "0.64144826", "0.64127785", "0.6412407", "0.64121455", "0.64105535", "0.64000344", "0.63941115", "0.63941", "0.63904184", "0.6390123", "0.63844067", "0.63723046", "0.6372089", "0.6363487", "0.63589543" ]
0.6818139
16
draw sun in random location in the sky
function drawSun() { L10_Super.crc2.beginPath(); L10_Super.crc2.arc(Math.random() * width + 100, height / 4, 100, 0, 2 * Math.PI); L10_Super.crc2.fillStyle = "#FFFF66"; L10_Super.crc2.fill(); L10_Super.crc2.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sun (yPos) {\n fill(\"#f7cb39\"); // Yellow color\n circle(250, yPos, 50);\n}", "function sky(x, y, r, g, b, a) { //input 6 random values for every unique ellipse\n ellipseMode(CENTER);\n noStroke();\n fill(r, g, b, a);\n var diam = random(30);\n ellipse(x, y, diam, diam);\n}", "function updateSun() {\n const phi = THREE.MathUtils.degToRad(90 - parameters.elevation);\n const theta = THREE.MathUtils.degToRad(parameters.azimuth);\n\n sun.setFromSphericalCoords(1, phi, theta);\n\n sky.material.uniforms[\"sunPosition\"].value.copy(sun);\n water.material.uniforms[\"sunDirection\"].value.copy(sun).normalize();\n\n // scene.environment = pmremGenerator.fromScene(sky).texture;\n}", "function updateSun() {\n\n var theta = Math.PI * (parameters.inclination - 0.5);\n var phi = 2 * Math.PI * (parameters.azimuth - 0.5);\n\n light.position.x = parameters.distance * Math.cos(phi);\n light.position.y = parameters.distance * Math.sin(phi) * Math.sin(theta);\n light.position.z = parameters.distance * Math.sin(phi) * Math.cos(theta);\n\n sky.material.uniforms.sunPosition.value = light.position.copy(light.position);\n water.material.uniforms.sunDirection.value.copy(light.position).normalize();\n\n cubeCamera.update(renderer, scene);\n\n }", "function newSun() { //////////////////////////////////////////////////创建太阳\n\t\t\tvar sunRow = Math.floor(Math.random() * 5); // random row\n\t\t\tvar sunCol = Math.floor(Math.random() * 9); // random column\n\t\t\tvar sun = new lib.sunMc(); // constructs the sun\n\t\t\tsun.buttonMode = true; // makes the mouse change shape when over the plant//////////////////////////////////////改变鼠标样式\n\t\t\tsun.alpha = 1; //太阳的血\n\t\t\tsunContainer.addChild(sun); // adds the sun\n\t\t\tsun.x = 52 + sunCol * 65; // places the sun in the proper column\n\t\t\tsun.destinationY = 130 + sunRow * 75; // definines the sun y destination point\n\t\t\tsun.y = -20; // places the sun out to the upper side of the stage\n\t\t\tsun.addEventListener(\"click\", sunClicked); // listener to be triggered when the sun is clicked\n\t\t}", "function draw() {\n//below function makes rain go down by one pixel per loop, then reset once it reaches the bottom//\nlet dotBlue = color( 0, 100, 0, 100);\nlet dotGreen = color( 0, 0, 100, 100);\nlet dotRed = color( 100, 0, 0, 100);\n let rainArray = [dotBlue, dotGreen, dotRed];\n rain.y = rain.y + 1;\n rain.y = rain.y % windowHeight;\n rain.x = random(0 , width);\n //nnothing goes here\n// defining rain variables for draw\n noStroke();\n fill ( rainArray[rainColor] );\n ellipse ( rain.x, rain.y, rain.wi, rain.hi );\n //print(rain.y)\n}", "function showSun() {\n\tnight = 0;\n\t$(\"#sun\").show();\n\t$(\"#daySky\").show();\n\t$(\"#sun\").css({\"width\":\"140px\",\n\t\t\"position\":\"absolute\",\n\t\t\"left\":\"26%\",\n\t\t\"top\":\"25px\"});\n }", "function revolution()\r\n{\r\n sun.position.x = radius * Math.cos(theta * Math.PI/180);\r\n sun.position.z = radius * Math.sin(theta * Math.PI/180);\r\n\r\n theta = (theta + 0.4) % 360;\r\n \r\n sunmodel.position.copy(sun.position); \r\n \r\n moonmodel.position.x = mradius * Math.cos(mtheta * Math.PI/180) * -1;\r\n moonmodel.position.z = mradius * Math.sin(mtheta * Math.PI/180) * -1;\r\n \r\n mtheta = (mtheta + 0.3) % 360;\r\n}", "static updateNorthSkyCanvas(sun) {\r\n var ctx = NorthSky.getContext()\r\n\r\n ctx.beginPath();\r\n // clockwise polygon covers image\r\n var c = document.getElementById(\"backgrd\");\r\n ctx.moveTo(0, 0);\r\n ctx.lineTo(c.width, 0);\r\n ctx.lineTo(c.width, c.height);\r\n ctx.lineTo(0, c.width);\r\n ctx.closePath();\r\n var southLat = 90 - Earth.LATIDUDE\r\n // hole to image is clockwise when sun is down\r\n ctx.ellipse(261, 332, 214, 180, 0, 0, 2 * Math.PI, sun.isDown);\r\n const backColor = sun.isDown ? 'black' : 'blue'\r\n ctx.fillStyle = backColor;\r\n ctx.globalAlpha = sun.isDown ? .2 : .1\r\n ctx.strokeStyle = \"rgba(0.1,0.5,0.5,0)\";\r\n ctx.lineWidth = 1;\r\n ctx.fill();\r\n ctx.globalAlpha = 1\r\n\r\n const y = 262 + NorthSky.EQUATOR_RADIUS * Math.sin(Earth.LATIDUDE)\r\n ctx.font = \"20px Arial\";\r\n ctx.fillText(\"Z\", 262, y);\r\n ctx.fillText(\"N\", 262, 172);\r\n ctx.fillText(\"S\", 262, 502);\r\n ctx.fillText(\"E\", 54, 350);\r\n ctx.fillText(\"W\", 449, 350);\r\n }", "switchSky() {\n this.moon = undefined;\n this.sun = new Sun(this.horizonSpeed * 1.1);\n }", "function draw() {\n // Clears everything to make all of the pixels 100% transparent\n clear(); // avoids having planets leave a trail\n\n // Removing the stroke on all planets\n noStroke();\n\n // Draw the sun and each planet\n planets();\n\n // Draw saturn's ring\n push();\n saturnRing();\n pop();\n\n // P5's orbitControl() allows you to drag and move around the world\n // in this case, the zoom is disabled\n orbitControl();\n}", "function addSnow() {\n // Creating the snow element\n const snow = document.createElement('span');\n\n // Setting random positions to the snow on the x-axis\n const left = Math.round(Math.random() * window.innerWidth);\n snow.style.left = left + 'px';\n\n // Setting random sizes to the snow \n const radius = Math.round(Math.random() * 15 + 5);\n snow.style.width = radius + 'px';\n snow.style.height = radius + 'px';\n\n // Setting a random delay on the fall animation in the css \n // so all snow elements won't start falling at the same time\n snow.style.animationDelay = Math.random() * 10 + 's';\n\n // Appending the snow to the DOM\n document.body.appendChild(snow);\n\n}", "function drawMoon(){\n fill('white');\n ellipse(random(width),80,80,80);\n}", "function draw() {\n background(20);\n // orbitControl(); // allows user to drag the screen\n noFill();\n strokeWeight(0.5);\n translate(0,0,0);\n angleMode(DEGREES);\n rotateY(frameCount * 0.2);\n\n\n // sun (yellow)\n stroke(255,255,0);\n sphere(100);\n // texture(neptuneImg);\n\n // earth (green)\n translate(500, 0, 0);\n push();\n rotateY(frameCount * 1);\n // rotateY(frameCount * 0.05);\n stroke(0,255,0);\n sphere(50);\n pop();\n // texture(earthImg);\n\n // neptune (blue)\n translate(0,-200,600);\n rotateY(frameCount *0.01);\n stroke(0,0,255);\n sphere(90);\n // venus (red)\n\n\n\n\n\n\n\n}", "draw() {\n randomSeed(seed);\n let colors = ['#FF0000', '#0000FF', '#008000'];\n let color = random(colors);\n\n let sizes = [10, 5, 15];\n let size = random(sizes);\n\n fill(color);\n ellipse(this.xOff + this.x, this.yOff + this.y, size, size);\n }", "function animate() {\n init()\n\n // delta required to change the perspective from star to persp\n dx = persp.x - sun.x\n dy = persp.y - sun.y\n\n bodies.forEach(body => {\n body.update()\n var xcor = body.x - dx\n var ycor = body.y - dy\n body.draw(xcor, ycor)\n });\n\n requestAnimationFrame(animate);\n}", "function sand (n, v, w, t, offset) {\n\n let xs = linspace (n, v.x, w.x);\n let ys = linspace (n, v.y, w.y);\n\n for (let times = 0; times < t; times++) {\n\n for (let i = 0; i < n; i++) {\n point (xs[i], ys[i]);\n //line (xs[i], ys[i], xs[i], ys[i] + 10);\n }\n\n xs = xs.map (e => e += random (-offset, offset));\n ys = ys.map (e => e += random (-offset, offset));\n }\n}", "function drawSkyLayers() {\n for (var i = 0; i < 50; i++) {\n drawSkyLayer(randomNumber(80, 90), randomNumber(110, 190), randomNumber(225, 255), 0.5);\n }\n}", "function draw() {\n background(50);\n\n if(weather) {\n windArrow.updateWind()\n windArrow.show();\n\n switch(currentWeatherCondition) {\n case 'Rain':\n case 'Drizzle':\n drawRain();\n break;\n case 'Thunderstorm':\n createThunderStorm();\n break;\n case 'Clouds':\n drawClouds();\n break;\n case 'Snow':\n drawSnow();\n break;\n case 'Clear':\n sun.show();\n break;\n case 'Mist':\n drawFog();\n break;\n default:\n sun.show();\n }\n }\n}", "function changeColor(state) {\n push();\n\n //If state < 0 nighttime\n if (state < 0) {\n\n //reDraw background for night, generate stars,\n //and set fill for moon\n background('#282828');\n generateNight(Math.random() * 50);\n fill('#928374');\n } else {\n \n //Day time background\n background('#7ec0ee');\n }\n\n //Master switch statement for moon / sun\n //Placement as well as color of sun\n // < 0 is a nighttime state\n switch(state) {\n case -1:\n ellipse(125, 100, 100); \n break;\n\n case -2:\n ellipse(375, 50, 100);\n break;\n\n case -3:\n ellipse(625, 50, 100);\n break;\n\n case -4:\n ellipse(875, 100, 100);\n break;\n\n //For daytime ellipses use ternery '?'\n //Operator to check rise then eval our x\n //Since cases of 0, 1, 2, 3 will be hit\n //Twice in a single day cycle\n case 0:\n fill('#d65d0e');\n ellipse(rise ? 50 : 850, 100, 100);\n break;\n\n case 1:\n fill('#fe8019');\n ellipse(rise ? 150 : 750, 75, 100);\n break;\n\n case 2:\n fill('#d79921');\n ellipse(rise ? 250 : 650, 50, 100);\n break;\n\n case 3:\n fill('#fabd2f');\n ellipse(rise ? 350 : 550, 25, 100);\n break;\n\n //Only Hit once, peak sun, no need to check rise\n case 4:\n fill(255, 255, 0);\n ellipse(450, 0, 100); \n break;\n }\n pop();\n}", "function drawSkyLayer(r, g, b, a) {\n for (var i = 0; i < 50; i++) {\n hide();\n penUp();\n moveTo(randomNumber(0, 320), randomNumber(0, 300));\n penRGB(r, g, b, a);\n dot(10);\n }\n}", "function generateSweetSpot(){\n\t//place x and y in the center\n\tvar x = canvasWidth/2;\n\tvar y = canvasHeight/2;\n\tconsole.log(x,y)\n\tx += random(-imageWidth/2 + 100, imageWidth/2 - 100);\n\ty += random(-imageHeight/2 + 100, imageHeight/2 + 50);\n\t//console.log(\"X, Y \", mouseX, mouseY);\n\trandPointX = x;\n\trandPointY = y;\n\t//console.log(randPointX, randPointY);\n\t//for visualization\n\t//ellipse(x,y,bigSpotDiam,bigSpotDiam);\n\t//ellipse(x,y,smallSpotDiam,smallSpotDiam);\n}", "function draw() {\n spot.x = random(0,width)\n spot.y = random(0,height)\n \n //use the spot.x value to determine the amount of red\n //more red the closer to the right the dot is\n colors.r=map(spot.x,0,width,100,255)\n \n //use the spot.y value to determine the amount of blue\n colors.b=map(spot.y,0,height,0,255)\n \n \n noStroke()\n fill(colors.r,colors.g,colors.b,100)\n ellipse(spot.x,spot.y,24,24)\n}", "function night () {\n background(\"#0f143b\"); // Dark blue color\n\n for (var i = 0; i < 10; i++) { // Used to create my stars across the screen horizontally\n var x = 20 + i * 50 ;\n for (var j = 0; j < 7; j++) { // Create stars across the screen vertically\n var y = 20 + 50 * j;\n fill (\"#e8cb6b\");\n circle(x, y, 5);\n }\n }\n}", "function startSun() {\r\n const geometry = new THREE.SphereGeometry(4, 20, 20);\r\n sfera = new THREE.PointLight(0xfdfbd3, 3, 100, 2);\r\n meshSfera = new THREE.MeshStandardMaterial({\r\n emissive: 0xfdfbd3,\r\n emissiveIntensity: 3,\r\n color: 0xfdfbd3\r\n });\r\n sfera.add(new THREE.Mesh(geometry, meshSfera));\r\n sfera.castShadow = true;\r\n scene.add(sfera);\r\n\r\n sfera.applyMatrix(new THREE.Matrix4().makeTranslation(0, 40, 30));\r\n\r\n pivot = new THREE.Group();\r\n pivot.position.set(0, 0, 0);\r\n scene.add(pivot);\r\n pivot.add(sfera);\r\n}", "function pickLocation(){\n\n var cols = floor(width/sz);\n var rows = floor(height/sz);\n//create a spot on the canvas for the food to fill\n food= createVector(floor(random(cols)),floor(random(rows)));\n food.mult(sz);\n }", "alterWind() {\n var change = Math.random() * 0.1;\n if(Math.random() > 0.5)\n change *= -1;\n\n if(Math.random() > 0.6)\n this.wind[0] += change;\n else\n this.wind[2] += change;\n vec3.normalize(this.wind, this.wind);\n\n vec3.scale(this.wind, this.wind, this.windStrength);\n }", "function setLoc() {\n xLoc = random(60, width - 60);\n yLoc = random(60, height - 60);\n}", "function snowflake() {\n // initialize coordinates\n this.posX = 0;\n this.posY = random(-50, 0);\n this.initialangle = random(0, 2 * PI);\n this.size = random(2, 5);\n\n // radius of snowflake spiral\n // chosen so the snowflakes are uniformly spread out in area\n this.radius = sqrt(random(pow(width / 2, 2)));\n\n this.update = function(time) {\n // x position follows a circle\n let w = 0.6; // angular speed\n let angle = w * time + this.initialangle;\n this.posX = width / 2 + this.radius * sin(angle);\n\n // different size snowflakes fall at slightly different y speeds\n this.posY += pow(this.size, 0.5);\n\n // delete snowflake if past end of screen\n if (this.posY > height) {\n let index = snowflakes.indexOf(this);\n snowflakes.splice(index, 1);\n }\n };\n\n this.display = function() {\n ellipse(this.posX, this.posY, this.size);\n };\n}", "function CreateSun()\n{\n var id = addUniforms(new THREE.Vector3(1.0, 0.75, 0.0));\n \n meshes.push(new THREE.Mesh(new THREE.SphereGeometry(50.0, 24, 24),\n new THREE.ShaderMaterial({\n uniforms: uniforms[id],\n attributes: {},\n vertexShader: vertexShaderSun(),\n fragmentShader: fragmentShader()\n })));\n meshes[id].visible = false;\n scene.add(meshes[id]);\n return id;\n}", "function foodLocation() {\n let x = floor(random(w));\n let y = floor(random(h));\n food = createVector(x, y);\n}", "function snow ()\n{\n\t//positions snow's x-coordinate from 0 to the width of the canvas\n\t\n\tthis.x = Math.random() * canvas.width; //sets the x to a random location\n\tthis.y = Math.random() * canvas.height; //sets the y to a random location\n\tthis.x = canvas.width/2; //sets the x to the center of the screen\n\tthis.y = canvas.height/2; //sets the y to the center of the screend\n\tthis.radius = Math.random() * 10 + 5;\n\tthis.vx = Math.random() * 10 + 5;\n\tthis.vy = Math.random() * 10 + 5;\n\n\tthis.vx = Math.random() * 20 - 10; //to move left and right \n\tthis.vy = Math.random() * 20 - 10; //to move up and down\n\n\t\t//draw a circle on the canvas\n\t\tthis.draw = function ()\n\n\t\t{\n\n\t\tcontext.fillStyle = \"aaaacc\"; //sets the color\n\t\tcontext.beginPath(); //starts a shape\n\n\t\t//creates the geometry for a circle\n\t\tcontext.arc(this.x, this.y, this.radius, this.radius, 0, 360 * Math.PI/180, false);\n\n\t\tcontext.fill(); //colors in the geometry\n\n\t\t}\n\n\t\t\n\t\t//move the snow\n\t\tthis.move = function ()\n\n\t\t{\n\n\t\t//add velocity y to y position\n\t\tthis.vy += gravity; //to apply gravity\n\t\tthis.x += this.vx; //to move things on the x-axis\n\t\tthis.y += this.vy; //to move things on the y-axis\n\n\t\tthis.y += Math.random() * 10 - 5; //to move randomly in different directions\n\t\tthis.x += Math.random() * 10 - 5; \n\n\t\t//check to see if snow is off the screen\n\n\t\t\tif(this.y > canvas.height)\n\t\t\t{\n\t\t\tthis.y = Math.random() * 1000 - 75; //puts snow back at top of screen\n\t\t\tthis.x = Math.random() * 1000 - 75;\n\n\t\t\t}\n\t\t}\n}", "function snowflake() {\n // initialize coordinates\n this.posX = 0;\n this.posY = random(-50, 0);\n this.initialangle = random(0, 2 * PI);\n this.size = random(2, 5);\n\n // radius of snowflake spiral\n // chosen so the snowflakes are uniformly spread out in area\n this.radius = sqrt(random(pow(width / 2, 2)));\n\n this.update = function(time) {\n // x position follows a circle\n let w = 0; // angular speed Changed the speed to 0\n let angle = w * time + this.initialangle;\n this.posX = width / 2 + this.radius * sin(angle);\n\n // different size snowflakes fall at slightly different y speeds\n this.posY += pow(this.size, 0.5);\n\n // delete snowflake if past end of screen\n if (this.posY > height) {\n let index = snowflakes.indexOf(this);\n snowflakes.splice(index, 1);\n }\n }\n\n this.display = function() {\n ellipse(this.posX, this.posY, this.size);\n }\n}", "function drawSnowflakes(x, y) {\r\n crc2.fillStyle = \"#FFFFFF\";\r\n crc2.beginPath();\r\n crc2.arc(x, y, 5, 0, 6 * Math.PI);\r\n crc2.fill();\r\n }", "function drawDay() {\n\n\timage(backgroundImg, 0, 0);\n\n\t//draw a mountatin\n\timage(mountainImg, 0, 190);\n\n\n\t//animate the water\n\twaterY = waterY + waterSpeedY;\n\tif (waterY > 240) {\n\t\twaterSpeedY = -waterSpeedY;\n\t}\n\tif (waterY < 190) {\n\t\twaterSpeedY = -waterSpeedY;\n\t}\n\n\t//place the water\n\timage(waterImg, 0, waterY - 45);\n\timage(waterImg, -100, waterY - 60);\n\n\t//animte the oldman\n\timage(oldmanImg, 300, 209);\n\n\tif (mouseIsPressed) {\n\t\timage(oldmanLeanImg, 280, 225);\n\t} else {\n\t\timage(oldmanStandImg, 300, 220);\n\t}\n\n\t//place the hand of old man\n\t// wind the fishing rod when clicked\n\tif (mouseIsPressed) {\n\t\timage(handImg, random(320, 340), 279);\n\t} else {\n\t\timage(handImg, 340, 279);\n\t}\n\n\t//animate the fishing rod\n\tif (mouseY > 235) {\n\t\tmouseY = 235;\n\t}\n\tif (mouseY < 80) {\n\t\tmouseY = 80;\n\t}\n\n\t//draw the fishing rod\n\tif (mouseIsPressed) {\n\t\timage(fishImg, random(401, 404), mouseY);\n\t} else {\n\t\timage(fishImg, 400, 235);\n\t}\n\n\t//hide the rope\n\timage(skyblockImg, 350, 74);\n\n\t//animate the boat\n\tboatY = boatY + boatSpeedY;\n\tif (boatY > 255) {\n\t\tboatSpeedY = -boatSpeedY;\n\t}\n\tif (boatY < 235) {\n\t\tboatSpeedY = -boatSpeedY;\n\t}\n\n\t//draw the boat\n\timage(boatImg, 50, boatY);\n\n\n\t//animate the water\n\twaterY = waterY + waterSpeedY;\n\tif (waterY > 240) {\n\t\twaterSpeedY = -waterSpeedY;\n\t}\n\tif (waterY < 190) {\n\t\twaterSpeedY = -waterSpeedY;\n\t}\n\n\n\t// animate the wave\n\twaveX += 0.8;\n\tif (waveX > 800) {\n\t\twaveX = -200;\n\t}\n\n\t//draw the wave\n\timage(waveImg, waveX, 365);\n\timage(waveImg, waveX - 200, waterY + 130);\n\timage(waveImg, waveX - 500, waterY + 110);\n\timage(waveImg, waveX - 800, waterY + 120);\n\timage(waveImg, waveX + 200, waterY + 100);\n\timage(waveImg, waveX + 500, waterY + 120);\n\timage(waveImg, waveX + 800, waterY + 130);\n\n\t// animate the water\n\timage(waterImg, 0, waterY + 30);\n\n\n\t//animate the fish\n\tfish3X = fish3X + fish3Xspeed;\n\tif (fish3X > 800) {\n\t\tfish3X = 0;\n\t}\n\n\t//draw the fish\n\timage(fish3Img, fish3X, waterY + 200);\n\timage(fish3Img, fish3X + 150, waterY + 230);\n\n\t// animate the wave\n\timage(waveImg, waveX, 365);\n\timage(waveImg, waveX - 300, 365);\n\timage(waveImg, waveX - 600, 365);\n\timage(waveImg, waveX - 900, 365);\n\timage(waveImg, waveX + 300, 365);\n\timage(waveImg, waveX + 600, 365);\n\timage(waveImg, waveX + 900, 365);\n\n\t// animate and draw the clouds\n\tcloud1X += 0.8;\n\tif (cloud1X > 800) {\n\t\tcloud1X = -200;\n\t}\n\timage(cloud1Img, cloud1X, 100);\n\n\tcloud2X += 0.5;\n\tif (cloud2X > 800) {\n\t\tcloud2X = -200;\n\t}\n\timage(cloud2Img, cloud2X, 50);\n\n\tcloud3X += 0.8;\n\tif (cloud3X > 800) {\n\t\tcloud3X = -200;\n\t}\n\timage(cloud3Img, cloud3X, 5);\n\n\tcloud4X += 0.6;\n\tif (cloud4X > 800) {\n\t\tcloud4X = -200;\n\t}\n\timage(cloud4Img, cloud4X, 80);\n\n\t//draw wheel that tell that the fish bited the rod\n\timage(wheelImg, 450, random(225, 227));\n\n\t//animate the fish\n\tfish2X = fish2X + fish2Xspeed;\n\tif (fish2X < 0) {\n\t\tfish2X = 800;\n\t}\n\n\t//draw the fish\n\timage(fish2Img, fish2X, waterY + 300);\n\n}", "display() {\n fill(random(255), random(255), random(255));\n ellipse(this.x, this.y, 30);\n }", "function draw() {\n\tconsole.log('sfdsf');\n //fill(0);\n for (var i = 0; i < 50; i+10) {\n for (var j = 0; j < 50; j+10) {\n \tconsole.log('i,j',i,j);\n fill(random(255),0,random(255));\n ellipse(i, j, 20, 20);\n }\n }\n}", "function drawRandom() {\n theContext.beginPath();\n target.x = Math.floor(Math.random() * (1000 - 500)) + 500;\n target.y = 640;\n theContext.arc(target.x, target.y, 5, 0, 2 * Math.PI);\n theContext.fillStyle = \"black\";\n theContext.fill();\n}", "function drawSky() {\n\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\n\n}", "function Star(){\r\n\tthis.z = randomIn(2, 10);\r\n\tthis.x = randomIn(0, canvas2.width);\r\n\tthis.y = randomIn(0, canvas2.height); \r\n\tthis.vel = map(this.z, 2, 10, 0.2, 2);\r\n\tthis.radius = map(this.z, 2, 10, 0.5, 2.8);\r\n\r\n\tthis.update = function(){\r\n\t\tthis.x += this.vel;\r\n\r\n\t\tif(this.x > canvas2.width) this.x = 0;\r\n\t\tthis.show();\r\n\t}\r\n\r\n\tthis.show = function(){\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);\r\n\t\tctx.fillStyle = \"rgba(255, 255, 255, 0.9)\";\r\n\t\tctx.fill();\r\n\t\tctx.closePath();\r\n\t}\r\n}", "function setMapSunPosition(r, a, p) {\n map.setLight({anchor: \"map\", position: [r, a, p]});\n}", "constructor() {\n this.x = random(width);\n this.y = random(-2000, -10);\n this.dx = random(-10, 10);\n this.dy = random(5, 6);\n this.size = random(20, 40);\n this.color = color(random(200, 255));\n this.touchingGround = false;\n this.shape = \"*\";\n //Very similar to raindrop\n }", "function perlinNoiseCircle(){\n translate(xpos,ypos);\n stroke(r,g,b, 50);\n noFill();\n beginShape();\n\n\n\n\n\n for (let a = 0; a < TWO_PI; a += 0.1) {\n\n let xoff = map(cos(a), -1, 1, 0, noiseMax);\n let yoff = map(sin(a), -1, 1, 0, noiseMax);\n let r = map(noise(xoff, yoff, zoff), 0, 1, xSize, ySize);\n let x = r * cos(a );\n let y = r * sin(a );\n\n\n vertex(x, y);\n\n }\n\n\n endShape(CLOSE);\n\n zoff += zoffChange;\n\n// changes the backgrounds colour randomly if you click on the screen\n if (mouseIsPressed){\n\nbgr = random(0,255);\nbgg = random(0,255);\nbgb = random(0,255);\n\na = 50;\n }\n\n}", "function initScene()\r\n{\t\r\n\tvar canvasWidth = window.innerWidth;\r\n\tvar canvasHeight = window.innerHeight;\r\n\tvar canvasRatio = canvasWidth / canvasHeight;\r\n\r\n\t// Set up a renderer. This will allow WebGL to make your scene appear\r\n\trenderer = new THREE.WebGLRenderer( { antialias: true } );\r\n\r\n\trenderer.gammaInput = true;\r\n\trenderer.gammaOutput = true;\r\n\trenderer.setSize( window.innerWidth, window.innerHeight );\r\n\trenderer.setClearColor( 0xAAAAAA, 1.0 );\r\n\r\n\t// Enable Shadows in the Renderer\r\n\trenderer.shadowMap.enabled = true;\r\n\t//renderer.shadowMap.type = THREE.BasicShadowMap;// shadow edges are crisp/sharp\r\n\trenderer.shadowMap.type = THREE.PCFSoftShadowMap;// make shadows edges soft\r\n\r\n\t// Scene\r\n\tscene = new Physijs.Scene;\r\n\tscene.setGravity(new THREE.Vector3( 0, -300, 0 ));\r\n\t\r\n\t// Camera\r\n\tcamera = new THREE.PerspectiveCamera( 45, canvasRatio, 1, 20000 );\r\n\r\n\tcameraControls = new THREE.OrbitControls( camera, renderer.domElement );\r\n\tcamera.position.set( -2095, 1145, 0);\r\n\r\n\t// Lights\r\n scene.add( new THREE.AmbientLight( 0x222222 ) );\r\n\r\n\t// the Sun in the sky\r\n\tlight = new THREE.DirectionalLight( 0xffffff, 1 );\r\n\tlight.castShadow = true;\r\n\tlight.position.set( -3000, 2000, -2000 );\r\n\tlight.shadowCameraLeft = -3000;\r\n\tlight.shadowCameraRight = 3000;\r\n\tscene.add( light );\r\n\t\r\n\t// if we do not want the sun to move across the sky\r\n\t// position it directly in the center behind the cannon\r\n\tif( moveTheSun == 0 )\r\n\t{\r\n\t\tlight.position.set( -3000, 2000, 0 );\r\n\t\tcountdownTime();\r\n\t}\r\n\r\n\t// else, make the sun move across the sky from East to West\r\n\tif( moveTheSun == 1 )\r\n\t{\r\n\t\tvar sunStart = { z: -2000 };\r\n\t\tvar sunEnd = { z: 2000 };\r\n\t\tvar moveSun = new TWEEN.Tween( sunStart ).to( sunEnd, time );\r\n\r\n\t\tcountdownTime();\r\n\r\n\t\tmoveSun.onUpdate(function(){\r\n\t\t\tlight.position.set( -3000, 2000, sunStart.z );\r\n\t\t});\r\n\t\t\r\n\t\tmoveSun.start();\r\n\t}\r\n\r\n // A simple grid floor, the variables hint at the plane that this lies within\r\n // Later on we might install new flooring.\r\n var gridXZ = new THREE.GridHelper(4000, 100, new THREE.Color(0xCCCCCC), new THREE.Color(0x888888));\r\n //scene.add(gridXZ);\r\n\r\n // Visualize the Axes - Useful for debugging, can turn this off if desired\r\n var axes = new THREE.AxisHelper(3000);\r\n axes.position.y = 1;\r\n //scene.add(axes);\r\n\r\n\t// support resizing the window to the new window dimensions\r\n\twindow.addEventListener('resize', onWindowResize, false);\r\n\t\r\n}// initScene()", "function createLandingPlanet() {\n ctx.beginPath();\n ctx.ellipse(400, 450, 430, 100, 0, Math.PI, 0);\n var grd = ctx.createLinearGradient(0, 300, 0, 400);\n grd.addColorStop(0, \"rgba(247, 185, 80, 1)\");\n grd.addColorStop(1, \"rgba(134, 27, 74, 1)\");\n ctx.fillStyle = grd;\n ctx.fill(); \n\n buildLightCraters() \n buildDarkCrater(700);\n buildDarkCrater(0);\n}", "function generateSky() {\n this.display = function() {\n fill(\"#8ad5ec\");\n rect(0,0,width,height);\n for (var i = 0; i < clouds.length; i++){\n clouds[i].display();\n //console.log(clouds[i].xPos);\n if (clouds[i].check() === false) {\n curCloud ++;\n if (curCloud == 5) {\n curCloud = 0;\n }\n clouds[i] = new cloud(random(width, (width*2) - (width*.667)) + cloudCounter, random(height- (groundHeight * 2)));\n }\n }\n }\n}", "function drawScene() {\n\n\t// Limpia canvas.\n\tctx.clearRect(0, 0, width, height);\n\n\n\n\t// Dibujar el cielo como un gradiente lineal\n\tsky = ctx.createLinearGradient(0, width, 0, height);\n\tsky.addColorStop(Math.random(), SKY_COLOR);\n\tsky.addColorStop(1, '#FFFFFF');\n\tctx.fillStyle = sky;\n\tctx.fillRect(0, 0, width, height);\n\t\n\n\t// Dibuja las montañas.\n\tctx.drawImage(mountains, -20, height - 400);\n\n\t// Dibuja el paisaje urbano.\n\tctx.drawImage(cityscape, 0, height - 400);\n\n\t// Dibuja el fondo.\n\tctx.drawImage(ground, 0, height - 86);\n\n\t// Dibuja el sol.\n\tif (sunPosition >= width)\n\t\tsunPosition = SUN_START_POSITION;\n\telse\n\t\tsunPosition++;\n\tctx.drawImage(sun, sunPosition, 0);\n\n\t// DDibuja las nubes.\n\tctx.drawImage(cloud1, 20, 50);\n\tctx.drawImage(cloud2, 150, 130);\n\tctx.drawImage(cloud3, 300, 40);\n\t\n}", "function starfield(){\n\n for (var i = 0; i < STAR_COUNT; i++) {\n x = Math.random() * canvas.width;\n y = Math.random() * canvas.height;\n context.fillStyle = \"white\";\n context.fillRect(x,y,1,1);\n }\n \n for (var i = 0; i < STAR_COUNT; i++) {\n var x = Math.random() * canvas.width;\n y = Math.random() * canvas.height,\n radius = Math.random() * 1.2;\n context.beginPath();\n context.arc(x, y, radius, 0, 360);\n context.fillStyle = \"hsla(200,100%,50%,0.8)\";\n context.fill();\n }\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n shark.y = random(0, height);\n shark.vx = shark.speed;\n}", "function randomStar(){\n\t\tx = Math.floor(Math.random() * window.innerWidth + 1);\n\t\ty = Math.floor(Math.random() * window.innerHeight +1); \n\t\tstarSize = (Math.floor(Math.random() * 10 + 3)) * 0.1;\n\t\tstarSize = starSize.toFixed(1);\n\t\tstar = new Raster(\"http://localhost/src/paperplay/images/miro-Star.png\");\n\t\tstar.scale(parseFloat(starSize));\n\t\tstar.position = new Point(x, y);\n}", "function funTime() {\n stroke(random(360), 100, 100);\n strokeWeight(1);\n\n line(0, 0, random(width), random(height));\n}", "function setPos() {\n //Get today's date\n\t\t\n\t\tif(daynight == \"night\") {\n\t\t\treturn;\n\t\t}\n\n var today = new Date();\n //Get current time\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n h = checkTime(h).toString();\n m = checkTime(m).toString();\n s = checkTime(s).toString();\n //Set time\n var time = h + m + s;\n //Calculate sky gradient position based on time\n var pos = time / 2400 * 2;\n // Set nightfall to 18:00\n var nightfall = padDigits(time - 180000, 6) * 0.00001;\n //Set sunrise to 06:00\n var sunrise = padDigits(60000 - time, 6) * 0.00001;\n //If AM, then set sky gradient position to positive value, else if PM then set to negative value\n if (pos < 100) {\n $('#sky').css({backgroundPosition: '0 ' + pos + '%'});\n } else {\n $('#sky').css({backgroundPosition: '0 ' + -pos + '%'});\n }\n //If between 18:00 and 23:59, then fade stars in, else fade out until 06:00\n if (time >= 180000 && time <= 235959) {\n $('#stars').css('opacity', nightfall);\n } else {\n $('#stars').css('opacity', sunrise);\n }\n //Update position and star opacity each second. Comment out the line below to calculate on page load only\n// p = setTimeout('setPos()', 1000);\n}", "function placeFood() {\n food = {\n x: Math.round((Math.random() * (width - cw)) / cw),\n y: Math.round((Math.random() * (height - cw)) / cw),\n };\n }", "function seeFarm(){\n //clear the document and set the background image\n document.body.innerHTML = \"\";\n\n var sun = createDiv();\n sun.id = \"sun\";\n\n var sunRays = createDiv();\n sunRays.id = \"rings\";\n sun.appendChild(sunRays);\n\n var sunRay1 = createDiv();\n sunRay1.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay1);\n\n var sunRay2 = createDiv();\n sunRay2.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay2);\n\n var sunRay3 = createDiv();\n sunRay3.classList.add(\"sunRay\");\n sunRays.appendChild(sunRay3);\n\n\n var farmerImage = createImage(\"images/farmer.png\");\n farmerImage.id = \"farmerPrize\";\n\n var barnImage = createImage(\"images/barn.png\");\n barnImage.id = \"barnPrize\";\n\n var chickenImage = createImage(\"images/chicken.png\");\n chickenImage.id = \"chickenPrize\";\n\n var pigImage = createImage(\"images/pig.png\");\n pigImage.id = \"pigPrize\";\n\n var goatImage = createImage(\"images/goat.png\");\n goatImage.id = \"goatPrize\";\n\n var cowImage = createImage(\"images/cow.png\");\n cowImage.id = \"cowPrize\";\n\n var donkeyImage = createImage(\"images/donkey.png\");\n donkeyImage.id = \"donkeyPrize\";\n\n var duckImage = createImage(\"images/duck.png\");\n duckImage.id = \"duckPrize\";\n\n var chickImage = createImage(\"images/chick.png\");\n chickImage.id = \"chickPrize\";\n\n var sheepImage = createImage(\"images/sheep.png\");\n sheepImage.id = \"sheepPrize\";\n\n var chicken2Image = createImage(\"images/chicken2.png\");\n chicken2Image.id = \"chicken2Prize\";\n\n var goat2Image = createImage(\"images/goat2.png\");\n goat2Image.id = \"goat2Prize\";\n\n var tree = createImage(\"images/tree.png\");\n tree.id = \"tree\";\n\n //create button to go back to home page\n var backToHomeButton = createButton(\"Back to Home Page\");\n backToHomeButton.id = \"backHomePrizeButton\";\n backToHomeButton.onclick = chooseLevel;\n}", "function newCircle() {\n x = random(windowWidth);\n y = random(windowHeight);\n r = random(255);\n g = random(255);\n b = random(255);\n}", "function generatestars() {\n const geom = new THREE.SphereGeometry(0.2, 24, 24);\n let rnd = Math.floor(Math.random()*4);\n let color;\n if (rnd === 0 || 1) {\n color = 0xfff4f3;\n } else if (rnd === 2) {\n color = 0xc7d8ff;\n } else {\n color = 0xffd9b2;\n }\n const mat = new THREE.MeshStandardMaterial({color: color});\n const star = new THREE.Mesh(geom, mat);\n const [x, y, z] = Array(3).fill().map(() => THREE.MathUtils.randFloatSpread(500));\n star.position.set(x, y, z);\n scene.add(star);\n }", "function setup() {\n canvas = createCanvas(screen.width, screen.height);\n //frameRate(60);\n canvas.position(0,200);\n canvas.style('z-index', '-3');\n for (i = 0; i < 100; i++) {\n rain[i] = new Rain(random(50, 550), random(0, -3000));\n }\n}", "function generateSnow(){\n var r = Math.random();\n if(r < 0.5)\n return new TreeImage('images/snowflakesmall.png', \n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\", \n 3 + Math.random() * speed_variance);\n else if (r < 0.9)\n return new TreeImage('images/snowflakemed.png', \n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\",\n 2 + Math.random() * speed_variance);\n else\n return new TreeImage('images/snowflakelarge.png',\n Math.random()*WIDTH, Math.random()*HEIGHT, \"snow\",\n 1 + Math.random() * speed_variance);\n}", "function drawCity (x, y) {\n\n var shape = new createjs.Shape();\n shape.snapToPixel = true;\n shape.x = x;\n shape.y = y;\n shape.graphics.beginFill(color.BLACK).drawCircle(0, 0, cityRadius);\n shape.cache(-cityRadius, -cityRadius, cityRadius * 2, cityRadius * 2);\n\n stage.addChild(shape);\n\n return shape;\n}", "function generateNight(numStars) {\n push();\n fill('#fabd2f');\n for (var i = 0; i < numStars; i++) {\n star(Math.random() * 1000, Math.random() * 500, 5, 15, 5);\n }\n pop();\n\n}", "function createSnow() { // shoud possibly be an object / constructo function\n var snow = document.createElement(\"div\");\n var _ = document.createTextNode(\".\");\n var main = document.getElementById(\"snowArea\"); // .createElement(\"div\");\n snow.appendChild(_);\n snow.classList.add(\"snow\");\n snow.style.cssText = \"background-color:blue;width:15px;border-radius:100%;\";\n snow.style.left = Math.random() * width + \"px\";\n snow.style.animationDuration = fallSpeed + \"s\";\n main.appendChild(snow);\n console.log(\"Created snow\");\n //console.log(\"Width: \" + width + \" FallSpeed: \" + fallSpeed + \" Rate: \" + rate);\n /* if (snow.style.top > 500 + \"px\") {\n\n }\n */\n}", "function updateLights(gl){\n if(isDisco){ // If disco mode is on\n xDisco+=1;\n for(var i=0; i<12; i++){\n lightColours[i]=randomLights[i].getVal(xDisco); // Randomise the lights\n }\n }else{\n for(var i=0; i<12; i++){\n lightColours[i]=1; // Set the lights to 1\n }\n }\n if(sunOn){\n if(sunTime+0.005>2*Math.PI){\n sunTime=0;\n }else{\n sunTime+=0.001;\n }if(won){ // If you got all the entities on the roof\n xSun+=1;\n gl.uniform3f(program.u_AmbientLight, randomSun[0].getVal(xSun), randomSun[1].getVal(xSun), randomSun[2].getVal(xSun)); // Randomise the ambient light\n gl.clearColor(randomSun[0].getVal(xSun), randomSun[1].getVal(xSun), randomSun[2].getVal(xSun),1); // Randomise the clear colour\n }else{\n sunBrightness=0.6+0.4*Math.sin(sunTime);\n gl.uniform3f(program.u_AmbientLight, sunBrightness, sunBrightness, sunBrightness); // Do the day/night cycle\n gl.clearColor(0,0,sunBrightness,1-0.6*sunBrightness);\n }\n }else{\n gl.uniform3f(program.u_AmbientLight, 0.7, 0.7, 0.7);\n }\n gl.uniform1iv(program.lightsOn, lightsOn); // Set whether the point lights are on\n gl.uniform3fv(program.lightColours, lightColours); // Set the point light colours\n gl.uniform3fv(program.lightPositions, lightPositions); // Set the point light positions\n\n}", "function moon(xloc, yloc, diam) {\n\tnoStroke();\n\tfill(255, 255, 153);\n\tellipse(xloc, yloc, diam); // parameters are passed into ellipse. \n}", "function pickLocation() {\n var cols = floor(width/scl);\n var rows = floor(height/scl);\n food = createVector(floor(random(1,cols-1)), floor(random(1,rows-1)));\n food.mult(scl);\n}", "function placeSunFlower() {\n\t\t\tvar plantRow = Math.floor((stage.mouseY - 80) / 75);\n\t\t\tvar plantCol = Math.floor((stage.mouseX - 25) / 65);\n\t\t\t// let's see if the tile is inside the game field and it's free\n\t\t\tif (plantRow >= 0 && plantCol >= 0 && plantRow < 5 && plantCol < 9 && plantsArray[plantRow][plantCol] == 0) {\n\t\t\t\tvar placedPlant = new lib.SunFlowerMc(); // constructs the plant to be placed\n\t\t\t\tplacedPlant.blood = 1.0; //向日葵的血\n\t\t\t\tplacedPlant.name = \"sunFlower_\" + plantRow + \"_\" + plantCol; // gives the plant a name\n\t\t\t\tplacedPlant.fireRate = 250 //产太阳速度\n\t\t\t\tplacedPlant.recharge = 0; // 累计能力产太阳\n\t\t\t\tplacedPlant.plantRow = plantRow; // plant row\n\t\t\t\tplacedPlant.plantCol = plantCol; //植物在哪一列\n\t\t\t\tsunFlowerContainer.addChild(placedPlant); // adds the plant\n\t\t\t\tplacedPlant.x = plantCol * 65 + 57;\n\t\t\t\tplacedPlant.y = plantRow * 75 + 115;\n\t\t\t\tplayerMoving_sunflower = false; // tells the script the player is no longer moving\n\t\t\t\tmovingSunFlower.removeEventListener(\"click\", placeSunFlower); // removes the CLICK listener from the draggable plant\n\t\t\t\toverlayContainer.removeChild(selector); // removes the selector\n\t\t\t\toverlayContainer.removeChild(movingSunFlower); // removes the plant itself\n\t\t\t\tplantsArray[plantRow][plantCol] = 2; // updates game array adding the new plant等于2是向日葵\n\t\t\t}\n\t\t}", "function getSunlightPosition(){\n sunAngle += deltaTime * 0.1 ;\n\n var x = Math.cos(sunAngle);\n var y = Math.sin(sunAngle);\n\n var direction = subtract(vec3(0.0, 0.0, 0.0), (vec3(x, y, 0.0)));\n direction[2] = sunlightDirection[2];\n return direction;\n}", "function draw() {\n // The following code changes the colours to daytime when a key is pressed\n if (keyIsPressed === true) {\n fill(\"#7CD1FF\");\n rect(0, 0, 600, 720);\n starColour = \"#7CD1FF\";\n skylineColour = \"#4A7D99\";\n lightPoleColour = \"#0F0F1C\";\n groundColour = \"#071523\";\n }\n\n // Draws stars and sets colour\n fill(starColour);\n rect(456, 40, 8, 8);\n rect(560, 104, 8, 8);\n rect(88, 64, 8, 8);\n rect(160, 144, 8, 8);\n rect(440, 168, 8, 8);\n rect(48, 216, 8, 8);\n rect(536, 232, 8, 8);\n\n // Draws skyline and sets colour\n fill(skylineColour);\n rect(0, 248, 8, 56);\n rect(8, 272, 8, 32);\n rect(16, 288, 16, 16);\n rect(32, 264, 8, 40);\n rect(40, 256, 8, 48);\n rect(48, 280, 24, 24);\n rect(72, 296, 8, 8);\n rect(104, 296, 16, 8);\n rect(120, 280, 40, 24);\n rect(136, 272, 8, 8);\n rect(144, 264, 8, 16);\n rect(160, 296, 8, 8);\n rect(176, 288, 24, 16);\n rect(304, 280, 24, 24);\n rect(312, 264, 8, 16);\n rect(392, 296, 8, 8);\n rect(400, 280, 16, 24);\n rect(408, 264, 8, 16);\n rect(432, 296, 80, 8);\n rect(448, 280, 32, 16);\n rect(456, 256, 8, 24);\n rect(528, 288, 16, 16);\n rect(552, 272, 16, 32);\n rect(568, 296, 8, 8);\n rect(576, 280, 16, 48);\n rect(592, 248, 8, 56);\n rect(0, 304, 600, 256);\n\n // Draws ground and sets colour\n fill(groundColour);\n rect(0, 560, 600, 168);\n\n // Draws light pole and sets colour\n fill(lightPoleColour);\n rect(328, 544, 88, 16);\n rect(344, 272, 56, 272);\n rect(352, 80, 40, 192);\n rect(360, 56, 24, 24);\n rect(352, 40, 32, 16);\n rect(224, 32, 144, 16);\n rect(224, 48, 64, 8);\n\n // Draws shoes and sets colour\n fill(shoeColour);\n rect(216, 552, 104, 8);\n rect(216, 536, 88, 16);\n\n // Draws laces and sets colour\n fill(laceColour);\n rect(240, 536, 24, 8);\n rect(256, 544, 16, 8);\n rect(288, 536, 24, 8);\n rect(304, 544, 16, 8);\n\n // Draws socks and sets colour\n fill(sockColour);\n rect(216, 528, 40, 8);\n rect(264, 528, 40, 8);\n\n // Draws pants and sets colour\n fill(pantsColour);\n rect(216, 440, 40, 88);\n rect(264, 440, 40, 88);\n rect(216, 392, 88, 48);\n\n // Draws shirt and sets colour\n fill(shirtColour);\n rect(240, 296, 40, 96);\n\n // Draws neck and sets colour\n fill(neckColour);\n rect(224, 264, 56, 32);\n\n // Draws face and sets colour\n fill(skinColour);\n rect(216, 216, 80, 40);\n rect(224, 256, 72, 8);\n rect(232, 264, 64, 8);\n rect(240, 272, 48, 8);\n\n // Draws hair and sets colour\n fill(hairColour);\n rect(216, 200, 16, 40);\n rect(224, 240, 8, 8);\n rect(224, 240, 8, 8);\n rect(224, 192, 16, 32);\n rect(232, 184, 64, 32);\n rect(296, 192, 8, 24);\n\n // Draws hoodie and sets colour\n fill(hoodieColour);\n rect(200, 272, 24, 8);\n rect(192, 280, 40, 8);\n rect(200, 288, 40, 48);\n rect(192, 296, 8, 8);\n rect(184, 304, 16, 32);\n rect(280, 280, 24, 120);\n rect(304, 304, 24, 104);\n rect(304, 288, 8, 16);\n rect(312, 296, 8, 8);\n\n // Draws strings and sets colour\n fill(stringColour);\n rect(224, 288, 8, 56);\n rect(288, 288, 8, 56);\n\n // Draws and rotates laptop and sets colour\n push();\n fill(laptopColour);\n rotate(PI / 3);\n rect(400, -60, 70, 100);\n pop();\n\n // Draws arm and sets colour\n fill(hoodieColour);\n rect(184, 328, 40, 32);\n rect(192, 360, 40, 16);\n rect(200, 368, 40, 16);\n rect(208, 384, 32, 8);\n\n // Draws hands and sets colour\n fill(skinColour);\n rect(240, 360, 16, 32);\n rect(256, 368, 8, 24);\n rect(296, 408, 32, 16);\n rect(304, 424, 24, 8);\n}", "function draw(){\n var dirY = (mouseY / height - 0.5) *2;\n var dirX = (mouseX / width - 0.5) *2;\n directionalLight(250, 250, 250, dirX, -dirY, 0.25);\n ambientMaterial(250);\n sphere(50, 64);\n\n\n}", "function calculateSun() {\n\t// Mean longitude of the Sun\n\tlet Lsun_mean = Utils.norm360Deg(280.4664567 + 360007.6982779 * Tau + 0.03032028 * Tau2 + Tau3 / 49931 - Tau4 / 15299 - Tau5 / 1988000);\n\n\t// Heliocentric longitude of the Earth\n\tLe = Earth.lEarth(Tau);\n\n\t// Geocentric longitude of the Sun\n\tLsun_true = Utils.norm360Deg(Le + 180 - 0.000025);\n\n\t// Heliocentric latitude of Earth\n\tBe = Earth.bEarth(Tau);\n\n\t// Geocentric latitude of the Sun\n\tlet beta = Utils.norm360Deg(-Be);\n\n\t// Corrections\n\tLsun_prime = Utils.norm360Deg(Le + 180 - 1.397 * TE - 0.00031 * TE2);\n\n\tbeta = beta + 0.000011 * (Utils.cosd(Lsun_prime) - Utils.sind(Lsun_prime));\n\n\t// Distance Earth-Sun\n\tRe = Earth.rEarth(Tau);\n\tdES = 149597870.691 * Re;\n\n\t// Apparent longitude of the Sun\n\tlambdaSun = Utils.norm360Deg(Lsun_true + deltaPsi - 0.005691611 / Re);\n\n\t// Right ascension of the Sun, apparent\n\tRASun = Math.toDegrees(Utils.norm2PiRad(Math.atan2((Utils.sind(lambdaSun) * Utils.cosd(eps) - Utils.tand(beta) * Utils.sind(eps)), Utils.cosd(lambdaSun))));\n\n\t// Declination of the Sun, apparent\n\tDECSun = Math.toDegrees(Math.asin(Utils.sind(beta) * Utils.cosd(eps) + Utils.cosd(beta) * Utils.sind(eps) * Utils.sind(lambdaSun)));\n\n\t// GHA of the Sun\n\tGHASun = Utils.norm360Deg(GHAAtrue - RASun);\n\n\t// Semidiameter of the Sun\n\tSDSun = 959.63 / Re;\n\n\t//Horizontal parallax of the Sun\n\tHPSun = 8.794 / Re;\n\n\t// Equation of time\n\t// EoT = 4*(Lsun_mean-0.0057183-0.0008-RASun+deltaPsi*Utils.cosd(eps));\n\tEoT = 4 * GHASun + 720 - 1440 * dayFraction;\n\tif (EoT > 20) {\n\t\tEoT -= 1440;\n\t}\n\tif (EoT < -20) {\n\t\tEoT += 1440;\n\t}\n}", "function Star(world) {\n\t\tthis.world = world;\n\t\tthis.rate = gs.random(0.5, 1.0);\n\t\tthis.size = Math.round(gs.random(0, 3));\n\t\tthis.x = gs.random(0, 10000);\n\t\tthis.y = gs.random(0, 10000);\n\t\tthis.fs = 'rgba(255, 255, 255, ' + (this.rate - 0.2) + ')';\n\t\t\n\t\tthis.update = function() {\n\t\t}\n\t\t\n\t\tthis.getX = function() {\n\t\t\treturn Math.round((this.x - this.world.cameraX()) * this.rate % gs.width);\n\t\t}\n\t\t\n\t\tthis.getY = function() {\n\t\t\treturn Math.round((this.y - this.world.cameraY()) * this.rate % gs.height);\n\t\t}\n\t\t\n\t\tif (this.size > 1.0) {\n\t\t\tthis.draw = function(c) {\n\t\t\t\tc.strokeStyle = this.fs;\n\t\t\t\tc.beginPath();\n\t\t\t\tc.arc(this.getX(), this.getY(), this.size, 0, Math.PI*2, true);\n\t\t\t\tc.closePath();\n\t\t\t\tc.stroke();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.draw = function(c) {\n\t\t\t\tc.fillStyle = this.fs;\n\t\t\t\tvar sx = this.getX() - 0.5;\n\t\t\t\tvar sy = this.getY() - 0.5;\n\t\t\t\tc.beginPath();\n\t\t\t\tc.rect(sx, sy, 1, 1);\n\t\t\t\tfor (var i=0; i<2; i++) {\n\t\t\t\t\tfor (var j=0; j<2; j++) {\n\t\t\t\t\t\tc.rect(sx + (i * 2 - 1) * 2, sy + (j * 2 - 1) * 2, 1, 1);\n\t\t\t\t\t\tc.rect(sx + (i * 2 - 1), sy + (j * 2 - 1), 1, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc.closePath();\n\t\t\t\tc.fill();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "refresh() {\n this.x = Math.random()*x_canv;\n this.depth = -20;\n this.radius = Math.random()*30+10;\n }", "function updateSky(currentTime, sunriseTime, sunsetTime, lastSunsetTime, nextSunriseTime) {\n\n let currentDay = currentTime.getDate();\n let currentMonth = currentTime.getMonth();\n let currentYear = currentTime.getUTCFullYear();\n let degrees = -105;\n\n\n\n if (currentTime <= sunsetTime && currentTime >= sunriseTime) {\n _sky.href = \"images/sky/day.png\";\n _moon.href = \"images/moons/sun.png\";\n _clock.style.fill = \"#7ac8f1\";\n _date.style.fill = \"#ddfafe\";\n\n let mins = ((currentTime - sunriseTime) * 100) / (sunsetTime - sunriseTime);\n\n mins /= 100;\n degrees = ((mins * 210) - 105);\n rotateSun(degrees);\n\n\n console.log(\"daytime set!\");\n }\n else {\n _sky.href = \"images/sky/night.png\";\n updateMoonPhase(util.getMoonPhase(currentYear, currentMonth, currentDay));\n _clock.style.fill = \"#1a2a31\";\n _date.style.fill = \"#364852\";\n var mins = 0;\n if (currentDay == sunriseTime.getDate() && currentTime >= sunriseTime) {\n mins = ((nextSunriseTime - currentTime) * 100) / (nextSunriseTime - sunsetTime);\n }\n else if (currentTime <= sunriseTime) {\n mins = ((sunriseTime - currentTime) * 100) / (sunriseTime - lastSunsetTime);\n }\n\n\n mins /= 100;\n mins = 1 - mins;\n degrees = ((mins * 210) - 105);\n\n\n rotateSun(degrees);\n console.log(\"nighttime set!\");\n\n //else console.log(\"SUNRISE ERROR\");\n }\n\n}", "function tick() {\n\n\n var moveSpeed = 2;\n var turnSpeed = 2;\n\n if (keys.left) {\n lookAngle -= turnSpeed;\n if (lookAngle < 0) lookAngle = 360 + lookAngle;\n }\n else if (keys.right) {\n lookAngle += turnSpeed;\n if (lookAngle >= 360) lookAngle %= 360;\n }\n if (keys.up) {\n var vec = getMoveVector();\n $scope.eye.x += moveSpeed * vec[0];\n $scope.eye.y += moveSpeed * vec[1];\n }\n else if (keys.down) {\n var vec = getMoveVector();\n $scope.eye.x -= moveSpeed * vec[0];\n $scope.eye.y -= moveSpeed * vec[1];\n }\n\n sunAngle++;\n sun.xform = new Matrix4().rotate(sunAngle / 80, 1, 0, 0);\n\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for (var a = 0; a < drawables.length; a++) {\n drawables[a].render($scope.eye, $scope.ambientValue);\n }\n requestAnimationFrame(tick, canvas);\n\n }", "function pickLocation(){\n var cols = floor(width/scl);\n var rows = floor(height/scl);\n food = createVector(floor(random(cols)), floor(random(rows)));\n food.mult(scl);\n}", "function draw() {\n background(220);\n \n for (let i = 0; i < antalBolde; i++) {\n if (xKoordinater[i] > width - d / 2 || xKoordinater[i] < 0 + d / 2) {\n xSpeed[i] = -xSpeed[i];\n }\n if (yKoordinater[i] > height - d / 2 || yKoordinater[i] < 0 + d / 2) {\n ySpeed[i] = -ySpeed[i];\n }\n xKoordinater[i] = xKoordinater[i] + xSpeed[i];\n yKoordinater[i] = yKoordinater[i] + ySpeed[i];\n \n }\n for (let i = 0; i < antalBolde; i++) {\n circle(xKoordinater[i], yKoordinater[i], d);\n fill(rød, grøn, blå);\n \n }\n}", "function setup() {\n\n// creating the canvas\n createCanvas(800,450);\n planetPink = new planet (width/2,height/2,30,30,0,0,\"#F7ACCF\",width/2,height/2,0,50,100,0.04);\n}", "function drawSphere (rex,yon) {\n\t\tconsole.log(\"call Me\");\n\t\t//debugger; \n var waxBall = new DoodleImage({\n src: \"elect.png\",\n left: rex,\n top: yon,\n width: 250,\n height: 50\n });\n draw(waxBall);\n\n }", "function flower() {\n fill('blue');\t\n translate(100, 100);\n noStroke();\n for (let i = 0; i < 10; i ++) {\n ellipse(0, 30, 20, 80);\n rotate(PI/5);\n }\n}", "function resetstar(a) {\n a.x = (Rnd() * width - (width * 0.5)) * warpZ;\n a.y = (Rnd() * height - (height * 0.5)) * warpZ;\n a.z = warpZ;\n a.px = 0;\n a.py = 0;\n }", "displayPixel() {\n // Display a pixel randomly inside the spray\n this.pixelX = random(this.x + this.sprayWidth / 2, this.x - this.sprayWidth / 2);\n this.pixelY = random(this.y + this.sprayHeight / 2, this.y - this.sprayHeight / 2);\n // Fills the pixel with variabes, without stroke and displays it from the center\n fill(this.red, this.green, this.blue);\n rectMode(CENTER);\n // Draws one pixel\n rect(this.pixelX, this.pixelY, this.pixelWidth, this.pixelHeight);\n }", "function setup() {\n createCanvas(600, 600);\n rectMode(CENTER);\n textAlign(CENTER);\n \n x = random(10, width-10);\n y = random(10, height-80);\n xSpeed = random(5, 5);\n ySpeed = random(5, 5);\n changeColor();\n}", "function drawWeather() {\n\tlet weather = document.getElementById(\"weather\")\n\tweather.style.backgroundColor = \"rgba(0,0,0,.4)\"\n\tweather.style.color = \"white\"\n\tlet temp = _weatherService.Weather\n\t// @ts-ignore\n\tweather.innerHTML = `${temp.tempF}°F <br>${temp.description}`\n}", "function mousePressed() {\n spherePosition.x = random(width);\n spherePosition.y = random(height);\n}", "update() {\n this.z -= 300/tempo;\n if (this.z < 1) {\n this.x = random(-width/1.5, width/1.5);\n this.y = random(-height/1.5, height/1.5);\n this.z = random(width);\n this.pz = this.z;\n }\n }", "function circle17(x, y, r){\n context.beginPath()\n for(let a=0; a<40; a++){\n let rt = r * Math.pow(Math.random(), 1/10)\n let theta = Math.random() * Math.PI * 2\n const xoff = Math.cos(theta) * rt + x\n const yoff = Math.sin(theta) * rt + y\n context.lineTo(xoff, yoff)\n }\n context.stroke()\n}", "function createFood() {\n food = createSprite(Math.floor((Math.random() * 590) + 30), Math.floor((Math.random() * 430) + 30), diameter, 30);\n food.shapeColor = color(255, 0, 0);\n}", "draw(color, locationX = this.ball.x, locationY = this.ball.y) {\n this.ball.graphics\n .beginRadialGradientFill([\"#fafafa\",color], [0, 1], 8, -8, 3, 0, 0, this.ballRadius)\n .drawCircle(0, 0, this.ballRadius);\n this.ball.x = locationX;\n this.ball.y = locationY;\n this.stage.addChild(this.ball);\n this.stage.update();\n }", "function foodGenerator(ctx){\n //x:(10,390) y:(160,620)\n var z = 0;\n for(var i = 0; i < 5; i++){\n var x = getRandomIntInclusive(20, 380);\n var y = getRandomIntInclusive(160, 610);\n var h = 0;\n while(inFoods(x,y)){\n x = getRandomIntInclusive(0,380);\n y = getRandomIntInclusive(160, 610);\n }\n foodDraw(ctx, x, y);\n }\n}", "function tick() {\n\n\n var moveSpeed = 2;\n var turnSpeed = 2;\n\n if(keys.left){\n lookAngle -= turnSpeed;\n if(lookAngle < 0) lookAngle = 360 + lookAngle;\n }\n else if(keys.right){\n lookAngle+=turnSpeed;\n if(lookAngle >= 360) lookAngle %= 360;\n }\n if(keys.up) {\n var vec = getMoveVector();\n $scope.eye.x += moveSpeed * vec[0];\n $scope.eye.y += moveSpeed * vec[1];\n }\n else if(keys.down){\n var vec = getMoveVector();\n $scope.eye.x-=moveSpeed*vec[0];\n $scope.eye.y-=moveSpeed*vec[1];\n }\n\n sunAngle++;\n sun.xform = new Matrix4().rotate(sunAngle/80,1,0,0);\n\n\n\n\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for(var a = 0; a < drawables.length; a++){\n drawables[a].render($scope.eye);\n }\n requestAnimationFrame(tick, canvas);\n\n }", "function sunlight(input, client, callback) {\n // console.log('sunlight script input: %s', util.inspect(input));\n var detail = input.data.detail;\n\n client.point_script(function(point){\n\n var sun_point = [input.data.sun.x, input.data.sun.y, input.data.sun.z];\n\n var dist_squared = point.c.reduce(function(out, n, i){\n var d = sun_point[i] - n;\n return out + (d * d);\n }, 0);\n\n var cos = (2 - dist_squared)/2;\n\n client.queue_point_data('sun_cos', detail, point.ro, cos, input.data.time);\n\n }, detail, function(){\n console.log('sent point data for time %s, sector %s', input.data.time, client.sector);\n client.save_point_data_queue ('sun_cos', detail, callback)\n });\n}", "function Movedown(){\n setInterval(() =>{\n x = Math.random() * canvas.width;\n y = 0;\n dy = 1;\n stars.push( new Star(x, y,dy));\n // console.log(x);\n }, 1000);\n}", "constructor() {\n this.x = random(width); //random x location for the stars to appear at \n this.y = random(height);//random y location for the stars to appear at \n this.diameter = random(5, 5);// random width and height fo each star object \n this.speed = 1;\n }", "function draw() {\n background(220, 30);\n \n // most commands are exactly the same\n // (like setting color for stroke and fill)\n fill(0);\n noStroke();\n \n // others just need to be changed to match\n // the Javascript variable syntax\n for (var i=0; i<100; i++) {\n var x = random(0, width);\n var y = random(0, height);\n ellipse(x,y, 10,10);\n } \n}", "function draw() {\n\tbackground(51);\n\n\tif(s.eat(food)){\n\t\tpickLocation();\n\t}\t\n\n\ts.death();\n\ts.update();\n\ts.show();\n\n\tfill(255, 0 ,100);\n\trect(food.x, food.y, grid, grid);\n}", "function redrawCircle() {\n\n r = 0;\n x = random(100, windowWidth);\n y = random(100, windowHeight);\n fillColor = color(random(0, 255), random(0, 255), random(0, 255));\n currentTime = 0;\n}", "function pickLocation(){\n var cols = floor (width/scl);\n var rows = floor (height/scl);\n //Floor to be whole numbers.\n food = createVector(floor(random(cols)), floor(random(rows)));\n food.mult(scl);\n}", "function addSunFlower() { ////////////////////////////////// //////////////////////////////////添加植物\n\t\t\tvar sunFlower = new lib.TwinSunflower(); // constructs a new plant\n\t\t\toverlayContainer.addChild(sunFlower); // adds the plant\n\t\t\tsunFlower.buttonMode = true; // makes the mouse change shape when over the plant//////////////////////////////////////改变鼠标样式\n\t\t\tsunFlower.x = 78;\n\t\t\tsunFlower.y = 9;\n\t\t\tsunFlower.addEventListener(\"click\", onSunFlowerClicked); // listener to be triggered once the plant is clicked\n\t\t}", "function positionFood() {\n food.x = random(0,width);\n food.y = random(0,height);\n food.vx = random(-food.maxSpeed,food.maxSpeed);\n food.vy = random(-food.maxSpeed,food.maxSpeed);\n}", "function drawSphere() {\n setMV();\n Sphere.draw();\n}", "function drawSphere() {\n setMV();\n Sphere.draw();\n}" ]
[ "0.76427907", "0.73669904", "0.72002107", "0.68546826", "0.67772126", "0.6686576", "0.66750973", "0.64924186", "0.64907587", "0.64816463", "0.64057523", "0.63944376", "0.6379517", "0.6342701", "0.631193", "0.6224635", "0.6220528", "0.6158347", "0.6134893", "0.61311525", "0.6105236", "0.607409", "0.6073363", "0.6056795", "0.60458404", "0.60345966", "0.6027607", "0.60270333", "0.6017773", "0.6016418", "0.6014415", "0.60111284", "0.60079116", "0.6003106", "0.59992254", "0.59563154", "0.5943606", "0.5941413", "0.5936616", "0.59338266", "0.59186405", "0.59028393", "0.5899837", "0.5879812", "0.58325624", "0.5810826", "0.58106196", "0.58001447", "0.57995325", "0.5781524", "0.575796", "0.5751189", "0.5750556", "0.5747322", "0.5742485", "0.5738883", "0.5735773", "0.5734546", "0.57278544", "0.57221746", "0.57215995", "0.5718938", "0.57173675", "0.571457", "0.571316", "0.569341", "0.5684799", "0.5676205", "0.56758904", "0.56757885", "0.5668483", "0.5667742", "0.56649506", "0.5662327", "0.56536734", "0.5646229", "0.5639994", "0.56320226", "0.5629753", "0.5628762", "0.5614151", "0.56102765", "0.5607059", "0.56062776", "0.5603052", "0.55954885", "0.5595041", "0.5590904", "0.55805707", "0.5569388", "0.5566691", "0.5556169", "0.5555788", "0.5549569", "0.554841", "0.5544725", "0.5544086", "0.55410004", "0.553916", "0.553916" ]
0.817499
0
Polling transport polymorphic constructor. Decides on xhr vs jsonp based on feature detection.
function polling(opts) { var xhr var xd = false var xs = false opts.xdomain = xd opts.xscheme = xs return new XHR(opts) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LongPollingTransport() {\n var _super = new org.cometd.LongPollingTransport();\n var that = org.cometd.Transport.derive(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: \"POST\",\n contentType: \"application/json;charset=UTF-8\",\n data: packet.body,\n xhrFields: {\n // Has no effect if the request is not cross domain\n // but if it is, allows cookies to be sent to the server\n withCredentials: true,\n },\n beforeSend: function (xhr) {\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send\n return true;\n },\n success: packet.onSuccess,\n error: function (xhr, reason, exception) {\n packet.onError(reason, exception);\n },\n });\n };\n\n return that;\n }", "function LongPollingTransport() {\n const _super = new org.cometd.LongPollingTransport();\n const that = org.cometd.Transport.derive(_super);\n that.xhrSend = (packet) => {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n beforeSend: (xhr) => {\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send\n return true;\n },\n success: packet.onSuccess,\n error: (xhr, reason, exception) => {\n packet.onError(reason, exception);\n }\n });\n };\n return that;\n }", "function LongPollingTransport() {\n var _super = new _cometd.LongPollingTransport();\n var that = (0, _cometd.derive)(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function beforeSend(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function error(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n}", "function LongPollingTransport() {\n var _super = new _cometd.LongPollingTransport();\n var that = (0, _cometd.derive)(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function beforeSend(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function error(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n}", "function LongPollingTransport() {\n var _super = new cometdModule.LongPollingTransport();\n var that = cometdModule.Transport.derive(_super);\n\n that.xhrSend = function(packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function polling$1 (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new xmlhttprequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new pollingXhr(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new pollingJsonp(opts);\n }\n }", "function polling$1(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new xmlhttprequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new pollingXhr(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new pollingJsonp(opts);\n }\n }", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n }", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n }", "function polling(opts){var xhr;var xd=false;var xs=false;var jsonp=false !== opts.jsonp;if(global.location){var isSSL='https:' == location.protocol;var port=location.port; // some user agents have empty `location.port`\nif(!port){port = isSSL?443:80;}xd = opts.hostname != location.hostname || port != opts.port;xs = opts.secure != isSSL;}opts.xdomain = xd;opts.xscheme = xs;xhr = new XMLHttpRequest(opts);if('open' in xhr && !opts.forceJSONP){return new XHR(opts);}else {if(!jsonp)throw new Error('JSONP disabled');return new JSONP(opts);}}", "function polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n var isSSL = \"https:\" === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr\n , xd = false;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n }\n\n xhr = util.request(xd, opts);\n\n if (xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n }\n\n opts.xdomain = xd;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n return new JSONP(opts);\n }\n}", "function BaseTransport(options) {\n this.options = options;\n /** A simple buffer holding all requests. */\n this._buffer = new utils_1.PromiseBuffer(30);\n /** Locks transport after receiving rate limits in a response */\n this._rateLimits = {};\n /** Default function used to parse URLs */\n this.urlParser = function (url) { return new url_1.URL(url); };\n this._api = new core_1.API(options.dsn, options._metadata, options.tunnel);\n }", "function Transport(options, callback) {\n options = options || {};\n if (typeof options === 'string') {\n options = {url: options};\n }\n if (typeof callback === 'function') {\n options.callback = callback;\n }\n this.data = options.data || {};\n this.path = options.path || [];\n this.base = options.url;\n this.callback = options.callback || function () {\n };\n this.state = 'idle';\n }", "getLongPollTransport(){ return LongPoll }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "function Polling(ri, Receiver, recv_url, AjaxObject) {\n var that = this;\n that.ri = ri;\n that.Receiver = Receiver;\n that.recv_url = recv_url;\n that.AjaxObject = AjaxObject;\n that._scheduleRecv();\n}", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", err => {\n this.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", err => {\n this.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug$1(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }" ]
[ "0.7308519", "0.7286786", "0.72286385", "0.72286385", "0.7202566", "0.7158869", "0.7158869", "0.7158869", "0.6479727", "0.64629453", "0.6436861", "0.6436861", "0.64278656", "0.64278656", "0.64278656", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.63772345", "0.63772345", "0.63772345", "0.6319875", "0.6319875", "0.625409", "0.6249667", "0.6248678", "0.6248678", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.6212791", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6192265", "0.61626863", "0.6035533", "0.6016028", "0.5990677", "0.56544554", "0.56486654", "0.56486654", "0.56410384", "0.5635839", "0.5597591", "0.5547469" ]
0.5942718
93
Remove all falsy values from an array. Falsy values in JavaScript are false, null, 0, "", undefined, and NaN. Solution:
function bouncer(arr) { return arr.filter(Boolean); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFalsy(arr) {\r\n return arr.filter(a => !!a);\r\n }", "function filterOutFalsy(array) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n result[result.length] = array[i];\n }\n }\n return result;\n}", "function removeFalsy(array) {\n return array.filter((el) => {\n return !!el;\n })\n }", "function filterFalsy (arr) {\n var newArray = [];\n var j = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] !== 0 && arr[i] !== \"\" && arr[i] !== null && arr[i] !== undefined && arr[i] !== NaN && arr[i] !== false){\n newArray[j] = arr[i];\n j++;\n }\n }return newArray;\n}", "function falsyFilter(){\n for(var i = 0; i < mixedArray.length; i++){\n\tif(mixedArray[i] === false)\n {mixedArray.splice(i, 1)};\n\treturn mixedArray;\n }\n}", "function falsyValues(array){\n var newArray = [];\n var count = 0;\n for (var i = 0; i < array.length; i++){\n if(!!array[i] !== false){\n newArray[count] = array[i]\n count++\n }\n }\n return newArray\n}", "function falsyFilter(){\nfor(var i = 0; i < mixedArray.length; i++) {\n if(mixedArray === true || mixedArray === \"true\" || mixedArray !== false)\n\t {mixedArray.slice(i, 1)}\n else return mixedArray;\n}\n}", "function trueValues(arr) {\n\n arr = arr.filter(Boolean);\n}", "function removeUndefined(arr) {\n return arr.filter(function(item){\n return item !== undefined ? true: false;\n });\n }", "function TruthyValue(myArray){\n var mynums = [];\n for (var i=0; i<myArray.length; i++){\n if ((myArray[i] > 0) && (myArray[i] !== null)){\n mynums.push(myArray[i]); \n }\n }\n return mynums;\n}", "function compact (array) {\n array = array || [];\n return array.filter(function(el) {\n return el === 0 || Boolean(el).valueOf();\n });\n}", "function compact(array) {\n var newArray = [];\n for (var i = 0; i < array.length; i++) {\n if (Number.isNaN(array[i]) !== true && array[i] !== false && array[i] !== 0 && array[i] !== undefined && array[i] !== '' && array[i] !== null) {\n newArray.push(array[i]);\n }\n }\n return newArray;\n}", "function cleanArray(arr) {\n var len = arr.length,\n i;\n\n for (i = 0; i < len; i++) {\n if (arr[i] && typeof arr[i] != \"undefined\") {\n arr.push(arr[i]); // copy non-empty values to the end of the array\n }\n }\n\n arr.splice(0, len); // cut the array and leave only the non-empty values\n\n return arr;\n }", "function removeNull(arr) {\n return arr.filter(Boolean);\n}", "removeEmptyVals(data) {\n return data.filter(val => {\n return !!val;\n });\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n function nofalsey(input){\n\n return input != false && input != 0 && input != \"\" && input != NaN && input != undefined;\n }\n return arr.filter(nofalsey);\n}", "function compact(array) {\n return array.filter(function (element) {\n return !!element;\n });\n}", "function bouncer(arr) {\n return arr.filter(Boolean); \n}", "function compact(arr) {\n\t return filter(arr, function(val){\n\t return (val != null);\n\t });\n\t }", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n}", "function bouncer(arr) {\n return arr.filter((val) => Boolean(val));\n}", "function bouncer(arr) {\n return arr.filter(val => Boolean(val));\n}", "function zeroNegVals(arr){\n for(var i = 0; i < arr.length; i++){\n if (arr[i] < 0){\n arr[i] = 0\n }\n }\n return arr\n}", "function compact(array) {\n var arrays= array.filter(function (params) {\n return !!params; \n });\n return arrays;\n}", "function bouncer(arr) {\n return arr.filter(function(val) {\n return Boolean(val);\n });\n}", "function filterNulls(arr){\n return arr.filter( x => x == null)\n}", "function stripArray(values) {\n return values.filter(function(d) {\n return d.length && d[0] !== '';\n });\n}", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n }", "function bouncer(arr) {\n // use filter function to extract all values other than false\n return arr.filter(Boolean);\n}", "function zeroOutArrayNegativeVals(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0\n }\n }\n return arr\n}", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n \n function falseValues(value) {\n if (Boolean(value)) {\n return true;\n } else {\n return false;\n }\n }\n \n var trueValues = arr.filter(falseValues);\n\n return trueValues;\n}", "function bouncer2(arr) {\n return arr.filter(Boolean)\n}", "function removeNull(array) {\n\t\t\t\treturn array.filter(x => x !== null)\n\t\t\t}", "function bouncer(arr) {\n return arr.reduce((acc,val) => {\n\n if (Boolean(val)) {\n acc.push(val);\n }\n return acc;\n }, []);\n}", "function removeZeros(arr) {\n return arr.filter((x) => x);\n}", "function zeroOutArrayNegativeVals(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = 0;\n }\n }\n return arr;\n}", "function compact(arrOrObj, opt_filterOutNothings) {\r\n return filter(arrOrObj, function(value) {\r\n return opt_filterOutNothings ? !isNothing(value) : value;\r\n });\r\n }", "function noNeg(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] < 0)\n arr[i] = 0;\n }\n return arr; \n}", "function bouncer(arr) {\n\n var holderArray = [];\n //calls filter to run removeFalseVar method\n holderArray = arr.filter(removeFalseVar);\n\n return holderArray;\n}", "function bouncer(arr) {\n // let arr1mod;\n // arr.forEach((e,i)=> {\n // // if (!e) {\n // // console.log('false ' + e)\n // // // arr.filter(x=> x == false)\n // // } else {\n // // console.log('true ' + e)\n // // }\n // if (!e) {\n // arr1mod = arr.filter(x=> x == e)\n // }\n // })\n // return arr1mod;\n let arr1mod;\n arr.forEach((e,i)=> {\n\n if (!e || e == 0 || e == undefined || e == \"\" || e == NaN || e == e) {\n arr1mod = arr.filter(x=> x)\n }\n })\n return arr1mod;\n\n}", "function filterArray(elt){\n return elt === null;\n}", "function bouncer(arr) {\n return arr.filter((x) => { // x iterates through arr and only returns values that are not false\n if (x != false) {\n return x;\n }\n });\n}", "function bouncerBool(arr) {\n let newArr = arr.filter(Boolean);\n return newArr;\n}", "function trimNull(array){\n for(var i = 0; i<array.length; i++) {\n if(array[i] == null) {\n array.splice(i--, 1);\n }\n }\n // console.log('Trimmed array: ');\n // console.log(array)\n }", "function removeFalsy(obj) {\n for(key in obj) {\n if(obj[key] == false || obj[key] == null || obj[key] == undefined ) {\n delete obj[key];\n }\n }\n return obj\n}", "function negativevalues(arr)\r\n{\r\n\tfor(var i=0;i<arr.length;i++)\r\n\t{\r\n\t\tif (arr[i]<0)\r\n\t\t{\r\n\t\t\tarr[i]=0;\r\n\t\t}\r\n\t}\r\n\r\n\t\tconsole.log (\"Removing negatives\",arr);\r\n}", "function ZeroOutArrayNegativeVals(arr){\n}", "function noNegs(x) {\n for (var i=0; i<x.length; i++) {\n if (x[i]<0) {\n x[i]=0;\n }\n }\n return x;\n}", "function nullify(array) {\n for (key in array) {\n if (array[key] == \"\") {\n array[key] = null;\n }\n }\n}", "function nullify(array) {\n for (key in array) {\n if (array[key] == \"\") {\n array[key] = null;\n }\n }\n}", "function nullify(array) {\n for (key in array) {\n if (array[key] == \"\") {\n array[key] = null;\n }\n }\n}", "function realRemoveZeros(array) {\n const head = [];\n const tail = [];\n for (const e of array) {\n if (e === 0 || e === \"0\") {\n tail[tail.length] = e;\n } else {\n head[head.length] = e;\n }\n }\n return [...head, ...tail];\n}", "function neg(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "function removeEmpty( array ) {\n\tfor ( var i = 0; i < array.length; i++ ) {\n\t\tif ( array[ i ] === \"\" ) {\n\t\t\tarray.splice( i, 1 );\n\t\t}\n\t}\n\treturn array;\n}", "function cleanArray( array ) {\n array.length = 0;\n }", "function filterArray(array) {\r\n const filteredArray = array.filter(item => item !== null);\r\n return filteredArray;\r\n}", "function filterArray(array){\n\nconst filteredArray=array.filter(item =>item !== null);\n\nreturn filteredArray;\n}", "function truthy(Obj) {\n\t\tconsole.log('removing falsy values');\n\t\tfor (var i in Obj) {\n\t\t\tif (!Obj[i]) {\n\t\t\t\tdelete Obj[i];\n\t\t\t}\n\t\t}\n\t\tObj = Obj;\n\t\treturn Obj;\n\t}", "cleanArray(array) {\n array = array.filter(function(element) {\n element = element.trim();\n \n if (element !== null && element !== \"\" && element!== undefined) {\n return element;\n }\n });\n \n array = array.map(element => element.trim());\n \n return array;\n }", "function countTruthy(array) {\n let newArray = [];\n for(let value of array) {\n if(value !== undefined && value!== null && value !== 0 && value !=='' && value !== false && value !== NaN) {\n newArray.push(value);\n }\n }\n return newArray.length;\n}", "function bouncer(arr) {\n return arr.filter((item) => {\n return Boolean(item);\n });\n }", "function destroyer(arr) {\n // Remove all the values\n for (var i = 1; i < arguments.length; i++) {\n var skip = arguments[i];\n arr = arr.filter(function (e) {\n return e !== skip;\n });\n }\n return arr;\n}", "function clearEmpty(objArr) {\n var nonull = [];\n for (var i = 0; i < objArr.length; ++i) {\n if (objArr[i]) {\n nonull.push(objArr[i]);\n }\n }\n return nonull;\n }", "function removeNonInteger(arr) {\n array = arr.filter(value => Number.isInteger(value));\n return array;\n}", "defined(arr) {\n\n let arr2 = [];\n for (let i = 0; i < arr.length; i++) {\n if (!arr[i] && arr[i] !== 0) {\n //console.log(arr[i]);\n } else {\n arr2.push(arr[i]);\n }\n }\n return arr2;\n }", "function arrayDefined(array) {\n return array.filter(function (item) { return item != null; });\n}", "function negatives(arr) {\n for (var i=0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n }\n return arr;\n}", "function filterArray(array) {\n const filteredArray = array.filter((item) => item !== null);\n return filteredArray;\n}", "function filterArray(array) {\n const filteredArray = array.filter((item) => item !== null)\n return filteredArray\n}", "function dropElements(arr, func) {\n let myArr = arr.map(func);\n arr.splice(0,myArr.indexOf(true));\n if(arr.length === myArr.length && myArr[myArr.length-1] === false){\n return [];\n }\n return arr;\n}", "function trimEmpty(array) {\n return array.filter(x => x !== \"\");\n}", "function noNegatives(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = 0;\n }\n }\n console.log(arr);\n}", "function wipe(array) {\n // Right now it's similar to array.fill(0). If it turns\n // out that runtimes optimize this call away, maybe\n // we can try something else.\n for (let i = 0; i < array.length; i++) {\n array[i] = 0;\n }\n return array;\n}", "function negatives(array) {\n for (let i = 0; i < array.length; i++) {\n if(array[i] < 0) { \n array[i] = 0;\n }\n }\n return array;\n}", "function destroyer(arr, ...values) {\n\treturn arr.filter((el) => !values.includes(el));\n}", "function compact(arr) {\n if (!arr) return null;\n var i, data = [];\n for (i = 0; i < arr.length; i++) {\n if (arr[i]) data.push(arr[i]);\n }\n return data;\n}", "function compact(ary) {\n\tlet ary1 = []\n\tfor (let i = 0; i < ary.length; i++){\n\t\tif (ary[i] != null){\n\t\t\tary1.push(ary[i])\n\t\t}\n\t}\n\treturn ary1\n}", "function bouncer(arr) {\n let newArr = [];\n for (let i = 0 ; i < arr.length ; i++) {\n if (Boolean(arr[i]) == true ) {\n newArr.push(arr[i])\n }\n }\n return newArr;\n}", "function zeroOutNegArrayVals(arr) {\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr.length; j++) {\n if (arr[i][j] < 0) {\n arr[i][j] = 0\n }\n }\n }\n console.log(arr)\n}", "function bouncer(arr) {\n let boolArr = []\n for(let i = 0; i < arr.length; i++) {\n if (arr[i]) boolArr.push(arr[i]);\n }\n return boolArr;\n }", "function _excludeEmptyElem(arr) {\n _.forEach(arr, function (elem) {\n _.remove(elem, function (innerElem) {\n return innerElem == -1;\n })\n })\n }", "function compact(array) {\n var i = 0;\n var length = array.length;\n var results = [];\n while(i < length) {\n if (array[i]) {\n results.push(array[i]);\n }\n i++;\n }\n return results;\n}", "function remove_falsy_values(obj) {\n var new_obj = {};\n for (var key in obj) {\n if (obj[key]) {\n new_obj[key] = obj[key];\n }\n }\n return new_obj;\n}", "function erase_strings(array) {\r\n\tfor (var i = 0; i < emptyArray.length; i++) {\r\n\t\tif (isNaN(emptyArray[i]) == 0) {\r\n\t\t\tnumberonlyArray[i] = emptyArray[i];\r\n\t\t\t//numberonlyArray.splice(i);\r\n\t\t}\r\n\t}\r\n\r\nreturn console.log(numberonlyArray);\r\n}", "function validValues(arr) {\r\n var newArr = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i] < 0 || arr[i] > 0) {\r\n newArr.push(arr[i]);\r\n }\r\n }\r\n return newArr;\r\n}", "function filterUndefined(value) {\n return value !== undefined;\n}", "function zeroOutNegativeNums(arr){\n for (let i =0; i<arr.length;i++){\n if (arr[i] < 0) {\n arr[i] = 0; \n }\n }\n return arr;\n}" ]
[ "0.8715977", "0.8510027", "0.8418151", "0.8347382", "0.80667627", "0.79442424", "0.7571476", "0.75634205", "0.7542532", "0.7405202", "0.7393069", "0.73711216", "0.7367117", "0.732526", "0.7209689", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.71225905", "0.70716333", "0.699667", "0.6977851", "0.69331956", "0.69321173", "0.69289315", "0.6909638", "0.6787262", "0.67655545", "0.67362434", "0.6717298", "0.66968375", "0.667787", "0.66694885", "0.6647343", "0.6640956", "0.6580371", "0.6576582", "0.6568702", "0.65582436", "0.6554899", "0.6531854", "0.65303195", "0.65150106", "0.65081364", "0.64923316", "0.6491684", "0.6483744", "0.6465666", "0.64521235", "0.6413497", "0.6378876", "0.6338187", "0.6337759", "0.6337759", "0.6337759", "0.63369465", "0.6335943", "0.6320786", "0.6318043", "0.6311787", "0.63076264", "0.63072485", "0.629607", "0.6294411", "0.62943465", "0.6292764", "0.62911016", "0.62858087", "0.62744683", "0.62659657", "0.6262486", "0.625529", "0.6251428", "0.6242221", "0.6227703", "0.6215992", "0.62154776", "0.62112194", "0.6189877", "0.6177292", "0.6174388", "0.61734825", "0.6165624", "0.6158746", "0.61580086", "0.61500347", "0.61266553", "0.6122749", "0.6119994", "0.6118026", "0.61149734" ]
0.6882298
32
Code Explanation: The Array.prototype.filter method expects a function that returns a Boolean value which takes a single argument and returns true for truthy 456 value or false for falsy value. Hence we pass the builtin Boolean function. Beginer Code Solution:
function isGood(val){ return val !== false && val !== null && val !== 0 && val !== "" && val !== undefined && !Number.isNaN(val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterExample(arr) {\n const even = (num) => {\n if (num % 2 == 0) {\n return num\n }\n };\n const odd = (num) => {\n if (num % 2 != 0) {\n return num\n }\n };\n console.log(arr.filter(even));\n console.log(arr.filter(odd));\n\n}", "function bouncer(arr) {\n return arr.filter((val) => Boolean(val));\n}", "function bouncer2(arr) {\n return arr.filter(Boolean)\n}", "function bouncer(arr) {\n return arr.filter(function(val) {\n return Boolean(val);\n });\n}", "function myFilter(arr, f){\n let ans = [] ;\n\n for(let i = 0; i < arr.length; i++){\n if(f(arr[i]) == true){\n ans.push(arr[i]) ;\n }\n }\n return ans ;\n}", "function bouncer(arr) {\n return arr.filter(val => Boolean(val));\n}", "function bouncer(arr) {\n return arr.filter((item) => {\n return Boolean(item);\n });\n }", "function bouncer(arr) {\n return arr.filter(Boolean); \n}", "function filter(array, fn) {\n let filteredArray = [];\n array.forEach(element => {\n if (!fn(element)) {\n filteredArray.push(element);\n }\n });\n console.log(filteredArray); \n}", "function filter(arr,fn){\n let filteredArray=[];\n for(let i =0;i<arr.length;i++){\n if(fn(arr[i])===true){\n filteredArray.push(arr[i]);\n }\n }\n return filteredArray;\n}", "function filter(arr, fn) {\n\tlet test = [];\n\tfor(let item of arr){\n\t\tif(fn(item)){\n\t\t\ttest.push(item);\n\t\t}\n\t\n\t}\n\treturn test;\n}", "function bouncerBool(arr) {\n let newArr = arr.filter(Boolean);\n return newArr;\n}", "function falsyFilter(){\nfor(var i = 0; i < mixedArray.length; i++) {\n if(mixedArray === true || mixedArray === \"true\" || mixedArray !== false)\n\t {mixedArray.slice(i, 1)}\n else return mixedArray;\n}\n}", "function filter(arr, fn) {\n let newArray = [];\n\n arr.forEach(element => { if (fn(element) === true) {\n newArray.push(element);\n }\n });\n\n return newArray;\n}", "function passTesting(arr, func) {\n // let new_array = [];\n\n // Let's try this with a simple for() loop // *** THIS WORKS BUT LETS IMPROVE IT ***\n // for(let i = 0; i < arr.length; i++) {\n // let result = func(arr[i]);\n // if(result == true) {\n // new_array.push(arr[i]);\n // }\n // }\n // return the NEW_ARRAY\n\n // ** This is how we can use higher order functions and improve the above code\n let new_array = arr.filter( elem => func(elem));\n \n console.log(new_array);\n return new_array;\n}", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n}", "function bouncer(arr) {\n return arr.filter((x) => { // x iterates through arr and only returns values that are not false\n if (x != false) {\n return x;\n }\n });\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function filter(arr, fn) {\n let newArray = [];\n\n for (let i=0; i<arr.length; i++){\n if(fn(arr[i]) === true){\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function filter(arr, fn) {\n let results = [];\n\n // iterate over the array\n // apply the function to that specific element\n // add it to my results array if it's true\n // or leave it out if it's false\n for (let element of arr) {\n let result = fn(element);\n\n if (result == true) {\n results.push(element);\n }\n }\n\n return results;\n}", "function returnBoo (arr) { \n\treturn arr.filter(function(element){\n\t\treturn typeof element === \"boolean\";\n\t})\n}", "function filter(arr, fn) {\n let newArray = [];\n for (i=0; i<arr.length; i++) {\n if(fn(arr[i])===true) {\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function mySome_filter(arr, condition) {\n\t\treturn arr.filter(condition).length != 0;\n\t}", "function bouncer(arr) {\n // let arr1mod;\n // arr.forEach((e,i)=> {\n // // if (!e) {\n // // console.log('false ' + e)\n // // // arr.filter(x=> x == false)\n // // } else {\n // // console.log('true ' + e)\n // // }\n // if (!e) {\n // arr1mod = arr.filter(x=> x == e)\n // }\n // })\n // return arr1mod;\n let arr1mod;\n arr.forEach((e,i)=> {\n\n if (!e || e == 0 || e == undefined || e == \"\" || e == NaN || e == e) {\n arr1mod = arr.filter(x=> x)\n }\n })\n return arr1mod;\n\n}", "function filter (array,fn) {\n return array.filter(fn)\n}", "function filter(array, f) {\n if (array) {\n var len = array.length;\n var i = 0;\n while (i < len && f(array[i]))\n i++;\n if (i < len) {\n var result = array.slice(0, i);\n i++;\n while (i < len) {\n var item = array[i];\n if (f(item)) {\n result.push(item);\n }\n i++;\n }\n return result;\n }\n }\n return array;\n }", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n }", "function filter(arr,fn) {\n const newArray = [];\n for(let i = 0; i<arr.length; i++){\n if(fn(arr[i])){\n newArray.push(arr[i]);\n }\n } \n return newArray;\n}", "function filter(array, test) {\r\n\tlet passed = [];\r\n\tfor(let element of array) {\r\n\t\tif(test(element)) {\r\n\t\t\tpassed.push(element);\r\n\t\t}\r\n\t}\r\n\treturn passed;\r\n}", "function filter(array, test) { // filters through an array\n var passed = []; // holds the passed elements of the test\n for (var i = 0; i < array.length; i++) { // goes through the length of the array\n if (test(array[i])) { // if the element passes the test\n passed.push(array[i]); // put it in the new array\n }// end of if \n }// end of for loop\n return passed; // return the array with the passes elements\n}// end of function", "function filter(array,test){\n //Create a new array to populate and return\n let passed = [];\n //Apply the test to each element of the array, if passes add to return array\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}", "function filter(array, test){\n let passed = [];\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}", "function evensOnly(arr){\r\n const result = arr.filter(function(num){\r\n if (num % 2 == 0){\r\n return true;\r\n };\r\n });\r\n return result;\r\n\r\n}", "function falsyFilter(){\n for(var i = 0; i < mixedArray.length; i++){\n\tif(mixedArray[i] === false)\n {mixedArray.splice(i, 1)};\n\treturn mixedArray;\n }\n}", "function filter(arr, fn) {\n let newArray = [];\n for (const item of arr) {\n if (fn(item)) newArray.push(item);\n }\n return newArray;\n}", "function filter(list, predicateFn) {\n\n}", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n function nofalsey(input){\n\n return input != false && input != 0 && input != \"\" && input != NaN && input != undefined;\n }\n return arr.filter(nofalsey);\n}", "function testcase() {\n\n function callbackfn(val, idx, obj) {\n if (idx === 1) {\n return val === 9;\n }\n return false;\n }\n\n var newArr = [11, 9].filter(callbackfn);\n return newArr.length === 1 && newArr[0] === 9;\n }", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n \n function falseValues(value) {\n if (Boolean(value)) {\n return true;\n } else {\n return false;\n }\n }\n \n var trueValues = arr.filter(falseValues);\n\n return trueValues;\n}", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n return passed;\n}", "function $FHml$var$filter(xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n\n return res;\n}", "function filterArray(arr,func){\n return arr.filter(func);\n}", "function filterPassing(array) {\n let filter = array.filter(array => array.passed === true);\n return filter\n}", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n\n return passed;\n}", "function filter(arr, fn) {\n let newArray = [];\n\n for (let elem of arr) {\n if(fn(elem)) newArray.push(elem);\n }\n\n return newArray;\n}", "function bouncer(arr) {\n \n let trueValues = arr.filter(function bouncer(arr) {\n\n return arr;\n \n })\n\n return trueValues;\n}", "function evensOnly(arr)\n{\n\t// your code here\n\tconst result = arr.filter(function(num){\n\t\tif (num % 2 == 0){\n\t\t\treturn true;\n\t\t}\n\t});\n\treturn result;\n} // end function", "function filter(arr, func){\n let filtered = []\n for(let i=0; i < arr.length; i++){\n if(func(arr[i])){\n filtered.push(arr[i])\n }\n }\n return filtered;\n}", "function filterArray(array, filterFunction) {\n // your code here!\n}", "function filter(array, test) {\n var passed = [];\n for (var i = 0; i < array.length; i++) {\n if (test(array[i])) {\n passed.push(array[i]);\n }\n }\n\n return passed;\n}", "static *_filter(iterator, predicate) {\n\t for (let value of iterator) {\n\t if (predicate(value)) {\n\t yield value;\n\t }\n\t }\n\t }", "function trueValues(arr) {\n\n arr = arr.filter(Boolean);\n}", "function removeFalsy(arr) {\r\n return arr.filter(a => !!a);\r\n }", "function filter(array, test) {\n//filter function passing it test and array\n var passed = [];\n//creating variable passes and new array\n for (var i = 0; i < array.length; i++) \n//for i is = to 0 and i is less than array length increment i\n {\n if (test(array[i]))\n//testting i in array\n passed.push(array[i]);\n//pushing onto the array\n }\n return passed;\n}", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n\n var truthy = arr.filter(function (truth) {\n if (truth) {\n return true;\n }\n });\n return truthy;\n}", "function filter(arr, testFunction) {\n var result = [];\n for (var i = 0; i < arr.length; ++i)\n var currentValue = arr[i];\n if (passesTest(currentValue)) {\n result.push(currentValue);\n }\n }", "function isFilter(arr){\n for(let i=0;i<arr.length;i++)\n {\n let val = isEven(arr[i]);\n console.log(val);\n }\n \n}", "function filterArray(arr, filterFn) {\r\n var tempArr = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (filterFn(arr[i], i, arr)) {\r\n tempArr.push(arr[i]);\r\n }\r\n }\r\n return tempArr;\r\n}", "function myFilter(fn) {\n var res = [];\n for (var i = 0; i < arr.length; i++) {\n var ret = fn(arr[i]);\n if (ret) res.push(arr[i]);\n }\n\n return res;\n}", "function filterQuestionsByType(arr,bool){\n return arr.filter(({isEssayQuestion})=> isEssayQuestion === bool)\n}", "function filter(array, fn) {\n // Your code here\n\n // I create an empty array result that will contain my answer\n let result=[];\n\n // I check that functions inputs were Ok\n if(array.length !==0 && fn===pickEvenNumbers){\n // If OK, I filter the array\n result=array.filter(fn);\n //If not, I manage the case\n }else{\n return(\"tableau vide\",array);\n }\n //I return the filtered array\n return result;\n}", "function filterLeft(arr, predicate = (element) => !!element) {\n let ret = [];\n for (let x of arr) {\n if (predicate(x)) {\n ret.push(x);\n }\n else {\n break;\n }\n }\n return ret;\n}", "function filter(array, filterFct) {\n\nvar outputArray = [];\n//iterate thru the initial array\n//check if element is even or not\nfor (var element of arr) {\n // if (element % 2 === 0) {\n // outputArr.push(element);\n // }\n if (filterFct(element)) {\n outputArr.push(element);\n }\n}\nreturn outputArr;\n}", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function filter(el, filterFn) {\n Array.prototype.filter.call(el, filterFn);\n } //https://jsfiddle.net/w1rktecz/", "function bouncer(arr) {\n\n var holderArray = [];\n //calls filter to run removeFalseVar method\n holderArray = arr.filter(removeFalseVar);\n\n return holderArray;\n}", "function filterNot(a,p){\n\tvar filteredElement = a.filter(isEven);\n\treturn filteredElement; //should return the array [1, 3, 5, 7, 9]\n}", "function myFilter(list, fn) {\n let filtered = [];\n for (let i = 0; i < list.length; i++) {\n if (fn(list[i])) {\n filtered.push(list[i])\n }\n }\n return filtered;\n}", "function myFilter(array, func) {\n var results = [];\n var i;\n for (i = 0; i < array.length; i++) {\n if (func(array[i])) {\n results.push(array[i]);\n }\n };\n\n return results;\n}", "function filterFunction() {\n \n}", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\n else\n return result\n }\n }\n}", "function bouncer(arr) {\n // use filter function to extract all values other than false\n return arr.filter(Boolean);\n}", "function func5(){\n return ages.filter(checkAdult);\n}", "function myFilter(array, callback){\n var arr = []\n array.forEach(element=>{\n if(callback(element)){\n arr.push(element);\n } \n });\n return arr;\n}", "function evenNumbers(arr) {\n const result = arr.filter(function(num) {\n if (num % 2 == 0) {\n return num;\n }});\n return result;\n}", "function myFilter(array, callback) {\n var newArray = [];\n array.forEach(element => {\n if (callback(element)) {\n newArray.push(element);\n }\n });\n return newArray;\n}", "function myFilter(arr,callback){\n var myfilter=[]\n for(var i=0;i<arr.length;i++){\n if (callback(arr[i])){\n myfilter.push(arr[i]);\n }\n }\n return myfilter;\n}", "function prime(){\r\n \r\n\r\nnumArray = numArray.filter((number) => {\r\n for (var i = 2; i <= Math.sqrt(number); i++) {\r\n if (number % i === 0) return false;\r\n }\r\n return true;\r\n\r\n\r\n});\r\n\r\nconsole.log(numArray);\r\n }", "function filterPassing(array) {\n return array.filter(function (filtered) {\n return filtered.passed === true;\n });\n}", "filter(predicate = this._compare) {\n return this._list.getValue().filter((_) => predicate(_));\n }", "function filter(lambda,array) {\n var newArray = new Array()\n for(var i = 0; i < array.length; i++) {\n if(lambda(array[i])) newArray.push(array[i])\n }\n return newArray\n}", "function filter(an_array, a_function) {\n return a_function(an_array);\n }", "function filterValidator(arr, store = []) {\n result = [];\n store.forEach((e) => {\n if (arr.includes(e)) {\n result.push(true);\n } else {\n result.push(false);\n }\n });\n\n let res = result.every((e) => e == true);\n if (res === true) {\n return store;\n } else {\n return store.filter((e, i) => result[i] === true);\n }\n }", "function myFilter(array, callback){\n let newArray = []\n for(let i=0; i<array.length; i++){\n let bool = callback(array[i])\n //put a condition, if true,\n if(bool){\n newArray.push(array[i])\n }\n //then push the item into the array\n\n\n }\n return newArray\n}", "filter() {\n\t}", "filter() {\n\t}", "function filterArray(arr, callback) {\r\n const copyArr = [];\r\n for (let item of arr) {\r\n copyArr.push(item);\r\n }\r\n executeforEach(copyArr, callback);\r\n const filteredArr = [];\r\n for (let i = 0; i < copyArr.length; i++) {\r\n if (copyArr[i] === true) {\r\n filteredArr.push(arr[i]);\r\n }\r\n }\r\n return filteredArr;\r\n}", "filter(predicate, thisArg = undefined) {\n const ret = new Arr();\n let i = 0;\n for (let p in this)\n if (predicate.call(thisArg, this[p], i++, this))\n ret.push(this[p]);\n return ret;\n }", "function findOdd(A) {\n //happy coding!\n A.filter()\n return 0;\n}" ]
[ "0.728264", "0.71547383", "0.71156996", "0.71049404", "0.70489216", "0.704323", "0.7006432", "0.69838524", "0.6922213", "0.6892954", "0.68747336", "0.6810381", "0.67904097", "0.6789595", "0.6787079", "0.6778886", "0.67781246", "0.67709213", "0.67709213", "0.67709213", "0.67709213", "0.67709213", "0.6754009", "0.6731175", "0.6661269", "0.66417307", "0.6618495", "0.6607778", "0.6595356", "0.65902317", "0.65649563", "0.65567523", "0.6541539", "0.65388525", "0.6496219", "0.6458331", "0.6458062", "0.645627", "0.64489675", "0.64450884", "0.64419174", "0.6441239", "0.64000124", "0.6394743", "0.63843", "0.63821405", "0.6364498", "0.6359725", "0.63512653", "0.63349277", "0.63245517", "0.63095427", "0.6301871", "0.62972796", "0.62884486", "0.628516", "0.6284469", "0.627563", "0.6271223", "0.6254518", "0.6242721", "0.6236088", "0.6233534", "0.62195855", "0.62032944", "0.61745715", "0.61743975", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61605257", "0.61572146", "0.61513907", "0.6142864", "0.61236924", "0.612172", "0.60908735", "0.6078942", "0.6076599", "0.6068656", "0.60649604", "0.60541713", "0.6046563", "0.604483", "0.60440123", "0.6033805", "0.60318434", "0.6024502", "0.60203075", "0.60202044", "0.601038", "0.60014045", "0.60014045", "0.59986585", "0.5995116", "0.5977048" ]
0.0
-1
what part of the shield
rayintersect(i, maxi) { let a = this.bearing1 + (i / maxi) * this.fov; let x = this.playerpos.x + Math.cos(a); let y = this.playerpos.y + Math.sin(a); //console.log(x,y) return new Point(x, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shield() {\n\t\n}", "function drawShield(x, y){\n if (shield == 1) {\n graphics.drawImage(redshield, x, y, 50, 50);\n } else if (shield == 2) {\n graphics.drawImage(greenshield, x, y, 50, 50);\n }\n }", "get info() {\n if (this.sick) {\n return 'not feeling well :(';\n } else {\n return 'grrrr....';\n }\n }", "function playerShieldRecover() {\n player.shieldColor = player.shieldHealthyColor;\n}", "function Awake()\n{\n\tplayer = GameObject.FindWithTag (\"Player\");\n\t//pyramid = GameObject.FindWithTag (\"Pyramid\");\n\tdaemonHealth = transform.parent.GetComponent.<Health>();\n}", "function viewShieldBattle(e){\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar $target = $(e.target).closest(\".rating\");\n\n\t\t\t\tif(animating){\n\t\t\t\t\tclearInterval(timelineInterval);\n\n\t\t\t\t\tanimating = false;\n\t\t\t\t}\n\n\t\t\t\tvar shields = $target.attr(\"shields\").split(\",\");\n\n\n\t\t\t\tpokeSelectors[0].setShields(shields[1]);\n\t\t\t\tpokeSelectors[1].setShields(shields[0]);\n\n\t\t\t\tstartBattle();\n\t\t\t}", "function getPurpose() {\n //Roll d20 for the purpose of this dungeon\n let d20 = roll('d20');\n //Now go through all the options\n if (d20 <= 1) return \"Death trap\";\n else if (d20 <= 5) return \"Lair\";\n else if (d20 <= 6) return \"Maze\";\n else if (d20 <= 9) return \"Mine\";\n else if (d20 <= 10) return \"Planar Gate\";\n else if (d20 <= 14) return \"Stronghold\";\n else if (d20 <= 17) return \"Temple or Shrine\";\n else if (d20 <= 19) return \"Tomb\";\n else return \"Treasure Vault\";\n}", "@action damageShields(damage, type) {\n return this.damageAttribute('currentShields', damage, type, 'shields')\n }", "function updateShieldDisplay() {\n\t// Update the shield label\n\tvar tempRef = document.getElementById('currentShield');\n\ttempRef.innerHTML = parseInt(displayedShield + 0.5);\n\n\t// Update the shield width\n\tshieldBoxCurrent.style.width = displayedShield / maxShield * 100 + '%';\n\n\t// Update the shield color\n var temp = parseInt(255.5 * displayedShield / maxShield);\n\tshieldBoxCurrent.style.background = '#00' + padHex(temp.toString(16)) + 'FF';\n}", "get stealChance() {\n return (this.Dexterity + this.Intelligence + this.Luck)/2\n }", "get effectiveDR() {\n let dr = this.DR\n\n if (this._isShotgun && this._shotgunRofMultiplier > 1) {\n dr = dr * this.shotgunDamageMultiplier\n }\n\n if (this._useArmorDivisor && !!this._armorDivisor) {\n // -1 divisor means \"Ignore DR\"\n let armorDivisor = this.effectiveArmorDivisor\n if (armorDivisor === -1) return 0\n if (armorDivisor < 1 && dr === 0) return 1\n\n return Math.floor(dr / armorDivisor)\n }\n return dr\n }", "function raiseShield(level)\n{\n player.imgElement.classList.add(\"shielded\");\n player.shielded = true;\n\n shieldCooldown = 100*level;\n weaponCooldown = 150*level;\n}", "isBust(){\n return (this.calculateHand() > 21);\n }", "function Start () {\n\t\tsuper();\n\t\ttype = UnitType.Researcher; // set unit type\n\t\tmanager = gameObject.FindGameObjectWithTag(\"MainCamera\").GetComponent(\"UnitManager\"); // find Unit Manager\n\t\tupgradeManager = GameObject.Find(\"Database\").GetComponent(UpgradeManager);\n\t\tif (heldUpgrade != UpgradeID.None) // if holding an upgrade, get the appropriate icon\n\t\t\theldUpgradeIcon = manager.GetUpgradeIcon(heldUpgrade - 1);\n\t}", "function dwaccess() {\r\n if (!items.moonpearl) {\r\n\t\treturn false;\r\n } if (items.glove == 2 || (items.glove && items.hammer)) {\r\n\t\treturn true;\r\n\t} return items.agahnim && items.hookshot && (items.hammer || items.glove || items.flippers);\r\n}", "aboutVehicle() {\n console.log(`${type}, ${this.manufacturer}, ${this.numWheels}`)\n }", "if(m_bOverTopArmor) {\n\t\t\t\tif (GetSP()->sp_bUsePEHealth) {\n\t\t\t\t\tif (((CPlayer &)*epass.penOther).m_fArmor==300) {\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\tif (((CPlayer &)*epass.penOther).m_fArmor==200) {\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}", "function evaluateEquipmentEfficiency(equipName) {\n var equip = equipmentList[equipName];\n var gameResource = equip.Equip ? game.equipment[equipName] : game.buildings[equipName];\n if (equipName == 'Shield') {\n if (gameResource.blockNow) {\n equip.Stat = 'block';\n } else {\n equip.Stat = 'health';\n }\n }\n var Eff = Effect(gameResource, equip);\n var Cos = Cost(gameResource, equip);\n var Res = Eff / Cos;\n var Status = 'white';\n var Wall = false;\n\n //white - Upgrade is not available\n //yellow - Upgrade is not affordable\n //orange - Upgrade is affordable, but will lower stats\n //red - Yes, do it now!\n if (!game.upgrades[equip.Upgrade].locked) {\n //Evaluating upgrade!\n var CanAfford = canAffordTwoLevel(game.upgrades[equip.Upgrade]);\n if (equip.Equip) {\n var NextEff = PrestigeValue(equip.Upgrade);\n //Scientist 3 and 4 challenge: set metalcost to Infinity so it can buy equipment levels without waiting for prestige. (fake the impossible science cost)\n //also Fake set the next cost to infinity so it doesn't wait for prestiges if you have both options disabled.\n if ((game.global.challengeActive == \"Scientist\" && getScientistLevel() > 2) || ((!getPageSetting('BuyArmorUpgrades') && !getPageSetting('BuyWeaponUpgrades'))))\n var NextCost = Infinity;\n else\n var NextCost = Math.ceil(getNextPrestigeCost(equip.Upgrade) * Math.pow(1 - game.portal.Artisanistry.modifier, game.portal.Artisanistry.level));\n Wall = (NextEff / NextCost > Res);\n }\n\n if (!CanAfford) {\n Status = 'yellow';\n } else {\n if (!equip.Equip) {\n //Gymystic is always cool, fuck shield - lol\n Status = 'red';\n } else {\n var CurrEff = gameResource.level * Eff;\n\n var NeedLevel = Math.ceil(CurrEff / NextEff);\n var Ratio = gameResource.cost[equip.Resource][1];\n\n var NeedResource = NextCost * (Math.pow(Ratio, NeedLevel) - 1) / (Ratio - 1);\n\n if (game.resources[equip.Resource].owned > NeedResource) {\n Status = 'red';\n } else {\n Status = 'orange';\n }\n }\n }\n }\n //what this means:\n //wall (don't buy any more equipment, buy prestige first) is true if the limit equipment option is on and we are past our limit \n //res = 0 sets the efficiency to 0 so that it will be disregarded. if not, efficiency will still be somenumber that is cheaper, \n // and the algorithm will get stuck on whatever equipment we have capped, and not buy other equipment.\n if (game.jobs[mapresourcetojob[equip.Resource]].locked){\n //cap any equips that we haven't unlocked metal for (new/fresh game/level1/no helium code)\n Res = 0;\n Wall = true; \n }\n if (gameResource.level > 10 - gameResource.prestige && getPageSetting('LimitEquipment')) {\n Res = 0;\n Wall = true;\n }\n if (gameResource.level >= 10 && getPageSetting('CapEquip')) {\n Res = 0;\n Wall = true;\n }\n if (game.global.world >= 58 && game.global.world < 60 && getPageSetting('WaitTill60')){\n Wall = true;\n }\n if (gameResource.level < 2 && equip.Stat == 'health' && getPageSetting('AlwaysArmorLvl2')){\n Res = 9999 - gameResource.prestige;\n }\n //manage prestige\n if (hiderwindow > 20 && game.global.world != 200 && equip.Stat == 'attack' && gameResource.level > 1) {\n Wall = true;\n }\n if (10*Cos > NextCost && equip.Stat == 'attack' && game.global.world > 37 && hiderwindow > 3) {\n Wall = true;\n }\n if ((gameResource.prestige < ((game.global.world-10)/5)+2 && gameResource.level > 2) && (equip.Stat == 'attack') && game.global.world > 37 && hiderwindow > 3) {\t\t\n Res = 0;\n Wall = true;\n }\n if (gameResource.prestige+1 < ((game.global.world-10)/5)+2 && gameResource.level > 0 && game.global.world > 37 && hiderwindow > 3) {\t\t\n Res = 0;\n Wall = true;\n }\n if (gameResource.level > 11 && game.global.world != 200 && game.global.world > 37 && (game.global.world < 200 || ( game.global.world > 200 && (4 * Cos) > game.resources.metal.owned))) {\t\t\n Res = 0;\n Wall = true;\n }\n\n return {\n Stat: equip.Stat,\n Factor: Res,\n Status: Status,\n Wall: Wall\n };\n}", "function get_player_hand(Player) {\n return Player.player_hand;\n}", "drive () {\n console.log(this.brand + ' drive around.');\n }", "function getClientInfo() {\n var description = {\n deviceModel: Detectizr.device.model,\n deviceType: Detectizr.device.type,\n browser: Detectizr.browser.name,\n screenWidth: window.innerWidth,\n screenHeight: window.innerHeight,\n //infra\n websockets: Modernizr.websockets,\n //sensors\n touchevents: Modernizr.touchevents,\n deviceorientation: Modernizr.deviceorientation,\n devicemotion: Modernizr.devicemotion,\n //actuators\n video: Modernizr.video,\n fullscreen: Modernizr.fullscreen,\n audio: Modernizr.audio,\n vibration: Modernizr.vibrate\n };\n\n return description;\n}", "function getDescription(){\n\t\tvar str = \"Draw Tool\";\n\n\t\treturn str;\n\t}", "function getWeaponDmgBonus() {\r\n\tif(equippedWpn == true) {\r\n\t\tfor(var i = 0; i < itemStorageArray.length; i++) {\r\n\t\t\tif(equippedWpnArr[0] == itemStorageArray[i].code) {\r\n\t\t\t\tweaponDmgBonus = itemStorageArray[i].effect;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tweaponDmgBonus = 0;\r\n\t}\r\n}", "getCheermoteDisplayInfo(name, bits, format) {\n name = name.toLowerCase();\n const { background, state, scale } = format;\n const tiers = this._data[name].tiers;\n const correctTier = tiers.sort((a, b) => b.min_bits - a.min_bits).find(tier => tier.min_bits <= bits);\n if (!correctTier) {\n throw new HellFreezesOverError(`Cheermote \"${name}\" does not have an applicable tier for ${bits} bits`);\n }\n return {\n // @ts-expect-error TS7015 TODO will be fixed with the removal of enums\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment\n url: correctTier.images[background][state][scale],\n color: correctTier.color\n };\n }", "getCylinder() {\n return this.getByte(1);\n }", "attack() {\n\t\treturn this.strength;\n\t}", "function GetPartName ()\n{\n\tvar DeviceName = GetProjectPartName ();\n\tTargetInterface.message (\"## get part name of \" + DeviceName);\n\n\tvar PART = \"\";\n\n\tif (TargetInterface.implementation () != \"j-link\")\n\t{\n\t\tif (TargetInterface.getProjectProperty (\"Target\").indexOf (\"_cm4\") != -1)\n\t\t{\n\t\t\tRelease_11xx_M4 ();\t// Enable the M4 Core\n\t\t\tTargetInterface.setDebugInterfaceProperty (\"set_adiv5_AHB_ap_num\", 1);\n\t\t}\n\t}\n\n\tif (TargetInterface.getProjectProperty (\"Target\").indexOf (\"MIMXRT11\") != -1)\n\t{\n\t\t// Read the chip silicon version\n\t\tvar MISC_DIFPROG = 0x40C84800\n\t\tvar ChipID = TargetInterface.peekUint32 (MISC_DIFPROG); // ANADIG_MISC-->MISC_DIFPROG (Chip Silicon Version Register)\n\t\tChipID &= 0x00FFFF00;\n\t\tChipID >>= 8;\n\t\tTargetInterface.message (\"#### Device detected: MIMXRT\" + ChipID.toString(16));\n/*\t\tPART = \"MIMXRT\" + ChipID.toString(16); */\n\t}\n\n\tTargetInterface.message (\"## get part name of \" + DeviceName + \" done\");\n\n\treturn PART;\n}", "damage() {}", "get physicalResist() {\n return this.Constitution + this.armorRating;\n }", "attack(warrior){\n if(warrior instanceof Elf){\n let dodge = Math.random();\n if(dodge > warrior.dodgingChance){\n warrior.hp -= this.strength;\n }\n }else{\n warrior.hp -= this.strength;\n }\n }", "function getStat(isPhysical, isOffensive) {\n\tif(isPhysical) {\n\t\tif(isOffensive) {\n\t\t\treturn 'at';\n\t\t} else {\n\t\t\treturn 'df';\n\t\t}\n\t} else {\n\t\tif(isOffensive) {\n\t\t\treturn 'sa';\n\t\t} else {\n\t\t\treturn 'sd';\n\t\t}\n\t}\n}", "getMaternalHealthSelected() {\n switch (this.#tabSelected) {\n case \"overview\":\n return this.overview.maternalHealthSelected;\n case \"health\":\n return this.health.maternalHealthSelected;\n case \"broadband\":\n return this.broadband.maternalHealthFilterSelected;\n default:\n console.error(\"something wrong\")\n break;\n }\n }", "function getHuman() {\n //Roll for a class\n let npcClass = getClass();\n //Roll for the npc alignment\n let npcAlignment = getAlignment();\n //Return the results\n return npcAlignment + \" \" + npcClass + \"(s)\";\n}", "renderOriginShield(originShieldEnabled, originShieldRegion) {\n if (!originShieldEnabled) {\n return { enabled: false };\n }\n return originShieldRegion ? { enabled: true, originShieldRegion } : undefined;\n }", "cylinder() {\n const context = GameState.current;\n\n Helper.strewnSprite(\n Helper.getMember(GroupPool.cylinder().members),\n { y: context.game.stage.height },\n { y: 10 }\n );\n }", "get hud() {\n return canvas.hud.drawing;\n }", "function priv_info() {\n var retv = \"<div style=\\\"font-size:12px\\\">\";\n retv += \"<table border=\\\"1\\\">\";\n retv += \"<tr><th>Privilege</th><th>Description</th></tr>\";\n retv += \"<tr><td>+ $12</td><td>Immediately add 12 ducats to your\";\n retv += \" bank account.</td></tr>\";\n retv += \"<tr><td>+5 B</td><td>Increase the Brewmaster point value\";\n retv += \" by five.</td></tr>\";\n retv += \"<tr><td>+1 per barrel</td><td>At the end of the game, each\";\n retv += \" barrel is worth one more point.</td></tr>\";\n retv += \"<tr><td>+1 per resource</td><td>Select a resource\";\n retv += \" Count the number of hexes on your board of that color.\";\n retv += \" Increase your resource points for that color by that\";\n retv += \" number.</td></tr>\";\n retv += \"<tr><td>+1 per scoring disk</td><td>Select one resource and\";\n retv += \" increase that resource's points by the number of scoring\";\n retv += \" disks on your board.</td></tr>\";\n retv += \"</table>\";\n retv += \"</div>\";\n gameDialog.message(retv, \"Privilege Information\");\n }", "get meleRange () { throw \"Game system not supported\"; }", "get magicResist() {\n return this.Spirit + this.magicArmorRating;\n }", "function beetle_lvl4() {}", "function pfSleightOfHand(){\n\tthis.inheritFrom = pfSkill;\n this.inheritFrom();\n this.setName(\"sleight_of_hand\");\n this.stat\t\t\t= \"dex\";\n this.armorPenalty \t= true;\n this.requireTrain\t= true;\n}", "get Emissive() {}", "function checkTiltAndLight() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * TiltAndLight.read();\n\n //devicelog(false,voltage);\n\n if (voltage > tiltThreshold){\n MedCanisterState.tilted = true;\n return \"Tilted\";\n }\n else{\n MedCanisterState.tilted = false;\n if (voltage < lidOpenLightThreshold){\n MedCanisterState.lidopen = true;\n return \"Opened\";\n }\n else{\n MedCanisterState.lidopen = false;\n return \"Closed\";\n }\n\n }\n}", "function Start()\r\n{\r\n\tlm = GameObject.Find(\"LevelManager(Clone)\");\r\n\tchapter = lm.GetComponent(LevelManager).GetChapSelect();\r\n\tlevels = lm.GetComponent(LevelManager).GetLevelLength(chapter);\t\r\n\t//bonus = lm.GetComponent(LevelManager).GetBonus(chapter);\r\n}", "describe() {\n return `${this.name} has ${this.health} health points, ${this\n .strength} as strength and ${this.xp} XP points`;\n }", "get qualify() {\n return this.ability >= 20 ? true : false;\n }", "function createShield() {\n console.log('Spawning shield...');\n\n // NOTE: source - http://www.clipartlord.com/wp-content/uploads/2016/04/aestroid.png\n var shieldDivStr = \"<div id='a-\" + shieldIdx + \"' class='shield'></div>\"\n console.log(shieldDivStr)\n // Add the lollipop to the screen\n gwhGame.append(shieldDivStr);\n // Create and candy handle based on newest index\n var curShield = $('#a-'+shieldIdx);\n\n shieldIdx++; // update the index to maintain uniqueness next time\n\n curShield.append(\"<img src='img/shield.png'/>\")\n\n // Pick a random starting position within the game window\n var startingPosition = Math.random() * (gwhGame.width()-50); // Using 50px as the size of the candy (since no instance exists yet)\n\n // Set the instance-specific properties\n curShield.css('left', startingPosition+\"px\");\n\n // Make the candys fall towards the bottom\n setInterval( function() {\n curShield.css('top', parseInt(curShield.css('top'))+candy_SPEED);\n // Check to see if the candy has left the game window\n if (parseInt(curShield.css('top')) > (gwhGame.height() - curShield.height())) {\n curShield.remove();\n }\n }, OBJECT_REFRESH_RATE);\n}", "get skillChance() {\n return (this.Dexterity + this.Intelligence + this.Luck)/2;\n }", "attack() {\n return 'attacks with ' + this.weapon;\n }", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "function HMDVRDevice() {\n}", "canUseWeapon(w)\n {\n // if eqWeap == -1 then this.weapons[eqWeap] -> undefined\n let r = true;\n if (w === undefined)\n return false\n else if (this.hasSkill(\"noncombatant\"))\n r = false;\n else if (w !== null && w.pref !== null && this.name != w.pref)\n r = false;\n return r;\n }", "function checkEquipped() {\n patt2 = /stone shield/g;\npatt3 = /parlathan/g;\npatt4 = /stone sword/g;\npatt5 = /joyeuse/g;\npatt6 = /plate armor/g;\npatt7 = /chainmail/g;\npatt8 = /old magic staff/g;\npatt9 = /stealth boots/g;\npatt10 = /magic robes/g;\npatt11 = /bow/g;\npatt12 = /dagger/g;\npatt13 = /wooden crossbow/g;\npatt14 = /worn stone shield/g; \n\nif(patt3.test(equippedW) || patt4.test(equippedW) || patt5.test(equippedW)) {\n sR = true;\n strikeAttack = true;\n} \nif (patt11.test(equippedW) || patt13.test(equippedW)) {\n lR = true;\n strikeAttack = true;\n} \nif (patt12.test(equippedW)) {\n daggerAttack = true;\n} \nif (patt8.test(equippedM)) {\n magicStaff = true;\n}\nif (patt2.test(equippedA) || patt14.test(equippedA)) {\n shield = true;\n}\n\nif(lR) {\n checklr = /shoot/g;\n checklr2 = /strike/g;\nif (checklr.test(allAttacks) === false) {\n allAttacks.push(\"shoot\");\n }\n if (checklr2.test(allAttacks) === false) {\n allAttacks.push(\"strike\");\n }\n}\nif (sR) {\n checksr = /strike/g;\nif (checksr.test(allAttacks) === false) {\n allAttacks.push(\"strike\");\n }\n}\nif (daggerAttack) {\n checkda = /stab/g;\nif (checkda.test(allAttacks) === false) {\n allAttacks.push(\"stab\");\n }\n}\nif (shield) {\n checks = /bash/g;\nif (checks.test(allAttacks) === false) {\n allAttacks.push(\"bash\");\n }\n}\nif (magicStaff) {\n checkms = /fire ball/g;\n checkms2 = /wind blast/g;\n checkms3 = /earth ball/g;\n \n if (checkms.test(allAttacks) === false) {\n allAttacks.push(\"fire ball\");\n }\n if (checkms2.test(allAttacks) === false) {\n allAttacks.push(\"wind blast\");\n }\n if (checkms3.test(allAttacks) === false) {\n allAttacks.push(\"earth ball\");\n }\n}\n\n}", "function battle(victimStrength, attackerStrength){\nif (victim.strength === attacker.strength) {\n console.log(\"Dead\");\n}\nelse if (victim.strength < attacker.strength) {\n console.log(\"Also dead\");\n}\nelse {\n console.log(\"Alive\");\n}\n}", "get Overdraw() {}", "constructor(name, health){//name and health will be varied\n\t\t\tthis.name = name;//the name is whatever the user chooses\n\t\t\tthis.maxHealth = health;//this will allow the character health to be restored if needed to it's max\n\t\t\tthis.currentHealth = health;//this health depeds\n\t\t\tthis.isIncapacitated = false;\n\t\t\tthis.barriers = {//basic statistics for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 10,\n\t\t\t\tsneak: 10,\n\t\t\t\tpersuade: 10\n\t\t\t};\n\t\t\tthis.skills ={//basic skill stats for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 0,\n\t\t\t\tsneak: 0,\n\t\t\t\tpersuade: 0\n\t\t\t};\n\t\t}", "whichProfile() {\n\t\tthis.profile = 'particle';\n\t\tthis.readProfileData();\n\t}", "getSynergy(){\n return 0.25 + 0.75 * (this.getActivePlayingPlayers().length / 11) ** 2;\n }", "function HMDVRDevice() {\n\t}", "function Start () {\n\n\tFindClosestEnemy();\n\ttransform.position.z = 0;\n\tif(this.gameObject.name == \"illuminaty_turret(Clone)\") {\n\tfireRate = 2;\n\t}\n\tif (this.gameObject.name == \"green_turret(Clone)\") {\n\tfireRate = 1;\n\t}\n\tif (this.gameObject.name == \"FlameThrower(Clone)\") {\n\tfireRate = 0.1;\n\t}\n\tif (this.gameObject.name == \"Ice_turret(Clone)\") {\n\tfireRate = 4;\n\ticeRate = 0.2;\n\t}\n\t\n\t//laser = GetComponent.<AudioClip>();\n}", "function getHeirloomIcon(heirloom) {\n\tif (typeof heirloom.name === 'undefined') return \"<span class='icomoon icon-sad3'></span>\";\n\tif (heirloom.rarity == 6) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s21.postimg.org/4imgb9nqv/Transparent_Armor_6.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s16.postimg.org/a1m5f2gqd/Transparent_Legs_6.png\"';\n\t}\n\tif (heirloom.rarity == 5) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s21.postimg.org/m7anwg63b/Transparent_Armor_5.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s12.postimg.org/96714wb5p/Transparent_Legs_5.png\"';\n\t}\n\tif (heirloom.rarity == 4) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s9.postimg.org/p3lns1qjj/Transparent_Armor_4.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s12.postimg.org/f6ply8bwd/Transparent_Legs_4.png\"';\n\t}\n\tif (heirloom.rarity == 3) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s10.postimg.org/c2pquh94p/Transparent_Armor_3.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s11.postimg.org/roo3t7v7n/Transparent_Legs_3.png\"';\n\t}\n\tif (heirloom.rarity == 2) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s18.postimg.org/jprvnxg15/Transparent_Armor_2.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s16.postimg.org/fupq997qd/Transparent_Legs_2.png\"';\n\t}\n\tif (heirloom.rarity == 1) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s21.postimg.org/iouuqjc8n/Transparent_Armor_1.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s10.postimg.org/nxsok6djt/Transparent_Legs_1.png\"';\n\t}\n\tif (heirloom.rarity == 0) {\n\tvar icon = (heirloom.type == \"Shield\") ? 'id=\"Shield\"><img style=\"max-height: 100%;\" src=\"https://s14.postimg.org/dcw0kj0ep/Transparent_Armor_0.png\"' : 'id=\"Staff\"><img style=\"max-height: 100%;\" src=\"https://s18.postimg.org/lh7kxanbd/Transparent_Legs_0.png\"';\n\t}\n\treturn icon;\n}", "getAbilities() {\n var rAbilities = [].concat(this.inherentAbilities).concat(this.acquiredAbilities);\n\n for (var i = 0; i < this.attachedCards.length; i++) {\n var tool = this.attachedCards[i];\n rAbilities = rAbilities.concat(tool.inherentAbilities);\n }\n\n var sAbilities = [];\n if (this.isSuppressed()) {\n for (var j = 0 ; j < rAbilities.length; j++) {\n if (!rAbilities[j].isMagic) {\n sAbilities.push(rAbilities[j]);\n }\n }\n return sAbilities;\n } else {\n return rAbilities;\n }\n }", "block() {\n if (this.type == \"sword\") {\n this.angle = 0;\n this.player.blocking = true;\n this.damage = 0;\n this.setTexture(\"shield\");\n }\n }", "function Start () {\n\n\tnukeUsed = false;\n\tisLightArmor = true;\n\t\n\tif(GameObject.Find(\"LevelEight\")){\n\tisLevel8 = true;\n\t}\n\telse{\n\tisLevel8 = false;\n\t}\n\t\n\t\n\n}", "function getDynamicOccupancyDisclaimerInfo() {\n if (props.roomInfo.currPhase !== '') {\n return \"Phase \" + props.roomInfo.currPhase + \" \";\n }\n return props.roomInfo.currPercentOccupancyGuideline + \"% occupancy \";\n }", "function get_player_strength(Player) {\n return Player.player_strength;\n}", "function printRole() {\n for (i=0; i<devs.length; i++){\n let name = devs[i].name;\n let tech = devs[i].tech_stack;\n console.log(`${name} specializes is ${tech}.`);\n }\n }", "isFriendly (unit) { return this.controller.isFriendly(unit.controller )}", "get TexturedWire() {}", "baseAmount() {return player.g.power}", "function getWpnDmg() {\r\n\tvar wpn = equippedWpnArr[0]; //player wpn\r\n\tvar wpnDmg = 0;\r\n\tfor(var i = 0; i < itemStorageArray.length; i++) {\r\n\t\tif(wpn == itemStorageArray[i].code) {\r\n\t\t\twpnDmg = itemStorageArray[i].effect;\r\n\t\t\tif(wpnDmg == \"1-2\") {\r\n\t\t\t\twpnDmg = randomIntFromInterval(1, 2);\r\n\t\t\t}\r\n\t\t\telse if(wpnDmg == \"2-4\") {\r\n\t\t\t\twpnDmg = randomIntFromInterval(2, 4);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn wpnDmg;\r\n}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "get info() {\n if (this.quantity < 2) {\n return 'This wheat is almost gone!'\n } else if (this.quantity < 3) {\n return 'This wheat is running low'\n } else {\n return 'This is some nice wheat'\n }\n }", "function drawPowerup() {\n //console.log(powerupX, powerupY);\n graphics.drawImage(greenshield, powerupX, powerupY, 60, 60);\n }", "SideComponent()\n {\n return this.m_pPlayer.Side().dot(this.m_vSteeringForce) * this.m_pPlayer.MaxTurnRate();\n }", "SideComponent()\n {\n return this.m_pPlayer.Side().dot(this.m_vSteeringForce) * this.m_pPlayer.MaxTurnRate();\n }", "function showWormInfo(currentWorm)\r\n{\r\n\talert(\t\"color: \"+currentWorm.color+\r\n\t\t\t\"\\nx: \"+currentWorm.x+\r\n\t\t\t\"\\ny: \"+currentWorm.y+\r\n\t\t\t\"\\nangle: \"+currentWorm.angle+\r\n\t\t\t\"\\nalive: \"+currentWorm.alive+\r\n\t\t\t\"\\nplaying: \"+currentWorm.playing+\r\n\t\t\t\"\\nscore: \"+currentWorm.score+\r\n\t\t\t\"\\nlength: \"+currentWorm.length);\t\t\r\n}", "function nombre_hardware(nombre_pieza) {\n var other_paremeters = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n other_paremeters[_i - 1] = arguments[_i];\n }\n return \"Description of components: \" + nombre_pieza + \" \" + other_paremeters.join(\" \");\n}", "function getState( ess) {\n if( ess.Standby === \"OffAvailable\" || ess.Standby === \"true\")\n return \"standby\"\n else if( typeof ess.Charging == \"boolean\")\n return ess.Charging ? \"charging\" : \"discharging\";\n else if( typeof ess.Charging.indexOf === 'function' && ess.Charging.indexOf(\"-\") >= 0) // has minus sign, so it's charging\n return \"charging\"\n else\n return \"discharging\"\n\n }", "function beetle_lvl5() {}", "function cylinder() {\n\n}", "function getMotorPerm() {\n\t return motor_perm\n}", "function runShieldBearer(){\n\n// redraw the gameWindow\nupdate();\ndraw();\n\n}", "function info_shield (axis_list){\n\n// var wait_id = 'wait_dialog_id_' + core.util.randomness(10);\n// var html_string = 'Creating dialog...';\n// var wait_text = '<div id=\"' + wait_id + '\">' + html_string + '</div>';\n\n// jQuery(\"body\").append(jQuery(wait_text)); \n// jQuery(\"#\" + wait_id ).dialog({\n// \tbgiframe: true,\n// \tautoOpen: false,\n// \theight: 300,\n// \twidth: 500,\n// \tmodal: true,\n// \tclose: function(){\n// \t}\n// });\n// jQuery('#' + wait_id).dialog('open');\n\n\n widgets.start_wait(\"Processing...\");\n \n //\n cart.reset_map();\n\n // Generate shield HTML.\n // Create the shield\n var shield_html = info_html(axis_list);\n new org.bbop.amigo.ui.shield.set(shield_html);\n cart.bind('cart-bindable');\n\n widgets.finish_wait();\n\n //jQuery('#' + wait_id).dialog('close');\n}", "function getPipe(){\n\treturn jQuery('.nes-screen')[0].getContext('2d').getImageData(0,40,214,1).data;\n}", "getName() {\n let name = this.getDeviceName(); // SHRGBW2#1234#1\n let ip = this.getIP(); // 192.168.11.1\n let deviceid = this.getDeviceId(); // shellyplug-s-12345\n let id = this.getId(); // shellyplug-s-12345\n return ip + ' (' + deviceid + ' / ' + id + ' / ' + name + ')';\n }", "hasAvatar() {\n return true;\n //return this.humanoid && this.mesh;\n }", "function check() {\n if ((wind - point) === 0) {\n return 'Offshore';\n } else if (\n (range[0] === 0) && (range[1] === 180) ||\n (range[0] === 180) && (range[1] === 0) ||\n (range[0] === 90) && (range[1] === 270) ||\n (range[0] === 270) && (range[1] === 90) ||\n (range[0] === 45) && (range[1] === 225) ||\n (range[0] === 225) && (range[1] === 45) ||\n (range[0] === 135) && (range[1] === 315) ||\n (range[0] === 315) && (range[1] === 135)) {\n return 'Onshore';\n } else {\n return 'Crosswind';\n }\n }", "function larryFight(h, d) {}", "coolantFloodOn() {\n this.sendMessage('command', this.options.port, 'gcode', 'M8');\n }", "function clue(who, where, weapon) {\n console.log('The murder was committed by ' + who + ' in the ' + where + ' with the ' + weapon + '.');\n}", "function createElectricityRequirement(){\n return 4 + Math.ceil(Math.random()*16); //uniform between 5 and 20 units\n}", "useItem() {\n let horse = allUnlockables['layer0']['unlockable0'];\n if (horse['found']){\n alert(`You used: ${this.name}!`);\n this.found = false;\n horse.unlocked = true;\n } else {\n alert(`Cannot use ${this.name}!`)\n }\n }", "function onRead( diy, ois ) {\n\tif( diy.version >= 5){\n\t\tportraits[0] = ois.readObject();\n\t\tportraits[1] = ois.readObject();\n\t}\n\tif( diy.version < 2 ) {\n\t\t$EnergyLimit = '-';\n\t\tdiy.version = 2;\n\t}\n\tif( diy.version < 4 ) {\n\t\treplacementText = '';\n\t\tif( $$LockRequired.yesNo && $$SecondaryWeapon.yesNo ) {\n\t\t\treplacementText = '<attack-lock> ';\n\t\t} else if( $$FocusRequired.yesNo && $$SecondaryWeapon.yesNo ) {\n\t\t\treplacementText = '<attack-focus> ';\n\t\t} else if( $$EnergyRequired.yesNo && $$SecondaryWeapon.yesNo ) {\n\t\t\treplacementText = '<attack-energy> ';\n\t\t} else if( $$SecondaryWeapon.yesNo ) {\n\t\t\treplacementText = '<attacks> ';\n\t\t} else if( $$Action.yesNo ) {\n\t\t\treplacementText = '<action> ';\n\t\t} else if( $$Energy.yesNo ) {\n\t\t\treplacementText = '<energy> ';\n\t\t}\t\t\n\t\t$Text = replacementText + $Text;\n\t\tdiy.version = 4;\n\t}\n\tif( diy.version < 5 ) {\n\t\t$Dual = 'no';\t\n\t\t$SubName = '';\t\n\t\t$DualSubName = '';\n\t\t$DualEnergyLimit = '-';\n\t\t$DualSecondaryWeapon = 'no';\n\t\t$DualAttackValue = '0';\n\t\t$DualRange = '1';\n\t\t$DualText = '';\n\t\t\n\t\toldPortrait = diy.getPortrait(0);\n\n\t\tdiy.portraitKey = null;\n\t\tdiy.customPortraitHandling = true;\n\n\t\t// Front Side Card Art\n\t\tportraits[0] = new DefaultPortrait( diy, 'upgrade-front' );\n\t\tportraits[0].setScaleUsesMinimum( false );\n\t\tportraits[0].facesToUpdate = [0];\n\t\tportraits[0].backgroundFilled = true;\n\t\tportraits[0].clipping = true;\n\t\tportraits[0].installDefault();\n\n\t\tportraits[0].setSource( oldPortrait.getSource() );\n\t\tportraits[0].setPanX( oldPortrait.getPanX() );\n\t\tportraits[0].setPanY( oldPortrait.getPanY() );\n\t\tportraits[0].setScale( oldPortrait.getScale() );\n\n\t\t// Back Side Card Art\n\t\tportraits[1] = new DefaultPortrait( diy, 'upgrade-back' );\n\t\tportraits[1].setScaleUsesMinimum( false );\n\t\tportraits[1].facesToUpdate = [1];\n\t\tportraits[1].backgroundFilled = true;\n\t\tportraits[1].clipping = true;\n\t\tportraits[1].installDefault();\n\n\t\tdiy.version = 5;\n\t}\n\tif( diy.version < 6 ) {\n\t\t$Style = 'regular';\n\t\tdiy.version = 6;\n\t}\n}", "attackWith() {\r\n const randomWeaponIndex = Math.floor(Math.random() * 8);\r\n return this.weapons[randomWeaponIndex];\r\n }" ]
[ "0.69179016", "0.5645263", "0.5541232", "0.5385604", "0.5379282", "0.5372021", "0.53716284", "0.53414696", "0.53219104", "0.5306511", "0.529019", "0.5244987", "0.52338725", "0.52242315", "0.5157053", "0.51509607", "0.51467013", "0.51407987", "0.5140209", "0.5133609", "0.5126674", "0.5125483", "0.51102245", "0.5097785", "0.5089795", "0.50875694", "0.5087098", "0.507013", "0.50657874", "0.50582546", "0.5052339", "0.50478697", "0.50457096", "0.5033971", "0.50324017", "0.5028479", "0.5011938", "0.49995837", "0.4996156", "0.49944928", "0.49889937", "0.49840292", "0.49780232", "0.49723876", "0.4970112", "0.49632087", "0.49594095", "0.49221128", "0.49156183", "0.4907876", "0.4907876", "0.4907876", "0.4907876", "0.4907876", "0.4907876", "0.4907876", "0.49078655", "0.49069765", "0.4906414", "0.49029145", "0.49010873", "0.48858264", "0.48807973", "0.48768136", "0.48702398", "0.48678276", "0.48662394", "0.48662382", "0.48652396", "0.48650318", "0.48649496", "0.48629472", "0.4857641", "0.485575", "0.48536882", "0.4851666", "0.4848759", "0.4848759", "0.48482567", "0.48465848", "0.48458827", "0.48458827", "0.48408556", "0.48391455", "0.48377755", "0.4824918", "0.48240706", "0.48235312", "0.48212507", "0.4818665", "0.48176706", "0.48149225", "0.48135072", "0.48075184", "0.48074964", "0.48073083", "0.48070395", "0.480641", "0.4806119", "0.48009723", "0.47976935" ]
0.0
-1
>>>>> Ciclo para guardar los datos ingresados
function render(leads) { let listItem = ""; for(let i = 0; i < leads.length; i++) { // console.log(myLeads[i]); // 1) == Primera forma == /* ulEl.textContent += myLeads[i]; */ /* ulEl.innerHTML += `<li>${myLeads[i]}</li>`; */ /* ulEl.style.fontSize = `20px`; */ /* ulEl.style.fontWeight = "700"; */ // 2) ===== forma de hacer / CREAR UN ELEMENTO ==== : /* const li = document.createElement(`li`); */ /* li.textContent = myLeads[i]; */ /* // == Method / element == */ /* ulEl.append(li); */ // 3 ) == extra forma == // < ==== Se llama TEMPLATE STRING = `${}` === > listItem += `<li><a href="${leads[i]}" target="_blank">${leads[i]}</a></li>`; //listItem += "<li><a target='_blank' href='" + myLeads[i] + "'>" + myLeads[i] + "</a></li>" console.log(listItem); ulEl.innerHTML = listItem; ulEl.style.fontSize = `20px`; ulEl.style.fontWeight = "700"; ulEl.style.margin = `20px 0`; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guardarDatosDetalles( id_proceso_masivo ){\n\t\t\tlet data_det = {};\n\t\t\tlet tblProcesosDetalles = sql.define({\n\t\t\t name: 'procesos_masivos_detalles',\n\t\t\t columns: [\n\t\t\t 'numero_remito',\n\t\t\t 'numero_lote',\n\t\t\t 'cantidad_actas',\n\t\t\t 'notificada',\n\t\t\t 'zona',\n\t\t\t 'id_tipo_envio',\n\t\t\t 'id_estado_envio',\n\t\t\t 'email_enviado',\n\t\t\t 'id_proceso_masivo',\n\t\t\t 'nota',\n\t\t\t 'id_proceso_masivo_detalle'\n\t\t\t ]\n\t\t\t});\n\n\t\t\tlet arr_obj_insert = [];\n\t\t\tlet arr_obj_update = [];\n\t\t\tlet arr_obj_delete = [];\n\t\t\tlet query = {};\n\t\t\tlet query_res;\n\n\t\t\tfor(var i=0; i<obj_detalle.length; i++){\n\n\t\t\t\t\t//const id_proceso_masivo = res.id_proceso_masivo;\n\n\t\t\t\t\tif(obj_detalle[i].hasOwnProperty('uid')){\n\n\t\t\t\t\t\tlet nota_texto = (obj_detalle[i].nota.texto == \"''\")?'':obj_detalle[i].nota.texto;\n\n\t\t\t\t\t\tlet colr_proc = false;\n\n\t\t\t\t\t\tif(obj_detalle[i].colr_rech){\n\t\t\t\t\t\t\tcolr_proc = -1;\n\t\t\t\t\t\t}else if(obj_detalle[i].colr_proc){\n\t\t\t\t\t\t\tcolr_proc = 1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcolr_proc = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_det = {\n\t\t\t\t\t\t\t\t'id_proceso_masivo': id_proceso_masivo,\n\t\t\t\t\t\t\t\t//'id_proceso_masivo_detalle': obj_detalle[i].id_proceso_masivo_detalle,\n\t\t\t\t\t\t\t\t'numero_remito': obj_detalle[i].remito,\n\t\t\t\t\t\t\t 'numero_lote': obj_detalle[i].lote,\n\t\t\t\t\t\t\t 'cantidad_actas': obj_detalle[i].actas,\n\t\t\t\t\t\t\t 'notificada': obj_detalle[i].notificada,\n\t\t\t\t\t\t\t 'zona': obj_detalle[i].zona,\n\t\t\t\t\t\t\t 'id_tipo_envio': obj_detalle[i].id_tipo_envio,\n\t\t\t\t\t\t\t 'id_estado_envio': colr_proc,\n\t\t\t\t\t\t\t 'email_enviado': (obj_detalle[i].colr_email)?1:0,\n\t\t\t\t\t\t\t 'nota': obj_detalle[i].nota.texto\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\tswitch (obj_detalle[i].uid){\n\n\t\t\t\t\t\t\tcase 'I': //INSERT\n\t\t\t\t\t\t\t\tarr_obj_insert.push(data_det);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'U': //UPDATE\n\t\t\t\t\t\t\t\t\tdata_det.id_proceso_masivo_detalle = obj_detalle[i].id_proceso_masivo_detalle;\n\t\t\t\t\t\t\t\t\tarr_obj_update.push(data_det);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'D': //DELETE\n\t\t\t\t\t\t\t\t\tarr_obj_delete.push({'id_proceso_masivo':id_proceso_masivo, 'id_proceso_masivo_detalle': obj_detalle[i].id_proceso_masivo_detalle});\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} // FIN FOR\n\n\t\t\t\tpg.connect(conString, function(err, client, done) {\n\t\t\t\t\t\n\t\t\t\t\tif( arr_obj_insert.length > 0){\n\t\t\t\t\t\t//console.log(arr_obj_insert)\n\t \t\t\t\t\tquery = tblProcesosDetalles.insert(arr_obj_insert).returning(tblProcesosDetalles.id_proceso_masivo).toQuery();\n\t \t\t\t\t\tquery_res = client.query(query);\n\t\t \t\t\t\tquery_res.on('row', function(row) {\n\t\t\t\t \t\tresults.push(row);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t \t\t\t\tif(arr_obj_update.length > 0){\n\n\t \t\t\t\t\tfor(var index_u=0; index_u<arr_obj_update.length; index_u++){\n\t\t\t\t\t\t\tquery = tblProcesosDetalles.update(arr_obj_update[index_u]).where(tblProcesosDetalles.id_proceso_masivo.equals(arr_obj_update[index_u].id_proceso_masivo), tblProcesosDetalles.id_proceso_masivo_detalle.equals(arr_obj_update[index_u].id_proceso_masivo_detalle)).toQuery();\n\t\t \t\t\t\t\tquery_res = client.query(query);\n\t\t\t \t\t\t\tquery_res.on('row', function(row) {\n\t\t\t\t\t \t\tresults.push(row);\n\t\t\t\t\t\t\t});\n\t\t \t\t\t\t}\n\n\t \t\t\t\t}\n\n\t \t\t\t\tif(arr_obj_delete.length > 0){\n\t \t\t\t\t\t//console.log(arr_obj_delete)\n\t \t\t\t\t\tfor(var index_d=0; index_d<arr_obj_delete.length; index_d++){\n\t \t\t\t\t\t\t\n\t\t \t\t\t\t\tquery = tblProcesosDetalles.delete(arr_obj_delete[index_u]).where(tblProcesosDetalles.id_proceso_masivo.equals(arr_obj_delete[index_d].id_proceso_masivo), tblProcesosDetalles.id_proceso_masivo_detalle.equals(arr_obj_delete[index_d].id_proceso_masivo_detalle)).toQuery()\n\t\t \t\t\t\t\tconsole.log('ASD',query)\n\t\t \t\t\t\t\tquery_res = client.query(query);\n\t\t\t \t\t\t\tquery_res.on('row', function(row) {\n\t\t\t\t\t \t\tresults.push(row);\n\t\t\t\t\t\t\t});\n\t\t \t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tif(arr_obj_insert.length > 0 || arr_obj_update.length > 0 || arr_obj_delete.length > 0){\n\t\t\t\t\t\tquery_res.on('end', function( result_query) {\t \t\n\t\t\t\t\t \t\tclient.end();\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t \t\t//return res.json(results)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t \t\t\t});\n\t\t\t\t\n\t\t\tif( id_proceso_masivo > 999999999){\n\t\t\t\tlet query_res = {};\n\t\t\t\t\n\t\t\t\t//console.log(obj_detalle.length)\n\t\t\t\tfor(var i=0; i<obj_detalle.length; i++){\n\n\t\t\t\t\t//const id_proceso_masivo = res.id_proceso_masivo;\n\n\t\t\t\t\tif(obj_detalle[i].hasOwnProperty('uid')){\n\n\t\t\t\t\t\tlet nota_texto = (obj_detalle[i].nota.texto == \"''\")?'':obj_detalle[i].nota.texto;\n\n\t\t\t\t\t\tlet colr_proc = false;\n\n\t\t\t\t\t\tif(obj_detalle[i].colr_rech){\n\t\t\t\t\t\t\tcolr_proc = -1;\n\t\t\t\t\t\t}else if(obj_detalle[i].colr_proc){\n\t\t\t\t\t\t\tcolr_proc = 1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcolr_proc = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst data_det = [\n\t\t \t\t\t\t\t\tobj_detalle[i].remito,\n\t\t \t\t\t\t\t\tobj_detalle[i].lote,\n\t\t \t\t\t\t\t\tobj_detalle[i].actas,\n\t\t \t\t\t\t\t\tobj_detalle[i].notificada,\n\t\t \t\t\t\t\t\tobj_detalle[i].zona,\n\t\t \t\t\t\t\t\tobj_detalle[i].id_tipo_envio,\n\t\t \t\t\t\t\t\tcolr_proc,\n\t\t \t\t\t\t\t\t(obj_detalle[i].colr_email)?1:0,\n\t\t \t\t\t\t\t\tid_proceso_masivo,\n\t\t \t\t\t\t\t\tobj_detalle[i].nota.texto,\n\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\tlet query_template = {\n\t\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\t\ttext: 'INSERT INTO procesos_masivos_detalles (numero_remito, numero_lote, cantidad_actas, notificada, zona, id_tipo_envio, id_estado_envio, email_enviado, id_proceso_masivo, nota) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id_proceso_masivo_detalle;',\n\t\t\t\t\t\t\t\tvalues: data_det,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tupdate: {\n\t\t\t\t\t\t\t\ttext: 'UPDATE procesos_masivos_detalles SET numero_remito=($1), numero_lote=($2), cantidad_actas=($3), notificada=($4), zona=($5), id_tipo_envio=($6), id_estado_envio=($7), email_enviado=($8), id_proceso_masivo=($9), nota=($10) WHERE id_proceso_masivo = $9 and id_proceso_masivo_detalle = $11',\n\t\t\t\t\t\t\t \tvalues: data_det,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdelete:{\n\t\t\t\t\t\t\t\ttext: 'DELETE FROM procesos_masivos_detalles WHERE id_proceso_masivo = $1 and id_proceso_masivo_detalle = $2',\n\t\t\t\t\t\t\t \tvalues: [id_proceso_masivo, obj_detalle[i].id_proceso_masivo_detalle],\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconsole.log(obj_detalle[i].uid)\n\t\t\t\t\t\tlet query = '';\n\n\t\t\t\t\t\tswitch (obj_detalle[i].uid){\n\n\t\t\t\t\t\t\tcase 'I': //INSERT\n\t\t\t\t\t\t\t\tquery = query_template.insert;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'U': //UPDATE\n\t\t\t\t\t\t\t\t\tdata_det.push(obj_detalle[i].id_proceso_masivo_detalle);\n\t\t\t\t\t\t\t\t\tquery = query_template.update;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'D': //DELETE\n\t\t\t\t\t\t\t\t\tquery = query_template.delete;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tpg.connect(conString, function(err, client, done) {\n\t\t\t\t\t\t\t\t//console.log('322>',query)\n\t\t\t\t \t\t\t\tquery_res = client.query(query);\n\t\t\t\t \t\t\t\tquery_res.on('row', function(row) {\n\t\t\t\t\t\t \t\tresults.push(row);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tquery_res.on('end', function( result_query) {\t \t\n\t\t\t\t\t\t\t \t\tclient.end();\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t \t\t//return res.json(results)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t \t\t\t});\n\t\t\t\t\t};\n\n\t\t\t\t}; //FIN FOR\n\t\t\t}\n\t\t}", "function guardarFormData() {\n this.datos;\n this.fmodificado;\n this.usrid;\n this.casid;\n}", "function guardar(){\n\n\tif(validateFields()){\n\t\tvar publicacion = new Publicacion(getValue('nombreID'), getValue('contactoID'), \n\t\tgetValue('estadoID'), getValue('ciudadID'), \n\t\tgetValue('shortDesc'), getValue('longDesc'));\n\n\t\tvar item = Object.assign({}, publicacion);\n\t\tdb.collection(COL_ORG).add(item).then(\n\t\tdata => {\n\t\t\talert('Guardado');\n\t\t\tconsole.log(\"Datos guardados exitosamente!!!\", data);\n\t\t\twindow.close();\n\t\t},\n\t\terror => {\n\t\t\talert('Error');\n\t\t\tconsole.error(\"Ocurrio un error al guardar los datos!!!\", error);\n\t\t});\n\t}else{\n\t\talert('Error: llena todos los campos.');\n\t}\n\n\n\t\n}", "materializar() {\n\t\t// Se pueden agregar comprobaciones para evitar que haya campos en blanco cuando se guarda.\n\t\tthis.guardarObjetoEnArchivo();\n\t}", "function guardarObjetos(){\n if(clases() != null){\n grupoEstadoTerminado = clases().filter(objetoActual => objetoActual.estado === \"terminada\");\n let objetoJson1 = JSON.stringify(grupoEstadoTerminado);\n fs.writeFileSync(\"terminada.json\",objetoJson1);\n \n grupoEstadoRepasar = clases().filter(objetoActual => objetoActual.estado === \"repasar\");\n let objetoJson2 = JSON.stringify(grupoEstadoRepasar);\n fs.writeFileSync(\"repasar.json\",objetoJson2);\n \n grupoEstadoPendiente = clases().filter(objetoActual =>objetoActual.estado === \"pendiente\");\n let objetoJson3 = JSON.stringify(grupoEstadoPendiente);\n fs.writeFileSync(\"pendiente.json\",objetoJson3);\n\n\n\n console.log(grupoEstadoTerminado);\n console.log(grupoEstadoRepasar);\n console.log(grupoEstadoPendiente);\n }\n else{\n console.log(\"el archivo JSON no se encontro\")\n }\n}", "function guardarPedidosEnLS() {\n localStorage.setItem(\"pedidos\", JSON.stringify(pedidosPorMesa));\n leerPedidosDeLS();\n}", "function guardarFilas() {\n // Obtengo las filas\n var filas_anteriores = armarFilasParaGuardar();\n\n $.ajax({\n type: 'POST',\n url: 'guardar-filas-anteriores',\n data:\n {\n 'articulos': filas_anteriores,\n 'local_id': $('#ingresar-mercaderia').data('local-id'),\n '_token': $('input[name=\"_token\"]').val()\n }\n });\n }", "function GuardarBocadillosPagina(){\n var Bocadillos;\n var PaginaID;\n var CuentoID;\n\n $('.actual').each(function () {\n var id = $(this)[0].id.split('_')[1];\n Bocadillos = getBocadillos(id);\n console.log(Bocadillos);\n\n PaginaID= parseInt($(this)[0].id.split('_')[1]);\n CuentoID= parseInt(CuentoActual.ID.split('_')[1]);\n\n });\n\n db.transaction(InsertBocadillos, errorinsertBocadillos, successinsertBocadillos);\n\n\n function InsertBocadillos(tx) {\n for(var i = 0; i < Bocadillos.length; i++) {\n var sql = \"INSERT OR REPLACE INTO `Bocadillos`(`ID`, `Posx`, `Posy`, `Zoom`, `Angulo`, `ID_Paginas`, `ID_Tipo`, `ID_Cuento`)\";\n sql += \" VALUES (\"+Bocadillos[i].id+\",\"+Bocadillos[i].x+\",\"+Bocadillos[i].y+\",\"+Bocadillos[i].zoom+\",\"+Bocadillos[i].angulo+\",\"+PaginaID+\",\"+Bocadillos[i].tipo+\",\"+CuentoID+\")\";\n tx.executeSql(sql);\n }\n }\n\n function errorinsertBocadillos(tx, err) {\n alert(\"Error en guardar Bocadillos processing SQL: \"+err);\n }\n\n function successinsertBocadillos() {\n }\n}", "guardarDB (){\n const payload ={\n historial: this.historial\n };\n\n fs.writeFileSync(this.dbPath, JSON.stringify(payload));\n\n }", "guardarDB() {\n fs.writeFileSync(this.dbPath, JSON.stringify(this.historial));\n }", "function guardarDatosLocalStorage(){\n //toma el valor de un arreglo con datos de LS o vacio\n localStorage.setItem('respuestasM', JSON.stringify(respuestaMotorcycle)); // todas las motos quedan almacenadas en local storage// todas las motos quedan almacenadas en local storage\n}", "function cargaDatos(){\n\tdb.transaction(cargaRegistros, errorDB);\n}", "function GuardarObjectPagina(){\n var Objetos;\n var PaginaID;\n var CuentoID;\n\t\n $('.actual').each(function () {\n var id = $(this)[0].id.split('_')[1];\n Objetos = getObjetos(id);\n \n PaginaID= parseInt($(this)[0].id.split('_')[1]);\n CuentoID= parseInt(CuentoActual.ID.split('_')[1]);\n\n });\n\n db.transaction(InsertObject, errorinsertObject, successinsertObject);\n\n function InsertObject(tx) {\n for(var i = 0; i < Objetos.length; i++) {\n var sql = \"INSERT OR REPLACE INTO `Objetos`(`ID`, `Posx`, `Posy`, `Zoom`, `Angulo`, `ID_Paginas`, `ID_Tipo`, `ID_Cuento`)\";\n sql += \" VALUES (\"+Objetos[i].id+\",\"+Objetos[i].x+\",\"+Objetos[i].y+\",\"+Objetos[i].zoom+\",\"+Objetos[i].angulo+\",\"+PaginaID+\",\"+Objetos[i].tipo+\",\"+CuentoID+\")\";\n tx.executeSql(sql);\n }\n }\n\n function errorinsertObject(tx, err) {\n alert(\"Error al guardar objeto de pagina: \"+err);\n }\n\n function successinsertObject() {\n \t//alert(\"Guardo el Objeto bien\");\n }\n\n\n}", "function guardarBusqueda(busqueda){\n localStorage.setItem(\"busqueda\", busqueda);\n}", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "function guardar() {\r\n var nombre = ventana.document.getElementById(\"txtnom\").value;\r\n var apellidos = ventana.document.getElementById(\"txtape\").value;\r\n var foto = ventana.document.getElementById(\"txtfoto\").value;\r\n var funciones = ventana.document.getElementById(\"txtfunc\").value;\r\n var telefono = ventana.document.getElementById(\"txttel\").value;\r\n\r\n crearNuevoSocio(nombre, apellidos, foto, funciones, telefono);\r\n ventana.close();\r\n}", "function guardarDatosLocalStorage(){\n //toma el valor de un arreglo con datos de LS o vacio\n localStorage.setItem('respuestasH', JSON.stringify(respuestaHelmet)); // todas las motos quedan almacenadas en local storage// todas las motos quedan almacenadas en local storage\n}", "function guardarDatos() {\n data.firstName = firstName.value;\n data.secondName = secondName.value;\n data.firstSurname = firstSurname.value;\n data.secondSurname = secondSurname.value;\n data.age = age.value;\n data.email = email.value;\n data.contactNumber = contactNumber.value;\n data.img = previewImage.src;\n\n localStorage.setItem(\"data\", JSON.stringify(data));\n}", "function guardarCambios() {\r\n let datos = {};\r\n datos.nombre = document.getElementById(\"name\").value;\r\n datos.apellido = document.getElementById(\"lastName\").value;\r\n datos.edad = document.getElementById(\"age\").value;\r\n datos.email = document.getElementById(\"email\").value;\r\n datos.telefono = document.getElementById(\"telephone\").value;\r\n console.log(datos);\r\n localStorage.setItem(\"perfil\", JSON.stringify(datos));\r\n}", "function guardarFromForm(data) {\n var flagError = false;\n var msgErrorParametros = 'Parámetros no validos';\n\n if (data.title === undefined || data.title === '') {\n flagError = true;\n }\n\n if (data.price === undefined || data.price === '') {\n flagError = true;\n }\n\n if (isNaN(parseFloat(data.price))) {\n flagError = true;\n }\n\n if (data.thumbnail === undefined || data.thumbnail === '') {\n flagError = true;\n }\n\n if (flagError) {\n return 400;\n } else {\n _data.lastID.lastID = _data.lastID.lastID + 1; // Se incrementa el lastID por que se va a guarda un nuevo valor.\n\n var objProducto = new _producto[\"default\"](data.title, data.price, data.thumbnail, _data.lastID.lastID);\n\n _data.productos.push(objProducto);\n\n _data.dbIDs.push(_data.lastID.lastID);\n\n return 200;\n }\n} //Funcion que se encarga de guardar los mensajes en tanto en la variable dinámica como en el archivo", "function guardar(req, res) {\n // declaramos una variable para contener la inscripcion\n let inscripcion = new Inscripcion()\n // requerimos del body cada parte del json y lo guardamos \n inscripcion.nombre_invitado = req.body.nombre_invitado\n inscripcion.email_invitado = req.body.email_invitado\n inscripcion.empresa_invitado = req.body.empresa_invitado\n inscripcion.cargo_invitado = req.body.cargo_invitado\n inscripcion.evento = req.body.idevento\n\n\n inscripcion.save((err, Inscripcionguardada) => {\n // enviamos un error si no se guarda\n if (err) return res.status(500).send(`Error de base de datos ${err}`)\n // efectuamos el guardado \n res.status(200).send({ InscripcionRegistrada: Inscripcionguardada })\n })\n}", "function guardar(elemento) {\n if (elemento == 'datos') {\n localStorage.setItem(elemento, JSON.stringify(datos));\n console.log('elemento datos fue guardado en setItem');\n }\n if (elemento == 'tarifas') {\n localStorage.setItem(elemento, JSON.stringify(tarifas));\n console.log('elemento datos fue guardado en setItem');\n }\n}", "function guardarOrdenes(){\r\n localStorage.setItem(\"Ordenes\", JSON.stringify(ordenes));\r\n return;\r\n}", "function guardar()\n {\n var _token = $('input[name=_token]').val();\n var id_empleado= $('#id_empleado').val();\n var nombres= $('#txt_nombres').val();\n var apellido1= $('#txt_apellido1').val();\n var apellido2= $('#txt_apellido2').val();\n var cedula= $('#txt_cedula').val();\n var direccion= $('#txt_direccion').val();\n var departamento= $('#cmb_Departamento').val();\n var telefono_1= $('#txt_telefono_1').val();\n var telefono_2= $('#txt_telefono_2').val();\n var nomb_notifica= $('#txt_nomb_notifica').val();\n var estado_civil= $('#cmb_estado_civil').val();\n var telefono_not= $('#txt_telefono_not').val();\n var edad= $('#txt_edad').val();\n var correo= $('#txt_correo').val();\n var sexo= $('#cmb_sexo').val();\n\n if (apellido2!=\"\")\n apellido2:apellido2.trim().toUpperCase()\n\n if (correo!=\"\" && edad!=\"\" && estado_civil!=\"\" && nombres!=\"\" && apellido1!=\"\" && cedula!=\"\" && sexo!=\"\"&& direccion!=\"\" && departamento!=\"\" && telefono_1!=\"\" && nomb_notifica!=\"\" && telefono_not!=\"\")\n {\n alertConfirm(\"¿Está seguro que desea guardar?\", function (e) {\n showLoad(true);\n $.ajax({\n type: 'POST',\n url: '/vendedor/guardar', //llamada a la ruta\n data: {\n _token:_token,\n id_empleado:id_empleado,\n nombres:nombres.trim().toUpperCase(),\n apellido1:apellido1.trim().toUpperCase(),\n apellido2:apellido2,\n cedula:cedula.toUpperCase(),\n direccion:direccion.trim(),\n departamento:departamento,\n telefono_1:telefono_1,\n telefono_2:telefono_2,\n nomb_notifica:nomb_notifica.trim().toUpperCase(),\n estado_civil:estado_civil,\n telefono_not:telefono_not,\n edad:edad,\n correo:correo.trim(),\n sexo:sexo.trim()\n },\n success: function (data) {\n showLoad(false);\n if (data.error) {\n alertError(data.mensaje);\n return;\n }\n else\n {\n resetForm();\n alertSuccess(data.mensaje);\n tblVendedores.ajax.reload();\n }\n },\n error: function (err) {\n alertError(err.responseText);\n showLoad(false);\n }\n\n });\n });\n\n }\n else\n alertError(\"Favor completar todos los campos\");\n\n }", "function guardar() {\n //si valida form regresa un falso nos salimos\n if (!ValidaForm())\n return;\n debugger;\n var formData = new FormData();\n var totalFiles = document.getElementById(\"FileUpload\").files.length;\n for (var i = 0; i < totalFiles; i++) {\n var file = document.getElementById(\"FileUpload\").files[i];\n\n formData.append(\"FileUpload\", file);\n }\n\n var item = new Evento();\n\n item.EventoId = 0; //Se pone 0 ya que al ser nuevo no tiene id\n item.Titulo = $('#txtTitulo').val();\n item.Imagen = '/rutadeprueba/.jpg';\n item.FechaEvento = $('#dpFechaEvento').val();\n item.Direccion = $('#txtDireccion').val();\n item.Establecimiento = $('#txtEstablecimiento').val();\n item.PrecioRegular = $('#txtPrecio').val();\n item.Promocion = $('#txtPromocion').val();\n item.Preventa = $('#txtPreventa').val();\n item.EventoTipo = { EventoTipoId : $('#cmbEventoTipo').val() };\n item.Ciudad = { CiudadId: $('#cmbCiudad').val() };\n item.Latitud = mapaLatitud;\n item.Longitud = mapaLongitud;\n item.LinkEventoFacebook = $('#txtLinkEventoFacebook').val();\n item.linkComprarBoleto = $('#txtLinkComprarBoleto').val();\n item.Estatus = true;\n item.Perfil = {PerfilId: PerfilId}\n\n var bandas = $('#txtTagBanda').textext()[0].tags()._formData;\n\n $.each(bandas, function (ind, elem) {\n item.lPerfil.push({ Nombre: elem });\n });\n\n var tags = $('#txtTagTag').textext()[0].tags()._formData;\n\n $.each(tags, function (ind, elem) {\n item.lTag.push({ Nombre: elem });\n });\n\n //limpiar tags http://cgit.drupalcode.org/block_class_tags/tree/jquery-textext/js/textext.plugin.clear.js?id=b4ef68e97ee57c27f34937bf37017449a9f852c6\n $('#txtTagTag').val('');\n\n $('#txtTagBanda').val('');\n\n //link video por eventos\n var group = $('input[name=\"mytext[]\"]');\n\n if (group.length > 0) {\n group.each(function () {\n //var nombre = $(this).val(); //$(this).attr(\"name\", $(this).attr(\"name\") + \"[]\");\n item.lEventoVideo.push({ UrlVideo: $(this).val() })\n });\n }\n\n\n\n formData.append(\"evento\", JSON.stringify(item));\n\n $.ajax({\n url: urlGuardarEvento,\n type: 'post',\n cache: false,\n contentType: false,\n processData: false,\n data: formData,\n success: function (Data) {\n //$('#lblModifica').text(\"registro modificado\");\n //showSuccess(Data);\n //$(location).attr('href', urlListado);\n showSuccess(Data.Mensaje);\n limpiar();\n },\n error: function (data) {\n //showErrorMessage(data);\n },\n complete: function () {\n //showSuccess(data);\n }\n })\n\n}", "function guardarProductosFiltrados(datos) {\n //Utilizamos un objeto con el mismo formato que maneja la API (.data) para los productos, para que la funcion que genera el listado de productos no nos devuelva error\n productosFiltrados = { data: Array(), error: \"\" };\n //Nos posicionamos dentro de la clave data de los productos que recibimos desde la API\n const losProductos = datos.data;\n let textoIngresado = $(\"#txtFiltroProductos\").val();\n if (datos && losProductos.length > 0) {\n for (let i = 0; i < losProductos.length; i++) {\n let unProducto = losProductos[i];\n let prodX = new Producto(unProducto._id, unProducto.codigo, unProducto.nombre, unProducto.precio, unProducto.urlImagen, unProducto.estado, unProducto.etiquetas);\n //Guardamos y pusheamos todos los productos filtrados que nos mande la API en la variable global productosFiltrados\n productosFiltrados.data.push(prodX);\n }\n }\n if (textoIngresado != \"\") {\n textoIngresado = textoIngresado.toLowerCase();\n for (let i = 0; i < productos.length; i++) {\n let unProd = productos[i];\n let lasEtiquetas = unProd.etiquetas;\n let x = 0;\n let encontrado = false;\n while (!encontrado && x < lasEtiquetas.length) {\n let etiquetaX = lasEtiquetas[x];\n //Verificamos que el texto ingresado por el usuario sea subcadena de una etiqueta de un objeto\n if (etiquetaX.includes(textoIngresado)) {\n let j = 0;\n let existeElProdFiltrado = false;\n while (!existeElProdFiltrado && j < productosFiltrados.data.length) {\n let unProdFiltrado = productosFiltrados.data[j];\n if (unProd.nombre == unProdFiltrado.nombre) {\n existeElProdFiltrado = true;\n }\n j++;\n }\n if (!existeElProdFiltrado) {\n productosFiltrados.data.push(unProd);\n }\n }\n x++;\n }\n }\n }\n //Llamamos a la funcion de Crear listado de productos, y le pasamos el Objeto con los productos filtrados\n crearListadoProductos(productosFiltrados);\n}", "function insertAnuncio(anuncio) {\n\n // Calcula novo Id a partir do último código existente no array para novo cadastro. Se edição, retorna valor salvo\n if (edicao != 1) {\n novoId = (dados.livros.length)+1;\n }\n else {\n novoId = idAtual;\n }\n \n // Organiza os dados na forma do registro\n let novoAnuncio = {\n \"user_id\": usuario_logado,\n \"id\": novoId,\n \"fotAn\": anuncio.fotAn,\n \"titAn\": anuncio.titAn,\n \"descAn\": anuncio.descAn,\n \"locAn\": anuncio.locAn,\n \"contAn\": anuncio.contAn\n };\n\n // Insere o novo objeto no array para novos cadastros, ou atualiza em caso de edição\n if (edicao != 1) {\n dados.livros.push(novoAnuncio);\n displayMessage(\"Anuncio inserido com sucesso!\");\n }\n else {\n dados.livros[novoId-1] = novoAnuncio;\n displayMessage(\"Anuncio atualizado com sucesso!\");\n }\n\n // Atualiza os dados no Local Storage\n localStorage.setItem('dados', JSON.stringify(dados));\n\n // Altera \"edicao\" para diferente de 1, considerando que a próxima tarefa seja novo cadastro\n edicao = 0;\n}", "function guardarExpediente()\n{\n\tvar idExp=$(\"input#idExpe\").val();\n\tvar idCita=$(\"select#idCita\").val();\n\tvar diagnostico=$(\"textarea#diagnostico\").val();\n\tvar receta=$(\"textarea#receta\").val();\n\tvar indicaciones=$(\"textarea#indicaciones\").val();\n\tvar fecha=$(\"input#fecha\").val();\n\t\n\tobjetoExpediente = {Id_Expediente:idExp,Id_Cita:idCita,Diagnostico:diagnostico, Receta:receta, Indicaciones:indicaciones, Fecha:fecha};\n\tif(idExp == 0){\n\t\t//insertar Medicamento:\n\t\taccion = \"insertar\";\n\t}else{\n\t\t//Actualizar Medicamento:\n\t\taccion = \"actualizar\";\n\t}\n\tpeticionJSON = JSON.stringify(\n\t\t\t{\n\t\t\t\t\"Id\": generarID(),\n\t\t\t\t\"method\":accion,\n\t\t\t\t\"clase\": CLASE_EXPEDIENTES,\n\t\t\t\t\"Params\":[objetoExpediente]\n\t\t\t});\n\t$.post(GATEWAY_EXPEDIENTES, peticionJSON, exitoGuardadoExpediente);\n}", "function guardarDetalles(){\r\n if(detallesOrden.length > 0){\r\n sessionStorage.setItem(\"DetallesOrden\",JSON.stringify(detallesOrden));\r\n }\r\n return;\r\n}", "function guardarDatos() {\n let datosFormulario = document.getElementsByTagName(\"input\");\n console.log(datosFormulario);\n let nombre,correo,pwd,sexo;\n nombre = datosFormulario[0].value; \n localStorage.setItem(\"Nombre\", nombre);\n correo = datosFormulario[1].value; \n localStorage.setItem(\"Correo\", correo);\n pwd = datosFormulario[2].value; \n localStorage.setItem(\"Pwd\",pwd)\n if (datosFormulario[3].checked) {\n sexo = \"Masculino\";\n } else {\n sexo = \"Femenino\";\n } \n localStorage.setItem(\"Sexo\",sexo);\n if (datosFormulario[6].checked) {\n localStorage.setItem(\"Deporte\",\"Si\");\n } else {\n localStorage.setItem(\"Deporte\",\"No\");\n } \n if (datosFormulario[7].checked) {\n localStorage.setItem(\"Programacion\",\"Si\");\n } else {\n localStorage.setItem(\"Programacion\",\"No\");\n } \n if (datosFormulario[8].checked) {\n localStorage.setItem(\"Lectura\",\"Si\");\n } else {\n localStorage.setItem(\"Lectura\",\"No\");\n }\n}", "function insertdata() {\n getData.getAllData().then(function() {});\n }", "function GuardarPersonajesPagina(){\n var Personajes;\n var PaginaID;\n var CuentoID;\n\n $('.actual').each(function () {\n var id = $(this)[0].id.split('_')[1];\n Personajes = getPersonajes(id);\n\n PaginaID= parseInt($(this)[0].id.split('_')[1]);\n CuentoID= parseInt(CuentoActual.ID.split('_')[1]);\n\n });\n\n db.transaction(InsertPersonajes, errorinsertPersonajes, successinsertPersonajes);\n\n\n function InsertPersonajes(tx) {\n for(var i = 0; i < Personajes.length; i++) {\n var sql = \"INSERT OR REPLACE INTO `Personajes`(`ID`, `Posx`, `Posy`, `Zoom`, `Angulo`, `ID_Paginas`, `ID_Tipo`, `ID_Cuento`)\";\n sql += \" VALUES (\"+Personajes[i].id+\",\"+Personajes[i].x+\",\"+Personajes[i].y+\",\"+Personajes[i].zoom+\",\"+Personajes[i].angulo+\",\"+PaginaID+\",\"+Personajes[i].tipo+\",\"+CuentoID+\")\";\n tx.executeSql(sql);\n }\n }\n\n function errorinsertPersonajes(tx, err) {\n alert(\"Error en guardar personaje processing SQL: \"+err);\n }\n\n function successinsertPersonajes() {\n }\n}", "function guardarMT(){\n var jsonData = []; //[1]\n jsonData.push(estados);\n jsonData.push(transiciones);\n jsonData = JSON.stringify(jsonData);\n\n if ( APIcompatible() ) { //[2]\n //[2.1]\n var data = new Blob([jsonData], {\n type: 'application/json'\n });\n var reader = new FileReader();\n reader.onload = function(event) {\n //configuración del archivo\n var save = document.createElement('a');\n save.href = event.target.result;\n save.target = '_blank';\n save.download = 'archivo.json';\n\n //evento que llama a la ventana del explorador de archivos\n var clickEvent = new MouseEvent('click', {\n 'view': window,\n 'bubbles': true,\n 'cancelable': true\n });\n save.dispatchEvent(clickEvent);\n (window.URL || window.webkitURL).revokeObjectURL(save.href);\n };\n reader.readAsDataURL(data);\n } else {\n mostrarAlert('API de guardado no compatible para este navegador.'); //[3]\n }\n }", "saveData() {\n if (this.s.unavailable()) {\n return;\n }\n\n for (const val of this.dispField.items) {\n this.s.set(val, this.dispField.checked(val));\n }\n\n this.s.set(\"unit\", this.unitField.get());\n this.s.set(\"format\", this.formatField.get());\n this.s.set(\"sort\", this.sortableField.toArray());\n }", "function guardar(){\n\t//valoracion de los imput\n\tvar nombre = document.getElementById('clave').value;\n\tvar comentario =document.getElementById('valor').value;\n\tlocalStorage.setItem(nombre,comentario);\n\n\tvar comentarioG = document.getElementById('textSave');\n\tfor (var i = 0; i < localStorage.length; i++) {\n\n\t\tvar name = localStorage.key(i);\n\t\tvar clave = localStorage.getItem(name);\n\n\t\tvar div = document.createElement('div');\n\t\tdiv.setAttribute(\"id\", \"content\");\n\n\t\tvar h4 = document.createElement('h4');\n\t\tvar nombre = document.createTextNode(name);\n\t\t\n\n\t\tvar p = document.createElement('p');\n\t\tvar comentarios = document.createTextNode(clave);\n\n\t\th4.appendChild(nombre);\n\t\tp.appendChild(comentarios);\n\t\tdiv.appendChild(h4);\n\t\tdiv.appendChild(p);\n\n\t\tcomentarioG.appendChild(div);\t\t\n\t}\n\t\tdocument.getElementById('clave').value = \"\";\n\t\tdocument.getElementById('valor').value=\"\";\n}", "data2db() {\n\t\tlet tables = ['modules', 'terms']\n\t\treturn this.db.transaction('rw', this.db.tables, () => {\n\t\t\treturn Promise.all(tables.map(t => \n\t\t\t\tthis.db.table(t).clear().then(()=>\n\t\t\t\t\tthis.db.table(t).bulkAdd(this.data[t]))))\n\t\t})\n\t}", "function GuardarFondoPagina(){\n\n var Pagina;\n\n $('.actual').each(function () {\n var id = $(this)[0].id.split('_')[1];\n Pagina = {ID:parseInt($(this)[0].id.split('_')[1]),CuentoID:parseInt(CuentoActual.ID.split('_')[1]), Fondo:parseInt(getFondo($(this)[0].id).split('_')[1])};\n });\n\n db.transaction(InsertFondo,errorinsertFondo, successinsertFondo);\n\n var sql = \"INSERT OR REPLACE INTO `Fondos`(`ID_Cuento`, `ID_Paginas`, `Tipo_Fondo`)\";\n sql += \" VALUES (\" + Pagina.CuentoID + \",\" + Pagina.ID + \",\" + Pagina.Fondo + \") \";\n \n function InsertFondo(tx) {\n tx.executeSql(sql);\n }\n\n function errorinsertFondo(tx, err) {\n alert(\"Error al guardar fondo: \"+err);\n }\n\n function successinsertFondo() {\n }\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "function saveData() {\n localStorage.setItem(\"datos\", JSON.stringify({\n nombre: document.querySelector(nombre).value,\n run: document.querySelector(run).value,\n edad: document.querySelector(edad).value,\n region: document.querySelector(region).value,\n // Al ser Javascript plano lenemos que usar en Index en duro, algun framework ($) y un campo bien referenciables seria mas lindo.\n regionId :document.querySelector(region).selectedOptions[0].attributes[\"data-id\"].value,\n comuna: document.querySelector(comuna).value,\n comunaId: document.querySelector(comuna).selectedOptions[0].attributes[\"data-id\"].value,\n domicilio: document.querySelector(domicilio).value,\n email: document.querySelector(email).value,\n }));\n}", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "function guardarCusoLocalStorage(curso){\n let cursos;\n cursos = obtenerCursosLocalStorage();\n\n cursos.push(curso)\n localStorage.setItem('cursos', JSON.stringify(cursos))\n}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "validateData(){\n this.hasSavedValues = false\n\n this.publicoAlvoSim > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n\n this.XER > 0 ? this.hasSavedValues = true : null\n this.COP > 0 ? this.hasSavedValues = true : null\n\n this.listaPrefixos.length > 0 ? this.hasSavedValues = true : null\n\n this.operacaoNaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculadaEmOutroNPJ > 0 ? this.hasSavedValues = true : null\n\n this.acordoRegPortalSim > 0 ? this.hasSavedValues = true : null\n this.acordoRegPortalNao > 0 ? this.hasSavedValues = true : null\n //this.acordoRegPortalDuplicados > 0 ? this.hasSavedValues = true : null\n\n this.estoqueNumber > 0 ? this.hasSavedValues = true : null\n this.fluxoNumber > 0 ? this.hasSavedValues = true : null\n \n this.duplicadoSimNao > 0 ? this.hasSavedValues = true : null\n this.analisadoSimNao > 0 ? this.hasSavedValues = true : null\n }", "save() {\n\t\treturn this.db2data().then(()=>AppData.saveCollection(this.path, this.data))\n\t}", "saveAllData(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n localStorage.setItem(CYCLING_TM, JSON.stringify(this.timestampData)) \n }", "function guardarCursoLocalStorage(curso) {\n let cursos;\n //Toma el valor de un arreglo con datos de localSTorage o vacio\n cursos = obtenerCursosLocalStorage();\n //El curso seleccionado se agrega al arreglo\n cursos.push(curso);\n\n localStorage.setItem('cursos', JSON.stringify(cursos));\n}", "function guardarCursoLocalStorage(curso){\n let cursos;\n // toma el valor de un arreglo con dato o vacio en ls\n cursos = obtenerCursosLocalStorage();\n\n cursos.push(curso); //el curso seleccionado se agrega al arreglo\n \n localStorage.setItem('cursos', JSON.stringify(cursos));\n}", "save() {\n let columns = Object.keys(this.data);\n let sql;\n // build sql string\n if (this.data[this.primaryKey]) {\n sql = Squel.update().table(this.table);\n } else {\n sql = Squel.insert().into(this.table);\n }\n\n columns.map( (column) => {\n // ignore primary key column\n if (column != this.primaryKey) {\n let value = this.data[column];\n sql.set(column, value);\n }\n });\n\n // update mode: set where condition\n if (this.data[this.primaryKey])\n sql.where(`${this.primaryKey} = ${this.data[this.primaryKey]}`);\n\n // execute sql\n sql = sql.toString();\n\n return new Promise( (resolve, reject) => {\n getSQLiteDB(this.table).executeSql(sql, [], (results) => {\n // update model's primaryKey on insertId\n if (results.insertId && !this.data[this.primaryKey])\n this.data[this.primaryKey] = results.insertId;\n\n resolve(true);\n });\n });\n }", "function guardarCursoLocalStorage(curso) {\n\tlet cursos;\n\t// Toma datos de LocalStorage o un array vacío\n\tcursos = obtenerCursosLocalStorage();\n\t// El curso seleccionado se agrega al array\n\tcursos.push(curso);\n\t// Almacena los cursos en LocalStorage\n\tlocalStorage.setItem('cursos', JSON.stringify(cursos));\n\treturn true;\n}", "function guardar_ejercicio(){\n\tsalvaEstado()\n\tif(no_identificado)\n\t{\n\t\tif(confirm(\"Los resultados se han guardado temporalmente.\\n\\n\"+\n\t\t\t\"Para guardar definitivamente y poder recuperarlos mas adelante debe registrarse o identificarse.\\n\\n\"+\n\t\t\t\"¿Desea registrarse ahora?\"))\n\t\t\twindow.location=\"pag420\";\n\t}\n\treturn false;\n}", "function saveData() {\n const transaction = db.transaction([\"transactions\"], \"readwrite\");\n const transactionStore = transaction.objectStore(\"transactions\");\n const allData = transactionStore.getAll();\n\n allData.onsuccess = () => {\n if (allData.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(allData.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n const transaction = db.transaction(\n [\"transactions\"],\n \"readwrite\"\n );\n const transactionStore =\n transaction.objectStore(\"transactions\");\n transactionStore.clear();\n });\n }\n };\n}", "function guardarCarritoEnLocalStorage() {\n const miLocalStorage = window.localStorage;\n miLocalStorage.setItem('carrito', JSON.stringify(carrito));\n}", "save() {}", "function saveRiga() {\n var $this = $(this);\n var isChecked;\n if($this.attr('id') === 'selezionaTuttiCespiti') {\n return;\n }\n isChecked = $this.prop('checked');\n selectedDatas[+$this.val()] = {isSelected: isChecked, data: $this.data('originalCespite')};\n }", "function insertardatos(n1,n2,n3){\n var nombre = obtener(n1);\n var contraseña = obtener(n2);//se obtienen los datos del formulariio\n var tipo = obtener(n3);\n if(nombre.length==0 || contraseña.length==0 ){\n //se verifica primero que todos los campos esten llenos\n nowuiDashboard.showNotification('top','center',\"<b>rellene todos los campos!</b>\",\"warning\");\n }else{\n //alert(nombre +\" \"+ contraseña +\" \"+ tipo);\n var obj = new Object;//se cre un objeto que representara un usuario\n obj[\"Nombre\"]= nombre;\n obj[\"pass\"]=contraseña;//con su nombre contraseña y tipo ademas de un esatdo que serviara para saber si esta logeado o no\n obj[\"tipo\"]=tipo;\n obj[\"Estado\"]=0;\n console.log(obj);//se imprimie en consola modo de pruebas no es necesario hacerlo\n \n var bd = firebase.database().ref(\"Usuarios\");//se inicia una instancia de la base de datos pero haciendo referencia a la tabla usuarios\n var id ;//se crea una variable para la id\n bd.once(\"value\",function(snap){ //se crea una consulta siempre se hace con el archivo que creaste la instancia en este caso bd\n //seguido de .once porque solo una consulta es no varias y como queremos nada mas revisar valores ponemos (\"value\", )y segudo de una funcion para tomar una captura de la instancia de la base de datos\n //por eso ponemos la palabra snap aunk puede ser cualquier palabra dentro de la funcion\n var aux = snap.val();//creamos una variable en este caso aux que tome los valores de la fotografia de los datos de la bd\n var n = 1;//creamos un contador para saber cuantos usuarios hay antes del que se ingresara\n for(var documento in aux){ //hacemos un for que por cada usuario en la fotografia se recorrera lo siguiente\n //OJO documento tomara los elementos dentro de usuarios osea solo los ID que representa\n console.log(documento+ \" \"+documento.substring(0,2));//datos de prueba en consola (opcional todos los que digan console.log)\n if(tipo==\"Limitado\"){ //aqui verificamos si es limitado o admin para contar solo los limitados o solo los admin\n id = \"LT\";//si es limitado los primeros digitos del id son LT\n if(documento.substring(0,2)==\"LT\"){//verificamos si el elemenot actual de la fotografia es un limitado osea que comienze su id con LT\n console.log(\"si\"+n);//opcional\n n++;//si el elemento actual es limitado entonces aumenta el contador de usuarios del mismo tipo que estamos insertando\n }\n }else{//------------------lo mismo pero para admin\n id = \"AD\";\n if(documento.substring(0,2)==\"AD\"){\n n++;\n }\n }\n //verificamos si dentro de la fotografia (aux) en el id que estamos viendo ahorita (documento) su parte del nombre es igual a la del elemento que vamos a insertar\n if(aux[documento].Nombre==obj[\"Nombre\"]){\n console.log((aux[documento].Nombre+\"--\"+obj[\"Nombre\"]));\n //si son iguales osea si ya hay un nombre igual al de elemento que pondremos \n nowuiDashboard.showNotification('top','center',\"<b>ESE USUARIO YA EXISTE!</b>\",\"danger\");\n return 0;//y se detendra la funcion\n }\n }\n //todo aqui abajo es para agregar una cantidad de 0 antes del n (representa el numero de usuario limitado o admin que sera el que se acaba de registrar)\n if(n>=10000){\n id+=\"0\"+n;\n }else if(n>=1000){\n id+=\"00\"+n;\n }else if(n>=100){\n id+=\"000\"+n;//si 3 digitos entonces 3 ceros y asi suscesivamente\n }\n else if(n>=10){\n id+=\"0000\"+n;//si es 2 digitos entonces 4 ceros\n }\n else{\n id+=\"00000\"+n;//si es de un digito el entonces 5 ceros antes\n }\n bd.child(id).set(obj);//se duce que en la instancia de la base de datos actual (vease linea N°34)\n //.child() crea un subdato que este sera el id que ya creamos y dentro de el se pondra (.set) el objeto que cotiene los datos del usuario\n\n /* alert(\"Registrado\");//se indica que se registro \n location.reload(true);//recargamos la pagina*/\n nowuiDashboard.showNotification('top','center',\"<b>REGISTRO EXITOSO!</b>\",\"success\");\n setTimeout(function(){location.reload()},3000);\n });\n // var bd = firebase.database().ref(\"Usuarios/\"+id);\n // bd.set(obj);\n }\n}", "function GuardarNarracionesPagina(){\n var Narraciones;\n var PaginaID;\n var CuentoID;\n\n $('.actual').each(function () {\n var id = $(this)[0].id.split('_')[1];\n Narraciones = getNarraciones(id);\n\n PaginaID= parseInt($(this)[0].id.split('_')[1]);\n CuentoID= parseInt(CuentoActual.ID.split('_')[1]);\n\n });\n\n db.transaction(InsertNarraciones, errorinsertNarraciones, successinsertNarraciones);\n\n\n function InsertNarraciones(tx) {\n for(var i = 0; i < Narraciones.length; i++) {\n var sql = \"INSERT OR REPLACE INTO `Narraciones`(`ID`, `Posx`, `Posy`, `Zoom`, `Angulo`,`Color_Texto`,`Color_Fondo`,`Texto`, `ID_Paginas`, `ID_Cuento`)\";\n sql += \" VALUES (\"+Narraciones[i].id+\",\"+Narraciones[i].x+\",\"+Narraciones[i].y+\",\"+Narraciones[i].zoom+\",\"+Narraciones[i].angulo+\",\"+-1+\",\"+-1+\",'\"+Narraciones[i].texto+\"',\"+PaginaID+\",\"+CuentoID+\")\";\n console.log(sql);\n tx.executeSql(sql);\n }\n }\n\n function errorinsertNarraciones(tx, err) {\n alert(\"Error en guardar narraciones processing SQL: \"+err);\n }\n\n function successinsertNarraciones() {\n }\n}", "function guardar() {\n console.trace(\"click guardar\");\n let id = document.getElementById(\"inputId\").value;\n let nombre = document.getElementById(\"inputNombre\").value;\n let avatar = document.getElementById(\"inputAvatar\").value;\n\n //sexo, si no esta marcado el de hombre, sera mujer\n let sexo = document.getElementById(\"sexoh\").checked ? \"h\" : \"m\";\n\n let persona = {\n id: id,\n nombre: nombre,\n avatar: avatar,\n sexo: sexo,\n };\n\n console.debug(\"persona a guardar %o\", persona);\n\n //CREAR\n if (id == 0) {\n console.trace(\"Crear nueva persona\");\n const url = endpoint + \"personas/\";\n ajax(\"POST\", url, persona)\n .then((data) => {\n alert(persona.nombre + \" ya esta con nosotros \");\n //limpiar formulario\n document.getElementById(\"inputId\").value = 0;\n document.getElementById(\"inputNombre\").value = \"\";\n document.getElementById(\"inputAvatar\").value = \"img/avatar1.png\";\n document.getElementById(\"sexoh\").checked = true;\n document.getElementById(\"sexom\").checked = false;\n\n cargarAlumnos();\n })\n .catch((error) => {\n console.warn(\"promesa rejectada %o\", error);\n alert(error.informacion);\n });\n\n // MODIFICAR\n } else {\n console.trace(\"Modificar persona\");\n\n const url = endpoint + \"personas/\" + persona.id;\n ajax(\"PUT\", url, persona)\n .then((data) => {\n alert(persona.nombre + \" modificado con exito \");\n cargarAlumnos();\n })\n .catch((error) => {\n console.warn(\"No se pudo actualizar %o\", error);\n alert(error.informacion);\n });\n }\n}", "function almacenarDatos(e) {\n let nombre = document.getElementById('nombre').value;\n let tipo = document.getElementById('tipo').value;\n let monto = document.getElementById('monto').value;\n let mes = document.getElementById('mes').value;\n\n console.log(tipo)\n //objeto para listar los datos\n let dato = {\n nombre,\n tipo,\n monto,\n mes\n };\n \n //grabar en localStorage \n if(localStorage.getItem('datos') === null) {\n let datos = [];\n datos.push(dato);\n localStorage.setItem('datos', JSON.stringify(datos));\n } else {\n let datos = JSON.parse(localStorage.getItem('datos'));\n datos.push(dato);\n localStorage.setItem('datos', JSON.stringify(datos));\n }\n \n\n IngresarDatos();\n //resetear el formulario\n document.getElementById('formulario').reset();\n e.preventDefault();\n}", "function saveToDatabase() {\n idb.add(dbKeys.stations, JSON.stringify(stationList));\n idb.add(dbKeys.lastFrequency, lastFrequency);\n }", "function guardaconteudo(id, idExpndo, idDisc, textarea, idSumario) {\n var edita = sessionStorage.getItem(\"edita\");\n \n if (edita == \"true\") {\n console.log(edita); \n query = \"UPDATE sumario SET sumario = '\" + textarea + \"' WHERE id = '\" + idSumario + \"'\"\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n texto = \"true\";\n var idSumarioaux = null;\n sessionStorage.setItem(\"idSumarioaux\", idSumarioaux);\n sessionStorage.setItem(\"idExplicando\", idExpndo);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"texto\", texto);\n verificaData(0);\n }\n });\n closeConnectionDataBase();\n } else {\n \n query = \"INSERT INTO sumario (id_explicando, id_explicador, id_disciplina, sumario, data) VALUES ('\" + idExpndo + \"', '\" + id + \"', '\" + idDisc + \"', '\" + textarea + \"', CURDATE())\";\n connectDataBase();\n connection.query(query, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n texto = \"true\";\n var idSumarioaux = null;\n sessionStorage.setItem(\"idSumarioaux\", idSumarioaux);\n sessionStorage.setItem(\"idExplicando\", idExpndo);\n sessionStorage.setItem(\"idDisciplina\", idDisc);\n sessionStorage.setItem(\"texto\", texto);\n verificaData(0);\n }\n });\n closeConnectionDataBase();\n }\n}", "function guardarLocal() {\n document.getElementById(\"guardar\").addEventListener(\"click\", function (e) {\n\n let informacion = {\n\n Nombre: document.getElementById(\"pila\").value,\n Apellidos: document.getElementById(\"apellido\").value,\n Email: document.getElementById(\"correoe\").value,\n Edad: document.getElementById(\"años\").value,\n Numero: document.getElementById(\"numero\").value\n }\n\n localStorage.setItem(\"click\", JSON.stringify(informacion));\n })\n var informacion = JSON.parse(localStorage.getItem('click'));\n\n document.getElementById(\"nombre\").innerHTML = informacion.Nombre;\n document.getElementById(\"apellidos\").innerHTML = informacion.Apellidos;\n document.getElementById(\"email\").innerHTML = informacion.Email;\n document.getElementById(\"edad\").innerHTML = informacion.Edad;\n document.getElementById(\"celular\").innerHTML = informacion.Numero;\n\n}", "setData(data){\n this.hasSavedValues = false,\n this.publicoAlvoSim= data.publicoAlvoSim,\n this.publicoAlvoNao= data.publicoAlvoNao,\n this.publicoAlvoALVA= data.publicoAlvoNao,\n this.XER= data.XER,\n this.COP= data.COP,\n this.listaPrefixos= data.listaPrefixos,\n this.operacaoNaoVinculada= data.operacaoNaoVinculada,\n this.operacaoVinculada= data.operacaoVinculada,\n this.operacaoVinculadaEmOutroNPJ= data.operacaoVinculadaEmOutroNPJ,\n this.acordoRegPortalSim= data.acordoRegPortalSim,\n this.acordoRegPortalNao= data.acordoRegPortalNao,\n //this.acordoRegPortalDuplicados= data.acordoRegPortalDuplicados,\n this.totaisEstoque = data.totaisEstoque,\n this.totaisFluxo = data.totaisFluxo,\n this.estoqueNumber= data.estoqueNumber,\n this.fluxoNumber= data.fluxoNumber,\n this.duplicadoSimNao = data.duplicadoSimNao,\n this.analisadoSimNao = data.analisadoSimNao\n }", "function guardaDO(){\n\tvar items=[];\n\t//traer todos los item\n\tDigitaloutput.find({}) \n\t .exec(\n\t \t\t(err, itemsFound) => {\n\t \t\t\tif (err){\n\t \t\t\t\tconsole.log(\"err: \"+ err);\n\t \t\t\t}else{\n\t \t\t\t\titems=itemsFound;\n\t \t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t \t//console.log(items[i]);\n\t\t\t\t \tvar params={valor: arrayGuardaDO[i] }\n\t\t\t\t \tDigitaloutput.findByIdAndUpdate(items[i]._id, params, { new: true }, (err, itemUpdated) => { \n\t\t\t\t\t\t\tif(err){ console.log(\"err: \"+ err);\t}\n\t\t\t\t\t\t});\n\t\t\t\t }\n\t\t\t\t mensajeDO(arrayGuardaDO);\n\t \t\t\t}\n\t \t\t}\n\t \t);\n}", "function guardarSesion(nombre,contraseña,id){\n sessionStorage.setItem('nombre',nombre);\n sessionStorage.setItem('contraseña',contraseña);\n sessionStorage.setItem('id',id);\n\n}", "saveMetaData (name, rows) {\n // console.debug(`meta: ${name}, \\t\\tcount: ${rows ? rows.length : 0}`)\n\n // save to a map\n this.dataInArray.set(name, rows) // TODO: meta saved two copys !!!\n let tmp = new Map() // temp map to save the rows\n let cardList = CARD_TYPES.includes(name) ? new Map() : null\n let maxID = 0\n if (rows) {\n let def = this.defs && this.defs[name]\n let keyName = def ? def.fields.names[def.keyIndex] : name + '_id'\n keyName = this.dealSpecialId(keyName, name)\n for (let item of rows) {\n // save to data\n let keyValue = item[keyName]\n if (name !== 'staff_extend' && name !== 'vehicle_extend') {\n let spy = item['name'] ? xdata.spell.makePy(item['name']) : ''\n spy = spy ? spy[0] : ''\n item['spy'] = spy\n }\n\n if (name === 'setting' && keyValue === 15) {\n let shiftData = new Map()\n shiftData.set(keyValue, item)\n this.data[SHIFTTABLENAME] = shiftData\n continue\n }\n\n tmp.set(keyValue, item)\n\n // is card, save to cardIndex\n if (cardList) {\n let cardID = item['card_id']\n cardList.set(cardID, item)\n this.cardIndex.set(cardID, item)\n }\n\n // init the maxID\n if (keyValue > maxID) {\n maxID = keyValue\n }\n }\n }\n\n this.data[name] = tmp\n this.maxIDs[name] = maxID\n\n // if (['reader', 'traffic', 'speaker', 'turnout'].includes(name)) {\n // xbus.trigger('DEVICE-INFO-UPDATED') // tell others to update the device info\n // }\n\n if (name === 'dept') {\n this.getMaxHMDeptID(rows)\n }\n\n if (cardList) {\n xbus.trigger('CARD-INFO-UPDATE', {\n type: name,\n data: cardList\n })\n }\n\n this.broadcastMetaUpdate(name, maxID, rows)\n }", "function guardarCursoLocalStorage(infocurso) {\n let cursos;\n cursos = obetenerCursoLocalStorage();\n //el curso seleccionado se agrega al arreglo\n cursos.push(infocurso);\n localStorage.setItem(\"cursos\", JSON.stringify(cursos));\n}", "async save(isCreated){\n \n let sql = '';\n // insert\n if(isCreated){\n \n sql = `INSERT INTO ${this.tableName} (tenTheLoai,moTa) VALUES ('${this.columns.tenTheLoai}','${this.columns.moTa}')`;\n try {\n let results = await database.excute(sql);\n this.id = results.insertId;\n } catch (error) {\n throw error;\n }\n }\n\n // update\n else{\n sql = `UPDATE ${this.tableName} SET moTa='${this.columns.moTa}',tenTheLoai='${this.columns.tenTheLoai}' `+\n `WHERE id = ${this.id}`;\n try {\n let rs = await database.excute(sql);\n this.id = rs.id; \n } catch (error) {\n throw error;\n }\n }\n }", "function saveBorrowing() {\n retrieveValues();\n saveToServer();\n}", "function insertTempObra(x) {\n //code Insertando avances fisicos\n \n if (AOTI && x >= AOTI.length) {\n //code\n console.log(\"Todas las inserciones terminadas:::::::::::::::::::::::::::::::::\");\n location.href=\"mapa_proyectos.html\";\n // insertarAvanceFinancieroProyectos(0);\n }\n \n else if (AOTI && AOTI.length > 0) {\n console.log(\"Cargando datos espere un momento ::: 4 X=\" + x + \" Avances: \"+ AOTI.length);\n \n \n \n db.transaction(function(tx) {\n \n tx.executeSql('INSERT INTO TempAvanceObras(idAvanceFinanciero, idAvanceFisico, idObra)' +\n ' VALUES (?, ?, ?)',\n [AOTI.item(x).idAvanceFinanciero, AOTI.item(x).idAvanceFisico, AOTI.item(x).idObraFisico]);\n console.log(\"Avance Temp en Proyectos: \" + AOTI.item(x).idObraFisico);\n \n \n }, errorCB, function (){\n console.log(\"Se inserto correctamente el avance temporal: \" + AOTI.item(x).idObraFisico);\n \n x++;\n insertTempObra(x);\n \n }); \n \n } else {\n console.log(\"No hay avances temporales de obra :::::::::::::::::::::::\");\n // insertarAvanceFinancieroProyectos(0);\n }\n}", "function guardarCursoLocalStorage(curso) {\n let cursos;\n\n //TOMA EL VALOR DEL ARREGLO DE LS O VACIO\n cursos = obtenerCursoLocalStorage();\n\n //EL CURSO SELECCIONADO SE AGREGA AL ARREGLO\n cursos.push(curso);\n\n localStorage.setItem('cursos', JSON.stringify(cursos));\n}", "async function guardar(oferta) {\n\n const opcionesFetch = {\n method: \"GET\",\n headers: HEADERS,\n };\n\n const response = await fetch(API + \"/PutInsertOfertas?id=\" + oferta[0] + \"&t=\" + oferta[1] + \"&d=\" + oferta[2], opcionesFetch);\n\n return response.ok; // true/false\n\n}", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "insertarPersona (persona) {\n let valores = `${ persona.getNombre() }, ${ persona.getApellido() }, ${ persona.getDireccion() }, ${ persona.getEdad() }, ${ persona.getTelefono() }, ${ persona.getCorreo() }`;\n let r = this.db.push(valores);\n if (r) {\n console.log( \"PERSONA_INSERTADA\" );\n } else {\n console.log( \"ERROR_PERSONA_INSERTADA\" );\n }\n }", "function guardarStorage() {\r\n localStorage.setItem('carrito', JSON.stringify(ProductosCarrito));\r\n //console.log(localStorage.getItem('carrito'))\r\n}", "async save(dbConfig) {\n // TODO inserire try catch\n let db = await sql.connect(dbConfig);\n // per distinguere se è un update o un insert into\n let query = 'INSERT INTO dbo.Events ([Location],[MaxUsers],[StartDate],[EndDate],[CorsoITS],[StudentName]) VALUES ( @Location,@MaxUsers,@StartDate,@EndDate,\\'DAM\\',\\'Mauro Biasutti\\')';\n console.log(query);\n if (this._id) {\n query = 'UPDATE dbo.Events SET [Location]=@Location, [MaxUsers]=@MaxUsers, [StartDate]=@StartDate, [EndDate]=@EndDate WHERE id=@id'\n }\n let EventSaved = await db.request()\n\n .input('Location', sql.NVarChar, this.Location)\n .input('MaxUsers', sql.Int, this.MaxUsers)\n .input('StartDate', sql.NVarChar, this.StartDate)\n .input('EndDate', sql.NVarChar, this.EndDate)\n .input('id', sql.Int, this._id)\n .query(query);\n\n console.log('sto salvando i dati dell\\'evento ');\n sql.close();\n return true;\n\n }", "function guardar(){\n \n if (vector == null)\n {\n vector = [];\n }\n var id = vector.length;\n var objeto ={\n \"userId\":id,\n \"nombre\": fNombre.value,\n \"apellido\":fApellido.value,\n \"telefono\":fTelefono.value,\n \"email\":email.value\n }\n vector.push(objeto);\n localStorage.setItem(\"xd\",JSON.stringify(vector));\n $.ajax({\n method: \"POST\",\n url:\"recibir.php\",\n data: objeto,\n success: function(data){\n alert(data);\n }\n });\n return true;\n}", "function guardarFichaFoto() {\n var idInstitucion = fp_InstitucionElegida;\n var numeroRegistroInterno = $(\"#tbNumeroInterno\").val();\n var numeroInventario = $(\"#tbNumeroInventario\").val();\n idPublicacion = fp_IdPublicacionElegida;\n if (idPublicacion == 0) {\n alert(\"No se ha elegido una publicación.\");\n return;\n }\n var idAlbum = fp_Album;\n var numeroEdicion = $(\"#tbNumeroEdicion\").val();\n var numeroPublicacion = $(\"#tbNumeroPublicacion\").val();\n var numeroTotalPaginas = $(\"#tbNumeroTotalPaginas\").val();\n var fechaPublicacion = $(\"#tbFechaPublicacion\").val();\n var tituloSeccion = $(\"#tbTituloSeccion\").val();\n var numeroPaginaEncuentra = $(\"#tbNumeroPaginaEncuentra\").val();\n var numeroColumnas = $(\"#tbNumeroColumnas\").val();\n var hallazgo = $(\"#selHallazgo\").val();\n var idPeriodicidad = $(\"#selPeriodicidades\").val();\n var issn = $(\"#tbISSN\").val();\n var anotaciones = $('#taAnotaciones').val();\n var contextoHistorico = $('#taContextoHistorico').val();\n var estadoConservacion = $('#sEstadoConservacion').val();\n var estadoIntegridad = $(\"#sEstadoIntegridad\").val();\n var arrugas = $(\"#cbArrugas\").is(\":checked\") ? \"SI\" : \"NO\";\n var ataqueBiologico = $(\"#cbAtaque\").is(\":checked\") ? \"SI\" : \"NO\"; \n var cintasAdhesivas = $(\"#cbCintas\").is(\":checked\") ? \"SI\" : \"NO\";\n var deformaciones = $(\"#cbDeformaciones\").is(\":checked\") ? \"SI\" : \"NO\";\n var deshojado = $(\"#cbDeshojado\").is(\":checked\") ? \"SI\" : \"NO\";\n var etiquetas = $(\"#cbEtiquetas\").is(\":checked\") ? \"SI\" : \"NO\"; \n var huellasDigitales = $(\"#cbHuellas\").is(\":checked\") ? \"SI\" : \"NO\";\n var hongos = $(\"#cbHongos\").is(\":checked\") ? \"SI\" : \"NO\";\n var manchas = $(\"#cbManchas\").is(\":checked\") ? \"SI\" : \"NO\";\n var rasgaduras = $(\"#cbRasgaduras\").is(\":checked\") ? \"SI\" : \"NO\";\n var ralladuras = $(\"#cbRalladuras\").is(\":checked\") ? \"SI\" : \"NO\";\n var retocado = $(\"#cbRetocado\").is(\":checked\") ? \"SI\" : \"NO\";\n var roturas = $(\"#cbRoturas\").is(\":checked\") ? \"SI\" : \"NO\";\n var sellosTinta = $(\"#cbSellos\").is(\":checked\") ? \"SI\" : \"NO\";\n var otros = $('#tbOtros').val(); \n var numeroFragmentos = $('#tbNumeroFragmentos').val();\n var alto = $('#tbAlto').val();\n var ancho = $('#tbAncho').val();\n var profundidad = $('#tbProfundidad').val();\n var pieImprenta = $('#tbPieImprenta').val();\n var inspeccionesOMarcas = $('#taInspecciones').val();\n var caracteristicas = $('#taCaracteristicas').val();\n var idPersonaCaptura = getCookie(\"idusuario\");\n var currentdate = new Date(); \n var fechaCaptura = (currentdate.getDate() < 10 ? \"0\" + currentdate.getDate() : currentdate.getDate()) + \"/\"\n + ((currentdate.getMonth() + 1) < 10 ? (\"0\" + (currentdate.getMonth() + 1)) : (currentdate.getMonth() + 1)) + \"/\" \n + currentdate.getFullYear() + \" @ \" \n + (currentdate.getHours() < 10 ? (\"0\" + currentdate.getHours()) : currentdate.getHours()) + \":\" \n + (currentdate.getMinutes() < 10 ? (\"0\" + currentdate.getMinutes()) : currentdate.getMinutes()) + \":\" \n + (currentdate.getSeconds() < 10 ? (\"0\" + currentdate.getSeconds()) : currentdate.getSeconds());\n var estado = \"ACTIVO\";\n var autores = fp_Autores;\n var temas = fp_temas;\n var generosPeriodisticos = fp_generosPeriodisticos;\n var generosLiterarios = fp_generosLiterarios;\n var tiposEncuadernacion = fp_tiposEncuadernacion;\n var tecnicasImpresion = fp_tecnicasImpresion;\n var tiposPapel = fp_tiposPapel;\n\n if (fp_IdFichaPublicacion == 0) {\n $.ajax({url: \"php/agregarFichaPublicacion.php\", async: false, type: \"POST\", data: { idInstitucion : idInstitucion, idPublicacion: idPublicacion, numeroRegistroInterno: numeroRegistroInterno,\n numeroInventario: numeroInventario, idAlbum: idAlbum, numeroEdicion: numeroEdicion, numeroPublicacion: numeroPublicacion, numeroTotalPaginas: numeroTotalPaginas,\n fechaPublicacion: fechaPublicacion, tituloSeccion: tituloSeccion, numeroPaginaEncuentra: numeroPaginaEncuentra, numeroColumnas:numeroColumnas,\n hallazgo: hallazgo, idPeriodicidad: idPeriodicidad, issn: issn, anotaciones: anotaciones, contextoHistorico: contextoHistorico, estadoConservacion: estadoConservacion, estadoIntegridad: estadoIntegridad,\n arrugas: arrugas, ataqueBiologico: ataqueBiologico, cintasAdhesivas: cintasAdhesivas, deformaciones: deformaciones, deshojado: deshojado, etiquetas: etiquetas, huellasDigitales: huellasDigitales,\n hongos: hongos, manchas: manchas, rasgaduras: rasgaduras, ralladuras: ralladuras, retocado: retocado, roturas: roturas, sellosTinta: sellosTinta,\n alto: alto, ancho: ancho, profundidad: profundidad, otros: otros, numeroFragmentos: numeroFragmentos, pieImprenta: pieImprenta, inspeccionesOMarcas: inspeccionesOMarcas, caracteristicas: caracteristicas,\n idPersonaCaptura: idPersonaCaptura, fechaCaptura: fechaCaptura, estado: estado,\n autores: autores, temas: temas, generosPeriodisticos, generosLiterarios, tiposEncuadernacion, tecnicasImpresion, tiposPapel },\n success: function(res) {\n if (res > 0) {\n obtenerUltimasFichasPublicacion();\n //limpiarCamposFichaPublicacion();\n fp_IdFichaPublicacion = res;\n $(\"#divEnlacesWeb\").css(\"visibility\", \"visible\");\n $(\"#divImagenesBien\").css(\"visibility\", \"visible\");\n $(\"#divPendientes\").css(\"visibility\", \"visible\");\n alert(\"Se ha ingresado la ficha de la publicación.\");\n } else {\n alert(res);\n }\n }});\n } else {\n $.ajax({url: \"php/actualizarFichaPublicacion.php\", async: false, type: \"POST\", data: { idFichaPublicacion: fp_IdFichaPublicacion, idInstitucion : idInstitucion, idPublicacion: idPublicacion, numeroRegistroInterno: numeroRegistroInterno,\n numeroInventario: numeroInventario, idAlbum: idAlbum, numeroEdicion: numeroEdicion, numeroPublicacion: numeroPublicacion, numeroTotalPaginas: numeroTotalPaginas,\n fechaPublicacion: fechaPublicacion, tituloSeccion: tituloSeccion, numeroPaginaEncuentra: numeroPaginaEncuentra, numeroColumnas:numeroColumnas,\n hallazgo: hallazgo, idPeriodicidad: idPeriodicidad, issn: issn, anotaciones: anotaciones, contextoHistorico: contextoHistorico, estadoConservacion: estadoConservacion, estadoIntegridad: estadoIntegridad,\n arrugas: arrugas, ataqueBiologico: ataqueBiologico, cintasAdhesivas: cintasAdhesivas, deformaciones: deformaciones, deshojado: deshojado, etiquetas: etiquetas, huellasDigitales: huellasDigitales,\n hongos: hongos, manchas: manchas, rasgaduras: rasgaduras, ralladuras: ralladuras, retocado: retocado, roturas: roturas, sellosTinta: sellosTinta,\n alto: alto, ancho: ancho, profundidad: profundidad, otros: otros, numeroFragmentos: numeroFragmentos, pieImprenta: pieImprenta, inspeccionesOMarcas: inspeccionesOMarcas, caracteristicas: caracteristicas,\n idPersonaCaptura: idPersonaCaptura, fechaCaptura: fechaCaptura, estado: estado,\n autores: autores, temas: temas, generosPeriodisticos, generosLiterarios, tiposEncuadernacion, tecnicasImpresion, tiposPapel },\n success: function(res) {\n if (res == 'OK') {\n obtenerUltimasFichasPublicacion();\n limpiarCamposFichaPublicacion();\n alert(\"Se ha actualizado la ficha de la publicación.\");\n } else {\n alert(res);\n }\n }});\n }\n}", "async function saveData(data) {\n\tfor (let countryData of data) {\n\t\t// check that country is not yet exists\n\t\tlet sql = `SELECT id FROM country WHERE id = ?`;\n\t\tconst countries = await db.query(sql, [countryData.id]);\n\t\t// if there is no such country then save it to DB\n\t\tif (countries.length == 0) {\n\t\t\tsql = `INSERT INTO country SET ?`;\n\t\t\tconst data = {\n\t\t\t\tid: countryData.id,\n\t\t\t\tshort_name: countryData.extra ? countryData.extra.fifa : null,\n\t\t\t\tfull_name: countryData.name,\n\t\t\t\t// TODO: fix\n\t\t\t\t// flag_svg: countryData.extra.flag\n\t\t\t}\n\t\t\tawait (db.query(sql, data));\n\t\t}\n\t}\n}", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function guardarCursoLocalStorage(curso){\n let cursos;\n cursos=obtenerCursosLocalStorage();\n cursos.push(curso);\n localStorage.setItem('cursos', JSON.stringify(cursos));\n //console.log(curso);\n}", "function guardarProductosLocalStorage() {\n localStorage.setItem(\"Carrito\", JSON.stringify(carrito));\n}", "async salva_descarregamento_sqlite({ ID, Unidade, Placa, Dia }){\n\n const Atualizado = module.exports.agora();\n\n // Procura um item igual no sqlite\n const db_caminhao = await connection('fDescarregamento')\n .select('*')\n .where( \"ID\", \"=\", ID );\n\n // Se não existir esses caminhões no sqlite ainda, criar um novo\n if ( db_caminhao.length === 0 ) {\n\n await connection('fDescarregamento')\n .insert({\n ID,\n Placa,\n Dia,\n Status: \"Aguardando chegada do veículo\",\n Unidade,\n Atualizado,\n });\n\n // Caso seja a primeira aparição dessa caminhão, inserir seu status na tabela de status\n module.exports.on_status_change({\n ID,\n Status: 'Aguardando chegada do veículo',\n Unidade,\n Placa,\n Dia,\n });\n };\n }", "saveAccounts() {\n let accounts = this._handlers.map( tw => tw.handle );\n store.setData( this._accountsKey, accounts );\n this.emit( 'handlers', this._handlers );\n }", "function savePomoData() {\n localStorage.setItem(\"cpid\", currentPomoID);\n localStorage.setItem(\"pomoData\", JSON.stringify(pomoData));\n}", "function guardarNuevoMovimiento(tablaMuestra) {\n\t var table = document.getElementById(tablaMuestra);\n\t var filas = $(\"#tablaMuestra\").find('tr'); \n\t var datosJson = [];\n\t var vendedorMovi = $('#vendedorMovi').val();\n\t var empresaMovi = $('#empresaMovi').val();\n\t var movimiento = $('#movimiento').val();\n\t var encargado = $('#encargadoRecibir').val();\n\t var validacion=true;\n\t var validador = 0;\n\t var i = 0;\n\n\n//hace uso de la funcion de foreach para validar que realmente estén llenados los campos en el modal //\n\t if(vendedorMovi==\"\" || vendedorMovi==null || vendedorMovi==undefined || \n\t\t empresaMovi==\"\" || empresaMovi==null || empresaMovi==undefined || shoppingCart.listCart()[0]==undefined ||\n\t\t encargado==\"\" || encargado==null || encargado==undefined){\n\t\t console.log(\"faltan datos\");\n\t\t Swal.fire({\n\t\t\t\ticon: 'error',\n\t\t\t\ttitle: 'Error',\n\t\t\t\ttext: '¡Todos los campos deben de estar llenos!',\n\t\t\t\tshowConfirmButton: false,\n\t\t timer: 3500\n\t\t\t })\n\t\t\tvalidacion=false;\n\t }\n\n//La función de este ciclo es realizar un JSON con todas las muestras agregadas en la tabla //\n\t if (table) {\n\t\t if(validacion==true){\n\t\t\t for(i=1; i<filas.length; i++){\n\t\t\t\t var celdas = $(filas[i]).find(\"td\");\n\t\t\t var record = {cantidad: $(celdas[0]).text(), \n\t\t\t\t\t\t\t\t nombreMuestra: $(celdas[1]).text(), \n\t\t\t\t\t\t\t\t modeloPrenda: $(celdas[2]).text(), \n\t\t\t\t\t\t\t\t idPrenda: $($(celdas[2]).children(\"input\")[0]).val(),\n\t\t\t\t\t\t\t\t codigoTela: $(celdas[3]).text(),\n\t\t\t\t\t\t\t\t idTela: \t$($(celdas[3]).children(\"input\")[0]).val(),\n\t\t\t\t\t\t\t\t idmuestra:\t\t$($(celdas[3]).children(\"input\")[1]).val()};\n\t\t datosJson.push(record);\n\t\t console.log($($(celdas[2]).children(\"input\")[0]).val());\n\t\t console.log($($(celdas[3]).children(\"input\")[0]).val());\n\t\t\t }\n\t\t }\n\t }\n\t if(validacion==true){\nconsole.log(encargado);\n//AJAX para mandar los datos del JSON y los datos del vendedor y la empresa(Cliente) //\n\t\t $.ajax({\n\t\t\t method: \"POST\",\n\t\t\t url: \"/guardarSolicitudMovimiento\",\n\t\t\t data:{\n\t\t\t\t \"_csrf\": $('#token').val(),\n\t\t\t\t vendedor: vendedorMovi,\n\t\t\t\t empresa: empresaMovi,\n\t\t\t\t encargado: encargado,\n\t\t\t\t idMovimiento:movimiento,\n\t\t\t\t \"object_muestras\": JSON.stringify(datosJson)\n\t\t\t },\n\t\t\t beforeSend: function () {\n\t\t \t Swal.fire({\n\t\t title: 'Cargando ',\n\t\t html: 'Por favor espere',// add html attribute if you want or remove\n\t\t allowOutsideClick: false,\n\t\t timerProgressBar: true,\n\t\t onBeforeOpen: () => {\n\t\t Swal.showLoading()\n\t\t },\n\t\t });\n\t\t\t },\n\t\t\t success: (data) => {\n\t\t\t\t if(data==1){\n\t\t\t\t\t Swal.fire({\n\t\t\t\t\t\t\ticon: 'success',\n\t\t\t\t\t\t\ttitle: 'Rack agregado',\n\t\t\t\t\t\t\ttext: '¡Se ha modificado un movimiento!',\n\t\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t timer: 2000,\n\t\t\t\t\t onClose: () => {\n\t\t\t\t\t \t$('#addTraspaso').modal(false);\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t }\n\t\t\t\t else if(data==2){\n\t\t\t\t\t Swal.fire({\n\t\t\t\t\t\t\ticon: 'success',\n\t\t\t\t\t\t\ttitle: 'Rack agregado',\n\t\t\t\t\t\t\ttext: '¡Se ha agregado el Rack!',\n\t\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t timer: 2000,\n\t\t\t\t\t onClose: () => {\n\t\t\t\t\t \tshoppingCart.clearCart();\n\t\t\t\t\t \tlocation.reload();\n\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t }\n\t\t\t\t else{\n\t\t\t\t\t Swal.fire({\n\t\t\t\t\t\t\ticon: 'error',\n\t\t\t\t\t\t\ttitle: '¡Algo salió mal!',\n\t\t\t\t\t\t\ttext: 'Intente de nuevo más tarde',\n\t\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t timer: 2000,\n\t\t\t\t\t onClose: () => {\n\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t }\n\t\t\t },\n\t\t\t error: (e) =>{\n\t\t\t }\n\t\t });\n\t }\n\t return datosJson;\n\t}", "function guardarCursoLocalStorage(infoCurso){\n\tlet memoriaCursos;\n\n\t// Obtener la lista de valores de Local Storage para cursos en el carrito\n\tmemoriaCursos = obtenerCursosLocalStorage();\n\n\t// Comprobar la comunicion de las funciones\n\tconsole.log('success I guess');\n\t// console.log(infoCurso);\n\n\t// Agregar la información del curso agregado a la colección de cursos en el carrito\n\tmemoriaCursos.push(infoCurso);\n\n\t// Guardar la información del carrito en Local Storage\n\tlocalStorage.setItem( 'carrito de cursos', JSON.stringify(memoriaCursos) );\n}", "function guardarContacto() {\n if (estado == \"guardar\") {\n\n //Cogemos los valores del formulario \n var id = contador;\n var nombre = document.getElementById(\"nombre\").value;\n var apellidos = document.getElementById(\"apellidos\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var fecha = document.getElementById(\"fecha\").value;\n\n /* Si esta funcion devuelve false no se añade el contacto a la agenda */\n if (validarFormulario(nombre, apellidos, telefono, fecha)) {\n\n //Añadimos los datos a la lista \n agenda[contador] = new Persona(id, nombre, apellidos, telefono, fecha);\n contador++;\n cargarResumen();\n limpiarFormulario();\n\n alert('Gracias por rellenar nuestro formulario correctamente');\n } else {\n alert('Campos incorrectos, intentelo de nuevo');\n }\n } else if (estado == \"editar\") {\n editarContacto();\n }\n}", "function saveChange() {\n //Guardo los datos ingresados en sus respectivas variables.\n let profile = {};\n\n profile.nombre = document.getElementById(\"perfilNombre\").value;\n profile.apellido = document.getElementById(\"perfilApellido\").value;\n profile.email = document.getElementById(\"perfilMail\").value;\n profile.telefono = document.getElementById(\"perfilTelefono\").value;\n\n if (profile.nombre == \"\" || profile.apellido == \"\" || profile.email == \"\" || profile.telefono == \"\" ) {\n \n document.getElementById(\"alertPerfil\").innerHTML = `*No puedes dejar campos vacios.*`\n } else {\n document.getElementById(\"alertPerfil\").className = \"text-secondary text-success mr-3 \";\n document.getElementById(\"alertPerfil\").innerHTML = `*Datos guardados exitosamente.*`\n \n //Creo los sessionStoragge, o los modifico. \n localStorage.setItem(\"perfil\", JSON.stringify(profile));\n \n}\n }", "function guardarReproduccion_old ( reproduccion ){\n return $q.when( reproduccion )\n //.then( buscarLibroEnBiblioteca ) //Si ya existe el registro, no guardar nada.\n .then( generarIdReproduccion ) //Generar el id que se usara para el registro en la DB\n .then( prepararRegistroReproduccion ) //crear el objeto (registro) cuyas propiedades son los campos\n .then( persistirReproduccionEnDB ) //metodo que invoca al servicio de base de datos para INSERT/UPDATE/DELETE\n .then(\n\n function guardarDatosExito( id ) {\n return $q.resolve( id );\n }\n\n ).catch(\n\n function Error(error) {\n console.log('guardarDatos()->error: ' + error)\n }\n\n )\n\n }", "GuardarCostoProductoDetalle(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n var costoProductoDetalle = new CostoProductoDetalle_model_1.CostoProductoDetalleModel();\n var body = req.body;\n costoProductoDetalle.Id_CostoProductoDetalle = null;\n costoProductoDetalle.Id_CostoProducto = body.Id_CostoProducto;\n costoProductoDetalle.Id_MateriaPrima = body.Id_MateriaPrima;\n costoProductoDetalle.Cantidad = body.Cantidad;\n costoProductoDetalle.Monto = body.Monto;\n yield database_1.default.query('INSERT INTO CostoProductoDetalle set ?', costoProductoDetalle, (err, datos) => {\n if (err) {\n return res.status(400).json({\n ok: false,\n mensaje: 'Error al crear Auxiliar',\n errors: err,\n });\n }\n costoProductoDetalle.Id_CostoProductoDetalle = datos.insertId;\n res.status(201).json({\n ok: true,\n CostoProducto: costoProductoDetalle,\n Info: datos,\n });\n });\n });\n }", "function saveTransfer() {\n retrieveValues();\n saveToServer();\n}", "async SyncDB() { // Sincroniza com as tabelas, colunas e todos os elementos do Banco de Dados\n await mysql.sync();\n }", "function saveData(data) {\n fs.writeFileSync(TASK_STORAGE_PATH, JSON.stringify(data));\n console.log(`Saved to database.`)\n list();\n}", "function saveRecordatorios(recordatorios){\n\tvar recordatorioJSON = JSON.stringify(recordatorios);\n\tlocalStorage.setItem(\"recordatorios\",recordatorioJSON);\n\n}", "function guardarDatosLocales(){\n\tlocalStorage.setItem(\"contactos\", JSON.stringify(arrayContactos));\n\tmostrarDatosLocales();\n\tlocation.reload();\t\n}", "async function savePedido(){\n try {\n await AsyncStorage.setItem('@Pedido', JSON.stringify(pedido));\n } catch (error) {\n // Error retrieving data\n }\n }", "function guardar(){\r\n\tvar nombre = $('#txtNombre').val();\r\n\tvar apellido = $('#txtApellido').val();\r\n\tvar direccion = $('#txtDireccion').val();\r\n\tvar referencia = $('#txtReferencia').val();\r\n\tvar cuidad = $('#txtCuidad').val();\r\n\tvar edad = $('#txtEdad').val();\r\n\r\n\tvar data= 'txtNombre='+nombre+'&txtApellido='+apellido+'&txtDireccion='+ direccion + '&txtReferencia='+ referencia + '&txtCuidad='+ cuidad + '&txtEdad='+ edad;\r\n\r\n\t$.ajax({\r\n\ttype:'post',\r\n url: '../ajax/app.php?op=guardar',\r\n data: data,\r\n success:function(resp){\r\n\t// alert(resp);\r\n\t\tif(resp==1)\r\n\t\t{\r\n\t\t\ttoastr.success('Registro Almacenado correctamente', 'INFORMACIÓN DEL SISTEMA');\r\n\t\t\tlistarDatos();\r\n\t\t\tlimpiar();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttoastr.error('Registro no se pudo almacenar', 'INFORMACIÓN DEL SISTEMA');\r\n\t\t}\r\n }\r\n\t});\r\n}", "guardarStorage() {\n localStorage.setItem('usuario', JSON.stringify(this.usuario));\n }", "function guardarCarreraAsociar() {\n let listaCheckboxCarreras = document.querySelectorAll('#tblCarreras tbody input[type=checkbox]:checked');\n let carreraSeleccionada = [];\n let codigoCarrera;\n\n for (let i = 0; i < listaCheckboxCarreras.length; i++) {\n codigoCarrera = listaCheckboxCarreras[i].dataset.codigo;\n carreraSeleccionada.push(codigoCarrera);\n }\n\n return carreraSeleccionada;\n}" ]
[ "0.65867466", "0.65676874", "0.650246", "0.63669145", "0.6219115", "0.6211952", "0.6130465", "0.6113292", "0.6102723", "0.6090414", "0.60738873", "0.59655225", "0.5959617", "0.59210974", "0.59088826", "0.5907218", "0.5900235", "0.5899711", "0.58931845", "0.5886742", "0.58766574", "0.58756703", "0.5864149", "0.58635306", "0.585175", "0.5838917", "0.5820851", "0.5815917", "0.5812975", "0.579776", "0.57946116", "0.57715917", "0.576859", "0.576688", "0.57335347", "0.57280576", "0.5709448", "0.5706194", "0.5706194", "0.5703348", "0.5666713", "0.56651855", "0.565992", "0.5647162", "0.5617404", "0.5604919", "0.5593551", "0.5588128", "0.5588119", "0.5587389", "0.5584177", "0.5579408", "0.5578883", "0.5575789", "0.5573484", "0.5572292", "0.55540156", "0.5550936", "0.55420846", "0.5536721", "0.5528605", "0.55210435", "0.5513033", "0.5497449", "0.5495862", "0.5492612", "0.5481712", "0.54777676", "0.5468554", "0.5462379", "0.5459355", "0.54538167", "0.54537874", "0.54528296", "0.5451655", "0.5445883", "0.54423386", "0.54394555", "0.54336756", "0.5432058", "0.5423524", "0.5422038", "0.5421361", "0.54179084", "0.5413663", "0.5408649", "0.5406677", "0.5398852", "0.5398839", "0.53971666", "0.5396273", "0.5396131", "0.5396063", "0.5391659", "0.5389334", "0.5388374", "0.53853875", "0.53646743", "0.53643006", "0.53638947", "0.5363424" ]
0.0
-1
Restores select box and checkbox state using the preferences stored in chrome.storage.
function restore_options() { chrome.storage.sync.get({ darkMode: true, hideLargeSig: true, largeSignatures: 600, resizeLargeImages: true, largeImages: 40.781, WYSIWYGCheckbox: false, addEdited: false, showSickles: true, banMeMillisec: 0, lockBan: false, colors: false }, function(items) { document.getElementById("darkSwitch").checked = items.darkMode; document.getElementById("hideLargeSig").checked = items.hideLargeSig; document.getElementById("largeSigInput").value = items.largeSignatures; if(items.hideLargeSig) { document.getElementById("largeSigInput").style.display = "initial"; document.getElementById("resetLargeSig").style.display = "initial"; } document.getElementById("resizeLargeImages").checked = items.resizeLargeImages; document.getElementById("largeImgInput").value = items.largeImages; if(items.resizeLargeImages) { document.getElementById("largeImgInput").style.display = "initial"; document.getElementById("resetLargeImg").style.display = "initial"; } document.getElementById("WYSIWYGCheckbox").checked = items.WYSIWYGCheckbox; document.getElementById("addEdited").checked = items.addEdited; document.getElementById("showSickles").checked = items.showSickles; if((new Date()).getTime() < items.banMeMillisec) { document.getElementById("cancelBanDIV").innerHTML = (items.lockBan ? "הבאן הנוכחי נעול." : "<button id='cancelBan'>בטל באן פעיל</button>"); // Yes, it will be pretty easy to remove the ban even if its locked. Self control is important, people. // But I challenge you to remove it without using that button :) (Its possible!) if(items.lockBan) { document.getElementById("cancelBanDIV").innerHTML = ("הבאן הנוכחי נעול."); } else { document.getElementById("cancelBanDIV").innerHTML = ("<button id='cancelBan'>בטל באן פעיל</button>"); document.getElementById("cancelBan").addEventListener("click", function () { if(confirm("את/ה בטוח/ה שאת/ה רוצה לבטל את הבאן?")) { chrome.storage.sync.set({ banMeMillisec: 0 }); document.getElementById("cancelBanDIV").innerHTML = "הבאן בוטל, יש לטעון מחדש את העמוד."; } }); } } else { document.getElementById("cancelBanDIV").innerHTML = "אין באן פעיל"; } if(items.colors != false) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restore_options() {\n $('#options-list input[type=\"checkbox\"]').each(function() {\n var obj = {};\n var check = $(this);\n obj[$(this).attr('id')] = 1;\n chrome.storage.sync.get(obj,\n function(item) {\n $(\"#\" + check.attr('id')).prop(\"checked\", item[check.attr('id')]);\n }\n );\n });\n $('#options-list input[type=\"text\"]').each(function() {\n var obj = {};\n var text = $(this);\n obj[$(this).attr('id')] = $(this).text();\n chrome.storage.sync.get(obj,\n function(item) {\n $(\"#\" + text.attr('id')).prop(\"value\", item[text.attr('id')]);\n }\n );\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n panel: true,\n remove: true,\n notify: true,\n restyle: true,\n console: false,\n console_deep: false,\n }, (items) => {\n for (let item in items) {\n document.getElementById(item).checked = items[item];\n }\n });\n}", "function restoreOptions() {\n // Default values.\n chrome.storage.sync.get({\n notifications: true,\n counters: true,\n buttons: true,\n }, function(items) {\n $(INPUT_NOTIFICATIONS_SELECTOR).prop('checked', items.notifications);\n $(INPUT_COUNTERS_SELECTOR).prop('checked', items.counters);\n $(INPUT_BUTTONS_SELECTOR).prop('checked', items.buttons);\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n \"gore\": false,\n \"bugs\": false,\n \"swears\": false,\n \"slurs\": false,\n \"nsfw\": true,\n \"selfharm\": false,\n \"drugs\": false,\n \"war\": false,\n \"scary\": false,\n \"suicide\": false,\n \"firsttime\": true,\n \"bans\": \"\"\n }, function(items) {\n document.getElementById('gore').checked = items.gore;\n document.getElementById('bugs').checked = items.bugs;\n document.getElementById('swears').checked = items.swears;\n document.getElementById('slurs').checked = items.slurs;\n document.getElementById('nsfw').checked = items.nsfw;\n document.getElementById('self-harm').checked = items.selfharm;\n document.getElementById('drugs').checked = items.drugs;\n document.getElementById('war').checked = items.war;\n document.getElementById('scary').checked = items.scary;\n document.getElementById('suicide').checked = items.suicide;\n document.getElementById('bans').value = items.bans;\n });\n}", "function restore_options() {\r\n chrome.storage.sync.get({\r\n hideExtensions: false,\r\n autoTheatre: false,\r\n cursorMute: false\r\n }, function(items) {\r\n document.getElementById('hideExtensions').checked = items.hideExtensions;\r\n document.getElementById('autoTheatre').checked = items.autoTheatre;\r\n document.getElementById('cursorMute').checked = items.cursorMute;\r\n });\r\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n darkGithub: false,\n darkSemaphore: false,\n darkLogentries: false,\n darkThundertix: false,\n darkThunderstage: false,\n darkThunderlocal: false\n }, function(items) {\n document.getElementById('dark_github').checked = items.darkGithub;\n document.getElementById('dark_semaphore').checked = items.darkSemaphore;\n document.getElementById('dark_logentries').checked = items.darkLogentries;\n document.getElementById('dark_thundertix').checked = items.darkThundertix;\n document.getElementById('dark_thunderstage').checked = items.darkThunderstage;\n document.getElementById('dark_localthundertix').checked = items.darkThunderlocal;\n });\n}", "function restoreOptions() {\n // defaults set to true\n chrome.storage.sync.get({\n translateHeadings: true,\n translateParagraphs: true,\n translateOthers: true,\n azurekey: ''\n }, function (items) {\n document.getElementById('selectorH').checked = items.translateHeadings\n document.getElementById('selectorP').checked = items.translateParagraphs\n document.getElementById('selectorOthers').checked = items.translateOthers\n if (items.azurekey != '') {\n document.getElementById('key').value = '***'\n }\n });\n}", "function restore_options() {\n\tfor( i in pOptions){\n\t\tif(typeof(pOptions[i].def)=='boolean')\n\t\t\tdocument.getElementById(i).checked = ((localStorage[i]=='true')?true:pOptions[i].def);\n\t\telse\n\t\t\tdocument.getElementById(i).value = ((localStorage[i])?localStorage[i]:pOptions[i].def);\n\t}\n\n\n// var favorite = localStorage[\"favorite_color\"];\n// if (!favorite) {\n// return;\n// }\n// var select = document.getElementById(\"color\");\n// for (var i = 0; i < select.children.length; i++) {\n// var child = select.children[i];\n// if (child.value == favorite) {\n// child.selected = \"true\";\n// break;\n// }\n// }\n}", "function restore_options() {\n chrome.storage.sync.get({\n definitionsCheckbox: 0,\n examplesCheckbox: 0,\n windowWidth: 1024,\n windowHeight: 768\n }, function (items) {\n document.getElementById('definitionsCheckbox').checked = items.definitionsCheckbox;\n document.getElementById('examplesCheckbox').checked = items.examplesCheckbox;\n document.getElementById('windowWidth').value = items.windowWidth;\n document.getElementById('windowHeight').value = items.windowHeight;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n showBrowserNotifications: true,\n showAccumulatedPoints: false,\n hideBonusChests: false,\n }, function(items) {\n document.getElementById('showBrowserNotifications').checked = items.showBrowserNotifications;\n document.getElementById('showAccumulatedPoints').checked = items.showAccumulatedPoints;\n document.getElementById('hideBonusChests').checked = items.hideBonusChests;\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.local.get({\n 'checkFrequency': 15000,\n 'notificationEnable': false,\n 'alertEnable': false,\n 'notificationTimeout': 30000,\n 'notificationEnableStatus': false,\n 'notificationEnablePlayers': false,\n 'notificationPlayerList': 'Banxsi, externo6, LukeHandle'\n }, function (items) {\n document.getElementById('checkFrequency').value = items.checkFrequency;\n document.getElementById('notificationEnable').checked = items.notificationEnable;\n document.getElementById('alertEnable').checked = items.alertEnable;\n document.getElementById('notificationTimeout').value = items.notificationTimeout;\n document.getElementById('notificationEnableStatus').checked = items.notificationEnableStatus;\n document.getElementById('notificationEnablePlayers').checked = items.notificationEnablePlayers;\n document.getElementById('notificationPlayerList').value = items.notificationPlayerList;\n });\n}", "function restore_options() {\n assignNodeReferences();\n chrome.storage.sync.get({\n payWallOption: true,\n adRemovalOption: true,\n trumpOption: true,\n trumpNameOption: 'florida man',\n yoHeaderOption: true,\n yoSuffixOption: 'yo'\n }, function(items) {\n payWallOption.checked = items.payWallOption;\n adRemovalOption.checked = items.adRemovalOption;\n trumpOption.checked = items.trumpOption;\n trumpNameOption.value = items.trumpNameOption.slice(0,30).toLowerCase();\n yoSuffixOption.value = items.yoSuffixOption.slice(0,30).toLowerCase();\n yoHeaderOption.checked = items.yoHeaderOption;\n closeButton.addEventListener(\"click\", function() {save_options()});\n closeButton.removeAttribute('disabled');\n });\n}", "function restoreOptions() {\n var i, len, elements, elem, setting, set;\n\n elements = mainview.querySelectorAll('#skinSection input');\n for (i = 0, len = elements.length ; i < len ; i += 1) {\n elem = elements[i];\n if (elem.value === localStorage[elem.name]) {\n elem.checked = true;\n }\n else {\n elem.checked = false;\n }\n }\n\n elements = mainview.querySelectorAll('#dictSection select');\n for (i = 0, len = elements.length ; i < len ; i += 1) {\n elem = elements[i];\n elem.querySelector('option[value=' + localStorage[elem.name] + ']').selected = true;\n }\n\n\n elements = mainview.querySelectorAll('#captureSection tbody tr');\n setting = JSON.parse(localStorage.capture);\n for (i = 0, len = elements.length ; i < len ; i += 1) {\n elem = elements[i];\n set = setting[i];\n elem.querySelector('input').checked = set.status;\n elem.querySelector('select').value = set.assistKey;\n }\n }", "function restoreOptions()\n{\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get(\n {\n 'favoriteColor': 'red',\n 'likesColor': true\n },\n function(items)\n {\n color_select.value = items.favoriteColor;\n color_selected.textContent = items.favoriteColor;\n color_selected.style.color = items.favoriteColor;\n like_checkbox.checked = items.likesColor;\n }\n );\n}", "function restore_options() {\n chrome.storage.sync.get(\n\t\tchrome.extension.getBackgroundPage().defaultSettings, \n \t\tfunction (settings) {\n \t\t\tdocument.getElementById(settings.o_theme).checked = true;\n \t\t\tdocument.getElementById(settings.o_live_output).checked = true;\n \t\t\tfor (let i = 0; i < settings.o_live_direction.length; i++) {\n \t\t\t\tdocument.getElementById(settings.o_live_direction[i]).checked = true;\n \t\t\t}\n \t\t\tfor (let i = 0; i < settings.o_live_type.length; i++) {\n \t\t\t\tdocument.getElementById(settings.o_live_type[i]).checked = true;\n \t\t\t}\n \t\t\tdocument.getElementById(settings.o_live_donation).checked = true;\n\n \t\t\tchrome.extension.getBackgroundPage().currentSettings = settings;\n \t\t}\n \t);\n}", "function restore_options() {\n chrome.storage.sync.get({\n fb: true,\n gmail: true,\n timeout: 600,\n alert: true\n }, function(items) {\n document.getElementById('fb').checked = items.fb;\n document.getElementById('gmail').checked = items.gmail;\n document.getElementById('timeout').value = items.timeout;\n document.getElementById('units').value = 'sec';\n document.getElementById('alert').checked = items.alert;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n // Set defaults.\n\ttitleEnabled: true,\n metaDescEnabled: true,\n\th1Enabled: true,\n\th2Enabled: false,\n\twmtEnabled: true,\n\tgaEnabled: true,\n\typaEnabled: false,\n\timgAltEnabled: false\n }, function(items) {\n document.getElementById('titleEnable').checked = items.titleEnabled;\n document.getElementById('metaDescEnable').checked = items.metaDescEnabled;\n\tdocument.getElementById('h1Enable').checked = items.h1Enabled;\n\tdocument.getElementById('h2Enable').checked = items.h2Enabled;\n\tdocument.getElementById('wmtEnable').checked = items.wmtEnabled;\n\tdocument.getElementById('gaEnable').checked = items.gaEnabled;\n\tdocument.getElementById('ypaEnable').checked = items.ypaEnabled;\n\tdocument.getElementById('imgAltEnable').checked = items.imgAltEnabled;\n\tdocument.getElementById('mainDiv').style.display = \"inline\";\n\tdocument.getElementById('loadingDiv').style.display = \"none\";\n });\n}", "function restore_options() {\n var settings = getFromLocalStorage(\"settings\");\n document.getElementById('apply').checked = settings.apply;\n document.getElementById('show').checked = settings.show;\n}", "function restore_options() {\n\n chrome.storage.sync.get({\n colourBlindMode: false,\n hideAOM: false,\n checkCreditBalances: false,\n highlightNegativesNegative: false,\n enableRetroCalculator: true,\n budgetRowsHeight: 0,\n categoryPopupWidth: 0\n }, function(items) {\n document.getElementById('colourBlindMode').checked = items.colourBlindMode;\n document.getElementById('hideAOM').checked = items.hideAOM;\n document.getElementById('checkCreditBalances').checked = items.checkCreditBalances;\n document.getElementById('highlightNegativesNegative').checked = items.highlightNegativesNegative;\n document.getElementById('enableRetroCalculator').checked = items.enableRetroCalculator;\n var budgetRowsHeightSelect = document.getElementById('budgetRowsHeight');\n budgetRowsHeightSelect.value = items.budgetRowsHeight;\n var categoryPopupWidthSelect = document.getElementById('categoryPopupWidth');\n categoryPopupWidthSelect.value = items.categoryPopupWidth;\n });\n}", "function restoreSettings() {\n function setCurrentChoice(result) {\n if(result !== undefined && result.insert !== undefined && result.insert !== \"\"){\n document.getElementById('cmn-toggle-1').checked = result.insert;\n }\n else{\n console.log(\"No Settings Found\");\n return null;\n }\n }\n\n chrome.storage.local.get(\"insert\", setCurrentChoice);\n chrome.storage.local.get(\"lang\", function(result) {\n if(result !== undefined && result.lang !== undefined && result.lang !== \"\") {\n lang = result.lang;\n updateStrings();\n var select = document.getElementById('lang-sel').value = result.lang;\n }\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n settingEnabled: true //default = true\n }, function (items) {\n settingsCheckboxObj.checked = items.settingEnabled;\n });\n}", "function restore_options() {\r\n\tchrome.storage.sync.get({\r\n\t\tcolor: '8AFFFB',\r\n\t\tselector: \"background\",\r\n\t\tdebugOption: false\r\n\t}, function(items) {\r\n\t\t\tif(items.selector == \"link\") {\r\n\t\t\t\tdocument.getElementById(\"link\").checked = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"background\").checked = true;\r\n\t\t\t}\r\n\t\t\tdocument.getElementById('color').value = items.color;\r\n\t\t\tdocument.getElementById('debug').checked = items.debugOption;\r\n\t\t});\r\n}", "function restore_options() {\n $('input:checkbox').click(function() {\n localStorage[this.id] = this.checked;\n chrome.tabs.sendRequest(parseInt(localStorage[\"tabID\"]), {'action' : 'restore_settings'}, function(response) {\n\n });\n show_success();\n if (this.id == 'notifications') {\n $('#mini_player').attr('disabled', !this.checked);\n $('#mini_player').parents('blockquote').toggleClass('disabled');\n }\n });\n $('input:checkbox').each(function(index) {\n if (localStorage[this.id] === undefined && this.id != 'support' && this.id != 'mini_player') {\n // console.log('first run, setting to true');\n localStorage[this.id] = 'false';\n }\n if (localStorage[this.id] == 'true') {\n this.checked = true;\n\n }\n else {\n this.checked = false;\n }\n });\n\n }", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.local.get({\n 'favoriteColor': 'red',\n 'likesColor': true\n }, function(items) {\n document.getElementById('color').value = items.favoriteColor;\n document.getElementById('like').checked = items.likesColor;\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n add_rmp_links: true,\n highlight_easy_classes: true,\n hide_full_classes: false\n }, function(items) {\n document.getElementById('add_rmp_links').checked = items.add_rmp_links;\n document.getElementById('highlight_easy_classes').checked = items.highlight_easy_classes;\n document.getElementById('hide_full_classes').checked = items.hide_full_classes;\n });\n }", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n favoriteColor: 'red',\n likesColor: true,\n\tinstancia: ''\n }, function(items) {\n document.getElementById('color').value = items.favoriteColor;\n document.getElementById('like').checked = items.likesColor;\n\tdocument.getElementById('instancia').value = items.instancia;\n });\n}", "function restore_options() {\n var storageArea = chrome.storage.local;\n storageArea.get(\"keybindings\", function(data) {\n if (!data.keybindings) {\n return;\n }\n choice = data.keybindings;\n var select = document.getElementById(\"keybindings\");\n for (var i = 0; i < select.children.length; i++) {\n var child = select.children[i];\n if (child.value == choice) {\n child.selected = \"true\";\n break;\n }\n }\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n bugBugs: false,\n bugSpiders: true,\n bugMax: 3,\n bugMin: 1,\n bugDelay: 3.5,\n bugOdds: 70\n }, function(items) {\n document.getElementById('bugs').checked = items.bugBugs;\n document.getElementById('spiders').checked = items.bugSpiders;\n document.getElementById('maxnum').value = items.bugMax;\n document.getElementById('minnum').value = items.bugMin;\n document.getElementById('delay').value = items.bugDelay;\n document.getElementById('odds').value = items.bugOdds;\n });\n}", "function restore_options() {\r\n chrome.storage.sync.get({\r\n hideGmailLogo: true,\r\n hideEmail: false,\r\n hideSubject: false,\r\n hideContactDetails: false\r\n }, function(items) {\r\n document.getElementById('hideGmailLogo').checked = items.hideGmailLogo;\r\n document.getElementById('hideEmail').checked = items.hideEmail;\r\n document.getElementById('hideSubject').checked = items.hideSubject;\r\n document.getElementById('hideContactDetails').checked = items.hideContactDetails;\r\n });\r\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n priceDelta: 0.1,\n tangDelta: 0.1,\n isNotifyTop: true,\n isNotifyPump: true,\n isNotifyDumpT: true,\n smallCoinVolume: 10,\n bigCoinVolume: 1000,\n isNotifySmallCoin: true,\n lotsize: 0.1,\n isAutoFillLot: true,\n }, function(items) {\n console.log(\"loaded item\", items)\n document.getElementById('priceDelta').value = items.priceDelta;\n document.getElementById('tangDelta').value = items.tangDelta;\n document.getElementById('isNotifyTop').checked = items.isNotifyTop;\n document.getElementById('isNotifyPump').checked = items.isNotifyPump;\n document.getElementById('isNotifyDumpT').checked = items.isNotifyDumpT;\n document.getElementById('smallCoinVolume').value = items.smallCoinVolume;\n document.getElementById('bigCoinVolume').value = items.bigCoinVolume;\n document.getElementById('isNotifySmallCoin').checked = items.isNotifySmallCoin;\n document.getElementById('lotsize').value = items.lotsize;\n document.getElementById('isAutoFillLot').checked = items.isAutoFillLot;\n });\n}", "function restoreOptions(cb) {\n\tchrome.storage.sync.get({\n\t\temailButton: \"\",\n\t\tminiEmailBtn: false,\n\t\tminiClinicBtn: false,\n\t\tclinicButton: \"\",\n\t\tclinicFeedbackBtn: \"\",\n\t\tminiTicketButton: \"\",\n\t\tminiTakeTicketBtn: \"\",\n\t\tminiSupportPhoneBtn: \"\",\n\t\tminiClientIssueBtn: \"\",\n\t\tdesignTab: false,\n\t\tplaybookTab: \"\",\n\t\todoTheme: null,\n\t\ttips: true,\n\t\tename: \"\",\n\t\tpanels: false,\n\t\tcalmAlerts: true,\n\t\tminPosts: true,\n\t\tloginText: \"\",\n\t\thidePosts: false,\n\t\tblockSpam: true,\n\t\tomniSearch: true,\n\t\tshowQuniTickets: false,\n\t\tshowSIQueue: false,\n\t\tshowTAQueue: false,\n\t\tshow360Queue: false,\n\t\tshowEEQueue: false,\n\t\tshowThemesQueue: false,\n\t\tshowVocQueue: false,\n\t\tshowStatQueue: false,\n\t\tshowIntQueue: false,\n\t\tlikeAndCloseBLC: true,\n\t\tnewBarnaby: true\n\t}, function(items) {\n\t\t$('#EmailButton').prop('checked', items.emailButton);\n\t\t$('#ClinicFeedbackButton').prop('checked', items.clinicFeedbackBtn);\n\t\t$('#MiniEmailButton').prop('checked', items.miniEmailBtn);\n\t\t$('#MiniClinicButton').prop('checked', items.miniClinicBtn);\n\t\t$('#ClinicButton').prop('checked', items.clinicButton);\n\t\t$('#MiniTicketButton').prop('checked', items.miniTicketButton);\n\t\t$('#MiniTakeTicket').prop('checked', items.miniTakeTicketBtn);\n\t\t$('#MiniSupportPhone').prop('checked', items.miniSupportPhoneBtn);\n\t\t$('#MiniClientIssue').prop('checked', items.miniClientIssueBtn);\n\t\t$('#Design').prop('checked', items.designTab);\n\t\t$('#EasterEggs').prop('checked', items.ee);\n\t\t$('#Playbook').prop('checked', items.playbookTab);\n\t\t$('#Theme').val(items.odoTheme);\n\t\t$('#Tips').prop('checked', items.tips);\n\t\t$('#Name').val(items.ename);\n\t\t$('#LoginText').val(items.loginText);\n\t\t$('#Panels').prop('checked', items.panels);\n\t\t$('#greyAlerts').prop('checked', items.calmAlerts);\n\t\t$('#shrinkPosts').prop('checked', items.minPosts);\n\t\t$('#hideSquawkPosts').prop('checked', items.hidePosts);\n\t\t$('#SpamCount').val(items.spamCount);\n\t\t$('#BlockSpam').prop('checked', items.blockSpam);\n\t\t$('#OmniSearch').prop('checked', items.omniSearch);\n\t\t$('#QuniTickets').prop('checked', items.showQuniTickets);\n\t\t$('#SIQueue').prop('checked', items.showSIQueue);\n\t\t$('#TAQueue').prop('checked', items.showTAQueue);\n\t\t$('#360Queue').prop('checked', items.show360Queue);\n\t\t$('#EEQueue').prop('checked', items.showEEQueue);\n\t\t$('#ThemesQueue').prop('checked', items.showThemesQueue);\n\t\t$('#VocQueue').prop('checked', items.showVocQueue);\n\t\t$('#StatQueue').prop('checked', items.showStatQueue);\n\t\t$('#IntQueue').prop('checked', items.showIntQueue);\n\t\t$('#LikeAndCloseBLC').prop('checked', items.likeAndCloseBLC);\n\t\t$('#NewBarnaby').prop('checked', items.newBarnaby);\n\t\tcb();\n\t});\n}", "function restore_options() {\n chrome.storage.local.get(null, function (result) {\n document.getElementById(\"newProductSelection\").selectedIndex = result.newProductCellColorUser;\n if (result.jiraPreviewLiveChecked) {\n document.getElementById('jiraPreviewLiveChecked').checked = true;\n }\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n moodPredict: true,\n recommendedContent: true,\n moodUpdate: 'weekly'\n }, function(items) {\n document.getElementById('moodPredict').checked = items.moodPredict;\n document.getElementById('recommendedContent').checked = items.recommendedContent;\n document.getElementById('moodUpdate').value = items.moodUpdate;\n });\n}", "function restoreSettingValues() {\n browser.storage.local.get()\n .then(function(items) {\n document.getElementById(\"delayBeforeCleanInput\").value = items.delayBeforeClean;\n document.getElementById(\"activeModeSwitch\").checked = items.activeMode;\n\t\tdocument.getElementById(\"statLoggingSwitch\").checked = items.statLoggingSetting;\n document.getElementById(\"showNumberOfCookiesInIconSwitch\").checked = items.showNumberOfCookiesInIconSetting;\n document.getElementById(\"notifyCookieCleanUpSwitch\").checked = items.notifyCookieCleanUpSetting;\n document.getElementById(\"contextualIdentitiesEnabledSwitch\").checked = items.contextualIdentitiesEnabledSetting;\n\n });\n}", "function restore_options() {\n\tchrome.storage.sync.get(['auto_duo'], function (items) {\n\t\t(document.getElementById('auto_duo')).checked = items.auto_duo;\n\t});\n}", "function restore_options() {\n chrome.storage.local.get('default_mode',function(items){\n var mode_ = items['default_mode'];\n if (!mode_) {\n return;\n }\n var select = document.getElementById(\"mode\");\n for (var i = 0; i < select.children.length; i++) {\n var child = select.children[i];\n if (child.value == mode_) {\n child.selected = \"true\";\n break;\n }\n }\n });\n }", "function restore_options() {\r\n chrome.storage.sync.get('options', function(items) {\r\n $('#options').val(JSON.stringify(items.options || options_default, undefined, 4));\r\n });\r\n}", "function restore_options() {\n $(\"input[name=etym][value=\"+localStorage[\"etym\"]+\"]\").attr(\"checked\",true);\n $(\"input[name=click2s][value=\"+localStorage[\"click2s\"]+\"]\").attr(\"checked\",true);\n $(\"input[name=root2note][value=\"+localStorage[\"root2note\"]+\"]\").attr(\"checked\",true);\n $(\"input[name=afx2note][value=\"+localStorage[\"afx2note\"]+\"]\").attr(\"checked\",true);\n $(\"input[name=hide_cn][value=\"+localStorage[\"hide_cn\"]+\"]\").attr(\"checked\",true);\n $(\"input[name=web_en][value=\"+localStorage[\"web_en\"]+\"]\").attr(\"checked\",true);\n var hider=localStorage[\"hider\"]\n if(undefined==hider) hider=[]\n else hider=hider.split(',')\n $(\"input[name=hider]:checkbox\").val(hider)\n}", "function restore_options() {\r\n // Use default value color = 'red' and likesColor = true.\r\n chrome.storage.sync.get({\r\n TimeRefresh: '1',\r\n DeskNotify: true\r\n }, function(items) {\r\n document.getElementById('time').value = items.TimeRefresh;\r\n document.getElementById('desktop').checked = items.DeskNotify;\r\n });\r\n}", "function restore_options() {\n chrome.storage.sync.get({\n isEnabled: true,\n language: \"jp\"\n }, function(items) {\n document.getElementById('enabled').checked = items.isEnabled;\n // Enable for multiple languages\n // document.getElementById('language').value = items.language;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n username: '',\n customGreeting: '',\n customAvatar: '',\n improveUI: true,\n addMarketStats: true\n }, function(items) {\n document.getElementById('username').innerHTML = items.username;\n document.getElementById('customGreeting').value = items.customGreeting;\n document.getElementById('customAvatar').value = items.customAvatar;\n document.getElementById('improveUI').checked = items.improveUI;\n document.getElementById('addMarketStats').checked = items.addMarketStats;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n pages: DEFAULT_PAGES,\n random: DEFAULT_RANDOM\n }, function(items) {\n clean_pages();\n set_pages(items.pages);\n document.getElementById('random').checked = items.random;\n });\n}", "function restoreOptions() {\n chrome.storage.local.get(function (data) {\n //console.warn(JSON.stringify(data));\n $('#block').val(data.blackListBlock);\n $('#completelyTrust').val(data.completelyTrust);\n $('#imagesTrust').val(data.imagesTrust);\n $('#videosTrust').val(data.videosTrust);\n $('#iframesTrust').val(data.iframesTrust);\n $('#downloadsTrust').val(data.downloadsTrust);\n //console.log(\"data.fileTypeTrust: \" + data.fileTypeTrust);\n $.each(data.fileTypeTrust, function () {\n //console.log(\"type: \" + this);\n $(\"input[value='\" + this + \"']\").prop(\"checked\", true);\n });\n $(\"input[name='blockSettings']\").prop(\"checked\", data.blockSettings);\n });\n\n $('#save').click(saveOptions);\n}", "function restore_options() {\n\tchrome.storage.sync.get(\n\t{\n\t\taddress: 'address',\n\t\tport: 'port',\n\t\tlogin: 'login',\n\t\tpassword: 'password'\n\t}, \n\tfunction(items) {\n\t\tdocument.getElementById('address').value = items.address;\n\t\tdocument.getElementById('port').value= items.port;\n\t\tdocument.getElementById('login').value = items.login;\n\t\tdocument.getElementById('password').value= items.password;\n\t});\n}", "function restoreOptions() {\n\tchrome.storage.sync.get(['savedOnce', 'displayType', 'increment', 'contentIsVisible', 'staticView', 'secretMenu'], function(data) {\n\t\tsavedOnce = data.savedOnce;\n\t\tdisplayType = data.displayType;\n\t\tincrement = data.increment;\n\t\tcontentIsVisible = data.contentIsVisible;\n\t\tstaticView = data.staticView;\n\t\tsecretMenu = data.secretMenu;\n\n\t\tif (displayType == \"fill\") { document.getElementById(\"fillRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"fillRadio\").checked=false; }\n\t\tif (displayType == \"hybrid\") { document.getElementById(\"hybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"hybridRadio\").checked=false; }\n\t\tif (displayType == \"none\") { document.getElementById(\"noneRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"noneRadio\").checked=false; }\n\t\tif (displayType == \"yellowHybrid\") { document.getElementById(\"yellowHybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"yellowHybridRadio\").checked=false; }\n\t\tif (displayType == \"blackHybrid\") { document.getElementById(\"blackHybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"blackHybridRadio\").checked=false; }\n\n\t\tif (isNaN(increment)) { document.getElementById(\"incrementField\").value = 50;\n\t\t} else { document.getElementById(\"incrementField\").value = increment;\n\t\t}\n\n\t\tif (contentIsVisible) { \n\t\t\tdocument.getElementById(\"showArticleContentCheckbox\").checked=true;\n\t\t} else { \n\t\t\tdocument.getElementById(\"showArticleContentCheckbox\").checked=false; \n\t\t\thideWikiContent();\n\t\t}\n\n\t\tif (staticView) { \n\t\t\tdocument.getElementById(\"staticViewCheckbox\").checked=true;\n\t\t} else { \n\t\t\tdocument.getElementById(\"staticViewCheckbox\").checked=false; \n\n\t\t\t// If staticView is false, then turn on bind parallax effect to scroll\n\t\t\t$(document).ready(function() {\t\n\t\t\t $(window).bind('scroll',function(e){\n\t\t\t \tscrolled = $(window).scrollTop();\n\t\t\t\t\t// Go through each wikilink...\n\t\t\t\t\tfor (index = 0; index < wikilinks.length; index++) {\n\t\t\t\t\t\tmoveCircles(index);\n\t\t\t\t }\n\t\t\t });\n\t\t\t});\n\n\t\t}\n\n\t\tif (secretMenu) { $(\"#displayChoicesHidden\").css(\"display\",\"inline-block\"); }\n\n\t\t// If settings have never been saved, automatically set fill = true, increment = 50, contentIsVisible = true, staticView = false\n\t\tif (!savedOnce) {\n\t\t\tchrome.storage.sync.set({\"displayType\": \"hybrid\"}, function() {});\n\t\t\tchrome.storage.sync.set({\"increment\": 50}, function() {});\n\t\t\tdisplayType = \"hybrid\";\n\t\t\tdocument.getElementById(\"hybridRadio\").checked=true;\n\t\t\t$(\"#optionsForm\").slideToggle();\n\t\t\tincrement = 50;\n\t\t\tcontentIsVisible = true;\n\t\t\tstaticView = false;\n\t\t} \n\n\t});\n}", "function restoreOptions() {\n // retrieves data saved, if not found then set these to default parameters\n chrome.storage.sync.get({\n color: \"FFEB3B\",\n opac: .5,\n rad: 50,\n trigger: \"F2\",\n\t\ttoggle: true,\n activePage: false\n }, function(items) {\n \t// sets value of the sliders and settings to saved settings\n document.getElementById('trigger').value = items.trigger;\n\n // draws the circle and text preview to loaded preferences\n\t\topacity = items.opac;\n\t\tradius = items.rad;\n\t\thighlight = items.color;\n\t\tcheck = items.toggle;\n\t\t$('#toggle').prop('checked', check);\n\t\tdrawCircle(opacity, radius, highlight);\n });\n}", "function restore_options () {\n\t\tfor ( var i = 0, l = OPTIONS.length; i < l; i++ ) {\n\t\t\tvar o = OPTIONS[ i ].id;\n\t\t\tvar val = localStorage.getItem( o );\n\t\t\tval = val === null ? OPTIONS[ i ].def : val;\n\t\t\tvar element = $( '#' + o );\n\t\t\tif ( typeof val != 'undefined' && element ) {\n\t\t\t\tif ( element.is( 'input[type=checkbox]' ) ) {\n\t\t\t\t\telement.prop( 'checked', !!val );\n\t\t\t\t} else if ( element.is( 'input[type=text]' ) || element.is( 'input[type=password]' ) ) {\n\t\t\t\t\telement.val( val );\n\t\t\t\t} else {\n\t\t\t\t\tthrow 'unknown element: ' + element;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$( '#link_regex' ).prop( 'disabled', !$( '#enable_leftclick' ).prop( 'checked' ) );\n\t\t}\n\t}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n preferredName: '',\n investmentUrl: '',\n donationUrl: ''\n }, function(items) {\n $('#preferred-name').val(items.preferredName)\n $('#investment-url').val(items.investmentUrl)\n $('#donation-url').val(items.donationUrl)\n });\n}", "function restore_options() {\n\tbrowser.storage.sync.get({ sheetIdValue: '', baseUrlValue: '', debugModeValue: ''}).then( (items) => {\n\t\tconsole.log(items);\n\t\tdocument.getElementById('sheet_id').value = items.sheetIdValue;\n\t\tdocument.getElementById(\"base_url\").value = items.baseUrlValue;\n\t\tdocument.getElementById(\"debug_mode\").checked = items.debugModeValue;\n\n\t})\n}", "function restore_options() {\n //Defaults\n chrome.storage.sync.get({\n cardSize: 'medium',\n displayCard: true,\n caseSensitive: true,\n cardMatch: true,\n linkMatch: true,\n deckButton: true\n }, function(items) {\n document.getElementById('card-size').value = items.cardSize;\n document.getElementById('case-sensitive').checked = items.caseSensitive;\n document.getElementById('card-match').checked = items.cardMatch;\n document.getElementById('link-match').checked = items.linkMatch;\n document.getElementById('deck-button').checked = items.deckButton;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n prefixText: '',\n prefixAvailable: false\n }, function(items) {\n document.getElementById('prefix_text').value = items.prefixText\n document.getElementById('prefix_available').checked = items.prefixAvailable\n })\n}", "function restore_options() {\n \n log('restoring options from saved - options:');\n \n chrome.storage.local.get({\n enabled: 'Ready',\n blockStreams: [],\n userSitePreset: [],\n baseInterval: 1,\n sites: [],\n }, (items) => {\n \n write_sites_to_page(items.sites);\n \n //reset other options, too\n log('items.blockStreams',items.blockStreams);\n document.getElementById('block_streams').checked = items.blockStreams;\n document.getElementById('enabled_status').textContent = items.enabled;\n document.getElementById('new_site').value = items.userSitePreset;\n console.log('setting base', items.baseInterval);\n document.getElementById('linkChangeInterval').value = items.baseInterval;\n });\n}", "function restoreOptions () {\n // Use default checked selected = true.\n chrome.storage.sync.get({\n mute: true\n }, function (items) {\n document.querySelector('.ios-switch').checked = items.mute\n })\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n ns_server: '',\n ns_username: \"\",\n ns_password: \"\",\n zd_server: '',\n zd_username: \"\",\n zd_password: \"\"\n }, function(items) {\n document.getElementById('server').value = items.ns_server;\n document.getElementById('username').value = items.ns_username;\n document.getElementById('password').value = items.ns_password;\n document.getElementById('zdserver').value = items.zd_server;\n document.getElementById('zdusername').value = items.zd_username;\n document.getElementById('zdpassword').value = items.zd_password;\n });\n}", "function restoreOptions() {\n chrome.storage.sync.get(['master', 'slave'], function(items) {\n document.getElementById('master').value = items.master || '';\n document.getElementById('slave').value = items.slave || '';\n });\n }", "function restore_options() {\n\n left.value \t= localStorage[\"left\"];\n right.value \t= localStorage[\"right\"];\n tops.value \t= localStorage[\"tops\"];\n bottom.value \t= localStorage[\"bottom\"];\n\n //alert(\"Test\");\n /* var select = document.getElementById(\"color\");\n for (var i = 0; i < select.children.length; i++) {\n var child = select.children[i];\n if (child.value == favorite) {\n child.selected = \"true\";\n break;\n }\n }*/\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n frequency: 'red',\n appearance: 'textImages',\n content: 'Informative Facts',\n category: 'Poaching',\n on: true,\n ads: 0\n }, function(items) {\n document.getElementById('myRange').value = items.frequency;\n setSelectedChbox( document.getElementById('view'),items.appearance);\n setSelectedChbox( document.getElementById('content'),items.content);\n setSelectedChbox( document.getElementById('category'),items.category);\n document.getElementById('earn').innerHTML = \"You have helped donate: \" +items.ads*5 + \" cents!\";\n\n if(items.on){\n document.getElementById(\"onoff\").value = \"Turn Off\";\n } else {\n document.getElementById(\"onoff\").value = \"Turn On\";\n }\n });\n}", "function restore_options() {\n chrome.storage.local.get(['ProgramDate','TicketNumber','ProgramSit'], items => {\n if (items) {\n document.getElementById('ProgramDate').value = items.ProgramDate;\n document.getElementById('ProgramSit').value = items.ProgramSit;\n document.getElementById('TicketNumber').selectedIndex = items.TicketNumber;\n }\n });\n}", "function restore_options() {\n\t//var badgerEndpoint = document.getElementById('badgerEndpoint');\n\tvar opts = {\n transparentArticles: true,\n hideNotAvailable: false,\n\t\tbadgerEndpoint: 'https://o2r.uni-muenster.de/api/1.0/badge/',\n enabled: true\n\t};\n\t//Restore badge settings\n\tfor(var i = 0; i < BadgeTypes.length; i++) {\n\t\tvar key = BadgeTypes[i].key;\n\t\t\n\t\topts[key + 'Badge'] = true;\n\t\t\n\t\tvar checkboxes = document.getElementById('checkboxes');\n\t\tcheckboxes.innerHTML += '<input type=\"checkbox\" id=\"' + key + '\" name=\"' + key + '\" /> <label for=\"' + key + '\">' + BadgeTypes[i].value + '</label><br>';\n\t}\n\t//Restore ERC button settings\n\tfor(var i = 0; i < RepositoryTypes.length; i++) {\n\t\tvar key = RepositoryTypes[i].key;\n\t\t\n\t\topts[key + 'Repository'] = true;\n\t\t\n\t\tvar ercCheckboxes = document.getElementById('ercCheckboxes');\n\t\tercCheckboxes.innerHTML += '<input type=\"checkbox\" id=\"' + key + '\" name=\"' + key + '\" /> <label for=\"' + key + '\">' + RepositoryTypes[i].value + '</label><br>';\n\t}\n\tchrome.storage.sync.get(opts, function (items) {\n\t\tfor(var i = 0; i < BadgeTypes.length; i++) { //Badges\n\t\t\tvar key = BadgeTypes[i].key;\n\t\t\tdocument.getElementById(key).checked = items[key + 'Badge'];\n\t\t}\t\n\t\tfor(var i = 0; i < RepositoryTypes.length; i++) { //Repositories\n\t\t\tvar key = RepositoryTypes[i].key;\n\t\t\tdocument.getElementById(key).checked = items[key + 'Repository'];\n\t\t}\n\t\tdocument.getElementById('transparentArticles').checked = items.transparentArticles;\n\t\tdocument.getElementById('hideNotAvailable').checked = items.hideNotAvailable;\n\t\tdocument.getElementById('badgerEndpoint').value = items.badgerEndpoint;\n\t\tdocument.getElementById('globalEnable').checked = items.enabled;\n\t});\n}", "function restore_options() {\n var q = $.Deferred();\n // Use default value color = 'red' and likesColor = true.\n var flat_options_list = key_list();\n\n chrome.storage.sync.get(flat_options_list, function(options) {\n $.each(options,function(idx,option){\n var two_part = idx.split(':::');\n options_defaults[two_part[0]].options[two_part[1]].value = option;\n });\n q.resolve();\n });\n return q;\n}", "function restore_options() {\n var opt = this\n chrome.storage.sync.get({\n syncVolume: true,\n saveVolume: true\n }, function(items) {\n document.getElementById('saveVol').checked = items.saveVolume; \n document.getElementById('syncVol').checked = items.syncVolume;\n if(items.saveVolume == false) {\n document.getElementById('syncVol').checked = false;\n document.getElementById('syncVol').disabled = true;\n document.getElementById('syncVolSpan').style.opacity = 0.6;\n } else {\n document.getElementById('syncVol').disabled = false;\n document.getElementById('syncVolSpan').style.opacity = 1;\n }\n\n // If it's a first time visit, then these values will not already be set. So, set them.\n opt.save_options();\n\n });\n}", "function restoreOptions() {\n chrome.storage.local.get('chromeNotifications',function(data){\n document.getElementById(\"chromeNotifications\").checked=data.chromeNotifications;\n });\n}", "function save_options() {\n// var select = document.getElementById(\"color\");\n// var color = select.children[select.selectedIndex].value;\n// localStorage[\"favorite_color\"] = color;\n \t\n \tfor( i in pOptions){\n \t\tif(typeof(pOptions[i].def)=='boolean')\n \t\t\tlocalStorage[i] = document.getElementById(i).checked;\n \t\telse\n \t\t\tlocalStorage[i] = document.getElementById(i).value;\n \t}\n\t\n\t\n\t//localStorage[\"hqthumbs\"] = document.getElementById(\"hqthumbs\").checked;\n\t//localStorage[\"showCurrentTab\"] = document.getElementById(\"showCurrentTab\").checked;\n\t//localStorage[\"maxhistory\"] = document.getElementById(\"maxhistory\").value;\n\t\n\t\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n Cr.empty(status).appendChild(Cr.txt(\"Options Saved.\"));\n setTimeout(function() {\n Cr.empty(status);\n }, 750);\n \n chrome.runtime.sendMessage({greeting: \"reloadprefs\"}, function(response) { });\n}", "function restore_options() {\n\n forEachField(function(id){\n\n val = localStorage[id];\n $('#' + id).val(val);\n\n });\n\n}", "function restore_options() {\r\n\tchrome.storage.sync.get({\r\n\t\ttabsBehavior: 'new',\r\n\t\tsortBehavior: 'alpha',\r\n\t\tshowRecentBehavior: true,\r\n\t\trecentItemCount: 3,\r\n\t\trecentExclude: false,\r\n\t\texcludeFolders: new Array(),\r\n\t}, function(items) {\r\n\t\tdocument.getElementById('tabs').value = items.tabsBehavior;\r\n\t\tdocument.getElementById('sort').value = items.sortBehavior;\r\n\t\tdocument.getElementById('show_recent').checked = items.showRecentBehavior;\r\n\t\tdocument.getElementById('recent_count').value = items.recentItemCount;\r\n\t\tdocument.getElementById('recent_exclude').checked = items.recentExclude;\r\n\t\r\n\t\tvar exclude_checks = document.getElementById('exclude-folder-list').getElementsByClassName('exclude-checkbox');\r\n\t\tif(items.excludeFolders) {\r\n\t\t\t[].forEach.call(exclude_checks, function (el) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar folder_id = el.id.match(/\\[(\\d+)\\]/i)[1];\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(items.excludeFolders.indexOf(folder_id) != -1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tel.checked = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t}\r\n\t\tif(items.showRecentBehavior) {\r\n\t\t\tdocument.getElementById('recent_count_div').style.visibility = 'visible';\r\n\t\t}\r\n\t\r\n\t});\r\n}", "function restore_options() {\n\tchrome.storage.sync.get({\n\t\tsourceUrl: '',\n\t\tincludeInvestors: false\n\t}, function(items) {\n\n\t\tif (items.sourceUrl) {\n\t\t\tdocument.getElementById('sourceUrl').value = items.sourceUrl;\n\t\t}\n\t\tdocument.getElementById('includeInvestors').checked = items.includeInvestors;\n\t});\n}", "function restoreOptions() {\r\n try {\r\n var api = chrome || browser;\r\n api.storage.sync.get(null, (res) => {\r\n document.querySelector(\"#voice\").value = res.voice || getFirstVoice();\r\n document.querySelector(\"#speed\").value = res.speed || 1;\r\n document.querySelector(\"#pitch\").value = res.pitch || 1;\r\n document.querySelector(\"#colorBackground\").value =\r\n res.colorBackground || \"light\";\r\n restoreColor();\r\n document.querySelector(\"#fontSize\").value = res.fontSize || \"medium\";\r\n\t restoreFontSize();\r\n if (\r\n res.experimentalMode &&\r\n res.definiteArticleCheck &&\r\n res.definiteArticleColor\r\n ) {\r\n colorDefiniteArticles(res.definiteArticleColor);\r\n }\r\n if (\r\n res.experimentalMode &&\r\n res.indefiniteArticleCheck &&\r\n res.indefiniteArticleColor\r\n ) {\r\n colorIndefiniteArticles(res.indefiniteArticleColor);\r\n }\r\n if (res.experimentalMode && res.eclipseMode) {\r\n eclipseMode();\r\n }\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}", "function restore_options() {\n // Use default value autoForward = false.\n chrome.storage.sync.get({\n autoForward: false, \n clubId: 4787\n }, function(items) {\n document.getElementById('autoForward').checked = items.autoForward;\n document.getElementById('clubId').value = items.clubId;\n });\n}", "function restore_options() {\n\tchrome.storage.sync.get({\n\t\tunicornImage: 'https://i.imgur.com/XeEii4X.png',\n\t\tunicornAdd: 'u',\n\t\tunicornClear: 'c'\n\t}, function(settings) {\n\t\tdocument.getElementById('unicorn-img-setting').value = settings.unicornImage;\n\t\tdocument.getElementById('unicorn-add-setting').value = settings.unicornAdd;\n\t\tdocument.getElementById('unicorn-clear-setting').value = settings.unicornClear;\n\t});\n}", "function restore_options(storageName, elementId) {\n var favorite = localStorage[storageName];\n if (!favorite) {\n return;\n }\n var select = document.getElementById(elementId);\n for (var i = 0; i < select.children.length; i++) {\n var child = select.children[i];\n if (child.value == favorite) {\n child.selected = \"true\";\n break;\n }\n }\n}", "function restore_options() {\n chrome.storage.sync.get({\n apiKey: 'a4bc2b1cb23bce56eddd44',\n sandBox: true,\n }, function(items) {\n document.getElementById('apikey').value = items.apiKey;\n document.getElementById('sandbox').checked = items.sandBox;\n });\n}", "function restore_options() {\n\tconsole.log(\"Params loaded\");\n chrome.storage.sync.get({\n prohibited: \"\"\n }, function(items) {\n document.getElementById('prohibited').value = items.prohibited;\n });\n}", "function restore_options() {\n chrome.storage.sync.get(['lang'], function (result) {\n let lang = result.lang;\n if (lang !== undefined) {\n document.querySelector(\"select#country\").value = lang;\n let elems = document.querySelectorAll('select');\n let instances = M.FormSelect.init(elems);\n }\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.local.get({\n newTab: false,\n buttonText: 'shortName',\n\n googleButton: true,\n youtubeButton: true,\n googleImagesButton: true,\n googleMapsButton: true,\n googleTranslateButton: true,\n dictionaryButton: true,\n wikipediaButton: true,\n googleNewsButton: false,\n hackerNewsButton: false,\n facebookButton: false,\n twitterButton: false,\n imdButton: false,\n bingButton: false,\n githubButton: false,\n stackOverflowButton: false,\n redditButton: false,\n amazonButton: false,\n piratebayButton: false,\n avaxhomeButton: false,\n rarbgButton: false,\n\n duckDuckGoLink: false,\n googleLink: true,\n youtubeLink: true,\n googleImagesLink: true,\n googleMapsLink: true,\n googleTranslateLink: true,\n dictionaryLink: true,\n googleNewsLink: true,\n wikipediaLink: true,\n hackerNewsLink: false,\n facebookLink: false,\n twitterLink: false,\n imdLink: false,\n bingLink: false,\n githubLink: false,\n stackOverflowLink: false,\n redditLink: false,\n amazonLink: false,\n piratebayLink: false,\n avaxhomeLink: false,\n rarbgLink: false\n\n\n }, function(items) {\n document.getElementById('newTab').checked = items.newTab;\n document.getElementById('buttonText').value = items.buttonText;\n\n document.getElementById('googleButton').checked = items.googleButton;\n document.getElementById('youtubeButton').checked = items.youtubeButton;\n document.getElementById('googleImagesButton').checked = items.googleImagesButton;\n document.getElementById('googleMapsButton').checked = items.googleMapsButton;\n document.getElementById('googleTranslateButton').checked = items.googleTranslateButton;\n document.getElementById('dictionaryButton').checked = items.dictionaryButton;\n document.getElementById('googleNewsButton').checked = items.googleNewsButton;\n document.getElementById('hackerNewsButton').checked = items.hackerNewsButton;\n document.getElementById('facebookButton').checked = items.facebookButton;\n document.getElementById('twitterButton').checked = items.twitterButton;\n document.getElementById('wikipediaButton').checked = items.wikipediaButton;\n document.getElementById('imdButton').checked = items.imdButton;\n document.getElementById('bingButton').checked = items.bingButton;\n document.getElementById('githubButton').checked = items.githubButton;\n document.getElementById('stackOverflowButton').checked = items.stackOverflowButton;\n document.getElementById('redditButton').checked = items.redditButton;\n document.getElementById('amazonButton').checked = items.amazonButton;\n document.getElementById('piratebayButton').checked = items.piratebayButton;\n document.getElementById('avaxhomeButton').checked = items.avaxhomeButton;\n document.getElementById('rarbgButton').checked = items.rarbgButton;\n\n document.getElementById('duckDuckGoLink').checked = items.duckDuckGoLink;\n document.getElementById('googleLink').checked = items.googleLink;\n document.getElementById('youtubeLink').checked = items.youtubeLink;\n document.getElementById('googleImagesLink').checked = items.googleImagesLink;\n document.getElementById('googleMapsLink').checked = items.googleMapsLink;\n document.getElementById('googleTranslateLink').checked = items.googleTranslateLink;\n document.getElementById('dictionaryLink').checked = items.dictionaryLink;\n document.getElementById('googleNewsLink').checked = items.googleNewsLink;\n document.getElementById('hackerNewsLink').checked = items.hackerNewsLink;\n document.getElementById('facebookLink').checked = items.facebookLink;\n document.getElementById('twitterLink').checked = items.twitterLink;\n document.getElementById('wikipediaLink').checked = items.wikipediaLink;\n document.getElementById('imdLink').checked = items.imdLink;\n document.getElementById('bingLink').checked = items.bingLink;\n document.getElementById('githubLink').checked = items.githubLink;\n document.getElementById('stackOverflowLink').checked = items.stackOverflowLink;\n document.getElementById('redditLink').checked = items.redditLink;\n document.getElementById('amazonLink').checked = items.amazonLink;\n document.getElementById('piratebayLink').checked = items.piratebayLink;\n document.getElementById('avaxhomeLink').checked = items.avaxhomeLink;\n document.getElementById('rarbgLink').checked = items.rarbgLink;\n\n });\n}", "function restore_options() {\r\n chrome.storage.sync.get({\r\n hostname: 'localhost',\r\n port_number: 8888,\r\n debug_mode: false\r\n }, (items) => {\r\n document.getElementById('hostname').value = items.hostname;\r\n document.getElementById('port-number').value = items.port_number;\r\n document.getElementById('debug-mode').checked = items.debug_mode;\r\n });\r\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({ settings: \n {\n targethost: '127.0.0.1',\n targetport: '9666',\n targetproto: 'http',\n targetuser: \"\",\n targetpasswd: \"\"\n\n }\n }, function(storage) {\n console.log(storage.settings)\n document.getElementById('targethost').value = storage.settings.targethost;\n document.getElementById('targetport').value = parseInt(storage.settings.targetport);\n document.getElementById('targetproto').value = storage.settings.targetproto;\n document.getElementById('targetuser').value = storage.settings.targetuser;\n document.getElementById('targetpasswd').value = storage.settings.targetpasswd;\n });\n}", "function restore_options() {\n\t// get options, or return default values if not set\n\tchrome.storage.sync.get(bb_values.default_options, function (items) {\n\t\tdocument.getElementById(\"forum_view\").value = items.forum_view;\n\t\tdocument.getElementById(\"blackboard_domains\").value = items.blackboard_domains.join(\"\\n\");\n\t});\n}", "function restore_options() {\n if ( window.localStorage.username != undefined )\n document.getElementById(\"username\").value = window.localStorage.username;\n\n if ( window.localStorage.url != undefined ) {\n document.getElementById(\"url\").value = window.localStorage.url;\n }\n\n if ( window.localStorage.refresh != undefined ) {\n document.getElementById(\"refresh\").value = window.localStorage.refresh;\n } else {\n document.getElementById(\"refresh\").value = 30;\n }\n\n if ( window.localStorage.ignoreServicesRegexp != undefined ) {\n document.getElementById(\"ignoreServicesRegexp\").value = window.localStorage.ignoreServicesRegexp;\n }\n\n if ( window.localStorage.dateFormat != undefined && window.localStorage.dateFormat != '' ) {\n document.getElementById(\"dateFormat\").value = window.localStorage.dateFormat;\n } else {\n document.getElementById(\"dateFormat\").value = \"DD-MM-YYYY hh:mm:ss\";\n }\n\n if ( window.localStorage.ignoreHostsRegexp != undefined ) {\n document.getElementById(\"ignoreHostsRegexp\").value = window.localStorage.ignoreHostsRegexp;\n }\n\n document.getElementById(\"ignoreCaseSensitivity\").checked = (window.localStorage.ignoreCaseSensitivity === \"false\") ? false : true;\n\n document.getElementById(\"hideAcked\").checked = (window.localStorage.hideAcked === \"true\") ? true : false;\n document.getElementById(\"hideDowntimeed\").checked = (window.localStorage.hideDowntimeed === \"true\") ? true : false;\n}", "function restoreOptions() {\n // Default values.\n chrome.storage.sync.get({\n dailyTasks: [],\n startOfDay: 480,\n endOfDay: 0,\n leeway: 100,\n shortEventDuration: 30,\n transitionTime: 10,\n blink: true,\n colorR: 255,\n colorG: 0,\n colorB: 0\n }, function(items) {\n restoreDailyTasks(items.dailyTasks);\n $(INPUT_START_OF_DAY_SELECTOR).val(minutesToTimeString(items.startOfDay));\n $(INPUT_END_OF_DAY_SELECTOR).val(minutesToTimeString(items.endOfDay));\n $(INPUT_LEEWAY_SELECTOR).val(items.leeway);\n $(INPUT_SHORT_EVENT_DURATION_SELECTOR).val(items.shortEventDuration);\n $(INPUT_TRANSITION_TIME_SELECTOR).val(items.transitionTime);\n $(INPUT_BLINK_SELECTOR).prop('checked', items.blink);\n $(INPUT_COLOR_R).val(items.colorR);\n $(INPUT_COLOR_G).val(items.colorG);\n $(INPUT_COLOR_B).val(items.colorB);\n });\n}", "function restore_options() {\n // restore options for popupDisplay\n var selection = localStorage[\"popupDisplayOption\"];\n var radios = document.popupOptionsForm.tabCountRadios;\n if (!selection) {\n document.getElementById(\"defaultPopupSelection\").checked = true;\n }\n for (var i = 0; i < radios.length; i++) {\n if (radios[i].value == selection) {\n radios[i].checked = true;\n }\n }\n\n // restore options for tabDedupe\n document.getElementById(\"tabDedupe\").checked = Boolean(localStorage[\"tabDedupe\"]);\n\n // Restore tab janitor options.\n document.getElementById(\"tabJanitor\").checked = Boolean(localStorage[\"tabJanitor\"]);\n document.getElementById(\"tabJanitorDays\").value = localStorage[\"tabJanitorDays\"] || 5;\n\n}", "function restore_options() {\n showContent(0);\n\n for (var i in boolIdArray) {\n var id = boolIdArray[i];\n var value = localStorage[\"gc_\" + id];\n\n if (value == \"true\") {\n var element = document.getElementById(id);\n element.checked = true;\n }\n\n console.log(\"restored: \" + id + \" as \" + value);\n }\n\n spawnIconRow(\"set1\", \"Default\");\n spawnIconRow(\"set2\", \"Default Grey\");\n spawnIconRow(\"set3\", \"Default White\");\n spawnIconRow(\"set11\", \"Native\");\n spawnIconRow(\"set12\", \"Native Grey\");\n spawnIconRow(\"set8\", \"Gmail Glossy\");\n spawnIconRow(\"set9\", \"Gmail Mini\");\n spawnIconRow(\"set10\", \"Gmail Monochrome\");\n spawnIconRow(\"set4\", \"Alternative 1\");\n spawnIconRow(\"set5\", \"Alternative 2\");\n spawnIconRow(\"set6\", \"Chromified Classic\");\n spawnIconRow(\"set7\", \"Chromified Grey\");\n\n var iconRadios = document.forms[0].icon_set;\n var iconFound = false;\n for (var i in iconRadios) {\n if (iconRadios[i].value == localStorage[\"gc_icon_set\"]) {\n iconRadios[i].checked = true;\n iconFound = true;\n break;\n }\n }\n if (!iconFound) {\n iconRadios[0].checked = true;\n }\n\n var previewRadios = document.forms[0].preview_setting;\n for (var i in previewRadios) {\n if (previewRadios[i].value == localStorage[\"gc_preview_setting\"]) {\n previewRadios[i].checked = true;\n break;\n }\n }\n\n if (localStorage[\"gc_poll\"] != null) {\n document.getElementById(\"poll_\" + localStorage[\"gc_poll\"]).selected = true;\n }\n\n accounts = localStorage.getObject(\"gc_accounts\");\n if (accounts == null) {\n accounts = new Array();\n }\n\n var langSel = document.getElementById(\"languages\");\n for (var i in languages) {\n langSel.add(new Option(languages[i].what, languages[i].id), languages[i].id);\n }\n langSel.value = localStorage[\"gc_language\"];\n\n sortlist(langSel);\n\n var acc_sel = document.getElementById(\"accounts\");\n for (var i in accounts) {\n if (accounts[i] == null || accounts[i].domain == null)\n break;\n acc_sel.add(new Option(accounts[i].domain), null);\n }\n\n //chrome.extension.getBackgroundPage().getLabels(\"https://mail.google.com/mail/\", loadLabels);\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get(['takeoverEnabled'], function(items) {\n console.log(items.takeoverEnabled);\n document.getElementById('always_noise').checked = items.takeoverEnabled;\n });\n}", "function restore_options() {\n chrome.storage.local.get({\n username: '',\n password: ''\n }, function(options) {\n document.getElementById('username').value = options.username;\n document.getElementById('password').value = options.password;\n });\n}", "function restoreSettings() {\n \n $(\"#quality_input\").val(settings.quality).slider(\"refresh\");\n $(\"#width_input\").val(settings.targetWidth).slider(\"refresh\");\n $(\"#height_input\").val(settings.targetHeight).slider(\"refresh\");\n \n if (settings.allowEdit) {\n $(\"#edit_input\").attr(\"checked\", true).checkboxradio(\"refresh\");\n } else {\n $(\"#edit_input\").removeAttr(\"checked\").checkboxradio(\"refresh\");\n }\n \n if (settings.correctOrientation) {\n $(\"#orient_input\").attr(\"checked\", true).checkboxradio(\"refresh\");\n } else {\n $(\"#orient_input\").removeAttr(\"checked\").checkboxradio(\"refresh\"); \n }\n \n var saveSwitch = $(\"#save_input\");\n saveSwitch[0].selectedIndex = ((settings.saveToPhotoAlbum === true) ? 1 : 0);\n saveSwitch.slider(\"refresh\");\n \n $(\"#encod_input\").val(settings.encodingType).selectmenu(\"refresh\");\n $(\"#media_input\").val(settings.mediaType).selectmenu(\"refresh\");\n}", "function restore_options() {\n if (common.options.getRSSChannels()) {\n var rss_channels_config = JSON.parse(common.options.getRSSChannels());\n Object.keys(rss_channels_config).forEach(function (key) {\n document.getElementById(key).checked = (rss_channels_config[key] === \"true\");\n });\n }\n document.getElementById(common.storageKey.showLastItems).value = common.options.getShowLastItems();\n document.getElementById(common.storageKey.updatePeriod).value = common.options.getUpdatePeriod();\n document.getElementById(common.storageKey.windowWidth).value = common.options.getWindowWith();\n}", "function restore_options() {\n $(\"#theme\").val(\"blue\");\n $(\"#font_size\").val(\"0.9em\");\n $(\"#popup_width\").val(\"610\");\n $(\"#popup_height\").val(\"620\");\n $(\"#bookmark_url\").val(\"http://www.google.com/bookmarks/\");\n $(\"#sig_url\").val(\"http://www.google.com/bookmarks/find\");\n}", "function restore_options() {\n // Use default values.\n chrome.storage.sync.get({\n openInNewTab: false, \n authorURL:'localhost:4502',\n publishURL:'localhost:4503',\n liveURL:'https://www.example.com', \n siteRootPath:'/content/aem-ninja',\n languagemastersPath:'/content/aem-ninja/language-masters/en',\n languagePath:'/content/aem-ninja/en-us',\n languagecodelength: '4',\n showStage: false,\n stageAuthorURL: 'https://localhost:4502',\n stagePublishURL: 'https://localhost:4503',\n stageLiveURL: 'https://stage.example.com' }, function(items) {\n document.getElementById('openInNewTab').checked = items.openInNewTab; \n document.getElementById('authorURL').value = items.authorURL;\n document.getElementById('publishURL').value=items.publishURL;\n document.getElementById('liveURL').value=items.liveURL; \n document.getElementById('siteRootPath').value=items.siteRootPath;\n document.getElementById('languagemastersPath').value=items.languagemastersPath;\n document.getElementById('languagePath').value=items.languagePath;\n document.getElementById('languagecodelength').value=items.languagecodelength;\n document.getElementById('showStage').checked=items.showStage;\n document.getElementById('stageAuthorURL').value=items.stageAuthorURL;\n document.getElementById('stagePublishURL').value=items.stagePublishURL;\n document.getElementById('stageLiveURL').value=items.stageLiveURL;\n \n showstageOptions();\n });\n}", "function restore_options() {\n chrome.storage.sync.get(tcDefaults, function(storage) {\n updateShortcutInputText('popKeyInput', storage.popKeyCode);\n });\n}", "function restoreOptions() {\n\tvar getting = browser.storage.local.get(SETTINGS_KEY.DEFAULTS);\n\tgetting.then((result) => {\n\t\tconsole.debug(JSON.parse(JSON.stringify(result)));\n\t\tif (result[SETTINGS_KEY.DEFAULTS]) {\n\t\t\tlet width = result[SETTINGS_KEY.DEFAULTS][SETTINGS_KEY.DEFAULT_MAX_WIDTH];\n\t\t\tlet enabled = result[SETTINGS_KEY.DEFAULTS][SETTINGS_KEY.DEFAULT_ENABLED];\n\t\t\tpopulateUI(width, enabled);\n\t\t} else {\n\t\t\tcallWithStorageDefaults(populateUI);\n\t\t}\n\t});\n}", "function restore_options() {\r\n console.debug(\"options restore_options function\");\r\n console.debug(localStorage[\"favorite_color\"]);\r\n var favorite = localStorage[\"favorite_color\"];\r\n if (!favorite) {\r\n return;\r\n }\r\n var select = document.getElementById(\"color\");\r\n for (var i = 0; i < select.children.length; i++) {\r\n var child = select.children[i];\r\n if (child.value == favorite) {\r\n child.selected = \"true\";\r\n break;\r\n }\r\n }\r\n}", "function restoreOptions() {\n\n var getting = browser.storage.local.get(\"currency\");\n getting.then(setCurrentChoice, onError);\n\n function setCurrentChoice(result) {\n document.querySelector(\"#currency\").value = result.currency || \"USD\";\n }\n\n function onError(error) {\n console.log(`Error: ${error}`);\n }\n}", "function restore_options() {\n chrome.storage.sync.get({\n publicKey: 'none',\n privateKey: 'none',\n passphrase: 'none',\n type: 'no'\n }, function(items) {\n document.getElementById('extcrypt-publicKey').value = items.publicKey;\n document.getElementById('extcrypt-privateKey').value = items.privateKey;\n document.getElementById('extcrypt-passphrase').value = items.passphrase;\n document.getElementById('extcrypt-select').value = items.type;\n });\n}", "function restore_options() {\r\n // Use default value keywords = 'none'.\r\n chrome.storage.sync.get({\r\n keywords: '',\r\n }, function(items) {\r\n document.getElementById('keywords').value = items.keywords;\r\n });\r\n}", "function restore_options() {\n chrome.storage.local.get(null, function(items) {\n const fetchedValues = Object(items);\n document.querySelector(\"#localserverid\").value = fetchedValues.local_server_id || null;\n document.querySelector(\"#remoteserverid\").value = fetchedValues.remote_server_id || DEFAULT_MYOPENHAB_URL;\n document.querySelector(\"#pathid\").value = fetchedValues.path_id || DEFAULT_PATH;\n document.querySelector(\"#widthid\").value = fetchedValues.width_id || DEFAULT_WIDTH;\n document.querySelector(\"#heightid\").value = fetchedValues.height_id || DEFAULT_HEIGHT;\n });\n}", "function restore_options() {\n if (typeof save === \"undefined\") {\n save = true;\n }\n\n if (typeof warn === \"undefined\") {\n warn = true;\n }\n\n if (typeof modify === \"undefined\") {\n modify = true;\n }\n\n if (typeof keyCommand === \"undefined\") {\n keyCommand = 69;\n }\n\n keyString.value = stringFromCharCode(keyCommand);\n keyValue.value = keyCommand;\n\n if (warn === \"true\") {\n warnYes.checked = true;\n } else {\n warnNo.checked = true;\n }\n\n if (save === \"true\") {\n saveYes.checked = true;\n } else {\n saveNo.checked = true;\n }\n\n if (modify === \"true\") {\n modifyYes.checked = true;\n } else {\n modifyNo.checked = true;\n }\n}", "function restore_options() {\t\n // Use default value badge = 'contact' and likesBadge = true.\n\tchrome.storage.local.get({\n\t\tfavoriteBadge: 'Contact',\n\t\tlikesBadge: true\n\t}, function(items) {\n\t\tdocument.getElementById('badge').value = items.favoriteBadge;\n\t\tdocument.getElementById('like').checked = items.likesBadge;\n\t\tvar chosenoption2 = items.favoriteBadge;\n\t\t//console.log('log: options='+chosenoption2);\n\t\tvar detail = document.getElementById('detail');\n\t\tif (chosenoption2 == \"none\"){\t \n\t\t\tdetail.textContent = '* Badge is Off.';\n\t\t}else if (chosenoption2 == \"contact\"){\n\t\t\tdetail.textContent = '* Show number of contact send new chat to you.';\n }else if (chosenoption2 == \"icontact\"){\n\t\t\tdetail.textContent = '* Show number of contact send new chat to you (inside icon). *This option is beta.';\n\t\t}else if (chosenoption2 == \"total\"){\n\t\t\tdetail.textContent = '* Show the total number of messages. (Next ver.)';\n\t\t}else {\n\t\t\tdetail.textContent = \"* First (Empty) default is 'Contacts'.\";\n\t\t}\n });\n \n}", "function restoreOptions() {\n\tdocument.getElementById(\"mail\").value = chrome.extension.getBackgroundPage().settings.getMail();\n\tdocument.getElementById(\"url\").value = chrome.extension.getBackgroundPage().settings.getURL();\n\tdocument.getElementById(\"contextMenu\").checked = chrome.extension.getBackgroundPage().settings.isContextMenu();\n\tdocument.getElementById(\"insertIntoPage\").checked = chrome.extension.getBackgroundPage().settings.isInsertIntoPage();\n\tdocument.getElementById(\"copyToClipboard\").checked = chrome.extension.getBackgroundPage().settings.isCopyToClipboard();\n\tdocument.getElementById(\"dateFormat\").value = chrome.extension.getBackgroundPage().settings.getDateFormat();\n }", "function saveOptions() {\n chrome.storage.sync.set(\n {\n translateHeadings: document.getElementById('selectorH').checked,\n translateParagraphs: document.getElementById('selectorP').checked,\n translateOthers: document.getElementById('selectorOthers').checked,\n }, function () {\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function () {\n status.textContent = '';\n }, 2000);\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n username: '',\n password: ''\n }, function(items) {\n document.getElementById('username').value = items.username;\n document.getElementById('password').value = items.password;\n });\n}", "function restore_options() {\n var favorite = localStorage[\"favorite_class\"];\n if (!favorite) {\n return;\n }\n var select = document.getElementById(\"trida\");\n for (var i = 0; i < select.children.length; i++) {\n var child = select.children[i];\n if (child.value == favorite) {\n child.selected = \"true\";\n break;\n }\n }\n}", "function restore_options() {\n\tchrome.storage.sync.get({\n\t\tname: '',\n\t\temail: '',\n\t\tphone: '',\n\t\taddress: '',\n\t\taddress2: '',\n\t\taddress3: '',\n\t\tcity: '',\n\t\tzip: '',\n\t\tstate: '',\n\t\tprefecture: '',\n\t\tcountry: '',\n\n\t\tcard_type: '',\n\t\tcard_no: '',\n\t\texpiry_month: '',\n\t\texpiry_year: '',\n\t\tcvv: '',\n\t\talt_size: '',\n\t\tany_size: '',\n\t\tautoco: '',\n\t\ttryagain: '',\n\t\tbypass: '',\n\t\tdelay: '',\n\n\t\tkw_enabled: '',\n\t\tar_enabled: '',\n\t\tstart_time: '',\n\t\tcategory: '',\n\t\tkeywords: '',\n\t\tcolour: '',\n\t\tsize: '',\n\t\tqueue: [],\n\t\treport: '',\n\t\tproxy: '',\n\t\tproxy_enabled: '',\n\t\t//tc_accepted: ''\n\t}, \n\tfunction(items) {\n\t\tdocument.getElementById(\"log-out\").innerText = JSON.stringify(items.report, null, 2);\n\t\t$(\"#changelog-out\").load(\"CHANGELOG\");\n\n\t\tdocument.getElementById('name').value = items.name;\n\t\tdocument.getElementById(\"email\").value = items.email;\n\t\tdocument.getElementById(\"phone\").value = items.phone;\n\t\tdocument.getElementById(\"address\").value = items.address;\n\t\tdocument.getElementById(\"address2\").value = items.address2;\n\t\tdocument.getElementById(\"address3\").value = items.address3;\n\t\tdocument.getElementById(\"city\").value = items.city;\n\t\tdocument.getElementById(\"zip\").value = items.zip;\n\t\tdocument.getElementById(\"state\").value = items.state;\n\t\tdocument.getElementById(\"prefecture\").value = items.prefecture;\n\t\tdocument.getElementById(\"country\").value = items.country;\n\n\t\tdocument.getElementById(\"card_type\").value = items.card_type;\n\t\tdocument.getElementById(\"card_no\").value = items.card_no;\n\t\tdocument.getElementById(\"expiry_month\").value = items.expiry_month;\n\t\tdocument.getElementById(\"expiry_year\").value = items.expiry_year;\n\t\tdocument.getElementById(\"cvv\").value = items.cvv;\n\t\tdocument.getElementById(\"alt-size\").value = items.alt_size;\n\t\tdocument.getElementById(\"any_size\").checked = items.any_size;\n\t\tdocument.getElementById(\"autoco\").checked = items.autoco;\n\t\tdocument.getElementById(\"tryagain\").checked = items.tryagain;\n\t\tdocument.getElementById(\"delay\").value = items.delay;\n\t\tdocument.getElementById(\"delay_text\").innerText = items.delay + \" seconds\";\n\n\t\tdocument.getElementById(\"kw_enabled\").checked = items.kw_enabled;\n\t\tdocument.getElementById(\"ar_enabled\").checked = items.ar_enabled;\n\t\tdocument.getElementById(\"start_time\").value = items.start_time;\n\t\tdocument.getElementById(\"category\").value = items.category;\n\t\tdocument.getElementById(\"keywords\").value = items.keywords;\n\t\tdocument.getElementById(\"colour\").value = items.colour;\n\t\tdocument.getElementById(\"size\").value = items.size;\n\n\t\tqueue_list = items.queue;\n\t\tfor (item in items.queue) {\n\t\t\t$('#queue-list').append($('<li class=\"list-group-item shopping-item\">').html(items.queue[item][0]+\": \"+items.queue[item][1]+\" - \"+items.queue[item][2]+\" (\"+items.queue[item][3]+\") <p class=\\\"delete-hint\\\">delete</p>\"));\n\t\t}\n\n\t\tif (items.kw_enabled) {\n\t\t\tdocument.getElementById(\"alt-size-group\").hidden = true;\n\t\t\tdocument.getElementById(\"kw-form-group\").hidden = false;\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"alt-size-group\").hidden = false;\n\t\t\tdocument.getElementById(\"kw-form-group\").hidden = true;\n\t\t}\n\n\t\tdocument.getElementById(\"ver\").innerHTML = chrome.runtime.getManifest().version + \"&nbsp;\";\n\n\t\tdocument.getElementById(\"proxy-data\").value = items.proxy;\n\t\tdocument.getElementById(\"proxy_enabled\").checked = items.proxy_enabled;\n\n\t\tif (items.bypass) {\n\t\t\tdocument.getElementById(\"bypass\").checked = false;\n\t\t\tchrome.storage.sync.set({bypass: false}, null);\n\t\t}\n\t});\n}" ]
[ "0.81281036", "0.7955493", "0.7952804", "0.79513884", "0.78100187", "0.7808064", "0.77839416", "0.77807534", "0.7736412", "0.7689603", "0.7679494", "0.767728", "0.76685506", "0.76565903", "0.76448274", "0.76442367", "0.763711", "0.7631986", "0.7629453", "0.7624296", "0.75998104", "0.7588145", "0.7581747", "0.7555378", "0.75505406", "0.7550533", "0.7546174", "0.754374", "0.751185", "0.7480267", "0.74798447", "0.746969", "0.74448675", "0.7441167", "0.74318707", "0.7431285", "0.74298424", "0.74044627", "0.7397935", "0.73903716", "0.73901993", "0.73815835", "0.7368205", "0.732753", "0.73116696", "0.7309065", "0.7302032", "0.7298479", "0.7271953", "0.7250711", "0.725066", "0.72342813", "0.7211314", "0.72037315", "0.71834356", "0.71796435", "0.71627295", "0.7154613", "0.711911", "0.7099658", "0.7094655", "0.70936096", "0.70932174", "0.70707715", "0.70702475", "0.70503646", "0.7003343", "0.6993385", "0.6986057", "0.6983135", "0.6982658", "0.6960463", "0.6951284", "0.69370633", "0.69284904", "0.69178456", "0.6917325", "0.6902105", "0.69005686", "0.6899289", "0.689227", "0.6881834", "0.6876649", "0.6867064", "0.68494403", "0.6844469", "0.6839766", "0.6836528", "0.6835346", "0.682916", "0.68289244", "0.67966586", "0.6795241", "0.6794659", "0.6777851", "0.6774039", "0.676838", "0.6765651", "0.6754528", "0.67538214", "0.67512286" ]
0.0
-1
Save options to chrome storage
function save_options() { var darkSwitchCheckbox = document.getElementById("darkSwitch").checked; var hideLargeSig = document.getElementById("hideLargeSig").checked; var largeSignaturesInput = document.getElementById("largeSigInput").value; var resizeLargeImages = document.getElementById("resizeLargeImages").checked; var largeImagesInput = document.getElementById("largeImgInput").value; var WYSIWYGCheckbox = document.getElementById("WYSIWYGCheckbox").checked; var addEdited = document.getElementById("addEdited").checked; var showSickles = document.getElementById("showSickles").checked; chrome.storage.sync.get( { banMeMillisec: 0 }, function(data) { if(data.banMeMillisec == 0) { var banMeMillisec = new Date(document.getElementById("banMe").value).getTime(); var lockBan = document.getElementById("lockBan").checked; chrome.storage.sync.set({ banMeMillisec: banMeMillisec, lockBan: lockBan }); } }); chrome.storage.sync.set({ darkMode: darkSwitchCheckbox, hideLargeSig: hideLargeSig, largeSignatures: largeSignaturesInput, resizeLargeImages: resizeLargeImages, largeImages: largeImagesInput, WYSIWYGCheckbox: WYSIWYGCheckbox, addEdited: addEdited, showSickles: showSickles, colors: colorList }, function() { // Update status to let user know options were saved. var optionsSaved = document.getElementById('optionsSaved'); optionsSaved.textContent = 'Options saved.'; setTimeout(function() { optionsSaved.textContent = ''; }, 1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettings() {\n\n chrome.storage.local.set({\n\n words: wordArray,\n pages: pagesArray\n\n }, function() {\n\n \t//**********************************\n\t// OPTIONS SAVED INTO LOCAL STORAGE\n\t//**********************************\n\n });\n\n}", "function saveOptions() {\n var backgroundColor = document.getElementById('background-color').value\n , faceColor = document.getElementById('face-color').value\n , faceOutlineColor = document.getElementById('face-outline-color').value\n , hourColor = document.getElementById('hour-color').value\n\n chrome.storage.sync.set({\n colors: {\n background: backgroundColor,\n face: faceColor,\n faceOutline: faceOutlineColor,\n hour: hourColor,\n }\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n document.getElementById('cp').style.display = 'none'\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options() {\n\n chrome.storage.sync.set({ settings:\n {\n targethost: document.getElementById('targethost').value,\n targetport: document.getElementById('targetport').value,\n targetproto: document.getElementById('targetproto').value,\n targetuser: document.getElementById('targetuser').value,\n targetpasswd: document.getElementById('targetpasswd').value\n }\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = ' Saved.';\n\n //reload background script\n chrome.extension.getBackgroundPage().window.location.reload();\n \n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function saveOptions() {\n // assigns the parameters to what is set in the settings\n var key = document.getElementById('trigger').value;\n\n\t// chrome API to store data in JSON, anon function for when saved\n\tchrome.storage.sync.set({\n \tcolor: highlight,\n \topac: opacity,\n \trad: radius,\n \ttrigger: key,\n \ttoggle: check,\n activePage: false\n \t}, function() {\n \t\t// sets div status element to options saved for 1 second, then to empty\n \t\t$(\"#save-status\").text(\"Options saved!\");\n \t\tsetTimeout(function() {\n \t\t\t\t$(\"#save-status\").text(\"\");\n \t\t}, 1000);\n\t});\n}", "function save_options() {\n\n chrome.storage.sync.set({\n payWallOption: payWallOption.checked,\n adRemovalOption: adRemovalOption.checked,\n trumpOption: trumpOption.checked,\n trumpNameOption: trumpNameOption.value.toLowerCase(),\n yoHeaderOption: yoHeaderOption.checked,\n yoSuffixOption: yoSuffixOption.value.toLowerCase(),\n }, function() {\n closeButton.setAttribute('disabled','disabled');\n statusSpan.textContent = 'Options saved...';\n const currentWindow = window;\n setTimeout(function() {\n currentWindow.close();\n }, 1000);\n });\n}", "function save_options() {\n var input_url = sanitizeURL();\n var input_default_project = sanitizeProject();\n var input_language = document.getElementById('inputLanguageOptions').value;\n chrome.storage.sync.set({\n useURL: input_url,\n useDefaultProject: input_default_project,\n useLanguage: input_language\n }, function() {\n // Update status to let user know options were saved.\n showSuccessText();\n restore_options();\n });\n}", "function save_options() {\n\tlet auto_duo = document.getElementById('auto_duo');\n\tchrome.storage.sync.set({\n\t\tauto_duo: auto_duo\n\t}, function () {\n\t\tlet status = document.getElementById('status');\n\t\tstatus.style.color = 'green';\n\t\tstatus.textContent = 'Options Saved!';\n\t\tsetTimeout(function () {\n\t\t\tstatus.textContent = '\\n';\n\t\t\tstatus.style.color = 'initial';\n\t\t}, 1000);\n\t});\n}", "function save_options() {\n var title = document.getElementById('titleEnable').checked;\n var metaDesc = document.getElementById('metaDescEnable').checked;\n var h1 = document.getElementById('h1Enable').checked;\n var h2 = document.getElementById('h2Enable').checked;\n var wmt = document.getElementById('wmtEnable').checked;\n var ga = document.getElementById('gaEnable').checked;\n var ypa = document.getElementById('ypaEnable').checked;\n var imgAlt = document.getElementById('imgAltEnable').checked;\n \n chrome.storage.sync.set({\n titleEnabled: title,\n metaDescEnabled: metaDesc,\n\th1Enabled: h1,\n\th2Enabled: h2,\n\twmtEnabled: wmt,\n\tgaEnabled: ga,\n\typaEnabled: ypa,\n\timgAltEnabled: imgAlt\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function saveOptions() {\n var history = document.getElementById('history').checked;\n chrome.storage.sync.set({\n history: history\n }, userFeedback('Options saved.'));\n}", "function save_options() {\n var color = document.getElementById('color').value;\n var likesColor = document.getElementById('like').checked;\n chrome.storage.local.set({\n 'favoriteColor': color,\n 'likesColor': likesColor\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options() {\n var address = document.getElementById('formAddress').value;\n var username = document.getElementById('formUsername').value;\n var password = document.getElementById('formPassword').value;\n var line = document.getElementById('formLine').value;\n var prefix = document.getElementById('formPrefix').value;\n var DTMF = document.getElementById('formDTMF').checked;\n var singletone = document.getElementById('formSingletone').checked;\n \n if (!validate_address(address))\n\treturn;\n\n chrome.storage.sync.set({\n address: address,\n username: username,\n\tpassword: password,\n\tline: line,\n\tprefix: prefix,\n\tDTMF: DTMF,\n\tsingletone: singletone\n }, function() { \n show_status('alert-success', 'Options saved.');\n });\n \n // notify content script that options may have changed \n chrome.runtime.sendMessage({action: \"optionsSaved\"});\n}", "function save_options() {\n// var select = document.getElementById(\"color\");\n// var color = select.children[select.selectedIndex].value;\n// localStorage[\"favorite_color\"] = color;\n \t\n \tfor( i in pOptions){\n \t\tif(typeof(pOptions[i].def)=='boolean')\n \t\t\tlocalStorage[i] = document.getElementById(i).checked;\n \t\telse\n \t\t\tlocalStorage[i] = document.getElementById(i).value;\n \t}\n\t\n\t\n\t//localStorage[\"hqthumbs\"] = document.getElementById(\"hqthumbs\").checked;\n\t//localStorage[\"showCurrentTab\"] = document.getElementById(\"showCurrentTab\").checked;\n\t//localStorage[\"maxhistory\"] = document.getElementById(\"maxhistory\").value;\n\t\n\t\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n Cr.empty(status).appendChild(Cr.txt(\"Options Saved.\"));\n setTimeout(function() {\n Cr.empty(status);\n }, 750);\n \n chrome.runtime.sendMessage({greeting: \"reloadprefs\"}, function(response) { });\n}", "function save_options() {\n var prohib = document.getElementById('prohibited').value;\n chrome.storage.sync.set({prohibited: prohib }, function() {\n // Update status to let user know options were saved.\n document.getElementById('status').innerHTML = 'Options saved.';\n });\n}", "function save_options() {\n if (doReload) {\n // just saving app_name and reloading extension to start the oAuth process\n var browser_name = $appName.value;\n localStorage.setItem(\"app_name\", browser_name);\n $status.textContent = \"Options Saved.\";\n _.delay(chrome.runtime.reload, 500);\n } else {\n // saving new URL and reseting local copy of DB\n var sheet_url_val = $sheet_url.value;\n localStorage.setItem(\"sheet_url\", sheet_url_val);\n DrivePass.Settings.gs_sheet_init.sheet_url = sheet_url_val;\n DrivePass.ResetLocal().init(function() {\n $status.textContent = \"Options Saved.\";\n });\n }\n }", "function save_options() {\n let sheetIdValue = document.getElementById('sheet_id').value;\n\tlet baseUrlValue = document.getElementById('base_url').value;\n\tconst debugModeValue = document.getElementById(\"debug_mode\").checked;\n\n\tbaseUrlValue = baseUrlValue\n .replace(/(^\\w+:|^)\\/\\//, \"\")\n .replace(/\\/+$/, \"\");\n\n\tsheetIdValue = sheetIdValue.trim();\t\n\n\tbrowser.storage.sync.set({ sheetIdValue, baseUrlValue, debugModeValue }).then( () => {\n\t\tvar status = document.getElementById('status');\n\t\tstatus.textContent = 'Options saved...';\n\t\tsetTimeout(function () {\n\t\t\tstatus.textContent = '';\n\t\t}, 750);\n\t})\n\n}", "function saveToStorage(){\n\tchrome.storage.sync.set(settings);\n}", "function save_options() {\r\n console.log(\"save_options() called\");\r\n chrome.storage.sync.set({\r\n 'tonefreq': bgp.tonefreq,\r\n 'volume' : bgp.volume\r\n }, function() {\r\n // Update status to let user know options were saved.\r\n var status = document.getElementById('status');\r\n status.textContent = 'Options saved.';\r\n setTimeout(function() {\r\n status.textContent = '';\r\n }, 750);\r\n });\r\n}", "function save_options() {\n var frequency = document.getElementById('myRange').value;\n var appearance = getSelectedChbox(document.getElementById('view')) ;\n console.log(appearance);\n var content = getSelectedChbox(document.getElementById('content')) ;\n var category = getSelectedChbox(document.getElementById('category')) ;\n chrome.storage.sync.set({\n frequency: frequency,\n appearance: appearance,\n content: content,\n category: category\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options() {\n const pages = get_pages();\n const isRandom = document.getElementById('random').checked;\n chrome.storage.sync.set({\n pages: pages,\n random: isRandom\n }, function() {\n // Update status to let user know options were saved.\n const status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options () {\n var url = document.getElementById('url').value;\n\n if (!url || url === 'https://' || previous_value === url) {\n return;\n }\n\n chrome.storage.sync.set({\n url: url\n }, function () {\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n previous_value = url;\n setTimeout(function () {\n status.textContent = '';\n }, 750);\n });\n}", "function saveOptions() {\n var master = document.getElementById('master').value,\n slave = document.getElementById('slave').value;\n\n chrome.storage.sync.set({\n master: master,\n slave: slave\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.innerHTML = 'Options Saved.';\n setTimeout(function() {\n status.innerHTML = '';\n }, 750);\n });\n\n }", "function saveOptions()\n{\n save_options_button.disabled = true;\n\n var color = color_select.value;\n var likesColor = like_checkbox.checked;\n\n chrome.storage.sync.set(\n {\n 'favoriteColor': color,\n 'likesColor': likesColor\n },\n function()\n {\n // Update status to let user know options were saved.\n status_display.textContent = echo('options_OptionsSaved', '2');\n color_selected.textContent = color;\n color_selected.style.color = color;\n setTimeout( function()\n {\n status_display.textContent = '';\n save_options_button.disabled = false;\n },\n 750\n );\n }\n );\n}", "function saveOptions() {\n var token = document.getElementById('token').value,\n user = document.getElementById('user').value,\n repo = document.getElementById('repo').value,\n regex = document.getElementById('regex').value;\n\n chrome.storage.sync.set({\n token: token,\n user: user,\n repo: repo,\n regex: regex\n }, function() {\n window.close();\n });\n}", "function save_options() {\n var wpm = document.getElementById('wpmSetting').value;\n var chunkSize = document.getElementById('chunkSizeSetting').value;\n\n chrome.storage.local.set({\n 'rapidReadWPM': wpm,\n 'rapidReadChunkSize': chunkSize\n }, function(){\n\n \twindow.location = \"popup.html\";\n });\n\n}", "function save_options(evt) {\n evt.preventDefault();\n\n chrome.storage.local.get(STANDALONE_SETTINGS_STORAGE_KEY, res => {\n var previousMode = res[STANDALONE_SETTINGS_STORAGE_KEY];\n var userSelectedValue = document.querySelector('input[name=\"standalone\"]:checked').value;\n if (userSelectedValue) {\n var isStandalone = userSelectedValue === 'true';\n var hasSwitchedExtensionMode = previousMode && previousMode !== isStandalone;\n chrome.storage.local.set({\n 'options.standalone': isStandalone,\n 'hasSwitchedExtensionMode': hasSwitchedExtensionMode,\n }, () => chrome.runtime.reload());\n }\n })\n\n}", "function save_options() {\n var checkFrequency = document.getElementById('checkFrequency').value,\n notificationEnable = document.getElementById('notificationEnable').checked,\n alertEnable = document.getElementById('alertEnable').checked,\n notificationTimeout = document.getElementById('notificationTimeout').value,\n notificationEnableStatus = document.getElementById('notificationEnableStatus').checked,\n notificationEnablePlayers = document.getElementById('notificationEnablePlayers').checked,\n notificationPlayerList = document.getElementById('notificationPlayerList').value;\n chrome.storage.local.set({\n 'checkFrequency': checkFrequency,\n 'notificationEnable': notificationEnable,\n 'alertEnable': alertEnable,\n 'notificationTimeout': notificationTimeout,\n 'notificationEnableStatus': notificationEnableStatus,\n 'notificationEnablePlayers': notificationEnablePlayers,\n 'notificationPlayerList': notificationPlayerList\n }, function () {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function () {\n status.textContent = '';\n }, 1000);\n });\n}", "function save_options() {\n\tlet newSettings = {\n\t\t'o_theme': null,\n\t\t'o_live_output': null,\n\t\t'o_live_direction': [],\n\t\t'o_live_type': [],\n\t\t'o_live_donation': null,\t\t\n\t};\n\n\tfor (let i = 0; i < document.getElementsByName('o_theme').length; i++) {\n\t\tif (document.getElementsByName('o_theme')[i].checked) {\n\t\t\tnewSettings.o_theme = document.getElementsByName('o_theme')[i].id;\n\t\t}\n\t}\n\tfor (let i = 0; i < document.getElementsByName('o_live_output').length; i++) {\n\t\tif (document.getElementsByName('o_live_output')[i].checked) {\n\t\t\tnewSettings.o_live_output = document.getElementsByName('o_live_output')[i].id;\n\t\t}\n\t}\n\tfor (let i = 0; i < document.getElementsByName('o_live_direction').length; i++) {\n\t\tif (document.getElementsByName('o_live_direction')[i].checked) {\n\t\t\tnewSettings.o_live_direction.push(document.getElementsByName('o_live_direction')[i].id);\n\t\t}\n\t}\n\tfor (let i = 0; i < document.getElementsByName('o_live_type').length; i++) {\n\t\tif (document.getElementsByName('o_live_type')[i].checked) {\n\t\t\tnewSettings.o_live_type.push(document.getElementsByName('o_live_type')[i].id);\n\t\t}\n\t}\n\tfor (let i = 0; i < document.getElementsByName('o_live_donation').length; i++) {\n\t\tif (document.getElementsByName('o_live_donation')[i].checked) {\n\t\t\tnewSettings.o_live_donation = document.getElementsByName('o_live_donation')[i].id;\n\t\t}\n\t}\n\n chrome.storage.sync.set(\n \tnewSettings, \n \tfunction() {\n\t let status = document.getElementById('status');\n\t status.textContent = 'Options saved.';\n\t setTimeout(function() {\n\t status.innerHTML = '&nbsp;';\n\t }, 1550);\n \t}\n );\n\n \tchrome.extension.getBackgroundPage().currentSettings = newSettings;\n}", "function save() {\n var hideRecc = document.getElementById(\"hideRecc\").checked;\n var hideSidebar = document.getElementById(\"hideSidebar\").checked;\n var showNumber = document.getElementById(\"showNumber\").checked;\n var showNotifications = document.getElementById(\"showNotifications\").checked;\n var silent = document.getElementById(\"silent\").checked;\n chrome.storage.sync.set(\n {\n \"hideRecc\": hideRecc,\n \"hideSidebar\": hideSidebar,\n \"showNumber\": showNumber,\n \"showNotifications\": showNotifications,\n \"silent\": silent\n });\n var message = {\n txt: \"savedOptions\"\n }\n chrome.runtime.sendMessage(\"\", message);\n}", "function save_options() {\n console.log(\"In save options\")\n var searches = Array.from(document.getElementsByClassName(\"searchInput\")).map(x => x.value);\n var replaces = Array.from(document.getElementsByClassName(\"replaceInput\")).map(x => x.value);\nchrome.storage.sync.set({\n searches: searches,\n replaces: replaces,\n\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options() {\n\n\n var popKeyCode = document.getElementById('popKeyInput').keyCode;\n\n\n popKeyCode = isNaN(popKeyCode) ? tcDefaults.popKeyCode : popKeyCode;;\n\n chrome.storage.sync.set({\n popKeyCode: popKeyCode\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved';\n setTimeout(function() {\n status.textContent = '';\n }, 1000);\n });\n}", "function save_options() {\n localStorage[\"etym\"] = $(\"input[name=etym]:checked\").val();\n localStorage[\"click2s\"] = $(\"input[name=click2s]:checked\").val();\n localStorage[\"root2note\"] = $(\"input[name=root2note]:checked\").val();\n localStorage[\"afx2note\"] = $(\"input[name=afx2note]:checked\").val();\n localStorage[\"hide_cn\"] = $(\"input[name=hide_cn]:checked\").val();\n localStorage[\"web_en\"] = $(\"input[name=web_en]:checked\").val();\n localStorage[\"hider\"] = $(\"input[name=hider]:checkbox:checked\").map(function(i,e){return $(e).val()}).toArray();\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"保存成功\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 750);\n chrome.extension.sendRequest({method: \"setLocalStorage\",data:localStorage});\n\n}", "function saveOptions(valuesHash) {\n chrome.storage.sync.set(\n valuesHash,\n function() {\n // Update status to let user know options were saved.\n var status = document.querySelector('#status');\n status.innerHTML = 'Options saved';\n setTimeout(function() {\n status.innerHTML = '&nbsp;';\n }, 2000);\n }\n );\n}", "function save_options() {\n chrome.storage.sync.set({ backendUrl: document.getElementById('backendUrl').value });\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 2000);\n}", "function save_options(e) {\n var option_set = { };\n var two_part = e.target.id.split(':::');\n option_set[e.target.id] = options_defaults[two_part[0]].options[two_part[1]].value = $(e.target).is(':checked')\n $('#saving_changes').show();\n chrome.storage.sync.set(option_set, function() {\n // Update status to let user know options were saved.\n $('#saving_changes').hide();\n var status = $('#status');\n status.textContent = 'Options saved...';\n setTimeout(function() {\n status.textContent = '';\n }, 2000);\n });\n}", "function saveOptions() {\n chrome.storage.sync.set({\n notifications: $(INPUT_NOTIFICATIONS_SELECTOR).is(CHECKED),\n counters: $(INPUT_COUNTERS_SELECTOR).is(CHECKED),\n buttons: $(INPUT_BUTTONS_SELECTOR).is(CHECKED)\n }, function() {\n // Disable save button to indicate that options are saved.\n $(SAVE_BUTTON_SELECTOR).prop(DISABLED, true);\n });\n return false;\n}", "function save_options() {\n var sound = document.getElementById('sound').value;\n var type = document.getElementById('type').value;\n browser.storage.sync.set({\n sound: sound,\n type: type\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = ' ';\n }, 750);\n });\n }", "function saveOptions(options, callback=function() {}) {\n // Deep copy so this function is not destructive.\n options = JSON.parse(JSON.stringify(options));\n // Disable autonomous highlighting if its required permissions were\n // removed.\n chrome.permissions.contains(\n getPermissions('autonomous_highlights'),\n function(result) {\n if (!result)\n options.autonomous_highlights = false;\n chrome.storage.local.get(['options'], function(storage) {\n const json = JSON.stringify(storage.options);\n // Don't save if there are no changes (to prevent 'storage' event listeners\n // from responding when they don't need to).\n // XXX: The comparison will fail if the keys are in different order.\n if (JSON.stringify(storage.options) !== JSON.stringify(options)) {\n chrome.storage.local.set({options: options}, callback);\n } else {\n callback();\n }\n });\n });\n}", "function save_options() {\n \n if (interval.value > 60) {\n interval.value = 60;\n }\n else if (interval.value < 1) {\n interval.value = 1;\n }\n\n chrome.storage.local.set(\n {\n 'enableHACS': enabled.checked,\n 'intervalHACS': interval.value\n },\n function () {\n // Update status to let user know options were saved.\n chrome.storage.local.get(usedKeys, function (result) {\n console.log(\"Saved value \" + result[usedKeys[0]]);\n console.log(\"Saved value \" + result[usedKeys[1]]);\n });\n }\n );\n}", "function saveOptions() {\n chrome.storage.sync.set(\n {\n translateHeadings: document.getElementById('selectorH').checked,\n translateParagraphs: document.getElementById('selectorP').checked,\n translateOthers: document.getElementById('selectorOthers').checked,\n }, function () {\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function () {\n status.textContent = '';\n }, 2000);\n });\n}", "function save_options() {\n var url = elements.url.value;\n storage.sync.set({\n serverUrl: url\n }, showSaveTimedMessage);\n }", "function save_options() {\n var status = document.getElementById('status');\n var startPage = document.getElementById(\"startPage\").value;\n status.textContent = STATUS_SAVING;\n status.style.color = COLOR_RED;\n chrome.storage.sync.set({\n startPage: startPage\n }, function() {\n // Update status to let user know options were saved.\n status.textContent = STATUS_SAVED;\n status.style.color = COLOR_GREEN;\n });\n}", "function save_options() {\n chrome.storage.sync.set(\n {\n ERPIITKGP_ERPLoginID: document.getElementById(\"ERPLoginID\").value,\n ERPIITKGP_ERPPassword: document.getElementById(\"ERPPassword\").value,\n ERPIITKGP_answer1: document.getElementById(\"answer1\").value,\n ERPIITKGP_answer2: document.getElementById(\"answer2\").value,\n ERPIITKGP_answer3: document.getElementById(\"answer3\").value,\n ERPIITKGP_question1: document.getElementById(\"question1\").value,\n ERPIITKGP_question2: document.getElementById(\"question2\").value,\n ERPIITKGP_question3: document.getElementById(\"question3\").value\n },\n function() {\n show_open_if_already_saved();\n\n document.getElementById(\"status\").innerHTML =\n '<div class=\"alert alert-info\" role=\"alert\">Changes saved.</div>';\n }\n );\n}", "function save_options() {\n $('#options-list input[type=\"checkbox\"]').each(function() {\n var obj = {};\n var check = $(this);\n obj[$(this).attr('id')] = $(this).prop(\"checked\");\n\n chrome.storage.sync.set(obj);\n console.log('saving', obj);\n });\n $('#options-list input[type=\"text\"]').each(function() {\n var obj = {};\n var value = $(this).val();\n obj[$(this).attr('id')] = value;\n chrome.storage.sync.set(obj);\n console.log('saving', obj);\n });\n\n $('#status').text(\"Saved\").slideDown();\n setTimeout(function() {\n $('#status').slideUp(function() {\n $(this).text(\"\");\n })\n }, 3000);\n}", "function save_options() {\n // Get values from form\n var webhookUrl = document.getElementById('webhookUrl').value;\n var notificationSecret = document.getElementById('notificationSecret').value;\n // Set the vars in sync and return \"success message\"\n chrome.storage.sync.set({\n webhookUrl: webhookUrl,\n notificationSecret: notificationSecret\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n}", "function save_options() {\n \n // get the default inputs\n const default_sites = document.getElementById('default_sites');\n const default_site_list = default_sites.getElementsByTagName('input');\n const sites_formatted = new Object();\n sites_formatted.default = [];\n log('default_site list', default_site_list);\n \n // loop through the displayed sites and make an array; then update what's saved\n for (let i = 0; i < default_site_list.length; i += 1) { \n sites_formatted.default[i] = new Object();\n sites_formatted.default[i].url = default_site_list[i].value;\n sites_formatted.default[i].checked = default_site_list[i].checked;\n }\n \n // get the user inputs\n const user_sites = document.getElementById('user_sites');\n const user_site_list = user_sites.getElementsByTagName('input');\n sites_formatted.user = [];\n log('user_site list: ',user_site_list);\n \n // loop through the displayed sites and make an array; then update what's saved\n for (let i = 0; i < user_site_list.length; i += 1) { \n sites_formatted.user[i] = new Object();\n sites_formatted.user[i].url = user_site_list[i].value;\n sites_formatted.user[i].checked = user_site_list[i].checked;\n }\n \n // also check other options\n const block_streams = document.getElementById('block_streams').checked;\n const explode_links = document.getElementById('explode_links').checked;\n const linkChangeInterval = document.getElementById('linkChangeInterval').value;\n \n chrome.storage.local.set({\n blockStreams: block_streams,\n explodeLinks: explode_links,\n sites: sites_formatted,\n baseInterval: linkChangeInterval,\n }, () => {\n chrome.runtime.sendMessage({ msg: 'updated_options' }, () => {});\n });\n}", "function saveOptions() {\n var dailyTasks = getDailyTasks();\n var leeway = parseInt($(INPUT_LEEWAY_SELECTOR).val());\n var startOfDay = timeStringToMinutes($(INPUT_START_OF_DAY_SELECTOR).val());\n var endOfDay = timeStringToMinutes($(INPUT_END_OF_DAY_SELECTOR).val());\n var shortEventDuration = parseInt($(INPUT_SHORT_EVENT_DURATION_SELECTOR)\n .val());\n var transitionTime = parseInt($(INPUT_TRANSITION_TIME_SELECTOR).val());\n var blink = $(INPUT_BLINK_SELECTOR).is(':checked');\n var colorR = parseInt($(INPUT_COLOR_R).val());\n var colorG = parseInt($(INPUT_COLOR_G).val());\n var colorB = parseInt($(INPUT_COLOR_B).val());\n chrome.storage.sync.set({\n dailyTasks: dailyTasks,\n startOfDay: startOfDay,\n endOfDay: endOfDay,\n leeway: leeway,\n shortEventDuration: shortEventDuration,\n transitionTime: transitionTime,\n blink: blink,\n colorR: colorR,\n colorG: colorG,\n colorB: colorB\n }, function() {\n // Disable save button to indicate that options are saved.\n $(SAVE_BUTTON_SELECTOR).prop(DISABLED, true);\n });\n return false;\n}", "function saveOptions() {\n var dictionaries = JSON.parse(window.localStorage.getItem('dictionaries'));\n\n // Saves custom dictionries to local storage(if any).\n if (tempCusDictionaries.length > 0) {\n if (dictionaries) {\n dictionaries = dictionaries.concat(tempCusDictionaries);\n window.localStorage.setItem('dictionaries', JSON.stringify(dictionaries));\n } else {\n window.localStorage.setItem('dictionaries', JSON.stringify(tempCusDictionaries));\n }\n tempCusDictionaries.splice(0, tempCusDictionaries.length);\n }\n\n showUserMessages('save_status', 0.5, 'saveStatus');\n// $('save_button').disabled = true;\n}", "function save_main_options() {\n chrome.storage.sync.set({ operationMode: this.value}, function (items) {\n try_update_status('status', 'Options saved', 1300);\n });\n}", "function save_options() {\n\tsetLocal(\"sense_facebook\");\n\tsetLocal(\"sense_google\");\n\tsetLocal(\"sense_twitter\");\n\tsetLocal(\"sense_youtube\");\n\tsetLocal(\"sense_4Chan\");\n\tsetLocal(\"sense_selector\");\n\tsetLocal(\"sense_color\");\n\tcheckAPI();\n}", "function saveOptions() {}", "function save_options() {\r\n localStorage[\"user\"] = document.getElementById(\"user\").value;\r\n localStorage[\"passwd\"] = document.getElementById(\"passwd\").value;\r\n\r\n // Update status to let user know options were saved.\r\n update_status(\"已保存\");\r\n}", "function save_options() {\n localStorage[_trackIdKey] = document.getElementById(_trackIdKey).value;\n localStorage[_trackIdKeyCa] = document.getElementById(_trackIdKeyCa).value;\n localStorage[_trackIdKeyUk] = document.getElementById(_trackIdKeyUk).value;\n localStorage[_trackIdKeyDe] = document.getElementById(_trackIdKeyDe).value;\n localStorage[_trackIdKeyEs] = document.getElementById(_trackIdKeyEs).value;\n localStorage[_trackIdKeyFr] = document.getElementById(_trackIdKeyFr).value;\n localStorage[_trackIdKeyIt] = document.getElementById(_trackIdKeyIt).value;\n localStorage[_trackIdKeyJp] = document.getElementById(_trackIdKeyJp).value;\n localStorage[_trackIdKeyCn] = document.getElementById(_trackIdKeyCn).value;\n localStorage[_trackIdKeyIn] = document.getElementById(_trackIdKeyIn).value;\n localStorage[_trackIdKeyFlipkart] = document.getElementById(_trackIdKeyFlipkart).value;\n\t\n // Update status to let user know options were saved.\n document.querySelector('button').innerHTML = \"Saved.\";\n // Close tab/popup\n setTimeout(\n function() { \n window.close();\n }, 750);\n}", "function save_options() {\n chrome.storage.sync.set({\n isNotificationEnabled: document.getElementById(\"is-notification-enabled\").checked,\n mioUrl: document.getElementById(\"mio-url\").value\n },function() {\n if (chrome.runtime.lastError) {\n showMessage(\"<font color='#FF0000'>Failed to save...</font>\");\n } else {\n showMessage(\"Saved!\");\n }\n });\n}", "function restore_options() {\r\n chrome.storage.sync.get('options', function(items) {\r\n $('#options').val(JSON.stringify(items.options || options_default, undefined, 4));\r\n });\r\n}", "function save_options() {\n var autoForward = document.getElementById('autoForward').checked;\n var clubId = document.getElementById('clubId').value;\n chrome.storage.sync.set({\n autoForward: autoForward, \n clubId: clubId\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Wijzigingen opgeslagen.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n \n}", "function save_options() {\n\n var envList = [\n document.getElementById('env-url-input1').value,\n document.getElementById('env-url-input2').value,\n document.getElementById('env-url-input3').value,\n document.getElementById('env-url-input4').value,\n document.getElementById('env-url-input5').value,\n document.getElementById('env-url-input6').value\n ]\n\n var queryLabels = document.querySelectorAll('input[name=\"label\"]');\n var queryTables = document.querySelectorAll('input[name=\"table\"]');\n var queryFields = document.querySelectorAll('input[name=\"field\"]');\n var queryOperators = document.querySelectorAll('select[name=\"operator\"]');\n queries = [];\n\n for (var i = 0; i < queryTables.length; i++) {\n var tmp = {\n label: queryLabels[i].value,\n table: queryTables[i].value,\n field: queryFields[i].value,\n operator: queryOperators[i].value\n };\n\n queries.push(tmp);\n }\n\n queries = queries.filter(item => {\n return (item.field != '' && item.label != '' && item.operator != '' && item.table != '');\n });\n\n envList = envList.filter(x => { return x != '' });\n\n chrome.storage.sync.set(getDataObject(envList, queries),\n function() {\n statusHeader.textContent = 'Options saved.';\n setTimeout(function() {\n statusHeader.textContent = '';\n }, 1000);\n\n queryContainer.innerHTML = '';\n addQueryBtn.disabled = false;\n hasNewQuery = false;\n refreshTables();\n });\n}", "function saveOptions() {\r\n var user = document.getElementById(\"user\").value;\r\n var pass = document.getElementById(\"pass\").value;\r\n if(user.trim()==\"\" || pass.trim()==\"\") {\r\n document.getElementById(\"status\").innerHTML = \"You must enter a valid username and password.\";\r\n return;\r\n }\r\n localStorage[\"user\"] = user;\r\n localStorage[\"pass\"] = sjcl.encrypt(\"javascript\",pass);\r\n\r\n // Update status to let user know options were saved.\r\n document.getElementById(\"status\").innerHTML = \"Saved successfully.\";\r\n chrome.runtime.sendMessage({updated: true}, function(response) {\r\n console.log(response.output);\r\n });\r\n}", "function save_options() {\n if (!window.localStorage) {\n alert(\"Error local storage is unavailable.\");\n window.close();\n }\n\n window.localStorage.username = document.getElementById(\"username\").value;\n if ( document.getElementById(\"password\").value != '' )\n window.localStorage.password = document.getElementById(\"password\").value;\n\n window.localStorage.url = document.getElementById(\"url\").value;\n\n window.localStorage.url_base = window.localStorage.url.replace(/^(https?:\\/\\/[^\\/]+)\\/.*$/i, '$1');\n window.localStorage.url_icinga = window.localStorage.url.replace(/^(.*)\\/[^\\/]+.cgi$/i, '$1');\n\n window.localStorage.refresh = document.getElementById(\"refresh\").value;\n\n window.localStorage.dateFormat = document.getElementById(\"dateFormat\").value;\n window.localStorage.ignoreServicesRegexp = document.getElementById(\"ignoreServicesRegexp\").value;\n window.localStorage.ignoreHostsRegexp = document.getElementById(\"ignoreHostsRegexp\").value;\n\n window.localStorage.ignoreCaseSensitivity =\n document.getElementById(\"ignoreCaseSensitivity\").checked ? true : false;\n\n window.localStorage.hideAcked =\n document.getElementById(\"hideAcked\").checked ? true : false;\n\n window.localStorage.hideDowntimeed =\n document.getElementById(\"hideDowntimeed\").checked ? true : false;\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n setTimeout(function() {\n status.innerHTML = \"\";\n }, 750);\n\n // refresh data\n chrome.extension.sendRequest({reqtype: \"refresh-data\"});\n}", "function save_options() {\n var num_rows = $(\":text[id^='username']\").length;\n var newSecretKeys = {};\n for (var i = 0; i < num_rows; i++) {\n if ($(`#username${i}`).val()) {\n newSecretKeys[$(`#username${i}`).val()] = $(`#key${i}`).val();\n }\n }\n chrome.storage.sync.set(\n {\n secretKeys: newSecretKeys,\n },\n function () {\n // Update status to let user know options were saved.\n var status = $(\"#status\");\n status.text(\"Save successful!\");\n setTimeout(function () {\n status.empty();\n }, 1000);\n }\n );\n }", "function saveOptions () {\n var selected = document.querySelector('.ios-switch').checked\n\n chrome.storage.sync.set({\n mute: selected\n }, function () {\n // Update status to let user know options were saved.\n var status = document.querySelector('#status')\n status.textContent = 'Options saved.'\n setTimeout(function () {\n status.textContent = ''\n }, 750)\n })\n}", "function write() {\n var store = {};\n\n // store inputs\n var inputs = document.querySelectorAll('input');\n for(var i=0;i<inputs.length;i++) {\n var val,\n key = inputs[i].name;\n\n switch (inputs[i].type) {\n case 'checkbox':\n val = inputs[i].checked ? inputs[i].value : '';\n break;\n default:\n val = inputs[i].value;\n break;\n }\n\n store[key] = val;\n }\n\n // cast\n store.debug = Boolean(store.debug);\n\n chrome.storage.local.set({'pwa': store}, function() {\n flash('Options Saved');\n });\n}", "function save_options() {\n var album = document.getElementById('albums').selectedOptions[0];\n chrome.storage.sync.set({\n albumName: album.innerText,\n albumID: album.value\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.innerText = \"Options saved.\";\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n\n alerts.innerHTML = \"\";\n restore_options();\n}", "function save_options() {\n let apiKey = document.getElementById('apikey').value;\n let sandBox = document.getElementById('sandbox').checked;\n chrome.storage.sync.set({\n apiKey: apiKey,\n sandBox: sandBox,\n }, function() {\n chrome.notifications.create({\n type: 'basic',\n iconUrl: chrome.extension.getURL('images/icon-38.png'),\n title: 'Easy Domain Registration',\n message: 'Your options saved.'\n });\n });\n}", "function saveColorOptions() {\n var colorHex = document.getElementById('color').value;\n var imageURL = colorHexToUrl(colorHex)\n\n chrome.storage.sync.set({\n imageURL: imageURL,\n overlayMode: getOverlayMode(),\n }, function() {\n updateImageUrl(imageURL);\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 1000);\n });\n}", "function save_options() {\n options.connection_cleanup_age = document.getElementById(\"connection_cleanup_age\").value;\n localStorage.connection_cleanup_age = options.connection_cleanup_age;\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n setTimeout(function () {\n status.innerHTML = \"\";\n }, 750);\n}", "function save_options() {\n // the way to open the extension\n var select = document.getElementById(\"open\");\n var open = select.children[select.selectedIndex].value;\n localStorage[\"open\"] = open;\n\n // the active tabs\n var select = document.getElementsByClassName(\"tabs\"); \n var tabs = [];\n for (var i = 0; i < select.length; i++) {\n if(select[i].checked)\n tabs.push(i);\n }\n localStorage[\"tabs\"] = JSON.stringify(tabs);\n\n // the suggestions language\n var select = document.getElementById(\"suggest-lg\");\n var suggest = select.children[select.selectedIndex].value;\n localStorage[\"suggest-lg\"] = suggest;\n\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.innerHTML = \"Options Saved.\";\n removeClass(status, \"hidden\");\n setTimeout(function() {\n status.innerHTML = \"\";\n addClass(status, \"hidden\");\n }, 1500);\n\n}", "function save_options_with_msg(msg) {\n var option_values = {\n downscroll_speed_opt: parseInt($('#downscroll').val()),\n prev_key_opt: parseInt($('.key-code[data-opt-name=\"prev_key\"]').text()),\n next_key_opt: parseInt($('.key-code[data-opt-name=\"next_key\"]').text()),\n alttext_key_opt: parseInt($('.key-code[data-opt-name=\"alttext_key\"]').text()),\n random_key_opt: parseInt($('.key-code[data-opt-name=\"random_key\"]').text()),\n };\n\n chrome.storage.sync.set(remove_falsy_values(option_values), function() {\n // Update status to let user know options were saved.\n show_status_msg(msg);\n });\n}", "function saveOptions() {\n clearAlerts();\n var prj = document.getElementById('project').value;\n var usr = document.getElementById('user').value;\n \n chrome.storage.sync.set({\n project: prj,\n user: usr\n }, function() {\n addAlert(\"Options updated\", \"success\");\n setTimeout(function(){ \n clearAlerts(); \n }, 1000);\n });\n}", "saveOptions(form) {\n let newSettings = {};\n\n for (let [key, value] of new FormData(form)) {\n if (newSettings.hasOwnProperty(key)) { // SerializedArray\n newSettings[key] += ',' + value; // add new\n newSettings[key] = newSettings[key].split(','); // to array [old, new]\n\n } else {\n newSettings[key] = value;\n };\n }\n\n Storage.setParams(newSettings, this.storageMethod);\n\n // notify background page\n chrome.extension.sendMessage({ // manifest v2\n // chrome.runtime.sendMessage({ // manifest v3\n \"action\": 'setOptions',\n \"settings\": newSettings\n });\n }", "function setSavedOptions() {\n log('Getting saved options.');\n GM_setValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n GM_setValue(\"opt_hidefedded\", opt_hidefedded);\n GM_setValue(\"opt_hidefallen\", opt_hidefallen);\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n GM_setValue(\"opt_hidehosp\", opt_hidehosp);\n GM_setValue(\"opt_disabled\", opt_disabled);\n }", "function save_options() {\n // Get words and split into array at newline\n var words = document.getElementById(\"words\").value.split(\"\\n\");\n\n // Remove last blank line\n // let trash = words.splice(-1);\n console.log(words);\n\n // Store\n chrome.storage.sync.set(\n {\n words: words\n },\n function() {\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n status.textContent = \"Options saved.\";\n setTimeout(function() {\n status.textContent = \"\";\n }, 750);\n }\n );\n}", "function saveOptions() {\n\tlocalStorage[\"default_folder_id\"] = $('#folder_list :selected').val();\n\tlocalStorage[\"dial_columns\"] = $('#dial_columns :selected').val();\n\tlocalStorage[\"dial_width\"] = $('#dial_width :selected').val();\n\tsaveCheckbox('drag_and_drop');\n\tsaveCheckbox('force_http');\n\tsaveCheckbox('show_advanced');\n\tsaveCheckbox('show_new_entry');\n\tsaveCheckbox('show_folder_list');\n\tsaveCheckbox('show_subfolder_icons');\n\tlocalStorage[\"thumbnail_url\"] = $('#thumbnail_url').val();\n\n\twindow.location = \"newtab.html\";\n}", "function saveSingleOption() {\n var imageURL = document.getElementById('url').value;\n if (imageURL.length == 0) {\n imageURL = DEFAULT_IMAGE_URLS[0];\n document.getElementById('url').value = imageURL;\n }\n chrome.storage.sync.set({\n imageURL: imageURL,\n overlayMode: getOverlayMode(),\n }, function() {\n updateImageUrl(imageURL);\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 1000);\n });\n}", "function save_options() {\n var tts = \"\";\n var elements = document.getElementsByName(\"uniquetab\");\n for (var i = 0; i < elements.length; i++)\n if (elements[i].checked)\n tts = elements[i].value;\n chrome.storage.sync.set({\n time2save: tts\n });\n}", "function save_options_() {\r\n save_options();\r\n }", "function restore_options() {\r\n chrome.storage.sync.get({\r\n hostname: 'localhost',\r\n port_number: 8888,\r\n debug_mode: false\r\n }, (items) => {\r\n document.getElementById('hostname').value = items.hostname;\r\n document.getElementById('port-number').value = items.port_number;\r\n document.getElementById('debug-mode').checked = items.debug_mode;\r\n });\r\n}", "function save_options(options) {\r\n API_GetTabURL(function(url) {\r\n var domain = url.match(/^[\\w-]+:\\/*\\[?([\\w\\.:-]+)\\]?(?::\\d+)?/)[1];\r\n saveBody(domain, options);\r\n });\r\n }", "function save_options() {\n\tvar host=getOptionFromElement(\"host\");\n\tvar username=getOptionFromElement(\"username\");\n\tvar password=getOptionFromElement(\"password\");\n\tvar servers = getLocalStorage(\"teamcitysettings\");\n\tvar server=servers[0]||{};\n\tif(server.host!=host||server.username!=username||server.password!=password){\n\t\tserver = {host:host,username:username,password:password};\n\t\tservers[0]=server;\n\t}else{\n\t\tconsole.log(\"No credentials changed\");\n\t}\n\t\n\tfor(var buildTypeId in server.listBuildTypeIds){\n\t\tvar key=\"input_\"+buildTypeId;\n\t\tvar value = getOptionFromElement(key);\n\t\tif(value){\n\t\t\n\t\t\tconsole.log(key+\" -> \"+value);\n\t\t\tserver.listBuildTypeIds[buildTypeId]=value;\n\t\t}\n\t}\n\tconsole.log(servers);\n\tconsole.log(server);\n\tsaveLocalStorage(\"teamcitysettings\",servers);\n\t\n\tloadTeamCityData();\n\t\n\t// Update status to let user know options were saved.\n\tvar status = document.getElementById(\"status\");\n\tstatus.innerHTML = \"Options Saved.\";\n\tsetTimeout(function() {\n\t\tstatus.innerHTML = \"\";\n\t}, 750);\n}", "function savePrefs()\n{\n let preferences = collatePrefs( prefs );\n browser.storage.local.set({\"preferences\": preferences});\n}", "function restore_options() {\n \n log('restoring options from saved - options:');\n \n chrome.storage.local.get({\n enabled: 'Ready',\n blockStreams: [],\n userSitePreset: [],\n baseInterval: 1,\n sites: [],\n }, (items) => {\n \n write_sites_to_page(items.sites);\n \n //reset other options, too\n log('items.blockStreams',items.blockStreams);\n document.getElementById('block_streams').checked = items.blockStreams;\n document.getElementById('enabled_status').textContent = items.enabled;\n document.getElementById('new_site').value = items.userSitePreset;\n console.log('setting base', items.baseInterval);\n document.getElementById('linkChangeInterval').value = items.baseInterval;\n });\n}", "function saveInstanceOptions () {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.instanceOptions = JSON.stringify(context.instanceOptions);\n }\n}", "function saveOptions() {\n\n // Get the excluded site index if it has already been added\n var excludedSiteIndex = -1;\n for (var i = 0; i < options.excludedSites.length; i++) {\n if (options.excludedSites[i] == siteHostname) {\n excludedSiteIndex = i;\n break;\n }\n }\n\n if ($('#chkExcludeSite')[0].checked) {\n if (excludedSiteIndex == -1)\n options.excludedSites.push(siteHostname);\n } else {\n if (excludedSiteIndex > -1)\n options.excludedSites.splice(excludedSiteIndex, 1);\n }\n\n actionKeys.forEach(function(key) {\n var id = key[0].toUpperCase() + key.substr(1);\n options[key] = parseInt($('#sel' + id).val());\n });\n\n localStorage.options = JSON.stringify(options);\n sendOptions(options);\n restoreOptions();\n return false;\n}", "function setOptionsAsString(options) {\n localStorage.setItem(\"options\", options);\n}", "function save_options() {\n var inp = document.getElementById(\"rndphrase_seed\");\n if(inp.value == MASK) {\n set_status(\"Cowardly refused to store '\"+MASK+\"' as seed.\");\n return;\n }\n var hash = rndphrase.CubeHash.hash(inp.value);\n\n return chrome.storage.sync.set({ seed: hash }, function () {\n inp.value = MASK;\n // Update status to let user know options were saved.\n set_status(\"Seed updated.\");\n });\n}", "function save_options() {\n var settingEnabled = settingsCheckboxObj.checked;\n chrome.storage.sync.set({ settingEnabled: settingEnabled });\n}", "function save_options() {\n chrome.storage.sync.set({\n repo_src: updateRepoField.value\n }, function() {\n });\n}", "function save_options() {\n var scrollTimeValue = document.getElementById('scroll-time').value;\n var animationTimeValue = document.getElementById('animation-time').value;\n if ((!scrollTimeValue) || (!animationTimeValue)) {\n set_status('Please fill all items in the form', 'error');\n return FALSE;\n }\n chrome.storage.sync.set({\n scrollTime: scrollTimeValue,\n animationTime: animationTimeValue\n }, set_status('Options Saved!', 'success'));\n}", "function save_options() {\n $(\".options\").each(function(){\n var op = this.id;\n localStorage[PREFIX+op] = $(this).val();\n });\n\n var s = [];\n $('#sortable1 > li').each(function(idx, d){\n s.push($(d).text()); \n });\n localStorage[\"tabs\"] = s.join(\", \"); \n \n alert(\"Options Saved.\");\n}", "function saveSettings() {\n var settings = [];\n if (options.orderby != defaults.orderby) {\n settings.push('\"orderby\":\"' + options.orderby + '\"');\n }\n if (options.thsize != defaults.thsize) {\n settings.push('\"thsize\":\"' + options.thsize + '\"');\n }\n if (options.extended != defaults.extended) {\n settings.push('\"extended\":' + (options.extended ? 'true' : 'false'));\n }\n if (options.proxy != defaults.proxy) {\n settings.push('\"proxy\":' + (options.proxy ? 'true' : 'false'));\n }\n if (settings.length > 0) {\n settings = '{' + settings.join(',') + '}';\n $.cookie('4cat', settings, {\n expires: 30,\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n else {\n $.cookie('4cat', null, {\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n }", "function save_options() {\n var zip = $('#zip').val();;\n\n chrome.storage.sync.set({\n zip: zip,\n }, function() {\n console.log(zip);\n });\n}", "function restore_options() {\n\tchrome.storage.sync.get(\n\t{\n\t\taddress: 'address',\n\t\tport: 'port',\n\t\tlogin: 'login',\n\t\tpassword: 'password'\n\t}, \n\tfunction(items) {\n\t\tdocument.getElementById('address').value = items.address;\n\t\tdocument.getElementById('port').value= items.port;\n\t\tdocument.getElementById('login').value = items.login;\n\t\tdocument.getElementById('password').value= items.password;\n\t});\n}", "function saveOptions(deploy) {\n function callback(tabs) {\n\n //Get either the SaaS tenant ID or the Managed environment ID from local storage\n let currentTab = tabs[0]; \n tenant = getTenantId(currentTab.url, deploy); \n\n console.log(\"saving values for \" + tenant);\n //Take the API key and session properties from the text fields along with the conversion goals and put them into an object to be set in local storage\n let tenantInfo = {\n 'api_key': document.getElementById(\"api_key\").value,\n 'tag_filter_key': document.getElementById(\"tag_filter_key\").value,\n 'tenant_color': document.getElementById(\"tenant_color\").value\n }\n console.log(tenantInfo);\n\n //Push the object above into local storage, set to either the SaaS tenant ID or the Managed environment ID\n chrome.storage.local.set({[tenant]: tenantInfo}, function () {\n //Once it's been set, effectively \"reload\" by getting the conversion goals and text field values\n setTextBoxDefaults(deploy);\n });\n\n chrome.tabs.getSelected(null, function(tab) {\n chrome.tabs.sendRequest(tab.id, {action:'modify'}, function(response) {});\n });\n }\n\n chrome.tabs.query(query, callback);\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({ settings: \n {\n targethost: '127.0.0.1',\n targetport: '9666',\n targetproto: 'http',\n targetuser: \"\",\n targetpasswd: \"\"\n\n }\n }, function(storage) {\n console.log(storage.settings)\n document.getElementById('targethost').value = storage.settings.targethost;\n document.getElementById('targetport').value = parseInt(storage.settings.targetport);\n document.getElementById('targetproto').value = storage.settings.targetproto;\n document.getElementById('targetuser').value = storage.settings.targetuser;\n document.getElementById('targetpasswd').value = storage.settings.targetpasswd;\n });\n}", "function restore_options() {\n chrome.storage.sync.get({\n username: '',\n customGreeting: '',\n customAvatar: '',\n improveUI: true,\n addMarketStats: true\n }, function(items) {\n document.getElementById('username').innerHTML = items.username;\n document.getElementById('customGreeting').value = items.customGreeting;\n document.getElementById('customAvatar').value = items.customAvatar;\n document.getElementById('improveUI').checked = items.improveUI;\n document.getElementById('addMarketStats').checked = items.addMarketStats;\n });\n}", "function restore_options() {\r\n chrome.storage.sync.get({\r\n hideExtensions: false,\r\n autoTheatre: false,\r\n cursorMute: false\r\n }, function(items) {\r\n document.getElementById('hideExtensions').checked = items.hideExtensions;\r\n document.getElementById('autoTheatre').checked = items.autoTheatre;\r\n document.getElementById('cursorMute').checked = items.cursorMute;\r\n });\r\n}", "function saveSetting(obj) {\n if (typeof chrome != 'undefined') {\n console.log('saving setting for ', JSON.stringify(obj, null, '\\t'));\n chrome.storage.sync.set(obj);\n } else {\n console.log('saving setting for other clients not implemented.');\n }\n }", "function restore_options() {\n\n chrome.storage.local.get(null, function (result) {\n\n document.getElementById('wpmSetting').value = result.rapidReadWPM;\n document.getElementById('chunkSizeSetting').value = result.rapidReadChunkSize;\n \n});\n}", "function save_sender_options() {\r\n var mailOptionsLength = localStorage['mailOptionsLength'];\r\n var child;\r\n\r\n for (var i = 0; i <= mailOptionsLength; i++) {\r\n child = $(\"#mail_picker_\" + i);\r\n localStorage[\"mail_picker_\" + i] = child.prop(\"checked\");\r\n }\r\n\r\n for (var i = 0; i <= mailOptionsLength; i++) {\r\n child = $(\"#new_window_\" + i);\r\n localStorage[\"new_window_\" + i] = child.prop(\"checked\");\r\n }\r\n \r\n toggle_newWindow_chbox();\r\n\r\n // Update status to let user know options were saved.\r\n\r\n //reload context menu with new settings\r\n chrome.contextMenus.removeAll();\r\n chrome.extension.getBackgroundPage().window.location.reload();\r\n}", "function restore_options() {\n chrome.storage.local.get({\n host: 'http://localhost',\n port: 5800,\n PIN: 1234\n }, function (items) {\n document.getElementById('hostadd').value = items.host;\n document.getElementById('port').value = items.port;\n document.getElementById('PIN').value = items.PIN;\n });\n}", "function restore_options() {\n chrome.storage.local.get(null, function(items) {\n const fetchedValues = Object(items);\n document.querySelector(\"#localserverid\").value = fetchedValues.local_server_id || null;\n document.querySelector(\"#remoteserverid\").value = fetchedValues.remote_server_id || DEFAULT_MYOPENHAB_URL;\n document.querySelector(\"#pathid\").value = fetchedValues.path_id || DEFAULT_PATH;\n document.querySelector(\"#widthid\").value = fetchedValues.width_id || DEFAULT_WIDTH;\n document.querySelector(\"#heightid\").value = fetchedValues.height_id || DEFAULT_HEIGHT;\n });\n}" ]
[ "0.8208671", "0.81641334", "0.81333387", "0.80997515", "0.80605656", "0.8034787", "0.79931915", "0.7969695", "0.7967973", "0.79387176", "0.7916807", "0.78878933", "0.78403693", "0.7832415", "0.7831214", "0.7822175", "0.7817581", "0.7812492", "0.7789036", "0.77857316", "0.7781444", "0.77751285", "0.77717936", "0.77614206", "0.77508956", "0.7746921", "0.7745248", "0.7725968", "0.7695728", "0.76654285", "0.7662909", "0.7647366", "0.7580857", "0.756053", "0.7560399", "0.75560987", "0.7545997", "0.75272423", "0.7521923", "0.7517045", "0.74942183", "0.74759597", "0.7458017", "0.74517715", "0.7447041", "0.7429093", "0.74173725", "0.7405112", "0.7405006", "0.7401136", "0.7389278", "0.73857886", "0.7370158", "0.73691857", "0.73633224", "0.7359385", "0.73589826", "0.73460966", "0.7342833", "0.73328495", "0.73317087", "0.7295182", "0.7282032", "0.7272562", "0.72517896", "0.7223563", "0.72233224", "0.7204523", "0.7197071", "0.7196921", "0.71920025", "0.71912295", "0.7184565", "0.7158092", "0.7155665", "0.7152218", "0.71472025", "0.7142651", "0.7137681", "0.71194124", "0.7111518", "0.7106753", "0.7105398", "0.71016484", "0.70670956", "0.7059926", "0.7055877", "0.7050726", "0.70457274", "0.7045458", "0.7023765", "0.7022713", "0.70159346", "0.69966245", "0.6994881", "0.6991573", "0.69816864", "0.69772863", "0.69744337", "0.6963677" ]
0.7567182
33
Maybe registered with undefined type accidentally if the user has typo in a constant type
undefined(state, n) { state.a += n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Defined(type)\n{\n\treturn (type !== \"undefined\");\n}", "unknownType() {\n console.log(this.type, this.type !== 'free', this.type !== 'premium');\n if (this.type !== 'free' && this.type !== 'premium') {\n throw new Error('type column has to be free or premium.');\n }\n }", "isDummy()\n{\n return 'dummy' == this.__type;\n}", "get isDefined() {\n return !!fastRegistry.getByType(this.type);\n }", "function Type() {}", "function register() {\n if (Object.prototype.typeOf !== boundTypeOf) {\n otypeof = Object.prototype.typeOf;\n Object.prototype.typeOf = boundTypeOf;\n }\n }", "function register() {\n if (Object.prototype.typeOf !== boundTypeOf) {\n otypeof = Object.prototype.typeOf;\n Object.prototype.typeOf = boundTypeOf;\n }\n }", "set type(value) {}", "ensure(types) {\n return {\n name: types.string.isRequired\n }\n }", "none(key) {\n throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`);\n }", "type() { }", "function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema === null || schema === void 0 ? void 0 : schema.getType(typeName)) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}", "function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema === null || schema === void 0 ? void 0 : schema.getType(typeName)) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}", "function getType() { return \"not\"; }", "function UnderreactType() {}", "getType() {}", "function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new _GraphQLError.GraphQLError(\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}", "function UniqueTypeNamesRule(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Type \\\"\".concat(typeName, \"\\\" already exists in the schema. It cannot also be defined in this type definition.\"), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new _GraphQLError.GraphQLError(\"There can be only one type named \\\"\".concat(typeName, \"\\\".\"), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}", "function registerType(type /*: string*/) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\"/* default */])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value))!==rule.type){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}}", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "get type() {}", "function registerType(type, skipAliasCheck) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts, skipAliasCheck);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function registerType(type, skipAliasCheck) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts, skipAliasCheck);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function registerType(type) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function registerType(type) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function effectiveType(varType, varDef) {\n return !varDef.defaultValue || varType instanceof _definition.GraphQLNonNull ? varType : new _definition.GraphQLNonNull(varType);\n}", "function kindOf(val) {\n\t if (val === null) {\n\t return 'Null';\n\t } else if (val === UNDEF) {\n\t return 'Undefined';\n\t } else {\n\t return _rKind.exec( _toString.call(val) )[1];\n\t }\n\t }", "function kindOf(val) {\n\t if (val === null) {\n\t return 'Null';\n\t } else if (val === UNDEF) {\n\t return 'Undefined';\n\t } else {\n\t return _rKind.exec( _toString.call(val) )[1];\n\t }\n\t }", "function checkType( value, type) {\n if ( type === PUBLIC) {\n return ((value & PHP.VM.Class[ type ]) === PHP.VM.Class[ type ]) || (value === PHP.VM.Class[ STATIC ]);\n } else {\n return ((value & PHP.VM.Class[ type ]) === PHP.VM.Class[ type ]);\n }\n\n }", "function deregister() {\n if (Object.prototype.typeOf === boundTypeOf) {\n Object.prototype.typeOf = otypeof;\n otypeof = undefined;\n }\n }", "function deregister() {\n if (Object.prototype.typeOf === boundTypeOf) {\n Object.prototype.typeOf = otypeof;\n otypeof = undefined;\n }\n }", "function newTypesComplain(req, res) {\n\n}", "function registerType(type) {\n var is = t[\"is\" + type] = function (node, opts) {\n return t.is(type, node, opts);\n };\n\n t[\"assert\" + type] = function (node, opts) {\n opts = opts || {};\n if (!is(node, opts)) {\n throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n }\n };\n}", "function effectiveType(varType, varDef) {\n\t return !varDef.defaultValue || varType instanceof _typeDefinition.GraphQLNonNull ? varType : new _typeDefinition.GraphQLNonNull(varType);\n\t}", "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "function preprocessorTypeError(type) {\n panic$1(`No preprocessor of type \"${type}\" was found, please make sure to use one of these: 'javascript', 'css' or 'template'`);\n}", "function isDef(val) {\n return typeof val != \"undefined\";\n}", "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "get type() {\n throw new Error('InternalModelMap.type is no longer available');\n }", "function registerType(type, skipAliasCheck) {\n var is = t[\"is\" + type] = function (node, opts) {\n return t.is(type, node, opts, skipAliasCheck);\n };\n\n t[\"assert\" + type] = function (node, opts) {\n opts = opts || {};\n if (!is(node, opts)) {\n throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n }\n };\n}", "function g$3(t){return t&&\"static\"===t.type}", "function effectiveType(varType, varDef) {\n return !varDef.defaultValue || varType instanceof _typeDefinition.GraphQLNonNull ? varType : new _typeDefinition.GraphQLNonNull(varType);\n}", "function reportInferrableType(node, typeNode, initNode) {\n if (!typeNode || !initNode || !typeNode.typeAnnotation) {\n return;\n }\n if (!isInferrable(typeNode, initNode)) {\n return;\n }\n let type = null;\n if (typeNode.typeAnnotation.type === typescript_estree_1.AST_NODE_TYPES.TSBooleanKeyword) {\n type = 'boolean';\n }\n else if (typeNode.typeAnnotation.type === typescript_estree_1.AST_NODE_TYPES.TSNumberKeyword) {\n type = 'number';\n }\n else if (typeNode.typeAnnotation.type === typescript_estree_1.AST_NODE_TYPES.TSStringKeyword) {\n type = 'string';\n }\n else {\n // shouldn't happen...\n return;\n }\n context.report({\n node,\n messageId: 'noInferrableType',\n data: {\n type,\n },\n fix: fixer => fixer.remove(typeNode),\n });\n }", "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "set_type(new_type){\n if(new_type){\n this.type = new_type;\n }\n else{\n this.invalid();\n }\n }", "function extendingUnknownTypeMessage(typeName, suggestedTypes) {\n var message = \"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\");\n\n if (suggestedTypes.length) {\n message += \" Did you mean \".concat(Object(_jsutils_quotedOrList__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), \"?\");\n }\n\n return message;\n}", "function isSimple(type) {\n return !!TYPE_CONVERTERS[type];\n }", "function isSimple(type) {\n return !!TYPE_CONVERTERS[type];\n}", "function Type() {\n}", "removable(type) { return this.removableTokens[type]!==undefined }", "_checkType(type) {\n\n if (this._specs[type] === undefined) {\n /**\n * @event spec-error\n * Fired when spec could not be loaded\n * detail payload: {string} spec name\n */\n let customEvent = new Event('spec-error', {composed: true, bubbles: true});\n customEvent.detail = type;\n setTimeout(() => {\n\n this.dispatchEvent(customEvent);\n console.warn('spec-error: Could not find specification of type: ' + type);\n }, 0);\n }\n\n\n }", "function Type() {\r\n}", "getDefaultValue(type) {\n switch (type) {\n case \"string\":\n return \"New Value\";\n case \"array\":\n return [];\n case \"boolean\":\n return false;\n case \"null\":\n return null;\n case \"number\":\n return 0;\n case \"object\":\n return {};\n default:\n // We don't have a datatype for some reason (perhaps additionalProperties was true)\n return \"New Value\";\n }\n }", "static type(type, mustExist = false) {\n const isValid = (value, strict = false) =>\n this.checkType(type, value, mustExist, strict)\n const ensureIsValid = (errorMessage, ...args) => {\n if (!isValid(...args)) {\n ERROR.typeError(errorMessage)\n }\n }\n return { isValid, ensureIsValid }\n }", "handleStaticResTypeChange(event, type)\t\t\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t{\n\t\tif(!r3IsSafeTypedEntity(this.state.editingStaticRes, 'object')){\n\t\t\treturn;\n\t\t}\n\n\t\t// check value\n\t\tlet\ttypeString;\n\t\tif(staticResDataType.staticResObjectDataType == type){\n\t\t\ttypeString = 'object';\n\t\t}else{\t// staticResDataType.staticResStringDataType\n\t\t\ttypeString = 'string';\n\t\t}\n\t\tif(!r3IsEmptyEntityObject(this.state.editingStaticRes, 'type')){\n\t\t\tif(typeString == this.state.editingStaticRes.type){\n\t\t\t\tconsole.warn('changed value type(' + JSON.stringify(type) + ') is something wrong.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// set type\n\t\tlet\tnewStaticRes\t= r3DeepClone(this.state.editingStaticRes);\n\t\tnewStaticRes.type\t= typeString;\n\n\t\t// update state\n\t\tthis.setState({\n\t\t\teditingStaticRes:\tnewStaticRes,\n\t\t\tstaticResMessage:\tnull\n\t\t});\n\t}", "function isSimple(type) {\n return !!TYPE_CONVERTERS[type];\n}", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isSpecifiedScalarName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function UniqueTypeNames(context) {\n var knownTypeNames = Object.create(null);\n var schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName\n };\n\n function checkTypeName(node) {\n var typeName = node.name.value;\n\n if (schema && schema.getType(typeName)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](existedTypeNameMessage(typeName), node.name));\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateTypeNameMessage(typeName), [knownTypeNames[typeName], node.name]));\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\r\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function isBuiltIn(type) {\n return !!BUILTINS[type];\n }", "function registered(type) {\n return turtles[type] != null;\n }", "function isUnknown(val) {\n return Unknown.isInstance(val);\n}", "function isBuiltIn(type) {\n return !!BUILTINS[type];\n}", "function et2_checkType(_val, _type, _attr, _widget)\n{\n\tif (typeof _attr == \"undefined\")\n\t{\n\t\t_attr = null;\n\t}\n\n\tfunction _err() {\n\t\tvar res = et2_typeDefaults[_type];\n\n\t\tif(typeof _val != \"undefined\" && _val)\n\t\t{\n\t\t\tegw.debug(\"warn\", \"Widget %o: '\" + _val + \"' was not of specified _type '\" +\n\t\t\t\t_type + (_attr != null ? \"' for attribute '\" + _attr + \"' \" : \"\") +\n\t\t\t\t\"and is now '\" + res + \"'\",_widget);\n\t\t}\n\t\treturn res;\n\t}\n\n\t// If the type is \"any\" simply return the value again\n\tif (_type == \"any\")\n\t{\n\t\treturn _val;\n\t}\n\n\t// we dont check default-value any further, that also fixes type=\"js\" does NOT accept null,\n\t// which happens on expanded values\n\tif (_val === et2_typeDefaults[_type])\n\t{\n\t\treturn _val;\n\t}\n\n\t// If the type is boolean, check whether the given value is exactly true or\n\t// false. Otherwise check whether the value is the string \"true\" or \"false\".\n\tif (_type == \"boolean\")\n\t{\n\t\tif (_val === true || _val === false)\n\t\t{\n\t\t\treturn _val;\n\t\t}\n\n\t\tif (typeof _val == \"string\")\n\t\t{\n\t\t\tvar lcv = _val.toLowerCase();\n\t\t\tif (lcv === \"true\" || lcv === \"false\" || lcv === \"\")\n\t\t\t{\n\t\t\t\treturn _val === \"true\";\n\t\t\t}\n\t\t\tif(lcv === \"0\" || lcv === \"1\")\n\t\t\t{\n\t\t\t\treturn _val === \"1\";\n\t\t\t}\n\t\t}\n\t\telse if (typeof _val == \"number\")\n\t\t{\n\t\t\treturn _val != 0;\n\t\t}\n\n\t\treturn _err();\n\t}\n\n\t// Check whether the given value is of the type \"string\"\n\tif (_type == \"string\" || _type == \"html\" || _type == \"rawstring\")\n\t{\n\t\tif (typeof _val == \"number\")\t// as php is a bit vague here, silently convert to a string\n\t\t{\n\t\t\treturn _val.toString();\n\t\t}\n\n\t\tif (typeof _val == \"string\")\n\t\t{\n\t\t\treturn _type == \"string\" ? html_entity_decode(_val) : _val;\n\t\t}\n\n\t\t// Handle some less common possibilities\n\t\t// Maybe a split on an empty string\n\t\tif(typeof _val == \"object\" && jQuery.isEmptyObject(_val)) return \"\";\n\n\t\treturn _err();\n\t}\n\n\t// Check whether the value is already a number, otherwise try to convert it\n\t// to one.\n\tif (_type == \"float\")\n\t{\n\t\tif (typeof _val == \"number\")\n\t\t{\n\t\t\treturn _val;\n\t\t}\n\n\t\tif (!isNaN(_val))\n\t\t{\n\t\t\treturn parseFloat(_val);\n\t\t}\n\n\t\treturn _err();\n\t}\n\n\t// Check whether the value is an integer by comparing the result of\n\t// parseInt(_val) to the value itself.\n\tif (_type == \"integer\")\n\t{\n\t\tif (parseInt(_val) == _val)\n\t\t{\n\t\t\treturn parseInt(_val);\n\t\t}\n\n\t\treturn _err();\n\t}\n\n\t// Parse the given dimension value\n\tif (_type == \"dimension\")\n\t{\n\t\t// Case 1: The value is \"auto\"\n\t\tif (_val == \"auto\")\n\t\t{\n\t\t\treturn _val;\n\t\t}\n\n\t\t// Case 2: The value is simply a number, attach \"px\"\n\t\tif (!isNaN(_val))\n\t\t{\n\t\t\treturn parseFloat(_val) + \"px\";\n\t\t}\n\n\t\t// Case 3: The value is already a valid css pixel value or a percentage\n\t\tif (typeof _val == \"string\" &&\n\t\t ((_val.indexOf(\"px\") == _val.length - 2 && !isNaN(_val.split(\"px\")[0])) ||\n\t\t (_val.indexOf(\"%\") == _val.length - 1 && !isNaN(_val.split(\"%\")[0]))))\n\t\t{\n\t\t\treturn _val;\n\t\t}\n\n\t\treturn _err();\n\t}\n\n\t// Javascript\n\tif (_type == \"js\")\n\t{\n\t\tif (typeof _val == \"function\" || typeof _val == \"undefined\")\n\t\t{\n\t\t\treturn _val;\n\t\t}\n\t\tif (_val) _val = _val.replace(/window\\.close\\(\\)/g, 'egw(window).close()');\n\n\t\t// Check to see if it's a string in app.appname.function format, and wrap it in\n\t\t// a closure to make sure context is preserved\n\t\tif(typeof _val == \"string\" && _val.substr(0,4) == \"app.\" && window.app)\n\t\t{\n\t\t\tvar parts = _val.split('.');\n\t\t\tvar func = parts.pop();\n\t\t\tvar parent = window;\n\t\t\tfor(var i=0; i < parts.length && typeof parent[parts[i]] != 'undefined'; ++i)\n\t\t\t{\n\t\t\t\tparent = parent[parts[i]];\n\t\t\t}\n\t\t\tif (typeof parent[func] == 'function')\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn jQuery.proxy(parent[func],parent);\n\t\t\t\t}\n\t\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t\treq.egw.debug('error', 'Function', _val);\n\t\t\t\t\treturn _err();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!_val || typeof _val == \"string\")\n\t\t{\n\t\t\treturn _val;\t// get compiled later in widgets own initAttributes, as widget is not yet initialised\n\t\t}\n\t}\n\n\t// We should never come here\n\tthrow(\"Invalid type identifier '\" + _attr + \"': '\" + _type+\"'\");\n}", "function registerSingleType(customTypeName, customTypeValue) {\n if (typeof customTypeName === 'object') {\n registerTypes(customTypeName);\n return;\n }\n if (typeof customTypeName !== 'string') {\n return;\n }\n \n var typeDefinitions = extensionInterface.getTypeDefinitions(),\n customTypeDefinition,\n composedCustomTypeDefinition,\n schemeAliases,\n matchMode;\n \n if (objKeys(typeDefinitions).indexOf(customTypeName) > -1) {\n throw 'Custom type name \"' + customTypeName + '\" conflicts with existing type name';\n }\n \n if (!/^([0-9a-z_]+)$/.test(customTypeName)) {\n throw 'Type name must only contain lowercase alphanumeric characters and underscore';\n }\n \n if (typeof customTypeValue === 'object' && customTypeValue !== null && ('definition' in customTypeValue)) {\n customTypeDefinition = customTypeValue.definition;\n schemeAliases = customTypeValue.schemeAliases;\n matchMode = customTypeValue.matchMode;\n } else {\n customTypeDefinition = customTypeValue;\n }\n \n if (typeof customTypeDefinition === 'string') {\n customTypeDefinition = composedCustomTypeDefinition = getCustomTypeDefinition(customTypeDefinition, matchMode, customTypeName);\n }\n \n if (typeof customTypeDefinition === 'number') {\n if ((customTypeDefinition & xtype.ANY) !== customTypeDefinition) {\n throw 'Custom extended type composite \\'' + customTypeName + '\\' can only be derived using built-in extended type Ids.';\n }\n } else if (typeof customTypeDefinition === 'object' && customTypeDefinition !== null) {\n if (typeof customTypeDefinition.validator !== 'function') {\n throw 'Custom type \\'' + customTypeName + '\\' definition is missing the validator function.';\n }\n if (composedCustomTypeDefinition !== customTypeDefinition) { // make internal copy of externally supplied object\n composedCustomTypeDefinition = objCreate(null);\n composedCustomTypeDefinition.validator = customTypeDefinition.validator;\n customTypeDefinition = composedCustomTypeDefinition;\n }\n } else if (typeof customTypeDefinition !== 'function') {\n throw 'No valid type definition provided for requested custom type \\'' + customTypeName + '\\'';\n }\n \n var customTypeIdentity = (typeof composedCustomTypeDefinition === 'object' ? composedCustomTypeDefinition.identity\n : typeof customTypeDefinition === 'object' ? customTypeDefinition.validator \n : customTypeDefinition);\n \n var existingTypeName = getTypeWithIdentity(customTypeIdentity);\n \n if (existingTypeName) {\n throw 'Custom type \\'' + customTypeName + '\\' conflicts with other type' +\n ' \\'' + existingTypeName + '\\' with identical definition';\n }\n \n if (schemeAliases) {\n if (typeof schemeAliases !== 'object') {\n throw 'Custom type \"' + customTypeName + '\" scheme aliases is not an object';\n }\n setSchemeAliases(customTypeName, schemeAliases);\n }\n extensionInterface.defineType(customTypeName, customTypeDefinition);\n }", "getType(){\n console.log(\"Needs an override\");\n }", "function type(rule, value, source, errors, options) {\n\t\t if (rule.required && value === undefined) {\n\t\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t\t return;\n\t\t }\n\t\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t\t var ruleType = rule.type;\n\t\t if (custom.indexOf(ruleType) > -1) {\n\t\t if (!types[ruleType](value)) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t // straight typeof check\n\t\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t}", "function BlankType(typeSpec) {\n if (Object.keys(typeSpec).length > 0) {\n throw new Error('BlankType can not be customized');\n }\n}", "__getTypeLabel() {\n return this.constructor.LabelSingular;\n }", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "function isBuiltIn(type) {\n return !!BUILTINS[type];\n}", "function defaultForType(type) {\n var def = {\n boolean: true,\n string: '',\n number: undefined,\n array: []\n };\n return def[type];\n } // given a flag, enforce a default type.", "registerValue(value, valueHolder) {\n const category = determineValueTypeCategory(value);\n if (category === ValueTypeCategory.Primitive) {\n valueHolder.valueId = 0;\n valueHolder.value = value;\n }\n else {\n const valueRef = this._serialize(value, 1, null, category);\n Verbose && this._log(`value #${valueRef.valueId} for trace #${valueHolder.traceId}: ${ValueTypeCategory.nameFrom(category)} (${valueRef.serialized})`);\n valueHolder.valueId = valueRef.valueId;\n valueHolder.value = undefined;\n }\n }", "function ValidateTypeValue(type, value)\n{\n\tif (type == \"Bool\")\n\t{\n\t\tif (value != \"true\" && value != \"false\")\n\t\t{\n\t\t\treturn \"default value must be either 'True' or 'False' for Bool\";\n\t\t}\n\t}\n\telse if (type == \"Int\" || type == \"Float\")\n\t{\n\t\tif (isNaN(value))\n\t\t{\n\t\t\treturn \"default value must be digit(s) for Int or Float\";\n\t\t}\n\t}\n\telse\n\t{\n\t\t// everything is fine as a string or custom type\n\t\treturn null;\n\t}\n}", "function replaceType(type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isListType\"])(type)) {\n // $FlowFixMe[incompatible-return]\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLList\"](replaceType(type.ofType));\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isNonNullType\"])(type)) {\n // $FlowFixMe[incompatible-return]\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function ensureDefault(Type, value) {\n if (value === undefined) {\n if (Type === types.Object || Type.prototype instanceof types.Object) {\n return {};\n }\n if (Type === types.Array || Type.prototype instanceof types.Array) {\n return [];\n }\n }\n return value;\n}", "getTypeFromValue(value, originalTypes) {\n if (value && value instanceof mdls.IdentifiableValue) {\n if (value.effectiveIdentifier.isPrimitive) {\n let type = value.effectiveIdentifier.name;\n if (type === 'concept') {\n type = 'CodeableConcept';\n } else if (type === 'xhtml') {\n // xhtml is a weird type in FHIR and should be treated like a string instead\n type = 'string';\n }\n return { code: type };\n } else {\n const def = this._specs.dataElements.findByIdentifier(value.effectiveIdentifier);\n const [type, value2] = this.getSimpleTypeAndValue(originalTypes.map(t => t.code), def, value);\n if (value2 == null) {\n // 13115, 'Couldn\\'t identify appropriate Extension.value[x] value for ${elementId}. Is it an attempt to reference a non-Entry?', 'Check value to ensure it is a primitive, maps to a FHIR datatype, or is an Entry (which allows references)', 'errorNumber'\n logger.error({ elementId: value.effectiveIdentifier.fqn }, '13115');\n return;\n }\n const map = this._specs.maps.findByTargetAndIdentifier(this._target, value2.effectiveIdentifier);\n if (map === undefined) {\n return;\n }\n const code = type;\n const profile = this._profileExporter.lookupProfile(map.identifier, true, true);\n if (code == 'Reference') {\n return { code: code, targetProfile: [profile.url] };\n } else if (common.isCustomProfile(profile) || profile.id !== type) {\n return { code: code, profile: [profile.url] };\n }\n return { code };\n }\n }\n }", "function isTypoTypeof(left, right, state) {\n var values;\n \n if (state.option.notypeof)\n return false;\n \n if (!left || !right)\n return false;\n \n values = state.inESNext() ? typeofValues.es6 : typeofValues.es3;\n \n if (right.type === \"(identifier)\" && right.value === \"typeof\" && left.type === \"(string)\")\n return !_.contains(values, left.value);\n \n return false;\n }", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "set loadType(value) {}", "function getType(value) {\n return ({}).toString.call(value);\n}", "function registerTypeByName(type) {\n if (registryLogger.isDebugEnabled()) {\n registryLogger.debug('Register Type \\'%s\\' by name [%s]', type.id, type.typeName);\n }\n typeByName[type.typeName] = type;\n return type;\n}", "get type () {\n return BLANK;\n }", "_sanitizeName (value, type) {\n if (typeof value !== \"string\") {\n throw new Error(`${type} must be a string`);\n }\n\n return value;\n }", "function canUseAsIs(valueType) {\n return valueType === \"string\" ||\n valueType === \"boolean\" ||\n valueType === \"number\" ||\n valueType === \"json\" ||\n valueType === \"math\" ||\n valueType === \"regexp\" ||\n valueType === \"error\";\n }", "function check(name, value, type) {\n switch (type) {\n\n case 'object':\n case 'array':\n var stringOfValue = Object.prototype.toString.call(value).toLowerCase();\n if(value !== undefined && stringOfValue !== '[object ' + type + ']') {\n throw new Error('Expecting ' + name + ' to be an ' + type + ', \"' + (stringOfValue) + '\" given');\n }\n break;\n\n case 'string':\n case 'function':\n var typeofValue = typeof value;\n if(value !== undefined && typeOfValue !== type) {\n throw new Error('Expecting ' + name + ' to be a ' + type + ', \"' + (typeOfValue) + '\" given');\n }\n break;\n\n default: // type not specified\n if(value === undefined) {\n throw new Error('Missing \"' + type + '\"');\n }\n }\n}", "get typeDefault()\n {\n return null;\n }", "function getApparentType(type) {\n if (type.flags & 16384 /* TypeParameter */) {\n type = getApparentTypeOfTypeParameter(type);\n }\n if (type.flags & 34 /* StringLike */) {\n type = globalStringType;\n }\n else if (type.flags & 340 /* NumberLike */) {\n type = globalNumberType;\n }\n else if (type.flags & 136 /* BooleanLike */) {\n type = globalBooleanType;\n }\n else if (type.flags & 512 /* ESSymbol */) {\n type = getGlobalESSymbolType();\n }\n return type;\n }", "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function isConstant(schema) {\n return (0, _isArray[\"default\"])(schema[\"enum\"]) && schema[\"enum\"].length === 1 || schema.hasOwnProperty(\"const\");\n}", "function isTypeOrUndefined(val, type) {\r\n\tfunction typeOrUndef(v,t) {\r\n\t\tvar actualType = typeOf(v);\r\n\t\treturn actualType == \"undefined\" || actualType == t;\t\r\n\t}\r\n\t\r\n\treturn new FunctionalAssertionResult(typeOrUndef, [val,type], \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"an object of type \"+type+\" or undefined\");\r\n}", "function LightType() {}", "static typeLiteral(value) {\n if (typeof value === 'string') {\n return TypeNames.anyType(`'${value}'`);\n }\n else {\n return TypeNames.anyType(`${value}`);\n }\n }" ]
[ "0.58754563", "0.57643586", "0.5762996", "0.5723538", "0.56492496", "0.5619613", "0.5619613", "0.56042075", "0.5596396", "0.5582464", "0.5554941", "0.5518423", "0.5518423", "0.5504347", "0.55030054", "0.54974097", "0.5473238", "0.5473238", "0.5392887", "0.5392577", "0.5375938", "0.53739274", "0.5373842", "0.5373842", "0.53689516", "0.53689516", "0.5330305", "0.5326214", "0.5326214", "0.53147596", "0.5314394", "0.5314394", "0.5312074", "0.530355", "0.53021634", "0.5300288", "0.5295912", "0.5287197", "0.52835023", "0.52807945", "0.52739495", "0.52618355", "0.52515715", "0.52407086", "0.5239271", "0.5239271", "0.5239271", "0.5239271", "0.52342916", "0.52332985", "0.52246004", "0.52220744", "0.52159965", "0.5215992", "0.5197803", "0.51976895", "0.519182", "0.51836264", "0.51834124", "0.5182562", "0.5182394", "0.51779807", "0.5176", "0.51733184", "0.51725066", "0.51645076", "0.5159034", "0.51497275", "0.51487255", "0.5143523", "0.51291066", "0.5117502", "0.5112793", "0.5112366", "0.51107585", "0.51064193", "0.5103382", "0.50975454", "0.50963366", "0.50961524", "0.5094598", "0.5092372", "0.5088902", "0.50867987", "0.5083428", "0.5083428", "0.5072264", "0.507073", "0.50679135", "0.50598806", "0.5058845", "0.50588167", "0.50576437", "0.50549877", "0.50525665", "0.5042759", "0.5042759", "0.50394595", "0.5034339", "0.50266325", "0.5025872" ]
0.0
-1
marks the end of the klyng app
function end() { process.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onEnd() {\n\t\t\tif ( ++counter === total ) {\n\t\t\t\tif ( clbk ) {\n\t\t\t\t\tclbk();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function endApp() {\n console.log(\n chalk.red(\n figlet.textSync(\"Goodbye!\", {\n font: \"Doom\",\n horizontalLayout: \"fitted\",\n verticalLayout: \"fitted\",\n width: 80,\n whitespaceBreak: true,\n })\n )\n );\n process.exit();\n}", "end() {\n }", "end() {\n }", "end(event) {\n\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "function tEnd(){\n\t\t\treturn tStart(true);\n\t\t}", "end() {\n this.log('end');\n }", "function endScreen() {\n push();\n textSize(30);\n fill(197, 26, 219);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You intoxicated yourself!`, width / 2, height / 2);\n pop();\n}", "function end(){\n return end;\n}", "function scriptEnding() {\n // re-enabled the standard application for touch events\n Controller.releaseJoystick(THRUST_CONTROLLER);\n Controller.releaseJoystick(VIEW_CONTROLLER);\n}", "function onFinish() {\n\t\tclbk();\n\t}", "end() { }", "function onEnd() {\n\n // reset the offsets\n stickyOffset = 0;\n\n if(pointer) {\n // if we have a pointer reference\n\n // update all the elements in the DOM\n setPointers();\n adjustBubbles();\n\n // the pointer is no longer active\n pointer.removeClass('active');\n\n if (scope.onEndFn) {\n scope.onEndFn();\n }\n }\n\n // reset the references\n pointer = null;\n ref = null;\n\n }", "buildEnd() {\n runs++;\n }", "mateEnd() {}", "onLineEnd() { }", "async end() {\n return;\n }", "end() {\n this.endZoomInMode();\n this.endHandMode();\n }", "function setEnd( end )\n{\n script.api.manualEnd = true;\n script.api.end = end;\n}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "jumpToEnd() {\n this.simulateKeyPress_(SAConstants.KeyCode.END, {ctrl: true});\n }", "endProcess() {\n this.index.end = this.history.length;\n }", "end() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"end\")) arr.exe();\n this.iterations++;\n this.engine.events.emit(`${this.name}-End`, this);\n if (this.engine.jumpingTo) return;\n this.engine.phases.current = this.engine.phases.get(this.next);\n this.engine.timer.reset();\n }", "function endScreen(){\n push();\n textSize(32);\n textAlign(CENTER);\n fill(255);\n text(txtEnd, width/2, height/2);\n pop();\n }", "function endScreen() {\n push();\n textSize(30);\n fill(255, 0, 0);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You lost!`, width / 2, height / 2);\n pop();\n}", "function end() {\n for (var i=0; i<words.length; i++) tick();\n }", "BunnyAtExit() {\n if (this.UpdatePoppedEggCount()) {\n this.Complete();\n } else {\n ui.AlarmEggCount();\n ui.Tip(\"You haven't got all the eggs yet - go back in\");\n }\n }", "async onEnd() {\n\t\tawait this.say('Exiting...');\n\t}", "function endTextEntry () {\n if (state.textInput) {\n state.textInput.abort()\n state.textInput = null\n resumeCapture()\n }\n}", "function i18nEnd() {\n var tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, \"tView should be defined\");\n i18nEndFirstPass(tView);\n}", "function i18nEnd() {\n var tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, \"tView should be defined\");\n i18nEndFirstPass(tView);\n}", "set end(value) {}", "function gameEnd() {\n push();\n background(wallpaper);\n textSize(finishState.size);\n fill(255);\n textAlign(CENTER, CENTER);\n textStyle(BOLD);\n strokeWeight(10);\n text(finishState.string, finishState.x, finishState.y);\n pop();\n}", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "function endGame() {\n setShouldStart(false)\n setWordCount(countWords(text))\n }", "checkForEnd() {\n if (this.rightPage !== 50) {\n this.onLastPage = false;\n } else {\n this.onLastPage = true;\n }\n }", "_onEnd() {}", "function end(){\n push();\n resizeCanvas(windowWidth, windowHeight);\n imageMode(CENTER);\n image(endImage,0,0,windowWidth,windowHeight);\n pop();\n}", "function afterAppend() {\n if (!--AppendLock) {\n runtime.editText();\n }\n minder.off(\"layoutallfinish\", afterAppend);\n }", "function end() {\n focusInput();\n updateInput = true;\n move(); up();\n }", "function end() {\n focusInput();\n updateInput = true;\n move(); up();\n }", "enterCommandEnd(ctx) {\n\t}", "endUpdate() {\r\n\r\n }", "function onEnd() {\n //console.log('' + this);\n scope.emit('end', this);\n }", "function END() {}", "end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = false;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }", "endMessage() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].strokeText(\"You Won!!.\",10,135);\n this.canvas[1].fillText(\"You Won!!.\",10,135);\n\n this.canvas[1].strokeText(\"End!!, Thank you for playing.\",10,this.canvas[0].height-50);\n this.canvas[1].fillText(\"End!!, Thank you for playing.\",10,this.canvas[0].height-50);\n }", "function showEnd(){\n console.log(\"End\")\n}", "moveToDocumentEnd() {\n this.handleControlEndKey();\n }", "exitQnaIdMark(ctx) {\n\t}", "onEndSpan(root) {\n if (!this.active)\n return;\n if (!root) {\n this.logger.debug('cannot end trace - no active trace found');\n return;\n }\n if (this.currentRootSpan !== root) {\n this.logger.debug('currentRootSpan != root on notifyEnd. Need more investigation.');\n }\n this.notifyEndSpan(root);\n }", "function endQuiz(){\n $(stage).append(\n '<div class=\"questionText\">You have finished the quiz!<br><br>Total questions:'\n +num+'<br>Correct answers: '+score+'</div>'\n );\n }", "function touchEnd(event) {ALLOW_ACTION_ON_SWIPE_END=true;} // last touch end event sets to allow clicks.", "endScript() {\r\n this._endScript = true;\r\n }", "function onEnd() {\n\n // reset the offsets\n stickyOffsetLow = 0;\n stickyOffsetHigh = 0;\n\n if(pointer) {\n // if we have a pointer reference\n\n // update all the elements in the DOM\n setPointers();\n adjustBubbles();\n\n // the pointer is no longer active\n pointer.removeClass('active');\n }\n\n // reset the references\n pointer = null;\n ref = null;\n dragRange = false;\n }", "function C012_AfterClass_Amanda_EndChat() {\n\tif (ActorGetValue(ActorPose) == \"Kneel\") ActorSetPose(\"Shy\");\n\tLeaveIcon = \"Leave\";\n}", "static get END() { return 6; }", "endDraw() {\n\t\tif (this.cursorEnabled) {\n\t\t\tthis.write(\"\\x1B[?25h\");\n\t\t\tthis.cursorVisible = true;\n\t\t}\n\t\tthis.write(\"\\x1B8\"); //load cursor pos\n\t}", "function endDraw() {\n draw = false;\n drawList = [];\n}", "end() {\n return this.index === this.questions.length;\n }", "exitCommandEnd(ctx) {\n\t}", "function theEnd() {\n console.log('This is the end!');\n}", "function onExit() {\n console.log('magik-server stopped'.red);\n console.log(pad('-', config.windowSize[0], '-').grey);\n cursor.reset();\n cursor.show();\n}", "finish(){\n model.stat.timer.stop();\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\n\t\tdocument.getElementById('nextBtn').disabled=true;\n\t\tdocument.getElementById('autoRunBtn').disabled=true;\n }", "function endTouch(event) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tvar i, L = event.changedTouches,touch, conf;\n\t\tfor(i=0; i< L.length; i++) {\n\t\t\ttouch = L.item(i);\n\t\t\tconf = configOfTouchId[ touch.identifier ];\n\t\t\tif(conf) {\n\t\t\t\tconf.automata[conf.state].apply(conf, [conf, \"release\", touch]);\n\t\t\t}\n\t\t}\n\t}", "onFocusExit() { }", "pressEnd () {\n if (this.buttonHasFocus) {\n this.index = this.length - 1;\n this.focus();\n }\n }", "function theEnd() {\n console.log(\"This is the end!\");\n}", "function badrejectionEnd() {\n background(0);\n push();\n textSize(64);\n fill(166, 1, 7);\n textSize(50);\n text(`3 days later`, width / 2, height / 2 - 50);\n text(`You were fine, but he didn't quite... survive the breakup`, width / 2, height / 2);\n text(`Perhaps you took a wrong turn somewhere.`, width / 2, height / 2 + 50);\n textSize(80);\n textFont(onyxFont);\n text(`THE END`, width / 2, height / 2 + 200)\n pop();\n}", "trajectoryEnd() {\n this.trajectoryIndex = this.trajectorySize - 1;\n this._drawTrajectories();\n }", "exit() {\n this.controller.loadContext(\"continuity\", {\n dotType: this._continuity.dotType,\n });\n }", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "function adbpEndSlateClick() {\n\ttry {\n\t\ttrackMetrics({ \n\t\t\ttype: \"endslate-click\", \n\t\t\tdata: {}\n\t\t}); \n\t} catch(e){}\n}", "function endQuiz() {\n\n // clear page\n clearPage();\n\n // replace start button\n $(\"#start-button\").append(\"<button>Click here to try again!</button>\");\n\n // show user how they did\n quizQuestion.append(\"<div>Correct Guesses: \" + correctGuesses + \"</div>\");\n quizQuestion.append(\"<div>Incorrect Guesses: \" + (questions.length - correctGuesses) + \"</div>\");\n\n }", "function end_game_flow () {\n\t// console.log(\"end...\");\n\t// block all the event to gems\n\tthis.backgroundView.updateOpts({\n\t\tblockEvents: true\n\t});\n\t// disable scoreboard\n\tthis._scoreboard.updateOpts({\n\t\tvisible: false\n\t});\n\t// show end screen\n\tthis._endheader.updateOpts({\n\t\tvisible: true,\n\t\tcanHandleEvents: true\n\t});\n\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\n\n\t// show score\n\tvar scoreText = new TextView({\n\t\tsuperview: this._endheader,\n\t\tx: 0,\n\t\ty: 35, // endscreen animate end point\n\t\twidth: 350,\n\t\theight: 233,\n\t\tautoSize: true,\n\t\ttext: \"You achieved \" + score.toString(),\n\t\tsize: 38,\n\t\tverticalAlign: 'middle',\n\t\thorizontalAlign: 'center',\n\t\tcanHandleEvents: false\n\t});\n\t// //slight delay before allowing a tap reset\n\tsetTimeout(emit_endgame_event.bind(this), 2000);\n\tconsole.log('end game flow.. \\n');\n}", "_endCommand() {\r\n if(!this.device) return;\r\n this._resetBuffer();\r\n this.buffer[0] = 0x04;\r\n this.buffer[GMMK_COMMAND_OFFSET] = GMMK_CMD_END;\r\n this._write(this.buffer);\r\n }", "function quizEnd() {\n /*\n @TODO: write your function code here\n */\n clearInterval(timerId);\n finalScore.textContent= score;\n questionsEl.setAttribute(\"class\", \"hide\");\n choicesEl.setAttribute(\"class\",\"hide\");\n endScreen.removeAttribute(\"class\");\n endScreen.setAttribute(\"style\",\"text-align:center\")\n}", "exit() {\n this.exit();\n }", "function onViewChangeEnd() {\n _addLabelsForZoomLevel();\n }", "function end () {\n //the page goes white\n $('body').css({\n backgroundColor: 'white',\n });\n $('#canvas').css({\n visibility: 'hidden',\n });\n\n //the final package downloads\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\n\n //the game functions stop running\n end = true;\n\n //the music stops\n Gibber.clear();\n}", "function endRound()\n{\n //@TODO: Hier coderen we alles om een ronde te beëindigen\n\n}", "function C010_Revenge_SidneyJennifer_EndChapter() {\n\tSetScene(CurrentChapter, \"Outro\");\n}", "function endCurrentCall() {\n\n}", "function endCT(){\n // HERE ADD YOUR CODE\n \n return false;\n }", "function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}", "function endEvent(){}", "set end(end) {\n\t\tthis._end = end;\n\t}", "function end() {\r\n bg.visible = false;\r\n monkey.visible = false;\r\n\r\n bananaGroup.destroyEach();\r\n stoneGroup.destroyEach();\r\n}", "finish() {\n this._ctx.restore();\n }", "function i18nEnd(){var tView=getLView()[TVIEW];ngDevMode&&assertDefined(tView,\"tView should be defined\");i18nEndFirstPass(tView);}", "end() {\n // Debugging line.\n Helper.printDebugLine(this.end, __filename, __line);\n\n // Let the user know that the cache stored in the database will be cleared.\n let tmpSpinner = new Spinner('Clearing cache stored in the database %s');\n tmpSpinner.start();\n\n this.clearCacheDB().then(() => {\n // Remove the information with the spinner.\n tmpSpinner.stop(true);\n\n // If we used the database as cache, the user should know this.\n if (Global.get('useDB')) {\n this.output.writeLine(`Used database until page ${Global.get('useDB')}`, true);\n }\n\n // Write some ending lines.\n this.output.writeUserInput(this);\n this.getReadableTime();\n\n // Close the write stream to the log file.\n this.output.logger.end();\n this.removeLockFile();\n }).catch(error => {\n console.log(error);\n });\n }", "endShape() {\n this._ctx.fill();\n }", "_after() {\n this._exitContext();\n }", "function endAnnotation(aElement) {\n const annPack = aElement && aElement._ANNOTATION_PACK || aElement;\n annPack && annPack.end && annPack.end();\n Utils.removeEventHandlers('roomView:', {\n screenChange: resizeAnnotationCanvas\n });\n annotation = null;\n }", "end() {\n Object.assign(this.previousState, this.state); // Save the previous state\n this.state.inside = false;\n\n // Notify the nodes\n this.notify();\n }", "function endingPoint() {\n painting = false;\n ctx.beginPath();\n }" ]
[ "0.6194811", "0.61424464", "0.6139903", "0.6139903", "0.6123729", "0.6100736", "0.6020073", "0.6016448", "0.601313", "0.60096794", "0.5990767", "0.59701395", "0.59687465", "0.59394526", "0.5926859", "0.58457094", "0.5839421", "0.58145016", "0.5811134", "0.58100903", "0.5785833", "0.5778491", "0.5778491", "0.5778491", "0.5778491", "0.5753937", "0.5746118", "0.57399553", "0.5729371", "0.5690253", "0.56563306", "0.56552", "0.5630613", "0.5627188", "0.56271696", "0.56271696", "0.5623901", "0.56085724", "0.5590751", "0.5590387", "0.55813825", "0.5573314", "0.55287296", "0.5519291", "0.5518714", "0.5518714", "0.55182284", "0.5504726", "0.5492625", "0.5491918", "0.5484369", "0.54818326", "0.5475399", "0.54709494", "0.54671776", "0.5454781", "0.54504794", "0.54377115", "0.5429334", "0.54270196", "0.5406251", "0.5404399", "0.54025066", "0.54017764", "0.53966105", "0.5377162", "0.5373872", "0.5360661", "0.53603894", "0.5353001", "0.53482956", "0.5348022", "0.53454924", "0.5344194", "0.5340838", "0.5339958", "0.5329293", "0.53286034", "0.5318468", "0.53156674", "0.5309668", "0.5307208", "0.53052783", "0.5301931", "0.52953005", "0.5294886", "0.5292239", "0.52916515", "0.529106", "0.5288464", "0.52863824", "0.5283006", "0.5282343", "0.52757555", "0.5274179", "0.52698976", "0.5263037", "0.52628046", "0.5260293", "0.52556556", "0.5254515" ]
0.0
-1