16th
Sep 2015
Dona Hertel
@cocofan
Sep 16 2015 00:00 UTC
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 UTC
@Matko95 worked! ;)
Mateja Trifunovski
@Matko95
Sep 16 2015 00:03 UTC
@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 UTC
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 UTC
@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 UTC

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 UTC
@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 UTC
@moigithub thank you that is exactly what I added.
ninjatron
@ninjatron
Sep 16 2015 00:28 UTC
hey
could anyone help me with a specific question
Hans van Riet
@hansinla
Sep 16 2015 00:30 UTC
@ninjatron yes
ninjatron
@ninjatron
Sep 16 2015 00:30 UTC
@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 UTC
@ninjatron Each state has a registry
ninjatron
@ninjatron
Sep 16 2015 00:31 UTC
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 UTC
@ninjatron That’s the most obvious choice IMO
ninjatron
@ninjatron
Sep 16 2015 00:32 UTC
hmmm....
Hans van Riet
@hansinla
Sep 16 2015 00:33 UTC
@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 UTC
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 UTC
I did?
Mateja Trifunovski
@Matko95
Sep 16 2015 00:35 UTC
tax must be simiral to thanks :D
CamperBot
@camperbot
Sep 16 2015 00:35 UTC
if you want to thank someone, put an @ before their name!
Mateja Trifunovski
@Matko95
Sep 16 2015 00:35 UTC
This message was deleted
ninjatron
@ninjatron
Sep 16 2015 00:38 UTC
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 UTC
@Matko95 lol
Moisés Man
@moigithub
Sep 16 2015 00:42 UTC
think
think you
Mateja Trifunovski
@Matko95
Sep 16 2015 00:44 UTC
it's not that aswell :D
Moisés Man
@moigithub
Sep 16 2015 00:44 UTC
@moigithub think you
@camperbot got a hiccup
@moigithub luck
Gary Lacey
@galacey
Sep 16 2015 00:50 UTC
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 UTC
So, I am needing some with the .pop() function
Hans van Riet
@hansinla
Sep 16 2015 00:53 UTC
@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 UTC
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 UTC
@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 UTC
+1 for @hansinla . I don't remember those being there when I did those
Gary Lacey
@galacey
Sep 16 2015 00:58 UTC
@hansinla thanks . wasn't sure if i was missing something
CamperBot
@camperbot
Sep 16 2015 00:58 UTC
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 UTC
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 UTC
@aniruddhabarapatre i assume you need to have npm installed some unit testing framework(s)?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:23 UTC
@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 UTC
hmmm
is there no package.json?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:24 UTC
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 UTC
(i haven't got there yet)
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:24 UTC
What I'm talking about should be easier to see on the full page example
Hans van Riet
@hansinla
Sep 16 2015 01:25 UTC
@JelaniThompson add a margin-top or an empty <div> with a certain height.
Britton Overall
@boverall
Sep 16 2015 01:27 UTC
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 UTC
@alanbuchanan Np. Thanks. There is a package.json and added test.js too. But it's empty.
CamperBot
@camperbot
Sep 16 2015 01:27 UTC
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 UTC
@boverall https://regex101.com/#javascript This is your friend.
Rory Smith
@alanbuchanan
Sep 16 2015 01:28 UTC
@aniruddhabarapatre how infuriating, that there are no further instructions
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:29 UTC
@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

"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 UTC
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 UTC
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 UTC
@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 UTC
@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 UTC
@aniruddhabarapatre can you show your package.json?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 16 2015 01:38 UTC
@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": "",
}
Rory Smith
@alanbuchanan
Sep 16 2015 01:41 UTC
@aniruddhabarapatre looks fine. i can't figure that one out :worried:
Jonathan Reasor
@abraxasrex
Sep 16 2015 01:42 UTC
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 UTC
@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 UTC
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 UTC
@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 UTC
@aniruddhabarapatre what are you typing to execute the test? npm test?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:49 UTC
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 UTC
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 UTC
@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 UTC
@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 UTC
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 UTC
Can someone help me with some jquery troubleshooting?
Britton Overall
@boverall
Sep 16 2015 01:56 UTC
Ah got it, thanks @matteverson
CamperBot
@camperbot
Sep 16 2015 01:56 UTC
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 UTC
This message was deleted
Rory Smith
@alanbuchanan
Sep 16 2015 01:57 UTC
@rbunz08 yeah i remember it being a pain to get right
Matt Everson
@matteverson
Sep 16 2015 01:57 UTC
@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 UTC
this was for Waypoint: Generate Random Whole Numbers within a Range
Mateja Trifunovski
@Matko95
Sep 16 2015 01:57 UTC
@weirdhockeygirl16 how do you mean a integer instead of decimal?
Jelani Thompson
@JelaniThompson
Sep 16 2015 01:58 UTC
@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 UTC
whole number instead of a decimal
@Matko95
Mateja Trifunovski
@Matko95
Sep 16 2015 01:58 UTC
@weirdhockeygirl16 oh :) Math.floor() does that job
it rounds to the nearest number, going downwards
rbunz
@rbunz08
Sep 16 2015 01:59 UTC

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 UTC
Math.floor(Math.random() * (9 - 0 + 1)) + 0
return Math.random();
}
Rory Smith
@alanbuchanan
Sep 16 2015 02:00 UTC
@rbunz08 have you tried using media queries?
Mateja Trifunovski
@Matko95
Sep 16 2015 02:00 UTC
@JelaniThompson the h2 elements
Alanna M
@weirdhockeygirl16
Sep 16 2015 02:00 UTC
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 UTC
@alanbuchanan in my css but can you use it in your javascript?
Mateja Trifunovski
@Matko95
Sep 16 2015 02:00 UTC
@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 UTC
im trying to do Waypoint: Generate Random Whole Numbers within a Range
Mateja Trifunovski
@Matko95
Sep 16 2015 02:02 UTC
@weirdhockeygirl16 you need to return this return Math.floor(Math.random()*(max-min+1)+min);
Alanna M
@weirdhockeygirl16
Sep 16 2015 02:02 UTC
@Matko95 thank you!
CamperBot
@camperbot
Sep 16 2015 02:02 UTC
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 UTC
@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 UTC
@matteverson the setup for basejumps comes after the mongodb module. can i do them in reverse order?
rbunz
@rbunz08
Sep 16 2015 02:04 UTC
@alanbuchanan I got it!! I used
if($(window).width() <= 770){ } around the button function Rory Smith @alanbuchanan Sep 16 2015 02:05 UTC @rbunz08 nice :thumbsup: Matt Everson @matteverson Sep 16 2015 02:26 UTC @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 UTC 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 UTC @YanKozlovskiy to check if it's odd or even Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:31 UTC oh what kind of math is this? i feel like i need more practice Mateja Trifunovski @Matko95 Sep 16 2015 02:31 UTC @YanKozlovskiy it's moduo wiki moduo CamperBot @camperbot Sep 16 2015 02:31 UTC 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 UTC wiki modulo CamperBot @camperbot Sep 16 2015 02:32 UTC 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 UTC wiki modulo CamperBot @camperbot Sep 16 2015 02:32 UTC 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 UTC hmm :D Rory Smith @alanbuchanan Sep 16 2015 02:32 UTC haha Mateja Trifunovski @Matko95 Sep 16 2015 02:32 UTC @YanKozlovskiy In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus). Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:32 UTC is there like a course i can take online? Mateja Trifunovski @Matko95 Sep 16 2015 02:32 UTC for math? Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:34 UTC 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 UTC @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 UTC 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 UTC there are free courses on math on khanacademy afaik Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:36 UTC thanks :) CamperBot @camperbot Sep 16 2015 02:36 UTC if you want to thank someone, put an @ before their name! Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:37 UTC thanks @Matko95 and @alanbuchanan CamperBot @camperbot Sep 16 2015 02:37 UTC 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 UTC FYI I just found this course on coursera Hans van Riet @hansinla Sep 16 2015 02:37 UTC @YanKozlovskiy There’s not more to it. It’s the remainder after a division. Yan Kozlovskiy @YanKozlovskiy Sep 16 2015 02:38 UTC 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 UTC ## 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 UTC 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 UTC @rbunz08$( window ).resize(function() {
$( "#log" ).append( "<div>Handler for .resize() called.</div>" ); }); rbunz @rbunz08 Sep 16 2015 03:29 UTC @hansinla I dont totally understand this... what do I put in the spots with yellow? Hans van Riet @hansinla Sep 16 2015 03:30 UTC @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 UTC
@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 UTC @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 UTC
@hansinla Isnt that the same?
Hans van Riet
@hansinla
Sep 16 2015 03:37 UTC
I was still editing. You may want to check closing brackets, but this is the idea.
rbunz
@rbunz08
Sep 16 2015 03:37 UTC
o ok..
@hansinla
Hans van Riet
@hansinla
Sep 16 2015 03:39 UTC
@rbunz08 To avoid repeat, put the repeated code in a function and call that function repeatedly.
rbunz
@rbunz08
Sep 16 2015 03:39 UTC
@hansinla thanks!
CamperBot
@camperbot
Sep 16 2015 03:39 UTC
rbunz08 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 367 | @hansinla | http://www.freecodecamp.com/hansinla
rbunz
@rbunz08
Sep 16 2015 03:40 UTC
@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 UTC
@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 UTC
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 UTC
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 UTC
Ok, Thanks @hansinla :)
CamperBot
@camperbot
Sep 16 2015 03:44 UTC
if you want to thank someone, put an @ before their name!
Phantom Bughunter
@mgrunenwald
Sep 16 2015 03:53 UTC
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 UTC
@mgrunenwald Can you show us your code here?
wiki format
CamperBot
@camperbot
Sep 16 2015 03:58 UTC

## :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 ⏎]

then press [shift + enter ⏎]

 ⇦ Type 3 backticks, then press [enter ⏎]

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

Phantom Bughunter
@mgrunenwald
Sep 16 2015 04:03 UTC
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 UTC

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 UTC
@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 UTC
@mgrunenwald You probably want to start with declaring your variables within the function and not as globals.
rbunz
@rbunz08
Sep 16 2015 04:09 UTC
@hansinla got it!! thanks
CamperBot
@camperbot
Sep 16 2015 04:09 UTC
rbunz08 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:warning: rbunz08 already gave hansinla points
Hans van Riet
@hansinla
Sep 16 2015 04:09 UTC
@rbunz08 Great
rbunz
@rbunz08
Sep 16 2015 04:09 UTC
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 UTC @rbunz08 looks great! Phantom Bughunter @mgrunenwald Sep 16 2015 04:11 UTC @hansinla that was it! Thanks very much! CamperBot @camperbot Sep 16 2015 04:11 UTC 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 UTC What was wrong with declaring the variables as globals in this instance, though? Barrett @Tao0fpooh Sep 16 2015 04:12 UTC @Gornstats still lost Hans van Riet @hansinla Sep 16 2015 04:13 UTC @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 UTC @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 UTC @hansinla I see. I’ll keep that in mind for upcoming exercises! Barrett @Tao0fpooh Sep 16 2015 04:16 UTC @Gornstats not passing with engine or engines Jeremy Gorniak @Gornstats Sep 16 2015 04:16 UTC @Tao0fpooh share your code again Barrett @Tao0fpooh Sep 16 2015 04:17 UTC @Gornstats var myCar = new Car(); this.engine = 1; Jeremy Gorniak @Gornstats Sep 16 2015 04:18 UTC @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 UTC 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 UTC @kgoode517 because anything times zero is zero? Mateja Trifunovski @Matko95 Sep 16 2015 04:21 UTC @kgoode517 it's that, and you declare a new variable through every iteration Hans van Riet @hansinla Sep 16 2015 04:21 UTC @Matko95 good catch Mateja Trifunovski @Matko95 Sep 16 2015 04:22 UTC @kgoode517 so every iteration you get newNum=5*5-1 kgoode517 @kgoode517 Sep 16 2015 04:22 UTC @Matko95 how would I correct that? Mateja Trifunovski @Matko95 Sep 16 2015 04:22 UTC @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 UTC so hard to avoid showing recursive answer kgoode517 @kgoode517 Sep 16 2015 04:25 UTC @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 UTC 5! = 5 * 4 * 3 * 2 * 1 = 120 Mateja Trifunovski @Matko95 Sep 16 2015 04:27 UTC or yeah you can use recursion Robert Richey @0x0936 Sep 16 2015 04:27 UTC the factorial of a non-negative number 0 or 1 is 1 Barrett @Tao0fpooh Sep 16 2015 04:31 UTC @Gornstats thanks! I got it CamperBot @camperbot Sep 16 2015 04:31 UTC 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 UTC @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 UTC @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 UTC 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 UTC @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 UTC 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 UTC function factorialize(num) { var sum = 1; while (num > 1) { sum *= num--; } return sum; } kgoode517 @kgoode517 Sep 16 2015 04:53 UTC @0x0936 That makes perfect sense thank you CamperBot @camperbot Sep 16 2015 04:53 UTC 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 UTC 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 UTC @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 UTC variable name sum is probably better named product or total Robert Smith @Tanker5419 Sep 16 2015 05:09 UTC 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 UTC type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom Robert Smith @Tanker5419 Sep 16 2015 05:09 UTC '''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 UTC :bulb: to format code use backticks!  more info Robert Smith @Tanker5419 Sep 16 2015 05:10 UTC 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 UTC @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 UTC Has anyone gone back to the pomodoro clock and tried to build it using Angular? Robert Smith @Tanker5419 Sep 16 2015 05:16 UTC @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 UTC tanker5419 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles: :star: 214 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest DJ @qualitymanifest Sep 16 2015 05:17 UTC 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 UTC @thomasvaeth I decided NOT to do that. LOL Thomas Vaeth @thomasvaeth Sep 16 2015 05:26 UTC @hansinla I think I'm going to go for it. It shouldn't that difficult. Hans van Riet @hansinla Sep 16 2015 05:34 UTC @thomasvaeth Good for you! I decided to do Wiki And Calculator as angular projects. Akira Laine @AkiraLaine Sep 16 2015 05:39 UTC # 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 UTC 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 UTC 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 UTC bf friendly CamperBot @camperbot Sep 16 2015 06:17 UTC ## :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 UTC @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 UTC Hi all, this is my first time here.... Ali-Haider5 @Ali-Haider5 Sep 16 2015 06:35 UTC 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 UTC Hi Ali, can you share the question also? Ali-Haider5 @Ali-Haider5 Sep 16 2015 06:46 UTC 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 UTC 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 UTC @saurabh-gahlot sorry i didn;t understand? Saurabh @saurabh-gahlot Sep 16 2015 06:48 UTC @Ali-Haider5 Share the full details of the question ... Ali-Haider5 @Ali-Haider5 Sep 16 2015 06:49 UTC @saurabh-gahlot I want to solve this challenge Waypoint: Make Object Properties Private This message was deleted CamperBot @camperbot Sep 16 2015 06:50 UTC :warning: no user found for saurabh-gahlot Saurabh @saurabh-gahlot Sep 16 2015 06:54 UTC @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 UTC @saurabh-gahlot why can't I write this. speed? Saurabh @saurabh-gahlot Sep 16 2015 06:57 UTC Beacause it should not be accessible ... Bill @kirah1314 Sep 16 2015 06:57 UTC @saurabh-gahlot you just have to remove this Saurabh @saurabh-gahlot Sep 16 2015 06:58 UTC Yes... Bill @kirah1314 Sep 16 2015 06:59 UTC that will make the function private Ali-Haider5 @Ali-Haider5 Sep 16 2015 07:00 UTC @thanks @kirah1314 that was my question? CamperBot @camperbot Sep 16 2015 07:00 UTC 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 UTC 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 UTC post your code help formatting CamperBot @camperbot Sep 16 2015 07:15 UTC ## :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 DTing @dting Sep 16 2015 07:15 UTC 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 UTC Thanks @dting :) CamperBot @camperbot Sep 16 2015 07:16 UTC millinet sends brownie points to @dting :sparkles: :thumbsup: :sparkles: :star: 1184 | @dting | http://www.freecodecamp.com/dting Isabelle Lepez @Isabellle Sep 16 2015 07:20 UTC Oh thank you for sharing this @dting CamperBot @camperbot Sep 16 2015 07:20 UTC millinet sends brownie points to @dting :sparkles: :thumbsup: :sparkles: :warning: millinet already gave dting points Manish Gupta @mformanish Sep 16 2015 07:51 UTC 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 UTC bf mutations CamperBot @camperbot Sep 16 2015 07:54 UTC ## :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 UTC @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 UTC 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 UTC 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 UTC if you want to thank someone, put an @ before their name! Robert Smith @Tanker5419 Sep 16 2015 08:22 UTC I understand the syntax and flag, but I don't understand what [\W_] means. Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:25 UTC 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 UTC @Ali-Haider5 you dont need the var before mycar.engines=1 marzelin @marzelin Sep 16 2015 08:33 UTC @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 UTC @marzelin thank you! CamperBot @camperbot Sep 16 2015 08:35 UTC tanker5419 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles: :star: 212 | @marzelin | http://www.freecodecamp.com/marzelin marzelin @marzelin Sep 16 2015 08:35 UTC @Tanker5419 :+1: @Tanker5419 do you want some good resources about regular expressions? Robert Smith @Tanker5419 Sep 16 2015 08:39 UTC marzelin @marzelin Sep 16 2015 08:41 UTC Robert Smith @Tanker5419 Sep 16 2015 08:45 UTC Thanks @marzelin ! CamperBot @camperbot Sep 16 2015 08:45 UTC tanker5419 sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles: :warning: tanker5419 already gave marzelin points Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:46 UTC 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 UTC 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 UTC @Ali-Haider5 add ; to the return line Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:48 UTC @marzelin didn't work marzelin @marzelin Sep 16 2015 08:49 UTC @Ali-Haider5 which waypoint is it? Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:49 UTC Waypoint: Condense arrays with reduce about @marzelin CamperBot @camperbot Sep 16 2015 08:50 UTC :star: 212 | @marzelin | http://www.freecodecamp.com/marzelin Aleksandr Sidorov @AleksandrSidorov Sep 16 2015 08:51 UTC This message was deleted marzelin @marzelin Sep 16 2015 08:51 UTC @Ali-Haider5 you have a typo in function Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:52 UTC @marzelin yeah but still didn't work after correcting funtion to function marzelin @marzelin Sep 16 2015 08:52 UTC @Ali-Haider5 as well should be singleVal Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:53 UTC Thanks @marzelin now its running CamperBot @camperbot Sep 16 2015 08:53 UTC 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 UTC @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 UTC thanks for suggestion CamperBot @camperbot Sep 16 2015 08:54 UTC if you want to thank someone, put an @ before their name! Ali-Haider5 @Ali-Haider5 Sep 16 2015 08:54 UTC @marzelin Dealga McArdle @zeffii Sep 16 2015 09:00 UTC @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 UTC @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 UTC 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 UTC help bonfire Roman Numeral Converter CamperBot @camperbot Sep 16 2015 09:15 UTC ## :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 UTC Guys. I need help with Bonfire: Confirm the Ending CamperBot @camperbot Sep 16 2015 09:22 UTC type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom urvashi9 @urvashi9 Sep 16 2015 09:22 UTC bonfire confirm the ending CamperBot @camperbot Sep 16 2015 09:22 UTC ## :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 UTC 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 UTC @urvashi9 . your equality is checked with == , should it be ? urvashi9 @urvashi9 Sep 16 2015 09:23 UTC 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 UTC @dting Thanks CamperBot @camperbot Sep 16 2015 09:25 UTC mformanish sends brownie points to @dting :sparkles: :thumbsup: :sparkles: :star: 1185 | @dting | http://www.freecodecamp.com/dting urvashi9 @urvashi9 Sep 16 2015 09:25 UTC 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 UTC is this for a bonfire? urvashi9 @urvashi9 Sep 16 2015 09:26 UTC Yes. Dealga McArdle @zeffii Sep 16 2015 09:26 UTC link? urvashi9 @urvashi9 Sep 16 2015 09:26 UTC bonfire confirm the ending CamperBot @camperbot Sep 16 2015 09:26 UTC ## :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 UTC @urvashi9 not last word. just that str ends with target urvashi9 @urvashi9 Sep 16 2015 09:28 UTC 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 UTC bf links CamperBot @camperbot Sep 16 2015 09:31 UTC links: DTing @dting Sep 16 2015 09:31 UTC use negative value for substrargument = to target's length urvashi9 @urvashi9 Sep 16 2015 09:31 UTC I did. DTing @dting Sep 16 2015 09:32 UTC no you did substr(-1, 1) urvashi9 @urvashi9 Sep 16 2015 09:34 UTC Oh wait. Just figured it out!! Thanks to you! @dting CamperBot @camperbot Sep 16 2015 09:35 UTC 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 UTC @urvashi9 function end(str, target) { return new RegExp(target+"$").test(str)
}
i learned that today :)
urvashi9
@urvashi9
Sep 16 2015 09:36 UTC
@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 UTC
it includes the explaination of @zeffii code
its at the bottom
urvashi9
@urvashi9
Sep 16 2015 09:37 UTC
Oh alright. I am going to check it out.
:)
Dealga McArdle
@zeffii
Sep 16 2015 09:37 UTC
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 UTC Okay, I did not know that. Thanks @zeffii CamperBot @camperbot Sep 16 2015 09:38 UTC urvashi9 sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles: :star: 358 | @zeffii | http://www.freecodecamp.com/zeffii DTing @dting Sep 16 2015 09:39 UTC ya that works until your target includes certain characters, for example: end("asdfadsf", "[a-z]") // true Dealga McArdle @zeffii Sep 16 2015 09:39 UTC @dting, valid point :) that doesn't mean it's not really useful in controlled circumstances CamperBot @camperbot Sep 16 2015 09:40 UTC :trollface: troll problems? notify admins here urvashi9 @urvashi9 Sep 16 2015 09:41 UTC Guys, What is the difference between == and ===? Dealga McArdle @zeffii Sep 16 2015 09:41 UTC have you googled that yet? @urvashi9 azaleas @azaleas Sep 16 2015 09:41 UTC This message was deleted strict equals doesnt convert type Dealga McArdle @zeffii Sep 16 2015 09:42 UTC urvashi9 @urvashi9 Sep 16 2015 09:43 UTC Yeah let me check those articles out. Thanks for being so helpful. :) CamperBot @camperbot Sep 16 2015 09:43 UTC if you want to thank someone, put an @ before their name! Ali-Haider5 @Ali-Haider5 Sep 16 2015 09:43 UTC need some code on Bonfire: Reverse a String azaleas @azaleas Sep 16 2015 09:44 UTC 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 UTC @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 UTC @dting, str[3] just for the testing purpose:) Ali-Haider5 @Ali-Haider5 Sep 16 2015 09:45 UTC 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 UTC @dting help bro azaleas @azaleas Sep 16 2015 09:46 UTC @dting where exactly I should join it? the error is the same DTing @dting Sep 16 2015 09:46 UTC 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 UTC ## :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 UTC bf links CamperBot @camperbot Sep 16 2015 09:47 UTC DTing @dting Sep 16 2015 09:47 UTC see those links Ali-Haider5 @Ali-Haider5 Sep 16 2015 09:49 UTC bf details CamperBot @camperbot Sep 16 2015 09:49 UTC ## :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 UTC 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 UTC ## :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 UTC @anik3tra0 your code needs to go inside the function function reverseString(str) { // Your code goes here } Aniket Rao @anik3tra0 Sep 16 2015 09:57 UTC @dting thanks! CamperBot @camperbot Sep 16 2015 09:57 UTC 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 UTC @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 UTC @mformanish thanks! I was reading that but got a bit confused.. CamperBot @camperbot Sep 16 2015 09:59 UTC 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 UTC Ok , Those links are like hints solution will be using all those links. Jack Demynn @infectiouscode Sep 16 2015 10:43 UTC Time to start my learning of functions. Not looking forward to it at all. Dealga McArdle @zeffii Sep 16 2015 10:43 UTC @infectiouscode you will like functions. Jack Demynn @infectiouscode Sep 16 2015 10:44 UTC Will I? XD It looks rough @zeffii Dealga McArdle @zeffii Sep 16 2015 10:45 UTC programming without function is rougher Jack Demynn @infectiouscode Sep 16 2015 10:45 UTC It just looked really difficult Alexander Schuneman @AxSch Sep 16 2015 10:45 UTC Anyone on Waypoint, pop? Dealga McArdle @zeffii Sep 16 2015 10:45 UTC i'm almost certain you will change your mind. Jack Demynn @infectiouscode Sep 16 2015 10:46 UTC Is that in the long run or when i start learning? Dealga McArdle @zeffii Sep 16 2015 10:46 UTC pretty early-on in the process Jack Demynn @infectiouscode Sep 16 2015 10:47 UTC Well I better get started :) zac247 @zac247 Sep 16 2015 11:01 UTC could any one tell me what the camperbot is? Alexander Schuneman @AxSch Sep 16 2015 11:04 UTC @zac247 its a bot programmed to help Jack Demynn @infectiouscode Sep 16 2015 11:05 UTC Im stuck on iterating on js with while loops, im not sure how to do them? Heres what it says to do. zac247 @zac247 Sep 16 2015 11:05 UTC @AxSch Thanks for replying;how can i make use of it? CamperBot @camperbot Sep 16 2015 11:05 UTC 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 UTC 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 UTC type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom Jack Demynn @infectiouscode Sep 16 2015 11:08 UTC For example he just asked me to type the bonfire name to get info on it @zac247 zac247 @zac247 Sep 16 2015 11:10 UTC 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 UTC if you want to thank someone, put an @ before their name! zac247 @zac247 Sep 16 2015 11:11 UTC @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 UTC 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 UTC @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 UTC 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 UTC the while loop you pasted above is equivalent to : for(i=0;i<5;i++){ Makler @Makler1337 Sep 16 2015 11:14 UTC 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 UTC yeah to me that looks alien to me Makler @Makler1337 Sep 16 2015 11:15 UTC <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 UTC What do you need help with @Makler1337 zac247 @zac247 Sep 16 2015 11:15 UTC //push variables into array each loop } Jack Demynn @infectiouscode Sep 16 2015 11:15 UTC 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 UTC 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 UTC @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 UTC I do go on codeacademy at times ive got yah answer bud zac247 @zac247 Sep 16 2015 11:19 UTC @Makler1337 <i> goes inside button Jack Demynn @infectiouscode Sep 16 2015 11:19 UTC @Makler1337 the I element goes here >>> Submit><i class="fa fa-thumbs-up"</i></button> zac247 @zac247 Sep 16 2015 11:21 UTC @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 UTC @infectiouscode love you thanks! CamperBot @camperbot Sep 16 2015 11:22 UTC 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 UTC 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 UTC //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 UTC 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 UTC Bonfire Factorialize a Number CamperBot @camperbot Sep 16 2015 11:35 UTC ## :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 UTC hint CamperBot @camperbot Sep 16 2015 11:36 UTC :construction: Spoilers are only in the Bonfire's Custom Room :point_right: Christoffer92 @Christoffer92 Sep 16 2015 11:39 UTC Bonfire Where art thou CamperBot @camperbot Sep 16 2015 11:39 UTC ## :fire:Bonfire: Where art thou :link: function where(collection, source) { var arr = []; // What's in a name? return arr; } where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }); Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument). more info: bf details | bf links | hint Christoffer92 @Christoffer92 Sep 16 2015 11:39 UTC hint CamperBot @camperbot Sep 16 2015 11:39 UTC :construction: Spoilers are only in the Bonfire's Custom Room :point_right: catalinxD44 @catalinxD44 Sep 16 2015 12:08 UTC 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 UTC Bonfire Search and Replace CamperBot @camperbot Sep 16 2015 12:21 UTC ## :fire:Bonfire: Search and Replace :link: function replace(str, before, after) { return str; } replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped"); Perform a search and replace on the sentence using the arguments provided and return the new sentence. more info: bf details | bf links | hint Christoffer92 @Christoffer92 Sep 16 2015 12:21 UTC hint CamperBot @camperbot Sep 16 2015 12:21 UTC :construction: Spoilers are only in the Bonfire's Custom Room :point_right: Bernard Doci @bernarddoci Sep 16 2015 12:29 UTC 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 UTC
@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 UTC
@bernarddoci there's a much shorter RegExp that will work
Christoffer92
@Christoffer92
Sep 16 2015 12:38 UTC
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 UTC
@bernarddoci It seems that the only problem is with your regular expressions.
Bernard Doci
@bernarddoci
Sep 16 2015 12:44 UTC
@natac13 @kmccn-org Thank you very much
CamperBot
@camperbot
Sep 16 2015 12:44 UTC
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 UTC
@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 UTC
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 UTC @bernarddoci replace(/[\W_]/g, "") Bernard Doci @bernarddoci Sep 16 2015 12:53 UTC @Takumar Thank you for your help CamperBot @camperbot Sep 16 2015 12:53 UTC 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 UTC @bernarddoci good job :-) Bernard Doci @bernarddoci Sep 16 2015 12:55 UTC @kmccn-org Yes your right it's much shorter than my regex. Thx CamperBot @camperbot Sep 16 2015 12:55 UTC 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 UTC welcome! Ali-Haider5 @Ali-Haider5 Sep 16 2015 13:00 UTC bonfire factoriolize CamperBot @camperbot Sep 16 2015 13:00 UTC Sorry, can't find a bonfire called factoriolize. [ Check the map? ] Ali-Haider5 @Ali-Haider5 Sep 16 2015 13:00 UTC Bonfire: Factorialize a Number CamperBot @camperbot Sep 16 2015 13:00 UTC ## :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 UTC bf link CamperBot @camperbot Sep 16 2015 13:00 UTC Sorry, can't find a bonfire called link. [ Check the map? ] Ali-Haider5 @Ali-Haider5 Sep 16 2015 13:01 UTC hint CamperBot @camperbot Sep 16 2015 13:01 UTC :construction: Spoilers are only in the Bonfire's Custom Room :point_right: Terry @terryrey Sep 16 2015 13:31 UTC 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 UTC if you want to thank someone, put an @ before their name! tva10 @tva10 Sep 16 2015 13:34 UTC @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 UTC @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 UTC @terryrey may be this link help you http://www.w3schools.com/html/html_symbols.asp Odysseas Samaras @odysseas Sep 16 2015 13:39 UTC 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 UTC @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 UTC I want to get the "clouds" value, so data.weather[0].main ? tva10 @tva10 Sep 16 2015 13:44 UTC @odysseas yes Odysseas Samaras @odysseas Sep 16 2015 13:44 UTC thanks @tva10 CamperBot @camperbot Sep 16 2015 13:44 UTC odysseas sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles: :star: 217 | @tva10 | http://www.freecodecamp.com/tva10 tva10 @tva10 Sep 16 2015 13:44 UTC but may be you should check data.weatherarray.length Odysseas Samaras @odysseas Sep 16 2015 13:47 UTC 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 UTC are you guys talking about the weather api zipline? tva10 @tva10 Sep 16 2015 13:48 UTC @odysseas To find out that, you need to read the documentation for the API azazel913 @azazel913 Sep 16 2015 13:48 UTC 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 UTC are you also having trouble accessing the weather part, it always comes up undefined for me Odysseas Samaras @odysseas Sep 16 2015 13:49 UTC yeah data.weather[0].main works for me at least for now Thomas Bernfeld @happpyier Sep 16 2015 13:50 UTC @odysseas Huh Thanks CamperBot @camperbot Sep 16 2015 13:50 UTC if you want to thank someone, put an @ before their name! tva10 @tva10 Sep 16 2015 13:51 UTC @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 UTC 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 UTC if you want to thank someone, put an @ before their name! azazel913 @azazel913 Sep 16 2015 13:53 UTC @tva10 so what do I have wrong tva10 @tva10 Sep 16 2015 13:54 UTC @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 UTC @tva10 okay thanks CamperBot @camperbot Sep 16 2015 13:55 UTC azazel913 sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles: :star: 218 | @tva10 | http://www.freecodecamp.com/tva10 tva10 @tva10 Sep 16 2015 13:55 UTC <img class="class1 class2 .your-border-class" ...> Terry @terryrey Sep 16 2015 14:10 UTC @tva10, I'm feeling extremely stupid because I just cannot see it! tva10 @tva10 Sep 16 2015 14:12 UTC @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 UTC
@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 UTC
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 UTC
@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 UTC
@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 UTC
@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 UTC
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 UTC
@moigithub that bonfire makes no sense to me. It needs a better explanation.
Elizabeth Hatleli
@TheHighPriestess
Sep 16 2015 14:29 UTC
I don't find these math related Bonfires helpful at all.
azazel913
@azazel913
Sep 16 2015 14:29 UTC
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 UTC
I thought that I was supposed to find the LCM...which is what the title is.
azaleas
@azaleas
Sep 16 2015 14:32 UTC
@azazel913
<p>
<a href="http://www.freecatphotoapp.com">cat photos</a>
View More

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

## welcome to FreeCodeCamp @Lasynsec!

MrZappy
@MrZappy
Sep 16 2015 14:35 UTC
@Lasynsec Welcome!
Robert Richey
@0x0936
Sep 16 2015 14:36 UTC
Welcome @Lasynsec
Lasynsec
@Lasynsec
Sep 16 2015 14:36 UTC
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 UTC
if you want to thank someone, put an @ before their name!
Lasynsec
@Lasynsec
Sep 16 2015 14:37 UTC
thank you @0x0936 and @MrZappy
CamperBot
@camperbot
Sep 16 2015 14:37 UTC
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 UTC
No problem
Lasynsec
@Lasynsec
Sep 16 2015 14:40 UTC
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 UTC i am not a native english speaker Elizabeth Hatleli @TheHighPriestess Sep 16 2015 14:48 UTC @moigithub Thank you CamperBot @camperbot Sep 16 2015 14:48 UTC thehighpriestess sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles: :star: 348 | @moigithub | http://www.freecodecamp.com/moigithub Lasynsec @Lasynsec Sep 16 2015 14:49 UTC maybe anyone knows a better way to build a tweet button ? ''' CamperBot @camperbot Sep 16 2015 14:54 UTC :bulb: to format code use backticks!  more info Lasynsec @Lasynsec Sep 16 2015 14:54 UTC This message was deleted tva10 @tva10 Sep 16 2015 14:55 UTC @Lasynsec I never make these buttons before, but do you see code generators? Alexander Schuneman @AxSch Sep 16 2015 14:55 UTC anyone on the pop waypoint? Lasynsec @Lasynsec Sep 16 2015 14:55 UTC <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');
Sasa Popovic
@Zunior
Sep 16 2015 14:56 UTC
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 UTC
thank you @tva10 , but what is code generators
?
CamperBot
@camperbot
Sep 16 2015 14:57 UTC
lasynsec sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 221 | @tva10 | http://www.freecodecamp.com/tva10
tva10
@tva10
Sep 16 2015 14:58 UTC
@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 UTC
@tva10 good , i'm on it
tva10
@tva10
Sep 16 2015 15:02 UTC
@Zunior I use .filter() in that task
Alejandro Colomer
@workerhn
Sep 16 2015 15:02 UTC
Moisés Man
@moigithub
Sep 16 2015 15:02 UTC
sinnersdoom
@sinnersdoom
Sep 16 2015 15:03 UTC
how do u post the pic of source code?
tva10
@tva10
Sep 16 2015 15:03 UTC
This message was deleted
Robert Richey
@0x0936
Sep 16 2015 15:04 UTC
@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 UTC
like the above one
Robert Richey
@0x0936
Sep 16 2015 15:04 UTC
javascript
//code

tva10
@tva10
Sep 16 2015 15:05 UTC
huh @sinnersdoom , you can use alt+prnt screen, and ctl+v to add this screenshoot to message
sinnersdoom
@sinnersdoom
Sep 16 2015 15:05 UTC
Lasynsec
@Lasynsec
Sep 16 2015 15:05 UTC
@moigithub thanks
CamperBot
@camperbot
Sep 16 2015 15:05 UTC
lasynsec sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 349 | @moigithub | http://www.freecodecamp.com/moigithub
sinnersdoom
@sinnersdoom
Sep 16 2015 15:06 UTC
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 UTC
@0x0936 thx a lot. Now to digest that...
CamperBot
@camperbot
Sep 16 2015 15:07 UTC
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 UTC
@camperbot bonfire check for palindromes help
Robert Richey
@0x0936
Sep 16 2015 15:10 UTC
@sinnersdoom change lable to label and lower case 'indoor-outdoor'
sinnersdoom
@sinnersdoom
Sep 16 2015 15:11 UTC
@0x0936 thanks
CamperBot
@camperbot
Sep 16 2015 15:11 UTC
sinnersdoom sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 156 | @0x0936 | http://www.freecodecamp.com/0x0936
qbai22
@qbai22
Sep 16 2015 15:14 UTC

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 UTC
@qbai22 you're replacing '_' with '-' which should instead be an empty string
tva10
@tva10
Sep 16 2015 15:17 UTC
@qbai22 I think you should replace all symbols, which are not letter or number
qbai22
@qbai22
Sep 16 2015 15:17 UTC
ye, i was just cunfused
tva10
@tva10
Sep 16 2015 15:18 UTC
like this expression /[^0-9a-z]/g
Moisés Man
@moigithub
Sep 16 2015 15:18 UTC
help formatting
CamperBot
@camperbot
Sep 16 2015 15:18 UTC

## :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 ⏎]

then press [shift + enter ⏎]

 ⇦ Type 3 backticks, then press [enter ⏎]

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

qbai22
@qbai22
Sep 16 2015 15:19 UTC
@tva10 oh thaks a lot i didnt know how to manage it inside one .replace thing
CamperBot
@camperbot
Sep 16 2015 15:19 UTC
qbai22 sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 222 | @tva10 | http://www.freecodecamp.com/tva10
qbai22
@qbai22
Sep 16 2015 15:20 UTC
@0x0936 ye , tnx i was just confused
Alexander Schuneman
@AxSch
Sep 16 2015 15:21 UTC
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 UTC
@qbai22 replace(/[\W_]/g, "")
Robert Richey
@0x0936
Sep 16 2015 15:21 UTC
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 UTC
@0x0936 you dont even need the |
qbai22
@qbai22
Sep 16 2015 15:22 UTC
@kmccn-org tt, i dont get it.. where i can read about how it exactly works?
Kevin McCann
@kmccn-org
Sep 16 2015 15:22 UTC
qbai22
@qbai22
Sep 16 2015 15:23 UTC
thank you!
CamperBot
@camperbot
Sep 16 2015 15:23 UTC
if you want to thank someone, put an @ before their name!
qbai22
@qbai22
Sep 16 2015 15:23 UTC
@kmccn-org thank you
Kevin McCann
@kmccn-org
Sep 16 2015 15:23 UTC

\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 UTC
qbai22 sends brownie points to @kmccn-org :sparkles: :thumbsup: :sparkles:
tva10
@tva10
Sep 16 2015 15:23 UTC
@0x0936 I invented it, after when I use .toLowerCase() before
CamperBot
@camperbot
Sep 16 2015 15:23 UTC
:star: 186 | @kmccn-org | http://www.freecodecamp.com/kmccn-org
Robert Richey
@0x0936
Sep 16 2015 15:23 UTC
@kmccn-org you do when it's not in a character class
Terry
@terryrey
Sep 16 2015 15:24 UTC
@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 UTC
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 UTC
@0x0936 ah gotcha
missed that part
Alexander Schuneman
@AxSch
Sep 16 2015 15:25 UTC
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 UTC
@AxSch what troubles with that do you have?
Rory Smith
@alanbuchanan
Sep 16 2015 15:27 UTC
@AxSch myArray[2].pop() this line is wrong
Alexander Schuneman
@AxSch
Sep 16 2015 15:27 UTC
@tva10 Its not returning the correct removed element
@alanbuchanan should that just be myArray.pop()?
Rory Smith
@alanbuchanan
Sep 16 2015 15:28 UTC
@AxSch pop() only takes the last value of an array, so you shouldn't pass a number
tva10
@tva10
Sep 16 2015 15:28 UTC
.pop() takes last value and returns it
Jonny Morley
@morley92
Sep 16 2015 15:28 UTC
@AxSch take out line 3
Alexander Schuneman
@AxSch
Sep 16 2015 15:29 UTC
@alanbuchanan ok that was what I initially did
I did myArray.pop();
Kevin McCann
@kmccn-org
Sep 16 2015 15:29 UTC
@AxSch @morley92 is correct, remove line 3
tva10
@tva10
Sep 16 2015 15:30 UTC
huh, there is push shft unshif after that
@AxSch
Alexander Schuneman
@AxSch
Sep 16 2015 15:30 UTC
that returns [John,23]
Rory Smith
@alanbuchanan
Sep 16 2015 15:30 UTC
@AxSch you have to store it in a var
@AxSch like on the line below
Alexander Schuneman
@AxSch
Sep 16 2015 15:31 UTC
@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 UTC
@AxSch .push .shift .unshift
Kevin McCann
@kmccn-org
Sep 16 2015 15:32 UTC
@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 UTC
@AxSch now x is ['cat', 2] and removed is ['John', 23]
Alexander Schuneman
@AxSch
Sep 16 2015 15:34 UTC
@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 UTC
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 UTC
Your h2 element should degrade to the font Monospace when Lobster is not available.
Rory Smith
@alanbuchanan
Sep 16 2015 15:40 UTC
@botgan23 could you post your code?
tva10
@tva10
Sep 16 2015 15:41 UTC
:D
Bogdan
@botgan23
Sep 16 2015 15:41 UTC
@alanbuchanan nope, just found in network :)
Rory Smith
@alanbuchanan
Sep 16 2015 15:41 UTC
i see
Bogdan
@botgan23
Sep 16 2015 15:43 UTC
how i can i post my code?
just copy paste O_O?
tva10
@tva10
Sep 16 2015 15:45 UTC
help formatting
CamperBot
@camperbot
Sep 16 2015 15:45 UTC

## :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 ⏎]

then press [shift + enter ⏎]

 ⇦ Type 3 backticks, then press [enter ⏎]

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

Bogdan
@botgan23
Sep 16 2015 15:47 UTC
<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 UTC
@botgan23 use comma, to point that fonts you want to use
font-family: font1, font2, font3
N Hameleers
@NHameleers
Sep 16 2015 15:50 UTC
This message was deleted
right those were quotes, not backticks, sorry :)
Rory Smith
@alanbuchanan
Sep 16 2015 15:52 UTC
@NHameleers you can edit your post if you press the up key :)
(for future reference)
N Hameleers
@NHameleers
Sep 16 2015 15:53 UTC
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 UTC @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 UTC I'm afraid that didn't seem to change anything Rex Schrader @SaintPeter Sep 16 2015 15:58 UTC @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 UTC 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 UTC @NHameleers Are you getting an error in your dev console? @NHameleers and do you have a link to your codepen? N Hameleers @NHameleers Sep 16 2015 16:01 UTC Rustam Turaev @rustamturaev Sep 16 2015 16:03 UTC 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.

@SaintPeter
Sep 16 2015 16:05 UTC
@NHameleers ok, found the problem
Paweł
@ridlez
Sep 16 2015 16:05 UTC
@rustamturaev try this for example $(.'btn').addClass('animated'); Rex Schrader @SaintPeter Sep 16 2015 16:06 UTC @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 UTC
@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 UTC @0x0936 The problem is not with the AJAX request. Moisés Man @moigithub Sep 16 2015 16:08 UTC fail ITS another jquery method.. like done.. the error probably is cuz incorrect nesting/chaining N Hameleers @NHameleers Sep 16 2015 16:09 UTC sorry i just got a skype call, i will be right back Rustam Turaev @rustamturaev Sep 16 2015 16:09 UTC 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 UTC$.getJSON( ... )
.done(function(){...})
.fail(function(){...})
http://api.jquery.com/jquery.getjson/
Rustam Turaev
@rustamturaev
Sep 16 2015 16:10 UTC
All other parts are in green. I don't understand
tva10
@tva10
Sep 16 2015 16:10 UTC
@rustamturaev use all these classes
Rustam Turaev
@rustamturaev
Sep 16 2015 16:11 UTC
Thats what I did: $("#target1").addClass(animated shake btn-primary); Is this correct? Rex Schrader @SaintPeter Sep 16 2015 16:11 UTC @rustamturaev You need quotes around your class string:$("#target1").addClass("animated shake btn-primary");
tva10
@tva10
Sep 16 2015 16:11 UTC
@rustamturaev use quotes
@SaintPeter
Sep 16 2015 16:11 UTC
@rustamturaev Also, I don't think you need btn-primary
Rustam Turaev
@rustamturaev
Sep 16 2015 16:12 UTC
Thank you guys
CamperBot
@camperbot
Sep 16 2015 16:12 UTC
if you want to thank someone, put an @ before their name!
Rustam Turaev
@rustamturaev
Sep 16 2015 16:13 UTC
@tva10 @SaintPeter @camperbot Thank you guys!
CamperBot
@camperbot
Sep 16 2015 16:13 UTC
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 UTC
@SaintPeter your call to forimsatic doesn't work for me. No 'Access-Control-Allow-Origin' header is present on the requested resource.
@SaintPeter
Sep 16 2015 16:14 UTC
@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 UTC
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 UTC @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 UTC 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 UTC @0x0936 got a Codepen URL for me? Robert Richey @0x0936 Sep 16 2015 16:25 UTC 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 UTC @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 UTC @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 UTC 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 UTC @0x0936 No idea. It was someone else's code. Maybe I missed something? Robert Richey @0x0936 Sep 16 2015 16:34 UTC and that last part is dreadfully cryptic. most articles and documentation show it as ?callback=? Rex Schrader @SaintPeter Sep 16 2015 16:35 UTC @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 UTC 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 UTC @sjnorth background-attachment: fixed; Samantha North @sjnorth Sep 16 2015 16:37 UTC @0x0936 as simple as that - cool. thanks :) CamperBot @camperbot Sep 16 2015 16:37 UTC sjnorth sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 159 | @0x0936 | http://www.freecodecamp.com/0x0936 Paweł @ridlez Sep 16 2015 16:39 UTC 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 UTC @ridlez what is simpleweather.js? Nolan Chan @NolanChan Sep 16 2015 16:44 UTC 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 UTC @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 UTC nhameleers sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles: :star: 624 | @saintpeter | http://www.freecodecamp.com/saintpeter kaki940 @kaki940 Sep 16 2015 16:49 UTC 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 UTC @kaki940 because you should remove special symbols Omar @Stenzky Sep 16 2015 16:50 UTC 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 UTC @kaki940 i use regExp to find them... SojournerOctocat @SojournerOctocat Sep 16 2015 16:51 UTC @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 UTC @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 UTC @Stenzky works fine here. @Stenzky how are you specifying min and max in your code? Omar @Stenzky Sep 16 2015 16:53 UTC min = 0 max = 9 , thnx for replying CamperBot @camperbot Sep 16 2015 16:53 UTC if you want to thank someone, put an @ before their name! kaki940 @kaki940 Sep 16 2015 16:54 UTC @SaintPeter so when i check i "remove" the digits and punctuations??? Philip Warkentien II @warkentien2 Sep 16 2015 16:55 UTC @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 UTC 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 UTC @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 UTC @chenry53 precedence. !important > id > class > tag .. p is a simple tag Rex Schrader @SaintPeter Sep 16 2015 16:56 UTC @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 UTC @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 UTC @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 UTC 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 UTC @Stenzky no problem! chenry53 @chenry53 Sep 16 2015 16:59 UTC @warkentien2 thanks CamperBot @camperbot Sep 16 2015 16:59 UTC chenry53 sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles: :star: 289 | @warkentien2 | http://www.freecodecamp.com/warkentien2 kaki940 @kaki940 Sep 16 2015 16:59 UTC @SaintPeter I think i understand. kaki940 @kaki940 Sep 16 2015 17:05 UTC @SaintPeter done, thanks. CamperBot @camperbot Sep 16 2015 17:05 UTC 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 UTC 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 UTC @SaintPeter its an api Nathan Kipsang Tum @nathantum Sep 16 2015 17:10 UTC ooh. Cam @cam-barts Sep 16 2015 17:11 UTC 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 UTC type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom tva10 @tva10 Sep 16 2015 17:12 UTC @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 UTC @nathantum firstLetterOfLastName = lastName[0]; @nathantum Just dd 0 index fter lastName *add tva10 @tva10 Sep 16 2015 17:15 UTC @TheBisonGuy where([5, 3, 20, 3], 3) that does'n work, right? Cam @cam-barts Sep 16 2015 17:17 UTC @tva10 Correct @tva10 neither does [2, 5, 10], 15 tva10 @tva10 Sep 16 2015 17:19 UTC @TheBisonGuy uhm, I found problem take a sec or use console.log(arr) after sort Nathan Kipsang Tum @nathantum Sep 16 2015 17:20 UTC @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 UTC 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 UTC @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 UTC @tva10 Any idea how to fix that? tva10 @tva10 Sep 16 2015 17:22 UTC @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 UTC :bulb: to format code use backticks!  more info tva10 @tva10 Sep 16 2015 17:23 UTC should' my breaked English ( Cam @cam-barts Sep 16 2015 17:25 UTC @tva10 HEEEYYY THAT WORKED. Thank you very much! CamperBot @camperbot Sep 16 2015 17:25 UTC thebisonguy sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles: tva10 @tva10 Sep 16 2015 17:25 UTC @nathantum m/b/ str[4]+str[7]+str[9] or smth like that... CamperBot @camperbot Sep 16 2015 17:25 UTC :star: 226 | @tva10 | http://www.freecodecamp.com/tva10 tva10 @tva10 Sep 16 2015 17:25 UTC @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 UTC @tva10 , thanks. CamperBot @camperbot Sep 16 2015 17:26 UTC nathantum sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles: :warning: nathantum already gave tva10 points Samantha North @sjnorth Sep 16 2015 17:45 UTC 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 UTC @sjnorth use JS/jQuery if you want Samantha North @sjnorth Sep 16 2015 17:49 UTC @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 UTC @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 UTC 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 UTC @breckler class should be capitalized. .addClass() and .removeClass() Brett @breckler Sep 16 2015 17:56 UTC ah, that might do it, thanks! CamperBot @camperbot Sep 16 2015 17:56 UTC if you want to thank someone, put an @ before their name! Brett @breckler Sep 16 2015 17:58 UTC @0x0936 thanks for the quick response CamperBot @camperbot Sep 16 2015 17:58 UTC breckler sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 162 | @0x0936 | http://www.freecodecamp.com/0x0936 Tod @thermobee Sep 16 2015 17:58 UTC 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 UTC does anyone have any advice on tackling Show the Local Weather zipline Tod @thermobee Sep 16 2015 18:00 UTC Lol thats what Im working on use open weather api Nolan Chan @NolanChan Sep 16 2015 18:02 UTC 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 UTC
make sure you have semi colon after the last parenthesis
Robert Richey
@0x0936
Sep 16 2015 18:04 UTC
@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 UTC Thanks @0x0936 CamperBot @camperbot Sep 16 2015 18:05 UTC thermobee sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles: :star: 164 | @0x0936 | http://www.freecodecamp.com/0x0936 Tod @thermobee Sep 16 2015 18:05 UTC But I got it to work. Do you mind testing its accuracy for me? Robert Richey @0x0936 Sep 16 2015 18:08 UTC @thermobee not accurate. I'm not in Weston County Tod @thermobee Sep 16 2015 18:08 UTC 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 UTC @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 UTC so i add one different class to each element? Robert Richey @0x0936 Sep 16 2015 18:10 UTC @thermobee there is no Weston county in my state Nolan Chan @NolanChan Sep 16 2015 18:10 UTC aaaah thanks @aniruddhabarapatre CamperBot @camperbot Sep 16 2015 18:10 UTC nolanchan sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles: :star: 214 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre Tod @thermobee Sep 16 2015 18:10 UTC @0x0936 madness! Chahan Shah @Chahanshah Sep 16 2015 18:58 UTC Scghh Paweł @ridlez Sep 16 2015 19:28 UTC 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 UTC 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 UTC the backgroundColor animation is working but when i want it to change into image it breaks Rex Schrader @SaintPeter Sep 16 2015 19:36 UTC @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 UTC @SaintPeter Thank you. I'm going to have to ponder this. It feels.....strange. CamperBot @camperbot Sep 16 2015 19:38 UTC 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 UTC @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 UTC @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 UTC thehighpriestess sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles: :warning: thehighpriestess already gave saintpeter points Alistair @CullenSkinked Sep 16 2015 19:50 UTC 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 UTC @CullenSkinked did you add border-width: 10px; in your css? Rex Schrader @SaintPeter Sep 16 2015 19:56 UTC @CullenSkinked Can you share the code that you wrote? wiki format CamperBot @camperbot Sep 16 2015 19:56 UTC ## :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 jkirch @jkirch Sep 16 2015 19:58 UTC 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 UTC <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 UTC I'm in the same boat. Looks like a bug. Rex Schrader @SaintPeter Sep 16 2015 19:59 UTC @CullenSkinked Humm, that looks correct. Let me try it. Mateja Trifunovski @Matko95 Sep 16 2015 20:01 UTC @jkirch you need to use the variables max and min in your formula Rex Schrader @SaintPeter Sep 16 2015 20:01 UTC @CullenSkinked Ok, I did this instead: .thick-green-border { border: 10px solid green; } and it worked. jkirch @jkirch Sep 16 2015 20:01 UTC Aha, @Matko95 . Thank you. How do I give you points? CamperBot @camperbot Sep 16 2015 20:01 UTC 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 UTC @jkirch you just did :) jkirch @jkirch Sep 16 2015 20:02 UTC How'd I do that? Mateja Trifunovski @Matko95 Sep 16 2015 20:02 UTC you only need to thank someone CamperBot @camperbot Sep 16 2015 20:02 UTC if you want to thank someone, put an @ before their name! jkirch @jkirch Sep 16 2015 20:03 UTC Wonderful, thanks. Mateja Trifunovski @Matko95 Sep 16 2015 20:03 UTC @CullenSkinked your code works for me, what browser are you using? Alistair @CullenSkinked Sep 16 2015 20:04 UTC @Matko95 I'm on chrome, was just thinking about trying another browser. Pete McPherson @StartupDino Sep 16 2015 20:04 UTC Didn't work for me ;) On Firefox Alistair @CullenSkinked Sep 16 2015 20:05 UTC @SaintPeter Tried the new code, didn't work either. Rex Schrader @SaintPeter Sep 16 2015 20:05 UTC @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 UTC Yeah probably something silly, I'll have a play about with it. Thanks @SaintPeter @Matko95 CamperBot @camperbot Sep 16 2015 20:06 UTC 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 UTC Opened up Firefox and it worked fine. jkirch @jkirch Sep 16 2015 20:10 UTC @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 UTC Thanks @jkirch Will try those out. CamperBot @camperbot Sep 16 2015 20:11 UTC cullenskinked sends brownie points to @jkirch :sparkles: :thumbsup: :sparkles: :star: 153 | @jkirch | http://www.freecodecamp.com/jkirch jkirch @jkirch Sep 16 2015 20:11 UTC My pleasure MrZappy @MrZappy Sep 16 2015 20:15 UTC Sup nerds SaintPeter @SaintPeter pushes up his glasses Rex Schrader @SaintPeter Sep 16 2015 20:16 UTC nuthin' MrZappy @MrZappy Sep 16 2015 20:17 UTC Hey bud how you been? kgoode517 @kgoode517 Sep 16 2015 20:17 UTC 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 UTC @MrZappy Kicking butt, taking down names . . . slacking at work . . . MrZappy @MrZappy Sep 16 2015 20:18 UTC @SaintPeter Sounds like an amazing time lol. Mateja Trifunovski @Matko95 Sep 16 2015 20:19 UTC @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 UTC @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 UTC @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 UTC 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 UTC @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 UTC 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 UTC @SaintPeter that is beautiful I see what you are saying. azazel913 @azazel913 Sep 16 2015 20:33 UTC <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 UTC 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 UTC
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 UTC
@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=