529 karma · joined Apr 10, 2018 (8y ago) · 249 submissions
4.
Show HN: Image Aspect Ratio Calculator(formgadget.com ↗)
1 points · by ishjoh · 1y ago · discuss
comment 3y ago · link · parent
I'm building an app on top of django where I have to worry about this, if you're using django check out there support for select-for-update, and if you're database supports it nowait=True can be a great thing that will fail a read if a select for update is already run:
https://docs.djangoproject.com/en/4.2/ref/models/querysets/#...
Also worth mentioning optimistic locking if you're looking to solve the issue in a different way, there is more involved from the application side but it has some advantages as well. I tend to prefer select for update with nowait=True since it's simpler on the application side, but I have used optimistic locking in the past with great success and some systems support it OOTB. Here is a description from AWS for those curious:
https://docs.aws.amazon.com/amazondynamodb/latest/developerg...
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
1. Were you just so hungry that you didn't want to stick with it anymore? What was your daily calorie deficit?
2. Did you enjoy your sports program or was it a chore to do?
comment 3y ago · link · parent
comment 3y ago · link · parent
But depositors didn't cause the initial problem, which was a large hole on the balance sheet of SVB. That was done by bad investments made by SVB. That was not the fault of tech companies but bankers.
> Seems like tech is systemically risky and should be highly regulated. This goes beyond tech businesses because the risk is there are lots of small businesses with high cash deposits in bank accounts. If the same thing happened to a different sector would you also call for highly regulating their industry because they had high deposit amounts in their bank accounts?
comment 3y ago · link · parent
I prefer REST. It is easier to cache server side which for certain types of data can be extremely useful. It works well with monitoring software. It is extremely easy to understand with just using curl.
Graphql works extremely well with React. The Graphql Apollo React client fits like a glove and is a pleasure to work with. I have not found a REST library that fits as well although there are likely some now.
comment 3y ago · link · parent
> thinking of all the vacations and iPhones I would have to buy
You don't have to buy this stuff. I grew up lower middle class, the only vacation we took until I was 15 was driving 8h to stay with my grandma. I never had a gameboy or lots of other things. My childhood was still great. Looking back maybe I could have had those things if my brother didn't exist, but I'm much happier that my brother exists because 10/10 I had way more fun with him than having a gameboy or exotic vacations, even though we didn't always get along.
College education is expensive, but it's possible to not spend a fortune using community college and transferring. Hopefully there will be even more low cost options in the future.
If you can have a roof over their head, feed them, have a stable home life and bring a positive attitude to every day then the rest doesn't matter.
comment 3y ago · link · parent
In particular a foot is an extremely intuitive unit of measure. It covers a number of use cases better than meters or centimeters.
I also prefer Fahrenheit now that I'm used to it. Fahrenheit has a nicer range for the temperatures we live our lives at, whereas Celsius compresses that range so much.
Unintuitive US units: Miles - I still have a very hard time with how far this is, km was much nicer.
comment 4y ago · link · parent
I also really like HoneyCrisp but I would rate it in the 70s, not the 90s.
comment 4y ago · link · parent
https://www.statista.com/statistics/1310218/time-spent-using...
Generally the younger you are the more likely you are to be a heavy user of your phone. There is no data for it but I would expect that high school and jr high kids are probably even higher users than 18 - 34.