These are chat archives for FreeCodeCamp/Help

7th
May 2018
Ken Haduch
@khaduch
May 07 2018 01:03
@maxroacharchieshepp - are you referring to the top video?
Ken Haduch
@khaduch
May 07 2018 01:26
@maxroacharchieshepp - if it is the video on top of the page, it loaded several times for me. I cannot see where the video loads in the dev tools, either - I'm not sure if there is a difference in the way a file that is loaded through a javascript action is logged there? Or not logged there.
KratosYQ
@KratosYQ
May 07 2018 01:53
你好
Greg D
@mosaic-greg
May 07 2018 02:03
@KratosYQ 欢迎
Henry
@GitHub-Henry
May 07 2018 04:18
Henry
@GitHub-Henry
May 07 2018 04:26
@khaduch i'm wodering if folks using production links are trying to drive traffic to their sites
Ken Haduch
@khaduch
May 07 2018 04:27
@GitHub-Henry - hi Henry - that is a possibility. I think that I saw one of the moderators commenting on that type of thing.
Henry
@GitHub-Henry
May 07 2018 04:28
@khaduch i think i'm going to ignore any request for help not using something like, codepen.io or the like
Ken Haduch
@khaduch
May 07 2018 04:29
@GitHub-Henry - it is probably a good thing to handle it that way. I mean, there could be a virus or something on a site that someone directs you to, as well.
Henry
@GitHub-Henry
May 07 2018 04:30
although, i did see a devious js script that was hidden away in the html panel of codepen.io, that used the client computer to do stuff, so be careful even on sites like codepen
Ken Haduch
@khaduch
May 07 2018 04:31
@GitHub-Henry - another good point!
Fernando L. Estuesta
@champolot
May 07 2018 04:47
any one here got a validation form. Like if the user got the correct form. It will show a check icon beside the text box?
i mean the correct format being ask
Claudio Restifo
@Marmiz
May 07 2018 05:21
@champolot there are plenty of libraries that aim to help you in form validation. As per the icons, some frameworks like Bootstrap has some in their icon components, or you can make your own :)
usually those icons are added to the input wrapper using the ::after pseudo-class
陳陳陳靓仔~
@CHENSOLO
May 07 2018 06:05
hello~
this what? what i do?
<p>View more <a href="http://www.freecatphotoapp.com">cat photos,</a></p>
Henry
@GitHub-Henry
May 07 2018 06:07
陳陳陳靓仔~
@CHENSOLO
May 07 2018 06:12
oo thanks
Norvin Burrus
@ndburrus
May 07 2018 06:19
@CHENSOLO @CHENSOLO ...這裡也 (第一顆子彈): :sparkles:
  • 中文聊天室
  • 這是一個具有以下特點的元素:文本,圖片鏈接以及更多文本。
Amit Patel
@AmitP88
May 07 2018 07:27
@GitHub-Henry I provided the pic because I've only completed the media query for min-width 320px, so it looks put together on that size, but on larger screens it looks out of whack (still working on that)
Henry
@GitHub-Henry
May 07 2018 07:52
@AmitP88 looks good so far
Fernando L. Estuesta
@champolot
May 07 2018 08:05
@Marmiz this is what kind of form validation I'm talking about..check it out https://elements.envato.com/sign-in
Amit Patel
@AmitP88
May 07 2018 09:05
@GitHub-Henry thanks. I changed the color of the text and removed the white background
CamperBot
@camperbot
May 07 2018 09:05
amitp88 sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 550 | @github-henry |http://www.freecodecamp.org/github-henry
Amit Patel
@AmitP88
May 07 2018 09:05
weather-app-mobile.png
Ken Haduch
@khaduch
May 07 2018 11:39
@AmitP88 - I like the look of your mobile view for the weather app!
Amit Patel
@AmitP88
May 07 2018 11:41
Thanks Ken! I actually kind of reverted back to the previous style though. I wanted to make sure it was readable.
Kranti Nebhwani
@darkphotonKN
May 07 2018 11:43
can someone help me with my form making different forms in html appear depending on which button i click
i got it to work but if i click the second form button both 2nd and 3rd forms appear
and bits of the 3rd form show up in the first form page even though i put "display: none" for entire of 3rd form while 1st form is active...
Ken Haduch
@khaduch
May 07 2018 13:10
@AmitP88 - ah - well, I just tried it on the phone and it looks good, readable with the opaque background. That version doesn't look good on the desktop, though - were you expecting it to? It comes out very huge on a big screen (but looks fine when I shrink the desktop browser window.)
Amit Patel
@AmitP88
May 07 2018 13:13
Oh yeah, I still need to adjust the styles for tablet and higher screensizes. I'm glad it looks good on your phone, I was having doubts lol
Ken Haduch
@khaduch
May 07 2018 13:22

@darkphotonKN - one thing that I see, when I click on the second form's dot, the HTML looks like this:

<div class="modal-body-2is-active">
      <div class="title">Step 2</div>
      <div class="description">Would you rather</div>
      <form lpformnum="2">
        <label>
          <input type="radio" name="radio">live one life that lasts 1,000 years?
        </label>
        <label>
          <input type="radio" name="radio" id="radio2">live 10 lives that last 100 years each?
        </label>
        <div class="text-center fade-in">
          <div class="button">Next</div>
        </div>
      </form>
    </div>

The classes on the top div have no space between them.

@darkphotonKN - and you are putting a class "is-active", but in your CSS your selector is .modal-body.is-showing {
Kranti Nebhwani
@darkphotonKN
May 07 2018 13:24
@khaduch thanks a lot, ive been staring at the code for so long that im looking past the obvious mistakes, i made some changes
CamperBot
@camperbot
May 07 2018 13:24
darkphotonkn sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3908 | @khaduch |http://www.freecodecamp.org/khaduch
Kranti Nebhwani
@darkphotonKN
May 07 2018 13:25
@khaduch now going back to form 1 does make form 1 reappear but going to form 2 and 3 both shows both forms at the same time
and the "done!" from form 3 always shows up..
if you refresh you should be able to see the changes
@khaduch so like the text that says "done!" in form 3 is definitely within the modal-body-3 tag
div *
and that's set to display: none
so I don't know why it's showing up either
Muhammad Anas Qasmi
@m1anas
May 07 2018 13:32
Hi All
I am unable to execute any React :(
I have added React and React DOM in settings and enabled Babel as preprocessor
Aditya
@ezioda004
May 07 2018 13:39
@m1anas You need to use render method from React-dom, the object in which render method exist is called ReactDOM. So, the last line should be ReactDOM.render()
Muhammad Anas Qasmi
@m1anas
May 07 2018 13:41
@ezioda004 oh well thanks
CamperBot
@camperbot
May 07 2018 13:41
m1anas sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 553 | @ezioda004 |http://www.freecodecamp.org/ezioda004
idris
@idris12
May 07 2018 13:45
am trying to tell javascript to only return the the array that matches with the vowels can someone tell me what wrong with my logic in this code
Kranti Nebhwani
@darkphotonKN
May 07 2018 13:51
ok all i managed to fix the form so it appears correctly between different foirms when you click on the different circles
but anyone know why the background is not white for the text written inside div's with classes which are colored with background white?
Aditya
@ezioda004
May 07 2018 13:54

@darkphotonKN Because you have

* {
   background-color: #d1ccc0; 
}

You need to explicitly set the background for the inputs.

Kranti Nebhwani
@darkphotonKN
May 07 2018 13:54
@ezioda004 oh so that will color those inputs even tho they are within a div who's color is set ?
Aditya
@ezioda004
May 07 2018 14:00
@darkphotonKN Yes, it seems to overwrite it.
Check in the inspect element tab, you'll see its being inherited but not being applied.
Kranti Nebhwani
@darkphotonKN
May 07 2018 14:02
@ezioda004 you're right, i fixed it adding another div that has that background color instead of using *
@ezioda004 before you go can you check a show / hide button for me too nobody could give me an answer xD
It simply shows another button and hides it when i click it again and it works
all except the first click
@ezioda004 basically I can't figure out why only the first click doesn't work
@ezioda004 if you refresh everytime the "show" button doesn't work, only if you click it again then it shows and it becomes a hide button and it works perfectly from there going from showing to hiding
Nazar
@IsaakNazar
May 07 2018 14:13
hey everybody! does anyone have experience with SASS?
Ken Haduch
@khaduch
May 07 2018 14:13
@darkphotonKN - hello again - glad that you got the other thing fixed...
For this one, it looks like your initial setting for style is not there, as an in-line style. It is initially in the CSS that is applied. After you click it once, the inline style is set, then it works. If you make the initial setting for that target button <button class="target" style="display:none">Target</button> then it works, because you have an inline style.
Aditya
@ezioda004
May 07 2018 14:13
@darkphotonKN Seems like its because there is no display: none in that Target button itself initially, so when you click it first you set its display to none and after that you toggle to block
Nazar
@IsaakNazar
May 07 2018 14:14
I've typed gem install sass, so CMD doesnt know what kind of command it is
Aditya
@ezioda004
May 07 2018 14:15
Isnt gem a ruby command? You need to install that first I think
Nazar
@IsaakNazar
May 07 2018 14:15
I've already installed that ruby
@ezioda004 ok, I had to reopen CMD, now it works :)
Aditya
@ezioda004
May 07 2018 14:17
Great! :thumbsup:
Nazar
@IsaakNazar
May 07 2018 14:17
@ezioda004 thx :+1:
CamperBot
@camperbot
May 07 2018 14:17
isaaknazar sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 554 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Adegoke Fred
@Frediflexta
May 07 2018 14:25
Hi guys, Hope you're all doing good
I'm a bit stuck trying to refactor a code i wrote sometime ago
basically its an isogram functions
Kranti Nebhwani
@darkphotonKN
May 07 2018 14:26
@khaduch hey thanks for replying again, that;s awesome! Is there a way to do it without setting an inline style though? How does one do a toggle like I am without using JQuery but not having to set an inline style to begin with?
CamperBot
@camperbot
May 07 2018 14:26
darkphotonkn sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3909 | @khaduch |http://www.freecodecamp.org/khaduch
Aditya
@ezioda004
May 07 2018 14:28
@darkphotonKN Make a new class with only display: none;, then toggle that class on that element. Its a good practice to use class instead of changing inline style.
Kranti Nebhwani
@darkphotonKN
May 07 2018 14:29
@ezioda004 thanks bud, so basically using document.style.color ="" etc is bad?
CamperBot
@camperbot
May 07 2018 14:29
darkphotonkn sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 555 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Kranti Nebhwani
@darkphotonKN
May 07 2018 14:30
compared to just using add / remove a class
Aditya
@ezioda004
May 07 2018 14:31
If you could avoid changing inline style then yes, use classes to toggle and that'd also fix the problem you have.
Kranti Nebhwani
@darkphotonKN
May 07 2018 14:32
@ezioda004 awesome, much appreciated!
Mandeep Sharma
@mandeephub
May 07 2018 17:04
needing help with javascript
Pieter Stokkink
@forkerino
May 07 2018 17:13
@mandeephub it helps if you ask a question
Mandeep Sharma
@mandeephub
May 07 2018 17:17
https://codepen.io/mandeep9362/pen/eGxgVp/
here is code pen link theproble is that i cant put the name from text box to p tag
DarkoxD
@DarkoxD
May 07 2018 17:17
Does anyone know why when i zipp folder (send to ---> compressed) my css wont load
Pieter Stokkink
@forkerino
May 07 2018 17:22
@mandeephub I think you need to use .value instead of .innerHtml
May Kittens Devour Your Soul
@diomed
May 07 2018 17:56
omg my networth is -3,5 fiddy
Mehdi Amlal
@mehdiamlal
May 07 2018 19:06
Hey guys
I'm currently working on a social media app that is powered by Django and React. What is the best hosting?
May Kittens Devour Your Soul
@diomed
May 07 2018 19:25
netlify?
Kyle Holm
@thekholm80
May 07 2018 20:06
hi, /help folks
Lance
@texas2010
May 07 2018 20:08
@thekholm80 hi
Kyle Holm
@thekholm80
May 07 2018 20:09
@thekholm80 hey lance, how's the regex coming along?
Henry
@GitHub-Henry
May 07 2018 20:10
@thekholm80 :wave:
Kyle Holm
@thekholm80
May 07 2018 20:10
@GitHub-Henry hey
Lance
@texas2010
May 07 2018 20:11
@thekholm80 ahh, I didnt take regex course. but i would do that someday. this time, i learned react and redux. I will learn how to do react and redux together. it is very interesting to know about redux.
Kyle Holm
@thekholm80
May 07 2018 20:12
@texas2010 redux is a life-saver with react. trying to pass everything as props and callbacks can get really confusing
Henry
@GitHub-Henry
May 07 2018 20:12
@thekholm80 how goes it
Kyle Holm
@thekholm80
May 07 2018 20:13
@GitHub-Henry pretty busy day. monday's are usually like that
Lance
@texas2010
May 07 2018 20:13
@thekholm80 yeah.
Henry
@GitHub-Henry
May 07 2018 20:13
@thekholm80 my brother would say, I'm being oppressed by the man
Kyle Holm
@thekholm80
May 07 2018 20:14
lol
Henry
@GitHub-Henry
May 07 2018 20:15
gotta go, hasta la vista
Lance
@texas2010
May 07 2018 20:18
@thekholm80 what about you?
Kyle Holm
@thekholm80
May 07 2018 20:20
i've been working on my book trading club app, but all i have left is the front end so it's hard to motivate
Lance
@texas2010
May 07 2018 20:23
maybe you can use react in front end lol
Kyle Holm
@thekholm80
May 07 2018 20:26
oh i am
react, react-bootstrap and react-apollo
i just hate designing the layout and all that
Lance
@texas2010
May 07 2018 20:27
ohh css
Kyle Holm
@thekholm80
May 07 2018 20:27
yeah, not my favorite for sure
Lance
@texas2010
May 07 2018 20:27
yeah. that will be thinking a lot
gishy1
@gishy1
May 07 2018 20:33
hello world !!
need help with two things
Stephen James
@sjames1958gm
May 07 2018 20:35
@gishy1 Which Two?
gishy1
@gishy1
May 07 2018 20:36
@sjames1958gm first is on code fights

function adjacentElementsProduct(inputArray) {
//create an empty array
//create a for loop
//multiply the adjacent integers
//organise the products in descending order
var spliced=[];
var product=[];
var i=0;
while(i<inputArray.length+1){
spliced[i]=inputArray.splice(0,2);
i=i+1;
}

for(var a=0;a<3;a++ ){

product[a]=(spliced[a][0])*(spliced[a][1]);
}

return product;

}

function adjacentElementsProduct(inputArray) {
//create an empty array
//create a for loop
//multiply the adjacent integers
//organise the products in descending order
var spliced=[];
var product=[];   
var i=0;    
while(i<inputArray.length+1){  
spliced[i]=inputArray.splice(0,2);
i=i+1;    
}    

for(var a=0;a<3;a++ ){

product[a]=(spliced[a][0])*(spliced[a][1]);    
}    

return product;

}
much better
the for loop is not responding
not sure why
inputArray = [3, 6, -2, -5, 7, 3],
Stephen James
@sjames1958gm
May 07 2018 20:37
@gishy1 splice is the devil's handiwork.
gishy1
@gishy1
May 07 2018 20:38
lool dont get you brother
Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
above in the requirement for this challenge
Stephen James
@sjames1958gm
May 07 2018 20:39
Why make an array of arrays - just calculate the products
arrayOfProducts.push(inputArray[i] * inputArray[i + 1]);
gishy1
@gishy1
May 07 2018 20:39
@sjames1958gm that is me making things more completed than necessary
Stephen James
@sjames1958gm
May 07 2018 20:40
just loop i from 0 to < inputArray.length - 1
gishy1
@gishy1
May 07 2018 20:40
let me try it
Stephen James
@sjames1958gm
May 07 2018 20:40
I seldom use splice - I don't remember the parameters and it mutates the input array
gishy1
@gishy1
May 07 2018 20:41
also wont it end up repeating some of the numbers
as in the first i is 3 multiplied by i+1 which is 6
Stephen James
@sjames1958gm
May 07 2018 20:43
3 * 6 then 6 * -2 then -2 * 5
gishy1
@gishy1
May 07 2018 20:43
but then on the second iteration i =1 so that means 6 will be multplied by i+1 which is -2
Stephen James
@sjames1958gm
May 07 2018 20:44
Unless it means every two - I thought adjacent meant each one multiplied by the next one
I don't think it means in chunks of two
so for array of n you would have n - 1 products
gishy1
@gishy1
May 07 2018 20:45
so then some would be repeated ?
i thought it meant chunks
Stephen James
@sjames1958gm
May 07 2018 20:46
It just say pair of adjacent, means that other than the first and last each would be in 2 products
gishy1
@gishy1
May 07 2018 20:47
thanks let me try it out then get back to you .
gishy1
@gishy1
May 07 2018 20:54
@sjames1958gm why would we have the length as inputArray.length-1?
@sjames1958gm yes!! it worled bro.\
I guess english was the problem
:smile:
Stephen James
@sjames1958gm
May 07 2018 21:48
@gishy1 The reason for inputArray.length - 1 is so i+1 won't go past end of array