- Aug 2024
-
www.truthdig.com www.truthdig.com
-
for - building new sustainable cities
summary - Building new "sustainable cities from nothing often does not consider the embodied energy required to do so. When that is considered, it is usually not viable - A context where it is viable is where there is extreme poverty and inequality
to - Why do old places matter? - sustainability - https://hyp.is/vlBLGlQFEe-EpqflmmlqnQ/savingplaces.org/stories/why-do-old-places-matter-sustainability
-
- Jul 2024
-
docdrop.org docdrop.org
-
the question is why are the mitochondria not doing their job why is the self not responding to insulin 00:05:34 that's the issue different tissues different reasons but the main one is the liver
for - question - health - insulin resistance - why aren't mitochondria within cells not responding to insulin?
question - health - insulin resistance - why aren't mitochondria within cells not responding to insulin? - The fat cells are being stored in the liver, resulting in - fatty liver disease - The liver stores the fat cells floating in blood (triglycerides) then recirculates it back to the cells. - The cells and liver are caught up in a vicious cycle of "hot potatos" with the fat cells.<br /> - (See Stanford explainer video above)
-
- Jun 2024
-
docdrop.org docdrop.orgText1
-
Refer to line 6 ( It looks like...….attacking his neck)
Identify the figure of speech used in this line.
-
- Feb 2024
- Jan 2024
-
mongoosejs.com mongoosejs.com
-
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 theAnimal
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 theAnimal
schema. When you create an instance of theAnimal
model (e.g., a dog), you can then callfindSimilarTypes
on that instance to find other animals with the same type. The method uses thethis.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 theAnimal
model.
Tags
Annotators
URL
-
- Dec 2023
-
www.kickstarter.com www.kickstarter.com
-
Kickstarter will not let me promise rewards within the same month, but the files will be sent to backers soon after the campaign ends.
-
-
developer.chrome.com developer.chrome.com
-
This feature is available only in Chrome, not Chromium.
Really? It's working for me in ungoogled-chromium
-
- Nov 2023
-
www.youtube.com www.youtube.com
-
- for: progress trap - free market, example - government policy - why it's needed
-
- Mar 2023
-
www.dol.wa.gov www.dol.wa.gov
-
Washington wallet-sized birth registration cards aren’t accepted
Tags
Annotators
URL
-
- Jan 2023
-
rubystyle.guide rubystyle.guide
-
Do not separate numbers from letters on symbols, methods and variables.
Okay... Why not?
-
- Dec 2022
-
help.activecampaign.com help.activecampaign.com
-
If a contact ever reaches out and is no longer receiving messages because they accidentally marked one of your campaigns as spam, you can reach out to Product Support. We can remove them from the suppression list for you.
why not allow user to do it directly instead of force to contact support? If they'll remove it for you because you said the user asked you to... why not just let you remove the suppression yourself? Mailgun lets you directly delete suppressions via their API.
-
- Oct 2022
-
-
This type does not exist in Ruby, however.
Tags
Annotators
URL
-
- Sep 2022
-
metalblueberry.github.io metalblueberry.github.io
-
Code explains what and how Documentation explains why.
-
-
github.com github.com
-
Yes, I understand that it had probably been tried. My question was more, "Why didn't twiddling the knob work?”
-
- Aug 2022
-
docs.gitlab.com docs.gitlab.com
-
The task is not deleted, but the two are no longer connected. It’s not possible to connect them again.
Should be possible!
Tags
Annotators
URL
-
- Jul 2022
-
catamphetamine.github.io catamphetamine.github.io
-
Windows 10 currently (01.01.2020) doesn't support Unicode country flags, and displays two-letter country codes instead of emoji flag images.
-
- May 2022
-
wordpress.com wordpress.com
-
"I didn't fully understand it at the time, but throughout my time as a freshman at Boston College I've realized that I have the power to alter myself for the better and broaden my perspective on life. For most of my high school experience, I was holding to antiquated thoughts that had an impact on the majority of my daily interactions. Throughout my life, growing up as a single child has affected the way am in social interactions. This was evident in high school class discussions, as I did not yet have the confidence to be talkative and participate even up until the spring term of my senior year."
-
"The need to engage with people in terms of evaluating them for the aim of acquiring a different point of view was one occasion this semester where the knowledge I received in class positively changed the way I approached an issue. I was patient enough to explore other perspectives, some of which disagreed with mine, so that I might learn about their opinions without bias or prejudice."
Tags
- (Major Essay) Introduction paragraph
- Introduction p.1
- In my annotation, I addressed the problem of not stating how and why this circumstance benefits me in the future. In the annotation, I continued to describe how hearing other people's ideas and responding to their comments and insights during class discussions will aid me in my career aspirations.
- In this annotation, I choose to expand on my introduction. Before I explain why I chose the words I did, I should mention that my first draft failed to meet one of the assignment's primary requirements: a "Story like" structure. Finally, I decided to rework my introduction because my first draft did not begin with a clear beginning. Instead, I started by describing the fundamental context of the encounter before detailing my previous experiences. To improve my final edit, I made sure I described my experiences and/or how I felt before they occurred.
- (Major Essay) Ending/Conclusion paragraph. 5
Annotators
URL
-
- Nov 2021
- Sep 2021
-
-
Webpacker used to configure Webpack indirectly, which lead to a complicated secondary configuration process. This was done in order to provide default configurations for the most popular frameworks, but ended up creating more complexity than it cured. So now Webpacker delegates all configuration directly to Webpack's default configuration setup.
more trouble than it's worth
- creating more complexity than it cured
Tags
- changed their mind/opinion
- too hard/complicated/non-trivial
- modern javascript development is complicated
- removing feature that is more trouble than it's worth (not worth the effort to continue to maintain / fix bugs caused by keeping it)
- Why can't this be easier/simpler? Why does it have to be so hard/complicated?
- doing more harm than good
- more trouble than it's worth
- newer/better ways of doing things
- too complicated
- complicated
Annotators
URL
-
-
forums.linuxmint.com forums.linuxmint.com
-
It seems to me (N.b. what do I know about this? Nothing!) that the best solution would be to tweak the 'Change Password' process so that it also updates the 'Passwords and Keys'>Passwords>Login folder's properties.
"I'm not an expert, but it seems to me..."
-
- Jul 2021
-
github.com github.com
-
Please note that the strategy: :build option must be passed to an explicit call to association, and cannot be used with implicit associations:
-
- Jun 2021
-
material.io material.ioLists1
-
Do not use aria-orientation attribute for standard list (i.e., role="list"), use component's vertical property to set the orientation to vertical.
Tags
Annotators
URL
-
-
github.com github.com
-
Closing this PR since it's been sitting here for over 2 years. Can reopen if need be.
-
- May 2021
-
unix.stackexchange.com unix.stackexchange.com
-
even if system scripts do not use this (I wonder why)
-
-
github.com github.com
-
Note that not all of the colors in SMUI read from CSS variables, so some parts will still use the colors defined in the original Sass compile.
-
-
www.kickstarter.com www.kickstarter.com
-
I am unable to change the name and URL of my Kickstarter account.
-
- Apr 2021
-
boardgamegeek.com boardgamegeek.com
-
I don't know if I am allowed to link here
It would be silly to not be allowed to...
-
-
www.freetaxusa.com www.freetaxusa.com
-
Already Signed InThis session has ended because the account has been signed into from another browser window on 04/11/2021 04:30:09 PM. This happens when you sign in to your account on more than one browser screen. You can't be signed into your account on two or more browser windows at the same time. Just close your browser and sign back into your account.
-
- Mar 2021
-
www.kickstarter.com www.kickstarter.com
-
click the images below
why not make this a link too?
-
-
auto.howstuffworks.com auto.howstuffworks.com
-
This content is not compatible on this device.
-
-
www.walmart.com www.walmart.com
-
Dole Mandarin Oranges in Light Syrup, All Natural Fruit, Non-GMO, 15oz CanNot available for curbside
-
-
www.chevtek.io www.chevtek.io
-
"Functions Are Not Packages" - Well why not?
-
-
www.sitepoint.com www.sitepoint.com
-
for whatever reasons, it hasn’t really liberated anyone from JavaScript.
Tags
Annotators
URL
-
- Feb 2021
-
github.com github.com
-
Any idea @AaronLasseigne if this is mergeable?
-
-
-
It makes me happy to see people actually think about things and not just accept a shitty API.
Tags
- intentional/well-considered decisions
- "makes me happy when ..."
- less than ideal / not optimal
- don't settle for/accept something that's not as good as it can be
- actually consider / think about how it _should_ (ideally) be
- describe the ideal hypothetical solution
- doing something without knowing why/how it works
- can we do even better?
Annotators
URL
-
-
www.dekudeals.com www.dekudeals.com
-
This game is not currently available in United States.
-
- Jan 2021
-
www.emailonacid.com www.emailonacid.com
-
The Gmail Android app that comes pre-installed with most new Android phones contains a feature to access non-Google accounts using POP and IMAP. Unfortunately, emails accessed through this setup lack the embedded style (<style>) support as well as the support for background images.
-
-
isthereanydeal.com isthereanydeal.com
-
We are not allowed to show you historical data for Amazon
Tags
Annotators
URL
-
-
snapcraft.io snapcraft.io
-
On Ubuntu, Chromium is not the default browser, and the package resides in the ‘universe’ section of the archive.
-
- Dec 2020
-
github.com github.com
-
Can this be merged please, this fixes a problem I have
-
-
github.com github.com
-
May I ask what is holding this back?
-
- Nov 2020
-
github.com github.com
-
I see this issue has 2 open PR's is this going to be finalized anytime soon?
-
-
github.com github.com
-
github.com github.com
-
Furthermore, how come there's a PR open since 3 months, at what seems to be the authoritative repo for Svelte?
-
-
github.com github.com
- Oct 2020
-
facebook.github.io facebook.github.io
-
Why not just use that instead of inventing a syntax that's not part of ECMAScript?
-
Why not Template Literals?
-
- Sep 2020
-
-
You must: reference each element you are extending using refs or an id add code in your oncreate and ondestroy for each element you are extending, which could become quite a lot if you have a lot of elements needing extension (anchors, form inputs, etc.)
-
This is where hooks/behaviors are a good idea. They clean up your component code a lot. Also, it helps a ton since you don't get create/destroy events for elements that are inside {{#if}} and {{#each}}. That could become very burdensome to try and add/remove functionality with elements as they are added/removed within a component.
Tags
- could be easier / more difficult than it needs to be
- scalability
- difficult/hard
- framework taking care of responsibility so users can leverage it and not have to worry about that responsibility themselves
- why this feature is needed
- too hard/difficult/much work to expect end-developers to write from scratch (need library to do it for them)
Annotators
URL
-
-
github.com github.com
-
Please focus on explaining the motivation so that if this RFC is not accepted, the motivation could be used to develop alternative solutions. In other words, enumerate the constraints you are trying to solve without coupling them too closely to the solution you have in mind.
Tags
- defining the problem clearly is as valuable coming up with specific implementation/solution
- answer the "why?"
- iterative process
- okay for proposal to not be accepted
- contribution guidelines: should explain motivation for change
- iterative process: building on previous attempts/work
Annotators
URL
-
- Jun 2019
-
engl201.opened.ca engl201.opened.ca
-
AtthecoreofmyargumentisthewayinwhichGooglebiasessearchtoitsowneconomicinterests—foritsprofitabilityandtobolsteritsmarketdominanceatanyexpense
I have been trying to avoid the word "money" in my annotations to avoid coming off as anti-capitalist as I really am, but yes: Corporations do not give a care about individuals or marginalized groups outside of how they can profit off of their oppression. Remember this June; this Pride Month; that any company selling you rainbow merchandise is not doing it out of legitimate care about LGBTQ+ rights but because it's profitable! Yes, even if they're giving 20% of proceeds to charity - where do you think the other 80% goes?
-