These are chat archives for FreeCodeCamp/Help

5th
Nov 2015
JCCoding
@JCCoding
Nov 05 2015 00:00
@hchevez01
Aleksander Gębicki
@Takumar
Nov 05 2015 00:00
@JCCoding "return" is a command which tells what your function will give you when you call it. so type return result; or return 34; or return "I'm good";
function giveMeFive() {
  return 5;
}
var result = giveMeFive();
Hamilton
@hchevez01
Nov 05 2015 00:00
@Takumar how did you format your examples?
Aleksander Gębicki
@Takumar
Nov 05 2015 00:01
@hchevez01 I use backticks
JCCoding
@JCCoding
Nov 05 2015 00:01
Thank you everyone I did it
CamperBot
@camperbot
Nov 05 2015 00:01
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Nov 05 2015 00:01
wiki format
CamperBot
@camperbot
Nov 05 2015 00:01

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

JCCoding
@JCCoding
Nov 05 2015 00:01
@Takumar
Hamilton
@hchevez01
Nov 05 2015 00:02
int var1 = 1;
ah okay
Aleksander Gębicki
@Takumar
Nov 05 2015 00:03
@JCCoding you have to type: "Thanks @hchevez01"
CamperBot
@camperbot
Nov 05 2015 00:03
takumar sends brownie points to @jccoding and @hchevez01 :sparkles: :thumbsup: :sparkles:
:star: 171 | @hchevez01 | http://www.freecodecamp.com/hchevez01
:warning: could not find receiver for jccoding
Hamilton
@hchevez01
Nov 05 2015 00:03
Thanks @JCCoding
CamperBot
@camperbot
Nov 05 2015 00:03
hchevez01 sends brownie points to @jccoding :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jccoding
Hamilton
@hchevez01
Nov 05 2015 00:04
woops wrong person
JCCoding
@JCCoding
Nov 05 2015 00:04
lmao
Hamilton
@hchevez01
Nov 05 2015 00:04
Thanks @Takumar
CamperBot
@camperbot
Nov 05 2015 00:04
hchevez01 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 636 | @takumar | http://www.freecodecamp.com/takumar
JCCoding
@JCCoding
Nov 05 2015 00:04
How do you send brownie points
Thanks everyone :0
CamperBot
@camperbot
Nov 05 2015 00:04
if you want to thank someone, put an @ before their name!
Hamilton
@hchevez01
Nov 05 2015 00:04
I'll probaly forget about the back stick but thanks nonetheless, going back to studying discrete math
CamperBot
@camperbot
Nov 05 2015 00:04
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Nov 05 2015 00:04
@hchevez01 you can type also three backtics and after that "js" or "html" to get correct colouring.
Hamilton
@hchevez01
Nov 05 2015 00:05
@JCCoding by "Thanks @(name)" the username you pick gets brownie point
CamperBot
@camperbot
Nov 05 2015 00:05
hchevez01 sends brownie points to @jccoding :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for jccoding
Ted Moxon
@Tedm82
Nov 05 2015 00:05
could someone please tell me how to insert data gathered from .pop into another array
Aleksander Gębicki
@Takumar
Nov 05 2015 00:05
@Tedm82 by using push() method.
Ted Moxon
@Tedm82
Nov 05 2015 00:05
thank you
CamperBot
@camperbot
Nov 05 2015 00:05
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Nov 05 2015 00:06

@Tedm82

myArr.push( yourArr.pop() );

of course if you want to push it to the end of array.
You can also check unshift()

Ted Moxon
@Tedm82
Nov 05 2015 00:07
yep thats what i was looking for thank you @Takumar
CamperBot
@camperbot
Nov 05 2015 00:07
tedm82 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 637 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Nov 05 2015 00:08
you're welcome.
I'm going sleep it's 1:08am. Good night!
Alem
@alemneh
Nov 05 2015 00:18
Hello trying to add minutes to this flip clock i'm using flipclock.js library I tried to use the increment option but my code is not recognizing it is a function when I run it. Here is the link https://gist.github.com/alemneh/ebc7680f5d6a7c444ce2
eagle122
@eagle122
Nov 05 2015 00:23
This message was deleted
This message was deleted
Arthur Zhuk
@ug02fast
Nov 05 2015 00:25
I have a git issue. I’m trying to remotely pull ALL the files from a branch on github. How can I do this? I’ve been trying numerous differnet commands and are working properly for me :(
eagle122
@eagle122
Nov 05 2015 00:30
Bring your JavaScript Slot Machine to Life I am entering the code and I know it is correct but still won't pass? what am i doing wrong? Screen Shot 2015-11-04 at 4.20.45 PM.png](https://files.gitter.im/FreeCodeCamp/Help/l5v5/thumb/Screen-Shot-2015-11-04-at-4.20.45-PM.png) The second test fails: You should have used the the selector given in the description to select each slot and assign it the value of slotOne, slotTwo and slotThree respectively.
Parker Mitchell
@RParkerM
Nov 05 2015 00:42
I think in that one you have to use exactly the line of code it supplies
I did it in an alternative way by creating my own function, and it still worked but it said it failed the test.
Ted Moxon
@Tedm82
Nov 05 2015 00:44
Having issues with Manipulate Arrays with shift. Am I just supposed to manually assign the data that i pull with shift because using .push() is giving me a Program Execution Failure
Bill
@kirah1314
Nov 05 2015 00:44
@eagle122 did you copy and paste the code on the left?
JCCoding
@JCCoding
Nov 05 2015 00:44

I have issues with "Waypoint: Create a JavaScript Slot Machine"

i fulfilled everything but "You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers."

I don't understand. I already used it 3 times

eagle122
@eagle122
Nov 05 2015 00:45
@kirah1314 no I typed the whole thing in
JCCoding
@JCCoding
Nov 05 2015 00:45
<script>
function runSlots(){
var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

// Only change code below this line.
var slotOne=(Math.random() * (3 - 1 + 1)) + 1;;
var slotTwo=(Math.random() * (3 - 1 + 1)) + 1;;
var slotThree=(Math.random() * (3 - 1 + 1)) + 1;;
Parker Mitchell
@RParkerM
Nov 05 2015 00:46
@Tedm82 Are you on the waypoint for manipulate arrays with shift? I don't believe you need to use push() anywhere in that waypoint.
JCCoding
@JCCoding
Nov 05 2015 00:46
slotOne should be a random number.
slotTwo should be a random number.
slotThree should be a random number.
You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers.
Bill
@kirah1314
Nov 05 2015 00:46
@eagle122 try copy/paste them and change the numbers. That should work
Parker Mitchell
@RParkerM
Nov 05 2015 00:46
@JCCoding you need to use Math.floor around everything but the +1
JCCoding
@JCCoding
Nov 05 2015 00:46
I fulfilled slot one, two and three. I already used it 3 times but the last part "You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers." says I didn't use it 3 times
Alex
@Sevohan
Nov 05 2015 00:47
Hey guys! I have a question that I hope will be easy to answer about arrays.
Parker Mitchell
@RParkerM
Nov 05 2015 00:47
@JCCoding You didn't use the Math.floor() function like it says in the test
at least in the code you showed
Ted Moxon
@Tedm82
Nov 05 2015 00:47
@RParkerM Yes I am. It says to assign the "shifted off" value to removedFromMyArray. I can get get it to pass if i just copy paste it but the wording makes me feel like i am missing code
JCCoding
@JCCoding
Nov 05 2015 00:48
oh
Lol thanks @RParkerM
CamperBot
@camperbot
Nov 05 2015 00:49
jccoding sends brownie points to @rparkerm :sparkles: :thumbsup: :sparkles:
:star: 209 | @rparkerm | http://www.freecodecamp.com/rparkerm
eagle122
@eagle122
Nov 05 2015 00:49
@kirah1314 ok I copied and pasted, now the first one fails and the second one passes????
Bill
@kirah1314
Nov 05 2015 00:49
@eagle122 paste your new codes?
Parker Mitchell
@RParkerM
Nov 05 2015 00:49
@Tedm82 Oh, I understand now. When you call array.shift(), it basically works exactly like .pop(). The variable just needs to be set to the value that it returns. :)
eagle122
@eagle122
Nov 05 2015 00:50
@kirah1314 yes
Parker Mitchell
@RParkerM
Nov 05 2015 00:50
@Tedm82 I think you might be trying to push a value onto the variable 'removedFromMyArray', which isn't an array. you can just set the variable.
Bill
@kirah1314
Nov 05 2015 00:50
@eagle122 I mean can you copy and paste your codes here?
Ted Moxon
@Tedm82
Nov 05 2015 00:51
@RParkerM Yes and it works just fine if i manually put the data that I .shift() into the array it will pass but the wording made me think i had to .push() it to the new array
Parker Mitchell
@RParkerM
Nov 05 2015 00:53
@Tedm82 Nope! you just need to set the variable removedFromMyArray to whatever you get from .shift. So in a different example you'd do
var removed = array.shift()
Ted Moxon
@Tedm82
Nov 05 2015 00:53
ahh ok so thats a little different then what I did
@RParkerM I just manually typed in the data instead of using that
Bill
@kirah1314
Nov 05 2015 00:54
@eagle122 still need help? Or did you solve it?
eagle122
@eagle122
Nov 05 2015 00:54
@kirah1314 sorry been a long week
$($(".slot")[0]).html(slotOne);
$($(".slot")[0]).html(slotTwo);
$($(".slot")[0]).html(slotThree);
Bill
@kirah1314
Nov 05 2015 00:54
@eagle122 ah ok, you have to change the 3 0's to 0, 1, 2
eagle122
@eagle122
Nov 05 2015 00:57
@kirah1314 Intresting if you look at the screen shot I had it that way. when you asked me to copy I thought you meant copy what was in instructions to the code so i did that and the test reversed 2 passed Thank you
Bill
@kirah1314
Nov 05 2015 00:59
@eagle122 yes I saw, but I can't see your screenshot very clearly. If you type it manually, it's easy to miss or add an extra character or space and that's where I think was the issue
Joseph Garrett
@CelticJoeG
Nov 05 2015 00:59
having some difficulty with instances and properties in java. Anyone help?
eagle122
@eagle122
Nov 05 2015 01:00
@kirah1314 I just checked it and they are identical so I dont know wht to say. Thank you for your help though
CamperBot
@camperbot
Nov 05 2015 01:00
eagle122 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 310 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 05 2015 01:01
@eagle122 you're welcome, copy/paste your original code here? Let me take a look
eagle122
@eagle122
Nov 05 2015 01:08
@kirah1314 I cant anymore. Unless there is a way to copy it off the screenshot i can type it in
Bill
@kirah1314
Nov 05 2015 01:09
@eagle122 lol ok, try copy/paste the codes you typed and the one provided by the waypoint on a word processor next time. One time I thought I had identical codes but turns out I had an extra space
eagle122
@eagle122
Nov 05 2015 01:10
@kirah1314 ok I will do that next time. Thanks again for your help
CamperBot
@camperbot
Nov 05 2015 01:10
eagle122 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: eagle122 already gave kirah1314 points
Alex
@Sevohan
Nov 05 2015 01:18
Can anyone help me to better understand a sticking point I'm having with referencing parts of an array within an array?
Hugo
@hugoender
Nov 05 2015 01:29

So I have the following HTML code:

<div class="checkbox">
        <input id="item1" type="checkbox"><label class="checkbox-text" for="item1”>stuff1</label>
      </div>
      <div class="checkbox">
        <input id="item2" type="checkbox" disabled><label class="checkbox-text" for="item2”>stuff2</label>
      </div>

and in Javascript, I want to code it so that when a user clicks on the first checkbox input, that the next one gets enabled. This is the code I have:

$('input[type=checkbox]').change(function(){
      $(this).next(‘:checkbox').prop('disabled', false);
});
but it’s not working and when i console.log the .next() item it shows me the clicked item in the chrome console
Parker Mitchell
@RParkerM
Nov 05 2015 01:30
@Sevohan What are you having trouble with?
Hugo
@hugoender
Nov 05 2015 01:30
any ideas on how I can select the next input in the list?
Alex
@Sevohan
Nov 05 2015 01:34
I was working on the Bonfire: Return Largest Numbers in Arrays and I was wondering how I would go about referencing each individual part of an array within another array but I believe I found a way around my problem.
Parker Mitchell
@RParkerM
Nov 05 2015 01:35
@Sevohan If you're referencing an array inside of another array(this is called a multidimensional array), you would do something like array['element of parent array']['element of child array']
Alex
@Sevohan
Nov 05 2015 01:36
Okay thank you @RParkerM !
CamperBot
@camperbot
Nov 05 2015 01:36
sevohan sends brownie points to @rparkerm :sparkles: :thumbsup: :sparkles:
:star: 211 | @rparkerm | http://www.freecodecamp.com/rparkerm
Parker Mitchell
@RParkerM
Nov 05 2015 01:38
@Sevohan you're welcome ^_^
Mike G.
@mgraham134
Nov 05 2015 01:40
Hey, guys. What's the difference between adding by increments of two (even and odd)?
in for loops
```
Parker Mitchell
@RParkerM
Nov 05 2015 01:41
I'm not really sure what you mean, could you give an example?
Mike G.
@mgraham134
Nov 05 2015 01:42
for(var i = 0; i < 10; i += 2){ ourArray.push(i); }
I can increment by two with even numbers like this but what about odd numbers? 1,3,5,7,9
Parker Mitchell
@RParkerM
Nov 05 2015 01:43
You can increment with odd numbers by setting i = 1, and the same code would work
Mateja Trifunovski
@Matko95
Nov 05 2015 01:43
@mgraham134 if you want to increment with 2, your loop starts with i=1
for(var i = 1; i < 10; i += 2){ ourArray.push(i); }
Mike G.
@mgraham134
Nov 05 2015 01:46
@RParkerM @Matko95 okay so that makes sense. Setting i = 0 will work for evens and i = 1 is for odds.
Parker Mitchell
@RParkerM
Nov 05 2015 01:46
Yes that will work :)
Mike G.
@mgraham134
Nov 05 2015 01:47
@RParkerM @Matko95 thanks I appreciate that.
CamperBot
@camperbot
Nov 05 2015 01:47
mgraham134 sends brownie points to @rparkerm and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 212 | @rparkerm | http://www.freecodecamp.com/rparkerm
:star: 442 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Nov 05 2015 01:49
@mgraham134 are you sure you understand why?
Mike G.
@mgraham134
Nov 05 2015 01:52
@Matko95 I believe so. Since i = 1 it pushes the values(odds) starting from 1-10. I get that the final part += 2 is for increments of 2.
Mike G.
@mgraham134
Nov 05 2015 02:00
for(var i = 9; i > 0; i -= 2) { myArray.push(i); }
@Matko95 Here it is backwards. I think I'm getting the hang of it.
:smile:
Nick Kasten
@kastentx
Nov 05 2015 02:08
hey guys! anyone here working on the Pomodoro clock? I'm hitting a bit of a snag with that one..
Nathan
@terakilobyte
Nov 05 2015 02:09
@kastentx what is the snag?
Fatheranime
@Fatheranime
Nov 05 2015 02:09
her is my question Your p element should have the text "View more " (with a space after it)
here is my code: <p class="red-text"> View more <a href="http://www.freecatphotoapp.com">cat photos</a> </p>
what am i doing wrong
Nick Kasten
@kastentx
Nov 05 2015 02:10
I'm curious what the best way to create the circle would be... I'm not sure if it should be a canvas object or maybe just a div with a 50% border radius @terakilobyte
not sure how I want to do the filling over time, but most likely with jQuery
Bill
@kirah1314
Nov 05 2015 02:11
@Fatheranime did you add that new line of code? You should modify the <p> under h2
Imnotgood1
@Imnotgood1
Nov 05 2015 02:11
Hello Everyone!
CamperBot
@camperbot
Nov 05 2015 02:11
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Imnotgood1
@Imnotgood1
Nov 05 2015 02:11
I am on Waypoint: Change the Font Size of an Element. And for the life of me I cant figure out how to do it .
Gulshan Saini
@gulshansainis
Nov 05 2015 02:11
Bonfire: Check for Palindromes
CamperBot
@camperbot
Nov 05 2015 02:11

: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

Nathan
@terakilobyte
Nov 05 2015 02:12
@kastentx I'd experiment with both at this point. Consider this science and you are performing an experiment
Bill
@kirah1314
Nov 05 2015 02:12
@Imnotgood1 paste your codes here so we can take a look?
Nick Kasten
@kastentx
Nov 05 2015 02:12
@mikeotis123 I think I might be able to help. What's up?
Gulshan Saini
@gulshansainis
Nov 05 2015 02:12
function palindrome(str) {
  var newStr="";
  var mystr = str.toLowerCase();

  // Good luck!
  for(i=mystr.length; i > 0; i--){
    newStr = newStr + mystr.charAt(i);
  }

  if(newStr===str){
    return true;
  }
  return false;
}



palindrome("eye");
it is not working and returning false
Imnotgood1
@Imnotgood1
Nov 05 2015 02:13

<style>
.red-text {
color: red; } p {font-size :16px}
</style>

<h2 class="red-text";> CatPhotoAp</h2><p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

<p class="red-text"{font-size:16px};>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>

Gulshan Saini
@gulshansainis
Nov 05 2015 02:13
even when i do console log it show two string as equal
Nick Kasten
@kastentx
Nov 05 2015 02:13
@terakilobyte I appreciate the "learn by doing" approach.. just wanted to see if anyone in the help channel could grant a little insight.
Nathan
@terakilobyte
Nov 05 2015 02:14
@kastentx you'll probably find you have more control with a canvas object
Nick Kasten
@kastentx
Nov 05 2015 02:15
@terakilobyte thanks! I will try both, but I may start with that to see how I like it :smile:
CamperBot
@camperbot
Nov 05 2015 02:15
kastentx sends brownie points to @terakilobyte :sparkles: :thumbsup: :sparkles:
:star: 215 | @terakilobyte | http://www.freecodecamp.com/terakilobyte
Nathan
@terakilobyte
Nov 05 2015 02:15
@kastentx np. Personally, I like drawing to the canvas if I'm trying to do anything that has an animation
seems smoother
Bill
@kirah1314
Nov 05 2015 02:16
@Imnotgood1 <p class="red-text"{font-size:16px};> remove {font-size:16px};
@Imnotgood1 and remove ; from <h2 class="red-text";>
Imnotgood1
@Imnotgood1
Nov 05 2015 02:21
okay but i feel like there is something missing.
especially since nothing happened
JCCoding
@JCCoding
Nov 05 2015 02:22
I don't get Waypoint: Bring your JavaScript Slot Machine to Life
....
Bill
@kirah1314
Nov 05 2015 02:22
@Imnotgood1 move this font-size :16px to .red-text
Matthew Mun
@mattmun
Nov 05 2015 02:22
hey guys
JCCoding
@JCCoding
Nov 05 2015 02:22
$($(".slot")[1]).html(slotOne);

$($(".slot")[2]).html(slotTwo);

$($(".slot")[3]).html(slotThree);
????
Matthew Mun
@mattmun
Nov 05 2015 02:22
a little help with bootstrap please?
Use Font Awesome to add a thumbs-up icon to your like button by giving it a i element with the classes fa and fa-thumbs-up.
  <button class="fa fa-thumbsup btn btn-block btn-primary">Like</button>
Bill
@kirah1314
Nov 05 2015 02:23
@Imnotgood1 the waypoint asks to create a new <p> element and add the provided text then change red-text class to font 16
Matthew Mun
@mattmun
Nov 05 2015 02:23
i added the classes
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:23
hey guys looking for some help or clarity.
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
Nick Kasten
@kastentx
Nov 05 2015 02:24
@mattmun it looks like you have the classes your <i> element needs assigned to your <button> element
Matthew Mun
@mattmun
Nov 05 2015 02:24
@kastentx can you clarify please?
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:24
im learning using conditional logic with if and else statemtns
Matthew Mun
@mattmun
Nov 05 2015 02:24
is it an inline tag i have to add?
Bill
@kirah1314
Nov 05 2015 02:24
@mattmun example <i class="fa fa-amazon"></i>
Rex Schrader
@SaintPeter
Nov 05 2015 02:25
@KyleBiancardi I know that seems a bit confusing - why add and subtract 0, right? The short answer is that we're using the "formula" to illustrate how you would get a random number. The key here is that flip will be either a 1 or a 0, hopefully 50% of the time.
Nick Kasten
@kastentx
Nov 05 2015 02:25
@mattmun yes.. there is a tag missing that will go inside the <button> tags
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:25
there is no explination as to what the (1-0+1))+0
means
JCCoding
@JCCoding
Nov 05 2015 02:25

<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 slotOne;
}

???? "Waypoint: Bring your JavaScript Slot Machine to Life"

I fulfilled 2nd requirement but not 1st

Matthew Mun
@mattmun
Nov 05 2015 02:25
do i remove button and replace it with i?
Rex Schrader
@SaintPeter
Nov 05 2015 02:25
@KyleBiancardi I believe if you look at prior examples with random numbers there is a better explanation of the formula.
Matthew Mun
@mattmun
Nov 05 2015 02:25
or <i button.....>
Nick Kasten
@kastentx
Nov 05 2015 02:26
@mattmun actually, the i tags go inside the button tags
Bill
@kirah1314
Nov 05 2015 02:26
@mattmun <i> and <button> are 2 different things, you can use both :)
Rex Schrader
@SaintPeter
Nov 05 2015 02:26
@KyleBiancardi Let me see if I can find it.
Matthew Mun
@mattmun
Nov 05 2015 02:26
<button><i class="fa fa-thumbsup btn btn-block btn-primary">Like</button></i>
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:26
i have and the only one was easy to understand but then out of nowhere it was multiple numbers being added and subtracts so im jsut not sure why they have it adding one plus one minus one plus one....why do you type that in>
?
thanks @SaintPeter
Matthew Mun
@mattmun
Nov 05 2015 02:27
<button><i class="fa fa-thumbsup btn btn-block btn-primary">Like</i></button>
CamperBot
@camperbot
Nov 05 2015 02:27
kylebiancardi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1396 | @saintpeter | http://www.freecodecamp.com/saintpeter
Nick Kasten
@kastentx
Nov 05 2015 02:27
@mattmun keep the other classes assigned to your button class, but you are getting close!
JCCoding
@JCCoding
Nov 05 2015 02:27
NVM I figured it out
Bill
@kirah1314
Nov 05 2015 02:27
@mattmun <button class="btn btn-block btn-primary"><i class="fa fa-thumbsup">Like</i></button>
Matthew Mun
@mattmun
Nov 05 2015 02:27
oh it just clicked thanks @kastentx @kirah1314
CamperBot
@camperbot
Nov 05 2015 02:27
mattmun sends brownie points to @kastentx and @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 311 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 205 | @kastentx | http://www.freecodecamp.com/kastentx
Nick Kasten
@kastentx
Nov 05 2015 02:28
@mattmun yw! nice job!
Imnotgood1
@Imnotgood1
Nov 05 2015 02:29
its just not working yo
Bill
@kirah1314
Nov 05 2015 02:30
@Imnotgood1 paste your new codes?
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:31
thanks @SaintPeter will you please elaborate.. i get the max and min range now but just looking for clarity on why after we add our range we add 1(what does adding that do) also dont know why we add min after all of that.....any help would be greatly appreciated
CamperBot
@camperbot
Nov 05 2015 02:31
kylebiancardi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: kylebiancardi already gave saintpeter points
Imnotgood1
@Imnotgood1
Nov 05 2015 02:31

<style>
.red-text {
color: red;
} font-size :16px
</style>

<h2 class= "font-size :16px">CatPhotoApp</h2> <p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

<p class="font-size:16px">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>

oh I got it
Bill
@kirah1314
Nov 05 2015 02:32
@Imnotgood1 the class should be "red-text"
Imnotgood1
@Imnotgood1
Nov 05 2015 02:32
i added a p and these {}
in the style
I dont understand why it wasnt working before though
yolo i guess
Rex Schrader
@SaintPeter
Nov 05 2015 02:33
@KyleBiancardi Math.random() returns a number between 0.0 and 1.0 - a decimal. In order to get a number in a range, you have to multiply that decimal by your range and then round to the nearest integer.
@KyleBiancardi Let me break it out
Imnotgood1
@Imnotgood1
Nov 05 2015 02:33
thanks @kirah1314
CamperBot
@camperbot
Nov 05 2015 02:33
imnotgood1 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 312 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 05 2015 02:33
@Imnotgood1 you got it? Great!
Imnotgood1
@Imnotgood1
Nov 05 2015 02:33
@kirah1314 YEA!
mikeotis123
@mikeotis123
Nov 05 2015 02:36
Waypoint: Manipulate Arrays With pop having problems getting through this challenge. Any help would be aprreciated.
Rex Schrader
@SaintPeter
Nov 05 2015 02:36

@KyleBiancardi

Math.floor(Math.random() * (max - min + 1)) + min;

max - min + 1 gives you the "scale" of the number - it will be between min and max. We add 1 because we're using Math.floor
Math.random() * multiplies that scale by the random fraction
Math.floor() Rounds down every time.
+ min adds the "floor" of the range to the number which will be between 0 and max + 1.

Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:37
perfect thank you so much @SaintPeter makes perfect sense now thank u!!
CamperBot
@camperbot
Nov 05 2015 02:37
kylebiancardi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: kylebiancardi already gave saintpeter points
Nick Kasten
@kastentx
Nov 05 2015 02:38
@mikeotis123 what's going on with your array? which part is giving you trouble?
Rex Schrader
@SaintPeter
Nov 05 2015 02:38
@KyleBiancardi so in order to get 0 or 1 we take a "scale" of 2. We multiply it by that fraction between 0.0 and 1.0, and then we round down. If the fraction is less than 0.5, it'll be a 0, if it's greater, it'll be a 1
@KyleBiancardi :D - That's actually the first time I've worked through the math and I think I understand it better myself now.
mikeotis123
@mikeotis123
Nov 05 2015 02:38
using the pop() to get rid of an element in the array
Nick Kasten
@kastentx
Nov 05 2015 02:39
@mikeotis123 OK. What specifically is giving you trouble? Are you getting an error, or is something not behaving like you expected?
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:39
lol im sitter here trying to figure out why i just entered that in....i dunno if im the only one but that explination wouldnt hurt to have in there.... just saying it really clarifies whats happening
i appreciate it
Nick Kasten
@kastentx
Nov 05 2015 02:40
yourArrayName.pop() should "pop" the element off the end of the array @mikeotis123
mikeotis123
@mikeotis123
Nov 05 2015 02:41
i will try that
Nick Kasten
@kastentx
Nov 05 2015 02:41
@mikeotis123 conversely, yourArrayName.push() will allow you to add a new element to the end of the array
mikeotis123
@mikeotis123
Nov 05 2015 02:43

var ourArray = [1,2,3];

var removedFromOurArray = ourArray.pop(); // removedFromOurArray now equals 3, and ourArray now equals [1,2]

var myArray = ["John", 23, ["cat", 2]];

// Only change code below this line.

var removedFromMyArray;

// Only change code above this line.

(function(y, z){return 'removedFromMyArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removedFromMyArray);
//WHERE WOULD I PUT THE POP FUNCTION. SORRY FOR THE ALL CAPS

Nick Kasten
@kastentx
Nov 05 2015 02:44
@mikeotis123 I'll give you a hint. look at the second line of the code you just posted...
Kyle Biancardi
@KyleBiancardi
Nov 05 2015 02:44
lower case m in myArray
Nick Kasten
@kastentx
Nov 05 2015 02:45
@mikeotis123 essentially you are doing the same thing that is being done there, just with "myArray" instead of "ourArray"
mikeotis123
@mikeotis123
Nov 05 2015 02:46
var removedFromMyArray.pop();
Nick Kasten
@kastentx
Nov 05 2015 02:47
@mikeotis123 not quite.. but close! look at how they are using the equals sign on that second line
remember, what you are trying to do is pop the element from the end of myArray and set it to a variable named removedFromMyArray @mikeotis123
Jeremiah Lawrence
@cyberonmymind
Nov 05 2015 02:48
Hey everyone! I need help with Waypoint: Size your Images: im trying to create a class called smaller-image and it to resize the image so that its only 100 pixels
mikeotis123
@mikeotis123
Nov 05 2015 02:49
@kastentx yes
Jeremiah Lawrence
@cyberonmymind
Nov 05 2015 02:49

<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;
}
</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

can anyone help thanks
CamperBot
@camperbot
Nov 05 2015 02:49
if you want to thank someone, put an @ before their name!
Synthia Beauvais
@sbeauvais34
Nov 05 2015 02:50
Screen Shot 2015-11-04 at 9.49.21 PM.png
I am not sure what I am mising here. I added the a element on line 30.
Nick Kasten
@kastentx
Nov 05 2015 02:51
@mikeotis123 yes? does that mean you got it working?
DJ
@qualitymanifest
Nov 05 2015 02:52
@sbeauvais34 the only thing i can think of is get rid of the www. in your link, since they don't have it in the instructions
mikeotis123
@mikeotis123
Nov 05 2015 02:53
yeah i finnaly got past that. it's only been about an hour. angry face!!!!!!!
Synthia Beauvais
@sbeauvais34
Nov 05 2015 02:53
wow. Thank You! @mikeotis123 That worked.
CamperBot
@camperbot
Nov 05 2015 02:53
sbeauvais34 sends brownie points to @mikeotis123 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for mikeotis123
DJ
@qualitymanifest
Nov 05 2015 02:53
@sbeauvais34 although it should work either way
Akaash Vankamamidi
@akaashv92
Nov 05 2015 02:53
You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers.
Can someone help me with this?
Synthia Beauvais
@sbeauvais34
Nov 05 2015 02:54
Right. That’s what I thought. Thank you again. @mikeotis123
CamperBot
@camperbot
Nov 05 2015 02:54
sbeauvais34 sends brownie points to @mikeotis123 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for mikeotis123
Nick Kasten
@kastentx
Nov 05 2015 02:54
@mikeotis123 Awesome! Congrats. glad you got it to work :)
kdizzle966
@kdizzle966
Nov 05 2015 03:00
anyone know why I cant submit my answers? did over 150 of them on work computer but one at home only opens problem, I cant submit it
Ali
@ali-castleford
Nov 05 2015 03:04
hey guys can anyone help me on the factorialize stage - javascript
li ang
@LALH
Nov 05 2015 03:06
Your a element should be a dead link with a href attribute set to "#".what it mean?
Nick Kasten
@kastentx
Nov 05 2015 03:07
@kdizzle966 different browsers?
@kdizzle966 I know I had problems when I was trying to do some of the lessons on IE, but with Chrome I've had no issues
li ang
@LALH
Nov 05 2015 03:09
oh i got it
ahirsi
@ahirsi
Nov 05 2015 03:16
I am stuck here, can any help
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:18
I'm struggling with the same error
"you must add three"
Waypoint: Iterate over Arrays with map
what part of 'return val 3' is not adding three?
Alvis Ng
@vizFlux
Nov 05 2015 03:20
Same here
Tyler Moeller
@TylerMoeller
Nov 05 2015 03:20
@gordondavidescu If you're adding three, you need the '+' return val + 3
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:22
right
no I had that
Alvis Ng
@vizFlux
Nov 05 2015 03:22
@TylerMoeller this solved the problem, but can you help me to understand why + and not *?
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:24
array = array.map(function(val){
return val + 3;
});
You should add three to each value in the array.
that's the error
Alvis Ng
@vizFlux
Nov 05 2015 03:25
cheers
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:25
i don't get it :(
Alvis Ng
@vizFlux
Nov 05 2015 03:28
@gordondavidescu check the terminal with @TylerMoeller approach and you'll understand why. That's how I get to understand by trying * and +
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:30
how do I check the terminal? silly question?
adjeim
@adjeim
Nov 05 2015 03:31
hi everyone, I'm working on Waypoint: Change the CSS of an Element Using jQuery, but I can't seem to figure out why it's not working
Alvis Ng
@vizFlux
Nov 05 2015 03:31
the black bar right underneath "Reset", "Help", "Bug"
adjeim
@adjeim
Nov 05 2015 03:32
I keep getting "Your target1 element should have red text." even though in the display it's rendering correctly
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
});
</script>
I wonder where the mistake might be?
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:33
my terminal says 1,2,3,4,5
I figured it out
Alvis Ng
@vizFlux
Nov 05 2015 03:35
@gordondavidescu right on
DJ
@qualitymanifest
Nov 05 2015 03:35
@adjeim which waypoint is this?
Mach
@vijesh-s
Nov 05 2015 03:36
hey guys
need help
Give the green box a padding of 40px on its top and left side, but only 20px on its bottom and right side.
Gordon Davidescu
@gordondavidescu
Nov 05 2015 03:36
like a dope I was actually using the array.map on the WRONG array
adjeim
@adjeim
Nov 05 2015 03:36
it's Waypoint: Change the CSS of an Element Using jQuery
Mach
@vijesh-s
Nov 05 2015 03:36
and i did this
.green-box {
background-color: green;
padding-top: 40px;
padding-left: 40px
padding-bottom: 20px;
padding-right: 20px;
}
whats wrong here/
?
adjeim
@adjeim
Nov 05 2015 03:36
@qualitymanifest it's Waypoint: Change the CSS of an Element Using jQuery
Bill
@kirah1314
Nov 05 2015 03:38
@vijesh-s it looks good, so what's the waypoint asking you to do?
@vijesh-s n/m I just scrolled up and saw it, can you post the waypoint link?
Mach
@vijesh-s
Nov 05 2015 03:39
it says the left and right padding is still not correct
i re-ordered in this way in the class top, right, bottom, left and it worked. weird
Bill
@kirah1314
Nov 05 2015 03:40
@vijesh-s i see you're missing ; after padding-left: 40px
Mach
@vijesh-s
Nov 05 2015 03:41
oh yeah.. thanks for pointing that out @kirah1314
CamperBot
@camperbot
Nov 05 2015 03:41
vijesh-s sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 313 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Mach
@vijesh-s
Nov 05 2015 03:41
so when i reordered the left was at the end of the class, and hence it worked even without a semicolon
Bill
@kirah1314
Nov 05 2015 03:42
@vijesh-s oh really, I guess that's the script checking for work
@vijesh-s it requires a certain order? which waypoint was this again?
Mach
@vijesh-s
Nov 05 2015 03:43
49
sorry 48
Bill
@kirah1314
Nov 05 2015 03:45
@vijesh-s
adjeim
@adjeim
Nov 05 2015 03:45
please, can anyone help? I still can't figure out why my solution is wrong
Bill
@kirah1314
Nov 05 2015 03:45
one of these?
  1. Waypoint: Inherit Styles from the Body Element Incomplete
  2. Waypoint: Prioritize One Style Over Another
DJ
@qualitymanifest
Nov 05 2015 03:46
@adjeim hold on im about to take a look
Bill
@kirah1314
Nov 05 2015 03:47
@vijesh-s it doesn't look like it's 48 or 49
DJ
@qualitymanifest
Nov 05 2015 03:49
@adjeim can you post all of the code for that waypoint? i just tried what you wrote and it passes for me
i'm just wondering if you changed something else outside of what you pasted here
adjeim
@adjeim
Nov 05 2015 03:50
@qualitymanifest I just now got it to work. I didn't change my answer at all---I clicked down further in the code before pressing submit and it passed this time
I wonder why that would make a difference?
DJ
@qualitymanifest
Nov 05 2015 03:50
@adjeim no idea. weird!
adjeim
@adjeim
Nov 05 2015 03:51
@qualitymanifest thank you for looking into it though
CamperBot
@camperbot
Nov 05 2015 03:51
adjeim sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 331 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Bill
@kirah1314
Nov 05 2015 03:51
weird, i typed 48. and 49. above and it turned into 1. 2.
@vijesh-s I believe you're on waypoint #45 and your original codes worked once I added ; after padding-left: 40px
Mach
@vijesh-s
Nov 05 2015 04:06
@kirah1314 this is my second day here i just some that number 48 on the top right. ? Is that the way to find out which waypoint it is or it some other way
Waypoint: Add Different Padding to Each Side of an Element. its this
Bill
@kirah1314
Nov 05 2015 04:07
@vijesh-s no worries, you can find the number in the map page: http://freecodecamp.com/map
Mach
@vijesh-s
Nov 05 2015 04:09
thanks @kirah1314 .. its waypoint 43
CamperBot
@camperbot
Nov 05 2015 04:09
vijesh-s sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: vijesh-s already gave kirah1314 points
Mach
@vijesh-s
Nov 05 2015 04:14
hi
help again
CamperBot
@camperbot
Nov 05 2015 04:14
no wiki entry for: again
:pencil: click here to create one now!after creating your page type update to reload it here
Mach
@vijesh-s
Nov 05 2015 04:15
Waypoint: Use Clockwise Notation to Specify the Padding of an Element
Use Clockwise Notation to give the ".green-box" class a padding of 40px on its top and left side, but only 20px on its bottom and right side.
.green-box {
background-color: green;
padding: 40px, 20px, 20x, 40px;
}
whats wrong here?
DJ
@qualitymanifest
Nov 05 2015 04:16
This message was deleted
Mach
@vijesh-s
Nov 05 2015 04:16
top, right, bottom, left
I think I figured whats wrong
DJ
@qualitymanifest
Nov 05 2015 04:17
nevermind, that's what you're supposed to do!
Mach
@vijesh-s
Nov 05 2015 04:17
the ',' should be omitted
DJ
@qualitymanifest
Nov 05 2015 04:17
@vijesh-s yeah thats it
Mach
@vijesh-s
Nov 05 2015 04:17
yeah
silly of me to post it here before looking closely :P
thanks @qualitymanifest coming up to help
CamperBot
@camperbot
Nov 05 2015 04:20
vijesh-s sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 334 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
David Franco
@franco3131
Nov 05 2015 04:20
How do you write img src with a class??
DJ
@qualitymanifest
Nov 05 2015 04:22
@franco3131 just add class="whateverClassYouWant" inside your img tag
@vijesh-s no problem! silly of me to respond before thinking about it
Mach
@vijesh-s
Nov 05 2015 04:27
@qualitymanifest not at all.. Its because of kind people like you that I have the confidence that my questions will be answered no matter how silly it is!!
David Franco
@franco3131
Nov 05 2015 04:27
I've tried adding the class but it gives me error message, what am i doint wrong?
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller_image">
Michael Cheung
@m6cheung
Nov 05 2015 04:28
@franco3131 eh img is self closing try doing
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller_image"/>
Jeff
@jbknight
Nov 05 2015 04:28
Hello.. Have a question about using Hash symbol for deadlinks. It says use # to replace href attribute, but when it says " '$' is undefined.. here is my code
<p>Click here for <a href="#">cat photos</a>.</p>
Michael Cheung
@m6cheung
Nov 05 2015 04:28
you should also put a space between class and the src
@jbknight don't put the hash in quotes
DJ
@qualitymanifest
Nov 05 2015 04:29
@jbknight post the rest of your code
@m6cheung you do want to put the hash in quotes
Michael Cheung
@m6cheung
Nov 05 2015 04:31
@qualitymanifest o woops you're right, I usually don't i should fix my bad habits
David Franco
@franco3131
Nov 05 2015 04:34
thanks! oops I was using _ instead of -
CamperBot
@camperbot
Nov 05 2015 04:34
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 05 2015 04:34
@franco3131 your issue is the class name. it's not supposed to be smaller_image. double check the sidebar for what the class name should be
yeah, there you go :)
Franco Benner
@FrancoBenner
Nov 05 2015 04:40
hello
how do i insert code?

:

<style>

h2 {
color: red;
}
</style>

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

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

:

h4r1m4u
@h4r1m4u
Nov 05 2015 04:42
wiki format
CamperBot
@camperbot
Nov 05 2015 04:42

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

h4r1m4u
@h4r1m4u
Nov 05 2015 04:42
@codecodeandcode :point_up:
Craig Morrison
@frogmorton
Nov 05 2015 04:48
Holding down the fort, @h4r1m4u ? LOL
h4r1m4u
@h4r1m4u
Nov 05 2015 04:48
to arms! there are ogres outside the wall!
:D
Craig Morrison
@frogmorton
Nov 05 2015 04:49
Ha! Or giant "bugs", a la "Starship Troopers"
h4r1m4u
@h4r1m4u
Nov 05 2015 04:50
i used to love that movie when it came out. must have seen at least 10 times
Craig Morrison
@frogmorton
Nov 05 2015 04:51
Or agents of the Matrix...
I simply can't type on a smart phone fast enough to answer questions in here. :-P
h4r1m4u
@h4r1m4u
Nov 05 2015 04:53
fair enough. i couldn't either
Craig Morrison
@frogmorton
Nov 05 2015 04:54
Teaching is learning (or solidifying knowledge) as they sometimes say
h4r1m4u
@h4r1m4u
Nov 05 2015 04:55
very true. i've learned a ton answering questions here. especially on the finer points of JS
Mach
@vijesh-s
Nov 05 2015 04:55
+1 @frogmorton
Herman Fassett
@HermanFassett
Nov 05 2015 04:55
;)
Craig Morrison
@frogmorton
Nov 05 2015 04:57
And if I don't know the answer, one of you brainiacs will swoop in and teach me
/ | _ ( - - ) Thanks in advance.
CamperBot
@camperbot
Nov 05 2015 04:58
if you want to thank someone, put an @ before their name!
Craig Morrison
@frogmorton
Nov 05 2015 04:59
Damn, gutter screwed up my home brewed emoticon
*gitter
/ | _ (--)
... Too much like code, I guess. LOL
Joy
@somepulp
Nov 05 2015 05:03
@codecodeandcode are you working on the css/html waypoint?
Parker Mitchell
@RParkerM
Nov 05 2015 05:06
Is there any way to combine multiple string replace operations? I'm working on Bonfire: Convert HTML entities, and I completed it but I took 5 calls to replace
DJ
@qualitymanifest
Nov 05 2015 05:08
@RParkerM FWIW i seem to remember it being the same for me and also wondering if there was a better way
Bill
@kirah1314
Nov 05 2015 05:08
@RParkerM yes, use arrays and a for loop
Craig Morrison
@frogmorton
Nov 05 2015 05:08
This might be a weird question but, is there a optimum method for reverse engineering things? Especially when you may have only the barest notion of where to start (this addresses pretty much all the ziplines)
Herman Fassett
@HermanFassett
Nov 05 2015 05:08
Yes @RParkerM you can chain them if that's what you want...
DJ
@qualitymanifest
Nov 05 2015 05:09
@HermanFassett i chained, and still thought maybe there was a better way
Parker Mitchell
@RParkerM
Nov 05 2015 05:09
@kirah1314 ok, but that's still 5 calls to replace :P I'm trying to figure out if there's a way to not have to call replace 5 times, but I'm not sure if it's possible
Herman Fassett
@HermanFassett
Nov 05 2015 05:09
Using arrays will shorten it
Bill
@kirah1314
Nov 05 2015 05:10
@RParkerM it's just 2 arrays and a for loop
DJ
@qualitymanifest
Nov 05 2015 05:10

@HermanFassett shorter than

return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&apos;").replace(/"/g, "&quot;");

? that's my code

Bill
@kirah1314
Nov 05 2015 05:10
@RParkerM you'll need to use regex
Herman Fassett
@HermanFassett
Nov 05 2015 05:11
Technically that is regex...
But it could be more pretty with arrays and loop
Parker Mitchell
@RParkerM
Nov 05 2015 05:11
Yeah I did it already and used regex, similar to the code @qualitymanifest just linked. I was just curious if there's any way to not call replace more than once(whether it be using an array or just typing it 5 times)
Bill
@kirah1314
Nov 05 2015 05:12
2 arrays, 1 for loop and 1 replace(), is that what you mean?
i have the above same code as @qualitymanifest also lol
but I have an alternative solution
h4r1m4u
@h4r1m4u
Nov 05 2015 05:14
if you put the replace() in a loop, it'll still get called 5 times. that's what @RParkerM is saying and he's right.
Paul Duncan
@paulduncan21
Nov 05 2015 05:14
hey when i uncomment my h1, h2 and p elements it tells me to delete trailing tags
but when i do i get a error
h4r1m4u
@h4r1m4u
Nov 05 2015 05:15
there's no impact on efficiency, imo. and what is 'prettier' is in the eye of the beholder.
DJ
@qualitymanifest
Nov 05 2015 05:15
@paulduncan21 post your code
Paul Duncan
@paulduncan21
Nov 05 2015 05:15

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

<h2>CatPhotoApp</h2>
<!--Hello Paragraph-->

<p>Hello Paragraph</p>

Bill
@kirah1314
Nov 05 2015 05:15
@h4r1m4u true, putting replace() in a loop would make it called 5 times
DJ
@qualitymanifest
Nov 05 2015 05:15
@paulduncan21 you haven't deleted a couple comments
h4r1m4u
@h4r1m4u
Nov 05 2015 05:15
i'm personally fine with the 5 chained replace(). it makes it immediately obvious what's going on. the forloop will complicate it. that said, if i had to do 10 replaces, i'd go with the array and loop solution too
Paul Duncan
@paulduncan21
Nov 05 2015 05:16

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

<h2>CatPhotoApp</h2>
<!--Hello Paragraph-->

<p>Hello Paragraph</p>

Herman Fassett
@HermanFassett
Nov 05 2015 05:16
What do you think of something like this?
function convert(str) {
  var arr = [[/&/g, "&amp;"],[/</g, "&lt;"],[/>/g, "&gt;"],[/"/g, "&quot;"],[/'/g, "&apos;"]];
  arr.forEach(function(a) { str = str.replace(a[0], a[1])});
  return str;
}
DJ
@qualitymanifest
Nov 05 2015 05:16
@paulduncan21 still haven't deleted a couple comments
h4r1m4u
@h4r1m4u
Nov 05 2015 05:17
@HermanFassett it's more complicated to understand what the code does upon a quick look. the chained replace() are more obvious
Paul Duncan
@paulduncan21
Nov 05 2015 05:17
Bill
@kirah1314
Nov 05 2015 05:18
can that bonfire even be done without using 5 replace()?
DJ
@qualitymanifest
Nov 05 2015 05:18
@paulduncan21 are you supposed to leave CatPhotoApp and Hello Paragraph commented?
Micheal Hall
@michealhall
Nov 05 2015 05:18
You can also reduce it to one replace() call using a reference object with the charCodes and their values ... the replace() method allows for a function that will return the content which gives you a chance to evaluate it and return what you want.
DJ
@qualitymanifest
Nov 05 2015 05:19
@HermanFassett i just don't see how that shortens it...?
Herman Fassett
@HermanFassett
Nov 05 2015 05:19
:P
Parker Mitchell
@RParkerM
Nov 05 2015 05:19
Yeah @HermanFassett that's pretty much what I was looking for! I was looking at that link too :)
I guess it's not a big deal to call replace a bunch, but I was curious
Herman Fassett
@HermanFassett
Nov 05 2015 05:20
If more html entities were involved, loops and arrays/objects would be a better way to go
Paul Duncan
@paulduncan21
Nov 05 2015 05:21
they want me to umcomment it
un*
DJ
@qualitymanifest
Nov 05 2015 05:22
@paulduncan21 CatPhotoApp and Hello Paragraph are still commented
@HermanFassett alright that makes sense
Paul Duncan
@paulduncan21
Nov 05 2015 05:22
do i remove -->?
h4r1m4u
@h4r1m4u
Nov 05 2015 05:23
@paulduncan21 remove both <!-- and -->
DJ
@qualitymanifest
Nov 05 2015 05:23
<!-- and --> comments out the "and" i just wrote there
Paul Duncan
@paulduncan21
Nov 05 2015 05:24
Thank you! guys
CamperBot
@camperbot
Nov 05 2015 05:24
if you want to thank someone, put an @ before their name!
llsseaw150
@llsseaw150
Nov 05 2015 05:31
how do i call a class inside an image tag? i'm trying to resize the image in number 22.
Herman Fassett
@HermanFassett
Nov 05 2015 05:32
<img class="classname">
llsseaw150
@llsseaw150
Nov 05 2015 05:35
@HermanFassett Thanks
CamperBot
@camperbot
Nov 05 2015 05:35
llsseaw150 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 523 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Craig Morrison
@frogmorton
Nov 05 2015 05:38
So aside from trying to pseudo code a solution, user story by user story, is it "cheating" to find tutorials on a particular problem?... In that sense, I'd rather explain my thinking to someone and be given gentle hints as to my mistakes, and / or what I need to consider. I'm sorry that my question isn't more specific.
Bill
@kirah1314
Nov 05 2015 05:40
@frogmorton are you learning through the tutorials?
Parker Mitchell
@RParkerM
Nov 05 2015 05:40
I don't think so.. You're still learning the material. I feel like FCC teaches the waypoints in a tutorial-like way
Craig Morrison
@frogmorton
Nov 05 2015 05:45
Well, I've gone through all the easy stuff, and even through the intermediate bonfires... I am to the front end ziplines
Perhaps all the hand holding is finished LOL
Bill
@kirah1314
Nov 05 2015 05:46
@frogmorton yup! I really enjoyed the ziplines though. There's a template you could use for first zipline, and from there just dabble with it
Craig Morrison
@frogmorton
Nov 05 2015 05:47
I've done that one ;-)
Bill
@kirah1314
Nov 05 2015 05:48
so you're on the quote machine?
Craig Morrison
@frogmorton
Nov 05 2015 05:48
Yes, if I go chronologically
Bill
@kirah1314
Nov 05 2015 05:49
ah ok, for this you could use your own quotes or get quotes through API
Craig Morrison
@frogmorton
Nov 05 2015 05:50
Right, I'm considering both. I'd learn more with the api version, but I suppose it's not required
Bill
@kirah1314
Nov 05 2015 05:51
I believe it took me a week to complete it
since I was new to API and twitter button
Craig Morrison
@frogmorton
Nov 05 2015 05:52
I've already built a randomizer program in JS that randomized chords & scales for music practice... That was done with static arrays
I'm new to those things too
Bill
@kirah1314
Nov 05 2015 05:53
ok then consider using API
Craig Morrison
@frogmorton
Nov 05 2015 05:53
I'm leaning that way
Rob Smith
@smit293
Nov 05 2015 05:54
Anyone done the Waypoint for reversing arrays recently? I am trying to do it and the output did reverse and I used array.reverse but it's showing a red X on "You should use the reverse method"?
Craig Morrison
@frogmorton
Nov 05 2015 05:54
Json was barely touched in the course, so it's by no means solid in my mind
Bill
@kirah1314
Nov 05 2015 05:54
lol, I looked through my quote zipline and it's really not that complicated. But at the time when I first did it, it was complicated. I definitely pulled some of my hair out
Craig Morrison
@frogmorton
Nov 05 2015 05:55
@kirah1314 been there on other bonfires... Haha
Bill
@kirah1314
Nov 05 2015 05:56
@frogmorton I did go back and refactored it several times, so I would suggest don't worry too much about the html/css part. You can always go back and make it look nicer
Rob Smith
@smit293
Nov 05 2015 05:56
If it helps my code is array.reverse(function(){});
Bill
@kirah1314
Nov 05 2015 05:57
@smit293 is that all you used?
Craig Morrison
@frogmorton
Nov 05 2015 05:57
Right. The functionality is most important
Rob Smith
@smit293
Nov 05 2015 05:57
@kirah1314 Yes and it gave me the output of reversing the array so not sure what's wrong
Bill
@kirah1314
Nov 05 2015 05:58
@smit293 array.reverse();
Rob Smith
@smit293
Nov 05 2015 05:59
AH! thought I tried that already thanks!
CamperBot
@camperbot
Nov 05 2015 05:59
if you want to thank someone, put an @ before their name!
Rob Smith
@smit293
Nov 05 2015 05:59
@kirah1314 bot told me to thank you proper! haha
CamperBot
@camperbot
Nov 05 2015 05:59
smit293 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 314 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 05 2015 05:59
@smit293 yw haha
Craig Morrison
@frogmorton
Nov 05 2015 06:01
I suppose the json call isn't that detailed, although getting a username secret key pair is necessary, right? @kirah1314
Bill
@kirah1314
Nov 05 2015 06:02
@frogmorton I think that depends on which API you plan to use. A key isn't required on many API's. I didn't need a key
Craig Morrison
@frogmorton
Nov 05 2015 06:03
Good to know
I had been making good, regular progress for a few months and was very JS focused going through the bf's... Then I suddenly found myself struggling with bootstrap (also new to me), and took WAY too much time to do the first zipline... I guess I got kind of mentally "stuck"
Bill
@kirah1314
Nov 05 2015 06:07
@frogmorton when I was working on the weather zipline, I thought a key was required but then I found an API that didn't require a key
@frogmorton lol I think you were just trying to make the first zipline look perfect, I was doing that too. But I've cleaned up my first zipline 10 times or more after I finished it the first time
Paul Duncan
@paulduncan21
Nov 05 2015 06:11
hello is this correct?
<h2> class="red-text">CatPhotoApp</h2>
Bill
@kirah1314
Nov 05 2015 06:12
@paulduncan21 you have an extra >
Paul Duncan
@paulduncan21
Nov 05 2015 06:12
ohhh ok i see it thanks
CamperBot
@camperbot
Nov 05 2015 06:12
if you want to thank someone, put an @ before their name!
Craig Morrison
@frogmorton
Nov 05 2015 06:12
I tend to be a bit of a perfectionist... The other thing is, I had some nice pair programming experiences in the bonfires, but that seems to have dried up. I have all these people on my screen hero, but only communicate with a few.
Bill
@kirah1314
Nov 05 2015 06:12
<h2> this will close h2
Craig Morrison
@frogmorton
Nov 05 2015 06:14
To be fair, I'm in Japan and most people in western countries aren't online when I am
Bill
@kirah1314
Nov 05 2015 06:14
@frogmorton yeah same here, all (or most) of the people I met as pair programming are gone
@frogmorton not sure if you already use it but http://www.w3schools.com/ was a good resource I used for ziplines.
@frogmorton font awesome is great for icons, check it out
Danil Belkov
@dbellkoff
Nov 05 2015 06:22
Hi all! pls help me, why i cant to be tested Waypoint: Nest an Anchor Element within a Paragraph my code <p>View more <a href="http://freecatphotoapp.com">cat photos</a></p>
sry for my english :smile:
Bill
@kirah1314
Nov 05 2015 06:24
@dbellkoff you have to modify the <p> under <h2> instead of adding a new line of codes
Noman Karim
@nomankarim
Nov 05 2015 06:25
good morning campers
i have started object oriented programming in javascript and i am stuck with properties and methods please help
Craig Morrison
@frogmorton
Nov 05 2015 06:28
@kirah1314 I use both of those resources heavily... Thanks for your help. I gotta get to a meeting now... take care
CamperBot
@camperbot
Nov 05 2015 06:28
frogmorton sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 315 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Nov 05 2015 06:29
@frogmorton ok cool, take care there and you know you still have all the chatrooms if you need any help including a zipline chatroom :)
Eude Lesperance
@lkeude96
Nov 05 2015 06:40
I accidentally created a invite loop in one of the bonfires and now it keep freezing everytime on this bonfire. There’s no way I can click the reset button someone help
please
Danil Belkov
@dbellkoff
Nov 05 2015 06:41

@kirah1314 i create new line with

<p>View more <a href="http://freecatphotoapp.com">cat photos</a></p>

all my html code (without CSS)

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

<p>View more <a href="http://freecatphotoapp.com">cat photos</a></p>

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

<p class="red-text»> Text1 </p>
<p class="red-text»> Text2 </p>
Hans van Riet
@hansinla
Nov 05 2015 06:42
@lkeude96 empty cache and relaunch your browser
@nomankarim What’s your specific question?
Danil Belkov
@dbellkoff
Nov 05 2015 06:49
lol #FreeCodeCamp/FreeCodeCamp#4145
need add «www» on link,
like
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Shyamaprasad Patra
@shyamaprasad
Nov 05 2015 07:02
@dbellkoff : all the url will not have the "www" or there might be mixed
Elliott McNary
@bighitbiker3
Nov 05 2015 07:02
function mutation(arr) {

  y = arr.slice(1, 2)
  .toString()
  .toLowerCase()
  .split('');

  x = arr.slice(0, 1)
  .toString()
  .toLowerCase()
  .split('');

  var n = [];

    for (i=0; i < x.length; i++) {
    n[i] = x.indexOf(y[i]); 
    }

     for (i=0; i < x.length; i++) { 
      if (n[i] == -1) {
          return false;}
        else {
          return true;}

     }

}

mutation(["hello", "hey"]);
Can someone please tell me why my n[i] in my if else isn't looping to n[3]?
Chethan Bhat
@chethanbhat
Nov 05 2015 07:04
Hello guys
can someone tell me why this code isn't working
Waypoint: Give your JavaScript Slot Machine some Stylish Images
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
Sabe Barker
@SabeBarker
Nov 05 2015 07:07
no [] for $($('.slot')[1]) @chethanbhat
Chethan Bhat
@chethanbhat
Nov 05 2015 07:08
hey i added
still not working
let me paste again
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
i dunno
somehow chat ir removing by 1
Sabe Barker
@SabeBarker
Nov 05 2015 07:08
just for future reference @chethanbhat
explain format
CamperBot
@camperbot
Nov 05 2015 07:08

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

Chethan Bhat
@chethanbhat
Nov 05 2015 07:10
~~~ $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
```
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">'); $($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">'); $($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
Sabe Barker
@SabeBarker
Nov 05 2015 07:11
your code is working for me so the problem is somewhere else... cope your code, then click the reset button to clear your code. Then paste back in your code.
cope = copy
Chethan Bhat
@chethanbhat
Nov 05 2015 07:15
thank you @phoenixlaef
CamperBot
@camperbot
Nov 05 2015 07:15
chethanbhat sends brownie points to @phoenixlaef :sparkles: :thumbsup: :sparkles:
:star: 201 | @phoenixlaef | http://www.freecodecamp.com/phoenixlaef
Chethan Bhat
@chethanbhat
Nov 05 2015 07:15
i reset the code
not it is proper
Sabe Barker
@SabeBarker
Nov 05 2015 07:15
no problems :)
Chethan Bhat
@chethanbhat
Nov 05 2015 07:15
now*
Sabe Barker
@SabeBarker
Nov 05 2015 07:16
excellent!
Noman Karim
@nomankarim
Nov 05 2015 07:18

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

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

};

dont understand what to do here
waypoint make object properties private
Osazeme Usen
@osazemeu
Nov 05 2015 07:20
make the properties of the object private in javascript
Noman Karim
@nomankarim
Nov 05 2015 07:21
how?
Markus Kiili
@Masd925
Nov 05 2015 07:26
@nomankarim That function is a constructor that can make Bikes. If you declare a variable like this.speed , it is public and can be accessed using dot notation like myBike.speed. If you declare a variable like var speed, it can only be accessed inside the constructor and is therefore private.
Paul Duncan
@paulduncan21
Nov 05 2015 07:26
img
.smaller-image {
width: 100px;
}
is that correct?
Danil Belkov
@dbellkoff
Nov 05 2015 07:30

@paulduncan21

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

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

or

<style>
  img {
    width: 100px;
  }
</style>

<img src="https://bit.ly/fcc-relaxing-cat»>
Markus Kiili
@Masd925
Nov 05 2015 07:33
@nomankarim Seems that addUnit is to be used only inside the constructor so it doesn't need this in front of it. getSpeed should be public so it needs this: this.getSpeed=...
Jeremiah Lawrence
@cyberonmymind
Nov 05 2015 07:47
Hi paul @paulduncan21 soorry for late response but neither worked
gongash17
@gongash17
Nov 05 2015 08:13
Hi guys. Waypoint: Add Font Awesome Icons to our Buttons. im having difficulties in this challenge.can someone help me?
Markus Kiili
@Masd925
Nov 05 2015 08:15
@gongash17 Just ask, this is help channel.
gongash17
@gongash17
Nov 05 2015 08:19
in Waypoint: Add Font Awesome Icons to our Buttons challenge . im not sure what to do.
i think i need to add fa and fa-thumbs-up on the class of the like button but i dont know what i need to do after
Markus Kiili
@Masd925
Nov 05 2015 08:24
@gongash17 Inside the button element, make a new <i></i> element before the text 'Like' and add the class to the opening <i> tag.
gongash17
@gongash17
Nov 05 2015 08:29
@Masd925 ty so much :)
Markus Kiili
@Masd925
Nov 05 2015 08:36
@gongash17 You're welcome.
Kostya
@lllkoslll
Nov 05 2015 09:10
what does it mean "your image should have a 'src attribute that points to the image " ?
i write <img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg">
but it doesn't pass me farther
Abs Duls
@AbsOnGithub
Nov 05 2015 09:14
Hey Guys.. I think I got confuse a bit...
Elliott McNary
@bighitbiker3
Nov 05 2015 09:17
@lllkoslll what's your whole code
Kostya
@lllkoslll
Nov 05 2015 09:19

@bighitbiker3 <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;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg">

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

'''

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

CamperBot
@camperbot
Nov 05 2015 09:22
:bulb: to format code use backticks! ``` more info
Danil Belkov
@dbellkoff
Nov 05 2015 09:22
@lllkoslll try
<img src="https://bit.ly/fcc-relaxing-cat»>
Kostya
@lllkoslll
Nov 05 2015 09:23
@dbellkoff :clap: thanks a lot !
CamperBot
@camperbot
Nov 05 2015 09:23
lllkoslll sends brownie points to @dbellkoff :sparkles: :thumbsup: :sparkles:
:star: 46 | @dbellkoff | http://www.freecodecamp.com/dbellkoff
Danil Belkov
@dbellkoff
Nov 05 2015 09:24
@lllkoslll You're welcome :)
Kostya
@lllkoslll
Nov 05 2015 09:25
<img src="https://bit.ly/fcc-relaxing-cat">
it works )
Ankit Panwar
@coderNoob
Nov 05 2015 09:40

The image doesn't seem to be working. Why? It just displays a broken image. I tried with different users.

$.getJSON(url + user + "?callback=?", function(json) {
    $("#testSome").html(json._links.self);
    $("#testImage").html("<img src='" + json.logo + "'>");
  });

@DustInCompetent

Robert Uivarosi
@URobert
Nov 05 2015 09:44
Hi everyone
Dustin Frank
@DustInCompetent
Nov 05 2015 09:44
Hi @URobert
Robert Uivarosi
@URobert
Nov 05 2015 09:44
just a quick question
can i style a html <h3> element
Dustin Frank
@DustInCompetent
Nov 05 2015 09:44
sure
Ankit Panwar
@coderNoob
Nov 05 2015 09:44
Yes you can
Robert Uivarosi
@URobert
Nov 05 2015 09:44
to change the background of the text
basically i`m overlaying some text on a wallpaper
and I would like the text to stickout
and not just by changing the color and font of the text
can I get a hint? :D
Dustin Frank
@DustInCompetent
Nov 05 2015 09:46
you can style an h3 element just like any other text or div, add a background-color or just a background (add an image)
Robert Uivarosi
@URobert
Nov 05 2015 09:46
yup
just cont to doing that
Robert Uivarosi
@URobert
Nov 05 2015 09:47
I just need to work on the container surrounding the text
thanks @coderNoob @DustInCompetent
CamperBot
@camperbot
Nov 05 2015 09:47
urobert sends brownie points to @codernoob and @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 248 | @codernoob | http://www.freecodecamp.com/codernoob
:star: 148 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 05 2015 09:47
then put it in a <div> and style that
Robert Uivarosi
@URobert
Nov 05 2015 09:50
I went with <div class="col-xs-9">
worked like a charm
Dustin Frank
@DustInCompetent
Nov 05 2015 09:51
:+1:
CamperBot
@camperbot
Nov 05 2015 09:51

:point_right: pair programming and why it is special [wiki]

Pair Programming is an Agile Development practice that was born out of the Extreme Programming movement.

Working as a team of [exactly] two, at a single computer, the pair will slide the keyboard and mouse back-and-forth throughout a "pairing session". This increases the code quality by providing a "greater than the sum of its parts" effect of two developers working on a single problem domain.

The increase in quality of the code, combined with the effect of knowledge and understanding on the project being spread across multiple developers, can produce a large savings in cost on the project as a whole.

In a Test Driven Development (TDD) shop, it is most common for each member of the pair to take turns a) writing a test and b) writing code to pass the test. This "ping pong" yields a cumulative effect on the overall quality of the final product.

To be most effective it is important that pairs are intermixed; not the same couple of developers always working together.

Pair programming is considered to be very "social". It can be akin to a marriage because you learn to cooperate with a peer in a close, give-and-take relationship. As such it is often very difficult to become comfortable with pair programming. Some developers simply NEVER feel quite at-home. In the end, the willingness to share, be a bit vulnerable and work cooperatively toward a better product will make you a far better developer (and a better person overall).

:pencil: read more about pair programming and why it is special on the FCC Wiki

Dustin Frank
@DustInCompetent
Nov 05 2015 09:51
What's that about "Extreme Programming" ?
sounds interesting :smile:
Dustin Frank
@DustInCompetent
Nov 05 2015 09:59
Thanks, @dbellkoff
CamperBot
@camperbot
Nov 05 2015 09:59
dustincompetent sends brownie points to @dbellkoff :sparkles: :thumbsup: :sparkles:
:star: 47 | @dbellkoff | http://www.freecodecamp.com/dbellkoff
Ca Chen
@birdca
Nov 05 2015 10:03
need help in "Waypoint: Give your JavaScript Slot Machine some Stylish Images"
I enter:
$($('.slot')[0]).html('<img src = "' + images[slotOne - 1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo - 1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree - 1] + '">');
but still get wrong in "Use the provided code three times. One for each slot."
I'm not sure where did i go wrong...?
Ankit Panwar
@coderNoob
Nov 05 2015 10:04
@dbellkoff LOL
Danil Belkov
@dbellkoff
Nov 05 2015 10:05
@coderNoob "debug or die" :D
Dustin Frank
@DustInCompetent
Nov 05 2015 10:05
$($('.slot')[0]).html('<img src = "' + images[slotOne - 1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo - 1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree - 1] + '">');
ftfy
$('.slot')1 see this?
Robert Uivarosi
@URobert
Nov 05 2015 10:05
$($('.slot')1).html('<img src = "' + images[slotTwo - 1] + '">'); typo
@birdca second line
Ankit Panwar
@coderNoob
Nov 05 2015 10:05
@DustInCompetent Can you help me with the image problem I posted ?
Ca Chen
@birdca
Nov 05 2015 10:05
actually i type $('.slot')[ 1 ], but it change here
Dustin Frank
@DustInCompetent
Nov 05 2015 10:06
i haven't done that waypoint but note that you forgot the parenteses on that 1: $($('.slot')1) (line 2)
Ca Chen
@birdca
Nov 05 2015 10:07
I did write $('.slot')[ 1 ], but it becomes to be a hyperlink here
Ankit Panwar
@coderNoob
Nov 05 2015 10:09
The image doesn't seem to be working. Why? It just displays a broken image. I tried with different users.
$.getJSON(url + user + "?callback=?", function(json) {
    $("#testSome").html(json._links.self);
    $("#testImage").html("<img src='" + json.logo + "'>");
  });
Ca Chen
@birdca
Nov 05 2015 10:11
$($('.slot')[0]).html('<img src = "' + images[slotOne - 1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo - 1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree - 1] + '">');
h4r1m4u
@h4r1m4u
Nov 05 2015 10:12
@coderNoob do you have it codepen?
h4r1m4u
@h4r1m4u
Nov 05 2015 10:13
@birdca remove the spaces around the - operator, eg. [slotOne - 1] should be [slotOne-1]. in practice it doesn't matter, but the FCC waypoint doesn't like the spaces
@birdca everything else is fine and should pass
Ca Chen
@birdca
Nov 05 2015 10:14
@h4r1m4u you are right!!!!!
@h4r1m4u thank u sooooo much!
CamperBot
@camperbot
Nov 05 2015 10:15
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 05 2015 10:15
@birdca you're welcome. yeah, it's silly that the waypoint wants it that way
Ankit Panwar
@coderNoob
Nov 05 2015 10:16
@h4r1m4u How do I get the logos of the users?
Ca Chen
@birdca
Nov 05 2015 10:16
@h4r1m4u : )
h4r1m4u
@h4r1m4u
Nov 05 2015 10:16

@coderNoob you should examine the structure of the json that's returned to you. you're referring to it in an incorrect way. use this:

$("#testImage").html("<img src='" + json.stream.channel.logo + "'>");

instead of

$("#testImage").html("<img src='" + json.logo + "'>");
Dustin Frank
@DustInCompetent
Nov 05 2015 10:17
json.logo returns undefined
Ankit Panwar
@coderNoob
Nov 05 2015 10:18
@h4r1m4u Yea just noticed it. Thanks.
CamperBot
@camperbot
Nov 05 2015 10:18
codernoob sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 150 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Nov 05 2015 10:18
thank h4r1m4u too. [fixed]
CamperBot
@camperbot
Nov 05 2015 10:18
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 05 2015 10:18
@coderNoob the json is 'nested'. there are objects within objects, so you just need the right path the logo property
Ankit Panwar
@coderNoob
Nov 05 2015 10:18
@h4r1m4u My bad. Thanks.
CamperBot
@camperbot
Nov 05 2015 10:18
codernoob sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 526 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 05 2015 10:18
:thumbsup:
Ankit Panwar
@coderNoob
Nov 05 2015 10:21
FCC has no logo?
Hmm
Logos can be displayed only for the online twitchers?
h4r1m4u
@h4r1m4u
Nov 05 2015 10:24
the fcc twitch channel should have a logo
Ankit Panwar
@coderNoob
Nov 05 2015 10:26
It's just not displaying though
and api objects has the logo only for the online twitchers
h4r1m4u
@h4r1m4u
Nov 05 2015 11:05
@coderNoob you're currently getting the information about 'streams'. look up the api call for 'users'
Eude Lesperance
@lkeude96
Nov 05 2015 11:19
thanks
CamperBot
@camperbot
Nov 05 2015 11:19
if you want to thank someone, put an @ before their name!
Eude Lesperance
@lkeude96
Nov 05 2015 11:19
thank you @hansinla
CamperBot
@camperbot
Nov 05 2015 11:19
lkeude96 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 568 | @hansinla | http://www.freecodecamp.com/hansinla
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 11:44

Can someone help me understand what's going on here? When you LOAD the page and click the start button...the computer plays..the user response..and everthing (based on the console.logs) seems OK. HOWEVER, what if you try to start the game again not by reloading the page...but by clicking the start button? Ah ha...it doesn't work.

What exactly is the difference here between reloading the page and simply pressing the start button?

sagar
@sagarbhaila
Nov 05 2015 12:33
Give elements with the red-text class a font-size of 16px.
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:34
.red-text{
font-size: 16px;
}
h4r1m4u
@h4r1m4u
Nov 05 2015 12:37
@TheHighPriestess did you update the codepen? if i load the page, the game doesn't run for me automatically. i have to click on the start button
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:41
@h4r1m4u Yes, I forked it...and started over.
h4r1m4u
@h4r1m4u
Nov 05 2015 12:41
ok
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:41
After you load the page and click start...it works...
up to a point, of course, because i'm not done with it...BUT
if you try to simply restart the game by clicking start again...it goes haywire
it will say both "true" and "false"
I'm trying to understand why exactly reloading the page is different from clicking start
because, naturally, i want the user to be able to start over...
without refreshing the page
h4r1m4u
@h4r1m4u
Nov 05 2015 12:45
something seems to be accumulating and not resetting properly when you click the start button, because this gets logged as many times as i played:
This is the registerClick function
false
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:46
hmmm
ok...let me take a look at it.
@h4r1m4u thank you
CamperBot
@camperbot
Nov 05 2015 12:46
thehighpriestess sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 531 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Daniel de Waard
@danieldewaard
Nov 05 2015 12:47
It could be to do with the scope of various variables in different functions, just a thought
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:48
@h4r1m4u so..it never changes back to true?
Manan Kalra
@manankalra
Nov 05 2015 12:49
<form>
<input type="text" class="form-control">
<button type="submit" class="btn btn-primary">
<i class="fa fa-paper-plane"></i> Submit
</button>
</form>
h4r1m4u
@h4r1m4u
Nov 05 2015 12:50
@TheHighPriestess if i played 5 rounds, the same text gets logged 5 times. the first will be true, the other 4 false
Manan Kalra
@manankalra
Nov 05 2015 12:50
There's no bug here.
Still the site says, that I didn't close my <i> tag
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:50
@h4r1m4u yeah...i just saw that.
h4r1m4u
@h4r1m4u
Nov 05 2015 12:50
@TheHighPriestess the amount of text increases with each new 'start'
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:52
@h4r1m4u well..it's supposed to..but i see that it's not happening
oh ok..because it keep resetting it to zero
i guess i should use another button to restart the game
h4r1m4u
@h4r1m4u
Nov 05 2015 12:56
i'm a little confused about what the different functions (startSimon(), newRound(), activateSimonBoard()) are meant to do, so i'm finding it difficult to see what the issue might and what's actually not working
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:57
@h4r1m4u me too
Let me work on it some more...because now I'm confused as well
h4r1m4u
@h4r1m4u
Nov 05 2015 12:57
roger that
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 12:58
maybe the problem will resolve itself lol
not likely..but we can hope
h4r1m4u
@h4r1m4u
Nov 05 2015 12:58
:D in ghost in the machine we trust
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 13:01
I promise not to come back unless I have a detailed explanation of what's supposed to be happening :)
Russell
@rwyatt86
Nov 05 2015 13:13
Good Morning everyone!
Could someone assist me on some JavaScript code?
<script>
function runSlots(){
var slotOne = 1;
var slotTwo = 2;
var slotThree = 3;

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

// Only change code below this line.

function runSlots() {

return Math.floor(Math.random() * (slotThree - slotOne + 1)) + slotOne;

}

// Only change code above this line.

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

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
$(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
}
return [slotOne, slotTwo, slotThree];
}

$(document).ready(function(){
$(".go").click(function(){
runSlots();
});
});
</script>
I am working on Waypoint 42 in the JavaScript section
and I cannot for the life of me figure out how to run the Math.floor(Math.random() * (3 - 1 +1) ) + 1 three times
Any help would be greatly appreciated
h4r1m4u
@h4r1m4u
Nov 05 2015 13:19

@rwyatt86 by now you should understand how to assign values to a variable. for example:

slotOne = "'Tis a beautiful slot.";

would store the "'Tis a beautiful slot." string in the slotOne variable. knowing this, how can you store the result of the random number formula in the slotOne, slotTwo and slotThree variables?

Rolands Jegorovs
@Rolandisimo
Nov 05 2015 13:22
Hey guys could someone help me with connecting to a Modulus MongoDB ? I have exhausted all options. :(

I'm connecting via server.js file

mongoose.connect('mongodb://user:userpass@apollo.modulusmongo.net:27017/wo5Puzum');

but all I get is a connection timeout

Russell
@rwyatt86
Nov 05 2015 13:25
var slotOne = Math.floor(Math.random() * 1); ?
h4r1m4u
@h4r1m4u
Nov 05 2015 13:27
@rwyatt86 close, but not quite. will this formula generate a random number between 1 and 3?
(which is what you want because each slot can display either the number 1, 2, or 3)
(and two slots can display the same number too, e.g. 3 / 3 / 2, or 1 / 3 / 1)
Russell
@rwyatt86
Nov 05 2015 13:28
var slotOne = Math.floor(Math.random() * 4)
h4r1m4u
@h4r1m4u
Nov 05 2015 13:29
don't over think it. you already know what the formula should look like
Russell
@rwyatt86
Nov 05 2015 13:33
Got it. Thank you! var slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1; and that would be ran three times. Like it was telling me to do.
CamperBot
@camperbot
Nov 05 2015 13:33
if you want to thank someone, put an @ before their name!
Russell
@rwyatt86
Nov 05 2015 13:34
Thanks @h4r1m4u
CamperBot
@camperbot
Nov 05 2015 13:34
rwyatt86 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 532 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 05 2015 13:34
yeah, one time for each of the slot variables! nice work :clap:
Rolands Jegorovs
@Rolandisimo
Nov 05 2015 13:35

Hey guys could someone help me with connecting to a Modulus MongoDB ? I have exhausted all options. :worried:

I'm connecting via server.js file

mongoose.connect('mongodb://user:userpass@apollo.modulusmongo.net:27017/wo5Puzum');

but all I get is a connection timeout

h4r1m4u
@h4r1m4u
Nov 05 2015 13:36
sorry @Rolandisimo wish i could help, but i haven't gotten that far yet
Pranay Kothapalli
@kotAPI
Nov 05 2015 13:36
Me neither
h4r1m4u
@h4r1m4u
Nov 05 2015 13:37
perhaps @SaintPeter can help when he comes online
Nathan
@terakilobyte
Nov 05 2015 13:37
@Rolandisimo you are in fact supplying your username and password in the real connection implementation?
frostmere
@removed~frostmere
Nov 05 2015 13:42
I must have re-read the instructions maybe more than 10 times now, what am I supposed to do in Waypoint: Make Object Properties Private?
Jeremy Roe
@jeremyroe
Nov 05 2015 13:44
@Elfborne - They are trying to teach you how to have properties of this object that are visible from outside the object vs those that are private only due to scope. There is an example shown that should help. Effectily you attach a public property using “this” and you hide a private property behind a function with a “var” which keeps it hidden inside that function scope
does that hlep?
The tests help deteremine what you’re after also - in this case “speed” and “addUnit” should be private and thus return “undefined” when they attempt to reach it publicly while “getSpeed” shoudl work because it is public
Rolands Jegorovs
@Rolandisimo
Nov 05 2015 13:48
@terakilobyte of course not :)
@h4r1m4u Ok, no problem.
Nathan
@terakilobyte
Nov 05 2015 13:50
@Rolandisimo lol, just want to make sure you aren't actually passing 'user:userpass@...' in instead of 'rolandisimo:fccrocks@...'
Rolands Jegorovs
@Rolandisimo
Nov 05 2015 13:51
@terakilobyte All good. Except for not being able to connect to MongoDB ;(
frostmere
@removed~frostmere
Nov 05 2015 13:51
@jeremyroe Ah, thanks :)
CamperBot
@camperbot
Nov 05 2015 13:51
elfborne sends brownie points to @jeremyroe :sparkles: :thumbsup: :sparkles:
:star: 254 | @jeremyroe | http://www.freecodecamp.com/jeremyroe
Nathan
@terakilobyte
Nov 05 2015 13:51
@Rolandisimo have you tried pinging the server?
@Rolandisimo because, I'm getting https://www.dropbox.com/s/89730qhzvrutrtq/Screenshot%202015-11-05%2005.53.07.png though they could have it configured not to respond to a ping
Rolands Jegorovs
@Rolandisimo
Nov 05 2015 13:55
@terakilobyte Yeah, I tried and got the same response. However, I previously tried Mongolab. Pinged the server - everything was fine. Started the server - connection timeout.
Craig Morrison
@frogmorton
Nov 05 2015 14:01
@h4r1m4u do each zipline have it's own chat room? or is there just a "ziplines" chatroom?
Jeremy Roe
@jeremyroe
Nov 05 2015 14:06
@terakilobyte perhaps try http://robomongo.org/ to see if you can connect to the DB and eliminate that before you worry about troubleshooting your application
h4r1m4u
@h4r1m4u
Nov 05 2015 14:07
@frogmorton i only know about the main /HelpZiplines channel
Craig Morrison
@frogmorton
Nov 05 2015 14:07
ok
fair enough
Byron Lagrone
@byronic
Nov 05 2015 14:07
yeah @frogmorton /HelpZiplines is the bee's pajamas or w/e
best place to be for any Zipline
Craig Morrison
@frogmorton
Nov 05 2015 14:25
@byronic Thanks! I'll check it out. I've got a reasonable portfolio page done, and now on to the projects which will provide some content for it... ;-)
CamperBot
@camperbot
Nov 05 2015 14:25
frogmorton sends brownie points to @byronic :sparkles: :thumbsup: :sparkles:
:star: 229 | @byronic | http://www.freecodecamp.com/byronic
Michelle
@pinskers
Nov 05 2015 14:30
Hello! I'll admit I'm not hugely math-inclined and seeking further clarification about "i++". I understand it adds one to the specified increment, but why "i++" and not "i+"? Is it literally "i PLUS one increment"?
Nathan
@terakilobyte
Nov 05 2015 14:31
@pinskers it's because + is a binary operator where as ++ is a unary operator
@pinskers if it was just i+ how would you add 3 to it? i+++?
i++ is the same as i = i + 1, or i += 1, and is just some sugar they came up with to reduce the amount of typing required
Michelle
@pinskers
Nov 05 2015 14:33
OH! Okay, I understand now! Thank you, @terakilobyte!
CamperBot
@camperbot
Nov 05 2015 14:33
pinskers sends brownie points to @terakilobyte :sparkles: :thumbsup: :sparkles:
:star: 225 | @terakilobyte | http://www.freecodecamp.com/terakilobyte
Nathan
@terakilobyte
Nov 05 2015 14:34
@pinskers np, enjoy the learning journey!
Robert Axelsen
@robaxelsen
Nov 05 2015 14:35
HI all :) Doing my first (ever) coding stream now. It'll be short, but feel free to come watch and join: http://www.twitch.tv/robchew
Nathan
@terakilobyte
Nov 05 2015 14:37
@robeerob you're getting a lot of ambient sound in your mic
Craig Morrison
@frogmorton
Nov 05 2015 14:37
What @terakilobyte said
Nathan
@terakilobyte
Nov 05 2015 14:39
@frogmorton across the pond or on the town?
Robert Axelsen
@robaxelsen
Nov 05 2015 14:39
Sorry about that. Tryon another headset
Craig Morrison
@frogmorton
Nov 05 2015 14:39
I'm in Japan!
Craig Morrison
@frogmorton
Nov 05 2015 14:40
HAHA
Robert Axelsen
@robaxelsen
Nov 05 2015 14:41
@terakilobyte @frogmorton Can you hear me better now?
Craig Morrison
@frogmorton
Nov 05 2015 14:41
Actually, I got the name from LOTR, it's an obscure Shire reference.
Yes, I can hear you
Nathan
@terakilobyte
Nov 05 2015 14:42
@robeerob I think your gain is still a bit high, it sounds like a vacuum cleaner is running in another room
@robeerob nothing big, but something you'll want to eventually sort out
Robert Axelsen
@robaxelsen
Nov 05 2015 14:45
@terakilobyte thanks :)
CamperBot
@camperbot
Nov 05 2015 14:45
robeerob sends brownie points to @terakilobyte :sparkles: :thumbsup: :sparkles:
:star: 226 | @terakilobyte | http://www.freecodecamp.com/terakilobyte
Craig Morrison
@frogmorton
Nov 05 2015 14:45
Good luck @robeerob I have precious little time to devote to FCC progress, I think i need to go do some coding of my own.
Robert Axelsen
@robaxelsen
Nov 05 2015 14:46
@frogmorton thanks. I am blessed to have time between work orders to devote to thos.
CamperBot
@camperbot
Nov 05 2015 14:46
robeerob sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 294 | @frogmorton | http://www.freecodecamp.com/frogmorton
Robert Axelsen
@robaxelsen
Nov 05 2015 14:46
this*
Craig Morrison
@frogmorton
Nov 05 2015 14:47
indeed! Keep it up!
Craig Morrison
@frogmorton
Nov 05 2015 15:00
@byronic would you recommend going through the json / API / ajax section before doing the beginning ziplines?
Byron Lagrone
@byronic
Nov 05 2015 15:01
@frogmorton Fair question. I'd say it's not necessary to do it in that order
All you need for the beginning Ziplines is CSS/HTML/JavaScript
I also used Bootstrap and jQuery for them
Craig Morrison
@frogmorton
Nov 05 2015 15:01
well, if I hit an api for the quote machine...
anthonygallina1
@anthonygallina1
Nov 05 2015 15:03
you can go through them fast I think they help
Byron Lagrone
@byronic
Nov 05 2015 15:03
^ I took a very long time on the Portfolio Zipline but it helped me out immensely
As for the quote machine, you will run into a small bit of Twitter's API for the ZipLine, but it's still just JavaScript
(if you do the bonus section re: Tweet button)
Craig Morrison
@frogmorton
Nov 05 2015 15:05
did you just gather a group of static quotes? or did you grab them via a quote site's API?
I'd like to do the tweet button, yes.
Sauryha
@WonderWoman182
Nov 05 2015 15:10
Hey everyone, having trouble creating an if/else statement
anyone able to help?
Craig Morrison
@frogmorton
Nov 05 2015 15:15
@WonderWoman182 do you have any code so far?
@byronic here is my current result for the personal profile page http://codepen.io/frogmorton/pen/gaWEXP
Craig Morrison
@frogmorton
Nov 05 2015 15:23
@WonderWoman182
if (condition) {
    /*what you want to run if condition is true*/
}
else {
    /*run this if condition is false*/
}
anthonygallina1
@anthonygallina1
Nov 05 2015 15:26
hmmm
Craig Morrison
@frogmorton
Nov 05 2015 15:28
ok, i wasn't entirely correct with that....
the else runs if the condition evaluates to anything other than true
Byron Lagrone
@byronic
Nov 05 2015 15:32
@frogmorton I dig it!
I haven't checked it on mobile, though
And you may want to add some backgrounds for the different sections
Craig Morrison
@frogmorton
Nov 05 2015 15:33
for some reason the pill doesn't work when the screen is resized
Caitlin
@cohalls
Nov 05 2015 15:33

I'm having trouble with WayPoint: Generate Random Fractions with Javascript. I did: function myFunction() {

// Only change code below this line.

return Math.random(myFunction);

// Only change code above this line.

It seems to randomly generate a decimal number, but it's not saying I'm correct.
Coira Ellison
@Coira
Nov 05 2015 15:36
@cohalls Math.random();
Craig Morrison
@frogmorton
Nov 05 2015 15:37
@byronic another problem i need to solve is, how to properly implement this: https://www.ctan.org/tex-archive/fonts/fontmfizz?lang=en
some icons are not showing up, because I'm doing something wrong...
Caitlin
@cohalls
Nov 05 2015 15:37
@Coira I just tried that but that doesn't work either.
Coira Ellison
@Coira
Nov 05 2015 15:38
return Math.random(); should work?
Caitlin
@cohalls
Nov 05 2015 15:38
It wants me to make the Function = Math.random I believe
Should I be pushing something to the function like I did with the arrays?
Craig Morrison
@frogmorton
Nov 05 2015 15:39
@byronic oops... I meant this link
Coira Ellison
@Coira
Nov 05 2015 15:40
@cohalls ah i see, no it wants the function myFunction to return a random number, which you do by putting in that line of code
so when you call myFunction(), (like it does at the bottom of the code), it performs whatever's inside myFunction
Caitlin
@cohalls
Nov 05 2015 15:41
@Coira I gave it one more try with the line "return Math.random();" and it is saying the function is not returning a random number
Coira Ellison
@Coira
Nov 05 2015 15:42
hm, show code?
Caitlin
@cohalls
Nov 05 2015 15:42
Can I do a screenshot here?
Coira Ellison
@Coira
Nov 05 2015 15:42
yeah, just drag image here
Craig Morrison
@frogmorton
Nov 05 2015 15:42
format code
format
Coira Ellison
@Coira
Nov 05 2015 15:43
wiki format
CamperBot
@camperbot
Nov 05 2015 15:43

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

Craig Morrison
@frogmorton
Nov 05 2015 15:43
thanks Coira
CamperBot
@camperbot
Nov 05 2015 15:43
if you want to thank someone, put an @ before their name!
Caitlin
@cohalls
Nov 05 2015 15:43
I tried refreshing the page and that made it work. I guess it was a bug maybe.
Thanks @Coira
CamperBot
@camperbot
Nov 05 2015 15:43
cohalls sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 291 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Nov 05 2015 15:43
ah, annoying browser stuff!
also, if you want to post code here, you can follow camperbot's instructions up there to make it look nice :)
@frogmorton i can never remember the correct command either :p
ijzavala
@ijzavala
Nov 05 2015 15:45
I'm having trouble with script. do not know how to write out the function code correctly
Caitlin
@cohalls
Nov 05 2015 15:45
@Coira I'm not quite sure where to find camperbot's instructions
ijzavala
@ijzavala
Nov 05 2015 15:45
can someone help me
Coira Ellison
@Coira
Nov 05 2015 15:46
how do i do that pointing thing that abhisek does??
@cohalls just scroll up a bit
@ijzavala do you have any code? which waypoint?
ijzavala
@ijzavala
Nov 05 2015 15:47
Waypoint 106
Caitlin
@cohalls
Nov 05 2015 15:47
Oh I see. So something like '''
return Math.Random();
CamperBot
@camperbot
Nov 05 2015 15:47
:bulb: to format code use backticks! ``` more info
Caitlin
@cohalls
Nov 05 2015 15:48
'''
return Math.Random();
'''
CamperBot
@camperbot
Nov 05 2015 15:48
:bulb: to format code use backticks! ``` more info
Coira Ellison
@Coira
Nov 05 2015 15:48
return Math.Random();
Caitlin
@cohalls
Nov 05 2015 15:48
I'm failing right now
lol
Coira Ellison
@Coira
Nov 05 2015 15:48
if it's any help, backtick on my keyboard is to the left of the 1 key
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 15:49
OK, I have even printed out my code...and to me...it SHOULD work. I follow it through on paper...and I don't see the problem.
ijzavala
@ijzavala
Nov 05 2015 15:50
<script $(document).ready(function( ) { } );>
</script> this is what I have
Caitlin
@cohalls
Nov 05 2015 15:50
I found the backticks, but when I use them, it won't let me enter to submit to chat. It just keeps entering down the line :(
Coira Ellison
@Coira
Nov 05 2015 15:51
shift-enter (or perhaps ctrl-enter, can't remember offhand)
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 15:51
I think it's shift-enter to get the second set of quotes..and then control-enter to post
I found it frustrating at first as well
Caitlin
@cohalls
Nov 05 2015 15:52
return Math.Random();
oh it was command enter!
I just kept hitting random buttons lol
Coira Ellison
@Coira
Nov 05 2015 15:52
:)
Caitlin
@cohalls
Nov 05 2015 15:52
Thanks @Coira, Thanks @TheHighPriestess
CamperBot
@camperbot
Nov 05 2015 15:52
cohalls sends brownie points to @coira and @thehighpriestess :sparkles: :thumbsup: :sparkles:
:warning: cohalls already gave coira points
:star: 310 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Craig Morrison
@frogmorton
Nov 05 2015 15:52
victory!
Caitlin
@cohalls
Nov 05 2015 15:52
Oh I guess I can't send points twice to someone?
Coira Ellison
@Coira
Nov 05 2015 15:52
camperbot's stingy
Craig Morrison
@frogmorton
Nov 05 2015 15:53
ha ha
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 15:53
So...I started my Simon over from the beginning..and I am STILL have the same problem
hotwings26
@hotwings26
Nov 05 2015 15:53
need help with "Waypoint: Filter Arrays with filter" please
keep getting "array is not defined"
Coira Ellison
@Coira
Nov 05 2015 15:53
@TheHighPriestess I'd have a go at helping you, but you're actually ahead of me, sorry!
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 15:54
when the computer generated array goes to 2 elements and the human clicks on the first one...it fails
@Coira it's really hideous
I don't want to scare anyone haha
Coira Ellison
@Coira
Nov 05 2015 15:57
ok, i'm going to have a look unless/until someone turns up who can actually help
because i'm procrastinating on my calculator...
hotwings26
@hotwings26
Nov 05 2015 15:58
what waypoint are you having a problem with?
@Coira
ijzavala
@ijzavala
Nov 05 2015 15:58
mines jquery
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 15:58
@Coira good luck
I THINK the problem is in the "registerClick" function..
Coira Ellison
@Coira
Nov 05 2015 15:59
oh, sorry @hotwings26 no problems, just looking at @TheHighPriestess's zipline
ijzavala
@ijzavala
Nov 05 2015 15:59
script tags and document ready work
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:18

I'm wondering...if this is correct:

else if(!active)

I wanted...NOT active
However, maybe that's not the way it's written
Coira Ellison
@Coira
Nov 05 2015 16:19
yep, that should work
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:20
ok..from what I can see...it's going right to that else if in the function checkLose
I'm trying to find out where active gets changed to false
The idea is to "shift" off the first element of the array and check it against the response. If they equal each other...then active is "true'
fedelegina2016
@fedelegina2016
Nov 05 2015 16:27
Hey can someone help me over here please?
Your form element should have the background-color of green? Im a bit lost on where to place this?
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:28
@fedelegina2016 which waypoint?
Marantini
@Marantinii
Nov 05 2015 16:28
Your img element should have the class smaller-image.
fedelegina2016
@fedelegina2016
Nov 05 2015 16:28
Waypoint: Use an ID Attribute to Style an Element
@TheHighPriestess
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:30
```
  #cat-photo-form{
    background-color: green;
  }
fedelegina2016
@fedelegina2016
Nov 05 2015 16:31
i understand the format but am unsure where to put it?
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:32
oh....in the CSS
fedelegina2016
@fedelegina2016
Nov 05 2015 16: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;
}
.gray-background {
background-color: gray
}
</style>

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

<p>Click here for <a href="#">cat photos</a>.</p>

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

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo" id="cat-photo-form">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

thats what i have
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:32
I am also having that problem @fedelegina2016
fedelegina2016
@fedelegina2016
Nov 05 2015 16:33
I'm new to this @ktbellinger
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 16:33
@fedelegina2016 put it right undernearth .gray-backround....but before the last style tag
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:33
Same @fedelegina2016
Rahul Jha
@RJ722
Nov 05 2015 16:33
Just put it in style tag @fedelegina2016
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:33

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

<style>

cat-photo-element {

  background-color: green;

}

Like so?
This message was deleted
Damn it automatically styles in the chat
fedelegina2016
@fedelegina2016
Nov 05 2015 16:34
@ktbellinger look up NewPeople room and join thats my room we can work together
Shair Mir
@ShairMir
Nov 05 2015 16:51
Anybody knows a good resource to learn DOM manipulation with JS?
Most google stuff seems so outdated
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:55
Can someone help me with something really quickly? I’m on Using an ID Attribute to style elemnts
Coira Ellison
@Coira
Nov 05 2015 16:56
Magnus Croneborg
@MagCron
Nov 05 2015 16:56
Maybe I can help you ktbellinger
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:56
I THINK I figured it out actually.
Coira Ellison
@Coira
Nov 05 2015 16:56
@TheHighPriestess is that working for you?
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:56
I had a hidden ` in my code
:( lol
Magnus Croneborg
@MagCron
Nov 05 2015 16:57
ok
Kevin Bellinger
@ktbellinger
Nov 05 2015 16:57
Thanks @MagCron
CamperBot
@camperbot
Nov 05 2015 16:57
ktbellinger sends brownie points to @magcron :sparkles: :thumbsup: :sparkles:
:star: 45 | @magcron | http://www.freecodecamp.com/magcron
Joy
@somepulp
Nov 05 2015 16:58
hi i need help with the create a form element wayform
is this where i ask?
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 17:00
@Coira whoa...yeah
You're a better programmer than I am LOL
What was the problem?
Eran
@EranZzZ
Nov 05 2015 17:00
what seems to be the problem @somepulp ?
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 17:00
@Coira Thank you
CamperBot
@camperbot
Nov 05 2015 17:00
thehighpriestess sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 292 | @coira | http://www.freecodecamp.com/coira
Joy
@somepulp
Nov 05 2015 17:00
@EranZzZ i just want to understand how it works
Coira Ellison
@Coira
Nov 05 2015 17:00
@TheHighPriestess you were on the right lines with deactivateBoard
Joy
@somepulp
Nov 05 2015 17:00
so is the action the attribute
or the input ?
Coira Ellison
@Coira
Nov 05 2015 17:01
@TheHighPriestess i added a couple of unbinds and that seemed to fix it, but i haven't tested it much
Joy
@somepulp
Nov 05 2015 17:02
action="url where you want to submit the form data", but then how do you nest the input field so you can get the data in the first place?
Eran
@EranZzZ
Nov 05 2015 17:02
not sure what you mean, but it looks like so <form action="/submit-cat-photo">
Joy
@somepulp
Nov 05 2015 17:03
ohhh..
its between the opening and closing form element
duh ..
sorry for stupid questions
Eran
@EranZzZ
Nov 05 2015 17:03
nah its okay ^^ dont be afraid to ask anything
Joy
@somepulp
Nov 05 2015 17:04
@EranZzZ thank you :smile:
CamperBot
@camperbot
Nov 05 2015 17:04
somepulp sends brownie points to @eranzzz :sparkles: :thumbsup: :sparkles:
:star: 175 | @eranzzz | http://www.freecodecamp.com/eranzzz
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 17:04
@Coira Well...it's working better than it was before.
Coira Ellison
@Coira
Nov 05 2015 17:04
@TheHighPriestess after seeing how annoying it is having to go back and forth binding the buttons and keeping everything in sync, i think i'll have a go at doing it in canvas instead!
though i don't know if that's against the spirit of the zipline
Eran
@EranZzZ
Nov 05 2015 17:05
oh nice, thank you @somepulp . didnt know you could get a brownie :) im so happy
CamperBot
@camperbot
Nov 05 2015 17:05
eranzzz sends brownie points to @somepulp :sparkles: :thumbsup: :sparkles:
:star: 37 | @somepulp | http://www.freecodecamp.com/somepulp
Coira Ellison
@Coira
Nov 05 2015 17:05
i suppose angular/react solves all those problems
Eran
@EranZzZ
Nov 05 2015 17:06
actually i came here to ask about "Waypoint: Make Instances of Objects with a Constructor Function". not sure what they want me to do there exactly. anyone can help?
Joy
@somepulp
Nov 05 2015 17:06
haha yeah i learned lots about brownies last night/this morning
Markus Kiili
@Masd925
Nov 05 2015 17:08
@EranZzZ You can insert properties to your myCar with dot notation: myCar.propertyName = value;
Eran
@EranZzZ
Nov 05 2015 17:09
ohh yeah thought thats what they ment but wrote myCar.Engine=1;
guess i missed the s :P
oh wait, still doesnt accept it.. weird. can you tell me whats the exact way to write it there?
h4r1m4u
@h4r1m4u
Nov 05 2015 17:11
@EranZzZ letter case matters. wink, wink
Eran
@EranZzZ
Nov 05 2015 17:11
duh small e, not capital
thanks @Masd925 @h4r1m4u ^^
CamperBot
@camperbot
Nov 05 2015 17:11
eranzzz sends brownie points to @masd925 and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 255 | @masd925 | http://www.freecodecamp.com/masd925
:star: 533 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Coira Ellison
@Coira
Nov 05 2015 17:12
@TheHighPriestess anyway, you're a far better designer than i am. i was gonna ask you about design stuff, but i have to disappear right now, so i'll ask you later if you don't mind :)
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 17:12
@Coira What exactly is canvas?
@Coira Thank you. I love design. Yeah..ask me anything
CamperBot
@camperbot
Nov 05 2015 17:12
thehighpriestess sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave coira points
Arnis Jaundzeikars
@SangSatori
Nov 05 2015 17:29
@TheHighPriestess: Just to chirp in, canvas is an HTML5 element that acts like a surface for drawing graphics/visuals using the canvas/WebGL APIs.
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:35
Hi everyone. Can i get some help with this challenge please. Waypoint: Iterate Odd Numbers With a For Loop.
``
h4r1m4u
@h4r1m4u
Nov 05 2015 17:36
@ian-splintercell-splinter what's the issue?
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:37
Push the odd numbers from 1 through 9 to myArray using a for loop.
h4r1m4u
@h4r1m4u
Nov 05 2015 17:37
ok. what specifically are you struggling with?
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:38
@h4r1m4u myArray should equal [1,3,5,7,9]
it equals 5 at moment
h4r1m4u
@h4r1m4u
Nov 05 2015 17:39
what does your code look like?
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:40

is it 2 back ticks i will try. Not to bright at code imput. `var ourArray = [];

for(var i = 0; i < 10; i += 2){
ourArray.push(i);
}

// Only change code below this line.

var ourArray = [];

for(var i = 0; i < 10; i += 2) {

ourArray.push(i);

}

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
`

h4r1m4u
@h4r1m4u
Nov 05 2015 17:40
it's three backticks at the beginning of the code and three at the end
ok, so it seems you just copied the sample code provided to you by the waypoint?
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:41

@h4r1m4u . ```var ourArray = [];

for(var i = 0; i < 10; i += 2){
ourArray.push(i);
}

// Only change code below this line.

var ourArray = [];

for(var i = 0; i < 10; i += 2) {

ourArray.push(i);

}

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
```

h4r1m4u
@h4r1m4u
Nov 05 2015 17:41
you want the opening three backticks on their own line
Ian Hyndman
@ian-splintercell-splinter
Nov 05 2015 17:49
Ok
Dave
@BeingDS
Nov 05 2015 17:57

Hey guys, I'm working through the Javascript waypoints and I'm having trouble understanding some of the code for generating random numbers.

The code for generating a coin flip (and this is pregenerated by the waypoint) is apparently "var "var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;"

This code doesn't make sense to me. "(Math.random() * (1-0+1))+0" seems to indicate that whatever Math-random results in, we're going to multiply it by 2 (1-0+1) and then add 0 to it.

So why are we multiplying a random decimal by 2, and expecting it to equal either 0 or 1 (I suppose I'm assuming that this is what a coin flip program would do)?

And what is the purpose of adding 0 to our result?

Farouq Hassan
@FarouqHassan
Nov 05 2015 17:57
Hello Guys i have a problem in the lesson 16 here you are the code

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

<h2 class="red-text" >Cat Photo App</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>

i have two error here
Your p element should be red.
Your p element should have the class red-text.
Dave
@BeingDS
Nov 05 2015 17:58
I think there should not be a space between "class=" and "red-text" but I'm new to coding too, so I could be wrong.
Farouq Hassan
@FarouqHassan
Nov 05 2015 17:59
thanks @BeingDS you are right !
CamperBot
@camperbot
Nov 05 2015 17:59
farouqhassan sends brownie points to @beingds :sparkles: :thumbsup: :sparkles:
:star: 163 | @beingds | http://www.freecodecamp.com/beingds
h4r1m4u
@h4r1m4u
Nov 05 2015 17:59
@BeingDS it'll make more sense once you get to the Generate Random Whole Numbers within a Range. basically since Math.random() generates only decimal numbers, there's a formula that let's you generate random integers from a specified min / max range. it goes like this: Math.floor(Math.random() * (max - min + 1)) + min
Farouq Hassan
@FarouqHassan
Nov 05 2015 17:59
I hope that i can help but still a beginner
h4r1m4u
@h4r1m4u
Nov 05 2015 18:00
@BeingDS so the expression that you're looking at is this formula, applied for 0 - 1 range
does that help?
Dave
@BeingDS
Nov 05 2015 18:01
@h4r1m4u Thanks for your help. I am already past that waypoint (I'm on the first waypoint in conditional statements). I guess I'm not understanding the specifics of random number generation (why the formula does what it does).
CamperBot
@camperbot
Nov 05 2015 18:01
beingds sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 534 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Dave
@BeingDS
Nov 05 2015 18:02
I never was very good at algebra.
h4r1m4u
@h4r1m4u
Nov 05 2015 18:02
ah, ok. well, Math.random() generates a random decimal from 0 - 1 range (e.g. 0.54, 0.23, 0.89, etc.)
Sauryha
@WonderWoman182
Nov 05 2015 18:02
@frogmorton how do I phrase the condition for if/else statements?
Dave
@BeingDS
Nov 05 2015 18:03
And Math.floor() causes that decimal to round down, correcy?
to a whole integer?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:03
yes, that's correct. which is why you get integers
Sauryha
@WonderWoman182
Nov 05 2015 18:03
anyone able to help with if/else?
Dave
@BeingDS
Nov 05 2015 18:04
So it will round down to zero, unless it's 1, correct?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:04
the formula just guarantees you get the whole numbers from the min / max range. best way to understand is to take a couple of min / max ranges and put the numbers in the formula. then calculate the result. try it with a random decimal too. it'll make sense if you actually go through the calculation yourself
Dave
@BeingDS
Nov 05 2015 18:04
Gotcha. Thanks @h4r1m4u
CamperBot
@camperbot
Nov 05 2015 18:04
beingds sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: beingds already gave h4r1m4u points
Elizabeth Hatleli
@TheHighPriestess
Nov 05 2015 18:05
@SangSatori ah ok....thank you. I will have to check it out.
CamperBot
@camperbot
Nov 05 2015 18:05
thehighpriestess sends brownie points to @sangsatori :sparkles: :thumbsup: :sparkles:
:star: 211 | @sangsatori | http://www.freecodecamp.com/sangsatori
h4r1m4u
@h4r1m4u
Nov 05 2015 18:05
yes, it'll round it down to 0 unless it's above 1. which it can be if the decimal from the Math.random() function is above 0.5
e.g. Math.floor(Math.random() * (1 - 0 + 1)) + 0; => Math.floor(0.65 * (2));=> Math.floor(1.3) => 1
@BeingDS
@WonderWoman182 what seems to be the issue?
Markus Kiili
@Masd925
Nov 05 2015 18:07
@WonderWoman182 The if/else condition is an expression that evaluates to boolean (true or false). If the condition is true the code block after if is run and is the condition is false then the code block after else is run.
Dave
@BeingDS
Nov 05 2015 18:07
@h4r1m4u So does Math.floor round down, or does it round to the nearest integer?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:08
The Math.floor() function returns the largest integer less than or equal to a given number.
Dave
@BeingDS
Nov 05 2015 18:08
Gotcha. Thanks.
CamperBot
@camperbot
Nov 05 2015 18:08
if you want to thank someone, put an @ before their name!
Sauryha
@WonderWoman182
Nov 05 2015 18:08
I think I'm phrasing my if/else statements incorrectly
h4r1m4u
@h4r1m4u
Nov 05 2015 18:09
how are you phrasing it @WonderWoman182 ? post your code?
Sauryha
@WonderWoman182
Nov 05 2015 18:09
how do I post the code?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:09
you can just copy it here into the chat, if you want to format it, use backticks (found under escape on your keyboard)
wiki format
CamperBot
@camperbot
Nov 05 2015 18:09

:point_right: code format [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 and then press [shift + enter ⏎]

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

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

How to Code

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

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

Dave
@BeingDS
Nov 05 2015 18:10
@WonderWoman182 you should be able to copy and paste right from FCC
h4r1m4u
@h4r1m4u
Nov 05 2015 18:10
:point_up:
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:10
anyone know how to center buttons in bootstrap?
Sauryha
@WonderWoman182
Nov 05 2015 18:10

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction() {

// Only change code below this line.

if (1===0) {
return heads;
} else {
return tails;
}

// Only change code above this line.

}

h4r1m4u
@h4r1m4u
Nov 05 2015 18:10
@Dueldrawer8 adding text-center class on the container holding the button should do the trick
Vibhor
@Vibhor100
Nov 05 2015 18:11

On the very first challenge where they have say hello to HTML elements, but why it doesn't accept my code.

<h1>Hello World</h1>
I think that's right. is there some bug?

Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:11
@h4r1m4u tried it
Vibhor
@Vibhor100
Nov 05 2015 18:11
WHen I run tests it says $ not defined?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:11
@WonderWoman182 you're returning heads and tails as variables. you're supposed to return them as strings and in order to do that, just wrap them in double quotes: "heads", "tails". your if/else if fine
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:12
@h4r1m4u unless i need to create another container or something? its not centering..
h4r1m4u
@h4r1m4u
Nov 05 2015 18:12
@Dueldrawer8 are you looking to center the social media buttons?
Sauryha
@WonderWoman182
Nov 05 2015 18:12
thank you! That's what I thought but the example listed above didn't wrap them in quotes
CamperBot
@camperbot
Nov 05 2015 18:12
if you want to thank someone, put an @ before their name!
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:12
@h4r1m4u yes
my code..
Shayk Yasin
@shaykyasin
Nov 05 2015 18:12
@all looking for suggestions on http://codepen.io/shaykyasin/pen/gajBPK
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:13
<div class="btn-group text-center">
        <button class="btn btn-primary" href="#" target="_blank">Twitter</button>
       <button class="btn btn-primary" href="#" target="_blank">LinkedIn</button>
        <button class="btn btn-primary" href="#" target="_blank">GitHub</button>
        <button class="btn btn-primary" href="#" target="_blank">Free Code Camp</button>
      </div>
Sauryha
@WonderWoman182
Nov 05 2015 18:13
thanks @h4r1m4u
CamperBot
@camperbot
Nov 05 2015 18:13
wonderwoman182 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 535 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 05 2015 18:14
@Dueldrawer8 yeah, you need to wrap that in another div with the text-center class:
<div class="text-center">
   <div class="btn-group">
        <button class="btn btn-primary" href="#" target="_blank">Twitter</button>
       <button class="btn btn-primary" href="#" target="_blank">LinkedIn</button>
        <button class="btn btn-primary" href="#" target="_blank">GitHub</button>
        <button class="btn btn-primary" href="#" target="_blank">Free Code Camp</button>
      </div>  
</div>
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:15
alright
@h4r1m4u thank you
CamperBot
@camperbot
Nov 05 2015 18:15
dueldrawer8 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 536 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 05 2015 18:15
yw
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:15
@shaykyasin how are you able to create that effect where as you slide down the webpage it goes from one picture into the next?
Dave
@BeingDS
Nov 05 2015 18:17

@h4r1m4u So the code pregenerated fro the waypoint to return a number between 0 and 1 is "var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;"

Why are there 3 numbers in the parentheses following Math.random()? Shouldn't there be only 2 (max - min)? Why does it appear to be "(max - min + max)?

Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:18
hmm maybe using fixed somehow looking at your code
h4r1m4u
@h4r1m4u
Nov 05 2015 18:18
@BeingDS because the range it 0 - 1. the formula is: Math.floor(Math.random() * (max - min + 1)) + min
Shayk Yasin
@shaykyasin
Nov 05 2015 18:18
set a background to the div. Look at the css file, you'll find the links to imgur. @Dueldrawer8
h4r1m4u
@h4r1m4u
Nov 05 2015 18:18
so it's not max - min + max. but max - min + 1
Dave
@BeingDS
Nov 05 2015 18:18
Ah. Thanks!
CamperBot
@camperbot
Nov 05 2015 18:18
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 05 2015 18:18
it's just confusing because the range is 0 - 1
@shaykyasin looks good so far. two suggestions:
1) on small screens, when the menu collapses, the hamburger button spills over the navbar
2) host the image that you use for the first section somewhere else than imgur. there have been a lot of problems with images from imgur not opening properly in codepen (i can't for example see the background image at the moment)
lastly, are you planning to add your projects porfolio on the page too?
Shayk Yasin
@shaykyasin
Nov 05 2015 18:24
@h4r1m4u Yup the mobile menu needs to be fixed. Also, once I have projects to show, I will add them in the portfolio. I
h4r1m4u
@h4r1m4u
Nov 05 2015 18:24
cool
Shayk Yasin
@shaykyasin
Nov 05 2015 18:26
Is there somewhere else I can host? @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 05 2015 18:26
do you have dropbox?
leodimilo
@leodimilo
Nov 05 2015 18:27
I have a weird question in regards to one of the javascript waypoints....(Generate Random Whole Numbers within a range) In this, they ask for you to define two variables (myMin and myMax set to equal numbers and then using the Math.floor and Math.random methods, return a number inbetween. I initially set myMin and myMax as arguments within the function but kept getting 'null' returned. When I reset it to make the function have no arguments, it worked fine. My question is why did it return 'null'?
h4r1m4u
@h4r1m4u
Nov 05 2015 18:28
@leodimilo you mean you did this? function ourFunction(myMin, myMax) {...}
leodimilo
@leodimilo
Nov 05 2015 18:28
yes
h4r1m4u
@h4r1m4u
Nov 05 2015 18:29
ok, if you do that then the myMin, myMax inside the function become the arguments, so you're relying on the range numbers to be provided to the function as arguments when called, eg. ourFunction(2, 5)
but that's not how the waypoint tester calls it
it doesn't provide the arguments
if the arguments are not provided when the function is called, the variables inside the function have no value
does that make sense?
leodimilo
@leodimilo
Nov 05 2015 18:31
okay...got it. Was scratching my head trying to understand why it wasn't working
Thank you much
CamperBot
@camperbot
Nov 05 2015 18:32
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 05 2015 18:32
if you defined the function as function ourFunction(a, b) { ... } and kept the myMin, myMax variables inside the function, it should still work
you're welcome
leodimilo
@leodimilo
Nov 05 2015 18:33
I appreciate it. Outside of closures and anonymous functions, I've been piecing this stuff together a little every day.
h4r1m4u
@h4r1m4u
Nov 05 2015 18:33
sure, no problem
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:36
<div class="text-center">
      <div class="btn-group">
        <button class="btn btn-primary" href="#" target="_blank"><i class="fa fa-twitter">Twitter</i></button>
its not adding the little twitter symbol
h4r1m4u
@h4r1m4u
Nov 05 2015 18:36
<i class="fa fa-twitter"></i> Twitter
put the text outside the <i> element
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:37
@h4r1m4u still a no show
h4r1m4u
@h4r1m4u
Nov 05 2015 18:38
did you import font awesome into your project?
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:38
@h4r1m4u no..
h4r1m4u
@h4r1m4u
Nov 05 2015 18:39
there's your answer :D
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:39
wait
yes its in there..
h4r1m4u
@h4r1m4u
Nov 05 2015 18:40
where? i don't see it
Randy Goldsmith
@Dueldrawer8
Nov 05 2015 18:41
when i click the gear symbol next to CSS in codepen.. that link is in one of the boxes
oh haha
@h4r1m4u i was looking at @shaykyasin
h4r1m4u
@h4r1m4u
Nov 05 2015 18:43
lol