- Oct 2024
-
dayoneapp.com dayoneapp.com
-
users can switch to specific journals once the word or phrase is searched.
...this is the literal inverse of what seems sensible to me and it's caused me (cumulatively, anyway) quite a bit of grief, actually, over the 15 years I've been using DayOne...
-
- Aug 2024
-
r-leyshon.github.io r-leyshon.github.io
-
How is a page note different to an annotation?
Tags
Annotators
URL
-
- Aug 2023
-
sveltequery.vercel.app sveltequery.vercel.app
Tags
Annotators
URL
-
- May 2023
- Mar 2023
-
tkdodo.eu tkdodo.eu
Tags
Annotators
URL
-
-
codesandbox.io codesandbox.io
Tags
Annotators
URL
-
-
tanstack.com tanstack.com
-
dev.to dev.to
-
tanstack.com tanstack.com
Tags
Annotators
URL
-
-
react-query-v3.tanstack.com react-query-v3.tanstack.comSSR1
Tags
Annotators
URL
-
- Feb 2023
- Dec 2022
-
github.com github.com
-
Note: it is not possible to apply a boolean scope with just the query param being present, e.g. ?active, that's not considered a "true" value (the param value will be nil), and thus the scope will be called with false as argument. In order for the scope to receive a true argument the param value must be set to one of the "true" values above, e.g. ?active=true or ?active=1.
Is this behavior/limitation part of the web standard or a Rails-specific thing?
-
- Oct 2022
-
reactrouter.com reactrouter.com
- Sep 2022
-
tkdodo.eu tkdodo.eu
- Aug 2022
-
blog.openreplay.com blog.openreplay.com
-
www.youtube.com www.youtube.com
-
-
Tags
Annotators
URL
-
-
daily-dev-tips.com daily-dev-tips.com
-
And in our case, we want it to keep track of our storage object. So let's also create a usePeristentContext hook.
```js import { useMutation, useQuery, useQueryClient } from 'react-query';
export default function usePersistentContext(key) { const queryClient = useQueryClient();
const { data } = useQuery(key, () => localStorage.getItem(key));
const { mutateAsync: setValue } = useMutation( (value) => localStorage.setItem(key, value), { onMutate: (mutatedData) => { const current = data; queryClient.setQueryData(key, mutatedData); return current; }, onError: (_, __, rollback) => { queryClient.setQueryData(key, rollback); }, } );
return [data, setValue]; } ```
js function SetContext() { const [value, setValue] = usePersistentContext('item_context'); return ( <button onClick={() => setValue(value === 'on' ? 'off' : 'on')}> Click me {value} </button> ); }
-
-
www.youtube.com www.youtube.comYouTube1
-
- Jul 2022
-
tanstack.com tanstack.com
- Jun 2022
-
codesandbox.io codesandbox.io
Tags
Annotators
URL
-
-
dev.to dev.to
-
www.smashingmagazine.com www.smashingmagazine.com
- Apr 2022
-
www.elastic.co www.elastic.co
-
The result from the above request includes a _scroll_id, which should be passed to the scroll API in order to retrieve the next batch of results.
This is the way to use scroll.
-
-
www.elastic.co www.elastic.co
-
Use with caution!
Using regular expression in this way might cause "Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]", especially when together with "query?scroll=1m"
-
- Mar 2022
-
twitter.com twitter.com
-
ReconfigBehSci on Twitter: ‘@STWorg @ProfColinDavis @rpancost @chrisdc77 @syrpis this is the most in depth treatment of the impact of equalities law on pandemic policy that I’ve been able to find- it would seem to underscore that there is a legal need for impact assessments that ask (some) of these questions https://t.co/auiApVC0TW’ / Twitter. (n.d.). Retrieved 22 March 2022, from https://twitter.com/SciBeh/status/1485927221449613314
-
- Feb 2022
-
github.com github.com
-
js queryClient .getQueryCache() .findAll(['partial', 'key']) .forEach(({ queryKey }) => { queryClient.setQueryData(queryKey, newData) })
-
-
dhruvnakum.xyz dhruvnakum.xyz
-
www.carlrippon.com www.carlrippon.com
-
www.smashingmagazine.com www.smashingmagazine.com
-
However there are some restrictions: if you are going to use different URLs for GET/PATCH, for example, you have to use the same key, otherwise, React Query will not be able to match these queries.
It is ok to use url as key for React query
-
- Jan 2022
-
lukesmurray.com lukesmurray.com
-
www.bezkoder.com www.bezkoder.com
Tags
Annotators
URL
-
-
egreb.net egreb.net
-
codesandbox.io codesandbox.io
-
betterprogramming.pub betterprogramming.pub
-
-
let's start with tag notes so i'm going to create a new note called tag note and a tag note takes
- My tagnote structure for my tag doesnt work on repeated trying 1248hrs
Tags
Annotators
URL
-
-
tkdodo.eu tkdodo.eu
-
Data Transformation
[…]
3. using the select option
v3 introduced built-in selectors, which can also be used to transform data:
/* select-transformation */ export const useTodosQuery = () => useQuery(['todos'], fetchTodos, { select: (data) => data.map((todo) => todo.name.toUpperCase()), })
selectors will only be called if data exists, so you don't have to care about undefined here. Selectors like the one above will also run on every render, because the functional identity changes (it's an inline function). If your transformation is expensive, you can memoize it either with
useCallback
, or by extracting it to a stable function reference:/* select-memoizations */ const transformTodoNames = (data: Todos) => data.map((todo) => todo.name.toUpperCase()) export const useTodosQuery = () => useQuery(['todos'], fetchTodos, { // ✅ uses a stable function reference select: transformTodoNames, }) export const useTodosQuery = () => useQuery(['todos'], fetchTodos, { // ✅ memoizes with useCallback select: React.useCallback( (data: Todos) => data.map((todo) => todo.name.toUpperCase()), [] ), })
Further, the select option can also be used to subscribe to only parts of the data. This is what makes this approach truly unique. Consider the following example:
/* select-partial-subscriptions */ export const useTodosQuery = (select) => useQuery(['todos'], fetchTodos, { select }) export const useTodosCount = () => useTodosQuery((data) => data.length) export const useTodo = (id) => useTodosQuery((data) => data.find((todo) => todo.id === id))
Here, we've created a
useSelector
like API by passing a custom selector to ouruseTodosQuery
. The custom hooks still works like before, as select will be undefined if you don't pass it, so the whole state will be returned.But if you pass a selector, you are now only subscribed to the result of the selector function. This is quite powerful, because it means that even if we update the name of a todo, our component that only subscribes to the count via
useTodosCount
will not rerender. The count hasn't changed, so react-query can choose to not inform this observer about the update 🥳 (Please note that this is a bit simplified here and technically not entirely true - I will talk in more detail about render optimizations in Part 3).- 🟢 best optimizations
- 🟢 allows for partial subscriptions
- 🟡 structure can be different for every observer
- 🟡 structural sharing is performed twice (I will also talk about this in more detail in Part 3)
-
Data Transformation
[...]
2. In the render function
As advised in Part 1, if you create custom hooks, you can easily do transformations there:
/* render-transformation */ const fetchTodos = async (): Promise<Todos> => { const response = await axios.get('todos') return response.data } export const useTodosQuery = () => { const queryInfo = useQuery(['todos'], fetchTodos) return { ...queryInfo, data: queryInfo.data?.map((todo) => todo.name.toUpperCase()), } }
As it stands, this will not only run every time your fetch function runs, but actually on every render (even those that do not involve data fetching). This is likely not a problem at all, but if it is, you can optimize with
useMemo
. Be careful to define your dependencies as narrow as possible. data inside thequeryInfo
will be referentially stable unless something really changed (in which case you want to recompute your transformation), but thequeryInfo
itself will not. If you addqueryInfo
as your dependency, the transformation will again run on every render:/* useMemo-dependencies */ export const useTodosQuery = () => { const queryInfo = useQuery(['todos'], fetchTodos) return { ...queryInfo, // 🚨 don't do this - the useMemo does nothing at all here! data: React.useMemo( () => queryInfo.data?.map((todo) => todo.name.toUpperCase()), [queryInfo] ), // ✅ correctly memoizes by queryInfo.data data: React.useMemo( () => queryInfo.data?.map((todo) => todo.name.toUpperCase()), [queryInfo.data] ), } }
Especially if you have additional logic in your custom hook to combine with your data transformation, this is a good option. Be aware that data can be potentially undefined, so use optional chaining when working with it.
- 🟢 optimizable via useMemo
- 🟡 exact structure cannot be inspected in the devtools
- 🔴 a bit more convoluted syntax
- 🔴 data can be potentially undefined
-
-
www.sitepoint.com www.sitepoint.com
Tags
Annotators
URL
-
-
-
🤔 So what?
Let’s review a typical Redux process for a fetch operation:
- Dispatch an Action
fetchSomething()
from within the Component - This Action hits the Reducer which will update the store with something like
isLoading: true
- The Component re-renders and displays a loader
- In the meanwhile the Action hits the Middleware which takes care of calling the API
- The API returns the response to the Middleware, which dispatches another Action:
fetchSomethingSucceeded()
when succeeded, orfetchSomethingFailed()
when failed - The succeeded/failed Action hits the Reducer, which updates the
store
- Finally, the response is back to the Component (optionally through a memoized selector) which will show the data
It’s a long process for just a simple fetch, isn’t it?
- Dispatch an Action
-
-
tkdodo.eu tkdodo.eu
- Dec 2021
-
tkdodo.eu tkdodo.eu
Tags
Annotators
URL
-
-
tkdodo.eu tkdodo.eu
Tags
Annotators
URL
-
-
tkdodo.eu tkdodo.eu
-
Increasing StaleTime
React Query comes with a default staleTime of zero. This means that every query will be immediately considered as stale, which means it will refetch when a new subscriber mounts or when the user refocuses the window. It is aimed to keep your data as up-to-date as necessary.
This goal overlaps a lot with WebSockets, which update your data in real-time. Why would I need to refetch at all if I just manually invalidated because the server just told me to do so via a dedicated message?
So if you update all your data via websockets anyways, consider setting a high
staleTime
. In my example, I just usedInfinity
. This means the data will be fetched initially via useQuery, and then always come from the cache. Refetching only happens via the explicit query invalidation.You can best achieve this by setting global query defaults when creating the QueryClient:
const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: Infinity, }, }, })
-
-
codesandbox.io codesandbox.io
Tags
Annotators
URL
-
-
thewebdev.info thewebdev.info
-
react-query.tanstack.com react-query.tanstack.com
-
blog.theodo.com blog.theodo.com
- Nov 2021
-
towardsdatascience.com towardsdatascience.com
-
The Query word can be interpreted as the word for which we are calculating Attention. The Key and Value word is the word to which we are paying attention ie. how relevant is that word to the Query word.
Finally
-
- Sep 2021
-
s3.us-west-2.amazonaws.com s3.us-west-2.amazonaws.com
-
don’t store all the values from onerow together, but store all the values from each column together instead. If each col‐umn is stored in a separate file, a query only needs to read and parse those columnsthat are used in that query, which can save a lot of work.
Why column storage is better query optimized
-
- Aug 2021
-
towardsdatascience.com towardsdatascience.com
-
So for each word, we create a Query vector, a Key vector, and a Value vector. These vectors are created by multiplying the embedding by three matrices that we trained during the training process.
-
-
stats.stackexchange.com stats.stackexchange.com
-
I'm going to try provide an English text example. The following is based solely on my intuitive understanding of the paper 'Attention is all you need'.
This is also good
-
For the word q that your eyes see in the given sentence, what is the most related word k in the sentence to understand what q is about?
-
So basically: q = the vector representing a word K and V = your memory, thus all the words that have been generated before. Note that K and V can be the same (but don't have to). So what you do with attention is that you take your current query (word in most cases) and look in your memory for similar keys. To come up with a distribution of relevant words, the softmax function is then used.
-
-
blog.isquaredsoftware.com blog.isquaredsoftware.com
-
We can even say that server caching tools like React-Query, SWR, Apollo, and Urql fit the definition of "state management" - they store initial values based on the fetched data, return the current value via their hooks, allow updates via "server mutations", and notify of changes via re-rendering the component
-
- May 2021
-
www.ulisp.com www.ulisp.com
-
Note that variables cannot appear in the predicate position.
-
-
-
This media query only targets WebKit-supported email clients—which have incredible support for HTML5 and CSS3. This media query allows you to use of modern techniques like HTML5 video, CSS3 animation, web fonts, and more.
-
- Feb 2021
-
philosophyideas.com philosophyideas.com
-
directexpress.mycardplace.com directexpress.mycardplace.com
-
Can I transfer money from the Direct Express® card to a checking or savings account?
-
Can I get cash when I need it with my Direct Express® card?
-
How do I get cash at a bank teller window?
-
How does the free Low Balance Alert work?
-
How does the free Deposit Notification work?
-
How can I protect my PIN?
-
Do I always need to use my PIN? Can I use my card without a PIN?
-
What if I forget my PIN?
-
Can I change my PIN?
-
What is a PIN?
-
Can I pay my bills or pay for Internet purchases with my Direct Express® card?
-
How do I check my balance on my Direct Express® card?
-
Where can I use my Direct Express® card?
-
How do I make purchases with my card?
-
Is Customer Service available in languages other than English?
-
Can I close my account and withdraw my money?
-
Can I have a monthly paper statement mailed to me?
-
What if I don't agree with my balance or one of my transactions?
-
Who should I notify if I change my mailing address?
-
How long will it take to receive a replacement card if reported lost or stolen?
-
What if my Direct Express® card is lost or stolen?
-
Who do I call if I have questions about how to use my Direct Express® card?
-
What if I can't find an ATM or my ATM is "out of order"?
-
How do I know if an ATM surcharge fee will be charged when I withdraw cash at an ATM?
-
What is the maximum amount of cash I can withdraw from an ATM with my Direct Express® card?
-
Where can I find Direct Express® card network ATMs?
-
What is the Direct Express® card surcharge-free ATM network?
-
How do I get cash at an ATM with my card?
-
How much will people be charged for going to an out-of-network ATM?
-
What if I don't live near a Direct Express® card surcharge-free network ATM?
-
How do I find a surcharge free network?
-
Is there a fee to use the ATM?
-
How does my free ATM cash withdrawal work?
-
How do I avoid transaction fees while using my Direct Express® card?
-
How much do I have to pay for the Direct Express® card?
-
What are my options if the Direct Express® card is just not for me?
-
I plan to retire in the near future. Can I request a Direct Express® card as soon as I sign up for my Social Security benefits?
-
Can I sign up for the Direct Express® card even if I have a bank account?
-
Can recipients who have a Direct Express® card switch to a traditional checking or savings account and receive their payment by direct deposit?
-
Are federal benefit recipients residing in a healthcare facility eligible for the Direct Express® card?
-
I am a representative payee who receives another type of federal benefit payment on behalf of someone else. Can I sign up for a Direct Express® card?
-
I am a representative payee who receives Social Security benefits on behalf of more than one person. Can I receive all of the benefits on one Direct Express® card?
-
I am a representative payee who receives Social Security benefits for someone else. Can I sign up for a Direct Express® card?
-
Do I need to give my federal paying agency my card information in order to receive benefits?
-
How do I activate my Direct Express® card?
-
How do I sign up for the Direct Express® card?
-
What are the benefits of the Direct Express® card?
-
How is the Direct Express® debit card different from a credit card?
-
Will my Social Security, Supplemental Security Income, and other federal benefits be safe?
-
How does the Direct Express® card work?
-
What type of federal payments can I have on the Direct Express® card account?
-
What is the Direct Express® card?
-
-
github.com github.com
-
# Returns a new relation, which is the logical union of this relation and the one passed as an # argument. # # The two relations must be structurally compatible: they must be scoping the same model, and # they must differ only by #where (if no #group has been defined) or #having (if a #group is # present). Neither relation may have a #limit, #offset, or #distinct set.
-
-
aeon.co aeon.co
-
quibble
quibble:a slight objection or criticism about a trivial matter.
-
- Oct 2020
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
online
Tags
Annotators
URL
-
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
information
Tags
Annotators
URL
-
-
www.kdnuggets.com www.kdnuggets.com
-
ciencia_datos
Tags
Annotators
URL
-
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
bioinformacion
-
-
www.google.com www.google.com
-
dashboard
Tags
Annotators
URL
-
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
online
-
-
app.dimensions.ai app.dimensions.ai
-
data_sacience
-
-
www.google.com www.google.com
-
- Sep 2020
-
www.preprints.org www.preprints.org
-
preprints,repositorio
-
- Aug 2020
-
github.com github.com
- Jul 2020
-
stackoverflow.com stackoverflow.com
-
all the subcolletions must have the same name, for instance tags
-
- May 2020
-
docs.gitlab.com docs.gitlab.com
-
Encoding API parameters of array and hash types
Tags
Annotators
URL
-
-
-
bug_status=NEW&bug_status=ASSIGNED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED
Passing multiple values for the same param key
-
- Mar 2020
-
hypothes.is hypothes.is
-
-
europepmc.org europepmc.org
-
Li_Wenliang
Tags
Annotators
URL
-
-
twitter.com twitter.comTwitter1
-
Li_Wenliang
Tags
Annotators
URL
-
-
es.statista.com es.statista.com
-
graficas
Tags
Annotators
URL
-
-
-
("SARS-CoV-2" OR "COVID-19")
-
-
www.sciencemag.org www.sciencemag.org
-
pubmed.ncbi.nlm.nih.gov pubmed.ncbi.nlm.nih.gov
-
unidad_COVID2019
-
-
europepmc.org europepmc.org
-
unidad_COVID2019
-
-
www.newscientist.com www.newscientist.comCovid-191
-
unidad_COVID2019
Tags
Annotators
URL
-
-
clinicaltrials.gov clinicaltrials.gov
-
unidad_COVID2019,ensayos clínicos
Tags
Annotators
URL
-
-
apps.who.int apps.who.int
-
unidad_COVID2019,ensayos clínicos
Tags
Annotators
URL
-
-
coronavirus.1science.com coronavirus.1science.com
-
unidad_COVID2019
Tags
Annotators
URL
-
-
europepmc.org europepmc.org
-
unidad_COVID2019
Tags
Annotators
URL
-
-
www.medrxiv.org www.medrxiv.org
-
unidad_COVID2019
Tags
Annotators
URL
-
-
www.biorxiv.org www.biorxiv.org
-
unidad_COVID2019
Tags
Annotators
URL
-
-
arxiv.org arxiv.org
-
unidad_COVID2019
-
-
www.ncbi.nlm.nih.gov www.ncbi.nlm.nih.gov
-
unidad_COVID2019
Tags
Annotators
URL
-
- Sep 2019
-
github.com github.com
-
May not need since we have https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
davidwalsh.name davidwalsh.name
-
URLSearchParams
-
- Nov 2018
- Jul 2018
- Jun 2018
-
blog.yipl.com.np blog.yipl.com.np
-
Annotator library
where can i get library??
-
- May 2018
-
hypothes.is hypothes.is
-
hi there learn MSBI in 20 min with handwritten explanation on each and every topics on the Course with real time examples
-
- Nov 2017