These are chat archives for FreeCodeCamp/Help

5th
Aug 2015
Johnathan Brown
@Legend28469
Aug 05 2015 00:00 UTC
@gibsonio I think str.repeat is too new. I haven’t even heard of it until now. It’s probably a support thing.
Juan Martínez
@jbmartinez
Aug 05 2015 00:00 UTC
@abbynormative just the same way "\" have a special use in regular expressions and you have to write it as "\" to escape it
Johnathan Brown
@Legend28469
Aug 05 2015 00:01 UTC
@gibsonio I’ll just say this. You can add a string to a string (literally)
Juan Martínez
@jbmartinez
Aug 05 2015 00:02 UTC
@gibsonio you can solve that bonfire without recursion
Heather Akers-Healy
@abbynormative
Aug 05 2015 00:02 UTC
@jbmartinez very confused. i thought that's what i had done with my code. for example if you look at the second argument in replace i'm using "\". i think this exercise desperately needs a written example to make it clearer.
Juan Martínez
@jbmartinez
Aug 05 2015 00:05 UTC
@abbynormative in that bonfire you only need to replace & with &, > with > and so on
Heather Akers-Healy
@abbynormative
Aug 05 2015 00:05 UTC
@jbmartinez these are the results when i do that: "should escape characters: expected 'Dolce & Gabbana' to equal 'Dolce & Gabbana'"
Juan Martínez
@jbmartinez
Aug 05 2015 00:06 UTC
@abbynormative there are different ways to escape characters depending on what are you working with. That's the way to escape html
@abbynormative 'Dolce & Gabbana' should be the result
Sean Davis
@Fridurmus
Aug 05 2015 00:10 UTC
http://www.freecodecamp.com/challenges/waypoint-get-set-for-basejumps for this waypoint, I'm being asked in the terminal: ? Would you like to use Javascript ES6 in your client by preprocessing it with Babel? (Y/n) and I'm not sure what to answer
Bill
@kirah1314
Aug 05 2015 00:10 UTC
@abbynormative that bonfire is confusing though. They really should add an example like & should be &amp...
Heather Akers-Healy
@abbynormative
Aug 05 2015 00:12 UTC
@kirah1314 right. because their test results don't list it that way.
Bill
@kirah1314
Aug 05 2015 00:14 UTC
exactly, but I'm sure we'll make improvements as time goes on
gazzer82
@gazzer82
Aug 05 2015 00:23 UTC
Hello all, anybody else struggling to understand what you're being asked to do on 'Practice Functional Programming?'
Really making my head hurt . . .
Ana U
@annaurib3
Aug 05 2015 00:26 UTC
Hi, do you guys know another way to solve Bonfire: Sum All Numbers in a Range? I got

function sumAll(arr) {
var sumTotal = 0;
var maxNum = Math.max.apply(null, arr);
var minNum = Math.min.apply(null, arr);
for(var i = minNum; i <= maxNum; i++){
sumTotal += i;
}
return sumTotal;
}

sumAll([1, 4]);

but i didn't use the reduce function they suggest.
hey @annaurib3
explain format
CamperBot
@camperbot
Aug 05 2015 00:28 UTC
no wiki entry for: @format
:pencil: click here to create one now!after creating your page type update to reload it here
explain format
CamperBot
@camperbot
Aug 05 2015 00:28 UTC

:pencil: code formatting [edit]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Ana U
@annaurib3
Aug 05 2015 00:30 UTC

'''
function sumAll(arr) {
var sumTotal = 0;
var maxNum = Math.max.apply(null, arr);
var minNum = Math.min.apply(null, arr);
for(var i = minNum; i <= maxNum; i++){
sumTotal += i;
}
return sumTotal;
}

sumAll([1, 4]);
'''

function sumAll(arr) {
  var sumTotal = 0;
  var maxNum = Math.max.apply(null, arr);
  var minNum = Math.min.apply(null, arr);
  for(var i = minNum; i <= maxNum; i++){
    sumTotal += i;
  }
  return sumTotal;
}


sumAll([1, 4]);
ctcrnitv
@ctcrnitv
Aug 05 2015 00:31 UTC
I have a question about this tutorial http://jhusain.github.io/learnrx/
for me #16 “Implement reduce()” was already completed when I got to it
just wondering if anyone knew whether that was intentional
gazzer82
@gazzer82
Aug 05 2015 00:33 UTC
Anyone got a suggestion for somewhere else i can read up on functional javascript programming as 'Practice Functional Programming' is confusing the heck out of me?
Or practice for that matter.
Ben
@benflinn
Aug 05 2015 00:33 UTC
@gazzer82 i tried that challenge over and over....... very demoralizing
@gazzer82 i did get about 20% of it though after two tries
explain higher order
@gazzer82 i found his videos fun and watchable
AJ Gibson
@gibsonio
Aug 05 2015 00:34 UTC
@Legend28469 @jbmartinez thx guys. i figured it out :)
but FCC for sure needs better material on this
gazzer82
@gazzer82
Aug 05 2015 00:34 UTC
@benflinn i really thought i was getting somewhere, but i now feel like i'm back at square 1.
@dcsan thanks, i'll check it out! Just missing that Ah Ha moment i think.
or you could mess around with lodash/underscore and go through each of the functions there
if you use ES6 there's a few more map/filter/reduce things to play with
gazzer82
@gazzer82
Aug 05 2015 00:36 UTC
Doesn't help that concatAll and various other things don't appear to be standard functions, so i can't just drop the code into Code9 and mess about, set breakpoint, log stuff. Which is how i normally figure this sort of stuff out.
explain filter
CamperBot
@camperbot
Aug 05 2015 00:36 UTC

:pencil: js filter [edit]

The filter() method creates a new array with all elements that pass the test implemented by the provided function

arr.filter(callback[, thisArg])
Parameter
Required Arr
Required callback (function with max 3 args)
Optional thisArg

Return: A new array that contains all the values for which the callback function returns true. If the callback function returns false for all elements of array1, the length of the new array is 0.

MDN link | MSDN link

:pencil: read more about js filter on the FCC Wiki

there are some examples on that page too
Jason Arnold
@thejasonfile
Aug 05 2015 00:37 UTC
should we still use screenhero for pair programming? I just tried to sign up and it says it is closed to new accounts.
gazzer82
@gazzer82
Aug 05 2015 00:37 UTC
I actually get filter and concat e.t.c on there own, i've been using them in the bonfires quite a lot, but these challenges just seem to dump you in the middle of nowhere and tell you to get on with it.
i'm just not getting how they come together, plus the function chaining in the answer code makes things even more confusing to work out what's actually going on.
yeah that content gets a lot of criticism. there's an issue on it already
at some point FCC need to switch it out
search GH issues someone mentioned a couple other tuts+ things
gazzer82
@gazzer82
Aug 05 2015 00:40 UTC
ok will take a look at the GH issue, reassuring to know it's not just me. I'll keep hammering away at some other sources and come back to it i think, hopefully then it'll click.
Thanks @dcsan
CamperBot
@camperbot
Aug 05 2015 00:40 UTC
gazzer82 sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 29 | @dcsan | http://www.freecodecamp.com/dcsan
Alan Savage
@asavage111
Aug 05 2015 00:42 UTC
How do I include a screen shot here?
Rex Schrader
@SaintPeter
Aug 05 2015 00:43 UTC
Just paste it in
Use something like the snipping tool on windows and just ctrl-v paste
Alan Savage
@asavage111
Aug 05 2015 00:44 UTC
blob
it shows up really small
Rex Schrader
@SaintPeter
Aug 05 2015 00:44 UTC
If you want to paste code use this:
wiki format
CamperBot
@camperbot
Aug 05 2015 00:44 UTC

:pencil: code formatting [edit]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Ben
@benflinn
Aug 05 2015 00:45 UTC
@gazzer82 yeah don't feel too discouraged, i think it's just a new level of programming... let it soak in a little and we'll figure it out i think
Alan Savage
@asavage111
Aug 05 2015 00:45 UTC
This message was deleted
Sean Davis
@Fridurmus
Aug 05 2015 00:47 UTC
http://www.freecodecamp.com/challenges/waypoint-get-set-for-basejumps for this waypoint, I'm being asked in the terminal: ? Would you like to use Javascript ES6 in your client by preprocessing it with Babel? (Y/n) and I'm not sure what to answer
Kolloom
@Kolloom
Aug 05 2015 00:47 UTC
bonfire chunky
CamperBot
@camperbot
Aug 05 2015 00:47 UTC

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

for more info: bf details bf links bf script bf wiki bf spoiler

Clayton
@cjg040103
Aug 05 2015 00:51 UTC
what is wrong with my code so far?
function titleCase(str) {
  var arrayVar = str.toLowerCase().split(' ');
  var finalString = [];
  for(var i=0; i<arrayVar.length; i++){
    finalString += arrayVar[i].charAt(0).toUpperCase();
    finalString += arrayVar[i].substr(1);
  }
  return finalString;
}

titleCase("I'm a little tea pot");
the result is "I'mALittleTeaPot"
should be "I'm A Little Tea Pot"
Rex Schrader
@SaintPeter
Aug 05 2015 00:53 UTC
@cjg040103 You're appending to a string, right? You're not putting any spaces in there. It might be better to "push" each answer onto an array, then join the array when you're done.
Clayton
@cjg040103
Aug 05 2015 00:53 UTC
Huh?
Ben
@benflinn
Aug 05 2015 00:53 UTC
ok so I can commit my "pull requests" - but it seems like they just go to my forked repo? how do they actually get changed in the FCC repo?
Rex Schrader
@SaintPeter
Aug 05 2015 00:56 UTC
@benflinn I reccomend this: setup an upstream remote to the main FCC repo. Do a git pull upstream staging, create a branch, make your edit, commit the edit, then push the branch to your forked repo. Create a cross-repo pull request from your new branch. That way you can pull future changes from upstream without disturbing your pull request. I got emberrased on the twitch stream when one of my pull requests was horribly mangled by my having pushed a new version of staging up to my fork.
Clayton
@cjg040103
Aug 05 2015 00:56 UTC
i'm pretty sure the problem is what u put between the '' in the .split('') @SaintPeter
Alan Savage
@asavage111
Aug 05 2015 00:56 UTC
This message was deleted
Can someone tell me why I can't pass this test "Wrap your i element within your button element." <i class='fa fa-thumbs-up'> <button class='btn btn-block btn-primary'>Like</button> </i>
Clayton
@cjg040103
Aug 05 2015 00:57 UTC
if u put anything else it will make it all caps or just print out the original sentance
Nikhil Deorkar
@nikhilnd
Aug 05 2015 00:58 UTC
Hi everybody! This a little bit of a off topic but I was hoping for a solution about a problem running sublime text 3 in the terminal.
Rex Schrader
@SaintPeter
Aug 05 2015 00:58 UTC
@cjg040103 You're breaking the string into an array, right? You do that with the .split(' '). That's correct. What I am proposing is that rather and appending to a single string finalString, you instead create a seperate string for each word. As each word is completed, push it on an array. Then, once you're done, use .join(' ') to turn the array back into a complete sentance.
Nikhil Deorkar
@nikhilnd
Aug 05 2015 00:58 UTC
Ben
@benflinn
Aug 05 2015 00:59 UTC
@SaintPeter thanks, i'll try to understand this... hmm
Nikhil Deorkar
@nikhilnd
Aug 05 2015 00:59 UTC
I keep on getting this error: ln: /usr/local/bin/sublime: Permission denied
Rex Schrader
@SaintPeter
Aug 05 2015 00:59 UTC
@benflinn If it's any consolation, I've been flailing at it for a couple weeks.
Kolloom
@Kolloom
Aug 05 2015 00:59 UTC
@cjg040103 you may add a space after the second finalString += and return the finalString without the last space
Clayton
@cjg040103
Aug 05 2015 00:59 UTC
@SaintPeter k thx so much! :smile:
@Kolloom k
Kolloom
@Kolloom
Aug 05 2015 01:01 UTC
bonfire falsey
CamperBot
@camperbot
Aug 05 2015 01:01 UTC

:fire:Bonfire: Falsey Bouncer :link:

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr;
}

bouncer([7, 'ate', '', false, 9]);

Remove all falsey values from an array.

for more info: bf details bf links bf script bf wiki bf spoiler

Ben
@benflinn
Aug 05 2015 01:01 UTC
@SaintPeter xD alright I guess I made a couple fixes today, I did this all online in github, I merged the fixes to my own forked repo, and now I just need to make a pull request to the FCC repo?
Gerard
@gerardmuhammad
Aug 05 2015 01:02 UTC
what am I doing wrong

<h1>Hello World</h1>
<!--building

<h2>CatPhotoApp</h2>

<p>Hello Paragraph<p>

Rex Schrader
@SaintPeter
Aug 05 2015 01:03 UTC
@benflinn In theory, yes. The issue is that if you make the changes to your copy of staging, when you go to make later changes (or when THEY make later changes), you'll still have your (potentially unaccepted) change request sitting on top of your commit tree. Better to create a branch and cherry-pick your commit(s) (BTW, you should squash your commits so they're just one commit.)
@benflinn have you cloned your fork of the repo to your local machine?
Jennifer Stipe
@jenniferstipe
Aug 05 2015 01:04 UTC
@gerardmuhammad Looks like you aren't ending your comment - comments need to be closed with the --> tag
Ben
@benflinn
Aug 05 2015 01:06 UTC
@SaintPeter ive just been using github in my browser but it seems to be working? I understand what you mean now - dont commit the branches to my own repo, instead push them to the FCC's repo
Rex Schrader
@SaintPeter
Aug 05 2015 01:07 UTC
@benflinn Nope, you push the branches to your own repo, then you can create a pull request from your branch against staging in the main repo. Also: I was warned by Quincy not to use the Github online editor to make changes because there was the potential to break the JSON.
Ben
@benflinn
Aug 05 2015 01:07 UTC
@SaintPeter is there a guide somewhere to explain this?
Rex Schrader
@SaintPeter
Aug 05 2015 01:07 UTC
@benflinn I wish. :( I guess I should write one.
Ben
@benflinn
Aug 05 2015 01:08 UTC
haha... alright i'll see if i can make this work
Rex Schrader
@SaintPeter
Aug 05 2015 01:08 UTC
I'm treating it as a crash course in git :D
James Darrohn
@jdarrohn
Aug 05 2015 01:09 UTC
Hey guys
Chunky Monkey help
Ben
@benflinn
Aug 05 2015 01:09 UTC
haha that's a good attitute..... ><
James Darrohn
@jdarrohn
Aug 05 2015 01:09 UTC
I have it kinda figured out...
May I post?
Rex Schrader
@SaintPeter
Aug 05 2015 01:10 UTC
@PlushyObject Of course, that's what we're here for. Do you know how to paste code?
James Darrohn
@jdarrohn
Aug 05 2015 01:10 UTC
For sure
function chunk(arr, size) {

  var newArray = [];

  for(i =0; i < size; i++){

    newArray.push( arr[i] );

  }

  arr = newArray;

  console.log(arr);
}

chunk(['a', 'b', 'c', 'd'], 2);
so this logs [a,b] which is right...
but I am not sure how to pick up there, I am not asking for the solution just maybe i need a spark to get this thing going
I would think maybe start at arr.length - size;
but that just seems convoluded
Rex Schrader
@SaintPeter
Aug 05 2015 01:11 UTC
@PlushyObject Well, you need nested arrays. IE: [ [ 'a', 'b' ], [ 'c', 'd'] ]
James Darrohn
@jdarrohn
Aug 05 2015 01:11 UTC
well right I get that
Marie Pelletier
@Marie000
Aug 05 2015 01:11 UTC
I'm on Bonfire Search and Replace and I cannot understand what I am doing wrong:
function replace(str, before, after) {
  // create checkcase function
  function checkcase() {
  // if before has uppercase first letter
    if (before.match(/[A-Z]./g)){

      after.split('');

      after[0] = after[0].toUpperCase;
      after.join('');
      return after;
    }
    else {
      return after;
    }

  }
  // replace function
  var newStr = str.replace(before,checkcase);

}

replace("A quick brown fox Jumped over the lazy dog", "Jumped", "leaped");
CamperBot
@camperbot
Aug 05 2015 01:11 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
James Darrohn
@jdarrohn
Aug 05 2015 01:12 UTC
I know I need the multi-dimensional array
Rex Schrader
@SaintPeter
Aug 05 2015 01:12 UTC
@PlushyObject You need a second loop, or some way of looping through the whole input array.
James Darrohn
@jdarrohn
Aug 05 2015 01:13 UTC
Okay stop there let me think about that.
Rex Schrader
@SaintPeter
Aug 05 2015 01:13 UTC
@Marie000 toUpperCase() needs parentheses to call it as a function
Marie Pelletier
@Marie000
Aug 05 2015 01:14 UTC
thanks @SaintPeter
CamperBot
@camperbot
Aug 05 2015 01:14 UTC
marie000 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 6 | @saintpeter | http://www.freecodecamp.com/saintpeter
Marie Pelletier
@Marie000
Aug 05 2015 01:14 UTC
but it still tells me that after.join is not a function
Ben
@benflinn
Aug 05 2015 01:15 UTC
@SaintPeter okay so my branches are here: https://github.com/benflinn/freecodecamp/branches/active
exactly how do i push them to FCC's staging branch?
Rex Schrader
@SaintPeter
Aug 05 2015 01:15 UTC

@Marie000 ok, you do this:

after.split('');

but you don't actually assign it to anything. after doesn't change, split returns an array.

@Marie000 strings in javascript are immutable
define immutable
define immutable
darnit. silly bot
@benflinn Select your branch and you should be given the option to create a pull request
create it across repos, against the main repo
@benflinn Humm
AJ Gibson
@gibsonio
Aug 05 2015 01:17 UTC
for the 'truncate a string' Bonfire, is there a different way other than what I have below?
function truncate(str, num) {

  var add = '...';



  var shortString = str.slice(0, num - 3) + add;

  if(str.length > num) {

    return shortString;

  }

  else {
    return str;
  }

}

truncate('A-tisket a-tasket A green and yellow basket', 11);
James Darrohn
@jdarrohn
Aug 05 2015 01:18 UTC
@gibsbonio the num - 3 thing was weird for sure
I think it was ignoring spaces and -
Rex Schrader
@SaintPeter
Aug 05 2015 01:18 UTC
@benflinn Your patch is based on an outdated fork. You need to pull down the latest changes. That can only be done on a local machine, not via the GitHub interface
@gibsonio That looks about right.
AJ Gibson
@gibsonio
Aug 05 2015 01:18 UTC
i had a feeling i took an easy way out by subtracting 3
James Darrohn
@jdarrohn
Aug 05 2015 01:18 UTC
I definitely did the same thing.
let me show you mine
function truncate(str, num) {

  if(str.length > num){

    str = str.slice(0, num - 3) + '...';

  }

  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
AJ Gibson
@gibsonio
Aug 05 2015 01:20 UTC
@PlushyObject cool. at least there are others thinking like me :smile:
James Darrohn
@jdarrohn
Aug 05 2015 01:20 UTC
I am pretty sure it was seeing the - and the white space as not characters because I counted to 11 a few times and was looking at the test liek "Huh?"
Brock Hayes
@brockson007
Aug 05 2015 01:21 UTC
// Write your jQuery code on line 3!
$(document).ready(function() {
    $target
    $target.fadeOut('fast');
});
Marie Pelletier
@Marie000
Aug 05 2015 01:21 UTC
Okay, I changed it a little, but the result is not undefined.
function replace(str, before, after) {
  // create checkcase function
  function checkcase() {
  // if before has uppercase first letter
    if (before.match(/[A-Z]./g)){
      var afterArr = after.split('');

      afterArr[0] = afterArr[0].toUpperCase();
      var newAfter = afterArr.join('');
      return newAfter;
    }
    else {
      return after;
    }

  }
  // replace function
  var newStr = str.replace(before,checkcase);

}

replace("A quick brown fox Jumped over the lazy dog", "Jumped", "leaped");
Brock Hayes
@brockson007
Aug 05 2015 01:21 UTC
can someone help me with this exercise? https://www.codecademy.com/courses/web-beginner-en-GfjC6/0/3#
James Darrohn
@jdarrohn
Aug 05 2015 01:22 UTC
@brockson007 I can help with that~!
Kolloom
@Kolloom
Aug 05 2015 01:22 UTC
@brockson007 you need to assign $target to an html element
James Darrohn
@jdarrohn
Aug 05 2015 01:22 UTC
$target = $('#id');
or $target = $('.class');
Timur Celikel
@teeceli
Aug 05 2015 01:23 UTC
I'm a senior level web software engineer and was mainly interested in the part of this site that deals with volunteering for non-profits but it looks like I need to complete all the courses first. Are there in fact several non-profit projects at the end of the tunnel, or is this site mainly used for learning? Thanks!
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 01:24 UTC
@teeceli As far as I knwo you need to complete the requirements before you can unlock the nonprofit projects. This site is for learning, and noce you learn you get to help a nonprofit to build a nice portfolio, feel betetr about yourself and hopefully get a job in the near future
James Darrohn
@jdarrohn
Aug 05 2015 01:25 UTC
@SaintPeter I am going to try to do this nested for loop, but I honestly might have to ask you for help again
for Chunky Monkey
Rex Schrader
@SaintPeter
Aug 05 2015 01:25 UTC
@PlushyObject That's what we're here for :D
James Darrohn
@jdarrohn
Aug 05 2015 01:25 UTC
Alright Cool let me see what I can do.
Timur Celikel
@teeceli
Aug 05 2015 01:26 UTC
ok cool. thanks @Rafase282
Rex Schrader
@SaintPeter
Aug 05 2015 01:26 UTC
@teeceli There are at least 3.
Timur Celikel
@teeceli
Aug 05 2015 01:26 UTC
do you know anyone that had made it through?
Rex Schrader
@SaintPeter
Aug 05 2015 01:26 UTC
wiki non profit
CamperBot
@camperbot
Aug 05 2015 01:26 UTC
no wiki entry for: non profit
:pencil: click here to create one now!after creating your page type update to reload it here
Rex Schrader
@SaintPeter
Aug 05 2015 01:26 UTC
@teeceli Around 40 or so
@teeceli Maybe a few more, I don't know concrete numbers.
Timur Celikel
@teeceli
Aug 05 2015 01:26 UTC
and they are actively working on projects?
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 01:27 UTC
oh teh camperbot is here too?
bf smallest
CamperBot
@camperbot
Aug 05 2015 01:27 UTC

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.

for more info: bf details bf links bf script bf wiki bf spoiler

Rafael J. Rodriguez
@Rafase282
Aug 05 2015 01:27 UTC
bf details
CamperBot
@camperbot
Aug 05 2015 01:27 UTC

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.
The range will be an array of two numbers that will not necessarily be in numerical order.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:

Smallest Common Multiple


  • bonfire info for more info
  • bonfire links
  • bonfire script for the script
  • bonfire spoiler for some clues on how to solve it
  • bonfire wiki for related info from the wiki
Rex Schrader
@SaintPeter
Aug 05 2015 01:27 UTC
wiki how free
CamperBot
@camperbot
Aug 05 2015 01:27 UTC

:pencil: how free code camp's nonprofit projects work [edit]

Building nonprofit projects is the main way that our campers learn full stack JavaScript and agile software development. Once you complete the Free Code Camp Waypoints, Bonfires, Ziplines and Basejumps, you'll begin this process.

Starting with the end in mind

Our goal at Free Code Camp is to help you land a job as a junior software developer (or, if you prefer, a 'pivot job' that leads your current career in a more technical direction).

You'll continue to work on nonprofit projects until you've built a sufficiently impressive portfolio and references to start your job search. Your portfolio will ultimately have four nonprofit projects. We estimate that the 800 hours of nonprofit projects you're going to complete, in addition to the 800 hours of challenges you've already completed, will be enough to qualify you for your first coding job. This will produce a much broader portfolio than a traditional coding bootcamp, which generally only has one or two capstone projects.

Choosing your first Nonprofit Project

We've categorized all the nonprofit projects by estimated time investment per camper: 100 hours, 200 hours, and 300 hours. These are only rough estimates.

Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week. If the project is a 100 hour per camper project, you should be able to complete it in about 5 weeks.
Our Nonprofit Project team will match you and your pair based on:

  • Your estimated time commitment (10, 20 or 40 hours per week)
  • Your time zone
  • The nonprofit projects you've chosen
  • Prior coding experience (we'd like both campers to be able to contribute equally)

We won't take age or gender into account. This will provide you with valuable experience in meshing with diverse teams, which is a reality of the contemporary workplace.

You'll only work on one project at a time. Once you start a nonprofit project, we'll remove you from all other nonprofit project you've expressed interest in. There's a good chance those projects will no longer be available when you finish your current project, anyway. Don't worry, though - we get new nonprofit project requests every day, so there will be plenty more projects for you to consider after you finish your current one.

Finalizing the Project

Before you can start working on the project, our team of Nonprofit Project Coordinators will go through the following process:

  • We'll wait until there are two campers who have chosen the same project and look like they're a good match for one another based on the factors mentioned above.
  • We'll call the stakeholder to confirm once again that he or she agrees with our terms and has signed our [Nonprofit Project Stakeholder Pledge] (http://goo.gl/forms/0YKkd9bpcR).
  • We'll set an initial meeting with representatives from Free Code Camp, the two campers, and the stakeholder.
  • If the stakeholder and both campers shows up promptly, and seem enthusiastic and professional, we'll start the project.

This lengthy process serves an important purpose: it reduces the likelihood that any of our campers or stakeholders will waste their precious time.

Nonprofit Stakeholders

Each nonprofit project was submitted by a nonprofit. A representative from this nonprofit has agreed to serve as a "stakeholder" - an authorative person who understands the organization and its needs for this particular project.

:pencil: read more about how free code camps nonprofit projects work on the FCC Wiki

Timur Celikel
@teeceli
Aug 05 2015 01:27 UTC
ok cool. thanks bot
@teeceli Each completed non-profit represents at least two coders
Timur Celikel
@teeceli
Aug 05 2015 01:28 UTC
awesome. thanks @SaintPeter
Rex Schrader
@SaintPeter
Aug 05 2015 01:28 UTC
@teeceli If you watch the august live stream, it has good detail
wiki august
CamperBot
@camperbot
Aug 05 2015 01:28 UTC

:pencil: august live stream [edit]

Free Code Camp's [August Live Stream] (https://youtu.be/UhoxoYrJ6Qs) was the largest yet.

The agenda included:

<a href="http://www.youtube.com/watch?feature=player_embedded&v=UhoxoYrJ6Qs " target="_blank"><img src="https://www.evernote.com/l/AnvmsUWWNeJFNbfm7fDa7SRLmnbn7jafRL4B/image.png" alt="Screen shot from our twitch feed on August 1 2015" width="560" height="315"border="10" /></a>
:pencil: read more about august live stream on the FCC Wiki

Kolloom
@Kolloom
Aug 05 2015 01:28 UTC
@SaintPeter I'm not entirely sure bombard the chat with such long text is good for everyone?
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 01:28 UTC
@SaintPeter how to I get to the bornfires on github?
Rex Schrader
@SaintPeter
Aug 05 2015 01:29 UTC
@Kolloom I concur. Sorry for the spam. It's just supposed to send the first part
Timur Celikel
@teeceli
Aug 05 2015 01:29 UTC
@SaintPeter is this site still fairly new?
Brock Hayes
@brockson007
Aug 05 2015 01:29 UTC
James Darrohn
@jdarrohn
Aug 05 2015 01:29 UTC
@brockson007 send me a message man
Rex Schrader
@SaintPeter
Aug 05 2015 01:29 UTC
@teeceli FreeCodeCamp started in October of last year, but is undergoing constant rennovation.
@teeceli You can see the beta site: http://beta.freecodecamp.com
Timur Celikel
@teeceli
Aug 05 2015 01:30 UTC
awesome. thank you
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 01:30 UTC
@SaintPeter I found a bug on a bf and I know hwo to fix it, I just can't find the repo
Rex Schrader
@SaintPeter
Aug 05 2015 01:30 UTC
@Rafase282 one moment
Kolloom
@Kolloom
Aug 05 2015 01:30 UTC
the beta is the first renovation ?
Rex Schrader
@SaintPeter
Aug 05 2015 01:30 UTC
The beta is the second major rennovation that I am aware of, although there is ongoing work all the time.
Kolloom
@Kolloom
Aug 05 2015 01:35 UTC
tried to use splice() to remove stuff in a list, but that modified the length and I couldn't complete the entire iteration, any pointers?
Sergey Zhidkov
@sergey-zhidkov
Aug 05 2015 01:36 UTC
@Kolloom create new array, without modifying old one
Bill
@kirah1314
Aug 05 2015 01:36 UTC
bonfire steamroller
CamperBot
@camperbot
Aug 05 2015 01:36 UTC

:fire:Bonfire: Steamroller :link:

function steamroller(arr) {
  // I'm a steamroller, baby
  return arr;
}

steamroller([1, [2], [3, [[4]]]]);

Flatten a nested array. You must account for varying levels of nesting.

for more info: bf details bf links bf script bf wiki bf spoiler

Bill
@kirah1314
Aug 05 2015 01:37 UTC
bf spoiler
CamperBot
@camperbot
Aug 05 2015 01:37 UTC
[0] Flatten a nested array. You must account for varying levels of nesting.
Caroline Dikibo
@cdikibo
Aug 05 2015 01:45 UTC
Bonfire #33
CamperBot
@camperbot
Aug 05 2015 01:45 UTC
:frown: Sorry, can't find a bonfire called 33 . Check the map?
Caroline Dikibo
@cdikibo
Aug 05 2015 01:46 UTC
function find(arr, func) {
  var num = 0;
 for(num; num<arr.length; num++){
     if(num%2===0){
         return num;
     }else{
         return undefined;
     }
 }
}  
find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
Kolloom
@Kolloom
Aug 05 2015 01:48 UTC
are you asking help for your code? @cdikibo
@Kolloom i fixed the august wiki entry.
it needed an H2 in the content
wiki august
CamperBot
@camperbot
Aug 05 2015 01:50 UTC

:pencil: august live stream [edit]

Free Code Camp's [August Live Stream] (https://youtu.be/UhoxoYrJ6Qs) was the largest yet.

:pencil: read more about august live stream on the FCC Wiki
Caroline Dikibo
@cdikibo
Aug 05 2015 01:51 UTC
@Kolloom yes
updated code
Kolloom
@Kolloom
Aug 05 2015 01:51 UTC
@dcsan i was complaining about how free
Caroline Dikibo
@cdikibo
Aug 05 2015 01:52 UTC
function find(arr, func) {
  var num = 0;
 for(i=0; i<arr.length; i++){
     if(arr[i]%2===0){
         return arr;
     }else{
         return undefined;
     }
 }
}  
find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
Kolloom
@Kolloom
Aug 05 2015 01:52 UTC
bonfire find
CamperBot
@camperbot
Aug 05 2015 01:52 UTC

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');

Return the length of the longest word in the provided sentence.

for more info: bf details bf links bf script bf wiki bf spoiler

Kolloom
@Kolloom
Aug 05 2015 01:53 UTC
@cdikibo which bonfire is that?
Nic Galluzzo
@ngalluzzo
Aug 05 2015 01:53 UTC
wooooo just 3 bonfires!!!
Caroline Dikibo
@cdikibo
Aug 05 2015 01:53 UTC
It's bonfire #33, finders keepers
CamperBot
@camperbot
Aug 05 2015 01:53 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Kolloom
@Kolloom
Aug 05 2015 01:54 UTC
@dcsan we should be able to refer bonfire with numbers, what you say?
CamperBot
@camperbot
Aug 05 2015 01:54 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
function isBigEnough(value, ray) {
  return value >= ray;
}
var sray = 432;
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough,sray);
console.log(filtered);
returns [12, 5, 8, 130, 44] ??!!!
what's wrong with syntax?
help how free
CamperBot
@camperbot
Aug 05 2015 01:55 UTC

:pencil: how free code camp works [edit]

Free Code Camp offers you a free, self-paced, browser-based program that takes about 1,600 hours to complete.

An image of a table showing the different segments of Free Code Camp

:pencil: read more about how free code camp works on the FCC Wiki

fixed
Bill
@kirah1314
Aug 05 2015 01:55 UTC
@cdikibo you can reference the 2nd function using func(arr[i])
@Kolloom i think in case more BFs get added in the middle, numbers aren't a great idea...
they'd have to be updated all the time.
Rex Schrader
@SaintPeter
Aug 05 2015 01:56 UTC
@dcsan There should be an upper limit on the number of words it can return
@dcsan or maybe number of links?
Kolloom
@Kolloom
Aug 05 2015 01:56 UTC
@cdikibo you just ignored the function provided by the bonfire(as an argument)
i had that before but it kept cutting off in the middle of script tags
i'll have to write a better chunked parser sometime...
for now, just edit the pages works ok
Prashanth Chandra
@prashcr
Aug 05 2015 01:57 UTC
What are the significant differences between an ISC and an MIT license? Why does npm default to ISC?
Kolloom
@Kolloom
Aug 05 2015 01:58 UTC
@cdikibo the bonfire ask to take out some of the item in that array, the return you used terminated the for loop at first iteration
@cdikibo it will return arr when the condition is met(which doesn't changes anything)
@dcsan ah good point, forgot the list can mutate :)
if we hack the wiki a bit it should get useful quite quickly :sunrise:
Kolloom
@Kolloom
Aug 05 2015 02:02 UTC
@SaintPeter @dcsan i'd say the output should be constrained by the lines taken in the chat?
Rex Schrader
@SaintPeter
Aug 05 2015 02:03 UTC
@Kolloom That can be non-trivial to compute
Kolloom
@Kolloom
Aug 05 2015 02:04 UTC
hmm... then i will go with pure link and a short description on that
most info is in the link provided anyway
Caroline Dikibo
@cdikibo
Aug 05 2015 02:05 UTC
@Kolloom I changed the for loop to reference the func
@Kolloom constrained how?
just limited?
yeh, but its hard tojust cut it off as it hacks the middle of markedup script blocks
if you rip out a closing ``` tag it goes to hell...
but yeah maybe that would be better - at least to add a guard so we dont get spammed with huge long entries
in future i could send an alert to another room that entry X needs editing... if it trips the >20 lines alert
lots to do! anyone wanna halp out with some bothacking? :rocket:
Kolloom
@Kolloom
Aug 05 2015 02:08 UTC
@cdikibo code?
Caroline Dikibo
@cdikibo
Aug 05 2015 02:08 UTC
function find(arr, func) {
  var num = 0;
 for(i=0; i<arr.length; i++){
     if(func(arr[i])%2===0){
         func(arr.some());
     }else{
         return undefined;
     }
 }
}  
find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
Kolloom
@Kolloom
Aug 05 2015 02:09 UTC
the function provided is an argument to the find function
so you refer the function by calling the function's name and an argument
function(num){ return num % 2 === 0; } this is a function, assigned to the argument name func
you calling it by the name and provide it with an argument: func(argument)
so it goes like this if (func(arr[i])
Bill
@kirah1314
Aug 05 2015 02:11 UTC
@cdikibo can remove %2===0 from the if statement now that you already referenced it. if (func(arr[i])) already loops through i
Kolloom
@Kolloom
Aug 05 2015 02:12 UTC
note the output of that function return num % 2 === 0, it would be either true of false
you can then use that as an condition to the if statment
if (true) {
    console.log('this will get printed'); // this line will be executed
}

if (false) {
    console.log('this will not get printed'); // this line will not
}
Kolloom
@Kolloom
Aug 05 2015 02:33 UTC
bonfire html
CamperBot
@camperbot
Aug 05 2015 02:33 UTC

:fire:Bonfire: Convert HTML Entities :link:

function convert(str) {
  // &colon;&rpar;
  return str;
}

convert('Dolce & Gabbana');

Convert the characters "&", "<", ">", '"' (double quote), and "'" (apostrophe), in a string to their corresponding HTML entities.

for more info: bf details bf links bf script bf wiki bf spoiler

Kolloom
@Kolloom
Aug 05 2015 02:36 UTC

i'm not sure what's going on with this bonfire, the expected output is exactly the same as input

convert('Dolce & Gabbana'), 'Dolce & Gabbana'
convert('Sixty > twelve'), 'Sixty > twelve'

Bill
@kirah1314
Aug 05 2015 02:38 UTC
@Kolloom that bonfire definitely could use some better explanation
ALINATSUI
@ALINATSUI
Aug 05 2015 02:38 UTC
Screen Shot 2015-08-04 at 10.37.29 PM.png
Help?! I'm doing the beta challenge: Manipulating Arrays with pop();
CamperBot
@camperbot
Aug 05 2015 02:38 UTC
no wiki entry for: im doing the beta challenge manipulating arrays with pop
:pencil: click here to create one now!after creating your page type update to reload it here
Bill
@kirah1314
Aug 05 2015 02:39 UTC
basically you have to change & to &amp; and so on for the others
Moisés Man
@moigithub
Aug 05 2015 02:39 UTC
&amp;
Jason Healy
@jhealy86
Aug 05 2015 02:39 UTC
@Kolloom what's happening is the string literal &amp; is being printed, but your browser is rendering it as &
... can it be escaped somehow? \&
ALINATSUI
@ALINATSUI
Aug 05 2015 02:39 UTC
part b is asking that myArray should contain (["cat",2) but can't figure out how to do that?
Jason Healy
@jhealy86
Aug 05 2015 02:39 UTC
nope
Kolloom
@Kolloom
Aug 05 2015 02:40 UTC
so the output should be 'Dolce &amp Gabbana'?
Jason Healy
@jhealy86
Aug 05 2015 02:40 UTC
@Kolloom exactly
well, &amp;
can't forget the semicolon
Kolloom
@Kolloom
Aug 05 2015 02:40 UTC
ok thanks
Jason Healy
@jhealy86
Aug 05 2015 02:41 UTC
&amp;
Clint
@jenkira
Aug 05 2015 02:41 UTC
Hi All, would i be able to get some help with Bonfire: Make a person? i have seen some of the issues and responses in the forum above, just not sure how they relate to what i have.
Jason Healy
@jhealy86
Aug 05 2015 02:41 UTC
there we go. you have to write &amp;amp;
Kolloom
@Kolloom
Aug 05 2015 02:44 UTC

I'm pretty sure i got something wrong here

function convert(str) {
  var original = ['&', '<', '>', '"'];
  var converted = ['&amp;', '&lt;', '&gt;', '&quot;'];
  for (var i = 0; i < str.length; i++) {
    str = str.replace(original[i], converted[i]);
  }
  return str;
}

convert('Dolce & Gabbana');

the error msg is not helping in anyway

Jason Healy
@jhealy86
Aug 05 2015 02:47 UTC
ok, so you're iterating over the length of the string you get passed. in this case "Dolce & Gabbana"
but you're accessing your original and converted arrays
Bill
@kirah1314
Aug 05 2015 02:48 UTC
@Kolloom you missed the apostrophe, there's 5 characters to replace
Jason Healy
@jhealy86
Aug 05 2015 02:48 UTC
^ also that
Kolloom
@Kolloom
Aug 05 2015 02:48 UTC
oh yeah...that's sloppy
Russell Westberry
@russbus
Aug 05 2015 02:50 UTC
Is this the most effective use of replace for stripping non-alphanumeric characters? Working on the palindromes bonfire. normalized = str.replace(/[\W_]+/g, "").toLowerCase();
Jason Healy
@jhealy86
Aug 05 2015 02:52 UTC
@russbus why the underscore?
Kolloom
@Kolloom
Aug 05 2015 02:52 UTC
I don't know why but the replace() only replace the first <?
Russell Westberry
@russbus
Aug 05 2015 02:53 UTC
@jhealy86 The internet said \w included underscores.
Jason Healy
@jhealy86
Aug 05 2015 02:54 UTC
huh, i did not know that
regardless, you're not going to get any underscores in your test cases
ALINATSUI
@ALINATSUI
Aug 05 2015 02:54 UTC
Anyone??
Jason Healy
@jhealy86
Aug 05 2015 02:56 UTC
@ALINATSUI ... yes?
@Kolloom i think that's how replace() works if you use a string as your first argument
Kolloom
@Kolloom
Aug 05 2015 02:58 UTC
anyway i can use variable name in conjunction with regex? /varible/g
Jason Healy
@jhealy86
Aug 05 2015 02:58 UTC
maybe not the variable name, but you can definitely put the character in a regex
Kolloom
@Kolloom
Aug 05 2015 02:59 UTC
don't like the idea of wrapping all five item with //g though
Jason Healy
@jhealy86
Aug 05 2015 02:59 UTC
why not? it's just a regex
Bill
@kirah1314
Aug 05 2015 02:59 UTC
@Kolloom your codes should work though. Can you post it?
Jimmy Hernandez
@dismister
Aug 05 2015 03:00 UTC
Is anyone here a developer with a few years of experience? I'm just getting into this field from a chemistry and business background.
Jason Healy
@jhealy86
Aug 05 2015 03:00 UTC
all it does is makes them regexes instead of strings
Kolloom
@Kolloom
Aug 05 2015 03:00 UTC
@kirah1314 nope not working
function convert(str) {
  var original = ['&', '<', '>', '"', "'"];
  var converted = ['&amp;', '&lt;', '&gt;', '&quot;', '&apos;'];
  for (var i = 0; i < original.length; i++) {
    console.log(i);
    str = str.replace(/original[i]/g, converted[i]);
  }
  return str;
}

convert('Dolce & Gabbana');
convert('Hamburgers < Pizza < Tacos');
ALINATSUI
@ALINATSUI
Aug 05 2015 03:00 UTC
hey @jhealy86. Thanks. I'm working on beta challenge. So here's the problem:
Screen Shot 2015-08-04 at 10.37.29 PM.png
Kolloom
@Kolloom
Aug 05 2015 03:01 UTC
@jhealy86 i could pass the list with a map() though
Jason Healy
@jhealy86
Aug 05 2015 03:01 UTC
@Kolloom well, the regex is literally trying to match "original[i]"
as far as i'm aware you can't put a variable in a regex like that
you could just make all the entries in your original array regexes
like this var original = [/&/g, /</g, ...];
ALINATSUI
@ALINATSUI
Aug 05 2015 03:02 UTC
The second part states that 'myArray should only have the first two values left (["cat"], 2)').
But the .pop() function only works on removing the end of an array.
Komal Bhandari
@panaroma
Aug 05 2015 03:02 UTC
I need help on Chunky Monnkey ?
Jason Healy
@jhealy86
Aug 05 2015 03:03 UTC
@ALINATSUI that's what pop() is supposed to do. it's so you can use the array object as a stack
Komal Bhandari
@panaroma
Aug 05 2015 03:03 UTC
Any one willing to help on it?
Jason Healy
@jhealy86
Aug 05 2015 03:03 UTC
@ALINATSUI when something gets popped it gets removed from the end and returned to you. if you don't capture it when you call pop() you lose it
ALINATSUI
@ALINATSUI
Aug 05 2015 03:03 UTC
ok but @jhealy86, how do I get past this challenge?
Jason Healy
@jhealy86
Aug 05 2015 03:04 UTC
so on line 8, you're calling myArray.pop(), and the thing popped off the back is just going into the void
you need to capture it somehow
ALINATSUI
@ALINATSUI
Aug 05 2015 03:04 UTC
right, set up another variable?
Jason Healy
@jhealy86
Aug 05 2015 03:04 UTC
look at how the commented lines work up above, see if you can spot any differences
also, when you want help in the chat room, it's much easier just to post the code. like this
```
code goes here
```
makes it look like this
code goes here
those backticks are to the left of the 1 if you have a QWERTY keyboard
Kolloom
@Kolloom
Aug 05 2015 03:07 UTC
@jheadly the regex should be wrapped with apostrophes?
ALINATSUI
@ALINATSUI
Aug 05 2015 03:07 UTC
hm..let me try. Thanks for the headsup.
Jason Healy
@jhealy86
Aug 05 2015 03:08 UTC
@Kolloom no, apostrophes make javascript think "string", forward slashes make it think "regex"
Bill
@kirah1314
Aug 05 2015 03:09 UTC
@Kolloom nope not working. Need regex for this bf I guess...
Kolloom
@Kolloom
Aug 05 2015 03:12 UTC
had converted all the character to regex, but still not working
function convert(str) {
  var original = ['&', '<', '>', '"', "'"];
  re = original.map(function(arg) {
      return '/' + arg + '/g';
  })
  console.log('original: ' + original);
  console.log('re: ' + re);

  var converted = ['&amp;', '&lt;', '&gt;', '&quot;', '&apos;'];
  for (var i = 0; i < original.length; i++) {

    console.log('re[i]: ' + re[i]);
    str = str.replace(re[i], converted[i]);
  }
  return str;
}

convert('Dolce & Gabbana');
Rishi Vasandani
@rvasandani
Aug 05 2015 03:14 UTC
@Kolloom I would stronly recommend splitting the string.. str.split("");
@Kolloom and then return str.join(""); after you have perfomed the conversion
Liz Rezes
@queenlizo
Aug 05 2015 03:15 UTC
Hi, all. I'm trying to figure out why my for loop isn't working. I specified the variable highNum, but it's not working. Thanks!
function sumAll(arr) {
    var highNum = Math.max(arr[0], arr[1]);
    var lowNum = Math.min(arr[0], arr[1]);

    for (var i = 0; i <= highNum; i+1) {
        return(i);
    }
}

sumAll([1, 4]);
@queenlizo i+1 should be i++ or i = i + 1
Right now it's not assigned anywhere.
Sean
@seanr707
Aug 05 2015 03:17 UTC
@Kolloom You can streamline your code by combining your two arrays into an object
Kameron Robinson
@RobinsonKameron
Aug 05 2015 03:17 UTC
@ALINATSUI @ALINATSUI Why do beta?
Kolloom
@Kolloom
Aug 05 2015 03:19 UTC
@seanr707 good suggestion, but problem is in replace() though
@matteverson can i make a new object at every iteration?
Sean
@seanr707
Aug 05 2015 03:22 UTC
@Kolloom Instead of creating your 'original' list with a map function, you may to write it out and
```
Matt Everson
@matteverson
Aug 05 2015 03:22 UTC
@Kolloom You could, or you could put those into your array
Sean
@seanr707
Aug 05 2015 03:22 UTC
/&/g
// instead of 
'/&/g'
Kolloom
@Kolloom
Aug 05 2015 03:23 UTC
oh totally forgot they are strings
Liz Rezes
@queenlizo
Aug 05 2015 03:25 UTC
@matteverson I forgot to thank you!
Sean
@seanr707
Aug 05 2015 03:26 UTC
I believe you can do a new RegExp('string') but using the 'new' keyword for builtin types is frowned upon
ninjatron
@ninjatron
Aug 05 2015 03:26 UTC
..
Kolloom
@Kolloom
Aug 05 2015 03:26 UTC
for what reason ?
Liz Rezes
@queenlizo
Aug 05 2015 03:26 UTC
OK. I'm trying to push number 2 and 3 to myArray in this code. For some reason, it's not working. Any help appreciated. Thanks!
function sumAll(arr) {
    var highNum = Math.max(arr[0], arr[1]);
    var lowNum = Math.min(arr[0], arr[1]);
    var myArray = [];

    for (var i = 1; i <= highNum; i = i + 1) {
        myArray = arr.push(i);
    }
    return myArray;
}

sumAll([1, 4]);
Sean
@seanr707
Aug 05 2015 03:27 UTC
@queenlizo you are pushing your numbers to 'arr' not 'myArray'
Sean Davis
@Fridurmus
Aug 05 2015 03:27 UTC

Can someone please help? I'm trying to restart my server on cloud9 for the basejumps, but inputting the same commands that I was told to input (grunt serve, specifically) results in

Running "open:server" (open) task
Warning: Command failed: 
(process:4231): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified
xdg-open: no method available for opening 'http://localhost:8080'

and then it fails out

Liz Rezes
@queenlizo
Aug 05 2015 03:28 UTC
@seanr707 Ahh. Let me change that. Thanks!
IllusionElements
@IllusionElements
Aug 05 2015 03:28 UTC
function translate(str) {
  var con = /['pyfgcrldhtnskxbmwvjz']+/;
  constants = str.match(con);

  if(str.substr(0).match(con)){
    arr = str.split("");
    arr.push(arr.splice(0, 1).toString(), 'a', 'y');  
    return arr.join("");
}
  else{
    str+= way;
  }
  }



translate("eight");
why does that keep returning ighteay
Sean
@seanr707
Aug 05 2015 03:29 UTC
@queenlizo You're welcome, it would also help to check out the reduce method out on Mozilla's doc
Liz Rezes
@queenlizo
Aug 05 2015 03:29 UTC
@seanr707 now when I change the return to return arr;, it brings back [ 1, 4, 1, 2, 3, 4 ]
Kolloom
@Kolloom
Aug 05 2015 03:29 UTC
hmm couldn't find a way to convert '/&/g' back to regex format
Sean
@seanr707
Aug 05 2015 03:30 UTC
@Kolloom could you display the changes you made?
SojournerOctocat
@SojournerOctocat
Aug 05 2015 03:31 UTC
function spinalCase(str) {
    if (str.search(" ") >= 0) {
        str = str.replace(/ /g, "-");
    } 
    else if (str.search("_") >= 0) {
        str = str.replace(/_/g, "-");
    } else {
        var arrSplitString = str.split("");
        var arrSpinalCaseChars = [];
        for (var numIter = 0; numIter < arrSplitString.length; numIter++) {
            if (arrSplitString[numIter].search(/[A-Z]/) > -1) {
                arrSpinalCaseChars.push("-");
                arrSpinalCaseChars.push(arrSplitString[numIter]);
            } else {
                arrSpinalCaseChars.push(arrSplitString[numIter]); 
            }
        }

        str = arrSpinalCaseChars.join("");
    }
}

    return str.toLowerCase();
}

spinalCase('thisIsSpinalTap');
Getting the error Return statements are only valid inside functions. Why?
Sean
@seanr707
Aug 05 2015 03:31 UTC
@SojournerOctocat you have an extra bracket
Darrell Wong
@darrell1226
Aug 05 2015 03:32 UTC
Any idea why .getJSON is not firing?
http://codepen.io/darrell1226/pen/EjryRM/
SojournerOctocat
@SojournerOctocat
Aug 05 2015 03:32 UTC
@seanr707 Thank you!
Kolloom
@Kolloom
Aug 05 2015 03:32 UTC
@seanr707
function convert(str) {
  charSet = ['&', '<', '>', '"', "'"].map(function(arg) {
      return '/' + arg + '/g';
  })
  console.log('charSet: ' + charSet);

  var htmlSet = ['&amp;', '&lt;', '&gt;', '&quot;', '&apos;'];
  for (var i = 0; i < charSet.length; i++) {
    console.log(typeof charSet[i]); //outputs string
    str = str.replace(charSet[i], htmlSet);
  }
  return str;
}
well at least i know why it's not working
a method of converting string to raw string does present in es6 though
Jason Healy
@jhealy86
Aug 05 2015 03:36 UTC
@Kolloom is there any reason you can't just make charSet an array of regex objects?
var charset = [/&/g, /</g, />/g, /"/g, /'/g];
Sean
@seanr707
Aug 05 2015 03:36 UTC

@SojournerOctocat You're Welcome!
@Kolloom Try a list like

charSet = [/&/g, /</g /*...*/]

Not super functional, but it will work

Kolloom
@Kolloom
Aug 05 2015 03:38 UTC
@seanr707 i went all the way to avoid doing that, oh well...
(nice tried
Sean
@seanr707
Aug 05 2015 03:41 UTC
You can do /&<>'"/g which would cut down on time, but then you have to add some workarounds later in the code
Kolloom
@Kolloom
Aug 05 2015 03:44 UTC
@seanr707 still learned something with map() though, wouldn't say that's totally waste of time, thankyou
Sean
@seanr707
Aug 05 2015 03:46 UTC
@Kolloom No, definitely not, .map() is something I just learned about in the functional programming section, and it can shorten many of the bonfires' solutions (though as you saw, not all of them sadly)
CamperBot
@camperbot
Aug 05 2015 03:46 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Kolloom
@Kolloom
Aug 05 2015 03:47 UTC
@SojournerOctocat you put the return statement outside the function, should be this
//codes
str = arrSpinalCaseChars.join("");
    }
  return str.toLowerCase();
}

} // delete this one
This message was deleted
bonfire spinal
CamperBot
@camperbot
Aug 05 2015 03:49 UTC

:fire:Bonfire: Spinal Tap Case :link:

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  return str;
}

spinalCase('This Is Spinal Tap');

Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.

for more info: bf details bf links bf script bf wiki bf spoiler

Deepal D'Silva
@dsilvadeepal
Aug 05 2015 03:49 UTC
This message was deleted
bonfire Return Largest Numbers in Arrays
CamperBot
@camperbot
Aug 05 2015 03:50 UTC

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

for more info: bf details bf links bf script bf wiki bf spoiler

Kolloom
@Kolloom
Aug 05 2015 03:52 UTC
so much trouble to generate a sequence in javascript...
Matt Everson
@matteverson
Aug 05 2015 03:53 UTC

@seanr707 @Kolloom map() can be used to shorten convert pretty well.

  return str.split('')
  .map(function(char){
      return entities[char] ? entities[char] : char;
  })
  .join('');

There's just a tiny bit to the function before that.

Kolloom
@Kolloom
Aug 05 2015 03:55 UTC
@matteverson that's a serious one-liner though
Sean
@seanr707
Aug 05 2015 03:56 UTC
@matteverson now that's some nice functional coding /thumbsUp
Jason Healy
@jhealy86
Aug 05 2015 03:56 UTC
@Kolloom not really
Kolloom
@Kolloom
Aug 05 2015 03:56 UTC
i dont know what that second return statement does though
Jason Healy
@jhealy86
Aug 05 2015 03:57 UTC
it's a ternary statement
Matt Everson
@matteverson
Aug 05 2015 03:58 UTC
Just a shorthand if/else
Jason Healy
@jhealy86
Aug 05 2015 03:58 UTC
basically, it's a shortened way of saying
if (entities[char]) {
  return entities[char];
} else {
  return char;
}
just wait until ES6 and big arrow functions
Luis Felipe López G.
@luishendrix92
Aug 05 2015 03:59 UTC
@matteverson Oh thanks, I rely highly on chained functions but I really don't like how a very long chained function looks like, but you made me realize I could just start in a new line:
some.nice().
chained().
function;
Matt Everson
@matteverson
Aug 05 2015 04:02 UTC
@luishendrix92 Yes, but to make it clear that the line is a continuation we usually put the dot on the next line down. Also, see this zipline code for a longer example: http://codepen.io/matteverson/pen/gpZGNp
Sean
@seanr707
Aug 05 2015 04:02 UTC
@jhealy86 similar to the arrows in coffeeScript?
Luis Felipe López G.
@luishendrix92
Aug 05 2015 04:03 UTC
@matteverson I see, I see, thank you!
Kolloom
@Kolloom
Aug 05 2015 04:05 UTC
damn so much stuff i do not know
This message was deleted
oh snap never mind
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:11 UTC
Anyone here good with github? I'm having trouble syncing to my repo using the app
Matt Everson
@matteverson
Aug 05 2015 04:16 UTC
@Rafase282 You're trying to push? What's the error?
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:16 UTC
@matteverson it is telling me to use the console and debug
Darrell Wong
@darrell1226
Aug 05 2015 04:17 UTC
I'm stuck on Bonfire Wikipedia Viewer. I am using $.submit() to $('.query').val(); Then I use that value and append it to the api query url. My $.getJSON function is not doing anything inside the $.submit function. Trying to find a solution online but still haven't found one.
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:18 UTC
@matteverson fatal: unable to access 'https://github.com/Rafase282/My-FreeCodeCamp-Code.git/': Failed connect to github.com:443; No error
Matt Everson
@matteverson
Aug 05 2015 04:20 UTC
@Rafase282 Can you access https://github.com ?
I don't seem to be able to right now
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:20 UTC
from the website yes
unless it is cache
Matt Everson
@matteverson
Aug 05 2015 04:20 UTC
It timed out then came back up. Maybe try it again
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:20 UTC
seems to be cache
the photo didnt show until now
D
@bergsman00
Aug 05 2015 04:21 UTC

Hey Campers! I’m on Waypoint: Use the Bootstrap Grid to Put Elements Side by Side. And, I’m not sure what I’m doing wrong…each button has the additional class and the class=‘row’ is within the div open and closed statements…Please look and advise.. <div
class='row'

<button class='col-xs-4 btn btn-block btn-primary'>Like</button>

<button class='col-xs-4 btn btn-block btn-info'>Info</button>

<button class='col-xs-4 btn btn-block btn-danger'>Delete</button>
</div>

Matt Everson
@matteverson
Aug 05 2015 04:21 UTC
They might be having DNS issues
@darrell1226 no console log messages?
Kolloom
@Kolloom
Aug 05 2015 04:22 UTC
@bergsman00 did you closed the beginning div with > eg:<div class='row'>
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:24 UTC
@matteverson it works now, thanks
Darrell Wong
@darrell1226
Aug 05 2015 04:24 UTC
@matteverson I found out I needed a return false statement. Now I'm trying to get http://en.wikipedia.org/w/api.php?action=parse&format=json&callback=?&page='+query to work but it's giving me an error.
D
@bergsman00
Aug 05 2015 04:24 UTC
@Kolloom the challenge still saysEach of your Bootstrap buttons should be wrapped within its own div element with the class "col-xs-4"
Thank you by the way @Kolloom
CamperBot
@camperbot
Aug 05 2015 04:25 UTC
bergsman00 sends brownie points to @kolloom :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for kolloom
Darrell Wong
@darrell1226
Aug 05 2015 04:25 UTC
Now I found out that I didn't need to convert the spaces to dashes.
Kolloom
@Kolloom
Aug 05 2015 04:26 UTC
@bergsman00 care to paste the code?
and the challenge link?
D
@bergsman00
Aug 05 2015 04:27 UTC
<div class='row'>
<button class='col-xs-4 btn btn-block btn-primary'>Like</button>
<button class='col-xs-4 btn btn-block btn-info'>Info</button>
<button class='col-xs-4 btn btn-block btn-danger'>Delete</button>
</div>
Kolloom
@Kolloom
Aug 05 2015 04:27 UTC
oh the button should be wrapped with they own divs with the class col-xs-4
so there would be 4 divs
D
@bergsman00
Aug 05 2015 04:28 UTC
@Kolloom So I need to use div for each button…Oh man…I thought it would work within those open and closed divs. Thank you so much!
Kolloom
@Kolloom
Aug 05 2015 04:29 UTC
<div class='row'>
  <div class='col-xs-4'><button>stuff</button>
  ...
</div>
something like that
Darrell Wong
@darrell1226
Aug 05 2015 04:31 UTC
I am able to query the wikipedia api but I can't find something to return that is similar to what the search results are when I search Jimi Hendrix on http://codepen.io/GeoffStorbeck/full/MwgQea. The array I receive doesn't have these types of links.
Matt Everson
@matteverson
Aug 05 2015 04:33 UTC
@darrell1226 Dig deeper into the api: https://en.wikipedia.org/w/api.php?action=help&modules=query
Darrell Wong
@darrell1226
Aug 05 2015 04:34 UTC
@matteverson Am i supposed to use action=parse in part of my API query?
Matt Everson
@matteverson
Aug 05 2015 04:35 UTC
No
Darrell Wong
@darrell1226
Aug 05 2015 04:36 UTC
Am i supposed to use action=query then?
What I used before was http://en.wikipedia.org/w/api.php?action=parse&format=json&callback=?&page='+query
Matt Everson
@matteverson
Aug 05 2015 04:38 UTC
What led you to try action=parse?
Feners4
@Feners4
Aug 05 2015 04:38 UTC
how can I align my display pics in http://codepen.io/Feners4/pen/EjONEe
DTing
@dting
Aug 05 2015 04:38 UTC
@darrell1226 I wouldn't sweat it
@darrell1226 are you getting at least jimmy hendrix?
Matt Everson
@matteverson
Aug 05 2015 04:39 UTC
@darrell1226 There might be a way to make that work, but I think the query module is a better fit.
Darrell Wong
@darrell1226
Aug 05 2015 04:40 UTC
I read a website that used that to retrieve information. I tried query before but it didn't return anything useful, I'll have to look into again.
But I don't know what I'm supposed to be returning as search results in the search database.
I don't get anything from using query except a warning.
action parse at least gives me something.
DTing
@dting
Aug 05 2015 04:43 UTC
I used 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=' + encodeURI(newVal) + '&callback=JSON_CALLBACK' so I could do auto complete
Darrell Wong
@darrell1226
Aug 05 2015 04:45 UTC
I think I can use that @dting , at least I'm getting some results.
DTing
@dting
Aug 05 2015 04:47 UTC
@darrell1226 I hadn't realized i was getting different results until you pointed that out haha
Darrell Wong
@darrell1226
Aug 05 2015 04:48 UTC
I'm getting the same results as the example, thank you @dting
DTing
@dting
Aug 05 2015 04:48 UTC
nps
Rafael J. Rodriguez
@Rafase282
Aug 05 2015 04:51 UTC
I need help with the FCC repo
Anyone familiar with branching and pull request and summiting code for review? please pm me
well, I think thigns went well so nvm
Darrell Wong
@darrell1226
Aug 05 2015 05:07 UTC
@dting can you share yours?
Alex Labanino
@labanino
Aug 05 2015 05:09 UTC
Return Largest Numbers in Arrays @jscogg Because you are adding '...' the total would be 14, that why in the code below we have num-3 to total 11. I hope it helps.
if (str.length > num) {
        str = str.slice(0, num - 3) + '...';
    }
    return str;
Justin Scoggin
@jscogg
Aug 05 2015 05:16 UTC
@labanino wait... what? I finished that bonfire a while back... I'm confused.
Robert
@rc242
Aug 05 2015 05:18 UTC
heyo
Justin Scoggin
@jscogg
Aug 05 2015 05:20 UTC
hey @rc242 :wave:
Luis Felipe López G.
@luishendrix92
Aug 05 2015 05:21 UTC
Woo, finished the longest numbers in arrays bonfire:
function largestOfFour(arr) {
  return arr.map(function(numSet) {
    var longestNum = 0;
    for (var num in numSet) 
      if (numSet[num] > longestNum) {longestNum = numSet[num];}
    return longestNum;
});}
I wish I could make it shorter...
DTing
@dting
Aug 05 2015 05:25 UTC
@luishendrix92 Usually you only use for in for objects. For arrays you would usually use forEach
function largestOfFour(arr) {
  return arr.map(function(element) {
    var longestNum = 0;
    element.forEach(function(number) {
      if (number > longestNum) longestNum = number;
    });
    return longestNum;
  });
}
DrakeMikels
@DrakeMikels
Aug 05 2015 05:25 UTC
This message was deleted
Luis Felipe López G.
@luishendrix92
Aug 05 2015 05:26 UTC
@dting I know but I just like using forIn because I don't want to type function(){} and make a callback hell. I am ok with using at most two levels of iterative methods of the array prototype one inside the other.
Justin Scoggin
@jscogg
Aug 05 2015 05:29 UTC

Okay people, I'm working on the Search and Replace bonfire... I think I'm headed in the right direction, but I could use a little guidance. Here's my code so far:

function replace (str, before, after) {
  var strToArray = str.split(' ');
  for (var i = 0, l = strToArray.length; i < l; i++) {
    var current = strToArray[i];
    if (current === before) {
      // not sure what to do here... maybe something with Array.prototype.splice?
    }
  }
  // return end result;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");

Thanks ahead of time!

CamperBot
@camperbot
Aug 05 2015 05:29 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Luis Felipe López G.
@luishendrix92
Aug 05 2015 05:30 UTC
Anyway, thanks for reminding me of Math.max, I googled the MDN for it and I saw function getMaxOfArray(numArray) { return Math.max.apply(null, numArray); }
I sometimes forget how powerful Function.apply can be
Darrell Wong
@darrell1226
Aug 05 2015 05:31 UTC
@dting Can you figure out how to let my search function search more than once?
http://codepen.io/darrell1226/pen/EjryRM/
DTing
@dting
Aug 05 2015 05:32 UTC
@darrell1226 your seach isnt working for me
Robert
@rc242
Aug 05 2015 05:32 UTC
@jscogg try writing the code for replacing the string first
Darrell Wong
@darrell1226
Aug 05 2015 05:32 UTC
@dting OMG lol
Robert
@rc242
Aug 05 2015 05:32 UTC
bonfire Search and Replace
CamperBot
@camperbot
Aug 05 2015 05:32 UTC

:fire:Bonfire: Search and Replace :link:

function replace(str, before, after) {
 return str;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");

Perform a search and replace on the sentence using the arguments provided and return the new sentence.

for more info: bf details bf links bf script bf wiki bf spoiler

@darrell1226 okay its back to working i think
Darrell Wong
@darrell1226
Aug 05 2015 05:34 UTC
@dting It only works the first time, can't figure out why.
DTing
@dting
Aug 05 2015 05:35 UTC
@darrell1226 you could use $('ul').empty();
Darrell Wong
@darrell1226
Aug 05 2015 05:35 UTC
Where should I use that?
DTing
@dting
Aug 05 2015 05:35 UTC
@darrell1226 oh hmm lemme look again
@darrell1226 if i hit search twice it just adds the same elements to the list. over and over but ya you are right searching for something else does nothing.
    $.getJSON(url, function(data){
      $('ul').empty();
i think that works.
i think it was actually working before you just weren't clearning the previous results
Robert
@rc242
Aug 05 2015 05:39 UTC
I've realized that I suck as a UX person.
Darrell Wong
@darrell1226
Aug 05 2015 05:40 UTC
@dting wow how did you know that genius?
@dting sorry if that sounded rude.
DTing
@dting
Aug 05 2015 05:41 UTC
heh. nps. glad its working.
M Used
@mildused
Aug 05 2015 05:42 UTC
@dting forgot the end curly brace and semicolon :worried:
DTing
@dting
Aug 05 2015 05:42 UTC
@mildused theres more code i just showed the line before for context =P
Darrell Wong
@darrell1226
Aug 05 2015 05:45 UTC
@dting would i have to use angular to get an autocomplete feature for the search box or does jQuery do that also?
M Used
@mildused
Aug 05 2015 05:46 UTC
@darrell1226 jquery can help you
DTing
@dting
Aug 05 2015 05:53 UTC
@darrell1226 ya $(' ').change(function() {...})
Jason Healy
@jhealy86
Aug 05 2015 05:53 UTC
i remember doing web pages without jquery. had to use document.getElementByClass('classname');
instead of just $('.classname')
M Used
@mildused
Aug 05 2015 05:54 UTC
@darrell1226 @dting Found this using vanilla JS, pretty cool, http://devbridge.github.io/Vanilla-Autocomplete/
Luis Felipe López G.
@luishendrix92
Aug 05 2015 05:55 UTC
@jhealy86 I think it was getElementsByClassName and it didn't work in some versions of IE
M Used
@mildused
Aug 05 2015 05:55 UTC
Jason Healy
@jhealy86
Aug 05 2015 05:55 UTC
@luishendrix92 i think you're right. but that's why i always hated DOM. jquery has made things so much easier
M Used
@mildused
Aug 05 2015 05:56 UTC
@dting @darrell1226 Or one that's 2kb in size http://leaverou.github.io/awesomplete/
digitalcodebot
@digitalcodebot
Aug 05 2015 06:07 UTC
Hi everyone! I am trying to learn more about bootstrap and was wondering where it should be placed in the head element? should it be before my normalize.css and custom css? or does it matter ?
Darrell Wong
@darrell1226
Aug 05 2015 06:12 UTC
@dting can you look at my code? I added the change function but it's not working.
http://codepen.io/darrell1226/pen/EjryRM/
Jen
@calaminejen
Aug 05 2015 06:12 UTC
hey guys, I have a question regarding arrays, as required by the Address Book waypoint. CodeAcademy seems to believe that "mary" is not the second object in my array in the following code:

var contacts = ["bob", "mary"];

console.log(contacts1.phoneNumber);

M Used
@mildused
Aug 05 2015 06:13 UTC
console.log(contacts1)
Jen
@calaminejen
Aug 05 2015 06:13 UTC
that linked 1 is, in the actual code, a 1 inside brackets
M Used
@mildused
Aug 05 2015 06:13 UTC
heheh
Jen
@calaminejen
Aug 05 2015 06:14 UTC
the error message literally says "Make sure that mary is the second object in contacts"
M Used
@mildused
Aug 05 2015 06:14 UTC
just whack the computer and tell it it's drunk
Jen
@calaminejen
Aug 05 2015 06:15 UTC
it is drunk :(
oh my god
i figured it out: bob and mary are not meant to be in quotes.
fuckin a
excuse my french
DTing
@dting
Aug 05 2015 06:20 UTC
@darrell1226 that pen isnt loading for me
Darrell Wong
@darrell1226
Aug 05 2015 06:20 UTC
M Used
@mildused
Aug 05 2015 06:21 UTC
@darrell1226 same thing
Bill
@kirah1314
Aug 05 2015 06:21 UTC
@darrell1226 just says Loading................. at the bottom
Darrell Wong
@darrell1226
Aug 05 2015 06:21 UTC
maybe it's the change function, something's wrong , i need to delete it.
Bill
@kirah1314
Aug 05 2015 06:22 UTC
@darrell1226 your JS says Unexpected end of input
M Used
@mildused
Aug 05 2015 06:22 UTC
@darrell1226 paste your code in this http://www.javascriptlint.com/online_lint.php
missing } after function body
hint
CamperBot
@camperbot
Aug 05 2015 06:26 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
bf
CamperBot
@camperbot
Aug 05 2015 06:26 UTC
give the name of the bonfire and I'll try to look it up!
bf status
CamperBot
@camperbot
Aug 05 2015 06:26 UTC
  • hints: 3
bf
CamperBot
@camperbot
Aug 05 2015 06:26 UTC
we're talking about bonfire :fire: Bonfire: Chunky Monkey
DTing
@dting
Aug 05 2015 06:29 UTC
@darrell1226 I lied to you. .change doesnt fire until the input loses focus
Darrell Wong
@darrell1226
Aug 05 2015 06:30 UTC
Haha yeah, I thought I was using it incorrectly.
DTing
@dting
Aug 05 2015 06:30 UTC
@darrell1226 try this
$(document).ready(function(){
  'use strict';
  $('.query').on('keyup', search);
  $('.search').submit(search);
  function search() {
    var query = $('.query').val();
    var url = 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&callback=?&search='+query;
    $.getJSON(url, function(data){
      $('ul').empty();
      console.log(data);
      for (var i=0; i < data[3].length; i++) {
        if (data[2][i] !== "") {
          $('ul').append('<a href="'+data[3][i]+'"><li>'+data[2][i]+'</li></a>');
        }
      }  
    });
    return false;
  }
});
Darrell Wong
@darrell1226
Aug 05 2015 06:32 UTC
@dting well that works lol
@darrell1226 what is the search without the .search inside the paranthesis?
Oh it's the function?
DTing
@dting
Aug 05 2015 06:34 UTC
ya thats the function
its the same function you had for submit. since they are the same i just made it a name function instead of an anonymous one
Darrell Wong
@darrell1226
Aug 05 2015 06:35 UTC
Yeah, I would have wrote the entire function inside the paranthesis and then I'd be confused with the closing brackets and paranthesis. It's much cleaner writing it out separately.
DTing
@dting
Aug 05 2015 06:35 UTC
*function expression
bonfire monkey
CamperBot
@camperbot
Aug 05 2015 06:36 UTC

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

bf spoiler
CamperBot
@camperbot
Aug 05 2015 06:36 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
DTing
@dting
Aug 05 2015 06:38 UTC
bf help
CamperBot
@camperbot
Aug 05 2015 06:38 UTC
Sorry, can't find a bonfire called help. [ Check the map? ]
DTing
@dting
Aug 05 2015 06:38 UTC
@camperbot help
Darrell Wong
@darrell1226
Aug 05 2015 06:38 UTC
@dting You're really knowledgable, have you done this before?
DTing
@dting
Aug 05 2015 06:39 UTC
@darrell1226 i've only played with javascript. I do more python and java coding. Javascript interests me tho.
@dting its just
help
CamperBot
@camperbot
Aug 05 2015 06:51 UTC

Hi this is CamperBot! I can assist you in this chatroom :smile:

Basic commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BFNAME info on a bonfire

:unlock: More commands and info

:pencil: read more about camperbot on the FCC Wiki

DTing
@dting
Aug 05 2015 06:52 UTC
@dcsan thanks
oh and its
M Used
@mildused
Aug 05 2015 06:52 UTC
Thanks! @dting
CamperBot
@camperbot
Aug 05 2015 06:52 UTC
mildused sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1 | @dting | http://www.freecodecamp.com/dting
thanks @dting
CamperBot
@camperbot
Aug 05 2015 06:52 UTC
dcsan sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 2 | @dting | http://www.freecodecamp.com/dting
M Used
@mildused
Aug 05 2015 06:52 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 06:52 UTC
sorry mildused, you can't send brownie points to yourself! :sparkles: :sparkles:
M Used
@mildused
Aug 05 2015 06:52 UTC
haha
DTing
@dting
Aug 05 2015 06:52 UTC
yay! thanks @dcsan
M Used
@mildused
Aug 05 2015 06:52 UTC
thanks @dting
CamperBot
@camperbot
Aug 05 2015 06:52 UTC
mildused sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
DTing
@dting
Aug 05 2015 06:52 UTC
thanks @dcsan
CamperBot
@camperbot
Aug 05 2015 06:52 UTC
dting sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 30 | @dcsan | http://www.freecodecamp.com/dcsan
we finally plugged that hack @mildused
DTing
@dting
Aug 05 2015 06:52 UTC
lol
M Used
@mildused
Aug 05 2015 06:53 UTC
I didn't even know it existed. Just wanted to try
thanks @mildused @dting
CamperBot
@camperbot
Aug 05 2015 06:53 UTC
dcsan sends brownie points to @mildused and @dting :sparkles: :thumbsup: :sparkles:
:star: 25 | @mildused | http://www.freecodecamp.com/mildused
:star: 3 | @dting | http://www.freecodecamp.com/dting
thanks @dting
CamperBot
@camperbot
Aug 05 2015 06:53 UTC
dcsan sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
M Used
@mildused
Aug 05 2015 06:53 UTC
Wait, how did I get 25?
that one was too quick
DTing
@dting
Aug 05 2015 06:53 UTC
is the code for camperbot posted?
M Used
@mildused
Aug 05 2015 06:54 UTC
Think I can write a bot to give me thanks?
DTing
@dting
Aug 05 2015 06:54 UTC
wtf @mildused doesnt help anyone!
jk =)
M Used
@mildused
Aug 05 2015 06:54 UTC
Apparently I do...
DTing
@dting
Aug 05 2015 06:54 UTC
i bet he was here last night thanking himself
M Used
@mildused
Aug 05 2015 06:54 UTC
Supposedly*
DTing
@dting
Aug 05 2015 06:54 UTC
haha jk
thanks @mildused
CamperBot
@camperbot
Aug 05 2015 06:54 UTC
dting sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 26 | @mildused | http://www.freecodecamp.com/mildused
M Used
@mildused
Aug 05 2015 06:55 UTC
thanks @dting
CamperBot
@camperbot
Aug 05 2015 06:55 UTC
mildused sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 4 | @dting | http://www.freecodecamp.com/dting
its on 30s timeout atm
M Used
@mildused
Aug 05 2015 06:55 UTC
30 seconds?
I'm writing a script for this
knock yourself out :)
DTing
@dting
Aug 05 2015 06:55 UTC
ahah.
right now its just for the beta site
M Used
@mildused
Aug 05 2015 06:55 UTC
who has the highest?
when we go live we'll change the timeouts etc.
M Used
@mildused
Aug 05 2015 06:55 UTC
to how long?
if you want to hack on it you can
M Used
@mildused
Aug 05 2015 06:56 UTC
No IP bans?
DTing
@dting
Aug 05 2015 06:56 UTC
cool i'll take a look
we should have a bug bounty with you guys :ambulance:
Bill
@kirah1314
Aug 05 2015 06:57 UTC
^ :thumbsup:
kathyharvey
@kathyharvey
Aug 05 2015 06:58 UTC
Bot Testing
CamperBot
@camperbot
Aug 05 2015 06:58 UTC

:point_right: testingjson [wiki]

id: bd7139d8c441eddfaeb5bdef
name: "Waypoint: Pair Program on Bonfires"
dashedName: "waypoint-pair-program-on-bonfires"
difficulty: 0.44
challengeSeed: "119657641"
description: 
        - "Please note that the video for this challenge is a little outdated, and doesn't perfectly match these steps. We plan to record a new video soon."
        - "OK, we're finally ready to start pair programming!"
        - "Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of \"Agile\" Software Development, which you will hear more about later."
        - "Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse."
        - "The most popular tool for pair programming is Screenhero. You can download Screenhero for <a href='http://links.screenhero.com/e/c/eyJlbWFpbF9pZCI6Ik1qQTNNem9XQkNJQ1pBQUNjd0FYQVZrVEdnRkxNamtfX0JWZEdGVEpSZkVCWlRwbFpXRTBNamM0WVMxaE56SmlMVEV4WlRRdE9HUXpZUzFpWXpVNE1HRTJNalkxTldNNk1UUTJNVEEyQUE9PSIsInBvc2l0aW9uIjowLCJocmVmIjoiaHR0cDovL2RsLnNjcmVlbmhlcm8uY29tL3NtYXJ0ZG93bmxvYWQvZklYQU1UUUJBTEtQQkhQTC9TY3JlZW5oZXJvLnppcD9zb3VyY2U9d2ViIn0=' target='_blank'>Mac</a> or <a href='http://links.screenhero.com/e/c/eyJlbWFpbF9pZCI6Ik1qQTNNem9XQkNJQ1pBQUNjd0FYQVZrVEdnRkxNamtfX0JWZEdGVEpSZkVCWlRwbFpXRTBNamM0WVMxaE56SmlMVEV4WlRRdE9HUXpZUzFpWXpVNE1HRTJNalkxTldNNk1UUTJNVEEyQUE9PSIsInBvc2l0aW9uIjoxLCJocmVmIjoiaHR0cDovL2RsLnNjcmVlbmhlcm8uY29tL3NtYXJ0ZG93bmxvYWQvZklYQU1UUUJBTEtQQkhQTC9TY3JlZW5oZXJvLXNldHVwLmV4ZSJ9' target='_blank'>Windows</a>. Create your new user account from within the app."
        - "We have a special chat room for people ready to pair program. Go to our <a href='//gitter.im/FreeCodeCamp/LetsPair' target='_blank'>LetsPair chatroom on Gitter</a> and type \"Hello Pair Programmers!\""
        - "If someone is available, they will be your \"pair\" - the person you pair programming with."
        - "If no one gets back to you in the first few minutes, don't worry. There will be lots of opportunities to pair program in the future."
        - "If someone does get back to you, private message them and ask for the email address they used to register Screenhero."
        - "Add them as a new contact in Screenhero, then click the monitor-looking button to attempt to share your screen with them."
        - "Once the Screenhero session starts, your screen's margins will glow orange. You are now sharing your screen."
        - "Your pair will have their own cursor, and will be able to type text on his or her keyboard."
        - "Now it's time to tackle our Bonfires. You can begin them by advancing to the next challenge."
        - "Once you you finish pair programming, end the session in Screenhero session."
        - "Congratulations! You have completed your first pair programming session."
        - "Pair program as much as possible with different campers until you've completed all the Bonfire challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!"
        - "Mark this Waypoint complete and move on."
:pencil: read more about testingjson on the FCC Wiki
kathyharvey
@kathyharvey
Aug 05 2015 06:58 UTC
1
2
3
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 06:58 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 27 | @mildused | http://www.freecodecamp.com/mildused
update
CamperBot
@camperbot
Aug 05 2015 06:59 UTC
updating wiki...
kathyharvey
@kathyharvey
Aug 05 2015 06:59 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 06:59 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
testingjson.md | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-)
done code: 0
:computer:
Updating 5b124ab..73e8327 Fast-forward
:star: 28 | @mildused | http://www.freecodecamp.com/mildused
DTing
@dting
Aug 05 2015 06:59 UTC
talking about writing bots reminds me of this https://news.ycombinator.com/item?id=9543005
kathyharvey
@kathyharvey
Aug 05 2015 06:59 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 06:59 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 29 | @mildused | http://www.freecodecamp.com/mildused
M Used
@mildused
Aug 05 2015 07:00 UTC
This message was deleted
I'm so popular!
was that the 2048 hack?
kathyharvey
@kathyharvey
Aug 05 2015 07:00 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 07:00 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
i remember that
M Used
@mildused
Aug 05 2015 07:00 UTC
@kathyharvey restart
kathyharvey
@kathyharvey
Aug 05 2015 07:00 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 07:00 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 30 | @mildused | http://www.freecodecamp.com/mildused
DTing
@dting
Aug 05 2015 07:00 UTC
nah it was something else. just some game where you combine numbers and people were like competing on how to get the game to play itself the best
interesting...
kathyharvey
@kathyharvey
Aug 05 2015 07:01 UTC
This message was deleted
CamperBot
@camperbot
Aug 05 2015 07:01 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 31 | @mildused | http://www.freecodecamp.com/mildused
have you done server side node too or just working on JS?
kathyharvey
@kathyharvey
Aug 05 2015 07:01 UTC
This message was deleted
M Used
@mildused
Aug 05 2015 07:01 UTC
Agar.io?
kathyharvey
@kathyharvey
Aug 05 2015 07:01 UTC
This message was deleted
M Used
@mildused
Aug 05 2015 07:02 UTC
@dcsan , you turned it off?
Bill
@kirah1314
Aug 05 2015 07:02 UTC
thanks @camperbot
CamperBot
@camperbot
Aug 05 2015 07:02 UTC
kirah1314 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
kathyharvey
@kathyharvey
Aug 05 2015 07:02 UTC
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 07:02 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 32 | @mildused | http://www.freecodecamp.com/mildused
M Used
@mildused
Aug 05 2015 07:03 UTC
@dcsan, can you make a spam room?
Bill
@kirah1314
Aug 05 2015 07:03 UTC
camperbot thanks @kathyharvey
kathyharvey
@kathyharvey
Aug 05 2015 07:03 UTC
Bot's don't do thank you's
Thanks @mildused
CamperBot
@camperbot
Aug 05 2015 07:03 UTC
kathyharvey sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 33 | @mildused | http://www.freecodecamp.com/mildused
Bill
@kirah1314
Aug 05 2015 07:04 UTC
i believe there's a testing room already
geez you guys, get a room!
kathyharvey
@kathyharvey
Aug 05 2015 07:04 UTC
Silly Bot, thanks are for AI's
M Used
@mildused
Aug 05 2015 07:04 UTC
Okay, it's off
Lol
exactly, thanks @kirah1314
M Used
@mildused
Aug 05 2015 07:04 UTC
Sorry :(
Bill
@kirah1314
Aug 05 2015 07:05 UTC
i didn't get any brownie points :cry:
agario is pretty interesting
about @kirah1314
CamperBot
@camperbot
Aug 05 2015 07:05 UTC
:star: 89 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Aug 05 2015 07:05 UTC
oh wow
M Used
@mildused
Aug 05 2015 07:06 UTC
@dcsan, have you tried a newer clone of agar.io, vanar.io
no
M Used
@mildused
Aug 05 2015 07:06 UTC
@dcsan It's probably twice as frustrating
haha
M Used
@mildused
Aug 05 2015 07:06 UTC
instead of blobs, it's a bunch of spaceships
the Euro server is pretty popular against the US
Lindell C. Bailey
@SamusBailey
Aug 05 2015 07:11 UTC
hello
i was wondering
does code camp teach the user everything from there website or do they use external resources such as codeacdemy.com etc.
M Used
@mildused
Aug 05 2015 07:12 UTC
@SamusBailey codecademy is used, along with udacity
the newer curriculum will be more self contained, but there will still be external resources
Lindell C. Bailey
@SamusBailey
Aug 05 2015 07:14 UTC
@mildused thank you so much for the information; udacity gonna go look that up
Aleksandar B.
@aleksandar-b
Aug 05 2015 07:52 UTC
I am trying for 4 days to figure out Jafar's Husein exercise 12 on Functional Programing. I dont understand the solution. Please help.
function() {
    var movieLists = [
            {
                name: "Instant Queue",
                videos : [
                    {
                        "id": 70111470,
                        "title": "Die Hard",
                        "boxarts": [
                            { width: 150, height:200, url:"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg" },
                            { width: 200, height:200, url:"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg" }
                        ],
                        "url": "http://api.netflix.com/catalog/titles/movies/70111470",
                        "rating": 4.0,
                        "bookmark": []
                    },
                    {
                        "id": 654356453,
                        "title": "Bad Boys",
                        "boxarts": [
                            { width: 200, height:200, url:"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg" },
                            { width: 150, height:200, url:"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg" }

                        ],
                        "url": "http://api.netflix.com/catalog/titles/movies/70111470",
                        "rating": 5.0,
                        "bookmark": [{ id:432534, time:65876586 }]
                    }
                ]
            },
            {
                name: "New Releases",
                videos: [
                    {
                        "id": 65432445,
                        "title": "The Chamber",
                        "boxarts": [
                            { width: 150, height:200, url:"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg" },
                            { width: 200, height:200, url:"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg" }
                        ],
                        "url": "http://api.netflix.com/catalog/titles/movies/70111470",
                        "rating": 4.0,
                        "bookmark": []
                    },
                    {
                        "id": 675465,
                        "title": "Fracture",
                        "boxarts": [
                            { width: 200, height:200, url:"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg" },
                            { width: 150, height:200, url:"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg" },
                            { width: 300, height:200, url:"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg" }
                        ],
                        "url": "http://api.netflix.com/catalog/titles/movies/70111470",
                        "rating": 5.0,
                        "bookmark": [{ id:432534, time:65876586 }]
                    }
                ]
            }
        ];


    // Use one or more map, concatAll, and filter calls to create an array with the following items
    // [
    //     {"id": 675465,"title": "Fracture","boxart":"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg" },
    //     {"id": 65432445,"title": "The Chamber","boxart":"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg" },
    //     {"id": 654356453,"title": "Bad Boys","boxart":"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg" },
    //     {"id": 70111470,"title": "Die Hard","boxart":"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg" }
    // ];

    return movieLists.
      map(function(movieList) {
        return movieList.videos.
          map(function(video) {
            return video.boxarts.
              filter(function(boxart) {
                return boxart.width === 150;
              }).
              map(function(boxart) {
                return {id: video.id, title: video.title, boxart: boxart.url};
              });
          }).
          concatAll();
      }).
      concatAll();

}
@samosale that content gets critizied a lot
Aleksandar B.
@aleksandar-b
Aug 05 2015 07:55 UTC
@dcsan uh, I tought it was me. I was considering to quit FCC.
its offsite
FCC needs to replace wtih their own material...
Aleksandar B.
@aleksandar-b
Aug 05 2015 07:59 UTC
@dcsan I don't understand how after return video.boxarts. he can chain another map that returns hole objectreturn {id: video.id, title: video.title, boxart: boxart.url}; when he is in boxart array?
Edgar S. Hurtado
@edgarshurtado
Aug 05 2015 08:34 UTC

Hi, I’m having an issue with the addClass() method. I have an <i> tag without class but for some reason my code doesn’t work. This is my calling to addClass

$("#simbol").addClass( "wi wi-day-sunny-overcast" );

I’m missing something?

wops’ i found the problem =P I have 2 tags overlapping
space between tags right? @edgarshurtado
Edgar S. Hurtado
@edgarshurtado
Aug 05 2015 09:20 UTC

I had a tag which content i was modifying with jquery, and then I was trying to get a tag that was inside the previous one, but of course jQuery was get rid of it before I tried to select it.

this was my html

<h2 id=“title”><i id=“weather-icon”></i></h2>

and then I tried to do

$(“#title”).text(“something”);
$(“#weather-icon”).addClass(“weather-class”);

because I changed the #title content, I didn’t have the #weather-icon anymore, so of course I couldn’t add a class to it

Matthew Barber
@Honno
Aug 05 2015 09:21 UTC
function palindrome(str) {
  var str1 = str.toLowerCase(); // "a man, a plan, a canal. panama"
  var str2 = str1.replace(" ", ""); // "aman,aplan,acanal.panama"
  var str3 = str2.replace(",", ""); // "amanaplanacanal.panama"
  var str4 = str3.replace(".", ""); // "amanaplanacanalpanama"
  var array = str4.split(""); 
  var arrayReverse = array.reverse();
  var strReverse = arrayReverse.join(""); // "amanaplanacanalpanama"
  if (strReverse === str4) {
    return true;
  } else {
    return false;
  }
}
Why does "A man, a plan, a canal. Panama" not return true?
Matthew Barber
@Honno
Aug 05 2015 09:33 UTC

Cleaner version

function palindrome(str) {
  var strClean = str.toLowerCase().replace(" ", "").replace(",", "").replace(".", "");
  console.log(strClean);
  var array = strClean.split("");
  var arrayReverse = array.reverse();
  var strReverse = arrayReverse.join("");
  console.log(strReverse);
  if (strReverse === strClean) {
    return true;
  } else {
    return false;
  }
}

Still stuck xD

 console.log(strClean) //  "aman a plan, a canal panama"
console.log(strReverse) // ""amanap lanac a ,nalp a nama"
ok
Nary Sovan
@nary-dev
Aug 05 2015 09:35 UTC
use regex
Matthew Barber
@Honno
Aug 05 2015 09:36 UTC
Oh, doing those tuts for regex weren't for nothing huh @nary-dev xD
guess I need to learn quickly how to implement regex into js, ty
Nary Sovan
@nary-dev
Aug 05 2015 09:36 UTC
no problem
Matthew Barber
@Honno
Aug 05 2015 09:42 UTC
tfw half n hour on a easy task
Chirag Patel
@CPatel217
Aug 05 2015 10:32 UTC
hey all, need some help on regex...doing exercises at end of Eloquent Javascript chap. 9
I've been here for more than half hour trying to figure out
a regex for a word without the letter 'e'
Joris Labie
@labiej
Aug 05 2015 10:35 UTC
does [^e]+ ring a bell?
all you need to do is modify to check full words
Chirag Patel
@CPatel217
Aug 05 2015 10:41 UTC
hmm ok so i would have \b[^e\s]+\b
Joris Labie
@labiej
Aug 05 2015 10:41 UTC
what is \b?
matejhegedus
@matejhegedus
Aug 05 2015 10:42 UTC
I don't think you need to put \s into the brackets
Chirag Patel
@CPatel217
Aug 05 2015 10:42 UTC
\b is a word boundary
isnt that how you check for full words
Joris Labie
@labiej
Aug 05 2015 10:42 UTC
aha, best to try it no?
It depends on the structure of the input.
Single words are easily tested with /^[^e]+$/i
matejhegedus
@matejhegedus
Aug 05 2015 10:44 UTC
I take that back, you probably do need \s in there
Joris Labie
@labiej
Aug 05 2015 10:45 UTC
@CPatel217 which flags do you think you need?
Other than that it's correct
Chirag Patel
@CPatel217
Aug 05 2015 10:46 UTC
g and i flags
no you dont need i
just g
Joris Labie
@labiej
Aug 05 2015 10:47 UTC
you do need i, otherwise 'Error' will match
Chirag Patel
@CPatel217
Aug 05 2015 10:47 UTC
oh right
ok
Joris Labie
@labiej
Aug 05 2015 10:47 UTC
and depending on the input you'll need m as well
I think
Chirag Patel
@CPatel217
Aug 05 2015 10:48 UTC
hold on tho...im trying /^[^e]+$/i on regexr.com and its not working
Joris Labie
@labiej
Aug 05 2015 10:48 UTC
use word boundaries, that one only works for single words
Eugene Finn
@eugene-finn
Aug 05 2015 10:51 UTC
who knows the best way to explore the sublime text ? maybe online simulator?
Chirag Patel
@CPatel217
Aug 05 2015 10:53 UTC
ok thanks
Peter Daily
@thepeted
Aug 05 2015 10:56 UTC
@eugene-finn - This course is good - Lynda.com is subscription based but you can get a free trial: http://www.lynda.com/Sublime-Text-tutorials/Up-Running-Sublime-Text-2/114325-2.html
Chirag Patel
@CPatel217
Aug 05 2015 10:57 UTC
damn im not sure i get it though
you take the + out and it doesnt work
Joris Labie
@labiej
Aug 05 2015 10:58 UTC
"+" means you need at least 1 character in the word
HelooBlorld
@qzoxec
Aug 05 2015 10:59 UTC
Hey all - how do you run javascript code tests? Using the browser based console only prints the first result of loops
Chirag Patel
@CPatel217
Aug 05 2015 11:00 UTC
yea but combined with [^e] im getting confused
can you but [^e]+ in wrods
put words*
matejhegedus
@matejhegedus
Aug 05 2015 11:00 UTC
[^e] will match only one letter
Joris Labie
@labiej
Aug 05 2015 11:00 UTC
the [^e] matches everything except e
Chirag Patel
@CPatel217
Aug 05 2015 11:01 UTC
oh...got it
Joris Labie
@labiej
Aug 05 2015 11:01 UTC
regex takes some getting used to
Chirag Patel
@CPatel217
Aug 05 2015 11:02 UTC
match everything except e and have 1 or more occurences
got it got it
Joris Labie
@labiej
Aug 05 2015 11:02 UTC
yep
you can even use {2,} instead of +
because there aren't any words with 1 letter
Chirag Patel
@CPatel217
Aug 05 2015 11:03 UTC
right
hm good stuff. thanks.
Joris Labie
@labiej
Aug 05 2015 11:06 UTC
once you understand the basics I think this course is good. I know that the learncodethehardway series is good to learn best practices
George Tsoukatos
@Gts0uk
Aug 05 2015 11:07 UTC
where is regex important ?
why do we need to learn it ?
matejhegedus
@matejhegedus
Aug 05 2015 11:07 UTC
@labiej There are words with one letter and for example Italian has the word 'e'. I don't think it would be good to use {2,}.
Chirag Patel
@CPatel217
Aug 05 2015 11:07 UTC
oh man, thats the Zed Shaw guy, hes a crazy mofo
Joris Labie
@labiej
Aug 05 2015 11:08 UTC
@Gts0uk it is so powerful that dozens of lines of code can be reduced to a single line in some cases
@matejhegedus alright, so it should depend on the language
HelooBlorld
@qzoxec
Aug 05 2015 11:09 UTC
Hey all - how do you run javascript code tests? Using the browser based console only prints the first result of loops
Joris Labie
@labiej
Aug 05 2015 11:09 UTC
jsfiddle or repl.it
Chirag Patel
@CPatel217
Aug 05 2015 11:11 UTC
@labiej dude you dont know how much you are the man today
that repl.it is what I've been looking for
plus i need another regex course
needed*
been using codepen and console but this....yes, this is it
George Tsoukatos
@Gts0uk
Aug 05 2015 11:13 UTC
@labiej when we write JS ?
Joris Labie
@labiej
Aug 05 2015 11:13 UTC
I did the (start of the) C course and found it very nice
George Tsoukatos
@Gts0uk
Aug 05 2015 11:13 UTC
@labiej there was a free course on codeschool about regex
It's no free anymore :(
Joris Labie
@labiej
Aug 05 2015 11:14 UTC
@Gts0uk sure thing, there are several examples in the bonfires like verifying telephone numbers
George Tsoukatos
@Gts0uk
Aug 05 2015 11:14 UTC
ok I'll check out regex
I wish the codeschool course was still free though :P
Eugene Finn
@eugene-finn
Aug 05 2015 11:18 UTC
@thepeted thank you
Matthew Barber
@Honno
Aug 05 2015 11:22 UTC
function largestOfFour(arr) {
  var arrLargest = [];
  var arrLargestValue = 0;
  for(i = 0; i < arr.length; i++) {
    var acc = 0;
    for(j = 0; j < arr[i].length; j++) {
      acc += arr[i][j];
    }
    if(acc > arrLargestValue) {
      arrLargest = arr[i];
      arrLargestValue = acc;
    }
  }
  return arrLargest;
}

(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]));
comes up with
(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([5,27,39,1001]);expected [ 1000, 1001, 857, 1 ] to deeply equal [ 5, 27, 39, 1001 ]
What am I doing wrong?
OH
it's asking for the largest number, not the adding up of the array contents
dont mind me xD
sigh
Hemedi
@Hemedi
Aug 05 2015 11:24 UTC
help with Title case a sentence anybody?
CamperBot
@camperbot
Aug 05 2015 11:24 UTC
no wiki entry for: with title case a sentence anybody
:pencil: click here to create one now!after creating your page type update to reload it here
Hemedi
@Hemedi
Aug 05 2015 11:24 UTC
help title case a sentence
CamperBot
@camperbot
Aug 05 2015 11:24 UTC
no wiki entry for: title case a sentence
:pencil: click here to create one now!after creating your page type update to reload it here
HelooBlorld
@qzoxec
Aug 05 2015 11:26 UTC
thanks labiej
Joris Labie
@labiej
Aug 05 2015 11:26 UTC
@honno try using console.log in strategic places to follow your algorithm
Eko Julianto Salim
@ekojsalim
Aug 05 2015 11:26 UTC
help case a
CamperBot
@camperbot
Aug 05 2015 11:26 UTC
no wiki entry for: case a
:pencil: click here to create one now!after creating your page type update to reload it here
Joris Labie
@labiej
Aug 05 2015 11:26 UTC
@Hemedi Try using regular expressions
Eko Julianto Salim
@ekojsalim
Aug 05 2015 11:27 UTC
bonfire case a
CamperBot
@camperbot
Aug 05 2015 11:27 UTC

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");

Return the provided string with the first letter of each word capitalized.
For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

Joris Labie
@labiej
Aug 05 2015 11:29 UTC
bf spoiler
CamperBot
@camperbot
Aug 05 2015 11:29 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Eko Julianto Salim
@ekojsalim
Aug 05 2015 11:32 UTC
This message was deleted
CamperBot
@camperbot
Aug 05 2015 11:32 UTC
Sorry, can't find a bonfire called symmetric. [ Check the map? ]
HelooBlorld
@qzoxec
Aug 05 2015 11:35 UTC
bonfire chunky
CamperBot
@camperbot
Aug 05 2015 11:35 UTC

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

HelooBlorld
@qzoxec
Aug 05 2015 11:35 UTC
bf links
CamperBot
@camperbot
Aug 05 2015 11:35 UTC
links:
HelooBlorld
@qzoxec
Aug 05 2015 11:36 UTC
bf spoiler
CamperBot
@camperbot
Aug 05 2015 11:36 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
HelooBlorld
@qzoxec
Aug 05 2015 11:37 UTC
Has anyone here done Chunky Monkey? I am running into some issues with a nested For loop
George Tsoukatos
@Gts0uk
Aug 05 2015 11:38 UTC
lol
Binny Kim
@removed~BinnyK
Aug 05 2015 11:39 UTC
bf spoiler
CamperBot
@camperbot
Aug 05 2015 11:39 UTC
Sorry, can't find a bonfire called spoiler. [ Check the map? ]
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:40 UTC
@qzoxec What have you tried up until now?
HelooBlorld
@qzoxec
Aug 05 2015 11:40 UTC
I'm new, can I/should I past my code?
Binny Kim
@removed~BinnyK
Aug 05 2015 11:40 UTC
bonfire roman
CamperBot
@camperbot
Aug 05 2015 11:40 UTC

:fire:Bonfire: Roman Numeral Converter :link:

function convert(num) {
 return num;
}

convert(36);

Convert the given number into a roman numeral.
All <a href="http://www.mathsisfun.com/roman-numerals.html">roman numerals</a> answers should be provided in upper-case.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

Binny Kim
@removed~BinnyK
Aug 05 2015 11:40 UTC
bf spoiler
CamperBot
@camperbot
Aug 05 2015 11:40 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:41 UTC
@qzoxec Yeah, it's okay if you paste your code - we're all here to help you, thus we need to analyze your solution and explain it so that you actually understand the mechanics and not just pass the Bonfire - the purpose is to learn!
HelooBlorld
@qzoxec
Aug 05 2015 11:42 UTC
This message was deleted
jordanelizaga
@jordanelizaga
Aug 05 2015 11:43 UTC
Hi I'm trying to add a twitter button to my website by using twttr.widgets.createShareButton.
The problem is I'm loading twttr synchronously when I want to be able to change the share text everytime I press a button. But when I add twttr.widgets.createShareButton
to a click event, my website creates another button when I only want to edit the original button
matejhegedus
@matejhegedus
Aug 05 2015 11:43 UTC
@qzoxec You should put ```above and below the code when you're pasting it here.
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:44 UTC
@qzoxec
matejhegedus
@matejhegedus
Aug 05 2015 11:44 UTC
@qzoxec It will make it more readable. Paste it again.
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:44 UTC
function chunk(arr, size) {
    // Break it up.
    var newArr = [];
    var numOfIts = arr.length/size;

    for (var i = numOfIts; i>0; i--){
        var SubNewArr = [];

        for (var i2 = 0; i2<size; i2++){
            SubNewArr.push(arr[i2]);
        }
        arr = arr.slice(size);
        newArr = newArr.push(SubNewArr);
    }

return newArr;

}
chunk(['a', 'b', 'c', 'd'], 2);
HelooBlorld
@qzoxec
Aug 05 2015 11:45 UTC
This message was deleted
matejhegedus
@matejhegedus
Aug 05 2015 11:46 UTC
@qzoxec ` is the key below Escape on the keyboard.
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:46 UTC
@qzoxec I've formatted it above
HelooBlorld
@qzoxec
Aug 05 2015 11:46 UTC
function chunk(arr, size) {
  var newArr = [];
  var numOfIts = arr.length/size;
  for (var i = numOfIts; i>0; i--){
    var SubNewArr = [];
    for (var ii = 0; ii<size; ii++){
      SubNewArr.push(arr[ii]);
    }
    arr = arr.slice(size); 
    newArr = newArr.push(SubNewArr);  
  }
  return newArr;
}

chunk(['a', 'b', 'c', 'd'], 2);
I saw, just wanted to get it to work myself, thanks
So I couldn;t think through how to do this without 2 loops, 1 to tick off each nested array pushed, and the subloop to create each
unfortunately it doesn;t work
matejhegedus
@matejhegedus
Aug 05 2015 11:49 UTC
@qzoxec What result are you getting?
HelooBlorld
@qzoxec
Aug 05 2015 11:49 UTC
and empty array
an
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:52 UTC
@qzoxec When you are running this line of code newArr = newArr.push(SubNewArr)
You are assigning the return value from push to the newArr variable
It should only be newArr.push(SubNewArr)
The Array.prototype.push() method returns the new length of the array. Thus, after your first iteration, the newArr variable will be 1 since the new length of the array is 1 after you push one element.
Afterwards, the code will fail because the push method is defined on the prototype of the Array. Hence your code will fail in pushing an element into a primitive value
HelooBlorld
@qzoxec
Aug 05 2015 11:56 UTC
I see, I have corrected that line to read
    newArr.push(SubNewArr);
but I am getting the same result
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:58 UTC
I am getting the proper result in my console O_O
matejhegedus
@matejhegedus
Aug 05 2015 11:59 UTC
It works for me too.
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 11:59 UTC
@qzoxec This is the updated code that I pasted in my console:
```
function chunk(arr, size) {
  var newArr = [];
  var numOfIts = arr.length/size;
  for (var i = numOfIts; i>0; i--){
    var SubNewArr = [];
    for (var ii = 0; ii<size; ii++){
      SubNewArr.push(arr[ii]);
    }
    arr = arr.slice(size); 
    newArr.push(SubNewArr);  
  }
  return newArr;
}

chunk(['a', 'b', 'c', 'd'], 2);
Joris Labie
@labiej
Aug 05 2015 11:59 UTC
it only works well when the chunk-size is divisor of the array-length, no?
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:00 UTC
@labiej True - he needs to account for special cases in his code, but I think the Bonfire only provides divisors as the size
CamperBot
@camperbot
Aug 05 2015 12:00 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Joris Labie
@labiej
Aug 05 2015 12:00 UTC
So the last test will fail
@vzamfirescu it doesn't, last test is chunk([0, 1, 2, 3, 4, 5], 4)
Shane
@KHam0425
Aug 05 2015 12:02 UTC
my solution truncated the last response
let me look at it
matejhegedus
@matejhegedus
Aug 05 2015 12:02 UTC
Yeah, when you calculate the number of subarrays, you need to convert it to a whole number.
George Tsoukatos
@Gts0uk
Aug 05 2015 12:02 UTC
free bootstrap course
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:03 UTC
@labiej Personally, I've checked the solution that I built when I tackled this bonfire and I see that I've done it with only one for loop
George Tsoukatos
@Gts0uk
Aug 05 2015 12:03 UTC
you are welcome
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:03 UTC
@labiej Thus, avoiding the usage of parseInt or any other additional methods
Shane
@KHam0425
Aug 05 2015 12:03 UTC
how do I paste the code?
matejhegedus
@matejhegedus
Aug 05 2015 12:06 UTC
@thief425 Write ``` above and below the code.
Shane
@KHam0425
Aug 05 2015 12:06 UTC
well...
Joris Labie
@labiej
Aug 05 2015 12:06 UTC
@vzamfirescu was just hinting why the fixed solution didn't pass the test yet
Shane
@KHam0425
Aug 05 2015 12:06 UTC
problem is...that key is bound to screen lock
there's a pastebin to it
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:07 UTC
@labiej Yeah, indeed, but it is quite troublesome to build it using this version, because you need to account for many possible scenarios
Joris Labie
@labiej
Aug 05 2015 12:07 UTC
not really
Shane
@KHam0425
Aug 05 2015 12:07 UTC
I used a while loop
HelooBlorld
@qzoxec
Aug 05 2015 12:08 UTC
Ok, but my console didn't return any correct solutions
Joris Labie
@labiej
Aug 05 2015 12:08 UTC
just add && ii<arr.length in the for loop
@qzoxec can you show your current code?
HelooBlorld
@qzoxec
Aug 05 2015 12:08 UTC
I need to leave for work now but will again toonight thanks for the help @labiej and @vzamfirescu
Shane
@KHam0425
Aug 05 2015 12:08 UTC
i posted the solution in that pastebin link, btw
"a" solution
Joris Labie
@labiej
Aug 05 2015 12:09 UTC
Nice one @thief425
Shane
@KHam0425
Aug 05 2015 12:10 UTC
it's helpful for the next one, too
because it's essentially reversing that solution and using slice instead of splice
now, if only I could figure out how to solve the title case sentence : /
Joris Labie
@labiej
Aug 05 2015 12:12 UTC
@thief425 try to solve the tests one by one
bonfire a case
CamperBot
@camperbot
Aug 05 2015 12:12 UTC
Sorry, can't find a bonfire called a case. [ Check the map? ]
Joris Labie
@labiej
Aug 05 2015 12:12 UTC
bonfire Title
CamperBot
@camperbot
Aug 05 2015 12:12 UTC

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");

Return the provided string with the first letter of each word capitalized.
For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

Shane
@KHam0425
Aug 05 2015 12:13 UTC
well, my problem is, the logical answer didn't work
Joris Labie
@labiej
Aug 05 2015 12:13 UTC
Don't forget to make everything lowercase first
Shane
@KHam0425
Aug 05 2015 12:13 UTC
I split each word into an array, then iterated through the array
Joris Labie
@labiej
Aug 05 2015 12:13 UTC
what's the output?
Shane
@KHam0425
Aug 05 2015 12:13 UTC
well, I did an if else, on the collection
oddly enough, not what it should be
it's the same
Joris Labie
@labiej
Aug 05 2015 12:15 UTC
code please
Shane
@KHam0425
Aug 05 2015 12:16 UTC
so, i did for(var word in arr){ for(var i = 0; i < word.length; i++){ if(i > 0){arr[word].charAt(i).toLowerCase(); }else{arr[word].charAt(i).toUpperCase():} basically
Ozy Design & Software
@OzySky
Aug 05 2015 12:16 UTC
you need to join the array, I think
it expects a string
Shane
@KHam0425
Aug 05 2015 12:17 UTC
it's not changing the case though
Joris Labie
@labiej
Aug 05 2015 12:17 UTC
You can make an entire string lowercase in a single go
Shane
@KHam0425
Aug 05 2015 12:17 UTC
when I log it, yeah, that's easy enough
then charAt(0).toUpperCase();
Joris Labie
@labiej
Aug 05 2015 12:17 UTC
But you need to use str = str.toLowerCase(); to save that action
Shane
@KHam0425
Aug 05 2015 12:17 UTC
correct.
let me check it again
that code up there didn't have it split.
Joris Labie
@labiej
Aug 05 2015 12:18 UTC
There exists a method-chaining solution too
When the code doesn't work, try to use console.log throughout your code!
Shane
@KHam0425
Aug 05 2015 12:23 UTC
lol...convoluted, but now i just need to join it back together
i abuse logging
i'll log every time a variable is declared, assigned, or changed
then i have to clean it all back up
is there something more elegant than this: arr[word] = arr[word].replace(arr[word].charAt(0),arr[word].charAt(0).toUpperCase());
Joris Labie
@labiej
Aug 05 2015 12:25 UTC
function titleCase(str) {
  return str.toLowerCase().
             split(' ').
             map( function( elem ){
               return elem.charAt(0).toUpperCase()+elem.substr(1);
             }).join(' ');
}
that's my solution
matejhegedus
@matejhegedus
Aug 05 2015 12:26 UTC
arr[word] = arr[word][0].toUpperCase(); should work I think @thief425
Jorge Almeida
@Jorgixhallo
Aug 05 2015 12:26 UTC
bf small
CamperBot
@camperbot
Aug 05 2015 12:26 UTC

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.
The range will be an array of two numbers that will not necessarily be in numerical order.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

Joris Labie
@labiej
Aug 05 2015 12:26 UTC
@matejhegedus it won't
matejhegedus
@matejhegedus
Aug 05 2015 12:27 UTC
oh yeah, now I know
Shane
@KHam0425
Aug 05 2015 12:27 UTC
yeah, that'll just get me the first letter
matejhegedus
@matejhegedus
Aug 05 2015 12:27 UTC
you can't modify a string
Shane
@KHam0425
Aug 05 2015 12:27 UTC
it's done now
Joris Labie
@labiej
Aug 05 2015 12:27 UTC
yay
Chirag Patel
@CPatel217
Aug 05 2015 12:27 UTC
hey @labiej whats considered a word boundary? and not a word boundary?
or anyone for that matter
Joris Labie
@labiej
Aug 05 2015 12:27 UTC
I don't know, haven't used that before
Shane
@KHam0425
Aug 05 2015 12:29 UTC
function titleCase(str) {
  var wordHolder = [];
  var arr = str.split(' ');
  console.log(arr);
  for(var word in arr){
    arr[word] = arr[word].toLowerCase();
    arr[word] = arr[word].replace(arr[word].charAt(0),arr[word].charAt(0).toUpperCase());
  }
  var strFixed = arr.join(" ");
  console.log(arr);

  return strFixed;
}

titleCase("I'm a little tea pot");
wordHolder is unused.
can get rid of that line.
Joris Labie
@labiej
Aug 05 2015 12:29 UTC
looks clean @thief425
Shane
@KHam0425
Aug 05 2015 12:31 UTC
yeah, I just wish that the replace was cleaner
Shane
@KHam0425
Aug 05 2015 12:31 UTC
i'm sure everyone else here is as well, but I'm a bit proud that I'm self-taught all of this over the last year and a half.
Betsey Biggs
@betsbillabong
Aug 05 2015 12:32 UTC

Hey people! I have a CSS question. I'm doing the web design/HTML/CSS stuff in Codecademy to feel stronger on that before I move onto jquery and javascript (and while I wait for Beta and regular FCC to merge). I'm doing this assignment:

https://www.codecademy.com/en/courses/html-css-prj/projects/html-css-prj_broadway

Anyway, I'm trying to style a button that should have a 16-px padding around the text, but it's going full width. Can anyone tell me what's wrong with my code? Thanks!

.btn-main {
  background-color: #333;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 1.3px;
  padding: 16px 16px 16px 16px;
  text-decoration: none;
  text-transform: uppercase;
}

And in the HTML I'm simple calling

 <div class="jumbotron">
      <div class="container">  
        <div class="main">
          <h1>We are Broadway</h1>
          <p class="btn-main">Get Started</p>
        </div>
      </div>
    </div>

I'm not seeing my error. Can anyone help me? Thanks!

Shane
@KHam0425
Aug 05 2015 12:32 UTC
from zero coding to working, but inelegant solutions in 18 months, lol
matejhegedus
@matejhegedus
Aug 05 2015 12:33 UTC
@thief425 arr[word]=arr[word][0].toUpperCase() + arr[word].slice(1); What about this?
Shane
@KHam0425
Aug 05 2015 12:33 UTC
margin on text, not padding, no?
margin is internal, padding is external?
Chirag Patel
@CPatel217
Aug 05 2015 12:34 UTC
@matejhegedus yeah sorry should've done that first
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:34 UTC
@thief425 Margin is the distance between the outmost margin of the object and the next object; Padding is the interior distance between the content and the margin of the object
Shane
@KHam0425
Aug 05 2015 12:34 UTC
oh.
shouldn't the p class be "btn btn-main"?
Betsey Biggs
@betsbillabong
Aug 05 2015 12:37 UTC
@thief425 thank you so much! it was the margin thing. i always have a hard time with that. that's an easy way to remember it. i think generally speaking you are right about calling btn as well as btn-main, but in this exercise there's only just btn-main. (also, i think that might be bootstrap where you have to call them both?) anyway, THANK YOU! now i can move on with my day :-)
@vzamfirescu oh, okay. so it's the opposite, then? weirdly, setting the margin fixed my problem though!
Mihai
@mihaisavezi
Aug 05 2015 12:37 UTC
Hey guys, anyone seeing the same problem in "Map the debris" bonfire ? I'm getting a NaN when I try to return the value of the orbitalperiod. I'm returning the orbitalP in the middle to test the code. Tried searching for this problem in the gitter chat, no one seems to be having it.
function orbitalPeriod(arr) {
  arr = [{"name": "default", "avgAlt":20000.4433}];



  // orbital period math = 2*3.14*sqrt(avg distance^3/GM)

  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  var orbitalP = 2*Math.PI*Math.sqrt(Math.pow(arr.avgAlt+earthRadius,3)/GM);
  return Math.round(orbitalP);

  arr[0].OrbitalPeriod = arr[0].avgAlt;
  delete arr[0].avgAlt;
  arr[0].OrbitalPeriod = orbitalP;

  return arr;
}

orbitalPeriod([{name : "sputkin", avgAlt : 35873.5553}]);
matejhegedus
@matejhegedus
Aug 05 2015 12:38 UTC
@thief425 I think if you use the replace() method like you did, it will change every occurrence of the first letter in the word to uppercase. So for example "emergency" would become "EmErgEncy". I haven't tested it but I think that's how this part of your code would work.
arr[word] = arr[word].replace(arr[word].charAt(0),arr[word].charAt(0).toUpperCase());
Shane
@KHam0425
Aug 05 2015 12:38 UTC
@matejhegedus that is a bit cleaner, but not as clear what is happening
no, it worked the way I wrote it, but yours did, too
if I were reading it from another coder, I'd be confused as to exactly what it was doing, but your solution works.
is it just concatentating the upper case character with the rest of teh string?
matejhegedus
@matejhegedus
Aug 05 2015 12:40 UTC
@thief425 yes
Shane
@KHam0425
Aug 05 2015 12:42 UTC
easy enough
this romeo and juliet one is making me a bit crazy
i can return true/false hasOwnProperty(source), but I don't know how to then search for those with property:value = source.value
Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:44 UTC
@mihaisavezi You should first parse the parameters that are passed as part of the object to float in order to make sure that they are all converted to integers
Shane
@KHam0425
Aug 05 2015 12:45 UTC
bonfire 16 help
CamperBot
@camperbot
Aug 05 2015 12:45 UTC
Sorry, can't find a bonfire called 16 help. [ Check the map? ]
Shane
@KHam0425
Aug 05 2015 12:45 UTC
bonfire where art thou
CamperBot
@camperbot
Aug 05 2015 12:45 UTC

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.

type: bf details bf links bf spoiler

Grace
@dogbot101
Aug 05 2015 12:45 UTC
This message was deleted
matejhegedus
@matejhegedus
Aug 05 2015 12:46 UTC
@thief425 loop through the whole collection and if the values are the same, push it to the array.
Shane
@KHam0425
Aug 05 2015 12:47 UTC
i know I need the value from the kv pair
I thought I was doing that last night, but I didn't.
maybe I wasn't sending the whole object
just the matching property
Grace
@dogbot101
Aug 05 2015 12:48 UTC
@mihaisavezi nevermind my last comment
I'm trying to compare my code to yours
and I was looking at the wrong one !
:worried:
This message was deleted
arr = [{"name": "default", "avgAlt":20000.4433}];
This is an object within an array
Betsey Biggs
@betsbillabong
Aug 05 2015 12:53 UTC

Still confused on how to change the horizontal padding on buttons inside my Codecademy 'broadway' project. Now I'm making 'learn more' buttons. Again, I'd like them to just have a little padding to either side of the text, but no matter how I set 'padding' in CSS, it seems like they stay the same.

.btn-default {
  border: 1px solid #333;
  color: #333;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 1.3px;
  padding: 14px 30px;
  text-decoration: none;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 20px;
}
 <p class="btn-default">Learn more.</p>

?????!

Vlad Zamfirescu
@vzamfirescu
Aug 05 2015 12:54 UTC
@betsbillabong When you use the aggregated padding property, you need to specify all the paddings clockwise, starting for the top. If you only want horizontal padding, you should specify padding: 0px 20px 0px 20px This will set the left and right padding to 20px and the top and bottom to 0px
Grace
@dogbot101
Aug 05 2015 12:54 UTC
@mihaisavezi arr = [{"name": "default", "avgAlt":20000.4433}];
console.log (arr[0].avgAlt); will show 20000.4433
@mihaisavezi arr = [{"name": "default", "avgAlt":20000.4433}];
console.log (arr.avgAlt); will be undefined
Mihai
@mihaisavezi
Aug 05 2015 13:10 UTC
@dogbot101 Hi, I managed to solve it on my own. I wanted to give default value to name and avgAlt in case they're not provided. But I realised I wasn't doing it right so I changed the code. And I was doing some other silly mistakes, but managed to solve them and pass the tests. :D
Grace
@dogbot101
Aug 05 2015 13:11 UTC
That's awesome!
@mihaisavezi Glad you were able to figure it out!
Shane
@KHam0425
Aug 05 2015 13:11 UTC
how do I get the key that's linked to the value?
Ozy Design & Software
@OzySky
Aug 05 2015 13:13 UTC
.keys i think should do it
Mihai
@mihaisavezi
Aug 05 2015 13:18 UTC
@dogbot101 Thanks ! And thanks for helping as well; I mean I always start to understand my code better and look for blockages once I ask for help in the chatroom, weirdly enough haha
Sophanarith Sok
@sok213
Aug 05 2015 13:22 UTC
for many of the bonfire exercises I've gotten an error similar to this: "expected [ Array(4) ] to deeply equal [ Array(4) ]" What does exactly does this mean? I have dealt with this error in the past many times, but I still don't understand the meaning of it. Can someone elaborate, please?
Omar
@oab00
Aug 05 2015 13:27 UTC
@sok213 it's just telling you that the array given from the function you made does not equal the test answer..
the arrays maybe too big to show on the test window so it just shortcuts it to your array does not equal my array
Array(4) I think means that both arrays have 4 elements but those elements aren't equal
@thief425 have u figured out that bonfire yet?
CamperBot
@camperbot
Aug 05 2015 13:30 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Sophanarith Sok
@sok213
Aug 05 2015 13:32 UTC
@oab00 makes sense, thanks.
Shane
@KHam0425
Aug 05 2015 13:41 UTC
@oab00 no, but I'll have to deal with that later.
work drama has started for the day.
dave oh
@david-oh-git
Aug 05 2015 13:46 UTC
hello everybody
please help!!!!!!!!!!!
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:48 UTC

Can a function in global execution context be called a "closure" of the global execution context?

A closure is a function which closes over it's bounding function's variables.

Rephrase: A closure is a function (execution context) which closes over it's bounding function's variable in it's parent execution context.

And the functions in a global execution context also closes over variables in the global execution context.
So can the normal functions be also called closures

justindobbs
@justindobbs
Aug 05 2015 13:51 UTC
@sok213 if you wrap your array in JSON.stringify() you can see more details on your return value
Sophanarith Sok
@sok213
Aug 05 2015 13:51 UTC
@hirako-shinji let us see your code?
dave oh
@david-oh-git
Aug 05 2015 13:52 UTC
i have written and deleted alot
Sophanarith Sok
@sok213
Aug 05 2015 13:52 UTC
@justindobbs I am currently coding everything on a javascript toolkit which allows me to see everything I need :)
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:53 UTC
@sok213 JS toolkit?
Sophanarith Sok
@sok213
Aug 05 2015 13:53 UTC
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:53 UTC

@sok213

403 Permission Denied

You do not have permission for this request /javascript-tester.html

Sophanarith Sok
@sok213
Aug 05 2015 13:54 UTC
I can see my output through the web console
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:54 UTC
@sok213 how do i access it? Why am I denied access?
justindobbs
@justindobbs
Aug 05 2015 13:54 UTC
cool, i'll have to try that sometime
Sophanarith Sok
@sok213
Aug 05 2015 13:55 UTC
here is the link
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:56 UTC
@sok213 but it says access denied.
Sophanarith Sok
@sok213
Aug 05 2015 13:56 UTC
hmm that's weird
try copying the link into the address bar?
or just google Javascript tester and click on the first link
Abhisek Pattnaik
@abhisekp
Aug 05 2015 13:58 UTC

Can a function in global execution context be called a "closure" of the global execution context?

A closure is a function which closes over it's bounding function's variables.

Rephrase: A closure is a function (execution context) which closes over it's bounding function's variable i.e. its parent execution context.

And the functions in a global execution context also closes over variables in the global execution context.
So can the normal functions be also called closures

@sok213 it works if I use a singapore proxy. :P
Sophanarith Sok
@sok213
Aug 05 2015 14:04 UTC
noice.
Abhisek Pattnaik
@abhisekp
Aug 05 2015 14:04 UTC
@sok213 why are you using a JS Tester? What good does it do?
help debugging
CamperBot
@camperbot
Aug 05 2015 14:05 UTC

:point_right: debugging [wiki]

Debugging helps you identify and remove errors from (computer hardware or software).

Use repl.it to help you debug your code. It shows the console output on the right as well as errors and lets you share your code snippets with other people.

:pencil: read more about debugging on the FCC Wiki

Sophanarith Sok
@sok213
Aug 05 2015 14:05 UTC
^There you go!
Thanks @camperbot !
CamperBot
@camperbot
Aug 05 2015 14:05 UTC
sok213 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
Abhisek Pattnaik
@abhisekp
Aug 05 2015 14:05 UTC
@sok213 but http://repl.it is better.
@sok213 and so is https://coderpad.io (supports pair programming too but no saved code snippets sharing)
Sophanarith Sok
@sok213
Aug 05 2015 14:07 UTC
I see, thanks for the links
Abhisek Pattnaik
@abhisekp
Aug 05 2015 14:08 UTC
@sok213 you could've said thanks @abhisekp so that I could've got some brownies. :P
Omar
@oab00
Aug 05 2015 14:09 UTC
woah real time coding on the web! that's some next level stuff
Sophanarith Sok
@sok213
Aug 05 2015 14:09 UTC
Thanks @sok213
CamperBot
@camperbot
Aug 05 2015 14:09 UTC
sorry sok213, you can't send brownie points to yourself! :sparkles: :sparkles:
Sophanarith Sok
@sok213
Aug 05 2015 14:09 UTC
crap.
...
Thanks @abhisekp ..
CamperBot
@camperbot
Aug 05 2015 14:13 UTC
sok213 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 23 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Aug 05 2015 14:15 UTC
thanks @abhisekp
thanks @abhisekp
CamperBot
@camperbot
Aug 05 2015 14:15 UTC
sorry abhisekp, you can't send brownie points to yourself! :sparkles: :sparkles:
maxiedk
@maxiedk
Aug 05 2015 14:17 UTC
hey guys. a bit stumped by bonfire#24. everything is green, but it doesn't get marked as done. http://repl.it/BAVA
CamperBot
@camperbot
Aug 05 2015 14:17 UTC
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Moisés Man
@moigithub
Aug 05 2015 14:17 UTC
bf pair
CamperBot
@camperbot
Aug 05 2015 14:17 UTC

:fire:Waypoint: Pair Program on Bonfires :link:

119657641

Please note that the video for this challenge is a little outdated, and doesn't perfectly match these steps. We plan to record a new video soon.
OK, we're finally ready to start pair programming!
Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of "Agile" Software Development, which you will hear more about later.
Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse.
The most popular tool for pair programming is Screenhero. You can download Screenhero for <a href='http://links.screenhero.com/e/c/eyJlbWFpbF9pZCI6Ik1qQTNNem9XQkNJQ1pBQUNjd0FYQVZrVEdnRkxNamtfX0JWZEdGVEpSZkVCWlRwbFpXRTBNamM0WVMxaE56SmlMVEV4WlRRdE9HUXpZUzFpWXpVNE1HRTJNalkxTldNNk1UUTJNVEEyQUE9PSIsInBvc2l0aW9uIjowLCJocmVmIjoiaHR0cDovL2RsLnNjcmVlbmhlcm8uY29tL3NtYXJ0ZG93bmxvYWQvZklYQU1UUUJBTEtQQkhQTC9TY3JlZW5oZXJvLnppcD9zb3VyY2U9d2ViIn0=' target='_blank'>Mac</a> or <a href='http://links.screenhero.com/e/c/eyJlbWFpbF9pZCI6Ik1qQTNNem9XQkNJQ1pBQUNjd0FYQVZrVEdnRkxNamtfX0JWZEdGVEpSZkVCWlRwbFpXRTBNamM0WVMxaE56SmlMVEV4WlRRdE9HUXpZUzFpWXpVNE1HRTJNalkxTldNNk1UUTJNVEEyQUE9PSIsInBvc2l0aW9uIjoxLCJocmVmIjoiaHR0cDovL2RsLnNjcmVlbmhlcm8uY29tL3NtYXJ0ZG93bmxvYWQvZklYQU1UUUJBTEtQQkhQTC9TY3JlZW5oZXJvLXNldHVwLmV4ZSJ9' target='_blank'>Windows</a>. Create your new user account from within the app.
We have a special chat room for people ready to pair program. Go to our <a href='//gitter.im/FreeCodeCamp/LetsPair' target='_blank'>LetsPair chatroom on Gitter</a> and type "Hello Pair Programmers!"
If someone is available, they will be your "pair" - the person you pair programming with.
If no one gets back to you in the first few minutes, don't worry. There will be lots of opportunities to pair program in the future.
If someone does get back to you, private message them and ask for the email address they used to register Screenhero.
Add them as a new contact in Screenhero, then click the monitor-looking button to attempt to share your screen with them.
Once the Screenhero session starts, your screen's margins will glow orange. You are now sharing your screen.
Your pair will have their own cursor, and will be able to type text on his or her keyboard.
Now it's time to tackle our Bonfires. You can begin them by advancing to the next challenge.
Once you you finish pair programming, end the session in Screenhero session.
Congratulations! You have completed your first pair programming session.
Pair program as much as possible with different campers until you've completed all the Bonfire challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!
Mark this Waypoint complete and move on.

type: bf details bf links bf spoiler

Moisés Man
@moigithub
Aug 05 2015 14:18 UTC
spam!!
Sophanarith Sok
@sok213
Aug 05 2015 14:18 UTC
no thanks @camperbot ..
@moigithub It is definitely a bug
You have the correct code
FCC gets buddy sometimes
buggy*
Moisés Man
@moigithub
Aug 05 2015 14:19 UTC
@maxiedk if i recall u need to return a 2d array like this
[[ 'A',' T'], ['T', 'A'], ['C', 'G'], ['G', 'C'],['A', 'T' ]]
Sophanarith Sok
@sok213
Aug 05 2015 14:20 UTC
oops