These are chat archives for FreeCodeCamp/Help

13th
Oct 2017
Albert Cardona II
@daddycardona
Oct 13 2017 03:12
@dsoucie I am glad you got the help :)
Sean Clarke
@Seanland
Oct 13 2017 03:38
Are there issues with the Twitch API for FCC? The https://wind-bow.glitch.me/twitch-api/streams/ url?
Amit Patel
@AmitP88
Oct 13 2017 03:40
hey guys, I'm wroking on my tile swap function in my match 3 game and I need a little help. I've made an empty array called swap_container that will hold a max of two clicked tiles to be swapped. I'm now working on conditions that will exclude a tile from being added to the array if the 2nd clicked tile is: 1.) the same tile as the first one clicked, 2.) not immediately next to the 1st clicked tile in any direction (left, top, right, bottom). I'm having trouble getting the 2.) condition to work. Please, any help will be highly appreciated
https://codepen.io/AmitP88/pen/pWyaNY
Surya Singh
@surya4
Oct 13 2017 04:42
can someone please help me understand in autocomplete - whatever field i am selecting from li
is coming in body ui for few seconds before redirecting, how to get rid of that
var temples = ['abc', 'def','xyz'];
    // taking imput from keyup
    $('#input').keyup(function() {
        var input = $('#input').val();
        $('input#input').autocomplete("enable");
        $('input#input').autocomplete("search", input);
        $('li').addClass("list-group-item");
    });
    // using jqury-ui to get autocomplete for input
    $('input#input').autocomplete({
        max: 10,
        minLength: 0,
        source: temples,
        messages: {
            noResults: '',
            results: function() {}
        },
        autoFocus: true,
        select: function(event, ui) {
            $('.input_selected_value').val(ui.item.value);
            location.href = "/" + ui.item.value;
            event.preventDefault();
        },
        close: function(el) {
            el.target.value = '';
        }

    });
});
Andrei
@DrDrei
Oct 13 2017 05:16
Just a follow up. It's something in my app, I made a small test project and deployed to firebase with a quick sidenav and animation works fine.
SL0TR
@SL0TR
Oct 13 2017 07:04

Need help!
https://codepen.io/SL0TR/pen/aLjyJz?editors=0111

When I'm adding an attribute(id) with JavaScript on the canvas tag it isn't showing up.
But if it's put manually then it shows

The id shows up in console but the element isn't visible.
vito lee
@vitoi
Oct 13 2017 08:16
who can help me on setting font-size attribute of a paragraph in html?
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 08:36
@vitoi sure
something going wrong?
@SL0TR hey can you be more especific about what line or part of the code?
Ene Catalin
@EneCatalin
Oct 13 2017 09:15
@vitoi if it's a very specific one just give it an id or a class and edit it there
heroiczero
@heroiczero
Oct 13 2017 10:08
@thekholm80 @Manish-Giri @DarrenfJ TY for the cookies
CamperBot
@camperbot
Oct 13 2017 10:08
heroiczero sends brownie points to @thekholm80 and @manish-giri and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1506 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 2125 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6648 | @manish-giri |http://www.freecodecamp.com/manish-giri
Petterandre
@Petterandre
Oct 13 2017 10:30
Hey guys! My Simon finally works :D However, one last issue that I am running into. My reset button isn't working as it should. When I hit the Reset button, something is off. It suddenly thinks I am hitting the wrong buttons. https://codepen.io/ImNoroz/pen/YrNpmq?editors=0112
heroiczero
@heroiczero
Oct 13 2017 10:44
@Petterandre Hmmm... Reset button seems to be working. I think the annoying part is you can click when the computer is showing their sequence.
Stephen James
@sjames1958gm
Oct 13 2017 10:45
@Petterandre How do you mean the wrong buttons? like you are hitting the same button more than once?
@Petterandre When you hit start, you add click handlers for each button (every time you hit start)
so the second time it acts as if you hit each button twice, then if you start again three times.
I would move those out of the start handler, and have them only take action if the user is active
Petterandre
@Petterandre
Oct 13 2017 10:48
oh, Ill try that
and yes, heroiczero, Im using the honor system :p
that worked! Awesome
Adressing your point, heroic. I presume there is a way to disable the buttons as Simon does his thing_
?
Is there a way to remove "clickability" during simonDoes?
heroiczero
@heroiczero
Oct 13 2017 10:52
you could probably setTimeout before the click
give the player a Timeout so Simon can do his thing then the player can do their thing :)
Petterandre
@Petterandre
Oct 13 2017 10:57
I tried putting all the buttons into a setTimeout but that didn't seem to work. Wouldn't it be equally easy to just remove clickability until simonDoes is done? Basically just add $('#blue').click(false) ?
apparenly didnt work, haha
heroiczero
@heroiczero
Oct 13 2017 10:59
you could use conditional statement so a playerTurn=false; after the player takes his turn and playerTurn=true;after the computer takes his turn
Stephen James
@sjames1958gm
Oct 13 2017 11:04
@Petterandre This is what @heroiczero was meaning - just ignore the click when not player turn
    $("#blue").click(function() {
       if (!playerTurn) return;
      $("#blue").addClass("blueActive");
      audioBlue.play();
      playerSeq.push(1);

      setTimeout(function() {
        $("#blue").removeClass("blueActive");
      }, 250);
      checkCorrect();
    });
Petterandre
@Petterandre
Oct 13 2017 11:04
aah
There we go
It seems as though I can bruteforce it if I spam or time it very well, but that goes for all games :D
heroiczero
@heroiczero
Oct 13 2017 11:11
@daddycardona @sjames1958gm Well thanks for helping the community :)
CamperBot
@camperbot
Oct 13 2017 11:11
:cookie: 382 | @daddycardona |http://www.freecodecamp.com/daddycardona
heroiczero sends brownie points to @daddycardona and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8545 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Petterandre
@Petterandre
Oct 13 2017 11:11
Thank you both, @heroiczero and @sjames1958gm :D
CamperBot
@camperbot
Oct 13 2017 11:11
petterandre sends brownie points to @heroiczero and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1874 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 8546 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Oct 13 2017 11:12
@Petterandre :+1:
heroiczero
@heroiczero
Oct 13 2017 11:12
@tiagocorreiaalmeida TY for helping people in FCC :)
CamperBot
@camperbot
Oct 13 2017 11:12
heroiczero sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 392 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Petterandre
@Petterandre
Oct 13 2017 11:49
There is almost nothing in this life that gives me as much joy as improving or solving a piece of code
Chris Cullen
@123xylem
Oct 13 2017 12:23

Hey guys.. Can u help me get the title and caption to come up a few lines on this site?
https://www.rosalievillagebarber.com
So far Ive used inspect and copied the selector it shows me for the caption but the thing just wont move!
Heres my code so far:

#main-slider > div.bx-wrapper > div.bx-viewport > div > div:nth-child(1) > div.slider-caption{padding-top:-30rem;}

So can you get the title and caption to move up the page?
Cheers

Yaroslav
@YariPL
Oct 13 2017 13:27
hi everyone. Have a question about PHP. How much it really takes to learn basics => a little more than basics of PHP if to know basics of JS before? (yes.I know the answer depends on the person but..)
rscales02
@rscales02
Oct 13 2017 13:33
Can someone help me understand why this logic is totally wrong? seems like it should work but it goes completely fucking haywire on me... https://repl.it/M7Dj/16 ... at the very least it would be nice to know why js is estimating simple 2 decimal addition and subtraction...
here is with the comments as I was walking myself through it
gishy1
@gishy1
Oct 13 2017 13:41
image.png
hello world im stuck
trying to figure out what to do from here
Fabien SHAN
@X140hu4
Oct 13 2017 13:43
So can you explain to me what your code does?
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:47
@gishy1 wanna split by spaces?
gishy1
@gishy1
Oct 13 2017 13:47
@X140hu4 find the longest word in a string
@tiagocorreiaalmeida na bro
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:47
so?
what's the idea of your first var?
gishy1
@gishy1
Oct 13 2017 13:49
@tiagocorreiaalmeida ok bro first wanted to split them into strings in the array
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:49
you wanna split them by white spaces right?
you could do it like str.split(" ");
andit would split
rscales02
@rscales02
Oct 13 2017 13:49
@gishy1 since you have it split into an array, maybe sort your array by word length?
gishy1
@gishy1
Oct 13 2017 13:50
@rscales02 using sort ?
Fabien SHAN
@X140hu4
Oct 13 2017 13:51
@tiagocorreiaalmeida The var works with the regex so both str.split(" ") and str.split(/\s/) achieve the same result
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:51
I know
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:54
there's no need to sort he only needs ro return the biggest length
Fabien SHAN
@X140hu4
Oct 13 2017 13:57
@gishy1 You have a return in the loop. It is always going to stop there.
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 13:57
^
gishy1
@gishy1
Oct 13 2017 13:58
@X140hu4 ya i was trying to figure out how to check the length of one of the strings while running with a while loop
Fabien SHAN
@X140hu4
Oct 13 2017 13:59
use your browser's console with some lines in your code to ouput info: console.log(data);
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 14:00
your for as some mistakes
i > arr.length
and you set i = 0
gishy1
@gishy1
Oct 13 2017 14:10
@tiagocorreiaalmeida but 0 is the first postition no?
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 14:11
but you are saying i is bigger than the arr.length
I think you want to say to loop if i < arr.length
since you increment the i value at the end
gishy1
@gishy1
Oct 13 2017 14:16
@tiagocorreiaalmeida yes that part i understood but how about the i=o
i=0
?
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 14:18
you have to user var or let to delcare it
for(var i = 0; i < arr.length; i++)
rscales02
@rscales02
Oct 13 2017 14:37
sort by word length and the answer is the length of the first word in the array,
seems easier than a loop i think
grimthedeathdealer
@grimthedeathdealer
Oct 13 2017 15:03
how do i submit pics on this chat?
Stephen James
@sjames1958gm
Oct 13 2017 15:46
@grimthedeathdealer If you want to post code -
https://forum.freecodecamp.com/t/markdown-code-formatting/18391
rscales02
@rscales02
Oct 13 2017 15:59
@grimthedeathdealer drag and drop into the window
knight2
@knight2
Oct 13 2017 16:16
@thekholm80 6 more mongoose challenges to go till I am finished with this awful testing :D
Kyle Holm
@thekholm80
Oct 13 2017 16:40
@knight2 lol you can do it!
knight2
@knight2
Oct 13 2017 17:42
@thekholm80 SOOO CLOSE. I looked at the api and microservice projects. IT will probably take me less time to finish those than it did to get through this mongoose section XD
Darren
@DarrenfJ
Oct 13 2017 20:37
hi fCC
my usual kudos to those still helping people out...
thanks @thekholm80 @sjames1958gm @heroiczero @daddycardona @Manish-Giri
CamperBot
@camperbot
Oct 13 2017 20:40
darrenfj sends brownie points to @thekholm80 and @sjames1958gm and @heroiczero and @daddycardona and @manish-giri :sparkles: :thumbsup: :sparkles:
:cookie: 384 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 1507 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 8549 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1875 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 6649 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Oct 13 2017 20:42
thanks @khaduch @GitHub-Henry @Gersho
CamperBot
@camperbot
Oct 13 2017 20:42
darrenfj sends brownie points to @khaduch and @github-henry and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 387 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 3364 | @khaduch |http://www.freecodecamp.com/khaduch
:cookie: 538 | @gersho |http://www.freecodecamp.com/gersho
Darren
@DarrenfJ
Oct 13 2017 20:43

and @Manish-Giri that dark theme you posted? that stackoverflow?

such dark
much wow

Stephen James
@sjames1958gm
Oct 13 2017 20:48
@DarrenfJ :wave:
Kyle Holm
@thekholm80
Oct 13 2017 20:59
@DarrenfJ ty sir
CamperBot
@camperbot
Oct 13 2017 20:59
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2126 | @darrenfj |http://www.freecodecamp.com/darrenfj
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 21:00
@sjames1958gm have you worked with chartjs?
gishy1
@gishy1
Oct 13 2017 21:35
need help guys
image.png
dont know where to go from here
gishy1
@gishy1
Oct 13 2017 21:42
no takers @tiagocorreiaalmeida amigo?
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 21:49
in what can I help you @gishy1 ?
Henry
@GitHub-Henry
Oct 13 2017 22:28
@DarrenfJ hello, ty for the brownies
CamperBot
@camperbot
Oct 13 2017 22:28
github-henry sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2127 | @darrenfj |http://www.freecodecamp.com/darrenfj
Stephen James
@sjames1958gm
Oct 13 2017 22:31
@gishy1 Think about a non-code solution first, then think about putting it in code.
@tiagocorreiaalmeida I have only looked at it, not worked with it
Tiago Correia
@tiagocorreiaalmeida
Oct 13 2017 22:34
allready solved it ;)
getting some doubts with mongodb are you used with it?
Stephen James
@sjames1958gm
Oct 13 2017 22:36
@tiagocorreiaalmeida On and off.
Alex
@alexandrupintilei
Oct 13 2017 22:44
Anyone have an idee why Code:Blocks ,it dosent work proper and get blocked (ubuntu)?
knight2
@knight2
Oct 13 2017 23:29
@gishy1 Why are you not logging to console and just asking for help?
@gishy1 For this problem you can use .split()/.join() or .substring() and you'll need to use .toUpperCase()
@gishy1 do it piece by piece and log to console to check your progress. use https://jsbin.com/ or something for that. then copy paste back for your correct solution.