IRC log of #novawebdev for Wednesday, 2023-06-21

*** shmohamud has quit (Ping timeout: 480 seconds)01:49
*** shmohamud has quit (Ping timeout: 480 seconds)04:32
*** shmohamud has quit (Ping timeout: 480 seconds)06:33
*** shmohamud has quit (Ping timeout: 480 seconds)10:35
*** sysadmin has quit (Ping timeout: 480 seconds)10:55
*** shmohamud has quit (Remote host closed the connection)12:51
scoopergood morning Sahnun12:52
shmohamudgood day scooper12:53
shmohamudI made a repo for you to clone for today's lesson12:53
shmohamudhttps://github.com/shmohamud/Nova_Web_Dev_Practice.git12:54
scooperOk thanks, will you paste the link here12:54
scooperSahnun12:55
scooperThis mean we will be using this repository for all of our work right???12:56
shmohamudGood question. I haven't decided yet. Should we?12:56
scooperyes12:56
scoopersince you are the creator12:56
scooperNo need to use the other one I created yesterday....12:57
shmohamudMy only concern is how will multiple people be able to push changes to my single repo?12:57
shmohamudIf you guys each forked the repo maybe that would work?12:59
scooperyes forking it will work13:00
scooperone more thing am I added as contributor???13:00
shmohamudwhat's your github handle? I'll add you now13:01
scooperSpencerscooper13:04
fkoikoiGood Morning shmohamud13:04
shmohamudgood day fkoikoi13:05
shmohamudwould you please fork this repo: https://github.com/shmohamud/Nova_Web_Dev_Practice.git13:05
fkoikoiokay13:05
shmohamudcan someone add "plan how to set up class/homework github" the agenda?13:06
fkoikoiokay13:07
fkoikoi!help13:07
LittleWebsterAvailable commands: !add, !agenda, !help, !remove13:07
fkoikoi!add How to setup Class/homework on github 13:09
LittleWebsterSuccess: "How to setup Class/homework on github" has been added to the agenda.13:09
fkoikoi!agenda13:09
LittleWebsterThis is the agenda for the next meeting:13:09
LittleWebsterDiscuss Summer schedule (10 min). (added by jelkner)13:09
LittleWebsterHow to setup Class/homework on github (added by fkoikoi)13:09
shmohamudawesome13:10
fkoikoithanks13:10
shmohamudlet me know when you both have forked the Nova_Web_Dev_Practice repo13:10
fkoikoiI have fork the repo13:10
scooperI have fork the account already and clone it on my computer13:11
shmohamudawesome13:11
shmohamudso regular expressions are important because sometimes we want to filter text by some character or pattern of characters13:11
shmohamudImagine if you're a data scientist. You want to find all the occurrences of a sentence that starts with a lower case letter. You can write a regular expression that checks if there is there is a period "." followed by a lower case letter.13:13
shmohamudregular expressions exist in most programming languages. Regular expressions are a way to match strings of texts. Whether it’s a particular character or pattern or characters.13:13
shmohamudWho can tell me what module we're using for regular expressions in python?13:14
scooperI m lost here when you say which module, I you talking about python?13:15
shmohamudyes, I'm talking about Python. The repo I shared, regular_expressions.py13:16
shmohamudcorrection: regex_practice.py13:16
scooperNO I m not too sure....13:17
scooperjust a guess "re"13:17
scooper\me spencer is talking with the supe13:18
scooperACTION spence is talking with the supe13:18
shmohamudcorrecy13:19
shmohamudcorrect scooper. re is the built-in package that supplies us the re module.13:20
fkoikoishmohamud13:22
fkoikoiWhat is a module and how can you know or identify the module?13:22
shmohamudA module is a set of code or functions with the.py extension. A library is a collection of related modules or packages. They are used by both programmers and developers13:23
shmohamudModules are imported. So the way to spot a module is when you see the "import" keyword13:23
scooperACTION back13:26
fkoikoithanks13:26
scooperI m here now13:26
shmohamudawesome. 13:26
fkoikoiI added you as collaborator to yesterday13:26
shmohamudToday's lesson is tough, I'm not good with regular expressions myself, usually I'll google them to figure out how to write them. So today, I want us to just get an overview of what they are and how they can be used13:27
shmohamuddo you both see the first match_string function?13:28
scooperfrom the assignment question or in here???13:30
shmohamudfrom the repo I shared13:30
shmohamudregex_practice.py13:31
scooperlet me check13:31
scooperI m only seeing regex_homework.py13:32
scooperall other string is comment13:33
shmohamudcheck under in_class directory13:33
scooperok13:33
shmohamudthere should be a regex_practice.py13:33
scooperlet me do that13:33
fkoikoi+113:34
fkoikoiI saw it13:34
scooperyou mean in this directory13:34
fkoikoiit's in the in_class directory13:35
scooperdid you just push it???13:35
shmohamudnope, it was pushed since yesterday night13:36
scooperforkWithSahnun/Nova_Web_Dev_Practice/homework13:36
scooperthis is my files path13:36
shmohamudoh, you forked the homework directory I think13:36
shmohamudI want you to fork Nova_Web_Dev_Practice itself13:37
scooperYes I forked Nova_Web13:37
shmohamudit should be in Nova_Web_Dev_Practice/in_class13:37
scooperooh13:38
scooperI saw13:38
shmohamudawesome13:38
scooperin_class is another subdirectory right??13:39
shmohamudyes13:39
scooperforkWithSahnun/Nova_Web_Dev_Practice/in_class13:39
scooperregex_practice.py13:39
shmohamudexactly13:40
scoopershould I open it???13:40
shmohamudso, I want you to read the first match_string and the comment and let me know when you're done.13:40
shmohamudYes, open it please.13:40
scooperI m done13:42
fkoikoi+113:43
shmohamudOk, notice where it has "^[a-zA-Z0-9_]+$"13:43
scooperyes13:43
shmohamudthat's the regular expression - it's telling the match function what to look for13:43
shmohamuda-z means all lowercase letters13:44
shmohamudA-Z means all uppercase letters13:44
shmohamud0-9 means all numbers13:44
shmohamudunderscore means all underscores13:44
shmohamudthe carrot at the beginning means: "Match the expression to its right at the start of the string"13:44
shmohamudas you can see, it's a bit confusing, because they're all bunched up in the brackets13:45
shmohamudthat's why I usually look them up, there are too many rules to remember them all without investing a lot of time13:45
shmohamudHere is a cheat sheet with regular expression terms in python: https://www.dataquest.io/wp-content/uploads/2019/03/python-regular-expressions-cheat-sheet.pdf13:46
shmohamudif you're curious, definitely look into the above and try to understand how the regex is working.13:46
shmohamudOk, so, please read match_string2 and let me know when you're done13:47
scooperfrom the link right???13:47
shmohamudno, from the regex_practice.py13:48
scooperooh ok13:48
fkoikoidone13:49
scooperI m done13:49
shmohamudok, notice the "ab*" is the regular expression here.13:51
shmohamudthe "a" says look for all "a" and the "b*" means one or more "b"13:51
fkoikoi+113:52
shmohamudfor match_string2 it will match whether the b comes first or the a comes first.13:53
shmohamudok match_string3, please read through13:54
scooperquestion before reading please13:55
shmohamudlet me know when you're done.13:55
shmohamudYes?13:55
scooperis the "r" representing a method or a regular expression. 2 you said b mean look for one or more right ??13:58
scooperis it because of the multiplication sign that why b is searching for more then one b in this expression???13:59
shmohamudthe "r" in the beginning is making sure that the string is being treated as a "raw string"14:00
shmohamudyes, the multiplication sign "*" means one or more14:01
scooperlastly can we address addition and dollars sign in the problem14:01
shmohamudI was mistaken about the "*" it matches 0 or more times14:02
shmohamudthe "+"14:02
shmohamud Greedily matches the expression to its left 114:02
shmohamudor more times.14:02
shmohamudthe 14:03
shmohamud| Matches the expression to its left at the14:03
shmohamudend of a string. It matches every such14:03
shmohamudinstance before each \n in the string14:03
shmohamud"$" sign 14:03
shmohamudreally good questions. I recommend looking at this: https://www.dataquest.io/wp-content/uploads/2019/03/python-regular-expressions-cheat-sheet.pdf14:04
scooperok14:06
scooperI m done with matching_string314:06
shmohamudfkoikoi?14:07
fkoikoiyes14:07
shmohamudok, now read the last one. Then, predict which ones of the test cases will fail14:08
shmohamudFinally, run the program.14:09
shmohamudI have to get going for the day - any questions before we call it a day?14:09
scooperyes14:10
scooperI ran the program14:10
scooperalready 14:10
shmohamudyes?14:12
scooper1 & 2 output is match and 3 & 4 output no match14:12
shmohamudyes14:13
scooperMy question is about function....14:13
scooperI wil place it in the repository14:13
shmohamudOk14:14
shmohamudAny last questions?14:14
scooperBut before I do that let me give you a hint14:14
scooperAccording to python for everybody function can be call from another function once it's defined???????14:15
shmohamudYes!14:15
scoopershmohamud14:19
scooperunfortunately I can not push to the repository14:20
scooperfatal: not a git repository (or any parent up to mount point /)14:20
scooperStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).14:20
shmohamudyeah, we're going to figure that out this weekend. My git skills aren't the best, so I'd like Jeff and additional input on how to best est this up14:20
scooperOh I deleted the repository I share with you yesterday14:21
scooperanyway should I paste it in here14:21
shmohamudplease do. I've got to run in about a minute but I'll check the logs before we meet tomorrow14:22
scooperthis will run 14:22
scooperef message () :14:22
scooper    print("Welcome to Novaweb Development")14:22
scooper    print("At Novaweb we believe in helping people learn how to code")14:22
scooperdef introduction () :14:22
scooper    message ()14:22
scooper    print("If you are highly interesting in coding enroll now!!")14:22
scooperintroduction ()14:22
shmohamudIt should. Have you tested it?14:23
scooperthis will not run if I called the last function in the first function14:23
scooperdef message () :14:23
scooper    introduction ()14:23
scooper    print("If you are highly interesting in coding enroll now!!")14:23
scoopermessage ()14:23
scooper    14:23
scooperdef introduction () :14:23
scooper    print("Welcome to Novaweb Development")14:23
scooper    print("At Novaweb we believe in helping people learn how to code")14:23
shmohamudif you call message() after you define introduction, let me know if that works14:25
scooperI send you two14:25
scooperthe first two function will work14:25
shmohamudI believe it's a Name Error because introduction is not defined at the time message is called14:25
scooperthe second two will not work at I switch thing around14:26
scooperit keep saying NameError" Introduction not defined14:26
shmohamudOk, so that makes sense. The function must be defined at the time it's called. So, the first two work because message is defined and then introduction is calledx14:26
shmohamudYes, because the function doesn't exist at the time it's called. Try moving the call to message to be below where introduction is defined and let me know what happens14:27
shmohamudOk I've got to go for the day, but try that and let me know tomorrow what happens14:28
scooperit work14:29
scooperbut that is a discussion for another day14:29
shmohamudawesome. Because it's defined.14:29
shmohamudYes, great job today guys, this is tough stuff so try the homework and we will work through it tomorrow14:29
shmohamudACTION logs off for the day14:29
*** shmohamud has quit (Remote host closed the connection)14:29
scooperThanks Sahnun14:29
scooperACTION logging out after learning a lot for Sahnun14:30
*** scooper has quit (Quit: Leaving)14:30
*** shmohamud has quit (Ping timeout: 480 seconds)14:38
*** tboimah has quit (Quit: Leaving)14:38
*** fkoikoi has quit (Ping timeout: 480 seconds)14:46
scooperHello Programmer, are you still here???15:39
*** scooper has quit (Quit: Leaving)15:53
*** shmohamud has quit (Remote host closed the connection)16:01
*** shmohamud has quit (Ping timeout: 480 seconds)17:17

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!