These are chat archives for FreeCodeCamp/HelpFrontEnd

2nd
Sep 2017
Rafael Monroy
@rafaelmonroy
Sep 02 2017 00:01
@longnt80 @gothamknight ah man, gotta run, I'll check it out at computer at home. thanks! brb
CamperBot
@camperbot
Sep 02 2017 00:01
rafaelmonroy sends brownie points to @longnt80 and @gothamknight :sparkles: :thumbsup: :sparkles:
:warning: rafaelmonroy already gave gothamknight points
:cookie: 541 | @longnt80 |http://www.freecodecamp.com/longnt80
Siddarth Krishnan
@siddarthk123
Sep 02 2017 00:29
can someone
tell me how to solve the roman numeral converter problem?
can someone
tell me how to solve
the roman numeral converter
problem
please?
Tom
@moT01
Sep 02 2017 00:40
start at the number and work down to zero
if number > 1000 { answer += "M" number -= 1000 }
@siddarthk123
Rafael Monroy
@rafaelmonroy
Sep 02 2017 00:46
@gothamknight @longnt80 ok I see the object data in the google chrome console (was working off safari earlier) how come it wont show on codepen console?
Long Nguyen
@longnt80
Sep 02 2017 00:51
@rafaelmonroy not all console is the same
devtool is the best out there
Henry
@GitHub-Henry
Sep 02 2017 01:12
@rafaelmonroy if you play around with it, you can use chrome dev tools with codepen
Refath
@Refath
Sep 02 2017 01:16
Can someone
help me wth my JS?
Tom
@moT01
Sep 02 2017 01:17
@Refath whats up
Refath
@Refath
Sep 02 2017 01:18
So the problem is that
in my pen, when you go down to Speed (in settings), and put like 3s, the animation-duration property will change to 3s, but the visual rotation of the wheel doesn't change until after 30s (default animation-duration). What I want is for the animation-duration to change, and the visual rotation to change accordingly immediately after the user clicks done.
Unfortunately, I'm kind of stumped on how to go on about this.
Here is the CodePen link. https://codepen.io/Refath/pen/yoZxMr
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:20
so my timer starts glitching after the session time has counted.....
https://codepen.io/Kowalatam/pen/LjqJmW
Refath
@Refath
Sep 02 2017 01:21
Any help is appreciated, guys
Tom
@moT01
Sep 02 2017 01:21
@Refath i thought i tried helping you earlier? did what i suggested not work?
Refath
@Refath
Sep 02 2017 01:22
@moT01 Wrapping the jQuery in one document window function?
Tom
@moT01
Sep 02 2017 01:22
changing the duration in .parent in the css
Refath
@Refath
Sep 02 2017 01:23
Right, but I'm not changing the duration via css, I'm doing it in jQuery
$(".parent").css("animation-duration", newimg);
newimg, by the way, is whatever the new number of seconds the animation duration is (user input)
Tom
@moT01
Sep 02 2017 01:24
probly cause the animation is already in progress and has to finish
Refath
@Refath
Sep 02 2017 01:26
Exactly
Tom
@moT01
Sep 02 2017 01:26
@Kowalatam dont forget to clear those intervals
Refath
@Refath
Sep 02 2017 01:26
But how can I like, disrupt the animation immediately, do you know?
Thanks for helping, BTW
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:27
@moT01 when i did the clearInterval tini.. it was still glitching..
i can give it one more go and see...
Tom
@moT01
Sep 02 2017 01:30
@Refath no i dont know off hand, you should really properly indent your code before you ask for help. What lines?
Refath
@Refath
Sep 02 2017 01:31
@moT01
$(".speedtext").keyup(function() { var newimg = $(this).val(); $(".parent").css("animation-duration", newimg); $(".speedSave").click(function() { $(".speedChange").html(newimg); }); });
Tom
@moT01
Sep 02 2017 01:32
top left on the keyboard
Refath
@Refath
Sep 02 2017 01:32
@moT01 I don't understand?
Tom
@moT01
Sep 02 2017 01:32
three of those, on their own line
`
'
different things
Refath
@Refath
Sep 02 2017 01:32
Oh, ok! Thanks
$(".speedtext").keyup(function() { var newimg = $(this).val(); $(".parent").css("animation-duration", newimg); $(".speedSave").click(function() { $(".speedChange").html(newimg); }); });
Tom
@moT01
Sep 02 2017 01:35
on their own line, three ' then hit shift+enter then your code then shift+enter and then three more '
Refath
@Refath
Sep 02 2017 01:37
$(".speedtext").keyup(function() { var newimg = $(this).val(); $(".parent").css("animation-duration", newimg); $(".speedSave").click(function() { $(".speedChange").html(newimg); }); });
Wow, nice!
So, thoughts?
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:39
im probably not using it well but it kinda made it worst ...
Tom
@moT01
Sep 02 2017 01:39
i got nothin
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:39
i guess thats what happens when i assume a project is going to be easy .. :)
Refath
@Refath
Sep 02 2017 01:39
OK Thx
Tom
@moT01
Sep 02 2017 01:39
no, im taking a look
but yea, im not sure, i dont think its as easy as you would think
i skimmed over this if you want to read it https://css-tricks.com/restart-css-animation/
Refath
@Refath
Sep 02 2017 01:40
Thanks for the link @moT01! Let me check it out
CamperBot
@camperbot
Sep 02 2017 01:40
refath sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 833 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Sep 02 2017 01:43
@Kowalatam yea, if you ever go start to finish on a project without any hiccups let me know, ill send some real cookies
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:44
@moT01 oh c'mon.. i actually enjoy hiccups... i find it frustrating and weirdly fun lol
if there is a project like that.. i probably won't do it.. will it for boring peeps lol :)
Tom
@moT01
Sep 02 2017 01:45
that's where you learn
im checking how i did it
you need to like set the interval to a variable name and then clear it
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:46
ohh i see..
i was setting the variable name to the main function ...
i'm so smart :)
@moT01 works well now.. thank u
CamperBot
@camperbot
Sep 02 2017 01:51
kowalatam sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 834 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Sep 02 2017 01:53
one other thing you might run into is hitting your start button when an interval is already running
Elizabeth Paul
@Kowalatam
Sep 02 2017 01:58
ahhh.. i seee.. witchcraft ... lol ...
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:15
can anyone tell me why this code will change my fahrentheit to celcius but not back to fahrenheit
$('#btn').on('click', function (){
          if ($weather.text(fahrenheit+' F')){
            $weather.text(celcius+' C');
          } else if ($weather.text(celcius+' C')){
            $weather.text(fahrenheit+' F');
          }
        })
Tom
@moT01
Sep 02 2017 02:18
is the variable named $weather?
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:19
yeah i set var $weather = $('#weather')
it turns it from F to C but not back
Tom
@moT01
Sep 02 2017 02:19
got a pen?
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:20
@moT01 i was having trouble with that so am trying a different approach lol but was wondering if this was the reason it wasnt working
Roxroy
@roxroy
Sep 02 2017 02:20
@rafaelmonroy , for the on click handle, check if the last char of the '$weather.text' is F or C. Then use it to switch the text
Tom
@moT01
Sep 02 2017 02:22
maybe some more code to show?
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:26
@moT01 @roxroy i commented out the second approach for now lol here is the pen running the code i had questions about https://codepen.io/rafaelmonroy/pen/BdMyeb
the reason I am trying to second approach is because I shouldnt be running a click function inside my success function, maybe thats the reason its not working? @roxroy @moT01
Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:31
Tom M
can someone help me
can someone
get on skype
and help me with the roman numeral challenge?
please?
Tom
@moT01
Sep 02 2017 02:32
i gave you a hint earlier
Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:33
Tom
Tom
@moT01
Sep 02 2017 02:33
@rafaelmonroy im taking a look, its not finding my location, so im trying to put my lat/long in the url
Roxroy
@roxroy
Sep 02 2017 02:33

@rafaelmonroy . you can create a variable outside the click handler
let showCelcius = false;
in the handler put

         showCelcius = !showCelcius;    
          if (showCelcius){
            $weather.text(celcius+' C');
          } else {
            $weather.text(fahrenheit+' F');
          }

This will toggle the temp unit

Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:33
Tom m
can we chat on skype?
Tom
@moT01
Sep 02 2017 02:33
no
Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:33
wait
so
if the number is larger than
1000
then print M
Tom
@moT01
Sep 02 2017 02:33
yup
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:33
@moT01 really? not showing your location? thats weird
Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:34
what if the number
reaches
a three digit number?
williamsb
@williamsb
Sep 02 2017 02:34
you have to enable geolocation in your browser
Tom
@moT01
Sep 02 2017 02:36
@siddarthk123 there should be a link in the challenge description on how roman numerals work
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:36
@roxroy nice! that worked! thanks bro
CamperBot
@camperbot
Sep 02 2017 02:36
rafaelmonroy sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:star2: 1132 | @roxroy |http://www.freecodecamp.com/roxroy
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:37
@moT01 kinda sucks tho because I dont really understand it lol
@roxroy do you know why my original code wasnt working>
Tom
@moT01
Sep 02 2017 02:38
@williamsb showing me its enabled
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:39
@moT01 it worked in my computer at work and computer at home, also in my cell phone at the store, is there a bug in my code?
Tom
@moT01
Sep 02 2017 02:39
no, that's something on my end
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:41
does anyone know what a ! before a variable mean?
williamsb
@williamsb
Sep 02 2017 02:42
returns the opposite of a boolean
so !true equals to false, !false equals to true
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:43
ohh ok @williamsb thanks
CamperBot
@camperbot
Sep 02 2017 02:43
rafaelmonroy sends brownie points to @williamsb :sparkles: :thumbsup: :sparkles:
:cookie: 46 | @williamsb |http://www.freecodecamp.com/williamsb
williamsb
@williamsb
Sep 02 2017 02:49
@rafaelmonroy '.text(content)' sets content while '.text()' returns the content value. so you would have to do '$weather.text() === (fahrenheit+" F")' and the same for celcius
Siddarth Krishnan
@siddarthk123
Sep 02 2017 02:49
can someone
help me with the roman numeral
converter
?
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:50
@williamsb alright let me see if i can get it to work, thanks again!
CamperBot
@camperbot
Sep 02 2017 02:50
rafaelmonroy sends brownie points to @williamsb :sparkles: :thumbsup: :sparkles:
:warning: rafaelmonroy already gave williamsb points
williamsb
@williamsb
Sep 02 2017 02:51
@rafaelmonroy okay lmk, i got it to work on my end
Tom
@moT01
Sep 02 2017 02:52
@siddarthk123 start with the number and work your way down to zero, maybe use a while loop
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:53
@williamsb YES! WOOOOO brroooo i knew i was close! lmao, got it to work
Tom
@moT01
Sep 02 2017 02:53
while (number > 0) {
  if (number > 1000) {
      answer += "M"
      number -= 1000; 
   }
....
....
}
williamsb
@williamsb
Sep 02 2017 02:54
@rafaelmonroy awesome
Rafael Monroy
@rafaelmonroy
Sep 02 2017 02:55
@williamsb quick question, is it bad coding technique to write the click handler inside my success function?
Refath
@Refath
Sep 02 2017 02:57
I need some help, folks
Tom
@moT01
Sep 02 2017 02:57
more than 4 hours? call a doctor
Refath
@Refath
Sep 02 2017 02:58
My pen, when I see it on debug mode, it's background image doesn't fit the body
williamsb
@williamsb
Sep 02 2017 03:00
@rafaelmonroy I don't see a problem with it (i could be wrong though)
Rafael Monroy
@rafaelmonroy
Sep 02 2017 03:02
@williamsb lol alright thanks man, I guess I’ll get feedback when I submit the final pen
CamperBot
@camperbot
Sep 02 2017 03:02
rafaelmonroy sends brownie points to @williamsb :sparkles: :thumbsup: :sparkles:
:warning: rafaelmonroy already gave williamsb points
Refath
@Refath
Sep 02 2017 03:03
@moT01 Thx
CamperBot
@camperbot
Sep 02 2017 03:03
refath sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 835 | @mot01 |http://www.freecodecamp.com/mot01
Refath
@Refath
Sep 02 2017 03:03
Worked
williamsb
@williamsb
Sep 02 2017 03:04
@rafaelmonroy np
Henry
@GitHub-Henry
Sep 02 2017 03:37
@rafaelmonroy just a heads up, I don't think feedback is provided to submitted projects, at least based on my experience.
williamsb
@williamsb
Sep 02 2017 03:39
@GitHub-Henry lol i was wondering about that I've submitted some and never received feedback
Henry
@GitHub-Henry
Sep 02 2017 03:41
I'm guessing it's an honor system kind of thing around here. So if you say it's done, then it's done. I haven't found anything to indicate otherwise.
Rafael Monroy
@rafaelmonroy
Sep 02 2017 03:47
@GitHub-Henry @williamsb guess its because I post it on my city’s facebook group, one of the admins always replies with suggestions, guess its not really code camplol
mstellaluna
@mstellaluna
Sep 02 2017 03:47
@rafaelmonroy Feedback isn't provided when you submit projects, they are verified for academic dishonesty. If you wish to have feedback you can post the link to your project in the codeReview room or in the main freecodecamp room.
Rafael Monroy
@rafaelmonroy
Sep 02 2017 03:48
@mstellaluna oh cool thats a good idea too, ill get the double the feedback lol
mstellaluna
@mstellaluna
Sep 02 2017 03:48
:)
Henry
@GitHub-Henry
Sep 02 2017 03:49
@mstellaluna what does 'verified for academic dishonesty' mean?
mstellaluna
@mstellaluna
Sep 02 2017 03:49
@GitHub-Henry it means they check to make sure you either a) did copy/paste the FCC example code or b) steal another camper's project and claim it as yours
williamsb
@williamsb
Sep 02 2017 03:51
@mstellaluna is this only for projects that are FCC related?
mstellaluna
@mstellaluna
Sep 02 2017 03:52
@williamsb yes
williamsb
@williamsb
Sep 02 2017 03:52
@mstellaluna ah okay
Henry
@GitHub-Henry
Sep 02 2017 03:53
@mstellaluna who is the 'they' that does this academic dishonesty check?
mstellaluna
@mstellaluna
Sep 02 2017 03:53
@GitHub-Henry FCC staff
sometimes cheating does get reported in to a moderator, the moderator checks out the claim, if its true, the moderator reports the cheating to the FCC staff
Henry
@GitHub-Henry
Sep 02 2017 03:57
@mstellaluna so if one does not copy another's work, is submitted work verified to meet minimum requirements before it is considered complete?
mstellaluna
@mstellaluna
Sep 02 2017 03:58
@GitHub-Henry i believe they are, i dont verify the projects.
Henry
@GitHub-Henry
Sep 02 2017 04:01
@mstellaluna just wondering, cuz i've looked at submitted work that didn't work properly (calculators for example), and it was considered complete. I've seen it enough times, I really wondered how it passed a verification check. So, are you pullling my leg about a verification check?
mstellaluna
@mstellaluna
Sep 02 2017 04:02
@GitHub-Henry as i said, i dont verify them... i believe they are
Henry
@GitHub-Henry
Sep 02 2017 04:02
@mstellaluna and you believe they are because?
mstellaluna
@mstellaluna
Sep 02 2017 04:03
@GitHub-Henry why wouldnt they be?
Henry
@GitHub-Henry
Sep 02 2017 04:04
@mstellaluna is there a policy page somewhere that indicates who and how this is supposed to be done?
when looking at completed work it really does make me question this verification claim you make
Rafael Monroy
@rafaelmonroy
Sep 02 2017 04:06
mstellaluna
@mstellaluna
Sep 02 2017 04:06
Henry
@GitHub-Henry
Sep 02 2017 04:09
@rafaelmonroy @mstellaluna thank you, what about verification of projects. as mentioned earlier. i've seen enough 'completed' work that makes me wonder how the project could be considered complete, since it didn't work (I am thinking of the 'completed' calculator projects that had flaws but were still marked as complete.
CamperBot
@camperbot
Sep 02 2017 04:09
github-henry sends brownie points to @rafaelmonroy and @mstellaluna :sparkles: :thumbsup: :sparkles:
:cookie: 269 | @rafaelmonroy |http://www.freecodecamp.com/rafaelmonroy
:cookie: 750 | @mstellaluna |http://www.freecodecamp.com/mstellaluna
mstellaluna
@mstellaluna
Sep 02 2017 04:10
@GitHub-Henry as the page says you can send an email to the FCC team and they can respond to your concerns
just be aware they get alot of email so expect a delay
Henry
@GitHub-Henry
Sep 02 2017 04:13
@mstellaluna the way i see it, is if someone wants to claim that a flawed project is complete, and that person is satisfied with it, and fcc is satisfied with it, and a potential employer is satisfied with it, who am i to say otherwise. but the claim of fcc verifying projects really is questionable in my mind, since i've seen enough projects to make me question it.
mstellaluna
@mstellaluna
Sep 02 2017 04:14
@GitHub-Henry that's your opinion and you have a right to it. Have a great evening Henry
Henry
@GitHub-Henry
Sep 02 2017 04:18
@mstellaluna thanks for your input and the academic honesty link, btw, is there a verification policy page. i'd appreciate the opportunity to review that policy.
CamperBot
@camperbot
Sep 02 2017 04:18
github-henry sends brownie points to @mstellaluna :sparkles: :thumbsup: :sparkles:
:warning: github-henry already gave mstellaluna points
mstellaluna
@mstellaluna
Sep 02 2017 04:21
@GitHub-Henry you know im not sure, you can either ask in the Contributors room, the FCC staff and Quincy Larson are sometimes in there, they might know https://gitter.im/FreeCodeCamp/Contributors just be aware this room isn't very active .. i believe there is an equivalent also on the forum ... or send an email to the team@freecodecamp.org to find out if there is one available
Henry
@GitHub-Henry
Sep 02 2017 04:22
@mstellaluna appreciate your input
mstellaluna
@mstellaluna
Sep 02 2017 04:22
:)
@GitHub-Henry you can post in there and tag quincy, when he's available he will eventually answer
the chat contributors room
Refath
@Refath
Sep 02 2017 05:16
Hi people
On my website, I have all my files linked, but the layout of the page is messed up. https://refath.github.io/Niva/
Any help is appreciated
David
@deitcode
Sep 02 2017 05:33
Hey everyone, I've just been putting the finishing touches on my Random Quote Machine for the intermediate projects of front-end cert. I built it locally on my machine and then copied and pasted everything into CodePen where I'm getting a little bit of extra height on the content of my twitter and new quote buttons. The height is perfect on my local copy though. Would anybody have any idea why this is happening? https://codepen.io/deitcode/pen/BdpGpo
Wow it looks pretty bad in there. I tried to build it without bootstrap and haven't really done any responsive design work on it yet. I've mostly been looking at it full screen, oops :(
piteto
@piteto
Sep 02 2017 05:38
@deitcode You'll probably need to right-click -> view source and compare to know for sure. This CSS fixes it for me:
.buttonbar {
  width: 100%;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  line-height: 1em;
}
David
@deitcode
Sep 02 2017 05:43
woah that works. I guess codepen was doing something weird with line-height inheritance or something. thanks @piteto
CamperBot
@camperbot
Sep 02 2017 05:43
deitcode sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 41 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 02 2017 05:44
I've been staring way too long at this....can anyone help me debug why I get a horizontal scrollbar in bootstrap's small breakpoint? It kicks in around 577px wide when the search results are shown. https://codepen.io/anon/pen/OjdBvK?editors=0010
Glad I could help @deitcode
Rafael Monroy
@rafaelmonroy
Sep 02 2017 05:55
hey guys, finally finished my weather app! thanks to all of you that helped along the way, i learned A LOT creating this one, it was a lot fun too. I’ll leave the pen here just incase anyone wants to check the weather lol https://codepen.io/rafaelmonroy/pen/BdMyeb/
Henry
@GitHub-Henry
Sep 02 2017 06:08
nice job @rafaelmonroy
Rafael Monroy
@rafaelmonroy
Sep 02 2017 06:09
@GitHub-Henry thanks
CamperBot
@camperbot
Sep 02 2017 06:09
rafaelmonroy sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 354 | @github-henry |http://www.freecodecamp.com/github-henry
heroiczero
@heroiczero
Sep 02 2017 06:13
@rafaelmonroy nice job on the Weather App works as expected
Henry
@GitHub-Henry
Sep 02 2017 06:14
@piteto I don't get a horizontal scroll bar. when i go below 577 px area the input bar gets larger, but no horizontal scroll bar in my browser.
David
@deitcode
Sep 02 2017 06:15
@GitHub-Henry the scrollbar appears after you do a search
piteto
@piteto
Sep 02 2017 06:16
I'm seeing it between roughly 577px -> 768px
Henry
@GitHub-Henry
Sep 02 2017 06:18
@piteto @deitcode ok, in my browser after i do a search, after the results start to get covered by the browser (chrome in my case) then the browser adds the scroll bar. I think this is the browser's way of indicating that there is stuff that the browser is covering which may be seen by using the scroll bar. If this is the case, then this is ok. What do you think?
piteto
@piteto
Sep 02 2017 06:20
I'd like to prevent it if I can @GitHub-Henry very odd that only happens in the sm breakpoint of bootstrap, so I'm leaning toward something in their CSS. Mine is kind of minimal
Henry
@GitHub-Henry
Sep 02 2017 06:21
I think there is a stop default browser action js command that could be used, to stop the browsers default action.
piteto
@piteto
Sep 02 2017 06:21
As soon as the browser width goes below around 768px, the content jumps to the left
Then the scroll bar appears
Henry
@GitHub-Henry
Sep 02 2017 06:21
i'd search 'stop default horizontal scroll bar chrome'
David
@deitcode
Sep 02 2017 06:22
@piteto when the scrollbar appears, the content jumps to the right for me
piteto
@piteto
Sep 02 2017 06:22
I can use overflow hidden, but I'd prefer to fix the issue rather than hide it
Same here @deitcode
Henry
@GitHub-Henry
Sep 02 2017 06:27
@piteto @deitcode Perhaps this can help
The link provides a few solutions
It's a start
piteto
@piteto
Sep 02 2017 06:29

This fixes it in the debugger:

@media (min-width: 576px)
.container {
  max-width: 720px;
}

But it won't apply the settings when I add it to my css

The card-columns are overflowing their .container at that one breakpoint
Henry
@GitHub-Henry
Sep 02 2017 06:32
@piteto when overridding boot strap stuff i've found it better to use id because of css specificity
piteto
@piteto
Sep 02 2017 06:33
I try to use the same class name and make sure my CSS loads after bootstrap
prakash chandra yadav
@prakashyadav008
Sep 02 2017 06:34
hello everyone
Henry
@GitHub-Henry
Sep 02 2017 06:34
@piteto try adding an id to the container, then use the id, really try it. do you understand specificity. if you do, then you why to use id.
prakash chandra yadav
@prakashyadav008
Sep 02 2017 06:34
heres my wikipedia project
plz suggest changes if any
heroiczero
@heroiczero
Sep 02 2017 06:36
@prakashyadav008 Your search button seems out of line other than that good job :+1:
Henry
@GitHub-Henry
Sep 02 2017 06:36
@piteto your example uses a class .container
piteto
@piteto
Sep 02 2017 06:38
This works just fine for overriding, but gives different results in the debugger for some reason:
@media (min-width: 576px) {
  .container {
    max-width: 720px;
  }
}
heroiczero
@heroiczero
Sep 02 2017 06:39
Henry
@GitHub-Henry
Sep 02 2017 06:40
@heroiczero i prefer to avoid bootstrap also, so css grid or flex would be the way I go
piteto
@piteto
Sep 02 2017 06:41
If only everyone would upgrade their browsers so we could use it
Henry
@GitHub-Henry
Sep 02 2017 06:42
@piteto they have
piteto
@piteto
Sep 02 2017 06:42
Yeah, CSS grid is broken for 1 out of every 3 browsers :)
That's flexbox, which I'm currently using, CSS grid has lower support numbers
Henry
@GitHub-Henry
Sep 02 2017 06:43
@piteto virtually everyone supports flexbox, that's why i use it
Henry
@GitHub-Henry
Sep 02 2017 06:43
that's also why i don't use css grid
gotta use what's supported, unless you want head aches
css grid is almost there
heroiczero
@heroiczero
Sep 02 2017 06:45
It will eventually be supported.
Henry
@GitHub-Henry
Sep 02 2017 06:46
should learn it, cuz it's going to be supported
Jan Shah
@JanShah
Sep 02 2017 06:53
@piteto opera mini is the only browser not currently supporting grid
piteto
@piteto
Sep 02 2017 06:55
@JanShah It's the versions of the browsers people are using that cause the problems. People need to update.
71% of browsers in use support css grid
Henry
@GitHub-Henry
Sep 02 2017 06:58
@piteto CSS specificity is the reason I suggested you use an ID over a class or pseudo-class. You may want to consider this.
the link shows a pseudo class is the same as a class, please look at the link to see the specificity
root is no better than a class
that's why i provided the link for you to see for yourself
you might want to review css specificity
@JanShah not everyone upgrades, i have friend still using iphone 4
cuz it's smaller
Jan Shah
@JanShah
Sep 02 2017 07:03
@GitHub-Henry tell me about it, I've still got iphone 3 and an old windows phone
Santiago Chopitea
@raka26
Sep 02 2017 07:32
Guys i use ajax to upload imgs with php and after the request my page url goes like +++++++++++++++++fileTo
Im using method=post. But whats the difference between type and method?
Adeel Salim
@adeelsalim
Sep 02 2017 07:42

HI! Everyone can anyone look at this and help met why dont i see the hamburger on mobile view although when i move the cursor thier it changes to pointer and even works fine but i cant see the humburger

https://codepen.io/adeelsalim/pen/WEPYPM

Jan Shah
@JanShah
Sep 02 2017 08:04
@adeelsalim
 <div style="z-index:10"class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">
          </span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </div>

//css
.icon-bar {
  background:blue; //choose color
}
I'm not sure why the icon bars aren't already coloured.
Adeel Salim
@adeelsalim
Sep 02 2017 08:08
@JanShah Thanks alot mate
CamperBot
@camperbot
Sep 02 2017 08:08
adeelsalim sends brownie points to @janshah :sparkles: :thumbsup: :sparkles:
:cookie: 506 | @janshah |http://www.freecodecamp.com/janshah
iso
@iso1048
Sep 02 2017 08:09
Hi. Is anyone available to help with an issue related to the textarea tag?
Jan Shah
@JanShah
Sep 02 2017 08:10
also, if you add navbar-fixed-top to <nav class="navbar navbar-clean it will stop the scrollbars from appearing but you'll need a background for the open menu
@adeelsalim
Adeel Salim
@adeelsalim
Sep 02 2017 08:19
@JanShah background for the open menu? how can i get that
ok i get it
Jan Shah
@JanShah
Sep 02 2017 08:23
@adeelsalim
.navbar-nav {
  background:grey;
}
.navbar-nav > .active {
  background:green;
}
.navbar-nav > li {
  background:blue;
}
Adeel Salim
@adeelsalim
Sep 02 2017 08:24
thanks alot @JanShah
CamperBot
@camperbot
Sep 02 2017 08:24
adeelsalim sends brownie points to @janshah :sparkles: :thumbsup: :sparkles:
:warning: adeelsalim already gave janshah points
Jan Shah
@JanShah
Sep 02 2017 08:25
@adeelsalim no worries, looks good :)
Adeel Salim
@adeelsalim
Sep 02 2017 08:27
what if only want it to give the background color when i toggle the hamburger menu.. otherwise remains transparent
LiciniusRex
@hashtagyolo1
Sep 02 2017 09:17
good morning happy campers!
I was hoping someone could help me work out why my buttons and search don't align with the rest of the site
LiciniusRex
@hashtagyolo1
Sep 02 2017 09:23
I should say, why they aren't correctly centered
Utsav Kafley
@chopedada
Sep 02 2017 09:27
@hashtagyolo1 You site is correcty centered. Its just that you have an element that is not visible on the page itself. If you use developer tools and use the inspect tool it would show you the element and its properties.
LiciniusRex
@hashtagyolo1
Sep 02 2017 09:30
thanks @chopedada , I'll get that fixed now
CamperBot
@camperbot
Sep 02 2017 09:30
hashtagyolo1 sends brownie points to @chopedada :sparkles: :thumbsup: :sparkles:
:warning: @chopedada's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
Utsav Kafley
@chopedada
Sep 02 2017 09:31
@hastagyolo1 You have provided the #centreLine div with a width of 600px. But the two buttons and searchbar only take about 380px of the whole area and the rest is blank space that the div occupies. I would create a class for the three elements and then center them instead.
LiciniusRex
@hashtagyolo1
Sep 02 2017 09:38
thanks @chopedada , that fixed it. I'd tried that with the wrapper div already rather than seperating them into their own divs.
CamperBot
@camperbot
Sep 02 2017 09:38
hashtagyolo1 sends brownie points to @chopedada :sparkles: :thumbsup: :sparkles:
:cookie: 204 | @chopedada |http://www.freecodecamp.com/chopedada
LiciniusRex
@hashtagyolo1
Sep 02 2017 09:39
Much obbliged :D
Emmanuel Sucilan
@HeartOfKings
Sep 02 2017 10:20
hi guys.!! glad to be back :)
Vishal Sholkay
@sholkay
Sep 02 2017 10:37
Anyone online I need help with my assignment
Ken Haduch
@khaduch
Sep 02 2017 10:49
@sholkay - what's up?
There is a .gif file inside this rar and i have also attached HTML and CSS files in it .. I want my site to look like .gif file
I am not able to apply @media queries please help me with that only ?
I am not familiar with @media queries .. so help me with that in it
Jan Shah
@JanShah
Sep 02 2017 10:52
@sholkay better off posting your code in codepen and then asking.
Ken Haduch
@khaduch
Sep 02 2017 10:53
@sholkay - yes, can you just post an image of the project, and code in CodePen? You can paste an image in here.
Vishal Sholkay
@sholkay
Sep 02 2017 10:53
I'll post the code in codepen :)
Ken Haduch
@khaduch
Sep 02 2017 10:53
great
dinesh
@1532j0004kg
Sep 02 2017 11:22
$.getJSON("/json/cats.json", function(json) {
$(".message").html(JSON.stringify(json));
});
can u plz explain this guys..
stingify(json)==>in this json is from where?
/json/cats.json is what?
Henry
@GitHub-Henry
Sep 02 2017 11:41
@1532j0004kg /json/cats.json should be a folder called jsonwith a file called cats.json
dinesh
@1532j0004kg
Sep 02 2017 11:41
where we can find this
Henry
@GitHub-Henry
Sep 02 2017 11:42
based on the code the folder json should be located in the same folder as the javascript file
dinesh
@1532j0004kg
Sep 02 2017 11:43
stingify(json)==>in this json is from where?
i can able to use another name replace of json ?
or what is json
Henry
@GitHub-Henry
Sep 02 2017 11:44
in this case, stringify(json) it appears that json should be a variable
dinesh
@1532j0004kg
Sep 02 2017 11:45
i can able to use the another name for replace of json?
Long Nguyen
@longnt80
Sep 02 2017 11:46
@1532j0004kg yes
Henry
@GitHub-Henry
Sep 02 2017 11:46
@1532j0004kg what @longnt80 said
dinesh
@1532j0004kg
Sep 02 2017 11:47
i can able to use the another name for replace of json
Henry
@GitHub-Henry
Sep 02 2017 11:48
@1532j0004kg you really need to understand what you are doing before you start making that kind of a change, based on your questions, you might want to do that first
dinesh
@1532j0004kg
Sep 02 2017 11:48
$.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?",function(val){

  var quote = "";

  quote = val.quoteText;

 $(".quotess").html(quote); 
in this how the quotetext refers the original quotetext?
Henry
@GitHub-Henry
Sep 02 2017 11:52
@1532j0004kg I gotta go now, good luck
dinesh
@1532j0004kg
Sep 02 2017 11:52
or how quotext refers the original quote?
@GitHub-Henry thanks
CamperBot
@camperbot
Sep 02 2017 11:52
1532j0004kg sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 355 | @github-henry |http://www.freecodecamp.com/github-henry
Elizabeth Paul
@Kowalatam
Sep 02 2017 11:56

@1532j0004kg yeah.. that looks like it.. it doesnt work ?

in this how the quotetext refers the original quotetext?

dinesh
@1532j0004kg
Sep 02 2017 11:57
it is working
Elizabeth Paul
@Kowalatam
Sep 02 2017 11:59
ok.. then what was the question ?
dinesh
@1532j0004kg
Sep 02 2017 11:59
quotetext is what?
shall u give the learning api links?
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:02
quotetext is the property that hold the Quote which is the property value..
dinesh
@1532j0004kg
Sep 02 2017 12:02
okok....
do u know any simple api links for learning..
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:03
i don't know any links.. but there is nothing that is not on youtube...
:)
dinesh
@1532j0004kg
Sep 02 2017 12:03
lol...
ok where u learned the api...
i think the question i asked are all in api...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:04
right here ... which means i probably should do personal reading reading on it..
when i had to use it for wikipedia
i asked around here and read some of the stuff in the forum
dinesh
@1532j0004kg
Sep 02 2017 12:05
i didn't use the links to learn api...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:07
just did a google search and its showing a bunch of things...
dinesh
@1532j0004kg
Sep 02 2017 12:07
okie...
thanks @Kowalatam
CamperBot
@camperbot
Sep 02 2017 12:08
1532j0004kg sends brownie points to @kowalatam :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @kowalatam |http://www.freecodecamp.com/kowalatam
dinesh
@1532j0004kg
Sep 02 2017 12:08
whats your current status in fcc
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:08
there are a lot of things.. so it might be good to narrow it down to specifics..
status how ? @1532j0004kg
dinesh
@1532j0004kg
Sep 02 2017 12:09
ok why your weathor api is not working...
weathor app
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:10
it's not ?.... eish... it used... i will check it out
dinesh
@1532j0004kg
Sep 02 2017 12:10
if i want to use weathor app of yours i need any special things?
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:11
it is working... just opened it now..
no.. just enable ur location i guess...
dinesh
@1532j0004kg
Sep 02 2017 12:12
okieee,,,
are u college student, why i asked because u know lot of things...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:13
image.png
dinesh
@1532j0004kg
Sep 02 2017 12:14
ok nice...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:14
yeah i am in college but not studying programming or computer stuff... just doing this as extra stuff
dinesh
@1532j0004kg
Sep 02 2017 12:15
great ..
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:15
how about you
dinesh
@1532j0004kg
Sep 02 2017 12:16
Am college student studying msc ss ... but didn't know more than u...
are u computer related student?
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:17
what is ss ?
dinesh
@1532j0004kg
Sep 02 2017 12:18
software systems
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:19
cool.. im not computer related.. mechanical engineering
dinesh
@1532j0004kg
Sep 02 2017 12:19
great...
shall u give tips to learn about json and api and ajax...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:22
that i really can't help very much.. what i know is just enough to use it..
u can hang around here and sm1 else can help u out on that part....
dinesh
@1532j0004kg
Sep 02 2017 12:23
what i want to learn first jquery or json
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:24
those are two different things..
jquery is a javascript library
dinesh
@1532j0004kg
Sep 02 2017 12:24
yes i know ...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:25
i hope i'm right... not good on theory lol
dinesh
@1532j0004kg
Sep 02 2017 12:25
but what i want to learn first to do projects
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:29
depends on u... u can do a lot without jquery
i'm unsure about json as i don't know much about it
dinesh
@1532j0004kg
Sep 02 2017 12:30
ok thanks for ur valuable time spend for me ...i will go and start learning...
Elizabeth Paul
@Kowalatam
Sep 02 2017 12:31
seriously though... where are all the experts ... c'mon... before i give out wrong information here .........
lol
@1532j0004kg usually ppl use other resources combined with freecode camp..
feel free to stray lol
Netrunner21
@Netrunner21
Sep 02 2017 13:23

JSON is similar to regular javascript object (referred to as an "object literal" in that case), except that JSON is usually stuffed with way more key value pairs. This is important: In JSON, Object keys must be strings. In object literals (what you as objects from freecodecamps lessons so far), you can store a lot more things as values, such as functions and other executable code. You cannot parse a JSON link the same way you parse an object literal - you must use either an AJAX call or jQuery's $.getJSON() method.

As for JSON vs jQuery, they are not comparable. JSON is a storage mechanism and jQuery is a javascript library.. Also note that JSON needs to be parsed because its not javascript. It is a javascript like format that can be used by lots of other programming languages. I'll also echo using other resources to compliment what you're doing here. I've done several of CodeCademy's courses when I didn't feel like had the full grasp from what I learned here.

Cheers.

Markus Kiili
@Masd925
Sep 02 2017 13:45
@Netrunner21 Just to clarify your explanation: JS object keys are also strings, but in JSON, they need to be double quoted.
Netrunner21
@Netrunner21
Sep 02 2017 13:47
That's right, I had forgotten about that
Netrunner21
@Netrunner21
Sep 02 2017 13:52
also, one correction on what I said earlier: all JSON-formatted text is also syntactically legal JavaScript code. AJAX calls and $.getJSON are used when your JSON comes from an outside source. Someone with more experience may be better able to explain it more clearly.
There are certain special characters than can be used in JSON than can't be parsed normally. That gets a bit hairy, and probably above the scope of what's trying to be learned here.
Markus Kiili
@Masd925
Sep 02 2017 14:01
@Netrunner21 The big difference is that JSON is text or string, and JS object literal is part of JS code. If you have a JSON formatted string (from an AJAX call for example), it can be parsed into an JS object with JSON.parse() or automatically under the hood like with getJSON(). The syntax of JSON is almost a more strict subset of JS object literal syntax, so in almost all cases JSON would work (pasted into) an object literal.
Netrunner21
@Netrunner21
Sep 02 2017 14:04
Nice. Thanks for the clarification @Masd925
CamperBot
@camperbot
Sep 02 2017 14:04
netrunner21 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4463 | @masd925 |http://www.freecodecamp.com/masd925
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:28
Hi there
I had just finished the local weather app
inserted the code in the codepen
and it didn't work
Trommelochse
@Trommelochse
Sep 02 2017 15:32
that can have several reasons
console usually gives you some information
@RTFerraz
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:33
alright @Trommelochse
outside the codepen the geolocation works
@Trommelochse
korzo
@korzo
Sep 02 2017 15:43
@RTFerraz Which type of geolocation(HTML5, ip based...) you use and which browser?
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:43
HTML5 @korzo
firefox and chrome
but didn't work on codepen
I used the navigator.geolocation.getCurrentLocation()
korzo
@korzo
Sep 02 2017 15:46
@RTFerraz I run also into this. there is some issue with geolocation when asking for permission inside iframe
@RTFerraz I take a look into my notes what I have about it
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:47
function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
            fccRequest(position.coords.latitude, position.coords.longitude);
        });
    } else { 
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
}
@korzo
I used this function inside an onload of the document
``
document.onload = getLocation();
just1witness
@just1witness
Sep 02 2017 15:50
@RTFerraz you can use this instead, it works more often
$.ajax({
    type: "GET",
    url: "https://ipinfo.io/json/",
    success: coordinates
  });
korzo
@korzo
Sep 02 2017 15:50
@RTFerraz that's ok. Coud you post link yo your pen ?
just1witness
@just1witness
Sep 02 2017 15:51
@RTFerraz It get's the location from the ip address, instead of using geolocation
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:53
@just1witness I'll try this
korzo
@korzo
Sep 02 2017 15:58
@RTFerraz well, it works for me in chrome and firefox.
just1witness
@just1witness
Sep 02 2017 15:58
@RTFerraz BTW, your geolocation worked for me
on FF
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 15:59
@korzo @just1witness it is working for me too
but only outside codepen
korzo
@korzo
Sep 02 2017 15:59
@RTFerraz Try incognito window
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 16:00
@korzo is that an option of codepen?
Trommelochse
@Trommelochse
Sep 02 2017 16:00
@RTFerraz most likely you selected 'no' when some app within codepen asked you if geolocation can be used. you could try clearing your cache
korzo
@korzo
Sep 02 2017 16:00
@RTFerraz no. In Chrome or private browsing in firefox
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 16:01
@Trommelochse I'll try
korzo
@korzo
Sep 02 2017 16:03
@Trommelochse @RTFerraz clearing cache will not help as geolocation preference is stored in Site settings
Open your pen in incognito window (right click on link and select open link in incognito window)
Trommelochse
@Trommelochse
Sep 02 2017 16:04
I see
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 16:06
@korzo didn't work
@RTFerraz @Trommelochse my link is working for you?
@Trommelochse @korzo thanks
CamperBot
@camperbot
Sep 02 2017 16:10
rtferraz sends brownie points to @trommelochse and @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @korzo |http://www.freecodecamp.com/korzo
:cookie: 324 | @trommelochse |http://www.freecodecamp.com/trommelochse
Renan Teixeira Ferraz
@RTFerraz
Sep 02 2017 16:11
Worked in firefox incognito
Trommelochse
@Trommelochse
Sep 02 2017 16:15
it is, @RTFerraz
Chrome
Refath
@Refath
Sep 02 2017 16:16
Hey guys
I was wondering if anyone could help me debug my website
Tom
@moT01
Sep 02 2017 16:29
whats up @Refath
Refath
@Refath
Sep 02 2017 16:30
@moT01 Sup
Still debugging
Tom
@moT01
Sep 02 2017 16:30
did you try some bug spray?
Refath
@Refath
Sep 02 2017 16:39
@moT01 Not compatible with HTML5
Tom
@moT01
Sep 02 2017 16:50
ha
just1witness
@just1witness
Sep 02 2017 19:21

I don't understand why this seems to be storing the 2, from the previous loop and adding the very same 2 to the next one, thus returning a true value and adding the identical index of 2 twice to the sum...

function pairwise(arr, arg) {
 var arr1 = [];
  var ind = [];
   for (var i = 0; i < arr.length; i++){
    arr.filter(function(el, index){
     if(el + arr[i] === arg){
      arr1.push(el , arr[i]);
       ind.push(index, i);
        arr[index] = "0";
        arr[i] = "0"; 
        }                 
       });
      }
return ind.reduce(function(sum, value) {
  return sum + value;
}, 0);

    }
pairwise([1, 3, 2, 4], 4);

_

just1witness
@just1witness
Sep 02 2017 19:35
@gersho helped me fix it, here's the finished solution
function pairwise(arr, arg) {
 var arr1 = [];
  var ind = [];
   for (var i = 0; i < arr.length; i++){
    arr.filter(function(el, index){
     if(el + arr[i] === arg && i !== index){

      arr1.push(el , arr[i]);
       ind.push(index, i);
        arr[index] = "0";
        arr[i] = "0"; 
        }                 
       });
      }
return ind.reduce(function(sum, value) {
  return sum + value;
}, 0);   
    }
pairwise([1, 1, 1], 2);
@gersho Thank you
CamperBot
@camperbot
Sep 02 2017 19:35
just1witness sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:warning: just1witness already gave gersho points
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:38
can someone
help me with the sorted union problem?
or no?
just1witness
@just1witness
Sep 02 2017 20:41
maybe
let's see it
need help with this one
just1witness
@just1witness
Sep 02 2017 20:44
I can help you, what do you have so far? To paste your code use three back ticks (```) press shift+enter, paste your code, press shift+enter again, and add three more back ticks
RonSwan
@RonSwan
Sep 02 2017 20:45
Is it a bad idea to have a very plain porfolio page to complete the project and just move on? I am planing on upgrading to a 'real' website and not a codepen that does not jive with my google fonts.
just1witness
@just1witness
Sep 02 2017 20:46
I don't think the profolio page you submit has to be in codepen. You may be able to submit the website.
@RonSwan
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:46
just 1 witness
can you
help me over skype?
just1witness
@just1witness
Sep 02 2017 20:47
no, thanks
@siddarthk123
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:48

function uniteUnique(arr) {

var newArr = [];

 for(var i =0 ; i <= arguments.length-1; i++){
   newArr = newArr.concat(arguments[i]);
 }
this is what i have
so far?
just1witness
@just1witness
Sep 02 2017 20:48
k, give me a minute.
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:49
ok
so i already got it unionized
now...
just1witness
@just1witness
Sep 02 2017 20:50
You can get an array to work with by using the basic .reduce() function. Have you read up on that method?
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:50
i just need to get rid of the duplicates.
yes.
i have
what do i do in the reduce function though?
delete duplicates?
just1witness
@just1witness
Sep 02 2017 20:50
now look at the filter() method @siddarthk123
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:51
so i use
filter
not....
reduce?
just1witness
@just1witness
Sep 02 2017 20:52
you can use that to compare elements in your array, if they are equal, you can remove them.
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:52
but i do not use reduce
just filter?
just1witness
@just1witness
Sep 02 2017 20:53
I used reduce to do what you did above, do you get one array with all the values?
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:53
yeah
so now i'm supposed to use filteR?
just1witness
@just1witness
Sep 02 2017 20:54
what I did to get that was
var objArr = Array.from(arguments.reduce(function(a,b){
    return a.concat(b);
},[]);
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:55
ok
i already got that
just1witness
@just1witness
Sep 02 2017 20:55
Filter would work to remove the duplicates, yes
Siddarth Krishnan
@siddarthk123
Sep 02 2017 20:55
now how do i get rid of the duplicates?
what do i put inside the filter function?
how do i compare item to item?
huh?
just1witness.
just1witness
@just1witness
Sep 02 2017 21:00
filter uses a function, in this case with three parameters. Array.filter(function(item, index, inputArray){condition goes here});
give me a sec, I'm trying to figure out the best way to explain it
index may be better called, next actually.
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:02
but how do i use
the filter function
to delete duplicates?
just1witness
@just1witness
Sep 02 2017 21:02
I know what your asking, just give me the time to figure out how to explain it clearly
I don't want to just hand you the answer
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:03
ok
Mike
@MikeJSchorah
Sep 02 2017 21:07
How has everyone's day been going so far?
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:07
arr = arr.filter( function( item, index, inputArray ) {
return inputArray.indexOf(item) == index;
});
what does this mean?
Mike
@MikeJSchorah
Sep 02 2017 21:08
I'm lucky to be alive. Almost involved in a head-on collision about an hour ago.
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:08
just1witness
can you explain it to me now?
just1witness
@just1witness
Sep 02 2017 21:08

the first parameter (item) is the current element being being processed in the array.
the second parameter (index) is the index of the current element being processed
the third parameter is the array you are filtering through

What you want to do is check the array (inputArray) for the index of your current element(item) and see if it's equal to the current index(index)

try to picture it as putting your array through a funnel that catches any values it sees twice
Mike
@MikeJSchorah
Sep 02 2017 21:09
Thanks. Guy must have been drunk or on drugs. I refused to be a witness because I have so much work to do, but I did call 911 and 5 people did stop. Guess I'm just compartmentalizing this, but I feel like I should cherish this moment in a sense that I should tell my family how lucky I am to be alive and how each and every moment counts because you don't know what is in the future and how much I love them. Idk. Just want to calm down from panic attack/adrenaline rush, haha
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:10
i dont get it
Mike
@MikeJSchorah
Sep 02 2017 21:10
I have a quick question: If I didn't use a child theme for my WordPress website, will all content be completely eliminated when the theme updates? I built 2 websites with the Avada theme and 3 websites with the Divi theme.
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:10
i dont really get it
just1witness
i do not get it.
just1witness
@just1witness
Sep 02 2017 21:10
Hold on
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:11
can you explain it to me on skype?
please?
just1witness
@just1witness
Sep 02 2017 21:11
You know when you pour something through a filter, or screen?
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:11
yes.
just1witness
@just1witness
Sep 02 2017 21:11
You want to remove something sprecific, like big rocks, and only keep the dust
Siddarth Krishnan
@siddarthk123
Sep 02 2017 21:12
yeah
just1witness
@just1witness
Sep 02 2017 21:12
well, filter does that, but with code
piteto
@piteto
Sep 02 2017 21:12
@MikeJSchorah When your theme updates, it won't preserve changes you've made to theme files. Always use a child theme if you need to customize your primary theme. (Glad you're okay, btw)
just1witness
@just1witness
Sep 02 2017 21:12
so you took your array
and pushed it through a filter that said, if the array index value is the same as the filter index value, get rid of it
Mike
@MikeJSchorah
Sep 02 2017 21:13
@piteto Thanks. Another quick question, if it's okay. What exactly is a child theme? So, I'm just dealing with stylesheets? Is it difficult to transfer my code over to a child theme?
CamperBot
@camperbot
Sep 02 2017 21:13
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 45 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 02 2017 21:14
@MikeJSchorah A child theme is a copy of the CSS for your primary theme that you can modify. http://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/
Always, always use a child theme :)
just1witness
@just1witness
Sep 02 2017 21:14
you set determined the filter conditions AFTER filter(), and you Added the array in question BEFORE filter() (ARR.filter())
Mike
@MikeJSchorah
Sep 02 2017 21:15
@piteto Thanks for the video. How is it different from the regular theme? I've been using a lot of CSS to style my websites
CamperBot
@camperbot
Sep 02 2017 21:15
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave piteto points
just1witness
@just1witness
Sep 02 2017 21:16
@siddarthk123 is that making any sense?
piteto
@piteto
Sep 02 2017 21:17
@MikeJSchorah It's really a reference to your main theme - if you're familiar with how CSS works, it lets you customize the appearance of your main theme without modifying the files that get updated / installed with your main theme.
Mike
@MikeJSchorah
Sep 02 2017 21:20
@piteto I guess my question is... I've built 5 sites now using Avada theme and Divi theme. They're all done. Is it going to be a TON of work to get those styles changed over to a child theme?
piteto
@piteto
Sep 02 2017 21:21
@MikeJSchorah You'll have to diff the changes you made to the core files and compare them to the originals to know for sure
If you just modified the CSS, take those changes you made and put them in a new style.css
iso
@iso1048
Sep 02 2017 21:22
does anyone use chrome canary?
piteto
@piteto
Sep 02 2017 21:22
That style.css will be used in your new child theme - it's hard to say how much work all of this will be without knowing how much you've modified the core theme
If you've modified core .php files, which you really shouldn't do, it could potentially be a lot of extra work
Mike
@MikeJSchorah
Sep 02 2017 21:24
@piteto Thanks for all of the info. I thought there was a lot of money in modifying WordPress PHP, no? I heard that 80% of ALL websites are powered by PHP. So, all of the work in WordPress is just CSS and customizing themes only?
CamperBot
@camperbot
Sep 02 2017 21:24
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave piteto points
piteto
@piteto
Sep 02 2017 21:26
@MikeJSchorah You can become a plugin developer and make money off of custom plugins for wordpress, those add to the core functionality provided by wordpress and the theme installed
Similar to how your child theme adds to the design of the core theme, plugins add to the functionality without modifying the core theme or wordpress installation
Mike
@MikeJSchorah
Sep 02 2017 21:28
@piteto Cool. Thanks. How often do themes update? I've done 2 sites with Avada and 3 sites with Divi in the past 5 weeks
CamperBot
@camperbot
Sep 02 2017 21:28
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave piteto points
piteto
@piteto
Sep 02 2017 21:29
@MikeJSchorah It depends on who developed the theme - some may only get updates when security bugs are found, others get new features added all the time and receive regular updates
I personally haven't used Avada or Divi, so can't say how often to expect updates - but there should be a log of release notes with dates for every release out there
Mike
@MikeJSchorah
Sep 02 2017 21:31
@piteto So the update is automatic? My stuff will automatically be wipes out or will I have to manually go in and update it?
piteto
@piteto
Sep 02 2017 21:31
@MikeJSchorah You can configure it to update automatically, but if you haven't done that, you'll manually update
I always do manual updates to review the changes and make backups first if needed. It sucks waking up to jetpack alerts that one of your sites are down because of a failed update
Mike
@MikeJSchorah
Sep 02 2017 21:33
@piteto Thanks. But do I really need to worry about my website getting hacked for not updating it?
CamperBot
@camperbot
Sep 02 2017 21:33
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave piteto points
piteto
@piteto
Sep 02 2017 21:34
Yes, that's definitely a concern - always apply updates as soon as possible @MikeJSchorah
There are roaming botnets out there searching for wordpress sites - it's scary if you check your firewall logs to see how much traffic tries to hack into your sites
Mike
@MikeJSchorah
Sep 02 2017 21:37
@piteto Yeah........ I had a site and my Sucuri WordPress plugin updated me so much that I deactivated it :o I got too many updates...
Shadow Walker
@khashy
Sep 02 2017 22:04
hey guys
i uploaded a website on server
Mike
@MikeJSchorah
Sep 02 2017 22:05
Which server? AWS? Heroku?
Shadow Walker
@khashy
Sep 02 2017 22:05
the background image is not loading like use to load
htttp://soheilsepahyar.com
@MikeJSchorah take a look
korzo
@korzo
Sep 02 2017 22:58
@khashy Looks ok from here
@khashy But your images are 3Mb , so it takes some time on slower network