These are chat archives for FreeCodeCamp/Help

16th
Mar 2015
John Ellis
@johnmellis
Mar 16 2015 02:03
Anyone here good with directives?
Danny Fritz
@dannyfritz
Mar 16 2015 02:09
i'm good with vue.js directives. ;)
John Ellis
@johnmellis
Mar 16 2015 02:10
I created a local app that's asking the user to register an email using a password and a confirmed password
I'm trying to prevent the submit button from being enabled unless the two password fields match
I can get it to show the alert if pwd != pwd2
but can't figure out for the life of me how to make the whole form throw an error if they don't match
Suzanne Atkinson
@AdventureBear
Mar 16 2015 04:07
How do I deploy a MEAN stack locally to heroku? I created the remote repo and deployed it but it looks like I need to most my mongo somewhere. Can this be done for free on heroku or do I need to use a service? @terakilobyte ? @crisberrios ? @QuincyLarson ?
Cristián Berríos
@crisberrios
Mar 16 2015 04:09
get a free mongo account at mongolabs
if you want to add it directly from heroku you need to add payment info (still free) but you can do it manually
database access shouldn't be hard-coded in the app but configured by adding enviroment variables in your heroku account
Suzanne Atkinson
@AdventureBear
Mar 16 2015 04:10
ah..OK. I tried a command line for what looked like a free versoin, but it did ask for payment info
I'll take care of that tomorrow.
thanks.
Cristián Berríos
@crisberrios
Mar 16 2015 04:10
yw :)
Suzanne Atkinson
@AdventureBear
Mar 16 2015 04:11
since it's mongo (and not mysql) once i've enabled it, the js code will automatically create it right? that's what happened on my local machine
time for bed, chat tomorrow I'm sure!
Cristián Berríos
@crisberrios
Mar 16 2015 04:13
yes, it will automatically create it
Julie Myers
@BlueOceanView
Mar 16 2015 04:16
This message was deleted
Paul C
@realPaulC
Mar 16 2015 14:50
Hi guys- I am up to challenge 36 (Get Started with Node.js) and feel like the subject matter is a bit over my head. I would like to continue working on bonfires but I find it very difficult to pair (not enough people trying to pair). I feel a bit stuck at this point. What do you suggest? I have completed about 7 or 8 bonfires on my own (not pairing).
MychaelZ
@MychaelZ
Mar 16 2015 14:53
How about just doing the bonfires yourself?
Ashley Drake
@aldraco
Mar 16 2015 14:54
@pcigolini node was a big jump for me too, but if it makes you feel more confident, i love it now. just took some work to really understand it.
Paul C
@realPaulC
Mar 16 2015 14:54
I wondered about that myself but hesitate to do them all on my own given the amount of emphasis freeCodeCamp puts on pairing
Ashley Drake
@aldraco
Mar 16 2015 14:54
you also might find more pair partners later in the day
Paul C
@realPaulC
Mar 16 2015 14:55
i tried all last week, aldraco. all different times of day, and didnt pair once
thanks for this input. i am pretty comfortable tacking the bonfires on my own
Ashley Drake
@aldraco
Mar 16 2015 14:56
that's what i did mostly
i had some trouble finding pairs as well
i tend to work more on FCC in the mornings :)
MychaelZ
@MychaelZ
Mar 16 2015 14:56
you can always post a problem on here if you need help with anything
Paul C
@realPaulC
Mar 16 2015 14:57
yeah. it would be good to see how other people solve the bonfires
Ashley Drake
@aldraco
Mar 16 2015 14:57
have you watched the twitch stream at all?
Paul C
@realPaulC
Mar 16 2015 14:57
the other day i solved one with about 10 lines and someone showed me how to do it with two
@aldraco im not familiar with the twitch stream
MychaelZ
@MychaelZ
Mar 16 2015 14:58
i've done most of the bonfires with one line
lol
Paul C
@realPaulC
Mar 16 2015 15:00
yeah, see im not there yet
takes me 5 or 6 at least most of the time
MychaelZ
@MychaelZ
Mar 16 2015 15:00
its alright it took me almost a year to get there
Paul C
@realPaulC
Mar 16 2015 15:00
i guess i was looking for FCC to be more of a one-stop-shop
you can watch other people code. They have a wide variety of stuff, from working on the website to watching people do bonfires.
if you can't find people to pair this is a pretty good substitute/supplement
Paul C
@realPaulC
Mar 16 2015 15:01
@aldraco thanks this is great
Ashley Drake
@aldraco
Mar 16 2015 15:02
np!
i think FCC is meant to be a one-stop shop in terms of providing guidance and resources, but a lot of your success depends on what you do with them. The biggest benefit, IMHO, is the opportunity to do the non profit projects. For someone like me, I really need things on my portfolio to get a job. That's huge.
plus it's extremely new so they're constnatly adding stuff
Bogdan
@pbogdan03
Mar 16 2015 18:31
hello
does anybody have the virtual box image cause the torrent isn't working
Oliver
@Dadsaster
Mar 16 2015 18:36
what is your OS?
Danny Fritz
@dannyfritz
Mar 16 2015 18:46
@pbogdan03 the magnet torrent link doesn't even seem to resolve for me
Yosi
@jparkton
Mar 16 2015 18:47
that might be something they should keep in the repos
might be too large though
maybe a dropbox?
Bogdan
@pbogdan03
Mar 16 2015 18:48
yeah same here... i've got some answers on nonprofitprojects gitter that i should set up the environment myself on windows
Evan Davis
@davisec52
Mar 16 2015 18:50
Say, I am working on the sum of all primes bonfires challenge
and don't understand why my solution below is failing. It appears
to list and sum the primes correctly but nevertheless fails.

var numList = [];
function sumPrimes(num) {
    function primeNum(num) {
        if(num < 2) return false;
        for(var i = 2; i < num && primeNum; i++) {
            if(num % i === 0) {
                return false;
            }
        }
        return true;
    }
    for(var i = 0; i <= num; i++) {
        if(primeNum(i)) {
            numList.push(i);
        }
    }
    return numList.reduce(function(a, b) {return a + b;});
}
sumPrimes(977); //73156
Bogdan
@pbogdan03
Mar 16 2015 18:53
what's the failed test?
Evan Davis
@davisec52
Mar 16 2015 18:53
@pbogdan03 moment and I'll paste them in

expect(sumPrimes(977)).to.equal(73156);AssertionError:expected 146312 to equal 73156
expect(sumPrimes(10)).to.equal(17);AssertionError:expected 73173 to equal 17
Bogdan
@pbogdan03
Mar 16 2015 18:55
i'm not familiar with the i < num && primeNum in the for loop
Oliver
@Dadsaster
Mar 16 2015 18:56
Are you sure you pasted your code into the challenge correctly? It is returning the correct results for me in all "failed" instances you posted.
Evan Davis
@davisec52
Mar 16 2015 18:56
@Dadsaster Cool! I'll check again.
Bogdan
@pbogdan03
Mar 16 2015 18:57
but why are you setting the for loop condition to i < primeNum ?
primeNum is a function
Evan Davis
@davisec52
Mar 16 2015 18:58
@pbogdan03 I am a javascript infant. I was trying to set up a boolean to sort primes from nonprimes and this seemed to work.
MychaelZ
@MychaelZ
Mar 16 2015 18:59
yeah the problem is the condition in the for loop
you are checking i < num && primeNum
the primeNum part doesn't really make sense in this case because it is just a function
Bogdan
@pbogdan03
Mar 16 2015 19:00
yep, me too :)) I thought it was something I haven't seen till now
I think it will work without the primeNum error, you can check only for i < num
Evan Davis
@davisec52
Mar 16 2015 19:01
@MychaelZ @pbogdan03 Ok, thanks--I'll tinker with it.
Oliver
@Dadsaster
Mar 16 2015 19:01
That && primeNum isn't effecting the output in any way
you can just delete it
MychaelZ
@MychaelZ
Mar 16 2015 19:02
I'm still looking into it
@davisec52 does that make sense though?
Evan Davis
@davisec52
Mar 16 2015 19:02
@MychaelZ @Dadsaster yes, it does make sense. Just deleted it.
The function still seems to give the right output in repl.it.
perhaps there is some underlying funkyness that's disturbing the bonfires system.
Oliver
@Dadsaster
Mar 16 2015 19:03
agreed - the output is correct both with and without that bit of code
MychaelZ
@MychaelZ
Mar 16 2015 19:03
its working?
Evan Davis
@davisec52
Mar 16 2015 19:04
@MychaelZ Strangely, yes, at least in repl.it.
MychaelZ
@MychaelZ
Mar 16 2015 19:04
refresh the bonfire page
if its not working there
Oliver
@Dadsaster
Mar 16 2015 19:05
what browser are you using?
Evan Davis
@davisec52
Mar 16 2015 19:05
Still erroring for me. Using chrome, current version.
If it is working for you, then there may be some idiosyncratic interaction between my system and the bonfires test page.
Evan Davis
@davisec52
Mar 16 2015 19:16
@Dadsaster @MychaelZ It is now passing. The problem was that I had put numList outside the function. Relocating numList within the scope of sumPrimes solved the immediate problem.