These are chat archives for FreeCodeCamp/Help

17th
Oct 2015
Greg Foley
@GregFoley
Oct 17 2015 00:00

Waypoint: Add Borders Around your Elements
`

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

.smaller-image {
width: 100px;
}

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

</style>

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

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

Hmmm... that was supposed to be a code block.
testing <img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
better
`
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
Joshua Abu
@Absolutestunna
Oct 17 2015 00:03
This might sound weird but how do you "unsplit" and array?>
Hans van Riet
@hansinla
Oct 17 2015 00:03
@Absolutestunna .join()
Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:03
@Absolutestunna str.split('').join('')
Greg Foley
@GregFoley
Oct 17 2015 00:03
Is there something wrong with my code or a bug in the app? (from Waypoint: Add Borders Around your Elements)
Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:04
explain format
CamperBot
@camperbot
Oct 17 2015 00:04

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:04
@GregFoley :point_up: October 17, 2015 5:34 AM
Joshua Abu
@Absolutestunna
Oct 17 2015 00:04
@hansinla @abhisekp thank you
CamperBot
@camperbot
Oct 17 2015 00:04
absolutestunna sends brownie points to @hansinla and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 540 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 603 | @abhisekp | http://www.freecodecamp.com/abhisekp
Greg Foley
@GregFoley
Oct 17 2015 00:05
It says I haven't given the image border a width of 10px. But it works in Firefox.
<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;
  }

  .smaller-image {
    width: 100px;
  }

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

</style>

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Jason
@Jauble
Oct 17 2015 00:06
Awesome, thanks @abhisekp
CamperBot
@camperbot
Oct 17 2015 00:06
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 604 | @abhisekp | http://www.freecodecamp.com/abhisekp
Rory Smith
@alanbuchanan
Oct 17 2015 00:06
hi all, need a bit of help with how to make this post request correctly http://stackoverflow.com/questions/33178601/getting-and-then-posting-based-on-user-selection
Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:08
@alanbuchanan
Hans van Riet
@hansinla
Oct 17 2015 00:09
@GregFoley That code is correct, it passes for me. Reset your cache and the code.
Joshua Abu
@Absolutestunna
Oct 17 2015 00:09
@abhisekp I am on the intermediate search and destroy. In this code, the check argument can successfully be replaced with the check argment. However I am unable to join the string bck together after the check
function myReplace(str, check, replacer) {
  var wordSlice = str.split(" ");


  for (var i=0; i<wordSlice.length; i++){
    if (wordSlice[i] === check){      
      var check = wordSlice[i]
      wordSlice.splice(wordSlice.indexOf(check), 1, replacer)


    }

  }return wordSlice



}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
Greg Foley
@GregFoley
Oct 17 2015 00:10
thank you @hansinla
CamperBot
@camperbot
Oct 17 2015 00:10
gregfoley sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 541 | @hansinla | http://www.freecodecamp.com/hansinla
Joshua Abu
@Absolutestunna
Oct 17 2015 00:10
@abhisekp I got it..fixed it..thakn you
Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:10
bf search and destroy
CamperBot
@camperbot
Oct 17 2015 00:10
Sorry, can't find a bonfire called search and destroy. [ Check the map? ]
Abhisek Pattnaik
@abhisekp
Oct 17 2015 00:10
bf search
CamperBot
@camperbot
Oct 17 2015 00:10

:fire:Bonfire: Search and Replace :link:

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

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

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

more info:  bf details | bf links | hint

Hans van Riet
@hansinla
Oct 17 2015 00:11
@Absolutestunna You’re redefining var check = wordSlice[i]
@Absolutestunna Also for code to pass, you cannot change the name of functions.
Rory Smith
@alanbuchanan
Oct 17 2015 00:18
@abhisekp why did you screenshot that?
Joshua Abu
@Absolutestunna
Oct 17 2015 00:20
@hansinla that "var check" didn't need to be there
I removed
it
Mahtab
@RoadToCode822
Oct 17 2015 00:22
Hi, I’m trying to center div’s using this code, but can’t do it
Brian K
@BKtheDAD
Oct 17 2015 00:34
help slasher flick
CamperBot
@camperbot
Oct 17 2015 00:34

:point_right: bonfire slasher flick [wiki]

The problem

Return the remaining elements of an array after chopping off n elements from the head. Factorials are often represented with the shorthand notation n!

For example: slasher([1, 2, 3], 2); must return [3]

:pencil: read more about bonfire slasher flick on the FCC Wiki

Greg Foley
@GregFoley
Oct 17 2015 00:35
I've tried everything to get Waypoint: Add Borders Around your Elements to pass. Cleared cache, used a different browser, reset code, hard reload page. It keeps on saying I get setting the image border -width to 10px wrong. I don't know what to do.
Matt Leonard
@matty22
Oct 17 2015 00:36
Show us your code Greg
Greg Foley
@GregFoley
Oct 17 2015 00:37
<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;
  }

  .smaller-image {
    width: 100px;
  }

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

</style>

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Bill
@kirah1314
Oct 17 2015 00:39
@GregFoley someone had the same issue yesterday too. I would suggest to just skip it and move on then later come back to finish it after FCC fix it
DJ
@qualitymanifest
Oct 17 2015 00:40
yeah that looks fine to me
Matt Leonard
@matty22
Oct 17 2015 00:40
Hmm...that looks good to me.
Greg Foley
@GregFoley
Oct 17 2015 00:40
Works for you guys?
Matt Leonard
@matty22
Oct 17 2015 00:40
Try this:
border: 10px solid green;
In your class
DTing
@dting
Oct 17 2015 00:41
@GregFoley your code works for me
what browser are you using?
Greg Foley
@GregFoley
Oct 17 2015 00:42
@matty22
same error
@dting Firefox, and I tried Chrome too. On Windows.
Brandon Braun
@bmb330
Oct 17 2015 00:42
@GregFoley the code works for me as well, just pasted in and passed the test
Greg Foley
@GregFoley
Oct 17 2015 00:43
Hmmm... what browser and OS?
Should I submit a but report... haven't done that yet.
Brandon Braun
@bmb330
Oct 17 2015 00:43
Im using Chromium on Arch Linux
DTing
@dting
Oct 17 2015 00:43
working on chrome osx
Greg Foley
@GregFoley
Oct 17 2015 00:43
(bug)
DTing
@dting
Oct 17 2015 00:44
try reseting
the code
err
and hard refreshing
Greg Foley
@GregFoley
Oct 17 2015 00:44
@dting I've tried both a few times.
VeeShostak
@VeeShostak
Oct 17 2015 00:45
interesting. I solved that waypoint but when I click view my solution, the 10px thing also appears as unsolvable
http://freecodecamp.com/challenges/waypoint-add-borders-around-your-elements#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%20%20%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%20border-style%3A%20solid%3B%20border-width%3A%2010px%3B%0A%20%20%7D%0A%20%20%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%0A%0A%3Cp%20class%3D%22red-text%22%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A%3Cp%20class%3D%22red-text%22%3EPurr%20jump%20eat%20the%20grass%20rip%20the%20couch%20scratched%20sunbathe%2C%20shed%20everywhere%20rip%20the%20couch%20sleep%20in%20the%20sink%20fluffy%20fur%20catnip%20scratched.%3C%2Fp%3E%0A
Brandon Braun
@bmb330
Oct 17 2015 00:45
That's strange, shows solved when I click the link
DTing
@dting
Oct 17 2015 00:45
FreeCodeCamp/FreeCodeCamp#3204
Greg Foley
@GregFoley
Oct 17 2015 00:46
@VeeShostak what browser/os?
DTing
@dting
Oct 17 2015 00:46
@GregFoley
VeeShostak
@VeeShostak
Oct 17 2015 00:46
Chrome windows 10
DTing
@dting
Oct 17 2015 00:46
do you scale your browser?
Bill
@kirah1314
Oct 17 2015 00:46
@VeeShostak your link shows all checks green for me
Greg Foley
@GregFoley
Oct 17 2015 00:46
Not sure what scale means.
VeeShostak
@VeeShostak
Oct 17 2015 00:46
@dting I got it
I scaled to 100%
and it passed
DTing
@dting
Oct 17 2015 00:46
press view
and click actual size
or control 0 i think on windows. cmd 0 on mac
if you change the zoom on your browser it will change the width of the border
which makes the tests fail
Bill
@kirah1314
Oct 17 2015 00:48
hold ctrl and scroll your mouse track also scales the zoom
VeeShostak
@VeeShostak
Oct 17 2015 00:49
@dting amazing spot. thanks
CamperBot
@camperbot
Oct 17 2015 00:49
veeshostak sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1412 | @dting | http://www.freecodecamp.com/dting
DJ
@qualitymanifest
Oct 17 2015 00:51
@dting ooohhhhhh right i forgot, i had that problem once. maybe even the same waypoint. funny
Greg Foley
@GregFoley
Oct 17 2015 00:57
I had Windows/Display control panel set to 125% (getting old). I changed it and restarted and now it passes.
Thanks for pointing me in the right direction.
CamperBot
@camperbot
Oct 17 2015 00:57
if you want to thank someone, put an @ before their name!
Stefan Stokic
@StefanStokic
Oct 17 2015 01:02
Hi guys! So I've been working on a twitter clone (front-end only for now) www.kinginthenorth.github.io |
However, now I wish to connect it to a backend/database for persistency
Any recommendations?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 01:07
@alanbuchanan :point_up: October 17, 2015 5:38 AM
Because you're top 24% of this year but apparently, you prefer to keep an air of mystery about you. :P
Rory Smith
@alanbuchanan
Oct 17 2015 01:08
@abhisekp i think it just says that for users who don't write a profile?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 01:09
@alanbuchanan yep! I guess so. But it looks cool in your profile tho. :sunglasses:
Brian K
@BKtheDAD
Oct 17 2015 01:11
help mutations
CamperBot
@camperbot
Oct 17 2015 01:11

:point_right: bonfire mutations [wiki]

Problem Explanation:

  • Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array..
:pencil: read more about bonfire mutations on the FCC Wiki
Brian K
@BKtheDAD
Oct 17 2015 01:17
is ther an easy way to change [“hello”, “hey”] to [“hello”],[“hey”]
Matt Leonard
@matty22
Oct 17 2015 01:19
@bkthegeek How about
var newArray = array1.pop()
Dharmang Hansaliya
@hansaliyad1
Oct 17 2015 01:20
hello guys
I m working this chapter
the challenge was to Nest your p element inside your div element.
Brian K
@BKtheDAD
Oct 17 2015 01:20
@matty22 yes, that’s what I was looking for
thank you
CamperBot
@camperbot
Oct 17 2015 01:20
if you want to thank someone, put an @ before their name!
Dharmang Hansaliya
@hansaliyad1
Oct 17 2015 01:21
and I did this <div><p></p></div>
then too its failing test
any idea
Matt Leonard
@matty22
Oct 17 2015 01:23
hansa can you show us all of your code?
KofiAkorli
@KofiAkorli
Oct 17 2015 01:43

hello guys, having a bit of a problem with Waypoint 39 in Basic Javascript

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

Is his code correct?

DTing
@dting
Oct 17 2015 01:45
@KofiAkorli try without the space
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[1]).html(slotTwo);
    $($(".slot")[2]).html(slotThree);
YI JIANG
@meet999
Oct 17 2015 01:45

// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3

var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
myArray = myArray.pop("john",23);
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);

help bb
DTing
@dting
Oct 17 2015 01:46
@meet999 you need to assign the value popped off myArray to removed
currecntly with your code you pop off the last element then assign myRemoved to that changed array
see the example in the comments
where they assign the popped off element to the "removed" variable
KofiAkorli
@KofiAkorli
Oct 17 2015 01:47
@dting yeah, just tried that, still not working
DTing
@dting
Oct 17 2015 01:47
what did you change your code to?
i see
YI JIANG
@meet999
Oct 17 2015 01:47
uyghur.png
DTing
@dting
Oct 17 2015 01:48
now you have changed myArray into the removed element
the pop function returns the element you removed
and mutates the array you called it on
so if you do myArray = myArray.pop();
myArray has now become the element you popped off. it is no longer the array
YI JIANG
@meet999
Oct 17 2015 01:49
i don't know bb
DTing
@dting
Oct 17 2015 01:49
you want to assign that element you popped off to myRemoved not myArray
YI JIANG
@meet999
Oct 17 2015 01:49
can i write it ?
var my Array = myArray.pop();?
DTing
@dting
Oct 17 2015 01:50
you cant have spaces in your variable names
why not directly assign the removed variable
YI JIANG
@meet999
Oct 17 2015 01:50
removed = myArray.pop("cat",2);
what should i do?
DTing
@dting
Oct 17 2015 01:51
you dont need the arguemnts
YI JIANG
@meet999
Oct 17 2015 01:51
var myArray = myArray.pop();
?
DTing
@dting
Oct 17 2015 01:51
removed
YI JIANG
@meet999
Oct 17 2015 01:52
which one is right?
DTing
@dting
Oct 17 2015 01:52
not myArray needs to be assigned the result of myArray.pop()
instead of adding a new line
add your function call to the var removed = array;line
YI JIANG
@meet999
Oct 17 2015 01:55
var popped = ("cat",2).pop;
?
var myArray = ().pop?
DTing
@dting
Oct 17 2015 01:56
var removed = myArray.pop();
now you have a variable "removed" set to the element that was popped off myArray
and myArray is mutated by the pop function call
so both of the criteria are met
YI JIANG
@meet999
Oct 17 2015 02:02
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
var myArray = myArray.pop("John",23)
// Only change code above this line.
// We use this function to show
how to remove the "jogn 23
john 23
DTing
@dting
Oct 17 2015 02:03
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23] // DELETE THIS
that second line just squashed your assigned variable on the previous line
also pop doesnt take arguments
you dont need call it with "cat", 2
LKian
@LKian
Oct 17 2015 02:04
does anyone here feel like looking at my html/css
can't get the banners to line up on the right end.
mostly curious why.
KofiAkorli
@KofiAkorli
Oct 17 2015 02:06
@kahwasaurus sure let's have a look
bruglesco
@bruglesco
Oct 17 2015 02:08
yeah show it
YI JIANG
@meet999
Oct 17 2015 02:09
56.png
I'm so confused
Adam Schmidt
@Chimasu
Oct 17 2015 02:11
@meet999 what are you confused on
bruglesco
@bruglesco
Oct 17 2015 02:13
@meet999 you dont need to add a value to the pop() method
Varun Upadhyay
@varunu28
Oct 17 2015 02:16
I have just started here and on 47th task of HTML/CSS track (Waypoint: Style the HTML Body Element) The page seems to be broken.What should I do?
KofiAkorli
@KofiAkorli
Oct 17 2015 02:19
@varunu28 broken how?
can you be more specific?
YI JIANG
@meet999
Oct 17 2015 02:20
can u write a answer to me bb
@bruglesco
I'm not smart
@Chimasu
Rex Schrader
@SaintPeter
Oct 17 2015 02:21
@meet999 What would be the point of us writing the answer? You wouldn't learn anything from it.
YI JIANG
@meet999
Oct 17 2015 02:21
removed should only contain ["cat", 2].
how to do the sedound step?
Rex Schrader
@SaintPeter
Oct 17 2015 02:22
@meet999 pop() on an array removes the last element of the array and returns it.
Varun Upadhyay
@varunu28
Oct 17 2015 02:22
@KofiAkorli The task asks me to change the background color of the body tag but the text editor is completely blank
Rex Schrader
@SaintPeter
Oct 17 2015 02:22
@meet999 So all you need to do is pop the value off the array and you're done.
Varun Upadhyay
@varunu28
Oct 17 2015 02:22
ok
It works now
Rex Schrader
@SaintPeter
Oct 17 2015 02:22
@meet999 pop takes no arguments and modifes the array it is called on. It returns the element(s) removed
Varun Upadhyay
@varunu28
Oct 17 2015 02:22
thanks :)
CamperBot
@camperbot
Oct 17 2015 02:22
if you want to thank someone, put an @ before their name!
Jordan Shackelford
@JordanShackelford
Oct 17 2015 02:23
My codepen project is stuck on a gray screen saying "loading........."
Varun Upadhyay
@varunu28
Oct 17 2015 02:23
@KofiAkorli Thanks
@camperbot Thank you too for reminding me this :)
CamperBot
@camperbot
Oct 17 2015 02:23
varunu28 sends brownie points to @kofiakorli and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 364 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 169 | @kofiakorli | http://www.freecodecamp.com/kofiakorli
YI JIANG
@meet999
Oct 17 2015 02:24

var pop = ("John",23);

?

Rex Schrader
@SaintPeter
Oct 17 2015 02:25
@meet999 pop is a function of all arrays. You use it like someArray.pop().
@meet999 It returns a value, which means you can assign it to a new variable:
var someArray = [ 1, 2, 3, 4, 5];
var someResult = someArray.pop()`
// someResult contains 5, the last number on someArray
YI JIANG
@meet999
Oct 17 2015 02:28
var removed = myArray.pop();?
no work
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:29
YI JIANG
@meet999
Oct 17 2015 02:31
var myArray = ("John",23).pop;
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:32
@meet999 did you read the whole pg.?
YI JIANG
@meet999
Oct 17 2015 02:32
no
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:32
@meet999 read it. There are example too
Rex Schrader
@SaintPeter
Oct 17 2015 02:32
@meet999 var removed = myArray.pop(); should work, but you may have some other code still there. That needs to be the ONLY code with removed
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:33
@meet999 btw, an array is written like this ["John",23] not like this ("John",23)
YI JIANG
@meet999
Oct 17 2015 02:34
how to remove the first element?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:34
bruglesco
@bruglesco
Oct 17 2015 02:34
thats irrelevant for that challenge
YI JIANG
@meet999
Oct 17 2015 02:35
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
var removed = myArray.pop("John",23);
bruglesco
@bruglesco
Oct 17 2015 02:36
nothing should be in the parenthesis of the pop() method
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:37
@meet999 did you read the manual pg. I just linked? https://devdocs.io/javascript/global_objects/array/pop
pls read it. It's for your benefit
DTing
@dting
Oct 17 2015 02:37
@meet999 as i said before
your second line
you are overwriting the variable you set when you repeat them
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
var removed = myArray.pop("John",23);
you just changed removed 3 times
var removed = myArray.pop();
thats it
YI JIANG
@meet999
Oct 17 2015 02:39
i did
bruglesco
@bruglesco
Oct 17 2015 02:39
1 line
YI JIANG
@meet999
Oct 17 2015 02:39
not work
Rex Schrader
@SaintPeter
Oct 17 2015 02:39
@meet999 Share your code again, please
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:39
This message was deleted
explain format
CamperBot
@camperbot
Oct 17 2015 02:39

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:39
@meet999 :point_up: October 17, 2015 8:09 AM
YI JIANG
@meet999
Oct 17 2015 02:40
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
var removed = myArray.pop();
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
bruglesco
@bruglesco
Oct 17 2015 02:40
you need to remove the extra lines
YI JIANG
@meet999
Oct 17 2015 02:40
which one is extra lines?
DTing
@dting
Oct 17 2015 02:40
// Only change code below this line.
var removed = myArray.pop("cat",2);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
var removed = myArray.pop();
// Only change code above this line.
bruglesco
@bruglesco
Oct 17 2015 02:40
1 line- thats it
DTing
@dting
Oct 17 2015 02:40
thats is still 3 assignements
// Only change code below this line.
var removed = myArray.pop();
// Only change code above this line.
YI JIANG
@meet999
Oct 17 2015 02:41
remove this one?
var removed = myArray.pop();
DTing
@dting
Oct 17 2015 02:41
no
keep that one
remove the other stuff
YI JIANG
@meet999
Oct 17 2015 02:43
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop("cat",2);
var removed = myArray.pop("John",23); // This should be ["cat", 2] and myArray should now be ["John", 23]
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:43
damn! :P
DTing
@dting
Oct 17 2015 02:43
...
Rex Schrader
@SaintPeter
Oct 17 2015 02:43
I suspect we're being trolled.
CamperBot
@camperbot
Oct 17 2015 02:43
:trollface: troll problems? notify admins here
Rex Schrader
@SaintPeter
Oct 17 2015 02:43
@meet999 I don't believe we can help you.
DTing
@dting
Oct 17 2015 02:44
hah
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:44
@meet999
Copy paste this
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop();
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
bruglesco
@bruglesco
Oct 17 2015 02:45
so is anyone here familiar with media queries?
css that is
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:45
@bruglesco what's up with it?
KofiAkorli
@KofiAkorli
Oct 17 2015 02:46
@bruglesco i've dabbled a little
bruglesco
@bruglesco
Oct 17 2015 02:46
So I wanna do mobile first but at what breakpoint
I know the reason the answers are all so different is because phones are all so different now but I do I figure out what will work for my site
how*
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:48
@bruglesco write normal css
Just use @media for > 768px or any other values for larger devices
KofiAkorli
@KofiAkorli
Oct 17 2015 02:48
@bruglesco you can google the various widths you need to work with but i suggest you take a look at bootstrap, it makes it waaay easier
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:49
@bruglesco or take a look at http://semantic-ui.com
bruglesco
@bruglesco
Oct 17 2015 02:50
thx
CamperBot
@camperbot
Oct 17 2015 02:50
if you want to thank someone, put an @ before their name!
bruglesco
@bruglesco
Oct 17 2015 02:50
thx @KofiAkorli @abhisekp
@KofiAkorli @abhisekp thanks
CamperBot
@camperbot
Oct 17 2015 02:50
bruglesco sends brownie points to @kofiakorli and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 172 | @kofiakorli | http://www.freecodecamp.com/kofiakorli
:star: 606 | @abhisekp | http://www.freecodecamp.com/abhisekp
Juan Martínez
@jbmartinez
Oct 17 2015 02:50
@bruglesco put the breakpoints at the resolutions your layout looks ugly or not usable
each layout is different
bruglesco
@bruglesco
Oct 17 2015 02:51
@jbmartinez kinda what I had in mind
whats the best way to figure that out
@bruglesco resize your browser
Seems too much work? Use a frame-work. ;)
bruglesco
@bruglesco
Oct 17 2015 02:53
Im avoiding the framework in an effort to learn how this actually works
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:54
@bruglesco sure. Then a minimal design will suffice. Not for production
bruglesco
@bruglesco
Oct 17 2015 02:54
yeah its for the first zipline
KofiAkorli
@KofiAkorli
Oct 17 2015 02:54
@abhisekp resizing your browser isn't very efficient, personally i use the developer tools in chrome and firefox
bruglesco
@bruglesco
Oct 17 2015 02:54
I figured it would be a suitably small enough piece to practice on
@KofiAkorli how can I use the dev tools to determine break points?
hah nvm
3 secs of toying with it to figure it out
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:56
@KofiAkorli k. But Why do you think it as ineffective? Any article or something about it?
KofiAkorli
@KofiAkorli
Oct 17 2015 02:57
@abhisekp it just makes it harder to determine the particular widths to apply the breakpoint fixes to
i use responsivepx or the dev tools in the browsers
Abhisek Pattnaik
@abhisekp
Oct 17 2015 02:57
@KofiAkorli oh! for developing. I thot for testing.
bruglesco
@bruglesco
Oct 17 2015 02:58
@KofiAkorli thanks
CamperBot
@camperbot
Oct 17 2015 02:58
bruglesco sends brownie points to @kofiakorli :sparkles: :thumbsup: :sparkles:
:warning: bruglesco already gave kofiakorli points
KofiAkorli
@KofiAkorli
Oct 17 2015 03:00
@abhisekp yeah, i actually use it for developing and for testing i open my sites on as many different phones as i can
@bruglesco you're welcome
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:00
@KofiAkorli what!!
Did you say many different phones?
How many do you possess?
KofiAkorli
@KofiAkorli
Oct 17 2015 03:01
@abhisekp yeah, phones and tablets actually, just to make sure it displays well
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:01
@KofiAkorli in dev tools or as in hardware?
KofiAkorli
@KofiAkorli
Oct 17 2015 03:02
chrome has quite a few in it dev tools, also i borrow my friends' phones to do testing on
i personally own just one
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:03
@KofiAkorli are your friend generous enough to hand over their phone to a web dev? :P
don't they know you break now and then. ;)
Parker Harris Emerson
@emersonp
Oct 17 2015 03:04
If I want to share some javascript, do I just paste it here, or should I share it with the channel via another method?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:04
explain format
CamperBot
@camperbot
Oct 17 2015 03:04

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:04
@emersonp :point_up: October 17, 2015 8:34 AM
KofiAkorli
@KofiAkorli
Oct 17 2015 03:04
@abhisekp hahaha, they understand
Parker Harris Emerson
@emersonp
Oct 17 2015 03:05
Thanks @abhisekp!
CamperBot
@camperbot
Oct 17 2015 03:05
emersonp sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 607 | @abhisekp | http://www.freecodecamp.com/abhisekp
KofiAkorli
@KofiAkorli
Oct 17 2015 03:05
@abhisekp and so long as the phones are still functioning when i hand it over to them they're okay
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:06
@KofiAkorli have you ever paid for breaking. No not the CSS ones. :P
Parker Harris Emerson
@emersonp
Oct 17 2015 03:06
So, I've got some javascript problems. I'm working on Zipline Build a Random Quot[ation] Machine.
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:06
@emersonp nice. :+1:
Parker Harris Emerson
@emersonp
Oct 17 2015 03:06
Javascript from my CodePen:
function getQuot() {
  var quotations = ["We can never give up longing and wishing while we are thoroughly alive. There are certain things we feel to be beautiful and good, and we must hunger after them.@George Eliot#The Mill on the Floss", "How wonderful it is that nobody need wait a single moment before starting to improve the world.@Anne Frank#The Diary of a Young Girl", "There will be little rubs and disappointments everywhere, and we are all apt to expect too much; but then, if one scheme of happiness fails, human nature turns to another; if the first calculation is wrong, we make a second better: we find comfort somewhere.@Jane Austen#Mansfield Park", "Fight till the last gasp.@William Shakespeare#Henry VI, Part One", "Get busy living or get busy dying.@Stephen King#The Shawshank Redemption", "We are all in the gutter, but some of us are looking at the stars.@Oscar Wilde#Lady Windermere's Fan", "The sun himself is weak when he first rises, and gathers strength and courage as the day gets on.@Charles Dickens#The Olde Curiosity Shop", "They wanted to speak, but could not; tears stood in their eyes. They were both pale and thin; but those sick pale faces were bright with the dawn of a new future, of a full resurrection into a new life. They were renewed by love; the heart of each held infinite sources of life for the heart of the other.@Fyodor Dostoevsky#Crime and Punishment"]

  quotation = quotations[Math.floor(Math.random() * quotations.length)];
  return [quotation.split('@')[0]].concat(quotation.split('@')[1].split('#'))
};

$(document).ready(function() {
  var quotSet = getQuot();
  $(".random-quotation").text(quotSet[0]);
  $(".random-author").text(quotSet[1]);
  $(".random-text").text(quotSet[2]);
  $(".twitter-share-button").attr("data-text", quotSet[0]);
  $(".go").click(function() {
    var quotSet = getQuot();
    $(".twitter-share-button").attr("data-text", quotSet[0]);
    $(".random-quotation").text(quotSet[0]);
    $(".random-author").text(quotSet[1]);
    $(".random-text").text(quotSet[2]);
  });
});

! function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    p = /^http:/.test(d.location) ? 'http' : 'https';
  if (!d.getElementById(id)) {
    js = d.createElement(s);
    js.id = id;
    js.src = p + '://platform.twitter.com/widgets.js';
    fjs.parentNode.insertBefore(js, fjs);
  }
}(document, 'script', 'twitter-wjs');
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:07
@emersonp you could've linked to your codepen :(
Parker Harris Emerson
@emersonp
Oct 17 2015 03:07
I'm working on the bonus - add a Twitter button.
OH.
See, that's what I'm talking about!
So.
KofiAkorli
@KofiAkorli
Oct 17 2015 03:07
@abhisekp nope, not yet, and i hope that never happens
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:08

@KofiAkorli What about the adage

Break it till you make it.

Parker Harris Emerson
@emersonp
Oct 17 2015 03:08
The Tweet button properly loads when the page does with the quotation, but it doesn't load when the quotation refreshes.
So I'm kind of at a loss.
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:10
@emersonp I don't see any issues?
KofiAkorli
@KofiAkorli
Oct 17 2015 03:10
@abhisekp hahaha ... mmm ...don't think i've heard that one before
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:11

@KofiAkorli Well, it's actually

Fake it till you make it. ;)

Parker Harris Emerson
@emersonp
Oct 17 2015 03:11
(And by load, I mean the text that the button should tweet.) When the page loads, the tweet text matches the quotation. But if you click new quotation, then the tweet text doesn't match the quotation.
KofiAkorli
@KofiAkorli
Oct 17 2015 03:11
@abhisekp ah yes, that one i know
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:12

@emersonp

Get busy living or get busy dying.

That's what it shows everytime
KofiAkorli
@KofiAkorli
Oct 17 2015 03:12
signing out now, it's 3 am here and I need my beauty sleep later @abhisekp
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:12
@KofiAkorli oh! I forgot to sleep last night. :P
@KofiAkorli Sleep well. bye :wave: Happy :sleeping:
KofiAkorli
@KofiAkorli
Oct 17 2015 03:13
yeah, i understand life of a coder @abhisekp
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:13
:)
@emersonp where are you updating your quotation text in your twitter btn?
Parker Harris Emerson
@emersonp
Oct 17 2015 03:15
@abhisekp - Oh that's weird. For me, I'm getting randomization.
In the javascript of the codepen.
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:16
@emersonp anyway, take a look at this https://dev.twitter.com/web/tweet-button/web-intent
Parker Harris Emerson
@emersonp
Oct 17 2015 03:17
Yeah, I got the twitter stuff. I'm able to populate the tweet. It's just not updating after I get a new random quotation.
Matt Yamamoto
@MattYamamoto
Oct 17 2015 03:18
@emersonp no, I think @abhisekp is saying to go about the tweet in a different way. What you're doing is creating a bunch of i-frames or something like that...that seems to be the issues
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:20
@emersonp you're using widgets in an iframe. rt? Well, you can't change codes inside iframes. Restricted by browser due to security vulnerability.
Parker Harris Emerson
@emersonp
Oct 17 2015 03:20
Oh, okay. I'll try plugging away at it. Thanks for the link @abhisekp, and thanks @MattYamamoto.
CamperBot
@camperbot
Oct 17 2015 03:20
emersonp sends brownie points to @abhisekp and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: emersonp already gave abhisekp points
:star: 380 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Oct 17 2015 03:20
oh yeah, I shouldn't have said a bunch of iframes... you have an iframe
Abhisek Pattnaik
@abhisekp
Oct 17 2015 03:21
@emersonp Create your button using https://dev.twitter.com/web/tweet-button/web-intent
as @MattYamamoto puts it — in a different way ;)
Matt Yamamoto
@MattYamamoto
Oct 17 2015 03:22
haha...yup. @emersonp it's super easy that way.
Parker Harris Emerson
@emersonp
Oct 17 2015 03:45
Oh. CodePen doesn't allow window.open(). Right. Of course.
Zipline completed. Thank you everybody.
CamperBot
@camperbot
Oct 17 2015 03:45
if you want to thank someone, put an @ before their name!
Levyian
@levyian
Oct 17 2015 04:25
@emersonp what JavaScript framework are you using?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 04:26
@levyian emersonp's pen http://codepen.io/emersonp/pen/dYZXBg
@emersonp it seems you've not put much effort in your quote machine. Why not improve it?
Levyian
@levyian
Oct 17 2015 04:29
@abhisekp ah ok. Thanks for sharing
CamperBot
@camperbot
Oct 17 2015 04:29
levyian sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 608 | @abhisekp | http://www.freecodecamp.com/abhisekp
Jason
@Jauble
Oct 17 2015 05:03
@abhisekp is there any way to .shift() where the number at index 1 moves to index 0?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:03
@Jauble well, that's the shift. Isn't it?
@Jauble or do you wanna rotate?
@Jauble
var arr = [2, 5, 6];
arr.push(arr.shift()) && arr;
// [5, 6, 2]
arr.push(arr.shift()) && arr;
// [6, 2, 5]
arr.push(arr.shift()) && arr;
// [2, 5, 6]
Jason
@Jauble
Oct 17 2015 05:07
@abhisekp what's the && arr?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:10
@Jauble as you know, the shift method returns the popped out value, we push the returned value in by passing it to arr.push method.
And as you know the push method returns the length of the array, we can't assign it to anything and if we want to assign, then we must return the modified array. Hence, the && arr ensures that I evaluate the 2nd operand of && which will make the output of the whole expression as the arr itself.
In this case, it's bogus.
Jason
@Jauble
Oct 17 2015 05:16
@abhisekp I don't know what's going on lol. It doesn't seem like it's working right in what i'm working on, but when I just tried it by itself, it does "shift" it over.
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:16
@Jauble :point_up: October 17, 2015 10:40 AM Updated
Jason
@Jauble
Oct 17 2015 05:18
I think I'm just too tired to be working on this right now lol
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:20
@Jauble I explained with all zeal and you say you're tired?
That's disappointing. :(
:P
Jason
@Jauble
Oct 17 2015 05:22
@abhisekp Sorry :worried: lol
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:23
@Jauble no worries. Just kidding. :D
Jason
@Jauble
Oct 17 2015 05:25
@abhisekp Ya I know :P. I got my function working too. The problem wasn't with shift after all lol
DJ
@qualitymanifest
Oct 17 2015 05:33
tax
CamperBot
@camperbot
Oct 17 2015 05:33
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:34
@qualitymanifest what you doing? It's not resolved. The admin is on vacation. :P
lolz
DJ
@qualitymanifest
Oct 17 2015 05:38
@abhisekp oh i was just testing that out to see if it was fixed. so you've done a PR then, it just hasn't been added yet?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:40
@qualitymanifest i've not done a PR yet bcoz the regex I found was flawed. And moreover, dcsan is on vacation out to Japan. (i dunno if he returned yet!). But we have some other open PRs which needs to be merged.
DJ
@qualitymanifest
Oct 17 2015 05:41
@abhisekp right, i remember you said something about it, like it caused the bot to freeze?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 05:43
@qualitymanifest sometimes, it caused the bot to end abruptly but I'm not sure if regex is the issue. And moreover, the regex i created is flawed i.e. it doesn't work properly for tq
DJ
@qualitymanifest
Oct 17 2015 05:48
@abhisekp ah. yeah i still need to figure out how to run gitterbot on my computer so i can test things out. i read through the installation instructions at https://github.com/dcsan/gitterbot but only got as far as installing node and npm before getting distracted. maybe tomorrow i'll get it set up. it's bed time though. night!
Abhisek Pattnaik
@abhisekp
Oct 17 2015 06:02
bf chunky
CamperBot
@camperbot
Oct 17 2015 06:02

:fire:Bonfire: Chunky Monkey :link:

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

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

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

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 17 2015 06:02
bf details
CamperBot
@camperbot
Oct 17 2015 06:02

:fire:Bonfire: Chunky Monkey :link:

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

chunk(['a', 'b', 'c', 'd'], 2);
Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Abhisek Pattnaik
@abhisekp
Oct 17 2015 06:02
@haribol007 :point_up: October 17, 2015 11:32 AM
Pravin Kerai
@yamd00t
Oct 17 2015 06:17
@abhisekp Thanks Abhisekp
CamperBot
@camperbot
Oct 17 2015 06:17
haribol007 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 609 | @abhisekp | http://www.freecodecamp.com/abhisekp
Meghan
@MeghanG
Oct 17 2015 06:24
Has anyone else had issues with windows 8? My phone screen is all white and the instructions with the check marks are missing... any thoughts?
Jason
@Jauble
Oct 17 2015 06:26
That's how they get you to upgrade to windows 10 lol
Meghan
@MeghanG
Oct 17 2015 06:30
that didn't work either, I got some error with no resolution!
Jason
@Jauble
Oct 17 2015 06:33
I dunno, sorry :worried:
Meghan
@MeghanG
Oct 17 2015 06:35
I just need to throw this thing out the window! thanks tho!
CamperBot
@camperbot
Oct 17 2015 06:35
if you want to thank someone, put an @ before their name!
Jason
@Jauble
Oct 17 2015 06:39
lol np
Yawar Jamal
@yj7o5
Oct 17 2015 06:48
does anyone wanna pair?
Levyian
@levyian
Oct 17 2015 06:57
I have a problem - none of my solutions (bonfires and waypoints) will show properly. I am only able to see the first two lines of code. Is there a known fix for this?
@MeghanG Is it an issue with the OS or the browser?
jlbelljr
@jlbelljr
Oct 17 2015 07:02
i always have to put my cursor at the end and hit enter then ithe rest shows up
JoelLindsey
@JoelLindsey
Oct 17 2015 07:06
blob
Anyone know where i messed up?
Meghan
@MeghanG
Oct 17 2015 07:09
@levyian I'm thinking it's a browser issue. I'm currently updating so that might fix it.
Levyian
@levyian
Oct 17 2015 07:11
@jlbelljr do you mean the end of the code in the editor? or the end of the code in the address bar? (neither works so far)
@MeghanG ah ok. Let me know how is goes and I'll try to help further.
jlbelljr
@jlbelljr
Oct 17 2015 07:13
@levyian in the code editor when it loads a new waypoint sometimes there is just a line or two there and the rest wont load til i actually click in the box and hit enter....then the rest appears...its weird but thats how it works for mine
@levyian and i am using opera
Levyian
@levyian
Oct 17 2015 07:16
@jlbelljr It seems to be a browser issue. I tried chrome and it worked fine but wouldn't in firefox. Thanks for the pointer
CamperBot
@camperbot
Oct 17 2015 07:16
levyian sends brownie points to @jlbelljr :sparkles: :thumbsup: :sparkles:
:star: 110 | @jlbelljr | http://www.freecodecamp.com/jlbelljr
jlbelljr
@jlbelljr
Oct 17 2015 07:17
sweet thanks @levyian
DTing
@dting
Oct 17 2015 07:24
@JoelLindsey You should return that code you wrote
instead of Math.random();
JoelLindsey
@JoelLindsey
Oct 17 2015 07:27
@dting oh so put myFunction instead?
Jose E. Pimentel
@jedpimentel
Oct 17 2015 07:28
@JoelLindsey you should save the logic inside a variable, then return the variable
DTing
@dting
Oct 17 2015 07:28
@JoelLindsey no.
you have an expression that is evaluated that isnt assigned to anything or returned.
The code you added gets run but you dont do anything with it
they want you to return the result of that code you added instead of Math.random(); (The original return statement)
JoelLindsey
@JoelLindsey
Oct 17 2015 07:32
@dting oops something happend messed everything up
DTing
@dting
Oct 17 2015 07:36
try resetting the code
JoelLindsey
@JoelLindsey
Oct 17 2015 07:36
oh @dting It worked now Thanks
CamperBot
@camperbot
Oct 17 2015 07:36
joellindsey sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1415 | @dting | http://www.freecodecamp.com/dting
ARodz
@AromaR
Oct 17 2015 08:05
hey people help me out
question: See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
my code:

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

public Bike.getSpeed = function () {
return addUnit(speed);

};

};

// Only change code above this line.

Jose E. Pimentel
@jedpimentel
Oct 17 2015 08:08
@AromaR try posting the whole code for context (not just the part you edited)
help code format
CamperBot
@camperbot
Oct 17 2015 08:08

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Jose E. Pimentel
@jedpimentel
Oct 17 2015 08:08
code format
help
CamperBot
@camperbot
Oct 17 2015 08:08

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

ARodz
@AromaR
Oct 17 2015 08:11
...

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

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

public Bike.getSpeed = function () {
return addUnit(speed);

};

};

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

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

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

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

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

};

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

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
Meghan
@MeghanG
Oct 17 2015 08:12
@levyian the update failed again so im thinking its the os...
Jose E. Pimentel
@jedpimentel
Oct 17 2015 08:13
@AromaR you can make the properties private by replacing them with var something = ... instead of this.something = ...
ARodz
@AromaR
Oct 17 2015 08:15
what about making them public?
Jose E. Pimentel
@jedpimentel
Oct 17 2015 08:15
@AromaR for .getSpeed to be public you should use this.getSpeed (Iwithout thepublic`)
(the ones you are making private where already public, for example
Levyian
@levyian
Oct 17 2015 08:16
@MeghanG as in you were able to update but it didn't fix the issue?
Meghan
@MeghanG
Oct 17 2015 08:29
@levyian the update failed.
Levyian
@levyian
Oct 17 2015 08:31
@MeghanG hmm, ok lets do private chat since its not specific to programming
Meghan
@MeghanG
Oct 17 2015 08:32
ok, great!
Celso Mireles
@celsom3
Oct 17 2015 09:51
Having trouble with the Chunky Monkey exercise
function chunk(arr, size) {
  // Break it up.
  var newArray = [];
  var subArray = [];
  var cursor = 0;

  for (var i = 0; i < arr.length; i++){
    if(subArray.length < size){
      subArray.push(arr[i]);
    }else{
      newArray.push(subArray);
      subArray = [];
    }
  }

  return newArray;
}

chunk(["a", "b", "c", "d"], 2);
marzelin
@marzelin
Oct 17 2015 10:06
@celsom3 try if(subArray.length <= size)
alex
@alexhudici
Oct 17 2015 10:07
as you're iterating through I think you're skipping a value when you go through the } else {
i <= arr.length
and have a subArray.push(arr[i]); at the end of the } else {
marzelin
@marzelin
Oct 17 2015 10:11
yep, @alexhudici is right, try subArray = [arr[i]];
alex
@alexhudici
Oct 17 2015 10:13
I think subArray = [arr[i]]; will reinitialize subArray with an array containing only what is in arr[i]
marzelin
@marzelin
Oct 17 2015 10:21
@alexhudici yes, that's what it supposed to do - enter that skipped value into the subArray
Krzysztof Miąsko
@kmiasko
Oct 17 2015 10:43
@celsom3 you arent pushing last chunk of data, all chunks are in newArray but the last one stays in subArray because your iteration stops at if (if arr.length % size === 0)
Lionel Croes
@lionelx1
Oct 17 2015 11:12

CAN any one help me with this question?
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}

What I would like to know is what function does “this” have?
I completed it but still don’t know what this does or do.

Jose E. Pimentel
@jedpimentel
Oct 17 2015 11:26
@lionelx1 "this" represents the object itself. this.gear refers to the gear property of whichever object contains that code. outside of the object definition, you would access it via Car.gear,
Lionel Croes
@lionelx1
Oct 17 2015 11:28
thanks @jedpimentel
CamperBot
@camperbot
Oct 17 2015 11:28
lionelx1 sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 367 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
SparksMKII
@SparksMKII
Oct 17 2015 11:40

function palindrome(str) {
// Good luck!

str = str.replace(/(.)/g,'')
str = str.toLowerCase().replace(/[\s,._-]+/g,'')
str2 = str.replace(/(.
)/g,'')
str2 = str.toLowerCase().replace(/[\s,._-]+/g,'').split('').reverse().join('')

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

 }
It works but there has to be a way to do this in a single regular expression, anyone that can point me in the right way?
Abhisek Pattnaik
@abhisekp
Oct 17 2015 11:41
explain format
CamperBot
@camperbot
Oct 17 2015 11:41

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Jose E. Pimentel
@jedpimentel
Oct 17 2015 11:42
@SparksMKII if I'm thinking right, I don't think you actually need the regex for the str2 var, since it's already been processed/filtered in the str var
SparksMKII
@SparksMKII
Oct 17 2015 11:45
You're absolutely right although the problem is I couldn't figure out how to remove the parenthesis within the same regex so that still persists now
Jose E. Pimentel
@jedpimentel
Oct 17 2015 11:48
I used str.replace(/\W/gi,"") for mine, but there seems to be a new test case which it fails
it's probably since it doesn't filter the underscore
Abhisek Pattnaik
@abhisekp
Oct 17 2015 11:52
@SparksMKII \W = [^A-Za-z0-9_]
So to also discard underscore _, use \W_
@SparksMKII you can otherwise write it as [^A-Za-z0-9] but that's too cumbersome.
SparksMKII
@SparksMKII
Oct 17 2015 11:55
Still better then what I came up with at first ;)
Abhisek Pattnaik
@abhisekp
Oct 17 2015 11:55
@SparksMKII but you should use a character class to discard one of \W or _ i.e. [\W_] or w/o character class \W|_.
SparksMKII
@SparksMKII
Oct 17 2015 11:58
yea that makes much more sense thanks @abhisekp
CamperBot
@camperbot
Oct 17 2015 11:58
sparksmkii sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 612 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 17 2015 11:59
@SparksMKII hence, the total thing is str.replace(/\W|_/g, '')
Abhijeet De
@iamads
Oct 17 2015 13:00
I am trying to setup for basejump in cloud9 but my installation process gets killed. Pls help
Levyian
@levyian
Oct 17 2015 13:00
@iamads which step?
Abhijeet De
@iamads
Oct 17 2015 13:01
@levyian After yo angular-fullstack
DTing
@dting
Oct 17 2015 13:03
@iamads the new version of yo angular-fullstack doesnt play nice with the free version of c9
Abhijeet De
@iamads
Oct 17 2015 13:04
@dting What should I do?
Levyian
@levyian
Oct 17 2015 13:04
@iamads This is a known issue. The plan is to use Clementine instead of Yoeman
DTing
@dting
Oct 17 2015 13:04
you can do your project locally
Levyian
@levyian
Oct 17 2015 13:05
@iamads This is what i did. in the meantime. It's long, but got the job done. FreeCodeCamp/FreeCodeCamp#3638
  1. delete the entire node_modules folder
  2. edit package.json file and remove all Dev-dependencies and 80% regular dependencies
  3. re-add 4-5 dependencies (then finally Dev-dependencies) at a time
  4. run npm install
  5. repeat step 3 & 4 until all dependencies are installed
Abhijeet De
@iamads
Oct 17 2015 13:06
@levyian trying this
thanks @levyian
CamperBot
@camperbot
Oct 17 2015 13:07
iamads sends brownie points to @levyian :sparkles: :thumbsup: :sparkles:
:star: 321 | @levyian | http://www.freecodecamp.com/levyian
Levyian
@levyian
Oct 17 2015 13:07
@iamads yeah no problem. hope it works out
CBell21985
@CBell21985
Oct 17 2015 13:24
hey can anyone help me with this i cant get the buttons to line up on the same line using bootstrap
<div class="row">
<div class="col-xs-6">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
Miguel Silva
@mini890
Oct 17 2015 13:24
it cant be all six
@CBell21985 try col-xs-4 instead
on bootstrap the grid is max of 12 per row, per line
in this case you are adding 6 + 6 + 6, which is greater than 12
CBell21985
@CBell21985
Oct 17 2015 13:25
ok thanks @mini890
CamperBot
@camperbot
Oct 17 2015 13:25
cbell21985 sends brownie points to @mini890 :sparkles: :thumbsup: :sparkles:
:star: 116 | @mini890 | http://www.freecodecamp.com/mini890
noobstar
@namsir
Oct 17 2015 14:31
wiki format
CamperBot
@camperbot
Oct 17 2015 14:31

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

xSKYx
@xSKYx
Oct 17 2015 14:41
Hi there, I'm stack at the Q 158 not sure how to define slotOne as a random number. I am using : return Math.floor(Math.random()*(3-1+1))+1; Thanks!
Blauelf
@Blauelf
Oct 17 2015 14:45
Why the return? Do you have an inner function there?
And what is the waypoint exactly (specified by name)? "Q 158" is no coordinate system I am aware of.
xSKYx
@xSKYx
Oct 17 2015 14:51
Oh yes, sorry about that, Create a Java Script Slot Machine
Blauelf
@Blauelf
Oct 17 2015 14:52
Are you talking about Basic JavaScript's 37th waypoint "Create a JavaScript Slot Machine"? There, only simple assignments are needed. Three lines, nearly identical, assigning to the three slot variables.
xSKYx
@xSKYx
Oct 17 2015 14:52
Yes, I know it is simple, but I am a bigginer so not so simple for me.
Blauelf
@Blauelf
Oct 17 2015 14:54
return would end the current function and give the parameter as the return value. Instead, you want to assign to those variables. What does your code (between the two lines "below this line" and "above this line") look like?
You mentioned being a beginner, but you do know what an assignment is, yes?
xSKYx
@xSKYx
Oct 17 2015 14:59
I'll try to figure it out.
Mettcon
@Mettcon
Oct 17 2015 16:07
try to put the stuff after the * inside the math.random brackets
whoops... synch issue
using jQuery instead of Angular.
jonnykanai
@jonnykanai
Oct 17 2015 16:17
I can't see any of the output boxes used to display how the code works, once correctly entered. Help!
Avishay
@avishayshushan
Oct 17 2015 16:25
Hey @jonnykanai could you add more details? what do you mean by output boxes?
Hans van Riet
@hansinla
Oct 17 2015 16:25
@jonnykanai ???
Avishay
@avishayshushan
Oct 17 2015 16:26
@jonnykanai are you in the bonfire?
Jason
@jimillett
Oct 17 2015 16:34
Can anyone help me with Waypoint: Make Instances of Objects with a Constructor Function
I don't quite understand the concept of the constructor function and how to use it
there is no example in the instruction panel on the left
Joseph Botros
@josephwasily
Oct 17 2015 16:38
@jimillett the construction function is an function that act as class, first it doesn't return anything (using return keyboard) so it must be constructed (instantiated - created) using " new" keyword , and when you create an variable using a new keyword followed by the class name you have created an "object"
Aleksandar B.
@aleksandar-b
Oct 17 2015 16:49
Selection_021.png
having trouble with git: git push origin <BRANCHNAME>
Jason
@jimillett
Oct 17 2015 16:56
ok thanks @josephwasily I'll give it a shot.
Lance Jordan
@lacostenycoder
Oct 17 2015 16:59
Joseph Botros
@josephwasily
Oct 17 2015 17:01
@samosale the problem is with the link, it returned 403 error
Lance Jordan
@lacostenycoder
Oct 17 2015 17:02
Having trouble with my comp. Gonna do full sys backup. But I want to backup all my .dotfiles. I have some dotfiles such as .env that contain API keys etc. I've checked out https://dotfiles.github.io/ But not sure where, if anywhere online, I should backup my keys. Of course not check-into repo. Any ideas?

@josephwasily the link may be fine, 403 means unauthorized. Github requires SSH keys to pull from repo via ssh. Username and Password will work if you use HTTP link instead. But then you won't be able to push. @samosale. For reference: 10.4.4 403 Forbidden

"The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead."

Joseph Botros
@josephwasily
Oct 17 2015 17:06
@lacostenycoder thanks, my fault!
CamperBot
@camperbot
Oct 17 2015 17:06
josephwasily sends brownie points to @lacostenycoder :sparkles: :thumbsup: :sparkles:
:star: 203 | @lacostenycoder | http://www.freecodecamp.com/lacostenycoder
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:07
@lacostenycoder I am trying to follow the instructions from the link. brb
@samosale I don't know what is my key, when github ask me to enter
Lance Jordan
@lacostenycoder
Oct 17 2015 17:10
blob
@samosale @josephwasily If you want to simply pull from a repo, you can toggle the git repo link to copy via https:
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:10
@lacostenycoder is my key Agent pid 3187
Lance Jordan
@lacostenycoder
Oct 17 2015 17:10
no
@samosale from terminal type: ls -la .ssh
you need id_rsa and id_rsa.pub
@samosale PID is the process ID running on your system
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:11
Selection_022.png
i got this
Lance Jordan
@lacostenycoder
Oct 17 2015 17:12
what repo are you trying to pull from?
Karan Joshi
@Bluespice31
Oct 17 2015 17:13
hey all, i'm on the exercise to change the colored text based on creating a css class and I've done everything right but the i'm not able to proceed further
do you guys think its an error in the website?
Lance Jordan
@lacostenycoder
Oct 17 2015 17:13
@samosale actually, if you're trying to push your local master branch to your github repo, you should type: git push origin master
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:13

@lacostenycoder I am trying to follow this exercises http://jlord.us/git-it/challenges/branches_arent_just_for_birds.html

I am stuck in the last chalenge to push my update to My fork

Lance Jordan
@lacostenycoder
Oct 17 2015 17:14
assuming you've already setup your repo on Github
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:14
@lacostenycoder it says that i should push to my fork
Lance Jordan
@lacostenycoder
Oct 17 2015 17:15
@samosale do you have a Github account?
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:15
@lacostenycoder yes
Jason
@jimillett
Oct 17 2015 17:15
@josephwasily this is my first attempt but it didn't work... what am I doing wrong
var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
var Const = function () {
  this.engines = 1;
Lance Jordan
@lacostenycoder
Oct 17 2015 17:15
where did you fork from?
Aleksander Gębicki
@Takumar
Oct 17 2015 17:16
@samosale and you are on a branch "samosale"?
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:16
@lacostenycoder don't know. @Takumar Yes I was
Lance Jordan
@lacostenycoder
Oct 17 2015 17:17
@samosale type: git branch
paste what it says
also: git remote -v
Aleksander Gębicki
@Takumar
Oct 17 2015 17:18
@samosale you should have branch "add-samosale" I think.
following convention mentioned in this step.
Joseph Botros
@josephwasily
Oct 17 2015 17:18
@jimillett add my name in pair programming
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:18
@lacostenycoder should I first go to folder patcwork, bc I cd .. from there
Jason
@jimillett
Oct 17 2015 17:18
@josephwasily sorry how do I do that?
Joseph Botros
@josephwasily
Oct 17 2015 17:19
var Car = function() {
   this.wheels = 4;
};

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

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

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:19
@Takumar are you shoure is add-samosale or just samosale
Lance Jordan
@lacostenycoder
Oct 17 2015 17:19
@samosale you should be in the same folder where your .git file was setup when you did git init
or if you did not init locally and cloned from a remote repo, then got to that folder
Aleksander Gębicki
@Takumar
Oct 17 2015 17:20
@samosale quotation from your exercise: "Create a branch and name it "add-<username>", where 'username' is your username."
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:20
@Takumar I typed git branch samosale
Jason
@jimillett
Oct 17 2015 17:21
ok I see but I thought you were supposed to use the Const function is the new car() the Const?
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:21
@lacostenycoder i am there
Lance Jordan
@lacostenycoder
Oct 17 2015 17:21
what do you see when you type: git branch
@samosale also when you type: git remote -v
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:22
@lacostenycoder
gh-pages
  • samosale
Aleksander Gębicki
@Takumar
Oct 17 2015 17:22
@samosale I'm not sure if it will pass, I think that I made similar "mistake" writing only my username as name of branch and it didn't pass.
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:22
@Takumar I am sure it is it. I will try that. tnx @Takumar and @lacostenycoder
CamperBot
@camperbot
Oct 17 2015 17:23
samosale sends brownie points to @takumar and @takumar and @lacostenycoder :sparkles: :thumbsup: :sparkles:
:star: 204 | @lacostenycoder | http://www.freecodecamp.com/lacostenycoder
:star: 499 | @takumar | http://www.freecodecamp.com/takumar
:star: 499 | @takumar | http://www.freecodecamp.com/takumar
Joseph Botros
@josephwasily
Oct 17 2015 17:23
@samosale i had the same thing, it should pass right not
Jason
@jimillett
Oct 17 2015 17:24
@josephwasily how do you use pair programming? I got past that waypoint but for future info if someone else asks me to do that how do I do that?
Lance Jordan
@lacostenycoder
Oct 17 2015 17:26
@samosale you have not added YOUR repo as a remote branch
your origin and upstream both point to the original master, not YOUR fork.
Unless you are jlord
Moisés Man
@moigithub
Oct 17 2015 17:27
@jimillett some use screenhero.. others use teamviewer.. and others use some online collaborative platform like cloud9 or nitrous
Jason
@jimillett
Oct 17 2015 17:28
@moigithub Oh ok thanks I am familiar with teamviewer
CamperBot
@camperbot
Oct 17 2015 17:28
jimillett sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 377 | @moigithub | http://www.freecodecamp.com/moigithub
Jason
@jimillett
Oct 17 2015 17:28
I thought it was something built in to gitter or FCC..
Lance Jordan
@lacostenycoder
Oct 17 2015 17:29
@samosale do: git remote rm origin
then: do git remote add origin git@github.com:samosale/patchwork.git
or whatever you correct repo is
upstream is the convention to use when you are working on a fork from someone else's public master. You use "upstream" to refer to their master. Then you use "origin" to refer to YOUR fork where you will push your changes to.
the idea is that you never touch someone else's repo directly. Rather you fork it, create your own public repo. Then do pull request if you want the owner to pull in your contributions from your fork.
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:32
@lacostenycoder is this correct
after.com it should be / right?
git remote add origin git@github.cm/add-samosale/patchwork.git
Lance Jordan
@lacostenycoder
Oct 17 2015 17:33
it looks like your username on github is samosale
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:33
@lacostenycoder yes
Lance Jordan
@lacostenycoder
Oct 17 2015 17:33
so get rid of "add-"
also you need .com not .cm
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:34
@lacostenycoder I have already done that in previous exercise
fatal: remote origin already exists.
Lance Jordan
@lacostenycoder
Oct 17 2015 17:34
you must remove origin first as i said
git remote rm origin
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:36
@lacostenycoder ok i have done that
should I start from the begining?
Lance Jordan
@lacostenycoder
Oct 17 2015 17:36
ok then add your repo as origin
Lance Jordan
@lacostenycoder
Oct 17 2015 17:36
did you add your repo as origin?
@samosale type: git remote add origin git@github.com:samosale/patchwork.git
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:38
@lacostenycoder i have done that
now what
?
Lance Jordan
@lacostenycoder
Oct 17 2015 17:39
@samosale
now you should be able to push
git push origin "whatever your branch is"
if your current branch is "samosale" then you would type:
git push origin samosale
Joseph Botros
@josephwasily
Oct 17 2015 17:40
i got "git@github.com/josephwasily/patchwork.git' does not appear to be a git repository"
Aleksander Gębicki
@Takumar
Oct 17 2015 17:40
@lacostenycoder Maybe I wrote wrong with this "add-username", but in this tutorial in chapter 8 there is reporobot which works on a file "add-username.txt" in repository and maybe it checks if branch is in form of "add-username" or only checks filename. @samosale please write if you manage to do it with branch "samosale".
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:40
@lacostenycoder I have threee of them
darko@android-c5e6e6764297878 ~/patchwork $ git branch
  • add-samosale
    gh-pages
    samosale
Lance Jordan
@lacostenycoder
Oct 17 2015 17:41
Joseph Botros
@josephwasily
Oct 17 2015 17:41
@lacostenycoder thanks
CamperBot
@camperbot
Oct 17 2015 17:41
josephwasily sends brownie points to @lacostenycoder :sparkles: :thumbsup: :sparkles:
:warning: josephwasily already gave lacostenycoder points
Lance Jordan
@lacostenycoder
Oct 17 2015 17:42
@samosale i don't know where you are in lesson but once you have set up your remote origin on github and have added it to your local git repo, you can push any branch you are currently working on
the dot indicates the local branch you are currently in
but you can push any branch you like
Jeff
@Garanimal
Oct 17 2015 17:44
Any Ideas why I cannot copy and paste in my Javascript box?
Lance Jordan
@lacostenycoder
Oct 17 2015 17:44
@josephwasily you're welcome. That freebie is pretty good and will give you a decent understanding of git.
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:44

@lacostenycoder
darko@android-c5e6e6764297878 ~/patchwork $ git push origin samosale
fatal: 'git@github.com/samosale/patchwork.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Lance Jordan
@lacostenycoder
Oct 17 2015 17:45
@samosale is this you? https://github.com/samosale
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:46
@lacostenycoder yes
Lance Jordan
@lacostenycoder
Oct 17 2015 17:46
did you set up your SSH keys on Github?
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:46
@lacostenycoder no, bc i dont know my keys
Manpreet Singh
@designviacode
Oct 17 2015 17:47
Hey everyone :smile: ... I'm stuck at Bonfire: truncate a string ..
My code till now :
function truncate(str, num) {

  if(str.length <= 3) {
    str= str.split('').splice(0,num).join("");
    str+= "...";
    return str;
  }else {
    str= str.split('').splice(0,num-3).join("");
    str+= "...";
    return str;
  }
}
Aleksandar B.
@aleksandar-b
Oct 17 2015 17:47
@lacostenycoder I was thinking that you take remote control on my comp via teamviewer
Lance Jordan
@lacostenycoder
Oct 17 2015 17:50
we can try
@samosale what's your id?
Aleksander Gębicki
@Takumar
Oct 17 2015 17:56
@samosale have you checked that after operations suggested by @lacostenycoder you have good configuration of your remote repository? Maybe run again: git remote -v and see if both for fetch and push are set to your repository: "https://github.com/samosale/patchwork.git"
Joseph Botros
@josephwasily
Oct 17 2015 18:01
@designviacode check this
function truncate(str, num) {
  // Clear out that junk in your trunk
  if(str.length>num){
    return str.slice(0,num-3)+"...";
  }
  else {
    return str;
  }
};

truncate("A-tisket a-tasket A green and yellow basket", 11);
@Takumar shouldn't the origin be the link of the original github repos (a.k.a jlord's patchwork)?
Manpreet Singh
@designviacode
Oct 17 2015 18:04
@josephwasily aaahh.. thanks :smile: :clap:
CamperBot
@camperbot
Oct 17 2015 18:04
designviacode sends brownie points to @josephwasily :sparkles: :thumbsup: :sparkles:
:star: 159 | @josephwasily | http://www.freecodecamp.com/josephwasily
Aleksander Gębicki
@Takumar
Oct 17 2015 18:12
@josephwasily no origin is default name for remote repository.
Tim Pinoy
@waeren
Oct 17 2015 18:13
Has anyone set up angular-fullstack on c9.io recently? The basic vm keeps running out of memory during npm install
Aleksander Gębicki
@Takumar
Oct 17 2015 18:14
@lacostenycoder asked @samosale for showing her configuration:
origin https://github.com/jlord/patchwork (fetch)
origin https://github.com/jlord/patchwork (push)
upstream https://github.com/jlord/patchwork.git (fetch)
upstream https://github.com/jlord/patchwork.git (push)
so as you see you have declared here alias: "upstream" which should show original repository from which @samosale forked.
Joseph Botros
@josephwasily
Oct 17 2015 18:15
i have removed the older origin
git remote remove origin
and then : git remote add origin https://github.com/josephwasily/patchwork.git
and then git push origin add-josephwasily
and it worked fine
Aleksander Gębicki
@Takumar
Oct 17 2015 18:28
@josephwasily congratulations!
Aleksander Gębicki
@Takumar
Oct 17 2015 18:35
@lacostenycoder @samosale have you managed to finish this Git-it challenge? What was the problem finally?
Jeff
@Garanimal
Oct 17 2015 18:44
Hey Guys. I was working on the Bonfire, Factorialize. I managed to solve it using a loop, and was wondering if that was the only real way to do it? My code is
function factorialize(num) {
 var sum = num
for (var i=1; i<(num) ; ++i) {sum = (sum*i)}

 if (sum>0) {return sum;}
  else {return 1}
  ;


}

factorialize(5);
I initially tried using an array but that fell flat pretty quickly.
Aleksander Gębicki
@Takumar
Oct 17 2015 18:46
@Garanimal if you want to make it shorter, think if you know something called: "recursion".
Jeff
@Garanimal
Oct 17 2015 18:46
@Takumar I'll check it out. I'm very new to all of this, just figured I would give it a shot, kinda got hooked.
Aleksander Gębicki
@Takumar
Oct 17 2015 18:47
Recursion is when you call your function inside your function. You can use it here for sure.
Jeff
@Garanimal
Oct 17 2015 18:49
Yeah I see how that would have been helpful. I'm actually a high school math teacher so this one was interesting. Recursion makes sense now that I'm looking at it. I guess I kind of accomplished that with the loop
Aleksander Gębicki
@Takumar
Oct 17 2015 18:53
@Garanimal sorry for trying to explain recursion to mathematician with my broken English :-) I may give small correct to your code because I have never seen that someone put variable alone in parentheses: i<(num) these parentheses are not needed for sure (but of course they are not bug.
Lance Jordan
@lacostenycoder
Oct 17 2015 18:53
@Takumar the problem was with the SSH keys not set up correctly
Jeff
@Garanimal
Oct 17 2015 18:53
haha no problem @takumar thanks for the suggestion!
CamperBot
@camperbot
Oct 17 2015 18:53
garanimal sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 502 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 17 2015 18:55
@lacostenycoder so as you thought earlier, problem with SSH. Good you found it.
Lance Jordan
@lacostenycoder
Oct 17 2015 18:57
yep
Aleksandar B.
@aleksandar-b
Oct 17 2015 19:06
@Takumar @lacostenycoder Hey it wont verify when type git-it verify. Wait to send pictures
When I am on branch samosale this is the error:
Selection_024.png
When i change via git checkout add-samosale, i get this
Selection_023.png
Joseph Botros
@josephwasily
Oct 17 2015 19:12
@samosale can you do git remote -v and send screenshot of the list
?
Jeff
@Garanimal
Oct 17 2015 19:13
@takumar I found another way to do it!
function factorialize(num) {
 var array =[1]
 for (var i=1; i<=num; i++) {array.push(i)}
var arrayFact = array.reduce(function(prev,curr){return prev*curr;});
  return arrayFact

  ;


}

factorialize();
Aleksandar B.
@aleksandar-b
Oct 17 2015 19:13
Selection_025.png
Joseph Botros
@josephwasily
Oct 17 2015 19:13
@Garanimal very nice one, and great idea !
you need to remove the origin
Jeff
@Garanimal
Oct 17 2015 19:13
the factorialize at the bottom?
Joseph Botros
@josephwasily
Oct 17 2015 19:14
use : git remote remove origin
Jeff
@Garanimal
Oct 17 2015 19:14
I dont know what that is im sorry
Joseph Botros
@josephwasily
Oct 17 2015 19:15
@Garanimal oh sorry i am speaking with @samosale
Jeff
@Garanimal
Oct 17 2015 19:15
oh haha ok
YI JIANG
@meet999
Oct 17 2015 19:15

/ var ourDog = {
// "name": "Camper",
// "legs": 4,
// "tails": 1,
// "friends": ["everything!"]
// };

// ourDog.bark = "arf!";
// delete ourDog.tails;

var myDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": []
};

// Only change code below this line.

// Let's add the property bark to myDog
bark.myDog =

// Now delete the property tails

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

Joseph Botros
@josephwasily
Oct 17 2015 19:15
@Garanimal your code is interesting though
YI JIANG
@meet999
Oct 17 2015 19:15
help
CamperBot
@camperbot
Oct 17 2015 19:15

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Joseph Botros
@josephwasily
Oct 17 2015 19:16
@meet999 what is your problem exactly?
Aleksandar B.
@aleksandar-b
Oct 17 2015 19:18
@josephwasily @lacostenycoder @Takumar tnx all it works now!
CamperBot
@camperbot
Oct 17 2015 19:18
samosale sends brownie points to @josephwasily and @lacostenycoder and @takumar :sparkles: :thumbsup: :sparkles:
:star: 205 | @lacostenycoder | http://www.freecodecamp.com/lacostenycoder
:star: 503 | @takumar | http://www.freecodecamp.com/takumar
:star: 161 | @josephwasily | http://www.freecodecamp.com/josephwasily
CamperBot
@camperbot
Oct 17 2015 19:18
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Dave Davids
@Falsedave
Oct 17 2015 19:18
Bonfire Where art thou
CamperBot
@camperbot
Oct 17 2015 19:18

:fire:Bonfire: Where art thou :link:

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

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

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Joseph Botros
@josephwasily
Oct 17 2015 19:18
@cooljoe21 @Garanimal can help right now
@cooljoe21 he just solved it
Jeff
@Garanimal
Oct 17 2015 19:19
@cooljoe21 what are your thoughts so far. How are yo uapproaching it?
saifcoding
@saifcoding
Oct 17 2015 19:19
@camperbot container-fluid
cooljoe21
@cooljoe21
Oct 17 2015 19:20
I have taken many different approaches and now I am a bit lost...
Jeff
@Garanimal
Oct 17 2015 19:21
@cooljoe21 show me your code. The biggest issue is dealing with the different numbers
Joseph Botros
@josephwasily
Oct 17 2015 19:21
container-fluid is a div container that makes all its child elements responsive with screen size
saifcoding
@saifcoding
Oct 17 2015 19:22
@josephwasily But if I want to use them later, should i remember all that names of classes?
cooljoe21
@cooljoe21
Oct 17 2015 19:22
function factorialize(num) {
  return num;
}

factorialize(5!);
5! = 1*2*3*4*5 = 120
CamperBot
@camperbot
Oct 17 2015 19:22
:bulb: to format code use backticks! ``` more info
saifcoding
@saifcoding
Oct 17 2015 19:23
@cooljoe21 Your function is wrong
function factorialize(num){
var result=1;
for(var i=1;i<=num;i++)
{
result*=i;
}
return result
}
Jeff
@Garanimal
Oct 17 2015 19:24
@cooljoe21 Ok, you don want to chance the factorialize(5), the function above is pulling "num" directly from what you have in the parenthesis of your bottom factorialize
Joseph Botros
@josephwasily
Oct 17 2015 19:24
@cooljoe21 the number keeps growing multiply by a decreasing factor so 5 is timed by 4 again by 3 untill it reaches 1
thats the idea of factor number
you can do it by two ways (three counting @Garanimal invention !)
either a loop
or recursion
Jeff
@Garanimal
Oct 17 2015 19:25
right, you cannot actually put in 54321 because that will not work when you put in 20
cooljoe21
@cooljoe21
Oct 17 2015 19:26
ok thank you @josephwasily @Garanimal and @saifcoding! I will try all that :smile:
CamperBot
@camperbot
Oct 17 2015 19:26
cooljoe21 sends brownie points to @josephwasily and @garanimal and @saifcoding :sparkles: :thumbsup: :sparkles:
:star: 178 | @garanimal | http://www.freecodecamp.com/garanimal
:star: 80 | @saifcoding | http://www.freecodecamp.com/saifcoding
:star: 162 | @josephwasily | http://www.freecodecamp.com/josephwasily
saifcoding
@saifcoding
Oct 17 2015 19:27
You welcome, keep coding :) better to try it and fail then other things, then you will remember the right solution @cooljoe21
Joseph Botros
@josephwasily
Oct 17 2015 19:28
recursion :

function factor(num){

    if (num == 1){
        return 1;
    }
    else {
        return num*factor(num-1);
    }
}
saifcoding
@saifcoding
Oct 17 2015 19:29
@josephwasily what if num<1??
Joseph Botros
@josephwasily
Oct 17 2015 19:31
@saifcoding the function should blow up !
:D
saifcoding
@saifcoding
Oct 17 2015 19:31
add if(num<1) return 0;
and without else because not needed :)
Joseph Botros
@josephwasily
Oct 17 2015 19:33
factor of negative number is undefined i should return "please read your math book" :D
Sergio Studdard
@sergistud
Oct 17 2015 19:34
what syntax would you use to give an img element to give it a css class? #suchanoob lol
Joseph Botros
@josephwasily
Oct 17 2015 19:35
you need to use jquery
$("img").css("property","value");
@sergistud have you learn about jquery yet?
Sergio Studdard
@sergistud
Oct 17 2015 19:36
no.. currently learning html/css on freecodecamp

Waypoint: Size your Images
CSS has a property called width that controls an element's width. Just like with fonts, we'll use px (pixels) to specify the image's width.

For example, if we wanted to create a CSS class called larger-image that gave HTML elements a width of 500 pixels, we'd use: <style> .larger-image { width: 500px; } </style>.

Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.

Your img element should have the class smaller-image.
Your image should be 100 pixels wide.
those are my instructions

<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 scratched.</p>

saifcoding
@saifcoding
Oct 17 2015 19:38
@sergistud then add in HTML: <img src="link to img here" class="class-name"> and in CSS use: .class-name { color: red }
color is bad idea for image
add width: 100px;
Sergio Studdard
@sergistud
Oct 17 2015 19:40
got it now.. i couldn't figure out where to apply the class properly. thank you @saifcoding
CamperBot
@camperbot
Oct 17 2015 19:40
sergistud sends brownie points to @saifcoding :sparkles: :thumbsup: :sparkles:
:star: 85 | @saifcoding | http://www.freecodecamp.com/saifcoding
h4r1m4u
@h4r1m4u
Oct 17 2015 20:29
bonfire Spinal Tap Case
CamperBot
@camperbot
Oct 17 2015 20:29

:fire:Bonfire: Spinal Tap Case :link:

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

spinalCase('This Is Spinal Tap');

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

more info:  bf details | bf links | hint

h4r1m4u
@h4r1m4u
Oct 17 2015 20:29
hint
CamperBot
@camperbot
Oct 17 2015 20:29
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jason Wood
@catapixel
Oct 17 2015 20:39
@h4r1m4u did you need help with Spinal Tap?
h4r1m4u
@h4r1m4u
Oct 17 2015 20:40
@catapixel thanks for asking. i'm good
CamperBot
@camperbot
Oct 17 2015 20:40
h4r1m4u sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 469 | @catapixel | http://www.freecodecamp.com/catapixel
Celso Mireles
@celsom3
Oct 17 2015 20:54
Thanks @marzelin , @alexhudici, and @kmiasko for the help. Kmiasko's comment I wasn't pushing the last chunk made me see that when if statement's condition ran false, it went to the else block but I wasn't doing anything with that data, just pushing the subArray to the newArray, and re-initiliazing it, but didn't do anything with that data in that specific iteration. Anyways, here is what worked for me:
function chunk(arr, size) {
  // Break it up.
  var newArray = [];
  var subArray = [];

  for (var i = 0; i < arr.length; i++){
    if(subArray.length < size){
      subArray.push(arr[i]);
    }else{
      newArray.push(subArray);
      subArray = [];
      subArray.push(arr[i]);
    }

  }
  newArray.push(subArray);
  return newArray;
}

chunk(["a", "b", "c", "d"], 2);
CamperBot
@camperbot
Oct 17 2015 20:54
celsom3 sends brownie points to @marzelin and @alexhudici and @kmiasko :sparkles: :thumbsup: :sparkles:
:star: 206 | @kmiasko | http://www.freecodecamp.com/kmiasko
:star: 49 | @alexhudici | http://www.freecodecamp.com/alexhudici
:star: 359 | @marzelin | http://www.freecodecamp.com/marzelin
Brian K
@BKtheDAD
Oct 17 2015 21:16
help seek and destroy
CamperBot
@camperbot
Oct 17 2015 21:16

:point_right: bonfire seek and destroy [wiki]

Explanation:

This problem is a bit tricky because you have to familiarize yourself with Arguments, as you will have to work with two or more but on the script you only see two. Many people hardcode this program for three arguments. You will remove any number from the first argument that is the same as any other other arguments.

:pencil: read more about bonfire seek and destroy on the FCC Wiki

Steve Ely
@stevereally
Oct 17 2015 21:26
Can anyone perhaps clarify if it matters if I'm consistent in what browser or machine I do these lessons on? I did all the HTML5/CSS waypoints in Firefox and started the Bootstrap stuff there and then switched over to Chrome, and in Chrome, the map shows me as having completed up through the second Bootstrap waypoint but when I go to any of the ones I've done already, it shows the tasks as uncompleted. That seems less than ideal.
Aleksandar B.
@aleksandar-b
Oct 17 2015 21:34
@stevereally that is because you have stored results in firefox cache(localStorage/memory).
actually your results are stored in url. It is better to ask @SaintPeter , @dting @abhisekpish
Miguel Silva
@mini890
Oct 17 2015 21:37
@stevereally Don't know if it work but try to update portfolio from github. Just click on your image on the website, you should see the button there.
Lux3
@Lux3
Oct 17 2015 21:50
bf dna
CamperBot
@camperbot
Oct 17 2015 21:50

:fire:Bonfire: DNA Pairing :link:

function pair(str) {
 return str;
}

pair("GCG");

The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.

more info:  bf details | bf links | hint

Lux3
@Lux3
Oct 17 2015 21:50
hint
CamperBot
@camperbot
Oct 17 2015 21:50
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Shehan Neomal Fernando
@shehannf
Oct 17 2015 21:53
"Add an i element with the classes fa and fa-thumbs-up."
how do i do this ?
Miguel Silva
@mini890
Oct 17 2015 21:53
add a class
like class="fa fa-thumbs-up"
Steve Ely
@stevereally
Oct 17 2015 21:54
Thanks, @samosale and @mini890. I appreciate the clarifications. The portfolio point turned out to be especially helpful. Clicking "View my solution" for any one of the challenges then updated how it shows when I later click on it from the map. So it looks like what the map knows about my having solved a given thing or not is dependent on the browser cache, but the portfolio knows independently of that, which is reassuring.
CamperBot
@camperbot
Oct 17 2015 21:54
stevereally sends brownie points to @samosale and @mini890 :sparkles: :thumbsup: :sparkles:
:star: 174 | @mini890 | http://www.freecodecamp.com/mini890
:star: 387 | @samosale | http://www.freecodecamp.com/samosale
Shehan Neomal Fernando
@shehannf
Oct 17 2015 21:54
thanks man, I didn't add "
CamperBot
@camperbot
Oct 17 2015 21:54
if you want to thank someone, put an @ before their name!
Shehan Neomal Fernando
@shehannf
Oct 17 2015 21:54
@mini890 thanks man
CamperBot
@camperbot
Oct 17 2015 21:54
shehannf sends brownie points to @mini890 :sparkles: :thumbsup: :sparkles:
:star: 175 | @mini890 | http://www.freecodecamp.com/mini890
Phil Andy
@philandy
Oct 17 2015 22:00
does chrome have an enableable menu for fullscreen?
Miguel Silva
@mini890
Oct 17 2015 22:04
try pressing F11???
don't know if that's what you want.
Phil Andy
@philandy
Oct 17 2015 22:05
I want to see at least the menu button on fullscreen
Miguel Silva
@mini890
Oct 17 2015 22:06
don't know sorry. I don't think it has, but I mostly use firefox so...
Phil Andy
@philandy
Oct 17 2015 22:07
@mini890 it's ok thanks
CamperBot
@camperbot
Oct 17 2015 22:07
philandy sends brownie points to @mini890 :sparkles: :thumbsup: :sparkles:
:star: 176 | @mini890 | http://www.freecodecamp.com/mini890
Ivo Jerčić
@IvoJercic
Oct 17 2015 22:08
hello guys :D
can someone help me
David Bouwkamp
@DavidBouw
Oct 17 2015 22:08
What's your question and can you post your code? @IvoJercic
Ivo Jerčić
@IvoJercic
Oct 17 2015 22:13
my question @BrainDrainBahrain is how to solve this problem
everything is wroten
1223.PNG
David Bouwkamp
@DavidBouw
Oct 17 2015 22:14
help format
CamperBot
@camperbot
Oct 17 2015 22:14

:point_right: code formatting [wiki]

Inline code

alt text

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

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

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

Ivo Jerčić
@IvoJercic
Oct 17 2015 22:16
i made it guys ,i am so stupid haha,thank you :D
CamperBot
@camperbot
Oct 17 2015 22:16
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 17 2015 22:19
Yay :smile:
Jason
@Jauble
Oct 17 2015 22:19
Hey @HermanFassett
Herman Fassett
@HermanFassett
Oct 17 2015 22:19
Hi @Jauble
KofiAkorli
@KofiAkorli
Oct 17 2015 22:22
hello people
Jason
@Jauble
Oct 17 2015 22:22
devToolsProblem.gif
Any idea why this keeps happening?
Hey @KofiAkorli
GitarMan
@GitarMan
Oct 17 2015 22:22

Hey everyone, I'm working on the Build a Wikipedia Viewer Zipline exercise. I've been reading up on the Wikipedia API documentation, AJAX, CORS, and HTTP Headers and I've already been able to successfully use JSON API's on the previous two exercises (Twitch.TV and Stylize Camper News).

I keep running into the following type of errors when I try to run my code:
XMLHttpRequest cannot load http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=beer. Response for preflight is invalid (redirect)
index.html:1

or

XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=beer. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Here is my function's code:

function searchWiki(str) {

  var xhr = new XMLHttpRequest();
  var searchTerm = str;
  var url = "http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=" + searchTerm;

  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 && xhr.status == 200) {
      var jsonArr = JSON.parse(xhr.responseText);

      document.getElementById('results').innerHTML = "Success!";
      document.getElementById('results').innerHTML += jsonArr;
      console.log(jsonArr);
    } else {
      document.getElementById('results').innerHTML = "Error<br />URL: " + url + "<br />Ready State: " + xhr.readyState + "<br />Status: " + xhr.status;
    }
  }

  xhr.open("GET", url, true);
  xhr.setRequestHeader('Access-Control-Allow-Origin', 'http://codepen.io/');
  xhr.setRequestHeader('Api-User-Agent', 'RonsWikiSearchProject/1.0' );
  xhr.send();

}

Can anyone help point out what I'm doing wrong to not pass the preflight tests and not retrieve the JSON text back from Wikipedia? Any help would be greatly appreciated.

Herman Fassett
@HermanFassett
Oct 17 2015 22:25
@GitarMan to allow access, you need &callback=? at the end of your url
GitarMan
@GitarMan
Oct 17 2015 22:26
Ok thanks @HermanFassett , let me go try that
CamperBot
@camperbot
Oct 17 2015 22:26
gitarman sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 381 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Jason
@Jauble
Oct 17 2015 22:26
@HermanFassett This keeps happening when I'm stepping through a function. Any idea why it's doing this? :point_up: October 17, 2015 3:22 PM
I think it's that console.log that's causing it
Herman Fassett
@HermanFassett
Oct 17 2015 22:29
I'm not sure @Jauble , kind of hard to read from animated gif
Post the relevant code so I don't have to keep watching it :P
GitarMan
@GitarMan
Oct 17 2015 22:31
@HermanFassett Hmmm, adding &callback=? to the end of my URL doesn't seem to be working. I still get the following error: 'XMLHttpRequest cannot load http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=beer&callback=?. Response for preflight is invalid (redirect)'
Do I need to define a separate callback function instead of the question mark?
JoelLindsey
@JoelLindsey
Oct 17 2015 22:32
i'm stuck on Waypoint: Use Conditional Logic with If and Else Statements can anybody help?
Screenshot 2015-10-17 17.30.34.png
Jason
@Jauble
Oct 17 2015 22:32
@HermanFassett Lol ok. I had the console.log originally to see if it was working and forgot to take it out. It doesn't give me the same error after I take it out.
  nums.forEach(function(value, index) {
    while (num >= value) {
      arr.push(index);
      console.log(arr);
      num -= value;
    }
  });
GitarMan
@GitarMan
Oct 17 2015 22:33
@JoelLindsey I can probably help; what is your question?
Herman Fassett
@HermanFassett
Oct 17 2015 22:33
@GitarMan that's interesting. I just used jquery getJSON
So I can't exactly relate with how you're doing it, but the question mark is correct
I needed callback otherwise I got an origins error I think
GitarMan
@GitarMan
Oct 17 2015 22:35
Ahh; yeah I tried it with jquery before too. Maybe I need to separate out the action into a callback function
JoelLindsey
@JoelLindsey
Oct 17 2015 22:35
@GitarMan Where did i mess up? i,ve been on this problem for a while
David Bouwkamp
@DavidBouw
Oct 17 2015 22:35
This question isn't related to any particular fcc problem but maybe someone can share their knowledge on the matter to help clear some confusion for me: Where does the HTML5 DOM come into play? I know it's incredibly powerful for manipulating html files on the fly, but what is the theoretical minimum of a webpage's HTML scaffolding that is able to then be filled in by JS using the DOM? And what performance impacts should I be aware of when using the DOM?
VeeShostak
@VeeShostak
Oct 17 2015 22:37
@JoelLindsey the flip variable will either be 1 or 0. so if flip === 0 { //return what? } then the same thing for the else statement
GitarMan
@GitarMan
Oct 17 2015 22:37
@JoelLindsey In your If logic test you wrote it so you are testing if the number 1 equals the number 2. This will never be true so your statement will return false
Ibrahim
@ibouGithub
Oct 17 2015 22:38
  .red-text{

      color: red;

  }
</style>

<h2 class="red-text"> CatPhotoApp </h2>
GitarMan
@GitarMan
Oct 17 2015 22:38
@JoelLindsey What you want to do is test to see if the random number generated is equal to 0 or equal to 1
Ibrahim
@ibouGithub
Oct 17 2015 22:38
what is wrong with this?
Matt Leonard
@matty22
Oct 17 2015 22:39
extra spaces in your h2?
or no opening <style> tag?
GitarMan
@GitarMan
Oct 17 2015 22:39
@ibouGithub Silly question, but are you missing the opening <style> tag?
Ibrahim
@ibouGithub
Oct 17 2015 22:40
  .red-text{

      color: red;

  }
</style>

<h2 class="red-text"> CatPhotoApp</h2>
Aditya Pradhana
@adtpdn
Oct 17 2015 22:40
  .red-text{
      color: red;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>
style missing
<style> …. </style>
Ibrahim
@ibouGithub
Oct 17 2015 22:40
the opning tag is there...
Matt Leonard
@matty22
Oct 17 2015 22:40
show us all of your code please
Ibrahim
@ibouGithub
Oct 17 2015 22:41
  .red-text{

      color: red;

  }
</style>

<h2 class="red-text"> CatPhotoApp</h2>
Matt Leonard
@matty22
Oct 17 2015 22:41
You need to add <style> above the line with .red-text{
Ibrahim
@ibouGithub
Oct 17 2015 22:41
For some reason, the opning tag doesn't show up
Matt Leonard
@matty22
Oct 17 2015 22:41
Oh
Which waypoint is it?
Ibrahim
@ibouGithub
Oct 17 2015 22:42
Create a CSS class called red-text and apply it to your h2 element.
JoelLindsey
@JoelLindsey
Oct 17 2015 22:42
@GitarMan So i change the numbers to 0 ===1?
Matt Leonard
@matty22
Oct 17 2015 22:43
Try removing the space before "CatPhotoApp"
David Bouwkamp
@DavidBouw
Oct 17 2015 22:43
@ibouGithub This is strange. I can't get your code to change CatPhotoApp to red, and it's functionally identical to my solution
hassanchagani
@hassanchagani
Oct 17 2015 22:44
hi folks, i'm trying to understand the grid in bootstrap for responsive design and need some help
Matt Leonard
@matty22
Oct 17 2015 22:44
Weird. I pasted it also into my waypoint and it doesn't turn the text red though it should.
hassanchagani
@hassanchagani
Oct 17 2015 22:44
in one of the solutions, early on, we use col-xs-7 for a text box and col-xs-5 for the submit button, can someone explain how these numbers are chosen?
Ibrahim
@ibouGithub
Oct 17 2015 22:44
:worried:
Brian K
@BKtheDAD
Oct 17 2015 22:45
i’m working on the seek and destroy bonfire
hassanchagani
@hassanchagani
Oct 17 2015 22:45
i tried changing the 7 to a 9 and the 5 to a 3 but it introduced horizontal scrolling on the preview phone
GitarMan
@GitarMan
Oct 17 2015 22:45
@JoelLindsey If you look at the top of your code you are defining a variable "flip" to be randomly either 0 or 1. IF the variable "flip" is equal to 0, return "Heads", ELSE return "Tails"
Herman Fassett
@HermanFassett
Oct 17 2015 22:45
Cool @bkthegeek
Brian K
@BKtheDAD
Oct 17 2015 22:45
can someone help me with the end of the code
function destroyer(arr) {
  // Remove all the values
  var seek = arr.slice.call(arguments);
  var args = seek.slice(1);
  var destroy = seek.indexOf(args);
  return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Matt Leonard
@matty22
Oct 17 2015 22:45
@ibouGithub Try deleting all of the style and retyping it?
Brian K
@BKtheDAD
Oct 17 2015 22:45
should I run some sort of for or while loop
KofiAkorli
@KofiAkorli
Oct 17 2015 22:45
@hassanchagani the bootstrap grid is based on a maximum of 12, so the numbers chosen have to add up to 12
Brian K
@BKtheDAD
Oct 17 2015 22:46
?
Aditya Pradhana
@adtpdn
Oct 17 2015 22:46
@ibouGithub Try this code

<h2 style="color:red">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>

hassanchagani
@hassanchagani
Oct 17 2015 22:46
@KofiAkorli makes sense and my number, 9+3 does equal 12 yet i saw a horizontal scroll bar
Brian K
@BKtheDAD
Oct 17 2015 22:46
I don’t want the answer, just some direction
i looked at the answer after I got stuck for too long and I don’t like it
Ibrahim
@ibouGithub
Oct 17 2015 22:47
@matty22 , thanks, that worked!
CamperBot
@camperbot
Oct 17 2015 22:47
ibougithub sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
:star: 189 | @matty22 | http://www.freecodecamp.com/matty22
Matt Leonard
@matty22
Oct 17 2015 22:47
Woop Woop!
Ibrahim
@ibouGithub
Oct 17 2015 22:47
@adtpdn thanks
CamperBot
@camperbot
Oct 17 2015 22:47
ibougithub sends brownie points to @adtpdn :sparkles: :thumbsup: :sparkles:
:star: 15 | @adtpdn | http://www.freecodecamp.com/adtpdn
Brian K
@BKtheDAD
Oct 17 2015 22:47
if that’s possible
KofiAkorli
@KofiAkorli
Oct 17 2015 22:47
@hassanchagani please paste your code here
Herman Fassett
@HermanFassett
Oct 17 2015 22:48
@bkthegeek filter works nicely for this one
hassanchagani
@hassanchagani
Oct 17 2015 22:48
@KofiAkorli <div class="row">
<div class="col-xs-9"><input type="text" class="form-control" placeholder="cat photo URL" required></div>
<div class="col-xs-3"><button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button></div>
</div>
David Bouwkamp
@DavidBouw
Oct 17 2015 22:48

@ibouGithub Try deleting all of the style and retyping it?

Can confirm. This fixes it. No idea why

Brian K
@BKtheDAD
Oct 17 2015 22:48
@HermanFassett would I run a loop with the filter?
Herman Fassett
@HermanFassett
Oct 17 2015 22:49
Well filter would loop through
Ibrahim
@ibouGithub
Oct 17 2015 22:49
@BrainDrainBahrain, yes it does!
Herman Fassett
@HermanFassett
Oct 17 2015 22:50
Btw @bkthegeek I think your first two lines could be written as
var args = Array.prototype.slice.call(arguments, 1);
Or the arr.slice instead of Array.prototype.slice
KofiAkorli
@KofiAkorli
Oct 17 2015 22:50
@hassanchagani which waypoint is that?
Herman Fassett
@HermanFassett
Oct 17 2015 22:51
Oh I see @bkthegeek you use both variables anyway
hassanchagani
@hassanchagani
Oct 17 2015 22:51
@KofiAkorli Waypoint: Line up Form Elements Responsively with Bootstrap
Brian K
@BKtheDAD
Oct 17 2015 22:51
yeah, what does the .protoype part of the function do?
i’ve never used it, but anytime i look up a new way to do something
Herman Fassett
@HermanFassett
Oct 17 2015 22:52
@bkthegeek if you just use the args and then filter arr checking its index of args it should work
Brian K
@BKtheDAD
Oct 17 2015 22:52
it’s always array.protype.slice()
Herman Fassett
@HermanFassett
Oct 17 2015 22:53
Array.prototype just represents prototype for Array constructor
Aleksander Gębicki
@Takumar
Oct 17 2015 22:54
@hassanchagani your div's should have different width. You should use classes: col-xs-7 and col-xs-5
Brian K
@BKtheDAD
Oct 17 2015 22:54
but what is the different in writing array.prototype.slice() vs array.slice()
KofiAkorli
@KofiAkorli
Oct 17 2015 22:55
@hassanchagani i tried it and i also got the horizontal scroll
hassanchagani
@hassanchagani
Oct 17 2015 22:55
@Takumar i agree, i was playing with the number at the end to see how it responds differently if i change the numbers
@Takumar what i'm trying to understand is how the 7 and 5 were chosen...any thoughts?
@Takumar @KofiAkorli I have to run for now; thank you for trying to help out...I will explore some more tomorrow.
CamperBot
@camperbot
Oct 17 2015 22:56
hassanchagani sends brownie points to @takumar and @kofiakorli :sparkles: :thumbsup: :sparkles:
:star: 187 | @kofiakorli | http://www.freecodecamp.com/kofiakorli
:star: 504 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 17 2015 23:00
@hassanchagani sorry I haven't look up for your question, I thought you have problem with current code. I think that width of that field was just chosen proportionally: field text wider and submit button shorter. Of course you remember that they should sum up to 12 (col-xs-9 + col-xs-3).
Brian K
@BKtheDAD
Oct 17 2015 23:01
@HermanFassett
function destroyer(arr) {
  // Remove all the values
  var seek = arr.slice.call(arguments);
  var args = seek.slice(1);
  var destroy = args.filter(arr.indexOf(args));
  return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
what am i doing wrong?
Herman Fassett
@HermanFassett
Oct 17 2015 23:03
@bkthegeek the geek you need to create a function inside filter which returns a boolean whether args contains value
Brian K
@BKtheDAD
Oct 17 2015 23:03
k thanks @HermanFassett
CamperBot
@camperbot
Oct 17 2015 23:03
bkthegeek sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 382 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 17 2015 23:03
Filter would be like
var destroy = args.filter(function(val) {
    return //blabla
}
Brian K
@BKtheDAD
Oct 17 2015 23:04
okay
Herman Fassett
@HermanFassett
Oct 17 2015 23:04
Where val is the current index of args
Brian K
@BKtheDAD
Oct 17 2015 23:32
function destroyer(arr) {
  // Remove all the values
  var seek = arr.slice.call(arguments);
  var args = seek.slice(1);
  var destroy = args.filter(function indexOf(args) {
    return arr;
  })
  return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
it’s returning [2,3]
how do I get it to return [1,1]
Mamadou Badiane
@diango
Oct 17 2015 23:38
fix the instructor of waypoint filter arrays with filter ........
Herman Fassett
@HermanFassett
Oct 17 2015 23:41
@bkthegeek I think I said filter args earlier... my bad, you should be filtering arr... Something like
var destroy = arr.filter(function(val) {
    return // args doesn't contain val
});
Brian K
@BKtheDAD
Oct 17 2015 23:45
@HermanFassett i’m still doing somehting wrong
Herman Fassett
@HermanFassett
Oct 17 2015 23:46
Show update :P
Brian K
@BKtheDAD
Oct 17 2015 23:46
function destroyer(arr) {
  // Remove all the values
  var seek = arr.slice.call(arguments);
  var args = seek.slice(1);
  var destroy = arr.filter(function indexOf(args) {
    return arr;
  })
  return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Herman Fassett
@HermanFassett
Oct 17 2015 23:47
You're still using that function wrong
Brian K
@BKtheDAD
Oct 17 2015 23:47
haha
of course
show me the way
Herman Fassett
@HermanFassett
Oct 17 2015 23:48
var destroyer = arr.filter(function(val) {
    // Do stuff in here with args indexof val
    return boolean
});
easyspirit
@easyspirit
Oct 17 2015 23:49
Hi, everyone. Hope everyone is well. I'd like some help with this Waypoint. It seems like such a simple question, yet, I'm having some difficulty coming up with the correct code/syntax to answer it correctly:
var Car = function() {
   this.wheels = 4;
};

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

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


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Brian K
@BKtheDAD
Oct 17 2015 23:49
var destroy = arr.filter(function(val) {
return val = arr.indexOf(args)
});
easyspirit
@easyspirit
Oct 17 2015 23:50
This message was deleted
Brian K
@BKtheDAD
Oct 17 2015 23:52
@HermanFassett got a little closer
Hans van Riet
@hansinla
Oct 17 2015 23:53
@easyspirit At the top you an example how the property wheels is added to the object Car. Now you need to add the property engines to the object myCar and set its value to 4.
Herman Fassett
@HermanFassett
Oct 17 2015 23:53
Not necessarily 4
Mamadou Badiane
@diango
Oct 17 2015 23:53
@HermanFassett i agree
Herman Fassett
@HermanFassett
Oct 17 2015 23:53
Ok @bkthegeek I'm not sure if you know what goes where in there
Brian K
@BKtheDAD
Oct 17 2015 23:54
function destroyer(arr) {
  // Remove all the values
  var seek = arr.slice.call(arguments);
  var args = seek.slice(1);
  return destroy = arr.filter(function(val) {
    return args.indexOf(val)
  });
  //return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
returning [1,3,1,3]
@HermanFassett
Herman Fassett
@HermanFassett
Oct 17 2015 23:55
Ok that's close @bkthegeek now inside your filter you're returning an index when you should be returning a boolean so just make it return whether index is -1 or not
Brian K
@BKtheDAD
Oct 17 2015 23:55
woot woot, thanks @HermanFassett
CamperBot
@camperbot
Oct 17 2015 23:55
bkthegeek sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: bkthegeek already gave hermanfassett points
Herman Fassett
@HermanFassett
Oct 17 2015 23:56
Yep
Brian K
@BKtheDAD
Oct 17 2015 23:57
what’s different when i make
return args.indexOf(val) === -1
@HermanFassett
Herman Fassett
@HermanFassett
Oct 17 2015 23:57
indexOf returns a number while indexOf === -1 returns a boolean
Brian K
@BKtheDAD
Oct 17 2015 23:57
okay, got it
Herman Fassett
@HermanFassett
Oct 17 2015 23:57
;P Yay
I finally finished all my bonfires and I'm trying to finish these ziplines necessary for Front End Development Certificate
Brian K
@BKtheDAD
Oct 17 2015 23:58
nice
how long did it take you to get through all the bonfires?
Chris
@Aoxom
Oct 17 2015 23:59
@HermanFassett were the intermediate bonfires much harder than the basic ones?
Herman Fassett
@HermanFassett
Oct 17 2015 23:59
Well beginner bonfires I could go through the whole section in a day, while advanced was more like 1 a day
Intermediate were harder but still most of them were easy to me with previous js experience