Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Eric Chung
@chungeric
@khaduch since it needs https for geolocation and the ajax url is http
Mostafa Masri
@thefakeweed
@khaduch my var is not defined error
Eric Chung
@chungeric
@khaduch maybe i'll just use getJSON...
Ken Haduch
@khaduch
@chungeric - are you loading your page with https://? You have to load your page using http:// in your URL, because the free version of the openweather api only uses http://. The problem with the geolocation is a real problem. Can you try firefox? That is not a good solution to require people to use firefox, but at least you can see if it works because geolocation on firefox doesn't need https:// (at least not yet)
@mml3b - you are not supposed to copy the example code into the exercise... And you don't need the b = 7; line.
@chungeric - there is a discussion in the FreeCodeCamp forum about the https:// problem. FreeCodeCamp/FreeCodeCamp#7853 And they discuss alternatives to using openweather.
Hello911
@Hello911

function reverseString(str) {
  str=[];
  str.split("");
  str.reverse();
  str.join("");
  return str;
}

reverseString("hello");
Why does the computer say Type error: str.split is not a function? The correct result should be "olleh''.
Ken Haduch
@khaduch
@Hello911 - you have changed str to an array, and .split is a string function. Get rid of the str = []; because that is killing the value of your function argument, which is str...
Then you have some other problems - str.split(""); returns a new string, so you have to assign your value from that back to str, the same thing all the way down the line. Watch for methods that modify the variable in place (there aren't too many) vs. those that return a modified value.
And you can do all of this in one line by chaining the methods together.
Steven Failla
@Stevo99
hey can someone please explain to me how to to put more than 1 background image in codepen. for some reason i cant figure it out and i keep hitting wall after wall
Hello911
@Hello911

@khaduch ```

function reverseString(str) {

str=str.split("");
str.reverse();
str=str.join("");
return str;

}

reverseString("hello");

This works Thanks @khaduch
Paul Maxwell
@paulmaxwell
I'm doing the intermediate algorithm challenges. Does it matter if I don't use the methods in the helpful links list? Am I missing the point of the exercise?
Steven Failla
@Stevo99
Eric Chung
@chungeric
@khaduch ok, I guess wunderground weather api is the solution. thanks for the link!
Steven Failla
@Stevo99
thats funny cause it works here but not there. i cant find the image after hitting run
Chris
@bestintown23
how can I center my social media icons ? http://codepen.io/bestintown23/full/XpzXmy/
Eric Chung
@chungeric
Put the icons in an icon-container or something, then use text-align: center on that container
@bestintown23 ^
Hello911
@Hello911
function factorialize(num) {
  for(var i=1;i<num;i++){
    num=num*i;
  }
  return num;
}

factorialize(5);
The computer says num=num*i; is a potential infinite loop that will crash browser, and the function doesn't work. Any hint?
Ken Haduch
@khaduch
@Hello911 - yes, you are changing the value of num (or at least potentially changing it) and trying to use it as your loop control. Bad idea... Make a separate variable to do your multiplication with.
Tyler Moeller
@TylerMoeller
@winroy For scroll spy to work, you'll need to add the required attributes to your <body> tag, since codepen adds the <body> already, you can add everything dynamically in your document.ready:
$(document).ready(function(){
  $('body').attr({
    'data-spy': 'scroll',
    'data-target': '.navbar',
    'data-offset': '50'
  });
});
Naterroy1
@Naterroy1
how do you make a caption under a picture
Ken Haduch
@khaduch
@villain101 - unless they ask for something specific that they are going to look for, like using the .reduce() method, or somesuch, then you can do whatever works. I think that the helpful links list is good if you are a newbie, or if they are recommending functions or methods that you are not familiar with and they are trying to introduce to you, then that's fine. I've seen people using ES6, all sorts of higher-level functions, etc. just to do the basics. It depends on your level of expertise, to a large extent (and in my opinion.)
@Naterroy1 - you can read about it here - https://www.w3.org/Style/Examples/007/figures.en.html
I just googled "HTML CSS how to make a caption under a picture" and that was one of the top links.... "Read, Search, Ask" ;)
I hope it helps.
Tyler Moeller
@TylerMoeller
@SamiNami Not sure if you got an answer, there are three API endpoints available for twitch (users, channels, streams), analyze all three to see how you want to check if brunofin has been deleted:
Sami Perälahti
@SamiNami
thanks @TylerMoeller
Tyler Moeller
@TylerMoeller
No problem - just a hint, hope it helps ;)
Naterroy1
@Naterroy1
thanks @khaduch
Tyler Moeller
@TylerMoeller
@Stevo99 Yes, you can use multiple background images. It depends on how you want it all set up. If you can send a link to a codepen and say what you're trying to achieve, we can try to help. Here's one way to do it:
<section class="section1"></section>
<section class="section2"></section>
.section1 {
  background: url(https://placehold.it/1200?text=section1) no-repeat center center;
  background-size: cover;
  border-bottom: 1px solid black;
  min-height: 50vh;
}
.section2 {
  background: url(https://placehold.it/1200?text=section2) no-repeat center center;
  background-size: cover;
  min-height: 50vh;
}
Steven Failla
@Stevo99
@TylerMoeller thank you soo much i can really use the help..
Japneet Singh
@japsuchiha
@bestintown23 add this :
<div class ="imga"> // added a div class
<img src="https://i.imgsafe.org/fd6f339860.png" class="icons">
<img src="https://i.imgsafe.org/fdfb20fa8d.png" class="icons">
<img src="https://i.imgsafe.org/fdfcd6a234.png" class="icons">
<img src="https://i.imgsafe.org/fdfebb2d2b.png" class="icons">
  </div>
.imga{
text-align: center;
}
Spyrantis Theodoros
@thodorisanta
Im suppose to return the sum of all odd fibonacci numbers. But my IF doesnt quite work...can you tell me why?

function sumFibs(num) {
  var a=1;var b=0; var temp=0; var i=0;
  var arr = [];
  var sum=0;
  while(a<num){

    temp = a;
    arr[i] = a;
    a = temp + b;
    b = temp;

    if(arr[i]/2!==0){
      sum += arr[i];
    }
    i++;
  }

  return sum;
}

sumFibs(4);
Steven Failla
@Stevo99
and I noticed also that on the html side when i started getting to line number 30 or so whenever i typed it would show up all the way at the right instead of right by the number.. why is that
even when i hit enter to bring up more line numbers theres a gap between the numbers even though theres no text at all
Tyler Moeller
@TylerMoeller
@Stevo99 We'd need to see the code to understand what's going on :)
Steven Failla
@Stevo99
how can i send it to you
just send you the link to the codepen doc right
Hello911
@Hello911
function replacer(match, p1, p2, p3, offset, string) {
  // p1 is nondigits, p2 digits, and p3 non-alphanumerics
  return [p1, p2, p3].join(' - ');
}
var newString = 'abc12345#$*%'.replace(/([^\d]*)(\d*)([^\w]*)/, replacer);
I am trying to understand .replace() method. What does replacer do in the last line??
Moisés Man
@moigithub
"hello".replace("l", "x") ----> "hexxo"
last line.. uses regex expression
www.regexone.com <-- a good place to start @Hello911
Steven Failla
@Stevo99
at the bottom its a little sloppy because i was trying soo many things.
Tyler Moeller
@TylerMoeller

@Stevo99 This should be removed from your HTML:

  <body background="https://wallpaperscraft.com/image/laptop_table_apple_macbook_pro_retina_window_73454_1920x1080.jpg"></body>

Use CSS to set background images, like in that code example I gave above. :point_up: January 27, 2017 8:20 AM

Steven Failla
@Stevo99
yea i only put it there cause it wont load if i do it on css
Tyler Moeller
@TylerMoeller
blob
Steven Failla
@Stevo99
and i used the style you gave me and it still didnt work