These are chat archives for FreeCodeCamp/HelpFrontEnd

5th
Nov 2017
Dylan Thrasher
@Thrasherman
Nov 05 2017 01:48
Hello all!
Tom
@moT01
Nov 05 2017 01:49
hey
shashankbheeshva
@shashankbheeshva
Nov 05 2017 02:21
Hi
Dylan Thrasher
@Thrasherman
Nov 05 2017 02:22
How are you all? How long have you been coding? I just started this program. Only just completed the linking to external pages with anchor elements part.
Adam Bohannon
@abohannon
Nov 05 2017 02:52
Is this the best way to pass along data for the weather app?
// fetch user's IP address to get latitude and longitude
const IP_URL = 'https://ipapi.co/json/'

fetch(IP_URL)
  .then((response) => response.json())
  .then((data) => getWeather(data))
  .catch((error) => console.log('There was an error. IP promise rejected.', error))

// fetch local weather data using user data
const getWeather = (userData) => {
  console.log('user', userData)
  const {latitude, longitude} = userData
  const API_KEY = 'secret'
  const weatherAPI = `https://api.darksky.net/forecast/${API_KEY}/${latitude},${longitude}`
  const proxy = 'https://cors-anywhere.herokuapp.com/'
  const REQUEST_URL = proxy + weatherAPI

  fetch(REQUEST_URL)
    .then((response) => {
      if (response.status !== 200) {
        console.log('Problem with response', response.status)
      } else {
        return response.json()
      }
    })
    .then((data) => app(data))
    .catch((error) => console.log('There was an error. Weather promise rejected.', error))
}
the fetch inside getWeather sends data to my app(), but Dark Sky's data doesn't contain city data. What's the best way to get city data from the IP_URL fetch to my app without creating a global variable?
Moisés Man
@moigithub
Nov 05 2017 03:30
u already passing IP_URL fetch data to getWeather through userData variable...
but u "only extracting" (destructuring) latitude and longitude
u could write const {latitude, longitude, city, region, country} = userData
Ken Haduch
@khaduch
Nov 05 2017 03:31
@Thrasherman - hey there, welcome to freeCodeCamp! I've been doing freeCodeCamp for a couple years, coding a loonnnggggg time (but not web development.)
Dylan Thrasher
@Thrasherman
Nov 05 2017 03:42
@khaduch Awesome! I plan on doing this freecodecamp and a boot camp to help push me into a career. I hear some people get jobs right out of here, however, I will plan to keep pushing for more knowledge and higher chances of that happening.
kevharvell
@kevharvell
Nov 05 2017 04:36
I need help on summing all odd fibonacci numbers. My code works for all cases except sumFibs(75025). I have no idea why it's not working.
function sumFibs(num) {
  var a = 1, b = 0, sum = 0, temp;
  while (num >= 0){
    temp = a;
    a = a + b;
    b = temp;
    if(temp % 2 !== 0 && temp <= num + 2) {
      sum += temp;
    }
    num--;

  }
  return sum;
}

sumFibs(75025);
Adam Bohannon
@abohannon
Nov 05 2017 05:10
@moigithub but then how do I get city into the fetch for REQUEST_URL to be passed into app()?
Adam Bohannon
@abohannon
Nov 05 2017 05:16
or should i place the fetch inside of app()?
Rada
@Radascript
Nov 05 2017 05:28
hey guys! Does anyone know how to make it so that when I hover off the element, it disappears the border in reverse way from hover, rather than instantly go?
https://codepen.io/RadaCodes/pen/ZaWwqJ?editors=1100
Rada
@Radascript
Nov 05 2017 05:42
@kevharvell idk what exactly you are doing with num + 2 and num--. You can just tweak your conditions so that it stops summing when temp > num
function sumFibs(num) {
  var a = 1, b = 0, sum = 0, temp = 0;
  while (temp <= num){
    temp = a;
    a = a + b;
    b = temp;
    if(temp % 2 !== 0 && temp <= num) {
      sum += temp;
    }

  }
  return sum;
}

sumFibs(75025);
alpox
@alpox
Nov 05 2017 09:04
@Radascript Seems you've done it :-)
linkin-park
@linkin-park
Nov 05 2017 09:39
hi pox
Addison
@addisonday
Nov 05 2017 09:52
https://codepen.io/addisonday/pen/xPVmJg?editors=1111
I have yet to add tweet functionaliy, but let me know what you guys think
alpox
@alpox
Nov 05 2017 09:58
@linkin-park :wave:
linkin-park
@linkin-park
Nov 05 2017 10:01
i have seen others they fetch there quotes from unknown endpoint and display @addisonday
Quantomistro3178
@Quantomistro3178
Nov 05 2017 10:50
// Example
var ourArr = [ 9, 10, 11, 12];
var ourTotal = 0;

for (var i = 0; i < ourArr.length; i++) {
  ourTotal += ourArr[i];
}

// Setup
var myArr = [ 2, 3, 4, 5, 6];

// Only change code below this line
var total = 0;

for (var i = 0; i < myArr.length; i++ ) {
  total += myArr[i];
}
I completed the challenge somehow, but I need help understanding the logic
help, please?
Max Voronov
@maxv
Nov 05 2017 11:35
@Quantomistro3178 It looks like you just sum all the numbers into the total variable
gaitchs gangmei
@gaitchs
Nov 05 2017 11:52
How to change services class box
Color box
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 11:53
@gaitchs what do you mean?is there a link for that?
gaitchs gangmei
@gaitchs
Nov 05 2017 11:54
I mean editing a template
The class is derived from servicess.css
The box color is green, I don't know how where to edit the code to change it
<div class="row services-row services-row-head services-row-1 services- ">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<div class="services-group wow animated fadeInLeft" data-wow-offset="40">

<p class="services-icon"><i class="fa fa-truck fa-5x"></i></p>
<h4 class="services-title">TOURISM</h4>
<p class="services-body">We are partnered with well establshised tourism agency that will impulse our growth and confidence in this sector, making platinum token a great investment opportunity</p>

</div>
</div>
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 11:56
show me a print if posslbe of what you wanna do and what you have
gaitchs gangmei
@gaitchs
Nov 05 2017 11:58
Ok on mobile right now .. will be home in a moment ..
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 11:58
sure go ahead ;)
Kevin
@AnaRobynn
Nov 05 2017 12:02
Someone can help me with REGEX?
Need to find a regex that matches both
This one
The green box
Android , apply, easy to use box
Ashwin
@ashwins93
Nov 05 2017 12:05
@AnaRobynn /import\s+.+from\s+['\"]react['\"]/g
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:05
this?
image.png
gaitchs gangmei
@gaitchs
Nov 05 2017 12:05
Yes
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:05
dont know how to change your background color ?
Ashwin
@ashwins93
Nov 05 2017 12:05
@AnaRobynn or even import\s+.+\sfrom\s+['\"]react['\"]
gaitchs gangmei
@gaitchs
Nov 05 2017 12:05
I forgot
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:05
of the icon or entire box?
gaitchs gangmei
@gaitchs
Nov 05 2017 12:07
Entire box
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:08
on the div or element you used to make the box you use background-color: thecoloryouneed;
gaitchs gangmei
@gaitchs
Nov 05 2017 12:08
Same for the light green overall background ?
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:09
yes
lightgreen of what?icons?
gaitchs gangmei
@gaitchs
Nov 05 2017 12:09
Just below the header
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:10
that line?
gaitchs gangmei
@gaitchs
Nov 05 2017 12:10
Or the overall background colour
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:10
image.png
Kevin
@AnaRobynn
Nov 05 2017 12:10
@ashwins93 Wooooh, you seem to know your REGEX.
I tried entering a capture group which included line-breaks as well :P
but tough luck
gaitchs gangmei
@gaitchs
Nov 05 2017 12:11
@tiagocorreiaalmeida yes
Ashwin
@ashwins93
Nov 05 2017 12:23
@AnaRobynn what are you trying to capture?
Kevin
@AnaRobynn
Nov 05 2017 12:24
@ashwins93 Well, someone made improvements on the react layer for Spacemacs
syl20bnr/spacemacs@12f823b
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 12:25
@gaitchs that cna be a border or a ::after
Kevin
@AnaRobynn
Nov 05 2017 12:25
What is does it choses the react-mode when it finds a match, in that REGEX. I think I found the solution though
Revert that commit.
Ashwin
@ashwins93
Nov 05 2017 12:27
ok? what do you wanna match? im not getting the intent
Kevin
@AnaRobynn
Nov 05 2017 12:28
@ashwins93 I don't want to match something specific. I just want to check the first line of the file and if it includes react
use the react layer
I think reverting the changes on that commit improves it for me
Ashwin
@ashwins93
Nov 05 2017 12:29
yeah thats done now right?
by matching import statements
Victor Abeledo
@victorja
Nov 05 2017 12:41
Hi guys, need some help with Reactjs components, I want to edit a list of movies and don't know how. Here is the full question on https://stackoverflow.com/questions/47121542/how-to-pass-a-value-to-other-component-in-react
Ashwin
@ashwins93
Nov 05 2017 12:49
@victorja you might want to make your "Movie" a stateless component
you can store the movie names on your movie array
That is not the solution
but it makes it easier to manipulate, to have all information in a single state
Victor Abeledo
@victorja
Nov 05 2017 12:50
@ashwins93 it was stateless but I tried changing it because I don't know how to pass values to the other component, I'm a bit lost
@ashwins93 I think the solution is with .bind?
Ashwin
@ashwins93
Nov 05 2017 12:50
you can pass the value as props
Victor Abeledo
@victorja
Nov 05 2017 12:54

So should it be

<button onClick={this.props.editMethod(),this.props.text}>edit</button>

?
gaitchs gangmei
@gaitchs
Nov 05 2017 13:09
how to change the box color green
<div class="row services-row services-row-head services-row-1 background-color:red">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<div class="services-group wow animated fadeInLeft" data-wow-offset="40">

<p class="services-icon"><i class="fa fa-truck fa-5x"> </i></p>
<h4 class="services-title">TOURISM</h4>
<p class="services-body">We are partnered with well establshised tourism agency that will impulse our growth and confidence in this sector, making platinum token a great investment opportunity</p>

</div>
</div>
this does not work
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 13:15
do you have a codepen for it?
gaitchs gangmei
@gaitchs
Nov 05 2017 13:16
no
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 13:16
make one and paste the link after!
gaitchs gangmei
@gaitchs
Nov 05 2017 13:16
upload all the web folder ?
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 13:17
place all the code in a codepen the html and the css
gaitchs gangmei
@gaitchs
Nov 05 2017 13:19
how to paste css
which one
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/animate.min.css">
<link rel="stylesheet" href="assets/css/style.css">
Tom
@moT01
Nov 05 2017 13:51
@gaitchs css libraries can get added on code pen in the little settings menu
click the little settings icon on the top left of the css section, and at the bottom there's a quick add
you can add bootstrap there
or paste in other libraries that they don't have listed
Jack Lyons
@JackEdwardLyons
Nov 05 2017 14:44
hey guys is there anyone out there who could help me with a Vue.js problem?
I'm trying to create a table which you can click on a row and toggle (show/hide) some relevant data
the problem is when I click toggle, because it is in a loop, it just toggles all the rows at once
if you want, i can give access to my c9 demo
Tom
@moT01
Nov 05 2017 14:48
i dont know any vue, but maybe you need to give each row or toggle button some sort of id or something
Jack Lyons
@JackEdwardLyons
Nov 05 2017 14:50
yeah... vue is super similar to react
so if that helps...
Tom
@moT01
Nov 05 2017 14:53
well, it doesn't hurt i guess
i feel like you need some sort of unique information to identify the row
Jack Lyons
@JackEdwardLyons
Nov 05 2017 14:58
yeah, i've been trying using indexes and keys but its still rendering in every row
Christopher Susi
@chrisandsuch
Nov 05 2017 15:06
Hey all, what is the best way (using GIT terminal) to restore a file in your working directory to the last commit you made
Tom
@moT01
Nov 05 2017 15:06
yea, i dunno - it's not letting me sign on with my github, and i dont feel like making a new account
@chrisandsuch what did you do
Christopher Susi
@chrisandsuch
Nov 05 2017 15:07
@JackEdwardLyons Did you try using unique id for each row?
Jack Lyons
@JackEdwardLyons
Nov 05 2017 15:08
@chrisandsuch yeah i think so....
I have the index as a key
i have two components, one for each td
when i click one component, i just want to display it's data, but it's populating all the other components as well
I bet this is something simple but I'm really struggling to figure this out
Jan
@pungiish
Nov 05 2017 15:10
@chrisandsuch check out git docs, it should be under checkout
Christopher Susi
@chrisandsuch
Nov 05 2017 15:13
@JackEdwardLyons this may be more involved than necessary but did you try seperating your loop function from everything else. Then using it as needed for each row?
Jack Lyons
@JackEdwardLyons
Nov 05 2017 15:14
how exactly do you mean? @chrisandsuch
sorry im a bit lost
Christopher Susi
@chrisandsuch
Nov 05 2017 15:23
@JackEdwardLyons start with creating a function that loops through data and displays it. Lets say you call it function loopAndShow. Then for each row ( and click event) you can use that function where you need it. Reusable
Jack Lyons
@JackEdwardLyons
Nov 05 2017 15:27
well, with vue you hav the v-for directive
which works easily, but with table elements its proving to be way harder
its so hard to explain
Christopher Susi
@chrisandsuch
Nov 05 2017 15:28
@JackEdwardLyons Oh. I didn’t know that. Haven’t worked with vue.js much at all
Marc
@MWBauer
Nov 05 2017 15:36
MOrning everyone
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 15:50
anyone who has experience with flexbox around?
alpox
@alpox
Nov 05 2017 15:51
@tiagocorreiaalmeida :wave: me, me, me :D
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 15:51
ahaha really?
alpox
@alpox
Nov 05 2017 15:51
:point_up:
Yup :D some
what would be the best way to keep those in their placeI know the effect is created by the spacebetween
on the econd line
but was thinking if is there any work around on it
alpox
@alpox
Nov 05 2017 15:55
@tiagocorreiaalmeida I guess it killed my browser :D i see only white
Ah noow
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 15:55
ahahhahahah
alpox
@alpox
Nov 05 2017 15:55
So you wanted the two elements there to be arranged how?
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 15:56
if I have 2 elements I want them side by side probably will have to remove the space-between and manage to create distance on the elements inside
alpox
@alpox
Nov 05 2017 15:58
@tiagocorreiaalmeida yea i think so. you'd need to center the elements and provide enough distance
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 15:58
yeah was thinking about it just trying to figure out if was there any option I could use/combine on flex to solve it but guess no
solved
image.png
alpox
@alpox
Nov 05 2017 16:02
@tiagocorreiaalmeida Ah well i thought you wanted the lower one to be in the middle :D
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 16:02
nono eheheh
I want them side by side now when I render it from the backend it can grows much as needed
alpox
@alpox
Nov 05 2017 16:03
Okay :D
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 16:11
so how's life?
Christopher Susi
@chrisandsuch
Nov 05 2017 16:16
@tiagocorreiaalmeida Life is going well. Coding is a lot of fun! Hey for your last question were you limiting the amount of external libraries in your code? I think jQuery Mobile, Bootstrap, w3 might give you some more options for responsive design.
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 16:17
@chrisandsuch im avoiding bootstrap allready got alot of projects with it :D doing some simple css using variables from css
and using flexbox for simple grids
Christopher Susi
@chrisandsuch
Nov 05 2017 16:20
@tiagocorreiaalmeida the vanilla approach definetly helps. building it your own way can be exciting
Moisés Man
@moigithub
Nov 05 2017 16:27
@abohannon since userData is available inside getWeather function .. u can just pass along
.then((data) => app(data, userData))
or just city
.then((data) => app(data, userData.city))
or since data is an object.. probably attach it as property
data.city = userData.city
.then((data) => app(data))
alpox
@alpox
Nov 05 2017 16:30
@tiagocorreiaalmeida Life is boring and stressful the same time :D but it gets better soon
@tiagocorreiaalmeida I mostly use Semantic UI instead of Bootstrap
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 16:33
gotta give it a try one day ;)
Christopher Susi
@chrisandsuch
Nov 05 2017 16:43
@alpox why do you prefer semantic ui over bootstrap? there are just so many to choose from. What process do you go through for deciding which one to use for your project?
alpox
@alpox
Nov 05 2017 16:46
@chrisandsuch I look at what my need is (Type of project) and what the framework provides me and how flexible it is - how easy it is to put in my own css when needed without destroying the whole framework layout etc.
Adam Bohannon
@abohannon
Nov 05 2017 16:47
@moigithub I refactored a bit to chain both fetches. But I don't see how to get userData to app(data). Aren't they separated by scope?
// fetch data
const IP_URL = 'https://ipapi.co/json/'

fetch(IP_URL)
  .then((response) => {
    if (response.status !== 200) {
      console.log('Problem with ip response', response.status)
    } else {
      return response.json()
    }
  })
  .then((userData) => {
    const {latitude, longitude, city} = userData // how to get city to app()?
    const API_KEY = '1234'
    const weatherAPI = `https://api.darksky.net/forecast/${API_KEY}/${latitude},${longitude}`
    const proxy = 'https://cors-anywhere.herokuapp.com/'
    const REQUEST_URL = proxy + weatherAPI

    return fetch(REQUEST_URL)
  })
  .then((response) => {
    if (response.status !== 200) {
      console.log('Problem with response', response.status)
    } else {
      return response.json()
    }
  })
  .then((data) => app(data))
  .catch((error) => console.log('There was an error. Weather promise rejected.', error))
alpox
@alpox
Nov 05 2017 16:47
Semantic UI is very flexible, has almost everything bootstrap has (and much more), lends itself much better to technical websites (Lots of forms etc.), own css is rarely needed and when needed its very easy to integrate and seldomly makes any trouble
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 16:49
atually if you have to build something unique that someone design I think the best path to go is to write the entire thing css
Christopher Susi
@chrisandsuch
Nov 05 2017 16:50
@alpox is it cross platform responsive? Easy to integrate oauth2 with it?
alpox
@alpox
Nov 05 2017 16:50
@tiagocorreiaalmeida Mostly yes :D in some cases you just don't have time for it though
@chrisandsuch responsive, yes. Easy to integrate oauth2? Well... no css framework helps you with that stuff :D
It has not even anything to do with it
So it doesn't stand in your way but also doesn't help
Moisés Man
@moigithub
Nov 05 2017 16:52
on this new code.. yes.. scopes will be different.. cuz what u have available on the "next" then callback
is what u return from previous then @abohannon
Christopher Susi
@chrisandsuch
Nov 05 2017 16:52
@alpox oh. Thats more of the backend right? I need to get more familiar with that.
alpox
@alpox
Nov 05 2017 16:53
@chrisandsuch Oauth2 is the authentication process which involves frontend and backend - but semantic ui and bootstrap are only css frameworks. They only care about design and appeareance. Not logic
Moisés Man
@moigithub
Nov 05 2017 16:55
// fetch data
const IP_URL = 'https://ipapi.co/json/'

fetch(IP_URL)
  .then((response) => {
    if (response.status !== 200) {
      console.log('Problem with ip response', response.status)
    } else {
      return response.json()
    }
  })
  .then((userData) => {
    const {latitude, longitude, city} = userData // how to get city to app()?
    const API_KEY = '1234'
    const weatherAPI = `https://api.darksky.net/forecast/${API_KEY}/${latitude},${longitude}`
    const proxy = 'https://cors-anywhere.herokuapp.com/'
    const REQUEST_URL = proxy + weatherAPI

    fetch(REQUEST_URL) .then((response) => {
    if (response.status !== 200) {
      console.log('Problem with response', response.status)
    } else {
      return response.json()
    }
  }).then(function(data){
 // here u can mix both "datas" cuz scopes
  return {data: data,  userData: userData}
})
  })

  .then(({data, userData}) => app(data)) // here u will have available whatever u returned on previous then
  .catch((error) => console.log('There was an error. Weather promise rejected.', error))
Adam Bohannon
@abohannon
Nov 05 2017 16:56
@moigithub makes sense. Thank you. Comparing this code with the last that separate the fetch calls, is one better than the other?
CamperBot
@camperbot
Nov 05 2017 16:56
abohannon sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3701 | @moigithub |http://www.freecodecamp.com/moigithub
Christopher Susi
@chrisandsuch
Nov 05 2017 16:56
@alpox Oh yeah! I just remember having a rough time integrating it into a React Native app last year. I still have much to learn, but its fun to figure it out. Thanks for the help.
CamperBot
@camperbot
Nov 05 2017 16:56
chrisandsuch sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1437 | @alpox |http://www.freecodecamp.com/alpox
Adam Bohannon
@abohannon
Nov 05 2017 17:20
@moigithub I couldn't get the final .then to work, but this works. Thanks again.
const app = (data) => {
  console.log(data)
  const {
    temperature,
    time,
    icon,
    precipProbability,
    summary,
    humidity
  } = data.weatherData.currently

  const {
    city
  } = data.userData

  console.log(city)

  const tempEl = document.querySelector('.container__temp')

  tempEl.innerHTML = `<span>${temperature}</span>`

  const imageEl = document.querySelector('.container__image')

  imageEl.innerHTML = `<span>${summary}</span>`
}

// fetch user's IP address to get latitude and longitude
const IP_URL = 'https://ipapi.co/json/'

fetch(IP_URL)
  .then((response) => {
    if (response.status !== 200) {
      console.log('Problem with ip response', response.status)
    } else {
      return response.json()
    }
  })
  .then((userData) => {
    const {latitude, longitude} = userData
    const API_KEY = '1234'
    const weatherAPI = `https://api.darksky.net/forecast/${API_KEY}/${latitude},${longitude}`
    const proxy = 'https://cors-anywhere.herokuapp.com/'
    const REQUEST_URL = proxy + weatherAPI

    fetch(REQUEST_URL)
      .then((response) => {
        if (response.status !== 200) {
          console.log('Problem with response', response.status)
        } else {
          return response.json()
        }
      })
      .then((weatherData) => {
        app({weatherData, userData})
      })
  })
  .catch((error) => console.log('There was an error. Weather promise rejected.', error))
CamperBot
@camperbot
Nov 05 2017 17:20
abohannon sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
api offline
Adam Bohannon
@abohannon
Nov 05 2017 17:20
sorry for the code vomit, everyone. Wish gitter would collapse like slack =\
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 18:46
@alpox wanna pair code the booking trade project?
alpox
@alpox
Nov 05 2017 18:48
@tiagocorreiaalmeida Sry, got too much on me atm :-) we can maybe do something like that sometime when i have more time :D
@tiagocorreiaalmeida I'm not doing FCC projects usually though
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 18:49
sure np ehehe
alpox
@alpox
Nov 05 2017 18:49
For me it would be interesting to try that in clojure ;-)
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 18:53
im thinking about usy mysql for this one not sure yet going to leave to last project the stock market one since its a different thing and forces to use external things apis and others and was getting a bit anxious :D
alpox
@alpox
Nov 05 2017 18:54
@tiagocorreiaalmeida Alright :D mysql is a good idea
Jan
@pungiish
Nov 05 2017 19:15
Which frameworks are you guys using? Opinions on Angular vs React vs Vue? I shy away from angular just because i don't want my app to be deprecated yearly. Just started learning React, which i know isn't a framework like the other two, but I like using it for now, just finishing the alpha challenges.
sirAnwarz
@sirAnwarz
Nov 05 2017 19:16
bf2100c583.jpg
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 19:18
?
sirAnwarz
@sirAnwarz
Nov 05 2017 19:19
any1 know how this "banners" are called if I want to look for them in inet? they move aside when you press em
Usama Mahmood
@usamacjs
Nov 05 2017 19:44
hello

function check() {
for (var i = 200; i < 250; i++) {

if (i%4 == 0)
var no = [i];
return no;

}

}
var c= check();
var el= document.getElementById('yeah');
for (var i = 0; i < 12; i++) {
el.textContent += c[i] +', ' ;
}

i am trying to display number divisible by 4 between 200 and 250.
can someone please check what's wrong with my code?
Moisés Man
@moigithub
Nov 05 2017 19:48
when NO curly brackets included... ONLY the immediate next line would be part of the previous statement
function check() {
   for (var i = 200; i < 250; i++) {
       if (i%4 == 0)
           var no = [i];
       return no;
   }
}
vs
function check() {
   for (var i = 200; i < 250; i++) {
       if (i%4 == 0) {
           var no = [i];
           return no;Ç
       }
   }
}
and.... return ends/exit the function
Usama Mahmood
@usamacjs
Nov 05 2017 19:51
okay okay, i understand
so what should i change
Screen Shot 2017-11-05 at 9.50.28 PM.png
this is the output after the changes you told me to make..
Moisés Man
@moigithub
Nov 05 2017 20:17
function check() {
   var el= document.getElementById('yeah');
   for (var i = 200; i < 250; i++) {
       if (i%4 == 0) {
           el.textContent += i +', ' ;
        }
   }
}
@usamacjs
mmiikkii94
@mmiikkii94
Nov 05 2017 20:57
Guys how to center submit button, i tried few things but without success?
https://codepen.io/mmiikkii/pen/eeJxwK
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:03
@mmiikkii94 since you are using bootstrap change your button to this
<div class="from-group text-center"><button type="button" class="btn btn-primary" style="
    /* margin: 0 auto; */
    text-align: center;
    ">Submit</button></div>
sec
<div class="from-group text-center"><button type="button" class="btn btn-primary" 

>Submit</button></div>
this will do it
mmiikkii94
@mmiikkii94
Nov 05 2017 21:06
@tiagocorreiaalmeida thanks a lot
CamperBot
@camperbot
Nov 05 2017 21:06
mmiikkii94 sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 427 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:09
@alpox around?
alpox
@alpox
Nov 05 2017 21:10
@tiagocorreiaalmeida Yah
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:12
im using some made charts that I found
image.png
this is the data that the chart reads, milisecond followed by value
but the data that I get from an api ts
['2017-11-03', 35.25]
I wound how muh would take for a foreach to run over 350 regists
this will make the app bad :D
wonder*
ok this doesnt seems to be a problem I runned over 9500 regists locally in 2econds :D
alpox
@alpox
Nov 05 2017 21:22
@tiagocorreiaalmeida Yea that should work out :D
But why do you have those as strings? Pretty bad :D
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:22
that was a mistake writing tough :D
the api returns a date type
yeah worked
alpox
@alpox
Nov 05 2017 21:23
Aha okay :-)
Nice
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:23
        response.on("end",()=>{
            data = JSON.parse(data);
            let dataSta = data.dataset.data.map((ele)=>{
                return moment(ele[0]).format('x') + "," + ele[1];
            })
            console.log(moment('2017-11-03').format('x'));
            Symbol.create({name:data.dataset.dataset_code,description:data.dataset.name
                ,date:moment().format("YYYY-MM-DD")
                ,data:dataSta}).then((doc)=>{
                   //emit to frontend
                }).catch((e)=>{ 
                    console.log(e);
                });
        });
but im sure that someday this will fail
cause the create doc ddoesnt wait for the map
alpox
@alpox
Nov 05 2017 21:24
Hmm why do you make a symbol of that?
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:24
symbol its a colletion, I need to store them so when I reopen the browser send to the page the ones I have on db
so if I user searchs for something I had it to the db and then display on the chart
alpox
@alpox
Nov 05 2017 21:25
Aah okay
Its just that Symbol is also an ES6 primitive
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:25
ups
didnt knew
will change it
alpox
@alpox
Nov 05 2017 21:26
Hmm and why shouldn't the create doc wait for the map? :D that code runs synchronous until the create
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 21:27
yeah nm it will api, I tough this would be really sllow but then I saw 9000 regists changing in 2 seconds or less and I was like, ok then :D
will wait*
alpox
@alpox
Nov 05 2017 21:28
Heheh :D could be worse yes
Javascript is sometimes quite fast
CallMeOrange
@EgnaroDev
Nov 05 2017 22:11
Yo
Christopher Susi
@chrisandsuch
Nov 05 2017 22:12
@EgnaroDev Hey
CallMeOrange
@EgnaroDev
Nov 05 2017 22:13
Sup
Christopher Susi
@chrisandsuch
Nov 05 2017 22:14
Was ES6 a big change from ES5?
CallMeOrange
@EgnaroDev
Nov 05 2017 22:14
I was not on fCC for a while, did fCC change or anything?
:o
Sorry I do not know much about ES5 or ES6..
Christopher Susi
@chrisandsuch
Nov 05 2017 22:16
@EgnaroDev I haven’t used FCC in awhile, but I enjoyed working through some of those lessons. How far did you get through FCC?
CallMeOrange
@EgnaroDev
Nov 05 2017 22:17
Well last time I was on Intermediate Algorithm Scripting
I was so busy with school so I probably forgot most of these
Right now I'm creating new account for fCC to start over, I'm sure I can catch up by a week or so
Christopher Susi
@chrisandsuch
Nov 05 2017 22:20
@EgnaroDev I’m in a similiar situation. Trying to do a quick refresh with JavaScript. Its all coming back as I read through some tutorials. I’ll be hitting up FCC problems soon after for practice
@EgnaroDev looks like some really cool features were added in ES6 javaScript
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 22:22
@alpox lord and savior around?
CallMeOrange
@EgnaroDev
Nov 05 2017 22:28
I remember HTML&CSS now, I can write style tags, attribute, etc. without having to review it
Yeah ES6 looks cool, I haven't learned it yet
I thought beta fCC would be ready in around November
CallMeOrange
@EgnaroDev
Nov 05 2017 22:34
@chrisandsuch How long have you been on fCC?
Christopher Susi
@chrisandsuch
Nov 05 2017 22:36
@EgnaroDev I started last year. I used teamtreehouse too.
CallMeOrange
@EgnaroDev
Nov 05 2017 22:38
Nice
Christopher Susi
@chrisandsuch
Nov 05 2017 22:38
@EgnaroDev I bounced around learning 6 or 7 languages and built a lot of tutorial projects. I haven’t built my own yet, but its definitely a goal of mine.
CallMeOrange
@EgnaroDev
Nov 05 2017 22:39
Wow, which languages have you learned?
Christopher Susi
@chrisandsuch
Nov 05 2017 22:45
@EgnaroDev javascript, python, ruby, swift, java, nosql. I really enjoyed learning how each language uniquely put their own flavor on the basic concepts. It seemed ruby was the most feature rich. Apple’s swift was the most challenging for me at first. With swift you have to specificially define your parameter types before using them. I think the term is ‘safe’ code. In the long run I think it helped me understand the concept a lot better.
CallMeOrange
@EgnaroDev
Nov 05 2017 22:46
That is good, so you learned some of these languages from teamtreehouse?
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 22:47
@EgnaroDev threehouse its expensive and even tough it can be worth there's other ways of learning aswell ;) I checked threehouse and tought about going on it but was like nah not today :D
Christopher Susi
@chrisandsuch
Nov 05 2017 22:48
@EgnaroDev Yeah. Sometimes I was really curious about something I learned and intended up reading up on it for hours lol
CallMeOrange
@EgnaroDev
Nov 05 2017 22:48
I see, sorry this is off topic but do you do crossfit? lol
Christopher Susi
@chrisandsuch
Nov 05 2017 22:49
@EgnaroDev Yeah, treehouse was expensive. I did like the instructor Pasan and the way he descibed concepts, so I found it worth the price at the time.
Tiago Correia
@tiagocorreiaalmeida
Nov 05 2017 22:50
I was about the techdegrees and I tought it was aswell 25 month but then I saw the price to those and well
Christopher Susi
@chrisandsuch
Nov 05 2017 22:50
@EgnaroDev I haven’t tried it, but have always been interested.
CallMeOrange
@EgnaroDev
Nov 05 2017 22:50
Hm.. They are good sport
Better than bodybuilding
I started doing crossfit like 2 years ago since my school offered these classes, they were hard... but I am used to it
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 22:54
.
about @ProgrammingForFun01
CamperBot
@camperbot
Nov 05 2017 22:54
:cookie: 19 | @programmingforfun01 |http://www.freecodecamp.com/programmingforfun01
Christopher Susi
@chrisandsuch
Nov 05 2017 22:54
@EgnaroDev I believe there is a free trial for treehouse that may help build up momentum for learning to code. You can create some amazing things with code. I imagine crossfit does a lot for mobility. I used to do a lot of weight training back in college and some after. It can be hard on your joints
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 22:57
Yeah, even my hips couldn't keep it up anymore and my back keeps hurting during walking and holding 80 pounds ball...
It was my fault using wrong form
I guess that is enough for now.. I am going back to coding
Christopher Susi
@chrisandsuch
Nov 05 2017 23:24
@EgnaroDev Where are you from? I’m from Texas
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:24
I come from Pakistan, currently live in US
Christopher Susi
@chrisandsuch
Nov 05 2017 23:26
@ProgrammingForFun01 Oh cool. Do you miss home? What was the biggest change for you in the US?
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:26
Not really, I came to US when I was 1 years old
Here and there are much pretty the same
Christopher Susi
@chrisandsuch
Nov 05 2017 23:27
@ProgrammingForFun01 What kind of food is your favorite?
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:28
Pizza lol
Christopher Susi
@chrisandsuch
Nov 05 2017 23:30
@ProgrammingForFun01 Same here lol. Always gives me a food coma after, so I’m gonna scale it back some haha
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:31
What do you mean by food coma?
Christopher Susi
@chrisandsuch
Nov 05 2017 23:32
@ProgrammingForFun01 That feeling you have to take a huge nap after eating a big meal
@ProgrammingForFun01 probably some sort of a gluten intole
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:33
ooh
Christopher Susi
@chrisandsuch
Nov 05 2017 23:33
@ProgrammingForFun01 *intolerance
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:33
lol "gluten"
So what are you coding right now?
Christopher Susi
@chrisandsuch
Nov 05 2017 23:35
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:36
I see
Christopher Susi
@chrisandsuch
Nov 05 2017 23:40
@ProgrammingForFun01 sometimes really wish I could go back and major in computer science. I learned a lot in health science that I love, but computer science is my first love
Saboor Malik
@ProgrammingForFun01
Nov 05 2017 23:41
Yeah I have seen some people wishing to major in Computer Science back then
Lucky I'm young, I plan to major in Computer Science :/
I'm curious.. what is this health science? like Biology?
An academically rigorous degree program, the Bachelor of Science in Health Science includes science-based courses in biology, chemistry, human anatomy and physiology, along with electives such as pharmacology, epidemiology, public health, nutrition and healthcare management that allow you to focus in your areas of ...
Interesting... I'm taking health next semester :/ not even close
Christopher Susi
@chrisandsuch
Nov 05 2017 23:55
@ProgrammingForFun01 it covers multiple topics in health. For instance, biology, genetics, organic & inorganic chem, physics (cal or algebra based), kinesiology. Some students who are planning to go to medical school after college major in health science in college.
iso
@iso1048
Nov 05 2017 23:57
@chrisandsuch were you planning on doing med?