Hello, everyone, and welcome to learnings from sustainability steering sustainability. I can't say it, so I'm just gonna say sustainability steering at the Kubernetes project. My name is Bob Killen. I am known as Mr. Bobby Tables across all the things. I am a program manager for Google's open source programs office, and I'm a member of the Kubernetes Steering Committee. Hey, everyone, I am Navarune. I work as a staff engineer at VMware, and I am also one of the members of the Steering Committee, and also chair of the Kubernetes Contributor Experience. To start with, I want to welcome our new members who recently joined us, Machie, Paco, and Patrick, who have a term until the end of September 295, and they will be joining us. Stephen got re-elected for another term, and they will be joining us again, like Ben, myself, and Bob, and we have a few people here in the audience as well. Ben. Yeah, Machie, and with that, we want to thank our previous steering committee members, Kristoff, who is in the audience, Tim and Carlos, and with that, this is the first time in the history of the steering committee that we have more members from outside North America than inside North America. That's the first time we've had representation from China as well. Yes. And with that comes a unique set of challenges. Since we are spread over so many time zones, we can't have a very good meeting time to talk about, and then we have to do a lot of our stuff async, but this is a very good problem to have, and we are very delighted to solve this problem. Try and move more async. You might already know, the Kubernetes org is really big. We have 83,000 plus contributors, 1800 plus org members, which contribute to 354 repositories combining all of the Kubernetes orgs, and we have 34 community groups. We'll talk more about what we have been doing about the community groups, their life cycle shutting some groups down because they have ended their lifespan or spinning up new groups in a later section. With that. Okay. So, to begin this, what does steering do? Well, the formal definition, and if you don't mind, I am actually just going to read it. The Kubernetes steering committee is the governing body of the Kubernetes project, providing decision-making and oversight pertaining to the Kubernetes project by-laws, sub-organizations, and financial planning. The steering committee also defines the project values and structure. It's honestly a pretty good TLDR. That was weird. What we actually really do is, review charters from our sub-projects, we look at their scopes, their responsibilities. Overall, we sort of define and evolve a non-technical vision for the project. We need to sort of evolve with the state of the project. Kubernetes is just about 10 years old, and what it does today is very different from 10 years ago. We need to determine the types of groups, roles, and structure that are most appropriate for us at this point in time and will help us have a sustainable future. We also are the primary group that interacts with the CNCF, so if there is a financial request or if there is some need to interact with them for one reason or another, that we are the body that does it. But really, what does steering really do? Well, really, we plan for the long-term sustainability of Kubernetes. A lot of the things that we actually do might not have an impact until we are done with our term, but our goal is to just make sure that the project itself can outlast us and outlast our terms. And the way steering does this is through governance and policy, that the changes that we make, again, are slow, might not be effective for a while, but we also spend a lot of time on these things. And steering tends to move pretty slow, but that is intentional. We are trying to put a lot of thought into what we do and their impact. Now, we actually have a few recent changes that we'll go over, and these kind of went into effect over the past year. Some changes to subproject leads and our chair and TL split, as well as revisiting some of our groups. So, to you first, before we dive into it, this is what is known as our contributor ladder. We have this as sort of a path of growth for people to enter the project and go from contributor to org member, and then we have a reviewer approver and subproject owner. A reviewer is someone that is added to an owner's file and it's sort of the first, wrong on the ladder, where they are tagged in first to do first line review of PRs and things of that nature. As they become more familiar with the code base and more trusted, they will then go to approver, where they are then allowed to merge code in their specific area, and then they move up to subproject owner, where they are sort of a root approver for that area. And this is what we had before. So, I'm going to talk about something, a change that we did really recently. So, what time we realized that we need one more level as a stepping stone into becoming, or coming into the contributor ladder or the leadership ladder. So, Bob mentioned the ladder in which people grow from becoming a non-cubinities org member to a subproject owner. But what do we really mean in that process, right? So, we sat and we thought about like, how do we make that role really formal? So, we did have subproject owner for a long time, but what we wanted to do was make it a formal part of our contributor ladder. So, we introduced a role called subproject lead. The key difference being, the subproject lead has more responsibilities compared to just being a subproject owner. So, subproject owners are essentially owners of code, but then subproject leads are also expected to have some technical direction for the area that they are lead-off. And you can think of like, it to be a more bubble-down version of a technical lead. A technical lead is, a SIG technical lead is supposed to handle like multiple areas or all areas of the SIG that they are a technical lead-off. And a subproject lead is only needed to supervise areas in the area that they are in their subproject essentially. So, there are a lot of differences between like a technical lead and a subproject lead, but these are like, it is designed to be a funnel to eventually become a technical lead inside a SIG. And this also gives the opportunity for the SIG chairs and technical leads to essentially grow contributors through a well-defined funnel. So, if someone is a SIG technical lead, they can essentially identify people who can be future technical leads through the subproject leads of the subprojects inside that SIG. And this gives a really good structured way for people to grow. For the most part, it's honestly just recognizing a lot of the people that are already doing the work. We have people that have been standouts in these roles for a while, now we are just giving them a title. The other thing that sort of complements this is the chair and TL split. So, before we've had like two top-level roles of a chair, which is usually the one that does like, I don't wanna say like all the administrative work, but they're the ones that organize the SIG, the group, and make sure everything is functioning as they should, making sure all the like, they're handling all the transparency requirements. The SIG is in good health, looking out for the various areas that might need to grow future people. And the tech lead role was specifically focused on sort of the stewardship of the code or the area that it owns. And before the tech lead role would roll up to the chair if no tech lead was explicitly defined. And this actually caused a lot of confusion because you had some people that were chairs that were also TLs and other places where they were chairs with separate TLs. And there was a lot of both confusion from people that needed to seek certain approvals as well as like when it comes to growing someone into a future role with them being conflated. It was really hard to sort of find people that could satisfy all of the above where it's a lot easier to find people that could do just one of the two roles. I should have pressed this slide or pressed this earlier. That was my mistake. This essentially just summarizes what I was saying. The other big thing to go sort of along with this out of revisiting our roles and how things sort of split the, we've also been like revisiting our groups and our requirements for our groups. Governance should change with the project and to like best achieve the project's goals at that point in time. And the current state of both Kubernetes and sort of the cloud native landscape as a whole is quite a bit different from when our governance is first drafted. And a large portion of our governance is like how we divide and essentially self-manage ourselves and we do that through management of groups. So we've been looking at a lot of our groups and looking at does this group continue to serve the goals of the project? Is it active? Is it, does it have enough people interested in it to sustain it in the future? Are there any reasonable changes that can be made to it to help it succeed or should we spin it down? And with the current state of things we just kind of need to like marry conduit and if it doesn't spark joy, eat it out of the org. This led us to recently retire our user groups. Years ago there were SIGs for like the big cloud providers, Google, Amazon, VMware, et cetera, et cetera. And it was determined that it really didn't make sense for them to continue as independent SIGs and there wasn't really like a long enough like long-term work to justify them as those independent groups. And it just like didn't really align to have like again the provider-specific groups in there. So those wound up being moved under like one Umbrella SIG cloud provider but there's still like a gap in there where users of those cloud providers could previously engage and provide feedback that would then be used by the groups and that sort of bore our idea of creating a user group back in the day. Unfortunately those groups were never really taken up on like there was one group, like a VMware user group, there's also a big data user group but they never really took off and didn't really help the project overall. They did have their own little communities and things but they weren't helpful to the project as a whole. And there's other things where like these days there were better alignment with them interacting at the CNCF level than the Kubernetes project level. So for us, it just made sense for us to spin them down. We did this largely like it just removed extra overhead and streamlined our own governance to honestly just help us manage things at this current point in time. So it also wasn't just user groups that we retired. In the past year, we've retired several SIGs and working groups. SIG usability was created with the intent to improve the overall user experience and accessibility of Kubernetes. But like it honestly wound up being fairly difficult to attract people to do that kind of work. It just frankly it wasn't incentivized by a lot of people who was really carried by a few people that were really passionate about it but it was hard to get them support. And in the end, it just made the most sense to spin it down. Another was SIG service catalog. Again, there's a few very passionate people in it but like the latest release hadn't been updated in several years. And again, it just kind of made sense for us to spin it down. Others, the multi-tenancy working group had a very similar story. One actual highlight is the reliability working group. While that spun down, it did actually succeed at its mission. We introduced, like its goal was to increase the reliability bar of Kubernetes so we could have more reliable release practices. And we wound up introducing a process called the production readiness review as part of our release process and it's now just baked into every release. Everything is looked at and evaluated to make sure that every feature is evaluated for its ability to, you know, is it implementing the right amount of observability? Is there a feature flags that makes it easy for it to roll back if needed? And that process, you know, once the reliability working group had succeeded at its mission and it was spun down. Then the last one, the IoT Edge working group is a case where another sort of successful one, you know, it didn't make a lot of sense for it to exist at the Kubernetes level, but it made sense for it to exist at the CNCF level because it was interacting with a lot of the IoT Edge projects. So we've been working on transferring it from Kubernetes to the CNCF just to, you know, give everything the best fit and best chance to succeed overall. But that, we spin down groups, but doesn't mean that we don't accept new groups. So in the past one year, or the past six months, actually. Raise the microphone a little bit. In the past six months, we had two new groups. We have HCD now and working group LTS, working towards their mission. They aren't really new per se, but have some backstory behind their recent additions back to the project. Coming to HCD, so we have to realize like what's the backstory behind it. So here you can see like one issue created by DIMMS in, if I remember this is the TOC group. The TOC have a report talking about the health of the HCD project. Now it's really good that projects are, projects raise flags when they feel like the traction is low or they need more maintainers or more contributors to even sustain their growth. And it's more so important for projects like HCD which serve as the storage backbone of Kubernetes. Without HCD, Kubernetes will not exist at this point. We might need to like invest in or find a new storage engine for our APIs, for our API objects. And it's very fair that sometimes due to such issues, projects can go into a crisis mode and people are already burnt out because of that. So what happened after that was, HCD was actually proposed as a Kubernetes SIG to help HCD gain more traction and HCD get the resources that we have in the Kubernetes community and align more. It made more sense because the goals of HCD or why HCD exists is very closely tied to Kubernetes's resource model and how Kubernetes talks to its storage back end. And with that, it was put into vote and we had unanimous approval to accept HCD into the Kubernetes project. And we did add HCD back into the project, talking about LTS. So what is the backstory behind LTS? So way back in 2017 or 2018, if I remember correctly, LTS was something that was thought of and a working group started back then with the goal of identifying how do you support Kubernetes for a longer duration. In 2020-ish, we spun down the group by achieving certain things, specifically increasing the support of Kubernetes from nine months to one year, like aligning with the business life cycles of the vendors. But then during KubeCon EU this year, discussions about supporting Kubernetes for a long term again began picking up traction. And more so because vendors started doing it on their own in that timeframe and it made a lot of sense for everyone to align efforts and align with the community goals on how LTS should be done. An unconference at the Kubernetes contributor summit during Amsterdam resulted in WGLTS to be reformed and here we see an issue from Jeremy to essentially describe the conclusions which were achieved at the end of that unconference and proposing LTS to be back as a working group. That's all on the new groups front. There are a few more activities that we do in the Staining Committee. One of those is, okay, sorry. Sorry for the snafu. One of the activities that we do is conducting the Code of Conduct Committee elections in the Kubernetes project. This year, we did change the process a little bit. Instead of doing a private voting using SIVs, we started using Electo, which is our in-house voting project that also conducts the Kubernetes Staining Committee elections to run the Code of Conduct Committee elections as well. We had like 11 amazing candidates for the two open slots in the Code of Conduct Committee. What, after the elections, what we decided was we should probably improve the process a little more. So right now the process is like the candidates who want to run for the Code of Conduct Committee, they submit their candidacy using a Google form and then we go ahead and populate the election mechanism. But what we want to do for next year is actually have the candidates nominate themselves directly on the GitHub repo and then the election app will take their candidacy up automatically. The other thing that we want to change is we also want to change the dates of the Code of Conduct Committee elections to closely align with the Staining Committee elections. What is it, though? It's the opposite. They're too close right now. Okay, so right now the big issue is the Code of Conduct Committee elections and Staining Committee elections essentially butt up to each other and that has honestly been rather difficult to manage just from like an administrative side plus what winds up happening is if a person that's running for the Code of Conduct Committee is potentially interested in running the Staining Committee, they have to basically decline that role and then run again for steering. What we would like to do is actually move, change the duration and change the date which the Code of Conduct Collections occur to after the Staining Committee elections which currently happen in like September, October and move them to say like January just so that there isn't such heavy overlap and that also gives an opportunity for any former steering members to run for the Code of Conduct Committee elections. So the next big thing that we are actively working on is looking at annual reports. One of the previous governance changes made by the Staining Committee was actually meant to like reduce the amount of public check-ins. We previously required our groups to check-in like once a quarter and this was bumping it and also doing it like live on camera with like a deck and this bumped it down to just checking in once a year with filling out a document with some information about the status of their group. You know, this was, ideally this is seen as like less work overall because you'd only be doing it once a year instead of once a quarter. You know, it would serve as a good way for steering to check-in with the group still and sort of get a pulse of the group's overall health. But like outside, the other thing that we wanted to do with them outside of checking on their health is also gave us a better way to surface the achievements and risks of that group to a larger audience with it being an actual document instead of something that is essentially in a recorded community meeting call. Now, as someone not working in a project every day, how you learn about those sort of, you know, recent changes in things that are struggling to keep help or keep up with, again, has been very difficult. We, after these annual reports were completed, we surfaced these up to the CNCF and a larger roll-up report was then served on the CNCF report site and was advertised by them. Now, you might think that all makes sense and that it's like less work overall, but the reality has actually been something quite different. We have had a lot of issues with people working on the annual reports. So first, this year's results, I know that numbers don't quite line up with what we said earlier in terms of our toll groups, but the annual report process doesn't exactly align with calendar years right now, so things are a little bit a tad off. The other thing you might notice right off the bat is only two-thirds of the groups actually completed and had a merged report. You know, that isn't great, and especially for something that's supposed to be easier. Now, especially, let's see. So, sorry, I don't wanna like dig into the specifics of this quite yet, but we'll look at a few things. So there are a few things I wanna highlight from this year's report and the previous year's report. And from what you're seeing here, it's a lot of red and yellow and that doesn't paint a great picture, but there's a lot of progress from red to yellow, so that is a nice iterative growth. So in 2021, there was a lot of areas that were not doing well, and they needed more reviewers, more approvers, just more people in the pipeline. So in 2022, we started to do several mentor cohorts to try and help bring people up into targeted areas. And frankly, we did have mixed results. Some worked out quite well, others, not so much, but we did learn a lot and have continued to make improvements. Our most recent mentor cohort has been wildly successful. Let's see. So similar on the next thing in 2021, still at this point, we're still mid-pandemic. There was a lot of burnout amongst our maintainer community. A lot of maintainers had less time and less good headspace to work on things, but things did seem to improve in 2022 from general conversations with them. And the reports from what the leads gave us.  So from the data that we have, things are looking a little bit better. This last thing I want to highlight is up until last year, the Kubernetes infrastructure costs have only really been fronted by Google. And so that's about nine years of supporting everything in the project. And we're talking multiple millions of dollars per year. And in 2021, things were starting to get bad. We came close to actually running out of funds. And at the rate that we were growing, we would definitely run out by the end of 2022. So Steering worked with the CNCF to help establish the cloud credits program and start to try and bring on more vendors to help support our infrastructure costs. This did succeed like long-term. We did get more vendors interested, but at the rate of growth that we were having and we weren't able to get vendors on board fast enough, we actually came close to a point of having to decide, do we turn off CI or do we stop serving images and break all our users? Thankfully, we did get an extension and were able to get enough coverage to get us through 2022. And you might remember at this time last year, AWS announced that they were going to start participating in the program. So things are now looking good. Now the costs are split between Google and Amazon for our CI and image hosting. Fastly has actually gotten involved and given us 50 petabytes of traffic a month of their CDN services for serving our binaries. Susie has also donated their resources for their open-build service, also letting us use them. And in 2024, it's looking likely that more vendors will be coming on board. So things are looking good now. There is some green, I swear. Let's see.  We are trying to find ways to surface this information better and earlier to avoid us coming to a point where, again, we're having to potentially make the call of, say, shutting down CI or stopping to serve images and just breaking a bunch of people. So, but yeah, things are looking good. So with all the insights that Bob has talked about, you have seen a common pattern that we derive a lot of insights from how our community is working and shaping up through the annual reports. And the survey, really great way to know what the six are up to. But the problem is, the annual report process has not been very great, and several sigleads have bubbled this up to us that some of the points in the annual report that they have to mention are kind of repetitive, can kind of be automated, and hence it results in a lot of toil for them, but the returns are less on that end. So we know that the reports are very useful, and both the leads and contributors have used them to justify what they work on in the community to their employers just because of these reports. So we want them to continue. But the thing is, we want the reports to be having as less overhead on our community leaders as much as possible. So the question is, what are the meaningful parts that we should keep in the reports, and what are the things that don't serve much value? And those are the parts that we should take out of the reports, and the parts that are generated or can be generated from metrics that are already there in the community, they should probably be generated and not be gathered by the community leads and put into the reports. So we want is, we want to know what works for you. We want to know from the audience and from our community leaders on what has been working for them in the annual reports and what hasn't been working for them. So that we as steering committee can change or improve the process for the next cycles. And you saw that we got only two-thirds or 70% involvement from the SIGs in terms of filling the annual reports. We really want all the SIGs to fill in the annual reports because that serves a real great value. And one value I personally think is very important is that getting the annual reports and showing them to your managers or your company's leadership lets them invest in you so that you can come to the community and work in the community and grow the community. If you have thoughts, please reach out to steering. And with that, we are kind of, at the end of the agenda, we'll come to Q&A. We actually are pretty close on time. I'm kind of surprised. Oh, wow. But before we move on to Q&A, we just wanted to let you know how do you reach us. We are in the public Slack channel called Steering Committee on the Kubernetes Slack. You can join the Kubernetes Slack by going to slack.caters.io and get an invite for yourself. It doesn't take much. Or you can join our mailing list, steering at dritkubanities.io. If you go to groups.google.com slash g slash steering, I think you can join the mailing list. But then if you just go to the GitHub repo, kubanitieslash community, you will find all the details on how to join the mailing list, how to join our meetings. And if you want something from us, you can always file an issue in kubanitieslash steering. Big, big, big thing is we do really, really want to know what is useful to you in these reports. Not just our community members, but like as an end user, or potentially someone that is a employer of people that might be contributing. What sort of information would be useful to you to help continue to justify a commitment to the project? So if you have any ideas, please, please, please, please reach out. We have one minute left, so I think we can take one. Yeah, we can probably go over to you. Does anyone actually have any questions? That was also kind of a whirlwind and I'm sorry. We can also freely take stuff after this too, if you want to talk privately. We have more steering community members. We got one, we got one. Hey, not really a question, just more of an answer to your previous question. So I'm a tech lead for SIG cluster lifecycle. We recently did a sub-project survey. So we kind of inspired ourselves from the SIG survey, but because cluster lifecycle is just made up of so many sub-projects, usually when we answer the SIG survey, it's like it depends on the project. So we try to do something similar so that we as SIG chairs and tech leads could have a better idea into what's actually going on in the projects. And one thing that I found really useful that I think it would be good to emphasize when we do these surveys is to encourage the SIGs to not have the chairs and tech leads answer it in their corner, but instead have like a meeting where they do kind of like a retrospective and then they talk about it. I have literally brought that up in every chair and tail meeting I've been in and talked about in reports. Yeah, because I sat in those meetings where sub-projects did that and everyone was like, whoa, we should do this more often. So I think, yeah, that would be a really great way to make it a conversation starter instead of a chore that people feel like they have to do on top of the million things that they have to do. The other thing that I've encouraged, like if you have someone in your SIG that is you're potentially thinking about promoting to a lead is to try and get them to lead that conversation. Because it's a great way for them to just get to know all the various sub-projects more and just get to know the people better. Yeah, I know a couple of SIGs where the chairs and tails have not written the report and someone else in the SIG who is contributing has written the report. And that's a great way to involve contributors. And this also removes confirmation bias. Okay, with that I think we can take it async. Thank you. Thank you everyone.


So once again, thank you so much for giving us your time and letting us pick your brain I think it's gonna be very valuable. So can you just tell us a little bit about your personal story? Like how you got to where you are today? You don't have to go extremely in detail, but give us the overview from player to What you're doing today helping out? Sure thing. So a real top line summary of my experience so far Initially started off playing in the UK as every you know, child does The boyhood dream is obviously to become a pro footballer You know, kind of luckily for me during my kind of teen years most crucial points during your your upbringing I never had an opportunity to play at any pro clubs But that didn't determine by the time I reached 18 and I was playing at a semi-pro side in the UK I decided that you know, I want to take my tennis abroad I had an excellent opportunity to go to the US where I first started off at a junior college in Seattle For me that was a great experience allowed me to you know, test myself I've played all over the world and further to develop my skills We had an award-winning program at the school that I started off at You know made a bit of history and then I ended up transferring to complete my time at West Virginia Tech University And during that period of time as well You know, we had a great team who's national champions, you know back-to-back But I always wanted to take you know myself to a step further. I'm unfortunately high was made ineligible one season And I'm not playing time was kind of like a cross-roller either Go back to the UK and just kind of sack it off or I could just use it as an opportunity to improve myself during the Free time that I had I chose to do the latter done so well and then I ended up playing pro football at the end of it So I got recruited from the US ended up going to Scandinavia I'm playing pro football from you know in two different parts of Sweden Very cool. And now What are you doing today sports agency? Yeah, so, you know off the back of our experience one of the biggest things that we found was that there was a lack of support for Athletes once they were actually places these American universities So we wanted to create a service which is very much tailored around each athlete that we work with And we've kind of got a three-step process which is preparation placement and support And our biggest value that we see is not just in placing the athletes America and saving them the most amount of money But it's about how we work with them for the entire point of experience and provide them with exit strategies and exit routes And that's all off the back of what we've done on our own accord You know the trials that where I had to drive eight hours from, you know, Virginia to Florida to go into combat You know showing people exactly what to do what also what not to do because there are a lot of you know I'd run events out there and all of that hindsight just provided with the athletes are coming for our program Amazing. So this is exactly what we want to hear about. Can you just talk about you said? Preparation placement support is that correct? Yeah, correct. So you kind of break those down a little bit Yeah So before any of our athletes go over to America, they have to go for a four-week training camp That is to just ensure that they're fit and ready to go over to the US and perform purely because we understand how rigorous Preseason is in the US and it's not somewhere that you go to get fit is somewhere where you need to go actually being fit So we've taken out of our athletes had a number by the number of platforms to get themselves fit get themselves sharp Ready in terms of placement we find that their best suited university on average we manage to negotiate scholarships between 65 to 100% off the total price And our athletes pay you know in comparison to the cost of studying in the UK Looking about 95% pay under the actual price is a significant saving and then as I mentioned the most valuable part for us Is the support element So we work with them for the entire four-year experience if they want to transfer from one university to another We handle a facility that operation as well. So, you know, they become part of our family as such Very good. So You just speak I got a lot of questions already But how are you negotiating these prices because I mean if I'm just a kid I'm contacting the coach by myself I'm trying to set up everything by myself Chances are I'm paying full price. What are you doing differently? Firstly is really understanding the recruitment process from a coach's perspective understanding what they're looking for for each position so we've got like a Manual as such for each position what type of video footage we need to see what do we need to uncover if you're fullback for example You know, what's your position like what's your recovery runs do you overlap? Can you put a ball in the box? All of these different things need to be showcased in a highlight state But not only is it that we typically play our athletes in top-level showcase games in order for us to To provide a coach with a very actual Concrete opinion on each athlete that we work with so for example in the past we've made games against lots of Arsenal Dagon and Redbridge Later Norio Chivas USA and most recently played against a Influencer team called Rebel FC. So these games The university coaches can trust us that their level of opposition at the competing against Is going to be of the equivalent standard as if they were going to go to the US As opposed to an individual who's sending let's say their highlight tape and it's showing all their clips But who are they really performing against right exactly exactly?


Welcome folks, we're in the Dow Industrial, finished up 28, Nasdaq is down 13, S&P's off 3.5. Gold, gold contract caught a bid up $13.90, $180.05 an ounce, we had Silver up $0.80, $20.64 an ounce, Platinum up $15.80, had 9.40 an ounce, Lightsweak crude up $1.60, $90.61 notes and bonds, the 10-year note, up 16 ticks trading at a price point of $1.1928, the 30-year bond was up a point and a half at $1.4221 and $Kingdala, $Kingdala traded down, down $221 ticks, $106.400, the Euro is at $1.01, the Yen is at $135 and the British Pound folks is at $120.00 to $1.00 at U.S. Dollar. We'll get over and we'll take a look at the S&P's first, what you're going to see out here, bottom line you're actually pushing highs and you've got volume on the push. You didn't hold price, the S&P's really went sideways down $0.42, he did 50 million shares, well the last swing high was $67 million. So bottom line you're going to need more volume there, no doubt about that but it's not backing down man. It actually took out the June 1st tie but we didn't get the volume either so bottom line you're going to do more backing and filling. And the X100, we take a look at the three Q's, we have the three Q's, same type of setup, the difference is that the Q's bottom line got some good volume, 43 million shares, last time we were up here which was last Thursday you only did 38 million so you can see you did 5 million more, you got over it then you didn't hold price. That's saying yeah you can back down a bit but the bottom line that is making its way up into the next swing up here is about $347 and we're at $3.20 right now. We go to Kingdala, so Kingdala what it's all about folks okay, the bottom line is that if the dollar goes higher markets go lower, if the dollar goes lower markets go higher, it's flat out and today what you had is you know bottom line Kingdala is dealing with this $106,792 area you know, you got above it again today, couldn't hold it, got above it again Friday, couldn't hold it, you're staying right at it though, that's the kicker here. So we'll see how this shakes out, it's $106,792 that's the number to keep your eye on. If we go to the 10-year and we take a look at the yield out here we are yielding 2.7 and if we actually look at the 10-year note how the 10-year note is set up what you're going to see is that it's starting to consolidate is in 850,000 contracts that's short contract volume but what has happened you came down to the breakout area you're consolidating this looks to me like it's building cars for higher price, lower yield. Have a great night folks, have a safe night, come back and visit Tommy tomorrow morning, kicks us off 9 o'clock in the morning, great show, look at him folks.


So, first thing I want to know before I get started, the link down there at the bottom, all the slides are up and available. That mirror screen thing is going to drive me nuts, I'm going to leave it though. If you can't see, like if you're in the back there, there's stuff hanging down. I ascribe to the top two-thirds kind of slide configuration, so if you can't see something, definitely go to the link. Yes. There, that's good. Can everybody see me okay? Okay, great. So, assuming this will work, which it doesn't, not surprising to me. Okay, that makes it much easier. Very funny. All right, so that's me. You can find me on Twitter. That's my blog.  That's my GitHub account. Many nerdy projects also. There's, at the end of this, there's a reference to it, but there's work that follows this bits and pieces of math with actual concrete stuff. And there's plenty of concrete stuff in the presentation as well. So first thing, I work full-time on jQuery Mobile at Adobe. I'm extremely lucky to have that job. And I'm very grateful that Adobe funds me to do that.  But if you don't have a job and you'd like one, there's great jobs at Adobe doing Ruby, Creative Cloud and some other things, some smart people there, and Typekit, actually. Anybody heard of Typekit? Right. So they got acquired and they're hiring. So if you're interested, the link's at the bottom. All right, so I feel like this definitely needs a little bit of motivation. Generally speaking, when you go to a JavaScript conference, you're not expecting to hear about math. And that's fine. I wouldn't either. And so let's talk a little bit about why I did this. So first and foremost, I don't really like using the laser pointer, but I'm going to call out the mullet. I really appreciate that. Math is pretty awesome. And I have kind of a tumultuous relationship with it. I didn't really like math until a couple of years ago when I kind of gave it a second chance. So I think my story is a common one. Lots of people go to high school and college and learn calculus. It's, they do a poor job of relating it to the real world. Me and a lot of my friends think that calculus should be a part of, like, a physics curriculum. Long story. But the point is, is that calculus can sour people on math, and math is so much more than calculus.  The computers that you're using right now, the phones that you use, the modern conveniences we enjoy are almost all entirely due to math. So that's amazing. There are domains to math that cover incredibly diverse set of topics. So operational semantics, logic, category theory, you know, vector math, all these crazy amazing things that are not calculus and are not quite so annoying and abstract, and they're very concrete. So we're going to see a little bit of that today, hopefully. Hopefully I will de-sour you on mathematics if you don't like it now. JQuery. So it's JQuery, obviously, this doesn't really need saying here, but it's very popular. Something like 50% of the top 10,000 websites is ranked by Alexa for whatever that's worth to you, use JQuery. So if we can get something out of this, if there's something concrete on the other end of this presentation that we can get out of it that improves JQuery broadly, we're making a big impact. So that's a motivating factor. Speed. So speed is nice. People like talking about speed. Nobody loves performance presentation. And one thing I'd like to note is that's a tachometer, a tachometer, that does not give you any information about how fast you're going. But it looks nice on the slide, so. Okay, so let's talk a little bit more about the problem that we're solving, this method chain thing. So this is a very common idiom in JQuery. So you might characterize it as the foundational idiom in JQuery, methods that you chain. It's simple, you understand what's going on, it's almost literate. But specifically what happens under each of these is not always obvious. If you've been using JQuery long enough, you already know what's happening in the background. So let's look at the kind of a naive underlying implementation of each of these. So hide. So hide might look a little something like this. The two things to note here most importantly is that it's a big loop over all the elements that have been selected from the DOM, so divs here. So all the divs in the DOM are being looped over and this, the key bit here is that the underlying DOM element is being manipulated, so the attribute is being set again. This is hyper naive, but this is hiding the stuff that we've selected. Second add class, again, another loop. It also alters all the DOM elements in the set. Same thing, big loop, DOM alterations. Show, again, very simple. Big loop, DOM element alterations, very similar to hide. So what we've got is this big set of loops. And I think generally speaking when you start programming, if you have a CS degree, someone along the way has said, it's good to do less loops. When you start learning about big O notation, obviously this is upper bounded by N, it doesn't really matter. There's three loops. The upper bound is still N, big O N, but it's one loop is better than three loops in a lot of cases. It's sort of something you might, it's sort of semi-intuitive at the very least. So what you might want to do, you might do, if you wanted to have less loops, you might squish everything, so squish everything down into this kind of single loop. So if you took all those three methods and you kind of toss them together, this is what you'd get on the other end. This has two problems. So one of them, obviously, is that these are very naive, they're very simple, but more complex than the actual implementations are much more complex than this, and it's not always clear how they should be squished together properly, right? I mean, even if you put them together just one on top of the other in the same loop, there could be conflicts, variable shadowing, all kinds of stuff. And the second problem is that you have to copy and paste. So we all know that copying and pasting is error prone, just even the very act of it, you can lose things, leave it behind that are very critical to the functionality. So this clearly will not work. If we are interested in reducing the number of loops, the number of ends, these are two problems that we have to solve. So an important note here is that it's not always obvious that less loops is better. And in some cases, it's not. But so I've done a little work on this, obviously. For some very simple examples, in this case, remove attribute, which the reason I chose it is because these squishable stuff inside of remove attribute is available on the dollar function. So it's easy to squish. There's no copying and pasting, so I chose this way. And what you get at the top blue bars and all those tests and the different browsers is the squished version versus the bottom red bar, which is just the chained version, the normal version. So it amounts to about a 5% to 10% performance improvement. I mean, this isn't going to change your life right now, clearly. But there is a performance improvement to be had. So it's good. It's well founded for certain sets of functions. Additionally, I pulled this one out of jQuery mobile. We have this enhanceable helper that's very similar in that it exposes the underlying squishable functionality. And again, pretty good performance improvement. Worth noting, in Safari, for some reason I am not clear on, it's not an obvious win. So it's within the plus or minus the kind of error bar there. But it's worth investigating. So the point being is that if you're not happy or comfortable just assuming that less loops is better, in most cases, well, not in most cases. In some cases, even in the cases where there are few loops to squish, it still has value in terms of performance. OK, so category theory. Let's get into this. And this is what I'm going to cover today. If I can get through my slides, I think I have 130 slides. So I've got to move quick. The things I'm going to cover today are, one, what a category is. Two, I'm going to build two categories so that you get an example and using things that you're used to, so DOM elements, JavaScript functions. And then last, I'm going to give you what's known as a functor. And don't run for the door because you heard the word functor. It's not that scary. OK, so just to start off, I'm going to get a little context in here. It's helpful to understand where category theory came from. So these two guys, Eilenberg and McLean, were sitting around working on some crazy math stuff, algebra, algebras. And what they were seeing was that there was this common activities, this common stuff in between all the algebras that they were working with.  So what they did was they saw all these similar behaviors and they wanted to abstract that stuff out. And so what that eventually became, obviously, didn't instantaneously become category theory. Over time, became category theory. And very specifically, some of the stuff we'll talk about today. So what specifically is a category theory? In mathematics, when you say this thing is a category, what do you have? So first and foremost, and I do have math notation in my slides. Again, don't run for the door. The thing on the left there is just a way to say the objects of a category. So an object or a category more specifically has two things. It has objects and it has what are called morphisms.  The objects are just things, so very abstractly things. So if you're talking about JavaScript in terms of a category, you would say JavaScript objects. So stuff you might be familiar with. And this complied a lot of stuff. For example, hask is a category if you've heard of Haskell. And the objects in hask are Haskell types. So it's just things, concretely things, or not so concretely things. The second piece is morphisms. So morphisms are just mappings. They're actions or things. So it's kind of a nouns and verbs type of relationship. And these are the two sort of concrete pieces of a category. Now there are two laws, the first of which, two laws that a category must satisfy to be a category. The first is identity. And the notation is actually pretty intuitive. So ID, identity, takes some object and gives it back. That's all it does. It's very simple. And it's not very obvious why that's necessary, but in a lot of mathematics, and my understanding of this is that in a lot of mathematics, it's just simpler to have something to put together with other things in terms of notation, in terms of simplicity, in terms of readability. So it's there for to shim stuff as necessary. So the category has to provide some sort of identity morphisms, some sort of identity action that just takes an object and then just gives it right back. In JavaScript, this is exceptionally simple. It just takes some A and returns the A. So not so hard to get. Composition, so the other thing that a category has to provide is composition. Now, many of you may have heard the term composition in terms of functional programming, and that is very similar to what we're talking about here. So in the notation, there are two functions, G, two example functions, possible functions, G and F. G takes an A, gives you back a B. F takes a B, gives you back a C. If you glue those two things together, and you can think of that little circle notation down there on the bottom is glue, if you glue them together, you get something that takes an A and gives you a C. Pretty simple. So that's composition, very abstractly, and four categories. For much more concretely, for JavaScript, you can build this yourself. It's very simple, like if you've used underscore, they have a compose function. Just takes two functions and returns a new function that takes one argument, hands it off to G, let's G operate on it, G hands off some result to F, and then the whole result is returned. So that's all that composition really does. It just glues two things together. It sort of chains them together in a nice, and in a single package. So the function that's returned is that package, that chain. So let's talk about our first category. The notation here, the four letters in the init cap is convention from the mathematics. So the second category will look a little bit odd, but that's why that's named that way. So let's talk about this category, HTML. So first thing we gotta do is we gotta define our objects, right? We said we'd have two concrete things. We have objects and morphisms. So first thing we gotta do is come up with objects. This is very simple. The objects in HTML are just DOM elements. So what you're familiar with, the stuff that's underneath jQuery, if you don't actually manipulate the DOM directly in your day to day, but DOM elements that you would get from JavaScript API. What are the morphisms? What are the things? What are the actions in this category? They're just functions that take DOM elements and return DOM elements. So they might manipulate them. In this case, this would be identity. But the key is that they can only take DOM elements and they can only return DOM elements. You can't take a DOM element and return an integer. The constraint that we're placing on here, placing on them verbally, because obviously JavaScript doesn't have a type system, is that they take DOM element and return it. So that's kind of on you if you wanna participate in the category. An example would be sort of from earlier, if you wanted to set the class to foo, would you take a DOM element, alter it, and then return it? Identity. So we need to define this behavior. We need to satisfy this law for the category. And again, it's very, very simple, just what we saw earlier in our example. The only difference is that it takes an HTML element. Composition. Again, the exact same thing that we saw earlier because it's just a DOM element, it's composed and instead of just some random thing, integer, whatever, you have to take a DOM element. That's the stipulation here. Okay, so we've defined our first category. Again, the thing I wanna go over here is that the reason why it seems so simple is because it is that simple. There's not a whole lot of complexity to these ideas, and it is in a lot of ways what gives it its power, because it's so abstract and sort of basic. Again, the common elements of some very already abstract things, you get that commonality between lots of stuff. So why category theory applies to JavaScript as well as Haskell as well as physics and some other crazy things. Anyway, if you feel a little bit confused by why it's so simple and why you thought it would be so complex, that's fine, it's supposed to be simple. So again, naming init cap, generally category names are four letters or less. So we're gonna name this category jQuery in short. The objects of jQuery. So what are the objects of jQuery? Well, they're jQuery objects. And to be clear, I don't mean, a lot of times there's this confusion between when you say jQuery objects between the dollar function and the results of like a selector, right? What I mean is the results of getting dom elements out of your document. Okay, so in this case, some element with the ID sample. So those are the objects of jQuery. What are the morphisms? Well, just as you'd expect, things that alter jQuery objects, the stuff you're used to using every day. And you can start to see where this is gonna tie in. Maybe you're starting to feel where it's tying into our original problem. Okay, so we've got those two laws. And now these get a little bit more complex. So this requires some knowledge of how jQuery methods, the methods you use every day hide show ad class that we showed earlier, work. Specifically, when you define a method on jQuery.fn, the context is available to you as the jQuery object will be available to you as a context, as this, when it's invoked on a jQuery object. So this thing becomes our first argument in identity. And since we don't, in identity, all we do is return the thing that we've been given. We just return it here. So this is exceptionally simple. As an example, if you did this, if you invoked this new thing that we just created, it would just give you back that same jQuery object. It wouldn't do anything else. Okay, so identity. Composition, this one's super fun. So again, we have two functions or two methods, jQuery methods specifically. We wanna run these things together. But remember, we said that it's not coming in as an argument. It's that this, we need this, we need the context. So this is our object that we're gonna be operating on. And we're gonna use apply to pipe the context into these jQuery methods that we wanna chain together. So instead of doing chaining like dot method chaining, here we're kind of doing it for you. And that will be our composition for this category. So again, g gets to manipulate this and we'll return this because we all know that all good jQuery methods return the jQuery object they're operating on. And then f gets to go. And then the whole thing gets returned. So let's take a quick, let's take a quick look at what an example this is so that it's totally clear. We got two jQuery methods that we're defining and ostensibly they alter the context, the jQuery object and then they return it. Using our new compose function, we smash those two things together and we have to define it on a jQuery object obviously. And then what ends up happening is that these two things become functionally equivalent. The chain that you would otherwise use is now just one thing. Now there's not a whole lot of value in this. Again, I'm sort of setting the stage for the real value but we're defining our categories here. We're trying to adhere to the laws we've been given in category theory. So that's composition. All right, the last piece of category theory is the functor.  So this is the important stuff, just pay attention for this. So a functor is a purely category theoretic construct. So we want it, it is a mapping between categories. So if you have objects in one category and you want to get it into the other category for whatever reason, because there are operations, there are interesting things going on in that category, you need a functor. You need to get between the categories with a functor. So it's a mapping. We need three things. The first equation is something that will map the object. So we need some way to get the objects from one category, in this case HTML, into another category, jQuery. I'm going to go back to this. So to be totally clear, we are mapping from HTML to jQuery, not the other way around. So that's our functor. It's a one-way thing. It doesn't go both directions. The second thing you need is something that takes the functions, the morphisms, the stuff, the actions, and also maps those across. So it takes them from HTML and gets them into jQuery. And last, there are more laws, but again, I only have so much time. The law that you have to adhere to, this is called preservation of composition. And we'll get into the specifics of this. Don't worry about the equation. We'll cover it. These are the three things that we need to get a functor together so that it adheres to the laws. And it will act as a functor in a properly defined category theoretic functor. So first, let's take a look at getting those objects from HTML to jQuery. This is very simple, right? So many people don't know this. And this audience might be better informed. But taking a DOM element and just wrapping it with the jQuery function. We'll give you back a jQuery object with a DOM element in it, as though you had selected it from the DOM specifically. So that's the first part. So we've taken a DOM element, which was in our category HTML. And we've sort of transported it quite easily into our category jQuery. And that's the result. We get a jQuery object back. Next, we have to deal with the morphisms. So we have to take these kind of pure, simple JavaScript functions that alter DOM elements. We have to get them into jQuery. We have to get it so that jQuery can use them to manipulate that set of things. And this bears an example. So the first thing I'm going to show you is set foo. So this is that very simple function that I showed earlier. It does something very simple. It just changes the class and changes it to foo. So normally, when you're just in HTML, so when you're just living in that one category, that first category, you're just going to use it like a regular JavaScript function. You're just going to invoke it, right? But what we really want is we want to use it like a jQuery method, because these are the morphisms of jQuery. So we need to take that first thing and turn it into the second thing. So how do we do that? So I'm sure some of you have already figured this out. But you can quite easily do that using map. So if we defined our set foo jQuery method and we started working on it, we started working on the jQuery object, and we said, OK, how do we take set foo and start pumping HTML elements in there? Well, the obvious thing to do is to map it over it. Map each similarly, give you all the HTML elements. It loops over the entire thing, just as we showed earlier. The use of map is very specific, though, because map requires that you return the element again. So it's a little bit more rigorous. And it also means that set foo can be the HTML morphism that we saw earlier. It can be that DOM element altering function. If we took that return statement out, it wouldn't really fit with our category that we defined earlier. So map is actually the way to do it in terms of category theory. So map. Map is our second piece. So we've got both of these. We've defined both of these. OK, we've got our objects, and we do that with a jQuery object. And we've got our morphisms, and we do that with map. So we've got the two pieces that we need. Now we just need to take care of that law. So this equation is actually pretty simple. What it says is that when you compose the, in our case, jQuery morphisms, it should be the same thing as composing the HTML morphisms and then using them with jQuery. OK, and I have an example. Don't worry, I know that sounds complex. So let's go back to our original example, where we composed two jQuery methods. So we've got these two jQuery methods, and we're going to stuff them together and we're going to create a new one. Now remember, we said that this thing was functionally equivalent to those two chains. So composing them, smashing them together in this case, is the same thing as chaining them. We established that. What's interesting is that if the functor law, if we can say that that functor law holds, it's actually exactly the same thing as just composing the two underlying manipulating bits and then mapping it once. So recall that that first one up top is two methods and two loops, and the one at the bottom is just one map. So this one is one loop, and the other one is two, and that applies broadly. So you can do this with as many chains as you want. So the functor law, what the functor law is telling us, and this is the key insight, is that if we adhere to some of these laws, we can say with good confidence that this is exactly the same thing as chaining it, but with less effort in terms of execution. OK, so meanwhile, back in the real world, everybody's wondering why this matters. You might even be saying to yourself, where's the beef? So I'll show you. Let's go back to our original example. Now I'm going to take out hide just for simplicity's sake. There's nothing particularly important about it. I just want to make this simple enough to understand. So you have these two jQuery methods, add class, and show. We've got two loops here, right, as we described earlier, and we want to make it one loop. So let's take a look at these two things. So we have these two things. Now what do we do if we want to get these things composed together, squished, in a way that solves our problems? Well, first thing we need to do is we need to, well, sorry. So that's the stuff that matters. That's the stuff that we need to squish together. And this is a squished together version, right? But we said that this has two problems. It has the first problem, that you have to go find it, and you have to know that it'll work, and then two, you have to copy and paste it, all of which is bad. So what do we do to fix that? How do we use the thing that we learn from category theory to fix this problem? So first, we need to expose this stuff. We need to stop mapping it directly, and we need to make sure that the underlying stuff is available to whomever, myself, whoever's going to be using this. So for now, we're going to wave our hands and say that because I'm defining it just as a function, it's global. And then, because we've defined it globally, and we've said that composing those two things is the same thing as chaining it, these things are effectively the same, right? So let me go back to that again. So these two things are the separated version of that top thing that's squished, right? But now, we have that compose function. So these two things are functionally equivalent. And that's what we wanted. We wanted a really simple way to squish everything together, right? We want the performance benefit, but we don't want to copy and paste, and we don't want to sit around and worry about whether we're going to have issues throwing these things together. And that's what we got. So we solved both of our problems. We've introduced a tiny problem, though, and it's a good problem, though. That's why it's a smiley face and not a frowny face, is that when I said I sort of hand-waved and said it's global, that doesn't work for everybody, right? So if we want this to be something serious and concrete, we actually have to make that available. That's where this comes in. And again, you might be wondering, John, this is interesting. You've got a performance benefit here. You even showed me some graphs that said it was 10% faster. Is any of this available to me today? Can I go compose these things? And the answer, obviously, is no. So we're going to talk about what we can do to fix that. In this scenario, so if we have an example in this set foo scenario that we described earlier, this is what you would do. So you'd sort of expose these things. And then inside the jQuery method that you define, you sort of map the HTML altering thing, right? So in this, actually, if you go into jQuery, a bunch of extra complexity, a lot of the methods actually do this on some level or another. They might use some of the internal methods. They might even use map. But internally, what will end up happening is they'll loop this sort of HTML altering stuff over the entire set. So for our example set foo, we've got the pure function exposed globally, globally. And then we use the map internally. So the answer to this, one answer, possible answer to this would be to say, for all jQuery methods, if you are able to and you think it's a good idea, you can expose that underlying piece of functionality as the composable property on the method itself. So this would be one way that everybody could know, like, oh, maybe I've got this big, long chain. Maybe I can smush some of these together. They could go look to see if that property was available. So what would that look like if you wanted to do the squishing yourself? So we have a chain here set foo, do bar. And both of those happen, thankfully, to some intelligent person who paid attention to my talk. They happen to have the composable attribute and the underlying manipulation to the DOM is available. All they have to do is use this compose function, ostensibly a helper with jQuery, and smash those two things together and map them over and you get some sort of performance benefit. That's the ideal, at the very least. But this is nice. And in a lot of ways, it's not a gigantic amount of complexity to add if you're actually evaluating performance. Generally speaking, when you do performance enhancements, there's some sort of trade-off. You're sacrificing some sort of obvious abstraction for something that's a little bit better. In reality, it probably has to be something a little more complex. And you don't necessarily have to worry about this. But likely, it has to partially apply some of its arguments. So there aren't very many jQuery methods that don't take any arguments. Most of them require some sort of input from you in terms of a selector, a string, some sort of information. So to get that composable thing out, you need to partially apply these arguments. If you don't know what I'm talking about, it's OK. So there's more to this. There's more on this concrete stuff that you can get into here. So first of all, the proxy. So I built a small library. You can actually, if we're at the case that jQuery methods define these things, or plug-in authors decided to start doing this stuff, you can actually warn the users automatically when they have chains that have these composable attributes. So it works as a very simple proxy in the prototype chain. And it can log to your console in the case where there's three methods in a row, two methods in a row, five methods in a row. You can configure it. The object size can be taken into account. And in that way, we can make sure that there are actually performance benefits when you're warned. And you don't actually really have to think about it. You just drop it in the DOM, and then you look in the console, and you look for optimizations. So with being able to reduce pain in this way makes it much more viable. There's still a lot of performance testing to do. So I've done a fair amount. I think it's well-founded for smaller sets with two or more chains. Well, probably three chains is probably a good place to start, or three methods chained. But it requires a lot of testing. So sort of assuming that it's a performance benefit because you're removing the number of loops that you're doing is not very smart. And it would be very interesting to see it implemented on an actual project. So I happen to be a jQuery mobile contributor, but I don't think they want to bother with any of this. If you're interested in this, and if I haven't totally ruined your day with math, there is more stuff on my blog about it. There's another article that's almost purely about the category theory, which has value. And I sincerely hope that it gives you an idea that the math doesn't have to be painful, that it doesn't have to be like calculus. There are interesting applications even in your day-to-day. So JavaScript, obviously, is your day-to-day. And we've applied category theories seemingly something very abstract to the very concrete. And that is category theory. So I have three minutes. I did not think I'd be able to do that. Happy to take questions if there aren't any. Hey, I have a question about the original performance stuff. So I'm assuming that you just smushed and then ran the performance and did not actually do the partial application slash.  Which is overhead. And that's actually part of the performance testing that has to happen. I still think that, and moreover, the examples are two chains. And in theory, there are much larger chains to be had and bigger performance benefits in terms of function call overhead. But yes, you are correct. OK. Great talk. Great concept. I don't mean my question to sound like I'm questioning it. What would be the difference functionally between doing what you suggested and taking any collection, saying dot each, and then doing three chain methods together individually, as opposed to then looping through it three times? Then you're doing one loop. So let me be clear before I repeat the question. You're saying just do each and then just kind of use the underlying stuff together. So that's what, OK. So the question was, why not just use each in a chain as opposed to using the jQuery method itself? So that's actually what we're trying to avoid. So the idea is that we don't want to do the extra loops. We want to eliminate those extra loops. And every time you use each, or I think what you're saying is that just use the three function calls, yeah, you can do that. But again, I think that the composer, to you who lose question also, that there's a performance benefit there. But I think the composition, one, provides a bit of rigor. Two, it gives you a sane way to put those things together without causing more mistakes. And three, it adheres to what we talked about in terms of category theory. You don't even have to do it with map, actually. You can do it with each because everything is a side effect. And actually, more importantly, because there are side effects, a lot of times the functor law doesn't apply. But it's an interesting insight into performance as a consequence of category theory. So you're not wrong. It just didn't fit into the map. Hopefully that answers your question. Lou, OK, so it's possible he just asked this. I heard your response, not really his question. But so theoretically, if you have four functions in a chain, and say the collection is like 20 objects along, so you'd be iterating 20 times and doing each one of those chains or something like that. Correct. If you were to say you select the same 20 item collection, and then you say dot each for instance, or a map, or whatever, and then inside the each loop, you call each one of the functions individually, each one of the four chain functions individually, you're theoretically still looping over each collection. But the collection has one item, if you will, in each set. I see what you're saying. Sort of what you're saying. So part of the performance issue here in understanding the performance tradeoffs is that the loop isn't that much overhead. It's actually, it's a couple function calls maybe. It's array access and maybe some incrementing somewhere in there. So the benefit is really, it can be quite small at times. But there is still a benefit there, because you are only doing that once, as opposed to resetting your increment variable and not doing the array access again and not doing the function calls again. So there is a benefit there, but that is similar to what he asked, which was, can't you just shove them all together? And you can. The downside being is that you still have to do a little bit more work, and there's maybe correctness issues there. I hope that answers your question. If it doesn't, we can talk after. I think I'm out of time anyway. Somebody in the back there. Do you have any plans to hack some code up together, like a patch for jQuery to make their, I don't know, to apply this, I guess? Yeah, I mean, it's a nice idea. Reality is that this should be very far down the list of their priorities, if we're even there. So it's not, it's a nice idea. There is, it's, again, I took the time to make sure that it's well founded. It's sort of an academic exercise, too. But what interested me and the reason why I wanted to give the talk, and I actually really appreciate the fact that they let me give the talk, is that this is the kind of stuff that interests me. Math, math is applied to everyday stuff, can be very interesting. And that's why I was kind of excited to give the talk. So no, I don't think that they're gonna implement it. I don't think that it's worth their time to be totally frank, especially for what, what appeared to be initially for small gains. Now, if I come across some set of, some set of conditions which increase the gains, and we can detect those, obviously, maybe I'll make a case for it to do the work myself, but realistically no. There's nobody else. Thank you very much. Thank you.


Hello, everyone. In this video, we will work on the interactive window that is available in Python win. And we will focus a little bit our attention on variables and different types of variables and how we can use them. So I'll just move. Before we begin, I would like to talk a bit about the importance of commanding your code. Whenever someone else looks at your code, or even if you yourself comes back to something that you have written a while ago, you will need the comments in order to be able to understand better and faster what its little part of your script does. So in order to create comments, the bound or most commonly known nowadays, the hashtag symbol is used. A comment can be given on its own line preceding a large piece of code such as a function where it describes more or less what it does. And the way to do it is the following. This is a comment. If I hit return, enter. Nothing happens because this is a comment. It's not a part of an executable code. Also, keep in mind that the comment can follow a specific line of code if you want to place an important message at a particular part of our script to keep in mind what happens at a very specific part of our script. So let's say s equals one. And this is very important. However, we cannot use the pound symbol like this the following way that I'm going to do it. Let's say that we have a string equals to this. This is not a comment. Because if I come here and hit string, we will see that the pound symbol is part of the string that I have created. But we will talk more about strings in a following video. After this brief introduction about comments, we can move on to the use of numbers and variables in the interactive window. The simplest thing that we can do over here is to use Python as a calculator. Here's an example. We can say two plus two equals four. Or we can use the interactive window to have some more complex mathematical formulas such as this one divided let's say by four and get a result right away. Keep in mind that this was a perfect division. And take notice that in the following division that I'm going to do only the integer part of the result is going to be shown in a similar manner to a Neuclidean division. So if we say seven divided by three, we will get only two. And if we want it in this particular case to get the remainder of this division, we would have to use the following operator. Seven like that. And we will get the remainder of one. Now let's spend some time to talk very briefly about variables. You could think variables as a small memory boxes where we can store different values that are useful to our programs. In order to do that, we use the equal sign in order to assign a value that we want into a variable. So let's say that we have a variable called width. And that is equals to 20. And then height equals to five times nine for whatever reason. And then we can use these variables to have some mathematical formulas such as width times height. And this should produce 900. Yes. So keep in mind that the same value can be assigned to different values to different variables throughout our program. And actually we can do that very easily in just one assignment like sorry, this one where x equals y equals z equals two zero. So indeed x is zero, y is zero, z is zero. And also be careful that if you try to use a variable that you have not yet defined, meaning you have not yet assigned any value to that variable, you will get an error such as let's say what are the contents of the variable and there is no n defined yet. So in order to do that, we have to first assign a value to n. So let's talk a little bit about the different types of variables that we're going to have specifically about number types of variables that we're going to use. So if we define x equals to five and then we ask Python what is the type of the x variable, we're going to get an answer that it is indeed an integer. And keep in mind that when we're using another variable to create a new one, the new variable is assigned the same type. What I mean is that if we use x to define y in a way such this one times three, y in this case is 30 and the type of y would be integer as well. If we want to, yeah, another thing, if we use a float number in this example, and let's say that y in this case is 5.0 instead of the same number but in this case it is a float number plus x times three. And we check to see what is the type of y, we will get a float number because in this case, Python is going to go and assign the more general, more encompassing type of variable since that one was used during the definition of that variable. And if we go to the previous example with a division where we had the seven divided by three getting a two, if we use a float seven and divide that by three, the result is not going to be an integer anymore. It's going to be a float number so we're going to get a more accurate result of 2.3333. Another way to receive similar results in this division or in similar cases, we can use a technique that is called typecasting. By doing that, you don't have to create different types of variables that have different types. I'm sorry, you can do the following. So let's say that x equals seven and y equals three, both of them are integers. But if we want to get a float result of this division, let's say z equals the float version of x divided by y and we get the 2.3333. One last thing I would like to bring up about the interactive mode before we move on to script windows is that the last printed expression is always assigned to a variable name underscore. This means that when you're using Python as a desk calculator, it is easier to keep that in mind and it's going to save you some time. So let's say in a very brief example, we have a ducks variable equals to something like that. It's 12.5%. The price of an item equals 185. Price times ducks equals that. So price plus underscore would be the final amount of money that we would have to pay. But be careful, these variables should be treated as a read only by the user. Don't try to assign a specific value to that variable because it's going to create a mess. Because this is going to create an independent local variable with the same name. And yeah, it's going to be problematic. So treat it as a read only and use it for only this specific purpose.


In this video, suppose that the population p of a flock of birds is growing exponentially so that dp over dx is equal to 20e to the point 05x where x is measured in times of years. So we're saying that the derivative p prime is equal to an exponential function here. So before anyone panics here, right, we're not saying that the population of the birds is growing exponentially. We're saying the rate at which the population of the birds is growing is growing exponentially. The derivative is growing exponentially. Yousers, what does that tell us for the function? It turns out it's not going to be much more complicated. But we want to find p in terms of x. So we want to write p as a function of x if we know there are 20 birds at the beginning of our observations here. So we have an initial value problem placed in front of us, a differential equation. We know a relationship on how the population is growing over time. We have an initial observation and we want to find an equation to model the population at a given time, right? So we know that p prime is equal to 20, excuse me, 20e to the point 05x. Now since we know the derivative is a function of x, we can actually take the antiderivative here, take the integral of dp, take the integral of 20e to the point 05x dx. The left-hand side is just going to be p. The right-hand side, we're going to get 20 over point 05e to the point 05x plus a constant, like so. And here 20 divided by point 05, be aware that point 05 is actually one-twentieth if you divide by one-twentieth, you're times it by 20. We're going to get that the population equals 400, 20 times 20, e to the point 05x plus a constant here. This gives us the general solution. The general solution to this differential equation. We want to find a particular solution and we do that with the initial value given. So when they say there are 20 birds initially, what they're saying is that p of 0 initially means that the start x equals 0. Initially there were 20 birds, so p of 0 equals 20. So if we make those substitutions in, let's see, p is 20 and you get 400e to the point 05 times 0. It's always nice when the initial value is 0, it doesn't have to be, but arithmetic with 0 is generally pretty nice. So what we see here is you're going to get e to the 0 power, which of course is 1, 400 times 1 is 400. We have 400 plus c, so if you subtract 400 from both sides, you're going to get that c equals negative 380. And we'll see in the future that this number right here is negative 380, it's measuring essentially some initial conditions about the population growth. This is actually measured in some type of elbow room, like how much does, how much potential of growth is going on right now, but we'll come back to that some time in the future. But for now, we can mention that our population of the birds would equal 400e to the negative 0.05x minus 380. And so after x many years, you could use this equation to predict how many birds are there going to be in the population. And so this example, this solving this initial value problem is starting to show you why people are interested in differential equations, because if we are some biologists who are studying this flock of birds, we are going to be interested in their population size. Can we come up with a mathematical equation that can predict how many birds we'll have on any given year, right? We can use this as we're studying the birds, but how does one actually determine this population? Well, in this situation, we use the growth rate, like we know how quickly they're growing and using that we are able to construct this differential equation. And so that brings us to the end of lecture 25 here. In the next lecture, we're going to start to see some more advanced techniques of solving differential equations, particularly we'll talk about a technique called separation of variables, in which case it turns out this example and the previous example we are doing are just a special case of that separation of variables situation.


Alright guys in this video I want to talk about the stages of sleep and how how sleep works in general because I don't think I've actually Mentioned that before I just want to explain like a very basic background Information about how sleep cycles and stages work and the best way of using that to learn how to lose a dream and sleep better So in an average night's sleep, okay, this is assuming by the way, we're gonna take our example We're gonna come up with an example name. I don't know Let's say Johnny right so let's say Johnny sleeps eight hours a day eight to nine hours a day So he goes to bed at ten he wakes up at 6 a.m. Which is a fairly as for the fairly standard sleep pattern sleep schedule It's not too late going to bed, but it's also early enough that you can get ready for work and stuff So Ted let's say 10 p.m. To 6 a.m. Is the sleep duration that's how long they've got Johnny's gonna sleep So within that time you'll have five about five sleep stages Cycle sorry with sleep cycles Within that time you'll have five sleep cycles now a sleep cycle is a 19 minute period consisting of five sleep stages So there's a lot of terminology here that sometimes gets mixed up and even myself, you know in previous videos I I sometimes mix these things up because it's so It's so easy to do you know these words are fairly synonymous with each other But there are they do mean different things so let me explain a sleep cycle is What we refer to as that chunk of 90 minutes that 90 minute chunk of time Within which there are sleep stages So if you think of the cycle as a big wheel right and then the stages are the little spokes on the wheel So you've got stage one stage two three four five so Your average night sleep.  Sometimes it's it's more, you know, it is The human body is not an exact thing, you know, sometimes we'll sleep or for more or less time It also depends on interruptions and things like that. But just for argument's sake Let's just assume five 90-minute chunks, which are your sleep cycles Within each cycle you have five sleep stages. The first stage is N REM sleep non REM sleep Essentially, this is just your body starting to transition from being awake to being asleep Okay, now if you're if you're woken up during this stage of sleep most people when they're woken up during the stage Well, not even feel like they've been asleep at all.  Just resting. Okay, they won't say oh I was in a deep sleep. So this is a transition period This is also where when you do the wild technique you you keep your mind awake during this non-REM stage of sleep in order to Slip into a lucid dream, but that's for another video. So the first stage non REM sleep. Okay, and this lasts for anywhere between Five to ten fifteen minutes. It really depends on the person. I'm not I'm actually not gonna go into the timings of these things just because it does vary massively from person to person and you know There's a lot of different factors that will influence this like say if you're if you're sleep deprived Let's say you've not been having enough sleep during the week then on date day seven say for example Your you might jump straight into deep sleep and you might miss the first three stages of sleep This is very very common. It's known as a sleep debt And it's essentially your body just trying to catch up on the lost deep sleep that you've missed So I'm not going to go into timings But stage one is a non REM sleep transition period not really a proper stage of sleep But it's like the transition between being awake and being asleep stage two stage two is essentially just like a continuation of stage one it's where your Your sleep paralysis will kick in, you know, your body will start to paralyze your muscles and you will start to Well not start to you will be asleep during the stage and this is where Your body starts to slow down. It's the things like metabolism You know your core temperature will cool down to get ready for the deepest stages of sleep And you'll start to be more relaxed especially if this is the first sleep cycle of the night So when you first go to sleep, this is where your body will start to bring the temperature down Bring the heart rate the blood pressure bring it all down to a low Relaxed deep state of relaxation Yeah, that's stage two now stages three and four are where things get interesting. This is where the arguably Arguably these are the most important stages of sleep along with REM sleep, but mainly the three and four What what happens here is your body starts to regenerate you start to have a lot of things happen within your body Like your you'll start to regenerate your your energy things like this You will start to you'll be very deeply asleep at this point if you are woken up during these sleep stages You will feel very groggy. Okay, you will feel fatigued annoyed anxious sad Angry whatever not good idea to wake yourself will have you or be woken up during stages three and four This is also when your body releases growth hormone Okay, so if you're let's say if you work out or you're at the gym or something like this You've you may have heard it being said that most of the muscle growth happens when you're asleep And this is very true During stages three and four your body releases growth hormone. It fixes its muscles. It repairs things It digest your food. It does all these these things for you It does all these things for you during those stages Very important stages of your sleep very very important and then we move on to my favorite stage Which is stage five stage five is your REM sleep This is your rapid eye movement sleep and the reason it's called that is Because your eyes underneath your eyelids during the stage are they're darting about all over the place Okay, they're looking at in random corners of your eyes We don't really know the exact reason for that. Yeah, some people say it's because you're Looking where you are looking in your dream and there is some truth to that but that's not always the case Okay, that doesn't always happen for everyone.  So you start again in non REM sleep the light transition period that I said about before This doesn't mean this doesn't mean that you wake up every 90 minutes What happens is it's a fluid transition. So you will go from having REM sleep after the first sleep cycle You go from having REM sleep at the end smoothly into having non REM sleep where you're Transitioning you're not really transitioning the second time. You're already asleep. You're just going into the next cycle However, it is a good time And it is a very common time to wake up during that time when you've just had your REM sleep Most people wake up during those those periods of time, especially towards the end of the night Which we'll get into in a second that cycle now essentially repeats itself Five to six times depending on how long you sleep for and if you're interrupted Until you wake up very simple right very very simple. I hope you're following along so far Now what happens is Most most of those sleep sleep stages most of them stay the same throughout the night The only difference the only changes there are as you as you get closer to waking up the last two sleep cycles the last hour and a half This sorry the last the last three hours of your sleep the last two sleep stages During the last three hours of your sleep the last two sleep cycles Your REM sleep gets progressively longer During those those last few hours of your sleep. That is why it's a perfect time to lose a dream Okay, so the last few hours of your sleep are the ideal time to lose a dream your hormones are in the perfect position Right, you've got serotonin slowly rising in your bloodstream To make way for you waking up to get your consciousness and you know Prepare your mind to be alert and awake for the day But at the same time because you've had three or four state at sleep cycles where you've had your restorative deep sleep Your body is very relaxed your body temperature is still fairly low and You're still able to have these vivid dreams making it the perfect time to lose the dream now Most dreams happen during REM sleep, which is why it's the most important time to target is your last few hours of your REM sleep Which happens during the early hours of the morning, which is why you may have heard of the technique Wake back to bed essentially what you're doing is you're waking yourself up during that time to then go back to sleep and have a lucid drink Now that is how the sleep cycles sleep stages. That's how they all work in order to learn more about how to best target those those different stages and how to best utilize and for lucid dreaming I'm gonna save that for another video because I Just want to you know I think this video has gone on long enough and I The coffee in on my shelf there has been waiting for me for a good few minutes now, so I'm gonna cut it there Hopefully you understand and I'll see you next time Thanks for watching guys this video and this channel was supported by my patreon followers Please consider giving just a dollar a month to support this channel or just click the links in the description You'll find links to various lucid dream products articles techniques and tutorials if you did enjoy this video Please click the notification bell and subscribe and I'll see you next time Why are you still watching that you should have clicked one of my related videos by now right or subscribed or gone on to my website or something like that