Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Lily Romano
    @Lilyheart
    LOL. We could just take turns :laughing: Well, I got the cold stuff away I think. Hopefully the rest can wait until I can move again .
    David Castner
    @davidjcastner
    Lily Romano
    @Lilyheart
    That makes me laugh every time I see it
    Jonathan Herman
    @lantech19446
    That's great
    I just have one question Dave, how bored were you when you found that video\
    David Castner
    @davidjcastner
    very, I've been struggling to focus after lunch at work today
    just ready to go home
    so I can write code at home lol
    Jonathan Herman
    @lantech19446
    yea but that's coding for you and probably far more interesting than what you're doing at work
    David Castner
    @davidjcastner
    correct!
    Jonathan Herman
    @lantech19446
    I'm having a terrible time focusing on anything, I really want to be able to understand what on earth you guys are talking about and actually begin doing something but my motivation level is so damn low I can't even tell you the last time I did something
    David Castner
    @davidjcastner
    I was feeling like that a week or two ago, i realized I was vegging out on my sofa too much instead of being productive. So I change my desk at home to be a standing desk (even though it looks ridiculous at my height), and just having to stand means I don't get into the habit of procrastinating. Really difficult ot get used to though, still have to take breaks
    Lily Romano
    @Lilyheart
    I wanna see this desk so bad. xD
    Jonathan Herman
    @lantech19446
    I think a lot of mine is from working so much, the good thing is by today my fast is kicking in and my energy level is peaking but I'm just so stressed out and on the move so much all the time that any time I get outside of work is time to relax
    David Castner
    @davidjcastner
    I'll take a picture when I get home
    Lily Romano
    @Lilyheart
    I just bought a Nutribullet RX so I can make soup too.
    Jonathan Herman
    @lantech19446
    lol Lily if you told me you were looking for a nutribullet I could have given you the base you would have just had to find some replacement cups for it. I got so fed up with it that I bought a ninja and then someone gave me another nutribullet and I stupidly said ok thinking I could sell it.
    Lily Romano
    @Lilyheart
    xD Probably not an RX tho. That's the one with the heat cycle. I have a midrange nutribullet already.
    Jonathan Herman
    @lantech19446
    o ok didn't realize it had a heat cycle most of the blenders that can make soup just spin fast enough to heat them
    Lily Romano
    @Lilyheart
    I believe that's what this one does actually xD But I don't think the lower powered Nutribullets can spin fast enough to get there (they are 600 & 900 and the RX is 1700 watt so big difference). The base is huge compared to the others.
    Jonathan Herman
    @lantech19446
    yea that's much higher, that actually competes with blendtec for power
    David Castner
    @davidjcastner
    @lily solve the java formatting problem yet, I think this might be the first question I put a bounty on for stackoverflow
    Matt Richards
    @mattjrichards
    hey guys
    David Castner
    @davidjcastner
    Hey Matt, how's it going?
    Matt Richards
    @mattjrichards
    It's going alright, I guess. Having trouble with Lesson #173.
    David Castner
    @davidjcastner
    what is lesson #173?
    Matt Richards
    @mattjrichards
    I think it's the way they have the directions worded. 3 other people were also having trouble with the same problem. The name of the lesson is "Stand in Line."
    Here is part of the instructions: Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
    David Castner
    @davidjcastner
    okay so it's asking you to use the array as a queue, do you understand the concept of a queue?
    Matt Richards
    @mattjrichards
    That is the section that I'm having trouble understanding. They don't elaborate enough on what they want you to do, given what I've learned in the previous lessons.
    yes

    I think I might have the first part right. ```
    function nextInLine(arr, item) {
    // Your code here
    arr.push(item);
    item.shift();
    return item; // Change this line
    }

    // Test Setup
    var testArr = [1,2,3,4,5];

    // Display Code
    console.log("Before: " + JSON.stringify(testArr));
    console.log(nextInLine(testArr, 6)); // Modify this line to test
    console.log("After: " + JSON.stringify(testArr));
    ```

    David Castner
    @davidjcastner
    Okay it's asking you to take the input item and add it to the end of the array, then remove the first element (shifting all other element as well) and returning the first element (what was the first element)
    Matt Richards
    @mattjrichards
    That's what I don't get. What is the first element?
    David Castner
    @davidjcastner
    for their test array, 1 is the first element
    for example
    var testArr = [1,2,3,4,5];
    console.log(nextInLine(testArr, 6)); // prints 1, what the first element was
    console.log(testArr); // testArr is now [2,3,4,5,6]
    Hint: shift is an array method that removes the first element and returns it
    David Castner
    @davidjcastner
    let me know if you're still having trouble
    Matt Richards
    @mattjrichards
    sorry buddy, I'm just slow
    David Castner
    @davidjcastner
    haha no worries, is there something in particular that you are still not understanding?
    Matt Richards
    @mattjrichards
    I'm trying to figure out how to ask my question so that it makes sense to you, but I'm having trouble finding the words.
    David Castner
    @davidjcastner
    alright i'll be back in a moment
    Matt Richards
    @mattjrichards
    ok
    Matt Richards
    @mattjrichards
    In this sentence, "Add the number to the end of the array, then remove the first element of array.", when they say "array" are they referring to var testArr = [1,2,3,4,5]; or are they referring to arr in function nextInLine(arr, item) { ?
    David Castner
    @davidjcastner
    ahh okay, they are referring to both. When you pass testArr to the function nextInLine (such as nextInLine(testArr, 6)), the variable arr inside the function represents the same array as the variable testArr. Inside the function they only want you to change that array that the variable arr represents so that any array can be used as input (when calling nextInLine with testArr as the input, it will change the variable testArr as well).
    Matt Richards
    @mattjrichards
    Ok. Let me let that sink in for a bit. I'm trying to visualize all this in my head, but arr and testArr are tripping me up.
    David Castner
    @davidjcastner
    It is important to think of variables are references to objects, but not the actual object. For example, the array [1,2,3,4,5] might reside somewhere inside your computer's memory, and the variable testArr simply points to the memory. Reassigning the variable (such as testArr = "something_else") is like pointing to different part of memory, but the actual array might still reside in memory, maybe with another variable pointing to it.
    var arrayHolderOne = [1,2,3,4];
    var arrayHolderTwo = null;
    arrayHolderTwo = arrayHolderOne;
    // arrayHolderTwo now points to the same array as arrayHolderOne
    
    arrayHolderOne.push(5); // this is adding 5 to the array that arrayHolderOne is pointing to.
    console.log(arrayHolderOne); // <-- [1,2,3,4,5]
    // even though I didn't directly manipulate the variable arrayHolderTwo,
    // the array that arrayHolderTwo points to is the same as a arrayHolderOne
    // therefore arrayHolderTwo also equals [1,2,3,4,5]
    console.log(arrayHolderTwo); // <- [1,2,3,4,5]
    Lily Romano
    @Lilyheart
    Man, I go out to grab dinner cuz I'm having a bad brain day and come back to so much chatter! :heartpulse:
    imma look at that code now David.
    Matt Richards
    @mattjrichards
    Ok. I'm still a bit confused. If "arr" and "testArr" are the same thing, or point to the same thing, I would think there would have to be a line like this somewhere in the code: var arr = testArr; or var arr = [1,2,3,4,5];But there isn't. Its like they put arr in there, but it's not assigned to anything. They want me to "remove the first element of array", so I would think that code would have to look like this: ```
    var arr = [1,2,3,4,5];