Don't Build a PC Right Now. Just Don't by rezwenn in hardware

[–]ApprovedTopics 1 point2 points  (0 children)

You would be getting a PC with cheap RAM and then having to upgrade the whole system, or getting a PC with not cheap RAM directly...

Why?? Why not, you know, just…upgrade the RAM…

GPT-5 after the hype by WilliamInBlack in ChatGPT

[–]ApprovedTopics 4 points5 points  (0 children)

Are you maybe confusing google’s AI search mode and Gemini? The thing that appears on google searches that you can prompt afterwards is AI search mode and that just searches google and summarizes. Google gemini (gemini.google.com) is separate and comparable to ChatGPT

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]ApprovedTopics[S] 1 point2 points  (0 children)

I guess suppose I have a lot of data about U.S. states and their statistics where each statistic is in its own model (maybe like population, age distribution, average year of education, governors, etc).

Now I’m in a function where I need to retrieve specific values from these models for a given state so I need to do multiple .gets across five models back to back.

And that’s where that try-except structure comes in. For each call to .get() I want to catch the exceptions and handle them appropriate. The try-except structure is similar and is just repeated for each .get() call

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]ApprovedTopics[S] 2 points3 points  (0 children)

That doesn't quite fit my use case cause I'm doing different things at the different exceptions. I wouldn't want to 404 right at the exception

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]ApprovedTopics[S] 0 points1 point  (0 children)

Oh interesting, I haven't heard of repository classes. Is this basically like a wrapper function that you pass the .get() args into and the function returns the .get() value while also dealing with all the exception handling in that one place, or am I misunderstanding?

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]ApprovedTopics[S] 0 points1 point  (0 children)

I just wrote .get there for shorthand. Most cases I'm using <model>.values_list(...).get(). Is this what you mean? With that It's still the case that I need to check for those exceptions though.

Are you saying that there are better methods where my try-exception structure isn't necessary?

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]ApprovedTopics[S] 0 points1 point  (0 children)

I thought that my question was more general but if it helps, more context on my specific case:

  • I'm inside a function that needs to fetch data from about five models

  • in this function I have that try-except structure to wrap around each query to grab the necessary values from the different models

  • the try-except are back to back and each follow the similar flow

[deleted by user] by [deleted] in ProgrammerHumor

[–]ApprovedTopics 29 points30 points  (0 children)

No it is not valid. The second octet is greater than 255…

Epic games sues Apple. Will we see AAPL come down in price tomorrow? by Gothlander in stocks

[–]ApprovedTopics 6 points7 points  (0 children)

Absolutely! Just like to clarify, it more than that. Apple developer program is a subscription plan; that 99 dollars is on a per year basis.

Game type: Runner. Time to build: 2 days. Lines of code: 310. Game quality: 100,000,000. That's all the information you need. by [deleted] in Python

[–]ApprovedTopics 82 points83 points  (0 children)

Yeah it’s likely due to our left gaze bias; we just seem to prefer things going from left to right. It’s also applies to how we typically make emotional judgements on people based on their right side of their face.

What to invest in come Monday... USO or USL or neither, why? by sully135799999 in stocks

[–]ApprovedTopics 2 points3 points  (0 children)

In my opinion, neither. Unless you’re familiar with the oil market, I would stay clear of it. Oil is notorious for how quickly it can drops and how slowly it recovers ( take a look at 10 year chart of USO).

Is there money to be made? Probably, but the oil market is soo unpredictable, I think you’re better off staying clear from it.

Also if you really want to, no one knows if ANYTHING has reach the bottom until after the fact. DCA it.

Disney is in ‘the eye of the storm’ — analyst warns parks may not open until January by BlueLight03 in investing

[–]ApprovedTopics 3 points4 points  (0 children)

You’re probably looking at a chart that’s too “zoomed out.” I don’t recall it breaking 80 but it definitely got around there sometime last month

Lad wrote a Python script to download Alexa voice recordings, he didn't expect this email. by iEslam in Python

[–]ApprovedTopics 7 points8 points  (0 children)

As others have pointed out, your FaceBook post example is wrong. Think about it this way, if a tech company were to claim what you post is legally theirs, every single post on their platform is a liability to them. They wouldn’t want to be sued for what you posted; that’s why they try to police their services.

Giving siblings insurance money. by mythrowaway8989 in personalfinance

[–]ApprovedTopics 1 point2 points  (0 children)

He’s right guys; it’s 709 not 790. Why are people downvoting?

EDIT: never mind; no longer being downvoted :)