These are chat archives for FreeCodeCamp/Help

19th
Jul 2018
Kyle Holm
@thekholm80
Jul 19 2018 00:00
i started doing that in all my code, when i go back months later i love myself for it
Smootimus
@Smootimus
Jul 19 2018 00:01
Except C++ doesn't really do docstrings like Python
i'd hate trying to grep that code a year from now
Smootimus
@Smootimus
Jul 19 2018 00:02
Yeah, something like that would be useful
Kyle Holm
@thekholm80
Jul 19 2018 00:02
it doesn't list all variables, though
just parameters
Smootimus
@Smootimus
Jul 19 2018 00:03
Lemme see if I can pull up something as an example
Eh, not really that I could use here
Pretty much it's just doubling up the work
If it would display like that, like how we're talking, like a tool tip or something..
Tat would be awesome and useful
Kyle Holm
@thekholm80
Jul 19 2018 00:06
i think vs code will use these as tooltips when you call the function
kind of neat
Smootimus
@Smootimus
Jul 19 2018 00:06
But it's not, it's just a comment with a list of variables and what they're storing, followed by the variable list we define it and initialize it u.u
Yeah?
I'm using Code more and more and getting better with all the tools it has and I'm really loving Code
Kyle Holm
@thekholm80
Jul 19 2018 00:08
i dunno where you even write c++, i assume some kind of IDE
Smootimus
@Smootimus
Jul 19 2018 00:08
I use Visual Studios vast majority of the time
So yeah IDE the most, and CLI other times
Kyle Holm
@thekholm80
Jul 19 2018 00:08
i could never make myself buy VS
i guess students get a good deal though?
Smootimus
@Smootimus
Jul 19 2018 00:09
When I say CLI, I mean... just telling g++ to compile and make the cpp files lol
I got mine for Free
We just switched actually, last quarter we were using Visual Studio 2010? I think it was 2010... Now we're doing 2017 lol
Kyle Holm
@thekholm80
Jul 19 2018 00:10
oh fancy
Smootimus
@Smootimus
Jul 19 2018 00:10
I got 2017 Enterprise for free when I got Visio through the school website for free
"Oh as an added bonus! Here's an VS Enterprise license!"
Great, I didn't pay for either
What we're running into, though...
Some of the class have Macs
And ya know... MS has that death grip on C++
Xcode doesn't give them the option to code in C++ lol
Kyle Holm
@thekholm80
Jul 19 2018 00:11
lol
i don't get macs
Smootimus
@Smootimus
Jul 19 2018 00:11
So they're having a hard time with that
I've never been a iOS guy
er macOS
Kyle Holm
@thekholm80
Jul 19 2018 00:12
oh dang, i don't know how to screen shot a tool tip but vs code is pretty awesome lol
Smootimus
@Smootimus
Jul 19 2018 00:12
lol I'm gonna have to play around with it
Kyle Holm
@thekholm80
Jul 19 2018 00:12
it shows the docstring when i hover over the function call, and if i hold ctrl it will show me the function code
Smootimus
@Smootimus
Jul 19 2018 00:12
Cause outside of HTML, CSS, JS and a few others I use it for...
I usually just throw C/C++/Java/Python in some kind of IDE
Ah that's REALLY nice
Paul Chu
@PaulChu756
Jul 19 2018 00:14
Hello everyone, I'm not receiving Quincy Larson emails anymore, what happened?
Smootimus
@Smootimus
Jul 19 2018 00:14
o.o
Paul Chu
@PaulChu756
Jul 19 2018 00:15
Or if anyone has received this same issue...
Kyle Holm
@thekholm80
Jul 19 2018 00:15
image.png
@PaulChu756 go to settings and click "On"
i think they updated settings and defaulted everything to 'Off'
Paul Chu
@PaulChu756
Jul 19 2018 00:16
I have done so, but I'm still not receiving his emails
Kyle Holm
@thekholm80
Jul 19 2018 00:17
when did you do it?
Paul Chu
@PaulChu756
Jul 19 2018 00:17
I did this at least weeks ago, and even just now
Kyle Holm
@thekholm80
Jul 19 2018 00:19
i don't see any emails from him in my inbox either
maybe he's given up on us
Smootimus
@Smootimus
Jul 19 2018 00:19
lol
Or maybe he's giving it time for things to adjust
But I would say given up, yeah..
He realized we not worth it
Paul Chu
@PaulChu756
Jul 19 2018 00:20
My last email from him is May 17th
I r sad
Smootimus
@Smootimus
Jul 19 2018 00:20
My inbox isn't
It's raving
Kyle Holm
@thekholm80
Jul 19 2018 00:20
i never even noticed, i see his stuff on twitter all the time
Paul Chu
@PaulChu756
Jul 19 2018 00:20
Oh, I don't used twitter
Kyle Holm
@thekholm80
Jul 19 2018 00:20
good idea
twitter is toxic
Smootimus
@Smootimus
Jul 19 2018 00:20
lol yep
I noticed that the new content doesn't "update" when you redo the challenge
Kyle Holm
@thekholm80
Jul 19 2018 00:21
what do you mean 'update'?
Smootimus
@Smootimus
Jul 19 2018 00:21
Like the old one used to say when you "first did it" then it would say when you redid it with an "updated" date
Paul Chu
@PaulChu756
Jul 19 2018 00:21
It does for me, but I had to clear my cache first
Kyle Holm
@thekholm80
Jul 19 2018 00:21
oh, right
Smootimus
@Smootimus
Jul 19 2018 00:21
So I was like.. redoing some challenges to get that specifically. And I noticed that it's not even tracking that any more lol
Oh yeah I haven't cleared anything
anthonygallina1
@anthonygallina1
Jul 19 2018 00:23
Quincy give up. I dont think so. Maybe he is busy on the launch. That happened.
YA havent seen the good links sent for a while here. But seemed to taper at about the launch time. IMO
Kyle Holm
@thekholm80
Jul 19 2018 00:25
@anthonygallina1 are you sure he didn't just say, "That thekholm80, no use wasting my emails on him anymore."?
Smootimus
@Smootimus
Jul 19 2018 00:25
Would make sense
I mean, that DOES sound like something he would say
anthonygallina1
@anthonygallina1
Jul 19 2018 00:25
@thekholm80 No way!
Smootimus
@Smootimus
Jul 19 2018 00:25
:laughing:
anthonygallina1
@anthonygallina1
Jul 19 2018 00:25
:smile:
Kyle Holm
@thekholm80
Jul 19 2018 00:25
i miss when people would look at my profile pic and think i'm quincy
i guess it must be hard to tell bald guys apart
anthonygallina1
@anthonygallina1
Jul 19 2018 00:26
hmmmm
:smile:
Paul Chu
@PaulChu756
Jul 19 2018 00:26
Isn't there a bald club?
Kyle Holm
@thekholm80
Jul 19 2018 00:27
the first rule of bald club is we don't talk about bald club
anthonygallina1
@anthonygallina1
Jul 19 2018 00:27
hair club for men :clubs:
Smootimus
@Smootimus
Jul 19 2018 00:27
lol
anthonygallina1
@anthonygallina1
Jul 19 2018 00:28
I may need to get a clip on pony tail though
Paul Chu
@PaulChu756
Jul 19 2018 00:28
Sooo
Kyle Holm
@thekholm80
Jul 19 2018 00:28
i thought about that, but i don't know what i'd clip it to
Paul Chu
@PaulChu756
Jul 19 2018 00:28
Those emails?
anthonygallina1
@anthonygallina1
Jul 19 2018 00:28
@thekholm80 :smile:
anthonygallina1
@anthonygallina1
Jul 19 2018 00:48
I wish I could get a clip on like this. @thekholm80
Kyle Holm
@thekholm80
Jul 19 2018 00:48
maybe i could find a glue-on man bun
i'd be so hip
bam
anthonygallina1
@anthonygallina1
Jul 19 2018 00:49
I made that :point_up:
Kyle Holm
@thekholm80
Jul 19 2018 00:49
the man bun?
anthonygallina1
@anthonygallina1
Jul 19 2018 00:49
WOW 9.99
NA the image only 6 layers
Kyle Holm
@thekholm80
Jul 19 2018 00:50
just realized that might be an actual product page, don't want to be advertising lol
anthonygallina1
@anthonygallina1
Jul 19 2018 00:50
lol
Kyle Holm
@thekholm80
Jul 19 2018 00:50
it looks cool, did you do just the wiggly bits in the sky or did you add the lighting below?
anthonygallina1
@anthonygallina1
Jul 19 2018 00:51
@thekholm80 lighting gimped too and clone brushed
top one line duplicated warped with filters etc
Kyle Holm
@thekholm80
Jul 19 2018 00:53
very cool, good job
anthonygallina1
@anthonygallina1
Jul 19 2018 00:54
thanks your the third to see it. My GF first but not completly objective.
Kyle Holm
@thekholm80
Jul 19 2018 00:54
you mean she's afraid of you?
anthonygallina1
@anthonygallina1
Jul 19 2018 00:55
oh no But she thinks lots of stuff I do is cool.
Kyle Holm
@thekholm80
Jul 19 2018 00:55
oh! well that's nice of her
anthonygallina1
@anthonygallina1
Jul 19 2018 00:55
very
Kyle Holm
@thekholm80
Jul 19 2018 00:55
always good to have someone on your side
anthonygallina1
@anthonygallina1
Jul 19 2018 00:55
yes
But by the time I finish a graphic I am not all ways sure.
Kyle Holm
@thekholm80
Jul 19 2018 00:56
i've done some photo editing - i always wanted to add stuff into them but i never felt i could make it look decent
anthonygallina1
@anthonygallina1
Jul 19 2018 00:56
Still trying to find a use for it.
@thekholm80 :thumbsup:
Kyle Holm
@thekholm80
Jul 19 2018 00:57
it always looked like i had cut out pictures from a magazine and glued them onto some kind of serial killer ransom note
which i suppose is okay if you're into serial killer ransom notes, but that wasn't my goal
anthonygallina1
@anthonygallina1
Jul 19 2018 00:58
Takes patience
You could do it
And lots of saves so you can go back
Kyle Holm
@thekholm80
Jul 19 2018 01:00
maybe someday. it's hard to find time now
anthonygallina1
@anthonygallina1
Jul 19 2018 01:01
If i can help let me know
Kyle Holm
@thekholm80
Jul 19 2018 01:04
@anthonygallina1 thanks
You can play it online lol on browser
Aditya
@ezioda004
Jul 19 2018 01:25

I might be using .reduce() way too much
My solution

function rowSumOddNumbers(n) {
  return Array.from(Array(n).keys()).reduce((a, c) => (a.sum += (a.pattern += 2)) && a, { pattern: (x => (x * (x-1) + 1)-2)(n), sum: 0 }).sum;
}

Top solution

function rowSumOddNumbers(n) {
  return Math.pow(n, 3);
}
Smootimus
@Smootimus
Jul 19 2018 01:28
Meh, I dunno reduce is pretty applicable lol
Aditya
@ezioda004
Jul 19 2018 01:30
It is, but this is overkill lol
Smootimus
@Smootimus
Jul 19 2018 01:32
Overkill is an understatement LOL!
Kyle Holm
@thekholm80
Jul 19 2018 02:28
@ezioda004 needs more reduce, imo
we can go deeper
image.png
@Smootimus can't decide if it's worth installing flash
Smootimus
@Smootimus
Jul 19 2018 02:42
It's not, if you don't already have it lol
I have pretty much everything on this machien
*machine
Kyle Holm
@thekholm80
Jul 19 2018 02:43
i didn't know flash was even still a thing
i'm so out of the loop
Anand Potukuchi
@anandpotukchi
Jul 19 2018 04:33
@ezioda004 completed
I was stressing myself
fresh mind, fresh start
Anand Potukuchi
@anandpotukchi
Jul 19 2018 04:49
hi ppl
is this code correct
const increment = (function() {
  "use strict";
  return function increment(number, value) {
    return number + value;
  };
})();
console.log(increment(5, 2)); // returns 7
console.log(increment(5)); // returns NaN
should the () be present on line 6
Claudio Restifo
@Marmiz
Jul 19 2018 04:52
yeh cos it's an IIFE :)
Anand Potukuchi
@anandpotukchi
Jul 19 2018 04:56
IIFE?
Claudio Restifo
@Marmiz
Jul 19 2018 04:56
Anand Potukuchi
@anandpotukchi
Jul 19 2018 05:00
what is that supposed to mean
Claudio Restifo
@Marmiz
Jul 19 2018 05:00
that is an immediately invoked function expression

or as the docs says:

An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

Claudio Restifo
@Marmiz
Jul 19 2018 05:06

or practically in your function gets called as soon as it's evaluated.
So you have const increment which has already evaluated and thus is assigned its return value of function increment

(btw using two times the same name is kinda misleading)

Anand Potukuchi
@anandpotukchi
Jul 19 2018 05:28
I have another question
the code editor here is a sandbox right
how do you create one?
I want to create ione for elixir
Claudio Restifo
@Marmiz
Jul 19 2018 05:37
afaik FCC uses CodeMirror, as for elixir, I don't know exactly how elixir-erlang works together under the hood so I can't be of too much help
Anand Potukuchi
@anandpotukchi
Jul 19 2018 05:43
const increment = (value = 1 ) => {
  "use strict";
  return function increment(number, value) {
    return number + value;
  }
the challenge is to add dfault paream of 1
I ried ading it this way:
const increment = (function(value = 1) {
  "use strict";
  return function increment(number, value) {
    return number + value;
  };
})();
console.log(increment(5, 2)); // returns 7
console.log(increment(5)); // returns NaN
which is changing the param in the def
didnt work'now I changed it to an arrow fn
stil doesn;t work
Aditya
@ezioda004
Jul 19 2018 05:47
@anandpotukchi Link to challenge?
Claudio Restifo
@Marmiz
Jul 19 2018 05:49
@anandpotukchi perhaps you want the default value to the function, and not the result of an IIFE?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 05:49
?
Claudio Restifo
@Marmiz
Jul 19 2018 05:49
which function do you think gets called here?
increment(5, 2)
Aditya
@ezioda004
Jul 19 2018 05:50
The inner function needs default parameter. console.log(increment(5)); // returns NaN is returning NaN because of value in function increment(number, value) being undefined.
Anand Potukuchi
@anandpotukchi
Jul 19 2018 05:53
oh
@Marmiz increment
got the point
Thayyeb salim
@Thayyebsalim
Jul 19 2018 06:55
can someone tell me the execution flow of this block of code please?
var printNumTwo;
for (var i = 0; i < 3; i++) {
  if(i === 2){
    printNumTwo = function() {
      return i;
    };
  }
}
console.log(printNumTwo());
returns 3
Aditya
@ezioda004
Jul 19 2018 06:59

@Thayyebsalim When i = 2, you're assigning an anonymous function expression

function() {
      return i;
    };

to printNumTwo, now when you execute the function in the last line console.log(printNumTwo());, the function will access its lexical scope and finds global variable i = 3.

If you want it to print 2 then you can change the var to let in the for loop
var printNumTwo;
for (let i = 0; i < 3; i++) {
  if(i === 2){
    printNumTwo = function() {
      return i;
    };
  }
}
console.log(printNumTwo()); // 2, not 3
Thayyeb salim
@Thayyebsalim
Jul 19 2018 07:04
Thanks @ezioda004
I was learning about let ^^
May Kittens Devour Your Soul
@diomed
Jul 19 2018 07:13
@thekholm80 flash is now like Adobe Acrobat. update every week.
suffice to say version is like 30 or smth
Aditya
@ezioda004
Jul 19 2018 07:13
@Thayyebsalim Yep, let solves this issue, you can also use IIFE.
var printNumTwo;
for (var i = 0; i < 3; i++) {
  if(i === 2){
    printNumTwo = (function(i) {
      return function(){
        return i;
      }
    })(i);
  }
}
console.log(printNumTwo()); //2
Claudio Restifo
@Marmiz
Jul 19 2018 07:33

update every week

like VS Code then @diomed

holdin07
@holdin07
Jul 19 2018 07:35
hey guys, My Javascript is running before html loads. i tried everything, putting script tag before </body>, using defer attribute, wrapping my code in window.onload=function(){}, Nothing is working, please help me out guys, i'm using chrome browser latest version
Anand Potukuchi
@anandpotukchi
Jul 19 2018 07:42
@holdin07 SHARE THE CODE
holdin07
@holdin07
Jul 19 2018 07:43
Capture.JPG
Capture2.JPG
Anand Potukuchi
@anandpotukchi
Jul 19 2018 07:43
put it on codepen.io
Claudio Restifo
@Marmiz
Jul 19 2018 07:47
@holdin07 wrap it in a
document.addEventListener("DOMContentLoaded", function() {
  // code...
});
Lazar Madžić
@LazarMadzic
Jul 19 2018 08:07
I have problem with regular expression: Using the Test Method
let myString = "Hello, World!";
let myRegex = /Hello/;
myRegex.test(myString); // Change this line
what is wrong with my code?
gishy1
@gishy1
Jul 19 2018 08:38
hello world !!
have a look at my landing page challenge and give any constructive criticism
Anand Potukuchi
@anandpotukchi
Jul 19 2018 08:51
how do i add a default params
const sum = (function() {
  "use strict";
  return function sum(...args) {

    return args.reduce((a, b, c) => a + b);
  };
})();
console.log(sum(1, 2, 3)); // 6
Anand Potukuchi
@anandpotukchi
Jul 19 2018 08:58
?
can't add
?????????????????????????????////
Yago Estévez
@yagoestevez
Jul 19 2018 09:06
@gishy1 I wouldn't use center elements. It's better to use CSS.
Fay Vor
@phavor
Jul 19 2018 09:06
you want to have a default sum value? @anandpotukchi
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:06
yes
but unable to add
Yago Estévez
@yagoestevez
Jul 19 2018 09:06
The title looks like default styled link and it's confusing from a UX perspective.
Your wrapping a div container inside a paragraph, which is not a good idea and will drive you nuts.
Speaking of the first two containers, they're not responsive.
You're using default styling for the anchor tags. If that's fine for you, also fine for me :)
You've got an empty paragraph on line 33.
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:11
@yagoestevez ?
Aditya
@ezioda004
Jul 19 2018 09:11
@anandpotukchi Default parameter to what? args?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:11
I need to set sum to zero
if there are no args
Yago Estévez
@yagoestevez
Jul 19 2018 09:12
You're styling select elements but I don't see any in the html markup
Some other empty paragraphs in the markup.
Hope it helps
Fay Vor
@phavor
Jul 19 2018 09:13
I think you can provide a param in the function parentheses and set it the your desired value
Claudio Restifo
@Marmiz
Jul 19 2018 09:14
@anandpotukchi you can simply
if args.length <= 0 return 0
no need to do fancy stuff :)
gishy1
@gishy1
Jul 19 2018 09:14
@yagoestevez noted brother , any reason why you wouldnt?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:14
@gishy1 @Marmiz i need a beter son withoout if/ese
Aditya
@ezioda004
Jul 19 2018 09:15
Yeah that'd be the best way to go about it
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:15
is this the only way
Claudio Restifo
@Marmiz
Jul 19 2018 09:15
@anandpotukchi why you "need"?
any particular reason
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:15
just wanna know
Claudio Restifo
@Marmiz
Jul 19 2018 09:15
args.length ? ...  :  0
but is implicit imho
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:16
without conditionals
Claudio Restifo
@Marmiz
Jul 19 2018 09:16
and not nice to read / debug
Yago Estévez
@yagoestevez
Jul 19 2018 09:16
@LazarMadzic what's the output? Any errors thrown?
Aditya
@ezioda004
Jul 19 2018 09:16
If you dont use rest parameter then you'd have to check arguments object and it'd be the same way.
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:16
defauklt para,s
Claudio Restifo
@Marmiz
Jul 19 2018 09:18
@anandpotukchi you can't have a default and a spread because the default would never be run since the spread will try to instantiate an iterable anyway
Yago Estévez
@yagoestevez
Jul 19 2018 09:18
The code is fine. Maybe you need to do it another way. What's the challenge link?
Aditya
@ezioda004
Jul 19 2018 09:20
Thats rest operator with function parameters and not default parameter.
Claudio Restifo
@Marmiz
Jul 19 2018 09:21
@anandpotukchi als you change the reduce function. There's a initialValue set for it
and you don't have one
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:22
is there ba apram called initial value
Yago Estévez
@yagoestevez
Jul 19 2018 09:23
@gishy1 because html is for the document structure, not for styling. That's my own vision, though.
Claudio Restifo
@Marmiz
Jul 19 2018 09:23
@anandpotukchi refer to reduce docs
Aditya
@ezioda004
Jul 19 2018 09:23
In .reduce(), yes. The last argument of .reduce() is initialValue.
Thayyeb salim
@Thayyebsalim
Jul 19 2018 09:24
thanks again :D @ezioda004
Aditya
@ezioda004
Jul 19 2018 09:25
:sparkles:
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:30
@Marmiz what are they even updating? everything's working fine. it's a text editor for god's sake
what's du javscript?
@ezioda004 you're our hero! :cookie: :cookie: 4 YOU!!!
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:31
@diomed what's the problem
whch challenge are you on'
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:32
I'm on challenge of talking with you
Claudio Restifo
@Marmiz
Jul 19 2018 09:32
@diomed dunno... every friggin week there's an update.
Just like vim. Last update was when Brontosaurus were roaming the earth and still works fine.
Aditya
@ezioda004
Jul 19 2018 09:32
:fire:
Lazar Madžić
@LazarMadzic
Jul 19 2018 09:32
@yagoestevez I've found the solution, but thanks eather way man,my code was good, but I didn't understand that they wanted the result to be stored inside "let result"
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:33
@Marmiz they should call us when they implement AI that'll code for us. we'll just tell it what we need
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:33
@diomed Why don't you see whether the challenge you're on has been added to th main curriculum
Aditya
@ezioda004
Jul 19 2018 09:34
Yeah all electron apps update quite frequently, slack, spotify, discord, VSC.
Ketan Ramteke
@TheKetan2
Jul 19 2018 09:34
https://codepen.io/TheKetan2/pen/qyamwg
HELP,
I need to remove white edged from the footer and the color of the footer would be all gray unlike the current white edges. any hints?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:35
@TheKetan2 change thebackground color
Claudio Restifo
@Marmiz
Jul 19 2018 09:36
@diomed I for once, welcome our lord the CodingAI
I'm sure it will invent a CMS
Ketan Ramteke
@TheKetan2
Jul 19 2018 09:38
@anandpotukchi I did but white edge is still there
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:38
wait

yo

emove white on the edges?

May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:39
@TheKetan2 add margin: 0 to body
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:39
@TheKetan2 @diomed has got it
add border 0 to body
Fay Vor
@phavor
Jul 19 2018 09:39
@TheKetan2 check if it's a child of any parent element that has been padded or has margin added to it
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:40
@Marmiz my cms is the best cms
problem is - i dont know how to make it. haha
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:47
@diomed why would nayone makea cms
when you could just use an existing one
Ketan Ramteke
@TheKetan2
Jul 19 2018 09:47
@phavor Thank you, it worked.
@phavor ++
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:48
wtf?
@anandpotukchi which existing cms is a good cms?
Fay Vor
@phavor
Jul 19 2018 09:48
you're welcome @TheKetan2 :sparkles:
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:49
what language are u 2 speaking, that's what I'd like to know
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:55
@diomed wp
prismic
Donkt know much about drupal
prsimic is cloud based headless api
I love ot for it's simplcity
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:57
u got any site on it?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:57
yeah
don't laugh
just view
The design sucks
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:59
what's the point of cms for one pager, tho?
you can easily just take a template and edit it in html
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:59
TAKES TOO MUCH TIME
May Kittens Devour Your Soul
@diomed
Jul 19 2018 09:59
dont think so
Anand Potukuchi
@anandpotukchi
Jul 19 2018 09:59
ys it does
this is just a few clicks
and can edit on mobile
May Kittens Devour Your Soul
@diomed
Jul 19 2018 10:00
like u ever edit it tho
but yeah, u got point there
Shazaib Ahmad
@sgript
Jul 19 2018 10:38
Hi there, I was wondering whether git bundle would be a viable form of backing up a git repository? Even if i.e. The original remote repository is deleted?
Anand Potukuchi
@anandpotukchi
Jul 19 2018 12:51

const inputStyle = {
  width: 235,
  margin: 5
}

class CheckUserAge extends React.Component {
  constructor(props) {
    super(props);
    // change code below this line
      this.state {
          input: ''
          userAge: ''

      }
    // change code above this line
    this.submit = this.submit.bind(this);
    this.handleChange = this.handleChange.bind(this);
  }
  handleChange(e) {
    this.setState({
      input: e.target.value,
      userAge: ''
    });
  }
  submit() {
    this.setState({
      userAge: this.state.input
    });
  }
  render() {
    const buttonOne = <button onClick={this.submit}>Submit</button>;
    const buttonTwo = <button>You May Enter</button>;
    const buttonThree = <button>You Shall Not Pass</button>;
    return (
      <div>
        <h3>Enter Your Age to Continue</h3>
        <input
          style={inputStyle}
          type="number"
          value={this.state.input}
          onChange={this.handleChange} /><br />
        {
          (this.state.userAge) ? buttonThree : buttonTwo
        }
      </div>
    );
  }
};
is this true
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:07
????????????????????????????
Smootimus
@Smootimus
Jul 19 2018 13:13
I really need to get on my React grind just to help @anandpotukchi
XD
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:13
:laughing:
Aditya
@ezioda004
Jul 19 2018 13:14
@anandpotukchi Syntax error in this.state object and yeah bunch of errors still.
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:14
?
what about the ternry exp?
Smootimus
@Smootimus
Jul 19 2018 13:15
Maybe point out the exact syntax error?
Some ,'s may be in order
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:16
the prob is th ediior doesn;t point it out
Smootimus
@Smootimus
Jul 19 2018 13:16
,
Aditya
@ezioda004
Jul 19 2018 13:16
this.state = {
          input: '',
          userAge: ''
      }
Smootimus
@Smootimus
Jul 19 2018 13:16
Yeah, that's what I figured
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:17
I'm jus wondering
has anyone ver compketed the curriculum?
Smootimus
@Smootimus
Jul 19 2018 13:17
I've known a couple that completed the whole thing BEFORE the release
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:18
@ezioda004 @Smootimus what are you people doing
Smootimus
@Smootimus
Jul 19 2018 13:18
Right now I'm sitting in my Network class
Kyle Holm
@thekholm80
Jul 19 2018 13:18
lol
Tuition: $7,000 per semester
Books: $550 per semester
Hanging out on gitter all day: Priceless
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:19
lol
Smootimus
@Smootimus
Jul 19 2018 13:19
LOL!!
Tr00f
I got one better for ya
Tuition: VA paid
Books: VA paid
Me: VA paid
Hanging out on gitter all day: VA paid
LOL
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:20
what's VA
Kyle Holm
@thekholm80
Jul 19 2018 13:20
oh dang, which service?
Smootimus
@Smootimus
Jul 19 2018 13:20
They're probably watching me post this
Veteran Affairs
I was in the US military
So I got a GI Bill
Kyle Holm
@thekholm80
Jul 19 2018 13:21
which branch?
Smootimus
@Smootimus
Jul 19 2018 13:21
Army
I was in the Rangers
Airborne Ranger
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:21
cool
Kyle Holm
@thekholm80
Jul 19 2018 13:21
oh. guess i should start being nice to you
Smootimus
@Smootimus
Jul 19 2018 13:21
Joined the Infantry and then took it as far as I could for 7 years
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:21
tours?
Smootimus
@Smootimus
Jul 19 2018 13:21
Got assigned to a LRS unit Long Range Surveillance
Did that my whole career
I was in Iraq and Afghanistan
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:22
great
Smootimus
@Smootimus
Jul 19 2018 13:22
So yeah, I get paid to go to school full time lol Which most the time ya'll see me here xD
Kyle Holm
@thekholm80
Jul 19 2018 13:22
that's pretty sweet
Smootimus
@Smootimus
Jul 19 2018 13:22
Yeah it's not a bad gig really, I mean I get paid in lump sums so it's on a monthly basis but...
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:23
which univ?
Smootimus
@Smootimus
Jul 19 2018 13:23
It's enough to make it between them, with that and my disability
Kyle Holm
@thekholm80
Jul 19 2018 13:23
i signed up for the navy in my 20s but it didn't pan out
Smootimus
@Smootimus
Jul 19 2018 13:23
New England Institute of Technology
Here in Rhode Island
I'm in Software Engineering
Yeah I signed up for the Marines when I was like.. 20... never went
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:23
Rhode Island's known for it's design school right
Smootimus
@Smootimus
Jul 19 2018 13:23
Then I almost did it again, but I didn't join the Army until I was 22
I danced around it for awhile
Yeah I live a block away from Brown Uni
And RISD
Rhode Island School of Design
And then there's Johnston and Wales, a cooking school really but other things
Roger Williams Uni
But Brown is the baby.
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:24
having the time of your ife eh? everything paid!
Kyle Holm
@thekholm80
Jul 19 2018 13:24
brown is ivy-league?
Smootimus
@Smootimus
Jul 19 2018 13:24
Like an hr away from MIT and Harvard. Maybe less than that actually
Yeah it's Ivy League
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:25
@thekholm80 yeah
Smootimus
@Smootimus
Jul 19 2018 13:25
Yeah I don't have many complaints lol it's pretty nice
Kyle Holm
@thekholm80
Jul 19 2018 13:25
i always remember harvard, yale, princeton but can't remember the others lol
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:25
two tiers down I think
Smootimus
@Smootimus
Jul 19 2018 13:25
I've done work on MIT, which was really cool
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:25
harvard yale princeton yale coulmbia brown darthmouth
Smootimus
@Smootimus
Jul 19 2018 13:25
I build up a Fiber Outside Plant for them
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:26
hmm
when did you get to do all that
weren't you on the front?
Smootimus
@Smootimus
Jul 19 2018 13:26
I got out the military in 2013
I did that project in 2014
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:27
whoosp. you look younger in that photograph
Smootimus
@Smootimus
Jul 19 2018 13:27
Dec 3 2013 was my last day in the service
Yeah everyone says I look 23-25
I'm 32 lol
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:27
the hair style maybe
Smootimus
@Smootimus
Jul 19 2018 13:27
DEF the hair
Even before I started growing it, people though I was younger
But the hair absolutely cements their thoughts that I"m younger
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:28
lol
Kyle Holm
@thekholm80
Jul 19 2018 13:28
when i went to MEPS there was a guy that looked like you, only his hair was all spiked up in a huge, bright red mohawk. he got a 97 on the asvab and went marines infantry
smh
Smootimus
@Smootimus
Jul 19 2018 13:28
LOL Kinda like how I did
They were trying to push me into Commo
Cause my background
I was like "Nah... infantry..."
Honestly, really glad I did as well
I wouldn't have got to experience all that I did if I went commo
I had a friend that went in with LONG dreadlocks LOL
And they were dyed red
Basic Drill sergeants had so much fun with him, and cutting those off
Kyle Holm
@thekholm80
Jul 19 2018 13:30
my recruiter told me not to cut my hair before going, he said they love seeing that
Smootimus
@Smootimus
Jul 19 2018 13:30
Yep
Exactly
It's true
They would eat dudes for breakfast that cut their hair before
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:31
you start college right after you came out?
Smootimus
@Smootimus
Jul 19 2018 13:32
I actually went to college before I joined the military
I went to Ohio State for Computer Science in 2004-2005
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:32
I would lay on the beach for atleast an year .. lol
Smootimus
@Smootimus
Jul 19 2018 13:32
I didn't finish my degree then because well, I couldn't afford it after my grants and federal funding ran out lol
Kyle Holm
@thekholm80
Jul 19 2018 13:33
ah, a buckeye
Smootimus
@Smootimus
Jul 19 2018 13:33
I kinda did that, for sure. I worked in the field for a few years after I got out of college, but then when I was 22 I joined the military.
When I got out of the military, from 2013 to 2016 I just kinda did my thing... And now I'm back in class finishing my degree and going further now that I have the GI Bill funding to do so
Oh yeah, a buckeye :D
I'm not really a football fan, though lol
Kyle Holm
@thekholm80
Jul 19 2018 13:34
lol
i used to follow NFL, never was really into college football
now, who has time?
Smootimus
@Smootimus
Jul 19 2018 13:35
Right lol
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:43
I'm doing the design part
since no one seems to have an answer to my ES6 or React challenge
Smootimus
@Smootimus
Jul 19 2018 13:44
I've taken a long break from fcc when I started class
I just now started getting back into it
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:45
fcc is a good resourrce
but takes a lot of time
Smootimus
@Smootimus
Jul 19 2018 13:45
For sure
Kyle Holm
@thekholm80
Jul 19 2018 13:45
Smootimus
@Smootimus
Jul 19 2018 13:46
It's nice to have when interfacing with businesses as well
LMAO Oh Alexa
Anand Potukuchi
@anandpotukchi
Jul 19 2018 13:50
LMAO
Smootimus
@Smootimus
Jul 19 2018 13:50
The Visual Design section is really nice, wish it was released when I had my Visual Design class last quarter =\
Kyle Holm
@thekholm80
Jul 19 2018 13:52
i wish the es6 section had existed when i learned es6
i mostly struggled through using mdn lol
Smootimus
@Smootimus
Jul 19 2018 13:53
LOL
Yeah I'm wondering how this Javascript class is gonna handle that
Cause he said "We'll be teaching the most recent tools!" In regard to HTML and CSS, like meaning 5 and 3... but I dunno, he didn't specify on JS
Anand Potukuchi
@anandpotukchi
Jul 19 2018 14:37
LOL
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:01
hey ppl
I need advice
I'm looking for a bachelor's online'
in cs
any suggestions
@ezioda004 maybe you can help
Smootimus
@Smootimus
Jul 19 2018 15:04
Eh...
I dunno about DEGREES online
Only certs
Like CS50 or some other courses on Udemy and whatnot
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:06
there are degrees online
Let me give a background
Im 22 - I had organ failure- lost two years of my life - my college woul'nt re-admit me - now I'm doing frreelance work
But unlike America, here people without a degree are treated like scum
so is there ANYTHING i can do
Kyle Holm
@thekholm80
Jul 19 2018 15:12
there are a lot of online schools, but make sure you check them out completely before giving them any money. quite a few are scams
if they're charging $40k per year and their graduation rate is < ~20% i'd think good and hard before signing up
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:14
How's Penn State
Kyle Holm
@thekholm80
Jul 19 2018 15:15
i've never dealt with penn state
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:15
Is it a valid school
IS it a real school
Kyle Holm
@thekholm80
Jul 19 2018 15:16
i'm sure you can google that just as easily as i can
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:16
how do i check that out
yeah well weveryone hs a website these days
May Kittens Devour Your Soul
@diomed
Jul 19 2018 15:17
@thekholm80 I only use these icons
Anand Potukuchi
@anandpotukchi
Jul 19 2018 15:18
the only schools I know are the Ivies , MIT, Stanford, CMU , UC, USC, Northwestern, UF and Georgia Tech
Kyle Holm
@thekholm80
Jul 19 2018 15:18
@diomed i love it
May Kittens Devour Your Soul
@diomed
Jul 19 2018 15:18
their banner gif is worth checking out fully
Alexander R Bott
@Abott1222
Jul 19 2018 16:00
@anandpotukchi If the ivy leagues schools have 100% online programs I would do it but the only one I know of is University of Arizona...
George Tech has an online masters of CS but I dont think they have undergrad online
Anand Potukuchi
@anandpotukchi
Jul 19 2018 16:00
columbia has online programs but they're masters
Alexander R Bott
@Abott1222
Jul 19 2018 16:01
ya thats the problem most of the online programs are graduate level
maybe nyu
Anand Potukuchi
@anandpotukchi
Jul 19 2018 16:08
thanks
i'll check it out
Anand Potukuchi
@anandpotukchi
Jul 19 2018 16:13
one more thing
if i donate, wil this annoying dialog go away?
Christopher McCormack
@cmccormack
Jul 19 2018 16:17
@anandpotukchi I believe so
Kyle Holm
@thekholm80
Jul 19 2018 16:17
Smootimus
@Smootimus
Jul 19 2018 16:28
I know the degrees online exist, I'm saying EH about them lol
Like, I dunno about all that. I dunno about the schools advertising it
Kyle Holm
@thekholm80
Jul 19 2018 16:28
@Smootimus you're just jelly you can't stay home and learn
Smootimus
@Smootimus
Jul 19 2018 16:29
I can sit in front of a computer at home and watch tutorial videos all day without paying X amount of dollars for it
LOL I kinda am
Kyle Holm
@thekholm80
Jul 19 2018 16:29
there are some really shady 'online universities' but there are also good schools that offer online classes
Smootimus
@Smootimus
Jul 19 2018 16:29
I'm sure, it would just be a case of research
Kyle Holm
@thekholm80
Jul 19 2018 16:30
yessir
i just want to know why when i do something on one vm it works, and when i do it on another, identical vm it doesn't
Smootimus
@Smootimus
Jul 19 2018 16:38
Gotta love virtualization
I'm wanting to get a vm up and running for class actually, it's something I've been meaning to do
Kyle Holm
@thekholm80
Jul 19 2018 16:40
i'm a big fan of vmware player
i love that i can create a vm, then just copy and paste it onto other machines
Alexander R Bott
@Abott1222
Jul 19 2018 16:47
i just want to know why when i do something on one vm it works, and when i do it on another, identical vm it doesn't
that right there is why I never would want to get into devops lol
Kyle Holm
@thekholm80
Jul 19 2018 16:47
it's pretty much the entire reason i don't own a hand gun
Alexander R Bott
@Abott1222
Jul 19 2018 16:47
hahahaah
wish I could help man. what are you working on?
Kyle Holm
@thekholm80
Jul 19 2018 16:49
right now i'm doing real, paid work. i was trying to write a bit of python in the vm i use for JS last night but for some reason virtualenv can't find packages after pip installs them
so (╯°□°)╯︵ ┻━┻)
Alexander R Bott
@Abott1222
Jul 19 2018 16:50
ah the path stuff always gave me nightmares
are you using conda by any chance? I know that does a lot of sorcery under the hood
Kyle Holm
@thekholm80
Jul 19 2018 16:50
nah, just py and py3 on debian, with virtualenv for sandboxes
Alexander R Bott
@Abott1222
Jul 19 2018 17:13
WHERE WAS THIS ALL OF MY LIFE
Smootimus
@Smootimus
Jul 19 2018 17:36
Pretty nice
May Kittens Devour Your Soul
@diomed
Jul 19 2018 18:54
@Smootimus got you a sweater bro
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:11
Hello everyone, I am having trouble with this challenge: Using the type attribute selector, try to give the checkboxes in CatPhotoApp a top margin of 10px and a bottom margin of 15px.
Kyle Holm
@thekholm80
Jul 19 2018 19:11
what have you tried?
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:12

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, monospace;
}

p {
font-size: 16px;
font-family: monospace;
}

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

.smaller-image {
width: 100px;
}

.silver-background {
background-color: silver;
}
[type='checkboxes']{
margin-top:10px 0px 15px 0px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<div class="silver-background">
<p>Things cats love:</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>
</div>

<form action="/submit-cat-photo" id="cat-photo-form">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>

Kyle Holm
@thekholm80
Jul 19 2018 19:12
i think you want type='checkbox' not checkboxes
i can't remember if you need input [type=...] as well
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:14
where would i put the input [type
Kyle Holm
@thekholm80
Jul 19 2018 19:15
you would add input before the [type='...'] you already have in your css
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:18
unfortunately, that did not work. Glad you found 'checkboxes' though, thank you
Kyle Holm
@thekholm80
Jul 19 2018 19:18
you also gave 4 parameters to margin-top, where it only takes one
i think you wanted margin
since it takes four paramters
Christopher McCormack
@cmccormack
Jul 19 2018 19:19
@leasingexpert_twitter better to share what you changed then just say it doesn't work, we have no idea if you implemented it properly
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:21
@thekholm80 that was it, thank you!
Kyle Holm
@thekholm80
Jul 19 2018 19:22
:+1:
Dominic Price
@leasingexpert_twitter
Jul 19 2018 19:22
@cmccormack, sorry. I am rookie. but here was where i messed up
image.png
i had initially put
[type='checkboxes'] {
margin-top:10px 0px 15px 0px;
}
Christopher McCormack
@cmccormack
Jul 19 2018 19:24
@leasingexpert_twitter that would do it :) also you can wrap your code with three backticks on their own line to format correctly in gitter:
```
Code
```
will produce
Code
jackeeclifton
@jackeeclifton
Jul 19 2018 19:38
When the viewport is 400px or more, container class should have a grid-template-areas property in which the footer and header areas occupy the top and bottom rows respectively and advert and content occupy the left and right columns of the middle row
Can someone help me please?
Kyle Holm
@thekholm80
Jul 19 2018 19:39
@jackeeclifton can you show your css?
jackeeclifton
@jackeeclifton
Jul 19 2018 19:40

@media (min-width: 400px){
.container{
/ change the code below this line /
grid-template-columns: auto 1fr;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"advert header"
"advert content"
"advert footer";

/* change the code above this line */
}

}

Kyle Holm
@thekholm80
Jul 19 2018 19:40
okay so your top row has 2 columns, in the first column is "advert", the second column is "header"
middle is "advert" in column 1 and "content" in column 2
bottom is "advert" in 1 and "footer" in 2
jackeeclifton
@jackeeclifton
Jul 19 2018 19:41
So do I remove advert from top and bottom row?
Kyle Holm
@thekholm80
Jul 19 2018 19:41
you still need to have something listed for both columns
jackeeclifton
@jackeeclifton
Jul 19 2018 19:42
I am very confused
Kyle Holm
@thekholm80
Jul 19 2018 19:42
so like
"header header"
"advert content"
"footer footer"
then the header fills the top row
advert and content share the middle
and the footer fills the bottom
jackeeclifton
@jackeeclifton
Jul 19 2018 19:43
That makes more sense
Josh Queen
@josh-queen
Jul 19 2018 20:15
Hey guys
I seem to have accidentally disabled the autocomplete feature in the text editor
Anyone know how I turn it back on?
Kyle Holm
@thekholm80
Jul 19 2018 20:24
that's one i've never heard before
Josh Queen
@josh-queen
Jul 19 2018 20:24
Ignore me
I'm being an idiot
Kyle Holm
@thekholm80
Jul 19 2018 20:24
oh lol
i searched github and the forums with no hint of a solution, glad you got it sorted out
Josh Queen
@josh-queen
Jul 19 2018 20:24
God, sorry!
Kyle Holm
@thekholm80
Jul 19 2018 20:24
oh no worries :smile:
Christopher McCormack
@cmccormack
Jul 19 2018 20:33
never seen that spelling of moustache before :D
But I agree I love it too, so much simpler to deal with responsive design
Kyle Holm
@thekholm80
Jul 19 2018 20:34
as long as it matches the element id i guess spelling doesn't matter lol
maybe there's a mustache element, too?
Christopher McCormack
@cmccormack
Jul 19 2018 20:36
haha that's true
Aita Kane
@aita-kane
Jul 19 2018 21:21
hello can someone help me please, i want my .col-right class to have a background-image but nothing appear. I use bootstrap 4.1.2 . Here is my pen: https://codepen.io/akane96/pen/qyOzex
Kyle Holm
@thekholm80
Jul 19 2018 21:29
oh man i'm dumb
Karma Drukpa
@coderkarma
Jul 19 2018 21:30
how @thekholm80
Kyle Holm
@thekholm80
Jul 19 2018 21:31
i've been sitting here trying to figure out what's wrong with one of my vms, because it won't run code that another vm runs fine
turns out i had missed one stupid thing in my code, the vm was fine
feelsBadMan.jpg
Karma Drukpa
@coderkarma
Jul 19 2018 21:32
oh!!
Do you run numerous virtual machine at a time?
Kyle Holm
@thekholm80
Jul 19 2018 21:33
the funny thing is, i sit here every day and deal with people who always say "my code is perfect, the system has a bug" but then it happened to me
sometimes i'll run multiple vms
Karma Drukpa
@coderkarma
Jul 19 2018 21:34
lol....
Christopher McCormack
@cmccormack
Jul 19 2018 21:35
@aita-kane your image url 404s
Karma Drukpa
@coderkarma
Jul 19 2018 21:39
@thekholm80 when we do closures, it calls the function inside right?
Kyle Holm
@thekholm80
Jul 19 2018 21:40
@coderkarma show me an example of what you mean
Aita Kane
@aita-kane
Jul 19 2018 21:40
@cmccormack actually it was just an example but they already helped me . thank you
Karma Drukpa
@coderkarma
Jul 19 2018 21:44
function sorted(a, b){
    function sort(a){
        return   a * a;
    }
    return a + b;
}
@thekholm80
somthing like that
so inner function return inside only right
Kyle Holm
@thekholm80
Jul 19 2018 21:44
your inner function isn't doing anything
it's just taking up space
if you remove it, will the output change in any way?
Karma Drukpa
@coderkarma
Jul 19 2018 21:45
I don't know
Kyle Holm
@thekholm80
Jul 19 2018 21:45
try it?
Karma Drukpa
@coderkarma
Jul 19 2018 21:46
no
it's just returning
a + b
Kyle Holm
@thekholm80
Jul 19 2018 21:46
right
Karma Drukpa
@coderkarma
Jul 19 2018 21:47
when do we basically do closure
then
Kyle Holm
@thekholm80
Jul 19 2018 21:48
now, if you had something like
function foo(a) {
  return function(b) {
    return a + b;
  }
}
const bar = foo(2);
console.log(bar(3)); // should be 5
i didn't test it lol but the inner function should be a closure. been a while since i've read up about them
oh yay it worked lol
Karma Drukpa
@coderkarma
Jul 19 2018 21:50
what const bar doing there?
Kyle Holm
@thekholm80
Jul 19 2018 21:50
in this case i'm using foo() as a function factory, so that bar holds the function created by calling foo()
Smootimus
@Smootimus
Jul 19 2018 21:51
Just constantly holding the results of foo :D
Kyle Holm
@thekholm80
Jul 19 2018 21:52
when const bar = foo(2); is called, that 2 gets passed into the closure, so the only remaining part of the equation is b - which is provided when calling bar(3)
Karma Drukpa
@coderkarma
Jul 19 2018 21:53
and it returns a + b at the very end?
Kyle Holm
@thekholm80
Jul 19 2018 21:53
yes
Karma Drukpa
@coderkarma
Jul 19 2018 21:54
which is the outer functions return ? right.?
Kyle Holm
@thekholm80
Jul 19 2018 21:54
the outer function returns the inner function, with the value of a already set
Karma Drukpa
@coderkarma
Jul 19 2018 21:56
hm...... ok but what if we just called foo at the end rather then assigning variable bar?
oh it just return function, nothing else . wth
Kyle Holm
@thekholm80
Jul 19 2018 21:57
if you just call foo, it will return the inner function with the value of a already set. if you don't catch the return in some way (i caught it by assigning it to bar) then it gets returned and nothing else happens
Kyle Holm
@thekholm80
Jul 19 2018 22:02
the real thing to take away from all of this, is how the inner function has access to a. the big exciting thing about closures (as i understand it, i don't think i've ever actually used one) is that the inner function has access to the lexical scope of the outer function. this is what makes it super useful
it'd probably be good to read up on scope, it's an important topic
Smootimus
@Smootimus
Jul 19 2018 22:09
higher order func
Karma Drukpa
@coderkarma
Jul 19 2018 22:11
ok @thekholm80 thank you
Kyle Holm
@thekholm80
Jul 19 2018 22:13
@Smootimus don't HOFs take a function as an argument?
anyway, headed out for a bit
Smootimus
@Smootimus
Jul 19 2018 22:15
In mathematics and computer science, a higher-order function (also functional, functional form or functor) is a function that does at least one of the following: takes one or more functions as arguments (i.e. procedural parameters), returns a function as its result.
@thekholm80
Fer when ya get back :D
Christopher McCormack
@cmccormack
Jul 19 2018 22:49
Does anyone know where the tests for projects live on FCC's github?
any help?
Henry
@GitHub-Henry
Jul 19 2018 23:32
@TheKetan2 if you'd like to work with someone this is the room for that. If you have a specific question, ask away.