These are chat archives for FreeCodeCamp/HelpFrontEnd

18th
Aug 2017
Jorge
@OrangeKulture
Aug 18 2017 00:00
@janelledement yeah thats the thing, u need to properly write the request .. you are doing ok with the geolocation
it would be good idea to check for it tho ..
if(navigator.geolocation){
   // do something
}
Janelle deMent
@janelledement
Aug 18 2017 00:01
@cowCrazy @OrangeKulture Thanks, I'll try this!
CamperBot
@camperbot
Aug 18 2017 00:01
janelledement sends brownie points to @cowcrazy and @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 338 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
:cookie: 435 | @orangekulture |http://www.freecodecamp.com/orangekulture
cowCrazy
@cowCrazy
Aug 18 2017 00:01
@janelledement also you need to have a '&' between the two
Janelle deMent
@janelledement
Aug 18 2017 00:02
@cowCrazy oh good point!
Ken Haduch
@khaduch
Aug 18 2017 00:02
@5millerk - I made a couple tweaks and it works... not sure what all I changed? I'll fork your project and you can check it out? here is the link
Jorge
@OrangeKulture
Aug 18 2017 00:03
@janelledement also, you cant use the getLocalWeather function with those variables, as it's out of scope..
try implementing all functionality within the document.ready() function
5millerk
@5millerk
Aug 18 2017 00:04
@khaduch the first thing i notice is you put the #footer inside the #body div
Janelle deMent
@janelledement
Aug 18 2017 00:04
@OrangeKulture Thanks! I'll try doing it that way
CamperBot
@camperbot
Aug 18 2017 00:04
janelledement sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:warning: janelledement already gave orangekulture points
Ken Haduch
@khaduch
Aug 18 2017 00:04
@5millerk - that may or may not be critical to making it work... :)
Jorge
@OrangeKulture
Aug 18 2017 00:05
crapsky
Gulsvi
@gulsvi
Aug 18 2017 00:05

@5millerk Change your body to use padding-top instead of margin-top:

html, body {
  padding-top: 10px;
  height: 100%;
  background-color: gray;
}

Change your .wrapper to calculate the height - the height of the footer:

.wrapper {
  height: calc(100% - 50px);
  position: relative;
}
Ken Haduch
@khaduch
Aug 18 2017 00:06
@5millerk - I took off the "margin-top" from the body. And removed the height setting from the footer, too? And added the left: 0 to the footer...
Jorge
@OrangeKulture
Aug 18 2017 00:07
if(navigator.geolocatoion){
// get lat and long to use:
navigator.geolocation.getCurrentPosition(function(position) {
      lat = position.coords.latitude;
      long = position.coords.longitude;
 }
}
@janelledement
Ken Haduch
@khaduch
Aug 18 2017 00:08
@OrangeKulture @janelledement - "geolocation" misspelled in your code, @OrangeKulture
5millerk
@5millerk
Aug 18 2017 00:09
@SkyC0der where have you been all my life?
Gulsvi
@gulsvi
Aug 18 2017 00:09
:)
5millerk
@5millerk
Aug 18 2017 00:10
@khaduch @SkyC0der @OrangeKulture thanks for the help :-)
CamperBot
@camperbot
Aug 18 2017 00:10
5millerk sends brownie points to @khaduch and @skyc0der and @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @orangekulture |http://www.freecodecamp.com/orangekulture
:star2: 2431 | @skyc0der |http://www.freecodecamp.com/skyc0der
:star2: 3214 | @khaduch |http://www.freecodecamp.com/khaduch
Gulsvi
@gulsvi
Aug 18 2017 00:10
I think you made some changes since I gave that CSS, hard to hit a moving target, but glad it helped!
Jorge
@OrangeKulture
Aug 18 2017 00:10
@khaduch woops
thanks for that !
Gulsvi
@gulsvi
Aug 18 2017 00:11
@janelledement Everything looks great now - just need to use JSON.stringify() not json.stringify() (JSON in all caps)
Hello @OrangeKulture what's crackalacking :joy:
Jorge
@OrangeKulture
Aug 18 2017 00:12
waahah hey Sky, all good ?
Gulsvi
@gulsvi
Aug 18 2017 00:12
Yes, all good over here :)
Jorge
@OrangeKulture
Aug 18 2017 00:12
not much, really annoyed at this bullshit cors
Janelle deMent
@janelledement
Aug 18 2017 00:13
@SkyC0der thanks!
CamperBot
@camperbot
Aug 18 2017 00:13
janelledement sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2432 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 00:13
Time to build a cors proxy?
No problem @janelledement :sparkles:
Jorge
@OrangeKulture
Aug 18 2017 00:14
how would i go about implementing on my angular app tho .. cuz if i host on github pages
hmmm
Gulsvi
@gulsvi
Aug 18 2017 00:15
Your angular app?
no jQuery, so you'd have to embed the api call as a script and use JSONP
or Build your own proxy server and route the request with the right headers @OrangeKulture
I totally forgot your codepen address...
Jorge
@OrangeKulture
Aug 18 2017 00:18
yeah thats the problem.. obvs
the headers
im trying to figure out if its cus of custom headers and its the endpoint thats not liking it
wanna take a look? for shits n giggles? :joy:
@SkyC0der its on git
@SkyC0der this is the app
Gulsvi
@gulsvi
Aug 18 2017 00:20
I just found it at the link above - I can't make any sense of that code :)
It's all bundled - webpack?
Jorge
@OrangeKulture
Aug 18 2017 00:20
well u gotta look in the repo
src/app/services/music.service.ts
yeah its all bundled,
if you use a CORS extension for chrome and have it on, it'll work obvs ...
Gulsvi
@gulsvi
Aug 18 2017 00:23
Yeah, you'll have to use JSONP or a proxy server it seems
Jorge
@OrangeKulture
Aug 18 2017 00:24
im just trying to figure out where would the main node code would go, and have express require cors package
u think passing the jsonp format request will avoid the error?
Gulsvi
@gulsvi
Aug 18 2017 00:25
I don't know how you would do it with Angular, but with vanillaJS you would embed the API call as a script and add a callback function to the end of the URL
that function would get called when the script gets the data
var apiURL = 'https://path/to/some/rest api/'
var scriptEl = document.createElement("script");
scriptEl.src = apiURL + "&callback=displayJSON";
document.body.appendChild(scriptEl);

function displayJSON(data) {
  console.log(data);
}
Jorge
@OrangeKulture
Aug 18 2017 00:28
ahh ok yeah ... this is really good. I mean, theres definitely a solution
i been working on this for a while .. maybe ill take a break or something
im definitely gonna try to implement what you're showing here somehow .. im been thinking i need to try out with the headers a lot
Gulsvi
@gulsvi
Aug 18 2017 00:30
Maybe try a basic request first - some APIs don't support JSONP, like all of Google's APIs.
If that's the case, then you'll have to use a proxy server... :(
Jorge
@OrangeKulture
Aug 18 2017 00:33
yeah .. thanks a lot for looking sky, definitely need to take a break and then try and figure out whats up ..
Gulsvi
@gulsvi
Aug 18 2017 00:34
Good luck :) seems it's definitely possible
Jorge
@OrangeKulture
Aug 18 2017 00:34
yeah for sure :thumbsup:
hermeticlock
@hermeticlock
Aug 18 2017 00:50

Hey guys, quick basic question...

I'm trying to host a website. All is well, but I have a feeling I'm linking my Jquery and boostrap libraries the wrong way.

Take a look at my navigation. When it turns into mobile the three bar icons appear but the Jquery animations don't when you click it.

http://codingforkids.us/newcodingforkids/

How do I get it to actually be clickable? I think I linked things weird. Lol. Let me know if my question makes no sense.
Or if you need more information.

What I mean is that when you resize it the button appears, but I don't think I've correctly set up my Javacript bootstrap stuff to make it work or something.
Azel Alyne Tan
@azelalynetan
Aug 18 2017 00:54
try to reorder your scripts.
jquery must be loaded first before the bootstrap.min.js
and aside from that, there's nothing wrong with your code :) It just that there's no content yet so we can't test if the links are working
hermeticlock
@hermeticlock
Aug 18 2017 00:59

Well the links should work fine once I set up the proper ID's.

But when you resize the screen so it's small and the button appears, it can't be clicked.

I'll try reordering the scripts and see if that fixes it.

That worked!
@azelalynetan Thanks!!
CamperBot
@camperbot
Aug 18 2017 00:59
hermeticlock sends brownie points to @azelalynetan :sparkles: :thumbsup: :sparkles:
:cookie: 30 | @azelalynetan |http://www.freecodecamp.com/azelalynetan
hermeticlock
@hermeticlock
Aug 18 2017 01:00
You're a complete genius and I love you.
hermeticlock
@hermeticlock
Aug 18 2017 01:07
One more question if you don't mind, and then I should be good to go.
Same website, on my <div class="main" im trying to make it so it's always below the navbar. When I resize the page, it moves upward, and when it get's too small it goes all the way up and is covered by the bar.
@azelalynetan
aRtoo
@artoodeeto
Aug 18 2017 01:10
hi everyone. i dont get the algorithm problem entitled smallest common multiple. i dont quite understand the question but heres my solution and its wrong.

function smallestCommons(arr) {


  var lcm = arr[0] * arr[1];
  var result = 0;

  for(var i=0; i<lcm; i++){
    if(i % 2 === 0){
      result +=i;
    }
  }

  return result;
}
smallestCommons([1,5]);
hermeticlock
@hermeticlock
Aug 18 2017 01:43

How can I get the text in my header image to be in the middle of the picture?
Website
http://codingforkids.us/newcodingforkids/

Website CSS
http://codingforkids.us/newcodingforkids/style.css

Answered in another channel.
DJ Nixon
@tGxcoder
Aug 18 2017 01:55
```
<a href="https://codepen.io/tGxCoder/#"><i class="fa fa-codepen" aria-hidden="true"></i>
 CodePen</a>
does codepen not allow its own font awesome? it worked for my linked in FA
Ken Haduch
@khaduch
Aug 18 2017 02:17
@tGxcoder - which version of font-awesome are you loading in CodePen?
Kyle Janka
@EverythingEpi
Aug 18 2017 02:27
@SkyC0der thanks for your help yesterday, I just seen your answer to my question. I ended up reading a little bit about media queries and was about to try the fix you told me before I read what you said haha.
CamperBot
@camperbot
Aug 18 2017 02:27
everythingepi sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2434 | @skyc0der |http://www.freecodecamp.com/skyc0der
Ken Haduch
@khaduch
Aug 18 2017 02:40
@tGxcoder - I don't know if you got it working or went away, but using font-awesome 4.7 on CodePen it works for me...
DJ Nixon
@tGxcoder
Aug 18 2017 03:14
@khaduch i got it. it took me awhile to find 4.7 everyone i found was using 4.4 thanks for the help though
CamperBot
@camperbot
Aug 18 2017 03:14
tgxcoder sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3215 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Aug 18 2017 03:14
@tGxcoder - that's great - I think that those icons are relatively new, I know that the free-code-camp icon was added recently... good luck!
DJ Nixon
@tGxcoder
Aug 18 2017 03:15
yeah per github 4.7 was the most recent update
i removed the text and just used the icon. i think it looks cleaner
aRtoo
@artoodeeto
Aug 18 2017 03:18
hey bros i have question. on the finders keepers algo challenge i used .push() method to get the first true number of the filter. what if .push() cant be use how can i stop the loop when it hits the first true value. note you cant use return inside the funcntion filter. heres my code:

function findElement(arr, func) {

  var numArr = [];

  for(var i=0; i<arr.length; i++){
    thisIsShit(arr[i]);
    console.log(arr[i]);
  }

  function thisIsShit(n){  
    [n].filter(function(x){
          console.log(func(x));
      if(func(x) === true){
        numArr.push(x); //this one. what if i dont want to use push? how can i stop the 
                                                   code to run after the it hits the first true num?
      }
    });
  }    
  return numArr[0];
}
Long Nguyen
@longnt80
Aug 18 2017 03:25
@artoodeeto kinda confusing. If there's no return inside filter, why would you want the filter?
Antonious Stewart
@Antonious-Stewart
Aug 18 2017 03:39
https://codepen.io/astewart400/pen/KqbYNZ need help finding out why my second page has a gap it was good until I added the h2 element
heroiczero
@heroiczero
Aug 18 2017 03:56
@Astewart400 You do know you could use Bootstrap Grid or try using CSS Grid which is more up to date
@Astewart400 you might have a gap because you are adjusting the margin-top:10%;
Ken Haduch
@khaduch
Aug 18 2017 04:10

@artoodeeto - My solution for that "Finder's Keepers" was this:

function findElement(arr, func) {
  return arr.filter(func).shift();
}

I think that your code is somewhat confusing? I think that you could simplify yours, if you didn't want to use .filter() to looks like this:

function findElement(arr, func) {
  for (var i = 0; i < arr.length; i++) {
      if (func(arr[i])) return arr[i];
}

although I didn't test it. But I think that you wouldn't need filter there at all?

heroiczero
@heroiczero
Aug 18 2017 04:39
@artoodeeto filter goes through the array and "returns" if the function is true you don't have to loop. .filter(); is already a loop
Antonious Stewart
@Antonious-Stewart
Aug 18 2017 04:42
@heroiczero haven't tried them yet but I will see what they do and ok ill play with it and see if that's it
heroiczero
@heroiczero
Aug 18 2017 04:46
@Astewart400 but if you are using a for loop and you have more than one case that passes the function you have to push the numbers into the array before you can return the array. Remember return exits for loops and function
John
@AnonymousLords
Aug 18 2017 04:48
Guys so confused on why this wont work

function chunkArrayInGroups(arr, size) {

  var array = []

var zero = arr.slice(0, size)
var next = arr.slice(size, size + size);
return array.push(zero, next)
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
It just outputs size
I want it to slice in itervials of size
heroiczero
@heroiczero
Aug 18 2017 04:49
@AnonymousLords .slice(begin, end); is format
John
@AnonymousLords
Aug 18 2017 04:49
Its going to go from size to size + size
Its goingt o slice from 0 to 2
Then slice from 2 to 4
humm
heroiczero
@heroiczero
Aug 18 2017 04:51
@AnonymousLords 0-2 is a b c
John
@AnonymousLords
Aug 18 2017 04:51
so size - 1?
heroiczero
@heroiczero
Aug 18 2017 04:51
yep that will give you 0-1 which is a size of 2
John
@AnonymousLords
Aug 18 2017 04:52
Okay
So now i want to keep slicing from 2 - 3
heroiczero
@heroiczero
Aug 18 2017 04:52
@AnonymousLords :+1:
John
@AnonymousLords
Aug 18 2017 04:53

function chunkArrayInGroups(arr, size) {

  var array = []

var zero = arr.slice(0, size - 1)
var next = arr.slice(zero + 1, zero + size);
return array.push(zero, next)
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
Gulsvi
@gulsvi
Aug 18 2017 04:53
@AnonymousLords .push() returns the length of the array after the items have been pushed.
John
@AnonymousLords
Aug 18 2017 04:53
Okay
Gulsvi
@gulsvi
Aug 18 2017 04:53
"4" in this case
John
@AnonymousLords
Aug 18 2017 04:53
I get 2 when i run it
Gulsvi
@gulsvi
Aug 18 2017 04:54
Whoops, yeah, you're right 2 sub arrays with 2 elements in each
['a','b'], ['c', 'd']
John
@AnonymousLords
Aug 18 2017 04:54
So my idea works
But only with size of 2?
heroiczero
@heroiczero
Aug 18 2017 04:54
@AnonymousLords dont you want to return the new array not the number?
John
@AnonymousLords
Aug 18 2017 04:55
I want to return the two sub arrays
heroiczero
@heroiczero
Aug 18 2017 04:55
@AnonymousLords do return array; on a new line
CamperBot
@camperbot
Aug 18 2017 04:56
:bulb: to format code use backticks! ``` more info
Dre'Sean Williams
@dresean
Aug 18 2017 04:57

```var johnSize = 150;
var jeffSize = 250;

const johnTotal = johnSize + (johnAge 5);
const jeffTotal = jeffSize + (jeffAge
5);

switch (winner) {
case johnTotal > jeffTotal:
console.log( ‘John is the winner! He had ‘+ johnTotal +’ points’ );
break;

case jeffTotal > johnTotal:
console.log( ‘Jeff is the winner! He had ‘+ jeffTotal +’ points’ );
break;

case jeffTotal === johnTotal:
console.log( ‘Issa tie boss!’ );
break

default:
console.log( ‘WHAT ARE THOSE?!’ );
break;
}
```

what am I doing wrong here? can someone help?
John
@AnonymousLords
Aug 18 2017 04:57
Un expected Token? var zero = (arr.slice(0, size - 1); @heroiczero @SkyC0der
Please use the proper way to post code
code
You messed it up
heroiczero
@heroiczero
Aug 18 2017 04:59
@AnonymousLords see your ( and ) for every bracket and parentheses you need a closing one too cant have them solo
John
@AnonymousLords
Aug 18 2017 04:59
Oh :P
Okay it jus returns 2
I accidentally added the extra paraentheses
heroiczero
@heroiczero
Aug 18 2017 05:01
@AnonymousLords because you are return array.push you want to only return array; remember Return exits the function
John
@AnonymousLords
Aug 18 2017 05:01
console.log(arr.slice(0, size - 1)); outputs [ 'a' ]
Azel Alyne Tan
@azelalynetan
Aug 18 2017 05:01
@hermeticlock glad it works. :)
I think you should remove the class "navbar-fixed-top" in your nav
John
@AnonymousLords
Aug 18 2017 05:03
console.log(arr.slice(0, size )); outputs [ 'a', 'b' ] @heroiczero @SkyC0der
Gulsvi
@gulsvi
Aug 18 2017 05:05
That looks right @AnonymousLords what's the issue?
heroiczero
@heroiczero
Aug 18 2017 05:05
@AnonymousLords oh my bad it doesn't include the end. I am half asleep.
My codde just outputs 2
Gulsvi
@gulsvi
Aug 18 2017 05:06

yeah, when you do this:

array = array.push(zero, next);

array is now equal to the length

John
@AnonymousLords
Aug 18 2017 05:06
I removed the -1 in the first slice to fix
@SkyC0der Okay
Gulsvi
@gulsvi
Aug 18 2017 05:06
var array = [10, 20, 30];
array = array.push(40);
console.log(array) // 4
John
@AnonymousLords
Aug 18 2017 05:07
Now my code outputs [ [ 'a', 'b' ], [] ]
Gulsvi
@gulsvi
Aug 18 2017 05:07
var array = [10, 20, 30];
array.push(40);
console.log(array) //  [10, 20, 30, 40];
Part of the problem is you returning the new length after the .push
John
@AnonymousLords
Aug 18 2017 05:08
I fixed the array = push party
Its just push
Gulsvi
@gulsvi
Aug 18 2017 05:09

You were closer before:

function chunkArrayInGroups(arr, size) {
  var array = [];

  var zero = arr.slice(0, size);
  var next = arr.slice(size, size + size);
  array.push(zero, next);
  return array;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);

That passes some of the tests, but you need to account for when the array can't be split up evenly

John
@AnonymousLords
Aug 18 2017 05:10
My code only splits twice
So for loop?
Gulsvi
@gulsvi
Aug 18 2017 05:11
a for loop could work - or a check to see if more elements remain. A few different approaches possible now
John
@AnonymousLords
Aug 18 2017 05:12
How would i check if more elements remain
Gulsvi
@gulsvi
Aug 18 2017 05:12
if the array is longer than size + size and less than size + size + size, just give me the rest
John
@AnonymousLords
Aug 18 2017 05:12
So that would work
Gulsvi
@gulsvi
Aug 18 2017 05:12
^^ Really crappy pseudocode by the way, but hope that paints a picture
:)
John
@AnonymousLords
Aug 18 2017 05:12
Okay
size + size is that slice?
@SkyC0der
And you changed your profile picture
Gulsvi
@gulsvi
Aug 18 2017 05:15
size + size is the end where you last sliced
or 4 in your case, so you'd check if the array is longer than 4
John
@AnonymousLords
Aug 18 2017 05:16
I'm confused
I never change the value of slice
Gulsvi
@gulsvi
Aug 18 2017 05:17
the first arr.slice you do is arr.slice(0, 2)
John
@AnonymousLords
Aug 18 2017 05:17
Yes
Gulsvi
@gulsvi
Aug 18 2017 05:17
then you do arr.slice(2, 4)
John
@AnonymousLords
Aug 18 2017 05:17
Yes
Gulsvi
@gulsvi
Aug 18 2017 05:17
which means start at index 2, end at index 4
John
@AnonymousLords
Aug 18 2017 05:17
Yes
Gulsvi
@gulsvi
Aug 18 2017 05:17
so, if index 5 exists, there's more to slice
John
@AnonymousLords
Aug 18 2017 05:17
Okay
Gulsvi
@gulsvi
Aug 18 2017 05:18
You'll need to check for that and take whatever's left from the array
John
@AnonymousLords
Aug 18 2017 05:18
STill confused
How do i check for more elemts
comparing size to arr's length?
Gulsvi
@gulsvi
Aug 18 2017 05:18
correct
John
@AnonymousLords
Aug 18 2017 05:19
Where do i add it though
after the first slice
Gulsvi
@gulsvi
Aug 18 2017 05:19
You could also use .splice() which will actually modify the original array and remove the elements from it
that way, you can keep .splice()'ing until there's nothing left
After the last slice, you need to check if there's more to slice
John
@AnonymousLords
Aug 18 2017 05:20
What if the size is 1
Gulsvi
@gulsvi
Aug 18 2017 05:21
I'd have to check, but I think if you slice a number greater than 1 when the array is larger than 1, it will still just return that one element
John
@AnonymousLords
Aug 18 2017 05:22
Because i cant do two slices if it is 1
so put after the first slice?
Gulsvi
@gulsvi
Aug 18 2017 05:22
var arr = [1];
var chunk = arr.slice(0,40);
console.log(chunk); // [1]
John
@AnonymousLords
Aug 18 2017 05:23

function chunkArrayInGroups(arr, size) {
  var array = [];



  arr.slice(0, size);
  if (arr.length > size) {
  arr.slice(size, size + size);
  }
  array.push(arr);
  return array;

}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
It current just returns the same array
Gulsvi
@gulsvi
Aug 18 2017 05:24
arr.slice() returns what got removed, so you need to assign the removed elements to something
like you had before
  var zero = arr.slice(0, size);
  var next = arr.slice(size, size + size);
maybe look at it like:
  var zero = arr.slice(0, size * 1);
  var next = arr.slice(size, size * 2);
John
@AnonymousLords
Aug 18 2017 05:25
function chunkArrayInGroups(arr, size) {
  var array = [];



  var zero = arr.slice(0, size );
  if (arr.length > size) {
  var next = arr.slice(size, size + size);
    array.push(zero, next);
  }
  return array;

}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
Doesnt work
I gtg in like 20 minutes
Gulsvi
@gulsvi
Aug 18 2017 05:26

or...

array.push(arr.slice(0, size * 1))
array.push(arr.slice(0,size * 2))
array.push(arr.slice(0,size * 3))

and keep going until size * number is bigger than the arr.length

John
@AnonymousLords
Aug 18 2017 05:29
Should i use a whileloop?
Instead of a ifstatement
Gulsvi
@gulsvi
Aug 18 2017 05:29
That's what I used
Trying to just give you some basic hints without telling you how to write it - sorry if I seem a little unhelpful
these JS challenges are hard for me to give hints on - it's why I hang out here in the Front End room :joy:
John
@AnonymousLords
Aug 18 2017 05:31
function chunkArrayInGroups(arr, size) {



  var array = [];
  var num = 1;

  var zero = arr.slice(0, size * num);
  while (size * num < arr.length) {
    num + 1;
    arr.slice(0, size * num)
    array.push(arr);
  }
  return array;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
infinite loop?
Gulsvi
@gulsvi
Aug 18 2017 05:31
num + 1 doesn't change the value of num
John
@AnonymousLords
Aug 18 2017 05:32
num += 1?
Gulsvi
@gulsvi
Aug 18 2017 05:32
Yes
or num++
iso
@iso1048
Aug 18 2017 05:32
@SkyC0der bro how well do you know command line?
John
@AnonymousLords
Aug 18 2017 05:32
function chunkArrayInGroups(arr, size) {



  var array = [];
  var num = 1;

  var zero = arr.slice(0, size * num);
  while (size * num < arr.length) {
    num++
    arr.slice(0, size * num)
    array.push(arr);
  }
  return array;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
Gulsvi
@gulsvi
Aug 18 2017 05:32
I know windows/dos pretty well @gothamknight
nothing about powershell or mac os terminal, linux, etc
John
@AnonymousLords
Aug 18 2017 05:33
Nowit just returns arr
iso
@iso1048
Aug 18 2017 05:33
@SkyC0der do you use it much?
Gulsvi
@gulsvi
Aug 18 2017 05:33
because you are pushing arr on every loop instead of what you sliced
@gothamknight Yeah, why?

@AnonymousLords

The slice() method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.

So, if you run .slice() on the array - the array isn't modified
John
@AnonymousLords
Aug 18 2017 05:35
var next = arr.slice(0, size * num)
    array.push(next);
Line 11 - 12
Why same result
iso
@iso1048
Aug 18 2017 05:35
@SkyC0der i just started the short codecademy course for it last night. Was just wondering if it was worth continuing. But they teach terminal. where did you learn windows command line?
Gulsvi
@gulsvi
Aug 18 2017 05:36
I learned it maybe 6 years ago so I could run some minecraft hacks
just typed in help in the command line and got all the commands
went through them one by one
John
@AnonymousLords
Aug 18 2017 05:36
Am i close @SkyC0der
Gulsvi
@gulsvi
Aug 18 2017 05:36
@AnonymousLords Looks like that should get you closer, yes
John
@AnonymousLords
Aug 18 2017 05:37
So now what
How do i push whast been sliced?
iso
@iso1048
Aug 18 2017 05:38
@SkyC0der oh true. What kind of stuff do you use dos for now?
Gulsvi
@gulsvi
Aug 18 2017 05:39
@AnonymousLords Add some console.log() statements to your code so you understand what each line is doing
Any more hints and I'm basically writing it for you :/
Not sure how else to help - but I've told you all I can about .slice() and how that works. How .push() works and what it returns
Remember that .slice takes a start and an end @AnonymousLords So if you have a 0 in there, and keep increasing the size of your splice, you start adding 2, then 4, then 6 elements at a time (for example, if the size = 2)
John
@AnonymousLords
Aug 18 2017 05:41
No matter what i do it alwasy returns the same string
Gulsvi
@gulsvi
Aug 18 2017 05:41
@gothamknight Just for backing up my computer now, some text parsing, etc
@AnonymousLords It's always returning the same thing because:
  while (size * num < arr.length) {
^^ that goes once when size * num = 2
then when it equals 4, it's no longer less than arr.length
John
@AnonymousLords
Aug 18 2017 05:43
so?
Gulsvi
@gulsvi
Aug 18 2017 05:43
So your while loop only runs once
John
@AnonymousLords
Aug 18 2017 05:43
function chunkArrayInGroups(arr, size) {



  var array = [];
  var num = 1;
  var numSize = size* num;

  var zero = arr.slice(0, size * num);
  while (size * num < arr.length) {
    num++;
    var next  = arr.slice(numSize, size * num)
    array.push(next);
  }
  return array;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
Now i only get c and d
Its only splitting from 0
as a start
Gulsvi
@gulsvi
Aug 18 2017 05:44
You're going to make me add all these console.log()'s for you huh?
:p
John
@AnonymousLords
Aug 18 2017 05:44
I have been adding
Gulsvi
@gulsvi
Aug 18 2017 05:44
It's the only way to understand what your code is doing
John
@AnonymousLords
Aug 18 2017 05:44
I do understand
prakash chandra yadav
@prakashyadav008
Aug 18 2017 05:44
hey can we apply the transition effect on the <i> tag
..?
John
@AnonymousLords
Aug 18 2017 05:45
I really dont understand why it wont work
Their sonly so many places i can add console.log
prakash chandra yadav
@prakashyadav008
Aug 18 2017 05:47
@SkyC0der
John
@AnonymousLords
Aug 18 2017 05:47
I either get a, b or c,d never both
[ 'c', 'd' ] => [ undefined ]
var next = console.log(arr.slice(numSize, size * num))
Gulsvi
@gulsvi
Aug 18 2017 05:47
function chunkArrayInGroups(arr, size) {
  var array = [];
  var num = 1;
  var numSize = size* num; // numsize starts at 2 but should start at 0

  var zero = arr.slice(0, size * num); // zero isn't used anywhere
  while (size * num < arr.length) {
    num++; // num = 2 on the first loop, the second loop doesn't happen because size * num becomes greater than arr.length
    var next  = arr.slice(numSize, size * num) // next = ["c", "d"]
    array.push(next); // now array = ["c", "d"]
  }
  return array; // ["c", "d"]
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
@prakashyadav008 Yes, you can apply css transition properties to i tags
John
@AnonymousLords
Aug 18 2017 05:49
@SkyC0der You told me to compare size * num to arr .-.
prakash chandra yadav
@prakashyadav008
Aug 18 2017 05:49
@SkyC0der take a look isnt working
Gulsvi
@gulsvi
Aug 18 2017 05:50
@AnonymousLords Yes, but you are comparing size * num to arr - 1 when you do (size * num < arr.length)
John
@AnonymousLords
Aug 18 2017 05:50
Still confused on why i need to compare
Gulsvi
@gulsvi
Aug 18 2017 05:50
4 is not less than 4
4 is less than or equal to 4 though
From the code comments I put above, you can see that you aren't doing anything with .slice(0, 2)
you're doing .slice(2,4) and then returning that
@prakashyadav008 In codepen, click the down arrow in your CSS panel in the top, right-hand corner and select "Analyze CSS"
Some errors that need to be fixed
John
@AnonymousLords
Aug 18 2017 05:53
function chunkArrayInGroups(arr, size) {
  var array = [];
  var num = 1;
  var numSize = size* num; // numsize starts at 2 but should start at 0

  var zero = arr.slice(0, size * num); // zero isn't used anywhere
  while (size * num < arr.length) {
    num++; // num = 2 on the first loop, the second loop doesn't happen because size * num becomes greater than arr.length
    var next  = arr.slice(numSize, size * num) // next = ["c", "d"]
    array.push(zero, next); // now array = ["c", "d"]
  }
  return array; // ["c", "d"]
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
I added zero to array.push
Gulsvi
@gulsvi
Aug 18 2017 05:55
Try to make a while loop that outputs these two number on every loop:
0, 2
2, 4
4, 6
6, 8
until 10
John
@AnonymousLords
Aug 18 2017 05:55
?
Gulsvi
@gulsvi
Aug 18 2017 05:56
That's what you .slice() has to do to group everything into chunks = size
John
@AnonymousLords
Aug 18 2017 05:57
okay
Gulsvi
@gulsvi
Aug 18 2017 05:57
It has to do .slice(0, 2), .slice(2, 4), etc... up until the second number is greater than or equal to the length of the array
John
@AnonymousLords
Aug 18 2017 05:57
Okay
Am i close?
Gulsvi
@gulsvi
Aug 18 2017 05:58
You've been really close, and I'm biting my fingers not to type out the answer for you :)
John
@AnonymousLords
Aug 18 2017 05:58
What am i missing?
console.log(num++) is only 1 ;-;
its 2 pm;
Sorin Ruse
@sorinr
Aug 18 2017 06:00
@prakashyadav008 I would add this code below in css to let the user know that clicking the temp symbol it takes some action:
#tempSymbol {
  cursor: pointer;
}
Gulsvi
@gulsvi
Aug 18 2017 06:01
@AnonymousLords
function chunkArrayInGroups(arr, size) {
  var array = [];
  var num = 0;

  while (size * num < arr.length) {
    var numSize = size * num;
    num++; 
    var next  = arr.slice(numSize, size * num);
    array.push(next)
  }
  return array;
}
^^ Study the differences
John
@AnonymousLords
Aug 18 2017 06:01
Is that teh correct version?
Gulsvi
@gulsvi
Aug 18 2017 06:01
I stopped biting my fingers, so close your eyes if you don't want a spoiler
It's your version adapted to work
John
@AnonymousLords
Aug 18 2017 06:03
Why does yours work?
Gulsvi
@gulsvi
Aug 18 2017 06:03
The only change is to move your numSize declaration inside the while loop so it increments too and to make it so you only push one value to the array
John
@AnonymousLords
Aug 18 2017 06:03
wha
english?
Gulsvi
@gulsvi
Aug 18 2017 06:04
You have numSize outside the while loop
John
@AnonymousLords
Aug 18 2017 06:04
Okay
Gulsvi
@gulsvi
Aug 18 2017 06:04
so, you are always doing .slice(0, <<some number>>>)
that 0 needs to increment too
0,2
2,4
4,6
etc.
so numSize needs to go in the while() loop
John
@AnonymousLords
Aug 18 2017 06:04
in·cre·ment
[ in-kr uh-m uhnt, ing-]

NOUN
1.
something added or gained; addition; increase.
okay
Gulsvi
@gulsvi
Aug 18 2017 06:05
lol
John
@AnonymousLords
Aug 18 2017 06:05
lol
Gulsvi
@gulsvi
Aug 18 2017 06:05
needs to get bigger bruh
:p
John
@AnonymousLords
Aug 18 2017 06:05
lol
I like coding, but i want to code a game
Or something
Coding is so complex
Gulsvi
@gulsvi
Aug 18 2017 06:05
The only other change was this: array.push(zero, next); to array.push(next);
only need to push what you sliced
Eric Hasegawa
@EricHasegawa
Aug 18 2017 06:06
I'm trying to build the local weather app, and I'm having a little trouble using the json data that I've connected to the page, can anyone help?
John
@AnonymousLords
Aug 18 2017 06:06
Okay thanks so much @SkyC0der
CamperBot
@camperbot
Aug 18 2017 06:06
anonymouslords sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2435 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 06:06
@AnonymousLords This stuff is hard, and you'll run into it with gaming development too
Think physics... g-forces, barrel rolls, crashes, and bouncing around - it's all math
how do I get my nav to not be right on top of the first card
John
@AnonymousLords
Aug 18 2017 06:07
@SkyC0der OHH IT JUST CLICKED
Tai Jones
@taiJones00
Aug 18 2017 06:07
using margin didn't work
John
@AnonymousLords
Aug 18 2017 06:07
Why yours works
Okay thanks
Gulsvi
@gulsvi
Aug 18 2017 06:08
It's nearly the same as yours
John
@AnonymousLords
Aug 18 2017 06:08
yeah
it all makes sense now lo
Okay i gtg to bed, its 2:07 pm
Havent slept in
around 18 hours
Can someone tell me how to use the JSON data I connected to display the weather?
Gulsvi
@gulsvi
Aug 18 2017 06:12
gnight @AnonymousLords
@EricHasegawa You seem to be getting the weather just fine
I see the temperature logged to the console for my location
Eric Hasegawa
@EricHasegawa
Aug 18 2017 06:14
@SkyC0der Yeah I know that much, but I'm not sure how to display it on the page for the user to see
Gulsvi
@gulsvi
Aug 18 2017 06:15

@EricHasegawa You can add a <div> with id="temperature":

<div id="temperature"></div>

Then with jQuery, do:

$("#temperature").html(json.main.temp);
^^ That will add your temperature to the div
Sorin Ruse
@sorinr
Aug 18 2017 06:15
@taiJones00 something like:
#card-one{
  margin-top: 50px;
}
Gulsvi
@gulsvi
Aug 18 2017 06:16
@EricHasegawa It's just like you did with .text() in your quote machine
.text(), .html(), .append(), .prepend(), all of the HTML manipulation methods listed here will be useful at some point: https://api.jquery.com/category/manipulation/
@SkyC0der I tried to manipulate it like you said, but it's showing up as the text on my web page
Sorin Ruse
@sorinr
Aug 18 2017 06:18
@taiJones00 and in js u need:
scrollTop: $(hash).offset().top-50
Eric Hasegawa
@EricHasegawa
Aug 18 2017 06:18
Oh nevermind dumb mistake
@SkyC0der I accidentally put it in quotations, thanks for the help!
CamperBot
@camperbot
Aug 18 2017 06:18
erichasegawa sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2436 | @skyc0der |http://www.freecodecamp.com/skyc0der
hermeticlock
@hermeticlock
Aug 18 2017 06:29

Quick question. I made my background container at the top transparent, but I only want the box to be transparent, not the text inside it.

http://codingforkids.us/newcodingforkids/

What are my options?

cowCrazy
@cowCrazy
Aug 18 2017 06:34
@hermeticlock try to make the opacity specific to your background like this background-color: rgb(243, 146, 55, 0.5); last parameter is opacity
hermeticlock
@hermeticlock
Aug 18 2017 06:36

Thanks @cowCrazy

Didn't know you could do that with rgb

CamperBot
@camperbot
Aug 18 2017 06:36
hermeticlock sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 339 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
hermeticlock
@hermeticlock
Aug 18 2017 06:37
That seemed to make the box disapear completely lol
@cowCrazy
cowCrazy
@cowCrazy
Aug 18 2017 06:39
@hermeticlock sorry, should be rgba()
hermeticlock
@hermeticlock
Aug 18 2017 06:41
You rock @cowCrazy
Sorin Ruse
@sorinr
Aug 18 2017 06:43
@hermeticlock your headbox class in css should be like:
.headbox {
    padding-top: 5%;
    background: rgba(243, 146, 55,0.5);
    border-radius: 5px;
    height: 150px;
    margin-left: auto;
    margin-right: auto;
    width: 250px;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";       /* IE 8 */
    filter: alpha(opacity=50);  /* IE 5-7 */
    -moz-opacity: 0.5;          /* Netscape */
    -khtml-opacity: 0.5;        /* Safari 1.x */
             /* Good browsers */
}
cowCrazy
@cowCrazy
Aug 18 2017 06:45
@sorinr :+1: , thanks for adding this important part :)
CamperBot
@camperbot
Aug 18 2017 06:45
cowcrazy sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1325 | @sorinr |http://www.freecodecamp.com/sorinr
hermeticlock
@hermeticlock
Aug 18 2017 06:46
So I should keep the other stuff?
One more question, how can I make my text centered in the box? It's under .main h1 in my CSS.
cowCrazy
@cowCrazy
Aug 18 2017 06:50

@hermeticlock

-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";       /* IE 8 */
    filter: alpha(opacity=50);  /* IE 5-7 */
    -moz-opacity: 0.5;          /* Netscape */
    -khtml-opacity: 0.5;        /* Safari 1.x */

this is to make it for other browsers, it would help to give an equal experience to all users on you website.

hermeticlock
@hermeticlock
Aug 18 2017 06:50
It's almost centered.... but I'm not sure how to make it exact because vertical-align: center; doesn't seem to work.
But won't that make the text inside it transparent too?
Rabin Shrestha
@jyapujuju
Aug 18 2017 06:51
 function sumFibs(num) {
  var m=0;
  var n=1;
  var fibb;
  var sum = [0,1];
  var totalsum=0;
  for(var i=1;i<=num;i++){
    fibb = m+n;
    m = n;
    n = fibb;
    sum.push(fibb);
  }
  for (var j = 0;j < sum.length; j++){
    if(sum[j] < num && sum[j]%2 != 0){
      totalsum = totalsum + sum[j];
    }  
  }
  return totalsum;

}

sumFibs(75025);
this giving me error
hermeticlock
@hermeticlock
Aug 18 2017 06:52

Look at your var totalsum=0;

Add a space between your = 0

I might be completely out of line and wrong, but that caught my eye.
cowCrazy
@cowCrazy
Aug 18 2017 06:56
@hermeticlock have you tried adding it and it gave the text opacity too?
hermeticlock
@hermeticlock
Aug 18 2017 06:57
Looks like it doesn't do that. Thanks guys.
hermeticlock
@hermeticlock
Aug 18 2017 07:40

How do I make my orange box smaller, in terms of width? Because the width attribute doesn't seem to change it...

http://codingforkids.us/newcodingforkids/

aisnotb
@aisnotb
Aug 18 2017 08:00
Hi, guys can you have a quick look at my code, why my loading logo is not centered.
I struggled for some time on this problem
iso
@iso1048
Aug 18 2017 08:10
@aisnotb don't know why your way is not working. You could manipulate the body to make it centered though.
aisnotb
@aisnotb
Aug 18 2017 08:13
@gothamknight what do you mean by manipulate body?
iso
@iso1048
Aug 18 2017 08:14
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
you could add that and then remove the position: absolute from the #loading css rule
aisnotb
@aisnotb
Aug 18 2017 08:15
i dont know much about flex :(
iso
@iso1048
Aug 18 2017 08:15
but then it will change the way you add other stuff onto the page.
Neither do I - http://flexboxfroggy.com/
aisnotb
@aisnotb
Aug 18 2017 08:15
Yeah, you are right.
iso
@iso1048
Aug 18 2017 08:15
that link is good
aisnotb
@aisnotb
Aug 18 2017 08:16
somehow transform: translate is not working on my machine. it worked for sure
iso
@iso1048
Aug 18 2017 08:16
i don't know anything about css animation
where did you learn it?
aisnotb
@aisnotb
Aug 18 2017 08:17
just google loading annimation and pick one you love and study it
iso
@iso1048
Aug 18 2017 08:17
true.
@SkyC0der with bootstrap nav, do the links in the nav have to be anchor elements. If I wanted to use icons as the nav-links, should I nest them within anchor elements or not?
Rabin Shrestha
@jyapujuju
Aug 18 2017 08:47
@SkyC0der can you look on my problem :\
:)
prakash chandra yadav
@prakashyadav008
Aug 18 2017 09:33
@SkyC0der thanks for the analyze css but the RBRACE warning doesnt matter
CamperBot
@camperbot
Aug 18 2017 09:33
prakashyadav008 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2440 | @skyc0der |http://www.freecodecamp.com/skyc0der
prakash chandra yadav
@prakashyadav008
Aug 18 2017 09:34
@SkyC0der still having issues using transition property for the <i> tag
BuntyBru
@BuntyBru
Aug 18 2017 10:10

Hello Everyone
Does anyone has an idea on

"What does a "Software Architecture and Design Engineer" does ?"
i need urgent help

Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:33
Friends, what topics do I need to prepare for an interview of Web UI role?
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:40
Need your suggestions please :)
Sajid Unar
@sajidunnar
Aug 18 2017 12:41
as frontend developer ?
try to know what technologies stack they are using in the company or ofcourse from job description
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:42
the JD just mentioned web UI
Sajid Unar
@sajidunnar
Aug 18 2017 12:43
Ui majorly used for design … UX is actual term
tryt o explore some of UI design frameworks ( google
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:44
ok
Sajid Unar
@sajidunnar
Aug 18 2017 12:44
for UX you can ofcourse review bootstrap , jquery and explore vue.js or react or angual or all
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:46
I like bootstrap and materializecss
Sajid Unar
@sajidunnar
Aug 18 2017 12:47
yes but in scope to get the job , we always need to know what they are seeking so we cover up those before call ;)
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:47
ok
Sajid Unar
@sajidunnar
Aug 18 2017 12:47
if you have contact of HR , ask questions wht u seeking wht skills etc
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:48
i don't have contact, i just got email for F2F and no mention about what skills they're looking for
Sajid Unar
@sajidunnar
Aug 18 2017 12:49
its k
if you are on linkedin … do some contact research and try any of person whos working there
Nitin Chandran Nair
@NitinNair89
Aug 18 2017 12:50
oh ok
Sajid Unar
@sajidunnar
Aug 18 2017 12:50
I mean search emploess of your target company
Eric Voigt
@ericvoigt
Aug 18 2017 12:56
When throughout the freecodecamp does javascript start to make sense? Not that I don't get it so far through the intro to JS but just seems like some of the console stuff is useless for me at this point. Just don't get the console for one, and I am sure it's just about gettting a baseline understanding.
Jim Tryon
@jimtryon
Aug 18 2017 12:57
It can take awhile to really understand javascript. I think it really starts to come together once you work through the projects @ericvoigt
Eric Voigt
@ericvoigt
Aug 18 2017 12:58
@jimtryon Thanks.. I know it's not useless info but just feel like I am at a stand still although I am doing assignments about everyday.
CamperBot
@camperbot
Aug 18 2017 12:58
ericvoigt sends brownie points to @jimtryon :sparkles: :thumbsup: :sparkles:
:cookie: 442 | @jimtryon |http://www.freecodecamp.com/jimtryon
Eric Voigt
@ericvoigt
Aug 18 2017 12:59
@jimtryon Soon will finishes the first javascript section and heading to object oriented then basic algorithm script (which sounds hard if you suck at math without a calculator lol)
Jim Tryon
@jimtryon
Aug 18 2017 12:59
@ericvoigt Yeah, algorithm section takes practice, a lot of practice depending on how fast you can learn things.
Eric Voigt
@ericvoigt
Aug 18 2017 13:00
@jimtryon how math intensive is it? Or theoretical math intensive
Jim Tryon
@jimtryon
Aug 18 2017 13:01
@ericvoigt I haven’t looked at it since I’m on that far but I’m going to say it’s going to require programming concepts like sorting algorithms, trees, etc
Eric Voigt
@ericvoigt
Aug 18 2017 13:02
@jimtryon cool, thanks for the input.. I have found a few youtube playlists, for atleast intro to javascript, that have helped a lot.. hope to find one for each section
CamperBot
@camperbot
Aug 18 2017 13:02
ericvoigt sends brownie points to @jimtryon :sparkles: :thumbsup: :sparkles:
:warning: ericvoigt already gave jimtryon points
Eric Voigt
@ericvoigt
Aug 18 2017 13:02
here is the intro to JS playlist tutorial if others need it.. helped me a ton! https://www.youtube.com/watch?v=HPV9CMwP-YI&list=PLF4Fpfzm6Ig1CCnNprimLx7yV1qbwHIre
DEEPAN
@ARASUMANI
Aug 18 2017 14:14
Hey do someone know a software which can detect some easy number captchas and type them in automaticall
Y
Gulsvi
@gulsvi
Aug 18 2017 14:54

@SkyC0der with bootstrap nav, do the links in the nav have to be anchor elements. If I wanted to use icons as the nav-links, should I nest them within anchor elements or not?

Yeah, you can do that. Is it not working for you? @gothamknight

@SkyC0der thanks for the analyze css but the RBRACE warning doesnt matter

@prakashyadav008 It's telling you that using a # to comment your CSS is invalid. If your issue still isn't resolved, I will take a closer look at your codepen when you fix these errors. All browsers handle invalid syntax differently.

@SkyC0der can you look on my problem :\

@jyapujuju Which problem did you need help with?

CamperBot
@camperbot
Aug 18 2017 14:54
skyc0der sends brownie points to @gothamknight and @prakashyadav008 and @jyapujuju :sparkles: :thumbsup: :sparkles:
:cookie: 379 | @gothamknight |http://www.freecodecamp.com/gothamknight
:cookie: 291 | @prakashyadav008 |http://www.freecodecamp.com/prakashyadav008
:cookie: 349 | @jyapujuju |http://www.freecodecamp.com/jyapujuju
alpox
@alpox
Aug 18 2017 14:57
@ARASUMANI We are not here to help with any kind of hacking
DEEPAN
@ARASUMANI
Aug 18 2017 14:59
@alpox its not to hack .I just wanted to know if there is any
alpox
@alpox
Aug 18 2017 15:03
@ARASUMANI I wouldn't tell you even if i knew. Captchas are there for protection. I'm sure nobody here wants to support any knowledge of going around the rightful protection of websites and applications
Jorge
@OrangeKulture
Aug 18 2017 15:03
hey whats happening guys
Colin
@finkbeca
Aug 18 2017 15:17
Hey everyone I have been trying to compile scss with node on the terminal. My scss is in a folder called css and I've been trying to use "node-sass -o css css/main.scss "and everytime it says no input file is founder any idea why this isnt working?
Tom
@moT01
Aug 18 2017 15:18
@finkbeca maybe try ./css/main.scss
Colin
@finkbeca
Aug 18 2017 15:22
@moT01 okay ill try that real fast
@moT01 Nope it still did not work
@moT01 When I try without the dot in the front so just "/css/main.scss" it tells me an output must be specified
Tom
@moT01
Aug 18 2017 15:25
yea, node-sass src/style.scss dest/style.css
thats the example on their gihub page
so you might want to try node-sass css/main.scss css/main.css
Colin
@finkbeca
Aug 18 2017 15:26
@moT01 no -0?
-o
node-sass css/main.scss css/main.css tried this and it says an output must be specified
Tom
@moT01
Aug 18 2017 15:27
it says -o is for the output directory, but that's included in the destination there in the example so i wouldn't think so
maybe add the / in front of the folders
Colin
@finkbeca
Aug 18 2017 15:28
k
Liam Docherty
@ldocherty1
Aug 18 2017 15:28
@SkyC0der Hi, remember I asked you about how to delay a animate.css effect? You linked me a codepen link. However, for some reason I think I deleted it by mistake. This was a few days but I was wondering if you had it saved somewhere. Sorry about this!
Colin
@finkbeca
Aug 18 2017 15:29
@moT01 yeah I tried that it says the same thing about output
@ldocherty1 I'm pretty sure there is a delay attribute for animate.
@ldocherty1 I don't know what you are looking for exactly but you can always use animation-delay:
dinesh
@1532j0004kg
Aug 18 2017 15:35
var flattened = [[0, 1], [2, 3], [4, 5]].reduce(
function(a, b) {
return a.concat(b);
},
[]
);
// flattened is [0, 1, 2, 3, 4, 5]
how it works?
Tom
@moT01
Aug 18 2017 15:37
@finkbeca im not sure, ...i would play around with it and try variations of the command. maybe look for another example. otherwise there's some online compilers - you would probly have to copy paste it in a new file
dinesh
@1532j0004kg
Aug 18 2017 15:37
in this what is a and b really mean
any body plz tell if u have some times...
var sum = [0, 1, 2, 3].reduce(function (a, b) {
return a + b;
}, 0);
// sum is 6
Colin
@finkbeca
Aug 18 2017 15:43
@moT01 what about something like koala?
No worries - ^^ have it saved here
dinesh
@1532j0004kg
Aug 18 2017 15:47
skycoder help me ...
Gulsvi
@gulsvi
Aug 18 2017 15:48
@1532j0004kg Try it this way and look at the console output:
var sum = [0, 1, 2, 3].reduce(function(a, b) {
  console.log("a:", a, "b:", b);
  return a + b;
}, 0);
Tom
@moT01
Aug 18 2017 15:49
@finkbeca give it a try
dinesh
@1532j0004kg
Aug 18 2017 15:49
ok what is a & b
I know this is parameters
Gulsvi
@gulsvi
Aug 18 2017 15:49
What do you see in the console when you run that code?
dinesh
@1532j0004kg
Aug 18 2017 15:51
I am using FCC in this I cant able to see
You know any other sites?
Gulsvi
@gulsvi
Aug 18 2017 15:52
repl.it and codepen.io are good ones
dinesh
@1532j0004kg
Aug 18 2017 15:55
tq i Understood
thanks @SkyC0der
CamperBot
@camperbot
Aug 18 2017 15:55
1532j0004kg sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2441 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 15:56
No problem
dinesh
@1532j0004kg
Aug 18 2017 16:02
sry I dont know the js
Davide Cristini
@davcri
Aug 18 2017 16:20
Hi guys! I'm making my first projects (tribute page and portfolio page). How these projects will be evaluated ?
dinesh
@1532j0004kg
Aug 18 2017 16:22
It must be web responsive , bro...
Davide Cristini
@davcri
Aug 18 2017 16:23
sorry I explain better: they are evaluated by a real person, not by a static program like other challenges ?
Gulsvi
@gulsvi
Aug 18 2017 16:23
@davcri They will be reviewed after completing all of your certifications (from what we know). They will likely be considered before you can begin contributing to non profit organizations as a full-stack developer.
dinesh
@1532j0004kg
Aug 18 2017 16:24

var array = [1, 12, 21, 2];

// Only change code below this line.

array.sort(function(a,b){
console.log(a,b);
return a-b;
});

i cant understood this
Davide Cristini
@davcri
Aug 18 2017 16:25
@SkyC0der nice :D so I can edit these projects after their submission ?
Amit Patel
@AmitP88
Aug 18 2017 16:25
hey guys, I'm working on a simple To Do List app using ReactJS and I've kind of hit a roadblock. I'm trying to pass the user input from the form into the <li> element in the Item component, but I don't think I'm doing it right, since the <Input> tag is in the Add component, but I have two <input> tags, one for the text field for the user to type in text and the other for the submit button. I'm not really sure exactly what I should do. https://codepen.io/AmitP88/pen/eEGKZM
Gulsvi
@gulsvi
Aug 18 2017 16:25
@davcri Yes, you can edit them after you submit them. :)
Davide Cristini
@davcri
Aug 18 2017 16:26
@SkyC0der thank you very much! Good camping everyone ;)
CamperBot
@camperbot
Aug 18 2017 16:26
davcri sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2442 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 16:27
Happy Camping ;) :fire:
Jake
@NeelDVirus
Aug 18 2017 16:40
why the css property top:50% of the selector .page not working.
https://codepen.io/neel111/pen/NvXNjN
Gulsvi
@gulsvi
Aug 18 2017 16:48
@NeelDVirus percentage depends on the height of the element's parent. Ask yourself - 50% of what?
The body is set to 100%, but 100% of what? :)
Give your body a height and then the .page will be 50% down from the top of that
dinesh
@1532j0004kg
Aug 18 2017 16:52
he already give a height to 100%;
gulptech
@gulptech
Aug 18 2017 17:10
html,body{ and transform: translate(-200px,-100px);
but you can adjust html,body to not have a background-color
Raja
@virtualhandshake
Aug 18 2017 17:23
Hi all.
dinesh
@1532j0004kg
Aug 18 2017 17:23
hi
Raja
@virtualhandshake
Aug 18 2017 17:23
Here's the personal portfolio page I am making: https://codepen.io/virtualhandshake/pen/KqorZK?editors=1100
As you can see in the main menu "portfolio" and "contact" won't center, what am I doing wrong?
dinesh
@1532j0004kg
Aug 18 2017 17:25
use right padding or center ...
I guess this...
Raja
@virtualhandshake
Aug 18 2017 17:26
I used text-align:center, it didn't work.
dinesh
@1532j0004kg
Aug 18 2017 17:28
where u used
gulptech
@gulptech
Aug 18 2017 17:28
get rid of the width: 70px not enough space for the text
Can someone help me to figure out how to centre the weather information?
ie. the temperature, humidity and conditions
refer this @virtualhandshake ...
Raja
@virtualhandshake
Aug 18 2017 17:33
@gulptech No, it wasn't that, I had to remove the right and left padding on li
@1532j0004kg Thanks, done!!!]
CamperBot
@camperbot
Aug 18 2017 17:33
virtualhandshake sends brownie points to @1532j0004kg :sparkles: :thumbsup: :sparkles:
:cookie: 257 | @1532j0004kg |http://www.freecodecamp.com/1532j0004kg
dinesh
@1532j0004kg
Aug 18 2017 17:34
ok broieee....what's the problem in urs pen,,,
may u tell me?
DJ Nixon
@tGxcoder
Aug 18 2017 18:05
.right{display: inline-block;
    position: fixed;
    top: 250px;
    bottom: 0;
    left: 15em;
    right: 0;}
Liam Docherty
@ldocherty1
Aug 18 2017 18:05
@SkyC0der Sorry for late response and that was the one thanks!
CamperBot
@camperbot
Aug 18 2017 18:05
ldocherty1 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2443 | @skyc0der |http://www.freecodecamp.com/skyc0der
DJ Nixon
@tGxcoder
Aug 18 2017 18:06
why does that squeeze my div together instead of just shift right?
Liam Docherty
@ldocherty1
Aug 18 2017 18:06
@finkbeca Thanks for the help :)
CamperBot
@camperbot
Aug 18 2017 18:06
ldocherty1 sends brownie points to @finkbeca :sparkles: :thumbsup: :sparkles:
:cookie: 246 | @finkbeca |http://www.freecodecamp.com/finkbeca
DJ Nixon
@tGxcoder
Aug 18 2017 18:07
this moves my div right but it squeezes then overlaps the further right i go. can someone explain why?
.right{display: inline-block;
    position: fixed;
    top: 250px;
    bottom: 0;
    left: 15em;
    right: 0;}
Gulsvi
@gulsvi
Aug 18 2017 18:08
@virtualhandshake remove navbar-right from your navbar <ul> element and your links will center:
<ul class="nav navbar-nav">
Gulsvi
@gulsvi
Aug 18 2017 18:14
@tGxcoder bootstrap columns all have a percentage-based width. When you push the row they are in over to the right, the row gets narrower, and so do the columns.
If you're hoping to move the columns over to the right, use column offsets instead: https://getbootstrap.com/docs/3.3/css/#grid-offsetting
DJ Nixon
@tGxcoder
Aug 18 2017 18:18
@SkyC0der thanks ill check that out
CamperBot
@camperbot
Aug 18 2017 18:18
tgxcoder sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2444 | @skyc0der |http://www.freecodecamp.com/skyc0der
Kyle
@kcoble24
Aug 18 2017 18:22
its time for my tribute page and idk wtf to do.... :(
gulptech
@gulptech
Aug 18 2017 18:23
a tribute to skycoder :)
Kyle
@kcoble24
Aug 18 2017 18:24
i think i decided on who to tribute, but i literally dont know where to start code wise
i feel like i didnt grasp anything from the training
DJ Nixon
@tGxcoder
Aug 18 2017 18:37
dont let it get you down i was the same way for awhile. i stooed for awhile and started over and it clicked . one of the things that helped me was looking at others pages and looking at the code trying to figure out what does what. plus it also helps you decide how you want to style it.
@kcoble24 it can be something as retarted as this lol https://codepen.io/tGxCoder/pen/xLXGBx
Rafal
@eggnaro
Aug 18 2017 18:51
hi
have a lil problem
Instructions
Use bracket notation to find the second-to-last character in the lastName string.

// Example
var firstName = "Ada";
var thirdToLastLetterOfFirstName = firstName[firstName.length - 3];

// Setup
var lastName = "Lovelace";

// Only change code below this line
var secondToLastLetterOfLastName = lastName;

and what I have one is just changed the last line of code like this
var secondToLastLetterOfLastName = lastName[lastName.lenght - 3];
is there somethink wrong?
Jorge
@OrangeKulture
Aug 18 2017 18:54
lastName.lenght - 3 would find the third to last
you are looking for the second to last
Rafal
@eggnaro
Aug 18 2017 18:56
thats what Ive done
and it doesnt work...
Jorge
@OrangeKulture
Aug 18 2017 18:57
yeah the last line of the code you included is wrong
Rafal
@eggnaro
Aug 18 2017 18:58
so -2?
Jorge
@OrangeKulture
Aug 18 2017 18:58
exactly
Rafal
@eggnaro
Aug 18 2017 18:58
ive tried that
and also doesnt worked
Jorge
@OrangeKulture
Aug 18 2017 18:58
whats the name of the challenge?
Rafal
@eggnaro
Aug 18 2017 18:58
155
Jorge
@OrangeKulture
Aug 18 2017 18:59
yeah but the name?
Rafal
@eggnaro
Aug 18 2017 18:59
Use Bracket Notation to Find the NthtoLast Character in a String
gulptech
@gulptech
Aug 18 2017 19:00
lastName.lenght :)
i made the same mistake
and yes…-2
Rafal
@eggnaro
Aug 18 2017 19:01
-2 doesnt work
gulptech
@gulptech
Aug 18 2017 19:01
length not lenght
Rafal
@eggnaro
Aug 18 2017 19:01
loooool
@gulptech thanks
CamperBot
@camperbot
Aug 18 2017 19:02
eggnaro sends brownie points to @gulptech :sparkles: :thumbsup: :sparkles:
:cookie: 323 | @gulptech |http://www.freecodecamp.com/gulptech
Rafal
@eggnaro
Aug 18 2017 19:02
my man :)
iso
@iso1048
Aug 18 2017 19:42
@SkyC0der awesome. Nah I was just wondering if it was good practice. Thanks
CamperBot
@camperbot
Aug 18 2017 19:42
gothamknight sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2445 | @skyc0der |http://www.freecodecamp.com/skyc0der
BrianWilliams28
@BrianWilliams28
Aug 18 2017 19:49
im trying to split a string by capital letters without any spaces in the substrings after the split, so far I have this str = 'This Is Spinal Tap' and var split = str.split(/(?=[A-Z])/g); which outputs to ["This ", "Is ", "Spinal ", "Tap"]. how can i fix it so that it splits without the spaces
the spaces in "Is " and "Spinal " for example
BrianWilliams28
@BrianWilliams28
Aug 18 2017 19:55
is it better to solve this algorithm with recude()?
or is there a way to modify the regular expression to delete the whitespaces after the split?
or just not include them in the search
juni
@junipberry
Aug 18 2017 20:00
could someone point out what I’m missing here:
function addFullNameProperty(obj) {
  let firstName = obj.firstName;
  let lastName = obj.lastName;
 return (firstName + " " + lastName);
}
Teo
@Teo03
Aug 18 2017 20:05
Can someone help, I don't know what's wrong with my code
Here is my code:
function fearNotLetter(str) {
  var letters = 'abcdefghijklmnopqrstuvwxyz';
  for(var i = 0; i < letters.length; i++){
    if(!str.includes(letters[i])){
      return letters[i];
    }
  }
  return undefined;
}

fearNotLetter("abce");
Tom
@moT01
Aug 18 2017 20:08
@Teo03 need to split it to an array first maybe?
Teo
@Teo03
Aug 18 2017 20:08
@moT01 Ok I will try
Gulsvi
@gulsvi
Aug 18 2017 20:10
@BrianWilliams28 You can check for spaces in regex with \s. Use a vertical bar for OR |: str.split(/(?=[A-Z])|\s/g)
I don't know about using .reduce(). Think about how you would do it mentally and try to make your code do the same. Then simplify the logic from there.
Teo
@Teo03
Aug 18 2017 20:10
@moT01 It still doesen't work
function fearNotLetter(str) {
  var arr = str.split('');
  var letters = 'abcdefghijklmnopqrstuvwxyz';
  for(var i = 0; i < letters.length; i++){
    if(!arr.includes(letters[i])){
      return letters[i];
    }
  }
  return undefined;
}

fearNotLetter("abce");
Tom
@moT01
Aug 18 2017 20:11
i meant letters
Teo
@Teo03
Aug 18 2017 20:12
@moT01
still doesen't work
Gulsvi
@gulsvi
Aug 18 2017 20:13
@junipberry Your code looks good to me, but I'm not sure what the expected output is. Here's what it returns for me with this example object:
function addFullNameProperty(obj) {
  let firstName = obj.firstName;
  let lastName = obj.lastName;
  return firstName + " " + lastName;
}

var obj = {
  firstName: "junip",
  lastName: "berry"
};

addFullNameProperty(obj); // returns "junip berry"
Tom
@moT01
Aug 18 2017 20:14
@Teo03 worked for me
Teo
@Teo03
Aug 18 2017 20:15
Here is my code but I can't pass
function fearNotLetter(str) {
  var letters = 'abcdefghijklmnopqrstuvwxyz';
  var arr = letters.split('');
  console.log(arr);
  for(var i = 0; i < arr.length; i++){
    if(!str.includes(arr[i])){
      return arr[i];
    }
  }
  return undefined;
}

fearNotLetter("abce");
Tom
@moT01
Aug 18 2017 20:16
what is the challenge? that will only return the first letter it doesn't find, if you need more than one letter you would probly want to make an array, and return the array after you've gone through the whole argument
Gulsvi
@gulsvi
Aug 18 2017 20:17
@Teo03 You'll need to check if you've already looked at all the letters in str.
Errr... never mind. looked too quickly :p. Your current approach assumes that a is in every single str passed to the function
if a isn't there, you return it
Stephen James
@sjames1958gm
Aug 18 2017 20:19
@Teo03 You need to start from arr[0] and confirm that each subsequent letter is the next in the sequence, if not return the missing one
BrianWilliams28
@BrianWilliams28
Aug 18 2017 20:21
@SkyC0der here's the problem, when I try to split it with caps or white spaces it works for some arguments but not others. like one of the things that it needs to work for us "AllThe-small Things"
Teo
@Teo03
Aug 18 2017 20:21
Is this better?
function fearNotLetter(str) {
  var letters = 'abcdefghijklmnopqrstuvwxyz';
  var arr = letters.split('');
  console.log(arr);
  for(var i = 0; i < str.length; i++){
  for(var j = 0; j < arr.length; j++){
    if(!str[i].includes(arr[i])){
      return arr[i];
    }
  }
  }
  return undefined;
}

fearNotLetter("abce");
I don't knowwhere I'am wrong
Gulsvi
@gulsvi
Aug 18 2017 20:23
@BrianWilliams28 You can use \W instead of \s to handle that case
var str = "AllThe-small Things";
console.log(str.split(/(?=[A-Z])|\W/g)); // ["All", "The", "small", "Things"]

var str = 'This Is Spinal Tap';
console.log(str.split(/(?=[A-Z])|\W/g)); // ["This", "Is", "Spinal", "Tap"]
honestly though, if this regex approach isn't working for you, try a different approach @BrianWilliams28. You don't have to use a regular expression.
Walk through each string with a loop: If it's upper-case and not the first letter, add a hyphen before it and make it lower-case. Remove spaces, underscores, and extra hyphens, along the way.
RonSwan
@RonSwan
Aug 18 2017 20:29
how does one get fontawesome to work in codepen?
alpox
@alpox
Aug 18 2017 20:30
@RonSwan Put that link in the css section:
https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css
And use it right away
Eric Hasegawa
@EricHasegawa
Aug 18 2017 20:34
Could anyone help me with this last part of the Local Weather App? I'm trying to figure out what's wrong with my code and why it doesn't change the weather from Celsius to Fahrenheit when I press the Convert Temperature button
Gulsvi
@gulsvi
Aug 18 2017 20:37
@EricHasegawa In JavaScript, we can't call a function that's inside another function
You're trying to call the ceToFa() function, but it's inside your getJSON callback function
RonSwan
@RonSwan
Aug 18 2017 20:38
thank you @alpox going to go over the lesson again having issues adding the icons to the profolio
CamperBot
@camperbot
Aug 18 2017 20:38
ronswan sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1305 | @alpox |http://www.freecodecamp.com/alpox
BrianWilliams28
@BrianWilliams28
Aug 18 2017 20:39
@SkyC0der cheers
Eric Hasegawa
@EricHasegawa
Aug 18 2017 20:44
@SkyC0der When I move it out of that function nothing changes
Gulsvi
@gulsvi
Aug 18 2017 20:45
@EricHasegawa Check again, really closely. That function can't be inside another function.
juni
@junipberry
Aug 18 2017 20:45
hey sky! Happy Friday :D
ty for getting back to me~~
I saw your msg, and yes that is the correct output I want
but not sure why I’m not passing :/
it says, “it should create a full name property” but isnt the function already doing that?
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:00
@SkyC0der Thanks, I can target it now and I'll remember that for next time, however now my celsius to fahrenheit code doesn't work, do you have any idea why?
CamperBot
@camperbot
Aug 18 2017 21:00
erichasegawa sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2446 | @skyc0der |http://www.freecodecamp.com/skyc0der
Liam Docherty
@ldocherty1
Aug 18 2017 21:05

Hi,

What does this mean? I'm aware this a class name .section-heading. However, I wasn't sure about what this means section h2

section h2.section-heading {
}
What does it mean when I see multiple font names listed like this
font-family: 'Droid Serif', 'Helvetica Neue', Helvetica, Arial, sans-serif
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:07
@ldocherty1 To answer your second question, the other font names after the first are fallback fonts, in case the browser doesn't recognize the first font.]
iso
@iso1048
Aug 18 2017 21:09
@ldocherty1 section h2 targets all h2 elements which are inside section elements.
Liam Docherty
@ldocherty1
Aug 18 2017 21:14
@EricHasegawa @gothamknight Thanks guys
CamperBot
@camperbot
Aug 18 2017 21:14
ldocherty1 sends brownie points to @erichasegawa and @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 380 | @gothamknight |http://www.freecodecamp.com/gothamknight
:cookie: 267 | @erichasegawa |http://www.freecodecamp.com/erichasegawa
Gulsvi
@gulsvi
Aug 18 2017 21:24
@junipberry If it wants you create a full name property in that object, it would look like:
function addFullNameProperty(obj) {
  obj.fullName = obj.firstName + " " + obj.lastName;
  return obj;
}

var obj = {
  firstName: "junip",
  lastName: "berry"
};

addFullNameProperty(obj); // returns {firstName: "junip", fullName: "junip berry", lastName: "berry"}
Gulsvi
@gulsvi
Aug 18 2017 21:29
@EricHasegawa The code in your click function isn't working because json.main.temp is not global - it's only available inside your getJSON function. One of the challenges is to figure out how to get the currently displayed temperature, figure out if it's fahrenheit or celsius, and then switch it :)
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:31
@SkyC0der I figured out that it was a scope issue, but I can't figure out how to find out the currently displayed temperature. I'd go $("#temperature").html . . . but then what?
Gulsvi
@gulsvi
Aug 18 2017 21:31
@ldocherty1 section h2.section-heading means to choose all h2 elements with class="section-heading" that are inside a <section> element.
<div class="myDiv section-heading active"></div>
^^ You could refer to that div in css as div.myDiv.section-heading.active (if you had a reason to do so)
@EricHasegawa There are lots of ways to go about it
global variables, custom data attributes, read the temperature from the page with .text(), etc...
Liam Docherty
@ldocherty1
Aug 18 2017 21:33
@SkyC0der Much appreciated :+1:
juni
@junipberry
Aug 18 2017 21:36
I see @SkyC0der , bc what I did was just define the value of full name but didnt assign it inside the obj..
ty @SkyC0der
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:38
@SkyC0der I'm still confused about it, I"m not suer how I would use them to find it
Adrian Turika
@therealcode
Aug 18 2017 21:38
Hey Guys, what's a good place to store all the useful API/Keys/Documentation to easily reference for coding?
Gulsvi
@gulsvi
Aug 18 2017 21:39
@junipberry It sounds like that's what the expectation was - add a full name property to the object, but I'm not sure.
juni
@junipberry
Aug 18 2017 21:39
yup, you’re right
ty sky
ty @SkyC0der
Liam Docherty
@ldocherty1
Aug 18 2017 21:40
@EricHasegawa Would you like me to link you an example that might help you understand?
juni
@junipberry
Aug 18 2017 21:40
where is that ty bot lol
Gulsvi
@gulsvi
Aug 18 2017 21:40
lol, don't worry about it @junipberry :)
Thanks @skyC0der !
CamperBot
@camperbot
Aug 18 2017 21:41
sorry skyc0der, you can't send brownie points to yourself! :sparkles: :sparkles:
Gulsvi
@gulsvi
Aug 18 2017 21:41
lol
juni
@junipberry
Aug 18 2017 21:41
what!
Gulsvi
@gulsvi
Aug 18 2017 21:41
@EricHasegawa Add this to your click function and look at your console: console.log($("#temperature").html())
juni
@junipberry
Aug 18 2017 21:41
:smile:
Gulsvi
@gulsvi
Aug 18 2017 21:41
cbot isn't listening to you @junipberry :p
CamperBot
@camperbot
Aug 18 2017 21:41
you called?
juni
@junipberry
Aug 18 2017 21:41
ty @SkyC0der
Liam Docherty
@ldocherty1
Aug 18 2017 21:42
lol
juni
@junipberry
Aug 18 2017 21:42
CamperBot… :(
Liam Docherty
@ldocherty1
Aug 18 2017 21:42
@junipberry Thanks!
CamperBot
@camperbot
Aug 18 2017 21:42
ldocherty1 sends brownie points to @junipberry :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @junipberry |http://www.freecodecamp.com/junipberry
juni
@junipberry
Aug 18 2017 21:43
thanks @SkyC0der
CamperBot
@camperbot
Aug 18 2017 21:43
junipberry sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2447 | @skyc0der |http://www.freecodecamp.com/skyc0der
juni
@junipberry
Aug 18 2017 21:43
ahh
there we go
Gulsvi
@gulsvi
Aug 18 2017 21:43
:clap: lol
juni
@junipberry
Aug 18 2017 21:43
guess ty stopped working
thanks @ldocherty1 lol
CamperBot
@camperbot
Aug 18 2017 21:44
:cookie: 152 | @ldocherty1 |http://www.freecodecamp.com/ldocherty1
junipberry sends brownie points to @ldocherty1 :sparkles: :thumbsup: :sparkles:
Liam Docherty
@ldocherty1
Aug 18 2017 21:47
@camperbot Hello
juni
@junipberry
Aug 18 2017 21:47
cbot
CamperBot
@camperbot
Aug 18 2017 21:47
you called?
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:47
@SkyC0der I added it, and I understand that idea, it's just trying to extrapolate the temperature out of that line that I don't know how to do
jdelori
@jdelori
Aug 18 2017 21:47
anyone able to help me with a bootstrap nav issue?
I've created a collapsible nav but can't get it to open once collapsed
Gulsvi
@gulsvi
Aug 18 2017 21:49
@EricHasegawa It looks like it has been a couple months since you did the JavaScript algorithms. You may want to do those again - especially the ones focusing on string manipulation. Figure out how to find a number in a string - or perhaps how to write your HTML differently so that it's easier to get the value you want. There are dozens of different ways to do it :)
You could also just .hide() and .show() the celsius / fahrenheit if you want to write it all to the page at once
Eric Hasegawa
@EricHasegawa
Aug 18 2017 21:50
@SkyC0der Yeah it's been a while, I'll go back
Gulsvi
@gulsvi
Aug 18 2017 21:52
@jdelori In your CodePen settings, click "JavaScript" and add Bootstrap's JavaScript library to get your mobile menu working:
https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js
Be sure to remove this from your CSS, or the mobile menu will overflow:
.navbar {
  height: 70px;
}
jdelori
@jdelori
Aug 18 2017 21:54
Thanks @SkyC0der I was looking for that but the bootsrap sites instructions aren't clear to me. Anyway. It still isn't working but I have to go offline so I'll check in a few when I get home.
CamperBot
@camperbot
Aug 18 2017 21:54
jdelori sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2448 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 21:55
@jdelori You didn't add the correct version of bootstrap - use the link I gave you above
jdelori
@jdelori
Aug 18 2017 22:14
@SkyC0der Thanks. I fixed that.
CamperBot
@camperbot
Aug 18 2017 22:14
jdelori sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:warning: jdelori already gave skyc0der points
jdelori
@jdelori
Aug 18 2017 22:18
Only now, when toggled close, the menu items appear anyway.
Frank
@Frankbono
Aug 18 2017 22:22
I can’t see why my search input field won’t get centered. I am using bootstrap 4. I have gone online, tried many things and nothing I try works. I know it’s probably a dumb thing I’m overlooking but I can’t figure out what I am doing. Can someone take a look at my code and see
iso
@iso1048
Aug 18 2017 22:28
@Frankbono not sure why the offset is not working. I can suggest another approach: remove the div with the class col-md-6 then add the class text-center to the div with the class container. then you could just target the input element in css to change its width...
Jan Shah
@JanShah
Aug 18 2017 22:28
@Frankbono wrap the div in a full width div (col-md-12 etc)
Jan Shah
@JanShah
Aug 18 2017 22:37
<div class="row">
  <div class="col-sm-2">
  </div>
  <div class="col">
    <input class="form-control" id="searchTerm"></input>
  </div>
  <div class="col-sm-2">
  </div> 
</div>
this also works
Gulsvi
@gulsvi
Aug 18 2017 22:37
@jdelori To fix the menu appearing automatically, remove this line of code from your JavaScript:
$('.collapse').collapse()
^^ That toggles the collapse behavior
Frank
@Frankbono
Aug 18 2017 22:39
@JanShah Thanks Jan! This worked
CamperBot
@camperbot
Aug 18 2017 22:39
frankbono sends brownie points to @janshah :sparkles: :thumbsup: :sparkles:
:cookie: 483 | @janshah |http://www.freecodecamp.com/janshah
Gulsvi
@gulsvi
Aug 18 2017 22:40
@Frankbono The bootstrap 4 beta no longer uses offsets. Use margins to adjust:
    <div class="col-md-8 mx-auto">
      <input class="form-control" id="searchTerm"></input>
    </div>
mx-auto = margin left/right = auto
Never a need to use empty divs to center your content in bootstrap
Frank
@Frankbono
Aug 18 2017 22:44
@SkyC0der I’ll definitely remember it from now on. Thanks again
CamperBot
@camperbot
Aug 18 2017 22:44
frankbono sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2449 | @skyc0der |http://www.freecodecamp.com/skyc0der
aRtoo
@artoodeeto
Aug 18 2017 22:46

guys. what is this shift doing here??

function dropElements(arr, func) {
  // drop them elements.
  var times = arr.length;
  for (var i = 0; i < times; i++) {
    if (func(arr[0])) {
      //console.log(arr);
      break;
    } else {
      arr.shift();
    }
  }
  return arr;
}
dropElements([0, 1, 0, 1], function(n) {return n === 1;}); //should return [1, 0, 1].

if the loop takes the zero index which is 0 its goes to shift then goes back to the loop then what is the shift doing when arr.shift will be the same?

iso
@iso1048
Aug 18 2017 22:49
@SkyC0der what do you reckon is the best way to 'toggle' (NOT meaning show/hide) an .animation() (jQuery)?
Gulsvi
@gulsvi
Aug 18 2017 22:52
@gothamknight Can you give an example?
@artoodeeto In that loop, it checks the first element of arr (arr[0]) and if it doesn't pas the test, it gets removed.
Loop keeps going, checking the first element and removing it if it doesn't pass the test
var arr = ["a", "r", "t", "o", "o", "d", "e", "e", "t", "o"];
var iterations = arr.length;
var answer = "";

for(var i = 0; i < iterations; i++) {
  answer += arr[0];
  arr.shift();
}

console.log(answer); // "artoodeeto"
Janelle deMent
@janelledement
Aug 18 2017 23:05
Hey again, I'm still working on the weather app. I have a function called getLocalWeather that makes a get request from the FCC weather API. I want to get three pieces of information from the api, but I'm only getting one of them. Can anyone tell me why that is? https://codepen.io/janelledement/pen/KvdOVg?editors=1010
Coy Sanders
@coymeetsworld
Aug 18 2017 23:09
your getCity call is commented out @janelledement
Janelle deMent
@janelledement
Aug 18 2017 23:10
@coymeetsworld I have it that way now just to focus on the FCC api not the google api.
Gulsvi
@gulsvi
Aug 18 2017 23:11
@janelledement your closing </span> elements are missing the final greater than sign at the end: </span</h3>
Coy Sanders
@coymeetsworld
Aug 18 2017 23:11
your closing span tags have issues too
:point_up:
Janelle deMent
@janelledement
Aug 18 2017 23:12
@coymeetsworld @SkyC0der Thanks guys!
CamperBot
@camperbot
Aug 18 2017 23:12
janelledement sends brownie points to @coymeetsworld and @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2450 | @skyc0der |http://www.freecodecamp.com/skyc0der
:star2: 2993 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Aug 18 2017 23:13
yw
jdelori
@jdelori
Aug 18 2017 23:14
@SkyC0der That stopped the behavior but the menu still won't open?
iso
@iso1048
Aug 18 2017 23:14

@SkyC0der

$('.ion-navicon').on('click', function(){
  //$('#nav-text-div').toggle('slide');
    $('#nav-text-div').animate({
    width: 200,
  },500);
  $('#nav-text-div .nav-link').show();

});

that is what i currently have to extend a navbar. By clicking on the same button, I want the inverse animation to occur to restore the default css.

@SkyC0der as you can see, I started off using toggle but I am trying to avoid changing the opacity as the navbar extends and retracts
Gulsvi
@gulsvi
Aug 18 2017 23:17

@jdelori Weird, it was working earlier. Your data-target value for your menu button needs to reference the ID of your links, so, change this:

<div class="collapse navbar-collapse" id="navbarNav">

to:

 <div class="collapse navbar-collapse" id="navbarNavDropdown">

And change this CSS:

.navbar {
  height: 70px;
}

to:

.navbar-brand {
  height: 70px;
}
jdelori
@jdelori
Aug 18 2017 23:20
@SkyC0der Its working now. Thanks!
CamperBot
@camperbot
Aug 18 2017 23:20
jdelori sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2451 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 18 2017 23:23
@gothamknight One way might be to use a class - if the navbar has the class "expanded", remove the class and do the inverse, else, add the class "expanded" and animate it's width to 200px
iso
@iso1048
Aug 18 2017 23:30
@SkyC0der ok cool, I'll give it a go in a while. Thanks
CamperBot
@camperbot
Aug 18 2017 23:30
gothamknight sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2452 | @skyc0der |http://www.freecodecamp.com/skyc0der
hermeticlock
@hermeticlock
Aug 18 2017 23:49

I think I've got a pretty simple CSS issue, but I can't seem to figure it out myself.

I'm trying to get my text "Hello World!/> to be in the center of my orange container. The orange container is a seperate div within a div, and inside the orange container div is my h1 tag. I'm trying to vertically align the text to be right in the center.

Here's the URL: http://codingforkids.us/newcodingforkids/

Eric Hasegawa
@EricHasegawa
Aug 18 2017 23:55
@hermeticlock Have you tried using margin-top and margin-bottom to centre it?
hermeticlock
@hermeticlock
Aug 18 2017 23:56

Yes. I think I experimented using padding...

Margin targets from outside of it right? Or do I have it backwords @EricHasegawa

iso
@iso1048
Aug 18 2017 23:56
@hermeticlock does adding display:flex; align-items:center to <div class="container container-fluid headbox"> that div work?
hermeticlock
@hermeticlock
Aug 18 2017 23:56
And then, I'd want to use % instead of px, correct?
Let me try that. I used that to align the orange container. It would make sense that that would work for that as well.
Doesn't seem to affect it.
Unless I'm targetting it wrong with my CSS.
.main h1 {
color: ;
display:flex; align-items:center;
text-align: center;
Going to try putting it in .headbox instead of h1 and see if that works.
iso
@iso1048
Aug 18 2017 23:59
@hermeticlock do you have the website on codepen?