Sequelize example Updated 2025-07-16
To run examples on a specific database:All examples can be tested on all databases with:
./index.jsor./index.js l: SQLite./index.js p: PostgreSQL. You must manually create a database calledtmpand ensure that peer authentication works for it
cd sequelize
./testOverview of the examples:
- nodejs/sequelize/index.js: a bunch of basic examples
- nodejs/sequelize/update.js: This file is also where we are storing our expression-foo for now, e.g. how to do stuff like
col1 + col2. Such knowledge can however be used basically anywhere else however, e.g. inASorWHEREclauses, not just inUPDATE. - nodejs/sequelize/count.js: a simplified single-table count example. In practice, this will be usually done together with JOIN queries across multiple tables. Answers: stackoverflow.com/questions/22627258/how-does-group-by-works-in-sequelize/69896449#69896449
- nodejs/sequelize/date.js: automatic date typecasts
- nodejs/sequelize/like.js: LIKE
- nodejs/sequelize/camel_case.js: trying to get everything in the database camel cased, columns starting with lowercase, and tables starting with uppercase. The defaults documented on getting started documentation do uppercase foreign keys, and lowercase non-foreign keys. It's a mess.
- nodejs/sequelize/ignore_duplicates.js: ignore query on unique violation with
ignoreDuplicates: truewhich does SQLiteINSERT OR IGNORE INTOor PostgreSQLON CONFLICT DO NOTHING. Closely related Upsert versions:- Upsert
- nodejs/sequelize/upsert.js:
.upsertselects the conflict column automatically by unique columns. Both SQLite and PostgreSQL doINSERT INTO ON CONFLICT. PostgreSQL usesRETURNING, which was added too recently to SQLite: www.sqlite.org/lang_returning.html - nodejs/sequelize/update_on_duplicate.js:
.bulkCreate({}, { updateOnDuplicate: ['col1', col2'] }. Produces queries analogous to.upsert. This method is cool because it can upsert multiple columns at once. But it is annoying that you have to specify all fields to be updated one by one manually. - stackoverflow.com/questions/29063232/how-to-get-the-id-of-an-inserted-or-updated-record-in-sequelize-upsert/72092277#72092277
- stackoverflow.com/questions/55531860/sequelize-bulkcreate-updateonduplicate-for-postgresql
- Upsert
- nodejs/sequelize/inc.js: demonstrate the
incrementmethod. In SQLite, it produces a statement of type:UPDATE `IntegerNames` SET `value`=`value`+ 1,`updatedAt`='2021-11-03 10:23:45.409 +00:00' WHERE `id` = 3 - nodejs/sequelize/sync_alter.js: illustrates
Model.sync({alter: true})to modify a table definition, answers: stackoverflow.com/questions/54898994/bulkupdate-in-sequelize-orm/69044138#69044138 - nodejs/sequelize/truncate_key.js
- nodejs/sequelize/validation.js: is handled by a third-party library: github.com/validatorjs/validator.js. They then add a few extra validators on top of that.The
args: truething is explained at: stackoverflow.com/questions/58522387/unhandled-rejection-sequelizevalidationerror-validation-error-cannot-create-pr/70263032#70263032 - nodejs/sequelize/composite_index.js: stackoverflow.com/questions/34664853/sequelize-composite-unique-constraint
- nodejs/sequelize/indent_log.js: stackoverflow.com/questions/34664853/sequelize-composite-unique-constraint
- association examples:
- nodejs/sequelize/one_to_many.js: basic one-to-many examples.
- nodejs/sequelize/many_to_many.js: basic many-to-many examples, each user can like multiple posts. Answers: stackoverflow.com/questions/22958683/how-to-implement-many-to-many-association-in-sequelize/67973948#67973948
- ORDER BY include:
- nodejs/sequelize/many_to_many_custom_table.js: many-to-many example, but where we craft our own table which can hold extra data. In our case, users can like posts, but likes have a integer weight associated with them. Related threads:
- nodejs/sequelize/many_to_many_same_model.js: association between a model and itself: users can follow other users. Related:
- nodejs/sequelize/many_to_many_same_model_super.js
- nodejs/sequelize/many_to_many_super.js: "Super many to many": sequelize.org/master/manual/advanced-many-to-many.html This should not exist and shows how bad this library is for associations, you need all that boilerplate in order to expose certain relationships that aren't otherwise exposed by a direct
hasManywith implicit join table.
- nested includes to produce queries with multiple JOIN:
- nodejs/sequelize/nested_include.js: find all posts by users that a given user follows. Answers: stackoverflow.com/questions/42632943/sequelize-multiple-where-clause/68018083#68018083
- nodejs/sequelize/nested_include_super.js: like nodejs/sequelize/nested_include.js but with a super many to many. We should move this to nodejs/sequelize/many_to_many_super.js.
- two relationships between two specific tables: we need to use
as:to disambiguate them- nodejs/sequelize/many_to_many_double.js: users can both follow and like posts
- nodejs/sequelize/one_to_many_double.js: posts have the author and a mandatory reviewer
- hooks
- internals:
- nodejs/sequelize/common.js: common utilities used across examples, most notably:
- to easily setup different DBRM
- nodejs/sequelize/min_nocommon.js: to copy paste to Stack Overflow
- nodejs/sequelize/min.js: template for new exapmles in the folder
- nodejs/sequelize/common.js: common utilities used across examples, most notably:
Ciro Santilli's hardware Toshiba MK1059GSM Updated 2025-07-16
Classification of finite simple groups Updated 2025-07-16
Ciro Santilli is very fond of this result: the beauty of mathematics.
How can so much complexity come out from so few rules?
How can the proof be so long (thousands of papers)?? Surprise!!
And to top if all off, the awesomely named monster group could have a relationship with string theory via the monstrous moonshine?
The classification contains:
- cyclic groups: infinitely many, one for each prime order. Non-prime orders are not simple. These are the only Abelian ones.
- alternating groups of order 4 or greater: infinitely many
- groups of Lie type: a contains several infinite families
- sporadic groups: 26 or 27 of them depending on definitions
Simple Groups - Abstract Algebra by Socratica (2018)
Source. Good quick overview. Classification of second order partial differential equations into elliptic, parabolic and hyperbolic Updated 2025-07-16
One major application of this classification is that different boundary conditions are suitable for different types of partial differential equations as explained at: which boundary conditions lead to existence and uniqueness of a second order PDE.
Clifford gates Updated 2025-07-16
This gate set alone is not a set of universal quantum gates.
Notably, circuits containing those gates alone can be fully simulated by classical computers according to the Gottesman-Knill theorem, so there's no way they could be universal.
This means that if we add any number of Clifford gates to a quantum circuit, we haven't really increased the complexity of the algorithm, which can be useful as a transformational device.
Clinton Engineer Works Updated 2025-07-16
Produced the enriched uranium used for Little Boy, located in the area/predecessor of Oak Ridge National Laboratory.
Concatenate two videos with ffmpeg Updated 2025-07-16
Organization developing quantum control systems Updated 2025-07-16
Schwinger effect Updated 2025-07-16
SQLite benchmark Updated 2025-07-16
SQL prefix column names with the table they came from Updated 2025-07-16
Closed access academic journals are evil Updated 2025-07-16
You are nothing but useless leeches in the Internet age.
You must go bankrupt all of you, ASAP.
Researchers and reviewers all work for peanuts, while academic publishers get money for doing the work that an algorithm could do. OurBigBook.com.
When Ciro learned URLs such as www.nature.com/articles/181662a0 log you in automatically by IP, his mind blew! The level of institutionalization of this theft is off the charts! The institutionalization of theft is also clear from article prices, e.g. 32 dollars for a 5 page article.
Long live the Guerilla Open Access Manifesto by Aaron Swartz (2008).
Key physics papers from the 50's are still copyright encumbered as of 2020, see e.g. Lamb-Retherford experiment. Authors and reviewers got nothing for it. Something is wrong.
Infinite list of other people:
- blog.machinezoo.com/public-domain-theft by Robert Važan:
Scientific journals are perhaps one of the most damaging IP rackets. Scientists are funded by governments to do research and publish papers. Reviews of these papers are done by other publicly funded scientists. Even paper selection and formatting for publication is done by scientists. So what do journals actually do? Nearly nothing.
Academic Publishing by Dr. Glaucomflecken (2022)
Source. COCO dataset Updated 2025-07-16
From cocodataset.org/:
So they have relatively few object labels, but their focus seems to be putting a bunch of objects on the same image. E.g. they have 13 cat plus pizza photos. Searching for such weird combinations is kind of fun.
Their official dataset explorer is actually good: cocodataset.org/#explore
Also, images have captions describing the relation between objects:Epic.
This dataset is kind of cool.
Soviet Union Updated 2025-07-16
Ultraviolet catastrophe Updated 2025-07-16
What is the Ultraviolet Catastrophe? by Physics Explained (2020)
Source. City in the Netherlands Updated 2025-07-16
Cladogram Updated 2025-07-16
TODO vs Phylogenetic tree? www.visiblebody.com/blog/phylogenetic-trees-cladograms-and-how-to-read-them:
Cladograms and phylogenetic trees are functionally very similar, but they show different things. Cladograms do not indicate time or the amount of difference between groups, whereas phylogenetic trees often indicate time spans between branching points.
Coinbase Bitcoin hello world Updated 2025-07-16
Collected Papers On Wave Mechanics by Deans (1928) Updated 2025-07-16
English translation of papers that include the original Quantization as an Eigenvalue Problem by Schrödinger (1926).
Collecting Updated 2025-07-16
Unlisted articles are being shown, click here to show only listed articles.
