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
try with a compas that point south maybe it will help
2017-07-25T04:55:27.611935
Ciera
pythondev_help_Ciera_2017-07-25T04:55:27.611935
1,500,958,527.611935
87,103
pythondev
help
So, rather than using the default `postgres` database I made a new one for testing and ran `CREATE EXTENSION postgis;` in it. However when running a query with a spatial function I get `ERROR: function st_dwithin(geography, geography) does not exist`. This doesn't happen in the `postgres` database. :thinking_face:
2017-07-25T04:57:04.648643
Thomasina
pythondev_help_Thomasina_2017-07-25T04:57:04.648643
1,500,958,624.648643
87,104
pythondev
help
Read that `SET search_path TO public, sml;` should fix it, but no luck
2017-07-25T04:58:16.676445
Thomasina
pythondev_help_Thomasina_2017-07-25T04:58:16.676445
1,500,958,696.676445
87,105
pythondev
help
postgis is definitely in the `public` schema
2017-07-25T05:03:18.798088
Thomasina
pythondev_help_Thomasina_2017-07-25T05:03:18.798088
1,500,958,998.798088
87,106
pythondev
help
<@Thomasina> Might be a question for <#C3X4T24LB|databases>
2017-07-25T05:23:21.264104
Gabriele
pythondev_help_Gabriele_2017-07-25T05:23:21.264104
1,500,960,201.264104
87,107
pythondev
help
Hello Pythonistas, anyone would know why `mimetypes.guess_type('my_file.csv')` returns `('application/vns.ms-excel', None)` instead of `('text/csv', None)` like Linux does? The file does not even exist.
2017-07-25T05:30:05.419551
Ronny
pythondev_help_Ronny_2017-07-25T05:30:05.419551
1,500,960,605.419551
87,108
pythondev
help
Maybe because the default software for it is `excel` and windows do some tricks
2017-07-25T05:32:13.469262
Ciera
pythondev_help_Ciera_2017-07-25T05:32:13.469262
1,500,960,733.469262
87,109
pythondev
help
is it doing the same with an existing file ?
2017-07-25T05:32:24.473595
Ciera
pythondev_help_Ciera_2017-07-25T05:32:24.473595
1,500,960,744.473595
87,110
pythondev
help
Looks like it uses registry settings, and doesn't examine actual files, just filenames
2017-07-25T05:34:25.519169
Gabriele
pythondev_help_Gabriele_2017-07-25T05:34:25.519169
1,500,960,865.519169
87,111
pythondev
help
Yeah, with an existing file the result is the same.
2017-07-25T05:35:07.534767
Ronny
pythondev_help_Ronny_2017-07-25T05:35:07.534767
1,500,960,907.534767
87,112
pythondev
help
Looks indeed as registry settings. I thought that `mimetypes` was supposed to be os-independent... I guess I am wrong? I just assumed it that way.
2017-07-25T05:35:51.551168
Ronny
pythondev_help_Ronny_2017-07-25T05:35:51.551168
1,500,960,951.551168
87,113
pythondev
help
<https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L350-L351>
2017-07-25T05:36:55.575405
Collette
pythondev_help_Collette_2017-07-25T05:36:55.575405
1,500,961,015.575405
87,114
pythondev
help
It's os-dependent :slightly_smiling_face: Like anything that windows touches
2017-07-25T05:37:12.581354
Collette
pythondev_help_Collette_2017-07-25T05:37:12.581354
1,500,961,032.581354
87,115
pythondev
help
What type a file 'is' can always be open to interpretation, unfortunately
2017-07-25T05:39:51.639512
Gabriele
pythondev_help_Gabriele_2017-07-25T05:39:51.639512
1,500,961,191.639512
87,116
pythondev
help
<@Thomasina> with alot of these postgis questions yo have, there should be answers on <https://gis.stackexchange.com/>
2017-07-25T05:43:10.713588
Meg
pythondev_help_Meg_2017-07-25T05:43:10.713588
1,500,961,390.713588
87,117
pythondev
help
<@Meg> Oh, yes, I check there and other places, but the supposed solution to the problem doesn't work for me. :disappointed:
2017-07-25T05:44:46.749080
Thomasina
pythondev_help_Thomasina_2017-07-25T05:44:46.749080
1,500,961,486.74908
87,118
pythondev
help
oh, interesting
2017-07-25T05:44:56.752645
Meg
pythondev_help_Meg_2017-07-25T05:44:56.752645
1,500,961,496.752645
87,119
pythondev
help
are you using 9.6 postgres?
2017-07-25T05:45:13.759419
Meg
pythondev_help_Meg_2017-07-25T05:45:13.759419
1,500,961,513.759419
87,120
pythondev
help
and the latest postgis?
2017-07-25T05:45:26.764335
Meg
pythondev_help_Meg_2017-07-25T05:45:26.764335
1,500,961,526.764335
87,121
pythondev
help
I've never encountered your issue
2017-07-25T05:45:44.771129
Meg
pythondev_help_Meg_2017-07-25T05:45:44.771129
1,500,961,544.771129
87,122
pythondev
help
Yes, and yes. :slightly_smiling_face:
2017-07-25T05:45:50.773237
Thomasina
pythondev_help_Thomasina_2017-07-25T05:45:50.773237
1,500,961,550.773237
87,123
pythondev
help
I run `SET search_path TO public, sml;` which is generally the solution presented but I still receive the same error.
2017-07-25T05:45:50.773380
Thomasina
pythondev_help_Thomasina_2017-07-25T05:45:50.773380
1,500,961,550.77338
87,124
pythondev
help
I don't, however, receive this error when running queries on the default `postgres` database. Only on this new one.
2017-07-25T05:46:18.783814
Thomasina
pythondev_help_Thomasina_2017-07-25T05:46:18.783814
1,500,961,578.783814
87,125
pythondev
help
And I've confirmed that postgis is on the public schema as well
2017-07-25T05:46:40.791990
Thomasina
pythondev_help_Thomasina_2017-07-25T05:46:40.791990
1,500,961,600.79199
87,126
pythondev
help
so, if you use something like pgadmin
2017-07-25T05:47:50.817853
Meg
pythondev_help_Meg_2017-07-25T05:47:50.817853
1,500,961,670.817853
87,127
pythondev
help
and open up the tree down to your new database
2017-07-25T05:48:10.825078
Meg
pythondev_help_Meg_2017-07-25T05:48:10.825078
1,500,961,690.825078
87,128
pythondev
help
so postgis is in your db extensions?
2017-07-25T05:48:40.835965
Meg
pythondev_help_Meg_2017-07-25T05:48:40.835965
1,500,961,720.835965
87,129
pythondev
help
also, what is your query you're running
2017-07-25T05:50:29.876048
Meg
pythondev_help_Meg_2017-07-25T05:50:29.876048
1,500,961,829.876048
87,130
pythondev
help
usually when you get this issue with postgis, it means you're inputing invalid types in the function
2017-07-25T05:50:47.882865
Meg
pythondev_help_Meg_2017-07-25T05:50:47.882865
1,500,961,847.882865
87,131
pythondev
help
Yes, it's listed in the extensions for the new database.
2017-07-25T05:54:59.975653
Thomasina
pythondev_help_Thomasina_2017-07-25T05:54:59.975653
1,500,962,099.975653
87,132
pythondev
help
Um...
2017-07-25T05:55:01.976486
Thomasina
pythondev_help_Thomasina_2017-07-25T05:55:01.976486
1,500,962,101.976486
87,133
pythondev
help
So I rebooted my PC for unrelated reasons and now it works.
2017-07-25T05:55:21.984411
Thomasina
pythondev_help_Thomasina_2017-07-25T05:55:21.984411
1,500,962,121.984411
87,134
pythondev
help
Interesting
2017-07-25T05:55:27.986498
Thomasina
pythondev_help_Thomasina_2017-07-25T05:55:27.986498
1,500,962,127.986498
87,135
pythondev
help
postgres might need a restart when you install postgis
2017-07-25T05:56:39.013084
Ciera
pythondev_help_Ciera_2017-07-25T05:56:39.013084
1,500,962,199.013084
87,136
pythondev
help
especially on windows
2017-07-25T05:59:24.073951
Meg
pythondev_help_Meg_2017-07-25T05:59:24.073951
1,500,962,364.073951
87,137
pythondev
help
because you can't update certain files when the system is running
2017-07-25T05:59:43.081340
Meg
pythondev_help_Meg_2017-07-25T05:59:43.081340
1,500,962,383.08134
87,138
pythondev
help
so you ether need to restart the service or reboot
2017-07-25T05:59:53.085159
Meg
pythondev_help_Meg_2017-07-25T05:59:53.085159
1,500,962,393.085159
87,139
pythondev
help
Yep - on Windows open up Task Manager, pick Services, find postgres whatever, right click, Restart
2017-07-25T05:59:55.085885
Gabriele
pythondev_help_Gabriele_2017-07-25T05:59:55.085885
1,500,962,395.085885
87,140
pythondev
help
Wow. Seems like one of those "did you try turning it off and back on again?" moments. :facepalm:
2017-07-25T06:53:09.128148
Thomasina
pythondev_help_Thomasina_2017-07-25T06:53:09.128148
1,500,965,589.128148
87,141
pythondev
help
Haha, thanks for clarifying that though!
2017-07-25T06:53:19.131191
Thomasina
pythondev_help_Thomasina_2017-07-25T06:53:19.131191
1,500,965,599.131191
87,142
pythondev
help
Hello guys I'm trying to implement a proxy server in the form of a python script it presents itself like this
2017-07-25T07:27:44.754197
Hyman
pythondev_help_Hyman_2017-07-25T07:27:44.754197
1,500,967,664.754197
87,143
pythondev
help
I want to operate 4 basic steps
2017-07-25T07:28:02.759673
Hyman
pythondev_help_Hyman_2017-07-25T07:28:02.759673
1,500,967,682.759673
87,144
pythondev
help
1- Listen from the web browser
2017-07-25T07:28:13.762989
Hyman
pythondev_help_Hyman_2017-07-25T07:28:13.762989
1,500,967,693.762989
87,145
pythondev
help
2- Forward the request to the web server
2017-07-25T07:28:37.770248
Hyman
pythondev_help_Hyman_2017-07-25T07:28:37.770248
1,500,967,717.770248
87,146
pythondev
help
3- Get the response from the web server
2017-07-25T07:28:54.775633
Hyman
pythondev_help_Hyman_2017-07-25T07:28:54.775633
1,500,967,734.775633
87,147
pythondev
help
4- Send back the server response to the browser
2017-07-25T07:29:21.783875
Hyman
pythondev_help_Hyman_2017-07-25T07:29:21.783875
1,500,967,761.783875
87,148
pythondev
help
My main problem is first at step 2. This is because at a certain point, i want to rewrite the URL from the browser and I don't know how to do that and I'm just a beginner
2017-07-25T07:30:45.810065
Hyman
pythondev_help_Hyman_2017-07-25T07:30:45.810065
1,500,967,845.810065
87,149
pythondev
help
There are existing proxies that can rewrite URLs. You don't need to write any software to do it.
2017-07-25T07:31:47.828763
Gabriele
pythondev_help_Gabriele_2017-07-25T07:31:47.828763
1,500,967,907.828763
87,150
pythondev
help
Oh... I didn't knew that. Can you please give me an example of one ?
2017-07-25T07:32:32.841939
Hyman
pythondev_help_Hyman_2017-07-25T07:32:32.841939
1,500,967,952.841939
87,151
pythondev
help
<http://httpd.apache.org/docs/current/mod/mod_rewrite.html>
2017-07-25T07:34:40.879929
Gabriele
pythondev_help_Gabriele_2017-07-25T07:34:40.879929
1,500,968,080.879929
87,152
pythondev
help
and if you're using nginx
2017-07-25T07:35:02.886704
Meg
pythondev_help_Meg_2017-07-25T07:35:02.886704
1,500,968,102.886704
87,153
pythondev
help
<http://nginx.org/en/docs/http/ngx_http_rewrite_module.html>
2017-07-25T07:35:02.886962
Meg
pythondev_help_Meg_2017-07-25T07:35:02.886962
1,500,968,102.886962
87,154
pythondev
help
OK i'll try it thanks guys
2017-07-25T07:49:32.152758
Hyman
pythondev_help_Hyman_2017-07-25T07:49:32.152758
1,500,968,972.152758
87,155
pythondev
help
<@Gabriele> Apache in 2017?
2017-07-25T08:36:24.147201
Suellen
pythondev_help_Suellen_2017-07-25T08:36:24.147201
1,500,971,784.147201
87,156
pythondev
help
Sure, go old school
2017-07-25T08:40:03.234198
Gabriele
pythondev_help_Gabriele_2017-07-25T08:40:03.234198
1,500,972,003.234198
87,157
pythondev
help
Nobody ever got fired for choosing IBM
2017-07-25T08:40:19.241036
Gabriele
pythondev_help_Gabriele_2017-07-25T08:40:19.241036
1,500,972,019.241036
87,158
pythondev
help
... etc
2017-07-25T08:40:25.242965
Gabriele
pythondev_help_Gabriele_2017-07-25T08:40:25.242965
1,500,972,025.242965
87,159
pythondev
help
don't forget mod_perl
2017-07-25T08:41:01.257636
Suellen
pythondev_help_Suellen_2017-07-25T08:41:01.257636
1,500,972,061.257636
87,160
pythondev
help
nah, straight to CGI, none of this crazy new tech
2017-07-25T08:58:53.727928
Gabriele
pythondev_help_Gabriele_2017-07-25T08:58:53.727928
1,500,973,133.727928
87,161
pythondev
help
I would start by moving it all into one function, which gets called once. Then I'd move parts of it into various individual functions based on grouping lumps of shared functionality together. For example, each block of logic in a for loop is a candidate for a function because it's related code that gets called on a succession of data
2017-07-25T09:03:59.877763
Gabriele
pythondev_help_Gabriele_2017-07-25T09:03:59.877763
1,500,973,439.877763
87,162
pythondev
help
I'd also consider ditching things like `range(len(target_column_G))` which is usually the wrong way to iterate over something in Python
2017-07-25T09:04:24.889612
Gabriele
pythondev_help_Gabriele_2017-07-25T09:04:24.889612
1,500,973,464.889612
87,163
pythondev
help
<@Gabriele> Thank you, I read about functions except I never really implemented one, any dummy proof example on this snippet how can I have them in a function?
2017-07-25T09:05:22.917764
Gertude
pythondev_help_Gertude_2017-07-25T09:05:22.917764
1,500,973,522.917764
87,164
pythondev
help
I think it's perhaps too fundamental a concept to explain in chat. Maybe a tutorial will help, e.g. <https://www.tutorialspoint.com/python/python_functions.htm>
2017-07-25T09:06:20.946559
Gabriele
pythondev_help_Gabriele_2017-07-25T09:06:20.946559
1,500,973,580.946559
87,165
pythondev
help
Thank you, reading it
2017-07-25T09:07:13.973268
Gertude
pythondev_help_Gertude_2017-07-25T09:07:13.973268
1,500,973,633.973268
87,166
pythondev
help
What would you suggest, to continue working on getting new features and bigger code, or to prioritize implementing functions to clean it up?
2017-07-25T09:09:04.029382
Gertude
pythondev_help_Gertude_2017-07-25T09:09:04.029382
1,500,973,744.029382
87,167
pythondev
help
I'd priotize learning good design and structure
2017-07-25T09:09:35.045342
Meg
pythondev_help_Meg_2017-07-25T09:09:35.045342
1,500,973,775.045342
87,168
pythondev
help
because once you are able to structure a program effectively, adding new features and maintaining older code is much easier
2017-07-25T09:10:09.062691
Meg
pythondev_help_Meg_2017-07-25T09:10:09.062691
1,500,973,809.062691
87,169
pythondev
help
Thank you
2017-07-25T09:13:57.177287
Gertude
pythondev_help_Gertude_2017-07-25T09:13:57.177287
1,500,974,037.177287
87,170
pythondev
help
<@Meg> Do you have any other notes other tha what <@Gabriele> mentioned?
2017-07-25T09:14:30.194302
Gertude
pythondev_help_Gertude_2017-07-25T09:14:30.194302
1,500,974,070.194302
87,171
pythondev
help
he covered everything, I think
2017-07-25T09:15:36.227782
Meg
pythondev_help_Meg_2017-07-25T09:15:36.227782
1,500,974,136.227782
87,172
pythondev
help
and i'd use some blank lines for separation
2017-07-25T09:15:58.238737
Meg
pythondev_help_Meg_2017-07-25T09:15:58.238737
1,500,974,158.238737
87,173
pythondev
help
for bits that really don't belong in a different function
2017-07-25T09:16:08.243880
Meg
pythondev_help_Meg_2017-07-25T09:16:08.243880
1,500,974,168.24388
87,174
pythondev
help
group variables together by general area of responsibility
2017-07-25T09:16:18.249385
Meg
pythondev_help_Meg_2017-07-25T09:16:18.249385
1,500,974,178.249385
87,175
pythondev
help
The problem with learning the right way to write programs is that a lot of it doesn't make much sense until you've gone through the process a few times
2017-07-25T09:16:54.268618
Gabriele
pythondev_help_Gabriele_2017-07-25T09:16:54.268618
1,500,974,214.268618
87,176
pythondev
help
I'd say just start small, clean things up, write functions, then maybe write classes, and read through the Python tutorial to understand all the tools available to you
2017-07-25T09:17:54.301056
Gabriele
pythondev_help_Gabriele_2017-07-25T09:17:54.301056
1,500,974,274.301056
87,177
pythondev
help
So <@Gabriele> I should continue developing this and learning other simple functions then when confident enough I release another version with functions?
2017-07-25T09:43:57.167192
Gertude
pythondev_help_Gertude_2017-07-25T09:43:57.167192
1,500,975,837.167192
87,178
pythondev
help
I don't know - what is your end goal here?
2017-07-25T09:44:35.189602
Gabriele
pythondev_help_Gabriele_2017-07-25T09:44:35.189602
1,500,975,875.189602
87,179
pythondev
help
Having an issue with instantiation of a new object within another one as an attribute. I have two classes as such `class a` and `class b`
2017-07-25T10:08:22.051066
Myong
pythondev_help_Myong_2017-07-25T10:08:22.051066
1,500,977,302.051066
87,180
pythondev
help
in class a under `__init__` I do `self.obj = b()`
2017-07-25T10:08:51.069514
Myong
pythondev_help_Myong_2017-07-25T10:08:51.069514
1,500,977,331.069514
87,181
pythondev
help
and I attempt to run a function from `class b` via the `obj` variable through `self.obj.run_func()` within `class a`
2017-07-25T10:09:53.108850
Myong
pythondev_help_Myong_2017-07-25T10:09:53.108850
1,500,977,393.10885
87,182
pythondev
help
I think a line got deleted that I typed, can't quite tell...
2017-07-25T10:10:42.139402
Myong
pythondev_help_Myong_2017-07-25T10:10:42.139402
1,500,977,442.139402
87,183
pythondev
help
But either way, `class b` isn't really a child as much as it's just an attribute of the `class a` but attempting to run a function within `class a` on the `obj` variable gives a reference error
2017-07-25T10:11:32.171068
Myong
pythondev_help_Myong_2017-07-25T10:11:32.171068
1,500,977,492.171068
87,184
pythondev
help
show the actual error
2017-07-25T10:11:40.176263
Gabriele
pythondev_help_Gabriele_2017-07-25T10:11:40.176263
1,500,977,500.176263
87,185
pythondev
help
`Unresolved attribute reference to run_func in object b`
2017-07-25T10:12:21.201466
Myong
pythondev_help_Myong_2017-07-25T10:12:21.201466
1,500,977,541.201466
87,186
pythondev
help
But the function is in the class
2017-07-25T10:12:54.222478
Myong
pythondev_help_Myong_2017-07-25T10:12:54.222478
1,500,977,574.222478
87,187
pythondev
help
but is it?
2017-07-25T10:13:22.240172
Suellen
pythondev_help_Suellen_2017-07-25T10:13:22.240172
1,500,977,602.240172
87,188
pythondev
help
Does it _actually_ say "in object b"
2017-07-25T10:13:32.246501
Gabriele
pythondev_help_Gabriele_2017-07-25T10:13:32.246501
1,500,977,612.246501
87,189
pythondev
help
`in class b` the edits I am making keep deleting the whole lines
2017-07-25T10:14:08.269858
Myong
pythondev_help_Myong_2017-07-25T10:14:08.269858
1,500,977,648.269858
87,190
pythondev
help
classes aren't objects, so these details are critical
2017-07-25T10:14:18.275907
Gabriele
pythondev_help_Gabriele_2017-07-25T10:14:18.275907
1,500,977,658.275907
87,191
pythondev
help
In your definition of `class b`, is there a method `run_func`?
2017-07-25T10:14:43.292296
Gabriele
pythondev_help_Gabriele_2017-07-25T10:14:43.292296
1,500,977,683.292296
87,192
pythondev
help
yes
2017-07-25T10:14:49.296351
Myong
pythondev_help_Myong_2017-07-25T10:14:49.296351
1,500,977,689.296351
87,193
pythondev
help
But I'm also getting scope errors for self
2017-07-25T10:15:02.304186
Myong
pythondev_help_Myong_2017-07-25T10:15:02.304186
1,500,977,702.304186
87,194
pythondev
help
"scope errors"
2017-07-25T10:15:17.313323
Gabriele
pythondev_help_Gabriele_2017-07-25T10:15:17.313323
1,500,977,717.313323
87,195
pythondev
help
shadow name self
2017-07-25T10:15:25.318990
Myong
pythondev_help_Myong_2017-07-25T10:15:25.318990
1,500,977,725.31899
87,196
pythondev
help
&gt; classes aren't objects say what
2017-07-25T10:15:26.319867
Suellen
pythondev_help_Suellen_2017-07-25T10:15:26.319867
1,500,977,726.319867
87,197
pythondev
help
<@Suellen> You'll confuse things...
2017-07-25T10:15:40.328775
Gabriele
pythondev_help_Gabriele_2017-07-25T10:15:40.328775
1,500,977,740.328775
87,198
pythondev
help
&gt; shadow name self here you go :slightly_smiling_face:
2017-07-25T10:15:44.330985
Suellen
pythondev_help_Suellen_2017-07-25T10:15:44.330985
1,500,977,744.330985
87,199
pythondev
help
yeah, but I don't understand exactly where it's coming from?
2017-07-25T10:16:11.348164
Myong
pythondev_help_Myong_2017-07-25T10:16:11.348164
1,500,977,771.348164
87,200
pythondev
help
Is it the import into the other module?
2017-07-25T10:16:25.357330
Myong
pythondev_help_Myong_2017-07-25T10:16:25.357330
1,500,977,785.35733
87,201
pythondev
help
<@Gabriele> I am writing a software which is used by few customers now, it does the job now, but I am looking to both better myself and my code that's all, so seeking advice if in your opinion I should let it stay the same for now till I learn more or continue working on adding more then later enhance.
2017-07-25T10:16:28.359363
Gertude
pythondev_help_Gertude_2017-07-25T10:16:28.359363
1,500,977,788.359363
87,202