These are chat archives for FreeCodeCamp/Help

9th
Nov 2017
artbohr
@artbohr
Nov 09 2017 01:44
Hello everyone. Does anyone know how to deploy a react project using the master branch instead of ghpages branch? because I read It's not neccesary anymore to create this extra branch "ghpages", I'm using create-react-app as a boilerplate
zootechdrum
@zootechdrum
Nov 09 2017 02:26

Hey, guys I am having trouble reading this code. My main problem with this code is I don't understand (arrayOne, arrayTwo) on the symDiff function. I understand that in the beginning
the function below makes args([[1, 2, 3], [5, 2, 1, 4]]);

function sym() {
    var args = [];
    for (var i = 0; i < arguments.length; i++) {
        args.push(arguments[i]);
    }

I also understand("at least I think") that the code below calls symDiff as its callback thus giving the two values that it needs. I am wondering how ([[1, 2, 3], [5, 2, 1, 4]]); is passed in as array one,arrayTwo in the symDiff function. How does it now weather its arrayOne or arrayTwo & isn't it just one argument

 return args.reduce(symDiff);

Below is freecodecamps actually solution to the symmetric difference problem

function sym() {
    var args = [];
    for (var i = 0; i < arguments.length; i++) {
        args.push(arguments[i]);
    }

    function symDiff(arrayOne, arrayTwo) {
        var result = [];

        arrayOne.forEach(function(item) {
            if (arrayTwo.indexOf(item) < 0 && result.indexOf(item) < 0) {
                result.push(item);
            }
        });

        arrayTwo.forEach(function(item) {
            if (arrayOne.indexOf(item) < 0 && result.indexOf(item) < 0) {
                result.push(item);
            }
        });

        return result;
    }

    // Apply reduce method to args array, using the symDiff function
    return args.reduce(symDiff);
korzo
@korzo
Nov 09 2017 02:32
@zootechdrum callback for reduce will always get 4 parameters.
accumulator, current element, index, whole array
@zootechdrum as you don't add parameter for initial value for reduce, accumulator will be first array and second array will be current element
Darren
@DarrenfJ
Nov 09 2017 02:34
@sjames1958gm oh yah... back
korzo
@korzo
Nov 09 2017 02:35
@zootechdrum so you can translate it as
return symDiff([1, 2, 3], [5, 2, 1, 4])
Darren
@DarrenfJ
Nov 09 2017 02:35
also.. evening fCC.. hope the code is going well
korzo
@korzo
Nov 09 2017 02:36
@DarrenfJ Hi
Darren
@DarrenfJ
Nov 09 2017 02:36
@korzo hey buddy :D
Ken Haduch
@khaduch
Nov 09 2017 02:42
@DarrenfJ - hey there, what's up?
Darren
@DarrenfJ
Nov 09 2017 02:42
@artbohr yah I read something recently about not needing the ghpages branch anymore.. actually I htink it was their main help article on using github to create webpages
@khaduch ah just hanging out.. you?
Ken Haduch
@khaduch
Nov 09 2017 02:43
I was just looking at the forum discussion about the "demotion" of the chat rooms... and thinking about what to do - maybe more React udemy lessons...
Claudio Restifo
@Marmiz
Nov 09 2017 02:44

@artbohr Haven't used github pages in a while, but the gh-pages branch is a "special" generated branch that should not affect your git anyway.

I remember using this script last time I published it to automate it directly from the CLI:
https://www.npmjs.com/package/gh-pages

Darren
@DarrenfJ
Nov 09 2017 02:45
@artbohr somewhere in the settings you can tag the master branch as github pages wihtout creating the gh branch anymore
off for :coffee:
code on roomies
korzo
@korzo
Nov 09 2017 02:46
@khaduch Could you post link to forum thread about "demotion" ?
Darren
@DarrenfJ
Nov 09 2017 02:46
@khaduch yah, that's old news though.. they got rid of the help link about 3 or so months ago
korzo
@korzo
Nov 09 2017 02:46
@DarrenfJ but link is back now
Ken Haduch
@khaduch
Nov 09 2017 02:47
@DarrenfJ @korzo - I was just pointed to it in the discussions of the past 24 hours with the spamming, forum usage, chat usage, etc. It is an old post, but here it is
@korzo - they have an "Ask for help on the forum" link, but not the chat room link, unless you go into your account settings, under actions there is "chat with other campers in real time" that gets you started on the gitter rooms.
zootechdrum
@zootechdrum
Nov 09 2017 03:03
@korzo I understand with two but how would it interpret ([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])
@korzo thanks for the reply
CamperBot
@camperbot
Nov 09 2017 03:03
zootechdrum sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 757 | @korzo |http://www.freecodecamp.com/korzo
korzo
@korzo
Nov 09 2017 03:05
@zootechdrum
return symDiff(symDiff([1, 1, 2, 5], [2, 2, 3, 5]), [3, 4, 5, 5]);
zootechdrum
@zootechdrum
Nov 09 2017 03:06
@korzo so what is arrayOne and arrayTwo
korzo
@korzo
Nov 09 2017 03:06
@zootechdrum at first it calls symDiff with first and second argument.
then it calls symDiff with result of first call and third argument
@zootechdrum accumulator holds returned value from previous callback call
at first call of callback function accumulator is either initial value passed to reduce as parameter or first element of array @zootechdrum
zootechdrum
@zootechdrum
Nov 09 2017 03:10
([[1,2,3],[2,2,3,5],[3,4,5,5]] so in the first call back it passes [1,2,3] and [2,2,3,5] as the two arguments
korzo
@korzo
Nov 09 2017 03:11
var result = symDiff([1, 1, 2, 5], [2, 2, 3, 5]);
return symDiff(result , [3, 4, 5, 5]);
more readable version @zootechdrum
zootechdrum
@zootechdrum
Nov 09 2017 03:12
and then the return of that array of the first call back is then passed back in as the first argument and then passes the third argument as the second argument in symDiff
korzo
@korzo
Nov 09 2017 03:12
@zootechdrum yes
at first call
[1,2,3] is accumulator (arrayOne)
[2,2,3,5] is current element (arrayTwo)
zootechdrum
@zootechdrum
Nov 09 2017 03:13
@korzo interesting. I don't think I would have ever figured that out without asking
lol thanks
@korzo appreciate it
korzo
@korzo
Nov 09 2017 03:14
@zootechdrum glad to help
@khaduch yeah, I saw the conversation and got warning also :)
It's a shame, chat is more suitable for quick help than forum
artbohr
@artbohr
Nov 09 2017 05:13
@Marmiz @DarrenfJ I meant this part in the package.json "deploy" : "npm run build&&gh-pages -d build" that's the usual thing that is done, so I was curious if there where a way to deploying directly to master branch using or not using the ghpages plugin, so currently I only know how to do it by this way (deploying to ghpages branch which is created automaticly)
Claudio Restifo
@Marmiz
Nov 09 2017 05:15
@artbohr oh yeah, the plugin is there to help you make some process automatic... but you can still do it the "manual" way via CLI.
refer to the official doc if you want more info:
https://pages.github.com/
Darren
@DarrenfJ
Nov 09 2017 06:40
@artbohr sorry brutha. I stepped away then didn't come back
@khaduch oh yah i think i commented on that a while back my comments but i mean.. it is what it is
you know, hang out, help people, thank them on a one on one basis
Nehemiah Kivelevitz
@NehemiahK
Nov 09 2017 08:17
hey is this valid
 var caps = /\[A-Z]/g ;
if (str.charAt(i)== caps)
Garrus Napp
@GarrusNapp
Nov 09 2017 08:44
@NehemiahK no, I dont think so
@NehemiahK use str.match(regexp)
Jill Lee
@jill-lee
Nov 09 2017 08:45
@NeelDVirus Thanks Neel :)
CamperBot
@camperbot
Nov 09 2017 08:45
phoenix-burn sends brownie points to @neeldvirus :sparkles: :thumbsup: :sparkles:
:cookie: 254 | @neeldvirus |http://www.freecodecamp.com/neeldvirus
Garrus Napp
@GarrusNapp
Nov 09 2017 08:46
@NehemiahK or rather if you want true/false regExp.test(str)
Jill Lee
@jill-lee
Nov 09 2017 08:48
Can anyone help me make the footer full width?
https://codepen.io/phoenix-burn/full/yPYrbY/
korzo
@korzo
Nov 09 2017 08:52
@phoenix-burn put it out of main .container
@phoenix-burn the same with copyright
Jill Lee
@jill-lee
Nov 09 2017 09:14
@korzo thanks I'll try that
@korzo thanks
CamperBot
@camperbot
Nov 09 2017 09:14
phoenix-burn sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 759 | @korzo |http://www.freecodecamp.com/korzo
Jill Lee
@jill-lee
Nov 09 2017 09:20
@korzo it didnt work :(
korzo
@korzo
Nov 09 2017 09:20
@phoenix-burn is your code pen updated?
Jill Lee
@jill-lee
Nov 09 2017 09:23
I think so
korzo
@korzo
Nov 09 2017 09:26
@phoenix-burn footer is still inside .container
I forked your pen and it works, but something happened with css :(
oh, I removed <head> tag, that's what happened :)
Jill Lee
@jill-lee
Nov 09 2017 09:29
On my homepage is perfect on the necklace page the footer just wont cover it all. https://codepen.io/phoenix-burn/pen/VzWOpa
Yep it worked just need to fix the fonts
korzo
@korzo
Nov 09 2017 09:30
@phoenix-burn looks like you have missing closing div somewhere
Jill Lee
@jill-lee
Nov 09 2017 09:30
@korzo thanks :D
CamperBot
@camperbot
Nov 09 2017 09:30
phoenix-burn sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
api offline
korzo
@korzo
Nov 09 2017 09:30
I added </div> before footer and now it works
https://codepen.io/korzo/pen/JOERWz?editors=1000
korzo
@korzo
Nov 09 2017 09:40
@phoenix-burn you have more missing elements there. Try to validate it https://validator.w3.org/
Simon Sardorf
@SSardorf
Nov 09 2017 10:32
Hey guys! I'm looking for a website where I can collaborate with some friends on a HTML project. (Realtime coding etc). Are there any ideas on where I could find such a thing? :)
I realize codepen has collaborative coding, but we're really not in a position to pay for such a thing right now :/
Noel Mathews
@nms2195
Nov 09 2017 10:49
@SSardorf - bitbucket/github/tortoise svn? commit and update scripts among ur friends..
heroiczero
@heroiczero
Nov 09 2017 12:18
@SSardorf you could also try JSfiddle
Ken Haduch
@khaduch
Nov 09 2017 12:27
@SSardorf - also check out jsbin.com
Albert Cardona II
@daddycardona
Nov 09 2017 15:18
hello yall I was just about to suggest jsfiddle lol
Ken Haduch
@khaduch
Nov 09 2017 15:23
@daddycardona - hello Albert... how are you doing?
Albert Cardona II
@daddycardona
Nov 09 2017 15:24
I am good about to go to a meetup in rhode island because the one in worcester doesn't meet up anymore lol
how you doing ?
Kyle Holm
@thekholm80
Nov 09 2017 15:25
@daddycardona :wave:
Albert Cardona II
@daddycardona
Nov 09 2017 15:26
what up kyle :)
Kyle Holm
@thekholm80
Nov 09 2017 15:26
i need to find a better caffeine delivery system, coffee is too slow
Albert Cardona II
@daddycardona
Nov 09 2017 15:32
LMAO you can always use a IV filled with caffine liquid directly to your veins lmao @thekholm80
Kyle Holm
@thekholm80
Nov 09 2017 15:32
you may be onto something there
Kaz Baig
@kbaig
Nov 09 2017 15:34
@thekholm80 caffeine pills are cheaper and stronger than coffee
Ken Haduch
@khaduch
Nov 09 2017 15:37

@daddycardona - I went to the FCC meetup in Framingham this past Saturday. Kind of a last-minute venture (adventure) because I didn't know it was going on until I saw a notice on facebook Saturday morning. THere were only 4 of us there, but it was nice to see some faces of people. Look for "Freecodecamp Metrowest" on meetup if you want to investigate.

Have a great time at the meetup - is it freecodecamp related?

Kaz Baig
@kbaig
Nov 09 2017 15:38
@khaduch Framingham MA?
Albert Cardona II
@daddycardona
Nov 09 2017 15:39
Yes it is FCC related @khaduch and man if I liked driving to Framingham I would be okay with it I hate driving that way. I don't even like RI lol but its easier and faster to go there :)
yes @kbaig
we both from Massachusetts :)
Kaz Baig
@kbaig
Nov 09 2017 15:39
I went to BU so I considered going but it's just so far if you don't drive
or want to take commuter rail
Albert Cardona II
@daddycardona
Nov 09 2017 15:40
yes it is and BU haves everything around it lol
Kaz Baig
@kbaig
Nov 09 2017 15:41
Yeah couldn't find a good beginner community at the time tho
Stephen James
@sjames1958gm
Nov 09 2017 15:43
@thekholm80 There is always the "energy" gum that the military uses, you can get the same (or similar) from Amazon.
Albert Cardona II
@daddycardona
Nov 09 2017 15:45
I never used energy gum when I was in lol
Kyle Holm
@thekholm80
Nov 09 2017 15:45
@sjames1958gm that sounds frightening
Ken Haduch
@khaduch
Nov 09 2017 15:45
@kbaig - yes, Framingham, MA . And @daddycardona - it meets on Saturday afternoon, so the traffic wasn't a problem (although there isn't really a good way to get there...)
Albert Cardona II
@daddycardona
Nov 09 2017 15:46
LOL well I might have to go but just not this saturday it is veterans day and me and my boy are going restaurant hopping for free food :)
Ken Haduch
@khaduch
Nov 09 2017 15:46
@kbaig - you are in Illinois now? So that would be a long commute...
Stephen James
@sjames1958gm
Nov 09 2017 15:46
@daddycardona :)
Kaz Baig
@kbaig
Nov 09 2017 15:46
@khaduch Haha it would indeed. Moved here for my first job
Albert Cardona II
@daddycardona
Nov 09 2017 15:47
so where you from @kbaig we know you live in Illinois and went to BU
so New Hampshire lol
Ken Haduch
@khaduch
Nov 09 2017 15:48

@daddycardona - they only meet the first SAturday of the month anyway, so not a huge commitment as far as the days. Pretty low key, too, but it would be nice just to see faces of fellow fCC-ers.

Have a great Veteran's day, too - thanks for your service, and I hope you get some great food! You deserve it!

CamperBot
@camperbot
Nov 09 2017 15:48
khaduch sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 483 | @daddycardona |http://www.freecodecamp.com/daddycardona
Albert Cardona II
@daddycardona
Nov 09 2017 15:51
thanks @khaduch I will enjoy it lol :) I really do hate traveling to boston but I am probably going to dorchester tonight to get my children for tomorrow
CamperBot
@camperbot
Nov 09 2017 15:51
daddycardona sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3486 | @khaduch |http://www.freecodecamp.com/khaduch
Daniel
@dkapexhiu
Nov 09 2017 15:52
hi! when i open modals in website which are triggered by a link the page goes at the top at the page and when i close the modal it returns back to the section i was. how to solve this issue?
Ken Haduch
@khaduch
Nov 09 2017 15:52
@daddycardona :+1:
Daniel
@dkapexhiu
Nov 09 2017 15:52
i have this script for smooth scrolling:
$(document).on("click", "a", function() {
if ($(this).attr('href') !== '#home') {
$("html, body").animate({
scrollTop: $($.attr(this, "href")).offset().top - 60
},800);
} else {
$("html, body").animate({
scrollTop: 0
},800);
}
});
Kaz Baig
@kbaig
Nov 09 2017 15:53
@daddycardona I'm actually from Pakistan lol. Came here to go to BU, working for a year on my student visa while the company tries to sponsor me
Albert Cardona II
@daddycardona
Nov 09 2017 15:53
i actually met like 6 people from pakistan
Darren
@DarrenfJ
Nov 09 2017 15:53
morning fCC
Ken Haduch
@khaduch
Nov 09 2017 15:53
@dkapexhiu - if you are just linking to a new page you are probably reloading the page when you click on the link? That's just a guess, though, without seeing the page.
Albert Cardona II
@daddycardona
Nov 09 2017 15:53
now 7
Kyle Holm
@thekholm80
Nov 09 2017 15:53
@DarrenfJ :wave:
Ken Haduch
@khaduch
Nov 09 2017 15:54
@DarrenfJ - good morning my friend... how are you today...
Albert Cardona II
@daddycardona
Nov 09 2017 15:54
@DarrenfJ you're back remember no thanking everyone I almost got banned for that too lol
I didn't even understand why they were mad at me I was like what you mean wall lol
Darren
@DarrenfJ
Nov 09 2017 15:54
yah...
@khaduch oh yah i think i commented on that a while back my comments but i mean.. it is what it is
you know, hang out, help people, thank them on a one on one basis
CamperBot
@camperbot
Nov 09 2017 15:54
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3487 | @khaduch |http://www.freecodecamp.com/khaduch
Darren
@DarrenfJ
Nov 09 2017 15:55
ooops. that was accidental lol!
Albert Cardona II
@daddycardona
Nov 09 2017 15:55
ahh snap see you next week lmao
Darren
@DarrenfJ
Nov 09 2017 15:55
but thanks for the hi's.. will probably thank each one of you separately within 15 minute increments so as not to distract all the people asking for help in here ;)
Daniel
@dkapexhiu
Nov 09 2017 15:56
@khaduch maybe but i have triggered a modal when clicking on the link:
<a data-toggle="modal" href="#star-wars">Star Wars: The Last Jedi</a>
mstellaluna
@mstellaluna
Nov 09 2017 15:56
@DarrenfJ thank you .. now you get the point
CamperBot
@camperbot
Nov 09 2017 15:56
mstellaluna sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2264 | @darrenfj |http://www.freecodecamp.com/darrenfj
Albert Cardona II
@daddycardona
Nov 09 2017 15:56
what exactly did you want it to do @dkapexhiu
who was it that told me try mongoDB? was that you @DarrenfJ
Kyle Holm
@thekholm80
Nov 09 2017 15:58
I <3 mongodb
now when i look at SQL it makes me feel kind of sick
Ken Haduch
@khaduch
Nov 09 2017 15:58
@DarrenfJ - I won't hold it against you, but I'm not a moderator or any person of power and influence... :)
Daniel
@dkapexhiu
Nov 09 2017 15:59
i have put together the link with the modal.. but when i open the modal from a link it goes to the top an when i close it , it goes to the section i was before opening the modal @daddycardona
Darren
@DarrenfJ
Nov 09 2017 15:59
i've done a little with it.. what i like about it is that they deal with data the way it is rather than trying to fit it into rigid tables... where i work they are jut trying to integrate noSQL concepts into how they work.. but the health sector still sends stuff more or less in XML and not JSON
Ken Haduch
@khaduch
Nov 09 2017 16:00
@dkapexhiu - do you have this in a codepen that you can give a link, or are you working locally?
Kyle Holm
@thekholm80
Nov 09 2017 16:00
a lot of the companies I work with are switching to JSON from XML, it's made my life so much easier
Darren
@DarrenfJ
Nov 09 2017 16:00
i know cause i think in JSON more than XML at least now after so much fCC
Kyle Holm
@thekholm80
Nov 09 2017 16:01
it's so much easier to parse
Albert Cardona II
@daddycardona
Nov 09 2017 16:01
Oh so yes I was hoping I could help you @dkapexhiu but I have no idea how to use modals yet sorry bos
boss
I feel that xml is easy but you need so much tags to really work it out properly and JSON makes it easier to read but I about to go to RI for a meetup ;)
peace brothers :)
Kyle Holm
@thekholm80
Nov 09 2017 16:03
@daddycardona give 'em hell
Darren
@DarrenfJ
Nov 09 2017 16:04
@daddycardona peace back atcha and thanks for the chat
CamperBot
@camperbot
Nov 09 2017 16:04
darrenfj sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 484 | @daddycardona |http://www.freecodecamp.com/daddycardona
Darren
@DarrenfJ
Nov 09 2017 16:04
i'm off to a meeting too.. stand-up for our rollouts to NYC.. later helpRoomies
Ken Haduch
@khaduch
Nov 09 2017 16:05
@DarrenfJ - have a good meeting... see you around the chats later on...
Darren
@DarrenfJ
Nov 09 2017 16:05
keep helping despite the thanklessness of it all... you all 'rawk
now try to open in the movies section a movie
no problem @daddycardona
Ken Haduch
@khaduch
Nov 09 2017 16:15
@dkapexhiu - well, one interesting this is after I hit the "Close" button on the modal, I can still hear the audio. And I see your scrolling action.
alpox
@alpox
Nov 09 2017 16:16
Now i'm glad i didn't click there o.O sound in the lecture hall wouldn't have been fun :D
Daniel
@dkapexhiu
Nov 09 2017 16:18
@khaduch yes, that's another thing.. but i need more help for the scrolling
Ken Haduch
@khaduch
Nov 09 2017 16:20
@dkapexhiu - how about if you change the "links" for the moves to something else? Or do they have to be anchor tags? How about if you change your scrolling so that if your link contains a class that is something related to the modal or you can add a class, then don't scroll at all? Because as far as I can tell, if you are clicking on a link, your scroll is going to be activated.
or just make it check for one (all) of your internal links, as you are doing with #home?
or check if your anchor has the data-toggle attribute, and just don't scroll.
Daniel
@dkapexhiu
Nov 09 2017 16:25
how can i make a script to check if element has data-toggle attribut and don't scroll? @khaduch
Ken Haduch
@khaduch
Nov 09 2017 16:26

@dkapexhiu - I just added this line to the top:

$(document).on("click", "a",function() {    
    if ($(this).attr('data-toggle') === 'modal') return; // check for 'modal' and don't scroll

And it seems to work?

Daniel
@dkapexhiu
Nov 09 2017 16:29
yes, thanks very much @khaduch
CamperBot
@camperbot
Nov 09 2017 16:29
dkapexhiu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3488 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Nov 09 2017 16:30
@dkapexhiu - you're welcome
Emmanuel Akodia
@akodiaemma
Nov 09 2017 16:47
i need urgent help with an issue
can anyone help me please
http://mapenzi.ug/project/absolut-electrik-nights/index.html . the divs are not responding to my css and yet in another directory http://mapenzi.ug/project/heineken-house/index.html they are
please someone help me
Darren
@DarrenfJ
Nov 09 2017 16:56

@SSardorf when fCC started they recommended screenhero which allowed you to share screens and take ownership and actually code together

Hey guys! I'm looking for a website where I can collaborate with some friends on a HTML project. (Realtime coding etc). Are there any ideas on where I could find such a thing? :)

not sure if it's still a thing
@akodiaemma do you have a CodePen or something where someone can take a look at the CSS?
@SSardorf looks like slack bought them out: https://screenhero.com/
i remember it being awesome.. it was like you were both on one computer.. did many of the early algo challenges that way.. used to be a way to add their name when you checked it off as complete and they got credit too...
Kyle Holm
@thekholm80
Nov 09 2017 17:14
@DarrenfJ @SSardorf I think https://repl.it allows multiple people to remotely code together
Darren
@DarrenfJ
Nov 09 2017 17:17
@thekholm80 hey thanks for the link gonna go check it out
CamperBot
@camperbot
Nov 09 2017 17:17
:star2: 1590 | @thekholm80 |http://www.freecodecamp.com/thekholm80
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
Darren
@DarrenfJ
Nov 09 2017 17:21
that's kinda cool
Kyle Holm
@thekholm80
Nov 09 2017 17:21
I've not used it much, but it seems pretty nifty
Darren
@DarrenfJ
Nov 09 2017 17:21
definitely nifty
DarrenfJ @DarrenfJ sneaks off back to work
Darren
@DarrenfJ
Nov 09 2017 19:44
also forgot to post the P1xt's got her CSS challenge up now... http://speedrunchallenge.com/
DarrenfJ @DarrenfJ back to work
Kaz Baig
@kbaig
Nov 09 2017 20:32
Dat angular favicon tho
Pethaf
@Pethaf
Nov 09 2017 21:08
My big cat decided that we should be bedfellows.
Dylan
@dhcodes
Nov 09 2017 21:16
@kbaig my question re: async/await was about something not working but I think it's because my function had to be wrapped in a Promise which I was not aware was a necessity
Kaz Baig
@kbaig
Nov 09 2017 21:25
@dhcodes the async function needed to be resolved as a promise?
Or do you mean the value you were using await for needed to be a promise
Dylan
@dhcodes
Nov 09 2017 21:27
I was doing something like:
async function () {
  let a = await function1()
  let b = await function2(a)
  let c = await function3(b)
return c
}
@kbaig and it would skip my awaits and say undefined
alpox
@alpox
Nov 09 2017 21:28
@dhcodes yea. Async/await works through generators and promises. If you want to await a function, it has to return a peomise
Dylan
@dhcodes
Nov 09 2017 21:28
turns out I had to wrap each function (1, 2, 3) like:
function1() {
return new Promise(resolve => {
    request(url, function(err, response, body) {
      resolve(body);
    })
}
then it worked
alpox
@alpox
Nov 09 2017 21:29
@dhcodes go sure to handle errors
Dylan
@dhcodes
Nov 09 2017 21:29
@alpox well I have everything wrapped in try/catch
is that all I need to do?
alpox
@alpox
Nov 09 2017 21:30
@dhcodes hmm depends on where you want the error. Send it back to the client? How many levels does it have to travel out?
@dhcodes if you in your function1 as example dont use promise rejection, you would swallow the error and the promise returns undefined
A try/catch wouldnt be entered because there is no promise rejection and no exception raised
Kaz Baig
@kbaig
Nov 09 2017 21:32
@dhcodes so yeah you should be using your awaits on promises
Dylan
@dhcodes
Nov 09 2017 21:32
@alpox so add a line that is reject(err) or reject(console.log(err))
which is the working one...
alpox
@alpox
Nov 09 2017 21:33
@dhcodes if(err) reject(err)
Don't reject if there is no error :-)
Dylan
@dhcodes
Nov 09 2017 21:34
so put that before resolve?
alpox
@alpox
Nov 09 2017 21:34
@dhcodes Yep
Dylan
@dhcodes
Nov 09 2017 21:34
do you like async/await vs promises?
Kaz Baig
@kbaig
Nov 09 2017 21:34
async/await is bae
Dylan
@dhcodes
Nov 09 2017 21:34
isn't promises more performant?
Kaz Baig
@kbaig
Nov 09 2017 21:35
async/await is an abstraction over promises
alpox
@alpox
Nov 09 2017 21:35

@dhcodes Even though the promise would swallow the resolve after a reject, maybe best do:

if(err) return reject(err);
resolve(body);

(The return for that you go sure not to call resolve anymore.)
It doesn't really make a difference, but it makes things more clear

Kaz Baig
@kbaig
Nov 09 2017 21:35
so technically yes because you're using a generator as a wrapper over your async function, where otherwise it would be more 'vanilla' code
@alpox is an actual CS person so he'll correct me in a sec ;)
alpox
@alpox
Nov 09 2017 21:35
@dhcodes As @kbaig points out, async/await IS promises in the end.
It does nothing else than using generators to handle the control flow and wait for the promise to resolve
@kbaig No need to correct :-)
Kaz Baig
@kbaig
Nov 09 2017 21:36
woooo
alpox
@alpox
Nov 09 2017 21:36
You got it right ;-)
Kaz Baig
@kbaig
Nov 09 2017 21:36
haha
alpox
@alpox
Nov 09 2017 21:36
@kbaig They don't teach you promises in CS though :D
Dylan
@dhcodes
Nov 09 2017 21:36
how much performance is lost i wonder
Kaz Baig
@kbaig
Nov 09 2017 21:36
Yes but they do teach you to think about things like that
alpox
@alpox
Nov 09 2017 21:36
@dhcodes About 0
Dylan
@dhcodes
Nov 09 2017 21:36
@alpox are you a dev?
Kaz Baig
@kbaig
Nov 09 2017 21:36
I know how to look at financial statements really well haha
alpox
@alpox
Nov 09 2017 21:37
@dhcodes Ye
@kbaig Thats something i could use too sometime xD
Kaz Baig
@kbaig
Nov 09 2017 21:37
@dhcodes Not anywhere near enough to be worth trading away the readability/maintainability
@dhcodes oh yeah what specifically
Dylan
@dhcodes
Nov 09 2017 21:38
@alpox are you full-stack or something else? js?
alpox
@alpox
Nov 09 2017 21:38
@dhcodes Kinda everything
Kaz Baig
@kbaig
Nov 09 2017 21:39
I studied Finance (among a couple other things) but knew early on that I wanted the skills but not the job environment
Dylan
@dhcodes
Nov 09 2017 21:39
cool. I'll tag you when I have questions lol @alpox
Kaz Baig
@kbaig
Nov 09 2017 21:39
So I use the skills professionally now, but kinda privately in my own head
Dylan
@dhcodes
Nov 09 2017 21:39
I feel like such a newb writing programs that actually do stuff
alpox
@alpox
Nov 09 2017 21:39
Full-stack, data processing, databases, system architecture... about anything with development
Dylan
@dhcodes
Nov 09 2017 21:39
@kbaig that's cool, I would love to know how to read a balance sheet and value stocks/funds
it's on my "to-learn" list
alpox
@alpox
Nov 09 2017 21:40
@dhcodes Okay do that :D
Kaz Baig
@kbaig
Nov 09 2017 21:40
One good thing to know is that if you don't hate looking at numbers/excel sheets, a lot of finance is just insecure people coming up with complicated terms so that people feel intimidated
Dylan
@dhcodes
Nov 09 2017 21:40
I'm working on a bot for fcc and I feel like when I'm done people will be like... this code is not so good
@kbaig good point
alpox
@alpox
Nov 09 2017 21:41
@kbaig thats kinda what i felt about finance stuff :D
Dylan
@dhcodes
Nov 09 2017 21:41
I just finished reading Flash Boys and the Big Short and wow, lots of crazy stuff in that world
alpox
@alpox
Nov 09 2017 21:41
@dhcodes what kind of bot?
Dylan
@dhcodes
Nov 09 2017 21:42
repo bot for the guides to check for plagiarism
alpox
@alpox
Nov 09 2017 21:43
@dhcodes ah nice thing. How do you go for checking for plagiarism? Do you check only copy-paste or also logical similarity?
Or are there services for it
Dylan
@dhcodes
Nov 09 2017 21:44
@alpox I'm just doing copy/paste. There are services that cost
Kaz Baig
@kbaig
Nov 09 2017 21:44
@dhcodes The first step to learning to write good code is to write bad code :)
alpox
@alpox
Nov 09 2017 21:44
Ah okay
Dylan
@dhcodes
Nov 09 2017 21:44
I'm just going to use google or bing
Kaz Baig
@kbaig
Nov 09 2017 21:45
I'm sure you could find a free dataset to train a classifier for plagiarism though
alpox
@alpox
Nov 09 2017 21:45
@dhcodes lately at the Hackzurich event there were some great guys which used machine learning for finding which parts of news articles are taken from news agencies and which are freely imagined. I think ML could do a lot in this space
Kaz Baig
@kbaig
Nov 09 2017 21:46
You best believe that's what the big boys were doing
alpox
@alpox
Nov 09 2017 21:46
@kbaig its hard to find the features and create a classifier with it tho
Kaz Baig
@kbaig
Nov 09 2017 21:46
@alpox depends on how good of a job you're trying to do ;)
There's this startup from the UK (funded by Mark Cuban) that's trying to detect fake news called Factmata
alpox
@alpox
Nov 09 2017 21:46
Yea true :D always go for the best!
Dylan
@dhcodes
Nov 09 2017 21:47
@alpox for sure, I meant to see if tensor flow would do google search comparisons
Kaz Baig
@kbaig
Nov 09 2017 21:47
Or I could be okay with a 10% accuracy and use it in interviews to talk about what I would do next time hehe
alpox
@alpox
Nov 09 2017 21:47
@dhcodes tensor flow is only a barebones ML tool. I guess you would have to do such yourself :D
Kaz Baig
@kbaig
Nov 09 2017 21:47
I would always push for Mathematica ;)
alpox
@alpox
Nov 09 2017 21:47
@kbaig haha yea sure
Ill have to use sklearn now to train a neuronal network for classifying swiss sentences to dialect
I still wonder what features i shouls extract and what methods to use for classification
Kaz Baig
@kbaig
Nov 09 2017 21:49
I'm no NLP expert, I only know how to talk about our NLP tools :P
alpox
@alpox
Nov 09 2017 21:49
Im now thinking about vowel/consonant colocations with n-grams and maybe hidsen markov for word context
@kbaig have to sell them or what :D
Kaz Baig
@kbaig
Nov 09 2017 21:50
Not sell as much as try to get people to try
I'm not a salesperson :)
alpox
@alpox
Nov 09 2017 21:50
Aha thats almost like selling :D
Kaz Baig
@kbaig
Nov 09 2017 21:51
That's trying to figure out what people do like, what they don't like, what they would like to see, etc
That's part of the job anyway
alpox
@alpox
Nov 09 2017 21:52
Ah okay, so its a bit like requirements analysis/ feedback
Kaz Baig
@kbaig
Nov 09 2017 21:52
Sure but external facing and not a main focus
alpox
@alpox
Nov 09 2017 21:53
Sure :)
Dylan
@dhcodes
Nov 09 2017 21:55
I'll buy 20 of your widgets
alpox
@alpox
Nov 09 2017 21:59
@kbaig that gif fills my whole screen in the gitter chat :D
Kaz Baig
@kbaig
Nov 09 2017 21:59
@alpox are you on a phone?
alpox
@alpox
Nov 09 2017 22:00
@kbaig On the phone it doesn't show at all :D on my computer it does ;-)
Kaz Baig
@kbaig
Nov 09 2017 22:00
Hmm seems ok for me
alpox
@alpox
Nov 09 2017 22:01
:D
DSC_0447.JPG
I didn't know that gitter blows such stuff up like hell ^^
Kaz Baig
@kbaig
Nov 09 2017 22:02
Try extending both sidebars?
alpox
@alpox
Nov 09 2017 22:02
@kbaig Yea bit better :D i never have them out
Dylan
@dhcodes
Nov 09 2017 22:07
You can clcick the ... to the right of the post and collapse it
alpox
@alpox
Nov 09 2017 22:07
@dhcodes :thumbsup:
Dylan
@dhcodes
Nov 09 2017 22:10
alright, back to working on this
au revoir
Kaz Baig
@kbaig
Nov 09 2017 22:13
@dhcodes amuse-toi bien
Dylan
@dhcodes
Nov 09 2017 22:14
i'm not sure what that means but ty
Kaz Baig
@kbaig
Nov 09 2017 22:17
have fun
:)
@dhcodes
Kyle Holm
@thekholm80
Nov 09 2017 22:17
avez-vous le fun
Kaz Baig
@kbaig
Nov 09 2017 22:18
nice
Kyle Holm
@thekholm80
Nov 09 2017 22:18
french is easy lol
Kaz Baig
@kbaig
Nov 09 2017 22:18
gottem
Kyle Holm
@thekholm80
Nov 09 2017 22:18
just have to put le in front of the words you don't know
Kaz Baig
@kbaig
Nov 09 2017 22:19
like putting o at the end of words you don't know in spanish
or, on a case by case basis, ito
Kyle Holm
@thekholm80
Nov 09 2017 22:19
el in front and o at the end
el spanisho
Kaz Baig
@kbaig
Nov 09 2017 22:19
Yep you got it!
Kyle Holm
@thekholm80
Nov 09 2017 22:20
i'm embarrassed by how little I know of other languages, then i talk to so many people here who learned english as a second language and speak it better than me
in my next life i want to be a jawa and communicate in clicks and whistles
Kaz Baig
@kbaig
Nov 09 2017 22:22
I've had a very fortunate life getting to live in a few diff countries so don't let my silliness get to you :)
Kyle Holm
@thekholm80
Nov 09 2017 22:22
:smile: got nothing but respect for you
Kaz Baig
@kbaig
Nov 09 2017 22:22
<3
Dylan
@dhcodes
Nov 09 2017 22:23
@thekholm80 reminds me of when I learned (a little) italian, went to italy, everyone spoke to me in english
wait i was supposed to be working
stop distracting
Kyle Holm
@thekholm80
Nov 09 2017 22:24
@dhcodes i met someone who spent 2 years learning sweedish for a trip to sweden, nobody would talk to her in anything but english
she was sad
Dylan
@dhcodes
Nov 09 2017 22:25
lol ouch
last thing I'll say. You all should check out the firefox dev edition
pretty neat
Kyle Holm
@thekholm80
Nov 09 2017 22:26
get to work
slacker
Dylan
@dhcodes
Nov 09 2017 22:26
got me
that's a hot gottem
Kaz Baig
@kbaig
Nov 09 2017 22:30
Several people have told me that Parisiens hate when you speak to them in French so don't try that one
They snootily reply in English
Kyle Holm
@thekholm80
Nov 09 2017 22:30
I've heard that if you go to France just don't speak to the natives
I still want to go, though
Kaz Baig
@kbaig
Nov 09 2017 22:30
they're better outside Paris
I've only been to a couple towns in Normandy, and only spoke French there without feeling weird about it