These are chat archives for FreeCodeCamp/HelpJavaScript

17th
Apr 2018
Adolfo Saenz
@AdoSae1
Apr 17 2018 03:39
body (
May Kittens Devour Your Soul
@diomed
Apr 17 2018 10:53
...)
1Mher1
@1Mher1
Apr 17 2018 10:54
please help in JavaScript anonymous function
May Kittens Devour Your Soul
@diomed
Apr 17 2018 10:54
body
( ( . ) ( . ) )
1Mher1
@1Mher1
Apr 17 2018 10:54
how can I Sort the array containing the names that are larger than 7 at the beginning
i tried this var name = ["Mher","Levon","Margarita","Ekatirina",]
name=name.filter(a => name.length < 7?1:-1)
console.log(name)
Markus Kiili
@Masd925
Apr 17 2018 10:55
@1Mher1 Filter is for creating a new array from some of the original elements, and sort is for sorting array elements.
1Mher1
@1Mher1
Apr 17 2018 10:57
I should do that if the array containing the names that are larger than at 7 put first
Stephen James
@sjames1958gm
Apr 17 2018 10:59
@1Mher1 Use sort function not filter function
1Mher1
@1Mher1
Apr 17 2018 11:01
@sjames1958gm var name = ["Mher","Levon","Margarita","Ekatirina",]
name=name.sort((a,b) => name.length < 7?1:-1)
console.log(name)
@sjames1958gm in console.log dont undertand name.sort no function
Stephen James
@sjames1958gm
Apr 17 2018 11:02
@1Mher1 You need to use a and b in the sort function a.length or b.length not name.length (name is the array)
1Mher1
@1Mher1
Apr 17 2018 11:03

@sjames1958gm why this code understand var z = ["Ararat","Mher","Hayk","Ashot","Aram"]

z=z.sort((a,b)=> a>b?1:-1)
console.log(z)

but this not undertand @sjames1958gm var name = ["Mher","Levon","Margarita","Ekatirina",]
name=name.sort((a,b) => a.length < 7?1:-1)
console.log(name)
Stephen James
@sjames1958gm
Apr 17 2018 11:04
@1Mher1 weird
name comes out as a string ??
1Mher1
@1Mher1
Apr 17 2018 11:05
yes
@sjames1958gm Uncaught TypeError: name.sort is not a function\
this is error
1Mher1
@1Mher1
Apr 17 2018 11:27
Howcan I remove negative numbers from array using lambda functions by JavaScript
var arr=[4,8,0,-7,20]
arr=arr.sort((a,b)=> a > -1 ?1:-1)
console.log(arr)
Markus Kiili
@Masd925
Apr 17 2018 11:29
@1Mher1 Sort doesn't remove anything, it only sorts.
1Mher1
@1Mher1
Apr 17 2018 11:31
@Masd925 what function I can use for this?
Claudio Restifo
@Marmiz
Apr 17 2018 11:32
filter
1Mher1
@1Mher1
Apr 17 2018 11:34
@Marmiz but in lambda how can I write/
var arr=[4,8,0,-7,20]
arr=arr.filter((a,b)=> a < -1 ?1:-1)
console.log(arr)
Markus Kiili
@Masd925
Apr 17 2018 11:40
@1Mher1 arr=arr.filter(a=>a>=0); would remove negative elements.
1Mher1
@1Mher1
Apr 17 2018 11:47
@Masd925 thx
CamperBot
@camperbot
Apr 17 2018 11:47
1mher1 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4783 | @masd925 |http://www.freecodecamp.org/masd925
1Mher1
@1Mher1
Apr 17 2018 11:47
please help me to Sort the array containing the names that are larger than 7 at the beginning
i tried this var name = ["Mher","Levon","Margarita","Ekatirina",]
name=name.sort((a,b) => a.length < 7?1:-1)
console.log(name)
Stephen James
@sjames1958gm
Apr 17 2018 11:50
@1Mher1 There must be something special about name probably use a different variable name
Elia
@elia-russad
Apr 17 2018 12:06
@1Mher1 maybe you want to filter array?
i don't get it
do you want to see Levon Aronyan in a result arr?
or it sould be in the end of the result array
Elia
@elia-russad
Apr 17 2018 12:26
name is a built-in property in js anyway
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 13:53
@1Mher1 , did the solution of upper casing the first and last character of an input field work?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 14:09
fetch(url, {
    method: 'post',
    headers: {
      "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
    },
    body: 'foo=bar&lorem=ipsum'
  })
  .then(json)
  .then(function (data) {
    console.log('Request succeeded with JSON response', data);
  })
  .catch(function (error) {
    console.log('Request failed', error);
  });
Does this attach the body at the end of the url and send it or is it actually in the body of the request.
Stephen James
@sjames1958gm
Apr 17 2018 15:04
@RoniqueRicketts That will put the info into the body of the post, not in the URL
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:04
@sjames1958gm thanks
CamperBot
@camperbot
Apr 17 2018 15:04
roniquericketts sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9208 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Jason Luboff
@JLuboff
Apr 17 2018 15:18
:wave:
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:22
@JLuboff sup man
Jason Luboff
@JLuboff
Apr 17 2018 15:22
Just starting the day, you?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:23
@JLuboff staying home from work since I don't feel 100% today. I am here trying to lazy code on an application :)
Jason Luboff
@JLuboff
Apr 17 2018 15:24
Hope you feel better bud
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:24
@sjames1958gm when we add credentials: 'include' to our fetch() code does this require JWT tokens?
@JLuboff I hope so too.
thanks btw
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 15:32
hello everyone
someone who knows a bit of python around?
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 15:34
yeah @tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 15:35
hey @arsho all good?so im really newbie to this but found out that python has a package that handles pdf merging easily just trying to figure out what im doign wrong with pip while installing it give me a second ;:D
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 15:36
@tiagocorreiaalmeida we may talk in https://gitter.im/FreeCodeCamp/python
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 15:36
ups didnt knew about that one thanks
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:38
@arsho hehe I am joining too because I am going to stay learning Python on my Birth Month. Its a part of my gift to myself :)
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 15:40
@RoniqueRicketts , you know what? I have never heard any better birthday gift! :D You will definitely enjoy it :)
@tiagocorreiaalmeida , are you there? :)
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:40
@arsho lol hehehe I think so. I believe in mental gifts on ones self. :)
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 15:41
That's really amazing. I am pretty sure you will keep your learning curve rising if you continue gifting like this! :D
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:42
@arsho Yes I will give myself a full year to practice Python hehehe, learning and building. But for now its all JavaScript :)
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 15:45
You can be a full stack developer. Python backend, JS frontend
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 15:47
you can also do it with nodejs :D , @arsho got it workign eheh thanks tough Im at work forgot I had no git installed here... :D
CamperBot
@camperbot
Apr 17 2018 15:47
tiagocorreiaalmeida sends brownie points to @arsho :sparkles: :thumbsup: :sparkles:
:cookie: 490 | @arsho |http://www.freecodecamp.org/arsho
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:51
@arsho Yes I can even though I am working on a fullstack application as we speak in JavaScript :) I am learning so much its not even funny. Learning how to read into error and fix unexpected features ( I am not calling them bugs anymore)
Jason Luboff
@JLuboff
Apr 17 2018 15:52
They're not bugs, they're features!
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 15:53
@JLuboff thats what I said. hehehe unexpected features. The code runs so its not a bug, the code is just not behaving in an expected way so its a feature I didn't plan for hehehe
Jason Luboff
@JLuboff
Apr 17 2018 15:57
:P\
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 16:14
They're not bugs, they're features!
will take this one in considerance next time I have one
:D
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 16:15
@tiagocorreiaalmeida good!
Blauelf
@Blauelf
Apr 17 2018 16:15
So from now on I'll use the defeaturer?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 16:15
@Blauelf yup, it could catch on
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 16:30
when we are working with images in react do we store then in the state when we are submitting them to the server?
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 16:53
yeah you can @RoniqueRicketts here is a good example: https://gist.github.com/AshikNesin/e44b1950f6a24cfcd85330ffc1713513
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 16:54
@arsho thanks bruv
CamperBot
@camperbot
Apr 17 2018 16:54
roniquericketts sends brownie points to @arsho :sparkles: :thumbsup: :sparkles:
:cookie: 491 | @arsho |http://www.freecodecamp.org/arsho
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 16:55
@arsho this is similiar with what I have its just that I want to know if this can be done the same way with fetch
Jason Luboff
@JLuboff
Apr 17 2018 17:02
Format your code properly :angry:
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:02
@JLuboff error bruv
here is what I have
class Signup extends Component {
  constructor(props){
    super(props);

    this.state ={
      firstname: "",
      lastname: "",
      email: "",
      telephone: "",
      avatar: [],
      schoolname: "",
      street: "",
      city: "",
      country: "",
      password: ""
    }
    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleChange = this.handleChange.bind(this);
    this.handleFileSelected = this.handleFileSelected.bind(this);
  }
  handleChange(event){
    if(event.target.id === "firstname"){
      this.setState({
        firstname: event.target.value
      });
    }
    else if(event.target.id === "lastname"){
      this.setState({
        lastname: event.target.value
      });
    }
    else if(event.target.id === "email"){
      this.setState({
        email: event.target.value
      });
    }
    else if(event.target.id === "telephone"){
      this.setState({
        telephone: event.target.value
      });
    }
    else if(event.target.id === "schoolname"){
      this.setState({
        schoolname: event.target.value
      });
    }
    else if(event.target.id === "street"){
      this.setState({
        street: event.target.value
      });
    }
    else if(event.target.id === "city"){
      this.setState({
        city: event.target.value
      });
    }
    else if(event.target.id === "country"){
      this.setState({
        country: event.target.value
      });
    }
    else if(event.target.id === "password"){
      this.setState({
        password: event.target.value
      });
    }
  }
  handleFileSelected(event){
    this.setState({
      avatar: this.state.avatar.concat(event.target.files[0])
    })
  }
  handleSubmit(){
    const url = 'http://localhost:8080/users/signup';
    fetch(url, {
      method: 'post',
      headers: {
        "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
      },
      body: `firstname=${this.state.firstname}&lastname=${this.state.lastname}&email=${this.state.email}&telephone=${this.state.telephone}&avatar=${this.state.avatar}&schoolname=${this.state.schoolname}&street=${this.state.street}&city=${this.state.city}&country=${this.state.country}&password=${this.state.password}`
    })
    .then(function (data) {
      console.log('Request succeeded with JSON response', data);
    })
    .catch(function (error) {
      console.log('Request failed', error);
    });
  }
the render section is not important. How will I populate avatar properly in state so I can send it to the server
{ firstname: 'John',
  lastname: 'Doe',
  email: 'h@h.com',
  telephone: '8764444444,
  avatar: '[object File]',
  schoolname: 'Data school',
  street: 'Data Street',
  city: 'Data City',
  country: 'Data Country',
  password: 'H' }
this is my server response
Ahmedur Rahman Shovon
@arsho
Apr 17 2018 17:05
@RoniqueRicketts , does this answer help? https://stackoverflow.com/a/36082038/3129414
Moisés Man
@moigithub
Apr 17 2018 17:11
handleChange:()=>{ this.setState({[event.target.id]:event.target.value}) }
should work i think.... using es7 enhanced object literal
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:17
@moigithub so where you have event.target.id should wont that be for the first event
Moisés Man
@moigithub
Apr 17 2018 17:18
since ur ID's have the same name as ur state keys,, that should work same way
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:19
@moigithub so replacing the If else with the above code should shorten my code?
Moisés Man
@moigithub
Apr 17 2018 17:19
i guess....
:)
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:19
ok cool
@moigithub what I was really focused on here was the ability to send my image along with the data I am collecting.
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:24
@arsho thanks I am trying to work through this
CamperBot
@camperbot
Apr 17 2018 17:24
roniquericketts sends brownie points to @arsho :sparkles: :thumbsup: :sparkles:
api offline
Moisés Man
@moigithub
Apr 17 2018 17:26
as u wrote on ur code... form-urlencoded is a string with key=value format (and multiple pairs joined with &)
BUT... im not sure if u can join a file value using that
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:27
@moigithub so id have to change the header type?
Moisés Man
@moigithub
Apr 17 2018 17:28
the example link posted above https://gist.github.com/AshikNesin/e44b1950f6a24cfcd85330ffc1713513uses
'content-type': 'multipart/form-data'
so instead of building a string (key=value pairs)
u create a formData object and append everything to it
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:30
@moigithub that was exactly what I wanted. I was wondering why I had to do it as a string omg you saved my brain a day of research thanks!!!
CamperBot
@camperbot
Apr 17 2018 17:30
roniquericketts sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3743 | @moigithub |http://www.freecodecamp.org/moigithub
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:41

@moigithub when I use

handleSubmit(){
    const url = 'http://localhost:8080/users/signup';
    fetch(url, {
      method: 'post',
      headers: {
        "Content-type": "multipart/form-data"
      },
      body: {name: 's'}
    })
    .then(function (data) {
      console.log('Request succeeded with JSON response', data);
    })
    .catch(function (error) {
      console.log('Request failed', error);
    });
  }

it send an empty object, what am I doing wrong here?

Moisés Man
@moigithub
Apr 17 2018 17:51
var formData = new FormData();
formData.append("username", "Groucho");
formData.append("accountnum", 123456); // number 123456 is immediately converted to string "123456"
formData.append("userfile", fileInputElement.files[0]);

 fetch(url, { method:'post', body: formData } )
.then((d)=>{console.log(d)})
.catch((e)=>{console.error(e)})
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 17:52
@moigithub i just found this on STackoverflow lol
Screen Shot 2018-04-17 at 12.52.10 PM.png
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:05
@moigithub tried your way and the way from stackover flow and it still failed I am getting a blank object on the server
Stephen James
@sjames1958gm
Apr 17 2018 18:11
@RoniqueRicketts Have you tried
'content-type': 'application/json'
and
body: JSON.stringify({name: 's'})
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:11
@sjames1958gm no
@sjames1958gm will this allow me to upload an image in the form?
Stephen James
@sjames1958gm
Apr 17 2018 18:12
@RoniqueRicketts
You mean send the image data to the backend? Probably not.
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:12
@sjames1958gm yes.
Stephen James
@sjames1958gm
Apr 17 2018 18:14
@RoniqueRicketts :(
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:14
@sjames1958gm I was hoping to send all the data at once
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:17
@sjames1958gm I tried removing the header and attaching the file and that fails also
Nate Mallison
@NJM8
Apr 17 2018 18:30
Can anyone help with express a bit? I'm rendering a static html file, which I have working fine for my index.html, but when I try to render error.html after an error it tells me 'Error: No default engine was specified and no extension was provided.'
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 18:31
@NJM8 are you using the express generator?
Nate Mallison
@NJM8
Apr 17 2018 18:31
nope, here is app.js : https://pastebin.com/kWgvtP03
ijhar
@ijhar8
Apr 17 2018 18:48
https://codepen.io/ijhar8/pen/aGoYNg can any one give me better solution of it .
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:13
https://github.com/tiagocorreiaalmeida/music-review/blob/master/client/src/components/ProfilePage.js @RoniqueRicketts I dont something similiar to what you want in this file give it a look, thered a function that handles the file input give it a look, othee than that I save it on the reactdtate before submiting the form
Do
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:19
@tiagocorreiaalmeida so I will have to switch form fetch to axios then?
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:46
no, axios has exactly the same purpose of fetch
@RoniqueRicketts do you know postman?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:47
Yes I am using it at the moment. I am not so verse on it btw
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:47
its used to test rest api's you make the request's manually and define e data to send, try to make the request with the image there
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:47
@tiagocorreiaalmeida ok never tried it with images before
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:48
can I see the full code?
client and server side?
and dont worry I remember it took me almost one day to get it working.. :D
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:50
@tiagocorreiaalmeida lol today is my first day on this form hehehe.
my sign in form works.
but my signup fails
i've been messing with the content type to see what difference it makes.
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:52
will try to compare my stuff with yours
the request body is coming empty back right?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:53
and btw don't you dare laugh at my code without providing some form of feedback to make it better. Then we can bother laugh at my code together hehehehe.
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:53
why laugh? we all need to learn stuff compared to someone else we can't know eveything,
dont worry :D
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:54
@tiagocorreiaalmeida yes it was until I change to the current content type but it is not accepting the form image.
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:54
I readed somewhere that you were using multer?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 19:54
@tiagocorreiaalmeida true, but its good to laugh, I am just saying that if you laugh you should provide an even better so next time I will do better. heheh
No I am not using multer, it was a suggestion I just started checking out what multer is lol hehehe
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 19:57
can you log the state on the top of handlesubmit function?
and see if the stuff is all there?
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:10
Yes when I log it out its all there.
ijhar
@ijhar8
Apr 17 2018 20:11

just got a mail
1:21 AM (14 minutes ago)
to me
Dear ijhar,

Thank you for your application for the Software Engineer Trainee position.

Our selection process involves multiple coding and interview rounds. You can get a significant advantage by making progress on FreeCodeCamp Front End Developer Track. https://www.freecodecamp.org/. If you get a score of 300+, you get additional marks in the selection process and/or bypass coding rounds

Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:11
@RoniqueRicketts then its time to implement multer I guess :\
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:12
@tiagocorreiaalmeida is that on the backend or frontend?
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:12
backend @RoniqueRicketts
let me see if I find the stuff I readed back then but it was quite some websites
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:13
@tiagocorreiaalmeida what is sendtfrom the frontend is just an empty array for the avatar in this.state
I found the api from the expressjs page. express has a bunch of middlewares
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:16
in this case you are turning the array into an object after you set the state cause the value of the first position is an object
  handleFileSelected(event){
    this.setState({
      avatar: this.state.avatar.concat(event.target.files[0])
    })
  }
please avoid this
dont use the current state while changing it, you can pass a function and have the previous state as an argument
also you dont need an array in this situation I guess?
the file related stuff is an object so an object will do it, also can you print me the output you get and show me ? or get me the repository url? if you have one
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:21
It may be a few changes behind
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:26
uh can you please commit the changes? im starting xampp right now so will start looking at it
but would make sense to have the stuff updated
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:26
one sec
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:37
@tiagocorreiaalmeida done. no need for the xampp that part is not yet in use as the backend is still in the development phase.
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:37
ok will give it a look
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:39
@tiagocorreiaalmeida thanks for the help in advance :)
CamperBot
@camperbot
Apr 17 2018 20:39
roniquericketts sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 516 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:40
just noticed @RoniqueRicketts dont commit your node modules, you can install them with just npm install after cloning a repository, avoids uploading all this junk :D
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:42
@tiagocorreiaalmeida if i add them to .gitignore will it ignore the uploads?
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:42
yes
node_modules/
will do it
Jason Luboff
@JLuboff
Apr 17 2018 20:44
Always add node_modules to your .gitignore
Brad
@bradtaniguchi
Apr 17 2018 20:51
Wheres the meme where they compare black holes to node_modules? No one wants to check node_modules into git :'(
Adel
@AdelMahjoub
Apr 17 2018 20:53
but you shouldn't check your dotenv if any into gitignore, your keys should be public :imp:
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:53
^ :D
Jason Luboff
@JLuboff
Apr 17 2018 20:53
:joy:
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:54
having issues starting the frontend @RoniqueRicketts deleting all the modules and the package lock to start over again :\
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 20:55
@AdelMahjoub fake news!!!!
Adel
@AdelMahjoub
Apr 17 2018 20:55
@RoniqueRicketts check your .env in .gitignore too
@RoniqueRicketts and add a .env.exemple as a hint
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 20:57
@AdelMahjoub @JLuboff codefights?
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed
what's even this
Jason Luboff
@JLuboff
Apr 17 2018 21:01
@tiagocorreiaalmeida mmm... I might be in for one
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:03
@AdelMahjoub i didn't realize I didn't ignore it thanks.
CamperBot
@camperbot
Apr 17 2018 21:03
roniquericketts sends brownie points to @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 680 | @adelmahjoub |http://www.freecodecamp.org/adelmahjoub
Jason Luboff
@JLuboff
Apr 17 2018 21:05
@tiagocorreiaalmeida Do a 10 minute one, I don't have enough time for a 15
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:05
sure np
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:05
@tiagocorreiaalmeida how? that module is just the React CLI
npm start should pop it up
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:05
@JLuboff done
@RoniqueRicketts no idea :\ funniest part is that I tried to open one of my projects and works well
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:06
what is the error your getting?
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:08
the above
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:08
@tiagocorreiaalmeida sigh I have to go now if you get it to work please send me a DM
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:08
and I start it says something about react scripts not existing :\
@RoniqueRicketts I will and sorry probably tomorrow morning at work will try to clone there
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:08
@tiagocorreiaalmeida thanks again
CamperBot
@camperbot
Apr 17 2018 21:08
roniquericketts sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
api offline
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:09
does it mean that ajv-keywords@3.1.0 is not installed on your machine?
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:09
yeah it says so :\
Ronique Ricketts
@RoniqueRicketts
Apr 17 2018 21:10
have rerun the installer to overwrite what you had? Or should npm install cover that in the initial install?
sigh gotta go now. bye guys, if I feel any better I may be back in a few hours
Jason Luboff
@JLuboff
Apr 17 2018 21:13
These are fucking retarded @tiagocorreiaalmeida :joy:
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:16
now this are some fucked up exercises :D
Jason Luboff
@JLuboff
Apr 17 2018 21:19
Dude...these suck
fucking @AdelMahjoub acting like he wouldn't get these
I give
Adel
@AdelMahjoub
Apr 17 2018 21:21
1 min left, I won't finish it, tiago has tricked us :laughing:
Jason Luboff
@JLuboff
Apr 17 2018 21:22
Honestly...I was lost for all of them lol
Tiago Correia
@tiagocorreiaalmeida
Apr 17 2018 21:22
congrats @AdelMahjoub :D
a solution for each language that's the oe ahah
Adel
@AdelMahjoub
Apr 17 2018 21:22
@tiagocorreiaalmeida thanks, can you pick the difficulty of the tournaments ?
CamperBot
@camperbot
Apr 17 2018 21:22
adelmahjoub sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 517 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Gulsvi
@gulsvi
Apr 17 2018 23:12
Anyone comfortable with Big-O notation? Trying to learn it...
Why is: log(n) + 4 considered O(log n) while log(n) * 5 + 12n + 8 considered O(n)?
Jason Luboff
@JLuboff
Apr 17 2018 23:19
Calling @Chrono79 for some Big-O notation
Brad
@bradtaniguchi
Apr 17 2018 23:42
@gulsvi Whats bigger log(n) or n?
Gulsvi
@gulsvi
Apr 17 2018 23:43
n is bigger than log(n) @bradtaniguchi
Brad
@bradtaniguchi
Apr 17 2018 23:43
Yea, that's all the Big-O notation states pretty much. O(n) is bigger, since 12n is in the equation
Gulsvi
@gulsvi
Apr 17 2018 23:44
I get that the second one takes more computations, just not sure how it becomes O(n) instead of O(n log n) or something even larger
Brad
@bradtaniguchi
Apr 17 2018 23:45
@gulsvi The main thing you need todo is throw out all the constants/ like +12. If the equation was 12n * log(n) then yes its n log n, but its not. Its log(n) + 12n. Graphing here helps a lot
Gulsvi
@gulsvi
Apr 17 2018 23:45
Hmmm, I hadn't thought of graphing it
so, multiplication vs. addition adds more complexity?
iso
@iso1048
Apr 17 2018 23:46
@gulsvi what resource/s are you using to learn comp sci?
Brad
@bradtaniguchi
Apr 17 2018 23:47
@gulsvi Yea think about the graphs where the x axis is the "size" of the computation, say sorting 10 items, vs 5. The y axis can be computation "work".
So like if your algo's big-O is "2^n" it sucks (the graph is exponential)
Gulsvi
@gulsvi
Apr 17 2018 23:47
Okay, thanks @bradtaniguchi
CamperBot
@camperbot
Apr 17 2018 23:47
gulsvi sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
:cookie: 463 | @bradtaniguchi |http://www.freecodecamp.org/bradtaniguchi
Gulsvi
@gulsvi
Apr 17 2018 23:48
@user-ap I came across this today and got curious: http://bigocheatsheet.com/
Brad
@bradtaniguchi
Apr 17 2018 23:48
It took me a long ass time to figure out what hell was going on with all this stuff, but stairing at graphs help the most haha
Gulsvi
@gulsvi
Apr 17 2018 23:48
Just searching around, nothing structured
Brad
@bradtaniguchi
Apr 17 2018 23:48
no BS formal definitions, proofs, or fancy lingo.
Gulsvi
@gulsvi
Apr 17 2018 23:48
I wish there was a way to more easily calculate Big-O
iso
@iso1048
Apr 17 2018 23:49
I wish I remembered calculus from high school
Brad
@bradtaniguchi
Apr 17 2018 23:49
I never learned how to calculate it formally, but spitballing it from code isn't that difficult
@user-ap You don't need calculus for CS, plus computers dont' understand it :trollface:
iso
@iso1048
Apr 17 2018 23:51
@bradtaniguchi I just miss calculus, and math in general
Brad
@bradtaniguchi
Apr 17 2018 23:51
gasp