You guys excited? Yeah, yes. Yes? Yes. Good. All right. So, I'm excited to do this talk. I really like kind of the future of where WordPress is going. It's kind of my part of the future that I like. So, I'm excited to do this. How many of these are remark developers? Okay. All right. Let's see. Get it all. A little bit of PHP and CSS. All right. So, there's this presentation. I wanted to give you a good foundation. I'm a guide in general. And then you kind of grow into talking about building stuff with the rest of you guys. So, this is me. I have a company that's walking distance from here. And for each right, we're closer to Kobo. It's like a five minute walk from here. We build a lot of really cool things. I love the things that we're always working at. We do, I would say, about seven percent of our projects are WordPress-based. And everything that we build is also maximum. So, our goals are like, you know, they're from a custom plug and a custom theme or custom integration. So, it's all about writing the software to be built at WordPress. They've been doing this for a long time now. I don't think the first WordPress that's happened first in my life, played with the PHP file in 2007. So, it's been a long time I've been doing WordPress. And I also, as you mentioned, helped lead the first three Wordcams back in 2012. All right, so let's get started. So, here's what we're going to do. We're going to do a little one-on-one on WordPress APIs. I'm not sure how familiar you guys are all. I'd like to try to make sure we're somewhat on the same page here. That way, it makes it a lot easier to kind of get in conversation. Then we'll do a little intro into the WordPress on WordPress API, what that looks like. We'll create a little mini-beat where we'll talk a little bit about headless WordPress and then extending this beyond. So, it's a pretty aggressive schedule. A lot that I want to cover in this short period of time, but hopefully this goes well as you guys comment about it. Okay, so let's get down to the fundamentals of what we're here to talk about, which is what is the API and all this stuff. So, the way I like to think of APIs, again, some of this might be a refresher, but again, it's all about the same page here. We have some data, and we want to share it, right? That's kind of the fundamental thing we have here. We have some data. So, for this example, we have a post file. They published an excerpt. We want to share it with people. So, what do we typically do? We build a website to share the information with people, so we display the information to people on our website. But what if you want to display that information on other devices, or you want the information to be accessible to multiple devices? The way this is typically handled is with an API. So, that's what we're here to talk about is how you facilitate that. So, when I think of an API, it's basically a proxy to the data to be viewed in different areas. So, that's kind of what this is. So, how does that look? It's obviously not pretty like the website. It's more programmatic, and this is a j-time representation, which is what we'll be talking about today, but what this allows us to do is how to break software on top of other platforms to access the data and show it to other places. So, that's, you know, it heads for what the API is and what's pretty useful. There's lots of servers out there that have APIs, as an example, a lot more than just that. Okay. So, what is restful? So, we're talking about restful API. So, it's important to just have a good understanding of what a restful means. And so, what this is kind of broken down is representational. Representational state transferred. And I have the four kind of main concepts of what this is. And we're going to go through each one of these just so we have a good foundation. So, let's look at this, what this looks like in terms of an HTTP request.  And when you hit those URLs, it returns data back. So, we have a few things that we have to break down into what this HTTP request looks like. So, we have the URL itself. We have the methods. Typically, when you use your browser, and you type a URL in, you're actually using the get method. That's what a browser does. In an API, we actually, a restful API, we have more than just a get method to get data. We'll talk more about that. And then we have header method that you'll also be able to add. And you also have the body, and that's ultimately what the request is. So, we're going to walk through this a little bit more so we all have an understanding of what these are. The second part to a restful API is its resource-based. So, what this means is the URLs, the way they're generated, is typically based off of an object. So, if you think of a custom post site as a resource, that's kind of the same kind of concept here of how that fits into play. As I mentioned before, a little bit about the HTTP requests. So, you can get a collection of posts. You can get post slash one, which gets a single post. You can use the post method to create a post, and those posts and posts is in there. Then you have the put and delete, which helps you update and delete those things. So, these are the different methods that you're using. And as we get into this a little bit more, you'll see how this all plays into the WordPress REST API, because all of these are the different methods that you're using. The WordPress REST API, because all of these things are components of it. The next part is stateless. So, in a RESTful API, every time you make a call, the authentication happens within the call. So, every call is self-contained, meaning that the way it typically works with authentication is authorization happens first, somewhere like a login, and then you have a token that you basically pass back and forth with the API, so that you can basically get the data and have permissions to do those type of things. So, this is also done with WordPress as well, where there's a token, and again, we're going to cover it a little bit more, but I'm just trying to put my mental here. And then we also have representation, which basically says the objects that are returned is in a format that is a greater problem. It's not common, but today we're focusing on JSON. Any questions on the foundational REST stuff, or are you guys good so far? Let's jump into the WordPress REST API and how this all comes together. So, since WordPress 47, the REST API has been available, if you actually just pull up in your browser whatever your WordPress site is and type in WP-JSON, you'll be able to see basically the core calls within WordPress API. So, apparently, it's there for you to be used. So, as an example, if you add a little more to the URL, I can get a collection of posts. So this is, you know, I'm starting really fundamental here, but we're not going to go into posts and pages and other CPTs. Obviously, if you take one, you can assume the same for all the other CPTs because I almost, which we'll cover a little bit near the end. But, so here's the posts. So, as you can see at the top, the URL is a little bit different. I have a version, and then I also have slash posts. And when I make that call, it's going to return an array of JSON objects. And each object is all of the data related to each post. So that way you can use it to do something else. So, I forgot I had this, like, little zoomed in. So there you go. There's a couple examples here where you can get posts. An individual post, or you can get a specific caliper. So this is really nice because not only can you get all the posts that you can also filter, like get, or your tags, and so forth. And all of their documentation and the projects is up to date. It's relatively up to date, and it does a pretty good job to help with seeing all the possibilities you can do when you get these requests. Okay. So, let's talk about building an inventory. I have an example I built that I took in 2017 and this is what I wanted to do is make the front page of 2017 be restful so that way we can work across the UPI so that way the posts are loading using the UPI as opposed to being done within PHP. So I think the biggest difference here to keep in mind is when you're building something with a WordPress UPI and you're building a theme specifically by default, a theme is PHP files, right? And you're using PHP tags to display the data, which means that the server on the back end is running into variables for you and then sending all the HTML to the browser to load the content, right? The difference now is that information doesn't exist on the front end. It's being requested individually through the UPI and then we have to take the data, bring it into the browser, generate the set HTML that we need to generate, and then insert it into the document and hence we have the data. So that's how a lot of websites work today which is like the browser is now always refreshing and it's kind of doing a pull and push of data using the browser and then releasing it on the front end. So that's essentially what we're going to create today. It's a mini theme that does exactly that. It's a pull. Alright, so Are these last ones available? Yes, yes, I have all these slides available basically out on this. So this looks very familiar. This is your 2017 theme. So I'm sure you guys have seen this many times before. And what we can see here is how the posts as an example have such a prepped ahead. I thought I was already hoping that those would take them. So let's just walk through this a little bit. We can always take a few of those technicals that I don't know why it's not working right now. Of course, quite a demo. I swear, I think it would be fantastic. I should have had it reloaded. So as an example, I just kind of showed you the lives I get in screenshot as well. You know we have those posts that are loaded there. This is what we typically would see. Of course, it's rendered to the end user and you just see it. We're going to render it a little bit differently using the main guy. So to do this, let's talk about what you have to do within a theme. I'm not going to go through how to create a theme. I have the assumption that you have a little bit of understanding of how the themes are created. But let's talk about how to add into your theme the dependencies that you need to do and the integrations so that you can use the API. So the first thing that we need to do is we have to add some JavaScript dependencies. So this is in the functions PHP file of your theme, which most of our alt-thieves have. And so what we're doing here is we're using the WP and Q-Scripps action here and we're queueing the WP API. So this is inherently in WordPress but it's not inherently in Q so you have to add that. And by doing that, we need to leave our going to have. In my browser console tool you can see my WP API setting so if I make that call my console I nearly have a nonce or group and a version which helps me get a little information I'm going to need for my API act or for my development of the API. So that's the first thing I have to do and then the second thing I'm just including here is essentially a JavaScript file. This JavaScript file is going to be making the requests to the API to basically retrieve my information. So those are the two things that we're adding to our functions VGP to do the integration. Alright, so the next thing that we need to do is essentially just make a HX call to the API to retrieve our information. So you can do this, this is using jQuery's HX call so you can see I have the API setting to that root is basically taken from that variable. So by adding that script to your you immediately have it available to you so now I can use it in my JavaScript. If you don't include that WP API script, you cannot do that and it will work obviously. The other thing we're doing is we're adding a header. So you can see that there will be four send, send, set request header and it's an XWP nonce and then I'm passing the WP API setting to nonce. The reason why we do this is this is your authentication and the instance that you want the site to be able to do something such as modify a post, maybe you want to have the ability to, on the front end, have the user modify some of the text of a post. You can do that by using the nonce. The nonce is going to basically help with the authentication and what that also does is it's not going to have user's information specifically but what it does on the back end is it uses that to determine who the user is, whether a logged user or not logged user and whether they have the permissions to do so and we'll get a little into that a little more. So that's the API call. That's using jQuery. This is pretty straightforward but we're doing an agent call. The nice thing is is WordPress actually provides you a JavaScript library. They have a backbone.js that you're built in. So this actually makes it even easier to integrate or work with WordPress API. So they provide too many things so we have models and collections of models like a post, a collection is a collection of models. So that's the two things that we have. So now taking that example that we have before with jQuery we can simplify our JavaScript and write something as simple as this. So you can see I have post collections equals the jQuery.intGuy that flushes and then capital P and by doing that I have this object that I can now fetch the collection. And so the next thing you can also see that I'm going to carry is I am providing category 7 so I won't just return to me all the posts that are in category 7. So this makes it a lot easier because you can do just two lines of code and it handles the authentication for you as well so you don't have to think about adding or using any other amount. This is all in my library. And you can also see as a second example I can do the models dot posts and provide the ID and that returns that JSON object back to me to use. Cool! Yes, do you have a readbook? I do not have a readbook or I can throw it somewhere I'm done. Yeah, I think I don't. I will most likely I built the I just built the theme recently. Yes, yes. It's fresh. If you do that it's fresh in your mind you literally don't have everything you want to talk about. That is honest. But anyways I will get and then I'll share with I'll basically just take a whole theme since you guys can go hack away. So let's expand on this. Now if I haven't made it clear where we do these type of things is in that front page JSON file that's what I have in the call file is not you don't have to call it that. So if you remember when we queued those two JavaScript files one on this front page so what we have now is a little bit of JavaScript and so you can see what we're doing here is we have this post collection which we're getting and we're fetching them and then we're basically then which is kind of what we're doing next so that was kind of compelling here I don't know what you guys are familiar with JavaScript promises much so the nice thing is this is you can basically it's all JavaScript promises which makes this a lot easier if you're doing a lot of things that you want to do easily. Which is nice. Okay so what we need to do now is we have this collection right so we have this JavaScript that's JSON objects and we need to display it on the front and how do we do that. So I'm using a small JavaScript library called SimplerJS to do so what we can see here is um I like the points um so that's a piece of code that you saw on the previous screen it's at the very bottom now so it's the same stuff and then I just have this function up above which is called renderedPosts and what I'm doing now is in the then that was empty before I'm calling that function passing those models of postPosting.models which is that array of posts which is a function up above and I'm looping through each one to generate the HTML um and so like I said I'm using SimplerJS so I have a simple function where I can pass the components and tokens in and it generates the HTML the question is where does the HTML come from so in this example we have a template of HTML and so this is very similar to the HTML that you're going to see in a but it's actually tokenized so you can see in here I didn't tokenize everything I just tokenized a handful of them for the for a single example but you can see I have like you know the dollar it's rather compelling I have postTitle, postExter, and the ID so I have a few different ones in here so essentially what the SimplerJS library does is when it loops through it takes this piece of HTML and injects the tokens into the values into each one of those the HTML sticks into the DOM that's what it's doing in short so when you do all those things you immediately have those posts showing right up you can see that there's you have their classes and everything so apparently it will just style to your theme and run from there so that's how you load those so the next thing that we can do is actually add a little bit more interactions to this and what we do is we can add essentially the event right here I'm using click so when you look on the .morePost object we want to load more posts so it's relatively straightforward the cool thing about the WordPress EPI client JavaScript JavaScript libraries are it gives you the ability to just call it .more and it loads more posts so you can read one, five, load five, load ten you can do that when you make your first call or you can do it within the .more parameters which you can look up client libraries with documentation but what's really nice is now I can keep this really clean I know I have this loading which is another piece of code I just wrote so that we can show like an animated gift that pages loading while it's retrieving information from the server or going back which is what you often see so I have a function that hides and shows that so yeah we just call it .more and so that way I was going to look at it and it's running this and it loads more posts and renders it back into the page on the loads and I just have to show you an example right now because you can see exactly what this does let's try it one more time okay so I have the one and so like we put the interactions and I click on it if you notice it loaded the gift and then while I was doing the gift it's showing it retrieves the new posts and then it reruns them so now it just continues to hit .more and it's reloading more posts right on page and now reloading so that is all doing that essentially any questions on that I know I went through relatively quickly but it's actually pretty clean you can do this stuff really it doesn't take a lot of code to do something like this yes are there any hooks that you can use to say you want some custom data on your posts can you add that today if you've got some help yes we're going to get to that again we're going to talk about extending my many example that kind of walks through taking a page and rendering it some of the other things that we can also do if you want to take your posts up further is you can actually so if you're going to let the single posts and people are making comments normally when you fill up a comment the page reloads right they have to like hit it and like submit the form in every load that person's comment there is the ability for people to submit comments using the same stuff we did you have the ability to do that and I'll show you a small code snippet how that works but you can also manipulate and push it and not just retrieve it everything that we did there is just retrieved alright so have you guys heard of Wordpress and it lists Wordpress concepts I wanted to see where we're at I was sitting outside it was like a slide above alright so let's talk about this a little bit differently though I'm going to give you the example Wordpress has a CMS we love Wordpress because the CMS capability that is at its core what makes this an amazing platform is the fact that we have a kind of old manual tool that is easy to use and that's what we're familiar with is this screen this is going to be a very arcade soon but this is kind of where what you see now and this is what we're familiar with and this is what I hope but what if we wanted for a completely custom admin for our clients or for myself what if we wanted to have an admin for Wordpress not just for a personal upside or business website we would use Wordpress for e-commerce we would use Wordpress for forms and so maybe I don't care about posts I'm an e-commerce I'm an e-commerce site and I just want to know about my finances I want to know about my products I want to know about hosting I want to manage those differently like the admin right now for Wordpress is basically built to manage the objects and the posts and pages there are better UIs depending on the type of sites that we have the nice thing about the rest of the APIs now we can create those new APIs or those new admin interfaces as an example you can create an admin interface just like this on top of Wordpress and it looks completely different but it was structured and organized in a way that meets the needs of that it clears up and you know I'm mentioning Gutenberg Gutenberg is a new admin interface for managing your posts and objects and that is right now being built on the rest of the API that we're talking about today so this is a new interface that is using this rest of the API and as you can see it's a completely new experience that's being created and that's why I think it's going to make this powerful I think FoodPerc is just the iceberg the tip of the iceberg of where we're going where we can give up because I can totally see this admin interface there's going to be like a series of admin interfaces depending on the type of site that you're building at Wordpress that is optimized for those reasons and that's what the power I believe can happen with this API alright so let's talk a little bit about manipulating data I know I kind of alluded to it so you can see I'm using the put command or the put method up here and not yet and this is how you would type a modify as you can see when I try to make this request I already know that it is post because I'm not authorized so again as long as you are building this we don't authorize that and going back to that object we have that nonce that we need to include again we don't have to worry too much about this if you're using the client library but if you are building this on another third-party system let's say we're not using Wordpress and I'm using an iPhone app and I need to access this data then you need to kind of be aware of these things okay so then I'm not going to go too much into this but I just wanted to mention that if you're using postman at first I would say you should use postman if you're working with APIs just straight flat out it is by far an amazing tool that I'm running through stuff that you can do all the time that makes developing with an API so much better so I should have alluded to that at the beginning but I'm saying it now but when you go to try to test things with your API you want to modify stuff using postman because like I mentioned every single call is independent of itself we have to have an authentication involved to modify the post and to do that you have to essentially add a cookie as well as add a header to the request and so that's what I'm showing you guys here which is we have to provide an authentication so what we do is I basically load I log into the site in my browser I go into my console and I grab the cookie from my browser as you can see here which is the WordPress login one essentially copy and paste that cookie into postman and then once I have that I can make my request as if I'm logging but there's more I don't want to go too far into this so you can be aware of that again I will show the slides so you can look through these things because there are links in here so that you can see you can retrieve them, you can create posts they show you all the examples for covers and one of the things I just showed you a few but you can do all of those things and then taking us a few steps further you can build in the WordPress and currently you have all of these objects the posts, categories, tags, comments and so forth so all of those are available to you even with that client library I'll give you an example of the I'll give you a post using the essentially retrieve it and then you can set the title and it just gets that's it, so it's really clean being able to do that all of those things you can do questions, alright so that is in short the concepts where you can really create some really cool interfaces from it so let's talk about taking us one step further and extending this beyond your basic objects you might add even more stuff to it the first thing you can do is if you're using plus and post types you can essentially automatically tell that plus and post type to add itself to that client library so if you're creating something new such as pets in this example if I want to do .pets .fetch you have to kind of tell WordPress like I need to add this to the rest of the guy so that was an example so if you want to do something like that that apparently isn't going to be there just because your plus and post type is there it won't be there so what we have to do is essentially give it a rest controller so we have this would be rest type controller into when I register my plus and post type so that's what you'll have to do and then this is going to help you add into that so that's the first thing that you can do so if you're doing plus and post types that's the first thing that you want to do is let's say you just want to credit your own API endpoint that is not a custom post type it's completely like something like whatever you want to be like maybe you're taking two different post objects and you're manipulating or you want to retrieve information in a totally different manner you can do that as well so let's talk a little bit about developing an API endpoint as a whole what we're going to do is we're going to talk about the method so you should try to stick to the rules of the get when you're using those methods based off of retrieving creating, updating, and deleting so use those we want to use the authentication as needed we want to validate user data so we want to make sure the data is being sent over is good before we do anything then we perform the actions and then we're going to turn to JSON response so that is the life cycle of what you need to do in an API endpoint so this is probably an example if that was one of the pet things but let's say that we want to add a custom endpoint that the search phrase something called pet name is not vital it's not post-vital this is just a one little object so here's an example that you can see here there is an action called REST API and you can register your own route so the route is the URL that you're in eventually here so what you do is you give a version and then you give the route and it is you can do things like the ID as dynamic as the URL and so you generate that you can declare a method and you can declare it to call back which is essentially the function that's going to retrieve the data so that's what we're doing here so that is where you can see down below this function you've got some pet I'm just having to retrieve posts in this example and then you can see that pulling it together and then generating the best response which would now be available to you with Wordpress that helps generating the response you set this VAS code typically to 200 of the success that you can use and then you return so it's relatively straightforward you register in your route and then you're returning the data so let's pretend that this call though I only want certain users to be able to do that because if you just did that right now you can start adding stuff to your site and then get it you don't want that to happen so we have to do the we have to have some type of authentication so there is another parameter the red is the route called permission to call back and in the permission to call back you do your capabilities check essentially so right now I'm using the current user can edit other posts that's the capabilities that happen to choose for this example but you could whatever capabilities you have in the system you do your check there this is going to use that authentication thing I was talking about so we have that cookie, we have that nonsense being passed in the request the word processing guy is going to check to see what the user is and then check to see if that user can have that permission or capability and if they do it allows them to continue and do the action that they do if they don't it's going to kick back to them and never put that further function that we talked about it just returns that you can't do and then the lesson that we can do is validate the data as well so there's two things permissions, validation and again we have this parameter of this arts and then you can say there are the data that's going to push it over and have them use this example and then validate and call back the data comes in and I'm just doing a very simple thing here which is like is the merit whatever code in there and you can do this for every single variable that you are posting or pushing to your API to validate the data as well you can see there's a variable that's called status and you only want to allow them to send the status over as published or dropped and no other jump you validate that this field doesn't match our validation so once you take that all you put it together and I want to do that but this is returning the response and there it is putting it all together I know it's really small to look at but essentially you can see that we have the arts for validation the validation of the data the permission call back and the retrieval of the data so that is a nutshell it's very simplified but you can really hopefully see that what the possibility is not great to go with that endless operations so that is everything I got any questions? I know I did cover a lot not many specifically yes but I would say it's very PHP how soon? I guess in your mind although society in a project you've been working and switching to Rustble are you are you convinced that this is the way to go and to get rid of PHP you're not going to get rid of PHP because it's only the right PHP to do if you're using WordPress you're using PHP so I would say if you're using WordPress you don't want to use PHP I don't see any time soon that WordPress is not going to have PHP I understand that more jobs are in WordPress in general and I think the rest of you guys even though it's been around for a couple of years now I still think it's super early and I'm really excited to see what people will do with it but you still have to get to show all that the hooks to generate the route to do all the pedications all the PHP you still have to write PHP at the very least it's the right PHP that language that WordPress is on I was curious why you put the API calls in the boot itself is there a better timeline to put it in the plugin or yes that would be what I would do my preferment that's what we do normally I'd like to do everything in the team take a conversation my goal is to show everything you can technically do it on the team but what I would typically do is I would build a plugin that would be an API and then I would build a theme that talks about plugins at the time that is what our company does we build rest of the APIs as a plugin but that's exactly our plugin it works very similar obviously in the way you create plugins you use all the same stuff one thing to mention though is if you're going to do like I want to write your data in a specific way then you would want to make sure that that's not in the plugin so that's the design part but in order to reuse the API calls you shouldn't put it you want to use it on different devices or whatever it would still work on other places because the endpoint still exists it's not as long as the theme is like the API is literally just retreating it's just the back and forth of data objects if you have the ability to do all of the manipulate of data objects regardless of the theme or plugin that's generating those API endpoints I can still go build an icon app that talks about API even though it's built on theme that doesn't change it's more of a code thing like if you're trying to as a developer of the API then you can build it at the plugin and then build a theme that talks to that you could do that but if you're just building an API that is specific to a theme would that make sense? yeah but normally I would probably be tired of that theme forever but I don't want to be able to pull that yeah and that's why you do a better design to be able to put it in the plugin but I'm going to say though today I'm talking about building two different things but yeah you could take a plugin or build it in the plugin and it should be different especially because like you said you change the theme all the code to the theme it lost but at the same time if you're changing the theme the theme will probably be different and maybe it doesn't even represent it so you have to kind of think about what you're doing it's not like if I go to change it if I go to change it and I change the theme the theme has to know the API exists and it has to talk to it so would loading the post is to be to Ajax better for that user group faster are there any negative consequences on SEO from that? yes there can be so yes so I'm not for months I know things are always changing right with the way Google index is stuck I know that they index some things like Ajax sometimes they don't but yeah there are some things that when the crawler is depending on how the crawler is going to pick some things up and there's a couple different ways that this is handled depending on the content you're showing kind of think of the current method because it has to be the few things that were done but there's some things that you can put in the site so that when the crawler is in your site the edge of it will retrieve the information for them what I do is I typically err outside of if I'm trying to go over SEO I typically when I load everything into the HTML it's a lot easier especially if you're doing even like Google has like these structured data I need to generate structured data for comforter posts and stuff like that those are the things that are easier to generate and those are more SEO friendly I think if you're building more administration tools or you're building more app type functionality then the API becomes a lot more powerful Would it be worth it to write the API and load that via PHP for initial load and then have the more lovely for more posts? Yeah, we've done that we've done that playing time and now what we do is what we need because you're already making these to be robust for like a single post because you have the route that you want for the URL for a single post that needs to be done with AJAX you're making the API request anyways for that post but the instance I want to show more like this example I could load the first five with PHP and then just load that for it I was just wondering, you had like two examples that you went through one was where you were setting up a API request to pull in that information put it on AJAX and the second one that you did was a custom endpoint you used more of the WordPress you know code next to it yeah, JavaScript I was just wondering what is really the difference between using those they both essentially do the same thing or that's how I'm seeing it anyways it's a great question it really is the difference of going through the AJAX version as opposed to going through the WordPress version of that so when we build the API that API is now accessible like anything that's created on the app anything, right? and the example with the simple object like the airport approach with the fine library is specifically if you're working within that one WordPress website if you are building like an iPhone app, you have to do both you have to use the commands to do the request but if I were to build another website that was not within the WordPress ecosystem you got a different domain I would have to use the jQuery example because I don't have that library available ok, so you're going through the difference between others and bring us essentially I know there's a lot the hard part about it is like I'm running over so much and it's so hard to cover a lot so if you guys have any questions or you're feeling good I'm going to be around all day so we can always chat more, yes it sounds like you kind of go more in on some of the future of where WordPress is going do you see any applications or any illumination with SSL versus just non-SSL I just see so many API kind of applications being mentioned you know, if you're not SSL at all and you're getting used to them I wonder if there's any directions that kind of start walking down within WordPress from the API to say look, you're not you're going to use the API to understand that I believe every single HTTP request should be SSL every but you don't see anything right now within the structure of the API well that has nothing to do with it that is like the way your server host is set up for the hosting, that's what the SSL looks like that this is outside of the control of that like we can't control SSL essentially we can write code that says don't make requests to other third parties but like everything should be superior in terms of you're pushing down I've given people some examples of simple things like a contact form well it's a contact form I believe in SSL and if someone has emailed a code number that has submitted a contact form and now that person's immigration is compromised that's a very small piece of information but there's value in that so everything should be encrypted happy to put some crypts around how they're to like do this maybe one more question great to be a lot of time done yeah alright what have they been carrying out with SSL I don't know if there are questions what should we do next week what should we do yeah I mean the low generally that's the working part yeah so basically this is an EU kind of thing that was set up which is basically said that we have to be better at informing our users of our site about the information we're collecting about that and the second part is trying to understand which has required us to take steps deeper into our projects that we're doing because a lot of the sites that we're using are using third party systems like Google Analytics per se most people can probably do as well and Google Analytics collects the tone of the link with our users it's anonymous right so there's if you go to your GCard there's a difference of personal information and personal anonymous and you still have to you shouldn't be able to identify the human being based on the information that's being collected which is kind of the second layer to it if it is being collected it is more knowable than it has to be but essentially we're helping our clients understand what information is being collected and putting the correct most of the notes into the slides a lot of our clients have third legal teams that we're working with we basically say here's the groupies that are being logged here's the time limit that they're being logged and then they draft it up we put the banner on and we link to the what article that they drafted so that's kind of the flow that we do when it comes to the notifications I was sitting really trying to go up here and what we're recommending where I work is that the notification is a problem now if somebody is going to be cookie-less and maybe browsing the economy or changing the browser settings wherever every time you go through a different page or if you have to have the notification throughout the entire site I cannot seem to find a wordpress plugin or maybe you would even know one fact will show up only once without knowing without being cookie so if somebody comes in Cognito you can't do anything the whole point of impacting the browser that's like hoping up a new computer you can't you can't like I would not I would be the wrong we shouldn't because I think that we can use all the situations where someone can see it because of the wrong part the law is very short that is a new user they see it the first time I would say like that isn't as basic as anything but I don't think people are going to do that and then complain about it while you're opening up a new browser that's like logging out every time you click on I think that's a problem I think that's a problem but it's only without collecting data they want to be able to put one notification one time to be clicked on and then have it go away it's a new user right you have to let everybody know right the browser do have no information about the current user so a lot of cookies yes that's the part hey now here's an example which is if someone's lost in and let's say the first person is doing it 0 and when they log in that's when you start to click once they log in you can decide because now you can at least you have the ability to try now that you think you can log in I think I can open the window and then you can decide which one but this still requires them to do something to tell them that they are a re-opening person otherwise there's no other way to do this yes it says it's already there it's creating a cookie so it works out great so yes yeah that's it


You may actually end up uncountable case also let us look into the example. Let us say this is my x axis and this is my y axis and I am interested in this region 0 to 1, 0 to 1. So just think of a geographical location which is like a square area, 1 unit square area which is represented by x and y coordinates ok. Now I am interested in this square area, this is my region and I am interested in let us say some particular point here and my omega is all x y which are between 0 and 1 and also my second axiom said that probability of omega has to be 1, then only it is a proper probability function otherwise it is not a probability function. Now let us look into this. Suppose let us say in this region x and y for any for any x y pair ok and that x y you gave a strictly positive number, strictly positive number you assigned. Then if I am going to sum them over all of them and everybody is strictly positive remember and those who know real analysis what does this mean? p of x y is greater than 0 greater than 0 that what does this mean? That means there exist there exist an epsilon positive such that p of x y is greater than or equals to epsilon right. If p x y is greater than 0 there exist a positive epsilon such this has to happen. If this is the case what is this number is sum is going to be? What summation of p of x y or x y is going to be? 1, will it be 1? See how many x y points are there infinity and each points probability is larger than epsilon. We are adding epsilon infinitely many times yeah I mean these are just all possible x y's if you want you take it as a integration instead of summation do a integration that is fine. But if you want to do integration of this p x y here every point is greater than epsilon what is this value is going to be? Is it 1? Can this be 1? Can this be finite? Can this summation will be finite if every point is greater than in is going to be greater than epsilon here ok let us do simple math further. So, I so for time being do not worry that is a summation or integration we can do. Now if this is the case we know that this has to be greater than or equals to x y epsilon because every point here is greater than epsilon ok and now you are adding this over all x y. So, now this value is nothing but epsilon times cardinality of omega and what is cardinality of omega that is going to be infinite right because there are how many points x y are there which are between 0 and 1 grid it is uncountably many actually. So, this becomes that if you are going to do like this this becomes actually infinity this summation cannot be 1. So, as you see that if this guy all this term has to be if this guy has to be 1 that is if this value has to be finite many of the p x y has to be 0 if they are not 0 then this you cannot guarantee this p of omega to be equals to 1 ok. So, this means let us take now p of x y equals to 0 for many point I mean take all of them to be 0 if that is the case if you are going to add p of x y equals to 0 and add all of them you see that right hand side is 0, but left hand side you want it to be 1 p of omega by assume it should be 1, but now in this case if all p of x y equals to 0 you will adding infinitely many 0s is still 0 right. So, and you will end up with a contradiction. So, this extension of additivity from countable to uncountable does not extend just because of the fact that I mean many points in this space has to have a 0 likelihood value they cannot all have positive likelihood and this is just for your friends do not worry much about that I mean we are not going to use it it is just to make it clear that the finite additivity why it is extended to countable, but why not to uncountable in many terms ok fine. So, if none of them is 0, if none of them is 0 the value cannot be finite, but so, I can think of some a simple case where instead of x and y we just take x x 10 is from 0 to infinity and p of x is 1 by x. So, then we take summation of that quantity that is finite 1. p of x is 1 by x. So, what is this example saying? So, suppose let us say is p of x is summation 1 by x is finite finite summation 1 by x let us take it is to be integer only like here x is greater than or equal instead of that just take x to be integers is this finite? This is not ok take this is finite ok you can make it a normal probability. Now, what we are saying here? Here in this interval for every point you have assigned a positive number let us say this is 1 by x I mean infinity let us exclude the infinity part, but open it interval infinity, but everything else. So, this is fine every point has a mass I am not talking about that case here right I am talking about the case where this assume where probability of omega has to be 1 whether that is going to be satisfied or not and probability of 1 is omega is nothing, but the uncountable many additions over all x y. So, in this case it could be 1 right. This could be 1 here in this case. The values are x values 0 to n table and each value has some finite mass there. So, finite mass here yes. So, all the cases are same with the condition right the number of points are infinite and none of the points are 0. So, over there it is come to be 1. So, how can we say that. So, this has to hold for anything right not for a particular example I mean this when we are talking about assume this has to be generalized over all possible space. So, saying in this example if we can prove that some of the values have to be 0. This would be a wrong statement right. In this case countably many has to be 0. That is true that is possible all of them can have some mass, but now that is what I am saying right like this is what we need to think about. Let us take if every point is positive then we are already saying that the summation cannot be anything finite it will be exploded. This is what we are we are arguing right. So, let us say in your case 1 by x square right this is going to 0 as extends to infinity and even those points which are tending to 0 are included in this. So, because of that you will not be able to find any epsilon positive and below which this value will not go. That epsilon here is arbitrary in this case, but where I mean what I am talking about is if everybody is positive with some fixed epsilon this condition is violated, but the example you are giving is that epsilon itself is tending to 0 ok. So, we have to somehow be careful when we are dealing with uncountably many points ok. So, that is why like I mean most of the arguments are going to make it for the finite case and wherever it is easy to extend it to the uncountable case we will do, but otherwise we will not get to that. So, that is why like people have built nice sophisticated theories in terms of measures and all I mean those things we will study in advanced classes ok ok. Next, how to interpret probability? I talked about one thing like likelihood ok like if you have a fair coin it is the likelihood of head happening is same as tail. So, I will assign equal values to them that is based on your intuition, but is there any other interpretation of these probabilities? Other interpretation, so the one we talked about is based on description or preferences. There other interpretation is called something called frequentist view ok. So, let me ask this question to understand this frequentist view. Suppose let us say you have a coin, a fair coin and you are going to throw it n times and out of this n times let us say you are going to see this many times heads and these many times tails and naturally n 1 of n plus n 2 of n has to be equals to small n. This is the total number of tosses you have made out of which n 1 is now let us look into this n 1 by n of n. So, what you are doing in this out of n trials you are trying to compute what fraction of the time out of this n outcomes what fraction of them are corresponding to heads right. Now, what do we expect this value to go if I increase n to larger and larger number tends to tends to what? Point 5. Why is that? You are understanding is if the coin is fair in the large number of trials it must have happened equal number of I mean it should its fraction should be almost half right. So, that is what like one could think probability as the fraction of the time it is going to happen when the experiment is done repeatedly and repeatedly means you continue till infinity. So, the frequentist view is exactly that like I can define let us say p is the probability of heads how I can do this?  Let us say suppose let us say in we have all this drugs that have been come up right which have been went through various trials and they said that the efficacy of my drug is 86 percent or my efficacy of my drug is 95 percent what does that mean? How did they come up this number? It is not like they just put its likelihoods on that they have to come up with this numbers right how did they come up with this? Yeah? Observe. Observe? Data and routine technical types. Yeah, so like they would have asked many volunteers like when you are go for a drug I mean evaluation you will ask volunteers or pay them to undergo trials you collect a good number of people you give this drug and see that on how many this drug is effective and then you take that on how many it is effective divided by the total number of people you administer this drug that can be taken as your probability of that effectiveness of your drug or curing that and that is why it like whenever you have data mostly you are going to go with this frequentist view and when you are actually not dealing with data like you have to just simply model some probabilities some probabilistic phenomena and you have just a belief about some probabilities then maybe you just to go and put this beliefs and try to see how things are ok. Now we are going to deal with three things as I said there is an underlying probability model we are going to observe that probability model through the data through which the data is generated and we want to see that can we imitate that underlying probability model so that we can also generate the data in the same way that guy is generating. If we could do that then basically we have understood that that system right we are basically able to like see what potential it could have done and infer and that is why the that role of the probability statistics and data comes into picture and that is what is now called it as a data science the interplay between these two. So, what happens in how they are used? So, probability and statistics these two things they kind of provide us a framework to understand the underlying phenomena and then make what we call it as consistent inference and also consistent reasoning and predict and make. So, how is that? Let us talk about some real word problem let us say this could be like a weather and in the weather I am interested in predicting whether it is going to rain tomorrow or not I am interested in that. So, if I know that how the weather affects like how the rain comes based on what factors everything then I kind of myself build a probability model and then predict whether the rain is going to come based on that, but weather is very complex like I cannot simply understand everything like based on which some weather phenomena happens. So, what we actually do is this is a real word weather, but we try to model it according to some probability model this is our model. So, this is reality this is our thing model is ours the reality is the real word problem. So, now what we are trying to do is we are trying to understand this real word problem using some probability model and when we try to build some probability model and we will say that this will come with some parameters probability when we are going to do models the models will come with some associated parameters. Now, just assume that real world problem is also another probability, but it is going to use some particular parameters and I do not know those parameters. If I know those parameters maybe my real word model is as good as my probability model is as good as the real word model it is just like maybe I do not know those particular parameters that is using, but then what is good is I can get the data from this real word problem right like whether I observe whether it is going to rain tomorrow or not and I have like that I have in the I have recorded whether it rained or not in the past 10 years on particular each of these days. So, I have this data I can use this data try to do the inference what could be the possible parameters that are going to explain this data and how to effectively identify and estimate those parameters all these things this statistics is going to tell me how to do that and once you use those parameters you go back and use them in your probability model and see that what your probability model this is your built model is going to tell like whether it is going to rain or not then you actually observe what happened and then you know that whether what you predicted and what data said they are same or not. If same good if not you know that you made a mistake your probability model is not good enough it needs to be improved ok. So, you take that and you use your other further statistics method to improve the parameters and go back and improve your probability model. You tries to continuously try to do this so that your probability model tries to give as good as predictions where your predictions are you are making lesser and lesser errors in your prediction that means you have try to understand the real or problems and your probability model is trying to capture that well. So, this is the interplay between all the things and I mean if you just think of the forecasting whether forecast this is exactly happening and people have built they have been collecting this data by putting sensors at various places and based on that they estimate the parameters and use that parameters to use in certain probability models based on that they predict whether it is going to what is the weather is going to be and then they will see that what actually happened get a new data and for that they will try to improve the parameters and discontinues ok. So, that is why it is very important that we understand probability models and see how to use the data to make a interference and get a good parameters for them and improve this probability model so that they capture the real world problems well ok. I think we already exceeded time we will stop here.


Hello and welcome to the Introduction to Fluvia webinar. I'm Grant Swanson, your host for today's session, and later I'll be joined by Nick Cardin, Principal Software Engineer here at Infineon. We will start with a few introduction to Infineon slides, then go into a live demo, and then finish up with Q&A. Please enter any questions in the chat window. We also have new content in the handout section available for consumption. This slide shows Infineon at a glance. Our founders who built EngineX's open source service mesh started the company in 2019. As companies progress on their journey in digital transformation, we believe that we're perfectly fit to drive the next stage of transformation, which is the use of real-time continuous intelligence to increase business impact. Our engineering team has written over 100,000 lines of code and have built an enterprise grade platform from the ground up that provides horizontal scale and self-healing. Infineon's mission is to accelerate the world's transition to the real-time economy. Fluvia is an open source programmable platform for data in motion that's built on rust. The platform features smart modules with programmable stream processing to clean, transform, correlate, and drive insights from data in real-time. It also features data streams that utilize distributed processing with redundancy and failover to prevent data loss and minimize downtime. The platform also includes a mutable store with a long-lived immutable storage layer that persists data without compromising latency. Excuse me. Fluvia has clients and connectors that include native API support to the most popular programming languages and a connector catalog. The platform allows architects, data engineers, and developers to build intelligent pipelines quickly for a broad set of use cases. Fluvia is modern as it's written in rust, which means it's extremely fast and safe and we'll go into some of those metrics later. And it's cloud-native with Kubernetes integration. Fluvia is powerful with programmable smart modules, event correlation, and hierarchical pipelines. Fluvia is also easy to use with the ability to provision end-to-end pipelines quickly. This is a comparison between Java and Rust. Java is a popular programming language used by developers and is what most of the data streaming products are built on. However, Rust has many advantages when it comes to performance and security. With no runtime or garbage collector, it can power performance critical services, run on embedded devices, and easily integrate with other languages. Latency stays predictable at high throughputs over P99, which means that 99% of the requests should be faster than the given latency. Rust is also completely memory safe, which separates it from Java with its strong security guarantees. While other data streaming platforms use polling to consume messages, Fluvia uses asynchronous processing for significantly lower latency. Fluvia runs in pods and can collect millions of events per second with just a few dedicated servers. Our technology can change servers and can scale up to virtually any number of concurrent connections. This diagram shows common components which are configured with smart modules performing inline computation. The diagram shows five places where smart modules may currently be used, in source connectors and sync connectors, in programmatic producers, consumers, and in the Fluvia OCLI. Smart modules are typically applied to data before the data is sent from one location to another. This is so that any filtering that happens will result in less network traffic and more savings. For example, stream inputs, source connectors, and producers will apply smart modules before sending data to the Fluvia O cluster and stream outputs such as sync connectors and consumers, or the Fluvia OCLI will upload smart modules to the Fluvia O cluster and process data before the stream is sent over the network. This helps to overcome data gravity by moving only the minimal amount of data necessary. We're gonna take a second and give, provide sort of a reference architecture for the before and after Kafka versus Fluvia. Kafka is one of the most popular data streaming open source platforms in the world. And we wanted to just compare what a reference architecture looks like. So in this Kafka versus Fluvia diagram, you will see the complexity of managing the various clusters to build an end-to-end pipeline with Kafka. Now looking at the Fluvia O cluster, we've eliminated the need for ETL, which is basically your extract, transform, and load tools as we're able to perform this function in line with smart modules. So no ETL tools needed. In addition, no Apache Zookeeper is needed, no KStream cluster, no KSQL cluster, or Flink clusters required. So very simplified architecture. Next we're gonna go into a case study for a current beta customer that's running Fluvia. And we have a cost savings case study that we produced that we'll share after the webinar. So this company is building a protocol for creating decentralized applications quickly on Ethereum and IPFS. They recently received $50 million in funding, have thousands of users, and are gaining significant momentum in the market. They reached out to Infineon because they hit a limit with their current Kafka architecture and had difficulty scaling. They did a POC with Fluvia with a use case that required data streaming and smart modules for extensive data transformation. They've estimated that traffic volume would require 22,000 partitions, excuse me, to run their network of users. For an average traffic volume, Kafka needs one gigabit of RAM per partition. With Fluvia, a partition requires 50 megabits of RAM. By moving to Fluvia, they're able to achieve a cost savings of over $41,000 per month. This high level roadmap that we're showing now shows the progress and feature development of Fluvia. We launched Fluvia in 2020 with immutable storage, replication, and APIs. In the early part of 2021, we launched smart modules that included real-time inline filtering and mapping capabilities. This was followed by array maps and aggregates. In 2022, we started to build out our connector catalog with MQTT, HTTP, and Postgres smart connectors now available. We also have Cassandra, Kafka, MongoDB, Redis, Snowflake, and Slack connectors that are in development. As we move into the second half of 2022, we will launch smart pipelines with derived streams. Now I'm gonna pass the controls over to Nick Cardin, our principal software engineer here at Infineon to show a live demo of Fluvia. Give me just one second, Nick. All right, there we go. Okay, and you can see my screen? Yes, we can. Okay, thanks. All right, good morning. So today I'm going to demonstrate creating a Fluvia smart module for removing sensitive information from a data stream. And to clarify, a smart module is a piece of logic that's compiled into WebAssembly and is able to be hooked into various parts of Fluvia to customize functionality. So for this demo, I'm going to produce a set of records with sensitive fields in a Fluvia cluster. Then I'll write a smart module to transform the records to remove fields and mask sensitive data. And I'll apply this while consuming the records to show the transformation. And like Grant said earlier, like these smart modules can be hooked in at any point data intros or exits Fluvia or moves between topics. And the sample data is going to look like this. It's going to have some fields and some of them will be sensitive and need to be redacted. Okay. In this scenario, I'm going to store some user accounts and they're going to have phone numbers and social security numbers. And we want to omit the social security number and mask the phone number. And for this, I'm going to be using our Infineon cloud. And you're able to perform these same steps by signing up for a free account. But for the demo, I'm going to use my demo account. And you can interact with your Fluvia cluster and Infineon cloud with either the web UI, Fluvia CLI, or any of the client libraries. I think Grant already mentioned that we have libraries for Rust, Python, Node.js, Java and Golang. But for the demo, I'm only going to need the web UI and the Fluvia CLI. Okay. So first thing I need to do is create a topic to hold the user accounts. Okay. And then I'm going to switch back to the Fluvia CLI to populate the sample data. Well, first I need to log into my cloud account. So I'm going to use the Fluvia CLI cloud login command and just use the same credentials as I used when I first signed up. And now my Fluvia CLI is synced up with my cloud account. And now I want to just produce the one record I'm showing you above. And just did Fluvia produce to the user accounts topic and the sample data file you see above. Okay. I'm going to switch back over to the web UI and in the records tab for the user accounts topic, you're going to see that what I just produced. And I'm going to write my smart module in the editor, smart module editor tab right here in the web UI. And the web UI currently only supports writing in wrestling, but other language support is planned. So I'm going to select the type smart module to be map. And here I need to write my map function that's going to do the transformation. I'm going to be pasting code snippets into the editor to save some time during this demo. And so I'll point out that Fluvia records are just arbitrary bytes, allows you to store any kind of data that you need. In this case, we're using JSON and we need to deserialize it. So first thing I'm going to do is define a struct here, user account that represents the data that I just produced earlier. And we need to bring in a serialization library. In RustLang, we have Serde, which is the most popular one. And then we need to decorate the struct with a deserialize procedural macro. And then we also need some modules from end types from the Fluvia smart module library. And then we're just going to define our function. And so it's just going to be a map function and it's going to take in a reference to our record and the output is going to be a tuple of key value and the key is optional. And the explanation around what is a, how keys work in Fluvia is a little bit out of scope for this demo, but the information's on the Fluvia website at fluvia.io. Okay, and the first thing we need to do is actually do the deserialization in this function. So we're going to deserialize and store the record, the account, deserialized account in this account variable of type user account. This is the struct we defined above. We're just using Serde JSON of passing in a reference to the record value. Okay, and now what we wanted to create here is a redacted version of the account. And we're just going to define this as a directly like a JSON object. It's going to have full name, email, phone, and we're going to omit SSN because we don't want that to be in the output. And we also want to mask the phone number. So we need to define another variable that's going to hold the last four of your phone number. And we're just going to do this the quick way. I'm going to take the phone number from the account, reverse split on the hyphen and then just get the first item which will be the last four of the phone. And we need to update the JSON output to instead use format like this where all the stuff that's been masked out is replaced with asterisks and we're going to inject the last four. So look how you expect. And then all we need to do is serialize it back into the JSON string. And we're using Saturday again. And then we just need to return bytes from this function. So we're going to convert that string. Since the output of this function is record data, and by calling dot int to on the JSON string, it's going to automatically convert it to bytes and that's what's going to be sent out from this function. And I think that should be it. And so let's apply this. And what that's going to do is it's going to compile this code using the REST compiler, but in our cloud backend. So that usually takes a few seconds at least. And here you see that the data has been transformed. So let's look at it again. So this is what went in. I guess I can actually show you that in the records tab. So that's what went in. And with this smart module I just written, this is what came up. No SSN and the phone number has been masked. Okay, so the smart module will be applied to any future record that's been being produced. And I can best demonstrate that using our CLI. So I have the same code that we wrote in the editor. I'll be prepared this here. And I'm just going to compile it and I'm going to upload it to the full view cluster under the name redact. So that's just the path to the wasm binary that was just built. And now I'm going to consume using that smart module. I'm sorry, Grant, can you let me know if you're seeing the right side of my screen or if it's being blocked? We can see it. Okay, thanks. All right. So now I'm going to produce a few thousand records from a prepared JSON file. Like I just have 5,000 pre-generated records here of user accounts. And I'm just going to produce it. You can see as a producer, the consume was active. And with the smart module automatically transformed everything I just produced. But to kind of give you a better feel of this happening and that this actually happens in real time, I want to do this in slow motion. So I'm going to use a Node.js script that I wrote that's going to produce records slowly so you can kind of just better visualize what's happening. So it's going to produce random new user accounts. As it's being produced, you can see that it's being redacted and displayed here in the consume output. Okay, and that concludes the demo. And Grant. Excellent. Thank you, Nick. That was awesome. So if anybody has any questions, please type them into the question window. Nick, we have a couple that have just come in. The first question is, can Fluvia run in public clouds like AWS? Absolutely. Our Infinion cloud is actually running in AWS. And with the open source Fluvia repository has scripts to help you deploy that in EKS on AWS. And since it runs on Kubernetes, it should run in any other cloud platform that supports Kubernetes. Excellent. We just had another question come in. They're asking what other kinds of smart modules can be written? Sure. Yeah, I think you went over it earlier. So we also support filter and array map and aggregate. And filter, and I can quickly explain those, like filter is just where you have right logic to make a decision as whether to consume this record or not. And aggregate is a little more powerful, allows you to look at multiple records in the stream and then aggregate some sort of value based on it, much like in relational database systems with aggregate functions. Awesome. I don't see any other questions. So I would just like to let the audience know you're welcome to go to www.infinion.com. There's a Try Now button if you'd like to start your own Infinion cloud account and test out the real-time data streaming. This is the most modern platform available written on Rust. As you can see, the performance metrics, the memory metrics are far better than any other data streaming platform out there. And we're really excited to show this. So if anybody's available on March 24th, we have our Kafka versus Fluvio event streaming for high performance data pipelines webinar. Feel free to register for that. We also have some great content in the handout section. And we appreciate you joining us for the webinar today and this concludes our session. Thank you so much. Bye.


Runs, runs, runs, that's all the Bemidji and Brainerd softball teams have done on the diamond this season. Rewind the last year's matchup between these two, a combined 31 runs were scored and the Warriors win. What will transpire this afternoon as the Jacks travel to Brainerd? Fifth inning we go, Brainerd's Elena Christensen finds some green in left field. That'll score Sadie Jordan, they're up four zip. Three batters later, it's Claire Sinoa. Lining it to the wall in right field here, the all-star Kylie Lang will cross the dish. That puts the Warriors up six to zip. The Jacks won't go away easy. Evette Morgan, she's gonna line a single in the left here. That'll score Samantha Edlin. But it's all Brainerd today, they go on to win seven to four. They are now 10-0 on this season. If you've enjoyed this segment of Lakeland News, please consider making a tax-deductible contribution to Lakeland Public Television.


Thank you very much. Good to be here. President of the United States. Thank you very much. Thank you. I heard you, Howard. That's always a thank you. Well, thank you, Bo, and thank you, ladies and gentlemen. For a minute there, Mr. Callaway, I almost called it BOPAC. Let me just add we owe a special thanks to Congressman Newt Gingrich. He couldn't be here today but the new General Chairman of GOPAC. You're here today because you've chosen to become actively involved in the political life of our nation. Well, I guess you wouldn't be surprised if I said that reminds me of a story. I hope I haven't told it to you before. It has to do with a fellow that had some creek bottom land. The old boy went to work and it was covered with rocks and brush, and he cleared away the brush and he hauled away the rocks, built the most beautiful garden spot you've ever seen. And one day at church, one Sunday, asked the preacher if he wouldn't come out and see what he'd been doing. That afternoon, when the preacher dropped by, he was astounded. He said, look at that corn. I've never seen corn. So look at those melons, the biggest melons. The Lord has blessed this land. And he went on with that way. Oh, bless the Lord. Look at all of this. And the old boy was getting pretty fidgety and finally he said, Reverend, I wish you could have seen it when the Lord was doing it by himself. That's the way it is with our nation. God has blessed us with an industrious people and a vast and beautiful land. But in this democracy, it's up to each of us to help keep America great. Think back just six years ago. Big taxing and spending had led to soaring interest rates and inflation. Our defenses had grown weak. All over the world, America's reputation was no longer one of strength and resolve, but of vacillation and self-doubt. Many in Washington seem to forget that the bedrock values of faith and freedom and family were what made us a great and good people. It seemed for a season as though any sense of justice, self-discipline, and duty was ebbing out of our national life, and that our nation was in an inevitable decline. The American people decided it was time to put a stop to that decline, time to give our country a rebirth of faith and freedom. We Republicans took office determined to make a new beginning. Today, we've knocked inflation down to about a third of what it was. We're in the midst of what may prove the longest economic expansion since the war, if not international history. The stock market is up, way up, and more Americans have jobs than at any other time in our history. And just as we've moved ahead in the economy, this Republican administration has taken vigorous action against waste and fraud in the federal government. We've taken aim at crime. We've nearly doubled the number of federal cases against drug offenders, more than doubling the conviction of organized crime leaders, and setting up drug task forces. And we've moved education to the very top of the national agenda. When we took office, only a handful of states had task forces on education. Now virtually all states have organized reform commissions. In foreign policy all over the world, or all the world knows that America is strong again and determined to stand up for freedom. Now we need to make these Republican accomplishments secure, extending our support to state and local levels. Consider this, there are 88 congressional districts where in 1984 George Bush and I received more than 60% of the vote, but where the congressional seat is today held by a Democrat. It's time for us to start fighting back and time for us to set priorities, concentrate on just how and where those congressional district lines are drawn. I used to say the redistricting that took place when I was governor of California, the only Republican district they left us in the state was south of the border. If Republicans have a greater state house strength, then we can play a major role in ensuring a fair redistricting process. And remember that process takes place again in 1990. I'm sure you'll agree that future presidents should not have to work with a Congress that doesn't represent the people. GOPAC is determined to correct this political anomaly. You know what political anomaly means, that's a fancy phrase that says the Democrats have been gerrymandering us for years. What we Republicans need is, well baseball season's here so let me put it this way, we need farm teams, training grounds where Republicans can get experience in state and local politics, preparing themselves for the House of Representatives and still higher office. And yes, where Republicans can learn to work together to gain the strength to prevent still more Democratic gerrymandering in the future. If the need is great, the opportunity is greater still. Listen to this, a gain of just 67 legislative seats nationwide would give us Republicans control of 49 state legislative chambers. Now to think of it, that's a fact we might want to learn by heart. Under the leadership of Bo Calloway and Newt Gingrich, you've been making GOPAC a force in Republican political campaigns across the country. Please keep up the good work. Get involved in your state legislative campaign committees and support local GOP candidates. And yes, help our party fight the fight for fair redistricting as we approach the next census. For all that you've done for our party, and even more for all that you're going to do, I thank you. God bless you all and now I understand there's time for a few questions, which I've been hurrying to get to, yes. As Senator Baker said, anyone that's been involved in business negotiations has seen how brilliantly you've negotiated with the Soviets. My question is, how likely is it that in the very near future we'll get the major arms control agreement that we all want? How much of the last part? What? How likely is it in the very near future that we'll get the major arms control agreement that we all want? Well, I've always been a little superstitious about getting optimistic and predicting a no-hitter or something. Dates back to my sports announcing days. But I do have to say that we all are encouraged here. When you stop to think that this is the first time any Russian leader has ever really proposed eliminating weapons they already have. That's never happened before. And I think that what's on our side is not a change of heart so much as just sheer necessity. He is faced with, as I was six years ago, with a great economic disastrous problem in his country and has been augmented by their great arms buildup. Already they've been building four-to-one in tanks over us in the NATO countries, six-to-one in aircraft, things of that kind. And I think he has a need that if he's going to get this class no-st as he calls it and these changes, he's going to have to make some changes about the military. So we are encouraged. Actually the proposal that he made about the long-range intermediate-range weapons in Europe, that's the proposal I made four years ago. And I'm just very happy to let him take credit for it just as long as we can get it. I got a thing on my desk that says you can accomplish much if you don't care who gets the credit. Someone else? I heard from Senator Baker's remarks that the expectation of some kind of cooperation from Japan and Germany to stimulate their respective economies was slim, perhaps slimmer than we in the financial community had hoped for. What is your feeling about that and what you hope to achieve? It's a long, hard fight. For three years, I'd been begging for a whole review of the GATT process and the treaties and so forth that have to do with trade. And finally, last year in Japan, our six economic summit allies agreed and we started. In Japan, we also made a decision that we've got to look at something worldwide about the problem of agriculture. For example, the simple truth is that we are all subsidizing agriculture in such a way that we are responsible for overproduction worldwide of the product and thus the lowering of the prices and so forth. We've got to get the marketplace back into dictating what's done, not governments. But yes, some of them are. We'll have a harder problem in dealing with it. Prime Minister Nakasone, you couldn't ask for someone that has tried to be of more help. He's endangered himself politically in his own country for what he's tried to accomplish. And something of the same exists with Germany. But we're after them. At least we have one thing that again makes me hopeful. And that is that when they saw our economic recovery and realized how it had come about, I was amazed that next economic summit I went to, following our beginning recovery, this was all they could talk about, was the American miracle, as they called it. And we told them that we'd done it by reducing government regulations, by reducing taxes, by providing incentive for people. And many of them spoke up and said they realized that they were burdened by too many regulations and restrictions on hiring of labor and this sort of thing, and taxes, you realize that under our new tax reform, that highest bracket, 28% on the biggest of earnings, that is lower than the lowest rate of income tax among most of our trading partners. So what we're trying to do is use ourselves as an example and encourage them. And some countries have done more than others in this and have found out that there is a stimulant to the economy when you let people keep a little more of what they earn. We're getting more revenue from lower tax rates. Mr. President, I think you were right in supporting the countries. Will they continue to be able to get support from our government? If I have to storm Capitol Hill like Teddy Roosevelt went up San Juan Hill, this is really shameful of what's going on in Congress and the attitude in Congress. We have a totalitarian communist government running Nicaragua. It was the only organization in the Revolution against Samosa, the only organized group. The Sandinistas have been a kind of a communist organization there in that country for a number of years. The Revolution was successful. They were in a position with an organization to kind of move in. And what they did was get rid of in a number of ways from exile to execution leaders of other groups in the Revolution. Now what you see is what they call the Contras. That's their name for them and it's disgraceful because that means counter-revolutionaries. They're not. They're still revolutionaries that want what they fought for in the first place and that's democracy. How many people know that in the midst of the Revolution against Samosa the revolutionaries ask the organization of American states to take their side and be helpful. And the organization said we want to know what are the goals of your revolution. Well in writing, they're for democracy, for a pluralistic society, for press, free labor unions, free speech, until they got in power and all of those promises have gone out the window. So I don't see us having any other choice but to be of help to the freedom fighters because if you want to look at it in a really selfish and practical way suppose that we don't succeed. And pretty soon, Hala Cuba, we have on the mainland of the American continents a Soviet satellite state. Now the Sandinistas have repeatedly said that their revolution knows no boundaries meaning that once they're there, they're going to try to expand and spread this through other countries. Well there could come a day when it wouldn't be a case of just providing arms for freedom fighters. It would be a case of where we might be forced to provide not only the arms but American military personnel to use them. And all we want is an opportunity for democracy there. And it's up to the American people to make this a case of misunderstanding because the Sandinistas have a very sophisticated disinformation network and it makes use of our own media many times to tell their story but to not tell the other story. A bishop from this country down there was leading some refugees across the Honduran border. The American press reported that they were attacked by the Contras but that he managed to get them across the border. And then the note said that he had come home to his bishop's position here. I phoned him and told him of what I had read. And he said, well, that's not true at all. He said, yes, I was leading the refugees but we were attacked by the Sandinistas and the Contras came to our aid. That story has never appeared in any of the media in this country but that's the kind of distortion that has the people so fooled that a great majority of them in the polls say they're opposed to me and wanting to help the Contras. But another question in the polls, do you think it would be right for us to oppose the establishment of a Soviet satellite on the mainland of America and it's about 80% of the people say, you bet we ought to stop them from doing that. Well, that's what we're doing. We just have to convince people that the two are one and the same thing. I won't. Thank you. The gains we're making on the tax structure, is there any other work being done like the taxpayers' bill of rights gains to protect the First Amendment rights of citizens, the civil rights of citizens from the IRS themselves? My golly, I don't know. I don't know but I can tell you that I have long felt that everybody has to be on their guard against the IRS agents. But we do want and we will and have checked into every time we find that we can find that there is an unfairness of any kind going on there. We want to give the country back to the people. Mr. Volcker's term comes up in August. Do you have any comments? I can't make one right now. We're in the midst of that entire situation. So I just can't comment. Part of the whole situation is what does he want to do? Last question. Tell me it's the last question. Mr. President, I'm a sports enthusiast from New York. And last year we had two championship teams and the Mets and the Giants. And a lot of it has to do with a good head coach. And I'd like to say and I'm sure everybody here agrees to be a great head coach for this country. Thank you very much. Thank you. Thank you. That was a good question. Thank you all very much. Mr. President, good to see you. Thank you.