text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
with the English language here I seem to
480.12
5.479
be saying if username and Dot in domain
482.72
5.039
as though I'm asking the question if the
485.599
5.481
username and the dot are in the domain
487.759
4.761
but that's not what this means these are
491.08
3.559
two separate Boolean Expressions if
492.52
4
username and
494.639
5.441
separately if dot in domain and if I
496.52
5.079
parenthesize this we could make that
500.08
3.6
even more clear by putting parentheses
501.599
3.88
there parentheses here so just to be
503.68
3.199
clear it's really two Boolean
505.479
2.961
Expressions that we're ending together
506.879
4.16
not one longer english-like sentence now
508.44
5.36
if I go ahead and run this python of
511.039
5.601
validate dopy enter I'll do my own email
513.8
5
address again mailin harvard.edu and
516.64
5.72
that's valid and it looks like I could
518.8
5.239
tolerate something like this if I do
522.36
4.919
mailin at just say Harvard I think at
524.039
5.36
the moment this is going to be invalid
527.279
4.481
now maybe the top level domain Harvard
529.399
4.241
exists but at the moment it looks like
531.76
3.24
we're looking for something more we're
533.64
3.72
looking for a top level domain too like
535
4.6
edu so for now we'll just consider for
537.36
5.479
this to be invalid but it's not just
539.6
6.08
that we want to do it's not just that we
542.839
3.961
want to check for the presence of a
545.68
2.92
username and the presence of a dot let's
546.8
3.279
be more specific let's start to now
548.6
2.919
narrow the scope of this program not
550.079
3.041
just to be about generic emails more
551.519
4.32
generally but about edu addresses so
553.12
4.56
specifically for someone in a US
555.839
3.281
University for instance whose email
557.68
4.399
address tends to end with doedu I can be
559.12
4.52
a little more precise and you might
562.079
3.841
recall this function already instead of
563.64
4.24
just saying is there a DOT somewhere in
565.92
5.359
domain let me instead say and the domain
567.88
6.92
ends with quote unquote. edu so now
571.279
5.361
we're being even more precise we want
574.8
3.68
there to be minimally a username that's
576.64
3.96
not empty it's not just quote unquote
578.48
4.359
nothing and we want the domain name to
580.6
5.32
actually end with doedu let me go ahead
582.839
5.161
and run python of validate dopy and just
585.92
3.4
to make sure I haven't made things even
588
3.2
worse let me at least chest my own email
589.32
4.32
address which does seem to be valid now
591.2
3.879
it seems that I minimally need to
593.64
3.12
provide a username because we definitely
595.079
3.601
do have that check in place so I'm going
596.76
4.079
to go ahead and say mailin and now I'm
598.68
4.56
going to go ahead and say at and it
600.839
4.721
looks like I could be a little malicious
603.24
4.839
here just say maen at.edu as though
605.56
4.279
minimally meeting the requirements of
608.079
3.961
this of this pattern and that of course
609.839
4.401
is considered valid but I'm pretty sure
612.04
5.44
there's no one at mailin at.edu we need
614.24
5.279
to have some domain name in there so
617.48
3.919
we're still not being quite as generous
619.519
3.481
now we could absolutely continue to
621.399
3.68
iterate on this program and we could add
623
3.76
some more Boolean Expressions we could
625.079
3.681
maybe use some other python methods for
626.76
3.48
checking more precisely is there's
628.76
3
something to the left of the dot to the
630.24
3.279
right of the dot we could use split
631.76
3.4
multiple times but honestly this just
633.519
3.481
escalates quickly like you end up having
635.16
4.88
to write a lot of code just to express
637
4.8
something that's relatively simple in
640.04
4.76
spirit just format this like an email
641.8
5.68
address so how can we go about improving
644.8
4.92
this well it turns out in Python there's
647.48
4.919
a library for regular Expressions it's
649.72
5.359
called succinctly re and in the re
652.399
4.761
Library you have a lot of capabilities
655.079
5.721
to Define and check for and even replace
657.16
5.88
patterns again a regular expression is a
660.8
4.8
pattern and this Library the re library
663.04
4.039
in Python is going to let us to Define
665.6
2.84
some of these patterns like a pattern
667.079
3.041
for an email address and then use some
668.44
4.12
built-in functions to actually validate
670.12
4.399
a user's input against that pattern or
672.56
3.92
even use these patterns to change the
674.519
4
user's input or extract partial
676.48
3.4
information there from we'll see
678.519
4.12
examples of all this and more so what
679.88
4.48
can and should I do with this Library
682.639
3.041
well first and foremost it comes with a
684.36
3.159
lot of functionality here's the URL for
685.68
4.12
instance to the official documentation
687.519
3.721
and let me propose that we focus on
689.8
3.24
using one of the most versatile
691.24
4.039
functions in the library library namely
693.04
5.599