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
Then check the beginning of the URL for any protocol with `[a-zA-Z]+:\/\/`
2019-05-19T10:37:29.125400
Ashley
pythondev_help_Ashley_2019-05-19T10:37:29.125400
1,558,262,249.1254
24,221
pythondev
help
Not sure if you have to escape the slashes though
2019-05-19T10:37:45.125900
Ashley
pythondev_help_Ashley_2019-05-19T10:37:45.125900
1,558,262,265.1259
24,222
pythondev
help
If it doesn't have one, then https should be the default
2019-05-19T10:38:26.126500
Ashley
pythondev_help_Ashley_2019-05-19T10:38:26.126500
1,558,262,306.1265
24,223
pythondev
help
i was thinking something like that but i have to do a negative test really
2019-05-19T10:42:44.127100
Christina
pythondev_help_Christina_2019-05-19T10:42:44.127100
1,558,262,564.1271
24,224
pythondev
help
the only issue is if people write `[this is bad practice []() ](<http://example.org|example.org>)`
2019-05-19T10:44:29.127500
Christina
pythondev_help_Christina_2019-05-19T10:44:29.127500
1,558,262,669.1275
24,225
pythondev
help
<@Ashley> do i have to pass that csrf magic or sessions class will do it for me?
2019-05-19T11:59:46.129500
Karen
pythondev_help_Karen_2019-05-19T11:59:46.129500
1,558,267,186.1295
24,226
pythondev
help
Expected: [['hi', 'bye', 'hi', 'bye'],'hellohello', 'goodbyegoodbye', [9,2,9,2], 8]
2019-05-19T12:00:13.129600
Scot
pythondev_help_Scot_2019-05-19T12:00:13.129600
1,558,267,213.1296
24,227
pythondev
help
<@Christina> is this to do validation on markdown or something? There might be a linter out there for it already that can take care of the other stuff
2019-05-19T12:01:45.131300
Ashley
pythondev_help_Ashley_2019-05-19T12:01:45.131300
1,558,267,305.1313
24,228
pythondev
help
<@Karen> what do you mean my csrf magic?
2019-05-19T12:02:05.131800
Ashley
pythondev_help_Ashley_2019-05-19T12:02:05.131800
1,558,267,325.1318
24,229
pythondev
help
Can you take a look at the link above
2019-05-19T12:07:11.132300
Karen
pythondev_help_Karen_2019-05-19T12:07:11.132300
1,558,267,631.1323
24,230
pythondev
help
<@Scot> If you are given one of those values, like `x = 'hello'`, what expression would you use to double it to `'hellohello'`?
2019-05-19T12:24:10.133400
Sasha
pythondev_help_Sasha_2019-05-19T12:24:10.133400
1,558,268,650.1334
24,231
pythondev
help
will this work?
2019-05-19T12:26:30.133500
Scot
pythondev_help_Scot_2019-05-19T12:26:30.133500
1,558,268,790.1335
24,232
pythondev
help
def double_mult(s): return ''.join([x*2 for x in s])
2019-05-19T12:26:33.133700
Scot
pythondev_help_Scot_2019-05-19T12:26:33.133700
1,558,268,793.1337
24,233
pythondev
help
What happens when you try it?
2019-05-19T12:27:59.133900
Sasha
pythondev_help_Sasha_2019-05-19T12:27:59.133900
1,558,268,879.1339
24,234
pythondev
help
TypeError: TypeError: sequence item 0: expected string, object found on line 3
2019-05-19T12:32:34.134100
Scot
pythondev_help_Scot_2019-05-19T12:32:34.134100
1,558,269,154.1341
24,235
pythondev
help
lst = [["hi", "bye"], "hello", "goodbye", [9, 2], 4] lst_copy = [["hi", "bye"], "hello", "goodbye", [9, 2], 4] lst2 = [''.join([x*2 for x in lst])]
2019-05-19T12:32:53.134300
Scot
pythondev_help_Scot_2019-05-19T12:32:53.134300
1,558,269,173.1343
24,236
pythondev
help
Does anyone know if there is some optimization is being done with `$` in regexes?
2019-05-19T12:42:35.135000
Linnie
pythondev_help_Linnie_2019-05-19T12:42:35.135000
1,558,269,755.135
24,237
pythondev
help
e.g. will it know it should actually match at the end of the string?
2019-05-19T12:42:53.135400
Linnie
pythondev_help_Linnie_2019-05-19T12:42:53.135400
1,558,269,773.1354
24,238
pythondev
help
a small experiment shows that `$` is not optimized :disappointed:
2019-05-19T12:50:17.135900
Linnie
pythondev_help_Linnie_2019-05-19T12:50:17.135900
1,558,270,217.1359
24,239
pythondev
help
optimized how?
2019-05-19T12:52:15.136300
Jettie
pythondev_help_Jettie_2019-05-19T12:52:15.136300
1,558,270,335.1363
24,240
pythondev
help
So, the `''.join()` is a string operation. It won't work on other data types.
2019-05-19T13:10:37.136500
Sasha
pythondev_help_Sasha_2019-05-19T13:10:37.136500
1,558,271,437.1365
24,241
pythondev
help
so how to solve this question?
2019-05-19T13:13:39.136700
Scot
pythondev_help_Scot_2019-05-19T13:13:39.136700
1,558,271,619.1367
24,242
pythondev
help
I'll ask my original question again. If `x = 'hello'`, what expression would give you `'hellohello'`?
2019-05-19T13:15:12.136900
Sasha
pythondev_help_Sasha_2019-05-19T13:15:12.136900
1,558,271,712.1369
24,243
pythondev
help
<@Jettie> like you can have a million 1's and then a 2, and try the regex `2$` and it will be slow
2019-05-19T13:17:03.137500
Linnie
pythondev_help_Linnie_2019-05-19T13:17:03.137500
1,558,271,823.1375
24,244
pythondev
help
I hoped it might somehow cleverly try fixed part of the regex together with an ending to short circuit
2019-05-19T13:17:39.138300
Linnie
pythondev_help_Linnie_2019-05-19T13:17:39.138300
1,558,271,859.1383
24,245
pythondev
help
interesting
2019-05-19T13:17:42.138500
Jettie
pythondev_help_Jettie_2019-05-19T13:17:42.138500
1,558,271,862.1385
24,246
pythondev
help
does `regex` handle it better?
2019-05-19T13:17:49.138800
Jettie
pythondev_help_Jettie_2019-05-19T13:17:49.138800
1,558,271,869.1388
24,247
pythondev
help
nope
2019-05-19T13:18:56.139100
Linnie
pythondev_help_Linnie_2019-05-19T13:18:56.139100
1,558,271,936.1391
24,248
pythondev
help
maybe a differen version on that right?
2019-05-19T13:19:11.139400
Linnie
pythondev_help_Linnie_2019-05-19T13:19:11.139400
1,558,271,951.1394
24,249
pythondev
help
I remember something like setting a protocol on it, i didn't yet
2019-05-19T13:19:24.139700
Linnie
pythondev_help_Linnie_2019-05-19T13:19:24.139700
1,558,271,964.1397
24,250
pythondev
help
no speed difference
2019-05-19T13:20:05.139900
Linnie
pythondev_help_Linnie_2019-05-19T13:20:05.139900
1,558,272,005.1399
24,251
pythondev
help
maybe it's not something trivial to optimize
2019-05-19T13:20:23.140200
Jettie
pythondev_help_Jettie_2019-05-19T13:20:23.140200
1,558,272,023.1402
24,252
pythondev
help
yea I think because it really is a left to right matcher
2019-05-19T13:20:51.140500
Linnie
pythondev_help_Linnie_2019-05-19T13:20:51.140500
1,558,272,051.1405
24,253
pythondev
help
I just somehow thought that something clever might occur
2019-05-19T13:21:02.140900
Linnie
pythondev_help_Linnie_2019-05-19T13:21:02.140900
1,558,272,062.1409
24,254
pythondev
help
btw my new package `textsearch` will come out very soon :smile: updating docs etc
2019-05-19T13:21:54.141200
Linnie
pythondev_help_Linnie_2019-05-19T13:21:54.141200
1,558,272,114.1412
24,255
pythondev
help
:-)
2019-05-19T13:22:48.141600
Jettie
pythondev_help_Jettie_2019-05-19T13:22:48.141600
1,558,272,168.1416
24,256
pythondev
help
afterwards I will update a lot of my packages (and add some new ones) based on it
2019-05-19T13:23:05.142000
Linnie
pythondev_help_Linnie_2019-05-19T13:23:05.142000
1,558,272,185.142
24,257
pythondev
help
I think it will be one of my most used ones haha
2019-05-19T13:24:26.142300
Linnie
pythondev_help_Linnie_2019-05-19T13:24:26.142300
1,558,272,266.1423
24,258
pythondev
help
it will allow me to post the most convenient/tweakable and fastest tokenizer available in python :smile:
2019-05-19T13:25:09.143000
Linnie
pythondev_help_Linnie_2019-05-19T13:25:09.143000
1,558,272,309.143
24,259
pythondev
help
It's for a university project with a micro-service inspired architecture, where each university group has a running service which can return a set of different things. one of them is markdown. It returns the markdown upon request from the server handling the UI. however the URL to the given microservice is not know at compile time, as everything is rather loosely coupled. BUT some groups didn't like having to use image hosting or CDNs. so they supply relative links, the microservice, which the browser does not know. so somewhere along the way (in angular) this domain has to be added.
2019-05-19T13:56:45.143100
Christina
pythondev_help_Christina_2019-05-19T13:56:45.143100
1,558,274,205.1431
24,260
pythondev
help
x+x
2019-05-19T13:56:54.143300
Scot
pythondev_help_Scot_2019-05-19T13:56:54.143300
1,558,274,214.1433
24,261
pythondev
help
Great. That also works for `4` -&gt; `8`. Does it also work for a list like `x = ["hi", "bye"]`?
2019-05-19T13:58:11.143500
Sasha
pythondev_help_Sasha_2019-05-19T13:58:11.143500
1,558,274,291.1435
24,262
pythondev
help
yes thanks i solved it
2019-05-19T14:03:47.143700
Scot
pythondev_help_Scot_2019-05-19T14:03:47.143700
1,558,274,627.1437
24,263
pythondev
help
:+1:
2019-05-19T14:04:18.143900
Sasha
pythondev_help_Sasha_2019-05-19T14:04:18.143900
1,558,274,658.1439
24,264
pythondev
help
None
2019-05-19T14:05:26.144100
Scot
pythondev_help_Scot_2019-05-19T14:05:26.144100
1,558,274,726.1441
24,265
pythondev
help
Does anyone know, within an executable created by PyInstaller, how would I spawn another Python process? `sys.executable` is my own packaged executable, so i can't use that.
2019-05-19T16:07:34.145400
Damien
pythondev_help_Damien_2019-05-19T16:07:34.145400
1,558,282,054.1454
24,266
pythondev
help
Doesn't `multiprocessing` work? Or `subprocess`?
2019-05-19T16:23:48.146200
Nigel
pythondev_help_Nigel_2019-05-19T16:23:48.146200
1,558,283,028.1462
24,267
pythondev
help
I specifically need to trigger a python process, because i am trying to run another python script. Specifically via `python -m`
2019-05-19T16:27:16.146800
Damien
pythondev_help_Damien_2019-05-19T16:27:16.146800
1,558,283,236.1468
24,268
pythondev
help
subprocess only works if i have a path to a python executable, but i don't. multiprocess only works for passing code of my own to.
2019-05-19T16:27:36.147300
Damien
pythondev_help_Damien_2019-05-19T16:27:36.147300
1,558,283,256.1473
24,269
pythondev
help
And requiring python to be in the PATH is not an option?
2019-05-19T16:29:25.147800
Nigel
pythondev_help_Nigel_2019-05-19T16:29:25.147800
1,558,283,365.1478
24,270
pythondev
help
(in order to not rely on the sys.executable)
2019-05-19T16:29:47.148300
Nigel
pythondev_help_Nigel_2019-05-19T16:29:47.148300
1,558,283,387.1483
24,271
pythondev
help
Good afternoon, could someone recommend a course to apply my basic knowledge of python and be able to climb a step more, I am between beginner and intermediate. I have done some python courses and I have gained in theory, I would like to continue learning but now I would like to do something more practical, some recommendations ??
2019-05-19T16:33:17.148400
Melia
pythondev_help_Melia_2019-05-19T16:33:17.148400
1,558,283,597.1484
24,272
pythondev
help
<@Melia> You can pick up something from here
2019-05-19T16:35:05.148500
Nigel
pythondev_help_Nigel_2019-05-19T16:35:05.148500
1,558,283,705.1485
24,273
pythondev
help
<@Nigel> if Python was in the PATH, i wouldn't need to use PyInstaller.
2019-05-19T16:43:44.149000
Damien
pythondev_help_Damien_2019-05-19T16:43:44.149000
1,558,284,224.149
24,274
pythondev
help
So the case would be: you want to call Python which is installed somewhere in the system from your frozen executable, right?
2019-05-19T16:50:44.149800
Nigel
pythondev_help_Nigel_2019-05-19T16:50:44.149800
1,558,284,644.1498
24,275
pythondev
help
Oh, btw, I didn't ask. What is your target OS? Is it Windows?
2019-05-19T16:54:10.150500
Nigel
pythondev_help_Nigel_2019-05-19T16:54:10.150500
1,558,284,850.1505
24,276
pythondev
help
No, the whole point is its _not_ on the system. I think I'll need to look for some pyinstaller specific forum for the information i need.
2019-05-19T17:42:00.151400
Damien
pythondev_help_Damien_2019-05-19T17:42:00.151400
1,558,287,720.1514
24,277
pythondev
help
Then it means that you bundle the python together with executable. Which means that you should know where the bundled python is. How else could you expect to run `python -m`?
2019-05-19T17:44:52.152300
Nigel
pythondev_help_Nigel_2019-05-19T17:44:52.152300
1,558,287,892.1523
24,278
pythondev
help
If you don't even know what PyInstaller is you don't have to try to answer a question you don't underestand.
2019-05-19T17:47:32.152800
Damien
pythondev_help_Damien_2019-05-19T17:47:32.152800
1,558,288,052.1528
24,279
pythondev
help
I was using pyinstaller several times in the past. Last time it was back in the beginning of 2016 though
2019-05-19T17:54:55.153400
Nigel
pythondev_help_Nigel_2019-05-19T17:54:55.153400
1,558,288,495.1534
24,280
pythondev
help
I was under the impression pyinstaller basically bundled a python interpreter plus your code for the intended target?
2019-05-19T20:06:23.154900
Bethany
pythondev_help_Bethany_2019-05-19T20:06:23.154900
1,558,296,383.1549
24,281
pythondev
help
only other option I can think of is using cython or similar to compile the python code to the target platform as well
2019-05-19T20:06:59.155300
Bethany
pythondev_help_Bethany_2019-05-19T20:06:59.155300
1,558,296,419.1553
24,282
pythondev
help
Yes that is what it does, the first thing.
2019-05-19T20:21:29.155500
Damien
pythondev_help_Damien_2019-05-19T20:21:29.155500
1,558,297,289.1555
24,283
pythondev
help
anyway i found an alternative method for what i needed to do. I now have an single-file EXE that can pip install stuff lol
2019-05-19T21:03:46.156200
Damien
pythondev_help_Damien_2019-05-19T21:03:46.156200
1,558,299,826.1562
24,284
pythondev
help
i promise that might actually be useful even
2019-05-19T21:03:59.156500
Damien
pythondev_help_Damien_2019-05-19T21:03:59.156500
1,558,299,839.1565
24,285
pythondev
help
I'm following the channels documentation tutorial(<https://channels.readthedocs.io/en/latest/tutorial/part_2.html>), I've made sure that channels can communicate with redis but when I go to my webpage the websocket immediately closes and I get a connection refused error. I'm using django 2.17, channels 2.2, and redis 2.8. Can anyone help me with this?
2019-05-19T22:47:34.159600
Erlene
pythondev_help_Erlene_2019-05-19T22:47:34.159600
1,558,306,054.1596
24,286
pythondev
help
does do you get any errors in the shell/logs were you are running django?
2019-05-19T22:59:05.160200
Kassandra
pythondev_help_Kassandra_2019-05-19T22:59:05.160200
1,558,306,745.1602
24,287
pythondev
help
Exception inside application: [Errno 111] Connect call failed ('127.0.0.1', 6379) followed by a bunch of python files and then a websocket disconnect
2019-05-19T23:02:51.160900
Erlene
pythondev_help_Erlene_2019-05-19T23:02:51.160900
1,558,306,971.1609
24,288
pythondev
help
sounds like django is having isseus talking to reddis (im assuming redis is running on 6379)
2019-05-19T23:03:51.161400
Kassandra
pythondev_help_Kassandra_2019-05-19T23:03:51.161400
1,558,307,031.1614
24,289
pythondev
help
yes
2019-05-19T23:04:08.161600
Erlene
pythondev_help_Erlene_2019-05-19T23:04:08.161600
1,558,307,048.1616
24,290
pythondev
help
I was able to follow the example on that page to make sure channels and redis are talking
2019-05-19T23:04:29.162100
Erlene
pythondev_help_Erlene_2019-05-19T23:04:29.162100
1,558,307,069.1621
24,291
pythondev
help
None
2019-05-19T23:05:29.162500
Erlene
pythondev_help_Erlene_2019-05-19T23:05:29.162500
1,558,307,129.1625
24,292
pythondev
help
are you using the same django settings there as you are when you run django?
2019-05-19T23:05:41.163000
Kassandra
pythondev_help_Kassandra_2019-05-19T23:05:41.163000
1,558,307,141.163
24,293
pythondev
help
what do you mean? I should be
2019-05-19T23:06:24.163400
Erlene
pythondev_help_Erlene_2019-05-19T23:06:24.163400
1,558,307,184.1634
24,294
pythondev
help
probably, i assuming your not running django within docker or something?
2019-05-19T23:07:32.164100
Kassandra
pythondev_help_Kassandra_2019-05-19T23:07:32.164100
1,558,307,252.1641
24,295
pythondev
help
just running something like `python3 manage.py runserver` ?
2019-05-19T23:07:53.164800
Kassandra
pythondev_help_Kassandra_2019-05-19T23:07:53.164800
1,558,307,273.1648
24,296
pythondev
help
I am but it just copies the local configuration I believe
2019-05-19T23:08:02.165000
Erlene
pythondev_help_Erlene_2019-05-19T23:08:02.165000
1,558,307,282.165
24,297
pythondev
help
I can paste my docker-compose.yml and requirements.txt
2019-05-19T23:08:24.165800
Erlene
pythondev_help_Erlene_2019-05-19T23:08:24.165800
1,558,307,304.1658
24,298
pythondev
help
that could be your issue `6379` withing docker != to `6397` on your machines localhost
2019-05-19T23:08:37.166100
Kassandra
pythondev_help_Kassandra_2019-05-19T23:08:37.166100
1,558,307,317.1661
24,299
pythondev
help
yer one way to check this is to exec into your docek container an run the above test within the container
2019-05-19T23:09:25.167200
Kassandra
pythondev_help_Kassandra_2019-05-19T23:09:25.167200
1,558,307,365.1672
24,300
pythondev
help
if that also fails with the same error then it is most likly something to do with compose not being configured properly
2019-05-19T23:09:46.167700
Kassandra
pythondev_help_Kassandra_2019-05-19T23:09:46.167700
1,558,307,386.1677
24,301
pythondev
help
Okay, you're right the error happens when I run async_to_sync(channel_layer.send)('test_channel', {'type': 'hello'})
2019-05-19T23:12:21.168500
Erlene
pythondev_help_Erlene_2019-05-19T23:12:21.168500
1,558,307,541.1685
24,302
pythondev
help
Here is my requirements.txt
2019-05-19T23:19:17.168600
Erlene
pythondev_help_Erlene_2019-05-19T23:19:17.168600
1,558,307,957.1686
24,303
pythondev
help
And here is my docker-compose.yml. Is there anything here that looks out of place or do I need to add anything? The redis and django servers starts up when I run docker compose.
2019-05-19T23:21:20.168900
Erlene
pythondev_help_Erlene_2019-05-19T23:21:20.168900
1,558,308,080.1689
24,304
pythondev
help
on your `web` you need to add a secont that binds it through to the `redis` add a ``` links: - "redis:redis" ``` to the web secion and then in your settings.py instread of `localhost:6397` have `redis:6397`
2019-05-19T23:32:54.170600
Kassandra
pythondev_help_Kassandra_2019-05-19T23:32:54.170600
1,558,308,774.1706
24,305
pythondev
help
what the above does is make the domain name `redis` in your `web` docker container = to your redis docker container
2019-05-19T23:33:30.171700
Kassandra
pythondev_help_Kassandra_2019-05-19T23:33:30.171700
1,558,308,810.1717
24,306
pythondev
help
where do i put the redis:6397 in my settings.py?
2019-05-19T23:39:25.172100
Erlene
pythondev_help_Erlene_2019-05-19T23:39:25.172100
1,558,309,165.1721
24,307
pythondev
help
do I also need to set it to redis in the channel layers portion?
2019-05-19T23:40:02.172500
Erlene
pythondev_help_Erlene_2019-05-19T23:40:02.172500
1,558,309,202.1725
24,308
pythondev
help
yes that is were you need to set it in the layers settings
2019-05-20T00:38:35.173300
Kassandra
pythondev_help_Kassandra_2019-05-20T00:38:35.173300
1,558,312,715.1733
24,309
pythondev
help
(i was assuming that was in your settings.py but of cource it does not need to be)
2019-05-20T00:38:53.173800
Kassandra
pythondev_help_Kassandra_2019-05-20T00:38:53.173800
1,558,312,733.1738
24,310
pythondev
help
I ended up not using docker and it works when just using the django server. Thank you for the help
2019-05-20T00:40:29.174500
Erlene
pythondev_help_Erlene_2019-05-20T00:40:29.174500
1,558,312,829.1745
24,311
pythondev
help
<@Chester> Thank you so much! I’ve never really had anyone look over my work this was great
2019-05-20T04:26:20.176200
Darnell
pythondev_help_Darnell_2019-05-20T04:26:20.176200
1,558,326,380.1762
24,312
pythondev
help
Glad to help :slightly_smiling_face:
2019-05-20T04:29:11.176400
Chester
pythondev_help_Chester_2019-05-20T04:29:11.176400
1,558,326,551.1764
24,313
pythondev
help
Hi all, we at Learning Dollars Talent are trying to help tech entrepreneurs and engineers with answers to questions surrounding freelance engineering platforms and full-time engineer recruiting tools. One of the members of our team has written the following medium reply - <https://medium.com/building-parable/how-to-find-strong-engineers-for-your-startup-idea-9e1275d8f5e8> and we are seeking feedback on the quality of the content. Do you find it helpful? Do you find it biased? Please let us know.
2019-05-20T06:38:25.177500
Dwayne
pythondev_help_Dwayne_2019-05-20T06:38:25.177500
1,558,334,305.1775
24,314
pythondev
help
Does anyone know how to make PyInstaller include _all_ the standard library modules in the build?
2019-05-20T08:03:00.178400
Damien
pythondev_help_Damien_2019-05-20T08:03:00.178400
1,558,339,380.1784
24,315
pythondev
help
<@Damien> going by their docs, you can probably use the `--hidden-import` flag a bunch. But why do you want all the standard library modules?
2019-05-20T08:14:34.180000
Ashley
pythondev_help_Ashley_2019-05-20T08:14:34.180000
1,558,340,074.18
24,316
pythondev
help
I'm building a tool which itself runs user-provided python scripts, so i can't depend on the import introspection
2019-05-20T08:15:33.180600
Damien
pythondev_help_Damien_2019-05-20T08:15:33.180600
1,558,340,133.1806
24,317
pythondev
help
Can you literally just bundle a zip with python + your app, and fallback on default python?
2019-05-20T08:18:43.181900
Bethany
pythondev_help_Bethany_2019-05-20T08:18:43.181900
1,558,340,323.1819
24,318
pythondev
help
not really, the whole intent is to make a single-EXE tool for people to use easily. I'll keep fiddling, there's gotta be more configuration options. I don't know if I'll use PyInstaller for this long-term, but its been a good way to prototype the tool, at least.
2019-05-20T08:25:44.183000
Damien
pythondev_help_Damien_2019-05-20T08:25:44.183000
1,558,340,744.183
24,319
pythondev
help
If you are looking to hire someone you should post this to <#C080T8XT2|job_board> <@Heide>
2019-05-20T09:15:05.188000
Clemmie
pythondev_help_Clemmie_2019-05-20T09:15:05.188000
1,558,343,705.188
24,320