These are chat archives for FreeCodeCamp/Help

16th
Sep 2015
Dona Hertel
@cocofan
Sep 16 2015 00:00
I'm working on Bonfire: no repeats please and I was wondering if there's a way to get around creating all permutations and then filtering them. I came up with a formula that works for only one group of adjacent letters but doesn't extent to two or more. I'm trying to avoid doing all permutations as this is extremely computational intensive if you have a long string (its O(n!) for gods sakes!). Is it okay to just do all the perms or would that be a bad solution (I notice the test dont use more than 7 characters which would be doable)
Baktybek
@Baktybek
Sep 16 2015 00:02
@Matko95 worked! ;)
Mateja Trifunovski
@Matko95
Sep 16 2015 00:03
@cocofan for FCC purposes it would be doable, but try to think of a solution that's scalable
and 7! is still 5040 :)
Dona Hertel
@cocofan
Sep 16 2015 00:05
Okay. Would there be a formula for this. I tried looking on the internet but couldn't find one.
Well...forget it. I think I have a different idea.
BruceJamesH
@BruceJamesH
Sep 16 2015 00:17
@0x0936 I'll do what I have to to deconstruct the wall. Pair programming sounds good - just hope I can hold up my end.
@DealPete Yes, I am. Not so basic to me.
kgoode517
@kgoode517
Sep 16 2015 00:18

Stuck on Waypoint: Make Instances of Objects with a Constructor Function
Here is my code what am I doing wrong?
var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car(function()){
this.engines = 1;
};

//Add the property "engines" to myCar, and make it a number.

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

Nvm solved it helps when I read directions.
Moisés Man
@moigithub
Sep 16 2015 00:22
@kgoode517 if u check above the Car function declaration.. it do not have/accept any kind of arguments
var Car = function() { ( ) <-- parenthesis are empty
the comment says...
Add the property "engines" to myCar,
myCar.theProperty = value;
kgoode517
@kgoode517
Sep 16 2015 00:26
@moigithub thank you that is exactly what I added.
ninjatron
@ninjatron
Sep 16 2015 00:28
hey
could anyone help me with a specific question
Hans van Riet
@hansinla
Sep 16 2015 00:30
@ninjatron yes
ninjatron
@ninjatron
Sep 16 2015 00:30
@hansinla how could i verify ownership of a business
say i have a this simple app in which businesses are listed
Hans van Riet
@hansinla
Sep 16 2015 00:31
@ninjatron Each state has a registry
ninjatron
@ninjatron
Sep 16 2015 00:31
and when someone from that business registers my app and demand to take control of company page
so you say i should scrape data from those registries
?
Hans van Riet
@hansinla
Sep 16 2015 00:32
@ninjatron That’s the most obvious choice IMO
ninjatron
@ninjatron
Sep 16 2015 00:32
hmmm....
but how about foreign businesses?
Hans van Riet
@hansinla
Sep 16 2015 00:33
@ninjatron Each company also has a federal tax ID. I think you’re out of luck if you’re searching for a universal solution.
CamperBot
@camperbot
Sep 16 2015 00:33
hansinla sends brownie points to @ninjatron :sparkles: :thumbsup: :sparkles:
:star: 94 | @ninjatron | http://www.freecodecamp.com/ninjatron
Hans van Riet
@hansinla
Sep 16 2015 00:34
I did?
Mateja Trifunovski
@Matko95
Sep 16 2015 00:35
tax must be simiral to thanks :D
CamperBot
@camperbot
Sep 16 2015 00:35
if you want to thank someone, put an @ before their name!
Mateja Trifunovski
@Matko95
Sep 16 2015 00:35
This message was deleted
ninjatron
@ninjatron
Sep 16 2015 00:38
i am great right
i get answer to my questions and on top of it i get appreciation from the answerer
Hans van Riet
@hansinla
Sep 16 2015 00:40
@Matko95 lol
Moisés Man
@moigithub
Sep 16 2015 00:42
think
think you
Mateja Trifunovski
@Matko95
Sep 16 2015 00:44
it's not that aswell :D
Moisés Man
@moigithub
Sep 16 2015 00:44
@moigithub think you
@camperbot got a hiccup
@moigithub luck
Gary Lacey
@galacey
Sep 16 2015 00:50
Hi, I've just completed mutation and am starting falsy bouncer. Bothof these send two aguments to the function - an array and an empty string. The empty string is not used in either. What's the reason for the empty string that's sent to the function but not used. Thanks.
Jeremiah
@jerrydtm
Sep 16 2015 00:53
So, I am needing some with the .pop() function
Hans van Riet
@hansinla
Sep 16 2015 00:53
@galacey No they only send an array to the function as argument. Are you looking at the tests?
Gary Lacey
@galacey
Sep 16 2015 00:55
mutation(["hello", "hey"], ""); it's the empty string after the array, just wondered why it's there
Hans van Riet
@hansinla
Sep 16 2015 00:57
@galacey They must have changed that since I did those assignments, but as you can see only the first argument (arr) is used in the function. Just ignore everything else.
jtingley
@jtingley
Sep 16 2015 00:58
+1 for @hansinla . I don't remember those being there when I did those
Gary Lacey
@galacey
Sep 16 2015 00:58
@hansinla thanks . wasn't sure if i was missing something
CamperBot
@camperbot
Sep 16 2015 00:58
galacey sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 366 | @hansinla | http://www.freecodecamp.com/hansinla
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:13
In manage packages with NPM, how to pass npm test step? Do I need to add anything in test.js?
Rory Smith
@alanbuchanan
Sep 16 2015 01:21
@aniruddhabarapatre i assume you need to have npm installed some unit testing framework(s)?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:23
@alanbuchanan That wasn't a requirement as I followed every step. This is the starting waypoint of Node.
Rory Smith
@alanbuchanan
Sep 16 2015 01:23
hmmm
is there no package.json?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:24
Hey guys, on my project here, how can I make it so that the navbar doesn't overlap the area where it jumps to when I click a link on it?
Rory Smith
@alanbuchanan
Sep 16 2015 01:24
(i haven't got there yet)
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:24
What I'm talking about should be easier to see on the full page example
Hans van Riet
@hansinla
Sep 16 2015 01:25
@JelaniThompson add a margin-top or an empty <div> with a certain height.
Britton Overall
@boverall
Sep 16 2015 01:27
Hi - trying to familiarize myself with Regex. I have a string "The rougher the seas, the smthr we sail" (no quotes) and am applying the following Regex: /\b[^aeiouy\s]+\b/i - It's picking up "smthr" but I think it should be picking up the comma instead - does anyone know why it doesn't?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:27
@alanbuchanan Np. Thanks. There is a package.json and added test.js too. But it's empty.
CamperBot
@camperbot
Sep 16 2015 01:27
aniruddhabarapatre sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 352 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:28
@boverall https://regex101.com/#javascript This is your friend.
Rory Smith
@alanbuchanan
Sep 16 2015 01:28
@aniruddhabarapatre how infuriating, that there are no further instructions
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:29
@alanbuchanan It's either no instructions, or I missed something.
Now  you've installed something, and used `npm ls` to show what's going on.

If you look at the package.json file, it has this rather odd bit in it:

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },

npm can be used as a task runner, and almost every module and project
will have a test script that runs to make sure everything is good.  In
order to help remind you to do this, npm puts a "always failing" test
in there by default.

First, create a file called `test.js`.  It doesn't have to do anything,
really.  (This is npm class, not testing class.)  But it has to exit
without throwing an error, or else the test fails.

Then, edit your `package.json` file to make your scripts section look like
this instead:

  "scripts": {
    "test": "node test.js"
  },
It does say that it has to exit without throwing any error.
Britton Overall
@boverall
Sep 16 2015 01:32
Thanks @aniruddhabarapatre . I tried it in regex101 and it looks like it's still picking up "smthr" instead of the comma. Any idea why it would skip over it?
CamperBot
@camperbot
Sep 16 2015 01:32
boverall sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles:
:star: 211 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre
Matt Everson
@matteverson
Sep 16 2015 01:32
@boverall Do you want it to only return the comma? Because , and space are both non-word characters, so there's no way for the \b markers to match in your regex around that comma.
Britton Overall
@boverall
Sep 16 2015 01:36
@matteverson . I'm trying to match "smthr", but just not clear on why it's not picking up the comma bc when I take out \s it matches on the space. Do you know why I would have to explicitly exclude the space but not punctuation?
Rory Smith
@alanbuchanan
Sep 16 2015 01:38
@aniruddhabarapatre can you show your package.json?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:38
@matteverson I'm clueless on this one
@alanbuchanan My package.json
{
  "name": "@aniruddhabarapatre/workspace",
  "version": "1.0.0",
  "description": ",-----.,--.                  ,--. ,---.   ,--.,------.  ,------.     '  .--./|  | ,---. ,--.,--. ,-|  || o   \\  |  ||  .-.  \\ |  .---'     |  |    |  || .-. ||  ||  |' .-. |`..'  |  |  ||  |  \\  :|  `--,      '  '--'\\|  |' '-' ''  ''  '\\ `-' | .'  /   |  ||  '--'  /|  `---.      `-----'`--' `---'  `----'  `---'  `--'    `--'`-------' `------'     -----------------------------------------------------------------",
  "main": "server.js",
  "dependencies": {
    "@linclark/pkg": "^1.0.2",
    "async": "^0.2.10",
    "express": "^3.2.6",
    "socket.io": "^0.9.17"
  },
  "devDependencies": {},
  "scripts": {
    "test": "node test.js",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC"
}
Rory Smith
@alanbuchanan
Sep 16 2015 01:41
@aniruddhabarapatre looks fine. i can't figure that one out :worried:
Jonathan Reasor
@abraxasrex
Sep 16 2015 01:42
Anybody here who knows about MongoDB or know somewhere to point me? I'm getting "Error connecting to mongo. connect ECONNREFUSED" on the "CONNECT" portion of the tutorial, and googling just leads to solutions that are over my head. I would just skip it for now and move on, but this is all there is left to do before the full stack section!!
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:43
@alanbuchanan Me neither. I think something has to be in test.js for tests to pass. I tried with simple assert(true === true)with no luck
Jonathan Reasor
@abraxasrex
Sep 16 2015 01:45
in addition, the node and express stuff in general is really deep in terminology I haven't encountered yet. i guess that's what I get for not having a comp sci bg tho, so i can't complain in good faith...
Matt Everson
@matteverson
Sep 16 2015 01:47
@boverall \b matches the place where a string of word characters (think alphanumeric) switches to non-word characters. "seas" before the comma, is tested between two word boundaries. The next section tested is ", " which doesn't have any other characters in between, so it fails because you require at least 1 (the +). The next section tested is "the", which has an e, and so on. I usually stay away from \b and use \s as my word markers instead.
Rory Smith
@alanbuchanan
Sep 16 2015 01:48
@aniruddhabarapatre what are you typing to execute the test? npm test?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:49
Hey guys! Can anyone here pinpoint the reason why there are white gaps in between my sections (.sec)'s?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:50
how-to-npm verify @alanbuchanan That's the command, it's been asking to run to verify if everything is ok
Mateja Trifunovski
@Matko95
Sep 16 2015 01:53
@JelaniThompson you need to specify the margin
@JelaniThompson since your h2 is the top element
h2{
margin-top:0;
}
rbunz
@rbunz08
Sep 16 2015 01:55
@alanbuchanan I figured out a semi easier way to toggle the navigation but im still having some issues
Alanna M
@weirdhockeygirl16
Sep 16 2015 01:55
Math.floor(Math.random() * (9 - 0 + 1)) + 0
return Math.random();
}
how do i make this have a integer instead of a decimal
rbunz
@rbunz08
Sep 16 2015 01:56
Can someone help me with some jquery troubleshooting?
Britton Overall
@boverall
Sep 16 2015 01:56
Ah got it, thanks @matteverson
CamperBot
@camperbot
Sep 16 2015 01:56
boverall sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 382 | @matteverson | http://www.freecodecamp.com/matteverson
Mateja Trifunovski
@Matko95
Sep 16 2015 01:56
This message was deleted
Rory Smith
@alanbuchanan
Sep 16 2015 01:57
@rbunz08 yeah i remember it being a pain to get right
Matt Everson
@matteverson
Sep 16 2015 01:57
@abraxasrex Check the waypoint that helps you set up for basejumps again. You should just have to create a data directory and start mongo. Check that when you run it, mongod doesn't throw any errors.
Alanna M
@weirdhockeygirl16
Sep 16 2015 01:57
this was for Waypoint: Generate Random Whole Numbers within a Range
Mateja Trifunovski
@Matko95
Sep 16 2015 01:57
@weirdhockeygirl16 how do you mean a integer instead of decimal?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:58
@Matko95 Wait, do you mean the margin of the nav bar or the h2 elements? It's really odd that each color used to take up one page's worth of screen and now it's just split by a white bar, haha
Alanna M
@weirdhockeygirl16
Sep 16 2015 01:58
whole number instead of a decimal
@Matko95
Mateja Trifunovski
@Matko95
Sep 16 2015 01:58
@weirdhockeygirl16 oh :) Math.floor() does that job
it rounds to the nearest number, going downwards
rbunz
@rbunz08
Sep 16 2015 01:59

I have a navigation that shows links while the screen is bigger than 770px. When it is smaller than that I have a navigation img button that shows and then used Jquery to toggle between the img and the navigation links when clicked.

The problem is that once I use this toggle function, if I go back to it being big screen the links have disappeared? How do I get it to use the toggle only when it is small screen and the links to always be shown when it is bigger??

Alanna M
@weirdhockeygirl16
Sep 16 2015 02:00
Math.floor(Math.random() * (9 - 0 + 1)) + 0
return Math.random();
}
Rory Smith
@alanbuchanan
Sep 16 2015 02:00
@rbunz08 have you tried using media queries?
Mateja Trifunovski
@Matko95
Sep 16 2015 02:00
@JelaniThompson the h2 elements
Alanna M
@weirdhockeygirl16
Sep 16 2015 02:00
so how would i make this return a whole number
Math.floor(Math.random() * (9 - 0 + 1)) + 0
return Math.random();
}
rbunz
@rbunz08
Sep 16 2015 02:00
@alanbuchanan in my css but can you use it in your javascript?
Mateja Trifunovski
@Matko95
Sep 16 2015 02:00
@weirdhockeygirl16 could you explain what you are trying to do?
@weirdhockeygirl16 Math.random() will give you a random number between 0 and 1, Math.floor(Math.random()) will give you 0
Alanna M
@weirdhockeygirl16
Sep 16 2015 02:01
im trying to do Waypoint: Generate Random Whole Numbers within a Range
Mateja Trifunovski
@Matko95
Sep 16 2015 02:02
@weirdhockeygirl16 you need to return this return Math.floor(Math.random()*(max-min+1)+min);
Alanna M
@weirdhockeygirl16
Sep 16 2015 02:02
@Matko95 thank you!
CamperBot
@camperbot
Sep 16 2015 02:02
weirdhockeygirl16 sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 297 | @matko95 | http://www.freecodecamp.com/matko95
Rory Smith
@alanbuchanan
Sep 16 2015 02:03
@rbunz08 i think i know what you mean, but not sure how to solve it. for mine i just played around with it until it worked
it might have something to do with the active class of the menu
Jonathan Reasor
@abraxasrex
Sep 16 2015 02:04
@matteverson the setup for basejumps comes after the mongodb module. can i do them in reverse order?
rbunz
@rbunz08
Sep 16 2015 02:04
@alanbuchanan I got it!! I used
 if($(window).width() <= 770){

}
around the button function
Rory Smith
@alanbuchanan
Sep 16 2015 02:05
@rbunz08 nice :thumbsup:
Matt Everson
@matteverson
Sep 16 2015 02:26
@abraxasrex Sorry, I see the map has changed there. learnyoumongo should walk you through the same sort of thing. I'd check mongod's startup output.
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:30
can someone explain this to me please?
var size = 8;

var board = "";

for (var y = 0; y < size; y++) {
  for (var x = 0; x < size; x++) {
    if ((x + y) % 2 == 0)
      board += " ";
    else
      board += "#";
  }
  board += "\n";
}

console.log(board);
i dont understand why it's x + y % 2
Rory Smith
@alanbuchanan
Sep 16 2015 02:31
@YanKozlovskiy to check if it's odd or even
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:31
oh
what kind of math is this?
i feel like i need more practice
Mateja Trifunovski
@Matko95
Sep 16 2015 02:31
@YanKozlovskiy it's moduo
wiki moduo
CamperBot
@camperbot
Sep 16 2015 02:31
no wiki entry for: moduo
:pencil: click here to create one now!after creating your page type update to reload it here
Rory Smith
@alanbuchanan
Sep 16 2015 02:32
wiki modulo
CamperBot
@camperbot
Sep 16 2015 02:32
no wiki entry for: modulo
:pencil: click here to create one now!after creating your page type update to reload it here
Mateja Trifunovski
@Matko95
Sep 16 2015 02:32
wiki modulo
CamperBot
@camperbot
Sep 16 2015 02:32
no wiki entry for: modulo
:pencil: click here to create one now!after creating your page type update to reload it here
Mateja Trifunovski
@Matko95
Sep 16 2015 02:32
hmm :D
Rory Smith
@alanbuchanan
Sep 16 2015 02:32
haha
Mateja Trifunovski
@Matko95
Sep 16 2015 02:32
@YanKozlovskiy In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus).
Rory Smith
@alanbuchanan
Sep 16 2015 02:32
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:32
is there like a course i can take online?
Mateja Trifunovski
@Matko95
Sep 16 2015 02:32
for math?
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:34
for that modulo math
i feel like there's more to it
understanding the basics is really important
Rory Smith
@alanbuchanan
Sep 16 2015 02:35
@YanKozlovskiy n % 2 is just a way to check if a number is even. you'll see it everywhere from now on. you wouldn't even need to understand %, just know that all it does is give the remainder
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:36
knowing the answer is great and all but i want to learn to understand why it works
Mateja Trifunovski
@Matko95
Sep 16 2015 02:36
there are free courses on math on khanacademy
afaik
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:36
thanks :)
CamperBot
@camperbot
Sep 16 2015 02:36
if you want to thank someone, put an @ before their name!
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:37
thanks @Matko95 and @alanbuchanan
CamperBot
@camperbot
Sep 16 2015 02:37
yankozlovskiy sends brownie points to @matko95 and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 298 | @matko95 | http://www.freecodecamp.com/matko95
:star: 353 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:37
FYI I just found this course on coursera
Hans van Riet
@hansinla
Sep 16 2015 02:37
@YanKozlovskiy There’s not more to it. It’s the remainder after a division.
Yan Kozlovskiy
@YanKozlovskiy
Sep 16 2015 02:38
i just answered my own question... learning is hard for me but now i'm doing a lot better
i hope that link helps everyone out
Rafael J. Rodriguez
@Rafase282
Sep 16 2015 03:06

Wiki Update!

Everything but ziplines from HTML and CSS to Intermediate bonfires are fully covered in the wiki now. Between now and tomorrow I'm going to do the upper bonfire and automated testign and debugging section. From there progress may be slower as starting from Avanced bonfires everythign is new to me.

I have revised the code, used proper for loops instead of using the one built for objects all the time, and did some cleanup on the styling of the code. You can see the progress on my wiki and also on the FCC wiki

I always update my wiki first before pushing to the FCC one and the pages might not have 100% the same content as I tend to cover more on mine that might be too much for the FCC one.

As always, free free to follow/star my wiki and enjoy and contribute to the FCC's wiki. Feel free to contact me about anythign regarding to the wikis.

rbunz
@rbunz08
Sep 16 2015 03:22
I have my jquery set so that it only goes off if the screen is smaller than 770px. However it only registers what the screen size is when the page first comes up. If I change the size of the screen after it doesnt go...How do I get it to register when the screen size changes
Hans van Riet
@hansinla
Sep 16 2015 03:25
@rbunz08
$( window ).resize(function() {
  $( "#log" ).append( "<div>Handler for .resize() called.</div>" );
});
rbunz
@rbunz08
Sep 16 2015 03:29
@hansinla I dont totally understand this... what do I put in the spots with yellow?
Hans van Riet
@hansinla
Sep 16 2015 03:30
@rbunz08
$( window ).resize(function() {
  // do here what you want to do when the screen resizes
});
@rbunz08 Is that more clear?
rbunz
@rbunz08
Sep 16 2015 03:34
@hansinla This is my new code...is there anyway to write this better as a large portion of it is repeated
/* toggle navigation on button click*/
if ($(window).width() < 770) {
  $('.nav.navbar-nav.navbar-right button').on('click', function() {
    $('.nav.navbar-nav.navbar-right li').toggle();
    $('.nav.navbar-nav.navbar-right li a').toggle();
  });
};
// recognise if the window changes size
$( window ).resize(function() {
  if ($(window).width() < 770) {
    $('.nav.navbar-nav.navbar-right button').on('click', function() {
      $('.nav.navbar-nav.navbar-right li').toggle();
      $('.nav.navbar-nav.navbar-right li a').toggle();
    });
  };
});
Hans van Riet
@hansinla
Sep 16 2015 03:34
@rbunz08
```
/* toggle navigation on button click*/
if ($(window).width() < 770) {
 doMyResize();
};
// recognise if the window changes size
$( window ).resize(function() {
  doMyResize();
  };
});

function doMyResize(){
 $('.nav.navbar-nav.navbar-right button').on('click', function() {
    $('.nav.navbar-nav.navbar-right li').toggle();
    $('.nav.navbar-nav.navbar-right li a').toggle();
  });
}
rbunz
@rbunz08
Sep 16 2015 03:35
@hansinla Isnt that the same?
Hans van Riet
@hansinla
Sep 16 2015 03:37
I was still editing. You may want to check closing brackets, but this is the idea.
rbunz
@rbunz08
Sep 16 2015 03:37
o ok..
@hansinla
Hans van Riet
@hansinla
Sep 16 2015 03:39
@rbunz08 To avoid repeat, put the repeated code in a function and call that function repeatedly.
rbunz
@rbunz08
Sep 16 2015 03:39
@hansinla thanks!
CamperBot
@camperbot
Sep 16 2015 03:39
rbunz08 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 367 | @hansinla | http://www.freecodecamp.com/hansinla
rbunz
@rbunz08
Sep 16 2015 03:40
@hansinla The only other problem I have now is then when I am in my smaller screen and use the toggle.... if go I back to big screen the navigation bar dissapears
Hans van Riet
@hansinla
Sep 16 2015 03:42
@rbunz08 In that case you’ll need to modify your resize method and make the nav bar reappear when the screen expands to > 770px.
Andreas
@a-nilss
Sep 16 2015 03:42
Hi guys, I got distracted by work stuff and was gone for like a month. Now that I logged in again most of the exercises that I had completed are now not marked as complete. Has anyone else seen that happen?
Hans van Riet
@hansinla
Sep 16 2015 03:43
No, there are some new exercises. Maybe just catch up on those, but it’s not necessary as long as you do all the ziplines.
Andreas
@a-nilss
Sep 16 2015 03:44
Ok, Thanks @hansinla :)
CamperBot
@camperbot
Sep 16 2015 03:44
if you want to thank someone, put an @ before their name!
Phantom Bughunter
@mgrunenwald
Sep 16 2015 03:53
Hi fellow campers — I’m having an issue with the chunky monkey bonfire. I’m fairly certain I’ve solved it, but my code isn’t passing the tests for some reason. Anyone else run into this?
Hans van Riet
@hansinla
Sep 16 2015 03:57
@mgrunenwald Can you show us your code here?
wiki format
CamperBot
@camperbot
Sep 16 2015 03:58

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and 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

Phantom Bughunter
@mgrunenwald
Sep 16 2015 04:03
var newArray = [];
var chunkArray = [];

function chunk(arr, size) {
var arrLength = arr.length;

for (var i = 0; i < arrLength; i += size) {
chunkArray = arr.slice(i, i + size);
newArray.push(chunkArray);
}

return newArray;
}
Barrett
@Tao0fpooh
Sep 16 2015 04:05

im stumped...for some reason it says engine is not assigned as a number
var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
this.engine = 1;
//Add the property "engines" to myCar, and make it a number.

Jeremy Gorniak
@Gornstats
Sep 16 2015 04:08
@Tao0fpooh this keyword only works when called inside a function/object. Try referencing the Car() object that was created instead
Hans van Riet
@hansinla
Sep 16 2015 04:08
@mgrunenwald You probably want to start with declaring your variables within the function and not as globals.
rbunz
@rbunz08
Sep 16 2015 04:09
@hansinla got it!! thanks
CamperBot
@camperbot
Sep 16 2015 04:09
rbunz08 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:warning: rbunz08 already gave hansinla points
Hans van Riet
@hansinla
Sep 16 2015 04:09
@rbunz08 Great
rbunz
@rbunz08
Sep 16 2015 04:09
This message was deleted
// toggle navigation on button click if screen is < 770px
if ($(window).width() <= 770) {
 smallScreen();
};

// recognise if the window changes size
$(window).resize(function() {
  if ($(window).width() <=  770) {
    smallScreen();
  };
  if ($(window).width() > 770) {
    original();
  };
});

function smallScreen(){
 $('.nav.navbar-nav.navbar-right button').on('click', function() {
    $('.nav.navbar-nav.navbar-right li').toggle();
    $('.nav.navbar-nav.navbar-right li a').toggle();
  });
};

function original(){
  $('.nav.navbar-nav.navbar-right li').show();
  $('.nav.navbar-nav.navbar-right li a').show();
};
Hans van Riet
@hansinla
Sep 16 2015 04:11
@rbunz08 looks great!
Phantom Bughunter
@mgrunenwald
Sep 16 2015 04:11
@hansinla that was it! Thanks very much!
CamperBot
@camperbot
Sep 16 2015 04:11
mgrunenwald sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 368 | @hansinla | http://www.freecodecamp.com/hansinla
Phantom Bughunter
@mgrunenwald
Sep 16 2015 04:12
What was wrong with declaring the variables as globals in this instance, though?
Barrett
@Tao0fpooh
Sep 16 2015 04:12
@Gornstats still lost
Hans van Riet
@hansinla
Sep 16 2015 04:13
@mgrunenwald Technically nothing (although it’s advisable to avoid global variables), but in this case it seems to throw off the testing code.
Jeremy Gorniak
@Gornstats
Sep 16 2015 04:13
@Tao0fpooh var myCar = new Car(); creates a new Car object called 'myCar'. If you want to add an engine variable to just that object, you should reference it directly instead of using this
@Tao0fpooh oh, and I think the property is meant to be called 'engines' not 'engine'. to past the tests
Phantom Bughunter
@mgrunenwald
Sep 16 2015 04:15
@hansinla I see. I’ll keep that in mind for upcoming exercises!
Barrett
@Tao0fpooh
Sep 16 2015 04:16
@Gornstats not passing with engine or engines
Jeremy Gorniak
@Gornstats
Sep 16 2015 04:16
@Tao0fpooh share your code again
Barrett
@Tao0fpooh
Sep 16 2015 04:17
@Gornstats var myCar = new Car();
this.engine = 1;
Jeremy Gorniak
@Gornstats
Sep 16 2015 04:18
@Tao0fpooh 'this' is your problem. You're not referencing myCar, you're referencing the window/global object
@Gornstats try calling .engine on 'myCar'
kgoode517
@kgoode517
Sep 16 2015 04:19
On Bonfire:Factorialize a Number why does this not work by multiplying all the way back to zero?

function factorialize(num) {
for(i=0;i<num;i++){
var newNum = num*num-1;
};
return newNum;
}

factorialize(5);

Hans van Riet
@hansinla
Sep 16 2015 04:20
@kgoode517 because anything times zero is zero?
Mateja Trifunovski
@Matko95
Sep 16 2015 04:21
@kgoode517 it's that, and you declare a new variable through every iteration
Hans van Riet
@hansinla
Sep 16 2015 04:21
@Matko95 good catch
Mateja Trifunovski
@Matko95
Sep 16 2015 04:22
@kgoode517 so every iteration you get newNum=5*5-1
kgoode517
@kgoode517
Sep 16 2015 04:22
@Matko95 how would I correct that?
Mateja Trifunovski
@Matko95
Sep 16 2015 04:22
@kgoode517 the idea is that you increment i and multiply by i until num, or decrement i and multiply i until you reach 1
@kgoode517 and note that factoralize(0) is equal to 1
Robert Richey
@0x0936
Sep 16 2015 04:24
so hard to avoid showing recursive answer
kgoode517
@kgoode517
Sep 16 2015 04:25
@0x0936 I have seen the recursive anwser but I dont understand it. I am trying to solve it with methods I understand but that doesnt seem to be working either.
Robert Richey
@0x0936
Sep 16 2015 04:26
5! = 5 * 4 * 3 * 2 * 1 = 120
Mateja Trifunovski
@Matko95
Sep 16 2015 04:27
or yeah you can use recursion
Robert Richey
@0x0936
Sep 16 2015 04:27
the factorial of a non-negative number 0 or 1 is 1
Barrett
@Tao0fpooh
Sep 16 2015 04:31
@Gornstats thanks! I got it
CamperBot
@camperbot
Sep 16 2015 04:31
tao0fpooh sends brownie points to @gornstats :sparkles: :thumbsup: :sparkles:
:star: 299 | @gornstats | http://www.freecodecamp.com/gornstats
Robert Richey
@0x0936
Sep 16 2015 04:33
@kgoode517 is that what you've seen?
function factorialize(num) {
  if (num < 2) { return 1; }
  return num * factorialize(num - 1);
}
kgoode517
@kgoode517
Sep 16 2015 04:36
@0x0936 No this

function factorialize(num) {
if (num === 0 || num == 1) { return 1; }
return num * factorialize(num-1);
}

factorialize(5);

Robert Richey
@0x0936
Sep 16 2015 04:37
it's the same thing, just written slightly differently. the if condition is exactly the same, using more characters
kgoode517
@kgoode517
Sep 16 2015 04:39
@0x0936 its just left a sour taste in my mouth. I understand it after reading through it but I think Im just going to move on to the next bonfire.
Robert Richey
@0x0936
Sep 16 2015 04:39

call 1: return 5 *
call 2: return 4 *
call 3: return 3 *
call 4: return 2 *
call 5: return 1

return 5 * 4 * 3 * 2 * 1

Robert Richey
@0x0936
Sep 16 2015 04:48
function factorialize(num) {
  var sum = 1;
  while (num > 1) {
    sum *= num--;
  }
  return sum;
}
kgoode517
@kgoode517
Sep 16 2015 04:53
@0x0936 That makes perfect sense thank you
CamperBot
@camperbot
Sep 16 2015 04:53
kgoode517 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 149 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Sep 16 2015 04:55
Great! learning is the goal, glad I could help. I've benefited by learning from enough answers that I don't think it's a sin to share, so long as you understand it before submitting
kgoode517
@kgoode517
Sep 16 2015 04:57
@0x0936 that's what I'm going for I could google and find every single one of these answers but if I don't understand it is not going to help.
Robert Richey
@0x0936
Sep 16 2015 05:01
variable name sum is probably better named product
or total
Robert Smith
@Tanker5419
Sep 16 2015 05:09
I need some help with the reverse a string bonfire please? I have the following but it doesn't seem to work, and I can't figure out why. '''
CamperBot
@camperbot
Sep 16 2015 05:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Robert Smith
@Tanker5419
Sep 16 2015 05:09
'''function reverseString(str) {
var revStr = str.split().reverse().join('');
return revStr;
string(revStr)
}
reverseString('hello', 'Howdy', 'Greetings from Earth');
CamperBot
@camperbot
Sep 16 2015 05:09
:bulb: to format code use backticks! ``` more info
Robert Smith
@Tanker5419
Sep 16 2015 05:10
```function reverseString(str) {
var revStr = str.split().reverse().join('');
return revStr;
string(revStr)
}
reverseString('hello', 'Howdy', 'Greetings from Earth');
DJ
@qualitymanifest
Sep 16 2015 05:10
@Tanker5419 you're not splitting it
you need to specify where you're going to split
and i'm not sure what "string(revStr)" is supposed to be doing
Thomas Vaeth
@thomasvaeth
Sep 16 2015 05:12
Has anyone gone back to the pomodoro clock and tried to build it using Angular?
Robert Smith
@Tanker5419
Sep 16 2015 05:16
@qualitymanifest Thank you for your help! I though string(revStr) was converting the array back to a string
CamperBot
@camperbot
Sep 16 2015 05:16
tanker5419 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 214 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Sep 16 2015 05:17
no problem, glad you got it. and yeah, it's the .join('') that converts it back to a string
Hans van Riet
@hansinla
Sep 16 2015 05:21
@thomasvaeth I decided NOT to do that. LOL
Thomas Vaeth
@thomasvaeth
Sep 16 2015 05:26
@hansinla I think I'm going to go for it. It shouldn't that difficult.
Hans van Riet
@hansinla
Sep 16 2015 05:34
@thomasvaeth Good for you! I decided to do Wiki And Calculator as angular projects.
Akira Laine
@AkiraLaine
Sep 16 2015 05:39

Hey guys, we just launched a Twitter account for FCC news! Follow it now: https://twitter.com/CamperNewsBot

PS: It's automated :D

justindobbs
@justindobbs
Sep 16 2015 05:41
I've updated my voting basejump if anyone is interested in testing in. https://rocky-ridge-1707.herokuapp.com/
Dona Hertel
@cocofan
Sep 16 2015 06:09
in Bonfire: Friendly Date Ranges are we to treat both 2015 and 2016 as the 'current' year? Otherwise, test 4 doesn't make sense to me.
DTing
@dting
Sep 16 2015 06:17
bf friendly
CamperBot
@camperbot
Sep 16 2015 06:17

:fire:Bonfire: Friendly Date Ranges :link:

function friendly(str) {
  return str;
}

friendly(['2015-07-01', '2015-07-04']);

Implement a way of converting two dates into a more friendly date range that could be presented to a user.

more info:  bf details | bf links | hint

DTing
@dting
Sep 16 2015 06:19
@cocofan The fourth test only requires showing the months and days because teh years are the same.

It must not show any redundant information in the date range.

For example, if the year and month are the same then only the day range should be displayed.

Saurabh
@saurabh-gahlot
Sep 16 2015 06:35
Hi all, this is my first time here....
Ali-Haider5
@Ali-Haider5
Sep 16 2015 06:35
Please help anyone?
//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};

var Bike = function() {
  // Only change code below this line.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  this.getSpeed = function () {
    return addUnit(this.speed);
  };

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
Saurabh
@saurabh-gahlot
Sep 16 2015 06:36
Hi Ali, can you share the question also?
Ali-Haider5
@Ali-Haider5
Sep 16 2015 06:46
Help help help please:
Waypoint: Make Object Properties Private
//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};

var Bike = function() {
  // Only change code below this line.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  this.getSpeed = function () {
    return addUnit(this.speed);
  };

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
CamperBot
@camperbot
Sep 16 2015 06:46
no wiki entry for: help help pleasewaypoint make object properties privatelets create an object with a two functions one attached as a property and one notvar car function thisgear 1 function addstylestyleme return the current gear is styleme thisgetgear function return addstylethisgear var bike function only change code below this line thisspeed 100 function addunitvalue return value kmh thisgetspeed function return addunitthisspeed only change code above this linevar mycar new carvar mybike new bikeifmybikehasownpropertygetspeedfunction return jsonstringifymybikegetspeed
:pencil: click here to create one now!after creating your page type update to reload it here
Ali-Haider5
@Ali-Haider5
Sep 16 2015 06:47
@saurabh-gahlot sorry i didn;t understand?
Saurabh
@saurabh-gahlot
Sep 16 2015 06:48
@Ali-Haider5 Share the full details of the question ...
Ali-Haider5
@Ali-Haider5
Sep 16 2015 06:49
@saurabh-gahlot I want to solve this challenge Waypoint: Make Object Properties Private
This message was deleted
CamperBot
@camperbot
Sep 16 2015 06:50
:warning: no user found for saurabh-gahlot
Saurabh
@saurabh-gahlot
Sep 16 2015 06:54
@Ali-Haider5

@Ali-Haider5 //Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

var Bike = function() {
// Only change code below this line.
speed = 100;
function addUnit(value) {
return value + "KM/H";
}

this.getSpeed = function () {
return addUnit(speed);
};

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};

Ali-Haider5
@Ali-Haider5
Sep 16 2015 06:56
@saurabh-gahlot why can't I write this. speed?
Saurabh
@saurabh-gahlot
Sep 16 2015 06:57
Beacause it should not be accessible ...
Bill
@kirah1314
Sep 16 2015 06:57
@saurabh-gahlot you just have to remove this
Saurabh
@saurabh-gahlot
Sep 16 2015 06:58
Yes...
Bill
@kirah1314
Sep 16 2015 06:59
that will make the function private
Ali-Haider5
@Ali-Haider5
Sep 16 2015 07:00
@thanks @kirah1314 that was my question?
CamperBot
@camperbot
Sep 16 2015 07:00
ali-haider5 sends brownie points to @thanks and @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thanks
:star: 240 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Isabelle Lepez
@Isabellle
Sep 16 2015 07:13
Hi all, quick question for you - I'm trying to return the largest number for each of 4 given arrays. I first start with the sort function; everything fine, but for the last one; the sort function seems to not work properly - have you experienced that?
(console.log results below)
[1, 3, 4, 5]
[13, 18, 26, 27]
[32, 35, 37, 39]
[1, 1000, 1001, 857]
DTing
@dting
Sep 16 2015 07:15
post your code
help formatting
CamperBot
@camperbot
Sep 16 2015 07:15

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and 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

DTing
@dting
Sep 16 2015 07:15
oh actually
i can tell you why
sort will sort lexigraphically unless you provide a compare function
it converts numbers to strings and sorts them
Isabelle Lepez
@Isabellle
Sep 16 2015 07:16
Thanks @dting :)
CamperBot
@camperbot
Sep 16 2015 07:16
millinet sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1184 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 16 2015 07:18
Isabelle Lepez
@Isabellle
Sep 16 2015 07:20
Oh thank you for sharing this @dting
CamperBot
@camperbot
Sep 16 2015 07:20
millinet sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: millinet already gave dting points
Manish Gupta
@mformanish
Sep 16 2015 07:51
Hi All
I need Help with Bonfir - Mutations

function mutation(arr) {
var el1 = arr[0];
var el2 = arr[1];
var found = null;
for(var i=0;i<el2.size-1;i++){
if(el1.indexOf(el2[i]) !== -1){
found = true
}
else {
found = false;
break;
}
}
return found;
}

mutation(["hello", "hey"], "");

DTing
@dting
Sep 16 2015 07:54
bf mutations
CamperBot
@camperbot
Sep 16 2015 07:54

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

mutation(['hello', 'hey']);

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

DTing
@dting
Sep 16 2015 07:57
@mformanish your conditional should be i < el2.length
@mformanish also they want you to ignore case so:
  var el1 = arr[0].toLowerCase();
  var el2 = arr[1].toLowerCase();
Robert Smith
@Tanker5419
Sep 16 2015 08:10
I found the answer and was able to complete the check for palindrome bf, but I just don't understand what this part here in the brackets is doing, can someone explain please? str.replace(/[\W_]/g, '')
Robert Smith
@Tanker5419
Sep 16 2015 08:18
It is the bonfire check for palindromes, I just want an understanding before i move on, if anyone has anything to offer? Thanks!
CamperBot
@camperbot
Sep 16 2015 08:18
if you want to thank someone, put an @ before their name!
Robert Smith
@Tanker5419
Sep 16 2015 08:22
I understand the syntax and flag, but I don't understand what [\W_] means.
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:25
What should I do in this challange
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.
var myCar.engines=1;

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

var Car = function() {
this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.
var myCar.engines=1;

var myCar = new Car();
// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

Jonny Morley
@morley92
Sep 16 2015 08:30
@Ali-Haider5 you dont need the var before mycar.engines=1
marzelin
@marzelin
Sep 16 2015 08:33
@Tanker5419 it's a regular expression. \W means match any special character like \?@# etc. The _ means match underscore.
Robert Smith
@Tanker5419
Sep 16 2015 08:35
@marzelin thank you!
CamperBot
@camperbot
Sep 16 2015 08:35
tanker5419 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 212 | @marzelin | http://www.freecodecamp.com/marzelin
marzelin
@marzelin
Sep 16 2015 08:35
@Tanker5419 :+1:
@Tanker5419 do you want some good resources about regular expressions?
Robert Smith
@Tanker5419
Sep 16 2015 08:39
Robert Smith
@Tanker5419
Sep 16 2015 08:45
Thanks @marzelin !
CamperBot
@camperbot
Sep 16 2015 08:45
tanker5419 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:warning: tanker5419 already gave marzelin points
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:46
Help anybody?
var array = [4,5,6,7,8];
var singleVal = 0;
// Only change code below this line.
var singleval= array.reduce(funtion(previousVal,currentVal){return previousVal+currentVal});


// Only change code above this line.
(function() {return singleVal;})();
CamperBot
@camperbot
Sep 16 2015 08:46
no wiki entry for: anybodyvar array 45678var singleval 0 only change code below this linevar singleval arrayreducefuntionpreviousvalcurrentvalreturn previousvalcurrentval only change code above this linefunction return singleval
:pencil: click here to create one now!after creating your page type update to reload it here
marzelin
@marzelin
Sep 16 2015 08:48
@Ali-Haider5 add ; to the return line
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:48
@marzelin didn't work
marzelin
@marzelin
Sep 16 2015 08:49
@Ali-Haider5 which waypoint is it?
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:49
Waypoint: Condense arrays with reduce
about @marzelin
CamperBot
@camperbot
Sep 16 2015 08:50
:star: 212 | @marzelin | http://www.freecodecamp.com/marzelin
Aleksandr Sidorov
@AleksandrSidorov
Sep 16 2015 08:51
This message was deleted
marzelin
@marzelin
Sep 16 2015 08:51
@Ali-Haider5 you have a typo in function
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:52
@marzelin yeah but still didn't work after correcting funtion to function
marzelin
@marzelin
Sep 16 2015 08:52
@Ali-Haider5 as well should be singleVal
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:53
Thanks @marzelin now its running
CamperBot
@camperbot
Sep 16 2015 08:53
ali-haider5 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 213 | @marzelin | http://www.freecodecamp.com/marzelin
marzelin
@marzelin
Sep 16 2015 08:54
@Ali-Haider5 always check your names twice, it'll spare you a lot of trouble :+1:
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:54
thanks for suggestion
CamperBot
@camperbot
Sep 16 2015 08:54
if you want to thank someone, put an @ before their name!
Ali-Haider5
@Ali-Haider5
Sep 16 2015 08:54
@marzelin
Dealga McArdle
@zeffii
Sep 16 2015 09:00
@AleksandrSidorov setInterval will schedule the repeat function calls..not immediately.
you trigger. it waits (...) milliseconds before triggering for the first time.
Aleksandr Sidorov
@AleksandrSidorov
Sep 16 2015 09:02
@zeffii thaks. It was just my subjective perception of time. It seems to me that calls begins much later than 1000 ms. Until I opened an OS clock near my timer.
CamperBot
@camperbot
Sep 16 2015 09:02
aleksandrsidorov sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 356 | @zeffii | http://www.freecodecamp.com/zeffii
Daniel Mendoza
@dmendoza05
Sep 16 2015 09:15
help bonfire Roman Numeral Converter
CamperBot
@camperbot
Sep 16 2015 09:15

:point_right: bonfire roman numeral converter [wiki]

Problem Explanation:

  • You will create a program that converts an integer to a roman numeral.
:pencil: read more about bonfire roman numeral converter on the FCC Wiki
urvashi9
@urvashi9
Sep 16 2015 09:22
Guys. I need help with Bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 16 2015 09:22
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
urvashi9
@urvashi9
Sep 16 2015 09:22
bonfire confirm the ending
CamperBot
@camperbot
Sep 16 2015 09:22

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

urvashi9
@urvashi9
Sep 16 2015 09:22
This is my code:
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  var string=str.replace("^[A-Za-z]+","");
  var a=string.substr(-1,1);
  var b=target;
  if(a==b)
    {
      return true;
    }
  else
    {
      return false;
    }
}

end("Bastian", "n", "");
But as you can see, it compares the last letter, instead of the last wode.
Dealga McArdle
@zeffii
Sep 16 2015 09:23
@urvashi9 . your equality is checked with == , should it be ?
urvashi9
@urvashi9
Sep 16 2015 09:23
word*
This code works fine if I want to confirm that the sentence ends with my target letter.
Manish Gupta
@mformanish
Sep 16 2015 09:24
@dting Thanks
CamperBot
@camperbot
Sep 16 2015 09:25
mformanish sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1185 | @dting | http://www.freecodecamp.com/dting
urvashi9
@urvashi9
Sep 16 2015 09:25
But the problem needs us to match the whole target. If it is a letter, It needs to see if that is the last letter of the phrase. And if it is a word, it needs to see if it is infact the last word ofthe phrase.
Dealga McArdle
@zeffii
Sep 16 2015 09:26
is this for a bonfire?
urvashi9
@urvashi9
Sep 16 2015 09:26
Yes.
Dealga McArdle
@zeffii
Sep 16 2015 09:26
link?
urvashi9
@urvashi9
Sep 16 2015 09:26
bonfire confirm the ending
CamperBot
@camperbot
Sep 16 2015 09:26

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

DTing
@dting
Sep 16 2015 09:27
@urvashi9 not last word. just that str ends with target
urvashi9
@urvashi9
Sep 16 2015 09:28
yes, but my code only works if the target is a letter
Can anyone tell me how to do it if the target is a word?
I have posted my code above
DTing
@dting
Sep 16 2015 09:31
bf links
CamperBot
@camperbot
Sep 16 2015 09:31
DTing
@dting
Sep 16 2015 09:31
use negative value for substrargument = to target's length
urvashi9
@urvashi9
Sep 16 2015 09:31
I did.
DTing
@dting
Sep 16 2015 09:32
no
you did substr(-1, 1)
urvashi9
@urvashi9
Sep 16 2015 09:34
Oh wait. Just figured it out!!
Thanks to you! @dting
CamperBot
@camperbot
Sep 16 2015 09:35
urvashi9 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1186 | @dting | http://www.freecodecamp.com/dting
Dealga McArdle
@zeffii
Sep 16 2015 09:35
@urvashi9
function end(str, target) {
  return new RegExp(target+"$").test(str)
}
i learned that today :)
urvashi9
@urvashi9
Sep 16 2015 09:36
@dting When you said I needed to use target's length in substr, I was like, "Why didn't I think of that?!" Haha.
@zeffii What does this code do?
DTing
@dting
Sep 16 2015 09:36
it includes the explaination of @zeffii code
its at the bottom
urvashi9
@urvashi9
Sep 16 2015 09:37
Oh alright. I am going to check it out.
:)
Dealga McArdle
@zeffii
Sep 16 2015 09:37
it uses a regular expression.. and asserts that whatever 'target' is , that the 'str' being tested ends with target ( because of the $, to denote end of string)
urvashi9
@urvashi9
Sep 16 2015 09:38
Okay, I did not know that. Thanks @zeffii
CamperBot
@camperbot
Sep 16 2015 09:38
urvashi9 sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 358 | @zeffii | http://www.freecodecamp.com/zeffii
DTing
@dting
Sep 16 2015 09:39
ya that works until your target includes certain characters, for example:
end("asdfadsf", "[a-z]")
// true
Dealga McArdle
@zeffii
Sep 16 2015 09:39
@dting, valid point :)
that doesn't mean it's not really useful in controlled circumstances
CamperBot
@camperbot
Sep 16 2015 09:40
:trollface: troll problems? notify admins here
urvashi9
@urvashi9
Sep 16 2015 09:41
Guys, What is the difference between == and ===?
Dealga McArdle
@zeffii
Sep 16 2015 09:41
have you googled that yet? @urvashi9
azaleas
@azaleas
Sep 16 2015 09:41
This message was deleted
strict equals doesnt convert type
urvashi9
@urvashi9
Sep 16 2015 09:43
Yeah let me check those articles out. Thanks for being so helpful. :)
CamperBot
@camperbot
Sep 16 2015 09:43
if you want to thank someone, put an @ before their name!
Ali-Haider5
@Ali-Haider5
Sep 16 2015 09:43
need some code on Bonfire: Reverse a String
azaleas
@azaleas
Sep 16 2015 09:44
function titleCase(str) {

    str = str.toLowerCase().split(" ");


    str[3] = str[3].charAt(0).toUpperCase() + str[3].substring(1);


    for (var i = 0; i < str.length(); i++){

      str[i] = str[i].charAt(0).toUpperCase() + str[i].substring(1);

    }

  return str;
}

titleCase("I'm a little tea pot", "");
I get number is not a function for my for loop, but without it the code works. This is a Title Case Bonfire
Can any1 help me?
DTing
@dting
Sep 16 2015 09:44
@azaleas you need to join that str with spaces then return
also remove

    str[3] = str[3].charAt(0).toUpperCase() + str[3].substring(1);
azaleas
@azaleas
Sep 16 2015 09:45
@dting, str[3] just for the testing purpose:)
Ali-Haider5
@Ali-Haider5
Sep 16 2015 09:45
need some code on Bonfire: Reverse a String
function reverseString(str) {
  var array=str.split();
  return str;
 };
reverseString("hello", "");
reverseString("Howdy", "");
reverseString('Greetings from Earth', "");
Ali-Haider5
@Ali-Haider5
Sep 16 2015 09:46
@dting help bro
azaleas
@azaleas
Sep 16 2015 09:46
@dting where exactly I should join it?
the error is the same
DTing
@dting
Sep 16 2015 09:46

  return str.join(' ');
}
@Ali-Haider5 spliting a string with no separator results in the string as an element inside an array you need to split on empty string
str.split('')
bf reverse
CamperBot
@camperbot
Sep 16 2015 09:47

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

DTing
@dting
Sep 16 2015 09:47
bf links
DTing
@dting
Sep 16 2015 09:47
see those links
Ali-Haider5
@Ali-Haider5
Sep 16 2015 09:49
bf details
CamperBot
@camperbot
Sep 16 2015 09:49

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Aniket Rao
@anik3tra0
Sep 16 2015 09:51

Below is from Bonfire Reverse a String
`function reverseString(str) {
return str;
}

reverseString("hello", "");

var array = reverseString.split(',');`

help please
CamperBot
@camperbot
Sep 16 2015 09:52

:point_right: bonfire no repeats please [wiki]

Problem Explanation:

This task requires us to look at each possible permutation of a string. This is best done using a recursion function. Being able to build a function which collects all permutations of a string is a common interview question, so there is no shortage of tutorials out there on how to do this, in many different code languages.

Permutation Recursion Function

This task can still be daunting even after watching a tutorial. You will want to send each new use of the function 3 inputs: 1. a new string (or character array) that is being built, 2. a position in your new string that's going to be filled next, and 3. an idea of what characters (more specifically positions) from the original string have yet to be used. The pseudo code will look something like this:

```
var str = ???;
perm(current position in original string, what's been used in original string, current string build thus far){
if(current string is finished) {
print current string;
}else{
for(var i = 0; i < str.length; i++) {
if(str[i] has not been used) {
put str[i] into the current position;
mark str[i] as used
perm(current position in original string, what's been used in original string, current string build thus far)
unmark str[i] as used because another branch in the tree for i + 1 will still likely use it;
}
}
:pencil: read more about bonfire no repeats please on the FCC Wiki

DTing
@dting
Sep 16 2015 09:55
@anik3tra0 your code needs to go inside the function
function reverseString(str) {
  // Your code goes here
}
Aniket Rao
@anik3tra0
Sep 16 2015 09:57
@dting thanks!
CamperBot
@camperbot
Sep 16 2015 09:57
anik3tra0 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1188 | @dting | http://www.freecodecamp.com/dting
Manish Gupta
@mformanish
Sep 16 2015 09:57
@anik3tra0 Once you move the code inside you need to reverse it using String function and then join it.
Array.reverse()
Read the Helpful Links with the Exercise
They are really helpful.
Aniket Rao
@anik3tra0
Sep 16 2015 09:59
@mformanish thanks! I was reading that but got a bit confused..
CamperBot
@camperbot
Sep 16 2015 09:59
anik3tra0 sends brownie points to @mformanish :sparkles: :thumbsup: :sparkles:
:star: 88 | @mformanish | http://www.freecodecamp.com/mformanish
Manish Gupta
@mformanish
Sep 16 2015 10:00
Ok , Those links are like hints solution will be using all those links.
Jack Demynn
@infectiouscode
Sep 16 2015 10:43
Time to start my learning of functions. Not looking forward to it at all.
Dealga McArdle
@zeffii
Sep 16 2015 10:43
@infectiouscode you will like functions.
Jack Demynn
@infectiouscode
Sep 16 2015 10:44
Will I? XD It looks rough @zeffii
Dealga McArdle
@zeffii
Sep 16 2015 10:45
programming without function is rougher
Jack Demynn
@infectiouscode
Sep 16 2015 10:45
It just looked really difficult
Alexander Schuneman
@AxSch
Sep 16 2015 10:45
Anyone on Waypoint, pop?
Dealga McArdle
@zeffii
Sep 16 2015 10:45
i'm almost certain you will change your mind.
Jack Demynn
@infectiouscode
Sep 16 2015 10:46
Is that in the long run or when i start learning?
Dealga McArdle
@zeffii
Sep 16 2015 10:46
pretty early-on in the process
Jack Demynn
@infectiouscode
Sep 16 2015 10:47
Well I better get started :)
zac247
@zac247
Sep 16 2015 11:01
could any one tell me what the camperbot is?
Alexander Schuneman
@AxSch
Sep 16 2015 11:04
@zac247 its a bot programmed to help
Jack Demynn
@infectiouscode
Sep 16 2015 11:05
Im stuck on iterating on js with while loops, im not sure how to do them? Heres what it says to do.
blob
zac247
@zac247
Sep 16 2015 11:05
@AxSch Thanks for replying;how can i make use of it?
CamperBot
@camperbot
Sep 16 2015 11:05
zac247 sends brownie points to @axsch :sparkles: :thumbsup: :sparkles:
:star: 252 | @axsch | http://www.freecodecamp.com/axsch
Jack Demynn
@infectiouscode
Sep 16 2015 11:06
And this is what my editor looks like
var myArray = [];
// Only change code below this line.

// Push the numbers zero through four to myArray using a "while loop".

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
@zac247 if you need help with bonfires, it goes into the FCC wikie and finds tips for you on that specific place
CamperBot
@camperbot
Sep 16 2015 11:07
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Jack Demynn
@infectiouscode
Sep 16 2015 11:08
For example he just asked me to type the bonfire name to get info on it @zac247
zac247
@zac247
Sep 16 2015 11:10
infectiouscode - yeah I saw that now thanks.Regarding your qn, i could give you the answer, but i suggest you try to figure it out some more
CamperBot
@camperbot
Sep 16 2015 11:10
if you want to thank someone, put an @ before their name!
zac247
@zac247
Sep 16 2015 11:11
@infectiouscode Don't take it in the wrong way, its always better for us while learning basics to figure out things the hard way
Jack Demynn
@infectiouscode
Sep 16 2015 11:11
Worked it out! However I did just copy the descriptions example, but i dont understand why we do what it tells us
zac247
@zac247
Sep 16 2015 11:13
@infectiouscode which part you did not understand. Is it the while loop?Think of while loop in terms of a for loop.
Jack Demynn
@infectiouscode
Sep 16 2015 11:14
its all the variables and arrays, they dont make sense to me like say in html a div class makes a lot of sense because you divide and give a group of elements a class or an id, but with arrays and variables it doesnt really make sense for me
zac247
@zac247
Sep 16 2015 11:14
the while loop you pasted above is equivalent to : for(i=0;i<5;i++){
Makler
@Makler1337
Sep 16 2015 11:14

hello can anyone help me with this one: ```

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
</div>
```

fuck sry
Jack Demynn
@infectiouscode
Sep 16 2015 11:15
yeah to me that looks alien to me
Makler
@Makler1337
Sep 16 2015 11:15
<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary">Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info">Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger">Delete</button>
    </div>
  </div>
Jack Demynn
@infectiouscode
Sep 16 2015 11:15
What do you need help with @Makler1337
zac247
@zac247
Sep 16 2015 11:15
//push variables into array each loop }
Jack Demynn
@infectiouscode
Sep 16 2015 11:15
I was crap at maths and it at school so all the JS is quite hard for me
Makler
@Makler1337
Sep 16 2015 11:16
i need to nest an i element which need to have class fa fa-thumbs-up
in the button
and i got confused
where exacly should i put it
since there is too much divs for me and its a ittle bit messy for me
zac247
@zac247
Sep 16 2015 11:17
@infectiouscode are you using freecodecamp only to learn? If you are not familiar with variables and other basics, you are better off learning the basics from another site and then coming back here.I suggest Codeacademy or a basic javascript text
Jack Demynn
@infectiouscode
Sep 16 2015 11:17
I do go on codeacademy at times
ive got yah answer bud
zac247
@zac247
Sep 16 2015 11:19
@Makler1337 <i> goes inside button
Jack Demynn
@infectiouscode
Sep 16 2015 11:19
@Makler1337 the I element goes here >>> Submit><i class="fa fa-thumbs-up"</i></button>
zac247
@zac247
Sep 16 2015 11:21
@infectiouscode i personally find the fcc learning materials inadequate.I learn from outside and come here to do the exercises.
Makler
@Makler1337
Sep 16 2015 11:22
@infectiouscode love you thanks!
CamperBot
@camperbot
Sep 16 2015 11:22
makler1337 sends brownie points to @infectiouscode :sparkles: :thumbsup: :sparkles:
:star: 146 | @infectiouscode | http://www.freecodecamp.com/infectiouscode
Jack Demynn
@infectiouscode
Sep 16 2015 11:22
Fair enough, I found it confusing learning at first cause FCC taught JS in a different way to Code academy, code academy teaches you diferentials earlier
and thats okay @Makler1337 :)
Christoffer92
@Christoffer92
Sep 16 2015 11:26
//Bonfire: Where art thou
function where(collection, source) {
  var arr = [];
  // What's in a name?
  var arrObject = [];
  var test = 0;

  //Just to make the Array in object.
  for(var i=0; i<collection.length; i++){
    arrObject.push(new Object(collection[i]));
  }

  //Its suppose to be the for-loop to check for matchs.
  for(i=0; i<arrObject.length; i++){
    test = arrObject[i].hasOwnProperty('first', 'Romeo');
  } 

  test = arrObject.keys(source);


  return test;
}

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

/*
#Create objects for the collection in a for loop.
#Check each object if it contains the name in source.
#Push the matched objects to the arr.
#Return the arr.
*/
I would like a tip on how to check for the matchs, i dont think i quite understand the Object.keys function.
CamperBot
@camperbot
Sep 16 2015 11:26
Sorry, can't find a bonfire called where art thoufunction wherecollection source var arr whats in a name var arrobject var test 0 just to make the array in object forvar i0 icollectionlength i arrobjectpushnew objectcollectioni its suppose to be the for-loop to check for matchs fori0 iarrobjectlength i test arrobjectihasownpropertyfirst romeo test arrobjectkeyssource return testwhere first romeo last montague first mercutio last null first tybalt last capulet first tybalt last capulet create objects for the collection in a for loopcheck each object if it contains the name in sourcepush the matched objects to the arrreturn the arri would like a tip on how to check for the matchs i dont think i quite understand the objectkeys function. [ Check the map? ]
Ali-Haider5
@Ali-Haider5
Sep 16 2015 11:35
Bonfire Factorialize a Number
CamperBot
@camperbot
Sep 16 2015 11:35

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Ali-Haider5
@Ali-Haider5
Sep 16 2015 11:36
hint
CamperBot
@camperbot
Sep 16 2015 11:36
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Christoffer92
@Christoffer92
Sep 16 2015 11:39
Bonfire Where art thou
CamperBot
@camperbot
Sep 16 2015 11:39

: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).

more info:  bf details | bf links | hint

Christoffer92
@Christoffer92
Sep 16 2015 11:39
hint
CamperBot
@camperbot
Sep 16 2015 11:39
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
catalinxD44
@catalinxD44
Sep 16 2015 12:08
i need some help plz , at a tutorial says (Your a element should be a dead link with a href attribute set to "#".)but when i go change the href into # it doent work
Christoffer92
@Christoffer92
Sep 16 2015 12:21
Bonfire Search and Replace
CamperBot
@camperbot
Sep 16 2015 12:21

: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.

more info:  bf details | bf links | hint

Christoffer92
@Christoffer92
Sep 16 2015 12:21
hint
CamperBot
@camperbot
Sep 16 2015 12:21
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Bernard Doci
@bernarddoci
Sep 16 2015 12:29
hi
why this code does not work:
function palindrome(str) {
// Good luck!
str = str.toLowerCase().replace(/[.,-\/#!$%\?][\^&*;:{}=-_`~()]/g, "").replace(" ","");
for(var i = 0; i < str.length; i++){
if(str[i] != str[str.length -1 -i])
return false;
}
return true;
}
palindrome("case");
Sean Campbell
@natac13
Sep 16 2015 12:36
@bernarddoci run it through this on the failing test and it will show you http://www.pythontutor.com/visualize.html#mode=edit
Kevin McCann
@kmccn-org
Sep 16 2015 12:37
@bernarddoci there's a much shorter RegExp that will work
Christoffer92
@Christoffer92
Sep 16 2015 12:38
function isUpperCase(char) {
  if (char == char.toUpperCase){
    return true;
  }
  else {
    false;
  }
}

function replace(str, before, after) {
 var test;
  if (isUpperCase(before[0]) == true){
    after[0].toUpperCase();
  }
  else {
    after[0].toLowerCase();
  }
  str = str.replace(before, after);

 return isUpperCase(before[0]);
}

replace("He is Sleeping on the couch", "Sleeping", "sitting");
This gives the result: undefined, why is that? :s
Aleksander Gębicki
@Takumar
Sep 16 2015 12:43
@bernarddoci It seems that the only problem is with your regular expressions.
Bernard Doci
@bernarddoci
Sep 16 2015 12:44
@natac13 @kmccn-org Thank you very much
CamperBot
@camperbot
Sep 16 2015 12:44
bernarddoci sends brownie points to @natac13 and @kmccn-org :sparkles: :thumbsup: :sparkles:
:star: 182 | @kmccn-org | http://www.freecodecamp.com/kmccn-org
:star: 342 | @natac13 | http://www.freecodecamp.com/natac13
Aleksander Gębicki
@Takumar
Sep 16 2015 12:45
@bernarddoci Look also that you not necessary run your for loop for every character in your string!
You can run it for only half of the length of your string because when you check the second half it was checked earlier in your if condition!
@bernarddoci In first step of your loop you compare first element of string with last element, and in the last step of loop you compare last element with first. It is not necessary.
Bernard Doci
@bernarddoci
Sep 16 2015 12:49
I have divided string length with 2 but it looks like white space isn't removed from string
@Takumar i have changed regex and every ting works fine now
function palindrome(str) {
// Good luck!
str = str.toLowerCase().replace(/[.,-\/#!$%\?][\^&*;:{}=-_`~()]/g, "").replace(/\s+/g, '');
for(var i = 0; i < str.length/2; i++){
if(str[i] != str[str.length -1 -i])
return false;
}
return true;
}
palindrome("case");
Kevin McCann
@kmccn-org
Sep 16 2015 12:53
@bernarddoci replace(/[\W_]/g, "")
Bernard Doci
@bernarddoci
Sep 16 2015 12:53
@Takumar Thank you for your help
CamperBot
@camperbot
Sep 16 2015 12:53
bernarddoci sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 323 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Sep 16 2015 12:54
@bernarddoci good job :-)
Bernard Doci
@bernarddoci
Sep 16 2015 12:55
@kmccn-org Yes your right it's much shorter than my regex. Thx
CamperBot
@camperbot
Sep 16 2015 12:55
bernarddoci sends brownie points to @kmccn-org :sparkles: :thumbsup: :sparkles:
:warning: bernarddoci already gave kmccn-org points
Kevin McCann
@kmccn-org
Sep 16 2015 12:56
welcome!
Ali-Haider5
@Ali-Haider5
Sep 16 2015 13:00
bonfire factoriolize
CamperBot
@camperbot
Sep 16 2015 13:00
Sorry, can't find a bonfire called factoriolize. [ Check the map? ]
Ali-Haider5
@Ali-Haider5
Sep 16 2015 13:00
Bonfire: Factorialize a Number
CamperBot
@camperbot
Sep 16 2015 13:00

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Ali-Haider5
@Ali-Haider5
Sep 16 2015 13:00
bf link
CamperBot
@camperbot
Sep 16 2015 13:00
Sorry, can't find a bonfire called link. [ Check the map? ]
Ali-Haider5
@Ali-Haider5
Sep 16 2015 13:01
hint
CamperBot
@camperbot
Sep 16 2015 13:01
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Terry
@terryrey
Sep 16 2015 13:31

I asked this on the HelpBonfires forum but am getting no response so thought I'd try here.
I have a problem understanding exactly what to return on the Convert HTML Entities bonfire. The code looks like this;

        function convert(str) {
            str = str.replace(/\u0026/g, "&(amp|AMP|#x00026|#38);");
             return str;
          }

When I run the test it returns the message "'Dolce &(amp|AMP|#x00026|#38); Gabbana' to match /Dolce &(amp|AMP|#x00026|#38); Gabbana/". I realise I am returning a string and it needs to be the escaped sentence /Dolce &(amp|AMP|#x00026|#38); Gabbana/ but I am mentally blocked as to how to convert the string to this format, can someone please point me in the right direction? Thanks.

CamperBot
@camperbot
Sep 16 2015 13:31
if you want to thank someone, put an @ before their name!
tva10
@tva10
Sep 16 2015 13:34
@terryrey you need to get one of this codes in string
it looks like 'some & str' -> 'some &#38; str'
or some &amp; str
Terry
@terryrey
Sep 16 2015 13:37
@tva10 , sorry I'm not sure what you mean. I need to convert "somestring" into /somestring/ At least, that is what I think I need to do according to the message.
tva10
@tva10
Sep 16 2015 13:37
@terryrey may be this link help you http://www.w3schools.com/html/html_symbols.asp
Odysseas Samaras
@odysseas
Sep 16 2015 13:39

Hi guys, I'm using openweathermap api for the weather app zipline. The json response is somethig like this

{"coord":{"lon":139,"lat":35},
"sys":{"country":"JP","sunrise":1369769524,"sunset":1369821049},
"weather":[{"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}],
"main":{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04},
"wind":{"speed":7.31,"deg":187.002},
"rain":{"3h":0},
"clouds":{"all":92},
"dt":1369824698,
"id":1851632,
"name":"Shuzenji",
"cod":200}

How do I access the weather -> main value? data.weather.main is undefined as is data.weather["main"]

tva10
@tva10
Sep 16 2015 13:41
@odysseas data.weather[0] -> {"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}
@odysseas data.main - >{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04}
data.main.temp -> 289.5
Odysseas Samaras
@odysseas
Sep 16 2015 13:43
I want to get the "clouds" value, so data.weather[0].main ?
tva10
@tva10
Sep 16 2015 13:44
@odysseas yes
Odysseas Samaras
@odysseas
Sep 16 2015 13:44
thanks @tva10
CamperBot
@camperbot
Sep 16 2015 13:44
odysseas sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 217 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Sep 16 2015 13:44
but may be you should check data.weatherarray.length
Odysseas Samaras
@odysseas
Sep 16 2015 13:47
I am only getting the current weather, so the array should have a single element always (at least I think so)
Thomas Bernfeld
@happpyier
Sep 16 2015 13:48
are you guys talking about the weather api zipline?
tva10
@tva10
Sep 16 2015 13:48
@odysseas To find out that, you need to read the documentation for the API
azazel913
@azazel913
Sep 16 2015 13:48

trying to make my border around my img and everything else what am I doing wrong in my code <img class="class1 class2"> <img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">

<style class=".thick-green-border"{border-color: green;border-width:10px;border-style:solid;} </style>

Thomas Bernfeld
@happpyier
Sep 16 2015 13:49
are you also having trouble accessing the weather part, it always comes up undefined for me
Odysseas Samaras
@odysseas
Sep 16 2015 13:49
yeah
data.weather[0].main works for me
at least for now
Thomas Bernfeld
@happpyier
Sep 16 2015 13:50
@odysseas Huh Thanks
CamperBot
@camperbot
Sep 16 2015 13:50
if you want to thank someone, put an @ before their name!
tva10
@tva10
Sep 16 2015 13:51
@azazel913
 <img class="class1 class2"> <img class="smaller-image .thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
<style>.thick-green-border{
border-color: green;border-width:10px;border-style:solid;
} </style>
uhh
Thomas Bernfeld
@happpyier
Sep 16 2015 13:51
you might wanna use .description instead
instead of Clear it says sky is clear!
Thanks for the help!
CamperBot
@camperbot
Sep 16 2015 13:53
if you want to thank someone, put an @ before their name!
azazel913
@azazel913
Sep 16 2015 13:53
@tva10 so what do I have wrong
tva10
@tva10
Sep 16 2015 13:54
@azazel913 in that task you need to add new class into style tag, and apply them to an image or div
azazel913
@azazel913
Sep 16 2015 13:55
@tva10 okay thanks
CamperBot
@camperbot
Sep 16 2015 13:55
azazel913 sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 218 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Sep 16 2015 13:55
<img class="class1 class2 .your-border-class" ...>
Terry
@terryrey
Sep 16 2015 14:10
@tva10, I'm feeling extremely stupid because I just cannot see it!
tva10
@tva10
Sep 16 2015 14:12
@terryrey in that task you need to get string, change sybols like #$<>... to their 'Codes' and return string
@terryrey I use .replace() for each symbol there //
Terry
@terryrey
Sep 16 2015 14:14
@tva10 I have done that and the resultant string is 'Dolce &(amp|AMP|#x00026|#38); Gabbana'. So far so good. However, when I run it the result says it is looking for /Dolce &(amp|AMP|#x00026|#38); Gabbana/
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 14:18
I'm confused about "Smallest Commons" ....the smallest commons of 1 and 5 is 60??????????
That's what the Bonfire says that it's expecting
"expect(smallestCommons([1,5])).to.equal(60);"
???
tva10
@tva10
Sep 16 2015 14:19
@terryrey really I don't know what you mean now. Beacuse my English is so bad. You want to know why whey use RegExp to assertEq?
Moisés Man
@moigithub
Sep 16 2015 14:24
@terryrey for html entities .. u need to replace/encode some "special characters" like & to (encoded version) &amp;
the other characters u seeing are a regex test to check if u did correct or not...
@TheHighPriestess its not 1 AND 5.. but 1,2,3,4,5
Terry
@terryrey
Sep 16 2015 14:27
@tva10, @moigithub OK, I think I have misunderstood what is required so will leave it alone for today and look at it again with fresh eyes tomorrow. Thanks for the help guys and sorry if I've caused you any confusion.
CamperBot
@camperbot
Sep 16 2015 14:27
terryrey sends brownie points to @tva10 and @moigithub :sparkles: :thumbsup: :sparkles:
:star: 345 | @moigithub | http://www.freecodecamp.com/moigithub
:star: 220 | @tva10 | http://www.freecodecamp.com/tva10
Robert Richey
@0x0936
Sep 16 2015 14:27
@moigithub that bonfire makes no sense to me. It needs a better explanation.
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 14:29
I don't find these math related Bonfires helpful at all.
azazel913
@azazel913
Sep 16 2015 14:29
where do I put the anchor at \ <p> "cat photo "<a href= "http://freecatphotoapp.com"> link to Free Code Camp</a> for you to follow.</p>.
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 14:30
I thought that I was supposed to find the LCM...which is what the title is.
azaleas
@azaleas
Sep 16 2015 14:32
@azazel913
<p>
    <a href="http://www.freecatphotoapp.com">cat photos</a>
      View More

  </p>
azazel913
@azazel913
Sep 16 2015 14:34
@azaleas thanks
CamperBot
@camperbot
Sep 16 2015 14:34
azazel913 sends brownie points to @azaleas :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for azaleas
Lasynsec
@Lasynsec
Sep 16 2015 14:35
Hello world
CamperBot
@camperbot
Sep 16 2015 14:35

welcome to FreeCodeCamp @Lasynsec!

MrZappy
@MrZappy
Sep 16 2015 14:35
@Lasynsec Welcome!
Robert Richey
@0x0936
Sep 16 2015 14:36
Welcome @Lasynsec
Lasynsec
@Lasynsec
Sep 16 2015 14:36
i am very happy to be here, and thanks to you guys , my JavaScript skills improve every day
CamperBot
@camperbot
Sep 16 2015 14:37
if you want to thank someone, put an @ before their name!
Lasynsec
@Lasynsec
Sep 16 2015 14:37
thank you @0x0936 and @MrZappy
CamperBot
@camperbot
Sep 16 2015 14:37
lasynsec sends brownie points to @0x0936 and @mrzappy :sparkles: :thumbsup: :sparkles:
:star: 154 | @0x0936 | http://www.freecodecamp.com/0x0936
:star: 201 | @mrzappy | http://www.freecodecamp.com/mrzappy
MrZappy
@MrZappy
Sep 16 2015 14:40
No problem
Lasynsec
@Lasynsec
Sep 16 2015 14:40
i am about to finish the zipeline:Build a Random Quote Machine exercice, but i am going to need some help for the Bonus User Story.
I have to build a tweet button, here is my little code : <a href="http://twitter.com/share" class="twitter-share-button" data-text="chooseQuote(quotes)" data-count="vertical" data-via="games_html5">Tweet</a>; var twitter_btn = $('.twitter-share-button'); twitter_btn.attr('data-text', chooseQuote(quotes));
unfortunately doesn't work, can anybody help with this ?
Sorry for all the mistakes i am doing with english :-)
Lasynsec
@Lasynsec
Sep 16 2015 14:47
i am not a native english speaker
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 14:48
@moigithub Thank you
CamperBot
@camperbot
Sep 16 2015 14:48
thehighpriestess sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 348 | @moigithub | http://www.freecodecamp.com/moigithub
Lasynsec
@Lasynsec
Sep 16 2015 14:49
maybe anyone knows a better way to build a tweet button ?
'''
CamperBot
@camperbot
Sep 16 2015 14:54
:bulb: to format code use backticks! ``` more info
Lasynsec
@Lasynsec
Sep 16 2015 14:54
This message was deleted
tva10
@tva10
Sep 16 2015 14:55
@Lasynsec I never make these buttons before, but do you see code generators?
Alexander Schuneman
@AxSch
Sep 16 2015 14:55
anyone on the pop waypoint?
Lasynsec
@Lasynsec
Sep 16 2015 14:55
<a href="http://twitter.com/share" class="twitter-share-button" data-text="chooseQuote(quotes)" data-count="vertical" data-via="games_html5">Tweet</a>;
var twitter_btn = $('.twitter-share-button');
twitter_btn.attr('data-text', chooseQuote(quotes));
Sasa Popovic
@Zunior
Sep 16 2015 14:56
please help compact code. Still have a feeling that I use C language sintax :worried:
function destroyer(arr) {

  var args = arr.slice.call(arguments);
  var count;
  var removed = [];

  for(var j=0; j<args[0].length; j++){
    count = 0;
    for(var i=1; i<args.length; i++) {
      if(args[0][j]!==args[i]) {
        count++;} else {
          break;
        }
      if(count===args.length-1) {
        removed.push(args[0][j]);
      }
    }
  }
  return removed;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
here maybe should be used filter
Lasynsec
@Lasynsec
Sep 16 2015 14:57
thank you @tva10 , but what is code generators
?
CamperBot
@camperbot
Sep 16 2015 14:57
lasynsec sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 221 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Sep 16 2015 14:58
@Lasynsec I mean that you can choose button style and attributes (like text hashtag etc) and generator provide you code which you can add to webPage
Lasynsec
@Lasynsec
Sep 16 2015 15:00
@tva10 good , i'm on it
tva10
@tva10
Sep 16 2015 15:02
@Zunior I use .filter() in that task
workerhn
@workerhn
Sep 16 2015 15:02
Dead Links uisng hash # how it works? Please help.
sinnersdoom
@sinnersdoom
Sep 16 2015 15:03
how do u post the pic of source code?
tva10
@tva10
Sep 16 2015 15:03
This message was deleted
Robert Richey
@0x0936
Sep 16 2015 15:04
@Zunior compacted
for (var i = 1, args = []; i < arguments.length; ++i) { args.push(arguments[i]); }
return arr.filter(function(value) { return args.indexOf(value) < 0; });
sinnersdoom
@sinnersdoom
Sep 16 2015 15:04
like the above one
Robert Richey
@0x0936
Sep 16 2015 15:04
```javascript
//code
```
tva10
@tva10
Sep 16 2015 15:05
huh @sinnersdoom , you can use alt+prnt screen, and ctl+v to add this screenshoot to message
sinnersdoom
@sinnersdoom
Sep 16 2015 15:05
blob
Lasynsec
@Lasynsec
Sep 16 2015 15:05
@moigithub thanks
CamperBot
@camperbot
Sep 16 2015 15:05
lasynsec sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 349 | @moigithub | http://www.freecodecamp.com/moigithub
sinnersdoom
@sinnersdoom
Sep 16 2015 15:06
i am not able two solve the problem
it say i need to name the radio button "indoor-outdoor"
Sasa Popovic
@Zunior
Sep 16 2015 15:07
@0x0936 thx a lot. Now to digest that...
CamperBot
@camperbot
Sep 16 2015 15:07
zunior sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 155 | @0x0936 | http://www.freecodecamp.com/0x0936
Samantha North
@sjnorth
Sep 16 2015 15:08
@camperbot bonfire check for palindromes help
Robert Richey
@0x0936
Sep 16 2015 15:10
@sinnersdoom change lable to label and lower case 'indoor-outdoor'
sinnersdoom
@sinnersdoom
Sep 16 2015 15:11
@0x0936 thanks
CamperBot
@camperbot
Sep 16 2015 15:11
sinnersdoom sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 156 | @0x0936 | http://www.freecodecamp.com/0x0936
qbai22
@qbai22
Sep 16 2015 15:14

hello guys i am just finished a third bonfire "Check for Palindromes" but because of the last condition "(assert(palindrome("0_0 (: /-\ :) 0-0") === true, '"0_0 (: /-\ :) 0-0" should return true.')" my code turned into some crazy thing , should i fix it into something more elegant?
'''
function palindrome(str) {

var b4 = str.toLowerCase().replace(/ /g, "").replace

(/,/g, "").replace(".","").replace("_", "-").replace("/","").replace("(","").replace(")","");

var after = b4.split("").reverse().join("") ;

if (after==b4){return true;}
else {return false}
}

palindrome("0_0 (: /-\ :) 0-0");

'''

whoops
code didnt insert tt
Robert Richey
@0x0936
Sep 16 2015 15:17
@qbai22 you're replacing '_' with '-' which should instead be an empty string
tva10
@tva10
Sep 16 2015 15:17
@qbai22 I think you should replace all symbols, which are not letter or number
qbai22
@qbai22
Sep 16 2015 15:17
ye, i was just cunfused
tva10
@tva10
Sep 16 2015 15:18
like this expression /[^0-9a-z]/g
Moisés Man
@moigithub
Sep 16 2015 15:18
help formatting
CamperBot
@camperbot
Sep 16 2015 15:18

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and 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

qbai22
@qbai22
Sep 16 2015 15:19
@tva10 oh thaks a lot i didnt know how to manage it inside one .replace thing
CamperBot
@camperbot
Sep 16 2015 15:19
qbai22 sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 222 | @tva10 | http://www.freecodecamp.com/tva10
qbai22
@qbai22
Sep 16 2015 15:20
@0x0936 ye , tnx i was just confused
Alexander Schuneman
@AxSch
Sep 16 2015 15:21
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray[2].pop();
var removed = myArray.pop(); // This should be ["cat", 2] and myArray should now be ["John", 23]
Having problems ith this code
Kevin McCann
@kmccn-org
Sep 16 2015 15:21
@qbai22 replace(/[\W_]/g, "")
Robert Richey
@0x0936
Sep 16 2015 15:21
I like @tva10 's regex, because it's less cryptic than what I used. /\W|_/g
Kevin McCann
@kmccn-org
Sep 16 2015 15:22
@0x0936 you dont even need the |
qbai22
@qbai22
Sep 16 2015 15:22
@kmccn-org tt, i dont get it.. where i can read about how it exactly works?
qbai22
@qbai22
Sep 16 2015 15:23
thank you!
CamperBot
@camperbot
Sep 16 2015 15:23
if you want to thank someone, put an @ before their name!
qbai22
@qbai22
Sep 16 2015 15:23
@kmccn-org thank you
Kevin McCann
@kmccn-org
Sep 16 2015 15:23

\W
Matches any character that is not a word character from the basic Latin alphabet. Equivalent to [^A-Za-z0-9_].

For example, /\W/ or /[^A-Za-z0-9_]/ matches "%" in "50%".

CamperBot
@camperbot
Sep 16 2015 15:23
qbai22 sends brownie points to @kmccn-org :sparkles: :thumbsup: :sparkles:
tva10
@tva10
Sep 16 2015 15:23
@0x0936 I invented it, after when I use .toLowerCase() before
CamperBot
@camperbot
Sep 16 2015 15:23
:star: 186 | @kmccn-org | http://www.freecodecamp.com/kmccn-org
Robert Richey
@0x0936
Sep 16 2015 15:23
@kmccn-org you do when it's not in a character class
Terry
@terryrey
Sep 16 2015 15:24
@tva10 @moigithub After a break, a cup of coffee and a chat to the wife it all became clear! Thanks again!
CamperBot
@camperbot
Sep 16 2015 15:24
terryrey sends brownie points to @tva10 and @moigithub :sparkles: :thumbsup: :sparkles:
:warning: terryrey already gave moigithub points
:warning: terryrey already gave tva10 points
Kevin McCann
@kmccn-org
Sep 16 2015 15:24
@0x0936 ah gotcha
missed that part
Alexander Schuneman
@AxSch
Sep 16 2015 15:25
Can anyone help me with the Javascript Waypoint: Manipulate Arrays with pop
please i’ve been stuck on this for days T_T
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray[2].pop();
var removed = myArray.pop(); // This should be ["cat", 2] and myArray should now be ["John", 23]
tva10
@tva10
Sep 16 2015 15:27
@AxSch what troubles with that do you have?
Rory Smith
@alanbuchanan
Sep 16 2015 15:27
@AxSch myArray[2].pop() this line is wrong
Alexander Schuneman
@AxSch
Sep 16 2015 15:27
@tva10 Its not returning the correct removed element
@alanbuchanan should that just be myArray.pop()?
Rory Smith
@alanbuchanan
Sep 16 2015 15:28
@AxSch pop() only takes the last value of an array, so you shouldn't pass a number
tva10
@tva10
Sep 16 2015 15:28
.pop() takes last value and returns it
Jonny Morley
@morley92
Sep 16 2015 15:28
@AxSch take out line 3
Alexander Schuneman
@AxSch
Sep 16 2015 15:29
@alanbuchanan ok that was what I initially did
I did myArray.pop();
Kevin McCann
@kmccn-org
Sep 16 2015 15:29
@AxSch @morley92 is correct, remove line 3
tva10
@tva10
Sep 16 2015 15:30
huh, there is push shft unshif after that
@AxSch
Alexander Schuneman
@AxSch
Sep 16 2015 15:30
that returns [John,23]
Rory Smith
@alanbuchanan
Sep 16 2015 15:30
@AxSch you have to store it in a var
@AxSch like on the line below
Alexander Schuneman
@AxSch
Sep 16 2015 15:31
@tva10 push shift?
@alanbuchanan like this
```
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var x = myArray.pop();
var removed = myArray;
tva10
@tva10
Sep 16 2015 15:31
@AxSch .push .shift .unshift
Kevin McCann
@kmccn-org
Sep 16 2015 15:32
@AxSch this worked for me:
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.

var removed = myArray.pop();
Rory Smith
@alanbuchanan
Sep 16 2015 15:32
@AxSch now x is ['cat', 2] and removed is ['John', 23]
Alexander Schuneman
@AxSch
Sep 16 2015 15:34
@kmccn-org I didn’t think to try that and thanks
@alanbuchanan How would I change it to be the correct way round
@tva10 Thanks I’ll look into the docs for those
CamperBot
@camperbot
Sep 16 2015 15:34
axsch sends brownie points to @kmccn-org and @alanbuchanan and @tva10 :sparkles: :thumbsup: :sparkles:
:star: 354 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
:star: 187 | @kmccn-org | http://www.freecodecamp.com/kmccn-org
:star: 223 | @tva10 | http://www.freecodecamp.com/tva10
Bogdan
@botgan23
Sep 16 2015 15:40
Your h2 element should degrade to the font Monospace when Lobster is not available.
can u please help me :(?
Rory Smith
@alanbuchanan
Sep 16 2015 15:40
@botgan23 could you post your code?
and is that your cat?
tva10
@tva10
Sep 16 2015 15:41
:D
Bogdan
@botgan23
Sep 16 2015 15:41
@alanbuchanan nope, just found in network :)
Rory Smith
@alanbuchanan
Sep 16 2015 15:41
i see
Bogdan
@botgan23
Sep 16 2015 15:43
how i can i post my code?
just copy paste O_O?
tva10
@tva10
Sep 16 2015 15:45
help formatting
CamperBot
@camperbot
Sep 16 2015 15:45

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and 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

Bogdan
@botgan23
Sep 16 2015 15:47
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
  <!--CSSstyle: h2 {
    font-family: Monospace, Serif, Sans-Serif;
  }-->
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
@alanbuchanan
tva10
@tva10
Sep 16 2015 15:49
@botgan23 use comma, to point that fonts you want to use
font-family: font1, font2, font3
N Hameleers
@NHameleers
Sep 16 2015 15:50
This message was deleted
right those were quotes, not backticks, sorry :)
Rory Smith
@alanbuchanan
Sep 16 2015 15:52
@NHameleers you can edit your post if you press the up key :)
(for future reference)
N Hameleers
@NHameleers
Sep 16 2015 15:53
good to know :)
Another try
$(document).ready(function() {

  function createQuote(){
    var apiUrl = 'http://api.forismatic.com/api/1.0/';
    var data = {
            lang: "en",
            method: "getQuote",
            format: "jsonp"
          };
    $.getJSON(apiUrl, data)
      .done(function(json) {
        $("#quotetext").html(json.quoteText + "<br>" + json.quoteAuthor)
      .fail(function(){
        $("#quotetext").text("error");
      })
    });
  } 
  /*
  function createQuote(){
      $.ajax({
        jsonp: "jsonp",
        dataType: "jsonp",
        url: 'http://api.forismatic.com/api/1.0/',
        contentType: 'application/jsonp',
        data: {
          lang: "en",
          method: "getQuote",
          format: "jsonp"
        },
        success: function(data){
          $("#quotebox").html("<p>" + data.quoteText + "<br>" + data.quoteAuthor + "</p>");
        }
      });
  }
  */

  $("#btn-submit").click(function(){
    createQuote();        
    }); 
});
Rex Schrader
@SaintPeter
Sep 16 2015 15:55
@NHameleers Try adding the following to your ajax data: jsonp: '?'
@NHameleers Also, delete your original message by hovering the mouse over the little ... to the right of the timestamp.
N Hameleers
@NHameleers
Sep 16 2015 15:57
I'm afraid that didn't seem to change anything
Rex Schrader
@SaintPeter
Sep 16 2015 15:58
@NHameleers How about udpating your url to this: "http://api.forismatic.com/api/1.0/?jsonp=?" and remove the jsonp from the data section
N Hameleers
@NHameleers
Sep 16 2015 15:59
Nope, also doesn't seem to change it
Do you know of any course of place where I can get a bit of an introduction to API requests? It's talked of in the ziplines, but there is no information or assignments about it before that
Rex Schrader
@SaintPeter
Sep 16 2015 16:01
@NHameleers Are you getting an error in your dev console?
@NHameleers and do you have a link to your codepen?
Rustam Turaev
@rustamturaev
Sep 16 2015 16:03

Hi guys I'm stuck on this assignment. Can anyone help me. Now you know three ways of targeting elements: by type: $("button"), by class: $(".btn"), and by id $("#target1").

Use each of these jQuery selectors to target your button element with the class btn and the id target1.

Use the addClass() jQuery function to give the element one new class for each selector: animated, shake, and btn-primary.

Rex Schrader
@SaintPeter
Sep 16 2015 16:05
@NHameleers ok, found the problem
Paweł
@ridlez
Sep 16 2015 16:05
@rustamturaev try this for example $(.'btn').addClass('animated');
Rex Schrader
@SaintPeter
Sep 16 2015 16:06
@NHameleers
  function createQuote(){
    var apiUrl = 'http://api.forismatic.com/api/1.0/';
    var data = {
            lang: "en",
            method: "getQuote",
            format: "jsonp"
          };
    $.getJSON(apiUrl, data)
      .done(function(json) {
        $("#quotetext").html(json.quoteText + "<br>" + json.quoteAuthor);  // <-- Add semicolon here
/*      .fail(function(){                            // .fail is not a function of HTML.  Remove this.
        $("#quotetext").text("error");            // and this
      })*/                                              // and this
    });
  }
Robert Richey
@0x0936
Sep 16 2015 16:06
@NHameleers here is my working ajax call to forismatic. that zipline should stop suggesting this API - it's a horrible first API experience
$.ajax({
  url: "http://api.forismatic.com/api/1.0/",
  jsonp: "jsonp",
  dataType: "jsonp",
  type: "GET",
  data: {
    method: "getQuote",
    lang: "en",
    format: "jsonp"
  }
})
Rex Schrader
@SaintPeter
Sep 16 2015 16:07
@0x0936 The problem is not with the AJAX request.
Moisés Man
@moigithub
Sep 16 2015 16:08
fail ITS another jquery method.. like done.. the error probably is cuz incorrect nesting/chaining
N Hameleers
@NHameleers
Sep 16 2015 16:09
sorry i just got a skype call, i will be right back
Rustam Turaev
@rustamturaev
Sep 16 2015 16:09
It won't let me proceed with this error: Your #target1 element should have the classes animated‚ shake and btn-primary.
Moisés Man
@moigithub
Sep 16 2015 16:10
$.getJSON( ... ) 
  .done(function(){...})
  .fail(function(){...})
http://api.jquery.com/jquery.getjson/
Rustam Turaev
@rustamturaev
Sep 16 2015 16:10
All other parts are in green. I don't understand
tva10
@tva10
Sep 16 2015 16:10
@rustamturaev use all these classes
Rustam Turaev
@rustamturaev
Sep 16 2015 16:11
Thats what I did: $("#target1").addClass(animated shake btn-primary);
Is this correct?
Rex Schrader
@SaintPeter
Sep 16 2015 16:11
@rustamturaev You need quotes around your class string:
$("#target1").addClass("animated shake btn-primary");
tva10
@tva10
Sep 16 2015 16:11
@rustamturaev use quotes
Rex Schrader
@SaintPeter
Sep 16 2015 16:11
@rustamturaev Also, I don't think you need btn-primary
Rustam Turaev
@rustamturaev
Sep 16 2015 16:12
Thank you guys
CamperBot
@camperbot
Sep 16 2015 16:12
if you want to thank someone, put an @ before their name!
Rustam Turaev
@rustamturaev
Sep 16 2015 16:13
@tva10 @SaintPeter @camperbot Thank you guys!
CamperBot
@camperbot
Sep 16 2015 16:13
rustamturaev sends brownie points to @tva10 and @saintpeter and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 618 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 223 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 224 | @tva10 | http://www.freecodecamp.com/tva10
Robert Richey
@0x0936
Sep 16 2015 16:14
@SaintPeter your call to forimsatic doesn't work for me. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Rex Schrader
@SaintPeter
Sep 16 2015 16:14
@0x0936 I am not getting that error. I got it working just fine - the error I was seeing was that .fail is not a function of .html
Robert Richey
@0x0936
Sep 16 2015 16:19
This doesn't work for me. Do you have any thoughts as to why?
function createQuote(){
  var apiUrl = 'http://api.forismatic.com/api/1.0/';
  var data = {
    lang: "en",
    method: "getQuote",
    format: "jsonp"
  };
  $.getJSON(apiUrl, data)
    .done(function(json) {
      console.log(json.quoteText);
    });
}
Rex Schrader
@SaintPeter
Sep 16 2015 16:20
@0x0936 Are you on the HTTPS version of codepen? If so, an http URL for forismatic will confilict. Or vice versa.
Robert Richey
@0x0936
Sep 16 2015 16:22
XMLHttpRequest cannot load http://api.forismatic.com/api/1.0/?lang=en&method=getQuote&format=jsonp. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://codepen.io' is therefore not allowed access.
Rex Schrader
@SaintPeter
Sep 16 2015 16:25
@0x0936 got a Codepen URL for me?
Robert Richey
@0x0936
Sep 16 2015 16:25
no, I was pasting it into the dev console and calling the function
just made a pen of it here
Rex Schrader
@SaintPeter
Sep 16 2015 16:28
@0x0936 Change your URL to this:
var apiUrl = 'http://api.forismatic.com/api/1.0/?jsonp=?';
@0x0936 You need to tell forismatic what the name of your callback function is, and the question mark on the end tells the ajax function to substitute in the name of the callback.
Robert Richey
@0x0936
Sep 16 2015 16:31
@SaintPeter yep, that works. and thank you very much. my follow up question is why did the API call work for you without ?jsonp=??
CamperBot
@camperbot
Sep 16 2015 16:31
0x0936 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 621 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 16 2015 16:31
@0x0936 No idea. It was someone else's code. Maybe I missed something?
Robert Richey
@0x0936
Sep 16 2015 16:34
and that last part is dreadfully cryptic. most articles and documentation show it as ?callback=?
Rex Schrader
@SaintPeter
Sep 16 2015 16:35
@0x0936 Yeah - the problem is that forismatic uses jsonp as the parameter for their callback function. That's just one reason I don't like their API
Samantha North
@sjnorth
Sep 16 2015 16:36
hey all, any tips on the best way to achieve the scrolling background effect for the portfolio design?
Robert Richey
@0x0936
Sep 16 2015 16:37
@sjnorth background-attachment: fixed;
Samantha North
@sjnorth
Sep 16 2015 16:37
@0x0936 as simple as that - cool. thanks :)
CamperBot
@camperbot
Sep 16 2015 16:37
sjnorth sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 159 | @0x0936 | http://www.freecodecamp.com/0x0936
Paweł
@ridlez
Sep 16 2015 16:39
hey does anyone know how can I show current location in simpleweather.js instead of clicking on the button to display?
Rex Schrader
@SaintPeter
Sep 16 2015 16:41
@ridlez what is simpleweather.js?
Nolan Chan
@NolanChan
Sep 16 2015 16:44
Hi, i had a question regarding "Waypoint: Target the same element with multiple jQuery Selectors", can anyone give me a hint? I'm somewhat confused at the instructions. I believe i tried all the permutations of concatenating the targeted elements but its not working
N Hameleers
@NHameleers
Sep 16 2015 16:45
@SaintPeter Thanks for your time and comments. I showed the page to my wife and in her browser it worked even with the .fail.
Then I read your comment about https, and switched off the "https everywhere" extension in Chrome. This did the trick and was probably the problem all along. Thanks again!!
CamperBot
@camperbot
Sep 16 2015 16:45
nhameleers sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 624 | @saintpeter | http://www.freecodecamp.com/saintpeter
kaki940
@kaki940
Sep 16 2015 16:49
Hi, someone can help me?? I have a query in the palindromes in the last assert (0_0 (: /-\ :) 0-0) because i dont know why should return true? (sorry for my english)
the assert 0_0 (: /-\ : ) 0-0
tva10
@tva10
Sep 16 2015 16:50
@kaki940 because you should remove special symbols
Omar
@Stenzky
Sep 16 2015 16:50
Hello, When I try to Generate Random Whole Numbers within a Range
and use the given function I can't seem to get a whole number even after looking at the help docs, can someone help me please ? Math.floor(Math.random() * (max - min + 1)) + min
tva10
@tva10
Sep 16 2015 16:51
@kaki940 i use regExp to find them...
SojournerOctocat
@SojournerOctocat
Sep 16 2015 16:51
@kaki940 It should return true because it's a palindrome. I think it's there to encourage people to be careful when removing non-letters & non-digits.
@kaki940 If you only remove punctuation (commas and periods), the last assertion should pass.
Rex Schrader
@SaintPeter
Sep 16 2015 16:52
@kaki940 If you're using /\W/ then remember that /\W/ === /[^a-zA-Z0-9_]/ - note the underscore.
Philip Warkentien II
@warkentien2
Sep 16 2015 16:53
@Stenzky works fine here.
@Stenzky how are you specifying min and max in your code?
Omar
@Stenzky
Sep 16 2015 16:53
min = 0 max = 9 , thnx for replying
CamperBot
@camperbot
Sep 16 2015 16:53
if you want to thank someone, put an @ before their name!
kaki940
@kaki940
Sep 16 2015 16:54
@SaintPeter so when i check i "remove" the digits and punctuations???
Philip Warkentien II
@warkentien2
Sep 16 2015 16:55
@Stenzky tested the code with the inputs you gave 0, 9. it's working..
if you´d like send me your code PM
chenry53
@chenry53
Sep 16 2015 16:55
hey im having trouble with Waypoint: Change the Font Size of an Element it wants me to change the font size to 16px but when i entered p {font size: 16px;} nothing changed. what am i doing wrong?
Robert Richey
@0x0936
Sep 16 2015 16:55
@Stenzky must be a problem somewhere else. I can copy past your code into the console, substitute 0 for min, 9 for max, and it works
Philip Warkentien II
@warkentien2
Sep 16 2015 16:56
@chenry53 precedence. !important > id > class > tag .. p is a simple tag
Rex Schrader
@SaintPeter
Sep 16 2015 16:56
@kaki940 The point is that \W does not remove underscores, and you need to remove underscores as well.
Philip Warkentien II
@warkentien2
Sep 16 2015 16:56
@chenry53 in other words.. any class will overwrite its font size. and any id will overwrite class font size
Omar
@Stenzky
Sep 16 2015 16:57
@warkentien2 thanks for your help, I'll try couple time more and if no luck will report a bug or something, cheers !
CamperBot
@camperbot
Sep 16 2015 16:57
stenzky sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles:
:star: 288 | @warkentien2 | http://www.freecodecamp.com/warkentien2
Philip Warkentien II
@warkentien2
Sep 16 2015 16:58
@Stenzky no problem!
chenry53
@chenry53
Sep 16 2015 16:59
@warkentien2 thanks
CamperBot
@camperbot
Sep 16 2015 16:59
chenry53 sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles:
:star: 289 | @warkentien2 | http://www.freecodecamp.com/warkentien2
kaki940
@kaki940
Sep 16 2015 16:59
@SaintPeter I think i understand.
kaki940
@kaki940
Sep 16 2015 17:05
@SaintPeter done, thanks.
CamperBot
@camperbot
Sep 16 2015 17:05
kaki940 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 628 | @saintpeter | http://www.freecodecamp.com/saintpeter
Nathan Kipsang Tum
@nathantum
Sep 16 2015 17:08
hey i am having trouble with bracket notation question "Use bracket notation to find the first character in the firstLetterOfLastName variable."
how can i answer that question
Paweł
@ridlez
Sep 16 2015 17:09
@SaintPeter its an api
Nathan Kipsang Tum
@nathantum
Sep 16 2015 17:10
ooh.
Cam
@cam-barts
Sep 16 2015 17:11

Where do I belong
Hey everybody. I found some help online, but I was wondering why my solution didn't work for all cases. Im on the bonfires one titled "Where do I belong"

function where(arr, num) {
  // Find my place in this sorted array.
  arr.push(num);
  arr.sort();
  return arr.indexOf(num);
}

where([40, 60], 50, "");

It doesn't work with every case. Most of the solutions I found involve looping through the array, but I don't understand why indexOf doesnt do that for you.

CamperBot
@camperbot
Sep 16 2015 17:11
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
tva10
@tva10
Sep 16 2015 17:12
@nathantum that means that you can operate with strings like arrays. e.g. you can get first letter str[0]
Rustam Turaev
@rustamturaev
Sep 16 2015 17:14
@nathantum firstLetterOfLastName = lastName[0];
@nathantum Just dd 0 index fter lastName
*add
tva10
@tva10
Sep 16 2015 17:15
@TheBisonGuy where([5, 3, 20, 3], 3) that does'n work, right?
Cam
@cam-barts
Sep 16 2015 17:17
@tva10 Correct
@tva10 neither does [2, 5, 10], 15
tva10
@tva10
Sep 16 2015 17:19
@TheBisonGuy uhm, I found problem
take a sec
or use console.log(arr) after sort
Nathan Kipsang Tum
@nathantum
Sep 16 2015 17:20
@tva10 , @rustamturaev thanks a lot. what if you have a long string, and you want to find the 4th, 7th, 9th letters of that string, can you do that in one line ?
CamperBot
@camperbot
Sep 16 2015 17:20
nathantum sends brownie points to @tva10 and @rustamturaev :sparkles: :thumbsup: :sparkles:
:star: 225 | @tva10 | http://www.freecodecamp.com/tva10
:star: 125 | @rustamturaev | http://www.freecodecamp.com/rustamturaev
tva10
@tva10
Sep 16 2015 17:21
@TheBisonGuy where([5, 3, 20, 3], 3) when your sort() what array, you get '[20, 3, 3, 5]'
@TheBisonGuy he sort's that like String
Cam
@cam-barts
Sep 16 2015 17:22
@tva10 Any idea how to fix that?
tva10
@tva10
Sep 16 2015 17:22
@TheBisonGuy I think you should special function for sorting like
.sort(function(a,b)return a-b;)
you shoul use'''
CamperBot
@camperbot
Sep 16 2015 17:23
:bulb: to format code use backticks! ``` more info
tva10
@tva10
Sep 16 2015 17:23
should'
my breaked English (
Cam
@cam-barts
Sep 16 2015 17:25
@tva10 HEEEYYY THAT WORKED. Thank you very much!
CamperBot
@camperbot
Sep 16 2015 17:25
thebisonguy sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
tva10
@tva10
Sep 16 2015 17:25
@nathantum m/b/ str[4]+str[7]+str[9] or smth like that...
CamperBot
@camperbot
Sep 16 2015 17:25
:star: 226 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Sep 16 2015 17:25
@TheBisonGuy I was happy to help :D
@TheBisonGuy and your idea was cool, because I get this task with loops
Nathan Kipsang Tum
@nathantum
Sep 16 2015 17:26
@tva10 , thanks.
CamperBot
@camperbot
Sep 16 2015 17:26
nathantum sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:warning: nathantum already gave tva10 points
Samantha North
@sjnorth
Sep 16 2015 17:45
anyone currently working on the portfolio zipline (using bootstrap), how do I view and edit the <body> tags? at the moment they are hidden in the html screen
tva10
@tva10
Sep 16 2015 17:47
@sjnorth use JS/jQuery if you want
Samantha North
@sjnorth
Sep 16 2015 17:49
@tva10 what I'm trying to do is add a full-page background image to the entire site. i had an idea to try and add it within the body, but is there a better way?
tva10
@tva10
Sep 16 2015 17:53
@sjnorth there is some example http://codepen.io/markmurray/pen/bklme
@sjnorth may be in the future you will be change your parallax effect, and what you will be need JS
Brett
@breckler
Sep 16 2015 17:54
I am having issues with both the .addclass and .removeclass fuction with jquery. I've tried to look it up online, but the solutions they gave, won't work either. I'm a little confused on what my next step should be. It won't remove the class at all.
Robert Richey
@0x0936
Sep 16 2015 17:56
@breckler class should be capitalized. .addClass() and .removeClass()
Brett
@breckler
Sep 16 2015 17:56
ah, that might do it, thanks!
CamperBot
@camperbot
Sep 16 2015 17:56
if you want to thank someone, put an @ before their name!
Brett
@breckler
Sep 16 2015 17:58
@0x0936 thanks for the quick response
CamperBot
@camperbot
Sep 16 2015 17:58
breckler sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 162 | @0x0936 | http://www.freecodecamp.com/0x0936
Tod
@thermobee
Sep 16 2015 17:58
Does anyone have any experience with the geolocation html5 function?
Im having trouble with it and I cant finish the weather app
hakimnasir
@hakimnasir
Sep 16 2015 17:59
does anyone have any advice on tackling Show the Local Weather zipline
Tod
@thermobee
Sep 16 2015 18:00
Lol thats what Im working on
use open weather api
Nolan Chan
@NolanChan
Sep 16 2015 18:02
for "Waypoint: Target the same element with multiple jQuery Selectors", is $("button").addClass("animated").$(".btn").addClass("shake").$("#target1").addClass("btn-primary"); legitimate?
cause it doesn't seem to be working for me
so i guess it's not, but I'm not sure how else to follow the instructions
Brett
@breckler
Sep 16 2015 18:04
make sure you have semi colon after the last parenthesis
Robert Richey
@0x0936
Sep 16 2015 18:04
@thermobee I recommend using ip-api.
$.get("http://ip-api.com/json", function(data) {
  var lat = data.lat;
  var lon = data.lon;
});
Tod
@thermobee
Sep 16 2015 18:05
Thanks @0x0936
CamperBot
@camperbot
Sep 16 2015 18:05
thermobee sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 164 | @0x0936 | http://www.freecodecamp.com/0x0936
Tod
@thermobee
Sep 16 2015 18:05
But I got it to work.
Do you mind testing its accuracy for me?
Robert Richey
@0x0936
Sep 16 2015 18:08
@thermobee not accurate. I'm not in Weston County
Tod
@thermobee
Sep 16 2015 18:08
Is that nearby at least?
@0x0936
Cause the coordinates I am getting are not exact but they are pretty close.
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 18:09
@NolanChan You've to target different one, not chain them. Add different classes by using all those methods. You're pretty close.
Nolan Chan
@NolanChan
Sep 16 2015 18:10
so i add one different class to each element?
Robert Richey
@0x0936
Sep 16 2015 18:10
@thermobee there is no Weston county in my state
Nolan Chan
@NolanChan
Sep 16 2015 18:10
aaaah thanks @aniruddhabarapatre
CamperBot
@camperbot
Sep 16 2015 18:10
nolanchan sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles:
:star: 214 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre
Tod
@thermobee
Sep 16 2015 18:10
@0x0936 madness!
Chahan Shah
@Chahanshah
Sep 16 2015 18:58
Scghh
Paweł
@ridlez
Sep 16 2015 19:28
hey guys could somebody help me, casue im stuck :D
$('body').animate({('background-image', 'url(http://i.imgur.com/TUzlB4U.jpg)')}, 1500);
} else {
$('body').animate({backgroundColor: '#0091c2'}, 1500);
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 19:28
I on Bonfire "Finders Keepers" and I need to pass a function as a parameter. Does anyone know of a SIMPLE example of how that works?
Paweł
@ridlez
Sep 16 2015 19:29
the backgroundColor animation is working but when i want it to change into image it breaks
Rex Schrader
@SaintPeter
Sep 16 2015 19:36
@TheHighPriestess
function passMe(a, b) {
    return a + b;
}

function passToMe(func) {
   return func(2, 3);
}

passToMe(passMe);
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 19:38
@SaintPeter Thank you. I'm going to have to ponder this. It feels.....strange.
CamperBot
@camperbot
Sep 16 2015 19:38
thehighpriestess sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 630 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 16 2015 19:39
@TheHighPriestess Think of a function as a machine. You can run the machine (call the function) or you can send the machine to your cousin (pass the function). Once your cousin gets it, he can run it (call the function you passed).
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 19:41
@SaintPeter Ok...I'm going to play around with this...get a feel for it...before I attempt the Bonfire. Thank you.
CamperBot
@camperbot
Sep 16 2015 19:41
thehighpriestess sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave saintpeter points
Alistair
@CullenSkinked
Sep 16 2015 19:50
Hi, looking for a little bit of help in HTML and CSS Waypoint 18. Looking at the code I can't see what i've done wrong and the output even looks correct, but it won't let me go to the next section. The error is that I haven't given my image a border of 10px.
''' .thick-green-border {
border-width: 10px;
border-style: solid;
border-color: green;
} '''
Mateja Trifunovski
@Matko95
Sep 16 2015 19:56
@CullenSkinked did you add border-width: 10px; in your css?
Rex Schrader
@SaintPeter
Sep 16 2015 19:56
@CullenSkinked Can you share the code that you wrote?
wiki format
CamperBot
@camperbot
Sep 16 2015 19:56

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks, then type js or html and 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

jkirch
@jkirch
Sep 16 2015 19:58
Hello. I'm having some trouble with "Waypoint: Generate Random Whole Numbers within a Range"
return Math.floor(Math.random() * 9 - 0 +1) + 1;
That's what I have, following instructions, but for some reason I'm failing on the third requirement
Alistair
@CullenSkinked
Sep 16 2015 19:59
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .smaller-image {
    width: 100px;
  }

  .thick-green-border {
    border-width: 10px;
    border-style: solid;
    border-color: green;
  }
</style>

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<h2 class="red-text">CatPhotoApp</h2>

<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Pete McPherson
@StartupDino
Sep 16 2015 19:59
I'm in the same boat. Looks like a bug.
Rex Schrader
@SaintPeter
Sep 16 2015 19:59
@CullenSkinked Humm, that looks correct. Let me try it.
Mateja Trifunovski
@Matko95
Sep 16 2015 20:01
@jkirch you need to use the variables max and min in your formula
Rex Schrader
@SaintPeter
Sep 16 2015 20:01

@CullenSkinked Ok, I did this instead:

  .thick-green-border {
    border: 10px solid green;
  }

and it worked.

jkirch
@jkirch
Sep 16 2015 20:01
Aha, @Matko95 . Thank you. How do I give you points?
CamperBot
@camperbot
Sep 16 2015 20:01
jkirch sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 304 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 16 2015 20:02
@jkirch you just did :)
jkirch
@jkirch
Sep 16 2015 20:02
How'd I do that?
Mateja Trifunovski
@Matko95
Sep 16 2015 20:02
you only need to thank someone
CamperBot
@camperbot
Sep 16 2015 20:02
if you want to thank someone, put an @ before their name!
jkirch
@jkirch
Sep 16 2015 20:03
Wonderful, thanks.
Mateja Trifunovski
@Matko95
Sep 16 2015 20:03
@CullenSkinked your code works for me, what browser are you using?
Alistair
@CullenSkinked
Sep 16 2015 20:04
@Matko95 I'm on chrome, was just thinking about trying another browser.
Pete McPherson
@StartupDino
Sep 16 2015 20:04
Didn't work for me ;) On Firefox
Alistair
@CullenSkinked
Sep 16 2015 20:05
@SaintPeter Tried the new code, didn't work either.
Rex Schrader
@SaintPeter
Sep 16 2015 20:05
@CullenSkinked It worked on Chome for me, both ways. Maybe try doing a "Reset" and re-type or paste your code. Sometimes the page gets in a weird state
Alistair
@CullenSkinked
Sep 16 2015 20:06
Yeah probably something silly, I'll have a play about with it. Thanks @SaintPeter @Matko95
CamperBot
@camperbot
Sep 16 2015 20:06
cullenskinked sends brownie points to @saintpeter and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 632 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 305 | @matko95 | http://www.freecodecamp.com/matko95
Alistair
@CullenSkinked
Sep 16 2015 20:08
Opened up Firefox and it worked fine.
jkirch
@jkirch
Sep 16 2015 20:10

@CullenSkinked if you would like to continue using chrome instead, often it helps to check your javascript and popup settings
settings>show advanced settings>privacy>content settings
Javascript:
allow allsites to run Javascript
Cookies:
Allow local data to be set

You can also check if its a cacheing issue or plugin by trying in incognito mode. If it works there, you can clear your cache, or disable plugins and one of those will fix it.

Alistair
@CullenSkinked
Sep 16 2015 20:11
Thanks @jkirch Will try those out.
CamperBot
@camperbot
Sep 16 2015 20:11
cullenskinked sends brownie points to @jkirch :sparkles: :thumbsup: :sparkles:
:star: 153 | @jkirch | http://www.freecodecamp.com/jkirch
jkirch
@jkirch
Sep 16 2015 20:11
My pleasure
MrZappy
@MrZappy
Sep 16 2015 20:15
Sup nerds
SaintPeter @SaintPeter pushes up his glasses
Rex Schrader
@SaintPeter
Sep 16 2015 20:16
nuthin'
MrZappy
@MrZappy
Sep 16 2015 20:17
Hey bud how you been?
kgoode517
@kgoode517
Sep 16 2015 20:17
Stuck on Bonfire: Check for Palindrome I am attempting to make a regular expression that will take out spaces and other punctations. Here is my code

function palindrome(str) {
var rvrstr = str.split("").reverse().join("");
if(rvrstr.replace(/\s/gi).toLowerCase()==str.replace(/\s/gi).toLowerCase()){
return true;
}
return false;
}

palindrome("eye");

Rex Schrader
@SaintPeter
Sep 16 2015 20:17
@MrZappy Kicking butt, taking down names . . . slacking at work . . .
MrZappy
@MrZappy
Sep 16 2015 20:18
@SaintPeter Sounds like an amazing time lol.
Mateja Trifunovski
@Matko95
Sep 16 2015 20:19
@kgoode517 /s will remove whitespace, you need a regex to also clear the punctuation and non letter characters
Rex Schrader
@SaintPeter
Sep 16 2015 20:19
@kgoode517 It's not just spaces you need to remove, it's also punctuation. Also, you might want to change your order of operations so you remove spaces and stuff from the string, THEN do the reverse operation. Then you only need to do it once. I suggest this site: http://regex101.com to help with your regular expression. Look into "Character Classes".
kgoode517
@kgoode517
Sep 16 2015 20:20
@SaintPeter thank you as ever I don't know the commands I need to do what you are suggesting i will hop on that website right now.
CamperBot
@camperbot
Sep 16 2015 20:20
kgoode517 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 635 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 16 2015 20:27
@kgoode517 Taking your code as is, just moving stuff around:
str = str.replace(/\s/gi).toLowerCase();  // Both the reversed and normal strings need this process
var rvrstr = str.split("").reverse().join("");  
if(rvrstr === str){
     return true;
}
    return false;
}
Jelani Thompson
@JelaniThompson
Sep 16 2015 20:29
Hey guys, so I'm still kinda stuck on the error from yesterday and just decided to clean up my code a bit, however, I'm still really confused as to why my bootstrap navbar is blocking content when I jump to it on the page. I worked with the margins and stuff but I'm really lost, haha
Any help would be appreciated!
kgoode517
@kgoode517
Sep 16 2015 20:31
@SaintPeter that is beautiful I see what you are saying.
azazel913
@azazel913
Sep 16 2015 20:33
<a href="#"><img class="smaller-image thick-green-border" src=https://bit.ly/fcc-relaxing-cat> <input type="text" placeholder="this is placeholder text"></a>
Will Moody
@willmoody
Sep 16 2015 20:33
Hey guys! I'm trying to use Angular for the first time, for my Twitch API Zipline, but for some reason my $http.get doesn't seem to be running? Can anybody please lend a hand? :D http://codepen.io/fractalmind/pen/PPZPBq
azazel913
@azazel913
Sep 16 2015 20:34
I need help adding Setting the value of your placeholder attribute to "cat photo URL".
<a href="#"><img class="smaller-image thick-green-border" src=https://bit.ly/fcc-relaxing-cat> <input type="text" placeholder="this is placeholder text"></a>
Will Moody
@willmoody
Sep 16 2015 20:35
@azazel913 You can make code more readable by putting ``` on the lines before and after
@azazel913 And it seems like they're looking for something like this:
<a href="#"><img class="smaller-image thick-green-border" src=https://bit.ly/fcc-relaxing-cat> <input type="text" placeholder="cat photo URL"></a>
azazel913
@azazel913
Sep 16 2015 20:37
@fractal-mind thank you
CamperBot
@camperbot
Sep 16 2015 20:37
azazel913 sends brownie points to @fractal-mind :sparkles: :thumbsup: :sparkles:
:star: 214 | @fractal-mind | http://www.freecodecamp.com/fractal-mind
Will Moody
@willmoody
Sep 16 2015 20:38
@azazel913 np!
Jack Demynn
@infectiouscode
Sep 16 2015 20:40
Hey guys, I'm trying codeacademy as-well for a bit more insite, does anyone know why this code isn't working? I'm trying ifs and elses
// The computer doesn't worry about extra spaces between words or brackets
// It just cares about the order of where things are placed
// and that you have used the right characters (){}[]"";

// For extra help, a program called a 'linter' is checking your code
// and will put a red 'x' next to the first line that contains errors

if (10 = 10); {
    console.log("You got a true!");
} else {
    console.log("You got a false!");
}
Pete McPherson
@StartupDino
Sep 16 2015 20:41
might try === instead of =
Jack Demynn
@infectiouscode
Sep 16 2015 20:41
Why is it three?
Pete McPherson
@StartupDino
Sep 16 2015 20:41
who is john galt? (I dunno. Just JS syntax I believe)
Mateja Trifunovski
@Matko95
Sep 16 2015 20:42
@JelaniThompson you could make a margin the length of the navbar
Jack Demynn
@infectiouscode
Sep 16 2015 20:42
Okay, was just wondering if there was a reason
Mateja Trifunovski
@Matko95
Sep 16 2015 20:45
@infectiouscode "=" is an operand of assigning a value, "===" is an operand of comparation
var x=10;
x=15; //x is now equal to 15
x===15;//returns false
Mark Jackson
@markjjackson
Sep 16 2015 20:45
@infectiouscode one = sign sets the value of a variable, so variableName = 10 sets the variable to 10, but == and === are comparison operators which compare the values on each side and return a boolean value (either 'true' or 'false'), so 10 == 10 is true and 10 == 11 is false. In the code you sent you are trying to the value of 10 rather than comparing it with the other value
Jack Demynn
@infectiouscode
Sep 16 2015 20:52
oh okay thanks @markjjackson @Matko95
CamperBot
@camperbot
Sep 16 2015 20:52
infectiouscode sends brownie points to @markjjackson and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 289 | @markjjackson | http://www.freecodecamp.com/markjjackson
:star: 308 | @matko95 | http://www.freecodecamp.com/matko95
Mark Jackson
@markjjackson
Sep 16 2015 20:53
no problem :)
Jonathan Reasor
@abraxasrex
Sep 16 2015 20:58
I'm having some trouble setting up the yeoman for the basejumps! It looks like there are extra prompts in addition to what is listed in the description free code camp provides. namely, it asks what you want to write tests with: Jasmine, or Mocha/Chai, and no matter which one I choose it throws an error that the yeoman restart doesn't seem to fix. Any pointers?
Rex Schrader
@SaintPeter
Sep 16 2015 21:00
@abraxasrex /HelpBasejumps may have more info - in general, though, no one has been able to use c9 for a while. They're setting up local dev environments. I suspect that you need to do an npm update or npm install to get updated versions of some module or another.
Jonathan Reasor
@abraxasrex
Sep 16 2015 21:03
@SaintPeter thanks! i keep forgetting to use the proper chat room
CamperBot
@camperbot
Sep 16 2015 21:03
abraxasrex sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 637 | @saintpeter | http://www.freecodecamp.com/saintpeter
Mateja Trifunovski
@Matko95
Sep 16 2015 21:05
Anyone here farmiliar with angular?