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
Minoy
@minoy
Hello everyone!
I am stuck with the 'Counting Cards' Javascript challenge

Following is the code:
var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count += 1;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count -= 1;

}

if (count <= 0) {
console.log (count + " Hold");
} else
console.log (count + " Bet");

//return count;
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display

cc(2); cc(3); cc(4); cc(5); cc(6);

I am not getting any output. Any ideas?

Ayobami
@purpose50

Hi guys, i dont know what the problem is here, my s function stream keeps returning undefined when the returned value is defined..
my Code:

$(document).ready(function() {
  var channels = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];

  function stream(channel) {
    var streamResult;
    var stream_link =  "https://wind-bow.gomix.me/twitch-api/streams/" + channel;
    $.getJSON(stream_link, function(result) {
      streamResult = result.stream;
    });

   return streamResult;
  }//end function stream

  alert(stream("ESL_SC2"));

  function channelInfo(stream, channel) {
    //var status = stream(channel);
    if(status === null) {
      var channel_status = "offline";
    }else {
      var channel_status = "online";
    }//end else

    var link = "https://wind-bow.gomix.me/twitch-api/channels/" + channel;
      $.ajax({
      url: link,
      dataType: "jsonp",
      success: function(json) {   
        $(".table").append("<tr><td><img src = '" + json.logo + "' width = '320'></td>");
        $(".table").append("<td>" + json.display_name + "</td>");
        $(".table").append("<td>" + channel_status + "</td></tr>");
      }//end success
    });//end $.ajax
  }//end channelInfo

  for(i = 0; i < channels.length; i++) {
   channelInfo(stream, channels[i]);
  }//end for
});///end document

codepen: http://codepen.io/purpose/pen/dOBxJy

any help please

alpox
@alpox
@purpose50 $.getJSON is an asynhronous call. That means, that the callback function given to it resolves late, and the code doesn't wait for it with running. so streamResult is not YET set when you return.
You will have to restructure your code accordingly.

When you want to encapsulate that stuff in a function still, you can use something like:

function stream(channel, cb) {
    var streamResult;
    var stream_link =  "https://wind-bow.gomix.me/twitch-api/streams/" + channel;
    $.getJSON(stream_link, function(result) {
      cb(result.stream);
    });
  }

And use it as:

stream("ESL_SC2", function(stream) {
    // here you have the stream
});
Paweł Rokosz
@PawelRokosz
hey, is it possible to design a html/css/js responsive project in which every section has the height of a device with a 100% fluid width?
alpox
@alpox
@PawelRokosz Sure
section {
    height: 100vh;
    width: 100%;
}
Paweł Rokosz
@PawelRokosz
@alpox awesome! Thank you!
CamperBot
@camperbot
pawelrokosz sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 713 | @alpox |http://www.freecodecamp.com/alpox
marko bogdanovic
@okramovic
in need of help with wiki challenge. why do i have empty myData?
http://codepen.io/okramovic/pen/woVKXB
Luke Sallmen
@LukeSallmen
Hey. I'm trying to make my links in my navbar entirely clickable - the whole block, not just the text - but I'm having trouble doing so. Is it possible to turn my text links into "blocks" in the navbar that are entirely clickable?http://codepen.io/LukeSallmen/pen/qqeWoR
Phillip Troutman
@troutman21
It looks like the whole thing is clickable from my side @LukeSallmen
Sara Soliman
@solimansara
Good Morning, do i need to include the google font link at the beginning of the page when i am using A Pen?
Phillip Troutman
@troutman21
only if you want a specific type of font that is not already supported by your bootstrap or something
Sara Soliman
@solimansara
Are most of the fonts supported by bootstrap?
Phillip Troutman
@troutman21
I think the basic ones are. Im still very new so i dont have a lot of experience with changing fonts. However I'm going to experiment with some new ones from google just to practice.
@solimansara
Sara Soliman
@solimansara
Cool, how do you know if the font wanted is supported or not?
Luke Sallmen
@LukeSallmen
@troutman21 more specifically I want the space above and around the text/anchor to be clickable as well
Icah Banton
@remdata
need help with the portfolio challenge. Can you use a codePen page as a responsive image?
Luke Sallmen
@LukeSallmen
@remdata what do you mean?
Icah Banton
@remdata
@LukeSallmen . I am trying to use a codePen as a thumbnail.
Luke Sallmen
@LukeSallmen
@remdata oh. you could screenshot it, perhaps?
Icah Banton
@remdata
@LukeSallmen . where would I store that image?
Luke Sallmen
@LukeSallmen
@remdata Github is generally recommended, but you could also use tinypic or similar services
Icah Banton
@remdata
@LukeSallmen . How do you store an image at Github?
Luke Sallmen
@LukeSallmen
@remdata make a repository and then "upload a file" and then select the images you want to upload.
Icah Banton
@remdata
thanks Luke. I will try that.
Luke Sallmen
@LukeSallmen
No problem!
Ayobami
@purpose50
@alpox yeah thanks
CamperBot
@camperbot
purpose50 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 714 | @alpox |http://www.freecodecamp.com/alpox
Ayobami
@purpose50
Hi guys, i just finished my twitch tv streamer, can you please check it out and tell me what you think?
http://codepen.io/purpose/full/dOBxJy
Ben Line
@Benwebdev
@purpose50 it's awesome :D.
Ayobami
@purpose50
@Benwebdev thanks :smile: :+1:
CamperBot
@camperbot
purpose50 sends brownie points to @benwebdev :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @benwebdev |http://www.freecodecamp.com/benwebdev
Sorin Ruse
@sorinr
@purpose50 you also need the filters for all, online, offline
Kelechi Chinaka
@ke1echi
any talk on how i will get started on the random quote machine
Sorin Ruse
@sorinr
@kelechichinaka a quote is just a quote. so, you have two ways to accomplish this: 1st using an array of quotes and get a random one from the array; 2nd using an quotes api (google for it) that will help you understand how to use apis for the future challanges. as for the layout(html) and design(css) its all up to u
Ayobami
@purpose50
@sorinr thanks, iwill do that
CamperBot
@camperbot
purpose50 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1014 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
@purpose50 :+1:
Patrick Tran
@tranpatrick01
my hr styling is not workinng
help?