« first day (3777 days earlier)      last day (1186 days later) » 

1:22 AM
@LucaSansS please don't ask for help here with fresh questions on the main site as per our rules
 
 
4 hours later…
5:38 AM
Hi all, I need your help to resolve my doubt on the result that i am getting "None" in the result . why so?

Code:-
class calculator:
num=100

def __init__(self,a,b):
self.first=a
self.last=b
print("This will be called automatically")

def getdata(self):
print("I am executing as method in class")

Result:-
This will be called automatically
I am executing as method in class
None
 
you need to look at tinyurl.com/urnzp7k for code formatting, also how are you executing this method
if you are using something like print(obj_calc.getdata()) you will most likely get None
 
@python_user i am using below code to return value but getting None along with the expected result

obj=calculator(4,5)
print(obj.getdata())
print(obj.summation())
 
you need to look at the link to format code
 
5:53 AM
format is correct thats why i am getting result but i am not getting what is the scene with None in the result
 
the methods in your class are returning None
 
@python_user print(obj.getdata()) method is returing None with expected result
i havent defined anything that will return none
 
in python if you do not return anything python returns None
 
@python_user Thank you :) I get it..
 
 
2 hours later…
7:47 AM
cbg. Should we answer such 'givemetehcodez' questions as stackoverflow.com/questions/66237618/… ?
 
8:14 AM
@smci Recent Meta discussions have been pretty clear that there is entirely no requirement whatsoever at all for askers to provide a code attempt at solving their own problem.
Whether that means one personally should provide an answer and thus support such questions is left as a personal exercise to the reader.
 
8:30 AM
@malan88 Yes it will. Relative paths are always in relation to the CWD. systemd will run your code just like any other system would; just be aware that it starts with a very bare environment, and that various useful settings are not available in older systemd versions.
The last part regularly bites me at work. :/
 
@smci ignore that ridiculous review comment
 
@MisterMiyagi I'm asking for your specific opinion on that one, and I wasn't aware of those recent Meta discussions, only all the older highly-upvoted ones (VLQ/givemetehcodez) that say we shouldn't. Who here thinks that question should be left open? open but downvoted? closed? I'm looking for guidance.
 
closed and downvoted
 
@cs95 Ok. as to the review comment clearly someone flagged me, for doing the right thing, to the best of my knowledge. No good deed goes unpunished. For VLQ/givemetehcodez, there's no obligation to posttehcodez.
 
A downvote is appropriate if you feel "This question does not show any research effort; it is unclear or not useful". A close vote is appropriate if any of the close vote reasons apply; none of them are for lack of effort.
 
8:41 AM
closure for off topic / unclear lacking mcve
although I'm guilty myself of answering questions like that
if those were python questions they'd almost certainly be closed. A lot of the times people excuse lack of code with pandas questions because it usually does not help / the final answer will likely be very different from OP's initial attempt
it still is nice to see their code so you know they've made an honest effort (even if their code shows they have no idea what they're doing)
 
Realistically speaking, often enough an "honest effort" is just noise that makes it more difficult to dupe hammer.
 
@cs95 Yes. I'm busy so I don't have time to keep abreast of Meta and the perennial "How welcoming...". Thanks for the backup on that review comment.
 
This Q in specific looks like something I'd expect to have a duplicate.
 
@MisterMiyagi But commands are keywords that help a search. In this case 'groupby(), sort(), top()
 
That would make sense to me if we could expect the OP to know the solution. Obviously, they don't.
If you know which commands are relevant, then an appropriate dupe should have these commands in its answers.
 
8:56 AM
@MisterMiyagi I didn't say that. I did say that after some hinting/prodding (like I gave), even a new user should try to post a little code, and even one or two commands are better than zero (in this case). Otherwise that's guaranteeing a stream of dupes that noone will bother to figure out which dupe target to close as. (And if you downvote/VtC rather than close-as-dupe, you'll be accused of unwelcoming). Honestly the tag is getting close to needing to be abandoned, and this would make it worse.
 
StackOverflow is Q&A, not a forum. An OP should not be guided along to some half-attempt before they deserve an answer.
Honestly, the tag is well past the point of where it should be abandoned.
 
i've seen people answering homework questions with hints rather than state the code outright. Why is that acceptable but not this?
I don't think "homework questions" should get special treatment, and indeed meta advises against that, so I assumed hints were permissible for questions that show no effort on their face
Agree that the tag is in a pretty sad state though
 
@cs95 The TLDR is: It's not acceptable there either.
 
Oh hrm. I can see that being a better option tbh. Refrain from answering at all, better chance of closing questions that need to be closed
 
 
2 hours later…
10:46 AM
@MisterMiyagi I'll fetch the gas can
The fire is already going so no need for matches
 
11:23 AM
I just drafted an issue on github and then rubber ducky struck again :)
 
Good job. My record is "spend an hour figuring out where the bug is, only to realize it was fixed in master two weeks ago".
it was an important experience: check master first
 
12:01 PM
Heh, it's the opposite on my current projects. main is where the demons hide
Thankfully, we've finally been able to merge everything up. But main was definitely the shadowy place
master not main sorry
 
@AndrasDeak yeah I had that last week. But I forgot that ros doesn't have rolling releases and a bunch of stuff broke when updating to master, took me a few days to get everything working again. At least I have the fix now :)
 
user13727121
12:55 PM
vegetables = ['squash', 'pea', 'carrot', 'potato'] this is considered as an iterable, right? like all sequences and collections
 
@AndrasDeak talking about our yesterdays short discussion about Python, Helm and 2 libraries for Helm 2 and Helm 3. Your idea about a wrapper was good. Adding a design pattern to it is a good thing too! refactoring.guru/design-patterns/facade
Like, a wrapper made with the facade design pattern
 
@CoreVisional yes. that's a good ol' python list.
 
@CoreVisional you can check collections.abc for protocols
 
@AndrasDeak that's a funny way of spelling typing ducks
 
user13727121
thank you @AndrasDeak and @ParitoshSingh
 
1:33 PM
morning cabbages, folks
 
1:50 PM
@EliHalych arbitrary pattern names make everything better
 
2:15 PM
Does anyone know a good algorithm to solve problem in math.stackexchange.com/questions/4021958/…
 
@JaakkoSeppälä I think your A3 is broken, with half the A4 explanation injected
ah, no, that's just some funky mathjax rendering
 
2:56 PM
refuels chainsaw of +3 against people-writing-O(n^2)-code-because-n-is-surely-going-to-be-small
 
well if it is going to be small then an n^2 with small coefficient can be reliably faster :P
 
We're now at 26h runtime to process 24h of data... :P
 
nice
I hope you implemented the O(log n) version in that time
 
I still haven't figured out what the original version even is.
I just prodded it with science.
 
Hmm? Do you mean that it's an O(n^2) black box?
 
3:09 PM
@JaakkoSeppälä I'd say your initial intuition is spot on! I've solved similar problems with a Genetic Algorithm, and Simulated Annealing should work as well
 
@AndrasDeak The correct term is "production ready package". Kinda plug and play, just without the play.
 
3:41 PM
@inspectorG4dget Thanks. It looks like a hard for me to find a good implementation for this problem.
 
@JaakkoSeppälä I wrote a GA framework a while ago, if that'd make things easier for you
 
@inspectorG4dget I try to learn to implement proper algorithm.
 
 
1 hour later…
4:57 PM
wth, I have a weird bug. In a test file doing this gives me (189, 235, 52, 0.5) as expected
class Foo:
    opacity = 0.5
    grey = (224, 205, 204)
    info = (0, 0, 255)
    warn = (189, 235, 52)
    error = (235, 58, 52)

    def __init__(self):
        color = self.warn
        self.color = color + (self.opacity,)

foo = Foo()
print(foo.color)
but in my actual code color is -0.9450465358886717 which seems so weird
and I get: TypeError: unsupported operand type(s) for +: 'float' and 'tuple'
ah, damn can't delete it. Sorry. I had something named error already ofc
 
5:45 PM
Freudian slip typo of the day: Pyharm
 
6:10 PM
 
6:23 PM
Turns out this may be a rediscovery of an earlier post by Andrew Dalke.
 
@holdenweb neat
 
6:57 PM
FYI - toonarmycaptain, Dodge, and I are all part of the Great Texas Polar Vortex and Power Grid Snafu currently going on (may be others in this chat also, but those are the ones I know about). The really cold temps are pretty much behind us, but still at or below freezing, so not all the frozen plumbing has revealed itself. The killer is that Texas in its infinite (lack of) wisdom, chose years ago to have its own power grid, mostly isolated from the rest of the country's.
To avoid that pesky federal regulation FERC. And as a cost saving measure, scaled back winterizing work on wind farms and gas distribution pipelines, because it never gets below 20F in Texas!
So there isn't much to be done, unless you have a time machine and the ability to sway greedy politicos to do the right thing, even if it cost some tax money.
Fortunately, we here at PaulMcG house still have electric, gas, and water, though nearby surrounding areas are on blackouts and having to boil their water (or had to shut it off because of burst frozen pipes). Best wishes to @Dodge and @toonarmycaptain, hope you guys are doing okay.
Just wanted to pass along to the rest of the group who might be wondering.
@Dodge and @toonarmycaptain - if you still have water, fill your bathtubs, just about all of Austin is boiling their water now.
 
7:30 PM
anyone have an idea of how I could find a "half step" in a geometric series?
i.e. I know the first term of the geometric series and I know the growth ratio. I can compute a_i for any integer value of i. However, what happens when I want to compute a_3.4, for instance?
should I just use a_0*r**3.4... or ?
 
That's what i would do
 
super. Thanks
just wanted to make sure I wasn't going crazy
 
7:51 PM
yup
that's also how logarithmic axes work
 
 
2 hours later…
10:03 PM
@PaulMcG Thanks for checking on us. All good here. Just a little cabin fever. My biggest gripe is that a package I'm waiting on appears to be stuck in DFW. Glad to hear you're getting by.
 
@AndrasDeak As used by mathematician lumberjacks
 
10:29 PM
:|
take care, Texans
11
 

« first day (3777 days earlier)      last day (1186 days later) »