Placeholder Image

字幕列表 影片播放

  • >> [MUSIC PLAYING]

    >> [音樂播放]

  • >> [MUSIC PLAYING]

    >> [音樂播放]

  • DAVID MALAN: All right.

    DAVID馬蘭:好的。

  • This is CS50.

    這是CS50。

  • [MUSIC PLAYING Tritonal, Cash Cash, "Untouchable"]

    [音樂播放Tritonal,現金現金,  “賤民”]

  • [MUSIC PLAYING]

    [音樂播放]

  • SPEAKER 1: I'm going to France, and you're going, too.

    揚聲器1:我要去 法國和你要去了。

  • [MUSIC PLAYING]

    [音樂播放]

  • DAVID MALAN: This is CS50, Harvard University's introduction

    DAVID馬蘭:這是CS50, 哈佛大學的介紹

  • to the intellectual enterprises of computer science

    以智力 計算機科學的企業

  • and the arts of program-- and for the first time in history,

    和program--的藝術 對於在歷史上第一次,

  • Yale University's as well.

    耶魯大學也是如此。

  • Indeed, whether you're here in Cambridge or in New Haven or Miami or St. Louis

    事實上,無論你在這裡在劍橋 或在紐黑文和邁阿密或聖路易斯

  • or Amsterdam or anywhere around the world

    或阿姆斯特丹或任何地方 世界各地的

  • taking CS50, computer science E50, CS50X, CS50 AP,

    服用CS50,計算機 科學E50,CS50X,CS50 AP,

  • we are all one and the same.

    大家都是同一個。

  • Welcome to CS50.

    歡迎CS50。

  • >> What we have--

    >> 我們have--

  • >> [APPLAUSE]

    >> [掌聲]

  • >> [LAUGHS]

    >> (笑)

  • >> [APPLAUSE]

    >> [掌聲]

  • >> So I made a mistake myself some time ago when I started off college.

    >> 所以,我犯了一個錯誤我自己的一些 很久以前,當我開始上大學。

  • And I got to college, and I decided to frankly, stick within my comfort zone.

    而我上大學,我決定 坦率地說,堅持在自己的安樂窩。

  • I ended up declaring a concentration, or a major, of government.

    最後我聲明濃度, 或重大的政府。

  • Ant that was mostly a function of me being pretty familiar with government

    螞蟻主要是我的函數 是非常熟悉政府

  • or at least history or I really liked constitutional law in high school.

    或者至少是歷史還是我真的很喜歡 憲法在高中。

  • And so when I got here, I kind of gravitated toward things

    因此,當我來到這裡,我種 的趨向了往東西

  • with which I was already familiar.

    與我已經熟悉了。

  • Right?

    對嗎?

  • God forbid I do poorly in the class.

    上帝保佑我在課堂上做的很差。

  • I certainly wanted to stay within my comfort zone,

    我當然想留 在我的安樂窩,

  • and it wasn't until sophomore year that I finally

    而且直到 大二那年,我終於

  • got up the nerve to step foot in a classroom called CS50.

    鼓起勇氣步驟腳 在一個名為CS50教室。

  • And at that point, did I finally realize that, my God, homework could actually

    在這一點上,我才終於明白 是,我的上帝,家庭作業居然可以

  • be fun.

    很有趣。

  • >> Indeed, I was one of those kids that on Friday evenings when

    >> 事實上,我是那種一個孩子 上週五晚上,當

  • the P-SETS would be released, I would go back to my room and dive

    在P-SETS將被釋放,我 會回到我的房間,潛水

  • into the night's P-SETS.

    到晚上的P-集。

  • And for me, that was a sign that this was a field for me.

    而對於我來說,這是個好兆頭 這是一個場對我來說。

  • But what was more important was the fact that I did get up this nerve

    但更重要的是 事實上,我的確得到了這根神經

  • to explore waters unfamiliar to me and get beyond my own comfort zone

    探索對我不熟悉的水域 並獲得超出了我自己的安樂窩

  • and frankly, I only was able to do that sophomore year by taking this class

    坦率地說,我只能夠做到這一點 大二的時候採取這一類

  • pass/fail.

    通過/失敗。

  • >> Indeed, it was the very last day that I finally switched over and finally

    >> 事實上,這是最後一天, 我終於切換,最後

  • declared CS as my concentration, putting gov at that point behind me.

    聲明CS為我的注意力, 把政府網站在我身後這一點。

  • And so we're not setting out in this course to turn all of you

    所以,我們不設置在 這當然把所有你

  • into CS majors or concentrators, but rather to give you an opportunity

    進入計算機專業或集中,但 而是為了給你一個機會

  • to hopefully go beyond the world with which you're currently familiar

    有希望超越世界 與您目前熟悉

  • and bring back from this world skills and knowledge and savvy

    而從這個世界帶回 技能和知識和悟性

  • that you can apply to your own world, whether that's

    您可以應用到您的 自己的世界,不管是

  • in the humanities, social sciences, natural sciences, or beyond.

    在人文科學,社會科學, 自然科學,或超越。

  • >> Indeed, if you're feeling a little intrepid

    >> 事實上,如果你 感覺有點勇敢

  • about being in this room let alone in this class,

    關於這個房間是 更何況在這個班,

  • realize that if history is any indication, 72% of you

    認識到,如果歷史 任何跡象表明,你72%

  • have never taken a CS course before.

    以前從來沒有採取CS課程。

  • So it is by all means not the case that the student sitting to the left

    因此,它是通過各種手段並非如此 該學生坐在左邊

  • or to the right or in front or behind you knows far more about CS

    或向右或前面或 你身後知道遠更多關於CS

  • or programming in particular than you.

    或在特定的比你的編程。

  • That's not in fact the case.

    這其實不是這樣的。

  • And indeed, much of the support structure

    事實上很多, 支撐結構

  • that we've set up in this course over the past many years

    我們已經在此設立 當然,在過去的許多年

  • has been for exactly that reason-- to provide an on ramp that still exits

    一直正是reason--到 斜坡上仍然退出提供

  • just as rigorously and just as high as ever--

    正如嚴格和 一樣高ever--

  • but the slope of which allow students less comfortable and more comfortable

    但它的坡度讓學生 那麼舒服,更舒適

  • alike to succeed irrespective of his or her prior background.

    一樣的成功,不論 他或她事先背景。

  • >> Indeed, what ultimately matters in this class is not

    >> 的確,最終 問題在這個類是不

  • so much where you end up relative to your classmates

    這麼多,你最終會 相對於你的同學

  • but where you in week 12 end up relative to yourself

    但如果你十二週 結束了相對於自己

  • in week zero, which is where we are here today.

    在零週,這是 我們今天在這裡。

  • >> Indeed and this may very well and probably does look like Greek

    >> 事實上,這可能非常好 而且很可能看起來像希臘

  • to many of you.

    許多你。

  • But rest assured, that this and so much more

    不過放心,這 這和這麼多

  • is going to be completely within your grasp in just a little bit of time.

    將是完全在你的 把握時間只是一點點。

  • >> But today, we focus on some of the higher level ideas

    >> 但是今天,我們關注一些 的較高級別的想法

  • to give you a taste of CS50 and computer science

    給你的味道 CS50和計算機科學

  • in a sense of what you're signing up for.

    在某種意義上是什麼 你報名參加。

  • And indeed, computer science might be distilled more

    事實上,計算機科學 可能更蒸餾

  • simply as computational thinking-- thinking like a computer, if you will.

    簡單地計算thinking-- 思就像一台電腦,如果你願意。

  • And there's so many different things ingredients that go into that,

    而且有這麼多不同的事情 成分進入的,

  • but let's propose just three for today.

    但是讓我們提出只有三個為今天。

  • If the goal of the class ultimately is not to teach you programming,

    如果類的目標,最終 不是教你編程,

  • is not to teach you C or PHP or SQL or any number of the words

    是不是要教你C或PHP或 SQL或任何數目的字

  • and acronyms in the course's description,

    並在縮略語 當然描述,

  • but rather to teach you to solve problems more effectively

    而是教你 更有效地解決問題

  • and to think more methodically and more algorithmically, so to speak.

    並認為更有條理和 更多的算法,可以這麼說。

  • Let's see what exactly this means.

    讓我們來看看究竟是什麼意思。

  • >> So I would propose that thinking computationally boils down

    >> 所以,我建議思考 計算歸結

  • to solving problems.

    以解決問題。

  • What do you need to solve a problem?

    你有什麼需要解決的一個問題?

  • You need to input-- like the input to the problem--

    您需要input--像 輸入到problem--

  • you need an output, which is hopefully the solution,

    需要的輸出,這 是有希望的解決方案,

  • and then you need a process by which to solve that problem, which

    然後你需要一個過程, 要解決這個問題,這

  • we'll call an algorithm-- a set of instructions for solving some problem.

    我們會打電話給一個算法 - 一組 說明解決一些問題。

  • >> But first, let's focus on the first and the last of these inputs and outputs.

    >> 但首先,讓我們關注的第一和 最後這些輸入和輸出。

  • Computers after all, apparently only understands zeros and ones.

    計算機畢竟,顯然 只有理解零和一。

  • But how can that possibly be?

    但如何才能使這可能是?

  • Even if you're not familiar at all with what's underneath the hood,

    即使你不熟悉的一切 什麼是引擎蓋下,

  • you probably at least heard that computers understand binary--

    你可能至少聽說 計算機能夠理解binary--

  • just zeros and ones-- but how can you possibly do anything interesting?

    只是零和ones--卻怎麼也 你可能做什麼有趣的事?

  • >> Well, one of the themes of the class is going

    >> 好了,主題之一 類的會

  • to be this layering-- where today, we'll take a quick glance at the lowest level

    是這個layering--今天在這裡,我們將 我們快速瀏覽一下的最低水平。

  • details, but with each passing day, where we layer

    細節,但與每 過一天,我們在那裡層

  • or abstract on top of those details to actually solve higher level

    或者在這些細節上面抽象 要真正解決更高層次

  • problems of interest to us.

    我們感興趣的問題。

  • >> So here is what we might call binary-- with just an alphabet of 0 and 1.

    >> 因此,這裡就是我們可以稱之為binary-- 用0和1只是一個字母。

  • But we humans are mostly familiar with decimal.

    但是,我們人類大多 熟悉小數。

  • Dec meaning 10.

    十二月意義10。

  • Bi meaning two.

    畢意兩種。

  • And so in the decimal system, we have 10 digits

    並因此在小數 系統,我們有10位

  • at our disposal-- of course, zero through nine.

    在我們的disposal-- 當然,0到9。

  • So if you look at a number like this, most of you

    所以,如果你看一個數字 像這樣的,你最多

  • intuitively just grasp that is 123.

    直觀地只是把握是123。

  • There's nothing really hard about that.

    沒有什麼真的很難有關。

  • But why is it 123?

    但為什麼123?

  • Well, if you think back to grade school-- or at least

    好吧,如果你想回 等級school--或至少

  • the way I learned this kind of world-- you

    我了解到這個問題的方法 那種天下 - 你

  • might recall that we treated these things in columns, or places.

    可能還記得,我們​​處理這些 事情列或場所。

  • >> So we have the ones place on the right.

    >> 因此,我們有在右側的那些地方。

  • The tens place in the middle.

    十位放置在中間。

  • The hundreds place on the left.

    數百放置在左側。

  • And then how do we get from this pattern symbols--

    然後我們怎麼 從這種模式symbols--

  • 1 2 3-- to this higher level idea that we know as 123?

    1 2 3--至更高水平 想法,我們所知道的123?

  • Well, it's just some simple arithmetic.

    好吧,這只是一些簡單的算術。

  • Right?

    對嗎?

  • >> The one there is essentially means give us 100 times 1 plus 10 times

    >> 一個有實質上是指 給我們100倍1加10倍

  • 2 plus 1 times 3.

    2加1次3。

  • And of course if we do out the math there, it's 100 plus 20

    當然,如果我們做出來的 數學那裡,它是100加20

  • plus 3-- otherwise known as 123.

    加3--否則稱為123。

  • >> So if you're on the same page as that right

    >> 所以,如果你在 同一個頁面的右側

  • now and are comfortable with the so-called decimal system as a human,

    現在是舒服的 所謂十進制系統作為一個人,

  • it's actually well within your scope of comfort

    它實際上完全在 您的舒適範圍

  • to consider now the binary system.

    現在要考慮的雙星系統。

  • Take a wild guess-- this represents, in the world of computers

    以野生guess--這代表, 在計算機的世界

  • in binary-- what number?

    在binary--什麼號碼?

  • Zero.

    零。

  • >> But why is that?

    >> 但是,這是為什麼?

  • Well, it turns out that the columns or places here-- they're not powers of 10.

    嗯,事實證明,該列或 這裡 - 他們不是10的冪的地方。

  • 1, 10, 100, 1,000, and so forth.

    1,10,100,1000,等等。

  • They're instead, quite simply, powers of 2.

    他們相反,相當 簡單地說,2的冪。

  • So, 1, 2, 4, 8, 16, 32, and so on.

    因此,1,2,4,8,16,32,等等。

  • And so now we of course get to 0 here simply because we have 4 times

    所以,現在我們當然得到0 在這裡,只是因為我們有4倍

  • 0 plus 2 times 0 plus 1 times 0, which of course gives us 0.

    0加2次0加1次 0,這當然給了我們0。

  • >> But how do I go about representing the number 1?

    >> 但我怎麼去 表示數字1?

  • What's the pattern of zeros and ones to represent

    什麼是模式 零和一表示

  • the number we humans know as 1?

    數我們人類所知道的1?

  • 001.

    001。

  • And 2?

    和2?

  • 010.

    010。

  • >> And now the pattern starts to repeats.

    >> 而現在的模式開始重複。

  • Now it's 011.

    現在是011。

  • And again, 0 fours, one 2, one 1.

    再次,0四肢一2一1。

  • So 2 plus 1.

    因此,2加1。

  • That's 3.

    這是3。

  • >> And now to represent 4, we don't just change that 0 to a 1.

    >> 現在來表示4,我們 不只是改變0到1。

  • You sort of have to carry, so to speak, and the numbers

    那種你必須隨身攜帶, 可以這麼說,而且數量

  • start flipping around just like in the decimal world.

    開始只是翻轉各地 像在十進制世界。

  • >> So this is 4.

    >> 因此,這是4。

  • This is 5.

    這是5。

  • This is 6.

    這是6。

  • This is 7.

    這是7。

  • And so we've counted as high as 7.

    所以,我們計算高達7。

  • >> Now all we just need is more a bits-- more zero's and one's.

    >> 現在我們只是需要更多的是 bits--更多的零的和一個人的。

  • And indeed "bits", if you've heard this term-- binary digit.

    事實上“位”,如果你 聽到這個term--二進制數字。

  • Bit is where that comes from.

    位就是來自。

  • And so if we want to represent bigger numbers, we need more bits.

    所以,如果我們要代表 更大的數字,我們需要更多的位。

  • But let's move away from slides now to something a little more real.

    但是,讓我們遠離幻燈片現在 以一些更實際。

  • Suppose that we want to actually represent this thing.

    假設我們要 實際上代表這件事情。

  • >> Well let's take a look now at a little demonstration.

    >> 那麼讓我們來看看現在 在一個小演示。

  • So this is a web based application that one of CS50's own, Michael G,

    因此,這是一個基於Web的應用程序 這對CS50自己,邁克爾·摹之一,

  • put together this summer to help us elucidate exactly this idea.

    放在一起在今年夏天幫助 我們闡明正是這種想法。

  • And would someone like to venture up on stage

    並會有人喜歡 冒險在舞台上

  • in front of all his or her classmates?

    在他或她的所有同學面前?

  • Right there in front.

    正確的,在前面。

  • Come on up.

    上來吧。

  • >> You have to be comfortable on camera and the internet.

    >> 你必須要舒服 在相機和互聯網。

  • Oh, right here.

    呵呵,就在這裡。

  • OK.

    確定。

  • We're OK.

    我們很確定。

  • All right.

    好的。

  • Come on up.

    上來吧。

  • What's your name?

    你叫什麼名字?

  • Emily come on up.

    艾米麗上來吧。

  • So this is Emily.

    因此,這是艾米莉。

  • What year are you?

    哪一年是嗎?

  • >> Freshman.

    >> 大一。

  • >> Emily, nice to meet you.

    >> 艾米麗,很高興見到你。

  • David.

    大衛。

  • >> All right.

    >> 好的。

  • So up on the screen here, we have this touch screen

    因此,在屏幕在這裡, 我們有這樣的觸摸屏

  • which is going to allow us to actually interact with this program,

    這將允許我們 這個程序實際上是互動,

  • and it's just a browser.

    它只是一個瀏覽器。

  • It's Chrome full screened at the moment, but it's

    它的鍍鉻全屏蔽 此刻,但它的

  • been programmed by Michael to respond in a way that allows

    已編程邁克爾 的方式,允許響應

  • us to play around with binary digits.

    我們玩的二進制數字。

  • >> So for instance, here we have not three but eight bits-- zeros and ones.

    >> 因此,例如,我們在這裡有沒有 3條,但8 bits--零和一。

  • Right now, we're looking at the number 0.

    現在,我們 看數字0。

  • And indeed, all eight zeros in decimal means zero.

    事實上,所有八個零 十進制表示零。

  • So that's all that's being hinted at here.

    所以,這一切的 被暗示在這裡。

  • >> So if you wanted to represent the number 8,

    >> 所以,如果你想 表示數字8,

  • what's the pattern of zeros and ones that you want?

    什麼是零的格局 和那些你想要什麼?

  • You can simply tap up or down or the numbers themselves.

    你可以簡單地點擊向上或向下 或數字本身。

  • All right.

    好的。

  • So that of course is 8, as you can see up there.

    使當然是8, 你可以看到在那裡。

  • And if we wanted to do 16, what do we do?

    如果我們想 做16個,我們該怎麼辦?

  • >> Yep, just touch it again.

    >> 是的,只需再次觸摸它。

  • 16.

    16。

  • All right.

    好的。

  • So this is all fine and good, it's still very low level.

    因此,這是一切優秀和良好, 它仍然是非常低的水平。

  • We need a way in the real world for Emily

    我們需要的一個方式 現實世界中的埃米莉

  • of actually representing these things.

    實際上代表這些東西。

  • And so suppose that we turn these zeros and ones, which is very

    所以,假設我們把這些 零和一,這是非常

  • conceptual, into actual light bulbs.

    概念,為實際燈泡。

  • Right?

    對嗎?

  • >> A computer is a physical, mechanical, electrical device.

    >> 計算機是一種物理, 機械,電氣設備。

  • And its input-- at least if you plug it in or charge it--

    和至少如果其input-- 您或負責將其插入它 -

  • is to have battery power and electrons flowing in and out.

    是有電池電量和 電子流進和流出。

  • >> So now, why don't we stop thinking about bits as zeros and ones,

    >> 所以,現在,我們為什麼不停止思考 關於位為0和1

  • but something more physical like light bulbs here.

    但更多的東西物理 就像燈泡在這裡。

  • And if Dan Armendariz could join me for just a moment-- come on up--

    如果丹Armendariz環能加盟 我只是一個moment--來吧up--

  • we're going to queue up an application.

    我們要排隊的應用程序。

  • >> Come on over, Emily.

    >> 你過來吧,艾米麗。

  • Sorry this is the most awkward demo for you ever.

    很抱歉,這是最 尷尬的演示給你直到永遠。

  • Come on over here.

    來吧,在這裡。

  • We're going to queue up with thanks to Dan

    我們要排隊 與感謝Dan

  • Armendariz, another member of our staff, an application known as binary bulb.

    Armendariz環,我們的工作人員的另一名成員, 稱為二進制燈泡的應用程序。

  • >> So what we have here is an iPad application

    >> 所以,我們在這裡 是一個iPad應用程序

  • that has the following user interface on the screen for Emily.

    具有以下用戶 界面屏幕艾米麗上。

  • It's just got the same exact UI essentially that's over there.

    這只是得到了完全相同的用戶界面 基本上是在那邊。

  • And if you now want to represent the number, say 8,

    如果你現在要 表示數字,說8,

  • how would you go about doing this noticing at the right,

    你將如何去這樣做 這注意到在正確的,

  • the light bulbs that we have here?

    燈泡,我們在這裡?

  • Ah-ha.

    啊,哈。

  • Magical.

    妙用。

  • So if we want to now turn this into something a little more challenging,

    因此,如果我們想現在把它變成 東西多一點挑戰性,

  • and let's go ahead and pick a random number like the number 50 here.

    讓我們繼續前進,選擇一個隨機的 像數50此處號碼。

  • Input this.

    輸入這一點。

  • And if you can now be challenged to come up with the number 50,

    如果你現在可以質疑 拿出數50,

  • we'll have a fabulous prize for you.

    我們會為您提供一個神話般的獎金。

  • >> EMILY: OK.

    >> 艾米麗:OK。

  • Oh my God.

    哦,我的上帝。

  • DAVID MALAN: Arithmetic is indeed hard in front

    DAVID馬蘭:算術 的確很難在前面

  • of hundreds of your classmates.

    數百你的同學。

  • But 50 has been the answer here.

    但50曾在這裡得到了答案。

  • >> [APPLAUSE]

    >> [掌聲]

  • >> And so now, this is meant to be demonstrative for Emily.

    >> 所以,現在,這是為了 是示範性的艾米麗。

  • So, in here, is some light bulbs quite like these,

    所以,在這裡,是一些輕 燈泡很喜歡這些,

  • but it's actually the little magnetic strips.

    但它實際上是 小磁條。

  • And what's cool about these and the reason we use them in CS50

    什麼是酷的這些和 我們使用他們在CS50的原因

  • is that they support something called an API-- an application programming

    是他們支持一種叫 一個API--一個應用程序編程

  • interface, which is just a fancy way of saying that what one of our staff

    接口,這僅僅是一個奇特的方式 的說什麼我們的工作人員

  • did over the summer was create an iPad application here

    並在今年夏天被創建 一個iPad應用程序在這裡

  • that talks over the internet to the light bulbs over here,

    ,討論在互聯網上 該燈泡在這裡,

  • which are wirelessly connected to another device.

    這是無線 連接到另一設備。

  • But this is now an option for final projects.

    但是,這是目前的一個選項 最終項目。

  • And so Emily, if you would so like, at the end of the term,

    所以艾米麗,如果你就這麼 像,在所述術語的末端,

  • you can adorn your dorm room in the meantime with those.

    你可以裝飾你的宿舍裡 在與這些其間。

  • Thank you to Emily as well.

    謝謝艾米莉為好。

  • >> [APPLAUSE]

    >> [掌聲]

  • >> But now, let's turn our attention to what

    >> 但現在,讓我們來談談 我們注意什麼

  • that message might have looked like, and it's a little something like this.

    該消息可能看起來像, 這是一個有點這樣的事情。

  • In fact, this is an example just as a teaser

    其實,這是一種 例如只是作為一個傳情

  • of what's to come of what's called an API request.

    一個什麼樣的來的是什麼 所謂的API請求。

  • And so what we have here is simply exactly the kinds of message

    所以我們在這裡僅僅是 正是各種消息

  • that after a few weeks time in CS50, you'll

    那幾個星期後, 時間在CS50,你會

  • be able to send to something fairly familiar like that to actually

    能夠發送到的東西相當 熟悉這樣的實際

  • turn them on and off.

    其打開和關閉。

  • But this is all fine and good.

    但是,這是一切優秀和良好。

  • Right?

    對嗎?

  • We have the mental model hopefully for representing numbers with

    我們的心智模式有希望 用於表示與數字

  • zero's and one's.

    零的和一個人的。

  • And from zeros and ones, we can get to higher numbers like 50,

    而從零和的,我們可以 得到更高的數字像50,

  • as Emily just did, or we can move up from that.

    作為艾米麗只是做,或者我們 可以從向上移動。

  • And I claim that we can represent things like letters as well.

    我說我們可以代表 封樣東西為好。

  • Right?

    對嗎?

  • >> Computers are far more interesting than just numbers.

    >> 電腦是更 有趣的不僅僅是數字。

  • And so how do you go about representing words

    所以你怎麼去 關於代表字

  • on the screen or emails or essays or the like?

    屏幕或電子郵件上 或文章或之類的?

  • Well, it turns out that computers simply abstract on top of these low level

    嗯,事實證明,電腦根本 對這些低級別的最高抽象

  • details, and humans some time ago, came up with an arbitrary, but a consistent,

    細節,和人類前段時間,來到 了一個任意的,但一致的,

  • mapping of numbers to letters-- so that any time you see a capital letter

    號碼映射到letters--所以 任何時候你看到一個大寫字母

  • A on your computer screen, odds are what's

    一個在您的計算機上 屏幕上,賠率是什麼

  • underneath the hood is a pattern of zeros and ones

    下方的引擎蓋是 零和一的模式

  • that represent the number, per this chart, 65.

    表示的數目, 根據該圖,65。

  • >> And more physically inside of your computer,

    >> 而更多的身體 你的電腦裡面,

  • are millions of things called transistors-- these days-- which

    有成千上萬的東西叫做 transistors--這些days--這

  • are just switches if you will, things that can go on and off and so imagine.

    只是開關,如果你願意,事情 可以去和脫落等想像。

  • Not eight of these large light bulbs but millions of these tiny little light

    不是八顆這些大型燈泡 但數以百萬計的這些微小的光

  • bulbs, or switches or transistors, that can turn on and off

    燈泡,或開關或晶體管, 能打開和關閉

  • based on how you program them.

    根據您如何編程。

  • And so now we have a way of representing letters as well.

    所以,現在我們有一個辦法 代表字母為好。

  • >> In fact, if I were to use this mapping here and try to actually

    >> 事實上,如果我用這個 這裡映射和嘗試實際

  • spell something out, we might look at this pattern of decimal digits

    拼出來的東西,我們不妨來看看 在十進制數字這一模式

  • right now.

    現在。

  • So we're not going to even focus on binary anymore.

    因此,我們不打算連 專注於二進制了。

  • Let's just consider these as decimal number 72, 73, 33.

    讓我們只考慮這些作為 十進制數72,73,33。

  • But what might this represent?

    但是,可能這代表什麼呢?

  • Anyone have a sufficiently photographic memory

    任何人有足夠 生動記憶

  • to know what's spelled on the screen here?

    要知道什麼是拼寫 在這裡的屏幕?

  • Yeah a few.

    是啊等等。

  • So hi.

    所以喜。

  • H-I and then an exclamation point, which was not actually on the screen.

    H-我,然後一個感嘆號, 這實際上並沒有在屏幕上。

  • But indeed there's a mapping for every letter to every number

    但是,確實有一個映射 對於每一個字母的每一個數字

  • that you might want to type on your keyboard.

    你可能想 鍵入鍵盤上。

  • >> But numbers don't have to represent just letters.

    >> 但號碼不必 代表只能是字母。

  • Right?

    對嗎?

  • All of us know about images and photographs and audio files

    我們大家都知道的圖像 和圖片和音頻文件

  • and video files and the like.

    和視頻文件等。

  • So clearly we can represent higher level things still.

    所以很明顯,我們可以代表 更高層次的東西還在。

  • And so what a computer does is simply choose

    還等什麼電腦 不只是選擇

  • to interpret patterns of zero ones differently based on the context.

    解讀為零那些模式 不同地基於所述上下文。

  • >> If you double click a Microsoft Word icon,

    >> 如果您雙擊一個 微軟Word圖標,

  • you see words on the screen instead of colors and pictures

    你在屏幕上看到的話 而不是顏色和圖片

  • because word knows that this is an essay that you've actually typed.

    因為字都知道,這是一個 作文,你實際上已經輸入的內容。

  • If you instead double click on a JPEG or a GIF or a PNG,

    如果改為雙擊 上的JPEG或GIF或PNG格式,

  • it opens up and is an image because the .PNG or the .docx or whatever the file

    它打開了,是因為一個圖像 .PNG或.DOCX或任何文件

  • extension is and whatever software you're using knows to interpret

    擴展是和任何軟件 您使用的是知道要解釋

  • a pattern of zeros and ones differently based on what its purpose in life is.

    零和一的圖案不同 依據是什麼它在生命的目的是。

  • >> So for instance, this same sequence of numbers

    >> 因此,例如,這 數相同的序列

  • might represent how much red do you want, how much green do you want,

    可能代表了多少紅你 想,多少綠色,你想要的,

  • and how much blue do you want.

    你要多少藍做的。

  • And indeed, if you've ever heard RGB-- so just red green blue.

    事實上,如果你曾經聽說過 RGB--所以才紅,綠,藍。

  • And so if I see numbers like, this give me 72 red, give me 73 green,

    所以,如果我看到這樣,這數字 給我72衝,給我73綠,

  • and 33 blue, this is how a computer using three bytes-- where

    33藍,這是怎樣一個 計算機使用三個bytes--在哪裡

  • a byte is eight bits or 24 bits-- would represent a pretty nasty shade

    一個字節是8比特或24 bits-- 將是一個非常討厭的樹蔭

  • of brown or yellow here.

    棕色或黃色這裡。

  • And in different contexts, could those exact same patterns in zeros and ones

    而在不同的情況下,可能這些 在零和的完全一樣的模式

  • mean something completely different as well.

    完全意味著什麼 不同的。

  • >> So we have now a way of representing information-- zeros and ones.

    >> 因此,我們必須較現在的方法 information--零和一。

  • On top of that, we get letters.

    最重要的是,我們收到信件。

  • On top of that, we might get colors.

    最重要的是,我們可能得到的顏色。

  • And let's assume for today that we can get audio and video

    而讓我們假設今天 我們可以得到的音頻和視頻

  • and things so much more sophisticated than that.

    與事這麼多 複雜的比。

  • >> But now let's consider how we use those inputs

    >> 但是,現在讓我們來看看 我們如何使用這些輸入

  • and produce those outputs now that we have

    而生產這些 現在產出,我們有

  • a way of representing that information.

    一種方式表示該信息。

  • Well, we need something called an algorithm.

    好了,我們需要的東西 所謂的算法。

  • Again, a set of instructions for solving some problem

    再次,一組指令 為解決一些問題

  • step by step-- and the more precise, the better.

    一步step--和 更精確,效果更好。

  • >> And so an example with which humans are admittedly less familiar these days,

    >> 就這樣一個例子與人類 誠然不太熟悉的這些天,

  • but nonetheless is still with us in software,

    但儘管如此仍 與我們的軟件,

  • is the process of looking up someone in a phone book.

    是看過程 了有人在電話簿。

  • >> Now, fewer and fewer folks know each year what this relic actually is here.

    >> 現在,越來越少的人知道每一個 今年這是什麼遺物實際上是在這裡。

  • But back in my day, this was a phone book

    但是,早在我的一天, 這是一個電話簿

  • with thousands of pages and numbers and people's names from A through Z.

    與成千上萬的網頁和電話號碼 人們的到Z從A名稱

  • And even though we're kind of cheating a bit-- this is mostly yellow pages.

    而且即使我們一種欺騙 一個bit--這主要是黃頁。

  • There were also white pages at the time, which

    也有白 在當時的網頁,該

  • had all of those names and numbers of actual human beings.

    把所有這些名字和 實際的人的號碼。

  • >> And if I wanted to look someone up in a phone book like this today, of course,

    >> 如果我想看看別人在一個 當然電話簿今天這個樣子,

  • I just type in the first few characters of his or her name,

    我只需輸入前幾個 他或她的名字的人物,

  • and my phone finds that information.

    和我的手機發現的信息。

  • But the process by which your iPhone or Android phone

    但過程,其中 你的iPhone或Android手機

  • or whatever is actually finding someone in your contacts list

    或什麼是真正找到 有人在你的聯繫人列表

  • is identical to what we humans probably have done for some time.

    等同於我們人類 大概做了有一段時間了。

  • >> Now I could take this problem, if you will,

    >> 現在,我可以藉此 的問題,如果你願意,

  • and the inputs here are not zeros and ones.

    而在這裡輸入 不是零和一。

  • They're pages-- like, let's say 1,000 pages.

    他們pages--一樣, 比方說,1000頁。

  • And if I wanted to look up someone like Mike Smith in this phone book,

    如果我想查找某個人 像邁克·史密斯在本電話簿,

  • I could start at the beginning and see that I'm in the A section

    我可以從頭開始 並看到我在A節

  • and then turn one page at a time, looking and looking

    然後打開一個頁面 一時間,尋找和期待

  • as I make to the B's and the C's and the D's and so forth for Mike Smith.

    因為我做的B的以及C的和 在D的等等麥克·史密斯。

  • Smith starting with an S, I'll hopefully eventually find him.

    史密斯開始與S,我會 希望最終找到了他。

  • >> Is this algorithm-- that process-- correct?

    >> 這是算法 - 這process--正確嗎?

  • Yeah.

    是啊。

  • It's correct.

    這是正確的。

  • I will find Mike if he's in here, but what's the caveat that you might offer.

    我會找到邁克,如果他在這裡,但 什麼,你可能會提供警告。

  • It's slow.

    這是緩慢的。

  • Right?

    對嗎?

  • I know Mike S is sort of toward the latter half of the phone book.

    我知道邁克S是那種朝 後者電話簿的一半。

  • Why the heck am I starting at the beginning

    見鬼,為什麼我是 從頭開始

  • and going page by page by page.

    並逐頁去逐頁。

  • So of course, I could flip it around and start from the back,

    所以,當然,我可以翻轉 周圍並從後面開始,

  • but that's going to get me there at the same rate,

    但是這會得到 我有以同樣的速度,

  • if you willl-- page after page after page.

    如果你willl--頁 後一頁頁。

  • And it's not going to work if I want to search for someone else whose

    而且它不會工作,如果我想 搜索別人的

  • name comes earlier in the alphabet.

    名字來自早期的字母表。

  • >> So what if I do what I learned in grade school,

    >> 那麼,如果我做什麼,我 在小學了解到,

  • again, do things not by ones but by twos.

    再次,做事情不 通過那些而是三三兩兩。

  • So 2, 4, 6, 8, 10, 12, and so forth.

    所以2,4,6,8,10,12,等等。

  • Is that correct?

    這是否正確?

  • No.

  • It's kind of correct.

    這是一種正確的。

  • But some of you who murmured no, where is the problem, or the bug,

    但你們中的一些誰低聲說沒有, 哪裡出了問題,或者錯誤,

  • the mistake so to speak.

    錯誤可以這麼說。

  • Yeah.

    是啊。

  • >> STUDENT: You might skip over the right entry.

    >> 學生:你可能會跳過 在右邊的條目。

  • >> DAVID MALAN: Yeah.

    >> DAVID馬蘭:是的。

  • I might skip over Mike Smith is because I've taken two pages at once

    我可能會跳過麥克·史密斯 因為我已經採取了兩頁一次

  • and he just happens to be sandwiched between those two pages.

    而他恰好是 這兩個頁面之間。

  • I might realize that I'm on to the T section

    我可能會認識到, 我在給T節

  • not having found Mike Smith yet.

    沒有找到邁克·史密斯呢。

  • >> And so what might the fixed there be?

    >> 所以什麼可能的固定在那裡呢?

  • Well, if I do hit the Ts in the phone book,

    好吧,如果我做打 在電話簿Ts時,

  • I might need to double back one or so page.

    我可能需要增加一倍 退一萬左右的網頁。

  • So it's fixable, but it's not quite as simple

    因此,它是可以解決的,但 它不是那麼簡單

  • as just going by two to speed up my performance.

    因為只是按兩 加快我的表現。

  • But what?

    但是什麼?

  • Come on.

    來吧。

  • What is what most humans are going to do with this kind of phone book?

    什麼是大多數人會 做這樣的電話簿?

  • You're given the phone book.

    你給出的電話簿。

  • What do you do?

    你會怎麼做?

  • >> What's that?

    >> 那是什麼?

  • Go to the middle.

    去中間。

  • So I heard go to the middle, and I find myself roughly in the M section,

    我聽說去中間,和我 發現自己大致在M部分,

  • so to speak.

    可以這麼說。

  • And now what do I want to do?

    現在做什麼我想做什麼?

  • Good job.

    幹得好。

  • What's your name?

    你叫什麼名字?

  • >> JAMES: James.

    >> 詹姆斯:詹姆斯。

  • >> DAVID MALAN: James, all right.

    >> DAVID馬蘭:詹姆斯,沒事的。

  • What do I do next?

    我該怎麼辦?

  • JAMES: You go in the half that has the S's.

    詹姆斯:你去了 一半具有S的。

  • DAVID MALAN: All right.

    DAVID馬蘭:好的。

  • I'm going to go into the half that has the S's in it because, again,

    我要去到一半 具有S的在,它因為再次,

  • a stipulation here was that this thing is sorted.

    這裡規定的是 這件事情進行排序。

  • It's a pretty useless 1,000 pages if Verizon doesn't actually

    這是一個相當無用1000 如果Verizon公司實際上並不頁面

  • sort these things for us A through Z.

    這些東西對於我們A到Z.排序

  • So if I know Mike is probably in the latter half of the phone book,

    所以,如果我知道邁克可能是在 後者的電話本的一半,

  • I can now.

    我現在可以。

  • >> [LAUGHS]

    >> (笑)

  • >> Tear the problem in half.

    >> 撕裂了一半的問題。

  • >> [APPLAUSE]

    >> [掌聲]

  • Thank you.

    謝謝。

  • Tear the problem in half.

    撕裂了一半的問題。

  • That was actually real-- that struggle.

    這實際上real--這一鬥爭。

  • So tear the phone book in half, leaving myself

    所以撕電話簿 在一半,留下自己

  • with fundamentally the same problem.

    用基本相同的問題。

  • But of course, half as large.

    但是,當然,其中的一半大。

  • And if I follow James's advice again, and I go here.

    如果我跟隨詹姆斯的 再次建議,我去這裡。

  • I say, oh now I'm in the T section.

    我說,哦,現在我在T節。

  • >> And so of course, I can tear the phone book

    >> 所以當然我 可撕電話簿

  • in half one more time, leaving me with a problem that's

    在半一次,留下 我有一個問題,這就是

  • now a quarter of the size.

    現在的四分之一大小。

  • So I've gone from 1,000 to 500 to 250 to 125 and so forth.

    所以,我從1000到500了 到250至125,等等。

  • It feels like I'm taking bigger bites out

    這感覺就像我 採取更大的咬出

  • of this problem with each iteration, or each step in it.

    此問題與每個 迭代中,或在其每一個步驟。

  • >> And indeed, the time I'm going to spend finding Mike Smith in this example

    >> 事實上,當時我要去花 找到邁克·史密斯在本例中

  • is so much less because eventually I'm going to whittle this pone book down

    是如此之少,因為最終我 打算以削減該推遲實施的本子記下來

  • to just one lone page.

    到只有一個孤獨的頁面。

  • And if Mike is on that page, I'm going to go ahead and give him

    如果邁克是該網頁上,我 要繼續前進,並給他

  • a call having found him.

    一個電話已經找到了他。

  • >> But just how much better is that algorithm--

    >> 但是,到底有多少好 是算法 -

  • that dare say intuitive algorithm-- than the ones we

    即敢說直觀 算法 - 比那些我們

  • started with which we're very linear-- left to right-- at a pace of 1 or 2x?

    開始我們感到非常linear-- 左到right--以1或2x的速度?

  • >> Well, let's plot this.

    >> 好吧,讓我們來繪製此。

  • We don't have to worry too much about math or numbers in this case here.

    我們也不必太擔心 在這裡這種情況下的數學或數字。

  • We just look at a plot.

    我們只是看一個情節。

  • So on the x, or horizontal axis, is the size of the problem--

    所以在x,或橫軸, 是problem--的大小

  • how many pages are there.

    有多少頁都在那裡。

  • On the y, or the vertical axis, is how much time

    對y,或垂直 軸,是多少時間

  • is it going to take me to solve it.

    是要帶我去解決它。

  • And maybe that's how many page turns, how many seconds,

    也許這是多少 翻頁,多少秒,

  • how many-- some unit of measures.

    如何many--措施,一些單位。

  • >> And I've drawn a red straight lines here because if each additional page

    >> 而且我畫一個紅色的直線 在這裡,因為如果每增加一頁

  • of the phone book, I require to make one additional step.

    電話簿的,我所需要 使一個附加的步驟。

  • So if Verizon adds one more page next year,

    因此,如果Verizon公司增加了一個 更多的頁面,明年,

  • I might have to flip one more page to find someone like Mike Smith.

    我可能要翻多了一個頁面 找一個像邁克·史密斯。

  • >> Meanwhile, the second algorithm, which I went by twos, is the same shape.

    >> 同時,第二算法,這 我經過三三兩兩,是相同的形狀。

  • It's still very linear, very left to right, taking equal bytes each time,

    它仍然非常線性,非常留下來 沒錯,每次服用相同的字節,

  • but the slope is a little lower.

    但斜率稍低。

  • >> For instance, if the size of the problem were roughly here

    >> 例如,如果的大小 這個問題是大致在這裡

  • and I used my first algorithm, I might end up all the way

    我用我的第一個算法, 我可能最終一路

  • at the top of that red line.

    在該紅線的頂部。

  • But if I instead use to twosies approach,

    但是,如果我轉而使用 到twosies接近,

  • the yellow line suggests because it's lower,

    黃線提示 因為它是低,

  • that it's going to take me less time the solve.

    它要採取 我少的時間解決。

  • >> But what's the shape of the third algorithm-- again, arguably

    >> 但是,什麼是的形狀 第三算法 - 再次,可以說是

  • the most intuitive algorithm?

    最直觀的算法?

  • Well, it looks a little something like this.

    好了,它看起來有點 這樣的事情。

  • It's curved, or logarithmic, in shape.

    它的彎曲,或對數,在造型上。

  • And even though it never kind of flattens out,

    即使它從未 樣的變平,

  • it asymptotically inches up and up and up but terribly slowly

    它漸近英寸和 起來了,但非常緩慢

  • versus everything else.

    與一切。

  • And what's the take away?

    又有什麼帶走?

  • Well, we call it log n.

    好了,我們把它叫做日誌N。

  • But what does that actually mean?

    但到底是什麼,實際上意味著什麼呢?

  • Well if Verizon doubled the number of pages in the phone book

    那麼,如果Verizon的一倍 的電話簿中的頁數

  • next year from 1,000 to 2,000.

    明年為1000〜2000。

  • How many more steps is my first algorithm going to take?

    還有多少步驟,是我的 第一種算法要採取?

  • >> My first algorithm.

    >> 我的第一個算法。

  • Maybe 1,000 more steps.

    也許1000多個步驟。

  • If they doubled the phone book, I'm going

    如果他們一倍 電話本,我要去

  • to have to flip through another 1,000 pages to find Mike.

    有翻閱另一 1000頁找到邁克。

  • Of course, if the second algorithm, maybe 500 because I'm

    當然,如果第二 算法,也許是500,因為我

  • going twice as fast.

    要快一倍。

  • >> But if Verizon doubles the number of pages between this year and next,

    >> 但是,如果Verizon的兩倍數量 今年和明年的頁面,

  • with my third algorithm-- the divide and conquer that James proposed,

    我的第三個算法 - 鴻溝 征服詹姆斯提議,

  • going in half and half and half-- how many more steps will

    去了一半,另一半和 half--多少更多的步驟將

  • it take me next year to have a phone book of a size 2,000?

    它帶我明年有 尺寸2000的電話本?

  • Just one.

    只需之一。

  • Because with one bite, I can take, out of that problem, half of the pages

    因為與一咬牙,我可以拿, 出這一問題的,一半的網頁

  • away.

    而去。

  • And if you think about this a little crazily now-- if the phone book doesn't

    如果你想想這一點 瘋狂now--如果電話簿不

  • have 1,000 or 2000 page, but let's say 4 billion pages--

    有1000或2000頁,但 讓我們例如4十億pages--

  • it's a big phone book-- how many times or how many steps

    這是一個大的手機book--如何 多少次或多少步

  • is it going to take me to find Mike Smith in the phone book

    是要帶我找 邁克·史密斯在電話簿

  • with 4 billion pages.

    有4十億的網頁。

  • You can sort of start to do the math.

    那種你可以開始做數學題。

  • All right.

    好的。

  • 4 billion divided by 2.

    4個十億除以2。

  • So that's 2 billion divided by 1.

    這樣的2個十億的1分。

  • That's 1 billion.

    這是1十億。

  • Then half a billion.

    然後半十億。

  • Then 250-- so you can do this again and again but not that many times before

    然後250--所以你可以再次做到這一點, 再一次,但不是很多次

  • you get to one page.

    你到一個頁面。

  • >> And indeed, even if the phone book is 4 billion pages long

    >> 而事實上,即使手機 本書為4十億頁長

  • or the database you're searching is 4 billion records long,

    或者數據庫要搜索 4十億條記錄長,

  • it's going to take you give or take 32 steps only to find Mike Smith.

    它會帶你給或採取 只有32個步驟,找到邁克·史密斯。

  • And if you double the phone book next year from 4 billion to 8 billion,

    如果您雙擊下一個電話簿 今年4十億至8十億,

  • 33 steps instead of just 32.

    33步,而不是僅僅32。

  • >> And this is testament to one of the ideas

    >> 這是證明 到的思想之一

  • that we might embrace in computer science more generally, which

    我們可能會在計算機擁抱 科學更普遍,這

  • is this computational thinking and approaching a problem

    這是計算思維 並逼近問題

  • frankly using tools from your already familiar tool

    坦率地使用工具從 你已經很熟悉的工具

  • kit-- your real world with which you're familiar,

    與kit--您的真實世界 你很熟悉,

  • but harnessing those ideas to actually solve problems.

    但利用這些想法 真正解決問題。

  • >> But we need to formalize our solutions to these problems.

    >> 但是,我們需要規範我們 解決這些問題的。

  • And so let me introduce for a moment something we might call pseudocode.

    因此,讓我介紹了一下 東西,我們可以稱之為偽代碼。

  • Much of the semester, we'll spend using actual code in languages like C and PHP

    大部分的學期,我們會花使用 像C和PHP語言的實際代碼

  • and JavaScript and SQL and the like.

    和JavaScript和SQL等。

  • >> But for now, let's just look at something fairly intuitive

    >> 但現在,就讓我們看一看 在一些很直觀

  • like English.

    喜歡英語。

  • I might distill that algorithm with which

    我可以提煉出 算法與

  • I found Mike into steps like this.

    我發現邁克成這樣的步驟。

  • >> Pick up the phone book

    >> 拿起電話本

  • >> Open to middle of phone book

    >> 打開電話本的中間

  • Look at the name's

    看名字的

  • If Mike is among the name's

    如果麥克是其中的名

  • Call Mike

    呼叫麥克

  • Else if Smith is earlier in the book

    否則,如果史密斯早在書

  • Open to the middle of the left half of the book

    開到中間 書的左半

  • Else go to line 3

    否則轉到第3行

  • Else if Smith is later in the book

    否則,如果史密斯後來在書

  • Open to the middle of the right half of the book

    打開來的中間 書的右半

  • Go to line three

    轉到三號線

  • Else

    其他

  • Give up

    罷休

  • And there's a few characteristics now of this that are worth pointing out.

    而且有幾個特點,現在 這是值得指出的。

  • So one, all the lines I've highlighted in yellow

    所以一台,所有線路 我以黃色突出顯示

  • we're going to start calling statements or functions or procedures.

    我們要開始打電話 聲明或函數或過程。

  • They're just actions do this, and there's not

    他們只是動作做 這一點,有沒有

  • all that much variability to it.

    所有的東西變化吧。

  • >> Next step here though, are these conditions-- if, else, else if, else.

    >> 這裡下一步不過,在這些 條件 - 如果,否則,否則,如果,否則。

  • And these are called conditions, or branches, and they're decision points.

    而這些都是所謂的條件下,或 分支機構,而且他們的決策點。

  • And they allow us to do something conditionally.

    他們讓我們做 一些有條件的。

  • >> And in fact, let's take a quick look at perhaps a familiar face--

    >> 而事實上,讓我們快速 看也許是熟悉的face--

  • we'll call him Bill-- and exactly what these conditions,

    我們會打電話給他Bill--和 正是這些條件下,

  • how these might be used.

    如何將這些可能被使用。

  • >> BILL GATES: People make decisions every day.

    >> BILL GATES:人們經常 每一天的決定。

  • For example, before you go outside you kind of have an if statement that says,

    例如,在你走之前,你外面 那種有一個if語句,上面寫著:

  • if it's raining, then I need to get my jacket.

    如果下雨的話,我 需要讓我的夾克。

  • >> And computers are amazing once you decide those kinds of statements

    >> 和電腦是驚人的,一旦你 決定這種類型的語句

  • that they can reliably execute those things at unbelievable speed.

    它們可以可靠地執行 這些東西在令人難以置信的速度。

  • And so a computer program really is a little bit of math and some

    因此計算機程序真的 是數學和一些一點點

  • if statements where the decision gets made.

    if語句的地方 該決定被作出。

  • >> DAVID MALAN: So now let's focus on a few different lines--

    >> DAVID馬蘭:所以現在我們的重點 上的幾個不同lines--

  • the ones I've highlighted in yellow here.

    那些我已經強調 黃色這裡。

  • And it turns out there's different ways of expressing this idea.

    而事實證明有不同 如何表達這種想法。

  • But intuitively what our lines 8 and 11 that I've highlighted here telling you

    但是,直覺就是我們8號線和11 我在這裡強調了告訴你

  • to do?

    怎麼辦?

  • Yes, go to line 3, but what behavior is that really inducing?

    是的,去線3條,但什麼 行為是真正的誘導?

  • It's some kind of loop or cycle, and you can kind of see it.

    這是某種形式的循環或週期, 你可以種看看吧。

  • Right?

    對嗎?

  • If on line 8, you go back to line 3, and then you hit line 8 again,

    如果在第8行,你回去行 3,然後你又打線8條,

  • you might go back to line 3, back to line 3, back to line 3.

    你可能會回到3號線, 回到第3行,回行3。

  • There's this sort of cycle or loop.

    有這種週期或循環。

  • And indeed, that's induced in line 11 potentially as well.

    事實上,這是誘發 11號線可能也是如此。

  • And this is a basic programming construct as well.

    而這是一個基本的 編程結構為好。

  • >> You might not want to just do something with a statement

    >> 你可能不希望只 做點什麼聲明

  • or do something conditionally with a condition or branch.

    或者做了什麼條件 用的條件或分支。

  • You might want to do something cyclically with a loop.

    你可能想要做的事 循環用的循環。

  • And we'll have someone else with whom you might be familiar-- we'll call him

    我們將有其他人與誰 你可能會familiar--,我們會打電話給他

  • Mark-- explain this concept here.

    Mark--這裡解釋一下這個概念。

  • MARK ZUCKERBERG: One thing that computers are

    馬克·扎克伯格:一 計算機是事

  • really good at is repeating commands.

    在真正的好是重複的命令。

  • As a person, you'd get really bored if you

    作為一個人,你會得到 如果你真的很無聊

  • had to do the same thing lots of times in a row,

    必須做同樣的事情 很多次在一排,

  • but a computer can do the same thing millions or even billions of times

    但一台計算機可以做同樣的事情 數百萬甚至數十億倍

  • and not get bored and be able to carry that out really well.

    不覺得無聊,並能 開展了這一點真的很好。

  • >> So for example, if I want to wish everyone

    >> 因此,舉例來說,如果我 要祝大家

  • on Facebook a happy birthday by sending them an email,

    Facebook上的生日快樂 通過向他們發送一封電子郵件,

  • it might take me more than a century to actually write out

    這可能要花費一個多 世紀真正寫出來

  • all of those emails to everyone.

    所有這些郵件給大家。

  • But with just a few lines of code, I can have a system send an email to everyone

    但是,代碼只有幾行,我可以 有一個系統發送電子郵件給大家

  • on Facebook wishing them a happy birthday.

    在Facebook希望 他們生日快樂。

  • >> So that's what loops are and why they're valuable and something

    >> 所以,這就是循環的,為什麼 他們是有價值的東西

  • that computers can do very well.

    計算機能夠做的非常好。

  • >> DAVID MALAN: Many thanks to our friends at code.org for those two films.

    >> DAVID馬蘭:非常感謝我們的朋友 在code.org對於那些兩部電影。

  • And just last week, you might have seen that Mark Zuckerberg and Facebook

    而就在上週,你可能有 可見,馬克·扎克伯格和Facebook

  • posted this announcement, which is that they just

    發布本公告, 這是他們剛

  • have passed an important milestone for the first time ever.

    已經通過了一項重要的 里程碑有史以來第一次。

  • 1 billion people used Facebook in a single day, specifically last Monday.

    十億人使用Facebook的一個 一天,特別是最後一個星期一。

  • One in seven humans on Earth apparently logged into Facebook.

    七分之一的人在地球上 顯然登錄到Facebook上。

  • >> Well, this seems a good opportunity to look back on where Facebook began,

    >> 好了,這似乎是一個很好的機會 回頭看看那裡的Facebook開始,

  • and we went through CS50's own archives because it turns out in 2005,

    我們通過CS50自己去 檔案館,因為事實證明,2005年,

  • Mark gave a guest lecture in CS50.

    馬克給客人演講中CS50。

  • You'll see that production values weren't quite the same back then

    你會看到,生產值 是不太一樣的當時

  • in terms of the technology available, and you'll also

    在技​​術方面 可用,你也

  • see that the presence of this guest lecture

    看到,存在 這客座講座

  • didn't necessarily pique the interest of the student body, your predecessors,

    不一定激起興趣 學生的身體,你的前任,

  • as much as it might have just a few years later.

    因為它可能有盡可能多的 短短幾年後。

  • >> So let's take a look at Science Center C.

    >> 因此,讓我們一起來看看 在科學中心C.

  • SPEAKER 2: Please join me, and welcome.

    揚聲器2:請和我一起,歡迎。

  • [APPLAUSE]

    [掌聲]

  • MARK ZUCKERBERG: Yo.

    馬克·扎克伯格:呦。

  • All right.

    好的。

  • Cool this is the first time I've ever have had to hold one of these things.

    酷派這是我第一次過 不得不持有這些事情之一。

  • So I'm just going to attach it really quickly.

    所以我只是要 真的很快將其附加。

  • All right.

    好的。

  • Can you hear it?

    你能聽到嗎?

  • Is this good?

    這是好?

  • Is this amplified at all?

    難道這放大呢?

  • All right.

    好的。

  • Sweet.

    甜。

  • So, this is like one of the first times I've been to a lecture at Harvard,

    所以,這就像一次次的一個 我去過一次演講在哈佛,

  • but--

    但 -

  • >> DAVID MALAN: So eventually the Science Center did zoom in on the video,

    >> DAVID馬蘭:所以最終的科學 中心沒有放大的視頻,

  • but not before capturing this excerpt where Mark's talking,

    但沒有捕獲此之前, 摘錄,其中馬克的談話,

  • which he discussed his roommate, Dustin, who

    他討論了他 室友達斯汀,誰

  • wanted to lend a hand with this site called the Facebook.com

    想伸出援助之手與此 網站稱Facebook.com

  • and realized that Mark is about to mention to programming languages--

    並意識到馬克即將 何況編程languages​​--

  • one called Pearl, one called PHP-- as he discusses

    一個叫明珠一 所謂PHP--因為他討論

  • the origins of Dustin's contribution.

    達斯汀的貢獻來源。

  • MARK ZUCKERBERG: I started running the site

    馬克·扎克伯格:我 開始運行的網站

  • and launched it at Harvard in February, 2004.

    並在啟動它 哈佛大學在2004年2月。

  • So I guess almost two years ago now.

    所以我想差不多兩年以前的事了。

  • And within a couple of weeks, a few thousand people had signed up,

    並在幾個星期中, 幾千人已經簽署了,

  • and we started getting some emails from people at other colleges asking

    我們開始得到一些電子郵件 從人的其他高校要求

  • for us to launch it at their schools.

    讓我們來運行它,在他們的學校。

  • >> And I was taking 161 at the time.

    >> 而我是以161的時候。

  • So I don't know if you guys know the reputation of that course,

    所以,我不知道,如果你們知道 該課程的聲譽,

  • but it was kind of heavy.

    但它是一種沉重。

  • It was a really fun course, but it didn't leave me with much time

    這是一個非常有趣的過程,但 它並沒有離開我,多少時間

  • to do anything else with Facebook.

    做任何事情都要與Facebook。

  • So my roommate Dustin, who I guess had just finished CS50, was like, hey.

    所以,我的室友達斯汀,誰我猜 剛剛完成CS50,很喜歡,嘿嘿。

  • I want to help out.

    我想幫忙。

  • I want to do the expansion and help you figure out how to do the stuff.

    我想要做的擴展和幫助 你知道如何做的東西。

  • >> So I was like, that's pretty cool, dude.

    >> 所以我當時想,這很酷,伙計。

  • But you don't really know any PHP or anything like that.

    但是,你真的不知道任何 PHP之類的東西。

  • So that weekend he went home, bought the book Pearl for Dummies,

    於是,他去了那個週末回家, 買了這本書明珠傻瓜,

  • came back and was like, all right.

    回來後,當時想,沒事。

  • I'm ready to go.

    我已經準備好了。

  • >> I was like, dude, the site's written in PHP not Pearl, but that's cool.

    >> 我當時想,伙計,該網站的書面 在PHP不是珍珠,而是這很酷。

  • >> So he picked up PHP over like a few days because I

    >> 於是,他拿起PHP比 像幾天因為我

  • promise that if you have a good background in C,

    許諾,如果你有 一個良好的背景在C,

  • PHP is a very simple thing to pick up.

    PHP是一個很簡單的事情回升。

  • And he just kind of went to work.

    正中下懷,他上班去了。

  • >> Before we take a look now at where the course is going,

    >> 之前,我們先來看看現在 其中,當然是怎麼回事,

  • allow me to invite just some of SC50's staff up on to stage.

    請允許我邀請只是一些 對SC50的工作人員上到舞台。

  • Some of them are shopping their own courses.

    其中一些正在選購 自己的課程。

  • But if those TFs and CAs and course heads who are here could come on up

    但是,如果這些轉錄因子和CA和課程 頭誰在這裡可以了加油

  • and join me for a quick hello.

    和我一起快速招呼。

  • >> Allow me to introduce in particular, Hanna, Maria, Daven, and Rob,

    >> 請允許我介紹,特別是 漢娜,瑪麗亞,Daven,和Rob,

  • CS50's course heads here in Cambridge.

    CS50的當然這裡頭在劍橋。

  • >> [APPLAUSE]

    >> [掌聲]

  • >> DAVID MALAN: Indeed, testament to the support structure that the course has

    >> DAVID馬蘭:確實,證明了 支撐結構的過程中有

  • built out over the past many years, CS50 staff this year numbers nearly 100,

    建立了在過去的許多年, CS50的工作人員,今年人數近100家,

  • and that's here in Cambridge alone.

    而這是這裡在劍橋孤單。

  • Meanwhile, in New Haven, are there some 40 TFs and CAs and staff members there

    同時,在紐黑文,還有一些 40中隊和CA和工作人員有

  • to run the course as well.

    運行過程中也是如此。

  • >> Allow us to introduce first, Rob Bowden.

    >> 讓我們先介紹,羅布鮑登。

  • ROB BOWDEN: Hi.

    羅伯BOWDEN:你好。

  • I'm Rob.

    我搶。

  • This is my sixth year TFing in the course.

    這是我第六年 TFing在使用過程中。

  • So, all the way back in my freshman year, I did not take CS50.

    因此,所有的方式回到我的 大一的時候,我並沒有採取CS50。

  • Your freshman fall-- you might be familiar

    你大一fall-- 你可能很熟悉

  • that you can only take four courses and there are so many courses today.

    你可以只需要四門課程 今天有這麼多的課程。

  • So I'm like, eh.

    所以我想,哎。

  • I took AP CS my senior year of high school it was horrible.

    我把AP CS四年級 高中這太可怕了。

  • So, I'm like, eh.

    所以,我想,哎。

  • Computer science is not for me.

    計算機科學是不適合我。

  • >> So then it was over the course of my freshman

    >> 那樣的話就結束了 我大一的課程

  • fall, that I had a friend in CS50, and I think I attended one lecture with her.

    跌倒,我曾在CS50的朋友, 我想,我參加了一次講座和她在一起。

  • It's like, oh, this is kind of better than what I had in high school.

    這就像,哦,這是一種較好的 比我在高中。

  • >> And over the course of the year, I had my own problem sets

    >> 而超過的過程 今年,我有我自己的問題集

  • in the courses I was actually taking.

    在課程實際上,我是服用。

  • But I found that whenever I wanted to procrastinate on those,

    但是,我發現每當我 想拖延這些,

  • I would go back to CS50 and look at some of that stuff.

    我會回去CS50和 看看一些的東西。

  • So, yeah.

    所以,是的。

  • I'm cool.

    我很冷靜。

  • I procrastination with coding.

    我拖沓與編碼。

  • So then it's at the end of the fall that I realize, hey,

    於是它在年底 我知道,嘿秋,

  • computer science is pretty cool.

    計算機科學是很酷。

  • I end up taking CS51.

    我最終以CS51。

  • In the next semester, I end up taking CS61.

    在接下來的學期, 我最終以CS61。

  • And it all from there, then I end up declaring

    而這一切都從那裡, 然後我最終聲明

  • computer science, which I had absolutely no intention of doing

    計算機科學,我有 絕對無意做

  • when I came into college.

    當我走進大學。

  • And now I'm here.

    而現在我在這裡。

  • So the course is what you make of it.

    所以,當然是你做了什麼。

  • I hope you enjoy it.

    我希望你喜歡它。

  • >> [APPLAUSE]

    >> [掌聲]

  • DAVID MALAN: Thank you to Rob.

    DAVID馬蘭:謝謝你搶。

  • >> And now Maria, our head course assistant.

    >> 而現在瑪麗亞, 領導當然助理。

  • >> MARIA: Hey guys.

    >> 瑪麗亞:嘿,伙計們。

  • My name is Maria.

    我的名字叫瑪麗亞。

  • I'm a sophomore in Cabot House, coming from Bulgaria,

    我在卡博特一名大二學生 眾議院,來自保加利亞的到來,

  • and I'm super excited to be part of the staff this year.

    和我超級興奮, 今年的工作人員。

  • I took CS50 as a freshman last year, and I never even

    我花了CS50作為新生 去年,我從來沒有

  • thought about CS beforehand.

    事前想過CS。

  • So I absolutely love the course, and I hope you all love it as much as I did.

    所以,我絕對愛的過程中,我 希望大家都喜歡它,因為我沒有那麼多。

  • And, yeah.

    而且,是的。

  • Welcome to CS50.

    歡迎CS50。

  • DAVID MALAN: Thank you to Maria.

    DAVID馬蘭:謝謝瑪麗亞。

  • [APPLAUSE]

    [掌聲]

  • Now Hanna, our head teaching fellow.

    現在漢娜,我們的頭教學研究員。

  • HANNA: Hi, I'm Hanna.

    HANNA:嗨,我是漢娜。

  • I'm a senior in Cabot studying computer science.

    我在卡博特高級 學習計算機科學。

  • I took CS50 as a freshman and had been TFing-- this'll be my third year.

    我花了CS50作為新生和有 一直TFing--這將是我的第三個年頭。

  • So I will be happily involved in CS50 for all four years,

    因此,我將愉快地參與 在CS50所有的四年中,

  • and I'm looking forward to working with you all.

    我很期待 與您的所有工作。

  • DAVID MALAN: Thank you to Hanna.

    DAVID馬蘭:謝謝漢娜。

  • [APPLAUSE]

    [掌聲]

  • And lastly, Daven, our precepter.

    最後,Daven,我們precepter。

  • DAVEN: Hey guys.

    DAVEN:嘿,伙計們。

  • I'm a precept over in computer science here.

    我是一個戒律過 這裡的計算機科學。

  • This'll be my fourth year teaching.

    這將是我第四年的教學。

  • I also help manage the course.

    我還幫助管理過程。

  • So I'm sure you'll see me around, especially at office hours.

    所以我敢肯定,你會看到我身邊, 尤其是在辦公時間。

  • I'm always at office hours.

    我總是在辦公時間。

  • So if you see me walking around, definitely come say hi.

    所以,如果你看到我走 各地,肯定會打個招呼。

  • I love to meet everybody.

    我愛大家見面。

  • Otherwise, have fun, and I'll see you around.

    否則,有樂趣, 和我會看到你的周圍。

  • >> DAVID MALAN: Thank you to Daven as well.

    >> DAVID馬蘭:謝謝Daven為好。

  • So you'll meet all of these folks before long.

    所以,你會滿足所有的 不久這些人。

  • But without further ado, if you guys would

    但是,如果沒有進一步的 廢話不多說,如果你們願意

  • like to resume your seats from earlier.

    要繼續從早期的席位。

  • Allow me to introduce from afar now some of our friends from New Haven,

    請允許我向遠道而來的,現在引進 我們的一些從紐黑文的朋友,

  • in particular the course's heads who'll be overseeing CS50 there-- Professor

    特別課程的頭,誰就會 被監督CS50那裡 - 教授

  • Brian Scassellati, Jason, and Andi, who just-- so that we didn't tempt fate

    布賴恩Scassellati,傑森,和Andi, 誰just--使我們沒有誘惑的命運

  • with any FaceTime or the like-- have just sent us minutes

    與任何的FaceTime或like-- 剛才給我們送來分鐘

  • ago the following video in which they say hello from lecture hall

    以前下面的視頻中, 他們打個招呼,從報告廳

  • at Yale, in which lecture is being streamed right now.

    在耶魯,其中講座 被流的現在。

  • >> So our friends from Yale.

    >> 因此,我們的朋友從耶魯大學。

  • BRIAN SCASSELLATI: Hi, David.

    BRIAN SCASSELLATI:嗨,大衛。

  • Hi, everyone at Harvard.

    嗨,大家在哈佛。

  • We are so excited to be bringing CS50 to Yale this semester.

    我們很高興能成為將 CS50耶魯這個學期。

  • My name is Brian Scassellati, but everyone just calls me Scas.

    我的名字叫布萊恩Scassellati, 但每個人都只是叫我中汽南方。

  • And I'm here today to introduce to you the CS50 staff.

    而今天我在這裡介紹 給你的CS50的工作人員。

  • >> [CHEERING]

    >> [歡呼]

  • >> And more importantly, I'm here to introduce as well

    >> 而更重要的是,我 這裡要介紹以及

  • all of the students at Yale who as of this morning

    所有的學生在 耶魯誰截至今天上午

  • have made this the most popular course at Yale the CS50 students.

    使這個最流行 當然,在耶魯大學的CS50的學生。

  • >> [CHEERING]

    >> [歡呼]

  • >> So we're very excited to be seeing you here

    >> 因此,我們非常興奮 在這裡見到你

  • on Friday and on Saturday for Puzzle Day and have a great lecture.

    上週五和週六 益智日,有一個偉大的演講。

  • Bye.

    再見。

  • >> [APPLAUSE]

    >> [掌聲]

  • >> DAVID MALAN: On the screen here is the names of the some of 140 staff

    >> DAVID馬蘭:在屏幕下面是 的一些工作人員140名

  • members who await you over the course of the semester-- some of them

    成員誰等待著你在 的過程中semester--他們中的一些

  • here in Cambridge, some of them here in New Haven.

    這裡在劍橋,一些 對他們在這裡的紐黑文。

  • And indeed you'll have an opportunity this Saturday,

    事實上,你將有一個 機會在週六,

  • as Scas notes, to attend CS50 Puzzle Day.

    作為中汽南方筆記, 參加CS50拼圖日。

  • You might have seen little puzzle pieces slipped under your doorways recently.

    你可能已經看到過小拼圖 最近在你的門口滑倒。

  • We have a few extras here later on when you exist.

    在這裡,我們有幾個臨時演員 以後當你的存在的。

  • If you assemble all four puzzle pieces and merge forces with rooms

    如果你組裝四個拼圖 件和合併部隊客房

  • nearby yours in your house or dorm, they'll

    附近你在你的 房子或宿舍,他們會

  • assemble into a QR code-- or a two dimensional bar code, that

    組裝成一個QR代碼 - 或 二維條碼,那

  • once assembled and scanned with your phone will lead you

    一旦組裝和掃描 與您的手機將引領您

  • to some fabulous prize or-- I suppose you could just photograph this now

    以or--我想一些神話般獎 你可能只是現在拍攝這個

  • as well.

    為好。

  • >> But find those puzzle pieces nonetheless in order to win that fabulous prize.

    >> 但是發現這些拼圖仍然 為了贏得這場精彩的獎品。

  • And indeed one of the traditions in SC50-- ah, too slow.

    在傳統事實上1 在SC50--啊,太慢了。

  • One of the traditions in CS50 is to serve cake after the first lecture.

    其中在CS50的傳統是 第一次講座後發球蛋糕。

  • >> And so indeed, in a few minutes from now,

    >> 因此實際上,在一 從現在開始幾分鐘,

  • there will be cake served outside both here and New Haven as well.

    會有蛋糕擔任外 在這裡和紐黑文也。

  • >> But first-- we decorated them ourselves.

    >> 但first--我們裝飾他們自己。

  • But first-- and hopefully there'll be enough.

    但first--並希望 就會有足夠。

  • >> But first, a quick look.

    >> 但首先,快速瀏覽一下。

  • So lectures is indeed will be produced mostly here in Cambridge.

    所以講座確實會 生產的主要是這裡在劍橋。

  • But each month, we'll hop down to Yale with CS50's production team and stream

    但是每個月,我們會乘到耶魯大學 與CS50的製作團隊和流

  • the course in the reverse direction as well so

    的過程中的反向 方向,以及使

  • as to bring these two campuses truly for the first time in history

    為使這兩個校區 真正的第一次歷史

  • as close together as possible as one in the same course.

    作為併攏盡可能 為一體,在同一課程。

  • >> In terms of the support structure that's been stood up here in Cambridge as well

    >> 在支撐結構中這方面的 已經站了起來這裡在劍橋以及

  • as in New Haven, are sections.

    在紐黑文,是部分。

  • Indeed, as some of you may know, we have different tracks

    事實上,正如一些你可能 都知道,我們有不同的軌道

  • within the course for those less comfortable, more comfortable,

    課程對那些更少的時間內 舒適,更舒適,

  • and somewhere in between so that irrespective of your prior background,

    和在兩者之間,使得某處 不論你以前的背景,

  • can you ultimately succeed in the class.

    你能在課堂上,最終取得成功。

  • >> Office hours meanwhile, are an opportunity on Mondays and Tuesdays

    >> 同時辦公時間,是一個 在星期一和星期二機會

  • and Thursday evenings to work both here and in New Haven on our course's

    和週​​四晚上工作兩個 在這裡,並在我們的課程的紐黑文

  • problem sets with dozens of the course's staff near you.

    問題的設置與幾十個 課程的工作人員靠近你。

  • >> Problem sets meanwhile, are supported by things we call

    >> 習題同時,有 由東西我們稱之為支持

  • walkthroughs, which are video based tutorials that truly answering FAQ

    演練,這是基於視頻 教程真正回答常見問題

  • of where to begin a week's challenge.

    在那裡開始了一周的挑戰。

  • And postmortems walk you through possible solutions

    而屍體解剖帶領您 通過可能的解決方案

  • so that the end of the problem set too, you

    使的結束 問題設置得,你

  • know exactly what you could have done differently or altogether otherwise.

    確切地知道你可以做 不同或乾脆以其他方式。

  • >> The problem sets themselves come in two editions, a standard edition

    >> 問題集本身來 兩個版本,標準版

  • that we expect and invite most of the class-- some 90% plus to do--

    我們期待並邀請最 該分類 - 約90%加至do--

  • and a so-called hacker edition on which every page is emblazoned

    和一個所謂的黑客版 上每一頁都印

  • hacker edition, hacker edition, hacker edition,

    黑客版,黑客 版,黑客版,

  • so that you have that karma if you will, for diving

    讓你有因緣 如果你願意,潛水

  • into more advanced versions of the course's problem sets

    為更高級版本 的過程中的問題集

  • that cover ostensibly the same material but with a more sophisticated approach

    該蓋表面上是相同的材料 但具有更複雜的方法

  • and with additional background sometimes introduced.

    並與其他背景 有時會出台​​。

  • >> Meanwhile, are there nine late days that you can apply to the course's problem

    >> 同時,還有9晚天 您可以申請過程中的問題

  • sets as well as the lowest score, which we drop at the terms end.

    設置以及最低分數, 我們落於下列條款結束。

  • >> But what awaits?

    >> 但等待?

  • Well, a taste of the problem sets at hand on Friday

    這個問題嘛,味道 內置的手在星期五

  • and next week where we dabble for just a few days in something

    下週,我們涉足 在一些短短幾天

  • called Scratch, a graphical programming language developed by our friends

    所謂的划痕,一個圖形化編程 語言開發我們的朋友

  • at MIT's Media Lab that allows you to program either for the first time

    在麻省理工學院的媒體實驗室,可以讓你 編程或者首次

  • or in a new environment altogether using a drag and drop type environment.

    或在一個新的環境完全 使用拖放式環境。

  • Whereby puzzle pieces only interlock together

    由此拼圖 只有聯鎖在一起

  • if it makes logical sense to do so.

    如果它使邏輯意義這樣做。

  • >> Meanwhile in problem set two last year for instance,

    >> 與此同時,在問題集 最後兩個年度為例,

  • did we introduce the class to the world of cryptography,

    並介紹了類 密碼學的世界裡,

  • the art of encrypting or scrambling information.

    加密的藝術或 擾碼信息。

  • Indeed, this text here if decrypted, will actually

    事實上,這個在這裡,如果文字 解密,將實際

  • lead you to some fun destination.

    導致你一些有趣的目的地。

  • And in the problem set, what we had students

    而在問題設置, 我們有什麼學生

  • do is implement exactly those kinds of things-- an algorithm,

    做的是完全相同的實施 種things--的算法的,

  • or set of instructions for scrambling and scrambling information.

    或指令集用於加擾 和擾碼信息。

  • >> And in the hacker edition of that same problem set,

    >> 而在黑客版 同樣的問題集,

  • did we challenge students to take a encrypted file from a typical computer

    我們什麼激勵學生採取 從一個典型的計算機的加密文件

  • system with lots of usernames and encrypted passwords

    系統的許多用戶名 和加密密碼

  • and to crack those passwords-- actually figure out

    而破解這些passwords-- 實際上弄清楚

  • what they were without knowing anything a priori about those actual passwords.

    他們是什麼不知道什麼 先驗那些真實密碼。

  • Meanwhile, do we transition in the problem

    同時,我們是否 在問題過渡

  • sets to then looking at the world of graphics.

    集,然後看著 圖形的世界。

  • And in fact, you might imagine now that this could perhaps

    而事實上,你可能想像 現在,這或許

  • be the simplest way to represent a black and white image.

    是代表最簡單的方法 黑白圖像。

  • >> A white pixel, or square, as at top right there,

    >> 白色像素,或方形, 截至右上方有,

  • might be represented with a 1 and a black square

    可能與表示 a 1和一個黑色的方形

  • might be represented with a 0.

    可表示一個0。

  • And just by using more bits like we proposed earlier with 72 and 73 and 33,

    而剛剛通過使用更多的位像我們 早些時候與72和73和33提出了

  • could we represent color pixels as well.

    可能我們代表顏色的像素為好。

  • And what we do during this problem set is

    而我們在做 這個問題集

  • generally take a stroll around campus with a digital camera,

    一般需要大約漫步 校園用數碼相機,

  • take photographs of people, places, and things.

    採取的照片 人,地,事,物。

  • Then somehow every semester, we seem to accidentally

    然後以某種方式每學期, 我們似乎意外

  • deleted or corrupt the memory card on which all of those photos are,

    刪除或損壞存儲卡 在所有這些照片都是,

  • and so you are challenged to then write software

    等你挑戰 要那麼寫軟件

  • with which to recover those JPEGs from a copy of our camera's card.

    與以恢復這些JPEG文件 從我們的相機的存儲卡的複印件。

  • >> Meanwhile, do we hand you later in the term a dictionary of English words

    >> 同時,我們在後面交給你 這個詞的英文單詞詞典

  • that have 143,000 words, and you need to come up

    有143000的話, 你需要拿出

  • with a smart way of loading them into memory,

    用一個巧妙的方法 它們加載到內存中,

  • or RAM so to speak, to answer queries of the form: is this a word,

    或RAM可以這麼說,回答 形式疑問:是這樣的話,

  • is this a word, implementing the fastest spell checker that you can,

    這是一個字,在實施 最快的拼寫檢查就可以了,

  • even pinning yourself potentially against classmates

    甚至寄希望於自己 可能對同學

  • to see which of you uses the least amount of time

    看到這些,你使用 最少的時間

  • when running your code and even the least amount of memory.

    運行代碼,甚至當 最少量的存儲器。

  • >> Later in term do you actually implement your own web server.

    >> 後來在長期做你真正 實現自己的Web服務器。

  • So not just a website in a language called HTML and more,

    所以,不只是一個網站 語言稱為HTML多,

  • but a web server that actually listens to requests on the internet

    但在Web服務器實際 偵聽到因特網上的請求

  • and responds to them.

    並響應它們。

  • And indeed, this is how we bridge our world of C with which you'll

    事實上,這就是我們如何彌合 我們這個世界的C與您會

  • become familiar next week and PHP and HTML and JavaScript

    熟悉下週 PHP和HTML和JavaScript

  • and CSS and the like.

    和CSS之類。

  • >> Because one of the first web based project we do later in the term

    >> 因為第一網絡的基於1 項目我們在後來一詞做

  • is historically CS50 Finance.

    在歷史上是CS50融資。

  • Etrade.com style a website that allows you to buy and sell stocks virtually

    Etrade.com風格的一個網站,讓 您可以購買和出售股票幾乎

  • while also writing code to talk to Yahoo Finance getting semi real time stock

    同時還編寫代碼來談談雅虎 財政部獲得半實時庫存

  • quotes in order to update your own portfolio.

    報價以更新 你自己的投資組合。

  • >> But lastly of course, is the final project--

    >> 但最後當然 是最後的項目 -

  • an opportunity to do most anything of interest to you to solve a problem here

    一個機會,做的大部分事情 感興趣的您可以在這裡解決問題

  • or beyond of interest to you that's somehow inspired

    或超出感興趣的 你這是在某種程度上啟發

  • by the lessons learned in the class.

    通過在課堂上所學到的教訓。

  • >> And the class, as you may know, culminates in so-called CS50 Hackathon

    >> 而類,如你所知, 高潮在所謂的CS50黑客馬拉松

  • and CS50 Fair and any number of other cultural events

    和CS50公平和任意數量 其他文化活動

  • throughout the semester that allow you to engage

    整個學期 允許你搞

  • with each other and the course's staff.

    互相過程中的工作人員。

  • >> For instance, at Fire and Ice in Sitar this year, well, on Friday afternoons,

    >> 例如,在火與冰的西塔 今年,好,上週五下午,

  • we invite some 50 students to lunch, whoever

    我們邀請了一些50 學生午餐,誰就

  • would like to join us, myself, and the staff,

    想加入我們, 我自己,和工作人員,

  • and our friends from industry and alums to chat about life in the real world

    我們從行業和校友的朋友 聊生活在現實世界中

  • and beyond while enjoying a good lunch.

    並同時享受一個不錯的午餐超越。

  • At the Hackathon will you see such images

    在黑客馬拉松會 你看到這樣的圖像

  • as these, including plenty of candy-- and as of 2014 for the first time--

    因為這些,其中包括大量candy--的 並作為2014用於第一時間 -

  • vegetables.

    蔬菜。

  • >> [APPLAUSE]

    >> [掌聲]

  • >> But by 5:00 AM, does the scene usually look a little something like this.

    >> 但到了上午5:00,做現場一般 看起來有點像這樣。

  • And then just a week or so later, is the CS50 Fair

    然後只需一個星期或 所以後來,是CS50展

  • to which some 2000 plus students and staff and faculty

    到大約2000加 學生和教職員工

  • members from across campus and across campuses this year

    來自全國各地的校園成員 和整個校園今年

  • come to see and delight in the accomplishments of CS50 students, which

    來看看和喜悅中 CS50的學生中,成績這

  • is now you.

    現在是你。

  • >> And indeed, while this year we'll be inviting and busing anyone

    >> 事實上,雖然今年我們將 被邀請和校車接送人

  • at at Yale who would like to come up to Cambridge this Saturday for CS50 Puzzle

    在耶魯,誰願意上來 劍橋這個星期六CS50謎

  • Day, and we'll do the exact same thing in December for the CS50 Hackathon

    那天,我們會做同樣的事情 12月份的CS50黑客馬拉松

  • so that Harvard and Yale students alike partake in both of these events.

    使哈佛和耶魯大學的學生 都中分一杯羹在這兩個事件。

  • >> We will also hold CS50 fairs in Cambridge and in New Haven this year

    >> 我們還將舉行CS50展銷 劍橋和紐黑文今年

  • so that students on both campuses and staff and faculty

    使學生在兩個 校園和教職員工

  • can see each respective campus's accomplishment.

    可以看到每個相應的 校園裡的成就。

  • And those accomplishments will induce such memory

    而那些成績 會引起這樣的記憶

  • as this and this and ultimately this, in which all of you

    因為這個和這個,最終 此,在這種大家

  • exit the class wearing a little something in which you were hopefully

    退出類穿著小 東西你是希望

  • happy or proud to say that I took CS50.

    高興或得意地​​說,我花了CS50。

  • >> But before that and before we serve cake,

    >> 不過在這之前和 我們服務的蛋糕前,

  • we've put together-- thanks to CS50's production team and a certain self

    我們已經把together--由於CS50的 製作團隊和一定的自我

  • stick, the one occasion that we use such things for-- when we sent it

    棒,我們使用的一個場合 這樣的事情for--,當我們把它

  • not only here to Cambridge but also to New Haven

    這裡不僅劍橋 而且紐黑文

  • to gather a few hellos from the course's staff and all of the folks

    收集從幾個打著招呼 當然,工作人員和所有鄉親

  • you will meet both here and in New Haven over the following months.

    你會遇到在這裡和新 紐黑文在接下來的幾個月。

  • >> Allow me to introduce a few more of CS50's staff.

    >> 請允許我介紹一 幾個CS50的工作人員。

  • MARK ZUCKERBERG: Did that make it go?

    馬克·扎克伯格:這是否讓他走?

  • Oh, it's going.

    哦,這是怎麼回事。

  • It's going.

    這是怎麼回事。

  • Ooh.

    哦。

  • Yarr!

    Yarr!

  • >> [MUSIC PLAYING ANDY GRAMMER, "HONEY, I'M GOOD"]

    >> [音樂播放ANDY GRAMMER,“親愛的,我  GOOD“]

  • >> MARY: This is Caitlin.

    >> Mary:這是凱特琳。

  • That's Jay, and I'm Mary.

    這是周杰倫,我是瑪麗。

  • SATO: Hi, guys.

    佐藤:嗨,伙計們。

  • I'm Sato.

    我琢磨。

  • MICHAEL G.: Hi.

    MICHAEL G.:你好。

  • My name is Michael, G.

    我的名字是邁克爾,G.

  • DOUG LLOYD: I'm not.

    道格·勞埃德:我不是。

  • No.

  • I'm Doug Lloyd.

    我是道格·勞埃德。

  • I can't believe that I'm holding a selfie stick right now.

    我不敢相信,我手裡拿 一個自拍桿現在。

  • SPEAKER 4: Hi.

    揚聲器4:你好。

  • SPEAKER 5: Hi.

    揚聲器5:你好。

  • SPEAKER 6: Hello.

    揚聲器6:你好。

  • SPEAKER 7: Hi.

    揚聲器7:你好。

  • SPEAKER 8: Hey.

    揚聲器8:嘿。

  • We're hanging out at Yale.

    我們掛在耶魯大學。

  • We're really excited for this semester because it's

    我們真的很興奮 這個學期,因為它是

  • the first time it's coming to Yale.

    第一次它的到來給耶魯大學。

  • It's going to be awesome!

    這將是真棒!

  • >> [MUSIC PLAYING]

    >> [音樂播放]

  • >> JACOB SCHERBA: My name is Jacob Scherba.

    >> JACOB舍巴:我的名字是雅各布舍巴。

  • I'm excited to teach CS50 because I think

    我很高興教 CS50因為我覺得

  • it bring computer science to people in and approachable way.

    它把計算機科學 人,平易近人的方式。

  • SPEAKER 9: I'm really excited to teach CS50

    揚聲器9:我真的 激動教CS50

  • because I took the class last year, and it's one of the best classes.

    因為我把班,去年, 和它的最好的類之一。

  • SPEAKER 10: Yeah.

    揚聲器10:是的。

  • My advice is you should take CS50.

    我的建議是你應該採取CS50。

  • JACOB SCHERBA: I chose CS because I think it's a fun and creative way

    JACOB舍巴:我選擇了CS,因為 我認為這是一個有趣的和創造性的方式

  • to solve problems in an analytical way.

    為了解決在分析方式的問題。

  • SPEAKER 11: Back when I was a little freshman and afraid of computer science

    揚聲器11:當我還是一個小 大一,怕計算機科學

  • and afraid of doing engineering and stuff,

    怕做 工程之類的東西,

  • it was the first hard class I took, and it was also my favorite class ever.

    這是第一個硬盤I類了, 而且它也是我最喜歡的課永遠。

  • DOUG LLOYD: This is my ninth year teaching CS50.

    道格·勞埃德:這是我的 第九個年頭的教學CS50。

  • That makes me sound so old!

    這讓我聽起來這麼老!

  • There's always something new.

    總是有一些新的東西。

  • There's always something exciting.

    總有一些令人興奮的。

  • There's always new challenges faced by new students, and it's fun to help them

    總有面臨新的挑戰 新的學生,和它的樂趣,幫助他們

  • and to experience those challenges with them

    並體驗到這些 與他們的挑戰

  • and help them solve their problems.

    並幫助他們解決困難。

  • >> SPEAKER 12: When I first learned how to do CS,

    >> SPEAKER 12:當我第一次 學會了如何做CS,

  • it was like learning a super power.

    這就像學習一門超強動力。

  • And to see that in other students and to help them through that process

    而要看到,在其他學生 並幫助他們完成這一過程

  • is one of the most rewarding things I've ever.

    是一個最 有益的事情我曾經。

  • >> SPEAKER 7: I chose CS because in the beginning, I was a math concentrator

    >> 揚聲器7:我選擇了CS因為在 開始,我是一個數學集中

  • and I took CS50 and fell in love with it.

    我花了CS50和 愛上了它。

  • I also felt that with CS, I could build things.

    我還認為,隨著 CS,我能建造的東西。

  • And that, I thought, was a really cool aspect.

    而且,我認為,是 一個很酷的方面。

  • >> SPEAKER 13: Some advice for new students is go to office hours

    >> SPEAKER 13:一些建議新 學生是去上班時間

  • and hang out with the awesome TFs.

    並掛出了真棒轉錄因子。

  • SPEAKER 14: Start your P-SETs early, go to office hours,

    揚聲器14:啟動P-集合 年初,去辦公時間,

  • become frends with your TF.

    成為FRENDS你的TF。

  • SPEAKER 15: Yeah.

    SPEAKER 15:是的。

  • Everything she said.

    一切,她說。

  • SPEAKER 16: Don't be afraid to ask for help.

    揚聲器16:不要 害怕尋求幫助。

  • SPEAKER 17: Yeah.

    揚聲器17:是的。

  • SPEAKER 18: Start your P-SETs early.

    揚聲器18:年初啟動的P-集。

  • SPEAKER 19: It's a big social experience.

    SPEAKER 19:這是一個 大的社會經驗。

  • Make a lot of friends this way.

    讓很多朋友這樣。

  • SPEAKER 14: Go to section It's fun.

    揚聲器14:去節這很有趣。

  • SPEAKER 11: I mean, go for it.

    揚聲器11:我的意思是,去了。

  • It's really hard.

    這真的很難。

  • You'll get out of it what you put into it,

    你會走出來 你把它付諸表決,

  • but it's a really fun class especially if you're

    但它是一個非常有趣 類特別是如果你

  • willing to put the time into it, but it helps if you put time into it.

    願意把時間分成,但 它幫助,如果你把時間進去。

  • You'll get a lot more out of it later on.

    你會得到更多的 出它以後。

  • MIKE: I'm Mike.

    MIKE:我是麥克。

  • CAMILLE: I'm Camille.

    卡米爾:我卡米爾。

  • HANYA: I'm Hanya.

    漢雅:我是漢雅。

  • MATT: I'm Matt.

    馬特:我是馬特。

  • PETER: I am Peter.

    彼得:我是彼得。

  • PHILLIP: I'm Phillip.

    菲利普:我是菲利普。

  • PATRICK: I'm Patrick.

    帕特里克:我是帕特里克。

  • ROB BOWDEN: I'm Rob Bowden.

    羅伯BOWDEN:我搶鮑登。

  • BRIAN SCASSELLATI: My name is Scas, and this--

    BRIAN SCASSELLATI:我 名字是中汽南方,和this--

  • ALL: --is CS50.

    ALL:--is CS50。

  • SPEAKER 20: At Yale.

    揚聲器20:在耶魯大學。

  • SPEAKER 21: At Yale.

    揚聲器21:在耶魯大學。

  • [LAUGHING]

    [笑氣]

  • DAVID MALAN: That's it for CS50.

    DAVID馬蘭:這就是它的CS50。

  • We will see you from Yale on Friday, Puzzle Day on Saturday.

    我們會看到你在耶魯上 週五益智日星期六。

  • Cake is now served.

    蛋糕現在擔任。

  • This is CS50.

    這是CS50。

  • >> [MUSIC PLAYING]

    >> [音樂播放]

>> [MUSIC PLAYING]

>> [音樂播放]

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋