5th
Mar 2018
Claudio Restifo
@Marmiz
Mar 05 2018 03:01 UTC
:wave: @Manish-Giri , have you solved the 123 java problem?
mstellaluna
@mstellaluna
Mar 05 2018 04:59 UTC
Hello. Please be aware FreeCodeCamp.org is experiencing intermittent connectivity issues. This is due to issues at Digital Ocean. We are currently aware of the issue and actively monitoring it. Thanks ! Happy Coding !
Greg Gordon
Mar 05 2018 06:24 UTC
https://s.codepen.io/papageg/debug/yvGYQM/GnrnbVRPKRar#aboutpage why when you click on the about tab on nav bar does it take the about and hide it behind nav bar but not when you have the page loaded up.
@Frediflexta
Mar 05 2018 06:38 UTC
Hi guys, good mornig, from over here. please i need some help figuring out a logic
i am trying to writing a sorting algorithm that sorts odd numbers before even numbers and then checks if isNaN(and if it is, it should discard it from the array)
Claudio Restifo
@Marmiz
Mar 05 2018 07:00 UTC
@Frediflexta you can do it either combining two methods: sort and then filter or in one go using a reducer function
@Frediflexta
Mar 05 2018 07:05 UTC
Okay... would look it up
@Frediflexta
Mar 05 2018 09:28 UTC
Hi guys...
so i tried implementing the sort, using an insertion sort alogorithm
it works alright, but i want to include some special cases where it checks and sorts odd numbers before even numbers and then checks if isNaN(and if it is, it should discard it from the array)
Any ideas pleaase?
Alsalman78
@Alsalman78
Mar 05 2018 12:44 UTC
hi
Stephen James
@sjames1958gm
Mar 05 2018 13:02 UTC
@Alsalman78 :wave:
Daniel
@dkapexhiu
Mar 05 2018 14:47 UTC
the code for adding reviews is on line 100
Stephen James
@sjames1958gm
Mar 05 2018 15:03 UTC
@dkapexhiu try passing value into the function - maybe self.restaurant.operating_hours isn't set?
Daniel
@dkapexhiu
Mar 05 2018 15:06 UTC
that is set into a json file.. i want to add new reviews on clicking the button and compiling the form..
Stephen James
@sjames1958gm
Mar 05 2018 15:09 UTC
@dkapexhiu The only thing I saw was the value not being set - I would add console.log statements to determine if that value is not set.
@dkapexhiu Since you have the value, seems more explicit to pass it in.
Daniel
@dkapexhiu
Mar 05 2018 15:17 UTC
yes, ok but when i add a review and click ok it refreshes the page.. how can i prevent this?
Kaz Baig
@kbaig
Mar 05 2018 15:41 UTC
:wave: long time
Stephen James
@sjames1958gm
Mar 05 2018 15:45 UTC
@dkapexhiu Make sure that if you have a form that you prevent the default action of refresh
Kaushik
@kilobytecosec
Mar 05 2018 15:45 UTC
Hi guys ! I have a question on docker, anybody can help ?
knight2
@knight2
Mar 05 2018 15:45 UTC
just posted this in frontend but asking for help here too
Does anyone know how to make css keyframe animation's to work with react rendering components?
I tried using ReactCSSTransitionGroup from react but it doesn't appear to be working anymore
Then I tried just using regular keyframes for animation, it only works on my first load, and not for subsequent changes of the react components

0%   { opacity: 0; }
100% { opacity: 1; }
}
0%   { opacity: 0; }
100% { opacity: 1; }
}
0%   { opacity: 0; }
100% { opacity: 1; }
}
0%   { opacity: 0; }
100% { opacity: 1; }
}

opacity: 0;
animation-duration: 2s;
animation-fill-mode: forwards;
}
Stephen James
@sjames1958gm
Mar 05 2018 15:45 UTC
knight2
@knight2
Mar 05 2018 15:46 UTC
and for react render in js i have

render(){
return(

<div id="quote-box" className="container-fluid row">

<p>{this.state.quote}</p>
</div>

<p>{this.state.author}</p>
</div>

<div className="buttons">
<button className="button" onClick={this.getQuote} id="new-quote">New Quote!</button> <br />

<a className="button" title="Tweet!" className="fa fa-twitter fa-lg" href="#" onClick={this.tweetQuote} id="tweet-quote"></a>
</div>
</div>
);
};
};
On first load, the webpage properly uses the keyframe animation, however if the user clicks the get new quote button, which changes the state of the component, and loads new text, the new text does NOT play the animation. I am not sure why this is the case?
What do I need to do to ensure all changes to the state of the component that are specified to play the animation on render?
Darren
@DarrenfJ
Mar 05 2018 16:13 UTC
morning fCC
Kyle Holm
@thekholm80
Mar 05 2018 16:18 UTC
@DarrenfJ :wave:
Darren
@DarrenfJ
Mar 05 2018 16:19 UTC
@thekholm80 hye buddy.. haven't caught you on here in a bit..
Kyle Holm
@thekholm80
Mar 05 2018 16:20 UTC
nothing really exciting, been sick :(
how's life for you?
Sweet Coding :)
@SweetCodingInc
Mar 05 2018 16:33 UTC
@thekholm80 Ser Kyle :wave:
@DarrenfJ Ser Darren :wave:
Kyle Holm
@thekholm80
Mar 05 2018 16:36 UTC
@SweetCodingInc hiya
Sweet Coding :)
@SweetCodingInc
Mar 05 2018 16:38 UTC
@thekholm80 New developments.. I made it to the final rounds of the interview...
Wednesday is the D-Day - whether I am to invade Germany or not lol :P
Darren
@DarrenfJ
Mar 05 2018 16:38 UTC
@SweetCodingInc congrats!
Kyle Holm
@thekholm80
Mar 05 2018 16:38 UTC
@SweetCodingInc very cool, hope it works out for you
Sweet Coding :)
@SweetCodingInc
Mar 05 2018 16:38 UTC
Yo!
Darren
@DarrenfJ
Mar 05 2018 16:39 UTC
@thekholm80 I've been focusing on the CSS but lately been watching security vids... gonna hafta figure out blockchain eventually... relearning crypotography.. that kind of thing
and just for shits and giggles decided to reedo the python course on codecademy since they revamped it a while back and i've done no python since then
Kyle Holm
@thekholm80
Mar 05 2018 16:40 UTC
sounds like a lot to digest
Darren
@DarrenfJ
Mar 05 2018 16:40 UTC
so much for focusssing on CSS ;)
too many things to learn!!
Mar 05 2018 17:11 UTC
@DarrenfJ - hey there - you are correct about too many things to learn!!! - I spent a couple hours reading interesting articles about functional programming - one article and a second article - still reading, but it's interesting stuff!
hi @thekholm80 @SweetCodingInc and everyone else out there...
Kyle Holm
@thekholm80
Mar 05 2018 17:12 UTC
Darren
@DarrenfJ
Mar 05 2018 17:17 UTC
CamperBot
@camperbot
Mar 05 2018 17:17 UTC
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Mar 05 2018 17:19 UTC
@DarrenfJ - yeah, just more stuff to learn, but people ask about functional programming now and then - just trying to get a little better handle on it because I keep dabbling in the learning / articles about it. That opensource.com article seemed to be rather interesting!
Darren
@DarrenfJ
Mar 05 2018 17:24 UTC
it's one of my next things.. was actually debating python vs deep diving into functional js
Kyle Holm
@thekholm80
Mar 05 2018 17:24 UTC
por que no los dos?
Darren
@DarrenfJ
Mar 05 2018 17:25 UTC
side note: really loving the scrimba vids.. the tool is pretty fun to use.. watch a vid, then code in the vid!!!
plus CS variables are pretty cool
@thekholm80 welp, i'm redelving into sql, deep diving into CSS, reviewing python and watching treehouse vids on security..
4 things is pretty good ;)
Kyle Holm
@thekholm80
Mar 05 2018 17:26 UTC
:)
Darren
@DarrenfJ
Mar 05 2018 17:27 UTC
5, even though wafer thin.. is just too much :P
scrimbas got one on grid, and flexbox too i wanna check out.. but i love the tool.. something new and shiney.. check it out
Mukesh Kumar Angrish
@MukeshAngrish
Mar 05 2018 17:47 UTC
Hey everyone, the ingredients in my Recipe Box app are not showing (or rendering, maybe). Can someone look into it and help me.😁
Christopher McCormack
@cmccormack
Mar 05 2018 18:06 UTC
@MukeshAngrish your ingredients variable is all undefined
Add this to your Recipe render - console.log(ingredients)
@MukeshAngrish either add a return in your map or change the curly braces to parenthesis
artbohr
@artbohr
Mar 05 2018 18:49 UTC
why after setting the new state through (this.setState) my component is not rerendering?

import React from 'react';
import {Pie} from 'react-chartjs-2';

class ShowForm extends React.Component {
constructor (props) {
super(props)
this.state = {
votingOption: 0,
};
}
submitVote = (e) => {
e.preventDefault();

const url = ${this.props.url}${this.props.pollId};

fetch(url, {
method: 'POST',
body: JSON.stringify({'voteOn' : this.state.votingOption }),
'Content-Type': 'application/json'
})
.catch(error => console.error('Error:', error));
}

deletePoll = (e) => {
e.preventDefault();

const url = ${this.props.url}${this.props.pollId};

fetch(url, {
method: 'DELETE',
body: JSON.stringify({}),
'Content-Type': 'application/json'
})
.catch(error => console.error('Error:', error));
}

e.preventDefault();

const url = ${this.props.url}${this.props.pollId};
const optionsArr = JSON.parse(JSON.stringify(this.props.pollOptions));

fetch(url, {
method: 'PUT',
body: JSON.stringify({"options" : optionsArr}),
'Content-Type': 'application/json'
})
.catch(error => console.error('Error:', error));
}

render() {
const colors = ['#FF6384', '#36A2EB', '#FFCE56', '#F19CBB', '#D1001C', '#7F3E98', '#4682BF', '#D2691E']

const data = {
labels: this.props.pollOptions.map(d => d),
datasets: [
{
backgroundColor: colors,
hoverBackgroundColor: colors
}
]
};

return (<div className="panel panel-default">
{this.props.pollName}
<button type="button" className="close" onClick={this.deletePoll}>
<span aria-hidden="true">Delete</span>
</button>
</div>
<div className="panel-body">
<form>
<div className="row form-group">
<div className="col-sm-5">
<label>Select Option</label>
<select className="form-control" onChange={e => this.setState({ votingOption: e.target.value })}>
{this.props.pollOptions.map((option, i) => <option key={option} value={i}>{option}</option>)}
</select>
<br/>
<button onClick={this.submitVote} className='btn btn-block btn-primary center-block'>Vote</button>

<div style={{display:'flex'}}>
<input style={{marginTop:'15px'}} onChange={e => this.setState({ addOptions: e.target.value })} placeholder='Add another option' className='form-control'/> <br />
</div>

</div>
<div className="col-sm-5">
<Pie data={data} width={20} height={5} /*options={{maintainAspectRatio: false}}*//>
</div>
</div>
</form>
</div>
</div>)
}
}

export default ShowForm;
all works as intended, but rerenderes does not happen in any case
Mar 05 2018 19:22 UTC
hi guys i deleted my account and created a new one and linked to my github but all the lessons they are not marked as complete but the code is complete anyone ?
__mifflin__
@cdrainxv
Mar 05 2018 19:35 UTC
@ezioda004
Mar 05 2018 19:36 UTC
@Koko7798 Hey, if you made a new account then the account progress starts from the beginning
Mar 05 2018 19:36 UTC
@ezioda004 it didnt for me bro
@ezioda004 only the completed green circle is off
but the lessons that i completed before are already finished like i just need to press completed
@ezioda004
Mar 05 2018 19:37 UTC
@Koko7798 Thats because the solution is also stored locally, so you should clear your browser cache if you want to delete them locally
Mukesh Kumar Angrish
@MukeshAngrish
Mar 05 2018 19:45 UTC
@cmccormack I added a return, but it still doesn't render the ingredients
Christopher McCormack
@cmccormack
Mar 05 2018 20:04 UTC
It does @MukeshAngrish but you have them in a collapse that's hiding it
Mar 05 2018 20:20 UTC
@MukeshAngrish - another thing that might be a problem (at least it's illegal HTML) is that you appear to be using the same ID value for multiple elements in the ingredients. It might cause a problem somewhere if you are using the ID for some DOM accesses...
Daniel
@dkapexhiu
Mar 05 2018 20:20 UTC
Hello! this codepen is not working for saving new pushing new objects into reviews array:
https://codepen.io/dkapexhiu/pen/paXgyB
Mar 05 2018 20:24 UTC
@dkapexhiu - you have some variable nreviews that doesn't seem to be defined - and it is used in a few places?
Mar 05 2018 20:29 UTC
@dkapexhiu - if you define a variable var nreviews = []; it starts to work - it will at least display the labels with names values of "undefined"... but it adds a new entry after Add button.
Daniel
@dkapexhiu
Mar 05 2018 20:30 UTC
ok thank you @khaduch for pointing it out .. exactly it add a new entry but all undefined
CamperBot
@camperbot
Mar 05 2018 20:30 UTC
dkapexhiu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Daniel
@dkapexhiu
Mar 05 2018 20:30 UTC
what it might be?
Mar 05 2018 20:33 UTC
@dkapexhiu - looking at it a little more.
Mar 05 2018 20:39 UTC
@dkapexhiu - it looks like the way you are trying to use this in your function describe is not working. I think that if you pass the review that you are processing into the function, and use that parameter to access the various review properties, you can get the data. The data seems to be getting stored into the nreviews array, just not being pulled out.
Daniel
@dkapexhiu
Mar 05 2018 20:42 UTC
so, how can that be done in code? what can i do?
Mar 05 2018 20:51 UTC

@dkapexhiu - the basic idea would be in the place where you are trying to display the data, within the showData() function - do something like this:

function showData() {
debugger;
var tmp = "<ul>";
nreviews.forEach(function(review) {
tmp += "<li>" + reviews.describe(review) + "</li>";
});
_("reviews").innerHTML = tmp + "</ul>";
}

Just passing the current review variable to your describe method. And change the describe method to look like this:

  describe: function(rev) {
var description =
"Name:" +
rev.name +
"<br>" +
"Date:" +
rev.date +
"<br>" +
"Comment:" +
rev.comment;
return description;
}

using a function argument rev (or a name of your choice) and then using that to access the variable properties of your description. It's really rough-looking, some output styling should be done, but it gets the information onto the screen...

Zentriks
@Zentriks
Mar 05 2018 21:18 UTC
Good Evening
I am making Movie Search Website that recommends you what Movie to watch. My question is do i need strong javascript and php to make it work good?
It's like movie search engine
Daniel
@dkapexhiu
Mar 05 2018 21:23 UTC
thank you very much @khaduch very good explanation of it
CamperBot
@camperbot
Mar 05 2018 21:23 UTC
dkapexhiu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
api offline
Daniel
@dkapexhiu
Mar 05 2018 21:27 UTC
where did you learn that? giving a parameter to describe function?
Stephen James
@sjames1958gm
Mar 05 2018 21:40 UTC
@Zentriks to make it active and modern you will need strong
JavaScript
Kyle Holm
@thekholm80
Mar 05 2018 21:40 UTC
lol
Stephen James
@sjames1958gm
Mar 05 2018 21:41 UTC