- Nov 2024
-
www.youtube.com www.youtube.com
-
around the AI is um the problem right now as I understand it
for - progress traps - AI - created by mind level that created all our existing problems - AI is not AI but MI - Mineral Intelligence
-
- Aug 2024
-
savingplaces.org savingplaces.org
-
for - Preserving old, existing buildings is greenest - from - California Forever - intentional community - green debate
from - California Forever - intentional community - green debate - https://hyp.is/DKpS7FQGEe-xvLfZC4U-7Q/www.truthdig.com/articles/californias-urban-dream/
-
- Jan 2024
-
docdrop.org docdrop.org
-
I've found that a lot of um Pioneers who have had brilliant ideas and have fought through and you know sort of um uh spent a lot of energy in their life pushing 00:42:00 some someone with some new idea those people are often the most resistant to other new ideas it's amazing
for - resonates with - existing meme
resonates with - existing meme - yesterday's revolutionaries become today's old guard
- What I tell my students just be very careful with people who are
- very smart and
- very successful
- They know their stuff they're not necessarily calibrated on your stuff
comment - Lebenswelt and multimeaningverse
- What I tell my students just be very careful with people who are
-
-
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
-
-
-
-
for: COP28 talk - later is too late, Global tipping points report, question - are there maps of feedbacks of positive tipping points?, My Climate Risk, ICICLE, positive tipping points, social tipping points
-
NOTE
- This video is not yet available on YouTube so couldn't not be docdropped for annotation. So all annotations are done here referred to timestamp
-
SUMMARY
-
This video has not been uploaded on youtube yet so there is no transcription and I am manually annotating on this page.
-
Positive tipping points
- not as well studied as negative tipping points
- cost parity is the most obvious but there are other factors relating to
- politics
- psychology
- We are in a path dependency so we need disruptive change
-
-
SPEAKER PANEL
- Pierre Fredlingstein, Uni of Exeter - Global carbon budget report
- Rosalyn Conforth, Uni of Reading - Adaptation Gap report
- Tim Lenton, Uni of Exeter - Global Tipping Report
-
Global Carbon Budget report summary
-
0:19:47: Graph of largest emitters
- graph
- comment
- wow! We are all essentially dependent on China! How do citizens around the world influence China? I suppose if ANY of these major emitters don't radically reduce, we won't stay under 1.5 Deg C, but China is the biggest one.
-
00:20:51: Land Use Emissions
-
three countries represent 55% of all land use emissions - Brazil - DRC - Indonesia
-
00:21:55: CDR
- forests: 1.9 Gt / 5% of annual Fossil Fuel CO2 emissions
- technological CDR: 0.000025% of annual Fossil Fuel CO2 emissions
-
00:23:00: Remaining Carbon Budget
- 1.5 Deg C: 275 Gt CO2
- 1.7 Deg C. 625 Gt CO2
- 2.0 Deg C. 1150 Gt CO2
-
Advancing an Inclusive Process for Adaptation Planning and Action
-
adaptation is underfinanced. The gap is:
- 194 billion / year
- 366 billion / year by 2030
- climate change increases transboundary issues
- need transboundary agreements but these are absent
- conflicts and migration are a result of such transboundary climate impacts
- people are increasing climate impacts to try to survive due to existing climate impacts
-00:29:46: My Climate Risk Regional Hubs - Looking at climate risks from a local perspective. - @Nate, @SoNeC - 00:30:33 ""ICICLE** storyllines - need bottom-up approach (ICICLE - Integrated Climate Livelihood and and Environment storylines)
-
00:32:58: Global Tipping Points
-
00:33:46: Five of planetary systems can tip at the current 1.2 Deg C
- Greenland Ice Sheet
- West Antarctic
- Permafrost
- Coral Reefs - 500 million people
- Subpolar Gyre of North Atlantic - ice age in Europe
- goes in a decade - like British Columbia climate
-
00:35:39
- risks go up disproportionately with every 0.1 deg C of warming. There is no longer a business-as-usual option now. We CANNOT ACT INCREMENTALLY NOW.
-
00:36:00
- we calculate a need of a speed up of a factor of 7 to shut down greenhouse gas emissions and that is done through positive tipping points.
-00:37:00 - We have accelerating positive feedbacks and if we coordinate policy changes with consumer behavior change and business behavior change to reinforce these positive feedbacks, we can help accelerate change in the other sectors of the global economy responsible for all the other emissions
-
00:37:30
- in the report we walk you through the other sectors, where their tipping points are and how we have to act to trigger them. This is the only viable path out of our situation.
-
00:38:10
- Positive tipping points can also reinforce each other
- Question: Are there maps of the feedbacks of positive tipping points?
- Tim only discusses economic and technological positive tipping points and does not talk about social or societal
-
-
- Nov 2022
-
github.com github.com
-
I'm rather concerned about adding svelte.config.js support to things that already have well established mechanisms for configuration.
-
-
-
Note that you can address this by creating signal handlers in Bash to actually do the forwarding, and returning a proper exit code. On the other hand that's more work, whereas adding Tini is a few lines in your Dockerfile.
-
- Aug 2022
-
www.nature.com www.nature.com
-
McDiarmid, A. D., Tullett, A. M., Whitt, C. M., Vazire, S., Smaldino, P. E., & Stephens, J. E. (2021). Psychologists update their beliefs about effect sizes after replication studies. Nature Human Behaviour, 5(12), 1663–1673. https://doi.org/10.1038/s41562-021-01220-7
-
- Jul 2022
-
iea.blob.core.windows.net iea.blob.core.windows.net
-
The energy sector contains a large number of long‐lived and capital‐intensive assets. Urban infrastructure, pipelines, refineries, coal‐fired power plants, heavy industrial facilities, buildings and large hydro power plants can have technical and economic lifetimes of well over 50 years. If today’s energy infrastructure was to be operated until the end of the typical lifetime in a manner similar to the past, we estimate that this would lead to cumulative energy‐related and industrial process CO2 emissions between 2020 and 2050 of just under 650 Gt CO2. This is around 30% more than the remaining total CO2 budget consistent with limiting global warming to 1.5 °C with a 50% probability (see Chapter 2)
Emissionen durch die Verfeuerung der vorhandenen Assets: 650 Gigatonnen
Das bedeutet eine 30prozentige Überschreitung des CO2-Budgets für 50% Wahrscheinlichkeit des 1,5°-Ziels
-
- Jun 2022
-
news.ycombinator.com news.ycombinator.com
-
I'd love something similar to automatically crawl and index every site I visit. I'm forever losing stuff. I know I saw it but I can't remember where. reply parent chillpenguin () 1 hour ago on I use BrowserParrot for this. Works really well.https://www.browserparrot.com/ reply parent thinkmassive () 2 hours ago on ArchiveBox documents how to automatically archive links from your browser history:https://github.com/ArchiveBox/ArchiveBox/wiki/Usage#Import-l... reply parent mttjj () 5 hours ago on This is Mac only and I have no affiliation other than I like this developer but your request reminded me that he just launched this app: https://andadinosaur.com/launch-history-book reply parent akrymski () 1 hour ago on I use Google for this. It's really annoyingly good at finding previously visited pages. reply parent asselinpaul () 3 hours ago on https://heyday.xyz comes to mind reply parent fudged71 () 2 hours ago on Vortimo
-
- Feb 2022
-
www.nature.com www.nature.com
-
Spinney, L. (2022). Pandemics disable people—The history lesson that policymakers ignore. Nature, 602(7897), 383–385. https://doi.org/10.1038/d41586-022-00414-x
Tags
- brain damage
- pandemic
- risk
- is:article
- neurological symptoms
- chronic
- policymaker
- vulnerable
- long covid
- disability rights
- disablism
- COVID-19
- ableism
- COVID-induced disability
- lang:en
- health economy
- acute
- mortality
- disability
- children
- pre-existing condition
- hospitalization
- flu
- policy
- history
- morbidity
- long influenza
Annotators
URL
-
- Jan 2022
-
twitter.com twitter.com
-
James 💙 Neill - 😷 🇪🇺🇮🇪🇬🇧🔶. (2022, January 23). Of 51,141 deaths due to ischaemic heart diseases 32,872 (64.3%) had pre-existing conditions.💔 Do those 33k heart disease deaths not count? Or is an absence of pre-existing conditions only required for Covid deaths...😡⁉️ Source: ONS England 2019 [Tweet]. @jneill. https://twitter.com/jneill/status/1485327886164844546
-
- Dec 2021
-
www.thelancet.com www.thelancet.com
-
Mills, M. C., & Rüttenauer, T. (2021). The effect of mandatory COVID-19 certificates on vaccine uptake: Synthetic-control modelling of six countries. The Lancet Public Health, 0(0). https://doi.org/10.1016/S2468-2667(21)00273-5
-
- Nov 2021
-
stackoverflow.com stackoverflow.com
-
Its good to know how to implement it. I would prefer to use a gem myself.
-
- Oct 2021
-
www.pnas.org www.pnas.org
-
Chu, J. S. G., & Evans, J. A. (2021). Slowed canonical progress in large fields of science. Proceedings of the National Academy of Sciences, 118(41). https://doi.org/10.1073/pnas.2021636118
-
- Sep 2021
-
gnunn1.github.io gnunn1.github.io
-
The VTE widget was originally designed as the back-end for Gnome Terminal but was fortunately designed as a GTK widget so that other terminal emulator applications could leverage it instead of rolling their own. Many popular Linux terminal emulators use this component.
.
-
- Jul 2021
-
github.com github.com
-
curl -o ~/.config/direnv/helpers.sh
-
- Jun 2021
-
ruanmartinelli.com ruanmartinelli.com
-
In fact, npm is not trying to reinvent the wheel. You can find similarities between all three Workspace implementations.
-
-
www.mutuallyhuman.com www.mutuallyhuman.com
-
Rather than write new tooling we decided to take advantage of tooling we had in place for our unit tests. Our unit tests already used FactoryBot, a test data generation library, for building up test datasets for a variety of test scenarios. Plus, we had already built up a nice suite of helpers that we coud re-use. By using tools and libraries already a part of the backend technology’s ecosystem we were able to spend less time building additional tooling. We had less code to maintain because of this and more time to work on solving our customer’s pain points.
-
-
www.gertgoet.com www.gertgoet.com
-
Note: as for setting boolean variables: not only are true/false and 0/1 acceptable values, but also T/F and on/off. Thanks, coercible!
-
- Apr 2021
-
-
But in all this incongruous abundance you'll certanly find the links to expect It's just what is wanted: the tool, which is traditionally used to communicate automatically with interactive programs. And as it always occurs, there is unfortunately a little fault in it: expect needs the programming language TCL to be present. Nevertheless if it doesn't discourage you to install and learn one more, though very powerful language, then you can stop your search, because expect and TCL with or without TK have everything and even more for you to write scripts.
-
- Mar 2021
-
www.theguardian.com www.theguardian.com
-
the Guardian. ‘Shield Some and Let Others Carry on? This Covid Theory Is Dangerous, and Foolish | Charlotte Summers’, 29 December 2020. http://www.theguardian.com/commentisfree/2020/dec/29/covid-theory-dangerous-health.
-
-
github.com github.com
-
Reopening #162
https://github.com/rails/sprockets/issues/162 was already closed as duplicated (so this just creates another duplicate).
Technically this could be added there.
Oh, I see, it was from so long ago (2015), that it would probably be frowned upon to reopen such an old issue.
-
- Feb 2021
-
dry-rb.org dry-rb.org
-
Another solution is using the Safe Navigation Operator &. introduced in Ruby 2.3 which is a bit better because this is a language feature rather than an opinionated runtime environment pollution
-
-
github.com github.com
-
The assert method is used by all the other assertions. It pushes the second parameter to the list of errors if the first parameter evaluates to false or nil.
Seems like these helper functions could be just as easily used in ActiveRecord models. Therefore, they should be in a separate gem, or at least module, that can be used in both these objects and ActiveRecord objects.
-
-
-
My reasoning for not gemifying ActiveForm is that the custom not-rails-core logic is relatively small
-
I've utilized as many Rails modules as I can to make maintenance a lot easier as I just have to update Rails and I get the updates for free. By utilizing Rails core modules, it's a really small library - there are only 10 methods in the Base module!
-
-
-
I'd like to know specifically what you were aiming to achieve with this Gem as opposed to simply using https://github.com/apotonick/reform? I am happy to help contribute, but equally if there is a gem out there that already does the job well, I'd like to know why we shouldn't just use that.
-
-
stackoverflow.com stackoverflow.com
-
I have checked the following close stackoverflow sources : Relation passed to #or must be structurally compatible. Incompatible values: [:references]
referencing similar questions so it won't be marked as duplicate
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
github.com github.com
-
I've only done components that need to/can be Svelte-ified. For some things, like RTL and layout grid, you can just use the MDC packages.
-
This is Sass based, and therefore doesn't require Svelte components
Just because we could make Svelte wrapper components for each Material typography [thing], doesn't mean we should.
Compare:
material-ui [react] did make wrapper components for typography.
- But why did they? Is there a technical reason why they couldn't just do what svelte-material-ui did (as in, something technical that Svelte empowers/allows?), or did they just not consider it?
svelte-material-ui did not.
- And they were probably wise to not do so. Just reuse the existing work from the Material team so that there's less work for you to keep in sync and less chance of divergence.
-
- Oct 2020
-
-
hyperscript is much simpler to refactor and DRY up your code than with JSX, because, being vanilla javascript, its easier to work with variable assignment, loops and conditionals.
Tags
- javascript
- template language vs. reusing existing language constructs
- making it easy for later refactoring
- it's just _
- JSX
- reuse existing language constructs
- hyperscript
- template language: bad: by not reusing existing language constructs; forced to reinvent equivalents which are inferior and unfamiliar
- comparison with:
Annotators
URL
-
-
github.com github.com
-
It causes some implementation complexity just by existing.
-
-
reactjs.org reactjs.org
-
Hooks embrace JavaScript closures and avoid introducing React-specific APIs where JavaScript already provides a solution.
-
-
-
Templates are prone to unnoticed runtime errors, are hard to test, and are not easy to restructure or decompose.
-
In contrast, Javascript-made templates can be organised into components with nicely decomposed and DRY code that is more reusable and testable.
-
In contrast, React apps shun templates and require the developer to create their DOM in Javascript, typically aided with JSX.
-
-
github.com github.com
-
It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases, features are absent for a reason.
-
- Sep 2020
-
sapper.svelte.dev sapper.svelte.dev
-
Links are just <a> elements, rather than framework-specific <Link> components. That means, for example, that this link right here, despite being inside a blob of markdown, works with the router as you'd expect
-
-
www.javascriptjanuary.com www.javascriptjanuary.com
-
As you can see, it uses Javascript label syntax to tell the compiler where recalculation should be carefully managed. And you thought that no one uses labels any more.
-
-
-
Doshi, P. (2020). Covid-19: Do many people have pre-existing immunity? BMJ, 370. https://doi.org/10.1136/bmj.m3563
-
-
-
You can construct both by setting other properties inside the Promise callbacks, but we have {#await} and I feel like it should be used for this, instead of special casing the logic every time.
-
-
github.com github.com
-
In a similar vein to (#33), it is arguably just something that compensates for the lack of power in the template language relative to JavaScript.
-
-
-
Yes, we use CSS. I thought a Svelte mantra was to use the existing language(s). This is fundamental CSS
-
-
github.com github.com
-
The complaint is that by choosing less powerful languages, template-based frameworks are then forced to reintroduce uncanny-valley versions of those constructs in order to add back in missing functionality, thereby increasing the mount of stuff people have to learn.
-
In general, I'm unpersuaded by these arguments (learning curve is determined not just by unfamiliar syntax, but by unfamiliar semantics and APIs as well, and the frameworks in question excel at adding complexity in those areas).
-
One of the arguments that's frequently deployed in favour of JSX-based frameworks over template-based ones is that JSX allows you to use existing language constructs:
Tags
- javascript
- unpersuaded
- familiar semantics
- template language vs. reusing existing language constructs
- React
- don't create a new syntax
- it's just _
- template language
- prefer plain code over new template language
- learning curve
- reuse existing language constructs
- template language: bad: by not reusing existing language constructs; forced to reinvent equivalents which are inferior and unfamiliar
- complexity
- familiar syntax
Annotators
URL
-
- Aug 2020
-
html.spec.whatwg.org html.spec.whatwg.org
- Jul 2020
-
psyarxiv.com psyarxiv.com
-
Plomecka, M., Gobbi, S., Neckels, R., Radziński, P., Skórko, B., Lazzeri, S., … Jawaid, A. (2020, May 5). Mental Health Impact of COVID-19: A global study of risk and resilience factors. https://doi.org/10.31234/osf.io/zj6b4
-
-
osf.io osf.io
-
Schraff, D. (2020). Political trust during the Covid-19 pandemic: Rally around the flag or lockdown effects? [Preprint]. SocArXiv. https://doi.org/10.31235/osf.io/pu47c
-
-
svelte.dev svelte.dev
-
Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the $: JS label syntax.
-
- Jun 2020
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
If you've found a problem in Ruby on Rails which is not a security risk, do a search on GitHub under Issues in case it has already been reported. If you are unable to find any open GitHub issues addressing the problem you found, your next step will be to open a new one.
-
-
github.com github.com
-
It's funny that in such a complex gem like this, there's only one open issue, exactly about what I came here to post.
-
- May 2020
-
psyarxiv.com psyarxiv.com
-
Shevlin, M., McBride, O., Murphy, J., Gibson Miller, J., Hartman, T. K., Levita, L., … Bentall, R. (2020, April 18). Anxiety, Depression, Traumatic Stress, and COVID-19 Related Anxiety in the UK General Population During the COVID-19 Pandemic. https://doi.org/10.31234/osf.io/hb6nq
-
- Oct 2019
-
english.stackexchange.com english.stackexchange.com
-
I'd say that "dump" in the CS sense, both as noun and verb, is merely another application of its preexisting meanings even without the vulgar one, particularly the ones related to unloading/releasing contents. (For example, "dump truck".)
-
For some geeky reason, the computer programming world has long maintained a tradition of using words in new ways, with a studied obliviousness to their prior, rude meanings: for example, 'dump'. 'Falsey' is merely another word in this long, and quite useful, tradition.
-
- Jan 2019
-
www.at-the-intersection.com www.at-the-intersection.com
-
ike I said, using the trading view chart is the best thing that you guys could have done. It's not, you know, like I said, don't, don't reinvent the wheel. It's already perfectly round. This one works great.
-
But I'm also not looking at necessarily reinvent the wheel, but the tools are offering specific applications, do a really good job at what they do.
-
Um, instead of building it from scratch cause they've done a good job and I believe that have a easier enough api to pull in, uh, those tools into your own
-