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
ah yes
2017-07-17T15:23:36.963835
Kandis
pythondev_help_Kandis_2017-07-17T15:23:36.963835
1,500,305,016.963835
85,903
pythondev
help
well idk i tried both spaces and tabs
2017-07-17T15:23:50.971165
Kandis
pythondev_help_Kandis_2017-07-17T15:23:50.971165
1,500,305,030.971165
85,904
pythondev
help
<@Thomasina> - you should make your editor insert 4 spaces when the tab key is hit. You don't literally type `&lt;space&gt;&lt;space&gt;&lt;space&gt;&lt;space&gt;...`
2017-07-17T15:24:05.978976
Beula
pythondev_help_Beula_2017-07-17T15:24:05.978976
1,500,305,045.978976
85,905
pythondev
help
:thinking_face:
2017-07-17T15:24:28.990901
Kandis
pythondev_help_Kandis_2017-07-17T15:24:28.990901
1,500,305,068.990901
85,906
pythondev
help
1s <@Kandis> - let me convert it
2017-07-17T15:24:43.998614
Beula
pythondev_help_Beula_2017-07-17T15:24:43.998614
1,500,305,083.998614
85,907
pythondev
help
<@Beula> Oh... I didn't even know that was possible as I've only ever used tabs. Good point. :joy:
2017-07-17T15:25:09.012260
Thomasina
pythondev_help_Thomasina_2017-07-17T15:25:09.012260
1,500,305,109.01226
85,908
pythondev
help
Oh sorry, you were converting it? Whoops... :cold_sweat:
2017-07-17T15:25:31.023993
Thomasina
pythondev_help_Thomasina_2017-07-17T15:25:31.023993
1,500,305,131.023993
85,909
pythondev
help
<@Thomasina> :taco:
2017-07-17T15:25:45.031223
Beula
pythondev_help_Beula_2017-07-17T15:25:45.031223
1,500,305,145.031223
85,910
pythondev
help
tabs vs. spaces. I am a spaces person, but I can see why tabs would be better.
2017-07-17T15:25:53.034971
Levi
pythondev_help_Levi_2017-07-17T15:25:53.034971
1,500,305,153.034971
85,911
pythondev
help
<@Beula> Haha, thanks! :fork_and_knife:
2017-07-17T15:26:06.042081
Thomasina
pythondev_help_Thomasina_2017-07-17T15:26:06.042081
1,500,305,166.042081
85,912
pythondev
help
queue clip from silicon valley!
2017-07-17T15:26:31.054897
Beula
pythondev_help_Beula_2017-07-17T15:26:31.054897
1,500,305,191.054897
85,913
pythondev
help
<https://www.youtube.com/watch?v=SsoOG6ZeyUI>
2017-07-17T15:26:46.062346
Beula
pythondev_help_Beula_2017-07-17T15:26:46.062346
1,500,305,206.062346
85,914
pythondev
help
I'm definitely going to read through this PEP 8 style guide. It'll take awhile but I think it'd be a good idea. Thanks for the link!
2017-07-17T15:26:47.063127
Thomasina
pythondev_help_Thomasina_2017-07-17T15:26:47.063127
1,500,305,207.063127
85,915
pythondev
help
79 characters might be the only think that should'nt be followed
2017-07-17T15:27:17.077872
Ciera
pythondev_help_Ciera_2017-07-17T15:27:17.077872
1,500,305,237.077872
85,916
pythondev
help
yes, but this is serious business! S.V. was lampooning these hair-splitty topics in programming. But to me tabs just bork up my whole work flow.
2017-07-17T15:27:20.079722
Levi
pythondev_help_Levi_2017-07-17T15:27:20.079722
1,500,305,240.079722
85,917
pythondev
help
this one gets the wrong answer <@Beula>
2017-07-17T15:27:36.088081
Kandis
pythondev_help_Kandis_2017-07-17T15:27:36.088081
1,500,305,256.088081
85,918
pythondev
help
well both of them get wrong answer as in 1
2017-07-17T15:28:11.105324
Kandis
pythondev_help_Kandis_2017-07-17T15:28:11.105324
1,500,305,291.105324
85,919
pythondev
help
and it should be 6
2017-07-17T15:28:21.110854
Kandis
pythondev_help_Kandis_2017-07-17T15:28:21.110854
1,500,305,301.110854
85,920
pythondev
help
:thinking_face:
2017-07-17T15:28:29.114781
Kandis
pythondev_help_Kandis_2017-07-17T15:28:29.114781
1,500,305,309.114781
85,921
pythondev
help
<@Kandis> can you repost the problem statement? I scrolled up looking for it, and I was unable to fnd it
2017-07-17T15:28:40.120023
Levi
pythondev_help_Levi_2017-07-17T15:28:40.120023
1,500,305,320.120023
85,922
pythondev
help
Technically, any int mod 1 is 0
2017-07-17T15:28:59.129513
Beula
pythondev_help_Beula_2017-07-17T15:28:59.129513
1,500,305,339.129513
85,923
pythondev
help
So it's kind of right
2017-07-17T15:29:05.132540
Beula
pythondev_help_Beula_2017-07-17T15:29:05.132540
1,500,305,345.13254
85,924
pythondev
help
You probably want `range(2, ...)`
2017-07-17T15:29:12.136008
Beula
pythondev_help_Beula_2017-07-17T15:29:12.136008
1,500,305,352.136008
85,925
pythondev
help
You should start at 2
2017-07-17T15:29:16.137869
Patty
pythondev_help_Patty_2017-07-17T15:29:16.137869
1,500,305,356.137869
85,926
pythondev
help
Because of that
2017-07-17T15:29:18.139230
Patty
pythondev_help_Patty_2017-07-17T15:29:18.139230
1,500,305,358.13923
85,927
pythondev
help
…I saw that edit, Matt :wink:
2017-07-17T15:29:28.144101
Patty
pythondev_help_Patty_2017-07-17T15:29:28.144101
1,500,305,368.144101
85,928
pythondev
help
which edit?
2017-07-17T15:30:19.170176
Beula
pythondev_help_Beula_2017-07-17T15:30:19.170176
1,500,305,419.170176
85,929
pythondev
help
<@Beula> Wow! In that clip, unless they're writing Python the girl is obviously wrong from a totally measurable and scientific point of view that is not at all biased by my extreme preference for tabs.
2017-07-17T15:30:32.176741
Thomasina
pythondev_help_Thomasina_2017-07-17T15:30:32.176741
1,500,305,432.176741
85,930
pythondev
help
I don't see any ` (edited)`!?
2017-07-17T15:30:33.177089
Beula
pythondev_help_Beula_2017-07-17T15:30:33.177089
1,500,305,433.177089
85,931
pythondev
help
<@Levi>
2017-07-17T15:30:35.178466
Kandis
pythondev_help_Kandis_2017-07-17T15:30:35.178466
1,500,305,435.178466
85,932
pythondev
help
Oh nevermind, you just beat me, again
2017-07-17T15:30:57.189534
Patty
pythondev_help_Patty_2017-07-17T15:30:57.189534
1,500,305,457.189534
85,933
pythondev
help
haha <@Thomasina> - the compiler takes care of them in any language pretty much
2017-07-17T15:31:01.191598
Beula
pythondev_help_Beula_2017-07-17T15:31:01.191598
1,500,305,461.191598
85,934
pythondev
help
<@Kandis> - They are asking for the actual "problem" that code is meant to solve, is there accompanying text?
2017-07-17T15:31:32.207814
Beula
pythondev_help_Beula_2017-07-17T15:31:32.207814
1,500,305,492.207814
85,935
pythondev
help
oh is to get the HCF — highest common factor
2017-07-17T15:32:03.223657
Kandis
pythondev_help_Kandis_2017-07-17T15:32:03.223657
1,500,305,523.223657
85,936
pythondev
help
HCF = Highest Common Factor?
2017-07-17T15:32:17.230737
Levi
pythondev_help_Levi_2017-07-17T15:32:17.230737
1,500,305,537.230737
85,937
pythondev
help
yes
2017-07-17T15:32:36.241117
Kandis
pythondev_help_Kandis_2017-07-17T15:32:36.241117
1,500,305,556.241117
85,938
pythondev
help
<@Beula> Sure, but code that written with spaces...it's just...so unnatural. I mean, spaces are wrong because reasons! :joy: It's funny how I can get so worked up over something like that...
2017-07-17T15:32:38.241964
Thomasina
pythondev_help_Thomasina_2017-07-17T15:32:38.241964
1,500,305,558.241964
85,939
pythondev
help
:smile:
2017-07-17T15:32:45.245124
Beula
pythondev_help_Beula_2017-07-17T15:32:45.245124
1,500,305,565.245124
85,940
pythondev
help
That's one pro about Golang, they have the `go fmt` tool, that forces tabs. The con is that it's tabs :wink:
2017-07-17T15:33:14.261171
Beula
pythondev_help_Beula_2017-07-17T15:33:14.261171
1,500,305,594.261171
85,941
pythondev
help
what happens in x=y on input?
2017-07-17T15:33:16.261968
Levi
pythondev_help_Levi_2017-07-17T15:33:16.261968
1,500,305,596.261968
85,942
pythondev
help
num1 = num2 ?
2017-07-17T15:33:27.267780
Levi
pythondev_help_Levi_2017-07-17T15:33:27.267780
1,500,305,607.26778
85,943
pythondev
help
n.m. I am looking at 20 windows at the same time here
2017-07-17T15:34:01.285660
Levi
pythondev_help_Levi_2017-07-17T15:34:01.285660
1,500,305,641.28566
85,944
pythondev
help
:astonished:
2017-07-17T15:34:18.294542
Kandis
pythondev_help_Kandis_2017-07-17T15:34:18.294542
1,500,305,658.294542
85,945
pythondev
help
forgive me if I am wrong, but if you are looking for highest shouldn't you set your loop down the integers, rather than loop up?
2017-07-17T15:35:50.342958
Levi
pythondev_help_Levi_2017-07-17T15:35:50.342958
1,500,305,750.342958
85,946
pythondev
help
Oh, maybe that is what I missed in the original intention - I thought it was the LCF
2017-07-17T15:36:31.363558
Beula
pythondev_help_Beula_2017-07-17T15:36:31.363558
1,500,305,791.363558
85,947
pythondev
help
yes, they ask for HCF, not LCF
2017-07-17T15:36:39.367982
Levi
pythondev_help_Levi_2017-07-17T15:36:39.367982
1,500,305,799.367982
85,948
pythondev
help
this is what I always told my students: read the question carefully - at least half of wrong answers are because the question was not properly parsed
2017-07-17T15:37:46.402232
Levi
pythondev_help_Levi_2017-07-17T15:37:46.402232
1,500,305,866.402232
85,949
pythondev
help
6 is indeed the highest no?
2017-07-17T15:38:28.423369
Kandis
pythondev_help_Kandis_2017-07-17T15:38:28.423369
1,500,305,908.423369
85,950
pythondev
help
Sorry <@Kandis> - my bad
2017-07-17T15:38:46.432412
Beula
pythondev_help_Beula_2017-07-17T15:38:46.432412
1,500,305,926.432412
85,951
pythondev
help
Yes, <@Levi> is right - it's best to walk DOWN instead of up this one
2017-07-17T15:38:59.439016
Beula
pythondev_help_Beula_2017-07-17T15:38:59.439016
1,500,305,939.439016
85,952
pythondev
help
<@Kandis> : no idea! :smile: your code should give you the right answer :smile:
2017-07-17T15:39:15.447552
Levi
pythondev_help_Levi_2017-07-17T15:39:15.447552
1,500,305,955.447552
85,953
pythondev
help
yea the standard answer i saw is:
2017-07-17T15:39:40.460344
Kandis
pythondev_help_Kandis_2017-07-17T15:39:40.460344
1,500,305,980.460344
85,954
pythondev
help
it indeed gets the right answer for num1 and num2's HCF which is 6
2017-07-17T15:40:14.477432
Kandis
pythondev_help_Kandis_2017-07-17T15:40:14.477432
1,500,306,014.477432
85,955
pythondev
help
I think that this loop will work, but it might be suboptimal for large numbers.
2017-07-17T15:40:52.496940
Levi
pythondev_help_Levi_2017-07-17T15:40:52.496940
1,500,306,052.49694
85,956
pythondev
help
but that is a topic for discussion
2017-07-17T15:41:02.502077
Levi
pythondev_help_Levi_2017-07-17T15:41:02.502077
1,500,306,062.502077
85,957
pythondev
help
because you have no way of softcoding a break point in the if-then clause. Whereas if you start high you can jump out as soon as the clause is fulfilled
2017-07-17T15:43:04.562638
Levi
pythondev_help_Levi_2017-07-17T15:43:04.562638
1,500,306,184.562638
85,958
pythondev
help
may i ask how did you determine when to loop up or down
2017-07-17T15:43:10.565724
Kandis
pythondev_help_Kandis_2017-07-17T15:43:10.565724
1,500,306,190.565724
85,959
pythondev
help
it just "made sense"
2017-07-17T15:43:22.571943
Levi
pythondev_help_Levi_2017-07-17T15:43:22.571943
1,500,306,202.571943
85,960
pythondev
help
can't explain how
2017-07-17T15:43:26.574192
Levi
pythondev_help_Levi_2017-07-17T15:43:26.574192
1,500,306,206.574192
85,961
pythondev
help
If you want it a little more terse, combining what I had earlier and what you have: ``` def compute_hcf(x, y): smaller = min(x, y) for i in range(1, smaller + 1): if x % 1 == 0 and y % i == 0: hcf = i return hcf ``` But this can be simplified even more going backwards instead of brute forcing it: ``` def compute_hcf(x, y): smaller = min(x, y) for i in range(smaller + 1, 1, -1): if x % 1 == 0 and y % i == 0: return i return 1 ```
2017-07-17T15:43:46.584473
Beula
pythondev_help_Beula_2017-07-17T15:43:46.584473
1,500,306,226.584473
85,962
pythondev
help
yes, version 2 is better
2017-07-17T15:44:03.593171
Levi
pythondev_help_Levi_2017-07-17T15:44:03.593171
1,500,306,243.593171
85,963
pythondev
help
The _when_ is usually a trade-off of how many operations are required until I meet my condition. So when stepping up, you *have to* evaluate every number in the range for the condition. However if you step down, the *first found* number is the answer
2017-07-17T15:44:50.616888
Beula
pythondev_help_Beula_2017-07-17T15:44:50.616888
1,500,306,290.616888
85,964
pythondev
help
simplification means reducing the time complexity. Because those two snippets contain basically identical code structures.
2017-07-17T15:44:58.620693
Levi
pythondev_help_Levi_2017-07-17T15:44:58.620693
1,500,306,298.620693
85,965
pythondev
help
So for v1 above: your complexity is `O(n)` (or that for the size of the range, every number must be evaluated)
2017-07-17T15:45:31.637738
Beula
pythondev_help_Beula_2017-07-17T15:45:31.637738
1,500,306,331.637738
85,966
pythondev
help
it is always `O(n)` in version one, where v. 2 is `O(n)` in the worst case
2017-07-17T15:46:05.654576
Levi
pythondev_help_Levi_2017-07-17T15:46:05.654576
1,500,306,365.654576
85,967
pythondev
help
But for v2 the complexity could be at the best case `O(1)` (for any size of the range, only 1 operation is needed) and at the worst case `O(n)`
2017-07-17T15:46:08.655903
Beula
pythondev_help_Beula_2017-07-17T15:46:08.655903
1,500,306,368.655903
85,968
pythondev
help
hehe
2017-07-17T15:46:12.657608
Levi
pythondev_help_Levi_2017-07-17T15:46:12.657608
1,500,306,372.657608
85,969
pythondev
help
Does that make sense <@Kandis> ?
2017-07-17T15:46:56.679923
Beula
pythondev_help_Beula_2017-07-17T15:46:56.679923
1,500,306,416.679923
85,970
pythondev
help
woo well explained <@Beula> may i ask if we can leave out the last “-1” in the second version’s range ( for i in range(smaller + 1, 1, -1):)
2017-07-17T15:49:17.750719
Kandis
pythondev_help_Kandis_2017-07-17T15:49:17.750719
1,500,306,557.750719
85,971
pythondev
help
shouldnt it count down one by one already by default
2017-07-17T15:50:21.783524
Kandis
pythondev_help_Kandis_2017-07-17T15:50:21.783524
1,500,306,621.783524
85,972
pythondev
help
<@Kandis> I think the best way to do these things is to experiment. You get intuition that way.
2017-07-17T15:50:51.799523
Levi
pythondev_help_Levi_2017-07-17T15:50:51.799523
1,500,306,651.799523
85,973
pythondev
help
<@Beula> <@Levi> :taco:
2017-07-17T15:51:25.816969
Kandis
pythondev_help_Kandis_2017-07-17T15:51:25.816969
1,500,306,685.816969
85,974
pythondev
help
thanks teachers
2017-07-17T15:51:36.822388
Kandis
pythondev_help_Kandis_2017-07-17T15:51:36.822388
1,500,306,696.822388
85,975
pythondev
help
Here's a link for your reading :smile: : <https://docs.python.org/3/library/functions.html#func-range>
2017-07-17T15:51:50.829888
Beula
pythondev_help_Beula_2017-07-17T15:51:50.829888
1,500,306,710.829888
85,976
pythondev
help
it's a bit like math: a technical skill rather than a pure talent. That is, until you get to the higher levels. But looping limits, aligning indices, all that painful stuff has to be done a few dozen times before you stop thinking about it.
2017-07-17T15:53:07.870438
Levi
pythondev_help_Levi_2017-07-17T15:53:07.870438
1,500,306,787.870438
85,977
pythondev
help
<@Kandis> You should also checkout Asymptotic Notations and complexity.
2017-07-17T15:54:38.917861
Cleta
pythondev_help_Cleta_2017-07-17T15:54:38.917861
1,500,306,878.917861
85,978
pythondev
help
great point. This is a fundamental theme in programming
2017-07-17T15:54:59.928869
Levi
pythondev_help_Levi_2017-07-17T15:54:59.928869
1,500,306,899.928869
85,979
pythondev
help
<@Levi> so deep!!haha thanks
2017-07-17T15:55:03.930887
Kandis
pythondev_help_Kandis_2017-07-17T15:55:03.930887
1,500,306,903.930887
85,980
pythondev
help
help me setting elasticsearch-dsl for n-gram!
2017-07-17T16:22:07.784369
Rickey
pythondev_help_Rickey_2017-07-17T16:22:07.784369
1,500,308,527.784369
85,981
pythondev
help
done!
2017-07-17T16:40:34.365514
Rickey
pythondev_help_Rickey_2017-07-17T16:40:34.365514
1,500,309,634.365514
85,982
pythondev
help
hi, all! I have dict with oldstring as key and newstring as value. I need replace strings in file according to that dict. What is the best way to do that?
2017-07-17T16:48:18.606636
Fleta
pythondev_help_Fleta_2017-07-17T16:48:18.606636
1,500,310,098.606636
85,983
pythondev
help
What have you tried <@Fleta> ?
2017-07-17T16:48:55.626200
Beula
pythondev_help_Beula_2017-07-17T16:48:55.626200
1,500,310,135.6262
85,984
pythondev
help
<@Beula> Well, I think to do it like this: ``` for key, value in dict.items(): with open(filename, 'r+'): for line in f: line = re.sub(key,value, line) f.write(line) # &lt;-- possible mistake f.close() ```
2017-07-17T16:55:18.824860
Fleta
pythondev_help_Fleta_2017-07-17T16:55:18.824860
1,500,310,518.82486
85,985
pythondev
help
Does that work?
2017-07-17T16:56:40.867492
Beula
pythondev_help_Beula_2017-07-17T16:56:40.867492
1,500,310,600.867492
85,986
pythondev
help
you could probably simplify it a little for yourself if you can fit the whole file in memory and then re-write it
2017-07-17T16:57:08.882198
Beula
pythondev_help_Beula_2017-07-17T16:57:08.882198
1,500,310,628.882198
85,987
pythondev
help
I thought there is more simple way...
2017-07-17T17:00:22.984296
Fleta
pythondev_help_Fleta_2017-07-17T17:00:22.984296
1,500,310,822.984296
85,988
pythondev
help
Also, if you use `with open` it handles closing the file for you. For those newer pythonistas, these are called context managers and are awesome
2017-07-17T17:00:26.986654
Patty
pythondev_help_Patty_2017-07-17T17:00:26.986654
1,500,310,826.986654
85,989
pythondev
help
<@Patty> cool)
2017-07-17T17:00:54.001525
Fleta
pythondev_help_Fleta_2017-07-17T17:00:54.001525
1,500,310,854.001525
85,990
pythondev
help
Yeah, the simplest: ``` with open(my_file) as f: content = f.read() for k, v in dict.items(): content = re.sub(k, v, content) with open(my_file, 'w') as f: f.write(content) ``` Though there probably is a "better" way.
2017-07-17T17:02:27.050835
Beula
pythondev_help_Beula_2017-07-17T17:02:27.050835
1,500,310,947.050835
85,991
pythondev
help
<@Beula> oh! that's really simple) thanks a lot, forget that it's possible to replace in the whole text not just in line
2017-07-17T17:09:09.247659
Fleta
pythondev_help_Fleta_2017-07-17T17:09:09.247659
1,500,311,349.247659
85,992
pythondev
help
It saves a few iterations, but it will load the whole file in - so be aware of how large the file is!
2017-07-17T17:09:43.263228
Beula
pythondev_help_Beula_2017-07-17T17:09:43.263228
1,500,311,383.263228
85,993
pythondev
help
Oh, it's just hundreds of lines, it will be ok.
2017-07-17T17:11:43.319264
Fleta
pythondev_help_Fleta_2017-07-17T17:11:43.319264
1,500,311,503.319264
85,994
pythondev
help
You can make rabbitmq faster by using the HiPe compile. But I doubt that's the problem, as you wont notice a difference there until you hit scale.
2017-07-17T17:17:32.480635
Signe
pythondev_help_Signe_2017-07-17T17:17:32.480635
1,500,311,852.480635
85,995
pythondev
help
so has anyone tried to setup travis with a public python repository that has a private repository as a dependency? From what I can tell I need to have a private travis accnt to even do this =(.
2017-07-17T18:08:52.766985
Johana
pythondev_help_Johana_2017-07-17T18:08:52.766985
1,500,314,932.766985
85,996
pythondev
help
well it make sense
2017-07-17T18:09:48.786598
Ciera
pythondev_help_Ciera_2017-07-17T18:09:48.786598
1,500,314,988.786598
85,997
pythondev
help
this wouldn’t be an issue except that my org has run out of private repos.
2017-07-17T18:10:29.801278
Johana
pythondev_help_Johana_2017-07-17T18:10:29.801278
1,500,315,029.801278
85,998
pythondev
help
i think if i used a dependency link in my setup.py with the env_var of a user token that has access and format the dependency link url with the token it should be able to pull the dependency down.
2017-07-17T18:12:11.836581
Johana
pythondev_help_Johana_2017-07-17T18:12:11.836581
1,500,315,131.836581
85,999
pythondev
help
a lil hacky.
2017-07-17T18:13:27.862787
Johana
pythondev_help_Johana_2017-07-17T18:13:27.862787
1,500,315,207.862787
86,000
pythondev
help
well if the repo is public people would have access
2017-07-17T18:13:58.873366
Ciera
pythondev_help_Ciera_2017-07-17T18:13:58.873366
1,500,315,238.873366
86,001
pythondev
help
not sure if that's ok for you
2017-07-17T18:14:09.876888
Ciera
pythondev_help_Ciera_2017-07-17T18:14:09.876888
1,500,315,249.876888
86,002