workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
wait, what do you mean coming through as a python data structure?
2017-07-19T14:49:25.702547
Suellen
pythondev_help_Suellen_2017-07-19T14:49:25.702547
1,500,475,765.702547
86,303
pythondev
help
it's getting placed in the url like this `['lol', 'dog']` but encoded
2017-07-19T14:49:51.718070
Liliana
pythondev_help_Liliana_2017-07-19T14:49:51.718070
1,500,475,791.71807
86,304
pythondev
help
`/%5B%27lol%27%2C%20%27dog%27%5D?`
2017-07-19T14:50:02.724516
Liliana
pythondev_help_Liliana_2017-07-19T14:50:02.724516
1,500,475,802.724516
86,305
pythondev
help
Works either way :confused:
2017-07-19T14:51:52.790303
Suellen
pythondev_help_Suellen_2017-07-19T14:51:52.790303
1,500,475,912.790303
86,306
pythondev
help
hmmmmmmm
2017-07-19T14:52:42.819432
Liliana
pythondev_help_Liliana_2017-07-19T14:52:42.819432
1,500,475,962.819432
86,307
pythondev
help
`J0HWW-lwQAAAF0HWW-jjgAAAFoAKAA%253D%253D` != `J0HWW-lwQAAAF0HWW-jjgAAAFoAKAA%3D%3D`. % sign in debug token got url encoded to %25
2017-07-19T14:53:06.834212
Minerva
pythondev_help_Minerva_2017-07-19T14:53:06.834212
1,500,475,986.834212
86,308
pythondev
help
?
2017-07-19T14:53:43.855695
Liliana
pythondev_help_Liliana_2017-07-19T14:53:43.855695
1,500,476,023.855695
86,309
pythondev
help
If I'm trying to parse some xml should I be using something like `beautifulsoup`?
2017-07-19T14:57:05.977894
Myong
pythondev_help_Myong_2017-07-19T14:57:05.977894
1,500,476,225.977894
86,310
pythondev
help
I've not used beautifulsoup, but if it is just xml there are other xml libraries
2017-07-19T14:57:51.004541
Meghan
pythondev_help_Meghan_2017-07-19T14:57:51.004541
1,500,476,271.004541
86,311
pythondev
help
why not lxml :slightly_smiling_face:
2017-07-19T14:58:06.013784
Suellen
pythondev_help_Suellen_2017-07-19T14:58:06.013784
1,500,476,286.013784
86,312
pythondev
help
it's got `xml` in its name
2017-07-19T14:58:17.020914
Suellen
pythondev_help_Suellen_2017-07-19T14:58:17.020914
1,500,476,297.020914
86,313
pythondev
help
I believe that is the one I liked.
2017-07-19T14:58:18.021086
Meghan
pythondev_help_Meghan_2017-07-19T14:58:18.021086
1,500,476,298.021086
86,314
pythondev
help
It can parse xml without you having to know anything about the content.
2017-07-19T14:58:31.029007
Meghan
pythondev_help_Meghan_2017-07-19T14:58:31.029007
1,500,476,311.029007
86,315
pythondev
help
and beautifulsoup only has `soup`...
2017-07-19T14:58:37.032560
Suellen
pythondev_help_Suellen_2017-07-19T14:58:37.032560
1,500,476,317.03256
86,316
pythondev
help
ah, and `beautiful`..
2017-07-19T14:58:50.040283
Suellen
pythondev_help_Suellen_2017-07-19T14:58:50.040283
1,500,476,330.040283
86,317
pythondev
help
be sure to use `defusedxml` if you are parsing unknown xml
2017-07-19T14:59:45.072699
Ciera
pythondev_help_Ciera_2017-07-19T14:59:45.072699
1,500,476,385.072699
86,318
pythondev
help
Yeah I saw there was some possibility of malicious xml with certain libraries unable to deal with it
2017-07-19T15:01:20.130773
Myong
pythondev_help_Myong_2017-07-19T15:01:20.130773
1,500,476,480.130773
86,319
pythondev
help
Why does xml seem so much more annoying than json... ugh
2017-07-19T15:01:39.142208
Myong
pythondev_help_Myong_2017-07-19T15:01:39.142208
1,500,476,499.142208
86,320
pythondev
help
because it is ? :smile:
2017-07-19T15:01:51.148639
Ciera
pythondev_help_Ciera_2017-07-19T15:01:51.148639
1,500,476,511.148639
86,321
pythondev
help
oh wow <@Minerva> i see what you are saying. it's not failing at the flask level, it's failing at the instagram fetch level because the token is wrong
2017-07-19T15:02:16.162972
Liliana
pythondev_help_Liliana_2017-07-19T15:02:16.162972
1,500,476,536.162972
86,322
pythondev
help
Yeah, I would much prefer json.
2017-07-19T15:03:21.199486
Meghan
pythondev_help_Meghan_2017-07-19T15:03:21.199486
1,500,476,601.199486
86,323
pythondev
help
Woo `from lxml import etree` can't find reference to etree :smile:
2017-07-19T15:08:19.368014
Myong
pythondev_help_Myong_2017-07-19T15:08:19.368014
1,500,476,899.368014
86,324
pythondev
help
`import lxml.etree as etree`
2017-07-19T15:08:44.381350
Suellen
pythondev_help_Suellen_2017-07-19T15:08:44.381350
1,500,476,924.38135
86,325
pythondev
help
`tree = etree.fromstring(binary_data)`
2017-07-19T15:09:22.401784
Suellen
pythondev_help_Suellen_2017-07-19T15:09:22.401784
1,500,476,962.401784
86,326
pythondev
help
`no module named etree`
2017-07-19T15:09:51.418065
Myong
pythondev_help_Myong_2017-07-19T15:09:51.418065
1,500,476,991.418065
86,327
pythondev
help
:open_mouth:
2017-07-19T15:09:56.420836
Suellen
pythondev_help_Suellen_2017-07-19T15:09:56.420836
1,500,476,996.420836
86,328
pythondev
help
gonna stick with just xml.etree lol
2017-07-19T15:09:57.421617
Myong
pythondev_help_Myong_2017-07-19T15:09:57.421617
1,500,476,997.421617
86,329
pythondev
help
pip installed and everything
2017-07-19T15:10:05.425718
Myong
pythondev_help_Myong_2017-07-19T15:10:05.425718
1,500,477,005.425718
86,330
pythondev
help
odd
2017-07-19T15:10:06.426191
Myong
pythondev_help_Myong_2017-07-19T15:10:06.426191
1,500,477,006.426191
86,331
pythondev
help
enjoy slow parsing :slightly_smiling_face:
2017-07-19T15:10:44.447605
Suellen
pythondev_help_Suellen_2017-07-19T15:10:44.447605
1,500,477,044.447605
86,332
pythondev
help
but yeah, pretty strange
2017-07-19T15:10:53.452381
Suellen
pythondev_help_Suellen_2017-07-19T15:10:53.452381
1,500,477,053.452381
86,333
pythondev
help
Slow and frustrating.
2017-07-19T15:10:57.455052
Meghan
pythondev_help_Meghan_2017-07-19T15:10:57.455052
1,500,477,057.455052
86,334
pythondev
help
lxml should really be in the standard library.
2017-07-19T15:11:10.462313
Meghan
pythondev_help_Meghan_2017-07-19T15:11:10.462313
1,500,477,070.462313
86,335
pythondev
help
well, `xml` already is and they share an interface (I think)
2017-07-19T15:11:54.486695
Suellen
pythondev_help_Suellen_2017-07-19T15:11:54.486695
1,500,477,114.486695
86,336
pythondev
help
all you have to do is ```import requests import lxml from lxml import html def xpathScraper(url,tag): page = requests.get(url) tree = html.fromstring(page.content) web_content = tree.xpath(tag) return web_content```
2017-07-19T15:13:08.526801
Martha
pythondev_help_Martha_2017-07-19T15:13:08.526801
1,500,477,188.526801
86,337
pythondev
help
Yeah I think that the Etree class is shared
2017-07-19T15:13:10.527799
Myong
pythondev_help_Myong_2017-07-19T15:13:10.527799
1,500,477,190.527799
86,338
pythondev
help
Why no `BeautifulSoup`? it supports `lxml` as well
2017-07-19T15:14:01.555439
Pasquale
pythondev_help_Pasquale_2017-07-19T15:14:01.555439
1,500,477,241.555439
86,339
pythondev
help
BeautifulSoup's interface is bizarre
2017-07-19T15:14:34.573312
Suellen
pythondev_help_Suellen_2017-07-19T15:14:34.573312
1,500,477,274.573312
86,340
pythondev
help
like really strange
2017-07-19T15:14:38.575308
Suellen
pythondev_help_Suellen_2017-07-19T15:14:38.575308
1,500,477,278.575308
86,341
pythondev
help
And it's an abstraction over lxml either way
2017-07-19T15:14:54.583727
Suellen
pythondev_help_Suellen_2017-07-19T15:14:54.583727
1,500,477,294.583727
86,342
pythondev
help
im not a fan of bsoup
2017-07-19T15:15:08.592217
Martha
pythondev_help_Martha_2017-07-19T15:15:08.592217
1,500,477,308.592217
86,343
pythondev
help
and everything i have ever tried/wanted to do i was able to solve with lxml in one way or another
2017-07-19T15:15:20.598565
Martha
pythondev_help_Martha_2017-07-19T15:15:20.598565
1,500,477,320.598565
86,344
pythondev
help
I just installed lxml and I noticed I get an import error as well. ``` Traceback (most recent call last): File "&lt;input&gt;", line 1, in &lt;module&gt; File "C:\Users\AB14925\Desktop\Viewfinity\PyCharm Community Edition 2017.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ImportError: DLL load failed: The specified procedure could not be found. ```
2017-07-19T15:16:28.635967
Meghan
pythondev_help_Meghan_2017-07-19T15:16:28.635967
1,500,477,388.635967
86,345
pythondev
help
lxml has cssselect, which is a godsend
2017-07-19T15:16:28.636084
Suellen
pythondev_help_Suellen_2017-07-19T15:16:28.636084
1,500,477,388.636084
86,346
pythondev
help
I'm not concerned about that, to be clear, I'm not using it in this environment, just wanted to see if <@Myong> was doing something wrong.
2017-07-19T15:17:35.672775
Meghan
pythondev_help_Meghan_2017-07-19T15:17:35.672775
1,500,477,455.672775
86,347
pythondev
help
I can try and deleting it real quick
2017-07-19T15:18:09.691100
Myong
pythondev_help_Myong_2017-07-19T15:18:09.691100
1,500,477,489.6911
86,348
pythondev
help
then reinstall
2017-07-19T15:18:11.692218
Myong
pythondev_help_Myong_2017-07-19T15:18:11.692218
1,500,477,491.692218
86,349
pythondev
help
one sec
2017-07-19T15:18:12.692749
Myong
pythondev_help_Myong_2017-07-19T15:18:12.692749
1,500,477,492.692749
86,350
pythondev
help
MS Windows For MS Windows, recent lxml releases feature community donated binary distributions, although you might still want to take a look at the related FAQ entry. If you fail to build lxml on your MS Windows system from the signed and tested sources that we release, consider using the binary builds from PyPI or the unofficial Windows binaries that Christoph Gohlke generously provides. <http://lxml.de/installation.html>
2017-07-19T15:19:07.722732
Meghan
pythondev_help_Meghan_2017-07-19T15:19:07.722732
1,500,477,547.722732
86,351
pythondev
help
im using the pypi ones though
2017-07-19T15:19:47.744629
Myong
pythondev_help_Myong_2017-07-19T15:19:47.744629
1,500,477,587.744629
86,352
pythondev
help
Yeah, I just tried updating setuptools and pip and it didn't work for me. May want to try those other binaries if you need it.
2017-07-19T15:31:04.108918
Meghan
pythondev_help_Meghan_2017-07-19T15:31:04.108918
1,500,478,264.108918
86,353
pythondev
help
#JustWindowsThings
2017-07-19T15:36:20.276127
Suellen
pythondev_help_Suellen_2017-07-19T15:36:20.276127
1,500,478,580.276127
86,354
pythondev
help
How is a date supposed to be formatted through a GET?
2017-07-19T15:42:22.467573
Myong
pythondev_help_Myong_2017-07-19T15:42:22.467573
1,500,478,942.467573
86,355
pythondev
help
should it be a date object?
2017-07-19T15:42:26.469502
Myong
pythondev_help_Myong_2017-07-19T15:42:26.469502
1,500,478,946.469502
86,356
pythondev
help
such as using `datetime.datetime`
2017-07-19T15:42:35.474332
Myong
pythondev_help_Myong_2017-07-19T15:42:35.474332
1,500,478,955.474332
86,357
pythondev
help
That's what I suspected when I saw the token in the url didn't match the token in the INFO log. I hope it turns out to be an easy fix for you!
2017-07-19T15:54:49.870200
Minerva
pythondev_help_Minerva_2017-07-19T15:54:49.870200
1,500,479,689.8702
86,358
pythondev
help
holy... there's legitimately no easy way to just grab every element with a tag inside an xml
2017-07-19T15:58:32.996121
Myong
pythondev_help_Myong_2017-07-19T15:58:32.996121
1,500,479,912.996121
86,359
pythondev
help
xpath?
2017-07-19T16:02:46.145935
Suellen
pythondev_help_Suellen_2017-07-19T16:02:46.145935
1,500,480,166.145935
86,360
pythondev
help
I figured it out had to use `.//{tag}` to grab all subelements of the root
2017-07-19T16:32:39.117079
Myong
pythondev_help_Myong_2017-07-19T16:32:39.117079
1,500,481,959.117079
86,361
pythondev
help
I've got this whole thing figured out now I think. A bit of a larger project than I imagined because I have to make like 4 different requests to get all the information/keys I need to be completely automated so I'm trying to skeleton out a small class to do everything in the end.
2017-07-19T16:33:36.147989
Myong
pythondev_help_Myong_2017-07-19T16:33:36.147989
1,500,482,016.147989
86,362
pythondev
help
Hello, a design question for a slackbot. I’m using slack’s RTM APIs to establish a websocket connection with slack. Code is deployed on a single instance/machine and everything is working well. Now, I want one more production instance to ensure availability in case one is down. How can I replicate the deployment on two machines?
2017-07-19T23:58:31.551238
Katheryn
pythondev_help_Katheryn_2017-07-19T23:58:31.551238
1,500,508,711.551238
86,363
pythondev
help
You really can't with a slackbot <@Katheryn> - otherwise what would happen is you'd have two bots listening and responding to all events. You may need a fail-over instead where another machine starts up and starts the bot if the main machine fails (of course you would likely have a period of downtime during that failover)
2017-07-20T00:00:19.571001
Beula
pythondev_help_Beula_2017-07-20T00:00:19.571001
1,500,508,819.571001
86,364
pythondev
help
&gt; you’d have two bots listening and responding to all events. Yeah, that was the problem even I had in mind. Should I explore on message queues?
2017-07-20T00:01:12.580523
Katheryn
pythondev_help_Katheryn_2017-07-20T00:01:12.580523
1,500,508,872.580523
86,365
pythondev
help
I guess you could, I haven't checked for any that de-duplicate repeat messages though
2017-07-20T00:03:10.602122
Beula
pythondev_help_Beula_2017-07-20T00:03:10.602122
1,500,508,990.602122
86,366
pythondev
help
I have never worked with message queues before. Can we have a configuration where event is consumed only by _one_ consumer at a time? Or, is it replicated to all of them?
2017-07-20T00:07:17.644338
Katheryn
pythondev_help_Katheryn_2017-07-20T00:07:17.644338
1,500,509,237.644338
86,367
pythondev
help
But all this sounds too complicated, I think. We only have about 800 users using out bot
2017-07-20T00:07:44.649322
Katheryn
pythondev_help_Katheryn_2017-07-20T00:07:44.649322
1,500,509,264.649322
86,368
pythondev
help
I am not aware of a way to only have one consumer listening at a time, but you could use a distributed lock for who is the "active" listener - but those are somewhat complicated.
2017-07-20T00:09:27.666992
Beula
pythondev_help_Beula_2017-07-20T00:09:27.666992
1,500,509,367.666992
86,369
pythondev
help
consul has a mechanism to do this
2017-07-20T00:09:33.667978
Beula
pythondev_help_Beula_2017-07-20T00:09:33.667978
1,500,509,373.667978
86,370
pythondev
help
i'd just keep all the state in a database
2017-07-20T00:11:45.689274
Marcie
pythondev_help_Marcie_2017-07-20T00:11:45.689274
1,500,509,505.689274
86,371
pythondev
help
messaging queues and consul in this would make things overly complicated in what's basically a feed consumption mechanism
2017-07-20T00:12:34.697335
Marcie
pythondev_help_Marcie_2017-07-20T00:12:34.697335
1,500,509,554.697335
86,372
pythondev
help
&gt; `i'd just keep all the state in a database` Could you please elaborate more on this?
2017-07-20T00:13:19.704726
Katheryn
pythondev_help_Katheryn_2017-07-20T00:13:19.704726
1,500,509,599.704726
86,373
pythondev
help
<@Katheryn> you have two services: service a: talks to Slack RTM, receives messages and puts them in incoming database, reads outgoing database, sends event to slack service b: consumes messages from incoming database, does logic to generate response, puts outgoing message onto database
2017-07-20T00:21:03.780890
Marcie
pythondev_help_Marcie_2017-07-20T00:21:03.780890
1,500,510,063.78089
86,374
pythondev
help
That doesn't really solve the issue of service a going down though, which is the desire, from my understanding
2017-07-20T00:22:51.798452
Beula
pythondev_help_Beula_2017-07-20T00:22:51.798452
1,500,510,171.798452
86,375
pythondev
help
e.g. HA consumer
2017-07-20T00:22:54.798887
Beula
pythondev_help_Beula_2017-07-20T00:22:54.798887
1,500,510,174.798887
86,376
pythondev
help
service b can run as many instances as you'd like
2017-07-20T00:23:23.803873
Marcie
pythondev_help_Marcie_2017-07-20T00:23:23.803873
1,500,510,203.803873
86,377
pythondev
help
and you could run multiple service a as well if you wanted
2017-07-20T00:24:21.813358
Marcie
pythondev_help_Marcie_2017-07-20T00:24:21.813358
1,500,510,261.813358
86,378
pythondev
help
you'd just have a constraint on message ID uniqueness in the DB
2017-07-20T00:24:40.816405
Marcie
pythondev_help_Marcie_2017-07-20T00:24:40.816405
1,500,510,280.816405
86,379
pythondev
help
so, basically, we are using database as an alternative to a message queue here?
2017-07-20T00:25:23.823681
Katheryn
pythondev_help_Katheryn_2017-07-20T00:25:23.823681
1,500,510,323.823681
86,380
pythondev
help
<@Katheryn> the difference with a DB is the unique constraint if you get message IDs
2017-07-20T00:26:02.830032
Beula
pythondev_help_Beula_2017-07-20T00:26:02.830032
1,500,510,362.830032
86,381
pythondev
help
so you could have any number of consumers from the RTM api
2017-07-20T00:26:11.831598
Beula
pythondev_help_Beula_2017-07-20T00:26:11.831598
1,500,510,371.831598
86,382
pythondev
help
alternative isn't quite the right phrase i think
2017-07-20T00:26:19.833157
Marcie
pythondev_help_Marcie_2017-07-20T00:26:19.833157
1,500,510,379.833157
86,383
pythondev
help
I see
2017-07-20T00:26:25.834128
Katheryn
pythondev_help_Katheryn_2017-07-20T00:26:25.834128
1,500,510,385.834128
86,384
pythondev
help
But depending on your load, you may get some DB locking issues. With 800 users, you are probably OK
2017-07-20T00:26:52.838580
Beula
pythondev_help_Beula_2017-07-20T00:26:52.838580
1,500,510,412.83858
86,385
pythondev
help
even our chat at its busiest wouldn't cause any trouble (that I can think of)
2017-07-20T00:27:13.841953
Beula
pythondev_help_Beula_2017-07-20T00:27:13.841953
1,500,510,433.841953
86,386
pythondev
help
message queues are really good for service discovery but not as good for reliable storage
2017-07-20T00:27:20.843290
Marcie
pythondev_help_Marcie_2017-07-20T00:27:20.843290
1,500,510,440.84329
86,387
pythondev
help
If you wanted the distributed systems approach for load: 1. N consumers -&gt; Rabbitmq Excahnge 2. RabbitMQ Exchange to any bound queues * One queue subscribed for saving to a DB * Another for processing You can do different routing mechanisms so the same work goes to the same worker, but instead just allow dupes and test for dupes on the consumer side
2017-07-20T00:28:52.857968
Beula
pythondev_help_Beula_2017-07-20T00:28:52.857968
1,500,510,532.857968
86,388
pythondev
help
But that's way overly complicated for the current need, it sounds
2017-07-20T00:29:07.860362
Beula
pythondev_help_Beula_2017-07-20T00:29:07.860362
1,500,510,547.860362
86,389
pythondev
help
Yes, I would agree. I am more inclined towards <@Marcie> suggestion. One more question, I am using `crontab` as a kind of “automated restart” setup for my bot’s running service and other scheduled events. Few days ago, there was a problem with `crontab`. Not sure about the cause. Any suggestions on improving this setup? Alternatives to `crontab`?
2017-07-20T00:32:33.894629
Katheryn
pythondev_help_Katheryn_2017-07-20T00:32:33.894629
1,500,510,753.894629
86,390
pythondev
help
Can we have notifications setup to know if `cron` didn’t run?
2017-07-20T00:33:31.904996
Katheryn
pythondev_help_Katheryn_2017-07-20T00:33:31.904996
1,500,510,811.904996
86,391
pythondev
help
Are you polling for it to be up or something?
2017-07-20T00:33:53.908366
Beula
pythondev_help_Beula_2017-07-20T00:33:53.908366
1,500,510,833.908366
86,392
pythondev
help
A `systemd` service would be better, IMO
2017-07-20T00:34:01.909778
Beula
pythondev_help_Beula_2017-07-20T00:34:01.909778
1,500,510,841.909778
86,393
pythondev
help
Well, I’m using `cron` to poll and monitor for my bot’s running process. So, to poll cron, we need another monitor?
2017-07-20T00:35:33.924905
Katheryn
pythondev_help_Katheryn_2017-07-20T00:35:33.924905
1,500,510,933.924905
86,394
pythondev
help
No, systemd would replace that need
2017-07-20T00:35:47.927229
Beula
pythondev_help_Beula_2017-07-20T00:35:47.927229
1,500,510,947.927229
86,395
pythondev
help
RabbitMQ with HA queues and publisher confirms is a pretty good reliable storage for temporary data
2017-07-20T00:36:03.929826
Collette
pythondev_help_Collette_2017-07-20T00:36:03.929826
1,500,510,963.929826
86,396
pythondev
help
basically the OS has a construct to ensure a process is always running at a certain "runlevel"
2017-07-20T00:36:04.930032
Beula
pythondev_help_Beula_2017-07-20T00:36:04.930032
1,500,510,964.930032
86,397
pythondev
help
Look into `systemctl` or `systemd` <@Katheryn>
2017-07-20T00:36:22.932813
Beula
pythondev_help_Beula_2017-07-20T00:36:22.932813
1,500,510,982.932813
86,398
pythondev
help
they should be synonymous
2017-07-20T00:36:28.933784
Beula
pythondev_help_Beula_2017-07-20T00:36:28.933784
1,500,510,988.933784
86,399
pythondev
help
Thank you <@Beula> , you are a great help. Will read on those <@Beula> :taco: <@Marcie> :taco:
2017-07-20T00:37:09.940185
Katheryn
pythondev_help_Katheryn_2017-07-20T00:37:09.940185
1,500,511,029.940185
86,400
pythondev
help
:toot:
2017-07-20T00:37:19.941859
Marcie
pythondev_help_Marcie_2017-07-20T00:37:19.941859
1,500,511,039.941859
86,401
pythondev
help
<@Katheryn> :thumbsup::skin-tone-4: here is an example from the <#C2FMLUBEU|community_projects> bot (<@Alesia> ) <https://github.com/pyslackers/ansible/blob/master/roles/system_service/templates/etc/systemd/system/service.j2>
2017-07-20T00:40:18.970227
Beula
pythondev_help_Beula_2017-07-20T00:40:18.970227
1,500,511,218.970227
86,402