These are chat archives for FreeCodeCamp/Help

13th
Nov 2018
Kyle Holm
@thekholm80
Nov 13 2018 00:58
@texas2010 :wave:
Lance
@texas2010
Nov 13 2018 00:59
@thekholm80 hey man
Aditya
@ezioda004
Nov 13 2018 01:46
@thekholm80 :wavy_dash:
codeloopy
@codeloopy
Nov 13 2018 02:21
hey y’all have a JS ? on the slice and splice challenge
why do u have to splice the array into a new var before you can use it to splice it back into arr2?
sorry I meant why slice it first
Aditya
@ezioda004
Nov 13 2018 02:24
@codeloopy Challenge link?
my solution wasn’t working so after some much more and I don’t underatand why use the slice first, I thought I could just insert the arr1 where it needed to go without having to slice it, I don’t understand why slice it first
Aditya
@ezioda004
Nov 13 2018 02:27

The second array should remain the same after the function runs.

Because of this test.

codeloopy
@codeloopy
Nov 13 2018 02:27
this is the correct solution:
function frankenSplice(arr1, arr2, n) {

let NewArr = arr2.slice(0,arr2.length)
NewArr.splice(n, 0, …arr1);

return NewArr;
}
Aditya
@ezioda004
Nov 13 2018 02:27
It wants you to return a new array.
codeloopy
@codeloopy
Nov 13 2018 02:28
yeah but doesn’t slice return a new array anyway?
Aditya
@ezioda004
Nov 13 2018 02:28
You could also do const newArr = [...arr2];
It does return a new array, .splice() doesnt, it mutates the array.
codeloopy
@codeloopy
Nov 13 2018 02:28
oooohhhhh, ok
SOB! unfortunately upon searching for help I fond a solution (so i didn’t solve it) but still didn’t get it.
@ezioda004 Thanks man!
ima revesit this later make sure I underatand it. Tnx again
gn
Aditya
@ezioda004
Nov 13 2018 02:30
No problem :thumbsup:
Ai rui 艾瑞
@aisolae
Nov 13 2018 03:50
hi
i have a problem
i am trying to make a gallery, i need the picture to view in the box onclick of individual picture.
anyone please help
Henry
@GitHub-Henry
Nov 13 2018 05:31
@aisolae here is a tutorial explaining how to do just that, https://www.w3schools.com/howto/howto_js_tab_img_gallery.asp
Ai rui 艾瑞
@aisolae
Nov 13 2018 06:49
Ok, i have seen that. just wondering what i did wrong in mine
i cant place the button to the right of the searchbox
in a way that works for all sizes
abraham anak agung
@padunk
Nov 13 2018 07:27
@LEvinson2504 you have display : block for your input text
Levinson D'Souza
@LEvinson2504
Nov 13 2018 07:29
@padunk ohh yess that fixed it Thanks a lot
@padunk ++
abraham anak agung
@padunk
Nov 13 2018 07:30
@LEvinson2504 :thumbsup:
Levinson D'Souza
@LEvinson2504
Nov 13 2018 07:57
what would be a way to center the textbox and search button?? @padunk
abraham anak agung
@padunk
Nov 13 2018 08:36
@LEvinson2504 use flexbox
display: flex; justify-content : center;
Levinson D'Souza
@LEvinson2504
Nov 13 2018 08:39
okayy
Eric Weiss
@eweiss17
Nov 13 2018 13:46
flexbox is super busted, i'd recommend anyone doing base css to learn it
Christopher McCormack
@cmccormack
Nov 13 2018 13:47
@eweiss17 super busted?
Eric Weiss
@eweiss17
Nov 13 2018 13:52
"Very good"
Aditya
@ezioda004
Nov 13 2018 14:01
@cmccormack Hey, have you setup fcc locally? I could use your reviews on some of the test PRs.
Christopher McCormack
@cmccormack
Nov 13 2018 14:48
@ezioda004 no sorry been extremely busy with work, probably will be until this weekend
but if I do find time I'll ping you - when you say test PRs what do you mean?
Aditya
@ezioda004
Nov 13 2018 14:50
@cmccormack The challenges test that needs to be tested locally and yeah sure the PRs arent running anywhere :D
Christopher McCormack
@cmccormack
Nov 13 2018 14:51
ok so not specific PRs but any PR that's in the queue that needs tested locally
Did you try it with a Mac or Windows?
Niraj Nandish
@Nirajn2311
Nov 13 2018 14:52
@ezioda004 I can help you with the PRs
Aditya
@ezioda004
Nov 13 2018 14:54
@cmccormack Specific PR's that I've authored, I setup fcc on ubuntu cause windows sucks
@Nirajn2311 Great, I'll tag you in the PRs.
Christopher McCormack
@cmccormack
Nov 13 2018 14:55
Did you try doing it with WSL on windows?
Niraj Nandish
@Nirajn2311
Nov 13 2018 14:56
Same here, windows kept on crashing fcc
May Kittens Devour Your Soul
@diomed
Nov 13 2018 14:56
._.
Christopher McCormack
@cmccormack
Nov 13 2018 14:57
@diomed hello :cat:
Aditya
@ezioda004
Nov 13 2018 14:58
Yeah, its a module issue - specifically some gulp package issue
May Kittens Devour Your Soul
@diomed
Nov 13 2018 14:58
hello, humans :cat:
Aditya
@ezioda004
Nov 13 2018 14:58
But it works great on elementary OS so its fine, just gotta switch b/w the OS once in a while
May Kittens Devour Your Soul
@diomed
Nov 13 2018 14:59
did you guys know that bike is short for Bichael?
Christopher McCormack
@cmccormack
Nov 13 2018 15:00
I need to find one with a cat playing the drums
ba_dum_tss_pirates_band_of_misfits.gif
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:00
cats dont play drums. lol
they roll eyes, tho
Christopher McCormack
@cmccormack
Nov 13 2018 15:01
that's about all I've ever seen them do
Aditya
@ezioda004
Nov 13 2018 15:01
Ba_Dum_Tss_Cat.jpg
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:01
_ R _ _ _ _ _ _ _
animal
Christopher McCormack
@cmccormack
Nov 13 2018 15:01
that's why I'm a dog person
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:01
@ezioda004 damnit!
Christopher McCormack
@cmccormack
Nov 13 2018 15:02
CRABLOCKER
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:02
is that your final answer?
Christopher McCormack
@cmccormack
Nov 13 2018 15:02
no?
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:02
it better not be
Christopher McCormack
@cmccormack
Nov 13 2018 15:02
G
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:02
nope
Christopher McCormack
@cmccormack
Nov 13 2018 15:02
L
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:03
you're in luck
_ R _ _ _ _ L L _
Christopher McCormack
@cmccormack
Nov 13 2018 15:03
I thought it might be GRAYGOOSE
but that's more of a drink than an animal
Y
It can also get rust off your chrome
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:04
damn. there goes my vodka based task
also - no Y
Aditya
@ezioda004
Nov 13 2018 15:05
E
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:05
nopey
Christopher McCormack
@cmccormack
Nov 13 2018 15:06
S
Aditya
@ezioda004
Nov 13 2018 15:06
P
Christopher McCormack
@cmccormack
Nov 13 2018 15:06
S as in Ceasar
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:06
anyone have experience selling your html template?
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:07
I wish I did :-/
Christopher McCormack
@cmccormack
Nov 13 2018 15:07
@Lia-Sue-Kim That's a weird synonym for soul
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:07
with a cool design
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:07
also NO on both of those letters
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:07
@cmccormack why
Christopher McCormack
@cmccormack
Nov 13 2018 15:07
U
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:07
on envato
people buy and sell
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:07
no U.
Christopher McCormack
@cmccormack
Nov 13 2018 15:08
A
Aditya
@ezioda004
Nov 13 2018 15:08
O
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:08
it's better I guess than waiting money from adsense lol
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:08
you're in luck
A R _ A _ _ L L O
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:08
abrakadabra
Aditya
@ezioda004
Nov 13 2018 15:08
armadillo!
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:09
:ballot_box_with_check: :tada: congratulations @ezioda004 ! :tada:
you WIN!
Aditya
@ezioda004
Nov 13 2018 15:09
@diomed Thanks, I'll take cash
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:09
I just wonder who would by if you do something
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:09
:yum:
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:09
buy
Christopher McCormack
@cmccormack
Nov 13 2018 15:09
That was a rollercoaster of emotions!
@Lia-Sue-Kim is this a wordpress theme?
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:10

life is a rollercoaster, you just gotta ride it

Ronan Keating

Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:10
no html css js
Christopher McCormack
@cmccormack
Nov 13 2018 15:10
That isn't a very useful quote, you have no choice but to ride this rollercoaster and for most it's made of splintered rotted wood
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:11
ouch!
@Lia-Sue-Kim send link of html template
Christopher McCormack
@cmccormack
Nov 13 2018 15:11
We aren't all born with a silver bell on our collar like @diomed
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:12
lol . silver bell. lol lol lol
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:12
@diomed in'ta on my computer
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:12
zip it and send me the file. I'll tell you if it's good
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 15:12
t's *
lol
Christopher McCormack
@cmccormack
Nov 13 2018 15:13
@Lia-Sue-Kim you made your first sale!
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:14
:octocat:
Eric Weiss
@eweiss17
Nov 13 2018 15:16
@Lia-Sue-Kim you trying to sell your own framework?
May Kittens Devour Your Soul
@diomed
Nov 13 2018 15:18
why is you calling html template a framework?
have you guys seen this new revolutionary way of shaving
Christopher McCormack
@cmccormack
Nov 13 2018 15:24
ouch
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 13 2018 16:17
@cmccormack kind of
@eweiss17 not really I'm still in that step when you just print 'Hello world'
May Kittens Devour Your Soul
@diomed
Nov 13 2018 16:44
print ("reddit")
Aditya
@ezioda004
Nov 13 2018 16:46
Error only python 2 is supported
Kyle Holm
@thekholm80
Nov 13 2018 16:48
:point_up: November 13, 2018 9:46 AM i've had nightmares about that
Aditya
@ezioda004
Nov 13 2018 16:50
The easiest fix - switch to JS
May Kittens Devour Your Soul
@diomed
Nov 13 2018 16:50
in recent news : next seasons of Westworld delayed for 2025 until they build a new set xD
apparently, Anthony Hopkins burned it all down
Christopher McCormack
@cmccormack
Nov 13 2018 16:52
@ezioda004 I couldn't get the JAM thing running because Python 2
May Kittens Devour Your Soul
@diomed
Nov 13 2018 16:52

said:

I didnt like the scenery

Aditya
@ezioda004
Nov 13 2018 16:54
@diomed Probably a Vue fanboy, couldnt stand Westworld running on React
May Kittens Devour Your Soul
@diomed
Nov 13 2018 16:56
@ezioda004 we all saw how things end up, when running on React
Niraj Nandish
@Nirajn2311
Nov 13 2018 16:56
In 🔥 🔥
May Kittens Devour Your Soul
@diomed
Nov 13 2018 16:58
@Nirajn2311 pika! pika! pika!
Niraj Nandish
@Nirajn2311
Nov 13 2018 18:53
@diomed i am not a fan of anime or any japanese cartoon
May Kittens Devour Your Soul
@diomed
Nov 13 2018 18:56
@Nirajn2311 neither am I so much. but pikachu :interrobang:
Niraj Nandish
@Nirajn2311
Nov 13 2018 18:58
@diomed
let i = 0;
while(i > -1)
{
     brain.log(“Ill send the data later”);
}

@Nirajn2311 neither am I so much. but pikachu :interrobang:

Still not interested in it, toy story had a better one :yum:

idris
@idris12
Nov 13 2018 21:16
Hi whenever i run this code if the first condition is met it still runs the if statement rather than stopping because i used the && condition what am i doing wrong
triangle.PNG
Christopher McCormack
@cmccormack
Nov 13 2018 21:21
@idris12 you may need to expand on your question and your code sample a bit... && implies both conditions need to be true to run the code within the block
idris
@idris12
Nov 13 2018 21:23
@cmccormack ok
Joshua Arnett
@josha5
Nov 13 2018 21:25
Anyone know if you can load images outside of src directory in react?
idris
@idris12
Nov 13 2018 21:25
so i this image the value of base i wrote e
then the value of height i wrote 9
and it displayed this
triangle2.PNG
instead of an alert()
Christopher McCormack
@cmccormack
Nov 13 2018 21:29
@idris12
> typeof NaN
'number'
cleanse your inputs
idris
@idris12
Nov 13 2018 21:31
i dont understand can u give me example
Christopher McCormack
@cmccormack
Nov 13 2018 21:38
Which part don't you understand? I did give you an example
'e' is not a number so it's evaluating to NaN which is ironically of the number type
Maybe check instead if a variable is NaN using if( !Number.isNaN(base) && ... for example
Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 21:49
@cmccormack hi chris- do you what the % sign means in ie css ie
%seed {
    background: #f0f0f0;
    border-radius: 50%;
    height: 7px;
    width:20px;
    box-shadow:1px 2px brown;
}

.seeds {
    @extend %seed;
    transform:rotate(-10deg);
 position:absolute;
  left:190px;
  top:120px;
    }

}
Christopher McCormack
@cmccormack
Nov 13 2018 21:51
@flyfishingbarbara looks like Sass
Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 21:51
@cmccormack yep
I've not used it though
Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 21:52
@cmccormack k, thnx
Bjorn van de Peut
@bjorno43
Nov 13 2018 21:53
@flyfishingbarbara That's a placeholder selector. You can read more about it here: http://thesassway.com/intermediate/understanding-placeholder-selectors
Basicly they're used for selectors that are never directly used into your code and are only there to extend other selectors. They're just there for you to use when developing, but will be gone on the resulting CSS
Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 22:00
@bjorno43 so in layman's terms the placeholder with the percent sign has additional properties but wont show up in css
ahh you beat me to it...
yep! got it now...thnx
Bjorn van de Peut
@bjorno43
Nov 13 2018 22:03
:thumbsup:
Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 22:04
@bjorno43 im challening myself to the #codevember challenge and learning a lot with pure css images...
Bjorn van de Peut
@bjorno43
Nov 13 2018 22:12
@flyfishingbarbara Ah cool :) I'm challenging myself with developing a fully featured chatsystem :P
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Nov 13 2018 22:14

In the stock price checker project the first thing that the user story tells is that we need to set the content security policies to only allow loading of scripts and css from your server. So in the server.jsfile we need to add

  const helmet = require('helmet');
...
  app.use(helmet.contentSecurityPolicy({
  directives: {
    defaultSrc: ["'self'"],
    styleSrc: ["'self'"]
    // scriptSrc: ["'self'", 'jquery.com']
  }
}));

The problem is that it blocks the https://code.jquery.com/jquery-2.2.1.min.js. I tried to add the scriptSrc: ["'self'", 'jquery.com'] but it didn't work and I also tried to use nonce attribute but still the same. What is the best thing to do?

Barbara Pentoney
@flyfishingbarbara
Nov 13 2018 22:16
@bjorno43 :thumbsup:
idris
@idris12
Nov 13 2018 22:20
@cmccormack thanks for your help
Christopher McCormack
@cmccormack
Nov 13 2018 22:20
@idris12 np
dyon gerwen
@fullstackinprogress_gitlab
Nov 13 2018 22:53
can someone help me to give an example to write this code in a node module with module .exports and how i can use it in another file ?
passport.serializeUser((user, done) => {
    done(null, user.id);
});

passport.deserializeUser((id, done) => {
    User.findById(id).then((user) => {
        done(null, user);
    });
});
// set up session cookies
app.use(cookieSession({
    maxAge: 24 * 60 * 60 * 1000,
    keys: [keys.session.cookieKey]
}));
dyon gerwen
@fullstackinprogress_gitlab
Nov 13 2018 23:47
@Robert Nash @pdurbin you are for years the first that read all comments but never say something
485865905-1024x1024.jpg
still living ?