Readit News logoReadit News
wbc commented on Architecture Patterns with Python   cosmicpython.com/book/pre... · Posted by u/asicsp
wormlord · 5 months ago
> I have seen how dangerous it can be when inexperienced developers take it as a gospel and try to implement everything at once

This book explicitly tells you not to do this.

> Similarly, service layers and unit of work are useful when you have complex applications that cover multiple complex use cases; but in a system consisting of small services with narrow responsibilities they quickly become overly bloated using this pattern. And don't even get me started with dependency injection in Python.

I have found service layers and DI really helpful for writing functional programs. I have some complex image-processing scripts in Python that I can use as plug-ins with a distributed image processing service in Celery. Service layer and DI just takes code from:

```python

dependency.do_thing(params)

```

To:

```python

do_thing(dependency, params)

```

Which ends up being a lot more testable. I can run image processing tasks in a live deployment with all of their I/O mocked, or I can run real image processing tasks on a mocked version of Celery. This lets me test all my different functions end-to-end before I ever do a full deploy. Also using the Result type with service layer has helped me propagate relevant error information back to the web client without crashing the program, since the failure modes are all handled in their specific service layer function.

wbc · 5 months ago
may I ask how you're mocking Celery to test?

the two main methods I've seen are to run tasks eagerly, or test the underlying function and avoid test Celery .delay/etc at all

wbc commented on To Delay Death, Lift Weights (2017)   outsideonline.com/health/... · Posted by u/makerdiety
polishdude20 · a year ago
It would be interesting to know what low strength people usually die from. One example where muscle mass would reign supreme would be in fall related deaths. Strength helps balance and helps prevent a fall in the first place. It also helps catch a fall. Strength training also strengthens bones so that would help you avoid a broken hip. Then if you do break a hip, your extra muscle mass and strength will deplete but not to the point where you're now bedridden. It's money in the bank.
wbc · a year ago
I think falling is the prime example. All 4 of my grandparents were relatively healthy, no heart issues, mild elevated blood sugar not even pre-diabetic. Once they reached 70s/80s, all of them eventually fell while walking around, became wheelchair-bound or hospitalized and died after.

I wish we had good population metrics on this.

wbc commented on What to do if your car is submerged in water   wsj.com/business/autos/wh... · Posted by u/JumpCrisscross
consp · a year ago
Manuals are actually less easy to open, if at all, once you get to the point where you are mostly under water. The electrics will function for quite a while and when you get to the point where they don't the manual is not going to do much anyway.
wbc · a year ago
o wow TIL, thanks for explaining that. Scary stuff to think about
wbc commented on What to do if your car is submerged in water   wsj.com/business/autos/wh... · Posted by u/JumpCrisscross
wbc · a year ago
Anyone know how feasible enough to require modern (powered-everything) cars have at least 1 window that has backup manual rolling for this scenario? or is it just too rare for the increased complexity?
wbc commented on Chronic stress spreads cancer   cshl.edu/chronic-stress-s... · Posted by u/bookofjoe
pazimzadeh · 2 years ago
> Mice were exposed to physical restraint stress as previously described (https://www.nature.com/articles/s41586-020-1935-3). Briefly, female mice were restrained in individual, homemade 50 mL Falcon tubes with air holes for 2 hours per day. Mice could move backward and forward slightly in the restraining tube.

I wonder why they only used female mice. In the original methods study about the effect of stress on hair loss both male and female mice are used.

wbc · 2 years ago
my understanding from the article is that they're working specifically w/ breast cancer, so probably easier w/ females
wbc commented on California to require firms to reveal carbon emissions in first law of its kind   theguardian.com/us-news/2... · Posted by u/PaulHoule
wbc · 2 years ago
Anyone work in emissions reporting have more insight into this? Scope 3 especially seems tough
wbc commented on Median Household Income After Taxes Fell 8.8% in 2022   census.gov/library/storie... · Posted by u/paulpauper
itake · 2 years ago
I don’t see how this fixes housing problems. If there are 5k housing units available, what is the “ socially inclusive minimum wage” such that everyone can afford housing?

This formula assumes all property and services are in abundance, but that is not reality.

wbc · 2 years ago
well clearly the solution is www.houseguarantee.lol
wbc commented on Who pays for your rewards? Redistribution in the credit card market [pdf]   federalreserve.gov/econre... · Posted by u/JumpCrisscross
wbc · 3 years ago
This whole thing is just so regressive. Every time I use my 2% back card, I know some less privileged folks paying cash gets shafted.

I wish everyone would use just debit cards over ccs, faster than trying to count out coins, less fees.

wbc commented on FTX Owes Money to More Than a Million People, Court Filing Suggests   vice.com/en/article/jgpnv... · Posted by u/bubblehack3r
lazide · 3 years ago
Simple that way? Yes, probably.

Tracing the actual on the ground transactions and seeing where each dollar went, and figuring out the mechanisms used to actually lift said dollars?

That’s what this discussion is about, and it’s not as clearly understood right now.

wbc · 3 years ago
sure it is! it all went to fiat@, it's marked clearly in the excel spreadsheet and everything

u/wbc

KarmaCake day157September 9, 2013View Original