These are chat archives for FreeCodeCamp/HelpJavaScript

28th
Aug 2018
Pagnito
@Pagnito
Aug 28 2018 00:41
hey i left a server running and changed the terminal adress but now i dont know how to kill the server i left open
Christopher McCormack
@cmccormack
Aug 28 2018 01:06
@Pagnito can you still view the process?
if so kill the process id
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:33
Hello Everyone.
JASON!!!!!!!!!!!! @JLuboff
Christopher McCormack
@cmccormack
Aug 28 2018 01:36
@RoniqueRicketts yo
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:36
@cmccormack Wazzup!!!!!
Christopher McCormack
@cmccormack
Aug 28 2018 01:36
Jason is probably at home now ignoring computers and playing with his kid
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:36
Haven't been here in a while.
@cmccormack Maybe. So whats popping?
Christopher McCormack
@cmccormack
Aug 28 2018 01:36
@RoniqueRicketts nm man studying up on some Linux and Systems engineering stuff
What about you?
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:37
@cmccormack Damn that sounds nerdy but cool. :) well I am here trying to figure out this some things. Hating this Jamaican heat.
Have you ever used Facebook for authentication with Passportjs?
Christopher McCormack
@cmccormack
Aug 28 2018 01:38
@RoniqueRicketts yup pretty nerdy but possibly useful for my career
No just twitter
I can't imagine it being much different though
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:38
@cmccormack Ya, I know it must be nice
@cmccormack Oh I wanted to know where on facebook to register this app so I can get my secret information.
Christopher McCormack
@cmccormack
Aug 28 2018 01:39
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:41
I was checking it out not got confused with all those other API
Christopher McCormack
@cmccormack
Aug 28 2018 01:42
My Apps > Add New App
probably
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:42
where where u saw that?
oooh dumb me
Christopher McCormack
@cmccormack
Aug 28 2018 01:43
That's how a few others do it too so I knew to go there first :)
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:48
First time messing with it
I’ve used username and password one and I learnt so much
Guys are you going to the free code camp hackathon? I am going through the information.
Christopher McCormack
@cmccormack
Aug 28 2018 01:50
In San Francisco?
@RoniqueRicketts oauth is so much easier
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:51
@cmccormack YES!! or ON freaking LINE
ONLINE
Christopher McCormack
@cmccormack
Aug 28 2018 01:51
oh that's pretty cool
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:51
@cmccormack really how so?
Christopher McCormack
@cmccormack
Aug 28 2018 01:52
@RoniqueRicketts you basically let the service do all the login password stuff and it just tells you if they are authorized or not
My twitter api code is like 1/10th my local code
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:52
@cmccormack nice
Christopher McCormack
@cmccormack
Aug 28 2018 01:52
@RoniqueRicketts attend sounds like a good time
You should go in person!
haha
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:53
Damn I don't have a US VISA or I'd go
Christopher McCormack
@cmccormack
Aug 28 2018 01:54
it's too expensive to go out there unless you stay outside the bay area and use a bus or whatever to get in
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:55
@cmccormack That's why I am glad its all online too. :)
Christopher McCormack
@cmccormack
Aug 28 2018 01:56
Yeah that would be kind of weak to host it there and not have others as well
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 01:57
Yeah. for shure!!! For that day I am upping my internet service :)
Christopher McCormack
@cmccormack
Aug 28 2018 01:58
you can do it by the day? neat
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 02:18
Yes I will just gonna write down the date and call my service provider on the day :)
Pagnito
@Pagnito
Aug 28 2018 04:36
trying to understand the deck GL arc layer and how the process that data into the arcs and then...


const f = data[toId];
hmm gotta love them great var names
Jefferson
@jeffersonnnn
Aug 28 2018 07:10
good morning (over hear, at least) guys
*here
Rogério Dalot
@Dalot
Aug 28 2018 08:52
@cmccormack Hey, do you have any experience with ionic or the MEAN stack in general?
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2018 10:35
gm everyone
alpox
@alpox
Aug 28 2018 11:34
@tiagocorreiaalmeida :wave.
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2018 11:39
hey how you doing? @alpox
alpox
@alpox
Aug 28 2018 11:48
@tiagocorreiaalmeida Working working :D and you?
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2018 11:50
pretty much the same ahha, don't you have holidays any time soon?
qjgetword
@qjgetword
Aug 28 2018 12:15
what!
help! how do write
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 13:03
@tiagocorreiaalmeida sup
alpox
@alpox
Aug 28 2018 13:12
@tiagocorreiaalmeida I don't have holidays :D I went straight from university to civil service
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2018 13:12
hey @RoniqueRicketts
ahahaha that sucks @alpox
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 13:13
@tiagocorreiaalmeida wazzup man?
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2018 13:14
leaving create-react-app behind and getting my hands back to webpack but things are starting to trhow errors that I can't understand pretty much that :D, how about you?
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 13:16
Umm. Stuck in a rot. I need a new environment. I wish you a clear understanding on those bugs :)
Nitin
@thenm
Aug 28 2018 14:05

Response from the API is

[
  {
    "count": 9,
    "status": "AllocationPending"
  },
  {
    "count": 2,
    "status": "Closed"
  },
  {
    "count": 3,
    "status": "InProcess"
  },
  {
    "count": 2,
    "status": "Spam"
  }
]

I want to format the response to

{
"AllocationPending": 9,
"Closed": 2,
"InProcess": 3,
"Spam": 2
}
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 14:11
Loop through the response and return just the status of each object. That’s how I’d do it.
Nitin
@thenm
Aug 28 2018 14:11
Got it.
var A = [
  {
    "count": 9,
    "status": "AllocationPending"
  },
  {
    "count": 2,
    "status": "Closed"
  },
  {
    "count": 3,
    "status": "InProcess"
  },
  {
    "count": 2,
    "status": "Spam"
  }
];

var B = {}
A.forEach(a => {
  B[a.status] = a.count
});
@RoniqueRicketts I needed the name of the status as well. Sweet and precise as i wanted. I was brain fogged for such simple looping. Not in mood to work . Thats what happens when are working against your will.
abraham anak agung
@padunk
Aug 28 2018 14:24
in case there is no count yet
A.forEach(a  => {
  B[a.status] = a.count || 0;
};
Nitin
@thenm
Aug 28 2018 14:30
@padunk yeah thanks
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 14:33
@thenm that’s ok. We all have those days.
Jason Luboff
@JLuboff
Aug 28 2018 15:12
@RoniqueRicketts Hey bud
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 15:17
What’s up man
Jason Luboff
@JLuboff
Aug 28 2018 15:18
Nothing much, just starting the grind for the day. You?
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 15:19
Same. Augh troubleshooting a printer and a person same time. Augh trust me it’s so easy to deal with machines than some humans!!
Jason Luboff
@JLuboff
Aug 28 2018 15:20
oh trust me, I know
I hate printers
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 15:38
Printer are ok
Humans from a particular country makes my job hard. They are so awful it make it hard to be nice to them.
Jason Luboff
@JLuboff
Aug 28 2018 15:43
I only have to deal with people in my company, but it can still be difficult :)
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 15:48
Damn
Nate Mallison
@NJM8
Aug 28 2018 15:51
export default function apiErrorHandler(error) {
import errorHandler from "@/helpers/apiErrorHandler";
Shouldn't that work?
oh
nvm
Jason Luboff
@JLuboff
Aug 28 2018 15:53
@NJM8 Glad I could help
Nate Mallison
@NJM8
Aug 28 2018 16:01
how's it going @JLuboff ?
are you a mac or PC?
Jason Luboff
@JLuboff
Aug 28 2018 16:04
@NJM8 Not too bad, yourself?
I am human
Nate Mallison
@NJM8
Aug 28 2018 16:05
doing well. I mean what platform you use
Christopher McCormack
@cmccormack
Aug 28 2018 16:06
ha
@NJM8 he's working on his MCSA if that tells you anything :)
Jason Luboff
@JLuboff
Aug 28 2018 16:07
Haha Ya I'm on Windows
Christopher McCormack
@cmccormack
Aug 28 2018 16:11
@NJM8 what is '@/ in your import statement? curious
Nate Mallison
@NJM8
Aug 28 2018 16:12
What's MCSA?
It's a helper I think from webpack to reference the root of your project directory
or whatever file you want to consider root
Christopher McCormack
@cmccormack
Aug 28 2018 16:13
ah neat
Microsoft Certified Solutions Associate
Jason Luboff
@JLuboff
Aug 28 2018 16:16
More like Microsft geek, am I right?
Christopher McCormack
@cmccormack
Aug 28 2018 16:18
yes you are correct :p
Jason Luboff
@JLuboff
Aug 28 2018 16:19
@cmccormack Whatre you working on today?
Christopher McCormack
@cmccormack
Aug 28 2018 16:20
Just drove down to the valley, working on little things, hoping to work with our vendor to setup some cool features on a new platform I'm working on
you?
Nate Mallison
@NJM8
Aug 28 2018 16:22
How is it using the terminal and node on windows? I had to get a new cpu for work as my old one was so slow, I'm a little tired of the apple tax, considering returning for a thinkpad or something. I generally dislike windows.
Jason Luboff
@JLuboff
Aug 28 2018 16:22
@cmccormack Lots of small things. Try to finish up the fixes on my conference room sign. Build up some computers. Setup a few peices of hardware for an individual. Etc
@NJM8 Works like a champ
When you install nodejs, it installs a node cmd (although you can use tyhe node commands in the regular cmd as well)
I also install git bash
So I can use git through cmd as well
Christopher McCormack
@cmccormack
Aug 28 2018 16:24
@NJM8 you can use WSL on windows, lowers the barrier a bit
Nate Mallison
@NJM8
Aug 28 2018 16:26
I'm going to guess you mean windows subsystem for linux not world surf league
I also really like PopOS, linux distro from System76, but not sure about needing to waste time sometimes getting wifi cards and crap to work correctly
Christopher McCormack
@cmccormack
Aug 28 2018 16:28
@NJM8 I compiled this for using WSL in windows with ZSH and Hyper terminal, maybe you'll be interested https://github.com/cmccormack/dotfiles/blob/master/ZSH_on_Win_10.md
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 16:30
@cmccormack Speak english!!
Nate Mallison
@NJM8
Aug 28 2018 16:31
nice! thanks
Christopher McCormack
@cmccormack
Aug 28 2018 16:32
@RoniqueRicketts I copied and improved upon some other guides for using a Linux like environment in Windows with a different shell and a neat terminal app
better?
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 16:33
@cmccormack Yes, :) I like when you all speak english. Remember kids are here. :)
Christopher McCormack
@cmccormack
Aug 28 2018 16:34
haha sorry
Maybe I'll add a section for VS Code too, you can change shells in VS Code so you aren't stuck using /shudder command prompt or powershell
Nate Mallison
@NJM8
Aug 28 2018 16:36
yeah that's what gives me the sweats when thinking about a windows machine. haha
should get like a 5th gen x1 carbon and put linux on it
Christopher McCormack
@cmccormack
Aug 28 2018 16:37
It's not so bad, I go back and forth between Windows Linux and MacOS every day and it gets easier every day between Windows and Mac because of all the cross-platform tools and improvements
Jason Luboff
@JLuboff
Aug 28 2018 16:38
Honestly...Windows isn't bad in the first place :)
Nate Mallison
@NJM8
Aug 28 2018 16:38
yeah, I hope that is the case. I sprung for the new MBP because my last one lasted me sooooo long. Never any problems. But it's been a week or two and the sticker shock hasn't worn off yet. haha
Christopher McCormack
@cmccormack
Aug 28 2018 16:39
What I really don't like about Windows current is how hard they made it to navigate the settings. Sure the old win 7 settings are still around but they are hidden
Nate Mallison
@NJM8
Aug 28 2018 16:39
macos isn't all that great either, it's just what I'm used to.
Christopher McCormack
@cmccormack
Aug 28 2018 16:39
yup Mac file system often bothers me
although I like how good sorting by columns is on Mac
Nate Mallison
@NJM8
Aug 28 2018 16:40
yeah. At my old job I hated trying to find something as simple as the cpu profiling tool. it should just be right there. But no you have to right click this and enable that. BS
on win 7
pop os sticks it right in your face where you want it.
Jason Luboff
@JLuboff
Aug 28 2018 16:40
@cmccormack Yes... Settings is god awful, I do everything I can from Control Panel.
I also use decrapifier on all new computers which gives me the option of having CP on the start menu
Christopher McCormack
@cmccormack
Aug 28 2018 16:41
It's like they looked at their users and said "How can we make them click as many buttons as possibly to do something until they give up and call support?"
Nate Mallison
@NJM8
Aug 28 2018 16:41
considering 90% of what I do on my computer is on a browser or vscode, It really doesn't matter what machine it is. cheapest with decent cpu and ram.
like, 100000 gb of ram for chrome. haha
Christopher McCormack
@cmccormack
Aug 28 2018 16:43
Looks like VS Code runs on Linux so that's good
I only use Linux headless so haven't tried it
Brad
@bradtaniguchi
Aug 28 2018 16:57
vscode on linux is just as smooth/same experience as I've had on windows
Christopher McCormack
@cmccormack
Aug 28 2018 17:00
That's great to hear
if Steam does what it proposes with gaming on Linux I may switch over permanently soon
Jason Luboff
@JLuboff
Aug 28 2018 17:01
I honestly can't stand Linux..I also haven't used it daily or used it really in years but I just never cared for the interface
Christopher McCormack
@cmccormack
Aug 28 2018 17:03
it definitely takes some time and practice to get familiar with
I tinker with it for various projects and https://www.edx.org/course/introduction-to-linux was pretty helpful
Jason Luboff
@JLuboff
Aug 28 2018 17:05
meh
NikolaNbgd
@NikolaNbgd
Aug 28 2018 17:06
Hi guys. I need help about slider countdown circle animation. So I have slider and I have to create countdown circle animation, the bold line has to fills out the circle when the time is up and in the center of circle is number of slide. Does anyone know where I can find some examples?
Brad
@bradtaniguchi
Aug 28 2018 17:15
@JLuboff Which interface? you can always change it up :P
Jason Luboff
@JLuboff
Aug 28 2018 17:16
I think typically I went with gnome
Nate Mallison
@NJM8
Aug 28 2018 17:21
check out PopOS, really nice. I don't like unbuntu personally. Haven't tried any others. Pop is easy to navigate and has great workspace manipulation
Jason Luboff
@JLuboff
Aug 28 2018 17:23
Meh...just have no desire to do so lol
Brad
@bradtaniguchi
Aug 28 2018 17:24
never heard of PopOS, is it based on an existing distro?
Nate Mallison
@NJM8
Aug 28 2018 17:25
I think it's a modified version of ubuntu, https://system76.com/pop
Brad
@bradtaniguchi
Aug 28 2018 17:27
Ah, I'll have to check it out. Is it oriented toward weaker machines? Or it is what it is? (so I know what kinda computer I need to run this thing haha)
oh wow you can get laptops pre-installed with this thing?
wait not nvm this is 76 hehe
Nate Mallison
@NJM8
Aug 28 2018 17:28
It's made by system 76 to go with their laptops so you get a better hardware/software experience.
I put it on a shitty old HP tower, worked pretty well. except for wifi adaptor
Brad
@bradtaniguchi
Aug 28 2018 17:29
yea networking stuff always kinda sucks for any distro, but cool I'll load it up when I get another extra machine available to try it out on.
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 17:37
Anyone here use Passportjs-facebook?
Jason Luboff
@JLuboff
Aug 28 2018 17:37
@RoniqueRicketts I have in the past, but not any time recently
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 17:38
@JLuboff Well I need your help with this madness. So I presume the new new dashboard is here https://developers.facebook.com/
Once I Clicl on my App then Add new and give it a name idk where else to go. :(
Jason Luboff
@JLuboff
Aug 28 2018 18:12
@RoniqueRicketts Sorry got busy
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 18:14
@JLuboff ok well I am here now n u r here so ;)
Jason Luboff
@JLuboff
Aug 28 2018 18:20
Still busy lol
Ronique Ricketts
@RoniqueRicketts
Aug 28 2018 19:47
fake news!!!
Jason Luboff
@JLuboff
Aug 28 2018 21:45
Have I complained about how I hate queries? Becuase I do
Pagnito
@Pagnito
Aug 28 2018 22:13
hey i opened a project i hadnt worked on for aabout two weeks and suddenly my requets are giving me a 504 error
504 (Gateway Timeout)
Jason Luboff
@JLuboff
Aug 28 2018 22:14
That sounds like an issue
Pagnito
@Pagnito
Aug 28 2018 22:19
yea its weird its not proxying my request
it proxies my current user
but not the articles
Jason Luboff
@JLuboff
Aug 28 2018 22:20
Did you check the logs?
Pagnito
@Pagnito
Aug 28 2018 22:26
i was wrong, i just had a few bad calls so i thought thats wat it was but i actually getting my data and its making it to my store and props
but somehow it suddenly renders before the props arrive i guess
for some reason my spinner stays even when props arrive
Pagnito
@Pagnito
Aug 28 2018 22:42
k figured it out
Simon Cordova
@gbsimon87
Aug 28 2018 22:48
Hey all
Brad
@bradtaniguchi
Aug 28 2018 22:48
@gbsimon87 he hows it going? :D
Simon Cordova
@gbsimon87
Aug 28 2018 22:49
Pretty good, enjoying the hot weather in North America
Brad
@bradtaniguchi
Aug 28 2018 22:50
I just came from Arizona, it was 100 driving back haha
Simon Cordova
@gbsimon87
Aug 28 2018 22:50
whoa, that's more than I want personally haha
Jason Luboff
@JLuboff
Aug 28 2018 22:52
@gbsimon87 They kick you out of London? :P
Simon Cordova
@gbsimon87
Aug 28 2018 22:53
For a few weeks while they can have me back :)
Yeah I needed to leave the UK in order to complete the visa process
Jason Luboff
@JLuboff
Aug 28 2018 22:54
Ah...back in Canada?
Simon Cordova
@gbsimon87
Aug 28 2018 23:11
Yeah for the moment
Min 3 weeks, probably over a month tbh
Jason Luboff
@JLuboff
Aug 28 2018 23:22
So you're just chilling or what? No work right?
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:38
function getLength(str) {
  "use strict";

  // change code below this line
  let len = 0;
  const length = str.length; // change this
  // change code above this line

  return { len } = length; // you must assign length to len in line

}
I can't understand what this challenge wants exactly? Any insights are appreciated. :)
Jason Luboff
@JLuboff
Aug 28 2018 23:39
@Morched23MJ Is that the destructuring one?
If so... it's stupid. lol
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:39
It is!
Jason Luboff
@JLuboff
Aug 28 2018 23:39
I think its supposed to be
const { length } = str;
They basically expect you to know that you can get the length of the string via destructuring when teaching you nothing of it
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:41
I still can't pass the challenge? :l
Brad
@bradtaniguchi
Aug 28 2018 23:41
confusing AF
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:41
It is. -.-
Use destructuring to obtain the length of the input string str, and assign the length to len in line. challenge says.
Aditya
@ezioda004
Aug 28 2018 23:42
It helps to think str as an object with property length, then you simply use destructuring on it.
Jason Luboff
@JLuboff
Aug 28 2018 23:43
Ugh ya I forget how to pass it. lol
Brad
@bradtaniguchi
Aug 28 2018 23:44
that language feature is one of those things I don't think I'd ever use, its too confusing
Jason Luboff
@JLuboff
Aug 28 2018 23:44
@bradtaniguchi destructuring? Its actually pretty nice
Brad
@bradtaniguchi
Aug 28 2018 23:45
I still don't know how to use it, so I guess that's why I dont like it haha
Aditya
@ezioda004
Aug 28 2018 23:46
Yeah, its one of those things that takes a while to wrap your head around. In React you cannot escape it.
Jason Luboff
@JLuboff
Aug 28 2018 23:46

I have

const { ObjectId } = require('mongodb');

Instead of

const ObjectId = require('mongodb').ObjectId;
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:46
function getLength(str) {
  "use strict";

  // change code below this line
  const length = str; // change this
  // change code above this line

  return { length:len } = length; // you must assign length to len in line

}
What's wrong with this? :l
Jason Luboff
@JLuboff
Aug 28 2018 23:46
Your changing code on the wrong line for starters
Aditya
@ezioda004
Aug 28 2018 23:46
^
Jason Luboff
@JLuboff
Aug 28 2018 23:47
Ohh now I got it! I was missing the assignment to len
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:50
I strongly believe it should be something like this:
function getLength(str) {
  "use strict";

  // change code below this line
  let len = 0;
  const length = str.length; // change this
  // change code above this line

  return { length : len } = length; // you must assign length to len in line

}
I defined len, because it said len is not defined
Jason Luboff
@JLuboff
Aug 28 2018 23:51
Ok let me give you a hint.. this part { length : len } is correct, but in the wrong line. It should be in your const assignment
Aditya
@ezioda004
Aug 28 2018 23:53
let len = 0; would also be a problem, cause of redeclaration.
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:54
I passed it. But how come, I declare an object as const { something} and then I can return something, even though I didn't give a name for the object holding something. :l
@ezioda004, yup. I removed it.
Aditya
@ezioda004
Aug 28 2018 23:54
That's the magic haha
Morchid Chellali
@Morched23MJ
Aug 28 2018 23:55
:D
Jason Luboff
@JLuboff
Aug 28 2018 23:58
@ezioda004 Just went to your portfolio page... Wow is all I have to say! haha
I really like the animations