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
You're looking for a `Finder` _instance_
2018-02-05T05:08:08.000042
Aleida
pythondev_help_Aleida_2018-02-05T05:08:08.000042
1,517,807,288.000042
32,824
pythondev
help
which is `Finder()`
2018-02-05T05:08:13.000007
Aleida
pythondev_help_Aleida_2018-02-05T05:08:13.000007
1,517,807,293.000007
32,825
pythondev
help
and you need to call methods on the instance, not on the class
2018-02-05T05:08:24.000051
Aleida
pythondev_help_Aleida_2018-02-05T05:08:24.000051
1,517,807,304.000051
32,826
pythondev
help
Thank you for your explanation <@Aleida> :slightly_smiling_face: I appreciate your help
2018-02-05T05:12:05.000168
Josephine
pythondev_help_Josephine_2018-02-05T05:12:05.000168
1,517,807,525.000168
32,827
pythondev
help
<@Josephine> it's common to use a `set` for membership testing instead of a `list`, but maybe that information is a bit early in your learning process.
2018-02-05T06:41:05.000155
Kay
pythondev_help_Kay_2018-02-05T06:41:05.000155
1,517,812,865.000155
32,828
pythondev
help
<@Kay> I was trying to do string matching with sorted and collections(counter).
2018-02-05T06:42:36.000240
Josephine
pythondev_help_Josephine_2018-02-05T06:42:36.000240
1,517,812,956.00024
32,829
pythondev
help
Aha, you have a bunch of strings, and you want to count the duplicates, and then find out if a certain string is present in the collection?
2018-02-05T06:43:57.000284
Kay
pythondev_help_Kay_2018-02-05T06:43:57.000284
1,517,813,037.000284
32,830
pythondev
help
Every character in my input (list of strings) has to occur exactly once (more precise: as often as in the pattern, but in arbitrary order.
2018-02-05T06:46:47.000420
Josephine
pythondev_help_Josephine_2018-02-05T06:46:47.000420
1,517,813,207.00042
32,831
pythondev
help
An example of the input would be ["abba", "bac", "caaa"] ?
2018-02-05T06:49:42.000160
Kay
pythondev_help_Kay_2018-02-05T06:49:42.000160
1,517,813,382.00016
32,832
pythondev
help
<@Kay> yes and if the input to be matched is abc , it should return ['bac']
2018-02-05T06:57:04.000127
Josephine
pythondev_help_Josephine_2018-02-05T06:57:04.000127
1,517,813,824.000127
32,833
pythondev
help
```matched_list = [x for x in string_list if Counter( string_match) == Counter(x)]```
2018-02-05T06:57:33.000453
Josephine
pythondev_help_Josephine_2018-02-05T06:57:33.000453
1,517,813,853.000453
32,834
pythondev
help
This is how I did it.
2018-02-05T06:57:40.000156
Josephine
pythondev_help_Josephine_2018-02-05T06:57:40.000156
1,517,813,860.000156
32,835
pythondev
help
I am not sure about the time complexity of this solution though.
2018-02-05T06:58:06.000049
Josephine
pythondev_help_Josephine_2018-02-05T06:58:06.000049
1,517,813,886.000049
32,836
pythondev
help
I have this, but it doesn;t meet your last criterium yet.
2018-02-05T06:58:09.000407
Kay
pythondev_help_Kay_2018-02-05T06:58:09.000407
1,517,813,889.000407
32,837
pythondev
help
```# Frequency definition definitions = ["abba", "bac", "caaa"] definitionoccurences = collections.Counter("".join(definitions)) print("letter occurences:", definitionoccurences) # Test some candidate words against the freqencies candidate = "bcbcb" candidateoccurences = collections.Counter(candidate) match = True for...
2018-02-05T06:58:14.000333
Kay
pythondev_help_Kay_2018-02-05T06:58:14.000333
1,517,813,894.000333
32,838
pythondev
help
Don't worry too much about time complexity yet at this stage (premature optimization)
2018-02-05T06:58:46.000003
Kay
pythondev_help_Kay_2018-02-05T06:58:46.000003
1,517,813,926.000003
32,839
pythondev
help
<@Kay> Thanks.
2018-02-05T06:58:59.000157
Josephine
pythondev_help_Josephine_2018-02-05T06:58:59.000157
1,517,813,939.000157
32,840
pythondev
help
I'm not sure I understand the requirements correctly
2018-02-05T06:59:23.000406
Kay
pythondev_help_Kay_2018-02-05T06:59:23.000406
1,517,813,963.000406
32,841
pythondev
help
This however does the job for me: ```matched_list = [x for x in string_list if Counter( string_match) == Counter(x)]```
2018-02-05T06:59:26.000227
Josephine
pythondev_help_Josephine_2018-02-05T06:59:26.000227
1,517,813,966.000227
32,842
pythondev
help
For example, the constructor should take an array as follows: ```python string_list = ['asd', 'asdd', 'fre', 'glk', 'lkm']; finder = Finder(string_list); ``` Calling `finder.find('sad')` should return a list containing the string `asd`. In the case where more than one member of the initialization list matches the ke...
2018-02-05T06:59:52.000297
Josephine
pythondev_help_Josephine_2018-02-05T06:59:52.000297
1,517,813,992.000297
32,843
pythondev
help
I think it's simpler than I expected.
2018-02-05T06:59:54.000172
Kay
pythondev_help_Kay_2018-02-05T06:59:54.000172
1,517,813,994.000172
32,844
pythondev
help
Yep.
2018-02-05T07:00:34.000338
Josephine
pythondev_help_Josephine_2018-02-05T07:00:34.000338
1,517,814,034.000338
32,845
pythondev
help
Ah ok. The person who came up with this idea must really love OOP
2018-02-05T07:00:39.000130
Kay
pythondev_help_Kay_2018-02-05T07:00:39.000130
1,517,814,039.00013
32,846
pythondev
help
:joy:
2018-02-05T07:00:55.000320
Josephine
pythondev_help_Josephine_2018-02-05T07:00:55.000320
1,517,814,055.00032
32,847
pythondev
help
<https://www.youtube.com/watch?v=o9pEzgHorH0>
2018-02-05T07:01:12.000206
Kay
pythondev_help_Kay_2018-02-05T07:01:12.000206
1,517,814,072.000206
32,848
pythondev
help
Starred !
2018-02-05T07:01:50.000034
Josephine
pythondev_help_Josephine_2018-02-05T07:01:50.000034
1,517,814,110.000034
32,849
pythondev
help
Classes with only one function, don't have to be classes. It's the Java straightjacket of having to put everything in a class, no matter what.
2018-02-05T07:01:51.000073
Kay
pythondev_help_Kay_2018-02-05T07:01:51.000073
1,517,814,111.000073
32,850
pythondev
help
I agree with you.
2018-02-05T07:02:06.000175
Josephine
pythondev_help_Josephine_2018-02-05T07:02:06.000175
1,517,814,126.000175
32,851
pythondev
help
It can be a simple function.
2018-02-05T07:02:16.000240
Josephine
pythondev_help_Josephine_2018-02-05T07:02:16.000240
1,517,814,136.00024
32,852
pythondev
help
Can anyone help out with wsgi daemon process? At the moment I have two sites on my server that initially used the following for the apache2 .conf file; ``` &lt;VirtualHost *:80&gt; ServerName <http://tracker.media.com|tracker.media.com> ServerAdmin <mailto:alfonso@media.com|alfonso@media.com> ...
2018-02-05T08:58:11.000345
Milo
pythondev_help_Milo_2018-02-05T08:58:11.000345
1,517,821,091.000345
32,853
pythondev
help
you mean this? <http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html>
2018-02-05T08:59:25.000328
Floy
pythondev_help_Floy_2018-02-05T08:59:25.000328
1,517,821,165.000328
32,854
pythondev
help
basically add that right under `WSGIScriptAlias`
2018-02-05T08:59:55.000665
Floy
pythondev_help_Floy_2018-02-05T08:59:55.000665
1,517,821,195.000665
32,855
pythondev
help
yes, but I am also using a virtual environment so was looking at this; <http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html#daemon-mode-single-application>
2018-02-05T09:00:19.000742
Milo
pythondev_help_Milo_2018-02-05T09:00:19.000742
1,517,821,219.000742
32,856
pythondev
help
wow its that simple?
2018-02-05T09:00:41.000671
Milo
pythondev_help_Milo_2018-02-05T09:00:41.000671
1,517,821,241.000671
32,857
pythondev
help
ok, that seems simple enough, and I am guessing you just change the data for other sites?
2018-02-05T09:03:49.000466
Milo
pythondev_help_Milo_2018-02-05T09:03:49.000466
1,517,821,429.000466
32,858
pythondev
help
you really should have both sites under their own different configuration
2018-02-05T09:04:36.000409
Floy
pythondev_help_Floy_2018-02-05T09:04:36.000409
1,517,821,476.000409
32,859
pythondev
help
eg different `*.conf` file
2018-02-05T09:04:46.000054
Floy
pythondev_help_Floy_2018-02-05T09:04:46.000054
1,517,821,486.000054
32,860
pythondev
help
what is also odd, is they told me to run this command; `mod_wsgi-express module-config` and then put the output of it in `wsgi.load` which I had no idea what I was doing
2018-02-05T09:05:19.000046
Milo
pythondev_help_Milo_2018-02-05T09:05:19.000046
1,517,821,519.000046
32,861
pythondev
help
cool, have this done
2018-02-05T09:05:34.000216
Milo
pythondev_help_Milo_2018-02-05T09:05:34.000216
1,517,821,534.000216
32,862
pythondev
help
I’m running this on python 2.7, which requires a different version of mod_wsgi ¯\_(ツ)_/¯
2018-02-05T09:05:46.000272
Floy
pythondev_help_Floy_2018-02-05T09:05:46.000272
1,517,821,546.000272
32,863
pythondev
help
IIRC the above should be forwards compatible, but not sure what that execution is supposed to do
2018-02-05T09:06:05.000552
Floy
pythondev_help_Floy_2018-02-05T09:06:05.000552
1,517,821,565.000552
32,864
pythondev
help
cool thanks <@Floy> :taco: will try and give it a go
2018-02-05T09:07:40.000221
Milo
pythondev_help_Milo_2018-02-05T09:07:40.000221
1,517,821,660.000221
32,865
pythondev
help
good luck :slightly_smiling_face:
2018-02-05T09:08:15.000003
Floy
pythondev_help_Floy_2018-02-05T09:08:15.000003
1,517,821,695.000003
32,866
pythondev
help
<@Floy> how did you enable your `mod_wsgi` as I normally went `a2enmod wsgi` but because they are installed in my virtual env I am not sure how to go about this!
2018-02-05T10:12:41.000344
Milo
pythondev_help_Milo_2018-02-05T10:12:41.000344
1,517,825,561.000344
32,867
pythondev
help
shouldn’t be installed in your virtualenv
2018-02-05T10:15:47.000449
Floy
pythondev_help_Floy_2018-02-05T10:15:47.000449
1,517,825,747.000449
32,868
pythondev
help
if you’re using ubuntu and did `apt-get install libapache2-mod-wsgi`, its installed to your apache environment
2018-02-05T10:16:15.000768
Floy
pythondev_help_Floy_2018-02-05T10:16:15.000768
1,517,825,775.000768
32,869
pythondev
help
that is what I had originally! then the other the person who wrote it told me to install it in my virtual env on github
2018-02-05T10:29:13.000400
Milo
pythondev_help_Milo_2018-02-05T10:29:13.000400
1,517,826,553.0004
32,870
pythondev
help
I have no clue what’s going on
2018-02-05T10:29:36.000251
Floy
pythondev_help_Floy_2018-02-05T10:29:36.000251
1,517,826,576.000251
32,871
pythondev
help
where were you getting this info?
2018-02-05T10:29:43.000806
Floy
pythondev_help_Floy_2018-02-05T10:29:43.000806
1,517,826,583.000806
32,872
pythondev
help
<https://github.com/GrahamDumpleton/mod_wsgi/issues/233#issuecomment-363042933>
2018-02-05T10:30:11.000370
Milo
pythondev_help_Milo_2018-02-05T10:30:11.000370
1,517,826,611.00037
32,873
pythondev
help
hmm ok
2018-02-05T10:30:31.000173
Floy
pythondev_help_Floy_2018-02-05T10:30:31.000173
1,517,826,631.000173
32,874
pythondev
help
that’s the author of the entire mod_wsgi project
2018-02-05T10:30:41.000239
Floy
pythondev_help_Floy_2018-02-05T10:30:41.000239
1,517,826,641.000239
32,875
pythondev
help
yes
2018-02-05T10:30:45.000422
Milo
pythondev_help_Milo_2018-02-05T10:30:45.000422
1,517,826,645.000422
32,876
pythondev
help
so did you execute `mod_wsgi-express` in `mods-availalbe`?
2018-02-05T10:31:25.000309
Floy
pythondev_help_Floy_2018-02-05T10:31:25.000309
1,517,826,685.000309
32,877
pythondev
help
scrolling down
2018-02-05T10:31:39.000332
Floy
pythondev_help_Floy_2018-02-05T10:31:39.000332
1,517,826,699.000332
32,878
pythondev
help
so, I think you need to set user, group, process, threads for `WSGIDaemonProcess`
2018-02-05T10:35:12.000061
Floy
pythondev_help_Floy_2018-02-05T10:35:12.000061
1,517,826,912.000061
32,879
pythondev
help
and FYI, when you say `not working`, give more details
2018-02-05T10:35:24.000301
Floy
pythondev_help_Floy_2018-02-05T10:35:24.000301
1,517,826,924.000301
32,880
pythondev
help
even if nothing happens, say `not working, executed as described, and got X output`
2018-02-05T10:35:48.000654
Floy
pythondev_help_Floy_2018-02-05T10:35:48.000654
1,517,826,948.000654
32,881
pythondev
help
yes but then disabled as I need to do it for two sites, which is confusing me
2018-02-05T10:35:56.000615
Milo
pythondev_help_Milo_2018-02-05T10:35:56.000615
1,517,826,956.000615
32,882
pythondev
help
cool will do
2018-02-05T10:36:25.000576
Milo
pythondev_help_Milo_2018-02-05T10:36:25.000576
1,517,826,985.000576
32,883
pythondev
help
I realize a process like this to figure a solution is frustrating
2018-02-05T10:36:45.000233
Floy
pythondev_help_Floy_2018-02-05T10:36:45.000233
1,517,827,005.000233
32,884
pythondev
help
this is where I get confused, so for my first site I have this currently; ``` &lt;VirtualHost *:80&gt; ServerName <http://businessopportunities.txfmedia.com|businessopportunities.txfmedia.com> ServerAdmin <mailto:alfonso.olivas@txfmedia.com|alfonso.olivas@txfmedia.com> WSGIDaemonProcess <http...
2018-02-05T10:37:19.000329
Milo
pythondev_help_Milo_2018-02-05T10:37:19.000329
1,517,827,039.000329
32,885
pythondev
help
and you’re not setting python home
2018-02-05T10:37:47.000161
Floy
pythondev_help_Floy_2018-02-05T10:37:47.000161
1,517,827,067.000161
32,886
pythondev
help
Hi guys, I have an endpoint that gets data from a collections. Each item has a datatime with this format `'2018-02-03T18:04:01+0000' `. What I’d need to do filter the results by datatime. So what I am trying to do is ``` from datetime import timedelta, timedelta import datetime periodstart = '2018-02-03T18:04:01+000...
2018-02-05T10:38:49.000139
Maya
pythondev_help_Maya_2018-02-05T10:38:49.000139
1,517,827,129.000139
32,887
pythondev
help
why are you converting `current_time` to a string`?
2018-02-05T10:39:59.000516
Floy
pythondev_help_Floy_2018-02-05T10:39:59.000516
1,517,827,199.000516
32,888
pythondev
help
`current_time = datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%S%z')` you format your `current_time` as a string here
2018-02-05T10:40:03.000238
Micki
pythondev_help_Micki_2018-02-05T10:40:03.000238
1,517,827,203.000238
32,889
pythondev
help
should be able to subtract datetime with a timedelta
2018-02-05T10:40:21.000428
Floy
pythondev_help_Floy_2018-02-05T10:40:21.000428
1,517,827,221.000428
32,890
pythondev
help
well, in the db I have the datatime stored as `2018-02-03T18:04:01+0000` generated with `datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%S%z')`
2018-02-05T10:41:12.000192
Maya
pythondev_help_Maya_2018-02-05T10:41:12.000192
1,517,827,272.000192
32,891
pythondev
help
stored as a string
2018-02-05T10:41:34.000532
Floy
pythondev_help_Floy_2018-02-05T10:41:34.000532
1,517,827,294.000532
32,892
pythondev
help
yes
2018-02-05T10:41:40.000588
Maya
pythondev_help_Maya_2018-02-05T10:41:40.000588
1,517,827,300.000588
32,893
pythondev
help
not as a date type?
2018-02-05T10:41:47.000337
Floy
pythondev_help_Floy_2018-02-05T10:41:47.000337
1,517,827,307.000337
32,894
pythondev
help
so I need to convert back to data type in order to use the timedelta
2018-02-05T10:42:01.000778
Maya
pythondev_help_Maya_2018-02-05T10:42:01.000778
1,517,827,321.000778
32,895
pythondev
help
?
2018-02-05T10:42:04.000631
Maya
pythondev_help_Maya_2018-02-05T10:42:04.000631
1,517,827,324.000631
32,896
pythondev
help
why are you storing the date as a string in the db, and not as a date type
2018-02-05T10:42:24.000788
Floy
pythondev_help_Floy_2018-02-05T10:42:24.000788
1,517,827,344.000788
32,897
pythondev
help
its’ for the client’s UI
2018-02-05T10:43:00.000058
Maya
pythondev_help_Maya_2018-02-05T10:43:00.000058
1,517,827,380.000058
32,898
pythondev
help
so the data can be displayed without any conversion
2018-02-05T10:43:16.000352
Maya
pythondev_help_Maya_2018-02-05T10:43:16.000352
1,517,827,396.000352
32,899
pythondev
help
not good
2018-02-05T10:43:38.000146
Floy
pythondev_help_Floy_2018-02-05T10:43:38.000146
1,517,827,418.000146
32,900
pythondev
help
surely in the client UI you want it in their local timezone?
2018-02-05T10:43:40.000143
Jama
pythondev_help_Jama_2018-02-05T10:43:40.000143
1,517,827,420.000143
32,901
pythondev
help
:point_up:
2018-02-05T10:43:45.000345
Floy
pythondev_help_Floy_2018-02-05T10:43:45.000345
1,517,827,425.000345
32,902
pythondev
help
have set python home, now says I have a syntax error on that line!
2018-02-05T10:43:45.000700
Milo
pythondev_help_Milo_2018-02-05T10:43:45.000700
1,517,827,425.0007
32,903
pythondev
help
plus, you can have the db handle all that for you rather than converting here, there and everywhere
2018-02-05T10:44:05.000605
Floy
pythondev_help_Floy_2018-02-05T10:44:05.000605
1,517,827,445.000605
32,904
pythondev
help
yes you’re half right in that you should store the times in UTC in the db
2018-02-05T10:44:07.000112
Jama
pythondev_help_Jama_2018-02-05T10:44:07.000112
1,517,827,447.000112
32,905
pythondev
help
and then also store the client offset/timezone so you can do the conversions in/out
2018-02-05T10:44:36.000238
Jama
pythondev_help_Jama_2018-02-05T10:44:36.000238
1,517,827,476.000238
32,906
pythondev
help
you mean timestamp with timezone :slightly_smiling_face:
2018-02-05T10:44:44.000070
Micki
pythondev_help_Micki_2018-02-05T10:44:44.000070
1,517,827,484.00007
32,907
pythondev
help
is what I did, adding the timezone
2018-02-05T10:45:18.000823
Maya
pythondev_help_Maya_2018-02-05T10:45:18.000823
1,517,827,518.000823
32,908
pythondev
help
the client just displays the data it gets
2018-02-05T10:45:50.000428
Maya
pythondev_help_Maya_2018-02-05T10:45:50.000428
1,517,827,550.000428
32,909
pythondev
help
Anyone here have prior success getting requests to accept an internal certificate? (my use case is SSL inspection - need to get to the internet and trust the SSL rewrites)
2018-02-05T10:45:58.000463
Hayden
pythondev_help_Hayden_2018-02-05T10:45:58.000463
1,517,827,558.000463
32,910
pythondev
help
but it also needs to filter them
2018-02-05T10:46:04.000387
Maya
pythondev_help_Maya_2018-02-05T10:46:04.000387
1,517,827,564.000387
32,911
pythondev
help
to avoid a huge amount of data as results of a GET
2018-02-05T10:46:37.000734
Maya
pythondev_help_Maya_2018-02-05T10:46:37.000734
1,517,827,597.000734
32,912
pythondev
help
I've been trying to build the chain, but can't get even openssl to verify it. Works fine on my mac (but not on CentOS/RHEL)
2018-02-05T10:46:53.000063
Hayden
pythondev_help_Hayden_2018-02-05T10:46:53.000063
1,517,827,613.000063
32,913
pythondev
help
<@Maya> again, use the db’s date type to enable the database to do that filtering for you
2018-02-05T10:47:30.000090
Floy
pythondev_help_Floy_2018-02-05T10:47:30.000090
1,517,827,650.00009
32,914
pythondev
help
<@Hayden> ssl can be a mess to deal with in python. If my memory is correct it should use the system certs
2018-02-05T10:48:03.000553
Micki
pythondev_help_Micki_2018-02-05T10:48:03.000553
1,517,827,683.000553
32,915
pythondev
help
but it depends on your python version
2018-02-05T10:48:09.000652
Micki
pythondev_help_Micki_2018-02-05T10:48:09.000652
1,517,827,689.000652
32,916
pythondev
help
well, it "SHOULD?
2018-02-05T10:48:13.000292
Hayden
pythondev_help_Hayden_2018-02-05T10:48:13.000292
1,517,827,693.000292
32,917
pythondev
help
* SHOULD
2018-02-05T10:48:17.000499
Hayden
pythondev_help_Hayden_2018-02-05T10:48:17.000499
1,517,827,697.000499
32,918
pythondev
help
but it seems requests will use the cerifi bundle if it's available
2018-02-05T10:48:33.000918
Hayden
pythondev_help_Hayden_2018-02-05T10:48:33.000918
1,517,827,713.000918
32,919
pythondev
help
(which we want it avaialbe)
2018-02-05T10:48:41.000311
Hayden
pythondev_help_Hayden_2018-02-05T10:48:41.000311
1,517,827,721.000311
32,920
pythondev
help
but at this point, I'm desparate just get get it to verify :slightly_smiling_face:
2018-02-05T10:48:58.000676
Hayden
pythondev_help_Hayden_2018-02-05T10:48:58.000676
1,517,827,738.000676
32,921
pythondev
help
yes but how I should handle different timezones?
2018-02-05T10:50:11.000458
Maya
pythondev_help_Maya_2018-02-05T10:50:11.000458
1,517,827,811.000458
32,922
pythondev
help
<@Hayden> I found this but you probably have too <https://incognitjoe.github.io/adding-certs-to-requests.html>
2018-02-05T10:51:27.000377
Micki
pythondev_help_Micki_2018-02-05T10:51:27.000377
1,517,827,887.000377
32,923