These are chat archives for FreeCodeCamp/Help

25th
Nov 2017
Adel
@AdelMahjoub
Nov 25 2017 00:00
so I can escort you on board, express are known for high speed but are not stable on rails
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:01
something is missing in the Ajax get request, I think.
Adel
@AdelMahjoub
Nov 25 2017 00:01
@josealonso the motor button is making an ajax request
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:02
@AdelMahjoub, I know, but there's no refresh whatsoever
Adel
@AdelMahjoub
Nov 25 2017 00:03
@josealonso yes, that's the purpose of ajax requests, you need to handle the response in the success callback,
@josealonso that success callback in your jquery function
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:03
I looked into it in stackoverflow, but I don't know how to do it
Kyle Holm
@thekholm80
Nov 25 2017 00:04
it's been so long since i've used jquery
Adel
@AdelMahjoub
Nov 25 2017 00:04
@josealonso do you expect some data from that request or is it just a view
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:05
This is the repo: https://github.com/josealonso/KC-Modulo-de-Nodejs_Basico
it's just a view
Sorry the comments are not in English, but I'm sure you'll undrstand the code.
Adel
@AdelMahjoub
Nov 25 2017 00:06
@josealonso if it is a view then why making an ajax request
@josealonso a GET request should be ok, unless you want to turn your app into a jQuery spa
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:07
Because I need to fetch the tagged data from the db
It's a GET request, sorry I misenderstood you
Adel
@AdelMahjoub
Nov 25 2017 00:08
@josealonso which request handler for that route, you code in espagnol :smile:
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:08
It's in routes/index.js
There's only one route, very easy
Adel
@AdelMahjoub
Nov 25 2017 00:10
router.get('/', function(req, res, next) {
    Article.lista(req)
        .then((lista) => {
            console.log('                                 Reloading....');
            res.render('index', {
                title: 'Nodepop',
                site_description: 'Tu portal de compra-venta',
                articles: lista
            });
            if (lista.length === 0) {
                console.log('Ningún artículo coincide con los criterios de búsqueda');
            }
        })
        .catch((err) => {
            next(err);
            return;
        });
});
@josealonso the Article model is parsing the querystring ?
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:10
Yes, it's that one.
Yes, because I put traces in the server-side and I checked it out.
Adel
@AdelMahjoub
Nov 25 2017 00:12
@josealonso get rid of the ajax request and use a GET request, that request handler is returning what you need, if you want an ajax request, then you need to response with a json object then handle that object in the success callback of that jquery ajax request
@josealonso you already rendering lista in the view
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:15
Did you see the file public/javascripts/tags.js ??
Adel
@AdelMahjoub
Nov 25 2017 00:15
@josealonso you have to make a choice, jquery success callback, parse the json response and update the view or rendering the way you are doing now
yes
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:15
can I not keep it the way I have it now ??
Adel
@AdelMahjoub
Nov 25 2017 00:16
@josealonso no
@josealonso the way you have it now it is doing nothing
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:17
So, do I have to change the model ??
Adel
@AdelMahjoub
Nov 25 2017 00:17
@josealonso not the model, the request->response pattern
@josealonso your model is parsing the querystring
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:18
yes, and ??
Adel
@AdelMahjoub
Nov 25 2017 00:18
@josealonso so you are sending the tag in the GET request querystring
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:18
that's right
Adel
@AdelMahjoub
Nov 25 2017 00:18
@josealonso all what you have to do is transform that button into a link, an anchor tag
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:19
h ref, you mean ??
Adel
@AdelMahjoub
Nov 25 2017 00:20
yes href
or any way to make a GET request
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:22
but my button are already triggering a get request,aren't they ??
Adel
@AdelMahjoub
Nov 25 2017 00:22
@josealonso an xhr get request
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:22
Yes, wrapped in a jquery function
Adel
@AdelMahjoub
Nov 25 2017 00:22
@josealonso with that kind of request, the callback function must get some response to parse
@josealonso but you are not parsing anything in the success callback, so nothing happens
@josealonso and you are sending a text/html response
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:23
the success property of the object ?
Adel
@AdelMahjoub
Nov 25 2017 00:23
@josealonso yes
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:24
so why can I not refresh part of the page in the success handler ??
I thought that was the problem
Adel
@AdelMahjoub
Nov 25 2017 00:26
@josealonso try location.reload(true) in that success callback
@josealonso but you are not handling the problem correctly
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:26
You're saying that if I use a link, then I don't need to use ajax ??
Adel
@AdelMahjoub
Nov 25 2017 00:27
@josealonso of course, you are sending a text/html response in to that request
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:27
Do I need to use Ajax ??
Adel
@AdelMahjoub
Nov 25 2017 00:27
@josealonso no need
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:28
how do I communicate the client with the server, then ??
Kyle Holm
@thekholm80
Nov 25 2017 00:29
i'm a big fan of axios
so easy to work with
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:29
so a link is a way to communicate both sides !!
Ok, I think I got it, but....
something tells me it's not the best way to tacke that situation
Adel
@AdelMahjoub
Nov 25 2017 00:31
@josealonsoI have a question tho
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:31
tell me
Adel
@AdelMahjoub
Nov 25 2017 00:31
@josealonso who made that login system in your portfolio
@josealonso you can't don't know about this stuff if you wrote it
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:32
Iḿ taking an online course on web development
that login system is very simple
I'm not following the freecodecamp lessons
Adel
@AdelMahjoub
Nov 25 2017 00:33
@josealonso and the react app, you can't don't know how ajax request works and built a react app
@josealonso and using react router
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:34
No, I just took a course on Angular 4
I don't know React !!
Adel
@AdelMahjoub
Nov 25 2017 00:34
@josealonso that about me page is a react app
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:35
which one ??
Adel
@AdelMahjoub
Nov 25 2017 00:35
@josealonso https://about.me/
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:36
that one !! Oh, it's an online service, just a template to put my stuff into
Anyone can have a profile in that web site
Adel
@AdelMahjoub
Nov 25 2017 00:37
@josealonso hmm, so you are not in the team or the owner of that service
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:37
Of course not
Adel
@AdelMahjoub
Nov 25 2017 00:37
@josealonso ok, I thought you are pretending being a beginner
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:37
why should I ??
Adel
@AdelMahjoub
Nov 25 2017 00:38
@josealonso who knows, social enginneers stuff
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:38
do you think I'm pretending something ??
No, I asked you about stuff I'm doing myself
although it's not a FCC project
Adel
@AdelMahjoub
Nov 25 2017 00:39
@josealonso it is ok, from that image you have and the links in your portfolio, I thought you were a social engineer with obscure motivations
@josealonso but no problem, an anchor tag with a href attribute will solve your problem
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:40
But didn't you know the about.me web service ???
Adel
@AdelMahjoub
Nov 25 2017 00:40
@josealonso nope
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:41
Is using an anchor the best way to do it ??
Adel
@AdelMahjoub
Nov 25 2017 00:41
@josealonso from the look of how you are handling requests, yes
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:42
May be I should put the filter out of the model
Adel
@AdelMahjoub
Nov 25 2017 00:42
@josealonso try location.reload(true) in the success callback if you want tok keep that ajax request
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:42
don't you think ??
Adel
@AdelMahjoub
Nov 25 2017 00:42
@josealonso yes, don't parse the request querystring in the model
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:43
It's that way just because the instructor had to explain the models in mongoose
Adel
@AdelMahjoub
Nov 25 2017 00:44
@josealonso hmm, why the instructor is doing that
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:44
But there's a problem with refreshing the whole page
Adel
@AdelMahjoub
Nov 25 2017 00:44
@josealonso use an anchor tag, and of course remove that click event listener
@josealonso or try location.reload(true).
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:45
Because the web master Im taking is supossed to be for total beginners
Adel
@AdelMahjoub
Nov 25 2017 00:45
@josealonso who is the instructor you are following
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:46
it's not an udemy-like course, but a guided one, with real instructors
and we have an schedule to follow
keepcoding, it's also in English, you can take a look
it's not free, though
Adel
@AdelMahjoub
Nov 25 2017 00:47
@josealonso I want to take a look at the course, because a beginner course have a big impact on beginners
@josealonso no problem, post the link
José Ramón Alonso Tapia
@josealonso
Nov 25 2017 00:47
let me look it up, one minute
Adel
@AdelMahjoub
Nov 25 2017 00:50
I have to go, I'll take a look at the link tomorrow, good night
Thanks, @AdelMahjoub, good night
CamperBot
@camperbot
Nov 25 2017 00:51
josealonso sends brownie points to @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 624 | @adelmahjoub |http://www.freecodecamp.org/adelmahjoub
Sam Goldberg
@sgoldber61
Nov 25 2017 01:20
I'm doing the node.js tutorial on cloud9, and I'm trying to install the through2-map package for one of the exercises in the tutorial. But npm install through2-map is giving me a ECONNREFUSED error.
avinassh
@avinassh
Nov 25 2017 02:44
Using JS, I am handling a POST request. The POST request is sent to some other site than the js script is installed. Say, I have site-1 and site-2. site-1 has a js which does post to site-2. Now, on site-2's server how do I make sure that the post requests are always from site-1, but not via using tools like postman or curl. Is that possible?
Stephen James
@sjames1958gm
Nov 25 2017 03:10
@avinassh If you are using node or something like express you can get the source of the request from the request object and check that.
Darren
@DarrenfJ
Nov 25 2017 04:59
evening fCC
Ken Haduch
@khaduch
Nov 25 2017 05:01
@DarrenfJ - howdy there - just about to get off the computer for the day... how was your Friday?
avinassh
@avinassh
Nov 25 2017 05:02
@sjames1958gm on server, I am using Python. So, is the source from request not possible to edit? basically I want the request from the site and from nowhere else (cURL, Postman) and I wanted to know if thats possible to ensure that.
Roger Xu
@sleepyxu
Nov 25 2017 05:34
hello

<style>
h2 {color: blue;}
</style>

<h2>我家的猫咪</h2>

<p>在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。</p>

Why the h2 didn't change to blue?
Can anybody help me?
Johnny
@JohnnyBizzel
Nov 25 2017 10:31
@sleepyxu style must go inside head tag
Stephen James
@sjames1958gm
Nov 25 2017 10:55
@avinassh I would assume that whatever python framework you are using has a "request" object that would have the source URL.
Adel
@AdelMahjoub
Nov 25 2017 12:17
@avinassh any http client could send the same headers as the browser send, even if all the requests are proxied from a gateway, in site-2 you are still not 100% sure from where the request come
Adel
@AdelMahjoub
Nov 25 2017 12:59
@avinassh postman default configuration send those two headers
postman-token': 'xxxxxx-xxxx-',
  'user-agent': 'PostmanRuntime/x.x.x'
Albert Cardona II
@daddycardona
Nov 25 2017 15:22
@DarrenfJ LOL yes just mulch it, man..
@khaduch thanks I will look into that when I get a job I can't afford simple stuff right now lol good news is I have an appointment on Tuesday about that school I was talking about. :)
CamperBot
@camperbot
Nov 25 2017 15:24
daddycardona sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3527 | @khaduch |http://www.freecodecamp.org/khaduch
Darren
@DarrenfJ
Nov 25 2017 17:06
morning fCC
Kyle Holm
@thekholm80
Nov 25 2017 17:06
@DarrenfJ :wave:
Darren
@DarrenfJ
Nov 25 2017 17:06
poppin' in to say hi before :coffee: and podcasts..
hi @thekholm80
@khaduch sorry i missed yah.. Friday was good.. excited about the announcement that beta is pushing for live end of Dec...
exciting
anyhoooo.. will pop in later to say hi.. just @me if anyone needs help.. :D
artbohr
@artbohr
Nov 25 2017 17:17
@DarrenfJ hey there
Ken Haduch
@khaduch
Nov 25 2017 18:04
@DarrenfJ - howdy Darren - just going about a busy saturday here, going out to do some errands... Hope that you have a good day! I took a look at the open issues, and it seems that the main ones that are there are the ones where things are not running without clearing the browser temporary files or reinitializing... stuff that might not even have a solution? But it will be interesting to see the new syllabus...
Darren
@DarrenfJ
Nov 25 2017 18:04
@artbohr hey buddy.. what up?
@khaduch Quincy's post was all about having a technical breakthrough so maybe it relates to that...
have a fun day
thanks @khaduch for popping in :D
CamperBot
@camperbot
Nov 25 2017 18:05
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3529 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
Nov 25 2017 18:06
@daddycardona - the Udemy courses are $10 this weekend (and they regularly run sales and special offers once you are signed up.) Not that I'm pushing them, or endorsing them over any other providers of courses. Just if you are interested you can get bargain prices on the courses.
Darren
@DarrenfJ
Nov 25 2017 18:06
podcast; replyAll # 53 about wifi and cell phone triangulation.. not technical (replyAll is never really technical) but a good listen
off for the next one :D
Ken Haduch
@khaduch
Nov 25 2017 18:12
@DarrenfJ - thanks for the podcast recommendation - I might give it a listen and see if I should add it to the list of regular podcasts to check out
CamperBot
@camperbot
Nov 25 2017 18:12
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2288 | @darrenfj |http://www.freecodecamp.org/darrenfj
rana-ej
@rana-ej
Nov 25 2017 19:33
Hi everyone. I have a problem with the FCC and I wonder if anyone else has experienced this or has a solution for it. Basically all my solutions for the "Intermediate Algorithm Scripting" has disappeared. On the MAP section it is shown that I have passed these challenges, but my solutions have disappeared. I would really appreciate any help to get back my solutions.
Darren
@DarrenfJ
Nov 25 2017 20:12
@rana-ej are you clicking through to them via the profile page?
note that some of the really old exercises no longer are around so the solutions links don't show anything
@rana-ej on this page.. clicking the 'view solution' on the right should bring up the code
@khaduch i like replyAll since it covers the sort of social and cultural implications of software, the internet, computers etc...
rana-ej
@rana-ej
Nov 25 2017 20:16
@DarrenfJ Thank you for your suggestion. Clicking on the solutions from the profile page shows the solutions, but on the MAP the solutions are not shown. They start showing up after I click through the profile though! This is really strange.
CamperBot
@camperbot
Nov 25 2017 20:16
rana-ej sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2289 | @darrenfj |http://www.freecodecamp.org/darrenfj
Darren
@DarrenfJ
Nov 25 2017 20:17
by really old above I mean anything like when fCC used to link to Standford online classes and Coursera, Udacity and Codecademy
@rana-ej welp, could be you cleared you browser cache? in anycase, they have kept the solutions in the db for you.. so worst case you just have to go and resubmit...
but note that only the things with an * beside them count for the certs... so algo challenges and projects..
rana-ej
@rana-ej
Nov 25 2017 20:19
I have started with FCC a couple of months ago only. Thanks for the suggestion, I will click through them and also from now on I will keep a copy of my solutions in case I lose my progress.
Darren
@DarrenfJ
Nov 25 2017 20:52
just thought of this.. some people log out when they clean their browser and can;t remember if they logged in via GitHub or email etc etc and end up logged in with a dual id.. used to be some stuff on the forum on it a while back but haven;t heard it happening lately...
Jonathan Erel
@joni7777
Nov 25 2017 20:55
Hey, im trying to start docker-compose for local freeCodeCamp and im getting error in the chrome of MIME TYPE instead of Javascript
image.png
anyone knows this issue?
same issue happend when i runned it locally with npm start
rana-ej
@rana-ej
Nov 25 2017 21:05
@DarrenfJ Aren't the ids linked together? If not, how should someone find out if they have dual ids and which one is the original id?
gishy1
@gishy1
Nov 25 2017 21:08
@DarrenfJ this is giving me an infinite loop with the for loop have a look
image.png
Jonathan Erel
@joni7777
Nov 25 2017 21:36
please help!
Kyle Holm
@thekholm80
Nov 25 2017 21:36
Jonathan Erel
@joni7777
Nov 25 2017 21:50
ill try thanks
Stephen James
@sjames1958gm
Nov 25 2017 22:14
i + size doesn't change i
@gishy1 As a suggestion - Array is a javascript global - so probably not a good idea to use it as a variable