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
like you can connect to the site through your main ip from the internet?
2017-09-08T11:04:32.000272
Junita
pythondev_help_Junita_2017-09-08T11:04:32.000272
1,504,868,672.000272
92,803
pythondev
help
cant connect
2017-09-08T11:04:45.000345
Sean
pythondev_help_Sean_2017-09-08T11:04:45.000345
1,504,868,685.000345
92,804
pythondev
help
can i verify if i am blocking it somehow?
2017-09-08T11:04:55.000715
Sean
pythondev_help_Sean_2017-09-08T11:04:55.000715
1,504,868,695.000715
92,805
pythondev
help
what do the permissions/ownership of the sock file look like?
2017-09-08T11:04:59.000094
Junita
pythondev_help_Junita_2017-09-08T11:04:59.000094
1,504,868,699.000094
92,806
pythondev
help
i might be using some firewall or similar but i cant seem to remember what setup i have
2017-09-08T11:05:05.000711
Sean
pythondev_help_Sean_2017-09-08T11:05:05.000711
1,504,868,705.000711
92,807
pythondev
help
`srw-rw----`
2017-09-08T11:05:29.000422
Sean
pythondev_help_Sean_2017-09-08T11:05:29.000422
1,504,868,729.000422
92,808
pythondev
help
no if you are getting the gateway error it’s connecting to nginx on your machine, it’s something about nginx routing to the uwsgi socket
2017-09-08T11:05:34.000240
Junita
pythondev_help_Junita_2017-09-08T11:05:34.000240
1,504,868,734.00024
92,809
pythondev
help
who owns it?
2017-09-08T11:05:41.000567
Junita
pythondev_help_Junita_2017-09-08T11:05:41.000567
1,504,868,741.000567
92,810
pythondev
help
my username and www-data
2017-09-08T11:05:47.000611
Sean
pythondev_help_Sean_2017-09-08T11:05:47.000611
1,504,868,747.000611
92,811
pythondev
help
and your username is the one in here: ``` [Unit] Description=uWSGI instance to serve myproject After=network.target [Service] User=sammy Group=www-data WorkingDirectory=/home/sammy/myproject Environment="PATH=/home/sammy/myproject/myprojectenv/bin" ExecStart=/home/sammy/myproject/myprojectenv/bin/uwsgi --ini myproject.ini [Install] WantedBy=multi-user.target ```
2017-09-08T11:06:19.000287
Junita
pythondev_help_Junita_2017-09-08T11:06:19.000287
1,504,868,779.000287
92,812
pythondev
help
like, instead of “sammy” it’s “msorja” or whatever it is
2017-09-08T11:06:29.000497
Junita
pythondev_help_Junita_2017-09-08T11:06:29.000497
1,504,868,789.000497
92,813
pythondev
help
yes
2017-09-08T11:06:43.000442
Sean
pythondev_help_Sean_2017-09-08T11:06:43.000442
1,504,868,803.000442
92,814
pythondev
help
exactly
2017-09-08T11:06:47.000065
Sean
pythondev_help_Sean_2017-09-08T11:06:47.000065
1,504,868,807.000065
92,815
pythondev
help
what happens if in your ini file you change `chmod-socket = 664` and restart it?
2017-09-08T11:11:01.000047
Junita
pythondev_help_Junita_2017-09-08T11:11:01.000047
1,504,869,061.000047
92,816
pythondev
help
which command for restart?
2017-09-08T11:12:07.000728
Sean
pythondev_help_Sean_2017-09-08T11:12:07.000728
1,504,869,127.000728
92,817
pythondev
help
`sudo systemctl restart myproject`
2017-09-08T11:13:00.000447
Junita
pythondev_help_Junita_2017-09-08T11:13:00.000447
1,504,869,180.000447
92,818
pythondev
help
no difference
2017-09-08T11:13:29.000343
Sean
pythondev_help_Sean_2017-09-08T11:13:29.000343
1,504,869,209.000343
92,819
pythondev
help
what are the permissions on that socket file now?
2017-09-08T11:13:43.000032
Junita
pythondev_help_Junita_2017-09-08T11:13:43.000032
1,504,869,223.000032
92,820
pythondev
help
`srw-rw-r--`
2017-09-08T11:16:42.000473
Sean
pythondev_help_Sean_2017-09-08T11:16:42.000473
1,504,869,402.000473
92,821
pythondev
help
hmm, in your service file, maybe try `ExecStart=/home/blizzard/myproject/myprojectenv/bin/uwsgi --ini myapp.ini --uid sammy --gid www-data`
2017-09-08T11:18:16.000526
Junita
pythondev_help_Junita_2017-09-08T11:18:16.000526
1,504,869,496.000526
92,822
pythondev
help
basically add your username to `--uid` and the `--gid www-data` - and you did add your user to the www-data group right?
2017-09-08T11:18:52.000393
Junita
pythondev_help_Junita_2017-09-08T11:18:52.000393
1,504,869,532.000393
92,823
pythondev
help
yea, but when i write `groups` it doesn't print out the `www-data` group ¿
2017-09-08T11:19:36.000288
Sean
pythondev_help_Sean_2017-09-08T11:19:36.000288
1,504,869,576.000288
92,824
pythondev
help
okay, screw all this. lets just make it run on a port. lol
2017-09-08T11:21:03.000092
Junita
pythondev_help_Junita_2017-09-08T11:21:03.000092
1,504,869,663.000092
92,825
pythondev
help
:smile:
2017-09-08T11:21:11.000431
Sean
pythondev_help_Sean_2017-09-08T11:21:11.000431
1,504,869,671.000431
92,826
pythondev
help
i hate uwsgi + nginx + python combo... i spent last time over 3 days (almost straight) getting it to work
2017-09-08T11:21:33.000331
Sean
pythondev_help_Sean_2017-09-08T11:21:33.000331
1,504,869,693.000331
92,827
pythondev
help
in the ini file, change `socket = myproject.sock` to `socket = 127.0.0.1:5000`
2017-09-08T11:22:02.000378
Junita
pythondev_help_Junita_2017-09-08T11:22:02.000378
1,504,869,722.000378
92,828
pythondev
help
just quickly - could you explain briefly the difference between sock and port?
2017-09-08T11:22:36.000505
Sean
pythondev_help_Sean_2017-09-08T11:22:36.000505
1,504,869,756.000505
92,829
pythondev
help
the port is just like you use connecting via the internet, sockets is a way for interprocess communication locally
2017-09-08T11:23:24.000710
Junita
pythondev_help_Junita_2017-09-08T11:23:24.000710
1,504,869,804.00071
92,830
pythondev
help
in your nginx config, change `uwsgi_pass unix:/home/sammy/myproject/myproject.sock;` to `uwsgi_pass 127.0.0.1:5000;`
2017-09-08T11:24:12.000197
Junita
pythondev_help_Junita_2017-09-08T11:24:12.000197
1,504,869,852.000197
92,831
pythondev
help
now restart :allthethings:
2017-09-08T11:24:26.000180
Junita
pythondev_help_Junita_2017-09-08T11:24:26.000180
1,504,869,866.00018
92,832
pythondev
help
first `sudo systemctl start myproject`
2017-09-08T11:24:44.000342
Junita
pythondev_help_Junita_2017-09-08T11:24:44.000342
1,504,869,884.000342
92,833
pythondev
help
then `sudo systemctl restart nginx`
2017-09-08T11:24:56.000326
Junita
pythondev_help_Junita_2017-09-08T11:24:56.000326
1,504,869,896.000326
92,834
pythondev
help
shouldnt i stop in between?
2017-09-08T11:25:06.000223
Sean
pythondev_help_Sean_2017-09-08T11:25:06.000223
1,504,869,906.000223
92,835
pythondev
help
myproject
2017-09-08T11:25:09.000455
Sean
pythondev_help_Sean_2017-09-08T11:25:09.000455
1,504,869,909.000455
92,836
pythondev
help
oh, oops, yeah. stop, or just restart should work
2017-09-08T11:25:17.000398
Junita
pythondev_help_Junita_2017-09-08T11:25:17.000398
1,504,869,917.000398
92,837
pythondev
help
still 502 :smile:
2017-09-08T11:26:28.000245
Sean
pythondev_help_Sean_2017-09-08T11:26:28.000245
1,504,869,988.000245
92,838
pythondev
help
yeah, I have no idea then, sorry. I do know we’ve seen other people come in with issues specifically around that tutorial
2017-09-08T11:26:51.000272
Junita
pythondev_help_Junita_2017-09-08T11:26:51.000272
1,504,870,011.000272
92,839
pythondev
help
yeah
2017-09-08T11:26:59.000398
Sean
pythondev_help_Sean_2017-09-08T11:26:59.000398
1,504,870,019.000398
92,840
pythondev
help
vps configuration not cool
2017-09-08T11:27:04.000647
Sean
pythondev_help_Sean_2017-09-08T11:27:04.000647
1,504,870,024.000647
92,841
pythondev
help
especially when it's my first and haven't reinitialized it in like 5 years... a lot of old configuration there, even some might be overlapping
2017-09-08T11:27:36.000441
Sean
pythondev_help_Sean_2017-09-08T11:27:36.000441
1,504,870,056.000441
92,842
pythondev
help
yeah, this is why I love Docker. :stuck_out_tongue:
2017-09-08T11:27:58.000172
Junita
pythondev_help_Junita_2017-09-08T11:27:58.000172
1,504,870,078.000172
92,843
pythondev
help
yeah, that's where im getting next, asap I get to reinitialize my vps, but I think that's a big job too
2017-09-08T11:28:20.000345
Sean
pythondev_help_Sean_2017-09-08T11:28:20.000345
1,504,870,100.000345
92,844
pythondev
help
but hey, thanks a lot , i'm out for today :unicorn_face:
2017-09-08T11:29:36.000412
Sean
pythondev_help_Sean_2017-09-08T11:29:36.000412
1,504,870,176.000412
92,845
pythondev
help
```import numpy as np from PIL import ImageGrab import cv2 import time def screen_record(): last_time = time.time() while(True): # 800x600 windowed mode printscreen = np.array(ImageGrab.grab(bbox=(0,40,800,640))) print('loop took {} seconds'.format(time.time()-last_time)) last_time = time.time() cv2.imshow('window',cv2.cvtColor(printscreen, cv2.COLOR_BGR2RGB)) if cv2.waitKey(25) & 0xFF == ord('q'): cv2.destroyAllWindows() break ```
2017-09-08T12:29:17.000740
Shirl
pythondev_help_Shirl_2017-09-08T12:29:17.000740
1,504,873,757.00074
92,846
pythondev
help
any idea why it looks like that?
2017-09-08T12:30:00.000172
Shirl
pythondev_help_Shirl_2017-09-08T12:30:00.000172
1,504,873,800.000172
92,847
pythondev
help
Probably the colour channel order is not what is being assumed
2017-09-08T12:32:23.000544
Gabriele
pythondev_help_Gabriele_2017-09-08T12:32:23.000544
1,504,873,943.000544
92,848
pythondev
help
And how do i fix that :)?
2017-09-08T16:13:16.000215
Shirl
pythondev_help_Shirl_2017-09-08T16:13:16.000215
1,504,887,196.000215
92,849
pythondev
help
question on a debate i'm having. we have a bunch of API classes that all take the same `api_session` parameter. we're debating these two approaches to a factory-esque thing: ``` from someapi1 import Api1 from someapi2 import Api2 def get_api1(api_session): return api1(api_session) def get_api1(api_session): return api2(api_session) ``` vs.: ``` from someapi1 import Api1 from someapi2 import Api2 def get_api(api_session, api_name): return return globals()[api_name](api_session) ```
2017-09-08T17:03:33.000444
Yesenia
pythondev_help_Yesenia_2017-09-08T17:03:33.000444
1,504,890,213.000444
92,850
pythondev
help
benefits of the first approach: don't have to remember the API names and intellisense-type completion works in IDEs
2017-09-08T17:03:59.000521
Yesenia
pythondev_help_Yesenia_2017-09-08T17:03:59.000521
1,504,890,239.000521
92,851
pythondev
help
benefits of the second: all you have to add is an import, no getters
2017-09-08T17:04:14.000150
Yesenia
pythondev_help_Yesenia_2017-09-08T17:04:14.000150
1,504,890,254.00015
92,852
pythondev
help
why would you want a function that only init a class ?
2017-09-08T17:05:40.000247
Ciera
pythondev_help_Ciera_2017-09-08T17:05:40.000247
1,504,890,340.000247
92,853
pythondev
help
<@Ciera> so we don't have to import the APIs all individually, we can just import one "importer" and tell it what we want and it will find it
2017-09-08T17:06:33.000441
Yesenia
pythondev_help_Yesenia_2017-09-08T17:06:33.000441
1,504,890,393.000441
92,854
pythondev
help
this is actually used in a fixture for pytest, so we avoid having to make a fixture for every API, just 1 one fixture that can import them all
2017-09-08T17:07:01.000097
Yesenia
pythondev_help_Yesenia_2017-09-08T17:07:01.000097
1,504,890,421.000097
92,855
pythondev
help
I don't know a lot pytest but if you really need it I would say the first one. I'm not a fan of using `globals`
2017-09-08T17:08:56.000102
Ciera
pythondev_help_Ciera_2017-09-08T17:08:56.000102
1,504,890,536.000102
92,856
pythondev
help
me neither, and i hate breaking code completion
2017-09-08T17:09:15.000411
Yesenia
pythondev_help_Yesenia_2017-09-08T17:09:15.000411
1,504,890,555.000411
92,857
pythondev
help
argument against me is "no one should rely on code completion" :confused:
2017-09-08T17:09:29.000303
Yesenia
pythondev_help_Yesenia_2017-09-08T17:09:29.000303
1,504,890,569.000303
92,858
pythondev
help
or make an `if` statement for each `api_name`
2017-09-08T17:09:37.000022
Ciera
pythondev_help_Ciera_2017-09-08T17:09:37.000022
1,504,890,577.000022
92,859
pythondev
help
I am kind of with <@Ciera> though i don't love either, myself. In a rare case I have just had a function to init those kinds of things and auto discover them
2017-09-08T17:10:03.000331
Beula
pythondev_help_Beula_2017-09-08T17:10:03.000331
1,504,890,603.000331
92,860
pythondev
help
but that complexity is isolated elsewhere
2017-09-08T17:10:11.000081
Beula
pythondev_help_Beula_2017-09-08T17:10:11.000081
1,504,890,611.000081
92,861
pythondev
help
``` def get_api(api_session, api): return api(api_session) ```
2017-09-08T17:10:21.000183
Ciera
pythondev_help_Ciera_2017-09-08T17:10:21.000183
1,504,890,621.000183
92,862
pythondev
help
I would prefer something like that (doesn't really provide anything here but we could imagine there is other param
2017-09-08T17:11:16.000028
Ciera
pythondev_help_Ciera_2017-09-08T17:11:16.000028
1,504,890,676.000028
92,863
pythondev
help
but then you still need to import the api modules where you call the function
2017-09-08T17:11:34.000054
Ciera
pythondev_help_Ciera_2017-09-08T17:11:34.000054
1,504,890,694.000054
92,864
pythondev
help
yeah the problem is `api` is what there are a lot of
2017-09-08T17:11:41.000159
Yesenia
pythondev_help_Yesenia_2017-09-08T17:11:41.000159
1,504,890,701.000159
92,865
pythondev
help
Or a dict of mappings
2017-09-08T17:11:57.000359
Beula
pythondev_help_Beula_2017-09-08T17:11:57.000359
1,504,890,717.000359
92,866
pythondev
help
yeah a big if or a dict would be the best imo
2017-09-08T17:12:24.000173
Ciera
pythondev_help_Ciera_2017-09-08T17:12:24.000173
1,504,890,744.000173
92,867
pythondev
help
example? not sure i follow
2017-09-08T17:12:38.000082
Yesenia
pythondev_help_Yesenia_2017-09-08T17:12:38.000082
1,504,890,758.000082
92,868
pythondev
help
+1 - it's clearer and more explicit
2017-09-08T17:12:39.000253
Beula
pythondev_help_Beula_2017-09-08T17:12:39.000253
1,504,890,759.000253
92,869
pythondev
help
``` APIS = { 'v1': ApiV1, 'v2': ApiV2, } def get_api(name): return APIS[name] ```
2017-09-08T17:13:04.000133
Beula
pythondev_help_Beula_2017-09-08T17:13:04.000133
1,504,890,784.000133
92,870
pythondev
help
This is all a bit abstract, so it still feels a little awkward - is this for flask?
2017-09-08T17:13:27.000387
Beula
pythondev_help_Beula_2017-09-08T17:13:27.000387
1,504,890,807.000387
92,871
pythondev
help
i gotcha, yeah that seems just a different version of #2
2017-09-08T17:13:55.000253
Yesenia
pythondev_help_Yesenia_2017-09-08T17:13:55.000253
1,504,890,835.000253
92,872
pythondev
help
<https://stackoverflow.com/questions/46124511/django-csrf-token-setup-with-jquery-issue> hey guys got a bug with javascript hoping another eye on this might help fix it
2017-09-08T17:14:14.000109
Beverley
pythondev_help_Beverley_2017-09-08T17:14:14.000109
1,504,890,854.000109
92,873
pythondev
help
but actually does save a little bit
2017-09-08T17:14:17.000329
Yesenia
pythondev_help_Yesenia_2017-09-08T17:14:17.000329
1,504,890,857.000329
92,874
pythondev
help
also i think this method still breaks code completion
2017-09-08T17:14:42.000044
Yesenia
pythondev_help_Yesenia_2017-09-08T17:14:42.000044
1,504,890,882.000044
92,875
pythondev
help
It probably does, what is the `api` classes?
2017-09-08T17:15:13.000197
Beula
pythondev_help_Beula_2017-09-08T17:15:13.000197
1,504,890,913.000197
92,876
pythondev
help
You can use type-hinting if you are on new python :smile:
2017-09-08T17:15:19.000310
Beula
pythondev_help_Beula_2017-09-08T17:15:19.000310
1,504,890,919.00031
92,877
pythondev
help
`apiv1: ApiV1 = get_api('v1')`
2017-09-08T17:15:27.000028
Beula
pythondev_help_Beula_2017-09-08T17:15:27.000028
1,504,890,927.000028
92,878
pythondev
help
<@Beula> `api` classes hold the methods for that particular API
2017-09-08T17:15:41.000286
Yesenia
pythondev_help_Yesenia_2017-09-08T17:15:41.000286
1,504,890,941.000286
92,879
pythondev
help
wow I am struggling
2017-09-08T17:15:42.000277
Beula
pythondev_help_Beula_2017-09-08T17:15:42.000277
1,504,890,942.000277
92,880
pythondev
help
they are broken up by function
2017-09-08T17:15:45.000420
Yesenia
pythondev_help_Yesenia_2017-09-08T17:15:45.000420
1,504,890,945.00042
92,881
pythondev
help
are you a client or server?
2017-09-08T17:15:53.000024
Beula
pythondev_help_Beula_2017-09-08T17:15:53.000024
1,504,890,953.000024
92,882
pythondev
help
client
2017-09-08T17:15:57.000238
Yesenia
pythondev_help_Yesenia_2017-09-08T17:15:57.000238
1,504,890,957.000238
92,883
pythondev
help
<@Beverley> looks like it's a better fit for <#C0LMFRMB5|django> or <#C45V5EJ15|javascript> :slightly_smiling_face:
2017-09-08T17:16:13.000318
Ciera
pythondev_help_Ciera_2017-09-08T17:16:13.000318
1,504,890,973.000318
92,884
pythondev
help
Oh, in that case I wouldn't likely do that at all and would much prefer to explicitly grab what I want if I need to know the name of the thing to get...
2017-09-08T17:16:32.000247
Beula
pythondev_help_Beula_2017-09-08T17:16:32.000247
1,504,890,992.000247
92,885
pythondev
help
You aren't really abstracting anything with that factory - so it doesn't really provide value
2017-09-08T17:16:43.000459
Beula
pythondev_help_Beula_2017-09-08T17:16:43.000459
1,504,891,003.000459
92,886
pythondev
help
yes let me push this there
2017-09-08T17:16:55.000024
Beverley
pythondev_help_Beverley_2017-09-08T17:16:55.000024
1,504,891,015.000024
92,887
pythondev
help
<@Beula> it allows us to be able to instantiate all APIs from one place, which for testing is nice
2017-09-08T17:17:37.000014
Yesenia
pythondev_help_Yesenia_2017-09-08T17:17:37.000014
1,504,891,057.000014
92,888
pythondev
help
otherwise we need a fixture for every single API
2017-09-08T17:17:43.000041
Yesenia
pythondev_help_Yesenia_2017-09-08T17:17:43.000041
1,504,891,063.000041
92,889
pythondev
help
So?
2017-09-08T17:17:50.000110
Beula
pythondev_help_Beula_2017-09-08T17:17:50.000110
1,504,891,070.00011
92,890
pythondev
help
explicit &gt; implicit
2017-09-08T17:17:55.000394
Beula
pythondev_help_Beula_2017-09-08T17:17:55.000394
1,504,891,075.000394
92,891
pythondev
help
well that's the problem we're solving
2017-09-08T17:17:59.000384
Yesenia
pythondev_help_Yesenia_2017-09-08T17:17:59.000384
1,504,891,079.000384
92,892
pythondev
help
right, i agree, but not everyone does
2017-09-08T17:18:09.000260
Yesenia
pythondev_help_Yesenia_2017-09-08T17:18:09.000260
1,504,891,089.00026
92,893
pythondev
help
some people favor code tidyness
2017-09-08T17:18:15.000388
Yesenia
pythondev_help_Yesenia_2017-09-08T17:18:15.000388
1,504,891,095.000388
92,894
pythondev
help
No, they are preferring "terseness"
2017-09-08T17:18:25.000140
Beula
pythondev_help_Beula_2017-09-08T17:18:25.000140
1,504,891,105.00014
92,895
pythondev
help
everyone has an opinion ¯\_(ツ)_/¯
2017-09-08T17:18:54.000161
Yesenia
pythondev_help_Yesenia_2017-09-08T17:18:54.000161
1,504,891,134.000161
92,896
pythondev
help
sometimes I just implement something to show the concrete way, gives less time to bike shed ¯\_(ツ)_/¯
2017-09-08T17:18:56.000200
Beula
pythondev_help_Beula_2017-09-08T17:18:56.000200
1,504,891,136.0002
92,897
pythondev
help
actually, the dict mapping does *not* break code completion somehow...
2017-09-08T17:19:29.000518
Yesenia
pythondev_help_Yesenia_2017-09-08T17:19:29.000518
1,504,891,169.000518
92,898
pythondev
help
interesting
2017-09-08T17:19:33.000045
Yesenia
pythondev_help_Yesenia_2017-09-08T17:19:33.000045
1,504,891,173.000045
92,899
pythondev
help
:tada:
2017-09-08T17:21:03.000071
Beula
pythondev_help_Beula_2017-09-08T17:21:03.000071
1,504,891,263.000071
92,900
pythondev
help
Have anybody of you taken an internship in Quora/Qualcomm/Intel/Cisco/Apple/Dropbox/Palantir or maybe is working there now?
2017-09-08T21:00:03.000072
Lashaunda
pythondev_help_Lashaunda_2017-09-08T21:00:03.000072
1,504,904,403.000072
92,901
pythondev
help
Hi
2017-09-09T11:44:14.000028
Cassaundra
pythondev_help_Cassaundra_2017-09-09T11:44:14.000028
1,504,957,454.000028
92,902