These are chat archives for FreeCodeCamp/Help

25th
Oct 2018
青青子衿
@ldama
Oct 25 2018 02:37
function mutation(arr) {
// 请把你的代码写在这里
for(var c=0;c<arr[1].length;c++){ arr[1]=arr[1].toLowerCase(); arr[0]=arr[0].toLowerCase(); // alert(arr[1]); if(arr[0].indexOf(arr[1].charAt(c))>-1){
}else{
return false;
}
return true;
}
}
mutation(["hello", "hey"]);
i wanna to ask why it return true;
image.png
image.png
i wanna to ask why it return true;
Claudio Restifo
@Marmiz
Oct 25 2018 03:01
@ldama formatted your code for readability:
function mutation(arr) {
  // 请把你的代码写在这里
  for (var c = 0; c < arr[1].length; c++) {
    arr[1] = arr[1].toLowerCase();
    arr[0] = arr[0].toLowerCase();
    alert(arr[1]);
    if (arr[0].indexOf(arr[1].charAt(c)) > -1) {
    } else {
      return false;
    }
    return true;
  }
}
Claudio Restifo
@Marmiz
Oct 25 2018 03:06
anyway your code is returning way too early :)
What happens is that you return and sto te execution at the first match (or non match), you are not really looping
青青子衿
@ldama
Oct 25 2018 03:36
thank you
i got it
but, how to ormatted code for readability:
Aditya
@ezioda004
Oct 25 2018 03:38
@ldama Press ctrl + shfit + m for markdown help.
Momozor
@momozor
Oct 25 2018 03:45
hmm
``` Nest your code in the middle ```
Claudio Restifo
@Marmiz
Oct 25 2018 04:09
@ldama also consider that having an empty if followed by an else may be a sign of a poor designed function..
I'm an advocate for "as long as it works.." but be mindful of this as well
Anand Potukuchi
@anandpotukchi
Oct 25 2018 04:10
Morning folks
Aditya
@ezioda004
Oct 25 2018 04:24
:sunny: :clock10:
Karma Drukpa
@coderkarma
Oct 25 2018 04:36
Good morning
Momozor
@momozor
Oct 25 2018 05:54
\o/
momozor @faraco sipping :coffee:
BuntyBru
@BuntyBru
Oct 25 2018 06:09
@Nirajn2311 text align did not worked for "John"
though i found a way
https://codepen.io/BuntyBru/pen/dgQYrY
Claudio Restifo
@Marmiz
Oct 25 2018 08:22
I was expecting a screaming goat
Henry
@GitHub-Henry
Oct 25 2018 08:29
no, just a flying bell
May Kittens Devour Your Soul
@diomed
Oct 25 2018 08:37
@faraco why light doesn't kill us? :cat:
Legzy27
@legzy27
Oct 25 2018 10:07
MongoDB and Mongoose - Install and Set Up Mongoose
cant get this to work.
Niraj Nandish
@Nirajn2311
Oct 25 2018 10:39
How does one get to know how good he is in js
Nicolas Ramirez
@kamatheuska
Oct 25 2018 10:53
@legzy27 are you having problems still?
Legzy27
@legzy27
Oct 25 2018 10:56
@kamatheuska Yes!! what do you do pls!! steps or instruction.
Nicolas Ramirez
@kamatheuska
Oct 25 2018 11:00
what machine are you usinf
Windows, Apple?
@legzy27
Legzy27
@legzy27
Oct 25 2018 11:02
@kamatheuska apple macbook.
are you following a tutorial?
Legzy27
@legzy27
Oct 25 2018 11:04
yes!!
Thanks for your help.
Nicolas Ramirez
@kamatheuska
Oct 25 2018 11:04
you could use brew too
sure!
Legzy27
@legzy27
Oct 25 2018 11:05
Im following freecodecamp.
Nicolas Ramirez
@kamatheuska
Oct 25 2018 11:06
ok cool!
why don't you try to follow those steps from the docs, and if you have any trouble just pm me or mention?
if you have brew, that would be the simplest way i believe @legzy27
Legzy27
@legzy27
Oct 25 2018 11:09
Thanks for your help.
BuntyBru
@BuntyBru
Oct 25 2018 11:10
which is the perfect way to handle event handling through checkboxes
?
apart from click
Nicolas Ramirez
@kamatheuska
Oct 25 2018 11:11
only god and lasagnas are perfect :P
@BuntyBru what do you mean exactly? like other ways to trigger an event on a checkbox?
BuntyBru
@BuntyBru
Oct 25 2018 12:06

@kamatheuska
there is a checkbox, and if i click on it
I get the data asscociated with it

Now the thing is
when i uncheck it , then also the function returns the data

I want the function to return data only once

May Kittens Devour Your Soul
@diomed
Oct 25 2018 12:39
@Nirajn2311 one takes tests and decides he's not good
that's how
btw. how is you with vue search
@kamatheuska make me vue search, you pizza hater
Niraj Nandish
@Nirajn2311
Oct 25 2018 12:42
@diomed what did you need axios for
May Kittens Devour Your Soul
@diomed
Oct 25 2018 12:43
@Nirajn2311 for some tables. why? do you know since today?
Niraj Nandish
@Nirajn2311
Oct 25 2018 12:43
Yeah, i know a bit today
so i thought that if i went through your code i might be able to understand and analyse
Eric Weiss
@eweiss17
Oct 25 2018 12:45
@BuntyBru how are you displaying the information?
May Kittens Devour Your Soul
@diomed
Oct 25 2018 12:45
gonna send you pm @Nirajn2311
BuntyBru
@BuntyBru
Oct 25 2018 12:45

@eweiss17

cleared the issue

Momozor
@momozor
Oct 25 2018 13:16

@diomed gosh...you are reading my articles now? xD

Anyway, thank you for doing so.

May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:26
@faraco only the ones that deem interesting to me :cat:
Momozor
@momozor
Oct 25 2018 13:44
:eyes:
May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:48
I want wumpus badly. oh god, oh god! plushieeeeee!!!!
Nicolas Ramirez
@kamatheuska
Oct 25 2018 13:48
@diomed I love pizza! :V; on the other hand, searching vue can be mangaed with a google search: vue
@BuntyBru Sorry, had to eat :)
May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:49
you forgot to mention pizza is perfect too
Nicolas Ramirez
@kamatheuska
Oct 25 2018 13:49
:O
sorry
haha
BuntyBru
@BuntyBru
Oct 25 2018 13:50
@kamatheuska no prob mate
May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:50
@Manish-Giri if you don't come to Croatia with one of these, I'm gonna denounce you :smirk_cat: :point_up: October 25, 2018 3:48 PM
Nicolas Ramirez
@kamatheuska
Oct 25 2018 13:51
I want to do a npm package
a full authentication suite, back and frontend. I want to be able to do something like npm install myAuth and then get it
any thoughs?
May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:53

any thoughs?

I like cheese

Momozor
@momozor
Oct 25 2018 13:58

any thoughs?

I like cheese

You're an odd looking cat..

Niraj Nandish
@Nirajn2311
Oct 25 2018 13:58
@faraco i like that profile pic of yours
May Kittens Devour Your Soul
@diomed
Oct 25 2018 13:59
@faraco I am :cat:boi now
Niraj Nandish
@Nirajn2311
Oct 25 2018 13:59
@faraco and @diomed on top of each other
Momozor
@momozor
Oct 25 2018 13:59
@Nirajn2311 Thank you :heart_eyes:
No..what
May Kittens Devour Your Soul
@diomed
Oct 25 2018 14:00
@faraco is fluffy
I pets
Momozor
@momozor
Oct 25 2018 14:03
:sweat_smile:
Nicolas Ramirez
@kamatheuska
Oct 25 2018 18:31
@diomed yo, kitty ki, you didn't tell me anything
May Kittens Devour Your Soul
@diomed
Oct 25 2018 18:32
@kamatheuska expert tells me you don't know vue :yum:
Nicolas Ramirez
@kamatheuska
Oct 25 2018 18:33
@diomed does experts need better things to research than me haha
but I have a lot to learn yes :)
May Kittens Devour Your Soul
@diomed
Oct 25 2018 18:33
unsure. your search didn't quite work :disappointed:
Nicolas Ramirez
@kamatheuska
Oct 25 2018 18:34
well, it works on my fork...
kamransagheir
@kamransagheir
Oct 25 2018 18:56
Can someone help me out with java
plz
Niraj Nandish
@Nirajn2311
Oct 25 2018 18:59
@Manish-Giri is the java expert here, ask him
kamransagheir
@kamransagheir
Oct 25 2018 19:02
@Manish-Giri I need help with an assignment that I'm working on. Will you be able to help me out please?
mstellaluna
@mstellaluna
Oct 25 2018 19:02
@kamransagheir you can ask the question but doesn't mean anyone online knows enough java to be able to help
kamransagheir
@kamransagheir
Oct 25 2018 19:02
It's like basics that I need help with
Kyle Holm
@thekholm80
Oct 25 2018 19:04
@mstellaluna is a java pro
mstellaluna
@mstellaluna
Oct 25 2018 19:04
@thekholm80 yea ok ..
@kamransagheir such as?
Kyle Holm
@thekholm80
Oct 25 2018 19:04
well, compared to me at least :smile:
mstellaluna
@mstellaluna
Oct 25 2018 19:05
@thekholm80 im just Manish's underling
Kyle Holm
@thekholm80
Oct 25 2018 19:06
i think we're all in is shadow in some ways lol
mstellaluna
@mstellaluna
Oct 25 2018 19:06
true dat
kamransagheir
@kamransagheir
Oct 25 2018 19:07
I'm working on snakes and ladders game and I have uml diagram for it. There is a method called SnLSquare that takes (int number) as a perimeter.
and Idk what to do with it
@mstellaluna
  1. Write the SnLSquare class. Test it until all unit tests pass.
     The format for the toString() method is: <number>
     <> means that it is a variable and you must substitute an actual value; don’t
    include the angle brackets in your string .
     Example: 1
     The landOn() method should simply return the square’s number
UML:
SnLSquare
-number:int
+SnLSquare(number:int)
+getNumber():int
+landOn():int
+toString():String
+equals(Object:o):boolean
My code so far:

public class SnLSquare {

private int number;
public SnLSquare(int number){


}

public int getNumber(){

    return this.number;

}

public int landOn(){

return this.number;
}


public String toString(){
    String s = new String ("");

}

public boolean equals(o Object){



}

}

Nicolas Ramirez
@kamatheuska
Oct 25 2018 19:09
@kamransagheir is that Java? :O :O
kamransagheir
@kamransagheir
Oct 25 2018 19:10
yeah it is
mstellaluna
@mstellaluna
Oct 25 2018 19:15
tbh im not sure
mstellaluna
@mstellaluna
Oct 25 2018 19:25
as per the UML is this class inheriting from another class?
landOn to me is a move type method, cuz your going to be landing on a specific square
kamransagheir
@kamransagheir
Oct 25 2018 19:36
@mstellaluna it is of :"has-a composition relationship"
Idk how to deal with the equals method
yeah! landOn just returns a number I used return this.number for it and it passed the test
but now, I'm stuck with equals method
mstellaluna
@mstellaluna
Oct 25 2018 19:41
okay so toString converts number to toString as its a reserved keyword like Arrays in .util has it to convert int arrays toString so they print properly rather than gibberish. So my assumption is that you need to take that string and probably use .equals() method to compare it with something
since you used the new keyword to create the string its no longer in the string pool so its the heap so yea you need to use .equals() you can no longer use ==
Cale Bybee
@calebybee
Oct 25 2018 19:43
Once @kamransagheir has their question answered, I’d love a bit of help concerning Github
mstellaluna
@mstellaluna
Oct 25 2018 19:44
what you need to compare.. no clue
kamransagheir
@kamransagheir
Oct 25 2018 19:45
I figured it out. I guess I was stressing out and couldn't really focus before. SO, for String, it was supposed to take the input number and convert it into string basically and the equals was used to check is 2 numbers that are being input are same or not along with the casting of the newly created object to the SnLSquare
Thanks @mstellaluna @mstellaluna :) :) :) :) :) Appreciate your help
mstellaluna
@mstellaluna
Oct 25 2018 19:46
anytime..
kamransagheir
@kamransagheir
Oct 25 2018 19:46
@mstellaluna :) :)
mstellaluna
@mstellaluna
Oct 25 2018 19:46
sorry its kinda hard with only a small piece of info to go on
@calebybee just ask your question if someone knows they can help
kamransagheir
@kamransagheir
Oct 25 2018 19:47
Yeah! Ik this the biggest problem we have with our prof thou. She is like that parent bird who throws their parents out and tell them either fly or die :P
I looked at the test code and kind of helped me as well as lectures :P
public void testEqualsNull() {
    SnLSquare instance = new SnLSquare(33);
    try {
        assertEquals(false, instance.equals(null));
    } catch (NullPointerException e) { 
        fail();
    }
}
@Test
public void testEqualsThis() {
    SnLSquare instance = new SnLSquare(33);
    assertEquals(true, instance.equals(instance));
}
@Test
public void testEqualsClassCast() {
    SnLSquare instance = new SnLSquare(33);
    Point p = new Point(3,5);
    try {
        assertEquals(false, instance.equals(p));
    } catch (ClassCastException e) { 
        fail();
    }
}
@Test
public void testEqualsTrue() {
    SnLSquare instance = new SnLSquare(33);
    SnLSquare other = new SnLSquare(33);
    assertEquals(true, instance.equals(other));
}
@Test
public void testEqualsFalse() {
    SnLSquare instance = new SnLSquare(33);
    SnLSquare other = new SnLSquare(34);
    assertEquals(false, instance.equals(other));
}
}
mstellaluna
@mstellaluna
Oct 25 2018 19:48
:thumbsup:
yozhikvtumane
@yozhikvtumane
Oct 25 2018 19:50
Hello!
How do I change the solution for a challenge on a settings page?
In "JavaScript Algorithms and Data Structures Projects"
Cale Bybee
@calebybee
Oct 25 2018 19:52
I’m trying to post my first project to Github. I’ve downloaded the app to my Mac, researched how to do it. GitHub website says you first need to access the terminal and call the file you want to upload, however each time I call the file path, it states it’s not found. Do I need to save my project to a specific place on my Mac?
In order to call it in Bash
Aditya
@ezioda004
Oct 25 2018 19:53
@yozhikvtumane Doesnt adding a new one in challenge page and passing it changes?
Ariel
@ArielLeslie
Oct 25 2018 19:54
What does it say is not found?
yozhikvtumane
@yozhikvtumane
Oct 25 2018 19:54
@ezioda004 no, this didn't help
Cale Bybee
@calebybee
Oct 25 2018 19:56
@ArielLeslie the file containing my project
Ariel
@ArielLeslie
Oct 25 2018 19:57
Sounds like you have the path to your project directory wrong.
Aditya
@ezioda004
Oct 25 2018 19:59
@yozhikvtumane Seems like there isnt a way to update that.
yozhikvtumane
@yozhikvtumane
Oct 25 2018 20:01
oh no
why?
it should be changed no matter what, look at this https://pastebin.com/L0j0Ls8W
=D
This is what I have now there
Aditya
@ezioda004
Oct 25 2018 20:06
@yozhikvtumane I understand, I have quite few abominations saved as solutions as well. Perhaps you can open an issue on github? Since we can update solutions for other certificates.
yozhikvtumane
@yozhikvtumane
Oct 25 2018 20:18
ok, will try maybe
Thanks!