OK, there's a billion questions:
- SQL Server
- stackoverflow.com/questions/485409/generating-a-histogram-from-column-values-in-a-database OP did not know the difference between count and histogram :-) But it's the number one Google result.
- stackoverflow.com/questions/19103991/create-range-bins-from-sql-server-table-for-histograms has a minor extra group by twist, but otherwise fine
- stackoverflow.com/questions/16268441/generate-histogram-in-sql-server
- SQLite
- stackoverflow.com/questions/67514208/how-to-optimise-creating-histogram-bins-in-sqlite perf only, benchmarking would be needed. SQLite.
- stackoverflow.com/questions/32155449/create-a-histogram-with-a-dynamic-number-of-partitions-in-sqlite variable bin size, same number of entries per bin
- stackoverflow.com/questions/60348109/histogram-for-time-periods-using-sqlite-regular-buckets-1h-wide time
- MySQL: stackoverflow.com/questions/1764881/getting-data-for-histogram-plot MySQL appears to extend
ROUND
to also round by integers:ROUND(numeric_value, -2)
, but this is not widely portable which is a shame - stackoverflow.com/questions/72367652/populating-empty-bins-in-a-histogram-generated-using-sql specifically asks about empty bins, which is amazing. Amazon Redshift dialect unfortunately, but answer provided works widely, and Redshift was forked from PostgreSQL, so there's hope. Those newb open source server focused projects that don't use AGPL!
Let's try it on SQLite 3.40.1, Ubuntu 23.04. Data setup:
sqlite3 tmp.sqlite 'create table t(x integer)'
sqlite3 tmp.sqlite <<EOF
insert into t values (
0,
2,
2,
3,
5,
6,
6,
8,
9,
17,
)
EOF
sqlite3 tmp.sqlite 'create index tx on t(x)'
For a bin size of 5 ignoring empty ranges we can:which produces the desired:
sqlite3 tmp.sqlite <<EOF
select floor(x/5)*5 as x,
count(*) as cnt
from t
group by 1
order by 1
EOF
0|4
5|5
15|1
And to consider empty ranges we can use SQL which outputs the desired:
genenerate_series
+ as per stackoverflow.com/questions/72367652/populating-empty-bins-in-a-histogram-generated-using-sql:sqlite3 tmp.sqlite <<EOF
select x, sum(cnt) from (
select floor(x/5)*5 as x,
count(*) as cnt
from t
group by 1
union
select *, 0 as cnt from generate_series(0, 15, 5)
)
group by x
EOF
0|4
5|5
10|0
15|1
The minimalism, serverlessness/lack of temporary caches/lack of permission management, Hipp's religious obsession with efficiency, the use of their own pure Fossil version control[ref]. Wait, scrap that last one. Pure beauty!
Official Git mirror: github.com/sqlite/sqlite
Create a table
sqlite3 db.sqlite3 "
CREATE TABLE 'IntegerNames' (int0 INT, char0 CHAR(16));
INSERT INTO 'IntegerNames' (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');
"
List tables:output:
sqlite3 db.sqlite3 '.tables'
IntegerNames
Show schema of a table:outputs the query that would generate that table:
sqlite3 db.sqlite3 '.schema IntegerNames'
CREATE TABLE IF NOT EXISTS 'IntegerNames' (int0 INT, char0 CHAR(16));
Example: sqlite/ip.c, adapted from www.sqlite.org/loadext.html, also mentioned explained at: stackoverflow.com/questions/7638238/sqlite-ip-address-storage/76520885#76520885.
Sample usage in the test program: sqlite/test.sh.
What is the Ultraviolet Catastrophe? by Physics Explained (2020)
Source. Answer: it can give some qualitative intuition on what is larger/smaller happens before/after based only on arguably more intuitive geometric considerations, without requiring you to do any calculations, see e.g. Figure "Spacetime diagram illustrating how faster-than-light travel implies time travel".
Example under: nodejs/sequelize/raw/tree.js
Stack overflow allows deleting content/making it visible only to 10k rep users.
Ciro Santilli is strictly against this, and this is an intended core policy of OurBigBook.com.
If you delete people's content randomly, they will be much less likely to write anything.
Getting downvoted to oblivion is one thing, but data loss? Unacceptable.
Only illegal content must ever be deleted. Or extremely obvious spam. But anything in a gray area should never be removed.
Deletion can be done by either:
- votes of high reputation users
- moderators
- or worse of all, which happens often on the smaller websites: auto-deletion because come content has not received enough views/votes above some treshold! stackoverflow.com/help/auto-deleted-questions. The most illogical thing of all is that the question is not even permanently removed from the system, only hidden from other/low reputation users! So it does not save any disk space at all! Mind blowing!
It is true, something Ciro Santilli often things about. One likely reason is that the world is broken and most cyclist are speed maniacs willing to put the time in. Unlike Dutch people where everyone cycles.
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.
There are few different versions. The most important as of 2020 are:
- historic counties of England: these are more fixed, but useless for politics
- administrative counties of England: these evolve with politics more
No one is capable of offering an official/more generalized (why can't Google Maps do this properly?) map than these people: wikishire.co.uk/map/#/centre=54.004,-4.500/zoom=7 So so be it.
Example: nodejs/sequelize/raw/tree.js
- Implementation agnostic
- Postgres
- stackoverflow.com/questions/67848017/simple-recursive-sql-query
- stackoverflow.com/questions/28688264/how-to-traverse-a-hierarchical-tree-structure-structure-backwards-using-recursiv
- stackoverflow.com/questions/51822070/how-can-postgres-represent-a-tree-of-row-ids
- depth first
- uspecified depth first variant
- preorder DFS
- breadth-first stackoverflow.com/questions/3709292/select-rows-from-table-using-tree-order
- MySQL
- Microsoft SQL Server
Unlisted articles are being shown, click here to show only listed articles.