All language subtitles for 020 Debugging 2D Arrays_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Arrays can store many values at once, but a variable does not store the array, it stores a reference

that points to it.

This can introduce a lot of bugs, so it helps to visualize the runtime using breakpoints.

In this lesson, you're going to learn to debuggers using breakpoints.

All right, at this point in the course, you're well aware of the reference trap, but it would be

nice to visualize the reference dropped during runtime.

So open this file.

Place breakpoints next to each line of code.

And you know what, I'm actually going to remove the breakpoints from functions and Lupe's.

All right, then launched the debugger.

The verbal greeting stories I reference that points to an array with two string values.

And by setting farewell equal to greeting farewell copies, that same reference.

Farewell and greeting cherie reference that points to the same array.

And so updating the array through farewell effects, greeting.

And now it's really nice that you can finally see the reference drop in real time, and this is why

I love this code anyways, this is considered a bug because the application doesn't behave like we expect

it to, because if we keep stepping into the runtime, that's exactly what happens.

And the solution, obviously, is to farewell equal to a copy of the Iraq.

Launch another debugging session.

The verbal greeting saw as a reference that points to an array with two string values.

Farewell was a reference that points to a copy of the original array, and so both variables are completely

independent of each other.

All right, now, debugging a one dimensional array is easy to erase are a different story.

So open up upper triangular java and the goal is to produce an upper triangular matrix from the two

Deira.

An upper triangular matrix is a two tier with zeros below the main diagonal.

If you're on the current code.

It's going to crash.

First step is to find out why something is wrong and using breakpoints, we can visualize the runtime

and figure it out.

Then launch a new debugging session.

And woops, it seems that every time the inner loop runs or increasing the outer loop counter, eventually

the outer loop counter exceeds the bounds of the array and crashes the up.

This mistake is so common and it can happen when you're not paying attention.

But seeing that runtime helps us debug the problem and see it right away.

All right, we run the code.

The nested loop sets every element to zero, that's not good.

If you look back at the output, only elements below the main diagonal should be zero.

Now it's hard to keep track of two counters at the same time.

And so this makes it hard to predict how we're going to use them to achieve our goal.

But it helps to launch a debugging session to visualize the runtime.

Hopefully then we can see a pattern.

And you know what, after visualizing the array without even stepping into the nested loop, the pattern

is clear.

The elements that need to be zero have a J index lower than the index.

So if Jay is smaller than I.

Then we're going to say matrix age is equal to zero.

All right, launch another debugging session to visualize the runtime.

And therein lies the beauty of visual analysis.

It helps to have a clear visual of what's going on instead of just looking at code.

And there's your upper triangular matrix.

In this lesson, you learn to debug using breakpoints now debugging in normal arrays, easy, but the

usage of a tutera implies a nested loop.

And so it's hard to keep track of the counters Ingi and how they're affecting your array.

But when you can visualize the runtime step by step, you can easily see how the state of the tiaro

is going to change.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.