There's a lotofotherchangesgoingoninthecityofNewYorkitself.
Thishascaused a lotofuswhoworkat N Y U tohavetochangeourdailyroutinestorevampourcurriculum, tothinkaboutdifferentthings.
I am a person, asyoumighthavenoticed, whohappenstodo a lotofonlineeducation.
EviladjacentstuffontheInternet.
Soinmanyways I amsetupwell.
Thioengageinanexperimentwithremoteeducation.
But I wouldsaythat I thinkitissomethingverydifferenttobecaringforandteachcaringfor a class a cohortofwhetherit's sixstudentsoreightor 12 or 16 or 20 or 50 or 100 evenwhichisquitedifferentthanthiswaslike a livestreamingthingonYouTube.
Therearerelationshipsandthethings I doonthischannel.
I hopeourresourceistwopeoplewhoareteachingcoursesthattheycancreatetheircommunity, theirlocalcommunityoftheircoursearound.
But I dothinkit's it's ah, I wanttobecarefulaboutsuggestingthat, Oh, it's timetodoremoteeducation.
That's a thingthat I doalready.
It's not.
I do a kindofremoteeducation, andmaybe a lotofit's filledwithlikewaytoomuchnonsense, but, umbutyes, So I don't wantto.
I don't wanttobelaborthisstory.
Thereis a hugeamountofstufftosound, and I amnotqualifiedtoprognosticateandpredictthefuture.
I'm justkindofworkingwithwhat I needtodotoday.
And I thinkactually, someofthechangesthatarehappeningbasedonlookingatreducingthespreadoftheviruswillprobablyultimatelyopenup a lotmoretimeformetolive, streamedormakevideotutorials.
Butactually, what's happenedtomethisweekis I'm having a lotlesstimebecausethere's a lotofthingsthatneedtobechanged.
I'm spittingup, actually a couplenewclassesfor N.
Y.
U.
Um, I, umthere's just a lotofmeetings, andnottomentionlikemysonschoolclosed.
He's actuallyhavingclasseswithZoomSoftwareathome.
He's infifthgradeonDSO.
Youknow, I don't havetobetherewithhimrightnowbecause I havethatcovered.
Butthat's thepuzzlepieces.
Mydaughterschoolstillopen, butthepuzzlepiecesoffamilyandallthatkindofstuffbecomeenormouslycomplicated, but I wasminted, managedtosticktohaving a livestreamToday.
I startedabout 1/2 anhourearlierthan I originallyintended, and I havetoleaveabsolutely 100% at 3 30 whichisnowaboutonehourand 50 minutes.
If I couldstilldomathonsomelevelloudsink, I wouldthatnoisetohappenagainsobizarrely I wasinheretheotherday.
I actuallywasmaking a quickvideotutorialforhowtodovideoconferencingwithZoom, which I mighttrytodosomemoreofthatonthechannelitself.
Um, butwho's loudnoise?
I thought, Youknowtheshop.
There's a sorryhitthebellbyaccident.
There's a woodshopoverthereand I thought, That's wherethat I neverhearthewoodshopinallof a sudden, I'm hearingittoday, drillingandhurtagainandheardagain.
Maybewasconstructionthen, uh, later I waslike, I needtoknow, gotothebathroomdoingnumberone.
I needtowashmyhands.
I didn't watchmyhead a lot.
So I wentintowatch.
Myhandsarewhenthewatercomesout.
Sorightnowduringthislivestream, ifwehearthesoundbar, I mean, somebody's washingtheirhands, andweshouldapplaudthemforbloodthemforwashingyourhandsfornottouchingyourface.
Um, itcouldbesomethingwecouldcotoday a handfacedetector, but I don't wanttobedueto I don't wanttomakelightofwhatisanincrediblycomplicatedanddifficultonlifechangingformanypeoplesituationrightnow.
Sothat's all I havetosayaboutthat.
I'm gonnamoveontobacktomysortof, like, usualprogramming, whichis a lotofthisstuff.
I dowanttoreallythinkaboutandmaybecomebacknextweekandfocusonourthere a setoftutorialsthat I coulddotohelpteachersspecificallywhomightbe, umwhowhomightbedoingsoRemotelearningmightwantrecordedvideolecture.
Aretherethingsthat I that I canoffmakesomecontentabouttohelppeoplesospecifically?
Ifyou're a teacherandthere's, like a thing I wouldlovetohearfromyouOrifyouhaveideasforme, letmeknow.
Andmaybenextweek.
Youknow, a lotof a lotofwhatpeoplearedoingwithremotelearningisrealtimeinteractionandquestionsandfeedbackandsmallergroups.
Andthat's notsomethingthat I reallyactuallyhave a lotofexperiencewith.
What I haveexperiencedthismuchmorelikeonewaybroadcast, althoughitissometimeslike a chatanddifferentthings.
But, um, but I wouldliketooffersomeresourceisoneresource I dowanttomentionLetmejust, ah, trytofinditfor a secondbecausetherehavebeen a lotofpeopleputtingtogetherum, thistotal.
Uh, thegeneticalloychapterisactuallysomethingthat I revisitedmorerecently, sotheremightbesomeaddedvideos, or I mightswapinandout a newversionofoneofthosevideos.
Butforthemostpart, that's goingtobe, uh, staywhen I made a coupleyearsago.
But I dohavesomeideasforsomeadditionalones.
Allright, sothefirstthingthat I wanttodois I wanttofindmyself a textfilewithonemilliondigitsofhigh.
Sothisisgoodforustofindbecause I nowwanttorecreatethisexactthing.
I'm goingtoloadin a filewithonemilliondigitsofpi, andthen I wanttocreateaninterfacewhere I typethisin.
I'm gonnahavetosayallthisagain, but I'm gettingmyselfsetupbecause I'm gonnadothat.
I wanttocreateaninterfacewhere I typethisin.
And I wanttofindwhereifthatsequenceexistsinthenumberofdigitsofpithat I haveandifsowhereAndwhile I'm goingtothisandJavaScriptwhile I couldjustusethebuiltinindexoffunction, I'm goingtowritemyownsearchin a stringalgorithmbecause, um, once I gettauonebilliondigits, am I gonnarunintoperformanceissues?
I thinkthisisactuallywhere I downloadedthedigitsfromItlookslike, butthere's alsootheralgorithmsoneknownasBoyermore, which I actuallyhaveneverheardofuntil I sawitposted.
I reallygottogetgoingBecauseif I keeprestartingthis, we'regonnabeinbigtrouble.
I haveto, nomatterwhat.
Leaveat 3 30 There's noand I mean, when I say 3 30 I mean I meanso I shouldreallybesayingthree.
I reallygottaleavemythree.
Okay?
HappyPiDayit's 2020.
Thisyear's PiDayit's todayand I wouldliketodoisnotreallytodaybecause I'm recordingthiscoupledaysearly.
But I wouldlikeyoutoseethisonPiDaycodingchallengethemedaroundthenumberpiandthankyoutofatten B buswhosuggestedthisone.
Piday.
Find a sequenceinpieissuenumber 1464 I wonderifthosenumbersarewheretheyareinPai, whowillfindoutbytheendofthisvideohowtolookathowonemightsearchforanygivensequenceofnumbersinpie.
Thiscouldleadto a lotofotherthingslikewhatifthosenumberswereencodedasmusic?
I'm toldthat I shouldsearchforthenumber 999 999 whichisthe 762nddigitofpi.
Solet's rememberthatandmakesurewhen I writemyownversionofthisthat I findthesamedigit.
So I'm gonnadothisatfirst.
I'm gonnadothiswith P fiveGSjobscriptthebrowser, andit's notgonnabeasnicelydesignedwith a beautifulinterfacelikethis.
But I'm firstgoingtorecreatethisexactthing.
Andthenandthenwhat I'm gonnadois I'm gonnagofromonemilliondigitstoonebilliondigitsandseeif I couldstillsearchrangeinandprobably I'm gonnafailbecausewe'regonnaneedsomekindoflikeoptimization.
It's gonnaruntooslowifhe's gonnacomecrashingdown.
But I'm gonnatrynonethelessandwe'llseewherewegettobytheendofthisvideo, and I I shouldmention, justdon't endupcoveringit.
Thereareoptimalwaystosearchfor a stringjusttosearchfor a stringinsideof a largerstringAndoneofthosealbumscalledTheBoyArmorAlgorithm.
Andsodependingonwhere I getit, I gettotheendofthisvideo.
I don't knowwhat I'm talkingaboutthisnow.
It's nottheend.
I'llknowwhere I'vegottentouhum, bettingonwhere I getto.
Thatmightbesomethingthatyoucouldalsodoasyourownas a contribution.
When I Thatcouldalsobesomethingthatyoudoasherowncontributiononthecodingtraindotcomitselfbymaking a optimizedversionofthis.
Allright.
Okay, herewego.
Youjustputthisinapplications.
I'm startingwith a simple P fivesketchandtotextfiles, onewithonebilliondigitsofpi, whichisjust a megabyteandonewithonebilliondigitsofpi, whichisgetitbythatmuchbiggerfile.
Solet's startwiththeonemegabytefile.
I uploadedit.
I'veuploadedthefiletothe P fiveWebeditorand I canloadallthetextfromthatfilerightnow, usingpreload.
I'm goingtojusttakeawayanimationhere.
I'm gonnagetridofthedrawloop, and I'm gonnasaynocanvas.
Hereisonething I don't loveaboutusingthewebeditor, becausecan I zoomaneyeframe?
Can I justmakethatbigger?
Can I doitwithCSS?
I don't wanttogocrazyhere.
If I dosomethinglike, justsaywhatisit, liketextsizeorsomething?
I don't know.
CSS.
SomebodytellmehowtoputsomeglobalCSSonsize.
Okay.
No, that's goingtowork.
I didn't makethetextfile.
Do I needtodoitfor, like, input?
Hey, therewego.
Perfect.
Okay.
That's probablybiggerthan I need.
Herewego.
That's plentyvisiblenow.
Okay.
I alsojustadded a I alsojustincreasedthefunsizeforanyinputelementonthepage.
That's a littleeasierforyoutosee.
Butthat's youknow, theinteractionthat I'm lookingforisanytimeanyonetypesanythingintothatsearchbox, I wannalookforthatstringthatthosedigitsinpieitselfsearchand P fivegshas a specialeventfunctioncalledinput, whichyoucancallonthesearchboxandpassanotherfunctionthatwillbeexecutedanytime a changehasbeenmade.
Soletmewritethat.
Searchitupfunction, becausethat's when I'm lookingforsomething.
I saysearchitup.
UmAndthen, uh, I'm gonnabe a littlesillyandmaketheseglobalvariables, and I'm goingtoThenthenletmegetwhat I'm searchingforfromthesearchboxandconsolelogthat.
Sonowwhenever I typeanythingintothatsearchbox, I shouldseewhat I typehereinthecouncil, andthat's working.
Thisisgonnaactuallybe a reallyeasyprojecttodo.
Youknowwhy?
Because I couldjustusetheindexoffunctioninjobscript.
TellLetmedothatrealquick.
Justplease, pleasego.
Justgotrealquickupintothatrealquickdigits.
Indexofsearch.
SothisissayinglookinsidethissearchstringandgivemebacktheindexofwhereNo, no, no, no.
Sobasically, I'm goingtomake a I wanttomake a guessthat I founditright.
Assoonas I findthatassoonas I findthefirstcharacter, assoonas I findthefirstcharacterbethesame, huh?
I foundit.
Andthenanytime I findanyneedtobedifferent, I cannowsayfoundequalsfalse.
Sothequestionbecomesrighthere.
Iffoundistrue, then I canbreakoutofthings.
Andonceoneisnottrue, I don't needtochecktherestso I canbreakoutAndthen, iffoundreturn.
What?
So I'm gonnasay, Letfoundindexequalsnegativeone.
I'llgive a defaultvalueofnegativeone.
Andthen, actually, if I'vefounditrighthere, umfoundindexshouldequalwhat I whereverwestartedwith I andthen a littlebitlostintermsofalltheloopsgoingonhere.
Andthenif I'vegonethrougheverypossibilityand I haven't foundit, then I'm gonnagettotheendthat I'm stilljustgoingtoreturnnegativeone, butfoundIndexwillhavenegativeone.
Soif I founditsomewhere, I'm gonnasetitequaltothatfirstindex.
Getoutoftheloop.
I don't needtocheckanymore, cause I'm justlookingforthefirstinstanceandthenreturnwhat I found.
Butwhatyou'reseeinghereis a couplesimplegamesthatyoucouldplayinteractivelyinthebrowsertolearnthebasicsofhow a neuralnetworkfunctionssoofwiringupneuronsintheprocessoffeedback, youcouldbuild a netwhereyoucouldgettobuildyourownnetworkthatclassifieshandwrittendigits.