*** shmohamud has quit (Remote host closed the connection) | 01:06 | |
*** shmohamud has quit (Remote host closed the connection) | 01:21 | |
*** shmohamud has quit (Remote host closed the connection) | 05:13 | |
*** mulbah has quit (Remote host closed the connection) | 11:40 | |
*** mulbah has quit (Remote host closed the connection) | 12:18 | |
*** mulbah has quit (Remote host closed the connection) | 12:19 | |
mulbah | Good morning Mr. Cole | 13:00 |
---|---|---|
ubuntourist | Hi. | 13:00 |
mulbah | How are you doing today | 13:01 |
ubuntourist | Did your preferred candidate win the election? Last time I checked the vote counting had not finished yet. | 13:01 |
ubuntourist | (I read that there were "skirmishes" but not too much violence.) | 13:02 |
mulbah | Yeah everything things is going cool | 13:04 |
ubuntourist | I had a sore night. All of the bones I've broken seem to be hurting more. I break easily: My first bone break was at age 6, my most recent at age 55. | 13:04 |
mulbah | there is no violence | 13:04 |
ubuntourist | It's starting to make me sleepy and grumpy all the time. | 13:04 |
mulbah | so you will not be up long today | 13:05 |
ubuntourist | I think I read that the "favorite horse in the race" is the current president winning another term. | 13:05 |
ubuntourist | I don't know how long I'll be up. I have things to do that require daylight. But I'll probably try to get some daytime sleeping in. | 13:06 |
ubuntourist | Anyway... On to the hard stuff. Were you able to look at old notes about fields and field delimiters? Can you explain them now? | 13:07 |
mulbah | Mr. Cole I didn't email you this week | 13:10 |
ubuntourist | I do too much "telling" and not enough "asking". So, I will be trying to ask for more demonstrations of understanding. | 13:11 |
mulbah | the reason is I have been busy with family stuff and also my Graduation | 13:12 |
ubuntourist | Congratulations on graduation. And good luck with family stuff. | 13:13 |
mulbah | Alright! thanks | 13:14 |
ubuntourist | I shoul prepare better. Give me a second. I had an idea last night while staring at the walls. | 13:14 |
ubuntourist | I want to quickly find a good file for you to download and experiment with... | 13:14 |
ubuntourist | I think I found one. Click on | 13:18 |
ubuntourist | https://www.openintro.org/data/csv/cars.csv | 13:18 |
ubuntourist | And save the file. | 13:19 |
mulbah | done | 13:19 |
ubuntourist | OK. | 13:20 |
ubuntourist | Now, using nano, | 13:20 |
ubuntourist | No.... wait. | 13:20 |
ubuntourist | Using "most", look at the file. | 13:20 |
mulbah | should i tmate you | 13:21 |
ubuntourist | sure. | 13:21 |
mulbah | ssh KkYEudpNmT5YD2R8BrkyUfCur@lon1.tmate.io | 13:21 |
mulbah | done | 13:23 |
mulbah | should i use nano now | 13:24 |
ubuntourist | No. I don't want to change the file. And I found one that is a bit more like what I want. | 13:24 |
ubuntourist | q and "rm" that file. | 13:24 |
ubuntourist | get this one instead | 13:25 |
ubuntourist | https://www.openintro.org/data/csv/cars93.csv | 13:25 |
ubuntourist | most cars93.csv | 13:26 |
ubuntourist | OK. | 13:26 |
ubuntourist | So, just looking at it, can you get an idea of what the data means? Look at the very beginning ("T" for "top"). | 13:28 |
mulbah | no | 13:29 |
mulbah | idea | 13:29 |
ubuntourist | OK... I will not be able to see this next thing when you type it: I want you to open the file a different way. type q to quit, then | 13:30 |
ubuntourist | type: | 13:30 |
ubuntourist | localc cars93.csv | 13:30 |
mulbah | locate cars93.csv right | 13:31 |
ubuntourist | Nope. Good guess, but this time I didn't make a typing mistake. ;-) I really wanted "localc" | 13:31 |
mulbah | alright | 13:32 |
ubuntourist | Look at what it is showing, and think about it a minute. Try to remember it for a few minutes. | 13:33 |
ubuntourist | Not everything, just the basic information. | 13:34 |
ubuntourist | Hold a sec while I call it up on my computer also. | 13:34 |
ubuntourist | So. We were talking about "fileds" and "filed delimiters". Notice where the screen shows "fields". | 13:35 |
ubuntourist | Notice what is below it. | 13:35 |
ubuntourist | I also said that "field delimiters" are sometimes called "field separators". (Maybe I didn't say it that exact way, but | 13:37 |
ubuntourist | field delimiters, field separators, and field dividers all mean the same thing. | 13:38 |
ubuntourist | So. There is a section called "separator options" on your screen... | 13:39 |
ubuntourist | What can you tell me about what you see there? Wha options are selected? | 13:39 |
mulbah | there options that are selected are: | 13:41 |
mulbah | Tab, comma Semicolon | 13:41 |
ubuntourist | And just above that, there is one other thing marked. (Below separator options but above tab, comma, semicolon.) | 13:42 |
ubuntourist | (When you see a square, it is a "checkbox" and it means you can select zero, one or many of the options. | 13:44 |
ubuntourist | When you see circles, they are called "radio buttons" and you can only select one option. They are called "radio buttons" | 13:45 |
ubuntourist | because old car radios used to allow you to set up your favorite radio stations and assign each station to a button. If you pressed a button, | 13:46 |
ubuntourist | it would select that station and cause all the other buttonss to release and "pop out". You could only choose one button at a time.) | 13:47 |
ubuntourist | So, what are the radio button choices and what is selected? | 13:47 |
mulbah | you asking me Mr. Cole | 13:52 |
ubuntourist | Yep | 13:52 |
mulbah | to separate by tab, comma, semicolon, and other | 13:55 |
ubuntourist | OK. | 13:56 |
mulbah | if you click fixed width it will lose ship | 13:57 |
ubuntourist | Good. | 13:57 |
ubuntourist | For a moment, let's keep "fixed width" selected. | 13:57 |
ubuntourist | When you do that, the bottom of the screen loses the column lines and instead displays at the top: | 13:58 |
ubuntourist | 0.........10.........20.........30.......... | 13:59 |
ubuntourist | Move your mouse over that line but don't click. | 13:59 |
ubuntourist | Move the mouse left and right and notice what happens. | 14:00 |
ubuntourist | (And tell me what you see.) | 14:00 |
mulbah | a straight line appeared and follow the mouse every where it go | 14:01 |
mulbah | almost like a radio stuff | 14:02 |
ubuntourist | OK. now pick a spot where the line appears and click. Then do iit a second and third time in other locations. | 14:03 |
mulbah | done | 14:03 |
ubuntourist | You shold see very faintly, lines staying wherever you clicked. | 14:04 |
mulbah | sure | 14:05 |
mulbah | with a red dot | 14:05 |
ubuntourist | Nice. You've got a slightly better version of the Libre Office Calc (localc) than I do: My dots are not in color. | 14:06 |
ubuntourist | I like the color better.. I will need to upgrade (or see if there is a way to turn that on for my system). | 14:07 |
mulbah | I download the whole file using wget -r | 14:07 |
mulbah | that why | 14:07 |
ubuntourist | Nope. It is not the data file. It is the localc program putting in the red dots. The way you downloaded the file makes no difference. | 14:08 |
mulbah | Alright | 14:08 |
ubuntourist | The data file is just a plain text file. You could create one with nano. Maybe we'll do that next in a minute. | 14:08 |
ubuntourist | A "fixed width" field means that data is divided into columns (fields) based on widths not separators. So, | 14:09 |
ubuntourist | wherever you clicked will determine where the each line is broken into separate parts. | 14:10 |
ubuntourist | The places where you clicked won't look good: Sometimes words will be split in the middle with a line dividing the | 14:12 |
ubuntourist | word into two parts randomly. That means this data is NOT fixed width. Some lines are longer or shorter than others. | 14:12 |
ubuntourist | Switch back to "Separated by" and notice how the bottom section in white changes. | 14:13 |
ubuntourist | For now, just concentrate on lines 1 and 2. Don't worry about "Standard" that appears above the lines. | 14:14 |
ubuntourist | Switch slowly back and forth between "Fixed width" and "Separated by" and look at the data in white for lines 1 and 2. | 14:15 |
ubuntourist | First, we're going to do things wrong: When you feel like you see the differences, leave it set to "fixed width" and click the "OK" at the bottom. | 14:17 |
mulbah | done | 14:17 |
ubuntourist | OK. It should look like garbage. I mean, the spreadsheet that shows up does not make sense. | 14:18 |
ubuntourist | Close that (and if it asks you if you want to save, tell it "No".) | 14:18 |
mulbah | it open in liberoffice | 14:19 |
ubuntourist | Right, Libre Office Calc - the spreadsheet program. | 14:19 |
ubuntourist | This time, leave it as "separated by" and click "OK" | 14:19 |
ubuntourist | Notice how the data in the spreadsheet looks when "separated by" is chosen. | 14:20 |
ubuntourist | What can you tell me about the difference in appearance between the "fixed width" version and the "separated by" version? | 14:21 |
mulbah | the difference is everything was colse together when I click the "fixed width" and when I click the separated by and press okay it was separated | 14:25 |
ubuntourist | OK. Close Libre Office Calc and go back to "most cars93.csv" | 14:26 |
mulbah | done | 14:27 |
ubuntourist | A file name that ends with ".csv" is a Comma-Separated-Values (CSV) file. And it is exactly what it says it is: | 14:27 |
ubuntourist | values are separated by commas. | 14:27 |
ubuntourist | When you opened it with localc, and you chose "separated by" it meant that localc would separate each line | 14:28 |
ubuntourist | anywhere that a comma, a semicolon or a tab appeared. And it would remove the comma, semicolon or tab, leaving only | 14:29 |
ubuntourist | the values that appeared between them. | 14:29 |
ubuntourist | Each column was also referred to as a "field". | 14:30 |
ubuntourist | Fields are groups of consecutive letters or numbers that together make sense. | 14:31 |
ubuntourist | For example, this sentence is can be broken up into fields. | 14:31 |
ubuntourist | Tell me, in my previous line, what is the field separator? (What is the field separator in "For example, this sentence can be broken up into fields.") | 14:32 |
ubuntourist | And how many fields are there? (Hint: More than two.) | 14:33 |
ubuntourist | (Hint #2: We have another way to describe the fields in a sentence.) | 14:34 |
mulbah | 14:37 | |
ubuntourist | I think you answered correctly. It is a bit difficult to be sure. Either add quotes or use a different way to describe. | 14:39 |
ubuntourist | ACTION waits for a response... | 14:43 |
ubuntourist | ACTION worries that the network is failing... | 14:45 |
mulbah | response on what | 14:46 |
ubuntourist | What is the field separator and how many fields in "For example, this sentence can be broken up into fields." | 14:47 |
mulbah | there are two fields | 14:48 |
ubuntourist | I already said "Hint: There are more than two." and "Hint #2: We have another way to describe fields in a sentence.") | 14:49 |
mulbah | they are four | 14:50 |
ubuntourist | You're just guessing. | 14:50 |
mulbah | two quotation marks | 14:50 |
mulbah | one , | 14:51 |
mulbah | and one dot | 14:51 |
ubuntourist | Look at the cars93.csv in your terminal. You do not need to scroll. How many fields in each line of the cars93.csv and what is the field separator? | 14:51 |
ubuntourist | (Each line contains the same number of fields.) | 14:52 |
ubuntourist | How many fields in each line of the cars93.csv and what is the field separator? | 14:55 |
mulbah | there are five I'm seeing | 14:56 |
ubuntourist | Then you are still not understanding. When we looked at the file with "localc" it asked us which field separators we would accept. | 14:58 |
ubuntourist | It divided the file into fields based on which separators we allowed, that were in the file. The file is a CSV file... | 14:59 |
ubuntourist | It's 11:00. I'm calling it "quits" for today. Go back and read today's IRC log. Also, look back to several weeks ago | 15:00 |
ubuntourist | when we were talking about file ownership and file permissions, and we looked at /etc/passwd. We talked about fields | 15:00 |
ubuntourist | and field separators then. | 15:01 |
mulbah | Alright I will email you tomorrow on this and the cut command | 15:01 |
ubuntourist | And TAKE NOTES !!! You won't learn this stuff and remember it unless you have your own notes, in your own way describing | 15:01 |
ubuntourist | what I've said. Rewriting it and summarizing will either help you understand, or help you ask good questions when you don't | 15:02 |
ubuntourist | understand. If you're writing it down, and yout own words do not make sense to you, then it's time to ask for a better | 15:03 |
ubuntourist | explanation. | 15:03 |
ubuntourist | Good luck! I hope you'll find some time to experiment with this stuff. | 15:03 |
mulbah | Alright | 15:03 |
mulbah | Thanks for today | 15:03 |
ubuntourist | (We're working our way back to the cut command, but trying to understand what a field is and waht a field delimiter (field separator, field divider) is. | 15:04 |
ubuntourist | Bye! | 15:04 |
*** ubuntourist has quit (Quit: Leaving) | 15:05 | |
*** mulbah has quit (Remote host closed the connection) | 15:12 | |
*** mulbah has quit (Ping timeout: 480 seconds) | 15:50 | |
*** mulbah has quit (Remote host closed the connection) | 17:52 | |
*** mulbah has quit (Remote host closed the connection) | 18:11 | |
*** mulbah has quit (Remote host closed the connection) | 18:13 | |
*** mulbah has quit (Ping timeout: 480 seconds) | 18:26 | |
*** sysadmin_ has quit (None) | 20:00 | |
*** scooper has quit (Ping timeout: 480 seconds) | 20:05 | |
shmohamud | Hi Scooper | 20:12 |
shmohamud | Hi Scooper | 20:17 |
*** scooper has quit (Ping timeout: 480 seconds) | 20:19 | |
sysadmin | Hello Sahnun | 20:21 |
shmohamud | How's it going? | 20:22 |
scooper | Interesting every single day with js | 20:22 |
shmohamud | :D good to hear | 20:23 |
shmohamud | So, ready for today's lesson? | 20:23 |
scooper | yes | 20:24 |
shmohamud | Write me a function declaration that takes in two numbers, a and b, and logs out the multiplication of a*b | 20:24 |
shmohamud | Can you do that for me? | 20:24 |
scooper | yes | 20:24 |
shmohamud | think about the name of the function carefully | 20:25 |
scooper | ok | 20:25 |
scooper | const doingMath = function(a,b){ | 20:28 |
scooper | console.log(a*b) | 20:28 |
scooper | } | 20:28 |
scooper | doingMath(4,5); | 20:28 |
scooper | VM235:2 20 | 20:28 |
shmohamud | is that a function declaration or function expression> | 20:28 |
shmohamud | ? | 20:28 |
shmohamud | and can you think of a more specific function name? That's better than yesterday but it could be better | 20:29 |
scooper | wait | 20:29 |
scooper | let me get something clear here Sahnun | 20:29 |
scooper | if you declare a function with const or let with putting an equal sign is call a declaration right?? | 20:30 |
scooper | *without | 20:30 |
shmohamud | yes, without the equal sign, it's a function declaration. | 20:30 |
scooper | if you declare a function with const or let without putting an equal sign is call a function declaration right | 20:30 |
shmohamud | yes | 20:31 |
scooper | ok | 20:31 |
scooper | now I understand the it now | 20:31 |
shmohamud | ok, so rewrite the function as a function declaration and name it more specifically to what the function is diong | 20:31 |
scooper | function timingNumbers(a,b){ | 20:35 |
scooper | console.log(a*b) | 20:35 |
scooper | } | 20:35 |
scooper | timingNumbers(4,5); | 20:35 |
scooper | VM259:2 | 20:35 |
shmohamud | good, it's a function declaration | 20:36 |
shmohamud | why did you name it timingNumbers? | 20:36 |
scooper | according to your convention function should alway be name base on verb or what they are doing.... | 20:37 |
shmohamud | yes | 20:37 |
shmohamud | what does the function have to do with timing? Is there there something more specific that the function is doing? Think about the math | 20:38 |
scooper | first that was the name that came to my mind, secondly according to your instruction " I write a function that take two number and output the multiplication of a*b | 20:39 |
shmohamud | you should take your time naming functions, the name is important to make the code readable and maintainable | 20:40 |
scooper | a*b is a multiplication going on here, that is why I name the function timingNumbers | 20:40 |
shmohamud | correct, it's about multiplication! So why not name it multiply? | 20:41 |
scooper | ok recommendation accepted I will take my time naming function next time, but is there a problem with the function? | 20:41 |
shmohamud | there's no problem with the function, well done :) | 20:42 |
shmohamud | just the name | 20:42 |
shmohamud | Ok so write the same function as an arrow function | 20:42 |
scooper | ok | 20:42 |
*** shmohamud has quit (Remote host closed the connection) | 20:48 | |
scooper | const doMath =(a,b) => { | 20:49 |
scooper | console.log(a*b) | 20:49 |
scooper | 20:49 | |
scooper | } | 20:49 |
scooper | doMath(4,5); | 20:49 |
scooper | VM884:2 20 | 20:49 |
shmohamud | excellent | 20:49 |
scooper | the function name is ok??? | 20:50 |
shmohamud | what if you named it multiply, would that make it more readable? | 20:50 |
scooper | ok | 20:50 |
scooper | naming function with a suitable name for now will take time Sahnun | 20:50 |
shmohamud | doMath could mean addition, subtraction, multiplication, division, exponentiation, etc. so it's better to be a bit more specific | 20:50 |
scooper | ok | 20:51 |
shmohamud | I understand, I'm just pointing you in the right direction. It will take time to get used to naming functions properly | 20:51 |
shmohamud | do you want to move on to logical operators? | 20:52 |
scooper | const Multiply = (a,b) => { | 20:52 |
scooper | console.log(a*b) | 20:52 |
scooper | } | 20:52 |
scooper | Multiply(4,5); | 20:52 |
scooper | VM1027:2 20 | 20:52 |
scooper | yes | 20:52 |
scooper | let more to logical operator in JS | 20:52 |
shmohamud | start by declaring x = 5 | 20:52 |
scooper | yes let move to logical operator in JS | 20:53 |
scooper | as global variable or local variable??? | 20:53 |
shmohamud | just use let x = 5 | 20:53 |
scooper | ok | 20:54 |
scooper | I m done | 20:54 |
shmohamud | ok now write console.log(x == 5) | 20:54 |
shmohamud | what do you expect it to log? | 20:54 |
scooper | it will print out true | 20:55 |
shmohamud | yes, test it and let me know what you see | 20:55 |
scooper | true | 20:55 |
shmohamud | perfect | 20:55 |
scooper | let x = 5; | 20:55 |
scooper | console.log(x == 5); | 20:55 |
scooper | VM1130:2 true | 20:55 |
shmohamud | how about x == "5" | 20:55 |
shmohamud | what do you expect? | 20:56 |
scooper | true | 20:56 |
shmohamud | ok, try it and let me know | 20:56 |
scooper | console.log(x == '5'); | 20:57 |
scooper | VM1226:1 true | 20:57 |
shmohamud | perfect. the == means "loose equality" it doesn't check if the type is equal. So integer and string of 5 , '5' will return true | 20:57 |
shmohamud | now try x === "5" | 20:57 |
shmohamud | what do you expect? | 20:57 |
scooper | false | 20:57 |
shmohamud | yes | 20:58 |
shmohamud | try it and let me know | 20:58 |
scooper | ok | 20:58 |
sysadmin | sorry my internet strip | 21:02 |
shmohamud | no problem | 21:02 |
sysadmin | Are you still there Shmohamud???? | 21:04 |
shmohamud | yes | 21:04 |
*** scooper has quit (Ping timeout: 480 seconds) | 21:07 | |
shmohamud | Scooper I've got to get going. Can we continue Monday? | 21:07 |
scooper | Ok | 21:07 |
scooper | I appreciate today.... | 21:07 |
shmohamud | Do you have any questions before I sign off? | 21:08 |
scooper | Thanks for every step along the way | 21:08 |
scooper | yes | 21:08 |
shmohamud | You're welcome, it's my pleasure. Yes, let's hear your question | 21:08 |
scooper | I really need to understand in JS when to do function declaration and when to do both declaration and assignment of function | 21:09 |
shmohamud | There's not a big difference, so don't worry about it. I'm just making sure you understand the difference because you will see it done both ways in code you read | 21:10 |
shmohamud | They're both functions. One of them is a function expression, one is a function declaration. | 21:11 |
scooper | ok, please give me your feedback on the book when we resume monday | 21:11 |
shmohamud | Ok, I'll take a look this weekend | 21:13 |
shmohamud | Have a good weekend and see you tomorrow for the meeting | 21:13 |
*** shmohamud has quit (Remote host closed the connection) | 21:13 | |
*** scooper has quit (Quit: Leaving) | 21:37 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 23:22 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!