These are chat archives for FreeCodeCamp/Help

15th
Feb 2018
Eric Miller
@ericmiller777
Feb 15 2018 01:16
afk, but feelf ree to leave feedback on my markdown previewer https://ericmiller777.github.io/Markdown_Previewer_freeCodeCamp/
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:18
Heyo
Anyone alive in here?
Kyle Holm
@thekholm80
Feb 15 2018 01:19
@ericmiller777 good job, nice and clean
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:19
Apparently yes
Kyle Holm
@thekholm80
Feb 15 2018 01:19
@ericmiller777 i keep hoping i'll see one of those where someone didn't use dangerouslySetInnerHTML, i couldn't figure out how to do it without it
@GreyGoldFish yes
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:20
What's that?
Kyle Holm
@thekholm80
Feb 15 2018 01:20
what's what?
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:20
"dangerouslySetInnerHTML"
Kyle Holm
@thekholm80
Feb 15 2018 01:20
a method in React
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:21
Ah, I see. I haven't gotten there yet with my learning.
Kyle Holm
@thekholm80
Feb 15 2018 01:21
keep at it :)
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:21
Thanks :)
I came here wondering if there's a way to fast-forward your progress on freeCodeCamp
Because the beginning tutorials are boring me out of my mind
I've already learned HTML and CSS, and just finished learning about methods for JavaScript, so I'm kinda bummed :/
Kyle Holm
@thekholm80
Feb 15 2018 01:23
i don't think there are any shortcuts to learning, but you can click on the Map at the top of your page and only have to complete those lessons marked with a * to earn the certificate
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:23
Oh my God...
I'm retarded!
I hadn't even seen that option hahaha
I got so far in I might as well finish it
But damn, there's a lot of content
Gersho
@Gersho
Feb 15 2018 01:24
that's lessons in small bites
Kyle Holm
@thekholm80
Feb 15 2018 01:24
you should check out beta.freecodecamp.org
Gersho
@Gersho
Feb 15 2018 01:25
it helps when you want to find again a lesson ^
Kyle Holm
@thekholm80
Feb 15 2018 01:25
that will be replacing the current curriculum soon
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:25
Thanks @thekholm80 !
CamperBot
@camperbot
Feb 15 2018 01:25
greygoldfish sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1693 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
Feb 15 2018 01:25
:+1:
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:26
Thanks @Gersho :)
CamperBot
@camperbot
Feb 15 2018 01:26
greygoldfish sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 596 | @gersho |http://www.freecodecamp.org/gersho
Gersho
@Gersho
Feb 15 2018 01:26
@ericmiller777 Hey ! been ages ! markdown seems to work fine, input is sanitized, feels a bit empty knowing how you're so big on design usually ;)
Kyle Holm
@thekholm80
Feb 15 2018 01:26
i like clean and simple
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:26
So, should I actually just use beta.freecodecamp.org from now on?
Gersho
@Gersho
Feb 15 2018 01:27
me too, but it feels almost too much
@GreyGoldFish who cares as long as you learn stuff ?
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:27
Fair enough.
Manish Giri
@Manish-Giri
Feb 15 2018 01:27
beta is very buggy
Kyle Holm
@thekholm80
Feb 15 2018 01:27
someday i'm going to try this
Manish Giri
@Manish-Giri
Feb 15 2018 01:27
might wanna stay off until it's ready
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:28
@thekholm80 My eyes!!
Gersho
@Gersho
Feb 15 2018 01:28
@thekholm80 for your project name i suggest myspacify
Kyle Holm
@thekholm80
Feb 15 2018 01:28
lol
i miss geocities
Gersho
@Gersho
Feb 15 2018 01:28
or AskKyle (he's a friend of jeeves)
Kyle Holm
@thekholm80
Feb 15 2018 01:28
brb downloading netscape
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:28
I feel like I'm too young to know what that is
Gersho
@Gersho
Feb 15 2018 01:28
well there's some mirror iirc
google before google was a thing
altavista too ! a billion result, none relevant
Kyle Holm
@thekholm80
Feb 15 2018 01:29
lol
Gersho
@Gersho
Feb 15 2018 01:29
yahoo search, found 3 results
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:29
I want to start the 100 days of code challenge, but I'm putting it off until I have meaningful code to write
Kyle Holm
@thekholm80
Feb 15 2018 01:29
i don't think it matters what code you write, it's more important to just write code
it's the act of doing, not the code, that's important
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:30
I get that, it's just that I want to use the challenge to motivate me to do projects specifically
Gersho
@Gersho
Feb 15 2018 01:30
or just find something you want to have for yourself, like a tool for whatever video game you like or something
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:30
Since I'm already motivated enough to code everyday
Well I do have a personal project that I have no clue how to implement
Gersho
@Gersho
Feb 15 2018 01:31
then start by that, and start learning whatever language is involved
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:31
I wanna make a web-scraper
Kyle Holm
@thekholm80
Feb 15 2018 01:31
python is awesome for web scrapers
Gersho
@Gersho
Feb 15 2018 01:31
curl ?
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:31
I know Python
It's just that right now I'm focused on learning front-end development
Kyle Holm
@thekholm80
Feb 15 2018 01:32
well hurry up i hate front end and my server is nearly done
Gersho
@Gersho
Feb 15 2018 01:32
for http python there's this https://github.com/requests/requests
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:33
Ahahaha
What's that @Gersho?
Gersho
@Gersho
Feb 15 2018 01:33
i still haven't finished my portfolio
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:33
Basically my whole family does front end
And since I'm the only one who actually studies CS at university, I figured it was about time I started learning how to do it
Gersho
@Gersho
Feb 15 2018 01:35
requests is a python library that does a lot of stuff for you
GreyGoldFish
@GreyGoldFish
Feb 15 2018 01:35
Interesting
I was looking around trying to see how I could go about making my web-scraper, affectionately named "Crowley" and I found Beautiful Soup
Anyone familiar?
Eric Miller
@ericmiller777
Feb 15 2018 01:57
@thekholm80 yea, i tryed to avoid it, but if it was possible it seemed like it would be very hard, or you'd need to create your own markdown translation function @Gersho yea, but at the same time, markdown is kinda boring anyway :/
Kyle Holm
@thekholm80
Feb 15 2018 01:58
@ericmiller777 please don't think i'm knocking on you for using that, like i said I've never seen one where it wasn't used
someday, maybe, i'll see one. it'll be like seeing a unicorn
Eric Miller
@ericmiller777
Feb 15 2018 01:59
@thekholm80 I understand :)
Gersho
@Gersho
Feb 15 2018 02:02
since it's sanitized can bad things still happen ?
Eric Miller
@ericmiller777
Feb 15 2018 02:02
I think xss?
maybe since it gh pages they might have some other protection?
@Gersho you ever use Chingu Cohorts?
Kyle Holm
@thekholm80
Feb 15 2018 02:05
i think that's the fear, but you're not using dbs or anything so there's no real risk from xss
Gersho
@Gersho
Feb 15 2018 02:05
never heard of it
Eric Miller
@ericmiller777
Feb 15 2018 02:05
you might be too late for the months but
seems interesting, I get a team tommorow
Gersho
@Gersho
Feb 15 2018 02:06
that doesn't really sound like my type of thing
Eric Miller
@ericmiller777
Feb 15 2018 02:08
@Gersho understood, ive just never worked with other people before, ive always wanted to contribute to open source, but ive never been able to find somthing i could contribute too (except documentation)
Gersho
@Gersho
Feb 15 2018 02:09
haven't really done any yet either, but cs50 has you work from a bunch of prewritten files so you learn how to read other people code
Eric Miller
@ericmiller777
Feb 15 2018 02:10
@Gersho ah cool, i might do that.... eventually
there's a but of search link to look for easy stuff to do (building req files and stuff like that)
or check my repos, surely there's some crap to fix xD
like a lot
Eric Miller
@ericmiller777
Feb 15 2018 02:34
@Gersho @thekholm80 thank you
CamperBot
@camperbot
Feb 15 2018 02:34
ericmiller777 sends brownie points to @gersho and @thekholm80 :sparkles: :thumbsup: :sparkles:
:cookie: 598 | @gersho |http://www.freecodecamp.org/gersho
:star2: 1694 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
Feb 15 2018 04:13
i'm confused
const myArr = [1, 1];

const isItOne = myArr.reduce((a, b) => {
  if (b === 2){
    return false;
  }
}, true);

console.log(isItOne);  // undefined
Tom
@moT01
Feb 15 2018 04:18
add else return true
Gersho
@Gersho
Feb 15 2018 04:18
if b != 2 what would the callback return ?
Kyle Holm
@thekholm80
Feb 15 2018 04:18
in that case i wouldn't want it to change the initial value
Gersho
@Gersho
Feb 15 2018 04:18
else continue ?
don't know if continue works in a reduce tho
Tom
@moT01
Feb 15 2018 04:19
but i dont think the value just doesnt change by default - something needs to be returned
Claudio Restifo
@Marmiz
Feb 15 2018 04:19
@thekholm80 i think you are not returning anything
Tom
@moT01
Feb 15 2018 04:19
on each iteration
Kyle Holm
@thekholm80
Feb 15 2018 04:19
oh, right i can just return a otherwise
Gersho
@Gersho
Feb 15 2018 04:20
initial value only stays that way for first iteration(as a), then reduce's return becomes the new a
Claudio Restifo
@Marmiz
Feb 15 2018 04:20
@thekholm80 or true
Kyle Holm
@thekholm80
Feb 15 2018 04:20
i can return true, but it wouldn't work for what i'm trying to do
i think Array.some() will work better for what i'm doing anyway. less hacky
Claudio Restifo
@Marmiz
Feb 15 2018 04:22

@thekholm80 but I don't get the logic.
What do you want to achieve? You are not "accumulating" anything...
so for instance [1,1,2,1] will return true since the last value is not 2.

Is it an intended behaviour?

Kyle Holm
@thekholm80
Feb 15 2018 04:23
this is the actual code i was trying:
addUser = checkBar.attending.reduce((a, b) => {
  if (b.display_name === display_name) {
    return false;
  }
}, true);

changing it to

addUser = checkBar.attending.reduce((a, b) => {
  if (b.display_name === display_name) {
    return false;
  }

  return a;
}, true);

worked

basically i'm checking a field in my database that contains an array of user names, i want to know if a user name is present
if it is, i won't add it. if it's not present, i will add it
Claudio Restifo
@Marmiz
Feb 15 2018 04:25
@thekholm80 indexOf or filter are probably better :)
Gersho
@Gersho
Feb 15 2018 04:25
if it's a database can't you query it ?
Claudio Restifo
@Marmiz
Feb 15 2018 04:25
i'd go with indexof
Kyle Holm
@thekholm80
Feb 15 2018 04:25
doh, forgot about that
Gersho
@Gersho
Feb 15 2018 04:25
indexOf ^ :thumbsup:
Claudio Restifo
@Marmiz
Feb 15 2018 04:26
arr.indexOf(var) === - 1 ? add : don't add
in case you want to do a don't add operation
Gersho
@Gersho
Feb 15 2018 04:27
but an array of username ? that doesn't sound like it would scale up nice
Kyle Holm
@thekholm80
Feb 15 2018 04:27
addUser = checkBar.attending.indexOf(display_name) === -1; is what i did
but it's not working right sigh
Claudio Restifo
@Marmiz
Feb 15 2018 04:28
@thekholm80 but being a db, why not a simple find? :)
Kyle Holm
@thekholm80
Feb 15 2018 04:28
i can't find a way to query in an array in mongo
oh mother F i just found it lol
$elemMatch i think it's time to call it a night
Claudio Restifo
@Marmiz
Feb 15 2018 04:29
Kyle Holm
@thekholm80
Feb 15 2018 04:32
@Marmiz @Gersho thanks
CamperBot
@camperbot
Feb 15 2018 04:32
thekholm80 sends brownie points to @marmiz and @gersho :sparkles: :thumbsup: :sparkles:
:star2: 1164 | @marmiz |http://www.freecodecamp.org/marmiz
:cookie: 599 | @gersho |http://www.freecodecamp.org/gersho
Kyle Holm
@thekholm80
Feb 15 2018 04:33
const checkBar = await Bars.findOne({ "bar_id": bar_id, "attending": { $elemMatch: { display_name }}}); was the magic solution lol
Claudio Restifo
@Marmiz
Feb 15 2018 04:33
@thekholm80 :clap: :clap: :fire:
Kyle Holm
@thekholm80
Feb 15 2018 04:35
graphql is so freaking awesome
Sweet Coding :)
@SweetCodingInc
Feb 15 2018 04:37
It is
Gersho
@Gersho
Feb 15 2018 04:37
only db i've used so far are the sqlite ones provided with django (unless you count phpmyadmin)
Kyle Holm
@thekholm80
Feb 15 2018 04:38
graphql is just a query language
i use it in place of a REST api
my db is MongoDB
Kyle Holm
@thekholm80
Feb 15 2018 05:17
well hot damn, i think my server is done
Gersho
@Gersho
Feb 15 2018 05:18
:confetti_ball:
Gersho
@Gersho
Feb 15 2018 05:36
30 minutes to write 4 lines but they compiled on first try, progress i guess ?
Claudio Restifo
@Marmiz
Feb 15 2018 05:56
wonder if this complies :shipit:
int main() {
  string name;
  std::cout << "What's your name?" << std::endl; 
  std::cin >> name;
  std::cout << "Hello " << name << std::endl;
}
Gersho
@Gersho
Feb 15 2018 05:58
i don't know half of this so i can't say
Claudio Restifo
@Marmiz
Feb 15 2018 06:00

Well it's c(++) :)

just a simpler way than using printf / scanf and so on

Gersho
@Gersho
Feb 15 2018 07:04
yay my code works ! but i'm leaking memory badly ==14684== ERROR SUMMARY: 426696 errors from 7 contexts and still reachable: 82,226,368 bytes xD
Vyacheslav Bagmut
@VBagmut
Feb 15 2018 08:04
Error on beta.freecodecamp.org when trying to unpin LinkedIn: "The redirect_uri does not match the registered value".
mstellaluna
@mstellaluna
Feb 15 2018 13:00
@VBagmut Hello this is already a known issue that is being fixed freeCodeCamp/freeCodeCamp#16412
Florent Vandroy
@florent6001
Feb 15 2018 13:21
Hi all, i have a little question, do we have collaboration projects in freecodecamp?
Tom
@moT01
Feb 15 2018 14:19
@florent6001 not specifically - but you can work with someone or multiple people if you want - perhaps ask in the pair room https://gitter.im/FreeCodeCamp/LetsPair or the forum https://forum.freecodecamp.org/ if you want to try and find someone
Florent Vandroy
@florent6001
Feb 15 2018 14:20
ty
Florent Vandroy
@florent6001
Feb 15 2018 15:43
The tribute page is verified by freecodecamp?
Cause i send it, and it take me directly to the next course, i don't have note?
Tom
@moT01
Feb 15 2018 15:50
i dont think the projects are reviewed by anyone
perhaps when you get the certifcate
cjlynch12
@cjlynch12
Feb 15 2018 15:51
currently the projects are reviewed or put through any automated tests, beta will be introducing project checks AKAIK
Florent Vandroy
@florent6001
Feb 15 2018 15:55
So, the system let me pass to the next step cause its good for him?
Aditya
@ezioda004
Feb 15 2018 15:56
Dont think it gets reviewed even when you get certificate.. I got mine instantly after completing final.
cjlynch12
@cjlynch12
Feb 15 2018 15:57
@florent6001 yeah it's basically the honor system right now
Florent Vandroy
@florent6001
Feb 15 2018 16:00
ty
Darren
@DarrenfJ
Feb 15 2018 16:33
morning fCC
VaseJS
@VaseJS
Feb 15 2018 16:34
@DarrenfJ yo
Darren
@DarrenfJ
Feb 15 2018 16:36
@VaseJS buddy!
:D
Kelechi Chinaka
@ke1echi
Feb 15 2018 19:02
how do you get the first digit of credit card? @Gersho
Gersho
@Gersho
Feb 15 2018 19:10
Hi all !
@kelechy did you get the first 2 digits already ?
Kelechi Chinaka
@ke1echi
Feb 15 2018 19:13
done...
trying to get a logic for first digit
Gersho
@Gersho
Feb 15 2018 19:14
firstdigit = firststwo /10
Kelechi Chinaka
@ke1echi
Feb 15 2018 19:15
decimal
eg 5.4
Kyle Holm
@thekholm80
Feb 15 2018 19:15
firsttwo - second / 10
Gersho
@Gersho
Feb 15 2018 19:16
int firstdigit
Kyle Holm
@thekholm80
Feb 15 2018 19:16
oh right, ints are whole numbers
c hurts my head
and hi @Gersho
Gersho
@Gersho
Feb 15 2018 19:16
:wave:
Kelechi Chinaka
@ke1echi
Feb 15 2018 19:17
i will just use a while loop @Gersho
:wave: @thekholm80
Gersho
@Gersho
Feb 15 2018 19:17
i've finished my code late night but still got to do the unload part
Kyle Holm
@thekholm80
Feb 15 2018 19:17
@kelechy hiya
Gersho
@Gersho
Feb 15 2018 19:20

by the way does someone know the difference between

typedef struct node
{
    bool is_word;
    struct node *child[27];
}
node;

and

typedef struct 
{
    bool is_word;
    struct node *child[27];
}
node;

i don't understand the difference

Stephen James
@sjames1958gm
Feb 15 2018 19:21
@Gersho there is really no difference. The first one you are naming the struct which is not needed as you are typedefing
Gersho
@Gersho
Feb 15 2018 19:21
ok thanks @sjames1958gm
CamperBot
@camperbot
Feb 15 2018 19:21
gersho sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8980 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Feb 15 2018 19:22
@Gersho With the first you could do
struct node variable;
with the second you cannot as you have no name
Kelechi Chinaka
@ke1echi
Feb 15 2018 19:22
did it with a while @Gersho
Gersho
@Gersho
Feb 15 2018 19:24
@sjames1958gm you don't even need struct, you can declare them that waynode *variable;
(with the first one, that's the one i'm using)
Stephen James
@sjames1958gm
Feb 15 2018 19:25
@Gersho Yes, that is what the typedef gives you.
Peritract
@Peritract
Feb 15 2018 20:00
I have a quick question about the beta projects. I've already completed some of them (like the calculator) on the old certificates, and I'd ideally like just to submit my solutions for the new certificates, rather than duplicate all of that effort in a slightly different way. The problem with this is that my code works, but doesn't pass some of the highly specific tests in the suite; I haven't structure my HTML exactly the same way as the new project wants. Is it okay to submit them even though they don't pass those specific tests?
Gersho
@Gersho
Feb 15 2018 20:04
hmm i guess that would depend on what the beta projects user stories are, if they ask for that specific html structure, it should be there.
it might also be a system where they set coding style specification as part of the notation
you should probably ask on the forum
Peritract
@Peritract
Feb 15 2018 20:04
I'll do that, thanks.
Amanda
@ScarlettKitsune
Feb 15 2018 20:36

I don't know if I am in the right chat

I'm working on: Use a CSS Class to Style an Element
Your h2 element should be red.-done
Your h2 element should have the class red-text.-done
Your stylesheet should declare a red-text class and have its color set to red. >>>>>>This one will not get checked off seemingly no matter what I do
Do not use inline style declarations like style="color: red" in your h2 element.-done

My code:

<style>
h2 {
color: red;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

There is an example:

<style>
.blue-text {
color: blue;
}
</style>

But when I use that only the bottom "do not use inline style..." gets check off and the rest are unchecked AND the color turns to black.

Altin Rrahmani
@DevKosov
Feb 15 2018 20:38
@ScarlettKitsune you should add the red-text class within the <style>...</style> and give the color red to it
Amanda
@ScarlettKitsune
Feb 15 2018 20:40
I'm not understanding what you just said. Not because you explained it wrong, I think I'm just not understanding this concept.
Altin Rrahmani
@DevKosov
Feb 15 2018 20:42
you should use the class attribute to color the h2 element
in this case you use .red-text
and you give it the color red
Amanda
@ScarlettKitsune
Feb 15 2018 20:43

Like this?

<style>
.red-text {
color: red;
}
</style>

<h2 class="red-text"><h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

when I do this is unchecks all but the bottom.

Altin Rrahmani
@DevKosov
Feb 15 2018 20:43
<h2 class="red-text"><h2>CatPhotoApp</h2>
this like is wrong
when you add an attribute to an element you should not add an other <h2> element
you just do it like this <h2 class="example">H2 content</h2>
i am not good at explaining stuff...
Amanda
@ScarlettKitsune
Feb 15 2018 20:47

That's okay. Apparently this concept is hard to expain because the lesson is doing a horrible job explaining.

This is the lesson.

Use a CSS Class to Style an Element
Classes are reusable styles that can be added to HTML elements.

Here's an example CSS class declaration:

<style>
.blue-text {
color: blue;
}
</style>
You can see that we've created a CSS class called blue-text within the <style> tag.

You can apply a class to an HTML element like this:

<h2 class="blue-text">CatPhotoApp</h2>

Note that in your CSS style element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.

Inside your style element, change the h2 selector to .red-text and update the color's value from blue to red.

Give your h2 element the class attribute with a value of 'red-text'.

Your h2 element should be red.
Your h2 element should have the class red-text.
Your stylesheet should declare a red-text class and have its color set to red.
Do not use inline style declarations like style="color: red" in your h2 element.

Altin Rrahmani
@DevKosov
Feb 15 2018 20:48
change the h2 selector to .red-text and update the color's value from blue to red.
Amanda
@ScarlettKitsune
Feb 15 2018 20:48
I wish I would request someone to look over this lesson and simplify it for people learning in the future.
Altin Rrahmani
@DevKosov
Feb 15 2018 20:50
i think you got a little confused because the lesson its quite clear but it happens and what is exactly that you don't understand?
Amanda
@ScarlettKitsune
Feb 15 2018 20:56

Example from lesson:

<style>
.blue-text {
color: blue;
}
</style>

Mine:

<style>
.red-text {
color: red;
}
</style>

example from lesson:

<h2 class="blue-text">CatPhotoApp</h2>

Mine:

<h2 class="red-text">CatPhotoApp</h2>

I don't know the vocab so when you say 'selector' I don't know what that means.

Altin Rrahmani
@DevKosov
Feb 15 2018 20:57
the selector is what you put within the stylesheet ex: .blue-text this selects all the blue-text classes and gives them the color blue
Amanda
@ScarlettKitsune
Feb 15 2018 20:57
Oh okay.
Altin Rrahmani
@DevKosov
Feb 15 2018 20:58
and what you wrote is correct
if it doesn't work in freecodecamp simply restart the page or web brower
Amanda
@ScarlettKitsune
Feb 15 2018 20:59
okay i'll try htat
omg lol thats all it took. Thank you so much!! You were a lot of help. Thank you for being patien.t
Altin Rrahmani
@DevKosov
Feb 15 2018 21:00
yeah i know freecodecamp is buggy sometimes
have a good time coding ;)
Amanda
@ScarlettKitsune
Feb 15 2018 21:01
thank you. btw is this the right chat for help with the lessons or is there a different chat for that?
Altin Rrahmani
@DevKosov
Feb 15 2018 21:01
@ScarlettKitsune this is it ;)
Amanda
@ScarlettKitsune
Feb 15 2018 21:02
okay cool thank youl
Kyle Holm
@thekholm80
Feb 15 2018 21:03
@DevKosov :wave:
Altin Rrahmani
@DevKosov
Feb 15 2018 21:03
@thekholm80 hey :wave:
how'v you been
Kyle Holm
@thekholm80
Feb 15 2018 21:04
pretty darn good, you?
thought i had finished the server for my project, but it turns out i'm an idiot and make bad assumptions
so, normal day
Altin Rrahmani
@DevKosov
Feb 15 2018 21:05
i'v doing some css (*Drupal is pain)
and keep going haha
you can do it
Kyle Holm
@thekholm80
Feb 15 2018 21:06
css can be interesting
i really like using scss
Altin Rrahmani
@DevKosov
Feb 15 2018 21:06
I agree
pretty damn useful
Kyle Holm
@thekholm80
Feb 15 2018 21:09
i'm kind of stumped right now
Altin Rrahmani
@DevKosov
Feb 15 2018 21:10
why?
Kyle Holm
@thekholm80
Feb 15 2018 21:13
i've created authorization route that sets http-only cookies containing a jwt, now i'm trying to require that cookie for some of my graphql mutations, but i can't set the cookie for testing and i have no idea how to proceed without just assuming it's working and then (possibly) having to go back and debug it when i build my front end
i really need someone smart to hold my hand sometimes. self-learning is hard
Altin Rrahmani
@DevKosov
Feb 15 2018 21:17
i only understood "cookies" in whatever you are doing
Kyle Holm
@thekholm80
Feb 15 2018 21:17
haha
Altin Rrahmani
@DevKosov
Feb 15 2018 21:17
but i understand that its hard to be self-taught
Kyle Holm
@thekholm80
Feb 15 2018 21:18
i only understand maybe 10% of what i'm trying to do
Altin Rrahmani
@DevKosov
Feb 15 2018 21:18
10% vs 0%
thats good already
Kyle Holm
@thekholm80
Feb 15 2018 21:19
yeah
i'll get there
it's just frustrating going so slow sometimes
Gersho
@Gersho
Feb 15 2018 21:19

but i understand that its hard to be self-taught

it feels a lot like learning things out of order

Altin Rrahmani
@DevKosov
Feb 15 2018 21:20
"A LOT"
Gersho
@Gersho
Feb 15 2018 21:20
today: learn how to triple flip
tomorrow: how to snap your fingers
Altin Rrahmani
@DevKosov
Feb 15 2018 21:20
accurate
Amanda
@ScarlettKitsune
Feb 15 2018 21:21
I also only understood "cookies" . haha @thekholm80 how long have you been studying?
Kyle Holm
@thekholm80
Feb 15 2018 21:21
@ScarlettKitsune 1 year, with about a 6 month break in the middle
Amanda
@ScarlettKitsune
Feb 15 2018 21:22
Well, that's not terrible. Hopefully I make it as far in 6 months. :)
Gersho
@Gersho
Feb 15 2018 21:22
progression speed has a lot of fluctuation
Kyle Holm
@thekholm80
Feb 15 2018 21:22
it's possible! I finished the first 2 certificates in about 4 months, iirc
then i got burned out and now i've forgotten a ton
Amanda
@ScarlettKitsune
Feb 15 2018 21:23
I am almost done with python for everyone on coursera. week 4/6. I don't know if it's the way he explains it but I'm finding python a lot easier than html and css lol
Altin Rrahmani
@DevKosov
Feb 15 2018 21:23
2 certificates in FCC??
Kyle Holm
@thekholm80
Feb 15 2018 21:23
yeah
Altin Rrahmani
@DevKosov
Feb 15 2018 21:23
hold on
*pulls out calculator
Gersho
@Gersho
Feb 15 2018 21:24
that's more than one but less than three
Amanda
@ScarlettKitsune
Feb 15 2018 21:24
maybe it's just the way fcc explains things.
Gersho
@Gersho
Feb 15 2018 21:24
fcc lesson are in really small bites
Kyle Holm
@thekholm80
Feb 15 2018 21:24
i started Feb 2017, got front end cert Mar 2017 and data viz May 2017
Gersho
@Gersho
Feb 15 2018 21:25
also html/css logic is very different than coding languages like js or py
cjlynch12
@cjlynch12
Feb 15 2018 21:25
@thekholm80 what you are you using to set the cookie right now? res.cookie?
Altin Rrahmani
@DevKosov
Feb 15 2018 21:25
you did 800 hours in 6 months?
WoW
Gersho
@Gersho
Feb 15 2018 21:25
oh i realised i also joined in feb 2017
Kyle Holm
@thekholm80
Feb 15 2018 21:26
@cjlynch12 yep. generating jwt with jsonwebtoken then setting that as an httponly cookie
Altin Rrahmani
@DevKosov
Feb 15 2018 21:26
i joined in may i think
but i don't have much time to do all the challenges
and i'm LAZY
:D
Gersho
@Gersho
Feb 15 2018 21:26
and i've done the front end in august so 6 months for front end (but i've never actually finished portfolio)
cjlynch12
@cjlynch12
Feb 15 2018 21:27
@thekholm80 you should be able to use cookie-parser to access it directly from the back end, but it's tough to tell without see how you have it all set up. I'm about to leave work but I can take a peek later on if you're still stuck.
Amanda
@ScarlettKitsune
Feb 15 2018 21:27
I started in June then life got in the way and I had to stop. ugh. I would be so much farther by now! oh well. I'm also studying Japanese with Japanese From Zero. So, I have given myself a lot to do lol.
Gersho
@Gersho
Feb 15 2018 21:28
also depends how long you get stuck, i rewrote simon multiple times because i didn't have a good understanding of how function ends
Kyle Holm
@thekholm80
Feb 15 2018 21:29
@cjlynch12 i've got all that, and i've exposed my req object to my graphql context, the problem is i set the cookie on my /api/login route but i'm testing my graphql using graphiql on it's own route /graphiql in the browser so the cookie never gets set
Amanda
@ScarlettKitsune
Feb 15 2018 21:29

Coursera has a class that just started called Responsive website basics: code with html, css, and javascript.

I LOVE coursera. They have so many courses. You guys might find some that could help.

Kyle Holm
@thekholm80
Feb 15 2018 21:30
i've done a udemy course, never any coursera
cjlynch12
@cjlynch12
Feb 15 2018 21:32
@thekholm80 ahh ok, you could just move your cookie setting/jwt function into your graphql route temporarily so that it sets everytime /graphql is called
Amanda
@ScarlettKitsune
Feb 15 2018 21:33
On Coursera you audit the classes unless you pay. Udemy you have to pay for them. Plus a lot of the classes are from university teachers from prestigious universities.
Kyle Holm
@thekholm80
Feb 15 2018 21:33
@cjlynch12 that's a good idea, i think i can make something like that work
@cjlynch12 thanks
CamperBot
@camperbot
Feb 15 2018 21:33
thekholm80 sends brownie points to @cjlynch12 :sparkles: :thumbsup: :sparkles:
:cookie: 429 | @cjlynch12 |http://www.freecodecamp.org/cjlynch12
Amanda
@ScarlettKitsune
Feb 15 2018 21:34
What are brownie points for?
cjlynch12
@cjlynch12
Feb 15 2018 21:34
np!
Gersho
@Gersho
Feb 15 2018 21:34
ePresitge
Kyle Holm
@thekholm80
Feb 15 2018 21:34
you can trade them for a toaster
10,000 brownie points = 1 toaster
Amanda
@ScarlettKitsune
Feb 15 2018 21:36
how do i give brownie points? Aldin helped me earlier.
Altin Rrahmani
@DevKosov
Feb 15 2018 21:36
@ScarlettKitsune thanks
CamperBot
@camperbot
Feb 15 2018 21:36
devkosov sends brownie points to @scarlettkitsune :sparkles: :thumbsup: :sparkles:
:cookie: 21 | @scarlettkitsune |http://www.freecodecamp.org/scarlettkitsune
Kyle Holm
@thekholm80
Feb 15 2018 21:36
@ScarlettKitsune click a name and type thanks
CamperBot
@camperbot
Feb 15 2018 21:36
thekholm80 sends brownie points to @scarlettkitsune :sparkles: :thumbsup: :sparkles:
:cookie: 22 | @scarlettkitsune |http://www.freecodecamp.org/scarlettkitsune
Altin Rrahmani
@DevKosov
Feb 15 2018 21:37
@thekholm80 @Gersho @cjlynch12 thanks
Kyle Holm
@thekholm80
Feb 15 2018 21:37
just like that
Amanda
@ScarlettKitsune
Feb 15 2018 21:37
@DevKosov thanks
CamperBot
@camperbot
Feb 15 2018 21:37
scarlettkitsune sends brownie points to @devkosov :sparkles: :thumbsup: :sparkles:
:cookie: 338 | @devkosov |http://www.freecodecamp.org/devkosov
Manish Giri
@Manish-Giri
Feb 15 2018 21:38
@diomed thx
CamperBot
@camperbot
Feb 15 2018 21:38
manish-giri sends brownie points to @diomed :sparkles: :thumbsup: :sparkles:
:star2: 5328 | @diomed |http://www.freecodecamp.org/diomed
Manish Giri
@Manish-Giri
Feb 15 2018 21:38
oo still works /
Kyle Holm
@thekholm80
Feb 15 2018 21:39
@diomed works?
i don't believe you
May Kittens Devour Your Soul
@diomed
Feb 15 2018 21:41
:unamused:
Manish Giri
@Manish-Giri
Feb 15 2018 21:42
@diomed :wave:
May Kittens Devour Your Soul
@diomed
Feb 15 2018 21:42
hi @Manish-Giri :cat:
Kaz Baig
@kbaig
Feb 15 2018 21:42
:wave:
Kyle Holm
@thekholm80
Feb 15 2018 21:44
@kbaig :wave:
Altin Rrahmani
@DevKosov
Feb 15 2018 21:49
@Manish-Giri @diomed :wave:
Manish Giri
@Manish-Giri
Feb 15 2018 21:50
@DevKosov :wave:
how goes it
Altin Rrahmani
@DevKosov
Feb 15 2018 21:52
its alright what about you?
Manish Giri
@Manish-Giri
Feb 15 2018 21:52
struggle is on
as always
Kyle Holm
@thekholm80
Feb 15 2018 22:02
hurray i figured it out. hacky, but done lol
Altin Rrahmani
@DevKosov
Feb 15 2018 22:04
@thekholm80 Congrats :congratulations:
Gersho
@Gersho
Feb 15 2018 22:06
:thumbsup:
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:09

Hi all, new to Apollo... When I add a new model (is that the right word?) I keep getting this: Error: "_makeNewID" defined in resolvers, but not in schema Any idea why?

I'm using Meteor and react-apollo, and using the same method I've used in the past couple of projects but this is the first time I've run into this.

import { createApolloServer } from 'meteor/apollo';
import { makeExecutableSchema } from 'graphql-tools';
import merge from 'lodash/merge';

import PinSchema from '../../api/pins/Pin.graphql';
import PinsResovler from '../../api/pins/pins';
import UsersSchema from '../../api/users/User.graphql';
import UsersResolver from '../../api/users/resolvers';

const typeDefs = [UsersSchema, PinSchema];
const resolvers = merge(UsersResolver, PinsResovler);

const schema = makeExecutableSchema({
  typeDefs,
  resolvers,
});

createApolloServer({ schema });
Kyle Holm
@thekholm80
Feb 15 2018 23:10
@mackmmiller did you add a typeDef for that model?
err ... i guess in your structure it would be added either in UsersSchema or PinSchema
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:11
The new model is the Pins, so I've added PinSchema to typeDefs and the resolvers to the resolvers
type Pin {
  _id: String
  title: String
  url: String
  author: String
}


extend type Query {
  pins: [Pin]
}

type Mutation {
  newPin(title: String, url: String): Pin
}
Kyle Holm
@thekholm80
Feb 15 2018 23:13
hmm, where's it getting _makeNewID?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:13
Exactly! I have absolutely no idea.
Kyle Holm
@thekholm80
Feb 15 2018 23:15
wow, google has 1 result for that error too
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:15
Yep!
Kyle Holm
@thekholm80
Feb 15 2018 23:15
I think you might be up for an award or something here
do they give a Nobel Prize for breaking stuff?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:15
I'm banging my head against the desk because I don't even know where to begin.
I sure hope so
Kyle Holm
@thekholm80
Feb 15 2018 23:17
i assume it all worked before you added this?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:18
Yeah, if I remove PinSchema from typeDefs and PinsResolver from resolvers it works
Kyle Holm
@thekholm80
Feb 15 2018 23:20
when i use makeExecutableSchema() from graphql-tools i pass a string as the typeDef, you've passed an array before and had it work?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:21
Yeah I've done it about 3 times before and this is exactly how I've done it
Okay, I've removed the user model info from the variables above and I'm still getting the same error
Kyle Holm
@thekholm80
Feb 15 2018 23:22
so it's definitely the pins
can you show the resolver?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:24
import Pins from './pins';

export default {
  Query: {
    pins(obj, args) {
      return Pins.find({}).fetch();
    },
  },

  Mutation: {
    newPin(obj, { title, url }, { userId }) {
      const pinId = Pins.insert({
        title,
        url,
        author: userId,
      });
      return Pins.findOne(pinId);
    },
  },
};
Kyle Holm
@thekholm80
Feb 15 2018 23:29
is your user resolver using the same .insert() method?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:30
As the Users resolver? No, I'm using Meteor so the users collection is already handled.
Kyle Holm
@thekholm80
Feb 15 2018 23:32
i'm reading the Meteor docs, and it assigns a unique id, and that's where i'm guessing the _makeNewID is coming from
but i'm not really getting much out of the docs. have you tried a Meteor or react-apollo help room?
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:35
Tried Apollo, no one responded haha. I'll try a Meteor room next
Kyle Holm
@thekholm80
Feb 15 2018 23:36
sorry, wish i could help
VaseJS
@VaseJS
Feb 15 2018 23:36
I’m usually on the other end helping but today I need some help. I trying to understand this SAM (state-action-model) pattern and have refactored an example from the site. But mine is not working. There must be something i messed up somewhere
Mackenzie Miller
@mackmmiller
Feb 15 2018 23:36
Not a problem! I'm glad it's stumping someone else too
original code here for codepen refactor above: https://bitbucket.org/snippets/jdubray/9dgKp
I can’t get it to start counting down
Kyle Holm
@thekholm80
Feb 15 2018 23:38
@VaseJS that's all greek to me
VaseJS
@VaseJS
Feb 15 2018 23:38
same here!
the view is in the ready state: view.ready. but i think the problem is in the form section
I dont understand this line:
view.ready = (model) => {
  return `<p>Counter: ${model.counter}<p>
          <form onsubmit='JavaScript:return actions.start({});'>
            <input type='submit' value='Start'>
          </form>`;
the onsubmit part. I’ve never seen “JavaScript:return …” before
why its a form, i don’t know
Kyle Holm
@thekholm80
Feb 15 2018 23:40
when i click the button i get a warning
VaseJS
@VaseJS
Feb 15 2018 23:40
nothing is being submitted
Kyle Holm
@thekholm80
Feb 15 2018 23:40
in the console
VaseJS
@VaseJS
Feb 15 2018 23:40
oh, i didn’t check that
Kyle Holm
@thekholm80
Feb 15 2018 23:40
Form submission canceled because the form is not connected
I don't know how you connect it though
VaseJS
@VaseJS
Feb 15 2018 23:41
it doesn’t
to the best of my knowledge
if you look at the working example, i don’t think it connects to anything
it simple counts down. why he used form is a mystery. maybe i need to do more refactoring
button onclick event instead
its a misuse of a form
thoughts?
Kyle Holm
@thekholm80
Feb 15 2018 23:43
switch to React?
VaseJS
@VaseJS
Feb 15 2018 23:44
or maybe the form serves a purpose i’m overlooking
lol
Kyle Holm
@thekholm80
Feb 15 2018 23:44
lol then at least I could help you
maybe
VaseJS
@VaseJS
Feb 15 2018 23:44
the funny thing is its an alt to react!
lol
Kyle Holm
@thekholm80
Feb 15 2018 23:44
we used to have some folks in here that used Vue
they'd probably have a good idea
seems similar
VaseJS
@VaseJS
Feb 15 2018 23:45
it is
just vanilla