These are chat archives for FreeCodeCamp/HelpFrontEnd

12th
Nov 2016
I am too stupid I dont get this thing
Coy Sanders
@coymeetsworld
Nov 12 2016 00:46
@rafaelmateo you don't define a again (i.e. use var a), you can only do that once, you don't define something twice
so just remove the var keyword in your code. Then you need to assign b to a after that and you should be done
Peter Andersson
@repeterande
Nov 12 2016 01:12
Hello, I have my first version of the Random Quote Machine working, it needs some more work as I am also learning react as I go, here's the pen if anyone wants to take a look, any pointers appreciated: http://codepen.io/repeterande/pen/pNJjzE?editors=0010
Ian Duke
@1andee
Nov 12 2016 01:20
@repeterande Do you intend on centering it both vertically and horizontally on the page?
Peter Andersson
@repeterande
Nov 12 2016 01:28
@ianduke: no I haven't really thought that far yet, my original thought was just to render the basic components, I drew a picture of the app and I haven't completed that view just yet, I threw in some materialize components along the way
so I might still change react elements/components and props some more, if I have any unusual or bad practise
please let me knwo
:)
sorry for spam, I should probably get some sleep soon
Ian Duke
@1andee
Nov 12 2016 01:34
@repeterande no worries. it works (and tweets!) so there's that
Ian Lee
@asparism
Nov 12 2016 01:58
does anyone know how ajax promises work? i can't seem to get my twitch.tv page working properly. http://codepen.io/Asparism/pen/oYbOOv
it works fine with async: false, but with the async i wonder if it's the syntax or logic that i'm not right on
JiaLe Guo
@gabygoole
Nov 12 2016 04:33
Is there anybody can help me with random quote machine?
grantknaver
@grantknaver
Nov 12 2016 05:09
hey you guys have any idea how to make a footer stay static when you shrink the width of the window?
any ideas?
grantknaver
@grantknaver
Nov 12 2016 05:24
any1
Nitin Chandran Nair
@NitinNair89
Nov 12 2016 05:27
anyone good in android studio?
Aarya Bhorra
@aarya1302
Nov 12 2016 05:36
hey guys i'm trying to run this code
$("#streams").append("<a href='"+json._links.channel+"'>"+channel[u] + "</a><br>");
But it says unexpected string
Nevermind it was a blockage in code pen
Ken Nawrocki
@nawrockp
Nov 12 2016 05:51
@grantknaver do u have a link?
Homer Allen
@homerallen
Nov 12 2016 06:43
Ok - so question. I am in the middle of making my portfolio page (http://codepen.io/HomerAllen/pen/MbKdqd/) and as you can see, I'm using Bootstrap grids, including within the navbar. Things look good full screen on medium or above, but when the browser shrinks, things aren't looking as good. I want it to be responsive, but I want some things to remain in tact, on one line, like my name and the menu. Does anyone have any thoughts on where I'm currently at and any tips on how to proceed?
Tyler Moeller
@TylerMoeller
Nov 12 2016 06:51
@homerallen You have the right idea, but you are using all xs grids. It's helpful to see how sm, md, and lg work as well: http://getbootstrap.com/css/#grid-media-queries
This may also give an idea how the different grid sizes work
Mike
@premack
Nov 12 2016 06:55
I @TylerMoeller @homerallen I found it incredibly hard to do the Portfolio Project. So hard that I moved onto another course in the mean time. I understand the idea is to make us think, but I'm sorry.. just not enough material to prepare us for such a task.
Homer Allen
@homerallen
Nov 12 2016 06:59
@TylerMoeller ok, hmm, the reason why I used xs grids was because I wanted things to be horizontal at all times - couldn't get stacking to work right. I can try replacing out with medium again and work with that
@TylerMoeller thanks for your help by the way!
CamperBot
@camperbot
Nov 12 2016 06:59
homerallen sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 929 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Nov 12 2016 07:00
xs is really meant for how you want it to look on a mobile device, sm would be closer to tablet, etc.
Mike
@premack
Nov 12 2016 07:09
Do any of you agree with me? That doing the Portfolio Project so early on in the course is a major head scratcher for a Beginner? Seriously, I'd love to look at the data that FreeCodeCamp collects on percentage of students who outright quit and never return once they get that far.
Coy Sanders
@coymeetsworld
Nov 12 2016 07:10
@premack its never going to be smooth sailing with any project, you're going to need to do and learn more than what the challenges went through
with Portfolio project it doesn't have to be like the example, all you need to do is pass the user stories and it doesn't have to be perfect either
you can always go back and improve on it
Homer Allen
@homerallen
Nov 12 2016 07:14
Ok, so I changed out my grids for medium grids in the navbar. Things definitely try to stack at lower browser dimensions and it doesn't look right. Playing with CSS to try to make things work. http://codepen.io/HomerAllen/pen/MbKdqd/ The example project does not stack at lower dimensions : https://codepen.io/FreeCodeCamp/full/YqLyXB
Annu Nirmal
@annunirmal
Nov 12 2016 07:15
can anyone help me align left sidebar-nav and its icons
http://codepen.io/nirmalannu/pen/oYbpmv?editors=1100
Coy Sanders
@coymeetsworld
Nov 12 2016 07:29
@annunirmal dont the font-awesome icons typically go in an i tag?
shouldn't be in div especially if you're nesting them in a list, you'll get some formatting problems that way for sure
Mike
@premack
Nov 12 2016 07:31
@coymeetsworld I agree, I still feel I need another course to help me with it. I've chosen this Udemy course The Ultimate Bootcamp by Colt Steele. They don't necessarily walk you through the process either, though.
Coy Sanders
@coymeetsworld
Nov 12 2016 07:31
best thing to do is just practice at it @premack and start small
my first portfolio was terrible, i just did what i needed to pass
then moved on, learned more CSS along the way and spent more time doing it and looking into design and making it better
Annu Nirmal
@annunirmal
Nov 12 2016 07:33
@coymeetsworld that way it was more problematic
@coymeetsworld within <i>
Mike
@premack
Nov 12 2016 07:34
Coy, maybe that's what I need. A design course.
Coy Sanders
@coymeetsworld
Nov 12 2016 07:35
@annunirmal well divs are block elements
and nesting them inside inline elements is going to be very hard to get it the way you want
maybe try a span tag instead
@premack yeah it wouldn't be bad
or more supplemental info on CSS, FCC only gives you the basics
Annu Nirmal
@annunirmal
Nov 12 2016 07:36
@coymeetsworld span instead of div ? and <li> inside it ?
Coy Sanders
@coymeetsworld
Nov 12 2016 07:36
if you're looking for a book The Missing Manual is pretty good
span inside the li's that you already have @annunirmal, maybe
but i would try i again
thats how they specify it in their documentation
idk what would happen if you give those classes to different elements
Annu Nirmal
@annunirmal
Nov 12 2016 07:46
@coymeetsworld removed div completely, let me know if you can help me know
http://codepen.io/nirmalannu/pen/oYbpmv?editors=1100
Coy Sanders
@coymeetsworld
Nov 12 2016 07:48
<a href="#" data-scroll> data-scroll?
whats that from bootstrap?
Annu Nirmal
@annunirmal
Nov 12 2016 08:06
@coymeetsworld that was jquery i was going to use
@coymeetsworld removed for now
WebDevClub
@WebDevClubWIUT
Nov 12 2016 08:11
Hello everyone
Daniel
@DanielMW34
Nov 12 2016 08:26
Would anyone be willing to help me with timing functions on my Simon Game?
I am losing my mind
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 08:31
@DanielMW34 I can take a look at it if you want
Daniel
@DanielMW34
Nov 12 2016 08:31
@Otto-AA Thank you very much
CamperBot
@camperbot
Nov 12 2016 08:31
danielmw34 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 371 | @otto-aa |http://www.freecodecamp.com/otto-aa
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 08:32
@DanielMW34 Gonna need a link and better description of the problem though
Daniel
@DanielMW34
Nov 12 2016 08:35
@Otto-AA here is the gist of the problem... (line 75 - javascript) the playSequence() function... the current function only "plays" (audio/visual effects) the last value in cpuSequence although I know the FOR loop is iterating over the entire array due to $("#test2test) ... I have a few other ways I've tried to do this and can provide them to you, however in those cases, all the values in the cpuSequence array "play" but they do so without delay and it occurs as nearly simultaneous. Essentially, I need the setTimeout to delay each iteration of the FOR loop a half-second so the user can actually "see" the pattern.
http://codepen.io/Daniel_Widrich/pen/yamwzG
Daniel
@DanielMW34
Nov 12 2016 08:42
@Otto-AA I am now reading a post about asynchronous events and the event queue and, I think this is perhaps explaining WHY this is not working the way I want it to... the setTimeout is delayed in the event queue however, in the meantime, the rest of the for loop executes. However, in light of this, I don't understand why I am not seeing all the values in the array "play" in rapid succession as they do in other cases.
Daniel
@DanielMW34
Nov 12 2016 08:50
@Otto-AA however, I'm still stuck
:(
Daniel
@DanielMW34
Nov 12 2016 09:02

@Otto-AA from (https://coderwall.com/p/_ppzrw/be-careful-with-settimeout-in-loops#comment_28319) ...
"The variables you're passing in don't keep their initial values, so if you're changing them (as in a for loop) please be aware:

for (var i = 1; i <= 5; ++i) {
  setTimeout(function(){
    console.log(i);
  }, 1000);
}

This will output the value 6 five times, which is not the intention."

The author then goes on to give this example:

for (i = 1; i <= 5; ++i) {
  setDelay(i);
}

function setDelay(i) {
  setTimeout(function(){
    console.log(i);
  }, 1000);
}

saying "Set the timeout from within a function"

Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:03
@DanielMW34 You want them to play one after another?
Daniel
@DanielMW34
Nov 12 2016 09:03
@Otto-AA yes, but I want a delay of half-second between them
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:04
then you could do for (var i = 0; i < x; i++) {setTimeout(function() { ... }, 500*i);}
Daniel
@DanielMW34
Nov 12 2016 09:04

I can get them to play one after another with this code:

function playSequence() {
    for (var i=0; i < (cpuSequence.length); i++) {
      setDelay(i);
    }
  }  

  function setDelay(i) {
    var y = cpuSequence[i];
    setTimeout(function() {
      if (y == 1) {
        $("#1").css("background-color", "#00fe00");
        document.getElementById("audio1").play();
        setTimeout(function() {
          $("#1").css("background-color", "#004d00"); }, 333);
        };
      if (y == 2) {
        $("#2").css("background-color", "#f60000");
        document.getElementById("audio2").play();
        setTimeout(function() {
          $("#2").css("background-color", "#860000"); }, 333);
        };
      if (y == 3) {
        $("#3").css("background-color", "#eeee00");
        document.getElementById("audio3").play();
        setTimeout(function() {
          $("#3").css("background-color", "#b3b300"); }, 333);
        };
      if (y == 4) {
        $("#4").css("background-color", "#0000ff");
        document.getElementById("audio4").play();
        setTimeout(function() {
          $("#4").css("background-color", "#000066"); }, 333);
        };
      }, 500);
  }

however, there is no half second delay in between

Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:05
@DanielMW34 then for the first one it would be 0ms, the second one 500ms, the third one 1000ms and so on
Daniel
@DanielMW34
Nov 12 2016 09:05
@Otto-AA WHA------? You're kidding... it's that simple....
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:05
@DanielMW34 :laughing:
Daniel
@DanielMW34
Nov 12 2016 09:05
@otto-AA I see the logic behind this (for the most part)
@Otto-AA so in your solution, we are telling the browser to delay playing each one a set amount so that they then go off in sequence... however, I'm not 100% sure why in my example, it plays the final value in the array only, nor do I understand in the code sample provided above, why do all the buttons "play" but in immediate and rapid succession...
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:08
@DanielMW34 Btw, $("#test2test").html(test2text + y); could be done with $("#test2test").append(y);
Daniel
@DanielMW34
Nov 12 2016 09:08
@Otto-AA duly noted
@Otto-AA that will end up being removed, but I appreciate you bringing it to my attention
@Otto-AA small problem, it only played/beeped the newest added value
@Otto-AA but it did it multiple times!!!!
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:13
@DanielMW34 (As far as I know) it only plays the last value because: It executes the for-loop with all the setTimeouts. Then, when the setTimeouts get called after some time, i has become the last value in the for-loop and therefore everyone executes with the last value
Daniel
@DanielMW34
Nov 12 2016 09:13
@Otto-AA yes, that is what the source I cited above was saying.... let me repost those comments

@Otto-AA from (https://coderwall.com/p/_ppzrw/be-careful-with-settimeout-in-loops#comment_28319) ...
"The variables you're passing in don't keep their initial values, so if you're changing them (as in a for loop) please be aware:

for (var i = 1; i <= 5; ++i) {
  setTimeout(function(){
    console.log(i);
  }, 1000);
}

This will output the value 6 five times, which is not the intention."

The author then goes on to give this example:

for (i = 1; i <= 5; ++i) {
  setDelay(i);
}

function setDelay(i) {
  setTimeout(function(){
    console.log(i);
  }, 1000);
}

saying "Set the timeout from within a function"

The setTimeout function is on hold in the queue while the variable i is changing as the loop progresses, by the time setTimeout executes, the variable i is equal only to the final value
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:15
@DanielMW34 Yeah, so try to do the thing with the playSequence -> setDelay(i) stuff, but remember to multiply the delay with i in setDelay
Daniel
@DanielMW34
Nov 12 2016 09:15
@Otto-AA wait one sec... I have tried this... but without the i multiplier
@Otto-AA
 function playSequence() {
    for (var i=0; i < (cpuSequence.length); i++) {
      setDelay(i);
    }
  }  

  function setDelay(i) {
    var y = cpuSequence[i];
    setTimeout(function() {
      if (y == 1) {
        $("#1").css("background-color", "#00fe00");
        document.getElementById("audio1").play();
        setTimeout(function() {
          $("#1").css("background-color", "#004d00"); }, 333);
        };
      if (y == 2) {
        $("#2").css("background-color", "#f60000");
        document.getElementById("audio2").play();
        setTimeout(function() {
          $("#2").css("background-color", "#860000"); }, 333);
        };
      if (y == 3) {
        $("#3").css("background-color", "#eeee00");
        document.getElementById("audio3").play();
        setTimeout(function() {
          $("#3").css("background-color", "#b3b300"); }, 333);
        };
      if (y == 4) {
        $("#4").css("background-color", "#0000ff");
        document.getElementById("audio4").play();
        setTimeout(function() {
          $("#4").css("background-color", "#000066"); }, 333);
        };
      }, 500+500*i);
  }
@Otto-AA BINGO!!!!!!!
@Otto-AA THANK YOU!
CamperBot
@camperbot
Nov 12 2016 09:17
danielmw34 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:warning: danielmw34 already gave otto-aa points
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:17
@DanielMW34 You're welcome :)
@DanielMW34 I also struggled with that when I started coding (before FCC) ;)
Daniel
@DanielMW34
Nov 12 2016 09:18
@Otto-AA I would send you something better than brownie points but gitter doesn't allow for that
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:18
@DanielMW34 You can try to help others as a Thank you =D
CamperBot
@camperbot
Nov 12 2016 09:18
otto-aa sends brownie points to @danielmw34 :sparkles: :thumbsup: :sparkles:
:cookie: 357 | @danielmw34 |http://www.freecodecamp.com/danielmw34
Daniel
@DanielMW34
Nov 12 2016 09:19
@Otto-AA yeah, I'm going to have to really look into this to try to wrap my brain around it . I struggled with the callbacks on the pomodoro clock as well. And, I will most definitely play it forward, was helping out some other fCC campers tonight and man, did I ever feel for them working on their first API calls and dealing with JSON / JSONP
@Otto-AA maybe you're a good person to ask... once I finish this project and get my certificate, where in the world of skill level does that place me? Are there any good comparisons like an associates degree? Midway through 2nd/3rd year in a bachelors program? Hire-able?
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:22

@DanielMW34 Hire-able for what?
For a little project: Yes
For a little website: Yes
For a real front-end job: Definitely not ;P

(But I am a newbie, so it may be wrong lol)

Daniel
@DanielMW34
Nov 12 2016 09:23
@Otto-AA by the end of earning all three certificates, would that be hire-able for a "real front end job" ?
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:26
@DanielMW34 Maybe.
I think that depends on your interest in learning things, to try out new things. If you want to become a web-designer, maybe try to make a website for your friends, do some more projects to practice the stuff you learned at FCC
But keep in mind, I am not even so far on FCC as you are. That's just my point of view
Daniel
@DanielMW34
Nov 12 2016 09:28
@Otto-AA I am literally starting a company this weekend to develop a mobile app that I have been working on for 2 years (I am not writing the code at this point). Beyond that, I saw myself going into the field of Geospatial Information Systems because I was an analyst for 8 years using that software/technology.
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:28
@DanielMW34 lol, never heard of that :)
Daniel
@DanielMW34
Nov 12 2016 09:28
@Otto-AA where else have you learned coding if not fCC ? The fact that you knew that or found that solution is REALLY impressive
@Otto-AA basically, Geospatial Information Systems (GIS) === making maps, mapping software, taking that geolocation data (like in the weather map app) and putting it into a visual display
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:30
@DanielMW34 I started with HTML and CSS on Codecademy, then made a really rubbish Website for my piano channel with downloads and stuff. Then I tried to implement some things like a piano to play or a list of all my songs and stuff. By that experimenting with stuff that I wanted to do I learned pretty much ;)
So mostly I learned it on my own with google as resource
@DanielMW34 Thanks for the explanation ;)
CamperBot
@camperbot
Nov 12 2016 09:31
otto-aa sends brownie points to @danielmw34 :sparkles: :thumbsup: :sparkles:
:warning: otto-aa already gave danielmw34 points
Daniel
@DanielMW34
Nov 12 2016 09:35
@Otto-AA Piano channel... you have a youtube channel by any chance?
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:35
Daniel
@DanielMW34
Nov 12 2016 09:36
@Otto-AA muchas gracias
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:36
@DanielMW34 Feel free to share it ^^
Daniel
@DanielMW34
Nov 12 2016 09:36
@Otto-AA that is beautiful
@Otto-AA MOSt DEFinitely
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:37
@DanielMW34 There's what I got so far for my website: http://aapianomusic.bplaced.net/
Daniel
@DanielMW34
Nov 12 2016 09:38
@Otto-AA do you compose these "live" via microphone recording or, do you arrange them with software like garageBand (apple) or Magix ?
@Otto-AA this seriously is beautiful
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:39
@DanielMW34 more or less live. I record a midi with my keyboard and then maybe erase some mistakes with a program.
(If you want to ask more, let's do it in a private chat. That's not really about Front-end anymore O.o)
Annu Nirmal
@annunirmal
Nov 12 2016 09:51
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:54
@annunirmal How far left do you want them? Looks ok for me
Annu Nirmal
@annunirmal
Nov 12 2016 09:54
@Otto-AA try changing the size of the screen
this is not good
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 09:55
ah, I see
Annu Nirmal
@annunirmal
Nov 12 2016 10:01
@Otto-AA after 720px its bizzare
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 10:37
@annunirmal try changing the text-indent with the different screen-sizes
.sidebar-nav li {
    text-indent: 13%;
  }
@annunirmal Also I would suggest to make a design which automatically fits to the size, without declaring everything with @media. This will make it much easier to maintain
@annunirmal This one works pretty nice: text-indent: calc(15% - 5px);
Waqas Abbasi
@Waqas909
Nov 12 2016 11:29

Hello Everyone . Have a look at this:

http://codepen.io/Waqas909/pen/oYgYyy

The random quote generator buttons move up and down based on the quotes Length. Is there anyway to keep them in a fixed area. Thanks It would be helpful

The Tweet button is still in progress
heroiczero
@heroiczero
Nov 12 2016 11:38
@Waqas909 maybe position:absolute;
Waqas Abbasi
@Waqas909
Nov 12 2016 11:48
@heroiczero Position:aboslute for the buttons?
heroiczero
@heroiczero
Nov 12 2016 11:50
@Waqas909 yeah it should work but gotta mess with the margin to position it correctly
Waqas Abbasi
@Waqas909
Nov 12 2016 11:51
@heroiczero Alright I'll give it a try and tell u if it works or not
gargtushar
@gargtushar
Nov 12 2016 11:59
@gargtushar
hello anyone here
I need help
I want to make a select box field , but want images in option box
Waqas Abbasi
@Waqas909
Nov 12 2016 12:01
@heroiczero Umm I tried it and the buttons still move up and down
gargtushar
@gargtushar
Nov 12 2016 12:02
@heroiczero please tell how can I achieve this
Waqas Abbasi
@Waqas909
Nov 12 2016 12:02
@heroiczero Maybe I should define the div with a certain wdith and height?
heroiczero
@heroiczero
Nov 12 2016 12:05
@Waqas909 maybe you could define it outside the div box for the quote since it is probably going up and down in the div box
Waqas Abbasi
@Waqas909
Nov 12 2016 12:06
@heroiczero I'll give it a go
heroiczero
@heroiczero
Nov 12 2016 12:06
@Waqas909 remember to position is so it does not overlap
@gargtushar dont really understand the question
gargtushar
@gargtushar
Nov 12 2016 12:11
I want to make a select box field , but want images in option box
Thayyeb salim
@Thayyebsalim
Nov 12 2016 12:12
obito my friend can you be more clear @gargtushar
gargtushar
@gargtushar
Nov 12 2016 12:12
I want to create a select tag
in html
heroiczero
@heroiczero
Nov 12 2016 12:13
@gargtushar so like an input or button?
gargtushar
@gargtushar
Nov 12 2016 12:13
and in the option field I want to show the image
heroiczero
@heroiczero
Nov 12 2016 12:13
@gargtushar so do u want to select something and then display an image in html
gargtushar
@gargtushar
Nov 12 2016 12:13
<select><option><img src ="path to image"></option></select>
but it's not working
heroiczero
@heroiczero
Nov 12 2016 12:14
@gargtushar doesnt that create a drop down list?
Waqas Abbasi
@Waqas909
Nov 12 2016 12:14
@heroiczero Thanks for the help, It worked
CamperBot
@camperbot
Nov 12 2016 12:14
waqas909 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:cookie: 377 | @heroiczero |http://www.freecodecamp.com/heroiczero
heroiczero
@heroiczero
Nov 12 2016 12:15
@Waqas909 :)
gargtushar
@gargtushar
Nov 12 2016 12:15
it will create a dropdown list, but not showing the image in the oprion
it's the problem
heroiczero
@heroiczero
Nov 12 2016 12:21
@gargtushar try using a background image for each option
@gargtushar probably have to mess with the margins to show the full image or the properties of background image like no-repeat
gargtushar
@gargtushar
Nov 12 2016 12:35
if I use background image then it is working only for firefox
not in google chrome
heroiczero
@heroiczero
Nov 12 2016 12:41
@gargtushar should work for google chrome i have no idea kinda puzzling
Waqas Abbasi
@Waqas909
Nov 12 2016 12:54
@gargtushar Then It's best you search it up on google. Why you are unable to do such a thing. I can guarantee many people would have faced the problem if google chrome wasnt doing something properly
Aman saxena
@neille2406
Nov 12 2016 12:58
can anyone suggest me some projects in html and css?
TasmaniaKrama
@TasmaniaKrama
Nov 12 2016 13:13
function permAlone(str) {
var array = p(str);
function p(a, b, res) {
var b = b || [], res = res || [], len = a.length;
  if (!len) {
    res.push(b);
  }
  else 
    for (var i = 0; i < len; p(a.slice(0, i).concat(a.slice(i + 1, len)), b.concat(a[i]), res) 
       , i++
    );

  return res; 

}

for (var i=0;i<array.length;i++){
    array[i] = array[i].join('');
}
var pattern = new RegExp(/(\w)\1+/);
function rep(string){
    if(pattern.test(string)){
        return false;
    }
    else return true;
}

return array.filter(rep).length;

}

permAlone("abfdefa");
Could someone tell me why this code works on repl.it but not on fcc?
Annu Nirmal
@annunirmal
Nov 12 2016 13:19
@Otto-AA thank you so much man ! i wasted too much time on this. wonder how i missed this . thanks alot
CamperBot
@camperbot
Nov 12 2016 13:19
annunirmal sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 372 | @otto-aa |http://www.freecodecamp.com/otto-aa
Waqas Abbasi
@Waqas909
Nov 12 2016 13:51
Does anyone know how to reference to a text in div in here where "hello world" is??
 $("#tweet").on('click',function(){
     window.open("https://twitter.com/intent/tweet?text="+ "hello world",'window','toolbar=no , menubar=no, resizable=yes');
How does it looks like?
Aman saxena
@neille2406
Nov 12 2016 14:05
best this is what they need now @mesopotamija9
Waqas Abbasi
@Waqas909
Nov 12 2016 14:11
How does one reference the text inside <p> in Javascript?
macieqx
@macieqx
Nov 12 2016 14:14
http://codepen.io/macieqx/pen/VmajOG
I have small problems with css, how do you make in navbar that font is white >.<
kat-mag
@kat-mag
Nov 12 2016 14:21
@macieqx override bootstrap ;3
.navbar-default .navbar-nav > li > a
macieqx
@macieqx
Nov 12 2016 14:23
Oh, i forgot about ">", now it works perfect :D
@kat-mag Thank you
CamperBot
@camperbot
Nov 12 2016 14:23
:cookie: 410 | @kat-mag |http://www.freecodecamp.com/kat-mag
macieqx sends brownie points to @kat-mag :sparkles: :thumbsup: :sparkles:
kat-mag
@kat-mag
Nov 12 2016 14:23
np
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Nov 12 2016 14:32
checkout and provide error
Waqas Abbasi
@Waqas909
Nov 12 2016 14:47
Can someone tell me why this doesnt work?
yy = [24,25,25];
$("body").css('background-color', "rgb(yy[0],yy[1],yy[2])" )
Nicholas FitzGerald
@nicfitzgerald
Nov 12 2016 14:52
Hey all, I was wondering if anyone can help with API/JSON calls.
kat-mag
@kat-mag
Nov 12 2016 15:22
@vipuldcoder Unclosed & messed up tags. And it looks like an example that's given to everybody, so you know...
kat-mag
@kat-mag
Nov 12 2016 15:34
@Waqas909 Yep. Use an API, not your own array with quotes. It's good for mocking up in the beginning, but later on you should be using APIs. You're going to work with them all the time.
and that switch is crazy
Aarya Bhorra
@aarya1302
Nov 12 2016 15:34
@kat-mag is right
I'm trying to do this twitch thing
I don't know why but when I do console.log(val) the order of the result is random please help

var channel = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var urlStream = channel.map(function(val) {
return "https://crossorigin.me/https://wind-bow.hyperdev.space/twitch-api/streams/" + val;
});
var urlChannel = channel.map(function(val) {
return "https://crossorigin.me/https://wind-bow.hyperdev.space/twitch-api/channels/" + val;
});

$(document).ready(function() {
urlStream.forEach(function(val){
$.ajax({
type:"GET",
dataType:"json",
url:val,
success:function(){
console.log(val);
}
});
});
});

Abdulah Hamzic
@hamzicabdulah
Nov 12 2016 15:39
Does anyone here have any experience with the Ionic framework?
kat-mag
@kat-mag
Nov 12 2016 15:42
@aarya1302 uh, I suppose it's because ajax calls are asynchronous... When it get's the data for one channel it prints that
@hamzicabdulah Ionic's going down ;D
Abdulah Hamzic
@hamzicabdulah
Nov 12 2016 15:44
@kat-mag How so?
kat-mag
@kat-mag
Nov 12 2016 15:45
@aarya1302 Oh, and right... Your data's being modified so forEach - that's designed to run on collections - might skip some stuff
@hamzicabdulah It's a framework for mobile front-end when Progressive Apps & Web Components are hyped to the oblivion
Gives no performance advantage over progressive apps
Aarya Bhorra
@aarya1302
Nov 12 2016 15:56
@kat-mag thanks
CamperBot
@camperbot
Nov 12 2016 15:56
aarya1302 sends brownie points to @kat-mag :sparkles: :thumbsup: :sparkles:
:cookie: 411 | @kat-mag |http://www.freecodecamp.com/kat-mag
DumeD
@DumeD
Nov 12 2016 15:59
hi guys
i have recently finished the pomodoro clock project http://codepen.io/emud/pen/vyGyyK
but i'm not so convinced about my code
it's very ripetitive and i have used too many if statements . i tried to think how i could improve but i really don't know. can someone give me some tips?
any suggestions are appreciated
Marko Karadzic
@Karagunis
Nov 12 2016 16:11
Hello Folks! I wanted to ask a question. How do i link or add images into my codepen project?
DumeD
@DumeD
Nov 12 2016 16:13
@Karagunis if you want do add your won images to a codepen project, just upload the images on some site like imgur and then copy the link and paste it in the img tag
How can I fill gap in middle with lither gray
Jesus Guzman
@gdevtech
Nov 12 2016 16:44
@mesopotamija9 Bootstrap adds 15px padding left and right per each col, so just remove the padding left and right
But then again why have sepereate columns
mesopotamija9
@mesopotamija9
Nov 12 2016 16:45
ty i used .col-md-6 .offset-md-3 so i made what i imagined
Jesus Guzman
@gdevtech
Nov 12 2016 16:45
Cool
mesopotamija9
@mesopotamija9
Nov 12 2016 16:52
How I can remove padding from left and right?
Jesus Guzman
@gdevtech
Nov 12 2016 16:53
target the div that has the col class
so for your class nopadding move that next to col-md-6
mesopotamija9
@mesopotamija9
Nov 12 2016 16:54
made it thanks
Aaron
@apalm1341
Nov 12 2016 18:04
@apalm1341
Hey all. Anyone here know of a good online jobs?
*know of good online jobs?
I want to be able to make some money by possibly tutoring people online via programming
Or do some type of program type of job where I can do research or projects
this way I can gain some experience and Learn more
while making some money
Magnus
@magnus195
Nov 12 2016 18:06
Try freelancing @apalm1341
Tom
@moT01
Nov 12 2016 18:09
anyone wanna look for some bugs in my calculator? http://codepen.io/moT01/pen/rWxJoa ---i havent done the "ce" or "back" buttons yet so those wont work
Magnus
@magnus195
Nov 12 2016 18:11
@moT01 for me it works fine, but you could add a limit on how many numbers someone can write
Tom
@moT01
Nov 12 2016 18:12
will do that, thanks @magnus195
CamperBot
@camperbot
Nov 12 2016 18:12
mot01 sends brownie points to @magnus195 :sparkles: :thumbsup: :sparkles:
:cookie: 123 | @magnus195 |http://www.freecodecamp.com/magnus195
Tom
@moT01
Nov 12 2016 18:13
hey heres a question, ...when im working with decimals it sometimes like adds or subtracts like a millionth of a decimal any idea why it does that
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 18:16
@moT01 Look there at Precision: Link
Marko Karadzic
@Karagunis
Nov 12 2016 18:17
Hello everyone. If i want to put some element below diferent element, should i use positioning like (position:absolute) or nesting columns in bootstrap?
like multiple rows and columns and nest them
gargtushar
@gargtushar
Nov 12 2016 18:21
@Waqas909 tnx
Tom
@moT01
Nov 12 2016 18:21
@Otto-AA thanks, im reading up on it, ...i thought it might be something like that
CamperBot
@camperbot
Nov 12 2016 18:21
mot01 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 373 | @otto-aa |http://www.freecodecamp.com/otto-aa
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 18:21
Hey there, can anyone give me feedback on a blog for my school? Just how you like the design, what you would do different
http://www.svalbertgasse.at/
Tom
@moT01
Nov 12 2016 18:24
@Otto-AA looks pretty good, if i had to be real picky id say that the olive green looks too close to the black on my screen, maybe put a little more green in there
im not a fan of the font, that typewriter font, but thats just me
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 12 2016 18:27
@moT01 Thanks for the feedback :+1:
CamperBot
@camperbot
Nov 12 2016 18:27
otto-aa sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 12 2016 18:34
same thing with the rest of it, its all preference and your choice, im not sure i like the whole color scheme in general, peach, green, black and white, ...but thats me, everyone else might says its a great color scheme, ...it is responsive and functional which is more important and takes more time, ...changing a few colors is easy
Daniel
@DanielMW34
Nov 12 2016 18:35
@Otto-AA MY MAN!!!!!!
@Otto-AA care to help me troubleshoot what may be the FINAL bug in my Simon game?
Tom
@moT01
Nov 12 2016 18:38
@DanielMW34 whats the problem
Daniel
@DanielMW34
Nov 12 2016 18:40
@moT01 When using strict mode, the code which executes is either not calling a named function or, that named function is not working (the second option doesn't make a ton of sense because this function is called at the very beginning of each game and works)
@moT01 see lines: 203, 261, 319, 377
@moT01 when LOSING a game while using strict mode, the setNewGame function does not appear to be executing
Daniel
@DanielMW34
Nov 12 2016 18:47
@moT01 THANK YOU it is working now
CamperBot
@camperbot
Nov 12 2016 18:47
danielmw34 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @mot01 |http://www.freecodecamp.com/mot01
Daniel
@DanielMW34
Nov 12 2016 18:47
was missing the () after setNewGame
Tom
@moT01
Nov 12 2016 18:48
@DanielMW34 ha
youre welcome
Daniel
@DanielMW34
Nov 12 2016 18:48
@moT01 you're THAT good
Tom
@moT01
Nov 12 2016 18:48
used the force
hey maybe you can help me, ...im working on my calculator, ...theres an issue when calculating decimals as discussed ealier
wondering what the best way to code something in to fix this is
should i round the decimals, or multiply by 10 and reconvert back to decimal
or maybe theres a different way
built in function or something
@DanielMW34
Daniel
@DanielMW34
Nov 12 2016 18:57
@moT01 what I did was simply pass the element holding your equation a decimal point/period, and when running the computation it worked fine because the method reads it all as a string .... see my code:
http://codepen.io/Daniel_Widrich/pen/BLJVQv
Tom
@moT01
Nov 12 2016 19:10
@DanielMW34 thanks
CamperBot
@camperbot
Nov 12 2016 19:10
mot01 sends brownie points to @danielmw34 :sparkles: :thumbsup: :sparkles:
:cookie: 359 | @danielmw34 |http://www.freecodecamp.com/danielmw34
Dave Learns Coding
@davelearnscoding
Nov 12 2016 19:19
hey guys/gals… just wanted to share my journey .. am a total newb. but i wanted to let me newbz like me see how the journey begins! http://davelearnscoding.blogspot.com/
tcar
@tcar
Nov 12 2016 19:44
hi, i need help with my simon game... why is this not working? it always stays in if statment even when ja[j]is equal to komp[j]. i have put some consol loge, so you can easy check... here is my codepen http://codepen.io/Tcar/pen/GNZWGg
Aaron
@apalm1341
Nov 12 2016 19:59
What is everyone's opinion here of what jobs r best for wanting to delve with android?
I like learning more about android and mobile apps for them
and games in general too
Karen McCulloch
@kazzacarrot
Nov 12 2016 20:15
Hi there,
I have a couple of bugs in my random quote machine webpage http://codepen.io/kazzacarrot/pen/QGNwLy?editors=0110
Somehow, a second twitter button pops up sometimes and the apostrophes in my quotes are displayed as their unicode number
Can anyone help?
Mateusz Kadlubowski
@xeho91
Nov 12 2016 20:17
It pops up only on page load
Karen McCulloch
@kazzacarrot
Nov 12 2016 20:18
@tcar did you get your simon game working?
@xeho91 yeah, but why?
Its got me sooo confused
Mateusz Kadlubowski
@xeho91
Nov 12 2016 20:20
Well... I would just remove this button in HTML code :)
since your JS code already creates one
Karen McCulloch
@kazzacarrot
Nov 12 2016 20:22
$('#tweetBtn iframe').remove();
I remove it before I create new one
But you're right
TasmaniaKrama
@TasmaniaKrama
Nov 12 2016 21:07

function makeFriendlyDates(arr) {
var firstyear = /\d{4}/.exec(arr[0])[0];
console.log(firstyear);
var secondyear = arr[1].replace(/\d{4}-(\d{2})/, '$1');
console.log(secondyear);


}

makeFriendlyDates(['2016-07-01', '2017-07-04']);
I don't understand why in secondyear 07 is not saved but 07-04 it doesn't make any sense.
Tyler Moeller
@TylerMoeller
Nov 12 2016 21:37
@TasmaniaKrama The capture group in your secondyear regex is (\d{2}), so the $1 is equal to 07. You are replacing 2017-07 with 07 which returns 07-04
Mario
@mariomeissner
Nov 12 2016 22:23
Hello guys.
Im working on my quote machine and I have some trouble. Is someone up to help me out one minute?
Tom
@moT01
Nov 12 2016 22:28
@mariomeissner whats the problem
@moT01 The api works correctly because if I use it as a normal URL in my browser it does throw quotes at me
However my code does not seem to pull new data each time
Not even when refreshing the project, which is weird.
Tom
@moT01
Nov 12 2016 22:34
i think i was having that problem, and i think the solution might be... i used a .ajax call and put the line cache: false, in there, i think you can do that in a .getjson as well
not positive on that but it might work
Mario
@mariomeissner
Nov 12 2016 22:35
codepen does strange stuff for http requests
it also apparently blocks cross origin sometimes
i will try doing that
Tom
@moT01
Nov 12 2016 22:38
i tried, couldn't get it working
//clear out that junk in your trunk
Mario
@mariomeissner
Nov 12 2016 22:39
@moT01 xD Its an official FCC comment on the truncate algorithm
@moT01 I didnt write it haha
Tom
@moT01
Nov 12 2016 22:41
oh ha
im playing around with it, ...tried putting the url variable in the function
didnt work
Mario
@mariomeissner
Nov 12 2016 22:42
:((
@moT01 Thank you for trying tho :)
CamperBot
@camperbot
Nov 12 2016 22:43
mariomeissner sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @mot01 |http://www.freecodecamp.com/mot01
Mario
@mariomeissner
Nov 12 2016 22:50
@moT01 It worked
$.ajax({
  dataType: "json",
  url: quoteAPI,
  cache: false,
  success: function(a) {
    quote = a[0].content;
    author = a[0].title;
    $("#quote").html(quote);
    $("#author").html(author);
    $("#twitter").attr("data-text", truncateString(quote, 90));
  }
})
cache: false did it
@moT01 Thanks so much!
CamperBot
@camperbot
Nov 12 2016 22:52
mariomeissner sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: mariomeissner already gave mot01 points
Mario
@mariomeissner
Nov 12 2016 22:52
@camperbot Shut up
Tom
@moT01
Nov 12 2016 22:54
there ya go
Mario
@mariomeissner
Nov 12 2016 22:56
@moT01 Youre my hero
@moT01 How can I pay you back
@moT01 I'll send you a cookie through mail
@moT01 Gimme your zip code (?
Tom
@moT01
Nov 12 2016 22:59
test my calculator, try n break it http://codepen.io/moT01/pen/rWxJoa see if you can find any bugs, theres a couple i know of
Ardis Petermans
@Ardis101
Nov 12 2016 23:02
@moT01 nice work :) numbers are going out of calculator if I keep presing them
Mario
@mariomeissner
Nov 12 2016 23:03
blob
@Ardis101 @moT01 Yup xDDD
Tom
@moT01
Nov 12 2016 23:04
thanks @Ardis101 @mariomeissner, yea i knew of that one, ...didn't get around to fixing it yet
CamperBot
@camperbot
Nov 12 2016 23:04
mot01 sends brownie points to @ardis101 and @mariomeissner :sparkles: :thumbsup: :sparkles:
Tyler Moeller
@TylerMoeller
Nov 12 2016 23:05
@moT01 Floating point arithmetic problem. Try: .05-.04
Ardis Petermans
@Ardis101
Nov 12 2016 23:07
@moT01 I can press (+-*/) before I even enter number and if I do -> +10 it shows as NaN
Tom
@moT01
Nov 12 2016 23:07
@TylerMoeller thanks, yea i knew about that one too, ...those were the two i had left, ...how would you go about fixing that one, ...i could round my decimal somehow, or multiply by 10 and convert back to decimal, or maybe try n find something built in
Ardis Petermans
@Ardis101
Nov 12 2016 23:07
@moT01 +10=+
CamperBot
@camperbot
Nov 12 2016 23:07
mot01 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
Tom
@moT01
Nov 12 2016 23:08
@Ardis101 theres a new one
Tyler Moeller
@TylerMoeller
Nov 12 2016 23:08
@moT01 There are libraries to help with it, but multiplying by 10 and then dividing again after also works
Also, don't forget to set a viewport, it is really small on mobile :)
Tom
@moT01
Nov 12 2016 23:11
did you check it on your phone, or do you have a like an emulator
Tyler Moeller
@TylerMoeller
Nov 12 2016 23:12
@moT01 I loaded this URL from my phone: http://s.codepen.io/moT01/debug/rWxJoa
(iPhone 6)
Tom
@moT01
Nov 12 2016 23:12
k
Ardis Petermans
@Ardis101
Nov 12 2016 23:16
@moT01 I cant divide by zero
@moT01 do anything by 0
Tom
@moT01
Nov 12 2016 23:26
roger that
Tom
@moT01
Nov 12 2016 23:32
thats some good feedback everyone
ADIL KARMOUZI
@mradil16
Nov 12 2016 23:52
Hi everyone. How can I change text direction when hovering a div (I used "direction : rtl" but it doesn't work) : http://codepen.io/mradil16/pen/ZBWyeG
Xavier Sumba
@cuent
Nov 12 2016 23:57
How could I run disabled a challenge?
It doesn't work adding &run=disabled