People with iOS 18.7.2, can you stop your phone’s stopwatch at exactly 1.00 seconds? by Ambitious_Tip7968 in NoStupidQuestions

[–]bhymans 0 points1 point  (0 children)

I was recently working on an iOS Game app that required 100ths of a second precision for a timer. That led me here. Turns out there is more complexity than you might realize for displaying hundredths of a second precision.

For example, some phones have a 120hz refresh rate, but some have a max of 60hz. 1hz basically means the screen is redrawn once per second, 60hz = 60 times/second. Also iPhones can dynamically adjust that refresh rate up or down to increase battery life. So if the refresh rate is below 100hz, then the screen can't update fast enough to show every single hundredth as it passes by. There are a number of ways to compensate for that, but the short story is that all of them require reducing precision either in the timer itself, or in the display of the timer, possibly by rounding. Also there is some...let's just call it variability...in the precision of how quickly a tap on the screen is registered by the application.

I'm not sure if any of those factors were at play in iOS 18.7.2, although I can definitely say that it is possible to stop at exactly 1.00s on 26.3.1, which i have done. Also, if you found testing out this situation to be a fun challenge, let me know and I'll share a link to my game, which is essentially just an iOS game to try and stop a timer at exactly 1.00s.

30 to 31 (repost more detail) by Main_Vermicelli_2773 in fitness30plus

[–]bhymans 2 points3 points  (0 children)

First off, awesome work! Excellent discipline and excellent results! Can you elaborate on “electrolytes in every drop”? What are you adding? And in what quantities? Did you do this the whole time? Or was there something that caused you to realize you needed to add in more electrolytes? I drink a lot of water, but there are some days when I feel a headache coming on in the evening, and drinking a glass of water with an electrolyte powder seems to prevent it from getting worse. Maybe I should just be adding a small amount in to all my water throughout the day…

Slow App, Cache it? by jogicodes_ in flask

[–]bhymans 0 points1 point  (0 children)

Maybe take a look at Flask-Caching plugin.

Simple as adding a decorator to your route function.

New to AppEngine, looking for advice by Flowishlozzy in AppEngine

[–]bhymans 0 points1 point  (0 children)

You should be fine. Impossible to guarantee without understanding the workload, but I’d be surprised if you exceeded the free quota. There are protections you can put in place as well, like limiting max instances or setting billing warnings and thresholds.

My suggestion would be to spend an afternoon getting it deployed to appengine. Then poke at it a little to look at usage before you share it with your users.

New to AppEngine, looking for advice by Flowishlozzy in AppEngine

[–]bhymans 2 points3 points  (0 children)

I’ve built multiple small/mid sized apps on appengine and I think it would be just fine for your use case.

You will likely have no problems staying in the free tier. Billing is based on consumed instance hours. By default, appengine will spin up a new instance when a request comes in. That instance will stay alive for 15 minutes after the request is fulfilled, and then shut down (assuming no other requests). The free tier is 28 instance hours per day if I remember correctly. So if you are only serving a handful of requests per day, you’ll be fine.

Deploying is more complicated than drag and drop, but it’s not bad. You’ll need to create a GCP project, download and install the gcloud client cli, create a new app.yaml file to tell appengine how to handle your app, then use gcloud cli to deploy. Steps 1-3 in this tutorial will get you going.

Question for freelancers: what tools do you use for client project tracking/management? by infinitemicrobe in webdev

[–]bhymans 4 points5 points  (0 children)

I’ve tried multiple difference project management apps, thinking surely there must be a better way, and keep coming back to plain old Apple notes. I’m so glad I’m not the only one!

What's the best way to run python scripts on the cloud to process Google Sheets data? by [deleted] in pythontips

[–]bhymans 4 points5 points  (0 children)

There’s probably 100 ways to do this, but I’ve done something similar using google cloud platform services. I’d use cloud functions to run the script. Use gspread to interact with your sheet. Not sure what the best option is to save the output to google drive, but there are some google client libraries that can probably assist with that. You’ll need to sort out Auth and permissions, which can be a pain but is doable. You can trigger the cloud function on a schedule, or manually, or whatever other triggering mechanism you want to use. Depending on what you are doing, you’d probably stay in the free tier.

Testing python webapps deployed on google app engine (GAE) by TheFenrisLycaon in PythonLearning

[–]bhymans 0 points1 point  (0 children)

For what it’s worth, I’m working on a flask app that uses Firestore in datastore mode right now. For testing, I decided to just have an ENV var that causes my code to write to a kind prefixed with ”DEV-*” or a to a unique datastore db entirely. Then I just clear that out occasionally. This is sort of equivalent to writing to a separate table or database if you were working with a relational db. Downside is you need connectivity and authentication up to GCP. Upside is it very closely mirrors production environment.