background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]"

input logo icon
Similar videos from our catalog
|

Similar videos from our catalog

19. CS50 на русском: Лекция #19 [Гарвард, Основы программирования, осень 2015 год]
48:48

19. CS50 на русском: Лекция #19 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
2. CS50 на русском: Лекция #2 [Гарвард, Основы программирования, осень 2015 год]
1:04:15

2. CS50 на русском: Лекция #2 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
13. CS50 на русском: Лекция #13 [Гарвард, Основы программирования, осень 2015 год]
1:09:49

13. CS50 на русском: Лекция #13 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
7. CS50 на русском: Лекция #7 [Гарвард, Основы программирования, осень 2015 год]
48:00

7. CS50 на русском: Лекция #7 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
6. CS50 на русском: Лекция #6 [Гарвард, Основы программирования, осень 2015 год]
44:35

6. CS50 на русском: Лекция #6 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
3. CS50 на русском: Лекция #3 [Гарвард, Основы программирования, осень 2015 год]
50:17

3. CS50 на русском: Лекция #3 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
8. CS50 на русском: Лекция #8 [Гарвард, Основы программирования, осень 2015 год]
38:22

8. CS50 на русском: Лекция #8 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
5. CS50 на русском: Лекция #5 [Гарвард, Основы программирования, осень 2015 год]
50:23

5. CS50 на русском: Лекция #5 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
22. CS50 на русском: Лекция #22 [Гарвард, Основы программирования, осень 2015 год]
1:04:37

22. CS50 на русском: Лекция #22 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
15. CS50 на русском: Лекция #15 [Гарвард, Основы программирования, осень 2015 год]
54:13

15. CS50 на русском: Лекция #15 [Гарвард, Основы программирования, осень 2015 год]

Channel: JavaRush
Video tags
|

Video tags

сomputer science
основы программирования
cs50
cs50 на русском
cs50 javarush
18 лекция cs50
гарвардский курс
Week 9
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:00
here's a site with shawarma works
00:00:04
[music]
00:00:16
welcome to harvard for the c course with
00:00:20
fifty
00:00:23
it's now fifty the beginning of the ninth week and
00:00:25
today is george boole's 200th birthday
00:00:28
we've referred to it multiple times when
00:00:30
using boolean variables and
00:00:32
true false and gender 10 and the like
00:00:35
today would have turned 200 and google
00:00:38
gives him credit if you want to
00:00:40
join lunch with the team with fichte
00:00:42
link on the course website these guys
00:00:45
are waiting for you here in cambridge and these are in
00:00:47
new haven and for the way ken in them or
00:00:49
didn’t make the so called gif and linea
00:00:52
recent
00:00:53
flexible meeting is a format of
00:00:54
graphic files familiar to you, it looks like something like
00:00:56
that, just a sequence of
00:00:59
essence, oh well, I’m not funny to you in the sniff,
00:01:03
we didn’t have fun, in general,
00:01:05
join here at Harvard on this
00:01:08
Wednesday for freshmen,
00:01:10
second and even third year students and who
00:01:13
want go to the computer tax class
00:01:15
there will be a consultation this Wednesday immediately
00:01:17
after class at four o'clock in the
00:01:19
computer science building Maxwell Dvorkin and
00:01:21
signed up tomorrow this information will also
00:01:24
appear on the site they say there
00:01:26
will be donuts for snacks okay funny story
00:01:30
I was poking around on the Internet and found the
00:01:33
archives of my old one site May
00:01:35
it turned out to be very timely because
00:01:37
again the election race of the
00:01:39
student council was on us in the street, in general, I then
00:01:43
participated in the elections and will continue partly, that’s probably why
00:01:45
my site looked like that then for some reason it
00:01:48
seemed interesting to me
00:01:50
before explaining to the people the essence of my
00:01:52
platform the reason to vote for me
00:01:53
forcing them to click to log in and
00:01:55
get information, looking back, I
00:01:58
understand that the idea was stupid, you’re flying, I do
00:02:01
n’t know why I did it,
00:02:04
of course, it didn’t help my company
00:02:06
even by the last year, I realized I
00:02:09
had a calendar with the Muppets back then, the Muppets
00:02:12
were in fashion and maybe not, but
00:02:13
then I had a calendar with layouts and I decided
00:02:15
that it would be cool to name my Harvard network computer
00:02:17
fragman. student Harvard
00:02:21
the idea at that time we all had
00:02:23
unique host names and we could
00:02:26
choose a new,
00:02:27
more sonorous name for myself, for some reason I chose
00:02:29
the flagship, in general, I did
00:02:31
n’t take a lot of time spent on these links
00:02:33
this morning, here’s the page for myself now
00:02:36
it seems lovely, but also according to it you can see
00:02:38
how far the progress has gone, I mean
00:02:41
that 486 was a thing today, it’s
00:02:45
very, very weak, we
00:02:46
probably have things in our pockets that are
00:02:49
more powerful, there are other reasons for this,
00:02:51
so I’ll just leave this here,
00:02:53
but this was my first foray into the network, but
00:02:57
no not my first first excursion into
00:02:59
web programming, this site I
00:03:02
forgot about it, I learned how to rivet
00:03:04
repeating pictures then
00:03:05
this tile seemed impressive to me
00:03:08
hockey players football and golf balls and
00:03:11
what else for a sports site, in
00:03:13
fact this was the first web project
00:03:15
that I mastered it maybe in the second or
00:03:18
third year after graduating from ses Fichte disappeared
00:03:20
fifty van one of the next classes for us
00:03:23
looking through the archives I discovered that my
00:03:25
friend and follower had
00:03:27
rewritten the copyright to himself but
00:03:29
I should still be ashamed,
00:03:30
however then as I said a couple of weeks
00:03:33
ago it was the first site for registering
00:03:35
newcomers, your sports section of the university, in
00:03:38
general, it turned out that having such background
00:03:40
pictures was not the best idea on the web,
00:03:43
it was a new thing
00:03:44
and we were all experimenting, and that’s exactly what
00:03:46
I was doing then,
00:03:48
okay, without further delay,
00:03:49
let’s move on to the last topic, which will be
00:03:51
especially useful for you graduation
00:03:53
projects and thanks to which the World Wide
00:03:55
Web will become more understandable tired of
00:03:57
being, we get acquainted with another
00:03:59
programming language called java
00:04:01
script, which is similar to the previously
00:04:02
discussed languages, but not exactly like a
00:04:04
baby, we remember and the compiled language
00:04:07
is run through the compiler, it
00:04:09
converts the source code into object code, that
00:04:10
is, units and zeros and ones and zeros
00:04:13
that understand your cp, aka the
00:04:15
central processor php, on the contrary, is not
00:04:18
compiled and what is the interpreted
00:04:23
language the
00:04:24
program interpreter reads it
00:04:25
from top to bottom from left to right and calculates
00:04:27
what your syntax means and should do
00:04:29
if there is a conditional loop or some other
00:04:32
program for the manual here what is an interpreted
00:04:35
language there is nothing there we studied html
00:04:38
html is not even a programming language as they would
00:04:40
call mine a
00:04:41
markup language this fancy term
00:04:44
means that there are no programming
00:04:45
constructs even like those we saw
00:04:47
meetings there
00:04:48
are no loops there are no conditions this language can
00:04:50
only arrange data format
00:04:52
them and how - then streamline
00:04:54
disappeared with also not a programming language; it
00:04:56
serves even more aesthetics; it allows
00:04:58
fine-tuning of
00:05:00
font size, color, and relative
00:05:02
position; then there was a sequel; a sequel, after all, a
00:05:05
kind of
00:05:07
programming language, although tailored
00:05:08
specifically for a database, we studied
00:05:10
only the operations of selecting, inserting, deleting,
00:05:13
changes and a couple more, but even they
00:05:15
allow you to write the so-
00:05:17
called functions and procedures that are
00:05:19
similar to the functions of php and sie ins,
00:05:21
remember that they exist because we won’t
00:05:24
bother with them, that’s enough for now
00:05:26
and in general, you see the acquaintances and here’s the
00:05:29
latest java-script of the languages ​​with
00:05:31
which we will get acquainted java-script who is
00:05:34
already an interpreted language who is in the subject
00:05:36
tell me what features distinguish it from and
00:05:39
stove what is the difference I did
00:05:42
n’t hear it is not compiled, that is, it is
00:05:46
interpreted they are compiled,
00:05:48
which means it is similar to the Pirlo kitsch stove and
00:05:50
yet it is strikingly differs from the stove
00:05:52
at least in terms of using the new product,
00:05:54
yes it usually works on the client, that’s the
00:05:58
distinguishing feature for us at this
00:06:00
stage, everything worked on the server in the sense
00:06:02
that we did everything with a recess of fifty
00:06:04
thousand and until now it also worked on the
00:06:06
server because it interpreted,
00:06:08
not compiled, but interpreted in the
00:06:10
ses editor, which is a
00:06:12
server or a group of servers in the cloud,
00:06:14
why is it a java script, even if you start
00:06:16
writing in it as part of the 8th medical problem book,
00:06:19
and maybe you
00:06:21
will write final projects in the ses fifty editor and
00:06:23
save files in it
00:06:24
but it is not a cloud server and where it is
00:06:27
located will not interpret and
00:06:29
execute your code; instead, it
00:06:32
will be transferred unchanged to the browser
00:06:34
and Explorer or Chrome or Firefox
00:06:37
or Safari or something else will interpret
00:06:40
it from top to left to right the whole Andy is so key
00:06:43
The difference today is that java script
00:06:45
on the client is a pretty penny, for example on the server,
00:06:48
and there is also a catch from the point of view of
00:06:51
intellectual property in
00:06:53
who can see your code. Indeed, you
00:06:56
can go to the Internet and find almost
00:06:58
any code written in java script,
00:07:00
sometimes it is legible sometimes it’s worn out, we
00:07:03
’ll come back to this later, in general, the syntax of
00:07:07
java script, to our delight, is all similar to
00:07:09
C and like a stove there is no main function in it
00:07:13
you want to write code in java script
00:07:15
today you’ll learn how easy it is to get started, we
00:07:19
’ll see that it’s especially good for
00:07:21
web browsers small correction for
00:07:23
today, now you
00:07:25
can increasingly use java script on the
00:07:27
server using a sophisticated platform, but
00:07:29
this is how some applications with
00:07:32
fifty-fifty are written are written, but in
00:07:35
our course we will study javascript on the
00:07:37
client side, this is how
00:07:40
the conditions on the stove are written, excuse me although this is
00:07:43
also correct, they also look like a
00:07:46
java script in terms of syntax, it is identical to c
00:07:48
and php, the
00:07:49
Boolean expression is syntactically the same,
00:07:52
all the shoulder stoves and
00:07:55
java-script switch statements are the same here we have
00:07:58
similar loops for a while and duvall
00:08:01
and here are the differences in the stove there was a construction
00:08:04
for each, perhaps you came across it in the
00:08:07
orgy of the seventh java script problem books, there is
00:08:09
also a special version of it literally for work in
00:08:12
reality in firing travel, which in short I
00:08:15
mean when I have an object for them
00:08:18
and we’ll come back soon and I want to go through
00:08:21
all its pairs key-value I don’t
00:08:24
need to come up with digital indexing for them
00:08:26
0
00:08:27
123 I can say this directly and for
00:08:30
each iteration the java script instead of me
00:08:32
assigns numbers to the keys in order
00:08:35
first next and so on and I can
00:08:37
get to its value of the java
00:08:40
script work with an object width you’ll see as with an
00:08:43
associative array with a php
00:08:45
stove and so, if you finally
00:08:47
figured out what the
00:08:49
associative array of a
00:08:50
stove is, you can still assume that a
00:08:53
java script object is the same thing, although not everything is
00:08:54
so simple, the arrays here are very similar to a
00:08:58
stove,
00:08:59
but without one sign there is no there is enough of
00:09:02
something that was in the oven last week and there is
00:09:04
not a dollar sign, which means we are
00:09:08
back in the ordinary world where variables are
00:09:10
devoid of banknotes, but usually
00:09:12
they are preceded by a var var you reblog means
00:09:15
a variable and also in the oven there is weak
00:09:17
typing, that is, the data type is
00:09:20
integers floating point numbers strings and
00:09:22
so on java-script they also have its
00:09:25
weak typing is that
00:09:27
we programmers do not need to clarify
00:09:29
enough to know that these types are ips
00:09:31
existential, therefore a variable like this we
00:09:34
can declare string hello world
00:09:37
pay attention to everything as in stove but without a
00:09:39
dollar we will meet with this more than once
00:09:42
today here is an object with keys and
00:09:44
values ​​as you noticed compared
00:09:46
to last week the syntax is a little
00:09:47
different take a closer look am how many keys does
00:09:50
this object have you think 4 and in your opinion two are
00:09:57
actually 2 a
00:09:58
set of two key-value pairs key
00:10:01
called symbol its value fb
00:10:03
key called price its value 100
00:10:06
153
00:10:07
and that two key-value pairs remember the
00:10:10
stoves again small differences in syntax
00:10:12
nothing particularly smart interesting in the stove the
00:10:15
same thing would look like this
00:10:17
quote equals this and changing to
00:10:19
square brackets to another then I
00:10:22
change this to the word price in quotation marks and also
00:10:25
remove: what I used last
00:10:28
week before equal and more conditional
00:10:31
arrow to the same thing here and the same
00:10:35
thing here that’s all if it’s not
00:10:38
in my memory yet nothing
00:10:40
scary because it’s really
00:10:41
not interesting, it’s just differences in
00:10:44
syntax, the essence is completely, even inside the
00:10:46
java script quotes variable
00:10:48
there is a collection of key-value pairs,
00:10:50
one of which is symbol and 2 price
00:10:53
to get to these values
00:10:54
we use this syntax and like in the
00:10:57
oven I could would
00:10:58
like let's increase this a little oh hour
00:11:02
like from the stove I could without a damn but just
00:11:09
like in the stove
00:11:11
okay we'll use notes like in
00:11:14
pete's stove you can enter the dollar
00:11:16
quote symbol and get the value of the
00:11:18
variable symbol and java script everything is
00:11:21
similar I can do it’s so easy to
00:11:24
remove the dollar sign, so we’re lucky, there’s
00:11:27
very little new syntax, let
00:11:28
’s focus today on some
00:11:31
ideas and applications, the first
00:11:33
application you’ve already seen is written if
00:11:35
you looked at the 7 problem book, it looks
00:11:37
like this, this problem book, even if you
00:11:39
haven’t opened it yet, contains a config file.
00:11:42
Jason that is, java-script object
00:11:45
Natasha's object annotation at mother-in-law's why
00:11:49
we decided to provide you with a sample in
00:11:51
key-value pairs
00:11:53
and here in the list the tail and server name are indicated
00:11:55
and a placeholder is also provided
00:11:57
for both your
00:11:59
username and your password
00:12:01
if you haven’t seen this yet don’t worry,
00:12:03
there is still a manual for the seventh
00:12:05
problem book; of course, you will need to
00:12:06
replace the work,
00:12:07
because at the entrance to the editor, the lucky one
00:12:09
each has his own login and password; we could
00:12:11
use here more than half a dozen
00:12:13
other formats; we could use
00:12:15
the file. text or with vip-file
00:12:17
or for example a.n. ai file xml file and
00:12:21
a bunch of other abbreviations that you haven’t even
00:12:23
heard of by and large this is a random
00:12:25
choice but the text format is especially popular today
00:12:27
Jason
00:12:29
java-script firing Nataysha this is it
00:12:32
he looks unclear but look at the
00:12:34
patterns at the beginning the opening curly
00:12:36
brace at the end the closing inside there is
00:12:38
some content of a
00:12:40
key-value pair, that is, now we
00:12:42
see on the screen an object that has one
00:12:45
key and one value, if we proceed from the
00:12:47
already familiar templates where the key is the
00:12:49
database, that is, what is to the left of :
00:12:53
it turns out that this time the value is
00:12:56
several the lines for the purpose
00:12:58
begin and end with a curly
00:12:59
brace, what type do you think the
00:13:01
value of the database is a dictionary or, more simply
00:13:07
put, an object is a data type
00:13:09
that can
00:13:10
contain other types within itself, and so
00:13:13
if this is all called an object and an object
00:13:15
means a set of key-value pairs that
00:13:17
value database is an object
00:13:20
value database is a whole bunch of
00:13:22
key-value pairs the first of them is host
00:13:24
then name then username password
00:13:27
each of these values ​​is nothing more than a
00:13:29
string in double quotes if everything is still
00:13:32
not completely clear but remember that this is
00:13:34
just a boring template a method of
00:13:36
standardized storage of information,
00:13:37
but you can often make mistakes in
00:13:40
small things even in the seventh problem book if, for
00:13:42
example, you accidentally skip here, and the
00:13:45
model will lead to the fact that the file
00:13:46
most likely will not run and if you
00:13:48
accidentally miss the quotes it
00:13:50
will not run so the format is quite
00:13:51
capricious but very common and you
00:13:54
will use it even if in general
00:13:56
java script is not used in the seventh
00:13:58
problem book, remember this diagram in
00:14:02
html well, we said the code may look like this,
00:14:05
it’s just a hallow hunger to catch
00:14:06
written in markup language would be there,
00:14:09
but then we decided that we can
00:14:10
consider it like a tree,
00:14:12
the structure on the left, which we
00:14:14
formatted for ease of perception,
00:14:16
can be represented in the form of such a
00:14:18
tree; your special root element,
00:14:21
which we will call in the general word document,
00:14:23
underneath it is the root html element, or because.
00:14:26
html
00:14:27
which has two child elements, a
00:14:29
header and a body, in which the header has a
00:14:32
title, the title has a text value and the
00:14:34
body also has a text value,
00:14:38
if it’s more convenient for you, you can
00:14:41
draw such a diagram under this html code, this is a great
00:14:44
idea, a different model
00:14:45
because now that we have a java
00:14:47
script a programming language that
00:14:49
the browser can execute
00:14:51
and interpret for you, it
00:14:52
turns out that through code we
00:14:55
can start managing this
00:14:56
data tree in memory, personally, I need to build a
00:14:59
tree in memory, we don’t need to create
00:15:01
complex data structures like in the fifth
00:15:03
problem book, the browser loves to
00:15:05
interpret html from top to bottom from left
00:15:07
to right and without any extra effort on our
00:15:09
part, it gives us a kind of pointer
00:15:11
to this tree, it does all the dirty
00:15:13
work, that's how it takes care of mozilla
00:15:16
apple and others with the help of a java script, we
00:15:20
will be able to manage changes and do many other
00:15:23
interesting things with this tree,
00:15:25
also known as the house object model
00:15:28
document
00:15:29
what exactly to do, it turns out that the java
00:15:32
script has a long list of possible
00:15:34
events in the hotel, we didn’t remember this
00:15:36
term from week zero from problem book 0
00:15:39
when we talked about scratch, probably
00:15:42
few of you used the event in the
00:15:44
scratch project my way, but maybe you
00:15:46
remember a simple example with Marco Polo where
00:15:48
there were two sprites, one of which was
00:15:51
Mark, who spoke, and the second, having heard this event,
00:15:53
responded to Paul, if you don’t remember the recordings will help you,
00:15:56
but this is just a way of saying, and the essence of these
00:15:59
listeners is clear from their name. java
00:16:01
script gives us a way to
00:16:03
listen to how the mouse moves down or
00:16:05
up again. a key is pressed, a
00:16:08
key is released, how the form is submitted,
00:16:10
selection and resizing occurs,
00:16:12
otherwise they say for any action
00:16:14
that the user can perform and
00:16:16
does every day,
00:16:18
there is a code in the browser that will track it
00:16:21
and react in a certain way to the crowd,
00:16:23
for example, you use google maps,
00:16:25
what will happen if you click on the button and
00:16:27
drag click and drag with the mouse and you
00:16:34
map to a point on the map will begin to move and
00:16:37
you can look at
00:16:38
what is here and what is there and how Google
00:16:41
implemented it. I assume that they
00:16:43
use a couple of event listeners,
00:16:45
one of which monitors the mouse click
00:16:47
when the user needs a
00:16:48
treatise or a mouse button and then we
00:16:50
begin to monitor something like
00:16:52
movement or another event that
00:16:54
conveys to us movement movement,
00:16:56
by the way, also got into this long list of
00:16:59
possible options, it turns out this is a powerful
00:17:01
mechanism for responding to
00:17:02
user actions even before he or she
00:17:05
clicks something obvious like
00:17:07
confirm we will have to go through a couple more
00:17:09
topics to figure this out but for now
00:17:12
let's move on to the actual code
00:17:13
open to 0 this is a very simple example let's
00:17:18
zoom in to see the
00:17:19
elements and I'll type my name David and
00:17:23
5 help I'll click confirm and here a
00:17:26
clumsy popup window pops up
00:17:29
that says hi , David
00:17:31
this like that hello world that we
00:17:33
used to write taxis and even on the stove
00:17:36
since I dynamically substituted my name, I
00:17:39
can substitute someone else’s name, I just change
00:17:41
the text to khan and click confirm and the
00:17:43
window changes pop-ups on the
00:17:47
Internet they really abuse it because of
00:17:49
this in due time Blockers came into fashion
00:17:50
because certain
00:17:52
sites of probably dubious content
00:17:54
began to flood your screen with packs of
00:17:57
pop-up windows. In general, this ability
00:17:59
to put
00:18:00
windows in the foreground was not very
00:18:02
welcoming and was accepted by humanity, which is
00:18:04
why you see a warning here
00:18:06
that spoils the picture so much,
00:18:08
we’ll have to look for it to communicate with
00:18:09
the user there is another method, but for now it
00:18:11
will work anyway, the whole part is purely intuitive, that’s
00:18:14
what’s happening here and I click
00:18:18
confirm, it’s called some event, it’s obvious
00:18:20
what’s missing from the material
00:18:23
last week when I clicked
00:18:24
confirm what’s not on the screen again
00:18:30
reboot ural I haven’t changed he said
00:18:33
that they were loading the house, but it was still a
00:18:35
house, but actually we had to go
00:18:38
to a different url address, but something like
00:18:39
a register. stoves,
00:18:41
but even if I close the window by clicking ok,
00:18:44
look and rl remains, but let's say if
00:18:47
I doubt that I can open chrome,
00:18:49
I open the network tab, we see it is empty,
00:18:52
I confirm to Maria, you see there is no
00:18:54
data transmission over the network, absolutely no
00:18:57
http, and so if we look at the source
00:19:00
code let me close this window and go
00:19:02
to the source,
00:19:03
it’s interesting, it looks like new tags have appeared here,
00:19:05
including violin, let’s
00:19:07
look in the ses fifty editor what I
00:19:09
sent to the user, here it is, look
00:19:12
only at the html mud of the moon, this is the second
00:19:14
half of the file house 0. html you see
00:19:18
the title here so at least so body so forms so the
00:19:21
differences are immediately obvious,
00:19:23
especially if you have not written in
00:19:25
java script before, scroll a little to the right
00:19:27
here so input and another input for
00:19:30
confirmation and also a little
00:19:33
unusual, but we met with this in
00:19:36
css what is absolutely new has changed, yes here he is the
00:19:40
view
00:19:42
after the demo yes great, then it’s not clear and
00:19:45
where it says submit, see what’s
00:19:48
next it’s called an attribute according to
00:19:51
html terminology its meaning this
00:19:54
line in quotes at first glance
00:19:56
looks strange it’s not html it’s not piss
00:19:59
then how you guessed it, the sting of the script
00:20:01
seems to be that the web page has a built-in function
00:20:03
called grid greeting I come
00:20:05
to this conclusion because after the word
00:20:07
grid there are parentheses and ; everything looks like a
00:20:10
function and a function in php, of course
00:20:13
this is a java-script function, it returns
00:20:15
false, we will return to this now, but where is
00:20:17
the definition of the function, let’s scroll to the top of
00:20:19
the file, this line despite the
00:20:22
length without causing any difficulties, I’ll zoom out a little, pay
00:20:25
attention to these four lines java
00:20:27
script, like in a beer stove, literally
00:20:29
write the words function, give a name
00:20:31
because there are brackets with arguments, but in
00:20:33
this case, without arguments, java script,
00:20:36
like in a stove, there
00:20:37
is no return value, everything is not
00:20:39
as strict as
00:20:40
we open and close curly braces
00:20:42
java script has a built-in function not
00:20:45
recommended under the name and ice
00:20:47
which exists solely to
00:20:49
show the terrible pop-ups
00:20:51
that we have seen so far it’s all hard
00:20:53
to digest what’s going on here let’s
00:20:56
parse the string piece by piece oh like this is the
00:20:59
only arch
00:21:00
ment of the alert function and what it gives us is similar
00:21:03
to a regular string it turns out to be
00:21:06
unlike stoves and squeezing Oscar, sorry,
00:21:08
unlike php and at sea
00:21:10
java script, it doesn’t matter what to use
00:21:12
single or double quotes, the essence does not
00:21:14
change, to be honest,
00:21:16
java script programmers for some reason prefer
00:21:18
single quotes, a matter of taste, we could
00:21:20
instead put double Lewis quotes to the
00:21:22
block here lus is a new symbol for us,
00:21:24
who has encountered this before, what does
00:21:26
plus media and concatenation mean, we
00:21:32
saw this in the nickname
00:21:34
php operator. glues two lines together,
00:21:36
this is all a real pain in the sixth
00:21:38
problem book, remember it was Moroccan
00:21:40
construction, the functions of a line were combined
00:21:42
after allocating memory on the stack or on the
00:21:44
heap,
00:21:45
such dances with a tambourine just to
00:21:46
connect for a line in Omsk, everything is just
00:21:49
enough to put pluses between them for the
00:21:51
most difficult thing we have here here because
00:21:54
at the end of this line I just add !
00:21:57
so if we had people popping up in the windows and Lu
00:21:59
David Heal at Khan Solo Maria and the
00:22:02
like, it’s clear that this piece of
00:22:05
code between two pluses should give me
00:22:07
access to what’s asking here, well,
00:22:16
let’s pretend that I heard the answer the name
00:22:18
these names popped up in the window that’s all this
00:22:21
means, as I said when analyzing this
00:22:24
scheme, the so-called house has a special
00:22:27
root element at the very top, the moment they are
00:22:30
afraid of the documents,
00:22:32
now it turns out that this is a special
00:22:34
global java script variable in
00:22:36
which a lot of useful
00:22:38
functionality is hardwired days of useful functionality
00:22:41
includes the ability to access
00:22:43
any child node,
00:22:45
that is, all these squares and
00:22:47
rectangles and ellipses are those same
00:22:50
nodes, it turns out that in the
00:22:53
document object in java script there is a function
00:22:56
or, in other words, a method called get
00:22:59
element buy ID
00:23:01
for calling a java script function from an
00:23:03
object from
00:23:05
or a variable is used. we saw
00:23:09
lac all this syntax tract jussi seventh
00:23:12
problem books something similar with fifty : : : :
00:23:18
php one of the ways to call a function without
00:23:21
inside an object java script is coping with this so far
00:23:23
.
00:23:24
and this function, as it were, kindly tells
00:23:26
us what it does, produces an element by its
00:23:29
go one element is just an
00:23:31
alternative name of a tag or node in
00:23:33
the house, that’s all, get an element by
00:23:35
ID name means
00:23:37
here is my html based on this code which
00:23:41
node or html tag Ilya programmatically I'll get it
00:23:44
if I call the document.
00:23:48
get element your id yes, I’m sure
00:23:52
I’ll get the value from the element whose id
00:23:54
name is in quotes so in this case
00:23:56
it’s the get element b go function, as it were,
00:23:59
returns us a pointer to a specific
00:24:01
node in the tree
00:24:02
we didn’t draw the tree itself, but it’s the
00:24:04
same as getting this
00:24:06
rectangle or that rectangle
00:24:08
by accessing it by a unique
00:24:10
identifier what is the benefit of this it
00:24:13
turns out that when you reach
00:24:15
this node of this rectangle on the diagram
00:24:18
but it in turn gives you a whole
00:24:21
stack of data properties or
00:24:24
key-value pairs
00:24:25
one of the keys called target
00:24:27
value or it’s not easy to
00:24:29
explain this, but in the end the only
00:24:31
goal is to get a
00:24:34
string entered by
00:24:36
the user from this hierarchy, something I don’t like here,
00:24:39
or rather, some things still raise
00:24:41
questions, let’s say it all works, but
00:24:44
why do you think I’m returning false when
00:24:46
calling grid it looks weird
00:24:49
because there are two expressions separated by
00:24:50
semicolons guess
00:24:53
if I remove the return value what
00:24:56
will happen what do you think dough instincts play
00:24:59
you could repeat a
00:25:02
bunch of windows will open perhaps something could
00:25:05
happen and what else should I
00:25:07
send the request to to the same page
00:25:12
to the same page is already closer to the truth,
00:25:15
although unlike previous examples I did not
00:25:18
specify the action attribute, which is for
00:25:20
this dinner, but it turns out it is there by default
00:25:23
where specifying action is the same as
00:25:25
putting empty quotes or the name of the
00:25:28
file itself in this case home 0 . html this is
00:25:32
kind of implied what will happen
00:25:35
if I don’t do this I save it
00:25:37
here I removed it return false open the
00:25:39
example again and update it you probably
00:25:41
noticed I always advise roosting
00:25:44
fifty discos if something works crookedly
00:25:46
and the browser behaves strangely quite
00:25:48
simply hold shift and shout update
00:25:50
this will reload any file and without
00:25:52
using cached data or
00:25:54
copies from memory
00:25:55
and now I open one spectrum
00:25:59
network tab and check the save
00:26:02
log box because I don’t want the
00:26:03
lines to disappear as soon as I
00:26:05
go somewhere open in now I I’m typing here and do
00:26:08
n’t press confirm, perfect,
00:26:10
everything seems to be according to plan,
00:26:11
written by Holo Andy, I press ok, interesting,
00:26:14
look, the page has been updated, it’s back to
00:26:17
the home page, but the url has changed a little, and it
00:26:19
appears at the end? a standard sign
00:26:22
that we confirmed the data and below,
00:26:24
for greater clarity,
00:26:25
we see an http request and response with status
00:26:28
200 brought me back here,
00:26:30
but that’s not what we need, really, I don’t
00:26:32
want to reload the entire page, instead it’s
00:26:34
better to return false to shorten the
00:26:36
standard browser algorithm, the essence of
00:26:38
which is to reload
00:26:40
page,
00:26:42
I suggest you look at a more serious example,
00:26:44
this is a house version 1, look here, it’s not
00:26:48
scary if you don’t enter individual
00:26:51
lines of code, but what is the fundamental
00:26:53
difference between this implementation, we’ll agree that
00:26:56
it works the same way, the result doesn’t
00:26:58
change, what I did differently, the object
00:27:06
is placed inside the script, the function is defined before
00:27:17
is defined differently, in
00:27:19
other words, it is not in the form tag in the
00:27:22
seventh line, that is, in 8 there
00:27:25
is no longer the attribute it submits,
00:27:27
but in the previous example it was and then I
00:27:29
described the code right here at the end I said
00:27:32
it will return false and if that hasn’t confused you yet it
00:27:35
should also soon be like it was with
00:27:38
html
00:27:39
when we started combining it with s in the
00:27:42
style attributes, confusion immediately began
00:27:44
and doubts arose here, the same thing
00:27:47
if you write html code and then throw a
00:27:49
java script thread into it in the form of a string in
00:27:52
quotes, it will be difficult to maintain it, that’s how it
00:27:55
started In general, it’s not clear to do a
00:27:58
java script somewhere,
00:27:59
so from the point of view of good
00:28:00
design it would be nice to separate html and
00:28:03
java script to ride for this here we
00:28:05
did it like this, we used
00:28:07
html only for markup alma anthology
00:28:11
version 1 I only have this and forms with a
00:28:14
unique ID and here below I
00:28:17
used a special java
00:28:19
script functionality that gives me a so-called
00:28:21
anonymous function that turns out to be if I
00:28:24
call the document.
00:28:26
get element buy a and d for the house Nikita,
00:28:29
as it were, I’ll get a pointer to this
00:28:31
tree node on the so-called Tesla form,
00:28:34
let’s put it down, I know a little html or
00:28:36
I read on the net that the form element
00:28:38
is supported by a whole bunch of listeners,
00:28:40
in other words, an infinite list of
00:28:42
long, which we saw a little earlier
00:28:44
commander I know from reference books that he
00:28:46
himself does not have a suitable listener and hall for the
00:28:49
form element about Athos. If I know this, then I
00:28:54
can do this like this: take this
00:28:56
tree node of the form element and access
00:28:59
its property, it is jointly hit. it
00:29:02
just means that this property is like a
00:29:04
special value inside it
00:29:05
and what data type do I assign to the property
00:29:08
it submit which is actually a
00:29:10
variable in this tree node time tea
00:29:14
this is a field inside the structure what
00:29:18
data type it has before this function cf it turns out
00:29:21
there is such a thing in the oven and although we didn’t
00:29:24
everyone tell you that there are also pointers to
00:29:26
functions, that is, the ability to assign
00:29:28
functions as values ​​of variables,
00:29:31
but we will not return to C for now
00:29:33
we will assume that here on the right, although it
00:29:36
sounds strange, they
00:29:37
say and took
00:29:39
give me a function, I won’t even
00:29:42
come up with a name for it because what I’m going to
00:29:44
attribute, let’s call it the address directly to
00:29:47
it’s submission, in other words, the browser, you
00:29:49
don’t need to remember how this function works,
00:29:52
you just need to know where it is
00:29:53
in memory, so you can put an
00:29:56
equal sign here and not bother with the
00:29:58
name of the types y or flu or something
00:30:01
else. here it’s just a question of design I
00:30:04
can move the curly brace excuse me
00:30:06
to the next line as usual all
00:30:09
swift but in java script they usually leave the
00:30:12
opening curly brace on the same
00:30:14
line
00:30:15
then nothing interesting the opening
00:30:18
curly brace just marks the beginning of the
00:30:19
function the function is the same only I
00:30:21
inserted return false inside the function
00:30:24
because it turns out that you can
00:30:26
only find out about this in reference books,
00:30:28
that if the function that you assign to
00:30:30
the handler, it sorbitol returns false,
00:30:33
the browser knows that there is no need to send
00:30:35
the form to the server, but if it returns
00:30:38
true, thin and send to exit and soon
00:30:41
we will figure out why I. a comma after the
00:30:43
second curly brace means I’ve finished
00:30:45
describing the function, it knows what to do as
00:30:47
soon as you get confirmation good
00:30:51
replay but it still looks clumsy
00:30:54
what else can we do it
00:30:56
turns out version 2 is the last one
00:30:58
let’s look at it am we risk ruining everything further
00:31:02
but it turns out there is such a
00:31:04
library as jack believe DJ to believe the
00:31:07
mega-popular java script library
00:31:09
so much so that many people generally
00:31:12
confuse jack believe java-script why the
00:31:14
java script itself is too
00:31:16
verbose my document.
00:31:18
get element buy ID blah blah blah blah blah
00:31:21
blah it turns out to be a very long code but an
00:31:24
eccentric named John Resik who now
00:31:26
works in one startup but created the
00:31:28
Jack Vere library quite a long time ago
00:31:30
by Ekimov and many have since contributed to it
00:31:34
so its syntax is a bit has changed
00:31:37
look here
00:31:38
you will definitely have to deal with this
00:31:40
if you take on the
00:31:42
final web project this is an alternative
00:31:45
way of writing functions too with the help of
00:31:47
this
00:31:48
swelling of water we won’t chew
00:31:50
each line just highlight a couple of
00:31:53
templates and how many anonymous functions or nameless functions are there in this code fragment
00:31:59
functions o
00:32:00
or lambda function 2 yes, this is clear even
00:32:05
if you are still swimming in the topic because the
00:32:07
word function with parentheses
00:32:08
occurs twice and so what does this code
00:32:10
do people and in the future we will also
00:32:13
call on the online reference book for help
00:32:15
now this simply means that when
00:32:17
the document is ready you need to register the
00:32:19
following function as a handler
00:32:20
it submits for html elements of the IDID and
00:32:24
when everything is done you need to call these two
00:32:27
lines of code and that, unfortunately, is an even
00:32:30
longer way to return false we
00:32:32
have we are talking about this because you
00:32:34
will see such code on the network and don’t be afraid of it,
00:32:36
just understand
00:32:38
that java-script is a common
00:32:40
paradigm, that’s why I’m showing it to you,
00:32:43
okay, let’s not dwell on this
00:32:45
syntax, do you have any questions
00:32:47
or thoughts about this example, okay,
00:32:52
let’s try to put it into
00:32:54
practice aubade throw it a web
00:32:56
page that just says hi
00:32:58
doesn’t cause anything interesting doesn’t strike the
00:33:00
imagination it won’t be much
00:33:02
prettier but at least useful let’s go back to the
00:33:05
folder and open say pin-up forms 0 .
00:33:08
html let this be a country with
00:33:11
registration in the sports section of the university
00:33:13
without any styles and design, I want to
00:33:15
register here, enter a password,
00:33:17
I’ll go straight to the conditions and click registration and
00:33:20
the site will say you are registered, but it doesn’t
00:33:22
quite seem to work, but
00:33:25
let me update
00:33:26
and now I’ll write no
00:33:29
you don’t need my real address, but I’ll just write here Malon,
00:33:33
let it be one two three 4 5 and now,
00:33:38
just because I’m a fool, I’m posting here one
00:33:41
two three 4 5 6 7 8 9 and I won’t put
00:33:43
a check mark like that, yes, there’s something to
00:33:47
work on here like you know or find out all the
00:33:49
God problem books you can write code and you
00:33:52
will have to write code in PHP protected from
00:33:55
such user errors because the
00:33:57
user is not always ready
00:33:58
to cooperate
00:33:59
he may not provide all the necessary
00:34:01
information or give it in the wrong format the
00:34:03
amount of these 7 problem books you will see that
00:34:06
you can set several conditions so that the
00:34:07
email address is in the style of
00:34:09
username doggy something. idea, and
00:34:12
if not, then you can apologize to the
00:34:14
user, as in the seventh problem book,
00:34:15
or if the box is not ticked, and
00:34:18
this can also be tracked, and of course, if they do
00:34:20
not match in role, as in the register.
00:34:22
oven in front of the father of the problem book and this can be
00:34:25
detected, but the ambush is that we need to
00:34:27
go all the way to the server to inform the user
00:34:29
about the error and if we don’t use a more
00:34:31
cunning technique, he will have to click on the
00:34:33
back arrow
00:34:34
no longer true, it would be better like on
00:34:36
modern sites so that the program
00:34:37
responds faster immediately, in other
00:34:40
words, let's move on to version 1, although
00:34:42
it will not be a move, that is, it is not better, but
00:34:45
at least it already has such
00:34:47
functionality million times two three 4 5 times two
00:34:50
three 4 5 6 7 8 9 I
00:34:51
don’t check the box registration password do not
00:34:53
match and although the pop-up window is crooked,
00:34:56
over time we will replace it with something like
00:34:58
bootstrap, and you will see in the seventh problem book
00:35:00
this is a popular library, we have already noticed
00:35:02
that the passwords do not match,
00:35:04
okay, I will correct it on behalf of the user,
00:35:06
say one two three 4 5 time two three 4 5
00:35:09
again I don’t accept conditions you must
00:35:12
accept the conditions of the thing with but why and puede
00:35:15
I have already stated that there is a way and we even
00:35:18
asked you in the seventh problem book
00:35:20
to detect such errors on the server side
00:35:22
so why should I do the same in
00:35:25
java-script here are the arguments in favor of the
00:35:28
fact that here you will see it will complicate everything even more
00:35:31
and maybe there aren’t any there
00:35:39
are options that may be
00:35:45
interesting a possible vulnerability of course
00:35:48
if you are not going to process
00:35:49
erroneous user data it may be
00:35:52
better so that they don’t get to your
00:35:54
server at all return everything back they say
00:35:56
fix the problems first
00:35:57
rightly more options not unlimited,
00:36:01
right, this code, as we have already said,
00:36:03
is interpreted on the client, it does not
00:36:05
reach the server and therefore does not affect the
00:36:07
load on the server capacity while we are
00:36:09
having fun here, this is not so important,
00:36:12
I only have one user here for now, but
00:36:14
if this is a decent-sized site or
00:36:16
one of the large ones like Facebook,
00:36:17
the more people you keep on the
00:36:19
server, the better because the server,
00:36:21
of course, has a limited supply of
00:36:23
RAM, a limited number of gigahertz, a
00:36:25
limited number of actions per
00:36:27
unit of time delta, so the more
00:36:29
people in the world who knock on your
00:36:32
server and have the wrong Latin alphabet, the better
00:36:34
the server will save you from this loading,
00:36:36
besides, especially for mobile devices,
00:36:38
if you log in to us May Harvard or
00:36:40
Yale there is no ID such sites load
00:36:42
late so it takes a
00:36:44
whole second or even 2 and then oh my God
00:36:47
if you misspelled you will have to
00:36:48
click back and that’s it at first, in general,
00:36:51
there will be a delay, especially if the
00:36:53
Internet connection is poor,
00:36:54
even if it’s a java script that
00:36:56
runs on the client and therefore shouldn’t
00:36:58
run back and forth when the connection is bad,
00:37:00
we get feedback almost
00:37:01
instantly
00:37:02
and now we go here, open form 0 and
00:37:05
look at the html and just Let's read that
00:37:09
here this is a form element whose action is equal to
00:37:12
resistor. stove
00:37:13
I use get to see believed but
00:37:15
for passwords we would of course change it
00:37:17
to fluorine and here is an input field of type text
00:37:20
another input field of type password and and here
00:37:23
you may not be familiar with an input field of
00:37:26
type checkbox but this is not java-script
00:37:28
it’s just html which opens the file
00:37:31
g-star. oven at the
00:37:32
obverse
00:37:33
one where the windows were popping up what's
00:37:35
going on there version 1 which I'll
00:37:38
open now I thought I had enough words but
00:37:42
it seems they've run out version 1 version
00:37:50
1 here it is
00:37:52
version 1 look here not the best
00:37:54
implementation but the very first one with the
00:37:57
form tag I have here like this the atek script
00:38:00
means the browser has a piece of code here,
00:38:02
usually in java script, and now look
00:38:04
what I’m doing in the line,
00:38:06
barely visible, do line 32 there is a
00:38:09
forms variable, give me the
00:38:12
forms variable and then call document. get
00:38:16
element buy go by id registration that's
00:38:19
where it's from let's scroll up
00:38:21
it turns out that I assigned the forms element a
00:38:23
controversial but meaningful identifier
00:38:25
registration so I get a variable
00:38:28
that will allow me to get this node
00:38:30
this rectangle from the tree
00:38:32
called form forms. he farms,
00:38:34
which means that the browser registers an
00:38:37
event listener for form elements,
00:38:38
in other words, when the form is confirmed,
00:38:41
execute the following code, he doesn’t need this name
00:38:43
because why do we need his name,
00:38:45
it’s enough to know what to do means
00:38:48
it’s anonymous or a lambda function and this
00:38:51
function is written on a few lines
00:38:53
below and now, to be honest, even if you have
00:38:55
never written code in java script
00:38:57
following the logic of this stove
00:38:59
if forms. and mail.ru equals equal empty
00:39:02
quotes, that is, if the email field is empty,
00:39:04
we scold the user, fill in more
00:39:07
addresses, otherwise if the forms . password. in
00:39:10
Ilya empty again we scold the user,
00:39:12
fill in more than the password Mountie
00:39:15
becomes much more interesting in a number of forms.
00:39:16
passport . value is
00:39:18
not equal to forms. confirmation. value y and
00:39:21
where did confirmation white come from we turn
00:39:23
up so I called this input field
00:39:26
password
00:39:27
and here I called this kanfer smaller I
00:39:29
could call it sent it
00:39:31
or anything from just checking the logic
00:39:33
so that they match otherwise again
00:39:35
we turn to Mr. broth logical
00:39:37
value check boxes
00:39:38
so if ! that is, if not
00:39:42
forms. and hryvnia. the effect is again a reprimand
00:39:45
to the user, as you will see, this
00:39:48
syntax is widely used in
00:39:49
java-script, this form of recording is via .
00:39:51
first there is an object then it means and
00:39:53
properties for example password before then the
00:39:56
actual value
00:39:57
look again here is the input field here is its
00:40:00
name password
00:40:01
and its value is whatever the
00:40:03
user enters in all these cases I
00:40:05
returned false otherwise I return
00:40:07
true here it is by force when you
00:40:10
return false to interrupt the
00:40:12
user's action and force him to select or
00:40:14
type again otherwise
00:40:17
return
00:40:18
true I'll show you another version
00:40:21
of this task just so you can get a better understanding
00:40:23
version 2 all in forum 2
00:40:27
perform with a slight movement of the hand this is
00:40:30
for the curious version on Jake Vere
00:40:33
you might want let's dig into this
00:40:35
library let's get started ok now
00:40:37
they don't have any questions I'll slow down for a
00:40:40
second because we drove for a long time and
00:40:42
quickly it's good that all this code is
00:40:45
more or less the same
00:40:47
from new material what is about what
00:40:48
are rectangles what is a class you
00:40:50
what is an anonymous function what is an
00:40:52
event handler however most of it
00:40:54
fortunately repeats itself from week zero
00:40:57
okay let's move on to the interesting part
00:40:59
first let's open google maps
00:41:01
google maps
00:41:02
pay attention for a moment for a split
00:41:05
second
00:41:06
look what happens if I click
00:41:08
quickly spin-off no connection at
00:41:10
Harvard it’s so fast that you ca
00:41:12
n’t even see it, but what should you see if I
00:41:15
click and drag very quickly who is
00:41:18
watching us online if you
00:41:20
double the speed you’ll see
00:41:22
better what happened before I clicked and dragged
00:41:25
let’s do this in a different way for example
00:41:29
90210
00:41:30
was heading away from no too
00:41:32
quickly again what about disney world but here
00:41:36
it is yeah what did you see for a split second
00:41:39
something like squares to the placeholder and
00:41:41
instead of tiles what was it Google Maps a
00:41:43
great example of a technology called
00:41:44
Weeks and this is where using a java script
00:41:47
becomes especially tempting there
00:41:49
used to be a site called metk weight you had to
00:41:52
take a screenshot back in the
00:41:53
nineties there if you needed to
00:41:55
look at the map above you had to
00:41:57
click on the up arrow which led to the
00:41:59
next square of the map if you
00:42:01
needed to move it to the left you had to again
00:42:03
click on the arrow move to another
00:42:04
square of the map some sites still
00:42:07
work like this, well no the quest
00:42:08
has been corrected like google maps and google but
00:42:10
instead today many sites
00:42:12
use
00:42:13
oh ok oh ax also known as
00:42:15
asynchronous script java script or xml
00:42:18
it's just a complicated name technology
00:42:21
or technique that allows the browser,
00:42:23
using a java script, to make
00:42:25
additional http requests after the
00:42:27
page is loaded
00:42:28
and part of the bin but what does this mean but you would be
00:42:31
tired if the dml every time you
00:42:33
need to check after required you to press
00:42:35
control r or commander or the
00:42:37
refresh button so that the whole the damn page
00:42:38
was overloaded though it was restored
00:42:41
white for a second you looked at the
00:42:42
stupid loading indicator to
00:42:44
see if you had a new letter the
00:42:46
whole page and the legal address would have to be
00:42:48
reloaded to jmail it works somehow
00:42:50
differently so when you receive a new
00:42:52
letter you pressed how the screen behaves
00:42:54
it just appears at the top yes it
00:42:56
magically appears as the top
00:42:58
line in the list in fact it's all
00:43:00
quite complicated really if you
00:43:01
think about this tree although it's
00:43:03
simple and jmail you'd have to look
00:43:06
at the code to make sure of this they're most
00:43:08
likely using an html table or a
00:43:11
bulleted list in the form of which it
00:43:12
displays a message in the inbox, if you
00:43:14
imagine that this is a memory tree, then when
00:43:17
using GI mail something like this happens when
00:43:20
google understands oh you have a new message
00:43:22
admin, but it will not
00:43:24
rebuild the entire tree; rather, it will
00:43:27
find a tree node that is different from the
00:43:29
inbox and just paste a new node
00:43:31
is similar to the task from the 5th problem book where you
00:43:34
inserted nodes in the vtap hash table,
00:43:36
and google its code java script
00:43:39
scans the tree, finds out where the part of
00:43:42
the window is responsible for the incoming ones and
00:43:43
inserts a new line, a
00:43:45
new line is just one or
00:43:47
more new nodes in the tree in general
00:43:49
Ajax a special technique created
00:43:52
specifically for this when visiting a url, no matter how
00:43:55
long it takes to load after the
00:43:58
page has fully loaded,
00:43:59
but you can still pull up new
00:44:01
data from the Internet, be it messages
00:44:02
or map tiles, take them out of the bins
00:44:05
and insert the page so that the
00:44:07
user does not have to wait, also
00:44:09
works messenger Facebook any
00:44:11
sites could become and even so I want to
00:44:14
say that it’s terribly annoying
00:44:15
lately if I start looking for
00:44:17
cats from the user’s point of view it’s
00:44:19
a nightmare it offers options instead of
00:44:21
me everything it does and the url has not changed
00:44:24
since I started typing text but
00:44:25
what's happening with the network
00:44:27
I'm doing interesting what's happening with the
00:44:30
network bright and even stranger okay
00:44:34
let's look at the code of the element and for
00:44:37
this we go to the network tab and try to
00:44:39
explain everything scientifically without cats and
00:44:41
while I'm typing verbatim cats and that's what's
00:44:46
happening I
00:44:49
won't I click here okay, it means
00:44:53
here below what we see after each
00:44:55
character that I enter 1 lower level
00:44:59
what happens after each character
00:45:00
entered from the keyboard yes exactly the characters
00:45:05
get into google one by one on
00:45:07
their server they build a string that
00:45:09
represents everything that I have already typed
00:45:11
and Every time I add a sign, they
00:45:13
mix up their secret
00:45:15
search algorithm and guess this or not this
00:45:17
page with cats, I
00:45:19
mean to them, in a sense, it makes my
00:45:21
life easier because I don’t even need to
00:45:23
finish my thought threads; of course,
00:45:25
autocomplete is a useful thing, in principle,
00:45:27
if their algorithms are good enough and
00:45:29
if my queries are obvious enough I
00:45:32
don't need to write down the words they
00:45:33
will tell me what I want to find so
00:45:35
instant google search is just an
00:45:37
ajax technique using code that
00:45:40
allows you to
00:45:41
request additional content through the
00:45:43
browser behind the scenes using this new
00:45:45
java script language.
00:45:47
so we still have a couple of minutes left,
00:45:49
let's call my friend Colton Auto on stage since the
00:45:53
presentation of the kalyk technology that you
00:45:56
showed interest in your final
00:45:57
projects was a lot of fun, although we decided that we could
00:45:59
use volunteers to
00:46:00
demonstrate to you an addition
00:46:02
that will allow you to see this hand
00:46:04
first come here, very cool, well done,
00:46:07
now we'll connect this to the monitor,
00:46:09
describe your name so everyone knows me
00:46:12
and fa fa fa fa fa fa, nice
00:46:14
to meet you, okay, let's get everything
00:46:16
ready, come out here in the middle
00:46:18
with the cardboard in Colton's hands, the
00:46:20
control panel and instead of standing in
00:46:22
this three-dimensional world, looking
00:46:23
around like Colton last time,
00:46:25
today he will walk forward back
00:46:27
left and right like a Nintendo or
00:46:29
x-box joystick,
00:46:31
I was standing somewhere here, but everything is possible,
00:46:34
give it as a gift, okay, putting this thing on,
00:46:38
let me switch the picture to the monitor and
00:46:43
when we turn off the light from Inna Colton, I’ll stand
00:46:46
here next to you, you’ll tell me, but the microphone
00:46:48
what’s happening in the do it, of course,
00:46:51
we’re now loading the Oculus Operative, not the
00:46:54
operating system, but the main program
00:46:56
from which you have access to all the games and
00:46:59
applications in your collection, now she’ll
00:47:02
say tap touchpad to start
00:47:04
dochp this is located on the right side of the headset,
00:47:07
you can press one on it and there you go,
00:47:13
it sees everything in much better quality,
00:47:16
but the picture is on Wi-Fi, now you
00:47:18
need to look at the top right corner of
00:47:20
the screen, yes, this game is at the very top
00:47:23
right when you select it again press
00:47:26
on the touchpad it looks like this duet is halls
00:47:29
and now it appears
00:47:33
let me hold your glasses for now and so I
00:47:38
gave him the headset he can control the
00:47:41
game he
00:47:42
can move in space and all
00:47:44
that look up it
00:47:45
says new game forward let
00:47:48
's start now you can control
00:47:50
yourself using the headset
00:47:52
like As soon as the game loads, it might
00:47:58
be scary, it’s time to say about
00:48:02
it, okay, I’ll check if you can
00:48:05
move, it turns out great,
00:48:08
look down you have a map on the map, you
00:48:10
can see where you are, you can look around
00:48:13
the room,
00:48:14
you can turn around completely like this,
00:48:16
turn around, look to the left, I think there’s
00:48:21
something on the barrel what you can
00:48:22
pick up or how to remove the map from the road
00:48:25
look above
00:48:26
just raise your head like this,
00:48:28
go forward and turn around look even
00:48:35
further to the left look left continue left like this and
00:48:41
go to it using your headset
00:48:46
like this now a hint will appear
00:48:48
pick up here it is pick up the bottle come on
00:48:51
to get out of this
00:48:53
edict room and the door now you need to press
00:48:57
there there is a hint to
00:48:58
press the button so that it opens
00:49:00
let's press the button here it
00:49:03
opens well done and so we
00:49:06
leave the room further let's think for
00:49:11
ourselves and
00:49:12
see what else you find and I don't want to go
00:49:19
into this dark room and stop, how can I
00:49:22
get through the dark hall
00:49:23
no, it’s better to go back everything is fine there are
00:49:31
still useful items there, pick up it looks like it’s on a
00:49:34
coin and this is a master key
00:49:35
if you find a locked door you can
00:49:38
use it scary for now okay
00:49:47
pretend until you
00:49:48
get into the role as if you’re standing there and if
00:49:51
you turn to you need to get used to this but
00:49:54
everything is logical and for now it can go
00:49:56
on for the whole day, I suggest
00:49:58
you sneak out of here but we
00:50:00
have two more couples if you want to go
00:50:02
play, the rest of us will see you next
00:50:04
Wednesday and thank you for the volunteer day
00:50:06
translated and voiced by the studio up
00:50:10
diver by order java rush
00:50:13
[music]
00:50:16
I'm fixing the TPL bayonet, I
00:50:19
've already changed the low-pass filters, what are you doing,
00:50:21
well, look at each of them, I'll show you, for
00:50:25
example, this one, you
00:50:26
see here, in my opinion, I'm full, if you
00:50:28
want more, no thanks, okay, help yourself to a
00:50:38
different color, in fact, this thing
00:50:41
adjusts the colors
00:50:44
translated and voiced by up diver studio

Description:

Доп. материалы и задачи к лекции - https://javarush.com/quests/lectures?quest=QUEST_HARVARD_CS50&level=9 Весь курс CS50 - https://javarush.com/quests/QUEST_HARVARD_CS50 CS50, или Computer Science 50 — это курс Гарвардского университета, посвящённый основам программирования. Тема восемнадцатой серии цикла — введение в ДжаваСкрипт и программирование на стороне клиента. Впервые в истории студенты двух учебных заведений — Гарварда и Йеля — при помощи современных технологий параллельно проходят обучение на курсе.

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "18. CS50 на русском: Лекция #18 [Гарвард, Основы программирования, осень 2015 год]"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.