Item number SCP-5850 Clearance Level 3, Confidential Containment Class, Keter Disruption Class 4, Echie Risk Class 5, Critical Special Containment Procedures Due to the nature of SCP-5850, containment is not possible at the present time. One personnel tasked with monitoring SCP-5850 are to be granted administrative access to all train traffic control systems operating within the United States. Reports concerning SCP-5850 are to be stored within a dedicated server and evaluated weekly. These reports must include the following information. SCP-5850's current, prior, and all previously reported locations. Material changes in velocity, magnitude, or physical structure. Copies of public material concerning SCP-5850. This material includes, but is not limited to, photographs, videos, and police reports. Dedicated observation of newly discovered SCP-5850A instances. Reports of SCP-5850's current Ulf value. In the event that SCP-5850 travels through a populated area, Foundation personnel are to reroute or stop all incoming traffic, so that no individuals are affected by the anomaly. In the event that these procedures fail, and any human subject perishes to the SCP-5850, the confiscation of any recording devices, along with the amnestidization of the populace that observed SCP-5850 is required. Description SCP-5850 is a passenger locomotive currently in transit within the United States, and has never been observed to stop or decelerate under any circumstances. SCP-5850 has plowed through all known obstructions, with no loss in velocity. SCP-5850 has also been observed to maintain its speed, even with the absence of rails. The current cause of this remains unknown. Upon its discovery in 1924, SCP-5850 maintained a velocity recorded at approximately 120 km per hour, and has since accelerated an additional 26 times to a current velocity of 145 km per hour. SCP-5850 has also been classified as an anti-excentential object due to its effects on dimensional energy and localized spacetime. SCP-5850's physical structure consists of steel, aluminum, zinc, and plastic. Along both sides of SCP-5850 reeds, Investago Railroad Company, which spans 70% of its total length. Even passenger cars are attached to SCP-5850, which also contains SCP-5850-A instances. SCP-5850-A refers to 24 indistinct humanoid entities, observed throughout the entirety of SCP-5850. These entities manifest after SCP-5850 collides with human subjects, followed forward with a flash of light. Recent research efforts are to ascertain the established connection between these entities and their perceived effect on SCP-5850's speed. These entities do not appear to require sustenance. Addendum 5850-1 On March 14, 2020, Senior Researcher Kenneth Williams submitted a request for experimentation on SCP-5850. When asked about his reasons, Researcher Williams submitted a report titled, All Values and Their Hypothetical Effect on Spacetime, which has been attached to Addendum 5850.2 of this document. Listed below is the video log after his report was formally accepted. Video Transcript 5850-A Video Log Date? March 26, 2020. Note The following video was recorded to observe and analyze SCP-5850. This recorded was taken from the perspective of Senior Researcher Williams. Accompanying him is Dr. Reigns, Mobile Task Force N-D-1 Captain Russells and MTF N-D-1 Sergeant Stevenson. The research team was also given several other devices per Researcher Williams request. Begin log. Video recording begins in an MTF N-D-1 designated vehicle traveling northbound. In front of the camera is Dr. Reigns. The perspective pans around the interior of the vehicle, introducing MTF N-D-1 Sergeant Stevenson and Captain Russell who sit alongside. Are you sure you understand what you're doing, Kenneth? Of course. Why do you ask? Well, it's just what you're proposing. Do you really think the counters are going to work? I couldn't tell you. Sergeant, are we getting close? Stevenson looks out the left window. Almost. Give us another minute. We'll let you know when we see. For now, stay cozy. Silence for 15 seconds. Laura, you know what you're doing, right? No, not really. You haven't really told me anything. I know, I know. But trust me, this is important.  Hopefully, if the math checks out, this test should tell us something. You keep saying that, but I still haven't heard you actually say what it is you're talking about. It's just a hunch, Laura. A hunch about what, Ken? Hey fellas, we're at the location. The vehicle turns sharply to the right before coming to a complete stop. All four passengers disembark, and the camera pans across a straight road leading to a railroad crossing. Williams and Reigns run to the railroad crossing, each carrying a pair of long aluminum rods with a bulbous tip. How far are we from SCP-5850? We're about 25 kilometers away at this point. Alright then. Fuck. Laura, let's get this equipment set up. You remember how I showed you, right? Good. Let's hurry then. We've only about ten minutes. Williams and Reigns begin setting up the Ulf counters in four separate locations, which corner the railroad crossing. Afterward, they connect each counter using a physical wire before bridging them together onto a computer terminal located ten meters away. Williams sits near the terminals, as Reigns continues setting up the Ulf counters. Laura, how are we looking so far? I'm almost finished. How long do we have left? Less than five minutes. Come on, you can leave them alone. They should be good as they are now. Laura, please. There's no reason to risk your life over them. Reigns vacates the area and moves to Williams. You better hope this hunch of yours is right, Kenneth.  Alright, I'm turning it on now. The computer terminal boots on and begins running an unknown program. In the distance, SCP-5850 is horned blairs.  Come to daddy. Is that really necessary? Sorry, what?  SCP-5850 arises at the location. As it progresses, several instances of SCP-5850-A are visible within its interior. SCP-5850-A does not react to Williams or Reigns, despite their proximity. It takes approximately two minutes for SCP-5850 to pass. During this time, Williams' computer terminal begins to flash. This ends when SCP-5850 exits the area. Well? Did you learn anything? Williams did not respond to Reigns, continuing to stare at the computer screen. Well, did you?  Well, what did you find? This...train. At first, I thought it was weird that the counters were picking up dimensional values. But then... Quit with the nonsense, Kenneth. Laura, take a look at these readings. Reigns walks to the terminal, leaning forward to observe the readings. We were right. EC-violation notice 5850.A, copy of ethics committee policy violation for Kenneth Williams and Laura Reigns. Ticket No.<PHONE_NUMBER> Assigned Agents Malcolm Dormansk Recipient Kenneth Williams, Laura Reigns Summary Anonymous complaints received on April 1, 2020 concerning indecent email between senior researcher Kenneth Williams and Dr. Laura Reigns were uncovered and promptly investigated. Following the conclusion of this investigation, Kenneth Williams and Laura Reigns have been warned about their behavior. It should be noted that failure to comply with Foundation policies and standards will result in corrective action up to and including termination. Our policy enforcement operatives on a three-strike system. This document is an official notice that the listed recipients have one strike on their record. This strike will be removed in one year if no other actions are taken against these recipients. This document, along with all of its attachments, has been saved to SCP-5850's file as it pertains to its continued investigation. Signed Malcolm Dormansk Are you ever going to explain what happened? You haven't been answering any of my texts, and I haven't been able to stay home long enough to talk to you. Are you okay? You sounded really excited about what happened. I know you've been submitting stuff to the IRFs, so I know you haven't died. Just let me know what's happening, okay? We're in this together. I know you're busy, so please respond when you can. I'm getting worried, Laura. I'm sorry about not getting back to you. You don't need to worry. I haven't become a zombie or anything. It's just… With what I've discovered, my excitement has gotten the best of me. I didn't mean to leave you in the dark. I'll be sending you with some more information later. I'll be home later if you want to talk about it. This could be revolutionary if my theories are right. It's exciting to me, that's all. I just needed some time alone for a week or so to get all my thoughts into one place. Tell you what, let me take you to dinner sometime. It'll be just like we used to. P.S., after dinner, why don't we take the fun back home? It'll be just like we used to. If we're going to do it like we used to. At least go to the pharmacy before you come home. I know how fast you can finish. Addendum 5850-2 Document 303-EM-5850.b Both values end their theoretical effect on spacetime. Status approved. Author. Kenneth Williams. Laura Reigns. Synopsis. For millennia, the human race has fantasized and dreamt of the places we would go to once we perish from the earth. Religions. Folklore. And even scientific studies have searched far and wide to ascertain the truth behind death. This simple question continues to plague us. What happens after we die? However, with the introduction of SCP-5850, the answer to an afterlife might have been inadvertently solved. Once we believed that our dimension, humanity's perception of reality, was stagnant and unchanging. With the introduction of anomalies such as SCP-3082 and SCP-4051, we now realize that dimensions such as ours can exist outside of our preconceived notion of reality. These anomalies can access, change, or fundamentally shift other dimensions to fit their needs. SCP-5850 is no exception. For these other dimensions, we have issued values that help reference their existence to our very own. Our dimensions set to the value of zero, with other dimensions spanning values from one to infinity. With dimensions closer to zero, we understand that they better relate to ours. But what would happen if a dimension held a value below zero? With the introduction of SCP-5850, we realize that dimensions are capable of doing exactly this. We understand that in order for dimensions to properly exist, organic matter must be able to fundamentally operate. With the introduction of these anti-dimensions, which are capable of possessing anti-spacetime, it should only make sense that non-living matter must fundamentally operate there as well. Because of this, we have issued a unit of measurement, specified as Ulfs, which measures the value of these anti-dimensions. Ulf values also measure similarly to current dimensional values, with numbers closer to zero relating to that of our own. SCP-5850's Ulf value measures negative 0.001 at the time of this writing. If this theory is correct, the concept of an afterlife purely resides in these anti-dimensions. There could be an infinite amount of afterlives, each operating in their own ways. Perhaps heaven and hell and Judeo-Christian holy books are real, but differing in their Ulf values. More research is required to understand more about these anti-dimensions. Video transcript 5850.b Video log Date May 2, 2020 Note, the following video was recorded during the measurement of SCP-5850's Ulf value. Footage recorded was taken from the perspective of Senior Researcher Williams, accompanying him as Dr. Reigns, and MTF-ND-1 Private Second Class Ryan Smith, who was away from the area. Begin log Video recording begins on a railroad split rail, with the camera facing towards the central point, in front of the camera is Dr. Laura Reigns. Hey, are you getting explained why we're at this divide? I thought the plan was to go somewhere more controlled, like, a clearing or something. It was, but we missed the opportunity. We just got some news that someone was hit. The place had been amnesticized, but now the train's faster than it was before. How much faster are you talking about? If it stayed consistent with the other ones, I'd say around 144 or 145 kilometers per hour. But besides that, this is the only other way it's heading that isn't a city or a town, so basically we're stuck here. Shit, how much longer do we have? A few minutes by this point. We need to hurry, though. The counters still need to be placed in the right areas. Could you set them over there? Yeah, I can. Thank you, Laura. Reigns heads towards the designated area and begins placing the elf counters. After a moment, Kenneth walks towards a computer terminal located 10 meters away. Hey, are you okay? Of course. Why wouldn't I be? It's just… you never answered my texts last night. Kenny, I'm fine. I know you're excited about this project, but… now isn't the time to discuss what's wrong with me. We can talk about it later. Are you sure? Fuck, it's already here. Laura, get away from the tracks! I hear it, Kenny. I'm trying. I just need to set the last two counters, okay? Hurry then! After several seconds, Reigns moves away from one of the elf counters and runs to the opposite side of the tracks. She quickly unfolds the final elf counter, quickly positioning it near the train tracks. Her body is directly across the edges of the track. SCP-5850 is visible, and it's estimated to be approximately 2 kilometers away at this point. You need to pick it up! Laura! Fuck, just another second. Williams begins to quickly walk towards Reigns as she finishes with the elf counter. Once completed, Reigns quickly turns around to Williams.  Williams begins running towards Reigns. Several seconds later, SCP-5850 impacts Reigns before she can finish her sentence. At the same moment, Smith was able to intercept Williams before he was able to get in closer. Williams remains silent for several seconds afterward. As SCP-5850 leaves the area, another instance of SCP-5850-A appears in the final passenger car. End log EC violation notice 5-8-5-0-point-B Copy of Ethics Committee policy violation for Kenneth Williams. Ticket number W-O-000152461 Assigned Agents Malcolm Dormansk Recipient Kenneth Williams Summary Several reports concerning Researcher Kenneth Williams' behavior were investigated on June 12, 2020. This behavior included, but was not limited to intimidation, physical aggression, indecent comments towards other personnel, and other related behavior. This document is an official notice that the listed recipient has two strikes on her record. These strikes will be removed in 18 months if no other actions are taken against this recipient. This document, along with all of its attachments, has been saved to SCP-5850's file as it pertains to its continuing investigation. Final notes While we condemn Senior Researcher Williams for these actions, we do understand the situation concerning Dr. Laura Reigns. It is an unfortunate circumstance, but we are here to guarantee that the proper resources are available to Foundation personnel that are in need. Whenever Senior Researcher Williams is free, we highly suggest that he has scheduled for an appointment with the on-site therapist. Listed below are additional attachments that have been sent to Senior Researcher Williams. Signed Malcolm Dormansk Addendum 5850-3 EC Violation Notice 5850.C Media Ethics Committee Policy Violation for Kenneth Williams Ticket Number W-O-00015-4298 Assigned Agents Malcolm Dormansk Recipient Kenneth Williams Summary Continued complaints concerning Senior Researcher Williams has led to a final investigation. Once its investigation concluded, it was determined that Senior Researcher Williams continued to express violent and inappropriate behavior. Specifically towards his colleagues. This document is an official notice that the listed recipient had three strikes on her record. Because of this, the Ethics Committee has deemed a motion, along with a transferral to be necessary. Please remove your belongings from any office or living quarters within your current site by Monday, August 8. This document, along with all of its attachments, has been saved to SCP-5850's file as it pertains to its continued investigation. Signed Malcolm Dormansk Six days after the violation noticed 5850.C, Researcher Kenneth Williams and several ALF counters were reported missing. This led to an official investigation of which Researcher Kenneth Williams was located in her Las Vegas, Nevada. Attached below is the affiliated video log taken during the investigation. The transcript, 5850.C, Video Log, Date, August 14, 2020 Note, the following video was recorded while four MTF-ND1 members were searching for Researcher Kenneth Williams. The recorded footage was taken from the perspective of MTF-ND1 Captain Russell. Accompanying him is MTF-ND1 Sergeant Stevenson, MTF-ND1 Corporal Chad Mayers, and MTF-ND1 Private Second Class Ryan Smith. Begin Log Video recording begins with MTF-ND1 approaching a bridge that overlooks a railroad track. Further ahead, a man can be seen on the bridge. Approach slowly. Mayers. Watch S6. Smith. Get to the other side. Stevenson and I can handle the POI. Make sure he's set to non-lethals. Shoot if required. Roger. Russell progresses towards the bridge. Stevenson follows on his right side. Mayers and Smith step out of the frame. MTF-ND1 continues to approach the figure. Are you in position, Smith? Affirmative. Standing by. Acknowledged. Hold your position. Establishing contact with POI. Russell signals Stevenson to hold his position as he continues towards the figure. It was hereby referred to as Williams. Once within a range of 10 meters, Russell stops moving. Freeze! We're here to escort you to a safer location. If you refuse to listen, we will use force. Hands up, Kenneth. Russell raises his weapons towards Williams. At the same moment, a blaring horn is heard nearby. Williams begins to laugh. Russell approaches slowly. I said hands up! We will engage if you don't cooperate. Just leave me alone. Don't you see what I'm trying to do? Russell advances. He is approximately 5 meters away from Williams. Along the edge of the frame, Smith also advances. Kenneth, step away from the edge of the building and walk towards me slowly. Williams takes a single step backward, leading his body to the edge of the bridge. Russell continues to approach Williams and is now 4 meters away. The sound of a horn can once again be heard, this time sounding louder. You don't understand, Laura isn't dead.  I've been pouring over the research for months. This is the only other place I know of where I can get close to SCP-5850. If I don't do it now, it'll only take more time before I travel somewhere else that I can get to, you have to let me at least try. That won't be necessary, either you do as I order you or we'll be forced to shoot. Look, none of the documents will tell you the truth. Laura and I spent so much wasted time. We would stay up all night for days, just looking over numbers in our bedroom. It was, it was peaceful. I'm sorry for you, Kenneth, but how does any of that right now solve anything? You don't understand, but you know what she was going to tell me before she died. We can talk about that once we're back home, but right now you're endangering yourself and plenty of other people. We need you to come with us. She, she had a miscarriage. After we spent forever trying to have one, I found the reports in her locker. Don't you get it? I can get her back. I know I can. I just need more time. You have to let me try. Nothing you're saying right now is making any sense. You're upset. I get it. But if anything were to happen to you, we would all be at a loss. Just let me do this. I have all the equipment set up. I just need this final test. You need to come with us. This is your final warning. SCP-5850 becomes visible behind Williams. Russell advances until he is approximately two meters away. Fine, so be it. I guess my only other option is to go where she is. Williams jumps backwards, going over the wall of the bridge. Russell attempts to fire at Williams, but is unsuccessful in incapacitating him. Williams falls to the ground in front of SCP-5850. Seconds later, SCP-5850 impacts Williams. God! Dammit! Stevenson, get Mayas. Tell him to bring a buddy back. End log. Following this incident, an additional SCP-5850-A was discovered sitting there another instance.


Abstract solid lipid nanoparticles, SLNs, are a promising lipid-based drug delivery system for the development of novel therapeutics. However, their characterization remains challenging due to the lack of suitable techniques. In this study, we introduce a new method based on stimulated Raman scattering, SRS, microscopy to image SLNs in vitro and in vivo. We demonstrate the feasibility of our method by imaging deuterated SLNs, which are bio-orthogonally labeled with a fluorescent dye. With this approach, we achieve ultra-high single-particle sensitivity, enabling us to count individual particles in vitro and in vivo. Furthermore, our method provides chemical specificity, allowing us to distinguish between different types of SLNs. Finally, our results show that our method has the potential to become a powerful tool for studying the mechanisms behind SLNs performance in drug delivery. This article was authored by Shachuling, XIN Gao, Mian Wei, and others. We are article.tv, links in the description below.


I'm Adrienne Lawson, a data analyst at the Linux Foundation Research Team. I'm working very closely with Stephen Hendrick on the quantitative research side of the research team's activities. And today's talk is going to be about, well, I named the asymmetries in open source, but it's really going to be about the consumption contribution gap that we're seeing within our research and ways to improve the sustainability of OSS. I'll go ahead and let people enjoy. So the research is based on the Global Spotlight 2023 survey, which follows the 2022 Europe Spotlight Survey, but this time we took a worldwide approach and tried to cover as many regions of the world as we can. The objectives of the study was to examine current levels of activity of open source, as usage and contribution patterns, mainly within organizations and whether organizations are using or contributing to open source. Also to identify inhibitors and motivators. So why is it that organizations are not that willing to contribute or whether they are using a lot of open source and why is that? Also to explore opportunities in the open source landscape. Recognize the growing reliance in open source that we usually see, but it's nice to see confirmed in the data. Also to understand the piercing value of open source. Investigates benefits and challenges, strengths and weaknesses. So this is what we set out to do with this survey, with 44 questions. Just a little bit about methodology, we distributed this survey between April to June of 2023. The regional distribution of the sample looks like 33% is from the Americas, 34% is from Europe, 27% from Asia-Pacific and then 7% from other regions, which are very much lumped together and this is because we weren't able to gather that much data from those regions, which is an issue but should be discussed at another session. Our sample sizes for the Europe sample because we're open source summit Europe, I thought that there would be some findings where I would highlight the European sample and respondents. That includes 307 usable responses and for the global sample we have more than 900 people who started the survey and then of course it's a 43. It's quite a long survey so we did have people dropping out throughout but we still made use of their responses before they drop out. Now going into the results, so I'm talking about this consumption contribution gap, what is that and why do we see it in the data and how did we measure it? One thing and that's why I titled this presentation as asymmetries in open source because there is definitely an asymmetry between open source use policies and contribution policies. Here on the horizontal axis it's all about contribution and then the more we go to the right the more the policy is open and permissive so on the right its OSS contributions are openly encouraged whereas on the left OSS contributions are not at all permitted and then on the vertical axis it's the same thing but for usage policy and if it was fully symmetrical we would see most of the percentages on the diagonal and we would hope to see as many organizations in the top right corner where organizations are openly encouraging use as well as contributions but as you can see it kind of shifts the left a little bit so more organizations are permissive in their use policies compared to their contribution policies. I think another chart that nicely illustrates the difference between consumption and contribution is this chart where each of the lines are showing a region so first it's the total than the Americas then Europe Asia Pacific and then the other regions lumped together. Four questions are shown in this graph the first one is whether open source is used within the organization and the percentage shows that the amount of organizations that say they have widespread or significant or moderate use of open source so that's around the 90% range as I think all of us kind of were thinking and it's not nice to see confirmed then going down to the use policy and better open source uses encouraged or we also had another answer choice which says open source use is up to each development team within the company that is around the 70 range and Asia Pacific goes down to 66% in this case. The third question would be about what's the contributions and the policies and whether it's encouraged or up to the development team to decide whether contributions are permitted that's down to the 60s range and then the last one is about OSPOS or clear and visible strategies we did try to not fix it to OSPOS because we do know that a lot of companies are not using the term OSPOS but instead but do have a visible and clear strategy and that that goes down to the 50 40s range in the other category it's 34% and it's interesting how in Europe there's a kind of widespread use it's quite encouraged compared to the other regions but OSPOS and visible strategies are not there for example compared to the level in the Americas. I made also kind of a turn to how is open source used because we did ask a lot of questions on what are the kind of steps that people are following when they're evaluating OSS components or better to use them and yeah I think this is a quite an important takeaway. One question asked whether people believe that OSS is more secure than closed software that was 68% of respondents but the picture is not that clear because in another question we do see that 42% still raise concerns about the security of open source components and then if you even go further it's 24% of organizations who require development training in secure software development so although people are raising concerns it seems that they don't require actions that would kind of make sure that they can avoid the concerns and then when people are evaluating whether to use an open source component in their organizations most of them tend to check the activity level or other proxies and then evaluate whether to use it instead of kind of a more direct inspection into the source code which is of course not possible in every situation but it's nice to see or interesting to see that this comes up at top. All right so what about contribution how is that going within organizations? So overall 48% of organizations contributed code to an open source project we did also ask about whether they contributed non-code assets such as graphics or whether they provided documentation or opened a query on Stack Overflow but when explicitly asked about contribution to an open source or contributing code to an open source project that was 48% and that number is 54% in Europe and we also asked about kind of the steps that are followed before or when contributing open source code and I think it's a nice there's a nice difference between organizations who do have an OSPO or a clear strategy compared to those who do not the sorry the dark blue is the are the organizations with an OSPO and the light blue is organizations without an OSPO and throughout the steps we can see that around there's two times more organizations following the different steps be it code review by peers or quality assurance testing or security testing or even legal approval in sign off so there's definitely a difference and then now going into how should we narrow the gap based on the data we did have an expressive question on whether respondents agree that the following actions would increase contribution if it was invested in their organizations and at the top it was allocating employee time for open source contributions so that their employees are able to within working hours within their salaries to contribute to open source projects the 63% said funding open source projects 62 about is it 65% 62% said that providing organizational education on the OSS value proposition would increase contributions and then there were also answer choices about clear policies and open sourcing their own product all right so how do we narrow it but also let's see how much time people are spending contributing to open source projects be it personal time or within working hours all right this is a bit of a complex graph so let me talk you through it the bar charts are showing time the percentage of respondents who said that they are working this much time during the week on open source so on the left is respondents who said i'm not working in open source at all then from one hours per week to all the way to more than 40 hours per week so just showing as we as we could it's not surprising as we're going down to 40 hours it's less and less respondents saying that they're working on open source within the charts we had different questions on whether they are working on inner source projects or other employer supported projects or a third party open source projects and as you can see there are differences and most of the people are working on inner source projects and then it's going down for third party projects the pink bar is showing personal time so the amount of personal time that people are are spending to contribute it's a bit of a it can be a bit confusing because we do have to add the inner source project in person for this project and third party projects to get out all of the time spent during working hours and that does exceed the personal time that people reported in the survey and then on the right axis it's about the total hours contributed and i just wanted to add that to the graph so that people can see that even the one or two hours per week do it up and that means a lot of hours even though there's just a few people contributing more than 40 hours and that adds up as well so all contributions are equally important and hopefully employers see that so i wanted this talk to be a bit about also help to individual contributors within companies so that they are able to go to their employers and say there is value in contributing i would like you to appreciate that that i can contribute be it one or two one to four hours or full as a full-time assignment and there are values tied to that there is definitely a growing value of both use and contribution so organizations were asked whether over the last year how has the business value or benefits of your organization derived from osu's contribution changed and even for contribution 46 percent of organizations said that the value increased just because we contributed 35 percent says that it has stayed the same and four percent said that it decreased going into the specific benefits that contribution brings the question was how often do osu's contributions in your organization deliver the following benefits and improves the software quality came up on the top as 52 percent said always or often it also makes the organization a better place to work and in an industry sense enables the IT industry to be more innovative people also mentioned a moral obligation and then there was also improved security all right and now to the limits of contribution where one clear answer could be that that organizations are not seeing a clear return on contribution a clear revenue back but there are actually non-monetary limits to why organizations are not allowing contribution the first one is actually legal or licensing concerns where the dark blue is people who agree and then agree with the statement the blue is neutral this greenish is disagree then going down is also free of leaking intellectual property then a lack of policy or training materials and then actually a clear lack of return on investment is down to the fourth place technology constraints and challenges come last all right so we also asked about open-source sustainability in general not just in your organization but in a wider sense how could we improve sustainability this question is about the areas of further investment so in which areas do you think that there should be further investment in open source across our geographic region and it's segmented by region for Europe and the Americas it's government adoption of open source that's the first that came up top so government has a special role whereas in Asia Pacific they would like to see better funding of the commercial open source startups ecosystem then we also see open source alternatives to technology monopolies and better academic education whereas in Asia Pacific it was more about fostering open source global technology standards and then the third best government adoption of open source yeah and the explicit question of how should open source project sustainably be improved 63 percent of respondents said again that organization should allow time during working hours for employees to make meaningful contributions 54 percent that said that organization should accept that they have a responsibility to give back and then 44 46 percent said that employers should proactively sponsor OSS standards and project for interoperability right so now going down to the conclusions and kind of what I think are the most important findings from this data is that we can see asymmetrical open source use and contribution policies there is a gap between use and contribution and organizations need to realize their responsibility that comes with use and contribution and that there should be steps followed before contributing or during using open source it does help or it correlates with whether an organization has an OSPO or another OSS initiative to to have with that we also saw that our spend contributing do differ but all of them are equally important um as the little adds up um that there are non-minutary benefits to contribution and that the value of contribution doesn't necessarily tie into money and it has value for the organizations um we also saw that there are limits which are also not tied to money for contribution for example legal and licensing concerns um also we saw that the government has a special role in advancing open source and uh that people feel like organizations have a responsibility to the give back to the open source community and that should start with allocating employee time to open source contributions and funding um so that was the end of it um here's my contact information and there's already a europe report up with just the european results on the aleph research website and the worldwide report we will publish in the end of october and another thing that the linux foundation research does is that we share all of our data on data.world um so that people are able to reproduce our results um so thank you and now i will open it for questions yeah go ahead i think from our survey what does come up is is kind of the innovation part of it so that they feel like even though there aren't direct returns right now on the innovation that is going on here in our company be that some people are contributing to open source um they do see an innovation aspect to it as in in the whole of the industry um the other thing is that as we saw most of the time they are letting employees work on inner source projects or employer related projects so that they do see an interest in the interesting contributing as maybe one their whole open source software is dependent or their their proprietary software is dependent on an open source project um and then they contribute to that uh project so that they are able to maintain their own proprietary uh uh software um i think these are probably the the main reasons why and then i think i i think it's not we shouldn't underestimate also employers who just really see and feel a responsibility to give back be that they they um yes they they just feel a moral obligation be that they have before contributed to open source and then became a CEO of a company and then still trying to um spread this evangelism that could be too 95 90 percent of the software is open source so i think it probably the companies will rise up and try and start understanding that directly getting involved in open source or it would be more like my pages it's it's probably that that is starting i think yes i think i think it is yeah thank you for the question that's a really good question um but on one part i would like them to see the surveys and the research result that we're doing so that they are able to see that other companies are thinking that um and then maybe they would feel a bit behind if um if they're able to see the results and they're like oh people are there already this many people are having ospos um but in terms of i think probably just the the linux foundations whole ecosystem i think a lot of um sub foundations such as the cloud native computing foundation uh hyper ledger do have these um open source landscape maps and are really trying to show people that there are projects happening and um and hopefully leaders are able to see that how much their work is depending on it um the biggest uh open source foundation i would say but how is that's a really good question and i don't think i fully um comprehended that when i first joined the linux foundation which wasn't that long ago it was in march and uh i think it it really depends there are some foundations which started off as a separate entity and then uh came to join the linux foundation but still kind of have a different um well i can see it on their website for example that the website is a bit different and then in the end you can see that oh it's part of the linux foundation so i think it's they are it's it's their own strategies or their own way of trying to figure out where to fit in this but there are a lot of people there are a lot of foundations which are part of the linux foundation um and have like either fully i'm not sure about the different joining processes and it could it could be all the same but this is what i've uh i've seen is that it might be very different for the different foundations um and i'm sure that there are foundations which are not at all um uh related to the linux foundation okay sorry it's okay i'm also happy to just have a like people commenting discussing it doesn't have to be a question yeah to me i think it was this one it was um because on one on the one hand i think probably the most um important limitation to contribution is this clear lack of of investment of a return of investment but also at the same time this graph suggests that organizations that kind of went beyond this and said okay we do see value we would love to contribute but they are still facing barriers um and not able to allow contribution happening in their organizations because they are afraid of these specific things and this really comes up in for example the financial services we are also doing uh research on that which is a highly regulated industry um and it can be seen that they are very very careful um even though even if they would love to contribute there are so many barriers to do that yes unfortunately this survey was very much organization focused as in a lot of the questions are based on um is there organization doing this why do you think your organization's contribution is limited by uh etc um there aren't a lot of personal level questions there is one question about what are the motivators for you to contribute in your own personal time um but there aren't really questions on for example why is so on a personal level why is contribution limited within your own working hours um even if you're allowed to um so we did not have a question um but i think probably there's going to be a there might be a very developer focused survey coming up it might happen i'll i'll discuss with uh with the team but i um yes um that i would love to see as well but also i think this survey is very good at showing that there are a lot of organizations seeing value um and that this can be uh used as kind of uh an evidence of okay plus either please continue what we're doing which is contributing and making sure that this ecosystem persists or or trying to get there no that's so good because i feel like it's gonna take a lot of different forms within their uh a specific company or a specific organization and i think that there was even a talk about um public ospals in public sectors and how that's different from from a company ospo so it just yeah it really depends on what what each team needs and what what each company needs and feels like um or how os is going to be incorporated into their their um every day if we are done discussing i'm happy to let you go earlier but let me know if you if you need anything and also just contact me if um if there's anything uh that you would like to discuss thank you


Okay. Good morning, everybody. So i'm glad to see so many people come out to this new JavaScript fact. We kind of put this together at the last Minute based on the new events in the word press world. So i'm actually, i don't actually have anything to do with The word press. I'll talk about myself later. But i do know my javascript. So that's sort of why i'm here. So today we're going to be talking about advanced topics Of javascript exploring the function. So functions are really important in javascript. And so we'll take a look at what that means. Okay. So please feel free to interrupt me, Raise your hand, whatever, for questions. I'm totally, totally, totally, totally okay with Interruptions for questions. This is for you guys to learn.  And at the end of this talk i'm also going to be at the Happiness bar hanging out at least for the next half Hour after my talk.  So please feel free to ask me Questions. It's fine. All right. So today we're going to be talking about the wild world of Functions. And so let's give a little context About what we're doing here before we start. So javascript is a bit nutty. It's a bit crazy. And unfortunately it will remain so forever. Okay, not forever, but maybe for the foreseeable future. Why is that? Because we, like, it has a lot of quirks. It was made in actually like two weeks. And we don't want to Break the web. We want pages from 15 years ago, Their javascript to keep working just like it did 15 years ago Today. So we have a problem. All those crazy things that it does, we're, they're here to Stay. We're not getting rid of them. So instead what we're going to do is to maintain backwards Compatibility, we're going to, a, learn about the things That are bad and stay away from those. And b, the standard is Going to be updating itself constantly. Not with changing the Old things, but with introducing new things that fix the things That the old things do bad. Okay. Anyway, i'm not going to talk about that, but just so you Know, we're not breaking the web. That's why javascript is so weird and wacky because we Just can't fix those things. I have to point this over here. Oops, wrong button. It's my bad. So it's especially crazy and eccentric with functions. Eccentric is a euphemism. Some of you may know that for Insane. Anyway, so, and functions are One of the most important things that javascript has. A lot of in javascript you do with functions. It's really, really important. So it's really weird that it Does so much things with the most important, their most Important object, but we have to learn about them because Well, they're important. So that's what we're going to Try to do. So we're going to try to address some of Those weird things that javascript does. And things especially that throw off new developers when They're learning this stuff. So we're here to help with Those things. So, number one, functions are Values. That's the first topic. In javascript, functions are values. What does that mean? It's odd for a language to have this property. So you might have heard this term. Functions are first class Citizens in javascript. How many people have heard that? Okay. How many people know what that means? Okay. Like a fourth of you. What that means is when you create a function in javascript, It is an object. It is a value. Just like when you create a string, that is a value. Our numbers are values. Our arrays are values. And all those things are values and objects. Just like a function is. That means you can assign it to a Variable. So when you create a function like this, You have a variable automatically created for you. So let's say i have this console log function here. And so i can call it. See, in that first line, They're saying, greeting, open parentheses, close parentheses. I'm calling the function. But i can also print out Greeting itself. By defining a function, Greeting itself is a variable that's created that has the Contents of this object that is a function. That's what that means. Okay. When you define a function in other languages, they're not Objects. They're not values. You can't assign them to a Variable. You can't pass them around. So a similar thing you can do in php, i'm assuming that some Of you are familiar, maybe more familiar with php than With javascript, you can do a similar thing by assigning A function to a variable like this. And so by assigning this function to a variable, you can Call it with its variable name, but the variable itself, if you VAR dump it, it's an object. It's an instance of a class or Something. So you can also do a similar Thing in javascript where you're assigning an anonymous Function, what we call that, to a variable. And that also works just the same as the previous example does. Now, you'll see me in my examples, i'm mostly going to use This style, which is using the function keyword and then the Variable, but ultimately it's the same and result most of the time. There are exceptions, but we're not going to talk about those. So mostly i'll be doing something like this. Okay. All right. So the first thing i want to show you is that the function Is an object and most objects in javascript are immutable. You can set properties to them. So here what i'm doing is Aside from just hello world like i did before, i'm also Keeping track of this amount property of this greeting object. So i'm starting it at zero, over here, starting it at zero. Then every time i call it, i'm calling it twice, i'm Incrementing it by one. And so at the end, i'm going to Console a greeting amount. That's going to give me a result of two. So it keeps track of that property just like it would In a regular object. Okay. And because a function is An object, you can do that. And because it's a mutable object, You can do that. If you assign a number to a Variable like this and try to set a property on that number, you Can't do it because numbers are immutable. You can even assign a Function as one of its properties because it's an object. And we'll circle back to doing this kind of thing later. So this is kind of making a makeshift method. I'm treating this greeting thing like an object, like a class, And then i'm making a new method on it called the spanish version Of hello world, which is or la mundo. So here i am calling it. So greeting itself is a function. I'm calling it. Greeting that spanish is also a function or a method, and i'm Calling it. And that works. That's fine. Doesn't complain about that. With me so far? Great. So practical application of Functions being values, passing functions as arguments to Other functions. So when you pass a function as An argument to another function, the past function is called a Callback. A callback. And basically when you're using A callback you're saying run this function that i'm providing For you when blank, when something happens. Now that something could be when the user clicks a button, That something could be when the page loads, that something Can be in three seconds. The condition under which the Function will be called will change, but the concept is the same. Passing some instructions to you to do when that thing is right. So what does that look like? Well, like i said, one of the Common cases for callbacks is click handlers in jQuery. How many people here are familiar with jQuery? So how many people here, their javascript code is centered Around the use of jQuery? Okay. So most of you. So here what i'm saying is, Okay, well, slug my button and then run this instruction when The user clicks that button. And that's it. So that anonymous function that i'm defining there, that Anonymous function is the callback. So function values you pass into other functions are known as... Oh, i just said that. I went back. Sorry. Let's go forward. Okay. And you can also pass in a function by using its Variable name instead of having an anonymous function. Okay. And again, in this case, i'm naming the function. I'm saying function do stuff. This is my callback function. And then i'm passing it in as an argument, just like you would Pass in a regular variable as an argument. Yes. The question is, if there's an Advantage to doing it this way as anonymous functions, Readability is the only one, the most of the biggest one. There may be other advantages too, but that's the main one. Actually, i'll show you an example with a settimeout Function later, especially with a settimeout. It's really way better to do it this way than the other way. Although i'll be using both in the examples. Good question. What's that? Oh, yeah. You can reuse it as well. If you name the function, you can Use it in multiple places. In this example, i'm only using One, so it doesn't matter. Okay. And just as a reminder, the callback is not click. Click is not the callback. Do stuff is the callback. The callback is the function that you pass. All right. So part three. Function, scope, enclosures. This is another really important thing that's really weird. This especially is really weird that javascript does. And obviously it's centered around functions. So let's talk about this. So local variables in javascript Have a specific scope. Okay. So local variables are those that are created with var. Notice in my examples i've been creating, every time i do a var. Looking for one here. Okay, here. Var greeting equals function whatever. That makes reading a local variable. Okay. Okay. So a variable scope determines what Parts of the code it can be used in. So the scope is about the visibility of the variable. Where it can be seen and where it can be used. So if else statements, another nonfunction blocks do not Constitute a new scope. So for example, in my first Line here, i'm saying var pizza equals pepperoni. By the way, all my examples are pizza related. I apologize if you're hungry. Anyway. So here, my first line is saying, okay, i'm setting pizza Equal to pepperoni, it's a string. Fine. Then i'm saying if true, that makes the if always happen. And i'm saying, okay, var pizza equals mushroom. Even though i said var pizza equals again, it's actually Referring to the same pizza variable. Okay. So inside that if statement and outside the If statement, we're both talking about the same scope. It's the same set of variables here. So pizza there and pizza inside, they're both the same pizza. So when i change pizza in the if, it gets changed outside The if as well. Okay. So i get mushroom here. Mushroom. But javascript has function scope, which means that you Create a new set of variables inside a function. So in this example, i'm starting out the same way. Pizza equals pepperoni. And i'm making a new function called print pizza. And in print pizza, i'm making another instance variable called pizza as well. I'm sending it to mushroom. Inside the function, that pizza is mushroom. Outside the function, pizza is still pepperoni. So print pizza prints out mushroom because in here, pizza is mushroom. But outside console log pizza still remembers, oh, yeah, i have this Variable called pepperoni. So this pizza and that pizza are two In separate bubbles. They're in parallel dimensions. They don't know about each other. They have the same name, but They're different. They're different variables. So when you open up a function, you have a new set of Variables. But there's some caveats. Like everything in javascript, there's some issues here. So the key thing to remember about javascript function scope is Disney pic star. And i find mnemonics are a Really good way to learn tricky concepts. So i don't know how many have heard the mnemonic righty Tidy, righty tidy. When you're twisting a screw, You twist it to the right and it's tightened to the left. So we're going to learn one for javascript. Here we go. Ready? Variables can be seen from the inside out. Disney pic star. Disney pic star. Inside out. You can see variables from the Inside out, which is to say that variables declared outside can Be seen from the inside, but you cannot see variables Declared in the inside from out. You can see inside out. Disney pic star. I say Disney pic star because it's hard to switch. It's easy to switch up inside out and outside in. Inside out. Okay. Good. So what does that mean? That means that i can see inside out. So inside this new print pizza, i can see that the value of this Pizza variable is hawain. This variable, i can still see it Because from the inside of print pizza, i know the stuff that's Outside it too. So print pizza still results in The right value, the value you'd expect. On the other hand, if i have another function called print Large pizza, and then here i'm defining a new variable called Large pizza, and that's a large four cheese pizza. So inside, that works. So over here, when i'm calling Large pizza, that works just fine. But outside, i try to use Large pizza and i get a reference error. My javascript blows up. Because i cannot see outside In. I can see inside out. So that large pizza, that is a local variable inside of Large pizza and inside of print large pizza only. Outside, that thing does not exist. And you will get an error like this one. Yes. So the question is, and this... It doesn't destroy. So the question is, if i go back a Couple of steps, over here. So i've declared here a pizza Variable inside print pizza. And does that override? Does that destroy it? Well, with javascript, it doesn't destroy it. Just for this scope, i can no longer access the previous pizza. I only have this new pizza. So what it does is that it has Basically an order in which it looks up names. If you name something, if you try to use something called pizza, It's going to look in things in order. It's going to say, okay, first, let me look at this current Function scope. It's going to look for inside print pizza. Do i have something called pizza? Okay. If it doesn't, it's going to look at the next scope above that. Do i have something here? It's going to keep doing that because You can have functions inside of functions inside of functions Inside of functions, but it's going to stop when it gets to What we call the global scope. And if the thing doesn't exist In the global scope, you'll get a reference error. But it does not override it. It's just that in this scope, My local variable pizza takes precedence over the one in the Outside scope. And once you define inside, You can't get the outside anymore, and there's a really Weird thing that happens exactly because of that. I don't have the example here, but ask me later and Okay. Okay. So the key thing to Remember here is this var part. It's because of this var. Because i'm making this a local variable inside print large pizza. That's what makes it local to the function. If i don't have var, i'm going to get a global variable. That is accessible everywhere. That is not a good thing. We're not going to get into why, but it's not a good thing.  That's our goal here. Okay. So practical application of this Scoping thing, you can actually use that to your Advantage. If you define a, if all your Application is inside a function, other scripts cannot Access it. Access any of your variables. They're protected. They're protected from any Outside tampering.  You're adding all these other Scripts. Because if you have all your Stuff inside a function, then all your stuff is protected. They can't accidentally change the value of a variable or Rename a function or anything like that. They can't mess with your stuff. Everything is protected. So this looks weird, but you'll see this a lot. How does this work? Well, i've got an anonymous function Here, and what are these? What are these? Okay. Well, this is called an iffy. It stands for immediately invoke in function expression. And so even though i don't have a name up here, i can add These parentheses around the function definition but also After, and what that does is it invokes the function Immediately. It defines a function on the Fly and calls it immediately even though i don't have a Name. Now, if i don't put these parentheses Outside the function definition, around the function definition, I'm going to get an error. And these two parentheses are Actually just to run it because since functions are values, If you put the name of a function without the parentheses, it Just says, oh, yeah, that's a variable and doesn't try to Run it. So i need these two parentheses To run the function to invoke the function and then i'm Going to get an error unless i put these around the function. So this is a way, you'll see this all the time. This is a way to basically put all your stuff inside a function That's protected against other people, other scripts. There's a link up here to an in-depth article about iffys. It's like five years old, but anyway, it's still good. I promise it's still good. Iffy. You'll see that a lot. That's why i teach you. So scoping can also be used to make variables private. There's no way to make a variable attached to an object private By default. So if i go all the way back to that Example where i was doing, i was counting. I had pizza dot amount or greeting dot amount and i was Counting the amount of times i was running, greeting. Well, there's nothing preventing you from actually resetting That to zero or somebody else resetting that to zero. So to make these variables truly private, you have to Take advantage of scoping. So let's see. I don't have an example of the price. So remember that this works inside out. So for example, if i had this function, do pizza stuff. And i'm setting a local variable pizza called onion and garlic For onion and garlic pizza. And then inside that do Pizza stuff, i have a print pizza function. And i call that pizza function. This still works because of inside out. Inside the print pizza function, i have access to the var pizza Of do pizza stuff. That's fine. This works as an inside out. So when i call do pizza stuff, It sets this variable, it defines what print pizza is, and it Calls print pizza as well. Okay. But typically, what you do is, Well, this works because you can, this is called a closure. So when you have a function that makes use of a variable That's not in its scope, that is called a closure. So in this example, my print pizza function over here is a closure. Because it uses pizza. It uses a variable that's not in its scope. So now this is a really contrived example because you're Just calling this function that's making this function. It's calling this function. But okay. Let's see how you really use this. Typically what you do is you return the closure. Which is to say that if i call my function create pizza Printer and i send it a variable, i send it a value. And then i return this function called print pizza over here. So let's look at what this does. I'm saying, okay, var Onion printer equals create pizza printer. Create pizza printer receives this kind of, the type of pizza. And then it returns, they find this function print pizza. That says, hey, i'm just going to print that thing out. And then you're returning this variable. So onion printer is now print pizza. But it has, it's bound to the value of onion and garlic. So if i call onion printer, it's always going to print out Onion and garlic. I know. I know. It's complicated. It's complicated. So this is a way of basically making this function onion printer That always prints out onion and garlic and no one can tamper With that pizza value. No one can tamper with it. It's still there. Like, pizza remembers that pizza Is onion and garlic. It remembers that. But no one can go in and mess with it. No one can change the value of pizza. So you will see this a lot. You will see this a lot. You'll have a function that returns a function. And basically it's just creating a function with a certain set of fixed values. So just to recap, create pizza printer is receiving this pizza the string. It's creating a new function called print pizza. And it just prints that string, and then it's returning the new function. So onion printer is now print pizza, but except that this Variable pizza is always going to be onion and garlic. So, yes. Yes. Nothing changes. So notice that onion printer is analogous to print pizza. What are the arguments of print pizza? So the question was what happens if i pass in an argument to onion printer? Well, print pizza doesn't have any arguments. Create pizza printer has arguments. And that's only being called one time. And even if you call create pizza printer again with a new string, That will not affect onion printer. Because every time you call create pizza printer, This is actually creating a new print pizza function for that one call. So if i do this, if i say i have onion printer this, and then Pepperoni printer with a different kind of pizza, print onion printer remembers that I'm supposed to print onion, pepperoni printer remembers it's supposed to print pepperoni. So what you send to onion printer does not matter. Because print pizza doesn't receive any arguments. Oh, yeah. Of course you can read, declare the variable and change it. Yes, that works. No problem. If you pass into a variable into onion printer. So what happens if you pass into a variable with onion printer? Well, it just ignores it. It just ignores it. So there's no argument errors. So some languages, if you don't pass in the right amount of arguments, You'll get an error. JavaScript does not care about that. You can pass in 57 arguments into onion printer, and it won't Complain, but it won't make use of any of them. Because this function is not defined to use any arguments. So it just ignores them. So practical application of this function, again, making variables private. So if i have a create counter here, this is a much better Version of what i was trying to do before. I have a function create counter that it sets up a variable count. And then it returns a function in anonymous closure that makes use of count. So create counter is set to my counter. What does that do? It sets count to zero and returns the function that adds One to count and then returns that new count. So every time i call my counter, i'm going to get incremented by one. But nobody can touch my count variable. Even if i create 50 counters, each of those individual counters Will have its own count variable. Everybody will have their own stuff. Everybody is protected. There's no way that i know of to mess with the count, except by calling the function, the my counter function. So if you have your counter, i have my counter, and somebody else has their third counter. Everybody has their own count. Nobody can affect each other's count. And nobody can reset or touch each other's count. Everybody has their own count, and the function is the only one who is able to access that count. So basically what i'm doing is i'm making var count private. Every time i do create counter, i'm making a function, and i'm making a new count variable. And that thing is roped off. Nobody can touch that. And you can also use this to make properties and methods on an object private. Although i'm not showing an example of that, but that's something that has happened. That's called the module pattern. You'll see that a lot. Module pattern. All right. Scope. Wow. That was tough. Okay. So aside from function scope, there's also a thing called function context. So function context and this. Let's talk about that. So functions also have a context in addition to a scope. And the context is basically an object that owns the call to the function. That owns the call to the function. Okay. Let's see that in action. So every function's context in that particular call Is represented by this magical keyword called this. Every time you call a function, this is going to have a value. And you don't have to define that. That just happens automatically. It's magic. Okay. It's magic. So here i have another pizza function. Here my pizza is fancy arugula because some pizzerias try to get fancy And they just throw arugula on the pizza. And so i'm printing out the pizza and also printing out this. Okay. Which is the magically defined keyword. So let's see what that does. So this is magical because it changes Depending on how the function is invoked. Depending on how you call or execute the function. So it can have potentially different, it can potentially have Different and unexpected values and we'll see why. And boy, this is the source of so many problems. Especially when you're starting out. Everybody, like literally everybody gets hit by some sort of this Context problem. Like this will happen. Okay. Even if you know about it, it will happen. So the manner of execution of the function determines the rules For the context. The rules for this. We're going to see a couple different examples. Not all of them because one of them is really weird. So imagine that. The ones we're seeing are weird. The two ones we're seeing are weird. And there's a third one that's even weirder. That we're not going to see. Anyway. Okay. So if i have a regular function. Regular function just like the one i had before. Oops. Spoiler. Regular function. Just like the one that before. What's that going to do? It's going to print fancy arugula because pizza is fancy Arugula and it's also going to print an object called window. So when you define a regular function and call it just like You always do. That thing, in this particular case, This is going to be window. What does that mean? When you call a function like this with just the name of the Function in argument, nobody owns that function. That particular call of the function is like a ronin. It's like he doesn't have a master. And so window is the global object. What is window? All global variables and functions are Properties of window. It's the global object. Every javascript environment has a global object. I'm using here. I'm assuming that most of you are going to Be running javascript on the browser. And in the browser, the global object is window. So everything is on window. Everything. This is just a small sample of all the things that are on Window. The array class. The number class. The object class. The regular expression class. The console. The where we use console log. The document where you do Document on ready and all that stuff. Set timeout which you're going to see later. Everything, everything, everything, everything, everything That ever was in javascript is on window. So when you call a function like you normally do, this is Going to be window. The context is window. It doesn't really have an owner. So the default owner is the global object which is window. With me so far. The other main way to call function is As a method of an object like we already saw. So let's make a simple pizza object and call a method on. So let's get this simple pizza object. It's got two properties. Toppings and cheese. I don't know why you want to change the cheese of a pizza, But bear with me. Toppings and cheese. So toppings here are fancy. It's fancy arugula like it was Before. Like those fancy pizzarias trying to be fancy. And then cheese is mozzarella because it's mozzarella, guys. Come on. Why do you want to change that? So because i have this object called pizza, i can do pizza Dot toppings that will get me fancy arugula. Because i have this object and it has a property cheese, i can Say dot cheese and it gives me mozzarella. With me so far. So let's add a print method to that. So we're just saying pizza dot print and we're modifying this Object in real and memory and saying let's add a function to This. Let's add a method to this. It's called print. So it's going to do this. It's going to say console log. So i'm shortening the pizza To one line because it looks better on the slides. So let's see. Pizza dot print. What we're doing is console logging, this dot toppings, this Dot cheese and a bunch of strings. When you call a method, this is no longer the window because It has an owner. Print has an owner. The owner is pizza. So inside that method, whenever You call this, this is going to be pizza. So this dot toppings is really pizza dot toppings. This dot cheese is really pizza dot cheese. So you get this message, fancy arugula and mozzarella pizza. So this is like a self-referential thing. And php works the same way. You have this and a stabby Arrow and the name of the variable. Same thing. So here's where it gets Complicated. Apologizing in advance. Here it comes. Here it comes. If you assign that method to a variable like this, VAR print pizza equals pizza dot print because pizza dot print, Because it's a function in javascript, it's an object. You can assign it to a different variable.  It is, it went rogue. It goes rogue on you. And this inside this function now is window dot toppings and Window dot cheese. And if you don't happen to buy Some weird accident, have a dot cheese and toppings variable That are global, you'll get undefined and undefined pizza. And i think we can all agree that nobody wants an undefined pizza. We want to know what's on there. We want to know what's on there. That's the only joke i have today, i'm sorry. So, so you can do this. This is crazy, but you can do this. You can say, okay, i'm going to take this method. It's an object, i'm just going to assign it and then call it And then boom, your this is, your this is all Borked. Your this is all screwed. So what do you do? What do you do? Oh, you want to take a picture? Okay, you're good. Anyway. Cool, right here. So one thing you can do. One thing you can do. Not saying this is the thing That you should do, but it's a thing you can do. After you assign that pizza, instead of calling it like you Normally call it, you use this method that all functions have. It's called dot call. What dot call does, it allows you To set the context of any function explicitly. You're saying, okay, call pizza, but make sure that this is pizza. That's what that's doing. So if you do that, this and this Inside of that function, they're going to work like you would Expect them to. We're getting to that. I'm guiding you. You have to trust me. If you don't do this, what do you do? Well, before we get to what you actually do. The problem with this is that you have to do dot call every time You want to call the thing, and that's not practical. That's not practical. You have to do dot call, dot call, Dot call. It's very, very wordy. And just as an fyi, wait, no. Okay, but the advantage of this, the advantage of this of Doing dot call is that you can actually change the context Of the function on the fly, which is pretty cool. For example, if i have a second pizza object where the Toppings is bison. And the cheese is cheddar. I don't know why you want to do that. I'm sorry. I don't know what mozzarella. Anyway, so i can do the same. So this is still pizza dot print, which is this function. And i can say dot call pizza, and that will do what it did Before, but i can also say dot call other pizza, and it Just changes dynamically. That's pretty cool. That's pretty cool. That's pretty cool. So as an fyi, you can also do a similar thing with dot Apply. Dot apply is similar to call in this Way and in this way only. There is another really, really Cool and subtle difference between dot apply and dot call, Which we're not going to get into, but if you're curious About that, ask me later. I just want to be thorough. Okay, so again, you have to do it call by call. It's not practical, so you have to do this every time. But another alternative is to use bind. So bind is another method on function. Every function has this bind method. And what this does is it fixes the context. It fixes the value of this for this function. So when i'm assigning my function, if i do pizza dot Print dot bind and then say, okay, bind this to pizza, Print pizza is now going to be bound to pizza all the time. The pizza object is now married to print pizza. Like you would expect it to. And so now every time you call Print pizza, you don't have to do any fancy tricks. It just works. It just works the way you want it to. It just works. Okay. So what this is really doing is it's creating a new function. It's creating a new function with the this fixed. So i'm here, as an example, i'm just saying, okay, print pizza, Is it equal to pizza dot print? are they the same object? No, they're not. Print pizza, because i did bind, That automatically created a new function and returned it. So they're no longer the same function. They do the same thing. The difference is that pizza dot print, that guy has no Loyalty. He can change the this anytime. Print pizza, that guy has loyalty. He's bound to this pizza Object right here. And furthermore, you cannot change The context of that function anymore. That new function that bind creates, that thing is set. It's baked in. You cannot change it. So even if i do that new bound function, if i try to do Dot call and try to change to this and try to be clever, Won't work. Won't work. It's immune to any changes in context because of dot bind. And that's also pretty cool. So practical applications of this stuff. Practical applications of this in context, the problem, the Real problem is that in a callback, this is always going to Be window. Why? Why do they do that? so, for example, set timeout. So here's an example of this. If i did this with anonymous Function, it would look really weird. That's why. Because set timeout takes this Other argument that makes it look really weird. So name functions, i'm saying pizza dot print, set timeout. But wait three seconds because it's supposed to do milliseconds. And then it says, okay, after three seconds it says undefined Undefined because pizza dot print, the context is not Properly set. So some pseudo code for set timeout. Basically what it does is it receives that function as this Variable callback. So it's basically assigning it to a Customer. So it does other stuff and then Eventually it does this callback and calls it. That's why, because i'm calling it with no object, with no Owner, that's why this is window and i get the problems again. Damn. So how do i fix that? How do i work around callbacks in context? a couple of Different things you can take away here. Number one, bind. Like we saw. If you create a new function with bind and you bind it to That pizza, nobody can change the context. So when you pass it to the function that receives a callback, Boom. It's bound. No problem. It's always going to work. I can know for sure that this is Going to work. This, unfortunately, though, is a Bit slow. So if you have to do millions and Millions of binds, your browser is going to be like this. Okay. So not a concern at first. Okay. Wait for this to happen. But just so you know, it could be a problem if you get Millions and millions of users. Okay. How am i doing on time? five minutes. Okay. All righty. Three minutes. Okay. Well, i'm about to wrap up. All right. So bind is one technique that you can do to Prevent the callbacks from transforming your method into Like a non-method function. The other thing you can do is Use a closure. If you make a closure, if you Make a function called print pizza, it remembers that pizza Is this thing. And then if you pass that under, Then that will work. Okay. And so essentially you're Doing basically the same thing as bind. You're making a function, a new function that's bound to Pizza. But you can do it manually, Sometimes, you know, maybe because arguably this is more Readable. Arguably it's easier to Understand, but it's more lines of code. So trade-offs. But this does the right thing. You'll get fancy, regular and mozzarella pizza. Okay. All right. That's it. That's all for the terms of the Learning. We did it. Good job. Good job. Okay. So i do have an exercise In store for you, but i'll put that in the resources. Basically, in this link, you'll find all my resources. They're not there yet. Right now there's only a few Links and the links to my slides. You'll have that.  And also some more in-depth resources that specific Articles and blogs about all this different stuff that You can, you know, read on your own pace. So bit.ly-exploring-js-functions. And that's going to link you to the github markdown file. All the links are going to be there. So, for example, you'll have things such as a link to note School. Note school is a really good Resource to learn a bunch of different javascript Subjects, not just node js subjects, javascript Subjects. Those are interactive Tutorials in your terminal. They'll give you an Exercise. They'll give you some stuff to Consume, some things to learn about, and then you'll have to Kind of write the code that makes it what they're asking for Work. This is a really good thing. A really good resource. And so they cover things like Functions. They cover things like the Basis of javascript. They cover things like there's Even one about git. There's a lot of different ones. I think there's graphics programming. There's new ones coming out all the time. So note school is a really good resource for learning. There's more javascript in depth. Also, as always, mozilla Developer network has a lot of in-depth articles about things Like context and scope and all that stuff. Some of these examples i took from mdn. I just renamed them to pizza themed examples and made it Work. So mdn, they have a specific Javascript section with a bunch of really cool stuff. So definitely check that out. And third major resource i Can recommend is effective javascript. It's a book that came out, i think, in 2014. Really good book. It's written by a guy named Dave herman. He works for mozilla. He works on the javascript standard and really good in-depth Article about every nuance that you could possibly be Interested in in javascript. And spoiler alert, Before wordpress, i have purchased ten books. Ten copies of these. And we're going to be doing Something with them. I don't know if we're going To raffle them or what, but ten people are coming away With a copy of this book. And anyway, i've been in azar. You can follow me pretty Much anywhere at my last name and twitter, et cetera, et cetera, Et cetera, et cetera, et cetera. I'm there and everywhere. And so what i do is i work for ironhack. You can see my shirt here. I'm the lead instructor there. We are coding boot camp here in miami and also in Madrid and barcelona that we teach people web development. So a lot of this stuff is stuff i had to teach beginners. You guys know javascript at least already. Imagine if you didn't know anything and you had to learn this. So these guys, every two months, i have to do this. Luckily they can ask me questions there. So these are the students i'm teaching right now. They're a really awesome group. So they're actually going to Work on their projects for the next two weeks. And the reason i tell you this is because we're looking for Mentors to help our students along their journey. To understand things like i tried to teach you today And hopefully i was successful with at least some of you. And so if you're interested in helping out, being a mentor is A four-hour commitment across two weeks. Obviously you have to be local. I know that all of you are. But if you're interested in doing that, you want to pay it Forward, talk to me and apply to be a mentor. And hopefully a lot of you will want to do that. So that's all i got. Thank you so much for your Patience and for bearing with me and learning scope. And again, that link to any further research, i will be Posting exercises on there for you guys to do. At least two exercises. Thank you.