Okay, good afternoon. Thanks for coming to my talk. I know there's other great options and so I appreciate you stopping by and Watching with me the live migration of a Java EE application based on web sphere to a cloud foundry environment As you can see also here there are two names listed So one is myself the other one is my colleague Torsten unfortunately, he had to cancel his trip in the night before the flight he had to go to the hospital in an emergency and This I don't know He's doing better now, but it was unable to travel so Quick shout out from my side and I know if this is recorded in later on on YouTube But you'll be missed my friend and it's not the same to stand up on the stage here on my own Wish your speedy recovery This also had of course a bit of an effect on the on the things that I want to show because we had kind of split the individual demo step, so I had to align it a little bit and Now we're gonna see how things go So as I said, it is kind of a live demo. So there are almost no slides. I have a few slides just as a like a Visual representation of the things that I that I try to do and try to show and what is that a thing is coming from I should probably say we have done an initial Presentation of this talk last year at the cloud foundry summit in in Basel However, this was more on a talk in a conceptual way why we did the individual things and how we approach it and so on and More about the technical backgrounds the one today is more about how we actually did it So showing the steps that we that we tried to do in order to get the job done So more on a hands-on kind of thing So if you have any further questions about why we came to that conclusion or why I did certain things that way I'm happy to answer any questions in the end Also, there will be a couple of like Times where I deploy things and we have to wait a little bit and I can have I'm happy to answer questions there as well so this is basically how the The high-level overview of how things started so initially we had a web or we still have that an application running on a clustered web sphere in a local data center and our the desire of our client was basically to modernize this application stack and Run this run the software in on a cloud-based platform potentially develop in in towards a microservice architecture So it's pretty much like here is our monolith running on the cloud for us. We don't care how all right and So well This was new for us as well This is the we have done it a couple of times in the meantime, but this was like the experience report from the first time We did it The steps we're going to show first of all web sphere was not we found web to not to be the suitable application like the application server runtime for for microservices So the first step would be to migrate from web sphere to web celebrity profile. This is like a lightweight application server also with its roots in IBM After that if this step goes fine and it most likely will go fine Trying the cloud foundry approach cloud foundry does have a community build pack for Liberty profile So that's was an initial decision for us to take that direction And then the first thing we did was trying to run it on a local development environment like a PCF dev still having it connected to the same back-end services that we had at the time and Then the final step to get it running in the cloud was using a solution to run on PCF on Azure And this case of course also involved not only the migration of the application side, but also of the back-end services so initially the The web sphere landscape was connected to it to DB to DB to most likely not available on Azure as a managed service So we did a migration to to postgres at the time Okay, so About the application it's a big Ear file it has about two hundred fifty thousand lines of code So it's not not the largest of all monoliths, but it's definitely pick on in a microservice and it's it's more it's in it's a back-end application from an automotive client that we serve and Most of the incoming calls are being done through rest There's also a bit of a web interface that I'm gonna show for validation, but it's not like a fancy UI application It's mostly about data processing. So it does about a million requests in an hour or so So it's con on the constant load which also had an effect on our decisions in in the migration so the first step as I said is basically trying to take web sphere out and Bring liberty in as a validation to say if this is running on a lot on a much lighter Java EE infrastructure than web sphere is and this is also like the recommended solution From both IBM and Pivotal to to to run those workloads in in cloud foundry or in containers in general And that's the thing we tried to do so Is that big enough for the people in the background to read? If you cannot see it raise your hands, please, okay, I'll Getting better Okay So I have a couple of photos here with the individual demo steps So I'm not going to show anything how the application is running in web sphere So I'm really starting at the point where I say Here is the ear file and we gonna look at that So the ear file is basically this one here. It has about 14 megabytes in size So I should probably say this is like the real world code The only thing that we did was completely scramble it and take all the references out From the internal project names and and custom name and so on In order to use it as for such demo purposes But it's not something we set up in a fake way to do a demo on that So this is the the real code of that application The first thing we did is their IBM provides a tool called The binary app scanner and with this one will basically scan the ear file To check what kind of technologies we're internally using and if they are compliant with a liberty runtime And what you need to basically do to enable them So this is a Java application. I Provide the I think It works like that Okay, so it's we're gonna go over that list and that feature list command will will actually trigger an Xml configuration to use later on with with liberty and it can also bring up a Migration report file. This is something that I have done in advance in order to save some time here So after executing this file, we're gonna get this one And if I look into that these are like the features that it has detected from a Java e technology perspective which we would then in turn need to to run it in a To run in a liberty profile now looking at that web page real quick This is a long website that you're going to get this application migration report So it will basically check If it finds certain platforms to be compliant to run it with This will also evaluate the individual technologies that you use and it will also Describe a couple of things that it found that you say well this runs on a web sphere But it's not running on a liberty. So please have a look into that to to update your code I'm just gonna close that section. It also I mean this shows the content of the file I think it would be pointless for you to throw you something in the code but just to give you an impression of what the complexity of the application kind of is and It's a good analysis tool for the application in general but very helpful also for the migration in the end It will come up with these features and these are the features that we basically use them to for the application migration So I'm trying to show that now What you what you're gonna have to come up with in the end is a so-called server XML file and that on the top of the Server XML file you expressively these list those features like each ab is Chandy I what kind of security things and so on basically everything your application needs and what you can take from the From the scanning what you can't take from the scanning are your application specific properties Like if you set change the i entries for yourself or if you connect to a database, so right here you get like the reference to the db2 That your application can connect in the same way It would be kind of dangerous if the application scanner could read out the passwords and so on so these are the things that you have To set by yourself, so it's a combination basically your features and configuration after this one is done You can basically Run the thing so that we have I have written a little script to To do that so the important command is basically Liberty's bin server run and then uses that file in the beginning We just copy a few file because I've done a bit of local development here to adapt for this demo That's why I put it into the script file so I should probably also mention I have a db2 running in a Docker container, I hope it is running in a darker content. Yes, it is This one I will try to connect to the only thing I have to validate quickly is The network connection Because this this is how the application connects and this IP is different from the one in my hotel and at home But that looks like it hasn't changed again. So this is good that means I can run this and And now Liberty will basically come up You will see the the output of the locked files. It's probably not gonna tell you much or not as much as it as it tells me So in the meantime, I can give a bit of an idea of why we did things that way as I said before the the application is on the Very heavy load and it was not a good not not an easy thing for us Can I just Need to have an eye on that a little bit So it says initialization successful, I'm gonna continue with that story later Because now I can I should be good to show it I just need to scroll back a little and see it will basically say at some point where the application is running And what port is it bound to so this is the one right here And if I go to my browser again and put the URL in Then I'm basically getting the the UI of that application. So It basically is a registry for the vehicles users partners and so on I mean, we're not really interested in what the application does internally just to show that things up can be run that way So that means the first part of the migration has then finished So we know we can run the application on Liberty now and Have a look at the further steps. So the next thing would be to make it run on cloud foundry And we used PCF death a lot for like local development That means what what we did was running PCF death on the local environment. Just leave the database as it is and Not run it with the Liberty profile in that way But using that Liberty build pack and run the application on top of that so I should probably also mention we didn't connect to db2 as as a User-provided service as cloud foundry would probably as it would be a best practice in cloud foundry We basically just connected straight over the network just to see if the application service Or the application can connect successfully All right, so To save some Memory if this work, okay, I'm gonna stop this application and Go over to the PCF now From a configuration perspective We left pretty much the server XML unchanged as it was connecting to the same database on the same host I'm on the same port. I mean the only thing we really had to set up is the money the manifest file and So what we specified was about two gigs of RAM One one gig of disk Specified that that zip file where the application is contained and explicitly Pick the build pack that we need to run So as you can see this is take coming from github from the cloud foundry from the cloud foundry space Is is is a community thing what you can see in the bottom here? It's just like IBM licensing information that you have to put in for making your liberty work okay, so Now as you are all here on the cloud foundry summit, I'm pretty sure you're familiar with this command Before I do it I just want to check if I'm connected to the right platform at the moment. So this is PCF depth. Yeah, this is good So I'm going to execute a CF push This will probably take a bit of time. I still have 18 minutes left for my overall migration. So that's looking good What will be happening now is first of all the The liberty container or like the instance will be created then it will have to detect what kind of features are required Those features are going to be installed then and in the end it will come up with a droplet They're holding the liberty application runtime and the application on top. So As it is quite heavy as you have seen before we We specified two gigs of RAM which we found to be sufficient for that purpose now as we wait on that I Can still come finish on the thing that I tried to explain before Lot of people have asked us why did we do this approach and not like try to rewrite things either in spring boot or create microservices and so on and The primary reason for that is as I said before we The application is live in production and is on the constant and heavy load so Rewriting stuff as microservice would have meant for us To have like a split development team for like maintaining the the legacy application and and running and creating the new one on the other hand We said if you can come to a way that we have the same code base that we run on on web sphere and on liberty Then we already know we have like a proper tested code because like this code base is always running in production and live and So we can't we shouldn't expect too many difficulties in that on the cloud side So the overall goal was still like to get it running on the cloud as a monolith And once we're there starting to take benefits of of a cloud platform like automatic restart scaling and so on But the first intention was to really get it there in the same shape Also, what we found is that especially running those tests and making it compliant for liberty liberty is It's kind of stricter in enforcing Java e or like Java in general policies and Webs like the same code Sometimes liberty would complain about something that webs for tolerated So in the end we we actually this helped us to make our code a little cleaner so once we got it running for liberty it was absolutely running fine on web sphere and This is basically The point where once you go to Now I can see Well as we wait on this are there any questions I can answer right now. Are you all good to follow? I Did it normally takes around four or five minutes on the first run And then once you once you start on stop the individual instance later on. It's like in a time frame of about 30 seconds to a minute and which is a lot of big improvement to what we had compared to the original web spin Moment where the startup time was about five minutes or so Now if this should for some whatever reason not come up In the desired time frame. I also have a Yes Okay, so repeating the question if I understood it correctly It's like if you find out during the migration process if the application is too big that you can't migrate it I mean in general We know we have to find out what too big means. I mean there's no size limitations so on I mean technically you can run everything in a container you can run web sooner container. It just doesn't make any sense. So This is the thing you need to really be careful of is Trying to comply with the 12 factor app guidelines and in particular to get in memory state out of the application This is basically one thing. We took us a bit of time to validate that we have the same instances Scaled that they prefer like they're doing this the same thing in the same way But from a from a size perspective in terms of lines of code or whatsoever There is no limitation if you're if this application runs on web sphere and doesn't really use any particular Libraries which don't exist there then it will run on Liberty as well in case if you get in such a scenario that it's really something Very I don't know legacy prone and you can't run it anywhere else then this approach will not work but we have done it for a couple of applications so far and Then the more the main effect we normally had was really just it helped us clean up our monolith code in the first place And once we had it migrated then it was kind of easy to kick off new Development and write new microservices alongside of it and deployed on the same platform or cut out microservices from the existing monolith so It says here waiting for the app to start I'm going to Yeah So it actually this one already says it has started let me just check the locks So this is still saying it is starting container became healthy Well, this one will actually say it has failed I think it runs in a timeout or something because it takes longer than the 300 seconds or whatever it has But as you can see on the locks on the right hand side, it is still in the process of of doing that and Will eventually become healthy, so I can already prepare for that and say I have CF apps then my link will be and the link local dot PC and Opening that here This our right is in need to specify The other port Right, so there it is I just this is the same application that you have seen before and as the URL reveals This is not a fake it is running on my local PCF environment now Which which basically tells me okay now have validated. It's not only Liberty compliant It's also the Cloud Foundry compliant and the next step would then be how I'm gonna get this Into like a enterprise level cloud so Looking at my windows, so that means we try to Stay on a platform level with with pivotal Cloud Foundry but we should remove the dev and switch it to a proper installation of pivotal Cloud Foundry running on Microsoft Azure and Tie it then to a Postgres database So what that basically means what we have to do is Do that database migration, I mean this is a part that I cannot show here completely I can just tell you what the steps you need to do from platform side in order to get there so I'm going to close this I can let the other one run Now I'm going to change the target This is an environment that I Got provided from our friends at at Pivotal to to demonstrate that and I hope the network is good enough right that looks good. So it says PCF Azure This is my endpoint and where I am connected so Basically what you need to do is Get yourself a database service and this is basically something we found really helpful running on that platform So I can open up the apps manager here. I'm sure most of you have seen something like that and You can also make this Sorry make this bigger and if you go to services here and you basically want to add a service you get all the the Azure Provided back end services directly like as native cloud founder services you can just invoke them with a simple CF create command and The in in the back end the the services will be created for you And once you once you're tied to the application all the connection information and credentials are going to be injected So this this one made it really really smooth for us to get there. So It's just that service creation That was one too many Takes a bit of time. I mean this I think in the background They will probably spin up a VM and put the database there. So for this case. I have already created one Which I called the psql test It and and now basically we need to access it from the outside and run our initial Configuration scripts for that database to make sure it will be running together with that application. So I have also on the application side. I think I can take this one out Well, I can actually use it. So I'm gonna save us the time of the CF push again That would be a similar thing. So the thing you should do in the first place then Do a CF push with a no start option. So that will basically just create the application and push the code But it's not gonna start any instances yet Just basically as the one you can see here, which I called anti-link backup and Then you can do a bind service This I guess it's the app name and then it's the service name and the service name was PSql test So it will probably tell me that I had they need to restage Did I oh it's back up? It's not so So yeah, it tells me to restage. This is something. I don't really care about what I really care about is I can now check the environment variables of my application and With that It will tell me all the connection information That got injected to the application from From Azure so I can see up here This is basically the URL where the application where the database back in is really running I got the configuration for username password and so on This is basically what is generated internally by the platform and injected to the application So from an application perspective the end user will never have to deal with that and I'm just Going to change the directory here and this will have a bit of an effect on the on the server XML so In the server XML you can then say the database name is just like cloud services and then PSql backup or psql test or whatever you name your your database connection is and all of that will be Injected to the application and will don't have to be configured out of there also what it means for us is We can we can leverage that to Connect to the database and configure it in the first place So I have a another script to do that. I think it's called restore psql Okay, so I need to split my screen here real quick and This So this is something I will most likely not get done until the end of this talk And it was probably a bit too challenging idea to do a micron I'm one of the migration in 30 minutes, but I just want to make sure I show you all the steps that that we did in there and Now I have I will execute this call And psql minus you the username which has just been created is this one the the Database is Forgetting I should be a host name as well Give me a second. I need to minus database. This is the Database name This is the host name. So normally you do that only once, right? and So I got user host name and maybe the port 5 4 3 2 and If things if I didn't do a typo that is asked me for the password and I also find the password here somewhere. Yeah, I got it. Thanks Yeah, and entering that now should hopefully give me the access and Well, I mean just trust me that this will normally work It's a bit too too much comma command line tweaking right here I'll try it later on before I do that I just want to show you that this actually works as you as you might have noticed I've already deployed an application there to show you that this is actually running this is this is the one right here and Going back to my browser Putting this in and say app to admin And then you see it's the same application now running on PCF on Azure connecting to that database If I mean you could actually validate this is a public URL you would be able to access it on from your mobile phone, so this is this is not a setup and From that point on this was a very effective means also for for the customer So when we when we wanted to show like the state We just send them an email with the link and say here access your application, please It's them the migration has been done to that point It was also very good to like test the application now having it running on on cloud foundry And we could it to like on a continuous way Work out if there were any problems trying to do scaling doing blue green deployments and all that the the typical Benefits that you would have from such a platform All right. I'm getting down with I'm with a time. I think so I Just wanted to recap the couple of steps what we did first to liberty then to PCF death using liberty then the PCF PCF on actually using liberty If you're interested more in the backgrounds why we did this the talk from tors than I from Basel last year you can find on YouTube. You can also catch me later I will I'll be happy to answer any questions. I'm just have another target four o'clock So that I might be busy then the only thing I want to say thanks to my colleagues to be as vicious and Constantine because they have been helping me to set up the To set up the the mocked code and one thing I would just really quickly Could everybody raised their hand who wishes tors in a speedy recovery because then I'll I send this photo to him And I'm pretty sure Thanks. That was very very kind He was yeah, he was very disappointed that he couldn't make it here And I'm sure like all your sympathy will then make him recover a lot faster. So I Don't know what the timing looks like Yeah, so I think maybe two questions in here would be fine and then we could definitely take some more time The lady was first Okay, the question was that we initially used db2 and where it then went when we migrated to cloud foundry. So Okay, this is my timer tells me I'm done We we lost db2 at the PCF dev step So initially websphere was connecting to db2 Liberty was connecting to db2 and the initial version running on PCF dev was also connected to db2 at that point we were already able to like spin up the the postgres sequel in parallel and I mean this one of course required some modification in the application this step I couldn't demo here, but it's like We we did that POC on on PCF dev to validate it it works against psql 2 and then I created the psql instance on Azure running that initial configuration script and that would be the same way as you can load the data into it Make sense now. Well Yes, so that like the data migration part is not Content of this talk. So I mean I the way I'm that what I did here was just basically initializing the database That the application can connect to it and work with it, but it didn't It I didn't migrate the data. Yeah, that's that's a pretty tough thing to do That yes, this might might be stuff for another talk Okay, you had a question too. I Mean it was a bit that as the things were not running in the same networks So this had of course an impact on well the question basically was About the performance differences between initial web sphere and then running on the cloud later on Well, this was kind kind of hard to measure because we had like a direct data center access on the web sphere side and then For the POC we were running on a public Azure. I can only say we didn't notice any Significant degradation or something like that. So the application responded in a similar way as it did before we We we did some comparisons running it by like locally on a web sphere and then on a Liberty and Yeah, that didn't do any harm to that Yes Well this The reason why I showed it that way is that it would work this way all the time. I mean IBM provides additional tooling Well, the one I showed was command line generating the news report There is not a tooling where you can plug in into an eclipse and it will highlight the pieces in the code that you actually have to migrate So that would be somewhat more visual But well the CF thing you can of course start an application through the apps manager and upload it this way But I wanted to have it in a generic way. So a couple of things can definitely be done different. Yeah They're always yeah There is just no like end-to-end migration tooling yet Which basically takes a monolith and then comes back with something which already running and connect to different database If if I had that that would be very good, but it would take me out of my job then okay, so thanks all for listening and As you are all experienced cloud foundries already I have another talk which is in the one-on-one section at 430 if you're interested But I expect most of you to know that already. Okay. Thanks a lot


Good morning, everyone. Thanks, Pailandim, for this opportunity. Let's get started. Some cheap marketing. I'm one of the co-founders, directors of Centrope Technologies, V2 end-to-end implementations of Integra data science projects, before that I was working with the hedge fund for almost 10 years. And I'm part of the organizing committee of Pyke and India 2018. Most of this works in Python 3, and later I haven't really tested everything with Python 2, but most of it should work. OK, there we go. Let's get started. What are classes in Python? So the way I'm going to run this is I'm going to keep switching between my presentation and this notebook.  That's why I'm going to run this entire thing. So before we talk about classes, I'll just get into some practical stuff. Let me create a simple class. I call it class test. No, nothing there, nothing fancy there, a very simple thing. I create an instance of the class, all good. I'm checking the type of the class. It says the class that I just created, test. And then I'm checking the type of the class itself, which is test. It says type, good. And then I also check the type of the type itself. It again says type. So everything boils down to type. So practically speaking, classes in Python are like their first class supported entities. Technically, class is an instance of type. And the classes are themselves like sugar in Python, like where we use class to create an instance of type. Then what is type in Python? So let me look at the official doc of it. For convenience, I have it here. All that it says is there is a signature which says I can use it in two ways. I can try by supplying this an object, or I can pass three arguments to it, which is name, basis, and dict. The first usage of it gives the objects type. The second one helps me to create a type, which internally is a class. So I have this name, basis, and dict. So name is the name of the class that I used to create it. Basis is a list of all the base classes that I want to inherit for this particular class. The dict is a dictionary of the attributes and their values that I want to be available for my usage within the class. A quick example there, like I'm just creating a simple class using the same invocation. I'm just calling type. The first one is a name followed by the object, which is a base class. Just creating it an empty dictionary. Let me look at that type of it. It says type. And then I'm creating an instance of what I just created. And then when I check the type of it, it says it is a class. So all that I have achieved is I have created a class without using the class as an instance of the core type. So this is how I dynamically create a class and also create an instance of it. So this is what I get by type. So type, essentially, is an important data structure. It's a native structure that is used for creating classes. Now let me get into some lifecycle that is involved in creating a class. If you look at it, this is a very vanilla example. All that I do here is I create a test class. I have all the magic methods, which is the dunder new, dunder call, and dunder init. All that I'm doing is I'm just simply putting up a print statement there and calling the super method. Nothing fancy here. So this is just there to illustrate how, when, each methods are called whenever I create something in Python. So all that I'm doing is the class is created. Nothing got printed. So nothing really got executed in this piece of code. I'm creating an instance of the class. So that calls the new method and the init method. So technically, this is the lifecycle. When I request for instance, the dunder new method gets called. Then the dunder init method gets called. Then the instance is returned. Technically, this is the dunder new or the dunder init combination as a constructor in other object-oriented languages like Java and like C-SHA. There is a convenience in Python where we have two methods. One is responsible for the instance creation. The other one is responsible for initialization of attributes within the instance. I'm just doing a simple call here. All that I'm doing is I'm supplying a bunch of attributes to the instance. So this internally calls the call method. I'm executing it for more than one time, second time, third time. Internet registering the call count. I get the call count as three. So the important takeaway, we know what the lifecycle of it is. And we also know call method is class instances are callable wherein I can supply a bunch of parameters and I can get some attributes out of it. We do a quick recap. All that I did so far is class is an instance of type. The type is the holy grail that we spoke about. This is the base of everything that we do in Python. And more importantly, if you clearly notice, I'm stressing it over and over again. Like type is the holy grail and class is an instance. You can further have objects which are instances of the class that is created. Type can be used to create dynamic classes. And we also saw about the lifecycle. Now this is good. Now we have the type. What can I really do with this type? So basically, type is one thing which is used to create a class. So technically, by modifying something in type, I'll be able to change the behavior of the classes. Given the type is native, we can't go and change it directly. However, we can subclass type and do something there. So that is what we call metaclasses. So metaclass is nothing but it is a subtype of type. It helps in changing the way the class behaves. Commonly called as black magic. Somebody said somewhere. And it is used to actually use it only when you actually need it. So a lot of things have been spoken. I'll just do a simple metaclass before we get on to the next steps. So all that I'm doing here is it is a simple metaclass where I try to create a singleton pattern. So internally, I'm writing a metaclass. And then using that in a metaclass. I'll also introduce to the syntax of it. So this is the syntax of creating a metaclass, which is like I create a metaclass. All that I need to do is it needs to be a child of type. And then using the metaclass, this is the Python 3 syntax wherein I supply a metaclass keyword argument and supply the metaclass that I just created. Let me do a simple metaclass now. So the stuff is simple. All that I do is I create it as a subclass of type. And then I override the dundercall method. Internally, I maintain a dictionary. Whenever I ask to create an instance of a class, I just check whether it is available in the dictionary. If available, return it from the dictionary. If not, then create a new one and then put it into the dictionary and return the same stuff. Simple stuff. And now I try and use this metaclass in the class that I just created. So this needs to behave like a singleton wherein if I ask for multiple times the instance of the class, it needs to return me the same instance. So I'm creating two instances of it. Let me check the type and IDs of it. You look at it. The IDs are the same, which means it is returning me the same class over and over again. Let me also introduce you to the big picture of it. So from a big picture, we have the type. And class is an instance of a type. We already established that. Then we can create objects, which are instances of the class. Then what we can also have is a metaclass, which is a child of a type. And we can use the metaclass that we created to create new classes. And that can be used to change the behavior of both the class and the instances of the class. Let me quickly go into the lifecycle of the metaclasses. So we have spoken a lot. I'm just putting in a simple stuff about a simple metaclass, same stuff as I did earlier. All that I'm doing is I'm overriding a bunch of methods, adding some print statements there, and I'm calling the super method of it. So I have dunder new, dunder call, and dunder init. And I created my metaclass. Nothing got printed, so the metaclass is clean. Now what I do is I use this metaclass in one of my classes. And now I kind of create a class. When I do this, I can clearly see it calls the metaclass's new method and the init method. So we saw earlier in the lifecycle, like whenever I create an instance of a class, it calls the new method and the init method. So class being an instance of type, it calls the metaclass's new method and the init method. Now let me try and create an instance of the class. So all the things that get called is I get the metaclass's call method gets called followed by the instances new and the init method. I think pictorially representing this. So we have the metaclass. In the metaclass, you have the new init and the call methods. In the actual class, you have again the new init and the call methods. Whenever the actual class is created, the red ones get called, which is the metaclass's new and init method gets called. And when I create an instance of a class, the metaclass's call method gets called and the actual class's new and init method gets called. I think this is a crux of what we will do primarily with metaclasses. So broad idea, if you really look at it, if you want to change something in the actual class, you need to change it in the metaclass's new and init method. If you want to change something, the behavior of a class's instance, then you need to deal with the call method of the metaclass. So this is what is the broad idea. You change the behavior of a class itself. You use the dunder new and dunder init methods. You change the behavior of the instance of a class. You use the dunder call method. So this is all the theory part of it. This is required to follow what we will be doing further. So I'm going to get into some of the patterns that we will use metaclasses. And we'll see some usages of all the stuff that we saw so far. The first pattern I like to go into is the abstract classes. So what we really do here is we use one of the native metaclasses that is available, which is called ABC meta. So there is a built-in package called ABC, like from which I'm getting the ABC meta and the abstract method. Let me see the doc of ABC meta. So all that it says is it is a meta class for defining abstract blaze classes. Usage very similar to what we have done so far. I create a class, which is my abstract class. And I have the metaclass defined to it, which is the ABC meta. And then init method is just a dummy there. And I have also defined an abstract method used at abstract method decorator there to decorate it and call it as abstract method. So what this does is it says this is an abstract class and there is an abstract method that is available. And by definition of that, I cannot directly create an instance of this class. I can only subclass it and implement the abstract method. Only then will it allow me to create an instance. Let me try and create the abstract class instance. It doesn't work. Now I'm creating a subclass of it. For illustration purposes, let me actually comment out the child classes abstract method definition. Now when I create it, it again says cannot instantiate because my abstract method is not initialized. Now let me go back. Let me remove the comment. I'm able to create it. So this is one fundamental design pattern where you could create abstract base classes. And you could use them to create your abstract method definitions and whatnot. The next pattern we'll be looking at is abstract family of singleton classes. So I used to be a Perl programmer. Then I became a Java programmer. And then for the past four years, I've been coding in Python. The day I came to Python, one of my fundamental questions are, where is my interface? Where is my abstract class? How do I do those things? So this is how we figured out probably we could do an interface with just like. All we wanted to do was we need to have an abstract base class or an interface. I'm talking about the requirement here. And you have multiple implementations of this. And you want each one of them to be singleton. We have seen abstract base classes separately. We have seen singleton separately. One problem with meta classes is you can only give one single meta class as a meta class to a given class. You cannot have more than one. To get around that thing, what we can do is we can combine two meta classes. All that I'm doing is I have a singleton ABC meta, which I inherit from ABC meta. If you look at it, internally ABC meta inherits from type. So I need to override the behavior of the singleton. So basically, the subclass should be a singleton, which means it deals with the classes instance. So I override the dunder call method. And then when I do that, I kind of do the same code that I did with the singleton. I have a local dictionary, which I maintain to hold the classes. And whenever I call for instance, I check the dictionary if available written there or else created and written there. So create this. Now I have my abstract singleton class, which uses this meta class to create the top one, which is the ABC or the interface. It's done. Now when I try and create an instance of it, it fails and says it doesn't implement the abstract class. Now I have a singleton child of it, which is implementing the abstract meta class, also implementing the abstract method. So now let me create two instances of it. Let me check the types. I see the types are matching and also the IDs are matching, which means it is returning me the same instance. So here we are dealing with two things, which is abstractness and also singleton. So this is like chaining of meta classes that we can really achieve. There are more behaviors to be required. We need to be a little careful about how we chain it. We can get that done. The third pattern that I'll talk is about hashable objects. So when I talk about the hashable objects, we all know not anything and everything could be hashed in Python. So the key of a hash, the key that we put in a dictionary should be immutable. So this is a simple pattern, which says it gives you an ability to put any object into the dictionary. So practically speaking, all that we are doing here is we are defining abstract method called getKey, which is abstract in nature. And anybody who uses this as a parent class will implement this. And we are overriding the equals method, which will use the getKey method. So technically, I can use this and create my hashable class. Like the moment I do this, I can get my hashable object. So basically, the keys that I'm using here are just the attributes a and b. So this gives me an ability to reuse the hashableness here where there is a1 and a2. And if you look at it, I'm just comparing a and b, which are the first two values. So the first two ones are not equal. The second and third one are equal. Now I try and put it in a hash map. This works. I'm skipping the comparable ones. I'll get into the pooled objects. So the pooled objects is just an extension of the singleton that we saw. So if you really look at it, the definition is the same. So the requirement here is whenever I supply the same set of arguments for creating an instance of the class, I need to get the same object. I don't want to get multiple variations of it. So all I do here is I internally create a tuple, which is a thing of args and cls. This doesn't work every time because your args could be heterogeneous. So you need to take care of what it is. Advice that I will say is probably you change the args to the actual arguments that you need in your class. Like you create your bean meta. Now you have your bean class, which is using this thing. Now I'm creating four instances of it by supplying four arguments. If you look at the IDs, the first and the fourth one are the same, which means they are using the same class. So this is some kind of a pooled objects wherein you can, it gives me the same instance as far as I supply the same arguments. Other ways of doing this are you could use an object pool manager or you can also use a moist function, which could actually help in getting the same stuff. The last pattern that I'll get today is with sealed classes. So in sealed classes, the requirement is I just want to know more subclasses of this particular class. And the subclassing should end with, so I don't want anybody else overriding or subclassing this and overriding behavior. I need this to be the bottom of the tree. So implementation is, again, I get the basis. For each of the basis, I get what is the meta class of that particular place, which I get by calling the type. And when I do this, I get all the meta classes that is used in the entire chain of MRO. Now I can check whether my sealed meta is available in the meta classes. If it is available, then somebody is kind of using this class as a parent, and then I raise the error. So this is what it is. I create my sealed class, like supplying this as a meta class, all good. Now when I try to override the sealed class and create a child of it, it says an error saying that you can't instantiate a sealed class. So basically, there are more behaviors that we can actually do this. We're running out of time. Otherwise, I would want to show this one thing, which is logging using meta classes. So technically, what I'm trying to do here is we kind of use the meta class to log every function that is called. We can use it again with the call method. We can use it again with the DunderNew method, apply a decorator to each one of them, and we can get it done. More things can be done in meta classes. Thank this opportunity to give me this opportunity to present this thing. There are some references. There is one video metaprogramming by David Weasley, wonderful thing. I think it's a three hour long video. Everybody should see that it's quite enlightening when it comes to meta classes. Obviously, practical Stack Overflow gives a lot of supports. Ready to take any questions if you have any. Thank you. So he's so kind, then he's going to ask a couple of questions. Yeah, over there. Nice talk, by the way. Thank you. With the keys and hashable objects, you said something about putting the objects in hash maps, but you actually never showed what happens if they had equal keys. So Python mandates that you need to have the keys of any dictionary to be immutable. Because if it is mutable, the hash code is computed once. It is the same in every other language, because if the object is mutable, then the hash code changes. You recompute the hash, it is not possible. So the only way you could do is keeping the object itself immutable. What I have tried and done there is saying, this is what my keys are. And use that to actually hash it into the thing. I'll probably share this notebook you can take a look at it and see. Thank you. Does it? Thanks for the talk. Thank you. It's called practical patterns. And I look at some of them, and I think they are very illuminating how the language works. But when I look at something like a sealed class, I think like, would I ever use it in an application? Would I ever be so, so not trusting of my fellow developers that I would say, look, this is a sealed class. Don't touch it. So do you have a motivating example for that? Or where would you actually do that? Basically, sealed classes, I thought it would be easier to illustrate here. But a more practical usage which could be used as an extension of the sealed class that you saw here is you sometimes don't want to allow your clients to override some methods. So basically what you can essentially do is instead of stopping them totally from using this as a parent class, there are many instances where you don't want somebody to override the methods. You could use this idea. This is just an idea. You could use this idea, extend it a little more to achieve that, which has far more practical usages than the sealed class itself. So one more question. I was just going to ask because you came from Java to Python, would you ever go back now or not? No, I came from Perl to Java to Python. So I definitely missed Perl when it was in Java, and I found the answer with Python. I found peace with Python. I'll stay with Python. OK. So one last thing, I'll just do this. I'm also a co-organizer of Pyken India. Pyken India is happening from October 5th through 9th in Hyderabad, India. This is the 10th anniversary of Python India, and the CFPs open, the tickets are open. These are the keynotes because we have for the event, and you can find more details at indodpyken.org. And hope to see many of you there. Thanks a lot for the opportunity. Thank you. Thank you very much.


The first out of businesses afternoon is portfolio questions. It is education and skills. As ever, if anyone wants to ask a supplementary, they should press their Aquest to Speak buttons during the relevant questions. There is quite a bit of interest, as you might expect. I would make the usual plea for brief questions and answers to match. Question number one from Stuart McMillan has been withdrawn. To ask the Scottish Government what it considers to be the educational impact of open-clan classrooms on primary school children. Local authorities are responsible for ensuring that the schools in their area, whatever the designer capable of providing an appropriate environment for effective learning and teaching. Therefore, consideration of the educational merits of open-clan classrooms is a matter for local authorities. However, as part of our school building programme, we gather feedback from schools and have heard how pupils and teachers can benefit from the increased connectivity that open-clan environments can offer. However, it is also important to consider the impact of activities that could be seen or heard between spaces and the positive or disruptive impact that they may have on others. I thank the minister for that response. Open-clan environments are perceived to benefit child social development. However, they are much noisier and such an environment impacts adversely on learning. Studies found that children in the noisiest open-clan classrooms is significantly lower speech perception ability and slow response times in those being taught in traditional classrooms. Open-clan classrooms are therefore not appropriate for young or sensitive children, while for teachers it can mean raised blood pressure, increased stress levels, headaches and fatigue. What steps are Scottish ministers and cos are taken to review the use of open-clan classrooms or at least improve the acoustics in classrooms to minimise noise and ensure that adequate learning can take place? Although the design and operation of school buildings are managed by local authorities to best suit their individual needs and circumstances, particularly of their specific pupil cohorts, as part of our school buildings programme, as I have mentioned, we continue to receive feedback from schools and, importantly, from those who use the open-clan classrooms. Our learning estate strategy, which was produced jointly between the Scottish Government and COSLA, makes clear that learning environments should support and facilitate excellent, joined-up learning and teaching to meet the needs of all learners. It is important to stress that those facilities need to work for all. The strategy also emphasises that teaching and learning environments should support the wellbeing of learners and meet the varying needs to support inclusion. We will continue to have discussions, of course, both with young people themselves and with parents and teachers, as we continue to ensure that our learning estate strategy moves forward. To follow on with what Kenneth Gibson has said, the last time we had an estate programme was in 2009, but the Scottish Government is responsible for the building standards technical handbook that was published in 2020 for non-domestic buildings. That caused auditory investigations to take place from new buildings. Is the cabinet secretary confident that those acoustic assessments are being made of buildings that are then exposing children in open classrooms to excessive noise? I thank the member for that question. It is a very important aspect that we look into how we are developing our learning estate programme. The work that goes on between COSLA and the Scottish Government as we develop the design process for that. I would be more than happy to get back to the member specifically as we look at the learning estate programme to also look at how that works with the wider issues that he has mentioned on building standards. If the member will forgive me, I will get back to him on the detail of that. To ask the Scottish Government what its position is on whether parents should have the right to appeal on school placement decisions. Under the Education Scotland Act 1980, decisions on school placements are the responsibility of the local authority. The views of parents should be taken into account. Parents should also be informed of the options available to them to appeal those decisions. If an agreement cannot be reached, parents and carers have the right to make a placing request to a school of their choice. If a placing request is refused, parents have a right to appeal. I thank the cabinet secretary for that answer. I am currently trying to help a constituent who has been told that her son, who has been in a mainstream primary school and has flourished, must go to an ASN school next year instead of a mainstream secondary school with his friends and peer group. Can the cabinet secretary set out what right to appeal parents, carers and pupils have in a situation like this? Under the Standards in Scotland Schools Act 1980, local authorities have a duty to provide education in a mainstream school unless specific exemptions apply. Authorities are supported in those decisions by our guidance on the presumption of mainstream education. I have set out the routes to appeal in my initial answer and I urge your constituent to engage with the school and local authority to resolve their concerns. They may also wish to contact the inquire service to discuss the details of their situation. If the details that I gave in my original answer are perhaps not detailed enough for Ms Mackay and to help her constituent, I would of course be happy to receive further information in writing to see whether there is further information that I can give her on those rights to appeal in this very specific circumstance that she has mentioned of the constituent's case. In 2022, there were over 350 fewer primary school teachers than in 2021, and there were fewer teachers from the teacher induction scheme teaching in their post-properation year than at any time since the scheme began. Key to restoring our world-class education system is reducing class sizes. Why then is this Government cutting teacher numbers at a time when school pupils have faced so much disruption over the last three years? I'm not saying that it's irrelevant to the original question, but I'm more than happy to answer that. I would agree, cabinet secretary. I want to keep your response brief on that basis. Recruitment and retention is a matter for local authorities of staff. The Government has a commitment to ensure that we have 3,500 additional teachers by the end of this parliamentary term. Part of that process has been further funding that has been baselined to local government of £145.5 million to support the teaching workforce. Thank you, Deputy Presiding Officer. To ask the Scottish Government what cross-government review is undertaken of policies supporting children with autism, including any assessment of the links between autism and other conditions such as ADHD. In March 2021, following a review, the Scottish Government published our Learning Intellectual Disabilities and Autism Towards Transformation Plan. The plan looks at the actions needed to shape support services and attitudes to ensure that the human rights of autistic people and people with learning intellectual disabilities are respected and protected. The plan includes a range of actions across the lifespan, including actions related to education, restraint and seclusion, health, post-diagnostic support, social care and employment. In September 2021, we published the national neurodevelopmental specification for children and young people, which sets out seven standards for service providers to ensure that children and young people who have neurodevelopmental profiles receive the support that they need. That includes both autism and ADHD. ADHD affects 5 to 7 per cent of the population and co-occurrence across neurodevelopmental conditions is the norm. We know from research that 50 to 70 per cent of autistic people present ADHD and 20 to 50 per cent of children with ADHD also meet the criteria for autism. I thank the minister for that useful answer.  My constituent took her family, the boys, to a private ADHD assessment, and they were both diagnosed. Given the necessary support and medication that has helped to transform their lives, will the Scottish Government agree to review pathways and guidance to ensure that all health boards across Scotland are taking a holistic approach to the assessment of children and that health boards will review existing cases over the last five years to offer those who have been diagnosed with autism the chance for an additional ADHD assessment? I think that we are straying into the territory that is under the portfolio responsibility of my colleagues in health, but what I am able to say here, and I will ask the minister for mental wellbeing and social care to respond directly to the points that you raised in terms of health board pathways, but Scottish Government policies take a wide neurodevelopmental approach that is inclusive of people with a range of conditions including autism, learning disabilities, ADHD and fetal alcohol syndrome. We fund the national autism implementation team as a key partner and they support us with policy development across health and social care, but also in education. It is understood that the impact of changes that occur in adolescence are more difficult for some neurodiverse young people to manage than for their neurotypical peers. Can the minister outline what engagement it has had with new or diverse adolescents and their parents to ensure that Scottish Government policies intended to support young neurodiverse people reflect the particular difficulties associated with this transition? In line with all development of policy in the area of those with lived experience, Scottish Government will engage regularly with service providers, with children and young people and their families and carers and also with key stakeholders in the development of pathways and of service provision.  Can the minister outline what action the Scottish Government is taking to ensure that children with autism are offered sufficient mental health support in school and that they are safeguarded against poor practice? Again, I think that that streaks into the territory of the health portfolio, but the additional support for learning review in 2020 set out a clear direction on how we continue to build on the progress and made recommendations on how to improve the implementation of additional support for learning, which is absolutely vital for those young people. We published our joint action plan with COSLA and ADES in October 2020, setting out the measures that we will take to implement those recommendations. Last November, we published our second progress report on updated action plan, highlighting that 24 of the 76 recommendations were completed with the rest under way. I hope that that gives the member some reassurance about the work that is being done in the education portfolio, but if there are other areas that he wishes to pick up that are covered by my colleagues in health, I am more than happy to get them to write back to him. To ask the Scottish Government what impact its draft budget for 23.24 will have on schools. We have protected councils in the most challenging budget settlements since devolution by providing over £13.2 billion through the local government settlement. That represents a real terms increase compared to 2022-23 and supports the continued delivery of high-quality education for our children. In addition to that, our schools funding will impact the most important areas in relation to education delivery, attainment and tackling child poverty. For example, we are investing a further £200 million for the Scottish attainment challenge to tackle the poverty-related attainment gap. We are also providing funding to local government to significantly reduce the cost of the school day. I thank the cabinet secretary for her response, but despite the largest block grant from Westminster in the history of devolution, the Scottish Government's budget delivers real terms cuts in funding for local councils, as the accounts commission made very clear in their report this morning. In my own region, Perthyn Cynrhods Council is facing a £20 million budget gap for the current year, which could see teacher numbers cut, child psychology cut, primary swimming lessons scrapped, all-school crossing patrollers scrapped and breakfast clubs for underprivileged children scrapped. How can the cabinet secretary possibly defend a budget settlement that is leading an SNP-run council to take decisions like this? Of course, the council budgets are not set yet, and there are a variety and range of suggestions that may come forward for officials, and it is for councillors to take decisions in due course. The numbers that I spoke about in my original answer are indeed correct. When we compare, as we do in every budget year, the proposed budget to the allocations approved by Parliament in previous year shows the best life for the comparison of available funding at this stage in the budget cycle. I would quite frankly say to Murdo Fraser on this, and in all aspects to do with the budget. He hears this every year. When he wishes to see more funding being spent, whether it is in local government or directly in the education budget, he will have to ensure that he says where that money will be coming from elsewhere in the Scottish Government budget, because the Government will be fully allocated. If he wishes to see changes rather than continue to talk through my answer, he may start writing down fully-costed allocations and propose them to the Deputy First Minister. There are a number of supplementaries here and on subsequent questions. It would be helpful if members could limit themselves to asking the questions and then listening to the responses. Please supplementary from Natalie Dawn first. I thank the cabinet secretary for her previous assessment. Schools are only one part of the multi-faceted infrastructure of Scotland's education system. Further to her original response, can I ask the cabinet secretary how the 23-24 budget will protect and enhance our whole education system from early years through to lifelong learning? Through the budget, I am continuing to invest in changing the lives of children and young people and learners across all ages. For example, we have the £1 billion of funding each year continuing to live 1140 hours of high-quality early learning and childcare. We have agreed £50 million to be allocated to the whole family well-being, including preventative holistic family support. We are investing £38 million for activities to keep the promise to our care-experienced children. Those are some of the examples that I could give on how we are improving the circumstances from early years to lifelong learning. The budget that we have in front of us has been warned by COSLA that there will be significant reductions in teacher numbers across the country. The cabinet secretary has committed to 3,500 more teachers, despite the fact that 100 were cut in the last year. How many more of those teachers will be delivered this year? In the current financial year, the Scottish Government provided £145.5 million base-lined into local government to ensure that councils could make changes from temporary to permanent contracts. I am exceptionally disappointed to see that, despite that funding, what we saw was a reduction in teacher numbers. I will continue to have discussions with COSLA on the area, but I will repeat very briefly the same point that I made to Mr Fraser. If Mr Marra would like to see changes made and additional funding going in to this or for other areas, he can of course suggest where that money should come from. To ask the Scottish Government what steps it is taking to ensure that schools are inspected regularly. Each year, the chief inspector of education determines the scale and priorities of the inspection programme in agreement with the cabinet secretary for education and skills. Prior to the pandemic, Education Scotland strengthened its scrutiny function and committed to carrying out 250 school inspections each year. This academic year, Education Scotland, will meet that commitment. In estimated 500 school inspections would have been carried out had it not been for the disruption caused by Covid. I set out in the programme for government an education reform bill will be introduced to establish an independent inspectorate. A high-level operating model for that new independent inspectorate is being developed and will be shared with stakeholders and users early this year, and that will set out how the inspectorate will operate effectively to provide the independent assurance of quality that our education system needs. I thank the cabinet secretary for that answer, but the reality is that those steps have been inadequate because an FOI response published in September showed that 1,118 state primary and secondary schools in Scotland had not been inspected in a decade. Indeed, in a my local area, the picture is even worse. There are 10 schools that have not been inspected in the last 10 years, and four schools that have been inspected in more than 10 years. Indeed, the longest situation being 2006. There are three schools that will not have been inspected in the entirety of the lifespan of Education Scotland. As we look to its successor organisation, can we at least guarantee to parents and pupils that their schools will be inspected at least once in the time that they attend? I laid out in my original answer the impact that Covid has had on the school inspection to be carried out. As a point to reassure, I hope, Dan Johnston, I would point out that the inspection is not the only method of scrutiny. Schools and local authorities also have responsibility for evaluating performance. Indeed, in Scotland, the provision of education with it being with local authorities has a duty to provide adequate and efficient school education. Under the Standards and Schools Act, the local authority is responsible for improving the quality of education of schools that manages with a view to raging standards. Yes, school inspections are exceptionally important. That is exactly why we have the high-level target operating model that is being developed. I would welcome any contributions that Daniel Johnston has to that when we publish that, but it is not the only way that the Government, its agencies or local authorities can ensure continuous improvement within schools. I am brief supplementary Stephen Kerr. That was just more complacency from the cabinet secretary. The reality is that 1118 schools, more than nearly 50 per cent of Scotland's schools have not been inspected for 10 years. Are you not embarrassed, cabinet secretary? Tell us one thing that you are going to do now in order to rectify the situation. As I have stated in my original answer to Daniel Johnston, there was, of course, an impact that we have seen on Covid of 500 school inspections that we would have expected to see happen that did not happen. Pre-Covid, Education Scotland had taken a great deal of work to ensure that it strengthened its scrutiny functions, to ensure that it was carrying out more school inspections each year than it had done in frequent years before that. However, it is very important that we take very seriously the role of school inspections. That is exactly why we have a reform process that is leading to an independent inspectorate. I would welcome the constructive views of Mr Kerr and others about how we can ensure that that independent inspectorate is as effective and efficient as it can be. Question 7, Graham Simpson. To ask the Scottish Government whether it will provide an update on its progress in closing the attainment gap. In December, we published the latest achievement of curriculum for excellence level statistics, the 2023 national improvement framework and plan, and the stretch aims each local authority has put in place for closing the attainment gap. Together, they set out the latest evidence for progress and our plans shared with local Government for substantially eliminating the poverty-related attainment gap by 2026. There are promising signs that the attainment gap is, once again, beginning to narrow. However, there is more to do, and that is why we will invest a further £200 million next year in the Scottish attainment challenge, part of our £1 billion commitment this parliamentary term. Thank you. In fact, there has been no progress in the last five years. In the aftermath of the Scottish budget, Jim Thullis, general secretary of school leader Scotland, said that education cuts will see class sizes increased and subjects removed. How does cutting subjects and increasing class sizes help to eliminate or substantially eliminate, which is the Government's phrase, the attainment gap by 2026? For the sake of brevity, I will point to my previous answers that I gave to Murdo Fraser about the importance of the member who would allow me to answer the question—that is exactly what I will do. The issue around budgets has been discussed with Murdo Fraser and others. It is important that we look at the investment that is going in, not just within education but also within local government. We are taking steps to ensure that we continue to invest in our children and young people. However, it is gravely unfair for the member to suggest that there has been no improvement. For example, for the sake of spirit, I will give one example of the gap between the proportion of primary pupils from the most and least deprived areas who achieved their expected level in literacy, narrowed from the previous year. That is very important. We have similarly saw that in numeracy as well. For both literacy and numeracy, those figures represent the largest single narrowing of the gap since data collection began in 2016-17. Of course, as with other educational areas across the UK and further afield, there has been an impact of Covid. It would be wrong to suggest that that is not the case, but what we are seeing within the ASL statistics is an improving picture. I would have thought that that is something that the member would welcome. That, in fairness, is not a brief response. It is meant that I am not able to take supplementaries from either of the members that we are looking to get in on this question. We need to now move on to question 8 from James Dorn, who joins us remotely. To ask the Scottish Government what its priorities for education will be in 2023. Tackling the poverty-related attainment gap remains the priority for the Scottish Government and it is at the heart of our ambitious reform programme, which aims to provide learners with the best opportunities to succeed. The priorities for Scottish education are set out in the 2023 national improvement framework, which was published in December 2022. It placed the human rights and needs of every child and young person at the centre of education, alongside improving children and young people's health and wellbeing, closing the attainment gap, improving attainment and skills and sustained positive school leaver destinations for all our young people. James Dorn. I welcome that tackling attainment remains a key priority for the Scottish Government. I also welcome the news that Professor John McKendrick has been appointed as a new commissioner for fair access to higher education in Scotland. Can I ask the cabinet secretary how his appointment will help to drive forward progress to further close the poverty-related attainment gap? I am also delighted to welcome the appointment of Professor John McKendrick. He brings to a role great experience to an eye. I look forward to working with him alongside my colleague Mr Hepburn. That is, of course, a very important role as we continue to see further success within the Scottish Government's ambitions on widening access. Brief supplementary first from Sue Wettman. Teachers are on strike, cabinet secretary, the first strike for 40 years. We have heard from countless teachers and the unions who say that they are feeling ignored by the Government that they are not fully engaged in the negotiations. We also know that violence in the classroom is up with over 20,000 instances of violence against teachers and school staff in the last academic year. Ignored by the Government and unsafe in the classroom, does the minister accept that ending teacher strikes and making teachers safe in the classrooms must be a priority for every student? It is indeed a priority, and that is why there are further constructive talks happening today. Brief supplementary first from Beatrice Wishart. In terms of priorities for education, the Scottish Government made a commitment to replace Erasmus and to create a Scottish education exchange programme. Although it has been repeatedly asked for in this chamber by colleagues, a date is still elusive. Wales made this happen, so what discussions has the Scottish Government had with Welsh counterparts on this and will the minister commit to a timetable so that students know when they will be able to benefit from a learning exchange? It is briefly as possible, cabinet secretary. This was, of course, a Government commitment that we hold very dear to and it is something that we are progressing our work on and will deliver within this parliamentary term. Thank you, cabinet secretary. That concludes portfolio questions. There will be a brief pause before we move to the next item of business. On a point of order, you tried to fit in as many supplementary questions as possible, but in your remarks you said that it was largely became impossible because of the length of the ministerial answers. This is not unique to this session of topical questions, but can I ask your guidance on what is being done in order to encourage ministers—including the First Minister, by the way—to shorten the answers that they give to the questions, which are becoming more concise? As a former business manager, he would be well aware of the on-going discussions that have been with business managers from all parties about the length both of the answers but also of the questions. In portfolio questions, we have seen evidence of both not being brief. That is something that I would impress upon all Members in order to provide opportunities for as many questions as possible and all parties suffer as a result. The questions and the answers need to be as brief as possible, but I think that attributing blame in one direction in this instance, Mr Kerr, is unfair and inaccurate. We now move on to the next item of business.


We're gonna hold the stones? Yeah. Like, refish your way. You just picked up the sizzling stone, bro. Ow! Yo, Andrew, you gotta hear about this guy called Confucius. He's got some crazy ideas. Dude, is he the one who was talking about the duality between the good and the bad and the yin and the yang? No, it's not what you're doing. Oh, Genghis! What? What up, man? You made it over the wall? Have you ever had Mongolian food through the wall? No. No? No. No, we're going to get it. Let's go. Right now? Yeah. We're going to go right now. So you're going to invade? Let's go. OK. Welcome, everybody, to a very authentic Mongolian episode of Fung Gros Food. And you know that we cannot try authentic Mongolian food without an authentic Mongolian person. We got Tam. Tam, what up? Dude, so in America, a lot of people eat Mongolian beef and Mongolian grill. And only recently have you been hearing about Mongolian hot pot in the past few years. But what we want to do today is dive into some authentic Mongolian food and see if those Mongolian dishes are actually really Mongolian. In the entire Southern California, I believe there is only one authentic Mongolian restaurant. And we are here today. Yo, is this true? I read this online. There's a saying in Mongolia that says, meat is for humans. Grass is for animals. Yeah, we do that. Because we have a lot of meat, like 80% of it. 80% of the diet is meat. I'm excited to have some authentic Mongolian food. Yaoji di, let's go. So it's here. It shows one of the main sports of Natham, the national festival. First one is wrestling. Second one is horse racing. And the third one is archery. Instead of where's Waldo, it's where's Genghis, man. So we play like this. If you have four, then this. And if you get like four different, like this. And it means like you're lucky. Yo, Tam, we got a crazy spread here. I like, I've never seen food like this before. We need you to introduce each one. So this is hoshor. Hoshor, yeah. So it's like the most famous food. The national festival is the main food too. It's like a mix of Russian, Chinese, and Mongolian style. Hoshor. That's crispy and fluffy and juicy. That's good, wow. They will have some oil. Gonna be ready in like three or five minutes. That's good, the amount of onions and beef and the juice, watch this. Watch this. Tripple it. I'm gonna pour up some tea real quick. It's a milk tea. Milk, water, and tea, and salt. In Mongolia, traditionally, they serve a lot of different milks, right? Yeah, black milk, horse milk. We call it Eric. If it can be milked, they're going to milk it. To look. This is like bulletproof coffee where you throw the butter into the coffee. It's a very rich, like slightly salty. Which animal does this one come from? Cow. I'm the main dishes here. Wow, wow, we're gonna talk about this one. This is right now. Rocks, rocks. Those are hot rocks. Hot rocks. So this is hot rock. First, you guys need to collect the stones and then you need to fire the stones to get it really hot. It's not the fire, it's all about the stones. Why are you serving the stones? So it's a process. I'm gonna hold the stones now. You're gonna hold the stones? Yeah, like refresh your way.  It's really hot. Just be careful. Mine isn't. I'm gonna play it. Ow. Ow. Let me get that one. Let me trade you. Let me trade you, all right. You gotta take this one. Oh, it's really hot. That's hot.  Lamb that was cooked with rocks. Yeah. Hot hot. Hot hot. Hot hot. Hot hot, yeah. No predominant spice. It's just straight to the earth. Wait, wait. This came with the hot hot, right? Yep. Okay, so how do we eat this? So it's a flour. Wow, look at this. Look at this. Unravel this. I'm gonna unravel this for you guys. You put the meat and then while at it later, you put the vegetables and then you put the flour on the top. So you just steam it. Oh, you put the flour on top. So let's go to this. So long. Looks like a stir-fry kind of chopped up noodle. And this is some battle food, man. You got to. David, we gotta fight after this. And we gotta get into fighting. Fry the meat and the vegetables first and put some water and then put the noodles on the top and steam it for a while. And then you just, check it out. Check it out. You guys know this book, right? Dumplings. It's in Chinese and Baozhi, right? Yeah, Baozhi. Oh, so it's the same word. It's the same word. Did you grab it with my hand? Yeah. Oh my gosh, this is huge. Look. Yeah, it's a piece of books. Books. So this is more like a moon. Okay, you see that like a moon, right? Like a, it's called sheep. And then there's like a, just a round of books. Like a circle one. Flavor between green onions, white onions, and the beef. Yo, this is really good. So this is Baozhi. So I'm going to use this with the milk tea. You know, like boil it with the, like a milk tea. You boil it in the milk tea. Yeah. Okay. So it's more like a healthy air food. You just dropped that dumpling into your milk tea. I've never seen that before. So you guys pour the milk tea on some dishes. Yeah, some, like day after, we just make some hot milk tea and just pour it inside. I'm dropping it in my milk tea. I'm going to have one regular too. I'm trying my milk tea dumpling. It's different now? Yeah, way more like moist. Mm, famous soup in New York. That looks great. It's called puta. Puta, puta, puta. Puta, puta. Okay. It's like a mix of so much food inside. So there's some noodles. Oh, some clear noodles. Meatballs, and sliced meat, and potatoes. When would you eat this? Like after hangovers. Okay. Oh wow. This is that Mongolian pho. Yo, it's crazy. It almost smells like a pizza. That just warms up my soul right there. What about this stuff? Is it the salad? Is that potato salad? Yeah, it's a potato salad. Is that traditional? It's Russian influence. Oh, Russian potato salad. So this is Gulesh. It's not Mongolian. Came in when the Russian influence came in. For like 28 years ago, there was a Soviet Union. It's like more Russian influence, you know. Everybody got to learn Russian, right? Wait, Mongolian? Your parents speak Russian. Mongolia was part of the Soviet Union. This is a great transition point to talk about the Mongolian identity, because from my research, there were so many different nomadic tribes up there, and then they all kind of got mixed into one, right? By Genghis Khan. By Genghis Khan, okay. Genghis Khan unified them as one culture. It made Mongolia. It made Mongolia. Mongolian pride. It was established in 1206. But in Mulan, that's not Genghis Khan. More than Shengyu. No, Huns is like way back. Oh, it's way back. What do you think is the future now? Like what do people want? Because it is kind of like viewed as this like East Asian country. You guys look like a Japanese, a Korean, or a Chinese, but with like maybe like kind of like a twist, right? I think it's gonna be like safe and how do you say preserve? Preserve the nomadic lifestyle forever. Right, you think that that is the destiny of Mongolia? Yeah, that's the destiny. To preserve this nomadic lifestyle that existed thousands of years ago, and it will continue to exist. Talk to us about the Mongolian wrestling. Every sumo like the champions, I'm on going right. I heard that in Japan. So when a wrestler comes in, it's like, everybody's like, you know, getting proud and stuff. Cause they are like always big guys. I heard Genghis Khan was very open to different religions when he was. Yeah, it's not the religion anymore. It's like more way of life.  Oh, okay. And he tells the real stuff. Tell us about your life in Mongolia cause you were actually a TV producer. Oh yeah. I had a TV channel, like a TV producer and an advertising agency. So I do graphic designs, videos and the TV contents and stuff. All the modern stuff. Modern stuff. So I tried to like develop the urban culture in the back of Mongolia. Mixing with the like ancient Mongolian cultures.  They have a place that I actually like to go to called Great Khan. Is it the whole grill thing that's not authentic? If you go back to the 13th century, it's invented by, so the warriors camp anywhere.  It's almost like taking your hat off and then just cooking with your hat. That's a hot one. Do you think there's anything that Asian-Americans can take away from the Mongolian attitude you guys do, you know? Like, media is the big power now. So we just need to spread the cultures and stuff, education on that. You know what it is? How about this, how about this? We could be more Mongolian or Genghis-like in spreading our culture. Not in attacking though. Not in attacking physically. Aggressively, aggressively spreading our culture. Do you got any projects that you, cause I think that a lot of young Mongolian Americans are gonna see this video. The name is Ancient Urban Kit. So ancient, as we talk, this is the history. So I'm a kid from an ancient history country. Ancient country, right? And I'm an urban kid. So like it's a mix of ancient urban kit. So I'm doing a, same as you guys, YouTube show. Oh, okay. Yeah. So targeting some stuff. Is it gonna be a Mongolian or English or both? Both. Okay. So I'm gonna target Mongolians, educate some urban culture. Okay. Do some ancient culture. Just the fact that you came here and said, you know what, I'm gonna start my own Mongolian English media station. We'll publish it right now. Ancient Urban Kit. Ancient Urban Kit. I think you know what it is. Maybe in a very classic Mongolian fashion, your actions speak a lot louder in your words. Thank you. Love. Aren't you guys, thank you so much for watching that Mongolian episode of Fumble's Food. Huge shout out to Tim. Thank you guys. Thank you. Thank you for having me. Oh. What is that? It's like, thank you. Barca. Barca. Tim at auk.world. Let us know in the comments below and also if there's any other cuisines around the area that you guys want us to try and delve deep into that are very interesting, let us know in the comments below too. All right, everybody. Thank you so much. This is Tim, David, Andrew from The Fun Grows. We just ate Mongolian food. Until next time, we out. Peace. So thank you for having me, guys. And I'm talking to the viewers and maybe I talked about wrong things or I don't know, like, how did they do so bad and good stuff? Right, right, right, right. I hope you guys will understand my, like, perspective. Perspective. And opinion. Also my English, you know. He just got here three months ago, okay? Maybe the way, you're saying maybe the way you said things. Said things wrong or, I don't know. So if some of the nuance or the detail got messed up, you're just like, hey, man, forgive me. Yeah, forgive me. This is just one of the many Mongolian people in the world, but he did share his opinion today. So thank you, Tim, and thank you for showing us this food.


T F N N headline news update Good afternoon everybody. I'm Tommy O'Brien coming to you live from T F N N headquarters in St. Petersburg, Florida 1 p.m. Eastern time on Thursday three hours left to go in the trading day and we got markets hanging right near in record territory S&P's up six points trading at 3201 Dow Jones up 93 trading at 28,000 333 Nasdaq up 41 points trading at 88 68 goal contract catching a little bit of a bid up $5 and 40 cents at 1484 notes and bonds we're getting a little bit of a higher price and lower yield pullback the 10 year up 7 ticks 128 12 the 30 year up 12 ticks at 156 13 and the dollar index off 55 ticks at 97 346 will start things off for the 1 p.m. Update We're gonna start it with a chart of the 10 year yield quite a print. We got today 1.95 we got up to but talk about short-lived We're now under 1.9 at 1.89 percent as the volatility continues in that note and bond market Jumping over to the indices will start things off with the Dow currently trading 28,000 348 we almost got up to 28,400. We missed it by just less than eight points in the futures We meet or excuse me 28,392 the high about 50 points off that level Nasdaq 186 50 less than 10 points off its high S&P's reached 3208 quite a number record territory as I mentioned currently trading 3205 Goal contract catching a bid as well with the markets pretty interesting at one point You had gold trading inversely with the markets right now gold trading higher at 1484 crude oil $61 and nine pennies and how about natural gas we got the EIA numbers at 10 30 this morning We saw a draw of 107 billion cubic feet the estimate was for a draw of about 95 billion cubic feet the price spikes to 230 But no matter what happens in that natural gas market can't catch a bid 226 in the price of January natural gas There's what else you have happening fundamentally in the market weekly jobless claims out this morning at 830 that number coming in at 234,000 for the week ended December 14th pulling back from the two-year high But still a bit more than the 225,000 economists had been expecting They tune folks we got a man Steve Rhodes coming up with the trader's edge live from one till to Dave white live with a Power trading hour at 2 o'clock Tom O'Brien live at 3 for record territory S&P's positive by 6 Dow Jones positive by 88 points We'll be right back