Hello everyone and welcome to my monthly Q&A live from my treadmill to you. It's my third Q&A of the day every month, periscope to a Facebook live. And here's the final one of this evening. This is your last chance to get your questions answered. Of course, you may very well see me live over the next week where I will be in Texas and California and Utah and Illinois and other places, probably just check out my speaking tour list on the website nutritionfacts.org speaking, which for those of you unfamiliar with my work every year, I read through every issue of every English language, nutrition, turn on the world, so busy folks like you don't have to. And then Kapala, the most interesting, most groundbreaking, most practical findings, is an article that I upload every day to my nonprofit site, nutritionfacts.org. Everything on the website is free. There are no ads, no corporate sponsorships, no non-commercial, not selling anything, just put it up as a public service as a labor of love, as a tribute to my grandmother, whose life was saved by the grandfather of someone who's actually answering a question. Hello, Riddie. I hope I pronounced your name. Riddie, maybe. Pritikin, who says that she is Nathan. Pritikin's great-granddaughter. Well, your great-grandfather saved my grandmother. So thank you so much for your whole entire family. I hope your family is still eating healthy. That's a question I have for you. Like, is that, has it suffused the rest of the family and they were all living long, healthy lives? I hope so, certainly. But even if you're eating all sorts of garbage, you've saved so many millions of people that... Anyway, all right. Your question was, what am I going to have for dinner tonight? Well, here on the East Coast, this 8 p.m. already had dinner, did not have a lot of time, just had a little half an hour bit between my periscope thing and this. So what can you make in a half an hour? I just put on some whole grain pasta. In this case, it was whole wheat, like some fettuccine. And then took a can of stewed tomatoes, put it in a blender to blend it up and mix that with a whole hunk and thing of my favorite green arugula. Put that in the microwave to wilt that down. Then, of course, you have to add the fresh arugula at the end to provide the miresonase enzyme to attack those glucose assimilates and make sulfuricane. If you have no idea what I just said, you've got to watch some more nutritionfacts.org videos. Add the can of drained artichokes hearts. Oh, chickpeas. I had some chickpeas in the fridge. Always have a can of fresh chickpeas in the fridge. Or fresh canned beans, period. Doesn't have to be canned in those funky new aseptic tetrapac packages. And then, oh, you know, pepper, oregano, I don't know, hot sauce, of course. And ate real quick. And then here I am, and hopefully don't have a ruble in my teeth. Although if I did, it would be proof that I'm not a poser that I actually do try to eat healthy. When I'm home and have control of my diet, unfortunately, that will not be the case, starting tomorrow for the next 10 days on the road. But I will do my best. All right, the next question.  AGEs are advanced glycation end products or advanced glycosylation end products, so-called glycotoxins. Now, I wouldn't expect much in soy unless you're like barbecuing some temper or something. But nuts, when you roast nuts, roast or toast nuts, when you expose high protein, high fat foods to high temperatures. So I guess soy nuts would both fit the bill. So high dry heat temperatures. You're not talking about boiling, steaming microwave.  I said, frying, baking even. So most, of course, those high fat, high protein foods that have all these AGEs, which are bad news, I go to the list in How Not To Dive, the new book, all proceeds go to charity.   So it's one of the changes I've made in my down diet is I no longer toast my nuts as much as I love the taste of toasted nuts and seeds. I don't do it because the AGEs are anyway to not produce it. Yes, low, you could cook it less. And so you could lightly toast instead of heavily toast or just not toasted all and eat your nuts raw. Okay, Brittany Flower Day, what a great last name, has a congenital heart condition. Would it be safe to stop the medication? So, presumably, we're talking about kumadin, it's a number of congenital heart, like valvular heart defects, which can create some turbulence that can increase one's risk for clotting. So some people are put on lifelong clotting medications, like kumadin. In fact, healthy diet may actually undermine the benefits of kumadin, because kumadin is basically a vitamin K poison, it blocks the body's ability to regenerate vitamin K.  And so you have to basically titrate, your doctor has to titrate your levels of vitamin K to kumadin and then eat about the same amount of greens day to day. And so you don't undermine the effectiveness of the drug. You can certainly go and bring your medical records for a second opinion, but I presume you will be on that for the rest of your life. But yes, congenital, the only way to reverse congenital heart defects is through surgery. However, most people have non-congenital heart defects, have atherosclerotic heart disease, and that can be reversed without drugs, without surgery, just a healthy diet. Another lifestyle changes, which we learned from the great grandfather of one of the questioners on our chat today. Okay, after Brittany, oh wow, I just jumped a whole bunch.  Should I do the latest first? Well, I feel bad for all the people that put their questions up a while ago. So, wow, there's so many. All right, sorry. All right, I'm just going to run to the end, because it'll take me too long to find each question, because it scrolls me down to the end and I have to find my way back. So, I am looking at the latest, which is from J. Mary, whoa, J. Mary last night is honed canned food better. Home canned food, well, when most people can, they're not actually canning, they're doing it in jars, right, in glass jars, and that's better, because then you don't have to worry about BPA, which is a plastic lining chemical, which is an endocrine disruptor. It's a synthetic estrogen and tied to all sorts of nasty stuff. Just had a bunch of videos about that, but if your tomatoes are in jars, then you don't have to worry about it. Just be careful, home canning to make sure that you're dealing with sterility, because you could accidentally have some botulinum, clostridium botulinum, which is a bacteria that basically is just all around. It's sporyland form for millions of years, literally, this little spore sent around for millions of years and waited, just waiting to get into your canned tomatoes. Improperly heated canned tomatoes, where all of a sudden there's no oxygen and then it can wake up after millions of years and produce a toxin that can kill you. The same thing that they inject people with Botox, but it's high levels and it's not that you don't get wrinkles, it's you stop breathing. So be very careful if you can your own foods to know what you're doing and not just do it willy-nilly, because you can see if a can has, you can tell if a can has been infected with the botulinum because it bulges out because of the gas created, but in a jar you may not be able to see that bulging. Anyway, don't just be careful. Okay. Oh my God, the questions are going back so quickly. Daniel Zamudio asks organic or conventional which do I prefer, presumably you're talking about fruits and vegetables, and I talk about a study in the book published in Food and Chemical Toxicology was kind of a modeling study that suggests that if just half of Americans ate a single serving of fruits or vegetables more every day, every year we would prevent 20,000 cancer deaths. Not just cancer cases, 20,000 cancer deaths every year.  However, because of the extra pesticide burden of those extra fruits and vegetables, because we're talking about conventional fruits and vegetables, pesticide laden fruits and vegetables, that extra pesticide exposure would cause an estimated 10 extra cancer deaths. So every year we would just prevent 19,990 cancer deaths. Now, for those of you thinking, wait a second, so there's tremendous benefit, a tiny bump in risk. Now, for those of you thinking, wait a second, why not get all benefit and no risk by choosing organic? Great. I certainly try to buy organic myself, but we should never let concern about pesticides from keeping us from stuffing our face with as many fruits and vegetables as possible. Even the most pesticide contaminated foods like strawberries and Chilean imported grapes and on down the list, it would still be better for our health if we ate them than if we didn't. There are ways you can reduce pesticide burden of conventional fruits and vegetables, rinsing under running water. There's a DIY do-it-yourself solution that I came up with. You can just put, just fruit and vegetable rinse into NutritionFacts.org and learn how you can get additional pesticides off, though you can always just choose organic or choose not to worry about it, though you should still always rinse fruits and vegetables under running water, but that's from primarily microbial risks. Who knows what body orifice the person handling your veggies was scratching before they touched your produce, which may not be cooked and that's the concern with fruits and vegetables because they may be keeping raw. Okay, wow. Okay, quick, stop. Questions? Okay, I'm sorry. No, I love the questions. They're going up so quickly that I can't keep track of them. Okay, do I recommend colloidal silver water? One mind asks. I do not recommend colloidal silver. In fact, you can become silver poisoned by ingesting. Some people put it up their nose and you should not use silver internally. You can actually get a disease, turns your skin strange color. Now, is there a role for colloidal silver in topical applications outside the body? Perhaps in some rare circumstances of multi-drug resistant bacteria, but that is not something that people should be using willy-nilly and certainly not internally. I'm so sorry, I can't pronounce some of these names. Joaquim said, where'd you go? Okay, stinky boom boom. Stinky boom boom asks. Wait a second, where did stinky boom boom go? I need to increase the size of my chat window here. Okay, I was so close to stinky boom boom. Okay, then it just disappeared. I'm so sorry, Ms. Boom Boom, or Mr. Boom Boom. Okay, I'm sorry, I got to go back to the bottom because it's growing up so quickly. Okay, any story about BP and vegan... Omar asks, any story about BP, blood pressure, and a vegan diet? Absolutely, I have a whole chapter on blood pressure in the book. We've known since the 1920s that high blood pressure need not occur. Researchers measured the blood pressures of 1,000 people living in rural Kenya, published in The Lancet by the most prestigious medical journal in the world in 1929, and our blood pressures go up as we age, such as about age 60. The majority of us are hypertensive, whereas they're eating a diet centered around fruits, vegetables, wild, dark, green, leafy vegetables, including end beans. Their blood pressures actually go down as they age, in fact, down to the ideal blood pressure. There's no benefit from reducing it further by the pressure of 110 over 70. That's where we should all be working on, and they got there naturally just even healthy. The same thing with rural China, 110 over 70, their entire lives, 70-year-old, same average blood pressure, 16-year-old. And again, what's the Venn diagram of the rural African nation diets? It was plant-based. They've met only not special occasions. Why do we think it's the plant-based nature of their diets? It was sub-protective because in the western world, according to the American Art Association, the only folks getting it down that low are those eating strictly bent-based diets coming in average 110 over 65. So to answer your question, BP and vegan diets average 110 over 65. Perfect, ideal blood pressures. And so that's the diet people should go on and treat the cause. However, you are on blood pressure medication.  If you treat the cause, eliminate your blood pressure.  You drop your pressures too low. You get dizzy, fall over, can hurt yourself. So ironically, the side effects are not having to take drugs or having to take fewer drugs. So please work with your physician closely to wean yourself off these medications. Hopefully you can get them off completely and then not suffer the side effects and more importantly, treat the cause of the disease. Okay, any research on recovery for vegan athletes asks Ricky Kay with lots of question marks. Yeah, I got a bunch of videos coming up on plant-based athletes and indeed, that seems to be the key is the recovery time just because the anti-inflammatory nature of the diet just allows people to train that much harder. But of course, the secret is in the training, not the diet. The diet just helps you, enables you to train more but you still have to actually do the training. No magic bullet. All right, Michael Stigl, Stiggy Stigl asks, are you on, of course, I'm on a treadmill. I walk about 17 miles a day.  But when I'm home, I control my diet, control my life. Yes, I'm on a treadmill all day. I work at a treadmill desk. I'm not tipped to the camera down. You will see my, well, I don't know if you'll see that. That's my, I got my keyboard. I got everything there. So, yeah, so then I can get work done. Does that actually show? Okay. All right. I knew I should have put pants on. And yeah, on a treadmill, because being sedentary is not good for you. Even if you exercise, even if you are, you know, go to the gym after work, sitting down for six hours or more a day associated with living a significantly shorter lifespan. I've got some videos about that. Check it out. What is my input on the lemon first thing in the morning? Fine with me. I would just rinse your mouth out with water after eating that lemon or any citrus or any sour food so as not to erode your dental enamel. Okay. Asks. Oh, darn it. Evan asked. Okay. I'm going to scroll up to see if I can catch up. Yes. Should we limit soy intake? I encourage. I think the sweet spot was three to five servings a day if I remember my own videos correctly. Because at high, two over five servings a day, you can increase your levels of IGF-1. Insulin-like growth factor one is the cancer-promoting growth hormone associated with animal protein consumption. But if you have enough soy protein, you can get higher IGF-1 levels two, which is not a good thing. Elizabeth asks, should humans fast? That is a fantastic question. There's a rich literature now. I wanted to do fasting videos, but there was just no science out there. But now there's just been this burst of science and caloric restriction, intermittent fasting, water only fasting, and all sorts of really cool data. I can't wait to dig through and do a whole series of videos. I hear you, and the videos are coming. Subscribe at NutritionFacts.org and you will be the first to know when the first fasting video goes up. All right. How Chloe Parker asks, how do I feel about the work of Ray Cronix? I think Ray is a genius brilliant guy. We share a lot of research. Anytime I come across a really interesting paper that I think will help his work, I send it to him. He returns the favor. He's got a book. He's working on a book called, I think, Our Broken Plate, something like that. And I'm so excited for its release. He's already published, the peer-reviewed medical literature. He's a former NASA engineer, smart guy. Kind of reminds me of Pritikin, right? Someone now with a medical background, just an engineering background, just wants to know the facts. Just show me the data. And he's done a deep dive in nutrition literature and really has some fascinating stuff. And I've done one video, I think, about his work. I got a bunch more videos coming out about his work. Hey, simple question. Ask short films, ABC, macros. What percentage, the question is like, should like 80, 10, 10, or what's the percentage of macronutrients from protein, carbs, and fat? And the answer is it's the source that matters. As Dr. David Katz likes to say, carbohydrates are lentils and lollipops. So you can't say, should eat more or less carbohydrates because what does that mean? Same thing with fat.  Right, you have to talk about sources. As long as the source is whole plant foods, I'm more interested in whether you're eating whole plant foods than whether or not you're eating high or low fat or, you know, so as long as your whole food source is fat. When I talk about oil, I'm talking about nuts, seeds, avocados. Those are health-promoting foods. I encourage people to eat a palm full, actually, of nuts every day. That's actually one of my daily dozen. Another one is a tablespoon of ground flax seeds. And so it's not, it's fat good or bad, it's the source. Whole food sources of fat, carbs, and protein are your best bet. It's okay to eat five carrots a day, ask Jackie. It is okay to eat five carrots a day and even better dip those carrots in some bean dip or hummus or, and, you're making me hungry. Okay.  I've got videos about the, the blood type diet or blood type astrology. That's, to me, it seems the same as asking, does my, does my horoscope have anything to do with what I should eat? And so the scientific community has been rightly very skeptical of that work and sees more as a marketing gimmick than having any support of science. Maggie asked, how can you increase your fertility? Actually very similar for both men and women. It's eating a healthy plant-based diet. Though there was a, the, the Adventist too, just had a sperm count diet that found, I think, that sperm counts of vegans was lower. I have that, that study, haven't read it yet, just noted the title and abstract and I will do a video about it. But in general, I've got videos on fertility and lower in saturated fat intake. So you'd assume someone in a plant-based would have improved fertility. I will check out that study and let you know. What about healthy vegan weight gain for strengthening athletes, as Lucas? So healthy, if you add the word healthy in there, then we're talking about whole-plant foods. For athletes that are spending a lot of energy, particularly swimmers, they're just losing so much heat energy and you have to, you know, eating thousands of extra calories a day, that can be challenging in a plant-based diet because their foods are relatively calorically dilute.  Now for most people, that's a good thing. It's just hard to get an excess of calories on a plant-based diet, why it's so great for weight loss.  So we're talking nuts, nut butters, avocados, smoothies. You can kind of sneak liquid calories past your body and kind of fool the body a little bit. So, you know, dried fruits. So dried fruits, nuts, trail mix. Yeah. So it's just, it's all about eating lots of food. And then to raise your core content. All right. Should I worry as Fritsomus2988 just went off the screen. Should I worry about my HDL cholesterol of 31 when my total is 134 and LDL 80 fantastic. No, you should not worry about your HDL. In fact, I've got a whole series of videos now that we have something called Mendelian Randomization Studies to look at whether the Protective Association of HDLs actually causal or not. Really quite revolutionary stuff that has rocked the cardiology world. I'm excited to come out videos about that bottom line for you. And you will find out why very soon. Actually, not very soon. But I will very soon when I script the videos, but it may be a while before they actually make it up. All right. How important it is to get your RDA for vitamin D as the vegan surgeon. Vitamin Retrude is very clerically dense.  But that's a good thing. So, yeah, no, I'd get the RDA for vitamin E. And so by following my recommendation being on to nuts and take a spoon of ground flax seeds, it should not be a problem. All right. I answered the fast-in question. Sorry, missed it. You can go back and listen. Before, only got four minutes left. Oh my God, they're flowing by so quick. Do I recommend a plant-based diet for anemics as Haley Hope? So, the first question is treat the cause. Why are you anemic? There's a number of reasons. So, anemic is not having enough blood cells in your body. So, could it be that you're not making enough blood cells? And there's a variety of reasons that could be the case, could be a problem with your bone marrow, could be a problem with not getting enough iron, could be a problem with not getting enough vitamin B12, or are you losing excess blood?  So, there's lots of ways. So, basically, if you're anemic, your doctor has to treat the cause by finding out what the cause is, and then if it is something like iron deficiency anemia, you would still eat a healthy diet, a whole food plant-based diet, but you would make sure that you combine iron rich foods like beans and greens with a vitamin C rich foods, which boosts absorption of plant-based iron. So, you want to have foods like tropical fruits and citrus and broccoli and bell peppers have that vitamin C in your stomach at the same time, they have iron rich foods in your stomach to boost absorption. That would be the first thing I would do to bring up one's hemoglobin which is probably the best laboratory indicator of anemia status, and ideally we should really have low blood counts kind of just above the lower edge because iron can be such a pro-oxidant within the body, and so we don't want to be subnormal, we don't want to be anemic, but low iron stores without anemia is probably the ideal iron status. All right. What? Okay. Doctor, how do you help girls who have Abbey Lavino ask that have lost their period? Ah! Because of something. Lost their period. Oh! So, that's great. There's something called the athletic triad. So, these are young women, typically athletes, who are thin who lost their periods because of a hormonal imbalance due to the lack of adequate body fat lack of adequate dietary fat.  So, that's why it's so critical. So, because the cause of lost your period is a perturbation in your hormone levels your hormone levels drop and you need those hormones to keep your bone strong. So, it's critical. And so anyone who's lost their period, they should go to a dietician. They should go to a doctor who knows what they're talking about. Like go to plantbaseddocs.org and you can find a physician that knows something about nutrition and work with them to restore normal hormone levels. And ah, that's it 8.30 already. That's the end of my third live Q&A for today. I hope you enjoyed it. Hope I see you out in the road the next week, the next month. I will talk to you next month. Get all as many questions as I can answer. I'm sorry I didn't get to so many of them. They're scrolling past. I hope everyone has a wonderful night and eats healthy and takes care of themselves.


Because meiosis 2 is essentially mitosis with half the chromosomes. So the reduction division has happened. We now, if I were to draw a picture of what we have at this stage in the game, you can imagine that we've got one big chromosome. It has sister chromatids, but there's only one of them, and maybe one little chromosome. There's only one of them. Here is its homologue. Sweet things. The homologue is in a whole other cell. Here is its homologue, and here is its other homologue, and it's in an entirely different cell. This is the cell. Both of these are going to go through meiosis 2. Now, prophase. Sometimes, when the cell goes through a little baby interface, sometimes the chromatin will re-unravel. Excuse me, sometimes the chromosomes will unravel and turn into chromatin again. Sometimes they don't. Sometimes it goes directly from telophase and cytokinesis in meiosis 1 into prophase of meiosis 2. So prophase 2, if we don't have everything condensed, if we made a nuclear envelope, we dissolve it. If we have a nucleolus, we undo it. But sometimes all that stuff is already done. So then you end up, here we are. Let's go ahead and throw in our spindles and our centrioles, and we're going to do some jockeying, and we're going to line everybody up where? On the metaphase plate. So metaphase 2, my chromosomes, my sister chromatids, line up on the metaphase plate. Do you see how, if this were mitosis, we would have our homologs, actually, all of these guys would be in one cell lining up. If it were meiosis 1, these guys would all be in one cell and my homologs would be hooked up so that they can separate. But this is meiosis 2. We only have one, it's a haploid cell, but we only line, everybody lines up in a line. Nobody is partnered up with anybody except for the sister chromatid. Anaphase 2, we just make sure that sisters are splitting. And T-lephase 2, sisters make it to the poles. We're going to go ahead and build a new nuclear envelope. We have a new nucleus. Let's go through cytokinesis. End result is a, well, four little, I can do it, I really can, gametes, there they are. These are my end gamete results. And that was my meiosis 2. I've got to have a sperm tail. Straight forward, isn't it? Okay, we're going to, why? Why do we do this? There are some parts of meiosis. Number one, it gets us a haploid chromosome number. But number two, there are things that are happening in meiosis that promote genetic diversity. So we're going to look at those things. For one, we have the process of crossing over. Let's look at that more closely. For two, and you can actually see that her, we actually have a process called independent assortment that is significant for producing genetic diversity. And then, if you start thinking about, whoa, how many possible sperm are there and how many possible eggs are there? And then how many possible babies can you make? Holy random fertilization madness of fun times and diversity. I'll be right back to talk about crossing over.


Okay, I think we're gonna get going here. Thank you for staying and coming to a five o'clock session, especially one that's going to be code heavy. So this is a talk by me and Cat Bailey, but you'll notice Cat Bailey is not here. So she couldn't make it, so it's just me. I'm Mark Sandoval. I'm a performance engineer at Acquia. Although my job is mostly performance, I also do a lot of work just to object-oriented programming in general and Drupal 8, and I helped get PHP unit into Drupal 8. So I'm passionate about unit testing and unit testability. So first, what is a unit test? It verifies the behavior of a unit of code in isolation, independent of application context. They're fast, but fast tests aren't always unit tests. Unfortunately, they do not replace integration and acceptance tests. As slow as our test suite is now, we will never get it into like 10 seconds by making them all unit tests because we can't convert them all. We still need acceptance tests and integration. So why unit test? Mostly code quality. When you force them to do unit tested, you're forcing that code to be context-independent. You're saying I can run this code and I can verify its behavior outside of the context that it's run in. A good unit test also serves as documentation. There are other communities that are not necessarily in the PHP or especially Drupal world where the tests are actually their best documentation and oftentimes they're better than written documentation because you can see exactly how the thing's used. The refactoring, it's very, very painful to refactor without unit tests. Anyone who has worked on Drupal 8 and had a random test failure for some web test and had to debug that, you've probably felt that pain. The feedback loop on that is very, very slow and it may break something that is completely unrelated to what you're doing. The feedback is also extremely valuable. When you're coding and you have unit tests, you're constantly running them and you know instantly when you break something and it's a constant feedback loop with the tests. Now, we talk a lot about testable code. I'm sure if you've been involved in Drupal 8, especially if you're familiar with the service container and the general dependency injection trend in Drupal 8, you've probably heard about testable code. But just to define it, I like this quote from the growing object-oriented software guided by Testbook. For a class to be easy to unit test, the class must have explicit dependencies that can be easily substituted and clear responsibilities that can be easily invoked and verified. So to illustrate that point, and here's an example of some code from D7. This code adds a role to a user. I believe it is triggered with the action that does that. It is an action. Right, it's just really confusing because the word action never appears anywhere here. So if you look at this code, if we look at the dependencies, we see the parameters. So you have an explicit dependency on accounts, operation and role. You have operation because it does multiple things. And then you have implicit dependencies. You have DB query, user load multiple, and user save. So those right there. And now if you were in a unit test and you were trying to run this, you would need all of those functions available. So you'd include the files that have those. But those functions call other functions. And so now you need all the files that those are in. And the files that those are in. And on and on. This is the level which I stopped doing this by hand. So the same code from D8. It's an add role user object, a little bit strangely named, but it is an action plugin. It takes the account, and then it has the role. The role actually got injected via its constructor because it's a plugin, that's a little weird. But two explicit dependencies. And here, all we have is a call to has role. And then if it doesn't have the role, it calls add role and save on that user object. So no function calls. Now if we look at the test for this, this test actually exists in core. You start that out by creating an account mock. And in this example, it's using mock builder. Sometimes you need that when you're creating a mock from a test or from a class instead of an interface. I'll show that later. And then you set up an expectation. You're saying that the method add role will never be called. And then you set up an expectation that the has role, the has role method will be called with this value and it will return true. And so that's basically saying, and then if you notice the test is called test execute add existing role, it's saying I'm gonna test the situation where the user already has this role. I'm gonna stub the has role methods that it returns true. And so that I'm gonna verify that add role never gets called. And then you basically set up that object and then you just do execute. You'll notice there's no assertion at the end. Who here's written a simple test for? PHP unit? So especially the people who have done simple tests, you're probably used to just always using like this assert equal assert something. The assertion here is in the expectation. This is an example of using a true mock. And when you say like on the second one, that's more of a stub because it's saying this any, but when you say this never, that means if the method is called once, the test fails. The test only passes when it gets called zero times. So I would say in this example, we have clear responsibilities and they're very easy to invoke and verify. And they're explicit and it was very easy to substitute them. So I mentioned briefly mocks and stubs to clarify these terms. They're two types of a test doubles. It's a sort of a recentish term, but it's a useful one for describing these objects. So say we have this class. It's a super simple class. It takes a storage interface. The only method it has is get stuff and then it just calls it delegates directly to stuff storage get. And then you just create the interface that just has get and set extremely simple. So the first type of object and the simplest is a fake. So when you're using a fake, you actually just implement that interface. You just create a class. And in this example, it's basically in memory storage. If you worked on Drupal test before, you'll see this a lot. This is what we've done quite often. We did that in D7. And then when you test it, you just instantiate that object. You set it that value manually and then you inject it and assert the response that comes back and make sure that you got the right thing. Now a stub is similar. Except with a stub, you don't actually have to make that class. As long as the interface exists, you can just tell PHP unit getMock for this interface and then set an expectation. And then expect any method get and it'll return that value and then use the same thing as before and then assert the value at the end. So you're asserting the state that came back. I think when people see this initially, it maybe seems like a lot of setup and it may be a little laborious. But I think compared to actually creating a class in the other one, this is still less work. And it's probably a little confusing also that the method is called getMock and I'm saying that this is a stub. It's not that great of an area, but if you actually look at the PHP unit documentation, they're clear about these are stubs. They just all come from the mock method because they can sort of be both. So a stub is used for indirect input and it asserts on state. Meaning you use a stub when you have input that's happening or input that you need to do the job that your method needs to do that is not passed in the method signature. And then you do an assertion on state. So mocks on the other hand are a bit different. So you might say, you thought we've always used mocks in Drupal. If you looked at the file system, you'd see a lot of things called mocks. Those aren't actually mocks. Pretty much all of them are fakes. So here's what the test with a mock would look like. Notice it is very similar to the stub, but the big difference is instead of saying this any, I say this once. And there's my expectation again, if it gets called twice or if it gets called zero times this test fails. And then I don't actually, like I would assign that stuff variable and I don't actually do anything with it because I don't care what the return value is because all my classes responsible for is delegating this call to another class. I don't necessarily need to return, I don't need to test the return keyword. So in this example, I know all I need to test is how this object interacts with the other object. So mocks are used for indirect output and they assert on behavior. So like I was saying before, we're basically asserting that this object acts or it behaves how it should with this other object. They send the right messages to each other. Now, if you've looked into mocks, you've probably heard somebody say that you should only mock what you own. It's a bit of an advanced topic for us, but I think it's worth introducing. And so from similar people, but in a different paper, mock objects is a design technique. So programmers should only write mocks for the types that they can change. Otherwise, they cannot change the design to respond to requirements that arise from the process. Meaning when you're programming with mocks and you're writing your tests first, and then you realize, okay, at this point, I have this other interface that I haven't made yet, but I'm making it now so that my tests can finish and so that my class can do what it needs to do. At that point, you're looking at the design and you might make changes to it and you can't do that with an object that's not your own. If that doesn't make sense, that's totally fine. It's not a hard rule. You can mock other things, but in general, like a simpler example is don't try to mock PDO. That's not a good idea. Instead, create a class that wraps PDO and then mock your class that you just made.  So look a bit about, or look a bit at Drupal 8 and how this helps us. Here's an example cap put together. This piece of code sort of reformatted to fit on the slide and cut down from the subpath auto module. All it does here is just a lookup on path to get the alias if it's an alias and then cuts it down. The important part is the Drupal lookup path. So in this example, like the one before, you end up with those dependencies. I did not trace them farther than that. They have more dependencies, but I didn't wanna do that again. But I mean the big one there, DB query. It's sort of game over at that point. So here's the new version. When you turn this into a plugin. Path processors are an object, like they're all objects in Drupal 8 and they all get run in a certain sequence. And so this actually had, this object gets, actually let's skip to that. It defines a service for itself and it says I need injected the path processor alias. And so there's another path processor object that all it does is it resolves these aliases and I need that injected into my object. And so once that's injected, all I do is I call this process inbound on it. And then you have to tag it path processor inbound. That's a little goofy. So here's the test for it. Basically do the same thing you do before because this is a class and not an interface. Use the mock builder and disable the constructor because you don't want the code from the constructor running. And then you set an expectation that process inbound is gonna get called once with that argument. And then you're giving it a return value. And so you're basically simulating it, giving you the unalias version. And then pass that mock into, it's sort of a mock and a stub in this sense. If I had this any, this would just purely be a stub but it doesn't hurt to just say this once and get both of them. So you inject that and then go ahead and call process inbound and then assert that you get the right value. And so this is a very unit testable version and really that's just not much trickery there. That's just how this thing works in droop life. So you might say testable classes all need to be defined in services. I've definitely read this in IRC more than a couple of times. That's not true. So as an example, it's kind of a silly example because this is hooks but it's a simple one. The hook discovery, plug in, plug in discovery object. Here's a test for that. And then at the top I just define one hook that's gonna get called and so I can assert on it. And there's also an example of when you need something like this, when you need a fake function or a fake class, don't be afraid to just stick it at the top of the test. I know that we have rules about where things go but in tests, all bets are off, it doesn't matter just to find a function. So this is what the test will look like regardless of what is happening in the class. We just do a simple assertion on what the expected value comes back and what we expect is that we wanna be told this module, some module implements some hook and it returns some ID. So the first like Drupal 7 style version of doing this you just call module implements. There's actually still code in Drupal 8 that calls module implements. And if you try that, you will get an undefined function because in PHP unit we don't include any code except for the stuff that's in the like the small bootstrap file and the code that's auto loaded. This I would consider untestable asterisk. There are ways to conditionally define functions. We do it in a couple of places but it's a bad idea and you generally never wanna do it. So when you have functions, you have no auto load. When you use require, it's like say you require like the common.inc or whatever has that function, you're polluting your test environment.  And as we saw before, it has unpredictable dependencies.  And so say we make this small change to it, we change out module implements for Drupal module handler git implementations. This is also something you see a lot in Drupal, especially in the entity system where there's not a lot of injection for reasons. It just calls straight out to this quite often. And so you might wonder if this is actually testable because it is a static method call. It is, here's how. You create a module handler mock, then you set an expectation on it. That's the part you're gonna have to do normally but then you have to create a new container, set the module handler on that container, and then set the global container singleton on the Drupal class so that when that Drupal module handler gets called, it'll be pulling from your container and not Drupals. And actually it'll fail if you don't do this because there is no container in PHP. So that passes. It's testable but it's painful. So you do get autoload but you also have non-object under test code running. And the term you'll see, object under test, system under test, is basically the thing you're testing because you should be testing that and nothing else in a unit test. And then if you do have this, you have to include a setter or else it just doesn't work. So another example, you could hide that call to Drupal module handler in a local method. And here it's basically the same thing except in get definitions, instead of calling out to the Drupal class, it's talking to itself. And then in the module handler, it'll only call out to Drupal module handler if the local variable is not set. And so one way to test with this is in your test subclass that class and add a setter. Some people find it very, very confusing if you just add a setter to that class because I suppose it might imply that you could use that although I think in general, that's probably not a big deal. If you wanna make it really explicit, you can just make, I mean on your normal class, you can just say set test module handler, which is very explicit, that you'd only use that during a test. And then you just basically call the set module handler and your test works. So that is totally testable. It mocks the inheritance or just a test only setter. So last example is just straight dependency injection. Here, this subject normally just had the hook, so we add module handler to the constructor and then you just call straight out to module handler because it had it when it was constructed. And the test for this is pretty simple. You lose the call for the setter. That passes. So that is very testable. Now it mocks just via new, just via making a new class, but it requires a service definition or a factory method, meaning if you have the service definition, that is what's going to allow you to specify which dependencies get injected into it. Or you'll notice with like form, I think forms, controllers and plugins, they have like a static create method. And the idea there is that you have a container aware factory, but your class isn't container aware. And if I probably haven't mentioned that, you don't want your classes to be container aware. Because one easy way to do this would be to just inject the whole container in your class and then you could get whatever you want, but that's not an explicit dependency. You should strictly limit what your class has access to. And so if you have to do that, or if you need stuff and you don't want to actually have a service, the best thing you can do is just create a factory that has the container and then that factory injects those into your class. But this is enough to make the dependency injection police happy. So you might ask, which method should I use? So constructor injection, like that should be your default. Definitely use it for what I'm calling domain collaborators. So like if you're like the token module and then there's a token storage class, assuming there is, I don't know if there is, those are both like sort of in the same domain. And so you have a very, like you have a high cohesion with that class, you probably want to inject that. So the test-only setter, you want to use that when you have dependencies, with safe defaults. So an example of that is say like a logger, a translator, URL generator. These are objects that it's very unlikely that we're going to have more than one instance of in a Drupal request. It's pretty rare. I mean, we might swap them out, but probably not more than once in a request. And it's also a good idea when you have a really bloated constructor. If you have a constructor with nine parameters in it, which we do, the ones that have safe defaults, you might just move to test-only setters because the only reason that you're injecting them, most likely, is that you want to be able to test your object. So if you can test it through a setter, but it's really just like an application like Drupal level dependency, feel free to get it out of your constructor because it's not really that important to what your object is doing. So replacing the singleton via the Drupal class, avoid it if you can. If I think it would probably be better to have a... No, it's not going to be better. The least you can do is to make a local accessor. If you're talking to a dependency, don't ever talk straight outside, only talk to yourself, and then wrap that dependency in a very small method. And that's totally easy, not a lot of overhead, and much, much better. So you might say, but it takes so much work to set up my unit test. This is a sign, and you should listen to this feedback. So all dependencies are not created equal. Like I mentioned before, some are closely related to your class, some are not. So this comes with the idea of cohesion and coupling. So elements are coupled. If a change in one forces a change in another. And cohesion is a measure of whether responsibilities form a meaningful unit. So if two classes are doing something similar, they're close collaborators, they live in the same domain, that's, it's a high cohesion. Entity storage controller has a, or node storage controller is highly cohesive with node. Right, it's not necessarily cohesive to module handler. That is a coupling. So here's an example to pick on Peter Wolonen. Maybe you wrote this, I don't know. The local task manager, it's a new one. And so it'll probably get refactored, who knows. It has a lot of dependencies. Okay, sweet. Good to know. Okay, I might have a suggestion for you. So when I see a class with this many dependencies, my first thought is to look at what they are and how they're being used, because it's pretty rare that you should ever have this many dependencies in one class. It's a good indicator that your class is doing too much. So the first thing that pops out of me is these. So we have request, route provider, and access manager. If you look at access manager, it actually already has a reference to route parameter, or route provider, and I believe it also has a request. And so these three are related. And now if this is a manager object, meaning it probably shouldn't have any significant business logic, it should mostly be delegating to other objects, I would take whatever is happening in these three objects and move them to a different one, and then have the local task manager just delegate to that instead. And then you turn three dependencies into one. Hopefully that makes some sense. Looks like you have something to say here. Right, this is hard, except that it's hard. But I think the point though here is that if you can find things that are related, like these are related and they're not related to those other ones. I think it's pretty likely that you could, that this functionality could exist in an object that doesn't have a controller resolver, module handler, cache backend, and language manager. I think that's likely. So the other one is module handler. And this is a subtle point, but we have this all throughout our code now. So all of the code that would have used module invoke, module invoke all, alter module implements, module implements are all using the module handler now. So basically if you have a hook or you just need a list of modules for any reason, you have to have a copy of the module handler. This isn't a great trend in my opinion. What's a little odd about this is actually it's just using it to call this ultra info, which it turns out is a plugin thing where you set that and then the plugin calls the hook on your behalf. So instead of this, what I would do, and I know I'm just trading one dependency for another here, is I would instead have a dependency on the event dispatcher. Because if you have a dependency on the event dispatcher, all you're doing is you're saying, I have this event that happens and here's the thing that goes along with it, somebody do something with it. All you can do that object is dispatch. With the module handler, if you look at the public interface of the module handler, you have access to way more than you should have. That's basically a dependency on all of Drupal when you have the module handler, versus the event dispatcher, which is much, much simpler. I trust some people will disagree, but I think it's an important point because it's all over the place. And now I don't have too much on this, but I can't talk about unit testing without mentioning TDD. I'm sure everyone has heard of TDD. You've probably heard it talked about a lot when simple tests went in. Another disappointing realization there is that we were actually never doing TDD and it's almost impossible to do in Drupal. I have talked to one person who did it with unit test base, but it's pretty rare. The distinguishing piece of TDD is that you write your test first, and we don't do that. Does anyone write their web test first? Right, that would be insane. What, is there an objection? Does somebody do that? So that's an integration test. It's doable. The feedback loop on that is so slow though, it generally doesn't facilitate that. The idea is you write your test first, and then that determines, so you write it for one class, and then you figure out who that class's collaborators are by that design process. So another good quote on that. You write your test first, you write test before the code. Instead of using testing to verify our work after it's done, TDD turns testing into a design activity. We use the test to clarify our ideas about what we want the code to do. And so this is the trick to unit testing. It's great for refactoring and telling you that your code still works. There is some value there and telling you that your code is correct. The real value is that it makes you write good code, and especially when you write your test first. When you get to writing unit tests and it's very painful, that process will change once you start writing your test first because you'll design better interfaces and you're designing your interfaces from the client's perspective. Because you're saying this object is gonna need to collaborate with this other thing that I haven't written, and this is what I would like the interface to look like. And you always get better interfaces when you do that. And so I would just encourage everybody when you're writing PHP yet, or you have a new class to make, you're porting your modules, just give it a shot. It's gonna be painful at first. You'll probably give up on it, but just keep trying because once it clicks, it's totally worth it. So just a couple of references for things I mentioned directly in the talk and things that have influenced my thinking on this. The growing object-oriented software guided by tests. That's probably the top one. Ex-unit test patterns. There's the paper, macrolls not objects from UPSLA that explains mocking what you own. And then the Sandy Metzbook practical object-oriented design in Ruby, which really is not that Ruby specific, but it has a great testing chapter. So that's all I have. Take questions and then feedback if you can follow those instructions if you want to give feedback. Yeah, questions. I can stand here awkwardly for a really long time. Oh yeah, and if you wanna ask a question, you have to go to the mic. Yes, yes. Right, so are Stubs and Mox useful in their own ways? Like, so you use one in one situation, one in another, not use one or the other. Yeah, yeah, absolutely. And so that's, that's right. I think fakes are fine. I think it's all depends on what you're dealing with.  Like having a memory-based, say we had a memory-based database connection, right? That would be really useful because we'd use that all over the place. And so maybe it's worth making a fake in that case. But it's like most design questions. I mean, because this is basically a test design question. It's you should let your pain guide you. If it hurts, do the other thing. But between Mox and Stubs, like there's a pretty important distinction there. You use a stub when you wanna verify the behavior of your method, but you need input from somewhere else to accomplish that task. And you use Mox when you wanna verify how your object interacts with another object. I think like I could say, you should try to always use Mox and that's like a super object-oriented geek thing to say. But it's a really hard thing to do. And so you should try, but you're probably still gonna need Stubs here and there. And really a Mox is a specialization of a stub. Sometimes when you have Mox, you need somewhere to return value so that it does what it does. And also you said the three things. There's actually more that I left out. Right, right, right. There's a dummy object. It's like when you just need to fulfill a constructor, but it's not actually gonna be used. That's called the dummy object. It's probably not that important that you know any of that. Did you just give up on your question? Wait, I just answered it in. Oh, okay, yeah. So I thought I saw Pat Collins, Connolly over there. I just frapped Michael over there. All right, that's disappointing. Anything else? Okay, thanks.


Adding a reference manually to EndNote. Select References and New Reference. Select the type of reference it is and fill in the details. You can run a spell check and click on the small X in the corner to save your reference. That is the end of this demonstration.


These are the candidates for sheriff The office of sheriff serves as the chief law enforcement officer for the county and is also responsible for all judicial support Including court security and oversees the operations of the beer County Adult Detention Center The candidates for this office are Susan Pomerlo Javier Salazar Larry Ricketts and James Dorsey We will begin with their two-minute opening statement starting with Ms. Pomerlo Good evening, and thank you so much to the League of Women Voters for setting this up and Arranging for us to be able to speak to you about the issues and This race is about public safety today and into the future and In the sheriff's office. We're in the midst of some exciting changes. In fact one week from today We will break ground for the first-ever Sheriff's substation after talking about it for 17 years we're also leaving behind the stubby pencil era and Moving into technology 30 years ahead of where we started when I became the sheriff Going from paper and pencil to an automated law enforcement state-of-the-art records management system Pay-in personnel system all those kinds of things that allow us to do the job better and put Deputies on the street and on the floors of the jail where they need to be working not spending So much time in terms of having to be inundated by paper But these changes don't just happen it takes leadership and from someone who has a proven track record Leading strategic transformation of organizations as I have done Rising to the rank of major general while I serve 32 years in the United States Air Force and As a senior vice president at USAA So it's someone who has experience and leading a large organization of almost 2,000 people and managing a budget of close to $200 million so this election is about performance not politics. It's about Responsibility not rhetoric. It's about experience not e-blasts, and it's about the public. Thank you Your time has expired you Mr. Salazar Good evening. My name is Javier Salazar. I want to be your next sheriff I'm a Bear County native and I'm a 23 year veteran of the San Antonio Police Department For 16 years now, I've been happily married to a young lady named Sarah Salazar That is a kindergarten teacher on the south side of town and together We're raising two beautiful young women who are 14 and 21 years of age I love my family and I love Bear County. It's my home. I was born here We're raising our family here and one of these days a long time from now I'm going to retire here in the meantime. I want to continue to protect and serve as I've done for the past 23 years See nationwide My profession law enforcement is in crisis We're in crisis because many agencies are having a hard time connecting with the community they serve and quite frankly people are dying I've seen enough in my career I've seen enough dying and killing to last a hundred careers and it needs to stop now while I can't directly control what happens in the rest of the country what I can control is my little piece of the world right here in Bear County What I can do is I can make sure that those those relationships exist in plenty here in Bear County and that we cultures We cultivate those relationships and maintain them the way any relationship needs to be We need to serve as the example to be emulated across the country And that's how you attain long-term cultural change across an entire nation I'm proud to have served in many many different levels of law enforcement as a boot on the ground patrol officer making calls as Undercovering our products detective for ten years working against organized crime and human trafficking and narco terrorism I've done it as a supervisor Leading my officers into a calculated risk and making sure that everybody gets home at the end of the night And I've also done it as a member of the administration of one of the largest of the largest law enforcement agency here in the Police Department So I'm proud to say that I've served you for 23 years and I love the opportunity to serve for another 25 And I'm asking you for the opportunity to do it as your next sheriff. Thank you. Thank you. Mr. Ricketts My name is Larry Ricketts Native Texan I've been married to the same lady for 45 years. We have three daughters 11 grandchildren We own a business in Southeast Bear County. We have a daycare center with that's been a business for 31 years I Served my country in Vietnam as a special forces commander When I came back from Vietnam, I went into the elevator construction trade where I spent 20 years installing elevators and escalators throughout South Texas. I Was on multi-million dollar jobs at all the military bases in Texas all these jobs were done under budget and Savings were given back to the company. I Started working the Sheriff's Department 1989 I worked in the jail for seven years Since I left the Sheriff's Department. I've been in the Cuspals Department I'm a captain and precinct for All my service has been 27 years in County law. I Look forward to the debate tonight and any questions you might have thank you. Thank you, Mr. Dorsey Well, thank you to the League of Women Voters. I Tell you guys If my Lord and Savior never does anything else for me, he's done enough My history speaks for itself. I was born in Raven, Louisiana To a woman who I lost at an early age. I never got to know I never understood Why the Lord would take her away from After that I was raised by my grandfather He took on me and five siblings and he had he already had ten himself Well the thing in his house with that You're gonna graduate and you're gonna go to college. I did that. I graduated Raven High School I went to college college wasn't for me. It's not for everybody But shortly after I joined the military I joined the military in 1982. I met my wife in 85 Joining the military was the best thing that ever happened to me and my hats off to all the veterans Be it retired active or disabled This country deserves to give you guys mega respect. I Served in the military under the power under the command of many many powerful general. I went to the desert in 1991 and served as shielded storm and also served during desert Khan while in the desert I had the opportunity to work with some very very professional individuals We did some things in the desert that most people never ever get to see So when I say there before you and I say I have the experience you can trust That mr. Dorsey have been through the valley and he have done just about everything that could possibly be done We have a crisis in San Antonio on all sides of the railroad We need to really really really think about the candidate that we put in office I ask you for your vote as the next bad county sheriff I will be the strongest sheriff that bear county has ever had we have had a crisis in bear county As far as I can remember. Thank you time has expired For our first question and we're gonna start with mr. Salazar on this one What are the most significant challenges in running a jail? Well, you're dealing with a Population that doesn't want to be there first and foremost or our current sheriff has Compared her position to that of being a landlord The only problem with that is that you have tenants that don't want to be there They're gonna they're gonna look to escape or they may look to commit suicide and in the past several months We've seen that the the current sheriff's administration has a challenge in preventing either one of those and so Those are the that is the what you're what you're dealing with You're dealing also with it with a population that has A higher than average Population within it of those that are that are mental health consumers And so you have to take a proactive approach to to preventing suicide and to dealing with those mental health issues At present that's not being done as proactively as it should and that's what I hope to bring to the sheriff's office Thank you, mr. Ricketts I'm proud to say that my seven years working in the jail. We never had a suicide The officers that work there were very diligent in doing their job and checking on these individuals constantly The old times still work Some of the new stuff is not working If you don't check on each body at a given time, you're gonna wind up with somebody who's wanting to commit a suicide Because they don't want to be there to begin with The morale at the jail right now is the lowest it's ever been and it's just gonna get lower Because the deputies are not being treated with respect that they deserve I plan on changing that Thank you Thank you, mr. Dorsey To know what's going on in the jail You have to have been there If you look at it from the inside out you'll have a different story a lot of people talk about it But I worked in the jail for eight years In 2012 I ran for barry county sheriff I ran against susan pamelot Lopez and a couple of other candidates Where after getting knocked out of the race in the primary I went over to miss miss pamelot and I told him that there are some things going on in the jail That needs to be taken care of four years later. That jail is worse off than it ever been I mean the officers on the street taking lives. There are such a mental crisis in the jail the use of Chemical restraint and it just keeps going and going and going We have to make the right decision Bear county we have to Thank you. Thank you miss pamelot Let me talk about the couple of the things my opponents have talked about One in every five inmates in the bear county jail has some level of mental illness. That's not just in the jail That's also a reflection of our community And we have worked from the beginning to establish multiple levels of mental health assessments And the one that we just started last year has already shown that we've identified 20 of everyone who is arrested In this county and are diverting them to treatment rather than to jail But through the work that we've done of correcting things that We're still undone at the beginning when I became sheriff We've reduced the number of suicides in the jail by 27% Over the four years prior to that and we continue to work in that regard to assure that inmates are safe Our officers are safe and we are providing safety for our community. Thank you Um The next question we're going to start with mr. Ricketts While san Antonio is far from being the most dangerous large city crime is increasingly a problem Particularly property crime What role do you see the share of taking in mitigating this problem? Back when I was with the department, we had an operation called so you special operations unit These deputies were highly trained in stopping burglaries and car thefts They knew it was going on and they stopped them after one example That unit was disbanded by a previous sheriff This is one of the biggest problems we have facing the deputies right now The county is so large and there's such a large area for them to have to drive around in It's hard for them to keep an eye on people's houses. And this is what I've suggested If you're in a certain district Look at the houses See what cars do not belong at that location Get out of your car and go up and talk to them and ask them what they're doing there Men and women want to come home of an evening with their possessions still being there Thank you Thank you. Mr. Torsi San Antonio is our home Barrett county is our home I tell you There is a saying that I used to say when I retired from the military SA will be like la Everybody know how la crying me is What we need to do in barrett county is try to challenge our commissioners challenge our leaders challenge those that handle the funds of barrett county sheriff and get More officers on the street I even were petitioning the governor that most of these officers in the state a lot of people don't know They are all of peace officers first and then they are sheriff and deputies and and police officers and so forth and so on If it was up to me, I would take all the patches off every Every officer in this state and I will allow these officers that sit next to your house to respond As opposed to having an officer come straight across all across town to get to your house The response time is too long and you'll never ever ever get anything done With response time over 20 minutes Thank you. Ms. Palmer look When I became the sheriff this agency was 30 years behind in technology in facilities and workforce development And as I said, not only are we having the groundbreaking for the first ever substation one week from today The second groundbreaking for the other substation will be on october the 21st We've added more than 40 additional law enforcement officers Over the since I've been the sheriff in working with the county commissioners in terms of property crime We established the sheriff's habitual offenders team and they have been able to solve 18 percent more property crimes Since that unit's been established And we will continue working with the commissioners court to make sure we have the resources to keep our community safe Including we've moved we've When toppled the number of cellular unpatrolling neighborhoods that have neighborhood Watches and making sure that they are our eyes and ears and partnering with us. Thank you, mr. Salazar While solving crime is is always a good thing Preventing crime is the better the better bet in my 23 years of law enforcement community policing and crime prevention have been my specialty And the best way to prevent crime is through a two-fold approach Of course, you have enforcement activities that need to be conducted. You need to be out proactively patrolling your neighborhoods But the second aspect of it is the public education aspect We need to be empowering our public on how best to take an active role in their own protection Until we get there and so that that means educating the public on on the best ways to to prevent crime from happening Many times it's as simple as just reminding folks to close your garage door Because that's an open portal to your house and all of your valuables It's a matter of taking taking advantage of Resources that are available like what the san antonio police department has Well, we'll come out and do a home assessment of your home and we'll teach you how to harden the target that is your home So i'm i'm a much bigger fan of preventing crime from happening in the first place That's the key to uh to uh preventing crime Thank you, mr. Ricketts. Oh, i'm sorry I'll do it again. Sorry, sorry, sorry I got behind myself Okay, this will be our final question What are the most significant challenges in running a jail and we'll start with mr. Dorsey one minute, please Is that the one I just asked Then we'll ask this one Um currently the sheriff's office is a two-tier system Are there any plans to make it a one-tier system where all deputies will be peace officers and we'll start with mr. Dorsey Great question great question My military background take me back to when we had security and law enforcement There was always a fight. There was always some commotion amongst both of the ranks in 1986 We decided to deplete the security part and to combine those forces Yes, there is a great need in this county to tear down the wall between the law enforcement officers and the detention officer All officers within the state once they get that peace officer license and if I was in charge of that jail Before they even came in to the sheriff department. I will ensure that their training that was involved peace officers instead of detention We have a great need for more officers in this county The commissioner just released 17 positions on the council constable And i'm not trying to throw the ball at all everybody, but we need to do something different We got to get more officers on the ground. We got to do better in barrett county San Antonio is our home as mr. Salazar say Preventive is the best way of fixing any type of crime and we need to get those officers on the street Thank you miss pomerlo When I became the sheriff It was obvious that people Deputies who served in the jail were treated as second class citizens If you weren't in law enforcement You just ain't And since that time we have raised the level of professionalism for our detention officers And more than a hundred today Are have national certifications as certified corrections professionals And that recognizes the role that they play in public safety They are two different types of professions But they also share a number of skills and responsibilities and both are important In our community to keep it safe It's a matter of making both parts of the profession Recognize for the job that they do and both are just as important in keeping our community safe Thank you. Mr. Salazar To answer your question, I don't believe that a one tier system where everybody's a peace officer is is the Solution to what we have going on While everybody needs a better trained Police officer, of course police training saves lives That's not necessarily the key here that peace officer training is something that's very expensive We're a government agency and it's not a bottomless pit of money So there the key is to make sure that everybody's trained on a continual basis within their own career path There are people that are perfectly happy being detention officers for 20 30 years And and they don't ever want to be police peace officers So to force them into that role is just not something that's there What we need to be doing at the sheriff's office is making sure that we're holding on to our current personnel We have an agency that's lost over 200 people through attrition over the past two years They're leaving to go elsewhere And so we need to definitely improve the uh the Morale and the environment that those officers are in so that they'll continue to stick around And protect and serve as as we need to within the current system that we have. Thank you. Thank you. Mr. Ricketts We've been fighting this issue for 20 years What I propose Is to put on two classes Every day so that the deputy is working in the jail that want to become peace officers Will have the opportunity to go to these classes to become certified peace officers Once you do that You've got more highly trained officers working in the jail They can see a light at the end of the tunnel Where they're not going to be sitting there as detention officers rest their lives So when they become peace officers, then we can start taking them out and let them ride along with warrants or patrol So when it comes time for them to advance further, they'll already have the experience This is at no cost to the taxpayers. Thank you. Thank you We're now going to have the one minute closing statement. We'll start with mr. Dorsey And I would like to ask all of the candidates if they would mind If the student leaders came up and stood behind you and the college got a picture of the four of you with the student leaders Thank you. Okay, so um Michelle go ahead and mr. Dorsey your one minute closing statement, please In closing, I think it's very important that I make everybody understand that I have 31 years of law enforcement I have served at every level I know bad county bad county is my home I know those officers in that county in the county Those officers deserve better their family deserve better We have to do something bad county It led me as your next sheriff And I promise you again that my word is all I got and that I will be the strongest sheriff bad county I've ever had I speak from experience I speak from my military background And like I say all the families here. I thank you guys for your time tonight. Thank you and god bless each and every last one Thank you. Mr. Ricketts As I said in my 27 years of law enforcement. It's all been in the county level I live outside of municipality so we don't have The safety that people live in the cities do We have to wait half an hour to an hour for a deputy to show up I'm accountable. So I don't have to worry about that myself But the rest of the citizens of barrett county do I wish That you would all take time And look at the problems that we have and who had the solutions to them Go to my website and you'll see that there's more problems. That's been than what's been mentioned And I had the solutions to these problems Please vote the bible. Thank you. Thank you. Mr. Salazar When you call 911 you don't ask for a democrat or republican to come to your house What you want is the most qualified best educated Best trained and most willing officer to come to your house and help you out in your time of need On january 1st 2017 i'm going to get up out of out of bed and i'm going to get dressed for work I'm going to put on a badge like i've done for the past 23 years and i'm going to protect and serve You the voters of barrett county are going to tell me what badge i'm going to put on that day On election day, you're going to be asked to make many decisions across all levels of government As far as the sheriff's office, you're going to be asked to decide who's most likely to fight crime in a meaningful way Who's most likely to form long lasting relationships with the community? And who's going to be the most likely to be a good steward of taxpayer dollars? I can tell you that that person is me My name is i've got Salazar. I want to be your next sheriff and i'm respectfully asking for your vote Thank you. Ms. Palmer. Love This race is about electing the best qualified to serve and protect the people of barrett county And in a 21st century sheriff's office It's important and this is one of the fastest growing metropolitan areas in the nation It's important that one have a different set of skills than just law enforcement or jail operations It takes executive leadership To lead an organization of almost 2000 people and oversee a budget of close to 200 million dollars And the race isn't just about fixing past problems It's about looking to the future and making the kind of changes that are necessary to move us into the future I've been asked to represent barrett county in the state of texas by democrats by republicans In the state legislature in the congress and in the white house On issues of criminal justice in our community mental health and across the board Thank you. I will continue doing that as I continue to be your sheriff for the next four years. Thank you Thank you. Uh, will the student leaders come up now and have their picture taken with the sheriff's candidates? Well that picture is being taken I will remind you that uh Early voting begins on october 24th and ends on november 4th election day is november 8th Thank you for coming out tonight to learn about the candidates That concludes tonight's candidate forum. Please join me in thanking the candidates for their participation and thank you for attending


Balcrum's level zero is actually way deeper than you thought it was. That's right, there's actually several sub-levels to the famous yellow walled expanse, and some of them are worse than others. Take the red rooms, for example. This level looks like the regular zero, except it's got a red corrosive hue to it, or the very air itself is dangerous. There are strange creatures that roam the halls, and once you get here, you cannot escape and you're trapped. What about level 0.5? The chaotic structure. This sub-level has a bluish fog-type hue to it, with strange shapes to float around. The air and ambience here is corrosive as well, and it's home to an entity called QWERTY that lurks in the fog and hunts wanderers down who come here. That's just two of the sub-levels of level 0. There's like 20 more. Let me know if you want to see more.


Hallo zusammen.  Thank you for the introduction. It's possible that I sound a bit bad, but I have a bit of a cold. The portal went well, it's not because of that. I'll tell you a little bit about the transparency law and which content should be in it and how we implemented it during the last year. At the top you see a long list of names and we will show you later who worked on this. Im Informatikum der Universität Hamburg ist ein Verein der Forschungsprojekte. We are a group at the University of Hamburg, which builds a colloquium of research organizations and commercial funds. And this time we built it with the finance administration. First, I will go over telling you what the transparency law is because I'm not sure everybody is on the same page. Then about delivery systems and basic decisions. For example, the multiple sources of documents which are fed into the delivery system and how the portal will be realized with those. I have some screenshots where we can see our looks and you can right now use it. The metadata model will be explained and the architecture and API will be shown, which allow a periodic download and what we have planned for the next two years. The transparency law had the goal of delivering administrative documents and data to the public. And the target was fulfilling this by October 6, 2014. We decided in a web portal was built with a lot of trying from the authorities and they wanted to get it done until the deadline and it had to work until then. The transparency law that's the first article the purpose of the law is to provide comprehensive right to information and thus making accessible and spread all the information helped by the authorities listed in the second architectural paragraph directly to the public. Personalized data excluded. And the authorities which I meant are basically all authorities. A central point in this law is information, articles of information, information items so to speak. And I'm going to just read them to you. It's the preamble and the subject of choosing those items was to discover how to present them and it was interesting to see what the messages of the city the senate of the city parliament were and this law, this list grew through the participation of citizens through a wiki where they asked which types of information would be interesting. So for example 0.9 geodata is something which would be more interested in the public than the subjects above in some cases. And the goal is there's a lot of different types of data and how do we structure them and the law said that these 15 types of information every type of information should then later on in the portal be categorized as shown here. From the law itself there is a list of delivery points which I need to be fulfilled. And on the other hand there were generally geodata rather generic things such as geodata and then we had to decide what is meant by this and immediately insofar interesting when contracts are concerned from the city of Hamburg with interested parties with firms, externals within 30 days one should be guaranteed to have the option of counteracting a contract so that it can later on be published and have the ability to react. And this is most relevant with geodata. The searchability is interesting in terms of metadata and full text and metadata such as title or publication date and the goal here is to make things easily findable. And it's important that all the states of information have to be supported via revisioning so that we can show historical data from a year ago and we can see and we need to show 10 years of data so that the database does support this. So, starting from 2014 on for the next 10 years the machine readability default formats vendor independence are all basis for new apps or application die Daten quasi verwenden sollen das heißt das eine Zielgruppe should be the basis in case their use on the data provided. Die Anwendung schreiben und die anderen sind einfach Menschen und der Rest, das heißt, der Data und der Privacy und der Protection der Personal Data should be given to protect the person. In some way the authorities didn't do that before and so they had to develop the process how to do it. On the right side you can see in 3-4 Monaten die Datenbanken oder Liefersysteme digitaler Grünpark digitaler Grünpark digitaler Grünpark Fluglerndaten all those things that are listed they are all connected to all those things that are listed. Das heißt, es hat sich ich glaube, wir hatten teilweise so 90 Liefersysteme 90 different systems of delivery und now we have 16 Alres ist das dritte Alres, for example, da gibt es quasi ein Alres-System wo man Bezirke veröffentlicht werden und wo man über das Portal publishen kann was man in der Gruppe decides. So Alres ist interessant, Ratruten-Systeme. So, das ist interessant, das sind so die Datenbanken. Das sind separate Databases. Das nächste interessante ist der Hamburger Metadata-Catalog. Der ist da unter der Schülerstatistik. Es ist unter der Statistik der Pupils.  So, wir müssen das Data speichern. Und manche Autorität und manche Systeme, die das Data persistieren können und wir müssen diese Autorität und das das Data speichern können.      Ich habe auch das, was die Autorität speichert. endlich auch für mehrere steht, der übrigens jetzt MetaFair.de heißt Meta-Datenverbund. And there is now association of Meta-Data-Modelling, where there is a rename, which will be possible for other different Bundesländer to support their indexes and upload them, but that's top in the future. Wir haben ein Meta-Daten-Modell angelehnt an das Open-Data-Meta-Daten-Modell verwendet.  Da sind Open-Data-Categories, which we kept, and they are all structured, for example, traffic or a school. The main idea is to have one dataset and different resources. Wir wollten ein Web-Portal, where you could search through the datasets and as well an RP for the app, and an architecture, in which I will go into further now. The portal itself is seen right there, the search point transparent, the pages transparent point, the search page, which supports the different delivery systems. Ich habe hier sozusagen nach Transparenz-Portal, and I have searched here for the transparency portal, and we had 16 results there. So the priority portal itself has also information about itself and how it was built, for example the process of contract decision making. You can decide whether you like the look and feel or not, but it's a search page and on the right here you have the filters, as they are known, and here the Open-Data-Categories, which can be seen. And there is a detail view, which contains the primary mode of actually downloading the resources. In this case a PDF on the right. You also see a time-based information, an interessierenden Zeiten suchen, zum Beispiel. Advanced searches, which you can look for. And you can look at this, I will go further into the depth of, I said that a metadata model is based on Open-Data, on the right you have the RP field names, if you ask something through the RP, and on the left the German names for it, and the author is the authority that gave the information. The Informationsgegenstand is the groups, the Open-Data categories. The others belong to resources, which you can download. The offline date is the date when it's going to be republished, 10 years, a data set is supposed to stay in, and there are as well data sets, which are put in on free will, which can be deleted earlier as well. And that is the architecture, it looks really dramatical, really big bubbles, I'm going to go to the next picture, we have implemented the upper green thing, search, searching, harvesting, mapping, the delivery systems, don't belong to the metadata scheme, in the middle there's a full text analyze, we have done it with the tool, you might know it from the open data group, the green part take it from us, and especially the RP, the portal can be checked through the CCAN RP. CCAN is a comprehensive knowledge archive network for the Open-Data group with the Open-Python here, in the Solar Index, in governmental parts of British authorities, and CCAN delivers harvest possibilities, where we can download the metadata, to get the geodata on the tables, and reanalyse them with Apache TK tools, and the solar search itself delivers these filters, which we used to advance search. The website itself, Hamburg, the A, is the design, the CCAN as well has a UI, in which we had especially to fit to our metadata. We have built advanced things for CCAN, especially to be harvested at 1900 hours, and then we present at the right time and place, and the distributed running of these harvesters is efficient, because otherwise we had always had to wait for the slow system. Highlighting is not yet possible, so for example if I search something and the match might be coming from something in the abstract, or so, it's not visible yet why and when that is matched, but in the next version it will be supported by CCAN, that display of highlighting. And what we of course have is the harvester implementation, the API allows programmatic access to the portal, and can be downloaded into this web and URL, and reviewed. And the search, primary search is the package search, which allows search directly via the API. So it's also, for example, possible to set feeds and get notified about new items. So, if you want to use the API, I have listed it here as metadata package API, so this was CCAN at the bottom right, you can see the idea of provider data pod, which means what we call the central storage. And the literary export of the authorities is exported to the processing system. So when you are actually getting a record, you are retrieving it from central storage. So for a CCAN, the central storage is like another delivery system. And this is contained in this principle, and at any time we can rebuild the entire index as long as they are in the central storage, even if it's not in a persistent delivery system. Und hier unten ist das Rote. And at the bottom here, the red part is the new workflow for the authorities, the employees. Unter now in the authorities, you had a folder, which went into the archive, and now it's eine Checkbox, das in die Transparenz-Portale bewegt und dann eine weitere Metadata, die zu enthalten ist, und dann haben die Deletions einen Platz, und das ist ein Werkflug für jeder Employee in der Autorität, und dann ist das Werkflug verabschiedet. Für dieses Portal, ein wesentlicher Punkt ist Qualitätssicherung und das Main-Point ist Qualitätsassurance. Für das Beispiel, dass alles jetzt ein guter Titel ist und das ist der Job aller Employee und die Authors, und es braucht zu mir sicher, dass das Harvesting-Prozess korrekt für alle Sätze von Daten und Auserhalt durchführt und von den Autoritäten von internen und externen Daten.  Axel ist von der Firma, die wir aus jedem Axel bauen können, ein Zip-File, ein Zip-File. Also wenn du nicht Axel hast, könntest du es weiter erweitern. Wir wollen es mehr öffnen, dass es möglich ist, Feedback von Daten zu bekommen. Also wenn du das und das missstattest, solltest du das fragen. Automatische Metadata, das haben wir noch nicht, das wird in der nächsten Version. Es gibt noch etwas, das wir noch nicht gebaut haben, es gibt noch ein paar Synonyms, Open-Data, Gafdata, Community, We've got, we will advance those, there are other Terms, which are needed for mining data, if I want to have a summary of things, if you have 50 pages, you want to have a summary, so I want to have a certain information about a data set. And this topic advanced delivery systems, we will build it into the next data systems. So thank you for your attention, that was my part, thank you Lothar, wer Fragen hat, es gibt hier Mikrofonen. We have time for a Q&A session right now. Let's go to the microphones. Fangen wir gleich mit dem Nummer 2 an, ja, Mikrofon 2. Ich habe eine technische Frage, ich komme aus Baden-Württemberg, ich bin von Baden-Württemberg, red-green coalition, now works on an information freedom act, und nothing has happened and the interest is low, and in other federal counties, there is much happening. And the question is, are you in Hamburg just building this, working on this, or is this being looked at by other parties, other counties, and is this just proprietary to Hamburg and everywhere else, there is blocked. And the second question is, in the transparency law, you have the exceptions like trade secrets and external data. And in all these federal countries, the authorities try to block anything they can, whoever is in charge, how is it, so the question is, how is it in Hamburg, are the authorities different here, or are they the same blockades that are everywhere. So my first question is proprietary, please only do one question, I have added them together into one. So the first question already is posed in a way that, I mean, there are other countries that have interest in it, federal countries, so for example NRW is starting a new portal right now. So I see interest in our work proprietary, maybe especially because it's only about Hamburg, but from the reductional side, I mean, I don't think it could be used by other federal countries. And the other question was, some authorities do it, some authorities don't, but during our project, there was an extra teaching and multiplicators to try to change the behavior and change the thought, the idea how they are. Some stay how they are, and some have, also dieses Thema veröffentlichen ist ja auch was Neues und verteilweise auch Leute. So the topic publishing is a special one. We only have time for two more questions, and I am going to number three. So vielen Dank. Thank you very much. The parliamentary database really needs to be cleaned up. If somebody ever looked at the UI, it's death. I have some concerns regarding the decrease, which are confidential, and this will change in January, and we'll all run around with toilet brushes again through Hamburg. And the question here is if that would give problems within authorities in terms of publishing information in the reserve guard. And what in the last ten years I've read in the Hamburger Abendblatt is that references to the newspaper in 1980, and the problem is often that the resources there are only in scanned images instead of index data. Well, the ten years are only now for starting now, at some point this will then better, and it can now be harvested, the portal, and it's being done now. If you also harvest the resources, you could then keep those information. I can only say that something is missing, something is bad. Let us know. Okay, und dann kommen wir zur letzten Frage. So, the last question. Okay, everybody now. We are still at the last question. Let's bitte daher leise in den Raum kommen. Please be quiet. Die letzte Frage. The last question. Ja.  Auf welcher Entscheidungsebene in der Verwaltung solltet? The level of decision in the body is the one where decisions are making. Auf welcher Entscheidungsebene? Administrative level? Kann ich nichts so sagen? I can't say. We don't know. Das ist nicht für jede Behörde gleich. It's not the same for every authority. That's decided by every authority, if they have to publish data. Vielen, vielen Dank. Thank you very much. The possibility to give further questions after the talk, with the loader directly. Outside would be best, because the next talk is coming in. Thank you very much. And a warm applause for Lothar. Thank you.