Members' statements. The Member for Niagara Center. Thank you, Speaker. I'm honored to rise in the House today to deliver my first member's statement. And I'd like to take a moment to say congratulations to the Speaker on his election. It's a privilege to be here to represent the people of Niagara Center, formerly Welland Riding, who have entrusted their faith in me to advocate for them here at Queen's Park. I am humbled by the opportunity to carry on the NDP legacy in Welland, Port Coburn, Thorold, and South St. Catharines, following in the very large footsteps of Mel Swart, Peter Cormos, and Cindy Forrester. With hard work, dedication, and the mentorship of my colleagues and predecessors, I trust their faith will not be misplaced. I'm very happy, Mr. Speaker, to introduce in this Legislature one of Ontario's favorite festivals, Canal Days in Port Coburn. Canal Days is a marine heritage festival hosted by the Port Coburn Historical and Marine Museum. Celebrating their 40th anniversary this year. Every year, Canal Days has become more popular and is now a four-day event hosting over 400,000 visitors, with vendors, buskers, food merchants, live entertainment, and one of the best firework displays in Ontario. Come Sail on the Empire Sandy, one of the many tall ships, gathered at the mouth of the Welland Canal, and experience Ontario's largest outdoor classic car and international kite show. Mr. Speaker, we invite everyone to the beautiful lakeside city of Port Coburn this August 3rd to 6th for this incredible holiday weekend. Thank you. Statements. Member for Brantford, Brandt. Thank you, Mr. Speaker. I'd like to pay tribute today to Brantford Brandt's very own Bob Nixon. Robert Fletcher Nixon was born on July 17th, 1928, and on Tuesday of this past week, he turned 90 years old. Mr. Nixon is the former leader of the Ontario Liberal Party and former Member of Provincial Parliament serving the people of Brant Haldeman. Bob is the son of former Premier of Ontario, Harry Nixon. He was first elected to the Legislative Assembly of Ontario in a 1962 by-election following his father's death. The younger Nixon was elected leader of the Ontario Liberal Party in 1967 and led them through three provincial elections. The first two where the Liberals retained their standing as the second largest party and official opposition in the Legislature. Nixon resigned as party leader in 1976 and was succeeded by Stuart Smith after a leadership convention. Mr. Nixon remained a prominent member of the Liberal Caucus after standing down from the party leadership, including two stints as interim opposition leader and served as Provincial Treasurer and Deputy Premier in the Government of David Peterson from 1985 to 1990. After leaving politics, he took a term as the official agent for Ontario in the United Kingdom and then served as a chair of Atomic Energy Canada. Truly, Bob is a great Ontarian and a great Canadian, but I don't say all that this, Mr. Speaker, to give honour to a family that held the same seat from 1919 to 1991 or to list Bob's accomplishments, rather, since he has become a patient in my practice, Bob has become a friend and mentor. Thank you. Thank you very much. Member Statements, Member for Kitchener Centre. Thank you, Mr. Speaker. During the election, I had the pleasure of meeting one of my constituents in Kitchener Centre who had me make her a promise. She asked me if I would work alongside my colleagues to change the culture of the discourse that's happening right here in the House. She was upset about the fighting and the anger and the animosity, and so I would like to use this moment to honour that. I'm going to do that, though, by being very clear about the kinds of things that have been happening right here in the last few days that I've been here. One of those things is actually racism. The way that racism operates under normal circumstances, people usually think that what the issue is is that it's an individual who is racist, but based on my experiences, it's not that. It's about systems. It's about laws and decisions and regulations that we make that perpetuate a myth of neutrality when they're actually harming particular people, particular people more than others. The reason that the NDP stands up against carding is because carding has been found to harm black, brown and indigenous people more than others. As a consequence, it is our job, it is our duty to our residents to stand straight, to stand firm and to stand tall and say no. There are other ways that we can make use of the police, and I think that we have to do that as part of our challenge. Thank you. Member Statements, Member Goldfeld. Thank you, Mr. Speaker, and my congratulations to you. I know you weren't in the house when I gave my inaugural speech on Monday, so my congratulations. Next Thursday, July 26th, we'll mark the start of four rounds of play of golf for the 109th Canadian Open Tournament. Once again, the Glen Abbey golf course has the pleasure of hosting the Canadian Open in Oakville. The Open is a rallying point for Canadian golf and an opportunity for Canada's top golf talent to challenge the world's best. Glen Abbey is so much more than just a golf course. The course was designed by the world-famous golfer Jack Nicklaus in his first solo design. History has been made there. One of Tiger Woods' best shots of all time occurred on the 18th hole of Glen Abbey in the Canadian Open in 2000. It was a 216-yard shot out of a bunker over a pond that clinched the Canadian Open for Woods that year. And the course is also home to the Canadian Golf Hall of Fame and the head office for Golf Canada. The Canadian Open is one of Canada's greatest sporting events and the tournament attracts tourists from all around the world. The Open is the third oldest tournament on the PGA Tour and was recently named the most fan-friendly on the PGA Tour. Oakville is truly fortunate to host this world-class Open and I hope that everybody here has the opportunity to visit Oakville and visit this great event. Children and youth under the age of 17 have complimentary admission. And as the member from Oakville, my humble suggestion to the PGA players is that they do remember to bring a second pair of pants in case they get a hole in one. Thank you. Member's statements. Member for Windsor West. Thank you Mr. Speaker. Yesterday I asked the Conservative Government about their plans for Ontario's automotive sector. I asked why they had not once mentioned the auto sector in their election plan or in their thrown speech. I don't understand why the Conservatives want to cancel the Jobs and Prosperity Fund which contributed millions in necessary investments to Windsor's auto sector supporting jobs and our local economy. Over 200 business owners, local representatives and industry executives met in Windsor yesterday to discuss the tariffs that President Trump is threatening to impose on our auto sector. Tariffs that undoubtedly would decimate our economy and the livelihoods of the people in Windsor. And despite this lemming threat, just four days ago the Conservatives fired Ontario's Trade Representative in Washington. What that says to me and my constituents is that this Conservative Government is not prioritizing our economy and our workers and my constituents are rightly concerned that this Government won't fight for them in the way they need them to during this uncertain time. We need to continue to hold the Conservative Government's feet to the fire and let them know loudly and clearly there's so much better. We need them to fight fiercely for our jobs and we need them to develop a comprehensive auto strategy to guarantee the future prosperity of the industry. Windsorites and Ontarians deserve nothing less from their Government. Thank you. Member's statements. Member for Scarborough Guildwood. Thank you Speaker. It's my pleasure to rise in this House and invite everyone to the Guild Festival Theatre. Guild Park is a special place for my writing of Scarborough Guildwood. A park, a top, the Scarborough Bluffs where nature, art, culture, heritage and the rich history of Scarborough are on full display. The Guild Festival Theatre has enhanced this experience through their modern take on classical theatre productions since 2011. I attended the opening night show of Shaw's Pig Malian along with many members of the community. All three levels of Government were present demonstrating the importance of the art and culture to Scarborough. The Guild Festival Theatre is the only one of its kind in Canada. It is a point where nature and culture meet and where past and present come together. The Guild Festival Theatre has become a pathway for vocational and educational opportunities for young artists. This would not be possible without the strong vision of the founders of the Guild of All Arts, Rosa Spencer Clark. And of course we know our former Premier Bill Davis visited Guild Park and were hosted by the Clarks. As well as the ongoing hard work and dedication of the volunteers and those who serve on the board, Janet Heiss, Janet Lambert Mont-Mauri, John Mason, Friends of Guild Park and Garden and the artistic director Jamie Robinson and of course the rest of the Guild Festival Theatre team. It's time to re-establish the Guild for a new age. I encourage the province to recognize the historic significance of Guild Park and please visit the performance of Pygmalion. It runs until August the 12th and I know you'll enjoy it. Thank you. Member Statements, Member for Cohen Health. Thank you very much Mr. Speaker and last week it was kind of monumental. We had a meeting with the Mayor of Markham, Mayor Frank Scar pity and for four years I was the Mayor of Markham region and I was joined with the members for Richmond Hill, Markham Stovel, Markham Unionville and Markham Florin Hill because we all either border Markham or we represent parts of Markham and of course all the PC, all the members now of York Region for the Legislative Assembly of Ontario are PC members so I'm going to have a lot of company and hopefully we're going to make the rounds and meet some of the other mayors as well. And to the city of Markham, specifically getting the young subway further north, freight train traffic, increased freight train traffic coming through the region and of specific importance and what I wanted to share with all of you here today is that Markham is a really strong economic player in Ontario. In fact I just wanted to share with you in terms of Canada's high-tech capital and you know we have that high-tech corridor from Kitchener, Waterloo, to Markham. Markham has 1500 tech firms with 37,000 tech employees whereas the GTA has 11,700 tech firms, I think that's 14,000 it's hard to read this, with 286,000 employees and Kitchener, Waterloo has 500 tech firms with 23,200 employees. So you see that Markham is a really strong economic player in Ontario and I'm looking forward to representing their interests here at the legislature. Thank you to the members for Humber River Black Creek. Thank you Mr. Speaker. I congratulate you and all members on your election to this prestigious house. I would also like to thank my family, friends, team and the great people of Humber River Black Creek. It is an honour and a dream to represent my lifelong home. Within Humber River Black Creek is the Jane and Finch community where I grew up. It is a place where over 100 languages are spoken and spoken to none. It's a place of active young people, eager students and caring teachers thriving businesses and brilliant entrepreneurs. We are a community of hardworking parents, educated professionals, inspired artists, amazing athletes, active seniors and passionate activists. We have beautiful naturalised areas and parks and annual events and festivals where families gather and children play. Yesterday, however, there was great disappointment that a government minister named my community only to describe it as a place of crime as he dodged a question from my esteemed colleague MPP Kevin Yard who was calling for an end to the discriminatory practice of police carding. Unfortunately the stigmatisation is nothing new to Jane and Finch but it is especially hurtful and callous to hear it in this house. Words spoken here carry great weight and as such must be weighed carefully. Rather it is important to be representative here last night to read a mean-spirited and insensitive statement. Jane and Finch and Humber River Black Creek deserve better than this. Member statements? Member for Simcoe North. Thank you. It's a privilege to pay tribute to a local World War II hero, Mr. Frank Edward Graham. Mr. Graham passed away July 13th just shy of 96 years old. He had so many wonderful accomplishments it's difficult to mention them all in the first Canadian Survey Corps Royal Canadian Artillery Regiment. He enlisted because it was the right thing to do in 1941. He saw action 42 through 45 in Africa, Sicily, Italy, France, Belgium and the Netherlands. He was wounded in the early spring of 45 and was sent to England to recover and eventually home to Toronto and finally residing in Midland, Ontario. He became Mr. Veteran Markelo after having travelled to Holland with many Canadian veterans at the Dutch Parliament to help celebrate the 45th anniversary of the Liberation of the Netherlands in 1990. In 2010, it was announced that it would be the last invitation to veterans to celebrate Holland's Liberation. Mr. Graham expressed his concern about keeping the memories of war alive so the children wouldn't forget. Your event, Oplet, Chair of Welcome Back Veterans Committee, took it to heart and the following year came to Canada to celebrate Mr. Graham's birthday and announced that his group would be celebrating the Liberation Tour in Holland. He was also organizing the Frank Graham Cycle Liberation Tour, a 10-day bicycle trip from Juneau Beach to Markelo for Dutch and Canadian students. There were two more tours in 2015 and 2017. Last year, the Dutch Government announced the Frank Graham Tulip, the colour of a poppy. He will be sadly missed by his wife and family, our community and the branch 80 Legion family, even the Dutch Government. Mr. Speaker, I was prepared to discuss the activities and great achievements that my constituents are working towards today. However, I must speak about a horrific and tragic event that occurred in a Mississauga Community Centre parking lot on Sunday, July 15, where a husband was viciously beaten and his wife Diana was also assaulted in front of their two young children, a friend, Fuad Yusid, who tried to intervene was also attacked. Yesterday, I visited the family at St. Michael's Hospital, where Mr. Muhammad Abu Marzouk had just regained consciousness and is bravely fighting for recovery. With great courage, his wife and children remain strong. Thanks to the work of police and first responders for addressing this incident urgently and professionally, also thanks to the witnesses, the two alleged attackers were apprehended and this horrific incident is now being investigated as a hate crime. Mr. Speaker, I believe I speak on behalf of all parliamentarians when I say that hate will not be accepted in this society and that we must continue to work collectively in order to eradicate hate and intolerance in all forms within our beautiful province and country. Thank you. That concludes the time we have available for member statements. Reports by committees.


Keep pie a cat, pie a cat Keep going what you do, going what you do Night, hey night I'm just trying to say Only be, be, be, be I'm just trying to say Only be, be, be, be I'm just trying to say Only be like I was your pie cat Is y'all not doing nothing for the black community, right? You know?  We ain't got no R-Spec Anyways, my Twitter name is Greg Pollack in case you guys want to say anything about or have any comments about this talk and the hashtag you can use for this talk is On the Edge of Rails Performance RubyConf 09, oh my god, WTF by bbq, ha, ha, ha, ha. You get extra points if you actually get, but anyways. Before I get into Rails performance, I wanted to share a little, a couple discoveries that I had last night. How many guys go to the startup crawl? Yeah, well, that was awesome. So we had a couple discoveries along the way, which I thought I would share with you. They'll be in a bigger video, which we're putting together for summarizing the conference. But there was a few discoveries. Starting with the Pivotal Labs. The first really cool thing we saw over there was they have a build board for all the different projects so you can kind of see the status of the builds and are they all in the green? Are they red? Are they building? That was kind of cool. The second cool thing we saw at Pivotal Labs was their awesome whiskey collection.  You sip, everyone has a sip. You don't shoot whiskey. I learned that at Pivotal Labs. Okay, so next up, we checked out Dropbox. And one of the cool things we saw at Dropbox was that the CEO, this guy, has like four screens vertical, which was kind of cool, until you realize he's using windows and he's going like all this stuff around here along with his deodorant and everything else. I'm gonna try to turn down the lights a little bit because I'm gonna be showing you guys a lot of screencast. So it'll be easier to see. Okay, that'll leave you a little better. And the other thing at Dropbox, totally unexpected, is the CEO turns to us and he says, is this desk over here? That's Zed Shaw's desk, Zed Shaw. And we kind of looked at the desk and we kind of looked at each other. Take a moment to think, what would you do? Given the opportunity, it was tempting. But yeah, you know, Zed Shaw, that guy up there. So I thought it was a little disappointing he wasn't there at his desk because I would have got him to autograph his book. In case you can't see it up at the top, this is the subtitle up at the top. Yeah, you know, I figured, well, another thing I thought about was, this was Dropbox. So if I really wanted I could drop something on his box. But no, we didn't do anything bad. Luckily though, an Nathaniel Bibler who does the Ruby 5 with me got a great idea as we were walking out because we love this application GoWalla. Anybody here GoWalla know what that is? Cool, it's an iPhone application basically allows you to sort of like a virtual geocaching where you walk around and you can check in at places, right? And so you basically, you know, you might call up your iPhone app and like these are all the close places around you and you could press one of those and then you could see who else is checked in. You could check in here and like leave items and that sort of stuff. And so Nathaniel got this bright idea.  Like little, you know, it's a monument there, you know, in San Francisco. So if you're walking down the streets of San Francisco you might see like, oh look, Zed Shaw's desk, I'll check in, right? And what's really cool about this is when you create something on GoWalla you have to categorize it. And Nathan found the perfect category for it. It's an antique, like Zed Shaw. Yeah, anyway, so that was sort of some discovery from the startup crawl. But this talk is about scaling rails. But earlier this year I released a bunch of screencasts on scaling rails. And have you guys watched any of these? Bunch of you guys, very cool. And so for this talk, as I said in the description I wanted to really briefly go over what we've covered already. Because a lot of the stuff I'm going over today is advanced stuff. You guys already have Rails apps, you're looking for ways to optimize them. But in case you're just getting started with that, here's the scaling rails in 60 seconds. First of all, the first thing you wanna do to scale your Rails application is work on page responsiveness. This is front-end responsiveness. Install YSLOW, get it running on your page, and optimize using what it tells you to do, like compress your CSS and JavaScript files together. Next up, page cache as much as you can. You can't do that, then you do action caching. You can't do that, then you do fragment caching. And you can't do that, you do object caching. And if you don't know what any of these means, well, go watch the screencasts. Cache expiration sucks, just in general. Avoid it as much as you can. Luckily, Rails comes with all this stuff built in so it's very friendly with memcached. And with memcached, if you program in a certain way, you never have to worry about cache expiration. So that's sort of something you might look into. Also, scaling, use background processes, delay as much work as you can. Some of this might be obvious to you guys, so anything that takes, say, longer than 500 milliseconds, put it on a background processor. Client-side caching, this is where you do to deal with ETags and Last Modified. And with Rails 2.2, we got a lot of little keywords and methods that help us do this. Next up, don't pre-optimize. So what I'm talking about here is that 99% of the time, you're gonna need zero of everything that I just talked about, right? So when you start out a project, some people make the mistake of trying to cache too early, optimize too early. And really, if you're worried about caching, set aside some time at the end of your project to do load testing and make sure it scales. And that's when you need to figure out, at that point, you can figure out what you need to do for caching. And then lastly, and this theme will come up many times during the talk, which is don't abuse your database. Because that's sort of like the number one thing you can do wrong with your Rails app. So let's get to the cool stuff. That was scaling Rails in 60 seconds. So a couple months ago, I started up this podcast called Ruby 5, which covers the latest news in the Ruby community twice weekly. And while doing this, I came upon a lot of Ruby libraries and gems, specifically for helping you scale your Ruby or your Rails application.  So it looks a little bit something like this. We're gonna be going over nine different libraries and plugins.  First, we're gonna look over active record plugins for database optimization. Rails plugins to help prevent memory bloat. Then lastly, Ruby libraries to help scale. And this last bit, this is like the most interesting bit at the end, so I highly encourage you guys to stick around. So first up, the bullet library. The bullet library helps you reduce a number of queries with alerts. And don't worry about scribbling this all down. I'll show you guys the URL that I showed at the beginning which will give you links to all of this sort of stuff. Cool. So let's take a look at the bullet library. Do you guys know, guys in the back, do you know if there's any way we can turn off some of these? So basically I have a, here's my view. I'm basically iterating through all the different posts. And I'm doing post.user.name. So I'm getting the author of each of these posts. So let's go ahead and run the server. And then you see when I refresh this. Oh hey, check that out. Bullet gave me a growl notification that's saying n plus one query detected. So it's basically saying, hey, you might want to add include. Awesome, thank you. And if you look at our logs, we can even see it tells us which line of code this actually was triggered on. So we can see now we've got post.user.name. Now, so what I want to do is I'm going to add include and now it's a refresh. Oh hey, now we added include as it recommended we do and now we don't get that growl notification anymore. The cool part about growls it works both ways. If you're using an include that you don't necessarily need now that I took it out. Oh, it says, oh hey, you've got unused eager loading. So you might want to remove include. Okay, so that's cool. Shows me when I don't need to use include. The next thing I want to show you guys with bullet is I'm going to go ahead and add comments. A comment count after each post. So I want to show all of the comments for each post. So I'm going to do post.comments.size for each one, which is going to trigger a query for each post, which isn't good, but it's going to recognize that and it says, hey, you might want to add a counter cache here. Cool. So that's bullet. That's the first plugin we're going to look at. Just allows you to help you reduce the number of queries with alerts. And what's neat is if you're not on windows, you might not have growl. By default, it's going to use a JavaScript alerts if you don't have growl built in with Mac. So next up, oh hey, now it's time for a pop quiz. Here's, oh, I just gave you the answer to pop quiz. What's missing from this migration? An index, right, as Rails developers we're not always that good at remembering to add all the indexes we need. And I'm not just talking about like foreign keys like this. I'm talking about indexes based on what we're querying upon, right? So if somewhere in my code I search on title, then I'm going to want an index on title. Well, how do we then look over code bases and figure out where we might be missing indexes? Well, here's one solution. But you led MITAR called Rails indexes, which basically gives you two different rake tasks, which we're going to run now on our application. So first I'm going to do is I'm going to install the plugin. Now I'm going to do rake show me immigration and what it's going to do is it went and looked at all of my models, all my relationships, looked into my database to see which foreign keys were actually in my database and recommended that I add this foreign key. So it basically gives me a migration. But like I said before, that's not all the types of indexes we need. What about when we have like find by title? Well, that's what the second rake task is for. The second rake task goes through all of my controllers in my views and looks at my find queries and based upon that, give some recommendations for some foreign keys, for some indexes. And I'm going to go ahead and show you guys, if I go ahead and change the code, so you can actually see that this works, I'm going to say find by title and published. And if I rerun it, I can see, sure enough, it gave me a composite index. Cool, so this is just two rake tasks you can run on your Rails app if you think you might be missing indexes. The next library I want to show you guys is Scrooge. Any of you guys use Scrooge before? One, cool. So let me show you why we might need Scrooge in our application. So in the examples that I showed you guys, we've got a post table. And a post has all of these different columns. And in my controller, I'm calling post.all, which is basically doing a query which looks like this. But this obviously isn't the most efficient way to run a query for the page that we were rendering before. Because in the page we were rendering, we weren't even showing the body of the post. So really the most optimal query that we might want to run is something that looks more like this, which only pulls the data that we might display on the page. So obviously if you wanted to follow this methodology, you could go into all your code and you could add the select option to all your find methods, but that's not totally optimal. That's where Scrooge comes in. So let's give this Scrooge a try. So obviously there in my post controller, I've got post.all, cool. And as you can see, without the Scrooge plugin, it's gonna do select star from post, get all the posts when in reality we might not need all that data. So now I'm gonna install the Scrooge plugin. And now this time, the first time I refresh the page, Scrooge is in the discovery phase. It's basically doing something down here. We see it say post Scrooge, doing all this stuff. It's learning. It's learning which items I need in that page. And the second time I refresh, I apologize for you guys in the back. I know there's a dead zone down here. It's only gonna query for the columns that I need, only the ones that I need. So the cool thing about this is it also works with relationships. Let's take a look. So we include the user item table, post.user.name. So we're referencing the relationship. Now the first time I refresh this, it again is doing a discovery. So it's figuring out which columns are being used in this page and getting all the user information. But we don't need all of that. We don't wanna pull the password. All we really care about is the name and ID, which is what it pulls the second time that page gets loaded. So as you can imagine with the Scrooge plugin, if you're, is it really, with this sort of application, it's not gonna make that bigger performance difference. But if you're pulling like, you know, hundreds of objects, tons of data, you know, you've got tables that have tons of columns with lots of data in them, this could really shave off some milliseconds off of each request. So it's something we're taking a look at. So that's Scrooge. Up next, we've got a couple plugins to prevent bloat. And oops, I'm gonna go back. So a couple weeks ago, Sudara Williams wrote this blog post on the Engine Yard blog where he started talking about that it's not memory leak, it's a bloat. Because this guy works for Engine Yard. He troubleshoots Rails apps on a daily basis and sees that people sometimes have a misconception that the reason why these mongrels on the server are bloated while they're 150 megs of RAM is that Ruby's leaking all over the place, right? Which is a big misconception. What he finds most of the time, the reason why these Ruby mongrels are bloating is because they're instantiating thousands of active record objects. That's usually where people abuse active record, which is something that you see over and over again. So he recommended three different tools in his blog post to help you not run into the situation, which I'm gonna show you now. The first thing he recommended was Rackbug by Brian Helmkamp. Any of you guys using Rackbug? Few more people, cool. Well, I'm gonna give you guys a real quick demo. So first we're going to install the plugin. And by the way, all these screencasts since Thursday are now available on the ScalingRail screencast. So you can get access to all these if you wanna go back and look at them later online. So Rackbug is a piece of middleware, which means you're going to have to be using Rails 2.3 or higher to take advantage of it. We're gonna add it as a config middleware, so insert into our middleware stack. I'm gonna give it two more items, two more options. The first one is so that I can secure the Rackbug. It's gonna be my password. And the second one is so that I can actually run database queries, which you'll see me do a little bit later. So let's go ahead and start up my server. Cool. Now the first thing we need to do before we start using Rackbug is install the bookmarklet. I'm gonna go to the secret URL, which it tells you about in the readme. And from there, I can just drag this link up to my browser and turn it into a bookmarklet. Once I have it there, I can go back into my app and I can hit the bookmarklet, type in my password. And it gives me a bunch of information about the request, which just happened. First up, it gives me the milliseconds that it took to render the request. The CPU time, system time, total CPU time. Next up, under Rack ENV, it shows me a bunch of environment variables. This is, you know, if we do a flash, if we have cookies, any sort of environment variables that get thrown back and forth between the server and the browser. You can see right here. We can also see that it did 10 queries, which took 22 milliseconds up at the top of the page. We can see that query breakdown. If we scroll over to the right, we can see exactly where in our code that query was triggered from. So in this case, it was line six post controller. I can actually execute that query against my database to figure out exactly what it's returning so I can quickly debug. I can even explain the query to make sure it's using the right indexes. So it's all right there in the browser. And this is something that we took, I think, from a Django slightly, right? Because they have a Django toolbar. This is our toolbar. We can see that how many active record objects were instantiated for this request. So obviously, if this was in the couple hundreds, maybe even thousands, that would not be good. Might want to do a factor. I get cache usage. So if I'm using any cache on this page, it'll tell me which cache was used, which templates got rendered and how long they took to render. I can look straight into the log file, which is awesome. Especially if I'm running this on my staging server. So I don't have to go to the staging server and look in the log for the request. I can just hit the log here and see exactly what I printed out the log. Very convenient. And the last bit of information up in the top right is showing me something really interesting. First it's showing me the Ruby process which rendered this page is currently occupying 35 megabytes. And from the time that it started processing their request to the time that it's ended this request and sent it back, it increased in memory usage by four kilobytes. It's great information to know. If you see this gets jumped up by 20, 30, 50 megabytes every time you hit this page, might be time to refactor. Which leads us to memory logic, which is one of these libraries which will help you figure out which actions are bloating. Where in your code you're getting memory bloat? So let's jump into memory logic and see what it does. So I just installed plugin. I have to do a little bit of configuration to get memory logic working. Just add a little bit to the top of our application controller and this is all the stuff that I'm doing is in the read me. And if I run my server, I'm gonna click around a little bit. I can look back at my log now and see that it has some additional information listed after each item. Take a look at that. So basically after each line, it's telling me the process which is rendering this action, here is the current memory footprint. So like if I'm getting some bloat on an action, I can go step by step to see where it started getting bloated, at what point in the code. Okay, right after it ran this query, what happened? I even have a process ID which is really convenient. So if I'm looking at say like New Relic RPM and I can see that oh yeah, this one process went out of control, I can dive into my server. Okay, what's the process ID on this one that's taking 150 meg of RAM right now? Grab that process ID, jump into the production log file and then quickly search on that process ID and figure out what exactly happened step by step. Cool. And that leads us to Oink. So Oink, we gotta figure out where our Ruby process is hogging memory, Oink. So yeah, so this takes it a step further and builds upon memory logic. Let me show you what that means. Gotta do a little bit of configuration to get this one going too. So now if I take a look at my logs, it's giving me a little bit of the same information from memory logic, but a little more organized. So it tells me memory usage for this current request is 34 meg process ID and the instantiation breakdown. So the number of active record objects which are getting instantiated. We also saw that on Rackbug and our Rackbug toolbar but this time it's printing out on our log. Now where Oink starts to get interesting is when you start, it lets you do some metrics on your actions to figure out which ones are the biggest hogs. So to do this, first we have to, I had realized you had to add some, change your logging syntax to use the HODL 3000 compliant log or so I'm gonna add that in there. And now I'm going to run my server and obviously from this point we wanna start collecting data because we want some metrics so I'm going to click around. I mean in reality of course you'd run this on your production server and start collecting data on your production server. And now we can start running some metrics. We're gonna run script Oink and we're gonna give it a threshold. We're gonna say look at all the actions that increased memory by more than 75 megabytes. And obviously this is just development, this is a demo so there was none. So I'm gonna change the threshold to something really small just to zero. So it went through, looked at everything in our log and figured out which ones are the worst requests that increased memory the most. So at one point in time the post controller increased memory by 486 kilobytes, 286 kilobytes. So I can figure out really quickly where I might need to refactor which actions are taking the most memory increasing memory the most. And then down here at the bottom it aggregates so you can see the worst actions. Now in reality if you ran this on a real Rails app you might get results that look a little bit more like this. So I can see here that I've got a request, the worst request increased memory by 157 megabytes. That's bad, right? And the next worst and the next worst and down here it's aggregating. So I can tell okay I might want to refactor the dashboards controller because that doesn't look so good. It's increasing memory by a lot. Cool. So we've reached the last section of this talk where I've got three more libraries to talk to you about Ruby libraries that can help you scale. And this is sort of a smorgasbord, a couple of different libraries. The first one is called Rubber by Matthew Conway. And this you can think of as a replacement for Chef with Chef Deploy. It basically allows you to deploy a cluster into EC2 really, really easily. Let me show you what it looks like. So the first thing I do when I'm running, I'm running this is I vulcanize when I'm running Rubber. So this is going to create some scaffolding. So you can think of it as scaffolding for me and vulcanize if in case you don't figure out the connection. Vulcanize is what you do to Rubber to harden it I guess. So we're gonna harden it. And we can specify here which components do we want and our EC2 cluster. Cool. And one sort of aggregate cluster that we can create that's set up for us by default. We can say complete passenger MySQL which gives us all these components. We wanted to add say Sphinx. We could say script generate vulcanize Sphinx. We wanted to add our own custom generator. We could do that as well. So once you do that, what it does is it goes into your Rails app and it's gonna add a new directory inside your config directory called Rubber. Now it's got a couple things inside of it. First it has your deploy information. These are all your Capistrano tasks for all of your different components. So you can see Apache, HEProxy, Monit. So these are all the Capistrano tasks to deploy those items. And down below you've got your YAML files. This is just your configuration. Yeah, so if we opened up one of these directories over here, if we opened up the roll directory inside Rubber, we would start seeing some files we recognize. Like you see we've got this My.CNF and it looks like a Monit script as well. If we looked inside of that, here's what we would see. We can see that it's populating from our YAML files some configuration items and then it's actually going to render this as an ERB file into our MySQL configuration file before it gets deployed on your server. Cool. So let me show you the secret sauce here. If I go ahead and run these Capistrano tasks on my server, once I have Rubber installed on my Rails app, you can see this is basically creating a bunch of different items for me, different rolls. Out of the box it's going to give me a complete cluster in EC2 after a couple lines. What's really cool is the guy that created this was really smart. System Administrative Nutrition Guy has ton of stuff built in. So you've got like by default, you've got database backups going on. You've got Monit monitoring your services. You've got Moonin, all these stuff like sort of optimal cluster of servers working for you. So yeah, it also has dynamic DNS updates, which is great. So if you want to do a new deploy, you could just deploy to an entirely new EC2 cluster, right, change the DNS automatically. You could do that automatically in your Capistrano task, kill the old cluster. That's built in backups like I said, so sort of like best practices for deployment. Easy staging. One of the really cool things about this is that when I talked to the guy that created this gem, he said that in their project where they have this, if any of the developers ever need to show off a feature, well, they deploy to EC2. They start up a staging instance. The awesome thing about that is that staging instance has the exact same configuration of their production instance. It's just on one box instead of many, right? And it just makes it so easy to spin up new instances. Oh, I'm gonna show off a feature to a client. Okay, we'll just spin up a new staging server. I'll run one Capistrano command, go. I'll throw it away afterwards. It's kind of neat. You've got Monit built in, which does all your process monitoring.  So that's rubber. What's great about that, what's kind of neat is it keeps deployment a first-class citizen. So because you're putting all of your configuration files for your cluster right there in your Rails app in these directories, well, all of your configuration management is in source control, which is awesome. It's right there in your Rails app. Kind of feels good to just have it right there in your Rails app. There's something cool about that. It's also very scalable by default.  Cool, so that's that one. Now I'm gonna be talking about Cloud Crowd a little bit, which is a background processor, which is really neat. A simple background processor. So these guys from Document Cloud had this problem. And really, they have this problem in their new application that they're developing for journalists. Basically, journalists are gonna be sending them PDFs, big PDFs, and they need a background process, which will hopefully use sort of like a map-reduced-like function to take that PDF, split it up, get images of those PDFs, strip the text off of them, and then combine them all together. So kind of like Scribd, where they'll take a PDF and sort of just put that onto the web. And that's obviously they have a background process, and these guys need a background process too. So out of this, they create a document cloud to do this for them. So here's the anatomy of their application, of their, of Document Cloud. So we've got an application or website. It needs to start a job, maybe to parse a PDF. That's gonna send a request to a central server. That's gonna have some sort of database. Could be MySQL, could be SQLite. That's gonna dispatch some work to what we're gonna be calling nodes. Those nodes might have workers that do work for them. Once those are complete, it's gonna save those files to S3, notify the central server that the results are done and that can send that back to the user. So this is basically the anatomy of a cloud crowd cluster and also probably many other database, background processors. Let's go ahead and run it though because this is where it starts to get really cool. So I'm gonna create a cloud crowd application. So I just do this install. And basically this gives me a couple files. First it gives me a rack file. So this is going to be my server, my central server that's gonna be monitoring the processes. And I can do some customizations in here. I can specify the number of workers that I want. I can specify the storage in here. Since I'm in development, I'm just gonna use the file system. Now I can say what sort of database I wanna use. I can use MySQL by default or in this case, since I'm just playing with it, I'm gonna use SQLite, cool. And now I need to create my database which is gonna hold my background processing. My jobs. Cool, and now I'm gonna go ahead and start up the central server. And here's where it really starts to get cool. Check out this UI. So this is running on thin, start it up, and here's sort of the UI that you get for cloud crowd. On the left, it can tell us all of the worker nodes. We don't have any yet. On the right, we can see all the work units in the queue. Notice that it's updating, it's doing polling so we can see what's in the queue at any point in time. I can see the jobs in the queue and what they're doing. And I can see active nodes and workers. It comes with this really nice interface which I'll show you, we'll check it out in action. So let's make this background processor do some work. First thing we need to do is start up a node. We need a node so they can do some work. So we say crowd node. And if we go back to our website, we can say, hey, yeah, look, okay, we've got a node here that's ready for work. So let's give it some work. So we can see that it comes with by default, a couple actions that we can do. We can do some graphics magic processing. We can process PDFs or we can do a word count. Let's do a word count. So here you can see we have to have a process action and a merge action process. It's just gonna do WC and count the number of words and whatever you are all I send in. And then merge is going to sum up all the counts of all of the documents that I send in. And I'm adding a sleep five to delay it just so you guys can see it in process. Otherwise it would be too quick. So cool, so how do I start that action? Well, I simply do a rest post request to jobs. I say, do the word count action and I send it a bunch of inputs and all these different inputs. These are just basically Shakespeare plays. So I wanted to count all the words in all these Shakespeare plays. So it's just gonna do a quick request. So let's go ahead and start that. As soon as I start that, I can go over and look at the, oh hey look, so now we've got five nodes all doing work. I can click on one and see exactly what it's doing. You can see, oh we're 23% complete. We can see exactly how an hour 41% complete it's running. We look over at the graph, we can see it started out with 23 work units in the queue and it's slowly processing using the five nodes that it has. Down here we can see the number of jobs in the queue that just won and so hey we're complete. Pretty cool. So now to figure out the status of how did it complete successfully. I happen to know the job that we ran would have got the idea of one. If I go to slash one, I get in JSON that it succeeded. It took 21 seconds and there's 558,804 words in all of those Shakespeare documents that I had it count. Actually we're like, ta-da. So that's Cloud Crowd. Why is Cloud Crowd interesting? Well it's all in Ruby and they made it so it was gonna be very simple and hackable. The disadvantage of using something, using a different background processor like Gearman or what's the new hotness? What do we? Like Rescue, what's the? What's that? Or like, what's that?  But the disadvantage of using these really sort of robust background processors that you see people like Facebook using is that these are all in C. So you're gonna be, if you ever need to hack them and make them behave a little bit differently you're going to have to learn C. These guys from Scratch wanted to keep it under 2,000 lines and make it very hackable. So I have the confidence in knowing that if I add this as a background processor and I ever wanna dig down on the code I'm not gonna be intimidated. I'm gonna be able to make it do exactly what I need it to do. And there's some sort of good feeling that comes from knowing that the code that is part of my system I can go in and I can hack if I need to. So that's sort of the benefit of Cloud Crowd. Cool, now we're down to the last bit which is good because I get to rant. I get to do a little bit of rant on email because there's two problems with doing email and any Rails app that really suck. And I'm sure there's a few of you guys that really feel my pain. The first thing that sucks about doing email in Rails is mailing lists. Every client that comes to you inevitably needs a white list or some sort of subscription list so that when people sign up they can say yes send me the newsletter, send me occasional discounts on lab tests and you've gotta maintain who's subscribed, who's unsubscribed, maybe even built in the ability to send out mass emails or at least export to CSV or something, right?  The other thing that really sucks about email is client changes. Because in Rails all of our HTML, all of our emails here are inside of our Rails app. So every time the client wants a change they have to go to you, the developer, and say, oh hey, could you change this grammar for me or could you change this one line of text?  It's too bad there isn't a way that I could maybe not do that. While there is a way, there's hope for dealing with these two different things. There's several different ways that you deal with this, but one of them that I'm going to mention tonight is by using a web service called Mad Mimi. And these guys aren't, they're not paying me anything to say this, but I want to give you guys a demo because they're our web service, they're our paid web service, but they're fricking awesome and I'm going to show you why. So in Mad Mimi, when I want to add a user to a mailing list, they have a very simple API, so they solve that problem for me. So I can say, add tom at example.com to this particular list, so I just need to do a call, restful URL call.  So I can just push them all there. What that means is now the client, whenever they want to send out an email, they can go straight to Mad Mimi and Mad Mimi's an email marketing service that does all this sort of tracking stuff, so they can go straight to Mad Mimi, create these bulk emails that they want to send out to all the users, create it there, send it out, create the campaign there. Mad Mimi does all the tracking and everything, so I can have them interface with Mad Mimi whenever they want to spam their users and we don't have to worry about exporting any CSV files because we're keeping the whitelist pretty much on Mad Mimi. So that's the first cool thing about Mad Mimi. The second thing, which is where it gets really neat, is when it comes to client changes. So what we did with this project of mine, we had this situation here where we had a lot of emails inside of the Rails app. We took them, all these emails, and we put them inside of Mad Mimi. Mad Mimi calls emails promotions. So we recreated all of them, even like the welcome emails. All the emails that the system sends out recreated them using the email builder inside Mad Mimi. Cool, so now in our Ruby application, our Rails application, we just replace ActionMailer with the Mad Mimi gem. Mad Mimi's a Rails app, by the way, just kinda neat. So we add the Mad Mimi gem and now to send an email, this is all we do. So for our new account, we say from this guy to that guy, here's the promotion name, which is the name of the email we created in Mad Mimi and here's the subject line. And to make that email send, we simply say deliver new account notification. It goes out to Mad Mimi, sends that email. I mean, that's pretty sweet.  So the one thing you might be thinking at this point is, well, what about for dynamic emails? What if I have like, I wanna put the user's email inside of my emails. If my emails are gonna be on somebody else's server, how do I deal with that? Well, Mad Mimi solves that as well, using these sort of brackets like you see here. So if I've got name, email, account, all I have to do is this. It's gonna wrap that up, send it over to Mad Mimi, populate the variables. So now my client is much happier because every time they need to make a change, they go straight into Mad Mimi. Every time they need to make a grammar change or a spelling change, the client go into Mad Mimi user, they're very easy user interface, make those small tweaks, don't have to bug me at all when they need to rearrange the emails. Oh, awesome, right? And so yeah, so these are the promotions inside Mad Mimi. Yeah, they can go right in here and they can edit the new user email, the forgot password email, anything that goes out. They can edit it right there. My client can edit it. So I did this with an application. It was going really well. And then all of a sudden one day I got this really awesome call from my client. I just couldn't believe this really happened. My client gave me a call. They said, okay, when somebody buys this item in the Rails app, I want this email to get sent out. And the email that I need to get sent out, I already created it for you in Mad Mimi. All you gotta do is hook it up. So I went, I was like, damn, right? Seriously? So all I had to do is go into the Rails app, hook it up to Mad Mimi and it was done. I mean, that was like, okay, that the client did like half the work I would normally have to do for me because they created the email. So that's Mad Mimi. And a lot of the stuff that I talk about with the scalability has to do with creating web services. So you can kind of think of this as another web service which can help you scale, right? Because you want to have, obviously when you scale stuff out into big pieces, all the big applications, whether it's Scribd, they've ended up splitting things out into components that are really focused on doing one thing. And really this is one thing. This is doing, taking care of your emails so that you don't have to deal with it. If your system gets really big, you'll never have to deal with emails and it's probably cheaper to pay them a subscription fee than it is to maintain that hardware, figure out how to do it and hire someone to maintain it. So that's all that I said. So all these screencasts, as I mentioned, if you go to this URL right here, you can get really quick links to all of these items which I talked about. Also, if you want to see the screencast again, they recently got posted up to the ScalingRail screencast series, so they're on there, so you can show other people if you want to show somebody the screencast again or you want to watch it again. Yeah, last bit, I did want to mention before we do questions, if there's any speakers in this room and I haven't gotten your 30 minutes, because you know I go around to the conferences and get all the speakers to give me their talks in 30 minutes, come find me, if you're 30 seconds, sorry. I aggregate them all and it's about 30 minutes. And then also, I talked about Gowalla at the beginning. If any of you happen to be sticking around tomorrow, Nathaniel and I are going to be doing two trips. Basically, they have these cool things like where you check in at a bunch of locations and you get a badge for doing it, right? And so there's, in San Francisco, there's two, there's North Beach Inn going to some of the coolest places in North Beach, and then I think we're gonna rent bikes and do the Golden Gate Gallop and go all the coolest places along the water and across the Golden Gate Bridge, renting bikes. So if any of you in here, feel free to come up if you wanna join us, come talk to me. And I guess I have maybe two minutes for questions. Any questions? What's not solved? Well, I think the most interesting bit going on right now is web services, right? I still think people aren't taking advantage of web services as much as we can, and I think Mad Mimi is a great example of that, right? If you have a web service for, like I know I've also heard people doing like MongoDB, like I think you can get MongoDB in the cloud as a web service, right? So I think it'd be interesting to see what other components of our web applications people can create sort of cheap paid web services so that we can easily, we can scale easier by taking those sort of like background jobs that maybe we don't wanna deal with, or email in some shape or form, and pushing that off to a separate web service that we might not have to deal with. So I think that's really interesting. Oh, and yeah, and if somebody creates that stuff, we'll be bound to talk about it on Ruby 5, so listen to Ruby 5.  Yeah? So just a comment. So another solution for memory profiling is to use Ruby prof and patch Ruby, which lets you do full line-level profiling and have like cash grant interface on top of it. Yeah, I guess you guys couldn't hear him in the back. He was saying, another way to do memory profiling is to use Ruby prof with the Ruby patches on top of that. Yeah, that's definitely one way to do it. Yeah. And also New Relic, I mean New Relic RPM is really good for keeping an eye on all of your servers. None of the stuff that I mentioned here sort of is sort of like a replacement for that.  It's also really good, especially if you start optimizing with memory stuff, because you can then go back and see, okay, a week ago, what do we look like? And today, what do we look like after the optimizations? They make it really easy to do that and compare results. Any other questions? Yeah? Does anybody know where Scrooge stores the optimized queries? Does anybody know where Scrooge stores the optimized queries? Not offhand. Sorry. I don't know what works with multiple databases. How it will work with multiple databases? Well, I suspect what it's doing, and this is just me sort of just, I suspect what it's doing is some form of a little bit of metaprogramming so that it's actually maybe writing some method definitions which get called. So I suspect it might not even matter what kind of database you're using, because it's actually writing out method calls. At least that makes sense to me. Any other questions? Are we good? All right, thank you guys for coming to the talk. I really appreciate it. And don't forget to check in at Zed Shaw's desk.


The Appalachian Advantage plan is the simpler, better way to get the phone you actually want, instead of paying hundreds of dollars upfront.  It's called the Appalachian Advantage and is available at Appalachian Wireless. May 27th, the Mountain Comprehensive Care Center will host the sixth annual Veterans' Stand Down and Job Fair in Archer Park. The stand down will be from 10 a.m. to 3 p.m. and all veterans and their families are welcome. This will make our sixth year that we've had to stand down for the veterans and this is just an awesome day for all veterans, not just homeless, but for everyone. We'll have a day full of singing prizes. Texas Roadhouse is going to provide the food. We'll have a day in the park for the family of the veterans as well. We're going to make sure that they're there with them because they're a good support of veterans. The veterans stand down will offer free health screenings, service referrals, housing referrals, veterans benefits, a food drive, live music, and more. The veterans don't get the attention or the resources that they deserve or we're free because of them fighting for our rights. It's near and dear to my heart and I want to try to do this as long as I can because this is one job that I really love and I try to do it with all my heart. For more information or to donate to the veterans stand down, contact Margaret Rice at<PHONE_NUMBER>. For Mountain Top News, I'm Brianna Robinson.


So, as the GSMA, we are committed to support the Green Digital Initiative under the pillar 3, which is our support to the Early Warnings for All Initiative. As such, our industry members, namely Telefonica, Avion, KDDI, MTN and Globe, so far have committed to the Early Warnings for All Initiative, and the ambition is to achieve Early Warnings for All by 2027. As the GSMA, we will work on getting the industry partners together, all the more, and getting cross stakeholder collaboration to achieve this goal, because this cannot be done by one industry, one person alone. It's a collaborative initiative, and we are very glad to be a partner to this. Thank you.


Hello, what is this? Hey, I'm doing my final tests on the ESP 32 s2 feather that I designed I finally got the modules with ps ram built in so that makes it really good for use with circuit python or do we know Got get that extra ps ram So what I'm doing is I'm testing it against all my different feather wings to make sure they work you know the Adelogger with the OLED all that and one of the tests I'm doing is with the RGB matrix Feather wings so this allows it to plug into you know these nice RG matrices. So this demo is actually Circuit Python demo That connects to github and gets the number of stars for circuit python and then Displays it onto the matrix. So got two thousand six hundred and thirty one stars and it's you know It's pretty fast what I like about having the native Wi-Fi as it can connect to the internet and get data in just a couple seconds So so far working so good. I'm gonna order this hardware real soon. Cool


Anna coming at you with a brand new season of Pure Fix TV. This season we're gonna be answering all your cycling questions. You'll see how to keep your bike in top shape in the Pure Fix garage. We're even gonna head out to the track to take your training to the next level with your fixed training tips. We've got a lot of new episodes coming your way so make sure you subscribe to our channel so you don't miss a minute. All new episodes of Pure Fix TV are coming your way.


I have to talk today about the operative treatment of fractures of the odontoid. So what is the problem here is it is difficult to imagine this bone which you just saw and imagine it inside a human body in three dimensions and then try to put the screw to fix a fracture which occurs commonly over here at the neck of the odontoid here this is one. I remember the first time I put an odontoid screw it was in 1997 or 98 and the next day morning when I put up the picture you know we had to have a morning meeting with the chairman and to show him what you have done yesterday. So I showed the post-op screw and he said oh my god this patient must be dead you have put the screw in the brainstem because it is difficult to imagine where this screw is going in an x-ray especially if you see an AP view of a fractured odontoid screw you will think that it is in the brainstem anyhow because of the complicated shape because it is difficult to imagine there is no disc you know here so sometimes identification is a problem because disc is a very good identification you can go into the disc you can put a needle stick a needle take an x-ray confirm where you are but here there are no discs it is difficult to put something inside and take an x-ray to confirm and there are all these ligaments attached to it the apical which is attached here the ailer they go on the sides and the transverse which kind of holds it together opposed to the C1 arch and stops it from pressing into the brainstem there are many other ligaments but let us not go into that these are some of the earliest reports which I could find on operative treatment of odontoid fractures so way back in 1980 that is 34 years from today so it is nothing new it is nothing new this operative treatment of the odontoid fracture has been around for a long time the report say that the incidence is increasing but there may be two or three reasons and it is a kind of a skewed observation because I think the number of people is increasing the number of wheels is increasing the speeds are increasing the roads are getting better there are more accidents and that is why your diagnostic ability is getting better you did not have CT scans and MRIs before now you have all of these and I think this is just a indication of all that technological advance that the incidence of odontoid fracture at least the pick up rate of odontoid fractures is increasing two peaks you see in the graph one in the young mostly motor vehicle accidents mostly hyper extension injuries and then the second peak in old people more than 75 or 80 years where a relatively trivial injury a fall in a bathroom hit against the tub or the wash basin or trivial injury can lead to odontoid fracture and usually what is seen is most of the young ones have an anterior type 2 and most of the old ones have a posterior type 2 if you see the embryology of the odontoid process these fracture modes generally follow that the tip is from a different sclerotome the fourth occipital the rest of the body of the odontoid is from a different sclerotome and then the rest of the C2 bodies from a different so that is where the commonest fractures occur this one is very rare I have seen only one maybe two and it looks more as if it's the ligament which is gets torn off due to a hyper extension and the tip a little bit of the bone gets torn off with the ligament which gets torn off otherwise it is not much of clinical significance to this type 1 fracture it is just there in the books I've never seen it maybe once or twice most common is this where the odontoid gets fracture at the neck and this is the one which we deal most commonly sometimes this fracture may extend into the body it may be a complicated fracture in the shape of an X Y Z all kinds of things or it can be a like a necklace extending into the body and some people have been kind of pushing the envelope trying to fix the fractures in the body as well but for the young people I won't advise you to do that don't push the envelope stick to the book stick to the the classical teaching only type 2 need to be fixed anteriorly this you can leave it when you have white hair like me why does it happen why do we need to fix it because of the vasculature you know they're kind of end arteries which supply the odontoid process and in a fracture they get disrupted and so there are the very high non-union rates even if it is not displaced it won't fuse and sometimes it gets distracted or move anteriorly or posteriorly and then it doesn't fuse and if it doesn't fuse it's going to cause chronic pain in the neck literally and that's why you say pain in the neck I think it came from non-union of odontoid fractures anyhow so that's the reason why we feel the need to fuse this so that that pain in the neck goes away if you don't do it it may lead to non-union classification we already know so type 1 just the tip type 2 at the neck type 3 the body's involved simple basic classification very easy to remember 2 can be divided into 2 a and p anterior if it gets displaced anteriorly posterior p I think this is a very good working and a simple classification for day-to-day management of these fractures this should suffice there are other classifications available but this is suffice how do you manage them type 1 if there is no instability and usually there isn't it's just the tip and it's so rare that you'll probably see once or twice in your lifetime just a caller for three months and it should be fine type 2 there are many things which have been described in literature you reduce and you fix anteriorly with an odontoid screw you reduce and you put a halo and wait till it fuses you may have to excise the odontoid if it is gone posteriorly pressing on the dura or pressing on the brainstem or the cervical medullary junction and it is not reducing sometimes you may have to excise it or you have to go from the back you go open the joint distract it try to pull it forward reduce it basically you have to reduce it if you don't reduce then the problem will remain that is one way or only posterior fixation or a transarticular screw there are many ways to fix it and type 3 usually the classical teaching is reduce try to get it back in position as close to normal anatomy as possible and put a halo wait three months any fracture will fuse it should fuse unless there is some soft tissue trapped between the two fractured elements and then it's going to be a non-union so before 85 everybody was putting a halo where nobody was putting any instrumentation for these fractures I think one of the largest and the oldest report was apple bomb in 92 I think he published 162 odontoid fractures with the anterior odontoid screw fixation and very good results so that I think renewed the interest in the surgery all over the world and since then there have been many series so there are some controversies with it why I explained to you the non-union and some people have actually studied compared people who have been put on a halo to people who have an anterior screw fixation and they found that the risk of failure of halo is 21 times higher than surgery if the patient is more than 50 years of age so it's not that halo is an answer to all there is a failure rate and significantly higher than an operated patient one screw versus two screw I think it depends upon the anatomy all my life I've done one screw and it has worked very well but if you have a big odontoid process if it's a seven foot or six foot eight inches man with a big odontoid process maybe you can get two screws in because the one screw may not give you the rotational stability which two screws provide but if it is a thin odontoid a small person one screw is good enough and this has been studied and written up and proved that the pullout strength and fusion rates and everything is the same there is no difference between one screw and two screws putting two screws in the odontoid can be tricky it can be difficult one screw works equally well we have seen all these now let's see what happens after rigid externally mobilization like I said 21 times higher rates of non-union especially if the patient is more than 50 years of age and there are so many reports to show 42% 50% 77% 91% doesn't fuse so if you can reduce it and fix with a screw either from the front or the back that definitely has better results than putting just a halo again the same thing and the fusion rates after surgery most of the reports the lowest fusion rates are around 90% that's very high compared to the failure so if you know how to do this operation your patients will be happier what about comparing anterior and posterior which one to do there are some disadvantages of the posterior surgery there is significant reduction of head rotation if you immobilize the C1 C2 joint this movement will definitely go because this happens at the C1 and C2 joint you can imagine what's the problem if you stop saying no you know saying no is very important even for a surgeon even for a spine surgeon you must learn and never forget when to say no and if you do that your patient is not going to be able to say no yeah so there's a significant reduction of that very important rotatory movement of the head and C1 on top of C2 you need to dissect muscle you need to expose the joint you need some bone graft either you cut off the C2 spinous process or you harvest bone from somewhere but you need some bone to fill up that joint so there is one extra scoop involved extra bone involved and you need to wait till it fuses you need to immobilize otherwise it's going to move so some collar or some some kind of restriction of neck movement is indicated but there are some patients in which you cannot do an anterior odontoid screw you have to do a posterior which are those patients irreducible if you cannot get the two pieces together you cannot put a screw through one into the other as simple as that is no complicated science involved in it it's not rocket science it's not neurosurgery if you can't get the two pieces together you can't put a screw from one to the other and very old fractures if the patient comes four months after injury apart from these contraindications all patients with type to odontoid fractures which are less than three months can be operated whether they should be or not is a clinical decision it's a clinical judgment it cannot be on a book you have to see the patient you have to see the x-ray you have to see the picture and you have to decide but apart from those two contraindications every fracture odontoid which can be reduced and which is less than three months can be fixed with an anterior odontoid screw you need to study all these things at least in the beginning when you are still learning it took me years to understand the anatomy and imagine it in my head imagine what it looks like actually inside the body because in the body you just see the posterior element or if you're going anteriorly you don't see anything because your incision is somewhere at C5 and 6 and you've kind of made a tunnel on the vertebral bodies and you reach C2 3 will I'll describe the technique now so looking at the x-ray again and again and again looking at the CT looking at the reconstructed images when we started off there weren't any three-dimensional reconstructions in the CT scan it was just a CT scan either axial and later on a sagittal and a coronal but now you have beautiful 3d reconstruction which can actually tell you the exact anatomy as in the patient look at the MRI look at the soft tissue try and look at the ligaments see if there is any other injury all these are important and decide which one is it so that's what it looks like you know there is a clear cut fracture you can see the anterior arch of the C1 that's the odontoid process so the transverse ligament keeps it together and that's why these pieces this and this stay together while the rest of it moves and it causes some compression on the cervical medullary junction and that's the dangerous part of this operation which is rare mind you it's not that all odontoid fracture kill they don't mostly nothing happens but there can be that is the danger this compression on the cervical medullary junction and if you see the x-ray that's what you'll see it's difficult to make out very faint but you can see the C1 this is the C2 this is C1 C2 on one side that's the odotoid process it should have been here which is overlap by the teeth but maybe you can see a margin here some kind of a fracture here so you put him on traction whatever you need to do extension or flexion depending upon the mechanism of injury and the displacement but you have to get the two pieces together if you can't get the two pieces together you cannot put an odontoid screw remember that if this is the only thing you remember you'll do well if you can't get the two pieces together you shouldn't be doing this operation at all okay okay the C2 is here and the odontoid and the C1 has shifted back so this is a posteriorly displaced again you need to put him on traction mobilize it somehow try and get it aligned only when it is aligned can you do an anterior screw otherwise you cannot few more so now what I mean is the 3d CT reconstruction you know you can have these beautiful images which tell you exactly what is happening the exact anatomy as it is in the patient earlier we didn't have it so the operation is a little bit tricky you need to be sure that you're in the midline so you need x-ray in one plane to confirm the midline and you need to make sure that your tip of the screw is directed at the right place at the top of the odontoid process or at the C1 tubercle so you need another x-ray in the second plane so you need x-rays in two planes before you can do this surgery remember that or if you have only one x-ray machine in the OT then you need to do an lateral then again do an AP then again a lateral and again an AP and it is very difficult to reproduce the image especially when everything is covered with sterile towels and you cannot touch anything you will be standing like this and asking somebody AP lateral and sometimes it is difficult to get the same image again so the best thing is to have two x-rays two image intensifies which can tell you about the AP and lateral at least in the first few cases you must have this and that's one of the drawbacks not every operation theater has two x-rays which can be spared for the same operation through and that's the principle you have to start at the disc between C2 and C3 take out a little bit of disc see this surface of the C2 body make your small starter hole here and then direct the drill bit or whatever you're drilling till you negotiate the fracture and you engage this one and this is the concept of the lag screw you know the only the tip is threaded so this threaded part holds the displaced or the fractured segment and pulls it and this one is like a nail so it's a nail and a screw and if you have worked with orthopedics this is a brilliant concept you've seen carpenters do it for I don't know how many years but then the orthopedics people adopted it and it works very well especially in this fracture because if there is a distal segment which you need to pull down and keep it under tension only then it's going to fuse for any fracture to heal you need it you need to be under tension and finally after removing a little bit of disc and exposing this surface of C2 this is what the ultimate result is going to be so you can imagine to get this angle this is the bone this is the isophagus trachea and the skin will be somewhere here so you just imagine where your skin incision is going to be you see that this is the angle at which you are working so this is two three four five six so your skin incision will be somewhere around C6 while your screw is starting from C2 and going up to the orthopedic process so you'll be working at an angle like this you won't be able to see any of this you'll be barely able to see the disc between C2 and 3 cut off a little bit of disc see this surface and the rest depends upon your two x-rays whether you are putting it in the right place or not okay so here is what it looks like and this is the x-ray which I showed my chairman of the department in 1997 and he said this patient must be dead I don't know where the screw is and then I showed him the lateral x-ray also and he said oh So we looked at our this is old data now it's probably 150 I don't know who's writing it up now I think it's 150 patients now so till 2006 and I started in 1997 we had done only 42 most of them were males and the ages were children as well as elderly gentlemen most of the patients did not have this deficit and you see very few people had it most of them were just pain nothing else but pain most of them are anterior as we saw from literature even literature says that most of the displacement is anterior so first 11 patients we had only one x-ray in our operating room we didn't have two x-rays so I had to do AP then lateral then AP is in lateral and sometimes I had to de scrub I had to remove my gloves and go and adjust the x-ray myself to get the exact image back again few millimeters I used to advance the screw and then I used to get scared I don't know where the screws going so but after we had two x-rays then it was much easier so most of these patients have been done with both and all the patients I've used the single lag screw or four millimeter diameter in 11 patients and after that we had this hollow titanium which you can put on a guide wire you know everything can become guided then it makes life simpler when you are sure that it's not going to go anywhere it's going to go on your guide wire so the later patients I think we had done with this lag screw no major complication nothing in fact and we had follow-up data of 37 patients of the remaining five one we never knew what happened to him and four when this was written up four were still very recent just a few months so we didn't have long-term data but out of whatever we could see all 37 had very good fusion with the anterior worldwide screw so fusion rate till that time was almost almost 100% if we consider only the follow-up patients so the advantages of this are immediate direct fixation of the fracture you're dealing with the pathology if you go and fix from the back and you fuse the joint you're not dealing with the pathology there may be advantages disadvantages sometimes you may have to do that but if you can deal directly with the pathology that is the best and here you're putting a screw right across the fracture and causing it to compress and fuse preserves the normal mobility of C1 and C2 which is very important there are fusion rates are very high more than 90% in the lowest reported cases and there is immediate improvement of cervical pain because the movement the moment that micro movement between the fracture segment goes away the pain goes away completely so here is a 32 year old which we had fixed and as you do it more and more you learn now this one is protruding slightly more than it should you know all these minor things these small things but these small things can cause a problem and if it's a thin patient who has a very thin neck it can actually press upon the esophagus of the trachea and it can cause a problem so you have to make sure that the head of the screw is buried completely under the level of the vertical body and it doesn't project out is another example and that's what it looks like on a CT scan if you do a post-op CT it should engage the top the cortical surface of the odontoid the most distal cortical surface otherwise you won't get that lag effect because it's only that when the screw threads hold the cortical bone that you get that lag effect if you're still in the cancerless bone you won't get that lag effect so to get that lag you need to engage the cortex on the distal side of the odontoid and well it should be placed right in the middle hopefully and in this patient it's everything was alright and this is where the C2-3 disc is so that's how it should be another patient before traction once you put him on traction everything looks aligned there is still a gap but it looks at least the displacement which is gone now and now we can be fixed with an odontoid screw and that's what we did and it worked alright and the oldest patient which I had done and now there are other colleagues who do all these things 80-year-old gentleman 15 days old injury no neurological deficit but he was bedridden due to the pain he used to come with his head held like this and used to say it hurts so much that I can't even move otherwise he was neurologically ill and immediately after surgery everything was fine and this spilt is probably because of some muscle plasm and not because of any rotatory he confirmed that so x-ray CT and MRI studied properly understand the anatomy reduced with traction the sine cone on of anti-rototoid screw fixation is reduction if you cannot reduce it you cannot do this operation and the operation has to be based on these two and you should be able to manage suppose the erotoid screw while doing the surgery you realize that you can't do it it's not possible to put the screw either you're not getting the angle or the C2 body for something wrong with it or your screw something is happening it's not going into the right place then you should be able to do the other operation to turn the patient over and do a posterior surgery if you cannot handle everything don't go into it what will you do if you can't do it you have stuck the patient is the same so all rounds you should be able to do everything then only so it's the treatment of choice for acute type 2 erotoid fracture which can be reduced and if you do it properly there's no mobility and there's immediate mobility you can make the patient stand and walk and do everything almost immediately and a single screw is sufficient to provide good fixation and fusion thank you very much


Moving on to Nottingham Forest. Now they have a confession to me. I don't like sponsorless kits Yeah, I don't I think they look like kids kits or like non-league kits Seeing you know sponsored kits for too long now. It's the norm It looks like there's something missing like I don't like steak on Everton's kit But I'd rather get a kit with steak on yeah without it looks too empty Makes it look too long. Well, that's it. It's too. There's just too much nothing. Yeah, it's missing something And if it adds a more ambitious design, let's say some sort of pattern, maybe Look at this the Zigo. Yeah, it make it compliments if it's Doesn't it I'm gonna say D D waste waste of the bunch. It's just it's just a plain red kid. It looks like it's from the 60s It's just fine. That's what you're going for but not me


The simplest way to change your life is to change your geography.  Move.