These are chat archives for FreeCodeCamp/Help

1st
Sep 2018
Aditya
@ezioda004
Sep 01 2018 00:03
@GitHub-Henry Its not suppose to show the html tags in the preview
Bjorn van de Peut
@bjorno43
Sep 01 2018 00:06
I'm gonna go off a while guys. Cya :wave:
Henry
@GitHub-Henry
Sep 01 2018 00:06
@ezioda004 somehow got off track somehow, thanks
Kyle Holm
@thekholm80
Sep 01 2018 00:07
@bjorno43 :wave:
Aditya
@ezioda004
Sep 01 2018 01:00
@thekholm80 x
Kyle Holm
@thekholm80
Sep 01 2018 01:08
lol
Niraj Nandish
@Nirajn2311
Sep 01 2018 03:17
@bjorno43 the spelling of similar is wrong when bobsbotty shows the help of challenges
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 01 2018 03:19
Hi is there any way to use grid in react?
const App = () => (
  <div id="drum-machine">
    <div id="pad-pane">
      <Pad />
    </div>
    <div id="controls-pane">
      <Power />
      <Display />
      <Volume />
      <KitToggle />
    </div>
  </div>
);
#drum-machine {
    background-color: #240b2d;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    grid-tempate-areas: 
        "left-pane right-pane";
    width: 100%;
}

#pad-pane {
    grid-area: left-pane;    
}

#controls-pane {
    grid-area: right-pane;
}
Kyle Holm
@thekholm80
Sep 01 2018 03:19
the same way you would use it without react
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 01 2018 03:20
It seems it is not working as expected
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 01 2018 03:40
oops should be template
Kyle Holm
@thekholm80
Sep 01 2018 03:43
bleh i'm too tired to math
psyperl
@psyperl
Sep 01 2018 04:04
i wonder if we can bake bread in the microwave
from the dough
gonna try to make radioactive pizza one day from scratch
Manish Giri
@Manish-Giri
Sep 01 2018 04:12
@psyperl you have a mac right?
psyperl
@psyperl
Sep 01 2018 04:12
i do yeah
Manish Giri
@Manish-Giri
Sep 01 2018 04:14
is there a dark theme for safari
i mean the non apple ones
coz there aren't any apple ones
psyperl
@psyperl
Sep 01 2018 04:15
wut? you meant gitter dark theme or?
Manish Giri
@Manish-Giri
Sep 01 2018 04:15
no a dark theme for safari itself
psyperl
@psyperl
Sep 01 2018 04:16
not that i know of
overall dark theme on the system will be available on Mojave though
Manish Giri
@Manish-Giri
Sep 01 2018 04:17
2011 macs not supported
:sob:
psyperl
@psyperl
Sep 01 2018 04:17
:(
Karma Drukpa
@coderkarma
Sep 01 2018 05:04
regular express section on fcc
It looks interesting
Dark theme for macOS @psyperl
Yashwardhan Pauranik
@yashwp
Sep 01 2018 05:59

I have a situation in my POST Request, it is throwing a error, which I don't know, what is it about?
Error -

SyntaxError: Unexpected token i in JSON at position 42
    at JSON.parse (<anonymous>)
    at parse (F:\Nodejs\rti-server\node_modules\body-parser\lib\types\json.js:89:19)
    at F:\Nodejs\rti-server\node_modules\body-parser\lib\read.js:121:18
    at invokeCallback (F:\Nodejs\rti-server\node_modules\raw-body\index.js:224:16)
    at done (F:\Nodejs\rti-server\node_modules\raw-body\index.js:213:7)
    at IncomingMessage.onEnd (F:\Nodejs\rti-server\node_modules\raw-body\index.js:273:7)
    at emitNone (events.js:106:13)

Here is my Nodejs Code

app.use(bodyParser.json({limit: '2mb', extended: true}));
app.use(bodyParser.urlencoded({limit: '2mb', extended: true}));

app.use((req,res,next) => {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
})

I'm sending data from frontend in as a obj { title: 'new title', images: [ {filename: 'sss', content: 'base64stringhere'}]}
Can anyone tell me whats wrong?

app.post('/event', async (req, res) => {
    console.log(req.body);
    res.send('200');
});
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:11
@coderkarma there's a regex section on fcc?
link me?
@diomed
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:24
@coderkarma thanks :thumbsup:
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:26
@Nirajn2311 Thanks, I've corrected it
Here in local news: First hyperloop pathways should be ready in 2021 followed by the rest of Europe within a few years :joy:
I'm pretty sure they're not gonna be able to dig the tunnels required so fast, lol
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:30
yay! only 50 more years till they get to Croatia
Karma Drukpa
@coderkarma
Sep 01 2018 07:31
@diomed welcome
Manish Giri
@Manish-Giri
Sep 01 2018 07:40
@diomed :cat:
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:45
Also in local news about that: Thanks to the vacuum, a hyperloop train is able to reach speeds above the speed of sound! - Erm, last time I checked, the speed of sound is zero within a vacuum :joy:
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:46
@Manish-Giri meow :Cat:
:cat:
Yashwardhan Pauranik
@yashwp
Sep 01 2018 07:46

I have a situation in my POST Request, it is throwing a error, which I don't know, what is it about?
Error -

SyntaxError: Unexpected token i in JSON at position 42
    at JSON.parse (<anonymous>)
    at parse (F:\Nodejs\rti-server\node_modules\body-parser\lib\types\json.js:89:19)
    at F:\Nodejs\rti-server\node_modules\body-parser\lib\read.js:121:18
    at invokeCallback (F:\Nodejs\rti-server\node_modules\raw-body\index.js:224:16)
    at done (F:\Nodejs\rti-server\node_modules\raw-body\index.js:213:7)
    at IncomingMessage.onEnd (F:\Nodejs\rti-server\node_modules\raw-body\index.js:273:7)
    at emitNone (events.js:106:13)

Here is my Nodejs Code

app.use(bodyParser.json({limit: '2mb', extended: true}));
app.use(bodyParser.urlencoded({limit: '2mb', extended: true}));

app.use((req,res,next) => {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
})

I'm sending data from frontend in as a obj { title: 'new title', images: [ {filename: 'sss', content: 'base64stringhere'}]}
Can anyone tell me whats wrong?

app.post('/event', async (req, res) => {
    console.log(req.body);
    res.send('200');
});
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:47
Quick! send your errors while @Manish-Giri is here to help
@bjorno43 so.. what's your point?
that statement is correct
@Manish-Giri Jack Ryan is out
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:49
@diomed Ghehe ok ok, you're right! :joy:
Yashwardhan Pauranik
@yashwp
Sep 01 2018 07:50
@bjorno43 can u help me out ?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:51
that statement is wet dream of every PR person
and of course facepalm of every scientist, but meh, they're in minority anyway
Manish Giri
@Manish-Giri
Sep 01 2018 07:52
@diomed x
I got notification about that from amazon prime..I wonder what all the hype is about :confused:
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:53
@yashwp That's not a valid JSON string:
Error: Parse error on line 1:
{ title: 'new title',
--^
Expecting 'STRING', '}', got 'undefined'
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:55
@Manish-Giri that tortoise be like
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:55
Though that might've simply been an example.. Anyway, the error is telling you it's not a valid JSON string. You'll have to give me the actual string if you want me to check it out
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:56
Travis - String
@bjorno43 have u seen that video
pretty good
IMHO
Bjorn van de Peut
@bjorno43
Sep 01 2018 07:57
Which one?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 07:58
Bjorn van de Peut
@bjorno43
Sep 01 2018 08:02
@diomed lol. The cook definitely won
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:02
monkey's got nothing on us
Jake
@neozane1
Sep 01 2018 08:08
hey can i get some help with my code for survey

<html>

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<head class = "flex-container" id = "header-container">
<h1 id ="title"> Survey Form </h1>
</head>
<div class = "container" id = "container">
<body>
<p id = "description">Please enter your information and answer the questions honestly</p>

<form id="survey-form">
<div class="rowTab">
<div class="labels">
<label id="name-label" for="name"> Name: </label>
</div>
<div class="rightTab">
<input autofocus type="text" name="name" id="name" class="input-field" placeholder="Enter your name" required>
</div>
</div>
<div class="rowTab">
<div class="labels">
<label id="email-label" for="email">
Email: </label>
</div>
<div class="rightTab">
<input type="email" name="email" id="email" class="input-field" required placeholder="Enter your Email">
</div>
</div>
<div class="rowTab">
<div class="labels">
<label id="number-label" for="age">* Age: </label>
</div>
<div class="rightTab">
<input type="number" name="age" id="number" min="1" max="125" class="input-field" placeholder="Age">
</div>
</div>

<div class="dropdown">
<h2> How man licks does it take to get to the end of a Lolly Pop?</h2>
<select id="dropdown">
<option value="fifty">50</option>
<option value="one_hundred">100</option>
<option value="infinity">Infinity</option>
<option value="no_clue">NO Clue</option>
</select>
</div>

<fieldset>
<div class = "right-tab">
<legend> If i would stream would you watch it? </legend>
<form>
<input type="radio" name="Yes" value="name" checked> Yes</input><br>
<input type="radio" name="No" value="name"> No</input><br>
<input type="radio" name="Maybe" value="name"> Maybe</input> <br></br>
</div>
</form>

<div class="rightTab">

<legend> Will you watch me game?<legend>
<ul style="list-style: none;">
<li class="radio" value = "name"><label>Definitely<input name="radio-buttons" value="1" type="radio" class="userRatings" ></label></li>
<li class="radio" value = "name"><label>Maybe<input name="radio-buttons" value="2" type="radio" class="userRatings" ></label></li>
<li class="radio" value = "name"><label>Not sure<input name="radio-buttons" value="3" type="radio" class="userRatings" ></label></li>
</ul>

<textarea name="textarea" style="width:250px;height:150px;" placeholder= "Any additional comments"></textarea>
<label>
<form id="submit">
<button id ="submit" type = "submit" value = "submit" > Submit </button>
<button id = "reset" type = "reset">Reset</button>
</form>
</div>
</body>
<footer>
<form id = "contact information">
</div>

  <legend> Contact me at jmason062083@gmail.com</legend>
</fieldset>
</html>

it says that my submit button it isnt showing and also my radio buttons arent working correctly

May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:16
@neozane1 we dont need your block of code here
we need link to it on codepen
Jake
@neozane1
Sep 01 2018 08:16
ok one sec
@Marmiz ok thank you much
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:18
@neozane1 form element is only one
u have multiple
Jake
@neozane1
Sep 01 2018 08:19
so if i just put it all under one form it should work>
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:20
yes
also, this is a mess:
<html>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  <head class = "flex-container" id = "header-container">
    <h1 id ="title"> Survey Form </h1>
</head>
  <div class = "container" id = "container">
      <body>
head and header are 2 different things
I think you meant to use header here
but there can't be header before <body> tag
Jake
@neozane1
Sep 01 2018 08:23
so if i move the body tag above header that should work then
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:23
also, cut this line: <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
from page and put it into Settings - stuff for head
@neozane1 i u move body above header that will be proper way to do things, yes
Jake
@neozane1
Sep 01 2018 08:25
it said to put it in my document to help tell me if i completed all the tasks
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:25
it will still be in your document, just on correct place
Jake
@neozane1
Sep 01 2018 08:26
where should i put it then
May Kittens Devour Your Soul
@diomed
Sep 01 2018 08:26
Settings - stuff for head
Bjorn van de Peut
@bjorno43
Sep 01 2018 08:45
@neozane1 Do you use a proper IDE, or at least a Syntax highlighter when you're coding?
Jake
@neozane1
Sep 01 2018 08:46
@bjorno43 what do you mean
Bjorn van de Peut
@bjorno43
Sep 01 2018 08:47
@neozane1 Do you use a program for coding that helps you with it? Like coloring your code and inform you about issues?
Jake
@neozane1
Sep 01 2018 08:48
yeah i use codepens analyse and also the one that came from free code camp
  1. Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute. Every radio-button group should have at least 2 radio buttons : expected 1 to be at least 2

  2. Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

it says im missing this
but im confused i thought i had it
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 01 2018 08:49
what are the common problems that css media breakpoints doesn't work?
Bjorn van de Peut
@bjorno43
Sep 01 2018 08:53
@neozane1 You should probably download a program like Atom. It'll help you develop your code more properly and tell you about most of the problems with it. The reason I'm telling you this is because there are so many errors and problems in your code, that I honestly don't even know where to begin on how to correct them :( Using an IDE should help you with that though
Jake
@neozane1
Sep 01 2018 08:54
@bjorno43 thanks that makes me feel so much better lol im just trying to learn ya know i know its bad
Bjorn van de Peut
@bjorno43
Sep 01 2018 08:55
@neozane1 I didn't mean to come across like an ass. If I did, then my apologies. I honestly ment to help you with that.
Jake
@neozane1
Sep 01 2018 08:57
@bjorno43 im learning peice by peice and im just trying to figure out why those two things werent working so that i can see what i did wrong and try to get better little by little
@bjorno43 i thought i had the raidio buttons and checkboxes i just dont know why im getting errors there
Bjorn van de Peut
@bjorno43
Sep 01 2018 09:00

@neozane1 Perhaps the first thing you should learn is proper code indentation. It works very easy and it'll help you a lot. Here's an example:

<html>
    <body>
        <div>
        </div>
    </body>
</html>

Do you see how I'm using a Tab character everytime I opened something but didn't close it yet? That's code indentation. It makes it easy for you see what's still open and where. Just by doing that, you can fix most of the errors in your code :)

Jake
@neozane1
Sep 01 2018 09:02
@bjorno43 i got what your saying i know your trying to help i do appreciate it its hard to learn like this but its all i can do right now ya know
Bjorn van de Peut
@bjorno43
Sep 01 2018 09:03
@neozane1 I know. No worries. I'll help you get through it step by step if you have the time for it. We'll get it working together, ok?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 09:04
step by step, day by day ... who's the boss
Jake
@neozane1
Sep 01 2018 09:04
https://codepen.io/neozane1/pen/vzORoX?editors=1100 @bjorno43 i did the auto indent on codepen does that look better
May Kittens Devour Your Soul
@diomed
Sep 01 2018 09:05
    < class="container" id="container">
what this tho?
Bjorn van de Peut
@bjorno43
Sep 01 2018 09:05
@neozane1 It does. But there are still errors in it. Do you want me to correct them?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 09:06
u have class and id, but of what element?
Jake
@neozane1
Sep 01 2018 09:06
div
i didnt realize it deleted
May Kittens Devour Your Soul
@diomed
Sep 01 2018 09:07
Half remembered names and faces, but to whom do they belong?
Jake
@neozane1
Sep 01 2018 09:09
@bjorno43 time for me to go to bed ill be on later today thank you for the help i really appreciated it
Bjorn van de Peut
@bjorno43
Sep 01 2018 09:11
@neozane1 It's ok. I'm busy correcting your code. I'll send it to you in IM when finished
Niraj Nandish
@Nirajn2311
Sep 01 2018 09:13
@bjorno43 and they said they would build a hyperloop in UAE
@neozane1 there are more spelling mistakes than mistakes in your code, no offense
May Kittens Devour Your Soul
@diomed
Sep 01 2018 09:54
there are no such things as splling mistakes
Niraj Nandish
@Nirajn2311
Sep 01 2018 09:55
@diomed I'm sorry to say but you have catlexia
view the above pen in full screen mode
I have 3 textareas but why are there space in between the textareas and iframe?
please help me
Momozor
@momozor
Sep 01 2018 11:52
urm
Ankit Behera
@ankit2670
Sep 01 2018 11:53
did you find out the problem?
Ene Catalin
@EneCatalin
Sep 01 2018 11:58
another cat, we need pest control
Ankit Behera
@ankit2670
Sep 01 2018 11:59
what?
Momozor
@momozor
Sep 01 2018 11:59
nu...... :'3
Ene Catalin
@EneCatalin
Sep 01 2018 11:59
aren't cats very territorial ?
maybe diomed will take care of it
there's quite a few cases of old cats never accepting a kitten even if months pass
diomed @diomed pets Cocoa Paw
May Kittens Devour Your Soul
@diomed
Sep 01 2018 12:41

Mikhele was author of several books
Aditya
@ezioda004
Sep 01 2018 12:42
No cat fight?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 12:45
no. thoz eyes are too mesmerizing
Xarri Jorge
@xarrijorge
Sep 01 2018 12:46
:wave: Whats up fellas?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 12:47
@xarrijorge oh hi. just reading about glass and thinking how I can convince Aditya to make me a css lattimo
Ene Catalin
@EneCatalin
Sep 01 2018 13:30
cat scared of kitten
May Kittens Devour Your Soul
@diomed
Sep 01 2018 13:33
nah. :cat: and kitten 4 friends
mew mew
Aditya Dehal
@aditya2000
Sep 01 2018 13:35
Hey everyone!
May Kittens Devour Your Soul
@diomed
Sep 01 2018 13:36
@ezioda004 who is this imposter?
Niraj Nandish
@Nirajn2311
Sep 01 2018 13:40
@ankit2670 could you explain your issue in more detail
Aditya
@ezioda004
Sep 01 2018 13:42
@diomed Get em kitty
May Kittens Devour Your Soul
@diomed
Sep 01 2018 13:44
nu. he seems dangerous
Aditya Dehal
@aditya2000
Sep 01 2018 13:46
WAR OF CATS ;D
Aditya
@ezioda004
Sep 01 2018 13:47
@diomed Heres a πŸ”ͺ
To sharpen your claws ofcourse
May Kittens Devour Your Soul
@diomed
Sep 01 2018 13:49
Aditya
@ezioda004
Sep 01 2018 13:56
:dog: πŸ”ͺ
Niraj Nandish
@Nirajn2311
Sep 01 2018 14:04
🐢πŸ”ͺ = πŸ‘‘πŸŒŽ
Kyle Holm
@thekholm80
Sep 01 2018 14:10
@ezioda004 is Array.includes() // O(n) and object[key] // O(1)?
Aditya
@ezioda004
Sep 01 2018 14:11
@thekholm80 Yeah, almost all array methods are O(n)
Kyle Holm
@thekholm80
Sep 01 2018 14:13
@ezioda004 thanks
Niraj Nandish
@Nirajn2311
Sep 01 2018 14:14
Date() will return the current date
So if I were to change it tomorrow date, how would I do it
Ene Catalin
@EneCatalin
Sep 01 2018 14:17
convert date into linux time, add seconds to make a new day, convert back with another function. That's the way I'd do it but I suck
Lance
@texas2010
Sep 01 2018 14:17
good morning.
Ene Catalin
@EneCatalin
Sep 01 2018 14:17
or, you know, this lol
morning
Kyle Holm
@thekholm80
Sep 01 2018 14:17
@texas2010 :wave:
Ene Catalin
@EneCatalin
Sep 01 2018 14:20
great bearded one, should someone who barely touches JS anymore learn react ? Is it easiesh to pick up ? I know you love that one
Kyle Holm
@thekholm80
Sep 01 2018 14:26
i think react is easy if you know JS
Lance
@texas2010
Sep 01 2018 14:26
i better be ready then go somewhere. lol
Ene Catalin
@EneCatalin
Sep 01 2018 14:28
let's assume you know JS is a programming language :D
Kyle Holm
@thekholm80
Sep 01 2018 14:29
at the most basic level you'd probably still be fine, once you got the hang of importing / exporting files, writing classes & functions
Ene Catalin
@EneCatalin
Sep 01 2018 14:30
you mean in basic JS ? That takes 5 mins of googling
Kyle Holm
@thekholm80
Sep 01 2018 14:30
yep
Aditya
@ezioda004
Sep 01 2018 14:30
I suppose some OOP knowledge would help
Ene Catalin
@EneCatalin
Sep 01 2018 14:30
but JS isn't OOP
so how does that help ?
Kyle Holm
@thekholm80
Sep 01 2018 14:30
it is though
Ene Catalin
@EneCatalin
Sep 01 2018 14:30
wouldn't that actually beep you over ?
Aditya
@ezioda004
Sep 01 2018 14:30
It is OOP, just not classical OOP
Kyle Holm
@thekholm80
Sep 01 2018 14:31
image.png
this is what i'm writing right now
OOP
Ene Catalin
@EneCatalin
Sep 01 2018 14:31
wait, I don't get it, are you forcing it to be OOP ?
Kyle Holm
@thekholm80
Sep 01 2018 14:31
no, it was introduced in es6 (iirc)
Niraj Nandish
@Nirajn2311
Sep 01 2018 14:31
A short intro of JS
@EneCatalin
Ene Catalin
@EneCatalin
Sep 01 2018 14:32
ima have to look over that
I mean you can never really escape JS
but later I've been stuck for 3 days on a thingy, finally making progress :D
Aditya
@ezioda004
Sep 01 2018 14:33
@EneCatalin There are two types of OOP, classical and prototypical, JS is latter one while Java is former one
Ene Catalin
@EneCatalin
Sep 01 2018 14:33
also nice code, very organized, opposite of what I tend to write
Kyle Holm
@thekholm80
Sep 01 2018 14:34
having tried to read some of my old code months later, i've realized the benefits of organized code
Aditya
@ezioda004
Sep 01 2018 14:36
@thekholm80 x
Ene Catalin
@EneCatalin
Sep 01 2018 14:36
oh I realize the benefits too, I just can't write it that way long term
Kyle Holm
@thekholm80
Sep 01 2018 14:36
haha yeah
Ene Catalin
@EneCatalin
Sep 01 2018 14:36
starts nice ends all over the place
Kyle Holm
@thekholm80
Sep 01 2018 14:36
you need discipline, grasshopper
Ene Catalin
@EneCatalin
Sep 01 2018 14:37
app started modular af, wrote everything as a separate module. Got stuck on something, had no idea how to write a module, code is a mess
Aditya
@ezioda004
Sep 01 2018 14:37
Almost all React code I've seen is pretty organized
Ene Catalin
@EneCatalin
Sep 01 2018 14:37
at least it's starting to sorta kinda work
Kyle Holm
@thekholm80
Sep 01 2018 14:37
i think react really encourages organization
Ene Catalin
@EneCatalin
Sep 01 2018 14:37
that speaks volumes about the framework tbh
Aditya
@ezioda004
Sep 01 2018 14:38
Yeah, individual components/classes in each file, I see some Java influence
Ene Catalin
@EneCatalin
Sep 01 2018 14:41
bestest language influence is always good. It's really hard to write bad java code but I can make it work :D
May Kittens Devour Your Soul
@diomed
Sep 01 2018 14:46
Screenshot_15.png
whaaat? since when is that?
also, when was :cat: ever being demanding. I mean...
come on. srsly
Ene Catalin
@EneCatalin
Sep 01 2018 14:49
someone actually told you that ?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 14:49
yup
YiMing18
@YiMing18
Sep 01 2018 15:57
hello everyone
Nazar
@IsaakNazar
Sep 01 2018 16:12
hey beautiful freecodecampers!
Aditya Dehal
@aditya2000
Sep 01 2018 16:15
Hey @IsaakNazar @YiMing18
Stephen James
@sjames1958gm
Sep 01 2018 16:41
@IsaakNazar :wave:
May Kittens Devour Your Soul
@diomed
Sep 01 2018 16:42
@IsaakNazar oh hey.
moves head to the right in slow motion, as his fur gently brushes in the wind
Kyle Holm
@thekholm80
Sep 01 2018 17:30
@diomed are you far from Sveti Martin?
Darren
@DarrenfJ
Sep 01 2018 17:49
happy Saturday fCC
@thekholm80 oh forgot to say thanks for the \blockbuster training link. MY communications and upsales skills have now gone through the roof...
Kyle Holm
@thekholm80
Sep 01 2018 17:53
@DarrenfJ lol i was really surprised when i realized i had watched the whole thing. i did resist watching part 2 though
Darren
@DarrenfJ
Sep 01 2018 17:53
never too old to learn how to sell video cassettes to the millenials..
just popped in the say hi.. gonna go listen to podcasts
DarrenfJ @DarrenfJ gets a coffee and settles in for a long listen
Xarri Jorge
@xarrijorge
Sep 01 2018 18:19
My ISP is taking their sweet time to renew my internet. I'm having to result to mobile data today.
:wave:
Niraj Nandish
@Nirajn2311
Sep 01 2018 18:37
@xarrijorge just wanted to cross check
proptypes is for checking if the right type of props is passed, right?
Also is it better if each component was in separate files or not?
Xarri Jorge
@xarrijorge
Sep 01 2018 18:44
Yep, and for on the fly validation as well. As for the second question, it is a common practice but I wouldn't say better. It just makes things look better and make importing a little more clean
@Nirajn2311
Niraj Nandish
@Nirajn2311
Sep 01 2018 18:50
const Description = props => {
    return (
        <div>
            <p>
                Hi {props.name}, this is a TODO app built with React.
                <br />
                Today Date: {Date()}
            </p>
        </div>
    );
};

class App extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <div>
                <div className="parent">
                    <h1>TODO App</h1>
                </div>
                <div className="description" name="Niraj">
                    <Description />
                </div>
            </div>
        );
    }
}

Description.propTypes = {
    name: PropTypes.string.isRequired
};

export default App;
@xarrijorge so in the above code I'm not sure if propTypes is working correctly or not, also the name is not appearing in the page
Kyle Holm
@thekholm80
Sep 01 2018 18:51
that's a giant wall of code
Niraj Nandish
@Nirajn2311
Sep 01 2018 18:55
@thekholm80 yeah i am not an expert in organizing code yet
Kyle Holm
@thekholm80
Sep 01 2018 18:56
my point was more "that's a lot to be pasting into the chat, i hope the mods don't get upset about spamming"
trying to look out for you
Niraj Nandish
@Nirajn2311
Sep 01 2018 18:58
@thekholm80 how's it now
Kyle Holm
@thekholm80
Sep 01 2018 18:58
you do you my man
Aditya
@ezioda004
Sep 01 2018 19:10
@bobsbotty challenge
Oh no
Kyle Holm
@thekholm80
Sep 01 2018 19:10
i killed it
with :fire:
Aditya
@ezioda004
Sep 01 2018 19:11
1 less PHP bot, humanity prevails
Kyle Holm
@thekholm80
Sep 01 2018 19:12
i've got a challenge for you
Aditya
@ezioda004
Sep 01 2018 19:13
What is it?
Kyle Holm
@thekholm80
Sep 01 2018 19:16
well, i started typing it all out but i'm questioning my math. i don't even know if i'm asking the right question yet
i need to translate x,y coordinates from one grid system to another
and it's math and i'm dumb at math
Aditya
@ezioda004
Sep 01 2018 19:17
Example? Math is not my strongest suit either
Kyle Holm
@thekholm80
Sep 01 2018 19:20
{ x: 50, y: 50 } should translate to { x: -8, y: -5 } and { x: 800, y: 600 } should translate to { x: 8, y: 5 } i think
<canvas> indexes 0, 0 at the top left of the element
i need to translate to roughly x,y centered with a different measurement system (not pixels)
oh, and the initial x,y will always be a multiple of 50
Aditya
@ezioda004
Sep 01 2018 19:24
:thought_balloon:
{ x: -8, y: -5 } this coordinates is from canvas?
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:24
$(document).ready(function() {
    setTimeout(function(){
  $('body').css("overflow","visible");
    },1200);
  });
is there something wrong with this jquery code?
Kyle Holm
@thekholm80
Sep 01 2018 19:25
@ezioda004 no, that's how many squares away from the player a tile is
Aditya
@ezioda004
Sep 01 2018 19:25
@ElectrocityGithub Seems fine
Kyle Holm
@thekholm80
Sep 01 2018 19:25
you can see my poor attempt here
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:27
interesting.. its not working with me
Kyle Holm
@thekholm80
Sep 01 2018 19:28
do you have jQuery loaded in your project?
does your console say $ is not defined
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:29
i've got this <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> and yes it does @thekholm80
Kyle Holm
@thekholm80
Sep 01 2018 19:29
where are you loading the cdn?
in <head>?
Aditya
@ezioda004
Sep 01 2018 19:30
@thekholm80 I'm clueless, I cant even check by cloning your repo right now cause I dont have laptop with me
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:31
@thekholm80 just above </body>
Kyle Holm
@thekholm80
Sep 01 2018 19:31
@ezioda004 no worries. worst-case i'll just build a look-up table like a noob and go on with my life
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:31
btw are you refering cdn as <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Aditya
@ezioda004
Sep 01 2018 19:32
@ElectrocityGithub Is your JS script tag below the jQuery one?
Kyle Holm
@thekholm80
Sep 01 2018 19:32
@ElectrocityGithub try moving it to the very end inside your <body> tag
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:33
@ezioda004 let me try that
@thekholm80 its in the end
@ezioda004 and @thekholm80 thanks for helping me out
my js script tag was above the jquery one
Kyle Holm
@thekholm80
Sep 01 2018 19:36
you just need
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- before your -->
<script>
  $(document).ready( ... )
</script>
it loads in order
top to bottom
ElectrocityGithub
@ElectrocityGithub
Sep 01 2018 19:37
i didn't know that this would affect javascript code
thank you
Aditya
@ezioda004
Sep 01 2018 19:37
<script async> </script> :trollface:
Muhammed Karim
@MuhammedKarim
Sep 01 2018 19:37
@bjorno43 So sorry I had to go! I'll check it now :smile:
Aditya
@ezioda004
Sep 01 2018 19:38
@MuhammedKarim You solved that one?
Muhammed Karim
@MuhammedKarim
Sep 01 2018 19:39
Gonna look into it now
first imma try and check out his code
Muhammed Karim
@MuhammedKarim
Sep 01 2018 19:51
@ezioda004 So here's the code he gave... which i would never have thought of myself tbh. amazing!
function centuryFromYear(year) {
    let result
    if (year<101) result = 1
    else {
        result = year.toString().substring(0, year.toString().length-2)
        const last = year.toString().substring(year.toString().length)
        if (parseInt(last)>0) result++
    }
    return parseInt(result)
}
@bjorno43 Thanks btw :smile:
where's that bot gone?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 19:54
@thekholm80 am quite far from Sveti Martin . why do you ask?
I see that that place is way up north, I'm closer to capital [Zagreb}
Muhammed Karim
@MuhammedKarim
Sep 01 2018 19:57
damn... the code's wrong somewhere
Aditya
@ezioda004
Sep 01 2018 20:05
@MuhammedKarim This would also work
function centuryFromYear(year) {
    return ~~(((year-1)/100)+1);
}
Muhammed Karim
@MuhammedKarim
Sep 01 2018 20:06
Woooww
that works fine!
Can u explain each part to me :worried:
Aditya
@ezioda004
Sep 01 2018 20:08
Basically dividing the year-1 by 100, adding 1 to it and rounding it up
year-1 because making sure that it returns 1 for year 100
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:08
@MuhammedKarim JS is like science. it can't be explained
Ene Catalin
@EneCatalin
Sep 01 2018 20:09
at least not by cat
Aditya
@ezioda004
Sep 01 2018 20:10
+1 because we always get -1 result. Example ~~(2012/100) // 20 it should be 21
~~ is just me being fancy, you can do Math.floor() instead
Muhammed Karim
@MuhammedKarim
Sep 01 2018 20:11
i needed explanation for the ~~ @diomed and btw hey, long time no see lol
@ezioda004 gtg out for a bit, will read up when i get back... if i get back within the next 2 days :cry:
life's so unpredictable
Aditya
@ezioda004
Sep 01 2018 20:12
:thumbsup:
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:13
Aditya is being wavy ~~
Aditya
@ezioda004
Sep 01 2018 20:13
:wavy_dash:
Lance
@texas2010
Sep 01 2018 20:22
eh.. i think it is not fun to do review js notes from someone. lol
Xarri Jorge
@xarrijorge
Sep 01 2018 20:23
Is it me or is codesandbox broken? https://codesandbox.io/s/qq1l20w2kq
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:23
DependencyNotFoundError
Xarri Jorge
@xarrijorge
Sep 01 2018 20:24
Yep, had to add a ./ to fix it
But in my local machine it works
Lance
@texas2010
Sep 01 2018 20:25
@diomed did you learn vuejs yet?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:26
no :-(
Lance
@texas2010
Sep 01 2018 20:26
@diomed oh why not?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:27
involved myself in some other things that I dedicated my time to
Lance
@texas2010
Sep 01 2018 20:27
ohh.
yeah, i dont have a time much for study. since i have a job. been busy.
Xarri Jorge
@xarrijorge
Sep 01 2018 20:28
@diomed What do you think of the base of my Pomodoro Clock?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:30
looks nice
am not a fan of tomato red
Lance
@texas2010
Sep 01 2018 20:32
@diomed so i have to find a way to make time for study again.
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:33
weekendS?
Lance
@texas2010
Sep 01 2018 20:34
depend on they give me a work schedule. i didnt tell them which day i want to take off. right now, just any.
Xarri Jorge
@xarrijorge
Sep 01 2018 20:35
What? Cats don't like tomatoes? @diomed
Lance
@texas2010
Sep 01 2018 20:36
maybe he dont eat tomatoes lol
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:36
I hate tomato red
Lance
@texas2010
Sep 01 2018 20:36
i love tomatoes
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:36
tomatoes are only good when fresh, rest is yuck
Lance
@texas2010
Sep 01 2018 20:36
haha
what about sauce? :P
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:37
nope
Lance
@texas2010
Sep 01 2018 20:37
for pasta
whatttt
Xarri Jorge
@xarrijorge
Sep 01 2018 20:37
hehe. Tomato red aside, what do you think of the interface? @diomed
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:37
no. also - ketchup - ugh.
Lance
@texas2010
Sep 01 2018 20:37
haha.
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:37
@xarrijorge pretty great. like the font
korzo
@korzo
Sep 01 2018 20:39
@xarrijorge You owe me a new pair of eyes :)
Also 8:8 time doesn't look right for me.
Otherwise good job.
Xarri Jorge
@xarrijorge
Sep 01 2018 20:41
Yeah, I'll have the zeros padded later. I'm working on adding the sound now.
And just send me the bill for them eyes, I have great insurance.
@korzo
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:41
u dont need the sound
sound is overrated
Xarri Jorge
@xarrijorge
Sep 01 2018 20:42
Or maybe a popup. Something to indicate a break
A beep will be great though. its great UX to have at least a beep draw the user's attention.
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:43
make it a fb notification beep :smiling_imp:
there is this one indie song that I bought and in background it has sound of fb notification, prolly someone left it there , intentionally, or not.
anyway, I'm like - wtf - every time
yj
@atangyj
Sep 01 2018 20:46
Does anyone know how to apply the certificate of javascript algorithm?
May Kittens Devour Your Soul
@diomed
Sep 01 2018 20:47
unsure what that even means
Xarri Jorge
@xarrijorge
Sep 01 2018 20:48
Just padded the zeros @korzo
Aditya
@ezioda004
Sep 01 2018 20:52
@atangyj If you completed the projects for algorithm certificate then it should be in your fcc profile.
korzo
@korzo
Sep 01 2018 20:55
@xarrijorge when time is less then 5 min and you click "-", clock stops but icon doesn't change to fa-play-circle
Kyle Holm
@thekholm80
Sep 01 2018 20:55
@diomed i was watching something that took place there, so i was curious
Lance
@texas2010
Sep 01 2018 21:18
peace out. have a nice day.
Xarri Jorge
@xarrijorge
Sep 01 2018 21:31
@thekholm80 :wave:
@korzo Okay, thanks. Lemme work on that.
I think the best move will be to disable the counter buttons till the user pauses the current timer. What do you think @korzo
Kyle Holm
@thekholm80
Sep 01 2018 21:34
@xarrijorge hey
Xarri Jorge
@xarrijorge
Sep 01 2018 21:35
Hey did everyone hear about the FCC Hackathon?
JamStack Hackathon to be exact
Xarri Jorge
@xarrijorge
Sep 01 2018 21:42
@korzo I added an alert to tell the user we can't decrease below the current time;
korzo
@korzo
Sep 01 2018 21:42
@xarrijorge I think set state.active to false always
  decTimer = () => {
    clearInterval(this.state.intervalID);
    let newState = { active: false};

    if(this.state.time > 300) {
      newState.time = this.state.time - 60;
    }

    this.setState(newState);
  };
Xarri Jorge
@xarrijorge
Sep 01 2018 21:43
Yeah, I fixed it already and added and alert for info. Thanks for the pointers @korzo
alpox
@alpox
Sep 01 2018 22:51
@GitHub-Henry Hmm somehow I don't see proper markdown styling. My output looks like normal text - no bullet points work, no headlines etc.
The tests are looking for the existence of marked in your code but that library is on your page hidden in a webpack module (encapsulated) Most tests would probably pass if you make it a globally available module (attached to window - window.marked)
Henry
@GitHub-Henry
Sep 01 2018 22:52
is that true when you inspect the html elements
alpox
@alpox
Sep 01 2018 22:53
@GitHub-Henry No matter what I see when I inspect the elements (they do show right) but the styling on your page doesn't look right
The preview
Henry
@GitHub-Henry
Sep 01 2018 22:53
but the elements are correct
alpox
@alpox
Sep 01 2018 22:54
As far as I can tell yes
Henry
@GitHub-Henry
Sep 01 2018 22:54
so the requirement was to generate correct elements
alpox
@alpox
Sep 01 2018 22:54
Id say you'd still need a correctly working page which shows them right too :D
Henry
@GitHub-Henry
Sep 01 2018 22:55
that's just styling
i styled the dots out of the list items
styling wasn't a requirement
generating correct elements was the requirement
styling aside, i think the requirements were met
alpox
@alpox
Sep 01 2018 22:58
@GitHub-Henry I think they are
Henry
@GitHub-Henry
Sep 01 2018 22:59
thanks, i wanted another set of eyes in case i was missing something. drums are next.
alpox
@alpox
Sep 01 2018 23:00
For the test cases, as I said, you can make marked global
Henry
@GitHub-Henry
Sep 01 2018 23:00
does that make the tests pass
i thought global was a no no
alpox
@alpox
Sep 01 2018 23:01
I was just pointing out styling because for real world projects you cannot just meet requirements (you get the requirement to make a list of to-dos but if they are not presented well enough they will come after you)
Henry
@GitHub-Henry
Sep 01 2018 23:02
i choose that styling. i can change if needed, but i'd rather spend the time doing the next project
alpox
@alpox
Sep 01 2018 23:02
Global is a no for usual (although in this case it doesn't hurt much) and the tests are not perfect. I think they cannot track the library marked when its not global. They expect people to use plain html/css/js when at the point of creating the markdown previewer (I think?) where they would add marked through a cdn which adds it as global object
Henry
@GitHub-Henry
Sep 01 2018 23:03
the previewer was supposed to be a react project
i think
so i imported marked, and as in import it is not global
alpox
@alpox
Sep 01 2018 23:04
Ah okay hmm you're right... then it is a bit weird that they don't find it
@GitHub-Henry Seems others had the same problem and indeed they had to add it as global
Henry
@GitHub-Henry
Sep 01 2018 23:09
appreciate the tip