These are chat archives for FreeCodeCamp/HelpFrontEnd

4th
Nov 2017
Ivan Ngundela
@ingundela
Nov 04 2017 06:55
hello everyone, please help with my Portfolio website project... I'm using bootstrap for the navigation menu right and added spyscroll, I don't want to use the default color.. The active is like bold white and spyscroll or when a hover the menu item is also bold white, here is my code and I wanted to target so that I change the color scroll down the page: <body data-spy="scroll" data-target=".navbar" data-offset="50">
<header id="mu-header">
<nav class="navbar fixed-top navbar-expand-lg navbar-dark style=" background-color:#000>
<div class="container">
<a class="navbar-brand h1 mb-0" href="index.html"><i class="fa fa-circle" aria-hidden="true"></i>INgundela</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About Me</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#portfolio">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
Barney
@sovietspy2
Nov 04 2017 08:32
Hi everyone! Is there an easy way to start a react redux porject like create-react-app but with redux ?
Andrey Azimov
@AndreyAzimov
Nov 04 2017 09:25
Hi guys, I've made a template to track freeCodeCamp progress on your site and it's updating automatically from Google Sheet: andreyazimov.com/freecodecamp
Maybe someone want to have same
kutagullasukumar
@kutagullasukumar
Nov 04 2017 09:31
image.png

```function palindrome(str) {
str.replace("_","").replace(" ","").replace(",","").toLowerCase();
str = str.split("").reverse().join('');
if(str !== str){
return false;
}
return true;
}

palindrome("eye");```

abraham anak agung
@padunk
Nov 04 2017 09:32
@AndreyAzimov how does it work?
abraham anak agung
@padunk
Nov 04 2017 09:37
@kutagullasukumar you compare the same variable str and str
kutagullasukumar
@kutagullasukumar
Nov 04 2017 09:37

```function palindrome(str) {
str.replace("_","").replace(" ","").replace(",","").toLowerCase();
str1 = str.split("").reverse().join('');
if(str1 == str){
return false;
}
return true;
}

palindrome("eye");```

abraham anak agung
@padunk
Nov 04 2017 09:40
function palindrome(str) {
  str.replace("_","").replace(" ","").replace(",","").toLowerCase(); //str will not replace if you are not assign it
  str1 = str.split("").reverse().join('');
  if(str1 == str){
    return false;
  }
  return true;
}



palindrome("eye");
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Nov 04 2017 10:08
Hello
alpox
@alpox
Nov 04 2017 10:58
@kutagullasukumar now you return false when its a palindrome.
Tiago Correia
@tiagocorreiaalmeida
Nov 04 2017 11:09
:wave:
Max Voronov
@maxv
Nov 04 2017 11:56
@padunk Hi! you can try and user regex instead of using multiple replace calls:
str.replace(/_|,| /g, '');
abraham anak agung
@padunk
Nov 04 2017 12:02
Hi @maxv i think u mean to address @kutagullasukumar
Max Voronov
@maxv
Nov 04 2017 12:02
Yes , sorry
Roge
@RogeMateos
Nov 04 2017 12:47
Screen Shot 2017-11-04 at 13.46.10.png
Screen Shot 2017-11-04 at 13.46.10.png
Screen Shot 2017-11-04 at 13.46.10.png
Hello i need some help with node i have installed but i cant see the version on my mac
Max Voronov
@maxv
Nov 04 2017 12:59
try: node -v
@RogeMateos
Roge
@RogeMateos
Nov 04 2017 13:00
that is whati did
you can see it there
Max Voronov
@maxv
Nov 04 2017 13:00
you forgot the "-"
Roge
@RogeMateos
Nov 04 2017 13:00
oh sorry
yes
Arseny
@arsenykonohovwork
Nov 04 2017 13:01
Hi there! Did anyone deal with SIP.js?
I need a help with this one
https://sipjs.com/api/0.7.0/mediaHandler/
I can't produce it for handling some events;
Max Voronov
@maxv
Nov 04 2017 13:01
@RogeMateos does it works now?
Roge
@RogeMateos
Nov 04 2017 13:01
yes , many thanks , give me a sec as i have another question you might help me if you have a minute please
Max Voronov
@maxv
Nov 04 2017 13:02
@RogeMateos yes, no prolem
no problem *
Roge
@RogeMateos
Nov 04 2017 13:04
i am installing this packet npm install -g bower gulp sass
and getting this error
Screen Shot 2017-11-04 at 14.04.14.png
Ashwin
@ashwins93
Nov 04 2017 13:06
@RogeMateos you need to be sudo to -g
Max Voronov
@maxv
Nov 04 2017 13:06
try writing sudo before everything else:
sudo npm install -g bower gulp sass
Yeah, what @ashwins93 said
Roge
@RogeMateos
Nov 04 2017 13:07
Screen Shot 2017-11-04 at 14.07.34.png
i thinki it worked
now
Max Voronov
@maxv
Nov 04 2017 13:08
@RogeMateos looks ok
Roge
@RogeMateos
Nov 04 2017 13:10
many thanks
Max Voronov
@maxv
Nov 04 2017 13:11
My pleasure :+1:
Roge
@RogeMateos
Nov 04 2017 13:11
and i have another one do you the shell zsh instead bash
i have changed in administrator zsh instead bash
and add a new theme for console
i installed
$ cd ~
$ curl -L http://install.ohmyz.sh | sh
Max Voronov
@maxv
Nov 04 2017 13:12
Sorry I just use the default terminal
Roge
@RogeMateos
Nov 04 2017 13:12
ok
no problem, thanks for your help anyway
Max Voronov
@maxv
Nov 04 2017 13:13
:+1: :+1:
Ashwin
@ashwins93
Nov 04 2017 13:30
@RogeMateos is that to make your terminal colorful?
Max Voronov
@maxv
Nov 04 2017 13:34
yeah
Milk.Brother
@MBWu
Nov 04 2017 15:46
does anyone know how to turn to other screen by bottom level navigator when i use react-navigation and redux
i can only turn to the top level screen from bottom level screen

let initialState = TopLevelNavigator.router.getStateForAction(

TopLevelNavigator.router.getActionForPathAndParams( 'Home' )

);

const navReducer = ( state = initialState, action ) => {

let nextState;

switch( action.type ){

    default:
        nextState = TopLevelNavigator.router.getStateForAction(

            action,
            state

        )
}

return nextState || state;

}

these are my navReducer code
kutagullasukumar
@kutagullasukumar
Nov 04 2017 16:16
function largestOfFour(arr) {

  var largest = 0;
  var num;

  for(var i =0; i< arr.length; i++){
    for(var j = 0; j <arr[i].length; j++){

         if(largest < arr[i][j]){
           largest = arr[i][j].length;
           num = arr[i][j];
         }
       }

  }
   return num;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Stephen James
@sjames1958gm
Nov 04 2017 16:46
@kutagullasukumar arr[i][j] is a number and has no length - you should be storing arr[i][j] in largest.
Also you are not creating an array of largest one from each inner array
kutagullasukumar
@kutagullasukumar
Nov 04 2017 16:46

function largestOfFour(arr) {

  var largest = 0;
  var newArray;

  for(var i =0; i< arr.length; i++){
    for(var j = 0; j <arr[i].length; j++){
          if(arr[i][j] > arr[i][j]){
            newArray = arr[i][j];
          }         
       }

  }
   return newArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
i changed the code please have a look
still somewhere wrong
if(arr[i][j] > arr[i][j]){
            newArray = arr[i][j];
          }
it is wrong but how to compare two numbers while iteration
Stephen James
@sjames1958gm
Nov 04 2017 16:48
@kutagullasukumar 1. You need to keep track of the largest in each array
Then after the inner loop is done, you need to add the largest to newArray (maybe use .push)
arr[i][j] > arr[i][j] you are comparing a number to itself
kutagullasukumar
@kutagullasukumar
Nov 04 2017 16:49
yea i did wrong i know
Stephen James
@sjames1958gm
Nov 04 2017 16:50
Your use of largest from before was closer. But you don't know which is largest until after you for j=0 loop is done
kutagullasukumar
@kutagullasukumar
Nov 04 2017 16:51
ok
kutagullasukumar
@kutagullasukumar
Nov 04 2017 17:04
@sjames1958gm Hi
function largestOfFour(arr) {

  var largest = 0;
  var newArray = [];
  var num;
  for(var i =0; i< arr.length; i++){
    for(var j = 1; j <arr[i].length; j++){
          if(largest < arr[i][j]){
            largest = arr[i][j];
            newArray.push(largest);
          } 

        }

  }
   return newArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
i believe i am almost close but getting two elements from 2nd sub-arat
*arrat
Stephen James
@sjames1958gm
Nov 04 2017 17:05
Why start j at 1 - also, how can you know which number is largest before you finish the inner loop?
kutagullasukumar
@kutagullasukumar
Nov 04 2017 17:05
@sjames1958gm got it bro
still error showing

function largestOfFour(arr) {

  var largest = 0;
  var newArray = [];
  for(var i =0; i< arr.length; i++){
    for(var j = 1; j <arr[i].length; j++){
          if(largest < arr[i][j]){
            largest = arr[i][j];

          } 

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

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
image.png
sorry change j=0
but still showing error
as below
image.png
Stephen James
@sjames1958gm
Nov 04 2017 17:09
Perhaps largest needs to be reset after storing in the array
kutagullasukumar
@kutagullasukumar
Nov 04 2017 17:10

function largestOfFour(arr) {

  var largest = 0;
  var newArray = [];
  for(var i =0; i< arr.length; i++){
    for(var j = 0; j <arr[i].length; j++){
          if(largest < arr[i][j]){
            largest = arr[i][j];

          } 

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

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
i extracted all largest numbers from sub-arrays but still showing error
korzo
@korzo
Nov 04 2017 17:18
@kutagullasukumar you have to reset largest after end of the for loop
kutagullasukumar
@kutagullasukumar
Nov 04 2017 17:19
reset means
Stephen James
@sjames1958gm
Nov 04 2017 18:30
@kutagullasukumar set largest back to zero
krckyboy
@krckyboy
Nov 04 2017 18:49
I'm in a dilemma. I need to get into back-end and I don't know whether I should go into PHP and also MySQL, or JS and.. MySQL or whatever. All I know is that I need to learn to deal with databases and design one. So what should I do? I was gonna just learn JS and stick to it, but now that I realized that I actually need to get really good at MySQL, shouldn't I just start learning PHP and stick to it since it's usually used to connect to a database?
alpox
@alpox
Nov 04 2017 18:50
@krckyboy You could at first try to get a grasp of Mongodb which may be a little bit easier to understand/grasp for you at first. Its a different database model though. Things get stored differently and you query them differently
Ghost
@ghost~57b1df1e40f3a6eec05f92a8
Nov 04 2017 18:50
@kutagullasukumar A sidenote: I wouldn't set largest = 0 because if the array only contains negative numbers it would return zero which isn't even given in the array
Tomasz
@Tgralak
Nov 04 2017 19:18
Hello, I have a problem with my counter to pomodoro clock project. It displays 01:00 instead of 2:00 and then it's going like 1:00 ->> 1:59 ->> 1:58... How can I solve this?
Here is my codepen: https://codepen.io/Tgralak/pen/BmjgjW
mbpiner
@mbpiner
Nov 04 2017 19:26
hi all, what is the responsive reorder class format for newest version of bootstrap(4.0-beta.2) ? I'm looking at the official docs and you can't really tell.
They don't mention how to do it responsively wth xs s m l xl
only thing I can get to work is order-first but that's not responsive, i've tried adding window size everywhere on it and cant get it to work. I guess I may have to go digging around the code.
Tom
@moT01
Nov 04 2017 19:30
@Tgralak that's a very elegant looking solution
i pulled the sec-- out and it seems to work
  $("#sec").html(display(sec%60))
  $("#min").html(display(parseInt(sec/60)))
    sec--;
Christopher Susi
@chrisandsuch
Nov 04 2017 19:30
@mbpiner have you tried fluid?
Tom
@moT01
Nov 04 2017 19:30
and the 10, not sure what that was for
@mbpiner glad to see im not the only one who struggles with the bootstrap docs
im not a fan
mbpiner
@mbpiner
Nov 04 2017 19:36
@moT01 "Use .order- classes for controlling the visual order of your content. These classes are responsive, so you can set the order by breakpoint (e.g., .order-1.order-md-2). Includes support for 1 through 12 across all five grid tiers."
does that mean use it as order-1-order-md-2 or order-md-2?
@chrisandsuch Yea I tried making my container and row fluid
Tom
@moT01
Nov 04 2017 19:40
im not sure what you're asking there
Tomasz
@Tgralak
Nov 04 2017 19:40
@moT01 thank You very much! I need to look deeper why my function was working that way
CamperBot
@camperbot
Nov 04 2017 19:40
tgralak sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 895 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 04 2017 19:40
i think you can just put a single class on something
.order-md-2 will make it order 2 on md screens
.order-1 will make is order 1 throughout
i have no idea, but thats my best guess
Christopher Susi
@chrisandsuch
Nov 04 2017 19:41
Hey all what is command for Mac terminal to create a new directory?
Tom
@moT01
Nov 04 2017 19:41
mkdir
Christopher Susi
@chrisandsuch
Nov 04 2017 19:42
@moT01 thank you!
CamperBot
@camperbot
Nov 04 2017 19:42
chrisandsuch sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 896 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Nov 04 2017 19:43
@mbpiner so what's the order and number for, is it like a newer offset i wonder?
Christopher Susi
@chrisandsuch
Nov 04 2017 19:44
What is command in Mac terminal to delete a directory and its sub files all at once?
Tom
@moT01
Nov 04 2017 19:46
rmdir -R i think
no, just rm -R
careful with it
Ashwin
@ashwins93
Nov 04 2017 19:47
@chrisandsuch rm -rf i believe
Christopher Susi
@chrisandsuch
Nov 04 2017 19:49
Looks like rm -R [directory] worked. Thanks everyone @ashwins93 @moT01
CamperBot
@camperbot
Nov 04 2017 19:49
chrisandsuch sends brownie points to @ashwins93 and @mot01 :sparkles: :thumbsup: :sparkles:
api offline
:cookie: 413 | @ashwins93 |http://www.freecodecamp.com/ashwins93
Christopher Susi
@chrisandsuch
Nov 04 2017 20:44
Do you all prefer Atom over Visual Code?
Is homebrew safe to use on macOS?
Tiago Correia
@tiagocorreiaalmeida
Nov 04 2017 20:59
I do prefer vs
Ashwin
@ashwins93
Nov 04 2017 20:59
i prefer vsc
its like a light weight ide very sleak
alpox
@alpox
Nov 04 2017 21:10
@chrisandsuch VSCode ofc :D
@chrisandsuch homebrew is safe, yes. Its the most used package manager on osx
I hate it though. its terribly slow
Christopher Susi
@chrisandsuch
Nov 04 2017 21:29
Thank you! @alpox
CamperBot
@camperbot
Nov 04 2017 21:29
chrisandsuch sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1434 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
Nov 04 2017 21:36
@chrisandsuch np
DMsalati
@DMsalati
Nov 04 2017 22:02
hey guys i need help with my buttons please
the three social medial links at the very bottom arent working for some reason and i dont know why
could someone pleae help?
Tiago Correia
@tiagocorreiaalmeida
Nov 04 2017 22:04
I think you wanna change them by links and not buttons
in this case <a> tag
with href to where you need it to go
DMsalati
@DMsalati
Nov 04 2017 22:05
but then it would just show the links
i want them to be in buttons
like this basically
Tiago Correia
@tiagocorreiaalmeida
Nov 04 2017 22:11
those "buttons" are an a tag
a tags are used for links and that's what you need here mate
<a href="websitetogo" class="yourclassname">facebookicon</a>
a tags dont have padding or others cause they are inline elements to change that on css give them display inline-block or block as you need
DMsalati
@DMsalati
Nov 04 2017 22:13
oh ok
thank you so much i will try it
@tiagocorreiaalmeida thank you
CamperBot
@camperbot
Nov 04 2017 22:13
dmsalati sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 425 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 04 2017 22:15
anytime gl with it
DMsalati
@DMsalati
Nov 04 2017 22:15
thanks