Hello in this lecture we will define bank reconciliation according to fundamental accounting principles while 22nd edition the definition of bank reconciliation is report that explains the difference between the book company balance of cash and the cash balance reported on the bank statement for purposes of computing the adjusted cash balance. In essence what we are going to do here is we're going to take the bank statement usually a monthly bank statement as of the end of the month and compare that to what we have in the books why do we do that because the bank is really a second recording a third party recording of our entire cash account the cash accounts being one of our most important accounts therefore if we can tie out what the bank has reported to what we have been reported we have one of the best and most secure checks to the fact that we have been recording cash correctly so for example we might have the bank statement in this case at the end of February showing the beginning balance showing the activity showing the ending balance at the end of February and then giving us the detail the deposits and the checks and the other types of transactions that would be involved in order to get to our ending balance from the beginning balance. We're going to take that bank statement it's from the bank this comes from the bank and compare that to our books something like this this is going to be kind of an example of our general ledger our general ledger should have all the same transactions recorded because of course our general ledger is recording the cash transactions for cash therefore we should be able to take our general ledger and basically just check it off to all the transactions that are happening in the bank and tie everything out now of course when we do that comparison and we look at the bank balance in this case as of February 28th we see that it does not match our book balance and typically that will be the case why normally when we get down to it it will be because of be because of outstanding checks outstanding deposits outstanding checks and deposits that have been made on our side that have not cleared the bank we expect that to be the case anything other than that are things that we should adjust our account for meaning if there's anything on the bank statement that's not on our books probably the case that we need to fix our books there's anything on our books not on the bank statement probably outstanding checks outstanding deposits those are the reconciling items that we will put on the bank reconciliation so when we do this comparison we see that we can check everything off but the withdrawals and the bank service charges and there's a couple outstanding checks here that if we ticked everything off which we won't do at the time we would have that but we see that we cannot we have these items on the bank statement that are not on our books so we made a withdrawal and we have bank services charges that we did not yet record on our side those are things that we are going to have to adjust we could put those on a bank statement to adjust them later or we could just basically make that adjustment and it would look something like this we would be increasing our cash here by the 82 and having having that go to some other account in this case miscellaneous and bank service charges and that would be changing our bank balance for the items on the bank that we need to record the we have recognized from the bank statement that we need to record then the things that are left that are the difference will be in this case the outstanding uh checks and the outstanding deposits therefore now we can take basically the bank balance and reconcile it to our balance so here's what the bank had we're going to say hey these checks were outstanding we know exactly what they are they were made at the end of the month so it would make sense that the bank has not yet had time to process those they will they be processed next month in march we have the same thing for the outstanding deposits this one was made at the end of the month therefore it has not cleared the bank that would be to be expected therefore we can see this is the bank balance that we can then adjust by those outstanding items to our balance and we tie out here why is that important it's important because if we know exactly what that differences is are exactly what they are then we also can have some assurance that all other transactions have been recorded correctly meaning that we haven't had some transactions made that weren't recorded in our books or we didn't um record something in our books that didn't happen those are the kind of things we're checking for in the bank statement in the bank reconciliation probably one of the most important checks that we should have after the double entry accounting system itself


Good afternoon. I'm Lisa Shea. I teach electrical engineering at West Point and I'm here with my colleague Greg Conti who teaches computer science at West Point and our friend Woody Hartsog who is a lawyer. He's an assistant professor at the Cumberland School of Law which is part of Samford University. He's also an affiliate scholar at the Stanford Center for Internet and Society and he's worked at the Electric Privacy Info Center as well. So we're going to talk about confronting automated law enforcement which is any use of automation computer analysis within the law enforcement process. These are our own ideas, our own thoughts, not those of our employers. So the whole idea is we like living in a free society and we don't want to live in a police state. And you think about it's always good to obey the law. I mean that's part of our value system, that's part of what makes society work. But think about what happens if everyone obeys every law rigidly all the time. This is a video that maybe many of you have seen where a group of students at Georgia Tech tried an experiment. They drove around the Beltway around Atlanta at exactly the speed limit and they got a whole bunch of friends together and drove right across the entire highway at exactly the speed limit. And you can see they got off a traffic jam that's building up behind them. They were happy too. And the people behind them you can imagine were just thrilled to be going exactly the speed limit. It could actually have been a very dangerous experiment. I mean there were people driving on the side of the road to try and get around this. So as I said, automated law enforcement is any computer based system that's going to use input from unattended sensors that we have all around us to algorithmically determine whether or not a law has been broken and then to take some kind of action. So really what we want you to take away from this talk are three things. One, the network technologies exist right now. Second, if we aren't careful in paying attention to how these systems are in place, really disastrous consequences could ensue. We could end up living in that police state we showed earlier. And then third, you all in this audience are in a unique position to help prevent this. You have the technical knowledge, you have the networks, you've got the skills and abilities to see what's going on and to ask the right questions of people who are trying to implement these systems. So over to you Greg. So what leads us to this conclusion? Well we argue the precursors are in place for this now and it's a natural extension. We can see what's going on now and look into the very near future to see where it's all heading and hence the motivation for our talk to try and generate some interest in deflecting the trajectory of this. Just imagine the sensors in your home, the sensors on your body, the sensors in your body, the sensors in your car, the sensors in your community. They're proliferating at a massive rate and that creates data and data flows at an enormous amount, increasing views on our lives from every, you know, every angle that can be sampled by a sensor. And we're seeing increased diversity and sensitivity of sensors. This is an example of someone who had a medical test that injected a radioactive compound into the body for a medical reason, driving home, sets off a radio activity sensor in a police car and gets pulled over. This is actually true, we have the links in the slide. But that's the type of thing. So we're seeing increased diversity of sensors. We're seeing sensors becoming mandatory. As in the United States, this trend toward mandatory black boxes in cars to track. We see increased mobility of sensors. We, and alongside that we see the transfer of military technology such as drones into law enforcement roles. Probably one of the largest areas of concern is the mobile device that we carry on our pocket and this closes our location. It includes, it's replete with sensors and high speed network connectivity. So what I'm trying to paint here is a portrait of where we are now.  But if you put them all together something larger and more concerning emerges. You know, the idea of connected cars and on-star. Sometimes you can't get the car, particularly in a rental, without it. This closes your location and this full time connection. If they can start your car remotely, presumably they can turn it off remotely as well. We're losing control of our technology and there's a great quote here from Corey Doctorow. But the idea is more and more we're having closed source technologies where it's illegal to lift the lid and look inside the firmware or the software. And so general purpose computing is under attack and Corey has a great talk on that. Highly recommended. So we've got these data flows and we have, but once you have this data, well what's a key component? It's identifying the people that are potentially the subjects of this law enforcement system. Obviously there's current advances in facial recognition system. Alongside mandatory biometric databases at the nation state level being constructed such as in India where there's over a billion people being enrolled in such a system. Computing, I mean I think we'll admit that facial recognition isn't there yet. It has its flaws. But hybrid systems are emerging to allow identification of individuals. And this is from identifyriders.com. It's a great time to be alive when there's a website called identifyriders.com. But this is from the Vancouver riots where they are trying to solicit crowdsourced identification of people who were allegedly involved in the riots. There's even business models where like say convenience store camera monitoring is being crowdsourced and then they give small rewards to the citizens. So what can't be automated can be combined in a human machine hybrid system. And as we look to the future, has anyone seen Google's project last video? Even better, have you seen the parodies where they're wearing the glasses and they get text messages across the street and get run over in the crosswalk? You should definitely go to YouTube and look up the parodies. They're better than the original. But the bottom line is if this actually comes to pass, there'll be millions of people wearing always on sensors looking around in every facet of your life or life on the street being collected. And it's a matter of then getting access to that data by corporate America or law enforcement. We also see a trend of analog systems being converted to digital systems. And analog systems and traditional law enforcement is moderated by the human, it's human in the loop, intensive nature. But as things become increasingly efficient, then you can have automated or law enforcement with unprecedented rigor. And bonus points, what is this license plate from? Back to the future too, yes. That's why I love DEF CON because you know people, you know someone will come up with it. We're seeing increased capability to analyze these data flows. Here's a system that claims to be capable of tracking 32 vehicles across four lanes. And what we see emerging is on all major highways, the ability to track every car in real time, identify the car, identify its speed and other activity. We also see other sensors, technologies being developed such as the wide area motion imagery system which can track individual vehicles and people over long term, you know over course of hours, you know, long term monitoring of paths that individual objects, people and cars are taking. And the very aptly named persistent stair, exploitation and analysis system. And then of course the cost of technology is dropping. Location tracking, so you can track your spouse or children is dropping on a daily basis. So the technology is getting cheaper and cheaper where it's almost disposable. In predictive policing, the ability to take the data as it exists that you have now and then try and project out into the future when and where crimes will occur is actually reality. We've seen this before. Where have you seen it? Yes. So okay, these aren't pre, we're not saying they're pre-COGs involved, but it's definitely out there and there's, we have links in our slide deck about where it's actually being done. And of course there's lots of interested parties because a lot of this comes down to who is incentivized to employ these systems? Who is incentivized to constrain these systems? And there's lots of interest across the law enforcement spectrum and from industry because there's benefits to this and there's certainly dangers and there's certainly financial advantage. And for those of you that live in New York, New York City, and we live an hour north of New York, so we're apparently in the near future will be no longer able to purchase 32 ounce sodas and that just gives a trend toward their well intentioned officials that might like the idea of broadly enforcing the law across the populace. And there are other, you know, historically if you look back, there are certainly law enforcement agencies that have strict, shall we say strict enforcement models. Some would call them speed traps such that the automobile association of America has erected billboards outside some of these towns to warn motorists. So there are, there is clearly the opportunity for abuse by automating some of these. And you hear the term quotas and most people law enforcement officials will say, well quotas don't exist. We never tell our officers to enforce a quota system to, you know, up the numbers for a given month. Well, we're, we argue that they do and I mean I'm sure they're not supported officially but here's an example that the New York City Police Benevolence Association has actually reported to the report form to report when the officer claims that they've been asked to enforce a quota. So these are all like trends pushing this forward. And the, who's seen bait cars, right, they leave a car on the side of the street and someone decides to get in and the keys happen to be in the car and they drive off and they get locked in the car a few blocks away and arrested. So, but, so the idea of these systems can be interacted and used in many, many innovative ways. And as we look to the future, you know, who knows what type of bait, that bait could be used, you know, the pleasure model robots or who knows what. And then out and out illegal enforcement. Well, you know, we don't want that to happen. The power that these systems provide allows for illegal enforcement and potentially. And we can certainly, and I want a picture like that on top of my car just for the record. But clearly certain regimes will abuse these systems if they, if they have the power to do so. And this is all in the context of citizens who want a free lunch. And this is from Sans Fire where a bunch of security professionals were literally offered a free lunch in return for their, in return for their personal information. And similarly, social media is part of this, disclosing so much information in largely a public way. And it has not gone unnoticed by law enforcement entities. And here's an example of college students who knew their local college police were monitoring law, monitoring Facebook and decided for underage drinking and decided to stage a party that they bragged about. And it turned out it was just cake and soda. But when local law enforcement arrived, they were not pleased. But still, the idea here is that social media provides a data flow. And this isn't all pie in the sky, just this is going to happen. We already see successful prototypes and business plans now. And if any of you, for example, driven the I-95 between, say, the Washington, D.C. area north toward New York City, there's sections of the highway that have cameras at regular intervals. So we're not making this up. And then the law itself lags technology and it's progressing forward at such a rate that the law just isn't there yet. And we'll probably never be there. So where's all this heading? Okay, we've got enabling technologies. Check. Sensors everywhere. Check. Permiscuous data sharing by citizens. Check. Security and financial incentives and well intentioned law enforcement and complacent citizenry. Check and check. And then the law lagging technology and successful prototype. So all the precursors are in place. And we have to now look at where this is all going and make sure that we deflect it onto a trajectory that makes sense. Because otherwise, frankly, I don't think this is going to end all that well. That's what you get for having someone else's keyboard. Okay. So how does the law become involved in all of this? So Greg just talked about how the technology is in place. The sensors are there to record our activities. But that's not the only thing that can be automated. When we're talking about automated law enforcement, we're talking about a complete loop, not just with sensors and recording activity, but in storing that activity, processing that activity and making a decision whether to punish someone or not based on that activity. And so we've actually got three different levels here where we talk about there's the subject that is surveilled, the law enforcement agency at various points which you could automate decisions. And finally, the judicial system. Do we decide to meet out some kind of punishment or not? I'm going to turn it over to Lisa to talk a little more about this diagram. Okay. Granted, this is a busy slide. It's in the CD that you got. So you can look at it in more detail later. But briefly, I'm going to go over the areas of how this could be automated. So looking at the upper left corner of the diagram, subjects going about his or her daily life being surveilled by an automated system, which a law minority report might have a predictive module in it that then says, oh, subject is about to commit a crime. And depending on the scenario could potentially stop that crime, prevent that crime, a law minority report, or in another scenario could warn the suspect that, hey, what you're about to do is illegal. And then the suspect has to make a decision to commit the crime or not. And then if the crime is in fact committed, there will be some post processing again by the surveillance system that then decides, ooh, did the system detect that a crime was committed or not? Yeah, somebody committed one, but does the system catch it? If the system doesn't catch it, that's a false negative. There are errors occurred. But in our personal view, a system that doesn't catch a crime is, you know, it's it's got problems, but that's not the most serious kind of error. What's worse is if the person says, oh, you're right, I'm not going to commit this crime, then the post processing algorithm decides that they did anyway, that's a much more serious error. We call that a false positive. And that's, that's where some of the real danger lies. And then if the crime was detected, the law enforcement system then decides to prosecute or not. In a normal, everyday human based system, the police officer on the beat has discretion. But in an automated system, this becomes embedded in code. And code does this code is a deterministic process. It will do the same thing every time. And there's not going to be the opportunity for discretion. The system then, if it decides to prosecute, hopefully will notify the person that they've been prosecuted. Again, one of the things we're looking for if some sort of system is implemented, is transparency and notification so that you're not automatically punished without even knowing what you did wrong. Then if the suspect is notified, that suspect then has the choice to contest it or not. And then in the judicial process, if they contest, then they can either be acquitted or not. So this whole system sets up a feedback loop. And in a normal life situation that we have now, that's a fairly slow loop. And there's time for reflection, there's time for consideration of all the facts. In an automated system, we fear that that loop gets so fast that the person is punished before they even realize what's been done to them. There's lots of opportunities for automating the punishment side of things. The top row, and again, this is a small slide, but it's in your city. The top row shows things that are currently in place. The bottom row shows technologies that could be in place in a couple of years. The middle row shows what could be done now with technology if there was a will. And the range of punishments run the gamut from just notice to execution. And we'll go through a couple examples. So in Virginia and in many other places, there are websites that show you where cameras and systems are in place. There are also places that will send you notice or emails of warning systems that are implemented. And then I think we've all been driving and seeing one of these radar systems. And you can, it's an automatic feedback system, you can see how fast the police think you're going, you can see what the speed limit is, and then you can make a decision. Now, I'll grant theft auto, I don't recommend trying to make that delta as large as possible. If you hit 99 extra points. If any of you saw Bruce Schneier's talk yesterday at Black Hat, he talked about one of the one of the mechanisms that help a law abiding society stay functional is that people are concerned about their reputations. And we all want to protect our good reputations. And what some law enforcement agencies are starting to do is put on websites pictures of people who have committed a variety of different crimes. And you can imagine how easy it is to just take a police blotter and and write some some very simple scripts that put all that information up on a website daily. In a more detrimental way, there are automatic systems for providing citations, points, fines. I know lots of people who've gotten automatic tickets based on red light cameras or speed traps or things like that. And then finally, or next to finally, there are systems that could could arrest people. The bait cars are one example, or robotic systems with a variety of mechanisms on them. We can automate the prosecution process as well. Here's an example of some source code from a open source camera security project that can, again, it's just it's code that makes a decision as to whether or not a crime's been committed. We have systems in place already for confinement. There's a whole variety of GPS tracking devices. Greg showed a couple examples, your your cell phones or GPS tracking devices as well. And there's a business model for for outsourcing this type of enforcement of certain types of punishments. You know, for those of you who are interested, the website says GPS is now available for only $3 per day. So run out and get yours. Track your family members for only $3 a day. Yeah, well, you know, I can think of my children to be a good use for this too. And then finally, you know, the ultimate punishment is death. And there are already examples of automated systems that have lethal weapons attached. The ones that we know about right now, by and large, have humans in the loop. And that's, you know, but but that technology doesn't necessarily require humans in the loop. All right. So clearly there are advantages to this and that but there are certainly disadvantages as well. And and it really depends on your perspective. Are you the subject? Are you the law enforcement agency? Are you the judicial system? So we're going to roll through some examples. Some would argue that these systems provide a more secure society and a safer society. They clearly have the potential or in theory to offer increased efficiency. And for some they'll be financial incentives. And really what underlies this, I believe is incentives, who's motivated to employ these systems. They have the potential to reduce bias. And depending on where you're coming from, that may be a good thing. For example, you may there's some great research, literally called driving while black that shows of bias of police officers. There's also stop and frisk activities in certain parts of the country. There's a ongoing debate between crack and cocaine as in the the punishments associated with possessions of each, which are really very similar substances. There can be protection from abuse. Or these systems can be abused. So depends on your perspective. So clearly if you go back and look at the history of various countries around the world, none are without their blemishes. And certainly there are false positives. If any of you have seen ED 209 from from the movies where in Robocop, they're demonstrating the robot, point your gun at the ED 209 and put down your in the response, please put down your weapon. He puts down the weapon. The robot responds, you have 15 seconds to put down your weapon. And after time runs out, I'm now authorized to use physical force. Things don't end so well. And there are also false negatives. And this is a classic example from Google Street View. Now this individual could be doing exercise or have lost his keys. But these systems could see, could, a crime could be occurring and could miss it. We argue that's probably better than a false positive in most cases. A key component is the identification of the people in the pictures. Well, historically we have had issues with the improper identification or incorrect identification. Classic example is Senator Ted Kennedy appearing on it, getting held up at the airport for being on a terrorist watch list. The results of this could be a less compliant populace because we as citizens have to agree. It's a contract. We have to agree to support the law, to believe in the law on some level. And if you take that decision making out of people's hands, there can be problems. And there's always the risk of un-proportional response. That the system will respond in a way that's inappropriate. And this is a Texas speed trap motivational poster. A chain gun. And clearly this has the ability to enforce social control on a large scale. Particularly as we move forward. And really depends on whether your local politicians want you to have 32-ounce sodas or not. Or a variety of other activities that can enforce it with automated means. Some won't like the loss of power. Yes, and that's Batman. And it turns out Batman was pulled over for incorrect plates but he was actually going to a children's hospital. His plates were expired so they let him go. But it was a good picture so I thought I'd include it. But law enforcement and others and I would assume some in power like the professional courtesy perhaps that the current law enforcement system provides to them. Well they might not enjoy that loss of power if you have an unbiased automated law enforcement system. And there's a nice example of Montgomery County Police Department in Maryland photographed speeding past the camera with their extended middle finger. The unions and other police related organizations will certainly have something to say because efficiency could very well mean lost jobs. So there are there are many questions necessary to move forward. You know as we move forward in this area I'll be followed by Woody. So what can we do? Chances are that we're not going to see full automation overnight. It's going to happen piece by piece. It's going to automate a little bit on surveillance side and maybe a little bit on the decision decision-making side. And we think that the appropriate response is to start asking questions now. To start demanding answers and that we if a system is going to be implemented it be implemented responsibly. And there are some things that need to be attended to if that's going to happen. So for example the method of implementation. Are they going to use the sensors that we're carrying around in our bodies or are they going to mandate that everyone install a government brand sensor. Control. Who gets control over the enforcement system. Is it going to be low level administrators. Is it going to be third parties. That's perhaps software vendors that create the code. And if so what kind of influence are they going to have over the decision-making process because ultimately if they're the ones writing the code they are the final stop and they're interpreting law. And there are some potential problems with that. Legal integration of algorithms. Are we going to reach a point where there is going to be incredible incentive to personalize the law. So for example if I'm a very good driver I can perhaps drive 10 miles an hour over the speed limit because I've been proven to be trustworthy whereas someone who has a horrible driving record perhaps only gets about five miles an hour. And they're able to integrate all kinds of algorithms that would be able to determine that.  Now that may seem like a simple question but I think that the political pressure could be great when these systems are already implemented and entrenched for someone to say well if you can stop the crime. If you can stop the violation of the law why wouldn't you stop the violation of the law. But I think that there are significant problems with preemptive enforcement of the law. System error and malfunction. How much error are we willing to tolerate in a system. So because of course no system is without error we've got to make the decision well if it's only got a five percent error rate then that's good. Or ten percent or fifteen percent and we need to determine who makes that call. And some of the big questions and I think the one that goes to the heart of our talk today is whether we want perfect enforcement of the law. And I would like to go ahead and say now that we need to dispel this notion that the goals of law should be to achieve perfect enforcement. I think that to be effective laws need only be enforced to the extent that violations are kept to a socially acceptable level. We don't enforce jaywalking one hundred percent. We maybe enforce it point one percent of the time and we're okay with that. You know we know that it's a rule and as long as everyone more or less keeps it together we're fine with that. And so the goal shouldn't be perfect enforcement and that's one thing that we'd like to to make clear in this talk. Besides another question about perfect enforcement is many times for example particularly with minor violations we might violate the law seven to ten different times. So for example if you're speeding and the speed limit is 55 you may go 57 and then drop back down to 53 and then go 60 all on the same trip. And so if you violate the speeding limit 17 different times in one trip do you get 17 tickets or do you get one ticket and these are difficult decisions that have to be made particularly if the goal is to perfectly enforce the law. Woody I'd add that we sometimes I mean it's just we will violate the law we could try scrupulously to not violate the law but it's certainly just a function of minutes perhaps an hour you'll make you'll make it in fact you'll do something wrong. Absolutely yeah I mean we're all violators. Yeah but I mean even with the best intentions. Absolutely. Another problem that comes with automated enforcement is the loss of human discretion. So while Greg talked about the fact that discretion can be bad because it can lead to unjust results discretion can be also very good. It allows us to be compassionate it allows us to follow the spirit of the law instead of the letter of the law and then allows law enforcement officers to prioritize enforcement. So I'm not going to investigate the case of the law sneakers real hard because we've got some murder over here and so we prioritize where we want to spend all of our energies and when you take discretion out of it I think that there's some significant problems. It also leads to the phenomenon known as automation bias so there's a fair amount of research out there that shows that we as humans as a group tend to irrationally trust judgments made by computers even when we have reasons to potentially doubt that. You know the idea is well that doesn't look like the guy but the computer says that's the guy so that's probably the guy and there's a fair amount of that in the literature and if you're going to automate a system you've got to find a way to combat automation bias. It's one thing to exercise your opinion and your right to freedom of expression and it's another thing to do it when there's a government camera right in your face and with the ubiquity of censors and surveillance around I fear that there will be some serious chilling effects to the freedom of expression in the United States and that's precisely what the First Amendment was created against and I think that any automated system should take measures to make sure that there are no undue chilling effects on speech and our First Amendment rights. Also imagine if let's say the use of speeding violations increases seven hundred percent when you automate the system we all decided to appeal simultaneously. We would crash the system. You have to make sure before you implement any system that there's a mechanism that the infrastructure can handle both the burden of the initial violations being issued and the appeals process that comes after it. And finally there's the issue of societal harm automating a law enforcement system to achieve perfect enforcement says two things but it says one thing in particular we don't trust you we don't trust you to do what's right and we're going to go ahead and force the law automatically particularly when you engage in preemptive enforcement and so that risks eroding the necessary trust between the citizens and the governments that's critical for any kind of effective governance. Also there are some moral implications of doing our best to make sure that nobody can violate any crime with preemptive enforcement and so what does it say about a society that takes away all accountability for violations like don't worry you can do anything you want because if it was bad for you we wouldn't let you do it in the first place. And so I think that that's those are the significant questions that have to be answered in any in any automated law enforcement scheme so what can we do about it well first of all we can ensure that their procedural safeguards we can ensure that the basic fundamental due process rights are respected the rights to notice and a hearing so we need to know when we have violated law and we need to have an opportunity to be heard. Privacy rights we need a better fourth amendment jurisprudence we need to solve the problem of privacy in public which I think that we're headed towards a conflict over that sooner rather than later we need better electronic surveillance laws the necessity defense all of us probably understand that if you are headed to the emergency room you probably it's okay to speak it's fine that if you need to go 75 miles 80 miles an hour to get to the emergency room that will let you pass on this one there are many instances that you can imagine where we need to go ahead and violate the law because the costs of not violating the law are greater. Transparency who sees the source code is it going to be a trade secret or do we all get to see it and we can look to a lot of the e-voting disputes to learn from this but I think that open source and transparency in the code is absolutely critical in any automated law enforcement system. So what can we do about this? Obviously there are there are counter measures that are available for all different kinds of problems. We gave Greg and I gave a talk at the Hope 9 conference last month or actually earlier this month about a taxonomy of countermeasure approaches and you know in this community we love to defeat the device. We are all about reverse engineering the firmware and repurposing devices for our own needs and and that's great and that's absolutely a way of providing countermeasures or man in the middle attacks on the network or defeat the processing. How securely is that database recording all our data and can we can we tamper with it and make it make it look different for us and those are those are fun and those are exciting engineering challenges but even more important we we assert is the the countermeasures or or the influence on the actors the decision makers the people who decide to build these systems to replace these systems and potentially to regulate these systems because if we can prevent a bad system from being in place in the first place prevention you know an ounce of prevention is worth a pound of cure and and that takes us out of our comfort zone because those are dealing with real people not with inanimate objects but that's a vital task to engage the media to engage policymakers to engage law enforcement officials to engage the people who design and build and test these systems because once the system's in place the local you know economy the local leaders are becoming addicted particularly if it's profitable addicted to the to the the financial you know resources that it brings in and getting it dislodged is going to be far far more difficult yeah better to prevent it than to try and remove it after the fact and then also you have to worry about competing sensors when you have these these different sensor mechanisms how are they how are they calibrated how are they how often are they maintained how how regularly are they maintained because if you have different sensors that that detect different things about your activities which one is right and then we have to look at really how are these laws written and how would they be algorithmically implemented this is a graph of data that I took from my 2006 Prius showing vehicle speed over a period of about five minutes in this test I set my cruise control to 42 miles an hour which is the pink line going straight across the graph and at the very beginning I was going a little bit downhill and you could see the speed rise and then I went a little bit uphill and the speed dropped below 42 and then I was on some relatively flat terrain and yet the speed is still bouncing back and forth why is that well speed isn't is inherently an analog quantity it has an infinite variability but the computers on board our cars are digital systems so they're doing analog to digital conversion and inherently there's some quantization error involved and it turns out that the computer system on board my Prius has a quantization window of about 0.6 miles an hour so it turns out that that computer will never read exactly 42 miles an hour it's going to read 41.6 42.2 42.8 and so forth even though the number that it actually spits out is four decimal places behind you know four digits behind the decimal place so it'd be like 41.6374 miles an hour and so you think it's really really accurate but it's not and so if you just look at this little graph if the speed limit was exactly what that red line was there's about 17 times within three minutes that I violated the speed limit even though my cruise control was set at the speed limit so would I get 17 speeding tickets I hope not but the law has to take that into account if if any one of us was tasked with writing code to enforce the speed limit law how would you do it and you know would you have this kind of level crossing scheme where every time you cross the speed limit on an upward trend you counted that as a violation or would you have some kind of sliding window scheme that said only if the level was crossed for 500 milliseconds or 300 milliseconds would you count that as a violation if there's three violations within a certain period of time you know does that count or is that three or is that one so there's lots of the levels in the details and I should add that that there's no current infrastructure in place in the law to respond to that because of course these laws were not written with algorithmic precision in mind and so for example take trespassing so it's it's a violation of the law to trespass but if you were tasked with making sure that for example if a GPS device could it could probably tell whether you're on someone else's property or not how long do you have to be on the property before it's a trespass is it a few seconds what if you're walking down the boundary and one foot touches over and how far deep into the property do you have to be before it's a trespass and there are all of these little decisions that we make as judgment calls all the time using discretion in deciding whether to force the law that then have to be encoded and if you make an error then all of a sudden you've systematized the error of the law so that opens up a wide range of research topics this is an unsolved problem and we're trying to prevent problems so the community really has to engage in critical analysis of what are the metrics to decide risk versus benefit at what point is it worth implementing an automated system you know how much benefit do you have to derive versus what kind of cost and then these systems need to be designed for transparency they need to be designed for accountability we submit that they should have manual overrides in them if a car is going to prevent me from violating the speed limit well in theory that sounds like a great thing but what if i am running to the emergency room i'd like to be able to get there quickly or how many of you saw the video footage from the japanese earthquake when there was this huge tsunami wave and there was this little car running down the writing down the the road trying to outrun the tsunami wave you know if my car couldn't go past like the 30 miles an hour on that road ooh that wouldn't be good so we want to have manual overrides and and we want to build in the security systems now you all are going to find the flaws and hopefully you'll tell us and hopefully you know we'll be able to do something about it but we want to be able to build in some minimal level of security um and the thing is this isn't going to happen overnight this is this sort of problem is is similar to environmental problems you know a little bit of pollution here and there and there and then suddenly you wake up one morning and your river is on fire uh you know it's the same kind of thing here you set you get a little a little sensor here a speed speed camera there um you know a new computer system in the police department and then the next thing you know um we're living in a police state so you'll be careful be careful what you build and um you know in summary these systems can be implemented there's there's sensor technology out there right now that that have the potential to automate a lot of the law enforcement process and if it's not done well we could have some really serious unintended consequences and you all in the audience are in a unique position to help avert these these catastrophes if you're interested and and the pdf on the slides has has these has all the uh references um we've done a a talk at hope on on countermeasures and we've also written a paper for the we-robot conference that talks about some of this in more detail and we'd really like to thank uh John Nelson and Dom Larkin who are two colleagues that collaborated with us on the we-robot project who weren't able to to be here with us today um so as we said if you've got questions uh we'll be in q and a room number one thank you very much


In New Zealand we used to be one of the most equal societies in the world, in fact perhaps the most equal amongst the rich countries, but right now or in the last few years we're about tenth from the bottom of the 34 OECD countries. We're in the top half of inequality. We actually had the biggest increase in inequality from the 1980s and through the 1990s of any of the 34 rich countries. The wealth gap has probably stabilised a bit. The global financial crisis actually generated a bit of a dip in the pockets of the wealthy, the rontiers, but the income distribution hasn't shown any signs of returning to greater equality. So it's sort of up there, unequal, probably fairly stable. The causes and reasons for increased inequality are obviously very interesting and reasonably complex, part because they differ between countries. The big increases in inequality were mainly in the Anglo countries, the UK, the US, New Zealand, Canada and Australia. And if you want to sort of say where did it actually happen the most, I mean inequality could increase because the poorer are getting poorer, or because the rich are getting richer, or both. It's actually been both. At one end of the distribution the very well off people, the top 1% of the population in terms of income have seen their shares at least double in those countries in the last 20 years or so, the last 25 years. And at the other end there's been at best a stagnation of the incomes for the lower 25% or so. In terms of where did it happen, it happened at both ends of the income distribution. The middle classes have sort of hung in there a bit, they haven't gained much grant or lost much grant. I think the reason that the top 1% share has exploded more than double, especially in the US and the UK, is two things going to that. One of which we've got in New Zealand and one of which we haven't. The thing we have got in New Zealand is that top pay in big businesses and in government has gone up a lot. CEO pay has increased enormously. In the United States of America the chief executive officers of the big corporations 30 years ago earned about 30 times the wage of a shop floor worker in their firm. Now it's more like 300 times or 400 times. So that's a huge increase and they've of course bought up the salaries of all their executive vice presidents with that. They could ask why that happened as well. We've had that in New Zealand, in government, in public sector and private sector. Perhaps not quite so much, but we've had it. What we haven't had in New Zealand, and that's the other sort of third or so of the increase in US and UK top pay, is the finance sector, or what's called the other finance sector. The people who got us into such a mess in the global financial crisis, that's just a playground for top salaries and not just for managers, but for traders and professionals as well. New Zealand, we don't have much of an other finance sector. So perhaps one of the reasons that our top 1% share is about 9% now, whereas it's 23% in the United States and I think about 18% in the UK, is that they have a Wall Street and a City of London and we don't. Why should we be concerned about this increase in inequality in our countries? Some people aren't, some people are celebrating it. Some people, and that really goes back to how it happened, it really started to happen, especially in New Zealand, UK and the US, with the sort of neoliberal, as we now call it, revolution or counter-revolution against the welfare state, which had sort of ruled the social democracy, welfare state-types politics had been the story of the first quarter century after the war, and that was a period of decreasing inequality, high economic growth, but actually the fruits of economic growth being more than equally shared, if you like, in that sense. And some people got a bit tired of this and said, well, the unions are getting too powerful, income taxes are too high, the incentives for the entrepreneurial classes are sort of being diluted. We need to stop this and with Thatcher and Britain and Reagan in the United States and Roger Douglas and then Ruth Richardson in New Zealand, they did stop it. They cut income tax rates a lot. They weakened labour market institutions, especially the union movement. They deregulated and liberalised and privatised and the desired effect of that was achieved, that the income distribution widened. So it happened, it was meant to happen in the countries where it did happen, I think, but was it a good thing or has it gone too far? Well, some people will say it wasn't a good thing in the first place, that the old welfare state wasn't broken, didn't need to be fixed. Others would say, well, perhaps it had gone a bit far, the welfare state, social democracy, but maybe we've gone too far in the other direction now and what we're facing now is the situation where possibly inequality is getting to the point where social cohesion is threatened and even, if you like, right-wing commentators and business people like Warren Buffett and many others are getting worried about that. Is it outcomes or processes that really matter about inequality? Does it matter if outcomes are unequal, if everyone's got a reasonably fair chance of getting the good outcome, you know, of upward social mobility if they start from a poor family and are doing well for themselves? Is it a bad thing to have wide divisions if everyone's got a fair chance of getting them, like lotto? You can't get anything fairer than lotto, you can't get anything less involving skill than lotto, it's pure luck. People win $23 million, as someone did last year, I think, and nobody makes a fuss, nobody says this is outrageous, they should have it taken away from, they go off and buy a lotto ticket. So it's sort of at least best ambivalent attitude towards high incomes if the process is seen to be fair. A lot of New Zealanders don't seem to be too worried about the process. Half of New Zealanders in a fairly recent poll international comparison said when asked should government in your country in New Zealand be doing more to reduce inequality, disagree. And that actually put us right at the extreme, even more so more than the United States. So it seems that a lot of New Zealanders, perhaps half of us, aren't too fussed about it at all. I would say that most people would agree, whatever their politics, that equality of opportunity is really quite important. Horizontal equity, if you like. You don't want a kid or a young person having worse prospects in life because their family background was unlucky, unfavourable, poor. So I think most of us would think that poverty is a problem if it exists, and it does exist in New Zealand. Low incomes, poor households, bad conditions for bringing up kids and stuff like that. But where the differences would come, I think, would probably be in, well, if you give people a fair go, as far as you need to go, and it's up to them after that, or do we have to look at the outcomes as well and be a bit worried that the outcomes have become too unequal. People are worrying that this level of inequality, even if it doesn't increase any more, is not sustainable socially in the long run. They point to signs of lack or disintegrating cohesion in social life, a sense that New Zealanders aren't all in it together anymore as we used to be when my generation grew up, and worries that, although this might be OK at the moment or not causing great problems, that in the long run it really could have serious consequences for our society and our economy. If you try to look for signs of what inequality does, the most interesting one that I know of is that it correlates quite strongly with decrease in trust across countries. The countries which are the most unequal and have seen the biggest increases in inequality are less likely. People in those countries are less likely to trust strangers, which is what trust is all about. That could be a red flag marking a loss of social cohesion, and that could have very serious long run consequences.


Now all the reversing entries are going to be as of 303123, the first day of the next following period. And now note that you might say, Hey, I'm just going to, I'm going to reverse it and put the debit on top and the credit on the bottom. But usually when I'm doing a reversing entry, I like to have the accounts the same from top to bottom. There's only two accounts right here. So it should be easy to see either way. But just as a general rule, I'm going to say, this is a reversing entry. I'm just going to mirror the order of the accounts, accounts receivable on top, but make it a credit of 450. That to me is easier to compare to the adjusting entry, easier to build, easier to enter. Some people get upset if you don't have the debits on top. But I just think that's an easier way to go. So that's, that's what I typically would do. And when you have longer complex entries, like we had with the invoice, then it's a lot easier to do, I think. So this is going to be a reversing entry. The name, I have to put something here. I'm not going to put the name of the actual customers involved, but ZZZ. So it'll be out of the way, not mess up the accounting department on the day to day. And then here, I'm going to put unearned revenue on earned revenue liability account. And there it is. No need for a name on that one. And so let's do it. This is going to, as of the first day after the cutoff date, reverse it. So it's going to decrease accounts receivable, putting it to that ZZZ customer in the sub ledger, and unearned revenue back down to zero. So we're back to where the bookkeeper was before. So we don't mess them up, save it and close it.


Okay guys, so here we go again about 12 hours after the episode with the echo box or echo doc whatever so Okay, so I'm in the bedroom. Hey, this is the living room. I'm in the bedroom. I Hear loud crash and I come running out Coming to garage Nothing's misplaced in the garage So let's start going over footage. Of course that Mike there picked it up Didn't find anything The dishes over there are stacked nice and neat Nothing fell down anywhere Until I decided to go to the bathroom shower curtain fell down I Know it happens right but I Have a shower curtain review to do tomorrow So here's the clip. No, I got to stop it right after the sound because I came running out very fast You know, I didn't know somebody's breaking in or what and I didn't have anything on so I knew you guys don't want to see that but Yeah About 12 hours. Well about about 13 hours after the Alexa incident but That's our curtains never fell down before All right guys, so, you know Strange stuff is going on The monkey knives talked about this before and it always seems like When our mom's not here Where did things happen? Anyway, there's we got the lights That used to be outside Until the one we had in here last year went bad and then I Took them from that one from the outside brought in here pretty cool But hey guys, so there you go. I don't know Monkey's like I'm supposed it in here I said me too because it's very loud because we got some totes stacked in the garage over there you know for That Hold all our Christmas decorations and stuff and it sounded something like that. It was very loud I'll play it for you. Anyway guys. Thanks for watching.  Take care


Health officials urge heightened awareness as eight more cases of coronavirus infection are confirmed over the weekend. On Saturday, October 31, two cases were registered from the castries and grozely districts. And Sunday, November 1, the six other cases were registered coming from the Babano, castries and Vuhor districts. This brings the total number of cases diagnosed in country to 84. At least five of the new patients were identified through the contact tracing process, linked to previous cases. All eight patients have been transferred into care at the Respiratory Hospital. In a statement, Sunday, Chief Medical Officer Dr. Sharon Belmont-George asked the public to be conscious of the COVID-19 situation and the stricter national protocols that took effect on Friday 30th October. Let's all be guided by the new advisories that were issued by the government of St. Lucia last week. We ask all who will be within their work environments, commuting via public transportation, going into public places to transact business, or going through their routine daily activities to be on a higher level of awareness. Ensure that in undertaking all of your activities that you remain aware of the need to act in ways that will reduce the risk of being exposed to the COVID-19 virus. Government implemented new measures to reduce the movement of people as much as possible for the month of November. These include all business operations and commercial activity on island must cease by 9pm, exemptions are listed, employers are being called to institute work-from-home programs, mass crowd events are reduced from 50 to 25 individuals per event, religious institutions to be guided by the square footage of their worship facilities, closure of school compounds extended to the entire month of November, and sale of alcohol is permissible, but bars must operate by grab-and-go policy to limit high-risk social gatherings. These advisories have been introduced to secure the health of our nation. With every challenge comes opportunity. The Ministry of Health therefore encourages everyone to utilize these 30 days to improve how we regulate our movements and behaviors to reduce the risk of exposure. These 30 days provide us with adequate time to form new lifestyle habits.


Everybody forced here ripping a 21-22 revolution basketball hobby eight bucks case number 45 random team style You can always find these results at late in sports cards calm. Thank you for joining everybody and good luck Yeah, that's that's a good start Mike, that's a good start Weird that you have to say that but Let's go floor to state Yeah, I mean that's all we have that's all we have the overhead cam.  What do you guys think case it galactic? Who's it gonna be? I?  I was here till like 330 as a last box. It was a step curry galactic Very last box. You're right. They're so late. I've been live for like 12 hours, man. I was falling apart Okay, Astro for this first Joe wise camp non-numbered in a gruba Groove towns for the T wolves Vortex Scottie Barnes Raptors That's a good you got a fractal vortex the mellow ball for the Hornets Zantad Astro Malcolm Brogdon for the Pacers It's a shockwave Damian Lillard Galactic vortex is Damian Lillard Galactic in the first box. How about it Congrats? Blazers Galactic case hit Damian Lillard First few packs of the break Congrats Blazers. We'll get that mag for you a book night rookie Revolution's awesome, man Love revolution one of my favorites That is a cosmic for the Grizzlies. It's Desmond Bain 78 of 99 of the cosmic lift off John Collins die cut for Atlanta In this I don't think so Groove Busevich for the bulls Jalen Green rookie base Rockets It's been scheduled Blake. It only filled up a private hour ago. It's been listed for a few days Astro for the Clippers Paul George for Tex Luca Justin s nice one Justin Justin s with the Blazers with the name Astro Van Vleet Raptors non-numbered liftoff Jalen Johnson Hawks who rookie Pacers Chris Duarte Sharif Cooper Hawks rookie Otto Jalen Johnson non-numbered for the Hawks. There you go a Impact gruba. Yep. It was one gruba 73 of 149 Rockets rookie impact Yeah, I love revolution quite a bit for a cheaper product. It's definitely one of my favorites I just like to look but I get it's not for everybody. I totally get that Groove Pelican CJ McCullum. I said Reeves rookie Lakers They're all about the like will be like And I'll respect you as long as I hurt nobody else Chris Paul Astro for the Suns Kate Cunningham for Tex Pistons Yeah, seriously juice rookie Astro for the Pacers Isaiah Jackson bones Highland rookie for the nose Yeah, it can be tough and there's not guaranteed auto and hobby boxes, but Still looks good Fractal calves Darius Garland Shockwave Franz Wagner magic rookie supernova fractal supernova for the Nets Kevin Durant Charles Bassie Think that's why I like it so much Kenneth is because it's not just a different color. There's a cool looking cards I'm not sure when we're doing another revolution, but I would just check the site periodically Break revolution every now and then for sure I don't have we have few more cases in the back to Astro for the heat bam out of bio And sometimes you do Chinese New Year team all revolution as well shockwave Kauai Leonard Another groove Duarte for the Pacers Herbert Jones I've come already. I feel like I didn't watch any of that game Guess I was trying to sell spots. Oh nice rookie cubic for the pelicans train Murphy the third love the cubics It's like a mosaic essentially 25 a 75 James Harden, let me check the price of the break in a second group for the bulls Nicola Husevich Say your Williams The case here was a Damian Lillard actually with a galactic Lillard in the first box Astro John Marant Grizzlies, I think it's like an actual case it to there's a LeBron vortex where like you only get one because it's a case Some products a case hit and it's like yeah none or four or whatever rookie Astro Kai Jones Hornets Who's my Garuba? Hey Mike Congrats, man. The second second kid Rack the rookie magic Jalen Suggs And a second gonna have a September baby. I don't know what that means. I'm not into astrology. I don't know what that means God Fractal, Yana supernova for the Bucks Zia Todd Mike how old your first job? Yeah, guys link is in the bio if you're watching on tiktok interested enjoying the breaks No, you have one more break with spots up tonight. It's almost full. We do personals in group breaks seven days a week We have a baseball channel as well on YouTube When our streams are always founds the full streams on YouTube and Twitch Astro for the Sixers James Harden for Tex Yannis ever babies Groove rookie Grizzlies, San C. Aldama, Dallin O'Banton Congrats Kenneth Congrats Kenneth That's awesome Kenneth cool guy. He's he's he's local. Yeah, got Fractal auto rookie Grizzlies. I hear Williams of the Fractal autos there 18 of 100 nice hit Grizzlies a Cubic Aaron Gordon for the Nuggets 75 50 of 75 jersey number on the Gordon show there for you 75 Nice Cubic double AOG Look at Donch it's shockwave Groove Harrison Barnes Kings Duarte Pacers rookie Hey, what's up spider? Hope you're having a good one too man Thanks for saying. Hey Astro Bobby porters for the bucks. It's Caleb's boy. See Caleb got that black and gold Caleb bought a black and gold to five Bobby porters out of prism Pretty cool PC bucks legend man, rookie Astro Chamber of the Third Pelicans Jackson Groove Anthony Davis Lakers or street clothes Davis is what Chuck calls him supernova Kevin Durant Got Frackle Davion Mitchell Kings vortex Joshua primo in with their Derek Jeter Do you name him Jeter like Jeter downs your name and Derek? Yeah, Jess mine are 25 and 21 happy birthday Mike Astro James Harden sixers vortex Tatum for the Celtics Um So the lower numbered parallels basically is kind of what you're looking for Lava to ten is a good one. Let's say cosmic rookie Isaiah Jackson for the Pacers Cosmics 62 of 99 And a giddy rookie for the Thunder and then the case hit parallel is a galactic which you've already hit But if you stick around for three kept him to see it, but galactic are really sought after They do pretty well a Cubic Darius Garland for the Cavs got a new teammate eight of 75 Good new teammate today Kevin Durant shockwave for the Nets Groove for the Hornets Gordon Hayward Davion Mitchell. Yeah, I heard that I'm good. My brother. My brother is Never done like anything really wrong like like girl bad, but right like oh, why would you you know? Astro John Wall for the Rockets not gonna put them on last year more tags to Steph Curry Warriors and Ricky revolution Kaminga for the Warriors He just likes to learn things that's halfway Astro rookie Grizzly's Zaire Williams Me I feel like it is pretty jobless for my parents, but you know, I was the first child, you know, the first the first one's always the First one's typically the one that listens and follows in directions Fractal Gary Trent Jr. For the Raptors shockwave James Harden Nets. Yeah, like revolution Shockwave fractal Trey Young for Atlanta And a Quentin Grimes three more boxes Three more in the case. Good luck everybody Well, I see a big auto. We only had two auto so far. So we should have a couple more. Usually it's about one every two boxes So we should have two more We've seen some big autos out of revolution as well. We've seen a lot of it's Carter. We've seen Anthony Edwards Shaq Astro Malcolm Brogdon Pacers Yana Shockwave for the Bucks Astro rookie for the Wizards Isaiah Todd got James Book Knight Love city Fractal Clippers Kawhi Leonard Vortex Harden for the Nets Vortex Fractal Franz Wagner Magic rookie Jalen Green rookie base for the Rockets needs some more big rookies in here. Not even like a bunch of base big rookies There's only four rookie base in box Astro Clippers Paul George Rookie Revolution Alperin Shengun Rockets groove rookie for the next Miles McBride Corey Kispert Wizards Isaiah Todd rookie auto here non-numbered and Very nice and it was one Garuba rookie Sunburst. Love the Sunburst 45 of 60 60 Used to be the 50 Jazz down of a Mitchell liftoff 60 on the Sunburst Garuba Groove Tatum for the Celtics got Kate Cunningham rookie for the Pistons First Kate I think in the whole case two more Groove Andrew Wiggins Warriors Jalen Green rookie Rockets Astro Hornets Gordon Hayward Shockwave rookie Magic Franz Wagner Astro DeMar DeRosin for Chicago a Rookie Revolution Josh Giddy for OKC. Oh, I can't speak for anybody else being honest about shipping stuff You just got to be careful next cubic for the D Rose there for 50 on the cubic James Book Knight. Yeah, I don't want to vouch for anybody else. You know just buy from You know, as long as they have a legitimate looking website and you can see them stream a lot and People fill out their breaks and stuff then seem pretty trustworthy Uh jazz impact go bear 82 of 149 former jazz Vortex Kate Cunningham Pistons Rookie Astro for the Magic Jalen Suggs King of the card That'd be a cool title, but I would not claim that title at all Fractal Jason Tatum for the Celtics liftoff Jalen Johnson Hawks Fractal Vortex Donovan Mitchell for the jazz Kate Cunningham rookie Pistons Yeah, don't ship anything to Sam. That's that's the one that's the one key.  Yeah, sketchy Sam is what they call him. Rookie astro Quentin grinds nicks Sketchy steve actually. Yeah Suspicious steve. That's what I call them fractal vortex thunder shy gillage alexander Tram and rookie revolution for okc Yeah, we know we know about whatnot Vortex fractal blazers. Damien Lillard. We'll be on it at some point Well Probably only do singles on it, but I we don't we don't we don't know what all is going to happen with what not yet Astro T wolves anthony edwards Nice edwards there vortex a bonus for the kings Sketch Sam Yeah, he does like sketches a rookie groove sancia al dama grizzlies. I've been mobility rookie base for the cabs Shaq there he is. I told you guys we've seen him two out of 100 fractal auto lakers. Very nice. It's an on-card Shaq Very nice hits la lakers That is a cubic porzingus for the wizards now 74 of 75 shockwave have been bubbly for the calves Big diesel big Aristotle the big big Shaq this big shamrock Superman got a groove Miami heat jimmy butler on the back is a bonus island base rookie. Give me one sec. Everybody will do a quick recap No crazy big parallels outside of the galactic unfortunately had some decent autos There's an okay case not the best Not the worst, but here are Highlights for us. There's that Shaq auto for the lakers the 100 At isaiatah jerky auto wizards not numbered xayer Williams fractal auto 18 of 100 for the grizzlies A jalen johnson the rookie auto for the hawks and galactic Vortex Damian lillard blazers love the galactic Acti case hits that'll do it. Thanks again everybody. We've got obsidian basketball coming up


It takes 10 more minutes if you want to pull weeks if you want. Hi, everyone. So this is Drew. He has been heavily involved in the WordPress community since 2011, contributing to the core documentation and meta-teamed writing plugins, and helping with support. He's been a core developer since 2013 and served as a WordPress documentation lead until 2016. And he's contributed to every WordPress release since V3.3. And Drew works remotely from Arvada, Colorado for a Sandhills development, the parent company for cool plugins like Affiliate WP, easy digital downloads, restrict content pro, sugar calendar, and more. And also the last thing I did forget to tell you guys, no using any type of Wi-Fi on your phones. Use it on your computer. The Wi-Fi has been a little weird, so that's it. Thank you. So yeah, as she said, my name is Drew Janes. For those who weren't familiar with Sandhills development, these are our monsters. For all of our products, each of our products has its own monster. Laptop's freaking out. Nice. Way to start. Please hold. Anybody know where the screen isn't lining up? Did I just try turning it off and turning it back on again? Did it decide to take a little break right now? I can, while we're trying to figure out the screen, I can give you a little overview. Basically, this talk is an overview of modern PHP development. And today, I'm going to be diving a little bit more into why than how. So we're not really going to discuss, I guess, the underlying thinking behind how things work, but we're going to talk a lot about why you should be using them. There's a ton of resources online for how you can go about actually implementing things in modern PHP concepts. But I think one of the biggest things that people don't talk about is why you should be using them. So for pretty much all the concepts I'm going to talk about today, we're going to talk about the basic benefits, why each is worth pursuing. And then for almost all of them, I have sort of pseudo code examples, which are just a good way of illustrating how it works. And then in most cases, I have practical examples showing how you could take legacy code and upgrade it to use modern features, whatever those are. I guess I'll just keep going, even though I don't have slides. So let's talk about what modern PHP development actually means. In WordPress terms, that's pretty much all the features that WordPress isn't using. Because WordPress still requires a minimum version of PHP 5.2. So pretty much all modern features, that is things that were created after PHP 5.2 was end of life eight years ago. Yeah, go ahead. Or what would be considered modern features? Let me switch this. All right. I will try to rattle some off. But modern features would be considered things like namespaces, closures, exception handling, which we'll come back and throw a little asterisk on there, exception handling, type-hinting, traits, generators, all sorts of modern PHP features. In terms of type-hinting and exception handling, those were actually introduced in 5.0. And WordPress still isn't using them. Exception handling is what I would consider to be a modern PHP standard for coding, but not necessarily a modern PHP feature. And the same goes with type-hinting. Type-hinting, which we'll talk more about in a minute, more has to do with avoidable mistakes.  It's OK. I can just do it without it up there, but OK. Well, we're going to do it without slides. This is going to be fun, especially the code parts. Yeah. And by the way, I tried to upload them on the Wi-Fi, and it didn't work. So we'll do it after. Hey. My hero. No, it still isn't. It's up, though. That's a what? OK. So should I wait? Namespaces, auto-loading, closures, type-hints, late static binding. Go ahead. Traits, generators, group aliasing, and my favorite lib-sodium and modern security features. Which, by the way, we're not going to talk about today, because I could probably talk about that stuff for 40 minutes all by itself. It's not flipping over. Next. Sorry, y'all. We had this working earlier, and now it doesn't work. OK. Well, the main gist here is that modern doesn't just mean new, right? So we're talking about exception handling. We're talking about type-hinting, other things that I would think would be considered modern PHP development that aren't new is don't use globals. Use exceptions in logging, type-hinting the right smarter code. And so that leads me to a point that is follow the leader question mark. Typically, in a third-party development ecosystem, the ecosystem tends to follow the platform's lead in terms of coding style and how things are coded. And in WordPress's case, this has actually been detrimental to its development community, because while you are under no obligation to support PHP 5.2, by following WordPress course lead, a lot of plug-in developers and theme developers have not updated their code for modern standards. And so what you get is this huge swath of really, really outdated legacy code and then this sort of small little subset of people who are like, I'm going to buck the system and use modern code. But then WordPress.org doesn't support enforcing the minimum PHP versions until this year, eight years after the version that we currently support is the minimum is end-of-life. So this is not an attack on WordPress core. Obviously, the reason that the minimum has been so low for so long is that we didn't want to leave users behind. But now, this year, they are talking about actually bumping the minimum, bumping the minimum to 5.6 in April and 7.2 in November, which is pretty fast. But the upside of that is that it will allow plug-in and theme developers to update their code with core handling a lot of the messaging for users to say, look, your PHP is out of date. You don't know what PHP is. Here's an example or an explanation of what PHP is. But the main point is that WordPress core has intentionally or unintentionally held back its development community, and I'm here to help. I had this quote that I actually really subscribed to. It's from a French author named Antoine de Saint-Exupéry. He's actually the guy who wrote The Little Prince. And this quote is from a different book called Citadel that was translated into The Wisdom of the Stands. But basically, the quote is, as for the future, your task is not to foresee it, but to enable it. And I sort of view this as if you build it, he will come, kind of quote. Along the lines of, your job is not to guess every imaginable use case for your code, but to enable it by using modern standards. So let's get into some of these concepts. And we're just going to start. Obviously, you can't see it. We're just going to start with refactoring old code. Incorporating more modern PHP is inevitably going to raise concerns with refactoring considerations, too, in terms of what approach you should take. Some people take an all-or-nothing approach. They just refactor. They just rewrite their entire plugin, possibly leaving their users behind in the process. It's happened before. It'll happen again. Of course, there's backward compatibility concerns there. I'm not going to name any names, but there have been some plugins that rewrote and broke a lot of stuff. I think probably one of the more responsible routes to take is gradual iteration, where you're refactoring slowly. In easy digital downloads 3.0, we introduced the concept of partial activation. And that essentially means that if we have any less than stellarly coded add-ons that check for the Edd main class, if Edd is not active, then it's going to fatal these add-ons. So we introduced the concept of partial activation. And that is essentially where we run the main plugin class but don't run the bootstrap. And that allows these add-ons to detect Edd and still work and not fatal. But Edd itself is not active. And so if you want to see how that works, check out the release 3.0 branch on the Edd repo, which I think is still public right. That one is. The main thing with refactoring is that I want to share with you a little bit of a cautionary tale. Navigating new skills takes time. This talk sort of assumes that you have some baseline of knowledge with PHP. And just know that navigating any new skills takes time. It's not going to be instant. So you probably shouldn't jump right in with a production project. Make sure you know what you're doing before you push your code out into the world. Everybody moves at their own pace. So absolutely do dive in headfirst.  See what works, what doesn't work, what breaks compact, what doesn't. But absolutely do not jam up your users in the process. And this is a bit of a recurring theme in this talk. But the thing is, is you have to be very careful about what you introduce or don't introduce. If you're running a private plugin, you're probably doing some level of usage tracking that has information about PHP versions and all those sorts of things. It is possible to get that data from WordPress.org if you ask for it. I think Dion might kill me for saying that. But it is possible to get this data to find out how it breaks down, how your users are using PHP lower versions. You might be able to bump it. You might be surprised. We were looking at the stats for Affiliate WP last night. 30, I think we decided 66% is on 5.6 or higher. It's amazing. Like, I did not expect that. But the main thing with don't jam up your users is obviously create version protected Bootstrap files. That is files that can run in PHP 5.2 and won't break and then run your Bootstrap in a separate file. And that's just, I mean, I think that's just best practice. Don't create a plugin Bootstrap that's going to fatal the site the minute you activate it. The very least, create some kind of partial activation situation. And the number one thing I would say there is graceful fallback. So the rule, not the exception when you're refactoring. So embrace what your users can't support. That's really what it comes down to. That's the cautionary tale. We're going to get into the code that you can't see here in a minute. I'd say everyone should gather around my laptop. I don't think that's reasonable. Namespaces. I don't know if we ever figured out why it's not working. Sure would be nice if it worked, though. Yeah, we got nothing. It's not flipping over, I don't know why. Well, the same problem applies. We could try, actually hold on a second. Please hold. I'm going to see if maybe we can do a. The problem is I don't think it's even connecting. So the problem, of course, is that I can't even mirror my screen because it's not even recognizing the computers there. Problem is, do you have something that's not lightning cable? Old MacBook. It's going to have to be like a mini display or for HDMI. Sorry, y'all. Say that again. No, it's in Keynote. I have it in a PDF, but I still can't connect to the thing, so it doesn't matter. Thank you, sorry. OK, anyway, the slides will be online. We're going to talk about the basic structure of namespaces, but we're not going to be able to show code, so that's OK. That's fine. Who here is familiar with the concept of namespacing, as in 5.3 namespacing? Because even pre-5.3, there was namespacing, but it was not what we know today as namespacing. It was the adding the EDD prefix onto the front of all your functions so that you didn't collide with other code, right? The idea of namespacing in the 5.3 plus world is to create a top-level vendor, essentially, namespace, under which your code lives so that there's no collisions with other people's code. And really, the why of using namespaces? I mean, you can use your old system. You don't have to introduce namespaces. Really, the why of introducing namespaces is actually that your functions can be a little less verbose. And also, this is a big one for me. Also, it teaches you about interoperability with other people's code. Because really, namespace is the biggest benefit, in my opinion, is being able to handle dependencies without collisions. So basically, you would introduce easy digital downloads. Maybe they would choose an EDD top-level namespace. And everything under that would live under that. The other thing with namespacing, and we'll get into auto-loaders in a minute, but the other thing with namespacing is it also introduces, in conjunction with auto-loaders, it introduces some higher level of organization to a project that didn't really exist before. There wasn't really a standard for how to do it. And by the way, there's not really a standard now, either. But the difference is that it's a lot easier for you to organize your code and mimic that with your directory structure. So it's a lot easier to find things based on your directory structures based on your component namespaces. Then it's a lot easier to find the actual files that the code lived in. In the pseudocode slide, I had these ridiculous namespaces. Like, this actually works, but even though it's ridiculous. But in an actual example, it essentially takes legacy code like an easy digital downloads class and converts it to a namespace version, just so you can see how it condenses it down. And like I said, we haven't really gotten into auto-loading. But auto-loading, hey! So just know, by the way, I can't see my notes or anything. So we're going to wing it from the slides. But I don't mind namespaces. Obviously, we just talked about this, but it establishes baseline code ownership. Simple naming, code segregation, and interoperability. All right, so here's the sort of pseudocode example. My verbose plug-in class name, my plug-in class name, my plug-in component class name, my plug-in function name. You get the idea. Jury's still out on whether namespacing functions is a good idea. I love doing it, personally. This totally works even though it's ridiculous. So this is an in-practice example. In this case, we have a class, easy digital donations bootstrap extends give. And then we have a fork method that essentially replaces the word give with easy digital donations. This is a special joke for EdD fans. Give forked EdD, and we would fork give back and create a new plug-in called easy digital donations. But anyway, this is the before. We have a verbose class name that extends give, has a method, and it runs the bootstrap. This is pretty much not unlike quite a few plugins in the repo right now. But this is how we might namespace it. We might namespace it as namespace EdD, class bootstrap, extends give, same method. But when you instantiate, it's new EdD bootstrap. So it's just a lot more compressed, and it's a lot less verbose. So why use namespaces? Obviously, we talked already about naming collisions. How much time do we have, by the way? OK, 22 in. Readability organization we talked about. We'll get into it with auto loaders in a minute. With great aliasing power comes great responsibility. This is pretty verbose, but it gives you the best idea, and we'll show a code example in a minute. But the main thing here is with namespacing comes the ability to alias. So either alias in a localized form or alias in a global form. So in this case, we're aliasing legacy verbose controller class as standardized controller. Class controller extends standardized controller. And then we have the use of class alias, which actually EdD does, to fix a typo in a class name. But in practice, this is how that would look if we didn't do any aliasing. This is literally marrying new code with legacy code. New controller extends legacy verbose controller class, et cetera, et cetera. If we locally alias this, we could use legacy verbose controller class as standard controller. And this is an easy way to make legacy code much more readable if you're extending it in a new way. But the main thing to remember here is that the aliasing is localized to this file only. Whereas this version, using class alias, is actually global. So any file that loads after this class alias call runs can use the class alias. So this is a great way to essentially rename some older legacy classes to bring them into your current style. But if you remember that slide a minute ago with great aliasing power comes great responsibility, don't overuse it and don't abuse it. Don't rely on it. It's a good way to get your development community into the mindset of, this is my new style. But you should have some exit strategy for that, deprecating it, moving the code, all those sorts of things. This is a good sort of middle step approach. So yeah, auto loading, what you need when you need it. The main thing that an auto loader does is remove the need to load your files before you call them. It sounds kind of dumb, but when you have hundreds of classes, I'm pretty sure we've all seen those plugins that have these massive blocks of require statements, requiring all of the things. It typically follows a project organization which we're actually not going to get too far into. And your standard auto loaders would be Composer, PSR0-based, PSR4-based, or rolling your own. The thing with the PSRs is that in most cases, if you're following court courting standards, it's not going to work very well for you. The main thing is that the way auto loaders work is that they convert class names into files, file names. And so that, of course, means that your namespacing has to follow your file structure. And then it basically has to be guessable based on the name of the class. This is a very, very, very, very simple auto loader. It takes a class name, and it looks in a directory called classes for a class with a file with that name, class.php. Like I said, we're not actually going to get too far in auto loaders, because I could talk about auto loaders for quite some time. But here are some resources. And again, these slides will be online after the talk. Tom McFarland's auto loader there on the bottom, simple auto loader for WordPress. My auto loader that's linked right above it is actually a fork of his. And I use it in a couple of my projects now. And the reason it's a fork of his is that I added support for interfaces and traits. So type hinting. Hinting at mistakes before you make them. I love this tweet from Phil Sturge, and this is actually from last week. Types aren't docs. Types aren't tests. Types aren't a Cocker Spaniel. Types aren't a Fine Age cheese. Types are good at letting devs know they're shoving a round peg in a square hole. And that's great. Use them appropriately, but also write tests and write docs. The main thing with type hints is that obviously they help catch avoidable mistakes. And it defines expectations. Prior to 5.1, base support was added for class and interface names and or self. 5.1 added array types. 5.4 added callables. 7 added scaler type support, which was huge. String, bool, int, float. And you're not allowed to use aliases, by the way. 7.1 added iterable, 7.2 added object. So let's look a little bit at what that looks like. Basically, type hinting is very simply in line documenting what type a parameter can accept. In this case, obviously, we're passing collection, collection, array, attributes, et cetera. And we're going to actually talk more about the try-catch later. But in this case, it's setting a type against the exception. And we'll talk briefly about why setting the type there is important. So this is an example, sort of a boiled down example of what's in EDD 3.0 coming soon. We essentially created what's called a marker interface in the EDD exception interface. And the way that works is you create a top level interface that all of your exceptions implement. And so what that means is that when you're anywhere in your code, you can catch all exceptions that implement that marker interface, meaning that all of the EDD interfaces implement the EDD exception interface, and therefore we can catch any EDD exceptions that get thrown. We actually use a different function, but I just wanted it to be clear. So here we're error logging the code plus the message. Maybe something that's a little bit more familiar. Here I've converted two core function signatures to add type inting. And by the way, it was quite difficult to find two core functions that only accept parameters that accept only one type. WP insert posts. We added the array type int in the Boolean WP transition post status. We had the string, string, and WP posts. For method examples, like a class constructor, we added a collection type for a collection parameter. And the last one's kind of a bonus. It's what's called a return type declaration. And that is essentially a case where you're declaring that this is the return type of this method, whatever that is. A bad habit that's sort of festered in the WordPress PHP community for a long time is multiple return types from different methods. If it failed, return false. If it didn't, then return something completely different. Modern best practice would be to try to return the same type from everything. So let's talk a little bit about nice to haves. Avoid running over your users in pursuit of shiny things. This goes back to that argument about what we talked about earlier, some plugins refactoring maybe a little too quickly, breaking back compact, leaving users behind on purpose.  So nice to haves. Closures. I actually consider closures to be a nice to have and not something you should necessarily be using a lot of. Closures are essentially anonymous functions. But obviously, before 5.3, there were the concept of anonymous functions. You could create function. But the main thing is that it's a really simple way to express simple one-time use code is the best way. But the main thing is that you should be careful using closures with hooks. And that is because the closure instance is not globally accessible. Which means if you hook to a WordPress hook with a closure, it is unhookable. Unhookable, I guess is a double negative. If you hook to a WordPress hook with a closure, other people cannot unhook it, unhook your callback, unless you make it globally accessible. So in most cases, I would say don't do that. In very, very limited cases, I would say use a closure in your core plugin to hook something to one of your hooks that you absolutely do not want anyone to unhook. But use it sparingly. This is a common example of having a callable parameter in a function. FeedPet was a callable message. You call FeedPet, you define your closure that echoes my pet has been fed. And then finally, probably one of the most common uses of callables in WordPress, I would say, is in the realm of display callbacks. Obviously, in most cases, you're not using closure, but all the same. So this is an example from Edd 3.0's reports API that's coming pretty soon. The main thing here that's happening is you can define a display callback when you instantiate an endpoint. So in this case, we're defining the display callback for this endpoint on the fly. If you look at line 11 and below, we're defining the display callback as a closure that gets past the endpoint object. And then we're echoing the data or whatever. And then if we call the display method for the endpoint, it performs that display callback. So this is a pretty good example of on the fly. This is another area where closures are actually as callbacks for sorting methods and sanitization things. A lot of times, you'll see something like ArrayMap absent and then an array of IDs. That's basically this. We're just defining a closure to do it on the fly. Same thing with the sorting method. So yeah, closures are handy, but be careful how you use them. Who in here has ever used late static binding in a project? Late static binding is a concept that throws object-oriented programming on its head because it essentially allows the parent class to statically access things and extending subclasses. So probably this is the easiest way to explain this. We have class alpha, class beta, and class beta that extends class alpha. Both define static methods, but in this case, if you were to call new beta get class name, you would get alpha. And that's because on line seven in get class name, we're calling return self get name. Because of inheritance in PHP, self is specifically to the class it's being called in. So in this case, self refers to alpha. So even if you call it from an extending class, it's always going to think self equals alpha. So if you change that keyword from self to static, that essentially allows the parent class to call a subclass method. So if you were to now call beta get class name, you would get beta. So traits, this is honestly one of my favorite things. And I think it's wildly underused. This is a simple concept. Wheel extends wheels. Engine extends engines. This is actually a fairly common problem. In this case, both classes are extending different superclasses. And in this case, they're actually both running code that does the same thing. But because they're not extending the same superclass, you can't abstract that up. So essentially what you end up with is two classes using the same code. Well, see here in red. That's the duplicated code. If we were to create a trait, this is PHP 5.4 plus. If we were to create a trait that holds that code in these other classes, Wheel and Engine, we could just declare that we're using this trait. And that automatically brings that code in. So then the constructors can use this set mechanic from the trait. Obviously, in this case, it's basically the same number of lines of code. But ultimately, it means you could reuse that for any number of components. I'm going to skip the group aliasing thing, even though it's really cool, because I only have a couple minutes. But the main thing I want to talk about is back in Compat to look out for. This is obviously using modern PHP. Call time pass by reference is a big one, because it fadles in 5.4 later. That is essentially passing a parameter by reference when you're using a function. Don't do it, because it'll fade out your stuff. PHP 4-style constructors, I don't know if anyone here's even written PHP 4-style constructors before. But it essentially, in class constructors, the way it works is you had a class named whatever. And then if you had a method with the same name as the class, it would be treated as the constructor. And WordPress Core actually had PHP 4-style constructors for a while. But at a certain point, they were deprecated in 7.0. Static calls and non-static methods were deprecated in 7.0. A closing with a quote, software is a great combination between artistry and engineering from Bill Gates. The only cautionary note that I would put with this quote is, don't forget to be an engineer, even if you're being an artist. Even if you're suddenly exploring and discovering all the new, wonderful features of PHP, don't forget that you're an engineer. And don't forget to be careful what you wish for. Thank you. I think there's only like a minute left. How much time do I have? Two minutes for questions. I will also be here all weekend, and I'll be at the contributor van Sunday. Anybody have any questions? I don't have enough time to get into Composer. He asked about including Composer and preventing collisions with other projects using Composer. I don't think I have enough time to, but we can talk about it after if you want. Anybody else have any questions? That URL that's up there, that'll be good in a minute when I upload them. Yeah. Well, the first one I don't think has a name. The second one, I have no idea because it's for WP SimplePay, which we just recently brought into our portfolio. This is Ed for EddD, does the whatever that is have a name. For Sugar Calendar, Gia. Gia is the whatever that is. And the ELF for Affiliate WP and RACS for RCP. Sure. Gia, I'll have to remember that. Sorry, JTRIB. Anybody else? Thanks for bearing with me on the weird slide problems. Thank you, everybody.