Rai anurus bet Open Gen Okua, rur�imun, rai i te kaitai mag23a NCT-rai m Zi o datesosit zaBrAM. Aga nanir해 taika, mūsiau na sei rai kaitai Ngatiêmara OK� Project hearing  walls by specifically looking at transformative projects, he has a background in capital, he was the director of direct capital. Matthew Monophan, really inspiring individual who I know a number of you in the room know, really such a pleasure and honour to meet Matthew a couple of years ago now and so inspiring as director of inflection, also CEO, founder of inflection, director of Namaste Foundation and also co-founder of Kiwi Connect so welcome both to the stage. It's a privilege to be up here and get a chance to interview Bill for all of you and I know we're going to have a lot of questions so Bill and I had some time to prep some topics and try to give a high level frame of next foundation but also very much want to invite the conversation so get ready with questions as we go along. So thanks for coming Bill. Pleasure. Nice to be here Matt, thank you. So maybe you can start off with the high level of who you are, what you're doing at next foundation, maybe a bit about the background. What I'm doing at next foundation, a lot of learning a lot but you know my next foundation you know as Rebecca said was launched last year with a gift from a very low profile New Zealand couple called Neil and Annette Plowman who were involved with a business called New Zealand Towel Services that many of you would know if you went to the toilet or the bathroom any time from about 10 years ago to 100 years ago then you probably used an NZTS Towel and Neil and Annette had been very philanthropic before next foundation they had been involved in a number of large scale projects like Rotorua Island, the Restoration of Abel Tasman National Park and some educational initiatives like Teach First and University of Auckland fellowships and they decided that they wanted to do their philanthropy in a more structured way and so formed next foundation last year and I've been lucky enough and privileged enough to be the CEO of that business since July last year and we've got an interest in making large scale wide impact grants in the areas of environment and education so the 100 million that Rebecca and Matt have talked about is to be spend down. My background as Rebecca has alluded to has been an investment really this is my third career my first career was really in foreign exchange dealing in Wellington in the 80s followed that with 20 years with direct capital which is a private equity business or as Payne's to point out to Matt that it is what those from your Silicon Valley would call growth equity not what some people associate with private equity and then across to next foundation last year and I've thoroughly enjoyed it. So one of the things in talking to Bill coming from a business background it's really interesting how next foundation is structured and the type of thinking that you're being tasked to bring into philanthropy but before we dive into that I'm wondering if you can speak to a bit about you know your relationship to this challenge we have globally around environmental restoration around education what drew you to this work what drew this this team configuration together and and how do you think about its importance? Yeah you know one of the things I've always believed about New Zealand is that you know one of the great benefits of being a small country is that is that you can actually do things and make things happen in New Zealand's an easy and easy to do business and an easy to parent and an easy to do things place. So you know next foundation was set up and and next foundation was set up really on the US philanthropic foundation model so while what it's doing is in some ways relatively new in New Zealand it's certainly not common in the states and those of you who are familiar with US philanthropic foundations the names we know and names like Carnegie and Rockefeller and some you know we're thinking about things in a similar way so I thought that bringing that structure and that way of thinking to New Zealand was a real opportunity. The chairman is a guy Chris Liddell who'll be known too many of you from New Zealand who's in the states has had quite a lot of exposure to the US philanthropic scene over there over the last 10 or 15 years has had a 35 year relationship with Neil and Annette Plowman and a very strong and trusting relationship as have the other trustees so they put together a structure and an approach in a way of thinking which I was which which I thought was great. I was fortunate enough that when I when they asked me to talk about how I would think about things I really talked about my experience which was involved in what I'd call growth I like the phrase growth equity that you've that you've got met but private private company investment we called it and I talked about that approach even though we were giving away or will be and will be giving away money we're still looking for returns they're just not financial returns they're ecological and educational returns and so the thinking is very similar and and that attracted me and you know the two the two areas from a personal point of view education I've always been interested in I come from a family that's been involved in that I've got a wife who is a teacher a sister who is a principal a father who was a teacher's college lecturer I've always been in and around it I had the fortune to teach myself and one of my one of the careers I didn't mention and and the environment is something that I think every New Zealander just gets that it's part of who we are and and it's critical to a successful future so it was that got me and as a matter of scale I mean 100 million being deployed by next foundation you know relative to maybe some US based philanthropic organizations is smaller than some of the ones you've mentioned but for New Zealand this is you know right up there if not the largest it's different yeah well 100 million is is dramatically smaller than many of those foundations but so is New Zealand luckily so you know that's and and I guess you know 100 million is it's a it's a it's a lot of money in one sense in a New Zealand context we're not but it's not there are other benefactors around giving significant gifts the thing that's probably a little different with our approach is that we're not looking to put that 100 million in 100 different places we're looking to put it in maybe a dozen and and make commitments that will be between three and 15 million for a multi-year commitments so the scale of the individual grants is probably at a philanthropic level are relatively new for New Zealand and so that that minds us to look for things that we believe can have a national can have a national impact and and our focus is New Zealand but we're mindful of the fact that there are things that if we can do them well in New Zealand they can have an impact in in offshore markets or in in other countries or or can it can still be leader leading in a global way even though really our our passion is about doing things for New Zealand so we're going to dive into I understand that next foundation opened it up for applications and maybe you could tell us a bit about that process and the outcome there and then also really want to get to this notion of ecological return and education return how are you thinking about taking this structured approach and applying it to to this area okay yeah okay yeah okay two two questions there really Matt so the first question is yeah we set up a once a year process for applications for grants and one of the one of the things that did it also attract me about the job was that the chairman Chris Liddell who's it who's taken an active role in this as an engineer so everything's got a process and a system and part of the system which I thought was a really good idea was to run a once a year process rather than having it open for 365 days a year and so we but we did that and part of the thinking for Neil and Annette behind that was that being involved in projects as I said over the previous decade really but one of the reasons they that next was created in the way it was and and and given some some sort of public profile completely different to the way Neil and Annette had operated before uh was um was because they wanted to find out what was out there in those two fields so a lot of the process was and we will run it again this year in May and June is to find out well where are the areas in environment and education that somebody like us can can get engaged and then we can decide whether we think those are the areas we want to get engaged in so we ran that process we ran a little sweepstake internally as to how many applications we might get my guess was 80 um I was sort of probably in the lower middle of the pack as as I often am when it comes to guessing things like that and um and we ended up getting 287 which was a lot more than any of us had expected and um and I got to say that you know I would have thought that 15% of them would have been kukes and they weren't um you know there were there were maybe five that were kukes they were you know it's a privilege to um to see all the good stuff that's going on in the country and I'll move by it you know it's been one of it's been one of the privileges of the job and so um we had to uh we we looked how did we look at those 287 while we were looking for things that we thought were transformational in the area that they were acting we thought could be inspirational and we thought we're going to be that we're being done in a business like way because as you have said Matt we come from a business background Neil and Annette come from a business background and and they set up a board uh to do this and the board appointed a CEO and that's a pretty business-like way to do things and um so uh we were looking for as for things that had those sort of three aspects transformational inspirational and business-like at a very high level um you know that allowed us to get the 287 to probably attend for that reasonably quickly um and then getting from that from those 30 uh down to what ended up being for when we were expect that we announced uh just before Christmas uh that we expected I expected anyway would be two um but we ended up being four because there were four that we thought uh we met our met our criteria um getting from with that was a lot more difficult job um and more subjective so what are the elements of subjectivity but what are the things that we were looking for when we were sort of going at at that stage um as I said we were looking for things for that were transformational and and that would not otherwise happen so you know a lot of things that if there were other funders be they government corporate philanthropic funders then those that was not an area that we thought that we wanted to go we we wanted to go to projects that we thought had a really clear definition of the problem and understood what the problem was and um and and it needed and it needed to be a problem that we uh we um uh were interested in and there's an element of subjectivity in that we're a family foundation um one of the areas we've engaged in is predator management predator free New Zealand um we're there because we all think it's important but we're there fundamentally too because Neil and I have a passion for it so you know that's um you know that's the that's there's a subjective element in that and there's nothing to say that the areas that we choose are any better or worse than other areas of uh that the philanthropists choose so the third thing that was important to us was good management team and particularly good leadership so you know probably more leadership than good management team uh really and we think we think that's fundamental uh really more than more than structure um we wanted them because we in a New Zealand context we see that they are large scale uh grants then we wanted them to have wide impact and to have the potential to be wide impact to have that wide impact or national impact and then we wanted them to be to have a plan uh in a thought process i guess that would see them being sustainable because we don't see ourselves as a forever funder and uh if we've got to put a time frame on it it's sort of a five-year time frame so we want to be thinking and talking to projects that can see themselves getting to a sustainable financial and other model uh in something like a five-year time frame um so those are the sort of the five characteristics that we applied at a high level and you talk about business like and one of the things that really struck me about our conversation the other day is that um you know in business there's so much focus on competition and the whole model is based on competition whereas with this predator free project maybe you can talk a bit about it you're really thinking about collaboration and partnerships yeah yeah that's absolutely right i mean one thing more at more at a personal level Matt but you know one of the joys of the of the of the whole gig from my point of view is that when you're operating in commercial in the commercial here and stuff IP and protection of IP and so on is always in your mind uh and always in the discussion the great thing about this gig is you're just given it away and um if people come and ask us how we do things then um we um uh you know we tell them and i've shared my board papers with all sorts of people actually and um and uh and that's um you know that's not only incredibly freeing but it's also an incredibly rewarding thing to be doing so predator free which is one of the areas yes it is uh you know we've um we've partnered and and invested and we call it uh you know we're making grants but uh we use the the terminology that we use as strategic investment um because getting returns is why we're doing it and and and we are involved with our projects on an ongoing basis not at an operational level but at a at a governance level and that strategy and network so we we it's not a give the money and come back and and invite us to the drinks at the end sort of relationship it's a it's an ongoing partnership with uh with the organizations that we uh that we partner with and we look to bring things to them other than just the money and um and so you predator free in New Zealand so some of you if you and some of you may have been here on Saturday when Lou Sanson from doc spoke about zero invasive predators and uh an initiative to um to to bring new technologies and processes to how we manage mainland predator management we can do it on the islands we can make them predator free the big challenge the next challenge and we'll be able to do it is to is to is to take large chunks of the mainland and predator and zips got some technologies that can make a real difference in doing that um so that's set up as a charitable trust with a corporate trustee with a board um with a a chief executive and and it's and a small team of four or five it's akin to a startup business that sort of film the film of cause of the world have got you know enormous experience in i'm surprised that i'm back in that business but it's easier when you don't have to get the money back at the end of it and and so and uh yeah and um it is and because the objectives with zip uh to um uh are very much to create processes and technologies uh that we will that will be able to be used by all conservation projects in the country and that's written into the constitution of the business that any of the process of the of the uh any of the ip and so this generated needs to be for the benefit of conservation in new zealand so i think about it as a for the environment structure um although it's actually it's a corporate trustee charitable charitable trust structure so this notion of for the environment is it's so interesting because this is one of the things we're really passionate about is the this blending of worlds between for-profit non-profit and how the rules are really changing you're applying a business like approach to non-profit you're saying we don't need the money back but we do need return we are doing this as an investment in the environment and i i'm just curious if you can reflect on anything else you see in the ecosystem that can help us if we have 300 amazing applications just out of the gate already and it's heartbreaking to see all of these amazing projects underfunded with doing good work for the world and for new zealand what can we do to bring more capital into the for the environment models that exist yeah okay what can we do one one little thing i guess one thing we did when we saw them um which indirectly to you to your question matters you know we we became aware and no surprise to any of you there were a lot and let's take conservation there we got 50 60 probably applications a lot of them were doing their own thing in different parts of the country in a similar way there's a lot of you know we're great at starting stuff up and and and you know getting the connection and so on doesn't always happen so one of the things you know when you have the privilege of seeing a number of them like that and one at one time you it hits you so we did something we set up within our website a thing called next change and and and invited everybody who'd applied to put their application up um a two pager uh because we just it was a two pager and um and you know probably uh i think there's a little under a hundred of them are up there on next change and we that was one thing we did because we just thought by getting them up there so that people can actually see what's going on that will create things and you know you're you're completely in the business of the of the commons that's your that's been your business well that was our little our little commons around around let's say conservation uh projects so um you know we did that we and we hope that by doing that and by people seeing other stuff and by people and and sharing other stuff that that that will attract um other other philanthropists we've had a number of approaches from uh from within New Zealand uh from from people and and and some organizations who have got an interest in the philanthropic space and from and from and from people in the states and one fantastic Japanese family who've who have run it who've been running a foundation for a number of years interested in conservation education and the arts and we've had approaches from them just about how we're doing things our contribution to that is to share what we're doing and um and to encourage them to participate and to see you know one of the great benefits of New Zealand is and its smallness is you can operate with government here um we've got government here at the table they're open they're looking for these opportunities and if you walk down Lambton Key you'll meet most of the people that you want to meet and and um and we've worked very closely with DOC so Lou when uh for those of you who are here um Zip is a is essentially a joint venture with DOC but we're prior to that we're involved in the restoration of Abel Tasman National Park making that predator free that's DOC land a project which is being funded by next run by next DOC are one of the partners in it but they are also a collaborator they are also a contractor in it and those sort of relationships and those sort of structures are a great opportunity so I think you know it's but it's telling that story is one of the is one of the reasons why you know Chris was a driver and this really said the US that you know there's a lot we learn from the US philanthropic model here in this country and it's not because they're more generous than us they're just a bit more developed in the in the models and um and got more experience and so you know that's our our sort of perspective is you know let's start we haven't been talking about it yet but we will start talking about it because you gotta wait till you've done something first we haven't done anything much yet terrific for anyone watching this if you don't know DOC is Department of Conservation we had a great talk from Lou which will be available on the KiwiConnect channel really highly encourage anyone needing it to see that talk to check it out I have a million more questions Bill this is really great and just want to acknowledge just the the terrific work you're doing but we have so many brilliant minds in the audience so I'd love to pass the mic to to anyone who has questions or reflections hi this is Simon Holdsworth do you you talked about collaboration do you have a way to actually bring in other people to to piggyback what you're doing yeah yeah and that's a good point thanks for raising it because yes we very much we are we want to do that we would like to do that so to give you an example of how that's happened to date um zip the the zero invasive predators started off you know in a sense a joint venture between NEXT and DOC Department of Conservation we went and had a talk along the way to Gareth Morgan who's clearly interested in the same space and is running a project in Stuart Island and now Gareth does a lot of other things other than support conservation but one of the things he does do is support conservation and so Gareth recognised that what zip was doing could really help him in terms of Stuart Island he has come in as as a as a funder of zip and so has Sam and the thing that's really exciting for us about Sam is that most of the work that Sam's done in the philanthropic space and he's done some fantastic things has been offshore and and so you know getting him engaged in something like this is is really interesting and and if I could answer that question in 48 hours I'd be able to talk about somebody else who's getting in as a partnership so we yes the answer is an emphatic yes we we really do want to partner with people just in my experience with NEXT I think one of the really transformational things that you're doing is firstly mapping the ecosystem of all the potential partners and players and then amplifying that good work being a facilitator of some of these strategic partners so that it's not all about NEXT and that we can have the catalytic impact at the pace and the scale that the country needs so I think that's a key element to the strategy and it's really exciting and and humbling to see in the philanthropic space in my experience one of the one of the major challenges that we see is this need to have you know be out in front and name and lights badges on things and NEXT and the ploughmans with their very humble approach I can see having it that will enable some truly catalytic impact in New Zealand so so further questions and and I'll add one point Rebekah you make a good point you know two points I'll add we're not inventing anything here we're just doing what what organisations do in the in the rest of the world and one of them in this regard with relevance to the sharing and collaborating is that's here in New Zealand doing this already and really leading and it is Julian Robertson's Aotearoa foundation so Julian Robertson and and and his New Zealand philanthropic vehicle Aotearoa are really talking this book doing exactly this in this way and and you know we're incredibly lucky that that Julian and and his late wife decided that this was a country that they were going to make this sort of thing work in I'm curious now that you've started interacting with these different types of organisations which classes of organisations or which types of organisations are ready to report measure and report on returns and which types are not and you know what kind of help do they need yeah in the in the in the non in the not-for-profit space yeah um the um because it's no coincidence that Gareth and Sam Morgan for example who I mentioned have come out of the commercial space and it's it's not a coincidence um you know if you're talking about the New Zealand philanthropic scene um that you know the larger um philanthropic foundations uh you know Todd you know Todd foundation for example um and have they are very much in that space they're looking to do that you know I'd read the most and and you know they're thinking about things in that way I think that you know the difference for from for us is more about the size of the grants that we're prepared to make and I guess the fact that we're only talking we're we're narrowing our focus uh more so we're saying actually well if we're going to make 12 grants with a hundred million dollars and I hope it'll be more in the end because I hope that we'll get more partners uh but um if we're going to do that well we can't go everywhere we've got to be very clear about where we want to go and why we want to go there um so um you know I those larger players I think are in that space I think there's an awareness of it it's the issue I think more is probably um is just how is just um expertise and how to do it and you know it's the fact that the board of next chose somebody who came from an investment background a private company or a financial investment background that's probably relatively new in New Zealand um um a lot of people thought I was retiring um I always knew I was going to a full-time job I didn't just realise quite how full time it was and um um but uh and I certainly um see that you know I think there's an awareness um there's probably just it's not not easy to um to not so easy to make it happen about next um and how we're able to kind of measure and tell the stories of the impact moving forward is um as we you know co-create in this country the ability to um frame the holistic social and environmental value that we're receiving and telling those stories I think that will be a big pull for other partners to come in um because people are good they want to do good and they want to be able to demonstrate how they've done good in the full holistic sense of the word so I can see that as a growing area and really exciting one for you so just a question over here oh thanks um just you mentioned with zip that there you're treating them more like a venture sort of an early stage venture rather than a kind of large-scale sort of deployment of capital for a project is there a difference in how you're treating those two different kinds of philanthropic investment as in if it's more of a an early stage venture you'd assume more risk you'd assume um that it has to unfold in a different way any different support or are you looking at them as being kind of pretty much the same thing um let me see if this answers your question that um zip has got all the characteristics of a startup business and in fact it more more for those of you it's more of a spinout out of dock they've been running trials within dock for the last couple of years specifically a 40 hectare trial and with their processes and the mulberry sounds and they're about to start or are just starting a 400 hectare trial in the mulberry sounds and so the people that the leader of zip the the chief executive has has left dock and joins zip as has has has has the number two and they will recruit they will recruit two or three other people to come and join them so in that sense it's got all the characteristics of a startup business and and all the risks and so is it high risk absolutely there are no guarantees that what they are doing will work um um but they are they're assuming a role that is also about hopefully providing some coordination or collaboration in the area of development of predator free tools for the country um i'm not sure if i'm answering your question but in the area of education we're much more likely to partner not with startups but with organisations that have been operating for probably five years um and that doesn't mean they're big though um and and one of the things we're but but because education i mean it's environment you know the ecological things bloody complex but education involves human beings so it's incredibly complex and and so getting involved in that space if something hasn't been operating for five years probably and and made and had the learnings that come with that it's where our our places is probably going to be to help scale those that that actually make a difference and one of the things that we were made aware of early on in the piece was actually one of New Zealand's and this will be no surprise to anybody but New Zealand's not short of good educational initiatives they don't make it pass the three year mark a lot of them because every three years is generally something dramatic hits them called an election and and and one of the things we were made aware of is that we can provide for those projects that we support the ability to ride through the electoral cycle and and you know some of my advisory panel are older than even me and and they've seen these cycles and they talk about the fact that things come around every 10 years and good initiatives so i think in education i see we've got a bit of a different you know in environment we probably will be more in the zip type thing Rotorara Island Able Tasman we started those projects in education a different place i'm not sure if it answers your question okay time for a couple more reflections sam did you hand was going up earlier thanks very much bill i just want to um your other reflections on any gaps or areas that you're noticing or maybe we're surprised that you didn't receive applications from or areas that other funders are not just next around the country or areas you would suggest that uh New Zealanders explore more and particularly the international community here that we do explore any thoughts broadly yeah well you know sam when you say surprise i was surprised at the quality of the applications i would have um uh at the high quality of them and um you know i was um you know as i said i would have thought 15 percent of them would have been kukes that wasn't the case but more than that actually the you know the 287 that we got 200 and something of them were fantastic projects and um and the people were thinking about them in a really good way and and and you know they didn't all have national potential because they weren't thinking about them that way but they were well put together and you know that's the respect i you know it's a privilege to see that stuff so but if you talk about areas that um uh the areas of opportunity we got um let me let me answer this way in the environment in the environment space we got about we got about half and half you know of of environment and education of the 140 odd in environment 60 of them were in the conservation space 20 or 30 of them were in sustainability probably and then um and then the balance were in a range of other things the next biggest i think was rivers where we got about 17 and um and then there was a range of a range of things i didn't think there were any gaps um that i'm aware of but i but i wasn't looking for them either um uh education is a much more we've got a pie chart and for those of you who are here tomorrow if i'm speaking tomorrow the education pie chart where i show where they came come from is much more there are 25 pieces of the pie in education and it's a reflective of how much more um uh um what's the word but you know 25 pieces of the pie rather than six um uh um uh the education sector is so it covered it covered a wide range of stuff that the thing the other part the way i'd answer the question is we're going to choose an environment i think we're going to choose three places to get engaged and this may or may not be it's probably not music to your ears Sam but but the um you know predator making New Zealand predator free we really that's that moves us you know um rivers and and um you know freshwater management we just think it's such an important issue and we've sort of got an opportunity to get involved in te awarau as we got 17 initiatives te awarau came with one that looked like it had a national approach so we're working with them and the third area which is is environmental education and to my mind it's really a third league for us overall i'm thinking increasingly thinking of us as being about environment education and environmental education um in in education i went run into it now but with this sort of four or five areas that i think we'll get engaged in uh tanks you will for uh sharing all of your uh knowledge and experience from next i've got two questions for you my my first question is around um you talk about the importance of environment education environmental education uh could you explain to us just a little bit more why do you think that's important for us to focus on at this specific time um and my next question i'll ask you the next question after yeah good okay uh why yeah why do why do we choose those uh you know um you know it's a combination it's it's there's there's two elements to it one element is is sort of the logical and if you like the business like answer and the other ones the the the passion answer you know um so environment is you know in an environment because the our focus is on making a you know a legacy of environmental and educational excellence for the benefit of future generations of New Zealanders so if you start thinking about future generations of New Zealanders i think you get to environment education pretty quickly really i mean other and it's not to say they're the complete answer but we said you know we can't do it we can't go everywhere so um environment is not only part of who New Zealanders are and um and you know every New Zealanders i think got an and and a one on one relationship with the environment it's one of the one of the fortunes we have but it's critical to the future of this country at an economic level at a at a at a status level at every level so it's it goes it goes to that education is about the future generations of New Zealanders how do you want and and we are fundamentally about transform transformation that means change that means new ways of doing things that means educations the enabler for doing that so they those two things drive us and um and if you think about environment and those two issues of predator free and um and rivers in one sense you know my generation and the generation before me we're the guys that have not bloody doubt not done the job on those things um so environmental education for us is about the 15 year olds and the eight year olds and the children and um and ensuring they're in a position to um you know to be able to actually a help address the issues that we're that we're doing and be you know deliver deliver better outcomes going forward and one of the nice things about the environment is it regenerates so it's actually not a it's not just about stopping stuff and my last question is do you see those as issues primarily that need to be focused by philanthropic and government organisations or is there a role that the private sector can also play yeah nobody can do it by themselves um the the so the philanthropic sector has got a has got a role to play and um um and and it can be in some places it can be a leadership role but it's by no means the only role and zip you know zip's my an answer to that I think is um you know it's a partnership between um between government uh and the philanthropic sector um uh and individuals and give it another 48 hours and there might be corporates involved and and so the the um you know those the answers and you know Te Arawa which Rebecca's involved with which is looking at rivers on a catchment by catchment basis and somebody said to me so who's responsible for the answers to the rivers uh you know who's who's going to make it happen I said everybody it's um so and as a philanthropist you've got a you're in a privileged position of a not just not bringing being able to bring money to the table that helps you get to the table but but what the privileged position is that you're not coming with any baggage or pre um uh or or history and or any particular angle and stating that you're here for the best possible outcome for this particular project is something that you can do and and provided you deliver on that it's a it's a it's a privileged role that can make a real difference in projects um but it's it's not the complete answer it's a it's a great reminder bill and I appreciate the sentiment that you know we all have work to do in these areas and and it's a great invitation I think to members of the business community um to to really get involved in these areas I'm wondering if there's any um final reflections or anything that that this group people might be able to offer any help you're looking for well I make an observation you know one of the things I think is really exciting about this you know what you have brought together over you know I mean I know this week but over over years is you know and I think on previous days you've had it New Zealand's New Zealand's a great laboratory for doing stuff um it's um you know the people are open-minded they they have to be outward looking because there's no one else out out there that's close yeah the closest place you can find three hours and three hours by flight so um and it's an easy place to do business so it's a um you know it's a um it's a great laboratory um so connections with the US and and other countries um where stuff is happening um that is completely relevant are can be incredibly powerful for both sides um incredibly powerful for New Zealand and New Zealand is because we don't have to invent that much we don't have to invent stuff and um and the and the size the scope and the connections that you know that you the the group of people that you've assembled here can bring is just of incredible value and New Zealand is is it is a small town and so you know making stuff happen is doable uh is doable here and but but connections with offshore groups who are who are looking down here um is great and I always used to say in business when we were looking to sell our business to businesses if we were to go people in the States I'd say get them down here once you get them down here you know it's only one stop out of LA and uh and and and once you get them down here you know they they tend to like it and um and so you know the fact that you've got 40 or 50 uh you know people down here who are looking to help I just think is a magnificent opportunity for us and um and you know all power to you in terms of uh in terms of making it happen let's give it up for Bill thank you


The war of liberation goes okay up here But because I had many different unit types My terracotta army now means that I have a gigantic military So it looks means the third biggest though I don't know if it updates this turn or not And also I have been neglected by military and I lost some units up here Now I just got to march these guys up toward victory Which means now I want to pull back I could go after this. It's really no point right now. I Do need some happiness though As soon as I settle here, it'll make my guy guys deeply unhappy. Let's back these guys off All right, I can't get out yet. I won't be able to one-shot me. I'm pretty confident Mining this isn't that important yet till I build this city. I gotta find someone else to trade with I wonder if I could bang out the Great Wall before they build it. Someone else might build it, though. It's the problem The other option is to build more military and be ready to fully assault deems So I can get units pretty quick or plus two happiness. If I build two Colosseums Be able to build that settler or use that settler. Oh, we can't do open borders yet So I can't actually get this guy over there. I just will come back this way To take care of all the domestic stuff first Chopping down some forests Get these troops up to the front lines Yeah, that's the best way If I double my tourism output now so early in the game. No, I think I want to push this culture Yeah, because then I'll be able to build cultural centers I'll be able to push my culture a lot further. Getting this will push the rest of it. All right need some money Does anyone want a trade route? No It's not even that much money Might as well do the safe one though. All right, let's see how to deal with this line of fools That guy took some damage. I like to retreat in Nobody would get to retreat him too, right? This guy can totally escape I had more money I could pay Hanoi to be my friend. All right, how do I preserve these units? For the war to come because I can run this guy over here to heal out of the way Well, this guy back they can come in and strike We'll be in range of this other stuff. I Want to get this settler up there Be dangerous to get him around here and settle, but I'm the one who chose not to go after seafaring Actually I'll get metal casting So four more turns and I'll also have optics So it's gonna keep this guy here for four turns and I'll just go across the water and settle right there now Why does it want me to settle here? Because it was also recommending this spot Might be whales or something. I don't know about over here. Oh Yeah, though since this city one two three, so if I settle here, I'll get these fish See he's pretty well defensible Actually, that means an inner a small intersea Navy would be invincible. It would just be free artillery in here for the rest of the game Silver silver. Oh, yeah Yeah All right, so there might be a whales or something here, but look at this one two three that'll give me an extra silver All right, what to do about the war And I feel they should leave this guy here Do some damage while we're at it Just gotta hold out until my troops get to the front line Oh, I could finish that guy off But then I'd be in range of that city which I think might It's occupied, but I think I think it's at the point where it's gonna it'll shoot at me No, I'm not gonna trade a sword horseman for a Composite bombing because he doesn't move that guy. It'll die I'll just leave this guy here ready to charge up and around the road will let me come in pretty nicely Leave this guy in the city leave this guy in the city All right Yeah, I'll get a city here So get me those luxury resources and I'll backfill and build this city. I still still want to build it here and not there Build it here. I don't need yet another citrus I could crank out a wonder Wonder if anyone else is working on it though. That would be a shame 15 turns. That's risky Of course go back to my demographics I do have the most industrial output by far. I have a lot of industrial output Which is interesting because I'm about to get metal casting So I can blitz some workshops I want to start on the workshop here pretty quick rather than going after a wonders I should build something that's only a quick build out Ah, if you've got all these composite bowmen then a bunch of spearmen Swordsmen would be nice, but I need iron There's the iron One two three I Still getting to work over there finish your mind later. I'll come back to that


Hello and welcome to the session. This is Professor Farhad and this session we're going to be looking at the topic of bankruptcy. This topic is covered in advanced accounting, as well as the CPA exam, the regulation section, as well as the FAR section. As always, I would like to remind you, my viewers, to connect with me only then. I would like to also remind you to subscribe to my YouTube. YouTube is where I list all my lectures, all my 1,500 plus accounting, auditing and tax lectures. If you like my lectures, please like them. Put them in playlists, share them, let the world know about them and please visit my website. I often have CPA offers for CPA students. This is my Instagram account and this is my Facebook account. So we're going to start by looking at the introduction and law. This topic is covered much, much more detailed than a business law course, but this is just an overview. So you are good enough for an advanced accounting course. You have a good enough knowledge. So first thing you want to know is Congress. Congress has the authority to enact uniform bankruptcy law and constitution of the Congress that right. There has been bankruptcy law since the 1800s. So it's something that's common and it's old. Then there was the major bankruptcy reform act of 1978, which was amended several times, 84, 88, 1990 and 1984. And there was always new rules and amendment to the bankruptcy law. But basically what we're going to be covering in this course is Chapter 7 or in this chapter and Chapter 11, which is Chapter 7 is liquidation and Chapter 11 is reorganization. Now notice, for example, Chapter 13 is adjustment of that to individuals with regular income. For example, Chapter 9 is adjustment of that of a municipality when a municipality goes out of business. So law applies to individuals, corporation and partnership, all of which are persons referred to as debtors. We have debtors and we have creditors. So the bankruptcy petition is an official form that initiate the bankruptcy proceeding. Now you could initiate this voluntarily. It means the business can start it itself or the creditors are in voluntary. The debtor must file a form listing all property at current market value and it's that. So they have to show their assets at current market value and they have to show their liabilities at current market value. This form is called statement of asset and liabilities. And here's a schedule of the statement of assets and liabilities. Let's take a look at it just to kind of show you what we mean by this. For example, here we have statement of all liabilities. Creditors have a priority, creditors holding security, creditors have an unsecured claim. So they list A1, A2, A3, then schedule B, real property. Again, with fair market value listed, personal property with fair market value, property not otherwise scheduled, property discovered later. So those are the schedule and B4, property claimed as exempt. Basically as exempt it means they belong to the individual. The individual can claim it. There are certain property that the individual can keep by law. Again, to learn more in details about this topic, you will learn in your business law class. Also in addition to this form, the debtor will have to complete a questionnaire called a statement of fair containing questions concerning all aspects of its financial condition and operation. Because the numbers may not capture everything. The court, they want to learn a little bit more, as well as the creditors about the person, about the debtor. So again, the bankruptcy can either start voluntarily or involuntarily. Basically, voluntarily is pretty straightforward. The debtor might file a voluntary petition for liquidation, which is chapter 7, or reorganization chapter 11. So there is no requirement. If you decide to file, you can file. Filing petition constitute an order for relief and prohibit legal action against the debtor by the creditor. Once you file, basically it's called an order of relief and the creditors can no longer take action. Now they're going to have to both submit to the court. It establishes in a state of the debtor's asset all property at current value and all liabilities at current value. So once you file, there is an estate, basically a new entity. Think of it as a corporation or as a trust. And in that trust, you'll list all the assets and all the liabilities. Who cannot file for a voluntary petition for bankruptcies? Banks, savings and loans, insurance companies, those they may not file for petition. Why? Because they're for the common good. They could be involuntary file against them, but they cannot voluntarily file. Involuntary petition, a little bit different. It's what someone comes after you. When the creditor comes after you. Creditor initiate action by filing a petition for liquidation, which is chapter seven or reorganization, which is chapter 11. So not anyone and you have to have a specific requirement. If you have 12 or more creditors, three have to sign them. And those three, they have to have a debt. Unsecured debt for more than 15,575. Now these figures, they change year after year. That's why I have underlined because you might be listening to this lecture in 2023, 2022. And you might say, this number is incorrect. Yeah, it does change. So the debt has to be greater than equal to than the value of any liens on the property. So basically this debt has to be unsecured. If they have a secured debt, then they cannot file the claim. Okay, because your debt is secured. Secured means you have a property. You have something that you can take over to satisfy your obligation. If you have less than 12 creditors, you have to sign it by one or more. One or more will be good enough. And the debt has to be greater than 1575, more than the value of any liens on the debtor property. So you have to have unsecured debt by that much. Okay, the court will accept the petition. If it sees evidence, the debtor is not paying its bill on time. Now you'll try, maybe the debtor will try to say, well, I'm paying my bills, but the court, if they say you're not paying your bills, they will accept the petition. And now you went into an involuntary petition. Basically you did not want to go into a bankruptcy, but your creditors, as long as they meet the requirements, they were able to put you into bankruptcy. We also have, we have a lot of differentiated between secured, fully secured, that's called partially secured and unsecured. Basically a lot secured and unsecured, but really we're going to have fully secured, the group that's called fully secured, partially secured and unsecured, but really it's secured and unsecured. So the creditors are classified at either secured or unsecured, although we're going to break them into three components, you will see why in a moment. So who are the fully secured or the secured, or the secured creditors? Those are those whose claims are secured by a lien or pledge of a specific asset, and the lien cover 100% of the debt. So the fair market value of the lien covers your debt, then you are fully secured. Okay, so if the proceeds from the sale of a pledged asset exceed the secured, the access proceeds are available to the unsecured. So if you have a loan, if you lend $100,000 to a company and they have a warehouse, and that warehouse is worth 120, they sold the warehouse, you are fully secured, okay, and they have $20,000 left. That $20,000 left, now it goes to the unsecured, unsecured group. If the secured claim exceeds the proceeds, okay, from the sale of a pledged asset, the remaining claim constitute an unsecured claim. Basically you lend $100,000 worth of money to this company and the warehouse is only worth 70,000. Now guess what? Now you are short $30,000. Now you are short $30,000, you become part of the unsecured claim, or you become partially secured. Partially secured claim are those who would lien against the asset who a realizable value is less than the amount claimed. So you have a million, 100,000, but the warehouse is only worth 70,000. So now you are partially secured, 70,000 and 30,000 unsecured. And we have the unsecured creditors. Well, who are the unsecured creditors? They really don't have a lien. They paid from whatever total money remains after the secured. The secured creditor has been satisfied. So you want to be fully secured. That means you have an asset against the debt and that asset is worth equal to the debt or more than the debt. If not, then it's partially secured and you could be unsecured. Now, for the unsecured, so let's assume we have money left for the unsecured. How do we distribute this money? There's a priority. So the priority for the unsecured creditors specified by the reform act. And it assigns priority to certain claims and each rank must be satisfied before the next rank is paid. So here are the, here's the rank. Now this rank may not be 100% in detail completely, but it gives you an idea. The first that's going to be paid are the people who is handling the bankruptcy. Basically the lawyers, the accountant, the CPA, the judges, the administration expenses, fees, the charges incurred and administering the bankruptcy estate. So those are the people that get paid first because they're going to be doing the work. Okay? Because those are the people in charge of the bankruptcy. Then you're going to pay the unsecured claim for wages, salaries commissioned by employees within 90 days before the date of filing the petition. So what's going to happen? The employees, they come after. The employees that work for the company. And you have to pay them, whatever you owe them for the past 90 days, but you cannot pay more than 4650 per employee. Once again, those figures will change every once in a while. Then once those are satisfied, unsecured claim for contribution to employee benefit plan from services rendered within 180 days before the date of the filing of the petition. But subject to certain limitation, we're not going to go into details. Simply put, if you have to fund your 401k for those employees, if you owe them anything for the past 180 days, you have to do the funding after you pay them. Then unsecured claims of individuals to the extent of 2100 for each individual arising from the deposit of money in connection with the purchase lease, rental of property or services that were not delivered or performed. Let's assume you went to this place and you rented something from them and you made a deposit. Okay, now you returned the item. Guess what? They have to give you your money back. You do have priority after the employees are paid and after the employees get their 401k funded. It's called unsecured claim to individuals. Then the last is unsecured claims of governmental unit for unpaid taxes. Then there's any unpaid taxes, those comes next, any unsecured claims. Now, bear in mind in a business law class you'd learn much, much more in details. This list is much more in details, but this again gives you an idea. Now, after all these people, all these parties has been satisfied, any remaining unsecured claim participate in a pro rata of any remaining real legalization proceeds. So after they have been satisfied that there's any money, we'll see if there's anything and we'll have to distribute it. The distribution to unsecured creditor is termed a dividend. So don't confuse the dividend with a stock dividend. And it generally expressed in terms of a percentage of the total unsecured claims that will be paid. So let's take a look to show you how it works. For example, if 100,000 of proceeds remain, so we still have 100,000, after all secured claim and claims have the priority have been paid, and total unsecured claims is 400,000, while each one will get 100,000 divided by 400,000, that's 25%. So each individual, each individual, each unsecured creditor will receive a 25% dividend. And how do you find a 25% dividend? It's this amount, amount of the proceeds remaining divided by the total unsecured creditor pro rata amount. Just to give you an idea about the actual bankruptcy in the real world, I remember when Enron filed for a bankruptcy in 2001, Enron, and it was $65 billion. That was, wow, that was huge. That was the largest bankruptcy. Then a year later, Wartcom, a year later in 2002, Wartcom filed another bankruptcy and it's 103. And we thought that's like, like this is huge. I mean, this is 103 billion dollars. Okay, those are the largest 10 bankruptcies. Then 2000, here comes 2008, with a financial crash, Washington Mutual, $327 billion. So Washington Mutual alone, accounted for almost, not almost, but almost for the last four largest bankruptcies. Okay, then here comes Lehman. Again, the financial crisis, $691 billion. So if you really think about it, Lehman and Washington Mutual, almost $1 trillion, it's more than the eight prior bankruptcies. What does that mean? Why am I saying this? If you notice, as time goes by, as time goes by, bankruptcies are getting larger and larger because companies are getting larger and larger. And I could assure you if the government did not intervene during the financial crisis, we would have had trillions of dollars and bankruptcies from different banks. Okay, but obviously the government stepped in and saved the day. This is just to give you an idea about bankruptcies. For example, GM, when they fell for their bankruptcy, Chapter 11 reorganization, it was $91 billion. Now GM, get out of it. Now, if you don't know what Chapter 11 is, we're going to be working with Chapter 11 shortly. The next thing, we're going to do Chapter 7 then Chapter 11. Just to give you an idea about bankruptcies in the real world. If you have any questions, any comments about this topic, please email me. If you happen to visit my website for additional lectures, please consider donating. If you are studying for your CPA exam, by all means study hard, it's worth it. And see you on the other side of success.


Thank you, everyone, for lasting so long. I know it's been a taxing day. My name is Ryan Davis. I have known elsewhere as Zen Spider. I'll be talking today about making a test framework from scratch. I'm a founding member of the Seattle Ruby Brigade. It's the first and oldest Ruby Brigade. In fact, we came up with brigade in the world. I'm now an independent consultant in Seattle, and I'm available. I'm also the author of many tests, which happens to be, according to the Ruby Toolbox, the most popular test framework in Ruby. And I only mentioned that part because I'm kind of astounded that I'm beating our spec. So setting expectations, something that I always do at the beginning of my talks. This is a very code heavy talk. I'm going to go into detail about the what's, the hows, and the whys of writing a test framework. I've got a few slides coming up to 9.4 slides a minute if I ignore the 30 minutes that I'm supposed to talk. I can go to 35. So I'm hitting 9.4 slides a minute. I've given this talk twice already. It's already been recorded and published, so you can watch it there if you need to. I generally find that adding more slides adds more explanation and comprehension, and generally makes the talk go smoother as long as you don't have AV problems. So the presentation has been published. The slides are up at the URL above, and there is a facsimile of the code that I'll be presenting that is at GitHub at that URL as well. First, a famous quote not said by a famous person. Tell me and I forget. Teach me and I may remember. Involve me and I learn. Who actually said this is a bit of a mystery, but it's usually attributed to Mr. Franklin. Whether it's a legitimate quote or not, I think it points out an important problem in code walkthrough talks. But don't get me wrong. Not all code walkthroughs are bad. Some of them are actually quite good. They're absolutely necessary for work. I'm only talking about code walkthrough talks. Quite simply, I could write this talk in my sleep by simply working through the current implementation of many tests and explaining each and every line. You'd learn nothing from it. Sorry about that. You'd learn almost nothing from it for getting it almost as quickly as you read it. Some of the many problems of code walkthroughs is that they're boring. They're top down. As a result, you focus on the what's and not the why's. They're all good reasons to tune out and not learn a thing. So these are all good reasons for me not to do a code walk through of many tests. That quote before that wasn't by Benjamin Franklin, the real quote that it's based on is much better. Not having heard something is not as good as having heard it. Having heard it is not as good as having seen it. Having seen it is not as good as knowing it. Knowing it is not as good as putting it into practice. I'm not going to try to murder that. Here's a more concise version for those who think that was too many words. And here's a version for tender love who is my most ferrity of friends. So starting from scratch, that's the point of this talk. Working up from nothing is the closest that I can get to allowing you to join me in building up a test framework from scratch. I will try to describe this in a way that you can literally code it up at the same time that I describe it and understand the steps that you went through to get there. Now would be a good time to open up your laptops if you want to attempt this. Many have tried, few have succeeded. Further, this will not be many tests by the end of the talk, obviously. Instead it's going to be some subset and I will apply the 80-20 rule to show the most of what many tests can do in a minimum amount of code. To emphasize that, I will be referring to this as micro test from here on out. There's always two people Google, I love it. And finally, I encourage you to deviate from the path and experiment. To do things differently and you might wind up understanding the choices that I made. Finally, this talk is an adaptation of a chapter of a book that I'm writing on many tests. More info will be on that at the end of the talk. So where to begin? At the bottom, the atomic unit of any test framework are the assertions. So let's start with plain old assert. In the simplest form, assert is incredibly straightforward. It only takes one thing, the result of an expression and it fails if that isn't truthy. And that's it. You have everything you need to test. Thank you. Please buy my book when it comes out. Are there any questions? Okay, no. I would like you to have a few more bills and whistles than that. But before I add those, let's figure out what I wrote already and figure out why. In this case, I chose quite arbitrarily to raise an exception if the value of the test isn't truthy. I could have chosen to do something other than raising an exception, like throwing or pushing some sort of failure instance into a collection of failures and returning. These are trade-offs and there are trade-offs but all of these choices, it doesn't really matter as long as you wind up reporting the failed assertion at some point. I mostly chose to raise an exception because exceptions work well for my brain. There's an added benefit in that it interrupts the execution of the test. It jumps out of the current level of the code. We're gonna see more of this later. So if you ran this expression, one double equals one would evaluate to true which would get sent to the test arg to assert and that would do nothing. In response, it's a pass. However, if you ran this expression, one double equals two would evaluate to false. That would get sent to the test arg and assert and that would wind up raising an exception. At some point, there will be mechanisms to deal with those exceptions and gracefully move on but for now, the whole test suite will grind to a halt on the first failed test. One problem we currently have is that the raised exception reports at the place that the raise was called inside the assert and not where the assertion was called. I want to only talk about the place where the assertion failed on line five of test.rb. So I'll clean up the exception a bit by changing the way the raise is called. Raise allows you to specify what exception class to use and the back trace you'd like to show. I didn't know that until about four weeks ago. I'll use caller for the back trace which returns the current runtime stack where caller is called. Now we see where the test actually failed. That's much more useful to a developer dealing with the failure. Second, we're gonna add our second exception or assertion, sorry, assert equals. Now that we have plain old assert, I can use that to build up any assertion that anyone would possibly need. About 90% of all the tests that I write use assert equal. Luckily, it's incredibly simple to implement. I just passed the results of A double equals B to assert and assert does the rest of the work. And here's how you'd use it, where two plus two does equal four, it would pass. It would pass true to assert and where two plus two doesn't equals five, it would pass false to assert. The rest you already know. This is really all I need to do most of my work quite happily but the way that it stands right now it has a pretty unhelpful error message when a failed assertion raises. First, the back trace is pointing at assert equals. Didn't I just fix this? Mostly. I'm using caller for the back trace and it included the entire call stack including the other assertions that may be up the stack. So I need to filter those assertions from it. So let's fix that by deleting everything at the start of the back trace that is in the implementation file itself. This is still ugly. The failure just says failed tests. So let's make it possible for assert equal to supply more information. Let's pull up the error message into an optional argument and use that argument in raise. Then we change assert equal to use that with a helpful message. Now we get error messages that look like this. That's much more useful although it may not still be 100% resilient but it'll do for now. Let's add one more assertion. Assert in Delta. One mistake people make time and again is misunderstanding how computers deal with floats. The rule is really, really simple. Never, ever, ever test floats for equality. Yes, there are exceptions to this rule but if you stick to that rule you'll be fine 100% of the time. So while we have assert equal we should not be using that for floats. We're going to write a certain Delta instead that's just for comparing floats. What it should do is see if the difference between two numbers is close enough where close enough, our version at least is simply going to be within 1, 1,000. You can make it fancier later but for now done is more important than good. So this is what it looks like. Almost the exact same as the assert equal except using the formula stated previously. And this is how it's used and it works right out of the gate. So what does that mean? That means for now assert is solid enough for general purpose use and we can write other assertions. Writing other assertions is fine and good, necessary even, but that could take hours and I'm only 25% through my slides. I will consider this an exercise for you after the conference but think now about what your favorite thing or test is. How would you write an assertion for it? You should go do that and then have a cookie. So once you can write one test you'll want to write many tests. This starts to introduce problems on its own. It'd be nice to be able to keep them separate. There are many reasons why you'd want to break up your tests and keep them separate. Organization, refactoring, reuse, safety, prioritization, parallelization. It would be nice to keep them separate but how do you do that? We do something really quickly and easily like this. We'll call the test method. It'll take some string describing the test itself. It'll take a block of code with assertions in it and it's equally easy to implement. You ignore the argument and you yield. This gives us the benefit that you can name the tests and you can put them in blocks so that you can see that they're separate but they're leaky and leaky tests infect results. Now that we can write multiple tests and keep them organized, we need to be able to trust them. The problem is that these tests aren't actually all that separate from each other. Here we can see A equals one at the top. First test asserts that it is one and it passes. The second test mutates that local variable and tests and it passes and the third test which expects to be like the first test fails because it has been mutated. What we really want is for those tests to be completely independent of each other but the fact that one test can mutate a local variable that is used by another test is simply a mistake. This goes against good testing practices which state that a test should always pass regardless of what was run, what order they were run in or anything else. Otherwise you don't trust the tests and trusting the test is crucial. We're gonna fix this using methods. There are a number of ways that we could try to patch this up. The simplest perhaps is just not to do it in the first place. Instead, just use Ruby. Ruby already provides a mechanism for separating blocks of code and making them immune to outer scopes. It's called the method and it's free. The nicest thing about this approach is that it's absolutely free. There's no cost to using this that you aren't already paying by using Ruby in the first place. It's also important to remember that by using plain Ruby is that anyone can understand it. It does have some drawbacks though. First, you have to run the methods yourself. That's fine for now and we'll address it later. Another perhaps more pressing issue is that there's code duplication in the previous examples.  I'm not gonna bother going into that at this time. If you stick to plain Ruby, it should be pretty easy to do though. So that's an exercise for you again. Now that we have multiple tests separated by methods, how do we get them to run?  We could come up with a more complicated way and we will but this we'll do for now. Methods are a good means to separate tests but more problems arise. Unique method names, it's harder to organize, reuse, compose, et cetera. Luckily Ruby comes with another mechanism to solve this. Classes. Didn't I just say to keep them separate though? Yeah I did but it'd be nice to organize them. There's some balance in between. So how do we do that? Well, we take the previous code and we wrap it in a class. Done. But how do we run those? Wrapping the methods in a class breaks the current run. In order to fix it we need an instance of each class before we call the method. So we add that to each line and we're passing again. Now granted, this doesn't really do anything for us. It does group the tests in classes but more importantly it puts us in an ideal position to make the tests run themselves. Right now we manually instantiate and call a method for each test. Let's push that responsibility towards the instance and have it run its own test. By adding a run instance method that takes a name and invokes it with send. This doesn't look like much either. In fact, by adding the call to run we've made it more cumbersome. But this will make the next step super easy. It also provides us with a location where we can extend what running a test even means. For example, the run method would be a good place to add setup and tear down features or anything else you might wanna do. What would you add? Running test manually is still pretty cumbersome so let's address that next. Now that an instance knows how to run itself let's make the class know how to run all of its instances. We can use public instance methods and then filter on all methods that end in underscore test. Public instance methods returns an array of all the public instance methods on a class or a module. And then we can use enumerable's grep method to filter on those. And wrap that up in a class method that instantiates and runs each test. This really doesn't do anything different than we were doing before. It just enumerates over the methods. This allows us to collapse this into this. This would be a good point to pause and apply some refactoring. What we've got is well and good but it's only on one test class. In order to really benefit from this we should push it up to a common ancestor. Let's make a parent class and refactor that. We simply reorganize the methods into a new class. We're going to call it test because we're very creative. Note that we also scooped up all the assertions while we were at it. Now we make all of our test classes subclass that class and that's all there is to it. Do that to all the test classes and they all benefit from code reuse. This makes it super trivial to have a bunch of classes of tests that can run themselves so let's push that further. The only thing left to address is where we manually tell each class to run its tests. So let's automate that too. Since we're using subclasses to organize our tests we can use an underappreciated feature of Ruby, the class inherited hook. Every time a new test subclass is created it will be automatically recorded and tests will notify all of them off when we tell it to. First we need some place to record the things we need to run. Then we use the inherited hook to record all the classes that subclass test. From there it is trivial to enumerate that collection until each one to run its tests. That allows us to rewrite this to this and that would be ideal to put in its own file so you can just require it and kick everything off. And that's all there is to it. So micro test is kind of hamstrung at this point. It runs tests and that's great but now what? Generally it's testing is supported it'd be nice to know what actually happened. On the one hand silence is golden. If you don't see an exception raised then everything worked, right? I think this is one of those situations where the Russian proverb trust but verify is a good policy to have. So let's give the framework a way of reporting the results and see if we can't enhance things while we're in there. How do we know what the results of a run are? I personally would be pretty happy just seeing that something ran. Let's start with that as a minimal goal. Let's print a dot for every test run. As a side note, this is quite possibly my favorite slide I've ever made. Look at that, look at that. It's a dot. Tough to you would be so proud of me. It's something about ink density. So let's add a print and a puts and we're done.   Quite simply we print a dot for every test and then we add a new line to make it keep it pretty at the end of the run. So doing so we'd see this. And now that we see that we ran three tests and that they all passed, that's actually really good information to know. I'm much happier. But what about failures? What happens when a test fails? Currently, if a test fails it immediately quits since it's raising an unhandled exception. That's not too terrible, but it does imply that you only see the first problem that raises. And that might not be the problem that you actually want to deal with. That might not provide as much insight, pattern matching ability that humans have as seeing all the failures at once. So let's clean this up. We'll rescue exceptions and print out what happened. We go ahead and wrap that up in a begin. We throw a rescue in. We capture the variable. We print out the message and we print out the first line of the back trace. Now that we see all the tests regardless of failures, we also don't see loads of backtraces. We're only printing that first line of the back trace. Perhaps this is not the prettiest output, but it is much better than before. But there are several things that I don't like about this code. I'm gonna do it on time. I'm actually doing okay on time, despite the speakers. I don't like the logic for running a test and doing IO is mixed up in the same method. It's just messy. So I want to address that and in the process refactor the code to be more maintainable and capable. The problem I have is that the run class method is doing way more than just running. Here we can see that there's about four categories of things that it's doing. The first thing I want to do is separate the exception handling from the test run. I really don't like that test class run is handling both printing and exception handling, but I especially don't like the exception handling. So let's address that first. Since test class run calls test instance run, which calls your actual test, it's two hops up from where any actual exceptions are getting raised. We should refactor this and break up the responsibilities. I want run all tests to only deal with running test classes from the top. I want each class to run their individual tests. I want each test instance to run a single test and handle any failures. And I want something else entirely to deal with showing the test results. So let's move forward with that in mind. First, let's push the rescue down one level so that test instance run returns the raised exception or false if there was no failure. Now we change test class run to print appropriately based on the return value. Now we have exception handling pushed down to the thing that's actually running the tests. Having exceptions only raise a single level usually means you're in a better place to deal with them. By doing this, we've also converted some exception handling into a simple conditional. Next, let's look at the IO. Let's extract the conditional responsible for IO into its own method and we'll call that report. By doing this, we've put ourselves into a better position to move that out entirely. So let's do exactly that. We extract the report method into its own class called reporter. We're gonna grab that puts two while we're at it and put that in a method called done. This lets us rewrite run all tests into something that is much cleaner. We instantiate a reporter object, we pass it through, we call done at the end. I think I just jumped over myself. I just jumped over myself. We create a reporter instance in run all tests, we use that throughout, we pass down the reporter instance to run, we use that to call report instead. And because name was a block variable before, we need to pass that down to reporter.reporter as well. Doing this, we removed all IO from the test class and delegated it elsewhere. Throughout these changes, you should be re-running the test to ensure that it works the same. But in this last case, it doesn't. The class name is wrong now that we've pushed reporting into a separate class. For now, we're gonna go the quick fix route by passing in the class. I'm intentionally focusing on fixing this bug, not using the right abstraction. Sometimes it's the right thing to do, but you pay the price in doing so. So let's add a new argument to the report method and we'll just call it K. We're gonna pass in the current class, which is self in any class method to report. This fixes our output back to what we expect to see. But we had to add a third argument to do it. And that should be a hint that we're doing things wrong. So let's try to address this now. We don't need to pass the actual exception to report. We can pass anything that has all of the information that a report needs to report the test result. And what better thing than the test itself? All we need to do is to make the test record any failure that it might have and make that accessible to the reporter. Let's add a failure attribute to test and default it to false. Then we modify test run to record the exception and failure and return the test instance instead of the exception. Now we can use the accessor and reporter to get the message and the back trace. Let's clean up the mess we made with the third argument. Now that E is the test instance, we're able to get rid of the K argument. This gets us back to two arguments, which in my opinion is still one too many. So let's try to remove name. With a little tweaking, test instances can know the name of the test that it ran. First by adding an accessor and then storing it in initialize. Then by passing the name to the initializer and not to run. And finally by removing the argument from run and using the accessor instead. We've just shifted things forward a bit. This means that a test instance is storing everything that reporter needs to do its job and we can get rid of the name argument. One more thing that I do not like is mixed types when you don't need them. Right now E is either false or the instance of a failed test, but tests now know whether they've passed or not. And false isn't helping and be the source of pesky bugs. So let's get rid of false. By adding an insure block with an explicit return and I need to always make sure that I point that out. We can get rid of the false and make sure that the run method always returns self. Next let's add an alias for the Canadian accessor, failure A and switch reporter to use this new predicate method to test. This looks pretty good now. I just don't like the name E anymore since it's no longer an exception, but a test instance. So let's rename it. Let's call it result. This makes the code much more descriptive, albeit a bit longer. Okay, at this point, I could call it a night, but the output is still a bit crafty. I want to enhance the output. It would be nicer if we separated the run overview, meaning the dots and any failure indicators from the failure details. Something like this. So let's change report to store off the failure and print all of them and done. This is pretty easy to do. We need a new failures array. To store them, we make an accessor and initialize it. Then we need to print an F in the case of a failure and store off the results in the case of a failure. Finally, we need to move the printing code down into an enumeration on that array. Now our output looks much, much better. But we're not quite done because I have five minutes left. There's just a couple of things left that are getting on my nerves. We've changed both report and done quite a bit. They're no longer doing what they say that they do. So let's rename them. Report becomes shovel and done becomes summary. We'll use those names in test. And at this point, I'm actually pretty happy with the code but we're not done yet. I'd like to add some more enhancements. One common problem that people often have writing tests is that their tests wind up depending on side effects of a previous test for it to pass. In this case, if that test is run by itself or in a different order, it's going to fail. This goes against that previous rule of testing that tests should pass regardless of their order. An easy way to enforce this is to run the tests in a random order. And that's easy to do in our current setup but I'd rather not mix too many things back into this method. So let's start by extracting the code that generates all the tests to run. Now test.run only deals with enumerating test names and firing them off. So we're in a better place to randomize the test. We just do that with shuffle. The button's not working. That's really all there is to it. We could get fancy and push it up to run all tests and randomize across the classes and the methods and get all fancy and stuff. But again, this is a good compromise and I'll leave that as an exercise for you. So we're done for now. What have we wind up with? Well, we wind up with about 70 lines of Ruby that is a good portion of what many tests actually does. It's well-factored, has zero duplications of any kind. The complexity score is incredibly low. It flogs at about 70, which is about five per method which is about half of the industry average outside of Rails. Even without any comments, the code is incredibly readable. The reporter first column, the test class methods, second column and the test instance methods all fit on one slide. That's not bad. It actually runs about twice as fast as Minitest because it does less. The worst thing about this talk is that I spent about nine slides per two lines of code but that's a price that I'm willing to pay in order to make this as explainable as possible. So how did we get there? We started with the atom. We built that up to molecules. We gathered tests into methods and methods into classes. We taught the class how to run one method. We taught the class how to run all of its methods. We taught it how to run all classes. Then we bothered with adding reporting, error handling and randomization as a cherry on top. That's where it pitches his book again. So I'm hoping to soon publish a small book under Michael Hardell's Learn Enough series. Learn enough or learn enough to be dangerous. Either way. If that goes well, I'm going to be doing a complete book on Minitest and perhaps testing philosophy. I don't know. I will have a sample chapter coming out soon for review. It's not ready yet. So please follow me on Twitter for announcements. Thank you and please hire me.


USA is different so yeah people I mean from different countries have different GDP right they have different incomes and so on you know there's some People from poor countries who cannot afford anything right they can't even afford food Well, they can use our free frequencies right we have something new for everybody. We have free frequencies we have We have low-cost coils and we also have the high-end coils. Why do we have high-end coils because? We put a lot of value into it. We have put a lot of prestige and premium Features and technology into there like if you like why do you buy people buy iPhone when you can just get a phone for ten dollars? Or fifty dollars at the drugstore, right? Why do people buy them?


Hello and welcome to the International Daily Roundup by People's Dispatch, where we bring you major news developments from around the world. Our headlines, Israeli Supreme Court post phones decision on forced evictions in Sheikh Jarrah, Mexico holds referendum on investigation into former presidents, millions at risk in the US after government ban and evictions expires, and in our video section, we take a look at the growing political opposition to Brazilian President Jair Bolsonaro. In our first story, hearing on the case of four Palestinian families from Sheikh Jarrah was held at the Israeli Supreme Court on August 2nd. The Jaunee, Iskafi, Al-Qurd and Al-Qadi families had filed a petition against the forced evictions ordered by the lower courts. The Supreme Court proposed an agreement during the hearing on Monday. It said it would issue a protected status to the families. This would mean that they would not be evicted for an unspecified number of years. However, they would have to pay rent fee to the Nahalat-Shimon settler organization. As per reports, the organization has also demanded that the Palestinians recognize its legal ownership of their land. Despite pressure from the Supreme Court, the four families rejected this offer. It is important to note that Mondays proceedings were conducted in Hebrew, which most of the Palestinians present did not understand. The court has now given the families seven days to present till the presence of protected tenants. Meanwhile, at least three people were arrested after Israeli forces raided homes in Sheikh Jarrah. The Supreme Court has also deferred a decision on the eviction of the Dajani, Hamad and Dahudi families on July 29th. Thirteen families in Sheikh Jarrah are currently facing eviction orders. Overall, 28 families of over 500 Palestinians in the area are at risk. They are settled in the neighborhoods in 1956 after being violently displaced from their homes during the Nakaba. Ownership was granted by the Jordanian government, which had controlled over Jerusalem until the war in 1967. However, Israeli settlers began firing lawsuits in 1970s claiming that the land belonged to them. Documents also showed that Jordan had started registering Palestinian ownership of the land before the efforts were disrupted by the war. In our next story, a referendum was held in Mexico on August 1st to decide if former president should be investigated for corruption. The action was promoted by incumbent progressive president Andres Manuel Lopez Obrador or AMLO. Where 93 million people were eligible to vote, however, voter turnout stood between 7 to 7.7%. Among those who voted between 89.3 to 96.2% voted in favor. These figures are the result of a quick count conducted by the National Electoral Institute. However, the referendum has failed, given that 40% of all eligible voters needed to vote yes. AMLO had promoted an inquiry into five former presidents, these included Carlos Salinas de Gortari, Ernesto Zedillo, Vincent E. Fox, Felipe Calderón and Enrique Pena Nieto. All stand accused of human rights violations, electoral fraud, corruption, illegal privatization, etc. An earlier version of the referendum had asked for a prosecution. However, the Supreme Court later changed the question and removed the names of the presidents. The low turnout on Sunday's polls was not surprising. The ruling Morena party had already denounced electoral authorities and opposition parties for trying to prevent a large turnout. Only one-by-third of the voting tables set up for legislative and local elections in June were set up on Sunday. We now go to the U.S. where millions of people are at risk of being forced out of their homes. This is after a pandemic-related government ban on evictions expired on July 31. The U.S. Congress adjourned on July 30 without revising the ban. This was after the Republican lawmaker blocked an attempt to extend the measure till October 18. The failure to pass the eviction ban has been condemned by housing rights activists and organizers. Progressive lawmakers within the Democratic Party too have blamed the Biden administration and senior leadership. President Biden stated last week that he would not extend the moratorium as per a recent Supreme Court ruling. In a ruling issued last month, the court had indicated that the recent moratorium would be the last. One of the judges also stated that a further expansion would require approval by the House of Representatives. Congresswoman Alexandria Ocasio-Cortez has stated that the administration did not inform the body of its stance until the last minute. Congresswoman Cori Bush also held an overnight vigil on Friday to protest the failure to extend the ban. Moratoriums and evictions have been in place across the U.S. since March 2020. Over 15 million people or 6.5 million households across the U.S. are currently behind on rent. At least 3.6 million people are at immediate risk of eviction within the next two months. Meanwhile, only 3 billion out of the 46.5 billion dollars in rental assistance allocated by Congress has been distributed. The eviction ban has also ended just weeks before an additional unemployment aid is set to expire on September 6. And on 7.5 million people are estimated to be impacted. And finally, we go to Brazil, where supporters of President J.R. Bolsonaro held protests on August 1. The mobilizations were called to defend the public counting of votes and the use of printed ballots. Bolsonaro had been pushing for an amendment to replace the current electronic voting system. He has also raised allegations of fraud in the 2018 elections without presenting any evidence. In a video published by the president's YouTube channel, he also threatened to cancel the 2022 elections. Bolsonaro is facing growing public opposition with the poll placing his disapproval rating at 51%. Recent surveys have also showed that former president Lula currently holds a lead over Bolsonaro ahead of next year's election. Meanwhile, lawmakers and even former supporters are now distancing themselves from the president. Here is a video by Brazil de Fato on the growing political opposition to Bolsonaro. With or without impeachment, the decrease of the president's popularity is for sure. It has been shown in every opinion poll. Sectors of the right-wing and center, conservatives and ultra liberals, which walked hand-in-hand with Jair Bolsonaro since the 2018 electoral campaign, keep on trying to distance themselves from Bolsonaro's image to maybe build the third way in 2022. According to the movement Vem pra rua, the current president betrayed the group. The movement was one of the protagonists in the controversial Dilma Housseff's impeachment process and in the election of Bolsonaro. Logo nos primeiros. In the first months of Bolsonaro's mandate, the movement realized that it would not fulfill his promise. The fight against corruption was being dismantled, either by action or even omission by the president of the republic. For congressman Alexandre Frota, elected thanks to his strong association with Bolsonaroism, the current government is committed to political alliances. It's only his role in staff that benefits all the time. Yes, Bolsonaro proved to be extremely unprepared. A liar, a charlatan, an electoral embezzlement was committed. Brazil COVID-19 parliamentary inquiry, which indicates serious failures by the federal government in managing the pandemic and everyday rebels' new complaints of corruption, has also had an influence in changing the opinion of former Bolsonaro supporters. Now many of the president's former allies are singing in unison with the left wing, demanding that he leaves office. It's very important to have this union. Unity does not mean that we will stop disagreeing on what we disagree with. It turns out that it's no longer a matter of political divergence. It's a matter of humanity. I find it very difficult to have a convergence around a unique name for the next presidential election. Which does not mean that it does debate or this union is not guiding the 2022 campaign. We need to remember that Bolsonaro, above all, wants to be reelected. That's all your time for today. Be back tomorrow with more news from around the world. Until then, keep watching People's Dispatch.