These are chat archives for FreeCodeCamp/HelpFrontEnd

10th
Feb 2018
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:28
Hey guys, had a quick question (i think), if I have "getElementById" grab a "ul" how do I have js put all of the contents of the ul into an array? Thanks in advance
Stephen James
@sjames1958gm
Feb 10 2018 00:31
@sturtzethan97 You can use querySelectorAll("ul > li") to do that.
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:32
and then what do I write to make that a classified array so I can use it later in functions?
let cards = document.querySelectorAll("ul > li");
Like this . ^^
I'm trying to create a memory game for a project if that helps..
Stephen James
@sjames1958gm
Feb 10 2018 00:34
@sturtzethan97 Yes that is how you would store that for later.
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:35
amazing, I really appreciate it. Now to figure out how to write 100 different functions I dont know how to make :) @sjames1958gm
Stephen James
@sjames1958gm
Feb 10 2018 00:35
@sturtzethan97 querySelector and querySelectorAll are nice because they use css selectors
@sturtzethan97 lol
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:37
Good to know, I'm doing a program, but I'm not sure if Im not retaining anything or if they want me to not know a lot about the project I'm doing lol
@sjames1958gm
Stephen James
@sjames1958gm
Feb 10 2018 00:38
retention of these new concepts can be difficult - only practice will help
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:38
Appreciate it! @sjames1958gm
Stephen James
@sjames1958gm
Feb 10 2018 00:39
@sturtzethan97 :+1: comeback if have more questions
Ethan Sturtz
@sturtzethan97
Feb 10 2018 00:39
Will do @sjames1958gm
Kersti McGee
@Kerstimcgee
Feb 10 2018 01:01
Hello! Does anyone know if I can deploy my jsfiddle projects to the actual web as a formal website?
or is that something I needed to put into Atom or something?
James Hall
@James-H33
Feb 10 2018 01:17
@Kerstimcgee you can share your fiddle with anyone the way it is. If you want people to be able to navigate to a custom domain as in Kerstimcgee.com to see your site then you will want to copy it over to your favorite IDE.
Ghost
@ghost~5a4a80acd73408ce4f859755
Feb 10 2018 02:44
@AbrisM @kbaig Thanks a lot for that :) makes soo much sense and works now as well!
CamperBot
@camperbot
Feb 10 2018 02:44
muhammedkarim sends brownie points to @abrism and @kbaig :sparkles: :thumbsup: :sparkles:
api offline
:cookie: 568 | @kbaig |http://www.freecodecamp.org/kbaig
Jonathan Schroeder
@jonjschroeder
Feb 10 2018 04:37
hey i'm new to freecodecamp, I love it
Ghost
@ghost~5a4a80acd73408ce4f859755
Feb 10 2018 04:41
@jonjschroeder who doesnt :)
Ken Haduch
@khaduch
Feb 10 2018 04:58
@jonjschroeder - welcome! Hope that you get a lot out of the freeCodeCamp lessons and projects!
DMsalati
@DMsalati
Feb 10 2018 06:19
like when you click on 'Random Wikipedia article' it should open a Random Wikipedia article but its not
Aditya
@ezioda004
Feb 10 2018 06:23
@DMsalati Missing $ in ("#randomArticle").click(function(){};
DMsalati
@DMsalati
Feb 10 2018 06:24
@ezioda004 thank you so much
CamperBot
@camperbot
Feb 10 2018 06:24
dmsalati sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 448 | @ezioda004 |http://www.freecodecamp.org/ezioda004
DMsalati
@DMsalati
Feb 10 2018 06:24
do you know why its not working on chrome tho?
like when i open it in chrome window.open doesnt work
but works in edge
Aditya
@ezioda004
Feb 10 2018 06:25
Its working in my chrome.
DMsalati
@DMsalati
Feb 10 2018 06:26
not for me
could it be the pop blocker?
yes its lol
i enabled it on codepen and now it works fine
Aditya
@ezioda004
Feb 10 2018 06:32
:thumbsup:
Dany Din
@danydin
Feb 10 2018 06:52
How to make with bootstrap that when the item is viewed in col-sm/xs the item disappear?
Aditya
@ezioda004
Feb 10 2018 06:55
@danydin Hmm you can use media query at sm/xs breaking point and set display: none;
DMsalati
@DMsalati
Feb 10 2018 06:55
you can use .toggle()
Dany Din
@danydin
Feb 10 2018 06:55
can i've an example how it looks like it in code please
DMsalati
@DMsalati
Feb 10 2018 06:59
$( "#clickme" ).click(function() {
  $( "#book" ).toggle( "slow", function() {
    // Animation complete.
  });
});
Dany Din
@danydin
Feb 10 2018 06:59
where is hiding the small display mate @DMsalati thanks
CamperBot
@camperbot
Feb 10 2018 06:59
danydin sends brownie points to @dmsalati :sparkles: :thumbsup: :sparkles:
:cookie: 169 | @dmsalati |http://www.freecodecamp.org/dmsalati
DMsalati
@DMsalati
Feb 10 2018 07:00
heres the link to documentations :http://api.jquery.com/toggle/
Aditya
@ezioda004
Feb 10 2018 07:00
@danydin Check this out and try resizing.
Dany Din
@danydin
Feb 10 2018 07:01
perfect thanks @ezioda004 i'm actually checking now if bootstrap hide class working will keep you update guys
CamperBot
@camperbot
Feb 10 2018 07:01
danydin sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 449 | @ezioda004 |http://www.freecodecamp.org/ezioda004
DMsalati
@DMsalati
Feb 10 2018 07:01
not really sure
Aditya
@ezioda004
Feb 10 2018 07:03
@DMsalati I think thats achievable with jQuerys .hide() and checking the $(window).width()
Would have to write a bit more code but yeah doable.
Dany Din
@danydin
Feb 10 2018 07:09
i tried do bootstrap hidden-md-down and iut does nothing can you check if it works at all on your side please @ezioda004 ?
Aditya
@ezioda004
Feb 10 2018 07:13
@danydin Checking
Dany Din
@danydin
Feb 10 2018 07:13
yay :)
Aditya
@ezioda004
Feb 10 2018 07:19
@danydin They removed hidden classes the docs above you posted are from alpha, new classes are like .d-none and so on
You can read more about them here
Also I updated my pen with the bs classes.
Dany Din
@danydin
Feb 10 2018 07:20
i see i seee.. perfect wasn't aware to that :)
i've 1 question regarding your pen.. i tried play with it.. add another class called check to the second div
and then in the css where you added the @media i wrote: .check, @media{...}
wondering why nothing occured.. neither when i removed the comma
Aditya
@ezioda004
Feb 10 2018 07:23
@danydin You need to put .checkinside @media its basically telling the browser to use this CSS when the width is less than 768px
Raghav Mundra
@Raghav17
Feb 10 2018 07:24

How can I add an "<a>" tag to my html form my JS?

$name.html("<a href=" + "data.stream._links.self" + "target=_blank>"+ chanData.display_name + "</a>");

Is this correct?
I do not want my "data.stream._links.self" to include in quotes, but when I remove it the code dosen't work.

Dany Din
@danydin
Feb 10 2018 07:24
yes ah ok i wasn't aware to the syntax so basically @media .check (max-width: 680px){}?
Aditya
@ezioda004
Feb 10 2018 07:25
No no
@media (max-width: 768px){
 .check {
     //CSS here
     }
}
Dany Din
@danydin
Feb 10 2018 07:29
oh i see i see thanks :)
@ezioda004 would you recommend me run on my site the bootstrap through cdn like on codepen or through local file?
CamperBot
@camperbot
Feb 10 2018 07:29
danydin sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
api offline
Aditya
@ezioda004
Feb 10 2018 07:31
@danydin I think having locally for own site would be better
Dany Din
@danydin
Feb 10 2018 07:33
okk
Raghav Mundra
@Raghav17
Feb 10 2018 07:35

Hey @ezioda004 , Can you please help.

$name.html('<a href="' + data.stream._links + '">' + chanData.display_name + '</a>');

Can you please tell me if there is anything wrong with this code?

Aditya
@ezioda004
Feb 10 2018 07:37
@Raghav17 Is it not working?
Raghav Mundra
@Raghav17
Feb 10 2018 07:38
Nope.
Aditya
@ezioda004
Feb 10 2018 07:38
@Raghav17 Codepen link maybe?
Raghav Mundra
@Raghav17
Feb 10 2018 07:38
Sure, here it is.
Aditya
@ezioda004
Feb 10 2018 07:44
@Raghav17 Look at the data object carefully, _links is an object inside data not inside stream so just do data._links
abraham anak agung
@padunk
Feb 10 2018 07:46
@Raghav17 btw, i still have your fork project here
Raghav Mundra
@Raghav17
Feb 10 2018 07:52
@ezioda004 Hey, thanks buddy. It was so small but was killing me from a long time. :D
CamperBot
@camperbot
Feb 10 2018 07:52
raghav17 sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 450 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Raghav Mundra
@Raghav17
Feb 10 2018 07:53
@padunk Haha, yeah. Tryipng to add new things buddy.
Sweet Coding :)
@SweetCodingInc
Feb 10 2018 08:01
@Raghav17 Like I told you before. Stay away from string building business. It's error prone and hard to change later should you decide to make it a bit more complicated to address more cases
Dany Din
@danydin
Feb 10 2018 08:01
@Raghav17 where you got the properties _links & self from?
Raghav Mundra
@Raghav17
Feb 10 2018 08:02
@danydin From the api.
Dany Din
@danydin
Feb 10 2018 08:03
ah ok
Raghav Mundra
@Raghav17
Feb 10 2018 08:03
@SweetCodingInc I am thinking about re-structuring the code again. I think the one I have made is not at all scaleable.
Dany Din
@danydin
Feb 10 2018 08:03
:p
Sweet Coding :)
@SweetCodingInc
Feb 10 2018 08:04

This

$name.html('<a href="' + chanData.url + '">' + chanData.display_name + '</a>');

is same but not as awesome as

var $a = $('<a/>', {
  href: data._links.channel,
  target: '_blank',
  text: chanData.display_name
});

$name.append($a);
Dany Din
@danydin
Feb 10 2018 08:07
When I just write @media (min-width: 600x{} does it influence all kind of devices?
Ghost
@ghost~5a4a80acd73408ce4f859755
Feb 10 2018 08:10
Anyone know a good app for Android to type code? Similar to CodePen website?
Raghav Mundra
@Raghav17
Feb 10 2018 08:10
@SweetCodingInc Haha, yes.
It is plain JS, right? I still have to learn a lot of things, thanks buddy. :smile:
CamperBot
@camperbot
Feb 10 2018 08:10
raghav17 sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 269 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Feb 10 2018 08:14
@Raghav17 Yes.. Plain js.
It just another jquery api to create html elements
simple and extensible..
The major advantage is, lets say tomorrow you want the logos to be on the right side and status on the left, imagine how much code you have to change if you're using string building approach.
Whereas with this jQuery api, you just end up changing the order in which your write your .append
one line change, that's all
Raghav Mundra
@Raghav17
Feb 10 2018 08:47
@SweetCodingInc Woah, I didn't think of that! That is a very good advice. Thanks. :)
CamperBot
@camperbot
Feb 10 2018 08:47
raghav17 sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
api offline
Dany Din
@danydin
Feb 10 2018 09:37
hey can someone help figure why on my site the 'hamburger' nav not show up on mobile and but it does work on minimize computer screen? i know all the classes for it will be easy for you to figure where i'm wrong thanks :)
Matej Bošnjak
@mbosnjak01
Feb 10 2018 09:39
would be easier with code or link to it
Dany Din
@danydin
Feb 10 2018 09:55
@mbosnjak01 i can link but it can't be put on codepen due to multiple files
can you check it maybe
alpox
@alpox
Feb 10 2018 10:10
@danydin try to put this in the head part of the html (or in codepen stuff for head part in the settings) <meta name="viewport" content="width=device-width, initial-scale=1">
Dany Din
@danydin
Feb 10 2018 10:16
@alpox thanks will try it!
CamperBot
@camperbot
Feb 10 2018 10:16
danydin sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1534 | @alpox |http://www.freecodecamp.org/alpox
Dhaval Vira
@dhavalveera
Feb 10 2018 10:34
Hello World
Dany Din
@danydin
Feb 10 2018 10:34
@alpox it solved it!! where can i read more on what it is exactly does?? i guess it change the calculation of the width in mobile devices because i saw there was a problem catching the right size of the screen..
Dhaval Vira
@dhavalveera
Feb 10 2018 10:37
@alpox you are a Complete Front-End Developer ???
Dany Din
@danydin
Feb 10 2018 10:37
@alpox the 'only' problem with programming is that they expect us to remmber those short docs like we are comptuers :crying_cat_face:
alpox
@alpox
Feb 10 2018 10:40
@dhavalveera You could say that. But i did not follow FCC
@danydin Hmm do "they"? :-) normal programmers like me are pretty lost without the internet to look up stuff :D
Dhaval Vira
@dhavalveera
Feb 10 2018 10:42
@alpox what is FCC ??
Dany Din
@danydin
Feb 10 2018 10:42
makes sense!!!
thisaif
@thisaif
Feb 10 2018 10:42
@danydin or having a dual monitor setup and having the docs on the left monitor (u can download most of the docs)
alpox
@alpox
Feb 10 2018 10:43
@dhavalveera FreeCodeCamp
Matej Bošnjak
@mbosnjak01
Feb 10 2018 10:43
@jmsfk why not dual monitor setup + a laptop? :D
Dhaval Vira
@dhavalveera
Feb 10 2018 10:44
@alpox shall we connect with each other on LinkedIn if you don't mine then ?
alpox
@alpox
Feb 10 2018 10:54
@dhavalveera See pm
plz check this and help me out
My code-

function palindrome(str) {
var original = str.replace("/\W\s/g", " ");
var reverse="";
for( let i = str.length - 1; i >= 0; i--){
reverse += str[i];
}
if( original == reverse)
return true;
else
return false;
}

palindrome("eye");

@tptynlr
https://beta.freecodecamp.org/en/challenges/javascript-algorithms-and-data-structures-projects/palindrome-checker
plz check this and help me out
My code-
function palindrome(str) {
var original = str.replace("/\W\s/g", " ");
var reverse="";
for( let i = str.length - 1; i >= 0; i--){
reverse += str[i];
}
if( original == reverse)
return true;
else
return false;
}

palindrome("eye");

alpox
@alpox
Feb 10 2018 11:04
function palindrome(str) {
  var original = str.replace("/\W\s/g", " ");
  var reverse="";
  for( let i = str.length - 1; i >= 0; i--){
    reverse += str[i];
  }
  if( original == reverse)
    return true;
  else
    return false;
}

palindrome("eye");
@tptynlr fixed the presentation in this chat for you
abraham anak agung
@padunk
Feb 10 2018 11:05
@tptynlr your reverse base on you str parameter, try use original
alpox
@alpox
Feb 10 2018 11:06
@tptynlr \W\s with this regex, you replace all non-word characters together with a following whitespace character. I believe thats not what you are looking for
And what @padunk says
tptynlr
@tptynlr
Feb 10 2018 11:09

function palindrome(str) {
var original = str.replace(/\W\s/g, " ");
var reverse="";
for( let i = original.length - 1; i >= 0; i--){
reverse += original[i];
}
if( original == reverse)
return true;
else
return false;
}

palindrome("eye");

this is also not working
@alpox @padunk
abraham anak agung
@padunk
Feb 10 2018 11:10
@tptynlr your regex is wrong like @alpox said.
and if you post code here use ``` at the beginning and end of the code, separate wiht new line
\W\s means non word following by white space
tptynlr
@tptynlr
Feb 10 2018 11:12
how do u remove space in a string ? for eg - "never odd or even"
alpox
@alpox
Feb 10 2018 11:13
@tptynlr a space is part of \W so it will be removed. But if you replace a space with " " you add a space again
As you replace any non-word character with a space
And you therefore also replace a space with a space
You gotta use the empty string as replacement: ""
tptynlr
@tptynlr
Feb 10 2018 11:14
that's what i am doing replacing a space with empty string
alpox
@alpox
Feb 10 2018 11:14
@tptynlr No what you did in the code you sent us, you replace a space with a space
tptynlr
@tptynlr
Feb 10 2018 11:15
okay I will fix it.
abraham anak agung
@padunk
Feb 10 2018 11:15
@tptynlr no, there is a difference between " " and ""
tptynlr
@tptynlr
Feb 10 2018 11:15
thanks both of u
now how can i remove non alphanumeric characters and spaces in a single regex code
can u plz write a regex code for that
alpox
@alpox
Feb 10 2018 11:16
@tptynlr We are not here to give solutions, but to give tips
tptynlr
@tptynlr
Feb 10 2018 11:17
.replace(/\s/,"");-- this will remove space
alpox
@alpox
Feb 10 2018 11:17
You are on the right track with \W. The only problem you got with it, is that \W does NOT include _
You gotta "add" that _ to the set of characters which you match
tptynlr
@tptynlr
Feb 10 2018 11:17
should i write two different replace methods for space and \w
alpox
@alpox
Feb 10 2018 11:18
\W includes the space. No need to test for space individually
tptynlr
@tptynlr
Feb 10 2018 11:18
okay.
abraham anak agung
@padunk
Feb 10 2018 11:19
@tptynlr you don't need to worry about space, underscore is the problem :smile:
tptynlr
@tptynlr
Feb 10 2018 11:19
str.replace(/\W|_/g, ""); this is working to remove space and underscore
now i am facing problem to remove , in string
alpox
@alpox
Feb 10 2018 11:19
Yup :-)
, should be in there already too
I think its uppercase which is the problem
tptynlr
@tptynlr
Feb 10 2018 11:21
thanks @alpox
CamperBot
@camperbot
Feb 10 2018 11:21
tptynlr sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1535 | @alpox |http://www.freecodecamp.org/alpox
tptynlr
@tptynlr
Feb 10 2018 11:21
got it
thanks @padunk
CamperBot
@camperbot
Feb 10 2018 11:21
tptynlr sends brownie points to @padunk :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @padunk |http://www.freecodecamp.org/padunk
abraham anak agung
@padunk
Feb 10 2018 11:22
np, happy coding...
alpox
@alpox
Feb 10 2018 11:23
@tptynlr np
coderNewby
@coderNewby
Feb 10 2018 12:08
thanks @DarrenfJ for thehelp in pm
CamperBot
@camperbot
Feb 10 2018 12:08
codernewby sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2384 | @darrenfj |http://www.freecodecamp.org/darrenfj
shivam gupta
@shivamg11000
Feb 10 2018 12:24
why on mobile view
when navbar toggle btn is toggled
the body slider goes up ( at the top)
Dhaval Vira
@dhavalveera
Feb 10 2018 12:47
@dhavalveera
I need help in Mobile View DropDown Menu
anyone here to help ?
Stephen James
@sjames1958gm
Feb 10 2018 12:57
@shivamg11000 maybe because the menu is above all the content, so when it shows it it has to show the top of the content
@shivamg11000 Try position: absolute rather than fixed?
that may not work, but not sure what will
Dany Din
@danydin
Feb 10 2018 13:46
How can i copy the svg/pic from this site?
http://simplelineicons.com/
Trommelochse
@Trommelochse
Feb 10 2018 13:48
it's an icon font
so you have to import it, for example via CDN
and then you can use the icons via classnames in <i> elements
Dany Din
@danydin
Feb 10 2018 13:50
if i want the pic itself?
not as class
what are my options?
Trommelochse
@Trommelochse
Feb 10 2018 13:53
not exactly sure, but it might help to have a look at their github repo - not sure if it's worth the effort, though
using the classnames is the intended use for a reason
Dany Din
@danydin
Feb 10 2018 14:03
yes i know i just wonder how it's made.. is it really all made through font syntax or iss it an actual image
LydaTech
@lydatech
Feb 10 2018 14:12
 Simple-Line-Icons.eot
Simple-Line-Icons.svg
Simple-Line-Icons.ttf 
Simple-Line-Icons.woff
Simple-Line-Icons.woff2
Dany Din
@danydin
Feb 10 2018 14:39
@lydatech yes but it doesn't tell me much about those pics where made
do you have any idea maybe?
LydaTech
@lydatech
Feb 10 2018 14:40
svg
Teo
@Teo03
Feb 10 2018 14:50
Can someone help? When I start editing a recipe it shows me a Save button.
The problem is it shows only on the first edited recipe. I want to be shown every time I start editing a recipe. Thanks
import React from 'react';
import { Collapse, Button, CardBody, Card } from 'reactstrap';

export class ShowRecipes extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            collapse: -1,
            hideSave: false
        }
        this.handleChange = this.handleChange.bind(this);
    }

    componentWillUpdate(nextProps, nextState){
        localStorage.setItem('updated', JSON.stringify(nextProps.recipes));
    }

    edit(num){
        var name = $('#title').text();
        var inst = $('#instructions').val();
        this.props.recipes.push({title: name, instructions: inst});
        this.props.recipes.splice(num, 1);
        $('#save').hide();

    }

    handleChange(){
        $('#save').show();
    }

    render() {
        var recipeList = this.props.recipes.map(function (recipeInfo, index) {
            return (
        <div className="recipe-list" key={index}>
        <div className="recipe" id={'recipe-' + index} onClick={() => this.setState({ collapse: index })}>
        <h1 id="title">{recipeInfo.title}</h1>
            <Collapse isOpen={this.state.collapse === index}>
                <Card>
                    <CardBody>
                        <textarea type="text" cols="80" rows="4" onKeyPressCapture={this.handleChange} id="instructions">{recipeInfo.instructions}</textarea>
                    </CardBody>
                        <div className="col-sm-12 btns">
                        <Button color="secondary" className='col-sm-4' onClick={() => index = -1}>Cancel</Button>
                        <Button color='success' className='col-sm-4' id="save" onClick={() => this.edit(index)}>Save</Button>
                        <Button color="danger" className='col-sm-4' onClick={() => this.props.recipes.splice(index, 1)}>Delete</Button>
                        </div>
                </Card>
            </Collapse>
            </div>
        </div>
            );
        }, this);
        return recipeList;
    }
}
LydaTech
@lydatech
Feb 10 2018 15:06
@Teo03 when you have large blocks of text please use a code hosting service instead of pasting into chat
Teo
@Teo03
Feb 10 2018 15:06
@lydatech Ok
LydaTech
@lydatech
Feb 10 2018 15:06
@Teo03 thx
CamperBot
@camperbot
Feb 10 2018 15:06
lydatech sends brownie points to @teo03 :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @teo03 |http://www.freecodecamp.org/teo03
Ken Haduch
@khaduch
Feb 10 2018 15:12
@Teo03 - do you have a URL for this project, CodePen? I'm going to theorize that there might be multiple "save" buttons (most of them not visible?) with the same ID (which is not a valid thing to do) and perhaps one of them is getting hidden or not hidden and not the one that you want?
Dany Din
@danydin
Feb 10 2018 15:20
@lydatech and how can i get to the svg links themselves?
LydaTech
@lydatech
Feb 10 2018 15:21
@danydin it would be easier to just explain what and why youre trying to do instead of all the back and forth
Dany Din
@danydin
Feb 10 2018 15:21
im trying to get the pic of a specific icon
save it on pc
Dany Din
@danydin
Feb 10 2018 15:24
so ican't really download it
i thought its a svg link
but it's some kind code?!
I'll look for debugger.. thanks a lot for the link! @lydatech
CamperBot
@camperbot
Feb 10 2018 15:25
danydin sends brownie points to @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2648 | @lydatech |http://www.freecodecamp.org/lydatech
LydaTech
@lydatech
Feb 10 2018 15:27
@danydin what are you doing with it?
Dany Din
@danydin
Feb 10 2018 15:30
just want to practice it.. so its basically kind of code like hex but different that creates a visual image?
LydaTech
@lydatech
Feb 10 2018 15:32
no its a svg glyph
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:37
If programming/ coding is eventually just gonna be replaced by machines, why should I even bother learning it?
thisaif
@thisaif
Feb 10 2018 15:37
@Quantomistro3178 cuz by the time that happens you, me, and a few generations will be already death
LydaTech
@lydatech
Feb 10 2018 15:38
@Quantomistro3178 You shouldnt. Just go learn to farm. Everyone will have to eat
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:39
@jmsfk So it's still pretty far away? I just read some articles that were all like "No you don't need to learn code. People who say everyone should learn a little code are wrong and all"
LydaTech
@lydatech
Feb 10 2018 15:40
thats like saying "why learn to drive? we'll have self driving cars eventually"
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:40
So i was just wondering. Because I'm still in school and im trying to learn code so I can make extra money as a freelancer or something like that, I don't think I'll do programming as a full time job. So I just wanted to make sure my effort wasn't being wasted.
thisaif
@thisaif
Feb 10 2018 15:41
@lydatech I'd say that's not the same tho... That future is very very near
LydaTech
@lydatech
Feb 10 2018 15:42
what future is near?
thisaif
@thisaif
Feb 10 2018 15:42
@lydatech self driving cars cuz we kinda have the technology for that
LydaTech
@lydatech
Feb 10 2018 15:43
even if we had self driving cars 100% viable right now it would be decades before they are that common
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:44
@lydatech So programmers are safe for now, right?
LydaTech
@lydatech
Feb 10 2018 15:45
@Quantomistro3178 yes for quite a while
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:46
@lydatech and learning to code will be useful to me in other areas of life as well right? (cause of logical thinking/ problem-solving etc.)
And me learning to all this will be worth it, right?
LydaTech
@lydatech
Feb 10 2018 15:47
@Quantomistro3178 that is subjective. it depends on you and what you do
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:48
I'm still just in high school
LydaTech
@lydatech
Feb 10 2018 15:48
95-98% of people who start coding will never do it professionally
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:49
but I like learning and coding cause its fun.
thisaif
@thisaif
Feb 10 2018 15:49
@lydatech where did u get that stats :D seems pretty high
LydaTech
@lydatech
Feb 10 2018 15:50
@jmsfk 35 years of doing this
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:51
that's the thing, I'm not planning on going and getting a degree in CS and becoming a full time professional programmer in the first place. I just wanna learn enough to be able to, I dunno make apps or websites for myself or for others from which I can make a bit of sort of extra money
LydaTech
@lydatech
Feb 10 2018 15:52
coding is a craft. To get good it takes effort.
anyone can throw some html and css together. Doent mean its coded well or looks good
thisaif
@thisaif
Feb 10 2018 15:54
@Quantomistro3178 that is not hard, html/css/javascript are relatively easy, but everyone can see the source code of your website and will be able to tell how bad you are, plus you will never be able to tell if the website is secure or not (since you are not aiming to be an expert) and you may not be able to understand ur whole app in a few months or years since it didn't have a good design
Quantomistro3178
@Quantomistro3178
Feb 10 2018 15:55
Yeah, and I'm trying to put in the effort to learn that craft well so that I can call it a 'skill' of mine. It's gonna be worth it isn't it?
That's what I'm trying to do, I'm trying to get better by putting in effort.
Ken Haduch
@khaduch
Feb 10 2018 16:46
@Teo03 - it took me a while to figure out how to get this running on my laptop - so I'm not sure that i have all of the pieces in place. I think that the behavior that I'm seeing is related to having multiple buttons with the ID of edit and the first one is getting hidden, the others in recipes that I added are showing up whenever I open the recipe (other than the first) and they are already showing the "Save" button. If I begin editing the first recipe, the "Save" button comes back. I think that it's related to multiple buttons with the same ID, as I said. Perhaps deleting the button after the save, and then adding it back in would be the way to go? Or making them with a unique ID, but then you'd have to be able to access that with your jquery selector.
Teo
@Teo03
Feb 10 2018 16:49
@khaduch Thanks for the help, I will try to add unique id to each of them
CamperBot
@camperbot
Feb 10 2018 16:49
teo03 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3725 | @khaduch |http://www.freecodecamp.org/khaduch
jolio007
@jolio007
Feb 10 2018 16:55
Hey guys! I'm trying to sort of recreate this page -> http://michaelacevedo.com/ | I'm having difficulties having one div with the background full size of the page then when I scroll down having another div. I can get the picture to be full page but then I can't seems to be able to get something under. not sure if that makes sense
jolio007
@jolio007
Feb 10 2018 17:09
I'm trying to do it without javascript/jquery like the guy did
Stephen James
@sjames1958gm
Feb 10 2018 17:25
@jolio007 Are you talking about the background image of the forest?
jolio007
@jolio007
Feb 10 2018 17:27
yes
Stephen James
@sjames1958gm
Feb 10 2018 17:27
@jolio007 The background image is being "manually" scrolled through the background-position property
jolio007
@jolio007
Feb 10 2018 17:29
Ok ^^ is it possible to do it using just CSS
Stephen James
@sjames1958gm
Feb 10 2018 17:29
@jolio007 I would be surprised if you could, but I am no CSS expert
jolio007
@jolio007
Feb 10 2018 17:30
Ahh ok
Tiago Correia
@tiagocorreiaalmeida
Feb 10 2018 17:30
you can with css if I didnt got the idea wrong
background-position: fixed;
attachement*
Trommelochse
@Trommelochse
Feb 10 2018 17:33
@tiagocorreiaalmeida the behaviour is still a bit different from what we see on that page. Having some lines of JS gives you great control over the movement of the background and should be worth it
jolio007
@jolio007
Feb 10 2018 17:37
@Trommelochse how would you go about doing it?
Trommelochse
@Trommelochse
Feb 10 2018 17:40
as Stephen mentioned, use javascript to manipulate the background-position property
jolio007
@jolio007
Feb 10 2018 17:40
ok I'll that
Trommelochse
@Trommelochse
Feb 10 2018 17:42
I would then attach a scroll listener to the window - in it's callback you can then determine how far the user has scrolled down (window.pageYOffset) and then use this value to manipulate the backgroujnd-position to your liking
Pixxel123
@Pixxel123
Feb 10 2018 17:48
Is this the chatroom to ask in if I need a hand with my tribute page project?
Pixxel123
@Pixxel123
Feb 10 2018 17:53
I've been struggling with getting my elements centered correctly on the page, I've managed to do it for my hero image text, and my first paragraph, "about-david" but the "million-quote" section isn't playing nice, no matter what I do with margins. I've wrapped it in a div, but can't see what I'm doing wrong
The border:none property of the blockquote also seems to not play nice in codepen for some reason... I've been doing this in sublime text mostly and it's fine on chrome
Trommelochse
@Trommelochse
Feb 10 2018 17:56
If I get you right, you want to add 'margin: 0 auto' to your blockquote element
Emil
@aguyinmontreal
Feb 10 2018 17:57
Anyone knows a good and easy .gif file editor?
Trommelochse
@Trommelochse
Feb 10 2018 17:57
@Pixxel123 If I get you right, you want to add 'margin: 0 auto' to your blockquote element
Pixxel123
@Pixxel123
Feb 10 2018 17:59
Ooohhhh I see where I was going wrong! I tried this earlier and realise I must've been putting this outside of the actual div! Thanks @Trommelochse!
CamperBot
@camperbot
Feb 10 2018 17:59
pixxel123 sends brownie points to @trommelochse :sparkles: :thumbsup: :sparkles:
:cookie: 344 | @trommelochse |http://www.freecodecamp.org/trommelochse
jolio007
@jolio007
Feb 10 2018 18:34
@Trommelochse sounds challenging ^^ thank you
CamperBot
@camperbot
Feb 10 2018 18:34
jolio007 sends brownie points to @trommelochse :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @trommelochse |http://www.freecodecamp.org/trommelochse
LydaTech
@lydatech
Feb 10 2018 19:21
@Pixxel123 fix your issue?
Pixxel123
@Pixxel123
Feb 10 2018 19:23
Yes it did!
Now onto the next one, searching stackoverflow now
Acutally, is there any reason the blockquote border would still be showing in the codepen and not in the browser?
Even with the border:none property
LydaTech
@lydatech
Feb 10 2018 19:25
youre mixing bootstrap versions in codepen
Pixxel123
@Pixxel123
Feb 10 2018 19:25
Aahhh
Mohsin Hayat
@mohsinht
Feb 10 2018 19:26
hi guys
Pixxel123
@Pixxel123
Feb 10 2018 19:27
I've been trying to code on my machine, and avoiding putting code straight to codepen for now, I'll probs start pushing to git in a few weeks when I've got a better handle on it all
Mohsin Hayat
@mohsinht
Feb 10 2018 19:27
I have one question
If I'm good at C++, will I be same as good in JS and Python?
LydaTech
@lydatech
Feb 10 2018 19:28
@Pixxel123 add border: none !important; in your blockquote. Youre not using bootstrap why are you loading it?
Pixxel123
@Pixxel123
Feb 10 2018 19:29
Just changed it
Commented out the bootstrap bit, and I'm gonna be using it to make a grid further down the page
Also completely forgot about the !important tag, thanks for the heads up!
Lee
@LeeConnelly12
Feb 10 2018 19:52
Can I help you with anything good sir?
AbrisM
@AbrisM
Feb 10 2018 20:13
Hi all
I just need to clarify this mathematical process. I know the answer is 1 but i'm wondering if the is multiplication? length = 5;
length
= 2;
length *= length;
length /= 100;
length *=2;
So on the second line, it is basicually taking 5 and multiplying by 2?
Then 10 is divided by 100
Okay, *= does mean multiplication. Its just another way of expressing it
Saboor Malik
@ProgrammingForFun01
Feb 10 2018 20:31
length = 5;
length = 2;

length *= length;
length /= 100;

length *= 2;
^ Is this what it looks like?
LydaTech
@lydatech
Feb 10 2018 20:50
I just need to clarify this mathematical process. I know the answer is 1 but i'm wondering if the * is multiplication? length = 5;
length = length * 2;
length = length * length;
length = length / 100;
length = length * 2;
AbrisM
@AbrisM
Feb 10 2018 22:11
@ProgrammingForFun01 Yes
@lydatech That could be another way of expressing it, but what threw me off was the *= part
the length *=2 was a correction to length=2;
jjzep
@jjzep
Feb 10 2018 22:59
I’m trying to figure out how to create an object with ES6 Classes with the constructor method, and a set method to update the key : value, but I’m running into a "Cannot set property object of ClassName which only has a getter” error
Stephen James
@sjames1958gm
Feb 10 2018 23:18
@jjzep Your setter has to have a name and you can only set with a single value
jjzep
@jjzep
Feb 10 2018 23:35
Oh interesting, I can’t create a method called set that takes multiple arguments?