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
No you don't.
2018-03-12T06:53:54.000219
Aleida
pythondev_help_Aleida_2018-03-12T06:53:54.000219
1,520,837,634.000219
38,324
pythondev
help
i m using a logic, first to find the index position of 'USD-GBP' 'USD-EUR' and store in some variable and then run for loop interation to have sum of product. is that right way ?
2018-03-12T06:57:32.000298
Refugia
pythondev_help_Refugia_2018-03-12T06:57:32.000298
1,520,837,852.000298
38,325
pythondev
help
or should i store the 'USD-GBP' 'USD-EUR' values in OrderedDict, and then do sum of product, like u did for sum ? i m little confuse here :slightly_smiling_face:
2018-03-12T06:59:00.000480
Refugia
pythondev_help_Refugia_2018-03-12T06:59:00.000480
1,520,837,940.00048
38,326
pythondev
help
Hey everyone. Im struggeling with encoding stuff again... I've got this line: `print((next_word.encode('utf-8') + b' ').decode('utf-8'), end='') ` having issues decoding \u2019... I can't really figure out the right place to put me de/encodes :C it's probably really simple but this always trips me up.
2018-03-12T08:55:08.000487
Maura
pythondev_help_Maura_2018-03-12T08:55:08.000487
1,520,844,908.000487
38,327
pythondev
help
so decoding takes an encoded string from an external source, say a web page, a text file, etc, and converts it into a unicode object, or in python 3 a string
2018-03-12T09:01:11.000311
Zack
pythondev_help_Zack_2018-03-12T09:01:11.000311
1,520,845,271.000311
38,328
pythondev
help
look at these unicode objects as sort of a universal way of storing the text data that only works inside your python program
2018-03-12T09:01:44.000132
Zack
pythondev_help_Zack_2018-03-12T09:01:44.000132
1,520,845,304.000132
38,329
pythondev
help
when you want to write that data out, you can’t do it directly, it needs to be encoded, so you call encode. if you *don’t* do that, it will just use whatever the default system encoding is, and try and do it automatically
2018-03-12T09:02:24.000641
Zack
pythondev_help_Zack_2018-03-12T09:02:24.000641
1,520,845,344.000641
38,330
pythondev
help
often, especially on python 2, that would be ascii, which can’t handle all sorts of fancy characters
2018-03-12T09:02:42.000636
Zack
pythondev_help_Zack_2018-03-12T09:02:42.000636
1,520,845,362.000636
38,331
pythondev
help
doing it manually and specifying something like `utf-8`, you’ll avoid those sorts of errors
2018-03-12T09:03:04.000230
Zack
pythondev_help_Zack_2018-03-12T09:03:04.000230
1,520,845,384.00023
38,332
pythondev
help
specific to your example - you wouldn’t want to encode and decode like that in the same line. if `next_word` is a string (or unicode object in python 2) the `encode` call is sufficient
2018-03-12T09:04:18.000467
Zack
pythondev_help_Zack_2018-03-12T09:04:18.000467
1,520,845,458.000467
38,333
pythondev
help
if it’s a already been encoded (i.e. in python 3 it’s a bytes object), you can just print it out without doing anything
2018-03-12T09:04:59.000568
Zack
pythondev_help_Zack_2018-03-12T09:04:59.000568
1,520,845,499.000568
38,334
pythondev
help
I already specified the encoding as utf-8 in my open(), shouldn't that be enough?
2018-03-12T09:05:34.000571
Maura
pythondev_help_Maura_2018-03-12T09:05:34.000571
1,520,845,534.000571
38,335
pythondev
help
well then you’ll want to `encode` only then as you print it out there
2018-03-12T09:05:54.000614
Zack
pythondev_help_Zack_2018-03-12T09:05:54.000614
1,520,845,554.000614
38,336
pythondev
help
this is python 3 I’m guessing?
2018-03-12T09:06:10.000138
Zack
pythondev_help_Zack_2018-03-12T09:06:10.000138
1,520,845,570.000138
38,337
pythondev
help
yeah
2018-03-12T09:06:14.000387
Maura
pythondev_help_Maura_2018-03-12T09:06:14.000387
1,520,845,574.000387
38,338
pythondev
help
yeah then having `print(f'{next_word} '.encode('utf-8'))` should be sufficient
2018-03-12T09:08:02.000350
Zack
pythondev_help_Zack_2018-03-12T09:08:02.000350
1,520,845,682.00035
38,339
pythondev
help
<@Hans> I think there's a code snippet on the bcrypt pypi page which does exactly what you're looking for
2018-03-12T09:50:50.000619
Porsha
pythondev_help_Porsha_2018-03-12T09:50:50.000619
1,520,848,250.000619
38,340
pythondev
help
```&gt;&gt;&gt; import bcrypt &gt;&gt;&gt; password = b"super secret password" &gt;&gt;&gt; # Hash a password for the first time, with a randomly-generated salt &gt;&gt;&gt; hashed = bcrypt.hashpw(password, bcrypt.gensalt()) &gt;&gt;&gt; # Check that an unhashed password matches one that has previously been &gt;&gt;&gt...
2018-03-12T09:51:22.000366
Porsha
pythondev_help_Porsha_2018-03-12T09:51:22.000366
1,520,848,282.000366
38,341
pythondev
help
just be sure to `utf-8 encode` any strings coming in from a form
2018-03-12T09:52:15.000267
Porsha
pythondev_help_Porsha_2018-03-12T09:52:15.000267
1,520,848,335.000267
38,342
pythondev
help
<@Waneta> I'm familiar with that example. Unfortunately when I tried to include the `.encode('utf8')` in my `check_password` method, my test for it failed.
2018-03-12T09:53:36.000270
Hans
pythondev_help_Hans_2018-03-12T09:53:36.000270
1,520,848,416.00027
38,343
pythondev
help
So I ended up removing it. Works for registration though. Let me give it another try and see.
2018-03-12T09:54:00.000676
Hans
pythondev_help_Hans_2018-03-12T09:54:00.000676
1,520,848,440.000676
38,344
pythondev
help
<@Hans> have you encoded both hashed pw and password input
2018-03-12T09:56:39.000577
Season
pythondev_help_Season_2018-03-12T09:56:39.000577
1,520,848,599.000577
38,345
pythondev
help
`.encode('utf-8')` should work fine
2018-03-12T09:56:51.000749
Season
pythondev_help_Season_2018-03-12T09:56:51.000749
1,520,848,611.000749
38,346
pythondev
help
Here's the error: ```hashed_password = bcrypt.hashpw(self.password.encode('utf8'), salt) AttributeError: 'bytes' object has no attribute 'encode' F. ```
2018-03-12T09:56:58.000108
Hans
pythondev_help_Hans_2018-03-12T09:56:58.000108
1,520,848,618.000108
38,347
pythondev
help
Assuming you are using Python 3
2018-03-12T09:57:01.000213
Season
pythondev_help_Season_2018-03-12T09:57:01.000213
1,520,848,621.000213
38,348
pythondev
help
if it’s a bytes object you’ll want to decode it, not encode it. although actually in this case you’ll want to do netiher maybe, and should just be able to use it as-is
2018-03-12T09:58:10.000823
Zack
pythondev_help_Zack_2018-03-12T09:58:10.000823
1,520,848,690.000823
38,349
pythondev
help
a bytes object is encoded already
2018-03-12T09:58:27.000475
Zack
pythondev_help_Zack_2018-03-12T09:58:27.000475
1,520,848,707.000475
38,350
pythondev
help
<@Zack> yes. That's why I removed the `.encode()` bit. The tests pass when I do that.
2018-03-12T09:59:05.000237
Hans
pythondev_help_Hans_2018-03-12T09:59:05.000237
1,520,848,745.000237
38,351
pythondev
help
Since the idea is that it is supposed to be receiving a password that already exists in a hashed form in `self.userdb`.
2018-03-12T09:59:52.000762
Hans
pythondev_help_Hans_2018-03-12T09:59:52.000762
1,520,848,792.000762
38,352
pythondev
help
cool, yeah should be in good shape then
2018-03-12T10:02:43.000832
Zack
pythondev_help_Zack_2018-03-12T10:02:43.000832
1,520,848,963.000832
38,353
pythondev
help
thanks everyone. Works for me :smile:
2018-03-12T10:14:53.000758
Hans
pythondev_help_Hans_2018-03-12T10:14:53.000758
1,520,849,693.000758
38,354
pythondev
help
<@Hans> actually - one thing that you might already realize but I want to make sure - you don’t “get the password” from the database and then hash it to compare with the provided values
2018-03-12T10:19:49.000752
Zack
pythondev_help_Zack_2018-03-12T10:19:49.000752
1,520,849,989.000752
38,355
pythondev
help
you should be storing the hashed password in the database
2018-03-12T10:19:55.000708
Zack
pythondev_help_Zack_2018-03-12T10:19:55.000708
1,520,849,995.000708
38,356
pythondev
help
so it’s like that, where `self.hashed_password` is the hash you retrieved from the user’s account in the database
2018-03-12T10:20:53.000791
Zack
pythondev_help_Zack_2018-03-12T10:20:53.000791
1,520,850,053.000791
38,357
pythondev
help
I recognize you might know that, and may have been including the hash step in your example code just by way of example, but just wanted to make sure that bit was clear
2018-03-12T10:21:20.000554
Zack
pythondev_help_Zack_2018-03-12T10:21:20.000554
1,520,850,080.000554
38,358
pythondev
help
lots of places end up storing passwords in plain text and then before you know it they are on <http://haveibeenpwned.com|haveibeenpwned.com>
2018-03-12T10:21:43.000538
Zack
pythondev_help_Zack_2018-03-12T10:21:43.000538
1,520,850,103.000538
38,359
pythondev
help
better safe than sorry <@Zack> :taco:
2018-03-12T10:22:24.000309
Micki
pythondev_help_Micki_2018-03-12T10:22:24.000309
1,520,850,144.000309
38,360
pythondev
help
I mean we’re all still sorry, but it’s good to also be safe. :stuck_out_tongue:
2018-03-12T10:22:56.000204
Zack
pythondev_help_Zack_2018-03-12T10:22:56.000204
1,520,850,176.000204
38,361
pythondev
help
<@Zack> that's a good catch. I didn't realize that the hash step shouldn't be included in the `check_password` method.
2018-03-12T10:23:17.000008
Hans
pythondev_help_Hans_2018-03-12T10:23:17.000008
1,520,850,197.000008
38,362
pythondev
help
yeah, basically the hash step should be in the sign up, you don’t want to store the plain text password anywhere
2018-03-12T10:23:58.000673
Zack
pythondev_help_Zack_2018-03-12T10:23:58.000673
1,520,850,238.000673
38,363
pythondev
help
But then I won't have anything to compare. So how would I check that the password is the one?
2018-03-12T10:24:28.000586
Hans
pythondev_help_Hans_2018-03-12T10:24:28.000586
1,520,850,268.000586
38,364
pythondev
help
you don’t need it to compare - note that in the `check_password` function I posted, it just compares the plain text password the user gives on logging in with the hashed password
2018-03-12T10:25:20.000150
Zack
pythondev_help_Zack_2018-03-12T10:25:20.000150
1,520,850,320.00015
38,365
pythondev
help
so you only need to save the hashed version
2018-03-12T10:25:45.000574
Zack
pythondev_help_Zack_2018-03-12T10:25:45.000574
1,520,850,345.000574
38,366
pythondev
help
and just in case all of that isn’t clear, are you familiar with something like and md5 or an sha hash?
2018-03-12T10:27:35.000660
Zack
pythondev_help_Zack_2018-03-12T10:27:35.000660
1,520,850,455.00066
38,367
pythondev
help
<@Zack> very familiar with password hashing.
2018-03-12T10:30:09.000458
Hans
pythondev_help_Hans_2018-03-12T10:30:09.000458
1,520,850,609.000458
38,368
pythondev
help
okay, cool. then yeah that’s all you need to be storing
2018-03-12T10:30:26.000710
Zack
pythondev_help_Zack_2018-03-12T10:30:26.000710
1,520,850,626.00071
38,369
pythondev
help
Unfortunately though my test now fails.
2018-03-12T10:31:02.000763
Hans
pythondev_help_Hans_2018-03-12T10:31:02.000763
1,520,850,662.000763
38,370
pythondev
help
yup, you need to get that into your `check_password` function as the hashed_password. so add the `user_password` variable as an argument to `check_password`, and then add it to the function signature, and use that in place of the `self.hashed_password` in my example before
2018-03-12T10:34:49.000775
Zack
pythondev_help_Zack_2018-03-12T10:34:49.000775
1,520,850,889.000775
38,371
pythondev
help
right, sort of like that, although I’d assume `hashed_password` is already encoded. might want to check the data type
2018-03-12T10:35:21.000021
Zack
pythondev_help_Zack_2018-03-12T10:35:21.000021
1,520,850,921.000021
38,372
pythondev
help
also note you no longer need the salt line, might as well delete that and the commented out `hashpw` call
2018-03-12T10:35:57.000500
Zack
pythondev_help_Zack_2018-03-12T10:35:57.000500
1,520,850,957.0005
38,373
pythondev
help
yeah just confirm the type of `user_record['password']` as it comes in it might already be decoded
2018-03-12T10:45:29.000419
Zack
pythondev_help_Zack_2018-03-12T10:45:29.000419
1,520,851,529.000419
38,374
pythondev
help
`"utf-8"`
2018-03-12T10:45:35.000370
Porsha
pythondev_help_Porsha_2018-03-12T10:45:35.000370
1,520,851,535.00037
38,375
pythondev
help
if so, just do an encode of it
2018-03-12T10:45:49.000099
Zack
pythondev_help_Zack_2018-03-12T10:45:49.000099
1,520,851,549.000099
38,376
pythondev
help
yeah it might be your hashed_password object
2018-03-12T10:46:56.000869
Zack
pythondev_help_Zack_2018-03-12T10:46:56.000869
1,520,851,616.000869
38,377
pythondev
help
Okay so I gotta run. Will be back in an hour or so, since this seems to require back and forth. Thanks for the help :clap:
2018-03-12T10:48:00.000101
Hans
pythondev_help_Hans_2018-03-12T10:48:00.000101
1,520,851,680.000101
38,378
pythondev
help
np, and just to confirm - the key bit here will be making sure your real data type match those of your testing data. you don’t want to be using the wrong thing in testing and trying to encode data in a test that doesn’t need to be in real operation
2018-03-12T10:49:12.000621
Zack
pythondev_help_Zack_2018-03-12T10:49:12.000621
1,520,851,752.000621
38,379
pythondev
help
i have a question? is it possible to become a programmer or a data scientist without a formal education? and if so what is the easiest way?
2018-03-12T13:35:23.000717
Remona
pythondev_help_Remona_2018-03-12T13:35:23.000717
1,520,861,723.000717
38,380
pythondev
help
Do a lot of programming
2018-03-12T13:35:55.000173
Garrett
pythondev_help_Garrett_2018-03-12T13:35:55.000173
1,520,861,755.000173
38,381
pythondev
help
Go learn stuff through online classes or by reading books/documentation
2018-03-12T13:36:08.000519
Garrett
pythondev_help_Garrett_2018-03-12T13:36:08.000519
1,520,861,768.000519
38,382
pythondev
help
i need a more specific answer
2018-03-12T13:36:35.000304
Remona
pythondev_help_Remona_2018-03-12T13:36:35.000304
1,520,861,795.000304
38,383
pythondev
help
There really isn't one
2018-03-12T13:36:44.000667
Garrett
pythondev_help_Garrett_2018-03-12T13:36:44.000667
1,520,861,804.000667
38,384
pythondev
help
Being a programmer means you program. That's it.
2018-03-12T13:36:57.000662
Garrett
pythondev_help_Garrett_2018-03-12T13:36:57.000662
1,520,861,817.000662
38,385
pythondev
help
So, go write code
2018-03-12T13:37:00.000668
Garrett
pythondev_help_Garrett_2018-03-12T13:37:00.000668
1,520,861,820.000668
38,386
pythondev
help
To get a job as a programmer, you'll have to demonstrate an ability to program
2018-03-12T13:37:17.000848
Garrett
pythondev_help_Garrett_2018-03-12T13:37:17.000848
1,520,861,837.000848
38,387
pythondev
help
yep, no shortcuts to learning
2018-03-12T13:37:18.000391
Shaun
pythondev_help_Shaun_2018-03-12T13:37:18.000391
1,520,861,838.000391
38,388
pythondev
help
what language would be the best to start learning? i dont have a lot of time....i meant what will get me employed
2018-03-12T13:37:19.000116
Remona
pythondev_help_Remona_2018-03-12T13:37:19.000116
1,520,861,839.000116
38,389
pythondev
help
Which you gain by writing code
2018-03-12T13:37:22.000704
Garrett
pythondev_help_Garrett_2018-03-12T13:37:22.000704
1,520,861,842.000704
38,390
pythondev
help
Language doesn't really matter. They're all in demand somewhere
2018-03-12T13:37:36.000441
Garrett
pythondev_help_Garrett_2018-03-12T13:37:36.000441
1,520,861,856.000441
38,391
pythondev
help
okay so which language first? and how much do i need to spend learning before again i can get a job
2018-03-12T13:37:46.000620
Remona
pythondev_help_Remona_2018-03-12T13:37:46.000620
1,520,861,866.00062
38,392
pythondev
help
If you want to get into data science, Python and R are your best choices at the moment
2018-03-12T13:37:47.000705
Garrett
pythondev_help_Garrett_2018-03-12T13:37:47.000705
1,520,861,867.000705
38,393
pythondev
help
And SQL
2018-03-12T13:37:50.000707
Garrett
pythondev_help_Garrett_2018-03-12T13:37:50.000707
1,520,861,870.000707
38,394
pythondev
help
You'll need to learn until you're proficient enough to get hired
2018-03-12T13:38:01.000093
Garrett
pythondev_help_Garrett_2018-03-12T13:38:01.000093
1,520,861,881.000093
38,395
pythondev
help
How long that takes will depend on your own abilities and what the companies you're applying to are looking for
2018-03-12T13:38:17.000246
Garrett
pythondev_help_Garrett_2018-03-12T13:38:17.000246
1,520,861,897.000246
38,396
pythondev
help
you dont think learning phyton is a waste of time?
2018-03-12T13:38:49.000499
Remona
pythondev_help_Remona_2018-03-12T13:38:49.000499
1,520,861,929.000499
38,397
pythondev
help
No
2018-03-12T13:38:59.000404
Garrett
pythondev_help_Garrett_2018-03-12T13:38:59.000404
1,520,861,939.000404
38,398
pythondev
help
Why would it be a waste of time?
2018-03-12T13:39:10.000527
Garrett
pythondev_help_Garrett_2018-03-12T13:39:10.000527
1,520,861,950.000527
38,399
pythondev
help
not a lot of companies are looking for that qualification, do you think java is a better choice?
2018-03-12T13:40:39.000440
Remona
pythondev_help_Remona_2018-03-12T13:40:39.000440
1,520,862,039.00044
38,400
pythondev
help
once you learn one language it becomes very easy to pick up a new one
2018-03-12T13:41:13.000228
Elisha
pythondev_help_Elisha_2018-03-12T13:41:13.000228
1,520,862,073.000228
38,401
pythondev
help
as the great lord raiden once said "there is no knowledge that is not power"
2018-03-12T13:41:29.000602
Elisha
pythondev_help_Elisha_2018-03-12T13:41:29.000602
1,520,862,089.000602
38,402
pythondev
help
I mean, Facebook, Instagram, Pinterest, Reddit, NASA, PBS, Microsoft, Twitter, Slack, YouTube, etc etc etc are all always hiring Python programmers, so, yeah, it's a dying language...
2018-03-12T13:41:38.000141
Garrett
pythondev_help_Garrett_2018-03-12T13:41:38.000141
1,520,862,098.000141
38,403
pythondev
help
do they hire someone from abroad
2018-03-12T13:42:06.000287
Remona
pythondev_help_Remona_2018-03-12T13:42:06.000287
1,520,862,126.000287
38,404
pythondev
help
Not to mention Bloomberg and pretty much every data science-focused company
2018-03-12T13:42:13.000297
Garrett
pythondev_help_Garrett_2018-03-12T13:42:13.000297
1,520,862,133.000297
38,405
pythondev
help
:thinking_face: Asking if learning python is a waste of time in a python slack group is bound to give skewed anwers lol
2018-03-12T13:42:15.000416
Leanora
pythondev_help_Leanora_2018-03-12T13:42:15.000416
1,520,862,135.000416
38,406
pythondev
help
haha
2018-03-12T13:42:24.000037
Remona
pythondev_help_Remona_2018-03-12T13:42:24.000037
1,520,862,144.000037
38,407
pythondev
help
Sure, most companies will hiring people on HB-1 visas. Many often have non-US-based offices
2018-03-12T13:42:31.000509
Garrett
pythondev_help_Garrett_2018-03-12T13:42:31.000509
1,520,862,151.000509
38,408
pythondev
help
what do you do if i may ask for a living
2018-03-12T13:42:49.000566
Remona
pythondev_help_Remona_2018-03-12T13:42:49.000566
1,520,862,169.000566
38,409
pythondev
help
I'm a programmer and teacher. Self-taught.
2018-03-12T13:43:03.000388
Garrett
pythondev_help_Garrett_2018-03-12T13:43:03.000388
1,520,862,183.000388
38,410
pythondev
help
how long have you been learning untill you got your first job
2018-03-12T13:43:57.000363
Remona
pythondev_help_Remona_2018-03-12T13:43:57.000363
1,520,862,237.000363
38,411
pythondev
help
what sites are best to look up for a job
2018-03-12T13:44:07.000207
Remona
pythondev_help_Remona_2018-03-12T13:44:07.000207
1,520,862,247.000207
38,412
pythondev
help
in what language do you program in
2018-03-12T13:44:14.000756
Remona
pythondev_help_Remona_2018-03-12T13:44:14.000756
1,520,862,254.000756
38,413
pythondev
help
I've been programming for a long time. Started when I was still a teenager, so that question is pretty much impossible to answer. But from when I started learning Python until I got a job focused on Python was about 2 years. I was already employed as a programmer for other languages at the time, though, so it wasn't a ...
2018-03-12T13:45:24.000848
Garrett
pythondev_help_Garrett_2018-03-12T13:45:24.000848
1,520,862,324.000848
38,414
pythondev
help
I mostly work in Python and JavaScript
2018-03-12T13:45:32.000433
Garrett
pythondev_help_Garrett_2018-03-12T13:45:32.000433
1,520,862,332.000433
38,415
pythondev
help
on which sites should i look for a job
2018-03-12T13:47:20.000273
Remona
pythondev_help_Remona_2018-03-12T13:47:20.000273
1,520,862,440.000273
38,416
pythondev
help
do you have a degree or any kind of certificate? did it get in your way that you didnt have a formal education
2018-03-12T13:49:24.000288
Remona
pythondev_help_Remona_2018-03-12T13:49:24.000288
1,520,862,564.000288
38,417
pythondev
help
I have a degree but not in CS/programming
2018-03-12T13:49:48.000032
Garrett
pythondev_help_Garrett_2018-03-12T13:49:48.000032
1,520,862,588.000032
38,418
pythondev
help
And, no, it hasn't gotten in my way
2018-03-12T13:49:54.000428
Garrett
pythondev_help_Garrett_2018-03-12T13:49:54.000428
1,520,862,594.000428
38,419
pythondev
help
what certificates are best recognised on the job market that you would recommend
2018-03-12T13:50:01.000136
Remona
pythondev_help_Remona_2018-03-12T13:50:01.000136
1,520,862,601.000136
38,420
pythondev
help
That will vary from language to language
2018-03-12T13:50:12.000595
Garrett
pythondev_help_Garrett_2018-03-12T13:50:12.000595
1,520,862,612.000595
38,421
pythondev
help
in my experience it's mostly a meritocracy
2018-03-12T13:50:16.000368
Elisha
pythondev_help_Elisha_2018-03-12T13:50:16.000368
1,520,862,616.000368
38,422
pythondev
help
Oh god no
2018-03-12T13:50:23.000209
Garrett
pythondev_help_Garrett_2018-03-12T13:50:23.000209
1,520,862,623.000209
38,423