HNHacker News
TopNewBestAskShowJobs

CapriciousCptl

1,466 karma · joined January 29, 2020

submissionscomments
CapriciousCptl··on A cross-platform GUI for YouTube-dl
Neat! Seeing this I'm considering making a similar project that takes a search and drops the preview pictures. No post-video-watching suggest + no 1 minute video shorts + no clickbaity preview pictures + setting a watch timer or something like that might get me back on youtube.
CapriciousCptl··on How We Went All In on sqlc/pgx for Postgres and Go
Personally, I tried pgtyped in a greenfield project but ended up switching to Slonik. Both are brilliant packages-- if you ever peak at the source of pgtyped it basically parses SQL on its own from what I could understand. The issues I had were-- 1) writing queries sometimes felt a little contrived in order to prevent multiple roundtrips to the database and back and 2) pgtyped gave weird/non-functioning types from some more complex queries. I've had better luck with Slonik and just writing types by hand.
CapriciousCptl··on TikTok overtakes YouTube for average watch time in US and UK
Note that this is watch time *per active user* lest anyone interprets the title as TikTok having more total active user-time.
CapriciousCptl··on FSNotes: Notes manager for macOS and iOS – native, open source
This is nice! Quiver was my previous go-to, but it's all but abandonware in 2021.
CapriciousCptl··on How database indexing works internally
I was curious so I tried it in postgres 13. Postgres, at least, uses the index to form a bitmap and scans that when aggregating in the first case (10% rows in the bitmap) and not in a second case WHERE "createdAt" BETWEEN '1990-01-01 00:00:00' AND '2020-12-31 23:59:59'; (100% rows in the bitmap, obviating the need for the intermediate step). I also tried ~20% rows (2019-2020) and the planner skipped the index. '''

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))

CapriciousCptl··on Endless Sky: an open source space trading and combat game
Sweet! An MMORPG element would be the bees knees here. Years ago there was a similar (though-MMORPG) game called Diaspora from a small studio[1]. I still remember waking up at all hours of the night to play inconspicuously (without tying up the phone line). It was freeware and featured in PC Gamer. Eventually cheaters/bots overtook the game, literally DDOSing the thing as each "node" could only support maybe 50 ships because of how they were displayed in game (~5x10 grid or so). Ultimately, the studio didn't have a solid monetization strategy and the project disappeared off the face of the earth when its users spiked. They would have made a killing with micro-transactions, but online payments weren't ubiquitous then. Instead these poor devs spent all this time/money developing the game, maintaining the servers and fighting cheaters for free before the whole thing crumbled under its own weight. It lived on in clones (Rillaspora, Xiaspora and The Reunion) but they all died within a year or two.

[1] https://en.wikipedia.org/wiki/Diaspora_(video_game)

CapriciousCptl··on Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8 and some default setup
I could be wrong but didn’t phoenix just switch to webpack from some other package manager? I guess that was 3ish years ago so a lifetime more or less in JS.
CapriciousCptl··on Amazon Web Services In Plain English (2019)
I think SQS was the first AWS offering. In that context “simple” means simple compared to other offerings of the 2000s/rolling it out yourself. I agree it’s a little convoluted for newcomers in 2021 although probably unintentional.
CapriciousCptl··on Google broke a conditional statement that verifies passwords on Chrome OS
The bug, which used a single & in an if statement instead of a double && reminds me of this one from years ago-- https://lwn.net/Articles/57135/

In that case it was a single = versus a double == but also in if statement.

CapriciousCptl··on An app for M1 Macs that plays the sound of a fan as CPU usage goes up
This is useful! Every so often Docker acts up or a Youtube video hidden in a tab somewhere or some silly mistake opens tons of Postgres connections on my M1. Previously the only cue was hitting the critically low power (10%?) at 6 hours instead of 12. Now there's this app. Thank you!
CapriciousCptl··on Postgres sequences can skip 32 unexpectedly
Good writeup! It's an interesting gotcha because Postgres and SQLite docs expressly disclaim that their sequences/AUTOINCREMENT are gapless but experienced and talented programmers still use them as such. Is the type of thing that doesn't bite you until production.

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.

CapriciousCptl··on Show HN: Unlimited, free intraday stock data API
Thanks, what about getting historical values from the API? It’d be very nice to get more historical data from the fianancial statements
CapriciousCptl··on Show HN: Unlimited, free intraday stock data API
Hey, this looks pretty neat. You even have some financials data. I see that all the financials data is in terms of “growth,” is there any chance you could expose the raw numbers? Also, cash flow? Emphasis on free cash flow.
CapriciousCptl··on All public GitHub code was used in training Copilot
Does intent not matter? Pasting code for explanatory reasons and citing the source seems different than silently incorporating it directly into a commercial work product.
CapriciousCptl··on Ask HN: Is this the most quoted quote on HN?
This isn't exactly a quote but fits in the sense of "general ideas mentioned frequently on HN and not frequently elsewhere"--

Gell-Mann Amnesia

https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

CapriciousCptl··on Robinhood S-1 IPO
ctrl+f arpu ctrl+f churn ctrl+f key performance

etc

CapriciousCptl··on Robinhood S-1 IPO
Per-user revenue was $109 for 2020. My goodness payment for order flow and cryptocurrency rebates are lucrative.
CapriciousCptl··on Ask HN: Why Poetry did not become a mainstream package manager for Python?
I can speak for myself— venv is good enough for most things and conda works for everything else (pandas/numpy/tensorflow on Mac m1).

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.

CapriciousCptl··on 80% of orgs that paid the ransom were hit again
Hmm, I dug further. The story probably comes from Plutarch (Lives), "[Crassus] would buy houses that were afire, and houses which adjoined those that were afire, and these their owners would let go at a trifling price owing to their fear and uncertainty"[1].

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/...

CapriciousCptl··on 80% of orgs that paid the ransom were hit again
I think wikipedia got the details wrong there. Crassus didn't offer to buy the burning buildings, he offered to put fires out. At least, that's how I understood it years ago and that's what Wiki's own source shows-- http://www.trivia-library.com/b/richest-people-in-history-ma... .

edit: Actually, Plutarch wrote that Crassus did buy the burning buildings.

CapriciousCptl··on El Salvador makes Bitcoin legal tender
WU incurred $41.3 million in "non-credit related losses," which includes fraud in 2020[1] which is only maybe 1% of their revenue. It had another ~$40 million in expected credit losses (primarily from agents), so I think ~2% of the fee goes to losses.

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)

CapriciousCptl··on The Shortest Possible Game of Monopoly (2010)
If you drop some presumptions about the players you can go even faster--

Player 1: Roll a 3, 5, 6, 8, 9, 11 or 12. Don't purchase, so it goes to auction. In auction player 2 buys for 100% of their cash.

Player 2: Rolls a 4, lands on income tax. Game over.

CapriciousCptl··on Security Issues with LastPass on Android
Better not sign up for services at ycombinator.xyz.
CapriciousCptl··on 'Irresponsible' London Underground Bitcoin Advert Banned
The advertisement text is-- "If you're seeing bitcoin on the [London] Underground, it's time to buy."

Which begs the question, when is the time to sell? When you stop seeing it on the Underground (now?).

CapriciousCptl··on Authorities are looking to close the gap on crypto unhosted wallets
At its core, a wallet is just a collection of private keys. So yes, these are easy to extract and, in the original client, there is a simple command to do just that. Or, as mentioned, you can access the BerkleyDB wallet.dat file directly. The "bitcoin" itself is never really stored anywhere in terms of state-- the chain simply stores the series of transactions between public keys up to right now and you calculate the btc state from that. The wallet.dat also typically stores cached transaction data, but it's only a local cache and not authoritative.
CapriciousCptl··on An early look at Postgres 14: Performance and monitoring Improvements
What's the issue? Just on Windows? Mac OS X with 13.2 has no issue for me with the 1.1gigabyte 20million record csv just imported last week, or some bigger ones I did a few months back.
CapriciousCptl··on An early look at Postgres 14: Performance and monitoring Improvements
You can fiddle with the autovacuum daemon[1,2] but we've never really had to. These days we just run AWS RDS when it counts or a dedicated VPS when it doesn't and things go fine--

[1,2] https://www.postgresql.org/docs/13/routine-vacuuming.html https://www.postgresql.org/docs/current/planner-stats.html

The main issue we get is the 1 connection = 1 process issue although there are ways to mitigate that (namely pgbouncer).

CapriciousCptl··on The whole freenode kerfluffle
Isn't it crazy how you remember getting kicked/banned 20 years later? Around the same time (early 200x) I was temp-banned from #cpp or #c++ or whatever after being accused of asking a homework question. I had been active in the channel for awhile by then and simply didn't have homework because I was self-learning with everything I could find.

It just stuck with me because I idolized the people in that room at the time.

CapriciousCptl··on How to look at the stack with gdb
her comics-- https://wizardzines.com/comics/
CapriciousCptl··on Bitcoin Plummets Below 40K
But in 15 years you could use that money to buy 0.5 pizzas!
Page 1 of 8Next →