« first day (3114 days earlier)      last day (2058 days later) » 

00:29
cbg
 
3 hours later…
03:34
@JonClements Congratulations! you've got python 3.x gold badge, little late to say this time :-)
@U9-Forward haha... thank you my chat member track badge stalker :p
@JonClements Lol, :-), bit late tho :-)
tenuous though... it'd only take a question to be removed or whatever and I wont have it anymore... blah blah
Next goal? :-)
@JonClements I would love to have another gold-badge, like , or ...
I have right now
meh.... not ultimately bothered
03:43
Lol :-)
got a diamond - what else could one want? :P
@JonClements Chee, i would like to have one as well :-)
haha... you really don't :)
@JonClements Well, i am not gonna go for it, maybe another couple of years (at least 3), well, this year cs95 (coldspeed) went for it, couldn't tho, i think next year he would get it.
He (cs95) just joined the room
rbrb for a bit
03:52
Okay
04:43
who the hell is coldspeed
;)
@cs95 You... i knew you gonna say that :-)
coldspeed is a user on SO :-)
dunno who that is but sounds like a cool fellow
 
2 hours later…
@AndrasDeak closed
looks like coldspeed got to it
bless his soul, whoever he is
@cs95 Lol :), you're coldspeed, stop trying to act like another user please :-)
please don't assume my identity ;(
06:42
@cs95 Where is botspeed again?
that made me laugh harder than it should have
who dat
@ParitoshSingh Lol
why didn't stackoverflow concentrate on UI?
@U9-Forward hey shaddap
06:43
they did.
@botspeed WHAT!
@cs95 What did you do to me...
@ParitoshSingh what?
@cs95 I want him to be here for more than a minute
don't ask me man, ask the guy who owns the account
yeah, where is coldspeed anyways?
06:46
@cs95 It's you
@AchyuthKodali SO has a lot of work done on its UI. Whether "you" like it or not is subjective, but doesn't mean its not there. the goal may not align with what you perhaps prefer, because its no frills minimalist. I rather like it myself, i dont enjoy things flashing in my face.
boi
As well as
@cs95 With same user id:
4909087
I gotcha man
@underscore Please do not show box-links here...
oh that user must've deleted their account before I got their ID.
06:48
P.S. that has nothing to do with python...
sopython.com/chatroom room rules, dont post your own recent questions here.
Also it is closed as a dupe now
@Arne Exactly, i just said that as well
you didnt?
@cs95 Than you're way to lucky than, than why you have the same logo
yeah ... let's call it luck...
06:49
mm
@cs95 Also why you name yourself, cs95, it's the same as coldspeed 95
what a strange coincidence.
@cs95 And how come you seem to be continuing the same account, you have started with coldpseed's rep
you really don't want to play this game with me
@cs95 Okay, i get it :-)
Strange
stackoverflow.com/users/11241872/botspeed says it's owner is a link to you
06:53
random question, if i read a string in that came from a different encoding, say utf16, and i write it out as utf8... im not doing anything wrong per se right?
reading the bytes on the input side, to string as utf16, but just writing it out in a different encoding. will it ever go wrong?
>>> 'coldspeed' == 'cs95'
True
>>>
they linked to the user who owned the account before I did, and I guess they forgot to remove the link once that user left. Bad.
Geez, i stop
How did you open up his account then?
And make him tell me to shaddap
not me.
shut up
06:55
ok
@cs95 Noooo... i didn't ask you to shut up...
I just wanted to make the speliing rrrrriiiiigggtttthhh
@ParitoshSingh in Python 3 no, when you decode you get a Unicode string and then you can encode it for a different encoding as you please
@cs95 talk please...
of course if something at the other end demands a particular encoding that's what you have to go by
Perfect, thank you!
06:58
so for instance if you write UTF-8 to a file which is consumed by a tool which expects UTF-16 you get gartbage in that other tool
aye, the receiving end for my case is expecting utf8, and so i just wanted to make sure i wasnt introducing any bugs while rewriting the current implementation
It's kind of like asking "is it wrong to take JSON as input and produce XML as output?". There's nothing inherently wrong with that. As long as you're sure that your input is really JSON-encoded and you really want your output to be XML-encoded, that's perfectly fine
@cs95 How do you create bots
?
this direction should work fine, there will be snags when you attempt to convert to legacy encodings which don't always support all the code points in Unicode
so UTF-16 to Latin-1 will appear to work fine with ordinary English text but fail spectacularly with Chinese
@underscore sorry, too late for me to downvote
07:01
@AndrasDeak I don't suppose we could undelete it just so we can add more downvotes and then delete it again
We could but it would not Be Nice :P
@tripleee At least with bash it's your problem
@tripleee yeah, makes sense. If theres one rule ive learnt, it seems its best to make sure to enforce your own outputs in one of the unicode formats (and utf 8 seems to be the nicest) as much as you can. Unless someone whos using your outputs cannot handle utf8, there seems to be no reason not to use it. (None that i know of yet anyways)
Im more concerned about how badly the input side will fail, and whether i should rely on it for what it "Says" the encoding is or not.. :/
its already lied to me once, and this is just about the only file i have for testing. Turns out the input encoding is not utf 16. send help
@ParitoshSingh amen brother utf8everywhere.org
@ParitoshSingh do you know the actual encoding?
07:09
cp1252 "seems" to look correct for this.
yuck
i just now need to figure out how to infer it, would resort to chardet if i cant find a property that indicates the correct encoding
Is that windows' latin1 cop?
the object im dealing with insists its utf 16 le though.. the output..is now chinese
latin-1 more like
07:10
Yeah, edited, thanks
@ParitoshSingh if you know what individual glyphs are supposed to represent you can look them up on (ahem cough cough) tripleee.github.io/8bit
would need to make a pipeline out of it, so i'd have to rely on something automated.
the tricky part is often finding the rare bytes which actually uniquely identify a particular encoding
to be more specific, this is outlook .msg files actually. So im sure there has to be some property somewhere. Gonna go digging
there is no way to fully automate this, you need human review
07:12
yeah, i think we will probably end up tolerating a couple bad conversions
@ParitoshSingh Outlook maliciously clobbers and falsifies a lot of the MIME information, is there a way you can use honest-to-jon-postel RFC5322 email format instead?
oh, not familiar with other email formats o.o
sadly, no, the emails themselves are out of my control
MSG is a horrible crock, they compile it into the proprietary Microsoft format which lies and cheats whenever it can
aye, ah well :P shrug
it's ostensibly documented now but like all the Microsoft legacy formats, there's a lot of "because Excel v2 did it this way we still do it this way and you just have to know the conventions"
but even with completely clean email source you have a lot of live email where the sender lied in the first place
so something tagged as Korean might actually be in English because the client was simply configured to use Korean as the default and nobody ever bothers to override for every message
07:16
oh gosh
should i just go for chardet and not bother?
swiping generalization ahead unless you are doing this for a high profile legal fact finding investigation or something like that, I guess yeah
mm, i'll look into some properties, and then resort to that if i dont find anything reliable in this documentation. Thanks
sure! oddly, this is really actually my pleasure
Making the world a better place one mojibake at a time
07:35
Hello guyz i need t detect the floor of room using openCV can anyone suggest some options to achieve that
Edge detection would probably be a good start
googling gets me some helpful hints on this site called Stack Overflow, did you look at that?
a little more seriously, tell us what you already tried and how that didn't work so we can better see where you are stuck
i achieved image processing with canny edge detection but i dont know how to find the floor from processed image
@mtbrands
Is the orientation always on the same level? Like floor will always be bottom of picture
yes i have restrict image capture on single mode
but i try to make it more generic so in future if we get multi orientation than also it will work
07:48
rbrb
 
2 hours later…
09:34
" I need help in this random generation thingy" is a strong contender for my favourite SO question :)
return 42
@ParitoshSingh You underestimate the thingy
return 42 + 1. That's basically chaos theory. I think.
shame, my trusted random number generator code never fails me
09:53
anyone knows how may i detect floor from image. i just apply canny algorithm to find edges but after that how may i detect floor from that image
@Anjan can you please stop asking that? If there was someone here who could answer from that amount of information you'd already have an answer.
Either produce an MCVE and wait patiently for an answer, or just stop. But there aren't many openCV (or image recognition in general) experts among regulars, I think.
ok no problem
frankly, you'd need to restrict the orientation to make sure the floor thats supposed to be down stays down
and just code the logic around the closed region at the bottom of the canny image
@Paritosh there's so much information missing. Leaving handwaving guesses with literally no info about the inputs is not helpful.
10:12
cbg
10:32
is this on purpose?! This has to be!! these removed messages messing with my curiousity, aah!
I thought it was the natural progression of the cbg chain :)
10:57
Does the django template language exist outside of django?
i just had a very...veryy weird moment. Apparently, i thought for a moment i had answered a question i was looking to find an answer for, about 7 years ago. It was...disconcerting, all things considered.
<smells socks>
Lol
Laurel
what's funny is that you dont really think about the answerer's name, and so i just scrolled to the comments, read a couple.. and then just had this weird feeling all over once i noticed the name in comments.
I've never met a person called Paritosh but Singh must surely up the chances of a match :)
11:03
oh absolutely, The first half of the name drops it considerably, but the second half.. well, you know. :P
*another person, I guess would be more accurate :)
TIL there's a builtin name copyright. I usually avoid naming function parameters like builtins, but I think I'll make an exception for this one...
@ParitoshSingh I get it now, to different users with same name
:)
@roganjosh You can apparently extend it if that's your goal. But it seems like the template is basically bundled with django.
@Aran-Fey thats a copyright vio..oh wait, you shadowed it.
@ParitoshSingh I find it quirky, i was curious whether it has life outside of django
11:06
i'd be surprised if it does to be honest
@roganjosh used or unused?
sounds a bit icky but you do you
Unused socks can smell quite pleasant, but not distinctly of socks
@AndrasDeak my phrasing could have been better perhaps, but I'm not sure I can paint any weirder portrait of myself than I already have over the years :P
@roganjosh does jinja count? they claim it was heavily influences by django's template language
@Arne jinja is used and corrected, IMO, a lot of the weirdness of django
11:19
django template language came before jinja?!
i just realised i dont actually know what came first, flask or django.
That's why I was curious. I don't think I'm being too much of a fanboy to say that it's a much better language
(and my brain keeps wanting to convert that sentence to chicken or egg)
django came before flask, dtl before jinja2
i suppose thats probably "why" flask came out now that i think about it
Yep. So jinja got a leg up, but I do keep running into django questions that slightly baffle me on the templating side
Templating/replying. I dont think my phone really knows me at all. Ill try harder on mastering my mother tongue before I complain about programming languages :)
12:09
A week or two ago I learned that Aloysius is how you write this name... I'm still in shock.
12:20
I can't say I've ever come across that name
Lewis, sure. But names get distorted in all sorts of ways
Question
class blah():
    def __init__(self):
        self.x = self.stuff_x()
        self.stuff_y()

    def stuff_x(self):
        return 42

    def stuff_y(self):
        self.y = 42

obj = blah()
print(obj.x)
print(obj.y)
Is one style preferred over the other? Are both acceptable?
one explicitly assigns in init, other does it inside the function
And neither defines self.y before a method is called. At the least I'd suspect that makes dir() more complicated
if you want subclasses to be able to override the default, the detour via a separate method is useful, and it would seem to make sense to make that method as simple as possible
if you don't have that requirement, both of these are overcomplications
Oh hey tripleee, so, y is preferred in that case? you kinda guessed it, this is an inherited class, and i was using some of the properties of the base class to set some things.
Guess what, found a property i think that will stay robust encoding wise ^^
12:28
actually stuff_x seems simpler to me
just have the method return whatever the default is supposed to be, and let __init__ decide where exactly it should be stored and maybe do other things with it which we don't know or care about
okay perfect. That does look nicer to me too, but i dont know if there's a convention around it, and couldn't seem to find one for python.
(apparently, java really hates even thinking of allowing the first. something about always getting and setting. made my head hurt)
... Java :)
shudders
12:45
too much coffee can do that
13:09
Hi guys, I come with a very basic question about pandas. If you wanna plot 2 histograms from two different dataframes in the same cell (I'm using jupyter as IDE), basically this DF1['feature'].hist(),DF2['variable'].hist(), python plots them in the same grid
Do you know how to get 2 histograms in 2 different grids?
I think I've answered something like that
It may have been in a comment
@AndrasDeak I've explored many pages, but nothing answers this issue precisely (or via matplotlib). I may have missed it. Can you share it again, please?
Store the first return value and use the ax keyword on the second call pandas.pydata.org/pandas-docs/stable/reference/api/…
Might get complicated for many columns, tempting to do with matplotlib directly in that case
@AndrasDeak I dont get what you mean with the ax keyword. How it would be in my simple case DF1['feature'].hist(),DF2['variable'].hist()?
Sorry, I'm on mobile from commute, can't hand-hold now. ax = ... then .hist(ax=ax) on second call
13:23
@AndrasDeak I may be really tired but I still don't get the syntax. Thank you anyway
*groan* why is the abc module so useless
the sentence he wrote can help. store the first return. pass to ax for 2nd call.
val = DF1['feature'].hist()
DF2['variable'].hist(ax = val)
I presume this will do it (disclaimer, i dont actually know this code)
Probably because its missing the other 23 letters... I'll walk myself out now.
rbrb
@ParitoshSingh Ah, this is what you mean by storing (in an object). Actually, it does not work, I get the same outcome as with my previous code. In other words, the two histograms are displayed in the same plot
I want them next to each other
I can't test either, but I gave up on pandas plotting years ago
You can pull the data out and use matplotlib's API
@roganjosh Yeah, I'm gonna do this. Thanks anyway guys
user7437554
13:38
Hi guys!
@rene you going to check your achievements... that green 3033 sitting there unchecked is driving me nuts.
@piRSquared it was to wound me :P
user7437554
I've finally understood that 1) A variable defined inside a function (f) has no use outside f, 2) that global arguments are sometimes modified if we use mutation tools
seriously its making me twitch. I want to reach through chat and click it. I tried clicking the image numerous times to no effect.
user7437554
Is there any simple way to recorgnize when those 'mutations' occur?
13:43
I don't follow
laurel. I don't follow your lack of following. Whom do you not follow?
You've got mutations of an object in the global namespace. There are no alerts for that, at least what I know of.
user7437554
Suppose this example:
@santimirandarp you should familiarize yourself with which methods of objects mutate. The most obvious one is the list objects append. When you are writing code, you should be aware of which methods you are using and on what objects you are using them on. Your familiarity should be all the alert you need. Otherwise, you are just typing random code.
user7437554
13:49
Fine, I was wondering if there is a kind of 'list of methods which mutate particular objects'
I think such a list might be a bit misguided. You need only know about mutability
There are plenty of in-place things you can do too
This is a learning process, @santimirandarp - shortcuts are not a good idea at this stage for you
user7437554
So I should memorise that on a function list.append('a') permanently modifies the list and 2*list does not? (apologizes if I'm wrong)
From what I can make of that question, yeah, you need to memorise that
You will get an intuition for what returns new objects
user7437554
I see. Thanks guys...
14:00
I need help
https://stackoverflow.com/questions/55758802/reaction-embed-and-edit-message-on-discord
@santimirandarp rule of thumb:
x = SomeObject()
x.do_stuff()  # maybe mutating
y = x.do_other_stuff()  # probably not mutating
@santimirandarp I'm stressing a little that I've come across as rude. It was not intended. You really will get that intuition over time, but it also takes time
@Arne Unless written by a green bean. And if that is the case, you can expect an associated SO question.
@piRSquared queue .pop() raising its ugly head :p
14:18
@Mez13 then create two subplots in advance with plt.subplots(ncols=2) and pass each to a call to .hist. But really, doing it manually might be best, because then you have full freedom of handling and formatting the data.
user7437554
no worries @roganjosh ! so far all of you have been helpful. And i'm trying to show my effort at least :)
I wanna award Kevin a bounty for his a == b or c answer, but I don't wanna risk it getting closed again because of the exposure :(
Well bounty is about exposure...you can insta-award it (maybe with some small delay) but he's got plenty of rep :P
Kevin may have plenty, but I have too much :D
Why? More delvotes
14:26
there's a 2-day period before you can award the bounty IIRC
Huh. I wasn't aware I could get more delvotes (not that I need them). When does that happen, at 25k?
it happens with each 1k rep above 10k until 35k or so
starting at 10k? In that case I'm in no danger of running out
I thought I remembered that figure from Madara's bounty call to arms but I don't see it
must I look at the help center
not for my sake, you don't
> How many times can I vote to delete per day?

At 10,000 reputation, you can cast 5 delete votes per day. An additional vote is granted per 1000 reputation, to a maximum of 30 delete votes per day.
14:33
I wonder if those that have already been awarded can be taken away? If @Aran-Fey has anything over 15 votes then we know he's carrying more than his current rep would account for and therefore must be carrying an amount that represents a high water mark.
It's ammo we're talking about, not bullets shot.
Every privilege is revokable, that's why suspensions put you to 1 rep.
I don't think I've ever hit 21k to be honest
oh, well then nvm (-:
there's a 21213 figure in your rep graph on your profile but that's unreliable
21227 seems to have been the most I ever had
15:33
cabbage
So TIL that while you can't do assert_called, assert_not_called, assert_called_with in pytest, you can monkey patch and in the monkeypatch function raise an Error if called, or called with unexpected args. Which in some ways is more useful I guess, because you can have very specific error messages to help yourself.
15:48
@piRSquared you're welcome i.sstatic.net/YmVlL.png ;)
Is this question as unclear to you guys as it is to me? And to me it is very unclear.
@rene and I thought we could be friends (-:
@piRSquared clear as mud
@piRSquared It looks like a simple problem couched in some overly-complicated language.
@piRSquared Not a fantastic mathematician but has the OP perhaps picked up "convolve"?
16:04
not a fantastic Englishist but what do you mean by "picked up"?
TIL Englishist (-:
You know, when you're just browsing and then you see a fancy, glittering word, so you just pick it up
5
Let's call that a magpie vocabulary
I approve. Let's convolve that word into history
I know exactly what it means. Anything I want it to.
Ahh better. Images are too big.
16:19
@roganjosh an ideal case to use the word "cabbage" :p
16:37
@JonClements I'm currently convolving an all-you-can-eat in China town. You'll have to deal with the sausage rolls. No cabbage to be convolved, though :/
@roganjosh oh... which china town?
@rene how dare you show your presence in this room my flower friend... it confuses the heck out of me regarding which room I'm actually in! Don't confuse the already confused puppy! :p
Manchester city centre
Im back home now :)
I was wondering if you were in London for a bit before heading back up north :p
the elusive city cat, the Man coon
@AndrasDeak regarding this A I think myself and PM2 have already answered that in various ways previously :p
16:47
I don't see no dupe banner :P
I didn't even consider if that was a dupe since our very own flower didn't consider hammering
Ok, to be fair, the OP is using the np.convolve function to merge 2 lists of data points (multiple values in the conv when summarizing by eid). But the wording of the question is pretty awful, contains extra irrelevant information, plus no actual attempted code is given.
plus they have a dataframe with list-valued items...
very good sign of an XYZABC problem
variable naming question. I got a variable that kind of represents the 'main' object of the program. It contains basically everything in the program like the curses screen, all of the pages, their renderers/controllers, &ct. What do you call such an object?
perhaps a god object ;)
Calling it god is actually really good.
TODO: Refactor God
16:54
Hmmm, I believe there is a different take away.
Also, "Ravioli code is a term specific to object-oriented programming. It describes code that comprises well-structured classes that are easy to understand in isolation, but difficult to understand as a whole.[13]"
I disagree. As a whole, ravioli is yummy.
Sounds like Unix
I was describing ravioli code one day (in contrast to spaghetti code), and in the course of our discussion we determined that inheritance can also foster lasagna code.
Fear the pastafication
wim
wim
Google "thanos" and then click the yellow glove image on the right with the jewels in it.
17:11
oh that's pretty neat
oOo You can click it again.
Hey, If anyone is familiar with SAP NetWeaver. Is it possible to login and access data via Python?
17:29
no clue Robert, but this looks promising : sap.github.io/PyRFC
@wim So does Disney pay for that Easter Egg? Or is that a fanboi at google
if anything it's the other way around, google paying royalties
@JonClements I this room in my own browser ;)
wim
wim
17:55
Yeah, folks are cowards when it comes to editing. BE BOLD! — Shog9 ♦ May 10 '14 at 2:23
was already that bad in 2014!
@toonarmycaptain pytest-mock plugin puts the mock api back into your pytest with a mocker fixture
@wim Thanks, I've seen reference to it :)
wim
wim
there are mixed feelings amongst pytest maintainers about the mock api though
api traps like mock.assert_called_once_with_typo() mean you shouldn't really trust a test unless you've seen it fail
and mock should probably autospec by default, I honestly can't think of a good reason why they don't
@wim So I have a weird thing with testing a while loop:
 while True:
    new_data = take_some_input(var)
    if not new_data:
        do_blank_data = blank_dialogue()
        if do_blank_data:
            break
        continue
    break
return new_data
I've stepped through the test with the debugger, hit the case where do_blank_data is False, but it skips over the continue line and straight back to the top of the loop, so coverage metrics show it as untested. :s
18:11
Oh, don't click the gauntlet a second time. That's a spoiler
@wim Yeah, I think they added some assert_something functions in the last few years that avoided some of that like .assert_called_once
wim
wim
18:28
@toonarmycaptain I think you are a victim of CPython peephole optimizer.
probably if you check with the disassembler you will see a jump directly from the second if line number back to the new_data = line
see here for this evil
18:47
@wim Maybe. If I put a print statement on the line above continue at the same indentation, it doesn't skip over it. But I'm not doing that for the sake of coverage metrics.
@wim 'evil'? Does it not make some code run faster?
wim
wim
Yes, but the optimizer is too aggressive.
Screws with tools like coverage and debuggers, as you've seen.
I would rather have an 100% coverage report and a debugger working on principle of least surprise than some micro-optimization I never asked for in the first place
I have only found two solutions, both lame: You can put # pragma: no cover to make coverage ignore reporting the line. Or try and restructure the code so the peephole doesn't screw things up.
...or just live with a 99% coverage report :(
see bugs.python.org/issue21074 for other awful stuff the peephole caused
19:08
@wim I'll take my 99%
@wim seems to predate Victor Stinner's coredevness
wim
wim
19:30
interesting, an ast optimizer was targeted for 3.7 but I don't recall any such thing happened bugs.python.org/issue11549
20:05
@U9-Forward fyi you don't have to ping me every time you direct a message to me
that's all from you
They're just waving at you. You know, because they're a fan...
i'm flattered but no thanks
pretty nice that i can control Excel with Python
the best part is you can drop the excel entirely ;)
20:31
yes!!!! you can create a hole workbook without creating an real item on a win file and cells are not created only after the xls file is saved as a folder. Thats Nice!
no no no no no, I meant dropping the excel format :D
aha Like Google Docs
well everybody works with excel if i can find a way to automate some stuff it can be a time saver however there are sure tools to use that are better than excel as python modules.
In the beginning i wanted to learn VBA but it couldnt do much out of excel so i passed into the Python world
df.to_excel -> df.to_csv
Does that has to do with pandas?
 
2 hours later…
22:29
>>> def foo(x, y, *, **kwargs):
...     pass
...
  File "<stdin>", line 1
SyntaxError: named arguments must follow bare *
^ why's that a syntax error? lazy devs?
Probably because a bare * with no keyword-only arguments following is more likely to be a mistake than deliberate.
I guess
if that were valid would it have different behaviour than just def foo(x, y, **kwargs):?
nah, not sure what could even be different
I just thought it should be valid because why not
23:22
i ve sent an email using python i am on fire today
23:58
I have a time log in a dataframe. I need to create a new 'log' from this dataframe that follows below rules (pseudo):
Row is added to new_df if:
if old_df['col_X'] > 0.01 and
(latest_fetched_row['col_Y'] from old_df > latest_row['col_Y'] in new_df)

« first day (3114 days earlier)      last day (2058 days later) »