These are chat archives for FreeCodeCamp/HelpFrontEnd

1st
Oct 2017
Moisés Man
@moigithub
Oct 01 2017 00:13
on first function reduce param probably the parameter name should be max instead of map
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:15
please, someone tell me why the menu is not working =/
https://codepen.io/arrudamt/pen/wgVYxv?editors=1100
korzo
@korzo
Oct 01 2017 00:26
@arrudamt Because logo is over menu button
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:28
@korzo how can i fix it?
korzo
@korzo
Oct 01 2017 00:30
@arrudamt In css on line 122 you have width 100%
Sean Pars
@SeanPars
Oct 01 2017 00:31
@korzo can u explain the paramters in the .reduce()
u r right it's an array of arrays tht's being passed in
korzo
@korzo
Oct 01 2017 00:32
@SeanPars First parameter is accumulator.
It's value returned from previous itteration
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:32
@korzo i took it off and it didnt work
korzo
@korzo
Oct 01 2017 00:33
Except for first iteration.
Then is accumulator either value passed as parameter or first element of array
@SeanPars second parameter is current element
Adel
@AdelMahjoub
Oct 01 2017 00:34
@arrudamt how it is not working, I tried and it is working, what is the expected behavior
korzo
@korzo
Oct 01 2017 00:34
@AdelMahjoub You can't click menu button
Adel
@AdelMahjoub
Oct 01 2017 00:35
ah the hamburger icon ?
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:36
@AdelMahjoub , the content doesnt hide
https://codepen.io/arrudamt/pen/wgVYxv?editors=1100
Adel
@AdelMahjoub
Oct 01 2017 00:36
@arrudamt hang on :ambulance:
Adel
@AdelMahjoub
Oct 01 2017 00:37
cool
@arrudamt , check @piteto link
Moisés Man
@moigithub
Oct 01 2017 00:38
lot easier for me when doing bootstrap menu.. is copy/paste then modify, cuz for sure u will start with a working menu
ie.. dont have 2 nav tags... or missing class names
korzo
@korzo
Oct 01 2017 00:38
@arrudamt Also you have display: block on line 130
piteto
@piteto
Oct 01 2017 00:39
There are still some HTML issues, but the navbar seems sorted now - had to revert back to bootstrap defaults. Not entirely sure what "fixed" it
Adel
@AdelMahjoub
Oct 01 2017 00:39
yes, I copy paste and modify it too
CallMeOrange
@EgnaroDev
Oct 01 2017 00:39
:walking:
Adel
@AdelMahjoub
Oct 01 2017 00:39
so it will work for sure lol
or bootstrap 3 code snippets
CallMeOrange
@EgnaroDev
Oct 01 2017 00:40
about @EgnaroDev
piteto
@piteto
Oct 01 2017 00:40
yeah, no one is going to memorize all of that :p
CamperBot
@camperbot
Oct 01 2017 00:40
:cookie: 552 | @egnarodev |http://www.freecodecamp.com/egnarodev
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:41
@AdelMahjoub @korzo @piteto thank you guys sooooo much!!!
CamperBot
@camperbot
Oct 01 2017 00:41
arrudamt sends brownie points to @adelmahjoub and @korzo and @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 173 | @piteto |http://www.freecodecamp.com/piteto
:cookie: 577 | @adelmahjoub |http://www.freecodecamp.com/adelmahjoub
:cookie: 563 | @korzo |http://www.freecodecamp.com/korzo
Maria Theresa Arruda
@arrudamt
Oct 01 2017 00:41
@piteto your code look such much more cleaner than mine! i'll take a time to "study" it and learn a bit =) thanks a lot again
CamperBot
@camperbot
Oct 01 2017 00:41
arrudamt sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
api offline
piteto
@piteto
Oct 01 2017 00:42
@arrudamt There is a menu in the upper, right-hand corner in codepen that will tidy your code.
It's all thanks to codepen
CallMeOrange
@EgnaroDev
Oct 01 2017 00:42
Yeah lol
Useful
Wish repl.it have that thing
:/
CallMeOrange
@EgnaroDev
Oct 01 2017 00:53
Okay...
:airplane:
you tried it!
@you-tried-it
Oct 01 2017 01:35
hi 4
Usman
@halohah
Oct 01 2017 04:11
Hey peeps, anybody have any recommended reading for JSON+APIs+AJAX. I have been learning on and off for a while and just got back to FCC. I kinda understand this stuff but am also pretty lost. Would appreciate any help! Note: I am on the intermediate front end dev projects atm
Gersho
@Gersho
Oct 01 2017 04:14
i don't have any lesson in mind sorry, but the most important idea in those type of function is that they are asynchronous
so you have to set up you code so that it "waits" for the server answer before moving on
Usman
@halohah
Oct 01 2017 04:16
@Gersho @heroiczero thanks! Also that link is AWESOME even outside of JS
CamperBot
@camperbot
Oct 01 2017 04:16
halohah sends brownie points to @gersho and @heroiczero :sparkles: :thumbsup: :sparkles:
:cookie: 487 | @gersho |http://www.freecodecamp.com/gersho
:star2: 1797 | @heroiczero |http://www.freecodecamp.com/heroiczero
Alexx Martínez
@AlexxMart
Oct 01 2017 04:22
I have a problem with the "Twitch TV" challenge
I have a key part figured out, but I need to add an event listener to toggle some classes
but none of my event listeners are working and I don't know why. Here's my code: https://codepen.io/Alexxander/pen/aLwamo
Ken Haduch
@khaduch
Oct 01 2017 04:23
@halohah - I saved a link to some YouTube video channel that has programming lessons, including one for APIs. I'll post it here if you want to have a look - maybe it will be a good intro?
Alexx Martínez
@AlexxMart
Oct 01 2017 04:23
I want to add an event listener to the "online" and "offline" buttons just to toggle some classes and it isn working
piteto
@piteto
Oct 01 2017 04:24
I don't see any code to add an event listener to those buttons
Ken Haduch
@khaduch
Oct 01 2017 04:24
@AlexxMart - maybe you have to save your COdePen project?
Gaurav khanna
@gomzk85
Oct 01 2017 04:25
Guys need one help i am a UI developer and i have an interview with microsoft in some days they have design round as one of the rpunds , as web developer what type of questions will be there in design round what to prepare and from where any links will be welcome(my work ex is 8+)?
Alexx Martínez
@AlexxMart
Oct 01 2017 04:26
@khaduch Still not working after saving the pen
Ken Haduch
@khaduch
Oct 01 2017 04:26
@AlexxMart - I clicked the "offline" button, and I got an alert? That was after reloading your page.
Alexx Martínez
@AlexxMart
Oct 01 2017 04:27
@khaduch I tried in "Incognito Mode" and it worked, I don't know what's wrong with this thing
@khaduch Thanks, I have no clue why is still not working on my pen
CamperBot
@camperbot
Oct 01 2017 04:28
alexxmart sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3327 | @khaduch |http://www.freecodecamp.com/khaduch
Alexx Martínez
@AlexxMart
Oct 01 2017 04:28
but at least is working in incognito, which is not helpful right now haha
Ken Haduch
@khaduch
Oct 01 2017 04:28
@AlexxMart - did you ever click the button "prevent this page from creating additional popups"? (Or whatever that says - the Opera browser doesn't show that button?)
@AlexxMart - try doing something other than an "alert" - maybe console.log or just generate some output to your page?
heroiczero
@heroiczero
Oct 01 2017 04:30
@AlexxMart Try to add a class that "display:none;" or "hides" the user
piteto
@piteto
Oct 01 2017 04:31
@heroiczero They're using jQuery, just use .hide()
$("#offline").click(function(){
  $('.offline').show();
  $('.online').hide();
})
Usually people add an offline or online class to each user's HTML @AlexxMart then hide/show users based on that
Gaurav khanna
@gomzk85
Oct 01 2017 04:32
Guys need one help i am a UI developer and i have an interview with microsoft in some days they have design round as one of the rpunds , as web developer what type of questions will be there in design round what to prepare and from where any links will be welcome(my work ex is 8+)?
piteto
@piteto
Oct 01 2017 04:32
@gomzk85 Let's say you have to create something you never thought was possible, what would you do?
How would you know your UI is designed well or not?
Gaurav khanna
@gomzk85
Oct 01 2017 04:35
@piteto i will do uat with some group of people also check how accessible it is for others
piteto
@piteto
Oct 01 2017 04:37
I think you have to stay focused on the customer - be honest, if you don't know the answer, tell them that, but talk about other times you didn't have all the information you needed and successfully delivered. Tell stories that show your experience
Alexx Martínez
@AlexxMart
Oct 01 2017 04:37
@piteto worked like a charm! Thank
CamperBot
@camperbot
Oct 01 2017 04:37
alexxmart sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 174 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Oct 01 2017 04:37
@AlexxMart Glad that helped :)
Gaurav khanna
@gomzk85
Oct 01 2017 04:40
@piteto can you give some idea where to how to tackle such problems or design questions
piteto
@piteto
Oct 01 2017 04:41
@gomzk85 "design" is very broad - can you be more specific on the type of technology you would work with?
web design, User Experience, c/c++
UI Development for native windows apps can be very different compared to web apps
@halohah For JSON APIs, they can be really scary at first. In the end though, it's all about working with JSON and accessing data. You use a method like getJSON, ajax, or fetch() and pull up a URL - it then gives you back JSON (data) in return that you can access to show on a page.
$.getJSON(url).then(function(data) {
  // request to URL complete! your JSON is in the data variable
});

$.ajax(url).then(function(data) {
  // request to URL complete! your JSON is in the data variable
});

fetch(url).then(res => res.json()).then(function(data) {
  // request to URL complete! your JSON is in the data variable
});

/***********
  if you get a cross origin error, use JSONP instead
***********/

$.getJSON(url + "?callback=?").then(function(data) {
  // request to URL complete! your JSON is in the data variable
  // if your URL already has a ? in it, use &callback=? instead.
});

$.ajax({
  url: url,
  dataType: 'jsonp'
}).then(function(data) {
  // request to URL complete! your JSON is in the data variable
});
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Oct 01 2017 06:25
@parthprakash1
Hi guys! Could anyone help me with this-
function numfunc() {
var cnum=rnum;
var rnum=Math.floor(Math.random()*20);
if (cnum===rnum){
numfunc()
}
console.log(rnum);
}
What I want to do is generate a random num but if its the same a s last one then I want to run it again
it refers to the function
Kris Baillargeon
@krisb1220
Oct 01 2017 06:50
hey guys - thoughts on my website's new design?
Long Nguyen
@longnt80
Oct 01 2017 06:55
@parthprakash1
var cnum;

function numfunc() {

    var rnum=Math.floor(Math.random() * (3 - 1) + 1);
    if (cnum===rnum){
        numfunc();
    }
    else {
        cnum=rnum;
    }

}
Kris Baillargeon
@krisb1220
Oct 01 2017 06:56
u forgot the ;
numfunc() ----- numfunc();
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Oct 01 2017 06:56
Yup thanks @krisb1220
CamperBot
@camperbot
Oct 01 2017 06:56
parthprakash1 sends brownie points to @krisb1220 :sparkles: :thumbsup: :sparkles:
:cookie: 254 | @krisb1220 |http://www.freecodecamp.com/krisb1220
Kris Baillargeon
@krisb1220
Oct 01 2017 06:57
np
Gaurav khanna
@gomzk85
Oct 01 2017 07:23
@piteto technology will be javascript experience i have is 8+ years UI development for web apps
Ian Gracia
@iangracia
Oct 01 2017 09:50
Can someone help me with the challenge "Everything Be True" ?
I don't understand the challenge
"Check if the predicate (second argument) is truthy on all elements of a collection (first argument)."
Ian Gracia
@iangracia
Oct 01 2017 10:06
nvm i solved it
Matej Bošnjak
@mbosnjak01
Oct 01 2017 12:16
I found get.JSON working really slow in comparison to standard jquery ajax call ... although I don't know why ... XD
Long Nguyen
@longnt80
Oct 01 2017 12:25
@mbosnjak01 it's just a shorthand, I can't see how it can be slower
linkin-park
@linkin-park
Oct 01 2017 13:42
hi
what is nvm , why its required ? @iangracia
CamperBot
@camperbot
Oct 01 2017 13:42
linkin-park sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 343 | @iangracia |http://www.freecodecamp.com/iangracia
dilaniat
@dilaniat
Oct 01 2017 14:14
Hey everyone, I need some help. I'm creating a web page for homework. I can only use html and css. I created a form for my contact page and centered the form using width: 0 auto;
but now when i display the page the form is behind the nav bar
Naveen Sharma
@naveencoder13
Oct 01 2017 14:14
dilaniat
@dilaniat
Oct 01 2017 14:20
@naveencoder13 It looks great. Did you use bootstrap? Can you help me with my problem I stated above?
Naveen Sharma
@naveencoder13
Oct 01 2017 14:26
@dilaniat first of all thanks for this appreciation and i am a newbie in this industry and this is my first project, so i can try tell me what you are trying to do?
CamperBot
@camperbot
Oct 01 2017 14:26
naveencoder13 sends brownie points to @dilaniat :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @dilaniat |http://www.freecodecamp.com/dilaniat
Moisés Man
@moigithub
Oct 01 2017 14:27
...probably u should also post a link to ur webpage, soo we can see what code u did which causes that behavior @dilaniat
else will be hard to guess....
maybe u have a fixed position navbar, since this make the nav "floating" all content hide below .. a solution is add some padding on top to ur component below
dilaniat
@dilaniat
Oct 01 2017 14:40
I'm using sublime text and all the files are on my flash drive. I can input the code onto codepen so you can see it but i don't think the images will show up since they live in a folder on my flash drive
I'll try to screenshot?
Marc
@MWBauer
Oct 01 2017 14:51
Is copyright a thing we need to worry about when making a portfolio?
dilaniat
@dilaniat
Oct 01 2017 15:18
here's my html....
image.png
and css...
image.png
when i created the form it was all the way to the left. i centered it by using margin:0 auto;
as you can see the form is now behind the nav
should I just use margin left to move the form over to the center instead?
Jorge
@OrangeKulture
Oct 01 2017 15:45
hows it going fellow campers
i guess chat is quite dead
alpox
@alpox
Oct 01 2017 16:01
@OrangeKulture Yea it gets less because the chat is not on the freecodecamp website anymore
Jorge
@OrangeKulture
Oct 01 2017 16:04
yeah we should probably start a revolution
Tom
@moT01
Oct 01 2017 16:33
hi
Bartek Lewandowski
@Jabarlew
Oct 01 2017 16:34
hello
Tom
@moT01
Oct 01 2017 16:57
@alpox so theyre pushing the use of the forum i suppose? and the chat rooms might slowly get more quiet - bummer
Amit Patel
@AmitP88
Oct 01 2017 17:06
hey guys, I'm refactoring my code and I'm running into an error "Cannot read property 'cell_x' of undefined" at line 36. I've read and inspected my code a few times, but I still can't see what's causing the error. Please, any help would be highly appreciated
https://codepen.io/AmitP88/pen/pWyaNY?editors=0010
Tom
@moT01
Oct 01 2017 17:19
try this.cell_x
maybe not
alpox
@alpox
Oct 01 2017 17:23
@moT01 yes exactly
Tom
@moT01
Oct 01 2017 17:24
maybe ill have to go complain
@AmitP88 i feel like there's two instances of cell x and y in there or something
is that intentional
maybe im wrong on that
Amit Patel
@AmitP88
Oct 01 2017 17:27
@moT01 oh, I resolved it. turns out I was trying to use an object key value pair to create another key value pair within the same object. I was told I couldn't do that while the object was still being made
@moT01 thanks for looking into it though, I really appreciate it :)
CamperBot
@camperbot
Oct 01 2017 17:28
amitp88 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 866 | @mot01 |http://www.freecodecamp.com/mot01
Linus
@nusli
Oct 01 2017 18:00
Hey guys I have a problem with my simon game: When the computer play it activates all the buttons at the same time. Is there a way to do this one after another besides using setTimeout()?
Tom
@moT01
Oct 01 2017 18:04
maybe if you share your code someone could find another way for you
set timeout is probly the way to go
but you might be able to put a css transition delay on it or something
Linus
@nusli
Oct 01 2017 18:11
@moT01
this is one version of it, might be a little messy atm. the important functions here are "activateSquare" and "activateSeries"
https://codepen.io/nusli/pen/MEvoJo
Tom
@moT01
Oct 01 2017 18:12
@nusli is it not working or are you just looking for another way
Linus
@nusli
Oct 01 2017 19:08
@moT01 i know that settimeout would work but im looking for another way. The code i posted isn't working
Ken Haduch
@khaduch
Oct 01 2017 19:21
@nusli - one problem is that the setTimeout calls that you make do not run sequentially, they would all run pretty much at the same time. You can add additional time to each subsequent invocation of setTimeout so that they would eventually fire at approximately the rate you are looking for. At least that's my guess at what is going on, without having too much time to delve into the operation of the code.
David Chen
@Obiwan777
Oct 01 2017 19:33
anyone familiar with php and mysqli stuff
Quilty Kim
@zebralight
Oct 01 2017 19:39
is anyone here familiar with using the google maps api with a framework like React or AngularJS, namely a way to consume it without the use of another script tag?
Linus
@nusli
Oct 01 2017 19:42
@khaduch i know. I was looking for another way of doing this. I thought of promises but obviously that's not working
piteto
@piteto
Oct 01 2017 20:08
@nusli your resolve() is firing immediately when activateSquare() is called - it needs to be called after the square finishes rotating
If you want a different approach though, it seems jQuery's .queue() method could work well here
http://api.jquery.com/queue/
  //function declarations
  function activateSquare(id) {
    return new Promise((resolve, reject) => {
      $("#" + id).addClass("square-rotate").delay(500).queue(function() {
        $(this).removeClass("square-rotate").dequeue();
        resolve();
      });
      sounds[id].play();
    });
  }
CXmanager
@CXmanager
Oct 01 2017 23:46
Hi all, I want to create a clickable header button at the top that will take you to a particular section. Can someone review the approach and comment why this is not working. https://codepen.io/CXmanager/pen/mwwxYq
Ken Haduch
@khaduch
Oct 01 2017 23:53
@CXmanager - a couple things that I see right off - your <div id=container> should be <div id="container"> But your button is working - either you fixed it since you posted the question, or the problem is that your content area is so small at this point that there isn't any scrolling that has to be done. If you shrink your rendered page area and click the "Portfolio" link, it will scroll the window up to show the portfolio section.
Tom
@moT01
Oct 01 2017 23:54
hey @khaduch
Ken Haduch
@khaduch
Oct 01 2017 23:59
@moT01 - howdy Tom!