Thanks so much for joining us. Thank Taikawaii, Rule of Law and the New Abnormal, and the election issues that may make a difference and results that may make a difference. So we have the good fortune of having with us today Louis Zeng, partner in Dentons, one of if not the largest law firm in the world, with branches in dozens of countries. And David Louis, former attorney general for the state of Hawaii, partner at Kobayashi Sugita and Godot. And folks, we're getting to these short strokes on the midterm elections. Are they gonna make a difference in the direction this country goes or the principles and values that are important to you and to most of us? What do you think, Louise? Oh, thanks for starting me off, Chuck, but I hope that that means the rest of you, the two of you will carry the rest. But I guess I am following the midterms and the ups and downs of it with great interest because I just see that the last few years have really increased the dangers to democracy, so to speak, and the level of rhetoric and the level of bitterness and division. And I'm not sure that this election is gonna help reduce the bitterness and division. I hope it does move towards that part, but I am hopeful that there is a growing, I guess, maybe strength in the appeal of democratic party values. And I'm thinking in terms of reproductive choice and just upholding the rule of law and the knowledge of civic engagement and democracy rather than intellectual dishonesty. I'm hoping anyway that Stainer Mines will prevail on those issues I guess maybe one hopeful sign is I was in Alaska right before their election to fill the seat that had been vacated by the late congressman and Mary Peltola prevailed over Sarah Palin. And she is a democratic candidate in a red state. What I found interesting about her is that from all of her interviews and the like, she seems to be somebody who wants to bridge divides who has a history of bridging divides who had kind things to say even about working with Sarah Palin even though they disagree. And if we could get more people like that in Congress and in places of power, I think that that would be important. That's a great insight. David, how do things look to you? Hey, so I am, how shall I say this? How shall I say this? Always hopeful that democracy as we have known it in the United States for the past, let's say 30 years or maybe 50 years will prevail. But there's many forms of democracy in this world and many of them have resulted in authoritarian regimes. Russia is theoretically a democracy. Hungary is theoretically a democracy. And China is theoretically a democracy. But none of those are truly democratic countries. So the thing about elections is they come up, they're very banal, they're very sort of plain, but they have tremendous consequences, tremendous consequences. And so while we are focused on the Senate races and the governor races and things like that, some important elections are gonna occur in the down ballot offices for the elections officials, actually the secretary of states because there's a bunch of election deniers and stop the steal Trump supporters who are more than willing to throw out the actual ballots and not deal with the true facts but say that they would certify or decertify an election that went against Trump and they're up for election. And if they get elected in Arizona or any of the other states where they're on the ballot, it will be a truly a disaster. And democracy as we know it is undergoing tremendous changes. So I worry about that. I also, you know, while I appreciate that this Native American woman, Mary and I don't know how to pronounce her last name Peltola or something like that. Peltola. Even though she got elected over Sarah Palin, that was only to fill out the three or four month term. And there's gonna be another election. And I think Sarah Palin is gonna put up a better contest. So it may be a very close election and it's not at all clear that she wins in the November election because Alaska is truly a red state. And so that may happen. And last time around Sarah Palin said told her voters not to put down any second rank choices because they have ranked choice voting which was a tremendous mistake. And I don't think they're gonna make that mistake again. So we don't know really what's gonna happen there. But insights and perspectives and thanks too for bringing up the fact that democracy takes many forms. And for us here in the United States, it's long been maybe more of an aspirational goal on an ideal than something that we can comfortably say we've achieved with stability. In fact, in a number of respects, we're still short of a democracy in the electoral college as opposed to the popular vote or the presidency. And in exactly the areas that you point out David, where election control, removal of people from voting roles, restriction of access to voting by taking away mail voting, taking away absentee, voting opportunities, all those things make us less of democracy. So where do you think the turning point issues are gonna be or what direction this country takes? Particularly in the congressional elections in the midterms. Louise, any thoughts? Well, let me just add this thought. I think as David said, the congressional elections are important, but I also think that we need to pay attention to local elections as well because that's where the power is devolving for such things as reproductive rights, gun control and the like and voting rights as well. Unfortunately, the congressional side, what I've been hearing on the news is that on the Republican side, they're gonna be playing up the economy and crime and the need for strong leadership to address those issues. Of course, on the Democratic side, we've got the bigger issues of, well, not just reproductive freedom, but gun control, sort of the other side of safety. And it seems to me that, I guess to me it boils down to voters need to stay engaged, they need to vote, they need to be reading and thinking critically. And voting on all of the elections up and down ballot, David, you make a great point about the importance of even Secretary of State elections and certainly our state and local legislatures, although we don't, we are a pretty blue state. It seems to me, even here in Hawaii, we do need to be vigilant because of course there are strong views on both sides. You know, we in Hawaii live in a bubble. We're a strong blue state, which is in some ways unfortunate, I wish the Republican party here was stronger, I wish there was. And there are a number of people in the Democratic party who might be enticed to become Republicans again or might have chosen Republicans if the Republican party was more moderate, both nationally and locally. But having a two-party system or having more voices, I think is important because it gives people a choice and it allows them to express themselves. As far as what's gonna happen, in the future, I think that congressional races will shape what President Biden is able to get done. It sounds like the house is gonna flip and so then that's no longer gonna be a Democratic house. That's what I'm hearing, I don't know and maybe the Senate will, maybe the Senate won't. We have such a divided country and such divided government, it will hamstring Joe Biden from doing almost anything except taking executive action where he can take executive action. But otherwise we're gonna have continued gridlock in Congress, which is unfortunate and is a sad thing. It's certainly no way to run a country. Yeah, no kidding. Yeah, where did bipartisan should go?  And how long is it gonna take?  No, and that's a good point. I think the only instance of a clear effort at bipartisanship on a key issue, gun control came from Chris Murphy right after the valdez, Miss Fortunes and tragedy. And even there, the changes were extremely limited and not likely to make a large difference in the access to guns for most people. And in fact, even in Hawaii, we're seeing stronger and stronger pushes for more access to not only open carry but even concealed carry legislation. Yeah, I think that the actions of the United States Supreme Court have made this country more dangerous, have made life cheaper and have made the propensity for violence in cities and states much, much greater. The push of the Supreme Court to allow virtually unlimited gun ownership, concealed carry and open carry in any places is leading to huge numbers. I saw an article the other day just citing the huge numbers of deaths, the doubling and tripling of deaths by gun violence that have occurred in the United States since these rulings have come out. And I put that right at the feet of the Samuel Alito, John Roberts, Clarence Thomas and the others. And it's sad and it's unfortunate that that is occurring. I think we've said this before in other sessions here and even outside of the sessions but David, I feel the same as David and what I feel is just horribly ironic is that at the same time as they are loosening gun controls, they are tightening reproductive freedom. The freedoms that you're free to choose guns just not your bodily, your reproductive rights. And so there's this whole disregard of, you're forcing people to bring children into a more dangerous world.  And yes, the Republicans might talk about what we're gonna also address child care and child welfare, but where does that come in and their economically conservative views on things? It's just, yeah, it's nuts. Well, and that's a great question because unless I've missed something, which is quite possible, I haven't really seen any kind of specific concrete detailed Republican platform on any of these issues other than some that come out from Scott or Paul or others as kind of fringe positions. So where are we headed? Well, I think at least for the courts and the Supreme Court has made it very clear that they are going to roll the clock back, that they are going to cut back on federalism. They are going to hamstring the national agencies from being able to do anything in the common good and the public good and that they are going to allow state legislatures to become supreme without any how shall I say this? Without any rails on them or guidelines or fairness or basic equality of opportunity or basic equity. And so we are going backwards now. It's interesting and I was thinking about this, Chuck, because your show is the rule of law. But, you know, the rule of law doesn't, we use that as shorthand for something that's good and something that's fair and something that's equitable and that no man should be above the law and that is true, no man should be above the law. But there was a time in this country, in the deep South, when the rule of law was used as a tool of oppression against blacks. And in fact, I remember all of these stories where the Nazis came over and studied the rules of law that the state legislatures, which are now being allowed to do these kinds of things, had put into place that discriminated against blacks and took away fundamental rights from blacks, women, other people of color under the guise of the rule of law and the Nazis said, oh, that is terrific genius. We're gonna use that and we're gonna oppress and then exterminate a Jewish people. So it's not, I mean, rule of law, the way we kind of think about it is a positive thing. And if there are basic fundamental fairness values behind the rule of law, then I certainly support that. But it can be a tool of oppression and unfairness and discrimination as well and people do that. And we always have to be careful about that. And that's a great insight because what we're hearing from both of you is the need to reestablish, to support and protect the values on which democracy is able to achieve stability and growth and to be available on a more egalitarian basis on a more equitable basis, to especially even those marginalized and disempowered. And over on the other side, again, unless I'm missing something, I'm not seeing the values and principles of democracy, getting that kind of priority. In fact, in voting rights, in reproductive rights, in affirmative action and educational rights, David, you nailed it. We're going backward, fairly quick. What I find so frustrating is how the right and conservatives are misusing, co-opting the terms of racism, anti-democracy and the like, to drive their point home, which is, in my view, basically abandoning all sense of principles and value and democracy and just going for, okay, what's gonna get us to power? And I found distressing and sort of along the lines of that, the recent statement by our former Congresswoman, a leave in the Democratic Party for an independent party and accusing the Democrats of censorship and anti-democratic principles and the like, where have you been? Oh, I guess that's a whole problem, where have you been? But, and I guess as we talk about this, even though I say I am impatient for more representation of Democrats in Congress, I think we are in the long game. And in that regard, I'm thinking, for instance, of they're gonna be having to be voices that speak up, tell stories and just continue to speak up. Chuck, you had shared last week a piece by Judge, I don't know, Professor Richardson, who does such incisive commentaries on almost a daily basis, but she had cited the comments by Judge Katanji Brown Jackson in one of her first hearings on a voting rights case and how the state was in Alabama was using the 14th Amendment to say, we need to be, we can't be race conscious. It's a race blind, equality needs to be race blind. And she turned that on that head and said, well, if you're gonna look at historical constant, the historical roots of the Constitution, think about the fact that the 14th Amendment was put in place to combat discrimination against blacks and to right the wrongs that had been done against blacks. And I thought that was a point that she's probably gonna have to be making repeatedly to the originalists on the Supreme Court, but it's good to have her voice. And that's really important. And in fact, right after her teaching, Justice Solido and the others, a really important legal and historical lesson on the real origin and intent of the 14th and 15th Amendments to counter policies that were not race neutral. I mean, just the idea, I was born in Louisiana, but the idea of Alabama coming in and saying, we need to be race neutral. We can't take race into account. And David's phrase off the rails may come into play there, particularly with our former Hawaii Congressperson as well. So David and Louise, what do you see that might turn this back in a healthier, more value-based direction? That's the $64 million question. Or, and, you know, it's not clear at all, I think, as to whether or not people will come out and vote. But that's, you know, the ballot box is the way to power in this country. The Republicans have been more successful about that. And in focusing upon that, and then the Democrats have. Part of that, I think, may be the constituents that have made up the Democratic Party in the past and just the global forces that have occurred. But I still believe that it is the ballot box, which is the great equalizer. And I just, I hope that people will vote, you know, and vote in favor of values that are Democratic traditionally held values. But, you know, that doesn't always happen. Doesn't always happen. And people vote for their reasons, not my reasons. So, you know, I'm hopeful, but I'm also skeptical and pessimistic at the same time. And I keep thinking back on the theme I've mentioned before about the importance of, well, it's like the long game against, you know, it's education. It is focusing on and reviving more civics education and supporting that kind of thing. And, you know, the storytelling, the storytelling is important on, you know, that's how we kind of understand how these principles affect people in real life historically and currently. And so I think we need to look to our kids, make sure that they are socially aware. And I do get a sense that in many respects, they are way more socially aware and sensitive to social injustice than perhaps our hardened older folks who have been seen the ups and downs. But I just, you know, I think it's, you know, having courts in the community, for instance, having the Supreme Court take their oral arguments to the high schools and inspire, hopefully future generations of kids to go to law school or become legislatures and understand, you know, our historic democratic principles and what makes government run. I hope all of that will get people engaged.  So one of the things that I think I'm hopeful will make a difference is the January 6th committee hearings that are going on today. I don't know if that will have an impact on these midterm elections, because Donald Trump is not on the ballot and the January 6th thing is all about Donald Trump. But it's also about his supporters as well and whether or not they get elected and the people who cozy up to Donald Trump. And what's unclear is whether or not those hearings, which are a little bit of inside baseball will make a difference to the average person who votes or whether or not they're gonna vote based upon gas prices, the economy or just the culture wars that they don't like, you know, certain groups or they don't like the direction of certain things.  I mean, we have Herschel Walker running against Ralph Warnock.    So you just don't know. Like I said, I'm hopeful, but I'm also a little pessimistic. Well, the other thing is that I'm sure all of us get like too many emails, crisis emails about you need to donate to this or that campaign. I do think it is important to put your money where your mouth is and donate. I wish they would stop sending so many. But, you know, I think that's an integral part. And I think getting our young ends to vote as well. But, you know, what started off this conversation and topic two off camera, I think was the whole issue of yes, the effect and January 6th and the instruction hearing should have impact. Will they have impact by the same token? Why is it taking so long for a criminal like Donald Trump to have consequences to his actions? That is crazy too. I mean, most of us had done half the things he did would already be prosecuted and in jail. And, you know, there's this strong part of the population that still believes in him despite everything. Although I was interested to hear in a NPR commentary yesterday, one Republican strategist saying, oh, you know, he's actually not that popular among voters. He's not helping some candidates. Well, then let's hear about that from the media. What's the media doing always focusing on him? You know, that part is frustrating too. Okay, this is just venting some of my frustrations. But I just think it goes back to people need to be critical readers and thinkers and also just look at what are the big issues facing our country in the long term and what kind of country do we wanna leave for our kids? And then in the meantime, are we educating our kids to, you know, think that critically too and to value democracy? And those are really important points because if there's major damage, exactly as you point out, to the democratic institutions, principles and values in the short term, they're not gonna be there available to us in the long term. Of course, it's gonna take a lot of work to get them back. And it'll take a long time. What do you see in the younger generations? Is there any sense of where their mentality, where their awareness, where their choices may be directed or headed? Well, I see a mixed bag, quite frankly. I think there is a tremendous cohort of younger leaders who are fearless, who are ready to step up, they're willing to give their opinions. Their opinions, unfortunately, are not always my opinions. But that's why, you know, that's democracy and that's their entitled to their opinions. And at the same time, so I mean, I think there's a tremendous amount of young people who are willing to lead, able to lead and have the gumption and spirit, determination and ambition to lead and to get involved at the same time, there's a tremendous amount of apathy. Both in younger people and in the electorate, generally. They don't see how elections affect their lives or they've given up hope. And so it's a dichotomy, both a lot of hope but then a lot of depressing factors that exist as to where we're going. And David and I may have maybe, you know, bias views because of course our kids do tend to share the views that we have in terms of what is social justice and economic justice and racial justice and the like. But I have to say that, you know, as I listen more broadly, you know, what I'm hearing is just more attention to, okay, you know, accepting more diverse people, wanting to achieve a more socially just society, actually environmental and climate change is a big issue and it should be a big issue for them because they will be living the effects of global warming. So I'm hoping that we see our kids, you know, getting more engaged, at least speaking up, and that's good. And I hope we're gonna see that on a broader basis. And on that note, we're out of time today but thanks so much. At least we'll see where youth helps take us and what kind of difference they make. Indeed. Thanks so much, David, Louise. Thanks. And everyone, join us again in two weeks, we'll be back. Thank you so much for watching Think Tech Hawaii. If you like what we do, please like us and click the subscribe button on YouTube and the follow button on Vimeo. You can also follow us on Facebook, Instagram, Twitter and LinkedIn and donate to us at thinktechhawaii.com. Mahalo.


All right. Hey, Martin, what does it say at the very, very top? Memorizing. Yes and no. I don't like memorizing. I'm teaching that, folks. I don't like memorizing stuff, unless I absolutely have to. What I'm going to do along the way of this lesson is to show you how, if you can do a bit of arithmetic in your head, you don't have to memorize these. You can derive them in about a second. If it took 10 seconds to derive them, then maybe I'd say it's worth memorizing them. Just 10 seconds on a test over and over that adds up. But you can derive them in about a second. So the first one, it's what we call the quadratic equation. The basic one is this, y equals x squared. What is that a graph of you learned this one last year? This is a parabola. Parabola is a quadratic. It goes through zero, zero, one, one, and then two, four, and then three. I think nine is, I think my graph goes eight high. So nine is one off the graph. Did your teacher last year teach you one, one, two, four, three, nine? Okay. I don't know if every teacher does it. When I teach, in fact, I think Mr. Gerard speaks it a bit. His is one, one, one, three, one, six or something like that. I memorize one, one, two, four, three, nine. Those are the key points. In fact, when I teach it in math 11 blame, we call it our mantra. A mantra is a chant that you repeat over and over to relax yourself. But I stole that word for a parabola because I said anytime you do a parabola, I'm thinking one, one, two, four, three, nine. One squared is one, two squared is four, three squared is nine. What's the standard form of a parabola?  Why was that minus? Because then the brackets was backwards. A told you if it was positive or negative, A told you which way it opened. And it also told you the vertical stretch, what you had to do with that one, one, two, four, three, nine. There is also general form for a quadratic equation. That's the one that you're used to seeing when you want to solve a quadratic equation. It was this one, Y equals AX squared plus BX plus C. That one is handier to do math with. Standard form is handier to graph with. And remember doing that thing called completing the square last year where you could rewrite parabolas as standard form. We won't be doing it again this year, but in calculus, you probably reviewed it when you did conics. Those of you that are in calculus.  Hey, what is the quadratic formula? X equals what? Negative B plus or minus? What is it? But I'm going to give you a candy for that. Can we say it backwards? A2 overall? Are you serious, Mr. Good? Sure. C A4 minus square B root square minus plus B negative equals X. I'm enough of a nerd. We love the quadratic formula, Blaine. To us in math, it's almost, I tell my students when I show it to them in grade 11, it's almost like iambic pentameter in English. It's almost poetry. It's one of the only times in math that you guys don't know this because you don't know all that much math yet. I got a math. It's one of the only times in math where you can get a formula that works for anything, any quadratic. There is no cubic formula. They've looked long and hard. In fact, they spent about 200 years looking. The turn of the century in that position actually proved that there isn't one. You can't find one. There is no to the fourth power quartic formula. There is no to the fifth power formula. In fact, in all sorts of other equations, you'll notice, well, have I given you an equation solving formula this year? I could give you steps. So for exponential equations, I said, well, get the exponent by itself and then take the log of both sides. But there was no formula yet to tweak it a little bit. For log equations, I couldn't give you a standard formula. So we like it. x equals negative b plus or minus the square root of b squared minus 4ac all over 2a. Make that a little larger. Clara, you do it differently in Germany. I believe you have an equation that has the letter p and the letter q in it or something like that to solve a quadratic. If you can solve it that way using the p and q method, good, I don't care. In North America, we use this thing here. And you don't need to freak out. I'll show you how it works another day. So just copy it out if you want to. Although you know what? This unit, you won't need it. And the unit that you do need it, you'll have a formula sheet by then, which actually has it on here. In other words, staff, you don't need to technically memorize this in math 12. But it's so important. This is one of the few times that my nerdishness overcomes my unwillingness to memorize stuff. OK. Domain. What's the domain of this particular parabola? In fact, what's the domain of any parabola? All reals. It goes from negative infinity to positive infinity. Now, we're going to define that a little more fussy. What we're really saying is this. Madeleine, in this generic standard form for parabola, you can put in any x value. No extraneous roots, no rejections, no. Martin, you always get a date on this graph. A smile on his face. The relief on his face. So we don't write all reals. Though we write x belongs to the set of all real numbers. That's the shortest. Well, that's the second shortest way to write all reals. Those of you that are in calculus, you know the shortest way is that. But that's interval notation. And so you're not going to use that. What's the range? Well, first of all, what's the range of this particular parabola? Greater than or touching zero. Now, this is a specific example. Can you generalize what's your range here? It depends on whether it opens up or down. Good point. So I'm going to say this. Y is greater than or equal to zero for our specific one. For the generic one, it would be Y is greater than or equal to, or it could be less than or equal to, but the letter P, sorry, not the letter P, mister, do I mind your P's and Q's? The letter Q, the Y coordinate of the vertex told you what your bottom or your top was. I'm not going to give you a generic one. Like I'll give you specifics, but we're just trying to refresh your memory from last year.  Vertex. What's the vertex of this particular parabola? What, comma, what? What's the vertex of this parabola? What, comma, what? Okay. Let's do that one generic. The vertex is P, comma, Q. And if there are no numbers in those locations, it's zero, comma, zero. Do you remember the equation of the axis of symmetry? What was the axis of symmetry? That was the line that ran right down the middle of your parabola and exactly bisected it. Pardon me? That's the slope of it. I heard it correctly over here. Angelo, you just impressed me. What? Isn't it Y equals zero because it's vertical? No, it's not. And this is one thing we've got to recognize. Okay? You were right the first time. Vertical lines are X equals. Horizontal lines are Y equals. So the equation of the axis of symmetry, except Angelo, I'm going to tweak ours just a little bit. I'm going to say it's actually X equals whatever slide your vertex has done, X equals P, except what's my X coordinate of my vertex here? Zero. So for this specific one, Angelo, X equals zero if I want to generalize it, X equals P. And then there was key points. For the parabola, the key points were the vertex, and then they were one, one, two, four, three, nine. Blaine, what I'm really saying is, remember we said that the parabola was based on Y equals X squared? What's one squared? That's Y one comma one. What's two squared? What's two squared? That's Y two comma four. What was the third one? I said three, nine. Can you see why I sort of said you can memorize the one, one, two, four, three, nine, or it's sort of here so you can derive it. What we did last year was when you were asked to graph the parabola, you did not make a table of values. What you did is you found the vertex and then you moved those key points. That's the strategy we're going to bring to this unit for generic graphs. For a generic graph, Chelsea, we're going to learn its key points, either just read it from the graph if they give us a shape, or if it's an equation that we know will memorize, derive it. And then we'll say, okay, we can figure out how this graph has been moved left to right, how it's been moved up or down, and once I figure out where this graph starts, sort of like the vertex from the parabola, I'm going to do its key points for that graph. It's going to cut way down on a lot of your arithmetic. You're going to find by the end of this you'll be going, oh, this is nice. Example two, the square root function. Did I get everything on example one? Key points, yeah, okay. Example two, the square root function. Strangely enough, y equals the square root of x. Oh, I guess I have a y equals down there, Mr. Good. y equals the square root of x. What does this look like? Well, what can't I take the square root of negatives? I've probably already figured out my domain, by the way. So let's start with positives. What's the square root of zero? So this graph is going to go through zero, zero. What's the square root of one? One. What's the square root of two? Yaki decimal. In fact, what's the next nice number to take the square root of four over? What is the square root of four? Two. What's the next nice number to take the square root of nine, which is one off my graph? What is the square root of nine, Alex? It looks like this. Here's how I remember it. Unfortunately, this one would not be green piece happy, but that's okay.  So you would draw a little sun like that, and then if it was like a little beach, what was that supposed to be? A seagull? This is the wounded seagull. If you chop a wing off, okay? So there's a seagull. Green piece is not happy, but that's a square root graph. It's a wounded seagull. It is. Sorry. Pardon me? No. Square root is defined as the positive answer when you take the square root of a point. In other words, this is defined as the positive. Now, you are also noticing, I'll get a little math speak for you, this is the top half of the inverse of a parabola. Is square rooting the inverse of squaring? Yeah. Oh, except the square root, it's defined as a well-known positive answer. Okay? By the way, key points. What did you tell me the square root of zero was? What was the square root of one? One. What was the next one we did? Comma. Two, and then nine comma. In fact, if you, in math 11, I made my kids memorize one, one, two, four, three, nine, and the reason was by doing that, they'd also memorize the square root, which is one, one, four, two, nine, three. Which, oh, how do you find an inverse? Switch the X and Y around. Really? Are they inverses of each other, the key points? Yes, they are. Oh, but instead of a vertex, we have an origin. In fact, you know what the origin is? Zero, zero. In other words, Kellen, if they asked me to graph the square root graph, but they've moved it around, if I can figure out where the origin has moved to, from there, I'll just count one, one, four, two, nine, three. I won't do any arithmetic. I'll just one, one, four, two, nine, three. There's my dots. What do we say the domain was? Everything bigger than or touching zero. Right? Pardon me? I can't hear you. Oh, greater than or equal to, which one? Q is rationals. You could say X is greater than or equal to the whole number system. Natural numbers from math 10 are one, two, three, four. Whole number, you add a zero. I can remember because zero looks like a whole, a whole, serious. You saw me thinking for a second there. My brain was going, okay, natural and whole. Which one has the zero? Zero goes with whole because it looks like a whole, the whole numbers. You guys not figure that one in grade 10 when you have to memorize those stupid number sets, which I always thought were kind of a waste of time. But anyways, hey, what's my range? Also the same thing. Everything above or touching zero. Key points, one, one, two, four, four. One, one, four, two, nine, three. Oh, and zero, zero, your origin. What I mean by at the top when I said memorize these, here's what I'm going to say. Chels, if you run across a graph that looks like this, hopefully you'll say wounded seagull, that's probably a square root graph, and I'll see if I can figure out how it's been moved. If you run across a graph that looks like this, hopefully you'll say, that's parabola. Oh, and we've broadened our math horizons. If you run into a graph that looks like this, hopefully you'll say, I bet you that's an inverse parabola because it looks like they switched the x and y's. In other words, we're going to broaden our what's out there. Memorize, recognize when you see it. It's really what I should have put at the top of the page, but that was too much writing. Graph three. Here's your first new one, the semicircle. I'm going to give you a specific example of a semicircle. It's going to look like this. Do a great big square root, and then inside the square root, you're going to have 25 minus x squared. Okay, now just take the square root of 25 and the square root of x squared. Isn't that the same as just 5 minus x? No, you can't square root one term at a time inside a square root. That's as simplified as it gets. But we're going to try and generate some numbers here. The first number, if I don't know what a graph looks like, the first number is I always try zero. What's zero squared, Justin? What's 25 take away zero? What's the square root of 25? When x is zero, y is 1, 2, 3, 4, 5. That's a point on our ground. How good are you guys at arithmetic? What other numbers could you put in there so that this would work out evenly? Five? Good suggestion. What's five squared? What's 25 take away 25? What's the square root of zero? So you're saying when x is five, y is zero? Okay, I like that. Oh, you know what? Not only positive five. You know what else would work? Not only positive five, because we're squaring negative five squared is also going to give me 25, 25 take away 25 is zero. You know what? Negative five is going to go through zero high. Justin, what? Three. Nice catch. What's three squared? What's 25 take away nine in your head? 16? What's the square root of 16? So when x is three, y is? So let's go three over four up. You know what? Not only positive three. Negative three gives you the same thing. It gives you 25 take away nine, square root of 16. Negative three is also four high. Three gave me a four as an answer. Why don't I try plugging in a four? That would be logical to try. What's four squared? 16? What's 25 take away 16? Square root of nine? Oh, you know what? Not only in this graph does three give me a four. Four gives me a three. That's a fluke. I made this one up for you guys nicely so that does work. That does not work with any other semicircle, unfortunately. So you're saying four over three up and also negative four over negative three up. If I connect the dots, do you see why I called this the semicircle graph? Looks like that. Oh, huge, huge. Semi-circle is a subgraph of a group of graphs called conics. They include the parabola, which you already looked at. The circle, the ellipse and the hyperbola, they show up all over the place in physics. In fact, almost any type of architecture that involves curves, like bridges or the church arches or any of those are almost all conic sections that they distribute forces very, very nicely. They have wonderful force distributing properties. Our planets move in ellipses. Orbits are circular or semicircle. Well, not quite semicircle, but circular. Comets move in ellipses or hyperbola. They show up all over the place. Huge. You just don't know that yet, but huge. Hey, Martin, what's the radius of this semicircle count? That's the diameter. What's the radius of this semicircle? Louder, please. Five. Now, look at the equation that I gave you. Can you see a five hidden in that equation anywhere at all? Where, Chels? What do you think if I wanted a semicircle of radius seven? What would my equation be? Big square root of 49 minus x squared. What if I wanted a radius 10 big square root of 100 minus x squared? In fact, if you want the standard form of a semicircle, it's this y equals great big square root of whatever you want the radius to be squared minus x squared. A semicircle doesn't have a vertex like the parabola. You know what it does have? It has the center. What's the center of our semicircle here? What, comma, what? Zero, zero, which is a really nice one. In other words, if I knew a graph was a semicircle and I knew the radius, if I could figure out where the new center was, if they moved it around, say the center was seven, comma, nine, and the radius was four, I would go seven over, nine up, and then I would go four right, four left, four up, draw a semicircle. That's how you do a semicircle. You don't actually know this table of values things that Justin and I did. You don't do that. It was nice to find our first one. Well, I'll try a three. I'll try a four. I'll try a five. You don't do that. You find the center, find the radius, and good enough. Oh, what's the radius? The radius of hours is five. The radius of this one is R. Martin, the other reason I like this graph is it's got a more interesting domain. Our specific graph, how far left does it go? Negative five. Touching? Yep. How far right? Touching? Okay. How do I write everything between and including negative five and positive five? This is the one that we did it this way last year. You did the smallest number first. Domain, is that X or Y? X. Leave a space. Put an X there because it's domain. You did the bigger number next. Leave a space again. By the way, can you see that the X is between negative five and positive five, which is kind of what I'm trying to show with my diagram. And then if you always did the smaller number first and you always did the bigger number next, it was always less than, less than. Oh, but Alex, did you say we're touching? Or equal to or equal to. Now what's the statement really saying? Cover up the right half and it's saying X is bigger than negative five, which is true. Everything to the right of negative five. And at the same time, everything to the left of positive five. That's the mathematical way to say it's in between those two numbers. I don't really memorize that. I just know if I do the smaller number first and then the X and the bigger number, it's less than, less than. And that part of it kind of makes sense. So starting between the two numbers, I want all the points between those two numbers. So now we figured that out so we can do the range. How low does my graph go? Zero. How high? Touching and touching? Smaller number. Range is Y. Bigger number. Less than, less than touching, touching. By the way, if I wanted to generalize this, negative radius less than or equal to X, less than or equal to positive radius, zero less than or equal to Y, less than or equal to whatever the positive radius is. This one for key points does not have a little mantra. Sorry. This one. Find the center. Find the radius. For me? Can the range? What do you think would cause a semi circle to open upside down? Do you think? Come on, bring the parabola back home here. Putting a negative in front of the whole thing? Really? We're going to generalize all those parabola rules. We're going to generalize them to any function. And yes, you can flip it.  What you didn't do last year, Alex, was you didn't do very much of flipping stuff horizontally. And the reason is a parabola is symmetrical.  You flip them vertically. And this one, flipping it horizontally, won't make a difference because it's so symmetrical. Ah, but we will eventually have non-symmetrical graphs. All the stuff you learned how to do up and down and vertically, we're going to add horizontally as well. And the nice thing is it all is going to tie together. In fact, I almost argue that it makes the parabola easier when you figure out why the parabola behaves weird in certain situations. No, it doesn't actually. It's behaving weird because you have to be specific instead of a general rule. The cubic, graph number four. The cubic is y equals x cubed. Once again, I'm going to stick in some basic numbers. And once again, I always try zero. What's zero to the third power? Yeah, this graph is going to go through zero, zero. What's one to the third power? One. It's going to go through one, one. What's two to the third power? Eight. This is going to go through two, comma, eight. Sally, what's three to the third? Twenty-seven. Off my graph. Who cares? Oh, you know what? What's negative going right? Let's go left. What's negative one to the third power? What's negative one times negative one times negative one? Which one? Negative or positive, folks? Okay. Negative one goes through negative one. Oh, and what's negative two to the third power? What's negative two times negative two times negative two? Not positive eight. Negative eight. And Sally, what's negative three to the third power? Negative 20. Is that off my graph? Okay. The cubic looks like this. Okay. What else am I supposed to... I'm limited. It's not a common shape. So, John Travolta graphs. Okay. This one doesn't have a vertex because a vertex is where the graph turns around on itself. This graph does have a center, though. Where does this graph look like it's centered symmetrically? Zero, zero. What's the domain? People on the video. Okay. Zero, zero. Zero, zero. Zero, zero. Zero, zero. Zero, zero. What's the domain? People on the video, anybody who's wait any day is watching this on video.  Come to class, if you're away. So, we do like this in that it has, really, the simplest possible domain in a range. All reels, all reels. Mr. Dubic, Y. What that saying is, I can put in any x value between negative infinity and positive infinity, and any answer you want to get a y value. I can find an x value that'll give you that answer, those Those types of graphs those types of functions have a special name, but I can't remember what they're called They're not one-to-one. They're not on to the homogeneous. There's something else. Oh key points Zero zero one one Two eight and then I'll trust that you can remember also negative one negative one and negative two negative eight But I'm not gonna write those down. I'll figure that out because it's a John Travolta graph Do I have to memorize those key points or can you just derive them by going? What is zero cubed? What is one cubed? What is two cubed? Yes, you can that's why you know If you're someone who has to memorize things find I honestly Connor don't I derive them every time because I can do a Bit of arithmetic in my head next one graph number five the absolute value function Looks like this That's the symbol for absolute value. What does this graph look like?  I can't come up with anything. What's the absolute value of zero? Zero what's the absolute value of one? One what's the absolute value of two? To what's the absolute value of three? I think I spotted the pattern Let's go in the other direction. What's the absolute value of negative one one? negative two two negative three three In fact, it looks like this Sesame Street is brought to you today by letter V Martin may be wondering What's the point of this function as well?  We call it a scalar right We actually do use this all the time Vertex zero zero In fact, doesn't this sort of kind of looks similar to the parabola. It's got the same domain of range domain All reels range why greater than or touching zero in the old math 12 course and in the conics unit Pardon me Just any question. No, okay We used to be interested in the slope of the arms I stuck this on just to review with you what slope was because technically you haven't seen it since math 10 Although you might have done it a little bit in math 11 or in chem This right hand arm, what's the slope? What's the rise over the run of the right hand arm one? What's the slope here? Negative ones. I'm gonna write down What letter do we use for slope and why? Because not all math is done by English speaking people And I believe is from the French Who's my immersion students anybody know the word for sneakness? I guess I'm gonna do with mountain or Mont Blanc or something like that. Anyways Not all English all not all math was done by English people. I think it's from the French or it could be from the Latin Okay, anyways, what do you say the slopes were plus or minus one depending which arm you look at? Hey, what are the key points of the absolute value graph? one one two two Three three Justin, can you figure out the next key point? How about four four? Four four what will the next one be? Five five now Justin actually said how about negative one comma one. I don't memorize that. I know that the absolute Value graph is shaped like a V. So you know what if I write that I can get the rest just flip it over, right? In fact, I'll be honest. I don't even memorize these I can absolute value is an easy enough function to do in my head that I would just try zero one two and three Somebody yawning the linear function y equals x This is a line that goes through One one two two well goes through one one two two three three four four five five six six seven seven eight eight Zero zero negative one negative one negative two negative two it looks like that That's the simplest possible line y equals x and then in math 10. We generalized it You remember what slope intercept form what the equation template was equal to y equals what x plus what? Okay, hugely overrated who's in calculus You've learned a better form. Have you not? Point slope form have you learned that one yet? If you haven't yet, you will be way more flexible In fact, they're finally in the new math 10 curriculum, which is this year. They're doing point slope form Good for them. Hey, what's the y intercept? zero comma B in My specific graph here is zero comma zero. What's the slope? The number in front of the x what's the domain of our particular line? All reels does that mean every single line has a domain of all reels There's one specific line that does not Negative I think that'll have a domain of all reels still good gas the good thought Which line would not have a domain of all reels? Who said that what? vertical Because it only has one x value doesn't move left right or off So let's pretend we're going to ignore the vertical and we're going to say the domain of any other line Is all reels and the range of any other line is also all reels unless it's a horizontal line Let's pretend we're ignoring the two extremes. What's the x intercept? How do I find an x intercept? Mathematically remember how? Angelo Okay, I'm just going to write down here Let y equals zero and solve Ooh wait a minute my physics 12 students Put a zero right there in your mind and get the x by itself negative b over m comma zero. I Don't memorize that Hannah I can derive it from this because I've done so much physics and rearranging it remember how hard that was at the beginning of physics 11 And now you're like, please I could do this in my sleep just about yeah, it's a useful skill But for what it's worth if they ever said what is the generic x intercept of a line? There it is Equation of a vertical line x equals or y equals for a vertical line Angelo remember Yeah x equals and I'll say a some number, you know the equation of a horizontal line is Y equals B. I did use B because it is the y intercept. That's how high that line is going to be so By the way, a horizontal line has a fancy schmancy name. It's also called the Constant function and those either done physics 11 or arguing physics 12. So oh, yeah when the V was steady We call that a constant velocity or when the distance versus time graph was steady That was a constant velocity. That is the constant function. Okay. Oh Constant function function didn't see that word there. I'll do that point slope form Really handy Well, it used to be really handy in math 12. It's not quite as handy as it used to be But really handy in calculus. There's a better form than y equals mx plus B You see for this to work and If you want to graph it B can't be a fraction because how the how high is 17 over 3 along your y-axis. You're kind of guessing an eyeballing So point slope form says this If your graph goes through a point, we're going to call it x1 x1. Mr. Do it comma y1 if you know any point on your graph and You know the slope the equation is this Calculus of mr. Kamosy showed you that one yet He probably will have you guys talked about tangent lines yet This is by far the best equation to find a tangent line with because you already know the point on the tangent line They gave that to you in the question because they said find the point at x equals 7 common And all you're doing then the spotting is really plugging in the slope, but it's really plug each up It's the best way to find a tangent. So you're gonna tangent. Uh-huh. Uh-huh Now then I wrote down in the blue Alberta book try Number page 5 numbers 1 to 3 and number 10 am I good with that? Let me see page 5 1 to 1 2 3 and Number 10. Oh sure That's only about 10 minutes worth of homework And I think I did that on purpose when I set this up because I also think that some of you were probably thinking Hey, mr. Do it could like to maybe do work on my log review or do a bit of studying or something like that Remember on Wednesday your log review is also due That's This big thing here, right? Okay And I'm gonna turn you loose, but just give me one second


Okay, are we ready for the next talk? Is that? Okay, thank you. See you guys. Okay, so I'm Stefan February. This is me. I'll be talking about spring boot configuration. I will not be covering any parts of actual Cloud Foundry, running Cloud Foundry deployment tonight, unless Tapping agrees to come and play with me and show me how it's really done. Otherwise, I'll embarrass myself. What I will do is I will talk a little bit about spring boot configuration. We'll do a bit of a code. I'll do a bit of live coding to show you how to actually get it going. It's quite easy to actually build the application yourself, just from some basics. My technical blog, which hasn't been updated in almost a year now, is hashtagbin. Yeah, that's me. So, spring boot configuration. Now everybody now. Okay, so first of all, apologies. I did a bit of a bait and switch. I threw the word microservices into the description on the Meetup group, because we all like the buzzwords. So, microservices. So, just to satisfy those of you who came here today to talk about microservices, 12-factor applications. So, we all know about the 12-factor applications if you haven't already. 12-factor.net lays out some really nice 12 points, almost like a modern manifesto for how we would like to deploy and manage applications for scalability, maintainability, and all the rest of these things. The third point of the 12-factor is actually configuration. Anybody who's ever deployed or had to maintain or manage an application in deployment knows that configuration is a bit of a nightmare.  So, the 12-factors actually state that we should store our configuration in the environment. What they really mean is let's externalize the configuration that the configuration ought to be kept inside. Now, spring already provides for externalized configurations. It is the spring framework that is. It is not that difficult to actually externalize your configurations. It's been around for a while. But externalized configuration does have some issues.  There's pretty no life reloading or reapplying of your configurations. There is no audit trail. In other words, unless you are actively, unless a part of your application, the resources folder where your application lives, is managed in a separate GitHub repository, you kind of stuff because you won't actually have a log or a change log as it were to know what have I done or who has done this change in the config server or on the configuration of my application. That information is gone. Typically, it's decentralized because the applications all have their configuration managed locally. Even if it's externalized, that tends to be decentralized. That's why we have things like puppet and shift to try and push out these configurations and manage them from a central location. But decentralized configuration, even when you're externalizing, it's a bit of a problem. And then, of course, there's the problem with encryption when your configurations are at rest, even if it's externalized. It could be a bit of a problem if you're storing, for example, clear text passwords in those configuration files. So this is some of the problems. We'll get to some of the solutions later on. Did you want to ask a question? You just did the old... All right. So why do we want to do good configuration? Well, you've got runtime logging. For example, you want to at runtime change your login level and actually see your application respond. So Dapeng actually messed with his server and he crashed it. One way that could be debugged with live... If he was able to, for example, say for this particular instance running there right now, the one that keeps booting, or even for all of them, just up the logging level to debug just for the next while, I tried to figure out what the heck is going on. And then you do a Cf log to tail and see basically what is going wrong. That would be massively helpful. No application restart needed. You just basically say up the logging level, promoting the application for these packages, the way that we can do it with log4j, right? You say, I only want spring framework boot. I only want that part of the logging for those packages to be up to debug because I know somewhere in there it's crashing, right? That's very helpful. And then, of course, feature toggles. You have a feature flag somewhere that's in configuration. You want to turn things on and off and see what happens after you've deployed. And, of course, we'd like to protect our passwords at risk. Spring boot configuration allows for us to encrypt our things and actually manage those cryptographic keys in a really nice manner. Okay, so configuration flow. I hope this is actually the diagram is clear. I'm going to try and explain what happens. There is a one. There's a two. And there's a three. There's a GitHub repository in the mix here. Over here is where the developer typically would be sitting. The spring boot config server is the one on the top right-hand side there. And then at the bottom here are three instances of your application, right? Or even three different applications. It depends on you. The way you do this is you push your changes to the GitHub repository. By now it should be obvious that at least one way of managing your externalized configurations with spring boot config server is to externalize them in the GitHub repo. So let's say you have a GitHub repo where you now decide, okay, this is my application configuration repo. I'm going to clone this repo locally and I'm going to make some changes to my application. I'm going to push this file up to the repo. Once the file is in the repo, the config server will actually take the change by a web hook and actually pull it in. It will pull in the change and apply the change and keep the change within its own state internally. Now the config server knows about that change. The config server is now ready to redistribute that change to everybody. But it doesn't just push it, right? They have to ask for it. So you now have to go to the application and there's a way using actuator that you actually just say, okay, pull the configuration change for this guy. Or you can say refresh the configuration for this server and that will actually trigger a pull on the config server and all of the configurations will be pulled down and then applied into your local state of your application. All right. That's enough talk. Now we're going to demo and do some stuff with keyboards. How are we doing for time? Okay. So what I'm going to be doing now, I actually need to write two applications. I need to write the config server and I need to write the client instance, what you saw at the bottom there. App A, B and C. I'm going to be doing app A. If you want to scale it out, taping has to come and help us. But for now, we'll be writing the config server and app A. It's not going to be particularly long because it's spring boot. We are going to win. All right. First thing you want to do, I've already gone to, if you're not familiar with run, run the Pivotal IO, not run. Start. Start spring.io. Right. Spring.io initializer. You can generate sort of a skeleton, basic skeleton for your application from here. You can choose whether you want it to be a Maven or a Gradle project. Choose the version of spring boot you'd like to use. And then you can sort of add in all of the spring boot packages that you would like to have added into your starter. I basically came here and the only thing that I changed was I changed my group and the name of the artifact. And what it ended up with is basically this config demo.zip file that we have here. So I'm going to unzip config demo and config demo is exactly the same thing right now. I'm going to split it into two applications, create two subfolders, import it into my ID and then we're going to go from there. Just give me a second. I just need to double check and confirm that I'm recording the screen. Yes, I am recording the screen. All right. Let's unpack this file. Right. I've got it in the config demo folder. I need a client in the server. So I'm going to move the config demo folder to config client. I'm going to unzip it again. And I'm going to move this copy to config demo to config server. Right. Now I have two instances of my application. First thing I'm going to do quickly, I just want to show you guys where I am. I'm in this folder. You can see it in the command line here. I mean idea projects, config dash talk. And there's an app config folder here. In the interest of time, this is actually a link to my... Sorry, this is my remote Git repo. It's a publicly configured repository at the moment. We'll come later to how you secure access to your Git repository. But for now it's a publicly accessible repo, which means that even you guys can pull my application configs. Although, of course, you won't be able to push things into it. But at any rate, let's have a look. Start with... I didn't show you what was in that folder. I've already got a whole bunch of things in here.  We'll create something new. Let me quickly go to GitHub. Right. This is the app config repository that I'm talking about. I'm going to import these applications into my IDE. So I'm going to create new projects. Let me import an existing source base. Config client, config talk, config client. Import it as a Maven project. Yes, it requires us to do what we need to do automatically. Since I need to actually... Which one am I doing first? Did I say the server or the client? The client? Okay. All right. I'm also going to do the server. So I'll open two at the same time. One from existing sources. This time, we'll do the server. Okay. Carefully import automatically. Remove Ruby. Okay. Carefully import automatically. Remove Ruby. All right. I'm going to do a quick bit of housekeeping. Before we actually get started, one of the first things is I'm going to change the artifact ID for the server to actually be config server. Going to go into the client. I'm going to change the artifact ID for the client config client. I'm going to do the same for the name. Okay. Let's start with the server. In order for something to be a config server, it needs to have this funky annotation called enable config server.  Where does that live? Okay. We need the spring cloud bits. So in my Maven project, I'm going to do or spring framework cloud. Right. This is spring cloud server. Which one? Cloud config server. Okay. Sure. We can do a release as well. You can specify the version of the server that we want. Anything else that I need here for now? Let's say no. Anything I need, because this application has automatically been generated for me, a skeleton application has been created. I'm going to enable config server, add the enable config server annotation to the spring boot application entry point. Let me get this out of the way. All right.  So config server. Because I'm pretty much done with that. Let's do Maven spring boot run. I'm going to run this here instead of in the IDE so that we can see the entire log of what's actually happening. Let me open the new tab. Go to the first one. And we are booting. And we failed. What did I forget? Ah, of course. I did not set up a repository. Okay. So, other thing that I dislike is properties files. I like YAML files. So let's create the application dot YAML. And I can never remember. The reason why I have my notebook here is because I can never remember the spring cloud config cloud config server cloud config server git. The git config. Git URI. Yes, the git URI that we want. Come on. Boom. There we go. So I know that my git repository lives at Stefon Fib. And this particular one is appconfig.git. Right? So let's try and start this guy up again. All right. Seems happy. Okay. That's the server done. Now our server is basically going to start pulling configuration information of the, of the, of my, of the server, of the GitHub repo. A bunch of the end points have automatically been created for me that I can already see here. I can, for example, go and look in. So one of the, one of the nice things that you get out of the server, it started on local host AT-AT automatically. One of the nice things is if I go to config client, something interesting is going to happen. Now the reason you're seeing this is because if I go to my GitHub repository, let me go to the GitHub repository. When you go to the GitHub repository, there is actually a file here called config client. Now I don't know how many, how many of you have worked with Spring Boot before, but Spring Boot has this opinionated way of picking up its configuration files. So when you have a configuration file in the resources folder locally, the way that those configuration files are actually identified is through this little algorithm that it applies where it first looks to see whether or not it's a YAML or a properties file. YAML files have precedence of a properties files. Then it looks to see whether or not you have some, you have the Spring dot application dot name environment variable set anywhere. If it isn't set, then it will look for, from the artifact ID, basically what your application name is. It will infer that. That will be the name of your Spring application. It will look for, application dot YAML is the default one. Any configuration in there will be applied. The next one is whatever that environment variable for the name of your application is. It will, sorry, Tapping, I'm going to turn off your phone here. Whatever the environment variable is, it's going to give, say if my server is called config server. Config server dot YAML, that's going to be the one that takes next level of precedence. If my config server, if I've configured Spring profiles for development, testing, et cetera, if I add a Spring, if config server dash something else in there. So for example, I'm going to give one here now. This is just by way of showing that I can actually have another configuration file in here, something like if this file was called config dash server dot YAML, that could, if the application was called config server, that YAML file would be picked up. If I had two different profiles that I would like to, that I've configured. Say for example, actually YAML files work in such an interesting manner that I can have both profiles active in separate documents inside the YAML file, right? A document is denoted by the dashes. Spring profile, active profile there. Spring profile here. Set the environment to the profile that I want and I will get it. For now, let's just say that my application YAML is being picked up and it's actually pointing at where my Git repository is. Now because of these rules about how to infer the file name of the config that I want, since I've enabled my application to actually go and reach out to a Git repository to pick up configuration information, it's read the entire Git repository. It's picked up everything in there. It's picked up the client config dash demo YAML, client config. Now the reason why this is interesting, the names that, every one of the names that it's picked up is because if you recall from the slide that I showed you before, which was this one, was it that one? No, it wasn't that one. No, yes, it was this one. So if you recall from this slide, right, the actual, the way that things actually work is that the client who is the guy who is a BFC is actually the guy who wants the information, is the guy that wants the configuration changes. And he will have to ask the config server. But he's going to have to ask the config server for something. Now because we were spring booting, there is some level of opinionatedness built into the framework. The default naming conventions that apply to your local configuration in your client application will automatically be applied on the config server. So if my application is called app, if I have a configuration called app-a.yaml and my application is called app-a, that file on the config server is basically going to get pulled. And where is the config server going to get it? The config server is going to go and get it in my Git repo, right? So back to the code. Right, next thing I'm going to do, I'm immediately going to jump in and build out my client application, right? Let's do that. Change to the client application. What do I want to do? Right, first thing. This application, before I start running it, I need a few things. This needs to be a RESTful application. I also want actuators so that I can do a nice, interesting actuator.  So I'm going to first make it a spring framework. Let me pull in the cloud stuff. Spring the client config. So I need to have the client configuration. It needs to know, okay, I'm basically a config client. I need to go and look somewhere for my configurations. Next thing that I'm going to do is I'm going to ask for spring framework REST controller stuff so that I can basically make myself a, I can ask spring boot to make me a spring, I'm going to spring data REST. So start a data REST, right? And I want actuator. So actuator is going to give me all the nice little endpoints, automatic endpoints for my application. So or spring framework boot. And I like it when the ID is always so helpful. It gives you all of these nice things. You can just look it up without having to worry about where it's actually coming from. First things first, let me go and create a controller that actually, so I'm going to create a new package, create a controller, create a controller folder package there. I'm going to create my greeting controller. And this is just going to be somebody who's going to basically say hello. This guy is going to be a REST controller so that it knows about how to return certain types of thing. I'm going to give it a request mapping so that it knows how to handle hello. I'm going to return a string and say hello. And I'm going to return hello dot dot dot. Right? And that's it. I'm going to start it up and cross my fingers. Let's not start today. My dear project is config talk. Config. This is the client. Get maven, spring boot to run. Make sure I'm not missing out anything that I want to touch on. Ah, crash. I love crashes. Tell you what you've done wrong. You have something running on the same port. What did I do? Ah, running on the same port. Oh, okay. All right. That's an easy fix. The config server actually starts up on the port 8888, like 4-8s. So I'm just going to force it back to, sorry, to run on port 8888 for the config server and keep my client where it is. And the reason the config server runs on that port is completely just some developer at spring decided that by default the server will run there and also that by default any locally run config clients on the same machine will go look for localhost on that same port. I'll show you guys a neat little trick in a second about how to figure out what the opinions of spring boot is because this is actually something that I found incredibly useful. Let me rerun this guy. Confirm this guy is now running on port 8888. Okay. Start it running. Can you guys see this? Should I make it larger? Okay. All right. Start up this guy. Okay. Up and running. Now, the first thing that I want to do is I would actually like for my client to go and look for a configuration on the server.  Now, we all know, is everybody familiar with the value annotation? The value annotation in spring is really nice because it allows you to grab properties or variables, environment variables from properties file or from the environment. So if there is a variable environment called greeting, it will go out, will grab that, and it will apply that. The way that it normally does this is by going to look for... Sorry. I will need to make this change in the application YAML. Hang on. I don't have a YAML file here. That's something I haven't done yet. Sorry. So let me create an application.yaml for the client and quickly make sure that the client actually is more or less configured for what it needs. So my client is ready to say hello. I've got this variable bound. Sorry. I need a private string here. I'm just going to call it greeting. And instead of returning hello, I'm going to return the greeting. Now, this guy needs to be told that there is actually an environment variable somewhere, right? So this environment variable greeting doesn't exist right now. Usually what you would do is this. You would say, okay, in my YAML file or in the environment, either via properties like minus D, greeting would be something. So I'll just now make greeting hello everyone. Which... Oh, the thing that I didn't show you probably was I didn't actually visit my local host to show that the hello endpoint was working before. So this is still the old hello for that the controller was returning. I'm just going to shut down the client and run it again. I don't have JRebel. If anybody has $500 to give me so I can buy JRebel, so I can have auto reload, you know where to find me. There is actually an auto restart feature inside Spring Boot as well, which I haven't turned on. Okay, so now it's reloaded. It's picking up hello everyone, but we don't want this guy to pick up hello everyone. We want this guy to go and look at the config server and pick up something from the config server. And in order to do that, we need an annotation to basically tell this guy, okay, a lot of the stuff that you're looking at here should be obtained from the config server. And that annotation, which I just mentioned, is enable configuration properties. The moment that I've enabled configuration properties for this class, it will actually go and look up configuration properties from somewhere and try to apply them to my greeting. The other thing I'm going to do now is immediately, there's one more thing which I've forgotten to do. The binding between this application's name in the greater scheme of things at the moment is wrong. This application's name is not what it needs to be. I'm going to give this application a name, but for the sake of the demo, I'm going to give it the name that corresponds to one of those YAML files that already exists over here, right? So I've got this config-client YAML, so I'm just going to give it that name. We'll come back later if we have time and we'll play around with it and create some other files and other file names on that repository. So in my YAML file, alongside the greeting, actually, yeah, okay. There is also another file called bootstrap.yaml which takes higher precedence than your application YAML, which is, of course, where bootstrap things that should run before everything else gets picked up, but for now, let's say that application.name, we want the spring application name to be config-client, right? This should actually allow us to go and pick up the greeting from elsewhere, right? Let's hope this works. Actually, it shouldn't work because I know for a fact there is no greeting configuration in that file in the config server. In fact, I hope it doesn't crash because it can't find the config variable. There we go. Can't find the configuration variable. Now, this problem that I'm having here is because there is an intermediary step which I'm going to skip over. I'm going to skip over directly to the advanced version of the talk, which is that I'm going to create, I'm actually going to bind the... Actually, I don't want this package here. What I'm going to do is I want to bind my configurations to a beam. For me, that's just going to be easier, right? We like that. We want our configurations to be picked up from a beam. So, let me call it config settings. Create a beam called config settings and in this beam, I'm going to create a string called, shall we call it greeting? Rather imaginatively. I'm going to make this into a proper beam with getters and setters. Why does it keep giving me files that aren't properly indented? Okay. First thing, I'm going to add the annotation for making this a configuration properties file. The configuration properties, I'm going to give it a... Just ignore this annotation processor thing up here. The configuration properties, this configuration properties file actually has this thing called the prefix, which I'm going to leave off right now. So, I'm going to make it pick up things from the default scope. The other thing that I need to do is I need to go and tell my REST controller that it actually needs to pick up the configuration properties from my configuration properties config settings file. So, I want to enable configuration for config settings of class. I'm going to have to import this class. Why isn't it picking up my class? Did I misspell my class name? I'm in the client class config settings in config. Okay. I'll get back to that in a second. Let me auto-wire in the config settings class. What did I do wrong in this config settings file that nobody wants to have anything to do with it? It's just a regular Java class. Am I going mental? Oh, I know. It's the flippant package name, isn't it? Nope. The package name is correct. io.pivotal.config. Public class config settings. Preview controller. I know what I'm going to do. I'm going to rename it in case something in the IDE is really messing with me. And my IDE is locked up now. Brilliant. Okay. I've had this problem before. It really just needs you to wait for it. Here we go. And we're back. Let me rename this guy. This is the weirdest thing. Import the REST controller. Import my values. Just drag to the other end. Just drag from that to the other end. So that can send package back. Yeah. This is... Just drag that in. It's weird, right? Yeah. I'm not going crazy. I'm not... I'm not losing my mind. Enable auto-configuration for this guy. I want to... So this annotation for enabling auto-configuration. Yeah. Then it knows it now. This auto-configuration will allow me to bind the... Where am I now? I mean the greeting controller. But I don't want this guy anymore. I want to auto-wire in my config setting, right? Create a local config setting. And then I will return config-setting.getGreeting. In this way, since config-setting will be auto... Will be automatically enable auto-configuration from the prefix. It's configuration properties from the prefix. I think I've mixed them around. Always get them wrong. Enable auto-configuration does not actually have that. Enable configuration properties for this guy. We should let him allow him to automatically be pulled in. So if we auto-wired in the config setting, this will basically auto-enable configuration of the config setting. Create a bean for it. The bean will be bound to all our properties. And that should hopefully just run build failure. Enable profits. Sorry? Enable config setting is not... Enable auto-configuration. Yeah, config setting. It's not? It's complaining something. Yeah. Cannot find anything. Yeah, I don't think it... I think I've got the wrong annotation here. I have the wrong annotation. That means that this guy is the other one which needs to be the auto-configuration client. Okay. So, really? No configuration properties for IOController annotation found on... No configuration properties? Ah, it's... No, sorry. It should be the configuration properties. This is the annotation. It's a configuration properties annotation. What the prefix is typically default. So, the reason why there's a prefix here is because when you have a configuration file that has a config property like spring.application.something, typically in your YAML file, you would have something like the application YAML, spring application name, and then here you'd have something else and then another thing. And on the same level here is basically what will be configured by the config setting here and automatically bound to this guy. So, I'm going to... Because I've been failing failure mode, I've been failing for a few seconds there. I'm going to say my prefix is failure mode. I'm going to go back to... Now, this is going to fail. I'm going to run this again. It should stay up this time, hopefully. Right, it stays up. The thing that I want to show is that when I go... What I expect when I see when I go to this hello endpoint is an empty string. It's empty because there is actually not a configuration anywhere in my application that corresponds to the value that would map onto failure mode dot greeting. And because that actually would be what gets bound to my config setting here, the config setting would be... The bean for that would be instantiated by this annotation, the enable configuration properties, and the auto wiring would then take care of tying that bean into my controller. So, how do I fix that? The fix for that is basically that I need to go into... Let me blow this up a bit. I need to go into my GitHub repository, modify the appropriate configuration here. I'm going to edit this one, and the reason I'm going to edit this one is because the fact that I've chosen the name for this client application to be config client, so the file name corresponds to that. I've cheated a little bit, so I'm going to... I've already created one before here. I'm going to create a new one now, which should correspond, if we recall correctly, to failure mode... So, failure mode greeting. Hello, CF. This configuration now needs to be pushed to the GitHub. While that is pushing, the server which is running here should pick up the new configuration changed. The Git push has exceeded. The server at some point will get a notification that something over there has changed. This is the client application which is running here. I'm going to issue a refresh on the client server by doing a curl minus x local host onto the client. At the endpoint is actually... Because of actuator, the endpoint is refresh. Local host, okay. Method not allowed. Why is it not allowed? Of course it's allowed. Didn't I tie up my actuator to the application? You have to have a refresh scope enabled on the variable. You are right. But that is not my problem at the moment, though. Yes, you are correct. I need refresh scope on the annotation here. But also I've forgotten to add something obvious into my config, my YAML here. I've got Spring Boot Starter. I've got the config client. I've got data rest. I've got actuator. You don't see anything obvious. Okay, I'm going to cheat. The easiest way to cheat is to look at your previous example. Which is... Okay, never mind. Are there any questions so far? Let me ask that. People have been awfully quiet until now. Any questions so far? So, why did the config client is running to the server? The config server? Yeah. Where is the exact configuration? So, that is the place where it actually... It infers that. So, it will right now... It's actually looking on localhost at the specific place. And that is an inferred setting. Remember before I said that in order for us to actually... If you wanted to figure out exactly where all these things are pointing to, what you can look at are places like these in the configuration. There is this very specific spring framework import for spring boot cloud called auto-configure. This import here. And if we look for the cloud configuration, we'll see cloud auto-configuration, which will point to other parts of the application like cloud scan configuration. That is interesting. It thinks that some of these files are missing. Some of these dependencies. It's missing them. Okay. How are we doing for time, by the way? Yeah. You are a bit over, so probably more... Okay. So, if I'm a bit over, I'm going to jump ahead. Just pull up my working application and just quickly run you through the actual working of... This is the config. Let me shut down these guys. I will go into the config client. And I'm really interested to see what exactly in my YAML file it was that just bit me. Because I can't, for the life of me, think of anything. I've got the config client dependency. I've got actuator. I've got data-rest. I've got the starter web. Everything is in there. I don't know what's going on with my computer right now. It didn't rate. So, if I run my server... So, my server is working. I am just going to start up the server again. And run my known working client. Which also happens to point at exactly the same place for the configuration file. Except that it is reading in a different location on the YAML file. Want that one? We want hello. So, this hello CF meetup is right now from being served from my client, the working client, which is, for some reason, unbeknownst to me, working, where the other one was broken. So, this client right now is working. No problems here. It's picking up the actual configuration from the GitHub repo. And where it is picking it up from, if I go to my GitHub repo on GitHub directly and I look at the client config YAML which is where that running application is actually picking up this change. If I edit this file directly, which you really should never do, but for the interest in the interest of privacy, hello direct edit. Let's go home already.  And when I now tell my application to refresh itself, let me set it not allowed. Yeah, it's supposed to be a post. Anyway, why on earth is it not? This is really bothering me now that the refresh is not working. Sorry? Yes, of course. Thank you. I need to say exactly what it is that I'm doing. So that is actually what was wrong, was that the method wasn't allowed because I was using curling correctly. Thanks, Mike. So, the funky cloud greeting has been pulled from the configuration. What has actually happened here is the config server or rather the client has basically said the only configuration that has changed is this funky cloud greeting. I've done a diff against my local changes. This is what changed. If I now go to my endpoint here, then there is this guy here that says, hello, let's go home already. There is one more thing which I will quickly point out. Inside, and I just want to talk about the fact that we talked about why it's so great that we can have encryption. You'll notice that there is actually this encrypted string inside my application YAML, inside my config client YAML file. That is automatically decrypted for me if it won't be now. It won't be automatically decrypted now because I haven't configured my client keys yet. So, I'll go to start up the server which knows how to decrypt the keys and this is just to give you an indication of something that you might like to do for further reading. We'll do spring boot run and once that local version which is running on 8888, if I look for the config client's configuration, it will come back to me, it will go to the GitHub repo and come back and it dumps the entire raw or parsed GitHub client config and instead that encrypted string which was on the server is now being decrypted. The way that works is basically you have to configure a cryptographic key with a simple secret that you specify in your application YAML and that is really it. So, if I go to source main resources here, I show you what my bootstrap.yaml looks like. There is just this encrypt key and that's it. Once I've specified a cryptographic key I'm then able to use the encrypt tool that comes with the spring command line tool or I can run on the... I can directly encrypt elements on... That is something... Okay, last thing. I can basically use my config server as a cryptographic endpoint. So I can actually encrypt things directly against my config server because one of the things that the config server makes available for me is if you see during startup there is a slash encrypt endpoint. There's also a slash decrypt endpoint. So I can do a curl. I can post to encrypt or since I'm sending data now I can just... No need to expose. I can just say send the data for Stefan. You still want that? Really? Ah, rom server. Again. Thanks curl. Sorry, my foo is completely not strong today. So it's encrypted that for me, right? And I can pass the string back into it and ask it to decrypt it. And in the same way that it's able to encrypt and decrypt for me it can do this over a... So you can imagine, right? I've now got cryptographic services for anything that I want to pass in. Right now it's decrypted with the Stefan down here. Right now it is actually an open server but it could just as well have been secured with spring security. I could have set up either security rather symmetric key based authentication using OAuth or I could have done something like a basic OAuth and secured my keys using configuration, externalized configuration where the key is stored and then have my client, my server securely communicate. Yeah. That's the gist of my talk and I'm going to bring it to a close now because I think I'm well over time at this point. If there are any questions please ask them now before we go. I've got one, two, three more books left to give out. Any questions? None. Okay. That's the end of the talk then. Thanks guys. Thanks for coming.