69 Matching Annotations
  1. Mar 2024
    1. Having foughtas an officer under Prince Eugene of Savoy in the Austro–Turkish War of1716–18, he understood military discipline. This was how he came to trustin the power of emulation; he believed that people could be conditioned todo the right thing by observing good leaders. He shared food with thosewho were ill or deprived. Visiting a Scottish community north of Savannah,he refused a soft bed and slept outside on the hard ground with the men.More than any other colonial founder, Oglethorpe made himself one of thepeople, promoting collective effort.43

      Description of James Edward Oglethorpe

  2. Jan 2024
    1. the castle rock of edinburgh

      for - example - concrescence - castle rock of Edinburgh

      example - concrescence - castle rock of Edinburgh - rocks ingress but have much less capacity than living organisms

    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. It's also common to want to compute the transitive closure of these relations, for instance, in listing all the issues that are, transitively, duped to the current one to hunt for information about how to reproduce them.
  3. Dec 2023
      • for: climate crisis - debate - community action, climate crisis - discussion - community action, indyweb - curation example

      • discussion: effectiveness of community action to address climate crisis

        • This is a good discussion on the effectiveness of community action to address the climate crisis.
        • It offers a diverse range of perspectives that can all be mapped using SRG trailmark protocol and then data visualized within Indyweb via cytoscape
    1. two tablespoons of crude oil contain as much free energy as would be expended by an adult male laborer in a day you every time you fill up your gas tank if you still have a gas tank uh 00:59:48 you're putting is you're putting two years of manual labor in that in that gas tank
      • for: fossil fuel energy density - example

      • example : energy density of fossil fuel

        • 2 tablespoons of fossil fuel containsv the energy equivalent of one full day of human
        • one full average gasoline tank is equivalent to 2 years of human labour
    1. we are certainly special I mean 00:02:57 no other animal rich the moon or know how to build atom bombs so we are definitely quite different from chimpanzees and elephants and and all the rest of the animals but we are still 00:03:09 animals you know many of our most basic emotions much of our society is still run on Stone Age code
      • for: stone age code, similar to - Ronald Wright - computer metaphor, evolutionary psychology - examples, evolutionary paradox of modernity, evolution - last mile link, major evolutionary transition - full spectrum in modern humans, example - MET - full spectrum embedded in modern humans

      • comment

      • insights

        • evolutionary paradox of modernity
          • modern humans , like all the living species we share the world with, are the last mile link of the evolution of life we've made it to the present, so all species of the present are, in an evolutionary sense, winners of their respective evolutionary game
          • this means that all our present behaviors contain the full spectrum of the evolutionary history of 4 billion years of life
          • the modern human embodies all major evolutionary transitions of the past
          • so our behavior, at all levels of our being is a complex and heterogenous mixture of evolutionary adaptations from different time periods of the 4 billion years that life has taken to evolve.
          • Some behaviors may have originated billions of years ago, and others hundred thousand years ago.
      • Examples: humans embody full spectrum of METs in our evolutionary past

        • fight and flight response
          • early hominids on African Savannah hundreds of thousands to millions of years ago when hominids were predated upon by wild predators
        • cancer
          • normative intercell communication breaks down and reverts to individual cell behavior from billions of years ago
            • see Michael Levin's research on how to make metastatic cancer cells return to normative collective, cooperative behavior
        • children afraid to sleep in the dark
          • evolutionary adaptation against dangerous animals that might have hid in the dark - dangerous insiects, snakes, etc, which in the past may have resulted in human fatalities
        • obesity
          • hunter gatherer hominid attraction to rich sources of fruit. Eating as much of it as we can and maybe harvesting as much as we can and carrying that with us.
            • like squirrels storing away for the winter.
  4. Nov 2023
    1. there are armed poachers who shoot at us they steal they kill our pigs we think about it all the time 00:06:53 after the wild pigs it's deer their numbers have decreased dramatically since the poachers forced the jarrow to hunt for them wild game is being sold illegally on the 00:07:12 indian market
      • for: cultural destruction - Jawara - poachers, modernity - disruption of ecological cycle, example - ecosystem disruption

      • comment

      • example: ecosystem disruption
      • example: human cultural ecosystem in balance
      • the uncontrolled influence of the outside world always follows. Governments are too shortsighted to understand that this always happens and feel they can control the situation. They cannot. Greed breeds resourcefulness
        • In a matter of years, poachers have disrupted the Jawara's traditional diet, forcing them to overhunt deer and disrupt the entire ecological cycle that existed up until then.It's an example of how modernity ruthlessly and rapidly disrupts ecosystems. In this case, ecosystems where humans have integrated in a balanced way.
    1. I 01:00:30 think that a proper version of the concept of synchronicity would talk about multiscale patterns so that when you're looking at electrons in the computer you would say isn't it amazing that these electrons went over here and 01:00:42 those went over there but together that's an endgate and by the way that's part of this other calculation like amazing down below all they're doing is following Maxwell's equations but looked at at another level wow they just just 01:00:54 computed the weather in you know in in Chicago so I I I think what you know I it's not about well I was going to say it's not about us and uh and our human tendency to to to to pick out patterns 01:01:07 and things like but actually I I do think it's that too because if synchronicity is is simply how things look at other scales
      • for: adjacency - consciousness - multiscale context

      • adjacency between

        • Michael's example
        • my idea of how consciousness fits into a multiscale system
      • adjacency statement
        • from a Major Evolutionary Transition of Individuality perspective, consciousness might be seen as a high level governance system of a multicellular organism
        • this begs the question: consciousness is fundamentally related to individual cells that compose the body that the consciousness appears to be tethered to
        • question: Is there some way for consciousness to directly access the lower and more primitive MET levels of its own being?
    2. when we work on cancer what you see is that when when 00:30:18 individual cells electrically disconnect from the rest of the body they their cognitive light cone shrinks they're back to their amoeba tiny little e gos and as far as they're concerned the rest of the body is just environment to them
      • for: MET of individuality - examples of breakdown - cancer

      • paraphrase

        • cancer is an example of when some part of the evolutionary program that coheres multicellularity into a cohesive whole goes faulty
          • then some subset of cells lose their coherence programming / story / narrative, the unity is lost and that cellular subset no longer identifies as part of the higher order collective individual, but return to a much more evolutionarily primitive state of pre-MET of individuality
        • this means that the MET individuality coherence program has weaknesses that can cause groups of cells to lose sight of the unifying logic and return to the primitive state
        • cancer demonstrates that these primitive programs still exist in all cells in our bodies and when the regulating coherence program is faulty, they can return to these more primitive states
  5. Sep 2023
    1. esearchers in 2019 did this at University of Tel Aviv and they took a primrose flower and they would play different sounds 00:06:03 to the flower and they would play you know like traffic noises low noises bat noises High noises and then the sounds of approaching pollinator and only when they approached or played the sounds of an approaching pollinator 00:06:15 did the flowers respond and they respond by producing more and sweeter nectar within just a couple of seconds right so the flowers hear the B through its petals 00:06:26 and get excited okay so plants can here
      • for: example - animal-plant communication, bee-flower communication, bee - primrose flower communication, communication - animal - plant, communication - bee - flower, 2019 University of Tel Aviv study
  6. Aug 2023
    1. he "Old Man of La Chapelle", for example, is the name given to the remains of a Neanderthal who lived 56,000 years ago, found buried in the limestone bedrock of a small cave near La Chapelle-aux-Saints, in France in 1908.
      • for: life expectancy - ancestors - example
      • example
      • paraphrase
        • The "Old Man of La Chapelle", is the name given to the remains of a Neanderthal who lived 56,000 years ago,
          • found buried in the limestone bedrock of a small cave near La Chapelle-aux-Saints, in France in 1908.
        • He was found to have had arthritis, bone regrowth along the gums where he lost several teeth.
  7. Dec 2022
    1. cultural evolution can lead to genetic evolution. "The classic example is lactose tolerance," Waring told Live Science. "Drinking cow's milk began as a cultural trait that then drove the [genetic] evolution of a group of humans." In that case, cultural change preceded genetic change, not the other way around. 

      !- example of : cultural evolution leading to genetic evolution - lactose intolerance

  8. Oct 2021
  9. Sep 2021
    1. Some would argue that the phrase ''survival of the fittest'' is tautological, in that the fittest are defined as those that survive to reproduce.
  10. Jun 2021
  11. May 2021
    1. Use cases: Volumes are most useful when you need more storage space but don’t need the additional processing power or memory that a larger Droplet would provide, like: As the document root or media upload directory for a web server To house database files for a database server As a target location for backups As expanded storage for personal file hosting platforms like ownCloud As components for building more advanced storage solutions, like RAID arrays
  12. Mar 2021
    1. Before a bug can be fixed, it has to be understood and reproduced. For every issue, a maintainer gets, they have to decipher what was supposed to happen and then spend minutes or hours piecing together their reproduction. Usually, they can’t get it right, so they have to ask for clarification. This back-and-forth process takes lots of energy and wastes everyone’s time. Instead, it’s better to provide an example app from the beginning. At the end of the day, would you rather maintainers spend their time making example apps or fixing issues?
  13. Feb 2021
    1. div:nth-of-type(3n+1) { grid-column: 1; } div:nth-of-type(3n+2) { grid-column: 2; } div:nth-of-type(3n+3) { grid-column: 3; } div:nth-of-type(-n+3) { grid-row: 1; }
    2. #ttt > * { border: 1px solid black; border-width: 0 1px 1px 0; display: flex; /* flex styling to center content in divs */ align-items: center; justify-content: center; } #ttt > *:nth-of-type(3n) { border-right-width: 0; } #ttt > *:nth-of-type(n+7) { border-bottom-width: 0; }
  14. Nov 2020
  15. Oct 2020
    1. A spreadsheet may be represented as a directed acyclic graph, with each cell a vertex and an edge connected a cell when a formula references another cell. Other applications include scheduling, circuit design and Bayesian networks.
    1. const countriesRegExp = countries.reduce( (regex, country, i) => (i === 0 ? `(${country})` : `${regex}|(${country})`), "" )
    1. Listening for External Changes By wrapping a stateful ExternalModificationDetector component in a Field component, we can listen for changes to a field's value, and by knowing whether or not the field is active, deduce when a field's value changes due to external influences.
    1. // Make a HOC
      // This is not the only way to accomplish auto-save, but it does let us:
      // - Use built-in React lifecycle methods to listen for changes
      // - Maintain state of when we are submitting
      // - Render a message when submitting
      // - Pass in debounce and save props nicely
      export default props => (
        <FormSpy {...props} subscription={{ values: true }} component={AutoSave} />
      );
      
  16. Sep 2020
  17. Aug 2020
  18. Jul 2020
  19. May 2020
    1. This change was made because GitLab License Management is now renamed to GitLab License Compliance. After review with users and analysts, we determined that this new name better indicates what the feature is for, aligns with existing market terminology, and reduces confusion with GitLab subscription licensing features.
  20. Apr 2020
    1. In informal contexts, mathematicians often use the word modulo (or simply "mod") for similar purposes, as in "modulo isomorphism".
  21. Mar 2020
  22. Feb 2020
  23. Nov 2019
    1. const setRefs = useRef(new Map()).current; const { children } = props; return ( <div> {React.Children.map(children, child => { return React.cloneElement(child, { // v not innerRef ref: node => { console.log('imHere'); return !node ? setRefs.delete(child.key) : setRefs.set(child.key, node)

      Illustrates the importance of having unique keys when iterating over children, since that allows them to be used as unique keys in a Map.

    1. Using expect { }.not_to raise_error(SpecificErrorClass) risks false positives, as literally any other error would cause the expectation to pass, including those raised by Ruby (e.g. NoMethodError, NameError, and ArgumentError)

      Actually, those would be false negatives: the absence of a test failure when it should be there.

      https://en.wikipedia.org/wiki/False_positives_and_false_negatives

    1. This is called a false positive. It means that we didn't get a test failure, but we should have

      No, this is a false negative. We didn't get a test failure (that is, there is a lack of the condition (test failure)), when the condition (test failure) should have been present.

      Read https://en.wikipedia.org/wiki/False_positives_and_false_negatives

  24. Oct 2019
  25. Sep 2019
  26. Aug 2019
  27. Jul 2017
    1. Partial loss-of-func- tion alleles cause the preferential loss of ventral structures and the expansion of remaining lateral and dorsal struc- tures (Figure 1 c) (Anderson and Niisslein-Volhard, 1988). These loss-of-function mutations in spz produce the same phenotypes as maternal effect mutations in the 10 other genes of the dorsal group.

      This paper has been curated by Flybase.

    1. Teach Source EvaluationSkillsIf you want to teach source evaluation skills, have small groups conduct research to answer a three-part problem such as this:1.How high is Mt. Fuji in feet?2.Find a different answer to this same question.3.Which answer do you trust and why do you trust it?As you observe students begin work on the third part of the problem, you likely will see a student begin to use the strategy that you have tar-geted: locating and evaluating the source of the information. When you see someone use this strategy, perhaps by clicking on a link to “About Us,” interrupt the other groups and have this student teach the strategy to the class, explaining how he or she evaluates a source for expertise and reliability. There are many inconsistent facts online that can also be used, just like this, to teach source evaluation including: “How long is the Mis-sissippi River?” or “What is the population of San Francisco?”
    1. We focus on a particular topic (e.g., racial prejudice), use a particular resource (e.g., To Kill a Mockingbird), and choose specific instructional methods (e.g., Socratic seminar to discuss the book and cooperative groups to analyze stereotypical images in films and on television) to cause learning to meet a given standard (e.g., the student will understand the nature of prejudice, and the difference between generalizations and stereotypes).
  28. Feb 2014
    1. The breakthrough patent that produces a Polaroid company is more the exception than the rule. The rule is the modestly successful novelist, the minor [*292] poet, and the university researcher -- all of whom may profit by licensing or selling their creations.

      Breakthrough patent of Polaroid (the exception) vs modestly successful novelist (the more common case)