HNHacker News
TopNewBestAskShowJobs

collinmanderson

2,545 karma · joined September 26, 2014

submissionscomments
collinmanderson··on Postgres WASM
PyScript ( https://pyscript.net ) recently came out, though I don't know if Django works with it yet.
collinmanderson··on How to build a personal webpage from scratch
It seems to me like they only do this in very very rare circumstances, maybe 3 times ever? And only when there's the threat of physical harm.

It's rare enough that the CEO publishes a blog post every time they do it.

"This is a hard case and we would caution anyone from seeing it as setting precedent."

collinmanderson··on Native Linux GPU Driver for Apple M1
Part of the issue is that 64-bit programs end up taking close to twice as much memory, because pointers are twice as big, instructions are longer, etc.

Higher screen resolution uses more memory too.

I'm sure dependencies / libraries have grown in size too, and yeah, using web for UI takes memory.

collinmanderson··on 58 bytes of CSS to look great nearly everywhere
Maybe they could do it the old-fashioned way and scroll the columns horizontally.

https://en.wikipedia.org/wiki/Dead_Sea_Scrolls#/media/File:G...

collinmanderson··on 58 bytes of CSS to look great nearly everywhere
Yeah when I saw 2em padding and 1.75 line height in the css I thought "too big". I think 1em padding and 1.5 line-height are a bit better for general defaults.

It often can look better to have more whitespace, but it lowers information density. It depends on the situation.

collinmanderson··on 58 bytes of CSS to look great nearly everywhere
It's probably hard to get everyone to agree on the defaults, especially the width / line-length of content. I think it makes sense to default to no width constraint, zero padding rather than picking something arbitrary. I personally start with 1em padding whereas the author seems to prefer 2em, (or 1.5, or 2ch which is roughly 1em)

Browsers used to default to adding margin/padding automatically to documents (Quirks Mode), but modern html includes a doctype to use "Standards Mode" which is more sane.

At the same time it would be nice to default to sans-serif typeface and line-height around 1.5 but it starts getting arbitrary very quickly and it's nice to build on something that doesn't change over time.

collinmanderson··on Someday aliens will land and all will be fine until we explain our calendar
The 360 probably came from an approximation of the number of days in a year.
collinmanderson··on Someday aliens will land and all will be fine until we explain our calendar
Technically days get longer (hours of daylight) during the winter and shorter during the summer.
collinmanderson··on Spotify Is Down
I don't think there was one when Spotify went down a few months ago:

https://news.ycombinator.com/item?id=30603574

collinmanderson··on No, you cannot trust third party code without reading it first
You don't need to read the code yourself, but ideally it should be vetted or reviewed by sources you trust. Maybe that's Debian / Ubuntu / Red Hat, or maybe it's through a review system like Rust's cargo-crev: https://github.com/crev-dev/cargo-crev

Minimizing the number of dependencies helps a lot too.

But don't blindly npm or pip install something unless you trust the developers. npx/pipx are even worse. All it takes is a one typo-squatter to steal your ssh keys and maybe even saved browser passwords or cookies.

collinmanderson··on Django 4.1
> Django doesn't default support REST endpoints, does it?

You just have to manually call json.parse(request.body) for incoming requests and return JsonResponse(data). And you generally need to serialize the data yourself.

Django does have some built-in model serialization, but that's mostly for import/export data, not really for sending to the browser.

collinmanderson··on Mary Schmich's “Wear Sunscreen”, which turned into an unlikely 90s hit (2019)
Also, right stereo channel: "This is The Panic Office. Section 917 may have been hit. Activate following procedure."

https://www.reddit.com/r/radiohead/comments/mhpv3/we_need_to...

(You can hear this clearly if you isolate stereo differences with Audacity: Effect -> Vocal Reduction and Isolation -> Remove Center. Strength 100%.)

https://www.youtube.com/watch?v=DPjQ-I4Tu24

collinmanderson··on Django 4.1
Yes, though I do think the python async ecosystem is gradually moving from a "3rd class citizen" to a "2nd class citizen". There are sync+async libraries like HTTPX that are gaining support. I don't expect it to really ever be a "1st class citizen" (supported as well as sync in pretty much every library everywhere) because of backward compatibility and ultimately async is just harder to program. Sometimes developer time is more important than the performance wins of async.
collinmanderson··on Django 4.1
> for anyone using other protocols like WS

Yes, if you do WebSockets, async really is a must if you don't want to have one thread per active connection. Each thread takes 8mb of virtual memory, not sure how much actual memory.

It's also nice for a backend that's doing a lot of proxying apis to another backend.

collinmanderson··on Django 4.1
Python 2 or 3?
collinmanderson··on Django 4.1
Right, though they're stuck on 1.8 (upgraded to 1.8 only so they could use python3), and really just use it for request/response/views, not ORM or anything else.
collinmanderson··on Django 4.1
Interesting looks like it might actually be a python bug. Somehow just changing from sys.exit(0) -> os._exit(0) apparently fixes it.

"There is a problem with using the sys.exit() in a forked process (child processes or workers) instead of using the os._exit() that is mentioned in python documentation."

https://github.com/benoitc/gunicorn/pull/2820

I've always just needed to manually reload the gunicorn async server in development. Super annoying.

collinmanderson··on Django 4.1
Yes, they're working from the top of the stack down, so first it was views+middleware, now it's the top layer of the database stack, and in future releases they'll work on pushing native async lower and lower in the stack.

Basically every function call that does db-queries needs an "a"-prefixed version. aget(), acreate(), aget_or_create(), acount(), aexists(), aiterator(), __aiter__, etc. And in future versions they'll work on the lower level, undocumented api, like _afetch_all(), aprefetch_related_objects(), compiler.aexecute_sql(), etc.

Eventually you'll probably need to switch database drivers to something that actually supports async.

collinmanderson··on Django 4.1
Why do a REST-like service?

It makes sense as backend for a native iOS/Android app, and if you already have that REST endpoint then it can make sense to re-use it for the web-version of your app.

But if you're not doing an iOS/Android app (most websites?), then I generally agree it's a lot more work compared to form-based / server-side-templates (though sometimes can give a _slightly_ better user experience, _if_ done correctly.)

HTMX seems to be growing as a "REST endpoint" alternative, but again not as useful if you're also doing a native iOS/Android app.

collinmanderson··on US regulators will certify first small nuclear reactor design
Yeah, they should get vehicle-to-grid capability.
collinmanderson··on Map showing birthplaces of "notable people" around the world
Yes. There was definitely a human named Jesus who “was baptized by John the Baptist and crucified by order of the Roman Prefect Pontius Pilate.”

https://en.wikipedia.org/wiki/Historicity_of_Jesus

collinmanderson··on Why is it so hard to give Google money?
Settings -> Phone -> Silence Unknown Callers.

It allows callbacks from numbers you’ve called recently which is nice.

For texts there’s “Filter Unknown Senders”

collinmanderson··on The History of ‘Ampersand’ (2020)

  A, B, C, and D,
  Pray, playmates, agree.
  E, F, and G,
  Well, so it shall be.
  J, K, and L,
  In peace we will dwell.
  M, N, and O,
  To play let us go.
  P, Q, R, and S,
  Love may we possess.
  W, X, and Y,
  Will not quarrel or die.
  Z, and ampersand,
  Go to school at command.
- A Book of Nursery Rhymes (1901)

https://en.wikisource.org/wiki/A_Book_of_Nursery_Rhymes/Part...

collinmanderson··on TeamViewer installs suspicious font only useful for web fingerprinting
Yes, this key point is missing from the rest of the discussion.

_Any_ website can tell whether or not you have TeamViewer installed. Ad networks could theoretically target you based on whether or not you have TeamViewer installed.

I’m not assuming malice, but it’s a much bigger privacy hole than just increasing fingerprinting by a few bits.

collinmanderson··on Deepest infrared image of universe
No. Webb looks deeper into the infrared and can see galaxies that Hubble can't see. There're some red galaxies in Webb (upper-right especially) that aren't in Hubble's at all.
collinmanderson··on James Webb first images – complete set of high resolution shots now live
Would be awesome to see if anyone can do machine learning using photoshop
collinmanderson··on The dark side of Shopify
Yes. I’ve stumbled upon some organizations in small towns in the US that want all postal mail going to their PO Box, nothing going to their physical address.

The small-town post office will sometimes _delete_ the physical address in the mail system so the actualy physical address is completely in-valid (or worse gets autocorrected to an address a mile away).

Turns out FedEx and UPS base their address validation off USPS and also don’t ship to PO Boxes.

collinmanderson··on I've locked myself out of my digital life
"please rest assured that my home is still standing" at the very end. I missed this myself.
collinmanderson··on VSCodium – Free/Libre Open Source Software Binaries of VS Code
I've been using vim over ssh for 13+ years, but switched to VSCode + "Remote SSH" this year for a few reasons:

- Keystrokes and edits are instant (not just predicted), even on a high-latency internet connection. (Since ~2007 I've been constantly annoyed by what's called "bufferbloat", and I want to be more resilient to a not-perfect internet connection because I don't control internet latency at coffee shops, etc.) (Mosh is annoying, having to set up special firewall rules to allow UDP ports, etc, and doesn't fully solve the problem.)

- VS Code is also easier to pick up where I left off if I lose the connection. (Yes, can be mostly solved with screen/tmux/byobu, but annoying to manage that.)

- Nice typing support, autocomplete and code navigation. I can command+click functions to jump straight to their actual definitions (not just something named the same thing). I get more instant feedback, catching more errors before actually running the code. (I use Python + pyright/pylance, and I suppose vim has some plugins for this too, but it's nice having something officially supported by the editor. I'm also guessing VS Code is way more powerful.)

- Easer to deal with multiple open files and switching between files in a projects. Uses many of the same keyboard-shortcuts as browser tabs. (I suppose vim has this functionality, but I never learned it.) Project-wide find/replace is also really really nice. (Easy to toggle between regex and case-sensitive modes, etc. Easier than "pie": perl -p -i -e 's/this/that/g' $(git ls-files))

- I can drag local files to the remote server really easily, and I can also right-click->download any file I see.

- Files open in the editor automatically update contents on screen if their content changes on the file system (unless there are unsaved changes).

Downsides so far are:

- VS Code is pretty memory hungry on the server and uses multiple node.js processes that probably don't share a lot of memory despite sharing tons of dependencies. (So, yes, bloat.)

- Remote SSH plugin isn't open source, and kinda just downloads and runs closed-source code on the server. I trust Microsoft more than some open-source projects to not abuse this though ideally I'd prefer to apt install something that Debian or Ubuntu has vetted.

- Annoying having to install a local client. Maybe we'll get a fully-featured browser-only version of it someday, but from what I've gathered it's not there yet (probably harder to lock down security-wise too).

collinmanderson··on Magic-trace – High-resolution traces of what a process is doing
Right, yeah I definitely recognized it in the screenshots.
← PreviousPage 8 of 32Next →