Hi everyone again welcome to the Linux programming and scripting class we will be talking about pearl in today's lecture let's look at what we covered in the last lecture and then we can start from there so let's quickly go through that so in the last lecture we had a lot of things that we covered lot of the things that new to most of you one thing we went into like more details about the pattern matching I think like I mean this is one of the key things that you want to understand in pearl then we also took it took a look into the pearl debugger the various debugging commands that even through and I think like I mean that's another thing like we want to run into trouble with any pearl programs you can invoke the pearl debugger and then use the pearl debugger to debug your program that will be like very useful and then we also looked at the functions some of the functions in more in-depth manner one was grep the grep is a function that is used to get particular word from given array of words or given dictionary and actually like I mean grep is used widely to compare two arrays and get the difference of the array or also compare two arrays and give unique items are the inverse of the differences essentially meaning or the commonality between the two arrays that's one thing and then also like the difference of the array as as output and then these things can be used by simply the function we looked at it basically how we can combine the hash table concept or hash array concept and then use grep to actually grab from that in the indices essentially so that's one thing and then the sort actually here we also went into more detail here actually like I mean the last class we use a new operator all the the steamboat operator essentially make this operator is used as a monitor to do the sorting the regular sort is an alpha sort essentially so there is lot of issues basically so when you have to have a numeric sort and also again and how do you do the numeric sort and sending order and depending on how do we do all those things we can achieve using the steamboat operator one thing to note here is in Perl the sort function by using a quick sort algorithm so essentially as you know the quick sort algorithm basically like just starts with any one variable any one element in the array and then it tries to sort the elements that are greater than that element after that element and then the elements that are less than that element before that element and then once it basically like once it anchors that particular element then it passes these two lists and then it continues the same way because it goes through so typically we see that it has a complexity of n log n I think like I mean you will probably like get into all these details once as a real computer science at least to know here you want to make about this complexity is in this log n area n log n is kind of it is very good considering the sort if it is inspired that means that you are actually going through the object in two times basically so I think like I mean this is a much controlled behavior so that is what we are using the sort so sort is fairly efficient so that's what I want to say about that then we also looked at the file open file close testing the files with various switches whether we can read it read a file write a file things like that and then also like in the same case for the directories to basically these testing tests can be done for the directories and then how do we open the file and these file handles things like what we talked about that and then we also talked about the strict keyword essentially so this is to make sure that Perl does not omit any kind of mornings or any other errors that isn't on this because Perl itself is a tolerant program so even if you made a mistake but if it is syntactically and semantically correct it just lets those things go through so I think strict is one keyword that we will be using basically it is the use strict we will see like more and more programs actually so initially like I mean if you are doing like simple programs you may not want to do this but once if you are doing any Perl programming development I strongly urge to use strict in your programs so I think this is pretty much like in what we saw last lecture I think like I mean that we went to like a lot of the modern of these areas but today I want to actually introduce two topics today one is there are some leftover items that I want to talk about one of them is essentially like how do you run a program within a Perl code so there are some need techniques for that and I will explain that and then the big topic for today is some of the object oriented features of Perl which is actually prominent in the Perl 5 which is the fifth generation Perl and this is essentially what is called the packages essentially we will talk about probably how do we use packages basically I mean one thing that made Perl a versatile language that exists today is the ability to actually export and import modules from different sources so we will see like I mean motivation behind that and then also like how do we do it in when we talk about the packages so let me talk about the first ones essentially as I mentioned how do we run programs inside Perl so say like I mean you want to do externally like I mean a CD to a directory or something like that inside of Perl how do you do that so we will see there are actually three ways of executing commands within Perl the first one is what we call as exe c or exec the exact commands essentially it executes a command that you provide but it never returns so this is the keyword the never returns it's like a written from a statement in a function if the command is not found the exec returns are false it never returns true because if the command is found it never returns at all there is also no point in executing returning to returning standard out standard error or exit status of command so some examples essentially like here cc or print standard error couldn't execute full with the dollar bang I think like I mean this one you already know about this basically this is to print the error message number so it gives the constant error message number for this particular error the other way to run exe c is just to enclose the whole statement within the curly braces and then essentially you can also if this returns zero then it goes into the next statement which is it'll say that it's not able to execute so exact pretty much like finishes a program so basically like I mean once you run the except it basically it just comes out from that program so this is one method there are places where this gets used so we will we will talk about it talk about some other things but it's it's one of the useful commands the second one is called system in system essentially like I mean once you specify the command it executes the command and then once the command finishes basically the perspective is continued and then it goes to and the return value for system command is the exit status of the command itself so if you are doing a CD and the CD become successful and if it doesn't one the return value from system is also one but if that CD was not possible and it returns to zero then the system command also returns to zero again it's mildly useful but it is not really useful because as we know then we try to execute commands yeah we can execute command like CD for example is is to go the take the program pointer to a different directory but if something like I mean if you are using an external sort or a final go and to find certain things how do you actually get those values and then process them further that's simply not possible with the system command so here the example for using the system command is command with arguments and within the reports inside the passes and then a better way is essentially like in closing command arg1 arg2 arg3 everything as its own strings so that it's actually better for the system see it and then one would run the system command now the third option that you have is what is called a back take and this is I think like I mean this is very prevalent one and then a lot of people use this and essentially this is something that that's you will be using in your program as well the difference between the back take and the system is it is like system there it executes a command and the Perl script is continued after the command is finished just like the system command but there the difference comes in is essentially the next line here where contrary to the system the the return value is standard out of the command so if you do the back take it's not the status but whatever goes into the standard out becomes the return value so here we can say like I mean in the scale of context dollar result is command followed by arg1 arg2 and then you notice the back take here back take here so this commander gets executed and essentially like I mean whatever the commands return value stored in as a scalar into the dollar result and then if you want if you if the command actually returns a list then all you got to do is basically like I mean you can store it as an array with result as the name and then executed command back take mode and then whatever comes up is stored as an array basically whatever the result of that command so this is very useful when you are doing a sort external start for some for some reason and then actually using it and storing it into the results so so again to recap on this one exe c essentially like I mean basically it executes the command but it never returns so it's useful but it is not that useful the system essentially like I mean this is the next best thing their system actually returns the the exit status of the program of the command rather than actually any any other thing basically whether it's an output of the command or doesn't produce that it only produces the exit status so here if you want to use this you may have to store the values into a temporary file and then basically like again read it back into the into Perl and then you can use it so like I mean system command is typically used to generate like I mean the argument data which will be used at some point of time later in the program so that is the system and then finally the back take commands the back take commands essentially it's just like the system where it executes the command and the Perl script continues after the execution is finished but the difference is that actually now you can pass on whatever the output of the particular command back to the program that initiates this call so it can be passed to those those things and then you can do for the processing or not so the back take is like a very useful I will say like I mean more often than not we will see the back take commands than the system commands so now that we covered this let's see the next one basically is how to write and use Perl modules again remember that this is basically Perl 5 which is some people call as object oriented Perl but I think like I mean the key thing here is your developing program how do we get it into another Perl program and how we can foster like a collaborative development of various Perl systems in fact today lot of companies whether it's hardware or software are using Perl as a wake up I mean use or doing Perl programming and the way that they do it is collectively they are doing it and then more in order to make the system work we need these modules the concept of modules and how do we actually write and use them so just a before that I wanted to introduce you one small function which is called the qw function it's called code word it is used to generate lists of words the qw actually extract words out of the spring using embedded white space as the delimiter so this is important you can actually like change this delimiter to any other delimiter that you can read up on that of this command command and then it returns words as a list essentially so and then it also one thing that note to note in one thing to note is that it doesn't it happens at compile time so which means that the call to the wq is replaced with the list itself before the code starts executing so here one simple example is code word temp file tender it returns temp file and tender as two different values so now so this is important in the next section when we talk about the modules because like I mean most of the modules we write it as functions and basically use for code word function a lot so let's look at first of all what is the module so the module is essentially a separate namespace in a separate file with related functions and variables so there are three things here one is a separate namespace another one is a great file and then there are related functions and variable so how do we do that we will see basically so what is the namespace the namespace provides a certain context to the function and variable so essentially you can think of namespace as any kind of names itself so my hammer Mary's lamb gulliverse travels Dutch cheese French bread your car so you can think of this as like this these pronouns here between your own various possessives here basically these are all the namespace that now that's basically like I mean that provides the context to the these functions so if so in short essentially like I mean you can say like two people writing soft function you can say like is the heart or these sort so we will be will see more about the that context essentially so here one example I have like two engineers jack and harm they both wrote a function to shuffle a sequence and you want to compare the two functions they both call the function as shuffle now how do you distinguish between them so the way to distinguish between them means to put the function in its own namespace so now we call the first one as jacks or harms so there is a sub shuffle and this is harm's implementation and then there is a sub shuffle which is jacks implementation so if you if you put basically say like I mean this is the sequence that we need to do and then if you say like I mean shuffle seq this will not work because it doesn't know like I mean okay which function to use again same thing it does not work so we need to distinguish between this and this how do we do that so again it is all the same basically like I mean the top one and then what the sequence that we want to shuffle is also the same only thing is like now we name the functions as shuffle harm and shuffle jack so you notice here that actually names are different we add this additional element to it yeah this is well and good but what happens basically when we you know we have to somebody has to tell the others essentially like if say like jack is the one that is that develop the shuffle second time now jack needs to at least harm needs to tell jack that hey jack I am using the name shuffle harm so you should use shuffle jack or everyone should have these kind of names arbitrary this is kind of arbitrary you can see basically so to avoid this essentially we use the package essentially so what we say is basically we call we will have the packages arm and then inside that we will still use the same name which is shuffle and then that is followed by the harm implementation and then we will have jacks block with the package called jack and then it also has the same thing the as a function which is shuffle and then this is jacks implementation so now we define these two things but how do we use them basically so the way to use it is like again like on the sequence is the same here we use harm as the package followed by this column column and then the function name here again the same thing for the jack it is basically jack column column and then the function these two will work basically and then you will get like two different answers based on how each one implemented these two functions so so this is the package that we can see basically like I mean so the package is essentially like I mean something that is used inside the same program so essentially like I mean so now if you want to compare these two packages basically like you need to put these two packages copy from harm's area and put it into your program copy from jack's area and the shuffle and then put it in the program and then we need to write the basically like then we can write the whole program to work with that and it's kind of cumbersome basically like I mean so one thing that we want to do is we don't want to even depend on harm or jack in order to develop our program so so for that we need we need to turn these packages into modules so to turn this into modules we save harm's package as harm.pm and jack's packages jack.pm but one small change that we may we put this one column I mean one semicolon as the last line of equal so then so then they are packages so then harm can check in this module I mean these packages are converted into modules now the harm can check in this module and then jack can separately check in this module and then they are somewhere basically so in order to use the these modules in our script basically what we need to do is we need to use the keyword use followed by the package in it I think like I mean you already saw the use of the keyword use essentially warning use strict these are all the various ways that we were using this and then the name of the module pile usually is the name of the package basically with the extension pm so essentially like I mean so we just say this is use harm and then use jack in this case so here we let's see like how we do basically so the harm.pm itself the way that we will write is we use the same use strict and warning we call it as a package HRM and then we write the shuffle then you can see that the one semicolon is there now in the Perl script the way that we can do it is basically use harm and use jack these are all the package names essentially because the file itself is stored with harm.pm so this is the packages so we kind of imported this packages from these locations now we give the same thing and then this is the same command that we saw and then this should produce write expected results we can also export functions by the modules into the main namespace so here we basically like I mean we use what is called an exporter and then essentially like I specify using the code word the exporter into this array and then export is nothing and basically like this is the another variable these are the two preset variables that we will see what they represent in the next sections so the export okay functions have to be explicitly imported basically so essentially like I mean so what this means is like I mean once we add this in in front of our programs essentially that becomes the modules of the functions that can be exported so actually there is a e missing here you can say basically so we say basically like for the shuffle function the export is okay for that particular function and then that's so that's what we mean here basically like for functions have to be explicitly imported so here essentially like I mean we use the same thing basically and then we say like shuffle sequence and then we will say like jack shuffle sequence so see here that actually like we don't need to specify harm anymore here that the reason is basically like I mean we cannot we don't need to put the arm because this is something that is what is being exported from this function so for the harm actually like we are using this so basically like it is directly exported into this main namespace so you don't have to specifically assign a jack namespace for that particular shuffle so wherever you call shuffle it's assumed that it's basically coming from harm okay so the location of the Perl module is the other thing basically that we want to talk about essentially it's essentially like I mean it's specified in this at INC array so once you have the Perl minus V which is the verbose often then you can actually like print this at INC to see where the where Perl looks for modules in your path so and then you can also add this path with the Perl 5 live in unendurable which is use live and then path to the libraries so now the question is like why we use modules so as I mentioned basically like there are there is one reason which is the sharing and core development of various programs but let's look at this essentially so the number one reason is essentially to organize the components of the program so what we can do is when we have like large programs you can develop some of the components as a bottom sub approach where we write the essential functions and then those functions can be stored in various files and essentially like an export mechanism or modules to export that into the main main program so this is one reason the second reason is the code reuse there we can use the same once we write a particular sort function and if we know that that is the most efficient way of doing we can use that over and over again in other scripts and we don't have developed this at all you can use reuse the code from one to the other and then the third main motivation for using the modules is it's a convenient way to publish or share the code with others so there are a lot of modules and their wide range of functions are available so this is one website that I want you to go and check for the various modules in Perl so some more details on the modules modules are an important and powerful part of Perl programming language the module is a named container for a group of variables and which can be loaded into your program by naming this collection of behaviors and storing it outside the main program you're able to refer back to them for from multiple programs and solve program solve from problems in manageable chunks as I said this is essentially like promoting the reuse mechanism the modular programs are easily tested and maintained because you can actually test test the modules and maintain them and you can avoid repeating the code and then the the mainly main reason why we can avoid repeating the code is also because we need to change any kind of bugs in only one place and then all the others automatically gets changed and then Perl modules can may also contain documentation they can be used by multiple programmers without each programmer needing to read all the code so essentially it promotes multi-user people to work on programs simultaneously and it also promotes developing a big environment which does several things collection of tools and techniques basically for solving a given problem and they can be generated by that and then the modules are foundation of the CPAN which contains thousands of ready to use modules many of which you will likely use on a regular basis so Perl installation the CPAN modules also becomes and then you can use them for your programming purposes so I want you to take a look at the CPAN the website is given the previous one so now let us look at what is CPAN so before that like I mean as I mentioned the Perl modules they are set of related functions and in a library file they are specifically designed to be reusable by other modules and program currently there are about 108,000 modules that are readily available for your use so what is CPAN? CPAN is this particular thing basically it is a comprehensive Perl R-time network I want you to go and like look for it because the CPAN function CPAN modules are widely used and pretty much it comes with every Perl installation and your installation if you have this and one thing to also notice most Perl modules are written in Perl but some use XS and they are they require C compiler modules may also have dependencies on other modules almost always on CPAN and cannot be installed without them so or we need all the without a specific version in the programming form so and then the CPAN itself in the modules in CPAN they require a reason for Perl which is Perl 5.8 so this is another location essentially like meta CPAN.org where you can search the 108,000 modules I mentioned on CPAN so think of these modules as now your apps only thing is like these apps are actually connected to each other so that I mean we can write a super app by just meshing these apps into that super app so essentially like and then so this and CPAN you can think of it as the iTunes for Perl and that has about 108 modules ready 108,000 modules ready for you to develop the new apps so I think like I mean this gives you like a good overview essentially now we will look at the one code segment basically we have one today here essentially like I am trying to list the contents of a directory so the first statement you know basically like you go to Perl use strict your warnings so here we are actually now exporting a module essentially called path and then basically like it contains the package class so here essentially like I mean we are we are defining the directory basically so it is full bar essentially that goes by full slash bar you can have like many many more and then they are all like we are opening it as a directory we are calling it as a direction and now we want to iterate over the contents of the full slash bar basically we are saying here this particular scalar variable is taller der next essentially the next file first we see basically like if it is a directory then we will skip basically so we do is there a test essentially on this particular file and essentially we just break the loop and then go to the next one if it is if the test becomes true if the test test is not true then what we do is we basically and we print that particular line into the as a string and with the new line character so the string if I is another function that is specified in the in this one basically which essentially like takes this content of the file which is the full slash bars first one and then it it creates a string out of the whole characters and then it prints out that particular string so I think like I mean it is a very simple program as you can see like I mean so this is you can think of this as the LS command essentially so LS and the directory name you get or in this full you get this particular per command you can see that 1 2 3 4 5 6 7 8 9 within less than 10 lines you can actually make this command work so this is how powerful you can see the programs and then how powerful it can get so I think let me just recap this whole session basically for you so we started by talking about how to execute commands inside of Perl using the three main methods one is the exe c which is not very useful because it executes a command and then it comes off so you can put it as a like last command if you want to send an email or something you can execute the email command then just come out of something like that then we also looked at system the system comma system specification is essentially it executes the command but it continues from where it is where it looked off and and until the Perl script itself is finished but the return code is actually the exit status of the command it is nothing it is not the output of the command but the exit status of the command is true or false so you have to use it with a pinch of salt here basically if you do not want any output coming from the particular command to be further processed then you can use a system call okay and then finally the back tick essentially is essentially like a back tick is the way that we can actually capture the results or capture the output of a particular command into various variables and this can be used within the Perl script itself so there are a couple of examples that we quoted here you can think of this basically you can have it in a scalar context or and list or another context so these things you can do then the next one that you talked about was how to write and use the Perl modules this is one of the advanced topics essentially like I mean there is also known as the objector in the Perl or Perl 5 one of the function that we talked about which is key to all these things is the qv qw or the quote word and this is used to extract words out of the string and using the embedded white space as the delimiter and it returns the words as so a simple command is shown here essentially and so then we went into the packages and the modules essentially the modules essentially is the separate namespace in a separate file with related functions and variables so we wanted to understand what the namespace is and the namespace is something that provides a context to the functions and variables so if you can distinguish between ace sort function these sort functions and then we explained the namespace with an example essentially like where we have two two individuals jack and harm who are trying to develop the same program or shuffle and how do we distinguish with them between them so if you just put the function name with the those two implementation as functions that does not work so one way to do the come up with a solution is basically embed the names into the functions so shuffle harm and shuffle jack yeah we can do this but this is again cumbersome and basically it will be all the it's a very subjective so we cannot really implement this so in order to find the happy medium what we said was basically the individual concept of the package where we start the harm block with what is called the package specification or package keyword and then harm and then we write a sort of shuffle and then for the jacks basically jack also starts in the package jack and then the is shuffle and then once we use it basically we just say harm colon colon and jack colon column so this is this is the way how we can import those packages into our program so but the package can be turned into modules by just using the one followed by semi-colon at the end of the program or the last line of the program should have this and then if you want to use the package in the script we use the keyword use followed by the package name and then we don't have to specify the extension PM here so here basically how we use it we do the define the harm dot PM with one semi-colon and then we use it inside the thing basically this harm you give like this keyword use harm to make sure that this package is exported so another way to do it is essentially like I mean then actually export it into so this is a simple export essentially living this harm and jack but you can also give it a main context essentially or you can export into the main works or namespace so that you can avoid every time typing these some names followed by column will have a name the main context to do that we use an exporter so we specify use exporter and then we basically like specify these commands and essentially the we say that export okay is shuffle and this actually gives the the the command actually like I mean how to do it so the we say basically use harm and then again the maybe the shovels as the subroutine essentially like so once we say that this is a subroutine and with this package that one we don't have to specify the harm anymore basically because it's it's also match of the exporter and then we continue with that process then we talked about the locations essentially like how to look at the libraries and then we talked about the why we use modules again the three reasons that we outline are one is to organize the components of your own module your own programs then to promote the code reuse where you develop once and share it and then use it many times and then sharing the code with others essentially this is the key thing why how the collaborative design environment can be developed and these are all like the the functions are all available in cpan.org which is an archive essentially the cpan itself stands for the components of Perl archive network and currently it has about 108,000 modules and one thing to note is like not all the modules are written in Perl some of them are written in the XS and they also require a compiler and then we also want to note that the modules themselves basically all other modules and so essentially like we need to install the whole thing to get all the modules and then the recent version of Perl is that's another thing that we need for accessing cpan cpan modules so the Perl version has to be 5.8 or above okay so I think and then we event into this one example where we just wanted to list the contents of a directory this doesn't check other things or does not have any other things basically this is kind of like an LS-L so it does not check whether there are any like dot files things like that or any other further checks on that only like directory is it avoid and it only prints the all the regular files so even LS-L actually prints all the directories and everything this only prints all just the files so I think this is pretty much it for Perl on the next class onwards we will start the tickle programming language I hope this is this was enjoyable we will have some quizzes coming up I think the PA will organize some of the quizzes and tests for Perl so thank you very much


A quick shout out to Craig for the bright green extra long socks. They could not have arrived at a better time. Basically I'm on the scooter all day long and to protect my foot, my hurt foot and my left kneecap is going a little raw. So basically the extra long socks are protecting my knee from the pad on this scooter, so I appreciate it Craig. You couldn't have timed it better. And yes, I did just finish wrapping up the last running shoes from the giveaway. But I have a couple pairs left that a couple people haven't claimed yet, so if you still want them, email me your address, you know who you are, who won them. I think one of the gentlemen, his name is John, just so you know. And last but not least, we're going to talk about, oh man, I hesitate a little bit even talking about it, but I'm actually not afraid to put forth very, very concrete goals in running, in life and on YouTube. So I'm excited about that. We're going to talk about the, yeah, I'm just going to say it, 100,000 subscriber goals and aspirations for this YouTube channel. I can't believe I just said that. It's so exciting. All right, let's rock and roll. Running shoes from Australia. This is incredible. Let's open up one box for the next giveaway. I just can't, I can't resist. I cannot resist. Oh man, hold on here. One sec. Okay. All right, I got it loose. Here we go. What is in box? From Australia. Nike Epic React, flying it. That is what I'm talking about. Look at those. Wow. This is lightweight. Hmm. Okay. I was resisting. I don't own the Epic Reacts.  I've actually haven't even held them in person. That's pretty interesting. Very lightweight, very nimble, very much neutral. Thank you. I believe it was John from Australia. This is exciting. They look really nice. So these will be for the next running shoe giveaway in size nine, size nine US, eight in the UK. All right. We will thank you again. We will open up the other two boxes live together here in the studio at the next giveaway. Okay. I'm not afraid. It's a little bit of a dreamy topic, but I'm excited and I have to share what I'm excited about with all of you when I'm sitting on that stationary bike over the last three weeks. I'm not just sitting there like a bump on a log. I'm thinking and dreaming about the future. And I've been doing a lot of that recently. And all when you're in the pool and you can't listen to music or you can't listen to anything, you're just swimming lap after lap after lap. And you just start thinking and dreaming about the future. And that is what the focus of this topic is right now on the vlog. So let's dive in. Okay. So this is a brief overview and history of what's been going on on this channel. I have been publishing a daily vlog for three years now straight. No days off, three years straight. I love it. That's why I do it. And frankly, it's exciting to begin to find an audience that really appreciates the content that I'm producing for all of you. So that was three years ago, 2016. Fast forward to October, November, 2018. So basically six months ago, I decided to take my passion of running and really put it into the daily vlog. So I pivoted from just a daily vlog to a daily running vlog. Well, when we did that, the channel started to grow and grow and grow. And it really hasn't stopped since I did that October, November to the present. So 2018. So again, six months ago. So when we made the pivot, we were sitting right at 1500 subscribers, actually a little under. And now, as you know, we're over 16 and heading quickly to 17,000 subscribers. It's amazing. It's blowing me away. I don't even it's it's hard to comprehend, frankly, in about once a quarter. And so that's what I did yesterday. I took a little bit, a little bit of a deep dive into the analytics behind this YouTube channel. And YouTube provides a lot of great data points, metric points to figure out what vlogs, what types of videos are doing well on the channel. And I do that. It's really important to do that because it tells me what you all want to watch more of. And in the process of diving deeper into these analytics, I did some quick math at the current rate of growth on the channel. If it stayed the same and it's not going to, it's going to dip. It's going to go up. It's going to dip. It does whatever it wants sometimes. But if it stayed exactly the same at the same level at this current rate of growth, we would be at and I say, we, not me, we would be at a hundred thousand subscribers in just over two years. So 2021. Now, why do I bring up the analytics, the subscriber count, all of that? As you well know, there's ads on these YouTube videos. Thank you for watching or bearing through them as much as possible. But I must say, I love modern day advertising. I'd rather watch an ad on YouTube than on TV. Like those aren't targeted on YouTube. I get running warehouse ads, jackrabbit ads, new balance ads, REI ads, all these ads to running outlets that I frankly click on. And I go and I explore around. So thank you for watching the ads. And so I really believe when and not if, but when we hit a hundred thousand subscribers together, it's not just me. Like you guys, like the comments, the sharing of the videos, the live stream, like coming to the live streams, the running shoe, the running shoe giveaways. Like it's not just me doing this. When we hit a hundred thousand subscribers, I'm making right now three commitments to you. And frankly, it's made. It's going to be made possible because of the YouTube advertising. I there's no other way to say it. The money that comes in and it's pennies, it's just pennies, but lots of little pennies add up over time. All right. So here's number one. I commit to you. Number one, I am going to be able to travel. Yes, I have a bucket list of races across the United States and around the world that I want to travel to race, film, and of course, meet all of you in those locales around the world. I definitely want to go to Australia. That's where those shoes showed up from today. I want to go to Singapore. I want to go to. Where's another one? I want to go to Croatia. That's the one I want to go to Croatia. So again, through these YouTube ads, you are enabling me to go race, but more importantly, to meet many of you out there, go for runs together. Who knows? Maybe I could even like give a talk at some local running like clubs. I have no clue. The sky is the limit. That is number one. OK, number two, this is crazy. I think the quality of these daily vlogs is decent, decent. That's right. I again, I'm very particular to the human eye as far as I call it eye candy. I like to seek beauty right through the camera, through my own eyes. And so I'm very particular in what level of quality I'm willing to watch on YouTube. And if my quality level is pretty high, I want to make sure that these daily vlogs, the quality level on a production on the production side is very high. Does that make sense? So I don't want you to be watching a daily vlog that's not entertaining, not well filmed, bad audio, poor editing, bad music choices. Therefore, commitment number two is this, at 100,000 subscribers, I want to bring on more help for editing and filming these daily vlogs on a consistent basis. OK. And what does that take? It takes talent, but talent, you got to pay. OK. But again, I firmly believe that once we get that point, based on projections right now, we're going to be able to do that. OK. So that's commitment number two at 100,000 subscribers. The quality level of these daily vlogs, it's going to go up. Is I'm calling it out. It's going to go up not to mention better cameras like cameras. Or this camera is a great camera, but it's not the highest level quality out there on the market. So oh, there's so much we can do to make sure you are entertained and informed about daily running content on this YouTube channel. Oh, I guess he's so excited. Stop. Stop the madness. Stop. I can't take it. I can't take it. You do family. Commitment number three, this is the most exciting. This is what I'm the most excited for. Oh, I've been thinking about this for a long time, by the way. This isn't just something that popped into my head like two weeks ago. Or I've been thinking about this a while at 100,000 subscribers. I commit to you if I buy a new pair of running shoes you out there, somebody in need, somebody in the list of running shoe scholarships will get a brand new pair as well. For example, if I buy the Nike next percent for $275 to do a full review for you, I'll buy a second pair for somebody out there in need. Why? Because, frankly, based on projections at 100,000 subscribers, based off of the YouTube ad revenue, because you guys are watching the ads, it's all connected. You see how it's all connected? Because of that money that will come in, I will be able to buy somebody else running shoes every single time I buy a new pair. Does that make sense? I know it's crazy. I know it's crazy. I've done the math, though, and I cannot wait. I cannot wait. This is my commitment to you. For example, I haven't bought a new pair of running shoes in probably three to four weeks because of this boot on my foot right now. And so once I'm healed, I've got three, four pairs of shoes that I want to buy and therefore I would pick three or four people out there watching who, again, need help. And of course, there'll be a vetting process, but people that really need help, I get emails every week from people. Not every week, maybe three times a month from people across the U.S. and around the world who need, who desperately, desperately need new running shoes like really bad. And again, I love this sport. I love the ability to get out there, keep ourselves healthy, explore the world, get fresh wind in our hair and just be alive. You know what I mean? Just be alive out there. So that is my third commitment, my final commitment. Again, once we hit 100,000 subscribers, we're going to be able to do it. Can I do it now? I cannot. I cannot. Unfortunately, at 100,000, we can do it. I know it's crazy and I know it's dreamy. I know this is a little bit of pie in the sky talk, but I'm not afraid to dream and I'm not afraid to put my money where my mouth is. And so I'm putting it on film right now so you can hold me accountable. And I can hold myself accountable. I can't wait. I cannot wait. Keyword. Okay. I forgot to put it up here. Keyword. It's going to be a hundred K, a hundred K. I think we can do it. And the question of the day, who out there? And I know I know there's creative people out there. Who out there has some ideas for basically getting this channel to 100,000 subscribers before two years from now? Listen, it might take two years and I'm fine with that. I'm OK. I just I've been doing this for three years. Another two years is nothing in my books. But based on the commitments I just told you, based on my style of filming and running and what I do here on this channel, all the creative people out there, put your thinking caps on and let us know down in the comments. Do you have any other out of the box things that I'm not doing? And this is where you can critique me. Like, let me know what I can do to help push this channel to that. And I know it's a big number. And I maybe you're like, Seth, whoa, whoa, whoa, let's just get to 50,000 first. And I'm like, all right, that's fair. But guess what? There's seven billion, almost eight billion people in the world. There's a lot of people in the world that are runners. And that's where I get excited. In fact, I just saw today the seventh world major marathon. They're talking about adding one, the next one in China. So you know how there's six? Boston, Tokyo, Chicago, New York, Berlin and London. Those are the six major marathons in the world. They're starting to discuss right now adding a seventh, which would be in China. China is going through a running boom, kind of like the United States in the 70s. That's what's happening in China right now. The number of road races in China, it's it's it's it's gone up like 300 percent over the past five years. It's crazy. Therefore, all I'm saying is how can we get this channel to 100,000 subscribers? Thank you for letting me know. I know that was a lot. I got pretty excited there. It's because I want to help and I want to help spread the word about this sport that we all love through this channel. That's it. That's it. See, beauty, work hard and love each other. Oh, let's do this. Let's do this. See you tomorrow.


super stimuli man dies after three-day internet gaming binge influencer dies after binge drinking on live stream digital content designed to grab attention by exploiting human psychology fast food is killing you slowly are the allegations true that you're secretly a lizard um dopamine dopamine dopamine it is surprising that we have ended up in this place isn't it the great challenge of our century is learning to consume less who has never killed an hour not casually or without thought but carefully a premeditated murder of minutes the violence comes from a combination of giving up not caring and a resignation that getting past it is all you can hope to accomplish so you kill the hour you do not work you do not read you do not daydream if you sleep it is not because you need to sleep and when at last it is over there is no evidence no weapon no blood and nobody the only clue might be the shadows beneath your eyes or a terribly thin line near the corner of your mouth indicating something has been suffered that in the privacy of your life you have lost something and the loss is too empty to share a life on the savannah 10 000 years ago shaped people's instincts for food sex and guarding their territory these instincts were not designed for a life in a society filled with sophisticated technology and a lot of people our natural tendencies have not had enough time to adapt to the rapid pace of change that characterizes the contemporary world now look into space and in physiology which is the scientific study of functions and mechanisms in a living system a stimulus is something that causes a physiological response and bringing detectable change in the chemical or physical structure of an organism's internal or external environment our ability to detect a change in the internal or external environment is called sensitivity or excitability and has played a huge role in our evolution as it can produce systemic responses throughout the entire body in the 1950s nicotine bergen a biologist and ornithologist started carrying out a series of studies in which he designed what we now call supernormal stimuli the stimuli consisted of unnatural representations of beaks and eggs as well as other biologically significant objects that were painted primed and magnified in these tests young herring gulls showed greater interest in pecking at large red knitting needles than at adult herring gull beaks this was likely due to the fact that the knitting needles were more vibrantly colored and longer than the beaks themselves if you view present-day movies as a herring gull then sex violence and adrenaline are your fake knitting needles similarly if you view present-day junk food as a herring gull then the multicolored processed food is your fake knitting needle richard dawkins a student of tinbergans gave the dummy a rounder and more pear shaped appearance which prompted a bigger amount of desire he referred to these play things as sex bombs outside of the laboratory male australian jewel beetles have been seen attempting to have sexual relations with beer bottles made of glossy brown glass as the light reflections on the bottles match the form and color of female beetles dawkins and john crebs used the phrase supernormal stimulus in 1979 to describe the amplification of pre-existing indicators generated by social parasites using the manipulation of baby birds hosts to show the power of these signals normal stimuli are things that animals have evolved to react to in certain ways over the course of their evolutionary history supernormal stimuli disrupt these normal responses because they amplify the features of the stimuli that the animals are adapted to react to this causes the animals normal responses to be distorted even when i go fishing nowadays i am almost forced to adapt to buy the right kind of artificial bait to excite the fish now animals routinely change or exaggerate traits in order to attract imitate frighten or defend themselves from members of the same species as shown by research on the evolution of signaling for example female firefly species mimic the light patterns of other firefly species females causing males from those other species to attempt to copulate with the deceptive females who then eat them however only humans are capable of engaging in conscious manipulation of signals in real time using customized instruments as opposed to relying on gradual genetic changes that have occurred over evolutionary time in the world of humans the existence of remarkable artificial signals produced by more sophisticated cultural tools is something to be wary of sexualized capitalism all we need to do is compare photoshopped images to the unretouched originals the perceptions of the same face with and without cosmetics artificially created exaggerations can be quite effective in eliciting heightened positive responses that may be consequential such as making one buy a specific product a growing body of evidence suggests the way women's beauty ideals are constructed and prescribed varies with such factors as socioeconomic status gender role stereotyping and sexual orientation by contrast research on what constitutes an attractive male body has not received the same level of attention despite evidence that both women and men hold strong beliefs about male attractiveness indeed women tend to prefer men whose torso have the shape of an inverted triangle that is a narrow waist and a broad chest and shoulders in keeping with physical strength and muscle development in the upper body and with the societal internalization of muscularity ideals a cereal bar is a super stimulus it has a higher concentration of sugar salt and fat than anything else that was present in the environment that our ancestors evolved in the flavor of a cereal bar is similar to taste buds that developed in an environment of hunter-gatherers but it is similar to those taste buds in a far stronger way than anything that really existed in an environment of hunter-gatherers the signal that was originally consistently connected to nutritious food has been hacked and masked by a point in taste space that was absent from the training data set humans find this almost impossible to resist your regular tech company now uses subliminal advertising to collect tons of personal data so that it can serve you the best type of cereal bar and even if you don't like cereal bars they will still push you one of their other products as there are a handful of companies that own the world's most popular brands if you are not into cereal bars try chocolate chip cookie if you are on a diet you have our nutritious water and maybe you can throw in some honest tea as well now that we can get far more than we need with little effort our evolved neediness serves us poorly however there is no evolutionary mechanism to rid ourselves of these powerful desires so we become fatter and fatter along with the profits of fast food corporations you don't simply want to eat at a restaurant anymore what we now have is a combination of eating entertainment and even punishment you are receiving all of these stimuli just by eating food in tech there's a whole new level of super stimuli oftentimes when I stare almost mindlessly into my tiny phone doing things I feel like I'm having an out of body experience the world fades away and I lose track of where I am then when I look up I'm astonished to remember I'm still in the same world sometimes it can feel like everything happening to you is not actually happening to you but rather to an alternate specter version bombarded by super stimuli this specter lives inside your password protected device in the world of data you rarely have to resurface to the real world just to maintain a conversation check the traffic light or pay as your next in line but that's not the real you for now that's just a superficial copy willing to give the real world a chance and if the world's not that interesting you retreat back into your device but when you wake up the specter the ghost does not suffer as everything transfers over so you get to pay you slowly become the projection devices become faster with slower queue times and fast responsiveness no more button pressing and feeling there's a layer you have to pass the touchscreen is fast and makes it more addictive knowing that whatever you can do you can do it fast makes you more willing to stay there and do more sometimes it feels so random that you have to follow random threads and randomness is addictive in rats addiction is also fueled by randomness a characteristic that's not only cherished by humans burris frederick skinner one of the most influential psychologists of the 20th century discovered that yes randomness is addictive by simply studying the mind of rats skinner developed boxes with levers attached so that when the rat pressed the lever food pellets were dispensed rat happy he also developed another set of boxes where when a lever got pressed the result was not one pellet but it could also be none or many pellets sounds familiar this is the heart of gambling this is why tiktok is recommendation based you do not know what you are going to get and this is why other digital casinos switched their strategy as well recommendation based not chronology based scrolling instagram is not even that fulfilling like you finish that hour and you're like i know that was a waste of my time yeah but it was like over the threshold where you couldn't quite it's hard to put the phone these companies generally decide what you can get they also decide if you can decide or not so i believe yes it is the appropriate experience for an ideal well and why don't you let your eight-year-old child on tiktok i have seen this news articles i would like to address that my kids live in singapore and in singapore we do not have the under 13 experience if they lived here in the united states i'll let them use the under 13 experience tiktok engineers have created an app that is extremely bingeable it caters to interests you had no idea you had it sifts through an infinite ocean of content to find the videos that will make you say just one more it is the equivalent of a dopamine drip tiktok on the other hand wants me to believe that my willpower and their timer are all i need to limit my usage you can do a quick exercise right now and look at the app usage on your smartphone most of you probably won't do it as we are inherently afraid of the truth i'm not saying that you cannot learn stuff but most of it is going to be rather trivial i remember that at some point someone sent me a 30 to 60 second tiktok video talking about physics and quantum mechanics and the origins of the universe and while the intention was good i could not help but wonder the percentage of people who actually remember something from that video as most of us are still struggling when creating spaced repetition decks to remember a few words when learning a new language tiktok and other similar companies are creating screen time tools as a first step in their journey down the path of arguing that addictions are personal failings and overcoming them is a personal responsibility the same way global warming is on you you have to recycle you have to dim the lights so you have to fight it by installing blockers and try to unplug yourself more often you have to stay on guard as your persecutors are getting stronger i had been equating social media with digital nicotine but the casino metaphor substantially improves upon that notion nicotine is a natural substance that triggers parts of our brains that cause us to want more of it the main point of cigarette corporations is to determine the best delivery platform shape size flavor etc and profit off our brains response we created new types of casinos to be like miniature amusement parks for our minds they now push buttons like family status instead of buttons like pleasure or relax it seems to me that social media is on a completely new level than the good old nicotine when coupled with instant feedback loops that may optimize the input for each distinct user in real time tiktok twitter facebook instagram and possibly all upcoming social media apps are worse than cocaine in some ways because cocaine is always cocaine the white powder does not track how you use it or change itself so that the way it comes to you becomes more addictive in ways that are purposefully imperceptible to you and even if you might not fit the type of individual who can easily get addicted to social media that's ultimately an engineering problem these activities are getting you into a state of flow in positive psychology a flow state also known colloquially as being in the zone is the mental state in which a person performing some activity is fully immersed in a feeling of energized focus full involvement and enjoyment in the process of the activity in essence flow is characterized by the complete absorption in what one does and a resulting transformation in one sense of time we also have the dark flow which is a pleasurable but maladaptive state where individuals become completely pulled in providing an escape from the depressing thoughts that characterize their everyday lives this is most commonly observed in the behavior of slot machine players who have difficulties remaining on track in their regular life but the reinforcing sights and sounds of slot machines rain in their otherwise wandering brains and create flow like experiences is there a difference between dark flow and good flow isn't it the same thing just in a different context well it is not that simple some of the things the white flow and the dark flow have in common are losing time perception and the out of body experience but the outcomes of being in each state are different the dark flow is easier to get into and it is more predictable but also harder to get out of the dark flow surely feels similar to the white flow with your senses sharpened fast reaction time speedier progress but you are still reacting to the inputs you have rules you have the feedback but you are missing the challenge skill balance you can obtain the flow without skill this is why it is so addictive as everyone can do it watching a 20 minute video is harder as it requires large amounts of attention in today's world and to get something out of it requires contemplation thought critical thinking while a 30 second video gives you the illusion of deep learning and does not put any pressure on you getting into the flow when say writing an essay is hard you have to prepare your stuff you have to be organized you have to collect resources read comprehend you oftentimes have to stop and think read it again struggle to keep yourself there the activity needs to be balanced so that it is not easy enough but also not too hard to make you stop it needs to be tuned to give you enough frustration but also enough evidence that you can do it you can complete the objective when learning a language using an app such as Duolingo the basic stuff works great and keeps you in the zone because the mental activity is so simple setbacks and mistakes are minimal and small enough to be assimilated into at least a semi flow state however it does not appear to work when you get to the rough part of the learning curve which is more about hard work and clean focus and there are no apps in that region you may acquire the basic starting stuff extremely well but in any field I've seen them handle they quit exactly when it becomes challenging at the point of transition from amateurism to beginning professional levels of ability in short the failure of a positive flow state will either make you transition to a normal state or stop take a break and maybe reset on the other hand the frustration you get during a dark flow state will lead the individual back into the game to play harder scroll harder as maybe just maybe you will get something astonishing with the next input the white flow has a clearer end point a clear goal the chess player will drop out of the flow when the game is over a climber when reaching the top of the mountain a surgeon when finishing the surgery gambling has no clear finish line you are playing to extinction perhaps we might consider these activities to be instruments that we use for a number of reasons and other people just keep returning to that easily accessible peak of realization to the point that that brief significant ascent becomes the structural axis of their life around which all other priorities are ordered and all other things are appraised these super stimuli are coping mechanisms to escape life what gamification appears to accomplish is increase in activities natural attractiveness it's a pleasant facade that occasionally covers the steep slope of the effort slash returns function isn't the black flow what happens when a low effort steam blowing fun pastime becomes the dopaminergic pinnacle of an otherwise bleak existence if you had no super stimuli would the life of prison inmates be the same this is a question without a proper answer as i do not have the data outlining the current state of an inmates brain distortion due to subhuman prison conditions but i do know that generally the prison system is pretty dysfunctional a cow uses vr goggles in an attempt to reduce anxiety how bad is this it obviously depends on the type of fence you are looking from with the rise of capitalism and consumer culture subtlety has become a powerful weapon huge banners yelling at you to buy a product are no longer needed people have become smarter in that regard now advertisements need to be carefully packaged polished and nicely labeled to fit a specific category there is a category tailored for everyone in the late 2000s mark fisher an english philosopher and political cultural theorist also known under his blogging alias k punk repurposed the term capitalist realism to describe the widespread sense that not only is capitalism the only viable political and economic system but also that it is now impossible even to imagine a coherent alternative to it he expanded on the concept in his 2009 book capitalist realism is there no alternative arguing that the term best describes the ideological situation since the fall of the soviet union in this situation the logics of capitalism have come to delineate the limits of political and social life with significant effects on education mental illness pop culture and methods of resistance the result is a situation in which it is easier to imagine an end to the world than an end to capitalism fisher writes capitalist realism as i understand it is more like a pervasive atmosphere conditioning not only the production of culture but also the regulation of work and education and acting as a kind of invisible barrier constraining thought and action capitalists maintain their power not through violence or force but by creating a pervasive sense that the capitalist system is all there is they maintain this view by dominating most social and cultural institutions fisher proposes that within a capitalist framework there is no space to conceive of alternative forms of social structures he adds that younger generations are not even concerned with recognizing alternatives he proposes that the 2008 financial crisis compounded this position rather than catalyzing a desire to seek alternatives for the existing model the response to the crisis reinforced the notion that modifications must be made within the existing system fisher argues that capitalist realism has propagated a business ontology which concludes that everything should be run as a business including education and health care productivity is encouraged and cherished but technology changed the game you no longer have to go through a difficult or dangerous journey to become an adult instead you may avoid danger and have a comfortable life this is an example of devolution you can have a good time being a degenerate well into your 60s pre-cooked foods constant entertainment and pornography have robbed us of our control over our behavior sure one can blame late-stage capitalism for giving people too much of a good thing capitalism is to blame as people are overworked and seek escapism through these comfort devices but we can see this type of gambling throughout history you have ancient myths describing people and even gods gambling to excess but maybe capitalism is the starting vehicle through which we can acquire life extension and even immortality there is of course a debate on whether or not acquiring immortality is even what we ought to do but that's a topic that i might cover in another video cutting-edge entertainment technology has the potential to induce widespread sterility wireheading population decrease and extinction given the heritability of media consumption habits any such impact would result in rapid human adaptation implying that extinction is practically impossible absent and abrupt collapse or maybe exponentially expanding addiction i feel like we need a different type of tech to incorporate the poor in the hills but we need to ask ourselves can we live completely off grid successfully by leveraging more portable devices which are not wi-fi dependent the smartphone will be almost dead without that what about living completely on the sea on a macro scale tech is ruined if you have to connect to wi-fi having something like wikipedia available offline can catapult one forward and allow for faster bootstrapping if say you want to rebuild civilization let's aim to decentralize the world instead of creating systems that leak power our current systems involve humans and maintenance but maybe we can solve this with ai in the end evolution is essentially a historical statistical macro fact about which predecessors truly reproduced these genes then continue to function as before consequently the organism's behavior is often better explained in terms of what was successful in the past rather than what might be effective in the future the organism's genes are indeed the product of past success not future functionality do superstitions contribute to behavioral addictions at the very least they frequently squander time and money with deceptive promises we find ourselves going down rabbit holes in search of unnecessary information or buying additional items that appear exciting but offer little genuine value less obviously they can negatively impact our responses to natural stimuli such as prioritizing fast food over nutritious meals photoshop models over ordinary people games and entertainment over the slow pleasures of reading novels and nonfiction and an unexamined frenetic lifestyle over a thoughtful one perhaps we should shift our focus away from the super normal and towards the subtle and fine encouraging a closer inspection and deeper appreciation of the beauty and benefits concealed within the ordinary ultimately the final question remains do you truly understand what you are consuming or are you simply ingesting whatever comes your way


Thank you very much and thank you for the opportunity and the invitation to speak at this important event. Let me first say that I and my family are really happy to live in Indonesia. It's a great country and we appreciate it every day. So, on behalf of CIFOR, I would like first to express our gratitude to the government of Indonesia, the president, the Ministry of Forestry, the FORDA for supporting us in our mission and for the strong partnership that we're enjoying with the Indonesian institutions. As you may know, Pak Eman is also on the board of trustees of CIFOR. Before him, we had Pak Fattoni and we also have an office with Indonesian government Pak Agus. We are very grateful to have these expertise to help CIFOR in its mission. CIFOR is an intergovernmental organization and this partnership with the government of Indonesia is really, really helpful when we do our work. And it's also very good and interesting to see the lead role that Indonesia is now taking internationally. We know very well from the follow-up to Rio Plus 20 that your president is engaged at the very highest level to look at the post-2015 development agenda and the sustainable development goals. I think this is an important sign because what we do in forestry, be it FORDA or be it CIFOR or be it any other institution, I think should relate to these broader development goals. And if we do that, then we will make sure that forestry is on the agenda, is in the minds of the high-level politics and in the minds of many people. I think this is really the important avenue forward and as I was speaking yesterday in the seminar here about how we put forests in the context of the green economy, this was also my message, we need to broaden out forestry, we need to make forestry relevant for the broader development goals. That's what I as an incoming DG of CIFOR is trying to promote and just to give you one sense of what that means in practice, we are working on our research priorities and we're having a dialogue also with FORDA on research priorities. One of the areas that I would like to see grow in importance is the planted forests, the production forests issues. And a very big reason for that is that this is one way I see how forestry can contribute to the broader development agenda, the environment part, the human part and the economic part. This is really central to forestry for the future. Of course, we will continue to be very much engaged in climate change, in biodiversity and all the other important topics, but I wanted to flag that we see the broader contributions to development as an important factor in forestry. FORDA is celebrating 100 years of research, that's a major achievement. CIFOR is celebrating only 20 years this year, but we are celebrating and I've learned that CIFOR actually was born on this campus and for the first year, CIFOR was hosted here at FORDA. I think we together can look forward to many more years of working together on shaping the forest research agenda and helping each other to influence the international debate, dialogue and decisions on forestry. Now, today we're going to have a ceremony to sign an agreement that will extend our partnership with the government of Indonesia. Particularly, this is about the initiative that started already in 2011 to work on awareness raising, communication and knowledge sharing on climate change and specifically on red. The work we've done since 2011 with a redIndonesia.org website, which this project is partly about, has shown that we've been able to attract more than 100,000 visits to this website. So we're really reaching out to a wider audience with the red issues. We've had 50,000 downloads of publications and we've had a monthly newsletter in Indonesia and distributed to more than 5,000 subscribers. So this partnership is really important. It helps the forestry research messages to get out to the wider public. And this is something we want to continue. And we're also continuing the series of training workshops on communication with FORDA staff. That will be an important element of the next phase. And we're also tailoring further communication initiatives together with FORDA. We all know the importance of social media these days, be it Facebook, Twitter, etc. And we are really using these to leverage our messages and helping the knowledge of red to grow. So in conclusion, I look forward to a continued partnership on this particular project. Again, many thanks to the Government of Indonesia for its support to see FORDA. I think we have a lot to build and work together on in the coming years. And I look forward to that very much. Thank you.