- Aug 2024
-
dba.stackexchange.com dba.stackexchange.com
- Apr 2024
-
dba.stackexchange.com dba.stackexchange.com
-
select count(*) filter (where year <= 1945) as pre1945, count(*) filter (where year between 1946 and 1964) as period2, count(*) filter (where year between 1965 and 1974) as period3, ... from ... where ...;
-
- Mar 2024
-
start.digitalefitheid.nl start.digitalefitheid.nl
-
Die onderste link wordt veroorzaakt door deze query (dank Joost Plattel ):```oqlname: "This day in my history"query: {$and: [{"path": "'Deze dag op"}, {"title": "'11-04"}]}template: 'list'fields: ['title']sort: 'title'badge: false```Deze query verwijst naar een uniek .md bestand met als titel de maand en de dag van vandaag.Zo heb ik voor de 365 en soms 366 dagen per jaar een uniek bestandje.Door op de link te klikken kom ik op de pagina van vandaag in mijn persoonlijke geschiedenis:
-
- Aug 2023
-
evilmartians.com evilmartians.com
-
TL;DR For classic Rails apps we have a built-in scope for preloading attachments (e.g. User.with_attached_avatar) or can generate the scope ourselves knowing the way Active Storage names internal associations.GraphQL makes preloading data a little bit trickier—we don’t know beforehand which data is needed by the client and cannot just add with_attached_<smth> to every Active Record collection (‘cause that would add an additional overhead when we don’t need this data).That’s why classic preloading approaches (includes, eager_load, etc.) are not very helpful for building GraphQL APIs. Instead, most of the applications use the batch loading technique.
-
-
engineering.universe.com engineering.universe.com
- Jul 2023
- Jun 2023
-
magrawala.substack.com magrawala.substack.com
-
We assume the AI will generate what a human collaborator might generate given the prompt.
Mistaken human assumptions that AI will generate what a human would given the same prompt are reinforced by claims by those selling AI tools that such tools "understand human language." We don't actually know that AI understands, just that it provides a result that we can interpret as understanding (with the help of our cognitive biases).
This claim to understanding is especially misleading for neural network-based AI. We don't know how neural networks think. With older Lisp based AI we could at least trace through the code to see how the AI thinks.
-
we can improve AI interfaces by enabling conversational interactions that can let users establish common ground/shared semantics with the AI, and that provide repair mechanisms when such shared semantics are missing.
By providing interfaces to AI tools that help us duplicate the aligning, clarifying, and iterating behaviors that we perform with human collaborators we can increase the sense that users can predict what results the AI will provide in subsequent iterations. This will remove the frustration of working with a collaborator that doesn't understand you.
-
Collaborating with another human is better than working with generative AI in part because conversation allows us to establish common ground, build shared semantics and engage in repair strategies when something is ambiguous.
Collaborating with humans beats collaborating with AI because we can sync up our mental models, clarify ambiguity, and iterate.
Current AI tools are limited in the methods they make available to perform these tasks.
-
finding effective prompts is so difficult that there are websites and forums dedicated to collecting and sharing prompts (e.g. PromptHero, Arthub.ai, Reddit/StableDiffusion). There are also marketplaces for buying and selling prompts (e.g. PromptBase). And there is a cottage industry of research papers on prompt engineering.
Natural language alone is a poor interface for creating an effective prompt. So bad that communities and businesses are surfacing to help people create effective prompts.
-
-
www.postgresql.org www.postgresql.org
-
Writing json_populate_record in the FROM clause is good practice, since all of the extracted columns are available for use without duplicate function calls.
-
- May 2023
- Apr 2023
-
www.youtube.com www.youtube.com
-
Dataview query for table of incoming outgoing links
dataview TABLE length*file.outlinks) as "Outgoing", length(file.inlinks) as "Incoming" where !contains(file.path, "Genie") and !contains(file.path,"Daily") and !contains(file.path,"Private") and !contains(file.path,"Weekly") and !contains(file.path,"FolderA") and !contains(file.path,"FolderB") and !contains(file.path,"FolderC") and !contains(file.path,"FolderD") and !contains(file.publish, "false") SORT length(file.outlinks) DESC LIMIT 50
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
- Nov 2022
-
github.com github.com
-
Post.in_order_of(:type, %w[Draft Published Archived]).order(:created_at).pluck(:name) which generates SELECT posts.name FROM posts ORDER BY CASE posts.type WHEN 'Draft' THEN 1 WHEN 'Published' THEN 2 WHEN 'Archived' THEN 3 ELSE 4 END ASC, posts.created_at ASC
-
- Jul 2021
-
forum.obsidian.md forum.obsidian.md
-
Then in your daily note Template add a tag that flags it as a daily note somewhere (eg. “#journal”. Also add an embedded query that looks like this: ```query {{date}} -"#journal" ```
Embeddable search queries for Obsidian
-
- Jun 2021
-
docs.gitlab.com docs.gitlab.com
-
As an example you might create 5 issues in between counts, which would cause the query count to increase by 5 if an N+1 problem exists.
-
QueryRecorder is a tool for detecting the N+1 queries problem from tests.
-
-
ddrscott.github.io ddrscott.github.io
-
SELECT * FROM ( -- build virtual table of all hours between -- a date range SELECT start_ts, start_ts + interval '1 hour' AS end_ts FROM generate_series( '2017-03-01'::date, '2017-03-03'::timestamp - interval '1 hour', interval '1 hour' ) AS t(start_ts) ) AS cal LEFT JOIN ( -- build virtual table of uptimes SELECT * FROM ( VALUES ('2017-03-01 01:15:00-06'::timestamp, '2017-03-01 02:15:00-06'::timestamp), ('2017-03-01 08:00:00-06', '2017-03-01 20:00:00-06'), ('2017-03-02 19:00:00-06', null) ) AS t(start_ts, end_ts) ) AS uptime ON cal.end_ts > uptime.start_ts AND cal.start_ts <= coalesce(uptime.end_ts, current_timestamp)
-
-
dba.stackexchange.com dba.stackexchange.com
-
FROM test x1 LEFT JOIN test x2 ON x1.id = (x2.data->>'parent')::INT;
-
- May 2021
-
mxb.dev mxb.dev
-
This looks cool! I can think of some interesting applications, but the example here is pretty slick.
-
- Feb 2021
-
github.com github.com
-
where_values_hash.reduce(&:or)
-
scope :deck_access, ->(user) { includes(:deck_permissions).where(where({ deck_permissions: { user_id: user.id, read_access: true } }, global_deck_read: true, user_id: user.id).where_values_hash.reduce(&:or)) }
-
- Oct 2020
-
api.rubyonrails.org api.rubyonrails.org
- Jun 2020
-
medium.com medium.com
-
If those comments are loaded outside of the blog_post association, then attempting to reference the blog_post association from within each comment will result in N blog_posts table queries even if they all belong to the same BlogPost!
-
- Apr 2020
-
dba.stackexchange.com dba.stackexchange.com
-
Joins are not expensive. Who said it to you? As basically the whole concept of relational databases revolve around joins (from a practical point of view), these product are very good at joining. The normal way of thinking is starting with properly normalized structures and going into fancy denormalizations and similar stuff when the performance really needs it on the reading side. JSON(B) and hstore (and EAV) are good for data with unknown structure.
-
- Mar 2020
-
build.affinity.co build.affinity.co
- Jan 2020
-
www.technobytz.com www.technobytz.com
-
The SELECT part should not contain any columns not referenced in GROUP BY clause, unless it is wrapped with an aggregate function.
-
-
stackoverflow.com stackoverflow.com
-
Before SQL3 (1999), the selected fields must appear in the GROUP BY clause
-
-
stackoverflow.com stackoverflow.com
-
Event.joins(:packages).having('array_agg(packages.type) @> array[?]', packages).group(:id)
-
-
stackoverflow.com stackoverflow.com
-
This illustrates a pretty common challenge with joins: you want them to be used for some of the query but not for other of it.
-
-
stackoverflow.com stackoverflow.com
-
Which to use? ANY is a later, more versatile addition, it can be combined with any binary operator returning a boolean value. IN burns down to a special case of ANY. In fact, its second form is rewritten internally: IN is rewritten with = ANY NOT IN is rewritten with <> ALL
-
- Aug 2016
-
lists.w3.org lists.w3.org
-
Yay! So my tweet earlier today was right, I think? But could eventually be wrong?
-