How to create your own consent forms using Canva. So this is a program that is absolutely free. I do pay for the pro Version of this but you do not have to the only reason I do is because I use this multiple times a day I use stock images all kinds of things But for the consent forms and a lot of things it's absolutely free So check them out for sure, but let me show you how to create a very easy one So all I did was as soon as I logged into Canva I put in the search word the search bar consent form all of these designs pop up So that's the nice thing. You don't have to create something from scratch. You can just pick something So let's just pick this one I'm just gonna click it and then you click customize the template But guess what even before I click customize look there's more things that pop up So you will start to see things you didn't even know you needed but then you're like oh that would be super cool Like for example a job application form. There's checklist. There's adoption forms You know all kinds of things, but let's go into this massage therapy client intake form And we're going to customize it for let's say a teeth whitening business So you might want to say something like so you just have to click and you can customize anything you want I'm just having a hard time clicking right now, but let's just try this first I guess so client intake form will that would be the same Let's say though you want to change The color of this you would then pick whatever color you want Let's say you want it to be pink Maybe a lighter pink or maybe you want it to be pink, but you want it to be not as pink You can go up to this plus sign right here and you can move this around as well to any color You like and see I want to change the text, but I can't so if you notice this happens What you have to do is there's something in front of it most likely so I'm going to click this again And I'm going to move it and then I can now Click on the text and I can change it. So let's say we want to do Teeth whitening, but what if you don't like this font? Well, guess what? You can highlight it and you can go up to the fonts here and change it to any font you like So let's just change it up completely You can look you can click anything you like and it's all right there I actually liked the one that they have I thought that looked the nicest So I'm just going to keep that what if you want to keep this pink down here now or you can move it back up It's totally up to you. So isn't that nice and then look at all of these different ones You can click and you can change what that actually says It says your therapist so you could say technician for a teeth whitening technician. I spelled that wrong There we go, and then you can change it up. Now. What if you liked everything that's here? But let's say you want to change a box color. So just go up here to change the color Let's say we want to change it to pink. Maybe we want every other box to be pink What I like about canva too is what if we did want every box to be pink But we don't want to have to click Individually look down here where it says change all from this green color to the pink. Well, yes We do so let's just change them all and that took a whole of one second, right? And then you can even change the bottom here to make it fit to your business Signature whatever you want to do. So that's a quick and easy way to make your very own client intake form now. Let's say You want to save this which I'm assuming you're going to want to I would change the title here so it's easier for you to find it later you go up to share and You go up to Download and then you pick do you want to save it as a image file a PDF if you're saving it as a form? I do suggest saving it as a PDF. It's just easier for printing That will make it easier to upload to your computer to your iPad to your tablet Or let's say you just simply want to post a picture of it on your social media on Instagram Facebook tick tock then you might want to save it as an image file So let's just say for the heck of it We're saving it as an image file And then you would just click download and it's going to download in like two seconds even less Right to your computer. So see you guys super easy. So have fun with that. Check it out at Canva comm Absolutely free to give them a try so have fun Let me know if you need anything and thank you so much for watching if this is helpful click like and that would be fantastic Click like to this video And if you haven't yet make sure to hit subscribe as well to see more videos Have fun you guys and I'll see you in the next one


whereas an election to the office of president was held on 12 August 2021 Pesuwan to article 47, 101 and 110 of the constitution of the Republic of Zambia whereas Mr. Hagainde Sami Hijilema was in the same election, duly elected as president of the Republic of Zambia now therefore the Honorable Acting Chief Justice of the Republic of Zambia Mr. Justice Mike Olmson the State Council invites the president-elect Mr. Hagainde Sami Hijilema to step forward and take his oath of office before the Honorable Acting Chief Justice, the president-elect sir Hagainde Sami Hijilema having been constitutionally elected to the office of the president of the Republic of Zambia do swear that I will faithfully and diligently discharge my duties and perform the functions in this high office that I will uphold and maintain the constitution and the laws of Zambia and that I will dedicate my abilities to the service and welfare of the people of Zambia without fear, favor or ill will so help me God his duty, the secretary cabinet sir invites His Excellency Dr. Edgar Chabualungu to the swearing-in table to officially hand over the instruments of power to the president Mr. Hagainde Hijilema the seventh president of Republic of Zambia and Commander-in-Chief of the Defense Force Your Excellency


This is the animation minute as always we start with jobs islands Vancouver studio is hiring for previous animators Lucid games here is hiring for senior animator real effects in Montreal is hiring you got animated position and other positions as well Steamroller animation is also looking for animators Heart Machine is also looking for lots of positions including tech anime Placeful the game works is looking for a frame animating pixel artists switching over to news You know, I like the threads by Edward here directors and actors another thread great stories Check it out new deal for animation is all over Twitter I did a quick recommendations video, but you can check out multiple tweets here I'm gonna put them here all links of course are in the description Check them out a lot to learn a lot to look at speaking of the industry don't do unpaid overtime I totally agree. There's a good threat make sure to read that and don't do it So she goes to this this is a CG mock-up of the map character from Wolf walkers. Come on That is super cool speaking of cool I'm always a big fan of 2d animation and also the effects look at that. I love that at the end is cool Speaking of cool anything with Lincoln Zelda on That is cool. I like that a lot cool design school colors That's super cute pre-order for a new book is out here design your own characters. It looks pretty cute That's nicely done Of course I put in the pre-order and the link is here as well both will be in the description This is super cool to look at that cool action cool characters Lots of contrast there. It's very cool. Check out the whole thing and speaking of animation. That is cool I like that keep on watching. This is Almost 40 seconds on what is this 40 seconds long lots of cool stuff check out that real Love stuff like this whenever you have breakdowns like that lining folds and muscles and color and all that stuff I love it Sonic Mania strap opening scene So much energy. I love that character. She's so super cute and in the sonic. Come on I got to show it that is also super cool. Saw the movie.  Definitely check it out and here's the final poster. Let's go down a little bit here Very cool and look at this one.  Check it out if you're into that and before I continue with more pixel art Look at this here. I have to start putting in more Lego designs. That is so cool Speaking of which this is cool. I love this one. I love the hoodie laces there Great nice curvature also neat pretty sure gonna pick up this one. You know, I have to put in pixel art You know, I love it, but when it zoomed in like this, it's so chunky. It's Delicious, I love it. I love this look forever and last but at least another cute little pixel animation. It's great I love that little mechanical look to it. It's so cool. All right. I'll leave it at that That's it for an animation minute. You can find it every Monday on my channel at 10 a.m


Pastor Lisago now using Cobra's snake to pray for people and anointed poison. The controversial Praetoria pastor Lisago Daniel Maggio of Rabbini Center Ministry Church in Chuanay has made headlines again in 2018, as he brought a live snake to church and used it to minister to his congregation during a church service. The pastor first made headlines when he made the congregants eat grass and followed it up with petrol, comparing drinking petrol to holy communion. Last week on Sunday he introduced a Cobra snake that he will be using to pray for people and the anointed snake poison that performs miracles, signs, wonders and heal every disease. You can see in the pictures the man of God holding a very dangerous snake Cobra that he claimed was given to him by Moses from the Bible when he went to heaven in December 2017 and Abraham was very pleased to see him in heaven. The snake is said to work exactly like undefeated Moses rod that turned to a snake in the Bible. In 2015, he told the Commission for the Promotion and Protection of the Rights of Cultural, Religious and Linguistic Communities Rights Commission, when I do things, it is no longer me but me and my master. I am led by the Holy Spirit.


Welcome back, today we will be looking at new lecture on response surface methodology. Again you might have come across this term when you are reading research papers or books on statistical design of experiments. This is a very popular tool and widely used in the industry. This is simply based on the concepts we have studied until now and involves an optimization exercise. So the purpose of any experimental work would be to identify optimum conditions for the production so that you want to either maximize the yield conversion to the desired product or minimize the power consumption or minimize the time required to complete the job. So these are all important optimization objectives and now we are adding a new dimension to our experimental design strategies. We were earlier looking at the issues like rotatability, spherical nature of the design, the scaled prediction variance, variance of the regression coefficients, the analysis of variance, the residual sum of squares, lack of fit and so on. The new dimension comes in the form of identifying the direction in which we do the experiments and obtain eventually the optimum conditions. We also have to ensure that the conditions we have reached are truly optimum. They are maximum conditions if you want to maximize our objective function or minimum conditions if you want to minimize our objective function. We also have mathematical tools available with us to indeed verify we have reached the optimum. And not for example a saddle point. When we start doing experiments we are really unsure where exactly the optimum conditions are. We cannot afford to wander in the wilderness of n dimensional experimental space in search for the optimum. A logical procedure is required to find the optimum conditions. So we do some preliminary experiments to get an idea about the features of the experimental design space. What do I mean by features of an experimental design space? We want to see in the design space of consideration whether only the main factors are contributing or there is interaction between the factors. We also want to see whether there is quadratic terms or curvature effects assuming importance even in our restricted design space. The curvature or quadratic effects manifest themselves in the form of x1 squared and x2 squared terms in the model equation. So we want to first check whether these terms are important. By restricting ourselves to a narrow design space initially we ensure that we get an idea about the features of the experiment without getting complicated by the curvature or quadratic terms. Even if interaction terms are not there it is well and good. So the response surface methodology deals with identifying the optimum settings of the factors in a systematic and planned fashion. So let us represent the process initially only in terms of the main factors x1 and x2. We are not considering the interaction between x1 and x2 and when interactions are not considered then even more complicated terms like x1 squared and x2 squared are not at all considered. But this is a simplified model we are starting with. But we have to ensure that our model is adequate or correct and the interaction terms and the quadratic terms are indeed not present. So here wire represents the response x1 is the independent variable 1 or the factor 1, x2 is the independent variable 2 and epsilon is the independent error term. Which is assumed to be normally distributed with mean 0 and constant variance sigma squared. We do not know sigma squared. So after we fit the model parameters the model is represented by y hat is equal to beta hat naught plus sigma equals 1 to 2 beta hat i xi. This is the prediction for any coordinate point in the experimental design space. So what is meant by the method of steepest ascent even though we generally talk about the method of steepest ascent you may also have to look at steepest descent as well. If your objective function is to maximize or if your exercise is to maximize the objective function then you are looking for the direction of steepest ascent and if your objective function involves minimization then you are looking for the direction of steepest descent. So what is steepest ascent? The steepest ascent method is a sequential process where we move in the direction of maximum increase in the response. And if minimization is required it is called as the method of steepest descent. So once we are in the preliminary region we want to move ahead then we have to move as rapidly or as quickly as possible in the direction where the response is increasing the fastest. So in that way we are hopeful that we would eventually reach the optimum condition as early as possible. So how to identify the direction of steepest ascent in maximization of the objective function problems. We want to look at the direction of steepest descent in the minimization of objective function problems. So let us look at process involving only two main factors there is no interaction between the two factors and you are having x1 represented as shown here and we assume that the scale for x2 is same as that for x1. And then what we do is we want to see how to progress the fastest where the response would be increasing very rapidly and you can see that these are response values. These are constant response values as long as they are in the black line the constant value is z is equal to 5. Then when you go to the next line this represents locus of all points where the response value is 15 this corresponds to 25 and this corresponds to 35. And as I said earlier the scales are the same on both axis and if you want to progress along the direction of steepest increase in the responses then we have to take a path which is perpendicular to the lines. And since only main factors are involved you are showing the response contours in the form of straight lines. If there were considerable interactions between the two parameters x1 and x2 the lines here would have become curves they would have been twisted because of the interaction effects. But fortunately as far as this model is concerned it is a simple one and it is an additive model where only the factors x1 and x2 influence the process. Even the interaction between the two factors x1 and x2 is negligible that is why the contours are straight lines and the direction of steepest ascent is given in terms of a line which is perpendicular to the constant value line. The direction of steepest ascent is the direction in which y hat increases most rapidly. It is taken as the line through the centre of the region of interest and normal to the fitted surface. The steps along the path are proportional to the regression coefficients modulus of beta hat i. So how do we take the steps along the path of the steepest ascent? Please note that the steps along the path are proportional to the regression coefficients. So we cannot assume equal importance to both the axis. For example if you are having two factors we are looking at a two dimensional space and we cannot say that if I move one step in the x1 direction I will also move one step in the y1 direction because each factor may not be contributing equally to the process response and hence it is clear that the direction of the steepest ascent would depend upon the relative importance of the two factors and the steps would be determined accordingly. So how long do we conduct the experiments along the direction of steepest ascent? Please note that we are conducting experiments along the direction of steepest ascent and we are not predicting the responses. So we conduct the experiments as long as the response values are increasing and a point may be reached where the values may begin to drop. So we have reached the conditions where the maximum response is obtained. Then we have to pause here a bit and then re-evaluate our experimental design strategy. So let us do this understanding of response surface methodology through an illustration. The problem statement goes like this, machine is used for production of powders of a certain size and the machine operates at constant speed and is fed with the material, it may be a rock or whatever. The production rate and kilograms per hour of the machine depends upon the power supply to the machine and the raw material feed rate. The data are presented in the coded format. So to obtain an idea about the experimental error, the experiments have been repeated at the geometric center of the design and the additional role of center points will be explained shortly. So we have the experimental data in coded format. They are given here x1, x2 and ykg per hour and x1, x2 are not having any units because they are coded variables and they are representing a 2 power 2 design as shown here, 1, 1, 1, minus 1, minus 1, minus 1, minus 1 settings and the responses are given here. And you also have the center points, repeats are carried out at the center points and these are the responses obtained from the 4 repeats. So we calculate the variance of the data obtained at the center points. So we essentially find the variance of 68, 65, 61 and 62 which comes out to be a whole number 10. And this is a measure of the error variance and it is denoted by sigma hat squared or estimated error variance sigma hat squared. So this is the estimation of the pure error only due to random factors. Now the conventional 2 power 2 factorial design is enhanced or augmented by 4 center points and the replicates of the center are used to estimate the experimental error and allow for checking for the adequacy of the first order model. It tells us whether a first order model we have proposed is sufficient or we need to consider the effects of curvature by the addition of the quadratic terms beta 1, 1 hat x1 squared or beta hat 1, 1 x1 squared and beta hat 2, 2 x2 squared. These represent the contributions from the quadratic effects. So let us see how to use the center runs to detect whether quadratic effects are significant or not. So before we do that let us fit the design based on the available data points. So the first order model which we get is of the form y hat is equal to beta hat naught plus sigma i is equal to 1 to 2 beta hat i xi. This first order model assumes that the variables x1 and x2 have only an additive effect on the response. So the first order model has center points, it can estimate the pure error. The first order model involving 4 factorial points will not only enable you to find the main effects but also to find the interaction because we are having 4 independent settings for a 2 power 2 design, we can find the intercept beta hat naught then we can find the contribution from factor 1 or the importance of contribution from factor 1 which is beta hat 1 and the importance of contribution from factor 2 is given from the beta hat 2 coefficient. So that makes it 3, we have 4 independent settings and so the remaining independent setting may be also used up in the calculation of the interaction term beta hat 1, 2. That means we are using 4 independent settings to find 4 parameters, we cannot estimate any more parameters from a 2 power 2 design. So even this limited design with the center points has enabled us to find a model with main factors and the interaction between the 2 main factors and also it has given us a good idea about the experimental error. Further the center points are invaluable in telling us whether quadratic effects are important or not. It cannot tell you exactly what those quadratic contributions are, it will only tell whether you need to consider the quadratic terms or you may at present omit the quadratic terms. So first let us look at the estimation of error before we go into the testing for the significance of the quadratic terms, let us do the simple things first which would be the estimation of the experimental error. Examples are very straightforward task, we have to just find the variance of the 4 center points. There are different ways of doing it, sigma xi-x bar whole square divided by n-1 or you may also do sigma xi square-sigma x whole square divided by n whole thing divided by n-1. Well you have come across these kind of calculations in the previous lectures, let us take the shortcut formula here. So sigma hat square is equal to 68 square plus 65 square plus 61 square plus 62 square, what are these points? These are nothing but the values obtained at the center, they are the repeat points at the center and 256 would be a sum of all these 4 observations. 68 plus 65 is so 133, 194, 194 plus 62 is 256, so that is what you have here and 4 would be the total number of repeats which is 1, 2, 3, 4 and then this 3 represents the degrees of freedom for the 4 data points. Since you are already calculating the mean from the 4 data points, we lose a degree of freedom there and we have only 3 as the degrees of freedom and we get sigma hat squared as 10. And how do you find the main and interaction effects? To do it in a very economical manner and universal manner, I would suggest you to adopt the regression approach. You have the x matrix and you have the y vector of responses or the experimental values obtained and you simply use the regression approach to identify the model parameters. That is very straightforward and if you have software like MATLAB or SyLAB or any software which can do these kind of matrix manipulations routinely, then the coefficients may be identified very quickly. But from a learning point of view, even for this design with the center points, we can identify the main effects and the interaction effects using the factorial design approach. We use the table of contrasts and from that we may identify the different effects. We know that once the effects are identified, the coefficients are estimated by dividing the effects by 2 because the effects represents the change from going from minus 1 coded value to plus 1 coded value, a jump of 2 units. But a regression equation involves the response when there is a change in one unit of a particular factor. So the effects are divided by 2 to get the coefficients. Either you use the regression approach or you may use the factorial approach to estimate the parameters. So if you want you can do these calculations since it is only a 2 power 2 design, you may do these very easily and you may verify whether the results you obtain are matching with the results which are going to be present. So when you look at the values, the main effect is having a value of 24. The main effect B is having a value of 30 and the interaction is having a value of 0 and the coefficient for the different effects or different factors rather are 12, 15 and 0. The sum of squares again may be easily calculated from the contrasts and they turn out to be 576 for A and 900 for B and for AB it is 0. We can now construct the ANOVA table and we have the degrees of freedom listed out here. Since we are having 4 repeats, we are having 3 degrees of freedom for the repeats and we found the mean square error or the variance as 10 and we also have the mean squares for factors AB and AB and so you have F0 value as 576 divided by 10 for AB is actually 0. So the probability P value comes out to be 1 for AB and so that tells us you can comprehensively reject the coefficient associated with the interaction between A and B but you can see that both effects A and B are highly significant because their P values are very small. The critical F value is given by F0.05 1, 3 and that turns out to be 10.13 and since these actual F values are much, much higher than the critical F value, they lie in the rejection region and hence you may reject the null hypothesis which states that the coefficient corresponding to factor A and the coefficient corresponding to factor B are both 0. So we reject the null hypothesis and say that both the factors are significant, only the insignificant factor is the interaction between the 2 factors A and B. So from the analysis of variance test from where we get the F and associated P values and perhaps even from visual inspection which is usually not trustworthy, it can be shown that the interaction term is currently unnecessary. If an interaction term were to be added, then we would have had an additional coefficient beta hat 1, 2 and that would have been present here but as far as this model goes, we can neglect the beta hat 1, 2 because the interaction effect is not significant. So finally we have the fitted model as y hat is equal to 63 plus 12 x1 plus 15 x2 and we can see that the coefficients are given here. So in the preliminary model, in the preliminary design the experiment, we have the model given as shown here. Now let us move on to the checks that are in place for the sufficiency of the linear model. We said that the quadratic effects may be actually important even in this preliminary design space and should we add beta hat 1, 1 x1 squared and beta hat 2, 2 x2 squared or we can get away without adding those model terms. That is what we have to check next. So what we do here is quite simple. We take the average of the 4 corner points of the factorial design y bar f and compare it with the average of the center point values y bar c. So if you go back to the table as shown here, so these are all the factorial points and these are the responses at the factorial points and these are all the center points and these are the values at the center points. So if you want to take the average y bar f, it would mean the average of the factorial points and that would be 150, 216, 216 plus 36 is 252. So 252 by 4 is 63 and this we saw as 133, 194, 256, 256 by 4 is 64. So the average of the factorial points is 63 and the average of the center points is 64. So the difference between the 2 is very small. So we can imagine that y bar f, the average of the factorial points is located close to y bar c which is the average of the center points. If you are going to have the second order effects or the quadratic effects important then what would have happened is the center points would have been located very far off from the factorial points. Then the average of the factorial points would have been quite different from the average of the center points. So if the averages between the center and factorial points are pretty much the same then we can understand intuitively that the center points are located very close to the plane containing the factorial points. In other words if you look at the model surface you do not see any strong peaks and valleys. So we were looking at the importance of the curvature terms. If you have strong curvature in your design space then the response surface would be characterized by peaks and valleys which would mean that if you are taking a plane of 4 points there may be a region in the center which is considerably at elevation with respect to the plane formed by the 4 points that shows that there is strong curvature and peak in this experimental design space. So we are having a center and then we have 4 factorial points. If the center point response is considerably different from the corner point responses then we may suspect the presence of peak or curvature in the design space between the factorial points and the center points. On the other hand if the center point values are comparable and very close to the 4 factorial points average then we may think that they are very close and we do not have any strong peak in the design space we have considered. So with this intuitive understanding we can carry out certain tests. So the first step is to find the difference between y bar f and y bar c. So if the difference between y bar f and y bar c is considerable then we can conclude that curvature effects may be important. What is the quadratic effects of the second order effects? If they are significant then the model should have in addition to the regular intercept main factors and then binary interaction it should also have beta hat 11 and beta hat 22. So what we are doing here is checking for the linear model sufficiency by estimating the quadratic effects. The quadratic effects are characterized by beta hat 11 and beta hat 22. With the current experimental design involving 4 factorial points and 4 center points we are unable to estimate beta hat 11 and beta hat 22 for the simple reason that we do not have sufficient degrees of freedom. So we are not in a position to estimate them explicitly. But we may have an idea of the importance of beta hat 11 plus beta hat 22 and that is given by the estimator y bar c minus y bar f. y bar c minus y bar f is acting as an estimator for beta 11 plus beta 22. So we can call y bar c minus y bar f as beta hat 11 plus beta hat 22. And so the difference between y bar c minus y bar f we saw from our calculations that it is 64 minus 63 and that is equal to 1. So an estimate of beta 11 plus beta 22 has been obtained from y bar c minus y bar f and that turns out to be 1. So the null hypothesis which involves the actual parameters are not the estimated ones. Please note that h naught is given by beta 11 plus beta 22 is equal to 0 and h1 is given by beta 11 plus beta 22 not equal to 0. So we are using the actual population parameters in our hypothesis statements and again to repeat y bar c minus y bar f is used as an estimator for the coefficients beta 11 and beta plus beta 22. So we can do a t test which is based upon the estimator y bar f minus y bar c minus the null hypothesis statement which says that beta 11 plus beta 22 is equal to 0 that is why we put 0 here and then we have the variance of y bar f minus y bar c. And this may be written as y bar f minus y bar c whole thing divided by sigma into root of 1 by nf plus 1 by nc where n is the number of factorial points and nc is the number of centre points and we can take convert this t test into an f test or convert the t statistic into an f statistic by squaring this term and we get f naught is equal to t naught squared which is y bar f minus y bar c whole squared divided by sigma squared into 1 by nf plus 1 by nc. So whatever we have studied in the first phase of this course hypothesis testing and important probability distributions we are making use now. And we do not know sigma squared but we have a easy solution for that we have repeats at the centre and we can use the mean square error as a surrogate value for sigma squared and we call that as a sigma hat squared. So now the variance is based on centre points and it may be substituted as an estimate for the error variance and so you have f naught is equal to y bar f minus y bar c whole squared by sigma hat squared into 1 by nf plus 1 by nc. So converting this into an f statistic we test the equivalent to the null hypothesis the numerator sum of squares degrees of freedom is 1 given by y bar f minus y bar c whole squared by 1 by nf plus 1 by nc is equivalent to the mean square error. So this f statistic is tested with 1 and nc minus 1 numerator and denominator degrees of freedom respectively. So how do you calculate the sum of squares of the pure quadratic? So when you simplify this particular expression which is given here we get nf into nc y bar f minus y bar c whole squared by nf plus nc which is number of factorial points 2 power 2 which is 4, number of centre points 4 and y bar f minus y bar c whole squared is 1 squared divided by 4 plus 4 which is 8 and that turns out to be 2. So when you divide the sum of squares of the pure quadratic by sigma hat squared we get 2 by 10 which is equal to 0.2. So the f value is 0.2 and this f value is associated with the p value of 0.685 which is very high and tells that the curvature term is insignificant because the p value is much higher than 0.05. So both the main effects are significant while the interaction and the pure curvature effects are not significant. So we can say that the model may be well represented by y hat is equal to 63 plus 12 x1 plus 15 x2. In order to find the direction of steepest ascent what we do is we convert this into x2 versus x1 form. When we do that we can show very easily that 15 x2 is y hat minus 12 x1 minus 63. So x2 is equal to minus 63 by 15 which is minus 4.2 and then you have for x1 minus 12 x1 by 15 which is minus 0.8 and then for y hat coefficient it will be simply 1 by 15 which turns out to be 0.06667. So what we have to do is use this equation to find the path of steepest ascent. So what we do here is we draw contour lines for constant y hat using this equation. We fix y hat at a certain value and then draw this line. Then we fix y hat at another value and draw another line. This way we can generate sufficient number of contour lines in the experimental design space of interest. And what is the slope M1 of this equation? The slope is given by minus 0.8 because we are plotting x2 versus x1 where y is a parameter and it is kept at different different values. So the main important defining relationship is between x2 and x1 and if I take the slope of this particular equation dx2 by dx1 would be equal to minus 0.8 and that is the slope. And if you want to find the direction normal to this slope then we have to find a slope which is bearing a relation M1 M2 is equal to minus 1. M1 is the slope of the original line, M2 is the slope of the new line in the direction of steepest ascent. To get the slope of the line in the direction of steepest ascent we have to find M2 and the relation is M1 M2 is equal to minus 1. Since M1 is known we can easily find out M2. So the slope M1 of this equation which was given before that is y hat is equal to 63 plus 12 x1 plus 15 x2 or x2 is minus 4.2 minus 0.8 x1 plus 0.06667. So the slope initially is minus 0.8 and we have to find the M2 the slope of the line of steepest ascent such that the relation M1 M2 is equal to minus 1 is satisfied. This equation comes in the normal calculations. So here we get M2 is equal to minus 1 by minus 0.8 which is 1.25. So here we are sketching the responses we are fixing different responses for y, y is 5, y is 30, y is 70 and y is 100. So these are different responses and you can see that for each of this response y there is a line. So for y is equal to 5 we have this line for y is equal to 30 we have this line for y is equal to 70 we have this line and y is equal to 100 we have this line. And all of these lines have a slope of minus 0.8. In order to identify the direction of steepest ascent we have to find a line with slope of 1.25 and the line is represented here. Since the scales are not the same in both x and y axis you can see that this line is not exactly perpendicular to the lines but it is slightly at an angle. But it still represents the direction of steepest ascent because it is drawn with the slope of M2 is equal to 1.25. So this is a close up view of the same figure which I showed previously and it can be seen that this is the path taken in the direction of steepest ascent and the slope of this particular line is 1.25. I am drawing this line starting from the centre of the design which is the origin and so you can see that for every one step I am taking along the x1 direction I am taking a step of 1.25 along the x2 direction. Now I have the direction of steepest ascent and please remember that the values are in the coded format. So persisting in the same coded format if I take a step of 1 unit along the x1 direction I take a step of 1.25 units along the y direction or x2 direction not the y direction y is the response. If I take a step of 1 unit along the x1 direction I take a step of 1.25 units along the x2 direction please note that the step sizes along each of the 2 directions need not be the same because the regression coefficients are different, there is a different weightage given for factor 1 and different weightage given for factor 2 and hence the direction of steepest ascent also has to respect this different weightages. And when you are doing experiments in real life please keep a track on your actual experimental value corresponding to the coded variables okay. When you are going along a direction of steepest ascent you are going 1.25 or 2.5 and so on. The response may be increasing all the time but you may not be able to go beyond a certain point for the simple reason because the pump would have saturated or the flow rate would have hit its maximum upper bound. So you have to stop at that particular point. So in some cases you cannot do experiments indefinitely until you get to the true optimum because you may hit a bound caused by the boundaries of your experimental design. You may not be able to cross the boundary for various practical reasons. So what I am trying to say here is when you are going along a particular direction in the coded format keep also a track on the actual values. We know that the coded format is done in order to put the factors independent of units and assign them equal importance. Now once you have a coded value you should also have the uncoded value. In one of my earlier lectures I have given you the formula for converting coded values into uncoded values and vice versa please refer to that. So when you are going along this direction of steepest ascent please make sure that you are not hitting a bound created by the constraints of your experimental program alright. And another important thing is in the direction of steepest ascent you are doing the experiments. You are not using the prediction model which you had developed earlier. The prediction model was carried out over a narrow design space and you ensured that there is no curvature effects present in that narrow design space. And then it also helped you to identify the path of the steepest ascent. So from that preliminary region you are going along the path of steepest ascent and that is helping you to proceed as quickly as possible. But once you have crossed that minus 1 plus 1 boundary corresponding to that narrow design space you should stop using the model prediction. You should actually perform experiments along the path of the steepest ascent and from the experimental responses decide when to stop okay. I have hit my bounds so I cannot go further on from here so I will stop or I am reaching an optimum response value and I will pause here to reevaluate my design strategy. So if you are lucky enough to get to the second stage where your response is showing an optimal value and then showing a maximum value and then declining you want to stop at that point and pause a bit and reevaluate your design strategy. So the experimenter has to meticulously do the experiment and measure the responses. He proceeds according to the table given in the next slide. The observed yield increases until a value of about 95 observed at 2.5 in the coded format and then starts decreasing. So that particular figure is as follows this is where you started and then when you proceed you find at the third step you are having a maximum value corresponding to about 95. And then the value start declining the production rate in kilograms per hour has reached maximum of 95 at about the third step. And remember that you are going for one unit along the x1 direction you are going 1.25 units along the x2 direction. So this is the point where you have to pause a bit and reevaluate your design strategy. So what we do is once you have reached that optimum location you will be having a new set of coordinates corresponding to that. There again you recode your experimental settings as –1 and –1 again this is very straightforward. So and this helps us to carry out the design on a uniform basis. So that we do not have odd numbers odd values like 1.27, 3.56 and so on we are always working with –1 plus 1. So whenever we adopt a new experimental design strategy we have to recode those experimental settings as a –1 plus 1 format. But we have to keep track on all the transformations. So at any point we should be able to convert the coded values into the actual uncoded experimental settings. That is what is of interest to the experimenter and these things are done very easily. I will just go to the board and tell you how the coding and uncoding is done. So the thing in coded form is very simple. This is the actual x value – x average divided by x max – x average. So let us say that you are having data points 30, 40 and 50 and if I am looking at 30 then it would be 30 minus average of 30, 40, 50 is 40 divided by max is 50 – 40 and this turns out to be 30 – 40 is – 10 divided by 10 which is – 1. Now when I am having 40 this is corresponding for x is equal to 30 this is – 1 coded value and for x is equal to 40 it is coded value is equal to 0 which is the center point for that particular x and for x is equal to 50 we have 50 – 40 divided by 50 – 40 which is plus 1 as the coded value. So for any experimental set of data we are able to convert it into minus 1 plus 1 coded format. So in the new so called optimum location we are again recoding our values and we get the responses as 85, 95 and 92.5. So at 2 and 2.5 we are getting the maximum response 95. So these values are now coded values and those coded values are 1, 2 and 3 okay this is the original coding. Now we have to recode these values as minus 1 so 1 will become a new minus 1, 2 will become a new 0 and 3 will become a new plus 1. Similarly 1.25 will become a new minus 1, 2.5 will become a new 0 and 3.75 will become a new plus 1. So the methodology I showed in the board can be adopted to code these values into minus 1 plus 1 format. So now we are in a new situation where we are hit a maximum. This itself indicates that there is a curvature and a peak and a valley kind of region in the new experimental design space. So a simple model involving the main factors and the interaction between the 2 main factors will be definitely insufficient. So we have to capture the quadratic terms or the peak and valley coefficients correctly and efficiently and for this reason we cannot stick with the original factorial design and the center points. We need to augment the original factorial design with axial locations. So we are now going in for the central composite design where we add axial points in addition to the existing factorial points and center points. And for 2 factors the axial points are located at plus or minus root 2, 0 and 0 plus or minus root 2 and this is the design matrix for the central composite design and you can see that in the recorded format we have the factorial points shown in green color. The axial points are shown in blue color and the center points shown in red color and when we do experiments at these conditions these are the production rates obtained. So at this point we can also show it graphically or in form of a figure. You can see that these were the factorial points and this represents the center points or the central points and then these represent the axial points and they are located at minus 1.414 plus 1.414 plus 1.414 and minus 1.414. So these are the axial points. So in addition to the factorial points and the center points we have the axial points and this represents the central composite design strategy. And what is the second order model we are testing with? The second order model we are testing is beta 0 plus beta 1 x1 plus beta 2 x2 plus beta 1 2 x1 x2, beta 1 1 x1 squared, beta 2 2 x2 squared plus the error term or the predicted expression or the prediction equation is given as y hat is equal to beta hat 0 plus beta hat 1 x1 plus beta hat 2 x2 plus beta hat 1 2 x1 x2 plus beta hat 1 1 x1 squared plus beta hat 2 2 x2 squared. So this completes our initial discussion on the response surface methodology. We will be looking at another example involving the central composite design and we will see how to estimate the beta hat 1 1 and beta hat 2 2 and we can also see whether these particular additional terms are significant or not and once we have done that we also have to locate the optimum condition. It is not enough that we identify the optimum condition we have to characterize the optimum condition also. First we have to tell whether we obtain the optimum condition is a maximum or a minimum. Sometimes it can even be neither you may be sitting on a saddle and there may not be any change in the value along a particular direction. So that may also happen we do not know and even though we may have hit a extreme minimum point we have to see whether it is a maximum or a minimum and some mathematical tools are available with this and we can use them. This is a very important aspect of experimental design and perhaps represents the ultimate point in experimental design strategies. So we have done experiments in a efficient manner, planned manner using factorial design concept and now we have added an additional dimension to the entire exercise by using design of experiments to find the optimum location. So we will continue in the next lecture with the suitable example involving the central composite design. Thanks for your attention.


Hello, and welcome to this first screencast for Math 123 Trigonometry, where we will discuss the definition of the circular functions, the cosine and sine functions. These will be the two primary functions that we will be working with throughout the course. The main thing we will use to make this definition is the so-called unit circle. We will place that circle with a center at the origin, and it has a radius of 1. There's a picture of the unit circle, and up at top you see the equation for that unit circle. The key idea is to measure the length of an arc along the circle. To do this, we always start our measurement at the point 1, 0. Now, if the arc has a positive direction, then we measure it, starting at the point 1, 0, and moving in a counterclockwise direction such as this. The arc will come and at a certain point there that will be called the terminal point of the arc, and generally we're going to use x, y to represent the coordinates of the terminal point of the arc. On the other hand, if the arc has a negative direction, we still start at the point 1, 0, but then we measure clockwise along the circle, so we might measure to place something like that. Now, a very important thing to remember is the circumference of the entire circle. If you recall, the circumference from the circle is equal to 2 pi times the radius. Since this circle has a radius of 1, it is a unit circle, we get a circumference of 2 pi. So if we go all the way around the circle one time, we will have an arc of length 2 pi. Other important points to keep in mind are kind of the points where the circle intersects the coordinate axes, which would be these four points that I'm drawing in there right now. And if we go one half of the way around the circle, then we have an arc of length pi, the one half of 2 pi. So the terminal point for an arc of length pi would be at the point minus 1, 0. And again, we can now divide this into quarters. And so an arc of length pi over 2 would finish up at that point right there. And an arc of length 3 pi over 2, which would be 3 quarters of the way around the circle, would end up at this point. So keep that in mind. In the next slide, we will show some arcs of special length, which are shown right here. These arcs all have our multiples of pi over 6 and pi over 4. So an arc of length pi over 6 would look something like that. And now if you can see if I can take certain multiples of pi over 6, such as 4 times pi over 6, we will get 4 sixth times pi. And if we reduce that fraction, 4 sixth is equal to 2 thirds, we get 2 thirds pi. So that's why you see something like 2 thirds pi there. That is a multiple of pi over 6. Some of the other ones, it's easier to see such as 7 pi over 6. And the pi over 3 one such as 5 pi over 3 is actually 10 times the multiple pi over 6. And again, if you work with that fraction, you get 10 sixth pi. And now we divide both numerator and denominator by 2 and we get 5 thirds pi. So that would correspond to that point there. It would go all the way around the circle to that point there. We also, as I said, we measure arcs in the negative direction as well. And those arcs are shown in the next slide. And you can see the measurements are pretty much the same except we're going in the negative direction. So again, you see minus 2 pi over 3 and you'll see minus 5 pi over 3 as we saw before. And again, this time the minus pi over 3 arc goes all the way around and has a terminal point in the first quadrant. So here's our definitions of the special functions that we will be working with throughout the course. And it's always good to make sure you understand these definitions as we will rely upon them from time to time throughout the course. And the ideas of t represents the length and direction of an arc. Notice again the word direction in there for our conventions for positive direction and negative direction. The initial point is at 1, 0. And the terminal point we're labeling as x, y. And for example, if a picture might look something like this and we would see a terminal point here of x, y, if that arc is length t, then we say the cosine of t is equal to x. Our shorthand notation for this, which is what we will be using throughout the course, is right there. And again, notice the function notation cosine of t equals x. The textbook will quite frequently leave off the parentheses and write cosine of t equals x. I prefer to include the parentheses in this and we'll try to do so throughout the course as it really emphasizes the function nature that we're talking about. This is a function of the real number t. Again, we measure that a length along the unit circle with our direction conventions and we come up with cosine of t equal to the x coordinate of the terminal point. And in the same way, the sine of t is equal to the y coordinate of the terminal point. And you see that right there. Another thing to really keep in mind always is the equation for the unit circle. That's a very, very important fundamental fact about the circle. And in fact, in the next slide, we translate that equation into one involving the cosine of t and the sine of t. Okay, as you can see, we have the equation for the unit circle in the first line. And what we have done there is simply made the substitution x equal to cosine of t and y equal to sine of t into this equation. That has given us the second equation in the line there. And you can now see we get this equation here. Now, there's kind of a funny thing about notation for trigonometric functions or in this case, the circular functions. The second line is actually the correct notation that we would use here but it has become convention over a long period of time to shorten this notation. And so instead of writing cosine of t, that whole thing squared, we shorten it to this. And unfortunately, maybe we sometimes read that as cosine squared of t. Actually, it is cosine of t quantity squared. And the way we will usually see this identity is right there. And that is called the Pythagorean identity, as you can see by the title of the slide. Now, this next problem is a typical type of problem that we will encounter in our trigonometry course. And it basically gives the value of one of the trigonometric functions and asks you to find the value or possible values of the other trigonometric function. And the primary tool we use is this identity right here, the Pythagorean identity. So you have to be careful with squares and square roots here. And the idea now is simply if sine of t equals one-third, to substitute that into the equation and you get cosine of t squared plus one-third squared equals one. And with a little bit of algebra and arithmetic, we get this equation of one-third squared becomes one-ninth. And now we subtract one-ninth from both sides of the equation. And we have to be a little careful with fractions, but we get one minus one-ninth, which is equal to eight-ninths. Now, here's where we start being careful with squares and square roots. We have cosine of t squared equals eight-ninths. The idea is to take the square root of both sides of the equation. But remember, there are two square roots, and so we will write cosine of t equals plus or minus the square root of eight-ninths. And we can do a little bit of simplification of that by realizing that the square root of nine is equal to three, and so we would finally be able to write cosine of t equals plus or minus the square root of eight over three. Now, it's interesting to know what has happened here. By giving the value for sine of t at one-third, what we have done is basically gone on the unit of y-axis up to about, let's say, that's one-third, and cut across that. And you can see what happens there. That intersects the circle at two points. And although my pencil width here doesn't show much difference here, the coordinate of that point now will have y-coordinate of one-third and the x-coordinate will be the square root of eight over three. So the coordinates of that point are listed as eight-thirds, one-third. The point on the left over here, create a little room up here, will have coordinates. The x-coordinate now is negative, so we get minus the square root of eight over three one-third as the coordinates of that point. So that's our first type of problem in the trigonometry course, and I hope you will find the screencast to be useful for you to give you examples to work with and so forth as you study the course. Thank you, and see you next time.


because it recalls the spirit more than the culture of times past. The sleek, tinseled folk dances performed in the United States reflect the core of the American personality. Rhythm, crisp, measured motion, any observer new to the country, tends to consider this tempo erratic. Nerves centered on modern gadgets, schedules, clocks, and dissonant city noises. But the American drive to be on the move, to stretch and grow, solidified itself into the national character as early as the 1780s. This was a momentous decade, one marked by the unification of the original 13 states, which formed a foundation for the expansion which was to follow clear across the North American continent to the Pacific Ocean. Creative thought and the invention of the cotton gin expanded the cotton fields of the South into vast acres of productivity and prosperity. The busy North and the gentle South joined in a mutual bond of commercial growth. Year by year, new states joined the union. More cotton, grain, salt, meat, and sugarcane floated along the Mississippi River to the New Orleans markets. To accommodate the growing demands of a busy republic, the rafts laden with cargo gave way to larger comfortable carriers called riverboats. As interstate travel became more comfortable, it became fashionable. The commercial riverboats became showboats as minstrels appeared, entertainers bringing to the North a view of Negro songs, humor, and dances. Such performances developed the original American folk dance and is performed today with a variety of struts and stances. Separating the North and the West gave way to roadbeds of steel and accelerated trade in a new direction. The South pursued its cotton economy. But the West had land and then word of the discovery of gold in the American West brought fortune seekers from all parts of the world. Cutting new trails far beyond the railroads in wooden wagons and on horseback. The wagon trains traveled deep into the heart of the ancient tribal life of the American Indian. Involving him in a wave of the future he could not comprehend. The Indian first met the newcomer with violence. Soon learned craftier ways of besting him. Was the exercise of skill exhibited in breaking a high spirited coat into controlled obedience to its owner. When the wagon trains were still for the night, folk songs from the old world were recalled with fond sentiment. And new ones told of toils encountered in conquering the plains. On festive occasions pioneer wagon dwellers gathered around the campfire and another folk dance Americana was originated. It is performed today as the hoedown. In the 1960s more land was brought under cultivation than in all the previous history of the United States. During the same period the population of the nation more than doubled. The tempo of business kept pace with this growth. The search for quick, efficient methods brought forth an era of ingenuity. Mechanical processes began to enlarge business operations. A communication system linked distant parts of the continent. A steady succession of inventions accelerated the social and economic life of the nation. The horseless carriage was introduced. It proved to be the beginning of an industrial giant. The chapter of big business began in the United States. Industrial expansion followed the route the pioneers had established. The country began to take on sectional identities. The stock exchange became synonymous with New York. Fishing villages meant New England. Steele, Pittsburgh. Lumber, the Northwest Territory. The span from the Atlantic Ocean to the Pacific had been accomplished. Sociologically and economically, prosperity was the keynote. The young country, like youth in all forms, was exuberant, lighthearted, energetic. The spirit of the times, the 1920s, was clear in a popular dance of the day called the Charleston. It was danced with zest. And today is a favorite in any repertoire of folk dances in the United States. But one had to be quite young and limber to execute it. And the style never found its way into the archives of American folk dance. Another, more sedate dance, called the Lambert Dance. The Lambert Dance. The Lambert Dance. The Lambert Dance. The American Folk Dance. Another, more sedate dance, called the Lambert Walk, was more indicative of the new calm that had just begun to settle around America. But it, too, failed to register itself into any repertoire of dance. Two had its problems worldwide. America was to experience in every little town, every geographic section, every category of living, a sense of responsibility, not only to its domestic welfare, but to the welfare of people in cities, towns, and countries spanning the globe. The network of communications saw television become a mass educator as well as a mass entertainer. Hours of TV documentary and discussion were broken with nostalgic reenactments of days when physical durability was the prime requirement. The legendary West provided a seemingly endless source of material Americana. The folk dance with a story is a style evolved from techniques first tried by Hollywood, further advanced by theatrical musicals, and brought full circle as a mass expression by TV in the 50s. The tale reliving the trials of the pioneer villain facing pioneer justice has become firmly entered in the records of past eras through dance.


From Hollywood it's time now for Johnny dollar John, this is Harry Branson of Philadelphia Mutual Harry. What are you doing in town? I'm not at least not in your town, but you've got a case for me Do you know anything about violins? Oh, don't tell me so he opened up his fiddle case and out came a submachine gun That it John that technique went out with prohibition now seriously this case contains a genuine amati good What's in a muddy one of the finest most expensive violins ever made this one was insured for $30,000 was Yes, now someone has to find it for us. What's more? Okay, Harry. I'm on my way Tonight in every weekday night Bob Bailey in the transcribed adventures of the man with the action-tact expense account America's fabulous freelance insurance Investigator yours truly Johnny dollar Expense accounts submitted by special investigator Johnny dollar to the Philadelphia Mutual liability and casualty company The following is an accounting of expenditures incurred during my investigation of the Ricardo Amarillo matter Expense account item one twelve forty train fare and incidentals to Philadelphia, Pennsylvania I took the train because Harry Branson didn't seem to be in any particular hurry And I kind of like a slow look at the countryside this time of year When I got to Philadelphia, I checked in at the Bellevue Stratford shaved and showered Then went over to Harry Branson's office in the security first building on Walnut Street. You deceived me, John I thought when we talked long distance that you'd be here right away, but instead of flying down Sobersides Branson had changed a bit hair a little grayer than the last Still the same serious lad who always acted as though he was carrying the weight of the world on his shoulders I feel a deep personal concern of the whole matter because it was a man I put in this office myself who issued the policies both of them two policies on this fiddle you were talking about No, John one on the Amati violin thirty thousand dollars and one on Ricardo Amarillo himself for twenty thousand dollars Who is Ricky? Who? Well, isn't that what you said his name is? I'm sure I didn't mention anyone button. Oh, oh, Ricardo Amarillo Yes, yes, well, where's he playing the purple cat or maybe we willies join over on John This man is a concert violinist or was he's disappeared now, please no more levity. Sorry, Earl. It's Harrison. Sorry, hurry All right. I'm quite all right now I realize that you have quite a sense of humor John But in a matter as important as this yeah, sure now let's have the story very well a few years ago Ricardo Amarillo was one of the world's leading concert violinist as famous in London Paris Rome is in the concert halls of this country Such virtuosity almost unbelievable. I shall never forget one evening here in our Academy of Music He had just finished a perfectly brilliant Vinny off ski amazing technical performance. Yeah, well on core He played Sarasate Sopatialo even more brilliant Harry, but the audience wouldn't let him leave the stage Ricardo Amarillo has disappeared. Oh, oh, yes, and you're in a hurry to get on with the case I'm sorry now thinking of his superlative performance that night carried me away for Yes, he's dead disappeared in the violin no trace dead. He didn't say that before I know you see there's no proof of death. Nobody disappeared. Well, don't let me shock your finer sensibilities, Harry Murder we have thought of that. Of course. Who's we the Port Morris police Port Morris, New Jersey Yes, you see since Amarillo's car went through the bridge rail crashed right through it and plunged into the river Trying to tie Harry down to pertinent facts that would help me in my investigation was to well futile At least three times during the next half hour He went off on glowing descriptions of violin recitals. He had known hyphets Elman Chrysler and so on But he did come up with one of two things I wanted first Amarillo and his fiddle had been driving down from Philadelphia to some spot in the South Jersey seashore Crossing an old wooden bridge over a little stream and inlet from the ocean the car had smashed through the guard rail and gone to the bottom of the inlet The car of course was found Amarillo in his violin. No Second and just as important the name of the beneficiary of Amarillo's policies Item two an expense account one dollar even Taxi to the Harnell building also on Walnut Street in the office of Peter Corbin Amarillo's booking agent The building was plush but Corbin's office was about as bare as I'd ever seen an old Beat-up desk a battered filing cabinet and a couple of straight chairs. That was it Corbin was chewing the stub of a cigar that he'd forgotten to relight for at least a couple of days We made with the usual howdy-dos Well, you man Branson told you exactly right dollop. I'm Ricardo Amarillo's soul and only beneficiary Well, it's not have been unusual for a man's agent to be as air or Was it because you were all personal friends. I'm gonna give it to you straight I Brought him a rig over to this country myself my own soul expense. I actually gave him the build-up I started his whole entire career I kept him on top all at my own expense. Well, didn't you collect a regular agents commission on his own sure sure plenty more Why kid about it sure while he was working. What's that supposed to mean bottle what yeah started hitting the bottle bad Not good and believe me the word gets around fast Instead of making me money himself to cause he started costing me money But you see he never saved anything even when he was earning big, you know how these artists. Yeah, right Well, it's the same with all of him.  So you had him take on a lot of insurance to name you has beneficiary Well, that was his idea actually of course. He always did have the Amarillo insured. That's his violin I saw I learned. Oh, you know about violence. No Oh Well, but the life insurance that was his own idea double and then of the all that sort of trouble and then oh But guess who had to take up the mula for the last couple premiums Big hearted Corbin. You're right. Not a bad investment. Oh, is it well? Hey Premiums and you stand to collect plenty if we can find proof that he's dead and if we can't I don't like that dollar. I don't either Corbin. It doesn't smell good Oh, you think me his own agent actually ricks something like that for one of my best friends you think that Listen wise guy Even if I did have any any of us such idea that'd be crazy Anything actually is as obvious as that. Well, sometimes the most obvious is the best cover.  Get out So help yeah, pretty obvious and every time you open your mouth Why is it that people who telegraph their punches are always the first to start swinging? Anyhow, I left Corbin to pick himself up and start thinking about some alibis he might need And in the camp back to my hotel, I did a lot of thinking myself Sure, the obvious off times is the best cover up and yet it might be too obvious far too obvious Branson here Johnny dollar here. Oh John good. Listen, at least there'll be no double indemnity to pay in the Amarigo matter For accidental death that is you see wait a minute about an hour ago. You weren't even sure he's dead Did somebody find the body? No, unfortunately, but I've just received a call from the Port Morris police They completed their examination of Amarigo's car after they pulled it out of the creek, of course. I hope so John They found conclusive evidence of murder Harry, I'll call you from Port Morris Expense account Adam to subway ferry train and bus fares to South Vinyl, New Jersey South Vinyl because Ed Bowles lived there, and I knew that if anything anything at all happened in the heart of sunny southern Jersey Ed would know about it Retired in raising some of those wonderful South Jersey sweet potatoes and peaches with plenty of hired help He amused himself by mowsing around getting to know everybody and everything that happened in his section of the state He had an insatiable curiosity and money enough to keep it satisfied gisling son of a gun I've been waiting for you to get here what took you so long What was that conniving chiseling crack son? We're still on expense account aren't you? Yeah, sure And so helped me nobody in history ever had the knack of patting out an expense account the way you can and collect those fancy commissions on top Hi, when I was a private investigator who is retired You call this retired? 270 acres of sandy soil from which to try to wrestle the poor living Wait a minute that that Cadillac Eldorado out front that belongs to one of the hired 983 peach trees and isn't that a landing field I see out there through the window a lot of sweet potato land to be cultivated Yes, hey, why didn't you fly down or let me know and I'd have picked you up look with all the time I have How long you're gonna stay so I can figure out where we'll go what we'll add I'm on a case sure Ricardo Amarigo and his priceless fiddle. Oh, no, it was easy When I heard about him going over the bridge I contacted Barney Peters of the Port Morris PD from Barney I learned all about the next akin fit his agent that is Pete Corbin, right? And that boy at Philadelphia Mutual Harry Branson and I knew Branson wouldn't call anybody but you in on the case So here you are still a private eye aren't you? You're gonna have some way of killing time and I suppose you have the whole case solved yep Well according to Harry Branson who heard from the Port Morris police just before I left Philly. It was murder. Oh You point killer. I thought I'd be the one to tell you that. Oh, sorry the cops knew it first second I told him huh? Yeah, I showed him where somebody used a hacksaw on the steering arm of Amarigo's car When they dragged it out of the creek So that was it yep, and who wielded the hacksaw Pete Corbin who else why who else stood to benefit by Amarigo's sudden trip to the great beyond No, it's too easy yet. What's more? He's the only one who had constant and complete access to Amarigo's car Why he not only mothered little Ricky clothed and fed him and kept him in booze But he paid his rent swept out his apartment serviced his car It's too easy and Johnny that car was even kept locked in Pete Corbin's own garage and Corbin had the only key Why did you learn that's Corbin's landlord by phone of course Said he thought Corbin did that so Ricky couldn't go out driving when he was drunk me. I think it was the other way around He'd only let him drive when he was drunk Instead of good chance of smashing up what would look like accidental death so that Corbin would collect the double indemnity It's open and shut Any proof Sherlock ha just get to Corbin throw it all at him and break him down Maybe you'll even find the hacksaw tucked up his sleeve too easy any bets that it isn't Corbin Yeah, yeah, I'll bet you you name it My commission on a case I'll match it.  What's more Pete Corbin acted anything but scared or so I thought until I put through a routine call to Harry Branson He was worried he had a right to be Pete Corbin had packed a bag jumped into his car and Disappeared now. Here's our star to tell you about tomorrow's intriguing episode of this week's story tomorrow a soggy day in a soggy, South Jersey swamp and The discovery almost too good to be true Join us want you yours truly Johnny dollar yours truly Johnny dollar starring Bob Bailey is transcribed in Hollywood Written by Sam Dawson. It is produced and directed by Jack Johnstone Be sure to join us tomorrow night same time and station for the next exciting episode of yours truly Johnny dollar Roy Rowan speaking


Okay, now in the fourth part, we'll go away from all the theory and how we design things and we'll look at two actual APIs that exist in the web that are somewhat restful. They're somehow similar to what we've done. And one example is PayPal. So PayPal offers an API, a web service, a number of them actually, but it offers you ways to program applications where you can use PayPal. So you could write your own application and build in PayPal payment so that it, for example, fits into a larger thing if you want to implement a new billing system, you could automatically connect it to PayPal so you can write your own solution. And we'll look at the payments API, so how to do payments and we'll do only very few postman requests actually because there are only some things that I can do without doing actual payments. So we'll just have a look at it, but first we'll look at the documentation. And I'll be using version one. So you see that they are actually using versioning. They have a version number. There's also version two. Version two is quite different from the way that we have designed restful APIs. That's why I show you the old one. But as you see, they do, for example, is versioning to say that you can still use version one, but at some point we'll get rid of it. So the interesting thing is, first of all, what kind of resources do we have? Here we have payments. So we can handle payments. And that's just located at v1 slash payments. So that's sort of here is where PayPal puts the payment API. And the resources look a bit different from ours. But it's similar. So this is identifying their API. So please use version one of the payment API. And then here's the resource. So as you see, they don't use plural. They just say payment. But basically we're accessing the payment resource. And what we do in this case is we do a post request. And as we have learned, that means we are creating something. Intuitively, by looking at this URL and looking at the method, you know that a post request to this URL will create a new payment. That's exactly what it does. So that's how you can use it. Now, this is not enough. But typically you have to know what exactly you need to send. What is the representation you have to send to create a payment? What's the information needed? And that's found down here in the information. So it says, creates a sale, an authorized payment, or an order. So the different kinds of these things. And you'll then actually see the different parameters you need. So what kind of headers do you need to provide? How does the request body looks like? So for example, one thing that is required is you have to send something called an intent, which means what exactly is the payment about? Is it a sale, something a direct payment? Is it sort of an authorization? So something that will be later handled? Or is it an order? We're ordering something. And I mean, I don't know the details of PayPal, so I cannot go into all these details here, but essentially you have different ways of doing a payment. And then the other thing that is required is the payer, the source of the funds. So are we paying from a PayPal account, from a PayPal wallet, or are we paying using a debit card, for example? So different ways of doing that. And then you have a lot of optional things you can do, like saying, okay, what is the application context? And now I don't really know the details there, but you see there's a lot of stuff you can do. Or transaction, any kind of transaction that is related to the payment. So for example, what is the payment for? Who is the one fulfilling it? And so on. So you can add some details there. Like saying, what's the total amount? What's the currency? What, which part of it is tax? Which part of it is shipping? What's the description? What is it actually? Is there maybe some kind of custom or invoice information and so on? So there's a lot, a lot of stuff you can add, but it's all optional. And then there are actually, this is hate to us. So PayPal actually requires you somewhere down there. It's listed as a required thing, I believe. You have, no, it's not, but whenever I try it, it tells me it's required. You have to set redirect URLs. So that basically means what else can you do? You can, where do you go? Where sort of the return address when the PayPal payment is successful, if you press cancel, where do you go instead? So that's sort of other details we need. But see, this is a very common way of describing an API, which is say, what's the method? What's the endpoint? What's the URL? And then what's the kind of information needed? That's how we do a payment. That's something that actually last year I got to work. This year I somehow haven't managed, so we won't create a payment this time. But another thing we can do, create is one thing. Of course, another thing we might want to do is list all the payments that exist. So as you have learned, that should be a get request to the resource. So if we do that, we should get all the payments that we have existing. And if we look into the query, there are kind of different things we can ask for. For example, give me all the queries starting from a certain date until another date. So we can somehow restrict. So that's similar to, for example, the pagination or filtering that I have discussed. And we also, as you see, there is sorting. We could say sorted by the time the payment was created. So these things are possible. The get request does not have any request body. So there's no body we have to send.  As successful requests will give you 200 okay. And a JSON response body that lists all the payment details. And it looks like this. There is an array of payments. Each of them has an ID, create time, update time, blah, blah, blah. So lots of information. If I would just do this call, it will fail. And that's simply because most APIs and PayPal, of course, is no exception. They want you to have some kind of authorization. So you're only allowed to use the service if you have signed up. And that's a bit, that's sort of the bit you see here. There is some kind of header going on. And the application tells, here's my authorization information. Here's my token. That's something I will not cover here, but essentially I could go into postman and I can do get payment. So what I'll do here is I just call the right URL with a get parameter. And if I have logged in before, which is actually a post request, that one looks different. We'll cover that in the security lecture. But I have to do that first. Then I can do a get request on all the payments. And what I get back is the list of all my payments which happens to be zero. So I just get an empty array back. I haven't made any payments in my API. So this thing is sort of self descriptive. I tried to play around with creating a payment but I didn't manage. So it always says that my token is not valid. So I basically don't have the rights to create a payment. So most likely I would have to somehow either pay for the service or somehow update my access. But again, it's a request I can make and I can just get a 400 bad. You're somehow doing a bad request because you don't have the rights to do this. Forget about it. And now if we look at the details, there are other things we might want to do, show payment details, for example. And that just means instead of getting all the payments or a list of payments, I get a specific one. And that's now exactly the same case that we had in our to do app when we said do a get request to a specific user. So here we do a get request to a specific payment. Same thing really. So this is how PayPal works for the payments. As you see, there are lots of other things you can do. You can do orders and they might then look very similar. You can do post request to slash orders, creates a new order. So they're just different things you can do. Transactions, subscriptions and so on. So there's a lot of stuff that can be done in PayPal. But you see that just this information, just the method and the URL already tells you what this thing does just because it follows a certain style. And that's really where a lot of the useful nest lies in rest that it's very easy to figure out how to use an API. Another example, the second one I'll do in this lecture is going into GitLab because GitLab also has a REST API. And that one is actually a bit nicer. It's much closer to what we have covered. But GitLab, you know, from my assignments, for instance, I have created a project that is called Vef20 Assignments. This one has an ID. And of course in GitLab, you have a lot of different things. You have all the files that I uploaded. You have branches, you have commits, you have issues, for example, you could post an issue that something is wrong. There are other things, right? You have merge requests and so on. So there are lots of potential resources here. And actually the API for GitLab is quite nice. And again, it's very intuitive by just looking at the description. So one of the things you might want to look at is what kind of resources do we actually have in GitLab? And first of all, there are three groups. And we only look at the first one, but you can have projects, you can have groups, you can have standalone and so on. It's not so important, we just look at the projects one. There are different versions. So again, they do API versioning. They say we have upgraded to version four, but you can still use version three. And then they use some kind of keys. So you might have to have an authorization. Now, here are all the project resources. So if you have a project, here is a project. My project has a certain ID. Then I can do things with that. So first of all, I can access all the different commits through this request here. So I can just say, give me all the projects, give me the project with a certain ID, and then do repository slash commits. So this basically gives you all the commits for a certain project. Issues, please give me all the issues for a certain project. So again, this is exactly the same structure we have been using before. Projects slash ID identifies an individual project and then issues accesses all the issues for that specific project. And this continues. So members, projects slash ID slash members gives you all the members. Projects slash ID slash merge requests gives you all the merge requests. If we look at one specific thing, if we go into issues, for instance, you see what you can do. And you'll see all the different things you can do. Now list issues, how would that work? Well, it's just a get request to slash issues. So exactly the same as we have discussed. The get request says read all the issues and return them. Here they have done a shortcut. They have removed the slash project slash ID, but it essentially means the same thing. So as it says here, it's relative to the project. They have just removed that part from the URL. You can do certain things. For example, you can do filtering. Say only give me the issues that are opened or only give me the issues that are closed. You can search something I haven't discussed, but it's also often implemented to say only give me issues that have foo in the title and so on. So those are things you can do. It tells you what exactly you will get back. And here, for example, we can list all the issues for a specific project. And if you want a single issue, how would that look like? Well, according to what we learned, we would just add a slash and the ID of an issue. And indeed, if we go to single issue here, it says get slash project slash ID slash issues slash issue ID. So exactly as we would expect. Creating a new issue should be a post request. Same here. Editing an issue is probably a put request. So it's a put request to a specific issue. So without looking at all the details, if I really want to do this, of course I need to understand what is the information I need to send, how does my request look like? But by just seeing the method at the URL, I can get a very good idea of how this API works. Delete an issue is just a delete request. So there's a lot of stuff. And then of course it gets a bit more difficult. So subscribe to an issue. They have actually introduced a subscribe resource. So if you want to subscribe to an issue, what this means is you're actually creating a subscription resource for a specific issue for a specific project. So now it's getting tricky. But those things are very similar, which creating a new resource that is related. So this is a good example of a RESTful API. It's quite nicely structured. And as you see, these things get fairly complicated as you have large projects, as you have large services, large applications. The cool thing now is if I would use this API, I can implement my own website that somehow accesses GitLab. I don't have to use the actual GitLab website. So I can write a new application that just uses part of it. For example, let's say I just want to use the issue system, I could implement my own dashboard, my own HTML application that just shows all the issues. That's something that can be very useful for a company that has, for example, their code running on GitLab, but they might also have an already existing application that shows all, let's say all their test cases, then maybe they want to build a plug-in that also at the same time in the same application displays all the issues they have in their repository. So it can be a way of using data from different places. Okay, so that's what we have done. We have actually looked at two real examples. We haven't done so much postman, but the beauty of what we have done so far is really that we haven't cared about how this whole thing is implemented. We have just looked at the textual descriptions of how to use the API. And that's all we need to know. We don't need to know how, for example, PayPal has implemented this. We don't need to know what kind of database they're using. All we need to know is what kind of requests, what kind of URLs are there, how do we send the requests, and what is it we get back. So that's a nice thing. What we'll now do in the next step in lecture 17 is we actually implement this ourselves. So we will take the to-do application that we have designed. We will use Express to implement this. So we actually write the application. Then we'll deploy it to the cloud. So it actually runs on the internet, not just on our computer. And then we'll just add a database for the fun of it, which is not required, but it's of course a useful thing to actually have persistent data. Okay, so that's it for lecture 15 and 16. See you in lecture 17.