These are chat archives for FreeCodeCamp/HelpFrontEnd

28th
Sep 2018
newmoon
@newmoon
Sep 28 2018 00:06
@jill-lee If the files were encrypted on a different computer, you cannot decrypt them from your computer. We get a big warning message about this when encrypting files in Windows telling us to back up the encryption key. Unfortunately, if you don't know the password and you don't have access to the encryption key on the other computer, the files cannot be opened.
Jill Lee
@jill-lee
Sep 28 2018 00:23
@newmoon so that means she's screwed because she doesn't have access to her old laptop anymore
@newmoon @JLuboff thank you I'll try
newmoon
@newmoon
Sep 28 2018 00:28
@jill-lee Yeah, unfortunately, she's screwed. Encryption is a security measure, so if your hard drive or computer is stolen, no one will be able to access the files.
Jill Lee
@jill-lee
Sep 28 2018 00:29
@newmoon can a cyber security specialist be able to unlock it or we need to bruteforce?
newmoon
@newmoon
Sep 28 2018 00:30
@jill-lee No, the files cannot be unlocked - even with bruteforce.
You need the encryption key to unlock them
Jill Lee
@jill-lee
Sep 28 2018 00:33
@newmoon oh that's sad thanks again
@newmoon what about a recovery agent data? Can they help with the certificate?
nevermind lol
newmoon
@newmoon
Sep 28 2018 00:35
@jill-lee No, it's a security measure and if we could just pay someone to decrypt our files, there would be no point in encrypting them. Sorry :(
Ryan Williams
@Ryanwfile
Sep 28 2018 01:38
@newmoon Thank you very much for the help
Morchid Chellali
@Morched23MJ
Sep 28 2018 09:01
import React, { PropTypes } from 'react';

const Items = (props) => {
  return <h1>Current Quantity of Items in Cart: {props.quantity}</h1>
};

// change code below this line
Items.propTypes = {
  quantity: PropTypes.number.isRequired
};
// change code above this line

Items.defaultProps = {
  quantity: 0
};

class ShoppingCart extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return <Items />
  }
};
Why this throws the error: require is not defined
Is there some bug in this challenge? :l
The challenge is to require quantity to be of number type, using PropTypes, which I have imported
Aditya
@ezioda004
Sep 28 2018 09:07
@Morched23MJ You dont need import statements in the challenges
Also, PropTypeshas been moved to a different package
Tony Elistratov
@frkntony
Sep 28 2018 13:13
@Morched23MJ Personally I didn't do the challenge. However, in the latest version of React we use a different package for PropTypes. This link https://reactjs.org/docs/typechecking-with-proptypes.html <-- has code samples how to import and define proptypes.
Morchid Chellali
@Morched23MJ
Sep 28 2018 16:10
import PropTypes from 'prop-types';
This still couldn't solve the problem. I think there is a bug in their tests..
Aditya
@ezioda004
Sep 28 2018 16:11
@Morched23MJ Removing the import statement worked for me.
Morchid Chellali
@Morched23MJ
Sep 28 2018 16:13
Oh, thank you. I didn't try your solution. Worked! Thanks again.
jdc20181
@jdc20181
Sep 28 2018 17:10
Haven't came around here for a while... hm
it made me rejoin the room
anyways, I need advice on something - I am not getting anything working in terms of a solution for a one page website that shows the active section (sometimes its referred to scroll spy I think if I remember correctly). Has anyone ever used this and what do you use?
Brad
@bradtaniguchi
Sep 28 2018 17:15
@jdc20181 like anchor links? (in the url it has #)
jdc20181
@jdc20181
Sep 28 2018 17:15
Yes I seen several examples but couldn't get anything working
Brad
@bradtaniguchi
Sep 28 2018 17:16
why not?
jdc20181
@jdc20181
Sep 28 2018 17:16
Here is what we have so far its for a group on roblox (lol I should stop even going on there but its fun with friends I have had for a while) https://www.w3schools.com/code/tryit.asp?filename=FVPRC2F0ZDD3
Brad
@bradtaniguchi
Sep 28 2018 17:17
looks to be working for me, do you want the scroll animation when you click on these things (that's more fancy?
jdc20181
@jdc20181
Sep 28 2018 17:18
Well yea.. but thats not what I meant by I was having trouble getting it to do what I wanted.. lemme get you an example (I tried to repurpose these examples and they all didn't work maybe w3schools blocks external js?)
I was trying to use jquery, but heres a bootstrap version

```$(document).ready(function() {
$('a[href*=#]').bind('click', function(e) {
e.preventDefault(); // prevent hard jump, the default behavior

            var target = $(this).attr("href"); // Set the target as variable

            // perform animated scrolling by getting top-position of target-element and set it as scroll target
            $('html, body').stop().animate({
                    scrollTop: $(target).offset().top
            }, 600, function() {
                    location.hash = target; //attach the hash (#jumptarget) to the pageurl
            });

            return false;
    });

});

$(window).scroll(function() {
var scrollDistance = $(window).scrollTop();

    // Show/hide menu on scroll
    //if (scrollDistance >= 850) {
    //        $('nav').fadeIn("fast");
    //} else {
    //        $('nav').fadeOut("fast");
    //}

    // Assign active class to nav links while scolling
    $('.page-section').each(function(i) {
            if ($(this).position().top <= scrollDistance) {
                    $('.navigation a.active').removeClass('active');
                    $('.navigation a').eq(i).addClass('active');
            }
    });

}).scroll();```

is what I tried before

omg
I hate when code does that
Christopher McCormack
@cmccormack
Sep 28 2018 17:44
@jdc20181 ``` go on their own line
Morchid Chellali
@Morched23MJ
Sep 28 2018 17:50
class MyForm extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      input: '',
      submit: ''
    };
    this.handleChange = this.handleChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }
  handleChange(event) {
    this.setState({
      input: event.target.value
    });
  }
  handleSubmit(event) {
    this.setState({
      submit: event.target.value
    });
    event.preventDefault();
  }
  render() {
    return (
      <div>
        <form onSubmit={this.handleSubmit}>
          <input type="text" value={this.state.input} onChange={this.handleChange} />
          <button type='submit'>Submit!</button>
        </form>
        <h1>{this.state.submit}</h1>
      </div>
    );
  }
};
Apparently this doesn't solve the challenge. What's wrong with my code? I should handle the submit, and render it in a Header.
Challenge link: https://learn.freecodecamp.org/front-end-libraries/react/create-a-controlled-form
Aditya
@ezioda004
Sep 28 2018 18:11
@Morched23MJ Try logging event.target.value in
this.setState({
      submit: event.target.value
    });
ReesesLover123
@ReesesLover123
Sep 28 2018 21:42
<html>
<head>
<link title="Project8" rel="stylesheet" href="Project8.css" type="text/css" />
<link title="Project8Alt" rel="stylesheet" href="project8alt" type="text/css"/>
<style>
</style>
</head>
<body>
<div class="author"> Hello
<img src="meirl.gif"/>
</div>
<h1> This is a cat.</h1>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2> I lied, there's not a cat.</h2>

<h3> There's no cake either.</h3>

</body>
</html>

css- div.author {
position:absolute;
right: 350px;
width: 50px;
height: 50px;
}
p {

color:red;
background-color:aqua;
border: 1em solid #FFFF19;
}

The image floats to the right on the normal style, but with the alternate stylesheet it's heavily to the left. What do
AJ Brommy
@AJ-Brommy
Sep 28 2018 22:01
href="project8alt"
there is no file extension
newmoon
@newmoon
Sep 28 2018 22:03
Good catch!
Also, the <link> tags appear incorrect - do they have a title attribute?
<link rel="stylesheet" type="text/css" href="yourCSSFileName.css">