Readit News logoReadit News
clawlor commented on Homomorphically Encrypting CRDTs   jakelazaroff.com/words/ho... · Posted by u/jakelazaroff
zawaideh · 9 months ago
If the server can't operate on the content, it can't merge it into the CRDT documents. Which means it would need to sending and receiving the entire state of the CRDT with each change.

If the friend is online then sending operations is possible, because they can be decrypted and merged.

clawlor · 9 months ago
There are variants of CRDTs where each change is only a state delta, or each change is described in terms of operations performed, which don't require sending the entire state for each change.
clawlor commented on You're not a senior engineer until you've worked on a legacy project (2023)   infobip.com/developers/bl... · Posted by u/tonkkatonka
breckenedge · a year ago
lol I love when people do this and it and now whenever I `git blame` their name shows up.
clawlor · a year ago
Agreed, this is quite annoying, but there is a workaround. You can tell blame to ignore commits like this, through a config option blame.ignoreRevsFile or similar CLI option. Not the most convenient perhaps, but it’s something. I believe GitHub also supports this, though you may have to request it to be enabled in your repository.

Given this, I tend to prefer a single, formatting-only commit when introducing formatting standards to an existing codebase. Otherwise, it’s difficult to take advantage of QOL features like auto formatting in your editor, or other formatting tools which tend to operate on entire files. Then PRs end up being mixed with formatting changes, which adds friction to the review process.

clawlor commented on Vegetable stock: my secret lover (2011)   blog.andymatuschak.org/po... · Posted by u/surprisetalk
plufz · 2 years ago
Sorry if I was vague. My question was why you would want your meat stock to have a thickener. I mean I don’t premix all my cornstarch with spices and salt since I want to be able to pick the right amount of aromas and taste separately from how thick I make my soup.
clawlor · 2 years ago
It's more of a mouthfeel thing than a thickener. Gelatin, in the amounts found in a good stock, will still be quite liquid when the stock is at serving temperature, but will sort of coat your mouth with flavor even when the broth hasn't been thickened with a roux or cornstarch.
clawlor commented on Why your team doesn't need to use pull requests   infrastructure-as-code.co... · Posted by u/aard
JenrHywy · 3 years ago
100%

The author also seems to have missed that you can still use CI on feature branches. Merge `master` to your feature branch regular, run the CI. Sure, you're only integrating with other complete-ish work, but it gets you a long way without making a complete mess of things.

clawlor · 3 years ago
Some CI systems do this automatically for PR builds, e.g. TravisCI:

> Rather than build the commits that have been pushed to the branch the pull request is from, we build the merge between the source branch and the upstream branch.

https://docs.travis-ci.com/user/pull-requests/#how-pull-requ...

clawlor commented on Writing Python like it's Rust   kobzol.github.io/rust/pyt... · Posted by u/thunderbong
miiiiiike · 3 years ago
I can’t get over how clunky Python 3 is getting. Does anyone like working with type hinting in Python? All of my code is typed but compared to basically every other type system the process was far more painful than it should have been.

Even years later I still keep printouts of the typing documentation next to me so I can save time when I invariably need to look up the multiple ways you can define ‘T’ when it would just be ‘class Foo<T>’ in almost any other language. I never have this problem C++/C#/TypeScript. I’d love to see type hinted Python look more like TypeScript.

I use Python every day and I like it less and less as it gets more of the features I want/need to use. I want types, I want generics, I want abstract classes, I want enums, I want interfaces. But I don’t want to have to import all of those features from modules when they should be built into the language itself.. When they’re built into the syntax of practically every other language that supports them.

When was the last time you saw a `Protocol` in the wild? Just add interfaces.

Teaching Python to a new developer is a ridiculous experience. There are just too many, usually half-baked, ways of doing things. Even this article, which does a great job going over some of Python’s newer/more advanced features, doesn’t use the latest version of the syntax or the generic versions of most types.

If I didn’t have such a massive investment in Python I would have moved to Rust by now. And don’t me wrong, I love Python, I want to use it. I just wish it would stop eating its tail.

Let’s just do a Python 4. Even if it means another decade long 2/3 adoption foot dragging.

clawlor · 3 years ago
> [...] when it would just be ‘class Foo<T>’ in almost any other language.

Good news on that front at least. PEP-895 [1] removes the need for `T = TypeVar(...)` boilerplate in Python 3.12.

[1] - https://peps.python.org/pep-0695/

clawlor commented on Use singular nouns for database table names   teamten.com/lawrence/prog... · Posted by u/pkkm
ahmedfromtunis · 3 years ago
In Django, the norm is to use singular nouns for models/table names.
clawlor · 3 years ago
Django also prepends the app name, giving you e.g. `auth_user` instead of `user`, side-stepping the likely collisions with reserved SQL keywords.
clawlor commented on A eulogy for Dark Sky, a data visualization masterpiece   nightingaledvs.com/dark-s... · Posted by u/skadamat
duanem · 3 years ago
I've actually already looked into the DEBUG=True issue just now. Setting it to false causes an "Internal Server Issue".

So do I spend hours looking for a fix, look into replacing it with a static pages site (I'm thinking Hugo) or just go back to porting Flowx to Apple :-)

clawlor · 3 years ago
> Never deploy a site into production with DEBUG turned on.

- https://docs.djangoproject.com/en/4.1/ref/settings/#debug

Setting DEBUG = False doesn't cause in Internal Server Issue. The issue is caused by something else, having DEBUG = True just means Django will return a detailed error page, instead of a generic 500 error page.

IIRC, DEBUG = True also used to leak memory, which doesn't matter so much for local development, where it's intended to be used.

clawlor commented on A GPT in 60 Lines of NumPy   jaykmody.com/blog/gpt-fro... · Posted by u/squidhunter
jwilber · 3 years ago
Almost every tech company will have some sort of commit hook using isort to force correct import ordering at the top of the file.
clawlor · 3 years ago
New (v5) isort doesn't move imports to the top of the file anymore, at least not by default. There is a flag to retain the old behavior, but even then I don't think it will move imports from, say, inside a function body to the top of the module.
clawlor commented on CamelCase vs. underscores revisited (2013)   whatheco.de/2013/02/16/ca... · Posted by u/aloukissas
stnmtn · 3 years ago
I don't hate leading underscores on _private_function or _class variable, in fact I think it's a great way to semantically signal intent

The double underscore for __super_private_function doesn't make much sense to me though. I can't see a reason why this shouldn't just be a single underscore, especially when __double_underscore__ signals very important python internals

clawlor · 3 years ago
The leading double underscore functions differently from a leading single underscore in this case:

> Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped.

See https://docs.python.org/3/tutorial/classes.html#private-vari...

clawlor commented on GeForce RTX 40 Series   nvidia.com/en-us/geforce/... · Posted by u/capableweb
colpabar · 3 years ago
Ask HN: I am still using a 980. What should I get? I do not care at all about having the latest/greatest, I just want an upgrade.
clawlor · 3 years ago
I upgraded from a 970 to a 2080 a while back and have been very happy with it. Still plays modern games at good frame rates, though not with max settings.

Obviously your choice depends greatly on budget + availability of hardware, as well as your desired resolution, but I'd suggest the 2070 or 2080 (maybe 2080ti?) as a good starting point.

u/clawlor

KarmaCake day43July 2, 2012View Original