These are chat archives for FreeCodeCamp/Help

24th
Feb 2018
Kyle Holm
@thekholm80
Feb 24 2018 00:24
holy crap i make some ugly UI
Samuel Culpepper
@qzdl
Feb 24 2018 00:50
hi everyone
anyone need help with anything?
啊吖嗄
@LinHuijuan
Feb 24 2018 02:26
I downloaded gitter, but every time I clicked on it, the interface was always blank. What should I do? I downloaded the Windows version.
xiaobingxiuajiang
@xiaobingxiuajiang
Feb 24 2018 03:34
why
啊吖嗄
@LinHuijuan
Feb 24 2018 03:45
I don't know, I downloaded and installed to the D disk from the website here, opened the option to log on GitHub, and the interface is always blank after clicking.
Ken Haduch
@khaduch
Feb 24 2018 03:52
@LinHuijuan - I always just go to the webpage for gitter on my desktop. On my phone I use the app... it works okay on the phone. The website works fine through the browser on desktop... windows 10
啊吖嗄
@LinHuijuan
Feb 24 2018 04:17
@khaduch ok,thank you
CamperBot
@camperbot
Feb 24 2018 04:17
linhuijuan sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3753 | @khaduch |http://www.freecodecamp.org/khaduch
啊吖嗄
@LinHuijuan
Feb 24 2018 04:23
@sjames1958gm Yesterday I didn't know thank you by @ you, now I make up for it. Thank you.
CamperBot
@camperbot
Feb 24 2018 04:23
linhuijuan sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9020 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Jacob Fines
@jfines
Feb 24 2018 04:24

I'm having some serious trouble with the way my project is organizaed. I'm using apache to serve it up and I like the way things are separated into their own directory, just not all the links I've been having to use to make the code function properly.

Someone advised me the other day on this but by the time I got the information I was so burned out I couldn't sustain through to complete the solution. I'm wondering what the best soln is for me and I really need to get this mess sorted out.

They say a picture tells a thousand words ... This pretty much says it all: https://imgur.com/a/190Vx

If anyone can help walk me through this ( or at least get me started ) I would really appreciate it.

Jacob Fines
@jfines
Feb 24 2018 05:08
I'll ask again later. Thanks
alpox
@alpox
Feb 24 2018 09:57
@jfines why do you need the links? You can directly refer to the scripts from the html sites with just using the path from the webroot to the script
Aditya
@ezioda004
Feb 24 2018 10:09
Anybody know how I can do the react challenges in beta? The map doesnt work for me.
Darren
@DarrenfJ
Feb 24 2018 16:55
morning fCC
quiet night I see ;)
off for :tea: and podcasts..
codeOn
Stephen James
@sjames1958gm
Feb 24 2018 16:58
@DarrenfJ :wave:
JarryHua
@JarryHua
Feb 24 2018 17:13
hey is anybody online.
I came across a problems when I did a practice.

<link href="//fonts.gdgdocs.org/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
h2 {
font-family: Lobster, Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="/images/relaxing-cat.jpg"></a>
</div>
</div>
<img src="/images/running-cat.jpg" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary fa fa-thumbs-up">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info ">Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger ">Delete</button>
</div>
</div>
<i class="fa fa-thumbs-up"></i>
<p>Things cats <span class="text-danger">love:</span></p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

I don't know why I can't pass through.
and the tips notify me the second and the third is wrong.
your thumbs-up icon should place on like button.
and the third is your i element .....
Kyle Holm
@thekholm80
Feb 24 2018 17:32
@JarryHua <button class="btn btn-block btn-primary fa fa-thumbs-up">Like</button> you need an icon element <i class="....">
if i remember the challenge correctly
The i element was originally used to make other elements italic, but is now commonly used for icons. You add the Font Awesome classes to the i element to turn it into an icon, for example:
<i class="fa fa-info-circle"></i>
Use Font Awesome to add a thumbs-up icon to your like button by giving it an i element with the classes fa and fa-thumbs-up.
@DarrenfJ hey :wave:
JarryHua
@JarryHua
Feb 24 2018 17:37
@thekholm80 thanks
CamperBot
@camperbot
Feb 24 2018 17:37
jarryhua sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1708 | @thekholm80 |http://www.freecodecamp.org/thekholm80
JarryHua
@JarryHua
Feb 24 2018 17:38
actually the thumbs-up icon has already displayed on the like button.
@thekholm80
Kyle Holm
@thekholm80
Feb 24 2018 17:39
is it done the way the instructions told you to do it?
getting a similar result is not the same as doing things the way you're asked to do them
JarryHua
@JarryHua
Feb 24 2018 17:39
there are four instructions and I passed the first and the last.
I am really confused by the two instructions.
I don't know how to do.
Kyle Holm
@thekholm80
Feb 24 2018 17:42

there's only 1 instruction

Use Font Awesome to add a thumbs-up icon to your like button by giving it an i element with the classes fa and fa-thumbs-up.

if you didn't do that, you won't pass the tests
JarryHua
@JarryHua
Feb 24 2018 17:45
so I did that with two line code, one is <i class="fa fa-thumbs-up"></i>
Kyle Holm
@thekholm80
Feb 24 2018 17:46
and you nested it inside the <button> element?
JarryHua
@JarryHua
Feb 24 2018 17:46
another line is <button class="btn btn-block btn-primary fa fa-thumbs-up">Like</button>
no
Kyle Holm
@thekholm80
Feb 24 2018 17:46
your button element shouldn't have the font-awesome classes
Amanda
@ScarlettKitsune
Feb 24 2018 17:49
Hello everyone
Kyle Holm
@thekholm80
Feb 24 2018 17:49
@ScarlettKitsune :wave:
JarryHua
@JarryHua
Feb 24 2018 17:49
@thekholm80
thanks a lot
I pass it.
Kyle Holm
@thekholm80
Feb 24 2018 17:49
:+1: good job!
JarryHua
@JarryHua
Feb 24 2018 17:50
I didn't nest the i element inside the like button, so is it.
JarryHua
@JarryHua
Feb 24 2018 18:54
@thekholm80 are you there?
Kyle Holm
@thekholm80
Feb 24 2018 18:54
yep
JarryHua
@JarryHua
Feb 24 2018 18:54
I am learning Learn how Script Tags and Document Ready Work section.
I don't understand the meanings of last words.
Kyle Holm
@thekholm80
Feb 24 2018 18:55

this part?

This is important because without your document ready function, your code may run before your HTML is rendered, which would cause bugs.

JarryHua
@JarryHua
Feb 24 2018 18:56
ok ,get it.
right.
cause the chinese is a little confused.
confusing.
Kyle Holm
@thekholm80
Feb 24 2018 18:57
ah, all chinese is confusing to me
JarryHua
@JarryHua
Feb 24 2018 18:57
haha thanks @thekholm80
CamperBot
@camperbot
Feb 24 2018 18:57
jarryhua sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1709 | @thekholm80 |http://www.freecodecamp.org/thekholm80
JarryHua
@JarryHua
Feb 24 2018 19:32
hey @thekholm80 sorry bothering again.
Change Text Inside an Element Using jQuery
this section,
my script is $("#target4").html("<em>jQuery Playground</em>");
Kyle Holm
@thekholm80
Feb 24 2018 19:34
you shouldn't change the text they gave you <button class="btn btn-default target" id="target4">#target4</button>so the button should still say "#target4" you've changed it to "jQuery Playground"
JarryHua
@JarryHua
Feb 24 2018 19:34
I already emphsize the button, but it notified me make sure the button you changed is target4.
Kyle Holm
@thekholm80
Feb 24 2018 19:34
so <em>#target4</em>
JarryHua
@JarryHua
Feb 24 2018 19:36
yeah, you right.
@ @thekholm80
Kyle Holm
@thekholm80
Feb 24 2018 19:45
@sjames1958gm you around?

okay, say i have a deep-nested object I want to destructure, like:

const myObj = {
  level1: {
    level2: {
      level3: {
        key: "puppies"
      }
    }
  }
}

both
const { key } = myObj.level1.level2.level3;
and
const { level1: { level2: { level3: { key }}}} = myObj;
accomplish the same thing, which one looks the least ugly?

Aditya
@ezioda004
Feb 24 2018 20:21
@thekholm80 Is there a correct answer? I remember reading that . notation is the fastest? I could be wrong
Gersho
@Gersho
Feb 24 2018 20:21
the second one hurts my eyes
}}}}
Kyle Holm
@thekholm80
Feb 24 2018 20:21
@ezioda004 i'm not aware of any performance differences
i went with the first one so i wouldn't have to hunt for the variable name
Gersho
@Gersho
Feb 24 2018 20:22
you reduce risk of typo with a more "human readable" format
Stephen James
@sjames1958gm
Feb 24 2018 20:22
@thekholm80 I would say that the first one is clearer
Aditya
@ezioda004
Feb 24 2018 20:23
Oh found it, here
Scammed by cbot :sob:
Kyle Holm
@thekholm80
Feb 24 2018 20:24
@ezioda004 @Gersho @sjames1958gm thanks
CamperBot
@camperbot
Feb 24 2018 20:24
thekholm80 sends brownie points to @ezioda004 and @gersho and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 604 | @gersho |http://www.freecodecamp.org/gersho
:cookie: 476 | @ezioda004 |http://www.freecodecamp.org/ezioda004
:star2: 9025 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Kyle Holm
@thekholm80
Feb 24 2018 20:24
there we go
__mifflin__
@cdrainxv
Feb 24 2018 20:30
^ I usually only go two levels deep.
Kyle Holm
@thekholm80
Feb 24 2018 20:59
ugh, another bit of weirdness
graphql is adding keys to my objects
image.png
my user object looks like {display_name: "name"} so I thought i could just attendees.includes(user) but with all those extra keys, i guess i have to iterate through the entire array myself?
Kyle Holm
@thekholm80
Feb 24 2018 21:22
hmm, wouldn't have worked the way I thought, anyway
alpox
@alpox
Feb 24 2018 21:54
@thekholm80 I suggest to use .some
Kyle Holm
@thekholm80
Feb 24 2018 21:55
@alpox i'll have to check that out, thanks. i ended up using something like
const isPresent = attendees.reduce((a, b) => {
  return b.key == comparisonValue ? true : a;
}, false);
CamperBot
@camperbot
Feb 24 2018 21:55
thekholm80 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1554 | @alpox |http://www.freecodecamp.org/alpox
alpox
@alpox
Feb 24 2018 21:56
@thekholm80 That can be reduced to const isPresent = attendees.some(a => a.key == comparisonValue)
Kyle Holm
@thekholm80
Feb 24 2018 21:56
much more succinct
right now i'm back to battling express over CORS
Kyle Holm
@thekholm80
Feb 24 2018 21:58
i'm using that
alpox
@alpox
Feb 24 2018 21:58
Ah ok :)
Kyle Holm
@thekholm80
Feb 24 2018 21:58
but it sets the Access-Control-Allow-Origin to *
and graphql doesn't like that
alpox
@alpox
Feb 24 2018 21:58
Yea thats the default
You have to configure the origin then:
app.use(cors({
   origin: [ "http://localhost:3000" ]
}));
Something like this
Kyle Holm
@thekholm80
Feb 24 2018 22:01
lol yeah have that too
alpox
@alpox
Feb 24 2018 22:02
And it still sets it to *?
Weird... did you restart the server? :D
Kyle Holm
@thekholm80
Feb 24 2018 22:02
yeah
well, nodemon did
alpox
@alpox
Feb 24 2018 22:03
Ah ok
Yea then i don't have to ask :D
Kyle Holm
@thekholm80
Feb 24 2018 22:03
i forgot i had cors() on my route
so i added the options object to that
and got passed the preflight check
alpox
@alpox
Feb 24 2018 22:04
:thumbsup: nice :D
Kyle Holm
@thekholm80
Feb 24 2018 22:04
but for some reason i don't think apollo is sending my cookies
alpox
@alpox
Feb 24 2018 22:04
Hmm i'm not sure if that has something to do with the cors module. I think not
Kyle Holm
@thekholm80
Feb 24 2018 22:05
nope, my cookie is there too
man i hate debugging
alpox
@alpox
Feb 24 2018 22:05
Can be a pain in the ass, yes
Kyle Holm
@thekholm80
Feb 24 2018 22:05
oh never mind it worked lol
alpox
@alpox
Feb 24 2018 22:06
Wonderful how things work out :D
Kyle Holm
@thekholm80
Feb 24 2018 22:06
learning new things is frustrating
@alpox thanks for the help
CamperBot
@camperbot
Feb 24 2018 22:06
thekholm80 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
api offline
alpox
@alpox
Feb 24 2018 22:06
Is it? I like it :D
Kyle Holm
@thekholm80
Feb 24 2018 22:06
this is my first app using graphql, and my first time using jwt
lots of new stuff to break
alpox
@alpox
Feb 24 2018 22:07
One gets used to hit the head on everything :D
Yea right, that takes time to get into
I didn't use graphql much. Only a little bit for testing purpose
Kyle Holm
@thekholm80
Feb 24 2018 22:07
i'm really enjoying it
feels a lot like redux
alpox
@alpox
Feb 24 2018 22:08
Uh only appollo has some things like redux as it also caches. But else i don't see much which is similar
As graphql is for transfer and redux only for state management
Kyle Holm
@thekholm80
Feb 24 2018 22:08
i mean, how you have to go through a huge, shamanistic ritual to accomplish anything
alpox
@alpox
Feb 24 2018 22:09
Ah that :D
Yea you're right about that
Kyle Holm
@thekholm80
Feb 24 2018 22:09
there's less steps to summoning the undead than there is to using redux or apollo
alpox
@alpox
Feb 24 2018 22:09
I was kinda thinking if there wouldn't be a better approach than redux
I think i'll give it a go after university
Kyle Holm
@thekholm80
Feb 24 2018 22:10
i hear if you use relay instead of apollo on the front it's much worse, too
alpox
@alpox
Feb 24 2018 22:10
Kinda have to work on an interesting thesis until summer. I learn a lot about things which could help to create something better suited. Hopefully.
Yea relay can be bad :D
Kyle Holm
@thekholm80
Feb 24 2018 22:10
what are you doing for your thesis?
alpox
@alpox
Feb 24 2018 22:11
I'll work on the publishing of big datasets and time-dependant data over datastreams in the web to which you can subscribe with different technologies.
Well lots of it is done already, but i will do work in that field, make it more stable and add stuff probably :)
The datasets are resembled as RDF Streams which are mainly graph structures and can be queried with SPARQL
Kyle Holm
@thekholm80
Feb 24 2018 22:12
which part are you focusing on? the serving part, the client part or the data part?
alpox
@alpox
Feb 24 2018 22:12
Likely at first the transformation from rdb to rdf
Kyle Holm
@thekholm80
Feb 24 2018 22:13
all way over my head
alpox
@alpox
Feb 24 2018 22:13
Means taking relational data from databases and transform it into graph structure
Mainly this here :D
Kyle Holm
@thekholm80
Feb 24 2018 22:13
ah
yay, think i'm all done
Daniel
@dkapexhiu
Feb 24 2018 22:14
why doesnt this code work:
function makeMarkerIcon(location) {
        //different icons for different categories
        var category = location.category;
        console.log(category);
        var icons = {
            shtepi: {
                icon: 'realestate.png'
            },
            biznese: {
                icon: 'homegardenbusiness.png'
            }
        };
        var markerImage = new google.maps.MarkerImage(
            'https://maps.google.com/mapfiles/kml/shapes/' + icons[category].icon,
            new google.maps.Size(48, 48),
            new google.maps.Point(0, 0),
            new google.maps.Point(10, 34),
            new google.maps.Size(48, 48)
            );
        return markerImage;
    };
Kyle Holm
@thekholm80
Feb 24 2018 22:14
now if i can remember how to build and deploy to heroku
Daniel
@dkapexhiu
Feb 24 2018 22:15
it doesnt return the correct icon for categories
alpox
@alpox
Feb 24 2018 22:15
@thekholm80 Hmm if you set it up right, just pushing to heroku should be enough :D maybe you need a production build first
Kyle Holm
@thekholm80
Feb 24 2018 22:16
i do need to build it first
and then test the built version
alpox
@alpox
Feb 24 2018 22:16
@dkapexhiu What would be an example category?
@thekholm80 :thumbsup:
Daniel
@dkapexhiu
Feb 24 2018 22:19
an example would be 'home'
alpox
@alpox
Feb 24 2018 22:22
@dkapexhiu Well there is no home entry in the icons object
Daniel
@dkapexhiu
Feb 24 2018 22:39
excuse me, the categories will be shtepi and biznese
Kyle Holm
@thekholm80
Feb 24 2018 22:45
image.png
oh heroku you crazy
alpox
@alpox
Feb 24 2018 22:59
@thekholm80 yea i think you didn't mean to create, i think you meant create
:clap:
Kyle Holm
@thekholm80
Feb 24 2018 22:59
lol
well, it's ugly but it's done
and it mostly works, too lol
alpox
@alpox
Feb 24 2018 23:00
Hmm
Is the search supposed to do something? :D
Kyle Holm
@thekholm80
Feb 24 2018 23:00
why would i have cors errors?
ugh, i hate everything
alpox
@alpox
Feb 24 2018 23:01
Did you set the origin only to localhost?
And forgot to set it for https://thekholm80-nightlife.herokuapp.com/ too? :D
Kyle Holm
@thekholm80
Feb 24 2018 23:01
i removed all of that before i deployed
alpox
@alpox
Feb 24 2018 23:01
@thekholm80 Request URL:http://localhost:3000/api
I don't think you can request localhost :D
Kyle Holm
@thekholm80
Feb 24 2018 23:02
i quit
lol
alpox
@alpox
Feb 24 2018 23:02
@thekholm80 Nooo stay heere! :D that can happen ;)
Kyle Holm
@thekholm80
Feb 24 2018 23:03
i can't believe i didn't update that, now i have to rebuild my front end and try to remember how to force heroku to update when all i changed is the build
alpox
@alpox
Feb 24 2018 23:04
Don't forget to put the cors origin also for the url of heroku
Kyle Holm
@thekholm80
Feb 24 2018 23:04
shouldn't need that
alpox
@alpox
Feb 24 2018 23:05
Why is that?
Kyle Holm
@thekholm80
Feb 24 2018 23:05
same origin
alpox
@alpox
Feb 24 2018 23:05
Hmm when you're right you're right. Didn't think about that :D
Kyle Holm
@thekholm80
Feb 24 2018 23:08
okay, working now
alpox
@alpox
Feb 24 2018 23:16
@thekholm80 Yea nice, looks better now :D
But the layout does crap :D
Kyle Holm
@thekholm80
Feb 24 2018 23:16
@alpox i need to hire a UI designer
alpox
@alpox
Feb 24 2018 23:17
Haha i know that feeling :D
But frameworks can help making it look at least 0815 and not terrible :D
Kyle Holm
@thekholm80
Feb 24 2018 23:19
i start out with big ideas of how i want it to be, but by the end i'm just like "who cares, put the crap on the screen and get on with your life"
alpox
@alpox
Feb 24 2018 23:19
Yea i'm glad that at my new work there will be designers and i don't have to care
Except for doing what they want
Kyle Holm
@thekholm80
Feb 24 2018 23:20
that would be awesome. I can follow someone else's design, i'm sure. I just suck at making my own
i'd still rather do back end and forget about css altogether
alpox
@alpox
Feb 24 2018 23:21
I feel you :D
Altin Rrahmani
@DevKosov
Feb 24 2018 23:23
@thekholm80 :wave:
Kyle Holm
@thekholm80
Feb 24 2018 23:23
@DevKosov hey buddy
Altin Rrahmani
@DevKosov
Feb 24 2018 23:23
how are you kyle
Kyle Holm
@thekholm80
Feb 24 2018 23:24
i'm good, you?
Altin Rrahmani
@DevKosov
Feb 24 2018 23:24
doing fine
just took a brake for like 3 days
Kyle Holm
@thekholm80
Feb 24 2018 23:24
oh nice
what was it you were learning? laravel? or django?
my memory sucks
Altin Rrahmani
@DevKosov
Feb 24 2018 23:25
drupal
Kyle Holm
@thekholm80
Feb 24 2018 23:25
oh right
you headed back to that, then?
Altin Rrahmani
@DevKosov
Feb 24 2018 23:26
yep
Kyle Holm
@thekholm80
Feb 24 2018 23:26
gonna build something cool?
Altin Rrahmani
@DevKosov
Feb 24 2018 23:26
its... yeah..
i hope
i am still learning it
Kyle Holm
@thekholm80
Feb 24 2018 23:26
i'm sure you'll do great
Altin Rrahmani
@DevKosov
Feb 24 2018 23:26
0.0002% progress atm
lol
Kyle Holm
@thekholm80
Feb 24 2018 23:27
i think i'm going to try this next
Altin Rrahmani
@DevKosov
Feb 24 2018 23:29
nice
Kyle Holm
@thekholm80
Feb 24 2018 23:29
i've never used a lot of the libraries he's using, might be fun
Altin Rrahmani
@DevKosov
Feb 24 2018 23:31
Gl buddy
Kyle Holm
@thekholm80
Feb 24 2018 23:31
hey thanks