HN user

tynorf

87 karma

[ my public key: https://keybase.io/tynor; my proof: https://keybase.io/tynor/sigs/cDld0ea8BUMbX4Blb2Hs-zUV9Cp9rGQDSu7I4SGZXeI ]

Posts0
Comments45
View on HN
No posts found.

The computer has 18GB of total RAM so I would hope that it’s already trying to conserve memory.

It’s kind of humorous that everyone interpreted the comment as complaining about Chrome. For all I know, it’s justified in using that much memory, or it’s the crappy websites I’m required to use for work with absurdly large heaps.

I really just meant that at least for work I need more than 8GB of RAM.

System Design 101 3 years ago

This is a very important point.

I'd argue all these "publish your DB schema as a GraphQL endpoint" frameworks that seem to proliferate have done a lot of damage to GraphQL's reputation. Strongly coupling data to presentation seems like such an obvious anti pattern, yet tools doing just that seem to be very popular for some reason.

Yes, that would be a different reason to prefer worktrees (that I mostly agree with). I was responding to the specific storage space claim.

I'm pretty sure part of the contract with gzip (and compression in general) is that applying it N times is undone by decompressing N times.

The size definitely gets bigger with each iteration:

  $ echo text >0.txt
  $ for i in {0..9}; do                             
  gzip <$i.txt >$((i + 1)).txt
  done
  $ ls | sort -n | xargs -n1 wc -c
       5 0.txt
      25 1.txt
      46 2.txt
      69 3.txt
      82 4.txt
     105 5.txt
     120 6.txt
     143 7.txt
     161 8.txt
     184 9.txt
     207 10.txt

I think the classic example is article list with author details. You load the articles (one query), then for each article you load its author (N queries). Naive use of an ORM causes this:

  articles = Article.load(limit=10)
  for article in articles:
    # .author implicitly runs a query
    author_name = article.author.name
This can be avoided in ORMs providing prefetching (e.g. `Article.load(eager_load='author')`).

I believe being lenient in accepting input is what leads to SSRF attacks (HTTP request smuggling via disagreeing `transfer-encoding` and `content-length` headers).

Probably either via a third party service (such as AWS secrets manager), or mounted as files scoped to the user your process is running as (which is not root, right? :) ).

Just a point of clarification: native app notifications on iOS are absolutely opt-in. If the app wants to send notifications it requires a dialogue and user confirmation.

Disappointingly, Apple makes an exception for their first party apps.

Firefox 80 6 years ago

Out of curiosity, how many windows/tabs? I routinely launch FF with dozens of windows/hundreds of tabs and I've never had macOS kernel panic in that case.

How to Exit Vim 7 years ago

Unfortunately:

  E183: User defined commands must start with an uppercase letter

Your protobuf messages are changing that much? My condolences.

ETA: Also, you already are needing to add code to every encode/decode point for the `map[string]interface{}` handling. :P

One technique I use is to create a struct that mirrors the layout of the target struct, then just cast between them. So if you have a

  type Person struct {
    FirstName string `json:"first_name"`
  }
And you get json like `{"name": "Alice"}`, you can decode it something like this:
  var doc struct {
    FirstName string `json:"name"`
  }
  json.Unmarshal(data, &doc)
  person := Person(doc)
I have not looked at the assembly so I can't say whether this incurs extra overhead or not.

AFAIK that is exactly how restic works. You use `restic forget` to remove the roots (snapshots), then `restic prune` garbage collects unreachable blobs.

ETA: However, nearly all data in restic is encrypted. This includes the index files. So you still need to have the encryption key to look at snapshots and walk their trees.

Many (most? all?) allocators are guaranteed to give you back aligned pointers.

For instance, jemalloc(3) on amd64 platforms will give back 16-byte aligned pointers:

  [...] The allocated space is suitably aligned
  (after possible pointer coercion) for storage of any type of object.