1,466 karma · joined Jan 29, 2020 (6y ago) · 257 submissions
comment 5y ago · link · parent
comment 5y ago · link · parent
4.
TypeScript Deep Dive(basarat.gitbook.io ↗)
3 points · by CapriciousCptl · 5y ago · discuss
comment 5y ago · link · parent
CREATE TABLE temp (id SERIAL PRIMARY KEY, amount MONEY, "createdAt" TIMESTAMPTZ); CREATE INDEX ON temp ("createdAt");
INSERT INTO temp(id, "createdAt", amount) SELECT generate_series(1,1000000) AS id, NOW() + (random() * (interval '10 years')) - interval '10 years' AS createdAt, random() * 100::money AS amount.
EXPLAIN SELECT sum(amount) FROM temp WHERE "createdAt" BETWEEN '2020-01-01 00:00:00' AND '2020-12-31 23:59:59';
Aggregate (cost=10286.06..10286.07 rows=1 width=8) -> Bitmap Heap Scan on temp (cost=2148.00..10033.48 rows=101032 width=8) Recheck Cond: (("createdAt" >= '2020-01-01 00:00:00-05'::timestamp with time zone) AND ("createdAt" <= '2020-12-31 23:59:59-05'::timestamp with time zone)) -> Bitmap Index Scan on "temp_createdAt_idx" (cost=0.00..2122.75 rows=101032 width=0) Index Cond: (("createdAt" >= '2020-01-01 00:00:00-05'::timestamp with time zone) AND ("createdAt" <= '2020-12-31 23:59:59-05'::timestamp with time zone))
And when running a longer query: Finalize Aggregate (cost=14596.71..14596.72 rows=1 width=8) -> Gather (cost=14596.49..14596.70 rows=2 width=8) Workers Planned: 2 -> Partial Aggregate (cost=13596.49..13596.50 rows=1 width=8) -> Parallel Seq Scan on temp (cost=0.00..12620.00 rows=390597 width=8) Filter: (("createdAt" >= '1990-01-01 00:00:00-05'::timestamp with time zone) AND ("createdAt" <= '2020-12-31 23:59:59-05'::timestamp with time zone))
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
Postgres docs-- https://www.postgresql.org/docs/13/sql-createsequence.html > Because nextval and setval calls are never rolled back, sequence objects cannot be used if “gapless” assignment of sequence numbers is needed. It is possible to build gapless assignment by using exclusive locking of a table containing a counter; but this solution is much more expensive than sequence objects, especially if many transactions need sequence numbers concurrently.
comment 5y ago · link · parent
Gell-Mann Amnesia
https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
comment 5y ago · link · parent
For production code I’m more worried about minimizing surprises then elegance which means it’s really hard to replace something that works. Poetry only hit 1.0 in 12/2019, so maybe I’ll try it if the api remains stable for another few years. Contrast that to JS where we’re now on webpack 5 I think and there’s really no long term support available.
comment 5y ago · link · parent
Plutarch was closer to Crassus than I am so I guess I can't argue.
[1] https://penelope.uchicago.edu/Thayer/e/roman/texts/plutarch/...
comment 5y ago · link · parent
edit: Actually, Plutarch wrote that Crassus did buy the burning buildings.
comment 5y ago · link · parent
Since their gross margins are consistently 40% and their operating margins are ~20% I think barriers to entry/international government regulations better explains the high fees.
[1] 2020 10-k (ctrl-f for 41.3)
23.
Microsoft Excel Esports Tournament Is Real and Happening(gamespot.com ↗)
1 points · by CapriciousCptl · 5y ago · discuss
24.
The Long, Painful History of Time (1999)(naggum.no ↗)
2 points · by CapriciousCptl · 5y ago · discuss