These are chat archives for FreeCodeCamp/Help

4th
Feb 2015
Avremel Kaminetzky
@avremel
Feb 04 2015 02:19 UTC
Do I really need to go thru all chrome dev tools at such an early stage? besides, the interface is TERRIBLY buggy...
Branden Byers
@brandenbyers
Feb 04 2015 02:20 UTC
@avremel What bugs are you running into?
cameronchong
@cameronchong
Feb 04 2015 02:21 UTC
@avremel I did, it doesn't take that long. Yeah it is buggy but just do what you can.
Avremel Kaminetzky
@avremel
Feb 04 2015 02:21 UTC
1) challenges being automatically completed upon loading 2) not responding to some edits in console/dev tools...
Branden Byers
@brandenbyers
Feb 04 2015 02:22 UTC
oh, you mean the Codeschool aspect is buggy?
Avremel Kaminetzky
@avremel
Feb 04 2015 02:22 UTC
yeah
Branden Byers
@brandenbyers
Feb 04 2015 02:22 UTC
Even though it isn’t the best experience, getting a good foundation in Chrome Dev Tools is going to help a lot once you get further into development.
Avremel Kaminetzky
@avremel
Feb 04 2015 02:23 UTC
i feel inundated :)
Branden Byers
@brandenbyers
Feb 04 2015 02:23 UTC
Don’t get hung up on the codeschool bugginess though.
Avremel Kaminetzky
@avremel
Feb 04 2015 02:23 UTC
thanks i shall recover
Branden Byers
@brandenbyers
Feb 04 2015 02:23 UTC
If it isn’t responding to edits and you get the basic idea, just skip along if you have to.
The content in the codeschool dev tools is what is most important, not whether or not you can get the extension to interact correctly with codeschool!
Avremel Kaminetzky
@avremel
Feb 04 2015 02:26 UTC
btw how many FCC conversations/chatrooms are there here. I know of FCC, FCC/help and FCC/letspair
Branden Byers
@brandenbyers
Feb 04 2015 02:26 UTC
You’ve got them covered. That’s it.
cameronchong
@cameronchong
Feb 04 2015 02:26 UTC
Dunno, they have one for the projects
Avremel Kaminetzky
@avremel
Feb 04 2015 02:26 UTC
great
cameronchong
@cameronchong
Feb 04 2015 02:26 UTC
They also have a private room for the FCC devs
Avremel Kaminetzky
@avremel
Feb 04 2015 02:27 UTC
projects are after completion of all the challenges?
Branden Byers
@brandenbyers
Feb 04 2015 02:27 UTC
@cameronchong very true. We just keep that one for the volunteer camp counselors though.
cameronchong
@cameronchong
Feb 04 2015 02:28 UTC
@avremel Yep
Branden Byers
@brandenbyers
Feb 04 2015 02:28 UTC
@avremel The nonprofit projects start after completion of all of the challenges. Then there are trello boards and other ways that the project is tracked.
Avremel Kaminetzky
@avremel
Feb 04 2015 02:30 UTC
is there a simple way to chat with others going through the same challenges?
Branden Byers
@brandenbyers
Feb 04 2015 02:31 UTC
@avremel There will be a better way soon. Not chat; but we’re about to revamp the FCC Forum and will include a good section and threads for all of the challenges.
Everyone goes at different paces, that the general FCC chat or this help area are the best place to go for help.
Avremel Kaminetzky
@avremel
Feb 04 2015 02:33 UTC
ok great, long road ahead..
Branden Byers
@brandenbyers
Feb 04 2015 02:34 UTC
It may come along faster than you think. How much time are you able to put into the challenges each week?
Avremel Kaminetzky
@avremel
Feb 04 2015 02:34 UTC
right now I try to get in 3 hours a day
2-3 challenges a day
Branden Byers
@brandenbyers
Feb 04 2015 02:36 UTC
So about 20 hours a week? You’ll be done with the 100 hours of challenges in no time. And at that pace you’ll be done with the additional 900 hours of nonprofit work in less than a year!
Avremel Kaminetzky
@avremel
Feb 04 2015 02:37 UTC
900 is the magic number!!!
I hope I get there...
Branden Byers
@brandenbyers
Feb 04 2015 02:39 UTC
If you put in the time, you will. There is plenty of support here to help you through.
Ammar Ali Shah
@AmmarAliShah
Feb 04 2015 11:42 UTC
Anyone available to help me understand something in Python 2?
Bastian B.
@DeXtr0niC
Feb 04 2015 17:58 UTC
Oh my god, I am about to dispair on the Bonfire http://www.freecodecamp.com/bonfires/sum-all-odd-fibonacci-numbers
anyone can help me find my error in my code?
function sumFibs(num) {
  //Initialize variables
  var fibs = [0,1];
  var oddIndex = [0,1];
  var tmp = 0;
  var sum = 0;
  var index = 0;
  //Create Fibonacci Number and checks if odd. Saves oddIndex.
  for(var i = 1; i <=num; i++){
    tmp = fibs[i]+fibs[i-1];
    if(tmp%2!==0){
      oddIndex.push(i+1);
    }
    fibs.push(tmp);
  }
  //Sum odd Fibonacci Numbers 
  for(var j = 0; j<oddIndex.length; j++){
 index = oddIndex[j];
    sum += fibs[index];
  }
  return sum;
}

sumFibs(6);
the first three test are passing. the test for bigger numbers fail.
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:02 UTC
Double check what you're pushing onto oddIndex
Cristián Berríos
@crisberrios
Feb 04 2015 18:02 UTC
oddIndex.push(i+1); <--- not a fibonacci number
Bastian B.
@DeXtr0niC
Feb 04 2015 18:03 UTC
nono, i know. i want to save the index of each fib number in that array
Cristián Berríos
@crisberrios
Feb 04 2015 18:04 UTC
why not summing right there if it's an odd number
Anyways, double check the tests, I've heard many people complaining about that bonfire, don't know if they changed the instructions or fixed the tests.
Bastian B.
@DeXtr0niC
Feb 04 2015 18:06 UTC
mh ok...
Banun Idris
@mininsomniac
Feb 04 2015 18:06 UTC
I havent beel able to get past that bonfire either @DeXtr0niC
I either pass the larger numbers test or the smaller ones
=/
*been
Bastian B.
@DeXtr0niC
Feb 04 2015 18:06 UTC
yeah i had a chat with Nathan about this yesterday. He says it`s working as intended
Banun Idris
@mininsomniac
Feb 04 2015 18:07 UTC
hmm
then i'll have to revisit it
Cristián Berríos
@crisberrios
Feb 04 2015 18:07 UTC
@DeXtr0niC can you print your fibs and oddindex arrays for a given input? let's say 100
Bastian B.
@DeXtr0niC
Feb 04 2015 18:08 UTC
no then it crashes. Because the tests will fire in big numbers anyway
had this problem yesterday
Cristián Berríos
@crisberrios
Feb 04 2015 18:08 UTC
also
take into consideration that fib series is 0,1,1,2,3.... (2 1's at start)
Bastian B.
@DeXtr0niC
Feb 04 2015 18:09 UTC
yeah i have. my "fib-factory" is running right
Cristián Berríos
@crisberrios
Feb 04 2015 18:09 UTC
I think it's taken into account but many failed at that
:P
anyways, I find the 2nd loop unnecessary
you could just sum right away
also omitting the index array
Bastian B.
@DeXtr0niC
Feb 04 2015 18:11 UTC
Let`s see if i can get rid of this
function sumFibs(num) {
  //Initialize variables
  var fibs = [0,1];

  var tmp = 0;
  var sum = 1;


  //Create Fibonacci Number and checks if odd. 
  for(var i = 1; i <=num; i++){
    tmp = fibs[i]+fibs[i-1];

    if(tmp%2!==0){
    sum += tmp;    
    }
    fibs.push(tmp);
  }

  return sum;
}

sumFibs(4);
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:16 UTC
...now I am confused
cause I got something to pass the unit test for that
but I had to kludge it
Banun Idris
@mininsomniac
Feb 04 2015 18:17 UTC
what is kludge @alicekamada
oh nevermind i googled it :sweat_smile:
Cristián Berríos
@crisberrios
Feb 04 2015 18:18 UTC
duh
just read the instructions
you got it wrong
fibs are up to passed number
not first N numbers
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:19 UTC
no, the test have the wrong values
Bastian B.
@DeXtr0niC
Feb 04 2015 18:19 UTC
but it expects 10 when you insert 4
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:19 UTC
I just did the calculations
Bastian B.
@DeXtr0niC
Feb 04 2015 18:20 UTC
when it would be "up to" then it would expect 0+1+1+3 = 5
^ @crisberrios
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:20 UTC
the more info box specifies the extra one is out
so whatever algorithm calculated the test values added the last Fibonacci number under the ceiling into the total twice
plus the extra leading one, which shouldn't be there
Bastian B.
@DeXtr0niC
Feb 04 2015 18:22 UTC
ahhhh
so i can`t solve it ^^
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:23 UTC
You probably have solved it.
Bastian B.
@DeXtr0niC
Feb 04 2015 18:23 UTC
or i could do what the algo does, too. It would pass the tests i guess^^
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:23 UTC
Just can't pass the tests unless you account for the mistakes
Bastian B.
@DeXtr0niC
Feb 04 2015 18:24 UTC
strange, yesterday Nathan said the bonfire is working as intended ... :-/
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:24 UTC
The bonfire, maybe.
Bastian B.
@DeXtr0niC
Feb 04 2015 18:24 UTC
and the challenge^^
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:24 UTC
The testing for that particular challenge, no.
Bastian B.
@DeXtr0niC
Feb 04 2015 18:24 UTC
thanks @alicekamada
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:25 UTC
NP, anyone know where I put the bug report?
Harry Karapetyan
@hk99
Feb 04 2015 18:26 UTC
I don't think its a testing issue
its more of directions not clear issue
it took me a while to get it but this was my solution
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:28 UTC
Definitely wrong values in the testing suite
Harry Karapetyan
@hk99
Feb 04 2015 18:30 UTC
function sumFibs(num) {
  //Initialize variables
  var fibs = [0,1];

  var tmp = 0;
  var sum = 1;


  //Create Fibonacci Number and checks if odd. 
  for(var i = 1; i <=num; i++){
    tmp = fibs[i]+fibs[i-1];

    if(tmp%2!==0){
    sum += tmp;    
    }
    if(tmp >= num){
        return sum
    }
    fibs.push(tmp);
  }
}
You can open issue through github
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:32 UTC
It's not the Fib under ceiling, it's the Fib right over ceiling
@hk99 Let me try running this. Looking at it, it should never go past 1.
Harry Karapetyan
@hk99
Feb 04 2015 18:33 UTC
What do you mean?
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:34 UTC
wait, nevermind
I misread
Bastian B.
@DeXtr0niC
Feb 04 2015 18:36 UTC
well... your solution works, but i don`t know exactly why... @hk99
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:36 UTC
I see it now
Cristián Berríos
@crisberrios
Feb 04 2015 18:36 UTC
@DeXtr0niC
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:37 UTC
@hk99 Add a console.log(tmp); right above your return statement
Bastian B.
@DeXtr0niC
Feb 04 2015 18:37 UTC
you sum it up. then you check if the last fibonacci number is greater than your passed one. so you are summing the one above your passed number, too
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:37 UTC
and you'll see the issue
Cristián Berríos
@crisberrios
Feb 04 2015 18:37 UTC
^ that
Bastian B.
@DeXtr0niC
Feb 04 2015 18:38 UTC
i think it`s just not clear from the task. Or it is simply wrong^^ should be reviewed
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:38 UTC
I'll talk to @terakilobyte next time he's on
Cristián Berríos
@crisberrios
Feb 04 2015 18:38 UTC
it's a mix of 1st N fibs + fibs up to N
2 conditions
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:39 UTC
@crisberrios That is definitely not what the instructions say
Cristián Berríos
@crisberrios
Feb 04 2015 18:40 UTC
Also.... tmp can be > num
so instructions are all wrong
Bastian B.
@DeXtr0niC
Feb 04 2015 18:40 UTC
thanks everyone :)
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:40 UTC
Mathwise, we're using a filtering function on a series, then summing the series.
@DeXtr0niC No problem, figuring out stuff like this is fun for me.
Bastian B.
@DeXtr0niC
Feb 04 2015 18:45 UTC
@alicekamada nice to hear haha. it`s not for me :D
but that`s why we are a community, right? :)
Cassandra Cruz
@lambdatastic
Feb 04 2015 18:46 UTC
Yup
Nathan
@terakilobyte
Feb 04 2015 19:59 UTC
I see the issues with the fib challenge, I'll be changing the description shortly
Nathan
@terakilobyte
Feb 04 2015 20:30 UTC
the fibonacci problem had the right values in the testing suite but the wrong description
I've changed the testing suite to match the description
they'll take hold shortly
hang tight!
Nathan
@terakilobyte
Feb 04 2015 20:38 UTC
build pushed
challenge fixed
Merlot Code
@MerlotCode
Feb 04 2015 20:40 UTC
thanks tkb
Nathan
@terakilobyte
Feb 04 2015 20:48 UTC
np
the description should now be inline with the updated tests
let me know if there are any more difficulties
Evan Davis
@davisec52
Feb 04 2015 20:52 UTC

Quick question here.

I have two statments that are intended to accomplish the same purpose.

I'm not getting why sample 1 returns a full string and sample 2 returns am error. (If I put a return in either of the if statements, it returns the first letter of the string.)


function swap(str) {
    var list = "";
    for(var i = 0; i < str.length; i++) {
        if(str.charAt(i).match(/[A-Z]/g)) {
            list += str[i].toLowerCase();
            //list[i].toLowerCase();
        }
        if(str.charAt(i).match(/[a-z]/g)) {
            list += str[i].toUpperCase();
        }
    }
    return list;
}
swap("The");

function swap(str) {
    var list = "";

    for(var i = 0; i < str.length; i++) {
        if(str[i].charCodeAt() >= 65 || str[i].charcodeAt() <= 90) {
            list += String.fromCharCode(str[i].charCodeAt(0) + 32);
        }
        if(str[i].charCodeAt() >= 97 || str[i].charcodeAt() <= 122) {
            list += String.fromCharCode(str[i].charCodeAt(0) - 32);
        }
    }
    return list;
}
swap("The");
Ben Clist
@BenClist
Feb 04 2015 20:56 UTC
@davisec52 you're not using charCodeAt correctly
Evan Davis
@davisec52
Feb 04 2015 20:57 UTC
@BenClist Thank you. Could you explain?
@BenClist Never mind. Thanks. Just slap me.
Ben Clist
@BenClist
Feb 04 2015 21:01 UTC
haha no worries
you need to give it a number ;)
Evan Davis
@davisec52
Feb 04 2015 21:03 UTC
Jeez!
Ben Clist
@BenClist
Feb 04 2015 21:04 UTC

By the way

str.charCodeAt(i);

is going to be more efficient than

str[i].charCodeAt(0);
Evan Davis
@davisec52
Feb 04 2015 21:07 UTC
Right. Thank you.