Skip to main content
Oliver Mohr Bonometti's user avatar
Oliver Mohr Bonometti's user avatar
Oliver Mohr Bonometti's user avatar
Oliver Mohr Bonometti
Prop Trader
  • Member for 11 years
  • Last seen this week
revised
Multiple inheritance in Rust
added 326 characters in body
Loading…
comment
Multiple inheritance in Rust
@Dai How do you deal with this in Rust then? I have like 4 other implementations for Day30 like "classes". Repeating code doesn't sound like a good idea.
comment
Multiple inheritance in Rust
@kmdreko But that would require to call the function in each implementation And also have to implement day_count instead of just implementing get_d1 and get_d2.
asked
Loading…
asked
Loading…
Loading…
comment
Close Python Websocket server from another thread
Thanks. Similar to ChatGPT solution I posted. Just a question, which implementation do you think is better? Just change this on stop method, or the one I posted.
answered
Loading…
Loading…
comment
Python Windows Service (pywin32) works in debug mode but fails as an installed Windows Service
Tried that, but it only changed the error to "could not log in". I suspect the error is not caused by running the service at computer level insted of user level.
Loading…
awarded
awarded
comment
Minimize class method with class attributes as parameters
Yes. "Calibrates its attributes x and y such that it minimizes the return value of get_value() method"
revised
Loading…
comment
Minimize class method with class attributes as parameters
It seems that ^ does not behave as expecte. Replacing it with **.
comment
Minimize class method with class attributes as parameters
- It is just a type hint. Python is not strongly typed. Using int or float will not raise an exception. - 13 is the result of get value with initial value given in c = Conic(0, 0,), therefore get_value() will calculate (0 - 2)^2 + (0 + 3)^2 = 4 + 9 = 13. - calibrate does nothing as that is the function I don't know how to code. And there should be the code that "finds" x = 2, y = -3.
revised
Loading…
comment
Minimize class method with class attributes as parameters
As stated, I want to minimize get_value() calibrating x and y. I'm adding expected behaviour to the question.
Loading…
1
2 3 4 5
11