These are chat archives for FreeCodeCamp/Help

1st
Apr 2015
Ryan Malm
@Rybar
Apr 01 2015 01:55
What's best practice for storing sensitive application data (Mandrill auth, API keys, etc) and accessing it?
storbeck
@storbeck
Apr 01 2015 02:51
salt and encrypt in a db
Cristián Berríos
@crisberrios
Apr 01 2015 02:55
enviroment variables
Jimmy Bryant II
@JimBry
Apr 01 2015 14:47
Does anyone mind inviting me to screenhero like it says here? http://blog.screenhero.com/post/110852538851/already-a-screenhero-user-heres-how-to-invite
Jimmy Bryant II
@JimBry
Apr 01 2015 15:01
Thanks! @AmmarAliShah
Victor Ghebre
@VictorGhebre
Apr 01 2015 16:55
Hi
function repeat(str, num) {
    if (num < 1) return '';
    var result = '';
    while (num > 1) {
        if (num & 1) result += str;
        num >>= 1, str += str;
    }
    return result + str;
}

repeat('abc', 3);
For the code above can someone explain what the following mean if(num & 1) & num >>= 1 please?
It's code that I found and adjusted to work for one of the bonfires. But I would like to under the two lines of code mentioned above before moving onto the next challenge.
*understand
Cristián Berríos
@crisberrios
Apr 01 2015 17:14
hi @VictorGhebre
Victor Ghebre
@VictorGhebre
Apr 01 2015 17:29
@crisberrios Thanks
Catalin Iosif
@ciosifweb
Apr 01 2015 17:30

Hello,
I finished a bonfire that required me to return the first element of an array that passed a test ( a function reference in the second argument). I used this:

function find(arr, func) {
  for (var i = 0; i < arr.length; i++) {
    if (func(arr[i])) {
      return arr[i];
    }
  }
}

I saw that Array.some() was specified in the recommended links section. Is there a better way of doing it, using that method?

Cristián Berríos
@crisberrios
Apr 01 2015 17:37
I think some returns only true or false
you are required to return the item which returns true right?
return arr.filter(function(i) { return func(i) })[0];
maybe something like that? but tests all the array so it can be potentially much slower
Catalin Iosif
@ciosifweb
Apr 01 2015 17:45
@crisberrios yeah, I have to return the element, not just the index
Cristián Berríos
@crisberrios
Apr 01 2015 17:46
your solution looks good and straightforward
Catalin Iosif
@ciosifweb
Apr 01 2015 17:47
thanks for the alternate solution
I can see a lot of uses for it in actual apps
I didn't get to use filter until now
I'll give it a deeper look
Cristián Berríos
@crisberrios
Apr 01 2015 17:49
when you finish the bonfires, or even before you continue, take a look at nodeschool's functional programming tutorial or http://jhusain.github.io/learnrx/ this one
it really enlightens you in how to use map/filter/reduce
Jon Lucas
@jonslucas
Apr 01 2015 17:50
Great link @crisberrios
definitely saving that for further inspection
Catalin Iosif
@ciosifweb
Apr 01 2015 17:52
yeah, looks awesome
YallaPapi
@YallaPapi
Apr 01 2015 21:54
so, i was under the impression that FCC matches you with nonprofits after you are done with the challenges.. am i wrong about that?
Julie Myers
@BlueOceanView
Apr 01 2015 21:54
@YallaPapi You are correct. Did you finish both the challenges and the bonfires?
YallaPapi
@YallaPapi
Apr 01 2015 21:54
lol wait nevermind I figured it out.. finished the challenges, working through the bonfires now
Darryl Dixon - Piece Digital
@piecedigital
Apr 01 2015 21:56
@YallaPapi There is a wait time, however. Matching campers up with non-profit project is a manual task, and a lengthy at that due to many factors.
YallaPapi
@YallaPapi
Apr 01 2015 21:58
hmm.. so i'm better off doing something else you're saying
Darryl Dixon - Piece Digital
@piecedigital
Apr 01 2015 22:01
I encourage you to get involved with a new or existing camper practice projects. We're aware of the long wait times and because of that many campers have taken it upon themselves to work on practice projects while they wait for a non-profit project. This is a good wait to increase your knowledge and improve your skills while you wait.
YallaPapi
@YallaPapi
Apr 01 2015 22:02
honestly.. i just want to start doing something. learning is great, but i don't think going through a bunch of exercises over and over is going to do the trick
i'll figure something out
Darryl Dixon - Piece Digital
@piecedigital
Apr 01 2015 22:03
That's precisely what the camper practice projects movement was aimed to solve. We have started creating real things on our own to truly apply and increase our knowledge and skill.
Darryl Dixon - Piece Digital
@piecedigital
Apr 01 2015 22:19
That's how it is sometimes LOL
Christopher Nguyen
@crosscris
Apr 01 2015 22:59
I wish I looked that good when I'm stuck
Suzanne Atkinson
@AdventureBear
Apr 01 2015 23:11
@YallaPapi a lot of us are in the same boat. Working on "practice projects". I'm just thinking of ideas i've wanted to implement and trying to do them. My backgammon game for example.
http://codepen.io/AdventureBear/pen/wBNaBP I have the front end sorted now, now I'll start working on the JS backend adn game play part of it. That's just one idea.
Cristián Berríos
@crisberrios
Apr 01 2015 23:16
check the board, it's not perfect on the right side
Harshal
@McQuinTrix
Apr 01 2015 23:17
@crisberrios hey how do i get started with MongoDB ?:)
(:
Cristián Berríos
@crisberrios
Apr 01 2015 23:18
you should've been already started with the MongoDB challenge
Harshal
@McQuinTrix
Apr 01 2015 23:18
did not understand ):
Cristián Berríos
@crisberrios
Apr 01 2015 23:18
apart from that, I've only followed disperse tutorials and now I'm doing Mongo University course
there are many courses and books available though
do you have access to pluralsight, treehouse or tutsplus?
Harshal
@McQuinTrix
Apr 01 2015 23:19
are they all paid ?
Cristián Berríos
@crisberrios
Apr 01 2015 23:20
yes, but I think there are deals for students
Harshal
@McQuinTrix
Apr 01 2015 23:20
which one you recommend ?
(:
Cristián Berríos
@crisberrios
Apr 01 2015 23:20
if not, just search around, you'll likely find many video courses
Mongo University videos are all on youtube
hmm I think for intermediate and some advanced courses the best is Pluralsight
for basic and some intermediate the best is Treehouse
but I went with tutsplus because I got a 75% off coupon and it has some courses I couldn't find anywhere else
so $45 for 1 year was a really good deal
Harshal
@McQuinTrix
Apr 01 2015 23:22
thats cool rreally .. i saw MongoDb university .. and it has courses for Node.Js, Java
which one is for us ?
Cristián Berríos
@crisberrios
Apr 01 2015 23:22
node.js
it already started
we're on week 3 right now
Harshal
@McQuinTrix
Apr 01 2015 23:23
oh ): .. let me see if i can find something outside
Cristián Berríos
@crisberrios
Apr 01 2015 23:23
you'll find many resources and books
just choose what you like more :)
Harshal
@McQuinTrix
Apr 01 2015 23:24
alright .. thank you (: