Hello and welcome back to this micro systems fabrication by advanced manufacturing processes lecture 16 a brief review of the previous lecture what we had tried to do last time was to design the electrolyte velocity and pressure between electrodes during an ECM operation and we saw that the velocities actually are limited by the fact that the amount of heat that is translated by the electrical power coming into the electrolyte is carried away assuming that there is no conductance across the tool workpiece surface. And the velocity should be designed in a manner so that the overall temperature of the electrolyte does not cross the boiling point also what is important is that velocity is also limited by the pressure scale where the pressure comes due to two factors one is the inertial component which is relatively a lower term particularly because of creepy flows or you know low Reynolds number flows which are executed in the small equilibrium gap that is in question and so therefore the pressure component given by the surface forces the viscous forces have to be matched with the ultimate heat stress of the material on one side. So that is what limits the velocity the design velocity of the electrolyte so what augments the velocity is the fact that the temperature should not go below the boiling point and what limits the velocity is the fact that the pressure which is generated because of the viscous effect of this velocity should not go above the ultimate heat stress of the material. So we also sort of tried to investigate the various effects of the heat and hydrogen generation on ECM process between the electrodes on the electrolyte and we were looking at some of the causes of surface finish due to the ECM operation including selective resolution sporadic breakdown of anodic film flow separation formulation of eddies evolution of hydrogen gas so on so forth. So we had already seen how two phases in an alloy A and B with different dissolution potentials would have a self ruffling effect as opposed to the general self leveling effect of an ECM process just because of the fact that the potential of one phase may be slightly higher over the potential of the other phase. So it was a very interesting case that we analyzed where roughness automatically gets generated because of difference in the dissolution potentials of the two phases. The other fact is about the sporadic breakdown of anodic film which we will just about see today and all these different causes varying from 2 to 4 we will try to evaluate today after going through a brief recap of the selective dissolution potential. So here you can see that there are two phases B and A where there is a difference in the potential dissolution potential VDA, the dissolution potential of A is lower in comparison to VDB and therefore there is a self ruffling where the B phase only gets dissolved when it hits this particular plane. This is just for the sake of repetition that I am doing. So if we really compare both of the cases so the electric field which is also proportional to the current density because electric field times the conductivity becomes the current density. Actually if you look at this gap as y between tool and the surface A and the available dissolution potential for A is VDA. So V minus VDA by y is the electric field across this particular gap. If we consider VDA potential or dissolution potential of A and if we consider that of B then the gap reduces to y minus delta thereby the field becomes equal to V minus VDB by y minus delta and typically these electric field should be similar to each other because they are with two equipotential surfaces in question and there should not be really much variation at least at the flat phase of this B surface and the flat phase of the A surface. So considering corners here where the field lines would automatically coil and would produce a considerably varied density here. So this is how the electric fields of the A part of the surface and the B part of the surface would compare and from this expression we really can get a value for this delta. So the delta thus can be found out by this expression 1 minus V minus VDB by V minus VDA times of y. Just algebraic manipulation from this particular equation here and so you can really find out what is the surface roughness if you knew the dissolution potentials of the phase A and B and you are aware of the gap when the two surfaces in equilibrium. So this can be the equilibrium gap. So that is what selective dissolution would mean. The other very interesting factor which affects the surface roughness is the sporadic breakdown of anodic film. Let us see how it happens. So the main reason for the sporadic breakdown of the anodic film is the gradual fall in the potential difference between the work surface and the electrolyte in the region away from the machining area obviously because let us say this is the electrode here and there is a certain field which is created in this particular gap which is represented by these lines of forces. So fields slightly curled around the corners and it is also reasonable to assume that this field here can extend farther away from the tool surface as well because field is actually if as it goes away from the tool it varies as a or it falls down as a inverse square of the distance r. So the field varies as a square of distance from the electrode onwards towards the remaining part of the surface but there does exist a field. So for example if this is the particular potential function which is available to this surface it slowly goes down as the distance increases as a square of r but there does exist some value here like for example at the point P 1 it may be V P 1 at the point P 2 it may be V P 2 so on so forth. So there are some finitely existing values of the fields which escape even though the tool is placed at some distance away from the surface. This is all covered with electrolyte because naturally the electrolyte flows around this gap and flows over the surface and everywhere else and it flows into the tool from this entry point here in the center. So supposing if there is an alloy in this particular region and particularly in the region P 1 there may be a phase where the potential which is available here is greater than the dissolution potential of that particular phase available at P 1. So there would be selective dissolution at P 1 by obviously by the reasons shown before and so dissolution potential of one phase would ensure that only one phase comes out. So you can see here this roughness which is created is because maybe one of the phases here in this particular zone or in this particular zone may be had the available potential V P 1 to be greater than their own dissolution potential ok. So you can call it V D of a phase maybe at P 1 ok and that came off and because of coming off you have this roughness or a tethered surface which results because of that. Obviously if there are corners and bends which are represented by the selective removal of one of the phases these corners would further lead to the coiling and the curling of the fields and so the line density in these points would increase tremendously and because of that there would be more dissolution which is available because of increased line density. Field concentration causes the phases to dissolve very rapidly further because of selective dissolution and formulation of these corners the sharp corners ok. So certainly this is something which is highly undesirable for an ECM process and this can be one of the main mechanisms for introducing surface roughness in an ECM although the ECM is supposed to be a self leveling and a very smooth operation. The other important factor which is responsible for the creation of surface roughness is the formulation of eddies and the separation of the flows. If supposing there is a rough surface which has been created because of the selective dissolution of the field due to an electrochemical tool it is always proper to assume that there may be a case of local circulation particularly when the electrolyte is flown in both the directions like this. So the electrolyte flows over the surface and there are these cases of local circulations which would exist over such crevices and corners meaning thereby that there are these eddies and vortices which are created close to these corners because of the surface perturbations which is the surface no longer a plain surface there are selective dissolutions because of which there is a lot of this cornering effect, chamfering effect which is present at various points here ok. So these local circulations are a cause for the debris particles which come out of this zone to keep circulating here without going further ok and that may change the local conductivity because precipitates are one of again the responsible causes for change of the conductivity of the medium electrolyte and eddies and vortices are something that you really do not want in ECM. The more streamlined operation the ECM would have in terms of electrolyte flow the better it is in terms of surface finish ok, but the more there is localization of flows and eddies and separation of flows at certain areas there may be local precipitate whirlpools which are formulated which have much more conductivity and therefore more dissolution and that may create a pitting effect in some of the local zones. So a great care needs to be designed to be taken in designing the tool surface particularly the same thing may happen to the selective dissolution of the tool as well ok. The surface may turn out to be rough with the operations if there is an alloy tool which is used and one needs to be very careful about these eddies and flow separations. So this is another third reason for the surface roughness finally as I already have mentioned before the evolution of hydrogen gas is pretty critical and if you can consider these tool workpiece surface supposing the electrolyte starts flowing from this end into the gap ok at a certain velocity and by the time it reaches at the other end here ok there is always an increase in the temperature and let us say if hydrogen emanates as bubbles into this electrolyte the concentration local concentration of hydrogen in the electrolyte increases because of which there is a change in conductivity and the hydrogen may be concentration may be lesser here, but by the time this goes ahead and the hydrogen gets carried away more and more hydrogen packs off you know to this electrolyte. So hydrogen concentration is greater here there is a density gradient which is created for the gas which is dissolved and therefore the conductivity is varied across the length of the workpiece even and because of that again there is a tendency of the conductivity to vary and also simultaneously the current density to vary. So at one point where the current density may be more because of reduced hydrogen may have a slightly greater resolution rate in comparison to the point where the current density is lower ok and so therefore again this can also result in some kind of a roughness where some points may be moved or dissolved in a greater pace in comparison to the other points. So there are two major aspects when we talk about ECM one is of course the tool design ok and another is the flow design the system of flow you know and the tool design is important because of two reasons one is that the tool shape so desired is exactly the negative replica of the shape that you are wanting to embed or imprint onto a surface that is the basic principle of an ECM operation. So particularly in microsystems technology when we are talking about some embedment some small feature which has to be created on the surface the exact contouring of the tool is very much needed so that the exact negative replica can be produced on the surface at that particular scale. And the other reason is that you know the electrolyte flow that the tool would have would really be creating a lot of effects on the overall material removal rate. So therefore the way that the electrolyte is flown the way that the sides of the tool are insulated the strengths and fixing arrangements of the insulations onto the tool they would be of great concern when we want to develop a good ECM process. So we will look at the first aspect now that is determining a tool shape so that the desired shape of the job can be achieved for a micro machining or for a machining condition and in that respect I would like to sort of propose a theory where we want to theoretically determine what is the tool shape based on a certain function which is known to be the final shape of the work piece that you would like to generate using ECM. So when a desired shape of the machined work piece surface is known and we want to somehow map the surface into a tool surface and which is possible actually theoretically. I will just show you an approach where theoretically you can determine and so the required geometry of the tool surface for a given set of machining conditions can be achieved very fast based on that and the first thing that we need to know here is that the equilibrium gap between the anode and cathode surfaces can be expressed as g dash is equal to the conductivity times of atomic weight of the material which is dissolved times of the voltage minus over voltage potential which is available for the electrochemical process divided by the density of the material to be removed the lowest valency state of the material and some other parameters like the Faraday constant the feed rate supposing it is going at an angle theta. So, if theta is the inclination angle of the tool WRT with respect to the work piece this can be called f cos theta. So, that is how you find out the equilibrium gap as we have seen before and let us actually now assume a certain random tool surface and work see per work piece surface as represented here. Let us say this is the x y plane and we are talking about a certain shape here of the work piece let us say this is the shape of the work piece which we are kind of aware what this shape would result or what would be the final shape which is desirable. So, this is given by the design team for the component and we also are aware that this work piece is being fed towards the tool at a feed rate of f and this is automatically the shape of the tool which is generated by the requirement of this work piece surface which is known to you. So, if we select the you know in the two dimensional sense a point here on the work piece surface let us say p w which is again a function of x w and y w and try to map a corresponding point on this particular surface the tool surface p t x t y t we should be able to somehow find out the functional relationship that exists between this point and this point given the constraints or conditions of the ECM process like the feed the direction of the feed so on so forth. So, the feed as you know is in this direction meaning thereby that if you look at a tangent to this particular point it would assume to have moved at an angle theta with respect to the direction of the feed ok. So, we are already aware of the work piece surface. So, let me be defined by a function y equal to phi x. So, there is a relationship between these two coordinate section y and it is a sort of non parametric representation of the surface y equal to phi x and we want to determine what this would mean when it gets translated into the tool surface to provide the tool shape. So, when a steady state condition is reached the gap between a point on the work piece let us say this x w y w point p w and the point on the tool surface be given by a steady state equilibrium gap g e ok where g has already been calculated before we know what g is it is function of many things like where the equilibrium gap is a function of many things as you know the atomic weight the available voltage which is there the conductivity the density of the work piece which material may be iron or copper whatever is being removed or machine so on so forth. So, if you look at the positional relationship between these coordinates x w y w and x t y t so the x t is displaced forward displaced from the x w by an amount g sin theta where g is this gap here between p w and p t right. And if you compare the position coordinates y w and y t the y w is forward displaced from the y t by a gap g cos theta meaning thereby we have two equations here x t minus x w which is g sin theta let us call it equation 1 and y t minus or y w minus y t which is g cos theta it is called it equation 2. We already know the value of g g is actually k a v minus delta v divided by rho z f cos of theta where we assume that the surface is moving along this line p w p t towards the tool surface at an angle theta. So, these are very generic form of a surface of a sudden functional shape to be replicated in terms of the tool surface. So, we are mapping from the work piece surface to the tool surface by using simple mathematics. So, here let us say if we wanted to just write everything in terms of the new value of g that we had obtained.  If you may remember this term here was actually equivalent to the lambda when we did the kinematics and dynamics of the ECM process.  And then the x w was displaced the x w was displaced backwards from the x t by the term g sin theta. So, therefore, if you just convert everything here in terms of lambda you can get x w plus lambda by f tan theta. So, we make this equation 3 and this equation 4. So, you already know that there is a functional relationship between the x w and the y w which exists. So, y w is function phi of x w in the work piece side and tan theta can be estimated as the slope d y w by d x w at the point p w x w y w where x t equals x w plus lambda by f times of tan theta which is d y w by d x w. Since the work surface geometry is given by this relationship the d y w by x w actually equals to d phi x w by d x w. So, a little bit looking at a little more fundamental way if this is the surface that we are trying to interrogate which is actually the work piece surface. And this is the point p w that we are trying to use to find the or trying to map into the tool surface. At this particular point the tangent which happens here is really in this direction right this is the tangent at this point. And we already know that the way that the surface would move is at an angle of theta with respect to the vertical direction. So, if I were to just find out whether tan theta is d w by d y w by d x w here you see if this is theta this becomes 90 minus theta and this becomes theta right. So, this tan of theta is actually d y w by d x w right. And so therefore, we can safely assume that g tan theta can be expressed as x t equal to x w plus lambda by f d y w by d x w right tan theta this is the g g tan theta. Similarly, we already have the equation 3 s plotted earlier where we are trying to say y w as a function of x w is nothing, but y t plus lambda by f. So, if this functional relationship exists between the y w and the x w and we have a relationship of y w with y t and x t with x w we can actually write down that y w which is y t plus lambda by f is functionally connected in the same manner to x w's value here which is x t minus lambda by f times of d y w by d x w. So, if you really know the slope here then it should not be a problem to map the x w y w to x t y t as available here in this functional relationship. So, therefore, the whole essence that is involved in all this is to somehow be able to write this d y w by d x w meaning thereby this is d phi x w by d x w in terms of x t and y t. So, then this whole equation can be converted into all x t's and y t's and the function there in which would be plotted would be a map of x w into y w x w y w into x t y t. So, therefore, the overall representation of a tool surface provided we already have a functional relationship between the workpiece surfaces y w is phi of x w is given by phi x minus lambda by f some function in terms of x t and y t of x y these are all tool sides minus lambda by f. So, this is the whole mapping equation from the workpiece surface to the tool surface. Now supposing if we assume a functional relationship of the time y equal to let us say a plus b x plus c x square for the workpiece surface and we want to find out what is the mapping into the tool surface as we already know the map is provided by y t equal to phi x t minus lambda by f some function of x t y t which is nothing, but the slope d y w by d x w right minus of lambda by f. So, let us try to determine this and try to find out how this is related to some function of x t and y t. So, we already know that d y w by d x w is actually equal to b plus c x w right and we are aware that x w or x t actually is equal to x w plus lambda by f times of d y w by d x w which means it is equal to x w plus lambda by f times of b plus c x w. So, therefore, we can either substitute the value of x w in this equation to find out what x t would be in terms or what this would be in terms of x t standalone. So, let us suppose that there is a function y on the workpiece surface which is related to x on the tool surface tool surface by the quadratic equation a plus b x w plus c x w square. Now, we want to find out how to map it from the tool from the workpiece surface into the tool surface. So, we first find out what d y w by d x w is let this be equal to some value i right and this is actually it can be represented as b plus twice c x w. We already from our previous formulation for x t and x w are very well aware that x t is related to x w by the relation x t equal to x w plus lambda by f times of d y w by d x w. So, the whole effort somehow should be to actually convert this whole thing in terms of tools I mean tools side coordinates x t and y t. So, we can write this as x w plus lambda by f times of i remember we have taken this d w d y w by d x w as i and. So, very easily we can see here that if supposing we write x w in terms of i it becomes twice c x w is i minus b or x w becomes equal to i by 2 c minus b by 2 c. And if we put this value here we get the value of x t as x t equal to i by 2 c minus b by 2 c plus lambda by f times of i. Obviously, this would mean that if you multiply the whole thing by 2 c we have 2 c x t equals i minus b plus lambda by f times of 2 c times of i or the value of i in terms of all x t comes out to be b plus twice c x t divided by 1 plus 2 c lambda by f. So, that is how you can formulate d x w by d y w by d x w. So, if I were to represent this i back into the formulation for y you already know that y t in this particular case is related to the x t as y t equal to phi function phi of x t minus lambda by f times of i minus lambda by f. And this really means that this coefficient x t becomes equal to x t minus lambda by f times of the i value that has been deciphered before as b plus twice c x t divided by 1 plus twice c lambda by f. So, minus lambda by f. And then of course, you already know that y t therefore, is written as a function of phi here which means it is a plus b times of this argument which has been formulated. So, we are mapping now the function plus c times of x t minus lambda by f b plus twice c x t divided by 1 plus twice c lambda by f square minus lambda by f. In other words, if you simplify this expression here this would be coming out as a plus b x t plus c x t minus lambda by f minus lambda by f times of b plus twice c x t square divided by 1 plus twice c lambda by f. So, that is how you can map a quadratic function on the workpiece surface to a tool surface. So, in this is just a generic representation of if suppose the surface is defined by a function what would happen. Now, if you look at the theory that is associated with the CAD designing process. The CAD designing also looks into local functions like this and tries to fit some of the formulations like Bezier curve or let us say you know spline fits between either two points or many points and this somehow has to be topologically mapped into the corresponding negative workpiece surface. So, the best way to do it is to keep in mind the equilibrium gap keep in mind that the surface is going at a certain angle to this you know tool surface and topologically map it by a function mapping from of the x y on the workpiece surface to the tool surface. For a certain simple equation like a quadratic equation it has been demonstrated here, but then if there is a complex function which is used for fitting contours or you know complex contours or topologies that function can also be mapped. So, the idea is that the whole design that is there of the workpiece as per the requirement of the workpiece have to be designed in bits and pieces and this each can be represented by either a group of functions or just a function or some of them are just linear and then you simply map those points on to the corresponding tool surface and obtain that way the tool surface. So, the tool design can be arrived at theoretically. So, that is a pretty good aspect of the ECM process that you can actually develop a tool surface exact negative of what is there on a complex design of the requirement of the workpiece. So, with this in mind we just try to do a numerical problem try to solve a numerical problem here as you see here the geometry of a workpiece with single curvature is given and this geometry is given by the equation y plus 10 y is equal to 10 plus 0.3 x minus 0.05 x square you know that these are values and centimeters and the process data is that the applied potential is 15 volts over voltage which is needed is 0.67 volts was a feed velocity of 0.75 millimeters per minute and is given in typically the minus y direction and the work material is copper electrolyte conductivity is about 0.2 ohm inverse centimeter inverse and we have to determine the equation of the required tool surface geometry. So, once again I would like for the sake of repetition to to reiterate this point that a CAD geometry is a complex system which is created out of many such functions which are standard functions either representing represented by nonparametric or parametric equations. Some linear connections between the many complex functions and then some fits the fits are because sometimes you need to really express very closely a complex topology and there is no other choice, but to force fit a sort of function like may be the Bezier function or the B spline function or just a normal cubic Hermitian function polynomial to in a manner that by knowing just by slopes on both ends or the or the different or may be one or two points or may be all the points you can try to develop a fit that way. So, that fit then the standard functions which are already there representing the surface and the linear functions may very safely be mapped topologically to develop the exact negative replica. So, the purpose of all these theoretical analysis is to ultimately arrive at a tool surface given a split up CAD model of a work piece surface. So, let us look at this is a very simplistic case you have already defined the single curvature of the equation given by this quadratic form and we want to find out that for copper we assume let us say a monovalent state which is coming out. So, we are assuming z to be plus 1 or the atomic weight of copper or the work material is 3.757 grams and the rho here the density function here is actually 8.96 grams per centimeter cube and the value of f here is 96500 coulomb ok. And we want to find out provided the feed is given to be 0.75 millimeters per minute or in other words 0.001 to 5 centimeters per second we want to find out what the g value is which is lambda by f and lambda can be represented as k a v minus delta v divided by rho z f where these terms are all as you have done many times meaning their own you know they are encompassing their own definitions. So, the k is the conductivity is given to be for the electrolyte 0.2 ohm inverse centimeter inverse. So, we have 0.2 times of the atomic weight of copper 63.57 times of the total potential which is available minus the over voltage which is 15 minus 0.67 divided by the rho value which in this particular case is about 8.96 it is copper times of monovalent state. So, plus 1 times of 96500 coulomb ok. So, that is how the lambda is and this would come out to be about 2.11 10 to the power of minus 4 centimeter square per second of course, the lambda by f can be 2.11 10 to the power minus 4 by 12.5 10 to the power minus 4 centimeter. This 0.169 centimeter then comes out to be the equilibrium gap y e or g e whatever you may think appropriate and this gives us a basis of plotting this functional relationship between y w and x w into y t and x t. So, that let us now have a look at the final formulation. So, for the workpiece side you know that phi x w is related to the y w by the equation 10 plus 0.3 x w minus 0.05 x w square and we know that the final tool surface geometry as we have already derived before for a quadratic equation can be represented as y t equal to 10 plus 0.3 times of x minus 0.169 times of 0.3 times of 0.1 x divided by 1 minus 0.1 times of 1.0.169 minus of 0.05 times of square of this argument. So, this is that argument value if you may remember which was including the slope and which was you know including the slope in terms of the x t and the y t value. So, this minus 0.05 to the same argument 0.169 0.3 minus 0.1 x divided by 1 minus 0.1 times of 0.169 square of that value minus 0.169 which is the lambda by f or the equilibrium gap term in this expression. And so, if you solve all this you get a relationship between the x t and the y t as x y t is a 9.815 times plus 0.315 x t minus 0.051 x t square where both x t and y t are in centimeters. So, basically this is a very good methodology of giving a sort of optimum tool shape for a single curvature which is already given by a quadratic equation for the work piece shape. So, I think today we are kind of at the end of the lecture. We have learnt how to derive some of the very fundamental aspects of velocity of the electrolyte while moving through the gap. And we have also learnt that how critical it is because you know it will essentially be related to the pressure which would be a determinant of the maximum level of the velocity. And on the minimum level of the velocity would be determined by the temperature requirements which would ensure that there is no boiling action. We tried to apply this fundamental problem to see what are the surface finish related defects which come in an ECM process. Thereby we learnt a lot of you know different corollaries of the ECM process which happens like for example, sporadic breakdown of the anodic film or for example, the flow separation of the eddies or the hydrogen gas generation which changes local conductivities. And it is always a problem with the ECM because the local roughnesses would tend to change and the local current density is because of that would be higher. And you can have selective dissolution which creates further problems by coiling the electric fields. You can have a case where more hydrogen is generated because of which the conductivity goes up or the flow separation of the eddies thereby meaning the local precipitates can deposited at different places where the local conductivity changes would result in more or less current densities. So, these are some of the very prominent problems which are available with the ECM system. And the prominence goes high as you to micro system fabrication with such ECM processes. We also tried to determine the tool shape where we investigated how you can topologically map one tool surface to other. The other aspect of tool is the electrolyte flow design which will of course, try to complete in the next lecture because the way that you insulate a tool's edges, the way that you create a conduit for the flow of the electrolyte from the tool onto the workpiece zone decides a lot of machining parameters for the electrochemical processes such. And so I would like to investigate these one by one in the next lecture. Thank you.


Hey everybody welcome back to magic orthodoxy my name is David and this is a book review Hey today, we're gonna look at origin from Peter McKinnon and illusionist calm What is origin origin is a book that Pete McKinnon put out and it kind of has its own journey its own story to it? Originally Pete put out like a little tiny booklet or a little pamphlet called the black hole prediction Which was kind of a joke And it's included in here if you want to see what it is But it's pretty darn funny after that he put another couple of tricks together called the riot collection and From that he had developed a little bit more stuff And now it's all come together into this nice hard-shell book called origin now the way I feel about books If you've seen any of my past videos, you know, but I'll repeat it for you. I think books are great I think whenever an artist Takes the time to sit down and actually write through their tricks right through some of the things that are special about them The things that make them unique original just the brain workings of you know professional magician You should pick it up. Seriously Books are great. They go with you everywhere Books don't need to get plugged in books don't need to recharge you can take them camping You can take them in the back seat of the car. You can take them to church. Okay, literally you can take a book anywhere There's light to read by okay, and so the great thing about books is you can always pull them off your shelf And find your references quickly. You don't have to fast-forward or rewind or search menus Books are really accessible and so Pete's done a lot of great work putting this together for you And I think it's highly worth the money to invest in something like this Welcome to as the 8020 control What's cool about it is that you force the card and control it in one action Instead of doing them both separately like you normally would Spectator says stop right about there. You show them the car They stopped that and you want to just leave it in the center. That's it All you got to do and it's back on top, which is cool because it starts on top and it ends on top That's the 8020 Inside this hardcover book are 29 different effects. There's slight such flourishes all of it comes together and demonstrates Peter's just relentless need to excel in every art that he stumbles across in this You're gonna find tricks with cards tricks with hats tricks with rings tricks with wallets You're gonna find transpositions table switches and so much more This book really does cover all the eccentricness that we know and love about Peter McKinnon So you're gonna have a lot of card flourishes in here a lot of tricks with cards in here And just all kinds of little knick-knacks tricks as well that kind of pizza picked up and put together in this volume So it does really make it worth it to pick up As far as the book goes and its quality Adam Wilbur was responsible for getting it printed here in the United States If you don't know Peter McKinnon, he's actually from Toronto, Canada There's 220 hand-drawn illustrations in here by one of Peter's friends by the name of Perseus Arca Manus And they're really cool because the artwork actually picks Peter So when you look at it, it's it's Peter's body. It's Peter's face Thomas Lavity did the cover if you don't know who he is. He's out on Instagram. You might want to go follow him. He's pretty cool. Another guy named Carmen He did the layout for the entire book and then Dave Buck wrote the forward And so just a lot of great minds came together to work on this and put it together And so sometime this week. I also did a review for lock stock and Wyatt, which is Peter McKinnon's dvd And the great thing about having the book and the dvd is a lot of those tricks go together Every single trick on the dvd is actually in this book And so sometimes it helps to have both So you can kind of go back to the book as a reference But then maybe go back to the dvd if you need to kind of see it a little bit more visually And so I did I bought both at the same time and so that's what I would recommend if you have the opportunity I would definitely go out and try to find The origin book last I saw it looked like it was sold out on illusionist.com You might want to just fire off an email to Pete McKinnon and see If it's available still somewhere maybe through his website All right, so standard questions we ask like can you do this trick surrounded or what are the angles? Or is there set up and reset of course because there's 29 effects in here Some of them flourishes those questions really don't apply To a book and so I think going into this you understand that you're getting a book that has Almost 30 tricks in it. So you're going to get this and that and the other so don't think of it like that think of it more like this is a A compendium of wealth and knowledge that you will continually go back to to glean inspiration from how's that All right, so is it worth your money? Hey books are always worth your money the 115 pages 29 tricks 40 bucks definitely worth your money Who would like this? I think fans of Peter McKinnon fans of illusionist.com fans of just Card flourishing card tricks and kind of the things that we know and love about Peter McKinnon I think would definitely love origin. All right, so that is my review for origin from Peter McKinnon As always recommend that you like this video just so other people can find it faster We also recommend that you subscribe to this channel Just to stay up to date on the latest in cards and card magic if you want to follow me on social media You can I'm at facebook.com slash magic orthodoxy twitter.com slash magic orthodoxy instagram.com slash magic underscore orthodoxy And if you need more content, you can always find it at magic orthodoxy.com. Thanks. Bye


In girl's hockey tonight Northern Lakes was looking for the season series sweep against Detroit Lakes and the first Northern Lakes has the puck to the side of the net and from an impossible angle Alexa Holm finds the back of the net. Later in the first the Lightning take a shot from the points and the rebound is right there for Caitlyn Gootsman. She scores to get them up two to nothing and then they're looking for more Riley Fogarty's shot. Rebounds to Rose Aldridge for the three to nothing lead. The Detroit Lakes to make a comeback they force overtime but Hayden Belter's goal in OT gives Northern Lakes the six to five win. If you enjoyed this segment of Lakeland news please consider making a tax-deductible contribution to Lakeland PBS.


So, let me start off with a little bit of Bhashan, as you say, on what is happening in the database community in the last few years.  If you were a small shop, you wouldn't, certainly, because you needed a very expensive mainframe. Then there was a democratization of this whole thing, which meant there was a lot of focus on small databases, small databases which you could run on, you know, if you had a shop, you could keep your inventory in a database. And there were a number of PC products which built these small databases. That was going on. Meanwhile, for large companies, they increased the number of people using the databases. The company who was in the company became a user more or less over time. And the load that these large companies had to handle kept growing. The next trend in databases, so this load, by the way, was something that mainframes of that era could handle with Moore's law, CPU speeds kept increasing, memory sizes kept increasing. And as a result, a single machine could handle the needs of many enterprises. Of course, it need not be a single core. They ended up with multiple CPUs, multiple disks, but one installation with a few machines could handle the needs. Now, this state went along and at one point, people said, if we can reach a thousand transactions per minute of a particular benchmark, TPC, then pretty much everybody's needs are met. And thousand transactions a second, that was almost unimaginable. Who would need thousand transactions a second? Well, along came some really big retail chains. One of the drivers of some of this was a company called Walmart in the US, which opened hundreds and hundreds of shops. Each shop had dozens of people checking out items. So each second, there were items being checked out across all of this place. And what Walmart did was they pioneered the collection of every single piece of data about what was sold, what item was sold, what time. Even down to the customer, if they knew who was the customer, they would record which customer bought it. And they collected all this data. Other companies could have, they didn't. What Walmart did was they pioneered the collecting all of this data and putting it in a central data warehouse. Remember, this was in an era before the web really exploded. So they had already started doing all this. And they would get it together in a data warehouse, which collected this every night. They would upload all the previous days information about who bought what. And one of the key things that they did was they analyzed this data. What did they do with this analysis? They could see what products were selling, what products were not selling. They could keep their inventory really tight. Most shops would buy enough material to last them a few months. Walmart could tell their suppliers, look, we sold 40 boxes of this yesterday. Tomorrow, suppliers 40 more boxes to replace those 40. Or maybe they would say sell us 60 boxes because the trend is going up. So they could do all kinds of analysis on this data and manage their inventory very, very effectively. And for a retail operation, managing the inventory is a very important part. And even for manufacturers, in fact, they started giving manufacturers access to their data analysis systems. So manufacturers could see what products were selling where. So as a result, if you had a company, let's say Hindustan liver, they could decide what to produce in the next week, based on what all has been selling in Walmart in the last few days. So that helped the manufacturers. And this actually is set about a very virtuous cycle where there is a lot of efficiency brought into production because of this. And there was tremendous value. There was also tremendous scale. Walmart managed to create the largest databases in the world at that period. Their databases were of the order of terabytes of data. Back when this were hardly 10 gigabyte, this was considered very big. One gigabyte disk was normal. They had databases with a few terabytes of data, hundreds of machines, each with many disks. So they bought these systems from a company called Teradata, which was a pioneer of parallel database systems. So Teradata basically is a company which is doing very well today. They are still the leaders in the parallel databases for data analysis, and Walmart was one of their driving forces. Now over time, other companies realized that such analysis was very important, and today the number of companies with such large volumes of data has exploded. If you went back 20 years, you would say, okay, there's Walmart with so much data, who else has data? Maybe one or two other companies, why do we care? Today, if I ask you to name companies which have this kind of scale in terms of number of shops, number of things being bought in the shops. Right here in India, we have a fantastic example, big bazaar and the other shops in the future bazaar chain. They're probably as big as Walmart is in the US. And in addition, there's this other enormous thing which is telecom. Every second person in India has a mobile phone now, hundreds of millions of phones which are active, telecom companies which are processing calls. One of the major factors for telecom companies is that people switch. They go with one company now, and they find somebody else is giving a better rate, they go with that company. In fact, there's a new trend if you have been observing the ads of having dual SIM phones. The simple reason is people don't want to abandon their old phone number, but they want outgoing calls on this cheaper thing, so they can have two SIM cards. So it's important for companies to stay competitive, to do what it takes to keep their customers. And the major factor in this is to analyze customer data. Now, the Indian telecom companies are doing it these days, but in the US, a long distance phone call companies had these problems about 15 years, 20 years ago, the same problem. And they pioneered a lot of work in analyzing their data and figuring out how to keep customers. So the bottom line is that there are now many, many different industries where the amounts of data are very large and you need to analyze huge volumes of data. So parallel databases have become a very important factor. Now it's not just parallel databases of regular traditional data. Now there's this whole slew of web facing companies where the amount of data which they get makes Walmart looks like peanuts. They collect terabytes, not overall, the database is not terabytes. Their databases are many petabytes, thousands of times what Walmart was and is. That scale is something which was unimaginable some time ago for operational data. People had this kind of scale for image data. If you take all the satellites that are sending images, some institutions like NASA collect that kind of data and they store it. But they're not doing processing on this on the fly. So this is very different. The scale is enormous. So a major challenge is how to deal with data at this scale. So today I'm going to cover two aspects of this. The first aspect is assuming the data has been acquired and is now stored in some kind of storage system, files or whatever. How do you process this data to do analysis of various kinds in parallel? One part of the answer was to have parallel database systems. And they run SQL. You just run SQL, they will parallelize it and do what it takes. And in fact, there are many companies which provide this today. As an example, I mentioned Teradata. Let me put down a few names. Okay, so there are these companies, I mentioned Teradata. Then there is Green Plum and Aster, which was the company I had mentioned as being founded by an alumnus of here. And these things, as I said, used Postgres SQL as the underlying database. So what they do is they have hundreds of machines. And each machine is running a copy of Postgres SQL. And whatever data is there is partition among all the machines. And whenever you submit a query, the query itself is broken up, executed on the different machines. Then there is some amount of work to exchange data between the machines, as required to complete the query processing. Little more work in Postgres SQL. And lo and behold, your answer is there. In fact, what is interesting is, there was a project called affordable, I don't know if you can read this, affordable databases. Affordable parallel databases, I should say, which Professor Fartuck was carrying out a few years ago. And interestingly, in parallel with these companies, he also had architecture where there were a number of copies of Postgres SQL on separate machines. And then a layer on top which could parallelize queries amongst these. Of course, this particular project was never commercial, it was a research project. But the others do have commercial offerings which are quite well known and popular on the market today. So this is one whole class of companies which handle very large query processing. But these are all SQL. Now, about again, 15, 10 years at least back. Companies such as web companies such as Google, Google was a pioneer in this. What they realize is that they are getting a huge amount of data, which they need to process in some way. Now, most of this data was not traditional database data. Amongst the kinds of data they had to process were collecting web pages which they crawl from across the world and then building an index on it. That's one example. Another example is they have all these logs of what people are querying. And they want to analyze those logs to maybe to look at what answers Google has been giving and to check who clicked where and what answers. Is Google giving the good answers at the beginning or is it quality going down by giving answers at the beginning which nobody is clicking. So what they now have is huge amounts of click data, what people clicked on. So what people searched query logs and in the query result what did people click on? Click logs. So they have hundreds of millions of such queries and clicks every day. And they want to analyze those to see what is happening. So there's a lot of analysis on data which is not traditional relational database data which has to be parallelized. As you can imagine there is no way to analyze this click data on a single machine. There is no way you can build a keyword index on billions of documents on a single machine. All of this has to be parallelized, that much is obvious. What is not obvious is how much parallelism do you need to handle such jobs? And the answer it turned out was not tens of machines. Tens of machines was what Teradata, it was a piece of cake for Teradata. Hundreds of machines that was the upper end of Teradata's installation some years ago. Today they're probably much larger but the largest installation 15 years back was probably several hundred machines. Now companies like Google realize that several hundred machines were not going to cut it. What they needed was thousands, in some cases tens of thousands of machines to analyze the amount of data that they have. They really have to parallelize a task across thousands of machines. Now this was a complete new ball game. One of the important things which you realize if you have one machine it's up most of the time. If you have ten machines working in parallel well they are probably going to be up most of the time too. If you have a lab with hundred machines probably one or two of them are going to be dead. If you have a rack with a hundred machines probably one or two of them will die every few months. But when you go to thousands of machines at any point in time, surely some of those machines are dead. So you can never actually run a computation across all those thousands of machines. You cannot assume that all the machines are alive.  It does happen. Or even if it doesn't die it may have some problems with its disk. Which means it's still working but it's much slower than the others. So here was a computation which finished in two minutes on all the other machines. And one particular machine is chugging along after five minutes. It's still not finished. It's part of the job and it's holding up all the others. So the moral of this theory is when you get to such large scale you have to deal with failures. You have to deal with recovering automatically from the failures in the sense that if something was supposed to be done by a failed node, it should be done by somebody else. Or if the node is slow, somebody else should take it up to finish up in case this guy doesn't finish it in time. So there's a whole lot of fault tolerance which needs to be built in. So when you build applications at this scale, fault tolerance becomes very, very important. In fact, companies like Teradata knew about this and they did in fact solve the problem. Their SQL engines could continue working even if a machine died. How do you do a parallel computation if a machine dies? Well, first of all, if you have many parallel machines, the data is split amongst all these machines. This is called shared nothing parallelism. So what this means is you have many machines all interconnected. Each machine has one or more disks internally and it stores the data. So what do you do if a machine fails? You can't access its data, it's gone. Therefore, one key part is replication. So what this means is whatever data is here has to be, you have to keep a copy at one or more machines, one or more of the other machines. In fact, there are some very clever tricks here. Now one simple way is to do something like raid one where you just keep a copy of the same data on another machine. So you pair up machines and keep a copy of the data on every pair. So that if one goes down, the other has all the data. It turns out that simply doing replication in this fashion causes a problem when one of the machine fails. So think what if this machine fails? Its data is there on the pad machine, so the data is not lost. So now you can actually do whatever computation this machine was supposed to do. This is dead. So whatever computation it was supposed to do, this next guy is doing. However, the next guy was not sitting idle. You can't afford to keep half your computer idle. It was already doing some work. Now you have a situation where you have 100 people doing work. When one guy dies, his partner is now responsible for doing both their work. What's going to happen? It should be very obvious that that partner is going to be overloaded. He is doing the work of two people. He cannot keep up with the workload. So instead, one of the key things which is done is, you think of this machine's data as being split into 10 small parts. Now the first part is replicated here. The second part is replicated as the next machine. The third part at the next one and so on. So what you have done is you are doing replication. But you have partitioned the data at each machine into small pieces and the replicas for each piece of data on a different machine. So now if this guy dies, guess what? Each of these other 10 people have one 10th extra work. So whatever work they would have finished in, say, 10 minutes. Now they will take 11 minutes to finish, which is not so bad. It's not as bad as eight of them finishing in 10 minutes and that one guy whose partner died taking 20 minutes to do it. So it's a lot cleaner this way. So replication is a key property which any parallel databases uses in order to spread the load around when things fail. Okay, then the next question is, how do you even parallelize a query? If I give you an SQL query, how do you run it in parallel? It turns out the answer is, first of all, you have to partition the data itself. How do you partition the data? There are many ways of doing it. Let's take a very simple way. We just take one tenth of the tuples in each, if I take a particular relation r. I will take one tenth of the tuples of r, put them in machine one, one tenth in machine two, arbitrarily in any old way. I don't care how I put it. I just put those tuples. Now supposing I get a query which says, find how many tuples there are in this relation. How would you answer this query? The tuples are broken up amongst 10 machines. Each machine can locally count how many tuples there are. It gets the count and then sends it to the central query site, which then adds up the 10 counts to get the final count. So what you have done is, you have effectively run this whole counting process completely in parallel. So that is one of the key tricks, which parallel database is used. It is not always possible to get this fantastic degree of parallelism. But in many cases, you do. So each machine works independently on each part of the data. So this is called independent, meaning first of all, before any query processing is done right at the beginning. When you load the data, the data is partitioned amongst the machines in some way. There are good ways and bad ways. Let us not bother about how to do it. It has been done somehow. Now when you get a query, a simple count query, it was very easy to parallelize. Now let us go one step above. Supposing the query was not just a simple count, but it was a select something like let us say shop ID comma count star or it could be some for that matter, from sales. This was the query, group by shop ID. So what do we have here? Oh, what happened? I should look at the screen when I am writing. I am sorry, if you are wondering why I am doing this. There is a blank sheet of paper. I take out the sheet of paper. The whiteboard does not get erased. The paper is erased because I have a new one. The whiteboard still has old stuff. So today I am writing everything twice. I have to again write this twice. Let me erase the whiteboard. I cannot actually see the whiteboard when I am writing. I could, but I end up seeing the paper. So what I was saying was this is called independent. And the query I had in mind was select shop ID, count star from sales, group by. So the question is how will you parallelize this query? If I did not have a group by, parallelizing it was very easy. So what I did was each machine locally computed the count, sent it to a common machine and it just added up the counts. Now with the group by I guess what you need to do. It is actually not that hard. With a group by what you do is each machine is going to run exactly the same query on whatever records it has locally. So what its result is going to be is not a single count. It is actually a set of shop ID count value. So maybe each machine, the first machine might give something like shop ID 1 count 5. This is at machine 1, shop ID 2 count 10. At the same time the next machine may give shop ID 1 count 3, shop ID 2 count 1 and so forth. So now you have these relations which you have got from each of the machines. How big are these relations at each machine? They are probably a lot, lot smaller than the original data. How many shops do you have? Even a big chain like Wal-Mart has only thousands of shops. Whereas the amount of data that is in there is probably millions of records sales each day. Each shop has thousands or tens of thousands of units sold. So the amount of data which you get as a result of executing this group by query locally at each machine is much smaller than the original data. Now the trick is that in a simple setup the results of each of these machines can be collected at one machine which then runs in local sum query. So it is going to again group by shop ID. So these two groups which shop ID 1 will form one group and this time instead of counting it is summing. So it adds 5 plus 3 and gets 8. So if there were just two machines in this parallel setup we just have to add up these two and you get 8. What if you have a hundred machines in this parallel setup each of which with a thousand shops. So now you have a hundred thousand records which you have to again group by an aggregate. At this scale it may actually make sense to do this second level of grouping and aggregation in parallel itself. So I hope you understood the problem. First of all each machine is locally done the group by an aggregate on whatever data it has. After this one option is you send all of this to a central machine which again does a group by aggregate. The other option is you actually divide up these records across those machines such that all the records for a particular group let us say all the records for shop ID 1 maybe not just 1 a few other shop IDs. So let us say that we take all shop IDs in the range 1 to 10 go to machine 1. 11 through 21 go to machine 2 and so forth. So what we have done is we have divided up shop IDs amongst machines. So what happens is each machine has computed a local table of shop ID pairs and now it is going to distribute these tuples to the respective machine. So it will say my first record is for shop ID 1 I will send it to machine 1. The second one is also for shop ID 1 I will send it to machine 1 again and then here is one with shop ID 11 which is going to send to machine 2 and here is one with shop ID 123 which it may send to machine 12 or 13 in this case. So the idea is each machine is going to get a part of this. Now machine 1 can do a group by and some locally on whatever it gets and what does it give finally? It gives for each shop ID for 1 it gets a final count let us say that is 8 for 2 the final count. So this one machine has done all the computation required for its range of shop ID. So shop ID 1 to 10 machine 1 has done its computation and it is finished. Similarly for shop ID 11 through 20 machine 2 will do its job and it is finished. What have we just done? This job of the second level of aggregation we have actually parallelized across all the machines which are in our cluster and each of them is again doing a part of the work. At the end each has finished its work locally it has got all the data. So the final result is now stored locally in each of these machines and the only remaining job is to gather all the local results and output it to the person who submitted the query in the first place. So what I have just shown you is aggregation can be parallelized very very easily. It is a very natural thing to parallelize. What about other operations in SQL? Joins and so on. In fact you can parallelize joints and in fact we have seen how to parallelize joints although I did not tell you that was parallelism. Just think what did we do when we did hash joint? We partitioned the data and then we joined each partition. So if you want to parallelize joints a very natural thing is to break up the data. Now it turns out that the data is not initially at one machine. The data itself is already partitioned somehow. So here is the data partitioned across. So here is the data across many machines. It is already partitioned somehow but it may not be partitioned on the joint attribute. So what we do is we apply hash joint but we are only going to do the partitioning step of hash joint initially. What is the partitioning step of hash joint do? It computes a hash function on the joint attribute and partitions. So this is one relation R. Similarly we have to do something for S. It is the same thing so we will postpone that. So what we do for R? So here are the hash partitions. So when R goes, when each of these machines, this is machine 1, 2, 3, 4 and so on. So what machine 1 does is it hashes its tuples and sends it to the right place. So now these hash partitions are again going to be on machines. So machine 1 will correspond to the first hash bucket, machine 2 to the second hash bucket and so on. So the number of hash buckets you create is equal to the number of machines. So this data is going to get partitioned and it is going to receive tuples which hash to the value 1 from each of these machines. So each machine is going through its tuples, computing the hash value and then sending it whatever has hash value 1 to machine 1 which will collect that in its hash partition. Similarly those with hash value 2 go to machine 2 and so forth. So what have we achieved at the end? We have, what we have achieved is we have repartitioned on joint attribute. So that is the goal of this phase. So what we have done is we have repartitioned one relation R on the joint attribute. Well now we do the same thing with S. S is also stored on the same set of machines. We repartition S on the joint attribute and what do we have now? After we repartition S, so this is H 1, H 2 and so on, H n. Similarly S 1, S 2 and so on up to S sorry R 1, not H 1. R 1, R 1, R 2 up to R n and on this side you have S 1, S 2 up to S n and at this point the joints can be done locally. Each machine has all the tuples which it needs to complete the joint locally on whatever it has. What do I mean? The i-th machine here has hash partition i of R and hash partition i of S. All we need to do now is join the corresponding hash partitions of R and S. So each machine locally does the join of whatever R i and S i it has, does the join and outputs the results locally. So what have we just done? We have just taken joint operation and shown how to parallelize it across machines. There is a cost. This thing here, all these lines here which you see going from here to here. These are all edges which are actually network traffic. Tuples are going across the network to repartition the relation. This is actually fairly expensive. So nothing is free. But if your network is fast enough, this will work reasonably fast and then you do the joining locally and you are done. So what I have just shown you is it is actually quite easy to partition and parallelize the join operation. So the moral of this theory is you can continue with other operations, even sort and so on, can be parallelized. So the moral is that you can take an SQL query, take the standard relational algebra operations we have seen so far and parallelize them very effectively, whether it is join, selection, group by, sort, whatever. We can parallelize all of them. As a result, parallel databases succeeded in many applications where other parallel things, back in the 80s and 90s before the web era, people built a lot of parallel computers and they were used for two tasks. One was for scientific computation like weather prediction or simulating nuclear bombs or whatever. And the other was for business applications which had to store and analyze large volumes of data and parallel databases did very well in that market. So now fast forward to the current era of web scale computing and it turned out that they needed to parallel process, but they had a lot of jobs. Now SQL is a language which was designed for doing, storing and processing data in ways in which typical applications or commercial requirements needed. And that made complete sense to parallelize access to data. You have a declarative language for querying data. The declarative language was invented not for parallelism, but to make the programmers job easy. But a fantastic side effect it had was that you can parallelize SQL queries very, very easily. Think about it. If instead of having SQL, the same thing had been written in C code. It's notoriously difficult to parallelize C code. But simply by using a declarative language, life was much easier and it was parallelized. So that is where the world was pre-web. But when the web era dawned, people realized that they have a lot of tasks, many of which could not be expressed very easily in SQL. There were much more complicated tasks which actually need to be parallelized and processed on very large volumes of data. And the data again did not necessarily have any good fit with relational databases. As an example, if Google has crawled the web and it has a local copy of all the web pages which it found, now it needs to do some analysis on this. It wants to compute page rank. If you have not heard of page rank, it's a way of ranking web pages by computing some statistics based on what web page links to what are the web pages, which was the major reason that Google came into prominence about 15 years back. When Google, well, less than 15 is what, 12, 13 years back, I should say. It became an overnight hit because they had a new way of how to rank websites or web pages, which gave much better, much more intuitive results than what other search engines of that era had. In fact, if you think about it, page rank was described in one paper and it can actually be expressed in a few lines of code. But that was the major difference which catapulted Google above all other companies. That was the key thing which let them give better search results. Then, of course, many other things followed. Once it was clear that they had some really cool technology which gave better results, people are attracted to it, they got funding, they could do many more things. They built thousands of applications which all of us use today. But the key step initially was this page rank. Now, it turns out the page rank computation on the web scale is actually not that easy. It is very easy to give an equation for computing page rank. But how to compute it on billions of documents? Computing a matrix computation with billions and billions of entries is mind boggling.  So, the question was how do you parallelize this kind of processing? Across not one, but thousands of machines. Each machine has some documents and you want to do some work on each of those machines. So, what Google did was it went back to an old paradigm for parallel processing called map reduce. Map reduce was introduced long ago. I think it was how long now? I think maybe 35, 40 years ago, the concept of map reduce was introduced in the programming, parallel programming language community. And it turned out that it was a very, very nice way of expressing how to parallelize certain computations which did not fit at all with SQL. So, what I am going to do next in today's lecture is switch from these parallel databases which have certainly been very successful. They are very useful. In fact, we have a chapter on it in the book. And feel free to read it and read the slides and then read the chapter. What I gave you here on the whiteboard was a small peek at what is there in the chapter. There are many more details. And certainly talking of whiteboard and slides. For the past nine days, I have been using a lot of slides. Part of the reason for using slides is it makes it easier to cover material and it makes it easier to go through material very fast. It turns out though that students do not necessarily like slides. What happens is we tend to go very fast through this material. It is quite probable. In fact, I am almost sure that many of you found the pace of some of these topics extremely fast and things zipped by extremely fast. Part of the reason I did this in the course is the time is limited. There are many topics I wanted to cover. And moreover, the assumption is that many of you have taught a database course already and are familiar with the fundamentals. So, I hope it was not too bad for most of you. But when I did the same thing with students, they kind of lost it. So, of late, I use the whiteboard a lot more with students. I keep slides as a backup for certain things which are too tedious to write or draw on the board. But for all other things, I use the whiteboard just like I did with you, drawing a few diagrams. It reduces the pace. More important, it reduces the amount of material which I cover in a class. But it turns out there is a big benefit. The students actually understand the material in a lot more depth than if I put it on a slide and zip by. I say here is something. Hope you understood it. Move on to the next slide. And guess what? They did not understand it. They did not get a chance to recover. When I do it on the board and take some time explaining it, they have some chance to catch up, assuming they are attentive. Of course, there is another problem which everybody has. I have heard this from other faculty in IIT. I have heard this from faculty in other IITs. I have heard it from faculty in other universities across the world that capturing the attention of students these days is very difficult because they feel that all the information that they need, they can get from Google. They just search Google or whatever. Bing or Yahoo or read it. You name it. They can get it from their favorite search engine, which is kind of true actually. If you just take raw information, yes, they can get it. But the point of teaching a course like this is to curate that information. To decide what of that enormous amount of information makes sense and to teach it in a proper flow so that from one topic to the next, you have the background and can understand the next topic and so on. Our job as teachers is to organize this flow and to have examples and help students learn it. Some of you probably only use blackboards. To you, there is no point saying this. You are already doing the right thing. For those of you who like me use slides and we do make slides available for the book, they are very useful. It's quite nice to back off from slides and use the whiteboard wherever possible.


Here's what this program does line by line. Up here we're setting a color variable with these values. Here's the setup block. First thing we do is tell it to make the background, the color that we set up here. And we're telling it what size to make the display window. Here in the draw block, we're setting a default fill color. And then we have two if statements, one after another. The first one says that if the cursor is greater than 100 in x and less than 100 in y, to make the fill this color. So this logical and here means that both of these have to be satisfied in order to execute this command. Same down here, but we're just giving it different places to look for. And then a different fill color in case this is true. When you write if statements that aren't nested, that are separate from each other, you have to make sure that the test couldn't be satisfied by both of them at the same time, because that will give you strange results that you're not expecting. Even if both of these turn out not to be true, we're going to draw this rectangle every time. And the ellipse is going to follow the mouse around. So let's see what it looks like when it's running. So there's our rectangle. It doesn't move, but it does change color, depending on where the cursor is. The circle follows the mouse around. And it changes color, just like we specified.