« first day (3263 days earlier)      last day (1668 days later) » 

1:31 AM
Hi @Michael
 
user10984358
1:51 AM
heya guys, hope y'all having a nice weekend
 
user10984358
I recently uninstalled my anaconda and had it setup again, but I get this (base) before my username, I know its a virtual environment but I didn't have this issue before
 
user10984358
I do source deactivate and I am asked to do conda deactivate as the former is deprecated, but the next time I open terminal the base is back there
 
5:08 AM
base is the "Default" environment, all that is perfectly fine
earlier, you may not have explicitly seen it, that is all. But it always uses an environment to manage packages, base being default. If you wish to do your work "without an environment" so to speak, then you're already there.
 
 
2 hours later…
7:12 AM
Can some one tell me which library is best for integrating dynamic charts in django. Chartjs highchart etc which one should i choose.
 
7:23 AM
just pick one and try it out
 
yeah i am trying chat.js
chart.js
 
cool cool
 
7:52 AM
@MuhammedBilal the backend has little to do with your choice (i.e. the fact that you're using Django). d3 is a big graphing library
 
8:05 AM
Today is an interesting day. It falls to me to take a German engineer that's installing one of our machines out to see Manchester. Poor guy has been flown over and is just sitting in a hotel in the middle of nowhere. Problem is, he speaks very little English. It's pouring with rain. I know the guy likes pubs but I don't know what kind. Any suggestions for types of pub I can suggest (i.e. old man pubs through to horribly trendy bars) in German?
 
8:48 AM
@roganjosh what do you mean by D3?
 
I mean exactly what I hyperlinked to for you
 
sorry did not see that tiny link
@roganjosh thanks
 
No worries, in hindsight, 2 characters is a bit tiny for a link. Sorry.
 
9:43 AM
cbg
 
9:57 AM
@roganjosh pubs that have the kind of atmosphere where people can huddle together in small groups and watch tv
 
@LucasTaddeus assignments don't evaluate to anything in python.
 
old man pubs or close to that. I think that should be a good fit. don't go for something too modern. chilled strong beer and most folks would enjoy themselves
 
@roganjosh I bet a lot of young Germans also like trendy bars...don't have too much prejudice. Ask the guy.
@LucasTaddeus I'd separate that into more lines. And lambda m: foo(m) is the same as foo.
dispatch = {'a': add_update, 'r': remove, 'g': generate}  # shortened example
action = dispatch[m.group(1)]  # TODO: add exception handling
return action(m)
 
Sorry, I didn't mean any prejudice. I have met the guy, he was out with us on Friday so I know that his English isn't great. I know he wants to go Old Trafford, so that's sorted and actually the weather is picking up so we might actually be able to walk around a bit thankfully
The weather is key, it's gonna make things a whole lot more enjoyable for him if it holds. Fingers crossed!
 
10:24 AM
Have fun :)
 
Hi Guys
is anyone online?
 
@Andrew please stop that. Ask your question without pings and wait for an answer.
 
sorry about that, yes: my question is I have a xml file, and couple of tags inside: <t1>test one</t1><t1>test two</t1><t1>test three.</t1> I need to get all the tags that does not have a full stop into one tag, <t1> test one test two test three </t1>
I am using lxml for this
 
What have you got so far?
 
yes so I iterated through the tags: for elem in root.xpath(//t1): elem.text
which I can see each text from the tag
 
10:33 AM
please also see sopython.com/wiki/… for future reference
 
I was thinking to use regex to store in a list then assign to each other
 
@Andrew I don't see a reason for regex. Take your loop, append to a list for the given tag, check elem.text.strip().endswith('.') to see if you need to start a new list.
 
let me try
 
And you'll want to ' '.join the contents of each sublist later
 
to understand will be: elem.text = ' '.join(elem.text.strip().endswith('.'))
 
10:38 AM
I did not say that (at all)
And for each block of unified elements you'll only end up with one element in the output.
 
yes, I am so confused about that
 
depending on your use case and the mutability of XML elements you'll either have to mutate your first t1 element in each block and delete the rest, or create a whole new copy of your document and only insert one new t1 element per block
@Andrew we ask in our rules that you don't ask for help here with your fresh questions on main
 
I think would probably mutate first t1 element in each block and delete the rest
stackoverflow.com/questions/58044961/… that is my question asking for people to help me
 
Yes, that's exactly what I was linking to in my message. Are you having difficulties understanding my previous message?
 
yes a bit, trying to figure out how to actually do it.
 
10:50 AM
@Andrew OK. So to make it perhaps clearer: please wait 38 more hours before continuing asking for help here
 
 
1 hour later…
11:50 AM
The reddit OP whose question I answered followed up with no less than five new questions. I regret everything.
 
tell them that the answer is 42
 
They'll probably ask "is 42 an instance of object?" and "how can I turn 42 into a metaclass?"
I'm tempted to answer all their "how can I..." questions with "Use your brain", because at this point they're getting pretty ridiculous
anyway, end of lunch break rbrb
 
user10984358
@ParitoshSingh thanks
 
1:20 PM
anyone knows how to use WTForms to create time filed ?
here is what i did
Html :
{{ form.start() }}
python:
from wtforms import StringField, PasswordField, BooleanField,SelectField , TimeField ,DateField
 class firstForm(FlaskForm):
       start = TimeField('start')
all i get is what seems to be a text box
i figured it out , its actually
from wtforms_components import TimeField
not from wtforms
 
 
2 hours later…
3:03 PM
can anyone explain to me why 2.2-1 in python3 is 1.20000000000000002
i expect something like 1.199999999999999999999999
what I think is, python3 first converts 2.2 and 1 to binary, then do maths and prints the decimal equivalent.
 
python has no reason to convert 2.2 or 1 to "binary"
 
then what?
 
close enough. it's not "python3" converting it to binary though, all computers work in binary
 
the hardware has support for floats and ints, python doesn't need to do anything to them
 
this isn't a python specific issue.
 
3:06 PM
@ParitoshSingh Okay
 
why do you expect to get 1.199999 as the result?
 
because binary equivalent of 1.2 is 1.0011001100110011......
 
floats don't work that way though
 
and computer cannot process infinite digits, hence it'll process finite digit. so that value will be less than the original number
 
what you have there is a fixed point representation, not a floating point one
 
3:10 PM
@Aran-Fey where?
 
1.0011001100110011
 
so what is actually happening?
 
we're deep in "you don't really need to know this" territory, but if you're interested you should read up on how floats work
 
ok i'll read some texts first
 
don't ask me, I can't remember all the details either
 
3:32 PM
@AkashKarnatak go for IEEE double precision
and side note:
>>> 1.199999999999999999999999 == 1.2
True
 
4:00 PM
:47366688 Hi, sorry I had to leave yesterday, and didnt get back till like 2am. I just tried the following change:
with sp.Popen(command, stdout=sp.PIPE, stderr=sp.STDOUT, bufsize=1, universal_newlines=True) as p:
for line in p.stdout:
print("Line = ", line, end='')
I am happy to say it works now.. I am able to get all of the outputs from the command prompt :)... Thank you very much @Aran-Fey and @AnttiHaapala
 
huh. Doesn't that block until the subprocess exits?
 
popen? i didnt think it blocked unless you wrote a wait somewhere explicitly
 
@Aran-Fey Not sure, but its working
 
but im not a 100% sure either ways
 
see, this is the outputs on my sublime:
Line = frame= 146 fps= 46 q=-0.0 size= 256kB time=00:00:06.62 bitrate= 316.7kbits/s speed= 2.1x
Line = frame= 162 fps= 43 q=-0.0 size= 256kB time=00:00:07.39 bitrate= 283.8kbits/s speed=1.97x
Line = frame= 166 fps= 38 q=-0.0 size= 256kB time=00:00:07.39 bitrate= 283.8kbits/s speed=1.68x
Line = frame= 176 fps= 35 q=-0.0 size= 256kB time=00:00:07.90 bitrate= 265.4kbits/s speed=1.58x
[Cancelled]
sorry its my first time using this module :D
 
4:07 PM
my little test script does nothing for 6 seconds and then prints all of the output at once
 
I just want to ask, by setting stderr=sp.STDOUT, does that mean errors will be captured by stdout?
 
it means stdout and stderr will be set to the same file
so... yes, I guess
 
Thanks that makes more sense.
@Aran-Fey I am not sure myself, sorry.. In your oppinion, are you suggesting this method I found is bad?
 
no, I'm just surprised it works for you
 
ohh
 
4:16 PM
...rather, I'm surprised it doesn't work for me
 
haha, honestly I myself have no idea :D
 
@Aran-Fey it doesn't output anything for me, just exits instantly
 
TIL subprocesses/pipes make no sense
that's always good
 
Are you on arch? And which python?
 
['python', '-c', code], just wanted to ask, does -c mean execute the code?
 
4:18 PM
@SShah yes
 
aran-fey@paul-laptop ~> uname -a
Linux paul-laptop 4.19.69-1-MANJARO #1 SMP PREEMPT Thu Aug 29 08:51:46 UTC 2019 x86_64 GNU/Linux
aran-fey@paul-laptop ~> python --version
Python 3.7.4
 
okay
 
take program source from command line
@Aran-Fey thanks. I'm on 3.7.0 on a debian...
 
I am on Windows 10
 
it should be the same thing
 
4:19 PM
brb
 
another thing I don't get is why I had to escape the \r to make it work
...I swear I got an error last time with end='\r' but now the program just exits instantly
 
currently trying to reverse engineer a websocket - I can use a bytearray to get data from binaryType='arraybuffer' right?
you'll have to forgive me because I'm not super familiar with websockets in python
 
I forgive you, partly because neither am I
 
maybe I need something like a DataView?
I have no idea
 
@Aran-Fey I just tried it and yeah it seems a little delayed, do you think it may be because of the buffer size?
no clue :D
 
4:33 PM
I have no idea what's happening anymore, don't ask me anything :D
 
Haha :D
 
@AndrasDeak it all went well :) he got his shirt from old trafford and we went through China Town
 
I was just wondering if stderr is set to STDOUT for me, when there is an actual error that occurs, on the command line side, I wonder if I will have to build some logic to identify if the line is an error or not?
 
yeah but ffmpeg prints non-error messages on stderr all the time anyway, so it doesn't really matter
 
ah okay, thanks alot :), I will try to stop bugging you now :D
cheers cya
 
4:40 PM
ahhhhhhh I hate websockets
 
What are you actually trying to do?
 
reverse engineer something
 
@roganjosh glad to hear that!
 
5:03 PM
Hi?
SO i have a problem ( something that should not be shared publicly ), i tried my best but could pass none except 1 testcase.
I wrote my solution in python.
 
Okay?
 
@Aran-Fey Shoua picture or should i write it down and then send it to you? (Sending a picture would be great as there is less chance of finding it.)
for the problem statement
??
 
Ah, so you can't share it in public but it's ok to share it with a single random stranger. I'm off to eat dinner, so I can't be that random stranger for you
 
It's just better not to share it publicly as other people who a going through the same problem might find it. (Like project eular kinda thing)
it would ruin the fun for them.
 
5:33 PM
Well, no, it's a problem covered by an NDA or it's something you can just post. Nobody is gonna go searching chat to find a problem they weren't even working on
 
But if it's too large by volume put it in a code paste service and link here rather than posting a wall of code or text directly
If by any chance you think you can get in trouble for asking here that's a good sign you should not ask here
 
Consider the following:
import asyncio

async def main():
    # do preparation stuff here
    asyncio.ensure_future(main())
    while True:
        # do more stuff here

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Basically I want to run main() again asynchronously while main() is executing, but the snippet I have does not work (main() never stars running the second time).
Does anyone know why this is?
 
I don't know any async, so this is a naive question: wouldn't that lead to an endless ladder of mains?
 
I know very little async, but I'm pretty sure it's because you never awaited it
it's kinda like instantiating an iterator and then throwing it away without iterating
 
Well you see the thing is I want main() to start running itself again in the background
main() will have an infinite loop at the end
asyncio.ensure_future() is supposed to allow me to do that
 
5:46 PM
Why do you need main to be running twice?
 
Long story short, I'm testing the security of one of my websocket servers and I'm building a list of multiple spammer clients
So it starts at 25 clients, they start spamming messages, while in the background it runs main() again to build more clients
 
why not a single main that creates multiple clients inside...?
main being called in a main always sounds like an anti-pattern in python
 
well but it's supposed to slowly build up more clients
so it starts with 25, then goes to 50, then 75, etc.
 
and why wouldn't that be possible in a different worker function/coroutine that spawns the clients?
 
while True:
    for _ in range(25):
        spawn_client()

    await asyncio.sleep(5)
^ maybe something like that?
 
5:52 PM
hmm
let me re-work some things
 
it's surprisingly hard to get answers on SO when you're dealing with a less-than-immensely-popular technology
I posted a kotlin question earlier today that I thought would be answered within 30 minutes, but... nope
 
I thought android was huge and kotlin was android
 
"kotlin" !== "android"
 
~95% of kotlin questions on SO are also android questions
 
6:03 PM
let me guess: you're in the 5%
 
okay now I'm stumped
asyncio.ensure_future() no longer works
 
yeah, I don't do android dev
I'm just practicing my kotlin for the heck of it, because that's the best statically typed, not horribly slow language I know
 
How about rust? :P
 
that feeling when a highly trusted built-in library stops working :P
 
that's usually a good sign that you're using it wrong
 
6:06 PM
yeahhhh
 
I had a look at rust a while ago and I didn't like it. I forget why, though. IIRC it was the syntax that put me off
learning another language makes me appreciate python's simpleness even more. Just consider the vast number of string operations, for example: take(n), drop(n), takeLast(n), dropLast(n), subSequence, subString, ... all of that is done with just square brackets in python
it feels like I'm not so much learning a new language, but rather just memorizing new function/class names
 
aight I was able to fix my async problems
 
Hmm, any ideas why python would ignore my PYTHONPATH envvar?
aran-fey@paul-laptop ~> echo $PYTHONPATH
/home/aran-fey/Desktop/folder/coding/python
aran-fey@paul-laptop ~> python -c "import sys; print(sys.path)"
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']
Huh, apparently it has something to do with my shell (fish). It works fine in bash:
[aran-fey@paul-laptop ~]$ echo $PYTHONPATH
:/home/aran-fey/Desktop/folder/coding/python
[aran-fey@paul-laptop ~]$ python -c "import sys; print(sys.path)"
['', '/home/aran-fey', '/home/aran-fey/Desktop/folder/coding/python', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']
I swear setting environment variables on linux is a thousand times more difficult than it has any right to be
 
6:31 PM
Obligatory xkcd: xkcd.com/456
In all seriousness, I have no idea
 
it is already too late for me
 
6:48 PM
Does os.environ see it at least?
@connectyourcharger I didn't remember that alt text
 
nope, not present in os.environ
 
and if os.environ doesn't see it you might as well take the machine and beat it with a sledgehammer
 
I mean, it kind of makes sense? Because I set the envvar in my bashrc, I wouldn't have been terribly surprised if it wasn't set in fish. But apparently it is set, so I have no idea what's going on
 
wait
it's set and not set at the same time?
 
6:55 PM
@Aran-Fey ^
 
Well, it works with echo but not with python
 
hi , i am building an app that would use maps all the time , i'm worried about the google maps api limitations , is there is a way to reduce the api requests ? , i heard that it's free to use google map on android but not sure if it will help me in webdev

i also saw some libraries on google maps but iam absolutely confused
 
um
the right click comic on xkcd doesn't work anymore
this is a sad, sad day
 
@Aran-Fey perhaps it's not an envvar, just a regular shell var?
 
7:09 PM
I suppose that's possible, but where did fish even get it from?
 
How is it set in bashrc? export?
 
yeah, export PYTHONPATH=${PYTHONPATH}:${HOME}/Desktop/folder/coding/python
by the way, on a scale from 1 to 10, how weird is it to have a folder named "folder"?
I'm thinking it's probably at least 7+, right?
 
you don't want to know what I name my folders
 
typical programmer naming, I suppose
 
7:17 PM
I have a folder named cd just so I can type cd cd
 
hahaha
 
How to Proceed with Tokenized text content which is given in number?
ff
 
sorry, dataset format is i.stack.imgur.com/28vdU.png
I have one data set of customer review, but the text data is given is tokenized text number. I am unable to proceed thinking about how to proceed?
Any guys can help or guide
 
has there ever been any sort of bot in this room?
 
7:25 PM
only experimental ones for testing purposes
as far as I know, at least. I haven't been a member in this room since its inception
 
wouldn't it be cool to get new questions streamed to the room?
 
If I wanted to see new questions I'd browse the new questions queue
 
hmm
how about bounty questions?
 
I personally don't care for those
 
@Aran-Fey 9+
@connectyourcharger no
 
7:29 PM
ouch, I didn't think it'd be that bad
actually I should consider getting rid of that folder. There's no point to it anymore since gnome no longer displays desktop icons. I can just merge it with my home folder, now
 
especially since on linux they call them directories :P
 
how about tweets from @ThePSF or @gvanrossum
 
@connectyourcharger also there's Feeds for that
@connectyourcharger see ^, and no
 
ah, good point
any reason you're against that type of thing?
 
I think most people here are just here to, y'know, chat.
 
7:33 PM
There have been bots and the response was basically "Oh god, no"
 
@connectyourcharger nothing particular, I just hate noise
 
for the record PSF doesn't tweet often and neither does guido
 
we have a feed ticker in the matlab room, and it's not as good as sliced bread, plus matlab throughput << python throughput
 
PSF usually tweets once per day and guido is like never more than once per day at most
wouldn't be too spammy
 
you're welcome to do so in any other room
 
7:36 PM
correct me if I'm wrong, but couldn't people who're interested in someone's tweets just use twitter?
 
Even on topic and relevant bots such as moderation with Queen were decided against. So you'll have trouble convincing me of useless noisy bots.
 
 
1 hour later…
8:40 PM
too broad or something, needs a tutorial, not helpful for future readers stackoverflow.com/questions/58053147/…
 
9:13 PM
Also, I find it concerning when someone chooses the flag of a political party as their avatar on SO
 
 
1 hour later…
10:15 PM
 
yes, and 2 spaces indent!
Cabbage
 
well that's OP's original
cbg
 
Yes - that doesn't make it more aesthetically pleasing! :D
 
10:32 PM
"Missing control character inserted ... \inaccessible". Oh I love you, TikZ
 
11:09 PM
anyone there?
 
ok when someone became yes. let me know
 
@αԋɱҽԃαмєяιcαη please see our code formatting guide for chat and practice in the sandbox if necessary
 

« first day (3263 days earlier)      last day (1668 days later) »