52 Matching Annotations
  1. Jan 2024
    1. Instance methods Instances of Models are documents. Documents have many of their own built-in instance methods. We may also define our own custom document instance methods. // define a schema const animalSchema = new Schema({ name: String, type: String }, { // Assign a function to the "methods" object of our animalSchema through schema options. // By following this approach, there is no need to create a separate TS type to define the type of the instance functions. methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } }); // Or, assign a function to the "methods" object of our animalSchema animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); }; Now all of our animal instances have a findSimilarTypes method available to them. const Animal = mongoose.model('Animal', animalSchema); const dog = new Animal({ type: 'dog' }); dog.findSimilarTypes((err, dogs) => { console.log(dogs); // woof }); Overwriting a default mongoose document method may lead to unpredictable results. See this for more details. The example above uses the Schema.methods object directly to save an instance method. You can also use the Schema.method() helper as described here. Do not declare methods using ES6 arrow functions (=>). Arrow functions explicitly prevent binding this, so your method will not have access to the document and the above examples will not work.

      Certainly! Let's break down the provided code snippets:

      1. What is it and why is it used?

      In Mongoose, a schema is a blueprint for defining the structure of documents within a collection. When you define a schema, you can also attach methods to it. These methods become instance methods, meaning they are available on the individual documents (instances) created from that schema.

      Instance methods are useful for encapsulating functionality related to a specific document or model instance. They allow you to define custom behavior that can be executed on a specific document. In the given example, the findSimilarTypes method is added to instances of the Animal model, making it easy to find other animals of the same type.

      2. Syntax:

      Using methods object directly in the schema options:

      javascript const animalSchema = new Schema( { name: String, type: String }, { methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } } );

      Using methods object directly in the schema:

      javascript animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };

      Using Schema.method() helper:

      javascript animalSchema.method('findSimilarTypes', function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); });

      3. Explanation in Simple Words with Examples:

      Why it's Used:

      Imagine you have a collection of animals in your database, and you want to find other animals of the same type. Instead of writing the same logic repeatedly, you can define a method that can be called on each animal instance to find similar types. This helps in keeping your code DRY (Don't Repeat Yourself) and makes it easier to maintain.

      Example:

      ```javascript const mongoose = require('mongoose'); const { Schema } = mongoose;

      // Define a schema with a custom instance method const animalSchema = new Schema({ name: String, type: String });

      // Add a custom instance method to find similar types animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };

      // Create the Animal model using the schema const Animal = mongoose.model('Animal', animalSchema);

      // Create an instance of Animal const dog = new Animal({ type: 'dog', name: 'Buddy' });

      // Use the custom method to find similar types dog.findSimilarTypes((err, similarAnimals) => { console.log(similarAnimals); }); ```

      In this example, findSimilarTypes is a custom instance method added to the Animal schema. When you create an instance of the Animal model (e.g., a dog), you can then call findSimilarTypes on that instance to find other animals with the same type. The method uses the this.type property, which refers to the type of the current animal instance. This allows you to easily reuse the logic for finding similar types across different instances of the Animal model.

      Certainly! Let's go through each part and explain it in simple terms: ### 1. `this` in Mongoose: - **What is `this`?** In JavaScript, `this` refers to the current context or object. In Mongoose, particularly within methods and middleware functions, `this` represents the instance (document) the function is currently operating on. - **Why is it used?** `this` is used to access and modify the properties of the current document. For example, in a Mongoose method, `this` allows you to refer to the fields of the specific document the method is called on. ### 2. Example: Let's use the `userSchema.pre("save", ...)`, which is a Mongoose middleware, as an example: ```javascript userSchema.pre("save", async function (next) { if (!this.isModified("password")) { next(); } else { this.password = await bcrypt.hash(this.password, 10); next(); } }); ``` - **Explanation in Simple Words:** - Imagine you have a system where users can sign up and set their password. - Before saving a new user to the database, you want to ensure that the password is securely encrypted (hashed) using a library like `bcrypt`. - The `userSchema.pre("save", ...)` is a special function that runs automatically before saving a user to the database. - In this function: - `this.isModified("password")`: Checks if the password field of the current user has been changed. - If the password is not modified, it means the user is not updating their password, so it just moves on to the next operation (saving the user). - If the password is modified, it means a new password is set or the existing one is changed. In this case, it uses `bcrypt.hash` to encrypt (hash) the password before saving it to the database. - The use of `this` here is crucial because it allows you to refer to the specific user document that's being saved. It ensures that the correct password is hashed for the current user being processed. In summary, `this` in Mongoose is a way to refer to the current document or instance, and it's commonly used to access and modify the properties of that document, especially in middleware functions like the one demonstrated here for password encryption before saving to the database.

    Tags

    Annotators

    URL

    1. Instead, look for the option to "Sign in with Google," which is a safer way to sync your mail to other apps. Learn about Sign in with Google.
  2. Dec 2023
    1. This describes account linking from the opposite direction than I'm used to: starting with the Google App, which requests your app to share data from your service with Google.

      As it says on https://developers.google.com/identity/account-linking overview:

      The secure OAuth 2.0 protocol lets you safely link a user's Google Account with their account on your platform, thereby granting Google applications and devices access to your services.

    1. A personalized button gives users a quick indication of the session status, both on Google's side and on your website, before they click the button. This is especially helpful to end users who visit your website only occasionally. They may forget whether an account has been created or not, and in which way. A personalized button reminds them that Sign In With Google has been used before. Thus, it helps to prevent unnecessary duplicate account creation on your website.

      first sighting: sign-in: problem: forgetting whether an account has been created or not, and in which way

  3. Nov 2023
    1. Sign in with Google for Web doesn't support silent sign in, in which case a credential is returned without any UI displayed. End users always see some UI, manual or automatic sign in, when a login credential is returned from Google to the relying party. This improves user privacy and control.
    1. As a prevention method, organizations should consider implementing passwordless practices like fingerprints or facial recognition, as well as modern authentication standards like WebAuthn, which remove passwords from the authentication experience. When organizations opt for these authentication methods, they help to mitigate the risk of stolen credentials, and minimize the chance of account takeovers.
    1. Improved blank slate experiences: After a user signs in using a social media account, site owners have the ability to auto-suggest or auto-populate their settings with information held in their social account. This lets organizations create a first impression of convenience and encourage further use of their apps and site.
  4. Oct 2023
  5. Mar 2023
  6. Nov 2022
    1. Page: Escape Sequences

      I was looking for documentation on escaped characters.

      This was because Auto Hotkey threw an error when I used <%* %> as an option for the text insert script. It said the illegal character was * but really what was happening was that the unquoted text %* % was treated like a variable since % is used to enclose variables in Auto Hotkey. The solution was to escape the percent sign with one left back tick.

  7. Sep 2022
    1. they suggest that the use of symbols to model the world developed rapidly between about 20,000 and 10,000 years ago, and has the effect of giving emphasis to analytic thought as the dominant mode of human consciousness. Rather than seeing symbols as the impetus for human logic, they argue for presymbolic elements of logic in Peirce’s sign categories shared widely by humans and other animals.

      !- explanation : language - instead of arguing for the power of symbols, they argue for the power of presymbolic elements of logic as per Charles Saunder Peirce's sign categories

  8. Mar 2022
    1. S CLEAR THAT spontaneous gestures can support intelligent thinking. There’salso a place for what we might call designed gestures: that is, motions that arecarefully formulated in advance to convey a particular notion. Geologist MicheleCooke’s gestures, inspired by sign language, fall into this category; she verydeliberately uses hand movements to help students understand spatial conceptsthat are difficult to communicate in words.

      There are two potential axes for gestures: spontaneous and intentional. Intentional gestures include examples like sign language, memetic pantomimes, and dance or related animal mimicry gestures used by indigenous cultures for communicating the movement and behavior of animals.

      Intentional gestures can also be specifically designed for pedagogical purposes as well as for mnemonic purposes.

      cross reference to Lynne Kelly example about movement/gesture in indigenous cultures.

    2. Cooke often employs a modified form of sign language with her (hearing)students at UMass. By using her hands, Cooke finds, she can accurately capturethe three-dimensional nature of the phenomena she’s explaining.

      Can gesturing during (second) language learning help dramatically improve the speed and facility of the second language acquisition by adult learners?

      Evidence in language acquisition in children quoted previously in The Extended Mind would indicate yes.

      link this related research

    3. People who are fluent in sign language, as Cooke is, have beenfound to have an enhanced ability to process visual and spatial information. Suchsuperior performance is exhibited by hearing people who know sign language, aswell as by the hearing impaired—suggesting that it is the repeated use of astructured system of meaning-bearing gestures that helps improve spatialthinking.

      Evidence indicates that those who are have experience or fluency in sign language (both hearing and non-hearing) have increased visual-spatial intelligence and reasoning. Practice using gesturing directly improves spatial thinking.

    4. Children can typically understand and act on a request to point to theirnose, for example, a full six months before they are able to form the spokenword “nose.”

      Many children are also able to begin using sign language for their needs prior to being able to use spoken language as well.

  9. Dec 2021
    1. Examining the dynamics oforganizational development is useful for understanding how alliances withnational intermediaries can strengthen grassroots engagement. Table 2 sum-marizes these dynamics.

      Flagging that something is important. then following with

    Tags

    Annotators

  10. Oct 2021
    1. We will also show you how to de-link your Chrome profile from your Google account(s) by stopping Chrome from syncing with Google in the first place. This will help keep your Chrome profile separate from your Google account and enhance your online privacy.
    2. To do that, Chrome automatically links your Chrome profile to a Google account when you sign in to any Google service on the web. That helps Google deliver a ‘seamless experience’ across all devices by letting you sync your history, bookmarks, passwords, etc., across multiple devices. Meanwhile, privacy-conscious users see this as a major threat to their online privacy and advise users to remove their Google account from Chrome.
    3. As mentioned already, Chrome automatically signs you in to your Google account every time you sign into a Google service, like Gmail, YouTube, Google Photos, etc. It also links your current Chrome profile to that account. While Google says that it does so to offer a ‘seamless experience’, it is a privacy nightmare for many users.
    1. Some Chrome users may like the new functionality as it makes it easier for them to sign in or out of Chrome and Google on the Web. Others may dislike it for privacy and user-choice reasons. Think about it, if you sign in to Chrome you are automatically recognized by any Google property on the web as that Google user.
  11. Jul 2021
  12. Mar 2021
    1. any form of activity, conduct, or process that involves signs, including the production of meaning. A sign is anything that communicates a meaning, that is not the sign itself, to the interpreter of the sign. The meaning can be intentional such as a word uttered with a specific meaning, or unintentional, such as a symptom being a sign of a particular medical condition. Signs can communicate through any of the senses, visual, auditory, tactile, olfactory, or taste.
  13. Dec 2020
    1. Used injudiciously in these circumstances, mathematics – and especially mathematical modelling – can serve to obfuscate rather than clarify, or at best add nothing at all to the situation other than the illusion of control.

      We find it very difficult to deal with uncertainty so are comforted by the high Priestesses of our era, vaguely aware of our hunger for the signs, symbols written in the runes descended from antiquity for portents of the future.

  14. Oct 2020
  15. Jun 2020
    1. Heat and work have signs (positive or negative), and the sign of each depends on whether the system we are considering is gaining or losing energy. In this class, if a process makes the system gain energy, qqq and/or www are positive; if the process makes the system lose energy, qqq and/or www are negative. We can put this information into four formal statements: If heat flows into a system, qqq is positive. If heat flows out of a system, qqq is negative If the surroundings do work on the system, www is positive. If the system does work, www is negative.

      Heat and work have signs (positive or negative), and the sign of each depends on whether the system we are considering is gaining or losing energy. In this class, if a process makes the system gain energy, q and/or w are positive; if the process makes the system lose energy, q and/or w are negative. We can put this information into four formal statements:

      • If heat flows into a system, q is positive.
      • If heat flows out of a system, q is negative
      • If the surroundings do work on the system, w is positive.
      • If the system does work, w is negative.
  16. May 2020
  17. touchpoints-demo.app.cloud.gov touchpoints-demo.app.cloud.gov
    1. Touchpoints uses Login.gov to handle user accounts. Once you authenticate with Login.gov, you will be signed in and redirected back to Touchpoints.
  18. Apr 2020
  19. Oct 2019
    1. Get the best Acrylic Moulding and Bending Services by Professional Acrylic LLC

      We are one of the best Suppliers for Acrylic Moulding and Bending in Dubai. Our professional and qualified team is very best in doing Moulding and Bending in Acrylic Products. Call our expert to get a free quote.

    2. Professional Acrylic LLC | Acrylic Moulding and Bending Dubai

      To find the best suppliers in Dubai which are good in Acrylic Fabrication, Acrylic Engraving, Acrylic Moulding and Acrylic Stand Suppliers in Dubai? Call our expert now to get a free quote.

  20. Feb 2019
    1. but we have ample proof, that this did not arise from a principle of neces-sity, but conveniency

      What would Siegert have to say about this?

    2. our ideas; and this is the utmost extent or their power. Did nothing pass in the mind of man, but ideas;

      As opposed to a sign (e.g. smoke is a sign of fire)

  21. Jan 2019
  22. Aug 2018
  23. Oct 2016
    1. Which single sign-on services do you integrate with? Technically, single sign-on can work with any IDP that is SAML 2.0 compliant -- this includes services like Okta, Ping Identity, OneLogin, and Bitium.

      single sign-on

  24. Oct 2015
  25. Nov 2013
    1. Truths are illusions which we have forgotten are illusions- they are metaphors that have become worn out and have been drained of sensuous force, coins which have lost their embossing and are now considered as metal and no longer as coins.

      Money was originally precious metals, and then signs for precious metals (paper money), and then signs for the signs for precious metals (debit/credit cards), and is now turning into signs for the signs for the signs for precious metals (apps that represent debit/credit cards). Just as money underwent this transition, so did truth. We now take truth to mean something fixed, but we have just forgotten that truth is a sign for a social illusion.

    1. "If signs are infallible," he says, "they are not arguments, because where they exist there is no room for question; even if they are doubtful, they are not arguments because they themselves need the support of arguments."

      Signs vs. arguments

  26. Oct 2013