symmetric difference iterates each set object once. making two differences also iterates each set object once. how would you propose to solve it without iterating each set at least once? seems impossible to me.
what's a common way to expose all models in a Django application via REST APIs generically, i.e. not having to add more code when adding another model
Looking for something like api/ressources/model1 CRUD for a model that is called Model1 where partial updates as well as Create read and delete are supported plus some query parameter driven filtering and nesting
I have several expressions such as x = x0 + sum(sin(n*y)*cosh(n*w)) for n = 1..4. What would the most pythonic way of doing this be? x0, y, w are known constants.
Not sure how to string that together but have a look at Python Math library and Numpy those plus a few others are what we are using in Applied Maths module at the moment in my masters program
@StewieGriffin Numpy is good when you have a lot of numbers to process, and you can organize your work to use arrays, so that Numpy can loop over the array elements at C speed. Using Numpy on an array of length 4 is overkill.
Hello @NasrinShirali! I was wondering what happened to you. Have you been busy with a new job?
@StewieGriffin Other math libs worth investigating are gmpy and mpmath. mpmath can do arbitrary precision arithmetic, and supports a large collection of functions. It can also do integrals, solve equations, and estimate limits of infinite series, assuming they converge.
Interesting. I have tests that run fine from the terminal in Pycharm, run fine on Travis, run fine on Appveyor, but when running in Pycharm's run pytest functionality, I need to put this code into one of the tests:
@PM2Ring Yup, it's running the test with cwd as the test_suite, which is a subdirectory in my project directory, and so I guess it's not finding my app_main.py in the project directory (which is what sys.path[0] returns). Yet...it runs fine on the terminal inside Pycharm, in my commandline, and on Travis...
Ah. Apparently...even though I could just right run the test by right clicking the folder, scripts etc, I had to set up a configuration with the working directory to be the project home instead of the test directory...not sure why PyCharm wouldn't assume the project home, but there you are.
@Ishwar It doesn't fail. Negative indices in Python count from the end of the list, tuple, or array, so a[-1] is the last element in a, a[-2] is the second-last, etc.
I agree, but then I'm still learning myself. I see spinning up a webapp as probably simpler than PyQt, plus you learn about a webapp framework, which you can extent to host your app beyond your local machine if you want to go there.
Hey, not sure what the expectations are in this case. I answered a question for a new user and was deemed helpful. When the OP got his code working with my answer, he posted his working code in the answer. Should I comment saying that really should be updated in the question or should it be an answer? stackoverflow.com/questions/53196063/…
Working code typically goes in an answer, although it's unusual for the OP to mark a post other than his own as accepted
Typically, either 1) he fixes it himself and accepts his own self-answer, or 2) someone else's answer solves the problem and he doesn't need to post working code
the last two weeks have seemed slow to me. We started a new project and I'm still wrapping up the previous one. So juggling the two is definitely stressful.
oh, looks like they didn't specify the content type for the metadata. but still, just a 3.0.1 would fix that, I don't understand the point of the "post" tag for minor screwups
Sublime has the same problem like thonny editor on Raspberry pi. the editor start reading the string from links to right. In this video you can see "mess of alphabets" which i meant https://www.youtube.com/watch?v=BDq6i5KKj3o