>> David: Merħba, jien jisimni David Malan u dan huwa CS50. U, dan mhux tipiċi għoli tiegħek iskola kompjuter xjenza kors. Dan il-kors huwa xi ħaġa speċjali ftit. U m'humiex għaliex jien tagħlim dan. huwa minħabba li din hija waħda mill-, aħna nixtiequ li wieħed jaħseb, dawk il-korsijiet rari li attwalment għafis moħħ tant u iskeda tiegħek tant li sa l-aħħar semestru int verament iħossuhom aktar intelliġenti. Allura, li kienet il-mod ħassejtni meta jiena stess ħa dan il-kors lura fl-1996. I kien importanti gvern fil-ħin hawn jgħixu fl Mather Kamra. U, I. [Cheering] Kif huma l-oħra, l-oħrajn ħames hemmhekk. Allura, I kien importanti gvern fil-ħin. U I kien kbir gvern minħabba I'd dejjem gustado istorja. Għoġobni liġi kostituzzjonali fl-iskola għolja. U hekk, jiena tpaċija fuq din is-sena freshmen triq tagħmel dak I do aħjar, tagħmel dak kont naf Għoġobni. U I'd dejjem kien daqsxejn ta 'geek, I'd dejjem babbled ma' kompjuters. Imma, Jien, forsi Ironikament retrospettivament, I'd dejjem meqjusa l-guys li kienu qed jieħdu kompjuter xjenza fl-iskola għolja tiegħi, ħbieb tiegħi bħala l-geeks reali. And yet, finalment għamel, sena sophomore I jieħdu dan il-kors ftit CS50 imsejħa li attwalment kellu jibża me bogħod sena tiegħi Freshman stess. U I kien assistent utent fil-ħin. Allura, I kien ċertament diġà kkwalifikat, għall-inqas, li jkunu fost dawk, dawn li geeks I magħmula gost fl-iskola għolja. Imma, I kien jibża. Hemm, hija kienet din ir-reputazzjoni fil-ħin u forsi għadhom parzjalment li dan kien, kien kors scary. Kien ħafna xogħol. Kien diffiċli u għadu, huwa wieħed minn dawk l-affarijiet fejn, Alla tiegħi, il-qoxra kien ferm agħar milli gidma tagħha. Sibt ruħi sophomore sena, għall-ewwel darba, fil-fatt konstatazzjoni gost dar. U jien ma tgħid dan biss biex żift dan il-kors li inti. dan kien realizzazzjoni ġenwin għalija. Issa, naħseb, fuq punt wieħed, I ma jaqsmu l-linja li geekdum veru fejn I attwalment użati biex bil-ħerqa li Ġimgħa bil-lejl minħabba I jistgħu curl fil quddiem MacBook ftit tiegħi u x-xogħol fuq settijiet problema CS50's. Allura, f'dak il-punt, naħseb kelli ċar jaqsmu l-linja. U, l-għan tagħna f'dan il-kors huwa ma jduru kollha inti fis dik il-persuna, iżda, biss li jgħidu li hemm ftit xi ħaġa speċjali dwar dan il-kors, ta 'xjenza ftit xi ħaġa speċjali dwar il-kompjuter b'mod ġenerali speċjalment f'dawn il-jiem. U, l-aktar akklimatizzati We've kollha ltqajna fis-teknoloġiji, il-ġugarelli aktar we jwettqu madwar fil-bwiet tagħna li huma nnifishom huma kompjuters. I mean, iPhone tiegħi huwa attwalment kompjuter jwettqu ogħla minn laptop tiegħi kien fil-kulleġġ. Inti tista 'tagħmel ħafna affarijiet pur ma' dawn l-affarijiet. U issa, ħafna minna f'din il-kamra, probabbilment biss użu ta 'softwer ta' nies oħrajn, l-għodod ta 'nies oħrajn, soluzzjonijiet ta' nies oħrajn għall-problemi għaliex immorru iTunes, aħna tniżżel xi app mill-maħżen app u walla nistgħu nagħmlu xi ħaġa verament pulita. Iżda, sa l-aħħar ta 'dan is-semestru, inti tista' tkun il-persuna li tagħmel din il-problema jissolvew. Tista 'tkun il-persuna jsolvu xi problema, bini li app, dik il-biċċa ta' softwer, dik l-għodda li, jew, wieħed biss amuses lili, amuses int. per eżempju, kontroll, jiġifieri, iTunes librerija tiegħek mill ħdejn appartamenti tiegħek b'mod ċar app li diġà teżisti jew tista 'ssib l-iskedi tax-shuttle aktar faċilment per eżempju. Allura fil-fatt, waħda mill-affarijiet ewwel għamilt wara li CS50 kien għal darb'oħra, kien probabbilment f'dan iljieli il-ġimgħa il-punt u ljieli is-Sibt, kien hemm din l-opportunità fil-waqt meta Harvard kien għaddej xarabankijiet tax-shuttle. U, għal din il-ġurnata, dawn ikunu għadhom stampati iskedi. Iżda, ma kien hemm l-ebda verament onlajn ifisser li jinstab meta l-shuttle li jmiss kien. Issa, I ma 'kura, għaliex anki jekk jiena għext fl Mather I ma kienx fost dawk li ġeneralment ħa l-mekkuk. Imma, kelli ħafna ħbieb fil Pfoho per eżempju. U wieħed minnhom staqsa lili, naħseb fuq punt wieħed. [Cheering] Okay Pfoho's aħjar minn Mather apparentament. Allura, wieħed mill-tip ħbieb tiegħi ta 'ltqajna me ħsieb forsi Kapaċi nikteb programm ftit li tip ta' għajnuna ħbieb tiegħi jivverifika l-iskedi tax-shuttle. U għalhekk twieled l-boy shuttle awkwardly jismu, din il-biċċa ta 'lessiku li jkun baqa' madwar għal xi numru ta 'snin mill-inqas fost uħud mill-upperclassmen. Fil-ħin, din kienet din ftit kmand linja programm simili fl-ispirtu li Dos. Huwa kien għaddej fl-ambjent UNIX. Allura, ma tantx kienet sexy fil-livelli kollha. Inti biss ttajpjati a kmandi koppja u qallek meta l-shuttles kienu. Ukoll, dawn il-ġranet huwa ta 'ftit aktar sofistikati. U, huwa attwalment rappreżentata preċiżament tat-tipi ta 'proġetti li l-istudenti fl dan il-għan matul teħid tad mit-termini finali. Allura, dan huwa verżjoni erba, xi 15 snin wara, ta 'Shuttleboy. Jidher Google Maps qed daqsxejn bil-mod hemm. Iżda, għal dawk minnkom li jridu toħroġ hawn klassi wara u jmorru, jiġifieri, minn Memorial Hall u l-ħtieġa li jmorru sa, jiġifieri, il-Quad. Ukoll, inti tista 'jew leave f'żewġ minuti jekk minn, dan huwa verament mhux jaħdem għalik għadha biss, jew għandek bħala għażliet oħra kemm inti tista' tixtieq. U, dalwaqt, nistgħu żift dan minn CS50, se jkun il-kapaċità istess bl-SMS. Tista 'test Shuttleboy permezz tat-telefon. Inti sejħa Shuttleboy. CS50's Numru tat-telefon din is-sena, ukoll, amazingly dan kien disponibbli, 617-BUG-CS50. Allura, li se DEBUT dalwaqt. Allura ma sejħa hija għadha biss għaliex stajt gotten anfira għal, id-dritt issa huwa qed jinqalbu għal cell phone sistema tagħna ras tagħlim sħabi's. Allura, int ser biss tikseb minnu jekk għandek xi mistoqsijiet dwar l-iskeda tax-shuttle issa. Iżda, li dalwaqt se tiġi implimentata. Allura, affarijiet oħra, fil-fatt, li aħna lilna nfusna jintefqu fuq dan is-sajf verament fil-preparazzjoni għall dan is-semestru kienet mazz sħiħ ta 'problemi oħra li ridna li ssolvi. Per eżempju, hemm lott kollu ta 'għalf li tmur fuq f'dan il-kampus f'jum mogħti. U fil-fatt, fi kliem ieħor, hemm lott kollu ta 'għalf għaddej f'dan il-kampus li jien żgur qatt ma jieħdu vantaġġ ta'. U, anki jekk jien issa b'rikjesti kemm affarijiet li huma għaddejjin, fuq il-kampus, I għadhom jidhru li qatt ma jsibu l-ħin. Iżda, walla, anki hemmhekk, lectures CS50's. Li meta inti huwa, għalhekk din kienet, dan kien il-programm aħna kiteb lill aggregat kollha ta 'l-avvenimenti fuq il-kampus. U dan ġie xi ħaġa li l-istudenti l-oħra f'dan il-kors istess ttrattati fuq tagħhom stess. U, We've jaħdmu ma 'entitajiet oħra fuq il-kampus li verament jagħmlu dan iseħħ. Iżda l-punt li CS50 dan it-terminu huwa li dawn il-programmi ftit We've ilhom jaħdmu fuq jekk dan wieħed jew jekk wieħed għall-aggregazzjoni kollha ta 'aħbarijiet Harvard f'post wieħed, l-Google News, kollha ta' dawn l-affarijiet huma ser ikollhom dak li huma msejħa l-interfaces API's, ipprogrammar applikazzjoni. U dan huwa biss fancy jitkellem għall-kapaċità ta 'kiri nies oħra, in-nies f'din il-kamra, fil-fatt tagħmel xi ħaġa ma' dak istess data. Allura, b'termini aħħar, jekk inti tiddeċiedi li jimplimenta l-proġett finali relatati ma 'l-aħbarijiet jew avvenimenti jew mapep, ukoll aħna, mill-inqas kors, se tagħmel li l-aktar faċli din is-sena billi nipprovdulek interface; tip ta' funzjoni, biex ngħidu hekk, software li inti tista 'tuża fil-proġetti tiegħek li tmur lil hinn fejn l-istudenti, forsi, marru fi żminijiet passat għaliex dan il-qafas ma ġiex fis-seħħ għalihom. U għal darb'oħra, dan kollu beda, għalija l-inqas, xi 15 snin ilu implimentazzjoni Shuttleboy. I imbagħad emailed ħabib Ken tiegħi fil Pfoho. I said ħej x'taħseb? Huwa dan utli? Huwa impustat hija fuq il-Pfoho lista miftuħa u walla, kollha dawn is-snin aktar tard jien apparentement xorta ħlib dan il-proġett. U l-ħaġa pulita dwar dan, u dan huwa fejn wisq kors bħal dan fl-inġinerija u x-xjenza tal-kompjuter, naħseb, huwa ftit speċjali, hija li, meta inti tagħmel dar tiegħek xogħlijiet u meta inti tagħmel proġetti tiegħek f'dan il-kors, inti jafu, ħafna minnhom, iva, inti ser twarrab u mhux verament użu mill-ġdid. Iżda, xi ftit minnhom, inti se. U hemm dan ħaġa verament b'saħħtu, għall-inqas għalija, dan il-ħaġa verament eċċitanti, meta inti tagħmel xi ħaġa u nies oħra fil-fatt kura, nies oħra ma biss tbissima u pat sort tiegħek fuq id-dahar u mbagħad ta 'jmorru dwar ħajjithom stess. Huma attwalment jużaw dak li tkun għamilt fil-ħajja tagħhom anki jekk għall-ħaġa bħala iblah jew bħala sempliċi biss bħala konstatazzjoni meta dawn ikunu jistgħu jiksbu minn hawn biex jaqbad il-mekkuk li jmiss għall-Quad. Allura, b'termini aħħar, li waħda mill-miri għal dan il-kors; biex jinkariga lill guys għal ftit tidentifika xi problema jekk huwa fuq il-kampus jew wieħed jittama lil hinn kampus, u fil-fatt jintużaw il-ħiliet tiegħek, mind tiegħek u ssolvi din il-problema f'xi parti, teknoloġikament. Allura, dan huwa wkoll kors kif ngħidu fil-sillabu u d-deskrizzjoni uffiċjali korsijiet li tgħallem inti kif jaħsbu u li tgħallem kif għandek tagħmel biex isolvu l-problemi b'mod aktar effiċjenti. Ukoll, xi jfisser? Well, meta inti stajt ltqajna 600 megahertz fil-but tiegħek jew tliet gigahertz taħt iskrivanija tiegħek fid-dar, inti tista 'ssolvi ħafna problemi b'mod effiċjenti biss bil-forza brutali shear. Iżda, hemm ħafna problemi f'din id-dinja, kemm jekk qed tfittex, jiġifieri, in-netwerk Facebook jew l-internet permezz ta 'Google, li ma jimpurtax kif fast kompjuter partikolari tiegħek, hemm ebda mod fl-infern int ser tfittxija biljuni ta 'paġni tal-web malajr sakemm inti fil-fatt l-approċċ din il-problema intelliġenti. Inti mhux biss tfittxija, per eżempju, lista enormi ta 'l-paġni tal-web fuq earth minn fuq għal isfel tfittex xi ħaġa relatati ma' termini ta 'tiftix x'ikun qed tfittex għall Google Google nisperaw u preżumibbilment u Facebook u kull wieħed minn dawn l-entitajiet kbar għandhom ħafna ta 'nies intelliġenti ħsieb dwar kif jistgħu jsibu data aktar malajr, kif dawn jistgħu jipproċessaw l-informazzjoni b'mod aktar effiċjenti, u, kif dawn jistgħu biss ġeneralment ritorn riżultati aktar malajr sabiex inti tista' tagħmel għadha, l-affarijiet aktar interessanti ma 'dawn il-mezzi. U għalhekk, X'nifhmu, għalkemm, minn kif, tagħlim nies kif jaħsbu aktar bir-reqqa, aktar algorithmically. Ukoll, dan viżwali ftit dejjem jidher li jmorru fuq sew. U, jidher li jkun memorabbli. U I kien saħansitra mitlub biss bieraħ minn student ta 'qabel, oh huma inti se tagħmel il-ħaġa phonebook darb'oħra. U I pretty ħafna fuq il-post iddeċieda alright żgur aħna ser jibnu ħaġa phonebook. U huwa staqsa lili meta inti Tore min-nofs id-dritt, I kien simili ukoll yeah teknikament aħna Tore min-nofs imma mhux fil-mod, fil-mod xjenza tal-kompjuter se nkun kapaċi tiċrita dan ħaġa min-nofs. U għalhekk, hawnhekk kienet il-problema li aħna ppreżentat għal xi żmien. Allura, hawnhekk ser phonebook. Huwa ltqajna mill-inqas elf paġni jew hekk. U l-mira sempliċi fil-idejn dinja reali ħafna huwa li jinstabu, jiġifieri, persuna fil hawn. Allura, Mike Smith, isem l-aħħar jibdew S. Allura, jien bniedem tipiku, I pick up dan il-ktieb tat-telefon. U xi ħadd hemmhekk, dak li int, persuna tipika, tagħmel biex tibda konstatazzjoni Mike Smith, ovvjament ma kienux jafu minn qabel liema paġna huwa attwalment fil. Dritt, sabiex inti tmur madwar fin-nofs, id-dritt. U f'dan il-punt fl-istorja, jien probabbilment fl-N jew O, inti taf, bejn wieħed u ieħor f'nofs il-phonebook. Jirriżulta li, l-aħħar darba Jien għamilt dan eżempju I b'xi sibt ruħi fit-taqsima skorta. Allura, huwa attwalment ma bbilanċjati ndaqs bejn A permezz M u N permezz Z. Imma, illum, aħna, fil-fatt, fil-M's, alright hekk, issa jien fil-M's. Imma x'hemm takeaway tiegħi issa biss bħala off umana normali tat-triq? Fejn nista mur li jmiss għall Mike Smith. [Inaudible] U hekk, biss probabbilment fuq din nofs, id-dritt, minħabba S wasal wara M. U hekk, hawnhekk tinsab-drama viżwali. Li mhux verament dmugħ min-nofs, id-dritt. I tip ta 'misruqin l-ċentru. Iżda, aħna issa jkunu jafu li Mike huwa mill-inqas mhux li nofs. Nistgħu litteralment tarmi nofs il-problema bogħod. U jien jitħallew bil-problema li l-fundamentalment għadu l-istess ħaġa, isibu Mike Smith fi ktieb tassew kbar. Iżda, il-problema issa nofs kbar. Jekk kellu paġni elf qabel, issa huwa ltqajna 500. Inti taf liema, nista jagħmlu l-istess ħaġa mill-ġdid. I jista tip ta 'recursively jew ripetutament jagħmlu l-istess ħaġa. Issa jien ma pjuttost fil S. I'm T. U hekk, oh I marru ftit wisq. Imma, naf issa li Mike mhux għad-dritt, hemm se tkun xi klassi someday I fejn biss ma tistax jitqattax il-ħaġa diga, I bet. Imma issa, naf hu li ma d-dritt. Allura, issa l-problema ġiet kwarti. Allura, stajt marret minn elf sa 500-250 paġni. U għal darb'oħra, jekk inti tkompli l-loġika, tkompli l-matematika, jien tqattiegħ din il-problema min-nofs, min-nofs, fil nofs sakemm finalment jien la ser ma ssib xi Smith fil-livelli kollha, probabbli, jew jien ser issib l-waħda Qed infittex. Iżda, dan, allura, tqajjem il-kwistjoni, hija din xi aħjar mill-approċċ sempliċi ta 'ftit qal, tafu, A, Boq, B, l-ebda, li jibda mix-xellug għal-lemin going lineari permezz ta' l-ktieb? Well, istintivament iva. Huwa ser ikun ħafna aktar malajr. Iżda, kemm inqas? Ukoll, jekk ikolli elf ktieb tat-telefon paġna jew ejja ngħidu 1024 għal dawk minnkom li jħobbu setgħat ta 'tnejn, kemm żmien jista I għandhom maqsuma din il-problema nofs qabel konstatazzjoni Mr Smith? > Għaxar>. >> David: Allura, għaxar, id-dritt. Jekk għandek 1,024 paġni u inti maqsuma fil nofs, min-nofs, min-nofs, fil nofs, I do li għaxar darbiet li jfisser mmur minn 1,000 paġna lill-persuna Qed infittex fil-paġni biss għaxar dawriet. U din it-tip ta pulita, iżda, inti taf, jekk inti taħseb dwarha inti kont qed tagħmel dan kollu tal-ħajja tiegħek. Dan m'huwiex drammatiku. Imma issa, li l-phonebook mhijiex biss għall Boston, huwa għall-Istati Uniti kollu jew il-dinja kollha u dan ħaġa għandha biljuni ta 'paġni li, sabiex wieħed jimmaġina li phonebook ma erba' biljun paġni. Kif jirriżulta paġna ħafna jien ser ikollhom jagħmlu maximally biex isibu Mike Smith fi phonebook erba 'biljun paġna? >> Bażi Log tnejn. >> David: Allura yeah, jekk int xorta tat-tip matematika dan huwa ġurnal bażi tnejn. Iżda, jekk taħseb 4-2000000000 to minn biljun, so nofs biljun. I mean, li attwalment tmur whittles stess jistabbilixxi pretty darn malajr. Fil-fatt bi 32 halvings ta 'l-phonebook anki minn erba' biljuni, I'll tibda l-paġna waħda. U din meta dan il-għalf gets qawwija, naħseb. Li meta dawn l-ideat jiksbu konvinċenti meta inti jista 'jkollhom problema erba' biljun paġna u fil-32 passi li inti tista 'ssib il-persuna li qed tfittex. U għalhekk, dan huwa dak li aħna tfisser meta ngħidu li inti ser jitgħallmu kif taħseb aktar bir-reqqa, aktar algorithmically, aktar intelliġenti dwar soluzzjoni ta 'problemi. U l-prospetti huma enormi meta inti tista 'attwalment jagħmlu dan, u għal darb'oħra, dan il-punt ta' l-googles tad-dinja l-Facebooks li jkollhom l-lussu ta 'li datasets enormi. Għandek strateġija dawn il-problemi f'dan il-mod ieħor huwa sempliċement mhux ser jaħdem. Ukoll, dak li dak li għamlet l-istudent fil-fatt jiġi mfakkar? I, aħna nixtiequ li tagħmel affarijiet li huma daqsxejn iblah ftit kultant, li tip ta 'jieħu l-xifer off ta' dak li hu inkella lott ta 'materjal ġdid. U għalhekk, huwa attwalment, dan l-istudent ex mibgħuta lili din ir-rabta li I marru quddiem, biss għall kicks u mbagħad iddispjaċih fl-aħħar, jinġibed fuq uTube hawn. Allura, ħsibt nixtieq jaqsmu dak xjenzat mhux kompjuter tfisser meta tiċrit ta 'phonebook-nofs. ] Laughter [ ] Silenzju [ [] Inaudible >> Inti taf fuq minn 200 paġna, linja nadif sbieħ, tiċrita leġittimi. ] Laughter [ >> David: hekk, I suppose, triqtu xogħlijiet wisq. Allura, dak li sibt minn dan il-kors dawk kollha snin ilu hija iva, Shuttleboy, u mbagħad iva grad fix-xjenza tal-kompjuter, u mbagħad iva PHD fix-xjenza tal-kompjuter. U li mhux dak li aħna qed tipprova li jduru istudenti bl-akbar f'dan il-kors fi. Ħafna minnkom dan il-kors ma jkunux se jmorru fuq fil maġġuri tax-xjenza tal-kompjuter. Xi wħud inti tista minuri, iżda għal xi wħud minnkom dan se jkun kors terminali. U din perfettament multa minħabba dan il-kors huwa, fil-fatt, strutturati b'mod fejn anki jekk inti sempliċiment iħallsu drittijiet tiegħek għal diversi xhur u int verament jiffukaw b'mod u int verament jieħdu bħala minn ħafna ta 'dan il-kors kif inti tista', inti se, fil- fatt, ikunu mgħammra tajjeb li jmorru lura għall dinja tiegħek ta 'l-ekonomija, bijoloġija, il-psikoloġija, applikati matematika, u fil-fatt jagħmlu użu ta' dak li hu finalment bħala interessanti kors kif aħna nittamaw li kunċettwali minħabba li huwa fundamentalment prattiku. U li wisq hija xi ħaġa li l-forsi daqsxejn rari li ssib. Ħsibt I'd sehem xi kummenti li l-istudenti mill-aħħar taqa 'jitqiegħed f'din il-gwida CUÉ aħħar snin meta mistoqsi dwar dak li tixtieq tgħid istudenti fil-futur. Ukoll, jekk inti ma jkunux diġà ħares lejn dawn il-kummenti, wieħed student qal dan il-kors se jieħu ammont ġust ta 'ħin tiegħek sa. iżda, jekk inti tpoġġi x-xogħol tiegħek ġo dinja totalment ġdida, kollu kemm hu, jekk inti tpoġġi l-ħidma, jekk inti tpoġġi l-ħidma fi, alright, għalhekk dan huwa grammatika tiegħu ma mini, hekk jekk inti tpoġġi, jitpoġġew fil-xogħol, dinja kollha ġodda se jiftħu lilek. Aqwa kemm tgħallimt biss 12-il ġimgħa. Student ieħor kiteb, inti aħjar tieħu din jew int ser jiddispjaċina minnu. Ieħor kiteb, ftit aktar bi frankezza, se kick ass tiegħek u jħallu inti tħossok kbir. U mbagħad finalment, dan huwa wieħed forsi xi ħaġa I jistgħu juru biss bil-miktub, iżda, it-tieni mill-qiegħ hawn. [Laughter] Allura, jien mhux ċert jekk ikollok ħafna ħbieb li ħadu dan il-kors imma aħna tip ta 'ma' lott ta 'ħsara għall-istudenti sena li għaddiet. Aħna introdotta, fil-bidu, lectures diversi proċeduri, kwizzijiet ftit, ta 'settijiet problemi koppja, dan il-kunċett ta' lolcats. Inti ma tistax tara dak nista 'nara hawn imma fil-mument se tara żagħżugħ jismu qtates kuntenti li huwa l-mexxej ta' l-lolcat hekk imsejħa. Din hija waħda mill-quddiem l-internet stupid li naħseb franchement id-dikotomija bejn dawn iż-żewġ irġiel hawn u dak issa għandna fuq l-iskrin huwa forsi. [Laughter] Wieħed mill-użi l-aktar xierqa ta 'dan teatru sal-lum. U, għaliex ma nagħmlu ftit iktar reali ftit iktar personali dan il-kunċett ta 'fatt isolvi problema b'mod aktar effiċjenti. Problema sempliċi fuq ġurnata waħda ta 'kull skola huwa li joqogħdu bilqegħda jew wieqfa u jibdew jgħoddu l-istudenti, id-dritt roll sejħa ta' tipi. Ukoll, l-approċċ l-aktar naïve imma madankollu, ħafna minnu li għalliem jista 'jieħu wieħed, tnejn, tlieta, erba', ħames, sitt, seba ', u we'd jkun hawn żmien pjuttost twil. Allura, x'hemm titjib marġinali fuq dan anke li jista 'jkollok jsir bħala kid? Kif inti għadd nies aktar malajr? U, tibdiex qari mill-istruzzjonijiet tiegħi? What would you għamlu bħala kid? twos Bidu għadd, id-dritt, bħal hekk jien pjuttost tajba fuq żewġ, erba ', sitt, tmienja, għaxar, 12. Allura, li xi ħaġa dritt interessanti. Allura, kemm ta 'titjib huwa li jkun hemm? Allura, huwa ovvjament fattur ta 'tnejn. Huwa jieħu lili nofs daqshekk ħin. Imma, inti taf liema, kif aħna ser issib matul dan is-semestru, big deal, bħal tħaffif tmexxija tiegħek żmien biss fattur ta 'tnejn huwa mhux kollha li interessanti minħabba l-Analog hawn fid-dinja tal-kompjuter hija li jien CPU I'm kompjuter, ukoll Heck, jekk I biss stenna 12-il xahar, 18-il xahar, I il-kompjuter se biss ikunu jistgħu min-natura, bl-għadd ta gigahertz I lili biex tkun tista 'għadd nies f'din il-kamra aktar malajr. Allura, dawn it-tipi ta ', dawn it-tipi ta' speedups lineari simili b'fattur ta 'tnejn b'fattur ta' tlieta, anki b'fattur ta 'għaxra, quién? Dritt, nistgħu tarmi hardware fil-problema. Nistgħu nistennew affarijiet. Nistgħu jiżviluppaw magni aktar malajr. Iżda, intellettwalment, yeah li kien tip ta 'għaqlija imma ma verament jibdel b'mod fundamentali l-problema. Jien xorta ser mix-xellug għal-lemin, quddiem għal wara. Huwa tassew l-algoritmu istess. Imma, I joffru li nistgħu nagħmlu aħjar. Nistgħu nagħmlu intelliġenti minn dan u tagħmel fundamentalment implimentazzjoni aktar mgħaġġla. Iżda, biex turi dan, għandna bżonn li inti umoriżmu magħna għal ftit mument. U huwa f'dan il-punt fejn ser tkun me jitkellem inqas u inti titkellem aktar. Imma jien bżonn li inti teżegwixxi pass wieħed flimkien, li hija jekk inti humour magħna, jekk jogħġbok wieqfa. Id-direzzjonijiet hawn fuq il-bord, inti taf huma, okay, ftit ikollok joqogħdu bilqegħda. Dawk fostkom fid-dahar, hemm immorru, alright. Grazzi. Allura, il-programm hawnhekk hija qabel int. Inti issa huma l-kompjuters ta 'eżekuzzjoni dan il-programm. Huwa pjuttost awto spjegazzjoni f'dan il-punt. Iva, inti għandek tkun numru wieħed. Ġġibu? Dritt, ħafna inti probabilment ħsieb din xorta waħda diġà, sena Freshman ewwel. Allura, taħseb li lilek innifsek, int l-numru wieħed. Allura, bi tliet stadji hawn, par off ma permanenti xi ħadd, żid żewġ numri tiegħek flimkien u tadotta din is-somma bħala numru ġdida tiegħek u aħna ser tagħmel verifika sanità. [Ħsejjes minn] folla Taf kemm aħna għandna? >>] [Inaudible >>] Nru inaudible [. >> Hemm bżonn li jkollhom ewlenin risposta. ] Silenzju [ > Yeah>. [Ħsejjes minn] folla >> David: Fuq dan il-punt l-algoritmu għandhom jiġu istralċ isfel. [Ħsejjes minn] folla Forsi għandna marru bl-approċċ tiegħi wara kollox. >> 43. >> 163. >> David: aritmetiku Ooh quddiem ta '300 plus nies. [Laughter] X'hemm jaqblu finali tagħna ser tkun? >> 180. ] Laughter [ >> 1,200. >> 386. >> David: 386, u inti l-aħħar waħda wieqfa? Li kulħadd? Taf il-risposta? >> Liema? >> David: Taf x'inhi l-risposta hija? Aħna ma tressaq ewlenin risposta magħna hekk, 386 fil-fatt hija preċiżament il-tweġiba t-tajba għall-ewwel darba. [Cheering] Applause [] That's okay. Applause [] ħafna, ħafna nicely isir. Allura, dak li kien il-takeaway peress li definittivament feltru ftit aktar kajman minn approċċ sempliċi ħafna, iżda madankollu ħafna korretta tiegħi biss jmorru onesies u twosies u ġusta jkollna jsir ma mix-xellug għal-lemin. Iżda, dak li ma aħna verament biss ma hemm? Ukoll, jekk kien hemm bejn wieħed u ieħor, ejja ngħidu, 400 inti wieqfa fuq punt wieħed, u mbagħad nofs inti, malajr ħafna, minn dak li jien setax jgħid, riedu li joqogħdu bilqegħda. Allura, nofs inti poġġa bilqiegħda, aħna marru 400-200 mbagħad għal 100 imbagħad għal 50 imbagħad 25. Għalhekk għal darb'oħra, hemm li jifirdu istess u conquer-idea li kellna ma 'l-phonebook. Għal darb'oħra, ma 'kull iterazzjoni aħna bin-nofs id-daqs tal-problema, aħna bin-nofs dan, aħna bin-nofs huwa. Allura, fit-teorija, algoriżmu tiegħek għandu ve kien ferm aktar mgħaġġla minn metodu lineari tiegħi għaliex approċċ tiegħi ħadt jiġifieri 400 passi jew forsi jekk jien ftit għaqlija 200 passi. Iżda, kieku tiegħek ħadt ferm inqas, id-dritt 400-200, 100, 50, 25, 13, sitta; sabiex inqas minn għaxar passi fl-aħħar kontra tiegħi 200 jew 400. U hemm il-raħs ta 'idea verament interessanti. U iva, matematikament dak li inti biss ma kienet xi ħaġa li l-ftit logaritmika ta 'natura mill-bażi log żewġ, aħna maqsuma f'żewġ u żewġ darb'oħra. U aħna ser tirrevedi dan aktar tard f'dan il-semestru. Iżda fih tinsab għal darb'oħra l-implimentazzjoni ħafna intelliġenti. U, aħna biss grif tal-wiċċ tal-ħafna għaqlija l-approċċi effiċjenti ħafna intelliġenti għall-problemi li aħna jistgħu finalment jissolvew. Allura, li huma l-persuni inti biss ċċettjaw ma? Fil-qosor jekk Tħassib komuni fil-kors bħal dan huwa li kulħadd lejn ix-xellug tal inti u kulħadd għad-dritt tal trid b'mod ċar taf aktar milli suppost. Ukoll, li assolutament mhux il-każ. U fil-fatt, fis-snin reċenti, dan il-kors ikun għamel sforz miftiehem biex jilħqu lil dawk inqas komdi, biex ngħidu hekk. U minn dan, aħna tfisser mhux nies li qatt ma stajt mimsus kompjuter qabel minħabba li tassew diffiċli li ssib madwar hawn dawn il-ġranet, iżda folks li jużaw l-email, użu Facebook, forsi anki dritt issa iżda mhumiex neċessarjament pjuttost ċert x'għandek tagħmel meta xi ħaġa tmur ħażin jew meta huma mitluba dwar xi ħaġa teknoloġiku, inti taf, l-idejn jitla 'jew huma tip ta' spinta l-hardware lil habib / a li l-forsi aktar versed fiha milli. Ukoll, dawn huma xi statistika mill semestru tas-sena l. Allura, meta mitluba, meta staqsejna 400 tagħna sabiex l-istudenti aħħar sena, inti taf, liema huwa l-livell tiegħek ta 'kumdità li jidħlu f'dan il-klassi, ukoll 34% kiteb infushom hekk kif fost dawk inqas komdi. Allura, jekk għandek jidħlu fis din il-kamra u għadhom jaħsbu issa, li, inti taf liema, dan it-terminu inqas komdi jiddeskrivi lili, taf li inti fil-kumpanija tajba ħafna. Iżda, tirrealizza wkoll li, jekk int ġejjin f'dan il-kors bi sfond fix-xjenza tal-kompjuter u inti kienu verament li geek fl-iskola tan-nofs u għolja l-iskola li kien miktub tal-kodiċi u infuskom lingwi tagħlim, sew li l-multa wisq għaliex hemm definittivament nontrivial udjenza ta 'daqs ma' dak l-isfond kif ukoll, madwar 13%, tul l-aħħar. U allura, hemm kulħadd, tip ta 'xi ħadd li ma jaħsibx li qed inqas komdi, huma definittivament ma naħsibx li qed ssir aktar komda iżda dawn qed biss fil-kors biex nikseb xi ħaġa minnha. Allura, jirrealizzaw dan il-kors ma jiġbed pjuttost l-ispettru ta 'studenti. U, biex dan f'termini iktar konkreti, 71% ta 'studenti, is-sena, kienet żero korsijiet warajhom. Allura, jekk int jidħlu dan il-kors ħsieb oh kulħadd li jieħu CS50 kien whiz xjenza tal-kompjuter fl-iskola għolja, mhuwiex il-każ. Ħafna nies huma presumibilment biss interessati fiha. U ftit, iva, assolutament ħadu xi korsijiet, xi wħud, jew għall-inqas persuna waħda aħħar sena kien ħa ħames korsijiet qabel. Allura, aħna definittivament għandhom xi varjazzjonijiet kbar iżda għal darb'oħra l-laħam tal-kurva tkun dawk il-valuri aktar baxxi għal kollox. U ieħor l-istatistika interessanti we maqsuma matul l-aħħar ftit snin huwa l-proporzjon bejn is-sessi. Allura, storikament, għall-inqas fil-xjenza tal-kompjuter, hemm daqsxejn ta 'jimmodifika femminili maskili. I ftit ta 'snin ilu kien ħafna aktar notevoli minn dawk is-sena l-aħħar. Allura, we're kważi issa fil-40% livell. U jekk nista 'tarmi jistabbilixxi gauntlet biss għall-fini li jkun hemm mappa pie tielet sena d-dieħla, li anke aktar ekwu. Infakkar li hemm assolutament l-ebda raġuni mill-perspettiva korsijiet li l-irġiel u n-nisa ma għandhomx ikunu rreġistraw f'dan it-tip ta 'kors. Fil relattivament istess għadd u tirrealizza sa 38 fil-mija, 48 fil-mija, we're attwalment pjuttost kuntent li jara li we're kwazi li, għallinqas, statistikament anke valur ta '50%. Għalhekk, jekk inti, fil-fatt, nisa, ma mistrieħ żgurat ukoll li dan mhux, fil-fatt, klassi iddominat maskili. Ukoll, dan biss hekk jiġri li jkun birthday 20 CS50's. I, ukoll nirringrazzjak. [Cheering] Applause [] Dak sbieħ ħafna minnkom għaliex aħna ippreżentat kejk għalik attwalment. U għalhekk, meta inti ħruġ hawn aktar tard illum, inti ser attwalment jiksbu opportunità li jilħqu ħafna tal-korsijiet ta 'tagħlim fellows li ser tkun wieqaf fil-hallway. U iva dan ser ikun tip sbieħ tal-mod inċentivizzati jintlaħqu l-inkarigati mir-tagħlim. Iżda, aħna jieħdu vjaġġ sa forn ftit u jerġa 'konsistenti mal-kors huwa natura jilgħab filwaqt li madankollu qed tistenna l-ammont ta' xogħol filwaqt li nontrivial qed ikollna din gost. Iżda, għandna waħda minn dawn kejkijiet għalik. [Laughter] Mela, jekk int laughing li fil-fatt tajba għaliex anki jekk int fost wieħed minn dawk anqas komdi inqas int konxji ta 'dan. Dawk fostkom fil-mija 14, jista 'jippreferi dan togħma. [Laughter] U mbagħad, jekk ma tkunx taf x'inhi l-infern li qed jiġri issa dritt, irridu wkoll dan għall-kumplament tal inti. [Cheering] ] Applause [Allura, dawk qed mqattgħin f'biċċiet barra kif nitkellmu. Allura darb'oħra, let's tagħti affarijiet up a talja u mill-inqas introdotti xi kerrej bażiċi li aħna ser imbagħad jieħdu għal mogħtija fil-bqija ta 'dan semestru. Allura, aħna kollha taf li probabbilment kompjuters finalment jsarrafx biss fl b'xi mod żerijiet u dawk, dawn l-affarijiet imsejħa bits. Xi jfisser? Ukoll inti tista 'taħseb li franchement bħala bozza tad-dawl, daqsxejn hija bozza tad-dawl li l-ġewwa jew huwa off. Huwa swiċċ, huwa jew fuq jew huwa off. Issa, xjenzjati tal-kompjuter ġeneralment jaħsbu off bħala l-għadd żero arbitrarju u l-, u l-kunċett ta 'fuq kif wieħed. Għalhekk, jekk inti tarmi switch tad-dawl fuq dak l-tidwira off li l-żero. Jew, b'mod ekwivalenti, imbagħad-dawl fuq dak l-valur ta 'dawran veru off dak l-valur ta' dokumenti foloz. Allura, dawn huma biss sinonimi. Fl-aħħar tal-ġurnata, iva, kollha komputazzjoni, kollha Jittieħed li tmur fuq taħt il-barnuża fil-kompjuter ma finalment jsarrafx biss fl żerijiet u dawk. U, meta tieqaf biex taħseb dwarha, huwa pjuttost diga notevoli dak id-dinja jsir ma 'dawn il building blocks bażiċi li jinkludu wħud mill-mekkaniżmi int azjenda f'idejk. Ukoll, għaliex huma żerijiet u dawk utli? Alla tiegħi, anki fid-dinja reali għandna mill-anqas ikollhom ċifri għaxar, żero permezz ta 'disa. Għaliex daqstant limitat? Tajjeb fir-rigward hardware huwa faċli ħafna. Huwa ħafna aktar faċli li jirrappreżentaw żewġ stati, id-dritt. Jekk kompjuters huma pplaggjat fil-ħajt, normalment, inti għandek dan is-sors faċli ta 'natura binarja. Hu jew fuq jew barra. Elettriku huwa mexxej jew mhuwiex. Allura, li l-xorta ta 'waħda mir-raġunijiet inizjali li d-dinja marru bi ftit żeri u dawk fil-kompjuters. Iżda, inti tista 'tużahom bħala sisien. Allura, dan fil-fatt hija ftit żgħira fuq l-iskrin hawn iżda nistgħu jgħodd binarji jew nistgħu jirrappreżentaw xejn li rridu fl binarju hekk kif nistgħu, jiġifieri, punt deċimali, eżatt kif nistgħu, anki fil-fatt, ma 'ittri alfabetiċi. U għalhekk, hawnhekk ser sistema malajr. Fi ftit żmien il minuta koppja tkun taf issa taf kif għadd, kif jiktbu, kif jitkellmu binarji simili ħafna laptop tiegħek. Ukoll, inti għandek, fid-dinja ta 'binarju, it-tip ta bħall kolonni iskola grad jew il-valuri. Allura, fl-iskola grad nitgħallmu dan huwa l-dawk kolonna dan huwa l-kolonna għexieren, il-kolonna mijiet u oħrajn. Fi kliem ieħor, għaliex huwa n-numru nafu kif in-numru 123 123? Ukoll, għalliem tiegħi għallmitni dan huwa l-dawk kolonna, dan kien il-għexieren, dan kien l-mijiet. Ukoll dak ma jfisser? Ukoll, għal ċifra barra dak il-valur totali hu ta 'dak li hu inkella l-sensiela ta' numri, biss marki tal-hash fuq il-bord. Ukoll, aħna għandna waħda 100, b'tali mod li l-1 100 darba u mbagħad flimkien ma 'dak iż-żewġ 10 hekk li's dawk 2 darbiet 10 flimkien ma' tliet, b'tali mod li l-3 darbiet 1, okay, so I jidhru li gotten lura lejn fejn bdejt. Iżda, dan il-proċess sempliċi ħafna ta 'ftit multiplikazzjoni tal-numri bil-valur tal-kolonna huwa eżattament dak li binarja hija kollha madwar. Iżda, fil-binarji inti tuża l-poteri ta 'żewġ mhux setgħat ta' għaxra. Allura, here's a serje ta 'tmien bozoz tad-dawl. xjenzjati tal-kompjuter jixtieq juża valuri bħal xahrejn u tmien u 16 u 24 u 32 minħabba li dawn qed kollha valuri ġeneralment konvenjenti għall-użu. Allura, meta nitkellmu dwar tmien valuri fis-sekwenza li dan huwa simili imsejjaħ il-byte. U dawn il-jiem aħna rarament nitkellmu f'bytes biss, nitkellmu gigabytes megabytes u terabytes dawn il-jiem. Imma dan kollu finalment l-istess ħaġa. Hawn tmien bits AKA byte waħda, biss jargon sempliċi. Allura, kollha ta 'dawn bozoz tad-dawl huma off. Allura, l-matematika huwa attwalment verament faċli. Allura hemm fuq il-lemin, għalkemm huwa żgħar biex tara, huwa kolonna l-waħda, il-twos, il-fours, il-eights, il-16S, 32s, 64s, 128s. Alright, forsi huwa diffiċli li jimmemorizza fl-ewwel imma hija biss multiplikat bi tnejn minn lemin għax-xellug. Allura, inti tista 'dejjem jirrikreaw dan. Ukoll, dawn qed kollha jintfew hekk li l-ħinijiet 0 placeholder, 0 darbiet placeholder. Allura, dan huwa n-numru 0 rappreżentati fil binarju. Fi kliem ieħor, kif taħseb li jiktbu n-numru nafu kif 0 fil-binarju? Ukoll, wieħed, tnejn, tlieta, erba ', ħames, sitt, seba', tmien, u teknikament eżatt bħal fil deċimali, f'kull wieħed minn dawn żero fuq quddiem, dawn ma żżid xejn mal-formola li qed biss hemm għaliex aħna arbitrarjament deċiż aħna jridu tmien ta 'dawn l-affarijiet fir-ringiela, id-dritt. Jekk dawn qed oġġetti fiżiċi, aħna għandna tmien sabiex ikunu ħadthom qbilna li kollha ikunu mitfija. Għalhekk, nistgħu ħadthom biss gotten bogħod ma 'wieħed żero. Ukoll kif taħseb li jirrappreżentaw numru wieħed? Ukoll, istintivament int ser tarmi wieħed mill-qlib. Int ser jagħlqu bozza fuq. Allura, hemm numru wieħed għaliex aħna issa tinsab waħda, bozza tad-dawl li dwar, fil-pożizzjoni l-wieħed. Kif aħna se jirrappreżentaw tnejn? Ukoll, we're fil-fatt se tarmi żewġ swiċċijiet issa anqas kontra dan l-istat, għandna jduru fuq il-kolonna żewġ's itfi l-ones kolonna u issa għandna l-valur ta 'wieħed fil-kolonna twos. Allura, dak l-valur totali ta 'żewġ. Issa, eżerċizzju mentali malajr; x'inhu jiġri mas-sekwenza li jmiss? Kif nista preżenti in-numru tlieta? Well, I ħtieġa waħda mill-kolonna twos, wieħed mill-kolonna inqas minn tliet snin u ha ah. Allura, issa stajt inkrementat li wieħed. U issa, dan jirrepeti istess mudell bażiku. X'hemm-numru erbgħa? Well ejja ara, I biss ħtieġa waħda fil-kolonna fours u mbagħad żerijiet fil-twos u dawk. Allura mbagħad, hija tkompli b'dan il-mod. U, huwa biss dan sekwenza ta 'passi. U fil-kunċett ta 'binarju huwa verament mhux kollha li kumplikati. Fil-quċċata hemm għandna tmien żerijiet. Hawn taħt li għandna seba żerijiet u waħda. Hawn taħt li aħna għandna sitt żerijiet, waħda, u żero u li l-binarju. Now, thankfully, we computer scientists, we programmers by terms end are not going to often be writing in binary, talking in binary, thinking in binary because we've built many layers of the traction on top of that. In fact, people rarely talk about bits except in a networking context they talk about bytes because one bit, not that useful, eight bits these days still not that useful, but at least eight bits, one byte is at least getting us toward more useful units of measure. But, when we start looking underneath the hood, when we do certain problems such as look at files and look perhaps at network traffic, it will become interesting to know how you're representing data because you're going to have to figure out how to display that same information. And, in fact, we, if we only have zeros and ones, how do we go about representing, say alphabetical letters? Well, we're going to have to have some mapping between binary and letters. But that's as of yet unclear. But to hammer this point home and to give me a break from speaking at, I thought I'd pause for a moment and see if we can't recruit eight volunteers, one byte eight people. Can I get eight people for whom it is not too awkward to come on up. good, good one, two, three, four, five, six, seven, eight very enthusiastic eight, come on down. So, you all, for just a moment here, oh and you have to be willing to not be on the internet because there is in fact a camera in the back of this room. So, turn back now if you don't want to be on the, hello mom, in perpetuity. So, let's see, you here will be the 128th column. And let me ask that you simply hold this before you. And actually, if you could scooch this way just a little bit, then I will get out of your way. You'll be the 64's column, you shall be the 32's column and the 16's. 32's, 16s, 8's, 4's, 2's and 1's. All right. So perfectly lined up with the place holders from before, but we need a little bit of mapping, so a quick set up. We just need an arbitrary way of mapping binary numbers, which really could be converted very easily to decimal numbers. So we need a way of converting numbers to letters if our computers are actually going to show us emails or type URL's or actually display non numeric information. And, in fact, there is a system for that, it's called ASCII, an acronym whose meaning is not so interesting, but whose utility is. This is just a mapping from letters to numbers and there's actually a lot more numbers on the screen, and you guys, don't worry, aren't going to have to test yourselves with this in just a moment. But there's a mapping between numbers and letters and I'm just going to get us started by pointing out a couple of these. The numbers of interest right now are going to be, whoops, are going to be this. Whoops. So in this column here, I can't seem to zoom in simultaneously, we have decimal. Dec for decimal. And then we have the character on the right hand side. So if I hop over into this column, thought it's a bit small on the screen, the number 65 represents what letter? Capital A. And the number 97? Lowercase A. All right. So those two alone, right, so do not go home and try to remember ASCII chart. Come quiz time, do not try memorizing an ASCII chart. Memorize two, 65 is capital A and 97 is lowercase A. And from there you can bootstrap yourself to all of the other alphabetical characters. But all this chart says, and I just downloaded this chart from ASCIItable.com, this is a standard that's been around for many, many, many years, but most computers still use it. What we now have is a means of encoding alphabetical information using what's ultimately numeric. So if these guys are just switches, light bulbs, computers, we can actually convey messages. So each of you has some hints on the back. We're going to have three rounds here where these guys are going to spell out in English, in ASCII, a very short message, a three letter word. It will involve them either raising their hand, thereby representing a one or just standing there awkwardly, thereby representing a zero. So why don't we proceed immediately with round one and you can either raise or not raise your hands. So the audience doesn't get off the hook. What number are they currently representing? 66. Right. Not hard because we have a one, a hand up in the 64s column, a hand up in the 2's column. 64 times one plus two times one is 66. They're representing the number 6, which means the first letter is B. So not too bad, right? Round two. First letter was a B. ] Laughter [ >> Seventy Nine. >> David: Can someone second that? Yes. All right. So 79, which means it's now an O. So B,O. There's a third letter. Actually that is kind of, yeah. Third round. Third and final round. What number is this? I heard an 87. Someone else agree? All right, yeah. This is in fact 87, which maps to, and this is a very clever set up at which point you all B, O, W, it's bow. Very good. So actually besides that little souvenir, that was not a very enthusiastic applause, so I'll take care of you. So we do have a little something for these guys here now that they just appeared on center stage doing perhaps the geekiest thing they could. So maybe if we could humor them if only because I'm feeling a little bit awkward now. A little round of applause for these guys here. [ Applause ] All yours. All right. Thank you very much. So, so, it turns out that we can take this one step further, but you are now entering a community of people who understand things like this. [ Silence ] It's slowly spreading, yes? [ Laughter ] It's not cool that you understand this now. So we've already done some damage here today, but yes, there is now such a thing as geek humor that you might just catch a little bit more on to. So what are we going to do throughout this semester? So there's 12 weeks, zero index, so 13 weeks in total. You'll find throughout the semester that computer scientists tend to count starting from zero for reasons that will soon become clear. But what we're going to do this week, starting this Friday, is introduce you to programming. Now you may already be coming at this course with a background in the same, and that's perfectly fine, but we'll also be able to introduce some more sophisticated topics than are typically covered, things like events and threading, so just to toss out a couple of buzz words for those unfamiliar. But what we're going to do is not dive into what the typically traditional language like Java or C++ or C sharp catch phrases that you might have heard in the past, but we're going to use a programming environment, a graphical programming environment that was actually developed by MIT's media lab. And this is an environment that allows you to program, quite literally, by dragging and dropping puzzle pieces that fit together logically that lets you implement these things called loops and conditions and Boolean expressions and you can actually, on day one, after this Friday, write a program that actually some of your friends might care about. So in yester year, say when you've taken a computer science course in high school, odds are one of your first programs was the equivalent of hello world, like wow mom, I just made the computer type some characters on the screen. It's a very underwhelming experience. Much more interesting is it to implement a little something like this, as one of last year's students did. So I give you the work of a former classmate. It's a love story, of sorts, about dancing cookies. [ Music ] So this was actually from a student who had never programmed before. And just to give you a teaser of this interface, and we're only going to use this for one week time, really to get the comfort levels up and to really get folks excited about what you can actually make these machines do, this is an environment where you'll be programming by, for at least a week, just dragging and dropping puzzle pieces that fit together, as we'll see, in a logical fashion. And it lets you do fun, silly things quickly. And for any of you who are a little bit familiar with things like Java and C++, it's usually a good semester or two or three before you finally get to start writing something that another person might actually enjoy watching. Well, in week one of the course, or the second week, zero index, where we dive into a little more traditional environment. In this course we'll spend much of our time on a language called C. This is one of the earliest languages that, unlike Java, actually gives us much greater access for better or for worse, to manipulating hardware and actual memory, and we can do a lot of damage with that. In fact, any time you read of web servers being exploited or computers being hacked into, very often to this day it's the result of people having run software in a language called C or C++ without sufficient care given to what are called buffer overruns or lengths of arrays, so some fairly technical concepts that are not that hard to understand, but there's been a lot of humans making a lot of mistakes for years and with this language we'll actually understand some of those security implications. But each week, typically, we'll introduce also an interesting domain that will inspire that week's problem set. So we'll also take a look this week at the field of cryptology, cryptanalysis, the notion that you can encipher information in such a way that people can't read your messages, but if clever enough perhaps you can, in fact, crack what are otherwise secret messages. In week three we'll then look at some basic fundamentals of computer science like searching and sorting and we'll actually look at this notion of recursion, how to debug things. In short, we'll take things up to the level of problem solving and not so much about mere syntax and implementing short little cookie cutter programs. In week four we'll introduce more sophisticated problems still. What does it mean to manage memory? What does it mean to run out of memory? What does it mean to actually segfault, if you've heard this expression, and odds are you haven't, but very bad things happen and frankly by terms end you'll understand terms like my code segfaulted which actually is generally not going to be a good thing. But then again, we'll introduce some domain specific stuff. So actually one of my internships during graduate school was to work for the local Middlesex County District Attorney's office doing forensic investigations in a digital sense. The local Mass state police would bring to our office hard drives and floppy disks and sometimes for no reason mice and keyboards. And we would be tasked with finding evidence. Now it turns out, maybe just an FYI, that the criminals in Cambridge, Massachusetts, at least, not necessarily that clever. Very often our forensic analysis boiled down to booting the computer up and double clicking on the My Documents folder, and therein laid the evidence. But what we'll do this week is give you a sense of what it actually means to store information on a hard drive, on a flash drive, and why can't otherwise private information be disclosed to third parties when you drop off a computer to be repaired or even when you discard it. Well someone might very well be sifting through those hard drives and it's really not that hard to find data if you know how to look for it. Well, in week five we'll look at more sophisticated data structures, tools and techniques that you can use ala phone books and ala searching huge data sets much more intelligently. And the week's problem set will task you competitively to see just how fast the code you can write is and how little memory you can use. Toward terms end though we'll take things up to a higher level in terms of programming languages and put C behind us and introduce a web programming language known as PHP, one of the popular languages these days. Much of Facebook is still written in PHP, at least outward facing, and it's just a very easy language to learn quickly once you already know another. So with PHP we'll be able to solve problems and implement websites that do interesting things. The news site I showed you, the events site, the shuttle boy site, all of those all happen to be written in PHP. But by no means is that prerequisite. What you'll also find throughout this course is that you're not going to exit this course knowing C. You're not going to exit this course knowing PHP. Those are not interesting skills to claim, but knowing how to program, knowing how to use data structures and algorithms in an interesting way, that's a compelling story. Even I, all these years later, throughout college and graduate school, the only time I ever learned a language was probably in CS50 where it was still taught in C and CS51, which is one of the successor courses. Everywhere along the way since has been go learn this language and then work on this problem set because computer science is not supposed to be about here's a language, let's spend seven weeks teaching you where the semi colons are. There are much more interesting ideas out there. Databases, for one. And in week two we'll introduce you to this query language called SQL that'll allow you to store information in databases and actually implement some fairly interesting final projects. The week after we'll look at what's called client side programming, doing interesting things on a user's computer, taking advantage of their CPU cycles, doing things ala Google maps and these websites that actually use JavaScript, which is actually a language we'll introduce to let you do client side things, make more interesting, more sophisticated user interfaces, but at the end of the day have to be really mindful when implemented of a lot of sticky issues like network speeds, network performance and security. So it's not about again just coding something up that's fun to use or pretty to look at, but actually thinking about the design that'll be the interesting process. And then, the end result aesthetically will often be a really neat toy to show yourself or a friend. And then we'll look at hardware. We're going to take for granted that there are these physical boxes throughout much of the semester that will do what we tell them to do. But how are they doing that. So we'll actually take a peak under the hood and talk about what a compiler really is, what a CPU really is and actually consider what's making all of this fanciness from stupid YouTube videos on down possible. So what are the expectations? Attending lectures and sessions, completing nine problem sets assigned roughly weekly, two quizzes, the final project and there is in fact no final exam. Grades, it's always a question, broken down as follows here. You can take the course pass-fail. But let me say it here, and I've said it many times. I personally care relatively little about grades. I think they are a wonderful, well, they are a useful pedagogical tool with which to motivate and unfortunately sometimes de-motivate, but you'll find in this course that at the end of the day it's more about seeing how far you can go from weeks zero to week 12, as we say in the syllabus than it is about absolutely ranking all students in this course. So if you're coming into this course among those less comfortable, though a large demographic do not assume that that's automatically putting you in the lower third of the so called distribution. At terms end do I sit down with the TF's and discuss each and every one of the students. We take into account where a student came from, what kind of trajectory they were actually on and so at the end of the day please focus more on, and I don't mean to sound too grand, the process of learning and less on the numeric's. And you'll actually see that we grade problem sets, in particular, very coarsely, whereby along three axis, you will get a score of 1, 2, 3, 4, or 5, where 3, is in fact good. 3 is not C. 3 is good, 4 is better, 5 is best. But more on that as the problem sets are released. So the course's website is where you will find, as in most cases, a whole lot of useful things, if not silly things, too. And we have the luxury, as computer scientists of implementing it ourselves. So over the course of the semester you will see various new features rolling out. You'll find out over the course of the semester that the bulletin board is a wonderful place, certainly in the course of this size, to turn when you have questions about the problem set, questions about some computer science concept. You'll be able to check your grades, download all handouts in advance of lecture typically will I post the slides, if you're the type who wants to scribble on notes. But as you've seen, usually I shy away from long lists of details and more like pictures of cats and other visual cues. So you'll find, too, that we will provide printouts of code when we actually think it particularly advantageous to write right on the paper. Software, videos will be available, usually around 1 to 2 to 3 days maximally after each lecture. So the courses are being filmed and every lecture will go online in various formats including QuickTime and MP3's for downloads to iPods and such. And also you will find a link to download what we call the virtual terminal room, which as you'll see is related to virtual office hours. Books are expensive and in the computer world also not that useful. They are on the shelves of the coop, although we're told that last year they ordered like 120 books for the course and 30 were actually purchased, but this perhaps speak to the fact that there are places like Amazon.com, so if you are the type who actually enjoys the sort of support structure that a book provides, if you like to read up more than say a course's typical materials offer, by all means, procure one or more of the books that we recommend here and discuss more in detail in the syllabus. But realize there are so many resources that this course provides in printed form and electronic form, and my God, there's the whole internet out there. Books are not something that are required for this particular course. Lectures, in general, will be Monday's and Wednesday's, except for this Friday and next Friday, simply because of shopping period and Labor Day. So we'll meet this Friday, next Wednesday, next Friday, but there after this is just a Monday, Wednesday course. So this little visual cue here is to remind me that yes, we do distribute videos in QuickTime formats, MP3's, fun ways that you can, if you're actually this type, maybe in the 14 percent, watch a computer science lecture on your iPod, but it reminded me that at terms end last year, the course culminates in final projects, in which students can design most anything they want, and we actually had some students tackle some iPhone applications. Some one of these at least is now in the Apple store. It's called Rover. It's been adopted essentially by Harvard agencies and it's the iPhone version of the unofficial guide to life at Harvard. They did a brilliant job. I bring this slide up too, just to point out what other technologies might very well be down the road. Some of you may have seen this before, but just to give you a teaser of apparently what's in the pipeline, I thought I would offer this brief distraction here. ] Mużika [ >> With the MacBook wheel, Apple has replaced the keyboard with a sleek, touch sensitive click wheel. Apple CEO Steve Jobs introduced the product yesterday at the annual Mac Expo. Senior product innovator says the MacBook wheel will make typing a thing of the past. >> At Apple our philosophy is create products that are simple to use and nothing's more simple than a single giant button. >> Gilman showed me how the revolutionary new computer works. >> Gilman: Just open the intuit-type alphabet menu here, scroll to the letter you need and center click to select it and click again to capitalize and repeat this process for each new letter. It couldn't be simpler. You could also let the predictive sentence technology complete the sentence for you. >> Gilman says the MacBook wheel has also simplified organization of files, so searching your hard drive will be a snap. >> Gilman: Just press both sides of the wheel concurrently and center click and there, you have an alphabetical list of every file on your hard drive. Everything is just a few hundred clicks away. >> Apple is calling the MacBook wheel the most intuitive product every designed. >> Here at Apple we like to think that we're giving customers features they don't even know they want yet. >> While the MacBook wheel won't hit the shelves for another 3 to 15 months, many apple users already have it on their wish list. >> I'll buy almost anything [inaudible] and made by Apple. >> Alex [inaudible] was one of the lucky few to get to try out a MacWheel and spent 45 minutes typing an email to his friend. >> I never really realized how much I hated keyboards until I saw this thing. >> I like how it automatically says, sent with a MacBook Wheel, so people automatically know you have one. >> With a price tag of just under 2600 dollars for the lowest end MacBook Wheel, it is an investment. But the super thin laptop features numerous innovations, like the new ultra thin hummingbird battery, which can power the MacBook Wheel for a fill 19 minutes before needing to be recharged and the computer is virtually unbreakable unless dropped or hit. But Apple isn't resting on its laurels, Bryan Gilman says they're already hard at work on the next generation of the MacBook Wheel, which will be four ounces lighter due to its lack of streaming hard drive or wheel. For the Ugly news Network, I'm Jeff Tate. >> Thank you for that, Jeff. It remains to be seen if the wheel will catch on in the business world where people use computers for actual work and not just dicking around. Moving on, police warn. >> David: So I've seen that thing at least a half a dozen times now, including once at like two a.m. last night and I was scrolling down on YouTube and literally like an hour prior, some guy in all seriousness posted, just a wheel? That's the stupidest product I've ever seen. [ Laughter ] And then the rants ensued in the thread thereafter. So besides lectures there are also sections and it is your teaching fellow and the course's course assistants that you will get to know very well over the course of this semester. Sectioning won't begin for a week or so's time. More on that in the lectures to come. But know that the course will have several different tracks of sections, much like First Knight's has for music. Sections targeted more at those less comfortable, those more comfortable and those somewhere in between. And we also offer most Sunday nights before a problem set is due on the following Friday is what we call code walkthrough's where one of the course's teaching fellows will lead a session targeted specifically at the week's problem set and will help you answer the question where do I begin, how should I approach this? And that too will be filmed and made available online and always linked on the course's website. So this course has a huge staff. Our staff is larger than Harvard's average class size. We have over 50 people involved in the production of this course on a weekly basis. Some of them teaching fellows who hold sections, grade work, hold office hours and more. Course assistants who are former students, who are offering on a volunteer basis in fact multiple hours of office hours in the computer lab per week. System administrators, folks doing all of our AV and video production. Someone who will actually be taking notes for you. So it is actually my opinion that scribbling down almost every word that someone like me says is not a very good use of one's time. It's much more interesting I think to actually engage with what's on the screen, what's being presented. And so what we will do as a course is post PDF's online within a couple of days of lectures of scribe notes, which is essentially an authoritative version of course notes, unedited, but documenting what went on in lecture that day, thereby hopefully freeing your minds and pencils from jotting information down. We have some of our team here. Most of our team is actually shopping courses. But if a few of your guys would like to come on stage for a moment with our head teaching fellow and assistant head teaching fellow. Allow me to ask the latter to say a quick hello. And as these guys come up in absentia allow me to say that also on staff this year besides the folks you see here are Alex, Alice, Andrew, Batul, Charlotte, Chris, Dan, Dan, Daniel, David, David, David, Derek, Dev, Didi, Doug, Drew, Erica, Fil, Glen, Greg, Janice, Jason, Jean, Jeff, Jesse, John, John, Jonathan, Jordan, Josh, Karim, Kelly, Ken, Kent, Kyu Bok, Lee, Madhura, Marta, Matthew, Michael, Michelle, Mike, Mike, Nathan, Patrick, Peter, Peyton, Rose, Saba, Sanjay, Shannon, Stacey, Ted, Wellie, Yair and me. So our course is teaching fellows and course assistants, Cansu and Yuhki, would you like to say a quick hello? >> Hi. It's definitely a great honor to be back here for the third time. And if you're one of those who are like less comfortable. [ Laughter ] I think I can [inaudible]. Okay. [ Laughter ] If you're one of those [inaudible]. There's no need to be afraid. I walked in here two years ago with no experience what so ever, and I thought that I was like dumb and I was sure that I was going to fail the class. And I came back for the third time. I did not fail the class. This course is great because it has such a good community. As you can tell by the names listed by David. All the CA's and TF's are here to help you. So if you have any questions at all, just come up to us. Not taking this class because it's hard is not a good excuse. So, hi. >> [Inaudible]. >> Hi, so well both as a student and TF, I've really enjoyed being a part of this course. And even though it's a course that requires a lot of work from you, we've put a lot of work in to it for you as well to make it as enjoyable and as fun as possible. So, we really hope that all of you stay and take part in this very special experience. >> Thanks. >> David: So you will find, thank you, all of you, you will meet them in the hallway in just a few minutes as well. So you'll find that this course, perhaps more so than many is very much a shared experience. This is not a competitive course. This is not your premed course. This is a course which ultimately yes is about doing independent work, as you'll see each week by way of the problem sets. But you can't help but to get close to someone when you're fighting with some bug and banging your head against the computer screen proverbially to try to track down some bug. And I think you'll find that past students will concur that you exit this course with a lot of friends among students and also on staff. So where does that happen? Well, within office hours in the basement of the science center there's some large computer labs and we pretty much take them over five nights a week. These won't start for some time, and this, to be honest, is perhaps the most beautiful picture of the science center I've ever seen. [ Laughter ] It does not look like that on the inside. But it is a place where a good percentage of students do choose to spend time to get one on one assistance with each of the week's problem sets. Each week we will offer more than 100 hours of assistance one on one in the science center per the schedule that will eventually go online. And for those of you who live, say in the quad, or in Mather, or who just don't want to trek all the way to the science center to ask that quick question, we also offer what are called virtual office hours, much like remote technical support where you'll be able to log into a glorified chat room, in which yes, you can type back and forth with a TF or a CA, but you can also share your screen or share control of your mouse with them subject to your consent so that they can help you troubleshoot any problem or any question you have remotely. To give you a sense of what's involved in the course, these are statistics from last year. So you will, I think it's quite fair to say, work your ass off in this course. But per my promise from the start, this is one of those experiences that I don't think a typical student regrets. If you flip through, for instance, the Q Guide forms that are all on the course's website, you'll find that only by putting in the time to a course like this do you really exit having felt like you got something out of it and frankly might very well even have emerged even smarter. So what does it mean to actually write programs and implement problem sets? Well, the first problem set last year, a quick retrospective here, was to implement your very own programming scratch. And we spend just the first week there, and the goal is to implement your own game or animation or art or anything that appeals to you. In week one, then do you implement some basic C programs to get acclimated to some more traditional programming environments at the command line, at Linux so you get comfortable with some of these basics that will certainly serve you well in the long run. Last year's Problem Set 2 was about cryptography. We gave students the opportunity to implement some ciphers, some algorithms that let them encrypt information. And we also offered some students the opportunity to do the opposite. Each problem set, many problem sets, as you'll see are implemented in two editions. A standard edition that we expect almost everyone to do, say 90 percent of the class. And then a hacker edition, which presents the material from a more sophisticated angle, expects perhaps a bit more clever work for those more experienced, and for this one did those students get handed in the hacker edition pre existing user names and passwords in encrypted form and they had to figure out what those passwords for. We actually got into trouble for this a few years ago because all of the sudden FAS Computer Services saw like 50 people running a crack program on nice.fas.Harvard.edu, so they now have been given a heads up for programs like that. Last year students implemented the game of 15. Not all that much fun to play as a party favorite, moving the numbers up down, left, right, but a real stepping stone to implementing something interactive that involves a human and the hacker edition for this one had students implementing God mode, which actually solved this thing for the human, maybe cheat mode is the more apt term, in Sudoku, which was a step up toward that, where we provided the students, you, with a framework with a whole bunch of code that you needed to first understand before taking things the final mile and implementing some of the remaining functionality. And then we dabbled in forensics and this grew out of a real world experience between me and a friend. For this problem set last year, this buddy and I, who he being a particularly good photographer, strolled around campus and we shot photographs of unique, non obvious, but identifiable places on campus. And this was using his digital camera. All of these JPEGs got stored on a digital flash card or what not. And then I accidentally formatting the thing, or erased it. Well, it turns out formatting something or erasing something, usually means neither. It just means doing a little bit of work to make the human think their data has been erased, when in reality it hasn't. It's just been forgotten. And so we tasked last year's students with writing a program in C to actually recover these photos for my friend. We gave everyone a forensic image, so to speak, a big file representing that compact flash card, and they had to recover the several dozen photographs. And they also had to solve this little murder mystery. We provided folks with this image here. Those of you who've seen this before might be doing that squinting thing right now where you're trying to look through the picture, well you look pretty awkward, because this is not a magic eye puzzle. This is just random red noise that actually has behind it an actual message. And it turns out, I think it was Colonel, let's see, I've got my little solution here. Last year it was Colonel Mustard in the study with the candlestick. And this was the murder message recovered by students who wrote code to do so. And then in Problem Set 6 last year. We challenged students with implementing the fastest spell checker possible. What do we mean by that? Well, we handed the students a big text file containing 140 plus thousand English words, and we said write a program that loads all of these words into memory, but very quickly and very efficiently can tell us yea or nay, is this document perfectly spelled or are there errors? And what we provided was a testing framework, a harness, that students, if they wanted to compete, could run their code against some benchmarks, against some testing programs that we wrote. And then, ranked on the course's website from fastest to slowest were the running times, the amount of time it took for each student's code to actually execute, complete opt in. It's by no means required. And we took a bullet for the team and made sure that one of our own teaching fellows intentionally, I think, was at the very bottom of the list. So, there was definitely a lower bound. But the odd, the funny thing was we saw this in the cue guide evaluation, this problem set of all things, was apparently the one that people sunk the most time into. Not because it took any longer than all the other p sets, but they would come back from like dinner, look at the board, and realize dam my friend, my roommate just ever so slightly inch higher than me and so it incentivized people if only to one up their friends and roommates. In Problem Set 7, last year, we asked students to implement their own E*Trade like website, whereby you had to create a website using that language call PHP a database called mysql that actually lets people log in and then manage a portfolio of stocks, buy stocks quote unquote, sell stocks quote unquote, get stock quotes. And from where? Well, we have the students; we had the student patch into Yahoo Finance where they grabbed merely the Real time stock quotes to actually simulate the process of buying and trading stocks. Unfortunately some students, perhaps some economics majors or just folks with too much free time figured out last year how to gain the system. So, even though we gave everyone 10,000 virtual dollars, I think our winner turned teaching fellow this year actually, right don't push them away make them one of your own, for a billion dollars something like that ridiculous. Turns out we weren't really checking whether or not people were trading after hours. And it turns out that also, Yahoo stalk quotes are not in fact perfectly Real time which means if you just have a real E*Trade account you can see the future and see where the stocks are going. [ Laughter ] So, apparently you can exploit that if you put your mind to it. and then, in Problem Set 8, the course's final problem set last year, we had students implement a mash up where they take Google News and Google Maps and mash them together using JavaScript, PHP and SQL in such a way that they had a website that they could find all of the local news from whether it's zip code 02138 or 90210. And, you would actually pull the local current even articles by this thing called XML and integrate it into the view of a Google Map. And then, at very course's end was the true climax of the course. This course culminates in final projects, which ultimately will be your opportunity to design your very own piece of software, designed by you or two or three friends. And the course then climaxes with the new and improved, with the second annual computer science 50 fair which last year was an exhibition across the street in one of the engineering buildings with 300 laptops atop tables, popcorn was popping, music was playing, stress balls with CS50's logo were being thrown around. And this was an opportunity for our 300 plus students to exhibit their final projects not only to each other but also to some 900 attendees in total. And we also invited some recruiters as well. So, that is what you have to look forward in this course. You also have cake to look forward to in the hallway. This is CS50 and we'll see you on Friday. ] Applause [ ==== Transcribed by Automatic Sync Technologies ====