So we're now going to hear directly from diaspora organisations from all the participating countries on how they can contribute to the SDGs. We'll see the results of consultation that were organised by the Global Diaspora Confederation during their first global assembly last year. And I'm delighted to introduce Laura de la Fuente, who's going to moderate this session for you. She's an expat, Laura has been an active contributor to the Mexican Global Network in Ireland since 2015 and is currently president of the Red Global MX Chapter in Ireland. The co-founder of the Latin America Trade Council of Ireland, there is no better person placed to lead this dynamic session. So Laura, it's over to you. Thank you de la. It's an honour to be here. Thank you IOM and Government of Ireland for this opportunity. Ministers and distinguished guests, you are all very welcome. Hi, Mila Fulcha, that's 100,000 welcomes in Irish. Our topic today is connecting with diasporas as partners for development. This hybrid session will provide an opportunity for delegations from participating countries to hear directly from three diaspora organisations regarding their vision for how they can contribute to achieving the sustainable development goals through the presentation of the results of consultations organised by the Global Diaspora Confederation during their first Global Diaspora Week last year, as well as selected interventions from other diaspora organisations. Our first speaker is Peter Kwok. He is the founding chair of the Global Diaspora Confederation, the Umbrella Let's Civil Society organisation to connect and empower diaspora organisations at the global level. Peter also chairs the UK Federation of Chinese Professionals, interconnecting Southeast and East Asian in the UK. Young Chinese Professionals UK and Grandville University's Alumni Association in China. He's a member of the Police Scotland's National Independent Strategy Advisory Group, a member of the advisory group at Scotland China Education Network and Hong Kong Scotland Education Connection. Peter previously supported as honorary chair for the Asian Association of Culture, Commerce and Education in Europe and the Association of Chinese Entrepreneurs in Scotland and as the chair of advisory board for social development international based in Cameroon. He was a former board member of Nanjing Overseas Friendship Association, Yangshu Provence Federation for Returned Overseas Chinese Junior Committee, both in China and Ricefield Chinese Arts and Culture Centre in the UK. Peter received the Alumni Award for Excellence in Achievement from Grandville University and the Freedom of the City of Glasgow. He has nominated for the Charity Chair of the Year in the UK and is a graduate of Imperial College. He's going to talk to us about the needs and aspirations, challenges and opportunities for diaspora organisations collected during last year's Global Diaspora Week. Peter, over to you. Thank you very much. Can I just check if the presentation is on? To the Director General, to the Director General, your Excellencies, distinguished guests, ladies and gentlemen. It is a great honor to be able to present here today and as Laura said, Global Diaspora Confederation connects and empowers diaspora organisations at the global level. If we go to the next slide. So what we do, GDZ brings together the efforts and voices of member diaspora organisations to further support their communities. We've got a very brief history, just over almost two years and celebrating with you in April this year as well. Next slide please. Our vision, Laura has already briefly explained, we are an umbrella-led and diaspora-led civil society organisation to unify, support, develop and promote diaspora organisations where they can discover and realise their visions in order to achieve peace, unity and social and economic advancement for all. And when we say diaspora organisations, they are a shorter firm, shorter form to talk, it's the old standard for diaspora organisation. Next slide please. So GDZ is a charitable, non-political and non-governmental organisation registered in the deathlets with envy status. GDZ has four principal organs, we've got a council, board, fellows and also secretaries. We're connecting with 1,500 diaspora organisations in the world, also develop 70 categories of diaspora organisations, having trustees based in Europe, South America and Africa. Next slide please. Great. So we, GDZ has got a membership structure. At the very top we've got fellows, GDZ 100, GDZ 21 and senior fellows and junior fellows, but at the same time we also have senior members and regular members who are holding up the GDZ system so that we can continue to recognise and empower them through this contribution way. At the same time, we also recognise a lot of diaspora organisations that don't have registration and although we don't work very closely with them, but they are still associated to us. So in order for our time to become a member, regular member with GDZ, they need to have a diaspora community network, obviously. They also need to have a registration in the country of operation and comply with laws. So talking about the global diaspora week and assembly, we had the absolute honour from the Director-General who opened our week last year in December. The week with the purpose of listening and consulting the diaspora organisations across the world, their work towards sustainable development goals, as well as the GCN objective 19. The week was spread over six days, continental days, starting with Asia, Africa, Europe, North Central America and the Caribbean, South America and Oceania. Next slide, please. The global diaspora week was closed with the honour from Miss Daniels, also the Deputy Director-General of ILM, who came to meet us, the diaspora organisations. So the purpose of the assembly, which is on the very final day, and also on International Migrants Day, is to aim to recognise diaspora organisations' achievements across the world, promote them, empower them, and also demonstrate that even local diaspora voices can be heard directly by those at the very top. And of course, summarise the global diaspora impact that we have holistically done together. Next slide, please. We've got 160 diaspora organisations in the very first year joined us at the global diaspora week. Next slide. And later, I will be talking about these five groups. So basically, these five groups of thematic groups of SDGs happened on every continental day. They are all observed by ILM officers in all continents, including each group. Next slide. So to begin with, the first thematic group one, we've got SDG one, two, three, and six. So no poverty, zero hunger, good health and well-being, and clean water and sanitation. Dio's from Dio's basically the diaspora organisation. Dio's from Asia believe it is important to map skills and establish relationships with stakeholders on clean water and sanitation. Many of them have skills, but local connections are sometimes missing. Dio's in Europe mentioned they have ongoing links with their home countries, not only to provide clean water and sanitation, but also to educate locals on the importance of water management. This sort of education has helped local communities to embed healthy sanitation practices in their day-to-day living. In addition to that, there were Dio's projects in Europe to provide a dam to address low water level and supply water to areas that depend on agriculture for survival. Not only projects are well funded and hence, Dio's in South America were engaged in crowdfunding activities to raise funds to build rainwater containers and reservoirs in areas of Venezuela where there is poor water supply. For example, solar panel plants for water treatment were used in Venezuela that has seen successes and they now even plan to export from the country. Dio's in South America also mentioned they have been tapping into government projects for clean water to rural communities in Chile. In terms of zero hunger and well-being, Dio's in Europe mentioned they have supported victims of natural disasters to tackle hunger, but limited capacity for Dio's in Africa meant connecting with stakeholders to collaborate at all levels is key. For example, fundraising to pull together resources. This is also echoed by South American Dio's with the vision to promote entrepreneurship to reduce poverty, empowering migrants with the tools to survive, financial support to find jobs and to help them live and work legally is becoming a common practice for diaspora organizations in many continents. For Dio's in North Central America and the Caribbean, they sent finances back to home countries to contribute to projects but express challenges of adequate resources required for intervention. These limited resources include time, finance and human resources capacity required. Next slide please. So for the same method group two, we're talking about SDG quality education. And of course, we also include partnership for goals number 17 in all groups. African diaspora organizations mentioned that Africa is encountering ongoing brain drain. We're highly skilled personnel migrate to developed countries for better living standards and quality of life. Hence they need to see education at the global at local level, so that Collins can feel the need to return to the countries of origin for development. Dio's in Europe shared that language support language schools have been attended by a sizable population of young descendants of migrants and elderly often enrich their quality of life when they pursue lifelong activities organized by Dio's. For Dio's in North Central America and the Caribbean, they expressed the need to have more resources channeled into improving education, citing it as a significant tool for development. Dio's in Oceania mentioned that they can leverage the use of technology for education and upscale migrants for employment where educational and language barriers can be bridged for better immigration into the country of destination. Next slide please. Thank you. So next slide, this slide, the matter group three key highlights. We're talking about SDG 5, 10, 16 and 17 as gender equality, reduce inequality, peace, justice and strong institution of course, partnership. Some Asian diaspora organizations have been offering support to victims of human trafficking, forced labour and modern slavery through advocacy efforts to cooperation with host government. They also emphasized the need for awareness campaigns that migrants worker need proper orientation and necessary support to avoid being victim of inhumane treatment. For Europe diaspora organizations mentioned that they have been supporting migrants integration into countries of destination with translated publications to remove the barriers while other deals provided language support to female diaspora farmers, for example, in parts of Europe. Gender imbalance within organizations is still an issue, especially in leadership positions, observed by deals in North Central America and the Caribbean. They suggested there should be adequate training for the next generation. Furthermore, there is an increasing number of good practices where deals promote entrepreneurship as a means to reduce poverty amongst women who are empowered to find jobs and overcome immigration issues and language barriers in host countries, discussed by deals in South America. For deals in Oceania, a balanced narrative needs to be given to remove the notion that diasporas just take from the host country and show through quantification and qualitative research. For example, references were made to Portugal's move in showing the contribution of diasporas not only in tax aspects, but also in social security contributions and South Africa's wine industry being majorly contributed to by diasporas. Sadly, the search in hate crimes answer a speech, particularly xenophobia, where ethnic minority groups were blamed for the outbreak of coronavirus has severely affected diasporas across the world, felt and alerted by a huge number of diaspora organizations. Next slide, please. So the next slide. So this slide will be the matter for looking at SDGs 8, 9, 11 and 17, eight being decent work and economic growth, nine being industry innovation and infrastructure, 11 sustainable cities and community communities. It is not taken lightly that the countries of destination had opened the doors to diaspora. However, according to deals in Oceania, the mindset needs to be shifted for diaspora to be able to create opportunities and enabling environments for themselves. For example, emphasis was drawn from the UK Prime Minister, acknowledging that he was attended, he was being attended to by migrant workers during COVID-19. With more institutional support, challenges such as host countries not recognising academic qualifications and experience obtained from home countries can also be mitigated. It is not uncommon to hear highly qualified migrants had no choice but to take on very low paid jobs in countries of destination because of such issues. Deos in Africa mentioned they have been contributing. Yeah, they have been contributing. To the countries of origin's economy, making investments and remittance for business to create employment opportunities. An African deal also mentioned a success story of the high spark women who put together funds to set up business rendering ambulance services. Every man deals have called for improved and better national government policies that will attract diasporas willing to come back to give back. They explained that some existing policies were discouraging for diasporas. As for deals in North Central America and the Caribbean, they observed that employment issues are hardly mentioned when grants are given, are being given to support projects, even employment issues contributing some of the major challenges diasporas face. Deos in South America believe the knowledge gap closing between migrants still need more support. As for Europe, deals think skills gap depends on different countries and volunteering with deals is a way to close it. Asian diaspora organisations believe that diasporas giving back the wealth of skills to the country of origin have led to employment creation. It is a common practice for Asian diasporas organisations to pursue synergic efforts with stakeholders for progressing infrastructures and innovations as well as policies on human and social capital development, funding and real time solutions to diaspora challenges. However, they have been really affected by COVID-19, especially unskilled migrant workers. Next slide please. Thank you. So Group 5, which is the very last group we had, we focused on number 7, 12, 13, 14 and 15.  Deos in South America suggest that there is a need to combine the goals of a country and those of the deos tourist clean energy solutions. For example, Dominican migrants in Chile imparting the knowledge of the use of recycled solar panels in Chile. There was consensus that although raising expertise can be done virtually, connectivity could be a barrier to others in other parts of the world. The need for diaspora driven impact investment was discussed. This required diaspora organisations to become climate change advocates and facilitate information sharing within their communities. This was also supported by deos in Europe, where climate change education was highlighted to tackle the global challenge through diaspora sharing examples from their affected countries of origin. Oceania diaspora organisations also mentioned there have been diaspora contributions as diasporas are often diverse responders to natural disasters. Their work should be quantified and recognised. Next slide please. So in short, everyone, including diaspora, are very affected by COVID-19 pandemic. Over the past year, OEM has been developing the global framework for diaspora engagement on humanitarian assistance. And this global framework, we're able to apply it right at this time, this very challenging and set time when we create the global diaspora humanitarian forum hub on Ukraine response. This later on you will be hearing from our colleagues from the Ukrainian diaspora, Ukrainian World Congress, who will talk more about their efforts. But at the same time, we at the global level also look at how we can provide support for Ukrainian diaspora, also non-Ukrainian diasporas. So to interrupt you, just we're running out of time, could you skip to perhaps to the conclusions? Wonderful. Thank you very much. In conclusion, which is like an alternative. Yeah, thank you very much. So in short, here are the recommendations and conclusions. We are moving away from traditional diaspora engagement and start harnessing the units of technology. We're also quantifying and recognizing diaspora and diaspora organizations effort, but we need your support. More opportunities to contribute to policy development and consultations have been a very big thing for diaspora organizations. We feel they wish their part and supporting the global efforts in building diaspora organization community is what GDC is working very closely with IOM and also all stakeholders in this sector, fostering more trust and capacity building activities is something that we hope to also work with stakeholders in future. And final but not least, promoting transparency in responding to and providing more resources for diaspora needs. So thank you very much for all your kind support in the years to come that we look forward to working with you at a global level and just just close the presentation. This year is 70 years anniversary for IOM. So wish you a wonderful time and also another successful 70 years ahead. Thank you very much for all the kind support and the privilege of sharing here today. Thank you, Peter. Our next speaker is Mirana Rajoharison. She's adept executive director. She joined the organization in July 2019 holding a double master in economics and development management. She has worked at different stages of the project cycle in various African and Southeast Asian countries. Mirana has also worked on the European Commission and World Bank funded projects. Her first experience on the nexus migration and development was in the Sahel where she worked with the climate migrants in the W park buffer zones. Mirana is from Madagascar where she has worked as an economic advisor with the president's office, within the president's office. She's going to share reflections of their work, challenges and more importantly opportunities to support their work going into the future through the future agenda document of the Global Diaspora Summit. Mirana, over to you. Thank you, Laura. Excellencies, honorable guests, ladies and gentlemen. Thank you for the opportunity to present Africa Europe Diaspora Development Platform, or ADEPT, the platform for Europe based African Diaspora organizations. Our mission is to amplify the influence and the impact in Europe and Africa. Our portfolio of services available to all African Diaspora organizations based in Europe includes policy and advocacy, capacity building, funding, as well as networking. In addition, we have dialogue tools. The first one is the diaspora development dialogue, a multi-stakeholder's round table deal with diaspora consoles. The second tool is the diaspora youth talk dedicated to youth preoccupations. The first attribute of diaspora organizations is their heterogeneity. This makes it difficult to meet their needs, which can be very diverse and even opposing. However, the major the majority of them hold similarities in the small size and lack of permanent staff. They constitute the first category of diaspora organizations. They usually are highly specialized. For full reason, they content their members and organize social events. They cannot rely on grants, as they do not have the necessary bid writing competencies, nor the access to relevant information. Our main challenge is to professionalize them, have them become more sustainable, notably for investment in human resources and in bid writing capacity. It is a prerequisite for that passing from this first category to the second one. The second category of diaspora organization is the medium one. They have more or less sustainable business model, permanent staff, and the benefit from capitalism of the 10 years of experience. They have the bid writing capacity in house, but lack time because of limited human resources. For the growth, they need opportunities to network with peers. This will enable them to learn from each other, as well as to constitute consortia, whether they pull the expertise to respond to calls for proposal. In addition to creating networking opportunities, we facilitate the connection with development agencies, especially in the field. Our main challenge is to be able to find funding to support the scaling up of the tested projects. Diaspora based in France and Germany, or from Mali and Selega, can benefit from dedicated funding. However, the European funding is needed to support the gas organizations based in a country with no historical link. Predictability of funding is key for them to formulate a long term growth and pass in the third category. The third category gathers Diaspora organizations with several decades of experience. The permanent staff is more than five people. They may have representation services in Europe and Africa. They have a proven business model and thanks to their recognized expertise, they can partner with international NGOs to carry out projects in Africa. The main expectation from us is the co-organization of events, relaying or tuning up on policy and advocacy, and eventually assistance for the outreach. They may have a cause to adapt small funding for the unplanned activities. These three categories share undertone motivation, efficiency and agility. The transaction costs are low as they connect directly the transnational to the local. The sustainability of their research is ensured by the partnership with local authorities and civil society guaranteeing a bottom up approach. They can intervene in fragile areas which foreigners do not have access to anyone. Excellencies, honorable guests, ladies and gentlemen. Diaspora organizations are our trump cards to achieve the sustainable development goals, as well as the objective two of the global compact migration. They can be the SDGs accelerator we need to minimize the drivers of migration. Adept commission of research that identified the key drivers for diaspora engagement. There were capacity building, funding and an agreement both in Europe and Africa. Countries aspiring to model good practices for enabling environment may strive to recognize diaspora organization clearly as development actors, integrate them into the development cooperation programs, include them in consultative mechanisms, dedicate specific funding adapted to their needs and characteristics, be it at a national level or through a platform and big partnerships with other organizations supporting them. Those are a few actions listed in the objective 19 of the global compact migration, which has been overlooked. Diaspora received today less than 0.1% of it. Diaspora organizations are doing their part. We have to do our work. Create the conditions for diaspora organizations to fully contribute to sustainable development. Excellencies, horrible guests, ladies and gentlemen, thank you for your attention. I look forward to co-creating a sharp vision diaspora sector together. Over to you Laura. Thank you, Mariana. Our third speaker is Mr. Stefan Romanev. Sorry about that, yes. Our third speaker is Mr. Stefan Romanev. He currently holds the position of Executive Director of Community Languages Australia. He served terms as the chairperson of the Victorian Multicultural Commission under both governments in Victoria. He has a teaching qualification and prior to moving into senior government positions and senior management worked in a range of school settings. He has served as the chairman of the Victorian Government Australia Committee. He's first vice president of the Ukrainian World Congress and co-chair of the Australian Federation for Ukrainian Organizations. He holds position of chair of the Ukrainian World Congress International Committee for Recognition of Holodomor as Genocide and chair of the Ukrainian World Congress International Religious Affairs Committee. Currently he serves as a chairman on a number of committees and organizations with broader Australian and Ukrainian communities. In 2001 he was awarded the Order of Australian Medal for his contribution to education. In 2003 received the Centenary Medal for services to the community. He has received the three levels of orders of recognition and medals from the president of Ukraine for services to Ukraine. He also received the Foreign Affairs of Ukraine Medal for services to international relations. Stefan the floor is yours. Thank you very much. On behalf of the Ukrainian World Congress, thank you for having the opportunity to be here. Before I go into my presentation, obviously this is a sad time for Ukraine given that Mr Putin and his Russian Federation have now committed genocide and acts of against humanity which you've all seen. And the reason for the raising of that is because the Ukrainian World Congress has now played an integral part in supporting Ukraine during this time. The Ukrainian World Congress has been an integral part of developing strategies that can work with governments throughout the world and in conjunction with Ukraine. Could I have the first slide please? Next slide please. The UWC is a global voice for the Ukrainian people worldwide. We represent about 20 million Ukrainians in the diaspora. We have over 60 countries and now we're talking about diaspora in action because those 60 countries have been very, very active in supporting Ukraine and taking out the message of Putin's atrocities in Ukraine. We're also recognising the United Nations Economic and Social Council and we're participatory members of the International Non-Government Organisation with the Council of Europe. Next slide please. We have a range of impactful programs. We have a global team of volunteers and staff and we have strong networks and partners and supporters and I think that's the important thing that I've taken out of some of the presentations by their Excellencies and Ministers and also Mr Kwok in terms of what the diaspora should be doing. Next slide please. Our programs are varied and we have active councils and whilst you can't see them on there, they're the different councils that we have that work throughout the international community and the diaspora working very, very close with Ukraine. And we have also have very prominent leaders who work with us. Next slide please. Again in terms of the Ukrainian World Congress and the diaspora working in or in action, encountering Russian aggression. We have an international coalition of support for Ukraine in our countries wherever we are. We have worked very, very hard to make sure that Ukraine gets the support of those governments. We have peace processes. We work towards the Crimea and the deoccupation of the Crimean platform. So ultimately we're active participants. We collaborate with many, many other ethnic communities again taking our experiences and their experiences. We're protecting Ukrainian communities in Russia. Putin and his government has had black band in the Ukrainian World Congress and the Ukrainian communities in Russia and we have taken those up into the international courts. And we are a global voice in terms of NATO membership and advocacy. We worked hard to stop Nord Stream 2, a campaign which has at least some limited success. Next slide please. At this point in time, we have a major campaign again bringing the diaspora together. You're not with Ukraine. We have a $25 million at this point, $25 million fund, which is supporting medical supplies, protective equipment, fuel, night vision goggles, protective equipment and communication. Because Ukraine is at war and we cannot stand idle because it is a war of values. It's a war for democracy. We have, next slide please. As a diaspora, we have called to action and many of our member countries have taken part in advocating in Europe, advocating in the US, advocating in Australia. We call to action and our communities come together. And next slide please. In our normal support for Ukraine, apart from this war effort, we have members of memorandum of understanding with the Ukrainian Cabinet of Ministers and Ukraine Invest. In other words, we work in partnership with the diaspora with Ukraine in developing Ukraine. We did election monitoring missions throughout the years. We have a campaign in obtaining multiple citizenship legislation. We've developed programs in terms of economic development. We're working towards Euro Atlantic integration and we foster the Ukrainian national identity or responsibilities of the UWC. Next slide please. We have very strong powerful partnerships which we have created internationally. And again, that goes back into being a diaspora and on somebody who mentioned before that first, it's first generation but we do have a number of people, second and third generation Ukrainians who have returned back to Ukraine over the last 20 years and play active roles in different positions. For example, up until recently the Acting Minister for Health was Oliana Suprun, an American who took on Ukrainian citizenship. Next next slide please. We have our campaign is strengthening our communities from the cradle to the grave. In other words, the diaspora works very very hard in maintaining identity, not to assimilate but to integrate, be strong communities but be strong and active communities in the countries of their of their being. Next slide please. We have a very strong collaboration with churches. The churches in our in Ukrainian culture play a very very important role. We participated in the strengthening of the Orthodox Church in the Thomas which was granted. We were working towards the Patriarchal status for the Ukrainian Greek Catholic Church. We work with the churches on community building and collaboration through such organizations as Caritas. And next slide please. We also as a diaspora see the importance of the memory of truthful history. Therefore, we have a committee and been working very hard about the Holodomor, the genocide against the Ukrainian nation 3233, the famine about getting global recognition. We have formed a Holodomor descendants network, again going back to what somebody mentioned before. It's no longer those descendants, many of those descendants have passed, but we want their children and their grandchildren and great-grandchildren to understand the impact of the Holodomor. We're also working towards the Babinyar memorialization. Stefan, one minute left. Revolution of dignity and the recognition of the 1944-51 deportation. Last slide. Our future vision. We're on to international advocacy. We're very close in collaboration with Ukraine at this point in time. We have a very strong youth program and for us community development is very, very important. Thank you for your attention. Thank you so much, Stefan. We have heard from three very important diaspora organizations and leaders what are their key challenges and the best practices. We recognize that diaspora organizations are instrumental to achieve the sustainable development goals of the global compact for migration. Some of the key insights and recommendations or best practices from the three diaspora presenters. We can take that and there's need for international advocacy, youth programs, community development and use of technology for a better diaspora engagement, quantifying diaspora organization efforts and more opportunities to contribute to policy development and consultations. As a diaspora myself with over 25 years in Ireland, I am very excited about the next chapter of diaspora engagement and the collaborations and partnerships that will stem from this summit and the collaborations in with our countries of origin and adopted countries. Thank you very much. Thank you, Laura. What a riveting session on who better than the diaspora organizations to let us know about the best practices.


Hi folks, good morning, Wednesday, Wednesday is the 13th today. Alright, we are going to get right into it because I want to make sure we cover the web vulnerability. We are going to pick up the rivalry laptop on Monday. So, we looked at, we've now seen at this point, we've seen web applications, we've seen some server-side web technologies like PHP. Now we need to look at how do we store state on our web application. And we saw that a lot of times the state is really a database, and one of the most prominent ways of how to query and interact with the database is through SQL, which is the structured query language. So, it's essentially a special-purpose language to interact with a relational database. There are multiple commands, the ones that are really important are select, which fetches data from the database. Update, which allows us to change data that's stored in the database. Insert, which allows us to put new data in the database. And delete, which is the other one. There are sometimes slight differences between SQL implementations. Every database engine has its own, basically, sort of looking for a SQL. That's what I meant. Dialect, yeah, its own dialect of SQL. So, there are some variations between that. So, some examples. So, this would, this is a query. So, select all columns, the star's columns, from the table of users, where the username is able to add them. Select all the columns from book, where price is greater than 100, 0.00, and order by title. This is, select the ISBN number, the title, the price from the book table, where price is less than the average price of the book. So, this is all the books that are less than the average price ordered by title. We can insert into there. So, here we specify the table that we want to insert to, which is an example. And we say we want columns field, field one, field two, field three, to have the values test and annul. Update, we can say update example table, set field one equal to update value where field two is equal to n. And then we can also, so SQL also allows us the ability to combine the results of two queries together. So, here this is a, what's called a union query. So, we're basically going to take the first query, and put it together with the results from the second query, and turn that into one result. So, we're going to get all of the a's from table one, where a is 10, and b is one, we'll get 10 of those, and we will add to that all of the a's from table two, where a is 11, and b is two. So, this allows us to extract information from different tables in a programmatic way. So, let's look at how PHP issues SQL queries. So, this is from the PHP manual. So, you first connect to the MySQL server, passing the user and the password. If there's an error, you stop and say, hey, I can't go any further. You select whatever database you want to use, and then let's say you have some first name and last name. These are just a real example, I mean real from their documentation. Then you do a query by doing an sprintf. So, we're going to select first last name address age from friends, where first name is single quote percent s, and last name is single quote percent s, and single quote first name, last name. So, what's sprintf doing? What's this going to be? Printing the output. What was that? Printing the combined output. What do you mean the combined output? Printing it. Pretty aware. Into the query. Into a string. Yeah, that's the s. So, it actually hasn't touched the database yet at this point, right? All we have is a query string, and this percent s is replaced by the first parameter, and this percent s is replaced by the second printf parameter. I actually just thought about it. I don't think I've looked at it, but I'm pretty sure PHP's printf functions do not support percent n, because that would be silly. But if anybody looks, that would be kind of cool to find out. And what happens if we pass more parameters than our parameters here? Okay, so at this point, so if we're going to talk about where could vulnerabilities exist, right? At this point there's no vulnerability. All we have is a string in the variable query that happens to be a SQL query. This variable never touched, if this doesn't get passed to a database, I think it's output to the user, right? There's no, it's just a value in memory. How we issue this query is we use this mySQL-underscore-query function to issue this SQL query to the database. And then if there's not a result, we say that there's some error. Otherwise we use other functions like mySQL-fetch-association, which fetches each of the resulting rows from this query as an associative PHP array and sets it into that variable row so we can access things like row-first-name, row-last-name. And we know we can access row-first-name or sorry, row-first-name and row-address because of this here. Questions on this? So this is a good fact of some of the PHP things. These mySQL functions, they're just global functions. That's why they all have mySQL-underscore prefix there. MySQL query is the actual function that pops to the database. Okay, so this is our little primer on SQL. We will come back to this when we need to to talk about SQL detection. Okay. So we saw the original HTML, right? Has images, tables. You can actually do font sizes. It has a lot of other things. But fundamentally, right? Anybody remember browsing the web in like the late 90s, early 2000s? Is it anything like it is now? And what's the big difference? What was it? It used to use frames. It used to use frames? For what? For dividing the page. Yeah, so you could have frames, actually a huge pane. Actually, I do not like frames. But what are that? So you can use that to divide the page. Was there a lot of, how did that page change? Yeah, so you click a link and then you can see a new page, right? And the page would change. But when you're looking at a page, the page would not change, right? Almost, I would say 99% of the content was static. You get a page and everything just looks static. Actually, if we go back and look at some of the home pages. So this is Yahoo's home page from 1996. So you can see it's just a page with links on this page, right? And yeah, there's an image. There's an image up top. There's a search bar. Whose search was terrible, by the way. There's what, oh, there's a, we have an Amazon's home page, one of the early, when Amazon launched in 1985. Now it's kind of weird to think about it now that Amazon was not in the cloud services business, right? They were just sold, sold books. This is all they did was books. And look at the page, right? It's just static page with links on the page to give you a click on things. This is Alta Vista from 1996. Also static page. And even, although actually I'd say, I guess it hasn't changed very much. So from 1998, Google's home page, or actually even before that it's called Backward Up. It's another search engine. So this was the early Google home page, right? And even this, although I guess I'd say it's actually very similar today, right? We have the Google search button and the I'm feeling lucky button. It's kind of crazy. Okay, so HTML was originally created, right? To describe a text document with hyperlinks to other text documents, right? This is the basis of HTML was we need a language to describe these hypertext documents. But as the web took off and as maybe you could argue as non-nerdy, non-technical people started to use and interact with the web, they thought, well hey, but how do I make fancy animations or pretty web pages, right? How do I actually make something that looks nice and doesn't just make me want to, like, throw up and never shop at this place ever again? Sorry, I know some of you are going to work in Amazon, but it's a good historical thing, right? So that's when this is really where JavaScript came in. So we think of now as, JavaScript is cool programming language of the web, you can run JavaScript on the server do all this crazy stuff. But it just started to solve this simple problem of, man, we wish web applications did, or web pages did fancier animations and were prettier. And so JavaScript is fundamentally a client-side scripting language for interacting and manipulating HTML pages. And that's really the genesis of JavaScript. It was created by one person at Netscape, Brendan and each, actually I don't know how to pronounce that, sorry, each. In 1995, and I don't think I have it here, I think he developed it in something like a week or two weeks. He was on a huge time crunch because Netscape wanted to get this out and show that they could do something like this. And it... It's actually really funny to think about names, right? So he created it as LiveScript, which actually is kind of a cool, it's a decent name, right? Netscape changed it to JavaScript. Anybody know why they changed it to JavaScript? Popularity of Java? Was that... You were in class. You didn't get answered. Yeah. So prior to this, there was another similar thing developed by a person. She called us Hot Java. And so when Hot Java wanted to make it official, they wanted to make their language official, these guys went to the conference at Europe somewhere and they got it named to JavaScript. And most of the functions that they have been defined have been taken from Java, for example, math and all those things because the Hot Java was primarily developed by a Java developer. Interesting. I actually have not heard that story. So from the press release, so they say that they're announcing JavaScript in an open cross-platform object scripting language for the creation and customization of applications on enterprise networks and the internet. Really good copy for whoever wrote that. And JavaScript from Wikipedia, it says it's a prototype-based scripting language with dynamic typing and first-class functions. Does this sound anything like Java, especially the Java of 95? Is Java a prototype-based language? Is Java a scripting language? Does Java have dynamic typing? Does Java have first-class functions? Not really, right? Yeah, so actually there are some questions over why the name to Java. Some people feel that it was a marketing ploy to try to like, because Java, believe it or not, at the time was like, right once, deploy everywhere. It was the hot programming language. Everybody was talking about Java, it had a huge buzz, so one of the theories is that they changed the name to take advantage of this buzz and basically piggyback on that. There's some collaboration between Sun and Netscape, so maybe somebody there was like, hey, you should call it something like Java. And so after this, in 1986, Microsoft added support for JavaScript to Internet Explorer. And there's this whole weird thing where the Microsoft changed the name of their language to JScript, so that way they wouldn't use it because Sun had a trademark on the name of programming languages, so they didn't want to call their thing JavaScript. Finally, this kind of all got settled a little bit when it was submitted to the ECMA, the International Standardization Body, which was finally standard as an ECMA script. So this is kind of like the classic traditional version. If you have a reference to that story, please send it to me. So I'd like to include that. That's really interesting. So JavaScript, love it, hate it, don't care about it, whatever your feelings, it is the language of the web. Every single browser, every single device now supports JavaScript. And so that it just is. We can't really change it although we're trying to move in that direction. It's eventually supported by all browsers and it evolved organically along the way from the original 1995 creation. And so to look at how, kind of mechanically how this works, is basically the ideal is you embed your code into your HTML page. So instead of just having a document that describes links and images and just basic text, you can actually specify to the browser, hey, here's some code, execute this code for me on your browser. It seemed like good from a security point of view. That seems crazy, right? Yeah, here, here. Browse my page, execute this code. How this looks. So inside the script tags, so start script tag and ending script tag, this is the way for the application developer to tell the browser, start executing JavaScript. So inside these script tags is my JavaScript code. And it used to be that not all browsers supported JavaScript, so you would actually have to put your JavaScript code inside an HTML comment because other browsers that didn't support JavaScript wouldn't show it and so you could actually be backwards and catable in a sense. So we can do things like we can declare a variable called name which is the result of calling some built-in function prompt and we can pass some values here. We would say if name is null then we can write welcome to my site, otherwise we can write out welcome to my site plus the name. There are two other ways to, or two. Yeah, one other way. Are there other ways to do this? Ah, sorry. The default for a script tag is JavaScript. You can also specify the language in either the type attribute or the language attribute of the HTML tag. This is a web page with this script tag. It looks something like this. We'll go to a page and it'll pop up a prompt. Just ask us to please enter our name. Type in something. If we click OK then we can click Adam and it'll say welcome to my site, Adam. So here we're actually building, and remember, none of this made any requests back to the server. This is all happening on the user's browser without any external requests. So here we have code that's executing and dynamically changing the HTML of the page based on the results of this code. That's kind of the core of JavaScript is it can, it can, it's running on your browser and it can change the content of that, of your page. And so, OK, so including JavaScript directly into every HTML page is kind of a pain, right? It's not the best practice from a software engineering standpoint, right? You'd have to duplicate your code everywhere that it's used, right? And so you can include JavaScript files, external JavaScript files in your HTML. So this is, so the previous one we saw is called inline JavaScript. So the JavaScript code is inline in the browser page, whereas these are external. So the idea is one's going to use the script tags, but here you set the source attribute to be either an absolute or a relative URL. And what happens is when the browser parses this element, it automatically fetches and executes that JavaScript before continuing to parse the rest of the HTML. And it's semantically equivalent, so it's exactly the same thing as if you took the contents of that JavaScript, whatever the result of making an HTTP request to that URL and putting it directly in the page there. So scoping rules, whatever, it still has exact, the exact semantics there. And so there's something important to keep in your mind. So yes, JavaScript is the basis, the history is a language to interact with HTML pages, right? But it doesn't mean that, so but there is a separation between the language of JavaScript and how JavaScript interacts with the HTML page, right? Similarly to maybe PHP is usually used to generate HTML pages and uses a web application. But you can actually use PHP as a command line tool if you're crazy. It doesn't have to actually output a web page, right? And so the document object model is a way to get it out from JavaScript. Okay, this is all the functions of JavaScript that deal with how to interact with the HTML document on the page which is separate from the language itself. So a lot of people, even people who've done JavaScript for a long time often conflate these two ideas. And now it's being even more important with being able to run JavaScript on a server to tease out these ideas. So the document object model is a programmatic, it's a way to manipulate the client-side content. And there's a globally accessible JavaScript object called document. And this is how you by interacting with this object is how you access and change the HTML content on the page. So you can traverse, query, manipulate, and change the browser's representation of the HTML page as well as set event handlers that say things like when the user clicks on this button it will go. So DOM 0 was released in 1995. It was incredibly basic. These kind of kept improving. The W3C stepped in and started to find standards. It's now a living standard. So it's continually evolving based on website developers and browser vendors. So let's look at an example. So here we have our HTML page. This is a valid HTML5 page. Here we have an H1 tag, a header tag that's a DOM example. And inside there is a div tag that has an idea of insert here. And so we have some super simple JavaScript code at the end here. That first is going to create, so it's using, so we know it's using the DOM since it's calling the document object. It's going to create an HR element, what's HR? Horizontal rule. Yeah, so it's just going to be a line. We're going to set that new element to be HR. To be in this variable HR. But notice we haven't done anything with it. We've just created this element. We haven't put it anywhere in the DOM. So if you do this, it will create this element but it's not going to do anything with it. So what we can do is we can access the DOM and we can say, okay document.find an HTML element that has the ID attribute of insert underscore here. Which is going to be this div right here. And add as a child this HR element. So this is exactly identical as, once this code runs, it will be identical as if there was in between this div tag, right? Inside there as a child will be an HR tag. And so we can look at this and we can go, yes we execute a run this, we'll see DOM example as the header and we'll see a line where that line actually came from the JavaScript code that executed. So this is how JavaScript is able to interact and change. And this is the fundamental mechanism that all of the fancy web applications change and manipulate your content of your page. Okay. So part of the problem is you would think that, well we have this DOM, we have this nice programmatic interface. We usually use this to do whatever we want.  It's not quite the unified standard that we would all want and love. So some highlights from this awesome Stack Overflow question of what browser, cross browser issues Internet Explorer does not replace Ampersand NBSP so this would be NBSP is non-breaking space or HTML character code 160 you need to replace its unicode equivalent. So Internet Explorer for some reason has a bug or whatever that it does not do this. So you would have to do this yourself. In Firefox this is not to bash on any one particular browser they're all terrible. In Firefox it dynamically created input field inside a form created using document.createElement not when you create it in the HTML does not pass its value on forms of it. What? document.getElementById in Internet Explorer will return an element even if we're returning element even if the element name matches. So if there's a name attribute on a tag it will return that which is not what you would expect what happened in a function called getElementById not getElementById and also name. Mozilla will only return the element if the ID matches. What? That's crazy. So this is why if you've ever done web programming you probably faced these issues or maybe you were smart and just started but jQuery is so popular because it provides a uniform interface and it handles all these low level details of cross browser compatibility so you don't have to worry you don't stress about checking if you're using Internet Explorer and will get element by ID actually return when you want it to return jQuery will completely take care of that for you. I guess I should ask if you're doing JavaScript programming or decent amount jQuery among those it's almost like if you're doing the web and you're doing JavaScript that's something that's longer than even one or two lines you probably still want to use some jQuery because you're probably going to do it wrong for some fraction of browsers and there will be really weird problems. So the document object model is all about how to access the HTML of the page or essentially how do we modify and interact with the content of the page in contrast the browser object model allows in JavaScript to interact with the actual browser itself right so this doesn't have to do anything with the document but this is things outside of that and of course because it's the web there is no standard of what is standard for the browser object model and even this term browser object model is colloquial it's not a standard term so some examples you can set the name of your tab or your window to be new named by using window.name right so this has nothing to do with the content on the page right you're just changing the title of the HTML page in the browser you can close right so you can have your, I don't know what happens if you do it nowadays on a tabbed environment does it go out of that way at the check but it used to be so JavaScript code can just close that page that it's on we can set, we can actually do essentially a redirect within JavaScript here by setting the locations the location would be the location bar to be a new HTTP URL and the browser will automatically go there to that location just as if we were redirected there by the browser so you can do this all in JavaScript okay so just to reiterate JavaScript the language is different from the document object model and the browser object model DOM has its own specification the bomb is kind of specified in HTML5 they're used together so much but with JavaScript occurring everywhere it is important to separate these in your mind right we have server side code in Node.js you can use JavaScript to specify database queries in framework or I don't know the best way to call that but in MongoDB instead of using SQL to query you use JavaScript to query Flash ActionScript in Flash is actually essentially JavaScript but kind of different and it has its own DOM-like capabilities to manipulate Flash objects even Java applications you can use javax.script to script your Java applications Windows applications ah this is the name Windows RT so you can write Windows applications now that are I'm sure there's some maybe OS functionality they would re-write files or something like that that doesn't make sense in a web context even though it's still JavaScript okay so now we're going to kind of dig in a little bit more to JavaScript the language to see how weird things can get so Java is object-based which means almost everything is an object and objects are essentially associative arrays or hash tables of key values and properties and values can be added and deleted at runtime so these are not the traditional objects you think about when you think of classes and objects right where classes the fields are defined statically based on the definition of the class defined statically these are all done at runtime so for instance here I have a variable so if our keyword defines a local variable that says the name of this variable is object and it is an this object has one field called test which value is the string foo and one field called num whose value is an integer 50 and there can be crazy things like set object test foo is equal to object so here I am creating a new field in this object foo which contains the object itself and they can write out object object test so what is this going to do so object test is going to look in here and return foo and well actually object foo is what the object itself and it is going to JavaScript has automatic corrosion so it is going to try to if we ever try to use an object as a string it will try to call the two string method on that object to try to turn it into a string so this will automatically print out whatever this object itself is and then we can do things like set so this is the other type of syntax so we can access fields and objects with you know the bracket rate bracket notation and we can also do it with the dot notation so we can say object.num means access the num field of objects set to be 1000 and log that so these are going to reference the same field and so we can do this we can see here we have done the variable object we say object foo is object and the browser so this is inside the browser's development console where we are doing all this and then when we do object.log right here we see it's oh it's logging it right it's right here it's outputting the object here we said object.num equals to 1000 and we log object angle brackets num to be 1000 as well so other things about JavaScript so we can do recursion in JavaScript so we have a function factorial and we can set if n is triple equal to zero we return one why JavaScript people why are we using triple equals here because yeah because it's also terrible in that actually BFB does this too so 80% of the languages web users are terrible so if we just use a double equal sign JavaScript will try to turn n into an integer if it can so it's a string if you pass in the string zero it will double equals the integer zero which is could be what you want but 9 times out of 10 is not exactly what you want because that doesn't make sense so you use triple equal sign and say are they the same thing and the same type basically and then we're going to turn n times factorial of n minus 1 so we can do things we can log factorial of 5 and that will tell us that is 120 so we can do this but JavaScript actually so the first class functions gives us a lot of really cool features so we can actually have anonymous functions so these are functions with no name and we can create closures over those functions so we can return functions from a function that refer to local variables in the scope of that function so look at what we're talking about so this is so we saw the syntax here for defining a function so this defines a function named factorial what this is doing is on the right hand side of this equal sign is it is creating an anonymous function this function has no name it is setting that anonymous function to the variable create function and functions are objects in JavaScript just like everything else so you can call them and you can also access fields of that function so in here we can set some variable to be count and we can actually return from this function a new function which returns plus plus count so this is returning so this function create function actually returns itself a new function and that function that it returns refers to this variable count so we can create a function called ink an incrementer function and we can call ink which is this function here so that's going to be so now the count of what it's going to return it forgot the difference between plus plus before and afterwards it's a prefix so it's going to use it and then increment it that's why this operator said use and then increment or no increment and then use cool so this is going to output one this will output two, this will output three but we can create a brand new function and incrementer two and now what's this going to output what's this going to return one, right, exactly because there's a new count variable so this inner anonymous function closes over this count variable and so every time it's executed that that variable from that scope is being incremented but here we create a new function it creates a new variable count and a new function refers to actually a different instance of this variable count cool and we can see this in action do we say it right, yes we did, cool so we define this function we can say that increment is a new create function we call it returns one, two, three and then we call it a new create function and it returns one it's actually really fun if you ever want to play with this I'd recommend it okay JavaScript also has features it does this as well to do runtime evaluation it's used a lot more in JavaScript so the idea is the eval function or function or set time out or set interval all of these functions will take a string as their argument and we'll interpret that string as JavaScript code and execute that JavaScript code contained in that string oh also exact script so we can have a variable foo is equal to bar we can have a constant string right where it'll say foo is equal to add up and now if we print out the value of foo what's it going to print out add up is this very easy then to reason about what code is doing that has an eval in it oh it can completely change and do anything right what if this string came from the user probably not great right we know what it's going to do we could do anything we can even have a variable x so we can have console.log hello we can set that to be some new function x and then when we call this function test this is going to parse this variable even x is a string it's going to take that string as if it was a function definition and then it's going to call that function and execute that code inside that string so we can see here if we have foo as a bar we eval that and when we log foo it's going to say add them and here when we call this function test it's going to say hello so here's all different cases where we can actually turn this into we can turn strings into code okay so some of the actually classic use cases of JavaScript and to try to give you some feeling that it's not superfluous so JavaScript actually has a very common purpose on the web even without thinking about fancy animations and graphics and jQuery and Ajax applications the question is so how do you you're writing a web application how do you validate the user input that the user gives to your application how would you do it you're writing an application no JavaScript parser parser parser don't find if there is anything you need to validate the input but where do you do that the server the user has their browser they fill in some values they hit enter and it goes to your server then you can check it and you sell them hey those values have been passed by parsing that's not actually an email address you sent me but this requires a round trip to the server the server has to be able to check that the input is valid so a classic example this would be we check if there's a submit then we get this thing from the student we get we set a student variable we set a class variable based on the get parameters we get the grade we check we're doing some validation making sure that students not empty classes not empty or grades not empty otherwise we say hey there was an error otherwise if the grade is one of the proper things we say hey there's an error your grade has to be one of these then we say otherwise we say grade successfully submitted so here in the form the form has a name student a name class and name grade and we know that because the form does not have an action attribute it's going to submit to the same page default over a get request so if we have our form here we can fill in add and d grade a but we didn't fill in a class so we're going to do this it's going to say error you didn't fill out all of this form so I can fill out something in there but change the grade to be a g and it will tell me well actually the grade has to be one of these values this is classic input validation that you all do when you write any kind of application because users are terrible they can put in whatever they want to make sure what they put in makes sense then I can finally submit it but if we think about what just happened in that context it would be me typing things in what happened was my browser made a request to the form validation php page got the response the initial page and then I made another request with an empty class field and I got a response saying oh I made a class field I made another response with the wrong grade format and then I finally got another response back saying well that's the wrong grade format and then finally I had a correct submission so this caused what 1, 2, 3, 4 4 round trips to the server but we saw with TCP if I'm not keeping this connection open which doesn't necessarily always happen this is going to be 4 3 way handshakes in order to start to establish the connections there this is hugely inefficient just to know that well you really wanted me to put in the class field and the grade has a specific format so what we can use and one of the use cases of JavaScript is to do this validation on the client so we can have our form and we can have JavaScript here so the key thing here is that we have an on submit handler this handler says essentially run this JavaScript code return the check function a check form function and if that returns true let them submit if it returns false stop them from submitting and so inside that function that's defined above this use here we're going to find some check form and we can say hey get this form so use the get element by ID get this form on this page and if the values are empty then pop up an alert to the user that says hey you must fill out all the form and return false test the grade say hey the grade has to be one of these otherwise return true so now stepping through our other example we fill in a student without a grade and it pops up an error message immediately the JavaScript code does this automatically right when we click that button the JavaScript code is living, running on the browser on our machine it checks and then it pops up this window and then we say okay well change the class and change the grade and it pops up again that hey the grade wasn't right and then finding that and change that and successfully submit it and now it actually makes the request to the server so now I've gone from here to just correct submission cut out all those middle parts so if we do this if we're doing this on the client we're checking making sure that the input is correct then can we get rid of all that code in the PHP side because the less code we have the less bugs we're going to have so we've already done that check in the JavaScript code can't we just get rid of that on the server side code? no now yeah the users can disable JavaScript right there's nothing that tells us that the user actually went through and the JavaScript code verified that everything is in order the user can disable JavaScript we saw we explored in one of the assignments command line clients right they're definitely not they're just making HTTP requests and from the HTML on this page right we can know exactly what request is going to be made when this form is filled out we know this is making a get request to the same page with a name of student with whatever value is a name of grade with whatever value is and a submit so we can actually automatically create an HTTP request directly from this we don't need a browser at all and so this actually can lead we'll look at it later because we're going over to groundwork here this is going to lead to security compromises depending on what the validation does so this actually is a problem right because now the validation must exist on your server side and your client side right so in this example what were the two languages there the HTTP and JavaScript right so you essentially have the same code in two different languages living in two different places that are checking should be the same thing so this is actually a whole nother problem making sure your validation is consistent between the two right and it's actually one of the big selling points in some sense of running like Node.js everything on the server because you can set it up so that the function is the same that checks right and on the server and the client it's the same language and the same function the same code okay so all this is great we can do fancy animations all this cool stuff but fundamentally right we're limited we don't make a request of the server until the user either clicks a link or fills out a form based on everything we've seen so far right so our JavaScript code can alter the page however we want but we still have to make a trip to the server so this is where the X in AJAX comes in the XML HTTP request object so it's actually really funny if nobody realized actually Microsoft we have Microsoft to thank for coming up with this so in the 2000s Outlook web access so anybody access the Outlook ASU things? EX was it Exchange 2010 ASU.EDU right so that's actually looks like Outlook but it's actually the web front end for the exchange server so everybody works on that team by weird historical accident that team is technically on the exchange team even though they're emulated they have the look and feel of the Outlook browser that's actually a different team it's very weird and so we have this example here that you can go check it out if you've never seen it before and so the idea was when you're developing a web mail client every mail you click on requires a whole round trip to the server to get that mail and then you want to go back to your inbox it's a whole round trip to get your inbox and so it actually leads to scalability problems with traditional web applications you're constantly clicking through things you know I don't know about you but I'm constantly looking at a lot of email when I go through my emails and if all this required round trips to the server it could be a problem so the idea was they created ActiveX control in about 1998 which would fetch bits of data from the server so the idea is well when the user clicks on their mail in their inbox let's just fetch those bits of that mail and then display that to the user right and then when they go back well they can go back where they have the inbox and they click on a new mail you can make a request there and so it's actually kind of weird it was towards that it's like a great I think I have the link here there's a really good historical document from one of the people involved here basically they were close to feature complete and they were shipping so they couldn't shove this into their code so they had to basically gross and get the MSXML team to include their ActiveX control which is where the XML comes in XMLHGP request so it actually has nothing really to do with XML you don't have to return XML back or anything like that it's kind of a historical accident and so it shipped in IE5 in March 1999 in exchange 2000 was finally reached in November 2000 and the Outlook Web Access used this ActiveX object and then finally in a net state realized oh man it's actually a really cool feature and they added it in 2000 so the full story is here it's really interesting so what was so I remember what the first application they used where they were like whoa how did they do that it's not for me it was I think Google Maps I think was probably one of the first ones it's not a flash application but you're scrolling you can infinitely scroll nothing's refreshing Gmail was also probably one of the first ones I was like whoa how are they actually doing this so it's actually because of this so because of all the stuff that Microsoft did getting this creating this so the idea is this object allows JavaScript code to retrieve data from the server process the data and update the DOM all without refreshing the page and so so once again browsers historical differences in most browsers you create an XML HTTP request just by calling new creating new object here in Internet Explorer you have to use this active x control to actually do that and so the idea is that already state change property of this object you can set actions and functions that occur at each point in the life cycle of this request so part of the idea is well this goes back to something that's in parentheses here right so we have the JavaScript code on the page but if the browser and the page stops everything to go make this request well then you've lost the interactive component of your application then the user can't interact with your application so the idea is you want this to happen asynchronously say hey go make this request and then when something good happens execute this code in order to update the page so this already state change is a function that gets called and so you set up this callback that says hey call this function with the state changes then you can execute the request and say hey make a get request to this example and this parameter will say what kind of request you want and then you can finally send the request so the third parameter indicates you can actually do asynchronous or synchronous requests and so the idea is the already state change will get called and it gets passed a value in here that says that tells you where it is in the life cycle so either it's uninitialized it's actually made the connection, it's loading the data it is loaded, it's finished loading and then it's interactive it's interactive and finally it's complete where the object is actually finished and initialized so usually wait until the status is complete so you say if HTTP request ready state is 4 then operate on your data so finally once we've received the document and we've checked for a successful return code the content of the request we can access with our object.response text this will give us the raw text of the response we can use the library to parse it as XML so we can actually automatically do that in this case we're going to operate and manipulate this object just through the DOM elements let's quickly go through an example so here's some code we have the HTML of the page we have this insert here element just like we had before here we're going to so this is actually kind of the raw code so this we're doing some kind of feature detection of the JavaScript to say hey if there's an XML HTTP request object then create a variable called HTML HTTP request otherwise this means we have to use Microsoft's ActiveX control if we have a console if we don't have a console then set up a log function to call this so this should show you all the crazy stuff you have to do to actually program across the browser then we can set up the on ready state change function to log that hey this is the ready state and if the ready state is 4 get the response back create a new text node and add that to the insert here div then we can say before the request we get it we send it and we say we're after the request so on a modern browser we can see here I'm debugging I'm at this console.log before request I'm now log the before request I'm opening the request and actually right after it does this open request it actually asynchronously calls this with 1 to say it's in ready state 1 then it does the after request and then it's in ready state 2 and then it's in ready state 3 and ready state 4 and then finally it changes the content of the page to put the test age act and we can see if we switch over to the network tab here we can see that it's made a request to this age act underscore test dot txt and which was the URL that we gave in our example so it's done this without the browser changing refreshing or anything and so we can see that that is the value of age act underscore test dot txt crazy enough is this code that we wrote still runs exactly the same in Internet Explorer 6 so we can use Internet Explorer 6 we can go to the same page we don't have a console to log things to so this is why we made that hook to create that console object so this log function actually just alerts so it says ready before request it says we've hit ready state 1 ready state 2 ready state 3 ready state 4 and finally updates it with the test age act so all this stuff happens automatically in the background and then it does the after request which is super weird I don't know exactly why but it does work and just to prove it this is i.e. 6 which one does it have from 1985 to 2004 wow that's got me cool and then looking at this with jQuery it's like this you say get age act test dot txt and when this returns in the insert here div insert the data as html I don't have to do any of that crazy complicated stuff where I was testing all these stuff and jQuery does everything for me and so we can do that and it just works and that actually still works in internet 4.6 which is why you want to use something like jQuery okay cool alright we'll stop here


So, is the Edge Router X still a good buy in 2018? I think so. Now, I will cut to the chase so and we're going to qualify this. So, do you have a fast internet connection as in do you have gigabit? Do you have like, let's say Google Fiber? If you're running a gigabit connection, you can, and I've done a video on this device, you can turn off hardware offloading and this will route at that speed. You can get full gigabit speed out of this. It's a wonderful and amazing feat of a device this small and this inexpensive. And like I said, I'll leave the links to my previous reviews and speed tests I've done on this. Now, the way you get that speed is by hardware offloading. Now you're probably asking why isn't it just on out of the box as a default convict? Well, the reason why is because a lot of these are used in like a small business and they want QoS on them. Do you need QoS is the question I kind of want to get to here because I've had people say, Oh, I don't want to do the hardware offloading is I hate to lose the QoS feature. And when they're running it in their house, I'm kind of like, okay, what are your use cases for it? And maybe they're valid. Maybe, you know, it people just think they need quality of service. Now the idea here and here's the quality of service breakdown and how to set it up. They've got really good documents on here. And for example, this would be with a VoIP configuration, which is the most common reason we put QoS in a lot of systems. Now if you need something that can both route it gigabit and have QoS to prioritize your VoIP traffic, then you're probably not looking at this. If you have that high speed of a connection, the majority of people, even us here in my office, you know, we only have a 50 meg circuit here at our office. They do offer faster ones. They are just substantially more expensive. And we already, if anyone doesn't know, pay a lot of money for internet here in the U.S. in general, based on the speed we get. I know it's more somewhere else and it's less in other places. That's a different discussion. But for me, this, we're using PF Sense, but this would work on our office. We could do QoS on it and we only have a 50 meg circuit. So that's fine. If you have a 200 meg circuit, still able to do QoS on here. Once you start getting over there, you start running into the problem of its ability to route at that high speed. So for home users, this is still an excellent device. I think it's an excellent purchase. And, you know, you combine that, because this is just the router, with like one of these Unify APACs. And this is, depending on where you find it on sale, between $50 and $60. I've seen them for less. I've seen them for more. It depends on the price when you're checking. But roughly in the $50 range, and this is roughly in the $89 to $100 range, it's supposedly for $150, you have one of the best home Wi-Fi systems you can set up. This is actually what I, when I'm not doing testing with PF Sense stuff, I put this in at friends' houses and things like that. It just works. It is like the easiest way to get your friends set up with really good internet at home and a really good router. Most of my friends, they're playing some games, they're not worried about QoS and VoIP.  Now that being said, let's go in a little bit about the hardware NAT. And they did a great explainer here, talk a little bit about what else this happens. So if you're not familiar with exactly hardware NAT is, hardware NAT, let me zoom in a little bit for you. Hardware NAT, offloading, and I keep seeing hardware NAT, it's actually more than that, just as the command is HW NAT. But offloading is used to execute functions of routers of hardware directly. And I'm not going to read all this, you can read this, but let me explain to you. The processor in here, what you're getting for this price, is not super, super fast. So when you don't offload the hardware to the very specific, I believe they're ASIC processors that do the routing on here, the processor has to handle it. And it's only able to handle so much at the price point that to fit this in here. So it's a great value, but unless you turn on it offloading, you can't, the processor just can't keep up. Hence it limited to, they said 300 meg here. Now, when you do this, you're going to lose the NetFlow, the ability to do bonding and QoS. But the other functions, VLANs and just general NAT, work perfectly fine.  And if you're someone who's got gigabit at home, depending on how much bandwidth you're pulling, or if you're maybe doing something like using torrenting, your voice quality will probably still be fine if you don't have a ton of devices behind there. So for the people who are just the home gamers and things like that, great. When it comes to if you're doing to run torrents on there, that's where you may want to run QoS. But most of the time you can probably pause your torrents to play your game, that's another option. So yes, it's still a good purchase. Yes, this is still an excellent device. You can't beat it for the price. But if you have that high speed requirement, you will have to do the sacrifice. And I'll leave the link to the video where I show you how to change the hardware NAT settings in here. You'll have to make the sacrifice of losing QoS and the NetFlow in there. So if that's a big deal to you, you're going to have to bump up to something bigger, more expensive that supports the full QoS and NAT. And this is one of the reasons I like the PF Sense one I recently reviewed. That's really good. The SG-3100, that's a great choice for to step up. Or you can go and look at some of the higher end UniFi stuff. So they make higher end devices as well. But if you're really looking, this is a people that ask me all the time, I'm looking for an inexpensive solution for home. I'm telling you what, Edge Router, it's quality, it's well built. It's the great solution for home. Combine that with, you know, start out with something basic, like one of these UniFi ACs. Generally for home use, plenty. Absolutely great. If you need something beefier, they do have higher end models. But these work great. That's an excellent setup. I've shown how to set up the Edge Router. I've shown how to do that. Shown how to set up the UniFi. Maybe one day I'll do a video where I combine both together, but or put them in a playlist and just watch both. It's pretty straightforward how to set them once you kind of get the idea of how these work. But they're both excellent products. I'm really, you know, a big fan of a lot of the UniFi platform. We deployed a lot of our clients and we've used these at our clients that don't need QoS. They don't have any voice systems or anything special. They just need, you know, a lot of our small businesses are just a couple of few computers. This is way better than the crap that you get from the cable providers here in America, you know, between Comcast and Wide Open West, the two popular ones here. They give you kind of crappy modems that just don't, they're not that great. Bridging them over to this. Easy, peasy solution. Drop these in. Excellent. They work great. They're small. Still a good buy.   But I tell you, the quality and routing performance you get out of these are better than some of that consumer grade ones that you'll find like at the big box stores and things like that. So these is helpful. And it's also for me to reply when people ask, should I buy the EdgeRouterX still? Because people see the videos from last year and they go, well, I don't know if I should buy it here in 2018. Yes, it's still a wonderful buy in 2018. Definitely buy it if you need a basic, you know, and if it fits your needs and you don't have that high speed requirement with QoS requirement. Other than that, it's great. All right, thanks for watching. If you like to catch me here, like and subscribe. If you want me to do some more videos on EdgeRouterX, let me know. If not, check out Willie's got a lot of videos in there, Willie Howe. There's a lot of great videos on how to configure these for doing special things because all these ports can be configured to a lot of different network options. Little bit more in depth in configuring it. Maybe I'll do some videos on there, but I think Willie's got a lot of them covered. So go ahead and check his channel out regarding that. Thanks.


Hey what's up you guys welcome to my channel, if you're new here, hi I'm Lydia and if you aren't here make sure you hit the subscribe button to know if you're Cajunza and hit the thumbs up button to agree just help me out.  I did all sorts, so I sort of am and the mental health team they all decided to put me under a sack. I got IM twice in A&E, both times with Halopyridone and my god I'm not coming out. Well I can't regular Halopyridone, I'm not coming out. There's not much to why I got admitted. I got admitted to keep me sane and I'm being discharged tomorrow now. It wasn't always today but my medication haven't gone wrong. But a psyched mission doesn't have nothing to worry about. It's not the end of the world. You meet some lovely people wrong. Might as well squeeze in a lady. And most of all I keep to myself. And it made sure she helped me out. It's just not a thing that happened, or she didn't happen. The reason I even went into A&E was because I injected too much of my diabetic medication which wasn't good. It led to high bills. I am just grateful that I came here. Because I wouldn't survive going home. Thanks for watching and I'll see you in my next video. Peace.


This is Ashley and today's little video is based on an article entitled male biting a problem deeper than skin deep. Now I'm sure a lot of us are guilty of biting our nails. I know I am. As a kid I used to bite my fingernails a lot but nobody really pointed it out except for my aunt and after she did I guess you can say that was when I started using a lot of nail polish and because I did use nail polish it prevented me from biting my fingernails because I do not want all of this hard work to go to waste. Now according to the article there are many reasons why a person who want to bite their nails. It can be attention seeking, sociopathy, lack of self-monitoring or self-esteem and it can even be OCD but the most common reasons are stress and anxiety. It's used as an outlet for built-up emotions and a way to reduce tension. In the article Dr. Roland Bronow says that our skin and nails are a mirror of our emotions. It just got pretty deep didn't it? Now to conclude this video I would like to give you guys some tips on how you can stop yourselves from biting your nails.  Admit it. Admit that you have a problem with biting your nails. Suggestion number one. This is gonna sound really ridiculous but as long as you're at home I think you can get away with it. You can wrap bandages around your fingernails. Suggestion number two. This is something that you can get away with especially when you're outside with friends or on occasion. You can wear some stylish gloves. For all of you lovely ladies out there like I mentioned in the first part of my video you can wear some nail polish and my last suggestion and I think this is the best way you can stop biting your nails is to keep your fingernails short.  And that is my time thank you so much for watching this video. The link to the article nail biting a problem deeper than skin deep is in the description box below. Hi thought you saw the last of me didn't you? I just wanted to remind all of you beautiful people that you can find all of our content on our website psych2go.net. Please follow our Tumblr page at psych2go.tumblr.com. Please follow us here on our YouTube channel. We will be posting videos based on the articles that are available on our website. Please remember to give this video and all of our videos a thumbs up to show your love and support. Once again thank you so much for watching this video and I'll see you next time.