My name is Jake Skuggs, and I'm going to talk a little bit about hotspots with metric foo. So, without further ado, I should probably explain what metric foo is. So, I don't know if you've used it or you haven't, but metric foo is a combination of a lot of metrics in one sort of gem. So, you can do code metrics about the health of your code, whether you have a lot of complexity, whether you have code coverage, whether you have code smells, and there's a bunch of different gems that will do that for you. And I kept having to rewrite rake tasks on every project I went to that would sort of collect all these metrics and put it into one nice report. And I thought, well, why not just turn that into a Rails plugin, and then later it became a Ruby gem. Some people think metric foo is only used on Rails projects. It actually can be used on Ruby projects, too. And it gets you a lot of stuff. So, I'm going to go pretty fast over the stuff it gets you, and then more in depth later. So, if you feel like you're falling behind, there will be explanations. So, you can get things like FLOG results. So, FLOG is code complexity analysis, and basically it tells you where you have high complexity. And we graph these things over time so you can see, hey, like my average complexity is going up, but we also graph, like, the top 5% of your most complex methods over time, which to me is much more indicative of how your project's doing, because average complexity is not going to change much day to day, but your worst methods, they tend to get a lot worse pretty quick if you don't keep an eye on them. You can do Archive. This is probably the most well-known metric, and one of the hardest to get running, but more on that later. Archive is code coverage. Yeah, more on this graph later.   Reek is one of many code smell detectors, and it discovers things like, hey, you have an uncommunicative name, or you have a long method, or you have some sort of other problem which tends to lead to badness, and we track those. Rails-backed practices as a code smell detector specifically focused on Rails. We don't run that if we're not in a Rails project, but if you are, we run this, and it'll tell you certain things about your Rails project that you probably shouldn't be doing. Flay is a structural duplication, so at its simplest, it's copy-paste detection, but it's so much more than that, because what you can do is find out if the code is very similar but written in a different way. So it sees through things like defined method, or depth, right, or curly braces versus due end, or even if you have a big chunk of code that's doing all the same things but the names are all different, it will detect that as similar code. So it's a very cool and sophisticated tool. Cycro is psychromatic complexity. Not pronounce, pronounce psychuru, it's pronounce psychro. It's a joke, like psychromatic complexity. Get it? And that is a number of paths through a given method, right? So if you have a psychromatic complexity of 10, there's 10 different ways to get through that method with all the ifs and the elses and the unless things that determine all your branching. We also do source control churn. So things that change a lot can indicate a problem. They can also not matter at all, but it's a nice thing to know about. And Rudy is yet one more code smell detector. Rudy's a little more trying to be definitive. So req will present things that may be a problem. Rudy is trying to present only things that definitely are a problem. So you won't see as many Rudy hits as you will see req hits. And that's by design. The two people who wrote it are sort of coming from different points. And so over the years, metric fruit went from being like three reports, maybe four reports, to being like eight, nine, ten reports. And that's a lot of data. And if you want to find bad places in your code, you have to kind of flip between all these reports and sort of go like, ooh, that one looked bad. Let's see how it scores on this other one. And that's just sort of terrible and hard to use. So from the beginning, what I thought would really be a cool thing in metric food is if you can combine all of these reports into one report, so it could tell you like, hey, this thing's bad for five different reasons. And then you could say, oh, wow, that's a really bad method. And then, oh, and it turns out it's totally uncovered by tests. That's one we should totally take a look at and destroy. So, in our hotspots. So now a little bit of a history lesson for you. A while back, the Devere guys tried to... Is anybody from Devere hanging out in the audience? Hey, is that Dan? Oh, hey, Dan. The Devere guys tried to commercialize metric food and they created this product called Caliper, which lived in the cloud and you could point it at a GitHub repository and it would run a bunch of static analysis stuff on your code base and it would tell you problems. And then they wrote this thing called hotspots, which could bind all of the things into one report, which was really cool. So that was nice and I was totally jealous. And unfortunately for them, but luckily for metric food, Caliper didn't succeed and I convinced them to donate the code to the community. So thank you. That was totally awesome. So we had to pull all this stuff in. But this, I mean, it sounds trivial, right? But here's something that you don't really realize. Like there's sort of like a lot of standards. The great thing about standards is there's so many to choose from. And this is one way you could represent any one of these methods. You could basically say Bar-Baz or Bar-Baz. Some metrics report this way if this is a class method, but some just report it always with a hash sign. Some metrics will keep a module that wraps around a class in the thing, but some metrics will not report the modules that wrap classes. So these could all be the same method. So what you have to do is find some way of sort of extracting out all the differences. And the other problem you have is file paths, right? It's not a particularly terrible problem, but different metrics report file paths in different ways. So the solution is the location class. So the location class is not polite at all. I just got a bug report about an hour ago that said, hey, dummy, I defined location in my project and you're overwriting that. So I should really probably, you know, scope that to metric food. So that's my fault. I'll fix that soon. But yeah, there could be problems. More on that later. So location is basically taking in file paths, class names and method names sort of stripping out all the differences so that you can say, hey, given this thing, give me back something that is, and I can now tell if it's the same as everything else. So it's defined sort of an equal here. And now I can say, oh, here I've got this class or method name. I'm going to give it to you and you tell me if it's the same as something else, which is pretty cool. And so we also defined the spaceship operator, which is nice. We have some stuff in here to strip out some module names just so we can be consistent. And so there's a fair amount of code now in metric food that basically just rips out stuff so that we can standardize file, class, and method names. So that's great. That's awesome. And it doesn't work at all for Archive because Archive has no concept of classes or methods. Archive just says this line was covered or this line wasn't covered, which is, you know, actually all you really need most times when you're running Archive, right? You just look through the report and you say, oh, these lines are covered and these lines aren't covered. But for my purposes, I really needed to get, I wanted like percent covered for a method. So I wanted to be able to say, hey, this method is 73% covered or this method is not covered at all, which is kind of a tricky thing. And so I stood on this one for a really long time and it turns out it was just like I just shouldn't have, I should have just started writing some code. I know we probably all have done this before. Like it seemed like an insurmountable problem. Like, wow, like, you know, like it opened up Archive and looked inside it and was like, maybe there's something hidden in there where I can, no, there's nothing in there that I can use. And I don't want to parse Ruby files just to get their line numbers. I mean, that sounds like a lot of trouble except that parse Ruby. Oh, wait, there's this thing called Ruby parser, right? And Ruby parser is actually like a really cool thing that you give it a bunch of Ruby and it can do some very cool stuff. It will do a whole bunch of stuff that I don't actually really need, but I'll tell you about it anyway. It gives you the abstract syntax tree of some given Ruby as nested s expressions. Now, I don't know if you know my history, but I used to be a high school physics teacher and I don't have a computer science background. So this was a little scary to me. Like, ooh, s expressions, that sounds fancy. So it turns out not so bad, right? When I first got into it, I went, oh, this is kind of like Lisp, which I don't know much about, but it was kind of interesting. And the cool thing is if you kind of dig around inside the guts of Ruby parser, it will tell you line numbers, which is awesome. Now, before I move on, I should also point out that Ruby parser is behind the scenes of almost all or a group percentage of the metrics provided by metric foo. Metric foo relies on things that try to find code complexity and code smells. And that's very hard to do if you have to parse a bunch of Ruby, but if you can use Ruby parser to look at the abstract syntax tree, it becomes much more easy. And so if you dig into the internals of a lot of those code smell detectors, you'll find Ruby parser in there. So, behold, the line number class. It turns out this is like you're going to laugh, because why did I spend so much time fearing this when this class is not very long? So literally all I do is I pass in the contents of a Ruby file. And this is super simplistic and maybe totally wrong, but it does work. So if it's a class that I do one thing, if it's a module, I do something else. There's sometimes a block when you're defining a couple of things in a file, so maybe you're defining two classes. Ruby parser will say, oh, I'll surround those two classes in what's called a block. And what we do is we process that stuff and we only expose two methods. One just says, hey, am I in a method for a given line number? So given line 23, is that in a method or is it outside a method? And then also, what is the method at that line number? And behind the scenes, what it's doing is it is building up a hash that has as its keys method names and as its values, range objects. And it turns out it's just pretty simple. You get the s expression that you want and you say s.line, and then if you say s.last.line, that's the last line number of the method, which is awesome. Defn would be a instance method and defs would be a class method. Now sometimes you have to get a little tricky because what you have is you're inside a class self block, right?  So you have to kind of like look for those things and search inside them. And then the problem I was having is that once I found them and then I went and looked for all the instance methods, I would find them again. So this is my super simple way to stop finding things. So what I do is after I've found something, I call hide methods from next round trying to be as intentional as possible, and I just replace all of these guides that I've already found and sort of marked off as maybe a class method or inside a module or whatever, and I put in ignore me, which means nothing in terms of an abstract syntax tree. It's just a way for me to ignore them the next time by moving through the abstract syntax tree. There possibly is a very better way to do this, but that was the way I figured out. So now we're in business, right? Because we've got all the things that we need. Our code stores has a way of outputting very detailed stuff, which we were already collecting in metric foo. So what we did is we store all the output of metric foo in case you don't know is serialized to YAML. So the cool thing about it is if you wanted to use the output of metric foo, you can. You can open up this object, load up the YAML.  This is inside the output of the Archive, and you can just sort of literally read the class here, and then right next to it is a was run true, right? This is not the output of Archive, but this is me taking the output of Archive and turning it into some YAML. And so I already had this data available. So now I can just loop over this thing, passing in this data to the line number generator, and then start gathering information for what was covered and what isn't on the method level. So all of a sudden, I can now pass this into the hotspot's magic rankifier. And the magic rankifier basically does something like this. It says, okay, I've got a maximum flog score across the whole app of 300, and I've got a minimum flog score of five. So we're just going to say five is the lowest and 300 is the highest, and we're going to define your rank based on where you are close to those two endpoints. And then it does that for Archive and it does that for Reek and Rudy. Now, Reek and Rudy, since those things are kind of like code smells, we just do sort of a cheat and we just count the number. So we just say like, oh, you have seven Reek problems or you have eight Rudy problems. And so now we can rank all these things, and now based on where your percentiles are and all of these various things, we can say, oh, you're 90th percentile bad, you're 85th percentile bad, and 100 percentile bad in these four, three, five, ten metrics. And so now we can rank all these guys versus each other, which is pretty cool. So now it's time for the live coding demo. So we're going to run metric foo on itself and see what happens. So here I am inside metric foo.  You can configure it, but I'm using pretty standard configurations here. So weeding for things to load up, spiking one of my cores. All right, so we're doing some parsing here. That is probably psychro. And now we're running some tests, which are actually specs, to get the Archive output. Generating some graphs. So I keep copies of all the previous runs for every day. So now that's how I graph that stuff over time. So I've serialized all the output, and I save it in various files, so then I can go back and mine all that stuff for things that you want. So here's the standard reports that you usually get with metric foo, and here's the brand new hotspots. So can you guys see this? Yeah, it looks pretty good. Yes, we can see it. So here is three categories. We look at files, classes, and methods. The first thing I did wrong, especially because the CSS sort of implies that, is I started reading left to right when I first looked at this. That is not the way to do this at all. Left to right has no meaning. It's up-down. My visualization skills... Actually, visualizations would be a really cool thing to do with all this data, and I just haven't done anything with that yet. So if you're interested, please submit. So you have methods here, and these are ranked from top to bottom, so worst things at the top. So you can see this guy is pretty brutal, right? Like a FLOG score 58.8, 58.4. Not terrible, but getting close to terrible. Cycro, 10, that's about five more than I usually like to have for a cyclomatic complexity in any method. And uncovered code 97.4%, that basically means it's completely uncovered, right? Because Ruby always evaluates the first line, the def, whatever.  So this guy is completely uncovered, and seven code smells from REEK. Now, this is the delicious, delicious irony of Metric Foo at this point, because the hotspots inside Metric Foo are the hotspot code, which is pretty cool, or horrible, I don't know. Anyway, but if you look through here, like Metric Analyzer, that's hotspot. Let's see, Metric Analyzer, yep. Location, oh yeah, I just showed you that guy. He's not really covered, he's got some problems. This is kind of weird, like what the hell does it mean to say you have 3.7 paths through something? That's an average, right? So for a file, we're going to take whatever methods we have in there and do some averaging. So you can get some sort of nonsensical numbers sometimes. So here's some more Metric Analyzer stuff. Awesome template apparently has some problems, not so awesome. And so on and so forth. So let's take a little bit of a tour through the rest of this stuff. We've got all these things that we can show. Churn is pretty cool. You can see which things have changed all the time. Things don't change too... What you're looking for in churn is you're looking for things that change way out of proportion to everything else. So if you have one file that changes 100 times over the last 3 months and every other file has only changed like 10 times, that's a file that needs to change no matter what you do. And that is some sort of object that has its fingers in way too many things and you need to keep an eye on that object. Flay structural duplication has gone up lately. So we're back to this graph which I said I would discuss later and now is the time. So as an open source maintainer you often have this dilemma where somebody will present you with a pile of code that does something really cool and yet it's not covered at all. And normally the right path is just to throw it back and say no. But guess what? Sometimes it's so cool you just take it in anyway. And that's what I did at least twice now in Metric Foods history. The first time was when we serialized the ammo output. There was some wonderful work done but it wasn't tested much at all. And so I brought it in and then I sort of like slowly over the time sort of got it back up to like 91% coverage. And then I took in the hotspot stuff and I feel like I'm bashing on hotspots guys who gave me this wonderful gift so don't read it that way. But I just have to go back now and sort of do some testing of that stuff which is fine. So what? We have a test. We'll give you the test. You have a test? Why didn't you tell me this? That's awesome. Alright that's great. Okay cool. Because I totally pulled that in going like okay I'm just committing to it. I'll write some tests for that. It'll happen. So cool. That's coming soon. I didn't plan that at all. Okay so yeah. So Rik and Rudy and Real's best practices they're all code smell things. I'm going to talk about that more in a little while. Alright so back to the presentation. So let's make an important point here that a lot of times when you come to these conferences people stand up here on stage and tell you how to do things and you can get the impression that we're all sort of perfect right? But I'm just some dude right? Like I kind of write some code and oftentimes I make a mess. And the important thing about making a mess is that you're probably going to do it no matter what you do. There will always be time constraints there will always be new people on your team there will always be consultants there will always be things that you can blame for your mess but it's probably your fault. Don't ignore them or hide them just clean them up and that's sort of the big point of metric foo is everybody on every project always feels like oh man the code's kind of a mess and then when you ask everybody like what you should fix first nobody agrees and that was sort of the point of metric foo was to help solve that problem like what's the worst thing let's shoot the first charging buffalo first right? You know like we may get trampled but we're going to take a few guys out we're going to live a little longer and it's going to be alright. Now it works. Anyway moving on. So problems with metric foo other than the ones I just showed you.  What? Gem sets. Oh god I love gem sets so yeah I just created a new gem set did a fresh install of metric foo and I got all these things notice we got a hole in here somebody doesn't understand development dependencies but that's okay because I just learned about it recently too so any change to any one of these gems especially in how they output can break metric foo because metric foo literally shells out to the command line and calls things like reek like we recently have tried to move away from that like there was a big refactor so we don't call flog from the command line anymore we call flog programmatically and I'd like to do that more often in metric foo to kind of avoid these problems of oh they added an extra space to the output of flog and now everything's busted like damn it so yeah there's a lot of regex parsing in metric foo which I would like to go away some time and then there's the classic things there's different rails versions different Ruby versions but the biggest problem and something if you're having problems with metric foo getting it running like I suggest turning off archive because metric foo just shells out to the command line and runs archive on all your tests or specs and most people never run their tests that way right like you probably have like some reek test that you call and it may or may not set things up for your test suite it may do certain various things you may have some tricky things that happen in your test suite or you might have some order dependent problems that you don't know about in your test suite so when the tests are running in different order they blow up so a lot of problems at running metric foo can be traced back to archive because archive is the only real dynamic processing we do in metric foo everything else is static analysis in other words meaning that we look at the code and just do some sort of static look at it where archive actually tries to execute not only your tests but all of the code that your test covers so that can be difficult so now because Prezi doesn't really do copy-paste super well I'm gonna have to switch over to another presentation okay so now what so we've gotten to the point where we've sort of found out that there's problems we knew there were problems what should we do with all this information so if you're like most developers probably not a lot right like you find out there's a problem you feel kind of bad about it you don't like feeling bad about things so you stop thinking about it and that is it's very common and I do it all the time but the point of it is to sort of keep reminding you right like hey there's these bad things out there so try not to be a bad developer oh I should explain these photos who can you read that I went to Japan recently for Rui Kaiji which was awesome name drop and they have all these wonderful English translations that don't quite work in Japan and I just took a lot of photos of them so yes it is a lot to process so let's start easy Flay is one of the easier things to understand it's copy paste detection but also structural duplication so we're violating dry don't repeat yourself and the solution is not real hard it's just playing around with extract method you know there can be other things but these really small steps can really help later on when you need to add functionality if everything's sort of defined into chunks that have a single responsibility but when you're interacting and adding new features you don't even realize how much easier it is until you went hey that feature wasn't hard at all single responsibility principle is sort of this concept that when I was like a physics teacher who was just an apprentice at Object Mentor and they were telling me about this it just didn't make a lot of sense to me I was like okay it should only do one thing but there's like five lines in there they're all doing different things but as I matured as a programmer it becomes more and more interesting to me the idea that like a method should just try and do one thing a class should just try and do one thing an entire project should just try and do one thing it can be applied at many different levels that's sort of the idea of having many different services if you're having a big team that has a lot of problems getting along you can break your project up into different services that try to do just one thing the one thing definition can be tricky but that's where the architecture hard part of software comes in you have to sort of decide what you want things to do so let me give you an example of this so I used to work on a project that had a lot to do with phone numbers and at some point we realized like we were doing all this phone number stuff in various different places so we would get like a phone number and then we'd start doing some regex stuff to get things like area code prefix, line number, extension and all that stuff and you know obviously this is duplication so this is like instead of like pulling stuff out or creating private methods it was actually just a missing object that we were missing there really need to be a phone number object that could do stuff with phone numbers so that was a nice little refactoring that sort of saved us a lot of duplication let us move on to churn so churn is this thing where you figure out like things that change the most and what others people about churn a lot is that sometimes it means nothing oh this file has changed a lot it's a CSS file maybe it's supposed to change a lot I still think it's actually kind of a code smell if you have like 10 CSS files and only one ever changes I don't know if you're really dividing up your CSS the way it really should be divided up but like I said it can indicate God objects an object that has its fingers the objects and the internals of them because then if the internals of another object has to change then it has to change so if you know you see something that has high churn it better be a good method and it better be well tested why? because everybody's in there all the time including your worst developers but of course you don't have bad developers on your team but seriously people inside a thing all the time if it's complex and it's changing a lot because complexity can hide bugs and if it's moving all the time you're just waiting for problems to happen okay moving on code coverage a lot of times out here developers say something like hey we should just have a week to write a bunch of tests and I just kind of cringe when I hear that I like the idea of people writing tests but I get a little worried when people are going to write tests for a week because I can consider that people are going to be writing tests for things that they don't really understand right if you're writing a bunch of unit tests for something and you don't really get it you might just be locking in a bug so you look at the thing and you go okay when I put in the numbers 2 and 2 it outputs 5 cool well I'll just lock that in with a test but maybe it was supposed to add those two numbers together and the output was wrong so if you're doing code coverage make sure that you kind of understand it when you're inside something and you're sort of moving around the code base and you come across something that isn't covered now is the time to cover it because like oh I have to change this thing now would be a good time for me to really figure it out and the best way to really figure something out is to write a bunch of tests for it the worst way to figure something out is to write one kind of wrapper test for one method if you don't you just kind of look at the output and then just sort of go okay well let's just freeze that into a test and they're actually harmful tested you know are bad and should be removed so warning vlog and psychro okay so they're both different ways of measuring code complexity vlog is sort of like a super set of psychro because vlog includes branching psychro psychro is just cyclomatic complexity will pass through a method vlog uses ABC metric which is assigns branches and calls so when you look at the output of vlog you'll see you get some points for every time you make an assignment every time you do some branching and every time you make a call to a guy and this would be super simple completely unauthorized guide to vlog scores basically my feeling on is below 20 and you're probably okay you're getting to a gray area here this could be trouble and above 60 you're just bad right and now you might say I don't know what's the 60 commonly it's not uncommon to have like hundreds and two hundreds and three hundreds if you're running vlog on a code base so anything above 60 though I'm gonna claim that you can probably fix this hey it's Ryan Davis it's Ryan in the audience hey Ryan so I should mention that like much of you really wouldn't exist without Ryan Davis right like I'm gonna go vlog it in a flay but also re-parcer which is behind the scenes of a lot of the things that mesh food pens upon and this is a wonderful photo from Aaron you're right over there right okay there's a great story behind this you should track him down to get this story I'm gonna move on so how do you fix this mostly extract method missing object and if that doesn't work it's now time to sort of roll up your sleeves and re-architect and you know I'm sorry about that I'm sorry to be the bearer of bad news but you really shouldn't have to have hugely complex methods in your app if you do there's probably something you're sort of doing wrong it's really time to sort of take a look at things and say like is this architecture something that worked in the past but now the metaphor of the application has changed and it no longer really applies alright so here's a more interesting flaws in the code that I work in multi-site help work in knit it was the worst method we're at so let's take a look at this so I work in backstop solutions we write a framework for creating websites for hedge funds and for the people who use them and the thing about hedge funds is they're they all want to look like their own thing so we basically serve up a bunch of different domains and everybody like blopartners.com wants to have two sites sort of a private site where they can edit things and then a public site where their customers can see reports on how their hedge fund is doing so I looked into this thing and I was like what is this this is horrible like just doing so much and all sort of low level stuff and if you look at this like all this YAML stuff and so after digging through this a little bit I realized like so we have all this configuration some of which is global which has to do with the suffix they want to apply right do you want to call it public.blopartners.com and private.blopartners.com no of course that's too simple they want to have something like superawesomeinvestments.blopartners.com and so we roll through this and we do a lot of merging so the first thing I did I'm going to talk about later sorry by the way the method goes on this has a block score of 169 that's brutal also look here seriously when the person was writing this did they not notice this I don't know anyway there's a refactoring opportunity right there so like I said the first thing I did was I pulled out this merge life cycle YAML into sites configuration method because basically all it was doing is taking some YAML guys and looking at their keys and sort of doing a merge so that sort of broke out a lot of stuff right here and what I'm trying to do this thing that Glenn Vandenberg sort of talked to me about this Loan Star recon a few years ago he was talking about sort of like uniformity of methods but basically the idea was that you want to have some methods that are sort of like directors and they make calls off to other methods and then you want to have some methods that basically do the low level work and so this was my attempt my first pass at sort of doing that I wanted to have this guy be sort of the high level method that says you go do this so you can kind of read through it and have a high level idea of what it does and so this was the most obvious refactoring set up private URLs and public URLs are basically the same thing they just have this difference in visibility one is private and one is public so I could pull that out into one thing and then I just pass it in visibility and then I can do some switching on that and that was pretty straightforward and then just a couple of other things that I noticed were like oh this is one section of the code I don't just pull this out and make it its own method now the interesting thing you can have here is that oftentimes when you do the refactoring if you add up all the FLOG scores it will actually be more than the original app and that doesn't mean you've done a bad thing because overall complexity for an entire application is not a bad thing because as an app it's going to do more it's going to do more complex what I'm really worried about is complexity per method so I've sort of gotten this down now this is by no means done this is at the refactor stage and we're actually just having a discussion about this earlier in the week because to get this down to be not horrible because if you look at this right now you have no idea what it does still we need to start actually doing some sort of re-architecture and that's a little more difficult so out of the scope of this presentation okay so Reek, Rudy and Real's best practices all these guys are supposed to look for design problems which is really cool because if it says you have feature envy and you don't know what feature envy is you can go look it up and then you say oh wow I'm calling this other thing more than I'm calling myself that means maybe the method should be the other thing instead of where it is and that's nice but the problem is keep in mind this is a machine trying to tell you a human problem right like all of these problems that we're talking about are problems for humans the machine can execute it just fine so when it says like hey you're in a controller and you're calling params an awful lot this method called params maybe you just go well yeah but I'm in a controller and calling params is probably something that's okay to do in a controller so you have to take these things with a grain of salt this is advice this is not the end all end all like I said in this slide it's up to you and your team to establish conventions and sort of stick to them I don't really care what the conventions are just establish them and stick to them sort of have rules about what the maximum number of lines you're going to have if you're going to tolerate for a method or how much complexity is too much complexity and what sort of code coverage you're aiming for so resources for metric foo so metric foo is at metric-foo at rubyforge.com it has a bunch of links to all the things you could possibly need if you want to contribute or just use metric foo and that's about it I would like to thank Backstop Solutions for donating a couple of days of my time to metric foo so they were very nice and gave me a couple of days last week to look at and sort of get metric foo all shaped up and ready for its 2.0 release so the 2.0 release was released yesterday like I said we already have some bug reports out on it so feel free to download it and try it it is a .0 release in the truest sense of the word I pulled in a bunch of stuff that was new it does some really cool things it works on all of my projects so I'm sure it'll work on yours Questions? Yes So I did just yesterday no two days ago I'm losing track of time two days ago I did a gemstone rails 3 I created a delete me project I wrote a couple of tests inside there and ran metric foo on it without too much difficulty there is some notes on the metric foo main page about what you want to do if you're inside rails 3 but I think most of those problems were the differences between active support the past and active support and the present active support right now you're supposed to require the just the things you need instead of just requiring active support which is very cool It worked for me for a pretty simple rails app using both RSpec and test unit so I think it's working obviously have a good time with that and let me know if it isn't Yes So one place that we extend our RSpec to have a nice impact I'll also have to Yeah keep in mind Ruby parser is pretty complicated right and it's trying to do a pretty ambitious thing so sometimes it can get confused in especially when you're moving between different rubies Other questions Yes so the question is What metrics would cover performance bottlenecks None It's not the point of metric foo I guess it could be at some point but I mean I guess you could make sort of grandiose claims like oh more complex methods or longer methods but really nowhere in here are we looking at something specifically in terms of performance So that's what you're looking for I don't have anything for you Alright well thanks a lot Thanks for attending and enjoy the rest of RubyCon


Okay, don't skip this advert if you recognize me and to be honest even if you don't recognize me you should probably watch this I'm not actually advertising a product here. I'm just saying I want to give you something for free I won't keep up too much of your time All I'm gonna say is if you're trying to learn how to lose a dream that is to control your dreams to be aware of the fact you're dreaming For whatever reason, you know, maybe you're trying to overcome nightmares Maybe you're trying to learn how to fly or even just experience your fantasies There are certain things and techniques that will work and there are other things which will just waste your time And it's really important especially if you're looking on YouTube for answers and you're looking for methods and techniques You can spend hours watching these sorts of videos without really learning anything and without really getting any sort of technique that you can practically apply So what I propose to you is this I've been teaching lucid dreaming for about eight to nine years now I've got various books on the subject But what I really want to do today is I just want to give you free tips and advice on lucid dreaming And the best way I've found of doing that is just to send you an email every couple of days for the next few weeks And in each of these emails, I'm gonna send you there's gonna be a detailed guide on lucid dreaming It's gonna tell you like how to do a particular technique or it's gonna tell you how to do a particular Meditation and all these things when you piece them together if you follow these lesson you will be able to lucid dream very very soon Okay, and not only that but if you stick with it till the end I will offer you a very special deal on a lucid dreaming course Which you probably won't find anywhere else even if you don't want that Please go and sign up for these free email lessons on lucid dreaming and find those out how to lucid calm forward slash sign up Or just click on this advert click anywhere on the screen here click on this question mark if you fancy it And I'll see you on the other side. I'll send you these detailed and very effective lucid dreaming lessons


Everybody forced here ripping a box of 2022 certified football hobby for Richard P. Thanks Richard and good luck on the rip here Gold team Kirk Cousins Gold team gold Russell Wilson Nice card nine out of 25 David O'Jabba rookie number three out of 75 on the blue Deandre Swift seal of approval Milish Jones jr. On the rookie jersey 74 out of 249 Garrett Wilson rookie graffiti Aidan Hutchinson on the freshman fabric 156 of 199 three-color patch as well Nice hit Richard on the Aidan Hutchinson dark horses Giovante a tight Chandler rookie numbered 238 of 325 DJ Moore numbered 138 of 149 certified stars Jonathan Taylor Gold team Matt Ryan They say it was benched for the season, which is an insane thing Rookie auto-cade otten to a five. He's been doing pretty well. Actually. He's like Brady's go-to tight end there Nice otten auto to a five gold team 203 of 249 Matthew Stafford good box Isis Spiller rookie Jersey 225 of 399 Deandre Hopkins seal of approval Travis Kelsey 133 of 275 God graffiti trail on Berks And Kyler Gordon pink rookie 170 of 199 There we go. Thanks again Richard. We will get these cards out to ya shortly


Welcome to Free Thoughts from Libertarianism.org and the Cato Institute. I'm Trevor Burrus, a research fellow at the Cato Institute's Center for Constitutional Studies. I'm Aaron Ross Powell, editor of Libertarianism.org and a research fellow here at the Cato Institute. Joining us is Bernard B. Carrick. Mr. Carrick was appointed the 40th Police Commissioner of New York City by Mayor Rudy Giuliani on August 21, 2000. Prior to his appointment, Carrick was Commissioner of the Department of Corrections. He served with the New York Police Department on both uniformed and plainclothes duty for eight years and was awarded the prestigious Medal of Valor among many other awards. His stewardship of the department in the aftermath of 9-11 brought him national attention. He is the author of the new book From Jailer to Jailed. Welcome to Free Thoughts. Thank you. You have one of the most fascinating and illustrious careers of anyone I've ever met.  Right. So I'd like to start where you start your book, which is on the ninth floor of the Special Housing Unit of the Metropolitan Correction Center in Lower Manhattan just a few years ago. Why were you there? I was actually being housed in the Federal Bureau of Prisons Special Housing Unit in MCC. I was a federal prisoner at the time. In 2004, after being nominated by President George W. Bush for the Department of Homeland Security as Secretary, I withdrew my name from consideration and because I had a nanny that I did not pay tax on. Ultimately, that led to me pleading guilty in 2009 to eight felony counts, which included full statements and tax charges relating to my children's nanny and some apartment renovations I had done. And I was sentenced to three years in prison, four years in prison. I did three, three years and 11 days. I was actually housed in a minimum security camp, but at some point in time I was brought back up to New York as a state witness and I was placed in solitary confinement for 60 days exactly. And that's where the book starts out. And it was during that 60-day period that I realized solitary confinement is a mind-altering, if you will, experience. You hallucinate. You talk to yourself.  You're locked down 24 hours a day. I was let out of my cell three times a week for a shower for about 45 minutes to an hour. No phone calls, one phone call a month, a 15-minute phone call, and no communications with the outside world. So it makes you insane basically. How or I guess why do people end up in solitary? Because we've heard these horror stories about it, but is it something where typically people are put into it to protect others? Is it really bad people who are violent or is it more of like a retribution or punishment? Like you've done something and we want to hurt you really bad. Well, here's the thing. I mean, there's a use for solitary confinement. As somebody that ran Rikers Island, I ran Rikers Island in the New York City jail system for six years and basically took it from one of the worst prison systems in this nation, one of the most violent and mismanaged to an international model for efficiency and safety. I can tell you there's a use for solitary.  Unfortunately, in our country, we've digressed from that and we use solitary confinement for protective custody. That was the excuse that I was given as to why I was placed in solitary. There's administrative segregation. There are low-level housing units that you could go into, but in my case, they stuck me in solitary. We take young kids. We put them in solitary confinement for institutional infractions. Like I said, solitary is a mind-altering experience.  There's a place for it. There's a purpose for it, but it should be monitored. There should be legislation to ensure that it's not abused because the ironic thing is you have correctional staff that man the gates of our prisons and jails all over this country that do a tremendous job. They have a dangerous job. They have a job that's pretty much thankless. For the most part, most of them do their job the way they're supposed to do it, but there are people out there that believe that it's their job to impose punishment on you. Your punishment in reality is the deprivation of freedom.  The use of solitary confinement, in many cases, is one of the ways they do that. Isn't that though part of the attitude of putting people into prison as part of it to demean them and degrade them and take away more than just their freedom? Because otherwise we could – I mean, the environment, prison is not, aside from the absence of freedom, it's also not the greatest environment. It's not pretty. The food's not good. We could list all of these things – I mean, even minor things compared to the really awful stuff that goes on. And so if the only punishment that we are giving people is the loss of freedom, then why put them in prison as opposed to somewhere really posh and nice with video games and entertainment? Well, here's the way I've tried to explain it. Unless you're an institutionalized animal, the deprivation of freedom is far more profound than anything you could imagine. You know, people have said to me, well, you were in a minimum security camp and a minimum security camp is considered a country club. It's considered club-fed, some people have said. Well, that is true. That may be true if you're somebody that's been institutionalized, but I could assure you somebody that's never been in prison before going into a minimum security camp is not the country club you would expect. And what I've told – I once told this to a room full of reporters. If you think it's that posh and you think it's that much of a country club, then pick out one of the best hotels in New York City – Four Seasons, The Ritz, whatever – go down to that Four Seasons. And I can assure you that the bathroom is bigger than the cubicle I lived in. My cubicle was about 12 by 8. Go into that bathroom that is made of pure granite and marble and has all the luxuries of modern-day. Lock the door, come out in a year, and tell me how posh it was. How great it was. Tell me what you think of it then, because I can assure you the deprivation of freedom is far, far more profound than anything you can imagine, especially if you have children, especially if you have family, if you have things you're concerned with on the outside. I've tried to explain to people, and an inmate once told me this, and I would have never understood it before going into prison. Prison is like dying with your eyes open. That's what it's like. Your whole world goes on without you in it, and there ain't a damn thing you can do about it. The good, the bad, the ugly, no matter what it is. That's what prison is like. Now, and from jailer to jailed, which the title explains that exactly, and as you mentioned, you were, what would be the title? Running Rikers. I was the Correction Commissioner from New York City before I was the Police Commissioner.  I mean, I'm sure it changed a lot, but did you think it was worse after you went through it or did you see how bad it was when you were at Rikers? What was the biggest surprise? Well, there's a difference between what I did at Rikers and a prison system. Rikers Island is a jail system. My average length of stay at Rikers was about 45 to 54 days. I had 133,000 inmate admissions per year. When I took over the department, we averaged 150 stabbings and slashings per month. 150? Wow. 150 stabbings and slashings per month. On the month I became Police Commissioner with one. So I reduced stabbings and slashings inmate on inmate violence by about 93% and created a number of other efficiencies that basically turned it into an international model for efficiency and safety. Just quickly, that's such an enormous difference. Presumably people are encouraging slashings and stabbings before that. How do you cut it from 150 to 1? Basically, there was a program. I don't know if you guys are familiar with the ComStat program on how crime was monitored and addressed in New York City. I created the same sort of program on overseeing the agency. And basically what that is, is daily data collection on addressing hot button issues such as violence, slashings, stabbings, assaults, inmate on inmate assaults, staff assaults, staff abuse, things like that. Instead of looking at that stuff quarterly or biannually the way it used to be looked at, I looked at it daily. So I address the issues daily. That's number one. Number two, removing the weapons. Getting the weapons out of the facilities. More searches. Searches of visitors coming into the institutions. Preventing the contraband from coming in. With the more searches exacerbate the interactions between correctional officers and the inmates which can lead to violence and that seems to be... And that's a really good point because some correction administrators will tell you that. It's all about first line supervision. You're going to have more contacts between the inmates and staff with more searches. If you have the right supervision, you have the right oversight, you have the right people, you have everything is videoed and that's what we did, then you don't have those incidents. You don't have those problems. In fact, the confrontations between staff and inmates reduced, was reduced during this time. But the other thing I did that historically had not been done and this came to light when I first took over as the first deputy commissioner, I once had a... I had two inmates that held a guy down on the ground and they took a turkey bone or a chicken bone and they carved LK into his back for Latin King. Like 180 stitches. And I asked one of my guys at the time, what happens to this guy? You know, what do we charge him with? And they basically looked at me and said, well, he doesn't get charged. See, he goes to special housing.  They said, well, the prosecutors look at it like this is jail. That's what happens in jail.  That's an assault. Outside the facility, if I nicked you with a razor blade, it would be an assault with a deadly weapon. You know, it would be all these charges. But inside a jail, you let them do what they want. Jail and prison cannot be a safe haven for criminal activity. You can't. So we started instituting charges, internal charges on guys that committed crimes within the system. If you cut somebody, if you assault them, you're charged. If you burn down a cell or light somebody on fire, you get charged with a crime. That immediately, immediately dropped inmate on inmate violence by 40%. Right out of the box. It's so simple. It's just crazy. But you know what, Trevor, it's simple stuff that historically was overlooked with the mindset that that's the way we've always done it. You know, that's the way we do it. That's the way it's always been. So nobody changes it. And if you look at the other things that we did within the system, you know, why does it take an inmate six hours to see a physician? Wow. Six hours. It used to take to have an inmate in the New York City Department of Correction to see a physician. One, the inmate puts in a notice 24 hours in advance. It's not like you don't know they're going. You don't know, it's not like you don't know how many inmates are going to be seeing the doctors the next morning in that facility. You know. So why do you have an inmate moved out of his housing area, taken to a place who sits around for six hours in most likely an unsecure or less secure spot waiting to see a doctor that he could see in 30 to 45 minutes if the movement was done correctly? Well, we changed that. How many hours it took for attorneys to see, and you can't, six hours, four hours for an attorney to come see a client on Rikers, which I thought was atrocious, considering that attorney's getting paid by the hours. That's what I was saying. They're getting paid the whole time for reading a magazine or whatever. And I'll tell you, and this goes to, this is sort of accountability one-on-one and this is, you know, you said it seemed so simplistic. I put up signs in all the visit rooms for the attorneys.  That number was the cell phone from my chief of staff. Well, I can promise you that only happened once or twice after. And then it's over. Then the inmates see their client, see their attorneys within 45 minutes and there's no problem. It's all about accountability. And if there's not leadership and accountability, you're going to have all this other stuff that creates problems within the system. What's the reaction from the staff to these reforms? I have to, when it first started, there was, you know, there was outcries, especially the unions, you know. I have a question here about the unions. Any change in a system, in a big system like that, any major change, the unions are going to have an issue with it. Okay. It's going to hurt my guys. It's going to impact them. It's, you know, they're going to be punished. The bottom line is, and if you go back and you look in 1990, 60 minutes in Mike Wallace, they did a full blowout feature of Rikers as being one of the worst, most violent jail systems in the nation. In 1998, Mike Wallace, in 60 minutes, the same exact team came back into Rikers when it was under my command. And the reason he came back is he saw an article in The New York Times and he called me and said he didn't believe it. He did not believe the article that said Rikers was a completely different environment. Rikers had been tamed, so to speak. Mike Wallace says, I want to look at. I want to see. And he went back in and he actually talked to staff. And ironically, he also talked to inmates that had been in the system then. And both the inmates and the staff said the exact same thing. It's safer. It's cleaner. Everything is better than it was. And we benefit from those changes. And that was inmates and staff alike. So at the end of the day, when you have change in a big organization like that, you're going to have outcries, especially from the union. But it's to their benefit that those changes are made. And once they understand that, once they see it, today, Rikers Island has 10,000 to 12,000 less inmates than I had on a daily basis.  And all the COs that were there under my command. The CO is correction officer. They're all begging me to come back. So it was to their benefit. It's interesting exposing these two sides. And that's one reason I'm really happy you're here on the show, because the prison seems like a black box to a lot of people. We don't even want to think about it. And there's a lot of things you can just... Something we like watching TV shows. Yeah, exactly. We like watching TV shows and everything. But there's a lot of, you know, out of sight, out of mind, seems to be a big part of this. And you've seen both sides of it. And a lot of these reforms see very, very commonsensical, that you can just accountability, just charging people with crimes, having accountability of correction officers. Another thing you talk about in your book is having the correction officers treat prisoners with respect, which I think is very important. Can you talk a little bit about that? It's sort of like I said before. You know, the punishment is the deprivation of freedom. The punishment is being away from your family. The punishment is the lack of employment. The punishment is a number of things.  And you have staff, for the most part, that do their job. It's, you know, like I said, a very dangerous job at times. But you also have staff out there that they feel that's something in them that thinks, you know, they feel that it's their job to impose punishment.  And this goes back to accountability. How do you get that to change? It's a question. It's all about first-line supervision. So, you know, every CO, you know, depending on your housing area where you work, you have a first-line supervisor, whether it's the federal system or a state system. And it's those first-line supervisors that oversee the people under them, the squad of correction officers or a platoon of correction officers, however number-many that is. It's their job to oversee them. And if the warden's doing his job, and I say the warden specifically because when I took over Rikers, I remember walking as the first Deputy Commissioner around Rikers Island and going through a housing area with a warden who the inmates in that housing area had never seen before. Now, I went up to an inmate and I asked him, how long have you been in the facility? I've been here four months. You've been here four months. And you don't know who that guy is. The guy with the white shirt and the stars right there. You don't know who that is? No. Well, that afternoon that warden was transferred. He was gone. You mean to tell me for four months that inmate never saw you pass this housing area? And believe me, if they did, you would know. So the bottom line is, if the warden's not making his rounds, if the first-line supervisors, if the Deputy Wardens aren't walking those facilities to see what the problematic issues are, well, then things like that are going to happen. And you're going to have COs that abuse their authority, that do things they shouldn't do, that create conflict, and many times create violence. So you have to have supervision. You have to have accountability. And I talk a little bit about how the... I don't like using the word cough gas too much, but it definitely fits your situation about how you found yourself in prison because someone's probably listening to this and saying, oh, I've heard of this guy. He's a corrupt guy. He's now a convicted felon and all this stuff. And it's not so much a matter of guilt and innocence. I think when you found yourself on the... wrapped around prosecutors and your own attorneys, it's not so much guilt and innocence anymore. It's whether or not you can maintain a staring contest with the government. And they have way more resources. All right. Let me talk about the staring contest. First of all, if you're indicted by the federal government, that indictment says the United States of America versus whoever your name... whatever your name is, I promise you, it's the United States of America. It's the whole United States of America. It's the prosecutor's office. It's all their attorneys. It's every agency... any agency they want involved, it's everybody and it's everything and it's all their money. And I really don't care who you are, unless you're Warren Buffett, Gates, Carlos Slimmer, a couple other guys I know that have wealth in the billions, there's not much you can do to fight the American government. There's passages in my book that I talk about this. And the one thing that I concluded and I believe in strongly is that you as an American citizen don't have the actual constitutional rights you think you have if you don't have the money to pay for them. And I will tell you, I was the more fortunate of many that I had money. But even then, and I'll give you an example, on a monthly basis I was billed between $100,000 to $150,000 to $200,000 a month for 18 to 20 months. In October of 2009, one month, a 30-day period, my legal bill for that 30-day period was $176,000. How long can you last? So the staring contest doesn't last that long. At some point it's more or less a business decision, whether you're going to keep trying to go forward and survive. And you can't, you just can't. They have all the cards. Well, and then to get back to my charges, specific charges, people just, you know, they hear about the case that he was charged with corruption. Well, one, I wasn't convicted of corruption. There was no corruption. There was false statements and tax charges. The false statements, I was not under oath, as I've heard many say, you know, he lied under oath. No, I did not. I didn't lie under oath. It was a false statement made on applications for a vetting process. For the secretary? The secretary and for a committee. It wasn't even the secretary. One of them was for a committee. That being said, my charges initially started with an ethics violation in the Bronx. The ethics violation, it was a 18 month grand jury investigation, 18 months that resulted in two ethics charges. One, I didn't put something on a financial disclosure. And two, that I accepted apartment renovations and I accepted a gift in the form of apartment renovations from a contractor attempting to do business with the city. The Bronx grand jury concluded their investigation with those two charges. The Bronx DA admitted and told the judge in court there was no quid pro quo between me and the contractor. Yeah, it was all news to you as you were talking about. There was no corruption. Immediately after I pled guilty to those two things I had $221,000 fine. Then the federal government came in and charged me all over again with the same, on the same issue. So because you said the G word, you said gift in your plead, right? Right. And that's, that was the thing. The government used my plea, the words in my plea against me to start a new investigation. I'm not saying I did nothing wrong. I'm not saying I'm not saying anything that I pled guilty to was wrong. Here's what I have a problem with. There isn't one thing I was charged with and pled guilty to that couldn't have been handled civilly or ethically. In fact, it already was. It was handled ethically by the state. And for those that have any doubts, most of my charges related to my tax stuff around my children's nanny. Okay. But at the same exact time that I was actually being prosecuted and investigated, Timothy Geithner was being confirmed by the United States Senate for the position of Treasury Secretary after he admitted that he didn't pay tax for like two or three years. Tom Daschle was up for Secretary under President Obama $180,000 in tax issues that he had over a period for a car and drivers. You had Zoe Baird President Clinton's Attorney General nominee Kimba Wood Clinton's Attorney General nominee all of them and specifically those nanny issues just like mine. There was no grand jury investigation. There was no investigation period. There was nothing. So anybody that believes or thinks that there aren't selective and political prosecutions you got to be pretty naive. So why you? I mean what why would they come after you and not those other people? Well I think at the time and I talk about this in the book I think at the time Rudy Giuliani was my friend, my partner somebody I worked with for eight years. In 2006 he announced he was running for president. He started his PAC made his announcement and from that point forward you know he was on a roll. If you go back in time you look at every single article that I was in he was mentioned. If you look at every article about him in his campaign I was in it. So there was this constant political driving force to besmirch him or dirty him up as a result of me and I think that had a lot to do with it. And then your the whole story gets kind of bizarre too because as you say the prosecutors here I always have this question about federal prosecutors and I want to ask you some later questions about some of the people you met in prison but you kind of wonder what they're doing. Why reading you, reading the menace and getting you off the streets is what they actually need to be doing right now to make the world a better place. You know what listen I can't speak for the prosecutors, my specific prosecutors other than to say what I've said in the book and I believe that there was enormous overreaching. I believe that it was politically driven and I want to be clear I've worked with some of the best prosecutors in this country on state and federal cases. Some of the most notorious drug investigators investigations and cartel investigations in New York the best prosecutors in the country I feel I've worked with and I know and they did their job by the book but there are prosecutors out there that they believe they're doing God's work in some way and it it blinds them to the injustices that they're really committing they're supposed to be working based on evidence based on you know going after really bad people they're not supposed to win cases by subwarning perjury suppressing evidence extorting testimony things like that but it does happen and horribly horribly it is happening at an increase in this country worse than anybody has seen in years it's so bad that out on the west coast just a few months ago you had the chief judge the chief federal judge out in the 9th district Kazinsky basically banished an entire office the entire United States Attorney's Office and called on the Justice Department to get people in there that weren't going to be engaged in misconduct that is horrendous and we're seeing it all over but I think that was a major major example of what's going on and increasing around the country but they have a lot of tools at their disposal for example that incredibly long criminal code there's a lot of things they can do well listen it's not even about the criminal code anymore depending on who you talk to I just came from somewhere else where 50 people sitting in a room talking about over criminalization and the bottom line is these are all experts in the field nobody can tell you how many crimes are on the books actually nobody can tell you and where they're at and worse than that and this goes back to the people I met in prison being involved in a crime a criminal investigation a real crime is one thing but that commercial fisherman caught too many fish that was a regulatory issue the guy that sold the whales tooth on ebay that's regulatory we're taking regulatory and civil issues and ethical issues and we're locking people up criminally we're turning them into career criminals basically for this stuff that's on the books as regulatory issues that's a big huge problem and the American public they don't have a clue they read a headline and they don't think of in the context of what that really means for them what it means for this country and also what it means for their pocketbook because you could have handled ethically or not ethically but regulatory wise you could have handled that commercial fisherman caught too many fish you could have suspended his license take his fish do something to hold him accountable we didn't do that we take his license, we take his boat the people on the boat lose their jobs he loses his job he loses his license forever he can't never work again and who pays for that we do the American taxpayer so it's a bizarre process but don't our laws, our regulations need teeth and it sounds someone could interpret what you're saying as well they were really hard on me and they're hard on these other people and I wish that they had gone easier on me and I wish they would go easier on these other people but isn't the goal of the regulation to the criminal law whatever these things are that we're charging people under to prevent people from doing this stuff and so if we went easier on them more of them would do it two things, one this isn't about me I'm done this is about the future of this country don't tell me that the only way to hold that commercial fisherman accountable is to put him in prison that's a ludicrous statement to make anybody that believes that is stupid because you can hold that guy accountable in a number of different ways you could suspend his license you could find him take his probation whatever license put him on probation do whatever you want to do but you don't turn him into a criminal and remove him from the work force all these guys you know you had these you had this the Obama task force in the financial world looking at the banks now they were looking at the banks the heads of the banks well what happens all the brokers on the bottom that were violating these regulatory issues they locked them all up they locked them up they didn't touch anybody in the banks everybody went about their business but the small guys they locked them up they turned them into criminals why not find them why not suspend their license why not take them out of the work force suspend their license for two years a year whatever make them pay restitution for whatever they think the loss was we don't do that on those regulatory issues and the ethical issues and things like that these are tens of thousands of people that we're doing this to we're permanently taking them out of the American work force we are creating a permanence underclass of American citizen permanent underclass in the millions there are millions of people in this class now which is a second class citizen civil and constitutional rights they have 40,000 different collateral consequences that they have to deal with you know until the day they die and they never get their civil and constitutional rights back in full never they're never empowered as a full American citizen again that is not the way the system was supposed to be looked at I agree with everything you've just said in the libertarian kiddo institute it leads me to how does that sort of argument apply to the thing that is perhaps the largest driving factor of destroying people's lives taking away their livelihood turning them into criminals through prison time and all that which is drug penalties for nonviolent defenders our jails and prisons are overflowing with nonviolent people who are in there as they bought and sold some chemicals that make you feel funny you mentioned a guy Eric you met in prison serving 36 months for 9 grams of cocaine his first defense nonviolent who was working two jobs and had a family well listen it's far worse than Eric's situation I met young black kids out of Baltimore 5 grams 10 years 15 years because they get tacked on to a conspiracy and the conspiracy enhancements kill them or somebody used a gun in a transaction had nothing to do with them they get hit with the enhancement there's all these things in the federal system that can enhance your penalties the reality is the kid never had a problem with the law it was a nonviolent offense it was a first time offense now he's doing 8 to 10, 15 years when he was 19 and his whole career his whole future is destroyed but here's the problem I think that we have in the legislature and in the general public at large and I think this goes to your question there are people that will listen to this and say drugs is a bad thing you're dealing drugs people get killed because of drugs so that guy whatever happened to him happened to him he deserves what he gets and what I would tell those people and I've had these conversations at like town hall meetings you know at book signings and things that I've been at don't be so quick to think that's a benefit to you in society because here's what you've done and here's what I don't think people understand you take that young kid that's never had a problem with the law and you stick him in prison for 15 years which means he's going to do 12 if he's doing 12 he's not going to a minimum security camp he's going to a lower or medium he's going to learn how to steal, cheat, lie, manipulate, gamble, con most importantly he's going to learn and he's going to believe very strongly that if he gets into a verbal altercation with anyone it ends with somebody getting cut or somebody getting beat to a pulp that's what you teach him and then you send him back home into society with no education no vocational skills no life improvement skills and you send him back and as one kid said to me I'm black and I'm a convicted felon what goods my GED do the bottom line is I know guys with doctorates masters, bachelors they can't get jobs because of a conviction because of their conviction what's that kid going to do you've guaranteed in most times you've guaranteed he's coming back as a convicted felon back into the system he has no choice he's got nowhere to go he's got no job he's not going to get a job especially after a 15 year sentence in a federal prison it's not happening we do that instead of taking those kids getting before a drug court and putting them in a mandatory boot camp or something that teaches them respect and discipline that parenting goes beyond conception getting them a GED and getting them on the right track and most importantly if they pass that boot camp dismiss their conviction get the conviction off the record because with that conviction I really don't care what you do to them I don't care what you do for them they're doomed to failure 95-99% of the time they're doomed to failure and we're creating it now when you walk to the beat when you were on the NYPD and you walked to the beat you were uniformed in plain clothes and that was in the 80s right when the drug war was getting ramped up and all those things did you think about the same stuff for the people you were interacting with did it strike you as much when you were uniformed? No and here's the problem it's not going to to anybody in law enforcement you're given a penal code you're given a set of laws you're told go out and enforce these laws nobody should blame the cops nobody should blame the federal agents for what's going on in today's criminal justice system don't blame them the system blame the legislators blame the people to create the laws and the punishments that we have to live by now that's what the problem is it's not the cops and the federal agents they're doing their job they're doing what they're supposed to do they're doing what they're told to do and that's the problem nobody in law enforcement no cop or federal agent or any of those guys they're not thinking of the end result you just don't but that's not your job your job is to take the bad guys off the streets and the law says this guy's a bad guy and that's what you have to do they do what they're supposed to do and the rest is through the system the system has to change knowing what you know now would you have done things differently when you were a beat cop? first of all I really don't think I ever locked up anybody for smoking marijuana most of the people I locked up were bad guys that did bad things and I was a very aggressive cop would I do anything different?  I promise you there's a prosecutor that's going to lock up the cop really? yeah they don't have the ability to do anything about it they can't let people go they can't do that so that's a problem you have to change the laws what about what are your thoughts on jury nullification how do we change things or the prosecutors aren't willing to stop prosecuting we empower the people or educate the people to just refuse to convict on these sorts of things you know what I think that's nice it sounds nice the reality is it's never going to happen and the reason it doesn't happen is because of the way the prosecutors get to present their cases that won't happen there's also almost no case goes to a jury anymore in the federal system I just did this recently I asked a group of people give me a give me a company or give me a government agency any government agency that has a perfect record anybody and they're all sitting around they're all thinking well maybe apple well it's not really perfect but maybe this or that 20 different things none of which can come close to the record of the United States Justice Department none 97% of the criminal cases in the Justice Department are pled out 97% and out of the 3% that aren't pled out 98% of those to 99% are found guilty perfect record really I don't know beyond what you could reasonably expect without well when you look at state prosecutions that are 65% to 75% I don't know well they can with the police system they can put as many screws to you as you want and we go back to the steering column listen and the and I'm not saying this you have Supreme Court justices former attorneys general and present day federal judges called the police system a corruption prone system it's corrupt anytime you could sit somebody in a room and tell them look you're looking to 25 to life when the reality is that's a complete exaggeration of what they could really get but you tell them that anyway you're looking at 25 to life so we're going to give you a break if you take 10 you've got to be an idiot the guy's going to take 10 I know tons of guys that took pleas to things they did not do because they were scared to death after being threatened with these crazy sentences now your plea you took I mean you had a lot of considerations about your lawyers constantly getting dismissed by a judge who seemed to be a little bit biased I had to pause there and so eventually you just kind of threw up your hands well in my case look I was actually days from going to trial I was going to trial and my judge in my case basically said he was inclined to disqualify my attorneys this would have been a third time disqualified the prior and the first one was conflicted out who eventually I don't know how it worked the prosecutors got him to cooperate in the case against me unbeknownst to me and without telling my lawyer so your first attorney was going to testify against you that's a little bit crazy a little bit let me tell you when you're standing up in the courtroom and the federal prosecutor starts to tell the judge that they had all these conversations with your attorney your prior attorney and you have no idea what he's talking about it's more than crazy but I was actually five days from trial and once he said he was inclined to disqualify my legal team at that point I was already remanded I'm already in solitary confinement I'm going to have to sit there for another year, year and a half until my new legal team comes up to speed and I had no more money for a retainer for new legal counsel what do you do you know I quit so that's it we have a system that's broken and so many different ways I think it's look there's nothing there's one answer and the one answer is the legislators there are hundreds if not thousands of advocacy groups around the country that do all kind of great work Kato Institute included phenomenal advocacy work on criminal justice reform if we don't change the laws you guys are going to be doing what you're doing for the next hundred years in this arena the laws have to be changed the mandatory minimums and sentencing guidelines have to be repealed, revamped, abolished whatever let the judges judge the mentally ill the addicted stop putting them in prison they don't belong in prison they belong in treatment centers I saw a lot of that really horrendous cases of that programs we need real programs that's going to reduce recidivism and get people back into society as productive citizens we don't have that it's just not happening and lastly at some point in time you pay your debt to society because it stands right now as it stands you never pay your debt to society this stuff goes on forever and it has a negative impact on you by some 70, 80, 90% you never remade a whole citizen again and I think it's wrong there are some people that may have to happen some people go to prison for a long time some people you have to put them away for a life to keep society safe I get that but when you pay your time you do your time, whatever you want to call it you're off probation and you become a model citizen well then get it over and the punishment because as it stands right now the punishment goes on for a lifetime it seems like we can reform a lot of the prison you were at in Cumberland Maryland federal prison camp which was supposed to be the way you first described it it was supposed to be kind of open I mean look security camp is pretty much a non-secure facility there's no fence there's no locks on the doors you could literally walk off site anytime you want it I could have a visitor come on a Saturday and Sunday I could walk out to the track get in the car and drive off it's an honor system so here's my question here's what I think people are missing when I push for programs they say well you need money you need real money well then take the 27,000 people that are sitting in these minimum security camps nonviolent first time many first time offenders low level drug offenders 27 to 28,000 of them sitting in federal prison camps at the cost of about $30,000 at the cost of $30,000 a year and more especially the older guys they could be $60,000 a year because of all the medical stuff you know send them home on home confinement do something that benefits society versus destroys it and I don't know what the number is you just reminded me of this I don't know what the actual number is you know how many prisoners are in the federal prison system on death row not on death row but they're dying they're dying they've got cancer they've got this, they've got that they're not murderers many of them are not violent criminals and they're infirmed send them out send them home the guy's dying for God's sakes let him die with dignity with his family instead of just forcing the issue to let him rot in prison as they say why do you do that it wouldn't be done the Cato Institute does an enormous amount as do others and I think time will tell well that's the crazy thing the thing that sets me the most about this is the sort of common sense element I feel like most people would agree with you that these people should not be in prison the people you talk about what's the problem with convincing them education the problem with convincing them is educated nobody, listen if every American citizen saw what I saw there'd be anger, there'd be outrage and there would be change they don't know and I know they don't know because I didn't know thank you for listening if you have any questions you can find us on twitter at Free Thoughts Pod that's Free Thoughts P.O.D Free Thoughts is produced by Evan Banks and Mark McDaniel to learn more find us on the web at www.freethoughts.org