These are chat archives for FreeCodeCamp/Help

9th
Feb 2018
Darren
@DarrenfJ
Feb 09 2018 03:37
evening fCC
Kyle Holm
@thekholm80
Feb 09 2018 03:37
@DarrenfJ :wave:
Darren
@DarrenfJ
Feb 09 2018 03:39
@thekholm80 yo brutha!
how goes it?
Kyle Holm
@thekholm80
Feb 09 2018 03:40
Pretty darn good. Watching a new show and it's [expletive deleted] brilliant. How's your world?
Darren
@DarrenfJ
Feb 09 2018 03:41
got sucked into Van Helsing... been binge watching it
Kyle Holm
@thekholm80
Feb 09 2018 03:41
hmm, I saw the movie. I didn't know there was a show
oh wait
With a female van helsing?
Darren
@DarrenfJ
Feb 09 2018 03:41
it's alright.. no walking dead but satisfies the need for post-apocalyptic nightmare alternate-reality stuff
yah sorta but they haven;t called her that yet..
Kyle Holm
@thekholm80
Feb 09 2018 03:42
interesting
Darren
@DarrenfJ
Feb 09 2018 03:42
she's basically a reverse vampire.. has the same strength and healing but human
a 'blade' but without the need to a vaccine for the urge
but she does go into rages and killing sprees..
but then, is it killing if it's the undead?
Kyle Holm
@thekholm80
Feb 09 2018 03:43
I might have to check that out
"laying to rest" maybe?
putting down?
Darren
@DarrenfJ
Feb 09 2018 03:43
yes..
putting down i was just gonna say too lol
Kyle Holm
@thekholm80
Feb 09 2018 03:43
lol
Darren
@DarrenfJ
Feb 09 2018 03:46
ok, off to watch CSS vids
still trying to deep dive the CSS but it's an endless trench in the sea
Kyle Holm
@thekholm80
Feb 09 2018 03:46
@DarrenfJ thanks for the show recommend
CamperBot
@camperbot
Feb 09 2018 03:46
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2382 | @darrenfj |http://www.freecodecamp.org/darrenfj
Darren
@DarrenfJ
Feb 09 2018 03:46
and @thekholm80 thanks for the chat
:D
thanks @thekholm80
CamperBot
@camperbot
Feb 09 2018 03:46
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1688 | @thekholm80 |http://www.freecodecamp.org/thekholm80
jeddionido
@jeddionido
Feb 09 2018 04:11
Hello
Can i have some help from you folks?
Kyle Holm
@thekholm80
Feb 09 2018 04:12
possibly, depends on the help you need
jeddionido
@jeddionido
Feb 09 2018 04:12
OK
I made a Program using Javascript and put a CSS background syntax and didn't work. How to troubleshoot this?
image.png
..
Kyle Holm
@thekholm80
Feb 09 2018 04:15
@jeddionido it looks like your css is
body (
  background-color: lightblue;
)
should use { } instead of ( )
unless i'm just blind
yep, i'm blind lol
jeddionido
@jeddionido
Feb 09 2018 04:16
It is like this
{ }
image.png
Kyle Holm
@thekholm80
Feb 09 2018 04:17
can you paste the code here? I'd like to stick it in a jsbin
so i can see what's going on
thanks, one sec
jeddionido
@jeddionido
Feb 09 2018 04:18
<html>
<head>
<style type="type/css">
body {
background-color: lightblue;
}
</style>
<script type="text/javascript">
function verify(){
var name=prompt("Enter Name:","");
var gender=prompt("Enter Gender:","");
var no=parseInt(prompt("Enter Age:",""));
document.write("<h1>You're visiting an Age Verification Program! </h1>");
document.write("Hello! ", name);
document.write("<br>");
document.write("You are a ", gender);
document.write("<br>");
document.write("Your age is ", no);
document.write("<br>");
if(no<18) { alert("UNDER 18"); document.write("Sorry! You're underage."); document.write("<br>"); document.write("THANKS FOR PARTICIPATING IN THE AGE VERIFICAITON!"); } else { alert("Your an adult!"); document.write("Your an ADULT!"); document.write("<br>"); document.write("THANKS FOR PARTICIPATING IN THE AGE VERIFICAITON!"); } } </script>
</head>
<body onload="verify()">
</body>
</html>
There
I'm just beginning to start learning JavaScripting and CSS
Kyle Holm
@thekholm80
Feb 09 2018 04:19
if i take the type="type/css" out of your <style> tag it works
jeddionido
@jeddionido
Feb 09 2018 04:21
Not working for me
Kyle Holm
@thekholm80
Feb 09 2018 04:22
if you're looking at the jsbin, click "Run with JS" in the top-right corner
Irina Brennen
@iabrenne
Feb 09 2018 04:23
@jeddionido take out type attribute alltogether
just leave at as <script>
sorry nevermind. oops looking at the wrong thing
jeddionido
@jeddionido
Feb 09 2018 04:24
image.png
Did the right thing @thekholm80 but nothing happened...
Kyle Holm
@thekholm80
Feb 09 2018 04:25
is there a reason you're using document.write() for all of this?
the color shows up until your script finishes
seems like an odd way to go about all this
jeddionido
@jeddionido
Feb 09 2018 04:27
IKR, thats the model that my teacher gave and i copyed it...
Kyle Holm
@thekholm80
Feb 09 2018 04:27
I see
for whatever reason, it's removing your css during the script execution
jeddionido
@jeddionido
Feb 09 2018 04:28
And i tried to troubleshoot all over again but the result is the same
Kyle Holm
@thekholm80
Feb 09 2018 04:29
image.png
jeddionido
@jeddionido
Feb 09 2018 04:30
Whats that for sir @thekholm80 ?
Kyle Holm
@thekholm80
Feb 09 2018 04:30
that's Chrome's built-in inspector
it's how you see what's going on on a page
jeddionido
@jeddionido
Feb 09 2018 04:31
Oh ok
Ill test the program there
Kyle Holm
@thekholm80
Feb 09 2018 04:31
sorry i can't help you, I really don't know what the deal is
Claudio Restifo
@Marmiz
Feb 09 2018 04:32
@jeddionido write used after a page is loaded will destroy the HTML and replace it.
therefore your original CSS will be erased
jeddionido
@jeddionido
Feb 09 2018 04:33
It's fine @thekholm80 :smile:
Claudio Restifo
@Marmiz
Feb 09 2018 04:33
I've never seen anyone using write besides for testing or for some funky new tabs creation
Kyle Holm
@thekholm80
Feb 09 2018 04:33
@Marmiz yeah, it's a new one for me, too
jeddionido
@jeddionido
Feb 09 2018 04:34
I'll try to troubleshoot... Thanks anyways! :D
Claudio Restifo
@Marmiz
Feb 09 2018 04:34
Jut to make it simple, everything you use in document.write will be like a brand new page. So if you want to use it as it is, you have to write the head as well
Kyle Holm
@thekholm80
Feb 09 2018 04:35
that would explain why the style is disappearing
jeddionido
@jeddionido
Feb 09 2018 04:35
But how?
Claudio Restifo
@Marmiz
Feb 09 2018 04:35
That'syour duty to find out :)
jeddionido
@jeddionido
Feb 09 2018 04:35
Ok
Thanks @Marmiz !!
CamperBot
@camperbot
Feb 09 2018 04:35
jeddionido sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1150 | @marmiz |http://www.freecodecamp.org/marmiz
Claudio Restifo
@Marmiz
Feb 09 2018 04:36

pppppsssst... i told you how a second ago:

Jut to make it simple, everything you use in document.write will be like a brand new page. So if you want to use it as it is, you have to write the head as well

:shipit:

@thekholm80 the only time I used write was with window.open to test a backend feature :)
Kyle Holm
@thekholm80
Feb 09 2018 04:37
lol
i've done some crazy vanilla stuff just to avoid jquery, but never document.write
lots of querySelector and appendChild stuff
Claudio Restifo
@Marmiz
Feb 09 2018 08:37
Someone in here willing to help me with a React thingy?
wangzhizheng
@asuka-wzz
Feb 09 2018 08:39
??
Olapri
@Olapri
Feb 09 2018 09:13
@thekholm80 @sjames1958gm @HeinousTugboat thanks.It was in a basic solution.
CamperBot
@camperbot
Feb 09 2018 09:13
olapri sends brownie points to @thekholm80 and @sjames1958gm and @heinoustugboat :sparkles: :thumbsup: :sparkles:
:star2: 8953 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
:cookie: 341 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
:star2: 1689 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Ancusor
@ancusor
Feb 09 2018 12:15
Hi there,I want to replace 16 GIF images from a website and replace it with one CSS SPRITE PNG,to have fewer requests.I made it work,but when CSS swap/alternate 2 images like GIF, it sees the other images when scrolls. I want to hide the scroll effect like a GIF,1 sec img1 & 1 sec img2 like a real GIF. Here my project https://codepen.io/ancusor/pen/oEZgXo
I hope somebody will help me :)
ehutchllew
@ehutchllew
Feb 09 2018 13:06
@Marmiz Still need help?
dkbast
@dkbast
Feb 09 2018 14:35
Hi, Im trying to figure out how the facebook pixel code works. In a first step, I am interested in how the cookie is set. Can anybody shed some light on that? I have been going through the minified code https://connect.facebook.net/en_US/fbevents.js for about an hour. Somehow I can't find the snippet where the cookie is set.
VaseJS
@VaseJS
Feb 09 2018 14:48
@dkbast cookies can be set on the back end so you’ll never see that code. they could be using Sessions or any back end tool to handle such things.
dkbast
@dkbast
Feb 09 2018 15:27
@VaseJS but they only want people to paste a small js snippet calling the fbevents - so I assume the cookie has to be set in the browser
Olapri
@Olapri
Feb 09 2018 15:47
Hallo. Pls help - I don`t understand ((((( - https://www.freecodecamp.org/challenges/wherefore-art-thou
function whatIsInAName(collection, source) {
var keySource = Object.keys(source);
return collection.filter(function (item) {
for(var i = 0; i < keySource.length; i++) {
if(!item.hasOwnProperty(keySource[i]) || source[keySource[i]] !== item[keySource])
{return false;}
else {return true;}
}
});
}
whatIsInAName([{ "a": 1, "b": 2 }, { "a": 1 }, { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 });
it does not work
Olapri
@Olapri
Feb 09 2018 15:55
please... help...
Ken Haduch
@khaduch
Feb 09 2018 16:02
@Olapri - what kind of results are you getting?
@Olapri - you might just need to add [i] to the source[keySource[i]] !== item[keySource]) - make it source[keySource[i]] !== item[keySource[i]])
Ken Haduch
@khaduch
Feb 09 2018 16:11
@Olapri - always reference keySource[i] in your inner loop.
Ken Haduch
@khaduch
Feb 09 2018 16:16
@Olapri - another helpful thing here is to post your code properly formatted, it makes it easier to study the code... proper indentation and surround your block of code with three backticks on a separate line at the top and bottom - ``` makes the code more readable.
Ken Haduch
@khaduch
Feb 09 2018 16:21
@Olapri - there might be another issue, too - you are missing a case where there are multiple properties in an object and by returning true when there is only a single match, it is not fully testing all of the sub-object properties - for example, the source in your test case above has { "a": 1, "b": 2 } and the second object in the array only consists of { "a": 1 }. Unless you determine that the second key/value "b": 1 exists and matches in the item, you will not get the correct result. so you don't want to return true in that case...
Olapri
@Olapri
Feb 09 2018 16:31
exactly - it is the problem I don`t know how to exclude this mistake - not to display only { "a": 1 } if the source has the second key/value "b": 1 as well
Aditya
@ezioda004
Feb 09 2018 16:43
@Olapri As @khaduch said your first problem is source[keySource[i]] !== item[keySource]) since keySource is an array. That can be solved with source[keySource[i]] !== item[keySource[i]]) now with the second problem of it returning true too early, that can be solved with having return true outside the loop so something like this.
for(var i = 0; i < keySource.length; i++) {
      if(!item.hasOwnProperty(keySource[i]) || source[keySource[i]] !== item[keySource[i]]){
        return false;}
      else {}
      }
    return true;
Olapri
@Olapri
Feb 09 2018 17:06
@ezioda004 @khaduch right you are. I managed to fix it. Thanks
CamperBot
@camperbot
Feb 09 2018 17:06
olapri sends brownie points to @ezioda004 and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 446 | @ezioda004 |http://www.freecodecamp.org/ezioda004
:star2: 3723 | @khaduch |http://www.freecodecamp.org/khaduch
Gersho
@Gersho
Feb 09 2018 17:39
Hello /Help
Aditya
@ezioda004
Feb 09 2018 17:43
@Gersho :wave:
Kyle Holm
@thekholm80
Feb 09 2018 17:53
@Gersho :wave:
VaseJS
@VaseJS
Feb 09 2018 18:56
@Gersho lol
Albert Cardona II
@daddycardona
Feb 09 2018 19:21
what up yall
been busy sorry a little sick :)
VaseJS
@VaseJS
Feb 09 2018 19:22
@daddycardona damn, where you been
Albert Cardona II
@daddycardona
Feb 09 2018 19:22
school surgery etc.. lol
I was starting a mini bootcamp with the lambada and when I was doing it I was learning how to use github properly then I got sick found out my appendix was being a a hole so I had to take that out and I only got to day 2 lol
I can basically say my calculator is done I have not worked on it since lol
Gersho
@Gersho
Feb 09 2018 19:24
and here i was slowing down out of plain lazyness
Albert Cardona II
@daddycardona
Feb 09 2018 19:24
Oh I was being lazy too I still have not fixed the ... or the 3.4.2 issues lmao
Gersho
@Gersho
Feb 09 2018 19:32
if you github via command line don't forget to setup your key or you won't be getting the points
Albert Cardona II
@daddycardona
Feb 09 2018 19:37
I was learning that with that school @Gersho
so I will be tackling the ... and 3.4.6 etc.. LOL
Gersho
@Gersho
Feb 09 2018 19:39
i'm still on week3 of cs50, it's getting a bit more intense (plus the lazy thing)
Albert Cardona II
@daddycardona
Feb 09 2018 19:39
did not do cs50 at all LOL yet
Gersho
@Gersho
Feb 09 2018 19:39
well there's only 24 hours in a day
and you're doing that school stuff too
Albert Cardona II
@daddycardona
Feb 09 2018 19:40
yeah electronics etc..
Kelechi Chinaka
@ke1echi
Feb 09 2018 19:55
:wave: @Gersho
Gersho
@Gersho
Feb 09 2018 19:56
@kelechy :wave:
Kelechi Chinaka
@ke1echi
Feb 09 2018 19:56
am doing cash now, do u have some mins to spare? @Gersho
C is banging ma head :smile:
Gersho
@Gersho
Feb 09 2018 19:59
sure
Kelechi Chinaka
@ke1echi
Feb 09 2018 19:59
#include <stdio.h>
#include <cs50.h>
#include <math.h>

int main (void)
{

    float f = 0;

    //prompt user for a valid input
    do
    {
        f = get_float("How much do we owe you?: \n");
    }
    while (f < 0);

    printf("%f\n", f);
}
Gersho
@Gersho
Feb 09 2018 20:01
since you're using a do loop you don't need to set f to 0 , it'll work even with float f;
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:02
i think i need to first multiply f by 100 then round it right?
Gersho
@Gersho
Feb 09 2018 20:03
yes
have you done the change challenge in JS on freecodecamp ?
they work pretty much the same way
only here you only need amount of coin and don't need to take supply in consideration
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:06
yes
i got confused at some point
so 5 should give me 500? @Gersho
Gersho
@Gersho
Feb 09 2018 20:07
you convert to cents to avoid floating errors, then you count down the money in a loop while storing the increasing number of coins
when converting to cents ? yes
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:08
ok
needed to be sure
hows pset3 going for you
Gersho
@Gersho
Feb 09 2018 20:10
week 3 is actually pset4 (week 1 has 2 parts) and it's a bit hard ^^
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:13
wow
Gersho
@Gersho
Feb 09 2018 20:13
Specification
Implement a program called recover that recovers JPEGs from a forensic image.
that's the one i'm "working" on atm ( IDE open, nothing written)
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:14
lol
gather your thoughts before opening the ide :smile:
it happens to everyone..u would get it
Gersho
@Gersho
Feb 09 2018 20:15
i tried that, the ide stayed closed for some time ^^
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:16
lol
Gersho
@Gersho
Feb 09 2018 20:16
but well, i'm making progress so it should work out at some point
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:16
it can be confusing at times too
i input 35 and it gave me 140 coins
Gersho
@Gersho
Feb 09 2018 20:17
well 35 dollars in coins would be 35*4 quarters i guess ?
you should use check50 instead of manual testing
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:18
i think my logic is correct
Gersho
@Gersho
Feb 09 2018 20:18
well the result is valid
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:19
just watched the short and am correct
:smile:
Gersho
@Gersho
Feb 09 2018 20:19
short ?
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:20
zamayla's videos
Gersho
@Gersho
Feb 09 2018 20:21
oh the walkthrough
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:21
correct
i did mario(more) yesterday and cash today
Gersho
@Gersho
Feb 09 2018 20:24
gratz! go for the (more) version
sometimes i do both, sometime only the (more) one
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:25
sure will
i think am begining to pick up.. had a very slow start to the course :smile:
Gersho
@Gersho
Feb 09 2018 20:29
well C is a bit ...harsh
my internet keeps going on and off, today is an annoying day :(
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:31
yea...it have to do almost everything yourself in C
Gersho
@Gersho
Feb 09 2018 20:33
yeah, and that's with cs50.h that includes some stuff like strings
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:37
the cs50.h has only 8 functions attached to it
Gersho
@Gersho
Feb 09 2018 20:38
it also had data types, like string
Kelechi Chinaka
@ke1echi
Feb 09 2018 20:39
o ok
Kyle Holm
@thekholm80
Feb 09 2018 22:11
@daddycardona hey welcome back
Altin Rrahmani
@DevKosov
Feb 09 2018 22:12
@thekholm80 :wave:
Kyle Holm
@thekholm80
Feb 09 2018 22:13
@DevKosov hey man, how are you?
Altin Rrahmani
@DevKosov
Feb 09 2018 22:13
i am great, what about you?
Kyle Holm
@thekholm80
Feb 09 2018 22:14
pretty darn good. almost 60 degrees today, took a 1/2 day off and rode my motorcycle
always makes for a good day
Altin Rrahmani
@DevKosov
Feb 09 2018 22:14
That's good to hear :)
Kenneth "Leeoku" Lee
@Leeoku
Feb 09 2018 22:15
@thekholm80 i hate you, its snowing outside here and a snowstorm is brewing T_T
jealous*
Kyle Holm
@thekholm80
Feb 09 2018 22:15
haha i have friends in Maine (USA) and they've got like 90 inches of snow
Kenneth "Leeoku" Lee
@Leeoku
Feb 09 2018 22:15
no way
Altin Rrahmani
@DevKosov
Feb 09 2018 22:15
Kyle have you had any experience using Drupal cms
happysoccerboy
@happysoccerboy
Feb 09 2018 22:16
image.png
hey guys, just wonder if you guys know how to clear recent files on Atom icon
it's confusing, when right click the icon, a bunch of same file names show up
Kyle Holm
@thekholm80
Feb 09 2018 22:17
@DevKosov nope, sorry.
Altin Rrahmani
@DevKosov
Feb 09 2018 22:18
i just started like today
i have lots of questions lol
Kyle Holm
@thekholm80
Feb 09 2018 22:56
@DevKosov I have not learned PHP so Drupal is a long way off for me
Kaz Baig
@kbaig
Feb 09 2018 23:00
@thekholm80 I'm about to head off to chicago via amtrak in a couple hours...not looking forward to it
one foot of snow between last night and tonight
Kyle Holm
@thekholm80
Feb 09 2018 23:01
@kbaig I love riding Amtrak, but I've never used it during any kind of bad weather
hope you don't get crappy delays
Stephen James
@sjames1958gm
Feb 09 2018 23:06
@happysoccerboy Try unpin from task bar then re-pin
happysoccerboy
@happysoccerboy
Feb 09 2018 23:08
@sjames1958gm you meant updock and re-dock Atom?
not working either
Stephen James
@sjames1958gm
Feb 09 2018 23:10
@happysoccerboy Is that not windows :)
happysoccerboy
@happysoccerboy
Feb 09 2018 23:11
@sjames1958gm using Macbook, that doesn't fix lol
Stephen James
@sjames1958gm
Feb 09 2018 23:12
@happysoccerboy made the stupid assumption it was windows :(
Kyle Holm
@thekholm80
Feb 09 2018 23:12
  1. install windows
  2. pin to task bar
  3. unpin from task bar
  4. re-pin to task bar
win
happysoccerboy
@happysoccerboy
Feb 09 2018 23:13
@sjames1958gm no worry
Stephen James
@sjames1958gm
Feb 09 2018 23:15
@thekholm80 Watch out for that first step it's a doozy :)
Kyle Holm
@thekholm80
Feb 09 2018 23:15
lol
someday I'm going to buy a mac, just so I can understand how they work
Gersho
@Gersho
Feb 09 2018 23:37
@happysoccerboy you could disable recent files system wide, but ofc that would impact your other software
Kaz Baig
@kbaig
Feb 09 2018 23:42
@thekholm80 it's always delayed in this direction of the journey so it's only going to be exacerbated (severely) by the weather
Kyle Holm
@thekholm80
Feb 09 2018 23:42
@kbaig sorry man. the worst part is when it's all over you'll be in Chicago
;)
Kaz Baig
@kbaig
Feb 09 2018 23:43
rude af
Kyle Holm
@thekholm80
Feb 09 2018 23:43
to be fair, i've never been to chicago so it could be awesome for all i know
VaseJS
@VaseJS
Feb 09 2018 23:53
hey, don’t hate on the Chi! this place is awesome!
:D