These are chat archives for FreeCodeCamp/Help

22nd
Aug 2015
DTing
@dting
Aug 22 2015 00:01
@johnmellis shoot
John Ellis
@johnmellis
Aug 22 2015 00:02
Okay
here’s my object array
[
        {"engineer":"Zach Violett","product":"HOOPS Exchange","issues_opened":1},
        {"engineer":"Zach Violett","product":"HOOPS Visualize","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"HOOPS Exchange","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"HOOPS Visualize","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"RealDWG","issues_opened":1},
        {"engineer":"William Gallego","product":"3D PDF Converter","issues_opened":66},
        {"engineer":"William Gallego","product":"3D PDF Reader","issues_opened":3},
        {"engineer":"William Gallego","product":"A3D Plugin","issues_opened":114},
        {"engineer":"William Gallego","product":"A3D Reviewer","issues_opened":189},
        {"engineer":"William Gallego","product":"Adobe 3D OEM","issues_opened":30}
      ]
I have to reformat it to look like this
[{ name: ‘zach violett’, data: [1,1]},{ name: ‘yanick fluhman’, data: [1,1]}]
so, I need to loop through the array
and create an object for each engineer
DTing
@dting
Aug 22 2015 00:04
@johnmellis where does data come from?
John Ellis
@johnmellis
Aug 22 2015 00:04
mysql
I need the data array
to represent each unique product (0 if products not found) where the index = product, and the value = issues_opened
so data for zack
would show [1, 1] because there were 1 issue opened for each product
I’m thinking that I need to first create a simple array of the products
so that I have a set order for the data array
DTing
@dting
Aug 22 2015 00:10
@johnmellis im still not clear what you want in your data array.
rolanjose7
@rolanjose7
Aug 22 2015 00:29
guys what is wrong with my code?```

```function largestOfFour(arr){
var largest = 0;
var biggestArray = [];
for(i = 0; i<arr.length;i++){
for(h=0; h<arr[i].length;h++){
if(largest < arr[i][h]){
largest = arr[i][h];
}
biggestArray[i] = largest;
}
}
return biggestArray;
}

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

function largestOfFour(arr){
  var largest = 0;
  var biggestArray = [];
  for(i = 0; i<arr.length;i++){
  for(h=0; h<arr[i].length;h++){
  if(largest < arr[i][h]){
      largest = arr[i][h];
    }
  biggestArray[i] = largest;
    }
  }
  return biggestArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
DTing
@dting
Aug 22 2015 00:29
@rolanjose7 move your largest declaration into the outer for loop.
rolanjose7
@rolanjose7
Aug 22 2015 00:30
@dting just that?
DTing
@dting
Aug 22 2015 00:31
@rolanjose7
biggestArray[i] = largest; that should be outside your inner for loop (after it)
you basically are trying to look at each element in the nested array find the biggest then set it as biggestArray[i] you dont need to set biggestArray[i] each inner iteration
rolanjose7
@rolanjose7
Aug 22 2015 00:33
@dting oooh i see...
@dting thanks!
CamperBot
@camperbot
Aug 22 2015 00:34
rolanjose7 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 544 | @dting | http://www.freecodecamp.com/dting
rolanjose7
@rolanjose7
Aug 22 2015 00:46
@dting hey do i have to move it outside of both of the for loops or just outside h?
DTing
@dting
Aug 22 2015 00:46
@rolanjose7 outside h
@rolanjose7 you probably want to use var for iand h also
rolanjose7
@rolanjose7
Aug 22 2015 00:48
@dting how so?
DTing
@dting
Aug 22 2015 00:49
function largestOfFour(arr){
  var biggestArray = [];
  for(var i = 0; i<arr.length;i++){
    var largest = 0;
    for(var h=0; h<arr[i].length;h++){
      if(largest < arr[i][h]){
        largest = arr[i][h];
      }
    }
    biggestArray[i] = largest;
  }
  return biggestArray;
}
rolanjose7
@rolanjose7
Aug 22 2015 00:49
@dting thanks man!
CamperBot
@camperbot
Aug 22 2015 00:49
rolanjose7 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: rolanjose7 already gave dting points
Phillip Paik
@phillippaik
Aug 22 2015 01:11
Hi everyone! I've been working on this for around an hour now, I still can't get it! It seems so easy but I guess I'm missing something, can someone help?

function palindrome(str) {
var str1 = str.toLowerCase();
var strNoSp = str1.replace(/\s/g, "");
var strNoSp2 = strNoSp.replace(/./g,"");
var strNoSp3 = strNoSp2.replace(",","");
var splitStr = strNoSp3.split("").reverse().join("");

if(splitStr === strNoSp3){
return true;
} else {
return false;
}

}

palindrome("eye");
palindrome("race car");
palindrome("A man, a plan, a canal. Panama");
palindrome("never odd or even");
palindrome("not a palindrome");

DTing
@dting
Aug 22 2015 01:13
@phillippaik strNoSp.replace(/./g) replaces more than you think it does
Phillip Paik
@phillippaik
Aug 22 2015 01:14
ahhh so I need to search for dots a different way
DTing
@dting
Aug 22 2015 01:14
@phillippaik do use regex there you would need to escape that dot
John Ellis
@johnmellis
Aug 22 2015 01:14
@dting the data array should be a preordered list of the “issues_opened” value
DTing
@dting
Aug 22 2015 01:15
@johnmellis where is that list?
John Ellis
@johnmellis
Aug 22 2015 01:15
it’s dynamically generated - that’s the challenge
DTing
@dting
Aug 22 2015 01:15
from what?
John Ellis
@johnmellis
Aug 22 2015 01:15
It’s an array of hte unique values that show up in each object for “product"
The length of the data array should be equivalent to the # of products shown across the original array
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 01:22
@phillippaik if you go to www.regexr.com you can play around and see the results of different regexp in real time. It helped me a lot.
Phillip Paik
@phillippaik
Aug 22 2015 01:24
ahhh thank you!
CamperBot
@camperbot
Aug 22 2015 01:24
if you want to thank someone, put an @ before their name!
Phillip Paik
@phillippaik
Aug 22 2015 01:25
Thank you @ChadKreutzer
CamperBot
@camperbot
Aug 22 2015 01:25
phillippaik sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 294 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
brycemcdonald86
@brycemcdonald86
Aug 22 2015 01:29
function truncate(str, num) {
  var str1;

  if (str.length + 3 > num) {
    str1 = str.slice(0, num-3);
    str = str1 += "...";
  }


  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
why is this not completely working?
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 01:30
bf truncate
CamperBot
@camperbot
Aug 22 2015 01:30

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

DTing
@dting
Aug 22 2015 01:30
@johnmellis
var arr = [
        {"engineer":"Zach Violett","product":"HOOPS Exchange","issues_opened":1},
        {"engineer":"Zach Violett","product":"HOOPS Visualize","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"HOOPS Exchange","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"HOOPS Visualize","issues_opened":1},
        {"engineer":"Yanick Fluhmann","product":"RealDWG","issues_opened":1},
        {"engineer":"William Gallego","product":"3D PDF Converter","issues_opened":66},
        {"engineer":"William Gallego","product":"3D PDF Reader","issues_opened":3},
        {"engineer":"William Gallego","product":"A3D Plugin","issues_opened":114},
        {"engineer":"William Gallego","product":"A3D Reviewer","issues_opened":189},
        {"engineer":"William Gallego","product":"Adobe 3D OEM","issues_opened":30}
      ];
var obj = {};
arr.forEach(function(el) {
  if (!obj.hasOwnProperty(el.engineer)) {
    obj[el.engineer] = {name: el.engineer, data: [el.issues_opened]};
  } else {
    obj[el.engineer].data.push(el.issues_opened);
  }
});
var newArr = Object.keys(obj).map(function(key) {return obj[key];});
JSON.stringify(newArr, null, 2);
"[
  {
    "name": "Zach Violett",
    "data": [
      1,
      1
    ]
  },
  {
    "name": "Yanick Fluhmann",
    "data": [
      1,
      1,
      1
    ]
  },
  {
    "name": "William Gallego",
    "data": [
      66,
      3,
      114,
      189,
      30
    ]
  }
]"
@brycemcdonald86 you probably want to change that conditional. what happens if the string is 10 characters long and you want to truncate at 11?
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 01:36
Or what happens when the string is 11 characters long and you don't want to truncate at all?
Darrell Wong
@darrell1226
Aug 22 2015 01:37
I can't seem to pass the second test on Waypoint: Bring your JavaScript Slot Machine to Life. I thought I did as asked and now I can't figure out what exactly is wrong.
// Only change code below this line.
    $($('.slot')[0]).html(slotOne);
    $($('.slot')[1]).html(slotTwo);
    $($('.slot')[2]).html(slotThree);
    // Only change code above this line.
Can anyone compare my answer to theirs and tell me what the problem is?
brycemcdonald86
@brycemcdonald86
Aug 22 2015 01:38
@ChadKreutzer thanks
CamperBot
@camperbot
Aug 22 2015 01:38
brycemcdonald86 sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 296 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Phillip Paik
@phillippaik
Aug 22 2015 01:41
Looks exactly the same as mine @darrell1226
//
$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);
Darrell Wong
@darrell1226
Aug 22 2015 01:42
I submitted a bug report but I still can't pass the test.
DTing
@dting
Aug 22 2015 01:42
@darrell1226 they are using regex to check change the single to double quotes
Darrell Wong
@darrell1226
Aug 22 2015 01:43
@dting course. Thanks.
CamperBot
@camperbot
Aug 22 2015 01:43
darrell1226 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 546 | @dting | http://www.freecodecamp.com/dting
Jordan Shackelford
@JordanShackelford
Aug 22 2015 02:15
"Let's try selecting all the occurrences of the word and in the string George Boole and Alan Turing went to the shop and got some milk. We can do this by replacing the .+ part of our regular expression with the current regular expression with the word and."
Damon Anderson
@CoderNurse
Aug 22 2015 02:16
bf chunky
CamperBot
@camperbot
Aug 22 2015 02:16

:fire:Bonfire: Chunky Monkey :link:

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

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

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

more info:  bf details | bf links | hint

DTing
@dting
Aug 22 2015 02:17
@JordanShackelford it just wants you to replace .+ with and on line 6
Jordan Shackelford
@JordanShackelford
Aug 22 2015 02:18
I did that and one of the tests is still failing
var test = (function() {
  var testString = "George Boole and Alan Turing went to the shop and got some milk";
  var expressionToGetMilk = /milk/gi;
  // Only change code below this line.

  var expression = /and/gi;

  // Only change code above this line.
  // We use this function to show you the value of your variable in your output box.
  return(testString.match(expression).length);
})();(function(){return(test);})();
CamperBot
@camperbot
Aug 22 2015 02:18
:bulb: to format code use backticks! ``` more info
Robert
@rc242
Aug 22 2015 02:19
@JordanShackelford and != And or any variations of it.
DTing
@dting
Aug 22 2015 02:19
@JordanShackelford for some reason it wants a + after the and
Robert
@rc242
Aug 22 2015 02:19
@JordanShackelford when you do i, you're adding case insensitive.
DTing
@dting
Aug 22 2015 02:19
@JordanShackelford i think its a bug
so /and+/
Jordan Shackelford
@JordanShackelford
Aug 22 2015 02:19
k it works. thanks @dting
CamperBot
@camperbot
Aug 22 2015 02:19
jordanshackelford sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 548 | @dting | http://www.freecodecamp.com/dting
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:22
So I've noticed that after completing the RegEx section, I don't really have a solid foundation on RegEx enough to do the string selection bonfires (validation of phone numbers, etc). Is there a better resource to really learn how to use RegEx WITH JavaScript? (as opposed to just learning RegEx without things like global replacements, etc)
Robert
@rc242
Aug 22 2015 02:24
@sonnytron I'm not sure if I follow your question. You're trying to understand regex or just the Regexp api?
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:26
So, in some of the bonfires, you have to validate a US phone number, which is very heavy in RegEx, but to work through that problem, I didn't really use a lot of what I learned in the section on RegEx
John Nieves
@karn09
Aug 22 2015 02:28
Did you do the regular expression bonfires in the new map, or the one that linked to an outside website?
DTing
@dting
Aug 22 2015 02:28
@sonnytron that problem is kinda hard in general. i think my expression is like 200+ characters but is probably a bit more robust than required.
I think previously FCC sent me over to that site, which I found helpful
M Used
@mildused
Aug 22 2015 02:29
https://regex101.com/ for quick testing...
Robert
@rc242
Aug 22 2015 02:29
@sonnytron Part of the point of Bonfires is to reinforce what you learned (or should have) from the Waypoints. If you're still struggling with regex, I would go through the Waypoints again (or the new ones). Sometimes, it takes time to soak in the information.
@sonnytron if you're struggling on the phone number, I would advise breaking it down. you don't need to have one complete regex.
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:31
@karn09 I used the previous ones which FCC sent to an external site. I found that it was good for introductory but I felt like it didn't prepare me anywhere near enough for actual bonfires that required expressions
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:31
@rc242 @sonnytron I had/have the same problem. I'm used to regex, but not used to using it with JS, and the explanatory texts weren't that helpful in figuring that out.
Andrew Gregory
@angregor
Aug 22 2015 02:32
Hey all!
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:32
How did you get past it @SojournerOctocat ? Any advice on reinforcement?
Robert
@rc242
Aug 22 2015 02:32
@sonnytron and by "breaking it down", I mean make several regexps that make sense to test a portion of the number and then go from there.
Andrew Gregory
@angregor
Aug 22 2015 02:32
Just wondering if someone is willing to go look at a heroku site of mine to help me make sure its online, my computer is displaying properly but i’d like for someone else to check since I had a lot of issues deploying. https://lightweight-lol-stats.herokuapp.com/
Robert
@rc242
Aug 22 2015 02:32
@sonnytron @SojournerOctocat If you're having a problem with the API, then ask a question about it.
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:33
@sonnytron I'm not past it -- not by a long shot -- but I did learn how to structure a basic replace statement.
Jeryl Barnum
@JBreezy11
Aug 22 2015 02:33
JavaScript 20. WayPoint: Mainpulate arrays with pop(); is there a bug in it? seems to me the logical answer is myArray.pop();
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:34
@rc242 @sonnytron The question is how to learn how to use regex with JS. Any other tutorials, resources that walk you through that?
Joe Toh Djojo
@joseph-tohdjojo
Aug 22 2015 02:34
@angregor works. love it
John Nieves
@karn09
Aug 22 2015 02:34
@sonnytron I think it just takes practice. I'm still working on understanding regex as it's not very intuitive.
Robert
@rc242
Aug 22 2015 02:34
@SojournerOctocat I read the MDN documentation on that API at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
Joe Toh Djojo
@joseph-tohdjojo
Aug 22 2015 02:34
@angregor when can i play?
Andrew Gregory
@angregor
Aug 22 2015 02:35
@mrhamburger Thanks!!! Haha maybe in a couple years :P
CamperBot
@camperbot
Aug 22 2015 02:35
angregor sends brownie points to @mrhamburger :sparkles: :thumbsup: :sparkles:
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:35
@rc242 I read that too and it wasn't very helpful...
CamperBot
@camperbot
Aug 22 2015 02:35
:star: 226 | @mrhamburger | http://www.freecodecamp.com/mrhamburger
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:35
Yeah I feel like the RegEx "guides" are written in like a "Hey there's a thing called RegEx, here's the basics, good luck okay let's move on to JavaScript"
Andrew Gregory
@angregor
Aug 22 2015 02:35
This message was deleted
CamperBot
@camperbot
Aug 22 2015 02:35

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:35
@rc242 The MDN documentation is very confusing to me most of the time.
@sonnytron Ditto!!!!
Andrew Gregory
@angregor
Aug 22 2015 02:35
Well back to developing. Thanks again @mrhamburger !
CamperBot
@camperbot
Aug 22 2015 02:35
angregor sends brownie points to @mrhamburger :sparkles: :thumbsup: :sparkles:
:warning: angregor already gave mrhamburger points
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:36
@sonnytron And the JavaScript documentation I've found isn't much better!
Robert
@rc242
Aug 22 2015 02:36
@SojournerOctocat If you can't follow the API on the MDN page, I would suggest asking a question here, or review other sites' documentation.
Joe Toh Djojo
@joseph-tohdjojo
Aug 22 2015 02:36
@angregor no problem. god speed
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:36
I've found the JavaScript tutorials to be miles better...
Robert
@rc242
Aug 22 2015 02:36
@SojournerOctocat Some people like http://www.w3schools.com/.
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:36
@rc242 @SojournerOctocat That's what we're doing lol... And you refer us back to the documentation. Don't be an infinite loop please lol
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:37
@sonnytron Any tutorials you recommend?
@rc242 w3schools isn't horrible. They are pretty basic, though. There must be something somewhere in the middle!
Robert
@rc242
Aug 22 2015 02:38
@sonnytron Then ask a question about the problem you're having.
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:38
Well for JavaScript, whenever I got stuck, I was at least 10~15% on the way to the solution which was enough to ask here about my code and then get the solution complete. This isn't the case with RegEx @SojournerOctocat
Robert
@rc242
Aug 22 2015 02:39
@SojournerOctocat If you're having a problem understanding the API, you need something basic... unless you're saying that w3schools isn't describing the API well enough.
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:41
@rc242 I'm saying the MDN and w3schools isn't describing how to use regex with JS well enough.
DTing
@dting
Aug 22 2015 02:41
@sonnytron I'm kind of glad they are like that. I don't think there are many "regex experts" in the real world. Most people just look up what they need. Its a useful tool to know exists and knowing the basics and when to use it is important. but mastery of regex is probably not a real good use of time.
James Funk
@jfunk46360
Aug 22 2015 02:41
Struggling with Waypoint 19 for Bootstrap. Was able to create the h3 element, but could not complete the instructions "Color your h3 element with the text-primary Bootstrap class, and center it with the text-center Bootstrap class."
Robert
@rc242
Aug 22 2015 02:41
@sonnytron I supposse Regex isn't completely understood if people aren't able to help you. Maybe ask when there's more people that seem to be active? If you're having an issue, I may be able to help.
@sonnytron I think I already gave you one hint on the phone number - break down the regexps.
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:43
When you add multiple classes to an element, make sure they're in the same quotation mark
@jfunk46360 my last message was for you
Robert
@rc242
Aug 22 2015 02:44
@jfunk46360 If you can paste your code here, we can probably help. Otherwise, we're just guessing at the problem.
Matt Everson
@matteverson
Aug 22 2015 02:44
I use regexes on a daily basis, but that's unusual. I use them for picking apart large blocks of text, and one of my interview questions was to do a version of phone number verification. I think here the waypoint is mostly to convince you that regexes are usually more trouble than they're worth :p
James Funk
@jfunk46360
Aug 22 2015 02:45

Don't laugh - complete beginner here. Here is the code. <div class= "text-primary text-center"">

<h3>
jQuery Playground
</h3>
</div>

Matt Everson
@matteverson
Aug 22 2015 02:45
The preferred method is to use a token parser. It'll be easier to maintain.
Robert
@rc242
Aug 22 2015 02:46
explain format
CamperBot
@camperbot
Aug 22 2015 02:46

: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

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

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

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

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

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

calisham
@calisham
Aug 22 2015 02:46
@jfunk46360 you need to add the classes to the h3 element, not the div
it says ""Color your h3 element" so I'm guessing that's where the issue is
HayleeNeal
@HayleeNeal
Aug 22 2015 02:47
So I'm doing a bit of a side project and I was wondering if someone could take a look at it and help me?
Sonny Rodriguez
@sonnytron
Aug 22 2015 02:47
@jfunk46360
<h3 class="text-primary text-center"> stuff in h3</h3>
calisham
@calisham
Aug 22 2015 02:47
@HayleeNeal sure
HayleeNeal
@HayleeNeal
Aug 22 2015 02:47
@calisham http://codepen.io/HayleeNeal/pen/doEXjg how do I fix the white spots behind the buttons?
calisham
@calisham
Aug 22 2015 02:48
what color do you want it to be?
HayleeNeal
@HayleeNeal
Aug 22 2015 02:48
black
Robert
@rc242
Aug 22 2015 02:49
@SojournerOctocat I guess I don't understand your chief complaint. I don't use w3schools enough, but I haven't had a problem to understand the String or Regexp API and their use with regular expressions.
@HayleeNeal what browser do you use?
HayleeNeal
@HayleeNeal
Aug 22 2015 02:51
Chrome
calisham
@calisham
Aug 22 2015 02:51
create a new nav div around your buttons and then use .nav {
background-color: black;
}
Robert
@rc242
Aug 22 2015 02:51
@HayleeNeal 1) You can use background-color. 2) You can inspect each element using Chrome by right clicking the element and going to inspect element.
@HayleeNeal Furthermore, you can modify that element by using the element.style{} block.
HayleeNeal
@HayleeNeal
Aug 22 2015 02:52
I tried the background color option. I'll try element.style{}
calisham
@calisham
Aug 22 2015 02:52
@HayleeNeal sorry, that msg was for you: create a new nav div around your buttons and then use .nav {
background-color: black;
}
make sense?
you can really name the div anything you want
HayleeNeal
@HayleeNeal
Aug 22 2015 02:53
That makes sense :)
calisham
@calisham
Aug 22 2015 02:53
great!
Robert
@rc242
Aug 22 2015 02:53
@HayleeNeal element.style isn't going to work. It's only for your chrome browser that adds it directly to the element with a stylc block.
This message was deleted
oops
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:54
@rc242 Reading the MDN on replace, I didn't understand enough to even know how to create the statement. Someone had to explain that how to structure a statement (for example, str.replace(/\s+/g, '')); it wasn't obvious from the documentation. Even now, I have no idea how to use a function in a replace statement. And I've poured through the replace documentation countless times.
Robert
@rc242
Aug 22 2015 02:54
This message was deleted
SojournerOctocat
@SojournerOctocat
Aug 22 2015 02:54
It's as if the thing wasn't written in English. Even though it's written in English.
Robert
@rc242
Aug 22 2015 02:54
this time i'll get it. i swear.
HayleeNeal
@HayleeNeal
Aug 22 2015 02:55
I used the .nav and it worked perfect
Thanks so much you guys, I'd been scratching my head on that one for a while and was just drawing a blank.
CamperBot
@camperbot
Aug 22 2015 02:55
if you want to thank someone, put an @ before their name!
calisham
@calisham
Aug 22 2015 02:55
no problem
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 02:55
@SojournerOctocat That's why I look at w3schools too. I usually find the way they explain things to be a bit clearer, even if it isn't quite as detailed.
Robert
@rc242
Aug 22 2015 02:56
#aboutbtn1 {
  font-size: 16px;
}

#portfoliobtn1 {
  font-size: 16px;
}

#gitbtn1 {
  font-size: 16px;
}

can be made to

#aboutbtn1, #portfoliobtn1, #gitbtn1 {
   font-size: 16px;
  background-color: black;
}

or better yet, you can make a class instead.

calisham
@calisham
Aug 22 2015 02:57
yeah, making a class for btn would probably be a lot simpler
HayleeNeal
@HayleeNeal
Aug 22 2015 02:57
I have those is separate classes for some reason, but I tried the background-color in each class and that turned the actual button black
Robert
@rc242
Aug 22 2015 02:58
@HayleeNeal oh, put it in the div, not the button.
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:00
@ChadKreutzer But they don't explain this.
Robert
@rc242
Aug 22 2015 03:01
@SojournerOctocat, this is on the MDN page
function styleHyphenFormat(propertyName) {
  function upperToHyphenLower(match) {
    return '-' + match.toLowerCase();
  }
  return propertyName.replace(/[A-Z]/g, upperToHyphenLower);
}
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:05
@rc242 The replacement function accepts the matched snippet as its parameter, and uses it to transform the case and concatenate the hyphen before returning. What is the matched snippet?
I'm reading it. And it's obvious that it makes sense to the writer, but I have tremendous difficulty understanding what they've written.
Robert
@rc242
Aug 22 2015 03:06
@SojournerOctocat It's some A-Z character.
Damon Anderson
@CoderNurse
Aug 22 2015 03:07
bf chunky
CamperBot
@camperbot
Aug 22 2015 03:07

:fire:Bonfire: Chunky Monkey :link:

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

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

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

more info:  bf details | bf links | hint

Damon Anderson
@CoderNurse
Aug 22 2015 03:08
hint
CamperBot
@camperbot
Aug 22 2015 03:08
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:10
@rc242 Okay, so you're saying that the match in upperToHyphenLower(match) is the regex contained in the replace statement?
DTing
@dting
Aug 22 2015 03:11
@SojournerOctocat match is whatever is found by the regex
basically if you use a function as the second argument to your string.replace function it will call that function with whatever matched the first argument of the replace function.
Robert
@rc242
Aug 22 2015 03:11
@SojournerOctocat I'm not just saying that. The documentation says it in the description of each parameter.
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:12
@rc242 The documentation says a lot of things I don't understand.
Robert
@rc242
Aug 22 2015 03:12
@SojournerOctocat There's a table describing each parameter for the function parameter.
DTing
@dting
Aug 22 2015 03:14
'12hello34'.replace(/[a-z]+/, function(match) { return match.split('').reverse('').join('');}); would give you 12olleh34 because the match would be "hello"
Robert
@rc242
Aug 22 2015 03:14
@SojournerOctocat From the documentation "The matched substring. (Corresponds to $& above.)"
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:15
@rc242 And what do they mean by specifying a string as a parameter?
DTing
@dting
Aug 22 2015 03:15
This message was deleted
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:16
@dting Well, they talk about using $$ and $& and others.
What I don't get is how.
Robert
@rc242
Aug 22 2015 03:17
@SojournerOctocat ... You can either specify a string or a function as the second parameter to the Replace function.
@SojournerOctocat The table is just "special" strings.
DTing
@dting
Aug 22 2015 03:18
@SojournerOctocat something like this:
"hello".replace(/[eo]/g, "$&" + "-");
will give you:
"he-llo-"
or:
"hello".replace(/.+/, "$&$&");
"hellohello"
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:24
Thanks! @rc242 & @dting ! That really helps demystify replace!
CamperBot
@camperbot
Aug 22 2015 03:24
sojourneroctocat sends brownie points to @rc242 and @dting :sparkles: :thumbsup: :sparkles:
:star: 151 | @rc242 | http://www.freecodecamp.com/rc242
:star: 552 | @dting | http://www.freecodecamp.com/dting
Luis Felipe López G.
@luishendrix92
Aug 22 2015 03:28
@SojournerOctocat You can also enumerate capture groups with () and use them later on as $1 $2 etc
SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:30
Can you give an example of that, @luishendrix92 ?
DTing
@dting
Aug 22 2015 03:37
@SojournerOctocat
"abcabc".replace(/(a)(b)(c)/g, "$2$3$1 ")
"bca bca"
calisham
@calisham
Aug 22 2015 03:38
Hi, I'm on Bring your Javascript Slot Machine to Life and struggling a bit
    $($(".slot") [0]).html(slotOne);
       $($(".slot") 
    [1]).html(slotTwo);
       $($(".slot") 
      [2]).html(slotThree);
DTing
@dting
Aug 22 2015 03:38
@calisham they use regex to check. make each slot 1 row
calisham
@calisham
Aug 22 2015 03:39
ohhh thanks @dting
CamperBot
@camperbot
Aug 22 2015 03:39
calisham sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 553 | @dting | http://www.freecodecamp.com/dting
Luis Felipe López G.
@luishendrix92
Aug 22 2015 03:40
This message was deleted
@SojournerOctocat "luishendrix92@gmail.com".replace(/[\w\-\.]+@([\w\-\.]+)/, "Some dumb mail hosted with " + "$1")
Will output: "Some dumb mail hosted with gmail.com"
Damon Anderson
@CoderNurse
Aug 22 2015 03:46
help
CamperBot
@camperbot
Aug 22 2015 03:46

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

SojournerOctocat
@SojournerOctocat
Aug 22 2015 03:47
Thanks @luishendrix92 & @dting ! I knew these were possible, but seeing examples really helps.
CamperBot
@camperbot
Aug 22 2015 03:47
:warning: sojourneroctocat already gave dting points
:star: 135 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
sojourneroctocat sends brownie points to @luishendrix92 and @dting :sparkles: :thumbsup: :sparkles:
Damon Anderson
@CoderNurse
Aug 22 2015 03:47
find pair
Damon Anderson
@CoderNurse
Aug 22 2015 03:48
who do we report bugs to?
Luis Felipe López G.
@luishendrix92
Aug 22 2015 03:49
Damon Anderson
@CoderNurse
Aug 22 2015 03:52
thanks @luishendrix92
CamperBot
@camperbot
Aug 22 2015 03:52
codernurse sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 136 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Pranav Doshi
@pranavdoshi
Aug 22 2015 03:54
@deaninous hey u der u wer asking something
Dayne Wright
@daynewright
Aug 22 2015 03:57
Anyone want to help me with some bootstrap formatting? Have a few questions.
Damon Anderson
@CoderNurse
Aug 22 2015 03:57
So how/where do I get started with pair programming? There used to be instructions on the FCC website, but no longer.
Or rather, is anyone interested in pair programming?
Damon Anderson
@CoderNurse
Aug 22 2015 03:59
@kirah1314 where are you able to find these FCC rooms?
Bill
@kirah1314
Aug 22 2015 04:00
on the top, there's a globe/earth icon
Damon Anderson
@CoderNurse
Aug 22 2015 04:00
Thanks @kirah1314
CamperBot
@camperbot
Aug 22 2015 04:00
codernurse sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 165 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Aug 22 2015 04:00
@CoderNurse :thumbsup:
calisham
@calisham
Aug 22 2015 04:14
@CoderNurse I'm up for pairprogramming
deaninous
@deaninous
Aug 22 2015 04:28
@calisham what are you working on
calisham
@calisham
Aug 22 2015 04:28
Bonfire challenges
CamperBot
@camperbot
Aug 22 2015 04:28
Sorry, can't find a bonfire called challenges. [ Check the map? ]
Derek Frankel
@TuvyaYis
Aug 22 2015 04:30

hello, if ```function factorialize(num) {
if (num === 0) {
return 1 ;
} else {
return num * factorialize(num-1);
}

}

factorialize(2);
```

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

}

factorialize(2);
the (num-1);
does that not represent (2 * 1) - 1 ???
However the answer is 2
And i should write (1 * 2) - 1
ohhhhh... i get it, okay, apologize for the interuption
deaninous
@deaninous
Aug 22 2015 04:34
n(n-1)? @TuvyaYis
Robert
@rc242
Aug 22 2015 04:34
@TuvyaYis hookay.
Zaynaib (Ola) Giwa
@zaynaib
Aug 22 2015 04:35
Can any one help me with waypoint Make Object Properties Private?
Derek Frankel
@TuvyaYis
Aug 22 2015 04:36
im going through numbers, i believe im on to it... however it seems merely coincidence that every val = (num) given can follow the laws of factorials.
Zaynaib (Ola) Giwa
@zaynaib
Aug 22 2015 04:36
//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.
  var speed = 100;
  function addUnit(value) {
    return(value + "KM/H");
  }

  function getSpeed () {
    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()));})();};
Derek Frankel
@TuvyaYis
Aug 22 2015 04:41
@deaninous can i ask you a question please pm?
@rc242 can i ask you a question in pm please?
Robert
@rc242
Aug 22 2015 04:47
@TuvyaYis sure.
Madmoneymike
@Madmoneymike
Aug 22 2015 04:47
Can someone help me with the Waypoint: Size your Images in the html/css section?
Robert
@rc242
Aug 22 2015 04:47
@TuvyaYis or you can ask here.
Madmoneymike
@Madmoneymike
Aug 22 2015 04:48
Your img element should have the class smaller-image.
Derek Frankel
@TuvyaYis
Aug 22 2015 04:48
ok, regarding the above factorial function...
Robert
@rc242
Aug 22 2015 04:48
@Madmoneymike other than telling you to add it to your class attribute in your img element, you'll need to post the code you currently have.
@TuvyaYis What's the question?
Madmoneymike
@Madmoneymike
Aug 22 2015 04:50
Thanks @rc242 how do I post code?
CamperBot
@camperbot
Aug 22 2015 04:50
madmoneymike sends brownie points to @rc242 :sparkles: :thumbsup: :sparkles:
:star: 152 | @rc242 | http://www.freecodecamp.com/rc242
Derek Frankel
@TuvyaYis
Aug 22 2015 04:50
i don't understand how it constitutes to the following: Multiply every number in a numeric fashion equal to and less than the supplied (num)
@rc242
Robert
@rc242
Aug 22 2015 04:50
explain format
CamperBot
@camperbot
Aug 22 2015 04:50

: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

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

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

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

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

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

Derek Frankel
@TuvyaYis
Aug 22 2015 04:51
factorials
function factorialize(num) {
  if (num === 0) {
    return 1 ;
  } else {
    return num * factorialize(num-1);
  }

}

factorialize(5);
Robert
@rc242
Aug 22 2015 04:51
@TuvyaYis you have a recursive function.
Zaynaib (Ola) Giwa
@zaynaib
Aug 22 2015 04:51
@Madmoneymike Here is an example inline style http://www.w3schools.com/tags/tag_img.asp
Madmoneymike
@Madmoneymike
Aug 22 2015 04:52
wow thanks! @zaynaib
CamperBot
@camperbot
Aug 22 2015 04:52
madmoneymike sends brownie points to @zaynaib :sparkles: :thumbsup: :sparkles:
:star: 282 | @zaynaib | http://www.freecodecamp.com/zaynaib
Derek Frankel
@TuvyaYis
Aug 22 2015 04:52
yes, i found both recursive and non-recursive
Robert
@rc242
Aug 22 2015 04:52
@TuvyaYis So, in your code, you have something like factorial(nfactiorial(n-1) ... factorial(1))
bleh
Derek Frankel
@TuvyaYis
Aug 22 2015 04:52
@rc242 yes
Robert
@rc242
Aug 22 2015 04:53
factorialize(n*factorialize(n-1)* ... factorialize(1))
Derek Frankel
@TuvyaYis
Aug 22 2015 04:53
@rc242 is "factorial" a defined key within the language of JavaScript,,, without using any human defining in to the function?
calisham
@calisham
Aug 22 2015 04:53
Bonfire Palindromes
CamperBot
@camperbot
Aug 22 2015 04:53

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Robert
@rc242
Aug 22 2015 04:54
@TuvyaYis No, I meant factorialize.
Derek Frankel
@TuvyaYis
Aug 22 2015 04:54
@rc242 oh... does JavaScript understand what to do with factorialize without the user even creating or defining its function?
Zaynaib (Ola) Giwa
@zaynaib
Aug 22 2015 04:54
@calisham what do you need help on
@calisham getting started?
Robert
@rc242
Aug 22 2015 04:55
@TuvyaYis No.
Derek Frankel
@TuvyaYis
Aug 22 2015 04:55
@rc242 ok
Robert
@rc242
Aug 22 2015 04:55
@TuvyaYis You're defining the factorialize function. You call it within the factorialize function, too. This makes it recursive.
@TuvyaYis Not sure what you're confused about.
Derek Frankel
@TuvyaYis
Aug 22 2015 04:56
@rc242 Then where in the code if given the value of (5)... does Js know to multiply each number in a numeric fashion if < 6 ???
@rc242 Did that question make sense?
Robert
@rc242
Aug 22 2015 04:59

@TuvyaYis factorialize(5) "looks" like this

factorialize(5*(factorialize(4*factorialize(3*factorialize(2*factorialize(1*factorialize(0))))

It stops at 0 because your (num === 0) returns 1 and there's no more function calls to factorialize.

@TuvyaYis It decreases by 1 because you invoke the factorialize function with num - 1.
Derek Frankel
@TuvyaYis
Aug 22 2015 05:01
@rc242 oh... okay that makes more sense i was multiplying the value upward from 1 ---> 5. However the code is stating: multiply from the largest given (num - 1)
@rc242 in downward fashion rather than the opposite
chicachicamji
@chicachicamji
Aug 22 2015 05:03
does anyone know how you would create a multidimensional array in a function?
Derek Frankel
@TuvyaYis
Aug 22 2015 05:03
@rc242 TY
Robert
@rc242
Aug 22 2015 05:05
@TuvyaYis Actually, it multiplies from factorialize(0), which is 1 to 5. So, it does this 1 1 2 3 4 * 5.
calisham
@calisham
Aug 22 2015 05:07
@zaynaib I posted that by mistake, but thanks for reaching out! I'm going to try to work through this on my own a little more first
CamperBot
@camperbot
Aug 22 2015 05:07
calisham sends brownie points to @zaynaib :sparkles: :thumbsup: :sparkles:
:star: 283 | @zaynaib | http://www.freecodecamp.com/zaynaib
Derek Frankel
@TuvyaYis
Aug 22 2015 05:08
@rc242 ok, you know i think im just trying to make this more complicated than it is
DTing
@dting
Aug 22 2015 05:08
@TuvyaYis
this problem doesnt require recursion if you dont want to use it.
Robert
@rc242
Aug 22 2015 05:10
@dting @TuvyaYis I would assert that using recursion on this wouldn't be the best solution.
Derek Frankel
@TuvyaYis
Aug 22 2015 05:10
@dting should i google what Recursion is versus Non-Recursion and Iteration? Recursion simply looked the most simple to understand. However I am not familiar with the concepts yet
@rc242 oh... right, i deeply thought the recursion was more complicated than the Bonfire called for. However i didn't understand another approach.
@rc242 what do you feel is best, most direct, short and simple?
@rc242 i'm sure you can use a while loop?
Robert
@rc242
Aug 22 2015 05:13
@TuvyaYis just a for loop is fine.
@TuvyaYis sure, a while loops is fine.
DTing
@dting
Aug 22 2015 05:13
the other approach is pretty straight forward. variable starting at 1 multiplied by all values between 1 and n
for loop works or while loop.
Derek Frankel
@TuvyaYis
Aug 22 2015 05:14
right, that's what the Bonfire expected... lemme try and write it out
Robert
@rc242
Aug 22 2015 05:15
@TuvyaYis To see the problem, try using some large number for your input to factorialize.
@TuvyaYis It should give you a problem about the stack, which is a problem using recursion in most languages.
DTing
@dting
Aug 22 2015 05:18
@rc242 i'm pretty sure thats not a problem with javascript. you'd get overflow of the number before stack overflow
Robert
@rc242
Aug 22 2015 05:19
@dting that wasn't my point.
My point is stack issues with recursion. You'll never know if you're going to hit the integer overflow or not until you have a stack issue.
Derek Frankel
@TuvyaYis
Aug 22 2015 05:22
@rc242 @dting can i see what a for loop would look like in this case for multiplication?
DTing
@dting
Aug 22 2015 05:23
@TuvyaYis
function factorialize(n) {
  if (n < 0) return undefined;
  if (n === 0) return 1;
  var fact = n;
  while (--n) {
    fact*=n;
  }
  return fact;
}
heres my while loop
var fact = 1;
for (var i = 2; i <= n; i++) {
  fact*=i;
}
Derek Frankel
@TuvyaYis
Aug 22 2015 05:26
Bonfire gives us: ```
CamperBot
@camperbot
Aug 22 2015 05:26
Sorry, can't find a bonfire called gives us . [ Check the map? ]
Derek Frankel
@TuvyaYis
Aug 22 2015 05:27

@dting Bonfire gives us ```
function factorialize(num) {
return num;
}

factorialize(5);

function factorialize(num) {
  return num;
}

factorialize(5);
DTing
@dting
Aug 22 2015 05:29
function factorialize(num) {
  var f = num;
  while (--f) {
    num *= f;
  }
  return num;
}

factorialize(5);
Robert
@rc242
Aug 22 2015 05:32
@TuvyaYis Right. In there you can just use a for-loop that increments from 2 to n, like @dting suggests.
Derek Frankel
@TuvyaYis
Aug 22 2015 05:32
@dting FCC doesn't like line 4
DTing
@dting
Aug 22 2015 05:33
bf factor
CamperBot
@camperbot
Aug 22 2015 05:33

: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

DTing
@dting
Aug 22 2015 05:34
@TuvyaYis i just checked all 3 methods and they seem to pass?
Derek Frankel
@TuvyaYis
Aug 22 2015 05:34
@dting i stand corrected
@dting there are strict laws for the use of a space or not in the while loop example
DTing
@dting
Aug 22 2015 05:37
@TuvyaYis shouldn't be
function factorialize(num) {
  var f = num;
  while (--f) num *= f;
  return num;
}
should also work
Chase Thomas
@ChaseMThomas
Aug 22 2015 05:37
OMG I just solved that. Took me 6 hours too.
DTing
@dting
Aug 22 2015 05:38
@ChaseMThomas heh nice!
calisham
@calisham
Aug 22 2015 05:39
can someone help me figure out what I'm missing ?
function palindrome(str) {
  // Good luck!
  str1 = str.toLowerCase()
  str1 = str.replace(/[.,'-\/#!$%\^&*;:{}=-_`~()]/g,"");
  str1 = str.split('').reverse().join('');

  if (str1 = str)
  {
  return true;
}
else
{
  return false;
}
}

palindrome("eye");
DTing
@dting
Aug 22 2015 05:39
@calisham you are assigning str1 in your conditional
@calisham also hmm
Chase Thomas
@ChaseMThomas
Aug 22 2015 05:39

Looks like I did it the hard way...

`function factorialize(num) {

var total = 0;
var count = num;

while (count > 1) {

    total = num * (count - 1);
    num = total;
    count -=1;

}

return total;
}

factorialize(5);`

DTing
@dting
Aug 22 2015 05:40
@calisham so read through your code again. you keep assigning str1 to stuff. after line 3 your str1 is something. then what would it become in line 4
calisham
@calisham
Aug 22 2015 05:40
how do i compare the original to the new one if i don't use a new name?
DTing
@dting
Aug 22 2015 05:41
@calisham so you make str1 = to str.lowercase(); in line 3;
calisham
@calisham
Aug 22 2015 05:41
ohhhh thanks @dting
CamperBot
@camperbot
Aug 22 2015 05:41
calisham sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 559 | @dting | http://www.freecodecamp.com/dting
Robert
@rc242
Aug 22 2015 05:42
@calisham if you're trying to get all alphanumeric characters, you can just do [A-Z1-9]/g
Tony Blanco
@tblancog
Aug 22 2015 05:42

@calisham I had to do this.. `function palindrome(str) {
// Good luck!
str= str.toLowerCase();
str= str.replace(/[,. ]+/ig, '');
var myArray=[];
console.log(str);
for(var i=0; i<str.length; i++){
myArray.push(str[i]);
}
console.log(myArray.reverse().join(''));
if(myArray.reverse().join('') === str){
return true;
}else{
return false;
}

}

palindrome("eye");

Sorry
Robert
@rc242
Aug 22 2015 05:42
@calisham er, [^A-Z1-9]/ig
DTing
@dting
Aug 22 2015 05:42
@calisham or /\W/g
Robert
@rc242
Aug 22 2015 05:42
\W picks up _, and he's trying to replace that.
Tony Blanco
@tblancog
Aug 22 2015 05:43

`function palindrome(str) {
// Good luck!
str= str.toLowerCase();
str= str.replace(/[,. ]+/ig, '');
var myArray=[];
console.log(str);
for(var i=0; i<str.length; i++){
myArray.push(str[i]);
}
console.log(myArray.reverse().join(''));
if(myArray.reverse().join('') === str){
return true;
}else{
return false;
}

}

palindrome("eye");`

DTing
@dting
Aug 22 2015 05:43
bf palindrome
CamperBot
@camperbot
Aug 22 2015 05:43

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Robert
@rc242
Aug 22 2015 05:43
er, doesn't.
explain format
CamperBot
@camperbot
Aug 22 2015 05:44

: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

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

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

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

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

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

DTing
@dting
Aug 22 2015 05:44
@rc242 its not tested but ya. /\W|_/g
Derek Frankel
@TuvyaYis
Aug 22 2015 05:47
@rc242 @dting how does the for loop look? I must be writing it out incorrectly
DTing
@dting
Aug 22 2015 05:47
@TuvyaYis
function factorialize(n) {
  var fact = 1;
  for (var i = 2; i <= n; i++) {
    fact*=i;
  }
  return fact;
}
that incorrectly returns 1 for numbers less than 0 tho. but that isnt checked so it passes the test
Robert
@rc242
Aug 22 2015 05:48
@TuvyaYis you may want to review for loops.
@dting yeah, using \W|_ will also work. At least on face value, it works.
Robert
@rc242
Aug 22 2015 05:55
off to bed. peace.
DTing
@dting
Aug 22 2015 05:56
cyas
Derek Frankel
@TuvyaYis
Aug 22 2015 05:59
@rc242 @dting thx... im going through loops again right now and some googling
CamperBot
@camperbot
Aug 22 2015 05:59
tuvyayis sends brownie points to @rc242 and @dting :sparkles: :thumbsup: :sparkles:
:star: 153 | @rc242 | http://www.freecodecamp.com/rc242
:star: 560 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 22 2015 05:59
@TuvyaYis nice. gluck!
HayleeNeal
@HayleeNeal
Aug 22 2015 05:59
<!--CONTACT FORM STARTS HERE -->
<div id="form-main">

<!-- SUMBIT FORM ENDs HERE -->
How many of you comment your code like this to separate between elements. My code partner says it's useless, I disagree.
Also, I deleted a lot of code between those comments, because it was crazy long and didn't want to post it all here
DTing
@dting
Aug 22 2015 06:05
@HayleeNeal it depends but i rarely comment html. the class names usually are self documenting. adding comments like that tend to stretch out code blocks and reduce what can been seen at one time. i've seen people inline comment the close tags. but i usually dont do that either.
Amardeep
@Amardeep91
Aug 22 2015 06:05
hii
HayleeNeal
@HayleeNeal
Aug 22 2015 06:07
I like to collapse each div as I'm done with the section. so commenting it helps me go back real fast. I only comment for major things like at the start and end of a whole form or something very intensive-ish. Idk maybe I just like to organise things too much
Amardeep
@Amardeep91
Aug 22 2015 06:10
hey
DTing
@dting
Aug 22 2015 06:10
@HayleeNeal using search usually helps me with that. ctrl+f contact-form But honestly personal preference on personal projects. Working in groups i think you'll find more often than not a few objections to that.
@HayleeNeal doesn't bother me unless its out of hand. but i've worked with some people that cant stand extra lines like that haha
May Pagatpatan
@myflryuna
Aug 22 2015 06:37
function truncate(str, num) {
  var strLength = str.length;

  if (strLength > num) {
    return str.slice(0, num) + "...";
  }

}

truncate('A-tisket a-tasket A green and yellow basket', 11);
can anyone tell me what is wrong with this code?
Nnxoxo
@Nnxoxo
Aug 22 2015 06:42
@myflryuna u forgot to add -3. return str.slice(0, num - 3) + "...";
minhanderson
@minhanderson
Aug 22 2015 06:56
I think your code is returning the first 11 characters & '...', which means the last word is broken off halfway, i.e 'A-tisket a-ta...'
Brian Daub
@briandaub
Aug 22 2015 07:31
Hey guys. I am wondering if someone can help me with the Where Art Thou bonfire. I am really struggling with it.
CamperBot
@camperbot
Aug 22 2015 07:31
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
George Tsoukatos
@Gts0uk
Aug 22 2015 07:32
my awesomeweather app http://codepen.io/gtsouk1/pen/zGypeo
any suggestions to make it better ?
Chocobowings
@chocobowings
Aug 22 2015 07:34
@codeJunkie01 What do you need help with ?
Brian Daub
@briandaub
Aug 22 2015 07:35
A very clear explination on how to solve it.
function where(collection, source) {
  var arr = [];
  // What's in a name?
  /*var propertyValue = source[Object.keys(source)];
  for(var i = 0; i < collection.length; i++){
    console.log(Object.keys(source));
    if(collection[i].hasOwnProperty(Object.keys(source))){ 

    }
  }*/
  for(var prop in collection){
     if(collection.hasOwnProperty(prop)){
        arr.push(collection[i]);
     }
  }
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
I have tried a lot of things. I cannot get the VALUE of the PROPERTY in collection (i.e. if the property is 'last' check if the value === 'Capulet'
I have had a few people give me very vague help but I have been stuck on this for a week and I am tired of working on it. Clearly I don't get it.
Chocobowings
@chocobowings
Aug 22 2015 07:38
@codeJunkie01 I sent you a PM
Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 22 2015 07:47
too embarrassed to ask my question- it is so basic I am too new
Chase Thomas
@ChaseMThomas
Aug 22 2015 07:51
first stupid question... when I paste my code into this chatroom, how do I make it all look like code?
function palindrome(str) {

  if (str.toLowerCase == str.toLowerCase().split("").reverse().join("")){

    return true;

  } else { 

    return false;

  }
}


palindrome("eye");
never mind, got it :)
George Tsoukatos
@Gts0uk
Aug 22 2015 07:52
http://codepen.io/gtsouk1/pen/zGypeo any suggestions to make it better ?
Chase Thomas
@ChaseMThomas
Aug 22 2015 07:52
Okay, can someone please give me a hint as to what's wrong with my code for the palindromes challenge?
The error i'm getting is "expected false to deeply equal true"
function palindrome(str) {

  if (str.toLowerCase == str.toLowerCase().split("").reverse().join("")){

    return true;

  } else { 

    return false;

  }
}


palindrome("eye");
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:00
Anyone out there? Some help would REALLY be appreciated.
Andrew Gregory
@angregor
Aug 22 2015 08:01
Hey, let me take a look at it
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:01
@angregor talking to me? :)
Andrew Gregory
@angregor
Aug 22 2015 08:01
@ChaseMThomas Yes sir
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:02
@angregor wonderful thanks.
CamperBot
@camperbot
Aug 22 2015 08:02
chasemthomas sends brownie points to @angregor :sparkles: :thumbsup: :sparkles:
:star: 190 | @angregor | http://www.freecodecamp.com/angregor
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:04
@angregor how do we do this? pair program or do you just want to look at the code. It's above.
Andrew Gregory
@angregor
Aug 22 2015 08:05
@ChaseMThomas I just took a look at it and tried debugging it, there’s two things wrong.
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:05
ok
Andrew Gregory
@angregor
Aug 22 2015 08:06
First off, you forgot the parentheses in the first str.toLowerCase() in this line:```
if (str.toLowerCase == str.toLowerCase().split("").reverse().join("")){
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:07
@angregor Ahhhhh yes. I see.
Andrew Gregory
@angregor
Aug 22 2015 08:08
The second issue has to due with your algorithm, while it does work for single words, it does not work for phrases (anything with a space) or any punctuation that may not be repeated.
assert.deepEqual(palindrome("race car"), true);
assert.deepEqual(palindrome("not a palindrome"), false);
assert.deepEqual(palindrome("A man, a plan, a canal. Panama"), true);
these three tests in particular
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:10
@angregor Okay. Hmmmm....
Andrew Gregory
@angregor
Aug 22 2015 08:10
for example you’re algorithm would state that “race car” !== “rac ecar” which you want to avoid
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:12
okay.
Guess I need to investigate the string.replace() method more closely.
I'm finding the regex's to be pretty confusing
tjstinso
@tjstinso
Aug 22 2015 08:14
@ChaseMThomas try out Regexr.com to figure out regex. It’s a really helpful tool
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:14
@tjstinso Thanks! will do.
CamperBot
@camperbot
Aug 22 2015 08:14
chasemthomas sends brownie points to @tjstinso :sparkles: :thumbsup: :sparkles:
:star: 170 | @tjstinso | http://www.freecodecamp.com/tjstinso
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:15
@angregor Thanks for the debugging.
Guess I'm following the rabbit down the regex hole!
see you next week! hahaha
Andrew Gregory
@angregor
Aug 22 2015 08:17
Good luck!
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:17
Thanks!
CamperBot
@camperbot
Aug 22 2015 08:17
if you want to thank someone, put an @ before their name!
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:17
@angregor Thanks!
CamperBot
@camperbot
Aug 22 2015 08:17
chasemthomas sends brownie points to @angregor :sparkles: :thumbsup: :sparkles:
:warning: chasemthomas already gave angregor points
Chocobowings
@chocobowings
Aug 22 2015 08:17
@ChaseMThomas Also try this https://regex101.com/
Andrew Gregory
@angregor
Aug 22 2015 08:17
I’m off the for the night, good luck to everyone seeking help!
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:17
@chocobowings Thanks!
CamperBot
@camperbot
Aug 22 2015 08:17
chasemthomas sends brownie points to @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 263 | @chocobowings | http://www.freecodecamp.com/chocobowings
Chocobowings
@chocobowings
Aug 22 2015 08:18
It will let you test in real time and give you a clear explanation
similar to doing bonfires but with regex
Chase Thomas
@ChaseMThomas
Aug 22 2015 08:18
Cool cool
lauratalaat
@lauratalaat
Aug 22 2015 08:25

Hi. Can anyone help me?
I have to do this: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.

And the code is:

function reverseString(str) {
  return str;
}

reverseString('hello');

What should i change?

Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 22 2015 08:27
thrilled that I was able to find the answer to my question by going to stack overflow....
Chocobowings
@chocobowings
Aug 22 2015 08:30
@lauratalaat you can use a for loop and iterate backwards
lauratalaat
@lauratalaat
Aug 22 2015 08:34

@chocobowings
i write like this;

function reverseString(str) {
  var str2;
  for(var i=0;i<str.length;i++){
    str2[i]=str[str.length-i-1];
  }
  return str2;
}

reverseString('hello');

and it is not correct

Mistereo
@Mistereo
Aug 22 2015 08:36
@lauratalaat try to initialize your str2 with empty string "", and instead of assigning to i index use +=:)
lauratalaat
@lauratalaat
Aug 22 2015 08:36
"Cannot set property 0 of undifined"
@Mistereo += for what?
Mistereo
@Mistereo
Aug 22 2015 08:37
@lauratalaat str2[i]=str[str.length-i-1]; -> str2 += str[str.length-i-1];
Chocobowings
@chocobowings
Aug 22 2015 08:37
var str2 = "";
  for(i= str.length-1 ; i>=0;i--){
    str2+=str[i];
  }
  return str2;
lauratalaat
@lauratalaat
Aug 22 2015 08:39
@chocobowings @Mistereo what does += do in this situation?
Chocobowings
@chocobowings
Aug 22 2015 08:39
@lauratalaat Adds characters
Mistereo
@Mistereo
Aug 22 2015 08:40
@lauratalaat a += b is the same as a = a + b
lauratalaat
@lauratalaat
Aug 22 2015 08:40
@Mistereo yes i know this
but i don't understand
why
str2i=str[str.length-i-1]
it is not correct
:(
Mistereo
@Mistereo
Aug 22 2015 08:40
@lauratalaat because you can't mutate strings in javascript.
lauratalaat
@lauratalaat
Aug 22 2015 08:40
*str2[i]=str[str.length-i-1];
aaaaa
okay i know C++ in CodeBlocks and there you can and i thought in js is ok too
Mistereo
@Mistereo
Aug 22 2015 08:42
@lauratalaat yes, in C++ strings are actually an array of chars (or vector of chars in case of std::string) :)
lauratalaat
@lauratalaat
Aug 22 2015 08:44
@Mistereo yes :)
@Mistereo @chocobowings thanks
CamperBot
@camperbot
Aug 22 2015 08:44
lauratalaat sends brownie points to @mistereo and @chocobowings :sparkles: :thumbsup: :sparkles:
:star: 265 | @chocobowings | http://www.freecodecamp.com/chocobowings
:star: 263 | @mistereo | http://www.freecodecamp.com/mistereo
George Tsoukatos
@Gts0uk
Aug 22 2015 08:51
ok I need to find weather are all the weather discriptions
I searched the openweather site and couldn't find them
if you guys can help thanks
CamperBot
@camperbot
Aug 22 2015 08:51
sorry gts0uk, you can't send brownie points to yourself! :sparkles: :sparkles:
Michael Swartz
@mlswartz
Aug 22 2015 08:51
Has anyone done "jQuery #6 - waypoint: Target the same element with multiple jQuery Selectors"? The instructions seem to be a bit confusing.
Nnxoxo
@Nnxoxo
Aug 22 2015 08:51
bf palindrome
CamperBot
@camperbot
Aug 22 2015 08:51

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

lauratalaat
@lauratalaat
Aug 22 2015 08:55
bf details
CamperBot
@camperbot
Aug 22 2015 08:55

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");
Return true if the given string is a palindrome. Otherwise, return false.
A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.
You'll need to remove punctuation and turn everything lower case in order to check for palindromes.
We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
George Tsoukatos
@Gts0uk
Aug 22 2015 09:04
ok I need to find weather are all the weather discriptions
I searched the openweather site and couldn't find them
if you guys can help thanks
CamperBot
@camperbot
Aug 22 2015 09:04
if you want to thank someone, put an @ before their name!
Michael Swartz
@mlswartz
Aug 22 2015 09:05
Has anyone done "jQuery #6 - waypoint: Target the same element with multiple jQuery Selectors"? The instructions seem to be a bit confusing.
George Tsoukatos
@Gts0uk
Aug 22 2015 09:06
ok I need to find weather are all the weather discriptions
I searched the openweather site and couldn't find them
if you guys can help thanks
CamperBot
@camperbot
Aug 22 2015 09:06
if you want to thank someone, put an @ before their name!
Matthew Barber
@Honno
Aug 22 2015 09:09
Why do I get XMLHttpRequest cannot load https://api.twitch.tv/kraken/streams/freecodecamp. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. with $.getJSON("https://api.twitch.tv/kraken/streams/freecodecamp", callback)
DTing
@dting
Aug 22 2015 09:30
@Honno you need to use jsonp
Matthew Barber
@Honno
Aug 22 2015 09:35
@dting yeah haha, I suck at api stuff heh
Tina McCausey
@Tinabe1970
Aug 22 2015 09:38
Does anyone know if 1 Waypoint: Comment your JavaScript Code is not working?
DTing
@dting
Aug 22 2015 09:39
@Tinabe1970 are you using edge safari or ie?
Tina McCausey
@Tinabe1970
Aug 22 2015 09:39
Google
Mistereo
@Mistereo
Aug 22 2015 09:39
@Tinabe1970 it's works for me :)
Tina McCausey
@Tinabe1970
Aug 22 2015 09:39
Sorry Chrome
DTing
@dting
Aug 22 2015 09:39
works for me also
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 09:41
so I finally got the symmetric bonfire, but I'm now looking to see if there is a better solution:
Array.prototype.removeDuplicates = function () {
        return this.filter(function (elem, index, testArray) {
            return !(elem === testArray[index - 1]);
        });
    };
    Array.prototype.arrayDiff = function (arr2) {
        return this.filter(function (elem) {
            return (arr2.indexOf(elem) < 0);
        });
    };
    Array.prototype.symmetricOfTwo = function (arr2) {
        return this.arrayDiff(arr2).concat(arr2.arrayDiff(this));
    };

    function sym(args) {
        return Array.prototype.slice.call(arguments)
            .reduce(function (curr, next) {
                return curr.symmetricOfTwo(next);
        }).removeDuplicates();
    }
DTing
@dting
Aug 22 2015 09:45
function sym(args) {
  var index = -1;
  var length = arguments.length;
  var result;
  while (++index < length) {
    var array = arguments[index];
    result = result ? diff(result, array).concat(diff(array, result)) : array;
  }
  return result ? uniq(result) : [];
}
function uniq(arr) {
  var h = Object.create(null);
  var u = [];
  arr.forEach(function(v) {
    if (v in h) return;
    h[v] = true;
    u.push(v);
  });
  return u;
}
function diff(a, b) {
  var h = Object.create(null);
  b.forEach(function(v) {
    h[v] = true;  
  });
  return a.filter(function(v) { return !(v in h);});
}
sym([1, 2, 3], [5, 2, 1, 4]);
@ChadKreutzer
hmm thats pretty messy i should re write that one.
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 09:47
@dting it looks like yours works very similarly to mine, just with loops.
DTing
@dting
Aug 22 2015 09:48
ya an not using indexOf
trade space for speed i guess.
smjava
@smjava
Aug 22 2015 09:49
I need a bit of help.Im on this part :Then, inside your <style> element, set the font-size of all p elements to 16 pixels. so is this correct? { font-size: 16px; } , only thing is where do i put this in the code?
DTing
@dting
Aug 22 2015 09:50
@smjava put it in your script tag and use a selector before the { ... }
@smjava sorry style tag
@smjava the contents look correct
@luxan14 copy paste $($(".slot")[0]).html(slotOne); in 3 times
Luxan Suthaharan
@luxan14
Aug 22 2015 09:51
@dting i did tht! bt it is nt working!
DTing
@dting
Aug 22 2015 09:51
what's your code look like?
Luxan Suthaharan
@luxan14
Aug 22 2015 09:52
<script>
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

    slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;

    $(".logger").html("");
    $(".logger").html("Not A Win")

    // Only change code below this line.

    $($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);



    // Only change code above this line.

    if(slotOne !== slotTwo || slotTwo !== slotThree){
      return(null);
    }

    if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
      $(".logger").html(slotOne);
      $(".logger").append(" " + slotTwo);
      $(".logger").append(" " + slotThree);
    }

    return([slotOne, slotTwo, slotThree]);
  }

  $(document).ready(function(){
     $(".go").click(function(){
       runSlots();
     });
   });
</script>
DTing
@dting
Aug 22 2015 09:52
@luxan14 you need to change the numbers after the ".slot")
smjava
@smjava
Aug 22 2015 09:52

<style><
.red-text {
color: red;
}
</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, .</p>

thats what i have
Luxan Suthaharan
@luxan14
Aug 22 2015 09:53
@dting It worked! thanks :smile:
CamperBot
@camperbot
Aug 22 2015 09:53
luxan14 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 564 | @dting | http://www.freecodecamp.com/dting
smjava
@smjava
Aug 22 2015 09:53
Give your p elements the font-size of 16px. have an X on that last step
DTing
@dting
Aug 22 2015 09:53
@smjava so you need to make the paragraph elements font-size: 16px;
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 09:53
<style>< 
  .red-text {
    color: red;
  }
</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, .</p>
smjava
@smjava
Aug 22 2015 09:53
yes
@luxan14 nps
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 09:54
@smjava see how the red-text class inside your style tag colors all the things red?
smjava
@smjava
Aug 22 2015 09:55
yep
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 09:55
@smjava how would you do that same thing but apply it to the p elements?
smjava
@smjava
Aug 22 2015 10:03
use p {font-size: 16px;} before the .red-text ?
DTing
@dting
Aug 22 2015 10:05
@smjava or after
smjava
@smjava
Aug 22 2015 10:08
ok I got it,ty
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 10:08
@smjava sorry, tabbed away. yup, you got it.
And now I sleep. And tomorrow I can start focusing on the portfolio zipline since I finally got the symmetric bonfire.
DTing
@dting
Aug 22 2015 10:12
@ChadKreutzer haha nice. ya that one was a doozie. gluck with the ziplines
Chad Kreutzer
@ChadKreutzer
Aug 22 2015 10:13
@dting thanks.
CamperBot
@camperbot
Aug 22 2015 10:13
chadkreutzer sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 565 | @dting | http://www.freecodecamp.com/dting
Jordan Shackelford
@JordanShackelford
Aug 22 2015 11:02
Nnxoxo
@Nnxoxo
Aug 22 2015 11:07
This message was deleted
Clearwood
@Clearwood
Aug 22 2015 11:11
hi how can i use the .pop() command?
Todd Johnson
@TJohnson93
Aug 22 2015 11:12
@Clearwood array.pop()
DTing
@dting
Aug 22 2015 11:12
@JordanShackelford dont type in the code, paste it in
@JordanShackelford $($) will put your browser into a loop. unfortunately autocomplete closes that outer $()
Clearwood
@Clearwood
Aug 22 2015 11:14
var myArray = ["John", 23, ["cat", 2]];
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
myArray.pop(); I did this but It didn't work
Todd Johnson
@TJohnson93
Aug 22 2015 11:14
@Clearwood That Waypoint wants you to assign it to a variable named removed
DTing
@dting
Aug 22 2015 11:14
@Clearwood pop will remove the value at the end and return it
Todd Johnson
@TJohnson93
Aug 22 2015 11:15
like so
var removed = myArray.pop();
DTing
@dting
Aug 22 2015 11:15
^
Clearwood
@Clearwood
Aug 22 2015 11:15
oh i see thx
CamperBot
@camperbot
Aug 22 2015 11:15
if you want to thank someone, put an @ before their name!
Clearwood
@Clearwood
Aug 22 2015 11:15
@TJohnson93 thx
CamperBot
@camperbot
Aug 22 2015 11:15
clearwood sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 251 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Clearwood
@Clearwood
Aug 22 2015 11:16
@dting thx
Todd Johnson
@TJohnson93
Aug 22 2015 11:16
@Clearwood anytime
DTing
@dting
Aug 22 2015 11:16
nps
George Tsoukatos
@Gts0uk
Aug 22 2015 11:18
any comment on my weather app ?
http://codepen.io/gtsouk1/pen/zGypeo
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 22 2015 11:36
hi campers, please what's wrong with my code (Bonfire: Seek and Destroy) .. it always return the same array without changes !!!!

function destroyer(arr) {
// Remove all the values
var filtred = arr;
for(var i = 1; i < arguments.length; i++){
filtred = filtred.filter(function(value){
return value !== argumentsi;
});
}
return filtred;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

Vitalii Danylov
@vitaliidanylov
Aug 22 2015 11:39
Who wants pair Bonfire: Exact Change?
Nnxoxo
@Nnxoxo
Aug 22 2015 11:49
@Abdelaziz18003 u don't need a for loop and u forgot about the second argument
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 22 2015 11:50

'''function destroyer(arr) {
// Remove all the values
var filtred = arr;
for(var i = 1; i < arguments.length; i++){
filtred = filtred.filter(function(value){
return value !== argumentsi;
});
}
return filtred;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);'''

CamperBot
@camperbot
Aug 22 2015 11:50
:bulb: to format code use backticks! ``` more info
Mounika Reddy
@mounikagv
Aug 22 2015 11:51
<p>Here's a <a href="http://www.w3schools.com/"> link to w3schools.com</a> for you to follow</p>
<p><a href="http://catphotoapp.com">cat photos</a></p>
i'm trying to create external link,bt itz nt wrkng..y??
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 22 2015 11:52
@Nnutthowze but how to iterate throw all arguments without a for loop ?
Nnxoxo
@Nnxoxo
Aug 22 2015 11:52
@Abdelaziz18003 u have a filter function
Todd Johnson
@TJohnson93
Aug 22 2015 11:54
This message was deleted
Jordan Shackelford
@JordanShackelford
Aug 22 2015 11:55
I've tried this waypoint in 3 different browsers and they all crash http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life
Todd Johnson
@TJohnson93
Aug 22 2015 11:55
@mounikagv remove last / off w3schools and add www. to catphotoapp.com
@JordanShackelford What code are you adding to it?
Mounika Reddy
@mounikagv
Aug 22 2015 11:56
i hve tried dat too..bt itz nt wrkng @TJohnson93
Jordan Shackelford
@JordanShackelford
Aug 22 2015 11:56
I type $($(
then it crashes
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 22 2015 11:56
@Nnutthowze normally the filter function will iterate through array elements, I used the for loop to iterate through the arguments object.
Jordan Shackelford
@JordanShackelford
Aug 22 2015 11:57
I can't reset the code because it always crashes before I can click the button
Todd Johnson
@TJohnson93
Aug 22 2015 11:58
@mounikagv seemed to work in my testing. Is this is FCC try refreshing the page and copy and pasting that code in
@JordanShackelford Try deleting cookies and temp files in browser as I believe the new update saves your code progress in browser temporary files.
Mounika Reddy
@mounikagv
Aug 22 2015 12:01
k i vll try.. @TJohnson93
Todd Johnson
@TJohnson93
Aug 22 2015 12:01
Sorry about the delay in my posts my internet is currently running at a pathetic 1.2Mbps Down. With a crappy max of 8Mbps… Stupid Australian internet… I had faster internet in central Australia
Jordan Shackelford
@JordanShackelford
Aug 22 2015 12:04
deleting cookies and cached files doesn't seem to help
Todd Johnson
@TJohnson93
Aug 22 2015 12:06

@JordanShackelford That’s odd…

$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);

Didn’t crash mine (thankfully)… this is your code as well?

Jordan Shackelford
@JordanShackelford
Aug 22 2015 12:06
I could only get as far as typing $($(
Todd Johnson
@TJohnson93
Aug 22 2015 12:06
My PATHETIC connection Speed Test
@JordanShackelford type code in text editor and copy and paste entire code in
Jordan Shackelford
@JordanShackelford
Aug 22 2015 12:09
I'm trying to disable javascript on the page so I can have a chance to change the text
Rich Stiehm
@Moondogg71
Aug 22 2015 12:12
anyone have any luck on....
Bonfire: Return Largest Numbers in Arrays
I understand what I need to do and can kind of work out in my head, but seem to hit a wall
executing
Todd Johnson
@TJohnson93
Aug 22 2015 12:15
@Moondogg71 Whats your code so far?
Nnxoxo
@Nnxoxo
Aug 22 2015 12:17
@TJohnson93 from mobile phone via wi-fi ahaha
http://www.speedtest.net/my-result/4602138401
Todd Johnson
@TJohnson93
Aug 22 2015 12:19
link clicked
link loaded
pathetic
Jordan Shackelford
@JordanShackelford
Aug 22 2015 12:21
I live in the southern united states and i'm honestly surprised to have much faster internet
If Australia has Cox you should use them
Clayton
@cjg040103
Aug 22 2015 12:25
anybody know what i shood put inside my indexOf([])?
function mutation(arr) {
  for(var i = 0; i > arr[0].length; i++) {
    var a = arr.indexOf([]);
    if(a === arr[1]) {
      return false;
    } else {
      return true;
    }
  }
}

mutation(['hello', 'hey']);
Nnxoxo
@Nnxoxo
Aug 22 2015 12:28
@cjg040103 maybe arr1?
Clayton
@cjg040103
Aug 22 2015 12:28
This message was deleted
umm... maybe... lemme try.
nope
function mutation(arr) {
  for(var i = 0; i > arr[0].length; i++) {
    var a = arr.indexOf([arr[1]]);
    if(a === arr[1]) {
      return false;
    } else {
      return true;
    }
  }
}

mutation(['hello', 'hey']);
Nnxoxo
@Nnxoxo
Aug 22 2015 12:31
@cjg040103 delete outer square brackets
@cjg040103 it should be indexOf(arr [ 1 ] );
Clayton
@cjg040103
Aug 22 2015 12:31
k
Todd Johnson
@TJohnson93
Aug 22 2015 12:31
@JordanShackelford Telstra owns all the lines and leasing out to other providers. They are rolling out a fibre network now but still many more years until it’s fully implemented.
Clayton
@cjg040103
Aug 22 2015 12:32
nooope... :worried:
function mutation(arr) {
  for(var i = 0; i > arr[0].length; i++) {
    var a = arr.indexOf(arr[1]);
    if(a === arr[1]) {
      return false;
    } else {
      return true;
    }
  }
}

mutation(['hello', 'hey']);
Rich Stiehm
@Moondogg71
Aug 22 2015 12:33
@TJohnson93
Well I don't have any code so far....
I understand how to sort a numeric array and splice .....
var myArray = [23, 1, 22, 90, 3];
myArray.sort(function(a, b) {
return b - a
});
var removedHighest = myArray.splice(0, 1);
removedHighest
//RETURNS [90]
Nnxoxo
@Nnxoxo
Aug 22 2015 12:34
@cjg040103 link the bonfire
@cjg040103 what u need to do there
Clayton
@cjg040103
Aug 22 2015 12:34
bonfire mutations
CamperBot
@camperbot
Aug 22 2015 12:34

: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

Clayton
@cjg040103
Aug 22 2015 12:34
bf details
CamperBot
@camperbot
Aug 22 2015 12:34

: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.
For example, ['hello', 'Hello'], should return true because all of the letters in the second string are present in the first, ignoring case.
The arguments ['hello', 'hey'] should return false because the string 'hello' does not contain a 'y'.
Lastly, ['Alien', 'line'], should return true because all of the letters in 'line' are present in 'Alien'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Clayton
@cjg040103
Aug 22 2015 12:36
bf links
CamperBot
@camperbot
Aug 22 2015 12:36
Nnxoxo
@Nnxoxo
Aug 22 2015 12:36
@cjg040103 ur for loop is incorrect
Clayton
@cjg040103
Aug 22 2015 12:36
oh?
Rich Stiehm
@Moondogg71
Aug 22 2015 12:36

@TJohnson93
Trying to jam this into a function that would iterate over each set of numbers and push the return into a new array.....at least that's what I think needs to happen lol....
Once again all i got is

var myArray = [23, 1, 22, 90, 3];
myArray.sort(function(a, b) {
return b - a
});
var removedHighest = myArray.splice(0, 1);
removedHighest
//RETURNS [90]

Clayton
@cjg040103
Aug 22 2015 12:37
whats wrong w/ it? @Nnutthowze
Nnxoxo
@Nnxoxo
Aug 22 2015 12:38
the task is to find if the all elements of the second string contain in the first string
Clayton
@cjg040103
Aug 22 2015 12:39
kk i get what i need to do!
Nnxoxo
@Nnxoxo
Aug 22 2015 12:39
@cjg040103 u need to iterate over the second string
Clayton
@cjg040103
Aug 22 2015 12:39
:D
Nnxoxo
@Nnxoxo
Aug 22 2015 12:41
@cjg040103 and if first string have all letters in the second u should return true
@cjg040103 i can write it for you... but it will be disservice for u
Clayton
@cjg040103
Aug 22 2015 12:43
whatevs.
i think i almost got it.
Nnxoxo
@Nnxoxo
Aug 22 2015 12:44
@cjg040103 nice
Clayton
@cjg040103
Aug 22 2015 12:46
whats wrong w/ this?
function mutation(arr) {
  var b = arr[1];
  for(var i = 0; i > arr[1].length; i++) {
    var a = arr[0].toUpperCase();
    if(b === a) {
      return true;
    } else {
      return false;
    }
  }
}

mutation(['hello', 'hey']);
Nnxoxo
@Nnxoxo
Aug 22 2015 12:47
@cjg040103 why u use i > arr1.length?
Clayton
@cjg040103
Aug 22 2015 12:48
woops
1 sec
there we go!
function mutation(arr) {
  var b = arr[1];
  for(var i = 0; i <= arr[1].length; i++) {
    var a = arr[0].toUpperCase();
    if(b === a) {
      return true;
    } else {
      return false;
    }
  }
}

mutation(['hello', 'hey']);
or...
nope same return
function mutation(arr) {
  var b = arr[1];
  for(var i = 0; i < arr[1].length; i++) {
    var a = arr[0].toUpperCase();
    if(b === a) {
      return true;
    } else {
      return false;
    }
  }
}

mutation(['hello', 'hey']);
Bastien Lemaire
@blemaire
Aug 22 2015 12:50
you're only checking if 1 character is present here...
Nnxoxo
@Nnxoxo
Aug 22 2015 12:51
@cjg040103 arr0 returns only first character
Clayton
@cjg040103
Aug 22 2015 12:51
how do i fix it?
Nnxoxo
@Nnxoxo
Aug 22 2015 12:51
@cjg040103 arr[i]
Clayton
@cjg040103
Aug 22 2015 12:51
ok! :smile:
Bastien Lemaire
@blemaire
Aug 22 2015 12:52
you should upper or lower case both arrays
Nnxoxo
@Nnxoxo
Aug 22 2015 12:52
@cjg040103 and if (b !== a) return false; and after your for loop return true;
Bastien Lemaire
@blemaire
Aug 22 2015 12:52
then you loop through the second array
Clayton
@cjg040103
Aug 22 2015 12:52
k
Nnxoxo
@Nnxoxo
Aug 22 2015 12:53
@cjg040103 btw, use indexOf()
Bastien Lemaire
@blemaire
Aug 22 2015 12:53
and use array.indexOf()
Clayton
@cjg040103
Aug 22 2015 12:53
here's what i got
Bastien Lemaire
@blemaire
Aug 22 2015 12:53
it returns -1 when the character is not found
Clayton
@cjg040103
Aug 22 2015 12:53
function mutation(arr) {
  var b = arr[1];
  for(var i = 0; i < arr[1].length; i++) {
    var a = arr[i].toUpperCase();
    if(b !== a) {
      return false;
    } else {
      return true;
    }
  }
}

mutation(['hello', 'hey']);
Stephan Tabor
@stephantabor
Aug 22 2015 12:53
you're getting closer
Clayton
@cjg040103
Aug 22 2015 12:54
how shood i be using indexOf
Bastien Lemaire
@blemaire
Aug 22 2015 12:54
change your if statement:
if (arr.indexOf(b) === -1) { return false; }
Stephan Tabor
@stephantabor
Aug 22 2015 12:54
you need to search the entire first string for each letter in the second string though
Bastien Lemaire
@blemaire
Aug 22 2015 12:54
then at the end of your for loop, return true..
Stephan Tabor
@stephantabor
Aug 22 2015 12:54
which indexOf will make easy for you
Clayton
@cjg040103
Aug 22 2015 12:54
ohh. @blemaire thx!
CamperBot
@camperbot
Aug 22 2015 12:54
cjg040103 sends brownie points to @blemaire :sparkles: :thumbsup: :sparkles:
:star: 2 | @blemaire | http://www.freecodecamp.com/blemaire
Bastien Lemaire
@blemaire
Aug 22 2015 12:55
however you need to make sure both are upper or lower case...
Clayton
@cjg040103
Aug 22 2015 12:55
kk
Stephan Tabor
@stephantabor
Aug 22 2015 12:55
personally i find it easier to think about if i use an intermediate variable for stuff like this, such as str1 = arr[0], str2 = arr[2]
Clayton
@cjg040103
Aug 22 2015 12:56
soooper close!
function mutation(arr) {
  var b = arr[1];
  for(var i = 0; i < arr[1].length; i++) {
    var a = arr[i].toUpperCase();
    if (arr.indexOf(b) === -1) {
      return false;
    } else {
      return true;
    }
  }
}

mutation(['hello', 'hey']);
1 sec
Bastien Lemaire
@blemaire
Aug 22 2015 12:57
this is close but no cigar
Stephan Tabor
@stephantabor
Aug 22 2015 12:57
check your if statement with indexOf
Clayton
@cjg040103
Aug 22 2015 12:58
@stephantabor whaddayamean?
:confused:
Stephan Tabor
@stephantabor
Aug 22 2015 12:58
so arr is basically [str1, str2] if i'm reading the prompt right
Clayton
@cjg040103
Aug 22 2015 12:59
yup
Stephan Tabor
@stephantabor
Aug 22 2015 12:59
so if you do [str1, str2].indexOf, is that looking for what you think it's looking for?
Nnxoxo
@Nnxoxo
Aug 22 2015 12:59
@cjg040103 arr1.indexOf(b)
nope
Bastien Lemaire
@blemaire
Aug 22 2015 12:59
hold on you need to extract both strings from the input parametre
Clayton
@cjg040103
Aug 22 2015 12:59
k
Nnxoxo
@Nnxoxo
Aug 22 2015 12:59
var b = arr[0]
Stephan Tabor
@stephantabor
Aug 22 2015 13:00
what you want to end up with is str1.indexOf(some char from str2)
Nnxoxo
@Nnxoxo
Aug 22 2015 13:00
arr1.indexOf(b);
@cjg040103 make smth like firstString = arr[0].toLowerCase(); secondString = arr[1].toLowerCase();
Bastien Lemaire
@blemaire
Aug 22 2015 13:02
first line, you need to extract both words from the input array:
var [a, b] = arr; (ES6) should put a = "Hello" and b = "hey"
Then you iterate through the letters in b
as soon as 1 letter from b is not found in a, you can return false;
if you get to the end of the for loop without having returned false, it means all letters have been found so after the closing bracket of your for loop, you need to return true.
if this doesn't work: var [a, b] = arr; you can do
var a = arr[0], b = arr[1];
Stephan Tabor
@stephantabor
Aug 22 2015 13:07
^ also convert them both to upper or lower when you do that
Clayton
@cjg040103
Aug 22 2015 13:09
i dunno... i'll come back l8r. thanks 4 all ur help ! @blemaire @Nnutthowze @stephantabor @stephantabor !
CamperBot
@camperbot
Aug 22 2015 13:09
cjg040103 sends brownie points to @blemaire and @nnutthowze and @stephantabor and @stephantabor :sparkles: :thumbsup: :sparkles:
:warning: cjg040103 already gave blemaire points
:star: 52 | @stephantabor | http://www.freecodecamp.com/stephantabor
:star: 52 | @stephantabor | http://www.freecodecamp.com/stephantabor
:star: 270 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
Bastien Lemaire
@blemaire
Aug 22 2015 13:10
var a = arr[0].toLower(), b = arr[1].toLower();
Clayton
@cjg040103
Aug 22 2015 13:11
bye!
Stephan Tabor
@stephantabor
Aug 22 2015 13:11
see ya
Bastien Lemaire
@blemaire
Aug 22 2015 13:18
anyone knows what's happening here: FreeCodeCamp/FreeCodeCamp#2489 ?
calisham
@calisham
Aug 22 2015 13:19
i think you need a space after well or after the colon. i can't remember. but i remember that being my problem
@blemaire that msg was for you
Bastien Lemaire
@blemaire
Aug 22 2015 13:21
solved, thanks @calisham
calisham
@calisham
Aug 22 2015 13:22
no problem @blemaire it's one of those really small things you can't tell you're doing wrong from the lesson description
Bastien Lemaire
@blemaire
Aug 22 2015 13:24
blob
that's a screenshot of the description
Mistereo
@Mistereo
Aug 22 2015 13:32
@blemaire the description is right actually, since you can $(".target:nth-child(2)").addClass("animated bounce"); instead of using selector with .well...
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:33
help
CamperBot
@camperbot
Aug 22 2015 13:33

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:34
bonfire bonfire-check-for-palindromes
CamperBot
@camperbot
Aug 22 2015 13:34

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Nnxoxo
@Nnxoxo
Aug 22 2015 13:34
@tokoiwesley show the code
Bastien Lemaire
@blemaire
Aug 22 2015 13:35
@Mistereo thanks, should have read more carefully, I thought I had to select the nth child (from the parent) but it was the child number n instead thanks
CamperBot
@camperbot
Aug 22 2015 13:35
blemaire sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 264 | @mistereo | http://www.freecodecamp.com/mistereo
Bastien Lemaire
@blemaire
Aug 22 2015 13:36
you can split the string in half and check if string[i] === string[string.lenght - i]
calisham
@calisham
Aug 22 2015 13:36
@tokoiwesley just finished that one and stumbled upon two ways to do it without realizing it. let me know if I can help
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:38
just a moment please
```
function palindrome(str) {

  var myString = str;
  myString = myString.toLowerCase();

  var myArray;
  myArray = myString.split("");

  var mySecondString;
  mySecondString = myArray.reverse();
  mySecondString = mySecondString.join("");

  if (myString == mySecondString) {
    return true;
  } else {
     return false;
  }

}



palindrome("eye");
Bastien Lemaire
@blemaire
Aug 22 2015 13:40
should be if (myString === mySecondString)
that should work but could be improved
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:42
@blemaire === gives the same result just as using ==
Nnxoxo
@Nnxoxo
Aug 22 2015 13:42
@tokoiwesley u need to clean ur strings... Your input string could have .,#% 87 and etc, so write the regulare expression for this situation
Stephan Tabor
@stephantabor
Aug 22 2015 13:42
generally better to avoid == in favor of ===
Bastien Lemaire
@blemaire
Aug 22 2015 13:43
=== is best practice as it also checks for type equality
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:43
@Nnutthowze I see, I didn't use a regular expression
Bastien Lemaire
@blemaire
Aug 22 2015 13:43
you should be looking at creating a loop for the whole function i think..
Nnxoxo
@Nnxoxo
Aug 22 2015 13:44
@tokoiwesley but u need to clean ur strings
calisham
@calisham
Aug 22 2015 13:44
hey @tokoiwesley you can also do this in less code. try str.split('').reverse().join('') as one
then you don't need three variables
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:44
thanks @calisham
CamperBot
@camperbot
Aug 22 2015 13:44
tokoiwesley sends brownie points to @calisham :sparkles: :thumbsup: :sparkles:
:star: 168 | @calisham | http://www.freecodecamp.com/calisham
Wesley Tokoi
@tokoiwesley
Aug 22 2015 13:45
thanks @Nnutthowze
CamperBot
@camperbot
Aug 22 2015 13:45
tokoiwesley sends brownie points to @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 271 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
Bastien Lemaire
@blemaire
Aug 22 2015 13:45
for (var i = 0 ; i < str.length ; i++) {
   if (str[i] !== str[str.length - i]) {
      return false;
   }
}

return true;
can be improved too:
```
for (var i = 0 ; i < str.length / 2 ; i++)
for (var i = 0 ; i < str.length / 2 ; i++)
may have a problem with string that have odd length though, it needs to be tested...
Lucas Ter
@sookiat
Aug 22 2015 13:50

hi fellow campers, what exactly is the GET/POST url for http://forismatic.com/en/api/? I tried using:

$.get("http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=text&lang=en",function(data,stats) 
                               {
                                  $("#quoteText").html(data);
                                  alert(data);
                               }
                              );

Can't seem to get it to work...

Moisés Man
@moigithub
Aug 22 2015 13:58
@sookiat check wht error u get (console)
Clearwood
@Clearwood
Aug 22 2015 13:59

var Second;
var MyArray;
function palindrome(str) {
// Good luck!
MyArray = str.toLowerCase().split();
Second = MyArray.reverse().join('')
if (MyArray === Second){
return true;
} else {
return false;
}
}

palindrome("eye");

what am I doing wrong
Lucas Ter
@sookiat
Aug 22 2015 14:02
@moigithub I'm doing this in codepen and is not getting any error message. Just no response when i click the button element I have embedded it in:
$("#button").click(function()
                     {
                        $.post("http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=text&lang=en",function(data,status) 
                               {
                                  $("#quoteText").html("data + status");
                                  alert("data");
                               }
                              );
                     }
                    );
Moisés Man
@moigithub
Aug 22 2015 14:04
@sookiat open web developer on console tab
and click ur #button so it execute ur $.post
Nnxoxo
@Nnxoxo
Aug 22 2015 14:04
@Clearwood what are u splitting in .split() ?
and dont forget to clean ur strings for this u need regexp
Bastien Lemaire
@blemaire
Aug 22 2015 14:05
@Clearwood
 var MyArray = str.toLowerCase();

    var Second = MyArray.split("").reverse().join("");
Nnxoxo
@Nnxoxo
Aug 22 2015 14:05
@sookiat if u want to see a data don't use quotes.
alert(data);
Lucas Ter
@sookiat
Aug 22 2015 14:06
@Nnutthowze Im debugging, so changed it to a string. Still nothing
Nnxoxo
@Nnxoxo
Aug 22 2015 14:07

@sookiat

$.post( "ajax/test.html", function( data ) { $( ".result" ).html( data ); });

Megan
@ms1818
Aug 22 2015 14:08
Hi, I need help with Waypoint: Size your Images
Nnxoxo
@Nnxoxo
Aug 22 2015 14:08
@ms1818 link the code
Megan
@ms1818
Aug 22 2015 14:11

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

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
img {
width: 100px;
}
</style>

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

<img 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>

my image is 100px but i'm not sure where I'm supposed to put this smaller-image class
catmojo
@catmojo
Aug 22 2015 14:12
Hi campers! Im new to codecamp so I apologize for newbie question here...im working through the first HTML waypoints. Its not letting me move on, says I have not nested my a tag in my p tag...but as you can see i did...please could someone kindly let me know what i did wrong? humble thx.

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

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

<p>click here for <a href="http://catphotoapp.com">cat photos</a></p>

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

Nnxoxo
@Nnxoxo
Aug 22 2015 14:14
@ms1818 between <style></style>
@catmojo what's the number of waypoint?
David Aarons
@daarons
Aug 22 2015 14:16
@catmojo your a and p tags looks good to me but try changing the p and h2 tags so that the class="red-text" is inside them like so: <h2 class="red-text">.....</h2>
Bastien Lemaire
@blemaire
Aug 22 2015 14:17
@catmojo also, the <img> tag should not end with /> (the / should not be there)
catmojo
@catmojo
Aug 22 2015 14:17
@Nnutthowze sorry its waypoint 22
thx @blemaire ..i removed that one...will try other suggestions...thx @daarons trying that too
CamperBot
@camperbot
Aug 22 2015 14:19
catmojo sends brownie points to @blemaire and @daarons :sparkles: :thumbsup: :sparkles:
:star: 219 | @daarons | http://www.freecodecamp.com/daarons
:star: 6 | @blemaire | http://www.freecodecamp.com/blemaire
Bastien Lemaire
@blemaire
Aug 22 2015 14:19
can you paste you code here again? (make sure to put 3 little backquote before and after your code)
Donny van Walsem
@Donneh
Aug 22 2015 14:19

I'm at the bonfire Mutations, i thought i had the solution but the last check fails.

function mutation(arr) {
  var string = arr[0].toLowerCase();
  var search = arr[1].toLowerCase();
  var result;

  for(var i = 0; i < search.length; i++) {
    if(string.indexOf(search.charAt(i)) > -1) {
      result = true;
    } else {
      result = false;
    }
  }
  return result;
}

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

hello and neo should return false, but it doesn't.

catmojo
@catmojo
Aug 22 2015 14:20
i fixed the h and p tag..but still wont let me through. :( says i cant get past as my a tag is not nested in my p tag....sigh

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

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

<p>click here for <a href="http://catphotoapp.com">cat photos</a></p>

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

Bastien Lemaire
@blemaire
Aug 22 2015 14:20
change this line:
if(string.indexOf(search.charAt(i)) > -1) { to if(string.indexOf(search.charAt(i)) < -1) {
and then return false inside that if
function mutation(arr) {
  var string = arr[0].toLowerCase();
  var search = arr[1].toLowerCase();
  var result;

  for(var i = 0; i < search.length; i++) {
    if(string.indexOf(search.charAt(i)) < 0) {
     return false
    }
  }
  return true;
}

mutation(['hello', 'neo']);
Donny van Walsem
@Donneh
Aug 22 2015 14:22
@blemaire Oh that works, but i don't really understand it. Could you elaborate a little?
Bastien Lemaire
@blemaire
Aug 22 2015 14:23
@Donneh of course the if statement checks for any character not in the first element of the array and returns false
(as soon as it finds a letter, it stops executing the code and returns false
David Aarons
@daarons
Aug 22 2015 14:24
@catmojo Try putting the <p> with the nested <a> ontop of the <img> tag
@catmojo not under
Bastien Lemaire
@blemaire
Aug 22 2015 14:24
if the loop ends, it means all letters were found and can return true
your version wasn't working because the last character was in the first string so the last value of result was true
catmojo
@catmojo
Aug 22 2015 14:25

@daarons like this?: <h2 class="red-text">CatPhotoApp</h2>

<p>click here for <a href="http://catphotoapp.com">cat photos</a></p>

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

David Aarons
@daarons
Aug 22 2015 14:25
@catmojo exactly
Donny van Walsem
@Donneh
Aug 22 2015 14:26
@blemaire Oh wow. I understand. Thank you! I don't know why i didn't see that myself.
CamperBot
@camperbot
Aug 22 2015 14:26
donneh sends brownie points to @blemaire :sparkles: :thumbsup: :sparkles:
:star: 7 | @blemaire | http://www.freecodecamp.com/blemaire
catmojo
@catmojo
Aug 22 2015 14:26
@daarons ....ugh..sorry still says Your a element should be nested within your new p element.
David Aarons
@daarons
Aug 22 2015 14:26
if that does not work post your code again but put three ``` before posting it and then press enter and put your code so we can see it better
Bastien Lemaire
@blemaire
Aug 22 2015 14:26
@Donneh note that this code will fail for some edge cases... (it will fail for sentences per example)
catmojo
@catmojo
Aug 22 2015 14:28

thx @daarons ```<h2 class="red-text">CatPhotoApp</h2>

<p>click here for <a href="http://catphotoapp.com">cat photos</a></p>

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

CamperBot
@camperbot
Aug 22 2015 14:28
catmojo sends brownie points to @daarons :sparkles: :thumbsup: :sparkles:
:warning: catmojo already gave daarons points
catmojo
@catmojo
Aug 22 2015 14:28
was it supposed to do that @daarons ?
Donny van Walsem
@Donneh
Aug 22 2015 14:29
@blemaire because it might lack spaces?
David Aarons
@daarons
Aug 22 2015 14:30
@catmojo No you should put three and then enter and put the code and then close with on a new line.
If you code still doesn't work look at the instructions on the left side of the page and scroll down to see where you have a red X indicating you didn't do something.
Hi
Bastien Lemaire
@blemaire
Aug 22 2015 14:32
@Donneh sorry, wrong exercice, it should work with sentences too.
but it would return true if the second element was empty I think...
catmojo
@catmojo
Aug 22 2015 14:32
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

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

<p>click here for <a href="http://catphotoapp.com">cat photos</a></p>

<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>
Bastien Lemaire
@blemaire
Aug 22 2015 14:33
@catmojo what's the issue?
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:34
Need some help with the repeat a string bonefire .. Drawing a blank here :/ Logicaly to me was using a method that repeats the string and there is such str.repeat() but it tells me that the object has no such method ? ..
catmojo
@catmojo
Aug 22 2015 14:34
@daarons thx for the correction... red x states the a tag is not nested in p tag...
CamperBot
@camperbot
Aug 22 2015 14:34
catmojo sends brownie points to @daarons :sparkles: :thumbsup: :sparkles:
:warning: catmojo already gave daarons points
Donny van Walsem
@Donneh
Aug 22 2015 14:36
@Ne0nite I did that with a for loop, I don't know if it's the best solution but it worked
David Aarons
@daarons
Aug 22 2015 14:36
@catmojo honestly it looks fine to me I really don't know. Try clicking the reset button on the left side and trying it over again. That's all I can think of. Sorry :(
Stephan Tabor
@stephantabor
Aug 22 2015 14:37
string repeat function is es6 i believe, it might not be supported
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:38
@Donneh hmm ok thank you will see how that goes
CamperBot
@camperbot
Aug 22 2015 14:38
ne0nite sends brownie points to @donneh :sparkles: :thumbsup: :sparkles:
:star: 159 | @donneh | http://www.freecodecamp.com/donneh
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 14:38
Return true if the given string is a palindrome. Otherwise, return false.
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:38
@stephantabor Hmm yea I figured as much after reading the method explanation. But I think they need to change this bonefore if there is a easy method to do it now ..At least my opinion
bonefire*
Stephan Tabor
@stephantabor
Aug 22 2015 14:39
i'm not sure how they run their test suite but it might not be easy for them to integrate es6 stuff before it's in the browser
catmojo
@catmojo
Aug 22 2015 14:41
haha...that was my last resort. thx @daarons for your patience :)
CamperBot
@camperbot
Aug 22 2015 14:41
catmojo sends brownie points to @daarons :sparkles: :thumbsup: :sparkles:
:warning: catmojo already gave daarons points
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:42
@stephantabor hmm You have a point there I guess :)
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 14:42

```function palindrome(str) {

// Good luck!
return true;
}

palindrome("eye");
```
Hi everyone, I'm working now on bonfire and I am stuck on this problem. here's the complete instruction:
"Return true if the given string is a palindrome. Otherwise, return false.

A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.

You'll need to remove punctuation and turn everything lower case in order to check for palindromes.

We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others." I already searched google, but I still couldn't figure it out.

function palindrome(str) {
// Good luck!
return true;
}
palindrome("eye");
Stephan Tabor
@stephantabor
Aug 22 2015 14:44
@Ne0nite more likely they are running their test suite on the server in node and it's not supported there yet
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:45
@Donneh The foor lop worked like a charm, Thank You for the hint :)
CamperBot
@camperbot
Aug 22 2015 14:45
ne0nite sends brownie points to @donneh :sparkles: :thumbsup: :sparkles:
:warning: ne0nite already gave donneh points
Tom Pyszczuk
@Ne0nite
Aug 22 2015 14:45
for loop*
Stephan Tabor
@stephantabor
Aug 22 2015 14:45
@jesserafael what are you stuck on exactly
Bastien Lemaire
@blemaire
Aug 22 2015 14:47
seems everyone is stuck on the palindrome today.. I haven't even reached there yet but I have to do everything else first :(
Stephan Tabor
@stephantabor
Aug 22 2015 14:47
i've been doing some bonfires in that section, i'm not sure where i'm at exactly overall since a lot of stuff has changed since i was last here lol
Donny van Walsem
@Donneh
Aug 22 2015 14:49
Is it normal to be stuck on most bonfires for a while?
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 14:51
@stephantabor I just couldn't figure out how to check for palindromes. It says that these codes: String.replace() and
String.toLowerCase() may help, but I don't know how to use it.
Stephan Tabor
@stephantabor
Aug 22 2015 14:52
gotcha
if you can break it down into smaller parts it might be able to help
those two functions will help
think of it like 1. remove whitespace characters, 2. convert all letters to lowercase, 3. compare a backward string to a forward string. it's easier to reason about it in small steps rather than just all at once
Stephan Tabor
@stephantabor
Aug 22 2015 14:55
i'm not sure if the test cases have punctuation or only spaces, if it's only spaces you probably don't even need a regex to use with .replace, you can just replace ' ' with '' for example
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 14:55
Does anyone know why the links to..for example...Twitter....from my pen....need to be right-clicked and opened in a new tab? Is that because I'm in Codepen?
Stephan Tabor
@stephantabor
Aug 22 2015 14:59
if you're doing something straight forward like just using an a tag then i'd assume it's codepen fault
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 14:59
It's strange. It will open up Github (but then my Codepen account is linked to Github)...but won't open any other link unless I open it in a new tab
mohamed khemaissia
@coder08
Aug 22 2015 15:00
hello everyone
can anyone help ?
Stephan Tabor
@stephantabor
Aug 22 2015 15:00
possibly
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:00

@stephantabor can you test it and see what happens for you. It's the links below the cat:

http://codepen.io/highpriestess/full/yNdamj/

Jesse Rafael Dizon
@jesserafael
Aug 22 2015 15:00
@stephantabor it just says that i'll need to rmove punctuation and turn everything lower case.
mohamed khemaissia
@coder08
Aug 22 2015 15:01

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}

orange-text {

color: orange;

}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>

<h1 id="orange-text" class="pink-text blue-text" style="color:green">Hello World!</h1>

normally the text shoud be white in this exercise
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:02
orange-text doesn't have the # tag in front of it
but in your h1 tag it says that it's an ID
@coder08 that's what I see
mohamed khemaissia
@coder08
Aug 22 2015 15:03
@TheHighPriestess it have a tag but when i paste it it doesnt appear
Stephan Tabor
@stephantabor
Aug 22 2015 15:04
@jesserafael the two given functions in the sidebar will do that part for you, check the docs for them on MDN, let me know if you get stuck on those or if it's on the part that comes after that
@TheHighPriestess the stuff in codepen, only the github link works, i think it's not doing the external ones
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:04
doesn't appear where? @coder08
Stephan Tabor
@stephantabor
Aug 22 2015 15:05
github link seems to be loading something in the codepen environment
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:05
@stephantabor ok...yeah...that's what it looks like. Have no idea why.
mohamed khemaissia
@coder08
Aug 22 2015 15:05
@TheHighPriestess it doesnt appear in here but in my code in waypoint i put the tag
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:05
@coder08 oh ok...
@coder08 shouldn't the text be green?
because of that inline style?
mohamed khemaissia
@coder08
Aug 22 2015 15:06
@TheHighPriestess the waypoint is about overiding they're telling me that in the end the color shoud be white
Your h1 element should be white
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:07
@coder08 which waypoint is it?
mohamed khemaissia
@coder08
Aug 22 2015 15:07
wait a minutes
@TheHighPriestess 52
Joshua
@ckent20
Aug 22 2015 15:09
alt is this normal?
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:10
@coder08 YOu have this: style="color:green"
it should be style="color:white"
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
Stephan Tabor
@stephantabor
Aug 22 2015 15:11
what do you mean @ckent20
mohamed khemaissia
@coder08
Aug 22 2015 15:11
@TheHighPriestess thanks a lot i feel like an idiot lol gracie
CamperBot
@camperbot
Aug 22 2015 15:11
coder08 sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 210 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Elizabeth Hatleli
@TheHighPriestess
Aug 22 2015 15:12
@coder08 haha I do stuff like that all the time.
Justin Dieter
@JDieter12
Aug 22 2015 15:12
I did the same thing…on the same lesson. Lol.
mohamed khemaissia
@coder08
Aug 22 2015 15:13
@TheHighPriestess @JDieter12 lool
Donavin Northrup
@dnorthrupva
Aug 22 2015 15:33
http://codepen.io/dnorthrupva/pen/gpNoOJ Anyone why know why what's going on, is going on? Haha (The Gray "fog" that slowly consumes everything.) BootStrap isnt' liking my CSS for some reason
Kyle Chesmore
@Kyleches
Aug 22 2015 15:36
Screenshot_25.png
Could anyone tell me what I've done wrong please?
Stephan Tabor
@stephantabor
Aug 22 2015 15:37
i do my best to avoid having to work on front end stuff ᕦ( ͡° ͜ʖ ͡°)ᕤ
mohamed khemaissia
@coder08
Aug 22 2015 15:37
@dnorthrupva GOOD WORK DUDE
Logan Tegman
@ltegman
Aug 22 2015 15:38
@dnorthrupva Your fader divs are overflowing the section they’re fading, so they’re overlapping eachother and making it progressively move opaque
Matthias Kern
@matthiaskern
Aug 22 2015 15:38
@Kyleches try adding it in the same order as in the description!
Donavin Northrup
@dnorthrupva
Aug 22 2015 15:39
@ltegman Any idea how to fix? The reason the <div> is where they are if because if I only put it in one section, it didn't cover the whole page. I'm not overly familiar with how BootStrap sections work.
@coder08 Thanks - Now if I make it work, it'll be progress... Haha
CamperBot
@camperbot
Aug 22 2015 15:39
dnorthrupva sends brownie points to @coder08 :sparkles: :thumbsup: :sparkles:
:star: 102 | @coder08 | http://www.freecodecamp.com/coder08
Kyle Chesmore
@Kyleches
Aug 22 2015 15:39
@kema00 I've tried that! That is how it was originally, still does not work :/
Donavin Northrup
@dnorthrupva
Aug 22 2015 15:40
@ltegman I felt weird having 4 divs, when normally I would make one div at the top(or bottom) of my code, and maybe move it up a bit on the z-axis. BootStrap didn't like it.
mohamed khemaissia
@coder08
Aug 22 2015 15:40
@dnorthrupva im sure it will work
Donavin Northrup
@dnorthrupva
Aug 22 2015 15:41
@ltegman Good catch, either way. I didn't even think about deleting the <div> one at a time to see the result. I see it slowly getting less obnoxious now.
@coder08 Thanks. I'm re-doing the zipline using Bootstrap and trying to make it "fancy" instead of just white backgrounds for text, or using built-in features.
Logan Tegman
@ltegman
Aug 22 2015 15:42
@dnorthrupva I don’t know of the top of my head since bootstrap is the bane of my existance, but I’ll mess around with it and see if I can help you out.
Matthias Kern
@matthiaskern
Aug 22 2015 15:44
Screenshot from 2015-08-22 18-41-34.png
mohamed khemaissia
@coder08
Aug 22 2015 15:44
@dnorthrupva keep up you're in the right way
Donavin Northrup
@dnorthrupva
Aug 22 2015 15:44

@ltegman If you could, I'd appreciate it. I've been messing with it since last night, but long story short: One of three things happen. A) The Div doesn't cover the ENTIRE Section, (similar to http://codepen.io/dnorthrupva/pen/gpNoOJ how it looks now, I saved it for show.) This is the BEST it's ever looked, but at the bottom there is that small bit of issue.
B) It doesn't show, at all. C) It causes the overlay issue.

I'm about to go pick up my wife, so I'll be AFK for a bit. If you come up with anything and wanna PM me, I'd appreciate it. I will work on it again once I return.

Matthias Kern
@matthiaskern
Aug 22 2015 15:44
@Kyleches my accepted solution is up there
Nnxoxo
@Nnxoxo
Aug 22 2015 15:46
@dnorthrupva I think, that u have to use .clearfix class on some problem sections of your layout
Kyle Chesmore
@Kyleches
Aug 22 2015 15:48
@kema00 Thanks, I think the website may be buggy. I'll come back to this part later.
CamperBot
@camperbot
Aug 22 2015 15:48
kyleches sends brownie points to @kema00 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for kema00
mohamed khemaissia
@coder08
Aug 22 2015 15:49
this camperbot become so annoying
Matthias Kern
@matthiaskern
Aug 22 2015 15:49
how come i dont get brownies :D
mohamed khemaissia
@coder08
Aug 22 2015 15:50
thanks @kema00 here are your brownies :p
CamperBot
@camperbot
Aug 22 2015 15:50
coder08 sends brownie points to @kema00 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for kema00
Matthias Kern
@matthiaskern
Aug 22 2015 15:51
:P but it says " could not find receiver"
Saumil Kadukkatt
@saumilkadukkatt
Aug 22 2015 15:51

function myFunction(){
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.
if (flip === 0) {
return("Heads");
}
else
{
return("tails");
}

}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();

mohamed khemaissia
@coder08
Aug 22 2015 15:51
@kema00 i juste notice it dont know what's the problem :/
Saumil Kadukkatt
@saumilkadukkatt
Aug 22 2015 15:52
it still shows error : assert((function(){if(myFunction() === "heads" || myFunction() === "tails"){return(true);}else{return(false);}})(), 'myFunction should either return heads or tails');myFunction should either return heads or tails
Michael D. Johnson
@CodeNonprofit
Aug 22 2015 15:52
@kema00 I've let the creator know about that bug. Thank you for your help!
CamperBot
@camperbot
Aug 22 2015 15:52
codenonprofit sends brownie points to @kema00 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for kema00
Matthias Kern
@matthiaskern
Aug 22 2015 15:53
@CodeNonprofit thanks :P
CamperBot
@camperbot
Aug 22 2015 15:53
kema00 sends brownie points to @codenonprofit :sparkles: :thumbsup: :sparkles:
:star: 72 | @codenonprofit | http://www.freecodecamp.com/codenonprofit
Matthias Kern
@matthiaskern
Aug 22 2015 15:55
oh, can somebody try again? it might be because my fcc profile wasnt linked to my github acc
Michael D. Johnson
@CodeNonprofit
Aug 22 2015 15:55
@kema00 The report back is this is happening because your username doesn't exist on Free Code Camp.
Matthias Kern
@matthiaskern
Aug 22 2015 15:55
@CodeNonprofit yep, what i thought now too!
Michael D. Johnson
@CodeNonprofit
Aug 22 2015 15:55
@kema00 Thanks
CamperBot
@camperbot
Aug 22 2015 15:55
codenonprofit sends brownie points to @kema00 :sparkles: :thumbsup: :sparkles:
:star: 190 | @kema00 | http://www.freecodecamp.com/kema00
Doug Riblet
@DougRiblet
Aug 22 2015 16:23
I'm having a problem with Expressworks, exercise 4 "Good Old Form".
Here is my program.js code. Every time I try to verify, I get long delay then "Error: socket hang up".
var express = require('express');
var bodyparser = require('body-parser');
var app = express();

app.use(bodyparser.urlencoded({extended: false}));

app.post('/form', function(req, res) {
    req.body.str.split('').reverse().join('');
});
app.listen(process.argv[2]);
Is there something wrong in here causing the socket hang-up?
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 16:28
@stephantabor Where do I go wrong here?
function palindrome(str) {
  var removePunc = str.replace(/[^a-zA-Z0-9]/, "EYe").toLowerCase();
  var checkPalindrome = str.split('').reverse().join('');

  if(removePunc === checkPalindrome) {
    return true;
  }
  else {return false;
  }



}



palindrome("eye");
Clearwood
@Clearwood
Aug 22 2015 16:28
i have big problems with bonfire; i hadn't any problems with java script before but i have know idea how to get a solution and i have been stuck for one hour with Bonfire: Title Case a Sentence. Can anybody help me?
N-kay
@N-kay
Aug 22 2015 16:29
Hey guys. I'm on my first zipline, recreating the portfolio, and I'm trying to create a nice overlay for the project thumbnails.
But I'm having trouble creating a nice css transition for the overlay, can anyone help?
Robert
@rc242
Aug 22 2015 16:29
heyo.
@Clearwood What's the problem?
@jesserafael You're replacing every non-alphanumeric character with EYe, not sure why.
Clearwood
@Clearwood
Aug 22 2015 16:32
i have just no idea how to solve the problem
Robert
@rc242
Aug 22 2015 16:32
bf title
CamperBot
@camperbot
Aug 22 2015 16:32

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

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

N-kay
@N-kay
Aug 22 2015 16:33
Here's my css for the thumbnail and overlay btw

.thumbnail {
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.thumbnail > .overlay {
  display: none;
  top: 0px;
  left: 0px;
  transition: background-color 1s linear;
}
.thumbnail:hover .overlay{
  display: inline;
  position: absolute;
  text-align: center;
  background-color: rgba(0,0,0,0.6);
  color: white;
  width: 100%;
  height: 100%;
}

.overlay p {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}
Sean Campbell
@natac13
Aug 22 2015 16:33
@Clearwood could you start by spliting the string into an array
Robert
@rc242
Aug 22 2015 16:33
@Clearwood Tackle it by steps. What step would you take first?
N-kay
@N-kay
Aug 22 2015 16:34
The transition doesn't seem to be working :(
Sean Campbell
@natac13
Aug 22 2015 16:35
@N-kay I see an extra } that is before .thumbnail:hover
Clearwood
@Clearwood
Aug 22 2015 16:35
@rc242 i first wanted to lowercase everything to start working with str.lowercase after that i wanted to identify the different words with str.match(/\w+/g); but i have no idea how to capitalize the first letter of each word
N-kay
@N-kay
Aug 22 2015 16:35
holy cow, how did I miss that?
Sean Campbell
@natac13
Aug 22 2015 16:36
@N-kay Stuff like that happens all the time to me man
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 16:36
@rc242 I already removed EYe , but it still doesn't work
Aaron Freidus
@shadowfool
Aug 22 2015 16:37
4 eyes are better than 2 @N-kay
Lux3
@Lux3
Aug 22 2015 16:37
Can anyone tell me how to get the number to factorialize here?
function factorialize(num) {
  return num;
}
var fact = 1;

factorialize(5);

for(var i = 1; i < num; i++) {
  fact = fact * i;
}
it is clearly not num
Aaron Freidus
@shadowfool
Aug 22 2015 16:37
so right now you function takesa number and then just spits it out
so factorialize(5) = 5
Lux3
@Lux3
Aug 22 2015 16:38
how do I get that number into a new var?
Clearwood
@Clearwood
Aug 22 2015 16:38
@Lux3 you don't have to use a new var
Robert
@rc242
Aug 22 2015 16:38
@Clearwood going lowercase on everything isn't really the right choice. You need to find the uppercase first.
@Clearwood sorry, wrong bf.
Lux3
@Lux3
Aug 22 2015 16:39
@Clearwood how do I need to change it then?
it tells me num is undefined
Aaron Freidus
@shadowfool
Aug 22 2015 16:40
num is only in the scope of your factorialize function
so if you want to use num in your for loop the for loop will need to be inside the factorialize function
N-kay
@N-kay
Aug 22 2015 16:40
@natac13 Wait no, that's actually correct. I'm selecting the :hover beneath that. The markup is wrong here for some reason?
Robert
@rc242
Aug 22 2015 16:40
@Clearwood So, you need to go and find the first character of each word. You don't need to go and lowercase everything. You can go ahead and use split as @natac13 suggested, or use another method directly without split.
Lux3
@Lux3
Aug 22 2015 16:40
ooh I think I get it thank you
CamperBot
@camperbot
Aug 22 2015 16:40
if you want to thank someone, put an @ before their name!
Aaron Freidus
@shadowfool
Aug 22 2015 16:41
function factorialize(num) {  //<---- begins the scope//
  return num; /// <--- only local to the scope//
}   // <---- this ends the scope//
var fact = 1;

factorialize(5);

for(var i = 1; i < num; i++) { // <---- num has no value here since it's not in the global scope//
  fact = fact * i;
}
Robert
@rc242
Aug 22 2015 16:41
@jesserafael what problems are you experiencing with it?
Doug Riblet
@DougRiblet
Aug 22 2015 16:42
@jesserafael post your current code, i'll try to offer suggestion.
Sean Campbell
@natac13
Aug 22 2015 16:42
@N-kay Then I ay b/c there is no background-color propertity in the .thumbnail > overlay
Logan Tegman
@ltegman
Aug 22 2015 16:42
@rc242 I believe you actually do need to lowecase everything since some of the test cases have non first letters capitilized that you need to fix.
Aaron Freidus
@shadowfool
Aug 22 2015 16:42
@lux3 let me know if you need me to explain it further.
Sean Campbell
@natac13
Aug 22 2015 16:42
to it is transistioning from nothing....
Clearwood
@Clearwood
Aug 22 2015 16:43
@rc242 the problem is you have to lowercase it and then i still have the problem i don't know how to get the first letters and then uppercase it again
Lux3
@Lux3
Aug 22 2015 16:43
@shadowfool I think I get that concept now but I am still not getting a result
here it works now
N-kay
@N-kay
Aug 22 2015 16:44
@natac13 the background-color is in the :hover element though.
Lux3
@Lux3
Aug 22 2015 16:44
function factorialize(num) {
  var fact = 1;
  for(var i = 2; i <= num; i++) {
  fact = fact * i;
  }
  return fact;
}

factorialize(5);
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 16:44

@smashzen @rc242
Here's the instruction : "Return true if the given string is a palindrome. Otherwise, return false.

A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.

You'll need to remove punctuation and turn everything lower case in order to check for palindromes.

We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others."

function palindrome(str) {
  var removePunc = str.replace(/\W+/gi, "").toLowerCase();
  var checkPalindrome = str.split('').reverse().join('');

  if(removePunc === checkPalindrome) {
    return true;
  }
  else {return false;
  }



}



palindrome("eye");
Aaron Freidus
@shadowfool
Aug 22 2015 16:44
@Lux3 awesome it looks like you understood. So you see now num is accessable to your for loop.
Robert
@rc242
Aug 22 2015 16:44
@Clearwood Using is split decent solution. You could also go through the string and replace the first alpha character to its uppercase counterpart.
bf palindrome
CamperBot
@camperbot
Aug 22 2015 16:44

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Lux3
@Lux3
Aug 22 2015 16:45
@shadowfool thank you so much. I am still having trouble getting used to doing all the lessons on FCC instead of off-site, how it was a few weeks ago.
CamperBot
@camperbot
Aug 22 2015 16:45
lux3 sends brownie points to @shadowfool :sparkles: :thumbsup: :sparkles:
:star: 267 | @shadowfool | http://www.freecodecamp.com/shadowfool
N-kay
@N-kay
Aug 22 2015 16:45
@natac13 Just like here in this MDN page, the transition property is in the normal selector, and the property I want to change is in the :hover property
Robert
@rc242
Aug 22 2015 16:45
@jesserafael \W+ will keep underscores.
Sean Campbell
@natac13
Aug 22 2015 16:45
@N-kay yeah but from what I know you need to transition from something to something...
Lux3
@Lux3
Aug 22 2015 16:46
@shadowfool they really walked you through it before now I have to go look things up, haha
Robert
@rc242
Aug 22 2015 16:46
@jesserafael what "word" is it failing on?
Doug Riblet
@DougRiblet
Aug 22 2015 16:46
@jesserafael Looks like when you do "if(removePunc === checkPalindrome) ", one of these has spaces and the other doesn't.
Aaron Freidus
@shadowfool
Aug 22 2015 16:46
@Lux3 yup it'll take a bit. The struggle is real, but you'll be better becasue of it. Plus you've got all the help you can get on this channel. (let me tell you I've been struggling hard on some of the ziplines because I try to implement all sorts of crazy things.)
Robert
@rc242
Aug 22 2015 16:46
@jesserafael @smashzen oh yes, you're reversing the wrong string.
Sean Campbell
@natac13
Aug 22 2015 16:46
@N-kay and background-color is set in the same spot as the transition and in the hover
Lux3
@Lux3
Aug 22 2015 16:47
@shadowfool we don't learn if we don't experiment! :wink:
Aaron Freidus
@shadowfool
Aug 22 2015 16:47
@Lux3 very true. Also we make crappy code if other people don't look at it.
Lux3
@Lux3
Aug 22 2015 16:48
@shadowfool :thumbsup:
N-kay
@N-kay
Aug 22 2015 16:48

@natac13 As I said, the article does the same thing and it works :/

But I changed it anyway to test it, still no result

.thumbnail:hover .overlay{
  display: inline;
  position: absolute;
  text-align: center;
  transition: background-color 1s linear;
  background-color: rgba(0,0,0,0.6);
  color: white;
  width: 100%;
  height: 100%;
}
Robert
@rc242
Aug 22 2015 16:48
@Clearwood the problem with using split is that it splits on a particular character. You probably don't want that for an actual sentence that has spaces, commas, and so forth. You probably instead want to iterate over the string instead.
N-kay
@N-kay
Aug 22 2015 16:48
@natac13 Full codepen is here if you want to take a closer look. Would be appreciated ;)
Or anyone else for that matter. I just can't figure out why it won't transition :fire:
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 16:49
@rc242 How do I correct it?
Robert
@rc242
Aug 22 2015 16:51
@jesserafael You have three strings. One is the original input, and two should be your "testing" strings. You have one string where your remove punctuation and another that reverses the input string. You then compare the reversed string and the removed punctuation string. However, the reversed string will NEVER be equal to the removed punctuation string because the reversed string still has punctuation with it.
Doug Riblet
@DougRiblet
Aug 22 2015 16:52
@jesserafael Hint -- how to make sure that removePunc is exactly reverse of checkPalindrome?
In last posted code, checkPalindrome is exactly reverse of str.
Lux3
@Lux3
Aug 22 2015 17:03
@jesserafael I figured it out.
Jesse Rafael Dizon
@jesserafael
Aug 22 2015 17:07
@Lux3 how did you do it ?
Davis
@ajdavis56
Aug 22 2015 17:08
How does one create a single scrollable page with multiple frames using bootstrap? (as in the example provided in Zipline 1)
Lux3
@Lux3
Aug 22 2015 17:09
@jesserafael as rc242 said you need to use the same string minus the punctuation. so on the line where you reverse it instead of having str.split I changed it to removePunc.split
Pranav Doshi
@pranavdoshi
Aug 22 2015 17:09
guys i need ur help on jquery waypoint