These are chat archives for FreeCodeCamp/HelpFrontEnd

2nd
Nov 2016
emamadordev
@emamadordev
Nov 02 2016 00:03
@lharv076 post the link to your page
ah so when I view in full page it works... woups
emamadordev
@emamadordev
Nov 02 2016 00:08
so you want it side by side on mobile?
@lharv076
Laurence
@lharv076
Nov 02 2016 00:09
nah on top like that is good (Y)
although I want it side by side when it's a bit smaller than a desktop
(so when I'm in the pen editor)
because right now it looks like this : https://i.imgsafe.org/92f1580b71.png
emamadordev
@emamadordev
Nov 02 2016 00:11
on my screen its side by side
Laurence
@lharv076
Nov 02 2016 00:12
is there a way to keep it side by side until you reach mobile-size?
emamadordev
@emamadordev
Nov 02 2016 00:14
@lharv076 check it out: http://i.share.pho.to/e6d32971_c.png
the second link is bigger
alt
Laurence
@lharv076
Nov 02 2016 00:18
oh weird
Walid Ashri
@walidashri
Nov 02 2016 00:21
@lharv076 if u need it side be side in tablet and laptops use the class col-sm-x
WhiteLeaf1103
@WhiteLeaf1103
Nov 02 2016 00:23
I still dont get the row and col classes...
Walid Ashri
@walidashri
Nov 02 2016 00:25
@WhiteLeaf1103
col1            col2                   col3
@WhiteLeaf1103 blackbox is a row and cols are cols
Jack Marks-Thomas
@JackMarksThomas
Nov 02 2016 00:27
Hey guys, I'm applying for jobs in London, HTML, CSS, and general knowledge of front end development I'm very good at, but a lot of these places seem to want someone with expert level javascript
Aaron Bell
@awb715
Nov 02 2016 00:28
anyone familiar with hover.css?
Jack Marks-Thomas
@JackMarksThomas
Nov 02 2016 00:28
in the few years I have worked freelance I haven't really needed to learn much apart from basics for the odd jquery stuff, do you think I will be able to get a job or should I hit the drawing board until I'm much better at javascript
@awb715 is it a bunch of premade hover effects and you can just add a class to your html I imagine
I used animate.css a few times
Aaron Bell
@awb715
Nov 02 2016 00:31
cool thanks @JackMarksThomas
CamperBot
@camperbot
Nov 02 2016 00:31
awb715 sends brownie points to @jackmarksthomas :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jackmarksthomas
Aaron Bell
@awb715
Nov 02 2016 00:31
@JackMarksThomas how far are you in fcc?
emamadordev
@emamadordev
Nov 02 2016 00:35
@lharv076 maybe you should remove the fixed width of the pic. then use the class col-sm-x
Jack Marks-Thomas
@JackMarksThomas
Nov 02 2016 01:35
I think I'm about %30 in, I'm just kind of doing it as a recap, so far I have done most of the bits before, it's explained very well though!
Ike Orji
@ikeuzo57
Nov 02 2016 01:35
Hi guys I'm about to start the portfolio project and I'm a newbie I need help with the how I set up a single Page application with bootstrap
Luciano
@luchosr
Nov 02 2016 01:59
@ikeuzo57 at the moment I-m in the same project, i am watching this youtube channel, and it looks so interesting. I hope it helps you https://www.youtube.com/watch?v=sBluMtsvCq4&index=1&list=PLHHEH8A1pSa7xks_bIXzO7geTD9s6GXoh
Ken Haduch
@khaduch
Nov 02 2016 01:59
@ikeuzo57 - I make a suggestion to check out the w3schools.com bootstrap lessons, and check the "themes" section for examples of portfolio-type pages. It might be helpful?
@luchosr - see my note above, too...
Ike Orji
@ikeuzo57
Nov 02 2016 02:00
@luchosr Thanks very much I appreciate
CamperBot
@camperbot
Nov 02 2016 02:00
ikeuzo57 sends brownie points to @luchosr :sparkles: :thumbsup: :sparkles:
:cookie: 121 | @luchosr |http://www.freecodecamp.com/luchosr
Luciano
@luchosr
Nov 02 2016 02:00
Oh! thanks a lot!
Ike Orji
@ikeuzo57
Nov 02 2016 02:00
@khaduch thanks very much
CamperBot
@camperbot
Nov 02 2016 02:00
ikeuzo57 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1864 | @khaduch |http://www.freecodecamp.com/khaduch
Rob
@s31181
Nov 02 2016 02:02
hey guys i'm working on the quote generator how do i push the quote from the api to the page?
Tom
@moT01
Nov 02 2016 02:03
@s31181 look into using .ajax and/or .getjson they use it in the excercises
Rob
@s31181
Nov 02 2016 02:04
i looked at it, but i'm not quite understanding what the code is doing is there any material to help me understand what's going on?
Tom
@moT01
Nov 02 2016 02:04
the jquery website gives some info
Rob
@s31181
Nov 02 2016 02:05
cool thanks @moT01
CamperBot
@camperbot
Nov 02 2016 02:05
s31181 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 294 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 02 2016 02:05
looking at examples helps too
gabi
@gikwu1
Nov 02 2016 02:19
anyone want to go through my work and tell me what you think?
Tom
@moT01
Nov 02 2016 02:20
@gikwu1 your indentation could use some help
every tab should be 'another layer deep'
gabi
@gikwu1
Nov 02 2016 02:22
can u specify pls @moT01
Tom
@moT01
Nov 02 2016 02:22
<div 1>
      <div2>
            <div3>
            </div3>
      </div2>
</div1>
<body>
      <div1></div1>
      <div2></div2>
</body>
Joshua Swift
@joshuaswift
Nov 02 2016 02:26

Hey guys, currently working on the Weather App, struggling to access location data from one function inside another function (so I can use the location with the weather API).

I've tried calling the weather function inside the location function but don't think I'm calling it correctly.

Any ideas?
Tom
@moT01
Nov 02 2016 02:28
@Joshuaswift its getting my city
console.log your locationdata and see if your getting the data
where you get and set the location, its not getting that info in your other function
Rob
@s31181
Nov 02 2016 02:31
still working on my Quote Generator - i can't even get the api-string to cast to the page.
Tom
@moT01
Nov 02 2016 02:33
im not getting anything from your url
Tom
@moT01
Nov 02 2016 02:38
you cant use console.log like that i dont think
im not sure what youre asking
i would start with my .getjson and find a way to get the data first, if your site looks pretty but doesn't function its worthless, but if it functions and looks crappy its still usable
heres the url i used to save you some time
Rob
@s31181
Nov 02 2016 02:41
thank you
Tom
@moT01
Nov 02 2016 02:41
use @name
click my name and say it
@s31181
Rob
@s31181
Nov 02 2016 02:42
sorry i'm confused
Tom
@moT01
Nov 02 2016 02:42
click my name and say thanks
Rob
@s31181
Nov 02 2016 02:43
gotcha thanks @moT01
CamperBot
@camperbot
Nov 02 2016 02:43
s31181 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: s31181 already gave mot01 points
Tom
@moT01
Nov 02 2016 02:43
already got point from ya thanks @s31181
CamperBot
@camperbot
Nov 02 2016 02:43
mot01 sends brownie points to @s31181 :sparkles: :thumbsup: :sparkles:
:cookie: 264 | @s31181 |http://www.freecodecamp.com/s31181
gabi
@gikwu1
Nov 02 2016 03:09
how do i include my link to my codepen?
Rob
@s31181
Nov 02 2016 03:09
i think just by coping the url
gabi
@gikwu1
Nov 02 2016 03:10
where do i paste it?
Rob
@s31181
Nov 02 2016 03:10
are you trying to post it in the chat?
or are you trying to submit the assignment
just paste it where you want it to go
gabi
@gikwu1
Nov 02 2016 03:18
i am trying to submit the assignment
codetilyoudrop
@codetilyoudrop
Nov 02 2016 03:20
I'm a bit stuck in the tribute page, I want to add frames or boxes in different color as it is on the sample page but i can't figure out what element to use, I dont recall learning about frames in the course that's why Im a bit lost, help please.. any info in much appreciated, this is what I have so far.. thank you in advance https://codepen.io/codetilyoudrop/pen/qaewrX
Tom
@moT01
Nov 02 2016 03:21
@codetilyoudrop its all css styling
padding, margin, borders, other stuff
w3schools.com is a good spot to learn about that stuff a little
codetilyoudrop
@codetilyoudrop
Nov 02 2016 03:22
@moT01 ah ok now that crossed my mind but when i saw the youtube video with the explanation it said it was all html nothing in CSS, ok now I can figure it out, thank you sooo very much!! :)
CamperBot
@camperbot
Nov 02 2016 03:22
codetilyoudrop sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 295 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 02 2016 03:23
well you can use styling within the html elements
i dont do it like that often
almost never
codetilyoudrop
@codetilyoudrop
Nov 02 2016 03:24
@moT01 ok yea i remember the lesson on styling with CSS I guess the frames is using html,
Evan Beyerle
@ebeyerle
Nov 02 2016 03:46
Did anyone have trouble with the Record Collection exercise in Javascript?
Tom
@moT01
Nov 02 2016 03:46
whats the problem?
i think that may be the most asked about lesson
Evan Beyerle
@ebeyerle
Nov 02 2016 03:47
I can't solve one of the requirements. The second one.
Tom
@moT01
Nov 02 2016 03:48
youre not giving me much to go on
Evan Beyerle
@ebeyerle
Nov 02 2016 03:48
My solution is even similar to others but that second requirement went get checked
Tom
@moT01
Nov 02 2016 03:48
probably missing one of the tests
Evan Beyerle
@ebeyerle
Nov 02 2016 03:49
tracks should have "Take a Chance on Me" as the last element
Tom
@moT01
Nov 02 2016 03:50
paste your code
i would bet, like i said, its one of your if statements, that case is slipping through
Annu Nirmal
@annunirmal
Nov 02 2016 03:53
topic:portfolio
i want every time i come to skill section it animates again and again. can anyone help me out with this
http://codepen.io/nirmalannu/full/amgaqE/
Eloisa Santos
@loisasantos
Nov 02 2016 03:54
i need help.. i can make my navigation stand out when the page scroll...
Tom
@moT01
Nov 02 2016 03:55
@annunirmal what is it you want? you want it to loop your saying?
Evan Beyerle
@ebeyerle
Nov 02 2016 03:55
I can't paste my code
Tom
@moT01
Nov 02 2016 03:56
or it is looping for you? and want it to stop
Annu Nirmal
@annunirmal
Nov 02 2016 03:57
@moT01 yeah i want it to animate every time i come to skill section, right now it only happens once thats in the starting
Tom
@moT01
Nov 02 2016 03:58
so not loop, just animate again when the user comes back to it
Annu Nirmal
@annunirmal
Nov 02 2016 03:58
@moT01 yes
Tom
@moT01
Nov 02 2016 03:59
that looks good by the way
Tessa
@TheTessaMurphy
Nov 02 2016 03:59
I have a strange question. I'm working on the quote machine, and I can't figure out how to load the json document into codepen -- or alternatively, how to load my document into some kind of cloud environment that I can access my document from. All the examples I'm finding are pulling from local files. In a normal working environment I'd just create a js folder and load from there, but with codepen I'm lost.
Annu Nirmal
@annunirmal
Nov 02 2016 03:59
@moT01 yeah but sometimes it animates when screen loads and i miss that animation
Tom
@moT01
Nov 02 2016 04:03
@annunirmal i dont have a quick fix for ya, you could tie it to the scroll bar location somehow
Annu Nirmal
@annunirmal
Nov 02 2016 04:05
@moT01 ok thanks
CamperBot
@camperbot
Nov 02 2016 04:05
annunirmal sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 296 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 02 2016 04:05
@TheTessaMurphy pull from a url for the projects, buy server space for ur own files
@annunirmal not sure if you want to go that route, but its called a parallax effect, so when the scroll bar gets down there it animates, but there might be an easier way
Annu Nirmal
@annunirmal
Nov 02 2016 04:07
@moT01 oaky let me search a bit
Tom
@moT01
Nov 02 2016 04:09
theres a good series on youtube about it
Tessa
@TheTessaMurphy
Nov 02 2016 04:10
I'm using dropbox to store my file. This is the link. I'm wondering if it's in the wrong format. "https://www.dropbox.com/s/tknva9yrc7wcn6i/quotes.json?dl=0"
Sorry, didn't realize that huge icon would appear.
Tom
@moT01
Nov 02 2016 04:13
thats alright, that looks like its pretty close and might work
be sure to use the url of just the file
Tessa
@TheTessaMurphy
Nov 02 2016 04:26
So I tried both ways, with the url ending right at json, before the ? and with the full url as posted. Neither worked. I'm frustrated. I am literally using the code -- straight from freecodecamp, just trying to pull in the document.

Here's the code
$(document).ready(function() {

$("#getMessage").on("click", function(){
  // Only change code below this line.
  $.getJSON("https://www.dropbox.com/s/tknva9yrc7wcn6i/quotes.json?dl=0",function(json) {

            $(".message").html(JSON.stringify(json));
});


  // Only change code above this line.
});

});

Tom
@moT01
Nov 02 2016 04:28
console.log(json); ...see if your getting anything
Tessa
@TheTessaMurphy
Nov 02 2016 04:29
Nope.
Tom
@moT01
Nov 02 2016 04:29
no that url pulls up that whole page, gotta do what i said
maybe
im not sure that one will work either
Tessa
@TheTessaMurphy
Nov 02 2016 04:36
Nope. Maybe the problem is dropbox. Maybe I need to find a different web server.
I need something like cloudinary, but for text files instead of images.
Tom
@moT01
Nov 02 2016 04:39
yea thats not the type of file you're looking for i dont think, that brings up a whole html page
i think most people used an api from another website
i did
Tessa
@TheTessaMurphy
Nov 02 2016 04:41
What website did you use?
Tom
@moT01
Nov 02 2016 04:42
quotesondesign.com
your file does look like it would work, you just need a url that opens that file directly
Tessa
@TheTessaMurphy
Nov 02 2016 04:48
Yeah. It's looking like dropbox doesn't let me do that. I think maybe for the assignment I'll try the quoteondesign site and then play around with json in notepad++ on my machine.
Thanks for your help.
Muhammad Hasham
@MohammadHasham
Nov 02 2016 05:06
how do i reset my tic tac toe game when
what would be the logic
tbc13315
@tbc13315
Nov 02 2016 05:17
Hi everyone. Could someone possibly help me with twitch api project. I can't seem to figure out how/where to use the click functions so I can see "all", "online", "offline" users. This seems to be a major impasse for me. Here is my code so far:
Muhammad Hasham
@MohammadHasham
Nov 02 2016 05:41
Anyone there?
i need help
regarding onClickListener
Sorin Ruse
@sorinr
Nov 02 2016 05:42
@MohammadHasham hi. what about?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 05:43
 $('#reset').click(function(){
    $('.square').empty();
  });
is this the right way to clear tabl elements
Muhammad Hasham
@MohammadHasham
Nov 02 2016 06:01
@sorinr
Sorin Ruse
@sorinr
Nov 02 2016 06:07
@MohammadHasham empty() function removes all child dom elements for the selected '.square' class. u can also use: $('.square').html('');
Muhammad Hasham
@MohammadHasham
Nov 02 2016 06:07
$('#reset').click(function(){
    for(var i=0;i<9;i++){
    $('#b'+i).empty();
    }
  });
it is working like this
@sorinr Thanks for your time and concern.
CamperBot
@camperbot
Nov 02 2016 06:08
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 807 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Nov 02 2016 06:13
@MohammadHasham i would use, if i remember right ur pen, $('#b'+i).text(''); and reinitialize the array with '' empty values
@MohammadHasham in your case ether empty(),html() or text() will do the same i think but most important is also to bring the array to '' empty values
Sorin Ruse
@sorinr
Nov 02 2016 06:19
@MohammadHasham with that function u r now only clearing data visually
Chris Cullen
@123xylem
Nov 02 2016 06:19
Does Anyone know about UNITY Developing??
Im trying to add light but it just wont WORK
http://i65.tinypic.com/157nng5.png
Zo Rana
@zrana86
Nov 02 2016 06:24
Im pretty surprised about the random quote machine
I feel like I haven't learned enough javascript
anyone else feel this way
Austin Steed
@asteed21
Nov 02 2016 06:56
@zrana86 I know what you mean. That is the project I think where the FCC curriculum really starts challenging you to go and find answers independently. It takes a while but it’s doable! At least for me I spent multiple hours researching different facets of incorporating APIs with JQuery before it all started to make sense. The FCC JSON API section is a good start, but that’s all it is.
Sorin Ruse
@sorinr
Nov 02 2016 07:05
@zrana86 you can do the random quote challenge without using any api by using an array of quotes but i strongly recommend u to do it by using an api. u will learn how to make an api call and interpret the response u get back from the api
Adam Pinsky
@adampinsky
Nov 02 2016 07:17
speaking of apis..... hello everyone. I'm just about finished with my Weather App, and I'm having trouble with my XMLHttpRequest. It gets too ready state 1 then ....nothing. Any pointers? Thanks in advance. http://codepen.io/adampinsky/pen/yOYLge?editors=0011
Alexander Huynh
@caesarsalad93
Nov 02 2016 08:00
@zrana86 yes, I came on this chat right now just to say that
Hèlen Grives
@mesmoiron
Nov 02 2016 08:48
@oppiniated thanks
CamperBot
@camperbot
Nov 02 2016 08:48
mesmoiron sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
:cookie: 206 | @oppiniated |http://www.freecodecamp.com/oppiniated
Amy Walters
@codecampamy
Nov 02 2016 11:11
Good morning! I've completed my tribute page but I'm unhappy with the way that the image aligns - it's definitely not centred. I could also do with any helpful critique as to ways I could make the code 'good code' as I am a complete beginner. Would appreciate any feedback, thank you http://codepen.io/codecampamy/pen/ALmAJV
hungnv24
@hungnv24
Nov 02 2016 11:13
@codecampamy you can add "text-align: center" in image parent (div.image)
you will also want to add .image img {max-width: 100%} in case of overflow
Ken Haduch
@khaduch
Nov 02 2016 11:20

@codecampamy - Hello, good day... add this <img class="center-block" class to your image and it will center it, since you are using bootstrap. Also, if you go to the CSS tab on CodePen, and in the options at the right of the box, the little down arrow, use the "Tidy CSS', it will put your CSS code into a more standard format. You can also do that with the HTML panel.

It looks like you haven't closed any of your <div> elements. Or at least many of them like the container, and row, and maybe the jumbotron. And the blockquote... check those things. The browsers help correct for errors like that, but it's better to be more precise with the proper closing tags for elements that require them. But you can start with the "tidy" options, they help with indentation, and that gives clues as to the structure.

It's a good start - good luck!

Walid Ashri
@walidashri
Nov 02 2016 11:22
@khaduch tried this center-block didn't work ?!:(
Ken Haduch
@khaduch
Nov 02 2016 11:24
@walidashri - in this case, it has to be on the img itself - it worked for me. On Amy's page, you have to click the "Run" button on top, since it is set up to not automatically reload. Not sure if that's where you are trying this, or on your own page?
Walid Ashri
@walidashri
Nov 02 2016 11:25
@khaduch :) I know that but didn't work :(
fijeko
@fijeko
Nov 02 2016 11:25
@adampinsky I've just tried your application, and it's give me all 4 XMLRequest stage in console, but on line 119 there is an error (iconCodes[i].indexOf(iconID) >= 0) you use indexOf on object, iconCode[i] is element of array and that is object
Walid Ashri
@walidashri
Nov 02 2016 11:25
I tried col-md-offset it did
Ken Haduch
@khaduch
Nov 02 2016 11:25
@walidashri - hmmm - it worked fine for me?
Amy Walters
@codecampamy
Nov 02 2016 11:26
Thanks - I just tried adding the <img class="center-block"> after listing the source in html @khaduch and now there is no image at all? What am I doing wrong - am I adding it to the wrong part? Also as re closing the <div> elements should I do that after listing each element in the html? Thanks!http://codepen.io/codecampamy/pen/ALmAJV
CamperBot
@camperbot
Nov 02 2016 11:26
codecampamy sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1865 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Nov 02 2016 11:27
@walidashri - this screen shot of the page with that class="center-block" @codecampamy
Walid Ashri
@walidashri
Nov 02 2016 11:27
@khaduch won't believe it it works in diff screen size
Ken Haduch
@khaduch
Nov 02 2016 11:27
blob
Walid Ashri
@walidashri
Nov 02 2016 11:27
anyways gtg now back for it latter @khaduch thanks
CamperBot
@camperbot
Nov 02 2016 11:27
walidashri sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1866 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Nov 02 2016 11:29
@codecampamy - I probably wasn't clear - it should be added to your existing <img, looks like you added a sepearate <img class="center-block"> within your img element. Take away the <img and closing > that you added and try it again.
@codecampamy - in other words, your imag element should look like this:
<img class="center-block img-responsive" src="https://res.cloudinary.com/codecampamy/image/upload/v1476875523/Screen_Shot_2016-10-19_at_11.45.19_xxj1bi.png" alt="Priscilla Welch crossing the finish line">
            </img>
@codecampamy - also, I'm adding another Bootstrap class, img-responsive - going to edit the code I posted above. It will make the image resize when the browser viewport size changes.
Amy Walters
@codecampamy
Nov 02 2016 11:35
I think I have it! @khaduch http://codepen.io/codecampamy/pen/ALmAJV
Ken Haduch
@khaduch
Nov 02 2016 11:37
@codecampamy - your other question about closing the <div> - each <div> should have a matching </div> somewhere, which you know. How and when you close them depends on the way you want your page to "flow" - if you are applying a certain style to a <div> and its children, you want to keep the "parent" div open until all of the children included. You can also just have single div elements without any children. They are "divisions" on the page, how you use them is up to your page design.
@codecampamy - it should be <img class= "center-block img-responsive" - the class is center-block, there has to be a dash in there between the words. And typically, I would not put spaces between the class= and the ", it is just more standard form, from what I see.
Amy Walters
@codecampamy
Nov 02 2016 11:43
Thanks again @khaduch - I think the issue I've had today is I've done a week of looking at this stuff everyday when I began code camp a couple of weeks ago and then my kids were off school for a week and I haven't been able to check in to keep this "language" and the rules all fresh in my mind . I'm going to bear this in mind look at the code now to close the tags. Thanks for all your time and advice
CamperBot
@camperbot
Nov 02 2016 11:43
codecampamy sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: codecampamy already gave khaduch points
Ken Haduch
@khaduch
Nov 02 2016 11:45
@codecampamy - you're welcome. It can be time-consuming, and having kids running around makes it difficult. And I find that I get "rusty" if I don't do some coding regularly. You just need to get back into the routine. Take your time, it'll come along! Cheers!
codeandrew
@codeandrew
Nov 02 2016 11:47

hello guys is it okay to Partition Ubuntu into 80gb
root - 20gb
home - 52gb
swap - 8 gb

I have 1TB HD and 8gb Ram

tcar
@tcar
Nov 02 2016 12:20
how can i start and stop interval by clicking on the same button?
tcar
@tcar
Nov 02 2016 12:26
yeah, but i want to start timer again when i press the same button
A_A
@Otto-AA
Nov 02 2016 12:28
@tcar when you clear the interval you can set it to false afterwards. And when clicking, check if it is false. IF, then setInterval ELSE clearInterval
@tcar Was this understandable?
tcar
@tcar
Nov 02 2016 12:43

`
$(".sredina").on ("click",pomodor);
function pomodor(){

if(interval==false){
interval=true;
    clearInterval(interval);

}
else{interval=setInterval(tajmer,1000);
interval=false;}
}
`

why is this not working?
Ken Haduch
@khaduch
Nov 02 2016 12:49
@tcar - the formatting is a little confusing there. It seems that, at least the way I would think about this, if ( interval === false), then you would want to start the timer? But you are using the same variable for your "flag" value and your return from setInterval... so I would do something like this, and you have to make sure to make these variables "global", so that they retain the value:
var timerRunning = false;
var interval = null;
// then in the place where you are handling your click
if ( timerRunning === false ) {
    interval = setInterval(...);  // you set your arguments where I put "..."
    timerRunning = true;
} else {
    // timer is running
    timerRunning = false;
    clearInterval(interval);
    interval = null;
}
tcar
@tcar
Nov 02 2016 12:53

tahnks, guys... i did it like this ```
$(".sredina").on ("click",pomodor);
function pomodor(){

if(interval==false){
interval=true;
interval=setInterval(tajmer,1000);

}
else{ clearInterval(interval);
interval=false;}
}
```

Adam Pinsky
@adampinsky
Nov 02 2016 13:21
@fijeko, thanks so much for taking a look at it. Someone had already helped me through my previous issue. I'm currently working on the issue with the icons.
CamperBot
@camperbot
Nov 02 2016 13:21
adampinsky sends brownie points to @fijeko :sparkles: :thumbsup: :sparkles:
:cookie: 324 | @fijeko |http://www.freecodecamp.com/fijeko
Muhammad Hasham
@MohammadHasham
Nov 02 2016 13:23
@sorinr really a valid point thanks for that
CamperBot
@camperbot
Nov 02 2016 13:23
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 809 | @sorinr |http://www.freecodecamp.com/sorinr
Muhammad Hasham
@MohammadHasham
Nov 02 2016 13:41

@sorinr

    for (var i = 0; i <= 9; i++) {
    $('#b'+i).text('');
    arr.push('');
    arr1.push('');

why is this not working?

i am really stuck
Clyde Lobo
@oppiniated
Nov 02 2016 13:56
@MohammadHasham What are you trying to achieve?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 13:57
Can you help me with my reset function @oppiniated
in tic tac toe game
Clyde Lobo
@oppiniated
Nov 02 2016 13:58
I have not taken that challenge, but I can help
Muhammad Hasham
@MohammadHasham
Nov 02 2016 13:59
i am trying to clear the values from the array]
and to change the text of elements as well'
@oppiniated
am i doing that right?
Clyde Lobo
@oppiniated
Nov 02 2016 13:59
@MohammadHasham Do you have a link I can see this ?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:12
yes
sure
@oppiniated
i'll send you my pen
you have to enter 1 and X for first two alerts
@oppiniated
can anyone help me?
marzelin
@marzelin
Nov 02 2016 14:22
@MohammadHasham why two arrays: arr and arr1?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:22
one for computer input and for for player input
@marzelin the last function is not emptying the arrays
marzelin
@marzelin
Nov 02 2016 14:23
@MohammadHasham but there is only one board, both for player and computer
Amy Walters
@codecampamy
Nov 02 2016 14:23
Does anyone have any online resources the could help me code my portfolio webpage - for example it's taken me about 30 minutes to work out that the term I think I need to get the effect I want is parallax scrolling! Anyway going to crack on and try and get something together - thanks
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:23
Yes!
but values are maintained in two arrays
@marzelin
marzelin
@marzelin
Nov 02 2016 14:24
@MohammadHasham ah, you like to complicate things. cool
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:24
@marzelin my bad.
will correct those things once i complete
the reset is really frustrating me
c0d0er
@c0d0er
Nov 02 2016 14:25
@toianw thanks
CamperBot
@camperbot
Nov 02 2016 14:25
:warning: c0d0er already gave toianw points
c0d0er sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
marzelin
@marzelin
Nov 02 2016 14:26
@MohammadHasham your reset function is just pushing more values to the arrays, not emptying them.
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:26
@marzelin how can i empty that
so that it would use those places again
marzelin
@marzelin
Nov 02 2016 14:27
ie use indexes
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:27
yes how can i do that
@marzelin
marzelin
@marzelin
Nov 02 2016 14:28
@MohammadHasham have you completed basic javascript challenges?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:28
Yes!
ofcourse
@marzelin oka got that
@marzelin Thanks
CamperBot
@camperbot
Nov 02 2016 14:29
mohammadhasham sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:cookie: 892 | @marzelin |http://www.freecodecamp.com/marzelin
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:29
i'll use splice
Now i have done what you said the array is empty but still it does not take new elements
@marzelin
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:34
i have made the length zero and then re - initialized the arrays
@marzelin
marzelin
@marzelin
Nov 02 2016 14:34
@MohammadHasham
  $('#reset').click(function(){

    for (var i = 0; i <= 9; i++) {
    $('#b'+i).text('');
    arr[i] = '';
    arr1[i] = '';

   }   
     console.log(arr);
  });
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:36
@marzelin still the problem persits
the array is clean now but when you click the cell
marzelin
@marzelin
Nov 02 2016 14:36
@MohammadHasham it would really speed up debugging and development if you temporarily hard coded values for player choice to avoid this annoying pop ups
Clyde Lobo
@oppiniated
Nov 02 2016 14:36
@MohammadHasham Will look into it later
Muhammad Hasham
@MohammadHasham
Nov 02 2016 14:37
that had the value it shows as if the values are still there @marzelin
@marzelin okay will take note of that
sorry for inconvenience
marzelin
@marzelin
Nov 02 2016 14:43

@MohammadHasham it's no surprise since you added local vars

    var arr = [];
    var arr1 = [];

I'd suggest you to deep dive into learning JavaScript before taking those front end projects. Otherwise it will be very frustrating experience.

Clyde Lobo
@oppiniated
Nov 02 2016 14:45
@marzelin Agree on that
Sorin Ruse
@sorinr
Nov 02 2016 15:27
@MohammadHasham if i remember right, at the beginning of your js code you where initializing your arr with empty strings ''. as you need it into the reset, i would suggest to move the initializing code into a function and call it whenever you want
Muhammad Hasham
@MohammadHasham
Nov 02 2016 15:27
@sorinr yeah did that
now i just wanted to ask that how can i make multiple screens
like in the given codepen for asking about player sign and number of players
@sorinr
arbershabani97
@arbershabani97
Nov 02 2016 15:35
hello guys, I'm having hard time building the random quote machine, I'm not sure how I'm supposed to make javascript work together with html and css on codepen. Any advices? or any videos where I can learn how to do that? thank you!
I just found some videos, so whatever, don't bother finding anything, because I'm checking out those
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 15:52
@arbershabani97 you write the each piece of code in its respective window
html goes inside html window, css inside css window and js inside js window.. you should probably know this coming this far in FCC challenges.
What issues are you facing? @arbershabani97
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:01
var str = 'thisIsMyString';
var arr = str.split("");
for (var i=0;i<arr.length;i++) {
if(/[^a-z]/.test(arr[i])) {
arr.splice(i, 0, "-");
}

    }
Could someone tell me why this isn't working?
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:03
@TasmaniaKrama do you know why few lines are greyed out?
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:04
No :( but I did notice it
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:04
try str.split('')
two single quotation
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:05
@NitinNair89 still endless loop :/
var str = 'thisIsMyString';
var arr = str.split('');
for (var i=0;i<arr.length;i++) {
if(/[^a-z]/.test(arr[i])) {
arr.splice(i, 0, '-');
}
}
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:06
why isn't the var keyword in pink color?
what else did you write in the code?
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:06
nothing
I am building something but was testing parts of the code
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:06
hmm
var arr[]
Parley Kennelly
@parleydk
Nov 02 2016 16:07
@Otto-AA On my iPhone, the menu items and social buttons at the bottom didn't do anything when clicked in iOS Safari. However I think I determined that it's something to do with codepen more than my code. I'll post it on my host shortly to confirm.
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:08
var arr[] @TasmaniaKrama
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:09
@NitinNair89 ?
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:09
instead of var arr use var arr[]
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:10
you can't do that. Now it won't even run.
The first 2 lines work like they should.
It's something in for and if and splice that causes the endless loop.
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 16:11
add console.log then
Eric Weiss
@eweiss17
Nov 02 2016 16:11
try console.log(arr[i]) after each for loop iteration to see what is going on
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:13
seems like arr.splice(i, 0, '-'); is causing problems
I removed it and placed console.log(arr[i]); and it only displays when the if is met
So it's arr.splice(i, 0, '-'); that is causing trouble
Vassil Kurktchiev
@kurkweb
Nov 02 2016 16:13
Hello, I linked the jQuery script src from the google cdn to my html document. But when I create a new script.js file and begin using jQuery syntax it does not display on my chrome browser. It does display if I write <script>//jQuery stuff</script> at the bottom of the head tag. Any one know why it is not working in a seperate file?
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:17
Ahhh I think I get it
when it's spliced the next index will have the same trigger (since I moved it) and it causes endless loop
Vassil Kurktchiev
@kurkweb
Nov 02 2016 16:24
figured it out XD
TasmaniaKrama
@TasmaniaKrama
Nov 02 2016 16:28
How would you use regexp to find and remove spaces but not - since .replace(/\s/g, ''); removes both?
Luis Felipe López G.
@luishendrix92
Nov 02 2016 17:07
I thought \s only removed whitespace, not -
var str = "This is awesome  lol-lero "
str.replace(/\s/g, '')
// Output: "Thisisawesomelol-lero"
Eslsamu
@Eslsamu
Nov 02 2016 17:16
Hey guys, how do I get an image in the center of a page? Like it works for "text-center". center-block has no effect
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 17:17
@Eslsamu add margin:0 auto; to that image
Eslsamu
@Eslsamu
Nov 02 2016 17:21
no effect...
Tyler Moeller
@TylerMoeller
Nov 02 2016 17:21

@Eslsamu Wrap it in a div with text-center:

<div class="text-center">
  <img src="https://placehold.it/320x240">
</div>

or use CSS:

<img id="my-image" src="https://placehold.it/320x240">
#my-image {
  display: block;
  margin: 0 auto;
}
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 17:21
@Eslsamu How did you add it?
Eslsamu
@Eslsamu
Nov 02 2016 17:24
ah okay with display block it works
thank you:)
what does it do?
A_A
@Otto-AA
Nov 02 2016 17:27
@parleydk Ah ok
Atharva Pandey
@atharvajava
Nov 02 2016 17:29
@NitinNair89 long time
FrancoCanova
@FrancoCanova
Nov 02 2016 17:30
Can anyone help please ? I dont know what im doing wrong but it isn't working.
function mutation(arr1) {

  var arr2 = arr1.map(function(iter) {
    return iter.toLowerCase();
  });

  var elem1 = [];
  var elem2 = [];
  var tracker;

  elem1.push(arr2[0]);
  elem2.push(arr2[1].split(""));



  for (i=0;i<elem2.length;i++) {
    tracker = elem1.indexOf(elem2[i]);
    if (tracker === -1) {
      break;
    }
  }
  if (tracker === -1) {
     return false;
    } else {
     return true;
  }
}

mutation(["Alien", "line"]);
A_A
@Otto-AA
Nov 02 2016 17:31
@FrancoCanova What should it do?
FrancoCanova
@FrancoCanova
Nov 02 2016 17:32
Sorry, the challenge is called Mutations
its supposed to check if all the letters of element are in 1
A_A
@Otto-AA
Nov 02 2016 17:33
@FrancoCanova k, let me thing
FrancoCanova
@FrancoCanova
Nov 02 2016 17:33
if all the letters of element 2 are in 1
Ok
A_A
@Otto-AA
Nov 02 2016 17:35
@FrancoCanova Why do you call break instead of returning false right there (don't think that's the error, but it's cleaner then ;) )
FrancoCanova
@FrancoCanova
Nov 02 2016 17:38
I was afraid that if i put a return true outside of the for loop it would overwrite the return false. So basically when there is a return it automatically breaks out of the function right ?
@Otto-AA
A_A
@Otto-AA
Nov 02 2016 17:38
@FrancoCanova Yeah, it stops the function and returns that thing
FrancoCanova
@FrancoCanova
Nov 02 2016 17:38
perfect
A_A
@Otto-AA
Nov 02 2016 17:40
elem2.push(arr2[1].split("")); will make elem2 [["l","i","n","e"]]. Is this intended?
( you can use return elem2 to see that)
FrancoCanova
@FrancoCanova
Nov 02 2016 17:45
No, i want one array only. I should do elem2 = arr[1].split(""). Thanks
@Otto-AA Thanks
CamperBot
@camperbot
Nov 02 2016 17:46
francocanova sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @otto-aa |http://www.freecodecamp.com/otto-aa
A_A
@Otto-AA
Nov 02 2016 17:46
@FrancoCanova Yeah, you're welcome :)
Nitin Chandran Nair
@NitinNair89
Nov 02 2016 17:51
@atharvajava Hello buddy
Atharva Pandey
@atharvajava
Nov 02 2016 18:00
@NitinNair89 so where are you in the challanges did you complete javascript
j1417
@j1417
Nov 02 2016 18:02
hi !! why when i reduce the window size the text goes out of the container?? http://codepen.io/Juan1417/pen/wowevJ
Ugochukwu Onyejiaka
@ugofred
Nov 02 2016 18:16
Hello people
Please I need help with my carousel, I'm not sure why its not loading
here is my code pen http://codepen.io/ugofred/pen/VmZLNw This is for my tribute page
herbie vd berg
@herbievdberg
Nov 02 2016 18:21
hi,can anyone plz help me..i want a img to appear when the user hover over a text..what is the code for that.
A_A
@Otto-AA
Nov 02 2016 18:23
@herbievdberg Suppose following is your html
<div class="hoverForIMG"><p>some Text</p><img src="" clas="..."></div>
Sorin Ruse
@sorinr
Nov 02 2016 18:24
@ugofred add in settings javascript first jquery and after bootstrap.js
A_A
@Otto-AA
Nov 02 2016 18:24
@herbievdberg Then an CSS option would be:
.hoverForIMG img {
   display: none;
}
.hoverForIMG p:hover + img {
   display: block;
}
@herbievdberg See here for the + selector: http://www.w3schools.com/cssref/sel_element_pluss.asp
herbie vd berg
@herbievdberg
Nov 02 2016 18:29
@Otto-AA ok thnx,will try that quickly
CamperBot
@camperbot
Nov 02 2016 18:29
herbievdberg sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 350 | @otto-aa |http://www.freecodecamp.com/otto-aa
Karolis
@Karoliss
Nov 02 2016 18:51
hello. can anyone tell me why pictures are not similar ? https://codepen.io/karke/pen/BzvYqx
j1417
@j1417
Nov 02 2016 18:52
hi!! i have a problem with my random quote generator... why the text goes out of the container when i reduce the window's size??http://codepen.io/Juan1417/pen/wowevJ
fccbcae16c6
@fccbcae16c6
Nov 02 2016 19:11
Can anyone help me figure out how to get my image to show up on my portfolio page that I'm working on? Sometimes it shows up, sometimes it doesn't http://codepen.io/fccbcae16c6/pen/qaeaYo
marzelin
@marzelin
Nov 02 2016 19:14
@fccbcae16c6 imgur blocks requests from codepen. you have to use another image host.
fccbcae16c6
@fccbcae16c6
Nov 02 2016 19:15
@marzelin do you know what i can use instead of imgur?
Muhammad Hasham
@MohammadHasham
Nov 02 2016 19:23
I know this if off-topic but can anyone help me regarding Upwork!
Ken Haduch
@khaduch
Nov 02 2016 19:30
@fccbcae16c6 - you can try postimg.org, that is a place to post pics that you can link to.
@fccbcae16c6 - oh, it looks like you changed it. Now your image is really large! I think that I see your shoulder. You should, perhaps, set a max-width property on your CSS id for #me?
mmbrown2000
@mmbrown2000
Nov 02 2016 19:45
Hi, I'm new here. Can anyone tell me how they included their image on their tribute page? I mean, I know the code but if you don't have your own server, where are you calling the image from?
Tom
@moT01
Nov 02 2016 19:47
find one from another url@mmbrown2000
CamperBot
@camperbot
Nov 02 2016 19:47
find one from another url@mmbrown2000
nothing found
mmbrown2000
@mmbrown2000
Nov 02 2016 19:48
Oh, I see someone was already talking about this. I will try postimg.org
fccbcae16c6
@fccbcae16c6
Nov 02 2016 19:50
@khaduch @marzelin thanks both of you! I ended up using cloudinary which is working fine for now. And in my CSS I I used display:block
CamperBot
@camperbot
Nov 02 2016 19:50
fccbcae16c6 sends brownie points to @khaduch and @marzelin :sparkles: :thumbsup: :sparkles:
:star2: 1867 | @khaduch |http://www.freecodecamp.com/khaduch
:cookie: 895 | @marzelin |http://www.freecodecamp.com/marzelin
mmbrown2000
@mmbrown2000
Nov 02 2016 19:59
CamperBot and MoT01 what does "one from another url@mmbrown2000" mean? Is there something I was supposed to do that I missed?
j1417
@j1417
Nov 02 2016 20:05
hi!! i have a problem with my random quote generator... why the text goes out of the container when i reduce the window's size??http://codepen.io/Juan1417/pen/wowevJ
Tom
@moT01
Nov 02 2016 20:07
let me know if you find out, ...you can hide it with overflow: hidden; on your container i believe
you could try and set a max-height on you text div
@mmbrown2000
just find an image online somewhere and use that url
Ken Haduch
@khaduch
Nov 02 2016 20:13
@mmbrown2000 - I think that the message was "find one from another URL", meaning find another image. The URL and your @mmbrown2000 just got smashed together. Camperbot was just doing an automatic response to the "find one ...", it has some keywords and phrases that it searches for.
Tom
@moT01
Nov 02 2016 20:14
@khaduch
wanna help me out?
Ken Haduch
@khaduch
Nov 02 2016 20:18
@j1417 - you have some strangeness going on there. FOr one thing, do not include bootstrap in your HTML panel - it should already be included because you have it in your CSS control panel as an external lib. Then you are messing with bootstrap's classes .container-fluid - that could be causing confusion in the results? The next thing is that using the grid and col-xs-* is somewhat restrictiing in that it will not have any "flexibility" when you go to a smaller screen size, so I think that it is doing its best to try and fit your text and image in the same space? And then, you are changing the i element and putting fixed margins and widths on it - which will also cause problems with the placement of elements on the smaller screen...
@moT01 - I can try - what have you got? I cannot find an earlier comment from you with a question?
Tom
@moT01
Nov 02 2016 20:19
yea i didnt ask yet
im working on map the debris and getting a strange result when i try to push an object to an array
Ken Haduch
@khaduch
Nov 02 2016 20:19
@moT01 - oh, I haven't done that yet, but do you have a URL? Oops, there it is... :)
Tom
@moT01
Nov 02 2016 20:21
do you see what i am talking about
masteresp
@masteresp
Nov 02 2016 20:21
Hey guys I'm working on my tribute page. Could someone explain how the bootstrap grid works, and how I can use it?
Tom
@moT01
Nov 02 2016 20:23
i dont know a whole lot of bootstrap but its like a grid with 12 columns in it
Ken Haduch
@khaduch
Nov 02 2016 20:24
@moT01 - I don't know what I'm looking at there on your project?
Tom
@moT01
Nov 02 2016 20:24
theres a bunch of predefined styling
masteresp
@masteresp
Nov 02 2016 20:24
Can anyone help?
Tom
@moT01
Nov 02 2016 20:25
the console logs, ...take a look at them in the browser, it shows the first object, ...looks like it right, but if you click on it or the array right after it, it shows different data in there
@masteresp did you do the bootstrap section?
marzelin
@marzelin
Nov 02 2016 20:26
@masteresp what's wrong with bootstrap documentation?
masteresp
@masteresp
Nov 02 2016 20:26
@moT01 Yeah
But I'm not sure how to use the grid
like col-md*
Ken Haduch
@khaduch
Nov 02 2016 20:26
@moT01 - hmmm... not sure what to make of your project yet?
masteresp
@masteresp
Nov 02 2016 20:27
something like that...
@marzelin Nothings wrong with it
Parley Kennelly
@parleydk
Nov 02 2016 20:27
@masteresp here's the official BootStrap site: http://getbootstrap.com/css/
masteresp
@masteresp
Nov 02 2016 20:28
@parleydk Yeah I've already read through that
marzelin
@marzelin
Nov 02 2016 20:28
masteresp
@masteresp
Nov 02 2016 20:28
ok
i'll check it out
Tom
@moT01
Nov 02 2016 20:28
for instance it goes through the first loop, puts the data in obj.name "sputnik" and obj.orbitalperiod 365 or whatever, and i push that to the array, ...and the array gets different data in it
Parley Kennelly
@parleydk
Nov 02 2016 20:28
Tom
@moT01
Nov 02 2016 20:29
its like it gets overwritten when it goes through the second loop
masteresp
@masteresp
Nov 02 2016 20:29
I'm using the read-search-ask method. First I read up on it and searched google, now im asking you guys ;)
j1417
@j1417
Nov 02 2016 20:31
@khaduch thanks!
CamperBot
@camperbot
Nov 02 2016 20:31
j1417 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1868 | @khaduch |http://www.freecodecamp.com/khaduch
Parley Kennelly
@parleydk
Nov 02 2016 20:31
I've only completed the first project and I'm almost done with the second. I did a bunch of trial and error. I still don't know if it meets best practice.
I typed a lot and then scrapped the whole layout, then started over just keeping the content.
I did that about three times.
j1417
@j1417
Nov 02 2016 20:32
i delted all the css and started again @khaduch
masteresp
@masteresp
Nov 02 2016 20:32
@parleydk Can I see your code pen?
Tyler Moeller
@TylerMoeller
Nov 02 2016 20:32
@masteresp Maybe this pen will help give a better understanding of how the bootstrap grid works after reading through the docs: http://codepen.io/TylerMoeller/pen/qNrbok
Parley Kennelly
@parleydk
Nov 02 2016 20:32
sure.
masteresp
@masteresp
Nov 02 2016 20:32
For the tribute page
Parley Kennelly
@parleydk
Nov 02 2016 20:33
look at anything you want: http://codepen.io/pdkennelly/
masteresp
@masteresp
Nov 02 2016 20:33
thx @parleydk
CamperBot
@camperbot
Nov 02 2016 20:33
masteresp sends brownie points to @parleydk :sparkles: :thumbsup: :sparkles:
:cookie: 125 | @parleydk |http://www.freecodecamp.com/parleydk
Ken Haduch
@khaduch
Nov 02 2016 20:34
@moT01 - try changing the code to this - basically, create a new Object each time you loop, because I think that objects are not pushed by value, but by reference? This code seems to work:
  //var newObj = {};

  for(i=0; i<arr.length; i++) {
    var newObj = new Object;
    newObj.name = arr[i].name;
    newObj.orbitalPeriod = arr[i].avgAlt;
    newArr.push(newObj);
    console.log(i);
    console.log(newObj);
    console.log(newArr);
  }
}
Parley Kennelly
@parleydk
Nov 02 2016 20:34
for the tribute page I just tried to replicate the layout Quincy had. Very simple and basic. for the portfolio I didn't try to replicate the look and fee. just meet the user stories and make it look not ugly
masteresp
@masteresp
Nov 02 2016 20:35
@parleydk Did you look at his code?
mmbrown2000
@mmbrown2000
Nov 02 2016 20:37
...verified email, maybe that was the problem
Tom
@moT01
Nov 02 2016 20:38
@khaduch hey thanks, that looks like it worked, I should have got that
CamperBot
@camperbot
Nov 02 2016 20:38
mot01 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1869 | @khaduch |http://www.freecodecamp.com/khaduch
masteresp
@masteresp
Nov 02 2016 20:38
Then how did you figure out this stuff ?
<div class="col-lg-6 col-lg-offset-3 col-md-6 col-md-offset-2 col-xs-12">
@parleydk ?
Tom
@moT01
Nov 02 2016 20:39
i think the col-lg-6 means that on a large screen that element takes up 6 columns
Parley Kennelly
@parleydk
Nov 02 2016 20:39
no I didn't look at his code. I just played with the numbers until I thought it looked about right.
Alexander Huynh
@caesarsalad93
Nov 02 2016 20:39
Hello beautiful people. I've reached the JSON/AJAX section of the lessons, but I feel like it just provides the code without explaining it all that well. Could someone help me try to comment through whats going on here?
Ken Haduch
@khaduch
Nov 02 2016 20:39
@moT01 - you're welcome.
Alexander Huynh
@caesarsalad93
Nov 02 2016 20:40
json.forEach(function(val) {
var keys = Object.keys(val);
html += "<div class = 'cat'>";
keys.forEach(function(key) {
html += "<strong>" + key + "</strong>: " + val[key] + "<br>";
});
html += "</div><br>";
});
Parley Kennelly
@parleydk
Nov 02 2016 20:40
and offset, saves you making a div to the left just to take up blank space.
Tom
@moT01
Nov 02 2016 20:40
@caesarsalad93 yea i hear ya on that, ...it didn't explain a lot
@caesarsalad93 did a lot of reading to sort of figure it out
Alexander Huynh
@caesarsalad93
Nov 02 2016 20:40
@moT01 good to know I'm not the only one
@moT01 any particular resource you recommend that clears it up?
Tom
@moT01
Nov 02 2016 20:41
.ajax and .getjson are very similar ways to get data in jquery
Simon Cordova
@gbsimon87
Nov 02 2016 20:42
Hey there, greetings everyone...Was wondering if anyone could figure out why my ajax call won't go through...
http://codepen.io/gbsimon87/pen/YGJkbO?editors=1011
Tom
@moT01
Nov 02 2016 20:42
i looked at the jquery website and a bunch of stackoverflow articles
@gbsimon87 whats the error,
Parley Kennelly
@parleydk
Nov 02 2016 20:44

@masteresp the four options for the columns are
xs
sm
md
lg

if you have multiple classes on the same div then it takes the characteristics of the largest one that applies to the current screen size.
For example, if you only use xs then it will be the same column layout for all screen sizes.
if you use xs and lg then for anything large it will use the lg settings, for everything from xs, sm, md it will use the xs settings.

Tom
@moT01
Nov 02 2016 20:45
i was having issues with that, ...added &callback=? to the end of the url to get it working, might be youre issue as well but im not sure
Parley Kennelly
@parleydk
Nov 02 2016 20:45
If you look at my portfolio there is more going on so it's more responsive.
Simon Cordova
@gbsimon87
Nov 02 2016 20:45
The url variable passed in I believe is correct...
I'm trying to log an entry to the console but nothing shows up
@moT01
Tyler Moeller
@TylerMoeller
Nov 02 2016 20:45
@gbsimon87 It's $.ajax - don't forget the dot. Also, use dataType jsonp instead of json
    $.ajax({
      type: 'GET',
      url: url,
      async: false,
      dataType: 'jsonp',
Parley Kennelly
@parleydk
Nov 02 2016 20:46
@TylerMoeller how do you get the code to post so pretty?
Aleksander Gębicki
@Takumar
Nov 02 2016 20:46
@parleydk use backticks to format your code:
```
your code
```
Tyler Moeller
@TylerMoeller
Nov 02 2016 20:46
Simon Cordova
@gbsimon87
Nov 02 2016 20:47
@TylerMoeller thx buds
CamperBot
@camperbot
Nov 02 2016 20:47
gbsimon87 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 902 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tom
@moT01
Nov 02 2016 20:48
i spent quite a while with that wiki api, it was a pain for me, but your url is giving back arrays not objects, ...not sure if it work like that or not
j1417
@j1417
Nov 02 2016 20:49
hi!! why when i reduce my window`s size the content of the page gets out of the container?? http://codepen.io/Juan1417/pen/wowevJ
Simon Cordova
@gbsimon87
Nov 02 2016 20:51
@moT01 how do you get it to show objects?
Tom
@moT01
Nov 02 2016 20:53
play around with the url
Parley Kennelly
@parleydk
Nov 02 2016 20:57
Sweet thanks @TylerMoeller
CamperBot
@camperbot
Nov 02 2016 20:57
parleydk sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 903 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
fccbcae16c6
@fccbcae16c6
Nov 02 2016 21:24
hey! so i think my little portfolio page looks okay so far, but 1. the links to my different social media just redirect to blank pages, and 2. I cant figure out why the navbar doesn't look right when i look at it on my phone http://codepen.io/fccbcae16c6/pen/qaeaYo?editors=1000
Gang Zhao
@crumpx
Nov 02 2016 21:24
i don't see any half grey lines?
Simon Cordova
@gbsimon87
Nov 02 2016 21:44
@fccbcae16c6 your links don't redirect to blank pages...
if you hold ctrl then click them, or command on mac, they'll open on a new page...
It appears that they can't load within codepen itself
Tony Miri
@TonyMiri
Nov 02 2016 21:44
@bill It looks like there is some default styling be applied to your buttons
maybe a drop-shadow or something
You're using bootstrap?
@fccbcae16c6 You can fix the blank pages by giving each <a> tag a target='something' attribute. That will cause them to open in a new tab.
Tony Miri
@TonyMiri
Nov 02 2016 21:52
@fccbcae16c6 To fix your navbar take a look at this page under the section titled 'Collapsing the Navigation Bar'. http://www.w3schools.com/bootstrap/bootstrap_navbar.asp
Tyler Moeller
@TylerMoeller
Nov 02 2016 21:55
@c0d0er This CSS will remove the border color around your circles:
button {
  border-color: transparent;
}
c0d0er
@c0d0er
Nov 02 2016 21:56
@TylerMoeller thanks
CamperBot
@camperbot
Nov 02 2016 21:56
c0d0er sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 904 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tony Miri
@TonyMiri
Nov 02 2016 21:57
Can anyone help me out with the twitch.tv API? I'm pretty sure my API call is formatted the way it's supposed to be but I'm not getting any data back.
Tyler Moeller
@TylerMoeller
Nov 02 2016 21:57
@c0d0er No problem. You might also want to add outline: none to avoid seeing that blue square when you click on a button.
@FatTone225 It looks like you have a space in your URL and a & instead of a ?. Try this instead:
'https://wind-bow.hyperdev.space/twitch-api/users/freecodecamp?callback=?'
Tony Miri
@TonyMiri
Nov 02 2016 22:00
@TylerMoeller Ah. Yep. Just got done with the wikipedia api project and they used the &
lol
@TylerMoeller Thank you.
CamperBot
@camperbot
Nov 02 2016 22:00
fattone225 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 905 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Nov 02 2016 22:00
It gets confusing - wish there was a standard!
Tony Miri
@TonyMiri
Nov 02 2016 22:00
For real
c0d0er
@c0d0er
Nov 02 2016 22:08
@crumpx i already fixed thanks!
CamperBot
@camperbot
Nov 02 2016 22:08
c0d0er sends brownie points to @crumpx :sparkles: :thumbsup: :sparkles:
:cookie: 398 | @crumpx |http://www.freecodecamp.com/crumpx
Brian
@BrianCodes33
Nov 02 2016 22:28
function mutation(arr) {
  var string1 = arr[0].toLowerCase();
  var string2 = arr[1].toLowerCase();
  for (var i=0; i<arr.length; i++) {
    if (string1.indexOf(string2[i]) < 0) {
      return false;
    } 
      return true;
  }
}



mutation(["hello", "hey"]);
anyone tell me what im doing wrong
Alexander Huynh
@caesarsalad93
Nov 02 2016 22:29
Why isn't my quote machine producing a quote? https://codepen.io/caesarsalad/full/LRwoGg/
marzelin
@marzelin
Nov 02 2016 22:30
@BrianCodes33 you return true too early

@caesarsalad93

jquery.min.js:4 Mixed Content: The page at 'https://codepen.io/caesarsalad/full/LRwoGg/' was loaded over HTTPS, but requested an insecure script 'http://api.forismatic.com/api/1.0/?format=jsonp&method=getQuote&jsonp=jQuery31007763541963507679_1478125850619&lang=en&_=1478125850620'. This request has been blocked; the content must be served over HTTPS.

Brian
@BrianCodes33
Nov 02 2016 22:32
can you elaborate @marzelin
Alexander Huynh
@caesarsalad93
Nov 02 2016 22:32
@marzelin what does that mean?
marzelin
@marzelin
Nov 02 2016 22:33
@BrianCodes33 in first for loop iteration you return either true or false. You should return true only if all chars are included in the target string
Alexander Huynh
@caesarsalad93
Nov 02 2016 22:33
Also, how do I get the gitter chat to stop spitting out messages from the left menu?
marzelin
@marzelin
Nov 02 2016 22:34
@caesarsalad93 use insecure protocol and you get the quote http://codepen.io/caesarsalad/pen/LRwoGg
Brian
@BrianCodes33
Nov 02 2016 22:35
still not clicking
marzelin
@marzelin
Nov 02 2016 22:37
@BrianCodes33
function mutation(arr) {
  var string1 = arr[0].toLowerCase();
  var string2 = arr[1].toLowerCase();
  for (var i=0; i<string2.length; i++) {
    if (string1.indexOf(string2[i]) < 0) {
      return false;
    } 
  }
  return true;
}
Alexander Huynh
@caesarsalad93
Nov 02 2016 22:38
@marzelin thanks
CamperBot
@camperbot
Nov 02 2016 22:38
caesarsalad93 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:cookie: 899 | @marzelin |http://www.freecodecamp.com/marzelin
Brian
@BrianCodes33
Nov 02 2016 22:40
so you are just iterating over 2nd array(target)? you don’t need to iterate through both right?
marzelin
@marzelin
Nov 02 2016 22:41
@BrianCodes33 the code should check if all letters from second array are present, so it should iterate trough those letters
Brian
@BrianCodes33
Nov 02 2016 22:41
right
thanks @marzelin
CamperBot
@camperbot
Nov 02 2016 22:42
briancodes33 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:cookie: 900 | @marzelin |http://www.freecodecamp.com/marzelin
Rob
@s31181
Nov 02 2016 22:51
can someone help me with my quote generator i'm trying to see if my button generates anything with "console.log()" but even then there's no output https://codepen.io/s31181/pen/pEMjqX?editors=1011
Adel
@AdelMahjoub
Nov 02 2016 22:53
@s31181 https://crossorigin.me/ in front of the API entry point, or load http:// codepen, instead of https://
Rob
@s31181
Nov 02 2016 22:57
i'm getting nothing
is the code correct?
Tyler Moeller
@TylerMoeller
Nov 02 2016 23:00
@s31181 Your URL format is off a bit for this API. Try this instead: http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?
And try not to use a https proxy unless absolutely needed. crossorigin.me can lag a lot and may go down at times without notice.
  var url = 'http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?'
  if (window.location.protocol !== 'http:') url = 'https://crossorigin.me/' + url;
Adel
@AdelMahjoub
Nov 02 2016 23:02
@s31181
http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en

{
"quoteText": "Do something wonderful, people may imitate it.  ",
"quoteAuthor": "Albert Schweitzer ",
"senderName": "",
"senderLink": "",
"quoteLink": "http://forismatic.com/en/9eda7393ca/"
}
Rob
@s31181
Nov 02 2016 23:03
thank you @TylerMoeller & @AdelMahjoub
CamperBot
@camperbot
Nov 02 2016 23:03
s31181 sends brownie points to @tylermoeller and @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 353 | @adelmahjoub |http://www.freecodecamp.com/adelmahjoub
:cookie: 906 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Ivan
@gonzalezi2
Nov 02 2016 23:07
Hey guys, does anyone have any hints or tips for the steamroller challenge? I think I may be overthinking it
Ivan
@gonzalezi2
Nov 02 2016 23:13
function steamrollArray(arr) {
  for (var i = 0; i < arrr.length; i++){
    if (Array.isArray(arr[i])){
        arr[i] = [].concat.apply([], arr[i]);
      }
  }
  return arr;
}

steamrollArray([1, [2], [3, [[4]]]]);
Mainly, I would like to know how to keep looping until arr[i] is no longer an array. I've tried using a while loop but I get an infinite loop. I'm lost
Not sure how to continue or what I'm doing wrong with the while loop that's giving me an infinite loop
marzelin
@marzelin
Nov 02 2016 23:16
@gonzalezi2 use recursion. Invoke steamrollArray if element is an array
Ivan
@gonzalezi2
Nov 02 2016 23:23
I'm not sure i've learned about recursion? I'm weak on functions to be honest
marzelin
@marzelin
Nov 02 2016 23:25
@gonzalezi2 I think that this challenge can be solved only with recursion
Ivan
@gonzalezi2
Nov 02 2016 23:27
Well I'm going to learn more about that now. Not sure why recursion wasn't one of the helpful links
marzelin
@marzelin
Nov 02 2016 23:27
@gonzalezi2 recursion is easy. Just provide base case and self invoking statement. Done.
Gang Zhao
@crumpx
Nov 02 2016 23:29
i have a version of this solution i wrote about a month ago, if you want? if i rewrite it now, it wouldve been different:)
Ivan
@gonzalezi2
Nov 02 2016 23:30
I can find the solution online but I want to figure it out on my own. I'm just trying to wrap my head around the whole "recursion" thing.
Gang Zhao
@crumpx
Nov 02 2016 23:31
OK to understand recursion, you have to first understand recursion😂😂😂
Ivan
@gonzalezi2
Nov 02 2016 23:31
ahhhh :/
Gang Zhao
@crumpx
Nov 02 2016 23:32
it just like a for loop
in for loop, the logic gives a result each time the loop execute. where in recursion, the result is given after the recusion stopped
Ivan
@gonzalezi2
Nov 02 2016 23:35
so i dont need a for loop inside the recursion?
Gang Zhao
@crumpx
Nov 02 2016 23:37
//jshint esversion:6 

factorialize = 
    (num) => {
        if(num>1) {
            return num * factorialize(num-1);
        } else return 1;
    };

factorialize(10);
sorry on my phone cant change it back to normal JS
=> is function, (num) is the argument
this is probably the simplest recursion
marzelin
@marzelin
Nov 02 2016 23:40
@crumpx
factorialize = num => num > 1?
  num * factorialize(num-1): 1;
much better
Gang Zhao
@crumpx
Nov 02 2016 23:41
yea :+1:
i was new when i wrote that😂😂😂
Maksim Kulichenko
@makstheimba
Nov 02 2016 23:41
@gonzalezi2 if you want to understand recursion better google some articles on it. There are pretty good explanations for beginners. It is a pretty hard topic to comprehend but it is useful technic and you will have to understand it anyway at some point in your programming career
Ivan
@gonzalezi2
Nov 02 2016 23:42
That's like a word definition using itself in the definition
FCC didn't warn me about this
Gang Zhao
@crumpx
Nov 02 2016 23:43
a recursion is a function that executing itself until some logic inside that function stop it self
Ivan
@gonzalezi2
Nov 02 2016 23:43
thanks @makstheimba @marzelin @crumpx I'll try this out. I'm sure I'll be back
CamperBot
@camperbot
Nov 02 2016 23:43
gonzalezi2 sends brownie points to @makstheimba and @marzelin and @crumpx :sparkles: :thumbsup: :sparkles:
:cookie: 399 | @crumpx |http://www.freecodecamp.com/crumpx
:cookie: 356 | @makstheimba |http://www.freecodecamp.com/makstheimba
:cookie: 901 | @marzelin |http://www.freecodecamp.com/marzelin
Gang Zhao
@crumpx
Nov 02 2016 23:45
as in for loop you increase or decrease value i in for loops
Ivan
@gonzalezi2
Nov 02 2016 23:50
Yeah for loops I understand very well. That's why I use them a lot even when I'm supposed to/should use something else...