I'm delighted to welcome Jean-Pierre Lacroix, who, as you know, is the Under Secretary-General at the United Nations for Peace Operations. I briefly overlapped with Jean-Pierre when I was still there myself, but I know that he has a very close relationship with our Ambassador, Geraldine Bernaysen, and indeed, generally with Ireland. And I'm aware for my own background of the very close cooperation we've had with the Department, which the Under Secretary-General heads at the UN. Jean-Pierre Lacroix has had a very distinguished career at the senior levels of diplomatic and political life in France. He had different times. You've been Ambassador to Sweden. You've been Deputy Prime Representative at the French Mission to the UN. You've been Advisor in the Office of the Prime Minister, I know that. And you've been the head of the Department at the Kedocé in charge of the UN and international organizations. So from that, then, you came to your present position at the UN. And really for the very few in this room who are not initiators, I suspect everybody knows, it's one of the critically important jobs at the UN. I mean, all of us as ambassadors there could witness the impact that job has. The number of challenges that you face is absolutely overwhelming, whether it is the changing nature of the threats which have to be dealt with, the degree of consensus that exists or does not exist on UN interventions in those situations, the budgetary challenge, which in the last couple of years I suspect has become even more pressing than in the past. And then also the wider issue of integrating peacekeeping within the architecture of the UN and getting a better join-up with the other pillars. It's a priority, I know, for the present Secretary General. So plenty to talk about. And as usual at the IAEA, there is a practice of the Speaker's remarks being on the record, and after that the Q&A would be Chavenhouse Rules. I think there's probably nobody in this room who doesn't know Chavenhouse Rules. And so with that, Jean-Pierre, I give you the floor. Well, thank you very much. Good morning, ladies and gentlemen. First of all, it's really a pleasure to be here. Thank you for having me. And also I would like to start by saying how happy I am to be here in Ireland, because I don't want to sort of be overly diplomatic, but sincerely, and you know, in all honesty, Ireland is a very solid, true, reliable partner for the UN in general. Commitment to multilateralism is something that suddenly we can use these days. But also, and more specifically, Ireland's commitment to peacekeeping. So I feel here that I'm speaking to an audience and to colleagues who are very well informed and versed into the reality of peacekeeping and also the challenges that we're currently facing. And I will address some of the challenges that we're facing because we're trying to find adequate responses to these challenges. But let me just start by saying that it's important to, first of all, to remember and recall the achievements of the UN when it comes to peacekeeping. And it's not only about the past and a number of countries that were held by peacekeeping operation in their return to stability. And the list is very long of these countries, but it's also about the current achievements in terms of protection of civilians. We have now protection of civilians as key priorities in many of our missions, particularly in Africa. And I think we protect every single day hundreds of thousands of people in different ways and sometimes really making the difference between life and death. Of course, we would like to do more and sometimes we don't do what we would want to do, but still the protection of civilians is, I think, an achievement of peacekeeping. And then the other achievement, which is also happening every day and not always very much on the radar screen, is the preventative role of peacekeeping. And here I have very much in mind what we call the traditional peacekeeping operation. There were mostly military people somehow along the ceasefire line or essentially tasked with monitoring a ceasefire and preventing any incident from escalating. And this is something that UNIFIL does on a daily basis. This is something that colleagues in Cyprus do. And I think it's important to highlight this because its prevention is what it is. When nothing happens, then no one has anything to talk about. But we know and you know because you have soldiers and staff in southern Lebanon and also on the Golan. There are incidents that occur every week, sometimes every day. And they might be very small, but if the blue helmets are not there to quickly de-escalate, then those incidents could very easily turn into a situation that would be out of control. And we never forget that we are dealing with parties that do not talk to each other and they don't recognize each other. They don't want to talk to each other. There's an exception in southern Lebanon because we facilitate some form of liaison between the Lebanese armed forces and the IDF. But still, so the preventative role, the protection of civilians and the fact that in many countries have been helped by peacekeeping. But at the same time, we have today challenges that are maybe not totally new but their magnitude is significant and also they have evolved in their nature because the nature of the conflicts we're dealing with has also evolved. And I think those challenges are essentially four. One is the fact that the political processes that we are supporting are usually moving very slowly or not moving at all. And this is a problem for us because I think it's quite clear that whatever the mandate, peace operations are there to support a political solution. That's really their key purpose. But if those political efforts are not succeeding, they're moving too slowly or not at all, then we don't have a prospect for exit. And there's a sentiment that then settles that we were there forever, we're stuck. And then there's an additional sentiment that sort of settles as well, which is you are failing. I mean, you've been in Cyprus for four years or 50 years and we don't have a political solution there. How come? So number one, of course, there are explanations to that. But I see this as a major challenge, especially at a time where the international community is divided and we cannot rely on a United Security Council, on a United international community, which would be in a better position to support political efforts. Now, the second challenge is the question of how dangerous or how much more dangerous the environment in which peace operation operate is, are today. We've had a higher number of fatalities in peacekeeping as a result of attacks against the blue helmets, but also against the humanitarian worker. Unfortunately, today or tonight, we had three colleagues from WHO who were killed in the eastern Congo because of the situation there and the tensions that arose as a result of a number of factors. But the reality is that the blue flag or the blue helmet do not protect anymore. And in some cases, unfortunately, they make you a target. And that is something to which we have to adapt and that it's very much as a result of the evolving nature of conflict, the fact that we're having to deal more and more with armed groups, criminal groups or terrorist groups or combination of those groups and those people have no interest in peace at all and they have, in many cases, they don't have much by political agenda. So how do you interact with them and for what? So that's the second challenge. The third challenge is the high number of vulnerable civilians in many of our peace operation settings and that makes protection of civilians a very key priority of our mandates, particularly in the big missions in Africa. And then against this backdrop, we have issues that have to do with preparedness. And I think part of it comes with the need to adjust from a traditional, quote-unquote, again, more kind of peaceful or maybe less challenging type of peacekeeping, although I, again, believe that even those traditional missions are challenging and sometimes dangerous. But it also comes from the fact that we have issues that have to do with training equipment. Performance assessment is something that we are working on as well. Mindset, again, mindset partly comes from this transition to a different kind of peacekeeping, et cetera, et cetera. So the problem with capacity and preparedness. So this is the determination that we made when Secretary General Antonio Guterres started his position in 2017. And the choice was made to share very candidly those challenges with the states and explain to them that we would be working on them and we would take action and remedial actions in many different areas. But at the same time, the key message was that we needed to work with them and we needed member states to help us because peacekeeping is quintessentially a partnership between member states and ourselves. Because our member states provide us with our mandates, our resources, financial resources, troop and police. And they can be also instrumental in helping us remedy the different issues and problems we have in many different areas. Training equipment and all this. So that was the approach that guided the action for peacekeeping initiative which is the sort of strategic framework against which we have taken a number of action. And the political momentum we got was when we shared a declaration of shared commitment with the member states and we invited them to sign on. And of course we had a few discussions with them to make sure that we would have as many signatories as possible. And we had many 152 member states which I think also was reflective of the fact that peacekeeping still benefits from a relatively high degree of support in the UN. As an activity, as a UN activity, so at least this is something on which we can build on and provide it that we are seen as taking action and being reactive in the face of all these challenges I think we can sustain this support. Within the action for peacekeeping initiative, we have essentially five or six key areas within which we work and we take a number of action. The first priority area is the political dimension. It is the most elusive and it is the subject on which it will be more difficult to come up with trends and numbers and diagrams and that would sort of somehow suggest impact or improvement, but at the same time, we want to make that as a top priority and a top item on our list because we, as I said, I mean we're about supporting political solutions but member states need to hear that message that they need to help us and they need to use and dedicate their energy and their influence to support in different ways those political efforts because we need them, we need the parties to be willing. The parties need to be encouraged and pressured if needed by those who can have an influence. We also need to work with regional, sub-regional organizations such as the African Union or any other EU of course. So that was the first item and the message was, work with us and please try to help unlock some of these stalled political processes.  It's everything we need to do to improve performance and we launched a number of initiatives regarding the improvement of training both in terms of the scope of training but also the way in which training was provided with a couple of areas which we're putting the emphasis such as leadership training and the in-mission training teams to make sure that there will be refreshment and also that our team, particularly the leaders, will be getting this additional training when deployed. We have been also taking a number of initiatives and by the way, this is something that we need to fund on the basis of voluntary funding. Peacekeeping is finance through assessed contribution. There's a scale of assessment by which member states pay a certain percentage of the total budget of peace operation but we cannot fund some of the key activities like training or evaluation and many other areas with these peacekeeping budgets. So we call on, we rely on voluntary funding and that is true for the training plan that we launched and that is true for many of the other initiatives that we took to improve equipment gaps and to improve the preparedness. We had discovered that some of the units that were deployed were not evaluated enough in terms of their ability not only to be good peacekeepers but also in terms of their core ability to basically perform as a military or a police unit and we've developed enhanced pre-deployment visits. There's a whole series of new instrument that we have as well to assess performance of military units, police unit and performance of mission as a whole that is called the Comprehensive Police, Comprehensive Performance Assessment System and these are tools of course but we thought that we needed to have to be a bit more scientific when it comes to assessing what are different components do on the ground, how they perform. Even though we recognize that ultimately performance is also has a non sort of less mathematical aspect as well. We have been working a lot on medical support as well. Accountability, this is something that now we sort of systematically evaluate especially when we have incident where we think we've been failing particularly in protecting civilians and we systematically investigate and I think that there's a recognition with our troops and police contributing countries that we do this in a constructive spirit. We are very candid with them but we also recognize that in most cases there are also some problems and issues that have to do with our own organization and not only with the TCCs and PCC which is how we call them, our troops and police contributing countries but we've had many cases where by this through this very sort of candid interaction with them we've been able to talk about issues and remedy and see improvement which I think is really the way forward. So that's the performance cluster and there are many other aspects. One of them is to which Ireland has contributed a lot is the rolling out of a peace keeping intelligence policy which is critical because we need to have also a better situational awareness and better capacity to be aware of what goes on in the environment in which we operate and then be in a better position to preempt and prevent threats to us and to the population. The third aspect on which we're working a lot is having more women in peace keeping and also involving women more in political processes. These are the two branches of what we call the women peace and security agenda. You all know that there was a landmark resolution adopted by the Security Council 19 years ago. So next year will be 20 years ago sort of really launching this very important platform. Having more women in peace keeping, we see it as not really, it's about performance and it's not only about improving the work environment and making sure that we have a work environment in our peace operation that is more reflective of the diversity of the societies and communities in which we were active but it is also very important because we're interacting a lot with communities in peace keeping and Southern Lebanon is a case in point. We are quite many in that relatively small area and sometimes we're quite intrusive. So and this is a very populated area. So we have to build trust with the population. We have to make sure that they would accept us and we have to make sure they would understand what we do and why we're there. And the challenges are the same. They're probably even greater to some extent in some of our missions in Africa because they were talking about communities that are sometimes extremely traumatized and vulnerable because the activities of armed groups and gender based violence and atrocities really committed against those communities. And if we are to build trust and enable ourselves to be effective then we have to have women with us interacting with communities. Otherwise, if we come only with men in uniform and with weapon to groups that are traumatized and have been harassed by men with weapon maybe not necessarily with uniform then we know we won't be able to kind of trust that we need and that we also be a disadvantage when it comes to having a better situation of awareness, not to mention the role that we're trying to play regarding gender based violence and other type of atrocities against either women or children. So I think we're in a better position now because there's total awareness I think within the states and through the police contributing countries that we need to have more women and they themselves are increasing the number of women in their own national police force but it's still a work in progress with almost double the proportion of staff officers and military observers and police officers or individual police officers over the last two years but it's still low, it's went from seven or 8% to roughly 15% the form units it's lower but it is also on the upward trend and I think we've jumped to almost 1% in one year from 4.1 to 5% so that's not a lot but 1% is significant in our because we have 70,000 military and 10,000 police deployed so 1% of 70,000 is already something and can make a difference on the ground and we've recently appointed a Brigadier General from Ireland as you may know, General Morin O'Brien who's currently the acting force commander in UNBUFF and we are I think about to appoint another female general to another position we have a head of the UNFICIP force who's also a major general from Australia so we are getting there slowly and even on the top ranks and then the second part equally important is how to involve women more in political efforts and political processes which is I think a condition to make peace agreements and peace more sustainable and more accepted in other words, make sure that there would be a peace not only on paper but one that would be accepted and that would be really that would take hold in hearts and minds and be rooted in communities so this is also something that is there is some progress and particularly when we look at some of the provisions that you can see now in some of the peace agreements or some of the new constitution of conflict emerging from countries emerging from crisis but I think it's still not really something that is accepted and totally mainstream and the involvement of women is to me still is not systematic and tends to be a bit too much one shot here and there but not something that is sustained throughout a political process maybe a bit more at the local level because we do handle a lot of small local conflict and there I think our peacekeepers do a lot in terms of involving women so a few other issues and very briefly first of all everything that I mentioned here political efforts, performance, women in peacekeeping is about partnership because we cannot work on performance without partners not only the troop and police contributing countries but also those who can help and I know Ireland does training with other troop and police contributing country we also have partnership that we're trying to develop in order to feel some equipment gaps and we've recently had a few example where one country came to the support of another one deployed in the field to mitigate those equipment gaps of course partnership are absolutely critical when it comes to political efforts one example is how we work together with the African Union to bring about a peace agreement in the Central African Republic which we know we wouldn't have been able to do that if we had been working alone or if the African Union had been working alone and then the third dimension of partnership is on the ground because we need to have prioritized mandate and I think one thing that we hear a lot and you certainly remember that prioritized mandate for peacekeeping which I think is perfectly right but then prioritized mandates which I think should be about peace efforts protection of civilian capacity building that's really what we should focus on but then it means that others should do other things or should help us do what we do on these three areas and we see that we're working much more and we will be working more with partners on the ground with the EUETMs, the EU training mission that we have and Ireland is involved in those mission in Mali or Central African Republic there's one in Somalia as well and the World Bank Agency Funds on Programmes and all of this and I think the challenge is to make sure that we really bring where the input in the areas where we have the biggest added value and we also coordinate us in such a way as to avoid application and to really maximize our respective input, the reforms that were carried out at the initiative of the Secretary General then accepted that adopted by member states really aim at providing and promoting this more integrated way of working and I think by bringing closer together the Department of Peace operation the Department of Political Affairs by promoting a more integrated way of working with the Agency Funds on Programmes there is I think a new spirit, it's a work in progress all these different UN institutions have their own ways of working, their own tradition, mobility, we're talking about mobility it's very weak and sensible but I do think that we have some progress there and we've been working on a few situations where we are currently transiting from peacekeeping to another form of international support and Haiti that was the case and Darfur, it is currently the case so this also helps us sort of approach situation from the right angle which has to be a broad one and I keep insisting that in any situation which we are deployed as peace operation we should not look at that situation from the point of view of the angle of the peace operation, we should look at the situation from the point of view of what is it that we can and should do to make a difference and then what is our role as peace operation and what is the other's role that should complement our own activities in peacekeeping so finally just a word on improving conduct and discipline as well which has been a major issue not that the situation regarding sexual exploitation abuse was not more prevalent in peacekeeping than in any other branch of the United Nations system but it was certainly even more unacceptable so there was a lot that was done and very much because of the personal engagement of the Secretary General, I think we're in a better place now we have a much stronger reactivity by member state I think we also are more effective in learning about the allegation making sure that they're brought to our knowledge and I think we're also better in terms of supporting victims because we have now this new system with victims rights advocate in our big mission and we provide all kind of support to victims including when it comes to paternity claim but I think the number of allegation is decreasing in peacekeeping so that is a good sign on the other hand I think we're not at the hook I think that first of all there are still cases there are allegation many of these allegations are about all cases but still we have to deal with these cases and I see an issue in terms of the responsiveness of a few states regarding all cases I see a problem when it comes to making sure that all states will have the proper legislation to prosecute those responsible for these acts and I see a problem in terms of making sure that really all allegations will be brought to our knowledge and I think it's again we're improving there but I think it's a work in progress so just to wrap up I think the future of partnership will be very much about you see the future of peace operation will be very much about partnership I think that's quite clear in all aspects and we have this big operation today we're very much focusing on trying to improve the impact of these operations that are all challenged and operating in challenging environment and at the same time we have to think that way forward and I believe that there will be a further diversification of the ways and modalities in which the UN will act on the ground be deployed to promote peace because it is clear that peacekeeping can be a flexible instrument but it's not effective and it's not appropriate and adequate for any kind of situation and particularly when we talk about peace enforcement, counter-terrorism then peacekeeping is not the response so we have to then work to support other form of operation and this is why we're very supportive of strengthening the African Union capacity for their own operation and supporting initiatives such as the T5 Sahel I think this is a way forward this is not... it is complementary to what peacekeeping and even the robust peacekeeping can do but I think there has to be a line it's probably a blurred line but I think there has to be a line drawn between those different type of situation and the kind of responses that they call for and with this I thank you for your attention


So, when I was a child, I made a promise to myself when I was about seven years old. I used to play in all these magnificent ways by standing across a mirror and pretending I was in all these really amazing worlds. So I could go anywhere in my imagination. And when I went there, it was the most valuable, most incredible, most brilliant space of all where my imagination was truly on fire. And about seven years old, I also know that it was time for me to grow up. So I told myself that maybe it wasn't such a bad thing to still keep playing. Like, can I grow up and still keep playing at the same time? So the promise I made myself is to always look at life and move forward without, never, ever stop playing. And I made that promise that I would keep growing up even as a teenager and still keep playing hard with my imagination, with my body, with my mind, with my businesses, with everything that I would do I would keep playing. But see, I'm kind of a weirdo. And I fly my freak flag really freely. So for me to keep playing and asking myself to kind of do it was not a challenge at all. Because, like, look, this is how I do my thing, and it is not hard for me to make a promise to myself like that. So I see things through all kinds of lenses, and the challenge I'd made myself was to keep playing and to teach all of you how to keep playing. And the most important part about that is it is what I gift, it is what I do. So how can I keep doing it as big as possible? See, totally weirdo. But when I made that bigger promise that I would be able to bring that to everybody's lives that they would never stop playing no matter how old and how serious things got that that would be the bigger promise that everyone kept playing. So I became a playologist. I started by writing books on play and literally doing that through counseling and clinical work where as a playologist I was able to bring it one problem and one solution and one family at a time. But to me that felt like sort of like I had the secret sauce and a backward like office where people were helping and healing but I wanted to do it bigger. So the way that I did it bigger was I started using these books to teach other people how to play. One idea, and I shared this with the cohort, was that I would bottle up lotion and for tantrums I would put sparkly cream in it and in the sparkly cream in the middle of a tantrum, which is basically your feelings not being able to get them out right, you would rub that on the child in the middle of the tantrum and you would say the cream is working, the sparkles of magic are taking away your tantrum. They would get distracted, they would start looking at the sparkles and then you can start giving them the words that they need to express themselves. So on a family and a family and a person to a person point of view I was able to do that but how could I actually do that in a really large way? So I started building large theme park attractions, huge ones. Ones where you would go into big water play experiences, big giant dumping buckets of water on your head, shooting them out of cannons and being able to use themes like curious George to get people to playing around a great IP.  And my favorite one was Magic Quest which I used technology in really genius ways where you became an avatar and a video game come to life with a real magic wand that really worked. So you were able to walk around a huge environment and you could wave your magic wand and treasure chests would open and dragons would come to life and it would never forget you. You would be able to start your quest in adventure just like you were in a real video game only this was live and with families doing it together and people socializing with each other. Big never stop playing in this experience model. Now overall that doesn't sound world changing does it? It sounds like people changing but it doesn't sound like it's a big world changing mission. And part of that reason, this is another one I did but I'll go right past it because it's a video game going down a water park slide. So the one thing that I truly enjoyed is the fact that I don't dislike technology. I think it's genius but I don't think it's what's in front of us. I think it's behind the curtain. It could be tactile. It could be making it feel like magic. And I loved inventing technology that you never saw but brought out the biggest play value in all of us. So what's hard is how do we think like that? How do we create like that?  That's how I started but I want this to be really big. So when we were doing our play session together between all of us fellows and supporters, we were thinking about doing something with climate change. Could you imagine if we actually took that on and made a play attraction about it instead? What if that was a playful way of solving the problem? What if we got a large space, large investment and brought everybody to the table? Because the way that it's really done is this guy holding the magic wand. He's not who I want to get playing. It's this guy. The one that doesn't participate, the arm pretzler. The one who's not in. He's my real victim. He's who I'm going after. Because if I can get him to play, now look at him, he's not in and he's not out. He's just kind of thinking about it. And if I can get him to really think about it and to get him to be involved, then you have your genius interaction. Then you can make real change because the guy who's bought in, he's in. It's the people that aren't that we really need to make a difference with. And play is an amazing vehicle to do that with. So I'm always thinking, always inventing, always creating, and always on the edge of taking anybody's idea and trying to figure out how to bring play into it. How to make it so that the pretzlers get involved. So that you open up the platform and use technology to take your genius to the next level to invent and create. So Brian was fooling with me as we were hanging out and some downtime together and said, what can you do with my land? How could you add some play to that? And all of a sudden on my beach walk later, I realized, where's the new frontier for kids? Where can they all come so we can start there, right? How can we create a whole new frontier so we invite children to learn? Children to understand where they can take their powers. Because aren't they the ones that are really going to do it? Aren't they the next generation of players and entrepreneurs and change makers? And if we can take this gift that we all want to do now and pass it forward to them one playful step at a time, don't you think it will really work? I do, thank you.


intro Once again The reason the reason we haven't continued it is not because we don't want to really guys I think you could tell for a few what we like this show a lot We were out of town, so that was one of the things and then we also just got really busy, so I'm sorry I'm hoping to finish it within the week Don't hold me to that So I'm very sorry, but here we go I saw a comment a second ago. It wasn't even a sacred games thing It was one of our reviews or one of our reactions and in it. It said if you guys don't react to sacred games soon I'm jumping off a building, so Thank you for not doing Here we go Landia I think it's the same height Ashubhashwish I know we saw him He was the guard He was with me I thought He was with someone I like how they did that Sir, let's talk later Right, when he saw his hallucinatory fear I'm pregnant Oh, wow You gonna pick a woman? Congratulations, you just heard the news Very good beginning Well, he's clearly You're the opposite Hey man, just let it go now My guess is that's them after I took them to the hospital where she either Couldn't get pregnant or maybe she had a miscarriage Something like that You go down the rabbit hole, Rick, you should definitely not wear that outfit Don't take it off, sir It's a big deal One thing is for sure You won't get pregnant That's great, that's great I knew it What's the point of this? And we decided together, sir That we won't have a baby Didn't we? Yes, I didn't I have no value for my choice So I got the abortion And you're the one That there's no place left in the world That's a great job I'll say more about it later I love how personal this has become I know It's true, you begin to root for the broken man What is your fate, sir?    Is that Shahid Khan? That guy's Shahid That's what I thought So I'm totally confused Like a huge actor If Gary Oldman showed up It would be like You must have just brain dead He's important With what's going on I thought that was a really good episode Great episode It was the most personal episode It was very personal It had a lot of information in it Yeah I thought there was a bunch of really great scenes I loved the juxtaposition of Sartaj and Gatande Going on the red pill journey That was really a great scene Whoever the cinematographer is Then needs to win an award For this show And the directing together Because obviously those are hand in hand DP's and directors are hand in hand Because the cinematography in this show Is just amazing So you've got the Gatande Going off on his own now And becoming basically Old Gatande Right Because he kind of almost lost his way After the whole season one thing He became her dog He became her dog Didn't like that So now we're probably going to see Gatande become the infamous Gatande Right Why everybody's scared of him now In Sartaj's time And all this kind of stuff I would like I would love to go back to watch The first episode again Yeah Because we didn't realize That that was actually like Noisiden Right That was in that chair Right And I feel like we would understand And understand a little bit more And also know And we still haven't really Unless they've exhausted it I feel like we still need to know more About Sartaj's dad And his relationship to Gatande And why Gatande reached out to Sartaj In the beginning Yeah And then that guy who's In the beginning Kidnapped by the other guy Right What's going on with that And I love I forget Forgive me for getting the active name But the I don't know what they're called Guru or whatever Yeah Who we saw in Newton Who we loved in Newton This completely different character Them together It's like a dynamic Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry Parry just reeling it in. Yeah. Reeling it in. And I'd be interested to see what else comes of what's her Facebook class is that I'm going to tell you about so much. Because she's really powerful and has a lot of friends everywhere and a lot of information. So she's not, I don't think, just going to let him go. No. No. I figure we're going to see her again more. Yeah.  But that whole, he's obsessed with Western colonization. So the whole story of how the West expanded from the East. And he's using that as like the pattern for what he's doing. And I can't wait to figure out how she kind of went on with Kuku. Right. Because she's really like strong and fast and smart and all that kind of stuff. And then to do that complete one aid on a different kind of character. And then something had to happen. And let's not forget that we still have underneath all of this, while this episode was so personal for these guys and these stories and even Kalki's character, we've got a lot still going on of religious tension and political tension and corruption in the law. Whatever bomb's going to go on. Right. And while on day seven of some nuclear something. Seven days left. Seven days left. Four episodes left of this season. I'd love to know people, if you know who've read the book, how well they're doing and taking the literature and making it TV. Because I know for the most part, people who've read, for example, Game of Thrones is the first thing to come to the mind that came to screen. They like what was done until season eight. Until they got ahead of the books. Ahead of the books. Yeah. So I don't know anything about the books. Shouldn't have done it. But it's so complex. Yeah. So complex. I love it. And I'm like I said, I'm hoping we'll finish the season within a week. But just don't hope we do that. Thanks for your patience. We're doing it. We're doing it. We love the show. But I just thought of us doing some kind of parody scene where I'm the guru in your guttung.  I don't want to see you with your shirt off. Yeah. You do.


We have the seats. So nearly the last joke. It will be given by person. He comes from India. He's still a student and he did the sum of code for Google. And at that time he has the opportunity to dig into scientific computing and for JRuby for instance. But also he did a lot of work on GPU computing and he developed a binding for Ruby and JRuby on CUDA which is a C++ framework for GPU computing. So you see that he has a quite good understanding of scientific computing. Please welcome him with me. Thank you. Hi, I am Prasoon and I will be talking about scientific computing on JRuby. So the main objective of this talk is to tell you how to create a great gem or tool that uses JRuby and that's very highly efficient and has a very good speed. And this is all because the scientific library that I worked on is memory intensive and speed counts. So I'd like to share my experiences with that. Next I will be introducing you to the general purpose GPU library that I worked on. And this was after my GSOC. And this library can be used for industry in production and academia for research. And yes it can be integrated with Rails. So SciRuby is also called as Ruby Science Foundation and it has been trying to push Ruby for scientific computing. Some of the popular SciRuby gems that we have currently are N-matrix, Daru, mixed models, NAPLOT, IPython notebook and many more. So these are the most commonly used ones. So what N-matrix is? N-matrix is a SciRuby's numerical matrix code. It helps you to perform linear algebra calculations on your CPU. And it has support for both dense matrices and sparse matrices. Basically it helps you to analyze matrices which you might have studied in your high school where you used to solve linear equations using matrices. And N-matrix for MRI relies on atlas, C-blast, C-lapac and standard lapac libraries for its linear algebra operations. These libraries are state-of-the-art libraries because they are written in Fortran and are highly efficient and are used for number crunching. So this is how you use an N-matrix gem. You just require it. And in the first one, second line of code, I create an N-matrix. This you can see that it's a two-dimensional matrix of three rows and three columns followed by the elements it contains. And the type of the matrix is float 64, which is actually double. So double is used for scientific computing because it has a high precision and you can't use simply float 32 or float. So I created a matrix of three by three. You can see that it's a row-major format, 1, 2, 3, 4, 5, 6 and 8, 9. In the next line of code, I just add these two matrices. And in the third line of code, I calculate the determinant of this matrix. Next, Daru. Daru is what pandas is for sci-pi. It helps you to load data into a data frame from, say, Excel file or CSV files or TSV files. And then you can analyze this data. So in this code, what I've done is that I simply require Daru. In the second line, I just load this data from alien spaces.csv. And next I do is that I create a vector and I just show this data frame. Now next is mixed models. So after you have loaded the data, maybe you want to perform some computations like model this data. So this can be done by mixed models gem. And in this code, we try to calculate the fixed effects and random effects of this model. And thus we can also use this to predict for some random data. Next is a NAP plot. Any scientific library is not successful unless we have some great visualization tools. NAP plots fit this gap for Sci-Ruby. It's used for 2D and 3D plotting and it's built on the top of D3. Next, why you should use Sci-Ruby instead of sci-pi? Simply because we love Ruby, we love Rails and expressiveness of Ruby. When you collect large amount of data from a Rails app, you can just fit this data into a Daru data frame and then you can perform computations and you can use this Daru as an analytics tool. Next is J-Ruby. My project for GSOC was to port and matrix to J-Ruby. And basically Sci-Ruby was trying to push its gem towards J-Ruby runtime because of the speed. It's actually 10 times faster than C-Ruby on certain aspects. And with Truffle Ruby, it's around 40 times faster. And right now we just heard that it's going to be around 26 times faster for just J-Ruby classic. So this bird, I like to call it as Roadrunner because I'm just dealing with speed. And I want to make this Roadrunner go beep-beep. So N matrix for J-Ruby. So N matrix for why? I will build N matrix for J-Ruby because it has no global interpreter log as in the case of MRI. So it's a very good team player. When you have a large processor with multi-course, you can utilize them. The program you develop can be easily deployed with the help of Warbler gem. So you can develop any gem on J-Ruby or any program in J-Ruby and just deploy it to your supercomputers or cluster of whatever you have.  Whenever you develop a C extension for C-Ruby, you have to take care for garbage collection because you are dealing with large data. And when C-Ruby does the mark-and-sweep model, as we have heard in the previous talk, that this mark-and-sweep is not really good to handle. And when you have a very large matrix, say 2.5 million elements in a matrix, you can't really, means speed is not good in such cases. Next is N matrix for J-Ruby that I worked on. It relies on Apache Commons Math, which is a Java library. And it has very good developer activity around this library. So MD array. Before I built N matrix for J-Ruby, we had MD array that does this, an MD array gem that was just like what N matrix was for. C-Ruby, it was the N matrix for J-Ruby. So when we try to create a unified interface for N matrix for Ruby as well as J-Ruby, just like Nokogiri does it, that you have a simple gem and you can run it on both instances. So we could have used MD array and just built a wrapper around it for N matrix. But indeed this was not going to be a good idea because it used parallel called as a dependency, just like I used Apache Commons Math. And it was depreciated at the moment. And next is that every gem when you create with the N matrix, you had to reimplement it using MD array if I didn't build a wrapper around MD array. So you have to put in more effort for optimization. For example, you have to check whether the data is not getting copied like that. So how N matrix works? Basically N matrix can be divided into categorized into two parts, N dimensional and two dimensional, two dimensional. So this is how an N matrix object looks like. You have its shape. That is, for example, I created a three by three matrix. Its shape is three comma three. Its D type is float or it can be anything like int complex like that. S type is like whether you want to store it as a dense matrix or a sparse matrix. Add S is basically the storage, the elements that go into a matrix. Now you have the add dim. This means that how many dimensions you have? For example, three comma three is a two dimensional matrix. Next is N matrix architecture. Basically, we have a Ruby front end here. Then we have for MRI, we have a shared object extension.so, which is built using C and C++. Now this integrates with N matrix C library. Sorry, a native C library which is C++ or C++. And this C library is connected to the FORTRAN library. That is BLAS and LAPAC. So basically you have three layers.  For JRuby, we have just extension.jar. It is built upon the top of Apache Commons Math. So, for N dimensional matrix, the major thing operator we had to build on it was element-wise operation. For example, add, subtract, sign or gamma. In the first slide where we added two matrixes, this was just going in element-wise operation. We iterate through the elements, we access the element, do the operation and return it. So the major thing that counts here is you have, your loops should be efficient. You can iterate throughout the array and whichever is the first, whether CRuby or JRuby. So here in this slide, I show you that when I created a matrix N1 and I just add them. So N1 plus N1, you get this matrix. For example, 1 plus 1 gets 2, 2 plus 2, 4. Next, what were the challenges that were faced? First is auto-boxing and handling multiple data types. Second is minimizing the copying of data. So in JRuby, we have this that when we tried no strict typing, basically directly creating a data using JRuby code, we got this error. For example, in this case, we have two arrays. We just add it and if this array is smaller than one, you start getting the values as 0. So I think Charles can answer me this question after this talk. And if I just simply add this any number greater than 1 to both of them and I subtract minus 10, so I get the correct result there. So next is auto-boxing. What we did was, as this project was in initial stage, I just dealt with the float 64, that is doubles only because we had to deal with reflection and that's all. Then for strict, we created data types using Java and we couldn't rely on reflection for large data. For example, if you create storage as array.new and storage as Java double with rows and columns.new, second one will be definitely faster because you know the size of the array and you can loop faster through the second array. So now we have auto-boxing and enumerators. This is a classic case because when we tried using a matrix for JRuby for real data, for example, we have a 5.5 GBs of data which we get from a blog and when we try to run it, we get an error here. As you can see this highlighted code, I just created this array as array.new. So what happens is that you start losing precision. So if you just implement this in using Java code, so here you don't lose precision. Next is minimizing the copying of data. As we had heard in the previous talk from Charles that JRuby takes more memory. So basically what we are trying to do is we take the storage. We are trying to build an enumerator that each with index. We have to get elements defined by indices and if there are blocks passed, I just want to do some computation with it. So I just convert this storage to an array and then I take the slice index and I try to push it in this array and here we start losing values. For example, if we were trying to factorize a matrix, so every time you do it, if the value is 0.02 or 0.03, this gets to 0. And when you are trying to optimize something and you have to iterate through this matrix, you have to perform the same computation through this matrix, it won't get optimized ever because you can't just go to a convex point where this value converges, so you can't reach a minima. So next is minimizing the copying of data. So whenever you build a JRuby application, you make sure that you don't make copies of data because already it consumes twice the memory than CRuby. So if you start making more copies and you have a larger matrix, it may totally destroy your GC. For example, there was a computation where CRuby takes around 50 seconds and when I was just building n matrix for JRuby, it took me around 1.5 hours. So after I made sure that I'm not making copies of data, I took down this time to 40 seconds, which was better than CRuby. So you just pass by your friends. You just create a static method as helpers. We will see this example later. So next is two-dimensional matrix. Now you have an n-dimensional matrix and you want to perform certain computations like you need to multiply two matrices or you need to factorize it. Then we need to just cast this n-dimensional matrix into a two-dimensional matrix. So the basic operations here are dot, which is matrix multiplication, dead for the calculating determinant, and factorized LU, means lower upper factorization. So in n-matrix MRI, we have BLAST3 and LAPAC routines that are built in Fortran. But n-matrix JRuby means it depends on Java functions from Apache Commons Maths. So the challenges were as follows. You convert an n-dimensional matrix into a two-dimensional matrix. So actually n-dimensional matrix is stored as a 1D array because you can't just simply store a multi-dimensional array because you can't just lay down them in the RAM properly. Now you have the array size matters and you have to access the elements with speed and you have to also take memory in consideration. So we have an n-matrix. I need to get a 2D matrix from this. So I use these helper functions. These are static methods from a matrix-generated class called get-matrix-double, and the array-generated class has a get-array-double. So in this code, I'm trying to iterate over a matrix. It means basically a two-dimensional array. So I just benchmark this Ruby code. You can see that in the first line of code, we create a Java, basically a two-dimensional matrix of size 15,000 to 15,000. And I just benchmark this code where I initialize the value of this matrix as the index. So this takes me around 39 seconds. And then next I iterate over two arrays where I just copy the elements of one array into another. So this takes me around 65.12 seconds and 5.4 GB of RAM. So when you have such large matrix, your RAM will be already consumed by that time and you can't do it for any number crunching program. So yes. And I do this similar thing in Java. And for this, the time requires 0.031 seconds. And when we have two arrays, it takes 0.033 seconds. And the RAM consumed is 300 MB. Hence, speed is improved 1,000 times and memory is improved 10 times. And this is actually speed-wise better than CRuby. But memory-wise, not as good as CRuby. CRuby takes less memory, but speed is slower. Next. Also, 15,000 is not a very large matrix, right? Yeah. 15,000 into 15,000, which is 225 million elements. Yeah. So there's another gem mixed models that relied on N matrix. And simply by porting N matrix, I just ported this library to JRuby2. And so you can model your data in JRuby now. Now we benchmark N matrix functionalities. These are the system specifications. I had an octa core CPU and a 16 GB RAM. Next form, in this graph, you can see that the number of elements in a matrix. This is, for example, 5,000 by 5,000 elements. We have 25 million elements in a matrix. And then on the y-axis, you can see the computation time. So lesser the computation time, the better the speed. So this is a logarithmic scale. So in this case, N matrix JRuby is faster than N matrix MRI. It is around 40 times faster. Next for subtraction, we have the same case. It's 40 times faster. Next for gamma, we have this, we compare 3.  You can see that on N matrix JRuby, it's even faster than the Fortran code. And it's a lot faster. It's 10 times faster than N matrix MRI and MRI LAPAC. And 400 times faster than this N matrix MRI. For N matrix multiplication, N matrix JRuby loses to N matrix CRuby or MRI. Because we definitely don't have Fortran libraries for this. And so any code, any Java code can never beat a Fortran code. Even though we have jitting and this code will get improved after running a lot of loops, but still not get better than Fortran. Similarly for determinants, it's again 20 times slower. For factorization, it's same 20 times slower. So these are the benchmark conclusions. N matrix JRuby is definitely faster for N dimensional matrices and 2 dimensional matrices when element wise operations are concerned. But N matrix MRI is faster for 2 dimensional matrices when you need to calculate the dot or determinant or you need to factorize it. So how can we improve this? So the solution is that we also implement the backend of N matrix JRuby with Fortran. And this time it will rely on Java native interfaces. And there was an option to use another library called Jblast, which is a JNI for BLAST libraries and LAPAC libraries. But when I tried to use them, it had a lot of bugs. And it was efficient enough. So this would be the final architecture of N matrix JRuby. So we took this left side of this diagram to this right side. And overall when we do this, when I tried to do a sample benchmark for this, it was actually faster than N matrix MRI. So maybe in 2 months N matrix JRuby would be faster on all aspects than N matrix MRI when I implement this part of the code. So also the future work includes implementing N matrix for complex data type and adding sparse support and convert N matrix JRuby enumerators to Java code for better speed. So overall whenever you try to do any computation using N matrix JRuby, it would be currently as far as N matrix CRuby or even sometimes faster because the overall calculations that rely on a single dimension, that would be faster in case of JRuby and obviously JIT. So am I done? No? Enter GPU. So after Google Summer of Code, I wanted to go even faster for number crunching and that's why I thought of implementing a general purpose library for GPU computations. And the aim of this project was to combine the beauty of Ruby with transparent GPU processing. And yes, this will be tested on both client computers and on servers that make use of Teslas and Intel Xeon 5 solutions. Before this, there was no Ruby project that was good for GPU computation maximum you could do was add two matrices using GPU and that also was for 1000 by 1000 matrix. But yes, the RFI library that RB library that I developed can handle around 15,000 into 15,000 elements matrix easily and we get to test it on supercomputers. So what is RFI actually? So RFI is an open source GPGP library that is written in C++ and uses JIT. So using JIT makes it even faster than CUDA and OpenCL. So yes, the competitors Pi CUDA and Pi OpenCL would be slower than RFI RB. RFI has also bindings to Python, but RFI Python is built using Cython. So whenever you try to do this, this code is really not tested and try to do some computations using RFI Python on my system and actually most of the times the program hang. So and when I did the same thing with RFI Ruby when I built it for MRI it was working properly and the speed was awesome. Next is RFI Ruby can also help you to just go computing without writing kernels. So whenever you try to do GPU computing most of the time you end up writing kernels and this is where most people just leave GPU computing. But in RFI you just have readymade formulas and it can handle matrices of any size. It automatically scales. So how do you use RFI Ruby? So you just in the first line of code I just created an RFI matrix. It's a two-dimensional and two rows and two columns. I just add these two and in the next I show you how we implemented BLAST routine where I multiply two matrices. And then in the third part of the code shows how to get the determinant of a matrix. So let's see how its RFI Ruby is built for MRI. It's a C extension and the architecture is inspired by a matrix and an array. Basically RFI is written in C++ so when we try to build this library we need to handle C++ code. So for that these instructions help you how you can do it. And the most important point to note here is that you just get rid of this mangling errors in C++. For example, this is how I implemented matrix multiplication. I just included ruby.h and I created a data structure for a RFI object. Then I just bind it to Ruby front-end in it RFI. I create a function called arf-madmul. So this is being casted here because this code is actually in a CPP file and what Ruby front-end expects it is to be in a C file. So next I do an arf-madmul. So this finally goes to this line of code where I just multiply it. Here we can see that this line is for whenever a GPU computation is done it's done on a GPU RAM. So you need to get this memory into the CPU RAM. So this line helps you to do this. So when we try to integrate RFI with Rails this line would be very helpful and you may be wondering that why GPU computing on Rails. Because you have data. Means you collect data through active records and now you can just analyze it. For JRuby the approach is same as N matrix JRuby. We have a Java native interface for RFI already built and even I implemented some of the BLAS and LAPAC routines. This works on RFI Java. For example the last example we saw where we did matrix multiplication in C code. This can be easily implemented in JRuby just using this part of code. So here you can see that how awesome JRuby is. Now we benchmark RFI. System specifications are as follows. We have same octa-core processor with 60 GB of RAM and GPU was NVIDIA JTX 750 Ti and RAM is 4 GB. So in this I think you can see it here. And this is around 10 raise to power 5 times faster than N matrix Ruby and 10 raise to power 4 times faster than N matrix JRuby. And again RFI is faster even here. It's around 10 raise to power 6 times faster. For matrix determinant it's around 100 times faster. Even for factorization it's RFI is 100 times faster. So transparency. After actually the current when you try to find RFI on GitHub you can see the code written only for MRI. For JRuby I have already done the groundwork. It just needs to be in the repo now. Can you go back to those figures because I think you are a bit too fast. Okay. It's more than 100 times faster to me. Okay. Maybe 1000 times faster. So transparency. We need to integrate it with N array and N matrix and with Rails. So where I showed you that just you just copy the RAM from GPU to CPU. You can just create some function methods for that. And yes Rails is now on GPU and similarly as N array and N matrix. So what are the applications? Actually RFI has endless applications. You can use it for bioinformatics. You can integrate it with TensorFlow when it's ready. So you can just create a GPU cluster using RFI and integrate it with TensorFlow. You can use it for image processing. You can use it for computational fluid dynamics. So hence beep beep. These are the useful links. You can go to for N matrix. You can find it there. And RFI RBZ. And the latest code can be found on RFI TEM branch. I would like to acknowledge my mentor Jotlpins and Charles Nutter and John Woods who have been very helpful to me in creating these libraries. Both RFI and N matrix. Next is Alex Gossman who developed the mixed model gen. He developed Daru. And then we have Pradig Garigipati from the RFI team. He is also mentoring me with this project. So also I would like to thank Emerging Technology Trust. That is the organizer of RubyConf India. And currently they have sponsored my travel to Fosden. And thank you. Thank you very much. We have time for questions. Did you consider other libraries like Boost, CMD or VC for the parallelism using the hardware? Hardware for what? N matrix or RFI? For sending more than one value to the processor for the computation to be done faster. See, your question is basically that I need to send the values to more than one course for processing, right? So basically for N matrix it is done by Fortran and Fortran is already optimized for this. It lays down memory in certain way that it uses parallelism for that. So yes, it's done by that way. And a Java code can beat that code. Okay, next. Actually Fortran doesn't use MMX or other processor instructions created by that after the Fortran language was defined. The Fortran libraries are really old for that. Usually you have now two libraries in C++ that are able to do that because they know how the processor was built. The name of those libraries are VC and Boost, CMD. Okay. If you want to take a look on that later. Okay. And there is also one library that I helped to write for matrix processing named Eigen3. That's really fast and I think it's... It's for R. Eigen3 is for R, right? No, Eigen3 is C++. Okay. But R uses it mostly. Yeah. RCPP and R Eigen. So I think that's slower than LAPAC and BLAS. Okay. Next question. So great work on this stuff. I just just a request. Okay. Anything that looks like a Bob or you've got problems comparing to MRI, even if you're not sure, just go ahead and file. Okay. We'll be able to tell you right away if there's any problem. Like that matrix thing. Yeah. I don't know. We are poking around over it. Okay. So basically the problem is that even I don't understand whether the problem is with JRuby or with JVM. So... It's probably us. Okay. I was just assuming it's us. Okay. But you added two arrays and normally that plus would just trapmate those. So do you override them? No. I didn't concatenate those. I just add these two elements. Means two... For example, the area is 2, 2 and other is 2, 3. So we get the final area as 4, 5. Yeah. Means one... Okay. And it's just not adding right. It looks like it's coercing as a fix. Yeah. Yeah. And actually this can't be reproduced. Sometimes you get 4 out of 10 times, you get a 0 or else it works fine. Yeah. What do you see is the integration of this with Rails? Yeah. What kind of integration do you think you can do that? So basically if you have some... Maybe you can try it with Active Record. Basically I'm not consulted. I consulted some Rails developers at RubyConf India and they had inputs like we can do it with Rails. And so it would be widely used. Other questions? Thank you, Preston. And a very good... Thank you.


MarketPulse is a Bookmap add-on that offers both visual and audio outputs. With MarketPulse, you can now hear the market unfold, offering you a different understanding of exactly what's taking place within the order flow. You can subscribe to the add-on via the Bookmap Marketplace. To learn more about this unique add-on, go to bookmap.com-knowledgebase in the add-on section. Basically, MarketPulse is a framework for a variety of diverse algos that can provide both visual and audio outputs. Let's get an overview from one of the algos called Volume Pressure. First, there's the Bookmap API. Then, MarketPulse. Here's the Volume Pressure Algo. It outputs sounds, a widget, and subchart lines. You can see other algos output data in a variety of ways. Scroll down a bit further and you'll see the download link. Click on it after you subscribe to MarketPulse from the Bookmap Marketplace. Then open Bookmap and add it via the Configure Add-ons tool. Scroll down and click on Add and add the download file. Once added, click on the box and click on the MarketPulse text. Let's go over the basics. We'll start afresh and remove all previous studies here. Now click on Create and select the specific algo from the drop-down menu. Hover over the info icon to understand the details for the specific algo here on Volume Pressure. You can apply it to a particular instrument from the drop-down menu here. Let's click on the Play button and the algo will begin loading. Once loaded, note that the widget pops up as well as lines in the subchart. With these tools, you can close the widget, mute it, or expand and collapse the settings. You can use the same tools on the actual widget with Mute and Close here. Or right-click on the widget, select the settings, and expand and collapse it. Thus we can close the Configure Add-ons window. Note the widget is a free-floating independent window. Let's go over some of the settings. First, what is the algo doing? When volume pressure crosses a certain threshold, then a sound is outputted. In the same moment, you can see it here in the subchart. Play around with the settings to get the desired effect. You can adjust the volume here. And down here you can choose from a variety of sounds for both the positive, P, and negative, N outputs. You can also give the study a specific name and play around with the widget size. Let's go over some important settings. The training period is basically the look-back period of the study. This allows you to adjust and control the output during slow and volatile market times. The half-life period is the decay rate or fall-off rate during the training period. For example, within the data of this particular training period, the output will fall off 50% every 10 seconds. Play around with these two settings to get the output you desire. How can we do this? Let's use the subchart settings to give us insight. Here you can display buyers and sellers separately, or by their absolute value, or by their delta of buy minus sell. Let's use the percentage of buyers and sellers. Now let's play around with the threshold and click apply. Note the white, green, and red lines in the subchart. When the buyer's threshold is met, a green line appears. When a seller's threshold is met, a red line appears. A white line appears when no threshold is met. Let's zoom out a bit and note when a sound or threshold is met. Depending on your trading methods, you may desire more or less outputs. Use this subchart along with the training period and half-life period to gauge when you'd like to receive a sound output. Now let's take a closer look at the actual widget. Sellers are here in red and buyers in green. The number in the top right is the max value obtained during the training period. The numbers here are the current value within the training period. The vertical white line represents the threshold value. When the red or green values cross the threshold, a sound will play. Let's close the settings and add a new setting via the configure add-ons button.  We'll open the setting here. Perhaps you want to add a new study for the same instrument, or you can select another instrument from the drop-down menu. Go through the same process as we did before to give the desired output. Let's also cover these buttons up here. These are global buttons that work on all listed studies. You can reset the widget location, mute all widgets, close all widgets, and expand or collapse all widgets. You can see that BookMap's Market Pulse add-on is a rather unique add-on that allows you to actually hear the order flow. This additional sensorial element will offer you much deeper understanding of exactly how the order flow is unfolding within the markets. Give it a try. You'll be amazed at what you can gain from hearing the market.