Let's talk a few about version control today. Yeah, I call it also your project safety net. First of all, it's maybe my phone. So first of all, yeah, version control. I want to back to know my audience. Who of you has ever heard of version control? Who of you is using version control every day or sometimes, okay, quite a few. Okay, for these people, yeah, I want to talk about version control, maybe also some aspect which you might not have known yet. And for everyone else, let's try to figure out what version control actually is and how it can be useful to you in your projects. Okay, so I've been working on my computer today and other days as a software developer and doing that in teams with different people, working on projects, working on many files in many different folders and there it can get messy. But there's one thing which helped me all the way along and this is version control and today I want to show you how it can help you as well. Good, so let's take a look at some project which we might start first on our own and then later, so together with other people and we've got some folders in there, we've got some files, also got some images. That's like just an example, small project, yeah. And we then in this case, sorry, I have to turn my hand like that, and yeah, so we have this project and then we might work on one file and go along but say, hey, we still want to keep this one little bit and don't want to delete that because maybe we need it later. So we create a copy of that folder, right? And then we go on and continue and maybe there's something else. We just change one file but we want to keep it. We create a new folder and another one and another one, but this is the last one, right? It's the final version. We will not do any changes after that, right? Yeah, so usually that happens and again and so on and this is just an example I've brought up because actually my personal examples, for example, in Bachelor thesis would be just too embarrassing to show here would be too long. Who of you actually, like things, such a thing might have happened to you as well at some point in your life? Oh, quite a lot of people, right? But the good news is, whenever you did that, you created your own version control system because that actually, you're taking your versions, different versions of your project and somehow control the flow of them. You give names to different versions and somehow have it in some sort of order. But what is, when you want this one little thing out of this one small file, is there any chance to find it again somewhere in all of this mess? Probably not, right? So here's where the version control system comes in there and I call it like a safety net for your project. So you can imagine your project, it's dancing on a line on a circus and you have everything in control but then you forget one thing, the version control is there to save you as your safety net. You fall but the version control system is there. Okay, what is your version control system actually? So it keeps a history of all of your different versions which you worked on in your past and it has a lot of different extra tools for you, this space. Good, who of you knows Google Docs? Right, almost everyone of you. There you can work on one file simultaneously. Like here you see two different people working on the same file at the same point in time but maybe not everyone of you knows about this other, like when you click on top there you can actually get to the version history section of Google Docs. So there you can actually see a history on the right, on the right hand side you see Google Docs is automatically storing different versions of your project where you can go back to and you can then recover stuff. On the left hand side you see different versions of people color highlighted. And that's, maybe you wonder, like I saw online many people really wonder why is there no save button there in Google Docs? There's no save, what? That's because Google Docs is keeping your versions, it's saving it for you. You don't need a save button yourself but there's a version control system behind it. Good, so Google Docs is something cool when you work on one file simultaneously but let's look at something where you can work together with many different people on many different files and many different folders. There you want a version which is local and for that you would have your local folder and you would have some hidden folder in there where your version control system, your safety net is storing all your versions and then you've also got, and here on the right hand side I just show you how it looks like when we do our naive version control approach and now I want to compare the two. So when I start with my first version I can add a name to it, a name how I can remember what they did in this version. And that's like, here the version separately stored and also who did that version. So here I've got a small emoji of an astronaut with a moustache because that's kind of what I dreamt to be at some point. It didn't work out that way but in Google Docs you can also actually give a name to your version and so that's the same way you can do it in a version control system. You can change the dates to names. Good, and then the whole thing comes in kind of a tree because that's how in a version control system all your versions you can imagine of being set along each other in a big tree and growing as you go on and they cannot be changed. So each version builds on the other one that you can change them that's more sophisticated way of using it but we'll stick to that. Okay, now it gets interesting and the second version. And now in the second version I want to include an intro of our cat and now we already see a first difference of in a version control system with just our one folder and the hidden folder VCS stands for version control system so it's the folder holding version control system and on the right hand side we have already two folders because we created a copy and this goes up into the tree and we can create more and more versions and now it's the eighth version and then even someone else could come in. Another person adds a version and changes the files and even another person undoes the change but you've got with all these messages a history of who did what and you see on the right hand side that when you do it naively you've already got a lot of many copies of your project and for example well the images, the image folder they were all copied again and again and the version control system we've got just one folder they add this hidden version control system folder okay, sounds good and the moment we will talk about what's actually inside this version control system folder which holds kind of the magic and how it works that we can have all of this history of versions where we can jump back to and forth without actually having all of these different folders so now even the rock is happy so he can read the messages and come back and forth but let's quickly review let's quickly recap the benefits are so we see that actually with the version control system we can have infinitely many versions but for that we need infinitely many folders and sorry that's when we do it by hand and when we have a version control system we can have as many versions as we want and we just keep this one folder with our project plus this additional version control system folder which we will look at in a moment and then we also see when you copy the files it gets big data-wise and with the version control system you use less this space but there's still you still got all these versions so how does this actually work and what's inside this version control system folder let's take a look how this works who of you does know any working control systems you know any names of them think you were first Git is a famous one anyone know another one yes SVN, subversion so there are some of them these are the three most popular ones so there are a lot of different ones it's actually a big space with a lot of different ones and I put in Google Docs there it's not a version control system but it has one under the hood and we will take a look at Git now that's the most successful and the most widely used one and it got a lot of and you see how popular it is it's called Github that's like a cloud version of it just recently got acquired by Microsoft for a really high price and just shows you how important these systems are good so let's take a look how could that actually work now to save space and all files so instead of copying all of these different folders and when we change just one word in one file you know but we want to keep some of the changes and keep the version we would copy the entire folder in our life approach what if we just only store the changes so we only store there was one word changed and then we change something else and we store only that change and then we change it again we store that change and we don't have to copy entire huge files we only change small bits and in the end we put everything together so that it again makes sense in one file as a version control system sounds reasonable right but that's not what Github is doing can you think of why that might not what could be a downside of that approach any ideas yes exactly so you see it's a really complicated thing to do if you have differences of files and then you have to remember once you deleted everything then you put something back then you change the name and so on and in the end you have to put everything together it's really complicated process and you've never got your real file which is your current version on your system you always first have to compute it so that's why Gith in particular is a version control system chose a different approach to change even a small one we copy this very file but we will never copy all of the other files which you have not of all of the other image files and so on but we can compare very fast whether your new all the files of your new version which ones have you changed and which ones not so how does Github do that alright so for each and every file it's a so called hash it's a representation of just a string of 40 characters of the contents of your file so everything in there gets a hash and with that you can the content is uniquely identified that's not only text that's also every picture every picture gets such a hash in the end you just have to compare hashes so even if you have documents like here in the first letter is different the hash the resulting string is completely different and that's really useful because you then only have to compare the hashes for example if only the last word of your file was changed the version control system has not had to go through the entire 1000 or so lines to check whether the document is different in the new version to the old one it could just compare the 40 characters and see that the document is different so each and every document in your folder receives a hash and for example this is my first version which is all of these hashes and then now I change only this one file this report file here in red and my second version will then get a new hash there but all the other hashes would remain the same so even also all of the folders all of the files would not be copied but just that one would be recreated let's take a look inside the version control system folder and here we see in the first version we've got all of these files in there recreated so actually when you begin your project with a version control system then you have a bit more data and you have double the amount of disk storage of your project but when you copy some file or just change one file only this one file is recreated and not all of the other files which would be done in a naive approach so after you create like the third version already you save disk space and that's especially useful when you share your project or working on it with many different people because many different people put in many different changes it will get a lot of versions and that makes it possible to work effectively ok, so I talked a lot about version control system very theoretically and so on and you must be thinking ok man, Andre but how could I ever use that if I'm not a programmer and raise my hand in the beginning and I have the feeling you're only talking to these guys of people, no graphical user interfaces where you can begin to use version control with any kind of project today and I give you just one example that source tree, I don't want to make any advertising for it, just free software and here you could take any folder of your project and just drag it in there and boom, your project is already version controlled and when you're inside there for example, as I did in the example before, I'm changing only one file this project file and here I'm deleting half of the project because I'm kind of fed up with it no, it was bad, but I might still want to keep this change and use it later, I never know and so this will be my change and the only real important word you need to know now to get going with Git and this one is a commit a commit stands for a new version and so here you see on the top left there's the commit button, when you press that you can also put in a name as you saw before, a name for your version you press commit and that version is saved and with that program, you can always go back to your versions, jump back and forth and then it has a lot of more tools to offer how to work together in a big team and that only in the end makes it even possible for people, for software teams and production projects to be spread around all over the world and to still being able to control exactly what they're doing, to know exactly who did what, where and when to have complete the complete overlook over everything and with kind of having all of this detailed information you think oh no everyone knows exactly what they did no, it actually frees up a lot because you can be spread over a lot and work together effectively okay, thank you very much thank you Andre any questions for Andre about version control there is at the back, do it Mike does it handle hash collisions and if yes then how okay so what is a hash collision and so we have got these hashes as you saw these strings of 40 characters and we saw that I told you they are unique every single document you have gets a unique string but this is an algorithm which tries to do that and does it almost all of the time but not each and every time and then if you have two documents different documents and they turn out to have the same 40 characters string you have a hash collision okay that is just to get everyone first on the page of what this question is about and now the question was does the system actually handle that and what does it do in that case and I must tell you I am not exactly sure how it handles that it happens very rarely and just as an addition to that because it happens so rarely actually you don't almost never on most computer systems you don't have to use the whole length of all of these 40 characters because just a part of that maybe even six or eight of these characters are enough most of the time to uniquely identify all of your different files because there are already millions of different combinations so like you need to try out until you get such a collision maybe another question please anyone right there at the back please one question if you are working with teams will be more recommended to work in the ones like Google, Dogs that already use this kind of algorithm behind or will there be like a certain philosophy using like a software specifically for this recommendation like to use the ones that are like Google Dogs or to download yours and work in files and teams with an algorithm approach okay thank you very good question so for example Google Dogs is really great for working on the same thing simultaneously real time you are all in there working on the same file and it has this mechanism for it which I showed you is you have your project kind of on a server you get your clone your copy of that work on it yourself on your computer and other people work on it as well they can chill work on it and then you put everything together on the server and at that point you might have to resolve conflicts so Google Dogs is a cool way of offering this live simultaneous thing and there are also other tools for that as well so I think that's kind of the main differences difference when you really are there at the same time and can even like add comments live and change that as with Git as you can take it home to your computer work on it and then maybe from even more complex things and then later send it to everyone thank you André, thank you very much Thank you


Hello friends and how are you all doing today? The question says, using integration find the area of the circle x square plus y square is equal to 16 which is exterior to the parabola y square is equal to 6x. Now here in this question we have in the first quadrant the point of intersection of the circle x square plus y square equal to 16 and the parabola y square equal to 6x is let's say point B which is 2, 2 root 2. x is 2 and y is 2 root 2. Now here we need to find out the area of the circle which is exterior to the parabola. So the required area over here is say A, area of the circle minus area of circle interior to parabola. Now area of the circle is pi r square here r is 2 so area of the circle will be pi sorry the radius of the circle is not 2 but it is 4 so it is pi 4 square minus area of the circle which will be the exterior to the parabola will be 2 integral 0 to 2 y dx minus 0 2 to 4 integral y dx. So what we need to do is we just need to simplify this expression. So we have it as 16 pi minus 2 integral 0 to 2 the value of y will be root 6x raised to the power 1 by 2 dx and for this one again it will be from 2 to 4 under root 16 minus x square. Now here we have substituted the value of y of this we substituted the value of y that is the value of y of this parabola. So we have 16i minus 2 root 6. Now here after solving this integral we have 2 by 3 x raised to the power 3 by 2 0 to 2 minus 2. Now here this integral this is of the special type a square minus x square. So we have the formula as x under root 16 minus x square upon 2 plus 16 sin inverse x by 4 0 to sorry 2 to 4 which can be solved further 16 pi minus its value can be written as 16 by root 3 minus 8 pi plus 4 root 3 plus 8 pi by which is further equal to 4 by root 3 plus 32 pi by 3 which can be further written as equal to 4 by 3 bracket taking 8 pi minus root 3 common square units. So this is the required answer to the given question. You understood it well and enjoyed it too have a nice day.


Secretary of the Navy, the Honorable Ray Mabus, visited members of the Naval Support Activity Bahrain community. During an all-hands call, Mabus delivered a specific message to the service members. I'll talk to you just for a second about what's been going on back in Washington. This area is one of the focuses of America and our defense strategy. And the message that I wanted to bring was how important it is, how well it's being done, and how critical it is that we continue to do this work in such a skilled and good way. For Mabus, this visit not only served as a chance to answer service members' questions, but an opportunity to thank them for their contribution to the mission. Reporting for Bahrain, I'm Patty Officer Sabrina Parker.


Hello my people, my name is Meacham, and I have something interesting to tell you. I, a native speaker of English, have finally taken an English language test. So today I'm gonna explain to you every single exercise that is on the Duolingo test, just to give you an overview of what the test is like, how you take it, and you might even see some dramatic re-enactments of me taking that test along the way. The first thing you have to do before you can even take the test is go to Duolingo's website, create an account, and pay for the test. It's $49, you can pay with credit cards, paypal, whatever. After you pay for it, you'll get a link to download some software that you have to put on your computer. It will check to make sure that you don't have any extra monitors. It'll also check to see if your camera and microphone are working. So once it has determined that everything is up to code, it'll let you start the test. Once you are ready to take the test, you will have to accept Duolingo's eight commandments. First, thou shalt not cover thine ears. Second, thou shalt keep thou eyes on the screen at all times. Third, thou shalt not have any other devices before thee.  Five, thou shalt not speak unless asked to. Six, thou shalt show Duolingo a valid government-issued photo ID. Seven, thou shalt not take notes. And eight, thou shalt keep thy face in the camera box at all times. With the terms and conditions accepted, I was able to start the Duolingo test. So let's talk about some of these exercises that were on the test that I took. Let's start with the ones I hate the most, the vocabulary exercises. I detest these. Ah. There's two ways that this works. One is where they give you a list of words and you simply have to mark which words are real words. The other form of this exercise is oral, meaning you click on the buttons and the sound will play the word like so. Hot, hot, hot. You then simply mark which of the words are real and which ones are fake. Now, every exercise on the Duolingo test is timed, including these ones. You will have like one minute to mark all of the correct or incorrect ones. If you don't get it done in that time, it just automatically moves you on to the next exercise. So because this test only takes about 45 minutes to complete, you got to move fast. All right, so after these vocabulary exercises- Maybe migration has spread the culinary traditions of the subcontinent throughout the world. Yeah, the dictation exercises. So the dictation exercises work like this. You basically click the button and go to the next question and if it's an audio dictation exercise, it will immediately start playing just like it did before. You then have to type and write exactly what you hear. These audios are never more than like one sentence long and all you have to do is just copy it exactly. Since it starts playing right away and you're not really prepared for it, you're probably gonna need to use one of your two additional clicks to listen to it again. And then the opposite of these dictation exercises is where they give you the sentence and you have to record it into the mic. Be careful when you record these things because you only get one chance to record any message. If you screw it up, it's over. There's no redoing your recording. And if you accidentally click next like I did on one of these without recording anything, it doesn't even give you the chance to go back and record it. There's like zero opportunity for mistakes when it comes to these recordings. From here, the test opens up a little bit. You're gonna have some open-ended questions. For example, there are speaking exercises where you will be given your choice of two topics and then talk for a couple of minutes. They ask you to speak for at least 30 seconds but they give you about two minutes to use so you probably should use all of the time available to you. I generally did about a minute and a half to two minutes for all of my replies. Was that enough to get me a good score?  The results are at the end. Another variant of these included photos. They put a very, very tiny, and I mean very tiny image on the screen which you had to talk about for a couple of minutes. The writing parts of the test are basically the same as the speaking parts except instead of recording yourself, you just type in your answer. Similar to the speaking exercises, there are pictures that they ask you to describe. They don't really give you a clear idea of how much they want you to say. They say in a few sentences, I put in like two or three. Again, there's a time limit on every exercise so it's kind of a question of how much can you do in 30 seconds to a minute for most of these things. And again, like the speaking part, there are also exercises for writing where you are given a choice of two topics and you have to decide which one you wanna write about and then you go ahead and write your answer. Now, all these exercises come in more or less random order. They don't seem to have any sort of pattern, at least not that I could tell and there wasn't any sort of difficulty curve. It didn't get more difficult as you went. So you'll probably do about three of each of these exercises from what I could tell. However, at the very end of the test, there are two distinct exercises that you have to do. These are basically like bigger versions of the choice speaking and choice writing exercises. These interview questions don't actually count towards your grade according to Duolingo, but they are delivered to the universities that you apply to. So it's kind of like a bit of an opportunity to show off and really do your best, but it's also not gonna influence your grade so it's kind of unclear what these are for exactly. And that's about all there is to it. I understand now why a lot of universities abroad are not taking this test. To be honest, even though it does take efforts to make sure that the test environment is secure, nobody asked me to show them the whole room. There was no proof that my phone was nowhere else to be seen. I could have easily had it like right down here and my eyes could have just done this and I probably could have cheated on this test if I wanted to. But the other aspect that I think is more important is the academic side of this. This test doesn't really test your reading or listening skills that well. I mean, there's not a single long form reading or listening in this entire test. You will not have to read one article or one essay. You will not have to listen to a long conversation or a monologue from a professor. And I don't really understand how you're gonna test people's university level reading and listening if you don't do those things. However, plenty of universities in the United States have adopted the Duolingo test in the recent year. So maybe it's a good idea for you to take it. Personally, I don't think it's a very difficult test and it might be easier for you to take the Duolingo than it is for the IELTS or the TOEFL. So are you ready to see my scores? Ladies, gentlemen, and non-binary's, drum roll, please. Check it out. So I didn't get a perfect score. I did pretty well, but not a perfect result anyway. I didn't finish one of the recordings. I just clicked next by accident instead of actually doing the recording first. I'm not sure if it's because I didn't fill out enough information on some of the writings why my grade has dropped in other areas. But the bottom line is I put in about 40% effort and did this in 40 minutes and I got pretty high scores and I could've tried harder. So I wanna do this test again and see if I can beat my own score. If you need help raising your score then you need to go to prepwithscore.com. We're also right now working on a series of video tutorials that also include practice materials specifically designed for the Duolingo test. So stay tuned, subscribe to the channel because when we launch that program we're gonna let you know here. Hit us up if you need something. And if you want me to do another English test just leave a comment below and tell me which one you want me to take. Not gonna lie, I actually do have to take a really high level English test soon because to finally get my degree here in Peru I have to prove that I speak English. The irony is not lost on me but it could be fun. I can make content out of it. So I'm looking at doing something pretty advanced soon so we'll see how that goes. I'll see you next time.


وأقولوا في القرآن ما جاءت به آياته فهو الكاريم المنزاله وأقولوا قال الله جل جلاله والمصطف الهدي ولا أتأوله هل أفعل شيئا أفضل؟ الحمد لله يا رب العالمين له الحمد للحسن والثناء الجميل وأشهد أن لا إله إلا الله وحده لا شريك له يقول الحق وهو يهدي السبيل وأشهد أن محمد عبده ورسوله صلى الله عليه وعليه وعاله وأصحابه والتابعين لهم بحسان إلى يوم الدين أما بعد في حلالك المؤسسة ما أنت أولاً يجب أن أفهم أحبت أخي أنه ليس مستحيل في الشريعة لأطفال أخي لأسيحية لأسيحة أي أسيحة التي لم يكن محمد إذا أنها أخي أو أنها أصدقاء أو أنها تتبع خلال أو إذا كانت تنسيحها فهو أنها أحياء أو أصدقاء أو إذا كانت تتبع أخي أو أخاق كيف تتعب with your hand وكيف تتعب with your hand أو أنها تخلق بأشياء أو أنك تخلق بأشياء لا تتغير تحديث يتبع بمزيد ومعالجه صلى الله عليه وسلم يتولى سنة حديث المام الطابلانيو ونريته فيه كبير من حديث معقل ابن يساد رضي الله تعالى عنه الشيخ الباني رحم الله قردت هذه الحديث بصحيح لأن يطعن في رأس أحدكم بمخيط من حديد خير له من أن يمس مراءة لا تحيل له الشيخ صلى الله عليه وسلم قردت لكي يجب أن تتعب with the hand of a woman أو لكي يجب أن تتعب with a woman في أي طريق من حديثها ما أفضل لكي يجب أن تتعب with a metal rod يجب أن تتعب with his head حسناً أنه أفضل لكي يجب أن تتعب with his head ثم يجب أن تتعب with the hand or the heart of a woman وكي يمكنك أن ترى how serious that it is الشيخ صلى الله عليه وسلم إلا حديث لم تتعب with whether she is young or old ولم تتعب with صلى الله عليه وسلم ولم تتعب with a veil or not ولم تتعب with صلى الله عليه وسلم even him صلى الله عليه وسلم لم يجب أن تفعل بيع بلجة الاليجنس with the women بشيك إنيها هنس كما يفعل لهم يجب أن تتعب with the allegiance بكتب لهم عليه الصلاة والسلام عايش رضي الله تعالى عنها she said والله ما مستت يد رسول الله صلى الله عليه وسلم يد مراءة قط غير أنه يبايعهم بالكلامي she said رضي الله تعالى عنها والله the messengers never touched the hand of a woman whatsoever of course she's referring to a woman that's a foreign from him a woman that isn't his wife or his sister or a woman that is not his محلم the prophet never touched صلى الله عليه وسلم the hand of any woman عائشة is saying this غير أنه except that he would what بايعهم بالكلامي he would give pledge of allegiance to them by speech بخارن مسلم narrated on the authority of our mother عائشة it has even been transmitted that the prophet صلى الله عليه وسلم he would say to the woman if she stuck her hand out he would say to her I do not shake the hand of women and Imam would tell him the النساء and Ibn Maja narrated it رضي الله تعالى عنهم رحمهم الله so if a woman tries to shake your hand you respond by saying to her I don't shake the hands of women as the prophet صلى الله عليه وسلم did I do not shake the hand of women also my beloved brothers and sisters who are listening and the questioner himself touching the hand of a woman is worse than looking at her because it moves your desires far greater than just looking at her it causes fitna to come about by touching her body and the prophet صلى الله عليه وسلم he told us أضر على الرجال من النساء ألمام البخارن مسلم both narrated that that the prophet said if fitna greater for the men than women also the prophet صلى الله عليه وسلم he said إن الدنيا حلوة خذرة وإن الله مستخلفكم فينظروا كيف تعملون فاتقوا الدنيا واتقوا المساء فإن أول فتنة بني إسرائيلة كانت في المساء مسلم نريت دا بن حريتي أبي سعيدن الخدري that the prophet صلى الله عليه وسلم he said this world is green and it is glamorous when prophet صلى الله عليه وسلم he wants to see what you're going to do فير الله سبحانه وتعالى in the affairs of the dunya and in the affairs of the women for verily the first fitna trial and tribulation that was placed on the people of بن إسرائيل was regarding the women also this is the issue that would lead to زنع by shaking a woman's hand and in our religion ما أدى إلى حرام فهو حرام that's the principle in our religion that becomes haram because the وسائل الأحكام المقاصد the means they take the ruling of that which it's going to lead to as for the doubts that some people bring which is the أبو بكر رضي الله تعالى عنه and his خلافه he used to go out to the qaba'il he used to go to the people of the city and the villages and he would shake the hands of the women this is weak ولذلك ألمام زيلاع in his كتاب نصور راية he was taken back by the statement and this action and he said this doesn't seem right and half of the when حجر العسقلاني he says I didn't even find a narration for this so this has no basis as for what was narrated that the Prophet صلى الله عليه وسلم he used to shake the hand of the women من تحت ثوب between him and the Prophet would be a veil he would use a cloth to shake the women's hand then this is also weak and there's no basis for all of this you can look at شيخة للباني رحمه الله تعالى the second volume of his كتاب أسلسلة صحيحة the second volume page 64 as for if a man wants to give salams to a woman he wants to give her a salam if there is no fitna that he fears and there's a need for it then the answer is that it's permissible it's permissible there's nothing wrong with that and the evidence for that is أبو داودن تلميدي it's been narrated and the wording I'm going to mention is a wording of an Imam with Tirmili and ibn Maja also narrated it on the authority of أسماء بنتي يزيد she said that the Prophet صلى الله عليه وسلم مر في المسجد يوم وعصبة من النسائق عودن فألوا بيده بالتسرين she said that the Prophet صلى الله عليه وسلم he came by the masjid one day and there was a group of women sitting in the middle of the salam he stuck her like that and he gave to sleep from them from that direction also أمو هاني ربي الله تعالى عنها she mentions his family she said to her I went to the Prophet صلى الله عليه وسلم عام الفتحة the year of the conquest فوجدتوا يغتسلوا I found him showering and his daughter Fatima was covering him she was like hiding him so no one could see him so I went to Ali and I gave him salam so he said who is this so I said I am أمو هاني the daughter of she is the sister of she said مرحبا بأمو هاني so that shows that he greeted her صلى الله عليه وسلم and also the narration رضي الله تعالى عنه he said كنا مكانت لنا عجوز there was an elderly woman فإذا صلينا الجمعات whenever we prayed a prayer and the prayer would be done صرفنا ونسلم عليها we would go and we would give her salams so it's not a problem to say السلام عليكم to a woman but it's haram for you to touch her when you give her salams also جيبريل عليه السلام who is an angel sent from الله سبحانه وتعالى whenever he would come to the Prophet صلى الله عليه وسلم or he visited the Prophet صلى الله عليه وسلم he would say to the Prophet صلى الله عليه وسلم greet عائشا on to me the narration mentions يا عائشة وهذا جيبريل يقرأوا عائشا عائشا this is جيبريل he's giving you salams عائشا then said السلام ورحمة الله peace and mercy be upon you تراما لانرا you see that which we can't see so a man should not touch the body of a woman جيبريل عليه السلام used to come to the Prophet صلى الله عليه وسلم and he would visit the Prophet and he never ever came to the Prophet in the form of a woman he always came to the Prophet صلى الله عليه وسلم in the form of a man it is not permissible for a man to shake the hand of a woman so the angel would never come in the form of a woman it would come in the form of a man and I'm going to stop there if you have any questions you'd like to see as part of this series and you can email us at questions at amau.org


Wisconsin wish you, and especially Mark Lee, a good morning. Good morning, sir. Good morning. Copy. Good work, Mark and Steve, a liveness test in work. Discover Houston, D.I.U., a liveness test successful. That's okay, sir. The Hubble Space Telescope, Shark's Bay, is the moon in my view.  Where's the moon? And these good-looking guys over here. The moon is over the Port Wing, right above Shark's Bay. You guys enjoy it. That's great up there. Just one more word on this MLI business. What we want to do is to avoid doing anything that will distract anybody's mind from the current EVA at hand, because that's the number one priority, and we will be scheduling time later on to talk about this whole issue so that you can get your inputs to us, and we will have a full discussion on the whole issue. Got some good news. The commands have gone through to the Esther, and it will be ready for you when you get there, and you'll be glad to know that all the commanding has been done through the new D.I.U., which you just finished installing, so complete success. Good work. Great hands, Mark. It's a little different on this side because of the constant exposure to the sun. The web cracks in it. Looks like they've got a really good sun tan. Fantastic job supporting us. We appreciate it.  All right, stop right there. You see all four connectors? Yes, we can. Just a little bit. Hold your shot right there. It has a solid state tape recorder. The telescope pushed it head me towards F.R. Swap down here at the loop. Okay, that's from headed. Step straight once, seriously. The thermal shield repair kits. The thermal shield repair kits yet, but we're going to do that right now. We do that. Okay, copy. But I can't confirm that the tethers requested are in the airlock. The tape caddy is with Mark. The MLI repair patch is in the airlock. And the thermal kit will be there soon.


Hey guys, welcome back to our channel. My name is Andrea with Food and Mentory Adventures in Food. Our channel is all about the food. We do taste test recipes, grocery hauls and what's for dinner. And I am here today with a quick grocery haul from Kroger.  So I went to Kroger specifically for these King Hawaiian slider buns. They were on sale. They're hot dog buns, slider buns, hamburger buns, et cetera, were on sale for $2.49 a package if you buy five participating items. So I will be sure to point out those items. So we are planning to have burgers one day and then hot dogs as well. So I picked up two packages of the buns. Then they're chopped, Taylor actually, Taylor Farms chopped salad kits were three, four, I think $9. So I just picked up a Caesar salad kit in case we have pasta next week.  And I picked up some jello pudding because I plan on making a dessert with that. And then I picked up some milk for Howard for the week or for the work week. And then this was on clearance and I thought that was a pretty good deal, $1.29. Then you get strawberries, blueberries, you get cinnamon almonds. And then you can't really see it, but there it is, so white, white cherries in there. So I thought that was a pretty good deal. Then whenever I see the shrimp on sale, I get it.  So this shrimp was on sale for $9.99.  So I grabbed that. I can't remember how much the shrimp was originally. I feel like it was $13 to $14. And it was on sale, like I said, for $9.99. Then I saw this meat on sale as well, the John Soul Spaghetti. And I grabbed two packages. This is the steak. Basically it was on sale for half price at $2.79 per package. And I plan on making quesadillas. Quesadillas one day with that. And then they had a special on sale for this weekend. Friday, I think it's Friday, Saturday, Sunday. It could be Monday too, I don't remember. But this is on sale. You might wanna check your ads and see if it's still on sale today. But this chicken sausage was $1.88.  And it looked really good. It's roasted garlic. And then also their hot links were on sale too for $1.88, so I got the package. And then I also grabbed a package of the Smokies. And they were also on sale for $1.88. And I got these because Howard really likes pigs in a blanket just like that picture. So I got those for him. Then I was really excited to see this Dijorno crispy pan pizza on sale. Now I have talked about this in our what's for dinner videos that come out every single Tuesday. We really like this Dijorno pan pizza, but it is pricey. So the normal price was $8.99. And it was on sale for $6.49 if you bought five participating items. So these were two of the five participating items. The other two were the Kings of Wine rolls. But this pan pizza is really good. It comes with its own pan. And it pretty much does look like the package. Now normally I get the Dijorno pan pizza from Sam's, but and it is cheaper. So when you get it from Sam's, it comes in a two pack and it's $5.99 per pizza. But the reason I decided to get this pizza is because Sam's only has pepperoni and Kroger had some varieties that we have not tried. So I grabbed this cheesy garlic and it looks really good. And then I also grabbed the Supreme pizza as well. That looks good to me too.  It was $2.49 and I grabbed this. If we have a salad or something like that or if Howard wants a chicken quesadilla instead of steak, that's why I grabbed that. And then I also grabbed some skirt steak. It was on sale for fajitas. And then this ribeye was also bone-in ribeye was also on sale for $5.99 a pound. So I got this package with two ribeye that was $17.25, which is a pretty good deal. And then Howard wanted some ribs. So we got a package of, I think these are baby back. They look pretty small, but so I got a package of these ribs, as you can see, for $6.85. So this is it for my Kroger haul. Like I said, some of these deals are still going on. So you have until Tuesday to grab some of them. Hope you guys enjoyed this video. If you did, please make sure to give us a thumbs up. And if you haven't subscribed, we hope that you'll do so. See you guys next time.


They usually give me the right after-lunch slot, which is awesome because I can say anything because everybody doesn't sleep any night, so I can't even read the phone but I still get good reading.  Would you do me a favor and close the door if I'm going to start again? Seriously, they don't lock, I just didn't want it to. I don't want to disrupt those people that are actually out there going to work. Hi there, my name is Cal Evans. We're going to talk about PHP for the CLI. First of all, who was in the last session in this room? Anybody? That was a good session. Emma did a great job but it was more of an intro to the command line in general. We're actually going to talk about PHP for the command line. Who out there has heard me speak before? All my jokes are new, awesome. Russ, you don't count. He's seen me talk. I have four jokes that I've been using since 2006. If you see him laugh, laugh. That means you're supposed to. It doesn't matter if you find it funny or not. I don't know what you're expecting. This is pretty much a beginner's talk. If you understand the basics of PHP, then you've got enough to go on to see this talk. If you've done PHP from the command line already, you might pick up something, but this is the very basics of how to get started doing that. I'm just setting some expectations here. The doors are not locked, I was kidding. So you can slip out.  You can find something better. The code for this is available on GitHub. If you want to play with this, this is interesting to you at all. This project will get into in just a second.  It's not going to be something you can go, hey, I can use this in one of my other projects. I hope it's not. If the talk is interesting to you at all, I encourage you to download the code and play with it.  I'm old, but I'm new at being old, so I keep putting my glasses on. I can't see you. I take them off. I can't see the monitor. I do apologize in advance for that. I got to researching because I decided to do this talk. I was invited to speak at Midwest PHP in the U.S. I wonder. Okay. I was invited to do this at Midwest PHP. I might as well just pick the dang thing up and carry it with me. I sat down, I wrote this talk, and I said this sounds very familiar. I got to looking, and I've written this talk three times for three different audiences. The very first time I wrote this was for the IPC conference in Karlsruhe, Germany. At that time it was very Zen framework focused because I was doing an awful lot of work in Zen framework. This time we're actually going to use a symphony component, but it's not really a symphony talk. We're just going to use the symphony component because that's the easiest one to get started with. First of all, the question, why use the CLI? I'm going to give you a few reasons why I program from the CLI. The first one, and actually this is point number zero, is I am absolutely horrible at drawing anything. Graphics, color, theory, all of that escapes me totally. Now, I am blessed to be married to the lovely and talented Kathy. She is a graphics designer. If you see anything that has my name on it and it looks good, she did it. But the CLI, I don't have to worry about that. The example I'll show you, we got fancy here and I've actually got colors, but that's about it. And it's not very good colors. I had to change them today because it didn't work on my terminal anymore. Reason zero is I'm absolutely horrible at that. I'm much more comfortable and have always been more comfortable as a middleware or back-end developer. I don't like designing screens. I don't like doing anything like that. And so I have found my love now designing things at the command line and designing APIs because you don't have to worry about it. It becomes somebody else's problem. But that's number zero. Number one is I just find it easier to use. A lot of the stuff that I do, especially from the command line, is just hit pocket or one-off programs. We've all done that. We write something. I've just got to move stuff from this database to that database and change everything or change the capitalization in between. You're only going to do that once. And yes, you could write this as a web program and have it output HTML to the browser. But what's the point in that? It's just a script. It's much more at home just running from the command line. I find it much easier to use. Can everybody hear me, by the way, because I'm not up at the mic? Okay. I have a tendency to be loud and boisterous. The mic usually blows people's ears out. Number two, that's their problem. Not mine. No, I'm kidding. You're right. They can't hear me on the video. I will try to stay at least close to the mic. Number two is a properly written PHP command line script can be part of a larger tool chain. Most of you who have used the command line on Linux or OS X for any amount of time know how to pipe things and tree things and move things around like that. And the UNIX concept of you write one small command or one command that does one thing and one thing only and it takes an input and it outputs the output and you chain these together to get the desired results. Well, a properly written PHP script from the command line can be part of that tool chain. I usually find that I can get about 75% of the way there with the UNIX tool chain before I have to resort to something like SED or AUK and I hate SED and AUK. So I ended up just writing the rest of it in PHP. But that's fine because PHP gives me a lot more control. Another reason is for security. If you have commands or if you have things that have to be done to your web application that you don't want everybody to be able to do, clear the cache or reset the database or whatever you want to do, you can write them and put them out on a URL and hope to God nobody ever finds them, security through obscurity or what I like to call the TSA model of web security. That jokes funny in the U.S. Okay, y'all don't know who the TSA is and it just hit me that. The people in the video from the U.S. will be dying at this point. But security through obscurity is just hoping nobody finds the URL that's going to do something dangerous like wipe your database or you can implement a full blown off in that. You can implement a token or a login or OAuth or something like that but that's a lot more difficult just to put a command out on a URL. Or you can use a command line tool because quite honestly the only way they can run it from the command line is if they have access to your server through SSH or physical access. And if someone you don't want to run your scripts has physical access to your server you've got bigger problems than I can solve in this talk. So it is much more secure. You log in, you have to be super user to run this and that's the only way you can execute that command. But the most important reason, and I can't stress this enough, I'm lazy. I find that I can quickly hack out a command line script and I've done this several times. I copy a composer.json file over to a new directory. I modify two or three things. I install the packages with it and I'm up encoding within about 10 minutes and usually about 25 minutes after I've started, I've got what I need to get going, going. And it either works and I'm going to finish it up or it didn't work and I've already moved on to the next idea. I'm very lazy about this stuff. I have probably 20 different commands that I use on a regular basis that I've written doing this and they all started out with, hey, I wonder if I can do it this way. And this PHP gives me, or the PHP command line gives me very easy way to do that. Also, and this comes into play if you're working on larger applications. If you have a large web app that has models that encapsulate all of your business logic, congratulations because that is the proper way to build them, but you don't always have access to all of that business logic. And I can either, most of the stuff that I write, I could probably write in using just straight bash. I hate bash, but I could write it just using straight bash, but then I lose access to all my business logic. And that's usually important and comes into play in all of these. Well, if your business application is written in PHP and your models are properly built and framework agnostic, meaning they can be instantiated without any framework dependencies, then you can use them in just about any command line script that you execute or that you build. And so all of your friends are right there because this is PHP and you know how to use PHP. You've got access to all of this. You can just start building and extending things and making them do new things. So that's why you use the PHP. Now let's talk a little bit about the how. Way back in Gondar. PHP was originally written to work with Apache. Now if you're not familiar, we're going to do a little history here. PHP was originally written to work with Apache and it was encapsulated in mod PHP, which is inserted into Apache. And this is wonderful if you're using Apache.  So the core team, those brilliant people that have volunteered their time so that I can have a career doing things like speaking to you, the core team decided, well, let's abstract everything. Let's make the server application programming interface and then we will implement Apache as that, but we can also implement lesser web servers like IIS. And so IIS now has access to PHP. Actually, we have quite a few of them now available to us and this is not even a complete list of them. Yes, you see that right. PHP supports AOL server for the two people in the world still running it, but it still supports it. But we're really only interested in the CLI and it acts as a... it is a SAPI, so it is the same interface that a web server would use to access this, but it is some of the things, as we'll talk about, behave a little differently than if you're actually using a web server. And there are two major differences in that. The first, the header command does absolutely nothing. You can set headers in your CLI scripts all day long. It's not going to do anything. The header does not output anything. This is a good thing. We don't need headers when we're doing CLI, but it's also a good thing that it doesn't throw an error or anything. It sees that it's working in the CLI SAPI and it just ignores everything that you're sending to you. And the other one, and this hasn't always been true, but we now get plain text error messages. Back when we first got the CLI SAPI, we would get the same output when we got an error as we do on an error on the web, which means you get the HTML output, but it's output in a terminal window, so you've got to sit there and filter out all the HTML so you can figure out what the problem is. That was a real pain in the rear end. Thankfully, those days are gone. We now get just strained plain text for the error messages. Now, when we're talking about PHP from the CLI, there are two ways that we can do this. What I like to call freestyle, which is you put a page out on the web server and you use WGet or Curl or whatever your favorite command line tool is to hit that page and call it in and execute it. This is okay, but it's not really what we're looking for and the OCD programmer in me says that's using the web server. I've got all this overhead for a web server that I don't really need because I just want to execute this script. And you also, like we talked about earlier, you've got to put authorization checks in there or you've got to hide it and hope nobody finds it. This is not a good thing. The reason we would do this, though, is we know these tools. They're handy. They're right there. If you're working from the CLI, you've got WGet or Curl that you use on a regular basis and you understand them. You know these. They're your friends. It's easy to put a command into a cron by doing this, just WGet and the URL. You don't have to worry about pathing or anything like that. It just works for you. And you can use existing code as is. Your web framework already knows how to instantiate the model. Your controllers understand how to do this. You already have views that are outputting stuff, so your framework understands how to do this. You have access to all your tools. It's just easy. And it's a paradigm that every web developer understands whether you work at the command line or not. So most people, when they make the transition to working in the command line, initially start with bash scripts that are doing this and they will call a PHP script through a web server and output it. Hopefully, I will inspire you at least to move beyond that if that's what you're doing now. Because there is a better way. There's a better way to call our code from cron jobs. There's a better way to build maintenance scripts and I do an awful lot of that. I have a little side project that I have to work on on a monthly basis and it was one of those I'm having to move data from this service to this service and I have to update everybody's subscription data and stuff like that. It just got to the point where I was doing a lot of this stuff manually and I said, okay, I can take this and make it a script and I can take this and make it a script. Well, the project has grown to the point where I don't run it by myself. My wife runs most of it these days and she came to me the other day. She says, well, if you'll just show me how to do this, I'll run it myself. I said, oops, well, here comes the problem with it. It all sits on my local laptop. So there are a few downsides to this. If you do this, push it up into a get repo or something so that other people can get to it. She's not a programmer. She's a designer. So she was hoping for go to this URL, click this button. So that's going to be probably the next step or the next evolution of these. But there is a better way for us to be able to build or to build our maintenance scripts. That's not exactly a new way though. We got the CLI SAPI in PHP version 4.3. And the first time I saw that, I got really excited because I was like, cool, because now I don't have to worry about all the HTML stuff. I can just do the stuff that I'm interested in and I dove into it and in 4.3 I actually build an object-ish mail system handler, maintenance scripts. I can issue a command and add a domain name to my mail server. And I can add accounts and I can delete accounts and all this was stored in the database. And yes, I realized storing mail in the database is a bad idea. But that's a lesson you really only have to learn one time. But I built all of this and it was 4.3 so we didn't have true objects. But I had, it was object-based programming. And it was eye-opening to be able to do all of this. And that was where I fell in love with building more and more of these scripts. But there's actually several ways. How many of you actually use a framework for PHP? Okay. Chances are good if you're using a modern-day framework, they have CLI support built in. Laravel, Zen Framework 2, Symphony 2, we'll be using the Symphony 2 command. Aura. Yeah, Aura. Keep wanting to call it Aurora. Aura has it built in. All of these already have these built in. So the concepts that we talk about are still going to be applicable to you even if the commands that we're going to show or I'm going to show you here have to be changed. But in reality, this is not a I'm going to show you step-by-step how to do this. This is one of these. I want to show you what's possible, hopefully inspire you to take the next step. So the sample project. We're moving fast. I talk fast. We're going to get done early. So the sample project, I never like sample codes in talks to be useful code. And by useful, I mean something you could take and look at and say, heck, I can use that in my own project. Because every time I've done that, what I have found is that people get wrapped up more in what the code is doing than the concepts that we're implementing. So the sample project that I have for you today is a command line Twitter client. I know. I know. The first question you're asking is, how can I monetize this? Twitter's been asking that since they began. No. Thank you. Okay, you're awake. Good. As I tell all my audiences, the jokes don't get much better. But if you don't laugh, I will tell more. Okay? We need the blink tag to come back because this really needs to be blinking. We're going to do a Twitter client. But first, like any good programming project, let's shave a yak. Okay, we've got to do a little research. I'm going to have to explain a few, all the moving parts to you. We're going to set it all up, and then we'll play with it. So the first thing we need to do is set up our bootstrap. Now, the way Symphony operates is I have a batch script that has PHP set as the interpreter. Now, I had somebody, I did this talk at Drupalcon LA, and I had somebody ask, well, couldn't I just say PHP and the name of the script? And yes, you certainly can, but you don't have to. You're using Unix or OSX, and you have this set with the proper execute permissions, then you can run this script, and basically that first line tells Bash the rest of this should be interpreted with PHP. If you're running it with PHP, PHP just sees a comment, boom, we're done. So this is... Oh, I don't need that. I'm not going to go through all of this. I'm going to talk about a couple of pieces of it. The first thing is we use the Composer Autoloader. Now, how many of you are using Composer? Congratulations. The rest of you, please start. Composer is one of two or three tools that have changed the way PHP developers operate. It is a fantastic tool. I guarantee you, if you learn how to use it, it will change how you operate because the one thing it does for you is all of a sudden other people's code is very easy to incorporate into your code. I'm going to show you how to do that. But we have to bring in Composer's Autoloader. That's really all we have to do. It sets up everything so that it can autoload our classes. Now all we have to do is get the name spacing right, which is a pain to begin with, but get the name spacing right and we've got everything. And you can see I use a command... I use the command sub-directory. So PHP from the CLI slash command. By the way, the backslash for name spacing. Everybody from the PHP name spacing? Back a few years ago when we were just starting to talk about name spacing, the core put up a vote for everyone, not just the core developers. They put up a vote for everyone to see what to use as the backslash. Everybody eventually voted, and that was the one that got the most. If you go research on RSC.php.net, you can find that. You will see that there is one vote for colon closed parentheses. Because I wanted the smiley face. I set that up. I voted for it. Just think of how much more fun programming would be if that was our name space separator. But anyhow, we bring in the autoloader. We set up our configuration. Now I'm going to talk to you a little bit later about this, but that's all it takes to bring in my configuration settings. I'm using the .env package for my good friend, Vance Lucas. It's available out on GitHub. This is not a sales pitch for it. It's really starting to sound like one, but it's available out there. If you've ever had to do configuration options for either a command line script or for your web server, it is just a fantastic package to use. It's one of those, it does its job, it does it well, and it's not trying to do anything else. That's it. He's had people suggest, well, why don't you have this feature, and this feature is like, no, this is what it does. So Vance does a good job of curating that. And then once we set everything up, that's all it takes to actually set the wheels in motion, or as I like to say, do the deed. The very first time I spoke in Amsterdam was for the Dutch PHP conference 2007. It was the very first one. It was a single track where all in one little room, way over there, in one of the smaller areas of the ride. And I have had this bad habit all my programming career of when I don't know what to name a function, I name it do me. Well, that's fine if you're just writing your own code, but when you're showing it to 200 programmers and it says do me, no, that one went over well with the Dutch. Okay, so that's all it takes. That's our bootstrap. The next thing we need is a model. Now, I'm not going to use any models in this. This is a do as I say not as I do. All your business logic should be encapsulated in your models. All your controllers should do is be the traffic cops say, oh, we want to do this. We need this model. And once the output is done, you say, okay, here is to the view. And you hand it to the view. I don't do that. Everything is slammed in the controller in this example. But you know better how to program. This is where you would bring in your existing models. If you're working on a maintenance script for a larger application, this is where you would use your existing models instead of writing new ones. Then there's the view, because we're model view programmers, right? Model view controller programmers. But in reality, the view doesn't change with scripts like this. It's always going to output text to standard out. That's it. So in reality, yes, you could set up a view. You could use symphonies component or any of the other ones, templating engines to control your output. I have yet to find it necessary to do that when doing this with one exception. I used to have a command that when I would set up a new development area on my server, it would run everything for me. It would set up custom DNS for my local network and custom Apache config files. And I would use the Zend view to do that. But I would never output to the screen. I was using it basically as a templating engine. I would save off the output and write it to the right place. So you can use a view if you want. I don't recommend it. I've just found it's easier just to echo stuff out to the screen or in the case of the symphony command, use the right one, which will output it for you. Then we have to set up our controller. Now our controller in this, if you're using the symphony controller, they're not actually called controllers, they're called commands. But it's the same function. The command serves the function as the controller. And then the config. Now I told you a little bit earlier, I used .env just because that makes it easier. Basically all .env is, it reads in a text file, which is nothing more than a key equals value file. And it sets up environment variables for me with this name and whatever the value is. And if you understand how sessions operate in Unix, then you know that those environment variables are good only for the life of the program and as soon as the program dies, they go away. So they're not permanently set, nobody can get to them at a later date. One side note here. I did, I told you I did this talk, I've done this talk several times, one of the versions of this talk I did for the Dutch PHP conference here at the ride. And I had a script that would send a text message to a phone number. And I was using a service called Troco. A good friend of mine, Adam Kelsie, is one of the, you can see like a VP of development up there. When I uploaded it to GitHub, I mistakenly left my phone number as the test phone number. Just see where this is going. Three freaking years. I got, this is a test. And of course since I did it over here in Europe, the first year, most of those came in at two a.m. Check in a sample config file. That's what we got here. The important thing to note here is you see that my keys are all in uppercase. That is a convention that I use that is not required. The only thing you have to know is that when you're using these in your code, the case for the key has to match. So I use all uppercase, just makes it much easier. The only thing that is checked in is the sample config. You'll have to create your own config. You will need your own Twitter account. Do your friends a favor if you have a Twitter account, and if you have a Twitter account, I do expect you to be tweeting all my jokes that they're funny. It doesn't matter if you agree with me, just tweet out that they're funny. It helps me get into the next topic.  Nobody wants to see this as a test 14 times in your Twitter stream. But I've got, at last count I have 12 Twitter accounts, and I'll use the one we're going to use on this one is one from a project that I've abandoned. So nobody should be watching it. But you will need to get it. You'll need to go to dev.twitter.com while you're logged into that account and get your API keys. When you do, it will tell you to read right. Do yourself a favor, set it to read right, because if you change it later it will give you new keys. You have to go through the whole process again. This application is read only. We're just going to search Twitter. But if you get ready to play around and do some more fun stuff with it, sending tweets and stuff like that, then you're going to have to read in those keys if you don't.  We're going to need three components in Composer. So we go out, and I just issue these commands, require symphony console, that's going to install symphony console. I mean, it's very small, it's wonderful. Fabienne and them have done a wonderful job at breaking these things apart so that you're not sucking in everything. Then I'm going to need Vance Lucas' wonderful PHP.env. We said that we do that. We've got an environment, we're going to need Zen Framework, Zen Service, Twitter. When you issue that command, go get coffee because it's bringing in the whole Zen Framework. Actually, then bring in all of it. This will bring in probably 20, 30 different pieces. Whereas Fabienne and them have done a great job of breaking it apart. Mwap and them are still learning how to do that. And Mwap is, for those of you who don't know, Matthew Ware-Ofinney, the Allied Commander of Zen Framework and now Zen Framework too. He works for Zen, he's a great friend of mine. But that's going to bring in a ton of code. If you want to take a look at the code directories afterwards, you'll see just exactly how much cruft that Zen Framework's going to bring in. But it's the coolest Twitter client that I've found. I've been using it back when Twitter just had the basic auth. You could just log in to the API using basic auth. If you're working in APIs, it was just the easiest to work with. Nowadays, not so much. Okay, let's finish shaping the act. We're going to flesh out our directory structure, which means in my case, I have the directory that the project's in. I have a directory under that called amp. Which is just, that's where I put things. And then under that, I have PHP from the CLI. And I have to tell composer where things are located. So this is my composer, Jason. You can see that I've got my three pieces that I required. It's already built those in. The important thing right here is the auto loader. The PSR0 section, I tell it, everything for this this project is located in the PHP from the CLI directory, and that directory is located in app. That's all you have to do. You set that up, you get that right, you run composer update, it rebuilds its auto loader, everybody's happy. Don't worry about it. 30 minutes. Okay, we're not good. So let's look at some code. Oh, I said let's look at some code. Did that work? Yeah, okay. Can everybody see that? Big enough? Okay. That's the wrong point. Let's find my mouse. Oh, there it is. We have three commands that we're going to look at. I'm going to walk through in detail the first one. As you will see, the other two are basically there's a bunch of in each one that's exactly identical business and walking through detail on all three of them. So the other two I'll simply skip and show you the interesting parts. But this first one. First, I have a namespace that way, composer auto loader knows how to load this and then I load in the symphony step. And it's the symphony command, the inputs, the outputs, the requirements, all of that. But I create my class and it has to extend the command, which is the symphony command. And this one's just called test. And if you're doing this, I highly recommend you create a test class like this. Never ever check it in and push it to production. But create a test class that makes sure that you can connect to in this case, Twitter or your database or any important service. So if something goes wrong, the first thing I do is I pop back in run the test command and if Twitter is down, I know that never happens. But if Twitter is down, it will tell me that and that way I can say, okay, it's not my script. It's Twitter. Nine times out of ten, it is my script. But the test command, that's all this does, that first function laser pointer for the one configure has to be in there. Symphony's command module will look for this in a command and this is just how we set up the command. We give it a name, which is test, I actually typed in. We give it a short description and we give it a longer cut. That's the real basics of it. I did not know you were here. I saw you tweeting, but I did not know you were here. Sorry. The next one is execute. If you're familiar with Java, this is your run. This is what's going to happen after Symphony finishes setting everything up. Down to here. Now the output is one of your properties. I always save it off into a property of the class called output. I'm not going to show it to you, but if you check out the code you'll see that I actually have a trade call right line here that helps me with debugging and will only output certain things if I have a debug level set at a certain level. This kind of thing. It depends on this output being existing. I always save it off. This also means that no matter what method I'm executing this class, I have access to the output. So that's all that's doing. And then print to the CLI. That goes right down here, or print CLI. That calls PHP's staffing name. This should in every case output three letters CLI. If it outputs anything else, you're doing this way wrong. Because this is what PHP thinks it is operating in and it's just going to show us that we have the CLI. And then I call Twitter set up credentials. Now, I love the Zen Twitter client. I've been using it forever. But it is dependent upon this array being set up exactly this way. So it's just easier to put it in method. Now, you'll notice over here I'm using the $env command because .end has already pulled all my configuration in and put them into environment variables. So I'm just pulling it out with PHP's .end or underscore .env. Notice uppercase. Token, secret, consumer key, consumer secret. Got to be uppercase because that's what I specified in my file. And then we're going to create the Twitter client using those options and we're going to call verify credentials. And then I'm going to call response to value. And response to value is going to give me output. Output is going to be the just do a print R on that. It's going to be the largest output you've ever seen.  It's a Zen Twitter response object and it's freaking huge. We're really not interested in anything in that except for the fact are do we have errors? If we have errors, output the first one because there's only one. They put it in an array. Output the first one. Otherwise, if there's no errors, output, credentials succeeded for and the account name. I'm going to show you what this looks like because this is just so dang exciting. Console test. CLI Woohoo! That also means the network's up. If the network was not up, this is a very short talk because we're almost done at that point. So, credentials ceded for Nomad Ruby which is an abandoned Twitter account that I just have laying around and then done. I always output done. I don't know why. It's just I want to know that the program succeeded or made it all the way to the end. So I just put that line there at the end. That's it. As you can see, there are two required functions, configure and execute. You have to have now in the UC that it's certainly okay to put other functions in there or other methods in your object. And by default, all of my methods are protected unless there's a reason not to be. I usually don't use public unless I want somebody else to be using them and I find private just to be offensive because that means that me as the program decided that you don't ever need to use this and that's just, I find that bad. So, but I stick with protected functions and everything and they just do the output for or they just take care of the necessary functions but I'm very big on breaking things up. I've got a friend of mine, some of you might know him, Rafael Domes. Anybody a member of Amsterdam PHP? Nobody. Anybody here from Amsterdam? Okay. Amsterdam PHP is one of the coolest PHP groups out there and I know most of the user group leaders in PHP groups in North America and Europe. But Rafael has a great talk that's available on protalk.tv called Your Code Sucks Let's Fix It and one of the things he talks about is we have a tendency just to keep putting things into the main function and he says the way you can tell this is if your code starts indenting and indenting and indenting and indenting then you need to break that up into smaller and smaller functions. I think his rule of thumb is if you have more than two levels of indent you need to break it up into another function. So that's what I'm trying to do. I'm trying to make Rafael proud so I keep breaking things up into smaller functions. Okay. That's the test. The test works. The network's still working. We're good. Okay. You can see I used my right line trait but here we also we define a few extra things. For my Twitter client I've got several options. The first is do I want English only tweets? The default is no but I can specify yes because quite honestly non-English tweets don't do me any good. But it defaults to no. Then the count. Twitter allows us to specify between one and 20 tweets to be returned. So if you don't specify it's going to default to 20 but and that's set somewhere else. But if you don't specify it'll return to full 20 but you can specify I only need two for this instance. And then only names and I'll show you why in a little bit but we have the option to only output the names of the people they're tweeting. So I set those as properties because I'm going to bring them in using command line properties but I need to store them in my object. Now, you'll notice in the configure that this is new. Let's see if I can scroll that over a little bit. Nope. Okay. We're defining an array called definition and this is the definition of our command line arguments. Now the test didn't have any command line arguments that they specified and the command itself did not specify any. It actually has about 10 of those symphonies of console predefined about 10 of course and this will eventually if you do this a lot it predefining all of these will drive you up the wall because it's taking all the good letters. The single letter things in dash E or something like that. Well it's got dash B so you can forget about using that for version for your script. It'll eventually drive you up the wall but for right now we're just going to find these and this one is set to value none just a flag. If you say dash E is specifying a flag it's only going to give me the English back. Only names is a flag count. It's an optional argument but it will take a parameter and search term. Now by default if we specify this it's going to search for pound PHP because that's usually what I'm looking for. However I can specify search term with anything. It is optional. I use the dash S although it says value required and you can't see it at the end of that. That last little there we go so I've got search term is the long command S is the short so I can do dash dash search term or dash S and then in my help if I specify help for the command it's going to say the term to search for default is PHP. It is required but there at the end I'm setting a default to pound PHP so it is required but it is getting a value even if I don't specify one. Back over here. We build that array and then this looks exactly the same with the exception of we now have set definition and that's it. Let's come down here I pick up my properties from get an input, get option. I do not save off input like I save off output because once you get through with it right here you usually don't ever need it again but I do save off, I use get option to get my my English, my only names and my count and if you didn't specify account then it's going to use null which if you don't specify Twitter will automatically use 20. I come on down, I set my search options if you specified English then we're going to use language, if you specified account we're going to use account. The search options is an array that I'm going to hand to Zen's search component and say input, get options, search term whatever my search term is and then the search options which is the array that we do with these two properties that's all the properties that are there and then we're going to process the response. We're going to do the deed and we're going to process the response and again tweet is a freaking huge thing and we're really only interested in a subset of what's the statuses. So we're going to send it to value and then we're going to pull out the statuses array and that's what we're going to spin through here and we're simply using the right one to say single tweet username and if you get down to it I'm just outputting it to the screen using the right one this is harder than you think when you're doing it this way. There we go I'm outputting the username and then two dashes and then the text. The text is optional. If you specify only names it will skip that. Okay. And then I set up Twitter just like I did last time and then set output which is just the way of setting the colors if you're interested in how that works with symphony check out the code. It gives you an example of that. Let's see this in action. Console Okay. Just a basic search. Basic search spelled correctly. There you go. The green is the username the rest of it is the tweet. Okay. Just to give you an idea if I say O and E. Those are only the names of the people that have tweeted something in English. I know. You know. I see the stunt. Half the room is stunned. I didn't know you could do this. The other half is I can monetize it. You can't. Okay. But Twitter can't. But that's what it does. That by itself not that stunning. Okay. But again the point of this is to show you what's possible and this is going to be a little more fun. Now I'm going to skip all the cruft. This one is called Echo. As you can see it takes standard in. Everybody knows that you have a standard in file handle that's already open. If you don't. PHP has STDIN. You can do any file options on them any reads of them. You can't write the standard in. Okay. It's not going to work. But you can do anything. It's already open for you. It's a constant and basically if anything's piped into this script it's going to come out of standard in. So I'm saying while I can get stuff out of standard in, echo it out with a counter, call in and content. It just echoes things and it's going to echo them back out and it's going to number them for us. The point is not to do something stunning with the code. The point is to be able to do something like this. Console search only English. Let's pipe this to sort pipe it to unique Told you. I always output done. I never want done into my list. So let's get rid of done. There we have it. We have outputted. We've taken all of them. We've written our script and our script is now a first class citizen in a Unix tool chain. We can even go one step further than that and pipe this back into console echo and now they're numbered. The amazing thing is not that Twitter has not failed in the past hour. The amazing thing is we've written code that now works with a Unix tool chain. So if you're writing your own command line script you don't have to write it all. Now I know a lot of some PHP do enjoy reinventing the wheel. I've got a stack of them in my project but we don't have to because Unix already gives us a way to sort things and a way to only pull out the unique things. And then we can pipe it back in. Now I have to show you this because I gave this talk at Drupalcon LA and in the audience was Ms. Sarah Goldman. Sarah if you do not know is a core developer. She now works at Facebook. She's working on the Hack and HHBM project but she wrote the SSH and SSHLib implementation for PHP. So if you use SSH or SSL in PHP, you owe Sarah a thank you tweet or something. She's a wonderful person. Good friend of mine I'm lucky to have a friend like her but she said, hey Cal that's cool but I'm going to copy and paste here. I've got these one here. I thought I was going to copy and paste. There we go. Okay, console. Let's get rid of all of this. And let's pipe it back into PHP. Can I screw that up? You're right. Sorry. Thank you. Congratulations, pair programming taken to the extreme. This isn't nearly as embarrassing as being on I used to do a two week tour where I would give the same talk over and over for two weeks and being in the last session at the last city and they point out, you know you got a spelling error in your slides. Nobody else could have told me that. Okay, so here's what we're going to do. We're still doing the search with only names in English and we're going to grep out the done. And if you don't know the dash V for grep, that's just exclude any line that says done. Okay. And then we're going to sort it and we're going to pipe it to unique but then we're going to take it instead of piping it back into echo, we're going to pipe it back into PHP with the capital R and what capital R does is says for anything coming into PHP execute this so since I'm piping it in as long as it's got input it's going to spin through this file.  It's going to print the name colon and then print the name with string reverse. Again, the point is not to wow you with my coding abilities, it's to show you what's possible. Okay. The dash R is a very powerful tool. PHP, you can pipe things straight into it. Again, we're using fdits on standard N. And we can tell it as long as you've got input, execute this. It's a very powerful tool. This is also fun for those times when your in-laws ask you, well what do you do? Well here, let me show you. Guarantee you they will never ask you that question. Okay. Thus end the code portion. How am I doing on time? Oh, I've got 15 minutes. Okay. We're about done. We're going to be done early, I told you that. I talk fast. Let's wrap it up. First, I'm going to take a sip of what I really had hoped was wine. They really ought not put it in bottles like that. Got my hopes up because I have found that my talks when I have had some alcohol, not a lot of alcohol, but I found that I enjoy them a lot more. It doesn't matter if you do anymore. I'm very funny drunk in my own head. Anyhow, wrap it up. Why do we do this? Because it's easy. I find this so much easier than writing a web-based tool because I don't have to deal with the HTML and all of that kind of stuff. I can use JSON and PHP. XML if I have to, but I charge more for using XML. But if you require it, I can do that. I don't accept jobs that require soap, and those of you who got close to me know that. No, I can't stand so if I use REST. But it's easy. All my friends are there. I use this for maintenance scripts of wine. I run a project right now where literally I have 10 or 15 of these that I run on a monthly basis just to keep everything flowing. The very first time I did this commercially, and not the mail script because that was not really commercially. It was from my own server, but I was setting up email accounts for my friends and family. But the very first time I did this commercially was I used to run DevZone for Zen if you've ever been there. It used to be a community site. Now it's mainly Zen stuff. That's not saying anything bad. But when I was running it, it was all community stuff. And we kept adding to it and making things and we had tag clouds and all this kind of fun stuff. And the tag clouds were dynamic. Which means they would load in via JavaScript. It was fun. But I got to realizing the more stuff we added, the slower it got. And it got to the point where it was taking 10, 15 seconds just to load the page which everybody knows that's unacceptable. So I started digging into the script. I used the Zen cache component. And I started caching the cache not out of everything. But the problem I found is every now and then I would run into an edge case where my caching rules did not work. Now my caching rules were if I posted a new article, clear the home page cache so that it would pick up the next time. And my tag cloud was cached for five minutes and all this kind of stuff. But every now and then I ran into a situation that I just needed to wipe the cache. I made that script. I just right, I did. It took 20 original lines of code plus the Zen framework crux that went around it. And I could just anytime I wanted to I could log in to the server, boom, clear the cache. Not only did it clear that cache but it would notify the other two because it was a distributed server. It notified the other two caches to clear themselves as well. They come in handy and you're going to find more and more uses for it. If you get comfortable doing this you'll find more and more uses. All of your, if you use an IDE you should not have any problem. I don't. I use sublime text these days simply because it'll open dang near anything and trust me I've tried. I've actually opened a JPEG with it. You don't want to do that. But it'll open anything. I just enjoy that more. I don't use an IDE. But if use an IDE like PSP storm or anything it's going to work with this. You don't have any problem. Find a project and just write a script for it. See if it works. It doesn't work for you. Don't worry about it. But I think you'll find that you're going to find ways to make it useful. Up until recently we could not have long running scripts in PHP. By long running scripts I mean anything's going to run for a minute or more. Most PHP scripts execute in sub second. But there are times when you want to process something large. I used to do this. I had a client that had 300 web servers that would generate a gigabyte log file every night. Apache Web servers. And he wanted to be able to search these. So I said okay fine.  Dumb idea. But that's not the point of this story. I wrote the script. I ran it on a 10 mag file and it worked beautifully. I mean you were processing two 300 lines per second. And I've got timers showing me that it's working and it's doing and how fast it's running. I said okay fine. I pointed it to the director. At 5 o'clock I hit the button and I went home. I come in the next morning. Not only is it not finished, but it's processing one line every 60 second. There's a memory bug in PHP up through 5.3. 5.3 they can clear it up. We can have long running processes. I have one, I have a little matmini at home that I like to pretend is my development server but I don't really do much unless I'm running classes or sessions anymore. But it's my development server. I do have a script that has been running on that for 3 months. I have no intention of stopping it. Now it's not constantly doing something. It will go to sleep for 10 minutes. It'll wake up. It'll check something. Hey, there's something I need to do. So it'll process. Sometimes it'll process for 2-3 hours and then it'll go back to sleep. But I don't have to keep running it. I don't have to put it in a crime job and say run this every hour. It's just a long running process. We've been running it for 3 months. We can now have these long running processes. I am not saying write daemons in PHP. Please don't tweet that out. At Drupal Camp LA they give. And one of the core developers who did not have contacts, he's a friend of mine wrote the facts as you're kidding, right? You would never suggest asking. No! I wasn't suggesting that. Don't write daemons. PHP is not the answer to everything. But if you've got something that needs to process for a long time, we now have the option to do that. And you don't have to run it in a web browser and keep that connection alive. You run a maintenance script, you run a PHP script from the command line, fire it up, let it run for as long as you want. It's absolutely wonderful. PHP is not the answer for everything. I do not believe that. I keep wanting to learn Ruby and Node and all these other things. And as soon as I find a project that I have to do, that I can't do well in PHP, I'm going to learn one of those. The problem is all the problems that I have to solve run very nicely in PHP, so I just don't have the reason to do that. Anyhow, that's all I've got for you. My name is Cal Evans. You can find my blog at blog.calevans.com if you do, stop by, leave a comment because it's basically me and my mom, so I'd love to hear from you. You can follow me on Twitter if you didn't get enough of me here, but most of you probably did. I'm at Cal Evans. I work for a wonderful company called Pantheon. That's getpantheon.com We do workflow and hosting for Drupal and WordPress sites. If you are in the market, come by the booth. I would love to talk to you. They've got a little demo. We can run you through. We'll give you a free t-shirt. It's all kind of fun. If you have any questions, PHP, Drupal not so much because I do not have the deep inroads into Drupal, the Drupal community that I have in the PHP community, but I've been banging around the PHP community for 13 years. I know a lot of people there. If you're stuck on something, drop me an email. Chances are I don't know the answer. I'm not that smart, but I probably do know who does know the answer and I'm happy to introduce you. And that's the one thing about the PHP community. All of us realize that we're standing on the shoulders of giants, that we're using programs and things like Drupal that others have graciously volunteered for, so it's up to us to volunteer our time to help the next person down the line. So, that's me. If you have any questions, I'll be floating around at the booth. Thank you for your attention. You've been a wonderful audience.


If you've watched our previous videos on MLA style, you'll recall the two basic concepts that form the underlying structure of the citations, core elements, and information containers. In this video we'll discuss core elements. These are the bits of information given in a specific order which describe the work you are citing. When put together in order, these elements create a citation. In the containers video we compared the citation to a mailing address and we can continue the comparison here. The core elements are like the individual details needed for the post office to get the letter to the right person. Each of these details, the name, the house number, etc., bring an added piece of information to ensure the letter gets to the right place and the right person. In citing a source, the core elements are bits of information like the author, the title, and the date published. Depending on the type of source you have, it may also include locational information such as volume and issue numbers, page numbers, or website URL. Remember, you want each citation to lead your reader to the same source you used, so you need to provide enough detail to ensure you're both looking at the same source. So let's get on with this. I'm going to demonstrate the process of creating a citation through the use of a blank template. You may not always need to use a template, but it's very helpful to use it the first few times you create a citation until you become more comfortable with the process. Different types of blank templates are available on the library website and are linked in the video description. Instead of using a template, you can also simply write or type the core elements you need in the order given. As you create your citation, you will also want to have a guide handy, such as the library's MLA 8th edition guide or the Purdue Owl Guide, also linked in the description. These guides will explain in detail when to include each element and how to format it correctly. To demonstrate, I'm going to cite this online news article. The first two elements, author and title of source, you will have for almost any source you use. Notice that with each element, I need to format it to match MLA style. For example, the author needs to be entered with the last name first, a comma, then the first name, and middle name of given, then a period. Specific rules apply if there are multiple authors or if there is no author given. The guide will tell me what to do in each of those cases. Now I continue to the next element, which is title of source. I'll look at my guide for directions on how to format. Each principal word of the title is capitalized. And in this example, I put the title in quotation marks because I am citing an article, a small part of a larger work. Notice the period goes before the ending quotation mark. I'm going to continue working my way through each element and either entering relevant information or skipping elements that don't apply to the source. You can see I really need a guide to show me what each element is for and how to format those elements I do use. I've now entered all the relevant information. You can see here that I skipped many of these elements because they didn't apply to my source. Now, if you use the template, you can copy and paste the citation into your document. There you can correct spacing or other typos and change the paragraph formatting too. Now it's your turn to try. You can do this. With practice, MLA becomes easier and easier. And remember to go to your instructor, the writing center or the library for help in creating your citations.