 My name is Tony Morris and thanks for having me here in India. This is my first time in India and I'm having a great time Thanks for having me so It's gone off the side. Oh So basically I live just off the bottom of this slide here in a place called Brisbane, Australia and Yeah, I came here three days ago. So again, thanks for having me Yeah, I'm not sure that resolution is going to work But anyway, I work at the Queensland functional programming lab We are a government funded so I work for the CSIRO, which is a federally federal funded research organization and Queensland government, which is the state I live in they fund a functional programming lab and We produce open source software Than to promote functional programming So some people often complain to me that how do I get my colleagues to use functional programming and so on and I Are sure you you can do it. You can even get your government to pay for it Okay, it can be done. You've just got to fight really hard, but it can be done So this talks about aviation So why aviation? So the real reason is I like choosing industries in which I can have an impact. I just see low-hanging fruit All right, so My house is near this airport. It's called Archfield Airport. My house is just over here somewhere and When I was riding home, I used to see this all the time and There's me not really Didn't get a haircut by the airplane. That's someone else and So I typed into Google. Hey teach me how to fly an airplane at Archfield Airport and my wife was she said this How much does that cost and aviation is expensive? So I won the argument. I just did that Yes, I win And So I'm currently studying Yeah, this slide has gone off off the bottom here. There's four levels I've recently passed a written exam for this level here and I'm still studying for that one So I'll tell you my experience about programming in that domain Just knowing that that's my knowledge at this point in time. So in Australia it's federally regulated by an organization called CASA and We provide we get services like weather and so on from air services Australia and We don't want this to happen In Australia, there are three different railway gauge widths Okay, you cannot get a train from well, you can actually but you got to change trains from Sydney to Brisbane You got to go along one of the railways and then switch to the other one All right, this sort of stuff goes on. There's three three of them So we have international organizations in aviation that make sure you know We don't want to fly from India to Brisbane. It's like, oh, you know, we we turn left and we turn right bang We don't want this to happen, right? So these two these two organizations look after that and they make sure we all agree on what the rules are around the world so just so you know India is just like Australia one of 191 signatories to the IKO and One of the governing councils just like Australia is So we have very similar aviation laws Australia and India So in Australia we have what's called the civil aviation act and the civil aviation safety regulation for and civil aviation orders, so they they inform us pilots of The laws that we must abide by in our operations in the air And we also have advisories, so it's recommended you do certain things is in that kind in that category So I'm going to talk about log books for a minute It's quite a small low-hanging fruit that I saw immediately when I started learning to fly airplanes So this is the actual law Basically it says I have to keep a log book by law and if someone walks up to me and says show me a log book I must be able to produce it That's what that says and a lot more other stuff basically that This is a paper log book So you write down the aircraft and and so on How long you were flying for and this is an obvious question. Can I? Can I have an electronic log book and the answer in Australia? Yes, you can so again, it's gone off the bottom Sorry about that, but it basically says you can't keep an electronic log book as long as if you're audited You can produce a paper copy. That's the law. Okay, so I can do whatever I want as long as I abide by that law So of course this results in the pilot log book cottage industry So if you go on the internet, right, you'll see this question Many thousands of times you'll see this question. So this guy here is a CFL. That's of those licenses And he's saying hey, I'm on a budget. What's everyone using and Someone someone might say Excel that Excel is always the top answer use Excel Or use a Google spreadsheet because that's just the same as Excel, but it's on the internet Or just use this proprietary one you've got to pay a hundred dollars a month or something. I don't know and So these are the kinds of comments you get this use this proprietary one here. Well, I hate this one. Don't use that one But sometimes I cross the dateline and then it stops working So Oh Where's my log book gone? I put it into the software and the software break. It's gone So this happens quite a lot So I might make the argument that if you are a responsible pilot you must use Haskell to do log books My argument is that a log book is an algebraic data type. How do you express those you use Haskell clearly and We use really good functions for querying log books. I'm going to show you some of the queries that um, I've had to do before And of course, I need I need to meet this this requirement for printing it out So I write it in Haskell and I just say I got ordered to make a PDF or something like that So this is it's this is some real code that I had to write once Basically, I had to turn the uppercase of all the people in my log book is including flight instructors to uppercase I don't know why someone said you have to so I did I said no worries. Here's the function. So this uses lenses To go into the surname of the log book of the person who owns the log book into the log book itself and turn them all into uppercase that's handy and This one shows me a aircraft. That's the list of aircraft get all the aircraft They want to see all the aircraft that I have flown before someone wanted to know that one day. So I wrote that function and Find so the aircraft have registration numbers. So find the first flight that I've had in that aircraft So someone asked me about that there was a reason I need to talk about what my first flight in that aircraft was so I just wrote the lens and I said there you go and Total day hours, so there's a difference between day and night flying so total day hours as in command of the aircraft As opposed so when you have with an instructor you are not in command of the aircraft So while I'm in command of the aircraft how many day hours have I done? Again lenses. So actually this is a monosomorphism So I'm kind of part of this talk actually assumes, you know, how good lenses are all right So if you've not used lenses before it is how we manipulate mutable data structures Sorry immutable data structures particularly in Haskell Okay, so you can imagine there's this great big log book data type And I need to navigate down and do certain things do reads and writes and so on and we use lenses for that in Haskell So these are examples of lenses. This is an isomorphism. So is that one and Basically these operations work on the lenses. So I just glue all these functions together and they become first class I can do whatever I want with them And then sometimes I need to pretty print Okay, I do it in HTML, right? So Casa comes along and says show me your logbook and I say no problem There you go, and I send it to the printer. Every airport has a printer many printers actually Hmm. So basically One of my goals is to be able to query the logbook in the most obtuse way that I possibly can think of Okay, so I set myself this goal. All right immediately. I can't use Excel I can't use Google spreadsheets. In fact, I can't use any of those things. I must use Haskell All right, so I just set up this silly thing if the day of the month is a multiple of seven and That's an airport there YCM in Australia and and so on you obviously can read that But it's an obtuse example and basically I want I want to set the following challenge is that you can come up to me right now and say Here's a really bizarre thing. I need you to write about your logbook. And I was like, yeah, no worries Glue some functions together and there you go. That was my goal so um and However obtuse you give it to me that's proportional to the effort, right? So if you just say a simple thing Here's the simple function. Here's the obtuse thing. Well, I've just got to glue a few more things together Because the alternative These are things that have that happen to logbooks Okay So if you if you go into the back of an airport one day if you go into like a flight operator somewhere You will see people with their flight instructor uniforms on with a pencil against the computer wanted to do in this counting something I don't know what it is. They're counting something And I'm like man just use Haskell it can count too so a Lot of a lot of flight training is your ability to actually move a pencil down a monitor without making a mistake Okay, so count all the aircraft that you flew on a Tuesday. So you list them all and you go, right? That was a Tuesday and At the end if you get the right answer you get your license No, I'm exaggerating, but it's a bit of it is like that Okay, and I like to call this flesh computing. All right So you see them there with the flight instructors there and they're their little computers counting flesh computing Very error prone right so very very error prone like fortunately if you get it wrong on the ground, it's okay Hopefully actually for most things like you don't want to calculate fuel like that. Let's say But some things it's some things. It's okay But there's a lot of pride taken in aviation in the ability to do a computer's job and I find that obscene just saying so That was pretty easy right my logbooks in Haskell I could show it to you if I got the castle walked in the door There you go. That's fine people always walk up to me and they say oh, how do you do your logbook? I've got paper this thick. I need to convert it to electronics like here's Haskell and you know Their mind explodes and then they go and use Excel but It would be cool if I could show them how to use Haskell I've got one flight instructor that I've almost got using Haskell working on it so Another subject I want to talk about is aeronautical data and information and I've not looked at the laws in India But I am going to guess that they're roughly the same as this. Okay, so The civil aviation safety regulations section 175 is all about aeronautical information service providing okay, so just providing certain information like maps and weather and so on and Basically, there's a law. There's a law for me as the pilot that says I have to carry appropriate maps for my flight operation Okay, so if I'm flying to India, I have to have a map of a proper map of all the different Things you know airspace related things in India not that I've ever flown to India I don't think I'd make it hit the water. I'd run out of petrol. But anyway, so this this is a visual terminal chart for Brisbane It looks quite innocent there doesn't it? But down the bottom of this slide that's gone off the bottom here. It actually says that it's one meter by 500 millimeters wide and Can you imagine opening that in the cockpit? No one opens it in the cockpit. In fact, I saw a photo yesterday on the internet of someone in a Boeing 737 Who was using it as a sunshade? That's no joke If you go if you go into the aviation forums where everyone's sort of joking around there's a picture there It's like this is what they're for there's a pilot. There's a bit sunny. He's put the put his map up on the windscreen So what really happens is? This is I can actually see that there's Brisbane City of Brisbane here. This is the Brisbane Airport Is what really happens is I on the ground I work out where I'm going to go and I fold the map appropriately All right, that's actually what happens. Okay, so if I'm flying from here to here these creases are the correct ones Okay, and you know you don't want to get too close because I might have to divert or something So maybe I'll put a margin in there just to be safe That happens. All right bearing that in mind So they're required and clearly I can't read I can't unfold out this great big map So actually what I do is I memorize them. Okay, I memorize if you flew those those circles back there by the way We're um, these are airspace boundaries. All right, so if I at certain heights and if I go in there Brisbane Airport rings me up on the radio and says, hey You're not meant to be there All right, so I have to memorize them and don't screw it up Don't want to bump into the you know holidays into Brisbane. Whoops can't happen. All right So do these maps exist in in a electronic format? Yes, but You must use one of the approved ones. You must use one of the approved aeronautical data providers for the electronic maps And in Australia, there's only two providers Two companies who make a lot of money So let's use them But yeah, they're the the authoritative source the paper maps are where these electronic maps come from Okay, so this is This is not one of those it's of a different one. It's in the USA this one, but basically you fly across JPEG files It's the same thing. This is JPEG files JPEG file and you fly across it and you go. What's that fit? I don't know it's a JPEG file and They don't do JPEG rectify. All right, so you know about map projections and so on you sort of get these ones going on That could be two miles or something I don't know So you have to work this out. In fact, I do have a map I didn't bring it with me, but I do have a map that is I'm sticky tape together along this line and I like I Did that? I'm not joking. So Basically it's gone off this off the end here, but here it so my house here I live here in Bell Bird Park wherever that is somewhere around here. There it is and This here is the raft base in Amberley. That's the Royal Australian Air Force and So that's quite a big big Air Force base in Australia in Brisbane and that this is the Green Bank Army range here So this is the military in Australia and there's Archfield Airport Okay, that's that's where I do my training Okay, bear that in mind all right because Don't want to make a mistake with these maps because here's the actual map and This here this line is the Amberley military controlled airspace Do not cross that line between surface to 8,500 feet There's a few little footnotes that you actually can over Amberley. There's a few you actually can for certain reasons however, there's Green Bank Army range and It's this is called an RA3. That's the highest level of restricted airspace in Australia from the surface to 2,000 feet So what happens if I did? What happens if I just sort of take off go through there? So they stand there and shoot me out of the sky No, this is what happens. This is in the aeronautical service provider is I get intercepted by a fighter jet and I'd really don't want that to happen There's all these things I have to know it's like if they wag their wings I have to follow them and Because they can't contact me on the radio and so on so this is if I screw up with my paper map that I didn't fold correctly That's what's going to happen Now the truth is um, I asked I went to an air show at Amberley Air Force Base and there was a guy there and I said hey, what are you doing here? Like he's in his he's got his Air Force uniform on he goes my job here is to teach pilots not to incurs on our military airspace Okay, that's a cool job And I said I said look if if I do one day are you really gonna send a fighter jet up there? I mean, what's I'm gonna I'm gonna crap myself You know, are you really gonna do that? He goes no we found that when we did that? The aeroplane fell out of the sky because the pilot got so scared. We don't do that anymore So now I don't know what happens. He didn't actually tell me what does happen. So Hopefully I don't do that. I'll fold my map studiously every every day So there is an alternative which is to use non-certified aeronautical data and then you have restrictions on what you can do Okay, so I'm operating under CASA laws all those aviation laws. I can have restrictions and do something else instead however This makes me a bit annoyed this one is this is a this is an aircraft. It's a small aircraft registered in New Zealand. That's what that zk means and This here is controlled flight into terrain So that means that the aircraft did not lose control, but it collided with terrain Why did it collide with terrain? That seems silly controlled flight so It's not like you know the engine cut out or anything like that. It's just bang into the terrain. Why? Well, this aircraft was flying VFR and IMC and VFR and IMC is a very dangerous condition. I mean in fact, there is one study on VFR and IMC by CASA It like in the world one study by CASA and that study was What is the average time to your death if you fly VFR and IMC and the answer is 178 seconds? Not joking just you type that into Google right now 178 seconds. I think you'll find that study So this pilot Was flying VFR and IMC which is in order to get your license You have to execute a maneuver to exit out of IMC under VFR So I had to do that to get my license. So the instructor said hey put a blindfold on you can't see Pretend you're in IMC get out of it, but this pilot sustained it He was feeling very confident that day that pilot So that was the main factor VFR so VFR means visual flight rules and when you're flying VFR that means you must maintain a visual reference to Well, you must maintain a visual reference usually to the ground unless you're on top of cloud Then there's other restrictions, but you must maintain visual reference and INC means instrument meteorological conditions So that is the conditions that we are in the meteorological conditions are such that we should be using instruments So not visual So you can only enter that if you're flying IFR So if you're flying under instrument flight rules So when you take off from Bangalore airport, you'll be flying IFR. All right, so I don't fly a far So that's you know, if you when you take off and you enter into cloud, they're flying IFR That's cool, but this guy was not he was flying VFR and not only that to fly IFR. That's an entire rating on your license I don't have that rating you have to do a lot of training to do that and your aircraft must have certain Additional equipment on board which it did not Okay, so all the ones that you guys travel in don't worry about it They've got the equipment those pilots are trained to fly IFR, but this guy was not and neither was the aircraft equipped so So actually I was just gonna work. Yes Okay, so I have a question. This is a this is from the accident report from this aircraft and Basically my question to you is this aircraft is heading toward high terrain What's its height? Does anyone know? For those of you at the back, it's down here. Sorry So this aircraft is heading towards terrain high terrain these points mean like a peak on a mountain or something and What's its height? 1717 This here is the height of the aircraft above the sea level So he's 3500 feet. This is actually an error. So the map data had an error in it He is not 409 feet above the ground You see those two maps joining That's a three Okay, it was found that the map did not display the three correctly So he can't see he's looking at his avionics sees that thinks it's a one bang Come on web programmers. We can do better than that that there's a three Okay, so that was a fatal accident Yeah, these two things. Oh, yeah, yeah, yeah It's true. Yeah so I sympathize with regulators of aviation where you know, they don't want to have any old person making aeronautical maps That would be bad Okay, however, I think we as programmers can do better than that although this pilot was doing dangerous things VFR and IMC and You're not meant to you it's illegal to do that There's a law that says definitely do that. Don't do that and He's relying on his map because he's feeling overconfident. So this happens occasionally But even so I think we can do better us programmers and I'm working on that problem. So Stay tuned Don't hit the mountain Okay, so I'll talk about something called weight and balance. So this is a problem I have solved So just a few principles on weight and balance I put that there because I'm trying to convince my boss to buy me an airplane But um, it's not gonna happen. So basically This here is the center of gravity of the aircraft and this is the center of lift So that's where so the lift is provided on the aircraft here There's also a downforce on here that provides stability So there's an upwards and a downwards force and there's a center of gravity and that replies to every airplane including an a380 if you've ever been in one Sometimes the center of lift is called the center of pressure and center of gravity is forward to the center of pressure There's a downforce on the tail plane then that that's how an airplane stays in the sky essentially so Clearly right. So if we look at this is if I put a lot of weight here the airplane is going to pitch up and That would be bad. We need we need this center of gravity in the right spot So that's called Balance and also we just need to be care about our overall weight so that we can even just get off the ground Right. So we need weight to we need the lift to overcome the weight to get off the ground So balance is ensuring the CG is positioned such that we can control right? So we go up and we we try to go down if the CG is behind us. It won't go down. It'll just All out of the sky. So we have to every time I do a flight I have to calculate the weight and balance and To do that you take So in my aircraft is poor seat aircraft You have the front row in the rear row you have to our two baggage rows Fuel and oil and the actual aircraft you have these parameters to work with calculate weight and balance and basically each of these has an arm So that's a distance from the center of gravity and then you multiply the weight by the arm And that will give you I'm sorry the moment that will give you the arm All right, so this will have a moment with the front the front seat passions will sit you know some number of inches from the center of gravity and Then I'll multiply that by the moment. I'll get the arm Every time I ask someone at least in Australia how heavy they are they'll say something kilograms Right, that's what I say Unfortunately my aeroplane's in pounds so I have to convert how many areas occur because of that lots you can guess All right, so and then you then you add them all up So you multiply them all and you might add them all up And then now you've got the total moment and you've also got the total weight because you just add all the weights up So and then you plot that on this graph, which is so this here is the weight So let's imagine all the weight and landed at 2,400 and down here's the moment and We found a moment and it sort of falls in here and we go we can go flying We're within this envelope we can go flying over here. We're out of balance up here We're above the takeoff weight and so on so That would be bad if we got it wrong. Hey, let's go flying or whoops go to take off and didn't get off the runway hit the trees at The end this happens They do all this work. You have to do this to get you get examined on it and then suddenly someone just Converted pounds to kilograms the wrong way like reciprocated or something happens all the time So I did in Haskell clearly So this happened this actually has happened to me is you get your front row passengers and your rear row passengers they have different weights and Or the aircraft itself is it has different weights and they said oh, we've just changed your aircraft now when I do weight And balance I usually do it the day before I go flying. I have no stress. I'm sitting there at home work it all out double check it and Now I'm about to take off and they say that so I now have to do it all over again That sucks Jessica once said I can I sit in the front Jessica what is not very heavy compared to the person who sits in the front now To do it all over again. Well, this is what really happens. I'll tell you what really happens They go Jessica. She doesn't weigh that much less than Bob It'll be right and then we swap seats. That's what actually happens So we can do it in Haskell actually of course we can and Jessica is a function argument She can sit wherever she likes. I'll just apply a function to her and says the aircraft they're also arguments and And there's a there's a package called diagrams are written in Haskell that produces diagrams like it You know PDF files and so on vector diagrams using Haskell so Here is the result. This is a result of a real flight. So this is the output of diagrams This line here is maximum fuel and that's empty fuel That's usable fuel. So there's a little bit of fuel that you got to have in your tank for usability And this is the amount that was in the aeroplane at the time All right, so you can see that I could Fill the tank up and I can burn all the fuel and I won't fall out of the envelope All right, so Basically, I just wrote the parameters and I said in Haskell and I just ran the main function and this popped out Okay, so I have much more confidence in my calculation and also does all the unit conversions. So They're also revision control. So if I get audited and this happens So cast a wall stuff and says hey, where's your weight and balance? I say stand by it's in Haskell. I'll just Break out my laptop Hand them a PDF and I publish it as a library, right? So then I can give you all these functions and You can calculate weight and balance for any aircraft that you like And you know when you go and fly in the big expensive aeroplanes, they've already got that done not in Haskell. I'm sure Probably in some two hundred thousand dollar C function All right, that's been audited over and over and probably won't break Yeah, it's been you know, you run tests a billion times and then you build up confidence And then there's like some edge case and you go, I know all that confidence. I imagine that's what it is So and also I can go back to my weight and balance. So people who do it on paper They tend to do the weight and balance put it in their pocket go flying and throw it in the bin Right. I don't I've got it in git. It's in Haskell So this is the real this is the real code my screenshot of my code. So there's me. There's George There's Jessica. There's that's my son there. There's Paul. So This this is an aircraft here. Let me see your echo It's called the basic empty weight basic empty weight of that aircraft is one thousand six hundred ninety one point six pounds and Of course people give me their weight in their kilograms and This is a particular flight that I conducted on the 2nd of January 2017 There's me in the left seat George in the right seat Jessica. No one else. It was just three of us I put 40 US gallons of fuel on board of Abgas 100LL that's the type of fuel they'll have different weights and 10 kilograms of baggage and there's a two baggage compartment. So there was nothing in the other one and out comes that diagram I feel less stressed now. I'm sure I'm not gonna hit the trees at the end of the runway. I'm using Haskell All right, so one last thing I want to talk about is ADS-B. Okay, so what's ADS-B? ADS-B is on board Certainly all IFR aircraft In Australia as of 2017 and probably India as well. So all you when you take off from Bangalore Airport that aircraft will be broadcasting over ADS-B and It's broadcasting certain things such as the latitude, longitude, the track, the Altitude whether it's climbing or descending Any emergency indicators and so on. So there's a bunch of parameters in this radio signal that a broadcast over ADS-B So I don't know if you have this problem in India, but we have this problem in Australia of people flying their drones Near the airport Yeah Okay, and the problem with that is There's two ways that people on the ground can see aircraft one is by ADS-B the aircraft is telling you where it is and The other one is by radar So it's it's going up and hitting the aircraft and getting a signal back and the problem with these drones is they do neither okay, they don't have ADS-B on board and There's some quite often you can't pick them up with a radar. They're too small All right, so this is creating quite a problem and it's being proposed that ADS-B is on board these drones to help help this problem. There's all sorts of solutions being proposed I like the solution. Just don't be an idiot. Don't fly near the airport doesn't seem to work So what's ADS-B so there's a few things gone off the bottom here, so the so all their friends have an international identifier The call sign position The accuracy of the GPS on board and just many many parameters come on an ADS-B signal And we can receive them on it's on that frequency there 1090 megahertz with a software digital radar, so I'll just show you a picture of one of those It's done using that hardware there I and by the way What about this right so the way traffic collision works like automated traffic collision is there's two aircraft They're both broadcasting their ADS-B One sees the other one the computer says if you don't do something you're going to crash So it gives them a warning and then they both turn and don't crash All right, so if I wanted to be an idiot I would go and spoof ADS-B All right, so I go and stand here at the bottom of a Bangalore airport and I go I'm going to put an aeroplane right there. I'll spoof it and watch and you know giggle to myself ha ha All right, so it has been simulated. It has been demonstrated that it could be done. All right. There's no security in it at all Yeah, don't give them any ideas I guess but I Haven't I don't know of any incident of it actually occurring but it can be done So this is just a picture of a device and by the way that device is sitting just over there behind the curtain I'm glad nobody found it, but it is there and It's got these two aerials on here picking up 1090 megahertz. There's the tuners and The antenna there is at my house The Haskell sticker on there making sure my neighbors know what I'm doing. I'm riding Haskell picking up some aeroplanes with Haskell it's got a accelerometer on board and I can't it's gone off the screen there, but basically there it is at my house is a display of what's going on and There it is picking up some aeroplanes. Okay, so I wish you could see that but basically that's all that's the entire record of Everything that comes From the traffic. All right, so any traffic picked up by those aerials goes into this record So I get all of these things. That's the tail number The emitter category a cat emitter category is what weight category the aircraft is for separation So heavy aircraft and I'm in my Cessna If I come along right behind that aircraft these kicked up all this weight turbulence and I go upside down I go, hey Don't be so heavy. No, I can't do that Basically you get separation so that that doesn't occur and Actually, that's my responsibility. So the way it really works is I see that there's an a380 in front of me And I must take appropriate action So that's the law So you get many many things from this radio signal And also on board that device is its situation. So it's attitude reference So pitch roll on your from the accelerometer the GPS and So I this is real Haskell code that I've written to interface with the device and my goal of doing this was to Demonstrate that I could write the software with it's about $200 worth of hardware not very expensive And I can carry it with me and it can SSH home and say what I'm doing All right, so I'm flying along. I turn I roll the aircraft It connects to my server at home over SSH and says the aircraft just turned left All right, so if I go missing they just go and look in my server logs. They know where I went All right, and it was just a prototype idea. It's like can I do this really cheaply? All right, so if you ever look into the cost of avionics, all right, you'll find that 1-0 is for the hardware and then you put about three zeros on the end for the certification All right So you'll go on you'll see like a ten thousand dollar computer. Yeah, that's about ten thousand And then you go, but it's certified. It's ten million straight away All right, so I don't have faith in certified hardware or software I believe in types Okay, so the idea is someone sitting there going through a test plan ticking boxes gives me no confidence And it shows I get in the I get in some airplanes There's an avionics and I turn it on and then it crashes and then I turn it off and then I go flying happens all the time Of course it crashes. It's certified It's a C program. All right, so let's write some code so basically This this code here is This is a bit of Haskell code that's going to interface with that device I don't know if there's any airplanes nearby. We'll find out That has a range because it's because only seeing one side of the building I found it has a range of about 15 to 20 nautical miles. So if there is an airplane nearby, we'll find it So basically I'm using lenses again I'm I'm going to ask for these parameters off the device and then just print them out All right, and that's in a it's in a do expression. Of course, if you know Haskell IO goes into do expressions And does it in a loop so it just sits there doing it, right? So what we're going to do so demo one We're going to get the situation. So that's not traffic. That's just That's the current Oh, no, that's the aircraft. Okay, so there is an aircraft nearby and You can see that it's heading at 233 degrees And I sorry, no, that is the device that is the device that device is currently facing 233 degrees over there somewhere and Has no role. That's because I I must have put a very level and And so on so that's not very interesting really it's altitude is 2,900 feet. There you go I'm not sure if that's correct But let's have a look at some traffic. So that's on demo two and there you go There is some aircraft that it's picking up live And you can see the latitude longitude scrolling by there I can see I think to aircraft coming past there. So basically it comes in pings So every time it receives it just prints out the aircraft. So these two flights Jai 2362 and SE J 562 Is that right? Yeah, so these these are two airplanes that are nearby that the aircraft are picking up and Wouldn't it be good if we could write traffic collision avoidance? Okay, so imagine imagine old mate that's gone VFR and IMC had this on board. He shouldn't have gone VFR and IMC I agree But imagine if you had this on board with terrain data, right? There's terrain data We can we can download that from NASA. All right, so we know the track. We know the height. It's very reliable just Simple things it would be like this is prototypical but with a lot more work and Demonstrating that it's reliable and can give good results. I think we as programmers could improve aviation and on I'm committed to doing that in my spare time So that's what I do and thanks for listening keep riding Haskell So are there any questions Yeah, yes, that's right. Yes Yeah, I know what you mean. Yeah, like the green screen, right? Yeah. Yeah, the radar didn't differentiate it to yeah, okay Absolutely. Yeah, so that that's part like there's an underlying argument. I'm trying to make right so there's a counter argument to my argument, which is simply We can't go and replace these systems without really good testing. All right, so it will be bad if I went and just put this in the control tower and said use this and You know my Haskell program added one accidentally You know there's like I'm not claiming to be really reliable But what so their argument is we've been doing this for decades with our green screens and it works out okay Occasionally incidents like this happen and if you look at aviation safety, it's it's extremely safe but unfortunately these things happen and I am in the in the business of thinking about well, can we do even better? Alright, so like I Really enjoy how safe aviation is just like I'm making fun of it a bit Just the the rigorous processes that you go through to even get a license and all these procedures ATC sitting there with their green screen and the problem that we've got is Well, we can sit here and show this really cheap hardware doing these simple things We have to go through the process of certifying that and making sure it absolutely does provide an improvement and that's a lot of money so What what we as programmers need to do is demonstrate that yes We can improve safety with these things because if I walk up to someone who is who? Who's not into programming like they're into aviation? Let's say and I try and convince them to start using what I'm talking about They have this problem that I may make things worse Okay, or and they've got no way to judge whether or not it's better or worse so That there's a project that a friend of mine is is So a friend of mine actually got really so annoyed at the way aviation is regulated and and so on is that he quit his job and Decided he's going to work for CASA and change it from within CASA and he now works for CASA and so say and One of his his goals is to use What's called SEL 4 which is a proven kernel so an operating system that is proven correct to write avionics system so perhaps ATC ground-control operations and prove it correct The problem is the law doesn't account for that the law just says you need to put three zeros on the end and get it certified All right, but if I can just say maths All right, there should be a law that just says maths therefore. Yes All right, that would be a good law because that right so he is working on that The problem we've got is we do have this constant fight between well you have to just trust me it's going to be better and That's a big ask from from an industry. So yeah, help me out Yeah, and and I'm sorry to hear about incidents like that. Okay. I sit there and go what could have gone wrong, right? The ATC guy they're doing their best with their bit green screen. No question and they're good at it They're really good at it, but can we do better? Yeah Yeah, the ones I've seen are C and XML C and XML for configuration Yeah, a flight plan is in XML format But I don't know to be honest I'm sure there's experts somewhere who could give a much better answer to that. Yeah Like I'm on the user of the of of the programs more than more than anything Yeah, and you know, I put an XML flight plan into the to the C program What what did I into get Get repository Yeah, which which data the logbook itself. Yeah, I'll show you my logbook. This is my real logbook So this is called my this is called a reference number aviation reference number 10073036 is my number and here. So basically let's talk about a flight. I did recently. All right, so if you scroll right down Right down. Okay, so the last flight that I did Geez was Last flight that I did was a no instrument flight dual so I did it with an instructor and This is its name. I did it in that aircraft. There's the instructor I did 1.9 hours. I might have to keep track of landings as landings and takeoffs as well for certain currency reasons So basically this is says I took off from Archfield Airport I landed at Kilkoy, then I landed at Kilkoy, then I landed at Kilkoy. Oh, sorry Yeah, so I landed took off from Archfield Kilkoy Kilkoy Kilkoy So I just sat there hitting the runway three times then I went back to Archfield I did that on the 7th of November. All right, so a couple of weeks ago and I take pictures of so there's it that there is some necessary paperwork in aviation, right? So I'm saying it's all electronic, but it's not you actually I have to do this is this is my navigation log and I have to fill that out as I fly and so on. This is called a world aeronautical chart I had to fill one of those out and to fill out a flight notification form to services And I took photos of these and keep them in my logbook because one day I might care All right, most people throw them in the bin, right? They get out of the aeroplanes like right throw that in the bin, but I don't and And this is this is just a list of all all the aviation related entries that I've done All the way down to that flight that I just did. All right, and that's that's in git And there's a compiler for it to HTML and whatever PDF. Yeah Yeah So While I've been learning that has not been changed So that law CASR 9098 was when it was last changed and I don't think it's going to change at any time The most recent change was about a week ago. They changed the way that Weather forecasts are given so it used to be called what's called an area forecast and now it's a graphical area forecast So that changes things So things do change, but in terms of my logbook nothing has changed I log more than the law requires me to I don't need to keep those pictures, but I do Yeah, like I could probably even put the weight and balance chart there now that I think about it No one's gonna that doesn't happen, right? So When when you get audited for weight and balance No one's gonna ask me a week later All right, because they've thrown it in the bin by then It's as you're walking back to the to the to the airport like from the from the from the runway or the taxiway Yeah, yep the flight plan or the or the the logbook That I would need have you got the internet because I don't actually I can let's give it a go. Let's try Come on wireless. Oh, yeah, I got one of those We just I just have to crank this handle. Well, maybe the compiler outputs already there Okay, I think the answer might be no or might be yes So this is the HTML output that includes all the Metadata alright, so if I were audited I wouldn't give them this one. I'd remove all that metadata There's another compiler that I write that removes it so This is just this is an overview Mostly of things that I need to look at real quickly how many How many hours have I done in a Cessna 162 skycatcher? Well, I've done five point nine hours total Zero of those were in command so they were all with an instructor for example, and then You can go and you can even look at My exam results if you if you want to go flying with me Make sure I know what I'm doing But yeah, it'll it'll take a lot of later. But yeah, that's that's an example of Of an output HTML output. Yeah, so so if I'm logging more than I'm required what kind of mistake might I make like I'm not sure of your question Yeah Yeah, I agree. I agree So I have this I have this perhaps naive view. All right, and and it's it's under test I I hope I'm right All right, which is CASA our regulator so they will be the people who would care about that is like I make every effort to ensure that my flights are legal and safe All right, so I do everything I possibly can and CASA takes on the attitude of they will support me in that Even if I make a mistake in an illegal mistake. All right, so You'll find that when CASA takes enforcement action against pilots. It's usually because they are deliberately negligent Okay, so if I turn up at the airport drunk I'll lose my license no question, but there are so many laws and if I make a slight mistake on one of those laws and I commit an illegal act and CASA takes the view that they will retrain so that means that there's a deficiency in my knowledge and actions and They will fill in that gap to help me continue what I'm doing. So I hope that's true It seems to be true and I've had no problems so far But the day I do and that stops being true then I'll say you were right. Yeah All right, so I'm conducting a little experiments like yeah, well aviation safe Why it's because we don't take punitive action unless it's deliberately negligent, right? So I know not to get drunk. That's pretty straightforward, but there's certain things like You must be stabilized on a final approach before 500 feet AGL. All right, so 500 feet I must be stabilized. What does stabilized mean that even that's a bit iffy, right? But you can clearly see that that law has been made for safety reasons All right, so using my judgment. I go. Well, I think I'm stabilized. I'm well above 500 feet I think I'm within the parameters But if I was deliberately negligent so like I'm a hundred feet I'm blowing all over for not even facing the runway yet That's clearly negligence. All right, so a bit a little bit of leeway in between. I think is just CASA will not take punitive action unless it's very deliberate and that seems to be the case Yeah, and I really support that idea Yes Yes. Yes, so I have a terrible memory and I My word I'll tell you my worst problem that I've ever had. All right in terms of memory is um So before I take off I have to do so many things. All right, so a lot of them I have remembered and and but one of them is um You set the barometric pressure on the altimeter. All right, and the idea of that is So the altimeter is a function of the barometric pressure. All right, so by law I must receive a weather report. I get the current pressure and I set it on the altimeter and this particular airplane. I was flying In Australia we use hector pascals and America uses inches Mercury and this airplane had both and Which made the two dials very small All right, so I believed I had set it correctly and on them meant to cross check which I did not do Okay, so my airport is at 65 feet above sea level and It was indicating negative 200 feet and I failed to notice that during all of my actions and I had two passengers on board which makes this even worse But what happened is I took off from the runway. I did not perform the cross check that I was meant to do I took off I believed I'd set it correctly as I'm taking off I notice that the altimeter because as you take off you do all sorts of things like check the altimeter I don't know how high you are if there's an engine failure What I'm going to do is a function of that old altitude so immediately I look at the altitude and decide what to do So I'm cross-checking at the whole time and I look and I go what? negative 200 what's that about and I made the decision to continue the climb and I reached up to Pat and altitude and I didn't say anything my passengers at this point. I'm just like I'm gonna troubleshoot figure out What's going on? Have I had an instrument failure? What have I done wrong? I radio to the tower and I said Have you got me a thousand feet the Pat and altitude and is the barometric pressure? Whatever it was at the time and they said you've got the barometric pressure, right? But you're at 1200 feet and I and I was about to terminate the flight and I'm and I'm just like I'm holy shit. What's going on and I took my glasses off and I leaned in and I looked at the little indicator and I was off I was off by four hectopascals for eight hectopascals, and I dialed it in correctly and it was 1,200 so I fixed it so Those are the kinds of mistakes that can occur yeah in turn to checklists So that's I find that embarrassing, but it's true. I did it had passengers. I told them I said hey I can't count sorry about that, but I can fly it's all right But yeah, like it if you look at all the other things that I could have committed an error on So aviation safety is all about multi-factored safety. So this was clearly a risk to the flight However, because I've done everything else correctly This became a small risk and you get trained on troubleshooting. I troubleshooted it I figured out the problem fixed it the flight continued where it becomes a problem is I didn't check the engine oil The engine fails the altimeters Giving me the wrong reading like many things are going wrong all at once. That's that's when air accidents occur Yeah, so that was my worst story. I said it on camera All right, thanks everyone