Hey everyone, welcome to this webinar on the project updates of open source litmus and what are the new set of features that we have been working on and added on the open source product. My name is Shayan, I'm a senior software engineer at Harness and I've been closely working with the litmus open source project since the past two years and also mainly working on the litmus 2.0 and the features associated with it. Now before we move on just wanted to quickly add that we're really excited to do this and thank you for having us. The agenda for today is about the new features that we have added on litmus 2.0 and not just the core features since I'm pretty sure we have already heard about the product and looked at the features that litmus 2.0 comes with but rather the development features and the developer centric focus features that we have added to the open source platform and also we are going to take a look at two different use cases to help understand how litmus is actually being used in the world right now. How litmus is erupted by different clients. We are also going to finish it with a small demo where we'll be seeing how the new enhanced features of litmus can be put to use in a much in a commercial application. So before we jump into the new developer centric features that we have added just a quick refresher of what litmus is for all the new users out there. So litmus is a cross-cloud cloud native chaos engineering tool set or a framework you can also say that which helps not only SRAs but also developers and different personas. Any personas try out chaos with seamless integration and automation that will help you ease your chaos engineering journey. So you can choose different experiments you can create scenarios out of them and then you can run your workflows and do chaos in a much simpler way with the help of litmus. Now assuming some of the community users are present here and have already used litmus we are going to take a look at the developer centric and the developer focus features that we have added to help ease both the developers as well as the community users the community contributors that have been working closely with us. So previously we already had the ability to add probes but we have also worked upon that and improved the probe addition capability. So now you can also once once you've added a probe now you can also go ahead and edit the same probe. Previously we did not have the capability but now you can edit it like previously you have to delete the entire thing and then create a new thing which was quite a bit of a pain when you are thinking about constructing new probes and thinking of the hypothesis and doing the steady state validation with probes. So it's better that you get an edit option so now you do and you can change the probe types in the same edit feature so you can just completely change the probe all together with this new probe editing feature. We have also improved the tune workflow section when you customize the scenario so now you can also edit the sequences so let's say you have two or two or more than two experiments in in your same scenario then you can also go to edit sequence and then customize the sequence put them in serial put them in parallel based on your requirements you can also have a combination of both and also in the yaml section you can also update the same steps and that should be visually that should be visually visible in the edit sequence as well. There's also the option to go to the configuration wizard which is the pencil icon that you see on the different experiments in the table so there you will have the option to tune your environments give certain value to your environment which will be reflected to the kiosk engine and also at the bottom of the table you would also get advanced options so in there you can select the pod gc strategy if you want to clean out all the different pods post chaos and then also if you want to add tints and tolerations to your particular chaos experiments then you can also do that kind of advanced configuration to that. Third we have the ability to upgrade a chaos delegate so let's say you are on the latest version of litmus you're running your litmus workflows on the deployed with the latest version of litmus but the community has pushed a few you're a bit behind on the upgrade part so let's say the community has pushed a new feature a new upgrade of the chaos delegate so with the new versions of litmus what you would be able to notice is there's an upgrade option at the chaos delegate side so if you're on a latest deployed version of litmus and there's an upgrade available of your chaos delegate then litmus would suggest that you go ahead and update your chaos delegate to the latest version so if you're already on the latest version the button would be disabled but if you are not if you're a little lagging behind on the update then litmus will show you the option to upgrade your chaos delegate to the latest version. Next we have added a more secure rback with update to the api this rback security updates have been added about to the api as well as to the ui so this was mostly a bug addressed from reported from the community side which is addressed by us which is there are two rback permissions which is editor and the viewer so as a viewer you shouldn't be able to access certain pages certain apis certain you shouldn't be able to do certain perform operations as a viewer which where there was few leak cases where you would be able create a scenario or view and like go to the editing section of a particular workflow which you shouldn't be able to do as a viewer so those things were addressed and now we have added a more secure rback so now let's say a viewer is given the specific screen through different api calls even you wouldn't be able to do so because the rback checks are also added to the api so now the apis are hardened as well as the ui so now a viewer should not be able to view screens which are only accessible via the admin and the editor also there have been a request of adding the support of running or scheduling a basic argov workflows rather than just chaos workflows so previously we had the support of running different kinds of chaos workflows which were also argov workflows but we didn't have the support to clearly run a very stripped down simple version of a basic argov workflow so now we have modified the back end and we have added the support of just scheduling a basic argov workflow as well so if you directly take an argov workflow from argov and try to run it on our platform that should work as of now similarly once Kubernetes moved once Kubernetes updated to 1.22.0 and above there were a few apis there were a few manifests deployments that users from the community side were trying and they were unable to execute them because we didn't had support for 1.22.0 and above so we have also addressed that and currently we do support all communities versions on 1.22.0 and above we also added the support for ipv6 and to ensure that we have a better end-to-end capability end-to-end strictness of all the different builds and continually do this kind of deployments via nightly builds or via regular ci checks we have done that we have ensured we do better testing and we have added more e2e test suits to cover all aspects of this development so when we push or when we complete our work by the end of the day there's always multiple nightly builds happening so that it ensures and also it gives you the reports so that it ensures that you that you know the status of your deployments so we have also added the ability to skip SSL verification so let's say in case of applying a manifest or you are trying to connect an agent so if you want to skip the SSL verification there's very much an option to do so now so we have added a feature so you can just provide the flag and you should be able to you should have the ability to skip your SSL verification if your use case demands so now also for developers also for both the community developers as well as the developers in the core team you have improved the log functionality of the different servers that we use so that way whenever you encounter a bug or whenever you encounter a specific log that you're looking for let's say an agent connection or a subscriber connection so those log metrics have been enhanced so now you you'll be getting better events you'll be getting better results so that way you would be knowing what exactly went wrong or what exactly is happening so we have enhanced that part of logs both for the development as well as for the production setup for production when you visit the kiosk engine log so when you go to the show the workflow and you check the logs there the pod logs they have better highlighting so let's say if approves was resulted in success or failure or if the experiment the verdict everything resulted in success or failure you'll be having that individual line highlighted out as either green red or if it's a warning so those kind of things so we have taken measures to enhance the logs both for the production as well as for the development side now on the internal side we have also migrated the project collection that we use so the project collection was used mainly to store metadata of the project of of your litmus projects previously it was in the litmus database now we have shifted that to the authentication database and also apart from just this shift we have also done internal code refactor of the authentication server to enhance and improve security we have also added enhancements in the cmd probe specifically in the source tab so previously we had the option to provide source just as an inline source but with the latest updates we have added we have destructured it and we you can add images and host network separately as a part of the source configuration we have also hardened the litmus alpine images that were used in different litmus kiosk tools and also the e2e pipeline to monitor all the pipeline builds have been created so there's nightly bills and and and a whole e2e dashboard that you can explore where you can see the different builds for individual workflows for each of the experiments etc and also lastly we of course are working on new experiments so experiments like a gwz az experiment as your disc laws etc so those new different kind of experiments have also been added to the public kiosk now let's take a look at what ifood is what their company does and what was the use case that they switched to using litmus and how litmus is actually helping them with the challenges that they faced ifood is one of the most demanded latin-american online food ordering platform and they have they have delivered more than 60 million orders each month they do deliver more than 60 million orders each month it was founded in 2011 and it aimed to provide a better and a quicker solution for online food delivery with innovative systems so that user can order deliveries on the internet with no hassle and with ease of use so with over 80 percent of the market share geographically ifood covers most cities and regions in brazil especially in the brazil's financial center of sau Paulo now what were the exact challenges that were faced by ifood and why did they think that the solutions they had didn't really work out specific to their specific use cases now due to its growing popularity of course because they were serving such a huge amount of customers they decided to break their existing monolithic architecture into several microservices so that they can scale better so this decision of moving from monolithic to a microservice oriented architecture of course came with its came with its quirks but also came with much more complexity and additional costs so that was one why they were trying to look for solutions to handle this kind of complexities and to deal with resiliency the more and more they scale false like database services going out of business message brokers crashing and the entire region of cloud providers going down due to different kind of outages and also network bandwidth dropping without notice were definitely some of the challenges and these are like these are definitions of different outages that might happen to your systems to your applications so these were some of the major problems that ifood was facing in the latin america and they wanted to mitigate these challenges because the user base was growing and they wanted to give them a seamless access to their delivery platform now they decided to tighten up the reliability by continuously doing load tests and bare minimum chaos experiments but the solutions that they were using at the time lacked specific use case driven functionality so if they had certain scenarios in mind they wouldn't be able to do it but they will be able to target and do basic chaos but based on the problems mentioned above they wanted something some solutions which can tether to their specific use cases and also the ability to customize their own kind of scenarios based on their experience and use them automatically in an automated fashion so they also had the requirement to know which users perform what kind of chaos to enable a better r-back control and production so that let's say because chaos testing requires an amount of responsibility when you're doing it so they wanted to know which user is performing what kind of chaos because if they're doing it on production let's say on a specific environment and if something goes horribly wrong because it was specific chaos experiment then they would like to know which user performed what experiment and what was the scale of it what exactly did it target so those kind of things they wanted to know which user performed what and enable better r-back controls and the current chaos engineering solutions they were using was not really automated and it also had limited number of experiments but with the amount of ideas that i food had regarding the scenarios they wanted to create these kind of things they wanted to customize the experiments and eliminate manual cost as much as possible because they wanted to have these ideas created custom scenarios and also automate the same and have it running by itself rather than doing it manually so these were some of the challenges that they faced and one of the main challenges downtime which is why the thought came into their mind to switch to an automated chaos tool so what exactly would go wrong if you have downtimes right so right of the bat there's a loss of customer confidence which is the biggest let down if you have an application with a huge base of customer and there's a time there's even a slight amount of downtime you would have a loss of customer confidence and not to also mention the amount of costs that you might incur in that time frame so the average downtime for an outage is reported to be about 79 minutes and the average cost of these down times are about 84 thousand dollars so which is huge considering in that period of time let's say even if it's not 79 minutes even if it's five minutes in that five minutes millions of users could have ideally clicked on or wanted to get food or wanted to have something delivered or just wanted to check out your platform so that is the main thing when there's downtime so you have a huge amount of customer confidence that is lost also the damage to brand's integrity if if a certain outages faced by them so I would consider those two as the main points to note when you have downtimes now how litmus exactly is helping i food now litmus came in with the idea of providing a lot of chaos experiments which suited their requirements because litmus has the ability to add your own private hubs as well as the public hub which litmus has is also filled up with over 50 plus experiments so one of those experiments they can usually pick up and then add on top of it and it comes and it covers a range of different types of experiments so i food really liked that idea of having to customize something that they can use for their specific requirements because there were multiple options multiple areas that litmus were was touching so they went with a declarative approach which helped them customize these chaos experiments and then target the chaos engineer and target the chaos engine further to add their own ends and attune that specifically to their requirement and it must also give them the ability to find grain this are back controls by having integration with dex so they integrated with the authentication service called dex and authenticated users to litmus kiosk which restricted their services as a developer to target specific applications where they can inject kiosk so that gave them the ability to restrict certain users to perform certain activities and gave the are back level control that they were initially looking for we also gave them the ability to construct a workflow as a chron now because they wanted to automate and also and save manual labor because we have the option to even save it save the difference scenarios as a template for later use so that aided with easier automation and auto chaos even after specific intervals so that is one so that is one feature that they considered handy and that is something that is helping them to automate this entire process and remove manual labor as much as possible so yeah that was one of the stories that i food currently is using litmus for and to continue with the next use case and also the demo i would like to hand it over to nilanjan and he can guide you with the rest hello let us take a look at another end user use case halodoc halodoc is the most popular all around health care application in indonesia a rapidly growing startup founded in 2016 the mission is to simplify and bring quality health care across indonesia halodoc has partnered with more than 4,000 pharmacies in over 100 cities to bring medicine to people's doorsteps recently they have launched a premium appointment service that partners with more than 500 hospitals for booking their doctor appointments using the application the platform is composed of several microservices hosted across hybrid infrastructure elements mainly on a managed Kubernetes cloud with an intricately designed communication framework halodoc has leveraged AWS cloud services such as rds lambda ms3 and consumes a significant suit of open source tooling especially from the cncf landscape to support these core services while operating a platform of such scale where newer services are onboarded quite frequently it's quite plausible to encounter service downtimes due to unanticipated causes it's not an isolated incident where newly added services go down which eventually get mitigated after much effort that affects the team and end users in a system with the kind of dependencies that halodoc had it was prudent to test and measure service availability across a host of failure scenarios this needed to be done before going live and occasionally after it a bit in a more controlled manner hence chaos engineering was found suitable to supplement the existing qa with comprehensive automated test suits and periodic performance testing analysis to make the platform more robust the major requirements that halodoc chaos engineering practices sought to include first being kubernetes native halodoc uses kubernetes as the underlying platform for a majority of the business services including hosting tools that operate and manage observability across the fleet of clusters they also needed a chaos tool that could be deployed and managed on arm64 that is aws gravitron based kubernetes as well as the ability to express a chaos test in kubernetes's language that is resource yamls second being wide range of experiments considering the microservices span across several frameworks and languages such as java python c plus plus and golang it was vital to subject them to varied service level faults add to it the hybrid nature of the infrastructure varied aws services and the ability to target non kubernetes entities like cloud instances disks etc becomes clear furthermore the application developers were required to be able to build their own faults and integrate them into the suit and have them orchestrated in a similar fashion to the cloud native faults chaos scenario definition there was a need for full-fledged chaos scenarios that combined faults with some custom validation depending on the use case as the chaos tests were expected to run in an automated fashion after the initial experimentation or establishing a good fit halodoc also uses a variety of synthetic load tools mapped to the families of microservices in its test environment that they wanted to leverage as part of the chaos experiments to make it more effective and derive greater confidence security features the tight staging environments at halodoc are multi-user shared by environments accessed by dedicated service owners sre teams with frequent upgrade to their applications halodoc needed a tool with the ability to isolate the chaos view for respective teams with admin controls in place for the possible blast radius contain this allied with the standard security considerations around running the third-party containers were required absorpti hooks halodoc relies heavily on absorpti both for monitoring application or infrastructure behavior the stack includes new relic crometheus grafana elastic search etc as well as for reporting and analysis they use allure for test reports and light lighthouse for service analytics it was only judicious to choose a chaos framework that can provide with enough data to ingest in terms of logs metrics and events lastly community support halodoc saw value in an open source project that has a strong community around the tool with approachable maintenance who could see reasons in the issues raised and the proposed enhancements while keeping a welcoming environment for users who can contribute back hence halodoc chose litmus chaos which meant the requirement criterias to a great extent while having a roadmap and release cadence that align well to their needs and pace another reason for choosing litmus chaos is the github support which allowed for the automation of chaos experiments halodoc has also contributed towards better user experience in the chaos center and improving the security of the platform from them halodoc's initial efforts with litmus involved manually creating chaos engine custom resources targeting the application ports to verify their behavior this in itself proof beneficial with some interesting application behavior on earth in the development process eventually the experiments were crafted with right validations using litmus probes to form chaos workflow resources that can be invoked programmatically and automate the process of hypothesis validation during the chaos today these chaos workflows are stored in a dedicated grid repository a map to a respective application services via subscription mechanism and are triggered upon app upgrade via the litmus event tracker service residing within the staging cluster while the chaos experiments on staging are used as a gating mechanism for deployment into production the team at halodoc believes firmly in the merits of testing in production scheduled chaos experiments are used to conduct automated game days in the production environment with the mapping between the fault type and load conditions that are devised based on the usage and traffic patterns the results of these experiments are then fed into a data lake for further analysis by the development teams while the reports from the chaos center the control plane component of the litmus chaos especially those around comparisons of the resiliency score of scenarios are also leveraged for high-level views the personnel involved in creating or maintaining the and tracking the chaos tests on staging are largely developers and extended tech teams belonging to different verticals while the game days are exclusively carried out by the members of the sre team the upgrades to the of the chaos microservices on the clusters are carried out in much of the same fashion as any other tooling with the application undergoing standard scans and checks in the git lab pipelines with that we are all set for a demonstration of litmus where we'll see that how we can inject chaos into a kubernetes application to assess its resiliency see you in the demo hello there and welcome to the demo on litmus chaos but before we actually jump into creating some chaos as you can see i'm here in my chaos center i would like to bring your attention to the booty cap the booty cap is basically an e-commerce microservice application which is completely composed of kubernetes microservices you have your typical sections of an e-commerce application such as the different products that you can buy the product descriptions for each one of them and you also have something like a for cart for example where you would essentially store all the items that you are meaning to check out and pay for so what we are going to do today as part of our demo is basically we are going to inject some chaos within this booty application and see how does it face against the injected chaos to be more specific what we are going to do today is we are going to use our shatp chaos experiments which is one of the newly added chaos experiments and we'll target it against this particular cart service which is a microservice within the kubernetes and see what is its effect on our application before we actually jump to doing some of the chaos i would also like to show you this dashboard which is a grafana dashboard for our booty application as you can see right now the metrics that we can observe here in the dashboards are indicative of a normal system behavior we have a black box exporter which indicates the service endpoint is quite healthy and the probe success percentage for the same is 100 therefore and we can also see the queries per second of the cart lies somewhere in the range of 60 to 40 qps or ops basically which is indicative of a normal system behavior and the access duration or you can see the latency is also quite low right now which is in vicinity of somewhere 2.4 2.0 2.8 seconds which is quite normal so yeah with that we can actually go ahead and target our chaos within our application using an sttp chaos experiment to do so in my chaos center i'll first of all schedule a chaos scenario i'll choose the self agent that i have and go next then i'll choose chaos up because that's where my pod sttp latency experiment the sttp chaos experiments is situated then i'll go next and then we can name this cart chaos scenario since we are targeting the cart and over here we need to now add our experiment which happens to be pod sttp latency now that we have added our chaos experiments we just need to simply fill up this experiment in a way that we are specifying the exact details of our chaos so that the experiment can target the requisite pod and the resource that we are target that we want to target so for that i'll first of all go next over here and here in the application namespace we need to choose the namespace in which our booty applies so that happens to be litmus for now since we have installed it in the same namespace as of litmus chaos and for the application kind well it is a deployment the cart is present as a deployment here and if we check for the label we can see that the litmus chaos performs your kubernetes resource discovery so that it can fetch the label for our cart service over here so we'll choose app is equal to cart service now it's worth mentioning that we have only one pod under this deployment which we are going to target right now so let us see what would be the effect on our application when we are targeting the only present pod so we'll go next from here and at this point we can add a litmus probe so what is a litmus probe well for the initiator litmus probes are a way to automate the process of hypothesis validation in a simple and declarative manner what we are going to do is we are going to define a criteria for this probe and the probe will basically validate this criteria when we are injecting our kubernetes and this would allow us to validate whether that condition is fulfilled or not as part of this experiment and help us to determine the outcome of this experiment so to do so I'll first of all add a new probe I'll go for let's say a cart probe over here that's the name of the probe and it would be a type of an http probe which will be running in a continuous mode that is throughout the experiment in a continuous fashion before we fill up any of the probe properties I'll first of all try to bring your attention to what we are going to do as part of this http probe we are going to validate the endpoint of this cart of this cart here in the booty gap so we are just going to provide the url over here for the cart and the condition that we are going to enforce to be checked is we are expecting a response code of 200 whenever we are performing a get request so what would happen is that we'll be performing a http get request at this particular endpoint in a continuous fashion throughout the duration of the experiment now we can go ahead and specify a few probe properties that is what is the timeout after which the probe would timeout basically would fail so let us give this as three seconds and how many times shall we retry in an event where our probe is actually failing so we can set this as once we can retry once just to be sure and then what is the interval that we want to have between the successive probe iteration so we can see that this can be one so with that we are pretty much done with expressing our probe in a declarative fashion as we saw and that's all you need to basically to initialize a probe and check your application steady state conditions during the chaos so with that I'll add the probe and go next lastly in the last step we just need to specify a few environment parameters for the experiment so these are the parameters through which the experiment would run first is the total chaos duration so we'll be running this for a duration of 60 seconds which seems plausible and for the latency what I'll do is I'll add a very big latency which would essentially go ahead and block our HTTP request for this latency value and this is in milliseconds so I'm adding an HTTP latency of 80,000 milliseconds which appears to be very large so we'll see what happens when we are applying this large of a latency to this experiment also we need to provide our target service port so this is the port that we are targeting for that deployment service so let us try to see what this target service port looks like within our Kubernetes terminal that is using kubectl so what I'll do is I'll try to list down all the services that we have over here you can see that we have a cart service and the cart service has a port of 7070 so we'll be using this as our target port lastly I need to also specify our container runtime so I'm using a container d runtime so I'll just promptly go ahead and mention the container runtime as well as these socket paths with that we are ready to go ahead but not before we actually specify the ports affected percentage so this is the percentage of the ports that we are meaning to target so the minimum number of ports that this experiment will target is one and above that like whatever percentage we are specifying over here would be the would be the percentage that it will go ahead and target so I'll mention 50 over here 50% would essentially mean half of the ports that are as part of our deployment but since we have only one port right now so it would go ahead and target on the one part so with that we can finish up over here and I'll make reverts scheduled to false what this will do is that basically it won't delete any of the application or basically the experiment metadata that that is getting created during the experiment execution this includes all the ports or the workflow resources that we are having as part of the experiment so this would allow us to retain the logs so that we can view them with that I'll go next and we can specify a weight for our calculation of the resiliency score at the end of the test so we can keep it at 10 since we have only one chaos experiment and it doesn't really matter what weight we are providing here as we only have one experiment we can go next now and I'd like to schedule now next so this is the summary of our entire chaos experiment what we just created let us actually go ahead and create this chaos scenario so our chaos scenario has been successfully created over here as you can see it's running so let us actually wait for a while for the experiment to get initialized so you can see right now that the chaos experiment is getting installed the pod stdp latency experiment is getting installed right now as part of this step all right so with that our installation of the chaos experiment is over and now we can see that the pod latency stdp latency experiment has in fact started so what we can do is that we can verify whether this the effects of this experiment in real time using our observed dashboard that is the grafana dashboard you can see that due to the chaos annotation applied by the chaos exporter we are able to see the impact of the chaos here in the dashboard we can observe that due to the experiment running the qps is going up right now and this is only explainable due to the impact of the experiment what we are doing is we are essentially applying a very large latency on our on our card service application and therefore we can see that the access duration or the latency is increasing exponentially while the qps is also taking a hit you can see that the mean qps indicated in yellow is going up while the while the 99% or the immediate qps is in fact going down so this indicate that indeed our application is affected and to confirm that if we refresh our cards you can see that we don't really get a response from our application the response is still pending and we can see that it says something has failed and there are some logs and basically some information for debugging it says 500 internal server error which makes sense because we have essentially added a very large latency and right now the front end is not getting any information from the card and hence we are observing this error if we go back to our application dashboard right now we can see that the chaos duration has in fact passed and at this stage we can see that the experiment is effectively getting over we are right now in the post chaos stage where the chaos effect has been reverted hopefully and what we would like to right now understand is what this caused to our application what we saw in real time is that well our application is unavailable but during the chaos it's very much important to validate what it's happening in an automated fashion so for that let's first of all try to see whether our application has ended or not okay it's still going on let us first of all wait for the experiment to complete as we wait for our experiment to conclude we can see that the service metrics are again regaining a normal system behavior the access duration is going down the card qps is returning to its normal state somewhat and for for the black box exporter that is the probe success percentage that we have it's also getting back to a normal 100% as part of our experiment run we can see that it failed but before we analyze that why it failed and what does the log indicate let us try to actually refresh this page yeah you can see that the chaos has been in fact reverted we can see that there's no remnant of the 500 internal error that we were getting since the the effects of the chaos have been removed for now so if we go back to our chaos center let us try to analyze that what went wrong in this experimentation what this litmus has to say about it if we go inside the table view and try to view the logs and results we can see that we have all the experiment logs over here as part of our experiment logs of course we are first of all getting all the different experiment metrics for example the running pod over here this is the name of the pod that we are targeting card service then we are also seeing the run properties of the probe over here that is the timeout the interval or the retries everything is here after that we are in fact going for the actual experiment so in the course of time we can see that initially we were getting an actual value of 200 when the probe was running which makes sense before since before the chaos there was the service of working correctly and henceforth we were getting a 200 response code as expected but during the chaos well we didn't quite got a 200 response code which can be seen over here in this log it says that actual value is 500 which is not expected to the expected value of 200 and this is in sync with what we saw earlier in our application in the browser as well basically we saw that we are getting a 500 internal error and therefore this has been the cause of the failure of this experiment as you can see the probe status has failed and therefore the experiment has failed so this shows that how litmus can be leveraged litmus probes can be leveraged to automate the process of the hypothesis validation during the chaos and how you can use the logs for verifying the perfect cause of your failure of your experiment or passage of an experiment using litmus chaos we can also get a quick summary of the entire experiment using the chaos result where we can see that the experiment status is completed but the verdict is failed and the probe success percentage is zero for the probe that we have defined that is a card prop we can see that it says better luck next time for the continuous mode which means that well it has failed so with that we saw that how we can validate the experiment how we can use litmus chaos in order to validate our chaos experiments resiliency so we got the information and the validation that well something is not quite right our with our application and some component of it at least is weak so how can we make it more resilient in this case so the most perfect or plausible explanation could be we can just bump up the number of parts that we have as part of our application deployment so let us actually try to do that we have one part right now let's scale it up to maybe two parts and rerun this experiment and see how this experimentation goes then i'll go back to my terminal and what i'll do is i'll try to scale up the card service deployment which is the deployment enabling the card to two replicas let us try to determine whether the scaling is done or not using this watch command so as you can see right now the scaling is still going on the pod is getting created let us wait for a while for the scaling to complete all right with that we have now successfully scaled our card service deployment to two pods so now the question remains that what would be the behavior of the experiment in this case right now if we are targeting 50% of the pods that is only one out of the two pods will our application be able to sustain the chaos let us try to find out so for that what i'll do is i'll simply go to the chaos scenarios to the schedules over here we have the card chaos scenario schedule that we had created just now which we run as part of the earlier experimentation and i'll just simply rerun the schedule what this will in effect do is that it would rerun the same workflow that we created last time and it would run the same pod http chaos pod http latency chaos experiment once more this time around let us try to observe the effects of the chaos again using the application dashboard but before that let us wait for a while for the experiment to start all right with that our pod http latency has actually started so let us head back to our application dashboard the booty gap dashboard we can see that slowly our chaos experiment is taking place over here the chaos annotation is quite prominent over here but what we are observing here in this case is that so far our steady state seems to be maintained the probe success percentage for the endpoint of the card service seems to be stable there's no deviation in the probe success percentage and for the cards as well we can see a slight change in the qps that we have over here right now it's slightly varying in the range of 100 and our access duration service is also spiking up a bit it's in vicinity of 2.5 minutes right now which is not too bad so yeah it seems that the chaos is doing something to our application the qps is steadily increasing and the access duration the latency is kind of flattering out but yeah the most important question remains is the application still available so for that I'll simply refresh and as you can see this time around it's not going down we are not waiting for any response code or anything as such it's still accessible no matter what the application dashboard is showing to compare the result of the application dashboard I'll actually like to compare them side by side maybe with 15 minutes yeah so this time around you can see that although we observed a spike in the access duration for the card service it's much less compared to our earlier expectation it's almost half which makes sense because we have added one more probe and sorry we have added one more pod and that is mitigating the effects of the chaos in effect and therefore helping the application to sustain the chaos this allows for a much scalable and much more reliable solution around our chaos scenarios where even if one pod goes down there will be another pod which can sustain the chaos running at the same time so with that we can see that our chaos duration has essentially passed we can go back to our application right now and we can see that well even after removal of the chaos everything is fine everything is working in order and we can wait for our chaos experiment to complete to observe its effect and as you can see the chaos experiment is this time around it's completed time around it's completed over here so let us try to observe the logs this time although we can already see that it has passed but let us try to still validate using the logs and the chaos result if we take a look at the logs this time around we can see that of course before the experiment as well we were getting an expected value of 200 as well as actual value of 200 that is the response code which makes sense and this time around every time we are performing this check we're always getting a 200 response code and there is no response time out this time that is we are right on track with what we observed within the browser as well for the application when we were refreshing the website was available throughout the experiment duration and as a result of this our probe has in fact passed as you can see the card probe has passed and this in turn made ensured that our application our experiment is passing we can observe the same from our chaos results as you can see over here the experiment status is completed while the verdict is passed with the probe success percentage of 100 since we had only one probe and it passed therefore the probe success percentage is 100 and the continuous probe that we had defined by the name of card probe it has passed so yeah with that we conclude the demonstration of litmus chaos we saw that how we can use the shtp chaos latency to validate the behavior of a kubernetes application when we are applying a latency of of a value to our kubernetes uh microservice and we also saw that how you can define litmus probes within the litmus chaos experiments in order to automate the process of hypothesis validation during the chaos with that i'd like to wrap up this demo thank you so much


leg two it must be Wednesday we're in Dunedin heading for Omeru and back to Dunedin tonight for Park Firmé overnight eight stages 138 Ks of specials and about 320 of touring story of the day is whether or not Glen Inkster who was servicing overnight and back in the event can stay ahead of Gavin Richers who is leading two-wheel drive but challenging for the lead overall


Everyone, Taryn Elmendars, I work at Pantheon, but I am the lead of the Drupal Diversity Inclusion Initiative. Thank you so much for coming out today for the session in Equity and Isolation. It's about inclusive practices for remote teams. And thank you again for giving me the space to wear all the hats. This is me. You can follow me on Drupal.org. My name's Nine Lives Black Cat. I did not know at my first DrupalCon that they would be printing my gamer tag on my badge, but it's all right. Yes, my name is Taryn. So it's like Karen, but with a T. And what's the letter? Yeah, two extra letters. My name on GitHub is actually Karen with a T. So it helps people learn how to pronounce it. All of the fiascoes today. So the slide that was up previously was discussing how the old workplace is dead. We'll get this slide back up for y'all here in a moment. But the old model in which we used to work, where folks were not allowed necessarily to work remotely, pre-COVID-19 has gone away, just like my presentation just said. Can I have some help? Maybe. Sorry. It's not wanting to cooperate. No, it doesn't. It's helping out. Maybe I can hold it. Oh, gosh. And then for some reason, I am not on the Wi-Fi. That is not one of the same one. OK. Now it's asking me for the password, triple com? Yes, all our case. Yes. One day we're going to get this up. Also, if you would like to ask me about anything that we are able to talk about in the next 15 minutes, I will be in the ballroom, table permitting. And I know we just had 25 minutes for this. But we're going to get through it together, because we're a community. So the old workplace is dead. We are no longer selling people, hey, city employee who works for the city of Dallas who will not be named, your job as a web developer cannot be done from home. That entire department had to shift from work from home because people still needed to retire, services that the city still needed to be rendered, and we had a job to do. Employees are very eager to continue working remotely, or hybrid. Thank you. This is what I get for being five foot nine. According to FlexJobs' 10th annual survey, 58% of the respondents reported that they want to be full-time. They want to be remote employees. We keep seeing all the thin pieces about quiet quitting, and the return to office is now. Employees aren't having it. So it was all for remote work. However, there are some stipulations to that. You can't just say, hey, here's a laptop. Here's maybe a mouse. Have at it. Do your job, especially when you're working with diverse groups of people. You never know the types of situations that they're in. I work for Pantheon, but I volunteer with a group called the Texas Organizing Project. And one of the things that they had to do was recognize that the internet that their employees might have had at home to check emails was not strong enough, in the United States at least, to be able to support Zoom conversations going on with dozens and dozens of people trying to make sure that they had their voting rights. Something that is important for us to consider, especially when you're looking at diversity and inclusion, is that remote work impacts the careers of different genders in different ways. There's a decorative picture on the right-hand side of the slide with people in different colors and illustrating a rudimentary concept of the gender spectrum. Men and women who work remotely do agree that they are more productive, and they tend to work more hours. Women reported that they feel more productive than men do. Female remote workers said that they are most concerned about having to work longer hours and having fewer opportunities to network and form relationships. Now, for men, that impact is different. They felt, and these are generalizations, broad generalizations talking to people about a lot of the ways that they are socialized and accepted in their workplaces. Men feel that their managers will view them negatively about working from home, that they're not as much of a team player, that they're not contributing, which would result in poor performance evaluations. This slide shows the ways that folks differ. They both feel that their productivity increase, that remote work allows them to stay in the workforce. Women who are in the darker shade on the left-hand side of the middle graph, apologies. This graph did not have very much contrast. Women feel like they had 13% more. That's a different number, 7% more opportunity to stay in the workforce, especially with how care responsibilities generally get put onto people who are socialized as women. And there are more women who feel like they will not have the opportunity to form strong work relationships. Now, this slide has a bunch of different colors. I'm trying to get better at how we put this into words just to talk about it. This is about people from different race groups. So these are some generalized groups of folks where we're looking at how people look at different opportunities. For Asian-Americans and Asian folks, they feel like 39% of that group will have fewer networking opportunities. Now, for Hispanic and Latino people, that number is as low as 12%. I will make sure that these slides are available so that we can talk about data in other conversations, because I know that y'all are wanting to know how can we make sure that we're more inclusive. Now, one thing that is interesting about these numbers, on the right-hand side, we're seeing that for Caucasian, Black, and mixed ethnicity groups, they feel that they have the most productivity. There was actually a study that came forward from Bloomberg and it said over the past year, Black workers who are in knowledge roles, like graphic design, data analysts, they feel like they're treated more fairly and value their coworkers more when they're able to do remote work. Anybody wanna take a quick guess at why that might be? It's okay. So what happens is that when you're in a workplace, sometimes you have to deal with unnecessary microaggressions and it can be from any group, right? This one is just in particular about Black workers, but they felt like they had to deal with more things that were more about the in-group that they belong to, that they were born in and not able to focus on their work. I don't have to answer nearly as many questions about why my hair is different today. I have raids today, y'all saw my other pictures. Some days I don't wanna put on a wig, but I can still get my job done. So many groups are benefiting from work from home arrangements. A lot of people think about people in wheelchairs when we think about disabilities. However, there are a lot of people that have invisible disabilities that are able to take the time to rest, relax, refresh themselves and still get their jobs done. One thing that is important to note is that with the COVID-19 pandemic, we are seeing increased numbers of people that are diagnosed with things like long COVID, long-term disabilities, and being able to work from home allows us to have more accommodations, embrace people for who they are, what they can do in the moment that they can and be human beings, honestly. Now, I did a talk at a nonprofit summit. One thing that is a particular note is that in the nonprofit workforce, women actually make up the majority of the nonprofit workforce. They are also generally classist caregivers. This group is often tasked with lots of mentally taxing labor, and in the nonprofit industry, we're paid less. Coming from a government worker formerly, that paychecks a lot less, especially in America, at least when they take your pension out, but at least we got a pension at that job. We won't talk about American retirement. I've got about nine minutes. However, like I said, you can't just send someone a laptop or say, hey, we got a women's group at work, at virtual work. Just granting someone access is not inclusion or equity. How can we do better? How can we make sure that we're supporting people? One thing to note is that not everyone has an equal opportunity to participate in remote work, at least in the United States where I'm from, and I looked up some stats, but I'm not gonna be able to do them because I was five minutes late to my own talk. In the United States, because of the nature of how work is distributed amongst different classes of people, people who are not college educated, who are black and Latino, are less likely to work jobs that can be done remotely. Personal share, my husband at the beginning of the pandemic worked for a ride share operator, high-scale ride share operator, but he has high blood pressure. So when it was disproportionately killing Latino men, we decided, hey, it's probably safe for you to work from home, and by that I meant make cool food. He didn't have to work for a while because I'd rather him be at home and pay extra bills than for him to be dead. But how do we do better as a society? So this challenge, number one, the home work environment might not be suited for work from home. This could be for any number of reasons. We've talked about the internet. Some people have roommates or family members that they're living with. People are feeling less connected from their coworkers. You might have someone that's less technologically savvy. Now when I was working in the office, no matter where I was, whether it was at the city or in a financial district, I'm a web developer, but sometimes my stuff breaks and I don't know how to fix it. What is it, Star Trek? I'm a web developer, not a computer operator, Jim. Star Trek, sorry, I'm also a nerd. You don't have Gary down the hall to say, hey, my iPhone, which I really don't understand, or thank you so much for the assistance of moderated folks, two minutes, all right, cool. I don't have somebody to say, hey, my MacBook's not working correctly. Can you look at it? Because I can't do a Zoom call if I can't get into my MacBook, right? The groups that are particularly hit by this particular challenge, particular twice, three times now, are low-income workers and workers in rural areas. I have seen some beautiful images of the rural areas in the EU. I'm not sure how the internet connectivity situation is out here. Maybe y'all have better satellite internet than we do. That would be very cool. I tend to think that Europe is just like internet and trains and amazing opportunities, sorry. This is my first time in the EU, so I'm just very excited to see everything. The impact of this challenge is having poor meeting quality, people are unable to work remotely. You can mitigate this by having tech stipends that allows your workers to pay for your workers' teammates. Your teammates, you pay for better internet access, you can get them equipment stipends so they can have the laptops that they need. A lot of folks do not have a computer in the home in impoverished groups, so expecting them to wait for their first check to be able to buy the system that they need to work on your sites, not happening. Also, these are tax deductible, those distributions for the tech stipends, we can talk more about that. Another challenge is onboarding and culture and social norms. You can pick that up a lot when you're in office, but when it's just you and your dog, Mojo, hanging out, doing Zoom calls, not so much. There are not as many opportunities to just run into people in hallways and sometimes employers don't promote this. What you can do, this impacts your new hires, right? They're part of your diverse groups and people who have not previously worked remotely. Jan might be very good at their job when they're in an office setting, but if they hadn't worked remotely before, they're not sure how often should I check in. For this mitigation, you create mentorship and networking programs. You can have some mandatory programs and I see that because if it's optional, people might be afraid to opt into that worrying that they're wasting time, that they're not being productive, that they're not doing their work, learning how to do your work is part of your work. And a lot of people that are in marginalized groups need to hear that message, they need to hear it often, they need to have it repeated. You're not lodging in them with it, you're just pushing the impact and support. Most importantly, it cannot just be talked about, it has to be understood by everybody in the company culture why that's important and why it's critical to organizational culture and success. And finally, this challenge, having less chances of incidental mentorship and growth opportunities, just like how I can't run down the hall and ask, it was scary, I can't ask Gary how to fix my iPhone. Well, I can't run into Stu in the coffee area and ask her, hey, Stu, how did you get this report done? I'm working on mine and it's very difficult or even hear about new opportunities that way. Impacted groups, as we saw earlier, lots of Asian women experience this and are worried about this. This is especially troublesome for people from marginalized backgrounds, especially from if you are the first person in your generation to go to college or university, you don't have that model to copy, you don't have a peer group to be able to ask. To mitigate this, you can create mentorship and networking programs. Again, these can be mandatory programs, I really think that they should be promoted and encouraged and there's a lot of research that has it, I can send out things about that, but it makes sure that folks know, yes, we need to get a website out and we need to get a website launched, but as we say at Pantheon, web operations is a team sport, we're all gonna achieve this by working together and supporting each other and it's part of the job. So those are the talking points that I had for this at the other DrupalCon, we had some time to have discussions, but I will be here as long as y'all need me to and if somebody else is here, I'll leave the room and we can go on to a buff, so thank you so much.


The two Democratic candidates vying to replace Senator John Kerry's Senate Seat squared off in a debate Wednesday night, moderated by Boston University professor, R. D. Saul. Stephen Lynch and Ed Markey used the half hour to cover topics ranging from gay marriage to the economy to Obamacare. The vote for President Obama's health care bill was the proudest vote of my career. Lynch, who voted against Obamacare, accused Markey of backtracking. You're supporting repeal of sections of the Affordable Care Act that you voted for because now you realize that the medical device tax is killing our manufacturers in the state. The candidates also touched on the important issue of a woman's right to an abortion. For 30 years, I have been a consistent supporter of a woman's right to choose. When key votes like the Stupak Amendment comes up on the floor of the House just three years ago that would deny a woman insurance coverage so that abortion would be covered from an insurance company perspective, I made sure that I voted against that amendment. Steve voted for it. Lynch fought back and clarified his position. I refer to myself. I consider myself pro-life. I know I've read recently and heard recently that I'm not pro-life or I'm not pro-life enough. Attacking Roe v. Wade won't make abortions go away. It'll just change the setting from a clinical setting to one that's much more dangerous for women. Many supporters of both candidates gathered outside of the debate. Markey tried to remain focused on the issues to secure the nomination in the primary. I think the driving issues, women's reproductive rights, health care, innovation, economy, the issue of gun control and my actual successful work in the past on banning Chinese assault weapons. I think they're going to be looking for someone who can go to the Senate and be effective and effective immediately. Lynch has the support of the iron workers and the firefighters but still trails by nearly 11 points in the latest poll. He said that encourages him to work harder. I always feel like I'm an adult but I like that. I've had three of these special elections and this is probably the best I've been doing, any of those elections and I won all three. So I guess I'm more comfortable in the underdog role after you've been there for a while. I'm always outspent but I'm never out hustled. The Democratic candidates discussed many issues tonight. There's still more time for debate and discussion. Not until April 30th, the general election at the end of June at the WCVB studios and Mike Knapp for Boston University News Service.


Thank you for attending this session. I'm glad to be here, to present kind of sociological study with the permission of chair of this session. The other of this study couldn't be here and I'm here today to present on her behalf. I'm here to present about the attitudes and awareness towards sexual reproductive health in Iran and in the city of Tehran, the capital of Iran. Even talking about sexual matters in Iran is considered as taboos and the previous studies in Iran show that sexual health programs is bounded for married people and limited to contraceptive, prenatal care, pregnancy, childbirth and breastfeeding. And the previous studies shows that educational services in the field of sexual health are not provided in government centers and in private


So yeah, next up we have pandas. So pandas builds on the NumPy things. So under the hood, pandas is using NumPy and it lets you do a lot more high level operations. So here we have my colleagues who can introduce themselves and take it away. All right. Hello, I am Marine van Vliet. And I'm a research fellow at Aalto University. And well, I use Python and I also use pandas a lot for my research, which is in neuroscience. And with me co-teaching today, we have Jarno. Hey. Good luck today. So you've all seen me already today. Hey, again. That's great. So, Marine, can you tell me what is pandas? Yes, let's dive right in. So pandas, what you need to know about this is that it's all about tables. So up to now we've been mostly working with NumPy. And NumPy really deals with these huge grids, uniform grids of numbers. And that's the kind of data that you will get out of some measurement device like a telescope or a large Hadron collider or something, fields of numbers. Pandas is what you use when you have the sort of data that is more like the data you get from a database. For example, a list of all the books in the library or the passenger manifesto of a large passenger ship, as we will see. And I think the best way to show what pandas is and what it does is just to load up some data and look at it a little bit through the eyes of pandas. So I'm gonna ask Yarno now to get a notebook ready. Okay. You're of course free to follow along everyone watching or just watch Yarno. So we get some data into pandas. So maybe first import pandas. Yeah, so the first thing I'll do is import pandas as PD. I guess that's the standard name. Yeah, that's what people usually use just like NP for NumPy pandas is PD. And let's load some data. And pandas is very good with handling CSV data comma separated values. And it can even read data just by putting a URL in there. So this is what is shown here in the lecture notes below. We just have the CSV file as a URL there. And so this is a file that is a URL that actually points to a CSV file online. Yeah. And then I just typed. So you just use one of pandas many data import functions. And this one is cool. So let's do read CSV for read. So we have read CSV file and the file is called Titanic. So I'm calling it Titanic here. Okay. Oh, oops. I need to put URL as a parameter and see what happens. Now it's in Titanic. Now I have something called Titanic. Should I just take a look? Yeah, just type it in and let's see. So the third thing you will notice is that Jupyter notebooks know how to show these pandas tables really pretty. So Jupyter notebook will render this as an HTML table. When you are in a text console you will get a nice text rendering of it. But here inside the browser we get a nice HTML rendering. And here you see a table. So pandas calls this a data frame. So maybe I should also start calling it a data frame but it is a table. And this data frame. So you see this is the passenger list of everyone who was on board the Titanic when it sank on its own journey. And so what I was saying about NumPy really being about grids of numbers, you see that with this data we don't only have numbers, we also have strings and we have both integers and floats and made the category data, it's all in there. So the way this is organized now is in this data frame is that this is a collection of columns and basically what pandas provides is a huge amount of tools to manipulate this data, to select this data and compute all kinds of stuff with this data. For example we can print some summary statistics. Do you like to try that, Jarnal? So say we want to get a quick overview of this data and let's use the describe method of this, so. Oh, okay. So describe Titanic.describe, okay. Let's see what that does. So, all right, that's a lot of things. Yeah, so what do you see, Jarnal? Well, there's 891 passengers but 891 survived, that doesn't seem right. No, well it's the count. It's the number of items you need. So some of these have missing values, age for example, but survive doesn't. Yeah, we have all the numbers, all the data for survive but not the age for every passenger. Then we have the mean, mean passenger ID, I guess it's not that meaningful, but the value is actually, that is an interesting number. It's the survival rate on the ship. 30, I mean age, might be interesting. Then there is standard deviation. And all kinds of other things. Okay, minimums. What do you call this in English? Percentiles. Percentiles, okay. And maximum, of course. Maximum age is 80. And you see that it computes these values for all the columns. And pandas is a lot about columns. So when you have a data frame in pandas, the data frame really is just a collection of columns. So these are kind of individual entries of data, individual people. And then these columns are what data there actually is for all of these people. Yes, each row here is a single passenger and each column tells us something about this passenger. And we can get, we can do all kinds of like more complicated data queries on this. For example, you can try two that are listed below. Well, let's try one. For example, can we compute for all the people who survived and all the people who did not survive? So let's split the data into survive and not survive and compute the mean age of them. So, okay. So the first thing we want to do is get who survived. Oh, yeah, we want to get the group of people who survived, let's say. Yeah. Let's do group by, or are you suggesting something else? Hopefully a demo, like look at the shiny stuff that pandas can do for us. See how easy this is. We're not gonna go deep now in how this works, but... Survived is one of the column names now. So we're taking all the different values of survived and creating, okay, this is a generic object. Okay, printing it doesn't tell you a lot. But then we can take the age column from that. Does printing this do anything? No, it's syntax error at the moment, because we forgot to call it. Okay, yes. It's still kind of series group. I mean, you can turn it into something that actually is printable, but it hasn't actually done the operation yet. It needs to know what to do. But now we are asking for a number, the mean. So we have taken the passengers who have survived, or we have rather grouped them by whether they have survived or not. So we have two groups, survived and not survived. And we have taken the age column only and are calculating the mean of that column. So let's see. It does a lot of work in a single line. So again, don't worry yet about exactly how each of these functions works. This is now the demo to show, okay, what kind of stuff can you do with pandas? So you can quickly compute this. This is not exactly what I was expecting. The average ages are very close to each other. That's true. So the old adage, women and children first, well. I guess more children survived. Yeah, but can you, yeah. So let's do the second one. So let's plot the entire age distribution. Maybe you can just copy paste this one. Okay, well, we could. Here's for histogram. So pandas also comes with some plotting. If I do this, we'll add a line break and break the flow of the code. Let's see. Okay, well, we did it wrong. Oh yeah. So pandas comes with two plotting functions as well. There, tomorrow we will look deeper into the plotting functionality of pandas and a companion library called Seaborn which provides much more visualization functions. Okay, so we have two plots. So here's zero and one. So that's for survived, whether they survived or not. Yeah, zero means they did not survive. And we're taking the age. Yeah. And then there's some details about the graph basically. But the important thing is, this is whether they survived. Well, whether they didn't survive with zero, survive this one. And then he's the age. Yeah, so did most of the children survive? Can you scroll down? There's a lot more children that survived than who didn't. But not all of them survived. No, some children, you know, he didn't. Okay, but so this is a way to see how pandas can quickly allow you to just do some data queries, answer these type of questions when you have a big table of just... I'm reading this wrong. So the first two columns are really the smallest children. And I guess, yeah, there is nobody here. So smallest ones, they just survived. Well, one is survived, right? And the first bar is ages, I don't know, zero to five or something? No? Yeah, if this is zero to five, well, zero to three. Yeah. All the children from zero to three survived. Oh, okay. Yeah. Yeah, that could be, okay, that's good. Okay, good to know. All right, but let's dial the back a bit. And let's get into it. So how do we actually, how does this work? How does this data manipulation work? So, okay, maybe go back to the data frame, to the table again. Okay, I'll... Okay, just... Okay, I'll do it again. All right. So, like I said, with pandas data frames, we're always looking at things in two dimensions. So we have rows and columns always, where the rows are the data points that we have, the observations that we have, and each column gives us some information about this data point. And a data frame like this is really a collection of columns. And you can see that by using the info method. The info method of a data frame, so now this Titanic object, it will show you some information of all the columns. So this is how pandas really sees this data set. And it sees it as a collection of, I think, 12 columns here. Yeah, zero to 11. Yeah. And note that even though we have different data types, we have numbers and text in the column side by side, inside a single column, all the data is the same. So inside a column, there can only be either numbers or text or only items with the same data type, which are the integer or floats or strings, text is object in this case. So this could be NumPy arrays. These are, in fact, NumPy arrays. It's column is stored as a NumPy array, but that's behind the scenes. So when we want to select data from this, because most of the queries, most of the things, well, common things you want to do, of course, the data is to select different type of, we have been doing, want to select only the people who survived or the people who did not survive and that sort of things. Let's first look at how to select a single column. Well, that's pretty easy because you can select it in the same way as you would select things from a Python dictionary. Okay, so that would be, well, the name of the column is a string. So I guess I put in a string. And we use, you used it here correctly, we use the square brackets. So square brackets in Python means select something out of a list or out of a dictionary or out of a NumPy array, square brackets. So also here, we use square brackets to select something from this data frame. So now this is a certain column. Now you only have the age column. There is another way to select things which may be useful to quickly show. If you don't want to type the square brackets and this quotation marks and all this stuff, there is a convenient shorthand. You can just write Titanic dot age. Yeah, so this is very sort of Pythonic way of doing things.  But when you're exploring data on the terminal and you're just typing out commands, this is sometimes really useful to just quickly select something. Okay, well, that's a column. Now the big question, how do we select rows? Okay, so should I just write try the name of the column? No, actually. Well, there are... I don't really have a name. If you show the table again, if you show the data frame, you think, and there's something I must tell you about this first. So all the columns have a name assigned to them. Yeah, that's much as it's obvious, all the columns are named. Actually, in pandas, also the rows have numbers. Well, they have numbers. The rows have names. That's what I'm talking about. But the names at the moment are zero and one and two. So that's a little bit not obvious that they're actually names assigned to them. So we didn't tell pandas to assign any specific names. So it's just assigned zero, one, two, and so on. And so on. So I think it will be more clear if we assign something else to the row name. So we set the name of the passenger and use them. So what was the function to do that? I could check it, but can you remind me? Set underscore index. Set index. Yes, and it's called set index because these row names, they are referred to in pandas as the index. We are indexing by name. If you know something about databases and for example, SQL databases, then the term index may mean something to you. It's something that you look up rows by. But in any case, it's the names of the rows. They are called the index. So this line will use the names of the passengers as the name column, so the name of the passenger. So I'm guessing it's very important here. Oh, it didn't print anything. So if there are two people with the same name, this would not work correctly. This would actually work. So the row names do not necessarily need to be unique. Oh, okay. The column names also I think do not need to be unique. It will be very confusing. So I think it's good practice to be very much aware. Do I have duplicate data here? But no, they don't need to be. But it's very convenient if they are. So now it's more obvious that rows have names because now they actually do have names. So now to get back to the questions, how do I select rows? Well, we can do it in two ways. We can select rows by their number, give me row number 15, or we can select it by their name. And maybe that's even more intuitive. So yeah, here in the lecture notes if you see now below at the screen, there are many different ways to select data, select rows. For example, we can select a row and a column together by their names. So maybe do that. So we see how old is. Tyntonic dot. So I want a row and a column. Yeah. Okay. Well, the at should do it. Yes. So let's take a column. So the downside of using the names, it is very clear that they are now names, but it is the downside is that they take a wild type. And I might make spelling mistakes. So yeah, I'm taking the age of Mr. Alilam. Yeah. No column. That is none. So it's not set, I guess. Let's see, I saw there is a... Can we try someone else? Heikinen mislaina. Is there a dot after miss? Yes. And is it MSS or just... It's the whole thing. Ah, that means it's not miss, it's misses. Okay. So it's set to 26. That's good. So now we can query single passengers. So if you want to... So that's the at localizer. Also note that it's a call it a localizer, not a function, because see, we don't use round brackets here. We're still using square brackets. It uses a bit of Python magic to be able to index this object in various ways. So it's kind of as if this at was an array or something like an array. Yes. So let's take a look at the other... So say we want all the information of miss the line at Heikinen as you finish, but... Yeah, that's why I chose the name. I can spell it. So let's just... For example, the lock one, the lock will give you a row of data. You can just do by name. So for lock, do I need the colon as in the... That's a slice syntax, sorry. No, let's not do that. So let's just... Just give it the name of a row. Yes. Yeah. So now we get all the information about miss liner. Yeah. Okay, so that's by name. And we can also do it by number. For example, what if we want rows five to 10 say? Okay. So now we don't use lock because lock is with by name. We use I lock, which means... Index. I is for index, I guess. You are right. Although the name is also called index. So maybe that is not... Yeah. It does not clarify as much as I was thinking it would. So that would be the first five rows. Yeah. This is easier to remember when you remember that it's for index. So this is the first five rows. So you could do all kinds of clever things. So if you want, for example, row... Actually the first six. Yeah. Row like three, five and six or something. You can also select with a list. So this is much like how you would slice a numpy. Well, it needs to be a list. You know, this is very much how you would slice a numpy object. True. Okay. I will give you the list. All right. So that will... So two ways to do this things. Okay. And now we get to a super useful thing. So now that we can select rows. I think what we want to do is we want to select rows based on some condition. So say we want all the people that are older than 70. Okay. So the syntax for selecting is the same but we want something in here that's somewhat different. Yeah. Actually, did we do this in numpy? I think we did. I think in numpy, we might also do this. So maybe first... So maybe you can do this in numpy. Yeah. So yeah, let's do what's inside first. Yeah. So can you select... So I select the column H. Maybe say that the H must be larger than 70. Yeah. So that's what this looks like. It takes the... Now you see the names because that is the... The index is the name of the row. That's the name. That's the name of the entry. But then the value is either true or false. It's mostly false here because most people... When are there... Of course, the value is in the H column is higher than 70. Yeah. And if I do 30, it will probably see some more. Yeah. There's some true values as well. But let's go back to 70. All right. So this is... So this now we can use as a mask like we did with the numpy arrays at the end of the numpy session. Yeah. So we can plug this into the selector syntax into the square brackets. Yes. Now we get the whole row for people who are older than 70. Yeah. And the H is here. Okay, yes. So now you've used to generate square brackets which are kind of magic. You could also use the iLock locator for this selector for this. So if you have Titanic.iLock, I think that should also work and then square brackets. I think it doesn't. Okay. Maybe that doesn't work. It really needs numbers. Okay. Or loc. Oh, loc does work. Okay. Because this was by name. So if we take just this, this is kind of weird. If we take just this, it has name and true or false. So loc takes names. Yes. Okay. And that's what it wants. So it's, but at least loc specifies we're interested in rows. We want to rows. Yeah. But this is true. Which maybe sometimes a bit more clear than just using square brackets. Because if you just use square brackets, appendix will try its best to figure out what you want. And so they're very powerful, but can also be a bit confusing when you do more complicated things with them. Okay. So we got queries like this. Okay. So now if all the people are 70s, could we, well, let's try one more before we go actually we should go to the exercise. I think. So you've now seen a bit how to, how to load data. You've seen how to select columns. You've seen how to select rows and rows based on some value for column. So all the people above 70, for example. So let's go to a quick exercise where you can try this yourself. And let's maybe take 10 minutes for this. You can find the exercise here in the lecture notes. So load some data, maybe have a look at the API reference for pandas or use the autocomplete feature to see what kinds of methods are available to you. You've already seen that we have a method called mean to compute the mean of values, but there are many, many others. And if you can, so try to compute the mean age of the first 10 passengers. So then you first need to slice by row, take 10 passengers and then use mean to compute the mean age of them. See if you can do that. Then if you have time left, we will take 10 minutes for this. You can compute, for example, the survival rate among passengers over and under the average rates. You can do a bit more complex queries on this data. Okay, so yeah, we'll be back. All right. There it is. 47 passed or 32. And let's pick up then. Good luck. Everyone, I've hoped you've managed to play a little with pandas, get the data inside and look around a little bit. Let's talk now a little bit about a section that's called tidy data. And this really is about a convention. So if you want to use the full power of pandas, you should organize your data a little bit in a way that fits nicely with this row and column structure of pandas. Most important thing about this is that in a tidy data set that it's variable in your data is its own column. So when we have a passenger of the Titanic that we have one row is a passenger and every variable, everything we know about this passenger is called a variable and is in one of the columns. So let's take a look at some data that is not organized like that. And let's see if we can reorganize it to be in this tidy data form. That may be the best way to explain it. So Jarno, can you execute that bit of code that is in there? So this bit of code will create a new data frame. Tomorrow we will get more into how do you actually create data frames from scratch? But if you want to sneak peek, this is how we do it. This creates a data frame, but it's not tidy. So this is some data about three runners who were running a race. And there also was a person with a stopwatch next to the track. And it's time to runners as they run 400 meters and then when they've run 800 meters, 1200 meters, 1500 meters, they took the time, they written them down. And this is now the data that we have. You see that 400, 800, 1200, 1500, those are now the names of our columns. What makes this data not tidy is that these column names, they actually are the values of a variable. We have a variable called distance. The distance that a runner ran. And this distance is either 400, 800, 1200, 1500. So let's reform up the data such that we really have the runner as a column. We have the distance that they run as a column and we have the time in which they ran the distance as a column. And so this is the natural way that people will probably write this data, but it is less machine readable. It's not as good for pandas or for most of the programs. No, it will start to limit this when we want to do certain queries. So because distance is not explicitly a variable here, it's just encoded in a column names, it becomes more tricky to do queries based on the distance. So say we want all the runners that, or we want to mean time that runners took to run, I don't know, 500 to 900 meters or something, those sort of queries that involve distance, or we want to plot time versus distance, for example, or that sort of thing. Yeah, let's make a variable called distance, sorry. Go ahead. Yeah, in the teaching materials, we now use one of pandas many, many data mangling functions. Also with this one, let's not get into the specifics of this one. So I recommend everyone read the documentation. There are so many ways to mangle the data. It will take weeks to sum them all up and go over all of them in depth. Just know that there are many. So if there's something you want to do with the data, chances are very good. There's a specific method that will do that for you and you can find it in the documentation. So pandas is really you have your data on one hand and you have the pandas documentation on the other hand, and this is how you use pandas. You always use it in the documentation. But here I'm choosing, I'm just choosing that the value runners will stay as it is. And I want to turn these values 400, 800 and 1,500 into a new variable called distance, I guess. Distance, yeah. Yes, and then what we do, yeah. What should happen? So there is a, I put some unnecessary parenthesis there. So there is a name for the column I create, but I also need a name for the row. Yeah, well, the column distance, this is where the numbers 400, 800, 1200, 1500 will go. But we also need a place to where all these values, other values go. What's this? Let's call the bottom key error runners. Oh, there's no column called runners with a capital T. No, because it's just runner. Okay, yes, okay. So it's probably clearer what this does after I actually run it, right? So runner remains, runner one, runner one again and so on. But then these numbers become the values of this distance column. Yeah, so now the values of these columns become the values of the time column. Yeah, so for example, if you now want runner two at 800 meters, right, that's now a separate row, runner two at 800 meters, run it in 160 seconds. This is the same date, it's not a way of looking at it, but now distance is a column of its own. So note that we want each column to be a variable. However, it's not necessary that each row is an individual runner, right? We have runner one, we have three rows corresponding now that tells us something about runner number one. So in the tidy data format, each column is a separate variable but each row does not have to be a specific runner or passenger of the Titanic or something anymore. So this is a bit more, a bit easier now. So let's... Okay, let's start from the beginning when I was typing. Yeah, let's wrap this up. So what do you want to do, Yarni? Let's do some query with the distance just to show how this now works. Okay, runner one. And I think you need parentheses, right? And let's say df will take the distance. And go fancy, now we, let's see. We take all the data for runner one, and now distance is bigger than 800. Let's see if this works. Let's work. Okay. Yeah. Okay, you, yeah, that's one query. We can, I guess the point was that we don't need to specify the runner. So, yeah. There's a parentheses missing. Oh, actually an extra one. Yeah. Yeah. And you can quickly do things like that. Yeah. Or, yeah, so now if you want, you can do the mean of that and that sort of things. So especially tomorrow we will look at plotting. So now if you want to, well, maybe you can quickly do it here. Let's make a quick line plot for the, I don't think we have it here right now. Okay. We may be able to improvise this. Plot time versus distance, for example. So let's make a plot where on the x axis we have time, and on the y axis we have distance. Um, is it pd? No, it's df.plot. df.plot. And then you give it two parameters and let's name them. So we do x equals what we want on the axis. And y, for example, time. Y equals, now the x and y are the x and y axis of the plot. Of the plot, yeah. Time is with a lower case t. Time, yes. There we go. And there we are. Now there's four runners at each time. So it looks a little bit weird as a time, as a line plot. Yeah, we can probably group them by, we can probably give the runners different colors, but now I would have to look at the documentation. So probably it's color equals runner or something, but I'm not quite sure. Okay. I mean, we don't have to do that. No, it's not, of course it wasn't. But, yeah. See, now I would also have to go to the documentation. So how do I- Yeah, there's much more than you can remember. But these sort of things would be more complicated. So these things are easier when all the variables are neatly, like one column is a single variable. And we don't have weird column names that are numbers. That's the main point of tidy data. Okay. So now you know a little bit about pandas, how data should be in there and how we do simple queries of them. So that's it for today's lesson on pandas. Tomorrow we will pick up with more complicated queries and a lot more about plotting. But for now, this is it. Thank you, Jarno, for your assistance. All right. Thank you. Does anybody know- Yeah. Of the teaching. How to plot runner as a color? Is there a preferred way to specify both rows and columns? I think you would do that with the lock. So maybe go, so we talked about the lock selector a little bit. And there we said, okay, you can use lock to select rows, but actually lock can also take two selectors and you can get both rows and columns in lock. Why do you manage to do it? Yeah. So that was, the question was to- So what if it was both- specific row and specific column, right? Oh, did we know that you still remember the name? Nope. Let's just stop and make it take one. So this is actually exactly the line I was starting to type. So if I want the row of Haken and Mislaina and the column age, I use the dot lock and then give, well, both of the values. First of all, and then the column. Yeah, these can also be slices, by the way. So you can take all the rows from Lina all the way to Mr. Lin or something. So beginning to Lina. Oh, yeah, yeah, everything until Lina. Yeah. And from age forward. Yeah, all the age to the rest, right? But I mean, in this particular database, the things aren't really that ordered. So I'm not sure if this makes sense. No, we can't do it. We'll make more sense if we would sort them by name first. Of course, right? Pen is of many stuff to sort today than in many different ways, as you can imagine. The easiest way to get the different plots for different runners was to use group by before calling the plot. And I don't actually need to have this time here that was unnecessary. Oh, that's, well, no, now it made more. Okay, it made three plots. That is an interesting reaction. Why did it do that? Okay. Yeah, so now we have the times. Which one was that? First one. Okay. Okay. Any other burning questions or shall we leave it for today? Maybe we all deserve to take a long break.


In the last video, we showed that Newtonian momentum, p equals mv, is not conserved in special relativity. Instead, we need to consider p equals gamma mv. So does this mean Newtonian momentum is wrong? Well, let's see what happens when v is much smaller than c. Well, in that case, gamma is approximately equal to 1, and our relativistic momentum reduces to p equals mv, the Newtonian case. So it's not that Newtonian momentum is wrong, per se. It's just that it's an approximation valid in a particular regime when our speed is much less than the speed of light. Relativistic momentum is also only valid in particular regimes. It works well in a lot of cases, but if you were to try and apply it to a black hole or to something on the quantum level where special relativity breaks down, then you'd find problems, and you'd have to consider a different expression. So what about if your velocity approaches c? Well, in that case, gamma is equal to 1 on 1 minus v squared on c squared, and approaches infinity. So in other words, if you're trying to move a massive object at the speed of light, you need to give it infinite momentum, which would require an infinite force. And this is why you can't accelerate anything to the speed of light. So now we know about relativistic momentum, let's derive an expression for relativistic energy. Force is defined as the rate of change of an object's momentum. Or writing that in terms of calculus, f equals dp by dt. So if you have an object with some initial momentum, and I apply a force to it for time t, its momentum at time t will be the initial momentum, p0, plus the force times time. Substituting in our expression for momentum, that's the gamma at time t times n times the velocity at time t. Or expanding gamma. So now let's solve this for velocity. Now this would be very tedious and difficult to do by hand, so we just shove that all into a computer, and it spits out this. So what does this mean? It means if we have an object of mass m, and an initial momentum p0, and we apply a force f for a time t, we plug those values into the right hand side, and then this tells us what velocity we end up with. Okay, so another expression you might remember is work is equal to force times distance. So now the work I do on an object is equal to the change in energy of that object, and the distance an object will travel is the integral of its velocity v over the time period. So we have delta e equals f times the integral of v. Or substituting in our expression for v, we get this. So let's assume we start off at time zero, and we finish at time capital T. Now to evaluate this integral, we just shove it into a computer, and it gives us this. Now this term over here is the momentum at time capital T, the momentum the object ends up with. So change in energy of an object is its final energy minus its initial energy. So maybe the first term here represents the final energy of the object, and the second term represents its initial energy. This would give us the formula that the energy at time t is the square root of m squared c to the 4 plus p squared c squared. Or in other words, squaring both sides and leaving the time dependence of energy and momentum implicit. E squared equals m squared c to the power 4 plus p squared c squared. So now we can't just directly believe this because we derived it using all sorts of things that we know from Newtonian mechanics. Work equals force times distance and f equals dp by dt. And at the moment we don't know if these hold up in special relativity or not. So what we do is we take this as a candidate and we go to experiment. We try and see does this equation seem to be valid? And what thousands and thousands of experiments have shown us is that yes, this is the equation for the energy of an object.


Ond i gweithio ar gyfer eu knosem iddynt yn sgol 있adwyd. Rydyn ni'n hoffi Whiteyys. Dw i gael gweithio ar y c rainingol gan y llwyddi, a ddim yn gwneud amwielio gyda'r hynny'r amser yn ddiweddar. Efallai'r rhai gwrs ni oedd yn y tŵr hynna gweithio oed. Efallai'n bwysig i ddim yn ddiweddar a llcarwch chi angen. Y wave kem yn lifted the D-class on to a rocks. A terech chi'n dwi weithio roli a gathbwyno. They were very cold, very scared. They could have been moshting to sea. They probably would have drowned if we hadn't got to them. Dwi'n hyffordd i gyda'r irth a pympl chwedeg i gael plant i ni chorion. Dwi'n hyffordd i hyffordd i hefyd, mae'n neud fi ddim yn falch byddwn i'n cael rydw prwy'r gadaf personal fi i bobl erill. I think probably the high point for me in terms of my career was doing the passion in Potalbut to be able to do a project that was so personal and so ambitious and so successful ultimately that it seemed to connect with so many people. It was quite an achievement. Cynllun ag y chyfnwyd y mam haes mawr i'w cynllun digon, lle mae pobl i fanc yn gallu dangos y cydnogau fi pobl i fanc eraill sydd yn lesbedd hoi yw deyrwyl ni'n trawswyl. People can and do make a difference. That's the golden thread which connects us all and that's why these St David awards are so important as a national celebration of the enduring power of individuals in their communities. It means the world to me to be nominated for a St David award amongst so many incredible Welsh men and women. It's awesome. I mean this absolutely from the bottom of my heart is to ever have an opportunity to represent this country, these people and this community. Also to absolutely acknowledge extraordinary work and activities so I think they're very important and I'm absolutely delighted to have been asked to present an award. It's my great pleasure. I can't tell you how very, very honoured I am and how happy I am. Diolch yn fawr i chi bryd. The winner is Rhiann Burke. I just want to thank you for believing in me, my family and to wish upon a star because we will make a difference. This country deserves it and the parents in this country deserve it too. So thank you.  So thank you. Thank you. Most importantly it's a way in which everybody who lives in our nation can look to reward people. People who do so much work in our community sometimes they ever know what they are sometimes but just to get them a bit of recognition and to show what other people are doing and show that they're an example to other communities across Wales.


The Naval Medical Center of San Diego hosts a three-day camp for its wheelchair basketball team, the World Cup. We do rec therapy as we provide opportunities to learn about adaptive sports and it helps them to re-engage in activities they enjoyed prior to injury. I think for the patients that are here at the Naval Medical Center in San Diego, shows them the ability they've got. It shows them the potential they've got, not just on the basketball court, but they can begin to look at how that potential can be moved from the basketball court into the rest of their lives. You know, everybody has the same mentality, you know, everybody's in combat, so it's pretty much everything I've learned in the Marine Corps, you know, I'm applying in wheelchair basketball. From Naval Medical Center in San Diego, I'm seeing a high young lead.