« first day (2650 days earlier)      last day (2305 days later) » 
00:00 - 17:0017:00 - 00:00

5:00 PM
@wim They have now
 
wim
encoding the entire text into the url is an incredibly bad way to implement this feature
@cᴏʟᴅsᴘᴇᴇᴅ uh-oh, a second answer
I will DV each and every answer that appears there :P
 
Only downvote the bad ones. That being said, I'll be surprised if I see a good one.
also, this is not a voting ring
 
wim
ahaha
"the room 6 effect" is like the new meta effect
 
except some people probably don't find it that amusing
Room owners and third parties alike. So I suggest ignoring that post going forward.
 
wim
hmm, nah ... the people that matter know better than to answer a question like that. the people that don't know better, will learn.
 
5:06 PM
That's fine, I just think we should be very careful not to look like a voting mob under any circumstances. You're still free to do whatever on your own accord/account.
 
Those 2 other votes could have been random ;)
As in, from other random users
 
wim
 
you don't need to help, coldspeed
 
@AndrasDeak This is one reason why I don't ask for CV here, scared of the mob mentality :D
 
cv-pls is one of the well-regulated forms of community moderation. It is public, and you are explicitly required to judge the post in its own merit regardless of the cv-pls request itself.
"public" in the sense that if something gets closed, your name is there and you are accountable
 
5:19 PM
the issue isn't with the cv, it's the downvote that might follow (cause and effect)
 
I don't think I've ever seen revenge downvotes for close votes.
 
DSM
I have. Rarely, but I've received a few.
 
in my experience those are almost exclusively due to comments and downvotes
 
I wish that gif would stop moving
 
@DSM perhaps it's just that I tend to step on toes so I have a large signal of revenge downvotes for different reasons :) You don't seem like the kind who antagonizes users in comments
 
5:24 PM
One day when I'm older and wiser, I'll hopefully not seem like that kind of person either
 
DSM
So here's an answer with 31 upvotes, which reads in part:
> The problem is, though, that the first element of each tuple needs to be hashable. Strings are not hashable.
As well as
> Note that the first element of each tuple is now a dictionary, which is hashable.
 
@AndrasDeak other way around. I don't want someone to close vote and then downvote on top of it, and if i ask for a CV then isn't that basically running the risk of basically asking a group to close vote if possible, and running the risk of them downvoting on top of it, thus indirectly asking for downvote ?
or am i thinking into this too much lol
 
Oooh, I see.
 
5:31 PM
@cᴏʟᴅsᴘᴇᴇᴅ bring it up in the Winter 2018 GM :D
 
DSM
I'm not even sure I know what "a recommended Python production environment" means.
 
YAY I've reached my 1000 rep (and a bit more).
@DSM I wonder if they tried www.python.org
 
@davidism This is a genuine question: what advantages does flask offer over django?
 
@cᴏʟᴅsᴘᴇᴇᴅ I've used it.
 
5:35 PM
I've worked with django in the past but never flask, so was hoping to get a dev's perspective on it
@AndrasDeak Okay... And...?
 
Doesn't work on templates like Django (if that's an advantage I'm not sure)
 
Oh you mean, that's the advantage? :D
 
how is that not an advantage D:
 
Django offers a lot of opinions, which makes it nice if you don't know what you're doing. However, those same opinions become restrictive when you want to do anything else. Django also hides a lot of behavior and configuration behind magic detection and never really explains or makes obvious how things are connected.
 
DSM
Don't worry. "Used by Andras Deak, once" is still considered the mark of quality here in Canada.
13
 
5:37 PM
The story I hear from newer users who have tried both is that after using Flask, they understand what's going on in Django.
 
@DSM eh :D
 
When you say "opinions"... what do you mean?
 
User management, configuration, SQL, ORM, generally HTML (although DRF exists). Pretty much everything Django comes with that's all integrated together already.
 
When I was a web dev in University, Flask made me understand what I was doing, you could said it made me understand how to use the tool get a job done; while, Django made me feel like I told the tool to do the job.
 
Breaking out of that is difficult, and Django starts getting in the way of what you want to do.
 
5:39 PM
sounds like a nice set of training wheels, but eventually you'll want to head for the hills B-)
 
I see... I think I get it; they offer you different levels of abstraction with their features, so the degree of freedom you have across the two frameworks varies
It's like using tensorflow versus using keras...
 
Flask has an ecosystem of extensions that can pretty much do whatever Django includes. They may not be integrated quite as well, but you can build whatever you want.
 
David, just to confirm, you don't get paid by Flask do you ?
 
Something that one could argue for Django's case is that it is more mature as a framework
But I'm guessing that's changing
 
@davidism Sorry I don't understand how can HTML be integrated already?
 
5:42 PM
Flask only came out a couple years after Django.
As opposed to making it easy to work with JSON or other request / response types. You can do it in Django, it's just not really built to support it as a first-class use case.
I actually started with Django before Flask came out, then switched to Flask because Django was getting in my way.
 
How did it get in your way may I ask (I would be interested to know the difference as well)?
 
7 mins ago, by davidism
User management, configuration, SQL, ORM, generally HTML (although DRF exists). Pretty much everything Django comes with that's all integrated together already.
 
So you wanted to use something not integrated?
 
If Django vs Flask isn't a Q&A on the main site, I think it should be, because I find people who want to do web dev stuff with these frameworks keep wondering what the differences are and which they should use. As beginners, not everyone would fully understand what they can or cannot do, just by reading each one's documentation
 
They're not going to go wrong picking either one to start with. Both are mature and powerful frameworks, they just take opposite approaches.
 
5:49 PM
Ah, fair enough.
 
The distinctions only really matter once you get to the scale that you know they matter, at which point you probably know enough to switch either direction rather easily.
@MartijnPieters I saw you forked trio, what are you doing with async?
I've been thinking of giving curio or trio a try for building Rabbit.
 
wim
@cᴏʟᴅsᴘᴇᴇᴅ no need to wish, get a browser plugin
^ who is the line with the really steep gradient there?
BalusC maybe?
hmm, no.
Gordon Linoff?
 
6:07 PM
that's an awfully straight line
 
Yeah comments on the meta post suggest Gordon Linoff
 
DSM
Yep, he's #1 in total answers. Our own Martijn comes in at #7, looks like.
 
wim
wow that guy must really game the system / answer dupes all the time
 
cbg - I have a question for you all about PyQt/classes. I have 2 windows in pyqt that are different classes by design. I have the parent open the child then the button on the child calls a function in the parent class to do somethings and close the child window. I have connected it by doing this:

self.pushButton.clicked.connect(parent.test)

Im trying to now pass a var from the child back to the parent.test() function. How is this done? I tried self.pushButton.clicked.connect(parent.test(exampleVar)) but it did not work.
 
clicked.connect(lambda: parent.test(exampleVar))
 
6:40 PM
anyone familiar with xml.etree?
in Android, 2 hours ago, by Code-Apprentice
Who is that gray line that is outpacing JS?
@wim great minds think alike ^
 
@Rawing As always thank you for the help! I saw one example with that in it but have never used it. Ill read up on it to see what it does
 
I remember having a similar conversation recently, but when you do parent.test(exampleVar) you're calling the function and passing its return value to clicked.connect(). That's obviously incorrect, and you want to pass a function object as the parameter instead - for example a lambda, which is an anonymous function.
 
Wow, that typo question has now earned the answerer 48 rep. They have 18k rep and could easily vote to close. :-|
Ugh, I just need to ignore it.
 
@Code-Apprentice you hang out in the android chat room ?
 
6:53 PM
@MooingRawr yes
I am a regular there
 
@Code-Apprentice js is the best
:D
:hides:
 
DSM
It's surprising how off-putting I find it that the function here is called m and not f.
 
that self answer off vault :D
 
@wim Gordon Linoff
See data.stackexchange.com/stackoverflow/query/116016/… for a query that lists answer counts.
@davidism that was just a follow-up to a SO moderator action.
But asyncio is the new hotness at Facebook. Has been for a year at least.
 
huh, Martijn, you have the highest question acceptance rate who has answered more than 10k questions. nice...
 
wim
7:01 PM
@davidism not a typo... understandable error of shadowing name in scope
almost certainly a dupe though
 
@DSM its a method, not a function
 
wim
@MartijnPieters nice query!
 
@Code-Apprentice what's the differences /jk
 
DSM
@Code-Apprentice: if so, wouldn't it have a self? I think the OP is just using the terms loosely.
I thought BalusC ragequit a few years ago? Or did that all settle down?
 
Hey all again, Im looking at: https://stackoverflow.com/questions/11875770/how-to-overcome-datetime-datetime-not-json-serializable
But am a bit confused on which approach I should try off of there. Right now my error is in this line:
ast.literal_eval(json.dumps(i))
I looks like this:
{u'USERNAME': u'ZTARR', u'TEAM_CD': 0, u'admin_ind': 0, u'USER_ID': 1, u'CREATED_DT_TM': datetime.datetime(2018, 1, 17, 13, 52, 38)}
 
7:06 PM
@DSM I often use the terms interchangeably.
 
wim
Martijn is definitely playing the quality game and GL is playing the quantity game
 
@DSM maybe it's intended to be used as a static method
 
DSM
Hmm, could be, I guess.
 
wim
difference between functions and methods is fairly superficial in Python anyway
 
@DSM nope, that wasn’t a ragequit, just a misunderstanding.
 
7:14 PM
Why is foo == None?
 
DSM
I don't know the terminology, but foo is the outermost element, so when you create your "tree" it's at foo level, and there's no Foo inside.
 
Foo is the root node, it's what ElementTree.fromstring returns
 
so find() only searches child elements?
 
is what the doc says
 
7:17 PM
depends on how you define "subelement"
 
<root> <subelement1> <subelement2> </subelement2> </subelement1> </root>
is how i would define it ...
 
for example in mathematics, typical definitions of "subset" include the entire set itself.
 
DSM
In this context I think saying something was a subelement of itself would make iterating over subelements needlessly complicated.
 
If I were iterating over tree, I would expect to visit the root element as well as each child.
 
DSM
If you iterate over tree you do get Foo (or you should, anyway), but not if you iterate over the children.
 
7:21 PM
Also my error message from the line above. Forgot to add that in there: TypeError: datetime.datetime(2018, 1, 17, 13, 52, 38) is not JSON serializable
 
@ZackTarr What's the point of doing ast.literal_eval(json.dumps(i)) anyway?
 
DSM
@ZackTarr: unfortunately there are no Python date literals and JSON doesn't support them either, so neither ast.literal_eval nor json.dumps is going to be much help, I think, and certainly not both of them together. :-)
 
Trying to get the elements back to a str rather than a u'string'
 
What's wrong with unicode strings?
 
DSM
Oops, looks like I'm violating my "don't answer Python 2 questions" policy..
 
7:23 PM
but my real problem is that find() and findall() don't seem to recursively visit the entire tree. They only look at the direct children.
@DSM find() seems to only iterate over the children. It doesn't seem to even iterate over their children.
 
@DSM I made that mistake when someone was print("str",object) and it was coming back like a tuple, It confused me until I realized it was Py2, which prompted me to leave the question.
 
DSM
@Code-Apprentice: yep, I think it only goes one deep.
 
@Rawing good point. I was using normal strings to search for the keys in the dict. Ill try to re write some lines to test it with unicode.
Based on some of the comments here it looks like I need to start coding in python 3? Any big reason why? Just curious on the subject
 
It's better and python 2 is dying
 
Seems to the point. It always seems libraries I want to use are 2.7. But Ill start heading that way. just have to step out of the comfort zone
 
DSM
What libraries are those, if you don't mind my asking?
 
@ZackTarr a lot of the big and useful modules are ported to Python 3... I'm with DSM, what libraries are you suffering for ?
 
@DSM I would have to look through ones Ive looked at in the past. Off the top of the head I honestly couldnt name any.
 
@DSM I guess you have to write your own search function if you want to find a tag anywhere in the tree, no matter how deep
 
Most of the reason for sticking with 2.7 is well I learned it in college and havent tried to fix whats not broken yet
 
7:30 PM
Hi
:)
 
DSM
I'm not saying there aren't any which aren't Python 3 compatible, but fortunately these days it's not nearly as much of a problem as it used to be.
 
user image
8
 
DSM
Heh.
@Code-Apprentice: can't you use xpath?
 
Interesting. Is the syntax pretty different?
 
DSM
xml = '<Foo><Bar/><Bar/><SubFoo><DeepestFoo></DeepestFoo></SubFoo></Foo>' and then tree.find(".//DeepestFoo").
 
7:33 PM
@ZackTarr Nope, it's hardly any different. Many people hate the parentheses after print though.
For a while
 
a small price to pay
 
I think thats the one thing that I keep seeing that makes me scared to switch over.
print "foo" is just so much easier to look at
 
I think input() pays for that.
 
@Code-Apprentice if you use DSM's example you can use ElementTree.Element.iter() to find the deepestFoo... example, it will also find your root (Foo).
 
recbg
 
7:46 PM
@simon input way better in python 3?
 
a = input('Yeah if it compares to raw_input()')
 
cbg AD :D
 
8:44 PM
@DSM oic...// seems to tell find() to do what I expected to begin with.
 
Whenever I have to install packages to python, or update something like anaconda manually (because the software for this is not working) I am so very glad I grew up using DOS. I can't imagine how intimidating commandlines might be otherwise.
 
the new junior and intern at my company are having fun learning *nix shell commands
 
(it's not a built-in)
 
My CS classes started us coding in the terminal and using I believe nano, later I grew up and moved to VIM. But I am glad I had that experience and am good with running the commands. But I cannot even tell you how many people I have found in the IT workspace that have no clue how to use the terminal.
 
@AndrasDeak TIL...now it is installed
 
9:01 PM
brief cbg
 
cbg brief
How are you, Jon?
 
same old, how's yourself?
 
wim
I'm not sure which I like better, alias sl=ls or alias ls=sl
 
@wim I had had alias sl=ls for almost 15 years before I discovered sl.
 
Yeah, install sl and you learn pretty quick to type the right one.
Especially if you're me and have a maximized terminal window.
Also fun is the nyancat command.
 
9:21 PM
lol, I'll use this as screen saver now xD
 
wim
By no stretch of the imagination is it "opinion based" why bool is a subclass of int in Python 3.
 
yesterday, by Andras Deak
no, I think opinionated is the typical reason for these kinds of questions
 
wim
I get it's an annoying bikeshedding style question, but it's answerable as demonstrated by kevin 2.35711e6
guys just vote to close for whatever reason because they don't like a question these days :)
for some reason (probably my dvorak layout) I've never fat-fingered ls
but I mistype import as improt so often that I actually wrote an ipython magic to do the right thing
 
user9092892
hey
 
@JonClements doing well...and quickly distracted from chat by work
@DannM Please read the room rules
 
user9092892
9:34 PM
Oops, sorry.
 
@DannM Have some patience. If someone on the main site can answer, they will.
 
user9092892
Yes, I understand sir.
 
don't "sir" me, I work for a living =p
 
can anyone make sense of that
 
9:38 PM
not like that, no
 
Indent code by four spaces, or use dpaste.com
 
and include an MCVE, or at least what (d)type and shape your objects are
 
wim
@Code-Apprentice very well, peasant!!
 
@Hatshepsut well are those strings or fractions?
 
9:41 PM
@AndrasDeak they're supposed to be strings
 
emphasis on "supposed to be"
produce an MCVE that shows this behaviour
 
are you saying they're fractions?
what is unclear?
 
I'm saying that if you write series into ipython it prints 9/19 for you
I also know that your dtype is object, so the items inside could even be instances of Cookie Monster
 
type(series.iloc[0]) -> str
 
>>> pd.Series(['9/19']).replace('/')
0    9/19
dtype: object
^ MCVE
 
DSM
9:44 PM
Looks reasonable enough to me. You're passing a string "/" to replace, and "/" doesn't exist in your series, so there's nothing to do.
 
you need to read the documentation/docstring of .replace
 
Hi all, quick question about the cmd module in python3: is it meant to complete commands?
So if I create a method called do_foo(), and then on the command line write f<tab> should that complete to foo?
From the docs: "If completion is enabled, completing commands will be done automatically"
 
@AndrasDeak there's a difference between `DataFrame.replace" and "str.replace", no?
 
Series.replace, actually, but yes
I specifically meant help(series.replace) just to be on the safe side;)
 
Also I see "The optional argument completekey is the readline name of a completion key; it defaults to Tab. If completekey is not None and readline is available, command completion is done automatically."
However, I haven't found that this actually works
Can someone else please help to verify my interpretation of the docs and this behaviour?
I think this might be a bug in the module
 
9:51 PM
@AndrasDeak they're all different though
 
I wouldn't be surprised
there's also re.replace, and the .replace that I just defined for my CookieMonster class
 
DSM
@BlackSheep: I googled for an example, tried the first one I found, and it successfully completed to "greet" after I typed "g[tab]".
 
@BlackSheep: Autocompletion seems to work fine for me.
 
oops, no re.replace :D
 
@DSM is our resident expert on pandas :)
 
9:56 PM
@DSM @user2357112 It works for me with python2 but fails with python3
Does it work for both of you with python3?
 
DSM
What is this python2 of which you speak?
10
 
The first rule of python is we don't talk about python2?
 
@BlackSheep: Seems to work fine for me on Python 3 as well.
Maybe your Python 3 build doesn't have readline, or you're running it in an IDE or something that interferes with the autocompletion.
 
This is very weird... I'm trying the basic example @DSM found and it's not working for me (iTerm, Mac OS, Python 3.6.0)
 
DSM
Maybe your Python build doesn't have access to readline?
 
9:59 PM
@BlackSheep: Mac, huh?
 
@user2357112 You think it's some sort of weird mac translation issue
 
@DSM got something interesting going on - don't know if you want to involved re: pandas?
 
Like it's remapping the key code to something else?
 
DSM
@JonClements: depends on how interesting. :-) What's it about?
 
not going to lie, the main reason why I want to learn pandas is so I can get a pandas badge and feel good about having an animal badge :D nevermind Wim pointed out snakes are animals. now I have no reason to learn Pandas
 
10:01 PM
Jon is collecting all the .replace methods in the python ecosystem
 
wim
you already have an animal badge
 
DSM
Heh. It's easy to forget.
 
@DSM I've have to do a lot of stuff recently, and redis is always usefull... if you have an "index", but I also use elastic and postgres for most things
 
Oh right... snakes are animals.
I'm a shame to think otherwise:(
 
wim
can people stop saying "Python 3"
12
there is only "Python" and "The language formerly known as Python"
 
10:03 PM
former python 3 is just python, former python 2 is pythoff
8
 
DSM
"pythoff" sounds like something KMG would come up with at the end of the day ;-)
 
wim
what's kmg
 
Kevin M Granger
 
It's something a Kevin would say, I think AD is a Kevin in disguise....
 
wim
ah
I thought it was a verbose symbol for grams
 
10:04 PM
@DSM it's not great at the moment... but I'm starting with a transparent DF to a redis key store - they'll be over head of stored and everything - but it's working for me.
 
and I'm wondering if I should be shocked ;)
 
recbg
 
DSM
@JonClements: hmm!
 
@BlackSheep: Looks like your Python 3 is using libedit instead of GNU readline for the readline module, and libedit has a different syntax that cmd.py isn't accounting for. It'll probably take a fix in the Python standard library to fix it properly. In the meantime, you can probably set the completion key manually using libedit syntax:
 
@DSM it's almost what dask does, but um....
 
wim
10:06 PM
(kilo-milli-grams? anyone? ehh...I'll get me coat ...)
 
ah!
 
import readline
if 'libedit' in readline.__doc__:
    readline.parse_and_bind('bind ^I rl_complete')
 
it didn't click for me because in Proper Scientific that would just be kmg
 
@user2357112 You get all the points. Perfect fix
Very nice catch
 
wim
what's Proper Scientific
 
10:10 PM
a hipster culture where people don't write KM and KG instead of km and kg
My brain rejects incorrectly capitalized units unless context makes it entirely obvious. Apparently "grams" alone weren't enough :P It only made me think of the MKS unit system.
 
wim
okay maybe KMG is KILA-MEGA-GIGA then
like, a really big prefix
 
@wim much better
I could work with kilamegagauss, but we just call those teslas
(sorry, kila is a lie)
 
@DSM anytway - taken the run-time down from 7hrs to 10mins
 
@BlackSheep I really hope you weren't the one that star that answer o.o
 
10:17 PM
@MooingRawr why not?
 
there's also a little snippet if you want to reward with rep you can do so but generally we try to keep the starboard free of random solutions to random questions.
 
@MooingRawr OK sorry about that
Long time listener first time caller
 
No worries just read the room rules, and things are good :D
 
wim
4-sum is O(n^2 log n) right?
stars are for important things like geek jokes and funny animals, not for actually helping users
 
@wim only if you force 'em
 
wim
10:21 PM
@AndrasDeak <
 
stars are for people to get caught up and or find funny/useful things. random code snippets doesn't fit those :D
 
wim
that's one-fifth of a star, all your joke deserved.
 
I'll take it
 
Gotta collect these star fragments, has Room6 turned into an RPG? one step closer to Room6 becoming an RPG
 
for the record I'm not trying very hard, I'm just very tired
 
DSM
10:23 PM
@JonClements: nice! (Interns dropped by for conversation, so got distracted.)
 
AD, your not trying is still impressive.
 
10:38 PM
I have another basic re problem. I'm attempting to match "10 echo hello world" from the string "10 echo hello world #hello message" using this re: \d+[\w\s]+ but it's matching the extra space so it looks like this: "10 echo hello world "
 
@Simon That's a bit tricky. You can try this: (\d+[a-z\s]+?)\s*(?![a-z\s]) That'll capture the text you want in group 1.
 
@wim Thank you I'll use that it future.
 
ooooor forget I said that and use \d+(?:\s+[a-z]+)+
 
Yeah it works. Hmm I've got a lot more work to do. Thank you. I'll use the regex room next time.
I've not encountered the : yet.
 
10:46 PM
(?: starts a non-capturing group. Same thing as ( except you can't access the captured text later (because it doesn't capture)
 
Right. I'll make a mental note of that when I come across it next. : )
 
11:01 PM
(?: is the same as \( or ( (depending on the language) :P
 
11:25 PM
@wim what about threesome?
@MooingRawr and yet random stars are often solutions to some question somewhere.
 
00:00 - 17:0017:00 - 00:00

« first day (2650 days earlier)      last day (2305 days later) »