These are chat archives for FreeCodeCamp/Help

5th
Jan 2018
Albert Cardona II
@daddycardona
Jan 05 2018 02:29
@sjames1958gm let me check it out
Gersho
@Gersho
Jan 05 2018 02:29
welcome back
Albert Cardona II
@daddycardona
Jan 05 2018 02:31
I feel a lot better tonight better then this morning ;)
thanks @Gersho
CamperBot
@camperbot
Jan 05 2018 02:31
daddycardona sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 560 | @gersho |http://www.freecodecamp.org/gersho
Albert Cardona II
@daddycardona
Jan 05 2018 02:31
:)
thanks @sjames1958gm and the @thekholm80 you guys helped with this alot even though its not done yet my mind is in the right position of working on it ;)
CamperBot
@camperbot
Jan 05 2018 02:32
daddycardona sends brownie points to @sjames1958gm and @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1651 | @thekholm80 |http://www.freecodecamp.org/thekholm80
:star2: 8819 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Kyle Holm
@thekholm80
Jan 05 2018 02:44
@daddycardona you got this, kick it in the butt
Gersho
@Gersho
Jan 05 2018 02:51
wow managing user login with django is so easy
was thinking i'll just start reading a bit about it and sleep on it and ended up doing all i need to do with it
Claudio Restifo
@Marmiz
Jan 05 2018 02:53
if(userIsCool) { return "your're cool";  }

return "not this time, bot";
and they say programming is hard
Claudio Restifo
@Marmiz
Jan 05 2018 02:57
that's actually how the design departments thinks we do all day
Albert Cardona II
@daddycardona
Jan 05 2018 03:05
@Gersho awesome @thekholm80 I will eventually get it
@Marmiz PS no bugs LOL
Gersho
@Gersho
Jan 05 2018 03:27
well that's it for me for today, happy coding to you all
Albert Cardona II
@daddycardona
Jan 05 2018 03:27
gn
Darren
@DarrenfJ
Jan 05 2018 03:44
@khaduch yah apparently the bomb cyclone is what the meteorologists call it.. weird stuff man, Sharks are freezing... cats are sleeping with dogs, up is down, and down is the upsidedown
Ken Haduch
@khaduch
Jan 05 2018 03:45
@DarrenfJ :worried:
Darren
@DarrenfJ
Jan 05 2018 03:47
@Gersho PS no bugs lol
Claudio Restifo
@Marmiz
Jan 05 2018 03:48
st
@DarrenfJ
Albert Cardona II
@daddycardona
Jan 05 2018 03:49
LMAO @darren how you all doing @khaduch and @Marmiz
I love that show btw
Darren
@DarrenfJ
Jan 05 2018 03:50
due to Black Mirror the Callister episode i am now binge watching Star Trek TOS
Albert Cardona II
@daddycardona
Jan 05 2018 03:51
have not seen that show yet
I heard it will make me cry lol
Ken Haduch
@khaduch
Jan 05 2018 03:53
@daddycardona - I'm doing okay. Managed not to shovel snow today, but it'll be there tomorrow. Unless the crazy winds blow it away! :) How are you doing?
Albert Cardona II
@daddycardona
Jan 05 2018 03:54
I am good feeling better been taking medicine and soup all day feel like a drug attick I hate taking meds lol
brb
Claudio Restifo
@Marmiz
Jan 05 2018 03:59
@daddycardona busy at work :) but can't complain :palm_tree: :sunny: :sunglasses:
Kyle Holm
@thekholm80
Jan 05 2018 03:59
eww work
Claudio Restifo
@Marmiz
Jan 05 2018 03:59
I like my job <3
so I don't mind working, tbh
but I'd love a 6moth holiday 6month work kind of lifestyile
Kyle Holm
@thekholm80
Jan 05 2018 04:00
tbh i like my job too, i just wish it was more challenging
Claudio Restifo
@Marmiz
Jan 05 2018 04:02
@thekholm80 you can always make it more challenging yourself...
like I'm gonna start working but with the monitor off :laughing:
Kyle Holm
@thekholm80
Jan 05 2018 04:02
oh that's a good idea
maybe i'll forward my work phone to my cell phone, and leave it at the other end of my house
then i have to race to reach it before it goes to voicemail
Claudio Restifo
@Marmiz
Jan 05 2018 04:03
fitness plan for 2018: sorted!
Albert Cardona II
@daddycardona
Jan 05 2018 04:11
TBH I am retired lol
but I will start school and it will lead me to a new career :)
LMAO @thekholm80 yo that is a fitness plan lol
Claudio Restifo
@Marmiz
Jan 05 2018 04:12
@daddycardona professional puppy petter?
best job ever
Albert Cardona II
@daddycardona
Jan 05 2018 04:12
LMAO no thank you but something in th electronic field
with my retirement and that job I shold be able to live well and bles others :)
Kyle Holm
@thekholm80
Jan 05 2018 04:13
you should bless me with a new Porsche
or a used one, i'm not picky
Albert Cardona II
@daddycardona
Jan 05 2018 04:14
I retired the military early lol not like I will be making enough to buy a porshe lol
i can buy you a hot wheels porsche lol
Kyle Holm
@thekholm80
Jan 05 2018 04:15
I had really hoped to be retired by 50 but it's not looking likely
Albert Cardona II
@daddycardona
Jan 05 2018 04:16
yeah I am trying to make good money and My gf is into stocks right now so I am hoping she makes good money too so we can find a house and move in together and I can touch her every night ;)
Kyle Holm
@thekholm80
Jan 05 2018 04:16
poor girl
Albert Cardona II
@daddycardona
Jan 05 2018 04:29
i know lol
Kyle Holm
@thekholm80
Jan 05 2018 04:29
I'm reading articles about how people in Oregon are freaking out because they have to pump their own gas now
it's kind of funny
Claudio Restifo
@Marmiz
Jan 05 2018 04:31
? there's no self service stations in the US?
Kyle Holm
@thekholm80
Jan 05 2018 04:31
it used to be state law in Oregon that you couldn't pump your own gas. that changed Jan. 1
i think they were the only state in the US that had that law, though
Ken Haduch
@khaduch
Jan 05 2018 04:33
@thekholm80 - as far as I know, New Jersey still has a law that you cannot pump your own gas?
Kyle Holm
@thekholm80
Jan 05 2018 04:33
i imagine it's a lot of this
@khaduch interesting, i did not know that
Ken Haduch
@khaduch
Jan 05 2018 04:35
wow, that's a real thing that someone did?
Kyle Holm
@thekholm80
Jan 05 2018 04:35
it's an old video, like 2013 I think
but it's real
Albert Cardona II
@daddycardona
Jan 05 2018 04:36
yeah that is true
Claudio Restifo
@Marmiz
Jan 05 2018 04:39
zl
Kyle Holm
@thekholm80
Jan 05 2018 04:40
omg i used to love that movie
Ismail Hozain
@ismailhozain
Jan 05 2018 04:55
hey guys some javascript questions -so what i want to do is replace some characters referenced in a function and am using replace but it keeps returning undefined function DNAStrand(dna){ dna.replace("A","T"); dna.replace("T","A"); dna.replace("C","G"); dna.replace("G","C"); }
Ken Haduch
@khaduch
Jan 05 2018 04:58
@ismailhozain - it doesn't look like you have a return statement, so the default is that the function will return undefined as a return value - also, the .replace() method returns a new string with the replacement, it doesn't modify the string value in place, so you would have to do something like dna = dna.replace(...); then at the end return dna;
Kyle Holm
@thekholm80
Jan 05 2018 04:59
@khaduch is right, it doesn't mutate the original string
Description
This method does not change the String object it is called on. It simply returns a new string.
Ismail Hozain
@ismailhozain
Jan 05 2018 05:00
how would i return that?
i set them to 4 different variables but then how do i return them ?
Ken Haduch
@khaduch
Jan 05 2018 05:01
@ismailhozain - look at my comment above - just keep using dna as the string - dna = dna.replace(...); four times, and then return dna; at the end.
Kyle Holm
@thekholm80
Jan 05 2018 05:01
what Ken said
Ismail Hozain
@ismailhozain
Jan 05 2018 05:02
oh i thought it was setting the variable do 4 different things whoops my bad
Ken Haduch
@khaduch
Jan 05 2018 05:02
or you can even do three times dna = dna.replace(...); and then for the last one return dna.replace(...); because it will return the final updated string value. Saves a line of code.
@ismailhozain - the only thing you are going to have trouble with, potentially, is that when you do this: dna = dna.replace("A", "T"); and then dna = dna.replace("T", "A"); it is going to just swap the letters back to the way they were at first. So you might need a different technique.
Kyle Holm
@thekholm80
Jan 05 2018 05:07

maybe something like

function DNAStrand (dna) {
  return dna.replace(/[ATCG]/g, letter => {
    switch (letter) {
      case 'A': return 'T';
      case 'T': return 'A';
      case 'C': return 'G';
      case 'G': return 'C';
      default: break;
    }
  });
}

?

Ismail Hozain
@ismailhozain
Jan 05 2018 05:07
i was just having that issue -do i need to loop the whole thing?
oh ok i will try that
@thekholm80 @khaduch thanks guys it worked
CamperBot
@camperbot
Jan 05 2018 05:08
ismailhozain sends brownie points to @thekholm80 and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3650 | @khaduch |http://www.freecodecamp.org/khaduch
:star2: 1652 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Ismail Hozain
@ismailhozain
Jan 05 2018 05:09
but @thekholm80 could you explain the code not sure i completely understand it?
Kyle Holm
@thekholm80
Jan 05 2018 05:09
you bet
Ken Haduch
@khaduch
Jan 05 2018 05:09
@ismailhozain :+1:
Kyle Holm
@thekholm80
Jan 05 2018 05:09
replace() takes 2 arguments
Ismail Hozain
@ismailhozain
Jan 05 2018 05:09
ok
Kyle Holm
@thekholm80
Jan 05 2018 05:10
the first I've put a regex expression that will look for the letters A, T, C, G
the second argument is telling it what to replace those letters with
Ismail Hozain
@ismailhozain
Jan 05 2018 05:10
do you mean the switch?
Kyle Holm
@thekholm80
Jan 05 2018 05:10
so the switch() statement will look at the matched letter and return the appropriate alternate value
Ismail Hozain
@ismailhozain
Jan 05 2018 05:11
oh ok thanks @thekholm80 now i got it
CamperBot
@camperbot
Jan 05 2018 05:11
ismailhozain sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
api offline
Kyle Holm
@thekholm80
Jan 05 2018 05:11
:+1:
oh wait, this might make more sense
function DNAStrand (dna) {
  return dna.replace(/[ATCG]/g, function (letter) {
    switch (letter) {
      case 'A': return 'T';
      case 'T': return 'A';
      case 'C': return 'G';
      case 'G': return 'C';
      default: break;
    }
  });
}
i used an arrow function before, this does the same thing
Ismail Hozain
@ismailhozain
Jan 05 2018 05:13
yeah that kinda tripped me up at first
Ken Haduch
@khaduch
Jan 05 2018 05:22

@ismailhozain - you could do it a few different ways, I think - something like this would work, too. It avoids that re-replacement problem by using a different replacement (lower case letters):

function DNAStrand(dna){ 
    dna = dna.replace(/A/g,"t"); 
    dna = dna.replace(/T/g,"a"); 
    dna = dna.replace(/C/g,"g"); 
    return dna.replace(/G/g,"C").toUpperCase();
}

And finally returns the upper-cased version.

Ismail Hozain
@ismailhozain
Jan 05 2018 05:23
what do the slashes do or are they insignificant?
Ken Haduch
@khaduch
Jan 05 2018 05:25
@ismailhozain - these are simple regular expressions, using the "g" flag (for "global") means to replace all occurrences of the letter between the slashes. If you just do dna.replace("A", "t"); it will only replace the first occurrence. Using the regexp, it will then replace all occurrences.
IT was just to present another way to think about and solve that problem...
Claudio Restifo
@Marmiz
Jan 05 2018 05:26
I'm totally brainfarted right now.
@thekholm80 in a stateles function, when destructuring how's the syntax with the spread operator?
const SF = ({children, ...rest}) => {
  // how do I access to the rest props?
 const { somePropInRest } = this.props;
}
Kyle Holm
@thekholm80
Jan 05 2018 05:27
can you use ..rest on an object?
Ismail Hozain
@ismailhozain
Jan 05 2018 05:27
@khaduch -thanks once again!
Kyle Holm
@thekholm80
Jan 05 2018 05:30
This message was deleted
Claudio Restifo
@Marmiz
Jan 05 2018 05:30
@thekholm80 yeh you can destructure inside an obj, this is actually quire common with react router:
const Route = ({ children, ...rest}) => (
  <Route
     {...rest}
/>
  {children}
</Route>
)
Kyle Holm
@thekholm80
Jan 05 2018 05:31
wow, i never got that heavy into router
I'm reading the MDN page on rest parameters right now
it's about as clear as mud
Claudio Restifo
@Marmiz
Jan 05 2018 05:33
I'm dumb as heck: if I call the parameter rest i should access them via that name:
const S =({...r}) => console.log(r) // the whole object
Ken Haduch
@khaduch
Jan 05 2018 05:34
@Marmiz - don't the ...rest properties have to be name: value pairs?
Kyle Holm
@thekholm80
Jan 05 2018 05:34
that's what I just decided @Marmiz ... MDN is using ...theArgs in their examples so I think the important bit is the ... then your variable name
Claudio Restifo
@Marmiz
Jan 05 2018 05:35
@khaduch it is. those are in fact react props passed as an object
@thekholm80 yep, told you I brainfart
Kyle Holm
@thekholm80
Jan 05 2018 05:36
well, i learned something new, thanks @Marmiz
CamperBot
@camperbot
Jan 05 2018 05:36
thekholm80 sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1119 | @marmiz |http://www.freecodecamp.org/marmiz
Claudio Restifo
@Marmiz
Jan 05 2018 05:36
stupid JS and its stupid syntax
Kyle Holm
@thekholm80
Jan 05 2018 05:36

was playing in jsbin, and

const obj = { a: 1, b: 2, c: 3 };

const myFunc = ({ a, ...rest }) => {
  console.log(rest);
}

myFunc(obj);

logs

[object Object] {
  b: 2,
  c: 3
}
pretty neat
Claudio Restifo
@Marmiz
Jan 05 2018 05:37
@thekholm80 it's handy, especially when you have tons of props but you are too lazy to type props everywhere...
and want to be expicit on the props your components needs
Kyle Holm
@thekholm80
Jan 05 2018 05:37
i generally just pull off the prop i need with destructuring and ignore the rest
Claudio Restifo
@Marmiz
Jan 05 2018 05:37
so thant when refatoring you see what you need/using
Kyle Holm
@thekholm80
Jan 05 2018 05:37
not sure if that's okay or not lol
Albert Cardona II
@daddycardona
Jan 05 2018 05:38
I have no clue what you smart people are talking about
Claudio Restifo
@Marmiz
Jan 05 2018 05:38

@thekholm80 but what if you have 10/15 props?
you write a function like this?

cost s = ({
prop1,
prop2,
prop3,
[..and so on]
}) => {}

I'd kill you for that

Kyle Holm
@thekholm80
Jan 05 2018 05:39
@daddycardona sometimes you only need a few keys from an object, destructuring makes it easy
@Marmiz rofl no i'd probably destructure where I used the prop, or just use props.myprop
but i have had some import { this, that, somethingElse, anotherThing } from Library statements before lol
Albert Cardona II
@daddycardona
Jan 05 2018 05:41
oh I know about the 3 ... but was told they not stable don't use them lol
Kyle Holm
@thekholm80
Jan 05 2018 05:41
i'm not stable
Albert Cardona II
@daddycardona
Jan 05 2018 05:41
lmao ;)
Claudio Restifo
@Marmiz
Jan 05 2018 05:42
@daddycardona life is to short to wait for browsers to implement things...
live fast and wreck all
Albert Cardona II
@daddycardona
Jan 05 2018 05:42
LOL
Kyle Holm
@thekholm80
Jan 05 2018 05:42
one of the benefits of React is Babel - it transpiles all our code into older ES5 code
so the ... goes away before it's deployed
Albert Cardona II
@daddycardona
Jan 05 2018 05:42
I am thinking about trying to create an extention for chrome just so I can say i did iit lol
I did not know that, Babel is cool
Kyle Holm
@thekholm80
Jan 05 2018 05:43
babel is very cool
Ken Haduch
@khaduch
Jan 05 2018 05:46
In the React course I'm doing on Udemy he has us using the babel plugin https://babeljs.io/docs/plugins/transform-object-rest-spread/ to do the object spread operator. In case it is missing from JS native support (I guess)
Albert Cardona II
@daddycardona
Jan 05 2018 05:48
I am going to let you all go because this coding today is pissing me off lol
Claudio Restifo
@Marmiz
Jan 05 2018 05:48

@daddycardona @khaduch only IE does not support it, and Edge does not support it only as destrucuring (you can still use it in array)
but yeah, since you are using JSX you'll need babel anyway...

so just add plugins ;)
(until you have 3MB of plugins)

Albert Cardona II
@daddycardona
Jan 05 2018 05:49
I hate when I thought I had a code written down and get help and don't know what to do with suggestions lol I even changed it to 2 for loops :(
Kyle Holm
@thekholm80
Jan 05 2018 05:52
@daddycardona you'll get it
Claudio Restifo
@Marmiz
Jan 05 2018 05:52
@daddycardona when you feel in a swamp:
rubber duck
Kyle Holm
@thekholm80
Jan 05 2018 05:52
I'm going to bed, got a long 3 day weekend to kick off tomorrow
Claudio Restifo
@Marmiz
Jan 05 2018 05:52
80% of the times works all the times
Albert Cardona II
@daddycardona
Jan 05 2018 05:53
lmao
yeah I am going to play video games ;)
I will get it later ;)
Claudio Restifo
@Marmiz
Jan 05 2018 05:53
@daddycardona I'm not joking, is an actual thing
https://en.wikipedia.org/wiki/Rubber_duck_debugging
Albert Cardona II
@daddycardona
Jan 05 2018 05:53
this might be the first one I have to psuedo code properly
oh still sounds funny lol
GN yall ;)
Claudio Restifo
@Marmiz
Jan 05 2018 05:55
:wave:
Albert Cardona II
@daddycardona
Jan 05 2018 05:55
thanks @Marmiz I will look that up too ;)
CamperBot
@camperbot
Jan 05 2018 05:55
daddycardona sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1120 | @marmiz |http://www.freecodecamp.org/marmiz
Ken Haduch
@khaduch
Jan 05 2018 05:58
@daddycardona - basically it is a process of talking through your code to some (one) or (thing), like a rubber duck. I saw a presentation by some guy who had a rubber duck sitting on the podium and he explained it. Just talking out loud as you go through your code can be helpful.
khaduch @khaduch - going off line for now - have a good night (or day) and happy coding everyone!
Long Nguyen
@longnt80
Jan 05 2018 06:51
@Marmiz @khaduch thanks guys! TIL
CamperBot
@camperbot
Jan 05 2018 06:51
longnt80 sends brownie points to @marmiz and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1121 | @marmiz |http://www.freecodecamp.org/marmiz
:star2: 3651 | @khaduch |http://www.freecodecamp.org/khaduch
slience.c
@hellc3c
Jan 05 2018 07:02
This message was deleted
Alvin Meng
@alvinmeng1993
Jan 05 2018 07:03
div
Claudio Restifo
@Marmiz
Jan 05 2018 07:18
@longnt80 ? what?
you mean the destructuring thing?
Long Nguyen
@longnt80
Jan 05 2018 07:18
no, the rubber duck :smile:
Claudio Restifo
@Marmiz
Jan 05 2018 07:18
we have a cactus at work :)
Jesse
@ki4jgt
Jan 05 2018 07:43
Why is the weather not showing in Firefox: https://codepen.io/ki4jgt/pen/aVjzLE
Sorin Ruse
@sorinr
Jan 05 2018 08:38
@ki4jgt for me its working on firefox
Dio
@DioGuo
Jan 05 2018 09:34
"Hello Paragraph"task,why i entered all the words but the page still shows error?
Stephen James
@sjames1958gm
Jan 05 2018 10:37
@DioGuo Show your code and which tests are failing?
pocahontas123
@pocahontas123
Jan 05 2018 13:16

HELLO, i have a simple question regarding "https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js" with the tribute project. THANKS
Maybe question is: Is it normal that i only have 1 test running out (1/10 with green color) and not like 10/10 ? It say in it: Tribute Page tests

Technology Stack

And at the top right: 1test 0 failure. So it mean it is ok for me?
(i'm going to check the chat now and then :) )

Ken Haduch
@khaduch
Jan 05 2018 19:40
@pocahontas123 - I have only looked at one project that was using the test suite, and I think that it had most of the tests passing - I think that it was a tribute page. I haven't made any pages on my own that use it, is it in the "beta" version of the site? Do you have a URL for the project that your working on (CodePen, I'm hoping?) That way some of us could take a look an offer help if needed.
Jesse
@ki4jgt
Jan 05 2018 21:40
@sorinr for me, Firefox only displays (Click to change).
artbohr
@artbohr
Jan 05 2018 23:27

hey guys, is this kind of FOG of war even playable?

https://codepen.io/artbohr/full/RxpPpY/

move with WASD

Kyle Holm
@thekholm80
Jan 05 2018 23:38
i love when i've walked away from a project for too long and then can't decide if it would be easier to try to figure out where I left off and finish the last 10%, or just start from scratch
artbohr
@artbohr
Jan 05 2018 23:57
@thekholm80 that's horrible, never leave your projects before they are done ^^
@thekholm80 a hard lesson to be learned haha
Kyle Holm
@thekholm80
Jan 05 2018 23:58
I decided to just start fresh. i had used REST apis and i'd really rather switch to GraphQL anyway
but yeah, lesson learned lol