These are chat archives for FreeCodeCamp/Help

25th
Mar 2018
Moisés Man
@moigithub
Mar 25 2018 02:05
0..n numbers at the end [0-9]*$ i think
start with alphabet ^[a-z]{2} 2 chars at least
ignore case i flag
Kyle Holm
@thekholm80
Mar 25 2018 02:13
i think the {2} means 'exactly 2'
{2,} would be 2 or more
zhaofeilon
@zhaofeilon
Mar 25 2018 02:45
像我这样英语不及格的人,都看不懂你们说什么
Ken Haduch
@khaduch
Mar 25 2018 02:47
@texas2010 - it's pretty straightforward to solve that one. Did you get it? The tough part is wrapping your head around regular expressions.
Lance
@texas2010
Mar 25 2018 02:48
@khaduch not really. but somehow i did passed it. regex is very new to me. so i will study more on it.
Kyle Holm
@thekholm80
Mar 25 2018 02:50
i used /[a-z]{2,}/i and it passed, i think maybe they need better tests
Ken Haduch
@khaduch
Mar 25 2018 02:50
@texas2010 - the http://regexr.com site it excellent for experimenting with the regular expressions - you can plug in all of the test strings that they test, and your expression, and it will explain the matches.
@thekholm80 - that passed? wow...
Kyle Holm
@thekholm80
Mar 25 2018 02:50
yeah
Lance
@texas2010
Mar 25 2018 02:51
@moigithub @thekholm80 yeah. i did that too. i saw that about {} at https://regex101.com/
Ken Haduch
@khaduch
Mar 25 2018 02:51
@thekholm80 - you're right! You should file a bug on that...
Kyle Holm
@thekholm80
Mar 25 2018 02:51
but ... but ... that requires effort
Ken Haduch
@khaduch
Mar 25 2018 02:52
yeah... never mind! ;)
Kyle Holm
@thekholm80
Mar 25 2018 02:52
lol
Ken Haduch
@khaduch
Mar 25 2018 02:52
:D
Kyle Holm
@thekholm80
Mar 25 2018 02:52
lance will do it!
i volunteer him
Lance
@texas2010
Mar 25 2018 02:52
i used /^[a-z]{2}/i . so i passed it.
not me. i think someone plan to talk me but idk! so i cant apply issue about that right now. :P
Kyle Holm
@thekholm80
Mar 25 2018 02:53
lol
that just leaves Ken
you're a good man, @khaduch thanks for taking one for the team
CamperBot
@camperbot
Mar 25 2018 02:54
thekholm80 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3816 | @khaduch |http://www.freecodecamp.org/khaduch
Lance
@texas2010
Mar 25 2018 02:54
but thanks people. more like you are right about it need to have more tests
@thekholm80 @khaduch @moigithub thanks for help.
CamperBot
@camperbot
Mar 25 2018 02:54
texas2010 sends brownie points to @thekholm80 and @khaduch and @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1745 | @thekholm80 |http://www.freecodecamp.org/thekholm80
:star2: 3733 | @moigithub |http://www.freecodecamp.org/moigithub
:star2: 3817 | @khaduch |http://www.freecodecamp.org/khaduch
Phoebe
@pl98
Mar 25 2018 02:54
Does anyone know why I have this weird space on the right side of my page? I don't want there to be a horizontal scroll.
Ken Haduch
@khaduch
Mar 25 2018 02:55
@thekholm80 - no, actually that's almost okay. There don't have to be any numbers, so it wouldn't matter for that case. and if you aren't checking for numbers, it won't match the ones that are only numbers. So, yeah, it needs some better tests... :(
Lance
@texas2010
Mar 25 2018 02:55
yeah. i am not sure if there need to test for num in the end.
Ken Haduch
@khaduch
Mar 25 2018 02:55
do you actually have to be doing the beta site exercises to file a bug? I don't see a link there? Maybe the forum is the place to go.
Kyle Holm
@thekholm80
Mar 25 2018 02:55
mine will match with numbers in the middle
Lance
@texas2010
Mar 25 2018 02:56
@khaduch not really, i just want to learn more. do challenges. i just trying to get keep busy.
and i need to practice on es6 more. i ddint realized i am still rookie on es6. :joy:
Ken Haduch
@khaduch
Mar 25 2018 02:57
@pl98 - are you using a container class div? Do you have a link for your page?
Kyle Holm
@thekholm80
Mar 25 2018 02:58
then you can learn es7
Lance
@texas2010
Mar 25 2018 02:58
@thekholm80 sure, i will do.
Kyle Holm
@thekholm80
Mar 25 2018 02:59
there are a lot of features i couldn't live without
Phoebe
@pl98
Mar 25 2018 02:59
@khaduch I actually figured it out haha. I think there were some issues with the div containing my background image being too wide so I set the width to 100% and it solved the issue. Thanks!
CamperBot
@camperbot
Mar 25 2018 02:59
pl98 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3818 | @khaduch |http://www.freecodecamp.org/khaduch
LydaTech
@lydatech
Mar 25 2018 02:59
@pl98 whats the site?
Phoebe
@pl98
Mar 25 2018 03:55
@lydatech It's okay I fixed it!
Though I have another problem now... I had my navbar change colors after scrolling past a certain point, but once I implemented a collapsed navbar with a smaller screen size, the color change function is now broken.
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:02
@pl98 , you have fantastic portfolio page. Let's fix the scrollbar color changing effect :smile:
Phoebe
@pl98
Mar 25 2018 04:03
@arsho Thanks!! Any help would be much appreciated. I've been pulling my hair on this for the last hour 😅
CamperBot
@camperbot
Mar 25 2018 04:03
pl98 sends brownie points to @arsho :sparkles: :thumbsup: :sparkles:
:cookie: 486 | @arsho |http://www.freecodecamp.org/arsho
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:04
let me see what I can do. I came here after a long break. :smile:
first point: if(scroll_start > offset.top) is not executed ever.
Phoebe
@pl98
Mar 25 2018 04:11
wait so how was it working before?
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:13
add a console.log inside that if else and see if you can get any message in console.
Ken Haduch
@khaduch
Mar 25 2018 04:13
it seems that the .scroll() method is not triggering now. WHen you implemented the collapsed navbar, how many things did you have to change? @pl98
Phoebe
@pl98
Mar 25 2018 04:17
@khaduch I added code to the original scroll bar. The collapsed navbar classes and <span> tags for the menu items.
*orginal nav bar sorry
Ken Haduch
@khaduch
Mar 25 2018 04:18
so no change in the JS code? It seems that the scroll event is not triggering that handler anymore.
Phoebe
@pl98
Mar 25 2018 04:18
Yeah I didn't change anything in JS for the collapsed navbar.
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:23
its not even executing $(document).scroll(function()
Ken Haduch
@khaduch
Mar 25 2018 04:27
@arsho - I'm seeing the same thing - almost like something is overriding or removing the scroll method, @pl98 ?
Phoebe
@pl98
Mar 25 2018 04:28
I think that's probably what happened. But I'm a beginner and I'm not really sure what it could be... 😞
@lydatech Wait how did you get it to work?
LydaTech
@lydatech
Mar 25 2018 04:30
@pl98 removed your inline style and added a more specific selector to your css
Phoebe
@pl98
Mar 25 2018 04:31
@lydatech Which inline style?
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:31
@lydatech great work :clap:
Thank you @lydatech
CamperBot
@camperbot
Mar 25 2018 04:31
arsho sends brownie points to @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2743 | @lydatech |http://www.freecodecamp.org/lydatech
Ahmedur Rahman Shovon
@arsho
Mar 25 2018 04:31
Now I can have my breakfast! :smile:
LydaTech
@lydatech
Mar 25 2018 04:32
@pl98
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-c" aria-expanded="false" aria-controls="navbar" style="border-color:white;">
style="border-color:white;"
@pl98 and i added
.navbar-header button.navbar-toggle {
  border: 1px solid red;
  background-color: blue;
}
Phoebe
@pl98
Mar 25 2018 04:36
It's still not working on mine for some reason 😞
LydaTech
@lydatech
Mar 25 2018 04:48
@pl98 what part isnt working?
Phoebe
@pl98
Mar 25 2018 04:49
the changing colors
I made the changes to my code that you did but it's still not triggering.
LydaTech
@lydatech
Mar 25 2018 04:53
@pl98 i put that css on the bottom of your styles it works. I am only working on changing the hamburger menu button not the whole bar. May be we are talking different things
Phoebe
@pl98
Mar 25 2018 04:54
No I'm talking about the navbar color change as you scroll down the page.
Ken Haduch
@khaduch
Mar 25 2018 04:54
@pl98 - if I replace @lydatech 's CSS into your current project, then it works. You should carefull check for differences between what you have an what he has.
Phoebe
@pl98
Mar 25 2018 04:55
Which CSS are you talking about? I'm confused because I don't want the hamburger menu button color to change, just the scroll function.
Ken Haduch
@khaduch
Mar 25 2018 04:58
@pl98 - I copied the entire custom CSS from @lydatech 's version of your project and replaced it into yours, and the coloring of the navbar changes when you scroll...
Phoebe
@pl98
Mar 25 2018 04:59
Ah I see. Maybe there's something in my CSS that interferes. I will check again.
Ken Haduch
@khaduch
Mar 25 2018 05:01

@pl98 - this section that he put into the CSS:

.navbar-header button.navbar-toggle {
  border: 1px solid red;
  background-color: blue;
}

is crucial to making it work. I haven't been checking the navbar collapse state, only the color change on scroll...
But obviously he would be able to help you alone, I have to get off the computer for the night! :)

Phoebe
@pl98
Mar 25 2018 05:02
@khaduch Thanks!
CamperBot
@camperbot
Mar 25 2018 05:02
pl98 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3819 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
Mar 25 2018 05:02
good luck getting it to work - these things are really frustrating at times!
@pl98 - just one last thing - in your html, body rule at the top of your CSS, I just commented out the overflow-x: hidden; property - and it allows the color change to work... I'm guessing that with that setting in place, it is thwarting the scroll handler?
maybe that will give you something additional to investigate... now, I'm outta here! GOod night... :)
Phoebe
@pl98
Mar 25 2018 05:07
@khaduch I put that in there originally to stop the page from scrolling horizontally, which is another thing I can't figure out how to fix. I fix one bug and two more pop up! Thanks for all your help :smile:
CamperBot
@camperbot
Mar 25 2018 05:07
pl98 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
api offline
LydaTech
@lydatech
Mar 25 2018 05:09
@pl98 yep the overflow-x: hidden; is the issue there with the navbar bg not changing
Phoebe
@pl98
Mar 25 2018 05:13
@lydatech is there another way I can stop the horizontal scroll?
LydaTech
@lydatech
Mar 25 2018 05:14
@pl98
<div class="row" style="padding:100px 0 0 0;">
            <div class="col-xs-12 center-block text-center">
              <a href="#about"><span id="scrollIcon" class="front-glyph glyphicon glyphicon-menu-down" aria-hidden="true"></span></a>
            </div>
          </div>
this is causing it. I havent looked at why yet
@pl98 just remove class="row" fixes it
Bashir Harrell
@bookofbash
Mar 25 2018 05:30
function comp(array1, array2){
  function squareRt(num){
    return Math.sqrt(num);
  }

var newArr2 =[]

for (var i = 0; i < array2.length; i ++){
  newArr2.push(squareRt(array2[i]));

}
 //compares the two arrays by sorting and joinging them 
if (newArr2.sort().join("") !== array1.sort().join("")){
  return false;  
  }
else{
  return true;
  }

}
I'm getting a Type error:
TypeError: Cannot read property 'length' of null
    at comp
        at /runner/frameworks/javascript/cw-2.js:159:11
    at Promise._execute
    at Promise._resolveFromExecutor
    at new Promise
    at Object.describe
            at Object.handleError
        at ContextifyScript.Script.runInThisContext
    at Object.runInThisContext
I cant figure out why.
Phoebe
@pl98
Mar 25 2018 05:33
@lydatech THANK YOU so much!!
CamperBot
@camperbot
Mar 25 2018 05:33
pl98 sends brownie points to @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2744 | @lydatech |http://www.freecodecamp.org/lydatech
LydaTech
@lydatech
Mar 25 2018 05:33
@pl98 glad i could help.
bed time g'night
Phoebe
@pl98
Mar 25 2018 05:39
g'night :-)
Anyone know how I can make a div into a link?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:42
@pl98 nest in <a>
Phoebe
@pl98
Mar 25 2018 05:44
It's not working for some reason. Basically I have an image that I overlayed a div onto, so when you hover over the image turns a certain color and is clickable.
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:45
@pl98 You wanted to make it clickable?
Phoebe
@pl98
Mar 25 2018 05:46
Yeah
So when I hover over it, it looks like this
image.png
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:47
image.png
This image?
Phoebe
@pl98
Mar 25 2018 05:47
yeah :-)
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:47
Oh snap
Phoebe
@pl98
Mar 25 2018 05:47
haha
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:47
You want to make it a link?
Phoebe
@pl98
Mar 25 2018 05:48
Yeah
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:54
@pl98 no luck so far, sorry
Phoebe
@pl98
Mar 25 2018 05:56
@MuhammedKarim it's okay! Would you be able to tell me how to move the arrow icon in my header down?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 05:57

@pl98 Found the issue.

<img src="http://i63.tinypic.com/2eeedzc.png" class="img-responsive img-link1" style="margin:100px auto; width:400px; height:auto;">

You missed out the " at the end

Phoebe
@pl98
Mar 25 2018 06:01
wait where?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:01
@pl98 On the image in question
@pl98 To move the arrow icon just change the padding to wherever you want it to be instead:
<div style="padding:100px 0 0 0;">
Phoebe
@pl98
Mar 25 2018 06:02
I'm confused sorry, where is there meant to be a "?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:03
@pl98 Where i have placed it, just before the closing > of the img
Phoebe
@pl98
Mar 25 2018 06:04
ohhhhh i thought that was a photo of my code haha
@MuhammedKarim thanks!
CamperBot
@camperbot
Mar 25 2018 06:04
pl98 sends brownie points to @muhammedkarim :sparkles: :thumbsup: :sparkles:
:cookie: 231 | @muhammedkarim |http://www.freecodecamp.org/muhammedkarim
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:04
@pl98 Both issues sorted?
Phoebe
@pl98
Mar 25 2018 06:04
ul.nav a:hover
sorry wrong thing
how do i move the arrow down if the padding is already zero at the bottom?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:05
@pl98 Padding creates space, so increasing the top padding would increase the space from the top
@pl98 I would suggest decreasing the top and bottom padding in your footer from 48px to 20px
Phoebe
@pl98
Mar 25 2018 06:19
@MuhammedKarim increasing the padding just increases the space at the top but the arrow doesn't get any closer to the bottom of the image
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:24
@pl98 add height: 100vh; to your bgimg-1 styles
Phoebe
@pl98
Mar 25 2018 06:39
@MuhammedKarim thanks! Do you know how to make the hover overlay trigger closer to the image on the sides? Right now it triggers on either side of the image.
CamperBot
@camperbot
Mar 25 2018 06:39
pl98 sends brownie points to @muhammedkarim :sparkles: :thumbsup: :sparkles:
api offline
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:42
@pl98 Change the width in your styles, if you change it to 400px, it will only trigger when the image itself is hovered over
.fig1 {
  position:relative;
  width:100%;
}
Phoebe
@pl98
Mar 25 2018 06:45
@MuhammedKarim Thanks! Sorry for bombarding you with questions!
CamperBot
@camperbot
Mar 25 2018 06:45
pl98 sends brownie points to @muhammedkarim :sparkles: :thumbsup: :sparkles:
api offline
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:47
@pl98 no problem, I'm new on the block myself so thanks for the opportunity :)
CamperBot
@camperbot
Mar 25 2018 06:47
muhammedkarim sends brownie points to @pl98 :sparkles: :thumbsup: :sparkles:
:cookie: 118 | @pl98 |http://www.freecodecamp.org/pl98
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 06:48
@pl98 Also, you're using bootstrap for your page, but it's not listed in your skills? And have you learnt jQuery but not JavaScript?
Phoebe
@pl98
Mar 25 2018 09:04
@MuhammedKarim I wasn't really sure whether to list Bootstrap haha. I don't really know JavaScript yet!
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:07
@pl98 Oh right, only list it if you think you know it well - I'm being hypocritical here :laughing:
Phoebe
@pl98
Mar 25 2018 09:10
@MuhammedKarim Haha it's okay 😛
@MuhammedKarim I have another question if that's okay. I'm constantly having trouble with alignment and spacing for some reason!
@MuhammedKarim In my portfolio section, how do I move the image closer to the words "my work"?
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:12
@pl98 oh no, I just switched off my PC I was just about to nap :(
Phoebe
@pl98
Mar 25 2018 09:13
@MuhammedKarim argh I'm sorry!
@MuhammedKarim Nevermind then I'll try to figure it out! 😆
lin
@lethitaa
Mar 25 2018 09:14
Let the font-size of the first paragraph and the second paragraph be 16px.
Please do not add the class attribute to the second paragraphs.
how to do
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:15
@pl98 No problem, just opened it on my phone anyways
Phoebe
@pl98
Mar 25 2018 09:16
@MuhammedKarim I actually figured it out already!
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:16
<img src="http://i63.tinypic.com/2eeedzc.png" class="img-responsive img-link1" style="margin:100px auto; width:400px; height:auto;">
Phoebe
@pl98
Mar 25 2018 09:16
@MuhammedKarim Yeah that's what I found haha. So sorry for the trouble!
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:17
@pl98 You can adjust the margin:100px to bring it closecloser to "my work"
*closer to
Phoebe
@pl98
Mar 25 2018 09:18
@MuhammedKarim Yeah I wasn't reading my code carefully enough 😅
@MuhammedKarim thanks!
CamperBot
@camperbot
Mar 25 2018 09:18
pl98 sends brownie points to @muhammedkarim :sparkles: :thumbsup: :sparkles:
:cookie: 232 | @muhammedkarim |http://www.freecodecamp.org/muhammedkarim
Ghost
@ghost~5a4a80acd73408ce4f859755
Mar 25 2018 09:19
@pl98 You're welcome :laughing: no worries
@lethitaa Please elaborate? Hopefully someone would be able to help
@pl98 sorry the messages didn't come through, just saw now that you said you've figured it out
Phoebe
@pl98
Mar 25 2018 09:21
@MuhammedKarim It's okay :-)
gishy1
@gishy1
Mar 25 2018 10:49
hello world !!
as regards the random quote assignment
how can i build an api that tweets out my quotes
my quotes are stored in an array
suggestions please!!
h1tag
@h1tag
Mar 25 2018 11:44
@gishy1 you don't have to build one, there are already made APIs available online
gishy1
@gishy1
Mar 25 2018 11:45
@h1tag so should i just use jquery to have it tweeted out?
h1tag
@h1tag
Mar 25 2018 11:46
@gishy1 yea
h1tag
@h1tag
Mar 25 2018 11:59
@gishy1 for the tweeting part, you'll have to use twitter for websites
Stephen James
@sjames1958gm
Mar 25 2018 14:45
@gishy1 Web intents are an easier way to simply issue a tweet
https://dev.twitter.com/web/intents
mustimuu
@mustimuu
Mar 25 2018 16:11

Hi guys & girls !

I am about to create a child-theme for my wordpress site.
I can't get the parent css transfered to my child theme.

Heres the code:
´´´

/
Theme Name: understrap Child
Theme URI: http://beproductive.dk/understrap-child/
Description: understrap Child Theme
Author: Musti
Author URI: http://bepductive.dk
Template: understrap
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: understrap-child
/

´´´

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'understrap-style'; // This is 'understrap-style' for the understrap theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
Apollo
@enigmacipher
Mar 25 2018 18:04
how can I line up textboxes horizontally like this : https://i.imgur.com/RWDbvfh.png ?
Stephen James
@sjames1958gm
Mar 25 2018 18:07
@enigmacipher I would consider flex box for this where you can align to flex-start
Apollo
@enigmacipher
Mar 25 2018 18:09
:+1: Thanks @sjames1958gm
CamperBot
@camperbot
Mar 25 2018 18:09
enigmacipher sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9134 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Mar 25 2018 18:31
@enigmacipher yw